sheetjs/dist/xlsx.mini.min.js

10 lines
241 KiB
JavaScript
Raw Normal View History

/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
2022-02-10 12:40:50 +00:00
var DO_NOT_EXPORT_CODEPAGE=true;var XLSX={};function make_xlsx_lib(e){e.version="0.18.0";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 o(){s(1252)}var l=function(e){r=e;s(e)};function c(){l(1200);o()}function f(e){var r=[];for(var t=0,a=e.length;t<a;++t)r[t]=e.charCodeAt(t);return r}function u(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 h(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 u(e.slice(2));if(r==254&&t==255)return h(e.slice(2));if(r==65279)return e.slice(1);return e};var p=function Vo(e){return String.fromCharCode(e)};var v=function Xo(e){return String.fromCharCode(e)};var m=null;var g=true;var b=function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return{encode:function(r){var t="";var a=0,n=0,i=0,s=0,o=0,l=0,c=0;for(var f=0;f<r.length;){a=r.charCodeAt(f++);s=a>>2;n=r.charCodeAt(f++);o=(a&3)<<4|n>>4;i=r.charCodeAt(f++);l=(n&15)<<2|i>>6;c=i&63;if(isNaN(n)){l=c=64}else if(isNaN(i)){c=64}t+=e.charAt(s)+e.charAt(o)+e.charAt(l)+e.charAt(c)}return t},decode:function(r){var t="";var a=0,n=0,i=0,s=0,o=0,l=0,c=0;r=r.replace(/[^\w\+\/\=]/g,"");for(var f=0;f<r.length;){s=e.indexOf(r.charAt(f++));o=e.indexOf(r.charAt(f++));a=s<<2|o>>4;t+=String.fromCharCode(a);l=e.indexOf(r.charAt(f++));n=(o&15)<<4|l>>2;if(l!==64){t+=String.fromCharCode(n)}c=e.indexOf(r.charAt(f++));i=(l&3)<<6|c;if(c!==64){t+=String.fromCharCode(i)}}return t}}}();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 S(e){return w?Buffer.alloc(e):typeof Uint8Array!="undefined"?new Uint8Array(e):new Array(e)}function _(e){return w?Buffer.allocUnsafe(e):typeof Uint8Array!="undefined"?new Uint8Array(e):new Array(e)}var C=function Go(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}function O(e){var r=[],t=0;var a=S(e.length+255);for(var n=0;n<e.length;++n){var i=e.charCodeAt(n);if(i<128)a[t++]=i;else if(i<2048){a[t++]=192|i>>6&31;a[t++]=128|i&63}else if(i>=55296&&i<57344){i=(i&1023)+64;var s=str.charCodeAt(++n)&1023;a[t++]=240|i>>8&7;a[t++]=128|i>>2&63;a[t++]=128|s>>6&15|(i&3)<<4;a[t++]=128|s&63}else{a[t++]=224|i>>12&15;a[t++]=128|i>>6&63;a[t++]=128|i&63}if(t>65530){r.push(a.slice(0,t));t=0;a=S(65535)}}r.push(a.slice(0,t));return D(r)}var D=function(e){if(typeof Uint8Array!=="undefined"){var r=0,t=0;for(r=0;r<e.length;++r)t+=e[r].length;var a=new Uint8Array(t);var n=0;for(r=0,t=0;r<e.length;t+=n,++r){n=e[r].length;if(e[r]instanceof Uint8Array)a.set(e[r],t);else if(typeof e[r]=="
n+=15;while(k<n)a=a>>>8^t[(a^e[k++])&255];return~a}function x(e,r){var a=r^-1;for(var n=0,i=e.length,s=0,o=0;n<i;){s=e.charCodeAt(n++);if(s<128){a=a>>>8^t[(a^s)&255]}else if(s<2048){a=a>>>8^t[(a^(192|s>>6&31))&255];a=a>>>8^t[(a^(128|s&63))&255]}else if(s>=55296&&s<57344){s=(s&1023)+64;o=e.charCodeAt(n++)&1023;a=a>>>8^t[(a^(240|s>>8&7))&255];a=a>>>8^t[(a^(128|s>>2&63))&255];a=a>>>8^t[(a^(128|o>>6&15|(s&3)<<4))&255];a=a>>>8^t[(a^(128|o&63))&255]}else{a=a>>>8^t[(a^(224|s>>12&15))&255];a=a>>>8^t[(a^(128|s>>6&63))&255];a=a>>>8^t[(a^(128|s&63))&255]}}return~a}e.table=t;e.bstr=k;e.buf=y;e.str=x});var H=function Jo(){var e={};e.version="1.2.1";function r(e,r){var t=e.split("/"),a=r.split("/");for(var n=0,i=0,s=Math.min(t.length,a.length);n<s;++n){if(i=t[n].length-a[n].length)return i;if(t[n]!=a[n])return t[n]<a[n]?-1:1}return t.length-a.length}function t(e){if(e.charAt(e.length-1)=="/")return e.slice(0,-1).indexOf("/")===-1?e:t(e.slice(0,-1));var r=e.lastIndexOf("/");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 o=r&63;r>>>=6;a.setHours(r);a.setMinutes(o);a.setSeconds(s<<1);return a}function s(e){Jr(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 o;function l(){return o||(o=require("fs"))}function c(e,r){if(e[0]==80&&e[1]==75)return Me(e,r);if((e[0]|32)==109&&(e[1]|32)==105)return $e(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 o=0;var l=0;var c=[];var p=e.slice(0,512);Jr(p,0);var m=f(p);t=m[0];switch(t){case 3:a=512;break;case 4:a=4096;break;case 0:if(m[1]==0)return Me(e,r);default:throw new Error("Major Version: Expected 3 or 4 saw "+t);}if(a!==512){p=e.slice(0,a);Jr(p,28)}var b=e.slice(0,a);u(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: ");o=p._R(4,"i");n=p._R(4,"i");l=p._R(4,"i");i=p._R(4,"i");for(var k=-1,x=0;x<109;++x){k=p._R(4,"i");if(k<0)break;c[x]=k}var S=h(e,a);v(l,i,S,a,c);var _=g(S,s,c,a);_[s].name="!Directory";if(n>0&&o!==L)_[o].name="!MiniFAT";_[c[0]].name="!FAT";_.fat_addrs=c;_.ssz=a;var C={},A=[],E=[],F=[];y(s,_,S,A,n,C,E,o);d(E,F,A);A.shift();var T={FileIndex:E,FullPaths:F};if(r&&r.raw)T.raw={header:b,sectors:S};return T}function f(e){if(e[e.l]==80&&e[e.l+1]==75)return[0,0];e.chk(B,"Header Signature: ");e.l+=16;var r=e._R(2,"u");return[e._R(2,"u"),r]}function u(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 h(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,o=0,l=t.length;var c=[],f=[];for(;a<l;++a){c[a]=f[a]=a;r[a]=t[a]}for(;o<f.length;++o){a=f[o];n=e[a].L;i=e[a].R;s=e[a].C;if(c[a]===a){if(n!==-1&&c[n]!==n)c[a]=c[n];if(i!==-1&&c[i]!==i)c[a]=c[i]}if(s!==-1)c[s]=a;if(n!==-1&&a!=c[a]){c[n]=c[a];if(f.lastIndexOf(n)<o)f.push(n)}if(i!==-1&&a!=c[a]){c[i]=c[a];if(f.lastIndexOf(i)<o)f.push(i)}}for(a=1;a<l;++a)if(c[a]===a){if(i!==-1&&c[i]!==i)c[a]=c[i];else if(n!==-1&&c[n]!==n)c[a]=c[n]}for(a=1;a<l;++a){if(e[a].type===0)
}var t=[];for(var a=0;a!=e.length;++a)t.push(String.fromCharCode(e[a]));return t.join("")}function ue(e){if(typeof JSON!="undefined"&&!Array.isArray(e))return JSON.parse(JSON.stringify(e));if(typeof e!="object"||e==null)return e;if(e instanceof Date)return new Date(e.getTime());var r={};for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))r[t]=ue(e[t]);return r}function he(e,r){var t="";while(t.length<r)t+=e;return t}function de(e){var r=Number(e);if(isFinite(r))return r;if(!isNaN(r))return NaN;if(!/\d/.test(e))return r;var t=1;var a=e.replace(/([\d]),([\d])/g,"$1$2").replace(/[$]/g,"").replace(/[%]/g,function(){t*=100;return""});if(!isNaN(r=Number(a)))return r/t;a=a.replace(/[(](.*)[)]/,function(e,r){t=-t;return r});if(!isNaN(r=Number(a)))return r/t;return r}function pe(e){var r=new Date(e),t=new Date(NaN);var a=r.getYear(),n=r.getMonth(),i=r.getDate();if(isNaN(i))return t;if(a<0||a>8099)return t;if((n>0||i>1)&&a!=101)return r;if(e.toLowerCase().match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/))return r;if(e.match(/[^-0-9:,\/\\]/))return t;return r}var ve="abacaba".split(/(:?b)/i).length==5;function me(e,r,t){if(ve||typeof r=="string")return e.split(r);var a=e.split(r),n=[a[0]];for(var i=1;i<a.length;++i){n.push(t);n.push(a[i])}return n}function ge(e){if(!e)return null;if(e.data)return d(e.data);if(e.asNodeBuffer&&w)return d(e.asNodeBuffer().toString("binary"));if(e.asBinary)return d(e.asBinary());if(e._data&&e._data.getContent)return d(fe(Array.prototype.slice.call(e._data.getContent(),0)));if(e.content&&e.type)return d(fe(e.content));return null}function be(e){if(!e)return null;if(e.data)return f(e.data);if(e.asNodeBuffer&&w)return e.asNodeBuffer();if(e._data&&e._data.getContent){var r=e._data.getContent();if(typeof r=="string")return f(r);return Array.prototype.slice.call(r)}if(e.content&&e.type)return e.content;return null}function we(e){return e&&e.name.slice(-4)===".bin"?be(e):ge(e)}function ke(e,r){var t=e.FullPaths||J(e.files);var a=r.toLowerCase().replace(/[\/]/g,"\\"),n=a.replace(/\\/g,"/");for(var i=0;i<t.length;++i){var s=t[i].replace(/^Root Entry[\/]/,"").toLowerCase();if(a==s||n==s)return e.files?e.files[t[i]]:e.FileIndex[i]}return null}function ye(e,r){var t=ke(e,r);if(t==null)throw new Error("Cannot find file "+r+" in zip");return t}function xe(e,r,t){if(!t)return we(ye(e,r));if(!r)return null;try{return xe(e,r)}catch(a){return null}}function Se(e,r,t){if(!t)return ge(ye(e,r));if(!r)return null;try{return Se(e,r)}catch(a){return null}}function _e(e){var r=e.FullPaths||J(e.files),t=[];for(var a=0;a<r.length;++a)if(r[a].slice(-1)!="/")t.push(r[a].replace(/^Root Entry[\/]/,""));return t.sort()}function Ce(e,r,t){if(e.FullPaths)H.utils.cfb_add(e,r,typeof t=="string"?w?k(t):C(Ke(t)):t);else e.file(r,t)}function Ae(){return H.utils.cfb_new()}function Ee(e,r){var t;switch(r.type){case"base64":t=H.read(e,{type:"base64"});break;case"binary":t=H.read(e,{type:"binary"});break;case"buffer":;case"array":t=H.read(e,{type:"buffer"});break;default:throw new Error("Unrecognized type "+r.type);}return t}function Fe(e,r){if(e.charAt(0)=="/")return e.slice(1);var t=r.split("/");if(r.slice(-1)!="/")t.pop();var a=e.split("/");while(a.length!==0){var n=a.shift();if(n==="..")t.pop();else if(n!==".")t.push(n)}return t.join("/")}var Te='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n';var Oe=/([^"\s?>\/]+)\s*=\s*((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g;var De=/<[\/\?]?[a-zA-Z0-9:_-]+(?:\s+[^"\s?>\/]+\s*=\s*(?:"[^"]*"|'[^']*'|[^'">\s=]+))*\s*[\/\?]?>/gm;if(!Te.match(De))De=/<[^>]*>/g;var Me=/<\w*:/,Ne=/<(\/?)\w+:/;function Ie(e,r,t){var a={};var n=0,i=0;for(;n!==e.length;++n)if((i=e.charCodeAt(n))===32||i===10||i===13)break;if(!r)a[0]=e.slice(0,n);if(n===e.length)return a;var s=e.match(Oe),o=0,l="",c=0,f="",u="",h=1;if(s)for(c=0;c!=s.length;++c){u=s[c];for(i=0;i!=u.length;++i)if(u.charCodeAt(i)===61)break;f=u.slice(0,i).trim();while(u.charCodeAt(i+1)==32)++i;h=(n=u.charCodeAt(i+1))==34||n==39?1:0;l=u.slice(i+1+h,u.length-h);for(o=0;o!=f.length;++o)if(f.charCodeAt(o)===58)break;if(o===f.length)
xlsb:"application/vnd.ms-excel.chartsheet"},dialogs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml",xlsb:"application/vnd.ms-excel.dialogsheet"},macros:{xlsx:"application/vnd.ms-excel.macrosheet+xml",xlsb:"application/vnd.ms-excel.macrosheet"},styles:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",xlsb:"application/vnd.ms-excel.styles"}};J(e).forEach(function(r){["xlsm","xlam"].forEach(function(t){if(!e[r][t])e[r][t]=e[r].xlsx})});J(e).forEach(function(r){J(e[r]).forEach(function(t){Yt[e[r][t]]=r})});return e}();var Kt=Q(Yt);hr.CT="http://schemas.openxmlformats.org/package/2006/content-types";function qt(){return{workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],TODO:[],xmlns:""}}function Zt(e){var r=qt();if(!e||!e.match)return r;var t={};(e.match(De)||[]).forEach(function(e){var a=Ie(e);switch(a[0].replace(Me,"<")){case"<?xml":break;case"<Types":r.xmlns=a["xmlns"+(a[0].match(/<(\w+):/)||["",""])[1]];break;case"<Default":t[a.Extension]=a.ContentType;break;case"<Override":if(r[Yt[a.ContentType]]!==undefined)r[Yt[a.ContentType]].push(a.PartName);break;}});if(r.xmlns!==hr.CT)throw new Error("Unknown Namespace: "+r.xmlns);r.calcchain=r.calcchains.length>0?r.calcchains[0]:"";r.sst=r.strs.length>0?r.strs[0]:"";r.style=r.styles.length>0?r.styles[0]:"";r.defaults=t;delete r.calcchains;return r}var Qt=cr("Types",null,{xmlns:hr.CT,"xmlns:xsd":hr.xsd,"xmlns:xsi":hr.xsi});var ea=[["xml","application/xml"],["bin","application/vnd.ms-excel.sheet.binary.macroEnabled.main"],["vml","application/vnd.openxmlformats-officedocument.vmlDrawing"],["data","application/vnd.openxmlformats-officedocument.model+data"],["bmp","image/bmp"],["png","image/png"],["gif","image/gif"],["emf","image/x-emf"],["wmf","image/x-wmf"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["tif","image/tiff"],["tiff","image/tiff"],["pdf","application/pdf"],["rels",Kt.rels[0]]].map(function(e){return cr("Default",null,{Extension:e[0],ContentType:e[1]})});function ra(e,r){var t=[],a;t[t.length]=Te;t[t.length]=Qt;t=t.concat(ea);var n=function(n){if(e[n]&&e[n].length>0){a=e[n][0];t[t.length]=cr("Override",null,{PartName:(a[0]=="/"?"":"/")+a,ContentType:Jt[n][r.bookType||"xlsx"]})}};var i=function(a){(e[a]||[]).forEach(function(e){t[t.length]=cr("Override",null,{PartName:(e[0]=="/"?"":"/")+e,ContentType:Jt[a][r.bookType||"xlsx"]})})};var s=function(r){(e[r]||[]).forEach(function(e){t[t.length]=cr("Override",null,{PartName:(e[0]=="/"?"":"/")+e,ContentType:Kt[r][0]})})};n("workbooks");i("sheets");i("charts");s("themes");["strs","styles"].forEach(n);["coreprops","extprops","custprops"].forEach(s);s("vba");s("comments");s("drawings");if(t.length>2){t[t.length]="</Types>";t[1]=t[1].replace("/>",">")}return t.join("")}var ta={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",SHEET:"http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument",HLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",VML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",XPATH:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",XMISS:"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",XLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",CXML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",CXMLP:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps",VBA:"http://schemas.microsoft.com/office/2006/relationships/vbaProject"};function aa(e){var r=e.lastIndexOf("/");return e.slice(0,r+1)+"_rels/"+e.slice(r+1)+".rels"}function na(e,r){var t={"!id":{}};if(!e)return t;if(r.charAt(0)!=="/"){r="/"+r}var a={};(e.match(De)||[]).forEach(function(e){var n=Ie(e);if(n[0]==="<Relationship"){var i={};i.Type=n.Type;i.Target=n.Target;i.Id=n.Id;i
;case"<u":if(!s.val)break;switch(s.val){case"double":r.uval="double";break;case"singleAccounting":r.uval="single-accounting";break;case"doubleAccounting":r.uval="double-accounting";break;};case"<u>":;case"<u/>":r.u=1;break;case"</u>":break;case"<b":if(s.val=="0")break;case"<b>":;case"<b/>":r.b=1;break;case"</b>":break;case"<i":if(s.val=="0")break;case"<i>":;case"<i/>":r.i=1;break;case"</i>":break;case"<color":if(s.rgb)r.color=s.rgb.slice(2,8);break;case"<color>":;case"<color/>":;case"</color>":break;case"<family":r.family=s.val;break;case"<family>":;case"<family/>":;case"</family>":break;case"<vertAlign":r.valign=s.val;break;case"<vertAlign>":;case"<vertAlign/>":;case"</vertAlign>":break;case"<scheme":break;case"<scheme>":;case"<scheme/>":;case"</scheme>":break;case"<extLst":;case"<extLst>":;case"</extLst>":break;case"<ext":n=true;break;case"</ext>":n=false;break;default:if(s[0].charCodeAt(1)!==47&&!n)throw new Error("Unrecognized rich format "+s[0]);}}return r}var Ma=function(){var e=er("t"),r=er("rPr");function t(t){var a=t.match(e);if(!a)return{t:"s",v:""};var n={t:"s",v:Be(a[1])};var i=t.match(r);if(i)n.s=Da(i[1]);return n}var a=/<(?:\w+:)?r>/g,n=/<\/(?:\w+:)?r>/;return function i(e){return e.replace(a,"").split(n).map(t).filter(function(e){return e.v})}}();var Na=function cl(){var e=/(\r\n|\n)/g;function r(e,r,t){var a=[];if(e.u)a.push("text-decoration: underline;");if(e.uval)a.push("text-underline-style:"+e.uval+";");if(e.sz)a.push("font-size:"+e.sz+"pt;");if(e.outline)a.push("text-effect: outline;");if(e.shadow)a.push("text-shadow: auto;");r.push('<span style="'+a.join("")+'">');if(e.b){r.push("<b>");t.push("</b>")}if(e.i){r.push("<i>");t.push("</i>")}if(e.strike){r.push("<s>");t.push("</s>")}var n=e.valign||"";if(n=="superscript"||n=="super")n="sup";else if(n=="subscript")n="sub";if(n!=""){r.push("<"+n+">");t.push("</"+n+">")}t.push("</span>");return e}function t(t){var a=[[],t.v,[]];if(!t.v)return"";if(t.s)r(t.s,a[0],a[2]);return a[0].join("")+a[1].replace(e,"<br/>")+a[2].join("")}return function a(e){return e.map(t).join("")}}();var Ia=/<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g,Ra=/<(?:\w+:)?r>/;var Pa=/<(?:\w+:)?rPh.*?>([\s\S]*?)<\/(?:\w+:)?rPh>/g;function La(e,r){var t=r?r.cellHTML:true;var a={};if(!e)return{t:""};if(e.match(/^\s*<(?:\w+:)?t[^>]*>/)){a.t=Be(Je(e.slice(e.indexOf(">")+1).split(/<\/(?:\w+:)?t>/)[0]||""));a.r=Je(e);if(t)a.h=He(a.t)}else if(e.match(Ra)){a.r=Je(e);a.t=Be(Je((e.replace(Pa,"").match(Ia)||[]).join("").replace(De,"")));if(t)a.h=Na(Ma(a.r))}return a}var Ba=/<(?:\w+:)?sst([^>]*)>([\s\S]*)<\/(?:\w+:)?sst>/;var za=/<(?:\w+:)?(?:si|sstItem)>/g;var Ua=/<\/(?:\w+:)?(?:si|sstItem)>/;function $a(e,r){var t=[],a="";if(!e)return t;var n=e.match(Ba);if(n){a=n[2].replace(za,"").split(Ua);for(var i=0;i!=a.length;++i){var s=La(a[i].trim(),r);if(s!=null)t[t.length]=s}n=Ie(n[1]);t.Count=n.count;t.Unique=n.uniqueCount}return t}ta.SST="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings";var Wa=/^\s|\s$|[\t\n\r]/;function ja(e,r){if(!r.bookSST)return"";var t=[Te];t[t.length]=cr("sst",null,{xmlns:hr.main[0],count:e.Count,uniqueCount:e.Unique});for(var a=0;a!=e.length;++a){if(e[a]==null)continue;var n=e[a];var i="<si>";if(n.r)i+=n.r;else{i+="<t";if(!n.t)n.t="";if(n.t.match(Wa))i+=' xml:space="preserve"';i+=">"+$e(n.t)+"</t>"}i+="</si>";t[t.length]=i}if(t.length>2){t[t.length]="</sst>";t[1]=t[1].replace("/>",">")}return t.join("")}function Ha(e){var r=e.slice(e[0]==="#"?1:0).slice(0,6);return[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16)]}function Va(e){for(var r=0,t=1;r!=3;++r)t=t*256+(e[r]>255?255:e[r]<0?0:e[r]);return t.toString(16).toUpperCase().slice(1)}function Xa(e){var r=e[0]/255,t=e[1]/255,a=e[2]/255;var n=Math.max(r,t,a),i=Math.min(r,t,a),s=n-i;if(s===0)return[0,0,r];var o=0,l=0,c=n+i;l=s/(c>1?2-c:c);switch(n){case r:o=((t-a)/s+6)%6;break;case t:o=(a-r)/s+2;break;case a:o=(r-t)/s+4;break;}return[o/6,l,c/2]}function Ga(e){var r=e[0],t=e[1],a=e[2];var n=t*2*(a<.5?a:1-a),i=a-n/2;var s=[i,i,i],o=6*r;var l;if(t!==0)switch(o|0){case 0:;case 6
if(i)l+=r.c;else--l;if(s)o+=r.r;else--o;return t+(i?"":"$")+ft(l)+(s?"":"$")+st(o)}return function a(n,i){r=i;return n.replace(e,t)}}();var Zn=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g;var Qn=function(){return function e(r,t){return r.replace(Zn,function(e,r,a,n,i,s){var o=ct(n)-(a?0:t.c);var l=it(s)-(i?0:t.r);var c=l==0?"":!i?"["+l+"]":l+1;var f=o==0?"":!a?"["+o+"]":o+1;return r+"R"+c+"C"+f})}}();function ei(e,r){return e.replace(Zn,function(e,t,a,n,i,s){return t+(a=="$"?a+n:ft(ct(n)+r.c))+(i=="$"?i+s:st(it(s)+r.r))})}function ri(e,r,t){var a=mt(r),n=a.s,i=pt(t);var s={r:i.r-n.r,c:i.c-n.c};return ei(e,s)}function ti(e){if(e.length==1)return false;return true}function ai(e){return e.replace(/_xlfn\./g,"")}var ni={};var ii={};ta.WS=["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"];var si=typeof Map!=="undefined";function oi(e,r,t){var a=0,n=e.length;if(t){if(si?t.has(r):Object.prototype.hasOwnProperty.call(t,r)){var i=si?t.get(r):t[r];for(;a<i.length;++a){if(e[i[a]].t===r){e.Count++;return i[a]}}}}else for(;a<n;++a){if(e[a].t===r){e.Count++;return a}}e[n]={t:r};e.Count++;e.Unique++;if(t){if(si){if(!t.has(r))t.set(r,[]);t.get(r).push(n)}else{if(!Object.prototype.hasOwnProperty.call(t,r))t[r]=[];t[r].push(n)}}return n}function li(e,r){var t={min:e+1,max:e+1};var a=-1;if(r.MDW)Za=r.MDW;if(r.width!=null)t.customWidth=1;else if(r.wpx!=null)a=en(r.wpx);else if(r.wch!=null)a=r.wch;if(a>-1){t.width=rn(a);t.customWidth=1}else if(r.width!=null)t.width=r.width;if(r.hidden)t.hidden=true;if(r.level!=null){t.outlineLevel=t.level=r.level}return t}function ci(e,r){if(!e)return;var t=[.7,.7,.75,.75,.3,.3];if(r=="xlml")t=[1,1,1,1,.5,.5];if(e.left==null)e.left=t[0];if(e.right==null)e.right=t[1];if(e.top==null)e.top=t[2];if(e.bottom==null)e.bottom=t[3];if(e.header==null)e.header=t[4];if(e.footer==null)e.footer=t[5]}function fi(e,r,t){var a=t.revssf[r.z!=null?r.z:"General"];var n=60,i=e.length;if(a==null&&t.ssf){for(;n<392;++n)if(t.ssf[n]==null){I.load(r.z,n);t.ssf[n]=r.z;t.revssf[r.z]=a=n;break}}for(n=0;n!=i;++n)if(e[n].numFmtId===a)return n;e[i]={numFmtId:a,fontId:0,fillId:0,borderId:0,xfId:0,applyNumberFormat:1};return i}function ui(e,r,t,a,n,i){try{if(a.cellNF)e.z=I._table[r]}catch(s){if(a.WTF)throw s}if(e.t==="z"&&!a.cellStyles)return;if(e.t==="d"&&typeof e.v==="string")e.v=ce(e.v);if((!a||a.cellText!==false)&&e.t!=="z")try{if(I._table[r]==null)I.load(L[r]||"General",r);if(e.t==="e")e.w=e.w||Xt[e.v];else if(r===0){if(e.t==="n"){if((e.v|0)===e.v)e.w=I._general_int(e.v);else e.w=I._general_num(e.v)}else if(e.t==="d"){var o=re(e.v);if((o|0)===o)e.w=I._general_int(o);else e.w=I._general_num(o)}else if(e.v===undefined)return"";else e.w=I._general(e.v,ii)}else if(e.t==="d")e.w=I.format(r,re(e.v),ii);else e.w=I.format(r,e.v,ii)}catch(s){if(a.WTF)throw s}if(!a.cellStyles)return;if(t!=null)try{e.s=i.Fills[t];if(e.s.fgColor&&e.s.fgColor.theme&&!e.s.fgColor.rgb){e.s.fgColor.rgb=Ya(n.themeElements.clrScheme[e.s.fgColor.theme].rgb,e.s.fgColor.tint||0);if(a.WTF)e.s.fgColor.raw_rgb=n.themeElements.clrScheme[e.s.fgColor.theme].rgb}if(e.s.bgColor&&e.s.bgColor.theme){e.s.bgColor.rgb=Ya(n.themeElements.clrScheme[e.s.bgColor.theme].rgb,e.s.bgColor.tint||0);if(a.WTF)e.s.bgColor.raw_rgb=n.themeElements.clrScheme[e.s.bgColor.theme].rgb}}catch(s){if(a.WTF&&i.Fills)throw s}}function hi(e,r,t){if(e&&e["!ref"]){var a=bt(e["!ref"]);if(a.e.c<a.s.c||a.e.r<a.s.r)throw new Error("Bad range ("+t+"): "+e["!ref"])}}function di(e,r){var t=bt(r);if(t.s.r<=t.e.r&&t.s.c<=t.e.c&&t.s.r>=0&&t.s.c>=0)e["!ref"]=gt(t)}var pi=/<(?:\w:)?mergeCell ref="[A-Z0-9:]+"\s*[\/]?>/g;var vi=/<(?:\w+:)?sheetData[^>]*>([\s\S]*)<\/(?:\w+:)?sheetData>/;var mi=/<(?:\w:)?hyperlink [^>]*>/gm;var gi=/"(\w*:\w*)"/;var bi=/<(?:\w:)?col\b[^>]*[\/]?>/g;var wi=/<(?:\w:)?autoFilter[^>]*([\/]|>([\s\S]*)<\/(?:\w:)?autoFilter)>/g;var ki=/<(?:\w:)?pageMargins[^>]*\/>/g;var yi=/<(
v:ce(_)};if(!a.cellDates)E={t:"n",v:re(E.v)};E.z=a.dateNF||I._table[14]}}if(E.z===undefined&&C!=null)E.z=C;var T="",O=S.getElementsByTagName("A");if(O&&O.length)for(var D=0;D<O.length;++D)if(O[D].hasAttribute("href")){T=O[D].getAttribute("href");if(T.charAt(0)!="#")break}if(T&&T.charAt(0)!="#")E.l={Target:T};if(a.dense){if(!e[v+n])e[v+n]=[];e[v+n][b+i]=E}else e[vt({c:b+i,r:v+n})]=E;if(c.e.c<b+i)c.e.c=b+i;b+=k}++v}if(u.length)e["!merges"]=(e["!merges"]||[]).concat(u);c.e.r=Math.max(c.e.r,v-1+n);e["!ref"]=gt(c);if(v>=l)e["!fullref"]=gt((c.e.r=o.length-p+v-1+n,c));return e}function Ps(e,r){var t=r||{};var a=t.dense?[]:{};return Rs(a,e,r)}function Ls(e,r){return yt(Ps(e,r),r)}function Bs(e){var r="";var t=zs(e);if(t)r=t(e).getPropertyValue("display");if(!r)r=e.style&&e.style.display;return r==="none"}function zs(e){if(e.ownerDocument.defaultView&&typeof e.ownerDocument.defaultView.getComputedStyle==="function")return e.ownerDocument.defaultView.getComputedStyle;if(typeof getComputedStyle==="function")return getComputedStyle;return null}var Us=function(){var e=function(e){var r=e.replace(/[\t\r\n]/g," ").trim().replace(/ +/g," ").replace(/<text:s\/>/g," ").replace(/<text:s text:c="(\d+)"\/>/g,function(e,r){return Array(parseInt(r,10)+1).join(" ")}).replace(/<text:tab[^>]*\/>/g,"\t").replace(/<text:line-break\/>/g,"\n");var t=Be(r.replace(/<[^>]*>/g,""));return[t]};var r={day:["d","dd"],month:["m","mm"],year:["y","yy"],hours:["h","hh"],minutes:["m","mm"],seconds:["s","ss"],"am-pm":["A/P","AM/PM"],"day-of-week":["ddd","dddd"],era:["e","ee"],quarter:["\\Qm",'m\\"th quarter"']};return function t(a,n){var i=n||{};if(m!=null&&i.dense==null)i.dense=m;var s=xlml_normalize(a);var o=[],l;var c;var f={name:""},u="",h=0;var d;var p;var v={},g=[];var b=i.dense?[]:{};var w,k;var y={value:""};var x="",S=0,_;var C=[];var A=-1,E=-1,F={s:{r:1e6,c:1e7},e:{r:0,c:0}};var T=0;var O={};var D=[],M={},N=0,I=0;var R=[],P=1,L=1;var B=[];var z={Names:[]};var U={};var $=["",""];var W=[],j={};var H="",V=0;var X=false,G=false;var Y=0;xlmlregex.lastIndex=0;s=s.replace(/<!--([\s\S]*?)-->/gm,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");while(w=xlmlregex.exec(s))switch(w[3]=w[3].replace(/_.*$/,"")){case"table":;case"工作表":if(w[1]==="/"){if(F.e.c>=F.s.c&&F.e.r>=F.s.r)b["!ref"]=gt(F);else b["!ref"]="A1:A1";if(i.sheetRows>0&&i.sheetRows<=F.e.r){b["!fullref"]=b["!ref"];F.e.r=i.sheetRows-1;b["!ref"]=gt(F)}if(D.length)b["!merges"]=D;if(R.length)b["!rows"]=R;d.name=d["名称"]||d.name;if(typeof JSON!=="undefined")JSON.stringify(d);g.push(d.name);v[d.name]=b;G=false}else if(w[0].charAt(w[0].length-2)!=="/"){d=Ie(w[0],false);A=E=-1;F.s.r=F.s.c=1e7;F.e.r=F.e.c=0;b=i.dense?[]:{};D=[];R=[];G=true}break;case"table-row-group":if(w[1]==="/")--T;else++T;break;case"table-row":;case"行":if(w[1]==="/"){A+=P;P=1;break}p=Ie(w[0],false);if(p["行号"])A=p["行号"]-1;else if(A==-1)A=0;P=+p["number-rows-repeated"]||1;if(P<10)for(Y=0;Y<P;++Y)if(T>0)R[A+Y]={level:T};E=-1;break;case"covered-table-cell":if(w[1]!=="/")++E;if(i.sheetStubs){if(i.dense){if(!b[A])b[A]=[];b[A][E]={t:"z"}}else b[vt({r:A,c:E})]={t:"z"}}x="";C=[];break;case"table-cell":;case"数据":if(w[0].charAt(w[0].length-2)==="/"){++E;y=Ie(w[0],false);L=parseInt(y["number-columns-repeated"]||"1",10);k={t:"z",v:null};if(y.formula&&i.cellFormula!=false)k.f=ods_to_csf_formula(Be(y.formula));if((y["数据类型"]||y["value-type"])=="string"){k.t="s";k.v=Be(y["string-value"]||"");if(i.dense){if(!b[A])b[A]=[];b[A][E]=k}else{b[vt({r:A,c:E})]=k}}E+=L-1}else if(w[1]!=="/"){++E;x="";S=0;C=[];L=1;var J=P?A+P-1:A;if(E>F.e.c)F.e.c=E;if(E<F.s.c)F.s.c=E;if(A<F.s.r)F.s.r=A;if(J>F.e.r)F.e.r=J;y=Ie(w[0],false);W=[];j={};k={t:y["数据类型"]||y["value-type"],v:null};if(i.cellFormula){if(y.formula)y.formula=Be(y.formula);if(y["number-matrix-columns-spanned"]&&y["number-matrix-rows-spanned"]){N=parseInt(y["number-matrix-rows-spanned"],10)||0;I=parseInt(y["number-matrix-columns-spanned"],10)||0;M={s:{r:A,c:E},e:{r:A+N-1,c:E+I-1}};k.F=gt(M);B.push([M,k.F])}if(y.formula)k.f=ods_to_csf_formula(y.formula);else for(Y=0;Y<B.length;++Y)if(A>
var v=aa(p);var m=Pn(Se(e,p,true),na(Se(e,v,true),p));var g=Fe(m,p);var b=aa(g);d=Yi(Se(e,g,true),g,l,na(Se(e,b,true),g),c,d);break;case"macro":d=ks(h,r,n,l,i[a],c,f,u);break;case"dialog":d=ys(h,r,n,l,i[a],c,f,u);break;default:throw new Error("Unrecognized sheet type "+o);}s[a]=d;var w=[];if(i&&i[a])J(i[a]).forEach(function(t){if(i[a][t].Type==ta.CMNT){var n=Fe(i[a][t].Target,r);w=Cs(xe(e,n,true),n,l);if(!w||!w.length)return;zn(d,w)}})}catch(k){if(l.WTF)throw k}}function Qs(e){return e.charAt(0)=="/"?e.slice(1):e}function eo(e,r){R(I);r=r||{};Ys(r);if(ke(e,"META-INF/manifest.xml"))return $s(e,r);if(ke(e,"objectdata.xml"))return $s(e,r);if(ke(e,"Index/Document.iwa")){if(typeof Uint8Array=="undefined")throw new Error("NUMBERS file parsing requires Uint8Array support");if(typeof Xs!="undefined"){if(e.FileIndex)return Xs.parse_numbers(e);var t=H.utils.cfb_new();_e(e).forEach(function(r){Ce(t,r,getzipbin(e,r))});return Xs.parse_numbers(t)}throw new Error("Unsupported NUMBERS file")}if(!ke(e,"[Content_Types].xml")){if(ke(e,"index.xml.gz"))throw new Error("Unsupported NUMBERS 08 file");if(ke(e,"index.xml"))throw new Error("Unsupported NUMBERS 09 file");throw new Error("Unsupported ZIP file")}var a=_e(e);var n=Zt(Se(e,"[Content_Types].xml"));var i=false;var s,o;if(n.workbooks.length===0){o="xl/workbook.xml";if(xe(e,o,true))n.workbooks.push(o)}if(n.workbooks.length===0){o="xl/workbook.bin";if(!xe(e,o,true))throw new Error("Could not find workbook");n.workbooks.push(o);i=true}if(n.workbooks[0].slice(-3)=="bin")i=true;var l={};var c={};if(!r.bookSheets&&!r.bookProps){ni=[];if(n.sst)try{ni=_s(xe(e,Qs(n.sst)),n.sst,r)}catch(f){if(r.WTF)throw f}if(r.cellStyles&&n.themes.length)l=Ss(Se(e,n.themes[0].replace(/^\//,""),true)||"",n.themes[0],r);if(n.style)c=xs(xe(e,Qs(n.style)),n.style,l,r)}n.links.map(function(t){try{var a=na(Se(e,aa(Qs(t))),t);return Es(xe(e,Qs(t)),a,t,r)}catch(n){}});var u=gs(xe(e,Qs(n.workbooks[0])),n.workbooks[0],r);var h={},d="";if(n.coreprops.length){d=xe(e,Qs(n.coreprops[0]),true);if(d)h=ua(d);if(n.extprops.length!==0){d=xe(e,Qs(n.extprops[0]),true);if(d)ba(d,h,r)}}var p={};if(!r.bookSheets||r.bookProps){if(n.custprops.length!==0){d=Se(e,Qs(n.custprops[0]),true);if(d)p=xa(d,r)}}var v={};if(r.bookSheets||r.bookProps){if(u.Sheets)s=u.Sheets.map(function D(e){return e.name});else if(h.Worksheets&&h.SheetNames.length>0)s=h.SheetNames;if(r.bookProps){v.Props=h;v.Custprops=p}if(r.bookSheets&&typeof s!=="undefined")v.SheetNames=s;if(r.bookSheets?v.SheetNames:r.bookProps)return v}s={};var m={};if(r.bookDeps&&n.calcchain)m=As(xe(e,Qs(n.calcchain)),n.calcchain,r);var g=0;var b={};var w,k;{var y=u.Sheets;h.Worksheets=y.length;h.SheetNames=[];for(var x=0;x!=y.length;++x){h.SheetNames[x]=y[x].name}}var S=i?"bin":"xml";var _=n.workbooks[0].lastIndexOf("/");var C=(n.workbooks[0].slice(0,_+1)+"_rels/"+n.workbooks[0].slice(_+1)+".rels").replace(/^\//,"");if(!ke(e,C))C="xl/_rels/workbook."+S+".rels";var A=na(Se(e,C,true),C);if(A)A=qs(A,u.Sheets);var E=xe(e,"xl/worksheets/sheet.xml",true)?1:0;e:for(g=0;g!=h.Worksheets;++g){var F="sheet";if(A&&A[g]){w="xl/"+A[g][1].replace(/[\/]?xl\//,"");if(!ke(e,w))w=A[g][1];if(!ke(e,w))w=C.replace(/_rels\/.*$/,"")+A[g][1];F=A[g][2]}else{w="xl/worksheets/sheet"+(g+1-E)+"."+S;w=w.replace(/sheet0\./,"sheet.")}k=w.replace(/^(.*)(\/)([^\/]*)$/,"$1/_rels/$3.rels");if(r&&r.sheets!=null)switch(typeof r.sheets){case"number":if(g!=r.sheets)continue e;break;case"string":if(h.SheetNames[g].toLowerCase()!=r.sheets.toLowerCase())continue e;break;default:if(Array.isArray&&Array.isArray(r.sheets)){var T=false;for(var O=0;O!=r.sheets.length;++O){if(typeof r.sheets[O]=="number"&&r.sheets[O]==g)T=1;if(typeof r.sheets[O]=="string"&&r.sheets[O].toLowerCase()==h.SheetNames[g].toLowerCase())T=1}if(!T)continue e};}Zs(e,w,k,h.SheetNames[g],g,b,s,F,r,u,l,c)}v={Directory:n,Workbook:u,Props:h,Custprops:p,Deps:m,Sheets:s,SheetNames:h.SheetNames,Strings:ni,Styles:c,Themes:l,SSF:I.get_table()};if(r&&r.bookFiles){if(e.files){v.keys=a;v.files=e.files}else{v.keys=[];v.files={};e.FullPaths.forEach(function(r,t){r=r.replace(/^Root