UNPKG

excellentexport

Version:

Client side JavaScript export to Excel or CSV

2 lines 333 kB
/*! For license information please see excellentexport.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ExcellentExport=t():e.ExcellentExport=t()}(self,()=>(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};e.d(t,{default:()=>Co});var r="0.20.3",n=1200,a=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],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},s=function(e){-1!=a.indexOf(e)&&(i[0]=e)},o=function(e){n=e,s(e)};var l=function(e){return String.fromCharCode(e)},f=function(e){return String.fromCharCode(e)},c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function h(e){for(var t="",r=0,n=0,a=0,i=0,s=0,o=0,l=0,f=0;f<e.length;)i=(r=e.charCodeAt(f++))>>2,s=(3&r)<<4|(n=e.charCodeAt(f++))>>4,o=(15&n)<<2|(a=e.charCodeAt(f++))>>6,l=63&a,isNaN(n)?o=l=64:isNaN(a)&&(l=64),t+=c.charAt(i)+c.charAt(s)+c.charAt(o)+c.charAt(l);return t}function u(e){var t="",r=0,n=0,a=0,i=0,s=0,o=0;"data:"==e.slice(0,5)&&(l=e.slice(0,1024).indexOf(";base64,"))>-1&&(e=e.slice(l+8)),e=e.replace(/[^\w\+\/\=]/g,"");for(var l=0;l<e.length;)r=c.indexOf(e.charAt(l++))<<2|(i=c.indexOf(e.charAt(l++)))>>4,t+=String.fromCharCode(r),n=(15&i)<<4|(s=c.indexOf(e.charAt(l++)))>>2,64!==s&&(t+=String.fromCharCode(n)),a=(3&s)<<6|(o=c.indexOf(e.charAt(l++))),64!==o&&(t+=String.fromCharCode(a));return t}var d=function(){return"undefined"!=typeof Buffer&&"undefined"!=typeof process&&void 0!==process.versions&&!!process.versions.node}(),p=function(){if("undefined"!=typeof Buffer){var e=!Buffer.from;if(!e)try{Buffer.from("foo","utf8")}catch(t){e=!0}return e?function(e,t){return t?new Buffer(e,t):new Buffer(e)}:Buffer.from.bind(Buffer)}return function(){}}(),m=function(){if("undefined"==typeof Buffer)return!1;var e=p([65,0]);return!!e&&1==e.toString("utf16le").length}();function g(e){return d?Buffer.alloc?Buffer.alloc(e):new Buffer(e):"undefined"!=typeof Uint8Array?new Uint8Array(e):new Array(e)}function v(e){return d?Buffer.allocUnsafe?Buffer.allocUnsafe(e):new Buffer(e):"undefined"!=typeof Uint8Array?new Uint8Array(e):new Array(e)}var w=function(e){return d?p(e,"binary"):e.split("").map(function(e){return 255&e.charCodeAt(0)})};function T(e){if("undefined"==typeof ArrayBuffer)return w(e);for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),n=0;n!=e.length;++n)r[n]=255&e.charCodeAt(n);return t}function b(e){if(Array.isArray(e))return e.map(function(e){return String.fromCharCode(e)}).join("");for(var t=[],r=0;r<e.length;++r)t[r]=String.fromCharCode(e[r]);return t.join("")}var E=d?function(e){return Buffer.concat(e.map(function(e){return Buffer.isBuffer(e)?e:p(e)}))}:function(e){if("undefined"!=typeof Uint8Array){var t=0,r=0;for(t=0;t<e.length;++t)r+=e[t].length;var n=new Uint8Array(r),a=0;for(t=0,r=0;t<e.length;r+=a,++t)a=e[t].length,e[t]instanceof Uint8Array?n.set(e[t],r):"string"==typeof e[t]?n.set(new Uint8Array(w(e[t])),r):n.set(new Uint8Array(e[t]),r);return n}return[].concat.apply([],e.map(function(e){return Array.isArray(e)?e:[].slice.call(e)}))},A=/\u0000/g,S=/[\u0001-\u0006]/g;function _(e){for(var t="",r=e.length-1;r>=0;)t+=e.charAt(r--);return t}function y(e,t){var r=""+e;return r.length>=t?r:De("0",t-r.length)+r}function x(e,t){var r=""+e;return r.length>=t?r:De(" ",t-r.length)+r}function C(e,t){var r=""+e;return r.length>=t?r:r+De(" ",t-r.length)}var O=Math.pow(2,32);function R(e,t){return e>O||e<-O?function(e,t){var r=""+Math.round(e);return r.length>=t?r:De("0",t-r.length)+r}(e,t):function(e,t){var r=""+e;return r.length>=t?r:De("0",t-r.length)+r}(Math.round(e),t)}function k(e,t){return t=t||0,e.length>=7+t&&103==(32|e.charCodeAt(t))&&101==(32|e.charCodeAt(t+1))&&110==(32|e.charCodeAt(t+2))&&101==(32|e.charCodeAt(t+3))&&114==(32|e.charCodeAt(t+4))&&97==(32|e.charCodeAt(t+5))&&108==(32|e.charCodeAt(t+6))}var N=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],I=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]],D={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"上午/下午 "hh"時"mm"分"ss"秒 "'},P={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},L={5:'"$"#,##0_);\\("$"#,##0\\)',63:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function M(e,t,r){for(var n=e<0?-1:1,a=e*n,i=0,s=1,o=0,l=1,f=0,c=0,h=Math.floor(a);f<t&&(o=(h=Math.floor(a))*s+i,c=h*f+l,!(a-h<5e-8));)a=1/(a-h),i=s,s=o,l=f,f=c;if(c>t&&(f>t?(c=l,o=i):(c=f,o=s)),!r)return[0,n*o,c];var u=Math.floor(n*o/c);return[u,n*o-u*c,c]}function F(e,t,r){if(e>2958465||e<0)return null;var n=0|(e=function(e){var t=e.toPrecision(16);if(t.indexOf("e")>-1){var r=t.slice(0,t.indexOf("e"));return(r=r.indexOf(".")>-1?r.slice(0,"0."==r.slice(0,2)?17:16):r.slice(0,15)+De("0",r.length-15))+t.slice(t.indexOf("e"))}var n=t.indexOf(".")>-1?t.slice(0,"0."==t.slice(0,2)?17:16):t.slice(0,15)+De("0",t.length-15);return Number(n)}(e)),a=Math.floor(86400*(e-n)),i=0,s=[],o={D:n,T:a,u:86400*(e-n)-a,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(o.u)<1e-6&&(o.u=0),t&&t.date1904&&(n+=1462),o.u>.9999&&(o.u=0,86400==++a&&(o.T=a=0,++n,++o.D)),60===n)s=r?[1317,10,29]:[1900,2,29],i=3;else if(0===n)s=r?[1317,8,29]:[1900,1,0],i=6;else{n>60&&--n;var l=new Date(1900,0,1);l.setDate(l.getDate()+n-1),s=[l.getFullYear(),l.getMonth()+1,l.getDate()],i=l.getDay(),n<60&&(i=(i+6)%7),r&&(i=function(e,t){t[0]-=581;var r=e.getDay();return e<60&&(r=(r+6)%7),r}(l,s))}return o.y=s[0],o.m=s[1],o.d=s[2],o.S=a%60,a=Math.floor(a/60),o.M=a%60,a=Math.floor(a/60),o.H=a,o.q=i,o}function U(e){return-1==e.indexOf(".")?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function B(e,t){switch(typeof e){case"string":return e;case"boolean":return e?"TRUE":"FALSE";case"number":return(0|e)===e?e.toString(10):function(e){if(!isFinite(e))return isNaN(e)?"#NUM!":"#DIV/0!";var t,r=Math.floor(Math.log(Math.abs(e))*Math.LOG10E);return t=r>=-4&&r<=-1?e.toPrecision(10+r):Math.abs(r)<=9?function(e){var t=e<0?12:11,r=U(e.toFixed(12));return r.length<=t||(r=e.toPrecision(10)).length<=t?r:e.toExponential(5)}(e):10===r?e.toFixed(10).substr(0,12):function(e){var t=U(e.toFixed(11));return t.length>(e<0?12:11)||"0"===t||"-0"===t?e.toPrecision(6):t}(e),U(function(e){return-1==e.indexOf("E")?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}(t.toUpperCase()))}(e);case"undefined":return"";case"object":if(null==e)return"";if(e instanceof Date)return se(14,ye(e,t&&t.date1904),t)}throw new Error("unsupported value in General format: "+e)}function W(e,t,r,n){var a,i="",s=0,o=0,l=r.y,f=0;switch(e){case 98:l=r.y+543;case 121:switch(t.length){case 1:case 2:a=l%100,f=2;break;default:a=l%1e4,f=4}break;case 109:switch(t.length){case 1:case 2:a=r.m,f=t.length;break;case 3:return I[r.m-1][1];case 5:return I[r.m-1][0];default:return I[r.m-1][2]}break;case 100:switch(t.length){case 1:case 2:a=r.d,f=t.length;break;case 3:return N[r.q][0];default:return N[r.q][1]}break;case 104:switch(t.length){case 1:case 2:a=1+(r.H+11)%12,f=t.length;break;default:throw"bad hour format: "+t}break;case 72:switch(t.length){case 1:case 2:a=r.H,f=t.length;break;default:throw"bad hour format: "+t}break;case 77:switch(t.length){case 1:case 2:a=r.M,f=t.length;break;default:throw"bad minute format: "+t}break;case 115:if("s"!=t&&"ss"!=t&&".0"!=t&&".00"!=t&&".000"!=t)throw"bad second format: "+t;return 0!==r.u||"s"!=t&&"ss"!=t?(o=n>=2?3===n?1e3:100:1===n?10:1,(s=Math.round(o*(r.S+r.u)))>=60*o&&(s=0),"s"===t?0===s?"0":""+s/o:(i=y(s,2+n),"ss"===t?i.substr(0,2):"."+i.substr(2,t.length-1))):y(r.S,t.length);case 90:switch(t){case"[h]":case"[hh]":a=24*r.D+r.H;break;case"[m]":case"[mm]":a=60*(24*r.D+r.H)+r.M;break;case"[s]":case"[ss]":a=60*(60*(24*r.D+r.H)+r.M)+(0==n?Math.round(r.S+r.u):r.S);break;default:throw"bad abstime format: "+t}f=3===t.length?1:2;break;case 101:a=l,f=1}return f>0?y(a,f):""}function H(e){if(e.length<=3)return e;for(var t=e.length%3,r=e.substr(0,t);t!=e.length;t+=3)r+=(r.length>0?",":"")+e.substr(t,3);return r}var G=/%/g;function z(e,t){var r,n=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(0==t)return"0.0E+0";if(t<0)return"-"+z(e,-t);var a=e.indexOf(".");-1===a&&(a=e.indexOf("E"));var i=Math.floor(Math.log(t)*Math.LOG10E)%a;if(i<0&&(i+=a),-1===(r=(t/Math.pow(10,i)).toPrecision(n+1+(a+i)%a)).indexOf("e")){var s=Math.floor(Math.log(t)*Math.LOG10E);for(-1===r.indexOf(".")?r=r.charAt(0)+"."+r.substr(1)+"E+"+(s-r.length+i):r+="E+"+(s-i);"0."===r.substr(0,2);)r=(r=r.charAt(0)+r.substr(2,a)+"."+r.substr(2+a)).replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(e,t,r,n){return t+r+n.substr(0,(a+i)%a)+"."+n.substr(i)+"E"})}else r=t.toExponential(n);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}var V=/# (\?+)( ?)\/( ?)(\d+)/,j=/^#*0*\.([0#]+)/,X=/\)[^)]*[0#]/,K=/\(###\) ###\\?-####/;function Y(e){for(var t,r="",n=0;n!=e.length;++n)switch(t=e.charCodeAt(n)){case 35:break;case 63:r+=" ";break;case 48:r+="0";break;default:r+=String.fromCharCode(t)}return r}function Z(e,t){var r=Math.pow(10,t);return""+Math.round(e*r)/r}function J(e,t){var r=e-Math.floor(e),n=Math.pow(10,t);return t<(""+Math.round(r*n)).length?0:Math.round(r*n)}function q(e,t,r){if(40===e.charCodeAt(0)&&!t.match(X)){var n=t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?q("n",n,r):"("+q("n",n,-r)+")"}if(44===t.charCodeAt(t.length-1))return function(e,t,r){for(var n=t.length-1;44===t.charCodeAt(n-1);)--n;return te(e,t.substr(0,n),r/Math.pow(10,3*(t.length-n)))}(e,t,r);if(-1!==t.indexOf("%"))return function(e,t,r){var n=t.replace(G,""),a=t.length-n.length;return te(e,n,r*Math.pow(10,2*a))+De("%",a)}(e,t,r);if(-1!==t.indexOf("E"))return z(t,r);if(36===t.charCodeAt(0))return"$"+q(e,t.substr(" "==t.charAt(1)?2:1),r);var a,i,s,o,l=Math.abs(r),f=r<0?"-":"";if(t.match(/^00+$/))return f+R(l,t.length);if(t.match(/^[#?]+$/))return"0"===(a=R(r,0))&&(a=""),a.length>t.length?a:Y(t.substr(0,t.length-a.length))+a;if(i=t.match(V))return function(e,t,r){var n=parseInt(e[4],10),a=Math.round(t*n),i=Math.floor(a/n),s=a-i*n,o=n;return r+(0===i?"":""+i)+" "+(0===s?De(" ",e[1].length+1+e[4].length):x(s,e[1].length)+e[2]+"/"+e[3]+y(o,e[4].length))}(i,l,f);if(t.match(/^#+0+$/))return f+R(l,t.length-t.indexOf("0"));if(i=t.match(j))return a=Z(r,i[1].length).replace(/^([^\.]+)$/,"$1."+Y(i[1])).replace(/\.$/,"."+Y(i[1])).replace(/\.(\d*)$/,function(e,t){return"."+t+De("0",Y(i[1]).length-t.length)}),-1!==t.indexOf("0.")?a:a.replace(/^0\./,".");if(t=t.replace(/^#+([0.])/,"$1"),i=t.match(/^(0*)\.(#*)$/))return f+Z(l,i[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,i[1].length?"0.":".");if(i=t.match(/^#{1,3},##0(\.?)$/))return f+H(R(l,0));if(i=t.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+q(e,t,-r):H(""+(Math.floor(r)+function(e,t){return t<(""+Math.round((e-Math.floor(e))*Math.pow(10,t))).length?1:0}(r,i[1].length)))+"."+y(J(r,i[1].length),i[1].length);if(i=t.match(/^#,#*,#0/))return q(e,t.replace(/^#,#*,/,""),r);if(i=t.match(/^([0#]+)(\\?-([0#]+))+$/))return a=_(q(e,t.replace(/[\\-]/g,""),r)),s=0,_(_(t.replace(/\\/g,"")).replace(/[0#]/g,function(e){return s<a.length?a.charAt(s++):"0"===e?"0":""}));if(t.match(K))return"("+(a=q(e,"##########",r)).substr(0,3)+") "+a.substr(3,3)+"-"+a.substr(6);var c="";if(i=t.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return s=Math.min(i[4].length,7),o=M(l,Math.pow(10,s)-1,!1),a=""+f," "==(c=te("n",i[1],o[1])).charAt(c.length-1)&&(c=c.substr(0,c.length-1)+"0"),a+=c+i[2]+"/"+i[3],(c=C(o[2],s)).length<i[4].length&&(c=Y(i[4].substr(i[4].length-c.length))+c),a+=c;if(i=t.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return s=Math.min(Math.max(i[1].length,i[4].length),7),f+((o=M(l,Math.pow(10,s)-1,!0))[0]||(o[1]?"":"0"))+" "+(o[1]?x(o[1],s)+i[2]+"/"+i[3]+C(o[2],s):De(" ",2*s+1+i[2].length+i[3].length));if(i=t.match(/^[#0?]+$/))return a=R(r,0),t.length<=a.length?a:Y(t.substr(0,t.length-a.length))+a;if(i=t.match(/^([#0?]+)\.([#0]+)$/)){a=""+r.toFixed(Math.min(i[2].length,10)).replace(/([^0])0+$/,"$1"),s=a.indexOf(".");var h=t.indexOf(".")-s,u=t.length-a.length-h;return Y(t.substr(0,h)+a+t.substr(t.length-u))}if(i=t.match(/^00,000\.([#0]*0)$/))return s=J(r,i[1].length),r<0?"-"+q(e,t,-r):H(function(e){return e<2147483647&&e>-2147483648?""+(e>=0?0|e:e-1|0):""+Math.floor(e)}(r)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(e){return"00,"+(e.length<3?y(0,3-e.length):"")+e})+"."+y(s,i[1].length);switch(t){case"###,##0.00":return q(e,"#,##0.00",r);case"###,###":case"##,###":case"#,###":var d=H(R(l,0));return"0"!==d?f+d:"";case"###,###.00":return q(e,"###,##0.00",r).replace(/^0\./,".");case"#,###.00":return q(e,"#,##0.00",r).replace(/^0\./,".")}throw new Error("unsupported format |"+t+"|")}function Q(e,t){var r,n=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(0==t)return"0.0E+0";if(t<0)return"-"+Q(e,-t);var a=e.indexOf(".");-1===a&&(a=e.indexOf("E"));var i=Math.floor(Math.log(t)*Math.LOG10E)%a;if(i<0&&(i+=a),!(r=(t/Math.pow(10,i)).toPrecision(n+1+(a+i)%a)).match(/[Ee]/)){var s=Math.floor(Math.log(t)*Math.LOG10E);-1===r.indexOf(".")?r=r.charAt(0)+"."+r.substr(1)+"E+"+(s-r.length+i):r+="E+"+(s-i),r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(e,t,r,n){return t+r+n.substr(0,(a+i)%a)+"."+n.substr(i)+"E"})}else r=t.toExponential(n);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}function ee(e,t,r){if(40===e.charCodeAt(0)&&!t.match(X)){var n=t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?ee("n",n,r):"("+ee("n",n,-r)+")"}if(44===t.charCodeAt(t.length-1))return function(e,t,r){for(var n=t.length-1;44===t.charCodeAt(n-1);)--n;return te(e,t.substr(0,n),r/Math.pow(10,3*(t.length-n)))}(e,t,r);if(-1!==t.indexOf("%"))return function(e,t,r){var n=t.replace(G,""),a=t.length-n.length;return te(e,n,r*Math.pow(10,2*a))+De("%",a)}(e,t,r);if(-1!==t.indexOf("E"))return Q(t,r);if(36===t.charCodeAt(0))return"$"+ee(e,t.substr(" "==t.charAt(1)?2:1),r);var a,i,s,o,l=Math.abs(r),f=r<0?"-":"";if(t.match(/^00+$/))return f+y(l,t.length);if(t.match(/^[#?]+$/))return a=""+r,0===r&&(a=""),a.length>t.length?a:Y(t.substr(0,t.length-a.length))+a;if(i=t.match(V))return function(e,t,r){return r+(0===t?"":""+t)+De(" ",e[1].length+2+e[4].length)}(i,l,f);if(t.match(/^#+0+$/))return f+y(l,t.length-t.indexOf("0"));if(i=t.match(j))return a=(a=(""+r).replace(/^([^\.]+)$/,"$1."+Y(i[1])).replace(/\.$/,"."+Y(i[1]))).replace(/\.(\d*)$/,function(e,t){return"."+t+De("0",Y(i[1]).length-t.length)}),-1!==t.indexOf("0.")?a:a.replace(/^0\./,".");if(t=t.replace(/^#+([0.])/,"$1"),i=t.match(/^(0*)\.(#*)$/))return f+(""+l).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,i[1].length?"0.":".");if(i=t.match(/^#{1,3},##0(\.?)$/))return f+H(""+l);if(i=t.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+ee(e,t,-r):H(""+r)+"."+De("0",i[1].length);if(i=t.match(/^#,#*,#0/))return ee(e,t.replace(/^#,#*,/,""),r);if(i=t.match(/^([0#]+)(\\?-([0#]+))+$/))return a=_(ee(e,t.replace(/[\\-]/g,""),r)),s=0,_(_(t.replace(/\\/g,"")).replace(/[0#]/g,function(e){return s<a.length?a.charAt(s++):"0"===e?"0":""}));if(t.match(K))return"("+(a=ee(e,"##########",r)).substr(0,3)+") "+a.substr(3,3)+"-"+a.substr(6);var c="";if(i=t.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return s=Math.min(i[4].length,7),o=M(l,Math.pow(10,s)-1,!1),a=""+f," "==(c=te("n",i[1],o[1])).charAt(c.length-1)&&(c=c.substr(0,c.length-1)+"0"),a+=c+i[2]+"/"+i[3],(c=C(o[2],s)).length<i[4].length&&(c=Y(i[4].substr(i[4].length-c.length))+c),a+=c;if(i=t.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return s=Math.min(Math.max(i[1].length,i[4].length),7),f+((o=M(l,Math.pow(10,s)-1,!0))[0]||(o[1]?"":"0"))+" "+(o[1]?x(o[1],s)+i[2]+"/"+i[3]+C(o[2],s):De(" ",2*s+1+i[2].length+i[3].length));if(i=t.match(/^[#0?]+$/))return a=""+r,t.length<=a.length?a:Y(t.substr(0,t.length-a.length))+a;if(i=t.match(/^([#0]+)\.([#0]+)$/)){a=""+r.toFixed(Math.min(i[2].length,10)).replace(/([^0])0+$/,"$1"),s=a.indexOf(".");var h=t.indexOf(".")-s,u=t.length-a.length-h;return Y(t.substr(0,h)+a+t.substr(t.length-u))}if(i=t.match(/^00,000\.([#0]*0)$/))return r<0?"-"+ee(e,t,-r):H(""+r).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(e){return"00,"+(e.length<3?y(0,3-e.length):"")+e})+"."+y(0,i[1].length);switch(t){case"###,###":case"##,###":case"#,###":var d=H(""+l);return"0"!==d?f+d:"";default:if(t.match(/\.[0#?]*$/))return ee(e,t.slice(0,t.lastIndexOf(".")),r)+Y(t.slice(t.lastIndexOf(".")))}throw new Error("unsupported format |"+t+"|")}function te(e,t,r){return(0|r)===r?ee(e,t,r):q(e,t,r)}var re=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function ne(e){for(var t=0,r="",n="";t<e.length;)switch(r=e.charAt(t)){case"G":k(e,t)&&(t+=6),t++;break;case'"':for(;34!==e.charCodeAt(++t)&&t<e.length;);++t;break;case"\\":case"_":t+=2;break;case"@":++t;break;case"B":case"b":if("1"===e.charAt(t+1)||"2"===e.charAt(t+1))return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"上":if("A/P"===e.substr(t,3).toUpperCase())return!0;if("AM/PM"===e.substr(t,5).toUpperCase())return!0;if("上午/下午"===e.substr(t,5).toUpperCase())return!0;++t;break;case"[":for(n=r;"]"!==e.charAt(t++)&&t<e.length;)n+=e.charAt(t);if(n.match(re))return!0;break;case".":case"0":case"#":for(;t<e.length&&("0#?.,E+-%".indexOf(r=e.charAt(++t))>-1||"\\"==r&&"-"==e.charAt(t+1)&&"0#".indexOf(e.charAt(t+2))>-1););break;case"?":for(;e.charAt(++t)===r;);break;case"*":++t," "!=e.charAt(t)&&"*"!=e.charAt(t)||++t;break;case"(":case")":++t;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;t<e.length&&"0123456789".indexOf(e.charAt(++t))>-1;);break;default:++t}return!1}var ae=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function ie(e,t){if(null==t)return!1;var r=parseFloat(t[2]);switch(t[1]){case"=":if(e==r)return!0;break;case">":if(e>r)return!0;break;case"<":if(e<r)return!0;break;case"<>":if(e!=r)return!0;break;case">=":if(e>=r)return!0;break;case"<=":if(e<=r)return!0}return!1}function se(e,t,r){null==r&&(r={});var n="";switch(typeof e){case"string":n="m/d/yy"==e&&r.dateNF?r.dateNF:e;break;case"number":null==(n=14==e&&r.dateNF?r.dateNF:(null!=r.table?r.table:D)[e])&&(n=r.table&&r.table[P[e]]||D[P[e]]),null==n&&(n=L[e]||"General")}if(k(n,0))return B(t,r);t instanceof Date&&(t=ye(t,r.date1904));var a=function(e,t){var r=function(e){for(var t=[],r=!1,n=0,a=0;n<e.length;++n)switch(e.charCodeAt(n)){case 34:r=!r;break;case 95:case 42:case 92:++n;break;case 59:t[t.length]=e.substr(a,n-a),a=n+1}if(t[t.length]=e.substr(a),!0===r)throw new Error("Format |"+e+"| unterminated string ");return t}(e),n=r.length,a=r[n-1].indexOf("@");if(n<4&&a>-1&&--n,r.length>4)throw new Error("cannot find right format for |"+r.join("|")+"|");if("number"!=typeof t)return[4,4===r.length||a>-1?r[r.length-1]:"@"];switch("number"!=typeof t||isFinite(t)||(t=0),r.length){case 1:r=a>-1?["General","General","General",r[0]]:[r[0],r[0],r[0],"@"];break;case 2:r=a>-1?[r[0],r[0],r[0],r[1]]:[r[0],r[1],r[0],"@"];break;case 3:r=a>-1?[r[0],r[1],r[0],r[2]]:[r[0],r[1],r[2],"@"]}var i=t>0?r[0]:t<0?r[1]:r[2];if(-1===r[0].indexOf("[")&&-1===r[1].indexOf("["))return[n,i];if(null!=r[0].match(/\[[=<>]/)||null!=r[1].match(/\[[=<>]/)){var s=r[0].match(ae),o=r[1].match(ae);return ie(t,s)?[n,r[0]]:ie(t,o)?[n,r[1]]:[n,r[null!=s&&null!=o?2:1]]}return[n,i]}(n,t);if(k(a[1]))return B(t,r);if(!0===t)t="TRUE";else if(!1===t)t="FALSE";else{if(""===t||null==t)return"";if(isNaN(t)&&a[1].indexOf("0")>-1)return"#NUM!";if(!isFinite(t)&&a[1].indexOf("0")>-1)return"#DIV/0!"}return function(e,t,r,n){for(var a,i,s,o=[],l="",f=0,c="",h="t",u="H";f<e.length;)switch(c=e.charAt(f)){case"G":if(!k(e,f))throw new Error("unrecognized character "+c+" in "+e);o[o.length]={t:"G",v:"General"},f+=7;break;case'"':for(l="";34!==(s=e.charCodeAt(++f))&&f<e.length;)l+=String.fromCharCode(s);o[o.length]={t:"t",v:l},++f;break;case"\\":var d=e.charAt(++f),p="("===d||")"===d?d:"t";o[o.length]={t:p,v:d},++f;break;case"_":o[o.length]={t:"t",v:" "},f+=2;break;case"@":o[o.length]={t:"T",v:t},++f;break;case"B":case"b":if("1"===e.charAt(f+1)||"2"===e.charAt(f+1)){if(null==a&&null==(a=F(t,r,"2"===e.charAt(f+1))))return"";o[o.length]={t:"X",v:e.substr(f,2)},h=c,f+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":c=c.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(t<0)return"";if(null==a&&null==(a=F(t,r)))return"";for(l=c;++f<e.length&&e.charAt(f).toLowerCase()===c;)l+=c;"m"===c&&"h"===h.toLowerCase()&&(c="M"),"h"===c&&(c=u),o[o.length]={t:c,v:l},h=c;break;case"A":case"a":case"上":var m={t:c,v:c};if(null==a&&(a=F(t,r)),"A/P"===e.substr(f,3).toUpperCase()?(null!=a&&(m.v=a.H>=12?e.charAt(f+2):c),m.t="T",u="h",f+=3):"AM/PM"===e.substr(f,5).toUpperCase()?(null!=a&&(m.v=a.H>=12?"PM":"AM"),m.t="T",f+=5,u="h"):"上午/下午"===e.substr(f,5).toUpperCase()?(null!=a&&(m.v=a.H>=12?"下午":"上午"),m.t="T",f+=5,u="h"):(m.t="t",++f),null==a&&"T"===m.t)return"";o[o.length]=m,h=c;break;case"[":for(l=c;"]"!==e.charAt(f++)&&f<e.length;)l+=e.charAt(f);if("]"!==l.slice(-1))throw'unterminated "[" block: |'+l+"|";if(l.match(re)){if(null==a&&null==(a=F(t,r)))return"";o[o.length]={t:"Z",v:l.toLowerCase()},h=l.charAt(1)}else l.indexOf("$")>-1&&(l=(l.match(/\$([^-\[\]]*)/)||[])[1]||"$",ne(e)||(o[o.length]={t:"t",v:l}));break;case".":if(null!=a){for(l=c;++f<e.length&&"0"===(c=e.charAt(f));)l+=c;o[o.length]={t:"s",v:l};break}case"0":case"#":for(l=c;++f<e.length&&"0#?.,E+-%".indexOf(c=e.charAt(f))>-1;)l+=c;o[o.length]={t:"n",v:l};break;case"?":for(l=c;e.charAt(++f)===c;)l+=c;o[o.length]={t:c,v:l},h=c;break;case"*":++f," "!=e.charAt(f)&&"*"!=e.charAt(f)||++f;break;case"(":case")":o[o.length]={t:1===n?"t":c,v:c},++f;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(l=c;f<e.length&&"0123456789".indexOf(e.charAt(++f))>-1;)l+=e.charAt(f);o[o.length]={t:"D",v:l};break;case" ":o[o.length]={t:c,v:c},++f;break;case"$":o[o.length]={t:"t",v:"$"},++f;break;default:if(-1===",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(c))throw new Error("unrecognized character "+c+" in "+e);o[o.length]={t:"t",v:c},++f}var g,v,w=0,T=0;for(f=o.length-1,h="t";f>=0;--f)switch(o[f].t){case"h":case"H":o[f].t=u,h="h",w<1&&(w=1);break;case"s":(g=o[f].v.match(/\.0+$/))&&(T=Math.max(T,g[0].length-1),w=4),w<3&&(w=3);case"d":case"y":case"e":h=o[f].t;break;case"M":h=o[f].t,w<2&&(w=2);break;case"m":"s"===h&&(o[f].t="M",w<2&&(w=2));break;case"X":break;case"Z":w<1&&o[f].v.match(/[Hh]/)&&(w=1),w<2&&o[f].v.match(/[Mm]/)&&(w=2),w<3&&o[f].v.match(/[Ss]/)&&(w=3)}switch(w){case 0:break;case 1:case 2:case 3:a.u>=.5&&(a.u=0,++a.S),a.S>=60&&(a.S=0,++a.M),a.M>=60&&(a.M=0,++a.H),a.H>=24&&(a.H=0,++a.D,(v=F(a.D)).u=a.u,v.S=a.S,v.M=a.M,v.H=a.H,a=v);break;case 4:switch(T){case 1:a.u=Math.round(10*a.u)/10;break;case 2:a.u=Math.round(100*a.u)/100;break;case 3:a.u=Math.round(1e3*a.u)/1e3}a.u>=1&&(a.u=0,++a.S),a.S>=60&&(a.S=0,++a.M),a.M>=60&&(a.M=0,++a.H),a.H>=24&&(a.H=0,++a.D,(v=F(a.D)).u=a.u,v.S=a.S,v.M=a.M,v.H=a.H,a=v)}var b,E="";for(f=0;f<o.length;++f)switch(o[f].t){case"t":case"T":case" ":case"D":break;case"X":o[f].v="",o[f].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":o[f].v=W(o[f].t.charCodeAt(0),o[f].v,a,T),o[f].t="t";break;case"n":case"?":for(b=f+1;null!=o[b]&&("?"===(c=o[b].t)||"D"===c||(" "===c||"t"===c)&&null!=o[b+1]&&("?"===o[b+1].t||"t"===o[b+1].t&&"/"===o[b+1].v)||"("===o[f].t&&(" "===c||"n"===c||")"===c)||"t"===c&&("/"===o[b].v||" "===o[b].v&&null!=o[b+1]&&"?"==o[b+1].t));)o[f].v+=o[b].v,o[b]={v:"",t:";"},++b;E+=o[f].v,f=b-1;break;case"G":o[f].t="t",o[f].v=B(t,r)}var A,S,_="";if(E.length>0){40==E.charCodeAt(0)?(A=t<0&&45===E.charCodeAt(0)?-t:t,S=te("n",E,A)):(S=te("n",E,A=t<0&&n>1?-t:t),A<0&&o[0]&&"t"==o[0].t&&(S=S.substr(1),o[0].v="-"+o[0].v)),b=S.length-1;var y=o.length;for(f=0;f<o.length;++f)if(null!=o[f]&&"t"!=o[f].t&&o[f].v.indexOf(".")>-1){y=f;break}var x=o.length;if(y===o.length&&-1===S.indexOf("E")){for(f=o.length-1;f>=0;--f)null!=o[f]&&-1!=="n?".indexOf(o[f].t)&&(b>=o[f].v.length-1?(b-=o[f].v.length,o[f].v=S.substr(b+1,o[f].v.length)):b<0?o[f].v="":(o[f].v=S.substr(0,b+1),b=-1),o[f].t="t",x=f);b>=0&&x<o.length&&(o[x].v=S.substr(0,b+1)+o[x].v)}else if(y!==o.length&&-1===S.indexOf("E")){for(b=S.indexOf(".")-1,f=y;f>=0;--f)if(null!=o[f]&&-1!=="n?".indexOf(o[f].t)){for(i=o[f].v.indexOf(".")>-1&&f===y?o[f].v.indexOf(".")-1:o[f].v.length-1,_=o[f].v.substr(i+1);i>=0;--i)b>=0&&("0"===o[f].v.charAt(i)||"#"===o[f].v.charAt(i))&&(_=S.charAt(b--)+_);o[f].v=_,o[f].t="t",x=f}for(b>=0&&x<o.length&&(o[x].v=S.substr(0,b+1)+o[x].v),b=S.indexOf(".")+1,f=y;f<o.length;++f)if(null!=o[f]&&(-1!=="n?(".indexOf(o[f].t)||f===y)){for(i=o[f].v.indexOf(".")>-1&&f===y?o[f].v.indexOf(".")+1:0,_=o[f].v.substr(0,i);i<o[f].v.length;++i)b<S.length&&(_+=S.charAt(b++));o[f].v=_,o[f].t="t",x=f}}}for(f=0;f<o.length;++f)null!=o[f]&&"n?".indexOf(o[f].t)>-1&&(A=n>1&&t<0&&f>0&&"-"===o[f-1].v?-t:t,o[f].v=te(o[f].t,o[f].v,A),o[f].t="t");var C="";for(f=0;f!==o.length;++f)null!=o[f]&&(C+=o[f].v);return C}(a[1],t,r,a[0])}function oe(e,t){if("number"!=typeof t){t=+t||-1;for(var r=0;r<392;++r)if(null!=D[r]){if(D[r]==e){t=r;break}}else t<0&&(t=r);t<0&&(t=391)}return D[t]=e,t}function le(e){for(var t=0;392!=t;++t)void 0!==e[t]&&oe(e[t],t)}function fe(){var e;e||(e={}),e[0]="General",e[1]="0",e[2]="0.00",e[3]="#,##0",e[4]="#,##0.00",e[9]="0%",e[10]="0.00%",e[11]="0.00E+00",e[12]="# ?/?",e[13]="# ??/??",e[14]="m/d/yy",e[15]="d-mmm-yy",e[16]="d-mmm",e[17]="mmm-yy",e[18]="h:mm AM/PM",e[19]="h:mm:ss AM/PM",e[20]="h:mm",e[21]="h:mm:ss",e[22]="m/d/yy h:mm",e[37]="#,##0 ;(#,##0)",e[38]="#,##0 ;[Red](#,##0)",e[39]="#,##0.00;(#,##0.00)",e[40]="#,##0.00;[Red](#,##0.00)",e[45]="mm:ss",e[46]="[h]:mm:ss",e[47]="mmss.0",e[48]="##0.0E+0",e[49]="@",e[56]='"上午/下午 "hh"時"mm"分"ss"秒 "',D=e}var ce=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g,he={"d.m":"d\\.m"};function ue(e,t){return oe(he[e]||e,t)}var de,pe=function(){var e={version:"1.2.0"},t=function(){for(var e=0,t=new Array(256),r=0;256!=r;++r)e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=r)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1,t[r]=e;return"undefined"!=typeof Int32Array?new Int32Array(t):t}(),r=function(e){var t=0,r=0,n=0,a="undefined"!=typeof Int32Array?new Int32Array(4096):new Array(4096);for(n=0;256!=n;++n)a[n]=e[n];for(n=0;256!=n;++n)for(r=e[n],t=256+n;t<4096;t+=256)r=a[t]=r>>>8^e[255&r];var i=[];for(n=1;16!=n;++n)i[n-1]="undefined"!=typeof Int32Array&&"function"==typeof a.subarray?a.subarray(256*n,256*n+256):a.slice(256*n,256*n+256);return i}(t),n=r[0],a=r[1],i=r[2],s=r[3],o=r[4],l=r[5],f=r[6],c=r[7],h=r[8],u=r[9],d=r[10],p=r[11],m=r[12],g=r[13],v=r[14];return e.table=t,e.bstr=function(e,r){for(var n=-1^r,a=0,i=e.length;a<i;)n=n>>>8^t[255&(n^e.charCodeAt(a++))];return~n},e.buf=function(e,r){for(var w=-1^r,T=e.length-15,b=0;b<T;)w=v[e[b++]^255&w]^g[e[b++]^w>>8&255]^m[e[b++]^w>>16&255]^p[e[b++]^w>>>24]^d[e[b++]]^u[e[b++]]^h[e[b++]]^c[e[b++]]^f[e[b++]]^l[e[b++]]^o[e[b++]]^s[e[b++]]^i[e[b++]]^a[e[b++]]^n[e[b++]]^t[e[b++]];for(T+=15;b<T;)w=w>>>8^t[255&(w^e[b++])];return~w},e.str=function(e,r){for(var n=-1^r,a=0,i=e.length,s=0,o=0;a<i;)(s=e.charCodeAt(a++))<128?n=n>>>8^t[255&(n^s)]:s<2048?n=(n=n>>>8^t[255&(n^(192|s>>6&31))])>>>8^t[255&(n^(128|63&s))]:s>=55296&&s<57344?(s=64+(1023&s),o=1023&e.charCodeAt(a++),n=(n=(n=(n=n>>>8^t[255&(n^(240|s>>8&7))])>>>8^t[255&(n^(128|s>>2&63))])>>>8^t[255&(n^(128|o>>6&15|(3&s)<<4))])>>>8^t[255&(n^(128|63&o))]):n=(n=(n=n>>>8^t[255&(n^(224|s>>12&15))])>>>8^t[255&(n^(128|s>>6&63))])>>>8^t[255&(n^(128|63&s))];return~n},e}(),me=function(){var e,t={};function r(e){if("/"==e.charAt(e.length-1))return-1===e.slice(0,-1).indexOf("/")?e:r(e.slice(0,-1));var t=e.lastIndexOf("/");return-1===t?e:e.slice(0,t+1)}function n(e){if("/"==e.charAt(e.length-1))return n(e.slice(0,-1));var t=e.lastIndexOf("/");return-1===t?e:e.slice(t+1)}function a(e,t){"string"==typeof t&&(t=new Date(t));var r=t.getHours();r=(r=r<<6|t.getMinutes())<<5|t.getSeconds()>>>1,e.write_shift(2,r);var n=t.getFullYear()-1980;n=(n=n<<4|t.getMonth()+1)<<5|t.getDate(),e.write_shift(2,n)}function i(e){qt(e,0);for(var t={},r=0;e.l<=e.length-4;){var n=e.read_shift(2),a=e.read_shift(2),i=e.l+a,s={};switch(n){case 21589:1&(r=e.read_shift(1))&&(s.mtime=e.read_shift(4)),a>5&&(2&r&&(s.atime=e.read_shift(4)),4&r&&(s.ctime=e.read_shift(4))),s.mtime&&(s.mt=new Date(1e3*s.mtime));break;case 1:var o=e.read_shift(4),l=e.read_shift(4);s.usz=l*Math.pow(2,32)+o,o=e.read_shift(4),l=e.read_shift(4),s.csz=l*Math.pow(2,32)+o}e.l=i,t[n]=s}return t}function s(){return e||(e=de)}function o(e,t){if(80==e[0]&&75==e[1])return ge(e,t);if(109==(32|e[0])&&105==(32|e[1]))return function(e,t){if("mime-version:"!=I(e.slice(0,13)).toLowerCase())throw new Error("Unsupported MAD header");var r=t&&t.root||"",n=(d&&Buffer.isBuffer(e)?e.toString("binary"):I(e)).split("\r\n"),a=0,i="";for(a=0;a<n.length;++a)if(i=n[a],/^Content-Location:/i.test(i)&&(i=i.slice(i.indexOf("file")),r||(r=i.slice(0,i.lastIndexOf("/")+1)),i.slice(0,r.length)!=r))for(;r.length>0&&(r=(r=r.slice(0,r.length-1)).slice(0,r.lastIndexOf("/")+1),i.slice(0,r.length)!=r););var s=(n[1]||"").match(/boundary="(.*?)"/);if(!s)throw new Error("MAD cannot find boundary");var o="--"+(s[1]||""),l={FileIndex:[],FullPaths:[]};T(l);var f,c=0;for(a=0;a<n.length;++a){var h=n[a];h!==o&&h!==o+"--"||(c++&&Ae(l,n.slice(f,a),r),f=a)}return l}(e,t);if(e.length<512)throw new Error("CFB file size "+e.length+" < 512");var r,n,a,i,s,o,h=512,u=[],p=e.slice(0,512);qt(p,0);var g=function(e){if(80==e[e.l]&&75==e[e.l+1])return[0,0];e.chk(O,"Header Signature: "),e.l+=16;var t=e.read_shift(2,"u");return[e.read_shift(2,"u"),t]}(p);switch(r=g[0]){case 3:h=512;break;case 4:h=4096;break;case 0:if(0==g[1])return ge(e,t);default:throw new Error("Major Version: Expected 3 or 4 saw "+r)}512!==h&&qt(p=e.slice(0,h),28);var v=e.slice(0,h);!function(e,t){var r;switch(e.l+=2,r=e.read_shift(2)){case 9:if(3!=t)throw new Error("Sector Shift: Expected 9 saw "+r);break;case 12:if(4!=t)throw new Error("Sector Shift: Expected 12 saw "+r);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+r)}e.chk("0600","Mini Sector Shift: "),e.chk("000000000000","Reserved: ")}(p,r);var w=p.read_shift(4,"i");if(3===r&&0!==w)throw new Error("# Directory Sectors: Expected 0 saw "+w);p.l+=4,i=p.read_shift(4,"i"),p.l+=4,p.chk("00100000","Mini Stream Cutoff Size: "),s=p.read_shift(4,"i"),n=p.read_shift(4,"i"),o=p.read_shift(4,"i"),a=p.read_shift(4,"i");for(var b=-1,E=0;E<109&&!((b=p.read_shift(4,"i"))<0);++E)u[E]=b;var A=function(e,t){for(var r=Math.ceil(e.length/t)-1,n=[],a=1;a<r;++a)n[a-1]=e.slice(a*t,(a+1)*t);return n[r-1]=e.slice(r*t),n}(e,h);f(o,a,A,h,u);var S=function(e,t,r,n){var a=e.length,i=[],s=[],o=[],l=[],f=n-1,c=0,h=0,u=0,d=0;for(c=0;c<a;++c)if(o=[],(u=c+t)>=a&&(u-=a),!s[u]){l=[];var p=[];for(h=u;h>=0;){p[h]=!0,s[h]=!0,o[o.length]=h,l.push(e[h]);var m=r[Math.floor(4*h/n)];if(n<4+(d=4*h&f))throw new Error("FAT boundary crossed: "+h+" 4 "+n);if(!e[m])break;if(p[h=zt(e[m],d)])break}i[u]={nodes:o,data:bt([l])}}return i}(A,i,u,h);i<S.length&&(S[i].name="!Directory"),n>0&&s!==C&&(S[s].name="!MiniFAT"),S[u[0]].name="!FAT",S.fat_addrs=u,S.ssz=h;var _=[],y=[],x=[];!function(e,t,r,n,a,i,s,o){for(var f,h=0,u=n.length?2:0,d=t[e].data,p=0,g=0;p<d.length;p+=128){var v=d.slice(p,p+128);qt(v,64),g=v.read_shift(2),f=At(v,0,g-u),n.push(f);var w={name:f,type:v.read_shift(1),color:v.read_shift(1),L:v.read_shift(4,"i"),R:v.read_shift(4,"i"),C:v.read_shift(4,"i"),clsid:v.read_shift(16),state:v.read_shift(4,"i"),start:0,size:0};0!==v.read_shift(2)+v.read_shift(2)+v.read_shift(2)+v.read_shift(2)&&(w.ct=m(v,v.l-8)),0!==v.read_shift(2)+v.read_shift(2)+v.read_shift(2)+v.read_shift(2)&&(w.mt=m(v,v.l-8)),w.start=v.read_shift(4,"i"),w.size=v.read_shift(4,"i"),w.size<0&&w.start<0&&(w.size=w.type=0,w.start=C,w.name=""),5===w.type?(h=w.start,a>0&&h!==C&&(t[h].name="!StreamData")):w.size>=4096?(w.storage="fat",void 0===t[w.start]&&(t[w.start]=c(r,w.start,t.fat_addrs,t.ssz)),t[w.start].name=w.name,w.content=t[w.start].data.slice(0,w.size)):(w.storage="minifat",w.size<0?w.size=0:h!==C&&w.start!==C&&t[h]&&(w.content=l(w,t[h].data,(t[o]||{}).data))),w.content&&qt(w.content,0),i[f]=w,s.push(w)}}(i,S,A,_,n,{},y,s),function(e,t,r){for(var n=0,a=0,i=0,s=0,o=0,l=r.length,f=[],c=[];n<l;++n)f[n]=c[n]=n,t[n]=r[n];for(;o<c.length;++o)a=e[n=c[o]].L,i=e[n].R,s=e[n].C,f[n]===n&&(-1!==a&&f[a]!==a&&(f[n]=f[a]),-1!==i&&f[i]!==i&&(f[n]=f[i])),-1!==s&&(f[s]=n),-1!==a&&n!=f[n]&&(f[a]=f[n],c.lastIndexOf(a)<o&&c.push(a)),-1!==i&&n!=f[n]&&(f[i]=f[n],c.lastIndexOf(i)<o&&c.push(i));for(n=1;n<l;++n)f[n]===n&&(-1!==i&&f[i]!==i?f[n]=f[i]:-1!==a&&f[a]!==a&&(f[n]=f[a]));for(n=1;n<l;++n)if(0!==e[n].type){if((o=n)!=f[o])do{o=f[o],t[n]=t[o]+"/"+t[n]}while(0!==o&&-1!==f[o]&&o!=f[o]);f[n]=-1}for(t[0]+="/",n=1;n<l;++n)2!==e[n].type&&(t[n]+="/")}(y,x,_),_.shift();var R={FileIndex:y,FullPaths:x};return t&&t.raw&&(R.raw={header:v,sectors:A}),R}function l(e,t,r){for(var n=e.start,a=e.size,i=[],s=n;r&&a>0&&s>=0;)i.push(t.slice(s*x,s*x+x)),a-=x,s=zt(r,4*s);return 0===i.length?er(0):E(i).slice(0,e.size)}function f(e,t,r,n,a){var i=C;if(e===C){if(0!==t)throw new Error("DIFAT chain shorter than expected")}else if(-1!==e){var s=r[e],o=(n>>>2)-1;if(!s)return;for(var l=0;l<o&&(i=zt(s,4*l))!==C;++l)a.push(i);t>=1&&f(zt(s,n-4),t-1,r,n,a)}}function c(e,t,r,n,a){var i=[],s=[];a||(a=[]);var o=n-1,l=0,f=0;for(l=t;l>=0;){a[l]=!0,i[i.length]=l,s.push(e[l]);var c=r[Math.floor(4*l/n)];if(n<4+(f=4*l&o))throw new Error("FAT boundary crossed: "+l+" 4 "+n);if(!e[c])break;l=zt(e[c],f)}return{nodes:i,data:bt([s])}}function m(e,t){return new Date(1e3*($t(e,t+4)/1e7*Math.pow(2,32)+$t(e,t)/1e7-11644473600))}function T(e,t){var r=t||{},n=r.root||"Root Entry";if(e.FullPaths||(e.FullPaths=[]),e.FileIndex||(e.FileIndex=[]),e.FullPaths.length!==e.FileIndex.length)throw new Error("inconsistent CFB structure");0===e.FullPaths.length&&(e.FullPaths[0]=n+"/",e.FileIndex[0]={name:n,type:5}),r.CLSID&&(e.FileIndex[0].clsid=r.CLSID),function(e){var t="Sh33tJ5";if(!me.find(e,"/"+t)){var r=er(4);r[0]=55,r[1]=r[3]=50,r[2]=54,e.FileIndex.push({name:t,type:2,content:r,size:4,L:69,R:69,C:69}),e.FullPaths.push(e.FullPaths[0]+t),b(e)}}(e)}function b(e,t){T(e);for(var a=!1,i=!1,s=e.FullPaths.length-1;s>=0;--s){var o=e.FileIndex[s];switch(o.type){case 0:i?a=!0:(e.FileIndex.pop(),e.FullPaths.pop());break;case 1:case 2:case 5:i=!0,isNaN(o.R*o.L*o.C)&&(a=!0),o.R>-1&&o.L>-1&&o.R==o.L&&(a=!0);break;default:a=!0}}if(a||t){var l=new Date(1987,1,19),f=0,c=Object.create?Object.create(null):{},h=[];for(s=0;s<e.FullPaths.length;++s)c[e.FullPaths[s]]=!0,0!==e.FileIndex[s].type&&h.push([e.FullPaths[s],e.FileIndex[s]]);for(s=0;s<h.length;++s){var u=r(h[s][0]);for(i=c[u];!i;){for(;r(u)&&!c[r(u)];)u=r(u);h.push([u,{name:n(u).replace("/",""),type:1,clsid:k,ct:l,mt:l,content:null}]),c[u]=!0,i=c[u=r(h[s][0])]}}for(h.sort(function(e,t){return function(e,t){for(var r=e.split("/"),n=t.split("/"),a=0,i=0,s=Math.min(r.length,n.length);a<s;++a){if(i=r[a].length-n[a].length)return i;if(r[a]!=n[a])return r[a]<n[a]?-1:1}return r.length-n.length}(e[0],t[0])}),e.FullPaths=[],e.FileIndex=[],s=0;s<h.length;++s)e.FullPaths[s]=h[s][0],e.FileIndex[s]=h[s][1];for(s=0;s<h.length;++s){var d=e.FileIndex[s],p=e.FullPaths[s];if(d.name=n(p).replace("/",""),d.L=d.R=d.C=-(d.color=1),d.size=d.content?d.content.length:0,d.start=0,d.clsid=d.clsid||k,0===s)d.C=h.length>1?1:-1,d.size=0,d.type=5;else if("/"==p.slice(-1)){for(f=s+1;f<h.length&&r(e.FullPaths[f])!=p;++f);for(d.C=f>=h.length?-1:f,f=s+1;f<h.length&&r(e.FullPaths[f])!=r(p);++f);d.R=f>=h.length?-1:f,d.type=1}else r(e.FullPaths[s+1]||"")==r(p)&&(d.R=s+1),d.type=2}}}function _(e,t){var r=t||{};if("mad"==r.fileType)return function(e,t){for(var r=t||{},n=r.boundary||"SheetJS",a=["MIME-Version: 1.0",'Content-Type: multipart/related; boundary="'+(n="------="+n).slice(2)+'"',"","",""],i=e.FullPaths[0],s=i,o=e.FileIndex[0],l=1;l<e.FullPaths.length;++l)if(s=e.FullPaths[l].slice(i.length),(o=e.FileIndex[l]).size&&o.content&&"Sh33tJ5"!=s){s=s.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF]/g,function(e){return"_x"+e.charCodeAt(0).toString(16)+"_"}).replace(/[\u0080-\uFFFF]/g,function(e){return"_u"+e.charCodeAt(0).toString(16)+"_"});for(var f=o.content,c=d&&Buffer.isBuffer(f)?f.toString("binary"):I(f),h=0,u=Math.min(1024,c.length),p=0,m=0;m<=u;++m)(p=c.charCodeAt(m))>=32&&p<128&&++h;var g=h>=4*u/5;a.push(n),a.push("Content-Location: "+(r.root||"file:///C:/SheetJS/")+s),a.push("Content-Transfer-Encoding: "+(g?"quoted-printable":"base64")),a.push("Content-Type: "+Te(o,s)),a.push(""),a.push(g?Ee(c):be(c))}return a.push(n+"--\r\n"),a.join("\r\n")}(e,r);if(b(e),"zip"===r.fileType)return function(e,t){var r=t||{},n=[],i=[],s=er(1),o=r.compression?8:0,l=0,f=0,c=0,h=0,u=e.FullPaths[0],d=u,p=e.FileIndex[0],m=[],g=0;for(l=1;l<e.FullPaths.length;++l)if(d=e.FullPaths[l].slice(u.length),(p=e.FileIndex[l]).size&&p.content&&(!Array.isArray(p.content)||0!=p.content.length)&&"Sh33tJ5"!=d){var v=c,T=er(d.length);for(f=0;f<d.length;++f)T.write_shift(1,127&d.charCodeAt(f));T=T.slice(0,T.l),m[h]="string"==typeof p.content?pe.bstr(p.content,0):pe.buf(p.content,0);var b="string"==typeof p.content?w(p.content):p.content;8==o&&(b=D(b)),(s=er(30)).write_shift(4,67324752),s.write_shift(2,20),s.write_shift(2,0),s.write_shift(2,o),p.mt?a(s,p.mt):s.write_shift(4,0),s.write_shift(-4,m[h]),s.write_shift(4,b.length),s.write_shift(4,p.content.length),s.write_shift(2,T.length),s.write_shift(2,0),c+=s.length,n.push(s),c+=T.length,n.push(T),c+=b.length,n.push(b),(s=er(46)).write_shift(4,33639248),s.write_shift(2,0),s.write_shift(2,20),s.write_shift(2,0),s.write_shift(2,o),s.write_shift(4,0),s.write_shift(-4,m[h]),s.write_shift(4,b.length),s.write_shift(4,p.content.length),s.write_shift(2,T.length),s.write_shift(2,0),s.write_shift(2,0),s.write_shift(2,0),s.write_shift(2,0),s.write_shift(4,0),s.write_shift(4,v),g+=s.l,i.push(s),g+=T.length,i.push(T),++h}return(s=er(22)).write_shift(4,101010256),s.write_shift(2,0),s.write_shift(2,0),s.write_shift(2,h),s.write_shift(2,h),s.write_shift(4,g),s.write_shift(4,c),s.write_shift(2,0),E([E(n),E(i),s])}(e,r);var n=function(e){for(var t=0,r=0,n=0;n<e.FileIndex.length;++n){var a=e.FileIndex[n];if(a.content){var i=a.content.length;i>0&&(i<4096?t+=i+63>>6:r+=i+511>>9)}}for(var s=e.FullPaths.length+3>>2,o=t+127>>7,l=(t+7>>3)+r+s+o,f=l+127>>7,c=f<=109?0:Math.ceil((f-109)/127);l+f+c+127>>7>f;)c=++f<=109?0:Math.ceil((f-109)/127);var h=[1,c,f,o,s,r,t,0];return e.FileIndex[0].size=t<<6,h[7]=(e.FileIndex[0].start=h[0]+h[1]+h[2]+h[3]+h[4]+h[5])+(h[6]+7>>3),h}(e),i=er(n[7]<<9),s=0,o=0;for(s=0;s<8;++s)i.write_shift(1,R[s]);for(s=0;s<8;++s)i.write_shift(2,0);for(i.write_shift(2,62),i.write_shift(2,3),i.write_shift(2,65534),i.write_shift(2,9),i.write_shift(2,6),s=0;s<3;++s)i.write_shift(2,0);for(i.write_shift(4,0),i.write_shift(4,n[2]),i.write_shift(4,n[0]+n[1]+n[2]+n[3]-1),i.write_shift(4,0),i.write_shift(4,4096),i.write_shift(4,n[3]?n[0]+n[1]+n[2]-1:C),i.write_shift(4,n[3]),i.write_shift(-4,n[1]?n[0]-1:C),i.write_shift(4,n[1]),s=0;s<109;++s)i.write_shift(-4,s<n[2]?n[1]+s:-1);if(n[1])for(o=0;o<n[1];++o){for(;s<236+127*o;++s)i.write_shift(-4,s<n[2]?n[1]+s:-1);i.write_shift(-4,o===n[1]-1?C:o+1)}var l=function(e){for(o+=e;s<o-1;++s)i.write_shift(-4,s+1);e&&(++s,i.write_shift(-4,C))};for(o=s=0,o+=n[1];s<o;++s)i.write_shift(-4,N.DIFSECT);for(o+=n[2];s<o;++s)i.write_shift(-4,N.FATSECT);l(n[3]),l(n[4]);for(var f=0,c=0,h=e.FileIndex[0];f<e.FileIndex.length;++f)(h=e.FileIndex[f]).content&&((c=h.content.length)<4096||(h.start=o,l(c+511>>9)));for(l(n[6]+7>>3);511&i.l;)i.write_shift(-4,N.ENDOFCHAIN);for(o=s=0,f=0;f<e.FileIndex.length;++f)(h=e.FileIndex[f]).content&&(!(c=h.content.length)||c>=4096||(h.start=o,l(c+63>>6)));for(;511&i.l;)i.write_shift(-4,N.ENDOFCHAIN);for(s=0;s<n[4]<<2;++s){var u=e.FullPaths[s];if(u&&0!==u.length){h=e.FileIndex[s],0===s&&(h.start=h.size?h.start-1:C);var p=0===s&&r.root||h.name;if(p.length>31&&(console.error("Name "+p+" will be truncated to "+p.slice(0,31)),p=p.slice(0,31)),c=2*(p.length+1),i.write_shift(64,p,"utf16le"),i.write_shift(2,c),i.write_shift(1,h.type),i.write_shift(1,h.color),i.write_shift(-4,h.L),i.write_shift(-4,h.R),i.write_shift(-4,h.C),h.clsid)i.write_shift(16,h.clsid,"hex");else for(f=0;f<4;++f)i.write_shift(4,0);i.write_shift(4,h.state||0),i.write_shift(4,0),i.write_shift(4,0),i.write_shift(4,0),i.write_shift(4,0),i.write_shift(4,h.start),i.write_shift(4,h.size),i.write_shift(4,0)}else{for(f=0;f<17;++f)i.write_shift(4,0);for(f=0;f<3;++f)i.write_shift(4,-1);for(f=0;f<12;++f)i.write_shift(4,0)}}for(s=1;s<e.FileIndex.length;++s)if((h=e.FileIndex[s]).size>=4096)if(i.l=h.start+1<<9,d&&Buffer.isBuffer(h.content))h.content.copy(i,i.l,0,h.size),i.l+=h.size+511&-512;else{for(f=0;f<h.size;++f)i.write_shift(1,h.content[f]);for(;511&f;++f)i.write_shift(1,0)}for(s=1;s<e.FileIndex.length;++s)if((h=e.FileIndex[s]).size>0&&h.size<4096)if(d&&Buffer.isBuffer(h.content))h.content.copy(i,i.l,0,h.size),i.l+=h.size+63&-64;else{for(f=0;f<h.size;++f)i.write_shift(1,h.content[f]);for(;63&f;++f)i.write_shift(1,0)}if(d)i.l=i.length;else for(;i.l<i.length;)i.write_shift(1,0);return i}t.version="1.2.2";var y,x=64,C=-2,O="d0cf11e0a1b11ae1",R=[208,207,17,224,161,177,26,225],k="00000000000000000000000000000000",N={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:C,FREESECT:-1,HEADER_SIGNATURE:O,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:k,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function I(e){for(var t=new Array(e.length),r=0;r<e.length;++r)t[r]=String.fromCharCode(e[r]);return t.join("")}function D(e){return y?y.deflateRawSync(e):ae(e)}var P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],L=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],M=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];function F(e){var t=139536&(e<<1|e<<11)|558144&(e<<5|e<<15);return 255&(t>>16|t>>8|t)}for(var U="undefined"!=typeof Uint8Array,B=U?new Uint8Array(256):[],W=0;W<256;++W)B[W]=F(W);function H(e,t){var r=B[255&e];return t<=8?r>>>8-t:(r=r<<8|B[e>>8&255],t<=16?r>>>16-t:(r=r<<8|B[e>>16&255])>>>24-t)}function G(e,t){var r=7&t,n=t>>>3;return(e[n]|(r<=6?0:e[n+1]<<8))>>>r&3}function $(e,t){var r=7&t,n=t>>>3;return(e[n]|(r<=5?0:e[n+1]<<8))>>>r&7}function z(e,t){var r=7&t,n=t>>>3;return(e[n]|(r<=3?0:e[n+1]<<8))>>>r&31}function V(e,t){var r=7&t,n=t>>>3;return(e[n]|(r<=1?0:e[n+1]<<8))>>>r&127}function j(e,t,r){var n=7&t,a=t>>>3,i=(1<<r)-1,s=e[a]>>>n;return r<8-n?s&i:(s|=e[a+1]<<8-n,r<16-n?s&i:(s|=e[a+2]<<16-n,r<24-n?s&i:(s|=e[a+3]<<24-n)&i))}function X(e,t,r){var n=7&t,a=t>>>3;return n<=5?e[a]|=(7&r)<<n:(e[a]|=r<<n&255,e[a+1]=(7&r)>>8-n),t+3}function K(e,t,r){return r=(1&r)<<(7&t),e[t>>>3]|=r,t+1}function Y(e,t,r){var n=t>>>3;return r<<=7&t,e[n]|=255&r,r>>>=8,e[n+1]=r,t+8}function Z(e,t,r){var n=t>>>3;return r<<=7&t,e[n]|=255&r,r>>>=8,e[n+1]=255&r,e[n+2]=r>>>8,t+16}function J(e,t){var r=e.length,n=2*r>t?2*r:t+5,a=0;if(r>=t)return e;if(d){var i=v(n);if(e.copy)e.copy(i);else for(;a<e.length;++a)i[a]=e[a];return i}if(U){var s=new Uint8Array(n);if(s.set)s.set(e);else for(;a<r;++a)s[a]=e[a];return s}return e.length=n,e}function q(e){for(var t=new Array(e),r=0;r<e;++r)t[r]=0;return t}function Q(e,t,r){var n=1,a=0,i=0,s=0,o=0,l=e.length,f=U?new Uint16Array(32):q(32);for(i=0;i<32;++i)f[i]=0;for(i=l;i<r;++i)e[i]=0;l=e.length;var c=U?new Uint16Array(l):q(l);for(i=0;i<l;++i)f[a=e[i]]++,n<a&&(n=a),c[i]=0;for(f[0]=0,i=1;i<=n;++i)f[i+16]=o=o+f[i-1]<<1;for(i=0;i<l;++i)0!=(o=e[i])&&(c[i]=f[o+16]++);var h=0;for(i=0;i<l;++i)if(0!=(h=e[i]))for(o=H(c[i],n)>>n-h,s=(1<<n+4-h)-1;s>=0;--s)t[o|s<<h]=15&h|i<<4;return n}var ee=U?new Uint16Array(512):q(512),te=U?new Uint16Array(32):q(32);if(!U){for(var re=0;re<512;++re)ee[re]=0;for(re=0;re<32;++re)te[re]=0}!function(){for(var e=[],t=0;t<32;t++)e.push(5);Q(e,te,32);var r=[];for(t=0;t<=143;t++)r.push(8);for(;t<=255;t++)r.push(9);for(;t<=279;t++)r.push(7);for(;t<=287;t++)r.push(8);Q(r,ee,288)}();var ne=function(){for(var e=U?new Uint8Array(32768):[],t=0,r=0;t<M.length-1;++t)for(;r<M[t+1];++r)e[r]=t;for(;r<32768;++r)e[r]=29;var n=U?new Uint8Array(259):[];for(t=0,r=0;t<L.length-1;++t)for(;r<L[t+1];++r)n[r]=t;return function(t,r){return t.length<8?function(e,t){for(var r=0;r<e.length;){var n=Math.min(65535,e.length-r),a=r+n==e.length;for(t.write_shift(1,+a),t.write_shift(2,n),t.write_shift(2,65535&~n);n-- >0;)t[t.l++]=e[r++]}return t.l}(t,r):function(t,r){for(var a=0,i=0,s=U?new Uint16Array(32768):[];i<t.length;){var o=Math.min(65535,t.length-i);if(o<10){for(7&(a=X(r,a,+!(i+o!=t.length)))&&(a+=8-(7&a)),r.l=a/8|0,r.write_shift(2,o),r.write_shift(2,65535&~o);o-- >0;)r[r.l++]=t[i++];a=8*r.l}else{a=X(r,a,+!(i+o!=t.length)+2);for(var l=0;o-- >0;){var f=t[i],c=-1,h=0;if((c=s[l=32767&(l<<5^f)])&&((c|=-32768&i)>i&&(c-=32768),c<i))for(;t[c+h]==t[i+h]&&h<250;)++h;if(h>2){(f=n[h])<=22?a=Y(r,a,B[f+1]>>1)-1:(Y(r,a,3),Y(r,a+=5,B[f-23]>>5),a+=3);var u=f<8?0:f-4>>2;u>0&&(Z(r,a,h-L[f]),a+=u),f=e[i-c],a=Y(r,a,B[f]>>3),a-=3;var d=f<4?0:f-2>>1;d>0&&(Z(r,a,i-c-M[f]),a+=d);for(var p=0;p<h;++p)s[l]=32767&i,l=32767&(l<<5^t[i]),++i;o-=h-1}else f<=143?f+=48:a=K(r,a,1),a=Y(r,a,B[f]),s[l]=32767&i,++i}a=Y(r,a,0)-1}}return r.l=(a+7)/8|0,r.l}(t,r)}}();function ae(e){var t=er(50+Math.floor(1.1*e.length)),r=ne(e,t);return t.slice(0,r)}var ie=U?new Uint16Array(32768):q(32768),se=U?new Uint16Array(32768):q(32768),oe=U?new Uint16Array(128):q(128),le=1,fe=1;function ce(e,t){var r=z(e,t)+257,n=z(e,t+=5)+1,a=function(e,t){var r=7&t,n=t>>>3;return(e[n]|(r<=4?0:e[n+1]<<8))>>>r&15}(e,t+=5)+4;t+=4;for(var i=0,s=U?new Uint8Array(19):q(19),o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],l=1,f=U?new Uint8Array(8):q(8),c=U?new Uint8Array(8):q(8),h=s.length,u=0;u<a;++u)s[P[u]]=i=$(e,t),l<i&&(l=i),f[i]++,t+=3;var d=0;for(f[0]=0,u=1;u<=l;++u)c[u]=d=d+f[u-1]<<1;for(u=0;u<h;++u)0!=(d=s[u])&&(o[u]=c[d]++);var p=0;for(u=0;u<h;++u)if(0!=(p=s[u])){d=B[o[u]]>>8-p;for(var m=(1<<7-p)-1;m>=0;--m)oe[d|m<<p]=7&p|u<<3}var g=[];for(l=1;g.length<r+n;)switch(t+=7&(d=oe[V(e,t)]),d>>>=3){case 16:for(i=3+G(e,t),t+=2,d=g[g.length-1];i-- >0;)g.push(d);break;case 17:for(i=3+$(e,t),t+=3;i-- >0;)g.push(0);break;case 18:for(i=11+V(e,t),t+=7;i-- >0;)g.push(0);break;default:g.push(d),l<d&&(l=d)}var v=g.slice(0,r),w=g.slice(r);for(u=r;u<286;++u)v[u]=0;for(u=n;u<30;++u)w[u]=0;return le=Q(v,ie,286),fe=Q(w,se,30),t}function he(e,t){var r=function(e,t){if(3==e[0]&&!(3&e[1]))return[g(t),2];for(var r=0,n=0,a=v(t||1<<18),i=0,s=a.length>>>0,o=0,l=0;!(1&n);)if(n=$(e,r),r+=3,n>>>1!=0)for(n>>1==1?(o=9,l=5):(r=ce(e,r),o=le,l=fe);;){!t&&s<i+32767&&(s=(a=J(a,i+32767)).length);var f=j(e,r,o),c=n>>>1==1?ee[f]:ie[f];if(r+=15&c,(c>>>=4)>>>8&255){if(256==c)break;var h=(c-=257)<8?0:c-4>>2;h>5&&(h=0);var u=i+L[c];h>0&&(u+=j(e,r,h),r+=h),f=j(e,r,l),r+=15&(c=n>>>1==1?te[f]:se[f]);var d=(c>>>=4)<4?0:c-2>>1,p=M[c];for(d>0&&(p+=j(e,r,d),r+=d),!t&&s<u&&(s=(a=J(a,u+100)).length);i<u;)a[i]=a[i-p],++i}else a[i++]=c}else{7&r&&(r+=8-(7&r));var m=e[r>>>3]|e[(r>>>3)+1]<<8;if(r+=32,m>0)for(!t&&s<i+m&&(s=(a=J(a,i+m)).length);m-- >0;)a[i++]=e[r>>>3],r+=8}return t?[a,r+7>>>3]:[a.slice(0,i),r+7>>>3]}(e.slice(e.l||0),t);return e.l+=r[1],r[0]}function ue(e,t){if(!e)throw new Error(t);"undefined"!=typeof console&&console.error(t)}function ge(e,t){var r=e;qt(r,0);var n={FileIndex:[],FullPaths:[]};T(n,{root:t.root});for(var a=r.length-4;(80!=r[a]||75!=r[a+1]||5!=r[a+2]||6!=r[a+3])&&a>=0;)--a;r.l=a+4,r.l+=4;var s=r.read_shift(2);r.l+=6;var o=r.read_shift(4);for(r.l=o,a=0;a<s;++a){r.l+=20;var l=r.read_shift(4),f=r.read_shift(4),c=r.read_shift(2),h=r.read_shift(2),u=r.read_shift(2);r.l+=8;var d=r.read_shift(4),p=i(r.slice(r.l+c,r.l+c+h));r.l+=c+h+u;var m=r.l;r.l=d+4,p&&p[1]&&((p[1]||{}).usz&&(f=p[1].usz),(p[1]||{}).csz&&(l=p[1].csz)),ve(r,l,f,n,p),r.l=m}return n}function ve(e,t,r,n,a){e.l+=2;var s=e.read_shift(2),o=e.read_shift(2),l=function(e){var t=65535&e.read_shift(2),r=65535&e.read_shift(2),n=new Date,a=31&r,i=15&(r>>>=5);r>>>=4,n.setMilliseconds(0),n.setFullYear(r+1980),n.setMonth(i-1),n.setDate(a)