case"X":n=parseInt(b[s].slice(1))-1;++B;break;case"Y":a=parseInt(b[s].slice(1))-1;for(p=l.length;p<=a;++p)l[p]=[];break;case"M":v=parseInt(b[s].slice(1))/20;break;case"F":break;case"G":break;case"P":c=f[parseInt(b[s].slice(1))];break;case"S":break;case"D":break;case"N":break;case"W":d=b[s].slice(1).split(" ");for(p=parseInt(d[0],10);p<=parseInt(d[1],10);++p){v=parseInt(d[2],10);h[p-1]=v===0?{hidden:true}:{wch:v};af(h[p-1])}break;case"C":n=parseInt(b[s].slice(1))-1;if(!h[n])h[n]={};break;case"R":a=parseInt(b[s].slice(1))-1;if(!u[a])u[a]={};if(v>0){u[a].hpt=v;u[a].hpx=ff(v)}elseif(v===0)u[a].hidden=true;break;default:if(r&&r.WTF)thrownewError("SYLK bad record "+m);}if(B<1)c=null;break;default:if(r&&r.WTF)thrownewError("SYLK bad record "+m);}}if(u.length>0)o["!rows"]=u;if(h.length>0)o["!cols"]=h;if(r&&r.sheetRows)l=l.slice(0,r.sheetRows);return[l,o]}functiont(r,t){vara=e(r,t);varn=a[0],i=a[1];vars=mt(n,t);X(i).forEach(function(e){s[e]=i[e]});returns}functiona(e,r){returnvt(t(e,r),r)}functionn(e,r,t,a){varn="C;Y"+(t+1)+";X"+(a+1)+";K";switch(e.t){case"n":n+=e.v||0;if(e.f&&!e.F)n+=";E"+Vc(e.f,{r:t,c:a});break;case"b":n+=e.v?"TRUE":"FALSE";break;case"e":n+=e.w||e.v;break;case"d":n+='"'+(e.w||e.v)+'"';break;case"s":n+='"'+e.v.replace(/"/g,"")+'"';break;}returnn}functioni(e,r){r.forEach(function(r,t){vara="F;W"+(t+1)+" "+(t+1)+" ";if(r.hidden)a+="0";else{if(typeofr.width=="number")r.wpx=Zl(r.width);if(typeofr.wpx=="number")r.wch=ql(r.wpx);if(typeofr.wch=="number")a+=Math.round(r.wch)}if(a.charAt(a.length-1)!=" ")e.push(a)})}functions(e,r){r.forEach(function(r,t){vara="F;";if(r.hidden)a+="M0;";elseif(r.hpt)a+="M"+20*r.hpt+";";elseif(r.hpx)a+="M"+20*lf(r.hpx)+";";if(a.length>2)e.push(a+"R"+(t+1))})}functionl(e,r){vart=["ID;PWXL;N;E"],a=[];varl=ut(e["!ref"]),f;varc=Array.isArray(e);varo="\r\n";t.push("P;PGeneral");t.push("F;P0;DG0G8;M255");if(e["!cols"])i(t,e["!cols"]);if(e["!rows"])s(t,e["!rows"]);t.push("B;Y"+(l.e.r-l.s.r+1)+";X"+(l.e.c-l.s.c+1)+";D"+[l.s.c,l.s.r,l.e.c,l.e.r].join(" "));for(varu=l.s.r;u<=l.e.r;++u){for(varh=l.s.c;h<=l.e.c;++h){vard=ft({r:u,c:h});f=c?(e[u]||[])[h]:e[d];if(!f||f.v==null&&(!f.f||f.F))continue;a.push(n(f,e,u,h,r))}}returnt.join(o)+o+a.join(o)+o+"E"+o}return{to_workbook:a,to_sheet:t,from_sheet:l}}();varZs=function(){functione(e,t){switch(t.type){case"base64":returnr(g.decode(e),t);case"binary":returnr(e,t);case"buffer":returnr(e.toString("binary"),t);case"array":returnr(ae(e),t);}thrownewError("Unrecognized type "+t.type)}functionr(e,r){vart=e.split("\n"),a=-1,n=-1,i=0,s=[];for(;i!==t.length;++i){if(t[i].trim()==="BOT"){s[++a]=[];n=0;continue}if(a<0)continue;varl=t[i].trim().split(",");varf=l[0],c=l[1];++i;varo=t[i].trim();switch(+f){case-1:if(o==="BOT"){s[++a]=[];n=0;continue}elseif(o!=="EOD")thrownewError("Unrecognized DIF special command "+o);break;case0:if(o==="TRUE")s[a][n]=true;elseif(o==="FALSE")s[a][n]=false;elseif(!isNaN(se(c)))s[a][n]=se(c);elseif(!isNaN(le(c).getDate()))s[a][n]=te(c);elses[a][n]=c;++n;break;case1:o=o.slice(1,o.length-1);s[a][n++]=o!==""?o:null;break;}if(o==="EOD")break}if(r&&r.sheetRows)s=s.slice(0,r.sheetRows);returns}functiont(r,t){returnmt(e(r,t),t)}functiona(e,r){returnvt(t(e,r),r)}varn=function(){vare=functiont(e,r,a,n,i){e.push(r);e.push(a+","+n);e.push('"'+i.replace(/"/g,'""')+'"')};varr=functiona(e,r,t,n){e.push(r+","+t);e.push(r==1?'"'+n.replace(/"/g,'""')+'"':n)};returnfunctionn(t){vara=[];varn=ut(t["!ref"]),i;vars=Array.isArray(t);e(a,"TABLE",0,1,"sheetjs");e(a,"VECTORS",0,n.e.r-n.s.r+1,"");e(a,"TUPLES",0,n.e.c-n.s.c+1,"");e(a,"DATA",0,0,"");for(varl=n.s.r;l<=n.e.r;++l){r(a,-1,0,"BOT");for(varf=n.s.c;f<=n.e.c;++f){varc=ft({r:l,c:f});i=s?(t[l]||[])[f]:t[c];if(!i){r(a,1,0,"");continue}switch(i.t){case"n":varo=b?i.w:i.v;if(!o&&i.v!=null)o=i.v;if(o==null){if(b&&i.f&&!i.F)r(a,1,0,"="+i.f);elser(a,1,0,"")}elser(a,0,o,"V");break;case"b":r(a,0,i.v?1:0,i.v?"TRUE":"FALSE");break;case"s":r(a,1,0,!b||isNaN(i.v)?i.v:'="'+i.v+'"');break;case"d":if(!i.w)i.w=R.format(i.z||R._table[14],J(te(i.v)));if(b)r
break;case"<vertAlign/>":;case"</vertAlign>":break;case"<family":if(l.val)n.family=parseInt(l.val,10);break;case"<family/>":;case"</family>":break;case"<scheme":if(l.val)n.scheme=l.val;break;case"<scheme/>":;case"</scheme>":break;case"<charset":if(l.val=="1")break;l.codepage=s[parseInt(l.val,10)];break;case"<color":if(!n.color)n.color={};if(l.auto)n.color.auto=Ue(l.auto);if(l.rgb)n.color.rgb=l.rgb.slice(-6);elseif(l.indexed){n.color.index=parseInt(l.indexed,10);varf=Ea[n.color.index];if(n.color.index==81)f=Ea[1];if(!f)thrownewError(e);n.color.rgb=f[0].toString(16)+f[1].toString(16)+f[2].toString(16)}elseif(l.theme){n.color.theme=parseInt(l.theme,10);if(l.tint)n.color.tint=parseFloat(l.tint);if(l.theme&&t.themeElements&&t.themeElements.clrScheme){n.color.rgb=Kl(t.themeElements.clrScheme[n.color.theme].rgb,n.color.tint||0)}}break;case"<color/>":;case"</color>":break;case"<extLst":;case"<extLst>":;case"</extLst>":break;case"<ext":i=true;break;case"</ext>":i=false;break;default:if(a&&a.WTF){if(!i)thrownewError("unrecognized "+l[0]+" in fonts")};}})}functiondf(e,r,t){r.NumberFmt=[];vara=X(R._table);for(varn=0;n<a.length;++n)r.NumberFmt[a[n]]=R._table[a[n]];vari=e[0].match(we);if(!i)return;for(n=0;n<i.length;++n){vars=Te(i[n]);switch(s[0]){case"<numFmts":;case"</numFmts>":;case"<numFmts/>":;case"<numFmts>":break;case"<numFmt":{varl=Re(We(s.formatCode)),f=parseInt(s.numFmtId,10);r.NumberFmt[f]=l;if(f>0){if(f>392){for(f=392;f>60;--f)if(r.NumberFmt[f]==null)break;r.NumberFmt[f]=l}R.load(l,f)}}break;case"</numFmt>":break;default:if(t.WTF)thrownewError("unrecognized "+s[0]+" in numFmts");}}}functionvf(e){varr=["<numFmts>"];[[5,8],[23,26],[41,44],[50,392]].forEach(function(t){for(vara=t[0];a<=t[1];++a)if(e[a]!=null)r[r.length]=er("numFmt",null,{numFmtId:a,formatCode:Fe(e[a])})});if(r.length===1)return"";r[r.length]="</numFmts>";r[0]=er("numFmts",null,{count:r.length-2}).replace("/>",">");returnr.join("")}varpf=["numFmtId","fillId","fontId","borderId","xfId"];varmf=["applyAlignment","applyBorder","applyFill","applyFont","applyNumberFormat","applyProtection","pivotButton","quotePrefix"];functionbf(e,r,t){r.CellXf=[];vara;varn=false;e[0].match(we).forEach(function(e){vari=Te(e),s=0;switch(i[0]){case"<cellXfs":;case"<cellXfs>":;case"<cellXfs/>":;case"</cellXfs>":break;case"<xf":;case"<xf/>":a=i;deletea[0];for(s=0;s<pf.length;++s)if(a[pf[s]])a[pf[s]]=parseInt(a[pf[s]],10);for(s=0;s<mf.length;++s)if(a[mf[s]])a[mf[s]]=Ue(a[mf[s]]);if(a.numFmtId>392){for(s=392;s>60;--s)if(r.NumberFmt[a.numFmtId]==r.NumberFmt[s]){a.numFmtId=s;break}}r.CellXf.push(a);break;case"</xf>":break;case"<alignment":;case"<alignment/>":varl={};if(i.vertical)l.vertical=i.vertical;if(i.horizontal)l.horizontal=i.horizontal;if(i.textRotation!=null)l.textRotation=i.textRotation;if(i.indent)l.indent=i.indent;if(i.wrapText)l.wrapText=i.wrapText;a.alignment=l;break;case"</alignment>":break;case"<protection":;case"</protection>":;case"<protection/>":break;case"<extLst":;case"<extLst>":;case"</extLst>":break;case"<ext":n=true;break;case"</ext>":n=false;break;default:if(t&&t.WTF){if(!n)thrownewError("unrecognized "+i[0]+" in cellXfs")};}})}functiongf(e){varr=[];r[r.length]=er("cellXfs",null);e.forEach(function(e){r[r.length]=er("xf",null,e)});r[r.length]="</cellXfs>";if(r.length===2)return"";r[0]=er("cellXfs",null,{count:r.length-2}).replace("/>",">");returnr.join("")}varEf=functionZm(){vare=/<numFmts([^>]*)>[\S\s]*?<\/numFmts>/;varr=/<cellXfs([^>]*)>[\S\s]*?<\/cellXfs>/;vart=/<fills([^>]*)>[\S\s]*?<\/fills>/;vara=/<fonts([^>]*)>[\S\s]*?<\/fonts>/;varn=/<borders([^>]*)>[\S\s]*?<\/borders>/;returnfunctioni(s,l,f){varc={};if(!s)returnc;s=s.replace(/<!--([\s\S]*?)-->/gm,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");varo;if(o=s.match(e))df(o,c,f);if(o=s.match(a))hf(o,c,l,f);if(o=s.match(t))uf(o,c,l,f);if(o=s.match(n))of(o,c,l,f);if(o=s.match(r))bf(o,c,f);returnc}}();varSf=er("styleSheet",null,{xmlns:ar.main[0],"xmlns:vt":ar.vt});Aa.STY="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles";functionkf(e,r){vart=[
d=Te(E[0],false);T=I=-1;x.s.r=x.s.c=1e7;x.e.r=x.e.c=0;g=i.dense?[]:{};_=[];O=[];j=true}break;case"table-row-group":if(E[1]==="/")--A;else++A;break;case"table-row":;case"行":if(E[1]==="/"){T+=P;P=1;break}v=Te(E[0],false);if(v["行号"])T=v["行号"]-1;elseif(T==-1)T=0;P=+v["number-rows-repeated"]||1;if(P<10)for(K=0;K<P;++K)if(A>0)O[T+K]={level:A};I=-1;break;case"covered-table-cell":++I;if(i.sheetStubs){if(i.dense){if(!g[T])g[T]=[];g[T][I]={t:"z"}}elseg[ft({r:T,c:I})]={t:"z"}}break;case"table-cell":;case"数据":if(E[0].charAt(E[0].length-2)==="/"){++I;k=Te(E[0],false);N=parseInt(k["number-columns-repeated"]||"1",10);S={t:"z",v:null};if(k.formula&&i.cellFormula!=false)S.f=Lu(Re(k.formula));if((k["数据类型"]||k["value-type"])=="string"){S.t="s";S.v=Re(k["string-value"]||"");if(i.dense){if(!g[T])g[T]=[];g[T][I]=S}else{g[ft({r:T,c:I})]=S}}I+=N-1}elseif(E[1]!=="/"){++I;N=1;var$=P?T+P-1:T;if(I>x.e.c)x.e.c=I;if(I<x.s.c)x.s.c=I;if(T<x.s.r)x.s.r=T;if($>x.e.r)x.e.r=$;k=Te(E[0],false);H=[];V={};S={t:k["数据类型"]||k["value-type"],v:null};if(i.cellFormula){if(k.formula)k.formula=Re(k.formula);if(k["number-matrix-columns-spanned"]&&k["number-matrix-rows-spanned"]){F=parseInt(k["number-matrix-rows-spanned"],10)||0;D=parseInt(k["number-matrix-columns-spanned"],10)||0;y={s:{r:T,c:I},e:{r:T+F-1,c:I+D-1}};S.F=ot(y);M.push([y,S.F])}if(k.formula)S.f=Lu(k.formula);elsefor(K=0;K<M.length;++K)if(T>=M[K][0].s.r&&T<=M[K][0].e.r)if(I>=M[K][0].s.c&&I<=M[K][0].e.c)S.F=M[K][1]}if(k["number-columns-spanned"]||k["number-rows-spanned"]){F=parseInt(k["number-rows-spanned"],10)||0;D=parseInt(k["number-columns-spanned"],10)||0;y={s:{r:T,c:I},e:{r:T+F-1,c:I+D-1}};_.push(y)}if(k["number-columns-repeated"])N=parseInt(k["number-columns-repeated"],10);switch(S.t){case"boolean":S.t="b";S.v=Ue(k["boolean-value"]);break;case"float":S.t="n";S.v=parseFloat(k.value);break;case"percentage":S.t="n";S.v=parseFloat(k.value);break;case"currency":S.t="n";S.v=parseFloat(k.value);break;case"date":S.t="d";S.v=te(k["date-value"]);if(!i.cellDates){S.t="n";S.v=J(S.v)}S.z="m/d/yy";break;case"time":S.t="n";S.v=q(k["time-value"])/86400;break;case"number":S.t="n";S.v=parseFloat(k["数据数值"]);break;default:if(S.t==="string"||S.t==="text"||!S.t){S.t="s";if(k["string-value"]!=null)w=Re(k["string-value"])}elsethrownewError("Unsupported value type "+S.t);}}else{z=false;if(S.t==="s"){S.v=w||"";z=B==0}if(U.Target)S.l=U;if(H.length>0){S.c=H;H=[]}if(w&&i.cellText!==false)S.w=w;if(!z||i.sheetStubs){if(!(i.sheetRows&&i.sheetRows<=T)){for(varY=0;Y<P;++Y){N=parseInt(k["number-columns-repeated"]||"1",10);if(i.dense){if(!g[T+Y])g[T+Y]=[];g[T+Y][I]=Y==0?S:ne(S);while(--N>0)g[T+Y][I+N]=ne(S)}else{g[ft({r:T+Y,c:I})]=S;while(--N>0)g[ft({r:T+Y,c:I+N})]=ne(S)}if(x.e.c<=I)x.e.c=I}}}N=parseInt(k["number-columns-repeated"]||"1",10);I+=N-1;N=0;S={};w=""}U={};break;case"document":;case"document-content":;case"电子表格文档":;case"spreadsheet":;case"主体":;case"scripts":;case"styles":;case"font-face-decls":if(E[1]==="/"){if((f=l.pop())[0]!==E[3])throw"Bad state: "+f}elseif(E[0].charAt(E[0].length-2)!=="/")l.push([E[3],true]);break;case"annotation":if(E[1]==="/"){if((f=l.pop())[0]!==E[3])throw"Bad state: "+f;V.t=w;V.a=X;H.push(V)}elseif(E[0].charAt(E[0].length-2)!=="/"){l.push([E[3],false])}X="";G=0;w="";B=0;break;case"creator":if(E[1]==="/"){X=s.slice(G,E.index)}elseG=E.index+E[0].length;break;case"meta":;case"元数据":;case"settings":;case"config-item-set":;case"config-item-map-indexed":;case"config-item-map-entry":;case"config-item-map-named":;case"shapes":;case"frame":;case"text-box":;case"image":;case"data-pilot-tables":;case"list-style":;case"form":;case"dde-links":;case"event-listeners":;case"chart":if(E[1]==="/"){if((f=l.pop())[0]!==E[3])throw"Bad state: "+f}elseif(E[0].charAt(E[0].length-2)!=="/")l.push([E[3],false]);w="";B=0;break;case"scientific-number":break;case"currency-symbol":break;case"currency-style":break;case"number-style":;case"percentage-style":;case"date-style":;case"time-style":if(E[1]==="/"){R[o.name]=u;if((f=l.pop())[0]!==E[3])throw"Bad state: "+f}
o='"'+o.replace(Cm,'""')+'"';break}if(o=="ID")o='"ID"'}elseif(d.f!=null&&!d.F){f=false;o="="+d.f;if(o.indexOf(",")>=0)o='"'+o.replace(Cm,'""')+'"'}elseo="";c.push(o)}if(l.blankrows===false&&f)returnnull;returnc.join(s)}functionIm(e,r){vart=[];vara=r==null?{}:r;if(e==null||e["!ref"]==null)return"";varn=ut(e["!ref"]);vari=a.FS!==undefined?a.FS:",",s=i.charCodeAt(0);varl=a.RS!==undefined?a.RS:"\n",f=l.charCodeAt(0);varc=newRegExp((i=="|"?"\\|":i)+"+$");varo="",u=[];a.dense=Array.isArray(e);varh=a.skipHidden&&e["!cols"]||[];vard=a.skipHidden&&e["!rows"]||[];for(varv=n.s.c;v<=n.e.c;++v)if(!(h[v]||{}).hidden)u[v]=at(v);for(varp=n.s.r;p<=n.e.r;++p){if((d[p]||{}).hidden)continue;o=Tm(e,n,p,u,s,f,i,a);if(o==null){continue}if(a.strip)o=o.replace(c,"");t.push(o+l)}deletea.dense;returnt.join("")}functionxm(e,r){if(!r)r={};r.FS="\t";r.RS="\n";vart=Im(e,r);if(typeofcptable=="undefined"||r.type=="string")returnt;vara=cptable.utils.encode(1200,t,"str");returnString.fromCharCode(255)+String.fromCharCode(254)+a}functionAm(e){varr="",t,a="";if(e==null||e["!ref"]==null)return[];varn=ut(e["!ref"]),i="",s=[],l;varf=[];varc=Array.isArray(e);for(l=n.s.c;l<=n.e.c;++l)s[l]=at(l);for(varo=n.s.r;o<=n.e.r;++o){i=qr(o);for(l=n.s.c;l<=n.e.c;++l){r=s[l]+i;t=c?(e[o]||[])[l]:e[r];a="";if(t===undefined)continue;elseif(t.F!=null){r=t.F;if(!t.f)continue;a=t.f;if(r.indexOf(":")==-1)r=r+":"+r}if(t.f!=null)a=t.f;elseif(t.t=="z")continue;elseif(t.t=="n"&&t.v!=null)a=""+t.v;elseif(t.t=="b")a=t.v?"TRUE":"FALSE";elseif(t.w!==undefined)a="'"+t.w;elseif(t.v===undefined)continue;elseif(t.t=="s")a="'"+t.v;elsea=""+t.v;f[f.length]=r+"="+a}}returnf}functionRm(e,r,t){vara=t||{};varn=+!a.skipHeader;vari=e||{};vars=0,l=0;if(i&&a.origin!=null){if(typeofa.origin=="number")s=a.origin;else{varf=typeofa.origin=="string"?lt(a.origin):a.origin;s=f.r;l=f.c}}varc;varo={s:{c:0,r:0},e:{c:l,r:s+r.length-1+n}};if(i["!ref"]){varu=ut(i["!ref"]);o.e.c=Math.max(o.e.c,u.e.c);o.e.r=Math.max(o.e.r,u.e.r);if(s==-1){s=o.e.r+1;o.e.r=s+r.length-1+n}}varh=a.header||[],d=0;r.forEach(function(e,r){X(e).forEach(function(t){if((d=h.indexOf(t))==-1)h[d=h.length]=t;varf=e[t];varo="z";varu="";if(typeoff=="number")o="n";elseif(typeoff=="boolean")o="b";elseif(typeoff=="string")o="s";elseif(finstanceofDate){o="d";if(!a.cellDates){o="n";f=J(f)}u=a.dateNF||R._table[14]}i[ft({c:l+d,r:s+r+n})]=c={t:o,v:f};if(u)c.z=u})});o.e.c=Math.max(o.e.c,l+h.length-1);varv=qr(s);if(n)for(d=0;d<h.length;++d)i[at(d+l)+v]={t:"s",v:h[d]};i["!ref"]=ot(o);returni}function_m(e,r){returnRm(null,e,r)}varym={encode_col:at,encode_row:qr,encode_cell:ft,encode_range:ot,decode_col:tt,decode_row:Zr,split_cell:st,decode_cell:lt,decode_range:ct,format_cell:dt,get_formulae:Am,make_csv:Im,make_json:Bm,make_formulae:Am,sheet_add_aoa:pt,sheet_add_json:Rm,aoa_to_sheet:mt,json_to_sheet:_m,table_to_sheet:Rp,table_to_book:_p,sheet_to_csv:Im,sheet_to_txt:xm,sheet_to_json:Bm,sheet_to_html:Ap.from_sheet,sheet_to_dif:Zs.from_sheet,sheet_to_slk:Js.from_sheet,sheet_to_eth:qs.from_sheet,sheet_to_formulae:Am,sheet_to_row_object_array:Bm};(function(e){e.consts=e.consts||{};functionr(r){r.forEach(function(r){e.consts[r[0]]=r[1]})}functiont(e,r,t){returne[r]!=null?e[r]:e[r]=t}functiona(e,r,t){if(typeofr=="string")returne[r]||(e[r]={t:"z"});if(typeofr!="number")returna(e,ft(r));returna(e,ft({r:r,c:t||0}))}functionn(e,r){if(typeofr=="number"){if(r>=0&&e.SheetNames.length>r)returnr;thrownewError("Cannot find sheet # "+r)}elseif(typeofr=="string"){vart=e.SheetNames.indexOf(r);if(t>-1)returnt;thrownewError("Cannot find sheet name |"+r+"|")}elsethrownewError("Cannot find sheet |"+r+"|")}e.book_new=function(){return{SheetNames:[],Sheets:{}}};e.book_append_sheet=function(e,r,t){if(!t)for(vara=1;a<=65535;++a)if(e.SheetNames.indexOf(t="Sheet"+a)==-1)break;if(!t)thrownewError("Too many worksheets");Hd(t);if(e.SheetNames.indexOf(t)>=0)thrownewError("Worksheet with name |"+t+"| already exists!");e.SheetNames.push(t);e.Sheets[t]=r};e.book_set_sheet_visibility=function(e,r,a){t(e