}returnres};exports.findCompression=function(compressionMethod){for(varmethodincompressions){if(!compressions.hasOwnProperty(method)){continue}if(compressions[method].magic===compressionMethod){returncompressions[method]}}returnnull};exports.isRegExp=function(object){returnObject.prototype.toString.call(object)==="[object RegExp]"}},{"./compressions":3,"./nodeBuffer":11,"./support":17}],22:[function(_dereq_,module,exports){"use strict";varStringReader=_dereq_("./stringReader");varNodeBufferReader=_dereq_("./nodeBufferReader");varUint8ArrayReader=_dereq_("./uint8ArrayReader");varutils=_dereq_("./utils");varsig=_dereq_("./signature");varZipEntry=_dereq_("./zipEntry");varsupport=_dereq_("./support");varjszipProto=_dereq_("./object");functionZipEntries(data,loadOptions){this.files=[];this.loadOptions=loadOptions;if(data){this.load(data)}}ZipEntries.prototype={checkSignature:function(expectedSignature){varsignature=this.reader.readString(4);if(signature!==expectedSignature){thrownewError("Corrupted zip or bug : unexpected signature "+"("+utils.pretty(signature)+", expected "+utils.pretty(expectedSignature)+")")}},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2);this.diskWithCentralDirStart=this.reader.readInt(2);this.centralDirRecordsOnThisDisk=this.reader.readInt(2);this.centralDirRecords=this.reader.readInt(2);this.centralDirSize=this.reader.readInt(4);this.centralDirOffset=this.reader.readInt(4);this.zipCommentLength=this.reader.readInt(2);this.zipComment=this.reader.readString(this.zipCommentLength);this.zipComment=jszipProto.utf8decode(this.zipComment)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8);this.versionMadeBy=this.reader.readString(2);this.versionNeeded=this.reader.readInt(2);this.diskNumber=this.reader.readInt(4);this.diskWithCentralDirStart=this.reader.readInt(4);this.centralDirRecordsOnThisDisk=this.reader.readInt(8);this.centralDirRecords=this.reader.readInt(8);this.centralDirSize=this.reader.readInt(8);this.centralDirOffset=this.reader.readInt(8);this.zip64ExtensibleData={};varextraDataSize=this.zip64EndOfCentralSize-44,index=0,extraFieldId,extraFieldLength,extraFieldValue;while(index<extraDataSize){extraFieldId=this.reader.readInt(2);extraFieldLength=this.reader.readInt(4);extraFieldValue=this.reader.readString(extraFieldLength);this.zip64ExtensibleData[extraFieldId]={id:extraFieldId,length:extraFieldLength,value:extraFieldValue}}},readBlockZip64EndOfCentralLocator:function(){this.diskWithZip64CentralDirStart=this.reader.readInt(4);this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8);this.disksCount=this.reader.readInt(4);if(this.disksCount>1){thrownewError("Multi-volumes zip are not supported")}},readLocalFiles:function(){vari,file;for(i=0;i<this.files.length;i++){file=this.files[i];this.reader.setIndex(file.localHeaderOffset);this.checkSignature(sig.LOCAL_FILE_HEADER);file.readLocalPart(this.reader);file.handleUTF8()}},readCentralDir:function(){varfile;this.reader.setIndex(this.centralDirOffset);while(this.reader.readString(4)===sig.CENTRAL_FILE_HEADER){file=newZipEntry({zip64:this.zip64},this.loadOptions);file.readCentralPart(this.reader);this.files.push(file)}},readEndOfCentral:function(){varoffset=this.reader.lastIndexOfSignature(sig.CENTRAL_DIRECTORY_END);if(offset===-1){thrownewError("Corrupted zip : can't find end of central directory")}this.reader.setIndex(offset);this.checkSignature(sig.CENTRAL_DIRECTORY_END);this.readBlockEndOfCentral();if(this.diskNumber===utils.MAX_VALUE_16BITS||this.diskWithCentralDirStart===utils.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===utils.MAX_VALUE_16BITS||this.centralDirRecords===utils.MAX_VALUE_16BITS||this.centralDirSize===utils.MAX_VALUE_32BITS||this.centralDirOffset===utils.MAX_VALUE_32BITS){this.zip64=true;offset=this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR);if(offset===-1){thrownewError("Corrupted zip : can't find the ZIP64 end of central directory locator")}this.reader.setIndex(offset);this.checkSignature(sig.ZIP64_CENTRAL_D
returno}functionparse_VtVector(blob,cb){}functionparse_TypedPropertyValue(blob,type,_opts){vart=blob.read_shift(2),ret,opts=_opts||{};blob.l+=2;if(type!==VT_VARIANT)if(t!==type&&VT_CUSTOM.indexOf(type)===-1)thrownewError("Expected type "+type+" saw "+t);switch(type===VT_VARIANT?t:type){case2:ret=blob.read_shift(2,"i");if(!opts.raw)blob.l+=2;returnret;case3:ret=blob.read_shift(4,"i");returnret;case11:returnblob.read_shift(4)!==0;case19:ret=blob.read_shift(4);returnret;case30:returnparse_lpstr(blob,t,4).replace(chr0,"");case31:returnparse_lpwstr(blob);case64:returnparse_FILETIME(blob);case65:returnparse_BLOB(blob);case71:returnparse_ClipboardData(blob);case80:returnparse_VtString(blob,t,!opts.raw&&4).replace(chr0,"");case81:returnparse_VtUnalignedString(blob,t,4).replace(chr0,"");case4108:returnparse_VtVecHeadingPair(blob);case4126:returnparse_VtVecUnalignedLpstr(blob);default:thrownewError("TypedPropertyValue unrecognized type "+type+" "+t)}}functionparse_PropertySet(blob,PIDSI){varstart_addr=blob.l;varsize=blob.read_shift(4);varNumProps=blob.read_shift(4);varProps=[],i=0;varCodePage=0;varDictionary=-1,DictObj={};for(i=0;i!=NumProps;++i){varPropID=blob.read_shift(4);varOffset=blob.read_shift(4);Props[i]=[PropID,Offset+start_addr]}varPropH={};for(i=0;i!=NumProps;++i){if(blob.l!==Props[i][1]){varfail=true;if(i>0&&PIDSI)switch(PIDSI[Props[i-1][0]].t){case2:if(blob.l+2===Props[i][1]){blob.l+=2;fail=false}break;case80:if(blob.l<=Props[i][1]){blob.l=Props[i][1];fail=false}break;case4108:if(blob.l<=Props[i][1]){blob.l=Props[i][1];fail=false}break}if(!PIDSI&&blob.l<=Props[i][1]){fail=false;blob.l=Props[i][1]}if(fail)thrownewError("Read Error: Expected address "+Props[i][1]+" at "+blob.l+" :"+i)}if(PIDSI){varpiddsi=PIDSI[Props[i][0]];PropH[piddsi.n]=parse_TypedPropertyValue(blob,piddsi.t,{raw:true});if(piddsi.p==="version")PropH[piddsi.n]=String(PropH[piddsi.n]>>16)+"."+String(PropH[piddsi.n]&65535);if(piddsi.n=="CodePage")switch(PropH[piddsi.n]){case0:PropH[piddsi.n]=1252;case1e4:case1252:case874:case1250:case1251:case1253:case1254:case1255:case1256:case1257:case1258:case932:case936:case949:case950:case1200:case1201:case65e3:case-536:case65001:case-535:set_cp(CodePage=PropH[piddsi.n]);break;default:thrownewError("Unsupported CodePage: "+PropH[piddsi.n])}}else{if(Props[i][0]===1){CodePage=PropH.CodePage=parse_TypedPropertyValue(blob,VT_I2);set_cp(CodePage);if(Dictionary!==-1){varoldpos=blob.l;blob.l=Props[Dictionary][1];DictObj=parse_dictionary(blob,CodePage);blob.l=oldpos}}elseif(Props[i][0]===0){if(CodePage===0){Dictionary=i;blob.l=Props[i+1][1];continue}DictObj=parse_dictionary(blob,CodePage)}else{varname=DictObj[Props[i][0]];varval;switch(blob[blob.l]){case65:blob.l+=4;val=parse_BLOB(blob);break;case30:blob.l+=4;val=parse_VtString(blob,blob[blob.l-4]);break;case31:blob.l+=4;val=parse_VtString(blob,blob[blob.l-4]);break;case3:blob.l+=4;val=blob.read_shift(4,"i");break;case19:blob.l+=4;val=blob.read_shift(4);break;case5:blob.l+=4;val=blob.read_shift(8,"f");break;case11:blob.l+=4;val=parsebool(blob,4);break;case64:blob.l+=4;val=newDate(parse_FILETIME(blob));break;default:thrownewError("unparsed value: "+blob[blob.l])}PropH[name]=val}}}blob.l=start_addr+size;returnPropH}functionparse_PropertySetStream(file,PIDSI){varblob=file.content;prep_blob(blob,0);varNumSets,FMTID0,FMTID1,Offset0,Offset1=0;blob.chk("feff","Byte Order: ");varvers=blob.read_shift(2);varSystemIdentifier=blob.read_shift(4);blob.chk(CFB.utils.consts.HEADER_CLSID,"CLSID: ");NumSets=blob.read_shift(4);if(NumSets!==1&&NumSets!==2)throw"Unrecognized #Sets: "+NumSets;FMTID0=blob.read_shift(16);Offset0=blob.read_shift(4);if(NumSets===1&&Offset0!==blob.l)throw"Length mismatch";elseif(NumSets===2){FMTID1=blob.read_shift(16);Offset1=blob.read_shift(4)}varPSet0=parse_PropertySet(blob,PIDSI);varrval={SystemIdentifier:SystemIdentifier};for(varyinPSet0)rval[y]=PSet0[y];rval.FMTID=FMTID0;if(NumSets===1)returnrval;if(blob.l!==Offset1)thrownewError("Length mismatch 2: "+blob.l+"
break;case"<color":if(y.rgb)font.color=y.rgb.substr(2,6);break;case"<family":font.family=y.val;break;case"<vertAlign":break;case"<scheme":break;default:if(y[0].charCodeAt(1)!==47)throw"Unrecognized rich format "+y[0]}}varstyle=[];if(font.b)style.push("font-weight: bold;");if(font.i)style.push("font-style: italic;");intro.push('<span style="'+style.join("")+'">');outro.push("</span>");returncp};functionparse_r(r){varterms=[[],"",[]];vart=r.match(tregex),cp=65001;if(!isval(t))return"";terms[1]=t[1];varrpr=r.match(rpregex);if(isval(rpr))cp=parse_rpr(rpr[1],terms[0],terms[2]);returnterms[0].join("")+terms[1].replace(nlregex,"<br/>")+terms[2].join("")}returnfunctionparse_rs(rs){returnrs.replace(rregex,"").split(rend).map(parse_r).join("")}}();varsitregex=/<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g,sirregex=/<(?:\w+:)?r>/;varsirphregex=/<(?:\w+:)?rPh.*?>(.*?)<\/(?:\w+:)?rPh>/g;functionparse_si(x,opts){varhtml=opts?opts.cellHTML:true;varz={};if(!x)returnnull;vary;if(x.match(/^\s*<(?:\w+:)?t[^>]*>/)){z.t=utf8read(unescapexml(x.substr(x.indexOf(">")+1).split(/<\/(?:\w+:)?t>/)[0]));z.r=utf8read(x);if(html)z.h=z.t}elseif(y=x.match(sirregex)){z.r=utf8read(x);z.t=utf8read(unescapexml((x.replace(sirphregex,"").match(sitregex)||[]).join("").replace(tagregex,"")));if(html)z.h=parse_rs(z.r)}returnz}varsstr0=/<(?:\w+:)?sst([^>]*)>([\s\S]*)<\/(?:\w+:)?sst>/;varsstr1=/<(?:\w+:)?(?:si|sstItem)>/g;varsstr2=/<\/(?:\w+:)?(?:si|sstItem)>/;functionparse_sst_xml(data,opts){vars=[],ss="";if(!data)returns;varsst=data.match(sstr0);if(isval(sst)){ss=sst[2].replace(sstr1,"").split(sstr2);for(vari=0;i!=ss.length;++i){varo=parse_si(ss[i].trim(),opts);if(o!=null)s[s.length]=o}sst=parsexmltag(sst[1]);s.Count=sst.count;s.Unique=sst.uniqueCount}returns}RELS.SST="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings";varstraywsregex=/^\s|\s$|[\t\n\r]/;functionwrite_sst_xml(sst,opts){if(!opts.bookSST)return"";varo=[XML_HEADER];o[o.length]=writextag("sst",null,{xmlns:XMLNS.main[0],count:sst.Count,uniqueCount:sst.Unique});for(vari=0;i!=sst.length;++i){if(sst[i]==null)continue;vars=sst[i];varsitag="<si>";if(s.r)sitag+=s.r;else{sitag+="<t";if(s.t.match(straywsregex))sitag+=' xml:space="preserve"';sitag+=">"+escapexml(s.t)+"</t>"}sitag+="</si>";o[o.length]=sitag}if(o.length>2){o[o.length]="</sst>";o[1]=o[1].replace("/>",">")}returno.join("")}functionparse_BrtBeginSst(data,length){return[data.read_shift(4),data.read_shift(4)]}functionparse_sst_bin(data,opts){vars=[];varpass=false;recordhopper(data,functionhopper_sst(val,R,RT){switch(R.n){case"BrtBeginSst":s.Count=val[0];s.Unique=val[1];break;case"BrtSSTItem":s.push(val);break;case"BrtEndSst":returntrue;case"BrtFRTBegin":pass=true;break;case"BrtFRTEnd":pass=false;break;default:if(!pass||opts.WTF)thrownewError("Unexpected record "+RT+" "+R.n)}});returns}functionwrite_BrtBeginSst(sst,o){if(!o)o=new_buf(8);o.write_shift(4,sst.Count);o.write_shift(4,sst.Unique);returno}varwrite_BrtSSTItem=write_RichStr;functionwrite_sst_bin(sst,opts){varba=buf_array();write_record(ba,"BrtBeginSst",write_BrtBeginSst(sst));for(vari=0;i<sst.length;++i)write_record(ba,"BrtSSTItem",write_BrtSSTItem(sst[i]));write_record(ba,"BrtEndSst");returnba.end()}function_JS2ANSI(str){if(typeofcptable!=="undefined")returncptable.utils.encode(1252,str);varo=[],oo=str.split("");for(vari=0;i<oo.length;++i)o[i]=oo[i].charCodeAt(0);returno}functionparse_Version(blob,length){varo={};o.Major=blob.read_shift(2);o.Minor=blob.read_shift(2);returno}functionparse_EncryptionHeader(blob,length){varo={};o.Flags=blob.read_shift(4);vartmp=blob.read_shift(4);if(tmp!==0)throw"Unrecognized SizeExtra: "+tmp;o.AlgID=blob.read_shift(4);switch(o.AlgID){case0:case26625:case26126:case26127:case26128:break;default:throw"Unrecognized encryption algorithm: "+o.AlgID}parsenoop(blob,length-12);returno}functionparse_EncryptionVerifier(blob,length){returnparsenoop(blob,length)}functionparse_RC4CryptoHeader(blob,length){varo={};varvers=o.EncryptionVersionInfo=parse_Version(blob,4);length-
(data.match(tagregex)||[]).forEach(function(x){vary=parsexmltag(x);switch(y[0]){case"<?xml":break;case"<calcChain":case"<calcChain>":case"</calcChain>":break;case"<c":deletey[0];if(y.i)i=y.i;elsey.i=i;d.push(y);break}});returnd}functionwrite_cc_xml(data,opts){}functionparse_BrtCalcChainItem$(data,length){varout={};out.i=data.read_shift(4);varcell={};cell.r=data.read_shift(4);cell.c=data.read_shift(4);out.r=encode_cell(cell);varflags=data.read_shift(1);if(flags&2)out.l="1";if(flags&8)out.a="1";returnout}functionparse_cc_bin(data,opts){varout=[];varpass=false;recordhopper(data,functionhopper_cc(val,R,RT){switch(R.n){case"BrtCalcChainItem$":out.push(val);break;case"BrtBeginCalcChain$":break;case"BrtEndCalcChain$":break;default:if(!pass||opts.WTF)thrownewError("Unexpected record "+RT+" "+R.n)}});returnout}functionwrite_cc_bin(data,opts){}functionparse_comments(zip,dirComments,sheets,sheetRels,opts){for(vari=0;i!=dirComments.length;++i){varcanonicalpath=dirComments[i];varcomments=parse_cmnt(getzipdata(zip,canonicalpath.replace(/^\//,""),true),canonicalpath,opts);if(!comments||!comments.length)continue;varsheetNames=keys(sheets);for(varj=0;j!=sheetNames.length;++j){varsheetName=sheetNames[j];varrels=sheetRels[sheetName];if(rels){varrel=rels[canonicalpath];if(rel)insertCommentsIntoSheet(sheetName,sheets[sheetName],comments)}}}}functioninsertCommentsIntoSheet(sheetName,sheet,comments){comments.forEach(function(comment){varcell=sheet[comment.ref];if(!cell){cell={};sheet[comment.ref]=cell;varrange=safe_decode_range(sheet["!ref"]||"BDWGO1000001:A1");varthisCell=decode_cell(comment.ref);if(range.s.r>thisCell.r)range.s.r=thisCell.r;if(range.e.r<thisCell.r)range.e.r=thisCell.r;if(range.s.c>thisCell.c)range.s.c=thisCell.c;if(range.e.c<thisCell.c)range.e.c=thisCell.c;varencoded=encode_range(range);if(encoded!==sheet["!ref"])sheet["!ref"]=encoded}if(!cell.c)cell.c=[];varo={a:comment.author,t:comment.t,r:comment.r};if(comment.h)o.h=comment.h;cell.c.push(o)})}functionparse_comments_xml(data,opts){if(data.match(/<(?:\w+:)?comments *\/>/))return[];varauthors=[];varcommentList=[];varauthtag=data.match(/<(?:\w+:)?authors>([^\u2603]*)<\/(?:\w+:)?authors>/);if(authtag&&authtag[1])authtag[1].split(/<\/\w*:?author>/).forEach(function(x){if(x===""||x.trim()==="")return;vara=x.match(/<(?:\w+:)?author[^>]*>(.*)/);if(a)authors.push(a[1])});varcmnttag=data.match(/<(?:\w+:)?commentList>([^\u2603]*)<\/(?:\w+:)?commentList>/);if(cmnttag&&cmnttag[1])cmnttag[1].split(/<\/\w*:?comment>/).forEach(function(x,index){if(x===""||x.trim()==="")return;varcm=x.match(/<(?:\w+:)?comment[^>]*>/);if(!cm)return;vary=parsexmltag(cm[0]);varcomment={author:y.authorId&&authors[y.authorId]?authors[y.authorId]:undefined,ref:y.ref,guid:y.guid};varcell=decode_cell(y.ref);if(opts.sheetRows&&opts.sheetRows<=cell.r)return;vartextMatch=x.match(/<(?:\w+:)?text>([^\u2603]*)<\/(?:\w+:)?text>/);if(!textMatch||!textMatch[1])return;varrt=parse_si(textMatch[1]);if(!rt)return;comment.r=rt.r;comment.t=rt.t;if(opts.cellHTML)comment.h=rt.h;commentList.push(comment)});returncommentList}functionwrite_comments_xml(data,opts){}functionparse_BrtBeginComment(data,length){varout={};out.iauthor=data.read_shift(4);varrfx=parse_UncheckedRfX(data,16);out.rfx=rfx.s;out.ref=encode_cell(rfx.s);data.l+=16;returnout}varparse_BrtCommentAuthor=parse_XLWideString;varparse_BrtCommentText=parse_RichStr;functionparse_comments_bin(data,opts){varout=[];varauthors=[];varc={};varpass=false;recordhopper(data,functionhopper_cmnt(val,R,RT){switch(R.n){case"BrtCommentAuthor":authors.push(val);break;case"BrtBeginComment":c=val;break;case"BrtCommentText":c.t=val.t;c.h=val.h;c.r=val.r;break;case"BrtEndComment":c.author=authors[c.iauthor];deletec.iauthor;if(opts.sheetRows&&opts.sheetRows<=c.rfx.r)break;deletec.rfx;out.push(c);break;case"BrtBeginComments":break;case"BrtEndComments":break;case"BrtBeginCommentAuthors":break;case"BrtEndCommentAuthors":break;case"BrtBeginCommentList":break;case"BrtEndCommentList":break;default:if(!pass||opts.WTF)thrownewError("Unexpect
break;case"BrtEndCellSmartTags":break;case"BrtEndSmartTags":break;case"BrtBeginCellWatches":break;case"BrtCellWatch":break;case"BrtEndCellWatches":break;case"BrtTable":break;case"BrtBeginCellIgnoreECs":break;case"BrtCellIgnoreEC":break;case"BrtEndCellIgnoreECs":break;default:if(!pass||opts.WTF)thrownewError("Unexpected record "+Record.n)}},opts);deleteopts.supbooks;deleteopts["!row"];if(!s["!ref"]&&(refguess.s.r<2e6||ref&&(ref.e.r>0||ref.e.c>0||ref.s.r>0||ref.s.c>0)))s["!ref"]=encode_range(ref||refguess);if(opts.sheetRows&&s["!ref"]){vartmpref=safe_decode_range(s["!ref"]);if(opts.sheetRows<+tmpref.e.r){tmpref.e.r=opts.sheetRows-1;if(tmpref.e.r>refguess.e.r)tmpref.e.r=refguess.e.r;if(tmpref.e.r<tmpref.s.r)tmpref.s.r=tmpref.e.r;if(tmpref.e.c>refguess.e.c)tmpref.e.c=refguess.e.c;if(tmpref.e.c<tmpref.s.c)tmpref.s.c=tmpref.e.c;s["!fullref"]=s["!ref"];s["!ref"]=encode_range(tmpref)}}if(mergecells.length>0)s["!merges"]=mergecells;returns}functionwrite_ws_bin_cell(ba,cell,R,C,opts){if(cell.v===undefined)return"";varvv="";switch(cell.t){case"b":vv=cell.v?"1":"0";break;case"n":case"e":vv=""+cell.v;break;default:vv=cell.v;break}varo={r:R,c:C};switch(cell.t){case"s":case"str":if(opts.bookSST){vv=get_sst_id(opts.Strings,cell.v);o.t="s";o.v=vv;write_record(ba,"BrtCellIsst",write_BrtCellIsst(cell,o))}else{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));elsewrite_record(ba,"BrtCellReal",write_BrtCellReal(cell,o));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))}functionwrite_CELLTABLE(ba,ws,idx,opts,wb){varrange=safe_decode_range(ws["!ref"]||"A1"),ref,rr="",cols=[];write_record(ba,"BrtBeginSheetData");for(varR=range.s.r;R<=range.e.r;++R){rr=encode_row(R);write_row_header(ba,ws,range,R);for(varC=range.s.c;C<=range.e.c;++C){if(R===range.s.r)cols[C]=encode_col(C);ref=cols[C]+rr;if(!ws[ref])continue;write_ws_bin_cell(ba,ws[ref],R,C,opts)}}write_record(ba,"BrtEndSheetData")}functionwrite_ws_bin(idx,opts,wb){varba=buf_array();vars=wb.SheetNames[idx],ws=wb.Sheets[s]||{};varr=safe_decode_range(ws["!ref"]||"A1");write_record(ba,"BrtBeginSheet");write_record(ba,"BrtWsDim",write_BrtWsDim(r));write_CELLTABLE(ba,ws,idx,opts,wb);write_record(ba,"BrtEndSheet");returnba.end()}varWBPropsDef=[["allowRefreshQuery","0"],["autoCompressPictures","1"],["backupFile","0"],["checkCompatibility","0"],["codeName",""],["date1904","0"],["dateCompatibility","1"],["filterPrivacy","0"],["hidePivotFieldList","0"],["promptedSolutions","0"],["publishItems","0"],["refreshAllConnections",false],["saveExternalLinkValues","1"],["showBorderUnselectedTables","1"],["showInkAnnotation","1"],["showObjects","all"],["showPivotChartFilter","0"]];varWBViewDef=[["activeTab","0"],["autoFilterDateGrouping","1"],["firstSheet","0"],["minimized","0"],["showHorizontalScroll","1"],["showSheetTabs","1"],["showVerticalScroll","1"],["tabRatio","600"],["visibility","visible"]];varSheetDef=[["state","visible"]];varCalcPrDef=[["calcCompleted","true"],["calcMode","auto"],["calcOnSave","true"],["concurrentCalc","true"],["fullCalcOnLoad","false"],["fullPrecision","true"],["iterate","false"],["iterateCount","100"],["iterateDelta","0.001"],["refMode","A1"]];varCustomWBViewDef=[["autoUpdate","false"],["changesSavedWin","false"],["includeHiddenRowCol","true"],["includePrintSettings","true"],["maximized","false"],["minimized","false"],["onlySync","false"],["personalView","false"],["showComments","commIndicator"],["showFormulaBar","true"],["showHorizontalScroll","true"],["showObjects","all"],["showSheetTabs","true"],["showStatusbar","true"],["showVerticalScroll","true"],["tabRatio","600"],["xWindow","0"],["yWindow","0"]];functionpush_defaults_array(target,defaults){for(varj=0;j!=target.length;++j){varw=target[j];for(vari=0;i!=defaults.length;++i){varz=defaults[i];if(w[z[0]]==null)w[z[0]]=z[1]}}}functionpush_defaults(target,defaults)
date1904:!!date1904});if(opts.cellNF)p.z=SSF._table[fmtid]}catch(e){if(opts.WTF)throwe}}functionmake_cell(val,ixfe,t){return{v:val,ixfe:ixfe,t:t}}functionparse_workbook(blob,options){varwb={opts:{}};varSheets={};varout={};varDirectory={};varfound_sheet=false;varrange={};varlast_formula=null;varsst=[];varcur_sheet="";varPreamble={};varlastcell,last_cell="",cc,cmnt,rng,rngC,rngR;varshared_formulae={};vararray_formulae=[];vartemp_val;varcountry;varcell_valid=true;varXFs=[];varpalette=[];varget_rgb=functiongetrgb(icv){if(icv<8)returnXLSIcv[icv];if(icv<64)returnpalette[icv-8]||XLSIcv[icv];returnXLSIcv[icv]};varprocess_cell_style=functionpcs(cell,line){varxfd=line.XF.data;if(!xfd||!xfd.patternType)return;line.s={};line.s.patternType=xfd.patternType;vart;if(t=rgb2Hex(get_rgb(xfd.icvFore))){line.s.fgColor={rgb:t}}if(t=rgb2Hex(get_rgb(xfd.icvBack))){line.s.bgColor={rgb:t}}};varaddcell=functionaddcell(cell,line,options){if(!cell_valid)return;if(options.cellStyles&&line.XF&&line.XF.data)process_cell_style(cell,line);lastcell=cell;last_cell=encode_cell(cell);if(range.s){if(cell.r<range.s.r)range.s.r=cell.r;if(cell.c<range.s.c)range.s.c=cell.c}if(range.e){if(cell.r+1>range.e.r)range.e.r=cell.r+1;if(cell.c+1>range.e.c)range.e.c=cell.c+1}if(options.sheetRows&&lastcell.r>=options.sheetRows)cell_valid=false;elseout[last_cell]=line};varopts={enc:false,sbcch:0,snames:[],sharedf:shared_formulae,arrayf:array_formulae,rrtabid:[],lastuser:"",biff:8,codepage:0,winlocked:0,wtf:false};if(options.password)opts.password=options.password;varmergecells=[];varobjects=[];varsupbooks=[[]];varsbc=0,sbci=0,sbcli=0;supbooks.SheetNames=opts.snames;supbooks.sharedf=opts.sharedf;supbooks.arrayf=opts.arrayf;varlast_Rn="";varfile_depth=0;varBIFF2Fmt=0;opts.codepage=1200;set_cp(1200);while(blob.l<blob.length-1){vars=blob.l;varRecordType=blob.read_shift(2);if(RecordType===0&&last_Rn==="EOF")break;varlength=blob.l===blob.length?0:blob.read_shift(2),y;varR=XLSRecordEnum[RecordType];if(R&&R.f){if(options.bookSheets){if(last_Rn==="BoundSheet8"&&R.n!=="BoundSheet8")break}last_Rn=R.n;if(R.r===2||R.r==12){varrt=blob.read_shift(2);length-=2;if(!opts.enc&&rt!==RecordType)throw"rt mismatch";if(R.r==12){blob.l+=10;length-=10}}varval;if(R.n==="EOF")val=R.f(blob,length,opts);elseval=slurp(R,blob,length,opts);varRn=R.n;switch(Rn){case"Date1904":wb.opts.Date1904=val;break;case"WriteProtect":wb.opts.WriteProtect=true;break;case"FilePass":if(!opts.enc)blob.l=0;opts.enc=val;if(opts.WTF)console.error(val);if(!options.password)thrownewError("File is password-protected");if(val.Type!==0)thrownewError("Encryption scheme unsupported");if(!val.valid)thrownewError("Password is incorrect");break;case"WriteAccess":opts.lastuser=val;break;case"FileSharing":break;case"CodePage":if(val===21010)val=1200;elseif(val===32769)val=1252;opts.codepage=val;set_cp(val);break;case"RRTabId":opts.rrtabid=val;break;case"WinProtect":opts.winlocked=val;break;case"Template":break;case"RefreshAll":wb.opts.RefreshAll=val;break;case"BookBool":break;case"UsesELFs":break;case"MTRSettings":break;case"CalcCount":wb.opts.CalcCount=val;break;case"CalcDelta":wb.opts.CalcDelta=val;break;case"CalcIter":wb.opts.CalcIter=val;break;case"CalcMode":wb.opts.CalcMode=val;break;case"CalcPrecision":wb.opts.CalcPrecision=val;break;case"CalcSaveRecalc":wb.opts.CalcSaveRecalc=val;break;case"CalcRefMode":opts.CalcRefMode=val;break;case"Uncalced":break;case"ForceFullCalculation":wb.opts.FullCalc=val;break;case"WsBool":break;case"XF":XFs.push(val);break;case"ExtSST":break;case"BookExt":break;case"RichTextStream":break;case"BkHim":break;case"SupBook":supbooks[++sbc]=[val];sbci=0;break;case"ExternName":supbooks[sbc][++sbci]=val;break;case"Index":break;case"Lbl":supbooks[0][++sbcli]=val;break;case"ExternSheet":supbooks[sbc]=supbooks[sbc].concat(val);sbci+=val.length;break;case"Protect":out["!protect"]=val;break;case"Password":if(val!==0&&opts.WTF)console.error("Password verifier: "+val);break;case"Prot4Rev":case"Prot4RevPass":break;case"BoundSheet8":{Directory[val.pos]=val;opts.snam