@cj-tech-master/excelts 0.1.0-canary.20251025023400.dff1908 → 0.1.0-canary.20251029013247.758de7b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/excelts.iife.js +2 -2
- package/dist/browser/excelts.iife.js.map +1 -1
- package/dist/browser/excelts.iife.min.js +2 -2
- package/dist/cjs/doc/worksheet.js +2 -2
- package/dist/esm/doc/worksheet.js +2 -2
- package/dist/esm/local.js +1 -0
- package/dist/types/local.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @cj-tech-master/excelts v0.1.0-canary.
|
|
2
|
+
* @cj-tech-master/excelts v0.1.0-canary.20251029013247.758de7b
|
|
3
3
|
* TypeScript Excel Workbook Manager - Read and Write xlsx and csv Files.
|
|
4
4
|
* (c) 2025 cjnoname
|
|
5
5
|
* Released under the MIT License
|
|
@@ -22,7 +22,7 @@ Use Chrome, Firefox or Internet Explorer 11`)}var a=ze().Buffer,o=global.crypto|
|
|
|
22
22
|
`)}})),Ci=c((e=>{var t=e;t.der=xi(),t.pem=Si()})),wi=c((e=>{var t=e;t.bignum=Tr(),t.define=di().define,t.base=hi(),t.constants=_i(),t.decoders=bi(),t.encoders=Ci()})),Ti=c(((e,t)=>{var n=wi(),r=n.define(`Time`,function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),i=n.define(`AttributeTypeValue`,function(){this.seq().obj(this.key(`type`).objid(),this.key(`value`).any())}),a=n.define(`AlgorithmIdentifier`,function(){this.seq().obj(this.key(`algorithm`).objid(),this.key(`parameters`).optional(),this.key(`curve`).objid().optional())}),o=n.define(`SubjectPublicKeyInfo`,function(){this.seq().obj(this.key(`algorithm`).use(a),this.key(`subjectPublicKey`).bitstr())}),s=n.define(`RelativeDistinguishedName`,function(){this.setof(i)}),c=n.define(`RDNSequence`,function(){this.seqof(s)}),l=n.define(`Name`,function(){this.choice({rdnSequence:this.use(c)})}),u=n.define(`Validity`,function(){this.seq().obj(this.key(`notBefore`).use(r),this.key(`notAfter`).use(r))}),d=n.define(`Extension`,function(){this.seq().obj(this.key(`extnID`).objid(),this.key(`critical`).bool().def(!1),this.key(`extnValue`).octstr())}),f=n.define(`TBSCertificate`,function(){this.seq().obj(this.key(`version`).explicit(0).int().optional(),this.key(`serialNumber`).int(),this.key(`signature`).use(a),this.key(`issuer`).use(l),this.key(`validity`).use(u),this.key(`subject`).use(l),this.key(`subjectPublicKeyInfo`).use(o),this.key(`issuerUniqueID`).implicit(1).bitstr().optional(),this.key(`subjectUniqueID`).implicit(2).bitstr().optional(),this.key(`extensions`).explicit(3).seqof(d).optional())});t.exports=n.define(`X509Certificate`,function(){this.seq().obj(this.key(`tbsCertificate`).use(f),this.key(`signatureAlgorithm`).use(a),this.key(`signatureValue`).bitstr())})})),Ei=c((e=>{var t=wi();e.certificate=Ti(),e.RSAPrivateKey=t.define(`RSAPrivateKey`,function(){this.seq().obj(this.key(`version`).int(),this.key(`modulus`).int(),this.key(`publicExponent`).int(),this.key(`privateExponent`).int(),this.key(`prime1`).int(),this.key(`prime2`).int(),this.key(`exponent1`).int(),this.key(`exponent2`).int(),this.key(`coefficient`).int())}),e.RSAPublicKey=t.define(`RSAPublicKey`,function(){this.seq().obj(this.key(`modulus`).int(),this.key(`publicExponent`).int())});var n=t.define(`AlgorithmIdentifier`,function(){this.seq().obj(this.key(`algorithm`).objid(),this.key(`none`).null_().optional(),this.key(`curve`).objid().optional(),this.key(`params`).seq().obj(this.key(`p`).int(),this.key(`q`).int(),this.key(`g`).int()).optional())});e.PublicKey=t.define(`SubjectPublicKeyInfo`,function(){this.seq().obj(this.key(`algorithm`).use(n),this.key(`subjectPublicKey`).bitstr())}),e.PrivateKey=t.define(`PrivateKeyInfo`,function(){this.seq().obj(this.key(`version`).int(),this.key(`algorithm`).use(n),this.key(`subjectPrivateKey`).octstr())}),e.EncryptedPrivateKey=t.define(`EncryptedPrivateKeyInfo`,function(){this.seq().obj(this.key(`algorithm`).seq().obj(this.key(`id`).objid(),this.key(`decrypt`).seq().obj(this.key(`kde`).seq().obj(this.key(`id`).objid(),this.key(`kdeparams`).seq().obj(this.key(`salt`).octstr(),this.key(`iters`).int())),this.key(`cipher`).seq().obj(this.key(`algo`).objid(),this.key(`iv`).octstr()))),this.key(`subjectPrivateKey`).octstr())}),e.DSAPrivateKey=t.define(`DSAPrivateKey`,function(){this.seq().obj(this.key(`version`).int(),this.key(`p`).int(),this.key(`q`).int(),this.key(`g`).int(),this.key(`pub_key`).int(),this.key(`priv_key`).int())}),e.DSAparam=t.define(`DSAparam`,function(){this.int()});var r=t.define(`ECParameters`,function(){this.choice({namedCurve:this.objid()})});e.ECPrivateKey=t.define(`ECPrivateKey`,function(){this.seq().obj(this.key(`version`).int(),this.key(`privateKey`).octstr(),this.key(`parameters`).optional().explicit(0).use(r),this.key(`publicKey`).optional().explicit(1).bitstr())}),e.signature=t.define(`signature`,function(){this.seq().obj(this.key(`r`).int(),this.key(`s`).int())})})),Di=c(((e,t)=>{t.exports={"2.16.840.1.101.3.4.1.1":`aes-128-ecb`,"2.16.840.1.101.3.4.1.2":`aes-128-cbc`,"2.16.840.1.101.3.4.1.3":`aes-128-ofb`,"2.16.840.1.101.3.4.1.4":`aes-128-cfb`,"2.16.840.1.101.3.4.1.21":`aes-192-ecb`,"2.16.840.1.101.3.4.1.22":`aes-192-cbc`,"2.16.840.1.101.3.4.1.23":`aes-192-ofb`,"2.16.840.1.101.3.4.1.24":`aes-192-cfb`,"2.16.840.1.101.3.4.1.41":`aes-256-ecb`,"2.16.840.1.101.3.4.1.42":`aes-256-cbc`,"2.16.840.1.101.3.4.1.43":`aes-256-ofb`,"2.16.840.1.101.3.4.1.44":`aes-256-cfb`}})),Oi=c(((e,t)=>{var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,r=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,a=yr(),o=Sr(),s=ze().Buffer;t.exports=function(e,t){var c=e.toString(),l=c.match(n),u;if(l){var d=`aes`+l[1],f=s.from(l[2],`hex`),p=s.from(l[3].replace(/[\r\n]/g,``),`base64`),m=a(t,f.slice(0,8),parseInt(l[1],10)).key,h=[],g=o.createDecipheriv(d,m,f);h.push(g.update(p)),h.push(g.final()),u=s.concat(h)}else{var _=c.match(i);u=s.from(_[2].replace(/[\r\n]/g,``),`base64`)}return{tag:c.match(r)[1],data:u}}})),ki=c(((e,t)=>{var n=Ei(),r=Di(),i=Oi(),a=Sr(),o=Yn().pbkdf2Sync,s=ze().Buffer;function c(e,t){var n=e.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),c=r[e.algorithm.decrypt.cipher.algo.join(`.`)],l=e.algorithm.decrypt.cipher.iv,u=e.subjectPrivateKey,d=o(t,n,i,parseInt(c.split(`-`)[1],10)/8,`sha1`),f=a.createDecipheriv(c,d,l),p=[];return p.push(f.update(u)),p.push(f.final()),s.concat(p)}function l(e){var t;typeof e==`object`&&!s.isBuffer(e)&&(t=e.passphrase,e=e.key),typeof e==`string`&&(e=s.from(e));var r=i(e,t),a=r.tag,o=r.data,l,u;switch(a){case`CERTIFICATE`:u=n.certificate.decode(o,`der`).tbsCertificate.subjectPublicKeyInfo;case`PUBLIC KEY`:switch(u||=n.PublicKey.decode(o,`der`),l=u.algorithm.algorithm.join(`.`),l){case`1.2.840.113549.1.1.1`:return n.RSAPublicKey.decode(u.subjectPublicKey.data,`der`);case`1.2.840.10045.2.1`:return u.subjectPrivateKey=u.subjectPublicKey,{type:`ec`,data:u};case`1.2.840.10040.4.1`:return u.algorithm.params.pub_key=n.DSAparam.decode(u.subjectPublicKey.data,`der`),{type:`dsa`,data:u.algorithm.params};default:throw Error(`unknown key id `+l)}case`ENCRYPTED PRIVATE KEY`:o=n.EncryptedPrivateKey.decode(o,`der`),o=c(o,t);case`PRIVATE KEY`:switch(u=n.PrivateKey.decode(o,`der`),l=u.algorithm.algorithm.join(`.`),l){case`1.2.840.113549.1.1.1`:return n.RSAPrivateKey.decode(u.subjectPrivateKey,`der`);case`1.2.840.10045.2.1`:return{curve:u.algorithm.curve,privateKey:n.ECPrivateKey.decode(u.subjectPrivateKey,`der`).privateKey};case`1.2.840.10040.4.1`:return u.algorithm.params.priv_key=n.DSAparam.decode(u.subjectPrivateKey,`der`),{type:`dsa`,params:u.algorithm.params};default:throw Error(`unknown key id `+l)}case`RSA PUBLIC KEY`:return n.RSAPublicKey.decode(o,`der`);case`RSA PRIVATE KEY`:return n.RSAPrivateKey.decode(o,`der`);case`DSA PRIVATE KEY`:return{type:`dsa`,params:n.DSAPrivateKey.decode(o,`der`)};case`EC PRIVATE KEY`:return o=n.ECPrivateKey.decode(o,`der`),{curve:o.parameters.value,privateKey:o.privateKey};default:throw Error(`unknown key type `+a)}}l.signature=n.signature,t.exports=l})),Ai=c(((e,t)=>{t.exports={"1.3.132.0.10":`secp256k1`,"1.3.132.0.33":`p224`,"1.2.840.10045.3.1.1":`p192`,"1.2.840.10045.3.1.7":`p256`,"1.3.132.0.34":`p384`,"1.3.132.0.35":`p521`}})),ji=c(((e,t)=>{var n=ze().Buffer,r=Vn(),i=Nr(),a=li().ec,o=Mr(),s=ki(),c=Ai(),l=1;function u(e,t,r,a,o){var c=s(t);if(c.curve){if(a!==`ecdsa`&&a!==`ecdsa/rsa`)throw Error(`wrong private key type`);return d(e,c)}else if(c.type===`dsa`){if(a!==`dsa`)throw Error(`wrong private key type`);return f(e,c,r)}if(a!==`rsa`&&a!==`ecdsa/rsa`)throw Error(`wrong private key type`);if(t.padding!==void 0&&t.padding!==l)throw Error(`illegal or unsupported padding mode`);e=n.concat([o,e]);for(var u=c.modulus.byteLength(),p=[0,1];e.length+p.length+1<u;)p.push(255);p.push(0);for(var m=-1;++m<e.length;)p.push(e[m]);return i(p,c)}function d(e,t){var r=c[t.curve.join(`.`)];if(!r)throw Error(`unknown curve `+t.curve.join(`.`));var i=new a(r).keyFromPrivate(t.privateKey).sign(e);return n.from(i.toDER())}function f(e,t,n){for(var r=t.params.priv_key,i=t.params.p,a=t.params.q,s=t.params.g,c=new o(0),l,u=h(e,a).mod(a),d=!1,f=m(r,a,e,n);d===!1;)l=_(a,f,n),c=v(s,l,i,a),d=l.invm(a).imul(u.add(r.mul(c))).mod(a),d.cmpn(0)===0&&(d=!1,c=new o(0));return p(c,d)}function p(e,t){e=e.toArray(),t=t.toArray(),e[0]&128&&(e=[0].concat(e)),t[0]&128&&(t=[0].concat(t));var r=[48,e.length+t.length+4,2,e.length];return r=r.concat(e,[2,t.length],t),n.from(r)}function m(e,t,i,a){if(e=n.from(e.toArray()),e.length<t.byteLength()){var o=n.alloc(t.byteLength()-e.length);e=n.concat([o,e])}var s=i.length,c=g(i,t),l=n.alloc(s);l.fill(1);var u=n.alloc(s);return u=r(a,u).update(l).update(n.from([0])).update(e).update(c).digest(),l=r(a,u).update(l).digest(),u=r(a,u).update(l).update(n.from([1])).update(e).update(c).digest(),l=r(a,u).update(l).digest(),{k:u,v:l}}function h(e,t){var n=new o(e),r=(e.length<<3)-t.bitLength();return r>0&&n.ishrn(r),n}function g(e,t){e=h(e,t),e=e.mod(t);var r=n.from(e.toArray());if(r.length<t.byteLength()){var i=n.alloc(t.byteLength()-r.length);r=n.concat([i,r])}return r}function _(e,t,i){var a,o;do{for(a=n.alloc(0);a.length*8<e.bitLength();)t.v=r(i,t.k).update(t.v).digest(),a=n.concat([a,t.v]);o=h(a,e),t.k=r(i,t.k).update(t.v).update(n.from([0])).digest(),t.v=r(i,t.k).update(t.v).digest()}while(o.cmp(e)!==-1);return o}function v(e,t,n,r){return e.toRed(o.mont(n)).redPow(t).fromRed().mod(r)}t.exports=u,t.exports.getKey=m,t.exports.makeKey=_})),Mi=c(((e,t)=>{var n=ze().Buffer,r=Mr(),i=li().ec,a=ki(),o=Ai();function s(e,t,i,o,s){var u=a(i);if(u.type===`ec`){if(o!==`ecdsa`&&o!==`ecdsa/rsa`)throw Error(`wrong public key type`);return c(e,t,u)}else if(u.type===`dsa`){if(o!==`dsa`)throw Error(`wrong public key type`);return l(e,t,u)}if(o!==`rsa`&&o!==`ecdsa/rsa`)throw Error(`wrong public key type`);t=n.concat([s,t]);for(var d=u.modulus.byteLength(),f=[1],p=0;t.length+f.length+2<d;)f.push(255),p+=1;f.push(0);for(var m=-1;++m<t.length;)f.push(t[m]);f=n.from(f);var h=r.mont(u.modulus);e=new r(e).toRed(h),e=e.redPow(new r(u.publicExponent)),e=n.from(e.fromRed().toArray());var g=p<8?1:0;for(d=Math.min(e.length,f.length),e.length!==f.length&&(g=1),m=-1;++m<d;)g|=e[m]^f[m];return g===0}function c(e,t,n){var r=o[n.data.algorithm.curve.join(`.`)];if(!r)throw Error(`unknown curve `+n.data.algorithm.curve.join(`.`));var a=new i(r),s=n.data.subjectPrivateKey.data;return a.verify(t,e,s)}function l(e,t,n){var i=n.data.p,o=n.data.q,s=n.data.g,c=n.data.pub_key,l=a.signature.decode(e,`der`),d=l.s,f=l.r;u(d,o),u(f,o);var p=r.mont(i),m=d.invm(o);return s.toRed(p).redPow(new r(t).mul(m).mod(o)).fromRed().mul(c.toRed(p).redPow(f.mul(m).mod(o)).fromRed()).mod(i).mod(o).cmp(f)===0}function u(e,t){if(e.cmpn(0)<=0||e.cmp(t)>=0)throw Error(`invalid sig`)}t.exports=s})),Ni=c(((e,t)=>{var n=ze().Buffer,r=Rn(),i=En(),a=Ve(),o=ji(),s=Mi(),c=Hn();Object.keys(c).forEach(function(e){c[e].id=n.from(c[e].id,`hex`),c[e.toLowerCase()]=c[e]});function l(e){i.Writable.call(this);var t=c[e];if(!t)throw Error(`Unknown message digest`);this._hashType=t.hash,this._hash=r(t.hash),this._tag=t.id,this._signType=t.sign}a(l,i.Writable),l.prototype._write=function(e,t,n){this._hash.update(e),n()},l.prototype.update=function(e,t){return this._hash.update(typeof e==`string`?n.from(e,t):e),this},l.prototype.sign=function(e,t){this.end();var n=o(this._hash.digest(),e,this._hashType,this._signType,this._tag);return t?n.toString(t):n};function u(e){i.Writable.call(this);var t=c[e];if(!t)throw Error(`Unknown message digest`);this._hash=r(t.hash),this._tag=t.id,this._signType=t.sign}a(u,i.Writable),u.prototype._write=function(e,t,n){this._hash.update(e),n()},u.prototype.update=function(e,t){return this._hash.update(typeof e==`string`?n.from(e,t):e),this},u.prototype.verify=function(e,t,r){var i=typeof t==`string`?n.from(t,r):t;return this.end(),s(i,this._hash.digest(),e,this._signType,this._tag)};function d(e){return new l(e)}function f(e){return new u(e)}t.exports={Sign:d,Verify:f,createSign:d,createVerify:f}})),Pi=c(((e,t)=>{var n=d(q()),r=li(),i=Tr();t.exports=function(e){return new o(e)};var a={secp256k1:{name:`secp256k1`,byteLength:32},secp224r1:{name:`p224`,byteLength:28},prime256v1:{name:`p256`,byteLength:32},prime192v1:{name:`p192`,byteLength:24},ed25519:{name:`ed25519`,byteLength:32},secp384r1:{name:`p384`,byteLength:48},secp521r1:{name:`p521`,byteLength:66}};a.p224=a.secp224r1,a.p256=a.secp256r1=a.prime256v1,a.p192=a.secp192r1=a.prime192v1,a.p384=a.secp384r1,a.p521=a.secp521r1;function o(e){this.curveType=a[e],this.curveType||={name:e},this.curve=new r.ec(this.curveType.name),this.keys=void 0}o.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},o.prototype.computeSecret=function(e,t,r){return t||=`utf8`,n.Buffer.isBuffer(e)||(e=new n.Buffer(e,t)),s(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),r,this.curveType.byteLength)},o.prototype.getPublicKey=function(e,t){var n=this.keys.getPublic(t===`compressed`,!0);return t===`hybrid`&&(n[n.length-1]%2?n[0]=7:n[0]=6),s(n,e)},o.prototype.getPrivateKey=function(e){return s(this.keys.getPrivate(),e)},o.prototype.setPublicKey=function(e,t){return t||=`utf8`,n.Buffer.isBuffer(e)||(e=new n.Buffer(e,t)),this.keys._importPublic(e),this},o.prototype.setPrivateKey=function(e,t){t||=`utf8`,n.Buffer.isBuffer(e)||(e=new n.Buffer(e,t));var r=new i(e);return r=r.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(r),this};function s(e,t,r){Array.isArray(e)||(e=e.toArray());var i=new n.Buffer(e);if(r&&i.length<r){var a=new n.Buffer(r-i.length);a.fill(0),i=n.Buffer.concat([a,i])}return t?i.toString(t):i}})),Fi=c(((e,t)=>{var n=Rn(),r=ze().Buffer;t.exports=function(e,t){for(var a=r.alloc(0),o=0,s;a.length<t;)s=i(o++),a=r.concat([a,n(`sha1`).update(e).update(s).digest()]);return a.slice(0,t)};function i(e){var t=r.allocUnsafe(4);return t.writeUInt32BE(e,0),t}})),Ii=c(((e,t)=>{t.exports=function(e,t){for(var n=e.length,r=-1;++r<n;)e[r]^=t[r];return e}})),Li=c(((e,t)=>{var n=Tr(),r=ze().Buffer;function i(e,t){return r.from(e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed().toArray())}t.exports=i})),Ri=c(((e,t)=>{var n=ki(),r=Be(),i=Rn(),a=Fi(),o=Ii(),s=Tr(),c=Li(),l=Nr(),u=ze().Buffer;t.exports=function(e,t,r){var i=e.padding?e.padding:r?1:4,a=n(e),o;if(i===4)o=d(a,t);else if(i===1)o=f(a,t,r);else if(i===3){if(o=new s(t),o.cmp(a.modulus)>=0)throw Error(`data too long for modulus`)}else throw Error(`unknown padding`);return r?l(o,a):c(o,a)};function d(e,t){var n=e.modulus.byteLength(),c=t.length,l=i(`sha1`).update(u.alloc(0)).digest(),d=l.length,f=2*d;if(c>n-f-2)throw Error(`message too long`);var p=u.alloc(n-c-f-2),m=n-d-1,h=r(d),g=o(u.concat([l,p,u.alloc(1,1),t],m),a(h,m)),_=o(h,a(g,d));return new s(u.concat([u.alloc(1),_,g],n))}function f(e,t,n){var r=t.length,i=e.modulus.byteLength();if(r>i-11)throw Error(`message too long`);var a=n?u.alloc(i-r-3,255):p(i-r-3);return new s(u.concat([u.from([0,n?1:2]),a,u.alloc(1),t],i))}function p(e){for(var t=u.allocUnsafe(e),n=0,i=r(e*2),a=0,o;n<e;)a===i.length&&(i=r(e*2),a=0),o=i[a++],o&&(t[n++]=o);return t}})),zi=c(((e,t)=>{var n=ki(),r=Fi(),i=Ii(),a=Tr(),o=Nr(),s=Rn(),c=Li(),l=ze().Buffer;t.exports=function(e,t,r){var i=e.padding?e.padding:r?1:4,s=n(e),f=s.modulus.byteLength();if(t.length>f||new a(t).cmp(s.modulus)>=0)throw Error(`decryption error`);var p=r?c(new a(t),s):o(t,s),m=l.alloc(f-p.length);if(p=l.concat([m,p],f),i===4)return u(s,p);if(i===1)return d(s,p,r);if(i===3)return p;throw Error(`unknown padding`)};function u(e,t){var n=e.modulus.byteLength(),a=s(`sha1`).update(l.alloc(0)).digest(),o=a.length;if(t[0]!==0)throw Error(`decryption error`);var c=t.slice(1,o+1),u=t.slice(o+1),d=i(u,r(i(c,r(u,o)),n-o-1));if(f(a,d.slice(0,o)))throw Error(`decryption error`);for(var p=o;d[p]===0;)p++;if(d[p++]!==1)throw Error(`decryption error`);return d.slice(p)}function d(e,t,n){for(var r=t.slice(0,2),i=2,a=0;t[i++]!==0;)if(i>=t.length){a++;break}var o=t.slice(2,i-1);if((r.toString(`hex`)!==`0002`&&!n||r.toString(`hex`)!==`0001`&&n)&&a++,o.length<8&&a++,a)throw Error(`decryption error`);return t.slice(i)}function f(e,t){e=l.from(e),t=l.from(t);var n=0,r=e.length;e.length!==t.length&&(n++,r=Math.min(e.length,t.length));for(var i=-1;++i<r;)n+=e[i]^t[i];return n}})),Bi=c((e=>{e.publicEncrypt=Ri(),e.privateDecrypt=zi(),e.privateEncrypt=function(t,n){return e.publicEncrypt(t,n,!0)},e.publicDecrypt=function(t,n){return e.privateDecrypt(t,n,!0)}})),Vi=c((e=>{Re();function t(){throw Error(`secure random number generation not supported by this browser
|
|
23
23
|
use chrome, FireFox or Internet Explorer 11`)}var n=ze(),r=Be(),i=n.Buffer,a=n.kMaxLength,o=global.crypto||global.msCrypto,s=2**32-1;function c(e,t){if(typeof e!=`number`||e!==e)throw TypeError(`offset must be a number`);if(e>s||e<0)throw TypeError(`offset must be a uint32`);if(e>a||e>t)throw RangeError(`offset out of range`)}function l(e,t,n){if(typeof e!=`number`||e!==e)throw TypeError(`size must be a number`);if(e>s||e<0)throw TypeError(`size must be a uint32`);if(e+t>n||e>a)throw RangeError(`buffer too small`)}o&&o.getRandomValues||!Q.browser?(e.randomFill=u,e.randomFillSync=f):(e.randomFill=t,e.randomFillSync=t);function u(e,t,n,r){if(!i.isBuffer(e)&&!(e instanceof global.Uint8Array))throw TypeError(`"buf" argument must be a Buffer or Uint8Array`);if(typeof t==`function`)r=t,t=0,n=e.length;else if(typeof n==`function`)r=n,n=e.length-t;else if(typeof r!=`function`)throw TypeError(`"cb" argument must be a function`);return c(t,e.length),l(n,t,e.length),d(e,t,n,r)}function d(e,t,n,i){if(Q.browser){var a=e.buffer,s=new Uint8Array(a,t,n);if(o.getRandomValues(s),i){Q.nextTick(function(){i(null,e)});return}return e}if(i){r(n,function(n,r){if(n)return i(n);r.copy(e,t),i(null,e)});return}return r(n).copy(e,t),e}function f(e,t,n){if(t===void 0&&(t=0),!i.isBuffer(e)&&!(e instanceof global.Uint8Array))throw TypeError(`"buf" argument must be a Buffer or Uint8Array`);return c(t,e.length),n===void 0&&(n=e.length-t),l(n,t,e.length),d(e,t,n)}})),Hi=c((e=>{e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=Be(),e.createHash=e.Hash=Rn(),e.createHmac=e.Hmac=Vn();var t=Un(),n=Object.keys(t),r=[`sha1`,`sha224`,`sha256`,`sha384`,`sha512`,`md5`,`rmd160`].concat(n);e.getHashes=function(){return r};var i=Yn();e.pbkdf2=i.pbkdf2,e.pbkdf2Sync=i.pbkdf2Sync;var a=wr();e.Cipher=a.Cipher,e.createCipher=a.createCipher,e.Cipheriv=a.Cipheriv,e.createCipheriv=a.createCipheriv,e.Decipher=a.Decipher,e.createDecipher=a.createDecipher,e.Decipheriv=a.Decipheriv,e.createDecipheriv=a.createDecipheriv,e.getCiphers=a.getCiphers,e.listCiphers=a.listCiphers;var o=jr();e.DiffieHellmanGroup=o.DiffieHellmanGroup,e.createDiffieHellmanGroup=o.createDiffieHellmanGroup,e.getDiffieHellman=o.getDiffieHellman,e.createDiffieHellman=o.createDiffieHellman,e.DiffieHellman=o.DiffieHellman;var s=Ni();e.createSign=s.createSign,e.Sign=s.Sign,e.createVerify=s.createVerify,e.Verify=s.Verify,e.createECDH=Pi();var c=Bi();e.publicEncrypt=c.publicEncrypt,e.privateEncrypt=c.privateEncrypt,e.publicDecrypt=c.publicDecrypt,e.privateDecrypt=c.privateDecrypt;var l=Vi();e.randomFill=l.randomFill,e.randomFillSync=l.randomFillSync,e.createCredentials=function(){throw Error(`sorry, createCredentials is not implemented yet
|
|
24
24
|
we accept pull requests
|
|
25
|
-
https://github.com/browserify/crypto-browserify`)},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}})),Ui=d(q(),1),Wi=d(Hi(),1);let Gi={hash(e,...t){let n=Wi.createHash(e);return n.update(Ui.Buffer.concat(t)),n.digest()},convertPasswordToHash(e,t,n,r){if(t=t.toLowerCase(),Wi.getHashes().indexOf(t)<0)throw Error(`Hash algorithm '${t}' not supported!`);let i=Ui.Buffer.from(e,`utf16le`),a=this.hash(t,Ui.Buffer.from(n,`base64`),i);for(let e=0;e<r;e++){let n=Ui.Buffer.alloc(4);n.writeUInt32LE(e,0),a=this.hash(t,a,n)}return a.toString(`base64`)},randomBytes(e){return Wi.randomBytes(e)}};var Ki=l({default:()=>qi}),qi,Ji=s((()=>{qi=null}));Ji();function Yi(){}let Xi=function(e,t,n,r){e.super_=t,r||(r=n,n=null),n&&Object.keys(n).forEach(t=>{Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))});let i={constructor:{value:e,enumerable:!1,writable:!1,configurable:!0}};r&&Object.keys(r).forEach(e=>{i[e]=Object.getOwnPropertyDescriptor(r,e)}),e.prototype=Object.create(t.prototype,i)};function Zi(e,t){return 25569+e.getTime()/(24*3600*1e3)-(t?1462:0)}function Qi(e,t){let n=Math.round((e-25569+(t?1462:0))*24*3600*1e3);return new Date(n)}let $i=/[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/;function ea(e){let t=$i.exec(e);if(!t)return e;let n=``,r=``,i=0,a=t.index;for(;a<e.length;a++){let t=e.charCodeAt(a);switch(t){case 34:r=`"`;break;case 38:r=`&`;break;case 39:r=`'`;break;case 60:r=`<`;break;case 62:r=`>`;break;case 127:r=``;break;default:if(t<=31&&(t<=8||t>=11&&t!==13)){r=``;break}continue}i!==a&&(n+=e.substring(i,a)),i=a+1,r&&(n+=r)}return i===a?n:n+e.substring(i,a)}function ta(e){return e.replace(/&([a-z]*);/g,e=>{switch(e){case`<`:return`<`;case`>`:return`>`;case`&`:return`&`;case`'`:return`'`;case`"`:return`"`;default:return e}})}function na(e){let t=parseInt(e,10);return Number.isNaN(t)?0:t}function ra(e){return e?(e=e.replace(/\[[^\]]*]/g,``),e=e.replace(/"[^"]*"/g,``),e.match(/[ymdhMsb]+/)!==null):!1}function ia(e){return new Promise(t=>{qi.access(e,qi.constants.F_OK,e=>{t(!e)})})}function aa(e){return e===!0||e===`true`||e===1||e===`1`}function*oa(e,t,n=1){let r=n>0?(e,t)=>e<t:(e,t)=>e>t;for(let i=e;r(i,t);i+=n)yield i}function sa(e){let t=Array.from(e);return t.every(e=>Number.isFinite(e))?t.sort((e,t)=>e-t):t.sort()}function ca(e,t=null){return e.reduce((e,n)=>(e[n]=t,e),{})}function la(e,t){ua(e,t);let{sourceSheet:n}=t,{rows:r,columns:i,values:a}=t,o=da(n,[...r,...i]),s=o.reduce((e,t,n)=>(e[t.name]=n,e),{});return{sourceSheet:n,rows:r.map(e=>s[e]),columns:i.map(e=>s[e]),values:a.map(e=>s[e]),metric:`sum`,cacheFields:o,cacheId:`10`}}function ua(e,t){if(e.workbook.pivotTables.length===1)throw Error(`A pivot table was already added. At this time, ExcelTS supports at most one pivot table per file.`);if(t.metric&&t.metric!==`sum`)throw Error(`Only the "sum" metric is supported at this time.`);let n=ca(t.sourceSheet.getRow(1).values.slice(1),!0);for(let e of[...t.rows,...t.columns,...t.values])if(!n[e])throw Error(`The header name "${e}" was not found in ${t.sourceSheet.name}.`);if(!t.rows.length)throw Error(`No pivot table rows specified.`);if(!t.columns.length)throw Error(`No pivot table columns specified.`);if(t.values.length!==1)throw Error(`Exactly 1 value needs to be specified at this time.`)}function da(e,t){let n=e.getRow(1).values,r=ca(t,!0),i=t=>{let n=e.getColumn(t).values.splice(2);return sa(new Set(n))},a=[];for(let e of oa(1,n.length)){let t=n[e],o=r[t]?i(e):null;a.push({name:t,sharedItems:o})}return a}let fa=(e,t)=>({...e,...t.reduce((t,n)=>(e[n]&&(t[n]={...e[n]}),t),{})}),pa=(e,t,n,r=[])=>{e[n]&&(t[n]=fa(e[n],r))},ma=e=>Object.keys(e).length===0,ha=e=>{if(!e)return e;if(ma(e))return{};let t={...e};return pa(e,t,`font`,[`color`]),pa(e,t,`alignment`),pa(e,t,`protection`),e.border&&(pa(e,t,`border`),pa(e.border,t.border,`top`,[`color`]),pa(e.border,t.border,`left`,[`color`]),pa(e.border,t.border,`bottom`,[`color`]),pa(e.border,t.border,`right`,[`color`]),pa(e.border,t.border,`diagonal`,[`color`])),e.fill&&(pa(e,t,`fill`,[`fgColor`,`bgColor`,`center`]),e.fill.stops&&(t.fill.stops=e.fill.stops.map(e=>fa(e,[`color`])))),t};var ga=class{constructor(e){e||={},this._workbook=e.workbook,this.id=e.id||0,this.orderNo=e.orderNo||0,this._name=e.name||`sheet${this.id}`,this.state=e.state||`visible`,this._rows=[],this._columns=null,this._keys={},this._merges={},this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},e.properties),this.pageSetup=Object.assign({},{margins:{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},orientation:`portrait`,horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!!(e.pageSetup&&(e.pageSetup.fitToWidth||e.pageSetup.fitToHeight)&&!e.pageSetup.scale),pageOrder:`downThenOver`,blackAndWhite:!1,draft:!1,cellComments:`None`,errors:`displayed`,scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,firstPageNumber:void 0,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},e.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},e.headerFooter),this.dataValidations=new se,this.views=e.views||[],this.autoFilter=e.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.pivotTables=[],this.conditionalFormattings=[]}get name(){return this._name}set name(e){if(e===void 0&&(e=`sheet${this.id}`),this._name!==e){if(typeof e!=`string`)throw Error(`The name has to be a string.`);if(e===``)throw Error(`The name can't be empty.`);if(e===`History`)throw Error(`The name "History" is protected. Please use a different name.`);if(/[*?:/\\[\]]/.test(e))throw Error(`Worksheet name ${e} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(e))throw Error(`The first or last character of worksheet name cannot be a single quotation mark: ${e}`);if(e&&e.length>31&&(e=e.substring(0,31)),this._workbook._worksheets.find(t=>t&&t.name.toLowerCase()===e.toLowerCase()))throw Error(`Worksheet name already exists: ${e}`);this._name=e}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){let e=new h;return this._rows.forEach(t=>{if(t){let n=t.dimensions;n&&e.expand(t.number,n.min,t.number,n.max)}}),e}get columns(){return this._columns}set columns(e){this._headerRowCount=e.reduce((e,t)=>{let n=t.header&&1||t.headers&&t.headers.length||0;return Math.max(e,n)},0);let t=1,n=this._columns=[];e.forEach(e=>{let r=new ae(this,t++,!1);n.push(r),r.defn=e})}getColumnKey(e){return this._keys[e]}setColumnKey(e,t){this._keys[e]=t}deleteColumnKey(e){delete this._keys[e]}eachColumnKey(e){Object.keys(this._keys).forEach(t=>e(this._keys[t],t))}getColumn(e){let t;if(typeof e==`string`){let n=this._keys[e];if(n)return n;t=m.l2n(e)}else t=e;if(this._columns||=[],t>this._columns.length){let e=this._columns.length+1;for(;e<=t;)this._columns.push(new ae(this,e++))}return this._columns[t-1]}spliceColumns(e,t,...n){let r=this._rows.length;if(n.length>0)for(let i=0;i<r;i++){let r=[e,t];n.forEach(e=>{r.push(e[i]||null)}),this.getRow(i+1).splice(...r)}else this._rows.forEach(n=>{n&&n.splice(e,t)});let i=n.length-t,a=e+t,o=this._columns?this._columns.length:0;if(i<0)for(let t=e+n.length;t<=o;t++)this.getColumn(t).defn=this.getColumn(t-i).defn;else if(i>0)for(let e=o;e>=a;e--)this.getColumn(e+i).defn=this.getColumn(e).defn;for(let t=e;t<e+n.length;t++)this.getColumn(t).defn=null;this.workbook.definedNames.spliceColumns(this.name,e,t,n.length)}get lastColumn(){return this.getColumn(this.columnCount)}get columnCount(){let e=0;return this.eachRow(t=>{e=Math.max(e,t.cellCount)}),e}get actualColumnCount(){let e=[],t=0;return this.eachRow(n=>{n.eachCell(({col:n})=>{e[n]||(e[n]=!0,t++)})}),t}_commitRow(e){}get _lastRowNumber(){let e=this._rows,t=e.length;for(;t>0&&e[t-1]===void 0;)t--;return t}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1]}findRow(e){return this._rows[e-1]}findRows(e,t){return this._rows.slice(e-1,e-1+t)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let e=0;return this.eachRow(()=>{e++}),e}getRow(e){let t=this._rows[e-1];return t||=this._rows[e-1]=new U(this,e),t}getRows(e,t){if(t<1)return;let n=[];for(let r=e;r<e+t;r++)n.push(this.getRow(r));return n}addRow(e,t=`n`){let n=this._nextRow,r=this.getRow(n);return r.values=e,this._setStyleOption(n,t[0]===`i`?t:`n`),r}addRows(e,t=`n`){let n=[];return e.forEach(e=>{n.push(this.addRow(e,t))}),n}insertRow(e,t,n=`n`){return this.spliceRows(e,0,t),this._setStyleOption(e,n),this.getRow(e)}insertRows(e,t,n=`n`){if(this.spliceRows(e,0,...t),n!==`n`)for(let r=0;r<t.length;r++)n[0]===`o`&&this.findRow(t.length+e+r)!==void 0?this._copyStyle(t.length+e+r,e+r,n[1]===`+`):n[0]===`i`&&this.findRow(e-1)!==void 0&&this._copyStyle(e-1,e+r,n[1]===`+`);return this.getRows(e,t.length)}_setStyleOption(e,t=`n`){t[0]===`o`&&this.findRow(e+1)!==void 0?this._copyStyle(e+1,e,t[1]===`+`):t[0]===`i`&&this.findRow(e-1)!==void 0&&this._copyStyle(e-1,e,t[1]===`+`)}_copyStyle(e,t,n=!1){let r=this.getRow(e),i=this.getRow(t);i.style=ha(r.style),r.eachCell({includeEmpty:n},(e,t)=>{i.getCell(t).style=ha(e.style)}),i.height=r.height}duplicateRow(e,t,n=!1){let r=this._rows[e-1],i=Array.from({length:t}).fill(r.values);this.spliceRows(e+1,n?0:t,...i);for(let n=0;n<t;n++){let t=this._rows[e+n];t.style=r.style,t.height=r.height,r.eachCell({includeEmpty:!0},(e,n)=>{t.getCell(n).style=e.style})}}spliceRows(e,t,...n){let r=e+t,i=n.length,a=i-t,o=this._rows.length,s,c;if(a<0)for(e===o&&(this._rows[o-1]=void 0),s=r;s<=o;s++)if(c=this._rows[s-1],c){let e=this.getRow(s+a);e.values=c.values,e.style=c.style,e.height=c.height,c.eachCell({includeEmpty:!0},(t,n)=>{e.getCell(n).style=t.style}),this._rows[s-1]=void 0}else this._rows[s+a-1]=void 0;else if(a>0)for(s=o;s>=r;s--)if(c=this._rows[s-1],c){let e=this.getRow(s+a);e.values=c.values,e.style=c.style,e.height=c.height,c.eachCell({includeEmpty:!0},(t,n)=>{if(e.getCell(n).style=t.style,t._value.constructor.name===`MergeValue`){let e=this.getRow(t._row._number+i).getCell(n),r=t._value._master,a=this.getRow(r._row._number+i).getCell(r._column._number);e.merge(a)}})}else this._rows[s+a-1]=void 0;for(s=0;s<i;s++){let t=this.getRow(e+s);t.style={},t.values=n[s]}this.workbook.definedNames.spliceRows(this.name,e,t,i)}eachRow(e,t){if(t||(t=e,e=void 0),e&&e.includeEmpty){let e=this._rows.length;for(let n=1;n<=e;n++)t(this.getRow(n),n)}else this._rows.forEach(e=>{e&&e.hasValues&&t(e,e.number)})}getSheetValues(){let e=[];return this._rows.forEach(t=>{t&&(e[t.number]=t.values)}),e}findCell(e,t){let n=m.getAddress(e,t),r=this._rows[n.row-1];return r?r.findCell(n.col):void 0}getCell(e,t){let n=m.getAddress(e,t);return this.getRow(n.row).getCellEx(n)}mergeCells(...e){let t=new h(e);this._mergeCellsInternal(t)}mergeCellsWithoutStyle(...e){let t=new h(e);this._mergeCellsInternal(t,!0)}_mergeCellsInternal(e,t){Object.values(this._merges).forEach(t=>{if(t.intersects(e))throw Error(`Cannot merge already merged cells`)});let n=this.getCell(e.top,e.left);for(let r=e.top;r<=e.bottom;r++)for(let i=e.left;i<=e.right;i++)(r>e.top||i>e.left)&&this.getCell(r,i).merge(n,t);this._merges[n.address]=e}_unMergeMaster(e){let t=this._merges[e.address];if(t){for(let e=t.top;e<=t.bottom;e++)for(let n=t.left;n<=t.right;n++)this.getCell(e,n).unmerge();delete this._merges[e.address]}}get hasMerges(){return Object.values(this._merges).some(Boolean)}unMergeCells(...e){let t=new h(e);for(let e=t.top;e<=t.bottom;e++)for(let n=t.left;n<=t.right;n++){let t=this.findCell(e,n);t&&(t.type===S.ValueType.Merge?this._unMergeMaster(t.master):this._merges[t.address]&&this._unMergeMaster(t))}}fillFormula(e,t,n,r=`shared`){let{top:i,left:a,bottom:o,right:s}=m.decode(e),c=s-a+1,l=m.encodeAddress(i,a),u=r===`shared`,d;d=typeof n==`function`?n:Array.isArray(n)?Array.isArray(n[0])?(e,t)=>n[e-i][t-a]:(e,t)=>n[(e-i)*c+(t-a)]:()=>void 0;let f=!0;for(let n=i;n<=o;n++)for(let i=a;i<=s;i++)f?(this.getCell(n,i).value={shareType:r,formula:t,ref:e,result:d(n,i)},f=!1):this.getCell(n,i).value=u?{sharedFormula:l,result:d(n,i)}:d(n,i)}addImage(e,t){let n={type:`image`,imageId:String(e),range:t};this._media.push(new G(this,n))}getImages(){return this._media.filter(e=>e.type===`image`)}addBackgroundImage(e){let t={type:`background`,imageId:String(e)};this._media.push(new G(this,t))}getBackgroundImageId(){let e=this._media.find(e=>e.type===`background`);return e&&e.imageId}protect(e,t){return new Promise(n=>{this.sheetProtection={sheet:!0},t&&`spinCount`in t&&(t.spinCount=Number.isFinite(t.spinCount)?Math.round(Math.max(0,t.spinCount)):1e5),e&&(this.sheetProtection.algorithmName=`SHA-512`,this.sheetProtection.saltValue=Gi.randomBytes(16).toString(`base64`),this.sheetProtection.spinCount=t&&`spinCount`in t?t.spinCount:1e5,this.sheetProtection.hashValue=Gi.convertPasswordToHash(e,`SHA512`,this.sheetProtection.saltValue,this.sheetProtection.spinCount)),t&&(this.sheetProtection=Object.assign(this.sheetProtection,t),!e&&`spinCount`in t&&delete this.sheetProtection.spinCount),n()})}unprotect(){this.sheetProtection=null}addTable(e){let t=new K(this,e);return this.tables[e.name]=t,t}getTable(e){return this.tables[e]}removeTable(e){delete this.tables[e]}getTables(){return Object.values(this.tables)}addPivotTable(e){console.warn(`Warning: Pivot Table support is experimental.
|
|
25
|
+
https://github.com/browserify/crypto-browserify`)},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}})),Ui=d(q(),1),Wi=d(Hi(),1);let Gi={hash(e,...t){let n=Wi.createHash(e);return n.update(Ui.Buffer.concat(t)),n.digest()},convertPasswordToHash(e,t,n,r){if(t=t.toLowerCase(),Wi.getHashes().indexOf(t)<0)throw Error(`Hash algorithm '${t}' not supported!`);let i=Ui.Buffer.from(e,`utf16le`),a=this.hash(t,Ui.Buffer.from(n,`base64`),i);for(let e=0;e<r;e++){let n=Ui.Buffer.alloc(4);n.writeUInt32LE(e,0),a=this.hash(t,a,n)}return a.toString(`base64`)},randomBytes(e){return Wi.randomBytes(e)}};var Ki=l({default:()=>qi}),qi,Ji=s((()=>{qi=null}));Ji();function Yi(){}let Xi=function(e,t,n,r){e.super_=t,r||(r=n,n=null),n&&Object.keys(n).forEach(t=>{Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))});let i={constructor:{value:e,enumerable:!1,writable:!1,configurable:!0}};r&&Object.keys(r).forEach(e=>{i[e]=Object.getOwnPropertyDescriptor(r,e)}),e.prototype=Object.create(t.prototype,i)};function Zi(e,t){return 25569+e.getTime()/(24*3600*1e3)-(t?1462:0)}function Qi(e,t){let n=Math.round((e-25569+(t?1462:0))*24*3600*1e3);return new Date(n)}let $i=/[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/;function ea(e){let t=$i.exec(e);if(!t)return e;let n=``,r=``,i=0,a=t.index;for(;a<e.length;a++){let t=e.charCodeAt(a);switch(t){case 34:r=`"`;break;case 38:r=`&`;break;case 39:r=`'`;break;case 60:r=`<`;break;case 62:r=`>`;break;case 127:r=``;break;default:if(t<=31&&(t<=8||t>=11&&t!==13)){r=``;break}continue}i!==a&&(n+=e.substring(i,a)),i=a+1,r&&(n+=r)}return i===a?n:n+e.substring(i,a)}function ta(e){return e.replace(/&([a-z]*);/g,e=>{switch(e){case`<`:return`<`;case`>`:return`>`;case`&`:return`&`;case`'`:return`'`;case`"`:return`"`;default:return e}})}function na(e){let t=parseInt(e,10);return Number.isNaN(t)?0:t}function ra(e){return e?(e=e.replace(/\[[^\]]*]/g,``),e=e.replace(/"[^"]*"/g,``),e.match(/[ymdhMsb]+/)!==null):!1}function ia(e){return new Promise(t=>{qi.access(e,qi.constants.F_OK,e=>{t(!e)})})}function aa(e){return e===!0||e===`true`||e===1||e===`1`}function*oa(e,t,n=1){let r=n>0?(e,t)=>e<t:(e,t)=>e>t;for(let i=e;r(i,t);i+=n)yield i}function sa(e){let t=Array.from(e);return t.every(e=>Number.isFinite(e))?t.sort((e,t)=>e-t):t.sort()}function ca(e,t=null){return e.reduce((e,n)=>(e[n]=t,e),{})}function la(e,t){ua(e,t);let{sourceSheet:n}=t,{rows:r,columns:i,values:a}=t,o=da(n,[...r,...i]),s=o.reduce((e,t,n)=>(e[t.name]=n,e),{});return{sourceSheet:n,rows:r.map(e=>s[e]),columns:i.map(e=>s[e]),values:a.map(e=>s[e]),metric:`sum`,cacheFields:o,cacheId:`10`}}function ua(e,t){if(e.workbook.pivotTables.length===1)throw Error(`A pivot table was already added. At this time, ExcelTS supports at most one pivot table per file.`);if(t.metric&&t.metric!==`sum`)throw Error(`Only the "sum" metric is supported at this time.`);let n=ca(t.sourceSheet.getRow(1).values.slice(1),!0);for(let e of[...t.rows,...t.columns,...t.values])if(!n[e])throw Error(`The header name "${e}" was not found in ${t.sourceSheet.name}.`);if(!t.rows.length)throw Error(`No pivot table rows specified.`);if(!t.columns.length)throw Error(`No pivot table columns specified.`);if(t.values.length!==1)throw Error(`Exactly 1 value needs to be specified at this time.`)}function da(e,t){let n=e.getRow(1).values,r=ca(t,!0),i=t=>{let n=e.getColumn(t).values.splice(2);return sa(new Set(n))},a=[];for(let e of oa(1,n.length)){let t=n[e],o=r[t]?i(e):null;a.push({name:t,sharedItems:o})}return a}let fa=(e,t)=>({...e,...t.reduce((t,n)=>(e[n]&&(t[n]={...e[n]}),t),{})}),pa=(e,t,n,r=[])=>{e[n]&&(t[n]=fa(e[n],r))},ma=e=>Object.keys(e).length===0,ha=e=>{if(!e)return e;if(ma(e))return{};let t={...e};return pa(e,t,`font`,[`color`]),pa(e,t,`alignment`),pa(e,t,`protection`),e.border&&(pa(e,t,`border`),pa(e.border,t.border,`top`,[`color`]),pa(e.border,t.border,`left`,[`color`]),pa(e.border,t.border,`bottom`,[`color`]),pa(e.border,t.border,`right`,[`color`]),pa(e.border,t.border,`diagonal`,[`color`])),e.fill&&(pa(e,t,`fill`,[`fgColor`,`bgColor`,`center`]),e.fill.stops&&(t.fill.stops=e.fill.stops.map(e=>fa(e,[`color`])))),t};var ga=class{constructor(e){e||={},this._workbook=e.workbook,this.id=e.id||0,this.orderNo=e.orderNo||0,this.name=e.name||`sheet${this.id}`,this.state=e.state||`visible`,this._rows=[],this._columns=null,this._keys={},this._merges={},this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},e.properties),this.pageSetup=Object.assign({},{margins:{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},orientation:`portrait`,horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!!(e.pageSetup&&(e.pageSetup.fitToWidth||e.pageSetup.fitToHeight)&&!e.pageSetup.scale),pageOrder:`downThenOver`,blackAndWhite:!1,draft:!1,cellComments:`None`,errors:`displayed`,scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,firstPageNumber:void 0,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},e.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},e.headerFooter),this.dataValidations=new se,this.views=e.views||[],this.autoFilter=e.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.pivotTables=[],this.conditionalFormattings=[]}get name(){return this._name}set name(e){if(e===void 0&&(e=`sheet${this.id}`),this._name!==e){if(typeof e!=`string`)throw Error(`The name has to be a string.`);if(e===``)throw Error(`The name can't be empty.`);if(e===`History`)throw Error(`The name "History" is protected. Please use a different name.`);if(/[*?:/\\[\]]/.test(e))throw Error(`Worksheet name ${e} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(e))throw Error(`The first or last character of worksheet name cannot be a single quotation mark: ${e}`);if(e&&e.length>31&&(e=e.substring(0,31)),this._workbook._worksheets.find(t=>t&&t.name.toLowerCase()===e.toLowerCase()))throw Error(`Worksheet name already exists: ${e}`);this._name=e}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){let e=new h;return this._rows.forEach(t=>{if(t){let n=t.dimensions;n&&e.expand(t.number,n.min,t.number,n.max)}}),e}get columns(){return this._columns}set columns(e){this._headerRowCount=e.reduce((e,t)=>{let n=t.header&&1||t.headers&&t.headers.length||0;return Math.max(e,n)},0);let t=1,n=this._columns=[];e.forEach(e=>{let r=new ae(this,t++,!1);n.push(r),r.defn=e})}getColumnKey(e){return this._keys[e]}setColumnKey(e,t){this._keys[e]=t}deleteColumnKey(e){delete this._keys[e]}eachColumnKey(e){Object.keys(this._keys).forEach(t=>e(this._keys[t],t))}getColumn(e){let t;if(typeof e==`string`){let n=this._keys[e];if(n)return n;t=m.l2n(e)}else t=e;if(this._columns||=[],t>this._columns.length){let e=this._columns.length+1;for(;e<=t;)this._columns.push(new ae(this,e++))}return this._columns[t-1]}spliceColumns(e,t,...n){let r=this._rows.length;if(n.length>0)for(let i=0;i<r;i++){let r=[e,t];n.forEach(e=>{r.push(e[i]||null)}),this.getRow(i+1).splice(...r)}else this._rows.forEach(n=>{n&&n.splice(e,t)});let i=n.length-t,a=e+t,o=this._columns?this._columns.length:0;if(i<0)for(let t=e+n.length;t<=o;t++)this.getColumn(t).defn=this.getColumn(t-i).defn;else if(i>0)for(let e=o;e>=a;e--)this.getColumn(e+i).defn=this.getColumn(e).defn;for(let t=e;t<e+n.length;t++)this.getColumn(t).defn=null;this.workbook.definedNames.spliceColumns(this.name,e,t,n.length)}get lastColumn(){return this.getColumn(this.columnCount)}get columnCount(){let e=0;return this.eachRow(t=>{e=Math.max(e,t.cellCount)}),e}get actualColumnCount(){let e=[],t=0;return this.eachRow(n=>{n.eachCell(({col:n})=>{e[n]||(e[n]=!0,t++)})}),t}_commitRow(e){}get _lastRowNumber(){let e=this._rows,t=e.length;for(;t>0&&e[t-1]===void 0;)t--;return t}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1]}findRow(e){return this._rows[e-1]}findRows(e,t){return this._rows.slice(e-1,e-1+t)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let e=0;return this.eachRow(()=>{e++}),e}getRow(e){let t=this._rows[e-1];return t||=this._rows[e-1]=new U(this,e),t}getRows(e,t){if(t<1)return;let n=[];for(let r=e;r<e+t;r++)n.push(this.getRow(r));return n}addRow(e,t=`n`){let n=this._nextRow,r=this.getRow(n);return r.values=e,this._setStyleOption(n,t[0]===`i`?t:`n`),r}addRows(e,t=`n`){let n=[];return e.forEach(e=>{n.push(this.addRow(e,t))}),n}insertRow(e,t,n=`n`){return this.spliceRows(e,0,t),this._setStyleOption(e,n),this.getRow(e)}insertRows(e,t,n=`n`){if(this.spliceRows(e,0,...t),n!==`n`)for(let r=0;r<t.length;r++)n[0]===`o`&&this.findRow(t.length+e+r)!==void 0?this._copyStyle(t.length+e+r,e+r,n[1]===`+`):n[0]===`i`&&this.findRow(e-1)!==void 0&&this._copyStyle(e-1,e+r,n[1]===`+`);return this.getRows(e,t.length)}_setStyleOption(e,t=`n`){t[0]===`o`&&this.findRow(e+1)!==void 0?this._copyStyle(e+1,e,t[1]===`+`):t[0]===`i`&&this.findRow(e-1)!==void 0&&this._copyStyle(e-1,e,t[1]===`+`)}_copyStyle(e,t,n=!1){let r=this.getRow(e),i=this.getRow(t);i.style=ha(r.style),r.eachCell({includeEmpty:n},(e,t)=>{i.getCell(t).style=ha(e.style)}),i.height=r.height}duplicateRow(e,t,n=!1){let r=this._rows[e-1],i=Array.from({length:t}).fill(r.values);this.spliceRows(e+1,n?0:t,...i);for(let n=0;n<t;n++){let t=this._rows[e+n];t.style=r.style,t.height=r.height,r.eachCell({includeEmpty:!0},(e,n)=>{t.getCell(n).style=e.style})}}spliceRows(e,t,...n){let r=e+t,i=n.length,a=i-t,o=this._rows.length,s,c;if(a<0)for(e===o&&(this._rows[o-1]=void 0),s=r;s<=o;s++)if(c=this._rows[s-1],c){let e=this.getRow(s+a);e.values=c.values,e.style=c.style,e.height=c.height,c.eachCell({includeEmpty:!0},(t,n)=>{e.getCell(n).style=t.style}),this._rows[s-1]=void 0}else this._rows[s+a-1]=void 0;else if(a>0)for(s=o;s>=r;s--)if(c=this._rows[s-1],c){let e=this.getRow(s+a);e.values=c.values,e.style=c.style,e.height=c.height,c.eachCell({includeEmpty:!0},(t,n)=>{if(e.getCell(n).style=t.style,t._value.constructor.name===`MergeValue`){let e=this.getRow(t._row._number+i).getCell(n),r=t._value._master,a=this.getRow(r._row._number+i).getCell(r._column._number);e.merge(a)}})}else this._rows[s+a-1]=void 0;for(s=0;s<i;s++){let t=this.getRow(e+s);t.style={},t.values=n[s]}this.workbook.definedNames.spliceRows(this.name,e,t,i)}eachRow(e,t){if(t||(t=e,e=void 0),e&&e.includeEmpty){let e=this._rows.length;for(let n=1;n<=e;n++)t(this.getRow(n),n)}else this._rows.forEach(e=>{e&&e.hasValues&&t(e,e.number)})}getSheetValues(){let e=[];return this._rows.forEach(t=>{t&&(e[t.number]=t.values)}),e}findCell(e,t){let n=m.getAddress(e,t),r=this._rows[n.row-1];return r?r.findCell(n.col):void 0}getCell(e,t){let n=m.getAddress(e,t);return this.getRow(n.row).getCellEx(n)}mergeCells(...e){let t=new h(e);this._mergeCellsInternal(t)}mergeCellsWithoutStyle(...e){let t=new h(e);this._mergeCellsInternal(t,!0)}_mergeCellsInternal(e,t){Object.values(this._merges).forEach(t=>{if(t.intersects(e))throw Error(`Cannot merge already merged cells`)});let n=this.getCell(e.top,e.left);for(let r=e.top;r<=e.bottom;r++)for(let i=e.left;i<=e.right;i++)(r>e.top||i>e.left)&&this.getCell(r,i).merge(n,t);this._merges[n.address]=e}_unMergeMaster(e){let t=this._merges[e.address];if(t){for(let e=t.top;e<=t.bottom;e++)for(let n=t.left;n<=t.right;n++)this.getCell(e,n).unmerge();delete this._merges[e.address]}}get hasMerges(){return Object.values(this._merges).some(Boolean)}unMergeCells(...e){let t=new h(e);for(let e=t.top;e<=t.bottom;e++)for(let n=t.left;n<=t.right;n++){let t=this.findCell(e,n);t&&(t.type===S.ValueType.Merge?this._unMergeMaster(t.master):this._merges[t.address]&&this._unMergeMaster(t))}}fillFormula(e,t,n,r=`shared`){let{top:i,left:a,bottom:o,right:s}=m.decode(e),c=s-a+1,l=m.encodeAddress(i,a),u=r===`shared`,d;d=typeof n==`function`?n:Array.isArray(n)?Array.isArray(n[0])?(e,t)=>n[e-i][t-a]:(e,t)=>n[(e-i)*c+(t-a)]:()=>void 0;let f=!0;for(let n=i;n<=o;n++)for(let i=a;i<=s;i++)f?(this.getCell(n,i).value={shareType:r,formula:t,ref:e,result:d(n,i)},f=!1):this.getCell(n,i).value=u?{sharedFormula:l,result:d(n,i)}:d(n,i)}addImage(e,t){let n={type:`image`,imageId:String(e),range:t};this._media.push(new G(this,n))}getImages(){return this._media.filter(e=>e.type===`image`)}addBackgroundImage(e){let t={type:`background`,imageId:String(e)};this._media.push(new G(this,t))}getBackgroundImageId(){let e=this._media.find(e=>e.type===`background`);return e&&e.imageId}protect(e,t){return new Promise(n=>{this.sheetProtection={sheet:!0},t&&`spinCount`in t&&(t.spinCount=Number.isFinite(t.spinCount)?Math.round(Math.max(0,t.spinCount)):1e5),e&&(this.sheetProtection.algorithmName=`SHA-512`,this.sheetProtection.saltValue=Gi.randomBytes(16).toString(`base64`),this.sheetProtection.spinCount=t&&`spinCount`in t?t.spinCount:1e5,this.sheetProtection.hashValue=Gi.convertPasswordToHash(e,`SHA512`,this.sheetProtection.saltValue,this.sheetProtection.spinCount)),t&&(this.sheetProtection=Object.assign(this.sheetProtection,t),!e&&`spinCount`in t&&delete this.sheetProtection.spinCount),n()})}unprotect(){this.sheetProtection=null}addTable(e){let t=new K(this,e);return this.tables[e.name]=t,t}getTable(e){return this.tables[e]}removeTable(e){delete this.tables[e]}getTables(){return Object.values(this.tables)}addPivotTable(e){console.warn(`Warning: Pivot Table support is experimental.
|
|
26
26
|
Please leave feedback at https://github.com/excelts/excelts/discussions/2575`);let t=la(this,e);return this.pivotTables.push(t),this.workbook.pivotTables.push(t),t}addConditionalFormatting(e){this.conditionalFormattings.push(e)}removeConditionalFormatting(e){typeof e==`number`?this.conditionalFormattings.splice(e,1):e instanceof Function?this.conditionalFormattings=this.conditionalFormattings.filter(e):this.conditionalFormattings=[]}get model(){let e={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map(e=>e.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map(e=>e.model),pivotTables:this.pivotTables,conditionalFormattings:this.conditionalFormattings};e.cols=ae.toModel(this.columns);let t=e.rows=[],n=e.dimensions=new h;return this._rows.forEach(e=>{let r=e&&e.model;r&&(n.expand(r.number,r.min,r.number,r.max),t.push(r))}),e.merges=[],Object.values(this._merges).forEach(t=>{e.merges.push(t.range)}),e}_parseRows(e){this._rows=[],e.rows&&e.rows.forEach(e=>{let t=new U(this,e.number);this._rows[t.number-1]=t,t.model=e})}_parseMergeCells(e){e.mergeCells&&e.mergeCells.forEach(e=>{this.mergeCellsWithoutStyle(e)})}set model(e){this.name=e.name,this._columns=ae.fromModel(this,e.cols),this._parseRows(e),this._parseMergeCells(e),this.dataValidations=new se(e.dataValidations),this.properties=e.properties,this.pageSetup=e.pageSetup,this.headerFooter=e.headerFooter,this.views=e.views,this.autoFilter=e.autoFilter,this._media=e.media.map(e=>new G(this,e)),this.sheetProtection=e.sheetProtection,this.tables=e.tables.reduce((e,t)=>{let n=new K(this,t);return n.model=t,e[t.name]=n,e},{}),this.pivotTables=e.pivotTables,this.conditionalFormattings=e.conditionalFormattings}},_a=class{constructor(e){this.template=e,this.sheets={}}addCell(e){this.addCellEx(m.decodeEx(e))}getCell(e){return this.findCellEx(m.decodeEx(e),!0)}findCell(e){return this.findCellEx(m.decodeEx(e),!1)}findCellAt(e,t,n){let r=this.sheets[e],i=r&&r[t];return i&&i[n]}addCellEx(e){if(e.top!==void 0)for(let t=e.top;t<=e.bottom;t++)for(let n=e.left;n<=e.right;n++)this.getCellAt(e.sheetName,t,n);else this.findCellEx(e,!0)}getCellEx(e){return this.findCellEx(e,!0)}findCellEx(e,t){let n=this.findSheet(e,t),r=this.findSheetRow(n,e,t);return this.findRowCell(r,e,t)}getCellAt(e,t,n){let r=this.sheets[e]||(this.sheets[e]=[]),i=r[t]||(r[t]=[]);return i[n]||(i[n]={sheetName:e,address:m.n2l(n)+t,row:t,col:n})}removeCellEx(e){let t=this.findSheet(e,!1);if(!t)return;let n=this.findSheetRow(t,e,!1);n&&delete n[e.col]}forEachInSheet(e,t){let n=this.sheets[e];n&&n.forEach((e,n)=>{e&&e.forEach((e,r)=>{e&&t(e,n,r)})})}forEach(e){Object.keys(this.sheets).forEach(t=>{this.forEachInSheet(t,e)})}map(e){let t=[];return this.forEach(n=>{t.push(e(n))}),t}findSheet(e,t){let n=e.sheetName;if(this.sheets[n])return this.sheets[n];if(t)return this.sheets[n]=[]}findSheetRow(e,t,n){let{row:r}=t;if(e&&e[r])return e[r];if(n)return e[r]=[]}findRowCell(e,t,n){let{col:r}=t;if(e&&e[r])return e[r];if(n)return e[r]=this.template?Object.assign(t,JSON.parse(JSON.stringify(this.template))):t}spliceRows(e,t,n,r){let i=this.sheets[e];if(i){let e=[];for(let t=0;t<r;t++)e.push([]);i.splice(t,n,...e)}}spliceColumns(e,t,n,r){let i=this.sheets[e];if(i){let e=[];for(let t=0;t<r;t++)e.push(null);Object.values(i).forEach(r=>{r.splice(t,n,...e)})}}};let va=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;var ya=class{constructor(){this.matrixMap={}}getMatrix(e){return this.matrixMap[e]||(this.matrixMap[e]=new _a)}add(e,t){let n=m.decodeEx(e);this.addEx(n,t)}addEx(e,t){let n=this.getMatrix(t);if(e.top)for(let t=e.left;t<=e.right;t++)for(let r=e.top;r<=e.bottom;r++){let i={sheetName:e.sheetName,address:m.n2l(t)+r,row:r,col:t};n.addCellEx(i)}else n.addCellEx(e)}remove(e,t){let n=m.decodeEx(e);this.removeEx(n,t)}removeEx(e,t){this.getMatrix(t).removeCellEx(e)}removeAllNames(e){Object.values(this.matrixMap).forEach(t=>{t.removeCellEx(e)})}forEach(e){Object.entries(this.matrixMap).forEach(([t,n])=>{n.forEach(n=>{e(t,n)})})}getNames(e){return this.getNamesEx(m.decodeEx(e))}getNamesEx(e){return Object.entries(this.matrixMap).map(([t,n])=>n.findCellEx(e,!1)&&t).filter(Boolean)}_explore(e,t){t.mark=!1;let{sheetName:n}=t,r=new h(t.row,t.col,t.row,t.col,n),i,a;function o(i,a){let o=e.findCellAt(n,i,t.col);return!o||!o.mark?!1:(r[a]=i,o.mark=!1,!0)}for(a=t.row-1;o(a,`top`);a--);for(a=t.row+1;o(a,`bottom`);a++);function s(t,i){let o=[];for(a=r.top;a<=r.bottom;a++){let r=e.findCellAt(n,a,t);if(r&&r.mark)o.push(r);else return!1}r[i]=t;for(let e=0;e<o.length;e++)o[e].mark=!1;return!0}for(i=t.col-1;s(i,`left`);i--);for(i=t.col+1;s(i,`right`);i++);return r}getRanges(e,t){return t||=this.matrixMap[e],t?(t.forEach(e=>{e.mark=!0}),{name:e,ranges:t.map(e=>e.mark&&this._explore(t,e)).filter(Boolean).map(e=>e.$shortRange)}):{name:e,ranges:[]}}normaliseMatrix(e,t){e.forEachInSheet(t,(e,t,n)=>{e&&(e.row!==t||e.col!==n)&&(e.row=t,e.col=n,e.address=m.n2l(n)+t)})}spliceRows(e,t,n,r){Object.values(this.matrixMap).forEach(i=>{i.spliceRows(e,t,n,r),this.normaliseMatrix(i,e)})}spliceColumns(e,t,n,r){Object.values(this.matrixMap).forEach(i=>{i.spliceColumns(e,t,n,r),this.normaliseMatrix(i,e)})}get model(){return Object.entries(this.matrixMap).map(([e,t])=>this.getRanges(e,t)).filter(e=>e.ranges.length)}set model(e){let t=this.matrixMap={};e.forEach(e=>{let n=t[e.name]=new _a;e.ranges.forEach(e=>{va.test(e.split(`!`).pop()||``)&&n.addCell(e)})})}},ba=Uint8Array,xa=Uint16Array,Sa=Int32Array,Ca=new ba([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),wa=new ba([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ta=new ba([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ea=function(e,t){for(var n=new xa(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new Sa(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},Da=Ea(Ca,2),Oa=Da.b,ka=Da.r;Oa[28]=258,ka[258]=28;var Aa=Ea(wa,0),ja=Aa.b;Aa.r;for(var Ma=new xa(32768),Na=0;Na<32768;++Na){var Pa=(Na&43690)>>1|(Na&21845)<<1;Pa=(Pa&52428)>>2|(Pa&13107)<<2,Pa=(Pa&61680)>>4|(Pa&3855)<<4,Ma[Na]=((Pa&65280)>>8|(Pa&255)<<8)>>1}for(var Fa=(function(e,t,n){for(var r=e.length,i=0,a=new xa(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new xa(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new xa(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=o[e[i]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)s[Ma[d]>>c]=l}else for(s=new xa(r),i=0;i<r;++i)e[i]&&(s[i]=Ma[o[e[i]-1]++]>>15-e[i]);return s}),Ia=new ba(288),Na=0;Na<144;++Na)Ia[Na]=8;for(var Na=144;Na<256;++Na)Ia[Na]=9;for(var Na=256;Na<280;++Na)Ia[Na]=7;for(var Na=280;Na<288;++Na)Ia[Na]=8;for(var La=new ba(32),Na=0;Na<32;++Na)La[Na]=5;var Ra=Fa(Ia,9,1),za=Fa(La,5,1),Ba=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},Va=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},Ha=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},Ua=function(e){return(e+7)/8|0},Wa=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new ba(e.subarray(t,n))},Ga=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],Ka=function(e,t,n){var r=Error(t||Ga[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,Ka),!n)throw r;return r},qa=function(e,t,n,r){var i=e.length,a=r?r.length:0;if(!i||t.f&&!t.l)return n||new ba(0);var o=!n,s=o||t.i!=2,c=t.i;o&&(n=new ba(i*3));var l=function(e){var t=n.length;if(e>t){var r=new ba(Math.max(t*2,e));r.set(n),n=r}},u=t.f||0,d=t.p||0,f=t.b||0,p=t.l,m=t.d,h=t.m,g=t.n,_=i*8;do{if(!p){u=Va(e,d,1);var v=Va(e,d+1,3);if(d+=3,v)if(v==1)p=Ra,m=za,h=9,g=5;else if(v==2){var y=Va(e,d,31)+257,b=Va(e,d+10,15)+4,x=y+Va(e,d+5,31)+1;d+=14;for(var S=new ba(x),C=new ba(19),w=0;w<b;++w)C[Ta[w]]=Va(e,d+w*3,7);d+=b*3;for(var T=Ba(C),E=(1<<T)-1,D=Fa(C,T,1),w=0;w<x;){var O=D[Va(e,d,E)];d+=O&15;var k=O>>4;if(k<16)S[w++]=k;else{var A=0,ee=0;for(k==16?(ee=3+Va(e,d,3),d+=2,A=S[w-1]):k==17?(ee=3+Va(e,d,7),d+=3):k==18&&(ee=11+Va(e,d,127),d+=7);ee--;)S[w++]=A}}var j=S.subarray(0,y),M=S.subarray(y);h=Ba(j),g=Ba(M),p=Fa(j,h,1),m=Fa(M,g,1)}else Ka(1);else{var k=Ua(d)+4,N=e[k-4]|e[k-3]<<8,P=k+N;if(P>i){c&&Ka(0);break}s&&l(f+N),n.set(e.subarray(k,P),f),t.b=f+=N,t.p=d=P*8,t.f=u;continue}if(d>_){c&&Ka(0);break}}s&&l(f+131072);for(var F=(1<<h)-1,te=(1<<g)-1,I=d;;I=d){var A=p[Ha(e,d)&F],L=A>>4;if(d+=A&15,d>_){c&&Ka(0);break}if(A||Ka(2),L<256)n[f++]=L;else if(L==256){I=d,p=null;break}else{var ne=L-254;if(L>264){var w=L-257,R=Ca[w];ne=Va(e,d,(1<<R)-1)+Oa[w],d+=R}var z=m[Ha(e,d)&te],re=z>>4;z||Ka(3),d+=z&15;var M=ja[re];if(re>3){var R=wa[re];M+=Ha(e,d)&(1<<R)-1,d+=R}if(d>_){c&&Ka(0);break}s&&l(f+131072);var B=f+ne;if(f<M){var V=a-M,ie=Math.min(M,B);for(V+f<0&&Ka(3);f<ie;++f)n[f]=r[V+f]}for(;f<B;++f)n[f]=n[f-M]}}t.l=p,t.p=I,t.b=f,t.f=u,p&&(u=1,t.m=h,t.d=m,t.n=g)}while(!u);return f!=n.length&&o?Wa(n,0,f):n.subarray(0,f)},Ja=new ba(0),Ya=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),Xa=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Ya[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},Za=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},Qa=function(e,t){return e[t]|e[t+1]<<8},$a=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},eo=function(e,t){return $a(e,t)+$a(e,t+4)*4294967296},to=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},no=function(){function e(e,t){typeof e==`function`&&(t=e,e={}),this.ondata=t;var n=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new ba(32768),this.p=new ba(0),n&&this.o.set(n)}return e.prototype.e=function(e){if(this.ondata||Ka(5),this.d&&Ka(4),!this.p.length)this.p=e;else if(e.length){var t=new ba(this.p.length+e.length);t.set(this.p),t.set(e,this.p.length),this.p=t}},e.prototype.c=function(e){this.s.i=+(this.d=e||!1);var t=this.s.b,n=qa(this.p,this.s,this.o);this.ondata(Wa(n,t,this.s.b),this.d),this.o=Wa(n,this.s.b-32768),this.s.b=this.o.length,this.p=Wa(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}(),ro=typeof TextEncoder<`u`&&new TextEncoder,io=typeof TextDecoder<`u`&&new TextDecoder;try{io.decode(Ja,{stream:!0})}catch{}var ao=function(e){for(var t=``,n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return{s:t,r:Wa(e,n-1)};i?i==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function oo(e,t){if(t){for(var n=new ba(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}if(ro)return ro.encode(e);for(var i=e.length,a=new ba(e.length+(e.length>>1)),o=0,s=function(e){a[o++]=e},r=0;r<i;++r){if(o+5>a.length){var c=new ba(o+8+(i-r<<1));c.set(a),a=c}var l=e.charCodeAt(r);l<128||t?s(l):l<2048?(s(192|l>>6),s(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|e.charCodeAt(++r)&1023,s(240|l>>18),s(128|l>>12&63),s(128|l>>6&63),s(128|l&63)):(s(224|l>>12),s(128|l>>6&63),s(128|l&63))}return Wa(a,0,o)}function so(e,t){if(t){for(var n=``,r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}else if(io)return io.decode(e);else{var i=ao(e),a=i.s,n=i.r;return n.length&&Ka(8),a}}var co=function(e,t){for(;Qa(e,t)!=1;t+=4+Qa(e,t+2));return[eo(e,t+12),eo(e,t+4),eo(e,t+20)]},lo=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;r>65535&&Ka(9),t+=r+4}return t},uo=function(e,t,n,r,i,a,o,s){var c=r.length,l=n.extra,u=s&&s.length,d=lo(l);to(e,t,o==null?67324752:33639248),t+=4,o!=null&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(a<0&&8),e[t++]=i&&8,e[t++]=n.compression&255,e[t++]=n.compression>>8;var f=new Date(n.mtime==null?Date.now():n.mtime),p=f.getFullYear()-1980;if((p<0||p>119)&&Ka(10),to(e,t,p<<25|f.getMonth()+1<<21|f.getDate()<<16|f.getHours()<<11|f.getMinutes()<<5|f.getSeconds()>>1),t+=4,a!=-1&&(to(e,t,n.crc),to(e,t+4,a<0?-a-2:a),to(e,t+8,n.size)),to(e,t+12,c),to(e,t+14,d),t+=16,o!=null&&(to(e,t,u),to(e,t+6,n.attrs),to(e,t+10,o),t+=14),e.set(r,t),t+=c,d)for(var m in l){var h=l[m],g=h.length;to(e,t,+m),to(e,t+2,g),e.set(h,t+4),t+=4+g}return u&&(e.set(s,t),t+=u),t},fo=function(e,t,n,r,i){to(e,t,101010256),to(e,t+8,n),to(e,t+10,n),to(e,t+12,r),to(e,t+16,i)},po=function(){function e(e){this.filename=e,this.c=Xa(),this.size=0,this.compression=0}return e.prototype.process=function(e,t){this.ondata(null,e,t)},e.prototype.push=function(e,t){this.ondata||Ka(5),this.c.p(e),this.size+=e.length,t&&(this.crc=this.c.d()),this.process(e,t||!1)},e}(),mo=function(){function e(e){this.ondata=e,this.u=[],this.d=1}return e.prototype.add=function(e){var t=this;if(this.ondata||Ka(5),this.d&2)this.ondata(Ka(4+(this.d&1)*8,0,1),null,!1);else{var n=oo(e.filename),r=n.length,i=e.comment,a=i&&oo(i),o=r!=e.filename.length||a&&i.length!=a.length,s=r+lo(e.extra)+30;r>65535&&this.ondata(Ka(11,0,1),null,!1);var c=new ba(s);uo(c,0,e,n,o,-1);var l=[c],u=function(){for(var e=0,n=l;e<n.length;e++){var r=n[e];t.ondata(null,r,!1)}l=[]},d=this.d;this.d=0;var f=this.u.length,p=Za(e,{f:n,u:o,o:a,t:function(){e.terminate&&e.terminate()},r:function(){if(u(),d){var e=t.u[f+1];e?e.r():t.d=1}d=1}}),m=0;e.ondata=function(n,r,i){if(n)t.ondata(n,r,i),t.terminate();else if(m+=r.length,l.push(r),i){var a=new ba(16);to(a,0,134695760),to(a,4,e.crc),to(a,8,m),to(a,12,e.size),l.push(a),p.c=m,p.b=s+m+16,p.crc=e.crc,p.size=e.size,d&&p.r(),d=1}else d&&u()},this.u.push(p)}},e.prototype.end=function(){var e=this;if(this.d&2){this.ondata(Ka(4+(this.d&1)*8,0,1),null,!0);return}this.d?this.e():this.u.push({r:function(){e.d&1&&(e.u.splice(-1,1),e.e())},t:function(){}}),this.d=3},e.prototype.e=function(){for(var e=0,t=0,n=0,r=0,i=this.u;r<i.length;r++){var a=i[r];n+=46+a.f.length+lo(a.extra)+(a.o?a.o.length:0)}for(var o=new ba(n+22),s=0,c=this.u;s<c.length;s++){var a=c[s];uo(o,e,a,a.f,a.u,-a.c-2,t,a.o),e+=46+a.f.length+lo(a.extra)+(a.o?a.o.length:0),t+=a.b}fo(o,e,this.u.length,n,t),this.ondata(null,o,!0),this.d=2},e.prototype.terminate=function(){for(var e=0,t=this.u;e<t.length;e++)t[e].t();this.d=2},e}(),ho=function(){function e(){}return e.prototype.push=function(e,t){this.ondata(null,e,t)},e.compression=0,e}(),go=function(){function e(){var e=this;this.i=new no(function(t,n){e.ondata(null,t,n)})}return e.prototype.push=function(e,t){try{this.i.push(e,t)}catch(e){this.ondata(e,null,t)}},e.compression=8,e}(),_o=function(){function e(e){this.onfile=e,this.k=[],this.o={0:ho},this.p=Ja}return e.prototype.push=function(e,t){var n=this;if(this.onfile||Ka(5),this.p||Ka(4),this.c>0){var r=Math.min(this.c,e.length),i=e.subarray(0,r);if(this.c-=r,this.d?this.d.push(i,!this.c):this.k[0].push(i),e=e.subarray(r),e.length)return this.push(e,t)}else{var a=0,o=0,s=void 0,c=void 0;this.p.length?e.length?(c=new ba(this.p.length+e.length),c.set(this.p),c.set(e,this.p.length)):c=this.p:c=e;for(var l=c.length,u=this.c,d=u&&this.d,f=function(){var e,t=$a(c,o);if(t==67324752){a=1,s=o,p.d=null,p.c=0;var r=Qa(c,o+6),i=Qa(c,o+8),d=r&2048,f=r&8,m=Qa(c,o+26),h=Qa(c,o+28);if(l>o+30+m+h){var g=[];p.k.unshift(g),a=2;var _=$a(c,o+18),v=$a(c,o+22),y=so(c.subarray(o+30,o+=30+m),!d);_==4294967295?(e=f?[-2]:co(c,o),_=e[0],v=e[1]):f&&(_=-1),o+=h,p.c=_;var b,x={name:y,compression:i,start:function(){if(x.ondata||Ka(5),!_)x.ondata(null,Ja,!0);else{var e=n.o[i];e||x.ondata(Ka(14,`unknown compression type `+i,1),null,!1),b=_<0?new e(y):new e(y,_,v),b.ondata=function(e,t,n){x.ondata(e,t,n)};for(var t=0,r=g;t<r.length;t++){var a=r[t];b.push(a,!1)}n.k[0]==g&&n.c?n.d=b:b.push(Ja,!0)}},terminate:function(){b&&b.terminate&&b.terminate()}};_>=0&&(x.size=_,x.originalSize=v),p.onfile(x)}return`break`}else if(u){if(t==134695760)return s=o+=12+(u==-2&&8),a=3,p.c=0,`break`;if(t==33639248)return s=o-=4,a=3,p.c=0,`break`}},p=this;o<l-4&&f()!==`break`;++o);if(this.p=Ja,u<0){var m=a?c.subarray(0,s-12-(u==-2&&8)-($a(c,s-16)==134695760&&4)):c.subarray(0,o);d?d.push(m,!!a):this.k[+(a==2)].push(m)}if(a&2)return this.push(c.subarray(o),t);this.p=c.subarray(o)}t&&(this.c&&Ka(13),this.p=null)},e.prototype.register=function(e){this.o[e.compression]=e},e}(),vo=d(sn(),1),yo=d(He(),1),bo=d(q(),1),xo=class{constructor(e){this._buf=bo.Buffer.alloc(e&&e.size||16384),this._encoding=e&&e.encoding||`utf8`,this._inPos=0,this._buffer=void 0}get length(){return this._inPos}get capacity(){return this._buf.length}get buffer(){return this._buf}toBuffer(){return this._buffer||(this._buffer=bo.Buffer.alloc(this.length),this._buf.copy(this._buffer,0,0,this.length)),this._buffer}reset(e){e||=0,this._buffer=void 0,this._inPos=e}_grow(e){let t=this._buf.length*2;for(;t<e;)t*=2;let n=bo.Buffer.alloc(t);this._buf.copy(n,0),this._buf=n}addText(e){this._buffer=void 0;let t=this._inPos+this._buf.write(e,this._inPos,this._encoding);for(;t>=this._buf.length-4;)this._grow(this._inPos+e.length),t=this._inPos+this._buf.write(e,this._inPos,this._encoding);this._inPos=t}addStringBuf(e){e.length&&(this._buffer=void 0,this.length+e.length>this.capacity&&this._grow(this.length+e.length),e._buf.copy(this._buf,this._inPos,0,e.length),this._inPos+=e.length)}},So=d(q(),1);Re();var Co=class{constructor(e,t){this._data=e,this._encoding=t}get length(){return this.toBuffer().length}copy(e,t,n,r){return this.toBuffer().copy(e,t,n,r)}toBuffer(){return this._buffer||=So.Buffer.from(this._data,this._encoding),this._buffer}},wo=class{constructor(e){this._data=e}get length(){return this._data.length}copy(e,t,n,r){return this._data._buf.copy(e,t,n,r)}toBuffer(){return this._data.toBuffer()}},To=class{constructor(e){this._data=e}get length(){return this._data.length}copy(e,t,n,r){this._data.copy(e,t,n,r)}toBuffer(){return this._data}},Eo=class{constructor(e){this.size=e,this.buffer=So.Buffer.alloc(e),this.iRead=0,this.iWrite=0}toBuffer(){if(this.iRead===0&&this.iWrite===this.size)return this.buffer;let e=So.Buffer.alloc(this.iWrite-this.iRead);return this.buffer.copy(e,0,this.iRead,this.iWrite),e}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(e){let t;return e===0?null:e===void 0||e>=this.length?(t=this.toBuffer(),this.iRead=this.iWrite,t):(t=So.Buffer.alloc(e),this.buffer.copy(t,0,this.iRead,e),this.iRead+=e,t)}write(e,t,n){let r=Math.min(n,this.size-this.iWrite);return e.copy(this.buffer,this.iWrite,t,t+r),this.iWrite+=r,r}};let Do=function(e){if(!(this instanceof Do))return new Do(e);vo.Duplex.call(this,e),e||={},this.bufSize=e.bufSize||1024*1024,this.buffers=[],this.batch=e.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};Xi(Do,vo.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return So.Buffer.concat(this.buffers.map(e=>e.toBuffer()))}},_getWritableBuffer(){if(this.buffers.length){let e=this.buffers[this.buffers.length-1];if(!e.full)return e}let e=new Eo(this.bufSize);return this.buffers.push(e),e},async _pipe(e){await Promise.all(this.pipes.map(function(t){return new Promise(n=>{t.write(e.toBuffer(),()=>{n()})})}))},_writeToBuffers(e){let t=0,n=e.length;for(;t<n;){let r=this._getWritableBuffer();t+=r.write(e,t,n-t)}},async write(e,t,n){t instanceof Function&&(n=t,t=`utf8`),n||=Yi;let r;if(e instanceof xo||e&&e.constructor?.name===`StringBuf`)r=new wo(e);else if(e instanceof So.Buffer)r=new To(e);else if(typeof e==`string`||e instanceof String||e instanceof ArrayBuffer)r=new Co(String(e),t);else throw Error(`Chunk must be one of type String, Buffer or StringBuf.`);if(this.pipes.length)if(this.batch)for(this._writeToBuffers(r);!this.corked&&this.buffers.length>1;)this._pipe(this.buffers.shift());else this.corked?(this._writeToBuffers(r),Q.nextTick(n)):(await this._pipe(r),n());else this.paused||this.emit(`data`,r.toBuffer()),this._writeToBuffers(r),this.emit(`readable`);return!0},cork(){this.corked=!0},_flush(){if(this.pipes.length)for(;this.buffers.length;)this._pipe(this.buffers.shift())},uncork(){this.corked=!1,this._flush()},end(e,t,n){let r=e=>{e?n(e):(this._flush(),this.pipes.forEach(e=>{e.end()}),this.emit(`finish`))};e?this.write(e,t,r):r()},read(e){let t;if(e){for(t=[];e&&this.buffers.length&&!this.buffers[0].eod;){let n=this.buffers[0],r=n.read(e);e-=r.length,t.push(r),n.eod&&n.full&&this.buffers.shift()}return So.Buffer.concat(t)}return t=this.buffers.map(e=>e.toBuffer()).filter(Boolean),this.buffers=[],So.Buffer.concat(t)},setEncoding(e){this.encoding=e},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe(e){return this.pipes.push(e),!this.paused&&this.buffers.length&&this.end(),e},unpipe(e){this.pipes=this.pipes.filter(t=>t!==e)},unshift(){throw Error(`Not Implemented`)},wrap(){throw Error(`Not Implemented`)}});var Oo=d(q(),1);let ko=global.TextEncoder===void 0?null:new global.TextEncoder;function Ao(e){return typeof e==`string`?ko?Oo.Buffer.from(ko.encode(e).buffer):Oo.Buffer.from(e):e}let jo=typeof window<`u`&&typeof document<`u`&&typeof navigator<`u`;var Mo=d(q(),1),No=class extends yo.default.EventEmitter{constructor(e){super(),this.options=Object.assign({type:`nodebuffer`,compression:`DEFLATE`},e),this.files={},this.stream=new Do,this.finalized=!1,this.zip=new mo((e,t,n)=>{e?this.stream.emit(`error`,e):(this.stream.write(Mo.Buffer.from(t)),n&&this.stream.end())})}append(e,t){let n;if(Object.prototype.hasOwnProperty.call(t,`base64`)&&t.base64){let t=typeof e==`string`?e:e.toString();if(jo){let e=atob(t),r=e.length;n=new Uint8Array(r);for(let t=0;t<r;t++)n[t]=e.charCodeAt(t)}else n=Mo.Buffer.from(t,`base64`)}else n=typeof e==`string`?jo?Ao(e):Mo.Buffer.from(e,`utf8`):Mo.Buffer.isBuffer(e)?new Uint8Array(e):e;let r=new po(t.name);this.zip.add(r),r.push(n,!0)}push(e){return this.stream.push(e)}async finalize(){this.finalized||(this.finalized=!0,this.zip.end(),this.emit(`finish`))}read(e){return this.stream.read(e)}setEncoding(e){return this.stream.setEncoding(e)}pause(){return this.stream.pause()}resume(){return this.stream.resume()}isPaused(){return this.stream.isPaused()}pipe(e,t){return this.stream.pipe(e,t)}unpipe(e){return this.stream.unpipe(e)}unshift(e){return this.stream.unshift(e)}wrap(e){return this.stream.wrap(e)}};function Po(e,t,n){e.push(` ${t}="${ea(n.toString())}"`)}function Fo(e,t){if(t){let n=[];Object.entries(t).forEach(([e,t])=>{t!==void 0&&Po(n,e,t)}),e.push(n.join(``))}}var Io=class{constructor(){this._xml=[],this._stack=[],this._rollbacks=[]}get tos(){return this._stack.length?this._stack[this._stack.length-1]:void 0}get cursor(){return this._xml.length}openXml(e){let t=this._xml;t.push(`<?xml`),Fo(t,e),t.push(`?>
|
|
27
27
|
`)}openNode(e,t){let n=this.tos,r=this._xml;n&&this.open&&r.push(`>`),this._stack.push(e),r.push(`<`),r.push(e),Fo(r,t),this.leaf=!0,this.open=!0}addAttribute(e,t){if(!this.open)throw Error(`Cannot write attributes to node if it is not open`);t!==void 0&&Po(this._xml,e,t)}addAttributes(e){if(!this.open)throw Error(`Cannot write attributes to node if it is not open`);Fo(this._xml,e)}writeText(e){let t=this._xml;this.open&&=(t.push(`>`),!1),this.leaf=!1,t.push(ea(e.toString()))}writeXml(e){this.open&&=(this._xml.push(`>`),!1),this.leaf=!1,this._xml.push(e)}closeNode(){let e=this._stack.pop(),t=this._xml;this.leaf?t.push(`/>`):(t.push(`</`),t.push(e),t.push(`>`)),this.open=!1,this.leaf=!1}leafNode(e,t,n){this.openNode(e,t),n!==void 0&&this.writeText(n),this.closeNode()}closeAll(){for(;this._stack.length;)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){let e=this._rollbacks.pop();this._xml.length>e.xml&&this._xml.splice(e.xml,this._xml.length-e.xml),this._stack.length>e.stack&&this._stack.splice(e.stack,this._stack.length-e.stack),this.leaf=e.leaf,this.open=e.open}get xml(){return this.closeAll(),this._xml.join(``)}static{this.StdDocAttributes={version:`1.0`,encoding:`UTF-8`,standalone:`yes`}}};let Lo=global.TextDecoder===void 0?null:new global.TextDecoder(`utf-8`);function Ro(e){return typeof e==`string`?e:Lo?Lo.decode(e):e.toString()}var zo=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CHAR=`
|
|
28
28
|
\r --�𐀀-`,e.S=` \r
|
|
@@ -24,8 +24,8 @@ class Worksheet {
|
|
|
24
24
|
// in a workbook, each sheet will have a number
|
|
25
25
|
this.id = options.id || 0;
|
|
26
26
|
this.orderNo = options.orderNo || 0;
|
|
27
|
-
// and a name
|
|
28
|
-
this.
|
|
27
|
+
// and a name - use the setter to ensure validation and truncation
|
|
28
|
+
this.name = options.name || `sheet${this.id}`;
|
|
29
29
|
// add a state
|
|
30
30
|
this.state = options.state || "visible";
|
|
31
31
|
// rows allows access organised by row. Sparse array of arrays indexed by row-1, col
|
|
@@ -21,8 +21,8 @@ class Worksheet {
|
|
|
21
21
|
// in a workbook, each sheet will have a number
|
|
22
22
|
this.id = options.id || 0;
|
|
23
23
|
this.orderNo = options.orderNo || 0;
|
|
24
|
-
// and a name
|
|
25
|
-
this.
|
|
24
|
+
// and a name - use the setter to ensure validation and truncation
|
|
25
|
+
this.name = options.name || `sheet${this.id}`;
|
|
26
26
|
// add a state
|
|
27
27
|
this.state = options.state || "visible";
|
|
28
28
|
// rows allows access organised by row. Sparse array of arrays indexed by row-1, col
|
package/dist/esm/local.js
CHANGED
package/dist/types/local.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cj-tech-master/excelts",
|
|
3
|
-
"version": "0.1.0-canary.
|
|
3
|
+
"version": "0.1.0-canary.20251029013247.758de7b",
|
|
4
4
|
"description": "TypeScript Excel Workbook Manager - Read and Write xlsx and csv Files.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|