sheetjs/dist/xlsx.min.js

15 lines
403 KiB
JavaScript
Raw Normal View History

/* xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
var XLSX={};(function make_xlsx(XLSX){XLSX.version="0.9.11";var current_codepage=1200,current_cptable;if(typeof module!=="undefined"&&typeof require!=="undefined"){if(typeof cptable==="undefined")cptable=require("./dist/cpexcel.js");current_cptable=cptable[current_codepage]}function reset_cp(){set_cp(1200)}var set_cp=function(cp){current_codepage=cp};function char_codes(data){var o=[];for(var i=0,len=data.length;i<len;++i)o[i]=data.charCodeAt(i);return o}var debom=function(data){var c1=data.charCodeAt(0),c2=data.charCodeAt(1);if(c1==255&&c2==254)return data.substr(2);if(c1==254&&c2==255)return data.substr(2);if(c1==65279)return data.substr(1);return data};var _getchar=function _gc1(x){return String.fromCharCode(x)};if(typeof cptable!=="undefined"){set_cp=function(cp){current_codepage=cp;current_cptable=cptable[cp]};debom=function(data){if(data.charCodeAt(0)===255&&data.charCodeAt(1)===254){return cptable.utils.decode(1200,char_codes(data.substr(2)))}return data};_getchar=function _gc2(x){if(current_codepage===1200)return String.fromCharCode(x);return cptable.utils.decode(current_codepage,[x&255,x>>8])[0]}}var DENSE=null;var Base64=function make_b64(){var map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return{encode:function(input,utf8){var o="";var c1,c2,c3,e1,e2,e3,e4;for(var i=0;i<input.length;){c1=input.charCodeAt(i++);c2=input.charCodeAt(i++);c3=input.charCodeAt(i++);e1=c1>>2;e2=(c1&3)<<4|c2>>4;e3=(c2&15)<<2|c3>>6;e4=c3&63;if(isNaN(c2)){e3=e4=64}else if(isNaN(c3)){e4=64}o+=map.charAt(e1)+map.charAt(e2)+map.charAt(e3)+map.charAt(e4)}return o},decode:function b64_decode(input,utf8){var o="";var c1,c2,c3;var e1,e2,e3,e4;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var i=0;i<input.length;){e1=map.indexOf(input.charAt(i++));e2=map.indexOf(input.charAt(i++));e3=map.indexOf(input.charAt(i++));e4=map.indexOf(input.charAt(i++));c1=e1<<2|e2>>4;c2=(e2&15)<<4|e3>>2;c3=(e3&3)<<6|e4;o+=String.fromCharCode(c1);if(e3!=64){o+=String.fromCharCode(c2)}if(e4!=64){o+=String.fromCharCode(c3)}}return o}}}();var has_buf=typeof Buffer!=="undefined"&&typeof process!=="undefined"&&typeof process.versions!=="undefined"&&process.versions.node;function new_raw_buf(len){return new(has_buf?Buffer:Array)(len)}function s2a(s){if(has_buf)return new Buffer(s,"binary");return s.split("").map(function(x){return x.charCodeAt(0)&255})}var bconcat=function(bufs){return[].concat.apply([],bufs)};var chr0=/\u0000/g,chr1=/[\u0001-\u0006]/;var SSF={};var make_ssf=function make_ssf(SSF){SSF.version="0.9.0";function _strrev(x){var o="",i=x.length-1;while(i>=0)o+=x.charAt(i--);return o}function fill(c,l){var o="";while(o.length<l)o+=c;return o}function pad0(v,d){var t=""+v;return t.length>=d?t:fill("0",d-t.length)+t}function pad_(v,d){var t=""+v;return t.length>=d?t:fill(" ",d-t.length)+t}function rpad_(v,d){var t=""+v;return t.length>=d?t:t+fill(" ",d-t.length)}function pad0r1(v,d){var t=""+Math.round(v);return t.length>=d?t:fill("0",d-t.length)+t}function pad0r2(v,d){var t=""+v;return t.length>=d?t:fill("0",d-t.length)+t}var p2_32=Math.pow(2,32);function pad0r(v,d){if(v>p2_32||v<-p2_32)return pad0r1(v,d);var i=Math.round(v);return pad0r2(i,d)}function isgeneral(s,i){i=i||0;return s.length>=7+i&&(s.charCodeAt(i)|32)===103&&(s.charCodeAt(i+1)|32)===101&&(s.charCodeAt(i+2)|32)===110&&(s.charCodeAt(i+3)|32)===101&&(s.charCodeAt(i+4)|32)===114&&(s.charCodeAt(i+5)|32)===97&&(s.charCodeAt(i+6)|32)===108}var opts_fmt=[["date1904",0],["output",""],["WTF",false]];function fixopts(o){for(var y=0;y!=opts_fmt.length;++y)if(o[opts_fmt[y][0]]===undefined)o[opts_fmt[y][0]]=opts_fmt[y][1]}SSF.opts=opts_fmt;var table_fmt={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"上午/下午 "hh"時"mm"分"ss"秒 "',6553
if(R!==-1&&dad[R]!==R)dad[i]=dad[R]}if(C!==-1)dad[C]=i;if(L!==-1){dad[L]=dad[i];q.push(L)}if(R!==-1){dad[R]=dad[i];q.push(R)}}for(i=1;i!==pl;++i)if(dad[i]===i){if(R!==-1&&dad[R]!==R)dad[i]=dad[R];else if(L!==-1&&dad[L]!==L)dad[i]=dad[L]}for(i=1;i<pl;++i){if(FI[i].type===0)continue;j=dad[i];if(j===0)FP[i]=FP[0]+"/"+FP[i];else while(j!==0){FP[i]=FP[j]+"/"+FP[i];j=dad[j]}dad[i]=0}FP[0]+="/";for(i=1;i<pl;++i){if(FI[i].type!==2)FP[i]+="/";FPD[FP[i]]=FI[i]}}function make_find_path(FullPaths,Paths,FileIndex,files,root_name){var UCFullPaths=new Array(FullPaths.length);var UCPaths=new Array(Paths.length),i;for(i=0;i<FullPaths.length;++i)UCFullPaths[i]=FullPaths[i].toUpperCase().replace(chr0,"").replace(chr1,"!");for(i=0;i<Paths.length;++i)UCPaths[i]=Paths[i].toUpperCase().replace(chr0,"").replace(chr1,"!");return function find_path(path){var k;if(path.charCodeAt(0)===47){k=true;path=root_name+path}else k=path.indexOf("/")!==-1;var UCPath=path.toUpperCase().replace(chr0,"").replace(chr1,"!");var w=k===true?UCFullPaths.indexOf(UCPath):UCPaths.indexOf(UCPath);if(w===-1)return null;return k===true?FileIndex[w]:files[Paths[w]]}}function sleuth_fat(idx,cnt,sectors,ssz,fat_addrs){var q;if(idx===ENDOFCHAIN){if(cnt!==0)throw new Error("DIFAT chain shorter than expected")}else if(idx!==-1){var sector=sectors[idx],m=(ssz>>>2)-1;if(!sector)return;for(var i=0;i<m;++i){if((q=__readInt32LE(sector,i*4))===ENDOFCHAIN)break;fat_addrs.push(q)}sleuth_fat(__readInt32LE(sector,ssz-4),cnt-1,sectors,ssz,fat_addrs)}}function get_sector_list(sectors,start,fat_addrs,ssz,chkd){var sl=sectors.length;var buf,buf_chain;if(!chkd)chkd=new Array(sl);var modulus=ssz-1,j,jj;buf=[];buf_chain=[];for(j=start;j>=0;){chkd[j]=true;buf[buf.length]=j;buf_chain.push(sectors[j]);var addr=fat_addrs[Math.floor(j*4/ssz)];jj=j*4&modulus;if(ssz<4+jj)throw new Error("FAT boundary crossed: "+j+" 4 "+ssz);if(!sectors[addr])break;j=__readInt32LE(sectors[addr],jj)}return{nodes:buf,data:__toBuffer([buf_chain])}}function make_sector_list(sectors,dir_start,fat_addrs,ssz){var sl=sectors.length,sector_list=new Array(sl);var chkd=new Array(sl),buf,buf_chain;var modulus=ssz-1,i,j,k,jj;for(i=0;i<sl;++i){buf=[];k=i+dir_start;if(k>=sl)k-=sl;if(chkd[k]===true)continue;buf_chain=[];for(j=k;j>=0;){chkd[j]=true;buf[buf.length]=j;buf_chain.push(sectors[j]);var addr=fat_addrs[Math.floor(j*4/ssz)];jj=j*4&modulus;if(ssz<4+jj)throw new Error("FAT boundary crossed: "+j+" 4 "+ssz);if(!sectors[addr])break;j=__readInt32LE(sectors[addr],jj)}sector_list[k]={nodes:buf,data:__toBuffer([buf_chain])}}return sector_list}function read_directory(dir_start,sector_list,sectors,Paths,nmfs,files,FileIndex){var blob;var minifat_store=0,pl=Paths.length?2:0;var sector=sector_list[dir_start].data;var i=0,namelen=0,name,o,ctime,mtime;for(;i<sector.length;i+=128){blob=sector.slice(i,i+128);prep_blob(blob,64);namelen=blob.read_shift(2);if(namelen===0)continue;name=__utf16le(blob,0,namelen-pl);Paths.push(name);o={name:name,type:blob.read_shift(1),color:blob.read_shift(1),L:blob.read_shift(4,"i"),R:blob.read_shift(4,"i"),C:blob.read_shift(4,"i"),clsid:blob.read_shift(16),state:blob.read_shift(4,"i")};ctime=blob.read_shift(2)+blob.read_shift(2)+blob.read_shift(2)+blob.read_shift(2);if(ctime!==0){o.ctime=ctime;o.ct=read_date(blob,blob.l-8)}mtime=blob.read_shift(2)+blob.read_shift(2)+blob.read_shift(2)+blob.read_shift(2);if(mtime!==0){o.mtime=mtime;o.mt=read_date(blob,blob.l-8)}o.start=blob.read_shift(4,"i");o.size=blob.read_shift(4,"i");if(o.type===5){minifat_store=o.start;if(nmfs>0&&minifat_store!==ENDOFCHAIN)sector_list[minifat_store].name="!StreamData"}else if(o.size>=4096){o.storage="fat";if(sector_list[o.start]===undefined)sector_list[o.start]=get_sector_list(sectors,o.start,sector_list.fat_addrs,sector_list.ssz);sector_list[o.start].name=o.name;o.content=sector_list[o.start].data.slice(0,o.size);prep_blob(o.content,0)}else{o.storage="minifat";if(minifat_store!==ENDOFCHAIN&&o.start!==ENDOFCHAIN){o.content=sector_list[minifat_store].data.slice(o.start*MSSZ,o.start*MSSZ+o.size);prep_blob(o.content,0)}}files[name]=o;FileIndex.p
var d=data.read_shift(1);data.l++;var out={fItalic:d&2,fStrikeout:d&8,fOutline:d&16,fShadow:d&32,fCondense:d&64,fExtend:d&128};return out}{var VT_EMPTY=0;var VT_NULL=1;var VT_I2=2;var VT_I4=3;var VT_R4=4;var VT_R8=5;var VT_CY=6;var VT_DATE=7;var VT_BSTR=8;var VT_ERROR=10;var VT_BOOL=11;var VT_VARIANT=12;var VT_DECIMAL=14;var VT_I1=16;var VT_UI1=17;var VT_UI2=18;var VT_UI4=19;var VT_I8=20;var VT_UI8=21;var VT_INT=22;var VT_UINT=23;var VT_LPSTR=30;var VT_LPWSTR=31;var VT_FILETIME=64;var VT_BLOB=65;var VT_STREAM=66;var VT_STORAGE=67;var VT_STREAMED_Object=68;var VT_STORED_Object=69;var VT_BLOB_Object=70;var VT_CF=71;var VT_CLSID=72;var VT_VERSIONED_STREAM=73;var VT_VECTOR=4096;var VT_ARRAY=8192;var VT_STRING=80;var VT_USTR=81;var VT_CUSTOM=[VT_STRING,VT_USTR]}var DocSummaryPIDDSI={1:{n:"CodePage",t:VT_I2},2:{n:"Category",t:VT_STRING},3:{n:"PresentationFormat",t:VT_STRING},4:{n:"ByteCount",t:VT_I4},5:{n:"LineCount",t:VT_I4},6:{n:"ParagraphCount",t:VT_I4},7:{n:"SlideCount",t:VT_I4},8:{n:"NoteCount",t:VT_I4},9:{n:"HiddenCount",t:VT_I4},10:{n:"MultimediaClipCount",t:VT_I4},11:{n:"Scale",t:VT_BOOL},12:{n:"HeadingPair",t:VT_VECTOR|VT_VARIANT},13:{n:"DocParts",t:VT_VECTOR|VT_LPSTR},14:{n:"Manager",t:VT_STRING},15:{n:"Company",t:VT_STRING},16:{n:"LinksDirty",t:VT_BOOL},17:{n:"CharacterCount",t:VT_I4},19:{n:"SharedDoc",t:VT_BOOL},22:{n:"HLinksChanged",t:VT_BOOL},23:{n:"AppVersion",t:VT_I4,p:"version"},26:{n:"ContentType",t:VT_STRING},27:{n:"ContentStatus",t:VT_STRING},28:{n:"Language",t:VT_STRING},29:{n:"Version",t:VT_STRING},255:{}};var SummaryPIDSI={1:{n:"CodePage",t:VT_I2},2:{n:"Title",t:VT_STRING},3:{n:"Subject",t:VT_STRING},4:{n:"Author",t:VT_STRING},5:{n:"Keywords",t:VT_STRING},6:{n:"Comments",t:VT_STRING},7:{n:"Template",t:VT_STRING},8:{n:"LastAuthor",t:VT_STRING},9:{n:"RevNumber",t:VT_STRING},10:{n:"EditTime",t:VT_FILETIME},11:{n:"LastPrinted",t:VT_FILETIME},12:{n:"CreatedDate",t:VT_FILETIME},13:{n:"ModifiedDate",t:VT_FILETIME},14:{n:"PageCount",t:VT_I4},15:{n:"WordCount",t:VT_I4},16:{n:"CharCount",t:VT_I4},17:{n:"Thumbnail",t:VT_CF},18:{n:"ApplicationName",t:VT_LPSTR},19:{n:"DocumentSecurity",t:VT_I4},255:{}};var SpecialProperties={2147483648:{n:"Locale",t:VT_UI4},2147483651:{n:"Behavior",t:VT_UI4},1919054434:{}};(function(){for(var y in SpecialProperties)if(SpecialProperties.hasOwnProperty(y))DocSummaryPIDDSI[y]=SummaryPIDSI[y]=SpecialProperties[y]})();var CountryEnum={1:"US",2:"CA",3:"",7:"RU",20:"EG",30:"GR",31:"NL",32:"BE",33:"FR",34:"ES",36:"HU",39:"IT",41:"CH",43:"AT",44:"GB",45:"DK",46:"SE",47:"NO",48:"PL",49:"DE",52:"MX",55:"BR",61:"AU",64:"NZ",66:"TH",81:"JP",82:"KR",84:"VN",86:"CN",90:"TR",105:"JS",213:"DZ",216:"MA",218:"LY",351:"PT",354:"IS",358:"FI",420:"CZ",886:"TW",961:"LB",962:"JO",963:"SY",964:"IQ",965:"KW",966:"SA",971:"AE",972:"IL",974:"QA",981:"IR",65535:"US"};var XLSFillPattern=[null,"solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"];function rgbify(arr){return arr.map(function(x){return[x>>16&255,x>>8&255,x&255]})}var XLSIcv=rgbify([0,16777215,16711680,65280,255,16776960,16711935,65535,0,16777215,16711680,65280,255,16776960,16711935,65535,8388608,32768,128,8421376,8388736,32896,12632256,8421504,10066431,10040166,16777164,13434879,6684774,16744576,26316,13421823,128,16711935,16776960,65535,8388736,8388608,32896,255,52479,13434879,13434828,16777113,10079487,16751052,13408767,16764057,3368703,3394764,10079232,16763904,16750848,16737792,6710937,9868950,13158,3381606,13056,3355392,10040064,10040166,3355545,3355443,16777215,0]);var ct2type={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":"workbooks","application/vnd.ms-excel.binIndexWs":"TODO","application/vnd.ms-excel.intlmacrosheet":"TODO","application/vnd.ms-excel.binIndexMs":"TODO","application/vnd.openxmlformats-package.core-properties+xml":"coreprops","application/vnd.openxmlformats-officedocument.custom-properties+xml":"custprops","application/vnd.ope
var retval;if(opts){if(opts.biff>=2&&opts.biff<=5)return blob.read_shift(cch,"sbcs-cont");if(opts.biff>=12)return blob.read_shift(cch,"dbcs-cont")}var fHighByte=blob.read_shift(1);if(fHighByte===0){retval=blob.read_shift(cch,"sbcs-cont")}else{retval=blob.read_shift(cch,"dbcs-cont")}return retval}function parse_XLUnicodeString(blob,length,opts){var cch=blob.read_shift(opts&&opts.biff==2?1:2);if(cch===0){blob.l++;return""}return parse_XLUnicodeStringNoCch(blob,cch,opts)}function parse_XLUnicodeString2(blob,length,opts){if(opts.biff>5)return parse_XLUnicodeString(blob,length,opts);var cch=blob.read_shift(1);if(cch===0){blob.l++;return""}return blob.read_shift(cch,"sbcs-cont")}var parse_ControlInfo=parsenoop;var parse_URLMoniker=function(blob,length){var len=blob.read_shift(4),start=blob.l;var extra=false;if(len>24){blob.l+=len-24;if(blob.read_shift(16)==="795881f43b1d7f48af2c825dc4852763")extra=true;blob.l=start}var url=blob.read_shift((extra?len-24:len)>>1,"utf16le").replace(chr0,"");if(extra)blob.l+=24;return url};var parse_FileMoniker=function(blob,length){var cAnti=blob.read_shift(2);var ansiLength=blob.read_shift(4);var ansiPath=blob.read_shift(ansiLength,"cstr");var endServer=blob.read_shift(2);var versionNumber=blob.read_shift(2);var cbUnicodePathSize=blob.read_shift(4);if(cbUnicodePathSize===0)return ansiPath.replace(/\\/g,"/");var cbUnicodePathBytes=blob.read_shift(4);var usKeyValue=blob.read_shift(2);var unicodePath=blob.read_shift(cbUnicodePathBytes>>1,"utf16le").replace(chr0,"");return unicodePath};var parse_HyperlinkMoniker=function(blob,length){var clsid=blob.read_shift(16);length-=16;switch(clsid){case"e0c9ea79f9bace118c8200aa004ba90b":return parse_URLMoniker(blob,length);case"0303000000000000c000000000000046":return parse_FileMoniker(blob,length);default:throw new Error("Unsupported Moniker "+clsid)}};var parse_HyperlinkString=function(blob,length){var len=blob.read_shift(4);var o=blob.read_shift(len,"utf16le").replace(chr0,"");return o};var parse_Hyperlink=function(blob,length){var end=blob.l+length;var sVer=blob.read_shift(4);if(sVer!==2)throw new Error("Unrecognized streamVersion: "+sVer);var flags=blob.read_shift(2);blob.l+=2;var displayName,targetFrameName,moniker,oleMoniker,location,guid,fileTime;if(flags&16)displayName=parse_HyperlinkString(blob,end-blob.l);if(flags&128)targetFrameName=parse_HyperlinkString(blob,end-blob.l);if((flags&257)===257)moniker=parse_HyperlinkString(blob,end-blob.l);if((flags&257)===1)oleMoniker=parse_HyperlinkMoniker(blob,end-blob.l);if(flags&8)location=parse_HyperlinkString(blob,end-blob.l);if(flags&32)guid=blob.read_shift(16);if(flags&64)fileTime=parse_FILETIME(blob,8);blob.l=end;var target=targetFrameName||moniker||oleMoniker;if(location)target+="#"+location;return{Target:target}};function parse_LongRGBA(blob,length){var r=blob.read_shift(1),g=blob.read_shift(1),b=blob.read_shift(1),a=blob.read_shift(1);return[r,g,b,a]}function parse_LongRGB(blob,length){var x=parse_LongRGBA(blob,length);x[3]=0;return x}function parse_XLSCell(blob,length){var rw=blob.read_shift(2);var col=blob.read_shift(2);var ixfe=blob.read_shift(2);return{r:rw,c:col,ixfe:ixfe}}function parse_frtHeader(blob){var rt=blob.read_shift(2);var flags=blob.read_shift(2);blob.l+=8;return{type:rt,flags:flags}}function parse_OptXLUnicodeString(blob,length,opts){return length===0?"":parse_XLUnicodeString2(blob,length,opts)}var HIDEOBJENUM=["SHOWALL","SHOWPLACEHOLDER","HIDEALL"];var parse_HideObjEnum=parseuint16;function parse_XTI(blob,length){var iSupBook=blob.read_shift(2),itabFirst=blob.read_shift(2,"i"),itabLast=blob.read_shift(2,"i");return[iSupBook,itabFirst,itabLast]}function parse_RkRec(blob,length){var ixfe=blob.read_shift(2);var RK=parse_RkNumber(blob);return[ixfe,RK]}function parse_AddinUdf(blob,length,opts){blob.l+=4;length-=4;var l=blob.l+length;var udfName=parse_ShortXLUnicodeString(blob,length,opts);var cb=blob.read_shift(2);l-=blob.l;if(cb!==l)throw new Error("Malformed AddinUdf: padding = "+l+" != "+cb);blob.l+=cb;return udfName}function parse_Ref8U(blob,length){var rwFirst=blob.read_shift(2);var rw
}function sylk_to_workbook(str,opts){return sheet_to_workbook(sylk_to_sheet(str,opts),opts)}function write_ws_cell_sylk(cell,ws,R,C,opts){var o="C;Y"+(R+1)+";X"+(C+1)+";K";switch(cell.t){case"n":o+=cell.v;break;case"b":o+=cell.v?"TRUE":"FALSE";break;case"e":o+=cell.w||cell.v;break;case"d":o+='"'+(cell.w||cell.v)+'"';break;case"s":o+='"'+cell.v.replace(/"/g,"")+'"';break}return o}function sheet_to_sylk(ws,opts){var preamble=["ID;PWXL;N;E"],o=[];preamble.push("P;PGeneral");var r=decode_range(ws["!ref"]),cell;var dense=Array.isArray(ws);for(var R=r.s.r;R<=r.e.r;++R){for(var C=r.s.c;C<=r.e.c;++C){var coord=encode_cell({r:R,c:C});cell=dense?(ws[R]||[])[C]:ws[coord];if(!cell||cell.v==null)continue;o.push(write_ws_cell_sylk(cell,ws,R,C,opts))}}preamble.push("F;P0;DG0G8;M255");var RS="\r\n";return preamble.join(RS)+RS+o.join(RS)+RS+"E"+RS}return{to_workbook:sylk_to_workbook,to_sheet:sylk_to_sheet,from_sheet:sheet_to_sylk}}();var DIF=function(){function dif_to_aoa(d,opts){switch(opts.type){case"base64":return dif_to_aoa_str(Base64.decode(d),opts);case"binary":return dif_to_aoa_str(d,opts);case"buffer":return dif_to_aoa_str(d.toString("binary"),opts);case"array":return dif_to_aoa_str(cc2str(d),opts)}throw new Error("Unrecognized type "+opts.type)}function dif_to_aoa_str(str,opts){var records=str.split("\n"),R=-1,C=-1,ri=0,arr=[];for(;ri!==records.length;++ri){if(records[ri].trim()==="BOT"){arr[++R]=[];C=0;continue}if(R<0)continue;var metadata=records[ri].trim().split(",");var type=metadata[0],value=metadata[1];++ri;var data=records[ri].trim();switch(+type){case-1:if(data==="BOT"){arr[++R]=[];C=0;continue}else if(data!=="EOD")throw new Error("Unrecognized DIF special command "+data);break;case 0:if(data==="TRUE")arr[R][C]=true;else if(data==="FALSE")arr[R][C]=false;else if(+value==+value)arr[R][C]=+value;else if(!isNaN(new Date(value).getDate()))arr[R][C]=new Date(value);else arr[R][C]=value;++C;break;case 1:data=data.substr(1,data.length-2);arr[R][C++]=data!==""?data:null;break}if(data==="EOD")break}return arr}function dif_to_sheet(str,opts){return aoa_to_sheet(dif_to_aoa(str,opts),opts)}function dif_to_workbook(str,opts){return sheet_to_workbook(dif_to_sheet(str,opts),opts)}var sheet_to_dif=function(){var push_field=function pf(o,topic,v,n,s){o.push(topic);o.push(v+","+n);o.push('"'+s.replace(/"/g,'""')+'"')};var push_value=function po(o,type,v,s){o.push(type+","+v);o.push(type==1?'"'+s.replace(/"/g,'""')+'"':s)};return function sheet_to_dif(ws,opts){var o=[];var r=decode_range(ws["!ref"]),cell;var dense=Array.isArray(ws);push_field(o,"TABLE",0,1,"sheetjs");push_field(o,"VECTORS",0,r.e.r-r.s.r+1,"");push_field(o,"TUPLES",0,r.e.c-r.s.c+1,"");push_field(o,"DATA",0,0,"");for(var R=r.s.r;R<=r.e.r;++R){push_value(o,-1,0,"BOT");for(var C=r.s.c;C<=r.e.c;++C){var coord=encode_cell({r:R,c:C});cell=dense?(ws[R]||[])[C]:ws[coord];if(!cell||cell.v==null){push_value(o,1,0,"");continue}switch(cell.t){case"n":push_value(o,0,cell.v,"V");break;case"b":push_value(o,0,cell.v?1:0,cell.v?"TRUE":"FALSE");break;case"s":push_value(o,1,0,cell.v);break;default:push_value(o,1,0,"")}}}push_value(o,-1,0,"EOD");var RS="\r\n";var oo=o.join(RS);return oo}}();return{to_workbook:dif_to_workbook,to_sheet:dif_to_sheet,from_sheet:sheet_to_dif}}();var PRN=function(){function set_text_arr(data,arr,R,C){if(data==="TRUE")arr[R][C]=true;else if(data==="FALSE")arr[R][C]=false;else if(data===""){}else if(+data==+data)arr[R][C]=+data;else arr[R][C]=data}function prn_to_aoa_str(f,opts){var arr=[];if(!f||f.length===0)return arr;var lines=f.split(/[\r\n]/);var L=lines.length-1;while(L>=0&&lines[L].length===0)--L;var start=10,idx=0;var R=0;for(;R<=L;++R){idx=lines[R].indexOf(" ");if(idx==-1)idx=lines[R].length;else idx++;start=Math.max(start,idx)}for(R=0;R<=L;++R){arr[R]=[];var C=0;set_text_arr(lines[R].slice(0,start).trim(),arr,R,C);for(C=1;C<=(lines[R].length-start)/10+1;++C)set_text_arr(lines[R].slice(start+(C-1)*10,start+C*10).trim(),arr,R,C)}return arr}function dsv_to_sheet_str(str,opts){var o=opts||{};var sep="";if(DENSE!=null&&o.dense==null)o.dense=DENSE;var ws=o.dense?
}if(y.rgb)font.color.rgb=y.rgb;break;case"<color/>":case"</color>":break;default:if(opts&&opts.WTF)throw new Error("unrecognized "+y[0]+" in fonts")}})}function parse_numFmts(t,styles,opts){styles.NumberFmt=[];var k=keys(SSF._table);for(var i=0;i<k.length;++i)styles.NumberFmt[k[i]]=SSF._table[k[i]];var m=t[0].match(tagregex);if(!m)return;for(i=0;i<m.length;++i){var y=parsexmltag(m[i]);switch(y[0]){case"<numFmts":case"</numFmts>":case"<numFmts/>":case"<numFmts>":break;case"<numFmt":{var f=unescapexml(utf8read(y.formatCode)),j=parseInt(y.numFmtId,10);styles.NumberFmt[j]=f;if(j>0)SSF.load(f,j)}break;case"</numFmt>":break;default:if(opts.WTF)throw new Error("unrecognized "+y[0]+" in numFmts")}}}function write_numFmts(NF,opts){var o=["<numFmts>"];[[5,8],[23,26],[41,44],[50,392]].forEach(function(r){for(var i=r[0];i<=r[1];++i)if(NF[i]!=null)o[o.length]=writextag("numFmt",null,{numFmtId:i,formatCode:escapexml(NF[i])})});if(o.length===1)return"";o[o.length]="</numFmts>";o[0]=writextag("numFmts",null,{count:o.length-2}).replace("/>",">");return o.join("")}function parse_cellXfs(t,styles,opts){styles.CellXf=[];var xf;t[0].match(tagregex).forEach(function(x){var y=parsexmltag(x);switch(y[0]){case"<cellXfs":case"<cellXfs>":case"<cellXfs/>":case"</cellXfs>":break;case"<xf":xf=y;delete xf[0];if(xf.numFmtId)xf.numFmtId=parseInt(xf.numFmtId,10);if(xf.fillId)xf.fillId=parseInt(xf.fillId,10);styles.CellXf.push(xf);break;case"</xf>":break;case"<alignment":case"<alignment/>":var alignment={};if(y.vertical)alignment.vertical=y.vertical;if(y.horizontal)alignment.horizontal=y.horizontal;if(y.textRotation!=null)alignment.textRotation=y.textRotation;if(y.indent)alignment.indent=y.indent;if(y.wrapText)alignment.wrapText=y.wrapText;xf.alignment=alignment;break;case"</alignment>":break;case"<protection":case"</protection>":case"<protection/>":break;case"<extLst":case"</extLst>":break;case"<ext":break;default:if(opts.WTF)throw new Error("unrecognized "+y[0]+" in cellXfs")}})}function write_cellXfs(cellXfs){var o=[];o[o.length]=writextag("cellXfs",null);cellXfs.forEach(function(c){o[o.length]=writextag("xf",null,c)});o[o.length]="</cellXfs>";if(o.length===2)return"";o[0]=writextag("cellXfs",null,{count:o.length-2}).replace("/>",">");return o.join("")}var parse_sty_xml=function make_pstyx(){var numFmtRegex=/<numFmts([^>]*)>.*<\/numFmts>/;var cellXfRegex=/<cellXfs([^>]*)>.*<\/cellXfs>/;var fillsRegex=/<fills([^>]*)>.*<\/fills>/;var fontsRegex=/<fonts([^>]*)>.*<\/fonts>/;var bordersRegex=/<borders([^>]*)>.*<\/borders>/;return function parse_sty_xml(data,themes,opts){var styles={};if(!data)return styles;var t;if(t=data.match(numFmtRegex))parse_numFmts(t,styles,opts);if(t=data.match(fontsRegex))parse_fonts(t,styles,themes,opts);if(t=data.match(fillsRegex))parse_fills(t,styles,themes,opts);if(t=data.match(bordersRegex))parse_borders(t,styles,themes,opts);if(t=data.match(cellXfRegex))parse_cellXfs(t,styles,opts);return styles}}();var STYLES_XML_ROOT=writextag("styleSheet",null,{xmlns:XMLNS.main[0],"xmlns:vt":XMLNS.vt});RELS.STY="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles";function write_sty_xml(wb,opts){var o=[XML_HEADER,STYLES_XML_ROOT],w;if(wb.SSF&&(w=write_numFmts(wb.SSF))!=null)o[o.length]=w;o[o.length]='<fonts count="1"><font><sz val="12"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/></font></fonts>';o[o.length]='<fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills>';o[o.length]='<borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders>';o[o.length]='<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>';if(w=write_cellXfs(opts.cellXfs))o[o.length]=w;o[o.length]='<cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>';o[o.length]='<dxfs count="0"/>';o[o.length]='<tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleMedium4"/>';if(o.length>2){o[o.length]="</styleSheet>";o[1]=o[1].replace("/>
var type=(blob[blob.l++]&96)>>5;var ixti=blob.read_shift(2);var w=8;if(opts)switch(opts.biff){case 5:blob.l+=12;w=6;break;case 12:w=12;break}blob.l+=w;return[type,ixti]}function parse_PtgAreaN(blob,length,opts){var type=(blob[blob.l++]&96)>>5;var area=parse_RgceAreaRel(blob,opts&&opts.biff>8?12:8,opts);return[type,area]}function parse_PtgArray(blob,length,opts){var type=(blob[blob.l++]&96)>>5;blob.l+=opts.biff==2?6:opts.biff==12?14:7;return[type]}function parse_PtgAttrBaxcel(blob,length){var bitSemi=blob[blob.l+1]&1;var bitBaxcel=1;blob.l+=4;return[bitSemi,bitBaxcel]}function parse_PtgAttrChoose(blob,length,opts){blob.l+=2;var offset=blob.read_shift(opts&&opts.biff==2?1:2);var o=[];for(var i=0;i<=offset;++i)o.push(blob.read_shift(opts&&opts.biff==2?1:2));return o}function parse_PtgAttrGoto(blob,length,opts){var bitGoto=blob[blob.l+1]&255?1:0;blob.l+=2;return[bitGoto,blob.read_shift(opts&&opts.biff==2?1:2)]}function parse_PtgAttrIf(blob,length,opts){var bitIf=blob[blob.l+1]&255?1:0;blob.l+=2;return[bitIf,blob.read_shift(opts&&opts.biff==2?1:2)]}function parse_PtgAttrIfError(blob,length){var bitIf=blob[blob.l+1]&255?1:0;blob.l+=2;return[bitIf,blob.read_shift(2)]}function parse_PtgAttrSemi(blob,length,opts){var bitSemi=blob[blob.l+1]&255?1:0;blob.l+=opts&&opts.biff==2?3:4;return[bitSemi]}function parse_PtgAttrSpaceType(blob,length){var type=blob.read_shift(1),cch=blob.read_shift(1);return[type,cch]}function parse_PtgAttrSpace(blob,length){blob.read_shift(2);return parse_PtgAttrSpaceType(blob,2)}function parse_PtgAttrSpaceSemi(blob,length){blob.read_shift(2);return parse_PtgAttrSpaceType(blob,2)}function parse_PtgRef(blob,length,opts){var ptg=blob[blob.l]&31;var type=(blob[blob.l]&96)>>5;blob.l+=1;var loc=parse_RgceLoc(blob,0,opts);return[type,loc]}function parse_PtgRefN(blob,length,opts){var type=(blob[blob.l]&96)>>5;blob.l+=1;var loc=parse_RgceLocRel(blob,0,opts);return[type,loc]}function parse_PtgRef3d(blob,length,opts){var type=(blob[blob.l]&96)>>5;blob.l+=1;var ixti=blob.read_shift(2);var loc=parse_RgceLoc(blob,0,opts);return[type,ixti,loc]}function parse_PtgFunc(blob,length,opts){var ptg=blob[blob.l]&31;var type=(blob[blob.l]&96)>>5;blob.l+=1;var iftab=blob.read_shift(opts&&opts.biff<=3?1:2);return[FtabArgc[iftab],Ftab[iftab],type]}function parse_PtgFuncVar(blob,length,opts){blob.l++;var cparams=blob.read_shift(1),tab=opts&&opts.biff<=3?[0,blob.read_shift(1)]:parsetab(blob);return[cparams,(tab[0]===0?Ftab:Cetab)[tab[1]]]}function parsetab(blob,length){return[blob[blob.l+1]>>7,blob.read_shift(2)&32767]}function parse_PtgAttrSum(blob,length,opts){blob.l+=opts&&opts.biff==2?3:4;return}var parse_PtgConcat=parseread1;function parse_PtgExp(blob,length,opts){blob.l++;if(opts&&opts.biff==12)return[blob.read_shift(4,"i"),0];var row=blob.read_shift(2);var col=blob.read_shift(opts&&opts.biff==2?1:2);return[row,col]}function parse_PtgErr(blob,length){blob.l++;return BErr[blob.read_shift(1)]}function parse_PtgInt(blob,length){blob.l++;return blob.read_shift(2)}function parse_PtgBool(blob,length){blob.l++;return blob.read_shift(1)!==0}function parse_PtgNum(blob,length){blob.l++;return parse_Xnum(blob,8)}function parse_PtgStr(blob,length,opts){blob.l++;return parse_ShortXLUnicodeString(blob,length-1,opts)}function parse_SerAr(blob,biff){var val=[blob.read_shift(1)];if(biff==12)switch(val[0]){case 2:val[0]=4;break;case 4:val[0]=16;break;case 0:val[0]=1;break;case 1:val[0]=2;break}switch(val[0]){case 4:val[1]=parsebool(blob,1)?"TRUE":"FALSE";blob.l+=7;break;case 16:val[1]=BErr[blob[blob.l]];blob.l+=8;break;case 0:blob.l+=8;break;case 1:val[1]=parse_Xnum(blob,8);break;case 2:val[1]=parse_XLUnicodeString2(blob,0,{biff:biff>0&&biff<8?2:biff});break}return val}function parse_PtgExtraMem(blob,cce){var count=blob.read_shift(2);var out=[];for(var i=0;i!=count;++i)out.push(parse_Ref8U(blob,8));return out}function parse_PtgExtraArray(blob,length,opts){var rows=0,cols=0;if(opts.biff==12){rows=blob.read_shift(4);cols=blob.read_shift(4)}else{cols=1+blob.read_shift(1);rows=1+blob.read_shift(2)}if(opts.biff>=2&&opts.biff<8){--rows;if(--cols==0)cols
189:3,190:1,195:3,196:3,197:1,198:1,199:3,201:1,207:4,210:3,211:1,212:2,213:2,214:1,215:1,229:1,230:1,231:1,232:1,233:1,234:1,235:3,244:1,247:4,252:2,257:1,261:1,271:1,273:4,274:2,275:2,276:2,277:3,278:3,279:1,280:3,281:3,282:3,283:1,284:1,285:2,286:4,287:3,288:2,289:4,290:3,291:3,292:3,293:4,294:1,295:3,296:1,297:3,298:1,299:2,300:3,301:3,302:4,303:2,304:2,305:2,306:2,307:2,308:2,309:3,310:2,311:2,312:2,313:2,314:2,315:2,316:4,325:2,326:2,327:2,328:2,331:2,332:2,337:2,342:1,343:1,346:2,347:1,350:4,351:3,352:1,353:2,360:1,368:1,369:1,370:1,371:1,372:1,373:1,374:1,375:1,376:1,377:1,378:1,382:3,385:1,392:1,393:1,396:2,397:2,398:2,399:1,400:1,401:1,402:1,403:1,404:1,405:1,406:1,407:1,408:1,409:1,410:1,414:4,415:1,416:1,417:2,420:1,421:1,422:2,424:1,425:2,426:2,427:2,428:2,430:3,438:3,439:3,440:3,443:2,444:2,445:2,446:2,447:6,448:6,449:2,450:2,464:2,468:3,476:2,479:1,480:2,65535:0};var XLSXFutureFunctions={"_xlfn.ACOT":"ACOT","_xlfn.ACOTH":"ACOTH","_xlfn.AGGREGATE":"AGGREGATE","_xlfn.ARABIC":"ARABIC","_xlfn.AVERAGEIF":"AVERAGEIF","_xlfn.AVERAGEIFS":"AVERAGEIFS","_xlfn.BASE":"BASE","_xlfn.BETA.DIST":"BETA.DIST","_xlfn.BETA.INV":"BETA.INV","_xlfn.BINOM.DIST":"BINOM.DIST","_xlfn.BINOM.DIST.RANGE":"BINOM.DIST.RANGE","_xlfn.BINOM.INV":"BINOM.INV","_xlfn.BITAND":"BITAND","_xlfn.BITLSHIFT":"BITLSHIFT","_xlfn.BITOR":"BITOR","_xlfn.BITRSHIFT":"BITRSHIFT","_xlfn.BITXOR":"BITXOR","_xlfn.CEILING.MATH":"CEILING.MATH","_xlfn.CEILING.PRECISE":"CEILING.PRECISE","_xlfn.CHISQ.DIST":"CHISQ.DIST","_xlfn.CHISQ.DIST.RT":"CHISQ.DIST.RT","_xlfn.CHISQ.INV":"CHISQ.INV","_xlfn.CHISQ.INV.RT":"CHISQ.INV.RT","_xlfn.CHISQ.TEST":"CHISQ.TEST","_xlfn.COMBINA":"COMBINA","_xlfn.CONFIDENCE.NORM":"CONFIDENCE.NORM","_xlfn.CONFIDENCE.T":"CONFIDENCE.T","_xlfn.COT":"COT","_xlfn.COTH":"COTH","_xlfn.COUNTIFS":"COUNTIFS","_xlfn.COVARIANCE.P":"COVARIANCE.P","_xlfn.COVARIANCE.S":"COVARIANCE.S","_xlfn.CSC":"CSC","_xlfn.CSCH":"CSCH","_xlfn.DAYS":"DAYS","_xlfn.DECIMAL":"DECIMAL","_xlfn.ECMA.CEILING":"ECMA.CEILING","_xlfn.ERF.PRECISE":"ERF.PRECISE","_xlfn.ERFC.PRECISE":"ERFC.PRECISE","_xlfn.EXPON.DIST":"EXPON.DIST","_xlfn.F.DIST":"F.DIST","_xlfn.F.DIST.RT":"F.DIST.RT","_xlfn.F.INV":"F.INV","_xlfn.F.INV.RT":"F.INV.RT","_xlfn.F.TEST":"F.TEST","_xlfn.FILTERXML":"FILTERXML","_xlfn.FLOOR.MATH":"FLOOR.MATH","_xlfn.FLOOR.PRECISE":"FLOOR.PRECISE","_xlfn.FORMULATEXT":"FORMULATEXT","_xlfn.GAMMA":"GAMMA","_xlfn.GAMMA.DIST":"GAMMA.DIST","_xlfn.GAMMA.INV":"GAMMA.INV","_xlfn.GAMMALN.PRECISE":"GAMMALN.PRECISE","_xlfn.GAUSS":"GAUSS","_xlfn.HYPGEOM.DIST":"HYPGEOM.DIST","_xlfn.IFNA":"IFNA","_xlfn.IFERROR":"IFERROR","_xlfn.IMCOSH":"IMCOSH","_xlfn.IMCOT":"IMCOT","_xlfn.IMCSC":"IMCSC","_xlfn.IMCSCH":"IMCSCH","_xlfn.IMSEC":"IMSEC","_xlfn.IMSECH":"IMSECH","_xlfn.IMSINH":"IMSINH","_xlfn.IMTAN":"IMTAN","_xlfn.ISFORMULA":"ISFORMULA","_xlfn.ISO.CEILING":"ISO.CEILING","_xlfn.ISOWEEKNUM":"ISOWEEKNUM","_xlfn.LOGNORM.DIST":"LOGNORM.DIST","_xlfn.LOGNORM.INV":"LOGNORM.INV","_xlfn.MODE.MULT":"MODE.MULT","_xlfn.MODE.SNGL":"MODE.SNGL","_xlfn.MUNIT":"MUNIT","_xlfn.NEGBINOM.DIST":"NEGBINOM.DIST","_xlfn.NETWORKDAYS.INTL":"NETWORKDAYS.INTL","_xlfn.NIGBINOM":"NIGBINOM","_xlfn.NORM.DIST":"NORM.DIST","_xlfn.NORM.INV":"NORM.INV","_xlfn.NORM.S.DIST":"NORM.S.DIST","_xlfn.NORM.S.INV":"NORM.S.INV","_xlfn.NUMBERVALUE":"NUMBERVALUE","_xlfn.PDURATION":"PDURATION","_xlfn.PERCENTILE.EXC":"PERCENTILE.EXC","_xlfn.PERCENTILE.INC":"PERCENTILE.INC","_xlfn.PERCENTRANK.EXC":"PERCENTRANK.EXC","_xlfn.PERCENTRANK.INC":"PERCENTRANK.INC","_xlfn.PERMUTATIONA":"PERMUTATIONA","_xlfn.PHI":"PHI","_xlfn.POISSON.DIST":"POISSON.DIST","_xlfn.QUARTILE.EXC":"QUARTILE.EXC","_xlfn.QUARTILE.INC":"QUARTILE.INC","_xlfn.QUERYSTRING":"QUERYSTRING","_xlfn.RANK.AVG":"RANK.AVG","_xlfn.RANK.EQ":"RANK.EQ","_xlfn.RRI":"RRI","_xlfn.SEC":"SEC","_xlfn.SECH":"SECH","_xlfn.SHEET":"SHEET","_xlfn.SHEETS":"SHEETS","_xlfn.SKEW.P":"SKEW.P","_xlfn.STDEV.P":"STDEV.P","_xlfn.STDEV.S":"STDEV.S","_xlfn.SUMIFS":"SUMIFS","_xlfn.T.DIST":"T.DIST","_xlfn.T.DIST.2T":"T.DIST.2T","_xlfn.T.DIST.RT":"T.DIST.RT","_xlfn.T.INV":"T.INV","_xlfn.T.INV.2T":"T.INV.2T","_xlfn.T.TEST":"T.TEST","
o.t="str";write_record(ba,"BrtCellSt",write_BrtCellSt(cell,o))}return;case"n":if(cell.v==(cell.v|0)&&cell.v>-1e3&&cell.v<1e3)write_record(ba,"BrtCellRk",write_BrtCellRk(cell,o));else write_record(ba,"BrtCellReal",write_BrtCellReal(cell,o));if(olddate){cell.t="d";cell.v=olddate}return;case"b":o.t="b";write_record(ba,"BrtCellBool",write_BrtCellBool(cell,o));return;case"e":o.t="e";break}write_record(ba,"BrtCellBlank",write_BrtCellBlank(cell,o))}function write_CELLTABLE(ba,ws,idx,opts,wb){var range=safe_decode_range(ws["!ref"]||"A1"),ref,rr="",cols=[];write_record(ba,"BrtBeginSheetData");var dense=Array.isArray(ws);for(var R=range.s.r;R<=range.e.r;++R){rr=encode_row(R);write_row_header(ba,ws,range,R);for(var C=range.s.c;C<=range.e.c;++C){if(R===range.s.r)cols[C]=encode_col(C);ref=cols[C]+rr;var cell=dense?(ws[R]||[])[C]:ws[ref];if(!cell)continue;write_ws_bin_cell(ba,cell,R,C,opts,ws)}}write_record(ba,"BrtEndSheetData")}function write_MERGECELLS(ba,ws){if(!ws||!ws["!merges"])return;write_record(ba,"BrtBeginMergeCells",write_BrtBeginMergeCells(ws["!merges"].length));ws["!merges"].forEach(function(m){write_record(ba,"BrtMergeCell",write_BrtMergeCell(m))});write_record(ba,"BrtEndMergeCells")}function write_COLINFOS(ba,ws,idx,opts,wb){if(!ws||!ws["!cols"])return;write_record(ba,"BrtBeginColInfos");ws["!cols"].forEach(function(m,i){if(m)write_record(ba,"BrtColInfo",write_BrtColInfo(i,m))});write_record(ba,"BrtEndColInfos")}function write_HLINKS(ba,ws,rels){ws["!links"].forEach(function(l){if(!l[1].Target)return;var rId=add_rels(rels,-1,l[1].Target.replace(/#.*$/,""),RELS.HLINK);write_record(ba,"BrtHLink",write_BrtHLink(l,rId))});delete ws["!links"]}function write_LEGACYDRAWING(ba,ws,idx,rels){if(ws["!comments"].length>0){var rId=add_rels(rels,-1,"../drawings/vmlDrawing"+(idx+1)+".vml",RELS.VML);write_record(ba,"BrtLegacyDrawing",write_RelID("rId"+rId));ws["!legacy"]=rId}}function write_AUTOFILTER(ba,ws){if(!ws["!autofilter"])return;write_record(ba,"BrtBeginAFilter",write_UncheckedRfX(decode_range(ws["!autofilter"].ref)));write_record(ba,"BrtEndAFilter")}function write_SHEETPROTECT(ba,ws){if(!ws["!protect"])return;write_record(ba,"BrtSheetProtection",write_BrtSheetProtection(ws["!protect"]))}function write_ws_bin(idx,opts,wb,rels){var ba=buf_array();var s=wb.SheetNames[idx],ws=wb.Sheets[s]||{};var r=safe_decode_range(ws["!ref"]||"A1");ws["!links"]=[];ws["!comments"]=[];write_record(ba,"BrtBeginSheet");write_record(ba,"BrtWsProp",write_BrtWsProp(s));write_record(ba,"BrtWsDim",write_BrtWsDim(r));write_COLINFOS(ba,ws,idx,opts,wb);write_CELLTABLE(ba,ws,idx,opts,wb);write_SHEETPROTECT(ba,ws);write_AUTOFILTER(ba,ws);write_MERGECELLS(ba,ws);write_HLINKS(ba,ws,rels);if(ws["!margins"])write_record(ba,"BrtMargins",write_BrtMargins(ws["!margins"]));write_LEGACYDRAWING(ba,ws,idx,rels);write_record(ba,"BrtEndSheet");return ba.end()}function parse_numCache(data){var col=[];(data.match(/<c:pt idx="(\d*)">(.*?)<\/c:pt>/gm)||[]).forEach(function(pt){var q=pt.match(/<c:pt idx="(.*?)"><c:v>(.*)<\/c:v><\/c:pt>/);if(!q)return;col[+q[1]]=+q[2]});var nf=unescapexml((data.match(/<c:formatCode>(.*?)<\/c:formatCode>/)||["","General"])[1]);return[col,nf]}function parse_chart(data,name,opts,rels,wb,csheet){var cs=csheet||{"!type":"chart"};if(!data)return csheet;var C=0,R=0,col="A";var refguess={s:{r:2e6,c:2e6},e:{r:0,c:0}};(data.match(/<c:numCache>.*?<\/c:numCache>/gm)||[]).forEach(function(nc){var cache=parse_numCache(nc);refguess.s.r=refguess.s.c=0;refguess.e.c=C;col=encode_col(C);cache[0].forEach(function(n,i){cs[col+encode_row(i)]={t:"n",v:n,z:cache[1]};R=i});if(refguess.e.r<R)refguess.e.r=R;++C});if(C>0)cs["!ref"]=encode_range(refguess);return cs}RELS.CS="http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet";var CS_XML_ROOT=writextag("chartsheet",null,{xmlns:XMLNS.main[0],"xmlns:r":XMLNS.r});function parse_cs_xml(data,opts,rels,wb,themes,styles){if(!data)return data;if(!rels)rels={"!id":{}};var s={"!type":"chart","!chart":null,"!rel":""};var m;if(m=data.match(/drawing r:id="(.*?)"/))s["!rel"]=m[1];if(rels["!id"][s["!rel"]])s["!
if(pagemargins.Top)cursheet["!margins"].top=pagemargins.Top;if(pagemargins.Left)cursheet["!margins"].left=pagemargins.Left;if(pagemargins.Right)cursheet["!margins"].right=pagemargins.Right;if(pagemargins.Bottom)cursheet["!margins"].bottom=pagemargins.Bottom;break;case"Unsynced":break;case"Print":break;case"Panes":break;case"Scale":break;case"Pane":break;case"Number":break;case"Layout":break;case"PageSetup":break;case"Selected":break;case"ProtectObjects":break;case"EnableSelection":break;case"ProtectScenarios":break;case"ValidPrinterInfo":break;case"HorizontalResolution":break;case"VerticalResolution":break;case"NumberofCopies":break;case"ActiveRow":break;case"ActiveCol":break;case"ActivePane":break;case"TopRowVisible":break;case"TopRowBottomPane":break;case"LeftColumnVisible":break;case"LeftColumnRightPane":break;case"FitToPage":break;case"RangeSelection":break;case"PaperSizeIndex":break;case"PageLayoutZoom":break;case"PageBreakZoom":break;case"FilterOn":break;case"DoNotDisplayGridlines":break;case"SplitHorizontal":break;case"SplitVertical":break;case"FreezePanes":break;case"FrozenNoSplit":break;case"FitWidth":break;case"FitHeight":break;case"CommentsLayout":break;case"Zoom":break;case"LeftToRight":break;case"Gridlines":break;case"AllowSort":break;case"AllowFilter":break;case"AllowInsertRows":break;case"AllowDeleteRows":break;case"AllowInsertCols":break;case"AllowDeleteCols":break;case"AllowInsertHyperlinks":break;case"AllowFormatCells":break;case"AllowSizeCols":break;case"AllowSizeRows":break;case"NoSummaryRowsBelowDetail":break;case"TabColorIndex":break;case"DoNotDisplayHeadings":break;case"ShowPageLayoutZoom":break;case"NoSummaryColumnsRightDetail":break;case"BlackAndWhite":break;case"DoNotDisplayZeros":break;case"DisplayPageBreak":break;case"RowColHeadings":break;case"DoNotDisplayOutline":break;case"NoOrientation":break;case"AllowUsePivotTables":break;case"ZeroHeight":break;case"ViewableRange":break;case"Selection":break;case"ProtectContents":break;default:seen=false}break;case"PivotTable":case"PivotCache":switch(Rn[3]){case"ImmediateItemsOnDrop":break;case"ShowPageMultipleItemLabel":break;case"CompactRowIndent":break;case"Location":break;case"PivotField":break;case"Orientation":break;case"LayoutForm":break;case"LayoutSubtotalLocation":break;case"LayoutCompactRow":break;case"Position":break;case"PivotItem":break;case"DataType":break;case"DataField":break;case"SourceName":break;case"ParentField":break;case"PTLineItems":break;case"PTLineItem":break;case"CountOfSameItems":break;case"Item":break;case"ItemType":break;case"PTSource":break;case"CacheIndex":break;case"ConsolidationReference":break;case"FileName":break;case"Reference":break;case"NoColumnGrand":break;case"NoRowGrand":break;case"BlankLineAfterItems":break;case"Hidden":break;case"Subtotal":break;case"BaseField":break;case"MapChildItems":break;case"Function":break;case"RefreshOnFileOpen":break;case"PrintSetTitles":break;case"MergeLabels":break;case"DefaultVersion":break;case"RefreshName":break;case"RefreshDate":break;case"RefreshDateCopy":break;case"VersionLastRefresh":break;case"VersionLastUpdate":break;case"VersionUpdateableMin":break;case"VersionRefreshableMin":break;case"Calculation":break;default:seen=false}break;case"PageBreaks":switch(Rn[3]){case"ColBreaks":break;case"ColBreak":break;case"RowBreaks":break;case"RowBreak":break;case"ColStart":break;case"ColEnd":break;case"RowEnd":break;default:seen=false}break;case"AutoFilter":switch(Rn[3]){case"AutoFilterColumn":break;case"AutoFilterCondition":break;case"AutoFilterAnd":break;case"AutoFilterOr":break;default:seen=false}break;case"QueryTable":switch(Rn[3]){case"Id":break;case"AutoFormatFont":break;case"AutoFormatPattern":break;case"QuerySource":break;case"QueryType":break;case"EnableRedirections":break;case"RefreshedInXl9":break;case"URLString":break;case"HTMLTables":break;case"Connection":break;case"CommandText":break;case"RefreshInfo":break;case"NoTitles":break;case"NextId":break;case"ColumnInfo":break;case"OverwriteCells":break;case"DoNotPromptForFile":break;case"TextWizardSettings":break;case"Source":bre
n:"BrtXF",f:parse_BrtXF},48:{n:"BrtStyle",f:parsenoop},49:{n:"BrtCellMeta",f:parsenoop},50:{n:"BrtValueMeta",f:parsenoop},51:{n:"BrtMdb",f:parsenoop},52:{n:"BrtBeginFmd",f:parsenoop},53:{n:"BrtEndFmd",f:parsenoop},54:{n:"BrtBeginMdx",f:parsenoop},55:{n:"BrtEndMdx",f:parsenoop},56:{n:"BrtBeginMdxTuple",f:parsenoop},57:{n:"BrtEndMdxTuple",f:parsenoop},58:{n:"BrtMdxMbrIstr",f:parsenoop},59:{n:"BrtStr",f:parsenoop},60:{n:"BrtColInfo",f:parse_ColInfo},62:{n:"BrtCellRString",f:parsenoop},63:{n:"BrtCalcChainItem$",f:parse_BrtCalcChainItem$},64:{n:"BrtDVal",f:parsenoop},65:{n:"BrtSxvcellNum",f:parsenoop},66:{n:"BrtSxvcellStr",f:parsenoop},67:{n:"BrtSxvcellBool",f:parsenoop},68:{n:"BrtSxvcellErr",f:parsenoop},69:{n:"BrtSxvcellDate",f:parsenoop},70:{n:"BrtSxvcellNil",f:parsenoop},128:{n:"BrtFileVersion",f:parsenoop},129:{n:"BrtBeginSheet",f:parsenoop},130:{n:"BrtEndSheet",f:parsenoop},131:{n:"BrtBeginBook",f:parsenoop,p:0},132:{n:"BrtEndBook",f:parsenoop},133:{n:"BrtBeginWsViews",f:parsenoop},134:{n:"BrtEndWsViews",f:parsenoop},135:{n:"BrtBeginBookViews",f:parsenoop},136:{n:"BrtEndBookViews",f:parsenoop},137:{n:"BrtBeginWsView",f:parsenoop},138:{n:"BrtEndWsView",f:parsenoop},139:{n:"BrtBeginCsViews",f:parsenoop},140:{n:"BrtEndCsViews",f:parsenoop},141:{n:"BrtBeginCsView",f:parsenoop},142:{n:"BrtEndCsView",f:parsenoop},143:{n:"BrtBeginBundleShs",f:parsenoop},144:{n:"BrtEndBundleShs",f:parsenoop},145:{n:"BrtBeginSheetData",f:parsenoop},146:{n:"BrtEndSheetData",f:parsenoop},147:{n:"BrtWsProp",f:parse_BrtWsProp},148:{n:"BrtWsDim",f:parse_BrtWsDim,p:16},151:{n:"BrtPane",f:parsenoop},152:{n:"BrtSel",f:parsenoop},153:{n:"BrtWbProp",f:parse_BrtWbProp},154:{n:"BrtWbFactoid",f:parsenoop},155:{n:"BrtFileRecover",f:parsenoop},156:{n:"BrtBundleSh",f:parse_BrtBundleSh},157:{n:"BrtCalcProp",f:parsenoop},158:{n:"BrtBookView",f:parsenoop},159:{n:"BrtBeginSst",f:parse_BrtBeginSst},160:{n:"BrtEndSst",f:parsenoop},161:{n:"BrtBeginAFilter",f:parse_UncheckedRfX},162:{n:"BrtEndAFilter",f:parsenoop},163:{n:"BrtBeginFilterColumn",f:parsenoop},164:{n:"BrtEndFilterColumn",f:parsenoop},165:{n:"BrtBeginFilters",f:parsenoop},166:{n:"BrtEndFilters",f:parsenoop},167:{n:"BrtFilter",f:parsenoop},168:{n:"BrtColorFilter",f:parsenoop},169:{n:"BrtIconFilter",f:parsenoop},170:{n:"BrtTop10Filter",f:parsenoop},171:{n:"BrtDynamicFilter",f:parsenoop},172:{n:"BrtBeginCustomFilters",f:parsenoop},173:{n:"BrtEndCustomFilters",f:parsenoop},174:{n:"BrtCustomFilter",f:parsenoop},175:{n:"BrtAFilterDateGroupItem",f:parsenoop},176:{n:"BrtMergeCell",f:parse_BrtMergeCell},177:{n:"BrtBeginMergeCells",f:parsenoop},178:{n:"BrtEndMergeCells",f:parsenoop},179:{n:"BrtBeginPivotCacheDef",f:parsenoop},180:{n:"BrtEndPivotCacheDef",f:parsenoop},181:{n:"BrtBeginPCDFields",f:parsenoop},182:{n:"BrtEndPCDFields",f:parsenoop},183:{n:"BrtBeginPCDField",f:parsenoop},184:{n:"BrtEndPCDField",f:parsenoop},185:{n:"BrtBeginPCDSource",f:parsenoop},186:{n:"BrtEndPCDSource",f:parsenoop},187:{n:"BrtBeginPCDSRange",f:parsenoop},188:{n:"BrtEndPCDSRange",f:parsenoop},189:{n:"BrtBeginPCDFAtbl",f:parsenoop},190:{n:"BrtEndPCDFAtbl",f:parsenoop},191:{n:"BrtBeginPCDIRun",f:parsenoop},192:{n:"BrtEndPCDIRun",f:parsenoop},193:{n:"BrtBeginPivotCacheRecords",f:parsenoop},194:{n:"BrtEndPivotCacheRecords",f:parsenoop},195:{n:"BrtBeginPCDHierarchies",f:parsenoop},196:{n:"BrtEndPCDHierarchies",f:parsenoop},197:{n:"BrtBeginPCDHierarchy",f:parsenoop},198:{n:"BrtEndPCDHierarchy",f:parsenoop},199:{n:"BrtBeginPCDHFieldsUsage",f:parsenoop},200:{n:"BrtEndPCDHFieldsUsage",f:parsenoop},201:{n:"BrtBeginExtConnection",f:parsenoop},202:{n:"BrtEndExtConnection",f:parsenoop},203:{n:"BrtBeginECDbProps",f:parsenoop},204:{n:"BrtEndECDbProps",f:parsenoop},205:{n:"BrtBeginECOlapProps",f:parsenoop},206:{n:"BrtEndECOlapProps",f:parsenoop},207:{n:"BrtBeginPCDSConsol",f:parsenoop},208:{n:"BrtEndPCDSConsol",f:parsenoop},209:{n:"BrtBeginPCDSCPages",f:parsenoop},210:{n:"BrtEndPCDSCPages",f:parsenoop},211:{n:"BrtBeginPCDSCPage",f:parsenoop},212:{n:"BrtEndPCDSCPage",f:parsenoop},213:{n:"BrtBeginPCDSCPItem",f:parsenoop},214:{n:"BrtEndPCDSCPItem",f:parsen
},60:{n:"Continue",f:parse_Continue},61:{n:"Window1",f:parse_Window1},64:{n:"Backup",f:parse_Backup},65:{n:"Pane",f:parse_Pane},66:{n:"CodePage",f:parse_CodePage},77:{n:"Pls",f:parse_Pls},80:{n:"DCon",f:parse_DCon},81:{n:"DConRef",f:parse_DConRef},82:{n:"DConName",f:parse_DConName},85:{n:"DefColWidth",f:parse_DefColWidth},89:{n:"XCT",f:parse_XCT},90:{n:"CRN",f:parse_CRN},91:{n:"FileSharing",f:parse_FileSharing},92:{n:"WriteAccess",f:parse_WriteAccess},93:{n:"Obj",f:parse_Obj},94:{n:"Uncalced",f:parse_Uncalced},95:{n:"CalcSaveRecalc",f:parse_CalcSaveRecalc},96:{n:"Template",f:parse_Template},97:{n:"Intl",f:parse_Intl},99:{n:"ObjProtect",f:parse_ObjProtect},125:{n:"ColInfo",f:parse_ColInfo},128:{n:"Guts",f:parse_Guts},129:{n:"WsBool",f:parse_WsBool},130:{n:"GridSet",f:parse_GridSet},131:{n:"HCenter",f:parse_HCenter},132:{n:"VCenter",f:parse_VCenter},133:{n:"BoundSheet8",f:parse_BoundSheet8},134:{n:"WriteProtect",f:parse_WriteProtect},140:{n:"Country",f:parse_Country},141:{n:"HideObj",f:parse_HideObj},144:{n:"Sort",f:parse_Sort},146:{n:"Palette",f:parse_Palette},151:{n:"Sync",f:parse_Sync},152:{n:"LPr",f:parse_LPr},153:{n:"DxGCol",f:parse_DxGCol},154:{n:"FnGroupName",f:parse_FnGroupName},155:{n:"FilterMode",f:parse_FilterMode},156:{n:"BuiltInFnGroupCount",f:parse_BuiltInFnGroupCount},157:{n:"AutoFilterInfo",f:parse_AutoFilterInfo},158:{n:"AutoFilter",f:parse_AutoFilter},160:{n:"Scl",f:parse_Scl},161:{n:"Setup",f:parse_Setup},174:{n:"ScenMan",f:parse_ScenMan},175:{n:"SCENARIO",f:parse_SCENARIO},176:{n:"SxView",f:parse_SxView},177:{n:"Sxvd",f:parse_Sxvd},178:{n:"SXVI",f:parse_SXVI},180:{n:"SxIvd",f:parse_SxIvd},181:{n:"SXLI",f:parse_SXLI},182:{n:"SXPI",f:parse_SXPI},184:{n:"DocRoute",f:parse_DocRoute},185:{n:"RecipName",f:parse_RecipName},189:{n:"MulRk",f:parse_MulRk},190:{n:"MulBlank",f:parse_MulBlank},193:{n:"Mms",f:parse_Mms},197:{n:"SXDI",f:parse_SXDI},198:{n:"SXDB",f:parse_SXDB},199:{n:"SXFDB",f:parse_SXFDB},200:{n:"SXDBB",f:parse_SXDBB},201:{n:"SXNum",f:parse_SXNum},202:{n:"SxBool",f:parse_SxBool},203:{n:"SxErr",f:parse_SxErr},204:{n:"SXInt",f:parse_SXInt},205:{n:"SXString",f:parse_SXString},206:{n:"SXDtr",f:parse_SXDtr},207:{n:"SxNil",f:parse_SxNil},208:{n:"SXTbl",f:parse_SXTbl},209:{n:"SXTBRGIITM",f:parse_SXTBRGIITM},210:{n:"SxTbpg",f:parse_SxTbpg},211:{n:"ObProj",f:parse_ObProj},213:{n:"SXStreamID",f:parse_SXStreamID},215:{n:"DBCell",f:parse_DBCell},216:{n:"SXRng",f:parse_SXRng},217:{n:"SxIsxoper",f:parse_SxIsxoper},218:{n:"BookBool",f:parse_BookBool},220:{n:"DbOrParamQry",f:parse_DbOrParamQry},221:{n:"ScenarioProtect",f:parse_ScenarioProtect},222:{n:"OleObjectSize",f:parse_OleObjectSize},224:{n:"XF",f:parse_XF},225:{n:"InterfaceHdr",f:parse_InterfaceHdr},226:{n:"InterfaceEnd",f:parse_InterfaceEnd},227:{n:"SXVS",f:parse_SXVS},229:{n:"MergeCells",f:parse_MergeCells},233:{n:"BkHim",f:parse_BkHim},235:{n:"MsoDrawingGroup",f:parse_MsoDrawingGroup},236:{n:"MsoDrawing",f:parse_MsoDrawing},237:{n:"MsoDrawingSelection",f:parse_MsoDrawingSelection},239:{n:"PhoneticInfo",f:parse_PhoneticInfo},240:{n:"SxRule",f:parse_SxRule},241:{n:"SXEx",f:parse_SXEx},242:{n:"SxFilt",f:parse_SxFilt},244:{n:"SxDXF",f:parse_SxDXF},245:{n:"SxItm",f:parse_SxItm},246:{n:"SxName",f:parse_SxName},247:{n:"SxSelect",f:parse_SxSelect},248:{n:"SXPair",f:parse_SXPair},249:{n:"SxFmla",f:parse_SxFmla},251:{n:"SxFormat",f:parse_SxFormat},252:{n:"SST",f:parse_SST},253:{n:"LabelSst",f:parse_LabelSst},255:{n:"ExtSST",f:parse_ExtSST},256:{n:"SXVDEx",f:parse_SXVDEx},259:{n:"SXFormula",f:parse_SXFormula},290:{n:"SXDBEx",f:parse_SXDBEx},311:{n:"RRDInsDel",f:parse_RRDInsDel},312:{n:"RRDHead",f:parse_RRDHead},315:{n:"RRDChgCell",f:parse_RRDChgCell},317:{n:"RRTabId",f:parse_RRTabId},318:{n:"RRDRenSheet",f:parse_RRDRenSheet},319:{n:"RRSort",f:parse_RRSort},320:{n:"RRDMove",f:parse_RRDMove},330:{n:"RRFormat",f:parse_RRFormat},331:{n:"RRAutoFmt",f:parse_RRAutoFmt},333:{n:"RRInsertSh",f:parse_RRInsertSh},334:{n:"RRDMoveBegin",f:parse_RRDMoveBegin},335:{n:"RRDMoveEnd",f:parse_RRDMoveEnd},336:{n:"RRDInsDelBegin",f:parse_RRDInsDelBegin},337:{n:"RRDInsDelEnd",f:parse_RRDInsD
o.push(" <office:body>\n");o.push(" <office:spreadsheet>\n");for(var i=0;i!=wb.SheetNames.length;++i)o.push(write_ws(wb.Sheets[wb.SheetNames[i]],wb,i,opts));o.push(" </office:spreadsheet>\n");o.push(" </office:body>\n");if(opts.bookType=="fods")o.push("</office:document>");else o.push("</office:document-content>");return o.join("")}}();function write_obj_str(factory){return function write_str(wb,o){var idx=0;for(var i=0;i<wb.SheetNames.length;++i)if(wb.SheetNames[i]==o.sheet)idx=i;if(idx==0&&!!o.sheet&&wb.SheetNames[0]!=o.sheet)throw new Error("Sheet not found: "+o.sheet);return factory.from_sheet(wb.Sheets[wb.SheetNames[idx]],o)}}var write_htm_str=write_obj_str(HTML_);var write_csv_str=write_obj_str({from_sheet:sheet_to_csv});var write_slk_str=write_obj_str(SYLK);var write_dif_str=write_obj_str(DIF);var write_prn_str=write_obj_str(PRN);var write_txt_str=write_obj_str({from_sheet:sheet_to_txt});function parse_ods(zip,opts){opts=opts||{};var ods=!!safegetzipfile(zip,"objectdata");if(ods)var manifest=parse_manifest(getzipdata(zip,"META-INF/manifest.xml"),opts);var content=getzipstr(zip,"content.xml");if(!content)throw new Error("Missing content.xml in "+(ods?"ODS":"UOF")+" file");return parse_content_xml(ods?content:utf8read(content),opts)}function parse_fods(data,opts){return parse_content_xml(data,opts)}function write_ods(wb,opts){if(opts.bookType=="fods")return write_content_xml(wb,opts);var zip=new jszip;var f="";var manifest=[];var rdf=[];f="mimetype";zip.file(f,"application/vnd.oasis.opendocument.spreadsheet");f="content.xml";zip.file(f,write_content_xml(wb,opts));manifest.push([f,"text/xml"]);rdf.push([f,"ContentFile"]);f="manifest.rdf";zip.file(f,write_rdf(rdf,opts));manifest.push([f,"application/rdf+xml"]);f="META-INF/manifest.xml";zip.file(f,write_manifest(manifest,opts));return zip}function fix_opts_func(defaults){return function fix_opts(opts){for(var i=0;i!=defaults.length;++i){var d=defaults[i];if(opts[d[0]]===undefined)opts[d[0]]=d[1];if(d[2]==="n")opts[d[0]]=Number(opts[d[0]])}}}var fix_read_opts=fix_opts_func([["cellNF",false],["cellHTML",true],["cellFormula",true],["cellStyles",false],["cellDates",false],["sheetStubs",false],["sheetRows",0,"n"],["bookDeps",false],["bookSheets",false],["bookProps",false],["bookFiles",false],["bookVBA",false],["password",""],["WTF",false]]);var fix_write_opts=fix_opts_func([["cellDates",false],["bookSST",false],["bookType","xlsx"],["compression",false],["WTF",false]]);function get_sheet_type(n){if(RELS.WS.indexOf(n)>-1)return"sheet";if(RELS.CS&&n==RELS.CS)return"chart";if(RELS.DS&&n==RELS.DS)return"dialog";if(RELS.MS&&n==RELS.MS)return"macro";if(!n||!n.length)return"sheet";return n}function safe_parse_wbrels(wbrels,sheets){if(!wbrels)return 0;try{wbrels=sheets.map(function pwbr(w){if(!w.id)w.id=w.strRelID;return[w.name,wbrels["!id"][w.id].Target,get_sheet_type(wbrels["!id"][w.id].Type)]})}catch(e){return null}return!wbrels||wbrels.length===0?null:wbrels}function safe_parse_sheet(zip,path,relsPath,sheet,sheetRels,sheets,stype,opts,wb,themes,styles){try{sheetRels[sheet]=parse_rels(getzipstr(zip,relsPath,true),path);var data=getzipdata(zip,path);switch(stype){case"sheet":sheets[sheet]=parse_ws(data,path,opts,sheetRels[sheet],wb,themes,styles);break;case"chart":var cs=parse_cs(data,path,opts,sheetRels[sheet],wb,themes,styles);sheets[sheet]=cs;if(!cs||!cs["!chart"])break;var dfile=resolve_path(cs["!chart"].Target,path);var drelsp=get_rels_path(dfile);var draw=parse_drawing(getzipstr(zip,dfile,true),parse_rels(getzipstr(zip,drelsp,true),dfile));var chartp=resolve_path(draw,dfile);var crelsp=get_rels_path(chartp);cs=parse_chart(getzipstr(zip,chartp,true),chartp,opts,parse_rels(getzipstr(zip,crelsp,true),chartp),wb,cs);break;case"macro":sheets[sheet]=parse_ms(data,path,opts,sheetRels[sheet],wb,themes,styles);break;case"dialog":sheets[sheet]=parse_ds(data,path,opts,sheetRels[sheet],wb,themes,styles);break}}catch(e){if(opts.WTF)throw e}}var nodirs=function nodirs(x){return x.slice(-1)!="/"};function parse_zip(zip,opts){make_ssf(SSF);opts=opts||{};fix_read_opts(opts);reset_cp