xsheetjs/dist/xlsx.mini.min.js

9 lines
201 KiB
JavaScript
Raw Normal View History

/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
var DO_NOT_EXPORT_CODEPAGE=true;var DO_NOT_EXPORT_JSZIP=true;var XLSX={};function make_xlsx_lib(e){e.version="0.16.7";var r=1200,t=1252;var a=[874,932,936,949,950];for(var n=0;n<=8;++n)a.push(1250+n);var i={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969};var s=function(e){if(a.indexOf(e)==-1)return;t=i[0]=e};function l(){s(1252)}var o=function(e){r=e;s(e)};function f(){o(1200);l()}function c(e){var r=[];for(var t=0,a=e.length;t<a;++t)r[t]=e.charCodeAt(t);return r}function h(e){var r=[];for(var t=0;t<e.length>>1;++t)r[t]=String.fromCharCode(e.charCodeAt(2*t)+(e.charCodeAt(2*t+1)<<8));return r.join("")}function u(e){var r=[];for(var t=0;t<e.length>>1;++t)r[t]=String.fromCharCode(e.charCodeAt(2*t+1)+(e.charCodeAt(2*t)<<8));return r.join("")}var d=function(e){var r=e.charCodeAt(0),t=e.charCodeAt(1);if(r==255&&t==254)return h(e.slice(2));if(r==254&&t==255)return u(e.slice(2));if(r==65279)return e.slice(1);return e};var p=function Rl(e){return String.fromCharCode(e)};var v=function Il(e){return String.fromCharCode(e)};var m=null;var g=true;var b=function Ll(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return{encode:function(r){var t="";var a=0,n=0,i=0,s=0,l=0,o=0,f=0;for(var c=0;c<r.length;){a=r.charCodeAt(c++);s=a>>2;n=r.charCodeAt(c++);l=(a&3)<<4|n>>4;i=r.charCodeAt(c++);o=(n&15)<<2|i>>6;f=i&63;if(isNaN(n)){o=f=64}else if(isNaN(i)){f=64}t+=e.charAt(s)+e.charAt(l)+e.charAt(o)+e.charAt(f)}return t},decode:function r(t){var a="";var n=0,i=0,s=0,l=0,o=0,f=0,c=0;t=t.replace(/[^\w\+\/\=]/g,"");for(var h=0;h<t.length;){l=e.indexOf(t.charAt(h++));o=e.indexOf(t.charAt(h++));n=l<<2|o>>4;a+=String.fromCharCode(n);f=e.indexOf(t.charAt(h++));i=(o&15)<<4|f>>2;if(f!==64){a+=String.fromCharCode(i)}c=e.indexOf(t.charAt(h++));s=(f&3)<<6|c;if(c!==64){a+=String.fromCharCode(s)}}return a}}}();var w=typeof Buffer!=="undefined"&&typeof process!=="undefined"&&typeof process.versions!=="undefined"&&!!process.versions.node;var k=function(){};if(typeof Buffer!=="undefined"){var y=!Buffer.from;if(!y)try{Buffer.from("foo","utf8")}catch(x){y=true}k=y?function(e,r){return r?new Buffer(e,r):new Buffer(e)}:Buffer.from.bind(Buffer);if(!Buffer.alloc)Buffer.alloc=function(e){return new Buffer(e)};if(!Buffer.allocUnsafe)Buffer.allocUnsafe=function(e){return new Buffer(e)}}function _(e){return w?Buffer.alloc(e):new Array(e)}function S(e){return w?Buffer.allocUnsafe(e):new Array(e)}var C=function Bl(e){if(w)return k(e,"binary");return e.split("").map(function(e){return e.charCodeAt(0)&255})};function A(e){if(typeof ArrayBuffer==="undefined")return C(e);var r=new ArrayBuffer(e.length),t=new Uint8Array(r);for(var a=0;a!=e.length;++a)t[a]=e.charCodeAt(a)&255;return r}function E(e){if(Array.isArray(e))return e.map(function(e){return String.fromCharCode(e)}).join("");var r=[];for(var t=0;t<e.length;++t)r[t]=String.fromCharCode(e[t]);return r.join("")}function F(e){if(typeof Uint8Array==="undefined")throw new Error("Unsupported");return new Uint8Array(e)}function T(e){if(typeof ArrayBuffer=="undefined")throw new Error("Unsupported");if(e instanceof ArrayBuffer)return T(new Uint8Array(e));var r=new Array(e.length);for(var t=0;t<e.length;++t)r[t]=e[t];return r}var O=function(e){return[].concat.apply([],e)};var D=/\u0000/g,M=/[\u0001-\u0006]/g;var N={};var P=function zl(e){e.version="0.11.2";function r(e){var r="",t=e.length-1;while(t>=0)r+=e.charAt(t--);return r}function t(e,r){var t="";while(t.length<r)t+=e;return t}function a(e,r){var a=""+e;return a.length>=r?a:t("0",r-a.length)+a}function n(e,r){var a=""+e;return a.length>=r?a:t(" ",r-a.length)+a}function i(e,r){var a=""+e;return a.length>=r?a:a+t(" ",r-a.length)}function s(e,r){var a=""+Math.round(e);return a.length>=r?a:t("0",r-a.length)+a}function l(e,r){var a=""+e;return a.length>=r?a:t("0",r-a.length)+a}var o=Math.pow(2,32);function f(e,r){if(e>o||e<-o)return s(e,r);var t=Math.round(e);return l(t,r)}function c(e,r){r=r||0;return e.length>=7+r&&(e.charCodeAt(r)|3
return r===-1?e:e.slice(0,r+1)}function a(e){if(e.charAt(e.length-1)=="/")return a(e.slice(0,-1));var r=e.lastIndexOf("/");return r===-1?e:e.slice(r+1)}function n(e,r){if(typeof r==="string")r=new Date(r);var t=r.getHours();t=t<<6|r.getMinutes();t=t<<5|r.getSeconds()>>>1;e._W(2,t);var a=r.getFullYear()-1980;a=a<<4|r.getMonth()+1;a=a<<5|r.getDate();e._W(2,a)}function i(e){var r=e._R(2)&65535;var t=e._R(2)&65535;var a=new Date;var n=t&31;t>>>=5;var i=t&15;t>>>=4;a.setMilliseconds(0);a.setFullYear(t+1980);a.setMonth(i-1);a.setDate(n);var s=r&31;r>>>=5;var l=r&63;r>>>=6;a.setHours(r);a.setMinutes(l);a.setSeconds(s<<1);return a}function s(e){Yr(e,0);var r={};var t=0;while(e.l<=e.length-4){var a=e._R(2);var n=e._R(2),i=e.l+n;var s={};switch(a){case 21589:{t=e._R(1);if(t&1)s.mtime=e._R(4);if(n>5){if(t&2)s.atime=e._R(4);if(t&4)s.ctime=e._R(4)}if(s.mtime)s.mt=new Date(s.mtime*1e3)}break;}e.l=i;r[a]=s}return r}var l;function o(){return l||(l=require("fs"))}function f(e,r){if(e[0]==80&&e[1]==75)return Ae(e,r);if(e.length<512)throw new Error("CFB file size "+e.length+" < 512");var t=3;var a=512;var n=0;var i=0;var s=0;var l=0;var o=0;var f=[];var p=e.slice(0,512);Yr(p,0);var m=c(p);t=m[0];switch(t){case 3:a=512;break;case 4:a=4096;break;case 0:if(m[1]==0)return Ae(e,r);default:throw new Error("Major Version: Expected 3 or 4 saw "+t);}if(a!==512){p=e.slice(0,a);Yr(p,28)}var b=e.slice(0,a);h(p,t);var w=p._R(4,"i");if(t===3&&w!==0)throw new Error("# Directory Sectors: Expected 0 saw "+w);p.l+=4;s=p._R(4,"i");p.l+=4;p.chk("00100000","Mini Stream Cutoff Size: ");l=p._R(4,"i");n=p._R(4,"i");o=p._R(4,"i");i=p._R(4,"i");for(var y=-1,x=0;x<109;++x){y=p._R(4,"i");if(y<0)break;f[x]=y}var _=u(e,a);v(o,i,_,a,f);var S=g(_,s,f,a);S[s].name="!Directory";if(n>0&&l!==I)S[l].name="!MiniFAT";S[f[0]].name="!FAT";S.fat_addrs=f;S.ssz=a;var C={},A=[],E=[],F=[];k(s,S,_,A,n,C,E,l);d(E,F,A);A.shift();var T={FileIndex:E,FullPaths:F};if(r&&r.raw)T.raw={header:b,sectors:_};return T}function c(e){if(e[e.l]==80&&e[e.l+1]==75)return[0,0];e.chk(L,"Header Signature: ");e.l+=16;var r=e._R(2,"u");return[e._R(2,"u"),r]}function h(e,r){var t=9;e.l+=2;switch(t=e._R(2)){case 9:if(r!=3)throw new Error("Sector Shift: Expected 9 saw "+t);break;case 12:if(r!=4)throw new Error("Sector Shift: Expected 12 saw "+t);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+t);}e.chk("0600","Mini Sector Shift: ");e.chk("000000000000","Reserved: ")}function u(e,r){var t=Math.ceil(e.length/r)-1;var a=[];for(var n=1;n<t;++n)a[n-1]=e.slice(n*r,(n+1)*r);a[t-1]=e.slice(t*r);return a}function d(e,r,t){var a=0,n=0,i=0,s=0,l=0,o=t.length;var f=[],c=[];for(;a<o;++a){f[a]=c[a]=a;r[a]=t[a]}for(;l<c.length;++l){a=c[l];n=e[a].L;i=e[a].R;s=e[a].C;if(f[a]===a){if(n!==-1&&f[n]!==n)f[a]=f[n];if(i!==-1&&f[i]!==i)f[a]=f[i]}if(s!==-1)f[s]=a;if(n!==-1&&a!=f[a]){f[n]=f[a];if(c.lastIndexOf(n)<l)c.push(n)}if(i!==-1&&a!=f[a]){f[i]=f[a];if(c.lastIndexOf(i)<l)c.push(i)}}for(a=1;a<o;++a)if(f[a]===a){if(i!==-1&&f[i]!==i)f[a]=f[i];else if(n!==-1&&f[n]!==n)f[a]=f[n]}for(a=1;a<o;++a){if(e[a].type===0)continue;l=a;if(l!=f[l])do{l=f[l];r[a]=r[l]+"/"+r[a]}while(l!==0&&-1!==f[l]&&l!=f[l]);f[a]=-1}r[0]+="/";for(a=1;a<o;++a){if(e[a].type!==2)r[a]+="/"}}function p(e,r,t){var a=e.start,n=e.size;var i=[];var s=a;while(t&&n>0&&s>=0){i.push(r.slice(s*R,s*R+R));n-=R;s=Wr(t,s*4)}if(i.length===0)return Kr(0);return O(i).slice(0,e.size)}function v(e,r,t,a,n){var i=I;if(e===I){if(r!==0)throw new Error("DIFAT chain shorter than expected")}else if(e!==-1){var s=t[e],l=(a>>>2)-1;if(!s)return;for(var o=0;o<l;++o){if((i=Wr(s,o*4))===I)break;n.push(i)}v(Wr(s,a-4),r-1,t,a,n)}}function m(e,r,t,a,n){var i=[],s=[];if(!n)n=[];var l=a-1,o=0,f=0;for(o=r;o>=0;){n[o]=true;i[i.length]=o;s.push(e[o]);var c=t[Math.floor(o*4/a)];f=o*4&l;if(a<4+f)throw new Error("FAT boundary crossed: "+o+" 4 "+a);if(!e[c])break;o=Wr(e[c],f)}return{nodes:i,data:vr([s])}}function g(e,r,t,a){var n=e.length,i=[];var s=[],l=[],o=[];var f=a-1,c=0,h=0,u=0,d=0;for(c=0;c<n;++c){l=[];u=c+r;if(u>=n)u-=n;if(s[u])continue;o=[];var p=[];for(h=u;h>=0;){p[h]=true;s[h]=tr
return r.join("")};if(w){var Ke=function Ul(e){var r=Buffer.alloc(2*e.length),t,a,n=1,i=0,s=0,l;for(a=0;a<e.length;a+=n){n=1;if((l=e.charCodeAt(a))<128)t=l;else if(l<224){t=(l&31)*64+(e.charCodeAt(a+1)&63);n=2}else if(l<240){t=(l&15)*4096+(e.charCodeAt(a+1)&63)*64+(e.charCodeAt(a+2)&63);n=3}else{n=4;t=(l&7)*262144+(e.charCodeAt(a+1)&63)*4096+(e.charCodeAt(a+2)&63)*64+(e.charCodeAt(a+3)&63);t-=65536;s=55296+(t>>>10&1023);t=56320+(t&1023)}if(s!==0){r[i++]=s&255;r[i++]=s>>>8;s=0}r[i++]=t%256;r[i++]=t>>>8}return r.slice(0,i).toString("ucs2")};var qe="foo bar baz☃🍣";if(Ye(qe)==Ke(qe))Ye=Ke;var Ze=function jl(e){return k(e,"binary").toString("utf8")};if(Ye(qe)==Ze(qe))Ye=Ze;Je=function(e){return k(e,"utf8").toString("binary")}}var Qe=function(){var e={};return function r(t,a){var n=t+"|"+(a||"");if(e[n])return e[n];return e[n]=new RegExp("<(?:\\w+:)?"+t+'(?: xml:space="preserve")?(?:[^>]*)>([\\s\\S]*?)</(?:\\w+:)?'+t+">",a||"")}}();var er=function(){var e=[["nbsp"," "],["middot","·"],["quot",'"'],["apos","'"],["gt",">"],["lt","<"],["amp","&"]].map(function(e){return[new RegExp("&"+e[0]+";","ig"),e[1]]});return function r(t){var a=t.replace(/^[\t\n\r ]+/,"").replace(/[\t\n\r ]+$/,"").replace(/>\s+/g,">").replace(/\s+</g,"<").replace(/[\t\n\r ]+/g," ").replace(/<\s*[bB][rR]\s*\/?>/g,"\n").replace(/<[^>]*>/g,"");for(var n=0;n<e.length;++n)a=a.replace(e[n][0],e[n][1]);return a}}();var rr=function(){var e={};return function r(t){if(e[t]!==undefined)return e[t];return e[t]=new RegExp("<(?:vt:)?"+t+">([\\s\\S]*?)</(?:vt:)?"+t+">","g")}}();var tr=/<\/?(?:vt:)?variant>/g,ar=/<(?:vt:)([^>]*)>([\s\S]*)</;function nr(e,r){var t=Ne(e);var a=e.match(rr(t.baseType))||[];var n=[];if(a.length!=t.size){if(r.WTF)throw new Error("unexpected vector length "+a.length+" != "+t.size);return n}a.forEach(function(e){var r=e.replace(tr,"").match(ar);if(r)n.push({v:Ye(r[2]),t:r[1]})});return n}var ir=/(^\s|\s$|\n)/;function sr(e,r){return"<"+e+(r.match(ir)?' xml:space="preserve"':"")+">"+r+"</"+e+">"}function lr(e){return Y(e).map(function(r){return" "+r+'="'+e[r]+'"'}).join("")}function or(e,r,t){return"<"+e+(t!=null?lr(t):"")+(r!=null?(r.match(ir)?' xml:space="preserve"':"")+">"+r+"</"+e:"/")+">"}function fr(e,r){try{return e.toISOString().replace(/\.\d*/,"")}catch(t){if(r)throw t}return""}function cr(e,r){switch(typeof e){case"string":var t=or("vt:lpwstr",We(e));if(r)t=t.replace(/&quot;/g,"_x0022_");return t;case"number":return or((e|0)==e?"vt:i4":"vt:r8",We(String(e)));case"boolean":return or("vt:bool",e?"true":"false");}if(e instanceof Date)return or("vt:filetime",fr(e));throw new Error("Unable to serialize "+e)}var hr={dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",mx:"http://schemas.microsoft.com/office/mac/excel/2008/main",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",sjs:"http://schemas.openxmlformats.org/package/2006/sheetjs/core-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",xsi:"http://www.w3.org/2001/XMLSchema-instance",xsd:"http://www.w3.org/2001/XMLSchema"};hr.main=["http://schemas.openxmlformats.org/spreadsheetml/2006/main","http://purl.oclc.org/ooxml/spreadsheetml/main","http://schemas.microsoft.com/office/excel/2006/main","http://schemas.microsoft.com/office/excel/2006/2"];var ur={o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel",ss:"urn:schemas-microsoft-com:office:spreadsheet",dt:"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882",mv:"http://macVmlSchemaUri",v:"urn:schemas-microsoft-com:vml",html:"http://www.w3.org/TR/REC-html40"};function dr(e,r){var t=1-2*(e[r+7]>>>7);var a=((e[r+7]&127)<<4)+(e[r+6]>>>4&15);var n=e[r+6]&15;for(var i=5;i>=0;--i)n=n*256+e[r+i];if(a==2047)return n==0?t*Infinity:NaN;if(a==0)a=-1022;else{a-=1023;n+=Math.pow(2,52)}return t*Math.pow(2,a-52)*n}function pr(e,r,t){var a=(r<0||1/r==-Infinity?1:0)<<7,n=0,i=0;var s=a?-r:r;if(!isFinite(s)){n=2047;i=isNaN(r)?26985:0}else if(s==0)n=i=0;else{n=Math.floor(Math.log(s)/Math.LN2);i=s*Math.pow(2,52-
hr.EXT_PROPS="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties";ta.EXT_PROPS="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties";var ma=["Worksheets","SheetNames","NamedRanges","DefinedNames","Chartsheets","ChartNames"];function ga(e,r,t,a){var n=[];if(typeof e=="string")n=nr(e,a);else for(var i=0;i<e.length;++i)n=n.concat(e[i].map(function(e){return{v:e}}));var s=typeof r=="string"?nr(r,a).map(function(e){return e.v}):r;var l=0,o=0;if(s.length>0)for(var f=0;f!==n.length;f+=2){o=+n[f+1].v;switch(n[f].v){case"Worksheets":;case"工作表":;case"Листы":;case"أوراق العمل":;case"ワークシート":;case"גליונות עבודה":;case"Arbeitsblätter":;case"Çalışma Sayfaları":;case"Feuilles de calcul":;case"Fogli di lavoro":;case"Folhas de cálculo":;case"Planilhas":;case"Regneark":;case"Hojas de cálculo":;case"Werkbladen":t.Worksheets=o;t.SheetNames=s.slice(l,l+o);break;case"Named Ranges":;case"Rangos con nombre":;case"名前付き一覧":;case"Benannte Bereiche":;case"Navngivne områder":t.NamedRanges=o;t.DefinedNames=s.slice(l,l+o);break;case"Charts":;case"Diagramme":t.Chartsheets=o;t.ChartNames=s.slice(l,l+o);break;}l+=o}}function ba(e,r,t){var a={};if(!r)r={};e=Ye(e);va.forEach(function(t){var n=(e.match(Qe(t[0]))||[])[1];switch(t[2]){case"string":if(n)r[t[1]]=Le(n);break;case"bool":r[t[1]]=n==="true";break;case"raw":var i=e.match(new RegExp("<"+t[0]+"[^>]*>([\\s\\S]*?)</"+t[0]+">"));if(i&&i.length>0)a[t[1]]=i[1];break;}});if(a.HeadingPairs&&a.TitlesOfParts)ga(a.HeadingPairs,a.TitlesOfParts,r,t);return r}var wa=or("Properties",null,{xmlns:hr.EXT_PROPS,"xmlns:vt":hr.vt});function ka(e){var r=[],t=or;if(!e)e={};e.Application="SheetJS";r[r.length]=Fe;r[r.length]=wa;va.forEach(function(a){if(e[a[1]]===undefined)return;var n;switch(a[2]){case"string":n=We(String(e[a[1]]));break;case"bool":n=e[a[1]]?"true":"false";break;}if(n!==undefined)r[r.length]=t(a[0],n)});r[r.length]=t("HeadingPairs",t("vt:vector",t("vt:variant","<vt:lpstr>Worksheets</vt:lpstr>")+t("vt:variant",t("vt:i4",String(e.Worksheets))),{size:2,baseType:"variant"}));r[r.length]=t("TitlesOfParts",t("vt:vector",e.SheetNames.map(function(e){return"<vt:lpstr>"+We(e)+"</vt:lpstr>"}).join(""),{size:e.Worksheets,baseType:"lpstr"}));if(r.length>2){r[r.length]="</Properties>";r[1]=r[1].replace("/>",">")}return r.join("")}hr.CUST_PROPS="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties";ta.CUST_PROPS="http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties";var ya=/<[^>]+>[^<]*/g;function xa(e,r){var t={},a="";var n=e.match(ya);if(n)for(var i=0;i!=n.length;++i){var s=n[i],l=Ne(s);switch(l[0]){case"<?xml":break;case"<Properties":break;case"<property":a=Le(l.name);break;case"</property>":a=null;break;default:if(s.indexOf("<vt:")===0){var o=s.split(">");var f=o[0].slice(4),c=o[1];switch(f){case"lpstr":;case"bstr":;case"lpwstr":t[a]=Le(c);break;case"bool":t[a]=Ge(c);break;case"i1":;case"i2":;case"i4":;case"i8":;case"int":;case"uint":t[a]=parseInt(c,10);break;case"r4":;case"r8":;case"decimal":t[a]=parseFloat(c);break;case"filetime":;case"date":t[a]=oe(c);break;case"cy":;case"error":t[a]=Le(c);break;default:if(f.slice(-1)=="/")break;if(r.WTF&&typeof console!=="undefined")console.warn("Unexpected",s,f,o);}}else if(s.slice(0,2)==="</"){}else if(r.WTF)throw new Error(s);}}return t}var _a=or("Properties",null,{xmlns:hr.CUST_PROPS,"xmlns:vt":hr.vt});function Sa(e){var r=[Fe,_a];if(!e)return r.join("");var t=1;Y(e).forEach(function a(n){++t;r[r.length]=or("property",cr(e[n],true),{fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:t,name:We(n)})});if(r.length>2){r[r.length]="</Properties>";r[1]=r[1].replace("/>",">")}return r.join("")}var Ca=function(){var e={1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127,8:865,9:437,10:850,11:437,13:437,14:850,15:437,16:850,17:437,18:850,19:932,
n.bold=1;break;case"<i":n.italic=l.val?Ge(l.val):1;break;case"<i/>":n.italic=1;break;case"<u":switch(l.val){case"none":n.underline=0;break;case"single":n.underline=1;break;case"double":n.underline=2;break;case"singleAccounting":n.underline=33;break;case"doubleAccounting":n.underline=34;break;}break;case"<u/>":n.underline=1;break;case"<strike":n.strike=l.val?Ge(l.val):1;break;case"<strike/>":n.strike=1;break;case"<outline":n.outline=l.val?Ge(l.val):1;break;case"<outline/>":n.outline=1;break;case"<shadow":n.shadow=l.val?Ge(l.val):1;break;case"<shadow/>":n.shadow=1;break;case"<condense":n.condense=l.val?Ge(l.val):1;break;case"<condense/>":n.condense=1;break;case"<extend":n.extend=l.val?Ge(l.val):1;break;case"<extend/>":n.extend=1;break;case"<sz":if(l.val)n.sz=+l.val;break;case"<sz/>":;case"</sz>":break;case"<vertAlign":if(l.val)n.vertAlign=l.val;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=i[parseInt(l.val,10)];break;case"<color":if(!n.color)n.color={};if(l.auto)n.color.auto=Ge(l.auto);if(l.rgb)n.color.rgb=l.rgb.slice(-6);else if(l.indexed){n.color.index=parseInt(l.indexed,10);var o=Vt[n.color.index];if(n.color.index==81)o=Vt[1];if(!o)throw new Error(e);n.color.rgb=o[0].toString(16)+o[1].toString(16)+o[2].toString(16)}else if(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=Ya(t.themeElements.clrScheme[n.color.theme].rgb,n.color.tint||0)}}break;case"<color/>":;case"</color>":break;case"<AlternateContent":s=true;break;case"</AlternateContent>":s=false;break;case"<extLst":;case"<extLst>":;case"</extLst>":break;case"<ext":s=true;break;case"</ext>":s=false;break;default:if(a&&a.WTF){if(!s)throw new Error("unrecognized "+l[0]+" in fonts")};}})}function pn(e,r,t){r.NumberFmt=[];var a=Y(N._table);for(var n=0;n<a.length;++n)r.NumberFmt[a[n]]=N._table[a[n]];var i=e[0].match(Oe);if(!i)return;for(n=0;n<i.length;++n){var s=Ne(i[n]);switch(Pe(s[0])){case"<numFmts":;case"</numFmts>":;case"<numFmts/>":;case"<numFmts>":break;case"<numFmt":{var l=Le(Ye(s.formatCode)),o=parseInt(s.numFmtId,10);r.NumberFmt[o]=l;if(o>0){if(o>392){for(o=392;o>60;--o)if(r.NumberFmt[o]==null)break;r.NumberFmt[o]=l}N.load(l,o)}}break;case"</numFmt>":break;default:if(t.WTF)throw new Error("unrecognized "+s[0]+" in numFmts");}}}function vn(e){var r=["<numFmts>"];[[5,8],[23,26],[41,44],[50,392]].forEach(function(t){for(var a=t[0];a<=t[1];++a)if(e[a]!=null)r[r.length]=or("numFmt",null,{numFmtId:a,formatCode:We(e[a])})});if(r.length===1)return"";r[r.length]="</numFmts>";r[0]=or("numFmts",null,{count:r.length-2}).replace("/>",">");return r.join("")}var mn=["numFmtId","fillId","fontId","borderId","xfId"];var gn=["applyAlignment","applyBorder","applyFill","applyFont","applyNumberFormat","applyProtection","pivotButton","quotePrefix"];function bn(e,r,t){r.CellXf=[];var a;var n=false;(e[0].match(Oe)||[]).forEach(function(e){var i=Ne(e),s=0;switch(Pe(i[0])){case"<cellXfs":;case"<cellXfs>":;case"<cellXfs/>":;case"</cellXfs>":break;case"<xf":;case"<xf/>":a=i;delete a[0];for(s=0;s<mn.length;++s)if(a[mn[s]])a[mn[s]]=parseInt(a[mn[s]],10);for(s=0;s<gn.length;++s)if(a[gn[s]])a[gn[s]]=Ge(a[gn[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/>":var l={};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=Ge(i.wrapText);a.alignment=l;break;case"</alignment>":break;case"<protection":break;case"</protection>":;case"<protection/>":break;case"<AlternateContent":n=true;break;case"</AlternateContent>":n=false;break;case"<extLst":;case"<extLst>":;case"</extLst>":break;case"<ext":n=true;break;case"<
var n="";var i=e.t,s=e.v;if(e.t!=="z")switch(e.t){case"b":n=e.v?"1":"0";break;case"n":n=""+e.v;break;case"e":n=Xt[e.v];break;case"d":if(a&&a.cellDates)n=oe(e.v,-1).toISOString();else{e=ce(e);e.t="n";n=""+(e.v=ee(oe(e.v)))}if(typeof e.z==="undefined")e.z=N._table[14];break;default:n=e.v;break;}var l=sr("v",We(n)),o={r:r};var f=ci(a.cellXfs,e,a);if(f!==0)o.s=f;switch(e.t){case"n":break;case"d":o.t="d";break;case"b":o.t="b";break;case"e":o.t="e";break;case"z":break;default:if(e.v==null){delete e.t;break}if(a&&a.bookSST){l=sr("v",""+li(a.Strings,e.v,a.revStrings));o.t="s";break}o.t="str";break;}if(e.t!=i){e.t=i;e.v=s}if(typeof e.f=="string"&&e.f){var c=e.F&&e.F.slice(0,r.length)==r?{t:"array",ref:e.F}:null;l=or("f",We(e.f),c)+(e.v!=null?l:"")}if(e.l)t["!links"].push([r,e.l]);if(e.c)t["!comments"].push([r,e.c]);return or("c",l,o)}var $i=function(){var e=/<(?:\w+:)?c[ >]/,r=/<\/(?:\w+:)?row>/;var t=/r=["']([^"']*)["']/,a=/<(?:\w+:)?is>([\S\s]*?)<\/(?:\w+:)?is>/;var n=/ref=["']([^"']*)["']/;var i=Qe("v"),s=Qe("f");return function l(o,f,c,h,u,d){var p=0,v="",m=[],g=[],b=0,w=0,k=0,y="",x;var _,S=0,C=0;var A,E;var F=0,T=0;var O=Array.isArray(d.CellXf),D;var M=[];var P=[];var R=Array.isArray(f);var I=[],L={},B=false;for(var z=o.split(r),W=0,$=z.length;W!=$;++W){v=z[W].trim();var U=v.length;if(U===0)continue;for(p=0;p<U;++p)if(v.charCodeAt(p)===62)break;++p;_=Ne(v.slice(0,p),true);S=_.r!=null?parseInt(_.r,10):S+1;C=-1;if(c.sheetRows&&c.sheetRows<S)continue;if(h.s.r>S-1)h.s.r=S-1;if(h.e.r<S-1)h.e.r=S-1;if(c&&c.cellStyles){L={};B=false;if(_.ht){B=true;L.hpt=parseFloat(_.ht);L.hpx=fn(L.hpt)}if(_.hidden=="1"){B=true;L.hidden=true}if(_.outlineLevel!=null){B=true;L.level=+_.outlineLevel}if(B)I[S-1]=L}m=v.slice(p).split(e);for(var j=0;j!=m.length;++j)if(m[j].trim().charAt(0)!="<")break;m=m.slice(j);for(p=0;p!=m.length;++p){v=m[p].trim();if(v.length===0)continue;g=v.match(t);b=p;w=0;k=0;v="<c "+(v.slice(0,1)=="<"?">":"")+v;if(g!=null&&g.length===2){b=0;y=g[1];for(w=0;w!=y.length;++w){if((k=y.charCodeAt(w)-64)<1||k>26)break;b=26*b+k}--b;C=b}else++C;for(w=0;w!=v.length;++w)if(v.charCodeAt(w)===62)break;++w;_=Ne(v.slice(0,w),true);if(!_.r)_.r=pt({r:S-1,c:C});y=v.slice(w);x={t:""};if((g=y.match(i))!=null&&g[1]!=="")x.v=Le(g[1]);if(c.cellFormula){if((g=y.match(s))!=null&&g[1]!==""){x.f=Le(Ye(g[1]));if(!c.xlfn)x.f=ai(x.f);if(g[0].indexOf('t="array"')>-1){x.F=(y.match(n)||[])[1];if(x.F.indexOf(":")>-1)M.push([gt(x.F),x.F])}else if(g[0].indexOf('t="shared"')>-1){E=Ne(g[0]);var H=Le(Ye(g[1]));if(!c.xlfn)H=ai(H);P[parseInt(E.si,10)]=[E,H,_.r]}}else if(g=y.match(/<f[^>]*\/>/)){E=Ne(g[0]);if(P[E.si])x.f=ri(P[E.si][1],P[E.si][2],_.r)}var V=dt(_.r);for(w=0;w<M.length;++w)if(V.r>=M[w][0].s.r&&V.r<=M[w][0].e.r)if(V.c>=M[w][0].s.c&&V.c<=M[w][0].e.c)x.F=M[w][1]}if(_.t==null&&x.v===undefined){if(x.f||x.F){x.v=0;x.t="n"}else if(!c.sheetStubs)continue;else x.t="z"}else x.t=_.t||"n";if(h.s.c>C)h.s.c=C;if(h.e.c<C)h.e.c=C;switch(x.t){case"n":if(x.v==""||x.v==null){if(!c.sheetStubs)continue;x.t="z"}else x.v=parseFloat(x.v);break;case"s":if(typeof x.v=="undefined"){if(!c.sheetStubs)continue;x.t="z"}else{A=ni[parseInt(x.v,10)];x.v=A.t;x.r=A.r;if(c.cellHTML)x.h=A.h}break;case"str":x.t="s";x.v=x.v!=null?Ye(x.v):"";if(c.cellHTML)x.h=je(x.v);break;case"inlineStr":g=y.match(a);x.t="s";if(g!=null&&(A=La(g[1]))){x.v=A.t;if(c.cellHTML)x.h=A.h}else x.v="";break;case"b":x.v=Ge(x.v);break;case"d":if(c.cellDates)x.v=oe(x.v,1);else{x.v=ee(oe(x.v,1));x.t="n"}break;case"e":if(!c||c.cellText!==false)x.w=x.v;x.v=Gt[x.v];break;}F=T=0;D=null;if(O&&_.s!==undefined){D=d.CellXf[_.s];if(D!=null){if(D.numFmtId!=null)F=D.numFmtId;if(c.cellStyles){if(D.fillId!=null)T=D.fillId}}}hi(x,F,T,c,u,d);if(c.cellDates&&O&&x.t=="n"&&N.is_date(N._table[F])){x.t="d";x.v=ne(x.v)}if(R){var X=dt(_.r);if(!f[X.r])f[X.r]=[];f[X.r][X.c]=x}else f[_.r]=x}}if(I.length>0)f["!rows"]=I}}();function Ui(e,r,t,a){var n=[],i=[],s=gt(e["!ref"]),l="",o,f="",c=[],h=0,u=0,d=e["!rows"];var p=Array.isArray(e);var v={r:f},m,g=-1;for(u=s.s.c;u<=s.e.c;++u)c[u]=ft(u);for(h=s.s.r;h<=s.e.r;++h){i=[];f=it(h);for(u=s.s.c;u<=s.e.c;++u)
s="xl/vbaProject.bin";Se(i,s,e.vbaraw);n.vba.push(s);oa(r.wbrels,-1,"vbaProject.bin",ta.VBA)}Se(i,"[Content_Types].xml",ra(n,r));Se(i,"_rels/.rels",sa(r.rels));Se(i,"xl/_rels/workbook."+t+".rels",sa(r.wbrels));delete r.revssf;delete r.ssf;return i}function il(e,r){var t="";switch((r||{}).type||"base64"){case"buffer":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];case"base64":t=b.decode(e.slice(0,12));break;case"binary":t=e;break;case"array":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];default:throw new Error("Unrecognized type "+(r&&r.type||"undefined"));}return[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3),t.charCodeAt(4),t.charCodeAt(5),t.charCodeAt(6),t.charCodeAt(7)]}function sl(e,r){if(j.find(e,"EncryptedPackage"))return al(e,r);return parse_xlscfb(e,r)}function ll(e,r){var t,a=e;var n=r||{};if(!n.type)n.type=w&&Buffer.isBuffer(e)?"buffer":"base64";t=Ae(a,n);return tl(t,n)}function ol(e,r){var t=0;e:while(t<e.length)switch(e.charCodeAt(t)){case 10:;case 13:;case 32:++t;break;case 60:return parse_xlml(e.slice(t),r);default:break e;}return Ta.to_workbook(e,r)}function fl(e,r){var t="",a=il(e,r);switch(r.type){case"base64":t=b.decode(e);break;case"binary":t=e;break;case"buffer":t=e.toString("binary");break;case"array":t=fe(e);break;default:throw new Error("Unrecognized type "+r.type);}if(a[0]==239&&a[1]==187&&a[2]==191)t=Ye(t);return ol(t,r)}function cl(e,r){var t=e;if(r.type=="base64")t=b.decode(t);t=cptable.utils.decode(1200,t.slice(2),"str");r.type="binary";return ol(t,r)}function hl(e){return!e.match(/[^\x00-\x7F]/)?e:Je(e)}function ul(e,r,t,a){if(a){t.type="string";return Ta.to_workbook(e,t)}return Ta.to_workbook(r,t)}function dl(e,r){f();if(typeof ArrayBuffer!=="undefined"&&e instanceof ArrayBuffer)return dl(new Uint8Array(e),r);var t=e,a=[0,0,0,0],n=false;var i=r||{};if(i.cellStyles){i.cellNF=true;i.sheetStubs=true}ii={};if(i.dateNF)ii.dateNF=i.dateNF;if(!i.type)i.type=w&&Buffer.isBuffer(e)?"buffer":"base64";if(i.type=="file"){i.type=w?"buffer":"binary";t=G(e)}if(i.type=="string"){n=true;i.type="binary";i.codepage=65001;t=hl(e)}if(i.type=="array"&&typeof Uint8Array!=="undefined"&&e instanceof Uint8Array&&typeof ArrayBuffer!=="undefined"){var s=new ArrayBuffer(3),l=new Uint8Array(s);l.foo="bar";if(!l.foo){i=ce(i);i.type="array";return dl(T(t),i)}}switch((a=il(t,i))[0]){case 208:if(a[1]===207&&a[2]===17&&a[3]===224&&a[4]===161&&a[5]===177&&a[6]===26&&a[7]===225)return sl(j.read(t,i),i);break;case 9:if(a[1]<=4)return parse_xlscfb(t,i);break;case 60:return parse_xlml(t,i);case 73:if(a[1]===68)return Oa(t,i);break;case 84:if(a[1]===65&&a[2]===66&&a[3]===76)return Ea.to_workbook(t,i);break;case 80:return a[1]===75&&a[2]<9&&a[3]<9?ll(t,i):ul(e,t,i,n);case 239:return a[3]===60?parse_xlml(t,i):ul(e,t,i,n);case 255:if(a[1]===254){return cl(t,i)}break;case 0:if(a[1]===0&&a[2]>=2&&a[3]===0)return WK_.to_workbook(t,i);break;case 3:;case 131:;case 139:;case 140:return Ca.to_workbook(t,i);case 123:if(a[1]===92&&a[2]===114&&a[3]===116)return RTF.to_workbook(t,i);break;case 10:;case 13:;case 32:return fl(t,i);}if(Ca.versions.indexOf(a[0])>-1&&a[2]<=12&&a[3]<=31)return Ca.to_workbook(t,i);return ul(e,t,i,n)}function pl(e,r){var t=r||{};t.type="file";return dl(e,t)}function vl(e,r){switch(r.type){case"base64":;case"binary":break;case"buffer":;case"array":r.type="";break;case"file":return X(r.file,j.write(e,{type:w?"buffer":""}));case"string":throw new Error("'string' output type invalid for '"+r.bookType+"' files");default:throw new Error("Unrecognized type "+r.type);}return j.write(e,r)}function ml(e,r){var t=r||{};var a=nl(e,t);var n={};if(t.compression)n.compression="DEFLATE";if(t.password)n.type=w?"nodebuffer":"string";else switch(t.type){case"base64":n.type="base64";break;case"binary":n.type="string";break;case"string":throw new Error("'string' output type invalid for '"+t.bookType+"' files");case"buffer":;case"file":n.type=w?"nodebuffer":"string";break;default:throw new Error("Unrecognized type "+t.type);}var i=a.FullPaths?j.write(a,{fileType:"zip",type:{nodebuffer:"buffer",string:"binary"}[n.type]||n.