}RELS.THEME="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme";functionparse_clrScheme(t,opts){themes.themeElements.clrScheme=[];varcolor={};t[0].match(tagregex).forEach(function(x){vary=parsexmltag(x);switch(y[0]){case"<a:clrScheme":case"</a:clrScheme>":break;case"<a:srgbClr":color.rgb=y.val;break;case"<a:sysClr":color.rgb=y.lastClr;break;case"<a:dk1>":case"</a:dk1>":case"<a:dk2>":case"</a:dk2>":case"<a:lt1>":case"</a:lt1>":case"<a:lt2>":case"</a:lt2>":case"<a:accent1>":case"</a:accent1>":case"<a:accent2>":case"</a:accent2>":case"<a:accent3>":case"</a:accent3>":case"<a:accent4>":case"</a:accent4>":case"<a:accent5>":case"</a:accent5>":case"<a:accent6>":case"</a:accent6>":case"<a:hlink>":case"</a:hlink>":case"<a:folHlink>":case"</a:folHlink>":if(y[0][1]==="/"){themes.themeElements.clrScheme.push(color);color={}}else{color.name=y[0].substring(3,y[0].length-1)}break;default:if(opts.WTF)throw"unrecognized "+y[0]+" in clrScheme"}})}functionparse_fontScheme(t,opts){}functionparse_fmtScheme(t,opts){}varclrsregex=/<a:clrScheme([^>]*)>[^\u2603]*<\/a:clrScheme>/;varfntsregex=/<a:fontScheme([^>]*)>[^\u2603]*<\/a:fontScheme>/;varfmtsregex=/<a:fmtScheme([^>]*)>[^\u2603]*<\/a:fmtScheme>/;functionparse_themeElements(data,opts){themes.themeElements={};vart;[["clrScheme",clrsregex,parse_clrScheme],["fontScheme",fntsregex,parse_fontScheme],["fmtScheme",fmtsregex,parse_fmtScheme]].forEach(function(m){if(!(t=data.match(m[1])))throwm[0]+" not found in themeElements";m[2](t,opts)})}varthemeltregex=/<a:themeElements([^>]*)>[^\u2603]*<\/a:themeElements>/;functionparse_theme_xml(data,opts){if(!data||data.length===0)returnthemes;vart;if(!(t=data.match(themeltregex)))throw"themeElements not found in theme";parse_themeElements(t[0],opts);returnthemes}functionwrite_theme(opts){if(opts.themeXml){returnopts.themeXml}return'<?xmlversion="1.0"encoding="UTF-8"standalone="yes"?>\n<a:themexmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"name="Office Theme"><a:themeElements><a:clrSchemename="Office"><a:dk1><a:sysClrval="windowText"lastClr="000000"/></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1><a:dk2><a:srgbClr val="1F497D"/></a:dk2><a:lt2><a:srgbClr val="EEECE1"/></a:lt2><a:accent1><a:srgbClr val="4F81BD"/></a:accent1><a:accent2><a:srgbClr val="C0504D"/></a:accent2><a:accent3><a:srgbClr val="9BBB59"/></a:accent3><a:accent4><a:srgbClr val="8064A2"/></a:accent4><a:accent5><a:srgbClr val="4BACC6"/></a:accent5><a:accent6><a:srgbClr val="F79646"/></a:accent6><a:hlink><a:srgbClr val="0000FF"/></a:hlink><a:folHlink><a:srgbClr val="800080"/></a:folHlink></a:clrScheme><a:fontSchemename="Office"><a:majorFont><a:latintypeface="Cambria"/><a:eatypeface=""/><a:cstypeface=""/><a:fontscript="Jpan"typeface="MSPゴシック"/><a:fontscript="Hang"typeface="맑은고딕"/><a:fontscript="Hans"typeface="宋体"/><a:fontscript="Hant"typeface="新細明體"/><a:fontscript="Arab"typeface="TimesNewRoman"/><a:fontscript="Hebr"typeface="TimesNewRoman"/><a:fontscript="Thai"typeface="Tahoma"/><a:fontscript="Ethi"typeface="Nyala"/><a:fontscript="Beng"typeface="Vrinda"/><a:fontscript="Gujr"typeface="Shruti"/><a:fontscript="Khmr"typeface="MoolBoran"/><a:fontscript="Knda"typeface="Tunga"/><a:fontscript="Guru"typeface="Raavi"/><a:fontscript="Cans"typeface="Euphemia"/><a:fontscript="Cher"typeface="PlantagenetCherokee"/><a:fontscript="Yiii"typeface="MicrosoftYiBaiti"/><a:fontscript="Tibt"typeface="MicrosoftHimalaya"/><a:fontscript="Thaa"typeface="MVBoli"/><a:fontscript="Deva"typeface="Mangal"/><a:fontscript="Telu"typeface="Gautami"/><a:fontscript="Taml"typeface="Latha"/><a:fontscript="Syrc"typeface="EstrangeloEdessa"/><a:fontscript="Orya"typeface="Kalinga"/><a:fontscript="Mlym"typeface="Kartika"/><a:fontscript="Laoo"typeface="DokChampa"/><a:fontscript="Sinh"typeface="IskoolaPota"/><a:fontscript="Mong"typeface="MongolianBaiti"/><a:fontscript="Viet"typeface="TimesNewRoman"/><a:fontscript="Uigh"typeface="MicrosoftUighur"/><a:font
}});if(XMLNS.main.indexOf(wb.xmlns)===-1)thrownewError("Unknown Namespace: "+wb.xmlns);parse_wb_defaults(wb);returnwb}varWB_XML_ROOT=writextag("workbook",null,{xmlns:XMLNS.main[0],"xmlns:r":XMLNS.r});functionsafe1904(wb){try{returnparsexmlbool(wb.Workbook.WBProps.date1904)?"true":"false"}catch(e){return"false"}}functionwrite_wb_xml(wb,opts){varo=[XML_HEADER];o[o.length]=WB_XML_ROOT;o[o.length]=writextag("workbookPr",null,{date1904:safe1904(wb)});o[o.length]="<sheets>";for(vari=0;i!=wb.SheetNames.length;++i)o[o.length]=writextag("sheet",null,{name:wb.SheetNames[i].substr(0,31),sheetId:""+(i+1),"r:id":"rId"+(i+1)});o[o.length]="</sheets>";if(o.length>2){o[o.length]="</workbook>";o[1]=o[1].replace("/>",">")}returno.join("")}functionparse_BrtBundleSh(data,length){varz={};z.hsState=data.read_shift(4);z.iTabID=data.read_shift(4);z.strRelID=parse_RelID(data,length-8);z.name=parse_XLWideString(data);returnz}functionwrite_BrtBundleSh(data,o){if(!o)o=new_buf(127);o.write_shift(4,data.hsState);o.write_shift(4,data.iTabID);write_RelID(data.strRelID,o);write_XLWideString(data.name.substr(0,31),o);returno}functionparse_BrtWbProp(data,length){data.read_shift(4);vardwThemeVersion=data.read_shift(4);varstrName=length>8?parse_XLWideString(data):"";return[dwThemeVersion,strName]}functionwrite_BrtWbProp(data,o){if(!o)o=new_buf(8);o.write_shift(4,0);o.write_shift(4,0);returno}functionparse_BrtFRTArchID$(data,length){varo={};data.read_shift(4);o.ArchID=data.read_shift(4);data.l+=length-8;returno}functionparse_wb_bin(data,opts){varwb={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},xmlns:""};varpass=false,z;recordhopper(data,functionhopper_wb(val,R){switch(R.n){case"BrtBundleSh":wb.Sheets.push(val);break;case"BrtBeginBook":break;case"BrtFileVersion":break;case"BrtWbProp":break;case"BrtACBegin":break;case"BrtAbsPath15":break;case"BrtACEnd":break;case"BrtWbFactoid":break;case"BrtBookProtection":break;case"BrtBeginBookViews":break;case"BrtBookView":break;case"BrtEndBookViews":break;case"BrtBeginBundleShs":break;case"BrtEndBundleShs":break;case"BrtBeginFnGroup":break;case"BrtEndFnGroup":break;case"BrtBeginExternals":break;case"BrtSupSelf":break;case"BrtSupBookSrc":break;case"BrtExternSheet":break;case"BrtEndExternals":break;case"BrtName":break;case"BrtCalcProp":break;case"BrtUserBookView":break;case"BrtBeginPivotCacheIDs":break;case"BrtBeginPivotCacheID":break;case"BrtEndPivotCacheID":break;case"BrtEndPivotCacheIDs":break;case"BrtWebOpt":break;case"BrtFileRecover":break;case"BrtFileSharing":break;case"BrtBeginSmartTagTypes":break;case"BrtSmartTagType":break;case"BrtEndSmartTagTypes":break;case"BrtFRTBegin":pass=true;break;case"BrtFRTArchID$":break;case"BrtWorkBookPr15":break;case"BrtFRTEnd":pass=false;break;case"BrtEndBook":break;default:if(!pass||opts.WTF)thrownewError("Unexpected record "+R.n)}});parse_wb_defaults(wb);returnwb}functionwrite_BUNDLESHS(ba,wb,opts){write_record(ba,"BrtBeginBundleShs");for(varidx=0;idx!=wb.SheetNames.length;++idx){vard={hsState:0,iTabID:idx+1,strRelID:"rId"+(idx+1),name:wb.SheetNames[idx]};write_record(ba,"BrtBundleSh",write_BrtBundleSh(d))}write_record(ba,"BrtEndBundleShs")}functionwrite_BrtFileVersion(data,o){if(!o)o=new_buf(127);for(vari=0;i!=4;++i)o.write_shift(4,0);write_XLWideString("SheetJS",o);write_XLWideString(XLSX.version,o);write_XLWideString(XLSX.version,o);write_XLWideString("7262",o);o.length=o.l;returno}functionwrite_BOOKVIEWS(ba,wb,opts){write_record(ba,"BrtBeginBookViews");write_record(ba,"BrtEndBookViews")}functionwrite_BrtCalcProp(data,o){if(!o)o=new_buf(26);o.write_shift(4,0);o.write_shift(4,1);o.write_shift(4,0);write_Xnum(0,o);o.write_shift(-4,1023);o.write_shift(1,51);o.write_shift(1,0);returno}functionwrite_BrtFileRecover(data,o){if(!o)o=new_buf(1);o.write_shift(1,0);returno}functionwrite_wb_bin(wb,opts){varba=buf_array();write_record(ba,"BrtBeginBook");write_record(ba,"BrtFileVersion",write_BrtFileVersion());write_record(ba,"BrtWbProp",write_BrtWbProp());write_BOOKVIEWS(ba,wb,opts);write_BUNDLESHS(ba,wb,opts);write_record(ba,"BrtCalcProp",w
case"TableStyle":break;case"TableStyleElement":break;case"SXStreamID":break;case"SXVS":break;case"DConRef":break;case"SXAddl":break;case"DConBin":break;case"DConName":break;case"SXPI":break;case"SxFormat":break;case"SxSelect":break;case"SxRule":break;case"SxFilt":break;case"SxItm":break;case"SxDXF":break;case"ScenMan":break;case"DCon":break;case"CellWatch":break;case"PrintRowCol":break;case"PrintGrid":break;case"PrintSize":break;case"XCT":break;case"CRN":break;case"Scl":{}break;case"SheetExt":{}break;case"SheetExtOptional":{}break;case"ObNoMacros":{}break;case"ObProj":{}break;case"CodeName":{}break;case"GUIDTypeLib":{}break;case"WOpt":break;case"PhoneticInfo":break;case"OleObjectSize":break;case"DXF":case"DXFN":case"DXFN12":case"DXFN12List":case"DXFN12NoCB":break;case"Dv":case"DVal":break;case"BRAI":case"Series":case"SeriesText":break;case"DConn":break;case"DbOrParamQry":break;case"DBQueryExt":break;case"IFmtRecord":break;case"CondFmt":case"CF":case"CF12":case"CFEx":break;case"Excel9File":break;case"Units":break;case"InterfaceHdr":case"Mms":case"InterfaceEnd":case"DSF":case"BuiltInFnGroupCount":case"Window1":case"Window2":case"HideObj":case"GridSet":case"Guts":case"UserBView":case"UserSViewBegin":case"UserSViewEnd":case"Pane":break;default:switch(R.n){case"Dat":case"Begin":case"End":case"StartBlock":case"EndBlock":case"Frame":case"Area":case"Axis":case"AxisLine":case"Tick":break;case"AxesUsed":case"CrtLayout12":case"CrtLayout12A":case"CrtLink":case"CrtLine":case"CrtMlFrt":case"CrtMlFrtContinue":break;case"LineFormat":case"AreaFormat":case"Chart":case"Chart3d":case"Chart3DBarShape":case"ChartFormat":case"ChartFrtInfo":break;case"PlotArea":case"PlotGrowth":break;case"SeriesList":case"SerParent":case"SerAuxTrend":break;case"DataFormat":case"SerToCrt":case"FontX":break;case"CatSerRange":case"AxcExt":case"SerFmt":break;case"ShtProps":break;case"DefaultText":case"Text":case"CatLab":break;case"DataLabExtContents":break;case"Legend":case"LegendException":break;case"Pie":case"Scatter":break;case"PieFormat":case"MarkerFormat":break;case"StartObject":case"EndObject":break;case"AlRuns":case"ObjectLink":break;case"SIIndex":break;case"AttachedLabel":case"YMult":break;case"Line":case"Bar":break;case"Surf":break;case"AxisParent":break;case"Pos":break;case"ValueRange":break;case"SXViewEx9":break;case"SXViewLink":break;case"PivotChartBits":break;case"SBaseRef":break;case"TextPropsStream":break;case"LnExt":break;case"MkrExt":break;case"CrtCoopt":break;case"Qsi":case"Qsif":case"Qsir":case"QsiSXTag":break;case"TxtQry":break;case"FilterMode":break;case"AutoFilter":case"AutoFilterInfo":break;case"AutoFilter12":break;case"DropDownObjIds":break;case"Sort":break;case"SortData":break;case"ShapePropsStream":break;case"MsoDrawing":case"MsoDrawingGroup":case"MsoDrawingSelection":break;case"ImData":break;case"WebPub":case"AutoWebPub":case"RightMargin":case"LeftMargin":case"TopMargin":case"BottomMargin":case"HeaderFooter":case"HFPicture":case"PLV":case"HorizontalPageBreaks":case"VerticalPageBreaks":case"Backup":case"CompressPictures":case"Compat12":break;case"Continue":case"ContinueFrt12":break;case"FrtFontList":case"FrtWrapper":break;case"ExternCount":break;case"RString":break;case"TabIdConf":case"Radar":case"RadarArea":case"DropBar":case"Intl":case"CoordList":case"SerAuxErrBar":break;default:switch(R.n){case"SCENARIO":case"DConBin":case"PicF":case"DataLabExt":case"Lel":case"BopPop":case"BopPopCustom":case"RealTimeData":case"Name":break;default:if(options.WTF)throw"Unrecognized Record "+R.n}}}}}elseblob.l+=length}varsheetnamesraw=opts.biff===2?["Sheet1"]:Object.keys(Directory).sort(function(a,b){returnNumber(a)-Number(b)}).map(function(x){returnDirectory[x].name});varsheetnames=sheetnamesraw.slice();wb.Directory=sheetnamesraw;wb.SheetNames=sheetnamesraw;if(!options.bookSheets)wb.Sheets=Sheets;wb.Preamble=Preamble;wb.Strings=sst;wb.SSF=SSF.get_table();if(opts.enc)wb.Encryption=opts.enc;wb.Metadata={};if(country!==undefined)wb.Metadata.Country=country;returnwb}functionparse_xlscfb(cfb,options){if(!options)options={};fix_read_opts(options);reset_