@cj-tech-master/excelts 9.4.1 → 9.4.2
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/modules/pdf/builder/document-builder.js +4 -23
- package/dist/browser/modules/pdf/core/pdf-stream.d.ts +15 -0
- package/dist/browser/modules/pdf/core/pdf-stream.js +47 -3
- package/dist/browser/modules/pdf/font/font-manager.d.ts +37 -6
- package/dist/browser/modules/pdf/font/font-manager.js +129 -17
- package/dist/browser/modules/pdf/font/system-fonts.d.ts +41 -0
- package/dist/browser/modules/pdf/font/system-fonts.js +188 -0
- package/dist/browser/modules/pdf/font/ttf-parser.js +29 -1
- package/dist/browser/modules/pdf/font/type3-font.d.ts +35 -0
- package/dist/browser/modules/pdf/font/type3-font.js +228 -0
- package/dist/browser/modules/pdf/font/type3-glyphs-extended.d.ts +33 -0
- package/dist/browser/modules/pdf/font/type3-glyphs-extended.js +4164 -0
- package/dist/browser/modules/pdf/font/type3-glyphs-extended2.d.ts +16 -0
- package/dist/browser/modules/pdf/font/type3-glyphs-extended2.js +9649 -0
- package/dist/browser/modules/pdf/font/type3-glyphs-fill.d.ts +17 -0
- package/dist/browser/modules/pdf/font/type3-glyphs-fill.js +5438 -0
- package/dist/browser/modules/pdf/font/type3-glyphs-quality.d.ts +28 -0
- package/dist/browser/modules/pdf/font/type3-glyphs-quality.js +5345 -0
- package/dist/browser/modules/pdf/font/type3-glyphs.d.ts +79 -0
- package/dist/browser/modules/pdf/font/type3-glyphs.js +2567 -0
- package/dist/browser/modules/pdf/render/layout-engine.js +36 -23
- package/dist/browser/modules/pdf/render/page-renderer.d.ts +9 -0
- package/dist/browser/modules/pdf/render/page-renderer.js +110 -78
- package/dist/browser/modules/pdf/render/pdf-exporter.js +73 -5
- package/dist/cjs/modules/pdf/builder/document-builder.js +3 -22
- package/dist/cjs/modules/pdf/core/pdf-stream.js +49 -3
- package/dist/cjs/modules/pdf/font/font-manager.js +129 -17
- package/dist/cjs/modules/pdf/font/system-fonts.js +194 -0
- package/dist/cjs/modules/pdf/font/ttf-parser.js +29 -1
- package/dist/cjs/modules/pdf/font/type3-font.js +231 -0
- package/dist/cjs/modules/pdf/font/type3-glyphs-extended.js +4167 -0
- package/dist/cjs/modules/pdf/font/type3-glyphs-extended2.js +9652 -0
- package/dist/cjs/modules/pdf/font/type3-glyphs-fill.js +5441 -0
- package/dist/cjs/modules/pdf/font/type3-glyphs-quality.js +5348 -0
- package/dist/cjs/modules/pdf/font/type3-glyphs.js +2573 -0
- package/dist/cjs/modules/pdf/render/layout-engine.js +36 -23
- package/dist/cjs/modules/pdf/render/page-renderer.js +111 -78
- package/dist/cjs/modules/pdf/render/pdf-exporter.js +71 -3
- package/dist/esm/modules/pdf/builder/document-builder.js +4 -23
- package/dist/esm/modules/pdf/core/pdf-stream.js +47 -3
- package/dist/esm/modules/pdf/font/font-manager.js +129 -17
- package/dist/esm/modules/pdf/font/system-fonts.js +188 -0
- package/dist/esm/modules/pdf/font/ttf-parser.js +29 -1
- package/dist/esm/modules/pdf/font/type3-font.js +228 -0
- package/dist/esm/modules/pdf/font/type3-glyphs-extended.js +4164 -0
- package/dist/esm/modules/pdf/font/type3-glyphs-extended2.js +9649 -0
- package/dist/esm/modules/pdf/font/type3-glyphs-fill.js +5438 -0
- package/dist/esm/modules/pdf/font/type3-glyphs-quality.js +5345 -0
- package/dist/esm/modules/pdf/font/type3-glyphs.js +2567 -0
- package/dist/esm/modules/pdf/render/layout-engine.js +36 -23
- package/dist/esm/modules/pdf/render/page-renderer.js +110 -78
- package/dist/esm/modules/pdf/render/pdf-exporter.js +73 -5
- package/dist/iife/excelts.iife.js +25445 -344
- package/dist/iife/excelts.iife.js.map +1 -1
- package/dist/iife/excelts.iife.min.js +48 -46
- package/dist/types/modules/pdf/core/pdf-stream.d.ts +15 -0
- package/dist/types/modules/pdf/font/font-manager.d.ts +37 -6
- package/dist/types/modules/pdf/font/system-fonts.d.ts +41 -0
- package/dist/types/modules/pdf/font/type3-font.d.ts +35 -0
- package/dist/types/modules/pdf/font/type3-glyphs-extended.d.ts +33 -0
- package/dist/types/modules/pdf/font/type3-glyphs-extended2.d.ts +16 -0
- package/dist/types/modules/pdf/font/type3-glyphs-fill.d.ts +17 -0
- package/dist/types/modules/pdf/font/type3-glyphs-quality.d.ts +28 -0
- package/dist/types/modules/pdf/font/type3-glyphs.d.ts +79 -0
- package/dist/types/modules/pdf/render/page-renderer.d.ts +9 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @cj-tech-master/excelts v9.4.
|
|
2
|
+
* @cj-tech-master/excelts v9.4.2
|
|
3
3
|
* Zero-dependency TypeScript toolkit — Excel (XLSX), PDF, CSV, Markdown, XML, ZIP/TAR, and streaming.
|
|
4
4
|
* (c) 2026 cjnoname
|
|
5
5
|
* Released under the MIT License
|
|
@@ -12,32 +12,32 @@ var ExcelTS=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Modu
|
|
|
12
12
|
`}}return`
|
|
13
13
|
`}function y(e,t=`"`,n,r,i){let a=n??m,o=a[0]??`,`,s=b(e,10,t,r,i);if(s.length===0)return o;let c=o,l,u;for(let e of a){let{avgFieldCount:n,delta:r}=x(s,e,t);n<=1.99||(l===void 0||r<l||r===l&&(u===void 0||n>u))&&(l=r,u=n,c=e)}return c}function b(e,t,n,r,i){let a=[],o=0,s=!1,c=e.length;for(let l=0;l<c&&a.length<t;l++){let t=e[l];if(n&&t===n)s&&e[l+1]===n?l++:s=!s;else if(!s&&(t===`
|
|
14
14
|
`||t===`\r`)){let n=e.slice(o,l);if(!(r&&n.startsWith(r))){let e=n.trim();!(n.length===0||i&&e===``)&&e!==``&&a.push(n)}t===`\r`&&e[l+1]===`
|
|
15
|
-
`&&l++,o=l+1}}if(o<c&&a.length<t){let t=e.slice(o);if(!r||!t.startsWith(r)){let e=t.trim();!(t.length===0||i&&e===``)&&e!==``&&a.push(t)}}return a}function x(e,t,n){if(e.length===0)return{avgFieldCount:0,delta:1/0};let r=0,i=0,a;for(let o of e){let e=S(o,t,n)+1;if(i+=e,a===void 0){a=e;continue}r+=Math.abs(e-a),a=e}return i/=e.length,{avgFieldCount:i,delta:r}}function S(e,t,n){let r=0,i=!1,a=e.length,o=t.length;for(let s=0;s<a;s++)n&&e[s]===n?i&&e[s+1]===n?s++:i=!i:i||(o===1?e[s]===t&&r++:e.startsWith(t,s)&&(r++,s+=o-1));return r}function
|
|
16
|
-
`,quote:r=`"`,escape:i,quoteColumns:a=!1,quoteHeaders:o=!1,writeHeaders:s,bom:c=!1,trailingNewline:l=!1,escapeFormulae:d=!1,decimalSeparator:f=`.`,typeTransform:p}=e;if(f!==`.`&&f!==`,`)throw new u(`Invalid decimalSeparator: "${f}". Must be "." or ",".`);if(f===t)throw new u(`decimalSeparator cannot be the same as delimiter`);let m=
|
|
17
|
-
`)!==-1||e.indexOf(`\r`)!==-1}function Te(e,t,n){let{index:r,header:i,isHeader:a,outputRowIndex:o,forceQuote:s,quoteAll:c,escapeFormulae:l,decimalSeparator:u,transform:d}=n,f,p;if(!a&&d){let t=Se(e,d,{column:i??r,index:o});t==null?f=Ce(e,u):xe(t)?(f=t.value,p=t.quote):f=t}else f=Ce(e,u);if(l&&p!==!1&&typeof e!=`number`&&typeof e!=`bigint`&&_(f)&&(f=`'`+f),!t.quoteEnabled)return f;let m;if(m=p===void 0?c||s||(t.useFastCheck?we(f,t.delimiter,t.quote,t.escape):t.needsQuoteRegex.test(f)):p,m){let e;return e=t.escape===t.quote?f.replace(t.escapeQuoteRegex,t.escapedQuote):f.replace(t.escapeQuoteRegex,e=>e===t.quote?t.escape+t.quote:t.escape+t.escape),t.quote+e+t.quote}return f}function Ee(e,t,n){let{quoteLookup:r,delimiter:i,headers:a,isHeader:o,outputRowIndex:s,quoteAll:c,escapeFormulae:l,decimalSeparator:u,transform:d}=n,f=e.length;if(f===0)return``;let p={index:0,header:a?.[0],isHeader:o,outputRowIndex:s,forceQuote:r(0,a?.[0]),quoteAll:c,escapeFormulae:l,decimalSeparator:u,transform:d},m=Te(e[0],t,p);for(let n=1;n<f;n++)p.index=n,p.header=a?.[n],p.forceQuote=r(n,p.header),m+=i+Te(e[n],t,p);return m}function De(e,t,n){if(!e.typeTransform?.row)return t;let r=e.typeTransform.row(t,n);return r===null?null:r}function Oe(e,t,n){let{headers:r,columns:i}=t;if(e.length===0)return i&&i.length>0?{keys:null,displayHeaders:i.map(e=>typeof e==`string`?e:e.header??e.key),rows:[]}:Array.isArray(r)?{keys:r,displayHeaders:r,rows:[]}:{keys:null,displayHeaders:null,rows:[]};let a=e[0];if(i&&i.length>0){let t=ge(i),r=t.keys,a=t.headers,o=[];for(let t=0;t<e.length;t++){let i=De(n,e[t],t);if(i===null)continue;let a;a=oe(i)?de(i,r):Array.isArray(i)?i:r.map(e=>i[e]),o.push(a)}return{keys:r,displayHeaders:a,rows:o}}if(oe(a)){let t=e,i=r===!0?le(t[0]):Array.isArray(r)?r:null,a=[];for(let e=0;e<t.length;e++){let r=De(n,t[e],e);if(r===null)continue;let o;o=oe(r)?i?de(r,i):ce(r):Array.isArray(r)?r:i?i.map(e=>r[e]):Object.values(r),a.push(o)}return{keys:i,displayHeaders:i,rows:a}}if(!Array.isArray(a)&&typeof a==`object`){let t=e,i=r===!0?Object.keys(t[0]):Array.isArray(r)?r:null,a=[];for(let e=0;e<t.length;e++){let r=De(n,t[e],e);if(r===null)continue;let o=i?i.map(e=>r[e]):Object.values(r);a.push(o)}return{keys:i,displayHeaders:i,rows:a}}let o=e,s=Array.isArray(r)?r:null,c=[];for(let e=0;e<o.length;e++){let t=De(n,o[e],e);t!==null&&c.push(t)}return{keys:s,displayHeaders:s,rows:c}}function ke(e,t={}){let n=ne(t),{displayHeaders:r,rows:i}=Oe(e,t,n),a=[],o=r?me(r):void 0;o&&n.writeHeaders&&a.push(Ee(o,n.regex,{quoteLookup:n.shouldQuoteHeader,delimiter:n.delimiter,headers:o,isHeader:!0,outputRowIndex:0,quoteAll:n.quoteAll,escapeFormulae:n.escapeFormulae,decimalSeparator:n.decimalSeparator,transform:void 0}));for(let e=0;e<i.length;e++)a.push(Ee(i[e],n.regex,{quoteLookup:n.shouldQuoteColumn,delimiter:n.delimiter,headers:o,isHeader:!1,outputRowIndex:e,quoteAll:n.quoteAll,escapeFormulae:n.escapeFormulae,decimalSeparator:n.decimalSeparator,transform:n.typeTransform}));let s=n.bom?``:``;return s+=a.join(n.lineEnding),a.length>0&&n.trailingNewline&&(s+=n.lineEnding),s}let Ae=/\r\n|\r|\n/,je=null,Me=null,Ne=null;function Pe(){return je||(je=new TextEncoder,Me=new Uint8Array(4),Ne=new Uint8Array(4096)),je}function Fe(e){let t=e.length;if(t===0)return 0;if(t===1)return e.charCodeAt(0)<128?1:Pe().encodeInto(e,Me).written;let n=!0;for(let r=0;r<t;r++)if(e.charCodeAt(r)>=128){n=!1;break}if(n)return t;let r=Pe();return t*3>Ne.length&&(Ne=new Uint8Array(t*3)),r.encodeInto(e,Ne).written}let w=Array.from({length:60},(e,t)=>t<10?`0${t}`:`${t}`),T=(e,t)=>(e.charCodeAt(t)-48)*10+e.charCodeAt(t+1)-48|0,Ie=(e,t)=>(e.charCodeAt(t)-48)*1e3+(e.charCodeAt(t+1)-48)*100+(e.charCodeAt(t+2)-48)*10+e.charCodeAt(t+3)-48|0,Le=[0,31,29,31,30,31,30,31,31,30,31,30,31];function Re(e,t,n){if(t<1||t>12||n<1||n>Le[t])return null;let r=new Date(e,t-1,n);return r.getMonth()===t-1?r:null}function ze(e,t,n,r,i,a){return t<1||t>12||n<1||n>Le[t]||r>23||i>59||a>59?null:new Date(e,t-1,n,r,i,a)}function Be(e){return e.charCodeAt(4)!==45||e.charCodeAt(7)!==45?null:Re(Ie(e,0),T(e,5),T(e,8))}function Ve(e){return e.charCodeAt(4)!==45||e.charCodeAt(7)!==45||e.charCodeAt(10)!==84||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58?null:ze(Ie(e,0),T(e,5),T(e,8),T(e,11),T(e,14),T(e,17))}function He(e){return e.charCodeAt(4)!==45||e.charCodeAt(7)!==45||e.charCodeAt(10)!==32||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58?null:ze(Ie(e,0),T(e,5),T(e,8),T(e,11),T(e,14),T(e,17))}function Ue(e){if(e.charCodeAt(19)!==90)return null;let t=new Date(e);return isNaN(t.getTime())?null:t}function We(e){if(e.charCodeAt(19)!==46||e.charCodeAt(23)!==90)return null;let t=new Date(e);return isNaN(t.getTime())?null:t}function Ge(e){let t=e.charCodeAt(19);if(t!==43&&t!==45)return null;let n=new Date(e);return isNaN(n.getTime())?null:n}function Ke(e){if(e.charCodeAt(19)!==46)return null;let t=e.charCodeAt(23);if(t!==43&&t!==45)return null;let n=new Date(e);return isNaN(n.getTime())?null:n}function qe(e){let t=e.charCodeAt(2);return t!==45&&t!==47||e.charCodeAt(5)!==t?null:Re(Ie(e,6),T(e,0),T(e,3))}function Je(e){let t=e.charCodeAt(2);return t!==45&&t!==47||e.charCodeAt(5)!==t?null:Re(Ie(e,6),T(e,3),T(e,0))}function Ye(e){let t=e.charCodeAt(2);return t!==45&&t!==47||e.charCodeAt(5)!==t||e.charCodeAt(10)!==32||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58?null:ze(Ie(e,6),T(e,0),T(e,3),T(e,11),T(e,14),T(e,17))}function Xe(e){let t=e.charCodeAt(2);return t!==45&&t!==47||e.charCodeAt(5)!==t||e.charCodeAt(10)!==32||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58?null:ze(Ie(e,6),T(e,3),T(e,0),T(e,11),T(e,14),T(e,17))}let Ze={"YYYY-MM-DD":Be,"YYYY-MM-DD[T]HH:mm:ss":Ve,"YYYY-MM-DD HH:mm:ss":He,"YYYY-MM-DD[T]HH:mm:ssZ":e=>e.length===20?Ue(e):e.length===25?Ge(e):null,"YYYY-MM-DD[T]HH:mm:ss.SSSZ":e=>e.length===24?We(e):e.length===29?Ke(e):null,"MM-DD-YYYY":qe,"MM-DD-YYYY HH:mm:ss":Ye,"MM/DD/YYYY HH:mm:ss":Ye,"DD-MM-YYYY":Je,"DD-MM-YYYY HH:mm:ss":Xe,"DD/MM/YYYY HH:mm:ss":Xe},Qe=[[10,[Be]],[19,[Ve,He]],[20,[Ue]],[24,[We]],[25,[Ge]],[29,[Ke]]];var $e=class e{constructor(e){this.parse=e=>{if(!e)return null;let t=e.trim();if(!t)return null;if(this.single)return this.fn0(t);for(let e=0,n=this.fns.length;e<n;e++){let n=this.fns[e](t);if(n)return n}return null},this.fns=e,this.single=e.length===1,this.fn0=e[0]}static create(t){return new e(t.map(e=>Ze[e]).filter(Boolean))}static iso(){let t=[];for(let[,e]of Qe)t.push(...e);return new e(t)}parseAll(e){let t=e.length,n=Array(t),r=this.parse;for(let i=0;i<t;i++)n[i]=r(e[i]);return n}parseValid(e){let t=[],n=this.parse;for(let r=0,i=e.length;r<i;r++){let i=n(e[r]);i&&t.push(i)}return t}};function et(e){let t=-e.getTimezoneOffset(),n=t>=0?`+`:`-`,r=Math.abs(t)/60|0,i=Math.abs(t)%60;return`${n}${w[r]}:${w[i]}`}var tt=class e{constructor(e){this.format=e=>this.fn(e),this.fn=e}static iso(t=!1){return t?new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();if(Number.isNaN(t))return``;let n=e.getUTCFullYear(),r=e.getUTCMonth()+1,i=e.getUTCDate(),a=e.getUTCHours(),o=e.getUTCMinutes(),s=e.getUTCSeconds(),c=e.getUTCMilliseconds();return`${n}-${w[r]}-${w[i]}T${w[a]}:${w[o]}:${w[s]}.${c<10?`00`+c:c<100?`0`+c:c}Z`}):new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();if(Number.isNaN(t))return``;let n=e.getFullYear(),r=e.getMonth()+1,i=e.getDate(),a=e.getHours(),o=e.getMinutes(),s=e.getSeconds(),c=e.getMilliseconds();return`${n}-${w[r]}-${w[i]}T${w[a]}:${w[o]}:${w[s]}.${c<10?`00`+c:c<100?`0`+c:c}${et(e)}`})}static create(t,n){let r=n?.utc??!1;if(t===`YYYY-MM-DD`)return r?new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return Number.isNaN(t)?``:`${e.getUTCFullYear()}-${w[e.getUTCMonth()+1]}-${w[e.getUTCDate()]}`}):new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return Number.isNaN(t)?``:`${e.getFullYear()}-${w[e.getMonth()+1]}-${w[e.getDate()]}`});if(t===`YYYY-MM-DD HH:mm:ss`)return r?new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return Number.isNaN(t)?``:`${e.getUTCFullYear()}-${w[e.getUTCMonth()+1]}-${w[e.getUTCDate()]} ${w[e.getUTCHours()]}:${w[e.getUTCMinutes()]}:${w[e.getUTCSeconds()]}`}):new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return Number.isNaN(t)?``:`${e.getFullYear()}-${w[e.getMonth()+1]}-${w[e.getDate()]} ${w[e.getHours()]}:${w[e.getMinutes()]}:${w[e.getSeconds()]}`});if(t===`MM-DD-YYYY`||t===`MM/DD/YYYY`){let n=t.charAt(2);return r?new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return Number.isNaN(t)?``:`${w[e.getUTCMonth()+1]}${n}${w[e.getUTCDate()]}${n}${e.getUTCFullYear()}`}):new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return Number.isNaN(t)?``:`${w[e.getMonth()+1]}${n}${w[e.getDate()]}${n}${e.getFullYear()}`})}if(t===`DD-MM-YYYY`||t===`DD/MM/YYYY`){let n=t.charAt(2);return r?new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return Number.isNaN(t)?``:`${w[e.getUTCDate()]}${n}${w[e.getUTCMonth()+1]}${n}${e.getUTCFullYear()}`}):new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return Number.isNaN(t)?``:`${w[e.getDate()]}${n}${w[e.getMonth()+1]}${n}${e.getFullYear()}`})}return e.createGeneric(t,r)}static createGeneric(t,n){let r=[],i=[],a=0;for(;a<t.length;)if(t[a]===`[`){let e=t.indexOf(`]`,a+1);e===-1?(i.push(t[a]),a++):(r.push(t.slice(a+1,e)),i.push(`\x00${r.length-1}\x00`),a=e+1)}else i.push(t[a]),a++;let o=i.join(``),s=o.includes(`YYYY`),c=o.includes(`SSS`),l=o.includes(`MM`),u=o.includes(`DD`),d=o.includes(`HH`),f=o.includes(`mm`),p=o.includes(`ss`),m=o.includes(`Z`);return new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();if(Number.isNaN(t))return``;let i=o;if(s&&(i=i.replace(/YYYY/g,String(n?e.getUTCFullYear():e.getFullYear()))),c){let t=n?e.getUTCMilliseconds():e.getMilliseconds();i=i.replace(/SSS/g,t<10?`00${t}`:t<100?`0${t}`:String(t))}return l&&(i=i.replace(/MM/g,w[n?e.getUTCMonth()+1:e.getMonth()+1])),u&&(i=i.replace(/DD/g,w[n?e.getUTCDate():e.getDate()])),d&&(i=i.replace(/HH/g,w[n?e.getUTCHours():e.getHours()])),f&&(i=i.replace(/mm/g,w[n?e.getUTCMinutes():e.getMinutes()])),p&&(i=i.replace(/ss/g,w[n?e.getUTCSeconds():e.getSeconds()])),m&&(i=i.replace(/Z/g,n?`Z`:et(e))),r.length&&(i=i.replace(/\x00(\d+)\x00/g,(e,t)=>r[+t])),i})}formatAll(e){let t=e.length,n=Array(t),r=this.fn;for(let i=0;i<t;i++)n[i]=r(e[i]);return n}};function nt(){return Object.keys(Ze)}let rt=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/,it=null;function at(){return it||=$e.iso(),it}function ot(e){return!e||e.length<10?null:at().parse(e)}function st(e,t){return e?e===!0?!0:Array.isArray(e)&&typeof t==`string`?e.includes(t):!1:!1}function ct(e,t){return e===t||e===t-32}function lt(e){let t=e.length;if(t===0)return``;let n=e.charCodeAt(0);if(t===4){if((n===116||n===84)&&ct(e.charCodeAt(1),114)&&ct(e.charCodeAt(2),117)&&ct(e.charCodeAt(3),101))return!0;if((n===110||n===78)&&ct(e.charCodeAt(1),117)&&ct(e.charCodeAt(2),108)&&ct(e.charCodeAt(3),108))return null}else if(t===5&&(n===102||n===70)&&ct(e.charCodeAt(1),97)&&ct(e.charCodeAt(2),108)&&ct(e.charCodeAt(3),115)&&ct(e.charCodeAt(4),101))return!1;if(n>=48&&n<=57||n===45||n===46||n===73||n===78){if(e.charCodeAt(t-1)<=32)return e;if(e===`Infinity`)return 1/0;if(e===`-Infinity`)return-1/0;if(e===`NaN`)return NaN;if(n===48&&t>1){let t=e.charCodeAt(1);if(t>=48&&t<=57)return e}if(n===45&&t>2&&e.charCodeAt(1)===48){let t=e.charCodeAt(2);if(t>=48&&t<=57)return e}if(rt.test(e)){let t=Number(e);if(!isNaN(t))return t}}return e}function ut(e){return typeof e==`function`}function dt(e,t){return t===!1?e:ut(t)?t(e):lt(e)}function ft(e,t,n,r){if(st(r,t)){let t=ot(e);if(t!==null)return t}if(n===!0)return lt(e);if(n===!1||t===void 0)return e;let i=n[t];return i===void 0?e:dt(e,i)}function pt(e,t,n){if(t===!1&&!n)return e;for(let r in e)Object.hasOwn(e,r)&&(e[r]=ft(e[r],r,t,n));return e}function mt(e,t,n,r){return n===!1&&!r||n!==!0&&n!==!1&&!t?e:e.map((e,i)=>{let a=t?.[i];return ft(e,a,n,r)})}function ht(e,t,n){let{headers:r,groupColumnsByName:i=!1}=t;if(n!==null&&Array.isArray(r))return null;let a,o;if(typeof r==`function`){if(a=r(e),a.length!==e.length)throw new u(`Header function returned ${a.length} headers but row has ${e.length} columns. The header function must return an array with the same length as the input row.`);o=!0}else if(Array.isArray(r))a=r,o=!1;else if(r)a=e,o=!0;else return null;let{headers:s,renamedHeaders:c}=he(a);return{headers:s,originalHeaders:i?a.map(e=>e==null?null:String(e)):null,renamedHeaders:c,skipCurrentRow:o}}function gt(e,t,n){let{columnLess:r,columnMore:i}=n,a=e.length;if(a===t)return{isValid:!0,modified:!1};if(a>t)switch(i){case`error`:return{isValid:!1,errorCode:`TooManyFields`,reason:`expected ${t} columns, got ${a}`,modified:!1};case`truncate`:return e.length=t,{isValid:!0,errorCode:`TooManyFields`,modified:!0};case`keep`:return{isValid:!0,errorCode:`TooManyFields`,modified:!0,extras:e.splice(t)};default:throw Error(`Unknown columnMore strategy: ${i}`)}switch(r){case`error`:return{isValid:!1,errorCode:`TooFewFields`,reason:`expected ${t} columns, got ${a}`,modified:!1};case`pad`:for(;e.length<t;)e.push(``);return{isValid:!0,errorCode:`TooFewFields`,modified:!0};default:throw Error(`Unknown columnLess strategy: ${r}`)}}function _t(e){return e?(t,n)=>{try{e(t,n)}catch{}}:null}function vt(e,t){let n=Object.create(null);for(let r=0;r<t.length;r++){let i=t[r];i!=null&&i!==`__proto__`&&(n[i]=e[r]??``)}return n}function yt(e,t,n,r){return r&&n?bt(e,n):vt(e,t)}function bt(e,t){let n=Object.create(null);for(let r=0;r<t.length;r++){let i=t[r];if(i!=null&&i!==`__proto__`){let t=e[r]??``;if(i in n){let e=n[i];Array.isArray(e)?e.push(t):n[i]=[e,t]}else n[i]=t}}return n}function xt(e){return e.filter(e=>e!=null)}function St(e){let{input:t,options:n,detectedDelimiter:r}=e,{delimiter:i=`,`,delimitersToGuess:a,lineEnding:o=``,quote:s=`"`,escape:c,skipEmptyLines:l=!1,trim:d=!1,ltrim:m=!1,rtrim:h=!1,headers:_=!1,comment:b,maxRows:x,toLine:S,skipLines:C=0,skipRows:ee=0,columnMismatch:te,groupColumnsByName:ne=!1,fastMode:re=!1,dynamicTyping:ie,castDate:ae,beforeFirstChunk:oe,info:se=!1,raw:ce=!1,relaxQuotes:le=!1,skipRecordsWithError:ue=!1,skipRecordsWithEmptyValues:de=!1,onSkip:fe,maxRowBytes:pe}=n,me=te?.less??`error`,he=te?.more??`error`,ge;if(t!==void 0){if(ge=t,oe){let e=oe(ge);if(typeof e==`string`)ge=e;else if(e!=null)throw new u(`beforeFirstChunk must return a string or undefined, got ${typeof e}`)}ge=g(ge)}let _e=l,{enabled:ve,char:ye}=f(s),be=p(c,ye),xe=be.enabled?be.char||ye:``,Se;Se=r===void 0?i===``&&ge!==void 0?y(ge,ye||`"`,a,b,_e):i===``?`,`:i:r;let Ce=o||(ge===void 0?`
|
|
18
|
-
`:v(
|
|
19
|
-
`&&
|
|
20
|
-
`&&
|
|
15
|
+
`&&l++,o=l+1}}if(o<c&&a.length<t){let t=e.slice(o);if(!r||!t.startsWith(r)){let e=t.trim();!(t.length===0||i&&e===``)&&e!==``&&a.push(t)}}return a}function x(e,t,n){if(e.length===0)return{avgFieldCount:0,delta:1/0};let r=0,i=0,a;for(let o of e){let e=S(o,t,n)+1;if(i+=e,a===void 0){a=e;continue}r+=Math.abs(e-a),a=e}return i/=e.length,{avgFieldCount:i,delta:r}}function S(e,t,n){let r=0,i=!1,a=e.length,o=t.length;for(let s=0;s<a;s++)n&&e[s]===n?i&&e[s+1]===n?s++:i=!i:i||(o===1?e[s]===t&&r++:e.startsWith(t,s)&&(r++,s+=o-1));return r}function ee(e){return e.replace(/[\\\]^-]/g,`\\$&`)}function te(e){let{quote:t,delimiter:n,escape:r}=e,{enabled:i,char:a}=f(t),o=p(r,a);if(!i)return{needsQuoteRegex:null,escapeQuoteRegex:null,escapedQuote:``,quoteEnabled:!1,quote:``,escape:``,delimiter:n,useFastCheck:!1};let s=o.char||a,c=n.length===1&&a.length===1&&s.length===1;return{needsQuoteRegex:c?null:(()=>{let e=`${ee(n)}${ee(a)}${s===a?``:ee(s)}\r\n`;return RegExp(`[${e}]`)})(),escapeQuoteRegex:s===a?new RegExp(d(a),`g`):RegExp(`${d(a)}|${d(s)}`,`g`),escapedQuote:s+a,quoteEnabled:!0,quote:a,escape:s,delimiter:n,useFastCheck:c}}function ne(e){return e===!0?()=>!0:e===!1||e===void 0?()=>!1:Array.isArray(e)?t=>!!e[t]:(t,n)=>n?!!e[n]:!1}function re(e){let{delimiter:t=`,`,lineEnding:n=`
|
|
16
|
+
`,quote:r=`"`,escape:i,quoteColumns:a=!1,quoteHeaders:o=!1,writeHeaders:s,bom:c=!1,trailingNewline:l=!1,escapeFormulae:d=!1,decimalSeparator:f=`.`,typeTransform:p}=e;if(f!==`.`&&f!==`,`)throw new u(`Invalid decimalSeparator: "${f}". Must be "." or ",".`);if(f===t)throw new u(`decimalSeparator cannot be the same as delimiter`);let m=te({quote:r,delimiter:t,escape:i});return{delimiter:t,lineEnding:n,quoteAll:a===!0,escapeFormulae:d,decimalSeparator:f,writeHeaders:s??!0,bom:c,trailingNewline:l,typeTransform:p,regex:m,shouldQuoteColumn:ne(a),shouldQuoteHeader:ne(o)}}let ie=/^-?\d+(,\d+)?([eE][+-]?\d+)?$/;function ae(e,t){return t===`,`?String(e).replace(`.`,`,`):String(e)}function oe(e,t){let n=e.trim();return t===`,`&&ie.test(n)?Number(n.replace(`,`,`.`)):Number(n)}function se(e){if(!Array.isArray(e)||e.length===0)return!1;let t=e[0];return Array.isArray(t)&&t.length===2&&typeof t[0]==`string`}function ce(e){let t=Object.create(null);for(let[n,r]of e)n!==`__proto__`&&(t[n]=r);return t}function le(e){return e.map(([,e])=>e)}function ue(e){return e.map(([e])=>e)}function de(e,t){for(let[n,r]of e)if(n===t)return r}function fe(e,t){if(t.length<=10)return t.map(t=>de(e,t));let n=ce(e);return t.map(e=>n[e])}function pe(e,t){return se(e)?t?fe(e,t):le(e):Array.isArray(e)?e:typeof e==`object`&&e?t?t.map(t=>e[t]):Object.values(e):[e]}function me(e){return se(e)?ue(e):!Array.isArray(e)&&typeof e==`object`&&e?Object.keys(e):[]}function he(e){return ge(e).headers}function ge(e){let t=new Map,n=new Set,r=new Set,i=[],a={},o=!1,s=0;for(let t of e)t!=null&&t!==``&&r.add(t);for(let c=0;c<e.length;c++){let l=e[c];if(l==null){i.push(l);continue}if(l===``){let e=`_column_${c}`;for(;n.has(e)||r.has(e);)e=`_column_${c}_${s++}`;n.add(e),i.push(e),a[e]=``,o=!0;continue}if(!n.has(l)){n.add(l),t.set(l,1),i.push(l);continue}let u=t.get(l)??1,d=`${l}_${u}`;for(;n.has(d)||r.has(d);)u++,d=`${l}_${u}`;t.set(l,u+1),n.add(d),i.push(d),a[d]=l,o=!0}return{headers:i,renamedHeaders:o?a:null}}function _e(e){return!e||e.length===0?null:{keys:e.map(e=>typeof e==`string`?e:e.key),headers:e.map(e=>typeof e==`string`?e:e.header??e.key)}}let ve=/\S/;function ye(e,t){if(!t)return!1;if(t===`greedy`){for(let t of e)if(ve.test(t))return!1}else for(let t of e)if(t!==``)return!1;return!0}function be(e){return ye(e,!0)}let xe=Symbol.for(`csv.FormattedValue`);function Se(e){return typeof e==`object`&&!!e&&e[xe]===!0}function Ce(e,t,n){if(e==null)return;let r=typeof e;if(r===`boolean`&&t.boolean)return t.boolean(e,n);if(e instanceof Date&&t.date)return t.date(e,n);if(r===`number`&&t.number)return t.number(e,n);if(r===`bigint`&&t.bigint)return t.bigint(e,n);if(r===`string`&&t.string)return t.string(e,n);if(r===`object`&&!Array.isArray(e)&&!(e instanceof Date)&&t.object)return t.object(e,n)}function we(e,t){if(e==null)return``;if(typeof e==`number`)return ae(e,t);if(e instanceof Date)return e.toISOString();if(typeof e==`bigint`)return String(e);if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`object`)try{return JSON.stringify(e)}catch{return`[object Object]`}return String(e)}function Te(e,t,n,r){return e.indexOf(t)!==-1||e.indexOf(n)!==-1||r!==n&&e.indexOf(r)!==-1||e.indexOf(`
|
|
17
|
+
`)!==-1||e.indexOf(`\r`)!==-1}function Ee(e,t,n){let{index:r,header:i,isHeader:a,outputRowIndex:o,forceQuote:s,quoteAll:c,escapeFormulae:l,decimalSeparator:u,transform:d}=n,f,p;if(!a&&d){let t=Ce(e,d,{column:i??r,index:o});t==null?f=we(e,u):Se(t)?(f=t.value,p=t.quote):f=t}else f=we(e,u);if(l&&p!==!1&&typeof e!=`number`&&typeof e!=`bigint`&&_(f)&&(f=`'`+f),!t.quoteEnabled)return f;let m;if(m=p===void 0?c||s||(t.useFastCheck?Te(f,t.delimiter,t.quote,t.escape):t.needsQuoteRegex.test(f)):p,m){let e;return e=t.escape===t.quote?f.replace(t.escapeQuoteRegex,t.escapedQuote):f.replace(t.escapeQuoteRegex,e=>e===t.quote?t.escape+t.quote:t.escape+t.escape),t.quote+e+t.quote}return f}function De(e,t,n){let{quoteLookup:r,delimiter:i,headers:a,isHeader:o,outputRowIndex:s,quoteAll:c,escapeFormulae:l,decimalSeparator:u,transform:d}=n,f=e.length;if(f===0)return``;let p={index:0,header:a?.[0],isHeader:o,outputRowIndex:s,forceQuote:r(0,a?.[0]),quoteAll:c,escapeFormulae:l,decimalSeparator:u,transform:d},m=Ee(e[0],t,p);for(let n=1;n<f;n++)p.index=n,p.header=a?.[n],p.forceQuote=r(n,p.header),m+=i+Ee(e[n],t,p);return m}function Oe(e,t,n){if(!e.typeTransform?.row)return t;let r=e.typeTransform.row(t,n);return r===null?null:r}function ke(e,t,n){let{headers:r,columns:i}=t;if(e.length===0)return i&&i.length>0?{keys:null,displayHeaders:i.map(e=>typeof e==`string`?e:e.header??e.key),rows:[]}:Array.isArray(r)?{keys:r,displayHeaders:r,rows:[]}:{keys:null,displayHeaders:null,rows:[]};let a=e[0];if(i&&i.length>0){let t=_e(i),r=t.keys,a=t.headers,o=[];for(let t=0;t<e.length;t++){let i=Oe(n,e[t],t);if(i===null)continue;let a;a=se(i)?fe(i,r):Array.isArray(i)?i:r.map(e=>i[e]),o.push(a)}return{keys:r,displayHeaders:a,rows:o}}if(se(a)){let t=e,i=r===!0?ue(t[0]):Array.isArray(r)?r:null,a=[];for(let e=0;e<t.length;e++){let r=Oe(n,t[e],e);if(r===null)continue;let o;o=se(r)?i?fe(r,i):le(r):Array.isArray(r)?r:i?i.map(e=>r[e]):Object.values(r),a.push(o)}return{keys:i,displayHeaders:i,rows:a}}if(!Array.isArray(a)&&typeof a==`object`){let t=e,i=r===!0?Object.keys(t[0]):Array.isArray(r)?r:null,a=[];for(let e=0;e<t.length;e++){let r=Oe(n,t[e],e);if(r===null)continue;let o=i?i.map(e=>r[e]):Object.values(r);a.push(o)}return{keys:i,displayHeaders:i,rows:a}}let o=e,s=Array.isArray(r)?r:null,c=[];for(let e=0;e<o.length;e++){let t=Oe(n,o[e],e);t!==null&&c.push(t)}return{keys:s,displayHeaders:s,rows:c}}function Ae(e,t={}){let n=re(t),{displayHeaders:r,rows:i}=ke(e,t,n),a=[],o=r?he(r):void 0;o&&n.writeHeaders&&a.push(De(o,n.regex,{quoteLookup:n.shouldQuoteHeader,delimiter:n.delimiter,headers:o,isHeader:!0,outputRowIndex:0,quoteAll:n.quoteAll,escapeFormulae:n.escapeFormulae,decimalSeparator:n.decimalSeparator,transform:void 0}));for(let e=0;e<i.length;e++)a.push(De(i[e],n.regex,{quoteLookup:n.shouldQuoteColumn,delimiter:n.delimiter,headers:o,isHeader:!1,outputRowIndex:e,quoteAll:n.quoteAll,escapeFormulae:n.escapeFormulae,decimalSeparator:n.decimalSeparator,transform:n.typeTransform}));let s=n.bom?``:``;return s+=a.join(n.lineEnding),a.length>0&&n.trailingNewline&&(s+=n.lineEnding),s}let je=/\r\n|\r|\n/,Me=null,Ne=null,Pe=null;function Fe(){return Me||(Me=new TextEncoder,Ne=new Uint8Array(4),Pe=new Uint8Array(4096)),Me}function Ie(e){let t=e.length;if(t===0)return 0;if(t===1)return e.charCodeAt(0)<128?1:Fe().encodeInto(e,Ne).written;let n=!0;for(let r=0;r<t;r++)if(e.charCodeAt(r)>=128){n=!1;break}if(n)return t;let r=Fe();return t*3>Pe.length&&(Pe=new Uint8Array(t*3)),r.encodeInto(e,Pe).written}let C=Array.from({length:60},(e,t)=>t<10?`0${t}`:`${t}`),w=(e,t)=>(e.charCodeAt(t)-48)*10+e.charCodeAt(t+1)-48|0,Le=(e,t)=>(e.charCodeAt(t)-48)*1e3+(e.charCodeAt(t+1)-48)*100+(e.charCodeAt(t+2)-48)*10+e.charCodeAt(t+3)-48|0,Re=[0,31,29,31,30,31,30,31,31,30,31,30,31];function ze(e,t,n){if(t<1||t>12||n<1||n>Re[t])return null;let r=new Date(e,t-1,n);return r.getMonth()===t-1?r:null}function Be(e,t,n,r,i,a){return t<1||t>12||n<1||n>Re[t]||r>23||i>59||a>59?null:new Date(e,t-1,n,r,i,a)}function Ve(e){return e.charCodeAt(4)!==45||e.charCodeAt(7)!==45?null:ze(Le(e,0),w(e,5),w(e,8))}function He(e){return e.charCodeAt(4)!==45||e.charCodeAt(7)!==45||e.charCodeAt(10)!==84||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58?null:Be(Le(e,0),w(e,5),w(e,8),w(e,11),w(e,14),w(e,17))}function Ue(e){return e.charCodeAt(4)!==45||e.charCodeAt(7)!==45||e.charCodeAt(10)!==32||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58?null:Be(Le(e,0),w(e,5),w(e,8),w(e,11),w(e,14),w(e,17))}function We(e){if(e.charCodeAt(19)!==90)return null;let t=new Date(e);return isNaN(t.getTime())?null:t}function Ge(e){if(e.charCodeAt(19)!==46||e.charCodeAt(23)!==90)return null;let t=new Date(e);return isNaN(t.getTime())?null:t}function Ke(e){let t=e.charCodeAt(19);if(t!==43&&t!==45)return null;let n=new Date(e);return isNaN(n.getTime())?null:n}function qe(e){if(e.charCodeAt(19)!==46)return null;let t=e.charCodeAt(23);if(t!==43&&t!==45)return null;let n=new Date(e);return isNaN(n.getTime())?null:n}function Je(e){let t=e.charCodeAt(2);return t!==45&&t!==47||e.charCodeAt(5)!==t?null:ze(Le(e,6),w(e,0),w(e,3))}function Ye(e){let t=e.charCodeAt(2);return t!==45&&t!==47||e.charCodeAt(5)!==t?null:ze(Le(e,6),w(e,3),w(e,0))}function Xe(e){let t=e.charCodeAt(2);return t!==45&&t!==47||e.charCodeAt(5)!==t||e.charCodeAt(10)!==32||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58?null:Be(Le(e,6),w(e,0),w(e,3),w(e,11),w(e,14),w(e,17))}function Ze(e){let t=e.charCodeAt(2);return t!==45&&t!==47||e.charCodeAt(5)!==t||e.charCodeAt(10)!==32||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58?null:Be(Le(e,6),w(e,3),w(e,0),w(e,11),w(e,14),w(e,17))}let Qe={"YYYY-MM-DD":Ve,"YYYY-MM-DD[T]HH:mm:ss":He,"YYYY-MM-DD HH:mm:ss":Ue,"YYYY-MM-DD[T]HH:mm:ssZ":e=>e.length===20?We(e):e.length===25?Ke(e):null,"YYYY-MM-DD[T]HH:mm:ss.SSSZ":e=>e.length===24?Ge(e):e.length===29?qe(e):null,"MM-DD-YYYY":Je,"MM-DD-YYYY HH:mm:ss":Xe,"MM/DD/YYYY HH:mm:ss":Xe,"DD-MM-YYYY":Ye,"DD-MM-YYYY HH:mm:ss":Ze,"DD/MM/YYYY HH:mm:ss":Ze},$e=[[10,[Ve]],[19,[He,Ue]],[20,[We]],[24,[Ge]],[25,[Ke]],[29,[qe]]];var et=class e{constructor(e){this.parse=e=>{if(!e)return null;let t=e.trim();if(!t)return null;if(this.single)return this.fn0(t);for(let e=0,n=this.fns.length;e<n;e++){let n=this.fns[e](t);if(n)return n}return null},this.fns=e,this.single=e.length===1,this.fn0=e[0]}static create(t){return new e(t.map(e=>Qe[e]).filter(Boolean))}static iso(){let t=[];for(let[,e]of $e)t.push(...e);return new e(t)}parseAll(e){let t=e.length,n=Array(t),r=this.parse;for(let i=0;i<t;i++)n[i]=r(e[i]);return n}parseValid(e){let t=[],n=this.parse;for(let r=0,i=e.length;r<i;r++){let i=n(e[r]);i&&t.push(i)}return t}};function tt(e){let t=-e.getTimezoneOffset(),n=t>=0?`+`:`-`,r=Math.abs(t)/60|0,i=Math.abs(t)%60;return`${n}${C[r]}:${C[i]}`}var nt=class e{constructor(e){this.format=e=>this.fn(e),this.fn=e}static iso(t=!1){return t?new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();if(Number.isNaN(t))return``;let n=e.getUTCFullYear(),r=e.getUTCMonth()+1,i=e.getUTCDate(),a=e.getUTCHours(),o=e.getUTCMinutes(),s=e.getUTCSeconds(),c=e.getUTCMilliseconds();return`${n}-${C[r]}-${C[i]}T${C[a]}:${C[o]}:${C[s]}.${c<10?`00`+c:c<100?`0`+c:c}Z`}):new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();if(Number.isNaN(t))return``;let n=e.getFullYear(),r=e.getMonth()+1,i=e.getDate(),a=e.getHours(),o=e.getMinutes(),s=e.getSeconds(),c=e.getMilliseconds();return`${n}-${C[r]}-${C[i]}T${C[a]}:${C[o]}:${C[s]}.${c<10?`00`+c:c<100?`0`+c:c}${tt(e)}`})}static create(t,n){let r=n?.utc??!1;if(t===`YYYY-MM-DD`)return r?new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return Number.isNaN(t)?``:`${e.getUTCFullYear()}-${C[e.getUTCMonth()+1]}-${C[e.getUTCDate()]}`}):new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return Number.isNaN(t)?``:`${e.getFullYear()}-${C[e.getMonth()+1]}-${C[e.getDate()]}`});if(t===`YYYY-MM-DD HH:mm:ss`)return r?new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return Number.isNaN(t)?``:`${e.getUTCFullYear()}-${C[e.getUTCMonth()+1]}-${C[e.getUTCDate()]} ${C[e.getUTCHours()]}:${C[e.getUTCMinutes()]}:${C[e.getUTCSeconds()]}`}):new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return Number.isNaN(t)?``:`${e.getFullYear()}-${C[e.getMonth()+1]}-${C[e.getDate()]} ${C[e.getHours()]}:${C[e.getMinutes()]}:${C[e.getSeconds()]}`});if(t===`MM-DD-YYYY`||t===`MM/DD/YYYY`){let n=t.charAt(2);return r?new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return Number.isNaN(t)?``:`${C[e.getUTCMonth()+1]}${n}${C[e.getUTCDate()]}${n}${e.getUTCFullYear()}`}):new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return Number.isNaN(t)?``:`${C[e.getMonth()+1]}${n}${C[e.getDate()]}${n}${e.getFullYear()}`})}if(t===`DD-MM-YYYY`||t===`DD/MM/YYYY`){let n=t.charAt(2);return r?new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return Number.isNaN(t)?``:`${C[e.getUTCDate()]}${n}${C[e.getUTCMonth()+1]}${n}${e.getUTCFullYear()}`}):new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return Number.isNaN(t)?``:`${C[e.getDate()]}${n}${C[e.getMonth()+1]}${n}${e.getFullYear()}`})}return e.createGeneric(t,r)}static createGeneric(t,n){let r=[],i=[],a=0;for(;a<t.length;)if(t[a]===`[`){let e=t.indexOf(`]`,a+1);e===-1?(i.push(t[a]),a++):(r.push(t.slice(a+1,e)),i.push(`\x00${r.length-1}\x00`),a=e+1)}else i.push(t[a]),a++;let o=i.join(``),s=o.includes(`YYYY`),c=o.includes(`SSS`),l=o.includes(`MM`),u=o.includes(`DD`),d=o.includes(`HH`),f=o.includes(`mm`),p=o.includes(`ss`),m=o.includes(`Z`);return new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();if(Number.isNaN(t))return``;let i=o;if(s&&(i=i.replace(/YYYY/g,String(n?e.getUTCFullYear():e.getFullYear()))),c){let t=n?e.getUTCMilliseconds():e.getMilliseconds();i=i.replace(/SSS/g,t<10?`00${t}`:t<100?`0${t}`:String(t))}return l&&(i=i.replace(/MM/g,C[n?e.getUTCMonth()+1:e.getMonth()+1])),u&&(i=i.replace(/DD/g,C[n?e.getUTCDate():e.getDate()])),d&&(i=i.replace(/HH/g,C[n?e.getUTCHours():e.getHours()])),f&&(i=i.replace(/mm/g,C[n?e.getUTCMinutes():e.getMinutes()])),p&&(i=i.replace(/ss/g,C[n?e.getUTCSeconds():e.getSeconds()])),m&&(i=i.replace(/Z/g,n?`Z`:tt(e))),r.length&&(i=i.replace(/\x00(\d+)\x00/g,(e,t)=>r[+t])),i})}formatAll(e){let t=e.length,n=Array(t),r=this.fn;for(let i=0;i<t;i++)n[i]=r(e[i]);return n}};function rt(){return Object.keys(Qe)}let it=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/,at=null;function ot(){return at||=et.iso(),at}function st(e){return!e||e.length<10?null:ot().parse(e)}function ct(e,t){return e?e===!0?!0:Array.isArray(e)&&typeof t==`string`?e.includes(t):!1:!1}function lt(e,t){return e===t||e===t-32}function ut(e){let t=e.length;if(t===0)return``;let n=e.charCodeAt(0);if(t===4){if((n===116||n===84)&<(e.charCodeAt(1),114)&<(e.charCodeAt(2),117)&<(e.charCodeAt(3),101))return!0;if((n===110||n===78)&<(e.charCodeAt(1),117)&<(e.charCodeAt(2),108)&<(e.charCodeAt(3),108))return null}else if(t===5&&(n===102||n===70)&<(e.charCodeAt(1),97)&<(e.charCodeAt(2),108)&<(e.charCodeAt(3),115)&<(e.charCodeAt(4),101))return!1;if(n>=48&&n<=57||n===45||n===46||n===73||n===78){if(e.charCodeAt(t-1)<=32)return e;if(e===`Infinity`)return 1/0;if(e===`-Infinity`)return-1/0;if(e===`NaN`)return NaN;if(n===48&&t>1){let t=e.charCodeAt(1);if(t>=48&&t<=57)return e}if(n===45&&t>2&&e.charCodeAt(1)===48){let t=e.charCodeAt(2);if(t>=48&&t<=57)return e}if(it.test(e)){let t=Number(e);if(!isNaN(t))return t}}return e}function dt(e){return typeof e==`function`}function ft(e,t){return t===!1?e:dt(t)?t(e):ut(e)}function pt(e,t,n,r){if(ct(r,t)){let t=st(e);if(t!==null)return t}if(n===!0)return ut(e);if(n===!1||t===void 0)return e;let i=n[t];return i===void 0?e:ft(e,i)}function mt(e,t,n){if(t===!1&&!n)return e;for(let r in e)Object.hasOwn(e,r)&&(e[r]=pt(e[r],r,t,n));return e}function ht(e,t,n,r){return n===!1&&!r||n!==!0&&n!==!1&&!t?e:e.map((e,i)=>{let a=t?.[i];return pt(e,a,n,r)})}function gt(e,t,n){let{headers:r,groupColumnsByName:i=!1}=t;if(n!==null&&Array.isArray(r))return null;let a,o;if(typeof r==`function`){if(a=r(e),a.length!==e.length)throw new u(`Header function returned ${a.length} headers but row has ${e.length} columns. The header function must return an array with the same length as the input row.`);o=!0}else if(Array.isArray(r))a=r,o=!1;else if(r)a=e,o=!0;else return null;let{headers:s,renamedHeaders:c}=ge(a);return{headers:s,originalHeaders:i?a.map(e=>e==null?null:String(e)):null,renamedHeaders:c,skipCurrentRow:o}}function _t(e,t,n){let{columnLess:r,columnMore:i}=n,a=e.length;if(a===t)return{isValid:!0,modified:!1};if(a>t)switch(i){case`error`:return{isValid:!1,errorCode:`TooManyFields`,reason:`expected ${t} columns, got ${a}`,modified:!1};case`truncate`:return e.length=t,{isValid:!0,errorCode:`TooManyFields`,modified:!0};case`keep`:return{isValid:!0,errorCode:`TooManyFields`,modified:!0,extras:e.splice(t)};default:throw Error(`Unknown columnMore strategy: ${i}`)}switch(r){case`error`:return{isValid:!1,errorCode:`TooFewFields`,reason:`expected ${t} columns, got ${a}`,modified:!1};case`pad`:for(;e.length<t;)e.push(``);return{isValid:!0,errorCode:`TooFewFields`,modified:!0};default:throw Error(`Unknown columnLess strategy: ${r}`)}}function vt(e){return e?(t,n)=>{try{e(t,n)}catch{}}:null}function yt(e,t){let n=Object.create(null);for(let r=0;r<t.length;r++){let i=t[r];i!=null&&i!==`__proto__`&&(n[i]=e[r]??``)}return n}function bt(e,t,n,r){return r&&n?xt(e,n):yt(e,t)}function xt(e,t){let n=Object.create(null);for(let r=0;r<t.length;r++){let i=t[r];if(i!=null&&i!==`__proto__`){let t=e[r]??``;if(i in n){let e=n[i];Array.isArray(e)?e.push(t):n[i]=[e,t]}else n[i]=t}}return n}function St(e){return e.filter(e=>e!=null)}function Ct(e){let{input:t,options:n,detectedDelimiter:r}=e,{delimiter:i=`,`,delimitersToGuess:a,lineEnding:o=``,quote:s=`"`,escape:c,skipEmptyLines:l=!1,trim:d=!1,ltrim:m=!1,rtrim:h=!1,headers:_=!1,comment:b,maxRows:x,toLine:S,skipLines:ee=0,skipRows:te=0,columnMismatch:ne,groupColumnsByName:re=!1,fastMode:ie=!1,dynamicTyping:ae,castDate:oe,beforeFirstChunk:se,info:ce=!1,raw:le=!1,relaxQuotes:ue=!1,skipRecordsWithError:de=!1,skipRecordsWithEmptyValues:fe=!1,onSkip:pe,maxRowBytes:me}=n,he=ne?.less??`error`,ge=ne?.more??`error`,_e;if(t!==void 0){if(_e=t,se){let e=se(_e);if(typeof e==`string`)_e=e;else if(e!=null)throw new u(`beforeFirstChunk must return a string or undefined, got ${typeof e}`)}_e=g(_e)}let ve=l,{enabled:ye,char:be}=f(s),xe=p(c,be),Se=xe.enabled?xe.char||be:``,Ce;Ce=r===void 0?i===``&&_e!==void 0?y(_e,be||`"`,a,b,ve):i===``?`,`:i:r;let we=o||(_e===void 0?`
|
|
18
|
+
`:v(_e));return{config:{delimiter:Ce,linebreak:we,linebreakRegex:we&&we!==`
|
|
19
|
+
`&&we!==`\r
|
|
20
|
+
`&&we!==`\r`?we:je,quote:be,escape:Se,quoteEnabled:ye,trimField:Et(d,m,h),trimFieldIsIdentity:!d&&!m&&!h,shouldSkipEmpty:ve,skipLines:ee,skipRows:te,maxRows:x,toLine:S,maxRowBytes:me,comment:b,fastMode:ie,relaxQuotes:ue,columnLess:he,columnMore:ge,groupColumnsByName:re,skipRecordsWithError:de,skipRecordsWithEmptyValues:fe,infoOption:ce,rawOption:le,dynamicTyping:ae,castDate:oe,invokeOnSkip:vt(pe),headers:_},processedInput:_e}}function wt(e,t){let n=Ct({input:e,options:t});return{config:n.config,processedInput:n.processedInput}}function Tt(e){return{delimiter:e.delimiter,quote:e.quote,escape:e.escape,quoteEnabled:e.quoteEnabled,relaxQuotes:e.relaxQuotes}}function Et(e,t,n){return e||t&&n?e=>e.trim():t?e=>e.trimStart():n?e=>e.trimEnd():e=>e}let Dt=new WeakMap;function Ot(e){let t=Dt.get(e);return t||(t=new RegExp(e.source,`${e.flags.replace(/g/g,``)}g`),Dt.set(e,t)),t}function*kt(e,t){if(e!==``)if(typeof t==`string`){let n=t;if(n===``){yield{line:e,lineEndingLength:0,lineLengthWithEnding:e.length};return}let r=0;for(;;){let t=e.indexOf(n,r);if(t===-1){if(r===e.length)return;let t=e.slice(r);yield{line:t,lineEndingLength:0,lineLengthWithEnding:t.length};return}let i=e.slice(r,t),a=n.length;yield{line:i,lineEndingLength:a,lineLengthWithEnding:i.length+a},r=t+n.length}}else{let n=t.global?t:Ot(t),r=0;for(n.lastIndex=0;;){let t=n.exec(e);if(!t)break;let i=t.index,a=i+t[0].length,o=e.slice(r,i),s=t[0].length;yield{line:o,lineEndingLength:s,lineLengthWithEnding:o.length+s},r=a,t[0].length===0&&n.lastIndex++}if(r===e.length)return;let i=e.slice(r);yield{line:i,lineEndingLength:0,lineLengthWithEnding:i.length}}}function At(e,t,n){let r=gt(e,{headers:n.headers,groupColumnsByName:n.groupColumnsByName},t.headerRow);return r?(t.headerRow=r.headers,t.originalHeaders=r.originalHeaders,t.renamedHeadersForMeta=r.renamedHeaders,t.headerRowProcessed=!0,r.skipCurrentRow):(t.headerRowProcessed=!0,!1)}function jt(e,t,n){if(!t.headerRow||t.headerRow.length===0)return null;let r=t.headerRow.length,i=e.length;if(i===r)return null;let a=_t(e,r,{columnLess:n.columnLess,columnMore:n.columnMore});return a.errorCode?{errorCode:a.errorCode,message:a.errorCode===`TooManyFields`?`Too many fields: expected ${r}, found ${i}`:`Too few fields: expected ${r}, found ${i}`,isValid:a.isValid,reason:a.reason,extras:a.extras}:null}function Mt(e,t,n,r){let i={index:t,line:e.currentRowStartLine,offset:e.currentRowStartOffset,quoted:e.currentRowQuoted.slice(0,r)};return n&&(i.raw=e.currentRawRow),i}function Nt(e,t,n){if(t.headerRow){let r=bt(e,t.headerRow,t.originalHeaders,n.groupColumnsByName);return(n.dynamicTyping||n.castDate)&&(r=mt(r,n.dynamicTyping||!1,n.castDate)),r}let r={};for(let t=0;t<e.length;t++)r[t]=e[t];return r}function Pt(e,t,n,r){return!!(t&&e[0]?.trimStart().startsWith(t)||ye(e,n)||r&&be(e))}function Ft(e,t,n,r,i){if(t.useHeaders&&!t.headerRowProcessed&&At(e,t,n))return{stop:!1,skipped:!0};if(t.skippedDataRows<n.skipRows)return t.skippedDataRows++,{stop:!1,skipped:!0};let a=jt(e,t,n),o;if(a){let t={code:a.errorCode,message:a.message,line:i};if(r.push(t),!a.isValid)return n.skipRecordsWithError?(n.invokeOnSkip?.({code:a.errorCode,message:a.reason||`Column mismatch`,line:i},e),{stop:!1,skipped:!0,row:e,error:{code:a.errorCode,message:a.reason||`Column mismatch`,line:i},reason:a.reason||`Column mismatch`}):{stop:!1,skipped:!0,row:e,error:t,reason:a.reason||`Column mismatch`};o=a.extras}if(n.skipRecordsWithEmptyValues&&be(e))return{stop:!1,skipped:!0};if(n.maxRows!==void 0&&t.dataRowCount>=n.maxRows)return t.truncated=!0,{stop:!0,skipped:!1};t.dataRowCount++;let s;return n.infoOption&&(s=Mt(t,t.dataRowCount-1,n.rawOption,e.length)),{stop:!1,skipped:!1,row:e,info:s,extras:o}}let It={delimiter:`,`,quote:`"`,escape:`"`,quoteEnabled:!0,relaxQuotes:!1};function Lt(){return{buffer:``,position:0}}function Rt(e,t){let n=e.length,r=e.indexOf(`
|
|
21
21
|
`,t),i=e.indexOf(`\r`,t);return r===-1&&i===-1?[-1,0]:i===-1||r!==-1&&r<i?[r,1]:i+1<n?e[i+1]===`
|
|
22
|
-
`?[i,2]:[i,1]:[i,-1]}function
|
|
23
|
-
`||n===`\r`)return{value:f(l),quoted:!0,endPos:l+1,needMore:!1};if(s){l>d&&(u??=[]).push(e.slice(d,l)),(u??=[]).push(i),l++,d=l;continue}return{value:f(l),quoted:!0,endPos:l+1,needMore:!1}}}if(n===i&&a!==i){if(l+1>=c)return r?{value:f(l),quoted:!0,endPos:l+1,needMore:!1}:{value:f(l),quoted:!0,endPos:l,needMore:!0,resumePos:t};let n=e[l+1];if((o.length===1?n===o:
|
|
22
|
+
`?[i,2]:[i,1]:[i,-1]}function zt(e,t,n){return n.length===1?e[t]===n:e.startsWith(n,t)}function Bt(e,t,n){return e.indexOf(n,t)}function Vt(e,t,n,r){let{quote:i,escape:a,delimiter:o,relaxQuotes:s}=n,c=e.length,l=t+1,u=null,d=l,f=t=>{let n=t>d?e.slice(d,t):``;return u===null?n:(n&&u.push(n),u.length===1?u[0]:u.join(``))};for(;l<c;){let n=e[l];if(a&&n===a){if(l+1<c&&e[l+1]===i){l>d&&(u??=[]).push(e.slice(d,l)),(u??=[]).push(i),l+=2,d=l;continue}if(a!==i&&l+1<c&&e[l+1]===a){l>d&&(u??=[]).push(e.slice(d,l)),(u??=[]).push(a),l+=2,d=l;continue}if(a===i){if(l+1>=c)return r?{value:f(l),quoted:!0,endPos:l+1,needMore:!1}:{value:f(l),quoted:!0,endPos:l,needMore:!0,resumePos:t};let n=e[l+1];if((o.length===1?n===o:zt(e,l+1,o))||n===`
|
|
23
|
+
`||n===`\r`)return{value:f(l),quoted:!0,endPos:l+1,needMore:!1};if(s){l>d&&(u??=[]).push(e.slice(d,l)),(u??=[]).push(i),l++,d=l;continue}return{value:f(l),quoted:!0,endPos:l+1,needMore:!1}}}if(n===i&&a!==i){if(l+1>=c)return r?{value:f(l),quoted:!0,endPos:l+1,needMore:!1}:{value:f(l),quoted:!0,endPos:l,needMore:!0,resumePos:t};let n=e[l+1];if((o.length===1?n===o:zt(e,l+1,o))||n===`
|
|
24
24
|
`||n===`\r`)return{value:f(l),quoted:!0,endPos:l+1,needMore:!1};if(s){l>d&&(u??=[]).push(e.slice(d,l)),(u??=[]).push(i),l++,d=l;continue}return{value:f(l),quoted:!0,endPos:l+1,needMore:!1}}if(n===`\r`){if(l+1<c){if(e[l+1]===`
|
|
25
25
|
`){l>d&&(u??=[]).push(e.slice(d,l)),(u??=[]).push(`
|
|
26
26
|
`),l+=2,d=l;continue}l>d&&(u??=[]).push(e.slice(d,l)),(u??=[]).push(`
|
|
27
27
|
`),l++,d=l;continue}if(!r)return{value:f(l),quoted:!0,endPos:l,needMore:!0,resumePos:t};l>d&&(u??=[]).push(e.slice(d,l)),(u??=[]).push(`
|
|
28
|
-
`),l++,d=l;continue}l++}return r?{value:f(l),quoted:!0,endPos:l,needMore:!1,unterminated:!0}:{value:f(l),quoted:!0,endPos:l,needMore:!0,resumePos:t}}function
|
|
28
|
+
`),l++,d=l;continue}l++}return r?{value:f(l),quoted:!0,endPos:l,needMore:!1,unterminated:!0}:{value:f(l),quoted:!0,endPos:l,needMore:!0,resumePos:t}}function Ht(e,t,n,r){let{delimiter:i}=n,a=e.length,o=Bt(e,t,i),[s,c]=Rt(e,t),l,u=!1;return o===-1&&s===-1?r?{value:e.slice(t),quoted:!1,endPos:a,needMore:!1}:{value:e.slice(t),quoted:!1,endPos:a,needMore:!0,resumePos:t}:(o===-1?(l=s,u=!0):s===-1||o<s?l=o:(l=s,u=!0),u&&c===-1&&!r?{value:e.slice(t,l),quoted:!1,endPos:l,needMore:!0,resumePos:t}:{value:e.slice(t,l),quoted:!1,endPos:l,needMore:!1})}function Ut(e,t,n,r,i,a){let{delimiter:o,quote:s,quoteEnabled:c}=n,l=o.length,u=e.length,d=i??[],f=a??[];i&&(i.length=0),a&&(a.length=0);let p=t,m=!1,h=t;for(;p<u;){let i=e[p];if(c&&i===s){let i=Vt(e,p,n,r);if(i.needMore)return{fields:d,quoted:f,endPos:p,complete:!1,needMore:!0,resumePos:i.resumePos??t,rawStart:h,rawEnd:p};if(i.unterminated&&(m=!0),d.push(i.value),f.push(!0),p=i.endPos,p<u){if(zt(e,p,o)){p+=l,p>=u&&r&&(d.push(``),f.push(!1));continue}let n=e[p];if(n===`
|
|
29
29
|
`)return{fields:d,quoted:f,endPos:p+1,complete:!0,needMore:!1,newline:`
|
|
30
30
|
`,rawStart:h,rawEnd:p};if(n===`\r`)return p+1<u?e[p+1]===`
|
|
31
31
|
`?{fields:d,quoted:f,endPos:p+2,complete:!0,needMore:!1,newline:`\r
|
|
32
|
-
`,rawStart:h,rawEnd:p}:{fields:d,quoted:f,endPos:p+1,complete:!0,needMore:!1,newline:`\r`,rawStart:h,rawEnd:p}:r?{fields:d,quoted:f,endPos:p+1,complete:!0,needMore:!1,newline:`\r`,rawStart:h,rawEnd:p}:{fields:d,quoted:f,endPos:p,complete:!1,needMore:!0,resumePos:t,rawStart:h,rawEnd:p};for(p++;p<u;){if(
|
|
33
|
-
`||e[p]===`\r`)break;p++}continue}continue}let a=
|
|
32
|
+
`,rawStart:h,rawEnd:p}:{fields:d,quoted:f,endPos:p+1,complete:!0,needMore:!1,newline:`\r`,rawStart:h,rawEnd:p}:r?{fields:d,quoted:f,endPos:p+1,complete:!0,needMore:!1,newline:`\r`,rawStart:h,rawEnd:p}:{fields:d,quoted:f,endPos:p,complete:!1,needMore:!0,resumePos:t,rawStart:h,rawEnd:p};for(p++;p<u;){if(zt(e,p,o)){p+=l;break}if(e[p]===`
|
|
33
|
+
`||e[p]===`\r`)break;p++}continue}continue}let a=Ht(e,p,n,r);if(a.needMore)return d.push(a.value),f.push(!1),{fields:d,quoted:f,endPos:a.endPos,complete:!1,needMore:!0,resumePos:a.resumePos??t,rawStart:h,rawEnd:a.endPos};if(d.push(a.value),f.push(!1),p=a.endPos,p<u){if(zt(e,p,o)){p+=l,p>=u&&r&&(d.push(``),f.push(!1));continue}let t=e[p];if(t===`
|
|
34
34
|
`)return{fields:d,quoted:f,endPos:p+1,complete:!0,needMore:!1,newline:`
|
|
35
35
|
`,rawStart:h,rawEnd:p};if(t===`\r`)return p+1<u&&e[p+1]===`
|
|
36
36
|
`?{fields:d,quoted:f,endPos:p+2,complete:!0,needMore:!1,newline:`\r
|
|
37
|
-
`,rawStart:h,rawEnd:p}:{fields:d,quoted:f,endPos:p+1,complete:!0,needMore:!1,newline:`\r`,rawStart:h,rawEnd:p}}}return r&&(d.length>0||p>t)?{fields:d,quoted:f,endPos:p,complete:!0,needMore:!1,unterminatedQuote:m||void 0,rawStart:h,rawEnd:p}:{fields:d,quoted:f,endPos:p,complete:!1,needMore:!r,resumePos:t,unterminatedQuote:m||void 0,rawStart:h,rawEnd:p}}function Ut(e){let t={...Ft,...e},n=It(),r=[],i=[];return{get config(){return t},scanRow(e,n=0,r=!1){return Ht(e,n,t,r)},feed(e){n.buffer+=e},nextRow(){if(n.position>=n.buffer.length)return null;let e=Ht(n.buffer,n.position,t,!1,r,i);if(e.needMore)return null;if(e.complete){e.raw=n.buffer.slice(e.rawStart,e.rawEnd),n.position=e.endPos;let t=n.position,r=n.buffer.length;return(t>65536||t>r/2&&t>4096)&&(n.buffer=n.buffer.slice(n.position),n.position=0),e}return null},flush(){if(n.position>=n.buffer.length)return null;let e=Ht(n.buffer,n.position,t,!0,r,i);return e.fields.length===0&&e.endPos===n.position?null:(e.raw=n.buffer.slice(e.rawStart,e.rawEnd),n.position=e.endPos,e)},reset(){n=It(),r.length=0,i.length=0},getBuffer(){return n.buffer.slice(n.position)}}}function Wt(e){let t={lineNumber:0,dataRowCount:0,skippedDataRows:0,truncated:!1,headerRow:null,originalHeaders:null,useHeaders:!1,headerRowProcessed:!1,renamedHeadersForMeta:null,currentRowStartLine:+!!e.infoOption,currentRowStartOffset:0,currentRowQuoted:[],currentRawRow:``},{headers:n,groupColumnsByName:r}=e;if(n===!0)t.useHeaders=!0;else if(Array.isArray(n)){let e=ht([],{headers:n,groupColumnsByName:r},null);e&&(t.headerRow=e.headers,t.originalHeaders=e.originalHeaders,t.renamedHeadersForMeta=e.renamedHeaders),t.useHeaders=!0,t.headerRowProcessed=!0}else typeof n==`function`&&(t.useHeaders=!0);return t}function Gt(e,t,n,r,i){t&&(e.currentRowQuoted=[],e.currentRowStartLine=r,e.currentRowStartOffset=i),n&&(e.currentRawRow=``)}let Kt=Object.freeze(Array(256).fill(!1));function qt(e){return e<=256?Kt:Array(e).fill(!1)}function Jt(e){return typeof e==`boolean`?{isValid:e,reason:`Validation failed`}:{isValid:e.isValid,reason:e.reason||`Validation failed`}}function Yt(e,t,n){return mt(e,null,t||!1,n)}function Xt(e){return e.length>0?e:void 0}function Zt(e,t){return{delimiter:e.delimiter,linebreak:e.linebreak,aborted:!1,truncated:t.truncated,cursor:t.dataRowCount,fields:t.headerRow?xt(t.headerRow):void 0,renamedHeaders:t.renamedHeadersForMeta}}function Qt(e,t){return t.trimFieldIsIdentity?e:e.map(t.trimField)}function*$t(e,t,n,r){if(e===``)return;let i=0;for(let{line:a,lineLengthWithEnding:o}of Ot(e,t.linebreakRegex)){if(n.lineNumber++,t.toLine!==void 0&&n.lineNumber>t.toLine){n.truncated=!0;break}if(n.lineNumber<=t.skipLines){i+=o;continue}if(a===``&&t.shouldSkipEmpty){i+=o;continue}if(t.maxRowBytes!==void 0&&Fe(a)>t.maxRowBytes)throw Error(`Row exceeds the maximum size of ${t.maxRowBytes} bytes`);t.infoOption&&(n.currentRowStartLine=n.lineNumber,n.currentRowStartOffset=i),t.rawOption&&(n.currentRawRow=a);let e=Qt(a.split(t.delimiter),t);if(t.infoOption&&(n.currentRowQuoted=qt(e.length)),t.comment&&e[0]?.trimStart().startsWith(t.comment)){i+=o;continue}if(t.shouldSkipEmpty&&ve(e,t.shouldSkipEmpty)){i+=o;continue}let s=Pt(e,n,t,r,n.lineNumber);if(i+=o,s.stop){yield s;return}(!s.skipped||s.error)&&(yield s),Gt(n,t.infoOption,t.rawOption,n.lineNumber+1,i)}}function*en(e,t,n,r){let i=wt(t),a=e.length,o=0;for(t.infoOption&&(n.currentRowStartOffset=0);o<a;){let a=Ht(e,o,i,!0);if(a.fields.length===0&&a.endPos===o)break;let s=Qt(a.fields,t),c=n.lineNumber+1;{let t=a.rawStart,r=a.rawEnd,i=1;for(let n=t;n<r;n++){let t=e.charCodeAt(n);t===10?i++:t===13&&(n+1<r&&e.charCodeAt(n+1)===10&&n++,i++)}n.lineNumber+=i}if(t.toLine!==void 0&&n.lineNumber>t.toLine){n.truncated=!0;break}let l=a.rawEnd;if(n.lineNumber<=t.skipLines){o=a.endPos;continue}if(t.maxRowBytes!==void 0&&Fe(e.slice(a.rawStart,l))>t.maxRowBytes)throw Error(`Row exceeds the maximum size of ${t.maxRowBytes} bytes`);if(t.comment&&s[0]?.trimStart().startsWith(t.comment)){o=a.endPos;continue}if(t.shouldSkipEmpty&&ve(s,t.shouldSkipEmpty)){o=a.endPos;continue}t.infoOption&&(n.currentRowStartLine=c,n.currentRowStartOffset=a.rawStart,n.currentRowQuoted=a.quoted),t.rawOption&&(n.currentRawRow=e.slice(a.rawStart,l)),a.unterminatedQuote&&r.push({code:`MissingQuotes`,message:`Quoted field unterminated`,line:n.lineNumber});let u=Pt(s,n,t,r,n.lineNumber);if(u.stop){yield u;return}(!u.skipped||u.error)&&(yield u),o=a.endPos,t.infoOption&&(n.currentRowStartOffset=a.endPos)}}function tn(e,t={}){let{config:n,processedInput:r}=Ct(e,t),i=Wt(n),a=[],o=[],s=n.fastMode?$t(r,n,i,a):en(r,n,i,a);if(!i.useHeaders){let e=[];for(let r of s){if(r.row&&!r.skipped){let i=r.row;if(t.rowTransform){let e=t.rowTransform(i);if(e==null)continue;i=e}if(t.validate){let{isValid:e,reason:n}=Jt(t.validate(i));if(!e){o.push({row:i,reason:n});continue}}(n.dynamicTyping||n.castDate)&&(i=Yt(i,n.dynamicTyping,n.castDate)),n.infoOption&&r.info?e.push({record:i,info:r.info}):e.push(i)}else r.row&&r.skipped&&r.error&&o.push({row:r.row,reason:r.reason||r.error.message});if(r.stop)break}let r=Zt(n,i);return n.infoOption||t.validate?{headers:void 0,rows:e,invalidRows:Xt(o),errors:Xt(a),meta:r}:e}let c=[];for(let e of s){if(e.row&&!e.skipped){let r=Mt(e.row,i,n);if(e.extras&&e.extras.length>0&&(r._extra=e.extras),t.rowTransform){let e=t.rowTransform(r);if(e==null)continue;r=e}if(t.validate){let{isValid:n,reason:i}=Jt(t.validate(r));if(!n){o.push({row:e.row,reason:i});continue}}n.infoOption&&e.info?c.push({record:r,info:e.info}):c.push(r)}else e.row&&e.skipped&&e.error&&o.push({row:e.row,reason:e.reason||e.error.message});if(e.stop)break}let l=Zt(n,i),{objname:u}=t;if(u&&i.headerRow){let e=Object.create(null);for(let t of c){let r=(n.infoOption?t.record:t)[u],i=r==null?``:String(r);i!==`__proto__`&&(e[i]=t)}return{headers:l.fields,rows:e,invalidRows:Xt(o),errors:Xt(a),meta:l}}return{headers:l.fields,rows:c,invalidRows:Xt(o),errors:Xt(a),meta:l}}function nn(e){return!!e&&typeof e==`object`&&typeof e.getReader==`function`}function rn(e){return!!e&&typeof e==`object`&&typeof e.getWriter==`function`}function an(e){return!!e&&typeof e==`object`&&!!e.readable&&!!e.writable&&nn(e.readable)&&rn(e.writable)}let on=new TextEncoder,sn=new TextDecoder(`utf-8`,{ignoreBOM:!0}),cn=new Map;function ln(e){let t=(e??`utf-8`).trim().toLowerCase();return t===``||t===`utf8`||t===`utf-8`?`utf-8`:t===`utf16le`||t===`utf-16le`||t===`ucs2`||t===`ucs-2`?`utf-16le`:t===`binary`?`latin1`:t}function un(e){let t=ln(e);if(t===`utf-8`)return sn;let n=cn.get(t);return n||(n=dn(t),cn.set(t,n)),n}function dn(e,t){try{return new TextDecoder(e,t)}catch(t){throw TypeError(`Unsupported text encoding: ${e}`,{cause:t})}}function fn(e){let t=ln(e);switch(t){case`hex`:return new pn;case`base64`:return new _n(!1);case`base64url`:return new _n(!0);case`ascii`:return new vn;default:return dn(t,{ignoreBOM:!0})}}var pn=class{decode(e){let t=``;for(let n=0;n<e.length;n++)t+=mn[e[n]];return t}};let mn=(()=>{let e=Array(256);for(let t=0;t<256;t++)e[t]=t.toString(16).padStart(2,`0`);return e})(),hn=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,gn=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`;var _n=class{constructor(e){this._remainder=null,this._chars=e?gn:hn}decode(e,t){let n;if(this._remainder){let t=new Uint8Array(this._remainder.length+e.length);t.set(this._remainder),t.set(e,this._remainder.length),n=t}else n=e;if(t?.stream??!1){let e=n.length%3,t=n.length-e;return this._remainder=e>0?n.slice(t):null,t>0?this._encodeBytes(n,t):``}return this._remainder=null,n.length>0?this._encodeBytes(n,n.length):``}_encodeBytes(e,t){let n=this._chars,r=n===gn,i=``,a=0;for(;a+2<t;a+=3){let t=e[a],r=e[a+1],o=e[a+2];i+=n[t>>>2]+n[(t&3)<<4|r>>>4]+n[(r&15)<<2|o>>>6]+n[o&63]}let o=t-a;if(o===1){let t=e[a];i+=n[t>>>2]+n[(t&3)<<4],r||(i+=`==`)}else if(o===2){let t=e[a],o=e[a+1];i+=n[t>>>2]+n[(t&3)<<4|o>>>4]+n[(o&15)<<2],r||(i+=`=`)}return i}},vn=class{decode(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]&127);return t}};function yn(e){let t=``;for(let n=0;n<e.length;n++)t+=mn[e[n]];return t}function bn(e,t){let n=t?gn:hn,r=``,i=0;for(;i+2<e.length;i+=3){let t=e[i],a=e[i+1],o=e[i+2];r+=n[t>>>2]+n[(t&3)<<4|a>>>4]+n[(a&15)<<2|o>>>6]+n[o&63]}let a=e.length-i;if(a===1){let a=e[i];r+=n[a>>>2]+n[(a&3)<<4],t||(r+=`==`)}else if(a===2){let a=e[i],o=e[i+1];r+=n[a>>>2]+n[(a&3)<<4|o>>>4]+n[(o&15)<<2],t||(r+=`=`)}return r}function xn(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]&127);return t}function Sn(e,t){let n=ln(t);switch(n){case`hex`:return yn(e);case`base64`:return bn(e,!1);case`base64url`:return bn(e,!0);case`ascii`:return xn(e);default:return un(n).decode(e)}}function Cn(e){return on.encode(e)}function wn(e,t){return un(t).decode(e)}function E(e,t){let n=e.length;if(n===0)return new Uint8Array;if(n===1){let t=e[0];return t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}if(t===void 0){let r=0;for(let t=0;t<n;t++)r+=e[t].length;t=r}let r=new Uint8Array(t),i=0;for(let t=0;t<n;t++){let n=e[t];r.set(n,i),i+=n.length}return r}function Tn(e){if(e instanceof Uint8Array)return e;if(typeof e==`string`)return on.encode(e);if(e instanceof ArrayBuffer||Array.isArray(e))return new Uint8Array(e);throw TypeError(`Expected Uint8Array, got ${typeof e}`)}function En(e){let t=globalThis.Buffer;return t?t.from(e.buffer,e.byteOffset,e.byteLength):e}async function*Dn(e){let t=e.getReader();try{for(;;){let e=await t.read();if(e.done)return;e.value!==void 0&&e.value!==null&&(yield e.value)}}finally{try{await t.cancel?.()}catch{}try{t.releaseLock?.()}catch{}}}function On(e){return e?16:65536}var kn=class extends n{constructor(e,t){super(e,t),this.name=`StreamError`}},An=class extends kn{constructor(e,t,n){super(`Cannot ${e}: ${t}`,n),this.operation=e,this.state=t,this.name=`StreamStateError`}},jn=class extends kn{constructor(e,t,n){super(`Expected ${e}, got ${t}`,n),this.expectedType=e,this.actualType=t,this.name=`StreamTypeError`}};let Mn=e=>Array.isArray(e);var D=class e{constructor(){this.__excelts_stream=!0,this._listeners=new Map,this._maxListeners=e.defaultMaxListeners}static{this.defaultMaxListeners=10}addListener(e,t){return this.on(e,t)}_listenerCount(e){return e?Mn(e)?e.length:1:0}_hasListeners(e){return this._listenerCount(this._listeners.get(e))>0}on(e,t){e!==`newListener`&&this._hasListeners(`newListener`)&&this.emit(`newListener`,e,t);let n=this._listeners.get(e);if(this._maxListeners>0){let t=this._listenerCount(n);t>=this._maxListeners&&console?.warn?.(`MaxListenersExceededWarning: Possible EventEmitter memory leak detected. ${t+1} ${String(e)} listeners added. Use emitter.setMaxListeners() to increase limit`)}return n?Mn(n)?n.push(t):this._listeners.set(e,[n,t]):this._listeners.set(e,t),this}prependListener(e,t){e!==`newListener`&&this._hasListeners(`newListener`)&&this.emit(`newListener`,e,t);let n=this._listeners.get(e);return n?Mn(n)?n.unshift(t):this._listeners.set(e,[t,n]):this._listeners.set(e,t),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return n.listener=t,this.on(e,n)}prependOnceListener(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return n.listener=t,this.prependListener(e,n)}removeListener(e,t){return this.off(e,t)}off(e,t){let n=this._listeners.get(e);if(!n)return this;if(!Mn(n))return(n===t||n.listener===t)&&(this._listeners.delete(e),e!==`removeListener`&&this._hasListeners(`removeListener`)&&this.emit(`removeListener`,e,t)),this;let r=n;if(r.length===0)return this._listeners.delete(e),this;let i=r.lastIndexOf(t);if(i!==-1)r.splice(i,1);else for(let e=r.length-1;e>=0;e--)if(r[e].listener===t){r.splice(e,1);break}return r.length===0?this._listeners.delete(e):r.length===1&&this._listeners.set(e,r[0]),e!==`removeListener`&&this._hasListeners(`removeListener`)&&this.emit(`removeListener`,e,t),this}emit(e,...t){let n=this._listeners.get(e);if(!n){if(e===`error`){let e=t[0];if(e instanceof Error)throw e;let n=`Unhandled error.${e===void 0?` (undefined)`:` (${e})`}`;throw Error(n)}return!1}if(!Mn(n))return n.apply(this,t),!0;let r=n,i=r.length;if(i===0){if(e===`error`){let e=t[0];if(e instanceof Error)throw e;let n=`Unhandled error.${e===void 0?` (undefined)`:` (${e})`}`;throw Error(n)}return!1}if(i===1)return r[0].apply(this,t),!0;let a=r.slice();for(let e=0;e<a.length;e++)a[e].apply(this,t);return!0}removeAllListeners(e){if(e!==void 0){if(e!==`removeListener`&&this._hasListeners(`removeListener`)){let t=this._listeners.get(e);if(t){let n=Mn(t)?t.slice():[t];this._listeners.delete(e);for(let t of n){let n=t.listener??t;this.emit(`removeListener`,e,n)}return this}}this._listeners.delete(e)}else{if(this._hasListeners(`removeListener`)){let e=[...this._listeners.keys()];for(let t of e)if(t!==`removeListener`){let e=this._listeners.get(t);if(e){let n=Mn(e)?e.slice():[e];this._listeners.delete(t);for(let e of n){let n=e.listener??e;this.emit(`removeListener`,t,n)}}}}this._listeners.clear()}return this}listenerCount(e){return this._listenerCount(this._listeners.get(e))}listeners(e){let t=this._listeners.get(e);return t?(Mn(t)?t:[t]).map(e=>e.listener??e):[]}rawListeners(e){let t=this._listeners.get(e);return t?Mn(t)?t.slice():[t]:[]}eventNames(){return[...this._listeners.keys()]}setMaxListeners(e){return this._maxListeners=e,this}getMaxListeners(){return this._maxListeners}};D.prototype.addListener=D.prototype.on,D.prototype.removeListener=D.prototype.off;function Nn(e,t){let n=(t??`utf-8`).trim().toLowerCase();switch(n){case``:case`utf8`:case`utf-8`:return on.encode(e);case`latin1`:case`binary`:{let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&255;return t}case`ascii`:{let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&127;return t}case`hex`:{let t=e.length>>>1,n=new Uint8Array(t);for(let r=0;r<t;r++)n[r]=parseInt(e.substring(r*2,r*2+2),16);return n}case`base64`:{let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}case`base64url`:{let t=e.replace(/-/g,`+`).replace(/_/g,`/`);for(;t.length%4!=0;)t+=`=`;let n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}case`utf16le`:case`utf-16le`:case`ucs2`:case`ucs-2`:{let t=new Uint8Array(e.length*2);for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[n*2]=r&255,t[n*2+1]=r>>>8&255}return t}default:throw Pn(n)}}function Pn(e){let t=TypeError(`Unknown encoding: ${e}`);return t.code=`ERR_UNKNOWN_ENCODING`,t}function Fn(e,t,n){return{chunk:typeof e==`function`?void 0:e,encoding:typeof t==`string`?t:void 0,cb:typeof e==`function`?e:typeof t==`function`?t:n}}let In=0;function O(e){queueMicrotask(()=>{In++;try{e()}finally{In--}})}function Ln(){return In>0}let Rn=null;function zn(){return Rn}function Bn(e){Rn=e}var Vn=class{constructor(e){this._items=[],this._index=0,this._front=[],this._byteSize=0,this._objectMode=e}_chunkSize(e){return e instanceof Uint8Array?e.byteLength:1}get length(){return this._front.length+(this._items.length-this._index)}get byteSize(){return this._byteSize}push(e){this._items.push(e),this._objectMode||(this._byteSize+=this._chunkSize(e))}shift(){let e;return this._front.length>0?e=this._front.pop():(e=this._items[this._index++],this._index===this._items.length?(this._items.length=0,this._index=0):this._index>1024&&this._index*2>this._items.length&&(this._items=this._items.slice(this._index),this._index=0)),this._objectMode||(this._byteSize-=this._chunkSize(e)),e}unshift(e){this._index===0?this._front.push(e):(this._index--,this._items[this._index]=e),this._objectMode||(this._byteSize+=this._chunkSize(e))}peek(){let e=this._front.length;return e>0?this._front[e-1]:this._index<this._items.length?this._items[this._index]:null}toArray(){let e=this._front.length,t=this._items.length-this._index,n=Array(e+t);for(let t=0;t<e;t++)n[t]=this._front[e-1-t];for(let r=0;r<t;r++)n[e+r]=this._items[this._index+r];return n}clear(){this._items.length=0,this._index=0,this._front.length=0,this._byteSize=0}consumeBytes(e){if(e===0)return new Uint8Array;let t=this.peek();if(t instanceof Uint8Array&&t.byteLength===e)return this.shift();if(t instanceof Uint8Array&&t.byteLength>e){this._shiftFrontChunk();let n=t.subarray(0,e),r=t.subarray(e);return this.unshift(r),n}let n=new Uint8Array(e),r=0;for(;r<e;){let t=this.shift();if(t instanceof Uint8Array){let i=e-r;t.byteLength<=i?(n.set(t,r),r+=t.byteLength):(n.set(t.subarray(0,i),r),this.unshift(t.subarray(i)),r+=i)}}return n}consumeAll(){let e=this._front.length,t=e+(this._items.length-this._index);if(t===0)return new Uint8Array;if(t===1)return this.shift();let n=this._byteSize,r=new Uint8Array(n),i=0;for(let t=e-1;t>=0;t--){let e=this._front[t];e instanceof Uint8Array&&(r.set(e,i),i+=e.byteLength)}for(let e=this._index;e<this._items.length;e++){let t=this._items[e];t instanceof Uint8Array&&(r.set(t,i),i+=t.byteLength)}return this.clear(),r}_shiftFrontChunk(){return this.shift()}};let Hn=(e,t,n)=>{typeof e.off==`function`?e.off(t,n):typeof e.removeListener==`function`&&e.removeListener(t,n)},Un=(e,t,n,r)=>(r?.once?typeof e.once==`function`&&e.once(t,n):typeof e.on==`function`&&e.on(t,n),()=>Hn(e,t,n)),Wn=()=>{let e=[];return{add:(t,n,r)=>{e.push(Un(t,n,r))},once:(t,n,r)=>{e.push(Un(t,n,r,{once:!0}))},cleanup:()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}};var Gn=class{constructor(e){this._source=e,this._destinations=[],this._listeners=new Map,this._sourceOverride=null}setSource(e){this._sourceOverride=e}get _emitSource(){return this._sourceOverride??this._source}pipe(e,t){let n=e,r=n,i=typeof n?.write==`function`,a=typeof n?.end==`function`,o=typeof r?.on==`function`,s=typeof r?.once==`function`,c=typeof r?.off==`function`;if(!i||!a||!s&&!o||!c&&!r?.removeListener)throw new jn(`Writable`,typeof n);this._destinations.push(n);let l,u=()=>{l&&=(Hn(r,`drain`,l),void 0)},d=e=>{if(!n.write(e)&&(this._source.pause(),!l)){l=()=>{u(),this._source.resume()},r.on(`drain`,l);let e=this._listeners.get(n);e&&(e.drain=l)}},f=t?.end===!1?void 0:()=>{n.end()},p=()=>{this.unpipe(n)},m=typeof r.once==`function`?`once`:`on`;return r[m](`close`,p),r[m](`finish`,p),this._listeners.set(n,{data:d,end:f,destClose:p,destFinish:p,eventTarget:r}),this._source.on(`data`,d),f&&this._source.once(`end`,f),r.emit?.(`pipe`,this._emitSource),this._source.resume(),e}unpipe(e){if(e){let t=this._destinations.indexOf(e);t!==-1&&(this._destinations.splice(t,1),this._removeListeners(e),this._destinations.length===0&&this._source.pause())}else{let e=this._destinations.length>0;for(let e of this._destinations)this._removeListeners(e);this._destinations=[],e&&this._source.pause()}}_removeListeners(e){let t=this._listeners.get(e);t&&(this._source.off(`data`,t.data),t.end&&this._source.off(`end`,t.end),t.drain&&Hn(t.eventTarget,`drain`,t.drain),t.destClose&&Hn(t.eventTarget,`close`,t.destClose),t.destFinish&&Hn(t.eventTarget,`finish`,t.destFinish),t.eventTarget.emit?.(`unpipe`,this._emitSource),this._listeners.delete(e))}};function Kn(e){return Sn(this,e??`utf-8`)}var k=class e extends D{static[Symbol.hasInstance](t){return typeof t!=`object`||!t?!1:Object.prototype.isPrototypeOf.call(e.prototype,t)?!0:t.__excelts_stream===!0&&typeof t.read==`function`&&typeof t.pipe==`function`&&typeof t.on==`function`&&`readableFlowing`in t}constructor(e){super(),this._reader=null,this._reading=!1,this._ended=!1,this._endEmitted=!1,this._destroyed=!1,this._internalDestroy=!1,this._errored=null,this._closed=!1,this._flowing=!1,this._resumeScheduled=!1,this._hasFlowed=!1,this._encoding=null,this._decoder=null,this._didRead=!1,this._pushMode=!1,this._webStreamMode=!1,this._hasReadImpl=!1,this._constructed=!0,this._asyncIterState=null,this.__excelts_stream=!0,this._objectMode=e?.objectMode??!1,this._highWaterMark=e?.highWaterMark??On(this._objectMode),this._buf=new Vn(this._objectMode),this._pipes=new Gn(this),this._autoDestroy=e?.autoDestroy??!0,this._emitClose=e?.emitClose??!0,e?.read?(this._read=e.read.bind(this),this._hasReadImpl=!0,this._pushMode=!0):this._hasSubclassRead()&&(this._hasReadImpl=!0,this._pushMode=!0),e?.destroy&&(this._destroy=e.destroy.bind(this)),e?.construct&&(this._constructFunc=e.construct.bind(this)),e?.stream?(this._stream=e.stream,this._webStreamMode=!0):this._stream=null,e?.encoding&&this.setEncoding(e.encoding),e?.signal&&this._setupAbortSignal(e.signal),this._maybeConstruct()}_maybeConstruct(){(this._constructFunc||this._hasSubclassConstruct())&&(this._constructed=!1,O(()=>{(this._constructFunc??this._construct.bind(this))(e=>{if(e){this.destroy(e);return}this._constructed=!0,this._hasReadImpl&&this._flowing&&!this._ended&&!this._destroyed&&this._callRead(this._highWaterMark)})}))}_hasSubclassConstruct(){let t=Object.getPrototypeOf(this);for(;t&&t!==e.prototype&&t!==Object.prototype;){if(Object.prototype.hasOwnProperty.call(t,`_construct`))return!0;t=Object.getPrototypeOf(t)}return!1}_hasSubclassRead(){let t=Object.getPrototypeOf(this);for(;t&&t!==e.prototype&&t!==Object.prototype;){if(Object.prototype.hasOwnProperty.call(t,`_read`))return!0;t=Object.getPrototypeOf(t)}return!1}_setupAbortSignal(e){if(e.aborted){this.destroy(i(e.reason));return}let t=()=>{r(),this.destroy(i(e.reason))},n=()=>{r()},r=()=>{e.removeEventListener(`abort`,t),this.off(`close`,n),this.off(`end`,n),this.off(`error`,n)};e.addEventListener(`abort`,t,{once:!0}),this.on(`close`,n),this.on(`end`,n),this.on(`error`,n)}static from(t,n){if(t&&typeof t.getReader==`function`)return e.fromWeb(t,n);if(typeof Blob<`u`&&t instanceof Blob)return e.fromWeb(t.stream(),n);if(t==null||typeof t!=`object`&&typeof t!=`string`){let e=TypeError(`The "iterable" argument must be an instance of Iterable. Received type ${typeof t} (${String(t)})`);throw e.code=`ERR_INVALID_ARG_TYPE`,e}let r=typeof t[Symbol.iterator]==`function`,i=typeof t[Symbol.asyncIterator]==`function`;if(!r&&!i&&typeof t!=`string`){let e=t?.constructor?.name??`Object`,n=TypeError(`The "iterable" argument must be an instance of Iterable. Received an instance of ${e}`);throw n.code=`ERR_INVALID_ARG_TYPE`,n}let a=new e({...n,objectMode:n?.objectMode??!0}),o=t;return $n(a,Qn(typeof o==`string`?[o]:o)),a}static isDisturbed(e){return e._didRead||(e._destroyed||e._errored!==null)&&!e._endEmitted}static isReadable(e){if(typeof e!=`object`||!e)return null;let t=e;return typeof t.read==`function`?t.destroyed||t._destroyed||t.readableEnded||t._endEmitted?!1:t.readable!==!1:null}static fromWeb(t,n){return new e({...n,stream:t})}static toWeb(e){return e._webStream}static wrap(t,n){return new e({objectMode:t.readableObjectMode??t.objectMode??!0,...n,destroy(e,n){typeof t.destroy==`function`&&t.destroy(e??void 0),n(e)}}).wrap(t)}push(e,t){if(this._destroyed)return!1;if(this._pushMode=!0,e!==null&&typeof e==`string`&&!this._objectMode){let n=Nn(e,t||`utf8`);n.toString=Kn,e=n}if(this._ended&&e!==null){let e=Error(`stream.push() after EOF`);return e.code=`ERR_STREAM_PUSH_AFTER_EOF`,O(()=>this.emit(`error`,e)),!1}if(e===null)return this._ended?!1:(this._ended=!0,this._buf.length===0&&O(()=>this._emitEndOnce()),!1);if(!this._objectMode&&(typeof e==`string`?e.length:e?.byteLength??e?.length??0)===0)return!0;if(this._flowing)return this._buf.length>0?(this._buf.push(e),this._objectMode?this._buf.length<this._highWaterMark:this._buf.byteSize<this._highWaterMark):(this._didRead=!0,this.emit(`data`,this._applyEncoding(e)),this._flowing?(this._hasReadImpl&&!this._ended&&O(()=>{this._flowing&&!this._ended&&!this._destroyed&&(this._callRead(this._highWaterMark),this._ended&&this._buf.length===0&&this._emitEndOnce())}),!0):!1);{let t=this._buf.length===0;return this._buf.push(e),t&&O(()=>this.emit(`readable`)),this._objectMode?this._buf.length<this._highWaterMark:this._buf.byteSize<this._highWaterMark}}_emitEndOnce(){if(this._endEmitted||this._destroyed||this._buf.length>0)return;let e=this._flushDecoder();e&&this.emit(`data`,e),this._endEmitted=!0,this.emit(`end`),this._autoDestroy&&this.destroy()}unshift(e,t){if(this._destroyed)return;if(e===null){this._ended||(this._ended=!0,this._buf.length===0&&O(()=>this._emitEndOnce()));return}if(this._endEmitted){let e=Error(`stream.unshift() after end event`);e.code=`ERR_STREAM_UNSHIFT_AFTER_END_EVENT`,O(()=>this.emit(`error`,e));return}if(typeof e==`string`&&!this._objectMode){let n=Nn(e,t||`utf8`);n.toString=Kn,e=n}let n=this._buf.length===0;this._buf.unshift(e),this._flowing?O(()=>{for(;this._buf.length>0&&this._flowing;){let e=this._buf.shift();this._didRead=!0,this.emit(`data`,this._applyEncoding(e))}this._ended&&this._buf.length===0&&this._emitEndOnce()}):n&&O(()=>this.emit(`readable`))}_callRead(e){try{this._read(e)}catch(e){let t=e instanceof Error?e:Error(String(e));this._internalDestroy=!0,this.destroy(t)}}read(e){this._didRead=!0;let t;if(e!=null){if(t=parseInt(e,10),isNaN(t))t=void 0;else if(t<=0){if(t===0&&!this._ended&&!this._destroyed&&this._constructed){let e=this._objectMode?this._buf.length:this._buf.byteSize;(e<this._highWaterMark||e===0)&&this._callRead(this._highWaterMark)}return null}}if(this._buf.length===0)return!this._ended&&!this._destroyed&&this._constructed&&this._callRead(this._highWaterMark),null;if(this._objectMode){let e=this._buf.shift();return this._ended&&this._buf.length===0&&O(()=>this._emitEndOnce()),this._hasReadImpl&&!this._ended&&!this._destroyed&&this._constructed&&this._buf.length<this._highWaterMark&&O(()=>{!this._ended&&!this._destroyed&&this._callRead(this._highWaterMark)}),e}let n;if(t==null)n=this._applyEncoding(this._buf.consumeAll());else if(this._buf.byteSize<t)if(this._ended)n=this._applyEncoding(this._buf.consumeAll());else return this._hasReadImpl&&this._constructed&&this._callRead(Math.max(t,this._highWaterMark)),null;else n=this._applyEncoding(this._buf.consumeBytes(t));return this._hasReadImpl&&!this._ended&&!this._destroyed&&this._buf.byteSize<this._highWaterMark&&O(()=>{!this._ended&&!this._destroyed&&this._callRead(this._highWaterMark)}),this._ended&&this._buf.length===0&&O(()=>this._emitEndOnce()),!this._flowing&&this._buf.length>0&&O(()=>this.emit(`readable`)),n}_flushDecoder(){if(!this._decoder)return null;let e=this._decoder.decode(new Uint8Array,{stream:!1});return this._decoder=null,e||null}setEncoding(e){return this._encoding=e,this._decoder=fn(e),this}_applyEncoding(e){return this._encoding&&e instanceof Uint8Array?(this._decoder||=fn(this._encoding),this._decoder.decode(e,{stream:!0})):e}wrap(e){let t=!1;return e.on(`data`,n=>{this.push(n)||(e.pause(),t=!0)}),e.on(`end`,()=>this.push(null)),e.on(`error`,e=>this.destroy(e)),e.on(`close`,()=>this.destroy()),this._hasReadImpl=!0,this._read=()=>{t&&(t=!1,e.resume())},this}pause(){return this._flowing?(this._flowing=!1,this.emit(`pause`)):this._hasFlowed=!0,this}resume(){return this._flowing||(this._flowing=!0,this._hasFlowed=!0,this._resumeScheduled||(this._resumeScheduled=!0,O(()=>{this._resumeScheduled=!1,this.emit(`resume`)}))),this._buf.length>0?O(()=>{for(;this._buf.length>0&&this._flowing;){let e=this._buf.shift();this._didRead=!0,this.emit(`data`,this._applyEncoding(e))}if(this._ended&&this._buf.length===0&&this._emitEndOnce(),this._flowing&&this._buf.length===0&&this._webStreamMode&&!this._pushMode&&!this._ended&&!this._destroyed&&this._startReading(),this._hasReadImpl&&this._flowing&&!this._ended&&!this._destroyed&&this._constructed){let e=this._objectMode?this._buf.length:this._buf.byteSize;(e<this._highWaterMark||e===0)&&this._callRead(this._highWaterMark)}}):this._ended&&this._buf.length===0?O(()=>this._emitEndOnce()):this._webStreamMode&&!this._pushMode?this._startReading():this._hasReadImpl&&O(()=>{this._flowing&&!this._ended&&!this._destroyed&&this._constructed&&(this._callRead(this._highWaterMark),this._ended&&this._buf.length===0&&this._emitEndOnce())}),this}on(e,t){return super.on(e,t),e===`data`?this.resume():e===`readable`&&(this._hasFlowed=!0,this._flowing=!1,(this._buf.length>0||this._ended)&&O(()=>this.emit(`readable`))),this}isPaused(){return this.readableFlowing===!1}pipe(e,t){return this._pipes.pipe(e,t)}unpipe(e){return this._pipes.unpipe(e),this}destroy(e){if(this._destroyed)return this;if(this._destroyed=!0,this._readableOverride=void 0,this.unpipe(),this._reader){let e=this._reader;this._reader=null,e.cancel().catch(()=>{}).finally(()=>{try{e.releaseLock()}catch{}})}let t=e=>{let t=e||null;t&&(this._errored=t),this._closed=!0;let n=()=>{t&&this.emit(`error`,t),this._emitClose&&this.emit(`close`)},r=this._endEmitted||this._internalDestroy;this._internalDestroy=!1,Ln()&&!this._hasDestroyHook()&&r?n():O(n)};if(this._hasDestroyHook())try{this._destroy(e??null,t)}catch(e){t(e instanceof Error?e:Error(String(e)))}else t(e);return this}_destroy(e,t){t(e)}_undestroy(){this._destroyed=!1,this._closed=!1,this._errored=null}_hasDestroyHook(){return Object.prototype.hasOwnProperty.call(this,`_destroy`)||Object.getPrototypeOf(this)._destroy!==e.prototype._destroy}get _webStream(){if(this._stream)return this._stream;let e=this,t=!1,n=new ReadableStream({pull(n){return new Promise((r,i)=>{if(t)return r();let a=()=>{if(e._destroyed){if(e._errored){t=!0;try{n.error(e._errored)}catch{}return i(e._errored)}t=!0;try{n.close()}catch{}return r()}let o=e.read();if(o!==null){try{n.enqueue(o)}catch{}return r()}if(e._endEmitted){t=!0;try{n.close()}catch{}return r()}let s=()=>{d(),a()},c=()=>{d(),t=!0;try{n.close()}catch{}r()},l=e=>{d(),t=!0;try{n.error(e)}catch{}i(e)},u=()=>{if(d(),!t){t=!0;try{n.close()}catch{}}r()},d=()=>{e.off(`readable`,s),e.off(`end`,c),e.off(`error`,l),e.off(`close`,u)};e.once(`readable`,s),e.once(`end`,c),e.once(`error`,l),e.once(`close`,u)};a()})},cancel(){e.destroy()}});return this._stream=n,n}get readable(){return this._readableOverride===void 0?!this._destroyed&&!this._endEmitted:this._readableOverride}set readable(e){this._readableOverride=e}get readableEnded(){return this._endEmitted}get readableLength(){return this._objectMode?this._buf.length:this._buf.byteSize}get destroyed(){return this._destroyed}set destroyed(e){this._destroyed=e}get errored(){return this._errored}get closed(){return this._closed}get readableFlowing(){return this._flowing?!0:this._hasFlowed?!1:null}set readableFlowing(e){e===!0?(this._flowing=!0,this._hasFlowed=!0):e===!1?(this._flowing=!1,this._hasFlowed=!0):(this._flowing=!1,this._hasFlowed=!1)}_setReadableFlowing(e){this.readableFlowing=e}get readableAborted(){return this._readableOverride===!1?!1:(this._destroyed||!!this._errored)&&!this._endEmitted}get readableDidRead(){return this._didRead}get readableEncoding(){return this._encoding}get readableObjectMode(){return this._objectMode}get readableHighWaterMark(){return this._highWaterMark}get readableBuffer(){return this._buf.toArray()}_releaseReader(){if(this._reader){let e=this._reader;this._reader=null;try{e.releaseLock()}catch{}}}async _startReading(){if(!(this._reading||this._destroyed||!this._flowing)){this._reading=!0;try{for(this._reader||=this._stream.getReader();this._flowing&&!this._destroyed&&!this._pushMode;){let{done:e,value:t}=await this._reader.read();if(this._pushMode){this._releaseReader();break}if(e){this._ended=!0,this._buf.length===0&&O(()=>this._emitEndOnce()),this._releaseReader();break}if(t!==void 0){let e=this._buf.length===0;for(this._buf.push(t),e&&O(()=>this.emit(`readable`));this._buf.length>0&&this._flowing;){let e=this._buf.shift();this._didRead=!0,this.emit(`data`,this._applyEncoding(e))}if(!this._flowing)break}}}catch(e){this.emit(`error`,e),this._releaseReader()}finally{this._reading=!1}}}async*[Symbol.asyncIterator](){this._asyncIterState||=this._initAsyncIterState();let e=this._asyncIterState;e.activeCount++;try{for(;;){if(e.streamError)throw e.streamError;if(e.dataQueueIndex<e.dataQueue.length){let t=e.dataQueue[e.dataQueueIndex];e.dataQueue[e.dataQueueIndex]=void 0,e.dataQueueIndex++,e.queuedSize-=this._chunkSizeForBackpressure(t),e.dataQueueIndex>=1024&&e.dataQueueIndex*2>=e.dataQueue.length&&(e.dataQueue.splice(0,e.dataQueueIndex),e.dataQueueIndex=0),this._maybeResumeIterState(e),yield t;continue}if(e.done)break;let t=await new Promise((t,n)=>{e.resolverQueue.push({resolve:t,reject:n})});if(t===null)break;yield t}}finally{e.activeCount--,e.activeCount===0&&this._teardownAsyncIterState(),this._destroyed||this.destroy()}}_chunkSizeForBackpressure(e){return this._objectMode?1:e instanceof Uint8Array?e.byteLength:typeof e==`string`?e.length:1}_maybeResumeIterState(e){e.pausedByIterator&&e.queuedSize<this._highWaterMark&&!e.done&&!this._destroyed&&(e.pausedByIterator=!1,this.resume())}_initAsyncIterState(){let e=this._highWaterMark,t={dataQueue:[],dataQueueIndex:0,queuedSize:0,resolverQueue:[],done:!1,streamError:null,activeCount:0,listenersAttached:!1,pausedByIterator:!1,dataHandler:null,doneHandler:null,errorHandler:null};for(t.dataHandler=n=>{if(t.resolverQueue.length>0){let{resolve:e}=t.resolverQueue.shift();e(n);return}t.dataQueue.push(n),t.queuedSize+=this._chunkSizeForBackpressure(n),!t.pausedByIterator&&t.queuedSize>=e&&(t.pausedByIterator=!0,this.pause())},t.doneHandler=()=>{t.done=!0;for(let{resolve:e}of t.resolverQueue)e(null);t.resolverQueue.length=0},t.errorHandler=e=>{t.done=!0,t.streamError=e;for(let{reject:n}of t.resolverQueue)n(e);t.resolverQueue.length=0};this._buf.length>0;){let e=this._applyEncoding(this._buf.shift());t.dataQueue.push(e),t.queuedSize+=this._chunkSizeForBackpressure(e)}if(this._ended){let e=this._flushDecoder();e&&(t.dataQueue.push(e),t.queuedSize+=this._chunkSizeForBackpressure(e)),t.done=!0}else this.on(`data`,t.dataHandler),this.on(`end`,t.doneHandler),this.on(`error`,t.errorHandler),this.on(`close`,t.doneHandler),t.listenersAttached=!0,this.resume();return t}_teardownAsyncIterState(){let e=this._asyncIterState;e&&(e.listenersAttached&&(this.off(`data`,e.dataHandler),this.off(`end`,e.doneHandler),this.off(`error`,e.errorHandler),this.off(`close`,e.doneHandler)),this._asyncIterState=null)}[Symbol.dispose](){this._destroyed||this.destroy()}async[Symbol.asyncDispose](){let e=!this._destroyed;return e&&this.destroy(),new Promise((t,n)=>{let r=()=>{e||this._endEmitted?t():n(Error(`Premature close`))};this._closed?r():this.once(`close`,r)})}iterator(e){if(e?.destroyOnReturn??!0)return this[Symbol.asyncIterator]();let t=this,n=null,r=null,i=!1,a=null,s=()=>{if(!n)return;let e=t.read();if(e!==null){let t=n;n=null,r=null,t({done:!1,value:e})}},c=()=>{s()},l=()=>{if(i=!0,n){let e=n;n=null,r=null,e({done:!0,value:void 0})}},u=e=>{if(i=!0,a=e,r){let t=r;n=null,r=null,t(e)}};t.on(`readable`,c),t.on(`end`,l),t.on(`error`,u);let d=()=>{t.off(`readable`,c),t.off(`end`,l),t.off(`error`,u)};return{next:async()=>{if(a)throw o(a);let e=t.read();return e===null?i?(d(),{done:!0,value:void 0}):new Promise((e,t)=>{n=e,r=t,s()}):{done:!1,value:e}},return:async e=>(d(),{done:!0,value:e}),throw:async e=>(d(),t.destroy(e),{done:!0,value:void 0}),[Symbol.asyncIterator](){return this}}}map(t,n){let r=n?.signal;qn(r);let a=n?.concurrency??1,o=new AbortController,s=o.signal,c=new e({objectMode:!0});return $n(c,(async function*(e){try{yield*Zn(e,e=>t(e,{signal:s}),a,r)}finally{o.abort()}})(this)),c.once(`close`,()=>{this.destroyed||this.destroy()}),r&&r.addEventListener(`abort`,()=>{c.destroy(i())},{once:!0}),c}filter(t,n){let r=n?.signal;qn(r);let a=n?.concurrency??1,o=new AbortController,s=o.signal,c=new e({objectMode:!0}),l=Symbol(`skip`);return $n(c,(async function*(e){try{if(a<=1)for await(let n of e)Jn(r),await t(n,{signal:s})&&(yield n);else for await(let n of Zn(e,async e=>await t(e,{signal:s})?e:l,a,r))n!==l&&(yield n)}finally{o.abort()}})(this)),c.once(`close`,()=>{this.destroyed||this.destroy()}),r&&r.addEventListener(`abort`,()=>{c.destroy(i())},{once:!0}),c}async forEach(e,t){let n=t?.signal;qn(n);let r=t?.concurrency??1,i=new AbortController,a=i.signal;try{if(r<=1)for await(let t of this)Jn(n),await e(t,{signal:a});else for await(let t of Zn(this,async t=>{await e(t,{signal:a})},r,n));}finally{i.abort()}}async toArray(e){let t=e?.signal;qn(t);let n=[];for await(let e of this)Jn(t),n.push(e);return n}async some(e,t){let n=t?.signal;qn(n);let r=t?.concurrency??1,i=new AbortController,a=i.signal;try{if(r<=1){for await(let t of this)if(Jn(n),await e(t,{signal:a}))return this.destroy(),!0}else for await(let t of Zn(this,t=>e(t,{signal:a}),r,n))if(t)return this.destroy(),!0;return!1}finally{i.abort()}}async find(e,t){let n=t?.signal;qn(n);let r=t?.concurrency??1,i=new AbortController,a=i.signal;try{if(r<=1){for await(let t of this)if(Jn(n),await e(t,{signal:a}))return this.destroy(),t}else for await(let t of Zn(this,async t=>({chunk:t,match:await e(t,{signal:a})}),r,n))if(t.match)return this.destroy(),t.chunk;return}finally{i.abort()}}async every(e,t){let n=t?.signal;qn(n);let r=t?.concurrency??1,i=new AbortController,a=i.signal;try{if(r<=1){for await(let t of this)if(Jn(n),!await e(t,{signal:a}))return this.destroy(),!1}else for await(let t of Zn(this,t=>e(t,{signal:a}),r,n))if(!t)return this.destroy(),!1;return!0}finally{i.abort()}}flatMap(t,n){let r=n?.signal;qn(r);let a=n?.concurrency??1,o=new AbortController,s=o.signal,c=new e({objectMode:!0});return $n(c,(async function*(e){try{if(a<=1)for await(let n of e){Jn(r);let e=await t(n,{signal:s});if(e&&typeof e[Symbol.asyncIterator]==`function`)for await(let t of e)yield t;else if(e&&typeof e[Symbol.iterator]==`function`)for(let t of e)yield t}else for await(let n of Zn(e,async e=>{let n=await t(e,{signal:s}),r=[];if(n&&typeof n[Symbol.asyncIterator]==`function`)for await(let e of n)r.push(e);else if(n&&typeof n[Symbol.iterator]==`function`)for(let e of n)r.push(e);return r},a,r))for(let e of n)yield e}finally{o.abort()}})(this)),c.once(`close`,()=>{this.destroyed||this.destroy()}),r&&r.addEventListener(`abort`,()=>{c.destroy(i())},{once:!0}),c}drop(t,n){let r=n?.signal;qn(r),Yn(t,`limit`);let a=new e({objectMode:!0});return $n(a,(async function*(e){let n=0;for await(let i of e)Jn(r),n>=t&&(yield i),n++})(this)),a.once(`close`,()=>{this.destroyed||this.destroy()}),r&&r.addEventListener(`abort`,()=>{a.destroy(i())},{once:!0}),a}take(t,n){let r=n?.signal;qn(r),Yn(t,`limit`);let a=new e({objectMode:!0});return $n(a,(async function*(e){let n=0;for await(let i of e){if(Jn(r),n>=t)break;yield i,n++}})(this)),a.once(`close`,()=>{this.destroyed||this.destroy()}),r&&r.addEventListener(`abort`,()=>{a.destroy(i())},{once:!0}),a}async reduce(e,t,n){let r=n?.signal;qn(r);let i=new AbortController,a=i.signal,o,s=arguments.length>=2,c=!0;try{for await(let n of this){if(Jn(r),c&&!s){o=n,c=!1;continue}c&&=(o=t,!1),o=await e(o,n,{signal:a})}if(c&&!s)throw TypeError(`Reduce of an empty stream requires an initial value`);return c?t:o}finally{i.abort()}}asIndexedPairs(e){let t=0;return this.map(e=>[t++,e],e)}compose(t,n){if(typeof t==`function`){let n=new e({objectMode:!0});$n(n,t(this)),n.once(`close`,()=>{this.destroyed||this.destroy()});let r=zn();return r?r(n):n}let r=t;if(this.pipe(r),r._readable&&r._writable)return r;if(r._readable){let e=zn();return e?e(r._readable):r._readable}let i=zn();return i?i(r):r}};k.prototype.addListener=k.prototype.on,k.prototype._read=function(e){let t=Error(`The _read() method is not implemented`);throw t.code=`ERR_METHOD_NOT_IMPLEMENTED`,t};function qn(e){if(e!==void 0&&!(e instanceof AbortSignal))throw TypeError(`options.signal must be an AbortSignal`)}function Jn(e){if(e?.aborted)throw i(e.reason)}function Yn(e,t){if(typeof e!=`number`||Number.isNaN(e)||e<0||Math.floor(e)!==e)throw RangeError(`The value of "${t}" must be a non-negative integer. Received ${e}`)}let Xn=Symbol(`EOF`);async function*Zn(e,t,n,r){if(n<=1){for await(let n of e)Jn(r),yield await t(n);return}let i=[],a=null,s=!1,c=e[Symbol.asyncIterator]();async function l(){let e=await c.next();return e.done?(s=!0,Xn):(Jn(r),t(e.value))}function u(){i.push(l().catch(e=>{throw a=e,e}))}try{for(;i.length<n&&!s&&!a;)Jn(r),u();for(;i.length>0;){Jn(r);let e=await i.shift();if(a)throw o(a);e!==Xn&&(yield e,!s&&!a&&u())}}finally{s||await c.return?.()}}function Qn(e){return e&&typeof e[Symbol.asyncIterator]==`function`?e:(async function*(){for(let t of e)yield t})()}function $n(e,t){let n=t[Symbol.asyncIterator](),r=!1,i=!1;e._hasReadImpl=!0,e._read=function(){r||i||(r=!0,(async()=>{try{if(e.destroyed){if(!i){i=!0;let e=n.return?.();e&&typeof e.then==`function`&&e.catch(()=>{})}return}let{value:t,done:r}=await n.next();if(r){i=!0,e.push(null);return}e.push(t)}catch(t){e.destroy(t)}finally{r=!1}})())},e._pushMode=!0}function er(e){return Sn(this,e??`utf-8`)}var A=class e extends D{static[Symbol.hasInstance](t){return typeof t!=`object`||!t?!1:Object.prototype.isPrototypeOf.call(e.prototype,t)?!0:t.__excelts_stream===!0&&typeof t.write==`function`&&typeof t.end==`function`&&typeof t.on==`function`&&`writableFinished`in t}constructor(e){if(super(),this._stream=null,this._writer=null,this._ended=!1,this._finished=!1,this._syncFinish=!1,this._destroyed=!1,this._errored=null,this._errorEmitted=!1,this._closed=!1,this._writableLength=0,this._needDrain=!1,this._corked=0,this._corkedChunks=[],this._defaultEncoding=`utf8`,this._ownsStream=!1,this._directWrite=!1,this._writeQueue=[],this._writing=!1,this._pendingEnd=null,this._constructed=!0,this._resolvedWritev=null,this.__excelts_stream=!0,this._objectMode=e?.objectMode??!1,this._highWaterMark=e?.highWaterMark??On(this._objectMode),this._autoDestroy=e?.autoDestroy??!0,this._emitClose=e?.emitClose??!0,this._decodeStrings=e?.decodeStrings??!0,this._defaultEncoding=e?.defaultEncoding??`utf8`,e?.stream)this._stream=e.stream,this._ownsStream=!1,this._directWrite=!1;else{if(e?.write&&(this._writeFunc=e.write.bind(this)),e?.final)this._finalFunc=e.final.bind(this);else{let e=this._getSubclassFinal();e&&(this._finalFunc=e)}if(e?.destroy&&(this._destroy=e.destroy.bind(this)),e?.construct&&(this._constructFunc=e.construct.bind(this)),e?.writev&&(this._writevFunc=e.writev.bind(this)),this._ownsStream=!0,this._writeFunc)this._directWrite=!0,this._stream=null;else{let t=e?.construct||this._hasSubclassConstruct(),n=this._getSubclassWrite();t&&n?(this._writeFunc=n,this._directWrite=!0,this._stream=null):(this._directWrite=!1,this._stream=new WritableStream({write:async e=>{this._write&&await new Promise((t,n)=>{this._write(e,`utf8`,e=>{e?n(e):t()})})},close:async()=>{if(this._finalFunc){let e=await new Promise(e=>{this._finalFunc(t=>{e(t??null)})});if(e){this._errored=e,this._errorEmitted=!0,this.emit(`error`,e),this._autoDestroy&&this.destroy(e);return}}this._finished=!0,this.emit(`finish`),this._autoDestroy&&this.destroy()},abort:e=>{this.emit(`error`,e)}}))}}e?.signal&&this._setupAbortSignal(e.signal),this._resolvedWritev=this._writevFunc??this._getWritevHook(),this._maybeConstruct()}_maybeConstruct(){(this._constructFunc||this._hasSubclassConstruct())&&(this._constructed=!1,O(()=>{(this._constructFunc??this._construct.bind(this))(e=>{if(e){this.destroy(e);return}if(this._constructed=!0,this._directWrite&&this._writeQueue.length>0&&!this._writing)this._writing=!0,this._drainWriteQueue();else if(this._pendingEnd&&!this._writing){let{cb:e}=this._pendingEnd;this._pendingEnd=null,this._doFinish(e)}})}))}_hasSubclassConstruct(){let t=Object.getPrototypeOf(this);for(;t&&t!==e.prototype&&t!==Object.prototype;){if(Object.prototype.hasOwnProperty.call(t,`_construct`))return!0;t=Object.getPrototypeOf(t)}return!1}_getSubclassWrite(){let t=Object.getPrototypeOf(this);for(;t&&t!==e.prototype&&t!==Object.prototype;){if(Object.prototype.hasOwnProperty.call(t,`_write`))return t._write.bind(this);t=Object.getPrototypeOf(t)}return null}_getSubclassFinal(){let t=Object.getPrototypeOf(this);for(;t&&t!==e.prototype&&t!==Object.prototype;){if(Object.prototype.hasOwnProperty.call(t,`_final`))return t._final.bind(this);t=Object.getPrototypeOf(t)}return null}_getWritevHook(){let t=Object.getPrototypeOf(this);return t._writev&&t._writev!==e.prototype._writev?t._writev.bind(this):null}_setupAbortSignal(e){if(e.aborted){this.destroy(i(e.reason));return}let t=()=>{r(),this.destroy(i(e.reason))},n=()=>{r()},r=()=>{e.removeEventListener(`abort`,t),this.off(`close`,n),this.off(`finish`,n),this.off(`error`,n)};e.addEventListener(`abort`,t,{once:!0}),this.on(`close`,n),this.on(`finish`,n),this.on(`error`,n)}setDefaultEncoding(e){return Nn(``,e),this._defaultEncoding=e,this}cork(){this._corked++}uncork(){if(this._corked>0&&this._corked--,this._corked===0){let e=this._corkedChunks;if(this._corkedChunks=[],e.length===0)return;for(let{chunk:t}of e)this._writableLength-=this._getChunkSize(t);let t=this._resolvedWritev;if(t&&e.length>1){let n=e.map(({chunk:e,encoding:t})=>({chunk:e,encoding:t})),r=n.reduce((e,{chunk:t})=>e+this._getChunkSize(t),0);this._writableLength+=r,this._writing=!0;try{t(n,t=>{if(this._writableLength-=r,this._writing=!1,t){this._destroyed||(this._errored=t,this.emit(`error`,t),this._autoDestroy&&this.destroy(t));for(let{callback:n}of e)n?.(t);return}this._needDrain&&this._writableLength<this._highWaterMark&&(this._needDrain=!1,O(()=>this.emit(`drain`)));for(let{callback:t}of e)t?.(null);this._drainWriteQueue()})}catch(t){this._writableLength-=r,this._writing=!1;let n=t instanceof Error?t:Error(String(t));this._destroyed||(this._errored=n,this.emit(`error`,n),this._autoDestroy&&this.destroy(n));for(let{callback:t}of e)t?.(n)}}else for(let{chunk:t,encoding:n,callback:r}of e)this._doWrite(t,n,r)}}write(e,t,n){if(e===null){let e=TypeError(`May not write null values to stream`);throw e.code=`ERR_STREAM_NULL_VALUES`,e}if(this._destroyed||this._ended){let e=this._destroyed&&!this._ended,r=Error(e?`Cannot call write after a stream was destroyed`:`write after end`);r.code=e?`ERR_STREAM_DESTROYED`:`ERR_STREAM_WRITE_AFTER_END`;let i=typeof t==`function`?t:n;return this._errored||=r,i&&O(()=>i(r)),!this._destroyed&&!this._errorEmitted&&(this._errorEmitted=!0,O(()=>this.emit(`error`,r))),!1}let r=typeof t==`string`?t:this._defaultEncoding,i=typeof t==`function`?t:n;if(this._corked>0){let t=this._normalizeWriteChunk(e,r);this._corkedChunks.push({chunk:t.chunk,encoding:t.encoding,callback:i});let n=this._getChunkSize(t.chunk,t.encoding);this._writableLength+=n;let a=this._writableLength<this._highWaterMark;return a||(this._needDrain=!0),a}let a=this._normalizeWriteChunk(e,r),o=this._doWrite(a.chunk,a.encoding,i);return o||(this._needDrain=!0),o}_doWrite(e,t,n){let r=this._getChunkSize(e,t);return this._writableLength+=r,this._directWrite?this._writing||!this._constructed?this._writeQueue.push({chunk:e,chunkSize:r,encoding:t,callback:n}):(this._writing=!0,this._callWriteFunc(e,r,t,n)):this._getWriter().write(e).then(()=>{this._writableLength-=r,this._needDrain&&this._writableLength<this._highWaterMark&&(this._needDrain=!1,O(()=>this.emit(`drain`))),n?.(null)}).catch(e=>{this._writableLength-=r,this._destroyed||(this._errored=e,this._errorEmitted=!0,this.emit(`error`,e),this._autoDestroy&&this.destroy(e)),n?.(e)}),this._writableLength<this._highWaterMark}_callWriteFunc(e,t,n,r){try{let i=this._objectMode?void 0:n,a=!1,o=!0;this._writeFunc(e,i,e=>{if(a){let e=Error(`Callback called multiple times`);e.code=`ERR_MULTIPLE_CALLBACK`,this.destroy(e);return}if(a=!0,e){if(this._writableLength-=t,this._destroyed?r?.(e):(this._errored=e,this._errorEmitted=!0,o?O(()=>{r?.(e),this.emit(`error`,e),this._autoDestroy&&this.destroy(e)}):(r?.(e),this.emit(`error`,e),this._autoDestroy&&this.destroy(e))),this._writing=!1,this._flushWriteQueueOnError(e),this._pendingEnd){let{cb:t}=this._pendingEnd;this._pendingEnd=null,t?.(e)}return}this._writableLength-=t,this._needDrain&&this._writableLength<this._highWaterMark&&(this._needDrain=!1,O(()=>this.emit(`drain`))),r?.(null),this._drainWriteQueue()}),o=!1}catch(e){this._writableLength-=t;let n=e instanceof Error?e:Error(String(e));if(this._destroyed||(this._errored=n,this.emit(`error`,n),this._autoDestroy&&this.destroy(n)),r?.(n),this._writing=!1,this._flushWriteQueueOnError(n),this._pendingEnd){let{cb:e}=this._pendingEnd;this._pendingEnd=null,e?.(n)}}}_drainWriteQueue(){if(this._writeQueue.length===0){if(this._writing=!1,this._pendingEnd){let{cb:e}=this._pendingEnd;this._pendingEnd=null,this._doFinish(e)}return}let e=this._resolvedWritev;if(e&&this._writeQueue.length>1){let t=this._writeQueue;this._writeQueue=[];let n=0,r=Array(t.length);for(let e=0;e<t.length;e++){let i=t[e];r[e]={chunk:i.chunk,encoding:i.encoding},n+=i.chunkSize}try{e(r,e=>{if(e){this._writableLength-=n,this._destroyed||(this._errored=e,this._errorEmitted=!0,this.emit(`error`,e));for(let n of t)n.callback?.(e);this._writing=!1,this._flushWriteQueueOnError(e);return}this._writableLength-=n,this._needDrain&&this._writableLength<this._highWaterMark&&(this._needDrain=!1,O(()=>this.emit(`drain`)));for(let e of t)e.callback?.(null);this._drainWriteQueue()})}catch(e){this._writableLength-=n,this._writing=!1;let r=e instanceof Error?e:Error(String(e));this._destroyed||(this._errored=r,this.emit(`error`,r));for(let e of t)e.callback?.(r)}}else{let e=this._writeQueue.shift();this._callWriteFunc(e.chunk,e.chunkSize,e.encoding,e.callback)}}_flushWriteQueueOnError(e){let t=this._writeQueue;this._writeQueue=[];for(let n of t)this._writableLength-=n.chunkSize,n.callback?.(e)}_doFinish(e){if(this._finalFunc)this._finalFunc(t=>{if(t){this._errorEmitted=!0,this.emit(`error`,t),e&&(this._pendingEnd={cb:e}),this._autoDestroy&&!this._destroyed&&this.destroy(t);return}let n=()=>{if(this._destroyed){e?.();return}this._finished=!0,this.emit(`prefinish`),e?.(),this.emit(`finish`),this._autoDestroy&&this.destroy()};this._syncFinish?(this._syncFinish=!1,n()):O(n)});else{let t=()=>{if(this._destroyed){e?.();return}this._finished=!0,this.emit(`prefinish`),e?.(),this.emit(`finish`),this._autoDestroy&&this.destroy()};Ln()?t():O(t)}}_getChunkSize(e,t){return this._objectMode?1:e instanceof Uint8Array?e.byteLength:typeof e==`string`?nr(e,t):0}_normalizeWriteChunk(e,t){if(this._objectMode||typeof e!=`string`||!this._decodeStrings)return{chunk:e,encoding:t};let n=Nn(e,t);return n.toString=er,{chunk:n,encoding:`buffer`}}end(e,t,n){if(this._ended){let{chunk:r,encoding:i,cb:a}=Fn(e,t,n);if(r!==void 0)return this.write(r,i??this._defaultEncoding,e=>{a?.(e??null)}),this;if(this._finished&&a){let e=Error(`Cannot call end after a stream was finished`);e.code=`ERR_STREAM_ALREADY_FINISHED`,O(()=>a(e))}else O(()=>a?.(null));return this}this._ended=!0,this._writableOverride=void 0;let{chunk:r,encoding:i,cb:a}=Fn(e,t,n);if(this._corked>0&&(this._corked=1,this.uncork()),this._directWrite){if(r!==void 0){let e=this._normalizeWriteChunk(r,i??this._defaultEncoding);this._doWrite(e.chunk,e.encoding)}if(this._errored){let e=this._errored;return O(()=>a?.(e)),this}return this._writing||this._writeQueue.length>0?this._pendingEnd={cb:a}:this._doFinish(a),this}return(async()=>{try{let e=this._getWriter();if(r!==void 0){let{chunk:t}=this._normalizeWriteChunk(r,i??this._defaultEncoding);await e.write(t)}if(await e.close(),this._writer===e){this._writer=null;try{e.releaseLock()}catch{}}this._ownsStream||(this._finished=!0,this.emit(`finish`),this._autoDestroy&&this.destroy()),a&&a()}catch(e){this.emit(`error`,e)}})(),this}destroy(e){if(this._destroyed)return this;if(this._destroyed=!0,this._writableOverride=void 0,e&&!this._errored&&(this._errored=e),this._writeQueue.length>0&&this._flushWriteQueueOnError(e??Error(`Cannot call write after a stream was destroyed`)),this._corkedChunks.length>0){let t=e??Error(`Cannot call write after a stream was destroyed`);for(let e of this._corkedChunks)e.callback?.(t);this._corkedChunks=[]}let t=this._pendingEnd?.cb;if(this._pendingEnd=null,this._writing=!1,this._writer){let t=this._writer;this._writer=null,t.abort(e).catch(()=>{}).finally(()=>{try{t.releaseLock()}catch{}})}let n=e=>{let n=e||null;n&&(this._errored=n),this._closed=!0;let r=()=>{n&&!this._errorEmitted&&(this._errorEmitted=!0,this.emit(`error`,n)),this._emitClose&&this.emit(`close`),t?.(n)};Ln()&&!this._hasDestroyHook()&&this._finished?r():O(r)};if(this._hasDestroyHook())try{this._destroy(e??null,n)}catch(e){n(e instanceof Error?e:Error(String(e)))}else n(e);return this}_destroy(e,t){t(e)}_undestroy(){this._destroyed=!1,this._closed=!1,this._errored=null,this._errorEmitted=!1}_hasDestroyHook(){return Object.prototype.hasOwnProperty.call(this,`_destroy`)||Object.getPrototypeOf(this)._destroy!==e.prototype._destroy}[Symbol.dispose](){this._destroyed||this.destroy()}async[Symbol.asyncDispose](){let e=!this._destroyed;return e&&this.destroy(),new Promise((t,n)=>{let r=()=>{e||this._finished?t():n(Error(`Premature close`))};this._closed?r():this.once(`close`,r)})}get _webStream(){return this._stream||=new WritableStream({write:e=>new Promise((t,n)=>{let r=this._objectMode?void 0:this._defaultEncoding;this._writeFunc(e,r,e=>{e?n(e):t()})}),close:async()=>{this._finalFunc&&await new Promise((e,t)=>{this._finalFunc(n=>{n?t(n):e()})})},abort:e=>{this.emit(`error`,e)}}),this._stream}get writable(){return this._writableOverride===void 0?!this._destroyed&&!this._ended:this._writableOverride}set writable(e){this._writableOverride=e}get writableEnded(){return this._ended}get writableFinished(){return this._finished}get writableLength(){return this._writableLength}get destroyed(){return this._destroyed}set destroyed(e){this._destroyed=e}get errored(){return this._errored}get closed(){return this._closed}get writableNeedDrain(){return this._needDrain}get writableCorked(){return this._corked}get writableAborted(){return this._writableOverride===!1?!1:(this._destroyed||!!this._errored)&&!this._finished}get writableObjectMode(){return this._objectMode}get writableHighWaterMark(){return this._highWaterMark}get writableBuffer(){let e=this._corkedChunks.map(e=>e.chunk);for(let t of this._writeQueue)e.push(t.chunk);return e}pipe(){let e=new An(`pipe`,`not readable`);e.code=`ERR_STREAM_CANNOT_PIPE`,O(()=>this.emit(`error`,e))}_getWriter(){return this._writer||=this._webStream.getWriter(),this._writer}static isDisturbed(e){return e&&e._readable instanceof k?k.isDisturbed(e._readable):k.isDisturbed(e)}static fromWeb(t,n){return new e({...n,stream:t})}static toWeb(e){return e._webStream}};A.prototype._writev=null,A.prototype._write=function(e,t,n){let r=Error(`The _write() method is not implemented`);throw r.code=`ERR_METHOD_NOT_IMPLEMENTED`,r};function tr(e){return e instanceof A?e:e?.getWriter?new A({stream:e}):e}function nr(e,t){let n=(t??`utf8`).toLowerCase();return n===`ascii`||n===`latin1`||n===`binary`?e.length:n===`utf16le`||n===`utf-16le`||n===`ucs2`?e.length*2:rr(e)}function rr(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r<=127?t+=1:r<=2047?t+=2:r>=55296&&r<=56319?(t+=4,n++):t+=3}return t}var ir=class e extends D{static[Symbol.hasInstance](t){return typeof t!=`object`||!t?!1:Object.prototype.isPrototypeOf.call(e.prototype,t)?!0:t.__excelts_stream===!0&&typeof t.read==`function`&&typeof t.pipe==`function`&&typeof t.write==`function`&&typeof t.end==`function`&&typeof t.on==`function`&&`readableFlowing`in t&&`writableFinished`in t}static isDisturbed(e){return e&&e._readable instanceof k?k.isDisturbed(e._readable):k.isDisturbed(e)}static from(t){if(t instanceof e)return t;let n=(e,t)=>{let n=new A({objectMode:t.readableObjectMode,write(e,n,r){t.push(e),r()},final(e){t.push(null),e()}}),r=Un(e,`error`,e=>{t.emit(`error`,e)});Un(e,`end`,r,{once:!0}),Un(e,`close`,r,{once:!0}),Un(n,`finish`,r,{once:!0}),e.pipe(n)};if(t instanceof Promise){let r=new e({objectMode:!0});return t.then(t=>{n(e.from(t),r)}).catch(e=>{r.destroy(e instanceof Error?e:Error(String(e)))}),r}if(typeof t==`string`){let r=k.from([t]),i=new e({objectMode:!0});return n(r,i),i}if(typeof Blob<`u`&&t instanceof Blob){let r=k.fromWeb(t.stream()),i=new e;return n(r,i),i}if(typeof t==`object`&&t&&`readable`in t&&`writable`in t){let r=t,i=new e({readableObjectMode:r.readable?.readableObjectMode,writableObjectMode:r.writable?.writableObjectMode,write:r.writable?(e,t,n)=>{r.writable.write(e,t,n)}:void 0,final:r.writable?e=>{r.writable.end(e)}:void 0,destroy:(e,t)=>{r.readable&&!r.readable.destroyed&&r.readable.destroy(e??void 0),r.writable&&!r.writable.destroyed&&r.writable.destroy(e??void 0),t(e)}});return r.readable&&n(r.readable,i),i}if(typeof t==`object`&&t&&typeof t.getReader==`function`&&typeof t.cancel==`function`){let r=k.fromWeb(t),i=new e({objectMode:r.readableObjectMode});return n(r,i),i}if(typeof t==`object`&&t&&typeof t.getWriter==`function`&&typeof t.close==`function`){let n=A.fromWeb(t);return new e({objectMode:n.writableObjectMode,write(e,t,r){n.write(e,t,r)},final(e){n.end(e)},destroy(e,t){n.destroyed||n.destroy(e??void 0),t(e)}})}if(typeof t==`object`&&t&&(Symbol.asyncIterator in t||Symbol.iterator in t)){let r=k.from(t),i=new e({objectMode:r.readableObjectMode});return n(r,i),i}if(t instanceof k){let r=new e({objectMode:t.readableObjectMode});return n(t,r),r}if(t instanceof A)return new e({objectMode:t.writableObjectMode,write(e,n,r){t.write(e,n,r)},final(e){t.end(e)}});throw new jn(`Duplex-compatible source`,typeof t)}static fromWeb(t,n){let r=new e(n),i=new k({stream:t.readable,objectMode:r.readableObjectMode}),a=new A({stream:t.writable,objectMode:r.writableObjectMode});return r._sideForwardingCleanup&&=(r._sideForwardingCleanup(),null),r._readable=i,r._writable=a,r._setupSideForwarding(),r}static toWeb(e){return{readable:k.toWeb(e._readable),writable:A.toWeb(e._writable)}}_getSubclassHook(t){let n=Object.getPrototypeOf(this);for(;n&&n!==e.prototype&&n!==Object.prototype;){if(Object.prototype.hasOwnProperty.call(n,t)){let e=this[t];return typeof e==`function`?e.bind(this):void 0}n=Object.getPrototypeOf(n)}}constructor(e){super(),this._dataForwardingSetup=!1,this._destroyed=!1,this._errored=null,this._closed=!1,this._sideForwardingCleanup=null,this._constructed=!0,this.__excelts_stream=!0,this.allowHalfOpen=e?.allowHalfOpen??!0,this._emitClose=e?.emitClose??!0,this._autoDestroy=e?.autoDestroy??!0;let t=e?.objectMode??!1,n=e?.readableObjectMode??t,r=e?.writableObjectMode??t,i=e!=null&&Object.prototype.hasOwnProperty.call(e,`highWaterMark`),a=i?e.highWaterMark:e?.readableHighWaterMark,o=i?e.highWaterMark:e?.writableHighWaterMark;e?.destroy&&(this._destroy=e.destroy.bind(this)),e?.construct&&(this._constructFunc=e.construct.bind(this));let s,c,l=this._hasConstructHook(),u=e?.read?e.read.bind(this):this._getSubclassHook(`_read`),d=e?.write?e.write.bind(this):this._getSubclassHook(`_write`),f=e?.writev?e.writev.bind(this):this._getSubclassHook(`_writev`),p=e?.final?e.final.bind(this):this._getSubclassHook(`_final`);this._readable=new k({highWaterMark:a,objectMode:n,read:u,encoding:e?.encoding,emitClose:!1,autoDestroy:!1,construct:l?e=>{s=e}:void 0}),this._writable=new A({highWaterMark:o,objectMode:r,write:d,writev:f,final:p,decodeStrings:e?.decodeStrings,defaultEncoding:e?.defaultEncoding,emitClose:!1,autoDestroy:!1,construct:l?e=>{c=e}:void 0});let m=()=>{};this._readable.on(`error`,m),this._writable.on(`error`,m),this._setupSideForwarding(),e?.signal&&this._setupAbortSignal(e.signal),l&&(this._constructed=!1,O(()=>{(this._constructFunc??this._construct.bind(this))(e=>{if(e){s?.(e),c?.(e),this.destroy(e);return}this._constructed=!0,s?.(),c?.()})}))}_setupAbortSignal(e){if(e.aborted){this.destroy(i(e.reason));return}let t=()=>{this.destroy(i(e.reason))};e.addEventListener(`abort`,t,{once:!0}),this.once(`close`,()=>{e.removeEventListener(`abort`,t)})}_setupSideForwarding(){this._sideForwardingCleanup&&=(this._sideForwardingCleanup(),null),this._readable._pipes?.setSource(this);let e=Wn(),t=!1,n=e=>{t||(t=!0,this.emit(`error`,e))},r=!1,i=!1,a=()=>{this._autoDestroy&&r&&i&&!this._destroyed&&this.destroy()};e.once(this._readable,`end`,()=>{this.emit(`end`),r=!0,this.allowHalfOpen||this._writable.end(),a()}),e.add(this._readable,`error`,n);let o=()=>{this.emit(`readable`)};D.prototype.on.call(this._readable,`readable`,o),e.add(this._readable,`pause`,()=>this.emit(`pause`)),e.add(this._readable,`resume`,()=>this.emit(`resume`)),e.add(this._writable,`error`,n),e.once(this._writable,`prefinish`,()=>this.emit(`prefinish`)),e.once(this._writable,`finish`,()=>{this.emit(`finish`),i=!0,a()}),e.add(this._writable,`drain`,()=>this.emit(`drain`)),e.add(this._writable,`pipe`,e=>this.emit(`pipe`,e)),e.add(this._writable,`unpipe`,e=>this.emit(`unpipe`,e)),e.once(this._writable,`finish`,()=>{!this.allowHalfOpen&&!this._readable.readableEnded&&this._readable.push(null)});let s=this._readable.destroy.bind(this._readable);this._readable.destroy=e=>{let t=s(e);return this._destroyed||this.destroy(e),t},this._sideForwardingCleanup=()=>{e.cleanup(),this._readable.off(`readable`,o),this._readable.destroy=s}}on(e,t){return super.on(e,t),e===`data`&&!this._dataForwardingSetup?(this._dataForwardingSetup=!0,this._readable.on(`data`,e=>this.emit(`data`,e))):e===`readable`&&this._readable._setReadableFlowing(!1),this}push(e,t){return this._readable.push(e,t)}unshift(e,t){this._readable.unshift(e,t)}read(e){return this._readable.read(e)}write(e,t,n){let r=typeof t==`string`?t:void 0,i=typeof t==`function`?t:n;return r===void 0?this._writable.write(e,i):this._writable.write(e,r,i)}end(e,t,n){let{chunk:r,encoding:i,cb:a}=Fn(e,t,n);if(this._writable.writableEnded){if(r!==void 0)return this.write(r,i,e=>{a?.(e??null)}),this;if(this.writableFinished&&a){let e=Error(`Cannot call end after a stream was finished`);e.code=`ERR_STREAM_ALREADY_FINISHED`,O(()=>a(e))}else a&&O(()=>a(null));return this}if(a){let e=!1,t=()=>{e||(e=!0,a())};this.once(`finish`,t),this.once(`close`,t)}if(r!==void 0){let e=e=>{e&&!this.destroyed&&this.destroy(e)};i===void 0?this._writable.write(r,e):this._writable.write(r,i,e)}return this._writable.end(),this}cork(){this._writable.cork()}uncork(){this._writable.uncork()}setEncoding(e){return this._readable.setEncoding(e),this}setDefaultEncoding(e){return this._writable.setDefaultEncoding(e),this}pipe(e,t){return this._readable.pipe(e,t),e}unpipe(e){return this._readable.unpipe(e),this}pause(){return this._readable.pause(),this}resume(){return this._readable.resume(),this}isPaused(){return this._readable.isPaused()}destroy(e){if(this._destroyed)return this;this._destroyed=!0,this._sideForwardingCleanup&&=(this._sideForwardingCleanup(),null);let t=e=>{let t=e||null;t&&(this._errored=t),this._closed=!0,this._readable.destroy(),this._writable.destroy();let n=()=>{t&&this.emit(`error`,t),this._emitClose&&this.emit(`close`)};Ln()&&!this._hasDestroyHook()&&this.readableEnded&&this.writableFinished?n():O(n)};if(this._hasDestroyHook())try{this._destroy(e??null,t)}catch(e){t(e instanceof Error?e:Error(String(e)))}else t(e);return this}_destroy(e,t){t(e)}_undestroy(){this._readable._undestroy(),this._writable._undestroy(),this._destroyed=!1,this._closed=!1,this._errored=null,this._setupSideForwarding()}_hasDestroyHook(){return Object.prototype.hasOwnProperty.call(this,`_destroy`)||Object.getPrototypeOf(this)._destroy!==e.prototype._destroy}_hasConstructHook(){if(this._constructFunc)return!0;let t=Object.getPrototypeOf(this);for(;t&&t!==e.prototype&&t!==Object.prototype;){if(Object.prototype.hasOwnProperty.call(t,`_construct`))return!0;t=Object.getPrototypeOf(t)}return!1}[Symbol.dispose](){this._destroyed||this.destroy()}async[Symbol.asyncDispose](){let e=!this._destroyed;return e&&this.destroy(),new Promise((t,n)=>{let r=()=>{e||this.writableFinished?t():n(Error(`Premature close`))};this._closed?r():this.once(`close`,r)})}get readable(){return this._readable.readable}set readable(e){this._readable.readable=e}get writable(){return this._writable.writable}set writable(e){this._writable.writable=e}get readableEnded(){return this._readable.readableEnded}get writableEnded(){return this._writable.writableEnded}get writableFinished(){return this._writable.writableFinished}get readableLength(){return this._readable.readableLength}get writableLength(){return this._writable.writableLength}get readableHighWaterMark(){return this._readable.readableHighWaterMark}get writableHighWaterMark(){return this._writable.writableHighWaterMark}get destroyed(){return this._destroyed}set destroyed(e){this._destroyed=e,this._readable.destroyed=e,this._writable.destroyed=e}get writableCorked(){return this._writable.writableCorked}get writableNeedDrain(){return this._writable.writableNeedDrain}get readableObjectMode(){return this._readable.readableObjectMode}get writableObjectMode(){return this._writable.writableObjectMode}get readableFlowing(){return this._readable.readableFlowing}get readableAborted(){return this._readable.readableAborted}get readableDidRead(){return this._readable.readableDidRead}get readableEncoding(){return this._readable.readableEncoding}get errored(){return this._errored??this._readable.errored??this._writable.errored}get closed(){return this._closed}get readableBuffer(){return this._readable.readableBuffer}get writableBuffer(){return this._writable.writableBuffer}wrap(e){return this._readable.wrap(e),this}iterator(e){return e?.destroyOnReturn===!1?this._readable.iterator(e):this._wrapAsyncIterator(this._readable[Symbol.asyncIterator]())}[Symbol.asyncIterator](){return this._wrapAsyncIterator(this._readable[Symbol.asyncIterator]())}_wrapAsyncIterator(e){let t=this;return{next(){return e.next()},async return(){let n=await e.return?.();return t.destroyed||t.destroy(),n??{value:void 0,done:!0}},async throw(n){let r=await e.throw?.(n);return t.destroyed||t.destroy(n instanceof Error?n:void 0),r??{value:void 0,done:!0}},[Symbol.asyncIterator](){return this}}}map(e,t){return this._readable.map(e,t)}filter(e,t){return this._readable.filter(e,t)}async forEach(e,t){return this._readable.forEach(e,t)}async toArray(e){return this._readable.toArray(e)}async some(e,t){return this._readable.some(e,t)}async find(e,t){return this._readable.find(e,t)}async every(e,t){return this._readable.every(e,t)}flatMap(e,t){return this._readable.flatMap(e,t)}drop(e,t){return this._readable.drop(e,t)}take(e,t){return this._readable.take(e,t)}async reduce(e,t,n){return arguments.length>=2?this._readable.reduce(e,t,n):this._readable.reduce(e)}compose(e,t){return this._readable.compose(e,t)}};ir.prototype.addListener=ir.prototype.on,ir.prototype._writev=null;var ar=class e extends D{static[Symbol.hasInstance](t){return typeof t!=`object`||!t?!1:Object.prototype.isPrototypeOf.call(e.prototype,t)?!0:t.__excelts_stream===!0&&typeof t.read==`function`&&typeof t.pipe==`function`&&typeof t.write==`function`&&typeof t.end==`function`&&typeof t.on==`function`&&typeof t._transform==`function`&&`readableFlowing`in t&&`writableFinished`in t}push(e,t){return this._readable.push(e,t)}constructor(t){super(),this._destroyed=!1,this._closed=!1,this._ended=!1,this._errored=null,this._dataForwardingSetup=!1,this._syncFinal=!1,this._endCalledFromSync=!1,this._endGeneration=0,this._endCallback=null,this._webStream=null,this._sideForwardingCleanup=null,this._afterTransformCallback=null,this.__excelts_stream=!0;let n=t?.objectMode??!1,r=t?.readableObjectMode??n,i=t?.writableObjectMode??n;this.allowHalfOpen=t?.allowHalfOpen??!0,this._emitClose=t?.emitClose??!0,this._autoDestroy=t?.autoDestroy??!0,this._transformImpl=t?.transform,this._flushImpl=t?.flush;let a=t!=null&&Object.prototype.hasOwnProperty.call(t,`highWaterMark`),o=a?t.highWaterMark:t?.readableHighWaterMark,s=a?t.highWaterMark:t?.writableHighWaterMark;t?.destroy&&(this._destroy=t.destroy.bind(this)),t?.construct&&(this._constructFunc=t.construct.bind(this));let c,l,u=this._hasConstructHook();this._readable=new k({highWaterMark:o,objectMode:r,encoding:t?.encoding,emitClose:!1,autoDestroy:!1,construct:u?e=>{c=e}:void 0}),this._readable._hasReadImpl=!0,this._readable._read=()=>{if(this._afterTransformCallback){let e=this._afterTransformCallback;this._afterTransformCallback=null,e(null)}},this._readable._pipes.setSource(this);let d=t?.write?(e,n,r)=>{t.write.call(this,e,n,r)}:(e,t,n)=>{let r=this._readable.readableLength,i=()=>{let e=this._readable.readableLength,t=this._readable.readableHighWaterMark;this._writable.writableEnded||r===e||e<t?n(null):this._afterTransformCallback=n},a=this._runTransformSync(e,t);a===void 0?i():a.then(()=>i(),e=>n(e))},f=t?.final?e=>{t.final.call(this,t=>{if(t){e(t);return}this._readable.push(null),e(null)})}:t=>{typeof this._final==`function`&&this._final!==e.prototype._final?this._final.call(this,e=>{if(e){t(e);return}t(null)}):this._hasSubclassFlush()||this._flushImpl?this._runFlush().then(()=>{this._readable.push(null),t(null)}).catch(e=>t(e)):this._syncFinal?(this._readable.push(null),this._readable._emitEndOnce(),t(null)):O(()=>{this._readable.push(null),t(null)})};this._writable=new A({highWaterMark:s,objectMode:i,emitClose:!1,autoDestroy:!1,write:d,writev:t?.writev?.bind(this),final:f,decodeStrings:t?.decodeStrings,defaultEncoding:t?.defaultEncoding,construct:u?e=>{l=e}:void 0});let p=()=>{};this._readable.on(`error`,p),this._writable.on(`error`,p),this._setupSideForwarding(),t?.signal&&this._setupAbortSignal(t.signal),u&&O(()=>{(this._constructFunc??this._construct.bind(this))(e=>{if(e){c?.(e),l?.(e),this.destroy(e);return}c?.(),l?.()})})}_setupAbortSignal(e){if(e.aborted){this.destroy(i(e.reason));return}let t=()=>{this.destroy(i(e.reason))};e.addEventListener(`abort`,t,{once:!0}),this.once(`close`,()=>{e.removeEventListener(`abort`,t)})}_setupSideForwarding(){this._sideForwardingCleanup&&=(this._sideForwardingCleanup(),null),this._readable._pipes?.setSource(this);let e=Wn(),t=!1,n=!1,r=()=>{this._autoDestroy&&t&&n&&!this._destroyed&&this.destroy()};e.once(this._readable,`end`,()=>{this.emit(`end`),t=!0,this.allowHalfOpen||this._writable.end(),r()}),e.add(this._readable,`error`,e=>this._emitErrorOnce(e));let i=()=>{this.emit(`readable`)};D.prototype.on.call(this._readable,`readable`,i),e.add(this._readable,`pause`,()=>this.emit(`pause`)),e.add(this._readable,`resume`,()=>this.emit(`resume`)),e.once(this._writable,`prefinish`,()=>this.emit(`prefinish`)),e.once(this._writable,`finish`,()=>{this.emit(`finish`),n=!0,r()}),e.add(this._writable,`drain`,()=>this.emit(`drain`)),e.add(this._writable,`error`,e=>this._emitErrorOnce(e)),e.once(this._writable,`finish`,()=>{!this.allowHalfOpen&&!this._readable.readableEnded&&this._readable.push(null)}),this._sideForwardingCleanup=()=>{e.cleanup(),this._readable.off(`readable`,i)}}_scheduleEnd(){if(this._destroyed||this._errored||this._writable.writableEnded)return;let t=++this._endGeneration;O(()=>{t===this._endGeneration&&(this._destroyed||this._errored||this._writable.writableEnded||(this._endCalledFromSync&&!this._hasSubclassFlush()&&!this._flushImpl&&!(typeof this._final==`function`&&this._final!==e.prototype._final)&&this._readable._pipes._destinations.length===0&&(this._syncFinal=!0,this._writable._syncFinish=!0),this._writable.end(),this._syncFinal=!1,this._writable._syncFinish=!1))})}_emitErrorOnce(e){if(this._errored)return;let t=e instanceof Error?e:Error(String(e));this._errored=t,this._destroyed||this.destroy(t)}_hasSubclassTransform(){if(this._isSubclassTransform!==void 0)return this._isSubclassTransform;if(this._transformImpl)return this._isSubclassTransform=!1,!1;let t=Object.getPrototypeOf(this);return this._isSubclassTransform=t._transform!==e.prototype._transform,this._isSubclassTransform}_hasSubclassFlush(){if(this._flushImpl)return!1;let t=Object.getPrototypeOf(this);for(;t&&t!==e.prototype&&t!==Object.prototype;){if(Object.prototype.hasOwnProperty.call(t,`_flush`))return!0;t=Object.getPrototypeOf(t)}return!1}_runTransformSync(e,t){if(this._destroyed||this._errored)return;if(this._hasSubclassTransform()){let n=!0,r=!1,i=null,a,s=!1,c=null,l=null;if(this._transform(e,t,(e,t)=>{if(s){let e=Error(`Callback called multiple times`);e.code=`ERR_MULTIPLE_CALLBACK`,this.destroy(e);return}if(s=!0,n){r=!0,i=e??null,a=t;return}if(e){l?.(e);return}t!==void 0&&this.push(t),c?.()}),n=!1,r){if(i)throw o(i);a!==void 0&&this.push(a);return}return new Promise((e,t)=>{c=e,l=t})}let n=this._transformImpl;if(!n){let n=!0,r=!1,i=null,a,s=null,c=null;if(this._transform(e,t,(e,t)=>{if(n){r=!0,i=e??null,a=t;return}if(e){c?.(e);return}t!==void 0&&this.push(t),s?.()}),n=!1,r){if(i)throw o(i);a!==void 0&&this.push(a);return}return new Promise((e,t)=>{s=e,c=t})}let r=!0,i=!1,a=null,s,c=!1,l=null,u=null,d=new Promise((e,t)=>{l=e,u=t});if(n.call(this,e,t,(e,t)=>{if(c){let e=Error(`Callback called multiple times`);e.code=`ERR_MULTIPLE_CALLBACK`,this.destroy(e);return}if(c=!0,r){i=!0,a=e??null,s=t;return}if(e){u?.(e);return}t!==void 0&&this.push(t),l?.()}),r=!1,i){if(a)throw o(a);s!==void 0&&this.push(s);return}return d}async _runFlush(){if(this._destroyed||this._errored)return;if(this._hasSubclassFlush()){await new Promise((e,t)=>{this._flush((n,r)=>{if(n){t(n);return}r!==void 0&&this.push(r),e()})});return}let e=this._flushImpl;e&&await new Promise((t,n)=>{e.call(this,(e,r)=>{if(e){n(e);return}r!==void 0&&this.push(r),t()})})}on(e,t){return super.on(e,t),e===`data`&&!this._dataForwardingSetup?(this._dataForwardingSetup=!0,this._readable.on(`data`,e=>{this.emit(`data`,e)})):e===`readable`&&this._readable._setReadableFlowing(!1),this}write(e,t,n){let r=typeof t==`string`?t:void 0,i=typeof t==`function`?t:n;if(this._ended){let e=Error(`write after end`);return e.code=`ERR_STREAM_WRITE_AFTER_END`,O(()=>this.emit(`error`,e)),i&&O(()=>i(e)),!1}return r===void 0?this._writable.write(e,i):this._writable.write(e,r,i)}end(e,t,n){if(this._ended){let{chunk:r,encoding:i,cb:a}=Fn(e,t,n);if(r!==void 0)return this.write(r,i,e=>{a?.(e??null)}),this;if(this.writableFinished&&a){let e=Error(`Cannot call end after a stream was finished`);e.code=`ERR_STREAM_ALREADY_FINISHED`,O(()=>a(e))}else a&&O(()=>a(null));return this}let{chunk:r,encoding:i,cb:a}=Fn(e,t,n);if(a&&(this._endCallback=a,this.once(`finish`,()=>{let e=this._endCallback;e&&(this._endCallback=null,e())})),r!==void 0){let e=e=>{e&&!this._destroyed&&this.destroy(e)};i===void 0?this._writable.write(r,e):this._writable.write(r,i,e)}return this._ended=!0,this._endCalledFromSync=!Ln(),this._scheduleEnd(),this}read(e){return this._readable.read(e)}pipe(e,t){return this._readable.pipe(e,t)}unpipe(e){return this._readable.unpipe(e),this}isPaused(){return this._readable.isPaused()}resume(){return this._readable.resume(),this}pause(){return this._readable.pause(),this}destroy(e){if(this._destroyed)return this;if(this._destroyed=!0,this._endGeneration++,this._afterTransformCallback){let t=this._afterTransformCallback;this._afterTransformCallback=null,t(e??null)}this._sideForwardingCleanup&&=(this._sideForwardingCleanup(),null);let t=e=>{let t=e||null;this._readable.destroy(),this._writable.destroy();let n=this._endCallback;this._endCallback=null,this._closed=!0;let r=()=>{n&&n(),t&&this.emit(`error`,t),this._emitClose&&this.emit(`close`)};Ln()&&!this._hasDestroyHook()&&this.readableEnded&&this.writableFinished?r():O(r)};if(this._hasDestroyHook())try{this._destroy(e??null,t)}catch(e){t(e instanceof Error?e:Error(String(e)))}else t(e);return this}_destroy(e,t){t(e)}_undestroy(){this._readable._undestroy(),this._writable._undestroy(),this._destroyed=!1,this._closed=!1,this._errored=null,this._setupSideForwarding()}_hasDestroyHook(){return Object.prototype.hasOwnProperty.call(this,`_destroy`)||Object.getPrototypeOf(this)._destroy!==e.prototype._destroy}_hasConstructHook(){if(this._constructFunc)return!0;let t=Object.getPrototypeOf(this);for(;t&&t!==e.prototype&&t!==Object.prototype;){if(Object.prototype.hasOwnProperty.call(t,`_construct`))return!0;t=Object.getPrototypeOf(t)}return!1}[Symbol.dispose](){this._destroyed||this.destroy()}async[Symbol.asyncDispose](){let e=!this._destroyed;return e&&this.destroy(),new Promise((t,n)=>{let r=()=>{e||this.writableFinished?t():n(Error(`Premature close`))};this.closed?r():this.once(`close`,r)})}_getWebStream(){if(this._webStream)return this._webStream;let e=this[Symbol.asyncIterator](),t=new ReadableStream({pull:async t=>{let{done:n,value:r}=await e.next();if(n){t.close();return}t.enqueue(r)},cancel:e=>{this.destroy(e instanceof Error?e:Error(String(e)))}}),n=new WritableStream({write:e=>new Promise((t,n)=>{this.write(e,e=>{e?n(e):t()})}),close:()=>new Promise(e=>{this.end(()=>e())}),abort:e=>{this.destroy(e instanceof Error?e:Error(String(e)))}});return this._webStream={readable:t,writable:n},this._webStream}get readable(){return this._readable.readable}set readable(e){this._readable.readable=e}get writable(){return this._writable.writable}set writable(e){this._writable.writable=e}get readableEnded(){return this._readable.readableEnded}get writableEnded(){return this._ended||this._writable.writableEnded}get writableFinished(){return this._writable.writableFinished}get readableLength(){return this._readable.readableLength}get writableLength(){return this._writable.writableLength}get readableHighWaterMark(){return this._readable.readableHighWaterMark}get writableHighWaterMark(){return this._writable.writableHighWaterMark}get readableObjectMode(){return this._readable.readableObjectMode}get readableFlowing(){return this._readable.readableFlowing}get destroyed(){return this._destroyed}set destroyed(e){this._destroyed=e,this._readable.destroyed=e,this._writable.destroyed=e}cork(){this._writable.cork()}uncork(){this._writable.uncork()}setEncoding(e){return this._readable.setEncoding(e),this}setDefaultEncoding(e){return this._writable.setDefaultEncoding(e),this}unshift(e,t){this._readable.unshift(e,t)}wrap(e){return this._readable.wrap(e),this}iterator(e){return this._readable.iterator(e)}get writableCorked(){return this._writable.writableCorked}get writableNeedDrain(){return this._writable.writableNeedDrain}get writableObjectMode(){return this._writable.writableObjectMode}get readableAborted(){return this._readable.readableAborted}get readableDidRead(){return this._readable.readableDidRead}get readableEncoding(){return this._readable.readableEncoding}get errored(){return this._errored??this._readable.errored??this._writable.errored}get closed(){return this._closed}get readableBuffer(){return this._readable.readableBuffer}get writableBuffer(){return this._writable.writableBuffer}async*[Symbol.asyncIterator](){yield*this._readable[Symbol.asyncIterator]()}map(e,t){return this._readable.map(e,t)}filter(e,t){return this._readable.filter(e,t)}async forEach(e,t){return this._readable.forEach(e,t)}async toArray(e){return this._readable.toArray(e)}async some(e,t){return this._readable.some(e,t)}async find(e,t){return this._readable.find(e,t)}async every(e,t){return this._readable.every(e,t)}flatMap(e,t){return this._readable.flatMap(e,t)}drop(e,t){return this._readable.drop(e,t)}take(e,t){return this._readable.take(e,t)}async reduce(e,t,n){return arguments.length>=2?this._readable.reduce(e,t,n):this._readable.reduce(e)}compose(e,t){return this._readable.compose(e,t)}static isDisturbed(e){return e&&e._readable instanceof k?k.isDisturbed(e._readable):k.isDisturbed(e)}static from(e){return ir.from(e)}static fromWeb(t,n){let r=new e(n);r._webStream=t;let i=k.fromWeb(t.readable,{objectMode:n?.objectMode}),a=A.fromWeb(t.writable,{objectMode:n?.objectMode});return r._sideForwardingCleanup&&=(r._sideForwardingCleanup(),null),r._readable=i,r._writable=a,r._setupSideForwarding(),r}static toWeb(e){return e._getWebStream()}_transform(e,t,n){let r=Error(`The _transform() method is not implemented`);throw r.code=`ERR_METHOD_NOT_IMPLEMENTED`,r}_final(e){typeof this._flush==`function`&&!this.destroyed?this._flush((t,n)=>{if(t){e(t);return}n!=null&&this.push(n),this.push(null),e()}):(this.push(null),e())}};ar.prototype.addListener=ar.prototype.on,ar.prototype._writev=null;var or=class extends ar{_transform(e,t,n){n(null,e)}};let sr=e=>!e||typeof e!=`object`||typeof e.pipe==`function`||typeof e.write==`function`||typeof e.end==`function`||typeof e.getReader==`function`||typeof e.getWriter==`function`?!1:Object.prototype.hasOwnProperty.call(e,`signal`)||Object.prototype.hasOwnProperty.call(e,`end`),cr=e=>`readableEnded`in e||`readable`in e||typeof e.read==`function`,lr=e=>`writableFinished`in e||`writable`in e||typeof e.write==`function`,ur=e=>{let t=!cr(e)||!!e.readableEnded,n=!lr(e)||!!e.writableFinished;return t&&n},dr=()=>{let e=Error(`Premature close`);return e.code=`ERR_STREAM_PREMATURE_CLOSE`,e.name=`Error [ERR_STREAM_PREMATURE_CLOSE]`,e},fr=(e,t,n)=>{let r=e;if(r.closed||r._closed){t();return}`_emitClose`in r&&`_autoDestroy`in r&&r._emitClose!==!1&&r._autoDestroy!==!1?n.once(e,`close`,()=>t()):t()},pr=e=>e instanceof k||e instanceof A||e instanceof ar||e instanceof ir?e:an(e)?ar.fromWeb(e):nn(e)?k.fromWeb(e):rn(e)?A.fromWeb(e):e,mr=e=>typeof e==`function`&&!(e instanceof k)&&!(e instanceof A),hr=(e,t)=>{let n=t(e);return k.from(n)};function gr(...e){let t,n={},r,a=e[e.length-1];if(typeof a==`function`){r=a;let i=e[e.length-2];sr(i)?(n=i,t=e.slice(0,-2)):t=e.slice(0,-1)}else sr(a)?(n=a,t=e.slice(0,-1)):t=e;let o=new Promise((e,r)=>{if(t.length<2){r(Error(`Pipeline requires at least 2 streams`));return}let a=t.map(pr),o=[],s=[],c=a[0];o.push(c),s.push(c);for(let e=1;e<a.length;e++){let t=a[e];mr(t)?(c=hr(c,t),o.push(c),s[s.length-1]=c):(o.push(t),s.push(t),c=t)}let l=s[0],u=s[s.length-1],d=s.slice(1,-1);for(let e of o)if(e.destroyed&&!ur(e)){r(dr());return}let f=!1,p=Wn(),m,h=t=>{if(!f){if(f=!0,m&&n.signal&&n.signal.removeEventListener(`abort`,m),t){let e=()=>{};for(let n of o)typeof n.on==`function`&&n.on(`error`,e),typeof n.destroy==`function`&&!n.destroyed&&n.destroy(t)}p.cleanup(),t?r(t):e()}};if(n.signal){if(n.signal.aborted){h(i(n.signal.reason));return}m=()=>h(i(n.signal.reason)),n.signal.addEventListener(`abort`,m)}c=l;for(let e of d)c.pipe(e),c=e;if(n.end!==!1)c.pipe(u);else{let e=!1,t=!1,n=()=>{t=!1,e&&typeof c.resume==`function`&&(e=!1,c.resume())};p.add(c,`data`,r=>{!u.write(r)&&!t&&(t=!0,!e&&typeof c.pause==`function`&&(e=!0,c.pause()),p.once(u,`drain`,n))}),p.once(c,`end`,()=>{fr(c,h,p)})}n.end!==!1&&p.once(u,`finish`,()=>{fr(u,h,p)});for(let e of o)p.once(e,`close`,()=>{f||ur(e)||h(dr())});for(let e of o)p.once(e,`error`,e=>h(e))});return r&&o.then(()=>r()).catch(e=>r(e)),o}function _r(e,t,n){let r={},a;typeof t==`function`?a=t:(r=t??{},a=n);let o=new Promise((t,n)=>{let a=pr(e),o=!1,s=Wn(),c,l=()=>{s.cleanup(),c&&r.signal&&r.signal.removeEventListener(`abort`,c)},u=e=>{o||(o=!0,l(),e?n(e):t())};if(r.signal){if(r.signal.aborted){u(i(r.signal.reason));return}c=()=>u(i(r.signal.reason)),r.signal.addEventListener(`abort`,c)}let d=a;if(d.destroyed||d._destroyed){if(d.errored||d._errored)u(d.errored??d._errored);else{let e=`readableEnded`in d||`readable`in d||typeof d.read==`function`,t=`writableFinished`in d||`writable`in d||typeof d.write==`function`,n=r.readable!==!1&&e,i=r.writable!==!1&&t,a=!n||!!(d.readableEnded||d._endEmitted),o=!i||!!(d.writableFinished||d._finished);a&&o?u():u(dr())}return}let f=`readableEnded`in a||`readable`in a||typeof a.read==`function`,p=`writableFinished`in a||`writable`in a||typeof a.write==`function`,m=r.readable!==!1&&f,h=r.writable!==!1&&p,g=!m||!!a.readableEnded,_=!h||!!a.writableFinished,v=a,y=`_emitClose`in v&&`_autoDestroy`in v&&v._emitClose!==!1&&v._autoDestroy!==!1&&!v._closed,b=()=>{if(g&&_){if(y)return;u()}};if(g&&_&&(!y||a.closed)){u();return}h&&!_&&s.once(a,`finish`,()=>{_=!0,b()}),m&&!g&&s.once(a,`end`,()=>{g=!0,b()}),r.error!==!1&&s.once(a,`error`,e=>u(e)),s.once(a,`close`,()=>{let e=g||!!a.readableEnded,t=_||!!a.writableFinished;if(e&&t){g=e,_=t,u(a.errored??a._errored??void 0);return}let n=a.errored??a._errored;if(n){u(n);return}let r=Error(`Premature close`);r.code=`ERR_STREAM_PREMATURE_CLOSE`,r.name=`Error [ERR_STREAM_PREMATURE_CLOSE]`,u(r)})});return a&&o.then(()=>a()).catch(e=>a(e)),o}Bn(e=>ir.from(e));function vr(e){return e.length<2}function yr(e){return e.length<2}var br=class extends ar{constructor(e={}){super({objectMode:e.objectMode!==!1}),this.parseErrorsSink=[],this.buffer=``,this._rowTransform=null,this._rowValidator=null,this.autoDetectDelimiter=!1,this.delimiterDetected=!1,this.chunkBuffer=[],this.totalRowsProcessed=0,this.isFirstChunk=!0,this.chunkAborted=!1,this.beforeFirstChunkApplied=!1,this.bomStripped=!1,this.toLineReached=!1,this.headersEmitted=!1,this.totalCharsProcessed=0,this.backpressure=!1,this.pendingCallback=null,this.options=e,this.chunkSize=e.chunkSize??1e3,this.decoder=new TextDecoder(e.encoding||`utf-8`);let t=e.delimiter??`,`;this.autoDetectDelimiter=t===``;let{config:n}=St({options:e});this.parseConfig=n,this.parseState=Wt(n),this.scanner=Ut(wt(n)),e.rowTransform&&this.transform(e.rowTransform),e.validate&&this.validate(e.validate)}_read(e){if(this.backpressure&&this.pendingCallback){this.backpressure=!1;let e=this.pendingCallback;this.pendingCallback=null,e()}}transform(e){if(typeof e!=`function`)throw TypeError(`The transform should be a function`);return vr(e)?this._rowTransform=(t,n)=>{try{n(null,e(t))}catch(e){n(e)}}:this._rowTransform=e,this}validate(e){if(typeof e!=`function`)throw TypeError(`The validate should be a function`);return yr(e)?this._rowValidator=(t,n)=>{try{let r=e(t);typeof r==`boolean`?n(null,r):n(null,r.isValid,r.reason)}catch(e){n(e)}}:this._rowValidator=e,this}_transform(e,t,n){if(this.chunkAborted||this.toLineReached){n();return}try{let t=typeof e==`string`?e:this.decoder.decode(e,{stream:!0});if(this.buffer+=t,!this.beforeFirstChunkApplied&&this.options.beforeFirstChunk){this.beforeFirstChunkApplied=!0;let e=this.options.beforeFirstChunk(this.buffer);typeof e==`string`&&(this.buffer=e)}if(this.bomStripped||=(this.buffer=g(this.buffer),!0),this.autoDetectDelimiter&&!this.delimiterDetected){let e=this.options.comment,t=!1,n=0,r=this.buffer.length;for(;n<r;){let i=n;for(;i<r&&this.buffer[i]!==`
|
|
37
|
+
`,rawStart:h,rawEnd:p}:{fields:d,quoted:f,endPos:p+1,complete:!0,needMore:!1,newline:`\r`,rawStart:h,rawEnd:p}}}return r&&(d.length>0||p>t)?{fields:d,quoted:f,endPos:p,complete:!0,needMore:!1,unterminatedQuote:m||void 0,rawStart:h,rawEnd:p}:{fields:d,quoted:f,endPos:p,complete:!1,needMore:!r,resumePos:t,unterminatedQuote:m||void 0,rawStart:h,rawEnd:p}}function Wt(e){let t={...It,...e},n=Lt(),r=[],i=[];return{get config(){return t},scanRow(e,n=0,r=!1){return Ut(e,n,t,r)},feed(e){n.buffer+=e},nextRow(){if(n.position>=n.buffer.length)return null;let e=Ut(n.buffer,n.position,t,!1,r,i);if(e.needMore)return null;if(e.complete){e.raw=n.buffer.slice(e.rawStart,e.rawEnd),n.position=e.endPos;let t=n.position,r=n.buffer.length;return(t>65536||t>r/2&&t>4096)&&(n.buffer=n.buffer.slice(n.position),n.position=0),e}return null},flush(){if(n.position>=n.buffer.length)return null;let e=Ut(n.buffer,n.position,t,!0,r,i);return e.fields.length===0&&e.endPos===n.position?null:(e.raw=n.buffer.slice(e.rawStart,e.rawEnd),n.position=e.endPos,e)},reset(){n=Lt(),r.length=0,i.length=0},getBuffer(){return n.buffer.slice(n.position)}}}function Gt(e){let t={lineNumber:0,dataRowCount:0,skippedDataRows:0,truncated:!1,headerRow:null,originalHeaders:null,useHeaders:!1,headerRowProcessed:!1,renamedHeadersForMeta:null,currentRowStartLine:+!!e.infoOption,currentRowStartOffset:0,currentRowQuoted:[],currentRawRow:``},{headers:n,groupColumnsByName:r}=e;if(n===!0)t.useHeaders=!0;else if(Array.isArray(n)){let e=gt([],{headers:n,groupColumnsByName:r},null);e&&(t.headerRow=e.headers,t.originalHeaders=e.originalHeaders,t.renamedHeadersForMeta=e.renamedHeaders),t.useHeaders=!0,t.headerRowProcessed=!0}else typeof n==`function`&&(t.useHeaders=!0);return t}function Kt(e,t,n,r,i){t&&(e.currentRowQuoted=[],e.currentRowStartLine=r,e.currentRowStartOffset=i),n&&(e.currentRawRow=``)}let qt=Object.freeze(Array(256).fill(!1));function Jt(e){return e<=256?qt:Array(e).fill(!1)}function Yt(e){return typeof e==`boolean`?{isValid:e,reason:`Validation failed`}:{isValid:e.isValid,reason:e.reason||`Validation failed`}}function Xt(e,t,n){return ht(e,null,t||!1,n)}function Zt(e){return e.length>0?e:void 0}function Qt(e,t){return{delimiter:e.delimiter,linebreak:e.linebreak,aborted:!1,truncated:t.truncated,cursor:t.dataRowCount,fields:t.headerRow?St(t.headerRow):void 0,renamedHeaders:t.renamedHeadersForMeta}}function $t(e,t){return t.trimFieldIsIdentity?e:e.map(t.trimField)}function*en(e,t,n,r){if(e===``)return;let i=0;for(let{line:a,lineLengthWithEnding:o}of kt(e,t.linebreakRegex)){if(n.lineNumber++,t.toLine!==void 0&&n.lineNumber>t.toLine){n.truncated=!0;break}if(n.lineNumber<=t.skipLines){i+=o;continue}if(a===``&&t.shouldSkipEmpty){i+=o;continue}if(t.maxRowBytes!==void 0&&Ie(a)>t.maxRowBytes)throw Error(`Row exceeds the maximum size of ${t.maxRowBytes} bytes`);t.infoOption&&(n.currentRowStartLine=n.lineNumber,n.currentRowStartOffset=i),t.rawOption&&(n.currentRawRow=a);let e=$t(a.split(t.delimiter),t);if(t.infoOption&&(n.currentRowQuoted=Jt(e.length)),t.comment&&e[0]?.trimStart().startsWith(t.comment)){i+=o;continue}if(t.shouldSkipEmpty&&ye(e,t.shouldSkipEmpty)){i+=o;continue}let s=Ft(e,n,t,r,n.lineNumber);if(i+=o,s.stop){yield s;return}(!s.skipped||s.error)&&(yield s),Kt(n,t.infoOption,t.rawOption,n.lineNumber+1,i)}}function*tn(e,t,n,r){let i=Tt(t),a=e.length,o=0;for(t.infoOption&&(n.currentRowStartOffset=0);o<a;){let a=Ut(e,o,i,!0);if(a.fields.length===0&&a.endPos===o)break;let s=$t(a.fields,t),c=n.lineNumber+1;{let t=a.rawStart,r=a.rawEnd,i=1;for(let n=t;n<r;n++){let t=e.charCodeAt(n);t===10?i++:t===13&&(n+1<r&&e.charCodeAt(n+1)===10&&n++,i++)}n.lineNumber+=i}if(t.toLine!==void 0&&n.lineNumber>t.toLine){n.truncated=!0;break}let l=a.rawEnd;if(n.lineNumber<=t.skipLines){o=a.endPos;continue}if(t.maxRowBytes!==void 0&&Ie(e.slice(a.rawStart,l))>t.maxRowBytes)throw Error(`Row exceeds the maximum size of ${t.maxRowBytes} bytes`);if(t.comment&&s[0]?.trimStart().startsWith(t.comment)){o=a.endPos;continue}if(t.shouldSkipEmpty&&ye(s,t.shouldSkipEmpty)){o=a.endPos;continue}t.infoOption&&(n.currentRowStartLine=c,n.currentRowStartOffset=a.rawStart,n.currentRowQuoted=a.quoted),t.rawOption&&(n.currentRawRow=e.slice(a.rawStart,l)),a.unterminatedQuote&&r.push({code:`MissingQuotes`,message:`Quoted field unterminated`,line:n.lineNumber});let u=Ft(s,n,t,r,n.lineNumber);if(u.stop){yield u;return}(!u.skipped||u.error)&&(yield u),o=a.endPos,t.infoOption&&(n.currentRowStartOffset=a.endPos)}}function nn(e,t={}){let{config:n,processedInput:r}=wt(e,t),i=Gt(n),a=[],o=[],s=n.fastMode?en(r,n,i,a):tn(r,n,i,a);if(!i.useHeaders){let e=[];for(let r of s){if(r.row&&!r.skipped){let i=r.row;if(t.rowTransform){let e=t.rowTransform(i);if(e==null)continue;i=e}if(t.validate){let{isValid:e,reason:n}=Yt(t.validate(i));if(!e){o.push({row:i,reason:n});continue}}(n.dynamicTyping||n.castDate)&&(i=Xt(i,n.dynamicTyping,n.castDate)),n.infoOption&&r.info?e.push({record:i,info:r.info}):e.push(i)}else r.row&&r.skipped&&r.error&&o.push({row:r.row,reason:r.reason||r.error.message});if(r.stop)break}let r=Qt(n,i);return n.infoOption||t.validate?{headers:void 0,rows:e,invalidRows:Zt(o),errors:Zt(a),meta:r}:e}let c=[];for(let e of s){if(e.row&&!e.skipped){let r=Nt(e.row,i,n);if(e.extras&&e.extras.length>0&&(r._extra=e.extras),t.rowTransform){let e=t.rowTransform(r);if(e==null)continue;r=e}if(t.validate){let{isValid:n,reason:i}=Yt(t.validate(r));if(!n){o.push({row:e.row,reason:i});continue}}n.infoOption&&e.info?c.push({record:r,info:e.info}):c.push(r)}else e.row&&e.skipped&&e.error&&o.push({row:e.row,reason:e.reason||e.error.message});if(e.stop)break}let l=Qt(n,i),{objname:u}=t;if(u&&i.headerRow){let e=Object.create(null);for(let t of c){let r=(n.infoOption?t.record:t)[u],i=r==null?``:String(r);i!==`__proto__`&&(e[i]=t)}return{headers:l.fields,rows:e,invalidRows:Zt(o),errors:Zt(a),meta:l}}return{headers:l.fields,rows:c,invalidRows:Zt(o),errors:Zt(a),meta:l}}function rn(e){return!!e&&typeof e==`object`&&typeof e.getReader==`function`}function an(e){return!!e&&typeof e==`object`&&typeof e.getWriter==`function`}function on(e){return!!e&&typeof e==`object`&&!!e.readable&&!!e.writable&&rn(e.readable)&&an(e.writable)}let sn=new TextEncoder,cn=new TextDecoder(`utf-8`,{ignoreBOM:!0}),ln=new Map;function un(e){let t=(e??`utf-8`).trim().toLowerCase();return t===``||t===`utf8`||t===`utf-8`?`utf-8`:t===`utf16le`||t===`utf-16le`||t===`ucs2`||t===`ucs-2`?`utf-16le`:t===`binary`?`latin1`:t}function dn(e){let t=un(e);if(t===`utf-8`)return cn;let n=ln.get(t);return n||(n=fn(t),ln.set(t,n)),n}function fn(e,t){try{return new TextDecoder(e,t)}catch(t){throw TypeError(`Unsupported text encoding: ${e}`,{cause:t})}}function pn(e){let t=un(e);switch(t){case`hex`:return new mn;case`base64`:return new vn(!1);case`base64url`:return new vn(!0);case`ascii`:return new yn;default:return fn(t,{ignoreBOM:!0})}}var mn=class{decode(e){let t=``;for(let n=0;n<e.length;n++)t+=hn[e[n]];return t}};let hn=(()=>{let e=Array(256);for(let t=0;t<256;t++)e[t]=t.toString(16).padStart(2,`0`);return e})(),gn=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,_n=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`;var vn=class{constructor(e){this._remainder=null,this._chars=e?_n:gn}decode(e,t){let n;if(this._remainder){let t=new Uint8Array(this._remainder.length+e.length);t.set(this._remainder),t.set(e,this._remainder.length),n=t}else n=e;if(t?.stream??!1){let e=n.length%3,t=n.length-e;return this._remainder=e>0?n.slice(t):null,t>0?this._encodeBytes(n,t):``}return this._remainder=null,n.length>0?this._encodeBytes(n,n.length):``}_encodeBytes(e,t){let n=this._chars,r=n===_n,i=``,a=0;for(;a+2<t;a+=3){let t=e[a],r=e[a+1],o=e[a+2];i+=n[t>>>2]+n[(t&3)<<4|r>>>4]+n[(r&15)<<2|o>>>6]+n[o&63]}let o=t-a;if(o===1){let t=e[a];i+=n[t>>>2]+n[(t&3)<<4],r||(i+=`==`)}else if(o===2){let t=e[a],o=e[a+1];i+=n[t>>>2]+n[(t&3)<<4|o>>>4]+n[(o&15)<<2],r||(i+=`=`)}return i}},yn=class{decode(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]&127);return t}};function bn(e){let t=``;for(let n=0;n<e.length;n++)t+=hn[e[n]];return t}function xn(e,t){let n=t?_n:gn,r=``,i=0;for(;i+2<e.length;i+=3){let t=e[i],a=e[i+1],o=e[i+2];r+=n[t>>>2]+n[(t&3)<<4|a>>>4]+n[(a&15)<<2|o>>>6]+n[o&63]}let a=e.length-i;if(a===1){let a=e[i];r+=n[a>>>2]+n[(a&3)<<4],t||(r+=`==`)}else if(a===2){let a=e[i],o=e[i+1];r+=n[a>>>2]+n[(a&3)<<4|o>>>4]+n[(o&15)<<2],t||(r+=`=`)}return r}function Sn(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]&127);return t}function Cn(e,t){let n=un(t);switch(n){case`hex`:return bn(e);case`base64`:return xn(e,!1);case`base64url`:return xn(e,!0);case`ascii`:return Sn(e);default:return dn(n).decode(e)}}function wn(e){return sn.encode(e)}function Tn(e,t){return dn(t).decode(e)}function T(e,t){let n=e.length;if(n===0)return new Uint8Array;if(n===1){let t=e[0];return t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}if(t===void 0){let r=0;for(let t=0;t<n;t++)r+=e[t].length;t=r}let r=new Uint8Array(t),i=0;for(let t=0;t<n;t++){let n=e[t];r.set(n,i),i+=n.length}return r}function En(e){if(e instanceof Uint8Array)return e;if(typeof e==`string`)return sn.encode(e);if(e instanceof ArrayBuffer||Array.isArray(e))return new Uint8Array(e);throw TypeError(`Expected Uint8Array, got ${typeof e}`)}function Dn(e){let t=globalThis.Buffer;return t?t.from(e.buffer,e.byteOffset,e.byteLength):e}async function*On(e){let t=e.getReader();try{for(;;){let e=await t.read();if(e.done)return;e.value!==void 0&&e.value!==null&&(yield e.value)}}finally{try{await t.cancel?.()}catch{}try{t.releaseLock?.()}catch{}}}function kn(e){return e?16:65536}var An=class extends n{constructor(e,t){super(e,t),this.name=`StreamError`}},jn=class extends An{constructor(e,t,n){super(`Cannot ${e}: ${t}`,n),this.operation=e,this.state=t,this.name=`StreamStateError`}},Mn=class extends An{constructor(e,t,n){super(`Expected ${e}, got ${t}`,n),this.expectedType=e,this.actualType=t,this.name=`StreamTypeError`}};let Nn=e=>Array.isArray(e);var Pn=class e{constructor(){this.__excelts_stream=!0,this._listeners=new Map,this._maxListeners=e.defaultMaxListeners}static{this.defaultMaxListeners=10}addListener(e,t){return this.on(e,t)}_listenerCount(e){return e?Nn(e)?e.length:1:0}_hasListeners(e){return this._listenerCount(this._listeners.get(e))>0}on(e,t){e!==`newListener`&&this._hasListeners(`newListener`)&&this.emit(`newListener`,e,t);let n=this._listeners.get(e);if(this._maxListeners>0){let t=this._listenerCount(n);t>=this._maxListeners&&console?.warn?.(`MaxListenersExceededWarning: Possible EventEmitter memory leak detected. ${t+1} ${String(e)} listeners added. Use emitter.setMaxListeners() to increase limit`)}return n?Nn(n)?n.push(t):this._listeners.set(e,[n,t]):this._listeners.set(e,t),this}prependListener(e,t){e!==`newListener`&&this._hasListeners(`newListener`)&&this.emit(`newListener`,e,t);let n=this._listeners.get(e);return n?Nn(n)?n.unshift(t):this._listeners.set(e,[t,n]):this._listeners.set(e,t),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return n.listener=t,this.on(e,n)}prependOnceListener(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return n.listener=t,this.prependListener(e,n)}removeListener(e,t){return this.off(e,t)}off(e,t){let n=this._listeners.get(e);if(!n)return this;if(!Nn(n))return(n===t||n.listener===t)&&(this._listeners.delete(e),e!==`removeListener`&&this._hasListeners(`removeListener`)&&this.emit(`removeListener`,e,t)),this;let r=n;if(r.length===0)return this._listeners.delete(e),this;let i=r.lastIndexOf(t);if(i!==-1)r.splice(i,1);else for(let e=r.length-1;e>=0;e--)if(r[e].listener===t){r.splice(e,1);break}return r.length===0?this._listeners.delete(e):r.length===1&&this._listeners.set(e,r[0]),e!==`removeListener`&&this._hasListeners(`removeListener`)&&this.emit(`removeListener`,e,t),this}emit(e,...t){let n=this._listeners.get(e);if(!n){if(e===`error`){let e=t[0];if(e instanceof Error)throw e;let n=`Unhandled error.${e===void 0?` (undefined)`:` (${e})`}`;throw Error(n)}return!1}if(!Nn(n))return n.apply(this,t),!0;let r=n,i=r.length;if(i===0){if(e===`error`){let e=t[0];if(e instanceof Error)throw e;let n=`Unhandled error.${e===void 0?` (undefined)`:` (${e})`}`;throw Error(n)}return!1}if(i===1)return r[0].apply(this,t),!0;let a=r.slice();for(let e=0;e<a.length;e++)a[e].apply(this,t);return!0}removeAllListeners(e){if(e!==void 0){if(e!==`removeListener`&&this._hasListeners(`removeListener`)){let t=this._listeners.get(e);if(t){let n=Nn(t)?t.slice():[t];this._listeners.delete(e);for(let t of n){let n=t.listener??t;this.emit(`removeListener`,e,n)}return this}}this._listeners.delete(e)}else{if(this._hasListeners(`removeListener`)){let e=[...this._listeners.keys()];for(let t of e)if(t!==`removeListener`){let e=this._listeners.get(t);if(e){let n=Nn(e)?e.slice():[e];this._listeners.delete(t);for(let e of n){let n=e.listener??e;this.emit(`removeListener`,t,n)}}}}this._listeners.clear()}return this}listenerCount(e){return this._listenerCount(this._listeners.get(e))}listeners(e){let t=this._listeners.get(e);return t?(Nn(t)?t:[t]).map(e=>e.listener??e):[]}rawListeners(e){let t=this._listeners.get(e);return t?Nn(t)?t.slice():[t]:[]}eventNames(){return[...this._listeners.keys()]}setMaxListeners(e){return this._maxListeners=e,this}getMaxListeners(){return this._maxListeners}};Pn.prototype.addListener=Pn.prototype.on,Pn.prototype.removeListener=Pn.prototype.off;function Fn(e,t){let n=(t??`utf-8`).trim().toLowerCase();switch(n){case``:case`utf8`:case`utf-8`:return sn.encode(e);case`latin1`:case`binary`:{let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&255;return t}case`ascii`:{let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&127;return t}case`hex`:{let t=e.length>>>1,n=new Uint8Array(t);for(let r=0;r<t;r++)n[r]=parseInt(e.substring(r*2,r*2+2),16);return n}case`base64`:{let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}case`base64url`:{let t=e.replace(/-/g,`+`).replace(/_/g,`/`);for(;t.length%4!=0;)t+=`=`;let n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}case`utf16le`:case`utf-16le`:case`ucs2`:case`ucs-2`:{let t=new Uint8Array(e.length*2);for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[n*2]=r&255,t[n*2+1]=r>>>8&255}return t}default:throw In(n)}}function In(e){let t=TypeError(`Unknown encoding: ${e}`);return t.code=`ERR_UNKNOWN_ENCODING`,t}function Ln(e,t,n){return{chunk:typeof e==`function`?void 0:e,encoding:typeof t==`string`?t:void 0,cb:typeof e==`function`?e:typeof t==`function`?t:n}}let Rn=0;function E(e){queueMicrotask(()=>{Rn++;try{e()}finally{Rn--}})}function zn(){return Rn>0}let Bn=null;function Vn(){return Bn}function Hn(e){Bn=e}var Un=class{constructor(e){this._items=[],this._index=0,this._front=[],this._byteSize=0,this._objectMode=e}_chunkSize(e){return e instanceof Uint8Array?e.byteLength:1}get length(){return this._front.length+(this._items.length-this._index)}get byteSize(){return this._byteSize}push(e){this._items.push(e),this._objectMode||(this._byteSize+=this._chunkSize(e))}shift(){let e;return this._front.length>0?e=this._front.pop():(e=this._items[this._index++],this._index===this._items.length?(this._items.length=0,this._index=0):this._index>1024&&this._index*2>this._items.length&&(this._items=this._items.slice(this._index),this._index=0)),this._objectMode||(this._byteSize-=this._chunkSize(e)),e}unshift(e){this._index===0?this._front.push(e):(this._index--,this._items[this._index]=e),this._objectMode||(this._byteSize+=this._chunkSize(e))}peek(){let e=this._front.length;return e>0?this._front[e-1]:this._index<this._items.length?this._items[this._index]:null}toArray(){let e=this._front.length,t=this._items.length-this._index,n=Array(e+t);for(let t=0;t<e;t++)n[t]=this._front[e-1-t];for(let r=0;r<t;r++)n[e+r]=this._items[this._index+r];return n}clear(){this._items.length=0,this._index=0,this._front.length=0,this._byteSize=0}consumeBytes(e){if(e===0)return new Uint8Array;let t=this.peek();if(t instanceof Uint8Array&&t.byteLength===e)return this.shift();if(t instanceof Uint8Array&&t.byteLength>e){this._shiftFrontChunk();let n=t.subarray(0,e),r=t.subarray(e);return this.unshift(r),n}let n=new Uint8Array(e),r=0;for(;r<e;){let t=this.shift();if(t instanceof Uint8Array){let i=e-r;t.byteLength<=i?(n.set(t,r),r+=t.byteLength):(n.set(t.subarray(0,i),r),this.unshift(t.subarray(i)),r+=i)}}return n}consumeAll(){let e=this._front.length,t=e+(this._items.length-this._index);if(t===0)return new Uint8Array;if(t===1)return this.shift();let n=this._byteSize,r=new Uint8Array(n),i=0;for(let t=e-1;t>=0;t--){let e=this._front[t];e instanceof Uint8Array&&(r.set(e,i),i+=e.byteLength)}for(let e=this._index;e<this._items.length;e++){let t=this._items[e];t instanceof Uint8Array&&(r.set(t,i),i+=t.byteLength)}return this.clear(),r}_shiftFrontChunk(){return this.shift()}};let Wn=(e,t,n)=>{typeof e.off==`function`?e.off(t,n):typeof e.removeListener==`function`&&e.removeListener(t,n)},Gn=(e,t,n,r)=>(r?.once?typeof e.once==`function`&&e.once(t,n):typeof e.on==`function`&&e.on(t,n),()=>Wn(e,t,n)),Kn=()=>{let e=[];return{add:(t,n,r)=>{e.push(Gn(t,n,r))},once:(t,n,r)=>{e.push(Gn(t,n,r,{once:!0}))},cleanup:()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}};var qn=class{constructor(e){this._source=e,this._destinations=[],this._listeners=new Map,this._sourceOverride=null}setSource(e){this._sourceOverride=e}get _emitSource(){return this._sourceOverride??this._source}pipe(e,t){let n=e,r=n,i=typeof n?.write==`function`,a=typeof n?.end==`function`,o=typeof r?.on==`function`,s=typeof r?.once==`function`,c=typeof r?.off==`function`;if(!i||!a||!s&&!o||!c&&!r?.removeListener)throw new Mn(`Writable`,typeof n);this._destinations.push(n);let l,u=()=>{l&&=(Wn(r,`drain`,l),void 0)},d=e=>{if(!n.write(e)&&(this._source.pause(),!l)){l=()=>{u(),this._source.resume()},r.on(`drain`,l);let e=this._listeners.get(n);e&&(e.drain=l)}},f=t?.end===!1?void 0:()=>{n.end()},p=()=>{this.unpipe(n)},m=typeof r.once==`function`?`once`:`on`;return r[m](`close`,p),r[m](`finish`,p),this._listeners.set(n,{data:d,end:f,destClose:p,destFinish:p,eventTarget:r}),this._source.on(`data`,d),f&&this._source.once(`end`,f),r.emit?.(`pipe`,this._emitSource),this._source.resume(),e}unpipe(e){if(e){let t=this._destinations.indexOf(e);t!==-1&&(this._destinations.splice(t,1),this._removeListeners(e),this._destinations.length===0&&this._source.pause())}else{let e=this._destinations.length>0;for(let e of this._destinations)this._removeListeners(e);this._destinations=[],e&&this._source.pause()}}_removeListeners(e){let t=this._listeners.get(e);t&&(this._source.off(`data`,t.data),t.end&&this._source.off(`end`,t.end),t.drain&&Wn(t.eventTarget,`drain`,t.drain),t.destClose&&Wn(t.eventTarget,`close`,t.destClose),t.destFinish&&Wn(t.eventTarget,`finish`,t.destFinish),t.eventTarget.emit?.(`unpipe`,this._emitSource),this._listeners.delete(e))}};function Jn(e){return Cn(this,e??`utf-8`)}var D=class e extends Pn{static[Symbol.hasInstance](t){return typeof t!=`object`||!t?!1:Object.prototype.isPrototypeOf.call(e.prototype,t)?!0:t.__excelts_stream===!0&&typeof t.read==`function`&&typeof t.pipe==`function`&&typeof t.on==`function`&&`readableFlowing`in t}constructor(e){super(),this._reader=null,this._reading=!1,this._ended=!1,this._endEmitted=!1,this._destroyed=!1,this._internalDestroy=!1,this._errored=null,this._closed=!1,this._flowing=!1,this._resumeScheduled=!1,this._hasFlowed=!1,this._encoding=null,this._decoder=null,this._didRead=!1,this._pushMode=!1,this._webStreamMode=!1,this._hasReadImpl=!1,this._constructed=!0,this._asyncIterState=null,this.__excelts_stream=!0,this._objectMode=e?.objectMode??!1,this._highWaterMark=e?.highWaterMark??kn(this._objectMode),this._buf=new Un(this._objectMode),this._pipes=new qn(this),this._autoDestroy=e?.autoDestroy??!0,this._emitClose=e?.emitClose??!0,e?.read?(this._read=e.read.bind(this),this._hasReadImpl=!0,this._pushMode=!0):this._hasSubclassRead()&&(this._hasReadImpl=!0,this._pushMode=!0),e?.destroy&&(this._destroy=e.destroy.bind(this)),e?.construct&&(this._constructFunc=e.construct.bind(this)),e?.stream?(this._stream=e.stream,this._webStreamMode=!0):this._stream=null,e?.encoding&&this.setEncoding(e.encoding),e?.signal&&this._setupAbortSignal(e.signal),this._maybeConstruct()}_maybeConstruct(){(this._constructFunc||this._hasSubclassConstruct())&&(this._constructed=!1,E(()=>{(this._constructFunc??this._construct.bind(this))(e=>{if(e){this.destroy(e);return}this._constructed=!0,this._hasReadImpl&&this._flowing&&!this._ended&&!this._destroyed&&this._callRead(this._highWaterMark)})}))}_hasSubclassConstruct(){let t=Object.getPrototypeOf(this);for(;t&&t!==e.prototype&&t!==Object.prototype;){if(Object.prototype.hasOwnProperty.call(t,`_construct`))return!0;t=Object.getPrototypeOf(t)}return!1}_hasSubclassRead(){let t=Object.getPrototypeOf(this);for(;t&&t!==e.prototype&&t!==Object.prototype;){if(Object.prototype.hasOwnProperty.call(t,`_read`))return!0;t=Object.getPrototypeOf(t)}return!1}_setupAbortSignal(e){if(e.aborted){this.destroy(i(e.reason));return}let t=()=>{r(),this.destroy(i(e.reason))},n=()=>{r()},r=()=>{e.removeEventListener(`abort`,t),this.off(`close`,n),this.off(`end`,n),this.off(`error`,n)};e.addEventListener(`abort`,t,{once:!0}),this.on(`close`,n),this.on(`end`,n),this.on(`error`,n)}static from(t,n){if(t&&typeof t.getReader==`function`)return e.fromWeb(t,n);if(typeof Blob<`u`&&t instanceof Blob)return e.fromWeb(t.stream(),n);if(t==null||typeof t!=`object`&&typeof t!=`string`){let e=TypeError(`The "iterable" argument must be an instance of Iterable. Received type ${typeof t} (${String(t)})`);throw e.code=`ERR_INVALID_ARG_TYPE`,e}let r=typeof t[Symbol.iterator]==`function`,i=typeof t[Symbol.asyncIterator]==`function`;if(!r&&!i&&typeof t!=`string`){let e=t?.constructor?.name??`Object`,n=TypeError(`The "iterable" argument must be an instance of Iterable. Received an instance of ${e}`);throw n.code=`ERR_INVALID_ARG_TYPE`,n}let a=new e({...n,objectMode:n?.objectMode??!0}),o=t;return tr(a,er(typeof o==`string`?[o]:o)),a}static isDisturbed(e){return e._didRead||(e._destroyed||e._errored!==null)&&!e._endEmitted}static isReadable(e){if(typeof e!=`object`||!e)return null;let t=e;return typeof t.read==`function`?t.destroyed||t._destroyed||t.readableEnded||t._endEmitted?!1:t.readable!==!1:null}static fromWeb(t,n){return new e({...n,stream:t})}static toWeb(e){return e._webStream}static wrap(t,n){return new e({objectMode:t.readableObjectMode??t.objectMode??!0,...n,destroy(e,n){typeof t.destroy==`function`&&t.destroy(e??void 0),n(e)}}).wrap(t)}push(e,t){if(this._destroyed)return!1;if(this._pushMode=!0,e!==null&&typeof e==`string`&&!this._objectMode){let n=Fn(e,t||`utf8`);n.toString=Jn,e=n}if(this._ended&&e!==null){let e=Error(`stream.push() after EOF`);return e.code=`ERR_STREAM_PUSH_AFTER_EOF`,E(()=>this.emit(`error`,e)),!1}if(e===null)return this._ended?!1:(this._ended=!0,this._buf.length===0&&E(()=>this._emitEndOnce()),!1);if(!this._objectMode&&(typeof e==`string`?e.length:e?.byteLength??e?.length??0)===0)return!0;if(this._flowing)return this._buf.length>0?(this._buf.push(e),this._objectMode?this._buf.length<this._highWaterMark:this._buf.byteSize<this._highWaterMark):(this._didRead=!0,this.emit(`data`,this._applyEncoding(e)),this._flowing?(this._hasReadImpl&&!this._ended&&E(()=>{this._flowing&&!this._ended&&!this._destroyed&&(this._callRead(this._highWaterMark),this._ended&&this._buf.length===0&&this._emitEndOnce())}),!0):!1);{let t=this._buf.length===0;return this._buf.push(e),t&&E(()=>this.emit(`readable`)),this._objectMode?this._buf.length<this._highWaterMark:this._buf.byteSize<this._highWaterMark}}_emitEndOnce(){if(this._endEmitted||this._destroyed||this._buf.length>0)return;let e=this._flushDecoder();e&&this.emit(`data`,e),this._endEmitted=!0,this.emit(`end`),this._autoDestroy&&this.destroy()}unshift(e,t){if(this._destroyed)return;if(e===null){this._ended||(this._ended=!0,this._buf.length===0&&E(()=>this._emitEndOnce()));return}if(this._endEmitted){let e=Error(`stream.unshift() after end event`);e.code=`ERR_STREAM_UNSHIFT_AFTER_END_EVENT`,E(()=>this.emit(`error`,e));return}if(typeof e==`string`&&!this._objectMode){let n=Fn(e,t||`utf8`);n.toString=Jn,e=n}let n=this._buf.length===0;this._buf.unshift(e),this._flowing?E(()=>{for(;this._buf.length>0&&this._flowing;){let e=this._buf.shift();this._didRead=!0,this.emit(`data`,this._applyEncoding(e))}this._ended&&this._buf.length===0&&this._emitEndOnce()}):n&&E(()=>this.emit(`readable`))}_callRead(e){try{this._read(e)}catch(e){let t=e instanceof Error?e:Error(String(e));this._internalDestroy=!0,this.destroy(t)}}read(e){this._didRead=!0;let t;if(e!=null){if(t=parseInt(e,10),isNaN(t))t=void 0;else if(t<=0){if(t===0&&!this._ended&&!this._destroyed&&this._constructed){let e=this._objectMode?this._buf.length:this._buf.byteSize;(e<this._highWaterMark||e===0)&&this._callRead(this._highWaterMark)}return null}}if(this._buf.length===0)return!this._ended&&!this._destroyed&&this._constructed&&this._callRead(this._highWaterMark),null;if(this._objectMode){let e=this._buf.shift();return this._ended&&this._buf.length===0&&E(()=>this._emitEndOnce()),this._hasReadImpl&&!this._ended&&!this._destroyed&&this._constructed&&this._buf.length<this._highWaterMark&&E(()=>{!this._ended&&!this._destroyed&&this._callRead(this._highWaterMark)}),e}let n;if(t==null)n=this._applyEncoding(this._buf.consumeAll());else if(this._buf.byteSize<t)if(this._ended)n=this._applyEncoding(this._buf.consumeAll());else return this._hasReadImpl&&this._constructed&&this._callRead(Math.max(t,this._highWaterMark)),null;else n=this._applyEncoding(this._buf.consumeBytes(t));return this._hasReadImpl&&!this._ended&&!this._destroyed&&this._buf.byteSize<this._highWaterMark&&E(()=>{!this._ended&&!this._destroyed&&this._callRead(this._highWaterMark)}),this._ended&&this._buf.length===0&&E(()=>this._emitEndOnce()),!this._flowing&&this._buf.length>0&&E(()=>this.emit(`readable`)),n}_flushDecoder(){if(!this._decoder)return null;let e=this._decoder.decode(new Uint8Array,{stream:!1});return this._decoder=null,e||null}setEncoding(e){return this._encoding=e,this._decoder=pn(e),this}_applyEncoding(e){return this._encoding&&e instanceof Uint8Array?(this._decoder||=pn(this._encoding),this._decoder.decode(e,{stream:!0})):e}wrap(e){let t=!1;return e.on(`data`,n=>{this.push(n)||(e.pause(),t=!0)}),e.on(`end`,()=>this.push(null)),e.on(`error`,e=>this.destroy(e)),e.on(`close`,()=>this.destroy()),this._hasReadImpl=!0,this._read=()=>{t&&(t=!1,e.resume())},this}pause(){return this._flowing?(this._flowing=!1,this.emit(`pause`)):this._hasFlowed=!0,this}resume(){return this._flowing||(this._flowing=!0,this._hasFlowed=!0,this._resumeScheduled||(this._resumeScheduled=!0,E(()=>{this._resumeScheduled=!1,this.emit(`resume`)}))),this._buf.length>0?E(()=>{for(;this._buf.length>0&&this._flowing;){let e=this._buf.shift();this._didRead=!0,this.emit(`data`,this._applyEncoding(e))}if(this._ended&&this._buf.length===0&&this._emitEndOnce(),this._flowing&&this._buf.length===0&&this._webStreamMode&&!this._pushMode&&!this._ended&&!this._destroyed&&this._startReading(),this._hasReadImpl&&this._flowing&&!this._ended&&!this._destroyed&&this._constructed){let e=this._objectMode?this._buf.length:this._buf.byteSize;(e<this._highWaterMark||e===0)&&this._callRead(this._highWaterMark)}}):this._ended&&this._buf.length===0?E(()=>this._emitEndOnce()):this._webStreamMode&&!this._pushMode?this._startReading():this._hasReadImpl&&E(()=>{this._flowing&&!this._ended&&!this._destroyed&&this._constructed&&(this._callRead(this._highWaterMark),this._ended&&this._buf.length===0&&this._emitEndOnce())}),this}on(e,t){return super.on(e,t),e===`data`?this.resume():e===`readable`&&(this._hasFlowed=!0,this._flowing=!1,(this._buf.length>0||this._ended)&&E(()=>this.emit(`readable`))),this}isPaused(){return this.readableFlowing===!1}pipe(e,t){return this._pipes.pipe(e,t)}unpipe(e){return this._pipes.unpipe(e),this}destroy(e){if(this._destroyed)return this;if(this._destroyed=!0,this._readableOverride=void 0,this.unpipe(),this._reader){let e=this._reader;this._reader=null,e.cancel().catch(()=>{}).finally(()=>{try{e.releaseLock()}catch{}})}let t=e=>{let t=e||null;t&&(this._errored=t),this._closed=!0;let n=()=>{t&&this.emit(`error`,t),this._emitClose&&this.emit(`close`)},r=this._endEmitted||this._internalDestroy;this._internalDestroy=!1,zn()&&!this._hasDestroyHook()&&r?n():E(n)};if(this._hasDestroyHook())try{this._destroy(e??null,t)}catch(e){t(e instanceof Error?e:Error(String(e)))}else t(e);return this}_destroy(e,t){t(e)}_undestroy(){this._destroyed=!1,this._closed=!1,this._errored=null}_hasDestroyHook(){return Object.prototype.hasOwnProperty.call(this,`_destroy`)||Object.getPrototypeOf(this)._destroy!==e.prototype._destroy}get _webStream(){if(this._stream)return this._stream;let e=this,t=!1,n=new ReadableStream({pull(n){return new Promise((r,i)=>{if(t)return r();let a=()=>{if(e._destroyed){if(e._errored){t=!0;try{n.error(e._errored)}catch{}return i(e._errored)}t=!0;try{n.close()}catch{}return r()}let o=e.read();if(o!==null){try{n.enqueue(o)}catch{}return r()}if(e._endEmitted){t=!0;try{n.close()}catch{}return r()}let s=()=>{d(),a()},c=()=>{d(),t=!0;try{n.close()}catch{}r()},l=e=>{d(),t=!0;try{n.error(e)}catch{}i(e)},u=()=>{if(d(),!t){t=!0;try{n.close()}catch{}}r()},d=()=>{e.off(`readable`,s),e.off(`end`,c),e.off(`error`,l),e.off(`close`,u)};e.once(`readable`,s),e.once(`end`,c),e.once(`error`,l),e.once(`close`,u)};a()})},cancel(){e.destroy()}});return this._stream=n,n}get readable(){return this._readableOverride===void 0?!this._destroyed&&!this._endEmitted:this._readableOverride}set readable(e){this._readableOverride=e}get readableEnded(){return this._endEmitted}get readableLength(){return this._objectMode?this._buf.length:this._buf.byteSize}get destroyed(){return this._destroyed}set destroyed(e){this._destroyed=e}get errored(){return this._errored}get closed(){return this._closed}get readableFlowing(){return this._flowing?!0:this._hasFlowed?!1:null}set readableFlowing(e){e===!0?(this._flowing=!0,this._hasFlowed=!0):e===!1?(this._flowing=!1,this._hasFlowed=!0):(this._flowing=!1,this._hasFlowed=!1)}_setReadableFlowing(e){this.readableFlowing=e}get readableAborted(){return this._readableOverride===!1?!1:(this._destroyed||!!this._errored)&&!this._endEmitted}get readableDidRead(){return this._didRead}get readableEncoding(){return this._encoding}get readableObjectMode(){return this._objectMode}get readableHighWaterMark(){return this._highWaterMark}get readableBuffer(){return this._buf.toArray()}_releaseReader(){if(this._reader){let e=this._reader;this._reader=null;try{e.releaseLock()}catch{}}}async _startReading(){if(!(this._reading||this._destroyed||!this._flowing)){this._reading=!0;try{for(this._reader||=this._stream.getReader();this._flowing&&!this._destroyed&&!this._pushMode;){let{done:e,value:t}=await this._reader.read();if(this._pushMode){this._releaseReader();break}if(e){this._ended=!0,this._buf.length===0&&E(()=>this._emitEndOnce()),this._releaseReader();break}if(t!==void 0){let e=this._buf.length===0;for(this._buf.push(t),e&&E(()=>this.emit(`readable`));this._buf.length>0&&this._flowing;){let e=this._buf.shift();this._didRead=!0,this.emit(`data`,this._applyEncoding(e))}if(!this._flowing)break}}}catch(e){this.emit(`error`,e),this._releaseReader()}finally{this._reading=!1}}}async*[Symbol.asyncIterator](){this._asyncIterState||=this._initAsyncIterState();let e=this._asyncIterState;e.activeCount++;try{for(;;){if(e.streamError)throw e.streamError;if(e.dataQueueIndex<e.dataQueue.length){let t=e.dataQueue[e.dataQueueIndex];e.dataQueue[e.dataQueueIndex]=void 0,e.dataQueueIndex++,e.queuedSize-=this._chunkSizeForBackpressure(t),e.dataQueueIndex>=1024&&e.dataQueueIndex*2>=e.dataQueue.length&&(e.dataQueue.splice(0,e.dataQueueIndex),e.dataQueueIndex=0),this._maybeResumeIterState(e),yield t;continue}if(e.done)break;let t=await new Promise((t,n)=>{e.resolverQueue.push({resolve:t,reject:n})});if(t===null)break;yield t}}finally{e.activeCount--,e.activeCount===0&&this._teardownAsyncIterState(),this._destroyed||this.destroy()}}_chunkSizeForBackpressure(e){return this._objectMode?1:e instanceof Uint8Array?e.byteLength:typeof e==`string`?e.length:1}_maybeResumeIterState(e){e.pausedByIterator&&e.queuedSize<this._highWaterMark&&!e.done&&!this._destroyed&&(e.pausedByIterator=!1,this.resume())}_initAsyncIterState(){let e=this._highWaterMark,t={dataQueue:[],dataQueueIndex:0,queuedSize:0,resolverQueue:[],done:!1,streamError:null,activeCount:0,listenersAttached:!1,pausedByIterator:!1,dataHandler:null,doneHandler:null,errorHandler:null};for(t.dataHandler=n=>{if(t.resolverQueue.length>0){let{resolve:e}=t.resolverQueue.shift();e(n);return}t.dataQueue.push(n),t.queuedSize+=this._chunkSizeForBackpressure(n),!t.pausedByIterator&&t.queuedSize>=e&&(t.pausedByIterator=!0,this.pause())},t.doneHandler=()=>{t.done=!0;for(let{resolve:e}of t.resolverQueue)e(null);t.resolverQueue.length=0},t.errorHandler=e=>{t.done=!0,t.streamError=e;for(let{reject:n}of t.resolverQueue)n(e);t.resolverQueue.length=0};this._buf.length>0;){let e=this._applyEncoding(this._buf.shift());t.dataQueue.push(e),t.queuedSize+=this._chunkSizeForBackpressure(e)}if(this._ended){let e=this._flushDecoder();e&&(t.dataQueue.push(e),t.queuedSize+=this._chunkSizeForBackpressure(e)),t.done=!0}else this.on(`data`,t.dataHandler),this.on(`end`,t.doneHandler),this.on(`error`,t.errorHandler),this.on(`close`,t.doneHandler),t.listenersAttached=!0,this.resume();return t}_teardownAsyncIterState(){let e=this._asyncIterState;e&&(e.listenersAttached&&(this.off(`data`,e.dataHandler),this.off(`end`,e.doneHandler),this.off(`error`,e.errorHandler),this.off(`close`,e.doneHandler)),this._asyncIterState=null)}[Symbol.dispose](){this._destroyed||this.destroy()}async[Symbol.asyncDispose](){let e=!this._destroyed;return e&&this.destroy(),new Promise((t,n)=>{let r=()=>{e||this._endEmitted?t():n(Error(`Premature close`))};this._closed?r():this.once(`close`,r)})}iterator(e){if(e?.destroyOnReturn??!0)return this[Symbol.asyncIterator]();let t=this,n=null,r=null,i=!1,a=null,s=()=>{if(!n)return;let e=t.read();if(e!==null){let t=n;n=null,r=null,t({done:!1,value:e})}},c=()=>{s()},l=()=>{if(i=!0,n){let e=n;n=null,r=null,e({done:!0,value:void 0})}},u=e=>{if(i=!0,a=e,r){let t=r;n=null,r=null,t(e)}};t.on(`readable`,c),t.on(`end`,l),t.on(`error`,u);let d=()=>{t.off(`readable`,c),t.off(`end`,l),t.off(`error`,u)};return{next:async()=>{if(a)throw o(a);let e=t.read();return e===null?i?(d(),{done:!0,value:void 0}):new Promise((e,t)=>{n=e,r=t,s()}):{done:!1,value:e}},return:async e=>(d(),{done:!0,value:e}),throw:async e=>(d(),t.destroy(e),{done:!0,value:void 0}),[Symbol.asyncIterator](){return this}}}map(t,n){let r=n?.signal;Yn(r);let a=n?.concurrency??1,o=new AbortController,s=o.signal,c=new e({objectMode:!0});return tr(c,(async function*(e){try{yield*$n(e,e=>t(e,{signal:s}),a,r)}finally{o.abort()}})(this)),c.once(`close`,()=>{this.destroyed||this.destroy()}),r&&r.addEventListener(`abort`,()=>{c.destroy(i())},{once:!0}),c}filter(t,n){let r=n?.signal;Yn(r);let a=n?.concurrency??1,o=new AbortController,s=o.signal,c=new e({objectMode:!0}),l=Symbol(`skip`);return tr(c,(async function*(e){try{if(a<=1)for await(let n of e)Xn(r),await t(n,{signal:s})&&(yield n);else for await(let n of $n(e,async e=>await t(e,{signal:s})?e:l,a,r))n!==l&&(yield n)}finally{o.abort()}})(this)),c.once(`close`,()=>{this.destroyed||this.destroy()}),r&&r.addEventListener(`abort`,()=>{c.destroy(i())},{once:!0}),c}async forEach(e,t){let n=t?.signal;Yn(n);let r=t?.concurrency??1,i=new AbortController,a=i.signal;try{if(r<=1)for await(let t of this)Xn(n),await e(t,{signal:a});else for await(let t of $n(this,async t=>{await e(t,{signal:a})},r,n));}finally{i.abort()}}async toArray(e){let t=e?.signal;Yn(t);let n=[];for await(let e of this)Xn(t),n.push(e);return n}async some(e,t){let n=t?.signal;Yn(n);let r=t?.concurrency??1,i=new AbortController,a=i.signal;try{if(r<=1){for await(let t of this)if(Xn(n),await e(t,{signal:a}))return this.destroy(),!0}else for await(let t of $n(this,t=>e(t,{signal:a}),r,n))if(t)return this.destroy(),!0;return!1}finally{i.abort()}}async find(e,t){let n=t?.signal;Yn(n);let r=t?.concurrency??1,i=new AbortController,a=i.signal;try{if(r<=1){for await(let t of this)if(Xn(n),await e(t,{signal:a}))return this.destroy(),t}else for await(let t of $n(this,async t=>({chunk:t,match:await e(t,{signal:a})}),r,n))if(t.match)return this.destroy(),t.chunk;return}finally{i.abort()}}async every(e,t){let n=t?.signal;Yn(n);let r=t?.concurrency??1,i=new AbortController,a=i.signal;try{if(r<=1){for await(let t of this)if(Xn(n),!await e(t,{signal:a}))return this.destroy(),!1}else for await(let t of $n(this,t=>e(t,{signal:a}),r,n))if(!t)return this.destroy(),!1;return!0}finally{i.abort()}}flatMap(t,n){let r=n?.signal;Yn(r);let a=n?.concurrency??1,o=new AbortController,s=o.signal,c=new e({objectMode:!0});return tr(c,(async function*(e){try{if(a<=1)for await(let n of e){Xn(r);let e=await t(n,{signal:s});if(e&&typeof e[Symbol.asyncIterator]==`function`)for await(let t of e)yield t;else if(e&&typeof e[Symbol.iterator]==`function`)for(let t of e)yield t}else for await(let n of $n(e,async e=>{let n=await t(e,{signal:s}),r=[];if(n&&typeof n[Symbol.asyncIterator]==`function`)for await(let e of n)r.push(e);else if(n&&typeof n[Symbol.iterator]==`function`)for(let e of n)r.push(e);return r},a,r))for(let e of n)yield e}finally{o.abort()}})(this)),c.once(`close`,()=>{this.destroyed||this.destroy()}),r&&r.addEventListener(`abort`,()=>{c.destroy(i())},{once:!0}),c}drop(t,n){let r=n?.signal;Yn(r),Zn(t,`limit`);let a=new e({objectMode:!0});return tr(a,(async function*(e){let n=0;for await(let i of e)Xn(r),n>=t&&(yield i),n++})(this)),a.once(`close`,()=>{this.destroyed||this.destroy()}),r&&r.addEventListener(`abort`,()=>{a.destroy(i())},{once:!0}),a}take(t,n){let r=n?.signal;Yn(r),Zn(t,`limit`);let a=new e({objectMode:!0});return tr(a,(async function*(e){let n=0;for await(let i of e){if(Xn(r),n>=t)break;yield i,n++}})(this)),a.once(`close`,()=>{this.destroyed||this.destroy()}),r&&r.addEventListener(`abort`,()=>{a.destroy(i())},{once:!0}),a}async reduce(e,t,n){let r=n?.signal;Yn(r);let i=new AbortController,a=i.signal,o,s=arguments.length>=2,c=!0;try{for await(let n of this){if(Xn(r),c&&!s){o=n,c=!1;continue}c&&=(o=t,!1),o=await e(o,n,{signal:a})}if(c&&!s)throw TypeError(`Reduce of an empty stream requires an initial value`);return c?t:o}finally{i.abort()}}asIndexedPairs(e){let t=0;return this.map(e=>[t++,e],e)}compose(t,n){if(typeof t==`function`){let n=new e({objectMode:!0});tr(n,t(this)),n.once(`close`,()=>{this.destroyed||this.destroy()});let r=Vn();return r?r(n):n}let r=t;if(this.pipe(r),r._readable&&r._writable)return r;if(r._readable){let e=Vn();return e?e(r._readable):r._readable}let i=Vn();return i?i(r):r}};D.prototype.addListener=D.prototype.on,D.prototype._read=function(e){let t=Error(`The _read() method is not implemented`);throw t.code=`ERR_METHOD_NOT_IMPLEMENTED`,t};function Yn(e){if(e!==void 0&&!(e instanceof AbortSignal))throw TypeError(`options.signal must be an AbortSignal`)}function Xn(e){if(e?.aborted)throw i(e.reason)}function Zn(e,t){if(typeof e!=`number`||Number.isNaN(e)||e<0||Math.floor(e)!==e)throw RangeError(`The value of "${t}" must be a non-negative integer. Received ${e}`)}let Qn=Symbol(`EOF`);async function*$n(e,t,n,r){if(n<=1){for await(let n of e)Xn(r),yield await t(n);return}let i=[],a=null,s=!1,c=e[Symbol.asyncIterator]();async function l(){let e=await c.next();return e.done?(s=!0,Qn):(Xn(r),t(e.value))}function u(){i.push(l().catch(e=>{throw a=e,e}))}try{for(;i.length<n&&!s&&!a;)Xn(r),u();for(;i.length>0;){Xn(r);let e=await i.shift();if(a)throw o(a);e!==Qn&&(yield e,!s&&!a&&u())}}finally{s||await c.return?.()}}function er(e){return e&&typeof e[Symbol.asyncIterator]==`function`?e:(async function*(){for(let t of e)yield t})()}function tr(e,t){let n=t[Symbol.asyncIterator](),r=!1,i=!1;e._hasReadImpl=!0,e._read=function(){r||i||(r=!0,(async()=>{try{if(e.destroyed){if(!i){i=!0;let e=n.return?.();e&&typeof e.then==`function`&&e.catch(()=>{})}return}let{value:t,done:r}=await n.next();if(r){i=!0,e.push(null);return}e.push(t)}catch(t){e.destroy(t)}finally{r=!1}})())},e._pushMode=!0}function nr(e){return Cn(this,e??`utf-8`)}var rr=class e extends Pn{static[Symbol.hasInstance](t){return typeof t!=`object`||!t?!1:Object.prototype.isPrototypeOf.call(e.prototype,t)?!0:t.__excelts_stream===!0&&typeof t.write==`function`&&typeof t.end==`function`&&typeof t.on==`function`&&`writableFinished`in t}constructor(e){if(super(),this._stream=null,this._writer=null,this._ended=!1,this._finished=!1,this._syncFinish=!1,this._destroyed=!1,this._errored=null,this._errorEmitted=!1,this._closed=!1,this._writableLength=0,this._needDrain=!1,this._corked=0,this._corkedChunks=[],this._defaultEncoding=`utf8`,this._ownsStream=!1,this._directWrite=!1,this._writeQueue=[],this._writing=!1,this._pendingEnd=null,this._constructed=!0,this._resolvedWritev=null,this.__excelts_stream=!0,this._objectMode=e?.objectMode??!1,this._highWaterMark=e?.highWaterMark??kn(this._objectMode),this._autoDestroy=e?.autoDestroy??!0,this._emitClose=e?.emitClose??!0,this._decodeStrings=e?.decodeStrings??!0,this._defaultEncoding=e?.defaultEncoding??`utf8`,e?.stream)this._stream=e.stream,this._ownsStream=!1,this._directWrite=!1;else{if(e?.write&&(this._writeFunc=e.write.bind(this)),e?.final)this._finalFunc=e.final.bind(this);else{let e=this._getSubclassFinal();e&&(this._finalFunc=e)}if(e?.destroy&&(this._destroy=e.destroy.bind(this)),e?.construct&&(this._constructFunc=e.construct.bind(this)),e?.writev&&(this._writevFunc=e.writev.bind(this)),this._ownsStream=!0,this._writeFunc)this._directWrite=!0,this._stream=null;else{let t=e?.construct||this._hasSubclassConstruct(),n=this._getSubclassWrite();t&&n?(this._writeFunc=n,this._directWrite=!0,this._stream=null):(this._directWrite=!1,this._stream=new WritableStream({write:async e=>{this._write&&await new Promise((t,n)=>{this._write(e,`utf8`,e=>{e?n(e):t()})})},close:async()=>{if(this._finalFunc){let e=await new Promise(e=>{this._finalFunc(t=>{e(t??null)})});if(e){this._errored=e,this._errorEmitted=!0,this.emit(`error`,e),this._autoDestroy&&this.destroy(e);return}}this._finished=!0,this.emit(`finish`),this._autoDestroy&&this.destroy()},abort:e=>{this.emit(`error`,e)}}))}}e?.signal&&this._setupAbortSignal(e.signal),this._resolvedWritev=this._writevFunc??this._getWritevHook(),this._maybeConstruct()}_maybeConstruct(){(this._constructFunc||this._hasSubclassConstruct())&&(this._constructed=!1,E(()=>{(this._constructFunc??this._construct.bind(this))(e=>{if(e){this.destroy(e);return}if(this._constructed=!0,this._directWrite&&this._writeQueue.length>0&&!this._writing)this._writing=!0,this._drainWriteQueue();else if(this._pendingEnd&&!this._writing){let{cb:e}=this._pendingEnd;this._pendingEnd=null,this._doFinish(e)}})}))}_hasSubclassConstruct(){let t=Object.getPrototypeOf(this);for(;t&&t!==e.prototype&&t!==Object.prototype;){if(Object.prototype.hasOwnProperty.call(t,`_construct`))return!0;t=Object.getPrototypeOf(t)}return!1}_getSubclassWrite(){let t=Object.getPrototypeOf(this);for(;t&&t!==e.prototype&&t!==Object.prototype;){if(Object.prototype.hasOwnProperty.call(t,`_write`))return t._write.bind(this);t=Object.getPrototypeOf(t)}return null}_getSubclassFinal(){let t=Object.getPrototypeOf(this);for(;t&&t!==e.prototype&&t!==Object.prototype;){if(Object.prototype.hasOwnProperty.call(t,`_final`))return t._final.bind(this);t=Object.getPrototypeOf(t)}return null}_getWritevHook(){let t=Object.getPrototypeOf(this);return t._writev&&t._writev!==e.prototype._writev?t._writev.bind(this):null}_setupAbortSignal(e){if(e.aborted){this.destroy(i(e.reason));return}let t=()=>{r(),this.destroy(i(e.reason))},n=()=>{r()},r=()=>{e.removeEventListener(`abort`,t),this.off(`close`,n),this.off(`finish`,n),this.off(`error`,n)};e.addEventListener(`abort`,t,{once:!0}),this.on(`close`,n),this.on(`finish`,n),this.on(`error`,n)}setDefaultEncoding(e){return Fn(``,e),this._defaultEncoding=e,this}cork(){this._corked++}uncork(){if(this._corked>0&&this._corked--,this._corked===0){let e=this._corkedChunks;if(this._corkedChunks=[],e.length===0)return;for(let{chunk:t}of e)this._writableLength-=this._getChunkSize(t);let t=this._resolvedWritev;if(t&&e.length>1){let n=e.map(({chunk:e,encoding:t})=>({chunk:e,encoding:t})),r=n.reduce((e,{chunk:t})=>e+this._getChunkSize(t),0);this._writableLength+=r,this._writing=!0;try{t(n,t=>{if(this._writableLength-=r,this._writing=!1,t){this._destroyed||(this._errored=t,this.emit(`error`,t),this._autoDestroy&&this.destroy(t));for(let{callback:n}of e)n?.(t);return}this._needDrain&&this._writableLength<this._highWaterMark&&(this._needDrain=!1,E(()=>this.emit(`drain`)));for(let{callback:t}of e)t?.(null);this._drainWriteQueue()})}catch(t){this._writableLength-=r,this._writing=!1;let n=t instanceof Error?t:Error(String(t));this._destroyed||(this._errored=n,this.emit(`error`,n),this._autoDestroy&&this.destroy(n));for(let{callback:t}of e)t?.(n)}}else for(let{chunk:t,encoding:n,callback:r}of e)this._doWrite(t,n,r)}}write(e,t,n){if(e===null){let e=TypeError(`May not write null values to stream`);throw e.code=`ERR_STREAM_NULL_VALUES`,e}if(this._destroyed||this._ended){let e=this._destroyed&&!this._ended,r=Error(e?`Cannot call write after a stream was destroyed`:`write after end`);r.code=e?`ERR_STREAM_DESTROYED`:`ERR_STREAM_WRITE_AFTER_END`;let i=typeof t==`function`?t:n;return this._errored||=r,i&&E(()=>i(r)),!this._destroyed&&!this._errorEmitted&&(this._errorEmitted=!0,E(()=>this.emit(`error`,r))),!1}let r=typeof t==`string`?t:this._defaultEncoding,i=typeof t==`function`?t:n;if(this._corked>0){let t=this._normalizeWriteChunk(e,r);this._corkedChunks.push({chunk:t.chunk,encoding:t.encoding,callback:i});let n=this._getChunkSize(t.chunk,t.encoding);this._writableLength+=n;let a=this._writableLength<this._highWaterMark;return a||(this._needDrain=!0),a}let a=this._normalizeWriteChunk(e,r),o=this._doWrite(a.chunk,a.encoding,i);return o||(this._needDrain=!0),o}_doWrite(e,t,n){let r=this._getChunkSize(e,t);return this._writableLength+=r,this._directWrite?this._writing||!this._constructed?this._writeQueue.push({chunk:e,chunkSize:r,encoding:t,callback:n}):(this._writing=!0,this._callWriteFunc(e,r,t,n)):this._getWriter().write(e).then(()=>{this._writableLength-=r,this._needDrain&&this._writableLength<this._highWaterMark&&(this._needDrain=!1,E(()=>this.emit(`drain`))),n?.(null)}).catch(e=>{this._writableLength-=r,this._destroyed||(this._errored=e,this._errorEmitted=!0,this.emit(`error`,e),this._autoDestroy&&this.destroy(e)),n?.(e)}),this._writableLength<this._highWaterMark}_callWriteFunc(e,t,n,r){try{let i=this._objectMode?void 0:n,a=!1,o=!0;this._writeFunc(e,i,e=>{if(a){let e=Error(`Callback called multiple times`);e.code=`ERR_MULTIPLE_CALLBACK`,this.destroy(e);return}if(a=!0,e){if(this._writableLength-=t,this._destroyed?r?.(e):(this._errored=e,this._errorEmitted=!0,o?E(()=>{r?.(e),this.emit(`error`,e),this._autoDestroy&&this.destroy(e)}):(r?.(e),this.emit(`error`,e),this._autoDestroy&&this.destroy(e))),this._writing=!1,this._flushWriteQueueOnError(e),this._pendingEnd){let{cb:t}=this._pendingEnd;this._pendingEnd=null,t?.(e)}return}this._writableLength-=t,this._needDrain&&this._writableLength<this._highWaterMark&&(this._needDrain=!1,E(()=>this.emit(`drain`))),r?.(null),this._drainWriteQueue()}),o=!1}catch(e){this._writableLength-=t;let n=e instanceof Error?e:Error(String(e));if(this._destroyed||(this._errored=n,this.emit(`error`,n),this._autoDestroy&&this.destroy(n)),r?.(n),this._writing=!1,this._flushWriteQueueOnError(n),this._pendingEnd){let{cb:e}=this._pendingEnd;this._pendingEnd=null,e?.(n)}}}_drainWriteQueue(){if(this._writeQueue.length===0){if(this._writing=!1,this._pendingEnd){let{cb:e}=this._pendingEnd;this._pendingEnd=null,this._doFinish(e)}return}let e=this._resolvedWritev;if(e&&this._writeQueue.length>1){let t=this._writeQueue;this._writeQueue=[];let n=0,r=Array(t.length);for(let e=0;e<t.length;e++){let i=t[e];r[e]={chunk:i.chunk,encoding:i.encoding},n+=i.chunkSize}try{e(r,e=>{if(e){this._writableLength-=n,this._destroyed||(this._errored=e,this._errorEmitted=!0,this.emit(`error`,e));for(let n of t)n.callback?.(e);this._writing=!1,this._flushWriteQueueOnError(e);return}this._writableLength-=n,this._needDrain&&this._writableLength<this._highWaterMark&&(this._needDrain=!1,E(()=>this.emit(`drain`)));for(let e of t)e.callback?.(null);this._drainWriteQueue()})}catch(e){this._writableLength-=n,this._writing=!1;let r=e instanceof Error?e:Error(String(e));this._destroyed||(this._errored=r,this.emit(`error`,r));for(let e of t)e.callback?.(r)}}else{let e=this._writeQueue.shift();this._callWriteFunc(e.chunk,e.chunkSize,e.encoding,e.callback)}}_flushWriteQueueOnError(e){let t=this._writeQueue;this._writeQueue=[];for(let n of t)this._writableLength-=n.chunkSize,n.callback?.(e)}_doFinish(e){if(this._finalFunc)this._finalFunc(t=>{if(t){this._errorEmitted=!0,this.emit(`error`,t),e&&(this._pendingEnd={cb:e}),this._autoDestroy&&!this._destroyed&&this.destroy(t);return}let n=()=>{if(this._destroyed){e?.();return}this._finished=!0,this.emit(`prefinish`),e?.(),this.emit(`finish`),this._autoDestroy&&this.destroy()};this._syncFinish?(this._syncFinish=!1,n()):E(n)});else{let t=()=>{if(this._destroyed){e?.();return}this._finished=!0,this.emit(`prefinish`),e?.(),this.emit(`finish`),this._autoDestroy&&this.destroy()};zn()?t():E(t)}}_getChunkSize(e,t){return this._objectMode?1:e instanceof Uint8Array?e.byteLength:typeof e==`string`?ar(e,t):0}_normalizeWriteChunk(e,t){if(this._objectMode||typeof e!=`string`||!this._decodeStrings)return{chunk:e,encoding:t};let n=Fn(e,t);return n.toString=nr,{chunk:n,encoding:`buffer`}}end(e,t,n){if(this._ended){let{chunk:r,encoding:i,cb:a}=Ln(e,t,n);if(r!==void 0)return this.write(r,i??this._defaultEncoding,e=>{a?.(e??null)}),this;if(this._finished&&a){let e=Error(`Cannot call end after a stream was finished`);e.code=`ERR_STREAM_ALREADY_FINISHED`,E(()=>a(e))}else E(()=>a?.(null));return this}this._ended=!0,this._writableOverride=void 0;let{chunk:r,encoding:i,cb:a}=Ln(e,t,n);if(this._corked>0&&(this._corked=1,this.uncork()),this._directWrite){if(r!==void 0){let e=this._normalizeWriteChunk(r,i??this._defaultEncoding);this._doWrite(e.chunk,e.encoding)}if(this._errored){let e=this._errored;return E(()=>a?.(e)),this}return this._writing||this._writeQueue.length>0?this._pendingEnd={cb:a}:this._doFinish(a),this}return(async()=>{try{let e=this._getWriter();if(r!==void 0){let{chunk:t}=this._normalizeWriteChunk(r,i??this._defaultEncoding);await e.write(t)}if(await e.close(),this._writer===e){this._writer=null;try{e.releaseLock()}catch{}}this._ownsStream||(this._finished=!0,this.emit(`finish`),this._autoDestroy&&this.destroy()),a&&a()}catch(e){this.emit(`error`,e)}})(),this}destroy(e){if(this._destroyed)return this;if(this._destroyed=!0,this._writableOverride=void 0,e&&!this._errored&&(this._errored=e),this._writeQueue.length>0&&this._flushWriteQueueOnError(e??Error(`Cannot call write after a stream was destroyed`)),this._corkedChunks.length>0){let t=e??Error(`Cannot call write after a stream was destroyed`);for(let e of this._corkedChunks)e.callback?.(t);this._corkedChunks=[]}let t=this._pendingEnd?.cb;if(this._pendingEnd=null,this._writing=!1,this._writer){let t=this._writer;this._writer=null,t.abort(e).catch(()=>{}).finally(()=>{try{t.releaseLock()}catch{}})}let n=e=>{let n=e||null;n&&(this._errored=n),this._closed=!0;let r=()=>{n&&!this._errorEmitted&&(this._errorEmitted=!0,this.emit(`error`,n)),this._emitClose&&this.emit(`close`),t?.(n)};zn()&&!this._hasDestroyHook()&&this._finished?r():E(r)};if(this._hasDestroyHook())try{this._destroy(e??null,n)}catch(e){n(e instanceof Error?e:Error(String(e)))}else n(e);return this}_destroy(e,t){t(e)}_undestroy(){this._destroyed=!1,this._closed=!1,this._errored=null,this._errorEmitted=!1}_hasDestroyHook(){return Object.prototype.hasOwnProperty.call(this,`_destroy`)||Object.getPrototypeOf(this)._destroy!==e.prototype._destroy}[Symbol.dispose](){this._destroyed||this.destroy()}async[Symbol.asyncDispose](){let e=!this._destroyed;return e&&this.destroy(),new Promise((t,n)=>{let r=()=>{e||this._finished?t():n(Error(`Premature close`))};this._closed?r():this.once(`close`,r)})}get _webStream(){return this._stream||=new WritableStream({write:e=>new Promise((t,n)=>{let r=this._objectMode?void 0:this._defaultEncoding;this._writeFunc(e,r,e=>{e?n(e):t()})}),close:async()=>{this._finalFunc&&await new Promise((e,t)=>{this._finalFunc(n=>{n?t(n):e()})})},abort:e=>{this.emit(`error`,e)}}),this._stream}get writable(){return this._writableOverride===void 0?!this._destroyed&&!this._ended:this._writableOverride}set writable(e){this._writableOverride=e}get writableEnded(){return this._ended}get writableFinished(){return this._finished}get writableLength(){return this._writableLength}get destroyed(){return this._destroyed}set destroyed(e){this._destroyed=e}get errored(){return this._errored}get closed(){return this._closed}get writableNeedDrain(){return this._needDrain}get writableCorked(){return this._corked}get writableAborted(){return this._writableOverride===!1?!1:(this._destroyed||!!this._errored)&&!this._finished}get writableObjectMode(){return this._objectMode}get writableHighWaterMark(){return this._highWaterMark}get writableBuffer(){let e=this._corkedChunks.map(e=>e.chunk);for(let t of this._writeQueue)e.push(t.chunk);return e}pipe(){let e=new jn(`pipe`,`not readable`);e.code=`ERR_STREAM_CANNOT_PIPE`,E(()=>this.emit(`error`,e))}_getWriter(){return this._writer||=this._webStream.getWriter(),this._writer}static isDisturbed(e){return e&&e._readable instanceof D?D.isDisturbed(e._readable):D.isDisturbed(e)}static fromWeb(t,n){return new e({...n,stream:t})}static toWeb(e){return e._webStream}};rr.prototype._writev=null,rr.prototype._write=function(e,t,n){let r=Error(`The _write() method is not implemented`);throw r.code=`ERR_METHOD_NOT_IMPLEMENTED`,r};function ir(e){return e instanceof rr?e:e?.getWriter?new rr({stream:e}):e}function ar(e,t){let n=(t??`utf8`).toLowerCase();return n===`ascii`||n===`latin1`||n===`binary`?e.length:n===`utf16le`||n===`utf-16le`||n===`ucs2`?e.length*2:or(e)}function or(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r<=127?t+=1:r<=2047?t+=2:r>=55296&&r<=56319?(t+=4,n++):t+=3}return t}var sr=class e extends Pn{static[Symbol.hasInstance](t){return typeof t!=`object`||!t?!1:Object.prototype.isPrototypeOf.call(e.prototype,t)?!0:t.__excelts_stream===!0&&typeof t.read==`function`&&typeof t.pipe==`function`&&typeof t.write==`function`&&typeof t.end==`function`&&typeof t.on==`function`&&`readableFlowing`in t&&`writableFinished`in t}static isDisturbed(e){return e&&e._readable instanceof D?D.isDisturbed(e._readable):D.isDisturbed(e)}static from(t){if(t instanceof e)return t;let n=(e,t)=>{let n=new rr({objectMode:t.readableObjectMode,write(e,n,r){t.push(e),r()},final(e){t.push(null),e()}}),r=Gn(e,`error`,e=>{t.emit(`error`,e)});Gn(e,`end`,r,{once:!0}),Gn(e,`close`,r,{once:!0}),Gn(n,`finish`,r,{once:!0}),e.pipe(n)};if(t instanceof Promise){let r=new e({objectMode:!0});return t.then(t=>{n(e.from(t),r)}).catch(e=>{r.destroy(e instanceof Error?e:Error(String(e)))}),r}if(typeof t==`string`){let r=D.from([t]),i=new e({objectMode:!0});return n(r,i),i}if(typeof Blob<`u`&&t instanceof Blob){let r=D.fromWeb(t.stream()),i=new e;return n(r,i),i}if(typeof t==`object`&&t&&`readable`in t&&`writable`in t){let r=t,i=new e({readableObjectMode:r.readable?.readableObjectMode,writableObjectMode:r.writable?.writableObjectMode,write:r.writable?(e,t,n)=>{r.writable.write(e,t,n)}:void 0,final:r.writable?e=>{r.writable.end(e)}:void 0,destroy:(e,t)=>{r.readable&&!r.readable.destroyed&&r.readable.destroy(e??void 0),r.writable&&!r.writable.destroyed&&r.writable.destroy(e??void 0),t(e)}});return r.readable&&n(r.readable,i),i}if(typeof t==`object`&&t&&typeof t.getReader==`function`&&typeof t.cancel==`function`){let r=D.fromWeb(t),i=new e({objectMode:r.readableObjectMode});return n(r,i),i}if(typeof t==`object`&&t&&typeof t.getWriter==`function`&&typeof t.close==`function`){let n=rr.fromWeb(t);return new e({objectMode:n.writableObjectMode,write(e,t,r){n.write(e,t,r)},final(e){n.end(e)},destroy(e,t){n.destroyed||n.destroy(e??void 0),t(e)}})}if(typeof t==`object`&&t&&(Symbol.asyncIterator in t||Symbol.iterator in t)){let r=D.from(t),i=new e({objectMode:r.readableObjectMode});return n(r,i),i}if(t instanceof D){let r=new e({objectMode:t.readableObjectMode});return n(t,r),r}if(t instanceof rr)return new e({objectMode:t.writableObjectMode,write(e,n,r){t.write(e,n,r)},final(e){t.end(e)}});throw new Mn(`Duplex-compatible source`,typeof t)}static fromWeb(t,n){let r=new e(n),i=new D({stream:t.readable,objectMode:r.readableObjectMode}),a=new rr({stream:t.writable,objectMode:r.writableObjectMode});return r._sideForwardingCleanup&&=(r._sideForwardingCleanup(),null),r._readable=i,r._writable=a,r._setupSideForwarding(),r}static toWeb(e){return{readable:D.toWeb(e._readable),writable:rr.toWeb(e._writable)}}_getSubclassHook(t){let n=Object.getPrototypeOf(this);for(;n&&n!==e.prototype&&n!==Object.prototype;){if(Object.prototype.hasOwnProperty.call(n,t)){let e=this[t];return typeof e==`function`?e.bind(this):void 0}n=Object.getPrototypeOf(n)}}constructor(e){super(),this._dataForwardingSetup=!1,this._destroyed=!1,this._errored=null,this._closed=!1,this._sideForwardingCleanup=null,this._constructed=!0,this.__excelts_stream=!0,this.allowHalfOpen=e?.allowHalfOpen??!0,this._emitClose=e?.emitClose??!0,this._autoDestroy=e?.autoDestroy??!0;let t=e?.objectMode??!1,n=e?.readableObjectMode??t,r=e?.writableObjectMode??t,i=e!=null&&Object.prototype.hasOwnProperty.call(e,`highWaterMark`),a=i?e.highWaterMark:e?.readableHighWaterMark,o=i?e.highWaterMark:e?.writableHighWaterMark;e?.destroy&&(this._destroy=e.destroy.bind(this)),e?.construct&&(this._constructFunc=e.construct.bind(this));let s,c,l=this._hasConstructHook(),u=e?.read?e.read.bind(this):this._getSubclassHook(`_read`),d=e?.write?e.write.bind(this):this._getSubclassHook(`_write`),f=e?.writev?e.writev.bind(this):this._getSubclassHook(`_writev`),p=e?.final?e.final.bind(this):this._getSubclassHook(`_final`);this._readable=new D({highWaterMark:a,objectMode:n,read:u,encoding:e?.encoding,emitClose:!1,autoDestroy:!1,construct:l?e=>{s=e}:void 0}),this._writable=new rr({highWaterMark:o,objectMode:r,write:d,writev:f,final:p,decodeStrings:e?.decodeStrings,defaultEncoding:e?.defaultEncoding,emitClose:!1,autoDestroy:!1,construct:l?e=>{c=e}:void 0});let m=()=>{};this._readable.on(`error`,m),this._writable.on(`error`,m),this._setupSideForwarding(),e?.signal&&this._setupAbortSignal(e.signal),l&&(this._constructed=!1,E(()=>{(this._constructFunc??this._construct.bind(this))(e=>{if(e){s?.(e),c?.(e),this.destroy(e);return}this._constructed=!0,s?.(),c?.()})}))}_setupAbortSignal(e){if(e.aborted){this.destroy(i(e.reason));return}let t=()=>{this.destroy(i(e.reason))};e.addEventListener(`abort`,t,{once:!0}),this.once(`close`,()=>{e.removeEventListener(`abort`,t)})}_setupSideForwarding(){this._sideForwardingCleanup&&=(this._sideForwardingCleanup(),null),this._readable._pipes?.setSource(this);let e=Kn(),t=!1,n=e=>{t||(t=!0,this.emit(`error`,e))},r=!1,i=!1,a=()=>{this._autoDestroy&&r&&i&&!this._destroyed&&this.destroy()};e.once(this._readable,`end`,()=>{this.emit(`end`),r=!0,this.allowHalfOpen||this._writable.end(),a()}),e.add(this._readable,`error`,n);let o=()=>{this.emit(`readable`)};Pn.prototype.on.call(this._readable,`readable`,o),e.add(this._readable,`pause`,()=>this.emit(`pause`)),e.add(this._readable,`resume`,()=>this.emit(`resume`)),e.add(this._writable,`error`,n),e.once(this._writable,`prefinish`,()=>this.emit(`prefinish`)),e.once(this._writable,`finish`,()=>{this.emit(`finish`),i=!0,a()}),e.add(this._writable,`drain`,()=>this.emit(`drain`)),e.add(this._writable,`pipe`,e=>this.emit(`pipe`,e)),e.add(this._writable,`unpipe`,e=>this.emit(`unpipe`,e)),e.once(this._writable,`finish`,()=>{!this.allowHalfOpen&&!this._readable.readableEnded&&this._readable.push(null)});let s=this._readable.destroy.bind(this._readable);this._readable.destroy=e=>{let t=s(e);return this._destroyed||this.destroy(e),t},this._sideForwardingCleanup=()=>{e.cleanup(),this._readable.off(`readable`,o),this._readable.destroy=s}}on(e,t){return super.on(e,t),e===`data`&&!this._dataForwardingSetup?(this._dataForwardingSetup=!0,this._readable.on(`data`,e=>this.emit(`data`,e))):e===`readable`&&this._readable._setReadableFlowing(!1),this}push(e,t){return this._readable.push(e,t)}unshift(e,t){this._readable.unshift(e,t)}read(e){return this._readable.read(e)}write(e,t,n){let r=typeof t==`string`?t:void 0,i=typeof t==`function`?t:n;return r===void 0?this._writable.write(e,i):this._writable.write(e,r,i)}end(e,t,n){let{chunk:r,encoding:i,cb:a}=Ln(e,t,n);if(this._writable.writableEnded){if(r!==void 0)return this.write(r,i,e=>{a?.(e??null)}),this;if(this.writableFinished&&a){let e=Error(`Cannot call end after a stream was finished`);e.code=`ERR_STREAM_ALREADY_FINISHED`,E(()=>a(e))}else a&&E(()=>a(null));return this}if(a){let e=!1,t=()=>{e||(e=!0,a())};this.once(`finish`,t),this.once(`close`,t)}if(r!==void 0){let e=e=>{e&&!this.destroyed&&this.destroy(e)};i===void 0?this._writable.write(r,e):this._writable.write(r,i,e)}return this._writable.end(),this}cork(){this._writable.cork()}uncork(){this._writable.uncork()}setEncoding(e){return this._readable.setEncoding(e),this}setDefaultEncoding(e){return this._writable.setDefaultEncoding(e),this}pipe(e,t){return this._readable.pipe(e,t),e}unpipe(e){return this._readable.unpipe(e),this}pause(){return this._readable.pause(),this}resume(){return this._readable.resume(),this}isPaused(){return this._readable.isPaused()}destroy(e){if(this._destroyed)return this;this._destroyed=!0,this._sideForwardingCleanup&&=(this._sideForwardingCleanup(),null);let t=e=>{let t=e||null;t&&(this._errored=t),this._closed=!0,this._readable.destroy(),this._writable.destroy();let n=()=>{t&&this.emit(`error`,t),this._emitClose&&this.emit(`close`)};zn()&&!this._hasDestroyHook()&&this.readableEnded&&this.writableFinished?n():E(n)};if(this._hasDestroyHook())try{this._destroy(e??null,t)}catch(e){t(e instanceof Error?e:Error(String(e)))}else t(e);return this}_destroy(e,t){t(e)}_undestroy(){this._readable._undestroy(),this._writable._undestroy(),this._destroyed=!1,this._closed=!1,this._errored=null,this._setupSideForwarding()}_hasDestroyHook(){return Object.prototype.hasOwnProperty.call(this,`_destroy`)||Object.getPrototypeOf(this)._destroy!==e.prototype._destroy}_hasConstructHook(){if(this._constructFunc)return!0;let t=Object.getPrototypeOf(this);for(;t&&t!==e.prototype&&t!==Object.prototype;){if(Object.prototype.hasOwnProperty.call(t,`_construct`))return!0;t=Object.getPrototypeOf(t)}return!1}[Symbol.dispose](){this._destroyed||this.destroy()}async[Symbol.asyncDispose](){let e=!this._destroyed;return e&&this.destroy(),new Promise((t,n)=>{let r=()=>{e||this.writableFinished?t():n(Error(`Premature close`))};this._closed?r():this.once(`close`,r)})}get readable(){return this._readable.readable}set readable(e){this._readable.readable=e}get writable(){return this._writable.writable}set writable(e){this._writable.writable=e}get readableEnded(){return this._readable.readableEnded}get writableEnded(){return this._writable.writableEnded}get writableFinished(){return this._writable.writableFinished}get readableLength(){return this._readable.readableLength}get writableLength(){return this._writable.writableLength}get readableHighWaterMark(){return this._readable.readableHighWaterMark}get writableHighWaterMark(){return this._writable.writableHighWaterMark}get destroyed(){return this._destroyed}set destroyed(e){this._destroyed=e,this._readable.destroyed=e,this._writable.destroyed=e}get writableCorked(){return this._writable.writableCorked}get writableNeedDrain(){return this._writable.writableNeedDrain}get readableObjectMode(){return this._readable.readableObjectMode}get writableObjectMode(){return this._writable.writableObjectMode}get readableFlowing(){return this._readable.readableFlowing}get readableAborted(){return this._readable.readableAborted}get readableDidRead(){return this._readable.readableDidRead}get readableEncoding(){return this._readable.readableEncoding}get errored(){return this._errored??this._readable.errored??this._writable.errored}get closed(){return this._closed}get readableBuffer(){return this._readable.readableBuffer}get writableBuffer(){return this._writable.writableBuffer}wrap(e){return this._readable.wrap(e),this}iterator(e){return e?.destroyOnReturn===!1?this._readable.iterator(e):this._wrapAsyncIterator(this._readable[Symbol.asyncIterator]())}[Symbol.asyncIterator](){return this._wrapAsyncIterator(this._readable[Symbol.asyncIterator]())}_wrapAsyncIterator(e){let t=this;return{next(){return e.next()},async return(){let n=await e.return?.();return t.destroyed||t.destroy(),n??{value:void 0,done:!0}},async throw(n){let r=await e.throw?.(n);return t.destroyed||t.destroy(n instanceof Error?n:void 0),r??{value:void 0,done:!0}},[Symbol.asyncIterator](){return this}}}map(e,t){return this._readable.map(e,t)}filter(e,t){return this._readable.filter(e,t)}async forEach(e,t){return this._readable.forEach(e,t)}async toArray(e){return this._readable.toArray(e)}async some(e,t){return this._readable.some(e,t)}async find(e,t){return this._readable.find(e,t)}async every(e,t){return this._readable.every(e,t)}flatMap(e,t){return this._readable.flatMap(e,t)}drop(e,t){return this._readable.drop(e,t)}take(e,t){return this._readable.take(e,t)}async reduce(e,t,n){return arguments.length>=2?this._readable.reduce(e,t,n):this._readable.reduce(e)}compose(e,t){return this._readable.compose(e,t)}};sr.prototype.addListener=sr.prototype.on,sr.prototype._writev=null;var cr=class e extends Pn{static[Symbol.hasInstance](t){return typeof t!=`object`||!t?!1:Object.prototype.isPrototypeOf.call(e.prototype,t)?!0:t.__excelts_stream===!0&&typeof t.read==`function`&&typeof t.pipe==`function`&&typeof t.write==`function`&&typeof t.end==`function`&&typeof t.on==`function`&&typeof t._transform==`function`&&`readableFlowing`in t&&`writableFinished`in t}push(e,t){return this._readable.push(e,t)}constructor(t){super(),this._destroyed=!1,this._closed=!1,this._ended=!1,this._errored=null,this._dataForwardingSetup=!1,this._syncFinal=!1,this._endCalledFromSync=!1,this._endGeneration=0,this._endCallback=null,this._webStream=null,this._sideForwardingCleanup=null,this._afterTransformCallback=null,this.__excelts_stream=!0;let n=t?.objectMode??!1,r=t?.readableObjectMode??n,i=t?.writableObjectMode??n;this.allowHalfOpen=t?.allowHalfOpen??!0,this._emitClose=t?.emitClose??!0,this._autoDestroy=t?.autoDestroy??!0,this._transformImpl=t?.transform,this._flushImpl=t?.flush;let a=t!=null&&Object.prototype.hasOwnProperty.call(t,`highWaterMark`),o=a?t.highWaterMark:t?.readableHighWaterMark,s=a?t.highWaterMark:t?.writableHighWaterMark;t?.destroy&&(this._destroy=t.destroy.bind(this)),t?.construct&&(this._constructFunc=t.construct.bind(this));let c,l,u=this._hasConstructHook();this._readable=new D({highWaterMark:o,objectMode:r,encoding:t?.encoding,emitClose:!1,autoDestroy:!1,construct:u?e=>{c=e}:void 0}),this._readable._hasReadImpl=!0,this._readable._read=()=>{if(this._afterTransformCallback){let e=this._afterTransformCallback;this._afterTransformCallback=null,e(null)}},this._readable._pipes.setSource(this);let d=t?.write?(e,n,r)=>{t.write.call(this,e,n,r)}:(e,t,n)=>{let r=this._readable.readableLength,i=()=>{let e=this._readable.readableLength,t=this._readable.readableHighWaterMark;this._writable.writableEnded||r===e||e<t?n(null):this._afterTransformCallback=n},a=this._runTransformSync(e,t);a===void 0?i():a.then(()=>i(),e=>n(e))},f=t?.final?e=>{t.final.call(this,t=>{if(t){e(t);return}this._readable.push(null),e(null)})}:t=>{typeof this._final==`function`&&this._final!==e.prototype._final?this._final.call(this,e=>{if(e){t(e);return}t(null)}):this._hasSubclassFlush()||this._flushImpl?this._runFlush().then(()=>{this._readable.push(null),t(null)}).catch(e=>t(e)):this._syncFinal?(this._readable.push(null),this._readable._emitEndOnce(),t(null)):E(()=>{this._readable.push(null),t(null)})};this._writable=new rr({highWaterMark:s,objectMode:i,emitClose:!1,autoDestroy:!1,write:d,writev:t?.writev?.bind(this),final:f,decodeStrings:t?.decodeStrings,defaultEncoding:t?.defaultEncoding,construct:u?e=>{l=e}:void 0});let p=()=>{};this._readable.on(`error`,p),this._writable.on(`error`,p),this._setupSideForwarding(),t?.signal&&this._setupAbortSignal(t.signal),u&&E(()=>{(this._constructFunc??this._construct.bind(this))(e=>{if(e){c?.(e),l?.(e),this.destroy(e);return}c?.(),l?.()})})}_setupAbortSignal(e){if(e.aborted){this.destroy(i(e.reason));return}let t=()=>{this.destroy(i(e.reason))};e.addEventListener(`abort`,t,{once:!0}),this.once(`close`,()=>{e.removeEventListener(`abort`,t)})}_setupSideForwarding(){this._sideForwardingCleanup&&=(this._sideForwardingCleanup(),null),this._readable._pipes?.setSource(this);let e=Kn(),t=!1,n=!1,r=()=>{this._autoDestroy&&t&&n&&!this._destroyed&&this.destroy()};e.once(this._readable,`end`,()=>{this.emit(`end`),t=!0,this.allowHalfOpen||this._writable.end(),r()}),e.add(this._readable,`error`,e=>this._emitErrorOnce(e));let i=()=>{this.emit(`readable`)};Pn.prototype.on.call(this._readable,`readable`,i),e.add(this._readable,`pause`,()=>this.emit(`pause`)),e.add(this._readable,`resume`,()=>this.emit(`resume`)),e.once(this._writable,`prefinish`,()=>this.emit(`prefinish`)),e.once(this._writable,`finish`,()=>{this.emit(`finish`),n=!0,r()}),e.add(this._writable,`drain`,()=>this.emit(`drain`)),e.add(this._writable,`error`,e=>this._emitErrorOnce(e)),e.once(this._writable,`finish`,()=>{!this.allowHalfOpen&&!this._readable.readableEnded&&this._readable.push(null)}),this._sideForwardingCleanup=()=>{e.cleanup(),this._readable.off(`readable`,i)}}_scheduleEnd(){if(this._destroyed||this._errored||this._writable.writableEnded)return;let t=++this._endGeneration;E(()=>{t===this._endGeneration&&(this._destroyed||this._errored||this._writable.writableEnded||(this._endCalledFromSync&&!this._hasSubclassFlush()&&!this._flushImpl&&!(typeof this._final==`function`&&this._final!==e.prototype._final)&&this._readable._pipes._destinations.length===0&&(this._syncFinal=!0,this._writable._syncFinish=!0),this._writable.end(),this._syncFinal=!1,this._writable._syncFinish=!1))})}_emitErrorOnce(e){if(this._errored)return;let t=e instanceof Error?e:Error(String(e));this._errored=t,this._destroyed||this.destroy(t)}_hasSubclassTransform(){if(this._isSubclassTransform!==void 0)return this._isSubclassTransform;if(this._transformImpl)return this._isSubclassTransform=!1,!1;let t=Object.getPrototypeOf(this);return this._isSubclassTransform=t._transform!==e.prototype._transform,this._isSubclassTransform}_hasSubclassFlush(){if(this._flushImpl)return!1;let t=Object.getPrototypeOf(this);for(;t&&t!==e.prototype&&t!==Object.prototype;){if(Object.prototype.hasOwnProperty.call(t,`_flush`))return!0;t=Object.getPrototypeOf(t)}return!1}_runTransformSync(e,t){if(this._destroyed||this._errored)return;if(this._hasSubclassTransform()){let n=!0,r=!1,i=null,a,s=!1,c=null,l=null;if(this._transform(e,t,(e,t)=>{if(s){let e=Error(`Callback called multiple times`);e.code=`ERR_MULTIPLE_CALLBACK`,this.destroy(e);return}if(s=!0,n){r=!0,i=e??null,a=t;return}if(e){l?.(e);return}t!==void 0&&this.push(t),c?.()}),n=!1,r){if(i)throw o(i);a!==void 0&&this.push(a);return}return new Promise((e,t)=>{c=e,l=t})}let n=this._transformImpl;if(!n){let n=!0,r=!1,i=null,a,s=null,c=null;if(this._transform(e,t,(e,t)=>{if(n){r=!0,i=e??null,a=t;return}if(e){c?.(e);return}t!==void 0&&this.push(t),s?.()}),n=!1,r){if(i)throw o(i);a!==void 0&&this.push(a);return}return new Promise((e,t)=>{s=e,c=t})}let r=!0,i=!1,a=null,s,c=!1,l=null,u=null,d=new Promise((e,t)=>{l=e,u=t});if(n.call(this,e,t,(e,t)=>{if(c){let e=Error(`Callback called multiple times`);e.code=`ERR_MULTIPLE_CALLBACK`,this.destroy(e);return}if(c=!0,r){i=!0,a=e??null,s=t;return}if(e){u?.(e);return}t!==void 0&&this.push(t),l?.()}),r=!1,i){if(a)throw o(a);s!==void 0&&this.push(s);return}return d}async _runFlush(){if(this._destroyed||this._errored)return;if(this._hasSubclassFlush()){await new Promise((e,t)=>{this._flush((n,r)=>{if(n){t(n);return}r!==void 0&&this.push(r),e()})});return}let e=this._flushImpl;e&&await new Promise((t,n)=>{e.call(this,(e,r)=>{if(e){n(e);return}r!==void 0&&this.push(r),t()})})}on(e,t){return super.on(e,t),e===`data`&&!this._dataForwardingSetup?(this._dataForwardingSetup=!0,this._readable.on(`data`,e=>{this.emit(`data`,e)})):e===`readable`&&this._readable._setReadableFlowing(!1),this}write(e,t,n){let r=typeof t==`string`?t:void 0,i=typeof t==`function`?t:n;if(this._ended){let e=Error(`write after end`);return e.code=`ERR_STREAM_WRITE_AFTER_END`,E(()=>this.emit(`error`,e)),i&&E(()=>i(e)),!1}return r===void 0?this._writable.write(e,i):this._writable.write(e,r,i)}end(e,t,n){if(this._ended){let{chunk:r,encoding:i,cb:a}=Ln(e,t,n);if(r!==void 0)return this.write(r,i,e=>{a?.(e??null)}),this;if(this.writableFinished&&a){let e=Error(`Cannot call end after a stream was finished`);e.code=`ERR_STREAM_ALREADY_FINISHED`,E(()=>a(e))}else a&&E(()=>a(null));return this}let{chunk:r,encoding:i,cb:a}=Ln(e,t,n);if(a&&(this._endCallback=a,this.once(`finish`,()=>{let e=this._endCallback;e&&(this._endCallback=null,e())})),r!==void 0){let e=e=>{e&&!this._destroyed&&this.destroy(e)};i===void 0?this._writable.write(r,e):this._writable.write(r,i,e)}return this._ended=!0,this._endCalledFromSync=!zn(),this._scheduleEnd(),this}read(e){return this._readable.read(e)}pipe(e,t){return this._readable.pipe(e,t)}unpipe(e){return this._readable.unpipe(e),this}isPaused(){return this._readable.isPaused()}resume(){return this._readable.resume(),this}pause(){return this._readable.pause(),this}destroy(e){if(this._destroyed)return this;if(this._destroyed=!0,this._endGeneration++,this._afterTransformCallback){let t=this._afterTransformCallback;this._afterTransformCallback=null,t(e??null)}this._sideForwardingCleanup&&=(this._sideForwardingCleanup(),null);let t=e=>{let t=e||null;this._readable.destroy(),this._writable.destroy();let n=this._endCallback;this._endCallback=null,this._closed=!0;let r=()=>{n&&n(),t&&this.emit(`error`,t),this._emitClose&&this.emit(`close`)};zn()&&!this._hasDestroyHook()&&this.readableEnded&&this.writableFinished?r():E(r)};if(this._hasDestroyHook())try{this._destroy(e??null,t)}catch(e){t(e instanceof Error?e:Error(String(e)))}else t(e);return this}_destroy(e,t){t(e)}_undestroy(){this._readable._undestroy(),this._writable._undestroy(),this._destroyed=!1,this._closed=!1,this._errored=null,this._setupSideForwarding()}_hasDestroyHook(){return Object.prototype.hasOwnProperty.call(this,`_destroy`)||Object.getPrototypeOf(this)._destroy!==e.prototype._destroy}_hasConstructHook(){if(this._constructFunc)return!0;let t=Object.getPrototypeOf(this);for(;t&&t!==e.prototype&&t!==Object.prototype;){if(Object.prototype.hasOwnProperty.call(t,`_construct`))return!0;t=Object.getPrototypeOf(t)}return!1}[Symbol.dispose](){this._destroyed||this.destroy()}async[Symbol.asyncDispose](){let e=!this._destroyed;return e&&this.destroy(),new Promise((t,n)=>{let r=()=>{e||this.writableFinished?t():n(Error(`Premature close`))};this.closed?r():this.once(`close`,r)})}_getWebStream(){if(this._webStream)return this._webStream;let e=this[Symbol.asyncIterator](),t=new ReadableStream({pull:async t=>{let{done:n,value:r}=await e.next();if(n){t.close();return}t.enqueue(r)},cancel:e=>{this.destroy(e instanceof Error?e:Error(String(e)))}}),n=new WritableStream({write:e=>new Promise((t,n)=>{this.write(e,e=>{e?n(e):t()})}),close:()=>new Promise(e=>{this.end(()=>e())}),abort:e=>{this.destroy(e instanceof Error?e:Error(String(e)))}});return this._webStream={readable:t,writable:n},this._webStream}get readable(){return this._readable.readable}set readable(e){this._readable.readable=e}get writable(){return this._writable.writable}set writable(e){this._writable.writable=e}get readableEnded(){return this._readable.readableEnded}get writableEnded(){return this._ended||this._writable.writableEnded}get writableFinished(){return this._writable.writableFinished}get readableLength(){return this._readable.readableLength}get writableLength(){return this._writable.writableLength}get readableHighWaterMark(){return this._readable.readableHighWaterMark}get writableHighWaterMark(){return this._writable.writableHighWaterMark}get readableObjectMode(){return this._readable.readableObjectMode}get readableFlowing(){return this._readable.readableFlowing}get destroyed(){return this._destroyed}set destroyed(e){this._destroyed=e,this._readable.destroyed=e,this._writable.destroyed=e}cork(){this._writable.cork()}uncork(){this._writable.uncork()}setEncoding(e){return this._readable.setEncoding(e),this}setDefaultEncoding(e){return this._writable.setDefaultEncoding(e),this}unshift(e,t){this._readable.unshift(e,t)}wrap(e){return this._readable.wrap(e),this}iterator(e){return this._readable.iterator(e)}get writableCorked(){return this._writable.writableCorked}get writableNeedDrain(){return this._writable.writableNeedDrain}get writableObjectMode(){return this._writable.writableObjectMode}get readableAborted(){return this._readable.readableAborted}get readableDidRead(){return this._readable.readableDidRead}get readableEncoding(){return this._readable.readableEncoding}get errored(){return this._errored??this._readable.errored??this._writable.errored}get closed(){return this._closed}get readableBuffer(){return this._readable.readableBuffer}get writableBuffer(){return this._writable.writableBuffer}async*[Symbol.asyncIterator](){yield*this._readable[Symbol.asyncIterator]()}map(e,t){return this._readable.map(e,t)}filter(e,t){return this._readable.filter(e,t)}async forEach(e,t){return this._readable.forEach(e,t)}async toArray(e){return this._readable.toArray(e)}async some(e,t){return this._readable.some(e,t)}async find(e,t){return this._readable.find(e,t)}async every(e,t){return this._readable.every(e,t)}flatMap(e,t){return this._readable.flatMap(e,t)}drop(e,t){return this._readable.drop(e,t)}take(e,t){return this._readable.take(e,t)}async reduce(e,t,n){return arguments.length>=2?this._readable.reduce(e,t,n):this._readable.reduce(e)}compose(e,t){return this._readable.compose(e,t)}static isDisturbed(e){return e&&e._readable instanceof D?D.isDisturbed(e._readable):D.isDisturbed(e)}static from(e){return sr.from(e)}static fromWeb(t,n){let r=new e(n);r._webStream=t;let i=D.fromWeb(t.readable,{objectMode:n?.objectMode}),a=rr.fromWeb(t.writable,{objectMode:n?.objectMode});return r._sideForwardingCleanup&&=(r._sideForwardingCleanup(),null),r._readable=i,r._writable=a,r._setupSideForwarding(),r}static toWeb(e){return e._getWebStream()}_transform(e,t,n){let r=Error(`The _transform() method is not implemented`);throw r.code=`ERR_METHOD_NOT_IMPLEMENTED`,r}_final(e){typeof this._flush==`function`&&!this.destroyed?this._flush((t,n)=>{if(t){e(t);return}n!=null&&this.push(n),this.push(null),e()}):(this.push(null),e())}};cr.prototype.addListener=cr.prototype.on,cr.prototype._writev=null;var lr=class extends cr{_transform(e,t,n){n(null,e)}};let ur=e=>!e||typeof e!=`object`||typeof e.pipe==`function`||typeof e.write==`function`||typeof e.end==`function`||typeof e.getReader==`function`||typeof e.getWriter==`function`?!1:Object.prototype.hasOwnProperty.call(e,`signal`)||Object.prototype.hasOwnProperty.call(e,`end`),dr=e=>`readableEnded`in e||`readable`in e||typeof e.read==`function`,fr=e=>`writableFinished`in e||`writable`in e||typeof e.write==`function`,pr=e=>{let t=!dr(e)||!!e.readableEnded,n=!fr(e)||!!e.writableFinished;return t&&n},mr=()=>{let e=Error(`Premature close`);return e.code=`ERR_STREAM_PREMATURE_CLOSE`,e.name=`Error [ERR_STREAM_PREMATURE_CLOSE]`,e},hr=(e,t,n)=>{let r=e;if(r.closed||r._closed){t();return}`_emitClose`in r&&`_autoDestroy`in r&&r._emitClose!==!1&&r._autoDestroy!==!1?n.once(e,`close`,()=>t()):t()},gr=e=>e instanceof D||e instanceof rr||e instanceof cr||e instanceof sr?e:on(e)?cr.fromWeb(e):rn(e)?D.fromWeb(e):an(e)?rr.fromWeb(e):e,_r=e=>typeof e==`function`&&!(e instanceof D)&&!(e instanceof rr),vr=(e,t)=>{let n=t(e);return D.from(n)};function yr(...e){let t,n={},r,a=e[e.length-1];if(typeof a==`function`){r=a;let i=e[e.length-2];ur(i)?(n=i,t=e.slice(0,-2)):t=e.slice(0,-1)}else ur(a)?(n=a,t=e.slice(0,-1)):t=e;let o=new Promise((e,r)=>{if(t.length<2){r(Error(`Pipeline requires at least 2 streams`));return}let a=t.map(gr),o=[],s=[],c=a[0];o.push(c),s.push(c);for(let e=1;e<a.length;e++){let t=a[e];_r(t)?(c=vr(c,t),o.push(c),s[s.length-1]=c):(o.push(t),s.push(t),c=t)}let l=s[0],u=s[s.length-1],d=s.slice(1,-1);for(let e of o)if(e.destroyed&&!pr(e)){r(mr());return}let f=!1,p=Kn(),m,h=t=>{if(!f){if(f=!0,m&&n.signal&&n.signal.removeEventListener(`abort`,m),t){let e=()=>{};for(let n of o)typeof n.on==`function`&&n.on(`error`,e),typeof n.destroy==`function`&&!n.destroyed&&n.destroy(t)}p.cleanup(),t?r(t):e()}};if(n.signal){if(n.signal.aborted){h(i(n.signal.reason));return}m=()=>h(i(n.signal.reason)),n.signal.addEventListener(`abort`,m)}c=l;for(let e of d)c.pipe(e),c=e;if(n.end!==!1)c.pipe(u);else{let e=!1,t=!1,n=()=>{t=!1,e&&typeof c.resume==`function`&&(e=!1,c.resume())};p.add(c,`data`,r=>{!u.write(r)&&!t&&(t=!0,!e&&typeof c.pause==`function`&&(e=!0,c.pause()),p.once(u,`drain`,n))}),p.once(c,`end`,()=>{hr(c,h,p)})}n.end!==!1&&p.once(u,`finish`,()=>{hr(u,h,p)});for(let e of o)p.once(e,`close`,()=>{f||pr(e)||h(mr())});for(let e of o)p.once(e,`error`,e=>h(e))});return r&&o.then(()=>r()).catch(e=>r(e)),o}function br(e,t,n){let r={},a;typeof t==`function`?a=t:(r=t??{},a=n);let o=new Promise((t,n)=>{let a=gr(e),o=!1,s=Kn(),c,l=()=>{s.cleanup(),c&&r.signal&&r.signal.removeEventListener(`abort`,c)},u=e=>{o||(o=!0,l(),e?n(e):t())};if(r.signal){if(r.signal.aborted){u(i(r.signal.reason));return}c=()=>u(i(r.signal.reason)),r.signal.addEventListener(`abort`,c)}let d=a;if(d.destroyed||d._destroyed){if(d.errored||d._errored)u(d.errored??d._errored);else{let e=`readableEnded`in d||`readable`in d||typeof d.read==`function`,t=`writableFinished`in d||`writable`in d||typeof d.write==`function`,n=r.readable!==!1&&e,i=r.writable!==!1&&t,a=!n||!!(d.readableEnded||d._endEmitted),o=!i||!!(d.writableFinished||d._finished);a&&o?u():u(mr())}return}let f=`readableEnded`in a||`readable`in a||typeof a.read==`function`,p=`writableFinished`in a||`writable`in a||typeof a.write==`function`,m=r.readable!==!1&&f,h=r.writable!==!1&&p,g=!m||!!a.readableEnded,_=!h||!!a.writableFinished,v=a,y=`_emitClose`in v&&`_autoDestroy`in v&&v._emitClose!==!1&&v._autoDestroy!==!1&&!v._closed,b=()=>{if(g&&_){if(y)return;u()}};if(g&&_&&(!y||a.closed)){u();return}h&&!_&&s.once(a,`finish`,()=>{_=!0,b()}),m&&!g&&s.once(a,`end`,()=>{g=!0,b()}),r.error!==!1&&s.once(a,`error`,e=>u(e)),s.once(a,`close`,()=>{let e=g||!!a.readableEnded,t=_||!!a.writableFinished;if(e&&t){g=e,_=t,u(a.errored??a._errored??void 0);return}let n=a.errored??a._errored;if(n){u(n);return}let r=Error(`Premature close`);r.code=`ERR_STREAM_PREMATURE_CLOSE`,r.name=`Error [ERR_STREAM_PREMATURE_CLOSE]`,u(r)})});return a&&o.then(()=>a()).catch(e=>a(e)),o}Hn(e=>sr.from(e));function xr(e){return e.length<2}function Sr(e){return e.length<2}var Cr=class extends cr{constructor(e={}){super({objectMode:e.objectMode!==!1}),this.parseErrorsSink=[],this.buffer=``,this._rowTransform=null,this._rowValidator=null,this.autoDetectDelimiter=!1,this.delimiterDetected=!1,this.chunkBuffer=[],this.totalRowsProcessed=0,this.isFirstChunk=!0,this.chunkAborted=!1,this.beforeFirstChunkApplied=!1,this.bomStripped=!1,this.toLineReached=!1,this.headersEmitted=!1,this.totalCharsProcessed=0,this.backpressure=!1,this.pendingCallback=null,this.options=e,this.chunkSize=e.chunkSize??1e3,this.decoder=new TextDecoder(e.encoding||`utf-8`);let t=e.delimiter??`,`;this.autoDetectDelimiter=t===``;let{config:n}=Ct({options:e});this.parseConfig=n,this.parseState=Gt(n),this.scanner=Wt(Tt(n)),e.rowTransform&&this.transform(e.rowTransform),e.validate&&this.validate(e.validate)}_read(e){if(this.backpressure&&this.pendingCallback){this.backpressure=!1;let e=this.pendingCallback;this.pendingCallback=null,e()}}transform(e){if(typeof e!=`function`)throw TypeError(`The transform should be a function`);return xr(e)?this._rowTransform=(t,n)=>{try{n(null,e(t))}catch(e){n(e)}}:this._rowTransform=e,this}validate(e){if(typeof e!=`function`)throw TypeError(`The validate should be a function`);return Sr(e)?this._rowValidator=(t,n)=>{try{let r=e(t);typeof r==`boolean`?n(null,r):n(null,r.isValid,r.reason)}catch(e){n(e)}}:this._rowValidator=e,this}_transform(e,t,n){if(this.chunkAborted||this.toLineReached){n();return}try{let t=typeof e==`string`?e:this.decoder.decode(e,{stream:!0});if(this.buffer+=t,!this.beforeFirstChunkApplied&&this.options.beforeFirstChunk){this.beforeFirstChunkApplied=!0;let e=this.options.beforeFirstChunk(this.buffer);typeof e==`string`&&(this.buffer=e)}if(this.bomStripped||=(this.buffer=g(this.buffer),!0),this.autoDetectDelimiter&&!this.delimiterDetected){let e=this.options.comment,t=!1,n=0,r=this.buffer.length;for(;n<r;){let i=n;for(;i<r&&this.buffer[i]!==`
|
|
38
38
|
`&&this.buffer[i]!==`\r`;)i++;let a=this.buffer.slice(n,i).trim();if(a!==``&&(!e||!a.startsWith(e))){t=!0;break}if(n=i,n<r&&this.buffer[n]===`\r`&&n++,n<r&&this.buffer[n]===`
|
|
39
|
-
`&&n++,n===i)break}if(t){let e=this.options.skipEmptyLines;this.parseConfig.delimiter=y(this.buffer,this.parseConfig.quote||`"`,this.options.delimitersToGuess,this.options.comment,e),this.delimiterDetected=!0,this.emit(`delimiter`,this.parseConfig.delimiter),this.scanner=
|
|
40
|
-
`),n=e.lastIndexOf(`\r`),r;return r=n>t?n===e.length-1?t:n:t,r===-1?-1:r+1}let n=new RegExp(t.source,`${t.flags}g`),r=-1;for(let t=n.exec(e);t;t=n.exec(e))r=t.index+t[0].length,t[0].length===0&&n.lastIndex++;return r}processBufferFastMode(e,t){let{skipLines:n=0}=this.options,r=[],i=this.getFastModeCompleteDataEnd(this.buffer);if(i===-1){e();return}let a=this.buffer.slice(0,i);this.buffer=this.buffer.slice(i);for(let{line:i,lineLengthWithEnding:o}of Ot(a,this.parseConfig.linebreakRegex)){if(i===``&&t){this.parseState.lineNumber++,this.totalCharsProcessed+=o;continue}let a=i.split(this.parseConfig.delimiter),s=this.parseConfig.trimFieldIsIdentity?a:a.map(this.parseConfig.trimField),c=this.parseConfig.infoOption?qt(s.length):void 0,l=this._handleParsedRow({fields:s,charLength:o,raw:i,quoted:c,pendingRows:r,shouldSkipEmpty:t,skipLines:n,callback:e});if(l===`stop`||l===`error`)return}this.processPendingRows(r,e)}buildRow(e,t){let{dynamicTyping:n,castDate:r,groupColumnsByName:i=!1}=this.options,a;if(this.options.headers&&this.parseState.headerRow){let t=yt(e,this.parseState.headerRow,this.parseState.originalHeaders,i);a=n||r?pt(t,n||!1,r):t}else a=n||r?mt(e,this.parseState.headerRow?xt(this.parseState.headerRow):null,n||!1,r):e;return this.parseConfig.infoOption?(t||={index:0,line:this.parseState.currentRowStartLine,offset:this.parseState.currentRowStartOffset,quoted:[...this.parseState.currentRowQuoted],raw:this.parseConfig.rawOption?this.parseState.currentRawRow:void 0},{record:a,info:t}):a}_handleParsedRow(e){let{fields:t,charLength:n,raw:r,quoted:i,pendingRows:a,shouldSkipEmpty:o,skipLines:s,callback:c}=e,l=this.parseState.lineNumber+1;if(r!==void 0){let e=1;for(let t=0;t<r.length;t++){let n=r.charCodeAt(t);n===10?e++:n===13&&(t+1<r.length&&r.charCodeAt(t+1)===10&&t++,e++)}this.parseState.lineNumber+=e}else this.parseState.lineNumber++;let{toLine:u}=this.options;return u!==void 0&&this.parseState.lineNumber>u?(this.toLineReached=!0,this.totalCharsProcessed+=n,this.processPendingRows(a,c),`stop`):this.parseState.lineNumber<=s?(this.totalCharsProcessed+=n,`skip`):(this.parseConfig.infoOption&&(this.parseState.currentRowStartLine=l,this.parseState.currentRowStartOffset=this.totalCharsProcessed,i&&(this.parseState.currentRowQuoted=i)),this.totalCharsProcessed+=n,r!==void 0&&this.parseConfig.maxRowBytes!==void 0&&Fe(r)>this.parseConfig.maxRowBytes?(c(Error(`Row exceeds the maximum size of ${this.parseConfig.maxRowBytes} bytes`)),`error`):(this.parseConfig.rawOption&&r!==void 0&&(this.parseState.currentRawRow=r),this.shouldSkipRow(t,o)?`skip`:this.processCompletedRow(t,a)?`continue`:(this.processPendingRows(a,c),`stop`)))}processCompletedRow(e,t){let n=Pt(e,this.parseState,this.parseConfig,this.parseErrorsSink,this.parseState.lineNumber);if(this.parseErrorsSink.length=0,this.emitHeaders(),n.reason&&this.emit(`data-invalid`,e,n.reason),n.stop)return!1;if(n.skipped)return!0;if(n.row){let e=this.buildRow(n.row,n.info);if(n.extras&&n.extras.length>0){let t=this.parseConfig.infoOption?e.record:e;t._extra=n.extras}t.push(e)}return!0}emitHeaders(){!this.headersEmitted&&this.parseState.headerRow&&(this.headersEmitted=!0,this.emit(`headers`,xt(this.parseState.headerRow)))}shouldSkipRow(e,t){return Nt(e,this.parseConfig.comment,t,!1)}processPendingRows(e,t){if(e.length===0){t();return}if(this.chunkAborted){t();return}if(!this._rowTransform&&!this._rowValidator){let n=0,r=()=>{for(;n<e.length&&!this.chunkAborted;){let i=e[n++];if(this.options.chunk){if(this.chunkBuffer.push(i),this.totalRowsProcessed++,this.chunkBuffer.length>=this.chunkSize){this.flushChunk(e=>{if(e){t(e);return}if(this.chunkAborted){t();return}n%1e3==0?setTimeout(r,0):r()});return}}else if(!this.pushRow(i)){this.backpressure=!0,this.pendingCallback=()=>r();return}}t()};r();return}let n=0,r=()=>{if(n>=e.length){t();return}let i=e[n++];this.transformAndValidateRow(i,(e,i)=>{if(e){t(e);return}if(i&&i.isValid&&i.row!==null){if(this.options.chunk){if(this.chunkBuffer.push(i.row),this.totalRowsProcessed++,this.chunkBuffer.length>=this.chunkSize){this.flushChunk(e=>{if(e){t(e);return}n%1e3==0?setTimeout(r,0):r()});return}}else if(!this.pushRow(i.row)){this.backpressure=!0,this.pendingCallback=()=>r();return}}else i&&!i.isValid&&this.emit(`data-invalid`,i.row,i.reason);n%1e3==0?setTimeout(r,0):r()})};r()}flushChunk(e){if(this.chunkBuffer.length===0||!this.options.chunk){e();return}let t=this.chunkBuffer.length,n={cursor:this.totalRowsProcessed-t,rowCount:t,isFirstChunk:this.isFirstChunk,isLastChunk:!1};this.isFirstChunk=!1;let r=this.chunkBuffer;this.chunkBuffer=[],this.pushBufferedRows(r),this.invokeChunkCallback(r,n,e)}transformAndValidateRow(e,t){this._rowTransform?this._rowTransform(e,(e,n)=>{if(e){t(e);return}if(n==null){t(null,{row:null,isValid:!0});return}this.validateRow(n,t)}):this.validateRow(e,t)}validateRow(e,t){this._rowValidator?this._rowValidator(e,(n,r,i)=>{if(n){t(n);return}t(null,{row:e,isValid:r??!1,reason:i})}):t(null,{row:e,isValid:!0})}};function xr(e={}){return new br(e)}var Sr=class extends ar{constructor(e={}){super({objectMode:e.objectMode!==!1,writableObjectMode:e.objectMode!==!1}),this.headerWritten=!1,this.keys=null,this.displayHeaders=null,this.sourceRowIndex=0,this.outputRowIndex=0,this.options=e,this.formatConfig=ne(e);let t=this.formatConfig;this.rowOptions={quoteLookup:t.shouldQuoteColumn,delimiter:t.delimiter,headers:void 0,isHeader:!1,outputRowIndex:0,quoteAll:t.quoteAll,escapeFormulae:t.escapeFormulae,decimalSeparator:t.decimalSeparator,transform:t.typeTransform};let n=ge(e.columns);n?(this.keys=n.keys,this.displayHeaders=n.headers):Array.isArray(e.headers)&&(this.keys=e.headers,this.displayHeaders=e.headers),this.displayHeaders&&=me(this.displayHeaders)}detectHeadersFromRow(e){let t=pe(e);t.length>0&&(this.keys=t,this.displayHeaders=me(t))}_transform(e,t,n){try{!this.headerWritten&&this.formatConfig.bom&&this.push(``),this.headerWritten||=(this.options.headers===!0&&!this.keys&&this.detectHeadersFromRow(e),this.formatConfig.writeHeaders&&this.displayHeaders&&this.push(this.formatRow(this.displayHeaders,!0)),!0);let t=e,r=this.sourceRowIndex++;if(this.formatConfig.typeTransform?.row&&(t=this.formatConfig.typeTransform.row(e,r),t===null)){n();return}this.formatAndPush(t),this.outputRowIndex++,n()}catch(e){n(e)}}_destroy(e,t){this.keys=null,this.displayHeaders=null,t(e)}_flush(e){!this.headerWritten&&this.displayHeaders&&this.formatConfig.writeHeaders&&(this.formatConfig.bom&&this.push(``),this.push(this.formatRow(this.displayHeaders,!0)),this.headerWritten=!0);let t=this.formatConfig.writeHeaders&&this.displayHeaders||this.outputRowIndex>0;this.formatConfig.trailingNewline&&t&&this.push(this.formatConfig.lineEnding),e()}formatAndPush(e){let t=fe(e,this.keys);this.push(this.formatRow(t,!1))}formatRow(e,t=!1){let n=this.formatConfig,r=this.rowOptions;r.quoteLookup=t?n.shouldQuoteHeader:n.shouldQuoteColumn,r.headers=this.displayHeaders??void 0,r.isHeader=t,r.outputRowIndex=this.outputRowIndex;let i=Ee(e,n.regex,r);return t||!(n.writeHeaders&&this.displayHeaders)&&this.outputRowIndex===0?i:n.lineEnding+i}};function Cr(e={}){return new Sr(e)}var j=class extends n{constructor(e,t){super(e,t),this.name=`ExcelError`}};function wr(e){return e instanceof j}var Tr=class extends j{constructor(...e){super(...e),this.name=`WorksheetNameError`}},Er=class extends j{constructor(e,t,n){super(t?`Invalid address "${e}": ${t}`:`Invalid address: ${e}`,n),this.address=e,this.name=`InvalidAddressError`}},Dr=class extends j{constructor(e,t,n){super(t?`Column ${e} is out of bounds: ${t}`:`Column ${e} is out of bounds. Excel supports columns from 1 to 16384`,n),this.column=e,this.name=`ColumnOutOfBoundsError`}},Or=class extends j{constructor(e,t,n){super(t?`Row ${e} is out of bounds: ${t}`:`Row ${e} is out of bounds`,n),this.row=e,this.name=`RowOutOfBoundsError`}},kr=class extends j{constructor(e,t){super(e??`Cannot merge already merged cells`,t),this.name=`MergeConflictError`}},Ar=class extends j{constructor(e,t,n){super(t??`Cannot process value of type: ${e}`,n),this.valueType=e,this.name=`InvalidValueTypeError`}},jr=class extends j{constructor(e,t,n){super(t??`Unexpected XML content in ${e}`,n),this.context=e,this.name=`XmlParseError`}},Mr=class extends j{constructor(e,t,n){super(t?`${e}: ${t}`:`${e} is not supported`,n),this.operation=e,this.reason=t,this.name=`ExcelNotSupportedError`}},Nr=class extends j{constructor(e,t,n,r){super(n?`Failed to ${t} Excel file "${e}": ${n}`:`Failed to ${t} Excel file "${e}"`,r),this.path=e,this.operation=t,this.name=`ExcelFileError`}},Pr=class extends j{constructor(e,t,n){super(`Cannot ${e}: ${t}`,n),this.operation=e,this.state=t,this.name=`ExcelStreamStateError`}},Fr=class extends j{constructor(e,t,n,r){super(`Failed to download from "${e}": HTTP ${t} ${n}`,r),this.url=e,this.status=t,this.statusText=n,this.name=`ExcelDownloadError`}},Ir=class extends j{constructor(...e){super(...e),this.name=`PivotTableError`}},Lr=class extends j{constructor(...e){super(...e),this.name=`TableError`}},Rr=class extends j{constructor(...e){super(...e),this.name=`ImageError`}},zr=class extends j{constructor(e,t,n){super(`Max ${e} count (${t}) exceeded`,n),this.itemType=e,this.maxItems=t,this.name=`MaxItemsExceededError`}};let Br=/^[A-Z]+\d+$/,M={_dictionary:`ABCDEFGHIJKLMNOPQRSTUVWXYZ`.split(``),_l2nFill:0,_l2n:{},_n2l:[],_level(e){return e<=26?1:e<=676?2:3},_fill(e){let t,n,r,i,a,o=1;if(e>=4)throw new Dr(e,`Excel supports columns from 1 to 16384`);if(this._l2nFill<1&&e>=1){for(;o<=26;)t=this._dictionary[o-1],this._n2l[o]=t,this._l2n[t]=o,o++;this._l2nFill=1}if(this._l2nFill<2&&e>=2){for(o=27;o<=702;)n=o-27,r=n%26,i=Math.floor(n/26),t=this._dictionary[i]+this._dictionary[r],this._n2l[o]=t,this._l2n[t]=o,o++;this._l2nFill=2}if(this._l2nFill<3&&e>=3){for(o=703;o<=16384;)n=o-703,r=n%26,i=Math.floor(n/26)%26,a=Math.floor(n/676),t=this._dictionary[a]+this._dictionary[i]+this._dictionary[r],this._n2l[o]=t,this._l2n[t]=o,o++;this._l2nFill=3}},l2n(e){if(this._l2n[e]||this._fill(e.length),!this._l2n[e])throw new Dr(e,`Invalid column letter: ${e}`);return this._l2n[e]},n2l(e){if(e<1||e>16384)throw new Dr(e);return this._n2l[e]||this._fill(this._level(e)),this._n2l[e]},_hash:{},decodeCol(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r>=65&&r<=90)t=t*26+r-64;else break}return t},validateAddress(e){if(!Br.test(e))throw new Er(e);return!0},decodeAddress(e){if(!e||typeof e!=`string`)throw Error(`Invalid Address: ${e}`);let t=e.length<5&&this._hash[e];if(t)return t;let n=0,r=0,i=!1,a=!1,o=0,s=0;for(let t=0;t<e.length;t++){let c=e.charCodeAt(t);if(c===36){!i&&!a&&(s=t+1);continue}if(!a&&c>=65&&c<=90)i=!0,n=n*26+c-64,o=t+1;else if(c>=48&&c<=57)a=!0,r=r*10+c-48;else if(a&&i)break}if(!i)n=void 0;else if(n>16384){let t=e.slice(0,o);throw new Dr(t,`Invalid column letter: ${t}`)}a||(r=void 0);let c=i?e.slice(s,o):``,l=a?String(r):``,u=c+l,d={address:u,col:n,row:r,$col$row:`$${c}$${l}`};return n<=100&&r<=100&&(this._hash[u]=d,this._hash[d.$col$row]=d),d},getAddress(e,t){if(t){let n=this.n2l(t)+e;return this.decodeAddress(n)}return this.decodeAddress(e)},decode(e){if(!e||typeof e!=`string`)throw Error(`Invalid Address: ${e}`);let t=e.split(`:`);if(t.length===2){let e=this.decodeAddress(t[0]),n=this.decodeAddress(t[1]),r={top:Math.min(e.row,n.row),left:Math.min(e.col,n.col),bottom:Math.max(e.row,n.row),right:Math.max(e.col,n.col),tl:``,br:``,dimensions:``};return r.tl=this.n2l(r.left)+r.top,r.br=this.n2l(r.right)+r.bottom,r.dimensions=`${r.tl}:${r.br}`,r}return this.decodeAddress(e)},decodeEx(e){if(!e||typeof e!=`string`)throw Error(`Invalid Address: ${e}`);let t=e.match(/^(?:(?:(?:'((?:[^']|'')+?)')|([^'^ !]+?))!)?(.*)$/),n=t[1]||t[2],r=t[3],i=r.split(`:`);if(i.length>1){let e=this.decodeAddress(i[0]),t=this.decodeAddress(i[1]),r=Math.min(e.row,t.row),a=Math.min(e.col,t.col),o=Math.max(e.row,t.row),s=Math.max(e.col,t.col),c=this.n2l(a)+r,l=this.n2l(s)+o;return{top:r,left:a,bottom:o,right:s,sheetName:n,tl:{address:c,col:a,row:r,$col$row:`$${this.n2l(a)}$${r}`,sheetName:n},br:{address:l,col:s,row:o,$col$row:`$${this.n2l(s)}$${o}`,sheetName:n},dimensions:`${c}:${l}`}}if(r.indexOf(`#`)===0)return n?{sheetName:n,error:r}:{error:r};let a=this.decodeAddress(r);return n?{sheetName:n,...a}:a},encodeAddress(e,t){return M.n2l(t)+e},encode(...e){switch(e.length){case 2:return M.encodeAddress(e[0],e[1]);case 4:return`${M.encodeAddress(e[0],e[1])}:${M.encodeAddress(e[2],e[3])}`;default:throw new Er(String(e.length),`Can only encode with 2 or 4 arguments`)}},compareAddress(e,t){let n=M.decodeAddress(e),r=M.decodeAddress(t);return n.col-r.col||n.row-r.row},inRange(e,t){let[n,r,,i,a]=e,[o,s]=t;return o>=n&&o<=i&&s>=r&&s<=a}};var N=class e{constructor(...e){this.model={top:0,left:0,bottom:0,right:0},this.decode(e)}setTLBR(e,t,n,r,i){if(typeof e==`string`&&typeof t==`string`){let r=M.decodeAddress(e),i=M.decodeAddress(t);this.model={top:Math.min(r.row,i.row),left:Math.min(r.col,i.col),bottom:Math.max(r.row,i.row),right:Math.max(r.col,i.col),sheetName:typeof n==`string`?n:void 0}}else typeof e==`number`&&typeof t==`number`&&typeof n==`number`&&typeof r==`number`&&(this.model={top:Math.min(e,n),left:Math.min(t,r),bottom:Math.max(e,n),right:Math.max(t,r),sheetName:i})}decode(t){switch(t.length){case 5:typeof t[0]==`number`&&typeof t[1]==`number`&&typeof t[2]==`number`&&typeof t[3]==`number`&&typeof t[4]==`string`&&this.setTLBR(t[0],t[1],t[2],t[3],t[4]);break;case 4:typeof t[0]==`number`&&typeof t[1]==`number`&&typeof t[2]==`number`&&typeof t[3]==`number`&&this.setTLBR(t[0],t[1],t[2],t[3]);break;case 3:typeof t[0]==`string`&&typeof t[1]==`string`&&typeof t[2]==`string`&&this.setTLBR(t[0],t[1],t[2]);break;case 2:typeof t[0]==`string`&&typeof t[1]==`string`&&this.setTLBR(t[0],t[1]);break;case 1:{let n=t[0];if(n instanceof e)this.model={top:n.model.top,left:n.model.left,bottom:n.model.bottom,right:n.model.right,sheetName:n.sheetName};else if(Array.isArray(n))this.decode(n);else if(typeof n==`object`&&`top`in n&&`left`in n&&`bottom`in n&&`right`in n)this.model={top:n.top,left:n.left,bottom:n.bottom,right:n.right,sheetName:n.sheetName};else if(typeof n==`string`){let e=M.decodeEx(n);`top`in e?this.model={top:e.top,left:e.left,bottom:e.bottom,right:e.right,sheetName:e.sheetName}:`row`in e&&(this.model={top:e.row,left:e.col,bottom:e.row,right:e.col,sheetName:e.sheetName})}break}case 0:this.model={top:0,left:0,bottom:0,right:0};break;default:throw new j(`Invalid number of arguments to _getDimensions() - ${t.length}`)}}get top(){return this.model.top||1}set top(e){this.model.top=e}get left(){return this.model.left||1}set left(e){this.model.left=e}get bottom(){return this.model.bottom||1}set bottom(e){this.model.bottom=e}get right(){return this.model.right||1}set right(e){this.model.right=e}get sheetName(){return this.model.sheetName}set sheetName(e){this.model.sheetName=e}get _serialisedSheetName(){let{sheetName:e}=this.model;return e?/^[a-zA-Z0-9]*$/.test(e)?`${e}!`:`'${e}'!`:``}expand(e,t,n,r){(!this.model.top||e<this.top)&&(this.top=e),(!this.model.left||t<this.left)&&(this.left=t),(!this.model.bottom||n>this.bottom)&&(this.bottom=n),(!this.model.right||r>this.right)&&(this.right=r)}expandRow(e){if(e){let{dimensions:t,number:n}=e;t&&this.expand(n,t.min,n,t.max)}}expandToAddress(e){let t=M.decodeEx(e);`row`in t&&`col`in t&&this.expand(t.row,t.col,t.row,t.col)}get tl(){return M.n2l(this.left)+this.top}get $t$l(){return`$${M.n2l(this.left)}$${this.top}`}get br(){return M.n2l(this.right)+this.bottom}get $b$r(){return`$${M.n2l(this.right)}$${this.bottom}`}get range(){return`${this._serialisedSheetName+this.tl}:${this.br}`}get $range(){return`${this._serialisedSheetName+this.$t$l}:${this.$b$r}`}get shortRange(){return this.count>1?this.range:this._serialisedSheetName+this.tl}get $shortRange(){return this.count>1?this.$range:this._serialisedSheetName+this.$t$l}get count(){return(1+this.bottom-this.top)*(1+this.right-this.left)}toString(){return this.range}intersects(e){return!(e.sheetName&&this.sheetName&&e.sheetName!==this.sheetName||e.bottom<this.top||e.top>this.bottom||e.right<this.left||e.left>this.right)}contains(e){let t=M.decodeEx(e);return`row`in t&&`col`in t?this.containsEx(t):!1}containsEx(e){return e.sheetName&&this.sheetName&&e.sheetName!==this.sheetName?!1:e.row>=this.top&&e.row<=this.bottom&&e.col>=this.left&&e.col<=this.right}forEachAddress(e){for(let t=this.left;t<=this.right;t++)for(let n=this.top;n<=this.bottom;n++)e(M.encodeAddress(n,t),n,t)}};function Vr(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(e=>Vr(e));let t={};for(let n of Object.keys(e))n!==`__proto__`&&n!==`constructor`&&n!==`prototype`&&(t[n]=Vr(e[n]));return t}var Hr=class{constructor(e){this.template=e,this.sheets=new Map}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.get(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.get(e);r||(r=[],this.sheets.set(e,r));let i=t>>>0,a=n>>>0,o=r[i]||(r[i]=[]);return o[a]||(o[a]={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&&(n[e.col>>>0]=void 0)}forEachInSheet(e,t){let n=this.sheets.get(e);n&&n.forEach((e,n)=>{e&&e.forEach((e,r)=>{e&&t(e,n,r)})})}forEach(e){for(let t of this.sheets.keys())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.has(n))return this.sheets.get(n);if(t){let e=[];return this.sheets.set(n,e),e}}findSheetRow(e,t,n){let r=t.row>>>0;if(e&&e[r])return e[r];if(n)return e[r]=[]}findRowCell(e,t,n){let r=t.col>>>0;if(e&&e[r])return e[r];if(n)return e[r]=this.template?{...t,...Vr(this.template)}:t}spliceRows(e,t,n,r){let i=this.sheets.get(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.get(e);if(i){let e=[];for(let t=0;t<r;t++)e.push(null);i.forEach(r=>{r.splice(t,n,...e)})}}};function Ur(){return null}let Wr=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/,Gr=/^[$]?[A-Za-z]{1,3}[$]?\d+(:[$]?[A-Za-z]{1,3}[$]?\d+)?$/,Kr=/^[$]?\d+:[$]?\d+$/,qr=/^[$]?[A-Za-z]{1,3}:[$]?[A-Za-z]{1,3}$/;function Jr(e){if(e.startsWith(`{`)||e.endsWith(`}`))return!1;let t=e.split(`!`).pop()??``;if(!Gr.test(t)&&!Kr.test(t)&&!qr.test(t))return!1;try{let t=M.decodeEx(e);return`row`in t&&typeof t.row==`number`||`top`in t&&typeof t.top==`number`||`left`in t&&typeof t.left==`number`}catch{return!1}}function Yr(e){let t=e.trim();if(t.startsWith(`{`)&&t.endsWith(`}`))return[];let n=[],r=!1,i=``;return e.split(`,`).forEach(e=>{if(!e)return;let t=(e.match(/'/g)??[]).length;if(!t){r?i+=`${e},`:Jr(e)&&n.push(e);return}let a=t%2==0;!r&&a&&Jr(e)?n.push(e):r&&!a?(r=!1,Jr(i+e)&&n.push(i+e),i=``):(r=!0,i+=`${e},`)}),n}function Xr(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if(r===`'`)t=!t;else if(r===`(`&&!t)return!0}return!1}function Zr(e,t,n){if(e===void 0)return t.length>0?{kind:`reference`,ranges:t}:{kind:`opaque`,ranges:[]};let r=e.trim();if(r.length===0)return{kind:`opaque`,ranges:[]};let i=r.startsWith(`{`)&&r.endsWith(`}`),a=r.startsWith(`"`)&&r.endsWith(`"`),o=r.startsWith(`#`),s=i||a||o;if(Xr(r)&&!s)return n&&n(r)?{kind:`formula`,ranges:[r],formulaExpression:r}:{kind:`opaque`,ranges:[]};let c=Yr(e);return c.length>0?{kind:`reference`,ranges:c}:s?{kind:`opaque`,ranges:[]}:n&&n(r)?{kind:`formula`,ranges:[r],formulaExpression:r}:{kind:`opaque`,ranges:[]}}function Qr(e,t){return t===void 0?e:`${e}\0${t}`}var $r=class{constructor(e){this.matrixMap={},this.formulaMap={},this.localSheetIdMap={},this.opaqueMap={},this.nameForKey={},this._explicitProbe=e??null}getMatrix(e){return this.matrixMap[e]||(this.matrixMap[e]=new Hr)}add(e,t){let n=M.decodeEx(e);`error`in n||(delete this.formulaMap[t],delete this.opaqueMap[t],this.nameForKey[t]=t,this.addEx(n,t))}addEx(e,t){let n=this.getMatrix(t);if(`top`in e)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)}addFormula(e,t){delete this.matrixMap[e],delete this.opaqueMap[e],this.nameForKey[e]=e,this.formulaMap[e]=t}remove(e,t){let n=M.decodeEx(e);`error`in n||this.removeEx(n,t)}removeEx(e,t){let n=this.getMatrix(t);if(`top`in e)for(let t=e.left;t<=e.right;t++)for(let r=e.top;r<=e.bottom;r++)n.removeCellEx({sheetName:e.sheetName,address:M.n2l(t)+r,row:r,col:t});else n.removeCellEx(e)}removeAllNames(e){Object.values(this.matrixMap).forEach(t=>{if(`top`in e)for(let n=e.left;n<=e.right;n++)for(let r=e.top;r<=e.bottom;r++)t.removeCellEx({sheetName:e.sheetName,address:M.n2l(n)+r,row:r,col:n});else t.removeCellEx(e)})}forEach(e){Object.entries(this.matrixMap).forEach(([t,n])=>{let r=this.nameForKey[t]??t;n.forEach(t=>{e(r,t)})})}getNames(e){let t=M.decodeEx(e);return`error`in t||`top`in t?[]:this.getNamesEx(t)}getNamesEx(e){return Object.entries(this.matrixMap).map(([t,n])=>n.findCellEx(e,!1)&&(this.nameForKey[t]??t)).filter(e=>!!e)}getAllNames(){return this.getAllEntries().map(e=>e.localSheetId===void 0?{name:e.name}:{name:e.name,localSheetId:e.localSheetId})}getAllEntries(){let e=[],t=new Set;for(let n of Object.keys(this.matrixMap)){if(t.has(n))continue;t.add(n);let r=this.getRanges(n),i=this.localSheetIdMap[n];e.push(i===void 0?r:{...r,localSheetId:i})}for(let n of Object.keys(this.formulaMap)){if(t.has(n))continue;t.add(n);let r=this.getRanges(n),i=this.localSheetIdMap[n];e.push(i===void 0?r:{...r,localSheetId:i})}for(let n of Object.keys(this.opaqueMap)){if(t.has(n))continue;t.add(n);let r=this.nameForKey[n]??n,i=this.opaqueMap[n];e.push({name:r,ranges:[],rawText:i.rawText,localSheetId:i.localSheetId,kind:`opaque`})}return e}_explore(e,t){t.mark=!1;let n=t.sheetName,r=new N(t.row,t.col,t.row,t.col,n),i,a,o=(t,r)=>e.findCellAt(n,t,r);function s(e,n){let i=o(e,t.col);return!i||!i.mark?!1:(r[n]=e,i.mark=!1,!0)}for(a=t.row-1;s(a,`top`);a--);for(a=t.row+1;s(a,`bottom`);a++);function c(e,t){let n=[];for(a=r.top;a<=r.bottom;a++){let t=o(a,e);if(t&&t.mark)n.push(t);else return!1}r[t]=e;for(let e=0;e<n.length;e++)n[e].mark=!1;return!0}for(i=t.col-1;c(i,`left`);i--);for(i=t.col+1;c(i,`right`);i++);return r}getRangesScoped(e,t){let n=Qr(e,t);return this.getRanges(n)}getRanges(e,t){let n=this.formulaMap[e];t||=this.matrixMap[e];let r=this.nameForKey[e]??e;return t?(t.forEach(e=>{e.mark=!0}),{name:r,ranges:t.map(e=>e.mark&&this._explore(t,e)).filter(e=>!!e).map(e=>e.$shortRange)}):n?{name:r,ranges:[n],formulaExpression:n}:{name:r,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(){let e=Object.entries(this.matrixMap).map(([e,t])=>{let n=this.getRanges(e,t),r=this.localSheetIdMap[e];return r===void 0?n:{...n,localSheetId:r}}).filter(e=>e.ranges.length),t=Object.entries(this.formulaMap).filter(([e])=>!this.matrixMap[e]).map(([e,t])=>{let n={name:this.nameForKey[e]??e,ranges:[t],formulaExpression:t},r=this.localSheetIdMap[e];return r===void 0?n:{...n,localSheetId:r}}),n=Object.entries(this.opaqueMap).map(([e,t])=>({name:this.nameForKey[e]??e,ranges:[],rawText:t.rawText,localSheetId:t.localSheetId,kind:`opaque`}));return[...e,...t,...n]}set model(e){let t=this.matrixMap={},n=this.formulaMap={},r=this.localSheetIdMap={},i=this.opaqueMap={},a=this.nameForKey={},o=this._explicitProbe??Ur();for(let s of e){let e=Qr(s.name,s.localSheetId);if(a[e]=s.name,s.localSheetId!==void 0&&(r[e]=s.localSheetId),s.formulaExpression&&s.rawText===void 0){n[e]=s.formulaExpression;continue}let c=Zr(s.rawText,s.ranges,o);switch(c.kind){case`reference`:{let n=t[e]=new Hr;for(let e of c.ranges)Wr.test(e.split(`!`).pop()??``)&&n.addCell(e);break}case`formula`:n[e]=c.formulaExpression;break;case`opaque`:s.rawText&&(i[e]={rawText:s.rawText,localSheetId:s.localSheetId});break}}}};let P=new Uint8Array;function ei(e,t,n=0){let r=e.length,i=t.length;if(i===0)return 0;if(i>r)return-1;let a=n|0;if(a<0&&(a=0),a>r-i)return-1;if(i===1)return e.indexOf(t[0],a);if(i===2){let n=t[0],i=t[1],o=r-2,s=e.indexOf(n,a);for(;s!==-1&&s<=o;){if(e[s+1]===i)return s;s=e.indexOf(n,s+1)}return-1}if(i===3){let n=t[0],i=t[1],o=t[2],s=r-3,c=e.indexOf(n,a);for(;c!==-1&&c<=s;){if(e[c+1]===i&&e[c+2]===o)return c;c=e.indexOf(n,c+1)}return-1}if(i===4){let n=t[0],i=t[1],o=t[2],s=t[3],c=r-4,l=e.indexOf(n,a);for(;l!==-1&&l<=c;){if(e[l+1]===i&&e[l+2]===o&&e[l+3]===s)return l;l=e.indexOf(n,l+1)}return-1}for(let n=a;n<=r-i;n++){let r=!0;for(let a=0;a<i;a++)if(e[n+a]!==t[a]){r=!1;break}if(r)return n}return-1}var ti=class{_activeChunkCount(){return this._chunks.length-this._chunkHead}_headChunk(){return this._chunks[this._chunkHead]}_compactConsumedChunks(){if(this._chunkHead!==0){if(this._chunkHead>=this._chunks.length){this._chunks=[],this._chunkHead=0;return}this._chunkHead>32&&this._chunkHead*2>=this._chunks.length&&(this._chunks=this._chunks.slice(this._chunkHead),this._chunkHead=0)}}_dropHeadChunk(){this._chunkHead++,this._headOffset=0,this._compactConsumedChunks()}constructor(e){this._chunks=[],this._chunkHead=0,this._headOffset=0,this._length=0,this._cachedView=null,this._cachedLength=0,e&&e.length>0&&this.reset(e)}get length(){return this._length}isEmpty(){return this.length===0}view(){if(this._length===0)return P;if(this._activeChunkCount()===1)return this._headChunk().subarray(this._headOffset,this._headOffset+this._length);if(this._cachedView&&this._cachedLength===this._length)return this._cachedView;let e=new Uint8Array(this._length),t=0;for(let n=this._chunkHead;n<this._chunks.length;n++){let r=this._chunks[n],i=n===this._chunkHead?this._headOffset:0,a=n===this._chunks.length-1?i+(this._length-t):r.length;if(e.set(r.subarray(i,a),t),t+=a-i,t>=e.length)break}return this._cachedView=e,this._cachedLength=this._length,e}reset(e){if(this._cachedView=null,this._cachedLength=0,this._chunks=[],this._chunkHead=0,this._headOffset=0,this._length=0,!e||e.length===0)return;let t=new Uint8Array(e.length);t.set(e),this._chunks=[t],this._chunkHead=0,this._headOffset=0,this._length=t.length}append(e){e.length!==0&&(this._cachedView=null,this._cachedLength=0,this._chunks.push(e),this._length+=e.length)}read(e){if(e<=0)return P;if(e>this._length)throw RangeError(`ByteQueue: read beyond available data`);if(this._cachedView=null,this._cachedLength=0,this._activeChunkCount()===1){let t=this._headChunk(),n=this._headOffset,r=n+e,i=t.subarray(n,r);return this._headOffset=r,this._length-=e,this._length===0?(this._chunks=[],this._chunkHead=0,this._headOffset=0):this._headOffset>=t.length&&this._dropHeadChunk(),i}let t=new Uint8Array(e),n=0,r=e;for(;r>0;){let e=this._headChunk(),i=this._headOffset,a=e.length-i,o=Math.min(a,r);t.set(e.subarray(i,i+o),n),n+=o,r-=o,this._headOffset+=o,this._length-=o,this._headOffset>=e.length&&this._dropHeadChunk()}return this._length===0&&(this._chunks=[],this._chunkHead=0,this._headOffset=0),t}peekChunks(e){if(e<=0)return[];if(e>this._length)throw RangeError(`ByteQueue: peek beyond available data`);if(this._activeChunkCount()===1){let t=this._headChunk(),n=this._headOffset;return[t.subarray(n,n+e)]}let t=[],n=e;for(let e=this._chunkHead;e<this._chunks.length&&n>0;e++){let r=this._chunks[e],i=e===this._chunkHead?this._headOffset:0,a=r.length-i;if(a<=0)continue;let o=Math.min(a,n);t.push(r.subarray(i,i+o)),n-=o}return t}discard(e){if(e<=0)return;if(e>=this._length){this._chunks=[],this._chunkHead=0,this._headOffset=0,this._length=0,this._cachedView=null,this._cachedLength=0;return}this._cachedView=null,this._cachedLength=0;let t=e;for(;t>0;){let e=this._headChunk(),n=this._headOffset,r=e.length-n,i=Math.min(r,t);this._headOffset+=i,this._length-=i,t-=i,this._headOffset>=e.length&&this._dropHeadChunk()}this._length===0&&(this._chunks=[],this._chunkHead=0,this._headOffset=0)}indexOfPattern(e,t=0){let n=e.length;if(n===0)return 0;let r=this._length;if(n>r)return-1;let i=t|0;if(i<0&&(i=0),i>r-n)return-1;if(this._activeChunkCount()===1){let t=this._headChunk(),a=this._headOffset,o=t.subarray(a,a+r);return n===1?o.indexOf(e[0],i):ei(o,e,i)}if(n>4)return ei(this.view(),e,i);let a=e[0],o=n>=2?e[1]:0,s=n>=3?e[2]:0,c=n>=4?e[3]:0,l=this._chunks,u=this._chunkHead,d=(e,t)=>{let n=e,r=t;for(;n<l.length;){let e=l[n];if(r<e.length)return e[r]|0;r-=e.length,n++}return null},f=0;for(let e=u;e<l.length;e++){let t=l[e],p=e===u?this._headOffset:0,m=t.length-p;if(m<=0)continue;let h=f,g=h+m,_=i<=h?p:i>=g?t.length:p+(i-h);if(_>t.length-1){f+=m;continue}let v=t.length-1,y=t.indexOf(a,_);for(;y!==-1&&y<=v;){let i=h+(y-p);if(i>r-n)return-1;if(n===1)return i;if(y+n<=t.length){if(t[y+1]!==o){y=t.indexOf(a,y+1);continue}if(n===2)return i;if(t[y+2]!==s){y=t.indexOf(a,y+1);continue}if(n===3)return i;if(t[y+3]!==c){y=t.indexOf(a,y+1);continue}return i}let l=d(e,y+1);if(l===null||l!==o){y=t.indexOf(a,y+1);continue}if(n===2)return i;let u=d(e,y+2);if(u===null||u!==s){y=t.indexOf(a,y+1);continue}if(n===3)return i;let f=d(e,y+3);if(f===null||f!==c){y=t.indexOf(a,y+1);continue}return i}f+=m}return-1}peekUint32LE(e){let t=e|0;if(t<0||t+4>this._length)return null;let n=this._chunks,r=t;for(let e=this._chunkHead;e<n.length;e++){let t=n[e],i=e===this._chunkHead?this._headOffset:0,a=t.length-i;if(r<a){let a=i+r;if(a+4<=t.length){let e=t[a]|0,n=t[a+1]|0,r=t[a+2]|0,i=t[a+3]|0;return(e|n<<8|r<<16|i<<24)>>>0}let o=t[a]|0,s=0,c=0,l=0,u=e,d=a+1;for(let e=1;e<4;e++)for(;u<n.length;){let t=n[u];if(d<t.length){let n=t[d]|0;e===1?s=n:e===2?c=n:l=n,d++;break}u++,d=0}return(o|s<<8|c<<16|l<<24)>>>0}r-=a}return null}peekByte(e){let t=e|0;if(t<0||t>=this._length)throw RangeError(`ByteQueue: peek beyond available data`);let n=t;for(let e=this._chunkHead;e<this._chunks.length;e++){let t=this._chunks[e],r=e===this._chunkHead?this._headOffset:0,i=t.length-r;if(n<i)return t[r+n]|0;n-=i}throw RangeError(`ByteQueue: peek beyond available data`)}};function ni(){try{return typeof CompressionStream>`u`?!1:(new CompressionStream(`deflate-raw`),!0)}catch{return!1}}function ri(){try{return typeof DecompressionStream>`u`?!1:(new DecompressionStream(`deflate-raw`),!0)}catch{return!1}}let ii=null,ai=null;function oi(){return typeof CompressionStream>`u`?!1:(ii===null&&(ii=ni()),ii)}function si(){return typeof DecompressionStream>`u`?!1:(ai===null&&(ai=ri()),ai)}function ci(){return oi()&&si()}async function li(e){let t=new ti;for(;;){let{done:n,value:r}=await e.read();if(n)break;t.append(r)}return t.read(t.length)}async function ui(e,t){let n=t.writable.getWriter(),r=t.readable.getReader();try{let t=li(r);return await n.write(e),await n.close(),await t}finally{try{n.releaseLock()}catch{}try{r.releaseLock()}catch{}}}async function di(e){return ui(e,new DecompressionStream(`deflate-raw`))}let fi=65521;function pi(e){let t=1,n=0;for(let r=0;r<e.length;){let i=Math.min(r+5552,e.length);for(;r<i;)t+=e[r++],n+=t;t%=fi,n%=fi}return n<<16|t}let mi={};function hi(e,t){let n=`${e}:${t}`;return()=>{let r=e===`compression`?typeof CompressionStream<`u`?CompressionStream:void 0:typeof DecompressionStream<`u`?DecompressionStream:void 0;if(!r)return!1;let i=mi[n];if(i!=null)return i;try{new r(t),mi[n]=!0}catch{mi[n]=!1}return mi[n]}}hi(`compression`,`gzip`),hi(`decompression`,`gzip`),hi(`compression`,`deflate`),hi(`decompression`,`deflate`);let gi={0:new Uint8Array([120,1]),1:new Uint8Array([120,1]),2:new Uint8Array([120,94]),3:new Uint8Array([120,94]),4:new Uint8Array([120,94]),5:new Uint8Array([120,94]),6:new Uint8Array([120,156]),7:new Uint8Array([120,218]),8:new Uint8Array([120,218]),9:new Uint8Array([120,218])};function _i(e){return gi[Math.max(0,Math.min(9,e))]??gi[6]}function vi(e){let t=new Uint8Array(4);return t[0]=e>>>24&255,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=e&255,t}let yi=(()=>{let e=new Uint8Array(288);for(let t=0;t<=143;t++)e[t]=8;for(let t=144;t<=255;t++)e[t]=9;for(let t=256;t<=279;t++)e[t]=7;for(let t=280;t<=287;t++)e[t]=8;return e})(),bi=new Uint8Array(32).fill(5),xi=[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],Si=[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],Ci=[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],wi=[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],Ti=[[1,0,0],[2,1,0],[3,2,0],[4,3,0],[6,4,1],[8,5,1],[12,6,2],[16,7,2],[24,8,3],[32,9,3],[48,10,4],[64,11,4],[96,12,5],[128,13,5],[192,14,6],[256,15,6],[384,16,7],[512,17,7],[768,18,8],[1024,19,8],[1536,20,9],[2048,21,9],[3072,22,10],[4096,23,10],[6144,24,11],[8192,25,11],[12288,26,12],[16384,27,12],[24576,28,13],[32768,29,13]],Ei=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Di(e,t){let n=new Uint16Array(16);for(let r=0;r<t;r++)e[r]>0&&n[e[r]]++;let r=new Uint16Array(16),i=0;for(let e=1;e<=15;e++)i=i+n[e-1]<<1,r[e]=i;let a={};for(let n=0;n<t;n++){let t=e[n];if(t===0)continue;i=r[t]++;let o=a;for(let e=t-1;e>=0;e--)i>>e&1?(o.right||={},o=o.right):(o.left||={},o=o.left);o.symbol=n}return a}var Oi=class{constructor(e){this.data=e,this.pos=0,this.bitBuf=0,this.bitCount=0}readBits(e){for(;this.bitCount<e;){if(this.pos>=this.data.length)throw Error(`Unexpected end of DEFLATE data`);this.bitBuf|=this.data[this.pos++]<<this.bitCount,this.bitCount+=8}let t=this.bitBuf&(1<<e)-1;return this.bitBuf>>=e,this.bitCount-=e,t}decodeSymbol(e){let t=e;for(;t.symbol===void 0;)if(t=this.readBits(1)===0?t.left:t.right,!t)throw Error(`Invalid Huffman code`);return t.symbol}alignToByte(){this.bitBuf=0,this.bitCount=0}readByte(){if(this.pos>=this.data.length)throw Error(`Unexpected end of data`);return this.data[this.pos++]}readUint16(){return this.readByte()|this.readByte()<<8}};function ki(e){let t=new Oi(e),n=[],r=!1;for(;!r;){r=t.readBits(1)===1;let e=t.readBits(2);if(e===0){t.alignToByte();let e=t.readUint16();if((e^t.readUint16())!==65535)throw Error(`Invalid stored block length`);for(let r=0;r<e;r++)n.push(t.readByte())}else if(e===1||e===2){let r,i;if(e===1)r=Di(yi,288),i=Di(bi,32);else{let e=t.readBits(5)+257,n=t.readBits(5)+1,a=t.readBits(4)+4,o=new Uint8Array(19);for(let e=0;e<a;e++)o[Ei[e]]=t.readBits(3);let s=Di(o,19),c=new Uint8Array(e+n),l=0;for(;l<e+n;){let e=t.decodeSymbol(s);if(e<16)c[l++]=e;else if(e===16){let e=t.readBits(2)+3,n=c[l-1];for(let t=0;t<e;t++)c[l++]=n}else if(e===17){let e=t.readBits(3)+3;for(let t=0;t<e;t++)c[l++]=0}else if(e===18){let e=t.readBits(7)+11;for(let t=0;t<e;t++)c[l++]=0}}r=Di(c.subarray(0,e),e),i=Di(c.subarray(e),n)}for(;;){let e=t.decodeSymbol(r);if(e<256)n.push(e);else if(e===256)break;else{let r=e-257,a=xi[r]+t.readBits(Si[r]),o=t.decodeSymbol(i),s=Ci[o]+t.readBits(wi[o]),c=n.length-s;for(let e=0;e<a;e++)n.push(n[c+e])}}}else throw Error(`Invalid DEFLATE block type: `+e)}return new Uint8Array(n)}function Ai(e){let t=65535,n=Math.ceil(e.length/t)||1,r=n*5+e.length,i=new Uint8Array(r),a=0,o=0;for(let r=0;r<n;r++){let s=r===n-1,c=Math.min(t,e.length-o);i[a++]=+!!s,i[a++]=c&255,i[a++]=c>>8&255,i[a++]=~c&255,i[a++]=~c>>8&255,i.set(e.subarray(o,o+c),a),a+=c,o+=c}return i.subarray(0,a)}let ji=32768;ji-1;let Mi=32768;function Ni(e){return e<=1?{maxChainLen:4,goodLen:4,niceLen:8,lazy:!1}:e<=3?{maxChainLen:8,goodLen:8,niceLen:32,lazy:!0}:e<=5?{maxChainLen:32,goodLen:16,niceLen:128,lazy:!0}:e<=7?{maxChainLen:64,goodLen:32,niceLen:258,lazy:!0}:{maxChainLen:128,goodLen:64,niceLen:258,lazy:!0}}function Pi(e,t,n){return(e<<16|t<<8|n)*506832829>>>17&32767}function Fi(e,t=6){if(e.length===0)return new Uint8Array([3,0]);if(e.length<100)return Ai(e);let n=Ni(t),r=Wi(e,0,e.length,n,null),i=new Ii;return Ui(i,r,!0),i.finish()}var Ii=class{constructor(){this.chunks=[],this.buffer=[],this.bitBuf=0,this.bitCount=0}alignToByte(){this.bitCount>0&&this.writeBits(0,8-this.bitCount)}writeBits(e,t){for(this.bitBuf|=e<<this.bitCount,this.bitCount+=t;this.bitCount>=8;)this.buffer.push(this.bitBuf&255),this.bitBuf>>=8,this.bitCount-=8,this.buffer.length>=65536&&(this.chunks.push(new Uint8Array(this.buffer)),this.buffer=[])}writeBitsReverse(e,t){let n=0;for(let r=0;r<t;r++)n=n<<1|e>>r&1;this.writeBits(n,t)}finish(){return this.bitCount>0&&this.buffer.push(this.bitBuf&255),this.chunks.length===0?new Uint8Array(this.buffer):(this.chunks.push(new Uint8Array(this.buffer)),E(this.chunks))}flushBytes(){if(this.chunks.length===0&&this.buffer.length===0)return new Uint8Array;let e;return this.chunks.length===0?e=new Uint8Array(this.buffer):(this.chunks.push(new Uint8Array(this.buffer)),e=E(this.chunks),this.chunks=[]),this.buffer=[],e}};let Li=(()=>{let e=[];for(let t=0;t<=287;t++){let n,r;t<=143?(n=48+t,r=8):t<=255?(n=400+(t-144),r=9):t<=279?(n=t-256,r=7):(n=192+(t-280),r=8),e[t]=[n,r]}return e})();function Ri(e,t){let[n,r]=Li[t];e.writeBitsReverse(n,r)}function zi(e){for(let t=0;t<xi.length;t++)if(t===xi.length-1||e<xi[t+1])return{code:257+t,extra:e-xi[t],extraBits:Si[t]};return{code:285,extra:0,extraBits:0}}function Bi(e){for(let t=0;t<Ti.length;t++){let[n,r,i]=Ti[t];if(e<=n)return{code:r,extra:e-(t===0?1:Ti[t-1][0]+1),extraBits:i}}return{code:29,extra:0,extraBits:13}}function Vi(e,t){let n=e.length,r=new Uint8Array(n),i=[];for(let t=0;t<n;t++)e[t]>0&&i.push({sym:t,freq:e[t]});if(i.length===0)return r;if(i.length===1)return r[i[0].sym]=1,r;i.sort((e,t)=>e.freq-t.freq||e.sym-t.sym);let a=i.map(e=>({freq:e.freq,sym:e.sym,left:null,right:null})),o=0,s=0,c=[];function l(){let e=o<a.length,t=s<c.length;return e&&t?a[o].freq<=c[s].freq?a[o++]:c[s++]:e?a[o++]:c[s++]}let u=i.length;for(let e=0;e<u-1;e++){let e=l(),t=l(),n={freq:e.freq+t.freq,sym:-1,left:e,right:t};c.push(n)}let d=c[c.length-1];function f(e,t){if(e.sym>=0){r[e.sym]=t;return}e.left&&f(e.left,t+1),e.right&&f(e.right,t+1)}f(d,0);let p=new Uint16Array(t+1);for(let e=0;e<n;e++)r[e]>0&&(r[e]>t?(p[t]++,r[e]=t):p[r[e]]++);let m=0;for(let e=1;e<=t;e++)m+=p[e]<<t-e;let h=1<<t;if(m===h)return r;for(;m>h;){let e=t-1;for(;e>0&&p[e]===0;)e--;if(e===0)break;p[e]--,p[t]++,m-=(1<<t-e)-1}for(;m<h;)p[t]++,m++;let g=[];for(let t=0;t<n;t++)r[t]>0&&g.push({sym:t,origLen:r[t],freq:e[t]});g.sort((e,t)=>t.origLen-e.origLen||e.freq-t.freq),r.fill(0);let _=0;for(let e=t;e>=1;e--)for(let t=p[e];t>0;t--)_<g.length&&(r[g[_].sym]=e,_++);return r}function Hi(e){let t=e.length,n=Array(t),r=new Uint16Array(16);for(let n=0;n<t;n++)e[n]>0&&r[e[n]]++;let i=new Uint16Array(16),a=0;for(let e=1;e<=15;e++)a=a+r[e-1]<<1,i[e]=a;for(let r=0;r<t;r++){let t=e[r];t>0?n[r]=[i[t]++,t]:n[r]=[0,0]}return n}function Ui(e,t,n){let r=new Uint32Array(286),i=new Uint32Array(30);r[256]=1;for(let e of t)if(e.dist===0)r[e.litOrLen]++;else{let t=zi(e.litOrLen);r[t.code]++;let n=Bi(e.dist);i[n.code]++}let a=Vi(r,15),o=Vi(i,15),s=!1;for(let e=0;e<o.length;e++)if(o[e]>0){s=!0;break}s||(o=new Uint8Array(30),o[0]=1,o[1]=1);let c=Hi(a),l=Hi(o),u=286;for(;u>257&&a[u-1]===0;)u--;let d=30;for(;d>1&&o[d-1]===0;)d--;let f=new Uint8Array(u+d);f.set(a.subarray(0,u)),f.set(o.subarray(0,d),u);let p=[],m=new Uint32Array(19);for(let e=0;e<f.length;){let t=f[e];if(t===0){let t=1;for(;e+t<f.length&&f[e+t]===0;)t++;for(;t>0;)if(t>=11){let n=Math.min(t,138);p.push({sym:18,extra:n-11,extraBits:7}),m[18]++,t-=n,e+=n}else if(t>=3){let n=Math.min(t,10);p.push({sym:17,extra:n-3,extraBits:3}),m[17]++,t-=n,e+=n}else p.push({sym:0,extra:0,extraBits:0}),m[0]++,t--,e++}else{p.push({sym:t,extra:0,extraBits:0}),m[t]++,e++;let n=0;for(;e+n<f.length&&f[e+n]===t;)n++;for(;n>=3;){let t=Math.min(n,6);p.push({sym:16,extra:t-3,extraBits:2}),m[16]++,n-=t,e+=t}for(;n>0;)p.push({sym:t,extra:0,extraBits:0}),m[t]++,n--,e++}}let h=Vi(m,7),g=Hi(h),_=19;for(;_>4&&h[Ei[_-1]]===0;)_--;e.writeBits(+!!n,1),e.writeBits(2,2),e.writeBits(u-257,5),e.writeBits(d-1,5),e.writeBits(_-4,4);for(let t=0;t<_;t++)e.writeBits(h[Ei[t]],3);for(let t of p){let[n,r]=g[t.sym];e.writeBitsReverse(n,r),t.extraBits>0&&e.writeBits(t.extra,t.extraBits)}for(let n of t)if(n.dist===0){let[t,r]=c[n.litOrLen];e.writeBitsReverse(t,r)}else{let t=zi(n.litOrLen),[r,i]=c[t.code];e.writeBitsReverse(r,i),t.extraBits>0&&e.writeBits(t.extra,t.extraBits);let a=Bi(n.dist),[o,s]=l[a.code];e.writeBitsReverse(o,s),a.extraBits>0&&e.writeBits(a.extra,a.extraBits)}let[v,y]=c[256];e.writeBitsReverse(v,y)}function Wi(e,t,n,r,i){let a=[],o=r.maxChainLen,s=r.goodLen,c=r.niceLen,l=r.lazy,u,d,f,p,m,h,g,_,v;i?(u=i.head,d=i.prev,f=i.window,p=i.windowLen,m=i.totalIn,h=i.hasPrevMatch,g=i.prevMatchLen,_=i.prevMatchDist,v=i.prevLiteral):(u=new Int32Array(ji),d=new Int32Array(Mi),f=null,p=0,m=0,h=!1,g=0,_=0,v=0);let y=i?r=>{let i=r-m;return i>=t&&i<n?e[i]:f[r&Mi-1]}:t=>e[t],b=i?t=>{if(t+2>=n)return;let r=Pi(e[t],e[t+1],e[t+2]),i=m+t;d[i&Mi-1]=u[r],u[r]=i+1}:t=>{if(t+2>=n)return;let r=Pi(e[t],e[t+1],e[t+2]);d[t&Mi-1]=u[r],u[r]=t+1},x=i?(t,n)=>{for(let r=0;r<n;r++)f[p+r&Mi-1]=e[t+r];p+=n}:(e,t)=>{},S=t;for(;S<n;){let t=0,r=0;if(S+2<n){let a=Pi(e[S],e[S+1],e[S+2]),f=i?m+S:S,p=l&&h&&g>=s?o>>2:o,_=u[a];for(;_>0&&p-- >0;){let i=_-1,a=f-i;if(a>Mi||a<=0)break;if(t>=3&&y(i+t)!==e[S+t]){_=d[i&Mi-1];continue}let o=Math.min(258,n-S),s=0;for(;s<o&&y(i+s)===e[S+s];)s++;if(s>t&&(t=s,r=a,s>=c))break;_=d[i&Mi-1]}i?(d[f&Mi-1]=u[a],u[a]=f+1):(d[S&Mi-1]=u[a],u[a]=S+1)}if(l&&h)if(t>g)a.push({litOrLen:v,dist:0}),g=t,_=r,v=e[S],x(S,1),S++;else{a.push({litOrLen:g,dist:_});let e=Math.min(S-1+g,n);for(let t=S;t<e;t++)b(t);x(S,e-S),S=e,h=!1,g=0}else if(t>=3)if(l)h=!0,g=t,_=r,v=e[S],x(S,1),S++;else{a.push({litOrLen:t,dist:r});let e=Math.min(S+t,n);for(let t=S+1;t<e;t++)b(t);x(S,e-S),S=e}else h&&(a.push({litOrLen:g,dist:_}),h=!1,g=0),a.push({litOrLen:e[S],dist:0}),x(S,1),S++}if(h){a.push({litOrLen:g,dist:_});let e=Math.min(S-1+g,n);for(let t=S;t<e;t++)b(t);x(S,e-S),h=!1,g=0}return i&&(i.windowLen=p,i.totalIn=m+(n-t),i.hasPrevMatch=h,i.prevMatchLen=g,i.prevMatchDist=_,i.prevLiteral=v),a}var Gi=class{constructor(e=6){this._output=new Ii,this._state={head:new Int32Array(ji),prev:new Int32Array(Mi),window:new Uint8Array(Mi),windowLen:0,totalIn:0,hasPrevMatch:!1,prevMatchLen:0,prevMatchDist:0,prevLiteral:0},this._level=Math.max(0,Math.min(9,e)),this._config=Ni(this._level)}write(e){if(e.length===0)return new Uint8Array;let t=this._output;return this._level===0?(this._writeStore(e),t.flushBytes()):(Ui(t,Wi(e,0,e.length,this._config,this._state),!1),t.flushBytes())}finish(){let e=this._output;return e.writeBits(1,1),e.writeBits(1,2),Ri(e,256),e.finish()}_writeStore(e){let t=this._output,n=0;for(;n<e.length;){let r=e.length-n,i=Math.min(65535,r);t.alignToByte(),t.writeBits(0,1),t.writeBits(0,2),t.alignToByte(),t.writeBits(i&255,8),t.writeBits(i>>8&255,8),t.writeBits(~i&255,8),t.writeBits(~i>>8&255,8);for(let r=0;r<i;r++)t.writeBits(e[n+r],8);n+=i}}},Ki=class extends n{constructor(e,t){super(e,t),this.name=`ArchiveError`}},qi=class extends Ki{constructor(e,t,n){super(`CRC32 mismatch for "${e}": expected 0x${t.toString(16).padStart(8,`0`)}, got 0x${n.toString(16).padStart(8,`0`)}`),this.path=e,this.expected=t,this.actual=n,this.name=`Crc32MismatchError`}},Ji=class extends Ki{constructor(e,t,n,r){let i=r===`too-many-bytes`?`Entry "${e}" produced more bytes than declared: expected ${t}, got at least ${n}`:`Entry "${e}" produced fewer bytes than declared: expected ${t}, got ${n}`;super(i),this.path=e,this.expected=t,this.actual=n,this.reason=r,this.name=`EntrySizeMismatchError`}isZipBomb(){return this.reason===`too-many-bytes`}isCorruption(){return this.reason===`too-few-bytes`}},Yi=class extends Ki{constructor(e,t){super(t?`Failed to decrypt "${e}": ${t}`:`Failed to decrypt "${e}": incorrect password or corrupted data`),this.name=`DecryptionError`}},Xi=class extends Ki{constructor(e){super(`File "${e}" is encrypted. Please provide a password to extract.`),this.name=`PasswordRequiredError`}},Zi=class extends Ki{constructor(e){super(`Unsupported compression method: ${e}`),this.name=`UnsupportedCompressionError`}};let Qi=null;function $i(){if(Qi)return Qi;let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return Qi=e,e}function ea(e,t){let n=$i();for(let r=0;r<t.length;r++)e=n[(e^t[r])&255]^e>>>8;return e}function ta(e){return(e^4294967295)>>>0}function na(e){return ta(ea(4294967295,e))}function ra(e,t){return($i()[(e^t)&255]^e>>>8)>>>0}let ia=`ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xA0`;function aa(e){let t=!1;for(let n=0;n<e.length;n++)if(e[n]>=128){t=!0;break}if(!t)return pa(e);let n=Array(e.length);for(let t=0;t<e.length;t++){let r=e[t];r<128?n[t]=String.fromCharCode(r):n[t]=ia[r-128]}return n.join(``)}function oa(e){if(e.length===0)return P;let t=new Uint8Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r),a=i;if(i>=55296&&i<=56319&&r+1<e.length){let t=e.charCodeAt(r+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+(t-56320)+65536,r++)}if(a<128){t[n++]=a;continue}if(a>65535){t[n++]=63;continue}let o=sa.get(String.fromCharCode(a));t[n++]=o??63}return n===t.length?t:t.subarray(0,n)}let sa=(()=>{let e=new Map;for(let t=0;t<128;t++)e.set(ia[t],128+t);return e})(),ca={name:`utf-8`,encode:Cn,decode:wn,useUtf8Flag:!0,useUnicodeExtraFields:!1},la={name:`cp437`,encode:oa,decode:aa,useUtf8Flag:!1,useUnicodeExtraFields:!0},ua=new WeakMap;function da(e){if(!e||e===`utf-8`)return ca;if(e===`cp437`)return la;let t=e,n=ua.get(t);if(n)return n;let r=t.useUtf8Flag??t.name===`utf-8`,i={...t,useUtf8Flag:r,useUnicodeExtraFields:t.useUnicodeExtraFields??!r};return ua.set(t,i),i}function fa(e,t){return e?t.encode(e):P}function pa(e){let t=``,n=32768;for(let r=0;r<e.length;r+=n){let i=e.subarray(r,Math.min(r+n,e.length));t+=String.fromCharCode(...i)}return t}function ma(e,t,n,r){return e.length===0?``:(t??0)&2048?wn(e):n&&n.version===1&&n.originalCrc32===na(e)?n.unicodeValue:r?r.decode(e):aa(e)}function ha(e,t,n,r){return ma(e,t,n?.unicodePath,r)}function ga(e,t,n,r){return ma(e,t,n?.unicodeComment,r)}function _a(e){return e.byteOffset===0&&e.byteLength===e.buffer.byteLength&&e.buffer.constructor===ArrayBuffer?e.buffer:e.slice().buffer}function va(e){let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e>>>0,!0),t}function ya(e,t){return new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(t,!0)}var ba=class{constructor(e,t=0){this.data=e,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.offset=t}get position(){return this.offset}set position(e){this.offset=e}get remaining(){return this.data.length-this.offset}readUint8(){let e=this.view.getUint8(this.offset);return this.offset+=1,e}readUint16(){let e=this.view.getUint16(this.offset,!0);return this.offset+=2,e}readUint32(){let e=this.view.getUint32(this.offset,!0);return this.offset+=4,e}readBigUint64(){let e=this.view.getBigUint64(this.offset,!0);return this.offset+=8,e}readBytes(e){let t=this.data.subarray(this.offset,this.offset+e);return this.offset+=e,t}readString(e,t=!0){let n=this.readBytes(e);return t?wn(n):aa(n)}skip(e){this.offset+=e}slice(e,t){return this.data.subarray(e,t)}peekUint32(e){return this.view.getUint32(e,!0)}};function xa(e,t){let n={},r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=0;for(let[a,o]of t){if(e.length>=i+o)switch(o){case 1:n[a]=r.getUint8(i);break;case 2:n[a]=r.getUint16(i,!0);break;case 4:n[a]=r.getUint32(i,!0);break;case 8:{let e=r.getUint32(i,!0);n[a]=r.getUint32(i+4,!0)*4294967296+e;break}default:throw Error(`Unsupported UInt LE size!`)}else n[a]=null;i+=o}return n}function Sa(e,t){return xa(e,t)}function Ca(e){return!Number.isFinite(e)||e<=0?0:e>=4294967295?4294967295:e>>>0}function wa(e){return Ca(Math.floor(e.getTime()/1e3))}function Ta(e){if(typeof BigInt!=`function`)throw Error(`NTFS timestamps require BigInt support`);return BigInt(e.getTime())*10000n+116444736000000000n}function Ea(e,t){let n=t?.atime!==void 0,r=t?.ctime!==void 0,i=1;n&&(i|=2),r&&(i|=4);let a=5+(n?4:0)+(r?4:0),o=new Uint8Array(4+a),s=new DataView(o.buffer);s.setUint16(0,21589,!0),s.setUint16(2,a,!0),o[4]=i,s.setUint32(5,wa(e),!0);let c=9;return n&&(s.setUint32(c,wa(t.atime),!0),c+=4),r&&s.setUint32(c,wa(t.ctime),!0),o}function Da(e,t){if(typeof BigInt!=`function`)throw Error(`NTFS timestamps require BigInt support`);let n=t?.atime??e,r=t?.ctime??e,i=t?.birthTime??e,a=new Uint8Array(44),o=new DataView(a.buffer);o.setUint16(0,10,!0),o.setUint16(2,40,!0),o.setUint32(4,0,!0),o.setUint16(8,1,!0),o.setUint16(10,32,!0);let s=12;return o.setBigUint64(s,Ta(e),!0),s+=8,o.setBigUint64(s,Ta(n),!0),s+=8,o.setBigUint64(s,Ta(r),!0),s+=8,o.setBigUint64(s,Ta(i),!0),a}function Oa(e){return[(e.getHours()&31)<<11|(e.getMinutes()&63)<<5|e.getSeconds()>>1&31,(e.getFullYear()-1980&127)<<9|(e.getMonth()+1&15)<<5|e.getDate()&31]}function ka(e,t){let n=e&31,r=e>>5&15,i=(e>>9&127)+1980,a=t?(t&31)*2:0,o=t?t>>5&63:0,s=t?t>>11:0;return new Date(Date.UTC(i,r-1,n,s,o,a))}function Aa(e,t,n){return n===void 0?ka(e,t):new Date(n*1e3)}function ja(e,t,n){if(t===`dos`)return new Uint8Array;let r=[Ea(e,n)];return t===`dos+utc+ntfs`&&r.push(Da(e,n)),E(r)}function Ma(e){let[t,n]=Oa(e);return{dosTime:t,dosDate:n}}function Na(e){return e<128?e<<1:e<<1^283}function Pa(e){let t=e.length/4,n=t+6,r=[];for(let n=0;n<t;n++)r.push(new Uint8Array([e[4*n],e[4*n+1],e[4*n+2],e[4*n+3]]));for(let e=t;e<4*(n+1);e++){let n=new Uint8Array(r[e-1]);if(e%t===0){let r=n[0];n[0]=Wa[n[1]]^Ga[e/t-1],n[1]=Wa[n[2]],n[2]=Wa[n[3]],n[3]=Wa[r]}else t>6&&e%t===4&&(n[0]=Wa[n[0]],n[1]=Wa[n[1]],n[2]=Wa[n[2]],n[3]=Wa[n[3]]);let i=new Uint8Array(4);for(let a=0;a<4;a++)i[a]=r[e-t][a]^n[a];r.push(i)}return r}function Fa(e,t){let n=t.length/4-1,r=new Uint8Array(16);r.set(e);for(let e=0;e<4;e++)for(let n=0;n<4;n++)r[4*e+n]^=t[e][n];for(let e=1;e<n;e++){for(let e=0;e<16;e++)r[e]=Wa[r[e]];let n;n=r[1],r[1]=r[5],r[5]=r[9],r[9]=r[13],r[13]=n,n=r[2],r[2]=r[10],r[10]=n,n=r[6],r[6]=r[14],r[14]=n,n=r[15],r[15]=r[11],r[11]=r[7],r[7]=r[3],r[3]=n;for(let e=0;e<4;e++){let t=r[4*e],n=r[4*e+1],i=r[4*e+2],a=r[4*e+3];r[4*e]=Na(t)^Na(n)^n^i^a,r[4*e+1]=t^Na(n)^Na(i)^i^a,r[4*e+2]=t^n^Na(i)^Na(a)^a,r[4*e+3]=Na(t)^t^n^i^Na(a)}let i=e*4;for(let e=0;e<4;e++)for(let n=0;n<4;n++)r[4*e+n]^=t[i+e][n]}for(let e=0;e<16;e++)r[e]=Wa[r[e]];let i;i=r[1],r[1]=r[5],r[5]=r[9],r[9]=r[13],r[13]=i,i=r[2],r[2]=r[10],r[10]=i,i=r[6],r[6]=r[14],r[14]=i,i=r[15],r[15]=r[11],r[11]=r[7],r[7]=r[3],r[3]=i;for(let e=0;e<4;e++)for(let i=0;i<4;i++)r[4*e+i]^=t[n*4+e][i];return r}function Ia(e,t,n){let r=16-e.length%16,i=new Uint8Array(e.length+r);i.set(e);for(let t=e.length;t<i.length;t++)i[t]=r;let a=Pa(t),o=i.length/16,s=new Uint8Array(i.length),c=n;for(let e=0;e<o;e++){let t=new Uint8Array(16);for(let n=0;n<16;n++)t[n]=i[e*16+n]^c[n];let n=Fa(t,a);s.set(n,e*16),c=n}return s}function La(e,t,n){if(e.length%16!=0)throw Error(`aesCbcEncryptRaw: plaintext length must be a multiple of 16`);let r=Pa(t),i=e.length/16,a=new Uint8Array(e.length),o=n;for(let t=0;t<i;t++){let n=new Uint8Array(16);for(let r=0;r<16;r++)n[r]=e[t*16+r]^o[r];let i=Fa(n,r);a.set(i,t*16),o=i}return a}function Ra(e,t){return Fa(e,Pa(t))}function za(e,t){return(e>>>t|e<<32-t)>>>0}function Ba(e){let t=e.length,n=Math.ceil((t+9)/64)*64,r=new Uint8Array(n);r.set(e),r[t]=128;let i=t*8,a=new DataView(r.buffer,r.byteOffset,r.byteLength);a.setUint32(n-8,0,!1),a.setUint32(n-4,i,!1);let o=Ka[0],s=Ka[1],c=Ka[2],l=Ka[3],u=Ka[4],d=Ka[5],f=Ka[6],p=Ka[7],m=new Uint32Array(64);for(let e=0;e<n;e+=64){for(let t=0;t<16;t++)m[t]=a.getUint32(e+t*4,!1);for(let e=16;e<64;e++){let t=za(m[e-15],7)^za(m[e-15],18)^m[e-15]>>>3,n=za(m[e-2],17)^za(m[e-2],19)^m[e-2]>>>10;m[e]=m[e-16]+t+m[e-7]+n>>>0}let t=o,n=s,r=c,i=l,h=u,g=d,_=f,v=p;for(let e=0;e<64;e++){let a=za(h,6)^za(h,11)^za(h,25),o=h&g^~h&_,s=v+a+o+qa[e]+m[e]>>>0,c=(za(t,2)^za(t,13)^za(t,22))+(t&n^t&r^n&r)>>>0;v=_,_=g,g=h,h=i+s>>>0,i=r,r=n,n=t,t=s+c>>>0}o=o+t>>>0,s=s+n>>>0,c=c+r>>>0,l=l+i>>>0,u=u+h>>>0,d=d+g>>>0,f=f+_>>>0,p=p+v>>>0}let h=new Uint8Array(32),g=new DataView(h.buffer);return g.setUint32(0,o,!1),g.setUint32(4,s,!1),g.setUint32(8,c,!1),g.setUint32(12,l,!1),g.setUint32(16,u,!1),g.setUint32(20,d,!1),g.setUint32(24,f,!1),g.setUint32(28,p,!1),h}function Va(e){let t=new Uint8Array(e);return globalThis.crypto.getRandomValues(t),t}async function Ha(e,t){let n=await globalThis.crypto.subtle.digest(Ua(e),t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength));return new Uint8Array(n)}function Ua(e){switch(e.toLowerCase().replace(/-/g,``)){case`sha1`:return`SHA-1`;case`sha256`:return`SHA-256`;case`sha384`:return`SHA-384`;case`sha512`:return`SHA-512`;default:return e}}var Wa,Ga,Ka,qa,Ja=t((()=>{Wa=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]),Ga=[1,2,4,8,16,32,64,128,27,54],Ka=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),qa=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),new Uint32Array([3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745])}));Ja();let Ya={128:8,192:12,256:16},Xa={128:16,192:24,256:32},Za={128:1,192:2,256:3},Qa={1:128,2:192,3:256};function $a(){if(globalThis.crypto?.subtle!==void 0)return globalThis.crypto.subtle;throw Error(`Web Crypto API not available`)}async function eo(e,t,n){let r=$a(),i=typeof e==`string`?Cn(e):e,a=Xa[n],o=a+32+2,s=await r.importKey(`raw`,_a(i),`PBKDF2`,!1,[`deriveBits`]),c=await r.deriveBits({name:`PBKDF2`,salt:_a(t),iterations:1e3,hash:`SHA-1`},s,o*8),l=new Uint8Array(c);return{encryptionKey:l.subarray(0,a),hmacKey:l.subarray(a,a+32),passwordVerify:l.subarray(a+32,a+34)}}async function to(e,t){let n=$a(),r=await n.importKey(`raw`,_a(e),{name:`HMAC`,hash:`SHA-1`},!1,[`sign`]),i=await n.sign(`HMAC`,r,_a(t));return new Uint8Array(i,0,10)}function no(e){let t=new Uint8Array(16);return new DataView(t.buffer).setUint32(0,e,!0),t}async function ro(e,t,n=!0){let r=$a(),i=await r.importKey(`raw`,_a(e),{name:`AES-CTR`},!1,[`encrypt`,`decrypt`]),a=no(1),o=await r.encrypt({name:`AES-CTR`,counter:_a(a),length:128},i,_a(t));return new Uint8Array(o)}function io(e,t,n){let r=new Uint8Array(11),i=new DataView(r.buffer);return i.setUint16(0,39169,!0),i.setUint16(2,7,!0),i.setUint16(4,e,!0),i.setUint16(6,17729,!0),r[8]=Za[t],i.setUint16(9,n,!0),r}function ao(e,t){let n=Ya[t],r=n+2+10;return e.length<r?null:{salt:e.subarray(0,n),storedVerify:e.subarray(n,n+2),ciphertext:e.subarray(n+2,e.length-10),storedHmac:e.subarray(e.length-10)}}function oo(e,t){return e[0]===t[0]&&e[1]===t[1]}function so(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}async function co(e,t,n){let r=ao(e,n);if(!r)throw Error(`Encrypted data too short`);let{salt:i,storedVerify:a,ciphertext:o,storedHmac:s}=r,c=await eo(t,i,n);if(!oo(c.passwordVerify,a))throw Error(`Password verification failed`);if(!so(await to(c.hmacKey,o),s))throw Error(`HMAC verification failed`);return ro(c.encryptionKey,o,!1)}async function lo(e,t,n){let r=Ya[n],i=Va(r),a=await eo(t,i,n),o=await ro(a.encryptionKey,e,!0),s=await to(a.hmacKey,o),c=new Uint8Array(r+2+o.length+10),l=0;return c.set(i,l),l+=r,c.set(a.passwordVerify,l),l+=2,c.set(o,l),l+=o.length,c.set(s,l),c}function uo(e,t,n){let r=Cn(n),i=5+r.length,a=new Uint8Array(4+i),o=new DataView(a.buffer,a.byteOffset,a.byteLength);return o.setUint16(0,e,!0),o.setUint16(2,i,!0),a[4]=1,o.setUint32(5,na(t)>>>0,!0),a.set(r,9),a}function fo(e,t){return uo(28789,e,t)}function po(e,t){return uo(25461,e,t)}let mo=BigInt(2**53-1);function ho(e,t){return e.getBigUint64(t,!0)}function go(e){return typeof e.getBigUint64==`function`}function _o(e){if(!(e>mo))return Number(e)}function vo(e,t){let n={};if(e.length<4)return n;let r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=go(r),a=0;for(;a+4<=e.length;){let o=r.getUint16(a,!0),s=r.getUint16(a+2,!0),c=a+4,l=c+s;if(l>e.length)break;if(o===1){let e=c;if(t.uncompressedSize===4294967295&&e+8<=l){let i=ho(r,e);n.uncompressedSize64=i,t.uncompressedSize64=i;let a=_o(i);a!==void 0&&(n.uncompressedSize=a,t.uncompressedSize=a),e+=8}if(t.compressedSize===4294967295&&e+8<=l){let i=ho(r,e);n.compressedSize64=i,t.compressedSize64=i;let a=_o(i);a!==void 0&&(n.compressedSize=a,t.compressedSize=a),e+=8}if(t.offsetToLocalFileHeader===4294967295&&e+8<=l){let i=ho(r,e);n.offsetToLocalFileHeader64=i,t.offsetToLocalFileHeader64=i;let a=_o(i);a!==void 0&&(n.offsetToLocalFileHeader=a,t.offsetToLocalFileHeader=a)}}else if(o===21589){if(s>=1){let t=e[c],i=c+1;t&1&&i+4<=l&&(n.mtimeUnixSeconds=r.getUint32(i,!0)>>>0,i+=4),t&2&&i+4<=l&&(n.atimeUnixSeconds=r.getUint32(i,!0)>>>0,i+=4),t&4&&i+4<=l&&(n.ctimeUnixSeconds=r.getUint32(i,!0)>>>0)}}else if(o===10){if(i&&s>=8){let e=c+4;for(;e+4<=l;){let t=r.getUint16(e,!0),i=r.getUint16(e+2,!0),a=e+4,o=a+i;if(o>l)break;t===1&&i>=32&&a+32<=o&&(n.ntfsTimes={mtime:r.getBigUint64(a+0,!0),atime:r.getBigUint64(a+8,!0),ctime:r.getBigUint64(a+16,!0),birthTime:r.getBigUint64(a+24,!0)}),e=o}}}else if(o===39169){if(s>=7){let t=r.getUint16(c,!0),i=r.getUint16(c+2,!0),a=e[c+4],o=r.getUint16(c+5,!0);if(i===17729){let e=Qa[a];e&&(t===1||t===2)&&(n.aesInfo={version:t,keyStrength:e,compressionMethod:o})}}}else o===28789?s>=5&&(n.unicodePath={version:e[c],originalCrc32:r.getUint32(c+1,!0),unicodeValue:wn(e.subarray(c+5,l))}):o===25461&&s>=5&&(n.unicodeComment={version:e[c],originalCrc32:r.getUint32(c+1,!0),unicodeValue:wn(e.subarray(c+5,l))});a=l}return n}let yo=67324752,bo=33639248,xo=101010256,So=134695760,Co=101075792,wo=117853008,To=2048,Eo=61440,Do=40960,Oo=16384;function ko(e){return e>>16&65535}function Ao(e){return(e&Eo)===Do}function jo(e){return(e&Eo)===Oo}let Mo=4294967295;function No(e,t,n,r){let i=r.versionNeeded??20;return t.setUint32(n+0,yo,!0),t.setUint16(n+4,i,!0),t.setUint16(n+6,r.flags,!0),t.setUint16(n+8,r.compressionMethod,!0),t.setUint16(n+10,r.dosTime,!0),t.setUint16(n+12,r.dosDate,!0),t.setUint32(n+14,r.crc32,!0),t.setUint32(n+18,r.compressedSize,!0),t.setUint32(n+22,r.uncompressedSize,!0),t.setUint16(n+26,r.fileName.length,!0),t.setUint16(n+28,r.extraField.length,!0),e.set(r.fileName,n+30),r.extraField.length>0&&e.set(r.extraField,n+30+r.fileName.length),30+r.fileName.length+r.extraField.length}function Po(e){let t=new Uint8Array(30+e.fileName.length+e.extraField.length);return No(t,new DataView(t.buffer,t.byteOffset,t.byteLength),0,e),t}function Fo(e,t,n,r){let i=r.versionMadeBy??20,a=r.versionNeeded??20,o=r.externalAttributes??0;return t.setUint32(n+0,bo,!0),t.setUint16(n+4,i,!0),t.setUint16(n+6,a,!0),t.setUint16(n+8,r.flags,!0),t.setUint16(n+10,r.compressionMethod,!0),t.setUint16(n+12,r.dosTime,!0),t.setUint16(n+14,r.dosDate,!0),t.setUint32(n+16,r.crc32,!0),t.setUint32(n+20,r.compressedSize,!0),t.setUint32(n+24,r.uncompressedSize,!0),t.setUint16(n+28,r.fileName.length,!0),t.setUint16(n+30,r.extraField.length,!0),t.setUint16(n+32,r.comment.length,!0),t.setUint16(n+34,0,!0),t.setUint16(n+36,0,!0),t.setUint32(n+38,o,!0),t.setUint32(n+42,r.localHeaderOffset,!0),e.set(r.fileName,n+46),r.extraField.length>0&&e.set(r.extraField,n+46+r.fileName.length),r.comment.length>0&&e.set(r.comment,n+46+r.fileName.length+r.extraField.length),46+r.fileName.length+r.extraField.length+r.comment.length}function Io(e,t,n,r){return t.setUint32(n+0,xo,!0),t.setUint16(n+4,0,!0),t.setUint16(n+6,0,!0),t.setUint16(n+8,r.entryCount,!0),t.setUint16(n+10,r.entryCount,!0),t.setUint32(n+12,r.centralDirSize,!0),t.setUint32(n+16,r.centralDirOffset,!0),t.setUint16(n+20,r.comment.length,!0),r.comment.length>0&&e.set(r.comment,n+22),22+r.comment.length}function Lo(e,t,n){let r=new Uint8Array(16),i=new DataView(r.buffer);return i.setUint32(0,So,!0),i.setUint32(4,e,!0),i.setUint32(8,t,!0),i.setUint32(12,n,!0),r}function Ro(e,t,n){let r=n>>>0,i=Math.floor(n/4294967296)>>>0;e.setUint32(t,r,!0),e.setUint32(t+4,i,!0)}function zo(e,t,n){let r=new Uint8Array(24),i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setUint32(0,So,!0),i.setUint32(4,e,!0),Ro(i,8,t),Ro(i,16,n),r}function Bo(e){let t=e.uncompressedSize!==void 0,n=e.compressedSize!==void 0,r=e.localHeaderOffset!==void 0,i=e.diskNumberStart!==void 0,a=0;if(t&&(a+=8),n&&(a+=8),r&&(a+=8),i&&(a+=4),a===0)return P;let o=new Uint8Array(4+a),s=new DataView(o.buffer,o.byteOffset,o.byteLength);s.setUint16(0,1,!0),s.setUint16(2,a,!0);let c=4;return t&&(Ro(s,c,e.uncompressedSize),c+=8),n&&(Ro(s,c,e.compressedSize),c+=8),r&&(Ro(s,c,e.localHeaderOffset),c+=8),i&&s.setUint32(c,e.diskNumberStart,!0),o}function Vo(e,t){return E([e,t])}function Ho(e,t,n,r){let i=r.versionMadeBy??20,a=r.versionNeeded??45,o=r.diskNumber??0,s=r.centralDirectoryDiskNumber??0;return t.setUint32(n+0,Co,!0),Ro(t,n+4,44),t.setUint16(n+12,i,!0),t.setUint16(n+14,a,!0),t.setUint32(n+16,o,!0),t.setUint32(n+20,s,!0),Ro(t,n+24,r.entryCountOnDisk),Ro(t,n+32,r.entryCountTotal),Ro(t,n+40,r.centralDirSize),Ro(t,n+48,r.centralDirOffset),56}function Uo(e,t,n,r){let i=r.zip64EndOfCentralDirectoryDiskNumber??0,a=r.totalDisks??1;return t.setUint32(n+0,wo,!0),t.setUint32(n+4,i,!0),Ro(t,n+8,r.zip64EndOfCentralDirectoryOffset),t.setUint32(n+16,a,!0),20}let Wo=[[`version`,4],[`pubKeyLength`,4],[`signatureLength`,4]],Go=[[`versionsNeededToExtract`,2],[`flags`,2],[`compressionMethod`,2],[`lastModifiedTime`,2],[`lastModifiedDate`,2],[`crc32`,4],[`compressedSize`,4],[`uncompressedSize`,4],[`fileNameLength`,2],[`extraFieldLength`,2]],Ko=[[`dataDescriptorSignature`,4],[`crc32`,4],[`compressedSize`,4],[`uncompressedSize`,4]],qo=[[`versionMadeBy`,2],[`versionsNeededToExtract`,2],[`flags`,2],[`compressionMethod`,2],[`lastModifiedTime`,2],[`lastModifiedDate`,2],[`crc32`,4],[`compressedSize`,4],[`uncompressedSize`,4],[`fileNameLength`,2],[`extraFieldLength`,2],[`fileCommentLength`,2],[`diskNumber`,2],[`internalFileAttributes`,2],[`externalFileAttributes`,4],[`offsetToLocalFileHeader`,4]],Jo=[[`diskNumber`,2],[`diskStart`,2],[`numberOfRecordsOnDisk`,2],[`numberOfRecords`,2],[`sizeOfCentralDirectory`,4],[`offsetToStartOfCentralDirectory`,4],[`commentLength`,2]],Yo=va(So);function Xo(e){return((e||0)&To)!==0}function Zo(e){if(e.length===0)return!1;let t=e.charCodeAt(e.length-1);return t===47||t===92}function Qo(e,t){return t===0&&Zo(e)?`Directory`:`File`}function $o(e,t,n){return{path:e,pathBuffer:t,flags:{isUnicode:Xo(n)}}}function es(e,t){let n=e.lastModifiedDate||0,r=e.lastModifiedTime||0,i=ka(n,r),a=t.mtimeUnixSeconds;return a===void 0?i:Aa(n,r,a)}let ts=vo;function ns(e){return((e||0)&8)!=0}function rs(e,t){return!ns(e)||(t||0)>0}async function is(e){let t=await e(12),n=t.length>=12?fs(t):Sa(t,Wo),r=n.pubKeyLength||0,i=await e(r+(n.signatureLength||0));return n.publicKey=i.subarray(0,r),n.signature=i.subarray(r),n}async function as(e){let t=await e(26),n=t.length>=26?ps(t):Sa(t,Go);return{vars:n,fileNameBuffer:await e(n.fileNameLength||0),extraFieldData:await e(n.extraFieldLength||0)}}async function os(e){let t=await e(16);return t.length>=16?ms(t):Sa(t,Ko)}async function ss(e){let t=Sa(await e(42),qo);await e(t.fileNameLength||0),await e(t.extraFieldLength||0),await e(t.fileCommentLength||0)}async function cs(e){await e(Sa(await e(18),Jo).commentLength||0)}function ls(e){switch(e){case yo:case bo:case xo:case Co:case wo:return!0;default:return!1}}function us(e,t){return(e[t]|0|(e[t+1]|0)<<8|(e[t+2]|0)<<16|(e[t+3]|0)<<24)>>>0}function ds(e,t){return(e[t]|(e[t+1]|0)<<8)>>>0}function fs(e){return{version:us(e,0),pubKeyLength:us(e,4),signatureLength:us(e,8)}}function ps(e){return{versionsNeededToExtract:ds(e,0),flags:ds(e,2),compressionMethod:ds(e,4),lastModifiedTime:ds(e,6),lastModifiedDate:ds(e,8),crc32:us(e,10),compressedSize:us(e,14),uncompressedSize:us(e,18),fileNameLength:ds(e,22),extraFieldLength:ds(e,24)}}function ms(e){return{dataDescriptorSignature:us(e,0),crc32:us(e,4),compressedSize:us(e,8),uncompressedSize:us(e,12)}}let hs=va(xo);async function gs(e,t,n,r,i){for(;;){let a=await t.pull(4);if(a.length===0){n.emitClose();return}let o=ya(a,0);if(o===875721283){r.crxHeader=await is(async e=>t.pull(e)),n.emitCrxHeader(r.crxHeader);continue}if(o===67324752){await i(e,t,n,r);continue}if(o===33639248){r.reachedCD=!0,await ss(async e=>t.pull(e));continue}if(o===101010256){await cs(async e=>t.pull(e)),t.setDone(),n.emitClose();return}if(r.reachedCD){await t.pullUntil(hs,!0),await cs(async e=>t.pull(e)),t.setDone(),n.emitClose();return}n.emitError(Error(`invalid signature: 0x`+o.toString(16))),n.emitClose();return}}var _s=class{constructor(e){this.searchFrom=0,this.pattern=e,this.overlap=Math.max(0,e.length-1)}find(e){return e.indexOfPattern(this.pattern,this.searchFrom)}onConsume(e){e>0&&(this.searchFrom=Math.max(0,this.searchFrom-e))}onNoMatch(e){this.searchFrom=Math.max(this.searchFrom,Math.max(0,e-this.overlap))}};function vs(e){return e instanceof Error?e.code===`ERR_STREAM_PREMATURE_CLOSE`||e.message===`Premature close`:!1}async function ys(e){try{await _r(e,{readable:!1})}catch(e){if(!vs(e))throw e}}let bs=256*1024;function xs(e){let t=e.pipe(new ar({transform(e,t,n){n()}}));return t.promise=()=>new Promise((e,n)=>{t.on(`finish`,e),t.on(`error`,n)}),t}function Ss(e){return new Promise((t,n)=>{let r=[],i=new ar({transform(e,t,n){r.push(e),n()}});i.on(`finish`,()=>{t(r.length===1?r[0]:E(r))}),i.on(`error`,n),e.on(`error`,n).pipe(i)})}function Cs(e){let{source:t,dataDescriptorSignature:n}=e,r=e.keepTailBytes??20,i=e.errorMessage??`FILE_ENDED: Data descriptor not found`,a=new or({highWaterMark:bs}),o=!1,s=!1,c=0,l=new _s(n),u,d=()=>{u&&=(u(),void 0)},f=()=>{s=!1,p()},p=()=>{if(o||s)return;let e=t.getLength();for(e===0&&t.maybeReleaseWriteCallback?.();e>0;){let n=!1;for(;;){let r=l.find(t);if(r===-1)break;let i=r+16;if(i+4<=e){let e=t.peekUint32LE(i),n=t.peekUint32LE(r+8),u=c+r>>>0;if(e!==null&&n!==null&&ls(e)&&n===u){if(r>0)if(t.peekChunks&&t.discard){let e=t.peekChunks(r),n=0;for(let t of e){let e=a.write(t);if(n+=t.length,!e){s=!0,a.once(`drain`,f);break}}if(n>0&&(t.discard(n),c+=n,l.onConsume(n)),s)return}else{let e=a.write(t.read(r));if(c+=r,l.onConsume(r),!e){s=!0,a.once(`drain`,f);return}}o=!0,t.maybeReleaseWriteCallback?.(),d(),a.end();return}l.searchFrom=r+1;continue}if(l.searchFrom=r,n=!0,t.isFinished()&&r+16<=e){let e=t.peekUint32LE(r+8),n=c+r>>>0;if(e!==null&&e===n){if(r>0)if(t.peekChunks&&t.discard){let e=t.peekChunks(r),n=0;for(let t of e)a.write(t),n+=t.length;n>0&&(t.discard(n),c+=n,l.onConsume(n))}else a.write(t.read(r)),c+=r,l.onConsume(r);o=!0,t.maybeReleaseWriteCallback?.(),d(),a.end();return}}break}n||l.onNoMatch(e);let i=e-r;n&&(i=Math.min(i,l.searchFrom));let u=Math.max(0,i);if(u>0){if(t.peekChunks&&t.discard){let n=t.peekChunks(u),i=0;for(let e of n){let t=a.write(e);if(i+=e.length,!t){s=!0,a.once(`drain`,f);break}}i>0&&(t.discard(i),c+=i,e-=i,l.onConsume(i)),e<=r&&t.maybeReleaseWriteCallback?.();return}let n=a.write(t.read(u));c+=u,e-=u,l.onConsume(u),e<=r&&t.maybeReleaseWriteCallback?.(),n||(s=!0,a.once(`drain`,f));return}t.maybeReleaseWriteCallback?.();break}!o&&t.isFinished()&&(o=!0,d(),a.destroy(Error(i)))};return u=t.onDataAvailable(p),queueMicrotask(p),a}async function ws(e,t,n,r,i,a){let o=e.thresholdBytes??5242880;await gs(e,t,n,i,async(s,c,l,u)=>{await Es(e,t,n,r,i,o,a)})}async function Ts(e,t,n,r){let i=r,a=null,s=e=>{a=e};t.once(`error`,s),n.once(`error`,s);let c=!1,l=t,u=null,d=()=>{try{l?.removeListener?.(`drain`,p)}catch{}try{n.removeListener(`__autodrain`,m)}catch{}try{n.removeListener(`close`,h)}catch{}},f=()=>{let e=u;e&&(u=null,d(),e())},p=()=>{f()},m=()=>{f()},h=()=>{f()},g=async()=>{await new Promise(e=>{u=e,typeof l?.once==`function`&&l.once(`drain`,p),n.once(`__autodrain`,m),n.once(`close`,h),(n.__autodraining||n.destroyed)&&f()})},_=async()=>{if(!c){c=!0;try{let e=t;typeof e.unpipe==`function`&&e.unpipe(n)}catch{}try{!n.writableEnded&&!n.destroyed&&n.end()}catch{}try{let e=t;typeof e.destroy==`function`&&e.destroy()}catch{}}};try{for(t.pipe(n);i>0;){if(a)throw o(a);!c&&(n.__autodraining||n.destroyed)&&await _();let r=Math.min(262144,i),s=await e.pull(r);if(s.length!==r)throw Error(`FILE_ENDED`);i-=s.length,c||t.write(s)||await g()}c||t.end(),await ys(n)}finally{t.removeListener(`error`,s),n.removeListener(`error`,s)}}async function Es(e,t,n,r,i,a,o){let{vars:s,fileNameBuffer:c,extraFieldData:l}=await as(async e=>t.pull(e)),u=s;i.crxHeader&&(u.crxHeader=i.crxHeader);let d={uncompressedSize:u.uncompressedSize??0,compressedSize:u.compressedSize??0},f=ts(l,d);u.uncompressedSize=d.uncompressedSize,u.compressedSize=d.compressedSize;let p=e.encoding?da(e.encoding):void 0,m=ha(c,u.flags,f,p),h=new or({highWaterMark:bs}),g=!1;h.autodrain=function(){return g=!0,h.__autodraining=!0,h.emit(`__autodrain`),xs(h)},h.buffer=function(){return Ss(h)},h.path=m,h.props=$o(m,c,u.flags),h.type=Qo(m,u.uncompressedSize??0),e.verbose&&(h.type===`Directory`?console.log(` creating:`,m):h.type===`File`&&(u.compressionMethod===0?console.log(` extracting:`,m):console.log(` inflating:`,m))),u.lastModifiedDateTime=es({flags:u.flags,uncompressedSize:u.uncompressedSize??0,lastModifiedDate:u.lastModifiedDate,lastModifiedTime:u.lastModifiedTime},f),h.vars=u,h.extraFields=f,h.__autodraining=g;let _=rs(u.flags,u.compressedSize);_&&(h.size=u.uncompressedSize??0),e.forceStream?n.pushEntry(h):(n.emitEntry(h),n.pushEntryIfPiped(h)),e.verbose&&console.log({filename:m,vars:u,extraFields:h.extraFields});let v=((u.flags??0)&1)!=0||u.compressionMethod===99,y=u.compressionMethod!==0&&!v&&!g,b=!ns(u.flags),x=u.compressedSize??0,S=u.uncompressedSize??0;if(b&&_&&o&&y&&x<=a&&S<=a){let e=o(await t.pull(x));h.end(e),await ys(h);return}let C=y?r():new or({highWaterMark:bs});if(_){if(await Ts(t,C,h,u.compressedSize??0),ns(u.flags)){let e=await os(async e=>t.pull(e));h.size||=e.uncompressedSize??0}return}try{await gr(t.streamUntilDataDescriptor(),C,h)}catch(e){if(!vs(e))throw e;try{h.size=(await os(async e=>t.pull(e))).uncompressedSize??0}catch{}return}h.size=(await os(async e=>t.pull(e))).uncompressedSize??0}var Ds=class extends ir{constructor(){super({writableHighWaterMark:512*1024,readableHighWaterMark:512*1024,write:(e,t,n)=>{this._doWrite(e,n)},final:e=>{this._closeWriter(()=>{e()})}}),this.reading=!1,this.writeClosed=!1,this._junkError=!1,this._bytesIn=0,this._bytesOut=0,this._readingDone=!1,this._pendingWrites=0,this._writeFinishedPromise=null,this._resolveWriteFinished=null,this.decompressionStream=new DecompressionStream(`deflate-raw`),this.writer=this.decompressionStream.writable.getWriter(),this.reader=this.decompressionStream.readable.getReader(),this._readingDonePromise=new Promise(e=>{this._resolveReadingDone=e}),this._startReading()}_doWrite(e,t){if(this._junkError){t&&t();return}this._bytesIn+=e.length,this._pendingWrites++,this.writer.write(e).then(()=>{this._pendingWrites--,this._pendingWrites===0&&this._resolveWriteFinished&&this._resolveWriteFinished(),t&&t()}).catch(e=>{this._pendingWrites--,this._pendingWrites===0&&this._resolveWriteFinished&&this._resolveWriteFinished();let n=e instanceof Error?e.message:String(e);n.includes(`Junk`)||n.includes(`junk`)?(this._junkError=!0,t&&t()):t?t(e):this.emit(`error`,e)})}async _startReading(){if(!this.reading){this.reading=!0;try{for(;;){let{done:e,value:t}=await this.reader.read();if(e)break;this._bytesOut+=t.length,this.push(t)}}catch(e){let t=e instanceof Error?e.message:String(e);t.includes(`Junk`)||t.includes(`junk`)?this._junkError=!0:this.emit(`error`,e)}finally{this._readingDone=!0,this._resolveReadingDone(),this.push(null)}}}_closeWriter(e){if(this.writeClosed){this._readingDonePromise.then(()=>{e&&e()});return}this.writeClosed=!0,(this._pendingWrites>0?new Promise(e=>{this._writeFinishedPromise=new Promise(e=>{this._resolveWriteFinished=e}),this._writeFinishedPromise.then(e)}):Promise.resolve()).then(()=>this.writer.close()).catch(()=>{}).finally(()=>{this._readingDonePromise.then(()=>{e&&e()})})}destroy(e){return this.writeClosed||this.writer.abort(e??void 0).catch(()=>{}),this.reader.cancel(e??void 0).catch(()=>{}),super.destroy(e??void 0)}};let Os=null;function ks(e){if(typeof e==`string`&&e.length>0)return e;if(Os)return Os;let t=new Blob([`
|
|
39
|
+
`&&n++,n===i)break}if(t){let e=this.options.skipEmptyLines;this.parseConfig.delimiter=y(this.buffer,this.parseConfig.quote||`"`,this.options.delimitersToGuess,this.options.comment,e),this.delimiterDetected=!0,this.emit(`delimiter`,this.parseConfig.delimiter),this.scanner=Wt(Tt(this.parseConfig))}}this.processBuffer(n)}catch(e){n(e)}}_flush(e){if(this.chunkAborted||this.toLineReached){e();return}try{let t=this.decoder.decode();if(t&&(this.buffer+=t),this.buffer){this.processBuffer(t=>{if(t){e(t);return}this.flushCurrentRow(t=>{if(t){e(t);return}this.flushFinalChunk(e)})});return}this.flushCurrentRow(t=>{if(t){e(t);return}this.flushFinalChunk(e)})}catch(t){e(t)}}_destroy(e,t){this.pendingCallback=null,this.backpressure=!1,this.buffer=``,this.chunkBuffer=[],this.scanner.reset(),t(e)}flushCurrentRow(e){if(this.toLineReached){e();return}if(this.parseConfig.fastMode){this.flushFastModeRemainder(e);return}let t=this.scanner.flush();if(!t||t.fields.length===0){e();return}let n=this.parseConfig.trimFieldIsIdentity?t.fields.slice():t.fields.map(this.parseConfig.trimField),r=[],i=this._handleParsedRow({fields:n,charLength:0,raw:t.raw,quoted:t.quoted,pendingRows:r,shouldSkipEmpty:this.options.skipEmptyLines||!1,skipLines:this.options.skipLines??0,callback:e});i===`stop`||i===`error`||this.processPendingRows(r,e)}flushFastModeRemainder(e){let t=this.buffer;if(this.buffer=``,t.endsWith(`\r`)&&(t=t.slice(0,-1)),t===``){e();return}let n=[],r=t.split(this.parseConfig.delimiter),i=this.parseConfig.trimFieldIsIdentity?r:r.map(this.parseConfig.trimField),a=this.parseConfig.infoOption?Jt(i.length):void 0,o=this._handleParsedRow({fields:i,charLength:0,raw:t,quoted:a,pendingRows:n,shouldSkipEmpty:this.options.skipEmptyLines||!1,skipLines:this.options.skipLines??0,callback:e});o===`stop`||o===`error`||this.processPendingRows(n,e)}pushBufferedRows(e){let t=this.options.objectMode===!1;for(let n of e)if(!this.push(t?JSON.stringify(n):n))return!1;return!0}pushRow(e){let t=this.options.objectMode===!1;return this.push(t?JSON.stringify(e):e)}invokeChunkCallback(e,t,n){let r=this.options.chunk(e,t);r instanceof Promise?r.then(e=>{e===!1&&(this.chunkAborted=!0),n()}).catch(e=>n(e)):(r===!1&&(this.chunkAborted=!0),n())}flushFinalChunk(e){if(this.chunkBuffer.length>0&&this.options.chunk){let t=this.chunkBuffer.length,n={cursor:this.totalRowsProcessed-t,rowCount:t,isFirstChunk:this.isFirstChunk,isLastChunk:!0};this.pushBufferedRows(this.chunkBuffer);let r=this.chunkBuffer;this.chunkBuffer=[],this.invokeChunkCallback(r,n,e)}else e()}processBuffer(e){let{skipEmptyLines:t=!1,skipLines:n=0}=this.options,r=t;if(this.parseConfig.fastMode){this.processBufferFastMode(e,r);return}let i=[];this.scanner.feed(this.buffer),this.buffer=``;let a;for(;(a=this.scanner.nextRow())!==null;){let t=a.raw,o=(a.raw?.length??0)+(a.newline?.length??0),s=this.parseConfig.trimFieldIsIdentity?a.fields.slice():a.fields.map(this.parseConfig.trimField),c=this._handleParsedRow({fields:s,charLength:o,raw:t,quoted:a.quoted,pendingRows:i,shouldSkipEmpty:r,skipLines:n,callback:e});if(c===`stop`||c===`error`)return}this.processPendingRows(i,e)}getFastModeCompleteDataEnd(e){let{linebreakRegex:t}=this.parseConfig;if(typeof t==`string`){let n=t;if(n===``)return-1;let r=e.length-n.length;if(r<0)return-1;let i=e.lastIndexOf(n,r);return i===-1?-1:i+n.length}if(t===je){let t=e.lastIndexOf(`
|
|
40
|
+
`),n=e.lastIndexOf(`\r`),r;return r=n>t?n===e.length-1?t:n:t,r===-1?-1:r+1}let n=new RegExp(t.source,`${t.flags}g`),r=-1;for(let t=n.exec(e);t;t=n.exec(e))r=t.index+t[0].length,t[0].length===0&&n.lastIndex++;return r}processBufferFastMode(e,t){let{skipLines:n=0}=this.options,r=[],i=this.getFastModeCompleteDataEnd(this.buffer);if(i===-1){e();return}let a=this.buffer.slice(0,i);this.buffer=this.buffer.slice(i);for(let{line:i,lineLengthWithEnding:o}of kt(a,this.parseConfig.linebreakRegex)){if(i===``&&t){this.parseState.lineNumber++,this.totalCharsProcessed+=o;continue}let a=i.split(this.parseConfig.delimiter),s=this.parseConfig.trimFieldIsIdentity?a:a.map(this.parseConfig.trimField),c=this.parseConfig.infoOption?Jt(s.length):void 0,l=this._handleParsedRow({fields:s,charLength:o,raw:i,quoted:c,pendingRows:r,shouldSkipEmpty:t,skipLines:n,callback:e});if(l===`stop`||l===`error`)return}this.processPendingRows(r,e)}buildRow(e,t){let{dynamicTyping:n,castDate:r,groupColumnsByName:i=!1}=this.options,a;if(this.options.headers&&this.parseState.headerRow){let t=bt(e,this.parseState.headerRow,this.parseState.originalHeaders,i);a=n||r?mt(t,n||!1,r):t}else a=n||r?ht(e,this.parseState.headerRow?St(this.parseState.headerRow):null,n||!1,r):e;return this.parseConfig.infoOption?(t||={index:0,line:this.parseState.currentRowStartLine,offset:this.parseState.currentRowStartOffset,quoted:[...this.parseState.currentRowQuoted],raw:this.parseConfig.rawOption?this.parseState.currentRawRow:void 0},{record:a,info:t}):a}_handleParsedRow(e){let{fields:t,charLength:n,raw:r,quoted:i,pendingRows:a,shouldSkipEmpty:o,skipLines:s,callback:c}=e,l=this.parseState.lineNumber+1;if(r!==void 0){let e=1;for(let t=0;t<r.length;t++){let n=r.charCodeAt(t);n===10?e++:n===13&&(t+1<r.length&&r.charCodeAt(t+1)===10&&t++,e++)}this.parseState.lineNumber+=e}else this.parseState.lineNumber++;let{toLine:u}=this.options;return u!==void 0&&this.parseState.lineNumber>u?(this.toLineReached=!0,this.totalCharsProcessed+=n,this.processPendingRows(a,c),`stop`):this.parseState.lineNumber<=s?(this.totalCharsProcessed+=n,`skip`):(this.parseConfig.infoOption&&(this.parseState.currentRowStartLine=l,this.parseState.currentRowStartOffset=this.totalCharsProcessed,i&&(this.parseState.currentRowQuoted=i)),this.totalCharsProcessed+=n,r!==void 0&&this.parseConfig.maxRowBytes!==void 0&&Ie(r)>this.parseConfig.maxRowBytes?(c(Error(`Row exceeds the maximum size of ${this.parseConfig.maxRowBytes} bytes`)),`error`):(this.parseConfig.rawOption&&r!==void 0&&(this.parseState.currentRawRow=r),this.shouldSkipRow(t,o)?`skip`:this.processCompletedRow(t,a)?`continue`:(this.processPendingRows(a,c),`stop`)))}processCompletedRow(e,t){let n=Ft(e,this.parseState,this.parseConfig,this.parseErrorsSink,this.parseState.lineNumber);if(this.parseErrorsSink.length=0,this.emitHeaders(),n.reason&&this.emit(`data-invalid`,e,n.reason),n.stop)return!1;if(n.skipped)return!0;if(n.row){let e=this.buildRow(n.row,n.info);if(n.extras&&n.extras.length>0){let t=this.parseConfig.infoOption?e.record:e;t._extra=n.extras}t.push(e)}return!0}emitHeaders(){!this.headersEmitted&&this.parseState.headerRow&&(this.headersEmitted=!0,this.emit(`headers`,St(this.parseState.headerRow)))}shouldSkipRow(e,t){return Pt(e,this.parseConfig.comment,t,!1)}processPendingRows(e,t){if(e.length===0){t();return}if(this.chunkAborted){t();return}if(!this._rowTransform&&!this._rowValidator){let n=0,r=()=>{for(;n<e.length&&!this.chunkAborted;){let i=e[n++];if(this.options.chunk){if(this.chunkBuffer.push(i),this.totalRowsProcessed++,this.chunkBuffer.length>=this.chunkSize){this.flushChunk(e=>{if(e){t(e);return}if(this.chunkAborted){t();return}n%1e3==0?setTimeout(r,0):r()});return}}else if(!this.pushRow(i)){this.backpressure=!0,this.pendingCallback=()=>r();return}}t()};r();return}let n=0,r=()=>{if(n>=e.length){t();return}let i=e[n++];this.transformAndValidateRow(i,(e,i)=>{if(e){t(e);return}if(i&&i.isValid&&i.row!==null){if(this.options.chunk){if(this.chunkBuffer.push(i.row),this.totalRowsProcessed++,this.chunkBuffer.length>=this.chunkSize){this.flushChunk(e=>{if(e){t(e);return}n%1e3==0?setTimeout(r,0):r()});return}}else if(!this.pushRow(i.row)){this.backpressure=!0,this.pendingCallback=()=>r();return}}else i&&!i.isValid&&this.emit(`data-invalid`,i.row,i.reason);n%1e3==0?setTimeout(r,0):r()})};r()}flushChunk(e){if(this.chunkBuffer.length===0||!this.options.chunk){e();return}let t=this.chunkBuffer.length,n={cursor:this.totalRowsProcessed-t,rowCount:t,isFirstChunk:this.isFirstChunk,isLastChunk:!1};this.isFirstChunk=!1;let r=this.chunkBuffer;this.chunkBuffer=[],this.pushBufferedRows(r),this.invokeChunkCallback(r,n,e)}transformAndValidateRow(e,t){this._rowTransform?this._rowTransform(e,(e,n)=>{if(e){t(e);return}if(n==null){t(null,{row:null,isValid:!0});return}this.validateRow(n,t)}):this.validateRow(e,t)}validateRow(e,t){this._rowValidator?this._rowValidator(e,(n,r,i)=>{if(n){t(n);return}t(null,{row:e,isValid:r??!1,reason:i})}):t(null,{row:e,isValid:!0})}};function wr(e={}){return new Cr(e)}var Tr=class extends cr{constructor(e={}){super({objectMode:e.objectMode!==!1,writableObjectMode:e.objectMode!==!1}),this.headerWritten=!1,this.keys=null,this.displayHeaders=null,this.sourceRowIndex=0,this.outputRowIndex=0,this.options=e,this.formatConfig=re(e);let t=this.formatConfig;this.rowOptions={quoteLookup:t.shouldQuoteColumn,delimiter:t.delimiter,headers:void 0,isHeader:!1,outputRowIndex:0,quoteAll:t.quoteAll,escapeFormulae:t.escapeFormulae,decimalSeparator:t.decimalSeparator,transform:t.typeTransform};let n=_e(e.columns);n?(this.keys=n.keys,this.displayHeaders=n.headers):Array.isArray(e.headers)&&(this.keys=e.headers,this.displayHeaders=e.headers),this.displayHeaders&&=he(this.displayHeaders)}detectHeadersFromRow(e){let t=me(e);t.length>0&&(this.keys=t,this.displayHeaders=he(t))}_transform(e,t,n){try{!this.headerWritten&&this.formatConfig.bom&&this.push(``),this.headerWritten||=(this.options.headers===!0&&!this.keys&&this.detectHeadersFromRow(e),this.formatConfig.writeHeaders&&this.displayHeaders&&this.push(this.formatRow(this.displayHeaders,!0)),!0);let t=e,r=this.sourceRowIndex++;if(this.formatConfig.typeTransform?.row&&(t=this.formatConfig.typeTransform.row(e,r),t===null)){n();return}this.formatAndPush(t),this.outputRowIndex++,n()}catch(e){n(e)}}_destroy(e,t){this.keys=null,this.displayHeaders=null,t(e)}_flush(e){!this.headerWritten&&this.displayHeaders&&this.formatConfig.writeHeaders&&(this.formatConfig.bom&&this.push(``),this.push(this.formatRow(this.displayHeaders,!0)),this.headerWritten=!0);let t=this.formatConfig.writeHeaders&&this.displayHeaders||this.outputRowIndex>0;this.formatConfig.trailingNewline&&t&&this.push(this.formatConfig.lineEnding),e()}formatAndPush(e){let t=pe(e,this.keys);this.push(this.formatRow(t,!1))}formatRow(e,t=!1){let n=this.formatConfig,r=this.rowOptions;r.quoteLookup=t?n.shouldQuoteHeader:n.shouldQuoteColumn,r.headers=this.displayHeaders??void 0,r.isHeader=t,r.outputRowIndex=this.outputRowIndex;let i=De(e,n.regex,r);return t||!(n.writeHeaders&&this.displayHeaders)&&this.outputRowIndex===0?i:n.lineEnding+i}};function Er(e={}){return new Tr(e)}var Dr=class extends n{constructor(e,t){super(e,t),this.name=`ExcelError`}};function Or(e){return e instanceof Dr}var kr=class extends Dr{constructor(...e){super(...e),this.name=`WorksheetNameError`}},Ar=class extends Dr{constructor(e,t,n){super(t?`Invalid address "${e}": ${t}`:`Invalid address: ${e}`,n),this.address=e,this.name=`InvalidAddressError`}},jr=class extends Dr{constructor(e,t,n){super(t?`Column ${e} is out of bounds: ${t}`:`Column ${e} is out of bounds. Excel supports columns from 1 to 16384`,n),this.column=e,this.name=`ColumnOutOfBoundsError`}},Mr=class extends Dr{constructor(e,t,n){super(t?`Row ${e} is out of bounds: ${t}`:`Row ${e} is out of bounds`,n),this.row=e,this.name=`RowOutOfBoundsError`}},Nr=class extends Dr{constructor(e,t){super(e??`Cannot merge already merged cells`,t),this.name=`MergeConflictError`}},Pr=class extends Dr{constructor(e,t,n){super(t??`Cannot process value of type: ${e}`,n),this.valueType=e,this.name=`InvalidValueTypeError`}},Fr=class extends Dr{constructor(e,t,n){super(t??`Unexpected XML content in ${e}`,n),this.context=e,this.name=`XmlParseError`}},Ir=class extends Dr{constructor(e,t,n){super(t?`${e}: ${t}`:`${e} is not supported`,n),this.operation=e,this.reason=t,this.name=`ExcelNotSupportedError`}},Lr=class extends Dr{constructor(e,t,n,r){super(n?`Failed to ${t} Excel file "${e}": ${n}`:`Failed to ${t} Excel file "${e}"`,r),this.path=e,this.operation=t,this.name=`ExcelFileError`}},Rr=class extends Dr{constructor(e,t,n){super(`Cannot ${e}: ${t}`,n),this.operation=e,this.state=t,this.name=`ExcelStreamStateError`}},zr=class extends Dr{constructor(e,t,n,r){super(`Failed to download from "${e}": HTTP ${t} ${n}`,r),this.url=e,this.status=t,this.statusText=n,this.name=`ExcelDownloadError`}},Br=class extends Dr{constructor(...e){super(...e),this.name=`PivotTableError`}},Vr=class extends Dr{constructor(...e){super(...e),this.name=`TableError`}},Hr=class extends Dr{constructor(...e){super(...e),this.name=`ImageError`}},Ur=class extends Dr{constructor(e,t,n){super(`Max ${e} count (${t}) exceeded`,n),this.itemType=e,this.maxItems=t,this.name=`MaxItemsExceededError`}};let Wr=/^[A-Z]+\d+$/,O={_dictionary:`ABCDEFGHIJKLMNOPQRSTUVWXYZ`.split(``),_l2nFill:0,_l2n:{},_n2l:[],_level(e){return e<=26?1:e<=676?2:3},_fill(e){let t,n,r,i,a,o=1;if(e>=4)throw new jr(e,`Excel supports columns from 1 to 16384`);if(this._l2nFill<1&&e>=1){for(;o<=26;)t=this._dictionary[o-1],this._n2l[o]=t,this._l2n[t]=o,o++;this._l2nFill=1}if(this._l2nFill<2&&e>=2){for(o=27;o<=702;)n=o-27,r=n%26,i=Math.floor(n/26),t=this._dictionary[i]+this._dictionary[r],this._n2l[o]=t,this._l2n[t]=o,o++;this._l2nFill=2}if(this._l2nFill<3&&e>=3){for(o=703;o<=16384;)n=o-703,r=n%26,i=Math.floor(n/26)%26,a=Math.floor(n/676),t=this._dictionary[a]+this._dictionary[i]+this._dictionary[r],this._n2l[o]=t,this._l2n[t]=o,o++;this._l2nFill=3}},l2n(e){if(this._l2n[e]||this._fill(e.length),!this._l2n[e])throw new jr(e,`Invalid column letter: ${e}`);return this._l2n[e]},n2l(e){if(e<1||e>16384)throw new jr(e);return this._n2l[e]||this._fill(this._level(e)),this._n2l[e]},_hash:{},decodeCol(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r>=65&&r<=90)t=t*26+r-64;else break}return t},validateAddress(e){if(!Wr.test(e))throw new Ar(e);return!0},decodeAddress(e){if(!e||typeof e!=`string`)throw Error(`Invalid Address: ${e}`);let t=e.length<5&&this._hash[e];if(t)return t;let n=0,r=0,i=!1,a=!1,o=0,s=0;for(let t=0;t<e.length;t++){let c=e.charCodeAt(t);if(c===36){!i&&!a&&(s=t+1);continue}if(!a&&c>=65&&c<=90)i=!0,n=n*26+c-64,o=t+1;else if(c>=48&&c<=57)a=!0,r=r*10+c-48;else if(a&&i)break}if(!i)n=void 0;else if(n>16384){let t=e.slice(0,o);throw new jr(t,`Invalid column letter: ${t}`)}a||(r=void 0);let c=i?e.slice(s,o):``,l=a?String(r):``,u=c+l,d={address:u,col:n,row:r,$col$row:`$${c}$${l}`};return n<=100&&r<=100&&(this._hash[u]=d,this._hash[d.$col$row]=d),d},getAddress(e,t){if(t){let n=this.n2l(t)+e;return this.decodeAddress(n)}return this.decodeAddress(e)},decode(e){if(!e||typeof e!=`string`)throw Error(`Invalid Address: ${e}`);let t=e.split(`:`);if(t.length===2){let e=this.decodeAddress(t[0]),n=this.decodeAddress(t[1]),r={top:Math.min(e.row,n.row),left:Math.min(e.col,n.col),bottom:Math.max(e.row,n.row),right:Math.max(e.col,n.col),tl:``,br:``,dimensions:``};return r.tl=this.n2l(r.left)+r.top,r.br=this.n2l(r.right)+r.bottom,r.dimensions=`${r.tl}:${r.br}`,r}return this.decodeAddress(e)},decodeEx(e){if(!e||typeof e!=`string`)throw Error(`Invalid Address: ${e}`);let t=e.match(/^(?:(?:(?:'((?:[^']|'')+?)')|([^'^ !]+?))!)?(.*)$/),n=t[1]||t[2],r=t[3],i=r.split(`:`);if(i.length>1){let e=this.decodeAddress(i[0]),t=this.decodeAddress(i[1]),r=Math.min(e.row,t.row),a=Math.min(e.col,t.col),o=Math.max(e.row,t.row),s=Math.max(e.col,t.col),c=this.n2l(a)+r,l=this.n2l(s)+o;return{top:r,left:a,bottom:o,right:s,sheetName:n,tl:{address:c,col:a,row:r,$col$row:`$${this.n2l(a)}$${r}`,sheetName:n},br:{address:l,col:s,row:o,$col$row:`$${this.n2l(s)}$${o}`,sheetName:n},dimensions:`${c}:${l}`}}if(r.indexOf(`#`)===0)return n?{sheetName:n,error:r}:{error:r};let a=this.decodeAddress(r);return n?{sheetName:n,...a}:a},encodeAddress(e,t){return O.n2l(t)+e},encode(...e){switch(e.length){case 2:return O.encodeAddress(e[0],e[1]);case 4:return`${O.encodeAddress(e[0],e[1])}:${O.encodeAddress(e[2],e[3])}`;default:throw new Ar(String(e.length),`Can only encode with 2 or 4 arguments`)}},compareAddress(e,t){let n=O.decodeAddress(e),r=O.decodeAddress(t);return n.col-r.col||n.row-r.row},inRange(e,t){let[n,r,,i,a]=e,[o,s]=t;return o>=n&&o<=i&&s>=r&&s<=a}};var Gr=class e{constructor(...e){this.model={top:0,left:0,bottom:0,right:0},this.decode(e)}setTLBR(e,t,n,r,i){if(typeof e==`string`&&typeof t==`string`){let r=O.decodeAddress(e),i=O.decodeAddress(t);this.model={top:Math.min(r.row,i.row),left:Math.min(r.col,i.col),bottom:Math.max(r.row,i.row),right:Math.max(r.col,i.col),sheetName:typeof n==`string`?n:void 0}}else typeof e==`number`&&typeof t==`number`&&typeof n==`number`&&typeof r==`number`&&(this.model={top:Math.min(e,n),left:Math.min(t,r),bottom:Math.max(e,n),right:Math.max(t,r),sheetName:i})}decode(t){switch(t.length){case 5:typeof t[0]==`number`&&typeof t[1]==`number`&&typeof t[2]==`number`&&typeof t[3]==`number`&&typeof t[4]==`string`&&this.setTLBR(t[0],t[1],t[2],t[3],t[4]);break;case 4:typeof t[0]==`number`&&typeof t[1]==`number`&&typeof t[2]==`number`&&typeof t[3]==`number`&&this.setTLBR(t[0],t[1],t[2],t[3]);break;case 3:typeof t[0]==`string`&&typeof t[1]==`string`&&typeof t[2]==`string`&&this.setTLBR(t[0],t[1],t[2]);break;case 2:typeof t[0]==`string`&&typeof t[1]==`string`&&this.setTLBR(t[0],t[1]);break;case 1:{let n=t[0];if(n instanceof e)this.model={top:n.model.top,left:n.model.left,bottom:n.model.bottom,right:n.model.right,sheetName:n.sheetName};else if(Array.isArray(n))this.decode(n);else if(typeof n==`object`&&`top`in n&&`left`in n&&`bottom`in n&&`right`in n)this.model={top:n.top,left:n.left,bottom:n.bottom,right:n.right,sheetName:n.sheetName};else if(typeof n==`string`){let e=O.decodeEx(n);`top`in e?this.model={top:e.top,left:e.left,bottom:e.bottom,right:e.right,sheetName:e.sheetName}:`row`in e&&(this.model={top:e.row,left:e.col,bottom:e.row,right:e.col,sheetName:e.sheetName})}break}case 0:this.model={top:0,left:0,bottom:0,right:0};break;default:throw new Dr(`Invalid number of arguments to _getDimensions() - ${t.length}`)}}get top(){return this.model.top||1}set top(e){this.model.top=e}get left(){return this.model.left||1}set left(e){this.model.left=e}get bottom(){return this.model.bottom||1}set bottom(e){this.model.bottom=e}get right(){return this.model.right||1}set right(e){this.model.right=e}get sheetName(){return this.model.sheetName}set sheetName(e){this.model.sheetName=e}get _serialisedSheetName(){let{sheetName:e}=this.model;return e?/^[a-zA-Z0-9]*$/.test(e)?`${e}!`:`'${e}'!`:``}expand(e,t,n,r){(!this.model.top||e<this.top)&&(this.top=e),(!this.model.left||t<this.left)&&(this.left=t),(!this.model.bottom||n>this.bottom)&&(this.bottom=n),(!this.model.right||r>this.right)&&(this.right=r)}expandRow(e){if(e){let{dimensions:t,number:n}=e;t&&this.expand(n,t.min,n,t.max)}}expandToAddress(e){let t=O.decodeEx(e);`row`in t&&`col`in t&&this.expand(t.row,t.col,t.row,t.col)}get tl(){return O.n2l(this.left)+this.top}get $t$l(){return`$${O.n2l(this.left)}$${this.top}`}get br(){return O.n2l(this.right)+this.bottom}get $b$r(){return`$${O.n2l(this.right)}$${this.bottom}`}get range(){return`${this._serialisedSheetName+this.tl}:${this.br}`}get $range(){return`${this._serialisedSheetName+this.$t$l}:${this.$b$r}`}get shortRange(){return this.count>1?this.range:this._serialisedSheetName+this.tl}get $shortRange(){return this.count>1?this.$range:this._serialisedSheetName+this.$t$l}get count(){return(1+this.bottom-this.top)*(1+this.right-this.left)}toString(){return this.range}intersects(e){return!(e.sheetName&&this.sheetName&&e.sheetName!==this.sheetName||e.bottom<this.top||e.top>this.bottom||e.right<this.left||e.left>this.right)}contains(e){let t=O.decodeEx(e);return`row`in t&&`col`in t?this.containsEx(t):!1}containsEx(e){return e.sheetName&&this.sheetName&&e.sheetName!==this.sheetName?!1:e.row>=this.top&&e.row<=this.bottom&&e.col>=this.left&&e.col<=this.right}forEachAddress(e){for(let t=this.left;t<=this.right;t++)for(let n=this.top;n<=this.bottom;n++)e(O.encodeAddress(n,t),n,t)}};function Kr(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(e=>Kr(e));let t={};for(let n of Object.keys(e))n!==`__proto__`&&n!==`constructor`&&n!==`prototype`&&(t[n]=Kr(e[n]));return t}var qr=class{constructor(e){this.template=e,this.sheets=new Map}addCell(e){this.addCellEx(O.decodeEx(e))}getCell(e){return this.findCellEx(O.decodeEx(e),!0)}findCell(e){return this.findCellEx(O.decodeEx(e),!1)}findCellAt(e,t,n){let r=this.sheets.get(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.get(e);r||(r=[],this.sheets.set(e,r));let i=t>>>0,a=n>>>0,o=r[i]||(r[i]=[]);return o[a]||(o[a]={sheetName:e,address:O.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&&(n[e.col>>>0]=void 0)}forEachInSheet(e,t){let n=this.sheets.get(e);n&&n.forEach((e,n)=>{e&&e.forEach((e,r)=>{e&&t(e,n,r)})})}forEach(e){for(let t of this.sheets.keys())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.has(n))return this.sheets.get(n);if(t){let e=[];return this.sheets.set(n,e),e}}findSheetRow(e,t,n){let r=t.row>>>0;if(e&&e[r])return e[r];if(n)return e[r]=[]}findRowCell(e,t,n){let r=t.col>>>0;if(e&&e[r])return e[r];if(n)return e[r]=this.template?{...t,...Kr(this.template)}:t}spliceRows(e,t,n,r){let i=this.sheets.get(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.get(e);if(i){let e=[];for(let t=0;t<r;t++)e.push(null);i.forEach(r=>{r.splice(t,n,...e)})}}};function Jr(){return null}let Yr=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/,Xr=/^[$]?[A-Za-z]{1,3}[$]?\d+(:[$]?[A-Za-z]{1,3}[$]?\d+)?$/,Zr=/^[$]?\d+:[$]?\d+$/,Qr=/^[$]?[A-Za-z]{1,3}:[$]?[A-Za-z]{1,3}$/;function $r(e){if(e.startsWith(`{`)||e.endsWith(`}`))return!1;let t=e.split(`!`).pop()??``;if(!Xr.test(t)&&!Zr.test(t)&&!Qr.test(t))return!1;try{let t=O.decodeEx(e);return`row`in t&&typeof t.row==`number`||`top`in t&&typeof t.top==`number`||`left`in t&&typeof t.left==`number`}catch{return!1}}function ei(e){let t=e.trim();if(t.startsWith(`{`)&&t.endsWith(`}`))return[];let n=[],r=!1,i=``;return e.split(`,`).forEach(e=>{if(!e)return;let t=(e.match(/'/g)??[]).length;if(!t){r?i+=`${e},`:$r(e)&&n.push(e);return}let a=t%2==0;!r&&a&&$r(e)?n.push(e):r&&!a?(r=!1,$r(i+e)&&n.push(i+e),i=``):(r=!0,i+=`${e},`)}),n}function ti(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if(r===`'`)t=!t;else if(r===`(`&&!t)return!0}return!1}function ni(e,t,n){if(e===void 0)return t.length>0?{kind:`reference`,ranges:t}:{kind:`opaque`,ranges:[]};let r=e.trim();if(r.length===0)return{kind:`opaque`,ranges:[]};let i=r.startsWith(`{`)&&r.endsWith(`}`),a=r.startsWith(`"`)&&r.endsWith(`"`),o=r.startsWith(`#`),s=i||a||o;if(ti(r)&&!s)return n&&n(r)?{kind:`formula`,ranges:[r],formulaExpression:r}:{kind:`opaque`,ranges:[]};let c=ei(e);return c.length>0?{kind:`reference`,ranges:c}:s?{kind:`opaque`,ranges:[]}:n&&n(r)?{kind:`formula`,ranges:[r],formulaExpression:r}:{kind:`opaque`,ranges:[]}}function ri(e,t){return t===void 0?e:`${e}\0${t}`}var ii=class{constructor(e){this.matrixMap={},this.formulaMap={},this.localSheetIdMap={},this.opaqueMap={},this.nameForKey={},this._explicitProbe=e??null}getMatrix(e){return this.matrixMap[e]||(this.matrixMap[e]=new qr)}add(e,t){let n=O.decodeEx(e);`error`in n||(delete this.formulaMap[t],delete this.opaqueMap[t],this.nameForKey[t]=t,this.addEx(n,t))}addEx(e,t){let n=this.getMatrix(t);if(`top`in e)for(let t=e.left;t<=e.right;t++)for(let r=e.top;r<=e.bottom;r++){let i={sheetName:e.sheetName,address:O.n2l(t)+r,row:r,col:t};n.addCellEx(i)}else n.addCellEx(e)}addFormula(e,t){delete this.matrixMap[e],delete this.opaqueMap[e],this.nameForKey[e]=e,this.formulaMap[e]=t}remove(e,t){let n=O.decodeEx(e);`error`in n||this.removeEx(n,t)}removeEx(e,t){let n=this.getMatrix(t);if(`top`in e)for(let t=e.left;t<=e.right;t++)for(let r=e.top;r<=e.bottom;r++)n.removeCellEx({sheetName:e.sheetName,address:O.n2l(t)+r,row:r,col:t});else n.removeCellEx(e)}removeAllNames(e){Object.values(this.matrixMap).forEach(t=>{if(`top`in e)for(let n=e.left;n<=e.right;n++)for(let r=e.top;r<=e.bottom;r++)t.removeCellEx({sheetName:e.sheetName,address:O.n2l(n)+r,row:r,col:n});else t.removeCellEx(e)})}forEach(e){Object.entries(this.matrixMap).forEach(([t,n])=>{let r=this.nameForKey[t]??t;n.forEach(t=>{e(r,t)})})}getNames(e){let t=O.decodeEx(e);return`error`in t||`top`in t?[]:this.getNamesEx(t)}getNamesEx(e){return Object.entries(this.matrixMap).map(([t,n])=>n.findCellEx(e,!1)&&(this.nameForKey[t]??t)).filter(e=>!!e)}getAllNames(){return this.getAllEntries().map(e=>e.localSheetId===void 0?{name:e.name}:{name:e.name,localSheetId:e.localSheetId})}getAllEntries(){let e=[],t=new Set;for(let n of Object.keys(this.matrixMap)){if(t.has(n))continue;t.add(n);let r=this.getRanges(n),i=this.localSheetIdMap[n];e.push(i===void 0?r:{...r,localSheetId:i})}for(let n of Object.keys(this.formulaMap)){if(t.has(n))continue;t.add(n);let r=this.getRanges(n),i=this.localSheetIdMap[n];e.push(i===void 0?r:{...r,localSheetId:i})}for(let n of Object.keys(this.opaqueMap)){if(t.has(n))continue;t.add(n);let r=this.nameForKey[n]??n,i=this.opaqueMap[n];e.push({name:r,ranges:[],rawText:i.rawText,localSheetId:i.localSheetId,kind:`opaque`})}return e}_explore(e,t){t.mark=!1;let n=t.sheetName,r=new Gr(t.row,t.col,t.row,t.col,n),i,a,o=(t,r)=>e.findCellAt(n,t,r);function s(e,n){let i=o(e,t.col);return!i||!i.mark?!1:(r[n]=e,i.mark=!1,!0)}for(a=t.row-1;s(a,`top`);a--);for(a=t.row+1;s(a,`bottom`);a++);function c(e,t){let n=[];for(a=r.top;a<=r.bottom;a++){let t=o(a,e);if(t&&t.mark)n.push(t);else return!1}r[t]=e;for(let e=0;e<n.length;e++)n[e].mark=!1;return!0}for(i=t.col-1;c(i,`left`);i--);for(i=t.col+1;c(i,`right`);i++);return r}getRangesScoped(e,t){let n=ri(e,t);return this.getRanges(n)}getRanges(e,t){let n=this.formulaMap[e];t||=this.matrixMap[e];let r=this.nameForKey[e]??e;return t?(t.forEach(e=>{e.mark=!0}),{name:r,ranges:t.map(e=>e.mark&&this._explore(t,e)).filter(e=>!!e).map(e=>e.$shortRange)}):n?{name:r,ranges:[n],formulaExpression:n}:{name:r,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=O.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(){let e=Object.entries(this.matrixMap).map(([e,t])=>{let n=this.getRanges(e,t),r=this.localSheetIdMap[e];return r===void 0?n:{...n,localSheetId:r}}).filter(e=>e.ranges.length),t=Object.entries(this.formulaMap).filter(([e])=>!this.matrixMap[e]).map(([e,t])=>{let n={name:this.nameForKey[e]??e,ranges:[t],formulaExpression:t},r=this.localSheetIdMap[e];return r===void 0?n:{...n,localSheetId:r}}),n=Object.entries(this.opaqueMap).map(([e,t])=>({name:this.nameForKey[e]??e,ranges:[],rawText:t.rawText,localSheetId:t.localSheetId,kind:`opaque`}));return[...e,...t,...n]}set model(e){let t=this.matrixMap={},n=this.formulaMap={},r=this.localSheetIdMap={},i=this.opaqueMap={},a=this.nameForKey={},o=this._explicitProbe??Jr();for(let s of e){let e=ri(s.name,s.localSheetId);if(a[e]=s.name,s.localSheetId!==void 0&&(r[e]=s.localSheetId),s.formulaExpression&&s.rawText===void 0){n[e]=s.formulaExpression;continue}let c=ni(s.rawText,s.ranges,o);switch(c.kind){case`reference`:{let n=t[e]=new qr;for(let e of c.ranges)Yr.test(e.split(`!`).pop()??``)&&n.addCell(e);break}case`formula`:n[e]=c.formulaExpression;break;case`opaque`:s.rawText&&(i[e]={rawText:s.rawText,localSheetId:s.localSheetId});break}}}};let ai=new Uint8Array;function oi(e,t,n=0){let r=e.length,i=t.length;if(i===0)return 0;if(i>r)return-1;let a=n|0;if(a<0&&(a=0),a>r-i)return-1;if(i===1)return e.indexOf(t[0],a);if(i===2){let n=t[0],i=t[1],o=r-2,s=e.indexOf(n,a);for(;s!==-1&&s<=o;){if(e[s+1]===i)return s;s=e.indexOf(n,s+1)}return-1}if(i===3){let n=t[0],i=t[1],o=t[2],s=r-3,c=e.indexOf(n,a);for(;c!==-1&&c<=s;){if(e[c+1]===i&&e[c+2]===o)return c;c=e.indexOf(n,c+1)}return-1}if(i===4){let n=t[0],i=t[1],o=t[2],s=t[3],c=r-4,l=e.indexOf(n,a);for(;l!==-1&&l<=c;){if(e[l+1]===i&&e[l+2]===o&&e[l+3]===s)return l;l=e.indexOf(n,l+1)}return-1}for(let n=a;n<=r-i;n++){let r=!0;for(let a=0;a<i;a++)if(e[n+a]!==t[a]){r=!1;break}if(r)return n}return-1}var si=class{_activeChunkCount(){return this._chunks.length-this._chunkHead}_headChunk(){return this._chunks[this._chunkHead]}_compactConsumedChunks(){if(this._chunkHead!==0){if(this._chunkHead>=this._chunks.length){this._chunks=[],this._chunkHead=0;return}this._chunkHead>32&&this._chunkHead*2>=this._chunks.length&&(this._chunks=this._chunks.slice(this._chunkHead),this._chunkHead=0)}}_dropHeadChunk(){this._chunkHead++,this._headOffset=0,this._compactConsumedChunks()}constructor(e){this._chunks=[],this._chunkHead=0,this._headOffset=0,this._length=0,this._cachedView=null,this._cachedLength=0,e&&e.length>0&&this.reset(e)}get length(){return this._length}isEmpty(){return this.length===0}view(){if(this._length===0)return ai;if(this._activeChunkCount()===1)return this._headChunk().subarray(this._headOffset,this._headOffset+this._length);if(this._cachedView&&this._cachedLength===this._length)return this._cachedView;let e=new Uint8Array(this._length),t=0;for(let n=this._chunkHead;n<this._chunks.length;n++){let r=this._chunks[n],i=n===this._chunkHead?this._headOffset:0,a=n===this._chunks.length-1?i+(this._length-t):r.length;if(e.set(r.subarray(i,a),t),t+=a-i,t>=e.length)break}return this._cachedView=e,this._cachedLength=this._length,e}reset(e){if(this._cachedView=null,this._cachedLength=0,this._chunks=[],this._chunkHead=0,this._headOffset=0,this._length=0,!e||e.length===0)return;let t=new Uint8Array(e.length);t.set(e),this._chunks=[t],this._chunkHead=0,this._headOffset=0,this._length=t.length}append(e){e.length!==0&&(this._cachedView=null,this._cachedLength=0,this._chunks.push(e),this._length+=e.length)}read(e){if(e<=0)return ai;if(e>this._length)throw RangeError(`ByteQueue: read beyond available data`);if(this._cachedView=null,this._cachedLength=0,this._activeChunkCount()===1){let t=this._headChunk(),n=this._headOffset,r=n+e,i=t.subarray(n,r);return this._headOffset=r,this._length-=e,this._length===0?(this._chunks=[],this._chunkHead=0,this._headOffset=0):this._headOffset>=t.length&&this._dropHeadChunk(),i}let t=new Uint8Array(e),n=0,r=e;for(;r>0;){let e=this._headChunk(),i=this._headOffset,a=e.length-i,o=Math.min(a,r);t.set(e.subarray(i,i+o),n),n+=o,r-=o,this._headOffset+=o,this._length-=o,this._headOffset>=e.length&&this._dropHeadChunk()}return this._length===0&&(this._chunks=[],this._chunkHead=0,this._headOffset=0),t}peekChunks(e){if(e<=0)return[];if(e>this._length)throw RangeError(`ByteQueue: peek beyond available data`);if(this._activeChunkCount()===1){let t=this._headChunk(),n=this._headOffset;return[t.subarray(n,n+e)]}let t=[],n=e;for(let e=this._chunkHead;e<this._chunks.length&&n>0;e++){let r=this._chunks[e],i=e===this._chunkHead?this._headOffset:0,a=r.length-i;if(a<=0)continue;let o=Math.min(a,n);t.push(r.subarray(i,i+o)),n-=o}return t}discard(e){if(e<=0)return;if(e>=this._length){this._chunks=[],this._chunkHead=0,this._headOffset=0,this._length=0,this._cachedView=null,this._cachedLength=0;return}this._cachedView=null,this._cachedLength=0;let t=e;for(;t>0;){let e=this._headChunk(),n=this._headOffset,r=e.length-n,i=Math.min(r,t);this._headOffset+=i,this._length-=i,t-=i,this._headOffset>=e.length&&this._dropHeadChunk()}this._length===0&&(this._chunks=[],this._chunkHead=0,this._headOffset=0)}indexOfPattern(e,t=0){let n=e.length;if(n===0)return 0;let r=this._length;if(n>r)return-1;let i=t|0;if(i<0&&(i=0),i>r-n)return-1;if(this._activeChunkCount()===1){let t=this._headChunk(),a=this._headOffset,o=t.subarray(a,a+r);return n===1?o.indexOf(e[0],i):oi(o,e,i)}if(n>4)return oi(this.view(),e,i);let a=e[0],o=n>=2?e[1]:0,s=n>=3?e[2]:0,c=n>=4?e[3]:0,l=this._chunks,u=this._chunkHead,d=(e,t)=>{let n=e,r=t;for(;n<l.length;){let e=l[n];if(r<e.length)return e[r]|0;r-=e.length,n++}return null},f=0;for(let e=u;e<l.length;e++){let t=l[e],p=e===u?this._headOffset:0,m=t.length-p;if(m<=0)continue;let h=f,g=h+m,_=i<=h?p:i>=g?t.length:p+(i-h);if(_>t.length-1){f+=m;continue}let v=t.length-1,y=t.indexOf(a,_);for(;y!==-1&&y<=v;){let i=h+(y-p);if(i>r-n)return-1;if(n===1)return i;if(y+n<=t.length){if(t[y+1]!==o){y=t.indexOf(a,y+1);continue}if(n===2)return i;if(t[y+2]!==s){y=t.indexOf(a,y+1);continue}if(n===3)return i;if(t[y+3]!==c){y=t.indexOf(a,y+1);continue}return i}let l=d(e,y+1);if(l===null||l!==o){y=t.indexOf(a,y+1);continue}if(n===2)return i;let u=d(e,y+2);if(u===null||u!==s){y=t.indexOf(a,y+1);continue}if(n===3)return i;let f=d(e,y+3);if(f===null||f!==c){y=t.indexOf(a,y+1);continue}return i}f+=m}return-1}peekUint32LE(e){let t=e|0;if(t<0||t+4>this._length)return null;let n=this._chunks,r=t;for(let e=this._chunkHead;e<n.length;e++){let t=n[e],i=e===this._chunkHead?this._headOffset:0,a=t.length-i;if(r<a){let a=i+r;if(a+4<=t.length){let e=t[a]|0,n=t[a+1]|0,r=t[a+2]|0,i=t[a+3]|0;return(e|n<<8|r<<16|i<<24)>>>0}let o=t[a]|0,s=0,c=0,l=0,u=e,d=a+1;for(let e=1;e<4;e++)for(;u<n.length;){let t=n[u];if(d<t.length){let n=t[d]|0;e===1?s=n:e===2?c=n:l=n,d++;break}u++,d=0}return(o|s<<8|c<<16|l<<24)>>>0}r-=a}return null}peekByte(e){let t=e|0;if(t<0||t>=this._length)throw RangeError(`ByteQueue: peek beyond available data`);let n=t;for(let e=this._chunkHead;e<this._chunks.length;e++){let t=this._chunks[e],r=e===this._chunkHead?this._headOffset:0,i=t.length-r;if(n<i)return t[r+n]|0;n-=i}throw RangeError(`ByteQueue: peek beyond available data`)}};function ci(){try{return typeof CompressionStream>`u`?!1:(new CompressionStream(`deflate-raw`),!0)}catch{return!1}}function li(){try{return typeof DecompressionStream>`u`?!1:(new DecompressionStream(`deflate-raw`),!0)}catch{return!1}}let ui=null,di=null;function fi(){return typeof CompressionStream>`u`?!1:(ui===null&&(ui=ci()),ui)}function pi(){return typeof DecompressionStream>`u`?!1:(di===null&&(di=li()),di)}function mi(){return fi()&&pi()}async function hi(e){let t=new si;for(;;){let{done:n,value:r}=await e.read();if(n)break;t.append(r)}return t.read(t.length)}async function gi(e,t){let n=t.writable.getWriter(),r=t.readable.getReader();try{let t=hi(r);return await n.write(e),await n.close(),await t}finally{try{n.releaseLock()}catch{}try{r.releaseLock()}catch{}}}async function _i(e){return gi(e,new DecompressionStream(`deflate-raw`))}let vi=65521;function yi(e){let t=1,n=0;for(let r=0;r<e.length;){let i=Math.min(r+5552,e.length);for(;r<i;)t+=e[r++],n+=t;t%=vi,n%=vi}return n<<16|t}let bi={};function xi(e,t){let n=`${e}:${t}`;return()=>{let r=e===`compression`?typeof CompressionStream<`u`?CompressionStream:void 0:typeof DecompressionStream<`u`?DecompressionStream:void 0;if(!r)return!1;let i=bi[n];if(i!=null)return i;try{new r(t),bi[n]=!0}catch{bi[n]=!1}return bi[n]}}xi(`compression`,`gzip`),xi(`decompression`,`gzip`),xi(`compression`,`deflate`),xi(`decompression`,`deflate`);let Si={0:new Uint8Array([120,1]),1:new Uint8Array([120,1]),2:new Uint8Array([120,94]),3:new Uint8Array([120,94]),4:new Uint8Array([120,94]),5:new Uint8Array([120,94]),6:new Uint8Array([120,156]),7:new Uint8Array([120,218]),8:new Uint8Array([120,218]),9:new Uint8Array([120,218])};function Ci(e){return Si[Math.max(0,Math.min(9,e))]??Si[6]}function wi(e){let t=new Uint8Array(4);return t[0]=e>>>24&255,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=e&255,t}let Ti=(()=>{let e=new Uint8Array(288);for(let t=0;t<=143;t++)e[t]=8;for(let t=144;t<=255;t++)e[t]=9;for(let t=256;t<=279;t++)e[t]=7;for(let t=280;t<=287;t++)e[t]=8;return e})(),Ei=new Uint8Array(32).fill(5),Di=[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],Oi=[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],ki=[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],Ai=[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],ji=[[1,0,0],[2,1,0],[3,2,0],[4,3,0],[6,4,1],[8,5,1],[12,6,2],[16,7,2],[24,8,3],[32,9,3],[48,10,4],[64,11,4],[96,12,5],[128,13,5],[192,14,6],[256,15,6],[384,16,7],[512,17,7],[768,18,8],[1024,19,8],[1536,20,9],[2048,21,9],[3072,22,10],[4096,23,10],[6144,24,11],[8192,25,11],[12288,26,12],[16384,27,12],[24576,28,13],[32768,29,13]],Mi=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Ni(e,t){let n=new Uint16Array(16);for(let r=0;r<t;r++)e[r]>0&&n[e[r]]++;let r=new Uint16Array(16),i=0;for(let e=1;e<=15;e++)i=i+n[e-1]<<1,r[e]=i;let a={};for(let n=0;n<t;n++){let t=e[n];if(t===0)continue;i=r[t]++;let o=a;for(let e=t-1;e>=0;e--)i>>e&1?(o.right||={},o=o.right):(o.left||={},o=o.left);o.symbol=n}return a}var Pi=class{constructor(e){this.data=e,this.pos=0,this.bitBuf=0,this.bitCount=0}readBits(e){for(;this.bitCount<e;){if(this.pos>=this.data.length)throw Error(`Unexpected end of DEFLATE data`);this.bitBuf|=this.data[this.pos++]<<this.bitCount,this.bitCount+=8}let t=this.bitBuf&(1<<e)-1;return this.bitBuf>>=e,this.bitCount-=e,t}decodeSymbol(e){let t=e;for(;t.symbol===void 0;)if(t=this.readBits(1)===0?t.left:t.right,!t)throw Error(`Invalid Huffman code`);return t.symbol}alignToByte(){this.bitBuf=0,this.bitCount=0}readByte(){if(this.pos>=this.data.length)throw Error(`Unexpected end of data`);return this.data[this.pos++]}readUint16(){return this.readByte()|this.readByte()<<8}};function Fi(e){let t=new Pi(e),n=[],r=!1;for(;!r;){r=t.readBits(1)===1;let e=t.readBits(2);if(e===0){t.alignToByte();let e=t.readUint16();if((e^t.readUint16())!==65535)throw Error(`Invalid stored block length`);for(let r=0;r<e;r++)n.push(t.readByte())}else if(e===1||e===2){let r,i;if(e===1)r=Ni(Ti,288),i=Ni(Ei,32);else{let e=t.readBits(5)+257,n=t.readBits(5)+1,a=t.readBits(4)+4,o=new Uint8Array(19);for(let e=0;e<a;e++)o[Mi[e]]=t.readBits(3);let s=Ni(o,19),c=new Uint8Array(e+n),l=0;for(;l<e+n;){let e=t.decodeSymbol(s);if(e<16)c[l++]=e;else if(e===16){let e=t.readBits(2)+3,n=c[l-1];for(let t=0;t<e;t++)c[l++]=n}else if(e===17){let e=t.readBits(3)+3;for(let t=0;t<e;t++)c[l++]=0}else if(e===18){let e=t.readBits(7)+11;for(let t=0;t<e;t++)c[l++]=0}}r=Ni(c.subarray(0,e),e),i=Ni(c.subarray(e),n)}for(;;){let e=t.decodeSymbol(r);if(e<256)n.push(e);else if(e===256)break;else{let r=e-257,a=Di[r]+t.readBits(Oi[r]),o=t.decodeSymbol(i),s=ki[o]+t.readBits(Ai[o]),c=n.length-s;for(let e=0;e<a;e++)n.push(n[c+e])}}}else throw Error(`Invalid DEFLATE block type: `+e)}return new Uint8Array(n)}function Ii(e){let t=65535,n=Math.ceil(e.length/t)||1,r=n*5+e.length,i=new Uint8Array(r),a=0,o=0;for(let r=0;r<n;r++){let s=r===n-1,c=Math.min(t,e.length-o);i[a++]=+!!s,i[a++]=c&255,i[a++]=c>>8&255,i[a++]=~c&255,i[a++]=~c>>8&255,i.set(e.subarray(o,o+c),a),a+=c,o+=c}return i.subarray(0,a)}let Li=32768;Li-1;let Ri=32768;function zi(e){return e<=1?{maxChainLen:4,goodLen:4,niceLen:8,lazy:!1}:e<=3?{maxChainLen:8,goodLen:8,niceLen:32,lazy:!0}:e<=5?{maxChainLen:32,goodLen:16,niceLen:128,lazy:!0}:e<=7?{maxChainLen:64,goodLen:32,niceLen:258,lazy:!0}:{maxChainLen:128,goodLen:64,niceLen:258,lazy:!0}}function Bi(e,t,n){return(e<<16|t<<8|n)*506832829>>>17&32767}function Vi(e,t=6){if(e.length===0)return new Uint8Array([3,0]);if(e.length<100)return Ii(e);let n=zi(t),r=Xi(e,0,e.length,n,null),i=new Hi;return Yi(i,r,!0),i.finish()}var Hi=class{constructor(){this.chunks=[],this.buffer=[],this.bitBuf=0,this.bitCount=0}alignToByte(){this.bitCount>0&&this.writeBits(0,8-this.bitCount)}writeBits(e,t){for(this.bitBuf|=e<<this.bitCount,this.bitCount+=t;this.bitCount>=8;)this.buffer.push(this.bitBuf&255),this.bitBuf>>=8,this.bitCount-=8,this.buffer.length>=65536&&(this.chunks.push(new Uint8Array(this.buffer)),this.buffer=[])}writeBitsReverse(e,t){let n=0;for(let r=0;r<t;r++)n=n<<1|e>>r&1;this.writeBits(n,t)}finish(){return this.bitCount>0&&this.buffer.push(this.bitBuf&255),this.chunks.length===0?new Uint8Array(this.buffer):(this.chunks.push(new Uint8Array(this.buffer)),T(this.chunks))}flushBytes(){if(this.chunks.length===0&&this.buffer.length===0)return new Uint8Array;let e;return this.chunks.length===0?e=new Uint8Array(this.buffer):(this.chunks.push(new Uint8Array(this.buffer)),e=T(this.chunks),this.chunks=[]),this.buffer=[],e}};let Ui=(()=>{let e=[];for(let t=0;t<=287;t++){let n,r;t<=143?(n=48+t,r=8):t<=255?(n=400+(t-144),r=9):t<=279?(n=t-256,r=7):(n=192+(t-280),r=8),e[t]=[n,r]}return e})();function Wi(e,t){let[n,r]=Ui[t];e.writeBitsReverse(n,r)}function Gi(e){for(let t=0;t<Di.length;t++)if(t===Di.length-1||e<Di[t+1])return{code:257+t,extra:e-Di[t],extraBits:Oi[t]};return{code:285,extra:0,extraBits:0}}function Ki(e){for(let t=0;t<ji.length;t++){let[n,r,i]=ji[t];if(e<=n)return{code:r,extra:e-(t===0?1:ji[t-1][0]+1),extraBits:i}}return{code:29,extra:0,extraBits:13}}function qi(e,t){let n=e.length,r=new Uint8Array(n),i=[];for(let t=0;t<n;t++)e[t]>0&&i.push({sym:t,freq:e[t]});if(i.length===0)return r;if(i.length===1)return r[i[0].sym]=1,r;i.sort((e,t)=>e.freq-t.freq||e.sym-t.sym);let a=i.map(e=>({freq:e.freq,sym:e.sym,left:null,right:null})),o=0,s=0,c=[];function l(){let e=o<a.length,t=s<c.length;return e&&t?a[o].freq<=c[s].freq?a[o++]:c[s++]:e?a[o++]:c[s++]}let u=i.length;for(let e=0;e<u-1;e++){let e=l(),t=l(),n={freq:e.freq+t.freq,sym:-1,left:e,right:t};c.push(n)}let d=c[c.length-1];function f(e,t){if(e.sym>=0){r[e.sym]=t;return}e.left&&f(e.left,t+1),e.right&&f(e.right,t+1)}f(d,0);let p=new Uint16Array(t+1);for(let e=0;e<n;e++)r[e]>0&&(r[e]>t?(p[t]++,r[e]=t):p[r[e]]++);let m=0;for(let e=1;e<=t;e++)m+=p[e]<<t-e;let h=1<<t;if(m===h)return r;for(;m>h;){let e=t-1;for(;e>0&&p[e]===0;)e--;if(e===0)break;p[e]--,p[t]++,m-=(1<<t-e)-1}for(;m<h;)p[t]++,m++;let g=[];for(let t=0;t<n;t++)r[t]>0&&g.push({sym:t,origLen:r[t],freq:e[t]});g.sort((e,t)=>t.origLen-e.origLen||e.freq-t.freq),r.fill(0);let _=0;for(let e=t;e>=1;e--)for(let t=p[e];t>0;t--)_<g.length&&(r[g[_].sym]=e,_++);return r}function Ji(e){let t=e.length,n=Array(t),r=new Uint16Array(16);for(let n=0;n<t;n++)e[n]>0&&r[e[n]]++;let i=new Uint16Array(16),a=0;for(let e=1;e<=15;e++)a=a+r[e-1]<<1,i[e]=a;for(let r=0;r<t;r++){let t=e[r];t>0?n[r]=[i[t]++,t]:n[r]=[0,0]}return n}function Yi(e,t,n){let r=new Uint32Array(286),i=new Uint32Array(30);r[256]=1;for(let e of t)if(e.dist===0)r[e.litOrLen]++;else{let t=Gi(e.litOrLen);r[t.code]++;let n=Ki(e.dist);i[n.code]++}let a=qi(r,15),o=qi(i,15),s=!1;for(let e=0;e<o.length;e++)if(o[e]>0){s=!0;break}s||(o=new Uint8Array(30),o[0]=1,o[1]=1);let c=Ji(a),l=Ji(o),u=286;for(;u>257&&a[u-1]===0;)u--;let d=30;for(;d>1&&o[d-1]===0;)d--;let f=new Uint8Array(u+d);f.set(a.subarray(0,u)),f.set(o.subarray(0,d),u);let p=[],m=new Uint32Array(19);for(let e=0;e<f.length;){let t=f[e];if(t===0){let t=1;for(;e+t<f.length&&f[e+t]===0;)t++;for(;t>0;)if(t>=11){let n=Math.min(t,138);p.push({sym:18,extra:n-11,extraBits:7}),m[18]++,t-=n,e+=n}else if(t>=3){let n=Math.min(t,10);p.push({sym:17,extra:n-3,extraBits:3}),m[17]++,t-=n,e+=n}else p.push({sym:0,extra:0,extraBits:0}),m[0]++,t--,e++}else{p.push({sym:t,extra:0,extraBits:0}),m[t]++,e++;let n=0;for(;e+n<f.length&&f[e+n]===t;)n++;for(;n>=3;){let t=Math.min(n,6);p.push({sym:16,extra:t-3,extraBits:2}),m[16]++,n-=t,e+=t}for(;n>0;)p.push({sym:t,extra:0,extraBits:0}),m[t]++,n--,e++}}let h=qi(m,7),g=Ji(h),_=19;for(;_>4&&h[Mi[_-1]]===0;)_--;e.writeBits(+!!n,1),e.writeBits(2,2),e.writeBits(u-257,5),e.writeBits(d-1,5),e.writeBits(_-4,4);for(let t=0;t<_;t++)e.writeBits(h[Mi[t]],3);for(let t of p){let[n,r]=g[t.sym];e.writeBitsReverse(n,r),t.extraBits>0&&e.writeBits(t.extra,t.extraBits)}for(let n of t)if(n.dist===0){let[t,r]=c[n.litOrLen];e.writeBitsReverse(t,r)}else{let t=Gi(n.litOrLen),[r,i]=c[t.code];e.writeBitsReverse(r,i),t.extraBits>0&&e.writeBits(t.extra,t.extraBits);let a=Ki(n.dist),[o,s]=l[a.code];e.writeBitsReverse(o,s),a.extraBits>0&&e.writeBits(a.extra,a.extraBits)}let[v,y]=c[256];e.writeBitsReverse(v,y)}function Xi(e,t,n,r,i){let a=[],o=r.maxChainLen,s=r.goodLen,c=r.niceLen,l=r.lazy,u,d,f,p,m,h,g,_,v;i?(u=i.head,d=i.prev,f=i.window,p=i.windowLen,m=i.totalIn,h=i.hasPrevMatch,g=i.prevMatchLen,_=i.prevMatchDist,v=i.prevLiteral):(u=new Int32Array(Li),d=new Int32Array(Ri),f=null,p=0,m=0,h=!1,g=0,_=0,v=0);let y=i?r=>{let i=r-m;return i>=t&&i<n?e[i]:f[r&Ri-1]}:t=>e[t],b=i?t=>{if(t+2>=n)return;let r=Bi(e[t],e[t+1],e[t+2]),i=m+t;d[i&Ri-1]=u[r],u[r]=i+1}:t=>{if(t+2>=n)return;let r=Bi(e[t],e[t+1],e[t+2]);d[t&Ri-1]=u[r],u[r]=t+1},x=i?(t,n)=>{for(let r=0;r<n;r++)f[p+r&Ri-1]=e[t+r];p+=n}:(e,t)=>{},S=t;for(;S<n;){let t=0,r=0;if(S+2<n){let a=Bi(e[S],e[S+1],e[S+2]),f=i?m+S:S,p=l&&h&&g>=s?o>>2:o,_=u[a];for(;_>0&&p-- >0;){let i=_-1,a=f-i;if(a>Ri||a<=0)break;if(t>=3&&y(i+t)!==e[S+t]){_=d[i&Ri-1];continue}let o=Math.min(258,n-S),s=0;for(;s<o&&y(i+s)===e[S+s];)s++;if(s>t&&(t=s,r=a,s>=c))break;_=d[i&Ri-1]}i?(d[f&Ri-1]=u[a],u[a]=f+1):(d[S&Ri-1]=u[a],u[a]=S+1)}if(l&&h)if(t>g)a.push({litOrLen:v,dist:0}),g=t,_=r,v=e[S],x(S,1),S++;else{a.push({litOrLen:g,dist:_});let e=Math.min(S-1+g,n);for(let t=S;t<e;t++)b(t);x(S,e-S),S=e,h=!1,g=0}else if(t>=3)if(l)h=!0,g=t,_=r,v=e[S],x(S,1),S++;else{a.push({litOrLen:t,dist:r});let e=Math.min(S+t,n);for(let t=S+1;t<e;t++)b(t);x(S,e-S),S=e}else h&&(a.push({litOrLen:g,dist:_}),h=!1,g=0),a.push({litOrLen:e[S],dist:0}),x(S,1),S++}if(h){a.push({litOrLen:g,dist:_});let e=Math.min(S-1+g,n);for(let t=S;t<e;t++)b(t);x(S,e-S),h=!1,g=0}return i&&(i.windowLen=p,i.totalIn=m+(n-t),i.hasPrevMatch=h,i.prevMatchLen=g,i.prevMatchDist=_,i.prevLiteral=v),a}var Zi=class{constructor(e=6){this._output=new Hi,this._state={head:new Int32Array(Li),prev:new Int32Array(Ri),window:new Uint8Array(Ri),windowLen:0,totalIn:0,hasPrevMatch:!1,prevMatchLen:0,prevMatchDist:0,prevLiteral:0},this._level=Math.max(0,Math.min(9,e)),this._config=zi(this._level)}write(e){if(e.length===0)return new Uint8Array;let t=this._output;return this._level===0?(this._writeStore(e),t.flushBytes()):(Yi(t,Xi(e,0,e.length,this._config,this._state),!1),t.flushBytes())}finish(){let e=this._output;return e.writeBits(1,1),e.writeBits(1,2),Wi(e,256),e.finish()}_writeStore(e){let t=this._output,n=0;for(;n<e.length;){let r=e.length-n,i=Math.min(65535,r);t.alignToByte(),t.writeBits(0,1),t.writeBits(0,2),t.alignToByte(),t.writeBits(i&255,8),t.writeBits(i>>8&255,8),t.writeBits(~i&255,8),t.writeBits(~i>>8&255,8);for(let r=0;r<i;r++)t.writeBits(e[n+r],8);n+=i}}},Qi=class extends n{constructor(e,t){super(e,t),this.name=`ArchiveError`}},$i=class extends Qi{constructor(e,t,n){super(`CRC32 mismatch for "${e}": expected 0x${t.toString(16).padStart(8,`0`)}, got 0x${n.toString(16).padStart(8,`0`)}`),this.path=e,this.expected=t,this.actual=n,this.name=`Crc32MismatchError`}},ea=class extends Qi{constructor(e,t,n,r){let i=r===`too-many-bytes`?`Entry "${e}" produced more bytes than declared: expected ${t}, got at least ${n}`:`Entry "${e}" produced fewer bytes than declared: expected ${t}, got ${n}`;super(i),this.path=e,this.expected=t,this.actual=n,this.reason=r,this.name=`EntrySizeMismatchError`}isZipBomb(){return this.reason===`too-many-bytes`}isCorruption(){return this.reason===`too-few-bytes`}},ta=class extends Qi{constructor(e,t){super(t?`Failed to decrypt "${e}": ${t}`:`Failed to decrypt "${e}": incorrect password or corrupted data`),this.name=`DecryptionError`}},na=class extends Qi{constructor(e){super(`File "${e}" is encrypted. Please provide a password to extract.`),this.name=`PasswordRequiredError`}},ra=class extends Qi{constructor(e){super(`Unsupported compression method: ${e}`),this.name=`UnsupportedCompressionError`}};let ia=null;function aa(){if(ia)return ia;let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return ia=e,e}function oa(e,t){let n=aa();for(let r=0;r<t.length;r++)e=n[(e^t[r])&255]^e>>>8;return e}function sa(e){return(e^4294967295)>>>0}function ca(e){return sa(oa(4294967295,e))}function la(e,t){return(aa()[(e^t)&255]^e>>>8)>>>0}let ua=`ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xA0`;function da(e){let t=!1;for(let n=0;n<e.length;n++)if(e[n]>=128){t=!0;break}if(!t)return ya(e);let n=Array(e.length);for(let t=0;t<e.length;t++){let r=e[t];r<128?n[t]=String.fromCharCode(r):n[t]=ua[r-128]}return n.join(``)}function fa(e){if(e.length===0)return ai;let t=new Uint8Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r),a=i;if(i>=55296&&i<=56319&&r+1<e.length){let t=e.charCodeAt(r+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+(t-56320)+65536,r++)}if(a<128){t[n++]=a;continue}if(a>65535){t[n++]=63;continue}let o=pa.get(String.fromCharCode(a));t[n++]=o??63}return n===t.length?t:t.subarray(0,n)}let pa=(()=>{let e=new Map;for(let t=0;t<128;t++)e.set(ua[t],128+t);return e})(),ma={name:`utf-8`,encode:wn,decode:Tn,useUtf8Flag:!0,useUnicodeExtraFields:!1},ha={name:`cp437`,encode:fa,decode:da,useUtf8Flag:!1,useUnicodeExtraFields:!0},ga=new WeakMap;function _a(e){if(!e||e===`utf-8`)return ma;if(e===`cp437`)return ha;let t=e,n=ga.get(t);if(n)return n;let r=t.useUtf8Flag??t.name===`utf-8`,i={...t,useUtf8Flag:r,useUnicodeExtraFields:t.useUnicodeExtraFields??!r};return ga.set(t,i),i}function va(e,t){return e?t.encode(e):ai}function ya(e){let t=``,n=32768;for(let r=0;r<e.length;r+=n){let i=e.subarray(r,Math.min(r+n,e.length));t+=String.fromCharCode(...i)}return t}function ba(e,t,n,r){return e.length===0?``:(t??0)&2048?Tn(e):n&&n.version===1&&n.originalCrc32===ca(e)?n.unicodeValue:r?r.decode(e):da(e)}function xa(e,t,n,r){return ba(e,t,n?.unicodePath,r)}function Sa(e,t,n,r){return ba(e,t,n?.unicodeComment,r)}function Ca(e){return e.byteOffset===0&&e.byteLength===e.buffer.byteLength&&e.buffer.constructor===ArrayBuffer?e.buffer:e.slice().buffer}function wa(e){let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e>>>0,!0),t}function Ta(e,t){return new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(t,!0)}var Ea=class{constructor(e,t=0){this.data=e,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.offset=t}get position(){return this.offset}set position(e){this.offset=e}get remaining(){return this.data.length-this.offset}readUint8(){let e=this.view.getUint8(this.offset);return this.offset+=1,e}readUint16(){let e=this.view.getUint16(this.offset,!0);return this.offset+=2,e}readUint32(){let e=this.view.getUint32(this.offset,!0);return this.offset+=4,e}readBigUint64(){let e=this.view.getBigUint64(this.offset,!0);return this.offset+=8,e}readBytes(e){let t=this.data.subarray(this.offset,this.offset+e);return this.offset+=e,t}readString(e,t=!0){let n=this.readBytes(e);return t?Tn(n):da(n)}skip(e){this.offset+=e}slice(e,t){return this.data.subarray(e,t)}peekUint32(e){return this.view.getUint32(e,!0)}};function Da(e,t){let n={},r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=0;for(let[a,o]of t){if(e.length>=i+o)switch(o){case 1:n[a]=r.getUint8(i);break;case 2:n[a]=r.getUint16(i,!0);break;case 4:n[a]=r.getUint32(i,!0);break;case 8:{let e=r.getUint32(i,!0);n[a]=r.getUint32(i+4,!0)*4294967296+e;break}default:throw Error(`Unsupported UInt LE size!`)}else n[a]=null;i+=o}return n}function Oa(e,t){return Da(e,t)}function ka(e){return!Number.isFinite(e)||e<=0?0:e>=4294967295?4294967295:e>>>0}function Aa(e){return ka(Math.floor(e.getTime()/1e3))}function ja(e){if(typeof BigInt!=`function`)throw Error(`NTFS timestamps require BigInt support`);return BigInt(e.getTime())*10000n+116444736000000000n}function Ma(e,t){let n=t?.atime!==void 0,r=t?.ctime!==void 0,i=1;n&&(i|=2),r&&(i|=4);let a=5+(n?4:0)+(r?4:0),o=new Uint8Array(4+a),s=new DataView(o.buffer);s.setUint16(0,21589,!0),s.setUint16(2,a,!0),o[4]=i,s.setUint32(5,Aa(e),!0);let c=9;return n&&(s.setUint32(c,Aa(t.atime),!0),c+=4),r&&s.setUint32(c,Aa(t.ctime),!0),o}function Na(e,t){if(typeof BigInt!=`function`)throw Error(`NTFS timestamps require BigInt support`);let n=t?.atime??e,r=t?.ctime??e,i=t?.birthTime??e,a=new Uint8Array(44),o=new DataView(a.buffer);o.setUint16(0,10,!0),o.setUint16(2,40,!0),o.setUint32(4,0,!0),o.setUint16(8,1,!0),o.setUint16(10,32,!0);let s=12;return o.setBigUint64(s,ja(e),!0),s+=8,o.setBigUint64(s,ja(n),!0),s+=8,o.setBigUint64(s,ja(r),!0),s+=8,o.setBigUint64(s,ja(i),!0),a}function Pa(e){return[(e.getHours()&31)<<11|(e.getMinutes()&63)<<5|e.getSeconds()>>1&31,(e.getFullYear()-1980&127)<<9|(e.getMonth()+1&15)<<5|e.getDate()&31]}function Fa(e,t){let n=e&31,r=e>>5&15,i=(e>>9&127)+1980,a=t?(t&31)*2:0,o=t?t>>5&63:0,s=t?t>>11:0;return new Date(Date.UTC(i,r-1,n,s,o,a))}function Ia(e,t,n){return n===void 0?Fa(e,t):new Date(n*1e3)}function La(e,t,n){if(t===`dos`)return new Uint8Array;let r=[Ma(e,n)];return t===`dos+utc+ntfs`&&r.push(Na(e,n)),T(r)}function Ra(e){let[t,n]=Pa(e);return{dosTime:t,dosDate:n}}function za(e){return e<128?e<<1:e<<1^283}function Ba(e){let t=e.length/4,n=t+6,r=[];for(let n=0;n<t;n++)r.push(new Uint8Array([e[4*n],e[4*n+1],e[4*n+2],e[4*n+3]]));for(let e=t;e<4*(n+1);e++){let n=new Uint8Array(r[e-1]);if(e%t===0){let r=n[0];n[0]=Xa[n[1]]^Za[e/t-1],n[1]=Xa[n[2]],n[2]=Xa[n[3]],n[3]=Xa[r]}else t>6&&e%t===4&&(n[0]=Xa[n[0]],n[1]=Xa[n[1]],n[2]=Xa[n[2]],n[3]=Xa[n[3]]);let i=new Uint8Array(4);for(let a=0;a<4;a++)i[a]=r[e-t][a]^n[a];r.push(i)}return r}function Va(e,t){let n=t.length/4-1,r=new Uint8Array(16);r.set(e);for(let e=0;e<4;e++)for(let n=0;n<4;n++)r[4*e+n]^=t[e][n];for(let e=1;e<n;e++){for(let e=0;e<16;e++)r[e]=Xa[r[e]];let n;n=r[1],r[1]=r[5],r[5]=r[9],r[9]=r[13],r[13]=n,n=r[2],r[2]=r[10],r[10]=n,n=r[6],r[6]=r[14],r[14]=n,n=r[15],r[15]=r[11],r[11]=r[7],r[7]=r[3],r[3]=n;for(let e=0;e<4;e++){let t=r[4*e],n=r[4*e+1],i=r[4*e+2],a=r[4*e+3];r[4*e]=za(t)^za(n)^n^i^a,r[4*e+1]=t^za(n)^za(i)^i^a,r[4*e+2]=t^n^za(i)^za(a)^a,r[4*e+3]=za(t)^t^n^i^za(a)}let i=e*4;for(let e=0;e<4;e++)for(let n=0;n<4;n++)r[4*e+n]^=t[i+e][n]}for(let e=0;e<16;e++)r[e]=Xa[r[e]];let i;i=r[1],r[1]=r[5],r[5]=r[9],r[9]=r[13],r[13]=i,i=r[2],r[2]=r[10],r[10]=i,i=r[6],r[6]=r[14],r[14]=i,i=r[15],r[15]=r[11],r[11]=r[7],r[7]=r[3],r[3]=i;for(let e=0;e<4;e++)for(let i=0;i<4;i++)r[4*e+i]^=t[n*4+e][i];return r}function Ha(e,t,n){let r=16-e.length%16,i=new Uint8Array(e.length+r);i.set(e);for(let t=e.length;t<i.length;t++)i[t]=r;let a=Ba(t),o=i.length/16,s=new Uint8Array(i.length),c=n;for(let e=0;e<o;e++){let t=new Uint8Array(16);for(let n=0;n<16;n++)t[n]=i[e*16+n]^c[n];let n=Va(t,a);s.set(n,e*16),c=n}return s}function Ua(e,t,n){if(e.length%16!=0)throw Error(`aesCbcEncryptRaw: plaintext length must be a multiple of 16`);let r=Ba(t),i=e.length/16,a=new Uint8Array(e.length),o=n;for(let t=0;t<i;t++){let n=new Uint8Array(16);for(let r=0;r<16;r++)n[r]=e[t*16+r]^o[r];let i=Va(n,r);a.set(i,t*16),o=i}return a}function Wa(e,t){return Va(e,Ba(t))}function Ga(e,t){return(e>>>t|e<<32-t)>>>0}function Ka(e){let t=e.length,n=Math.ceil((t+9)/64)*64,r=new Uint8Array(n);r.set(e),r[t]=128;let i=t*8,a=new DataView(r.buffer,r.byteOffset,r.byteLength);a.setUint32(n-8,0,!1),a.setUint32(n-4,i,!1);let o=Qa[0],s=Qa[1],c=Qa[2],l=Qa[3],u=Qa[4],d=Qa[5],f=Qa[6],p=Qa[7],m=new Uint32Array(64);for(let e=0;e<n;e+=64){for(let t=0;t<16;t++)m[t]=a.getUint32(e+t*4,!1);for(let e=16;e<64;e++){let t=Ga(m[e-15],7)^Ga(m[e-15],18)^m[e-15]>>>3,n=Ga(m[e-2],17)^Ga(m[e-2],19)^m[e-2]>>>10;m[e]=m[e-16]+t+m[e-7]+n>>>0}let t=o,n=s,r=c,i=l,h=u,g=d,_=f,v=p;for(let e=0;e<64;e++){let a=Ga(h,6)^Ga(h,11)^Ga(h,25),o=h&g^~h&_,s=v+a+o+$a[e]+m[e]>>>0,c=(Ga(t,2)^Ga(t,13)^Ga(t,22))+(t&n^t&r^n&r)>>>0;v=_,_=g,g=h,h=i+s>>>0,i=r,r=n,n=t,t=s+c>>>0}o=o+t>>>0,s=s+n>>>0,c=c+r>>>0,l=l+i>>>0,u=u+h>>>0,d=d+g>>>0,f=f+_>>>0,p=p+v>>>0}let h=new Uint8Array(32),g=new DataView(h.buffer);return g.setUint32(0,o,!1),g.setUint32(4,s,!1),g.setUint32(8,c,!1),g.setUint32(12,l,!1),g.setUint32(16,u,!1),g.setUint32(20,d,!1),g.setUint32(24,f,!1),g.setUint32(28,p,!1),h}function qa(e){let t=new Uint8Array(e);return globalThis.crypto.getRandomValues(t),t}async function Ja(e,t){let n=await globalThis.crypto.subtle.digest(Ya(e),t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength));return new Uint8Array(n)}function Ya(e){switch(e.toLowerCase().replace(/-/g,``)){case`sha1`:return`SHA-1`;case`sha256`:return`SHA-256`;case`sha384`:return`SHA-384`;case`sha512`:return`SHA-512`;default:return e}}var Xa,Za,Qa,$a,eo=t((()=>{Xa=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]),Za=[1,2,4,8,16,32,64,128,27,54],Qa=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),$a=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),new Uint32Array([3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745])}));eo();let to={128:8,192:12,256:16},no={128:16,192:24,256:32},ro={128:1,192:2,256:3},io={1:128,2:192,3:256};function ao(){if(globalThis.crypto?.subtle!==void 0)return globalThis.crypto.subtle;throw Error(`Web Crypto API not available`)}async function oo(e,t,n){let r=ao(),i=typeof e==`string`?wn(e):e,a=no[n],o=a+32+2,s=await r.importKey(`raw`,Ca(i),`PBKDF2`,!1,[`deriveBits`]),c=await r.deriveBits({name:`PBKDF2`,salt:Ca(t),iterations:1e3,hash:`SHA-1`},s,o*8),l=new Uint8Array(c);return{encryptionKey:l.subarray(0,a),hmacKey:l.subarray(a,a+32),passwordVerify:l.subarray(a+32,a+34)}}async function so(e,t){let n=ao(),r=await n.importKey(`raw`,Ca(e),{name:`HMAC`,hash:`SHA-1`},!1,[`sign`]),i=await n.sign(`HMAC`,r,Ca(t));return new Uint8Array(i,0,10)}function co(e){let t=new Uint8Array(16);return new DataView(t.buffer).setUint32(0,e,!0),t}async function lo(e,t,n=!0){let r=ao(),i=await r.importKey(`raw`,Ca(e),{name:`AES-CTR`},!1,[`encrypt`,`decrypt`]),a=co(1),o=await r.encrypt({name:`AES-CTR`,counter:Ca(a),length:128},i,Ca(t));return new Uint8Array(o)}function uo(e,t,n){let r=new Uint8Array(11),i=new DataView(r.buffer);return i.setUint16(0,39169,!0),i.setUint16(2,7,!0),i.setUint16(4,e,!0),i.setUint16(6,17729,!0),r[8]=ro[t],i.setUint16(9,n,!0),r}function fo(e,t){let n=to[t],r=n+2+10;return e.length<r?null:{salt:e.subarray(0,n),storedVerify:e.subarray(n,n+2),ciphertext:e.subarray(n+2,e.length-10),storedHmac:e.subarray(e.length-10)}}function po(e,t){return e[0]===t[0]&&e[1]===t[1]}function mo(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}async function ho(e,t,n){let r=fo(e,n);if(!r)throw Error(`Encrypted data too short`);let{salt:i,storedVerify:a,ciphertext:o,storedHmac:s}=r,c=await oo(t,i,n);if(!po(c.passwordVerify,a))throw Error(`Password verification failed`);if(!mo(await so(c.hmacKey,o),s))throw Error(`HMAC verification failed`);return lo(c.encryptionKey,o,!1)}async function go(e,t,n){let r=to[n],i=qa(r),a=await oo(t,i,n),o=await lo(a.encryptionKey,e,!0),s=await so(a.hmacKey,o),c=new Uint8Array(r+2+o.length+10),l=0;return c.set(i,l),l+=r,c.set(a.passwordVerify,l),l+=2,c.set(o,l),l+=o.length,c.set(s,l),c}function _o(e,t,n){let r=wn(n),i=5+r.length,a=new Uint8Array(4+i),o=new DataView(a.buffer,a.byteOffset,a.byteLength);return o.setUint16(0,e,!0),o.setUint16(2,i,!0),a[4]=1,o.setUint32(5,ca(t)>>>0,!0),a.set(r,9),a}function vo(e,t){return _o(28789,e,t)}function yo(e,t){return _o(25461,e,t)}let bo=BigInt(2**53-1);function xo(e,t){return e.getBigUint64(t,!0)}function So(e){return typeof e.getBigUint64==`function`}function Co(e){if(!(e>bo))return Number(e)}function wo(e,t){let n={};if(e.length<4)return n;let r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=So(r),a=0;for(;a+4<=e.length;){let o=r.getUint16(a,!0),s=r.getUint16(a+2,!0),c=a+4,l=c+s;if(l>e.length)break;if(o===1){let e=c;if(t.uncompressedSize===4294967295&&e+8<=l){let i=xo(r,e);n.uncompressedSize64=i,t.uncompressedSize64=i;let a=Co(i);a!==void 0&&(n.uncompressedSize=a,t.uncompressedSize=a),e+=8}if(t.compressedSize===4294967295&&e+8<=l){let i=xo(r,e);n.compressedSize64=i,t.compressedSize64=i;let a=Co(i);a!==void 0&&(n.compressedSize=a,t.compressedSize=a),e+=8}if(t.offsetToLocalFileHeader===4294967295&&e+8<=l){let i=xo(r,e);n.offsetToLocalFileHeader64=i,t.offsetToLocalFileHeader64=i;let a=Co(i);a!==void 0&&(n.offsetToLocalFileHeader=a,t.offsetToLocalFileHeader=a)}}else if(o===21589){if(s>=1){let t=e[c],i=c+1;t&1&&i+4<=l&&(n.mtimeUnixSeconds=r.getUint32(i,!0)>>>0,i+=4),t&2&&i+4<=l&&(n.atimeUnixSeconds=r.getUint32(i,!0)>>>0,i+=4),t&4&&i+4<=l&&(n.ctimeUnixSeconds=r.getUint32(i,!0)>>>0)}}else if(o===10){if(i&&s>=8){let e=c+4;for(;e+4<=l;){let t=r.getUint16(e,!0),i=r.getUint16(e+2,!0),a=e+4,o=a+i;if(o>l)break;t===1&&i>=32&&a+32<=o&&(n.ntfsTimes={mtime:r.getBigUint64(a+0,!0),atime:r.getBigUint64(a+8,!0),ctime:r.getBigUint64(a+16,!0),birthTime:r.getBigUint64(a+24,!0)}),e=o}}}else if(o===39169){if(s>=7){let t=r.getUint16(c,!0),i=r.getUint16(c+2,!0),a=e[c+4],o=r.getUint16(c+5,!0);if(i===17729){let e=io[a];e&&(t===1||t===2)&&(n.aesInfo={version:t,keyStrength:e,compressionMethod:o})}}}else o===28789?s>=5&&(n.unicodePath={version:e[c],originalCrc32:r.getUint32(c+1,!0),unicodeValue:Tn(e.subarray(c+5,l))}):o===25461&&s>=5&&(n.unicodeComment={version:e[c],originalCrc32:r.getUint32(c+1,!0),unicodeValue:Tn(e.subarray(c+5,l))});a=l}return n}let To=67324752,Eo=33639248,Do=101010256,Oo=134695760,ko=101075792,Ao=117853008,jo=2048,Mo=61440,No=40960,Po=16384;function Fo(e){return e>>16&65535}function Io(e){return(e&Mo)===No}function Lo(e){return(e&Mo)===Po}let Ro=4294967295;function zo(e,t,n,r){let i=r.versionNeeded??20;return t.setUint32(n+0,To,!0),t.setUint16(n+4,i,!0),t.setUint16(n+6,r.flags,!0),t.setUint16(n+8,r.compressionMethod,!0),t.setUint16(n+10,r.dosTime,!0),t.setUint16(n+12,r.dosDate,!0),t.setUint32(n+14,r.crc32,!0),t.setUint32(n+18,r.compressedSize,!0),t.setUint32(n+22,r.uncompressedSize,!0),t.setUint16(n+26,r.fileName.length,!0),t.setUint16(n+28,r.extraField.length,!0),e.set(r.fileName,n+30),r.extraField.length>0&&e.set(r.extraField,n+30+r.fileName.length),30+r.fileName.length+r.extraField.length}function Bo(e){let t=new Uint8Array(30+e.fileName.length+e.extraField.length);return zo(t,new DataView(t.buffer,t.byteOffset,t.byteLength),0,e),t}function Vo(e,t,n,r){let i=r.versionMadeBy??20,a=r.versionNeeded??20,o=r.externalAttributes??0;return t.setUint32(n+0,Eo,!0),t.setUint16(n+4,i,!0),t.setUint16(n+6,a,!0),t.setUint16(n+8,r.flags,!0),t.setUint16(n+10,r.compressionMethod,!0),t.setUint16(n+12,r.dosTime,!0),t.setUint16(n+14,r.dosDate,!0),t.setUint32(n+16,r.crc32,!0),t.setUint32(n+20,r.compressedSize,!0),t.setUint32(n+24,r.uncompressedSize,!0),t.setUint16(n+28,r.fileName.length,!0),t.setUint16(n+30,r.extraField.length,!0),t.setUint16(n+32,r.comment.length,!0),t.setUint16(n+34,0,!0),t.setUint16(n+36,0,!0),t.setUint32(n+38,o,!0),t.setUint32(n+42,r.localHeaderOffset,!0),e.set(r.fileName,n+46),r.extraField.length>0&&e.set(r.extraField,n+46+r.fileName.length),r.comment.length>0&&e.set(r.comment,n+46+r.fileName.length+r.extraField.length),46+r.fileName.length+r.extraField.length+r.comment.length}function Ho(e,t,n,r){return t.setUint32(n+0,Do,!0),t.setUint16(n+4,0,!0),t.setUint16(n+6,0,!0),t.setUint16(n+8,r.entryCount,!0),t.setUint16(n+10,r.entryCount,!0),t.setUint32(n+12,r.centralDirSize,!0),t.setUint32(n+16,r.centralDirOffset,!0),t.setUint16(n+20,r.comment.length,!0),r.comment.length>0&&e.set(r.comment,n+22),22+r.comment.length}function Uo(e,t,n){let r=new Uint8Array(16),i=new DataView(r.buffer);return i.setUint32(0,Oo,!0),i.setUint32(4,e,!0),i.setUint32(8,t,!0),i.setUint32(12,n,!0),r}function Wo(e,t,n){let r=n>>>0,i=Math.floor(n/4294967296)>>>0;e.setUint32(t,r,!0),e.setUint32(t+4,i,!0)}function Go(e,t,n){let r=new Uint8Array(24),i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setUint32(0,Oo,!0),i.setUint32(4,e,!0),Wo(i,8,t),Wo(i,16,n),r}function Ko(e){let t=e.uncompressedSize!==void 0,n=e.compressedSize!==void 0,r=e.localHeaderOffset!==void 0,i=e.diskNumberStart!==void 0,a=0;if(t&&(a+=8),n&&(a+=8),r&&(a+=8),i&&(a+=4),a===0)return ai;let o=new Uint8Array(4+a),s=new DataView(o.buffer,o.byteOffset,o.byteLength);s.setUint16(0,1,!0),s.setUint16(2,a,!0);let c=4;return t&&(Wo(s,c,e.uncompressedSize),c+=8),n&&(Wo(s,c,e.compressedSize),c+=8),r&&(Wo(s,c,e.localHeaderOffset),c+=8),i&&s.setUint32(c,e.diskNumberStart,!0),o}function qo(e,t){return T([e,t])}function Jo(e,t,n,r){let i=r.versionMadeBy??20,a=r.versionNeeded??45,o=r.diskNumber??0,s=r.centralDirectoryDiskNumber??0;return t.setUint32(n+0,ko,!0),Wo(t,n+4,44),t.setUint16(n+12,i,!0),t.setUint16(n+14,a,!0),t.setUint32(n+16,o,!0),t.setUint32(n+20,s,!0),Wo(t,n+24,r.entryCountOnDisk),Wo(t,n+32,r.entryCountTotal),Wo(t,n+40,r.centralDirSize),Wo(t,n+48,r.centralDirOffset),56}function Yo(e,t,n,r){let i=r.zip64EndOfCentralDirectoryDiskNumber??0,a=r.totalDisks??1;return t.setUint32(n+0,Ao,!0),t.setUint32(n+4,i,!0),Wo(t,n+8,r.zip64EndOfCentralDirectoryOffset),t.setUint32(n+16,a,!0),20}let Xo=[[`version`,4],[`pubKeyLength`,4],[`signatureLength`,4]],Zo=[[`versionsNeededToExtract`,2],[`flags`,2],[`compressionMethod`,2],[`lastModifiedTime`,2],[`lastModifiedDate`,2],[`crc32`,4],[`compressedSize`,4],[`uncompressedSize`,4],[`fileNameLength`,2],[`extraFieldLength`,2]],Qo=[[`dataDescriptorSignature`,4],[`crc32`,4],[`compressedSize`,4],[`uncompressedSize`,4]],$o=[[`versionMadeBy`,2],[`versionsNeededToExtract`,2],[`flags`,2],[`compressionMethod`,2],[`lastModifiedTime`,2],[`lastModifiedDate`,2],[`crc32`,4],[`compressedSize`,4],[`uncompressedSize`,4],[`fileNameLength`,2],[`extraFieldLength`,2],[`fileCommentLength`,2],[`diskNumber`,2],[`internalFileAttributes`,2],[`externalFileAttributes`,4],[`offsetToLocalFileHeader`,4]],es=[[`diskNumber`,2],[`diskStart`,2],[`numberOfRecordsOnDisk`,2],[`numberOfRecords`,2],[`sizeOfCentralDirectory`,4],[`offsetToStartOfCentralDirectory`,4],[`commentLength`,2]],ts=wa(Oo);function ns(e){return((e||0)&jo)!==0}function rs(e){if(e.length===0)return!1;let t=e.charCodeAt(e.length-1);return t===47||t===92}function is(e,t){return t===0&&rs(e)?`Directory`:`File`}function as(e,t,n){return{path:e,pathBuffer:t,flags:{isUnicode:ns(n)}}}function os(e,t){let n=e.lastModifiedDate||0,r=e.lastModifiedTime||0,i=Fa(n,r),a=t.mtimeUnixSeconds;return a===void 0?i:Ia(n,r,a)}let ss=wo;function cs(e){return((e||0)&8)!=0}function ls(e,t){return!cs(e)||(t||0)>0}async function us(e){let t=await e(12),n=t.length>=12?vs(t):Oa(t,Xo),r=n.pubKeyLength||0,i=await e(r+(n.signatureLength||0));return n.publicKey=i.subarray(0,r),n.signature=i.subarray(r),n}async function ds(e){let t=await e(26),n=t.length>=26?ys(t):Oa(t,Zo);return{vars:n,fileNameBuffer:await e(n.fileNameLength||0),extraFieldData:await e(n.extraFieldLength||0)}}async function fs(e){let t=await e(16);return t.length>=16?bs(t):Oa(t,Qo)}async function ps(e){let t=Oa(await e(42),$o);await e(t.fileNameLength||0),await e(t.extraFieldLength||0),await e(t.fileCommentLength||0)}async function ms(e){await e(Oa(await e(18),es).commentLength||0)}function hs(e){switch(e){case To:case Eo:case Do:case ko:case Ao:return!0;default:return!1}}function gs(e,t){return(e[t]|0|(e[t+1]|0)<<8|(e[t+2]|0)<<16|(e[t+3]|0)<<24)>>>0}function _s(e,t){return(e[t]|(e[t+1]|0)<<8)>>>0}function vs(e){return{version:gs(e,0),pubKeyLength:gs(e,4),signatureLength:gs(e,8)}}function ys(e){return{versionsNeededToExtract:_s(e,0),flags:_s(e,2),compressionMethod:_s(e,4),lastModifiedTime:_s(e,6),lastModifiedDate:_s(e,8),crc32:gs(e,10),compressedSize:gs(e,14),uncompressedSize:gs(e,18),fileNameLength:_s(e,22),extraFieldLength:_s(e,24)}}function bs(e){return{dataDescriptorSignature:gs(e,0),crc32:gs(e,4),compressedSize:gs(e,8),uncompressedSize:gs(e,12)}}let xs=wa(Do);async function Ss(e,t,n,r,i){for(;;){let a=await t.pull(4);if(a.length===0){n.emitClose();return}let o=Ta(a,0);if(o===875721283){r.crxHeader=await us(async e=>t.pull(e)),n.emitCrxHeader(r.crxHeader);continue}if(o===67324752){await i(e,t,n,r);continue}if(o===33639248){r.reachedCD=!0,await ps(async e=>t.pull(e));continue}if(o===101010256){await ms(async e=>t.pull(e)),t.setDone(),n.emitClose();return}if(r.reachedCD){await t.pullUntil(xs,!0),await ms(async e=>t.pull(e)),t.setDone(),n.emitClose();return}n.emitError(Error(`invalid signature: 0x`+o.toString(16))),n.emitClose();return}}var Cs=class{constructor(e){this.searchFrom=0,this.pattern=e,this.overlap=Math.max(0,e.length-1)}find(e){return e.indexOfPattern(this.pattern,this.searchFrom)}onConsume(e){e>0&&(this.searchFrom=Math.max(0,this.searchFrom-e))}onNoMatch(e){this.searchFrom=Math.max(this.searchFrom,Math.max(0,e-this.overlap))}};function ws(e){return e instanceof Error?e.code===`ERR_STREAM_PREMATURE_CLOSE`||e.message===`Premature close`:!1}async function Ts(e){try{await br(e,{readable:!1})}catch(e){if(!ws(e))throw e}}let Es=256*1024;function Ds(e){let t=e.pipe(new cr({transform(e,t,n){n()}}));return t.promise=()=>new Promise((e,n)=>{t.on(`finish`,e),t.on(`error`,n)}),t}function Os(e){return new Promise((t,n)=>{let r=[],i=new cr({transform(e,t,n){r.push(e),n()}});i.on(`finish`,()=>{t(r.length===1?r[0]:T(r))}),i.on(`error`,n),e.on(`error`,n).pipe(i)})}function ks(e){let{source:t,dataDescriptorSignature:n}=e,r=e.keepTailBytes??20,i=e.errorMessage??`FILE_ENDED: Data descriptor not found`,a=new lr({highWaterMark:Es}),o=!1,s=!1,c=0,l=new Cs(n),u,d=()=>{u&&=(u(),void 0)},f=()=>{s=!1,p()},p=()=>{if(o||s)return;let e=t.getLength();for(e===0&&t.maybeReleaseWriteCallback?.();e>0;){let n=!1;for(;;){let r=l.find(t);if(r===-1)break;let i=r+16;if(i+4<=e){let e=t.peekUint32LE(i),n=t.peekUint32LE(r+8),u=c+r>>>0;if(e!==null&&n!==null&&hs(e)&&n===u){if(r>0)if(t.peekChunks&&t.discard){let e=t.peekChunks(r),n=0;for(let t of e){let e=a.write(t);if(n+=t.length,!e){s=!0,a.once(`drain`,f);break}}if(n>0&&(t.discard(n),c+=n,l.onConsume(n)),s)return}else{let e=a.write(t.read(r));if(c+=r,l.onConsume(r),!e){s=!0,a.once(`drain`,f);return}}o=!0,t.maybeReleaseWriteCallback?.(),d(),a.end();return}l.searchFrom=r+1;continue}if(l.searchFrom=r,n=!0,t.isFinished()&&r+16<=e){let e=t.peekUint32LE(r+8),n=c+r>>>0;if(e!==null&&e===n){if(r>0)if(t.peekChunks&&t.discard){let e=t.peekChunks(r),n=0;for(let t of e)a.write(t),n+=t.length;n>0&&(t.discard(n),c+=n,l.onConsume(n))}else a.write(t.read(r)),c+=r,l.onConsume(r);o=!0,t.maybeReleaseWriteCallback?.(),d(),a.end();return}}break}n||l.onNoMatch(e);let i=e-r;n&&(i=Math.min(i,l.searchFrom));let u=Math.max(0,i);if(u>0){if(t.peekChunks&&t.discard){let n=t.peekChunks(u),i=0;for(let e of n){let t=a.write(e);if(i+=e.length,!t){s=!0,a.once(`drain`,f);break}}i>0&&(t.discard(i),c+=i,e-=i,l.onConsume(i)),e<=r&&t.maybeReleaseWriteCallback?.();return}let n=a.write(t.read(u));c+=u,e-=u,l.onConsume(u),e<=r&&t.maybeReleaseWriteCallback?.(),n||(s=!0,a.once(`drain`,f));return}t.maybeReleaseWriteCallback?.();break}!o&&t.isFinished()&&(o=!0,d(),a.destroy(Error(i)))};return u=t.onDataAvailable(p),queueMicrotask(p),a}async function As(e,t,n,r,i,a){let o=e.thresholdBytes??5242880;await Ss(e,t,n,i,async(s,c,l,u)=>{await Ms(e,t,n,r,i,o,a)})}async function js(e,t,n,r){let i=r,a=null,s=e=>{a=e};t.once(`error`,s),n.once(`error`,s);let c=!1,l=t,u=null,d=()=>{try{l?.removeListener?.(`drain`,p)}catch{}try{n.removeListener(`__autodrain`,m)}catch{}try{n.removeListener(`close`,h)}catch{}},f=()=>{let e=u;e&&(u=null,d(),e())},p=()=>{f()},m=()=>{f()},h=()=>{f()},g=async()=>{await new Promise(e=>{u=e,typeof l?.once==`function`&&l.once(`drain`,p),n.once(`__autodrain`,m),n.once(`close`,h),(n.__autodraining||n.destroyed)&&f()})},_=async()=>{if(!c){c=!0;try{let e=t;typeof e.unpipe==`function`&&e.unpipe(n)}catch{}try{!n.writableEnded&&!n.destroyed&&n.end()}catch{}try{let e=t;typeof e.destroy==`function`&&e.destroy()}catch{}}};try{for(t.pipe(n);i>0;){if(a)throw o(a);!c&&(n.__autodraining||n.destroyed)&&await _();let r=Math.min(262144,i),s=await e.pull(r);if(s.length!==r)throw Error(`FILE_ENDED`);i-=s.length,c||t.write(s)||await g()}c||t.end(),await Ts(n)}finally{t.removeListener(`error`,s),n.removeListener(`error`,s)}}async function Ms(e,t,n,r,i,a,o){let{vars:s,fileNameBuffer:c,extraFieldData:l}=await ds(async e=>t.pull(e)),u=s;i.crxHeader&&(u.crxHeader=i.crxHeader);let d={uncompressedSize:u.uncompressedSize??0,compressedSize:u.compressedSize??0},f=ss(l,d);u.uncompressedSize=d.uncompressedSize,u.compressedSize=d.compressedSize;let p=e.encoding?_a(e.encoding):void 0,m=xa(c,u.flags,f,p),h=new lr({highWaterMark:Es}),g=!1;h.autodrain=function(){return g=!0,h.__autodraining=!0,h.emit(`__autodrain`),Ds(h)},h.buffer=function(){return Os(h)},h.path=m,h.props=as(m,c,u.flags),h.type=is(m,u.uncompressedSize??0),e.verbose&&(h.type===`Directory`?console.log(` creating:`,m):h.type===`File`&&(u.compressionMethod===0?console.log(` extracting:`,m):console.log(` inflating:`,m))),u.lastModifiedDateTime=os({flags:u.flags,uncompressedSize:u.uncompressedSize??0,lastModifiedDate:u.lastModifiedDate,lastModifiedTime:u.lastModifiedTime},f),h.vars=u,h.extraFields=f,h.__autodraining=g;let _=ls(u.flags,u.compressedSize);_&&(h.size=u.uncompressedSize??0),e.forceStream?n.pushEntry(h):(n.emitEntry(h),n.pushEntryIfPiped(h)),e.verbose&&console.log({filename:m,vars:u,extraFields:h.extraFields});let v=((u.flags??0)&1)!=0||u.compressionMethod===99,y=u.compressionMethod!==0&&!v&&!g,b=!cs(u.flags),x=u.compressedSize??0,S=u.uncompressedSize??0;if(b&&_&&o&&y&&x<=a&&S<=a){let e=o(await t.pull(x));h.end(e),await Ts(h);return}let ee=y?r():new lr({highWaterMark:Es});if(_){if(await js(t,ee,h,u.compressedSize??0),cs(u.flags)){let e=await fs(async e=>t.pull(e));h.size||=e.uncompressedSize??0}return}try{await yr(t.streamUntilDataDescriptor(),ee,h)}catch(e){if(!ws(e))throw e;try{h.size=(await fs(async e=>t.pull(e))).uncompressedSize??0}catch{}return}h.size=(await fs(async e=>t.pull(e))).uncompressedSize??0}var Ns=class extends sr{constructor(){super({writableHighWaterMark:512*1024,readableHighWaterMark:512*1024,write:(e,t,n)=>{this._doWrite(e,n)},final:e=>{this._closeWriter(()=>{e()})}}),this.reading=!1,this.writeClosed=!1,this._junkError=!1,this._bytesIn=0,this._bytesOut=0,this._readingDone=!1,this._pendingWrites=0,this._writeFinishedPromise=null,this._resolveWriteFinished=null,this.decompressionStream=new DecompressionStream(`deflate-raw`),this.writer=this.decompressionStream.writable.getWriter(),this.reader=this.decompressionStream.readable.getReader(),this._readingDonePromise=new Promise(e=>{this._resolveReadingDone=e}),this._startReading()}_doWrite(e,t){if(this._junkError){t&&t();return}this._bytesIn+=e.length,this._pendingWrites++,this.writer.write(e).then(()=>{this._pendingWrites--,this._pendingWrites===0&&this._resolveWriteFinished&&this._resolveWriteFinished(),t&&t()}).catch(e=>{this._pendingWrites--,this._pendingWrites===0&&this._resolveWriteFinished&&this._resolveWriteFinished();let n=e instanceof Error?e.message:String(e);n.includes(`Junk`)||n.includes(`junk`)?(this._junkError=!0,t&&t()):t?t(e):this.emit(`error`,e)})}async _startReading(){if(!this.reading){this.reading=!0;try{for(;;){let{done:e,value:t}=await this.reader.read();if(e)break;this._bytesOut+=t.length,this.push(t)}}catch(e){let t=e instanceof Error?e.message:String(e);t.includes(`Junk`)||t.includes(`junk`)?this._junkError=!0:this.emit(`error`,e)}finally{this._readingDone=!0,this._resolveReadingDone(),this.push(null)}}}_closeWriter(e){if(this.writeClosed){this._readingDonePromise.then(()=>{e&&e()});return}this.writeClosed=!0,(this._pendingWrites>0?new Promise(e=>{this._writeFinishedPromise=new Promise(e=>{this._resolveWriteFinished=e}),this._writeFinishedPromise.then(e)}):Promise.resolve()).then(()=>this.writer.close()).catch(()=>{}).finally(()=>{this._readingDonePromise.then(()=>{e&&e()})})}destroy(e){return this.writeClosed||this.writer.abort(e??void 0).catch(()=>{}),this.reader.cancel(e??void 0).catch(()=>{}),super.destroy(e??void 0)}};let Ps=null;function Fs(e){if(typeof e==`string`&&e.length>0)return e;if(Ps)return Ps;let t=new Blob([`
|
|
41
41
|
let ds;
|
|
42
42
|
let writer;
|
|
43
43
|
let reader;
|
|
@@ -109,11 +109,11 @@ onmessage = async (ev) => {
|
|
|
109
109
|
postMessage({ t: 'error', message: m, id: msg && msg.id });
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
|
-
`],{type:`text/javascript`});return Os=URL.createObjectURL(t),Os}var As=class extends ir{constructor(e){super({write:(e,t,n)=>{this._doWrite(e,n)},final:e=>{this._doClose(e)}}),this._nextId=1,this._pendingAcks=new Map,this._workerClosed=!1,this._junkError=!1,this._terminated=!1;let t=ks(e);this.worker=new Worker(t),this.worker.onmessage=e=>{let t=e.data;if(!(!t||typeof t.t!=`string`)){if(t.t===`data`){let e=t.chunk;this.push(e);return}if(t.t===`end`){this.push(null),this._terminateWorker();return}if(t.t===`aborted`){this._terminateWorker();return}if(t.t===`ack`){let e=t.id,n=this._pendingAcks.get(e);n&&(this._pendingAcks.delete(e),n());return}if(t.t===`error`){let e=typeof t.message==`string`?t.message:`Worker inflate error`;if(e.includes(`Junk`)||e.includes(`junk`)){this._junkError=!0,this.push(null),this._terminateWorker(),this._settlePendingAcks();return}let n=Error(e);this._settlePendingAcks(n),this.emit(`error`,n),this._terminateWorker();return}}},this.worker.onerror=e=>{let t=Error(e.message??`Worker error`);this._settlePendingAcks(t),this.emit(`error`,t),this._terminateWorker()}}_settlePendingAcks(e){if(this._pendingAcks.size!==0){for(let t of this._pendingAcks.values())t(e);this._pendingAcks.clear()}}_terminateWorker(){if(!this._terminated){this._terminated=!0;try{this.worker.terminate()}catch{}}}_doWrite(e,t){if(this._workerClosed||this._junkError){t();return}let n=this._nextId++;this._pendingAcks.set(n,t);let r=e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e:e.slice();this.worker.postMessage({t:`write`,id:n,chunk:r},[r.buffer])}_doClose(e){if(this._workerClosed){e();return}this._workerClosed=!0,this.worker.postMessage({t:`close`}),e()}destroy(e){if(!this._workerClosed){this._workerClosed=!0;try{this.worker.postMessage({t:`abort`})}catch{}}return this._terminateWorker(),super.destroy(e??void 0)}},js=class extends ir{constructor(){super({write:(e,t,n)=>{if(this._finished){n(Error(`write after end`));return}this.chunks.push(e),n()},final:e=>{this._decompress(e)}}),this.chunks=[],this._finished=!1}_decompress(e){try{let t=ki(E(this.chunks));this.push(t),this.push(null),this._finished=!0,e()}catch(t){e(o(t))}}destroy(e){return this._finished=!0,this.chunks=[],super.destroy(e??void 0)}};function Ms(){return si()?new Ds:new js}let Ns=Yo;function Ps(e){return class extends ir{constructor(t={}){super({objectMode:!0,write:(e,t,n)=>{this._handleWrite(e,n)},final:e=>{this.finished=!0,this._maybeReleaseWriteCallback(),this._wakeUp(),this.emit(`data-available`),this.emit(`chunk`,!1),this._parsingDone.then(()=>e()).catch(e)}}),this._buffer=new ti,this.finished=!1,this._driverState={},this._parsingDone=Promise.resolve(),this._parserDoneFlag=!1,this._parserError=null,this._parserDeferred=null,this._parserDonePromise=null,this._entryQueue=[],this._entryWaiter=null,this._entriesDone=!1,this._opts=t,this.on(`error`,e=>{this._rejectParserDeferred(e),this._closeEntryQueue(e)});let n=Math.max(64*1024,t.inputHighWaterMarkBytes??2*1024*1024),r=Math.max(32*1024,t.inputLowWaterMarkBytes??Math.floor(n/4));this._inputHighWaterMarkBytes=n,this._inputLowWaterMarkBytes=Math.min(r,n);let i={pull:e=>this.pull(e),pullUntil:(e,t)=>this.pullUntil(e,t),stream:e=>this.stream(e),streamUntilDataDescriptor:()=>this._streamUntilDataDescriptor(),setDone:()=>{this.push(null)}},a={emitEntry:e=>{this.emit(`entry`,e)},pushEntry:e=>{this.push(e),this._enqueueEntry(e)},pushEntryIfPiped:e=>{this._enqueueEntry(e)},emitCrxHeader:e=>{this.crxHeader=e,this.emit(`crx-header`,e)},emitError:e=>{this.__emittedError=e,this.emit(`error`,e)},emitClose:()=>{this.emit(`close`)}};queueMicrotask(()=>{let t=()=>{if(this._opts.useWorkerInflate&&typeof Worker<`u`&&si())try{return new As(this._opts.workerInflateUrl)}catch{return e()}return e()};this._parsingDone=ws(this._opts,i,a,t,this._driverState),this._parsingDone.then(()=>{this.__emittedError?(this._rejectParserDeferred(this.__emittedError),this._closeEntryQueue(this.__emittedError)):(this._resolveParserDeferred(),this._closeEntryQueue())},e=>{(!this.__emittedError||this.__emittedError!==e)&&(this.__emittedError=e,this.emit(`error`,e)),this._rejectParserDeferred(e),this._closeEntryQueue(e),this.emit(`close`)})})}_handleWrite(e,t){this._buffer.append(e),this._buffer.length>=this._inputHighWaterMarkBytes?this._writeCb=t:t(),this._wakeUp(),this.emit(`data-available`),this.emit(`chunk`)}get buffer(){return this._buffer.view()}set buffer(e){this._buffer.reset(e)}_wakeUp(){if(this._pendingResolve){let e=this._pendingResolve;this._pendingResolve=void 0,this._pendingDataPromise=void 0,e()}}_maybeReleaseWriteCallback(){if(!this._writeCb||this._buffer.length>this._inputLowWaterMarkBytes)return;let e=this._writeCb;this._writeCb=void 0,e()}_waitForData(){return this._pendingDataPromise||=new Promise(e=>{this._pendingResolve=e}),this._pendingDataPromise}async _pullInternal(e){if(e===0)return P;let t=e,n=null,r=null,i=e=>{if(e.length!==0){if(!n){n=e;return}if(!r){r=[n,e];return}r.push(e)}};for(;t>0;){for(;this._buffer.length===0;){if(this.finished)throw Error(`FILE_ENDED`);await this._waitForData()}let e=Math.min(t,this._buffer.length);i(this._buffer.read(e)),t-=e,this._buffer.length===0&&this._maybeReleaseWriteCallback()}return this._maybeReleaseWriteCallback(),n?r?E(r):n:P}async _pullUntilInternal(e,t=!1){let n=null,r=null,i=new _s(e),a=e.length,o=e=>{if(e.length!==0){if(!n){n=e;return}if(!r){r=[n,e];return}r.push(e)}};for(;;){let e=this._buffer.length,s=i.find(this._buffer);if(s!==-1){this.match=s;let e=s+(t?a:0);return e>0&&(o(this._buffer.read(e)),this._maybeReleaseWriteCallback()),n?r?E(r):n:P}if(i.onNoMatch(e),this.finished)throw Error(`FILE_ENDED`);let c=this._buffer.length-a;c>0&&(o(this._buffer.read(c)),i.onConsume(c),this._maybeReleaseWriteCallback()),await this._waitForData()}}_streamFixedLength(e){let t=new or({highWaterMark:bs}),n=e,r=!1,i=!1,a=()=>{i=!1,o()},o=()=>{if(!r&&!i){for(;n>0&&this._buffer.length>0;){let e=Math.min(n,this._buffer.length),r=this._buffer.read(e);n-=e;let o=t.write(r);if(this._maybeReleaseWriteCallback(),!o){i=!0,t.once(`drain`,a);return}}n===0?(r=!0,this.removeListener(`data-available`,o),t.end()):this.finished&&(r=!0,this.removeListener(`data-available`,o),t.destroy(Error(`FILE_ENDED`)))}};return this.on(`data-available`,o),queueMicrotask(()=>o()),t}_streamUntilPattern(e,t=!1){let n=new or({highWaterMark:bs}),r=!1,i=e.length,a=new _s(e),o=!1,s=()=>{o=!1,c()},c=()=>{if(!(r||o))for(;!(this._buffer.length<=0);){let e=this._buffer.length,l=a.find(this._buffer);if(l!==-1){this.match=l;let e=t?l+i:l;if(e>0){let t=n.write(this._buffer.read(e));if(a.onConsume(e),this._maybeReleaseWriteCallback(),!t){o=!0,n.once(`drain`,s);return}}r=!0,this.removeListener(`data-available`,c),n.end();return}if(a.onNoMatch(e),this.finished){r=!0,this.removeListener(`data-available`,c),n.destroy(Error(`FILE_ENDED`));return}let u=e-i;if(u<=0){this._buffer.length<=i&&this._maybeReleaseWriteCallback();break}let d=n.write(this._buffer.read(u));if(a.onConsume(u),this._maybeReleaseWriteCallback(),!d){o=!0,n.once(`drain`,s);return}}};return this.on(`data-available`,c),queueMicrotask(()=>c()),n}stream(e,t){return typeof e==`number`?this._streamFixedLength(e):this._streamUntilPattern(e,t??!1)}pull(e,t){if(e===0)return Promise.resolve(P);if(typeof e==`number`){if(this.finished&&this._buffer.length<e)return Promise.reject(Error(`FILE_ENDED`));if(this._buffer.length>=e){let t=this._buffer.read(e);return this._maybeReleaseWriteCallback(),Promise.resolve(t)}return this._pullInternal(e)}return this.finished?Promise.reject(Error(`FILE_ENDED`)):this._pullUntilInternal(e,t??!1)}pullUntil(e,t){return this.pull(e,t)}_streamUntilDataDescriptor(){return Cs({source:{getLength:()=>this._buffer.length,read:e=>this._buffer.read(e),peekChunks:e=>this._buffer.peekChunks(e),discard:e=>this._buffer.discard(e),indexOfPattern:(e,t)=>this._buffer.indexOfPattern(e,t),peekUint32LE:e=>this._buffer.peekUint32LE(e),isFinished:()=>this.finished,onDataAvailable:e=>(this.on(`data-available`,e),()=>this.removeListener(`data-available`,e)),maybeReleaseWriteCallback:()=>this._maybeReleaseWriteCallback()},dataDescriptorSignature:Ns})}promise(){return this._parserDoneFlag?this._parserError?Promise.reject(this._parserError):Promise.resolve():(this._parserDonePromise||=new Promise((e,t)=>{this._parserDeferred={resolve:e,reject:t}}),this._parserDonePromise)}_resolveParserDeferred(){if(!this._parserDoneFlag&&(this._parserDoneFlag=!0,this._parserDeferred)){let{resolve:e}=this._parserDeferred;this._parserDeferred=null,e()}}_rejectParserDeferred(e){if(!this._parserDoneFlag&&(this._parserDoneFlag=!0,this._parserError=e,this._parserDeferred)){let{reject:t}=this._parserDeferred;this._parserDeferred=null,t(e)}}_enqueueEntry(e){if(this._entryWaiter){let{resolve:t}=this._entryWaiter;this._entryWaiter=null,t({value:e,done:!1})}else this._entryQueue.push(e)}_closeEntryQueue(e){if(this._entriesDone=!0,this._entryWaiter){let t=this._entryWaiter;this._entryWaiter=null,e?t.reject(e):t.resolve({value:void 0,done:!0})}}[Symbol.asyncIterator](){let e={next:()=>this._entryQueue.length>0?Promise.resolve({value:this._entryQueue.shift(),done:!1}):this._entriesDone?this._parserError?Promise.reject(this._parserError):Promise.resolve({value:void 0,done:!0}):new Promise((e,t)=>{this._entryWaiter={resolve:e,reject:t}}),return:()=>(this._entriesDone=!0,this._entryQueue.length=0,this._entryWaiter=null,Promise.resolve({value:void 0,done:!0})),[Symbol.asyncIterator](){return e}};return e}}}let Fs=Ps(Ms);var Is=class extends Fs{};function Ls(e){return new Is(e)}let Rs=function(e){return e[e.Null=0]=`Null`,e[e.Merge=1]=`Merge`,e[e.Number=2]=`Number`,e[e.String=3]=`String`,e[e.Date=4]=`Date`,e[e.Hyperlink=5]=`Hyperlink`,e[e.Formula=6]=`Formula`,e[e.SharedString=7]=`SharedString`,e[e.RichText=8]=`RichText`,e[e.Boolean=9]=`Boolean`,e[e.Error=10]=`Error`,e[e.JSON=11]=`JSON`,e[e.Checkbox=12]=`Checkbox`,e}({}),zs=function(e){return e[e.None=0]=`None`,e[e.Master=1]=`Master`,e[e.Shared=2]=`Shared`,e}({}),Bs=function(e){return e[e.None=0]=`None`,e[e.OfficeDocument=1]=`OfficeDocument`,e[e.Worksheet=2]=`Worksheet`,e[e.CalcChain=3]=`CalcChain`,e[e.SharedStrings=4]=`SharedStrings`,e[e.Styles=5]=`Styles`,e[e.Theme=6]=`Theme`,e[e.Hyperlink=7]=`Hyperlink`,e}({}),Vs=function(e){return e[e.Xlsx=1]=`Xlsx`,e}({}),Hs=function(e){return e[e.LeftToRight=1]=`LeftToRight`,e[e.RightToLeft=2]=`RightToLeft`,e}({}),Us={NotApplicable:`#N/A`,Ref:`#REF!`,Name:`#NAME?`,DivZero:`#DIV/0!`,Null:`#NULL!`,Value:`#VALUE!`,Num:`#NUM!`},Ws={ValueType:Rs,FormulaType:zs,RelationshipType:Bs,DocumentType:Vs,ReadingOrder:Hs,ErrorValue:Us},F={OfficeDocument:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument`,Worksheet:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet`,CalcChain:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain`,SharedStrings:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings`,Styles:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles`,Theme:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme`,Hyperlink:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink`,Image:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,CoreProperties:`http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties`,ExtenderProperties:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties`,Comments:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments`,VmlDrawing:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing`,Table:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/table`,PivotCacheDefinition:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition`,PivotCacheRecords:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheRecords`,PivotTable:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable`,FeaturePropertyBag:`http://schemas.microsoft.com/office/2022/11/relationships/FeaturePropertyBag`,CtrlProp:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/ctrlProp`,SheetMetadata:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata`,ExternalLink:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink`,ExternalLinkPath:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath`};var Gs=class extends n{constructor(...e){super(...e),this.name=`XmlError`}},Ks=class extends Gs{constructor(e,t,n){let r=[];t?.fileName&&r.push(t.fileName),t?.line!==void 0&&r.push(`${t.line}:${t.column??0}`);let i=r.length>0?`${r.join(`:`)}: `:``;super(`${i}${e}`,n),this.name=`XmlParseError`,this.line=t?.line,this.column=t?.column,this.fileName=t?.fileName}},qs=class extends Gs{constructor(e,t,n){super(`Cannot ${e}: ${t}`,n),this.name=`XmlWriteError`,this.operation=e,this.state=t}};let Js=65533,Ys=(()=>{let e=Array(128);for(let t=0;t<128;t++)e[t]=String.fromCharCode(t);return e})();function I(e){return e<128?Ys[e]:String.fromCodePoint(e)}let Xs=(()=>{let e=new Uint8Array(128);for(let t=97;t<=122;t++)e[t]=1;for(let t=65;t<=90;t++)e[t]=1;return e[95]=1,e[58]=1,e})(),Zs=(()=>{let e=new Uint8Array(128);for(let t=97;t<=122;t++)e[t]=1;for(let t=65;t<=90;t++)e[t]=1;for(let t=48;t<=57;t++)e[t]=1;return e[95]=1,e[58]=1,e[45]=1,e[46]=1,e})();function Qs(e){return e===32||e===10||e===13||e===9}function $s(e){return e===34||e===39}function ec(e){return e<128?Xs[e]===1:e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e===8204||e===8205||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function tc(e){return e<128?Zs[e]===1:e===183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=768&&e<=879||e>=880&&e<=893||e>=895&&e<=8191||e===8204||e===8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function nc(e){return e>=32&&e<=55295||e===10||e===13||e===9||e>=57344&&e<=65533||e>=65536&&e<=1114111}let rc={amp:`&`,gt:`>`,lt:`<`,quot:`"`,apos:`'`};var ic=class{constructor(e){this._entityExpansionCount=0,this._nsStack=[],this.state=0,this.chunk=``,this.i=0,this.prevI=0,this.text=``,this.name=``,this.q=null,this.tags=[],this.tag=null,this.attribList=[],this.entity=``,this.entityReturnState=0,this.openWakaBang=``,this.sawRoot=!1,this.closedRoot=!1,this._bomStripped=!1,this._closed=!1,this.reportedTextBeforeRoot=!1,this.reportedTextAfterRoot=!1,this.line=1,this.column=0,this.positionAtNewLine=0,this.chunkPosition=0,this.ENTITIES={...rc},this._handlers={},this.trackPosition=e?.position!==!1,this.fileName=e?.fileName,this.fragment=e?.fragment??!1,this.xmlns=e?.xmlns??!1,this.maxDepth=e?.maxDepth===void 0?256:e.maxDepth,this.maxEntityExpansions=e?.maxEntityExpansions===void 0?1e4:e.maxEntityExpansions,this.invalidCharHandling=e?.invalidCharHandling??`error`,this._init()}get closed(){return this._closed}get position(){return this.chunkPosition+this.i}_init(){this.state=0,this.text=``,this.name=``,this.q=null,this.tags=[],this.tag=null,this.attribList=[],this.entity=``,this.openWakaBang=``,this.sawRoot=this.fragment,this.closedRoot=this.fragment,this.reportedTextBeforeRoot=this.fragment,this.reportedTextAfterRoot=this.fragment,this.carriedFromPrevious=void 0,this._bomStripped=!1,this.line=1,this.column=0,this.positionAtNewLine=0,this.chunkPosition=0,this.chunk=``,this.i=0,this.prevI=0,this._nsStack=this.xmlns?[{xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`}]:[],this._entityExpansionCount=0}on(e,t){this._handlers[e]=t}off(e){delete this._handlers[e]}makeError(e){return new Ks(e,{line:this.trackPosition?this.line:void 0,column:this.trackPosition?this.column:void 0,fileName:this.fileName})}fail(e){let t=this.makeError(e);if(this._handlers.error)this._handlers.error(t);else throw t;return this}write(e){if(this._closed){if(e===null)return this;this._closed=!1,this._init()}let t=!1;e===null&&(t=!0,e=``),this.carriedFromPrevious!==void 0&&(e=this.carriedFromPrevious+e,this.carriedFromPrevious=void 0),this._bomStripped||(this._bomStripped=!0,e.length>0&&e.charCodeAt(0)===65279&&(e=e.slice(1)));let n=e.length;if(!t&&n>0){let t=e.charCodeAt(n-1);(t===13||t>=55296&&t<=56319)&&(this.carriedFromPrevious=e[n-1],n--,e=e.slice(0,n))}for(this.chunk=e,this.i=0;this.i<n;)this.processState();return this.chunkPosition+=n,t?this.end():this}close(){return this.write(null)}handleInvalidChar(e,t){switch(this.invalidCharHandling){case`replace`:return Js;case`skip`:return-2;default:{let n=t?`invalid XML character: ${t} 0x${e.toString(16)}`:`invalid XML character: 0x${e.toString(16)}`;return this.fail(n),e}}}handleInvalidCharInText(e,t,n,r){switch(this.invalidCharHandling){case`skip`:return t&&n<this.prevI&&(this.text+=this.chunk.slice(n,this.prevI)),this.i;case`replace`:return t&&(n<this.prevI&&(this.text+=this.chunk.slice(n,this.prevI)),this.text+=`�`),this.i;default:{let t=r?`invalid XML character: ${r} 0x${e.toString(16)}`:`invalid XML character: 0x${e.toString(16)}`;return this.fail(t),n}}}handleInvalidCharInAttr(e,t,n){switch(this.invalidCharHandling){case`skip`:return t<this.prevI&&(this.text+=this.chunk.slice(t,this.prevI)),this.i;case`replace`:return t<this.prevI&&(this.text+=this.chunk.slice(t,this.prevI)),this.text+=`�`,this.i;default:{let r=n?`invalid XML character: ${n} 0x${e.toString(16)}`:`invalid XML character: 0x${e.toString(16)}`;return this.fail(r),t}}}getCode(){for(;;){let{chunk:e}=this,t=this.i;if(this.prevI=t,this.i=t+1,t>=e.length)return-1;let n=e.charCodeAt(t);if(n>=32&&n<=126||n===9)return this.trackPosition&&this.column++,n;if(n===13)return e.charCodeAt(t+1)===10&&(this.i=t+2),this.trackPosition&&(this.line++,this.column=0,this.positionAtNewLine=this.position),10;if(n===10)return this.trackPosition&&(this.line++,this.column=0,this.positionAtNewLine=this.position),10;if(n>=55296&&n<=56319){let r=e.charCodeAt(t+1);if(r>=56320&&r<=57343)return this.i=t+2,this.trackPosition&&this.column++,65536+((n-55296)*1024+(r-56320));let i=this.handleInvalidChar(n,`lone surrogate`);if(i!==-2)return i;continue}if(n>=56320&&n<=57343){let e=this.handleInvalidChar(n,`lone surrogate`);if(e!==-2)return e;continue}if(n>=128){if(this.trackPosition&&this.column++,n===65534||n===65535){let e=this.handleInvalidChar(n);if(e!==-2)return e;continue}return n}this.trackPosition&&this.column++;let r=this.handleInvalidChar(n);if(r!==-2)return r}}unget(){this.i=this.prevI,this.trackPosition&&this.column--}processState(){switch(this.state){case 0:this.sText();break;case 1:this.sOpenWaka();break;case 2:this.sOpenWakaBang();break;case 3:this.sOpenTag();break;case 4:this.sOpenTagSlash();break;case 5:this.sAttrib();break;case 6:this.sAttribName();break;case 7:this.sAttribNameSawWhite();break;case 8:this.sAttribValue();break;case 9:this.sAttribValueQuoted();break;case 10:this.sAttribValueClosed();break;case 11:this.sCloseTag();break;case 12:this.sCloseTagSawWhite();break;case 13:this.sComment();break;case 14:this.sCommentEnding();break;case 15:this.sCommentEnded();break;case 16:this.sCData();break;case 17:this.sCDataEnding();break;case 18:this.sCDataEnding2();break;case 19:this.sPI();break;case 20:this.sPIEnding();break;case 21:this.sDoctype();break;case 22:this.sDoctypeQuote();break;case 23:this.sDoctypeDTD();break;case 24:this.sDoctypeDTDQuoted();break;case 25:this.sEntity();break}}sText(){this.tags.length===0?this.handleTextOutsideRoot():this.handleTextInRoot()}handleTextInRoot(){let{chunk:e}=this,{i:t}=this,n=this._handlers.text,r=e.length;for(;this.i<r;){let r=e.charCodeAt(this.i);if(r>=32&&r<=126&&r!==60&&r!==38){this.i++,this.trackPosition&&this.column++;continue}if(r===9){this.i++,this.trackPosition&&this.column++;continue}if(r===60){if(this.prevI=this.i,this.i++,this.trackPosition&&this.column++,n){let r=e.slice(t,this.prevI);this.text.length>0?(n(this.text+r),this.text=``):r.length>0&&n(r)}this.state=1;return}if(r===38){this.prevI=this.i,this.i++,this.trackPosition&&this.column++,n&&(this.text+=e.slice(t,this.prevI)),this.state=25,this.entityReturnState=0,this.entity=``;return}if(r===10){this.prevI=this.i,this.i++,this.trackPosition&&(this.line++,this.column=0,this.positionAtNewLine=this.position),n&&(this.text+=e.slice(t,this.prevI)+`
|
|
112
|
+
`],{type:`text/javascript`});return Ps=URL.createObjectURL(t),Ps}var Is=class extends sr{constructor(e){super({write:(e,t,n)=>{this._doWrite(e,n)},final:e=>{this._doClose(e)}}),this._nextId=1,this._pendingAcks=new Map,this._workerClosed=!1,this._junkError=!1,this._terminated=!1;let t=Fs(e);this.worker=new Worker(t),this.worker.onmessage=e=>{let t=e.data;if(!(!t||typeof t.t!=`string`)){if(t.t===`data`){let e=t.chunk;this.push(e);return}if(t.t===`end`){this.push(null),this._terminateWorker();return}if(t.t===`aborted`){this._terminateWorker();return}if(t.t===`ack`){let e=t.id,n=this._pendingAcks.get(e);n&&(this._pendingAcks.delete(e),n());return}if(t.t===`error`){let e=typeof t.message==`string`?t.message:`Worker inflate error`;if(e.includes(`Junk`)||e.includes(`junk`)){this._junkError=!0,this.push(null),this._terminateWorker(),this._settlePendingAcks();return}let n=Error(e);this._settlePendingAcks(n),this.emit(`error`,n),this._terminateWorker();return}}},this.worker.onerror=e=>{let t=Error(e.message??`Worker error`);this._settlePendingAcks(t),this.emit(`error`,t),this._terminateWorker()}}_settlePendingAcks(e){if(this._pendingAcks.size!==0){for(let t of this._pendingAcks.values())t(e);this._pendingAcks.clear()}}_terminateWorker(){if(!this._terminated){this._terminated=!0;try{this.worker.terminate()}catch{}}}_doWrite(e,t){if(this._workerClosed||this._junkError){t();return}let n=this._nextId++;this._pendingAcks.set(n,t);let r=e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e:e.slice();this.worker.postMessage({t:`write`,id:n,chunk:r},[r.buffer])}_doClose(e){if(this._workerClosed){e();return}this._workerClosed=!0,this.worker.postMessage({t:`close`}),e()}destroy(e){if(!this._workerClosed){this._workerClosed=!0;try{this.worker.postMessage({t:`abort`})}catch{}}return this._terminateWorker(),super.destroy(e??void 0)}},Ls=class extends sr{constructor(){super({write:(e,t,n)=>{if(this._finished){n(Error(`write after end`));return}this.chunks.push(e),n()},final:e=>{this._decompress(e)}}),this.chunks=[],this._finished=!1}_decompress(e){try{let t=Fi(T(this.chunks));this.push(t),this.push(null),this._finished=!0,e()}catch(t){e(o(t))}}destroy(e){return this._finished=!0,this.chunks=[],super.destroy(e??void 0)}};function Rs(){return pi()?new Ns:new Ls}let zs=ts;function Bs(e){return class extends sr{constructor(t={}){super({objectMode:!0,write:(e,t,n)=>{this._handleWrite(e,n)},final:e=>{this.finished=!0,this._maybeReleaseWriteCallback(),this._wakeUp(),this.emit(`data-available`),this.emit(`chunk`,!1),this._parsingDone.then(()=>e()).catch(e)}}),this._buffer=new si,this.finished=!1,this._driverState={},this._parsingDone=Promise.resolve(),this._parserDoneFlag=!1,this._parserError=null,this._parserDeferred=null,this._parserDonePromise=null,this._entryQueue=[],this._entryWaiter=null,this._entriesDone=!1,this._opts=t,this.on(`error`,e=>{this._rejectParserDeferred(e),this._closeEntryQueue(e)});let n=Math.max(64*1024,t.inputHighWaterMarkBytes??2*1024*1024),r=Math.max(32*1024,t.inputLowWaterMarkBytes??Math.floor(n/4));this._inputHighWaterMarkBytes=n,this._inputLowWaterMarkBytes=Math.min(r,n);let i={pull:e=>this.pull(e),pullUntil:(e,t)=>this.pullUntil(e,t),stream:e=>this.stream(e),streamUntilDataDescriptor:()=>this._streamUntilDataDescriptor(),setDone:()=>{this.push(null)}},a={emitEntry:e=>{this.emit(`entry`,e)},pushEntry:e=>{this.push(e),this._enqueueEntry(e)},pushEntryIfPiped:e=>{this._enqueueEntry(e)},emitCrxHeader:e=>{this.crxHeader=e,this.emit(`crx-header`,e)},emitError:e=>{this.__emittedError=e,this.emit(`error`,e)},emitClose:()=>{this.emit(`close`)}};queueMicrotask(()=>{let t=()=>{if(this._opts.useWorkerInflate&&typeof Worker<`u`&&pi())try{return new Is(this._opts.workerInflateUrl)}catch{return e()}return e()};this._parsingDone=As(this._opts,i,a,t,this._driverState),this._parsingDone.then(()=>{this.__emittedError?(this._rejectParserDeferred(this.__emittedError),this._closeEntryQueue(this.__emittedError)):(this._resolveParserDeferred(),this._closeEntryQueue())},e=>{(!this.__emittedError||this.__emittedError!==e)&&(this.__emittedError=e,this.emit(`error`,e)),this._rejectParserDeferred(e),this._closeEntryQueue(e),this.emit(`close`)})})}_handleWrite(e,t){this._buffer.append(e),this._buffer.length>=this._inputHighWaterMarkBytes?this._writeCb=t:t(),this._wakeUp(),this.emit(`data-available`),this.emit(`chunk`)}get buffer(){return this._buffer.view()}set buffer(e){this._buffer.reset(e)}_wakeUp(){if(this._pendingResolve){let e=this._pendingResolve;this._pendingResolve=void 0,this._pendingDataPromise=void 0,e()}}_maybeReleaseWriteCallback(){if(!this._writeCb||this._buffer.length>this._inputLowWaterMarkBytes)return;let e=this._writeCb;this._writeCb=void 0,e()}_waitForData(){return this._pendingDataPromise||=new Promise(e=>{this._pendingResolve=e}),this._pendingDataPromise}async _pullInternal(e){if(e===0)return ai;let t=e,n=null,r=null,i=e=>{if(e.length!==0){if(!n){n=e;return}if(!r){r=[n,e];return}r.push(e)}};for(;t>0;){for(;this._buffer.length===0;){if(this.finished)throw Error(`FILE_ENDED`);await this._waitForData()}let e=Math.min(t,this._buffer.length);i(this._buffer.read(e)),t-=e,this._buffer.length===0&&this._maybeReleaseWriteCallback()}return this._maybeReleaseWriteCallback(),n?r?T(r):n:ai}async _pullUntilInternal(e,t=!1){let n=null,r=null,i=new Cs(e),a=e.length,o=e=>{if(e.length!==0){if(!n){n=e;return}if(!r){r=[n,e];return}r.push(e)}};for(;;){let e=this._buffer.length,s=i.find(this._buffer);if(s!==-1){this.match=s;let e=s+(t?a:0);return e>0&&(o(this._buffer.read(e)),this._maybeReleaseWriteCallback()),n?r?T(r):n:ai}if(i.onNoMatch(e),this.finished)throw Error(`FILE_ENDED`);let c=this._buffer.length-a;c>0&&(o(this._buffer.read(c)),i.onConsume(c),this._maybeReleaseWriteCallback()),await this._waitForData()}}_streamFixedLength(e){let t=new lr({highWaterMark:Es}),n=e,r=!1,i=!1,a=()=>{i=!1,o()},o=()=>{if(!r&&!i){for(;n>0&&this._buffer.length>0;){let e=Math.min(n,this._buffer.length),r=this._buffer.read(e);n-=e;let o=t.write(r);if(this._maybeReleaseWriteCallback(),!o){i=!0,t.once(`drain`,a);return}}n===0?(r=!0,this.removeListener(`data-available`,o),t.end()):this.finished&&(r=!0,this.removeListener(`data-available`,o),t.destroy(Error(`FILE_ENDED`)))}};return this.on(`data-available`,o),queueMicrotask(()=>o()),t}_streamUntilPattern(e,t=!1){let n=new lr({highWaterMark:Es}),r=!1,i=e.length,a=new Cs(e),o=!1,s=()=>{o=!1,c()},c=()=>{if(!(r||o))for(;!(this._buffer.length<=0);){let e=this._buffer.length,l=a.find(this._buffer);if(l!==-1){this.match=l;let e=t?l+i:l;if(e>0){let t=n.write(this._buffer.read(e));if(a.onConsume(e),this._maybeReleaseWriteCallback(),!t){o=!0,n.once(`drain`,s);return}}r=!0,this.removeListener(`data-available`,c),n.end();return}if(a.onNoMatch(e),this.finished){r=!0,this.removeListener(`data-available`,c),n.destroy(Error(`FILE_ENDED`));return}let u=e-i;if(u<=0){this._buffer.length<=i&&this._maybeReleaseWriteCallback();break}let d=n.write(this._buffer.read(u));if(a.onConsume(u),this._maybeReleaseWriteCallback(),!d){o=!0,n.once(`drain`,s);return}}};return this.on(`data-available`,c),queueMicrotask(()=>c()),n}stream(e,t){return typeof e==`number`?this._streamFixedLength(e):this._streamUntilPattern(e,t??!1)}pull(e,t){if(e===0)return Promise.resolve(ai);if(typeof e==`number`){if(this.finished&&this._buffer.length<e)return Promise.reject(Error(`FILE_ENDED`));if(this._buffer.length>=e){let t=this._buffer.read(e);return this._maybeReleaseWriteCallback(),Promise.resolve(t)}return this._pullInternal(e)}return this.finished?Promise.reject(Error(`FILE_ENDED`)):this._pullUntilInternal(e,t??!1)}pullUntil(e,t){return this.pull(e,t)}_streamUntilDataDescriptor(){return ks({source:{getLength:()=>this._buffer.length,read:e=>this._buffer.read(e),peekChunks:e=>this._buffer.peekChunks(e),discard:e=>this._buffer.discard(e),indexOfPattern:(e,t)=>this._buffer.indexOfPattern(e,t),peekUint32LE:e=>this._buffer.peekUint32LE(e),isFinished:()=>this.finished,onDataAvailable:e=>(this.on(`data-available`,e),()=>this.removeListener(`data-available`,e)),maybeReleaseWriteCallback:()=>this._maybeReleaseWriteCallback()},dataDescriptorSignature:zs})}promise(){return this._parserDoneFlag?this._parserError?Promise.reject(this._parserError):Promise.resolve():(this._parserDonePromise||=new Promise((e,t)=>{this._parserDeferred={resolve:e,reject:t}}),this._parserDonePromise)}_resolveParserDeferred(){if(!this._parserDoneFlag&&(this._parserDoneFlag=!0,this._parserDeferred)){let{resolve:e}=this._parserDeferred;this._parserDeferred=null,e()}}_rejectParserDeferred(e){if(!this._parserDoneFlag&&(this._parserDoneFlag=!0,this._parserError=e,this._parserDeferred)){let{reject:t}=this._parserDeferred;this._parserDeferred=null,t(e)}}_enqueueEntry(e){if(this._entryWaiter){let{resolve:t}=this._entryWaiter;this._entryWaiter=null,t({value:e,done:!1})}else this._entryQueue.push(e)}_closeEntryQueue(e){if(this._entriesDone=!0,this._entryWaiter){let t=this._entryWaiter;this._entryWaiter=null,e?t.reject(e):t.resolve({value:void 0,done:!0})}}[Symbol.asyncIterator](){let e={next:()=>this._entryQueue.length>0?Promise.resolve({value:this._entryQueue.shift(),done:!1}):this._entriesDone?this._parserError?Promise.reject(this._parserError):Promise.resolve({value:void 0,done:!0}):new Promise((e,t)=>{this._entryWaiter={resolve:e,reject:t}}),return:()=>(this._entriesDone=!0,this._entryQueue.length=0,this._entryWaiter=null,Promise.resolve({value:void 0,done:!0})),[Symbol.asyncIterator](){return e}};return e}}}let Vs=Bs(Rs);var Hs=class extends Vs{};function Us(e){return new Hs(e)}let Ws=function(e){return e[e.Null=0]=`Null`,e[e.Merge=1]=`Merge`,e[e.Number=2]=`Number`,e[e.String=3]=`String`,e[e.Date=4]=`Date`,e[e.Hyperlink=5]=`Hyperlink`,e[e.Formula=6]=`Formula`,e[e.SharedString=7]=`SharedString`,e[e.RichText=8]=`RichText`,e[e.Boolean=9]=`Boolean`,e[e.Error=10]=`Error`,e[e.JSON=11]=`JSON`,e[e.Checkbox=12]=`Checkbox`,e}({}),Gs=function(e){return e[e.None=0]=`None`,e[e.Master=1]=`Master`,e[e.Shared=2]=`Shared`,e}({}),Ks=function(e){return e[e.None=0]=`None`,e[e.OfficeDocument=1]=`OfficeDocument`,e[e.Worksheet=2]=`Worksheet`,e[e.CalcChain=3]=`CalcChain`,e[e.SharedStrings=4]=`SharedStrings`,e[e.Styles=5]=`Styles`,e[e.Theme=6]=`Theme`,e[e.Hyperlink=7]=`Hyperlink`,e}({}),qs=function(e){return e[e.Xlsx=1]=`Xlsx`,e}({}),Js=function(e){return e[e.LeftToRight=1]=`LeftToRight`,e[e.RightToLeft=2]=`RightToLeft`,e}({}),Ys={NotApplicable:`#N/A`,Ref:`#REF!`,Name:`#NAME?`,DivZero:`#DIV/0!`,Null:`#NULL!`,Value:`#VALUE!`,Num:`#NUM!`},Xs={ValueType:Ws,FormulaType:Gs,RelationshipType:Ks,DocumentType:qs,ReadingOrder:Js,ErrorValue:Ys},k={OfficeDocument:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument`,Worksheet:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet`,CalcChain:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain`,SharedStrings:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings`,Styles:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles`,Theme:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme`,Hyperlink:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink`,Image:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,CoreProperties:`http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties`,ExtenderProperties:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties`,Comments:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments`,VmlDrawing:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing`,Table:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/table`,PivotCacheDefinition:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition`,PivotCacheRecords:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheRecords`,PivotTable:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable`,FeaturePropertyBag:`http://schemas.microsoft.com/office/2022/11/relationships/FeaturePropertyBag`,CtrlProp:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/ctrlProp`,SheetMetadata:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata`,ExternalLink:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink`,ExternalLinkPath:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath`};var Zs=class extends n{constructor(...e){super(...e),this.name=`XmlError`}},Qs=class extends Zs{constructor(e,t,n){let r=[];t?.fileName&&r.push(t.fileName),t?.line!==void 0&&r.push(`${t.line}:${t.column??0}`);let i=r.length>0?`${r.join(`:`)}: `:``;super(`${i}${e}`,n),this.name=`XmlParseError`,this.line=t?.line,this.column=t?.column,this.fileName=t?.fileName}},$s=class extends Zs{constructor(e,t,n){super(`Cannot ${e}: ${t}`,n),this.name=`XmlWriteError`,this.operation=e,this.state=t}};let ec=65533,tc=(()=>{let e=Array(128);for(let t=0;t<128;t++)e[t]=String.fromCharCode(t);return e})();function nc(e){return e<128?tc[e]:String.fromCodePoint(e)}let rc=(()=>{let e=new Uint8Array(128);for(let t=97;t<=122;t++)e[t]=1;for(let t=65;t<=90;t++)e[t]=1;return e[95]=1,e[58]=1,e})(),ic=(()=>{let e=new Uint8Array(128);for(let t=97;t<=122;t++)e[t]=1;for(let t=65;t<=90;t++)e[t]=1;for(let t=48;t<=57;t++)e[t]=1;return e[95]=1,e[58]=1,e[45]=1,e[46]=1,e})();function ac(e){return e===32||e===10||e===13||e===9}function oc(e){return e===34||e===39}function sc(e){return e<128?rc[e]===1:e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e===8204||e===8205||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function cc(e){return e<128?ic[e]===1:e===183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=768&&e<=879||e>=880&&e<=893||e>=895&&e<=8191||e===8204||e===8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function lc(e){return e>=32&&e<=55295||e===10||e===13||e===9||e>=57344&&e<=65533||e>=65536&&e<=1114111}let uc={amp:`&`,gt:`>`,lt:`<`,quot:`"`,apos:`'`};var dc=class{constructor(e){this._entityExpansionCount=0,this._nsStack=[],this.state=0,this.chunk=``,this.i=0,this.prevI=0,this.text=``,this.name=``,this.q=null,this.tags=[],this.tag=null,this.attribList=[],this.entity=``,this.entityReturnState=0,this.openWakaBang=``,this.sawRoot=!1,this.closedRoot=!1,this._bomStripped=!1,this._closed=!1,this.reportedTextBeforeRoot=!1,this.reportedTextAfterRoot=!1,this.line=1,this.column=0,this.positionAtNewLine=0,this.chunkPosition=0,this.ENTITIES={...uc},this._handlers={},this.trackPosition=e?.position!==!1,this.fileName=e?.fileName,this.fragment=e?.fragment??!1,this.xmlns=e?.xmlns??!1,this.maxDepth=e?.maxDepth===void 0?256:e.maxDepth,this.maxEntityExpansions=e?.maxEntityExpansions===void 0?1e4:e.maxEntityExpansions,this.invalidCharHandling=e?.invalidCharHandling??`error`,this._init()}get closed(){return this._closed}get position(){return this.chunkPosition+this.i}_init(){this.state=0,this.text=``,this.name=``,this.q=null,this.tags=[],this.tag=null,this.attribList=[],this.entity=``,this.openWakaBang=``,this.sawRoot=this.fragment,this.closedRoot=this.fragment,this.reportedTextBeforeRoot=this.fragment,this.reportedTextAfterRoot=this.fragment,this.carriedFromPrevious=void 0,this._bomStripped=!1,this.line=1,this.column=0,this.positionAtNewLine=0,this.chunkPosition=0,this.chunk=``,this.i=0,this.prevI=0,this._nsStack=this.xmlns?[{xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`}]:[],this._entityExpansionCount=0}on(e,t){this._handlers[e]=t}off(e){delete this._handlers[e]}makeError(e){return new Qs(e,{line:this.trackPosition?this.line:void 0,column:this.trackPosition?this.column:void 0,fileName:this.fileName})}fail(e){let t=this.makeError(e);if(this._handlers.error)this._handlers.error(t);else throw t;return this}write(e){if(this._closed){if(e===null)return this;this._closed=!1,this._init()}let t=!1;e===null&&(t=!0,e=``),this.carriedFromPrevious!==void 0&&(e=this.carriedFromPrevious+e,this.carriedFromPrevious=void 0),this._bomStripped||(this._bomStripped=!0,e.length>0&&e.charCodeAt(0)===65279&&(e=e.slice(1)));let n=e.length;if(!t&&n>0){let t=e.charCodeAt(n-1);(t===13||t>=55296&&t<=56319)&&(this.carriedFromPrevious=e[n-1],n--,e=e.slice(0,n))}for(this.chunk=e,this.i=0;this.i<n;)this.processState();return this.chunkPosition+=n,t?this.end():this}close(){return this.write(null)}handleInvalidChar(e,t){switch(this.invalidCharHandling){case`replace`:return ec;case`skip`:return-2;default:{let n=t?`invalid XML character: ${t} 0x${e.toString(16)}`:`invalid XML character: 0x${e.toString(16)}`;return this.fail(n),e}}}handleInvalidCharInText(e,t,n,r){switch(this.invalidCharHandling){case`skip`:return t&&n<this.prevI&&(this.text+=this.chunk.slice(n,this.prevI)),this.i;case`replace`:return t&&(n<this.prevI&&(this.text+=this.chunk.slice(n,this.prevI)),this.text+=`�`),this.i;default:{let t=r?`invalid XML character: ${r} 0x${e.toString(16)}`:`invalid XML character: 0x${e.toString(16)}`;return this.fail(t),n}}}handleInvalidCharInAttr(e,t,n){switch(this.invalidCharHandling){case`skip`:return t<this.prevI&&(this.text+=this.chunk.slice(t,this.prevI)),this.i;case`replace`:return t<this.prevI&&(this.text+=this.chunk.slice(t,this.prevI)),this.text+=`�`,this.i;default:{let r=n?`invalid XML character: ${n} 0x${e.toString(16)}`:`invalid XML character: 0x${e.toString(16)}`;return this.fail(r),t}}}getCode(){for(;;){let{chunk:e}=this,t=this.i;if(this.prevI=t,this.i=t+1,t>=e.length)return-1;let n=e.charCodeAt(t);if(n>=32&&n<=126||n===9)return this.trackPosition&&this.column++,n;if(n===13)return e.charCodeAt(t+1)===10&&(this.i=t+2),this.trackPosition&&(this.line++,this.column=0,this.positionAtNewLine=this.position),10;if(n===10)return this.trackPosition&&(this.line++,this.column=0,this.positionAtNewLine=this.position),10;if(n>=55296&&n<=56319){let r=e.charCodeAt(t+1);if(r>=56320&&r<=57343)return this.i=t+2,this.trackPosition&&this.column++,65536+((n-55296)*1024+(r-56320));let i=this.handleInvalidChar(n,`lone surrogate`);if(i!==-2)return i;continue}if(n>=56320&&n<=57343){let e=this.handleInvalidChar(n,`lone surrogate`);if(e!==-2)return e;continue}if(n>=128){if(this.trackPosition&&this.column++,n===65534||n===65535){let e=this.handleInvalidChar(n);if(e!==-2)return e;continue}return n}this.trackPosition&&this.column++;let r=this.handleInvalidChar(n);if(r!==-2)return r}}unget(){this.i=this.prevI,this.trackPosition&&this.column--}processState(){switch(this.state){case 0:this.sText();break;case 1:this.sOpenWaka();break;case 2:this.sOpenWakaBang();break;case 3:this.sOpenTag();break;case 4:this.sOpenTagSlash();break;case 5:this.sAttrib();break;case 6:this.sAttribName();break;case 7:this.sAttribNameSawWhite();break;case 8:this.sAttribValue();break;case 9:this.sAttribValueQuoted();break;case 10:this.sAttribValueClosed();break;case 11:this.sCloseTag();break;case 12:this.sCloseTagSawWhite();break;case 13:this.sComment();break;case 14:this.sCommentEnding();break;case 15:this.sCommentEnded();break;case 16:this.sCData();break;case 17:this.sCDataEnding();break;case 18:this.sCDataEnding2();break;case 19:this.sPI();break;case 20:this.sPIEnding();break;case 21:this.sDoctype();break;case 22:this.sDoctypeQuote();break;case 23:this.sDoctypeDTD();break;case 24:this.sDoctypeDTDQuoted();break;case 25:this.sEntity();break}}sText(){this.tags.length===0?this.handleTextOutsideRoot():this.handleTextInRoot()}handleTextInRoot(){let{chunk:e}=this,{i:t}=this,n=this._handlers.text,r=e.length;for(;this.i<r;){let r=e.charCodeAt(this.i);if(r>=32&&r<=126&&r!==60&&r!==38){this.i++,this.trackPosition&&this.column++;continue}if(r===9){this.i++,this.trackPosition&&this.column++;continue}if(r===60){if(this.prevI=this.i,this.i++,this.trackPosition&&this.column++,n){let r=e.slice(t,this.prevI);this.text.length>0?(n(this.text+r),this.text=``):r.length>0&&n(r)}this.state=1;return}if(r===38){this.prevI=this.i,this.i++,this.trackPosition&&this.column++,n&&(this.text+=e.slice(t,this.prevI)),this.state=25,this.entityReturnState=0,this.entity=``;return}if(r===10){this.prevI=this.i,this.i++,this.trackPosition&&(this.line++,this.column=0,this.positionAtNewLine=this.position),n&&(this.text+=e.slice(t,this.prevI)+`
|
|
113
113
|
`),t=this.i;continue}if(r===13){this.prevI=this.i,this.i++,e.charCodeAt(this.i)===10&&this.i++,this.trackPosition&&(this.line++,this.column=0,this.positionAtNewLine=this.position),n&&(this.text+=e.slice(t,this.prevI)+`
|
|
114
|
-
`),t=this.i;continue}if(r>=128){if(this.prevI=this.i,r>=55296&&r<=56319){let i=e.charCodeAt(this.i+1);i>=56320&&i<=57343?this.i+=2:(this.i++,t=this.handleInvalidCharInText(r,n,t,`lone surrogate`))}else r>=56320&&r<=57343?(this.i++,t=this.handleInvalidCharInText(r,n,t,`lone surrogate`)):r===65534||r===65535?(this.i++,t=this.handleInvalidCharInText(r,n,t)):this.i++;this.trackPosition&&this.column++;continue}this.prevI=this.i,this.i++,this.trackPosition&&this.column++,t=this.handleInvalidCharInText(r,n,t)}n&&t<this.i&&(this.text+=e.slice(t,this.i))}handleTextOutsideRoot(){let{chunk:e}=this,{i:t}=this,n=this._handlers.text,r=!1,i=this.invalidCharHandling===`skip`,a=this.invalidCharHandling===`replace`;for(;;){let o=this.i,s=this.getCode();if(s===-1){n&&t<o&&(this.text+=e.slice(t,o));break}if(i&&this.prevI>o&&(n&&t<o&&(this.text+=e.slice(t,o)),t=this.prevI),a&&s===
|
|
115
|
-
`),t=this.i):Qs(s)||(r=!0)}r&&(!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail(`text data outside of root node.`),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail(`text data outside of root node.`),this.reportedTextAfterRoot=!0))}sOpenWaka(){let e=this.getCode();if(e!==-1){if(ec(e)){this.closedRoot&&!this.fragment&&this.fail(`documents may contain only one root element`),this.state=3,this.name=I(e);return}switch(e){case 47:this.state=11,this.name=``;break;case 33:this.state=2,this.openWakaBang=``;break;case 63:this.state=19,this.text=``;break;default:this.fail(`unexpected character in tag`),this.state=0}}}sOpenWakaBang(){let e=this.getCode();if(e!==-1)switch(this.openWakaBang+=I(e),this.openWakaBang){case`[CDATA[`:this.state=16,this.text=``,this.openWakaBang=``;break;case`--`:this.state=13,this.text=``,this.openWakaBang=``;break;case`DOCTYPE`:this.state=21,this.text=``,this.openWakaBang=``;break;default:this.openWakaBang.length>=7&&(this.fail(`incorrect syntax`),this.state=0)}}sOpenTag(){let{chunk:e}=this,t=this.i,n=this.i;for(;n<e.length;){let t=e.charCodeAt(n);if(t<128?Zs[t]===1:tc(t))n++;else break}if(n>=e.length){this.name+=e.slice(t,n),this.i=n,this.trackPosition&&(this.column+=n-t);return}this.name+=e.slice(t,n),this.i=n,this.trackPosition&&(this.column+=n-t);let r=this.getCode();r!==-1&&(this.tag={name:this.name,attributes:Object.create(null),isSelfClosing:!1},this.attribList=[],this.sawRoot=!0,r===62?this.openTag():r===47?this.state=4:(Qs(r)||this.fail(`unexpected character in tag`),this.state=5))}sOpenTagSlash(){let e=this.getCode();e!==-1&&(e===62?this.openSelfClosingTag():(this.fail(`expected >`),this.state=5))}sAttrib(){let e=this.skipSpaces();e!==-1&&(ec(e)?(this.name=I(e),this.state=6):e===62?this.openTag():e===47?this.state=4:this.fail(`unexpected character in attribute`))}sAttribName(){let{chunk:e}=this,t=this.i,n=this.i;for(;n<e.length;){let t=e.charCodeAt(n);if(t<128?Zs[t]===1:tc(t))n++;else break}if(n>=e.length){this.name+=e.slice(t,n),this.i=n,this.trackPosition&&(this.column+=n-t);return}this.name+=e.slice(t,n),this.i=n,this.trackPosition&&(this.column+=n-t);let r=this.getCode();r!==-1&&(r===61?this.state=8:Qs(r)?this.state=7:r===62?(this.fail(`attribute without value`),this.attribList.push({name:this.name,value:this.name}),this.name=``,this.openTag()):this.fail(`unexpected character in attribute name`))}sAttribNameSawWhite(){let e=this.skipSpaces();e!==-1&&(e===61?this.state=8:(this.fail(`attribute without value`),this.name=``,this.text=``,e===62?this.openTag():ec(e)?(this.name=I(e),this.state=6):(this.fail(`unexpected character`),this.state=5)))}sAttribValue(){let e=this.skipSpaces();e!==-1&&($s(e)?(this.q=e,this.text=``,this.state=9):(this.fail(`unquoted attribute value`),this.state=0))}sAttribValueQuoted(){let{q:e,chunk:t}=this,{i:n}=this,r=t.length;for(;this.i<r;){let r=t.charCodeAt(this.i);if(r>=32&&r<=126&&r!==e&&r!==38&&r!==60){this.i++,this.trackPosition&&this.column++;continue}if(r===e){this.prevI=this.i,this.i++,this.trackPosition&&this.column++,this.attribList.push({name:this.name,value:this.text+t.slice(n,this.prevI)}),this.name=``,this.text=``,this.q=null,this.state=10;return}if(r===38){this.prevI=this.i,this.i++,this.trackPosition&&this.column++,this.text+=t.slice(n,this.prevI),this.state=25,this.entityReturnState=9,this.entity=``;return}if(r===60){this.prevI=this.i,this.i++,this.trackPosition&&this.column++,this.text+=t.slice(n,this.prevI),this.fail(`< not allowed in attribute value`),this.attribList.push({name:this.name,value:this.text}),this.name=``,this.text=``,this.q=null,this.unget(),this.state=0;return}if(r===9||r===10){this.prevI=this.i,this.i++,r===10&&this.trackPosition?(this.line++,this.column=0,this.positionAtNewLine=this.position):this.trackPosition&&this.column++,this.text+=t.slice(n,this.prevI)+` `,n=this.i;continue}if(r===13){this.prevI=this.i,this.i++,t.charCodeAt(this.i)===10&&this.i++,this.trackPosition&&(this.line++,this.column=0,this.positionAtNewLine=this.position),this.text+=t.slice(n,this.prevI)+` `,n=this.i;continue}if(r>=128){if(this.prevI=this.i,r>=55296&&r<=56319){let e=t.charCodeAt(this.i+1);e>=56320&&e<=57343?this.i+=2:(this.i++,n=this.handleInvalidCharInAttr(r,n,`lone surrogate`))}else r>=56320&&r<=57343?(this.i++,n=this.handleInvalidCharInAttr(r,n,`lone surrogate`)):r===65534||r===65535?(this.i++,n=this.handleInvalidCharInAttr(r,n)):this.i++;this.trackPosition&&this.column++;continue}this.prevI=this.i,this.i++,this.trackPosition&&this.column++,n=this.handleInvalidCharInAttr(r,n)}this.text+=t.slice(n,this.i)}sAttribValueClosed(){let e=this.getCode();e!==-1&&(Qs(e)?this.state=5:e===62?this.openTag():e===47?this.state=4:ec(e)?(this.fail(`no whitespace between attributes`),this.name=I(e),this.state=6):this.fail(`unexpected character after attribute`))}sCloseTag(){let{chunk:e}=this,t=this.i;if(this.name===``){if(t>=e.length){let e=this.getCode();if(e===-1)return;ec(e)?this.name=I(e):this.fail(`unexpected character in close tag`);return}let n=e.charCodeAt(t);if(n<128?Xs[n]!==1:!ec(n)){this.i=t,this.getCode()!==-1&&this.fail(`unexpected character in close tag`);return}this.name=e[t],t++,this.trackPosition&&this.column++}let n=t;for(;t<e.length;){let n=e.charCodeAt(t);if(n<128?Zs[n]===1:tc(n))t++;else break}if(t>n&&(this.name+=e.slice(n,t)),this.trackPosition&&(this.column+=t-n),t>=e.length){this.i=t;return}this.i=t;let r=this.getCode();r!==-1&&(r===62?this.closeTag():Qs(r)?this.state=12:this.fail(`unexpected character in close tag`))}sCloseTagSawWhite(){let e=this.skipSpaces();e!==-1&&(e===62?this.closeTag():this.fail(`unexpected character in close tag`))}sComment(){let e=this.getCode();e!==-1&&(e===45?this.state=14:this.text+=I(e))}sCommentEnding(){let e=this.getCode();e!==-1&&(e===45?this.state=15:(this.text+=`-`+I(e),this.state=13))}sCommentEnded(){let e=this.getCode();e!==-1&&(e===62?(this._handlers.comment?.(this.text),this.text=``,this.state=0):e===45?this.text+=`-`:(this.fail(`malformed comment`),this.text+=`--`+I(e),this.state=13))}sCData(){let e=this.getCode();e!==-1&&(e===93?this.state=17:this.text+=I(e))}sCDataEnding(){let e=this.getCode();e!==-1&&(e===93?this.state=18:(this.text+=`]`+I(e),this.state=16))}sCDataEnding2(){let e=this.getCode();e!==-1&&(e===62?(this._handlers.cdata?this._handlers.cdata(this.text):this._handlers.text&&this.text.length>0&&this._handlers.text(this.text),this.text=``,this.state=0):e===93?this.text+=`]`:(this.text+=`]]`+I(e),this.state=16))}sPI(){let e=this.getCode();e!==-1&&(e===63?this.state=20:this.text+=I(e))}sPIEnding(){let e=this.getCode();if(e!==-1)if(e===62){let e=this.text,t=e.indexOf(` `);t>=0?this._handlers.pi?.(e.slice(0,t),e.slice(t+1)):this._handlers.pi?.(e,``),this.text=``,this.state=0}else e===63?this.text+=`?`:(this.text+=`?`+I(e),this.state=19)}sDoctype(){let e=this.getCode();e!==-1&&(e===62?(this.text=``,this.state=0):$s(e)?(this.q=e,this.state=22):e===91?this.state=23:this.text+=I(e))}sDoctypeQuote(){let e=this.getCode();e!==-1&&(e===this.q?(this.q=null,this.state=21):this.text+=I(e))}sDoctypeDTD(){let e=this.getCode();e!==-1&&(e===93?this.state=21:$s(e)&&(this.q=e,this.state=24))}sDoctypeDTDQuoted(){let e=this.getCode();e!==-1&&e===this.q&&(this.q=null,this.state=23)}sEntity(){let e=this.getCode();if(e!==-1)if(e===59){let e=this.entity,t;e===``?(this.fail(`empty entity`),t=`&;`):t=this.parseEntity(e),this.text+=t,this.state=this.entityReturnState,this.entity=``}else tc(e)||e===35?(this.entity+=I(e),this.entity.length>64&&(this.fail(`entity name too long`),this.text+=`&`+this.entity,this.state=this.entityReturnState,this.entity=``)):(this.fail(`invalid entity character`),this.text+=`&`+this.entity+I(e),this.state=this.entityReturnState,this.entity=``)}parseEntity(e){if(e[0]!==`#`){let t=this.ENTITIES[e];return t===void 0?(this.fail(`undefined entity: `+e),`&`+e+`;`):this.maxEntityExpansions>0&&e!==`lt`&&e!==`gt`&&e!==`amp`&&e!==`quot`&&e!==`apos`&&(this._entityExpansionCount++,this._entityExpansionCount>this.maxEntityExpansions)?(this.fail(`entity expansion limit (${this.maxEntityExpansions}) exceeded — possible XML bomb`),``):t}let t;return t=e[1]===`x`||e[1]===`X`?parseInt(e.slice(2),16):parseInt(e.slice(1),10),isNaN(t)||t<1||t>=55296&&t<=57343||t>1114111?(this.fail(`invalid character entity: &#`+e.slice(1)+`;`),``):nc(t)?String.fromCodePoint(t):(this.fail(`invalid character entity`),``)}skipSpaces(){for(;;){let e=this.getCode();if(e===-1||!Qs(e))return e}}splitQName(e){let t=e.indexOf(`:`);return t<0?[``,e]:[e.slice(0,t),e.slice(t+1)]}resolveNs(e){for(let t=this._nsStack.length-1;t>=0;t--){let n=this._nsStack[t][e];if(n!==void 0)return n}return``}applyNamespaces(e){let t=`http://www.w3.org/XML/1998/namespace`,n=`http://www.w3.org/2000/xmlns/`,r={},i=e.attributes;for(let e in i)if(Object.prototype.hasOwnProperty.call(i,e)){if(e===`xmlns`)r[``]=i[e];else if(e.startsWith(`xmlns:`)){let a=e.slice(6),o=i[e];a===`xmlns`?this.fail(`the "xmlns" prefix must not be declared`):a===`xml`&&o!==t?this.fail(`the "xml" prefix must be bound to "${t}"`):o===t&&a!==`xml`?this.fail(`namespace "${t}" must only be bound to the "xml" prefix`):o===n&&this.fail(`namespace "${n}" must not be bound to any prefix`),r[a]=o}}this._nsStack.push(r),Object.keys(r).length>0&&(e.ns=r);let[a,o]=this.splitQName(e.name);o.includes(`:`)&&this.fail(`invalid QName "${e.name}": local part must not contain ":"`),e.prefix=a,e.local=o,e.uri=this.resolveNs(a),a!==``&&e.uri===``&&this.fail(`unbound namespace prefix: "${a}"`);let s=new Set;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e)||e===`xmlns`||e.startsWith(`xmlns:`))continue;let[t,n]=this.splitQName(e);if(n.includes(`:`)&&this.fail(`invalid attribute QName "${e}": local part must not contain ":"`),t!==``){let e=this.resolveNs(t);e===``&&this.fail(`unbound namespace prefix on attribute: "${t}"`);let r=e+`\0`+n;s.has(r)&&this.fail(`duplicate attribute by expanded name: {${e}}${n}`),s.add(r)}}}openTag(){let e=this.tag;e.isSelfClosing=!1;for(let{name:t,value:n}of this.attribList)t in e.attributes&&this.fail(`duplicate attribute: ${t}`),e.attributes[t]=n;this.attribList=[],this.xmlns&&this.applyNamespaces(e),this.maxDepth>0&&this.tags.length>=this.maxDepth&&this.fail(`maximum element nesting depth (${this.maxDepth}) exceeded`),this._handlers.opentag?.(e),this.tags.push(e),this.name=``,this.state=0}openSelfClosingTag(){let e=this.tag;e.isSelfClosing=!0;for(let{name:t,value:n}of this.attribList)t in e.attributes&&this.fail(`duplicate attribute: ${t}`),e.attributes[t]=n;this.attribList=[],this.xmlns&&this.applyNamespaces(e),this.maxDepth>0&&this.tags.length>=this.maxDepth&&this.fail(`maximum element nesting depth (${this.maxDepth}) exceeded`),this._handlers.opentag?.(e),this._handlers.closetag?.(e),this.xmlns&&this._nsStack.pop(),this.tags.length===0&&(this.closedRoot=!0),this.name=``,this.state=0}closeTag(){let{tags:e,name:t}=this;if(this.state=0,this.name=``,t===``){this.fail(`empty close tag`),this.text+=`</>`;return}let n=!1;for(let r=e.length-1;r>=0;r--)if(e[r].name===t){for(;e.length>r;){let t=e.pop();this._handlers.closetag?.(t),this.xmlns&&this._nsStack.pop(),e.length>r&&this.fail(`unclosed tag: `+t.name)}n=!0;break}n||(this.fail(`unmatched close tag: `+t),this.text+=`</`+t+`>`),e.length===0&&(this.closedRoot=!0)}end(){for(this.sawRoot||this.fail(`document must contain a root element`);this.tags.length>0;){let e=this.tags.pop();this.fail(`unclosed tag: `+e.name)}return this.text.length>0&&this._handlers.text&&(this._handlers.text(this.text),this.text=``),this._closed=!0,this._init(),this}};async function ac(e,t){let n=new TextDecoder(`utf-8`,{fatal:!0}),r,i=e._handlers?.error;e.on(`error`,e=>{r=e,i?.(e)});for await(let i of t){let t=typeof i==`string`?i:n.decode(i,{stream:!0});if(e.write(t),r)throw o(r)}let a=n.decode();if(a&&e.write(a),e.close(),r)throw o(r)}var oc=class extends D{constructor({workbook:e,id:t,iterator:n,options:r}){super(),this._hyperlinkCount=0,this.workbook=e,this.id=t,this.iterator=n,this.options=r}get count(){return this.hyperlinks?this._hyperlinkCount:0}each(e){let t=this.hyperlinks;if(t)for(let n in t)e(t[n],n)}async read(){let{iterator:e}=this,t=this.options.hyperlinks,n=t===`emit`,r=t===`cache`,i=null;if(r&&(this._hyperlinkCount=0,this.hyperlinks=i=Object.create(null)),!n&&!r){this.emit(`finished`);return}try{let t=new ic({position:!1,invalidCharHandling:`skip`}),r=new TextDecoder(`utf-8`,{fatal:!0});t.on(`opentag`,e=>{if(e.name!==`Relationship`)return;let t=e.attributes;if(t.Type!==F.Hyperlink)return;let r={type:7,rId:t.Id,target:t.Target,targetMode:t.TargetMode};if(n){this.emit(`hyperlink`,r);return}let a=r.rId;i&&i[a]===void 0&&(this._hyperlinkCount+=1),i[a]=r});for await(let n of e){let e=typeof n==`string`?n:r.decode(n,{stream:!0});t.write(e)}let a=r.decode();a&&t.write(a),t.close(),this.emit(`finished`)}catch(e){this.emit(`error`,e)}}};let sc=(e,t)=>({...e,...t.reduce((t,n)=>(e[n]&&(t[n]={...e[n]}),t),{})}),cc=(e,t,n,r=[])=>{e[n]&&(t[n]=sc(e[n],r))},lc=e=>Object.keys(e).length===0,L=e=>{if(!e)return e;if(lc(e))return{};let t={...e};return cc(e,t,`font`,[`color`]),cc(e,t,`alignment`),cc(e,t,`protection`),e.border&&(cc(e,t,`border`),cc(e.border,t.border,`top`,[`color`]),cc(e.border,t.border,`left`,[`color`]),cc(e.border,t.border,`bottom`,[`color`]),cc(e.border,t.border,`right`,[`color`]),cc(e.border,t.border,`diagonal`,[`color`])),e.fill&&(cc(e,t,`fill`,[`fgColor`,`bgColor`,`center`]),e.fill.stops&&(t.fill.stops=e.fill.stops.map(e=>sc(e,[`color`])))),t},uc={'"':`"`,"&":`&`,"<":`<`,">":`>`},dc=/["&<>]/g;function fc(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;let n=typeof e;if(n!==typeof t||n!==`object`)return!1;let r=Array.isArray(e);if(r!==Array.isArray(t))return!1;if(r){let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(!fc(e[r],t[r]))return!1;return!0}let i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(let n=0,r=i.length;n<r;n++){let r=i[n];if(!Object.prototype.hasOwnProperty.call(t,r)||!fc(e[r],t[r]))return!1}return!0}function pc(e){return e.replace(dc,e=>uc[e])}function mc(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function hc(...e){let t=e[0]||{},n=e.length;for(let r=1;r<n;r++){let n=e[r];if(n)if(Array.isArray(n))for(let e=0,r=n.length;e<r;e++){let r=n[e];if(r===void 0)continue;let i=t[e];Array.isArray(r)?t[e]=hc(Array.isArray(i)?i:[],r):mc(r)?t[e]=hc(mc(i)?i:{},r):t[e]=r}else{let e=Object.keys(n);for(let r=0,i=e.length;r<i;r++){let i=e[r];if(i===`__proto__`||i===`constructor`||i===`prototype`)continue;let a=n[i];if(a===void 0)continue;let o=t[i];Array.isArray(a)?t[i]=hc(Array.isArray(o)?o:[],a):mc(a)?t[i]=hc(mc(o)?o:{},a):t[i]=a}}}return t}var gc=class e{constructor(e,t,n){this._worksheet=e,this._number=t,n!==!1&&(this.defn=n)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return M.n2l(this._number)}get isCustomWidth(){return this.width!==void 0&&this.width!==9}get defn(){return{header:this._header,key:this.key,width:this.width,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel,bestFit:this.bestFit}}set defn(e){e?(this.key=e.key,this.width=e.width===void 0?9:e.width,this.outlineLevel=e.outlineLevel,e.style?this.style=L(e.style)??{}:this.style={},this.header=e.header,this._hidden=!!e.hidden,this.bestFit=e.bestFit):(delete this._header,delete this._key,delete this.width,this.style={},this.outlineLevel=0,delete this.bestFit)}get headers(){return Array.isArray(this._header)?this._header:this._header===void 0?[]:[this._header]}get header(){return this._header}set header(e){e===void 0?this._header=void 0:(this._header=e,this.headers.forEach((e,t)=>{this._worksheet.getCell(t+1,this.number).value=e}))}get key(){return this._key}set key(e){(this._key&&this._worksheet.getColumnKey(this._key))===this&&this._worksheet.deleteColumnKey(this._key),this._key=e,e&&this._worksheet.setColumnKey(e,this)}get hidden(){return!!this._hidden}set hidden(e){this._hidden=e}get outlineLevel(){return this._outlineLevel??0}set outlineLevel(e){this._outlineLevel=e}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=(this._worksheet.properties.outlineLevelCol??0))}toString(){return JSON.stringify({key:this.key,width:this.width,headers:this.headers.length?this.headers:void 0})}equivalentTo(e){return this.width===e.width&&this.hidden===e.hidden&&this.outlineLevel===e.outlineLevel&&fc(this.style,e.style)}equivalentToModel(e){return this.width===e.width&&this.hidden===e.hidden&&this.outlineLevel===e.outlineLevel&&this.bestFit===e.bestFit&&fc(this.style,e.style)}get isDefault(){if(this.isCustomWidth||this.hidden||this.outlineLevel||this.bestFit)return!1;let e=this.style;return!(e&&(e.font||e.numFmt||e.alignment||e.border||e.fill||e.protection))}get headerCount(){return this.headers.length}eachCell(e,t){let n=this.number,r,i;typeof e==`function`?(r={},i=e):(r=e,i=t),this._worksheet.eachRow(r,(e,t)=>{i(e.getCell(n),t)})}get values(){let e=[];return this.eachCell((t,n)=>{t&&t.type!==0&&(e[n]=t.value)}),e}set values(e){if(!e)return;let t=this.number,n=0;Object.prototype.hasOwnProperty.call(e,`0`)&&(n=1),e.forEach((e,r)=>{this._worksheet.getCell(r+n,t).value=e})}addPageBreak(e,t){let n=this._worksheet,r=Math.max(0,(e??0)-1)||0,i=Math.max(0,(t??0)-1)||1048575,a={id:this._number,max:i,man:1};r&&(a.min=r),n.colBreaks.push(a)}get numFmt(){return this.style.numFmt}set numFmt(e){this.style.numFmt=e,this.eachCell(t=>{t.numFmt=e})}get font(){return this.style.font}set font(e){this.style.font=e,this.eachCell(t=>{t.font=e&&structuredClone(e)})}get alignment(){return this.style.alignment}set alignment(e){this.style.alignment=e,this.eachCell(t=>{t.alignment=e&&structuredClone(e)})}get protection(){return this.style.protection}set protection(e){this.style.protection=e,this.eachCell(t=>{t.protection=e&&structuredClone(e)})}get border(){return this.style.border}set border(e){this.style.border=e,this.eachCell(t=>{t.border=e&&structuredClone(e)})}get fill(){return this.style.fill}set fill(e){this.style.fill=e,this.eachCell(t=>{t.fill=e&&structuredClone(e)})}static toModel(e){let t=[],n=null;return e.forEach((e,r)=>{e.isDefault?n&&=null:!n||!e.equivalentToModel(n)?(n={min:r+1,max:r+1,width:e.width===void 0?9:e.width,style:e.style,isCustomWidth:e.isCustomWidth,hidden:e.hidden,outlineLevel:e.outlineLevel,collapsed:e.collapsed,bestFit:e.bestFit},t.push(n)):n.max=r+1}),t.length?t:void 0}static fromModel(t,n){let r=t,i=Array.isArray(t)?t:n??[];i??=[];let a=[],o=1,s=0;for(i=i.sort((e,t)=>e.min-t.min);s<i.length;){let t=i[s++];for(;o<t.min;)a.push(new e(r,o++));for(;o<=t.max;)a.push(new e(r,o++,t))}return a}},_c=class e{static{this.DEFAULT_CONFIGS={note:{margins:{insetmode:`auto`,inset:[.13,.13,.25,.25]},protection:{locked:`True`,lockText:`True`},editAs:`absolute`},type:`note`}}constructor(e,t){this.note=e,this.author=t}get model(){let t;switch(typeof this.note){case`string`:t={type:`note`,note:{texts:[{text:this.note}]}};break;default:t={type:`note`,note:this.note??{}};break}let n=hc({},e.DEFAULT_CONFIGS,t);return this.author!==void 0&&(n.author=this.author),n}set model(e){let{note:t}=e,{texts:n}=t;n&&n.length===1&&Object.keys(n[0]).length===1?this.note=n[0].text:this.note=t,this.author=e.author}static fromModel(t){let n=new e;return n.model=t,n}};function vc(){return typeof process<`u`&&!!process.versions?.node}let yc={lt:`<`,gt:`>`,amp:`&`,quot:`"`,apos:`'`},bc=/&(#\d+|#[xX][0-9A-Fa-f]+|\w+);/g,xc=(()=>{let e=new Uint8Array(128);for(let t=0;t<=8;t++)e[t]=2;e[11]=2,e[12]=2;for(let t=14;t<=31;t++)e[t]=2;return e[127]=2,e[34]=1,e[38]=1,e[39]=1,e[60]=1,e[62]=1,e})(),Sc={34:`"`,38:`&`,39:`'`,60:`<`,62:`>`};function Cc(e){return e.indexOf(`&`)===-1?e:e.replace(bc,(e,t)=>{if(t[0]===`#`){let n=t[1]===`x`||t[1]===`X`?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Number.isNaN(n)||n<1||n>=55296&&n<=57343||n>1114111?e:String.fromCodePoint(n)}return yc[t]??e})}function R(e){let t=e.length,n=-1;for(let r=0;r<t;r++){let t=e.charCodeAt(r);if(t<128){if(xc[t]!==0){n=r;break}}else if(t>=55296&&t<=57343){if(t<=56319){let t=e.charCodeAt(r+1);if(t>=56320&&t<=57343){r++;continue}}n=r;break}else if(t===65534||t===65535){n=r;break}}if(n===-1)return e;let r=[],i=0;for(let a=n;a<t;a++){let t=e.charCodeAt(a);if(t<128){let n=xc[t];if(n===0)continue;i<a&&r.push(e.substring(i,a)),n===1&&r.push(Sc[t]),i=a+1}else if(t>=55296&&t<=56319){let t=e.charCodeAt(a+1);if(t>=56320&&t<=57343){a++;continue}i<a&&r.push(e.substring(i,a)),i=a+1}else (t>=56320&&t<=57343||t===65534||t===65535)&&(i<a&&r.push(e.substring(i,a)),i=a+1)}return i<t&&r.push(e.substring(i)),r.length===1?r[0]:r.join(``)}function wc(e){return R(e)}let Tc=/[\s<>"'/=&]/;function Ec(e){if(!e)throw new Gs(`XML name must not be empty`);if(Tc.test(e))throw new Gs(`Invalid XML name: contains forbidden character in "${e}"`);let t=e.charCodeAt(0);if(t>=48&&t<=57||t===45||t===46)throw new Gs(`Invalid XML name: "${e}" starts with forbidden character`)}function Dc(e){return`<![CDATA[`+e.split(`]]>`).join(`]]]]><![CDATA[>`)+`]]>`}function Oc(e){if(e.includes(`--`)||e.endsWith(`-`))throw new Gs(`Invalid comment: must not contain "--" or end with "-"`)}let z={version:`1.0`,encoding:`UTF-8`,standalone:`yes`};function kc(e){if(vc())return Buffer.from(e,`base64`);let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function Ac(e,t){return 25569+e.getTime()/(24*3600*1e3)-(t?1462:0)}function jc(e,t){let n=Math.round((e-25569+(t?1462:0))*24*3600*1e3);return new Date(n)}function Mc(e){return new Date(e.endsWith(`Z`)?e:e+`Z`)}let Nc=/_x([0-9A-Fa-f]{4})_/g;function Pc(e){return e.replace(Nc,(e,t)=>{let n=parseInt(t,16);return n===0||n>=1&&n<=8||n===11||n===12||n>=14&&n<=31||n===127||n>=55296&&n<=57343||n===65534||n===65535?e:String.fromCharCode(n)})}function Fc(e){return e.replace(Nc,`_x005F_x$1_`)}let Ic=/[\t\n\r]/g,Lc={" ":`_x0009_`,"\n":`_x000A_`,"\r":`_x000D_`};function Rc(e){let t=e.replace(Nc,`_x005F_x$1_`);return t=t.replace(Ic,e=>Lc[e]),t}function zc(e){let t=typeof e==`number`?e:parseInt(e,10);return Number.isNaN(t)?0:t}function Bc(e){let t=[],n=``,r=!1,i=!1;for(let a=0;a<e.length;a++){let o=e[a];o===`"`&&!i?(r=!r,n+=o):o===`[`&&!r?(i=!0,n+=o):o===`]`&&!r?(i=!1,n+=o):o===`;`&&!r&&!i?(t.push(n),n=``):n+=o}return t.push(n),t}let Vc=/[ymdhMsb]/,Hc=/\[[^\]]*\]|"[^"]*"/g,Uc=new Map;function Wc(e){if(!e)return!1;let t=Uc.get(e);if(t!==void 0)return t;let n=Bc(e)[0].replace(Hc,``),r;return r=n.indexOf(`@`)>-1?!1:Vc.test(n),Uc.set(e,r),r}function Gc(e){return e===!0||e===`true`||e===1||e===`1`}function*Kc(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 qc(e){let t=Array.from(e);return t.length<=1?t:t.every(e=>Number.isFinite(e))?t.sort((e,t)=>e-t):t.every(e=>e instanceof Date)?t.sort((e,t)=>e.getTime()-t.getTime()):t.sort((e,t)=>{let n=Jc(e),r=Jc(t);return n===r?n===0?e-t:n===1?e.getTime()-t.getTime():String(e).localeCompare(String(t)):n-r})}function Jc(e){return Number.isFinite(e)?0:e instanceof Date?1:2}let Yc=new TextDecoder(`utf-8`),Xc,Zc=!1;function Qc(){if(!Zc){Zc=!0;try{Xc=new TextDecoder(`latin1`)}catch{Xc=void 0}}return Xc}function $c(e){return typeof e==`string`?e:Yc.decode(e)}function el(e){if(vc())return Buffer.from(e).toString(`base64`);if(Qc())try{return btoa(Xc.decode(e))}catch{}let t=32768,n=[];for(let r=0;r<e.length;r+=t)n.push(String.fromCharCode.apply(null,e.subarray(r,r+t)));return btoa(n.join(``))}function tl(e){let t=new Uint8Array(e.length*2);for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[n*2]=r&255,t[n*2+1]=r>>8&255}return t}function nl(){return new Promise(e=>setTimeout(e,0))}function rl(e,t){let n=Math.round(e).toString();for(;n.length<t;)n=`0`+n;return n}function il(e){if(e.length<=3)return e;let t=e.length%3,n=e.substring(0,t);for(let r=t;r<e.length;r+=3)n+=(n.length>0?`,`:``)+e.substring(r,r+3);return n}function al(e,t){let n=10**t;return Math.round(e*n)/n}function ol(e){let t=e.replace(/_./g,` `);return t=t.replace(/\*./g,``),t}function sl(e){return/^General$/i.test(e.trim())}function cl(e){let t=e.replace(/\[[^\]]*\]/g,``);return/[ymdhs]/i.test(t)&&!/^[#0.,E%$\s()\-+]+$/i.test(t)}let ll=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],ul=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],dl=[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],fl=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],pl=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];function ml(e){let t=/\x00(?:Y[24]|D[12]|MN[345])\x00/,n=/\x00H[12]\x00/g,r=/\x00S[12]\x00/g,i=``,a=e,o=a.search(/mm/i);for(;o!==-1;){let e=a.slice(0,o),s=a.slice(o+2),c=-1,l;for(n.lastIndex=0;(l=n.exec(e))!==null;)c=l.index;r.lastIndex=0;let u=r.exec(s),d=u?u.index:-1,f=c!==-1&&!t.test(e.slice(c)),p=d!==-1&&!t.test(s.slice(0,d));i+=e+(f||p?`\0MI2\0`:`\0M2\0`),a=s,o=a.search(/mm/i)}return i+=a,i}function hl(e,t){let n=Math.round(e*86400)%86400,r=Math.floor(n/3600),i=Math.floor(n%3600/60),a=n%60,o=jc(e,!1),s=o.getUTCFullYear(),c=o.getUTCMonth(),l=o.getUTCDate(),u=o.getUTCDay(),d=e*86400-Math.floor(e*86400),f=/AM\/PM|A\/P/i.test(t),p=r>=12,m=r%12||12,h=t.replace(/\[(Red|Green|Blue|Yellow|Magenta|Cyan|White|Black|Color\d+)\]/gi,``);h=ol(h);let g=h.match(/ss\.(0+)/i),_=``;if(g){let e=g[1].length;_=Math.round(d*10**e).toString().padStart(e,`0`),h=h.replace(/ss\.0+/gi,`\0SF\0`)}h=h.replace(/yyyy/gi,`\0Y4\0`),h=h.replace(/yy/gi,`\0Y2\0`),h=h.replace(/mmmmm/gi,`\0MN5\0`),h=h.replace(/mmmm/gi,`\0MN4\0`),h=h.replace(/mmm/gi,`\0MN3\0`),h=h.replace(/dddd/gi,`\0DN4\0`),h=h.replace(/ddd/gi,`\0DN3\0`),h=h.replace(/dd/gi,`\0D2\0`),h=h.replace(/\bd\b/gi,`\0D1\0`),h=h.replace(/hh/gi,`\0H2\0`),h=h.replace(/\bh\b/gi,`\0H1\0`),h=h.replace(/ss/gi,`\0S2\0`),h=h.replace(/\bs\b/gi,`\0S1\0`),h=ml(h),h=h.replace(/\bm\b/gi,`\0M1\0`),h=h.replace(/AM\/PM/gi,`\0AMPM\0`),h=h.replace(/A\/P/gi,`\0AP\0`);let v=f?m:r;return h=h.replace(/\x00Y4\x00/g,s.toString()).replace(/\x00Y2\x00/g,(s%100).toString().padStart(2,`0`)).replace(/\x00MN5\x00/g,dl[c]).replace(/\x00MN4\x00/g,ul[c]).replace(/\x00MN3\x00/g,ll[c]).replace(/\x00M2\x00/g,(c+1).toString().padStart(2,`0`)).replace(/\x00M1\x00/g,(c+1).toString()).replace(/\x00DN4\x00/g,pl[u]).replace(/\x00DN3\x00/g,fl[u]).replace(/\x00D2\x00/g,l.toString().padStart(2,`0`)).replace(/\x00D1\x00/g,l.toString()).replace(/\x00H2\x00/g,v.toString().padStart(2,`0`)).replace(/\x00H1\x00/g,v.toString()).replace(/\x00MI2\x00/g,i.toString().padStart(2,`0`)).replace(/\x00S2\x00/g,a.toString().padStart(2,`0`)).replace(/\x00S1\x00/g,a.toString()).replace(/\x00SF\x00/g,a.toString().padStart(2,`0`)+`.`+_).replace(/\x00AMPM\x00/g,p?`PM`:`AM`).replace(/\x00AP\x00/g,p?`P`:`A`),h=h.replace(/\\/g,``),h}function gl(e){return typeof e==`boolean`?e?`TRUE`:`FALSE`:typeof e==`string`?e:Number.isInteger(e)?e.toString():e.toPrecision(11).replace(/\.?0+$/,``).replace(/\.?0+e/,`e`)}function _l(e,t){let n=(t.match(/%/g)??[]).length;return Sl(e*100**n,t.replace(/%/g,``)||`0`)+`%`.repeat(n)}function vl(e,t){let n=e<0?`-`:``,r=Math.abs(e);if(r===0){let e=t.match(/\.([0#]+)E/i),n=e?e[1].length:2;return`0.`+`0`.repeat(n)+`E+00`}let i=t.match(/\.([0#]+)E/i),a=i?i[1].length:2,o=t.includes(`E+`),s=Math.floor(Math.log10(r)),c=al(r/10**s,a).toFixed(a),l=s>=0?o?`+`:``:`-`,u=rl(Math.abs(s),2);return n+c+`E`+l+u}function yl(e,t){let n=e<0?-1:1,r=Math.abs(e),i=Math.floor(r);if(r-=i,r<1e-10)return[n*i,0,1];let a=0,o=1,s=1,c=0,l=Math.floor(r),u=l,d=1;for(;c<t&&(l=Math.floor(r),u=l*o+a,d=l*c+s,!(r-l<1e-10));)r=1/(r-l),a=o,o=u,s=c,c=d;return d>t&&(d=c,u=o),[n*i,n*u,d]}function bl(e,t){let n=e<0?`-`:``,r=Math.abs(e),i=t.match(/\?+\s*\/\s*(\d+)/);if(i){let e=parseInt(i[1],10),a=Math.floor(r),o=r-a,s=Math.round(o*e);return t.includes(`#`)||t.includes(`0`)?s===0?n+a.toString():n+(a>0?a+` `:``)+s+`/`+e:n+(a*e+s)+`/`+e}let a=t.match(/\/\s*(\?+)/),[o,s,c]=yl(r,10**(a?a[1].length:2)-1);return t.includes(`#`)&&o!==0?s===0?n+Math.abs(o).toString():n+Math.abs(o)+` `+Math.abs(s)+`/`+c:s===0?o===0?`0`:n+Math.abs(o).toString():n+(Math.abs(o)*c+Math.abs(s))+`/`+c}function xl(e,t){let n=Math.round(e*86400),r=Math.floor(n/60),i=Math.floor(r/60),a=n%60,o=r%60,s=i,c=t;return/\[h+\]/i.test(c)&&(c=c.replace(/\[h+\]/gi,s.toString())),/\[m+\]/i.test(c)&&(c=c.replace(/\[m+\]/gi,r.toString())),/\[s+\]/i.test(c)&&(c=c.replace(/\[s+\]/gi,n.toString())),c=c.replace(/mm/gi,o.toString().padStart(2,`0`)),c=c.replace(/ss/gi,a.toString().padStart(2,`0`)),c}function Sl(e,t){let n=Math.abs(e),r=e<0?`-`:``,i=0,a=t;for(;a.endsWith(`,`);)i++,a=a.slice(0,-1);let o=n/1e3**i,s=a.indexOf(`.`),c=a,l=``;s!==-1&&(c=a.substring(0,s),l=a.substring(s+1));let u=l.replace(/[^0#?]/g,``).length,d=al(o,u);if(d===0&&!c.includes(`0`)&&!l.includes(`0`)){let e=``;for(let t of c)t===`?`?e+=` `:t!==`#`&&t!==`,`&&(e+=t);if(u>0&&/[0?]/.test(l)){e+=`.`;for(let t of l)t===`?`&&(e+=` `)}return r+e}let[f,p=``]=d.toString().split(`.`),m=/[0#?][^0#?,.\s][0#?]/.test(c),h;if(m){let e=c.replace(/[^0#?]/g,``).length,t=f;t.length<e&&(t=`0`.repeat(e-t.length)+t),h=``;let n=t.length-e;for(let e=0;e<c.length;e++){let r=c[e];r===`0`||r===`#`||r===`?`?n<t.length&&(h+=t[n],n++):r!==`,`&&(h+=r)}}else{h=f,c.includes(`,`)&&(h=il(f));let e=(c.match(/0/g)??[]).length,t=(c.match(/[0?]/g)??[]).length;h.length<e&&(h=`0`.repeat(e-h.length)+h),h.length<t&&(h=` `.repeat(t-h.length)+h),h===`0`&&e===0&&t===0&&(h=``)}let g=``;if(u>0){let e=(p+`0`.repeat(u)).substring(0,u).split(``);for(let t=l.length-1;t>=0;t--)if(!(t>=e.length))if(l[t]===`#`&&e[t]===`0`)e[t]=``;else if(l[t]===`?`&&e[t]===`0`)e[t]=` `;else break;let t=e.join(``);t.length>0&&(g=`.`+t)}return r+h+g}function Cl(e){let t=``,n=0;for(;n<e.length;)if(e[n]===`"`){for(n++;n<e.length&&e[n]!==`"`;)t+=e[n],n++;n++}else e[n]===`\\`&&n+1<e.length?(n++,t+=e[n],n++):(t+=e[n],n++);return t}function wl(e,t){let n=t.match(/\[(=|>|<|>=|<=|<>)(-?\d+(?:\.\d*)?)\]/);if(!n)return!1;let r=n[1],i=parseFloat(n[2]);switch(r){case`=`:return e===i;case`>`:return e>i;case`<`:return e<i;case`>=`:return e>=i;case`<=`:return e<=i;case`<>`:return e!==i;default:return!1}}function Tl(e,t){if(typeof t==`string`){let n=Bc(e);return n.length>=4&&n[3]?Cl(n[3]).replace(/@/g,t):t}if(typeof t==`boolean`)return t?`TRUE`:`FALSE`;let n=Bc(e),r=/\[(=|>|<|>=|<=|<>)-?\d+(?:\.\d*)?\]/;if((n[0]&&r.test(n[0])||n[1]&&r.test(n[1]))&&n.length>=2){for(let e=0;e<Math.min(n.length,2);e++){let r=n[e].match(/\[(=|>|<|>=|<=|<>)-?\d+(?:\.\d*)?\]/);if(r&&wl(t,r[0]))return n[e]}return n[n.length>2?2:1]}return n.length===1?n[0]:n.length===2?t>=0?n[0]:n[1]:t>0?n[0]:t<0?n[1]:n[2]||n[0]}function El(e,t){let n=Bc(e);return n.length>=2&&n[1]===t}function Dl(e,t){if(t==null)return``;if(sl(e))return gl(t);if(typeof t==`string`)return Tl(e,t);if(typeof t==`boolean`)return t?`TRUE`:`FALSE`;let n=t,r=Tl(e,n);n<0&&El(e,r)&&(n=Math.abs(n));let i=r.replace(/\[(Red|Green|Blue|Yellow|Magenta|Cyan|White|Black|Color\d+)\]/gi,``);if(i=i.replace(/\[(>|<|>=|<=|=|<>)-?\d+(\.\d+)?\]/g,``),i=i.replace(/\[\$[^\]]*\]/g,``),i=ol(i),i=Cl(i),/\[[hms]+\]/i.test(i))return xl(n,i);if(cl(i))return hl(n,i);if(i.includes(`%`))return _l(n,i);if(/E[+-]?/i.test(i))return vl(n,i);if(/\?+\s*\/\s*[\d?]+/.test(i))return bl(n,i);if(i.includes(`(`)&&i.includes(`)`)&&n<0){let e=i.replace(/\(|\)/g,``);return`(`+Sl(-n,e)+`)`}if(i===`@`)return n.toString();let a=``,o=``,s=i.match(/^([^#0?.,]+)/);s&&(a=s[1],i=i.substring(s[0].length));let c=i.match(/([^#0?.,]+)$/);c&&!c[1].includes(`%`)&&(o=c[1],i=i.substring(0,i.length-c[0].length));let l=Sl(n,i);return a+l+o}function Ol(e){let t=e.replace(/"[^"]*"/g,``);if(/\[[hms]\]/i.test(t))return!1;let n=t.replace(/\[[^\]]*\]/g,``),r=/[hs]/i.test(n)||/AM\/PM|A\/P/i.test(n);return/[yd]/i.test(n)||/m/i.test(n)&&!r?!1:r}function kl(e){let t=e.replace(/"[^"]*"/g,``);if(/\[[hms]\]/i.test(t))return!1;let n=t.replace(/\[[^\]]*\]/g,``);return!!(/[yd]/i.test(n)||/m/i.test(n)&&!(/[hs]/i.test(n)||/AM\/PM|A\/P/i.test(n)))}function Al(e,t,n){if(e instanceof Date){let r=Ac(e);if(Ol(t))return r%=1,r<0&&(r+=1),Dl(t,r);let i;return i=n&&kl(t)?n:!t||sl(t)?r%1==0?`yyyy-mm-dd`:`yyyy-mm-dd hh:mm:ss`:t,Dl(i,r)}return Dl(t,e)}function jl(e,t){let n=e.value,r=e.numFmt,i=typeof r==`string`?r:r?.formatCode??`General`;if(n==null)return``;if(n instanceof Date||typeof n==`number`||typeof n==`boolean`||typeof n==`string`)return Al(n,i,t);if(typeof n==`object`&&`formula`in n){let e=n.result;if(e==null)return``;if(e instanceof Date||typeof e==`number`||typeof e==`boolean`||typeof e==`string`)return Al(e,i,t)}return e.text}let Ml=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,Nl=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;function Pl(e,t,n){let r=M.decode(t),i=M.decode(n);return e.replace(Ml,(e,t,n,a,o)=>{if(o)return e;let s=Nl.exec(a);if(s){let n=s[1],a=s[2].toUpperCase(),o=s[3],c=s[4];if(a.length>3||a.length===3&&a>`XFD`)return e;let l=M.l2n(a),u=parseInt(c,10);return n||(l+=i.col-r.col),o||(u+=i.row-r.row),(t??``)+(n??``)+M.n2l(l)+(o??``)+u}return e})}let Fl=e=>!!e&&(typeof e!=`object`||Object.keys(e).length>0);function Il(e){let t=``;for(let n of e)n&&typeof n.text==`string`&&(t+=n.text);return t}function Ll(e){let t,n;Array.isArray(e.richText)&&e.richText.length>0?(n=e.richText,t=Il(n)):t=typeof e.text==`string`?e.text:``;let r={text:t,hyperlink:typeof e.hyperlink==`string`?e.hyperlink:``};return n&&(r.richText=n),typeof e.tooltip==`string`&&e.tooltip.length>0&&(r.tooltip=e.tooltip),r}var B=class e{static{this.Types=Ws.ValueType}constructor(t,n,r){if(!t||!n)throw new j(`A Cell needs a Row`);this._row=t,this._column=n,M.validateAddress(r),this._address=r,this._value=Zl.create(e.Types.Null,this),this.style=this._mergeStyle(t.style,n.style,{}),this._mergeCount=0}get worksheet(){return this._row.worksheet}get workbook(){return this._row.worksheet.workbook}destroy(){this.style=void 0,this._value=void 0,this._row=void 0,this._column=void 0,this._address=void 0}get numFmt(){return this.style.numFmt}set numFmt(e){this.style.numFmt=e}get font(){return this.style.font}set font(e){this.style.font=e}get alignment(){return this.style.alignment}set alignment(e){this.style.alignment=e}get border(){return this.style.border}set border(e){this.style.border=e}get fill(){return this.style.fill}set fill(e){this.style.fill=e}get protection(){return this.style.protection}set protection(e){this.style.protection=e}_mergeStyle(e,t,n){let r=e&&e.numFmt||t&&t.numFmt;r&&(n.numFmt=r);let i=e&&Fl(e.font)&&e.font||t&&Fl(t.font)&&t.font;i&&(n.font=structuredClone(i));let a=e&&Fl(e.alignment)&&e.alignment||t&&Fl(t.alignment)&&t.alignment;a&&(n.alignment=structuredClone(a));let o=e&&Fl(e.border)&&e.border||t&&Fl(t.border)&&t.border;o&&(n.border=structuredClone(o));let s=e&&Fl(e.fill)&&e.fill||t&&Fl(t.fill)&&t.fill;s&&(n.fill=structuredClone(s));let c=e&&Fl(e.protection)&&e.protection||t&&Fl(t.protection)&&t.protection;return c&&(n.protection=structuredClone(c)),n}get address(){return this._address}get row(){return this._row.number}get col(){return this._column.number}get $col$row(){return`$${this._column.letter}$${this.row}`}get type(){return this._value.type}get effectiveType(){return this._value.effectiveType}toCsvString(){return this._value.toCsvString()}addMergeRef(){this._mergeCount++}releaseMergeRef(){this._mergeCount--}get isMerged(){return this._mergeCount>0||this.type===e.Types.Merge}merge(t,n){this._value.release(),this._value=Zl.create(e.Types.Merge,this,t),n||(this.style=L(t.style)??{})}unmerge(){this.type===e.Types.Merge&&(this._value.release(),this._value=Zl.create(e.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{...this.style}))}isMergedTo(t){return this._value.type===e.Types.Merge&&this._value.isMergedTo?this._value.isMergedTo(t):!1}get master(){return this.type===e.Types.Merge?this._value.master:this}get isHyperlink(){return this._value.type===e.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value(t){if(this.type===e.Types.Merge){this._value.master.value=t;return}this._value.release(),this._value=Zl.create(Zl.getType(t),this,t)}get note(){if(this._comment)return this._comment.note}set note(e){this._comment=new _c(e)}get comment(){return this._comment}set comment(e){e===void 0?this._comment=void 0:e instanceof _c?this._comment=e:this._comment=new _c(e)}get text(){return this._value.toString()}get displayText(){return jl(this)}get html(){return pc(this.text)}toString(){return this.text}_upgradeToHyperlink(t){switch(this.type){case e.Types.String:this._value=Zl.create(e.Types.Hyperlink,this,{text:String(this._value.value),hyperlink:t});break;case e.Types.RichText:{let n=this._value.value,r=n&&Array.isArray(n.richText)?n.richText:[];this._value=Zl.create(e.Types.Hyperlink,this,{text:Il(r),richText:r.length>0?r:void 0,hyperlink:t});break}default:break}}get formula(){return this._value.formula}get result(){return this._value.result}set result(t){this.type===e.Types.Formula&&(this._value.result=t)}get formulaType(){return this._value.formulaType??0}get fullAddress(){let{worksheet:e}=this._row;return{sheetName:e.name,address:this.address,row:this.row,col:this.col}}get name(){return this.names[0]}set name(e){this.names=[e]}get names(){return this.workbook.definedNames.getNamesEx(this.fullAddress)}set names(e){let{definedNames:t}=this.workbook;t.removeAllNames(this.fullAddress),e.forEach(e=>{t.addEx(this.fullAddress,e)})}addName(e){this.workbook.definedNames.addEx(this.fullAddress,e)}removeName(e){this.workbook.definedNames.removeEx(this.fullAddress,e)}removeAllNames(){this.workbook.definedNames.removeAllNames(this.fullAddress)}get _dataValidations(){return this.worksheet.dataValidations}get dataValidation(){return this._dataValidations.find(this.address)}set dataValidation(e){this._dataValidations.add(this.address,e)}get model(){let{model:e}=this._value;return e.style=this.style,this._comment&&(e.comment=this._comment.model),e}set model(e){if(this._value.release(),this._value=Zl.create(e.type,this),this._value.model=e,e.comment)switch(e.comment.type){case`note`:this._comment=_c.fromModel(e.comment);break}e.style?this.style=L(e.style)??{}:this.style={}}},Rl=class{constructor(e){this.model={address:e.address,type:B.Types.Null}}get value(){return null}set value(e){}get type(){return B.Types.Null}get effectiveType(){return B.Types.Null}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return``}release(){}toString(){return``}},zl=class{constructor(e,t){this.model={address:e.address,type:B.Types.Number,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return B.Types.Number}get effectiveType(){return B.Types.Number}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}},Bl=class{constructor(e,t){this.model={address:e.address,type:B.Types.String,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return B.Types.String}get effectiveType(){return B.Types.String}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return`"${this.model.value.replace(/"/g,`""`)}"`}release(){}toString(){return this.model.value}},Vl=class{constructor(e,t){this.model={address:e.address,type:B.Types.String,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}toString(){return this.model.value.richText.map(e=>e.text).join(``)}get type(){return B.Types.RichText}get effectiveType(){return B.Types.RichText}get address(){return this.model.address}set address(e){this.model.address=e}get text(){return this.toString()}toCsvString(){return`"${this.text.replace(/"/g,`""`)}"`}release(){}},Hl=class{constructor(e,t){this.model={address:e.address,type:B.Types.Date,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return B.Types.Date}get effectiveType(){return B.Types.Date}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}},Ul=class{constructor(e,t){if(this.model={address:e.address,type:B.Types.Hyperlink},t){if(`formula`in t&&typeof t.formula==`string`){let e=t,n=e.result===void 0||e.result===null?``:String(e.result);this.model.text=n,this.model.hyperlink=e.hyperlink??``,e.tooltip!==void 0&&(this.model.tooltip=e.tooltip),this.model.formula=e.formula,e.result!==void 0&&(this.model.result=e.result);return}let e=Ll(t);this.model.text=e.text,this.model.hyperlink=e.hyperlink,e.richText&&(this.model.richText=e.richText),e.tooltip!==void 0&&(this.model.tooltip=e.tooltip)}}get value(){let e={text:this.model.text??``,hyperlink:this.model.hyperlink??``};return this.model.richText&&this.model.richText.length>0&&(e.richText=this.model.richText),this.model.tooltip!==void 0&&(e.tooltip=this.model.tooltip),e}set value(e){let t=Ll(e);this.model.text=t.text,this.model.hyperlink=t.hyperlink,t.richText?this.model.richText=t.richText:delete this.model.richText,t.tooltip===void 0?delete this.model.tooltip:this.model.tooltip=t.tooltip}get text(){return this.model.text}set text(e){this.model.richText&&delete this.model.richText,this.model.text=e}get richText(){return this.model.richText}set richText(e){Array.isArray(e)&&e.length>0?(this.model.richText=e,this.model.text=Il(e)):delete this.model.richText}get hyperlink(){return this.model.hyperlink}set hyperlink(e){this.model.hyperlink=e}get type(){return B.Types.Hyperlink}get effectiveType(){return B.Types.Hyperlink}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.hyperlink??``}release(){}toString(){return this.model.text??``}},Wl=class{constructor(e,t){this.model={address:e.address,type:B.Types.Merge,master:t?t.address:void 0},this._master=t,t&&t.addMergeRef()}get value(){return this._master.value}set value(e){e instanceof B?(this._master&&this._master.releaseMergeRef(),e.addMergeRef(),this._master=e):this._master.value=e}isMergedTo(e){return e===this._master}get master(){return this._master}get type(){return B.Types.Merge}get effectiveType(){return this._master.effectiveType}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return``}release(){this._master.releaseMergeRef()}toString(){return this.value==null?``:this.value.toString()}},Gl=class{constructor(e,t){this.cell=e,this.model={address:e.address,type:B.Types.Formula,shareType:t?t.shareType:void 0,ref:t?t.ref:void 0,formula:t?t.formula:void 0,sharedFormula:t?t.sharedFormula:void 0,result:t?t.result:void 0,isDynamicArray:t?t.isDynamicArray:void 0}}_copyModel(e){let t={};return e.formula&&(t.formula=e.formula),e.result!==void 0&&(t.result=e.result),e.ref&&(t.ref=e.ref),e.shareType&&(t.shareType=e.shareType),e.sharedFormula&&(t.sharedFormula=e.sharedFormula),e.isDynamicArray&&(t.isDynamicArray=e.isDynamicArray),t}get value(){return this._copyModel(this.model)}set value(e){e.formula&&(this.model.formula=e.formula),e.result!==void 0&&(this.model.result=e.result),e.ref&&(this.model.ref=e.ref),e.shareType&&(this.model.shareType=e.shareType),e.sharedFormula&&(this.model.sharedFormula=e.sharedFormula),e.isDynamicArray!==void 0&&(this.model.isDynamicArray=e.isDynamicArray)}validate(e){switch(Zl.getType(e)){case B.Types.Null:case B.Types.String:case B.Types.Number:case B.Types.Date:break;case B.Types.Hyperlink:case B.Types.Formula:default:throw new Ar(String(Zl.getType(e)),`Cannot process that type of result value`)}}get dependencies(){return{ranges:this.formula.match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g),cells:this.formula.replace(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g,``).match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}/g)}}get formula(){return this.model.formula||this._getTranslatedFormula()||``}set formula(e){this.model.formula=e}get formulaType(){return this.model.formula?1:this.model.sharedFormula?2:0}get result(){return this.model.result}set result(e){this.model.result=e}get type(){return B.Types.Formula}get effectiveType(){let e=this.model.result;return e==null?0:typeof e==`string`?3:typeof e==`number`?2:e instanceof Date?4:typeof e==`object`&&`error`in e?10:0}get address(){return this.model.address}set address(e){this.model.address=e}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){let{worksheet:e}=this.cell,t=e.findCell(this.model.sharedFormula);this._translatedFormula=t&&t.formula?Pl(t.formula,t.address,this.model.address):void 0}return this._translatedFormula}toCsvString(){return`${this.model.result??``}`}release(){}toString(){return this.model.result?this.model.result.toString():``}},Kl=class{constructor(e,t){this.model={address:e.address,type:B.Types.SharedString,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return B.Types.SharedString}get effectiveType(){return B.Types.SharedString}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}},ql=class{constructor(e,t){this.model={address:e.address,type:B.Types.Boolean,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return B.Types.Boolean}get effectiveType(){return B.Types.Boolean}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return+!!this.model.value}release(){}toString(){return this.model.value.toString()}},Jl=class{constructor(e,t){this.model={address:e.address,type:B.Types.Checkbox,value:t.checkbox}}get value(){return{checkbox:this.model.value}}set value(e){this.model.value=e.checkbox}get type(){return B.Types.Checkbox}get effectiveType(){return B.Types.Boolean}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return+!!this.model.value}release(){}toString(){return this.model.value.toString()}},Yl=class{constructor(e,t){this.model={address:e.address,type:B.Types.Error,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return B.Types.Error}get effectiveType(){return B.Types.Error}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}},Xl=class{constructor(e,t){this.model={address:e.address,type:B.Types.String,value:JSON.stringify(t),rawValue:t}}get value(){return this.model.rawValue}set value(e){this.model.rawValue=e,this.model.value=JSON.stringify(e)}get type(){return B.Types.String}get effectiveType(){return B.Types.String}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}};let Zl={getType(e){if(e==null)return B.Types.Null;if(typeof e==`string`)return B.Types.String;if(typeof e==`number`)return B.Types.Number;if(typeof e==`boolean`)return B.Types.Boolean;if(e instanceof Date)return B.Types.Date;if(typeof e==`object`){if(`checkbox`in e&&typeof e.checkbox==`boolean`)return B.Types.Checkbox;if(`hyperlink`in e&&typeof e.hyperlink==`string`&&e.hyperlink){let t=`text`in e&&typeof e.text==`string`&&e.text.length>0,n=`richText`in e&&Array.isArray(e.richText)&&e.richText.length>0,r=`formula`in e&&typeof e.formula==`string`;if(t||n||r)return B.Types.Hyperlink}if(`formula`in e&&e.formula||`sharedFormula`in e&&e.sharedFormula)return B.Types.Formula;if(`richText`in e&&Array.isArray(e.richText)&&e.richText.length>0)return B.Types.RichText;if(`sharedString`in e&&e.sharedString)return B.Types.SharedString;if(`error`in e&&e.error)return B.Types.Error}return B.Types.JSON},types:[{t:B.Types.Null,f:Rl},{t:B.Types.Number,f:zl},{t:B.Types.String,f:Bl},{t:B.Types.Date,f:Hl},{t:B.Types.Hyperlink,f:Ul},{t:B.Types.Formula,f:Gl},{t:B.Types.Merge,f:Wl},{t:B.Types.JSON,f:Xl},{t:B.Types.SharedString,f:Kl},{t:B.Types.RichText,f:Vl},{t:B.Types.Boolean,f:ql},{t:B.Types.Error,f:Yl},{t:B.Types.Checkbox,f:Jl}].reduce((e,t)=>(e[t.t]=t.f,e),[]),create(e,t,n){let r=this.types[e];if(!r)throw new Ar(String(e),`Could not create Value`);return new r(t,n)}};var Ql=class{constructor(e,t){this._worksheet=e,this._number=t,this._cells=[],this.style={},this.outlineLevel=0}get number(){return this._number}get worksheet(){return this._worksheet}commit(){this._worksheet._commitRow(this)}destroy(){this._worksheet=void 0,this._cells=void 0,this.style=void 0}findCell(e){return this._cells[e-1]}getCellEx(e){let t=this._cells[e.col-1];if(!t){let n=this._worksheet.getColumn(e.col);t=new B(this,n,e.address),this._cells[e.col-1]=t}return t}getCell(e){let t;if(typeof e==`string`){let n=this._worksheet.getColumnKey(e);t=n?n.number:M.l2n(e)}else t=e;return this._cells[t-1]||this.getCellEx({address:M.encodeAddress(this._number,t),row:this._number,col:t})}splice(e,t,...n){let r=e+t,i=n.length-t,a=this._cells.length,o,s,c;if(i<0)for(o=e+n.length;o<=a;o++)c=this._cells[o-1],s=this._cells[o-i-1],s?(c=this.getCell(o),c.value=s.value,c.style=L(s.style)??{},c.comment=s.comment):c&&(c.value=null,c.style={},c.comment=void 0);else if(i>0)for(o=a;o>=r;o--)s=this._cells[o-1],s?(c=this.getCell(o+i),c.value=s.value,c.style=L(s.style)??{},c.comment=s.comment):this._cells[o+i-1]=void 0;for(o=0;o<n.length;o++)c=this.getCell(e+o),c.value=n[o],c.style={},c.comment=void 0}eachCell(e,t){let n=null,r;if(typeof e==`function`?r=e:(n=e,r=t),n&&n.includeEmpty){let e=this._cells.length;for(let t=1;t<=e;t++)r(this.getCell(t),t)}else this._cells.forEach((e,t)=>{e&&e.type!==0&&r(e,t+1)})}addPageBreak(e,t){let n=this._worksheet,r=Math.max(0,(e??0)-1)||0,i=Math.max(0,(t??0)-1)||16838,a={id:this._number,max:i,man:1};r&&(a.min=r),n.rowBreaks.push(a)}get values(){let e=[];return this._cells.forEach(t=>{t&&t.type!==0&&(e[t.col]=t.value)}),e}set values(e){if(this._cells=[],e)if(e instanceof Array){let t=0;Object.prototype.hasOwnProperty.call(e,`0`)&&(t=1),e.forEach((e,n)=>{e!==void 0&&(this.getCellEx({address:M.encodeAddress(this._number,n+t),row:this._number,col:n+t}).value=e)})}else this._worksheet.eachColumnKey((t,n)=>{e[n]!==void 0&&(this.getCellEx({address:M.encodeAddress(this._number,t.number),row:this._number,col:t.number}).value=e[n])})}getValues(){let e=[];return this._cells.forEach(t=>{t&&t.type!==0&&(e[t.col-1]=t.value)}),e}valuesToString(e=`,`){return this.getValues().join(e)}get hasValues(){return this._cells.some(e=>e&&e.type!==0)}get cellCount(){return this._cells.length}get actualCellCount(){let e=0;return this.eachCell(()=>{e++}),e}get dimensions(){let e=0,t=0;return this._cells.forEach(n=>{n&&n.type!==0&&((!e||e>n.col)&&(e=n.col),t<n.col&&(t=n.col))}),e>0?{min:e,max:t}:null}_applyStyle(e,t){this.style[e]=t,this._cells.forEach(n=>{n&&(n.style[e]=typeof t==`object`&&t?structuredClone(t):t)})}get numFmt(){return this.style.numFmt}set numFmt(e){e!==void 0&&this._applyStyle(`numFmt`,e)}get font(){return this.style.font}set font(e){e!==void 0&&this._applyStyle(`font`,e)}get alignment(){return this.style.alignment}set alignment(e){e!==void 0&&this._applyStyle(`alignment`,e)}get protection(){return this.style.protection}set protection(e){e!==void 0&&this._applyStyle(`protection`,e)}get border(){return this.style.border}set border(e){e!==void 0&&this._applyStyle(`border`,e)}get fill(){return this.style.fill}set fill(e){e!==void 0&&this._applyStyle(`fill`,e)}get hidden(){return!!this._hidden}set hidden(e){this._hidden=e}get outlineLevel(){return this._outlineLevel??0}set outlineLevel(e){this._outlineLevel=e}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=(this._worksheet.properties.outlineLevelRow??0))}get model(){let e=[],t=0,n=0;return this._cells.forEach(r=>{if(r){let i=r.model;i&&((!t||t>r.col)&&(t=r.col),n<r.col&&(n=r.col),e.push(i))}}),this.height!=null||e.length?{cells:e,number:this.number,min:t,max:n,height:this.height,customHeight:this.customHeight,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel,collapsed:this.collapsed,dyDescent:this.dyDescent}:null}set model(e){if(e.number!==this._number)throw new j(`Invalid row number in model`);this._cells=[];let t;e.cells.forEach(e=>{switch(e.type){case B.Types.Merge:break;default:{let n;if(e.address)n=M.decodeAddress(e.address);else if(t){let{row:e}=t,r=t.col+1;n={row:e,col:r,address:M.encodeAddress(e,r),$col$row:`$${M.n2l(r)}$${e}`}}if(t=n,!n)break;let r=this.getCellEx(n);r.model=e;break}}}),e.height==null?delete this.height:this.height=e.height,e.customHeight==null?delete this.customHeight:this.customHeight=e.customHeight,this.hidden=e.hidden,this.outlineLevel=e.outlineLevel??0,this.dyDescent=e.dyDescent,this.style=e.style?structuredClone(e.style):{}}},$l=class extends D{constructor({workbook:e,id:t,iterator:n,options:r}){super(),this.workbook=e,this.id=t,this.sheetNo=typeof t==`number`?t:parseInt(String(t),10),this.iterator=n,this.options=r||{},this.name=`Sheet${this.id}`,this._columns=[],this._keys=Object.create(null),this._dimensions=new N}destroy(){throw new Pr(`destroy`,`Invalid operation for a streaming reader`)}get dimensions(){return this._dimensions}get columns(){return this._columns}getColumn(e){if(typeof e==`string`){let t=this._keys[e];if(t)return t;e=M.l2n(e)}if(e>this._columns.length){let t=this._columns.length+1;for(;t<=e;)this._columns.push(new gc(this,t++))}return this._columns[e-1]}getColumnKey(e){return this._keys[e]}setColumnKey(e,t){this._keys[e]=t}deleteColumnKey(e){delete this._keys[e]}eachColumnKey(e){let t=this._keys;for(let n in t)e(t[n],n)}async read(){try{for await(let e of this.parse())for(let t=0;t<e.length;t++){let n=e[t];this.emit(n.eventType,n.value)}this.emit(`finished`)}catch(e){this.emit(`error`,e)}}async*[Symbol.asyncIterator](){for await(let e of this.parse())for(let t=0;t<e.length;t++){let n=e[t];n.eventType===`row`&&(yield n.value)}}async*parse(){let{iterator:e,options:t}=this,n=!1,r=!1,i=null;switch(t.worksheets){case`emit`:n=!0;break;case`prep`:break;default:break}switch(t.hyperlinks){case`emit`:r=!0;break;case`cache`:this.hyperlinks=i=Object.create(null);break;default:break}if(!n&&!r&&!i)return;let a=r||i!==null,{sharedStrings:o,styles:s,properties:c}=this.workbook,l=!1,u=!1,d=!1,f=null,p=null,m=null,h=null,g=null,_=new ic({position:!1,invalidCharHandling:`skip`});_.on(`opentag`,e=>{if(n)switch(e.name){case`cols`:l=!0,f=[];break;case`sheetData`:u=!0;break;case`col`:l&&f.push({min:parseInt(e.attributes.min,10),max:parseInt(e.attributes.max,10),width:parseFloat(e.attributes.width),styleId:parseInt(e.attributes.style??`0`,10)});break;case`row`:if(u){let t=parseInt(e.attributes.r,10);if(p=new Ql(this,t),e.attributes.ht&&(p.height=parseFloat(e.attributes.ht)),e.attributes.customHeight===`1`&&(p.customHeight=!0),e.attributes.s!==void 0){let t=parseInt(e.attributes.s,10),n=s.getStyleModel(t);n&&(p.style=L(n)??{})}}break;case`c`:if(p){let t=e.attributes.s,n=e.attributes.cm;m={ref:e.attributes.r,s:t===void 0?void 0:parseInt(t,10),t:e.attributes.t,cm:n===void 0?void 0:parseInt(n,10)}}break;case`f`:m&&(h=m.f={text:``});break;case`v`:m&&(h=m.v={text:``});break;case`is`:case`t`:m&&(h=m.v={text:``});break;case`mergeCell`:break;default:break}if(a)switch(e.name){case`hyperlinks`:d=!0;break;case`hyperlink`:if(d){let t=e.attributes.location,n={ref:e.attributes.ref,rId:e.attributes[`r:id`],target:t?t.startsWith(`#`)?t:`#${t}`:void 0};r?(g||=[]).push({eventType:`hyperlink`,value:n}):i[n.ref]=n}break;default:break}}),_.on(`text`,e=>{n&&h&&(h.text+=e)}),_.on(`closetag`,e=>{if(n)switch(e.name){case`cols`:l=!1,this._columns=gc.fromModel(f);break;case`sheetData`:u=!1;break;case`row`:p&&(this._dimensions.expandRow({number:p.number,dimensions:p.dimensions??void 0}),(g||=[]).push({eventType:`row`,value:p})),p=null;break;case`c`:if(p&&m){let e=M.decodeAddress(m.ref),t=p.getCell(e.col);if(m.s!==void 0){let e=s.getStyleModel(m.s);e&&(t.style=L(e)??{})}if(m.f){let e={formula:m.f.text};if(m.v&&(m.t===`str`?e.result=m.v.text:e.result=parseFloat(m.v.text)),m.cm!==void 0){let{workbook:t}=this;t.dynamicArrayCmIndices?t.dynamicArrayCmIndices.has(m.cm)&&(e.isDynamicArray=!0):t.hasDynamicArrayMetadata&&(e.isDynamicArray=!0)}t.value=e}else if(m.v)switch(m.t){case`s`:{let e=parseInt(m.v.text,10);o?t.value=o[e]:t.value={sharedString:e};break}case`inlineStr`:t.value=m.v.text.includes(`_x`)?Pc(m.v.text):m.v.text;break;case`str`:t.value=m.v.text;break;case`e`:t.value={error:m.v.text};break;case`b`:t.value=parseInt(m.v.text,10)!==0;break;default:{let e=typeof t.numFmt==`string`?t.numFmt:t.numFmt?.formatCode;e&&Wc(e)?t.value=jc(parseFloat(m.v.text),c?.model?.date1904):t.value=parseFloat(m.v.text);break}}if(i){let e=i[m.ref];e&&(t.text=t.value,t.value=void 0,t.hyperlink=e)}m=null,h=null}break;default:break}if(a)switch(e.name){case`hyperlinks`:d=!1;break;default:break}});let v=new TextDecoder(`utf-8`,{fatal:!0});for await(let t of e){let e=typeof t==`string`?t:v.decode(t,{stream:!0});_.write(e);let n=g;n&&n.length>0&&(g=null,yield n)}let y=v.decode();y&&_.write(y),_.close();let b=g;b&&b.length>0&&(yield b)}};async function*eu(e){let t=[],n=null,r=e=>{t.push(e),n&&=(n(),null)};e.on(`data`,r);let i=!1,a=()=>{i=!0,n&&=(n(),null)};e.on(`end`,a);let s=!1,c=e=>{s=e,n&&=(n(),null)};e.on(`error`,c);try{for(;!i||t.length>0;){if(t.length===0)e.resume(),await new Promise(e=>{n=e});else{e.pause();let n=t.shift();n!==void 0&&(yield n)}if(s)throw o(s)}}finally{e.removeListener(`data`,r),e.removeListener(`end`,a),e.removeListener(`error`,c)}}let V={contentTypes:`[Content_Types].xml`,rootRels:`_rels/.rels`,docPropsApp:`docProps/app.xml`,docPropsCore:`docProps/core.xml`,xlWorkbook:`xl/workbook.xml`,xlWorkbookRels:`xl/_rels/workbook.xml.rels`,xlSharedStrings:`xl/sharedStrings.xml`,xlStyles:`xl/styles.xml`,xlTheme1:`xl/theme/theme1.xml`,xlFeaturePropertyBag:`xl/featurePropertyBag/featurePropertyBag.xml`,xlMetadata:`xl/metadata.xml`},tu=/^xl\/worksheets\/sheet(\d+)[.]xml$/,nu=/^xl\/worksheets\/_rels\/sheet(\d+)[.]xml[.]rels$/,ru=/^xl\/theme\/[a-zA-Z0-9]+[.]xml$/,iu=/^xl\/media\/([a-zA-Z0-9]+[.][a-zA-Z0-9]{3,4})$/,au=/^xl\/drawings\/(drawing\d+)[.]xml$/,ou=/^xl\/drawings\/_rels\/(drawing\d+)[.]xml[.]rels$/,su=/^xl\/drawings\/(vmlDrawing\d+)[.]vml$/,cu=/^xl\/drawings\/(vmlDrawingHF\d+)[.]vml$/,lu=/^xl\/(?:comments(\d+)|comments\/comment(\d+))[.]xml$/,uu=/^xl\/tables\/(table\d+)[.]xml$/,du=/^xl\/pivotTables\/(pivotTable\d+)[.]xml$/,fu=/^xl\/pivotTables\/_rels\/(pivotTable\d+)[.]xml[.]rels$/,pu=/^xl\/pivotCache\/(pivotCacheDefinition\d+)[.]xml$/,mu=/^xl\/pivotCache\/_rels\/(pivotCacheDefinition\d+)[.]xml[.]rels$/,hu=/^xl\/pivotCache\/(pivotCacheRecords\d+)[.]xml$/,gu=/^xl\/externalLinks\/externalLink(\d+)[.]xml$/,_u=/^xl\/externalLinks\/_rels\/externalLink(\d+)[.]xml[.]rels$/;function vu(e){return e.startsWith(`/`)?e.slice(1):e}function yu(e){let t=tu.exec(e);if(t)return parseInt(t[1],10)}function bu(e){let t=nu.exec(e);if(t)return parseInt(t[1],10)}function xu(e){return e.startsWith(`xl/media/`)}function Su(e){let t=iu.exec(e);return t?t[1]:void 0}function Cu(e){return ru.test(e)}function wu(e){let t=/^xl\/theme\/([a-zA-Z0-9]+)[.]xml$/.exec(e);return t?t[1]:void 0}function Tu(e){return xu(e)||Cu(e)}function Eu(e){let t=au.exec(e);return t?t[1]:void 0}function Du(e){let t=ou.exec(e);return t?t[1]:void 0}function Ou(e){let t=su.exec(e);return t?t[1]:void 0}function ku(e){let t=cu.exec(e);return t?t[1]:void 0}function Au(e){return lu.test(e)}function ju(e){let t=uu.exec(e);return t?t[1]:void 0}function Mu(e){let t=du.exec(e);return t?t[1]:void 0}function Nu(e){let t=fu.exec(e);return t?t[1]:void 0}function Pu(e){let t=pu.exec(e);return t?t[1]:void 0}function Fu(e){let t=mu.exec(e);return t?t[1]:void 0}function Iu(e){let t=hu.exec(e);return t?t[1]:void 0}function Lu(e){let t=gu.exec(e);return t?parseInt(t[1],10):void 0}function Ru(e){let t=_u.exec(e);return t?parseInt(t[1],10):void 0}function H(e){return e.startsWith(`/`)?e:`/${e}`}function zu(e){return`xl/theme/${e}.xml`}function Bu(e){return`xl/media/${e}`}function Vu(e){return`xl/worksheets/sheet${e}.xml`}function Hu(e){return`xl/worksheets/_rels/sheet${e}.xml.rels`}function Uu(e){return`worksheets/sheet${e}.xml`}function Wu(e){return`xl/comments${e}.xml`}function Gu(e){return`xl/${e}.xml`}function Ku(e){return`xl/drawings/vmlDrawing${e}.vml`}function qu(e){return`xl/drawings/vmlDrawingHF${e}.vml`}function Ju(e){return`xl/drawings/_rels/vmlDrawingHF${e}.vml.rels`}function Yu(e){return`xl/tables/${e}`}function Xu(e){return`xl/drawings/${e}.xml`}function Zu(e){return`xl/drawings/_rels/${e}.xml.rels`}function Qu(e){return`xl/pivotCache/pivotCacheDefinition${e}.xml`}function $u(e){return`xl/pivotCache/_rels/pivotCacheDefinition${e}.xml.rels`}function ed(e){return`xl/pivotCache/pivotCacheRecords${e}.xml`}function td(e){return`pivotCacheRecords${e}.xml`}function nd(e){return`xl/pivotTables/pivotTable${e}.xml`}function rd(e){return`xl/pivotTables/${e}.xml`}function id(e){return`xl/pivotTables/_rels/pivotTable${e}.xml.rels`}function ad(e){return`xl/externalLinks/externalLink${e}.xml`}function od(e){return`xl/externalLinks/_rels/externalLink${e}.xml.rels`}function sd(e){return`externalLinks/externalLink${e}.xml`}function cd(e){return`../pivotCache/pivotCacheDefinition${e}.xml`}let ld={workbookStyles:`styles.xml`,workbookSharedStrings:`sharedStrings.xml`,workbookTheme1:`theme/theme1.xml`,workbookFeaturePropertyBag:`featurePropertyBag/featurePropertyBag.xml`,workbookMetadata:`metadata.xml`};function ud(e){return`pivotCache/pivotCacheDefinition${e}.xml`}function dd(e){return`../comments${e}.xml`}function fd(e){return`../drawings/vmlDrawing${e}.vml`}function pd(e){return`../drawings/vmlDrawingHF${e}.vml`}function md(e){return`../drawings/${e}.xml`}function hd(e){return`../pivotTables/pivotTable${e}.xml`}function gd(e){return`../tables/${e}`}function _d(e){return`../media/${e}`}function vd(e){return`xl/ctrlProps/ctrlProp${e}.xml`}function yd(e){return`../ctrlProps/ctrlProp${e}.xml`}function bd(e,t){if(t.startsWith(`/`))return t.slice(1);let n=((e.endsWith(`/`)?e:e+`/`)+t).split(`/`),r=[];for(let e of n)if(e===`.`||e===``)continue;else e===`..`?r.pop():r.push(e);return r.join(`/`)}function xd(e,t){if(t)for(let n in t){let r=t[n];r!==void 0&&(Ec(n),e.push(` ${n}="${wc(String(r))}"`))}}var Sd=class{constructor(){this._parts=[],this._chunks=[],this._stack=[],this._snapshots=[],this._leaf=!1,this._open=!1}_consolidate(){this._snapshots.length>0||this._parts.length>=1e4&&(this._chunks.push(this._parts.join(``)),this._parts.length=0)}get depth(){return this._stack.length}get currentElement(){return this._stack.length>0?this._stack[this._stack.length-1]:void 0}get cursor(){return this._chunks.length*1e4+this._parts.length}openXml(e){let t=e?{...z,...e}:z;this._parts.push(`<?xml`),xd(this._parts,t),this._parts.push(`?>
|
|
116
|
-
`)}openNode(e,t){Ec(e),this._open&&this._parts.push(`>`),this._stack.push(e);let n=`<`+e;if(t)for(let e in t){let r=t[e];r!==void 0&&(Ec(e),n+=` ${e}="${wc(String(r))}"`)}this._parts.push(n),this._leaf=!0,this._open=!0}addAttribute(e,t){if(!this._open)throw new qs(`add attribute`,`no element is open`);Ec(e),this._parts.push(` ${e}="${wc(String(t))}"`)}addAttributes(e){if(!this._open)throw new qs(`add attributes`,`no element is open`);xd(this._parts,e)}writeText(e){this._open&&=(this._parts.push(`>`),!1),this._leaf=!1,this._parts.push(R(String(e)))}writeRaw(e){this._open&&=(this._parts.push(`>`),!1),this._leaf=!1,this._parts.push(e)}writeCData(e){this._open&&=(this._parts.push(`>`),!1),this._leaf=!1,this._parts.push(Dc(e))}writeComment(e){this._open&&=(this._parts.push(`>`),!1),this._leaf=!1,Oc(e),this._parts.push(`<!--${e}-->`)}closeNode(){let e=this._stack.pop();if(e===void 0)throw new qs(`close node`,`no element is open`);this._leaf?this._parts.push(`/>`):this._parts.push(`</${e}>`),this._open=!1,this._leaf=!1,this._consolidate()}leafNode(e,t,n){Ec(e),this._open&&=(this._parts.push(`>`),!1);let r=`<`+e;if(t)for(let e in t){let n=t[e];n!==void 0&&(Ec(e),r+=` ${e}="${wc(String(n))}"`)}n===void 0?r+=`/>`:r+=`>`+R(String(n))+`</`+e+`>`,this._parts.push(r),this._leaf=!1}closeAll(){for(;this._stack.length>0;)this.closeNode()}toString(){return this._chunks.length===0?this._parts.join(``):this._chunks.join(``)+this._parts.join(``)}get xml(){return this.toString()}save(){this._snapshots.push({partsLength:this._parts.length,chunksLength:this._chunks.length,stackLength:this._stack.length,leaf:this._leaf,open:this._open})}commit(){if(this._snapshots.length===0)throw new qs(`commit`,`no snapshot to commit`);this._snapshots.pop()}rollback(){if(this._snapshots.length===0)throw new qs(`rollback`,`no snapshot to rollback`);let e=this._snapshots.pop();this._parts.length=e.partsLength,this._chunks.length=e.chunksLength,this._stack.length=e.stackLength,this._leaf=e.leaf,this._open=e.open}reset(){this._parts=[],this._chunks=[],this._stack=[],this._snapshots=[],this._leaf=!1,this._open=!1}};let Cd=new Set([`ep`,`cp`,`dc`,`dcterms`,`dcmitype`,`vt`]);function wd(e,t){let n=!1;for(let e in t)if(e.length>6&&e.startsWith(`xmlns:`)){let r=e.slice(6);if(t[e]===`http://schemas.openxmlformats.org/spreadsheetml/2006/main`)return r;Cd.has(r)&&(n=!0)}if(n)return null;let r=e.indexOf(`:`);return r!==-1&&Cd.has(e.slice(0,r))?null:void 0}function Td(e,t){let n=e.indexOf(`:`);if(n===-1)return e;let r=e.slice(0,n);return r===t||Cd.has(r)?e.slice(n+1):e}var U=class e{prepare(e,t){}render(e,t){}parseOpen(e){}parseText(e){}parseClose(e){return!1}reconcile(e,t){}reset(){this.model=void 0,this.map&&Object.values(this.map).forEach(t=>{t instanceof e?t.reset():t.xform&&t.xform.reset()})}mergeModel(e){this.model=Object.assign(this.model||{},e)}async parse(e){let t=!1,n,r=0,i=null;for await(let a of e)if(!t){for(let{eventType:e,value:o}of a)if(e===`opentag`){if(r===1){this.parseOpen(o);continue}if(r===0){let e=wd(o.name,o.attributes);if(e===void 0){r=1,this.parseOpen(o);continue}r=2,i=e}let e=Td(o.name,i);e===o.name?this.parseOpen(o):this.parseOpen({name:e,attributes:o.attributes,isSelfClosing:o.isSelfClosing})}else if(e===`text`)this.parseText(o);else if(e===`closetag`){if(r===1){if(!this.parseClose(o.name)){t=!0,n=this.model;break}continue}if(!this.parseClose(Td(o.name,i))){t=!0,n=this.model;break}}}return t?n:this.model}async parseStreamDirect(e){let t=new ic({invalidCharHandling:`skip`}),n=new TextDecoder(`utf-8`,{fatal:!0}),r=!1,i,a=0,s=null,c;t.on(`error`,e=>{r||(c=e)}),t.on(`opentag`,e=>{if(r)return;if(a===1){this.parseOpen(e);return}if(a===0){let t=wd(e.name,e.attributes);if(t===void 0){a=1,this.parseOpen(e);return}a=2,s=t}let t=Td(e.name,s);t===e.name?this.parseOpen(e):this.parseOpen({name:t,attributes:e.attributes,isSelfClosing:e.isSelfClosing})}),t.on(`text`,e=>{r||this.parseText(e)}),t.on(`closetag`,e=>{if(r)return;let t=a===2?Td(e.name,s):e.name;this.parseClose(t)||(r=!0,i=this.model)});for await(let i of e){if(r)continue;let e=typeof i==`string`?i:n.decode(i,{stream:!0});if(t.write(e),c)throw o(c)}if(!r){let e=n.decode();if(e&&(t.write(e),c)||(t.close(),c))throw o(c)}return r?i:this.model}async parseStream(e){return this.parseStreamDirect(e)}get xml(){return this.toXml(this.model)}toXml(e){let t=new Sd;return this.render(t,e),t.xml}static toAttribute(e,t,n=!1){if(e===void 0){if(n)return t}else if(n||e!==t)return e.toString()}static toStringAttribute(t,n,r=!1){return e.toAttribute(t,n,r)}static toStringValue(e,t){return e===void 0?t:e}static toBoolAttribute(e,t,n=!1){if(e===void 0){if(n)return t}else if(n||e!==t)return e?`1`:`0`}static toBoolValue(e,t){return e===void 0?t:e===`1`}static toIntAttribute(t,n,r=!1){return e.toAttribute(t,n,r)}static toIntValue(e,t){return e===void 0?t:parseInt(e,10)}static toFloatAttribute(t,n,r=!1){return e.toAttribute(t,n,r)}static toFloatValue(e,t){return e===void 0?t:parseFloat(e)}},Ed=class extends U{constructor(){super(),this._parsedText=[]}render(e,t){e.openNode(`definedName`,{name:t.name,localSheetId:t.localSheetId}),t.kind===`opaque`&&t.rawText?e.writeText(t.rawText):e.writeText(t.ranges.join(`,`)),e.closeNode()}parseOpen(e){switch(e.name){case`definedName`:return this._parsedName=e.attributes.name,this._parsedLocalSheetId=e.attributes.localSheetId,this._parsedText=[],!0;default:return!1}}parseText(e){this._parsedText.push(e)}parseClose(){let e=this._parsedText.join(``),t={name:this._parsedName,ranges:[],rawText:e.trim()||void 0};return this._parsedLocalSheetId!==void 0&&(t.localSheetId=parseInt(this._parsedLocalSheetId,10)),this.model=t,!1}},Dd=class extends U{render(e,t){e.leafNode(`externalReference`,{"r:id":t.rId})}parseOpen(e){return e.name===`externalReference`?(this.model={rId:e.attributes[`r:id`]??``},!0):!1}parseText(){}parseClose(){return!1}};let Od=new Set([`visible`,`hidden`,`veryHidden`]);function kd(e){let t=e||`visible`;return Od.has(t)?t:`visible`}var Ad=class extends U{render(e,t){e.leafNode(`sheet`,{name:t.name,sheetId:t.id,state:t.state===`visible`?void 0:t.state,"r:id":t.rId})}parseOpen(e){return e.name===`sheet`?(this.model={name:e.attributes.name,id:parseInt(e.attributes.sheetId,10),state:kd(e.attributes.state),rId:e.attributes[`r:id`]},!0):!1}parseText(){}parseClose(){return!1}},jd=class extends U{render(e,t){e.leafNode(`calcPr`,{calcId:171027,fullCalcOnLoad:t.fullCalcOnLoad?1:void 0,iterate:t.iterate?1:void 0,iterateCount:t.iterateCount===void 0?void 0:t.iterateCount,iterateDelta:t.iterateDelta===void 0?void 0:t.iterateDelta})}parseOpen(e){if(e.name===`calcPr`){let t=e.attributes??{};return this.model={fullCalcOnLoad:t.fullCalcOnLoad===`1`,iterate:t.iterate===`1`?!0:void 0,iterateCount:t.iterateCount===void 0?void 0:parseInt(t.iterateCount,10),iterateDelta:t.iterateDelta===void 0?void 0:parseFloat(t.iterateDelta)},!0}return!1}parseText(){}parseClose(){return!1}},Md=class extends U{render(e,t){e.leafNode(`pivotCache`,{cacheId:t.cacheId,"r:id":t.rId})}parseOpen(e){return e.name===`pivotCache`?(this.model={cacheId:e.attributes.cacheId,rId:e.attributes[`r:id`]},!0):!1}parseText(){}parseClose(){return!1}},Nd=class extends U{render(e,t){e.leafNode(`workbookPr`,{date1904:t.date1904?1:void 0,filterPrivacy:1})}parseOpen(e){return e.name===`workbookPr`?(this.model={date1904:e.attributes.date1904===`1`},!0):!1}parseText(){}parseClose(){return!1}},Pd=class extends U{get tag(){return`workbookProtection`}render(e,t){if(!t)return;let n={};t.lockStructure&&(n.lockStructure=`1`),t.lockWindows&&(n.lockWindows=`1`),t.lockRevision&&(n.lockRevision=`1`),t.workbookPassword&&(n.workbookPassword=t.workbookPassword),t.revisionsPassword&&(n.revisionsPassword=t.revisionsPassword),t.algorithmName&&(n.workbookAlgorithmName=t.algorithmName,n.workbookHashValue=t.hashValue,n.workbookSaltValue=t.saltValue,n.workbookSpinCount=t.spinCount?.toString()),Object.values(n).some(e=>e!==void 0)&&e.leafNode(this.tag,n)}parseOpen(e){switch(e.name){case this.tag:{let t=e.attributes;return this.model={lockStructure:t.lockStructure===`1`||void 0,lockWindows:t.lockWindows===`1`||void 0,lockRevision:t.lockRevision===`1`||void 0,workbookPassword:t.workbookPassword||void 0,revisionsPassword:t.revisionsPassword||void 0},t.workbookAlgorithmName&&(this.model.algorithmName=t.workbookAlgorithmName,this.model.hashValue=t.workbookHashValue,this.model.saltValue=t.workbookSaltValue,this.model.spinCount=t.workbookSpinCount?parseInt(t.workbookSpinCount,10):void 0),!0}default:return!1}}parseText(){}parseClose(){return!1}},Fd=class extends U{render(e,t){let n={xWindow:t.x??0,yWindow:t.y??0,windowWidth:t.width??12e3,windowHeight:t.height??24e3,firstSheet:t.firstSheet,activeTab:t.activeTab};t.visibility&&t.visibility!==`visible`&&(n.visibility=t.visibility),e.leafNode(`workbookView`,n)}parseOpen(e){if(e.name===`workbookView`){let t=this.model={},n=function(e,n,r){t[e]=n===void 0?r:n},r=function(e,n,r){let i=n===void 0?r:parseInt(n,10);i!==void 0&&(t[e]=i)};return r(`x`,e.attributes.xWindow,0),r(`y`,e.attributes.yWindow,0),r(`width`,e.attributes.windowWidth,25e3),r(`height`,e.attributes.windowHeight,1e4),n(`visibility`,e.attributes.visibility,`visible`),r(`activeTab`,e.attributes.activeTab,void 0),r(`firstSheet`,e.attributes.firstSheet,void 0),!0}return!1}parseText(){}parseClose(){return!1}},W=class extends U{constructor(e){super(),this.tag=e.tag,this.always=!!e.always,this.count=e.count,this.empty=e.empty,this.$count=e.$count??`count`,this.$=e.$,this.childXform=e.childXform,this.maxItems=e.maxItems}prepare(e,t){let{childXform:n}=this;e&&e.forEach((e,r)=>{t.index=r,n.prepare(e,t)})}render(e,t){if(this.always||t&&t.length){e.openNode(this.tag,this.$),this.count&&e.addAttribute(this.$count,t?.length??0);let{childXform:n}=this;(t??[]).forEach((t,r)=>{n.render(e,t,r)}),e.closeNode()}else this.empty&&e.leafNode(this.tag)}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.model=[],!0):this.childXform.parseOpen(e)?(this.parser=this.childXform,!0):!1}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)&&(this.model.push(this.parser.model),this.parser=void 0,this.maxItems&&this.model.length>this.maxItems))throw new zr(this.childXform.tag,this.maxItems);return!0}return!1}reconcile(e,t){if(e){let{childXform:n}=this;e.forEach(e=>{n.reconcile(e,t)})}}reset(){super.reset(),this.childXform&&this.childXform.reset()}};function Id(e,t){e.openNode(t.tag,t.$),t.c&&t.c.forEach(t=>{Id(e,t)}),t.t&&e.writeText(t.t),e.closeNode()}var Ld=class extends U{constructor(e){super(),this._model=e}render(e){if(!this._xml){let e=new Sd;Id(e,this._model),this._xml=e.xml}e.writeRaw(this._xml)}parseOpen(){return!0}parseText(){}parseClose(e){switch(e){case this._model.tag:return!1;default:return!0}}},Rd=class e extends U{constructor(){super(),this.map={fileVersion:e.STATIC_XFORMS.fileVersion,workbookPr:new Nd,workbookProtection:new Pd,bookViews:new W({tag:`bookViews`,count:!1,childXform:new Fd}),sheets:new W({tag:`sheets`,count:!1,childXform:new Ad}),definedNames:new W({tag:`definedNames`,count:!1,childXform:new Ed}),calcPr:new jd,pivotCaches:new W({tag:`pivotCaches`,count:!1,childXform:new Md}),externalReferences:new W({tag:`externalReferences`,count:!1,childXform:new Dd})}}prepare(e){e.sheets=e.worksheets;let t=[],n=0;e.sheets.forEach(e=>{if(e.pageSetup&&e.pageSetup.printArea&&e.pageSetup.printArea.split(`&&`).forEach(r=>{let i=r.split(`:`),a=i[0],o=i[1]??a,s={name:`_xlnm.Print_Area`,ranges:[`'${e.name}'!$${a}:$${o}`],localSheetId:n};t.push(s)}),e.pageSetup&&(e.pageSetup.printTitlesRow||e.pageSetup.printTitlesColumn)){let r=[];if(e.pageSetup.printTitlesColumn){let t=e.pageSetup.printTitlesColumn.split(`:`),n=t[0],i=t[1]??n;r.push(`'${e.name}'!$${n}:$${i}`)}if(e.pageSetup.printTitlesRow){let t=e.pageSetup.printTitlesRow.split(`:`),n=t[0],i=t[1]??n;r.push(`'${e.name}'!$${n}:$${i}`)}let i={name:`_xlnm.Print_Titles`,ranges:r,localSheetId:n};t.push(i)}n++}),t.length&&(e.definedNames=e.definedNames.concat(t)),(e.media??[]).forEach((e,t)=>{e.name=e.type+(t+1)})}render(t,n){t.openXml(z),t.openNode(`workbook`,e.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(t),this.map.workbookPr.render(t,n.properties),this.map.workbookProtection.render(t,n.protection),this.map.bookViews.render(t,n.views),this.map.sheets.render(t,n.sheets),this.map.definedNames.render(t,n.definedNames),this.map.calcPr.render(t,n.calcProperties);let r=n.pivotTables??[],i=new Set,a=r.filter(e=>i.has(e.cacheId)?!1:(i.add(e.cacheId),!0));this.map.pivotCaches.render(t,a);let o=n.externalLinks??[];if(o.length>0){let e=o.map(e=>({rId:e.rId}));this.map.externalReferences.render(t,e)}t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`workbook`:return!0;default:return this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`workbook`:return this.model={sheets:this.map.sheets.model,properties:this.map.workbookPr.model||{},protection:this.map.workbookProtection.model,views:this.map.bookViews.model,calcProperties:this.map.calcPr.model||{}},this.map.definedNames.model&&(this.model.definedNames=this.map.definedNames.model),this.map.pivotCaches.model&&this.map.pivotCaches.model.length>0&&(this.model.pivotCaches=this.map.pivotCaches.model),this.map.externalReferences.model&&this.map.externalReferences.model.length>0&&(this.model.externalReferences=this.map.externalReferences.model),!1;default:return!0}}reconcile(e){let t=(e.workbookRels??[]).reduce((e,t)=>(e[t.Id]=t,e),{}),n=[],r,i=0;(e.sheets??[]).forEach(a=>{let o=t[a.rId];o&&(r=e.worksheetHash[`xl/${o.Target.replace(/^(\s|\/xl\/)+/,``)}`],r&&(r.name=a.name,r.id=a.id,r.state=a.state,n[i++]=r))});let a=[];e.definedNames&&e.definedNames.forEach(e=>{let t=e.ranges?.length>0?e.ranges:e.rawText?[e.rawText]:[];if(e.name===`_xlnm.Print_Area`){if(r=n[e.localSheetId],r&&t.length>0){r.pageSetup||={};let e=M.decodeEx(t[0]);r.pageSetup.printArea=r.pageSetup.printArea?`${r.pageSetup.printArea}&&${e.dimensions}`:e.dimensions}}else if(e.name===`_xlnm.Print_Titles`){if(r=n[e.localSheetId],r&&t.length>0){r.pageSetup||={};let e=t.join(`,`),n=/\$/g,i=e.match(/\$\d+:\$\d+/);if(i&&i.length){let e=i[0];r.pageSetup.printTitlesRow=e.replace(n,``)}let a=e.match(/\$[A-Z]+:\$[A-Z]+/);if(a&&a.length){let e=a[0];r.pageSetup.printTitlesColumn=e.replace(n,``)}}}else a.push(e)}),e.definedNames=a,e.media.forEach((e,t)=>{e.index=t})}static{this.WORKBOOK_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x15`,"xmlns:x15":`http://schemas.microsoft.com/office/spreadsheetml/2010/11/main`}}static{this.STATIC_XFORMS={fileVersion:new Ld({tag:`fileVersion`,$:{appName:`xl`,lastEdited:5,lowestEdited:5,rupBuild:9303}})}}},zd=class extends U{constructor(...e){super(...e),this._metadataTypeNames=[],this._cellMetadataTypeRefs=[],this._inCellMetadata=!1,this._currentRcType=void 0}get tag(){return`metadata`}render(e,t){!t||t.dynamicArrayCount<=0||(e.openXml(z),e.openNode(`metadata`,{xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:xda":`http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray`}),e.openNode(`metadataTypes`,{count:`1`}),e.leafNode(`metadataType`,{name:`XLDAPR`,minSupportedVersion:`120000`,copy:`1`,pasteAll:`1`,pasteValues:`1`,merge:`1`,splitFirst:`1`,rowColShift:`1`,clearFormats:`1`,clearComments:`1`,assign:`1`,coerce:`1`,adjust:`1`,cellMeta:`1`}),e.closeNode(),e.openNode(`futureMetadata`,{name:`XLDAPR`,count:`1`}),e.openNode(`bk`),e.openNode(`extLst`),e.openNode(`ext`,{uri:`{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}`}),e.leafNode(`xda:dynamicArrayProperties`,{fDynamic:`1`,fCollapsed:`0`}),e.closeNode(),e.closeNode(),e.closeNode(),e.closeNode(),e.openNode(`cellMetadata`,{count:`1`}),e.openNode(`bk`),e.leafNode(`rc`,{t:`1`,v:`0`}),e.closeNode(),e.closeNode(),e.closeNode())}reset(){this._metadataTypeNames=[],this._cellMetadataTypeRefs=[],this._inCellMetadata=!1,this._currentRcType=void 0}parseOpen(e){switch(e.name){case`metadata`:return this.reset(),!0;case`metadataType`:return this._metadataTypeNames.push(e.attributes.name||``),!0;case`cellMetadata`:return this._inCellMetadata=!0,!0;case`bk`:return this._inCellMetadata&&(this._currentRcType=void 0),!0;case`rc`:return this._inCellMetadata&&e.attributes.t!==void 0&&(this._currentRcType=parseInt(e.attributes.t,10)),!0;case`metadataTypes`:case`futureMetadata`:case`extLst`:case`ext`:case`xda:dynamicArrayProperties`:return!0;default:return!1}}parseText(){}parseClose(e){switch(e){case`bk`:return this._inCellMetadata&&(this._cellMetadataTypeRefs.push(this._currentRcType??0),this._currentRcType=void 0),!0;case`cellMetadata`:return this._inCellMetadata=!1,!0;case`metadata`:{let e=new Set;for(let t=0;t<this._cellMetadataTypeRefs.length;t++){let n=this._cellMetadataTypeRefs[t];this._metadataTypeNames[n-1]===`XLDAPR`&&e.add(t+1)}return this.model={hasDynamicArrays:e.size>0,dynamicArrayCmIndices:e},!1}default:return!0}}},Bd=class extends U{render(e,t){e.leafNode(`Relationship`,t)}parseOpen(e){switch(e.name){case`Relationship`:return this.model=e.attributes,!0;default:return!1}}parseText(){}parseClose(){return!1}},Vd=class e extends U{constructor(){super(),this.map={Relationship:new Bd}}render(t,n){let r=n||this._values;t.openXml(z),t.openNode(`Relationships`,e.RELATIONSHIPS_ATTRIBUTES),r.forEach(e=>{this.map.Relationship.render(t,e)}),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`Relationships`:return this.model=[],!0;default:if(this.parser=this.map[e.name],this.parser)return this.parser.parseOpen(e),!0;throw new jr(`Relationships`,`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.push(this.parser.model),this.parser=void 0),!0;switch(e){case`Relationships`:return!1;default:throw new jr(`Relationships`,`Unexpected xml node in parseClose: ${e}`)}}static{this.RELATIONSHIPS_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/package/2006/relationships`}}},Hd=class extends U{constructor(e){super(),this.name=e??`color`}get tag(){return this.name}render(e,t){return t?(e.openNode(this.name),t.argb?e.addAttribute(`rgb`,t.argb):t.theme===void 0?t.indexed===void 0?e.addAttribute(`auto`,`1`):e.addAttribute(`indexed`,t.indexed):(e.addAttribute(`theme`,t.theme),t.tint!==void 0&&e.addAttribute(`tint`,t.tint)),e.closeNode(),!0):!1}parseOpen(e){return e.name===this.name?(e.attributes.rgb?this.model={argb:e.attributes.rgb}:e.attributes.theme?(this.model={theme:parseInt(e.attributes.theme,10)},e.attributes.tint&&(this.model.tint=parseFloat(e.attributes.tint))):e.attributes.indexed?this.model={indexed:parseInt(e.attributes.indexed,10)}:this.model=void 0,!0):!1}parseText(){}parseClose(){return!1}},Ud=class e extends U{constructor(e){super(),this.name=e,this.map={color:new Hd}}get tag(){return this.name}render(e,t,n){let r=t&&t.color||n||this.defaultColor;e.openNode(this.name),t&&t.style&&(e.addAttribute(`style`,t.style),r&&this.map.color.render(e,r)),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.name:{let{style:t}=e.attributes;return t?this.model={style:t}:this.model=void 0,!0}case`color`:return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(e===this.name&&this.map.color.model&&(this.model||={},this.model.color=this.map.color.model),!1)}validStyle(t){return e.validStyleValues[t]}static{this.validStyleValues=[`thin`,`dashed`,`dotted`,`dashDot`,`hair`,`dashDotDot`,`slantDashDot`,`mediumDashed`,`mediumDashDotDot`,`mediumDashDot`,`medium`,`double`,`thick`].reduce((e,t)=>(e[t]=!0,e),{})}},Wd=class extends U{constructor(){super(),this.map={top:new Ud(`top`),left:new Ud(`left`),bottom:new Ud(`bottom`),right:new Ud(`right`),diagonal:new Ud(`diagonal`)}}render(e,t){let{color:n}=t;e.openNode(`border`),t.diagonal&&t.diagonal.style&&(t.diagonal.up&&e.addAttribute(`diagonalUp`,`1`),t.diagonal.down&&e.addAttribute(`diagonalDown`,`1`));let r=(r,i)=>{let a=r;a&&!a.color&&t.color&&(a={...a,color:t.color}),i.render(e,a,n)};r(t.left,this.map.left),r(t.right,this.map.right),r(t.top,this.map.top),r(t.bottom,this.map.bottom),r(t.diagonal,this.map.diagonal),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`border`:return this.reset(),this.diagonalUp=Gc(e.attributes.diagonalUp),this.diagonalDown=Gc(e.attributes.diagonalDown),!0;default:return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;if(e===`border`){let e={},t=!1,n=(n,r,i)=>{r&&(i&&Object.assign(r,i),e[n]=r,t=!0)};n(`left`,this.map.left.model),n(`right`,this.map.right.model),n(`top`,this.map.top.model),n(`bottom`,this.map.bottom.model),n(`diagonal`,this.map.diagonal.model,{up:this.diagonalUp,down:this.diagonalDown}),this.model=t?e:void 0}return!1}};let Gd={ReadingOrder:{LeftToRight:1,RightToLeft:2}},Kd={horizontalValues:[`left`,`center`,`right`,`fill`,`centerContinuous`,`distributed`,`justify`].reduce((e,t)=>(e[t]=!0,e),{}),horizontal(e){return this.horizontalValues[e]?e:void 0},verticalValues:[`top`,`middle`,`bottom`,`distributed`,`justify`].reduce((e,t)=>(e[t]=!0,e),{}),vertical(e){return e===`middle`?`center`:this.verticalValues[e]?e:void 0},wrapText(e){return e?!0:void 0},shrinkToFit(e){return e?!0:void 0},textRotation(e){switch(e){case`vertical`:return e;default:{let t=zc(e);return t!==void 0&&t>=-90&&t<=90?t:void 0}}},indent(e){let t=zc(e);return Math.max(0,t)},readingOrder(e){switch(e){case`ltr`:return Gd.ReadingOrder.LeftToRight;case`rtl`:return Gd.ReadingOrder.RightToLeft;default:return}}},qd={toXml(e){let t=Kd.textRotation(e);if(t){if(t===`vertical`)return 255;let e=Math.round(t);if(e>=0&&e<=90)return e;if(e<0&&e>=-90)return 90-e}},toModel(e){let t=zc(e);if(t!==void 0){if(t===255)return`vertical`;if(t>=0&&t<=90)return t;if(t>90&&t<=180)return 90-t}}};var Jd=class extends U{get tag(){return`alignment`}render(e,t){let n={};function r(e,t){t&&(n[e]=t)}r(`horizontal`,Kd.horizontal(t.horizontal)),r(`vertical`,Kd.vertical(t.vertical)),r(`wrapText`,Kd.wrapText(t.wrapText)?`1`:!1),r(`shrinkToFit`,Kd.shrinkToFit(t.shrinkToFit)?`1`:!1),r(`indent`,Kd.indent(t.indent)),r(`textRotation`,qd.toXml(t.textRotation)),r(`readingOrder`,Kd.readingOrder(t.readingOrder)),Object.keys(n).length>0&&e.leafNode(`alignment`,n)}parseOpen(e){let t={},n=!1;function r(e,r,i){e&&(t[r]=i,n=!0)}r(e.attributes.horizontal,`horizontal`,e.attributes.horizontal),r(e.attributes.vertical,`vertical`,e.attributes.vertical===`center`?`middle`:e.attributes.vertical),r(e.attributes.wrapText,`wrapText`,Gc(e.attributes.wrapText)),r(e.attributes.shrinkToFit,`shrinkToFit`,Gc(e.attributes.shrinkToFit)),r(e.attributes.indent,`indent`,parseInt(e.attributes.indent,10)),r(e.attributes.textRotation,`textRotation`,qd.toModel(e.attributes.textRotation)),r(e.attributes.readingOrder,`readingOrder`,e.attributes.readingOrder===`2`?`rtl`:`ltr`),this.model=n?t:null}parseText(){}parseClose(){return!1}},Yd=class extends U{constructor(){super(),this.map={color:new Hd}}get tag(){return`stop`}render(e,t){e.openNode(`stop`),e.addAttribute(`position`,t.position),this.map.color.render(e,t.color),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`stop`:return this.model={position:parseFloat(e.attributes.position)},!0;case`color`:return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(){}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.model.color=this.parser.model,this.parser=void 0),!0):!1}},Xd=class extends U{constructor(){super(),this.map={fgColor:new Hd(`fgColor`),bgColor:new Hd(`bgColor`)}}get name(){return`pattern`}get tag(){return`patternFill`}render(e,t){e.openNode(`patternFill`),e.addAttribute(`patternType`,t.pattern),t.fgColor&&this.map.fgColor.render(e,t.fgColor),t.bgColor&&this.map.bgColor.render(e,t.bgColor),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`patternFill`:return this.model={type:`pattern`,pattern:e.attributes.patternType},!0;default:return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser.model&&(this.model[e]=this.parser.model),this.parser=void 0),!0):!1}},Zd=class extends U{constructor(){super(),this.map={stop:new Yd}}get name(){return`gradient`}get tag(){return`gradientFill`}render(e,t){switch(e.openNode(`gradientFill`),t.gradient){case`angle`:e.addAttribute(`degree`,t.degree);break;case`path`:e.addAttribute(`type`,`path`),t.center.left&&(e.addAttribute(`left`,t.center.left),t.center.right===void 0&&e.addAttribute(`right`,t.center.left)),t.center.right&&e.addAttribute(`right`,t.center.right),t.center.top&&(e.addAttribute(`top`,t.center.top),t.center.bottom===void 0&&e.addAttribute(`bottom`,t.center.top)),t.center.bottom&&e.addAttribute(`bottom`,t.center.bottom);break;default:break}let n=this.map.stop;t.stops.forEach(t=>{n.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`gradientFill`:{let t=this.model={stops:[]};return e.attributes.degree?(t.gradient=`angle`,t.degree=parseInt(e.attributes.degree,10)):e.attributes.type===`path`&&(t.gradient=`path`,t.center={left:e.attributes.left?parseFloat(e.attributes.left):0,top:e.attributes.top?parseFloat(e.attributes.top):0},e.attributes.right!==e.attributes.left&&(t.center.right=e.attributes.right?parseFloat(e.attributes.right):0),e.attributes.bottom!==e.attributes.top&&(t.center.bottom=e.attributes.bottom?parseFloat(e.attributes.bottom):0)),!0}case`stop`:return this.parser=this.map.stop,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.model.stops.push(this.parser.model),this.parser=void 0),!0):!1}},Qd=class e extends U{constructor(){super(),this.map={patternFill:new Xd,gradientFill:new Zd}}get tag(){return`fill`}render(e,t){t.type!==`pattern`&&t.type!==`gradient`||(e.openNode(`fill`),t.type===`pattern`?this.map.patternFill.render(e,t):this.map.gradientFill.render(e,t),e.closeNode())}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`fill`:return this.model={},!0;default:return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.model=this.parser.model,this.model.type=this.parser.name,this.parser=void 0),!0):!1}validStyle(t){return e.validPatternValues[t]}static{this.validPatternValues=[`none`,`solid`,`darkVertical`,`darkGray`,`mediumGray`,`lightGray`,`gray125`,`gray0625`,`darkHorizontal`,`darkVertical`,`darkDown`,`darkUp`,`darkGrid`,`darkTrellis`,`lightHorizontal`,`lightVertical`,`lightDown`,`lightUp`,`lightGrid`,`lightTrellis`,`lightGrid`].reduce((e,t)=>(e[t]=!0,e),{})}static{this.StopXform=Yd}static{this.PatternFillXform=Xd}static{this.GradientFillXform=Zd}},$d=class extends U{constructor(e){super(),this.tag=e.tag,this.attr=e.attr}render(e,t){t&&(e.openNode(this.tag),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.model=!0)}parseText(){}parseClose(){return!1}},ef=class extends U{constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this.zero=e.zero,this.text=[]}render(e,t){(t||this.zero)&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,t):e.writeText(t),e.closeNode())}parseOpen(e){return e.name===this.tag?(this.attr?this.model=parseInt(e.attributes[this.attr],10):this.text=[],!0):!1}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=parseInt(this.text.join(``)||`0`,10)),!1}},G=class extends U{constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this.text=[]}render(e,t){t!==void 0&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,t):e.writeText(t),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.attr?this.model=e.attributes[this.attr]:this.text=[])}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=this.text.join(``)),!1}},tf=class e extends U{static{this.Attributes={single:{},double:{val:`double`},singleAccounting:{val:`singleAccounting`},doubleAccounting:{val:`doubleAccounting`}}}constructor(e){super(),this.model=e}get tag(){return`u`}render(t,n){if(n||=this.model,n===!0)t.leafNode(`u`);else{let r=e.Attributes[n];r&&t.leafNode(`u`,r)}}parseOpen(e){e.name===`u`&&(this.model=e.attributes.val||!0)}parseText(){}parseClose(){return!1}},nf=class e extends U{constructor(t){super(),this.options=t||e.OPTIONS;let n=[{tag:`b`,prop:`bold`,xform:new $d({tag:`b`,attr:`val`})},{tag:`i`,prop:`italic`,xform:new $d({tag:`i`,attr:`val`})},{tag:`u`,prop:`underline`,xform:new tf},{tag:`strike`,prop:`strike`,xform:new $d({tag:`strike`,attr:`val`})},{tag:`condense`,prop:`condense`,xform:new $d({tag:`condense`,attr:`val`})},{tag:`extend`,prop:`extend`,xform:new $d({tag:`extend`,attr:`val`})},{tag:`outline`,prop:`outline`,xform:new $d({tag:`outline`,attr:`val`})},{tag:`shadow`,prop:`shadow`,xform:new $d({tag:`shadow`,attr:`val`})},{tag:`sz`,prop:`size`,xform:new ef({tag:`sz`,attr:`val`})},{tag:`color`,prop:`color`,xform:new Hd},{tag:this.options.fontNameTag,prop:`name`,xform:new G({tag:this.options.fontNameTag,attr:`val`})},{tag:`family`,prop:`family`,xform:new ef({tag:`family`,attr:`val`})},{tag:`scheme`,prop:`scheme`,xform:new G({tag:`scheme`,attr:`val`})},{tag:`charset`,prop:`charset`,xform:new ef({tag:`charset`,attr:`val`})},{tag:`vertAlign`,prop:`vertAlign`,xform:new G({tag:`vertAlign`,attr:`val`})}];this.map=Object.fromEntries(n.map(e=>[e.tag,{prop:e.prop,xform:e.xform}])),this.renderOrder=n.map(e=>e.tag)}get tag(){return this.options.tagName}render(e,t){let{map:n,renderOrder:r}=this;e.openNode(this.options.tagName),r.forEach(r=>{n[r].xform.render(e,t[n[r].prop])}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(this.map[e.name])return this.parser=this.map[e.name].xform,this.parser.parseOpen(e);switch(e.name){case this.options.tagName:return this.model={},!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser&&!this.parser.parseClose(e)){let t=this.map[e];return this.parser.model&&(this.model[t.prop]=this.parser.model),this.parser=void 0,!0}switch(e){case this.options.tagName:return!1;default:return!0}}static{this.OPTIONS={tagName:`font`,fontNameTag:`name`}}};let rf={0:{f:`General`},1:{f:`0`},2:{f:`0.00`},3:{f:`#,##0`},4:{f:`#,##0.00`},9:{f:`0%`},10:{f:`0.00%`},11:{f:`0.00E+00`},12:{f:`# ?/?`},13:{f:`# ??/??`},14:{f:`mm-dd-yy`},15:{f:`d-mmm-yy`},16:{f:`d-mmm`},17:{f:`mmm-yy`},18:{f:`h:mm AM/PM`},19:{f:`h:mm:ss AM/PM`},20:{f:`h:mm`},21:{f:`h:mm:ss`},22:{f:`m/d/yy h:mm`},27:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},28:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},29:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},30:{"zh-tw":`m/d/yy `,"zh-cn":`m-d-yy`,"ja-jp":`m/d/yy`,"ko-kr":`mm-dd-yy`},31:{"zh-tw":`yyyy"年"m"月"d"日"`,"zh-cn":`yyyy"年"m"月"d"日"`,"ja-jp":`yyyy"年"m"月"d"日"`,"ko-kr":`yyyy"년" mm"월" dd"일"`},32:{"zh-tw":`hh"時"mm"分"`,"zh-cn":`h"时"mm"分"`,"ja-jp":`h"時"mm"分"`,"ko-kr":`h"시" mm"분"`},33:{"zh-tw":`hh"時"mm"分"ss"秒"`,"zh-cn":`h"时"mm"分"ss"秒"`,"ja-jp":`h"時"mm"分"ss"秒"`,"ko-kr":`h"시" mm"분" ss"초"`},34:{"zh-tw":`上午/下午 hh"時"mm"分"`,"zh-cn":`上午/下午 h"时"mm"分"`,"ja-jp":`yyyy"年"m"月"`,"ko-kr":`yyyy-mm-dd`},35:{"zh-tw":`上午/下午 hh"時"mm"分"ss"秒"`,"zh-cn":`上午/下午 h"时"mm"分"ss"秒"`,"ja-jp":`m"月"d"日"`,"ko-kr":`yyyy-mm-dd`},36:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},37:{f:`#,##0 ;(#,##0)`},38:{f:`#,##0 ;[Red](#,##0)`},39:{f:`#,##0.00;(#,##0.00)`},40:{f:`#,##0.00;[Red](#,##0.00)`},45:{f:`mm:ss`},46:{f:`[h]:mm:ss`},47:{f:`mmss.0`},48:{f:`##0.0E+0`},49:{f:`@`},50:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},51:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},52:{"zh-tw":`上午/下午 hh"時"mm"分"`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`yyyy"年"m"月"`,"ko-kr":`yyyy-mm-dd`},53:{"zh-tw":`上午/下午 hh"時"mm"分"ss"秒"`,"zh-cn":`m"月"d"日"`,"ja-jp":`m"月"d"日"`,"ko-kr":`yyyy-mm-dd`},54:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},55:{"zh-tw":`上午/下午 hh"時"mm"分"`,"zh-cn":`上午/下午 h"时"mm"分"`,"ja-jp":`yyyy"年"m"月"`,"ko-kr":`yyyy-mm-dd`},56:{"zh-tw":`上午/下午 hh"時"mm"分"ss"秒"`,"zh-cn":`上午/下午 h"时"mm"分"ss"秒"`,"ja-jp":`m"月"d"日"`,"ko-kr":`yyyy-mm-dd`},57:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},58:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},59:{"th-th":`t0`},60:{"th-th":`t0.00`},61:{"th-th":`t#,##0`},62:{"th-th":`t#,##0.00`},67:{"th-th":`t0%`},68:{"th-th":`t0.00%`},69:{"th-th":`t# ?/?`},70:{"th-th":`t# ??/??`},81:{"th-th":`d/m/bb`}};function af(){let e={};return Object.entries(rf).forEach(([t,n])=>{n.f&&(e[n.f]=parseInt(t,10))}),e}let of=null;function sf(){return of||=af(),of}var cf=class extends U{constructor(e,t){super(),this.id=e,this.formatCode=t}get tag(){return`numFmt`}render(e,t){e.leafNode(`numFmt`,{numFmtId:t.id,formatCode:t.formatCode})}parseOpen(e){switch(e.name){case`numFmt`:return this.model={id:parseInt(e.attributes.numFmtId,10),formatCode:e.attributes.formatCode.replace(/[\\](.)/g,`$1`)},!0;default:return!1}}parseText(){}parseClose(){return!1}static getDefaultFmtId(e){return sf()[e]}static getDefaultFmtCode(e){return rf[e]&&rf[e].f}};let lf={boolean(e,t){return e===void 0?t:e}};var uf=class extends U{get tag(){return`protection`}render(e,t){let n={},r=lf.boolean(t.locked,!0)?void 0:`0`,i=lf.boolean(t.hidden,!1)?`1`:void 0;r!==void 0&&(n.locked=r),i!==void 0&&(n.hidden=i),Object.keys(n).length>0&&e.leafNode(`protection`,n)}parseOpen(e){let t={locked:e.attributes.locked!==`0`,hidden:e.attributes.hidden===`1`},n=!t.locked||t.hidden;this.model=n?t:null}parseText(){}parseClose(){return!1}},df=class extends U{constructor(){super(),this.map={alignment:new Jd,border:new Wd,fill:new Qd,font:new nf,numFmt:new cf,protection:new uf}}get tag(){return`dxf`}render(e,t){if(e.openNode(this.tag),t.font&&this.map.font.render(e,t.font),t.numFmt&&t.numFmtId){let n={id:t.numFmtId,formatCode:t.numFmt};this.map.numFmt.render(e,n)}t.fill&&this.map.fill.render(e,t.fill),t.alignment&&this.map.alignment.render(e,t.alignment),t.border&&this.map.border.render(e,t.border),t.protection&&this.map.protection.render(e,t.protection),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:return this.reset(),!0;default:return this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e===this.tag?(this.model={alignment:this.map.alignment.model,border:this.map.border.model,fill:this.map.fill.model,font:this.map.font.model,numFmt:this.map.numFmt.model,protection:this.map.protection.model},!1):!0}},ff=class extends U{constructor(e){super(),this.xfId=!!(e&&e.xfId),this.map={alignment:new Jd,protection:new uf}}get tag(){return`xf`}render(e,t){e.openNode(`xf`,{numFmtId:t.numFmtId??0,fontId:t.fontId??0,fillId:t.fillId??0,borderId:t.borderId??0}),this.xfId&&e.addAttribute(`xfId`,t.xfId??0),(t.applyNumberFormat||t.numFmtId)&&e.addAttribute(`applyNumberFormat`,`1`),(t.applyFont||t.fontId)&&e.addAttribute(`applyFont`,`1`),(t.applyFill||t.fillId)&&e.addAttribute(`applyFill`,`1`),(t.applyBorder||t.borderId)&&e.addAttribute(`applyBorder`,`1`),(t.applyAlignment||t.alignment)&&e.addAttribute(`applyAlignment`,`1`),(t.applyProtection||t.protection)&&e.addAttribute(`applyProtection`,`1`),t.pivotButton&&e.addAttribute(`pivotButton`,`1`),t.alignment&&this.map.alignment.render(e,t.alignment),t.protection&&this.map.protection.render(e,t.protection),t.checkbox&&t.xfComplementIndex!==void 0&&(e.openNode(`extLst`),e.openNode(`ext`,{"xmlns:xfpb":`http://schemas.microsoft.com/office/spreadsheetml/2022/featurepropertybag`,uri:`{C7286773-470A-42A8-94C5-96B5CB345126}`}),e.leafNode(`xfpb:xfComplement`,{i:t.xfComplementIndex}),e.closeNode(),e.closeNode()),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`xf`:this.model={numFmtId:parseInt(e.attributes.numFmtId,10),fontId:parseInt(e.attributes.fontId,10),fillId:parseInt(e.attributes.fillId,10),borderId:parseInt(e.attributes.borderId,10)},this.xfId&&(this.model.xfId=parseInt(e.attributes.xfId,10)),e.attributes.pivotButton===`1`&&(this.model.pivotButton=!0);for(let t of[`applyNumberFormat`,`applyFont`,`applyFill`,`applyBorder`,`applyAlignment`,`applyProtection`])e.attributes[t]===`1`&&(this.model[t]=!0);return!0;case`alignment`:return this.parser=this.map.alignment,this.parser.parseOpen(e),!0;case`protection`:return this.parser=this.map.protection,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.map.protection===this.parser?this.model.protection=this.parser.model:this.model.alignment=this.parser.model,this.parser=void 0),!0):e!==`xf`}},pf=class e extends U{constructor(t){super(),this.map={numFmts:new W({tag:`numFmts`,count:!0,childXform:new cf}),fonts:new W({tag:`fonts`,count:!0,childXform:new nf,$:{"x14ac:knownFonts":1}}),fills:new W({tag:`fills`,count:!0,childXform:new Qd}),borders:new W({tag:`borders`,count:!0,childXform:new Wd}),cellStyleXfs:new W({tag:`cellStyleXfs`,count:!0,childXform:new ff}),cellXfs:new W({tag:`cellXfs`,count:!0,childXform:new ff({xfId:!0})}),dxfs:new W({tag:`dxfs`,always:!0,count:!0,childXform:new df}),numFmt:new cf,font:new nf,fill:new Qd,border:new Wd,style:new ff({xfId:!0}),cellStyles:e.STATIC_XFORMS.cellStyles,tableStyles:e.STATIC_XFORMS.tableStyles,extLst:e.STATIC_XFORMS.extLst},t&&this.init()}initIndex(){this.index={style:{},numFmt:{},numFmtNextId:164,font:{},border:{},fill:{}}}init(){this.model={styles:[],numFmts:[],fonts:[],borders:[],fills:[],dxfs:[]},this.initIndex(),this._addBorder({}),this._addStyle({numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}),this._addFill({type:`pattern`,pattern:`none`}),this._addFill({type:`pattern`,pattern:`gray125`}),this.weakMap=new WeakMap,this._hasCheckboxes=!1}setDefaultFont(e){this.defaultFont=e}render(t,n){let r=n||this.model;t.openXml(z),t.openNode(`styleSheet`,e.STYLESHEET_ATTRIBUTES),this.index?(r.numFmts&&r.numFmts.length&&(t.openNode(`numFmts`,{count:r.numFmts.length}),r.numFmts.forEach(e=>{t.writeRaw(e)}),t.closeNode()),r.fonts.length||this._addFont(this.defaultFont||{size:11,color:{theme:1},name:`Calibri`,family:2,scheme:`minor`}),t.openNode(`fonts`,{count:r.fonts.length,"x14ac:knownFonts":1}),r.fonts.forEach(e=>{t.writeRaw(e)}),t.closeNode(),t.openNode(`fills`,{count:r.fills.length}),r.fills.forEach(e=>{t.writeRaw(e)}),t.closeNode(),t.openNode(`borders`,{count:r.borders.length}),r.borders.forEach(e=>{t.writeRaw(e)}),t.closeNode(),this.map.cellStyleXfs.render(t,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),t.openNode(`cellXfs`,{count:r.styles.length}),r.styles.forEach(e=>{t.writeRaw(e)}),t.closeNode()):(this.map.numFmts.render(t,r.numFmts),this.map.fonts.render(t,r.fonts),this.map.fills.render(t,r.fills),this.map.borders.render(t,r.borders),this.map.cellStyleXfs.render(t,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(t,r.styles)),e.STATIC_XFORMS.cellStyles.render(t),this.map.dxfs.render(t,r.dxfs),e.STATIC_XFORMS.tableStyles.render(t),e.STATIC_XFORMS.extLst.render(t),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`styleSheet`:return this.initIndex(),!0;default:return this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`styleSheet`:{this.model={};let e=(e,t)=>{t.model&&t.model.length&&(this.model[e]=t.model)};if(e(`numFmts`,this.map.numFmts),e(`fonts`,this.map.fonts),e(`fills`,this.map.fills),e(`borders`,this.map.borders),e(`styles`,this.map.cellXfs),e(`dxfs`,this.map.dxfs),this.map.fonts.model&&this.map.fonts.model.length>0&&(this.defaultFont=this.map.fonts.model[0]),this.index={model:[],numFmt:{}},this.model.numFmts){let e=this.index.numFmt;this.model.numFmts.forEach(t=>{e[t.id]=t.formatCode})}return!1}default:return!0}}addStyleModel(e,t){if(!e)return 0;this.model.fonts.length||this._addFont(this.defaultFont||{size:11,color:{theme:1},name:`Calibri`,family:2,scheme:`minor`});let n=t||2;if(n!==12&&this.weakMap&&this.weakMap.has(e))return this.weakMap.get(e);let r={};if(e.numFmt)r.numFmtId=this._addNumFmtStr(e.numFmt);else switch(n){case 2:r.numFmtId=this._addNumFmtStr(`General`);break;case 4:r.numFmtId=this._addNumFmtStr(`mm-dd-yy`);break;default:break}e.font&&(r.fontId=this._addFont(e.font)),e.border&&(r.borderId=this._addBorder(e.border)),e.fill&&(r.fillId=this._addFill(e.fill)),e.alignment&&(r.alignment=e.alignment),e.protection&&(r.protection=e.protection);for(let t of[`pivotButton`,`applyNumberFormat`,`applyFont`,`applyFill`,`applyBorder`,`applyAlignment`,`applyProtection`])e[t]&&(r[t]=!0);n===12&&(this._hasCheckboxes=!0,r.alignment=r.alignment||{},r.checkbox=!0,r.xfComplementIndex=0);let i=this._addStyle(r);return n!==12&&this.weakMap&&this.weakMap.set(e,i),i}getStyleModel(e){let t=this.model.styles[e];if(!t)return null;let n=this.index.model[e];if(n)return n;if(n=this.index.model[e]={},t.numFmtId){let e=this.index.numFmt[t.numFmtId]||cf.getDefaultFmtCode(t.numFmtId);e&&(n.numFmt=e)}function r(e,t,r){if(r||r===0){let i=t[r];i&&(n[e]=i)}}r(`font`,this.model.fonts,t.fontId),r(`border`,this.model.borders,t.borderId),r(`fill`,this.model.fills,t.fillId),t.alignment&&(n.alignment=t.alignment),t.protection&&(n.protection=t.protection);for(let e of[`pivotButton`,`applyNumberFormat`,`applyFont`,`applyFill`,`applyBorder`,`applyAlignment`,`applyProtection`])t[e]&&(n[e]=!0);return n}addDxfStyle(e){return e.numFmt&&(e.numFmtId=this._addNumFmtStr(e.numFmt)),this.model.dxfs.push(e),this.model.dxfs.length-1}getDxfStyle(e){return this.model.dxfs[e]}get hasCheckboxes(){return!!this._hasCheckboxes}_addStyle(e){let t=this.map.style.toXml(e),n=this.index.style[t];return n===void 0&&(n=this.index.style[t]=this.model.styles.length,this.model.styles.push(t)),n}_addNumFmtStr(e){let t=cf.getDefaultFmtId(e);if(t!==void 0||(t=this.index.numFmt[e],t!==void 0))return t;t=this.index.numFmt[e]=164+this.model.numFmts.length;let n=this.map.numFmt.toXml({id:t,formatCode:e});return this.model.numFmts.push(n),t}_addFont(e){let t=this.map.font.toXml(e),n=this.index.font[t];return n===void 0&&(n=this.index.font[t]=this.model.fonts.length,this.model.fonts.push(t)),n}_addBorder(e){let t=this.map.border.toXml(e),n=this.index.border[t];return n===void 0&&(n=this.index.border[t]=this.model.borders.length,this.model.borders.push(t)),n}_addFill(e){let t=this.map.fill.toXml(e),n=this.index.fill[t];return n===void 0&&(n=this.index.fill[t]=this.model.fills.length,this.model.fills.push(t)),n}static{this.STYLESHEET_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x14ac x16r2`,"xmlns:x14ac":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac`,"xmlns:x16r2":`http://schemas.microsoft.com/office/spreadsheetml/2015/02/main`}}static{this.STATIC_XFORMS={cellStyles:new Ld({tag:`cellStyles`,$:{count:1},c:[{tag:`cellStyle`,$:{name:`Normal`,xfId:0,builtinId:0}}]}),dxfs:new Ld({tag:`dxfs`,$:{count:0}}),tableStyles:new Ld({tag:`tableStyles`,$:{count:0,defaultTableStyle:`TableStyleMedium2`,defaultPivotStyle:`PivotStyleLight16`}}),extLst:new Ld({tag:`extLst`,c:[{tag:`ext`,$:{uri:`{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`},c:[{tag:`x14:slicerStyles`,$:{defaultSlicerStyle:`SlicerStyleLight1`}}]},{tag:`ext`,$:{uri:`{9260A510-F301-46a8-8635-F512D64BE5F5}`,"xmlns:x15":`http://schemas.microsoft.com/office/spreadsheetml/2010/11/main`},c:[{tag:`x15:timelineStyles`,$:{defaultTimelineStyle:`TimeSlicerStyleLight1`}}]}]})}}};pf.Mock=class extends pf{constructor(){super(),this.model={styles:[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}],numFmts:[],fonts:[{size:11,color:{theme:1},name:`Calibri`,family:2,scheme:`minor`}],borders:[{}],fills:[{type:`pattern`,pattern:`none`},{type:`pattern`,pattern:`gray125`}]}}parseStream(e){return e.autodrain(),Promise.resolve()}addStyleModel(e,t){switch(t){case 12:throw new Mr(`Checkbox cells`,`require styles to be enabled (useStyles: true)`);case 4:return this.dateStyleId;default:return 0}}get hasCheckboxes(){return!1}get dateStyleId(){if(!this._dateStyleId){let e={numFmtId:cf.getDefaultFmtId(`mm-dd-yy`)};this._dateStyleId=this.model.styles.length,this.model.styles.push(e)}return this._dateStyleId}getStyleModel(){return{}}};var mf=class extends D{getHyperlinkReader(e){return this._hyperlinkReadersBySheetNo?.[String(e)]}getHyperlink(e,t){return this.getHyperlinkReader(e)?.hyperlinks?.[t]}getHyperlinkTarget(e,t){return this.getHyperlink(e,t)?.target}constructor(e,t,n,r){super(),this.hasDynamicArrayMetadata=!1,this._totalBufferedBytes=0,this.input=e,this.WorksheetReaderClass=n,this.HyperlinkReaderClass=r,this._maxBufferedBytes=t.maxBufferedWorksheetBytes??256*1024*1024,this.options={worksheets:`emit`,sharedStrings:`cache`,hyperlinks:`ignore`,styles:`ignore`,entries:`ignore`,...t},this.styles=new pf,this.styles.init()}_getStream(e){if(e instanceof k)return e;if(e&&typeof e==`object`&&typeof e.getReader==`function`){let t=k.fromWeb;if(typeof t==`function`)return t(e);try{return new k({stream:e})}catch{throw new Nr(`<ReadableStream>`,`read`,`Could not recognise input`)}}let t=e;if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t instanceof Uint8Array)return k.from([t]);throw new Nr(String(e),`read`,`Could not recognise input`)}_cleanupWaitingWorksheets(e){for(let t of e)t&&typeof t.cleanup==`function`&&t.cleanup()}_createWorksheetReader(e){return new this.WorksheetReaderClass({workbook:this,id:e.id,iterator:e.iterator,options:e.options})}_createHyperlinkReader(e){return new this.HyperlinkReaderClass({workbook:this,id:e.id,iterator:e.iterator,options:e.options})}async read(e,t){try{for await(let{eventType:n,value:r}of this.parse(e,t))switch(n){case`shared-strings`:this.emit(n,r);break;case`worksheet`:this.emit(n,r),await r.read();break;case`hyperlinks`:this.emit(n,r);break}this.emit(`end`),this.emit(`finished`)}catch(e){this.emit(`error`,e)}}async*[Symbol.asyncIterator](){for await(let{eventType:e,value:t}of this.parse())e===`worksheet`&&(yield t)}async*parse(e,t){t&&(this.options=t);let n=this.stream=this._getStream(e||this.input),r=[];try{for await(let e of this._parseEntries(n))if(e.eventType===`waiting-worksheet`){let t=await this._storeWaitingWorksheet(e.sheetNo,e.entry);r.push(t)}else yield e;yield*this._processWaitingWorksheets(r)}catch(e){throw this._cleanupWaitingWorksheets(r),e}}_emitEntry(e){this.options.entries===`emit`&&this.emit(`entry`,e)}async _parseRels(e){let t=new Vd;this.workbookRels=await t.parseStream(eu(e)),this._workbookRelIdByTarget=Object.create(null);for(let e of this.workbookRels??[])e?.Target&&e?.Id&&(this._workbookRelIdByTarget[e.Target]=e.Id)}async _parseWorkbook(e){this._emitEntry({type:`workbook`});let t=new Rd;this.model=await t.parseStream(eu(e)),this.properties=t.map?.workbookPr,this._sheetByRelId=Object.create(null);for(let e of this.model?.sheets??[])this._sheetByRelId[e.rId]=e}async*_parseSharedStrings(e){switch(this._emitEntry({type:`shared-strings`}),this.options.sharedStrings){case`cache`:this.sharedStrings=[];break;case`emit`:break;default:return}let t=null,n=[],r=0,i=null,a=!1;if(this.options.sharedStrings===`cache`){let r=this.sharedStrings,o=new ic({position:!1,invalidCharHandling:`skip`});o.on(`opentag`,e=>{switch(e.name){case`b`:i||={},i.bold=!0;break;case`charset`:i||={},i.charset=parseInt(e.attributes.charset,10);break;case`color`:i||={},i.color={},e.attributes.rgb&&(i.color.argb=e.attributes.rgb),e.attributes.val&&(i.color.argb=e.attributes.val),e.attributes.theme&&(i.color.theme=e.attributes.theme);break;case`family`:i||={},i.family=parseInt(e.attributes.val,10);break;case`i`:i||={},i.italic=!0;break;case`outline`:i||={},i.outline=!0;break;case`rFont`:i||={},i.name=e.attributes.val;break;case`r`:a=!0;break;case`si`:i=null,n=[],t=null,a=!1;break;case`sz`:i||={},i.size=parseInt(e.attributes.val,10);break;case`strike`:i||={},i.strike=!0;break;case`t`:t=null;break;case`u`:i||={},i.underline=!0;break;case`vertAlign`:i||={},i.vertAlign=e.attributes.val;break}}),o.on(`text`,e=>{t=t?t+e:e}),o.on(`closetag`,e=>{switch(e.name){case`t`:t!=null&&t.includes(`_x`)&&(t=Pc(t));break;case`r`:a&&(n.push({font:i,text:t}),i=null,t=null);break;case`si`:r.push(n.length?{richText:n}:t??``),n=[],i=null,t=null,a=!1;break}}),await ac(o,eu(e));return}let o=new ic({invalidCharHandling:`skip`}),s=new TextDecoder(`utf-8`,{fatal:!0}),c=[];o.on(`opentag`,e=>{switch(e.name){case`b`:i||={},i.bold=!0;break;case`charset`:i||={},i.charset=parseInt(e.attributes.charset,10);break;case`color`:i||={},i.color={},e.attributes.rgb&&(i.color.argb=e.attributes.rgb),e.attributes.val&&(i.color.argb=e.attributes.val),e.attributes.theme&&(i.color.theme=e.attributes.theme);break;case`family`:i||={},i.family=parseInt(e.attributes.val,10);break;case`i`:i||={},i.italic=!0;break;case`outline`:i||={},i.outline=!0;break;case`rFont`:i||={},i.name=e.attributes.val;break;case`r`:a=!0;break;case`si`:i=null,n=[],t=null,a=!1;break;case`sz`:i||={},i.size=parseInt(e.attributes.val,10);break;case`strike`:i||={},i.strike=!0;break;case`t`:t=null;break;case`u`:i||={},i.underline=!0;break;case`vertAlign`:i||={},i.vertAlign=e.attributes.val;break}}),o.on(`text`,e=>{t=t?t+e:e}),o.on(`closetag`,e=>{switch(e.name){case`t`:t!=null&&t.includes(`_x`)&&(t=Pc(t));break;case`r`:a&&(n.push({font:i,text:t}),i=null,t=null);break;case`si`:c.push({index:r++,text:n.length?{richText:n}:t??``}),n=[],i=null,t=null,a=!1;break}});for await(let t of eu(e)){let e=typeof t==`string`?t:s.decode(t,{stream:!0});if(o.write(e),c.length>0){for(let e of c)yield e;c=[]}}let l=s.decode();if(l&&o.write(l),o.close(),c.length>0)for(let e of c)yield e}async _parseStyles(e){this._emitEntry({type:`styles`}),this.options.styles===`cache`&&(this.styles=new pf,await this.styles.parseStream(eu(e)))}async _parseMetadata(e){let t=await new zd().parseStream(eu(e));t&&(this.hasDynamicArrayMetadata=!!t.hasDynamicArrays,this.dynamicArrayCmIndices=t.dynamicArrayCmIndices)}*_parseWorksheet(e,t){this._emitEntry({type:`worksheet`,id:t});let n=parseInt(t,10),r=this._createWorksheetReader({id:n,iterator:e,options:this.options});r.sheetNo=n;let i=this._workbookRelIdByTarget?.[Uu(t)],a=i?this._sheetByRelId?.[i]:void 0;a&&(r.id=a.id,r.name=a.name,r.state=a.state),this.options.worksheets===`emit`&&(yield{eventType:`worksheet`,value:r})}async*_parseHyperlinks(e,t){this._emitEntry({type:`hyperlinks`,id:t});let n=this._createHyperlinkReader({id:parseInt(t,10),iterator:e,options:this.options});if(this.options.hyperlinks===`cache`){this._hyperlinkReadersBySheetNo||=Object.create(null),this._hyperlinkReadersBySheetNo[t]=n;let e=n.read;typeof e==`function`&&await e.call(n);return}this.options.hyperlinks===`emit`&&(yield{eventType:`hyperlinks`,value:n})}async*_parseEntries(e){let t=Ls({forceStream:!0});e.on(`error`,e=>t.emit(`error`,e)),e.pipe(t);for await(let e of eu(t)){let t,n=vu(e.path);switch(n){case V.rootRels:break;case V.xlWorkbookRels:await this._parseRels(e);break;case V.xlWorkbook:await this._parseWorkbook(e);break;case V.xlSharedStrings:for await(let t of this._parseSharedStrings(e))yield{eventType:`shared-strings`,value:t};break;case V.xlStyles:await this._parseStyles(e);break;case V.xlMetadata:await this._parseMetadata(e);break;default:if(t=yu(n)?.toString(),t)if(this.workbookRels&&this.model&&(this.options.sharedStrings!==`cache`||this.sharedStrings)){yield*this._parseWorksheet(eu(e),t);continue}else{yield{eventType:`waiting-worksheet`,sheetNo:t,entry:e};continue}if(t=bu(n)?.toString(),t){yield*this._parseHyperlinks(eu(e),t);continue}break}e.autodrain()}}},hf=class extends mf{constructor(e,t={}){super(e,t,$l,oc)}async _storeWaitingWorksheet(e,t){let n=[],r=new TextEncoder;for await(let e of eu(t)){let t;if(e instanceof Uint8Array)t=e;else if(typeof e==`string`)t=r.encode(e);else continue;if(this._totalBufferedBytes+=t.length,this._totalBufferedBytes>this._maxBufferedBytes)throw Error(`Buffered worksheet data exceeds limit of ${this._maxBufferedBytes} bytes. The XLSX file may be malicious (adversarial ZIP entry ordering) or too large for streaming. Increase maxBufferedWorksheetBytes if this is expected.`);n.push(t)}return{sheetNo:e,data:n}}async*_processWaitingWorksheets(e){for(let t of e){let e=(async function*(){for(let e of t.data)yield e})();yield*this._parseWorksheet(e,t.sheetNo)}}};let gf={maxWorkers:typeof navigator<`u`&&navigator.hardwareConcurrency||4,minWorkers:0,idleTimeout:3e4,useTransferables:!0,workerUrl:void 0};function _f(e){let t=e?.maxWorkers??gf.maxWorkers,n=e?.minWorkers??gf.minWorkers;return{maxWorkers:Math.max(1,t),minWorkers:Math.max(0,Math.min(n,t)),idleTimeout:Math.max(0,e?.idleTimeout??gf.idleTimeout),useTransferables:e?.useTransferables??gf.useTransferables,workerUrl:e?.workerUrl}}let vf={high:3,normal:2,low:1};function yf(e){return e?vf[e]??vf.normal:vf.normal}function bf(){return typeof Worker<`u`&&typeof Blob<`u`}function xf(){return`
|
|
114
|
+
`),t=this.i;continue}if(r>=128){if(this.prevI=this.i,r>=55296&&r<=56319){let i=e.charCodeAt(this.i+1);i>=56320&&i<=57343?this.i+=2:(this.i++,t=this.handleInvalidCharInText(r,n,t,`lone surrogate`))}else r>=56320&&r<=57343?(this.i++,t=this.handleInvalidCharInText(r,n,t,`lone surrogate`)):r===65534||r===65535?(this.i++,t=this.handleInvalidCharInText(r,n,t)):this.i++;this.trackPosition&&this.column++;continue}this.prevI=this.i,this.i++,this.trackPosition&&this.column++,t=this.handleInvalidCharInText(r,n,t)}n&&t<this.i&&(this.text+=e.slice(t,this.i))}handleTextOutsideRoot(){let{chunk:e}=this,{i:t}=this,n=this._handlers.text,r=!1,i=this.invalidCharHandling===`skip`,a=this.invalidCharHandling===`replace`;for(;;){let o=this.i,s=this.getCode();if(s===-1){n&&t<o&&(this.text+=e.slice(t,o));break}if(i&&this.prevI>o&&(n&&t<o&&(this.text+=e.slice(t,o)),t=this.prevI),a&&s===ec&&e.charCodeAt(this.prevI)!==ec){n&&(t<this.prevI&&(this.text+=e.slice(t,this.prevI)),this.text+=`�`),t=this.i,r=!0;continue}if(s===60){if(n){let r=e.slice(t,this.prevI);this.text.length>0?(n(this.text+r),this.text=``):r.length>0&&n(r)}this.state=1;break}if(s===38){n&&(this.text+=e.slice(t,this.prevI)),this.state=25,this.entityReturnState=0,this.entity=``,r=!0;break}s===10?(n&&(this.text+=e.slice(t,this.prevI)+`
|
|
115
|
+
`),t=this.i):ac(s)||(r=!0)}r&&(!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail(`text data outside of root node.`),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail(`text data outside of root node.`),this.reportedTextAfterRoot=!0))}sOpenWaka(){let e=this.getCode();if(e!==-1){if(sc(e)){this.closedRoot&&!this.fragment&&this.fail(`documents may contain only one root element`),this.state=3,this.name=nc(e);return}switch(e){case 47:this.state=11,this.name=``;break;case 33:this.state=2,this.openWakaBang=``;break;case 63:this.state=19,this.text=``;break;default:this.fail(`unexpected character in tag`),this.state=0}}}sOpenWakaBang(){let e=this.getCode();if(e!==-1)switch(this.openWakaBang+=nc(e),this.openWakaBang){case`[CDATA[`:this.state=16,this.text=``,this.openWakaBang=``;break;case`--`:this.state=13,this.text=``,this.openWakaBang=``;break;case`DOCTYPE`:this.state=21,this.text=``,this.openWakaBang=``;break;default:this.openWakaBang.length>=7&&(this.fail(`incorrect syntax`),this.state=0)}}sOpenTag(){let{chunk:e}=this,t=this.i,n=this.i;for(;n<e.length;){let t=e.charCodeAt(n);if(t<128?ic[t]===1:cc(t))n++;else break}if(n>=e.length){this.name+=e.slice(t,n),this.i=n,this.trackPosition&&(this.column+=n-t);return}this.name+=e.slice(t,n),this.i=n,this.trackPosition&&(this.column+=n-t);let r=this.getCode();r!==-1&&(this.tag={name:this.name,attributes:Object.create(null),isSelfClosing:!1},this.attribList=[],this.sawRoot=!0,r===62?this.openTag():r===47?this.state=4:(ac(r)||this.fail(`unexpected character in tag`),this.state=5))}sOpenTagSlash(){let e=this.getCode();e!==-1&&(e===62?this.openSelfClosingTag():(this.fail(`expected >`),this.state=5))}sAttrib(){let e=this.skipSpaces();e!==-1&&(sc(e)?(this.name=nc(e),this.state=6):e===62?this.openTag():e===47?this.state=4:this.fail(`unexpected character in attribute`))}sAttribName(){let{chunk:e}=this,t=this.i,n=this.i;for(;n<e.length;){let t=e.charCodeAt(n);if(t<128?ic[t]===1:cc(t))n++;else break}if(n>=e.length){this.name+=e.slice(t,n),this.i=n,this.trackPosition&&(this.column+=n-t);return}this.name+=e.slice(t,n),this.i=n,this.trackPosition&&(this.column+=n-t);let r=this.getCode();r!==-1&&(r===61?this.state=8:ac(r)?this.state=7:r===62?(this.fail(`attribute without value`),this.attribList.push({name:this.name,value:this.name}),this.name=``,this.openTag()):this.fail(`unexpected character in attribute name`))}sAttribNameSawWhite(){let e=this.skipSpaces();e!==-1&&(e===61?this.state=8:(this.fail(`attribute without value`),this.name=``,this.text=``,e===62?this.openTag():sc(e)?(this.name=nc(e),this.state=6):(this.fail(`unexpected character`),this.state=5)))}sAttribValue(){let e=this.skipSpaces();e!==-1&&(oc(e)?(this.q=e,this.text=``,this.state=9):(this.fail(`unquoted attribute value`),this.state=0))}sAttribValueQuoted(){let{q:e,chunk:t}=this,{i:n}=this,r=t.length;for(;this.i<r;){let r=t.charCodeAt(this.i);if(r>=32&&r<=126&&r!==e&&r!==38&&r!==60){this.i++,this.trackPosition&&this.column++;continue}if(r===e){this.prevI=this.i,this.i++,this.trackPosition&&this.column++,this.attribList.push({name:this.name,value:this.text+t.slice(n,this.prevI)}),this.name=``,this.text=``,this.q=null,this.state=10;return}if(r===38){this.prevI=this.i,this.i++,this.trackPosition&&this.column++,this.text+=t.slice(n,this.prevI),this.state=25,this.entityReturnState=9,this.entity=``;return}if(r===60){this.prevI=this.i,this.i++,this.trackPosition&&this.column++,this.text+=t.slice(n,this.prevI),this.fail(`< not allowed in attribute value`),this.attribList.push({name:this.name,value:this.text}),this.name=``,this.text=``,this.q=null,this.unget(),this.state=0;return}if(r===9||r===10){this.prevI=this.i,this.i++,r===10&&this.trackPosition?(this.line++,this.column=0,this.positionAtNewLine=this.position):this.trackPosition&&this.column++,this.text+=t.slice(n,this.prevI)+` `,n=this.i;continue}if(r===13){this.prevI=this.i,this.i++,t.charCodeAt(this.i)===10&&this.i++,this.trackPosition&&(this.line++,this.column=0,this.positionAtNewLine=this.position),this.text+=t.slice(n,this.prevI)+` `,n=this.i;continue}if(r>=128){if(this.prevI=this.i,r>=55296&&r<=56319){let e=t.charCodeAt(this.i+1);e>=56320&&e<=57343?this.i+=2:(this.i++,n=this.handleInvalidCharInAttr(r,n,`lone surrogate`))}else r>=56320&&r<=57343?(this.i++,n=this.handleInvalidCharInAttr(r,n,`lone surrogate`)):r===65534||r===65535?(this.i++,n=this.handleInvalidCharInAttr(r,n)):this.i++;this.trackPosition&&this.column++;continue}this.prevI=this.i,this.i++,this.trackPosition&&this.column++,n=this.handleInvalidCharInAttr(r,n)}this.text+=t.slice(n,this.i)}sAttribValueClosed(){let e=this.getCode();e!==-1&&(ac(e)?this.state=5:e===62?this.openTag():e===47?this.state=4:sc(e)?(this.fail(`no whitespace between attributes`),this.name=nc(e),this.state=6):this.fail(`unexpected character after attribute`))}sCloseTag(){let{chunk:e}=this,t=this.i;if(this.name===``){if(t>=e.length){let e=this.getCode();if(e===-1)return;sc(e)?this.name=nc(e):this.fail(`unexpected character in close tag`);return}let n=e.charCodeAt(t);if(n<128?rc[n]!==1:!sc(n)){this.i=t,this.getCode()!==-1&&this.fail(`unexpected character in close tag`);return}this.name=e[t],t++,this.trackPosition&&this.column++}let n=t;for(;t<e.length;){let n=e.charCodeAt(t);if(n<128?ic[n]===1:cc(n))t++;else break}if(t>n&&(this.name+=e.slice(n,t)),this.trackPosition&&(this.column+=t-n),t>=e.length){this.i=t;return}this.i=t;let r=this.getCode();r!==-1&&(r===62?this.closeTag():ac(r)?this.state=12:this.fail(`unexpected character in close tag`))}sCloseTagSawWhite(){let e=this.skipSpaces();e!==-1&&(e===62?this.closeTag():this.fail(`unexpected character in close tag`))}sComment(){let e=this.getCode();e!==-1&&(e===45?this.state=14:this.text+=nc(e))}sCommentEnding(){let e=this.getCode();e!==-1&&(e===45?this.state=15:(this.text+=`-`+nc(e),this.state=13))}sCommentEnded(){let e=this.getCode();e!==-1&&(e===62?(this._handlers.comment?.(this.text),this.text=``,this.state=0):e===45?this.text+=`-`:(this.fail(`malformed comment`),this.text+=`--`+nc(e),this.state=13))}sCData(){let e=this.getCode();e!==-1&&(e===93?this.state=17:this.text+=nc(e))}sCDataEnding(){let e=this.getCode();e!==-1&&(e===93?this.state=18:(this.text+=`]`+nc(e),this.state=16))}sCDataEnding2(){let e=this.getCode();e!==-1&&(e===62?(this._handlers.cdata?this._handlers.cdata(this.text):this._handlers.text&&this.text.length>0&&this._handlers.text(this.text),this.text=``,this.state=0):e===93?this.text+=`]`:(this.text+=`]]`+nc(e),this.state=16))}sPI(){let e=this.getCode();e!==-1&&(e===63?this.state=20:this.text+=nc(e))}sPIEnding(){let e=this.getCode();if(e!==-1)if(e===62){let e=this.text,t=e.indexOf(` `);t>=0?this._handlers.pi?.(e.slice(0,t),e.slice(t+1)):this._handlers.pi?.(e,``),this.text=``,this.state=0}else e===63?this.text+=`?`:(this.text+=`?`+nc(e),this.state=19)}sDoctype(){let e=this.getCode();e!==-1&&(e===62?(this.text=``,this.state=0):oc(e)?(this.q=e,this.state=22):e===91?this.state=23:this.text+=nc(e))}sDoctypeQuote(){let e=this.getCode();e!==-1&&(e===this.q?(this.q=null,this.state=21):this.text+=nc(e))}sDoctypeDTD(){let e=this.getCode();e!==-1&&(e===93?this.state=21:oc(e)&&(this.q=e,this.state=24))}sDoctypeDTDQuoted(){let e=this.getCode();e!==-1&&e===this.q&&(this.q=null,this.state=23)}sEntity(){let e=this.getCode();if(e!==-1)if(e===59){let e=this.entity,t;e===``?(this.fail(`empty entity`),t=`&;`):t=this.parseEntity(e),this.text+=t,this.state=this.entityReturnState,this.entity=``}else cc(e)||e===35?(this.entity+=nc(e),this.entity.length>64&&(this.fail(`entity name too long`),this.text+=`&`+this.entity,this.state=this.entityReturnState,this.entity=``)):(this.fail(`invalid entity character`),this.text+=`&`+this.entity+nc(e),this.state=this.entityReturnState,this.entity=``)}parseEntity(e){if(e[0]!==`#`){let t=this.ENTITIES[e];return t===void 0?(this.fail(`undefined entity: `+e),`&`+e+`;`):this.maxEntityExpansions>0&&e!==`lt`&&e!==`gt`&&e!==`amp`&&e!==`quot`&&e!==`apos`&&(this._entityExpansionCount++,this._entityExpansionCount>this.maxEntityExpansions)?(this.fail(`entity expansion limit (${this.maxEntityExpansions}) exceeded — possible XML bomb`),``):t}let t;return t=e[1]===`x`||e[1]===`X`?parseInt(e.slice(2),16):parseInt(e.slice(1),10),isNaN(t)||t<1||t>=55296&&t<=57343||t>1114111?(this.fail(`invalid character entity: &#`+e.slice(1)+`;`),``):lc(t)?String.fromCodePoint(t):(this.fail(`invalid character entity`),``)}skipSpaces(){for(;;){let e=this.getCode();if(e===-1||!ac(e))return e}}splitQName(e){let t=e.indexOf(`:`);return t<0?[``,e]:[e.slice(0,t),e.slice(t+1)]}resolveNs(e){for(let t=this._nsStack.length-1;t>=0;t--){let n=this._nsStack[t][e];if(n!==void 0)return n}return``}applyNamespaces(e){let t=`http://www.w3.org/XML/1998/namespace`,n=`http://www.w3.org/2000/xmlns/`,r={},i=e.attributes;for(let e in i)if(Object.prototype.hasOwnProperty.call(i,e)){if(e===`xmlns`)r[``]=i[e];else if(e.startsWith(`xmlns:`)){let a=e.slice(6),o=i[e];a===`xmlns`?this.fail(`the "xmlns" prefix must not be declared`):a===`xml`&&o!==t?this.fail(`the "xml" prefix must be bound to "${t}"`):o===t&&a!==`xml`?this.fail(`namespace "${t}" must only be bound to the "xml" prefix`):o===n&&this.fail(`namespace "${n}" must not be bound to any prefix`),r[a]=o}}this._nsStack.push(r),Object.keys(r).length>0&&(e.ns=r);let[a,o]=this.splitQName(e.name);o.includes(`:`)&&this.fail(`invalid QName "${e.name}": local part must not contain ":"`),e.prefix=a,e.local=o,e.uri=this.resolveNs(a),a!==``&&e.uri===``&&this.fail(`unbound namespace prefix: "${a}"`);let s=new Set;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e)||e===`xmlns`||e.startsWith(`xmlns:`))continue;let[t,n]=this.splitQName(e);if(n.includes(`:`)&&this.fail(`invalid attribute QName "${e}": local part must not contain ":"`),t!==``){let e=this.resolveNs(t);e===``&&this.fail(`unbound namespace prefix on attribute: "${t}"`);let r=e+`\0`+n;s.has(r)&&this.fail(`duplicate attribute by expanded name: {${e}}${n}`),s.add(r)}}}openTag(){let e=this.tag;e.isSelfClosing=!1;for(let{name:t,value:n}of this.attribList)t in e.attributes&&this.fail(`duplicate attribute: ${t}`),e.attributes[t]=n;this.attribList=[],this.xmlns&&this.applyNamespaces(e),this.maxDepth>0&&this.tags.length>=this.maxDepth&&this.fail(`maximum element nesting depth (${this.maxDepth}) exceeded`),this._handlers.opentag?.(e),this.tags.push(e),this.name=``,this.state=0}openSelfClosingTag(){let e=this.tag;e.isSelfClosing=!0;for(let{name:t,value:n}of this.attribList)t in e.attributes&&this.fail(`duplicate attribute: ${t}`),e.attributes[t]=n;this.attribList=[],this.xmlns&&this.applyNamespaces(e),this.maxDepth>0&&this.tags.length>=this.maxDepth&&this.fail(`maximum element nesting depth (${this.maxDepth}) exceeded`),this._handlers.opentag?.(e),this._handlers.closetag?.(e),this.xmlns&&this._nsStack.pop(),this.tags.length===0&&(this.closedRoot=!0),this.name=``,this.state=0}closeTag(){let{tags:e,name:t}=this;if(this.state=0,this.name=``,t===``){this.fail(`empty close tag`),this.text+=`</>`;return}let n=!1;for(let r=e.length-1;r>=0;r--)if(e[r].name===t){for(;e.length>r;){let t=e.pop();this._handlers.closetag?.(t),this.xmlns&&this._nsStack.pop(),e.length>r&&this.fail(`unclosed tag: `+t.name)}n=!0;break}n||(this.fail(`unmatched close tag: `+t),this.text+=`</`+t+`>`),e.length===0&&(this.closedRoot=!0)}end(){for(this.sawRoot||this.fail(`document must contain a root element`);this.tags.length>0;){let e=this.tags.pop();this.fail(`unclosed tag: `+e.name)}return this.text.length>0&&this._handlers.text&&(this._handlers.text(this.text),this.text=``),this._closed=!0,this._init(),this}};async function fc(e,t){let n=new TextDecoder(`utf-8`,{fatal:!0}),r,i=e._handlers?.error;e.on(`error`,e=>{r=e,i?.(e)});for await(let i of t){let t=typeof i==`string`?i:n.decode(i,{stream:!0});if(e.write(t),r)throw o(r)}let a=n.decode();if(a&&e.write(a),e.close(),r)throw o(r)}var pc=class extends Pn{constructor({workbook:e,id:t,iterator:n,options:r}){super(),this._hyperlinkCount=0,this.workbook=e,this.id=t,this.iterator=n,this.options=r}get count(){return this.hyperlinks?this._hyperlinkCount:0}each(e){let t=this.hyperlinks;if(t)for(let n in t)e(t[n],n)}async read(){let{iterator:e}=this,t=this.options.hyperlinks,n=t===`emit`,r=t===`cache`,i=null;if(r&&(this._hyperlinkCount=0,this.hyperlinks=i=Object.create(null)),!n&&!r){this.emit(`finished`);return}try{let t=new dc({position:!1,invalidCharHandling:`skip`}),r=new TextDecoder(`utf-8`,{fatal:!0});t.on(`opentag`,e=>{if(e.name!==`Relationship`)return;let t=e.attributes;if(t.Type!==k.Hyperlink)return;let r={type:7,rId:t.Id,target:t.Target,targetMode:t.TargetMode};if(n){this.emit(`hyperlink`,r);return}let a=r.rId;i&&i[a]===void 0&&(this._hyperlinkCount+=1),i[a]=r});for await(let n of e){let e=typeof n==`string`?n:r.decode(n,{stream:!0});t.write(e)}let a=r.decode();a&&t.write(a),t.close(),this.emit(`finished`)}catch(e){this.emit(`error`,e)}}};let mc=(e,t)=>({...e,...t.reduce((t,n)=>(e[n]&&(t[n]={...e[n]}),t),{})}),hc=(e,t,n,r=[])=>{e[n]&&(t[n]=mc(e[n],r))},gc=e=>Object.keys(e).length===0,_c=e=>{if(!e)return e;if(gc(e))return{};let t={...e};return hc(e,t,`font`,[`color`]),hc(e,t,`alignment`),hc(e,t,`protection`),e.border&&(hc(e,t,`border`),hc(e.border,t.border,`top`,[`color`]),hc(e.border,t.border,`left`,[`color`]),hc(e.border,t.border,`bottom`,[`color`]),hc(e.border,t.border,`right`,[`color`]),hc(e.border,t.border,`diagonal`,[`color`])),e.fill&&(hc(e,t,`fill`,[`fgColor`,`bgColor`,`center`]),e.fill.stops&&(t.fill.stops=e.fill.stops.map(e=>mc(e,[`color`])))),t},vc={'"':`"`,"&":`&`,"<":`<`,">":`>`},yc=/["&<>]/g;function bc(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;let n=typeof e;if(n!==typeof t||n!==`object`)return!1;let r=Array.isArray(e);if(r!==Array.isArray(t))return!1;if(r){let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(!bc(e[r],t[r]))return!1;return!0}let i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(let n=0,r=i.length;n<r;n++){let r=i[n];if(!Object.prototype.hasOwnProperty.call(t,r)||!bc(e[r],t[r]))return!1}return!0}function xc(e){return e.replace(yc,e=>vc[e])}function Sc(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Cc(...e){let t=e[0]||{},n=e.length;for(let r=1;r<n;r++){let n=e[r];if(n)if(Array.isArray(n))for(let e=0,r=n.length;e<r;e++){let r=n[e];if(r===void 0)continue;let i=t[e];Array.isArray(r)?t[e]=Cc(Array.isArray(i)?i:[],r):Sc(r)?t[e]=Cc(Sc(i)?i:{},r):t[e]=r}else{let e=Object.keys(n);for(let r=0,i=e.length;r<i;r++){let i=e[r];if(i===`__proto__`||i===`constructor`||i===`prototype`)continue;let a=n[i];if(a===void 0)continue;let o=t[i];Array.isArray(a)?t[i]=Cc(Array.isArray(o)?o:[],a):Sc(a)?t[i]=Cc(Sc(o)?o:{},a):t[i]=a}}}return t}var wc=class e{constructor(e,t,n){this._worksheet=e,this._number=t,n!==!1&&(this.defn=n)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return O.n2l(this._number)}get isCustomWidth(){return this.width!==void 0&&this.width!==9}get defn(){return{header:this._header,key:this.key,width:this.width,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel,bestFit:this.bestFit}}set defn(e){e?(this.key=e.key,this.width=e.width===void 0?9:e.width,this.outlineLevel=e.outlineLevel,e.style?this.style=_c(e.style)??{}:this.style={},this.header=e.header,this._hidden=!!e.hidden,this.bestFit=e.bestFit):(delete this._header,delete this._key,delete this.width,this.style={},this.outlineLevel=0,delete this.bestFit)}get headers(){return Array.isArray(this._header)?this._header:this._header===void 0?[]:[this._header]}get header(){return this._header}set header(e){e===void 0?this._header=void 0:(this._header=e,this.headers.forEach((e,t)=>{this._worksheet.getCell(t+1,this.number).value=e}))}get key(){return this._key}set key(e){(this._key&&this._worksheet.getColumnKey(this._key))===this&&this._worksheet.deleteColumnKey(this._key),this._key=e,e&&this._worksheet.setColumnKey(e,this)}get hidden(){return!!this._hidden}set hidden(e){this._hidden=e}get outlineLevel(){return this._outlineLevel??0}set outlineLevel(e){this._outlineLevel=e}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=(this._worksheet.properties.outlineLevelCol??0))}toString(){return JSON.stringify({key:this.key,width:this.width,headers:this.headers.length?this.headers:void 0})}equivalentTo(e){return this.width===e.width&&this.hidden===e.hidden&&this.outlineLevel===e.outlineLevel&&bc(this.style,e.style)}equivalentToModel(e){return this.width===e.width&&this.hidden===e.hidden&&this.outlineLevel===e.outlineLevel&&this.bestFit===e.bestFit&&bc(this.style,e.style)}get isDefault(){if(this.isCustomWidth||this.hidden||this.outlineLevel||this.bestFit)return!1;let e=this.style;return!(e&&(e.font||e.numFmt||e.alignment||e.border||e.fill||e.protection))}get headerCount(){return this.headers.length}eachCell(e,t){let n=this.number,r,i;typeof e==`function`?(r={},i=e):(r=e,i=t),this._worksheet.eachRow(r,(e,t)=>{i(e.getCell(n),t)})}get values(){let e=[];return this.eachCell((t,n)=>{t&&t.type!==0&&(e[n]=t.value)}),e}set values(e){if(!e)return;let t=this.number,n=0;Object.prototype.hasOwnProperty.call(e,`0`)&&(n=1),e.forEach((e,r)=>{this._worksheet.getCell(r+n,t).value=e})}addPageBreak(e,t){let n=this._worksheet,r=Math.max(0,(e??0)-1)||0,i=Math.max(0,(t??0)-1)||1048575,a={id:this._number,max:i,man:1};r&&(a.min=r),n.colBreaks.push(a)}get numFmt(){return this.style.numFmt}set numFmt(e){this.style.numFmt=e,this.eachCell(t=>{t.numFmt=e})}get font(){return this.style.font}set font(e){this.style.font=e,this.eachCell(t=>{t.font=e&&structuredClone(e)})}get alignment(){return this.style.alignment}set alignment(e){this.style.alignment=e,this.eachCell(t=>{t.alignment=e&&structuredClone(e)})}get protection(){return this.style.protection}set protection(e){this.style.protection=e,this.eachCell(t=>{t.protection=e&&structuredClone(e)})}get border(){return this.style.border}set border(e){this.style.border=e,this.eachCell(t=>{t.border=e&&structuredClone(e)})}get fill(){return this.style.fill}set fill(e){this.style.fill=e,this.eachCell(t=>{t.fill=e&&structuredClone(e)})}static toModel(e){let t=[],n=null;return e.forEach((e,r)=>{e.isDefault?n&&=null:!n||!e.equivalentToModel(n)?(n={min:r+1,max:r+1,width:e.width===void 0?9:e.width,style:e.style,isCustomWidth:e.isCustomWidth,hidden:e.hidden,outlineLevel:e.outlineLevel,collapsed:e.collapsed,bestFit:e.bestFit},t.push(n)):n.max=r+1}),t.length?t:void 0}static fromModel(t,n){let r=t,i=Array.isArray(t)?t:n??[];i??=[];let a=[],o=1,s=0;for(i=i.sort((e,t)=>e.min-t.min);s<i.length;){let t=i[s++];for(;o<t.min;)a.push(new e(r,o++));for(;o<=t.max;)a.push(new e(r,o++,t))}return a}},Tc=class e{static{this.DEFAULT_CONFIGS={note:{margins:{insetmode:`auto`,inset:[.13,.13,.25,.25]},protection:{locked:`True`,lockText:`True`},editAs:`absolute`},type:`note`}}constructor(e,t){this.note=e,this.author=t}get model(){let t;switch(typeof this.note){case`string`:t={type:`note`,note:{texts:[{text:this.note}]}};break;default:t={type:`note`,note:this.note??{}};break}let n=Cc({},e.DEFAULT_CONFIGS,t);return this.author!==void 0&&(n.author=this.author),n}set model(e){let{note:t}=e,{texts:n}=t;n&&n.length===1&&Object.keys(n[0]).length===1?this.note=n[0].text:this.note=t,this.author=e.author}static fromModel(t){let n=new e;return n.model=t,n}};function Ec(){return typeof process<`u`&&!!process.versions?.node}let Dc={lt:`<`,gt:`>`,amp:`&`,quot:`"`,apos:`'`},Oc=/&(#\d+|#[xX][0-9A-Fa-f]+|\w+);/g,kc=(()=>{let e=new Uint8Array(128);for(let t=0;t<=8;t++)e[t]=2;e[11]=2,e[12]=2;for(let t=14;t<=31;t++)e[t]=2;return e[127]=2,e[34]=1,e[38]=1,e[39]=1,e[60]=1,e[62]=1,e})(),Ac={34:`"`,38:`&`,39:`'`,60:`<`,62:`>`};function jc(e){return e.indexOf(`&`)===-1?e:e.replace(Oc,(e,t)=>{if(t[0]===`#`){let n=t[1]===`x`||t[1]===`X`?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Number.isNaN(n)||n<1||n>=55296&&n<=57343||n>1114111?e:String.fromCodePoint(n)}return Dc[t]??e})}function Mc(e){let t=e.length,n=-1;for(let r=0;r<t;r++){let t=e.charCodeAt(r);if(t<128){if(kc[t]!==0){n=r;break}}else if(t>=55296&&t<=57343){if(t<=56319){let t=e.charCodeAt(r+1);if(t>=56320&&t<=57343){r++;continue}}n=r;break}else if(t===65534||t===65535){n=r;break}}if(n===-1)return e;let r=[],i=0;for(let a=n;a<t;a++){let t=e.charCodeAt(a);if(t<128){let n=kc[t];if(n===0)continue;i<a&&r.push(e.substring(i,a)),n===1&&r.push(Ac[t]),i=a+1}else if(t>=55296&&t<=56319){let t=e.charCodeAt(a+1);if(t>=56320&&t<=57343){a++;continue}i<a&&r.push(e.substring(i,a)),i=a+1}else (t>=56320&&t<=57343||t===65534||t===65535)&&(i<a&&r.push(e.substring(i,a)),i=a+1)}return i<t&&r.push(e.substring(i)),r.length===1?r[0]:r.join(``)}function Nc(e){return Mc(e)}let Pc=/[\s<>"'/=&]/;function Fc(e){if(!e)throw new Zs(`XML name must not be empty`);if(Pc.test(e))throw new Zs(`Invalid XML name: contains forbidden character in "${e}"`);let t=e.charCodeAt(0);if(t>=48&&t<=57||t===45||t===46)throw new Zs(`Invalid XML name: "${e}" starts with forbidden character`)}function Ic(e){return`<![CDATA[`+e.split(`]]>`).join(`]]]]><![CDATA[>`)+`]]>`}function Lc(e){if(e.includes(`--`)||e.endsWith(`-`))throw new Zs(`Invalid comment: must not contain "--" or end with "-"`)}let A={version:`1.0`,encoding:`UTF-8`,standalone:`yes`};function Rc(e){if(Ec())return Buffer.from(e,`base64`);let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function zc(e,t){return 25569+e.getTime()/(24*3600*1e3)-(t?1462:0)}function Bc(e,t){let n=Math.round((e-25569+(t?1462:0))*24*3600*1e3);return new Date(n)}function Vc(e){return new Date(e.endsWith(`Z`)?e:e+`Z`)}let Hc=/_x([0-9A-Fa-f]{4})_/g;function Uc(e){return e.replace(Hc,(e,t)=>{let n=parseInt(t,16);return n===0||n>=1&&n<=8||n===11||n===12||n>=14&&n<=31||n===127||n>=55296&&n<=57343||n===65534||n===65535?e:String.fromCharCode(n)})}function Wc(e){return e.replace(Hc,`_x005F_x$1_`)}let Gc=/[\t\n\r]/g,Kc={" ":`_x0009_`,"\n":`_x000A_`,"\r":`_x000D_`};function qc(e){let t=e.replace(Hc,`_x005F_x$1_`);return t=t.replace(Gc,e=>Kc[e]),t}function Jc(e){let t=typeof e==`number`?e:parseInt(e,10);return Number.isNaN(t)?0:t}function Yc(e){let t=[],n=``,r=!1,i=!1;for(let a=0;a<e.length;a++){let o=e[a];o===`"`&&!i?(r=!r,n+=o):o===`[`&&!r?(i=!0,n+=o):o===`]`&&!r?(i=!1,n+=o):o===`;`&&!r&&!i?(t.push(n),n=``):n+=o}return t.push(n),t}let Xc=/[ymdhMsb]/,Zc=/\[[^\]]*\]|"[^"]*"/g,Qc=new Map;function $c(e){if(!e)return!1;let t=Qc.get(e);if(t!==void 0)return t;let n=Yc(e)[0].replace(Zc,``),r;return r=n.indexOf(`@`)>-1?!1:Xc.test(n),Qc.set(e,r),r}function el(e){return e===!0||e===`true`||e===1||e===`1`}function*tl(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 nl(e){let t=Array.from(e);return t.length<=1?t:t.every(e=>Number.isFinite(e))?t.sort((e,t)=>e-t):t.every(e=>e instanceof Date)?t.sort((e,t)=>e.getTime()-t.getTime()):t.sort((e,t)=>{let n=rl(e),r=rl(t);return n===r?n===0?e-t:n===1?e.getTime()-t.getTime():String(e).localeCompare(String(t)):n-r})}function rl(e){return Number.isFinite(e)?0:e instanceof Date?1:2}let il=new TextDecoder(`utf-8`),al,ol=!1;function sl(){if(!ol){ol=!0;try{al=new TextDecoder(`latin1`)}catch{al=void 0}}return al}function cl(e){return typeof e==`string`?e:il.decode(e)}function ll(e){if(Ec())return Buffer.from(e).toString(`base64`);if(sl())try{return btoa(al.decode(e))}catch{}let t=32768,n=[];for(let r=0;r<e.length;r+=t)n.push(String.fromCharCode.apply(null,e.subarray(r,r+t)));return btoa(n.join(``))}function ul(e){let t=new Uint8Array(e.length*2);for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[n*2]=r&255,t[n*2+1]=r>>8&255}return t}function dl(){return new Promise(e=>setTimeout(e,0))}let fl=`File system operations are not available in browser environment.`;function pl(e,t){throw Error(fl)}function ml(e){return!1}function hl(e){throw Error(fl)}function gl(e,t){let n=Math.round(e).toString();for(;n.length<t;)n=`0`+n;return n}function _l(e){if(e.length<=3)return e;let t=e.length%3,n=e.substring(0,t);for(let r=t;r<e.length;r+=3)n+=(n.length>0?`,`:``)+e.substring(r,r+3);return n}function vl(e,t){let n=10**t;return Math.round(e*n)/n}function yl(e){let t=e.replace(/_./g,` `);return t=t.replace(/\*./g,``),t}function bl(e){return/^General$/i.test(e.trim())}function xl(e){let t=e.replace(/\[[^\]]*\]/g,``);return/[ymdhs]/i.test(t)&&!/^[#0.,E%$\s()\-+]+$/i.test(t)}let Sl=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Cl=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],wl=[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],Tl=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],El=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];function Dl(e){let t=/\x00(?:Y[24]|D[12]|MN[345])\x00/,n=/\x00H[12]\x00/g,r=/\x00S[12]\x00/g,i=``,a=e,o=a.search(/mm/i);for(;o!==-1;){let e=a.slice(0,o),s=a.slice(o+2),c=-1,l;for(n.lastIndex=0;(l=n.exec(e))!==null;)c=l.index;r.lastIndex=0;let u=r.exec(s),d=u?u.index:-1,f=c!==-1&&!t.test(e.slice(c)),p=d!==-1&&!t.test(s.slice(0,d));i+=e+(f||p?`\0MI2\0`:`\0M2\0`),a=s,o=a.search(/mm/i)}return i+=a,i}function Ol(e,t){let n=Math.round(e*86400)%86400,r=Math.floor(n/3600),i=Math.floor(n%3600/60),a=n%60,o=Bc(e,!1),s=o.getUTCFullYear(),c=o.getUTCMonth(),l=o.getUTCDate(),u=o.getUTCDay(),d=e*86400-Math.floor(e*86400),f=/AM\/PM|A\/P/i.test(t),p=r>=12,m=r%12||12,h=t.replace(/\[(Red|Green|Blue|Yellow|Magenta|Cyan|White|Black|Color\d+)\]/gi,``);h=yl(h);let g=h.match(/ss\.(0+)/i),_=``;if(g){let e=g[1].length;_=Math.round(d*10**e).toString().padStart(e,`0`),h=h.replace(/ss\.0+/gi,`\0SF\0`)}h=h.replace(/yyyy/gi,`\0Y4\0`),h=h.replace(/yy/gi,`\0Y2\0`),h=h.replace(/mmmmm/gi,`\0MN5\0`),h=h.replace(/mmmm/gi,`\0MN4\0`),h=h.replace(/mmm/gi,`\0MN3\0`),h=h.replace(/dddd/gi,`\0DN4\0`),h=h.replace(/ddd/gi,`\0DN3\0`),h=h.replace(/dd/gi,`\0D2\0`),h=h.replace(/\bd\b/gi,`\0D1\0`),h=h.replace(/hh/gi,`\0H2\0`),h=h.replace(/\bh\b/gi,`\0H1\0`),h=h.replace(/ss/gi,`\0S2\0`),h=h.replace(/\bs\b/gi,`\0S1\0`),h=Dl(h),h=h.replace(/\bm\b/gi,`\0M1\0`),h=h.replace(/AM\/PM/gi,`\0AMPM\0`),h=h.replace(/A\/P/gi,`\0AP\0`);let v=f?m:r;return h=h.replace(/\x00Y4\x00/g,s.toString()).replace(/\x00Y2\x00/g,(s%100).toString().padStart(2,`0`)).replace(/\x00MN5\x00/g,wl[c]).replace(/\x00MN4\x00/g,Cl[c]).replace(/\x00MN3\x00/g,Sl[c]).replace(/\x00M2\x00/g,(c+1).toString().padStart(2,`0`)).replace(/\x00M1\x00/g,(c+1).toString()).replace(/\x00DN4\x00/g,El[u]).replace(/\x00DN3\x00/g,Tl[u]).replace(/\x00D2\x00/g,l.toString().padStart(2,`0`)).replace(/\x00D1\x00/g,l.toString()).replace(/\x00H2\x00/g,v.toString().padStart(2,`0`)).replace(/\x00H1\x00/g,v.toString()).replace(/\x00MI2\x00/g,i.toString().padStart(2,`0`)).replace(/\x00S2\x00/g,a.toString().padStart(2,`0`)).replace(/\x00S1\x00/g,a.toString()).replace(/\x00SF\x00/g,a.toString().padStart(2,`0`)+`.`+_).replace(/\x00AMPM\x00/g,p?`PM`:`AM`).replace(/\x00AP\x00/g,p?`P`:`A`),h=h.replace(/\\/g,``),h}function kl(e){return typeof e==`boolean`?e?`TRUE`:`FALSE`:typeof e==`string`?e:Number.isInteger(e)?e.toString():e.toPrecision(11).replace(/\.?0+$/,``).replace(/\.?0+e/,`e`)}function Al(e,t){let n=(t.match(/%/g)??[]).length;return Fl(e*100**n,t.replace(/%/g,``)||`0`)+`%`.repeat(n)}function jl(e,t){let n=e<0?`-`:``,r=Math.abs(e);if(r===0){let e=t.match(/\.([0#]+)E/i),n=e?e[1].length:2;return`0.`+`0`.repeat(n)+`E+00`}let i=t.match(/\.([0#]+)E/i),a=i?i[1].length:2,o=t.includes(`E+`),s=Math.floor(Math.log10(r)),c=vl(r/10**s,a).toFixed(a),l=s>=0?o?`+`:``:`-`,u=gl(Math.abs(s),2);return n+c+`E`+l+u}function Ml(e,t){let n=e<0?-1:1,r=Math.abs(e),i=Math.floor(r);if(r-=i,r<1e-10)return[n*i,0,1];let a=0,o=1,s=1,c=0,l=Math.floor(r),u=l,d=1;for(;c<t&&(l=Math.floor(r),u=l*o+a,d=l*c+s,!(r-l<1e-10));)r=1/(r-l),a=o,o=u,s=c,c=d;return d>t&&(d=c,u=o),[n*i,n*u,d]}function Nl(e,t){let n=e<0?`-`:``,r=Math.abs(e),i=t.match(/\?+\s*\/\s*(\d+)/);if(i){let e=parseInt(i[1],10),a=Math.floor(r),o=r-a,s=Math.round(o*e);return t.includes(`#`)||t.includes(`0`)?s===0?n+a.toString():n+(a>0?a+` `:``)+s+`/`+e:n+(a*e+s)+`/`+e}let a=t.match(/\/\s*(\?+)/),[o,s,c]=Ml(r,10**(a?a[1].length:2)-1);return t.includes(`#`)&&o!==0?s===0?n+Math.abs(o).toString():n+Math.abs(o)+` `+Math.abs(s)+`/`+c:s===0?o===0?`0`:n+Math.abs(o).toString():n+(Math.abs(o)*c+Math.abs(s))+`/`+c}function Pl(e,t){let n=Math.round(e*86400),r=Math.floor(n/60),i=Math.floor(r/60),a=n%60,o=r%60,s=i,c=t;return/\[h+\]/i.test(c)&&(c=c.replace(/\[h+\]/gi,s.toString())),/\[m+\]/i.test(c)&&(c=c.replace(/\[m+\]/gi,r.toString())),/\[s+\]/i.test(c)&&(c=c.replace(/\[s+\]/gi,n.toString())),c=c.replace(/mm/gi,o.toString().padStart(2,`0`)),c=c.replace(/ss/gi,a.toString().padStart(2,`0`)),c}function Fl(e,t){let n=Math.abs(e),r=e<0?`-`:``,i=0,a=t;for(;a.endsWith(`,`);)i++,a=a.slice(0,-1);let o=n/1e3**i,s=a.indexOf(`.`),c=a,l=``;s!==-1&&(c=a.substring(0,s),l=a.substring(s+1));let u=l.replace(/[^0#?]/g,``).length,d=vl(o,u);if(d===0&&!c.includes(`0`)&&!l.includes(`0`)){let e=``;for(let t of c)t===`?`?e+=` `:t!==`#`&&t!==`,`&&(e+=t);if(u>0&&/[0?]/.test(l)){e+=`.`;for(let t of l)t===`?`&&(e+=` `)}return r+e}let[f,p=``]=d.toString().split(`.`),m=/[0#?][^0#?,.\s][0#?]/.test(c),h;if(m){let e=c.replace(/[^0#?]/g,``).length,t=f;t.length<e&&(t=`0`.repeat(e-t.length)+t),h=``;let n=t.length-e;for(let e=0;e<c.length;e++){let r=c[e];r===`0`||r===`#`||r===`?`?n<t.length&&(h+=t[n],n++):r!==`,`&&(h+=r)}}else{h=f,c.includes(`,`)&&(h=_l(f));let e=(c.match(/0/g)??[]).length,t=(c.match(/[0?]/g)??[]).length;h.length<e&&(h=`0`.repeat(e-h.length)+h),h.length<t&&(h=` `.repeat(t-h.length)+h),h===`0`&&e===0&&t===0&&(h=``)}let g=``;if(u>0){let e=(p+`0`.repeat(u)).substring(0,u).split(``);for(let t=l.length-1;t>=0;t--)if(!(t>=e.length))if(l[t]===`#`&&e[t]===`0`)e[t]=``;else if(l[t]===`?`&&e[t]===`0`)e[t]=` `;else break;let t=e.join(``);t.length>0&&(g=`.`+t)}return r+h+g}function Il(e){let t=``,n=0;for(;n<e.length;)if(e[n]===`"`){for(n++;n<e.length&&e[n]!==`"`;)t+=e[n],n++;n++}else e[n]===`\\`&&n+1<e.length?(n++,t+=e[n],n++):(t+=e[n],n++);return t}function Ll(e,t){let n=t.match(/\[(=|>|<|>=|<=|<>)(-?\d+(?:\.\d*)?)\]/);if(!n)return!1;let r=n[1],i=parseFloat(n[2]);switch(r){case`=`:return e===i;case`>`:return e>i;case`<`:return e<i;case`>=`:return e>=i;case`<=`:return e<=i;case`<>`:return e!==i;default:return!1}}function Rl(e,t){if(typeof t==`string`){let n=Yc(e);return n.length>=4&&n[3]?Il(n[3]).replace(/@/g,t):t}if(typeof t==`boolean`)return t?`TRUE`:`FALSE`;let n=Yc(e),r=/\[(=|>|<|>=|<=|<>)-?\d+(?:\.\d*)?\]/;if((n[0]&&r.test(n[0])||n[1]&&r.test(n[1]))&&n.length>=2){for(let e=0;e<Math.min(n.length,2);e++){let r=n[e].match(/\[(=|>|<|>=|<=|<>)-?\d+(?:\.\d*)?\]/);if(r&&Ll(t,r[0]))return n[e]}return n[n.length>2?2:1]}return n.length===1?n[0]:n.length===2?t>=0?n[0]:n[1]:t>0?n[0]:t<0?n[1]:n[2]||n[0]}function zl(e,t){let n=Yc(e);return n.length>=2&&n[1]===t}function Bl(e,t){if(t==null)return``;if(bl(e))return kl(t);if(typeof t==`string`)return Rl(e,t);if(typeof t==`boolean`)return t?`TRUE`:`FALSE`;let n=t,r=Rl(e,n);n<0&&zl(e,r)&&(n=Math.abs(n));let i=r.replace(/\[(Red|Green|Blue|Yellow|Magenta|Cyan|White|Black|Color\d+)\]/gi,``);if(i=i.replace(/\[(>|<|>=|<=|=|<>)-?\d+(\.\d+)?\]/g,``),i=i.replace(/\[\$[^\]]*\]/g,``),i=yl(i),i=Il(i),/\[[hms]+\]/i.test(i))return Pl(n,i);if(xl(i))return Ol(n,i);if(i.includes(`%`))return Al(n,i);if(/E[+-]?/i.test(i))return jl(n,i);if(/\?+\s*\/\s*[\d?]+/.test(i))return Nl(n,i);if(i.includes(`(`)&&i.includes(`)`)&&n<0){let e=i.replace(/\(|\)/g,``);return`(`+Fl(-n,e)+`)`}if(i===`@`)return n.toString();let a=``,o=``,s=i.match(/^([^#0?.,]+)/);s&&(a=s[1],i=i.substring(s[0].length));let c=i.match(/([^#0?.,]+)$/);c&&!c[1].includes(`%`)&&(o=c[1],i=i.substring(0,i.length-c[0].length));let l=Fl(n,i);return a+l+o}function Vl(e){let t=e.replace(/"[^"]*"/g,``);if(/\[[hms]\]/i.test(t))return!1;let n=t.replace(/\[[^\]]*\]/g,``),r=/[hs]/i.test(n)||/AM\/PM|A\/P/i.test(n);return/[yd]/i.test(n)||/m/i.test(n)&&!r?!1:r}function Hl(e){let t=e.replace(/"[^"]*"/g,``);if(/\[[hms]\]/i.test(t))return!1;let n=t.replace(/\[[^\]]*\]/g,``);return!!(/[yd]/i.test(n)||/m/i.test(n)&&!(/[hs]/i.test(n)||/AM\/PM|A\/P/i.test(n)))}function Ul(e,t,n){if(e instanceof Date){let r=zc(e);if(Vl(t))return r%=1,r<0&&(r+=1),Bl(t,r);let i;return i=n&&Hl(t)?n:!t||bl(t)?r%1==0?`yyyy-mm-dd`:`yyyy-mm-dd hh:mm:ss`:t,Bl(i,r)}return Bl(t,e)}function Wl(e,t){let n=e.value,r=e.numFmt,i=typeof r==`string`?r:r?.formatCode??`General`;if(n==null)return``;if(n instanceof Date||typeof n==`number`||typeof n==`boolean`||typeof n==`string`)return Ul(n,i,t);if(typeof n==`object`&&`formula`in n){let e=n.result;if(e==null)return``;if(e instanceof Date||typeof e==`number`||typeof e==`boolean`||typeof e==`string`)return Ul(e,i,t)}return e.text}let Gl=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,Kl=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;function ql(e,t,n){let r=O.decode(t),i=O.decode(n);return e.replace(Gl,(e,t,n,a,o)=>{if(o)return e;let s=Kl.exec(a);if(s){let n=s[1],a=s[2].toUpperCase(),o=s[3],c=s[4];if(a.length>3||a.length===3&&a>`XFD`)return e;let l=O.l2n(a),u=parseInt(c,10);return n||(l+=i.col-r.col),o||(u+=i.row-r.row),(t??``)+(n??``)+O.n2l(l)+(o??``)+u}return e})}let Jl=e=>!!e&&(typeof e!=`object`||Object.keys(e).length>0);function Yl(e){let t=``;for(let n of e)n&&typeof n.text==`string`&&(t+=n.text);return t}function Xl(e){let t,n;Array.isArray(e.richText)&&e.richText.length>0?(n=e.richText,t=Yl(n)):t=typeof e.text==`string`?e.text:``;let r={text:t,hyperlink:typeof e.hyperlink==`string`?e.hyperlink:``};return n&&(r.richText=n),typeof e.tooltip==`string`&&e.tooltip.length>0&&(r.tooltip=e.tooltip),r}var j=class e{static{this.Types=Xs.ValueType}constructor(t,n,r){if(!t||!n)throw new Dr(`A Cell needs a Row`);this._row=t,this._column=n,O.validateAddress(r),this._address=r,this._value=uu.create(e.Types.Null,this),this.style=this._mergeStyle(t.style,n.style,{}),this._mergeCount=0}get worksheet(){return this._row.worksheet}get workbook(){return this._row.worksheet.workbook}destroy(){this.style=void 0,this._value=void 0,this._row=void 0,this._column=void 0,this._address=void 0}get numFmt(){return this.style.numFmt}set numFmt(e){this.style.numFmt=e}get font(){return this.style.font}set font(e){this.style.font=e}get alignment(){return this.style.alignment}set alignment(e){this.style.alignment=e}get border(){return this.style.border}set border(e){this.style.border=e}get fill(){return this.style.fill}set fill(e){this.style.fill=e}get protection(){return this.style.protection}set protection(e){this.style.protection=e}_mergeStyle(e,t,n){let r=e&&e.numFmt||t&&t.numFmt;r&&(n.numFmt=r);let i=e&&Jl(e.font)&&e.font||t&&Jl(t.font)&&t.font;i&&(n.font=structuredClone(i));let a=e&&Jl(e.alignment)&&e.alignment||t&&Jl(t.alignment)&&t.alignment;a&&(n.alignment=structuredClone(a));let o=e&&Jl(e.border)&&e.border||t&&Jl(t.border)&&t.border;o&&(n.border=structuredClone(o));let s=e&&Jl(e.fill)&&e.fill||t&&Jl(t.fill)&&t.fill;s&&(n.fill=structuredClone(s));let c=e&&Jl(e.protection)&&e.protection||t&&Jl(t.protection)&&t.protection;return c&&(n.protection=structuredClone(c)),n}get address(){return this._address}get row(){return this._row.number}get col(){return this._column.number}get $col$row(){return`$${this._column.letter}$${this.row}`}get type(){return this._value.type}get effectiveType(){return this._value.effectiveType}toCsvString(){return this._value.toCsvString()}addMergeRef(){this._mergeCount++}releaseMergeRef(){this._mergeCount--}get isMerged(){return this._mergeCount>0||this.type===e.Types.Merge}merge(t,n){this._value.release(),this._value=uu.create(e.Types.Merge,this,t),n||(this.style=_c(t.style)??{})}unmerge(){this.type===e.Types.Merge&&(this._value.release(),this._value=uu.create(e.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{...this.style}))}isMergedTo(t){return this._value.type===e.Types.Merge&&this._value.isMergedTo?this._value.isMergedTo(t):!1}get master(){return this.type===e.Types.Merge?this._value.master:this}get isHyperlink(){return this._value.type===e.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value(t){if(this.type===e.Types.Merge){this._value.master.value=t;return}this._value.release(),this._value=uu.create(uu.getType(t),this,t)}get note(){if(this._comment)return this._comment.note}set note(e){this._comment=new Tc(e)}get comment(){return this._comment}set comment(e){e===void 0?this._comment=void 0:e instanceof Tc?this._comment=e:this._comment=new Tc(e)}get text(){return this._value.toString()}get displayText(){return Wl(this)}get html(){return xc(this.text)}toString(){return this.text}_upgradeToHyperlink(t){switch(this.type){case e.Types.String:this._value=uu.create(e.Types.Hyperlink,this,{text:String(this._value.value),hyperlink:t});break;case e.Types.RichText:{let n=this._value.value,r=n&&Array.isArray(n.richText)?n.richText:[];this._value=uu.create(e.Types.Hyperlink,this,{text:Yl(r),richText:r.length>0?r:void 0,hyperlink:t});break}default:break}}get formula(){return this._value.formula}get result(){return this._value.result}set result(t){this.type===e.Types.Formula&&(this._value.result=t)}get formulaType(){return this._value.formulaType??0}get fullAddress(){let{worksheet:e}=this._row;return{sheetName:e.name,address:this.address,row:this.row,col:this.col}}get name(){return this.names[0]}set name(e){this.names=[e]}get names(){return this.workbook.definedNames.getNamesEx(this.fullAddress)}set names(e){let{definedNames:t}=this.workbook;t.removeAllNames(this.fullAddress),e.forEach(e=>{t.addEx(this.fullAddress,e)})}addName(e){this.workbook.definedNames.addEx(this.fullAddress,e)}removeName(e){this.workbook.definedNames.removeEx(this.fullAddress,e)}removeAllNames(){this.workbook.definedNames.removeAllNames(this.fullAddress)}get _dataValidations(){return this.worksheet.dataValidations}get dataValidation(){return this._dataValidations.find(this.address)}set dataValidation(e){this._dataValidations.add(this.address,e)}get model(){let{model:e}=this._value;return e.style=this.style,this._comment&&(e.comment=this._comment.model),e}set model(e){if(this._value.release(),this._value=uu.create(e.type,this),this._value.model=e,e.comment)switch(e.comment.type){case`note`:this._comment=Tc.fromModel(e.comment);break}e.style?this.style=_c(e.style)??{}:this.style={}}},Zl=class{constructor(e){this.model={address:e.address,type:j.Types.Null}}get value(){return null}set value(e){}get type(){return j.Types.Null}get effectiveType(){return j.Types.Null}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return``}release(){}toString(){return``}},Ql=class{constructor(e,t){this.model={address:e.address,type:j.Types.Number,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return j.Types.Number}get effectiveType(){return j.Types.Number}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}},$l=class{constructor(e,t){this.model={address:e.address,type:j.Types.String,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return j.Types.String}get effectiveType(){return j.Types.String}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return`"${this.model.value.replace(/"/g,`""`)}"`}release(){}toString(){return this.model.value}},eu=class{constructor(e,t){this.model={address:e.address,type:j.Types.String,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}toString(){return this.model.value.richText.map(e=>e.text).join(``)}get type(){return j.Types.RichText}get effectiveType(){return j.Types.RichText}get address(){return this.model.address}set address(e){this.model.address=e}get text(){return this.toString()}toCsvString(){return`"${this.text.replace(/"/g,`""`)}"`}release(){}},tu=class{constructor(e,t){this.model={address:e.address,type:j.Types.Date,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return j.Types.Date}get effectiveType(){return j.Types.Date}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}},nu=class{constructor(e,t){if(this.model={address:e.address,type:j.Types.Hyperlink},t){if(`formula`in t&&typeof t.formula==`string`){let e=t,n=e.result===void 0||e.result===null?``:String(e.result);this.model.text=n,this.model.hyperlink=e.hyperlink??``,e.tooltip!==void 0&&(this.model.tooltip=e.tooltip),this.model.formula=e.formula,e.result!==void 0&&(this.model.result=e.result);return}let e=Xl(t);this.model.text=e.text,this.model.hyperlink=e.hyperlink,e.richText&&(this.model.richText=e.richText),e.tooltip!==void 0&&(this.model.tooltip=e.tooltip)}}get value(){let e={text:this.model.text??``,hyperlink:this.model.hyperlink??``};return this.model.richText&&this.model.richText.length>0&&(e.richText=this.model.richText),this.model.tooltip!==void 0&&(e.tooltip=this.model.tooltip),e}set value(e){let t=Xl(e);this.model.text=t.text,this.model.hyperlink=t.hyperlink,t.richText?this.model.richText=t.richText:delete this.model.richText,t.tooltip===void 0?delete this.model.tooltip:this.model.tooltip=t.tooltip}get text(){return this.model.text}set text(e){this.model.richText&&delete this.model.richText,this.model.text=e}get richText(){return this.model.richText}set richText(e){Array.isArray(e)&&e.length>0?(this.model.richText=e,this.model.text=Yl(e)):delete this.model.richText}get hyperlink(){return this.model.hyperlink}set hyperlink(e){this.model.hyperlink=e}get type(){return j.Types.Hyperlink}get effectiveType(){return j.Types.Hyperlink}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.hyperlink??``}release(){}toString(){return this.model.text??``}},ru=class{constructor(e,t){this.model={address:e.address,type:j.Types.Merge,master:t?t.address:void 0},this._master=t,t&&t.addMergeRef()}get value(){return this._master.value}set value(e){e instanceof j?(this._master&&this._master.releaseMergeRef(),e.addMergeRef(),this._master=e):this._master.value=e}isMergedTo(e){return e===this._master}get master(){return this._master}get type(){return j.Types.Merge}get effectiveType(){return this._master.effectiveType}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return``}release(){this._master.releaseMergeRef()}toString(){return this.value==null?``:this.value.toString()}},iu=class{constructor(e,t){this.cell=e,this.model={address:e.address,type:j.Types.Formula,shareType:t?t.shareType:void 0,ref:t?t.ref:void 0,formula:t?t.formula:void 0,sharedFormula:t?t.sharedFormula:void 0,result:t?t.result:void 0,isDynamicArray:t?t.isDynamicArray:void 0}}_copyModel(e){let t={};return e.formula&&(t.formula=e.formula),e.result!==void 0&&(t.result=e.result),e.ref&&(t.ref=e.ref),e.shareType&&(t.shareType=e.shareType),e.sharedFormula&&(t.sharedFormula=e.sharedFormula),e.isDynamicArray&&(t.isDynamicArray=e.isDynamicArray),t}get value(){return this._copyModel(this.model)}set value(e){e.formula&&(this.model.formula=e.formula),e.result!==void 0&&(this.model.result=e.result),e.ref&&(this.model.ref=e.ref),e.shareType&&(this.model.shareType=e.shareType),e.sharedFormula&&(this.model.sharedFormula=e.sharedFormula),e.isDynamicArray!==void 0&&(this.model.isDynamicArray=e.isDynamicArray)}validate(e){switch(uu.getType(e)){case j.Types.Null:case j.Types.String:case j.Types.Number:case j.Types.Date:break;case j.Types.Hyperlink:case j.Types.Formula:default:throw new Pr(String(uu.getType(e)),`Cannot process that type of result value`)}}get dependencies(){return{ranges:this.formula.match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g),cells:this.formula.replace(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g,``).match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}/g)}}get formula(){return this.model.formula||this._getTranslatedFormula()||``}set formula(e){this.model.formula=e}get formulaType(){return this.model.formula?1:this.model.sharedFormula?2:0}get result(){return this.model.result}set result(e){this.model.result=e}get type(){return j.Types.Formula}get effectiveType(){let e=this.model.result;return e==null?0:typeof e==`string`?3:typeof e==`number`?2:e instanceof Date?4:typeof e==`object`&&`error`in e?10:0}get address(){return this.model.address}set address(e){this.model.address=e}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){let{worksheet:e}=this.cell,t=e.findCell(this.model.sharedFormula);this._translatedFormula=t&&t.formula?ql(t.formula,t.address,this.model.address):void 0}return this._translatedFormula}toCsvString(){return`${this.model.result??``}`}release(){}toString(){return this.model.result?this.model.result.toString():``}},au=class{constructor(e,t){this.model={address:e.address,type:j.Types.SharedString,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return j.Types.SharedString}get effectiveType(){return j.Types.SharedString}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}},ou=class{constructor(e,t){this.model={address:e.address,type:j.Types.Boolean,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return j.Types.Boolean}get effectiveType(){return j.Types.Boolean}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return+!!this.model.value}release(){}toString(){return this.model.value.toString()}},su=class{constructor(e,t){this.model={address:e.address,type:j.Types.Checkbox,value:t.checkbox}}get value(){return{checkbox:this.model.value}}set value(e){this.model.value=e.checkbox}get type(){return j.Types.Checkbox}get effectiveType(){return j.Types.Boolean}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return+!!this.model.value}release(){}toString(){return this.model.value.toString()}},cu=class{constructor(e,t){this.model={address:e.address,type:j.Types.Error,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return j.Types.Error}get effectiveType(){return j.Types.Error}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}},lu=class{constructor(e,t){this.model={address:e.address,type:j.Types.String,value:JSON.stringify(t),rawValue:t}}get value(){return this.model.rawValue}set value(e){this.model.rawValue=e,this.model.value=JSON.stringify(e)}get type(){return j.Types.String}get effectiveType(){return j.Types.String}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}};let uu={getType(e){if(e==null)return j.Types.Null;if(typeof e==`string`)return j.Types.String;if(typeof e==`number`)return j.Types.Number;if(typeof e==`boolean`)return j.Types.Boolean;if(e instanceof Date)return j.Types.Date;if(typeof e==`object`){if(`checkbox`in e&&typeof e.checkbox==`boolean`)return j.Types.Checkbox;if(`hyperlink`in e&&typeof e.hyperlink==`string`&&e.hyperlink){let t=`text`in e&&typeof e.text==`string`&&e.text.length>0,n=`richText`in e&&Array.isArray(e.richText)&&e.richText.length>0,r=`formula`in e&&typeof e.formula==`string`;if(t||n||r)return j.Types.Hyperlink}if(`formula`in e&&e.formula||`sharedFormula`in e&&e.sharedFormula)return j.Types.Formula;if(`richText`in e&&Array.isArray(e.richText)&&e.richText.length>0)return j.Types.RichText;if(`sharedString`in e&&e.sharedString)return j.Types.SharedString;if(`error`in e&&e.error)return j.Types.Error}return j.Types.JSON},types:[{t:j.Types.Null,f:Zl},{t:j.Types.Number,f:Ql},{t:j.Types.String,f:$l},{t:j.Types.Date,f:tu},{t:j.Types.Hyperlink,f:nu},{t:j.Types.Formula,f:iu},{t:j.Types.Merge,f:ru},{t:j.Types.JSON,f:lu},{t:j.Types.SharedString,f:au},{t:j.Types.RichText,f:eu},{t:j.Types.Boolean,f:ou},{t:j.Types.Error,f:cu},{t:j.Types.Checkbox,f:su}].reduce((e,t)=>(e[t.t]=t.f,e),[]),create(e,t,n){let r=this.types[e];if(!r)throw new Pr(String(e),`Could not create Value`);return new r(t,n)}};var du=class{constructor(e,t){this._worksheet=e,this._number=t,this._cells=[],this.style={},this.outlineLevel=0}get number(){return this._number}get worksheet(){return this._worksheet}commit(){this._worksheet._commitRow(this)}destroy(){this._worksheet=void 0,this._cells=void 0,this.style=void 0}findCell(e){return this._cells[e-1]}getCellEx(e){let t=this._cells[e.col-1];if(!t){let n=this._worksheet.getColumn(e.col);t=new j(this,n,e.address),this._cells[e.col-1]=t}return t}getCell(e){let t;if(typeof e==`string`){let n=this._worksheet.getColumnKey(e);t=n?n.number:O.l2n(e)}else t=e;return this._cells[t-1]||this.getCellEx({address:O.encodeAddress(this._number,t),row:this._number,col:t})}splice(e,t,...n){let r=e+t,i=n.length-t,a=this._cells.length,o,s,c;if(i<0)for(o=e+n.length;o<=a;o++)c=this._cells[o-1],s=this._cells[o-i-1],s?(c=this.getCell(o),c.value=s.value,c.style=_c(s.style)??{},c.comment=s.comment):c&&(c.value=null,c.style={},c.comment=void 0);else if(i>0)for(o=a;o>=r;o--)s=this._cells[o-1],s?(c=this.getCell(o+i),c.value=s.value,c.style=_c(s.style)??{},c.comment=s.comment):this._cells[o+i-1]=void 0;for(o=0;o<n.length;o++)c=this.getCell(e+o),c.value=n[o],c.style={},c.comment=void 0}eachCell(e,t){let n=null,r;if(typeof e==`function`?r=e:(n=e,r=t),n&&n.includeEmpty){let e=this._cells.length;for(let t=1;t<=e;t++)r(this.getCell(t),t)}else this._cells.forEach((e,t)=>{e&&e.type!==0&&r(e,t+1)})}addPageBreak(e,t){let n=this._worksheet,r=Math.max(0,(e??0)-1)||0,i=Math.max(0,(t??0)-1)||16838,a={id:this._number,max:i,man:1};r&&(a.min=r),n.rowBreaks.push(a)}get values(){let e=[];return this._cells.forEach(t=>{t&&t.type!==0&&(e[t.col]=t.value)}),e}set values(e){if(this._cells=[],e)if(e instanceof Array){let t=0;Object.prototype.hasOwnProperty.call(e,`0`)&&(t=1),e.forEach((e,n)=>{e!==void 0&&(this.getCellEx({address:O.encodeAddress(this._number,n+t),row:this._number,col:n+t}).value=e)})}else this._worksheet.eachColumnKey((t,n)=>{e[n]!==void 0&&(this.getCellEx({address:O.encodeAddress(this._number,t.number),row:this._number,col:t.number}).value=e[n])})}getValues(){let e=[];return this._cells.forEach(t=>{t&&t.type!==0&&(e[t.col-1]=t.value)}),e}valuesToString(e=`,`){return this.getValues().join(e)}get hasValues(){return this._cells.some(e=>e&&e.type!==0)}get cellCount(){return this._cells.length}get actualCellCount(){let e=0;return this.eachCell(()=>{e++}),e}get dimensions(){let e=0,t=0;return this._cells.forEach(n=>{n&&n.type!==0&&((!e||e>n.col)&&(e=n.col),t<n.col&&(t=n.col))}),e>0?{min:e,max:t}:null}_applyStyle(e,t){this.style[e]=t,this._cells.forEach(n=>{n&&(n.style[e]=typeof t==`object`&&t?structuredClone(t):t)})}get numFmt(){return this.style.numFmt}set numFmt(e){e!==void 0&&this._applyStyle(`numFmt`,e)}get font(){return this.style.font}set font(e){e!==void 0&&this._applyStyle(`font`,e)}get alignment(){return this.style.alignment}set alignment(e){e!==void 0&&this._applyStyle(`alignment`,e)}get protection(){return this.style.protection}set protection(e){e!==void 0&&this._applyStyle(`protection`,e)}get border(){return this.style.border}set border(e){e!==void 0&&this._applyStyle(`border`,e)}get fill(){return this.style.fill}set fill(e){e!==void 0&&this._applyStyle(`fill`,e)}get hidden(){return!!this._hidden}set hidden(e){this._hidden=e}get outlineLevel(){return this._outlineLevel??0}set outlineLevel(e){this._outlineLevel=e}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=(this._worksheet.properties.outlineLevelRow??0))}get model(){let e=[],t=0,n=0;return this._cells.forEach(r=>{if(r){let i=r.model;i&&((!t||t>r.col)&&(t=r.col),n<r.col&&(n=r.col),e.push(i))}}),this.height!=null||e.length?{cells:e,number:this.number,min:t,max:n,height:this.height,customHeight:this.customHeight,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel,collapsed:this.collapsed,dyDescent:this.dyDescent}:null}set model(e){if(e.number!==this._number)throw new Dr(`Invalid row number in model`);this._cells=[];let t;e.cells.forEach(e=>{switch(e.type){case j.Types.Merge:break;default:{let n;if(e.address)n=O.decodeAddress(e.address);else if(t){let{row:e}=t,r=t.col+1;n={row:e,col:r,address:O.encodeAddress(e,r),$col$row:`$${O.n2l(r)}$${e}`}}if(t=n,!n)break;let r=this.getCellEx(n);r.model=e;break}}}),e.height==null?delete this.height:this.height=e.height,e.customHeight==null?delete this.customHeight:this.customHeight=e.customHeight,this.hidden=e.hidden,this.outlineLevel=e.outlineLevel??0,this.dyDescent=e.dyDescent,this.style=e.style?structuredClone(e.style):{}}},fu=class extends Pn{constructor({workbook:e,id:t,iterator:n,options:r}){super(),this.workbook=e,this.id=t,this.sheetNo=typeof t==`number`?t:parseInt(String(t),10),this.iterator=n,this.options=r||{},this.name=`Sheet${this.id}`,this._columns=[],this._keys=Object.create(null),this._dimensions=new Gr}destroy(){throw new Rr(`destroy`,`Invalid operation for a streaming reader`)}get dimensions(){return this._dimensions}get columns(){return this._columns}getColumn(e){if(typeof e==`string`){let t=this._keys[e];if(t)return t;e=O.l2n(e)}if(e>this._columns.length){let t=this._columns.length+1;for(;t<=e;)this._columns.push(new wc(this,t++))}return this._columns[e-1]}getColumnKey(e){return this._keys[e]}setColumnKey(e,t){this._keys[e]=t}deleteColumnKey(e){delete this._keys[e]}eachColumnKey(e){let t=this._keys;for(let n in t)e(t[n],n)}async read(){try{for await(let e of this.parse())for(let t=0;t<e.length;t++){let n=e[t];this.emit(n.eventType,n.value)}this.emit(`finished`)}catch(e){this.emit(`error`,e)}}async*[Symbol.asyncIterator](){for await(let e of this.parse())for(let t=0;t<e.length;t++){let n=e[t];n.eventType===`row`&&(yield n.value)}}async*parse(){let{iterator:e,options:t}=this,n=!1,r=!1,i=null;switch(t.worksheets){case`emit`:n=!0;break;case`prep`:break;default:break}switch(t.hyperlinks){case`emit`:r=!0;break;case`cache`:this.hyperlinks=i=Object.create(null);break;default:break}if(!n&&!r&&!i)return;let a=r||i!==null,{sharedStrings:o,styles:s,properties:c}=this.workbook,l=!1,u=!1,d=!1,f=null,p=null,m=null,h=null,g=null,_=new dc({position:!1,invalidCharHandling:`skip`});_.on(`opentag`,e=>{if(n)switch(e.name){case`cols`:l=!0,f=[];break;case`sheetData`:u=!0;break;case`col`:l&&f.push({min:parseInt(e.attributes.min,10),max:parseInt(e.attributes.max,10),width:parseFloat(e.attributes.width),styleId:parseInt(e.attributes.style??`0`,10)});break;case`row`:if(u){let t=parseInt(e.attributes.r,10);if(p=new du(this,t),e.attributes.ht&&(p.height=parseFloat(e.attributes.ht)),e.attributes.customHeight===`1`&&(p.customHeight=!0),e.attributes.s!==void 0){let t=parseInt(e.attributes.s,10),n=s.getStyleModel(t);n&&(p.style=_c(n)??{})}}break;case`c`:if(p){let t=e.attributes.s,n=e.attributes.cm;m={ref:e.attributes.r,s:t===void 0?void 0:parseInt(t,10),t:e.attributes.t,cm:n===void 0?void 0:parseInt(n,10)}}break;case`f`:m&&(h=m.f={text:``});break;case`v`:m&&(h=m.v={text:``});break;case`is`:case`t`:m&&(h=m.v={text:``});break;case`mergeCell`:break;default:break}if(a)switch(e.name){case`hyperlinks`:d=!0;break;case`hyperlink`:if(d){let t=e.attributes.location,n={ref:e.attributes.ref,rId:e.attributes[`r:id`],target:t?t.startsWith(`#`)?t:`#${t}`:void 0};r?(g||=[]).push({eventType:`hyperlink`,value:n}):i[n.ref]=n}break;default:break}}),_.on(`text`,e=>{n&&h&&(h.text+=e)}),_.on(`closetag`,e=>{if(n)switch(e.name){case`cols`:l=!1,this._columns=wc.fromModel(f);break;case`sheetData`:u=!1;break;case`row`:p&&(this._dimensions.expandRow({number:p.number,dimensions:p.dimensions??void 0}),(g||=[]).push({eventType:`row`,value:p})),p=null;break;case`c`:if(p&&m){let e=O.decodeAddress(m.ref),t=p.getCell(e.col);if(m.s!==void 0){let e=s.getStyleModel(m.s);e&&(t.style=_c(e)??{})}if(m.f){let e={formula:m.f.text};if(m.v&&(m.t===`str`?e.result=m.v.text:e.result=parseFloat(m.v.text)),m.cm!==void 0){let{workbook:t}=this;t.dynamicArrayCmIndices?t.dynamicArrayCmIndices.has(m.cm)&&(e.isDynamicArray=!0):t.hasDynamicArrayMetadata&&(e.isDynamicArray=!0)}t.value=e}else if(m.v)switch(m.t){case`s`:{let e=parseInt(m.v.text,10);o?t.value=o[e]:t.value={sharedString:e};break}case`inlineStr`:t.value=m.v.text.includes(`_x`)?Uc(m.v.text):m.v.text;break;case`str`:t.value=m.v.text;break;case`e`:t.value={error:m.v.text};break;case`b`:t.value=parseInt(m.v.text,10)!==0;break;default:{let e=typeof t.numFmt==`string`?t.numFmt:t.numFmt?.formatCode;e&&$c(e)?t.value=Bc(parseFloat(m.v.text),c?.model?.date1904):t.value=parseFloat(m.v.text);break}}if(i){let e=i[m.ref];e&&(t.text=t.value,t.value=void 0,t.hyperlink=e)}m=null,h=null}break;default:break}if(a)switch(e.name){case`hyperlinks`:d=!1;break;default:break}});let v=new TextDecoder(`utf-8`,{fatal:!0});for await(let t of e){let e=typeof t==`string`?t:v.decode(t,{stream:!0});_.write(e);let n=g;n&&n.length>0&&(g=null,yield n)}let y=v.decode();y&&_.write(y),_.close();let b=g;b&&b.length>0&&(yield b)}};async function*pu(e){let t=[],n=null,r=e=>{t.push(e),n&&=(n(),null)};e.on(`data`,r);let i=!1,a=()=>{i=!0,n&&=(n(),null)};e.on(`end`,a);let s=!1,c=e=>{s=e,n&&=(n(),null)};e.on(`error`,c);try{for(;!i||t.length>0;){if(t.length===0)e.resume(),await new Promise(e=>{n=e});else{e.pause();let n=t.shift();n!==void 0&&(yield n)}if(s)throw o(s)}}finally{e.removeListener(`data`,r),e.removeListener(`end`,a),e.removeListener(`error`,c)}}let M={contentTypes:`[Content_Types].xml`,rootRels:`_rels/.rels`,docPropsApp:`docProps/app.xml`,docPropsCore:`docProps/core.xml`,xlWorkbook:`xl/workbook.xml`,xlWorkbookRels:`xl/_rels/workbook.xml.rels`,xlSharedStrings:`xl/sharedStrings.xml`,xlStyles:`xl/styles.xml`,xlTheme1:`xl/theme/theme1.xml`,xlFeaturePropertyBag:`xl/featurePropertyBag/featurePropertyBag.xml`,xlMetadata:`xl/metadata.xml`},mu=/^xl\/worksheets\/sheet(\d+)[.]xml$/,hu=/^xl\/worksheets\/_rels\/sheet(\d+)[.]xml[.]rels$/,gu=/^xl\/theme\/[a-zA-Z0-9]+[.]xml$/,_u=/^xl\/media\/([a-zA-Z0-9]+[.][a-zA-Z0-9]{3,4})$/,vu=/^xl\/drawings\/(drawing\d+)[.]xml$/,yu=/^xl\/drawings\/_rels\/(drawing\d+)[.]xml[.]rels$/,bu=/^xl\/drawings\/(vmlDrawing\d+)[.]vml$/,xu=/^xl\/drawings\/(vmlDrawingHF\d+)[.]vml$/,Su=/^xl\/(?:comments(\d+)|comments\/comment(\d+))[.]xml$/,Cu=/^xl\/tables\/(table\d+)[.]xml$/,wu=/^xl\/pivotTables\/(pivotTable\d+)[.]xml$/,Tu=/^xl\/pivotTables\/_rels\/(pivotTable\d+)[.]xml[.]rels$/,Eu=/^xl\/pivotCache\/(pivotCacheDefinition\d+)[.]xml$/,Du=/^xl\/pivotCache\/_rels\/(pivotCacheDefinition\d+)[.]xml[.]rels$/,Ou=/^xl\/pivotCache\/(pivotCacheRecords\d+)[.]xml$/,ku=/^xl\/externalLinks\/externalLink(\d+)[.]xml$/,Au=/^xl\/externalLinks\/_rels\/externalLink(\d+)[.]xml[.]rels$/;function ju(e){return e.startsWith(`/`)?e.slice(1):e}function Mu(e){let t=mu.exec(e);if(t)return parseInt(t[1],10)}function Nu(e){let t=hu.exec(e);if(t)return parseInt(t[1],10)}function Pu(e){return e.startsWith(`xl/media/`)}function Fu(e){let t=_u.exec(e);return t?t[1]:void 0}function Iu(e){return gu.test(e)}function Lu(e){let t=/^xl\/theme\/([a-zA-Z0-9]+)[.]xml$/.exec(e);return t?t[1]:void 0}function Ru(e){return Pu(e)||Iu(e)}function zu(e){let t=vu.exec(e);return t?t[1]:void 0}function Bu(e){let t=yu.exec(e);return t?t[1]:void 0}function Vu(e){let t=bu.exec(e);return t?t[1]:void 0}function Hu(e){let t=xu.exec(e);return t?t[1]:void 0}function Uu(e){return Su.test(e)}function Wu(e){let t=Cu.exec(e);return t?t[1]:void 0}function Gu(e){let t=wu.exec(e);return t?t[1]:void 0}function Ku(e){let t=Tu.exec(e);return t?t[1]:void 0}function qu(e){let t=Eu.exec(e);return t?t[1]:void 0}function Ju(e){let t=Du.exec(e);return t?t[1]:void 0}function Yu(e){let t=Ou.exec(e);return t?t[1]:void 0}function Xu(e){let t=ku.exec(e);return t?parseInt(t[1],10):void 0}function Zu(e){let t=Au.exec(e);return t?parseInt(t[1],10):void 0}function Qu(e){return e.startsWith(`/`)?e:`/${e}`}function $u(e){return`xl/theme/${e}.xml`}function ed(e){return`xl/media/${e}`}function td(e){return`xl/worksheets/sheet${e}.xml`}function nd(e){return`xl/worksheets/_rels/sheet${e}.xml.rels`}function rd(e){return`worksheets/sheet${e}.xml`}function id(e){return`xl/comments${e}.xml`}function ad(e){return`xl/${e}.xml`}function od(e){return`xl/drawings/vmlDrawing${e}.vml`}function sd(e){return`xl/drawings/vmlDrawingHF${e}.vml`}function cd(e){return`xl/drawings/_rels/vmlDrawingHF${e}.vml.rels`}function ld(e){return`xl/tables/${e}`}function ud(e){return`xl/drawings/${e}.xml`}function dd(e){return`xl/drawings/_rels/${e}.xml.rels`}function fd(e){return`xl/pivotCache/pivotCacheDefinition${e}.xml`}function pd(e){return`xl/pivotCache/_rels/pivotCacheDefinition${e}.xml.rels`}function md(e){return`xl/pivotCache/pivotCacheRecords${e}.xml`}function hd(e){return`pivotCacheRecords${e}.xml`}function gd(e){return`xl/pivotTables/pivotTable${e}.xml`}function _d(e){return`xl/pivotTables/${e}.xml`}function vd(e){return`xl/pivotTables/_rels/pivotTable${e}.xml.rels`}function yd(e){return`xl/externalLinks/externalLink${e}.xml`}function bd(e){return`xl/externalLinks/_rels/externalLink${e}.xml.rels`}function xd(e){return`externalLinks/externalLink${e}.xml`}function Sd(e){return`../pivotCache/pivotCacheDefinition${e}.xml`}let Cd={workbookStyles:`styles.xml`,workbookSharedStrings:`sharedStrings.xml`,workbookTheme1:`theme/theme1.xml`,workbookFeaturePropertyBag:`featurePropertyBag/featurePropertyBag.xml`,workbookMetadata:`metadata.xml`};function wd(e){return`pivotCache/pivotCacheDefinition${e}.xml`}function Td(e){return`../comments${e}.xml`}function Ed(e){return`../drawings/vmlDrawing${e}.vml`}function Dd(e){return`../drawings/vmlDrawingHF${e}.vml`}function Od(e){return`../drawings/${e}.xml`}function kd(e){return`../pivotTables/pivotTable${e}.xml`}function Ad(e){return`../tables/${e}`}function jd(e){return`../media/${e}`}function Md(e){return`xl/ctrlProps/ctrlProp${e}.xml`}function Nd(e){return`../ctrlProps/ctrlProp${e}.xml`}function Pd(e,t){if(t.startsWith(`/`))return t.slice(1);let n=((e.endsWith(`/`)?e:e+`/`)+t).split(`/`),r=[];for(let e of n)if(e===`.`||e===``)continue;else e===`..`?r.pop():r.push(e);return r.join(`/`)}function Fd(e,t){if(t)for(let n in t){let r=t[n];r!==void 0&&(Fc(n),e.push(` ${n}="${Nc(String(r))}"`))}}var Id=class{constructor(){this._parts=[],this._chunks=[],this._stack=[],this._snapshots=[],this._leaf=!1,this._open=!1}_consolidate(){this._snapshots.length>0||this._parts.length>=1e4&&(this._chunks.push(this._parts.join(``)),this._parts.length=0)}get depth(){return this._stack.length}get currentElement(){return this._stack.length>0?this._stack[this._stack.length-1]:void 0}get cursor(){return this._chunks.length*1e4+this._parts.length}openXml(e){let t=e?{...A,...e}:A;this._parts.push(`<?xml`),Fd(this._parts,t),this._parts.push(`?>
|
|
116
|
+
`)}openNode(e,t){Fc(e),this._open&&this._parts.push(`>`),this._stack.push(e);let n=`<`+e;if(t)for(let e in t){let r=t[e];r!==void 0&&(Fc(e),n+=` ${e}="${Nc(String(r))}"`)}this._parts.push(n),this._leaf=!0,this._open=!0}addAttribute(e,t){if(!this._open)throw new $s(`add attribute`,`no element is open`);Fc(e),this._parts.push(` ${e}="${Nc(String(t))}"`)}addAttributes(e){if(!this._open)throw new $s(`add attributes`,`no element is open`);Fd(this._parts,e)}writeText(e){this._open&&=(this._parts.push(`>`),!1),this._leaf=!1,this._parts.push(Mc(String(e)))}writeRaw(e){this._open&&=(this._parts.push(`>`),!1),this._leaf=!1,this._parts.push(e)}writeCData(e){this._open&&=(this._parts.push(`>`),!1),this._leaf=!1,this._parts.push(Ic(e))}writeComment(e){this._open&&=(this._parts.push(`>`),!1),this._leaf=!1,Lc(e),this._parts.push(`<!--${e}-->`)}closeNode(){let e=this._stack.pop();if(e===void 0)throw new $s(`close node`,`no element is open`);this._leaf?this._parts.push(`/>`):this._parts.push(`</${e}>`),this._open=!1,this._leaf=!1,this._consolidate()}leafNode(e,t,n){Fc(e),this._open&&=(this._parts.push(`>`),!1);let r=`<`+e;if(t)for(let e in t){let n=t[e];n!==void 0&&(Fc(e),r+=` ${e}="${Nc(String(n))}"`)}n===void 0?r+=`/>`:r+=`>`+Mc(String(n))+`</`+e+`>`,this._parts.push(r),this._leaf=!1}closeAll(){for(;this._stack.length>0;)this.closeNode()}toString(){return this._chunks.length===0?this._parts.join(``):this._chunks.join(``)+this._parts.join(``)}get xml(){return this.toString()}save(){this._snapshots.push({partsLength:this._parts.length,chunksLength:this._chunks.length,stackLength:this._stack.length,leaf:this._leaf,open:this._open})}commit(){if(this._snapshots.length===0)throw new $s(`commit`,`no snapshot to commit`);this._snapshots.pop()}rollback(){if(this._snapshots.length===0)throw new $s(`rollback`,`no snapshot to rollback`);let e=this._snapshots.pop();this._parts.length=e.partsLength,this._chunks.length=e.chunksLength,this._stack.length=e.stackLength,this._leaf=e.leaf,this._open=e.open}reset(){this._parts=[],this._chunks=[],this._stack=[],this._snapshots=[],this._leaf=!1,this._open=!1}};let Ld=new Set([`ep`,`cp`,`dc`,`dcterms`,`dcmitype`,`vt`]);function Rd(e,t){let n=!1;for(let e in t)if(e.length>6&&e.startsWith(`xmlns:`)){let r=e.slice(6);if(t[e]===`http://schemas.openxmlformats.org/spreadsheetml/2006/main`)return r;Ld.has(r)&&(n=!0)}if(n)return null;let r=e.indexOf(`:`);return r!==-1&&Ld.has(e.slice(0,r))?null:void 0}function zd(e,t){let n=e.indexOf(`:`);if(n===-1)return e;let r=e.slice(0,n);return r===t||Ld.has(r)?e.slice(n+1):e}var N=class e{prepare(e,t){}render(e,t){}parseOpen(e){}parseText(e){}parseClose(e){return!1}reconcile(e,t){}reset(){this.model=void 0,this.map&&Object.values(this.map).forEach(t=>{t instanceof e?t.reset():t.xform&&t.xform.reset()})}mergeModel(e){this.model=Object.assign(this.model||{},e)}async parse(e){let t=!1,n,r=0,i=null;for await(let a of e)if(!t){for(let{eventType:e,value:o}of a)if(e===`opentag`){if(r===1){this.parseOpen(o);continue}if(r===0){let e=Rd(o.name,o.attributes);if(e===void 0){r=1,this.parseOpen(o);continue}r=2,i=e}let e=zd(o.name,i);e===o.name?this.parseOpen(o):this.parseOpen({name:e,attributes:o.attributes,isSelfClosing:o.isSelfClosing})}else if(e===`text`)this.parseText(o);else if(e===`closetag`){if(r===1){if(!this.parseClose(o.name)){t=!0,n=this.model;break}continue}if(!this.parseClose(zd(o.name,i))){t=!0,n=this.model;break}}}return t?n:this.model}async parseStreamDirect(e){let t=new dc({invalidCharHandling:`skip`}),n=new TextDecoder(`utf-8`,{fatal:!0}),r=!1,i,a=0,s=null,c;t.on(`error`,e=>{r||(c=e)}),t.on(`opentag`,e=>{if(r)return;if(a===1){this.parseOpen(e);return}if(a===0){let t=Rd(e.name,e.attributes);if(t===void 0){a=1,this.parseOpen(e);return}a=2,s=t}let t=zd(e.name,s);t===e.name?this.parseOpen(e):this.parseOpen({name:t,attributes:e.attributes,isSelfClosing:e.isSelfClosing})}),t.on(`text`,e=>{r||this.parseText(e)}),t.on(`closetag`,e=>{if(r)return;let t=a===2?zd(e.name,s):e.name;this.parseClose(t)||(r=!0,i=this.model)});for await(let i of e){if(r)continue;let e=typeof i==`string`?i:n.decode(i,{stream:!0});if(t.write(e),c)throw o(c)}if(!r){let e=n.decode();if(e&&(t.write(e),c)||(t.close(),c))throw o(c)}return r?i:this.model}async parseStream(e){return this.parseStreamDirect(e)}get xml(){return this.toXml(this.model)}toXml(e){let t=new Id;return this.render(t,e),t.xml}static toAttribute(e,t,n=!1){if(e===void 0){if(n)return t}else if(n||e!==t)return e.toString()}static toStringAttribute(t,n,r=!1){return e.toAttribute(t,n,r)}static toStringValue(e,t){return e===void 0?t:e}static toBoolAttribute(e,t,n=!1){if(e===void 0){if(n)return t}else if(n||e!==t)return e?`1`:`0`}static toBoolValue(e,t){return e===void 0?t:e===`1`}static toIntAttribute(t,n,r=!1){return e.toAttribute(t,n,r)}static toIntValue(e,t){return e===void 0?t:parseInt(e,10)}static toFloatAttribute(t,n,r=!1){return e.toAttribute(t,n,r)}static toFloatValue(e,t){return e===void 0?t:parseFloat(e)}},Bd=class extends N{constructor(){super(),this._parsedText=[]}render(e,t){e.openNode(`definedName`,{name:t.name,localSheetId:t.localSheetId}),t.kind===`opaque`&&t.rawText?e.writeText(t.rawText):e.writeText(t.ranges.join(`,`)),e.closeNode()}parseOpen(e){switch(e.name){case`definedName`:return this._parsedName=e.attributes.name,this._parsedLocalSheetId=e.attributes.localSheetId,this._parsedText=[],!0;default:return!1}}parseText(e){this._parsedText.push(e)}parseClose(){let e=this._parsedText.join(``),t={name:this._parsedName,ranges:[],rawText:e.trim()||void 0};return this._parsedLocalSheetId!==void 0&&(t.localSheetId=parseInt(this._parsedLocalSheetId,10)),this.model=t,!1}},Vd=class extends N{render(e,t){e.leafNode(`externalReference`,{"r:id":t.rId})}parseOpen(e){return e.name===`externalReference`?(this.model={rId:e.attributes[`r:id`]??``},!0):!1}parseText(){}parseClose(){return!1}};let Hd=new Set([`visible`,`hidden`,`veryHidden`]);function Ud(e){let t=e||`visible`;return Hd.has(t)?t:`visible`}var Wd=class extends N{render(e,t){e.leafNode(`sheet`,{name:t.name,sheetId:t.id,state:t.state===`visible`?void 0:t.state,"r:id":t.rId})}parseOpen(e){return e.name===`sheet`?(this.model={name:e.attributes.name,id:parseInt(e.attributes.sheetId,10),state:Ud(e.attributes.state),rId:e.attributes[`r:id`]},!0):!1}parseText(){}parseClose(){return!1}},Gd=class extends N{render(e,t){e.leafNode(`calcPr`,{calcId:171027,fullCalcOnLoad:t.fullCalcOnLoad?1:void 0,iterate:t.iterate?1:void 0,iterateCount:t.iterateCount===void 0?void 0:t.iterateCount,iterateDelta:t.iterateDelta===void 0?void 0:t.iterateDelta})}parseOpen(e){if(e.name===`calcPr`){let t=e.attributes??{};return this.model={fullCalcOnLoad:t.fullCalcOnLoad===`1`,iterate:t.iterate===`1`?!0:void 0,iterateCount:t.iterateCount===void 0?void 0:parseInt(t.iterateCount,10),iterateDelta:t.iterateDelta===void 0?void 0:parseFloat(t.iterateDelta)},!0}return!1}parseText(){}parseClose(){return!1}},Kd=class extends N{render(e,t){e.leafNode(`pivotCache`,{cacheId:t.cacheId,"r:id":t.rId})}parseOpen(e){return e.name===`pivotCache`?(this.model={cacheId:e.attributes.cacheId,rId:e.attributes[`r:id`]},!0):!1}parseText(){}parseClose(){return!1}},qd=class extends N{render(e,t){e.leafNode(`workbookPr`,{date1904:t.date1904?1:void 0,filterPrivacy:1})}parseOpen(e){return e.name===`workbookPr`?(this.model={date1904:e.attributes.date1904===`1`},!0):!1}parseText(){}parseClose(){return!1}},Jd=class extends N{get tag(){return`workbookProtection`}render(e,t){if(!t)return;let n={};t.lockStructure&&(n.lockStructure=`1`),t.lockWindows&&(n.lockWindows=`1`),t.lockRevision&&(n.lockRevision=`1`),t.workbookPassword&&(n.workbookPassword=t.workbookPassword),t.revisionsPassword&&(n.revisionsPassword=t.revisionsPassword),t.algorithmName&&(n.workbookAlgorithmName=t.algorithmName,n.workbookHashValue=t.hashValue,n.workbookSaltValue=t.saltValue,n.workbookSpinCount=t.spinCount?.toString()),Object.values(n).some(e=>e!==void 0)&&e.leafNode(this.tag,n)}parseOpen(e){switch(e.name){case this.tag:{let t=e.attributes;return this.model={lockStructure:t.lockStructure===`1`||void 0,lockWindows:t.lockWindows===`1`||void 0,lockRevision:t.lockRevision===`1`||void 0,workbookPassword:t.workbookPassword||void 0,revisionsPassword:t.revisionsPassword||void 0},t.workbookAlgorithmName&&(this.model.algorithmName=t.workbookAlgorithmName,this.model.hashValue=t.workbookHashValue,this.model.saltValue=t.workbookSaltValue,this.model.spinCount=t.workbookSpinCount?parseInt(t.workbookSpinCount,10):void 0),!0}default:return!1}}parseText(){}parseClose(){return!1}},Yd=class extends N{render(e,t){let n={xWindow:t.x??0,yWindow:t.y??0,windowWidth:t.width??12e3,windowHeight:t.height??24e3,firstSheet:t.firstSheet,activeTab:t.activeTab};t.visibility&&t.visibility!==`visible`&&(n.visibility=t.visibility),e.leafNode(`workbookView`,n)}parseOpen(e){if(e.name===`workbookView`){let t=this.model={},n=function(e,n,r){t[e]=n===void 0?r:n},r=function(e,n,r){let i=n===void 0?r:parseInt(n,10);i!==void 0&&(t[e]=i)};return r(`x`,e.attributes.xWindow,0),r(`y`,e.attributes.yWindow,0),r(`width`,e.attributes.windowWidth,25e3),r(`height`,e.attributes.windowHeight,1e4),n(`visibility`,e.attributes.visibility,`visible`),r(`activeTab`,e.attributes.activeTab,void 0),r(`firstSheet`,e.attributes.firstSheet,void 0),!0}return!1}parseText(){}parseClose(){return!1}},P=class extends N{constructor(e){super(),this.tag=e.tag,this.always=!!e.always,this.count=e.count,this.empty=e.empty,this.$count=e.$count??`count`,this.$=e.$,this.childXform=e.childXform,this.maxItems=e.maxItems}prepare(e,t){let{childXform:n}=this;e&&e.forEach((e,r)=>{t.index=r,n.prepare(e,t)})}render(e,t){if(this.always||t&&t.length){e.openNode(this.tag,this.$),this.count&&e.addAttribute(this.$count,t?.length??0);let{childXform:n}=this;(t??[]).forEach((t,r)=>{n.render(e,t,r)}),e.closeNode()}else this.empty&&e.leafNode(this.tag)}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.model=[],!0):this.childXform.parseOpen(e)?(this.parser=this.childXform,!0):!1}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)&&(this.model.push(this.parser.model),this.parser=void 0,this.maxItems&&this.model.length>this.maxItems))throw new Ur(this.childXform.tag,this.maxItems);return!0}return!1}reconcile(e,t){if(e){let{childXform:n}=this;e.forEach(e=>{n.reconcile(e,t)})}}reset(){super.reset(),this.childXform&&this.childXform.reset()}};function Xd(e,t){e.openNode(t.tag,t.$),t.c&&t.c.forEach(t=>{Xd(e,t)}),t.t&&e.writeText(t.t),e.closeNode()}var Zd=class extends N{constructor(e){super(),this._model=e}render(e){if(!this._xml){let e=new Id;Xd(e,this._model),this._xml=e.xml}e.writeRaw(this._xml)}parseOpen(){return!0}parseText(){}parseClose(e){switch(e){case this._model.tag:return!1;default:return!0}}},Qd=class e extends N{constructor(){super(),this.map={fileVersion:e.STATIC_XFORMS.fileVersion,workbookPr:new qd,workbookProtection:new Jd,bookViews:new P({tag:`bookViews`,count:!1,childXform:new Yd}),sheets:new P({tag:`sheets`,count:!1,childXform:new Wd}),definedNames:new P({tag:`definedNames`,count:!1,childXform:new Bd}),calcPr:new Gd,pivotCaches:new P({tag:`pivotCaches`,count:!1,childXform:new Kd}),externalReferences:new P({tag:`externalReferences`,count:!1,childXform:new Vd})}}prepare(e){e.sheets=e.worksheets;let t=[],n=0;e.sheets.forEach(e=>{if(e.pageSetup&&e.pageSetup.printArea&&e.pageSetup.printArea.split(`&&`).forEach(r=>{let i=r.split(`:`),a=i[0],o=i[1]??a,s={name:`_xlnm.Print_Area`,ranges:[`'${e.name}'!$${a}:$${o}`],localSheetId:n};t.push(s)}),e.pageSetup&&(e.pageSetup.printTitlesRow||e.pageSetup.printTitlesColumn)){let r=[];if(e.pageSetup.printTitlesColumn){let t=e.pageSetup.printTitlesColumn.split(`:`),n=t[0],i=t[1]??n;r.push(`'${e.name}'!$${n}:$${i}`)}if(e.pageSetup.printTitlesRow){let t=e.pageSetup.printTitlesRow.split(`:`),n=t[0],i=t[1]??n;r.push(`'${e.name}'!$${n}:$${i}`)}let i={name:`_xlnm.Print_Titles`,ranges:r,localSheetId:n};t.push(i)}n++}),t.length&&(e.definedNames=e.definedNames.concat(t)),(e.media??[]).forEach((e,t)=>{e.name=e.type+(t+1)})}render(t,n){t.openXml(A),t.openNode(`workbook`,e.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(t),this.map.workbookPr.render(t,n.properties),this.map.workbookProtection.render(t,n.protection),this.map.bookViews.render(t,n.views),this.map.sheets.render(t,n.sheets),this.map.definedNames.render(t,n.definedNames),this.map.calcPr.render(t,n.calcProperties);let r=n.pivotTables??[],i=new Set,a=r.filter(e=>i.has(e.cacheId)?!1:(i.add(e.cacheId),!0));this.map.pivotCaches.render(t,a);let o=n.externalLinks??[];if(o.length>0){let e=o.map(e=>({rId:e.rId}));this.map.externalReferences.render(t,e)}t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`workbook`:return!0;default:return this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`workbook`:return this.model={sheets:this.map.sheets.model,properties:this.map.workbookPr.model||{},protection:this.map.workbookProtection.model,views:this.map.bookViews.model,calcProperties:this.map.calcPr.model||{}},this.map.definedNames.model&&(this.model.definedNames=this.map.definedNames.model),this.map.pivotCaches.model&&this.map.pivotCaches.model.length>0&&(this.model.pivotCaches=this.map.pivotCaches.model),this.map.externalReferences.model&&this.map.externalReferences.model.length>0&&(this.model.externalReferences=this.map.externalReferences.model),!1;default:return!0}}reconcile(e){let t=(e.workbookRels??[]).reduce((e,t)=>(e[t.Id]=t,e),{}),n=[],r,i=0;(e.sheets??[]).forEach(a=>{let o=t[a.rId];o&&(r=e.worksheetHash[`xl/${o.Target.replace(/^(\s|\/xl\/)+/,``)}`],r&&(r.name=a.name,r.id=a.id,r.state=a.state,n[i++]=r))});let a=[];e.definedNames&&e.definedNames.forEach(e=>{let t=e.ranges?.length>0?e.ranges:e.rawText?[e.rawText]:[];if(e.name===`_xlnm.Print_Area`){if(r=n[e.localSheetId],r&&t.length>0){r.pageSetup||={};let e=O.decodeEx(t[0]);r.pageSetup.printArea=r.pageSetup.printArea?`${r.pageSetup.printArea}&&${e.dimensions}`:e.dimensions}}else if(e.name===`_xlnm.Print_Titles`){if(r=n[e.localSheetId],r&&t.length>0){r.pageSetup||={};let e=t.join(`,`),n=/\$/g,i=e.match(/\$\d+:\$\d+/);if(i&&i.length){let e=i[0];r.pageSetup.printTitlesRow=e.replace(n,``)}let a=e.match(/\$[A-Z]+:\$[A-Z]+/);if(a&&a.length){let e=a[0];r.pageSetup.printTitlesColumn=e.replace(n,``)}}}else a.push(e)}),e.definedNames=a,e.media.forEach((e,t)=>{e.index=t})}static{this.WORKBOOK_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x15`,"xmlns:x15":`http://schemas.microsoft.com/office/spreadsheetml/2010/11/main`}}static{this.STATIC_XFORMS={fileVersion:new Zd({tag:`fileVersion`,$:{appName:`xl`,lastEdited:5,lowestEdited:5,rupBuild:9303}})}}},$d=class extends N{constructor(...e){super(...e),this._metadataTypeNames=[],this._cellMetadataTypeRefs=[],this._inCellMetadata=!1,this._currentRcType=void 0}get tag(){return`metadata`}render(e,t){!t||t.dynamicArrayCount<=0||(e.openXml(A),e.openNode(`metadata`,{xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:xda":`http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray`}),e.openNode(`metadataTypes`,{count:`1`}),e.leafNode(`metadataType`,{name:`XLDAPR`,minSupportedVersion:`120000`,copy:`1`,pasteAll:`1`,pasteValues:`1`,merge:`1`,splitFirst:`1`,rowColShift:`1`,clearFormats:`1`,clearComments:`1`,assign:`1`,coerce:`1`,adjust:`1`,cellMeta:`1`}),e.closeNode(),e.openNode(`futureMetadata`,{name:`XLDAPR`,count:`1`}),e.openNode(`bk`),e.openNode(`extLst`),e.openNode(`ext`,{uri:`{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}`}),e.leafNode(`xda:dynamicArrayProperties`,{fDynamic:`1`,fCollapsed:`0`}),e.closeNode(),e.closeNode(),e.closeNode(),e.closeNode(),e.openNode(`cellMetadata`,{count:`1`}),e.openNode(`bk`),e.leafNode(`rc`,{t:`1`,v:`0`}),e.closeNode(),e.closeNode(),e.closeNode())}reset(){this._metadataTypeNames=[],this._cellMetadataTypeRefs=[],this._inCellMetadata=!1,this._currentRcType=void 0}parseOpen(e){switch(e.name){case`metadata`:return this.reset(),!0;case`metadataType`:return this._metadataTypeNames.push(e.attributes.name||``),!0;case`cellMetadata`:return this._inCellMetadata=!0,!0;case`bk`:return this._inCellMetadata&&(this._currentRcType=void 0),!0;case`rc`:return this._inCellMetadata&&e.attributes.t!==void 0&&(this._currentRcType=parseInt(e.attributes.t,10)),!0;case`metadataTypes`:case`futureMetadata`:case`extLst`:case`ext`:case`xda:dynamicArrayProperties`:return!0;default:return!1}}parseText(){}parseClose(e){switch(e){case`bk`:return this._inCellMetadata&&(this._cellMetadataTypeRefs.push(this._currentRcType??0),this._currentRcType=void 0),!0;case`cellMetadata`:return this._inCellMetadata=!1,!0;case`metadata`:{let e=new Set;for(let t=0;t<this._cellMetadataTypeRefs.length;t++){let n=this._cellMetadataTypeRefs[t];this._metadataTypeNames[n-1]===`XLDAPR`&&e.add(t+1)}return this.model={hasDynamicArrays:e.size>0,dynamicArrayCmIndices:e},!1}default:return!0}}},ef=class extends N{render(e,t){e.leafNode(`Relationship`,t)}parseOpen(e){switch(e.name){case`Relationship`:return this.model=e.attributes,!0;default:return!1}}parseText(){}parseClose(){return!1}},tf=class e extends N{constructor(){super(),this.map={Relationship:new ef}}render(t,n){let r=n||this._values;t.openXml(A),t.openNode(`Relationships`,e.RELATIONSHIPS_ATTRIBUTES),r.forEach(e=>{this.map.Relationship.render(t,e)}),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`Relationships`:return this.model=[],!0;default:if(this.parser=this.map[e.name],this.parser)return this.parser.parseOpen(e),!0;throw new Fr(`Relationships`,`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.push(this.parser.model),this.parser=void 0),!0;switch(e){case`Relationships`:return!1;default:throw new Fr(`Relationships`,`Unexpected xml node in parseClose: ${e}`)}}static{this.RELATIONSHIPS_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/package/2006/relationships`}}},nf=class extends N{constructor(e){super(),this.name=e??`color`}get tag(){return this.name}render(e,t){return t?(e.openNode(this.name),t.argb?e.addAttribute(`rgb`,t.argb):t.theme===void 0?t.indexed===void 0?e.addAttribute(`auto`,`1`):e.addAttribute(`indexed`,t.indexed):(e.addAttribute(`theme`,t.theme),t.tint!==void 0&&e.addAttribute(`tint`,t.tint)),e.closeNode(),!0):!1}parseOpen(e){return e.name===this.name?(e.attributes.rgb?this.model={argb:e.attributes.rgb}:e.attributes.theme?(this.model={theme:parseInt(e.attributes.theme,10)},e.attributes.tint&&(this.model.tint=parseFloat(e.attributes.tint))):e.attributes.indexed?this.model={indexed:parseInt(e.attributes.indexed,10)}:this.model=void 0,!0):!1}parseText(){}parseClose(){return!1}},rf=class e extends N{constructor(e){super(),this.name=e,this.map={color:new nf}}get tag(){return this.name}render(e,t,n){let r=t&&t.color||n||this.defaultColor;e.openNode(this.name),t&&t.style&&(e.addAttribute(`style`,t.style),r&&this.map.color.render(e,r)),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.name:{let{style:t}=e.attributes;return t?this.model={style:t}:this.model=void 0,!0}case`color`:return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(e===this.name&&this.map.color.model&&(this.model||={},this.model.color=this.map.color.model),!1)}validStyle(t){return e.validStyleValues[t]}static{this.validStyleValues=[`thin`,`dashed`,`dotted`,`dashDot`,`hair`,`dashDotDot`,`slantDashDot`,`mediumDashed`,`mediumDashDotDot`,`mediumDashDot`,`medium`,`double`,`thick`].reduce((e,t)=>(e[t]=!0,e),{})}},af=class extends N{constructor(){super(),this.map={top:new rf(`top`),left:new rf(`left`),bottom:new rf(`bottom`),right:new rf(`right`),diagonal:new rf(`diagonal`)}}render(e,t){let{color:n}=t;e.openNode(`border`),t.diagonal&&t.diagonal.style&&(t.diagonal.up&&e.addAttribute(`diagonalUp`,`1`),t.diagonal.down&&e.addAttribute(`diagonalDown`,`1`));let r=(r,i)=>{let a=r;a&&!a.color&&t.color&&(a={...a,color:t.color}),i.render(e,a,n)};r(t.left,this.map.left),r(t.right,this.map.right),r(t.top,this.map.top),r(t.bottom,this.map.bottom),r(t.diagonal,this.map.diagonal),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`border`:return this.reset(),this.diagonalUp=el(e.attributes.diagonalUp),this.diagonalDown=el(e.attributes.diagonalDown),!0;default:return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;if(e===`border`){let e={},t=!1,n=(n,r,i)=>{r&&(i&&Object.assign(r,i),e[n]=r,t=!0)};n(`left`,this.map.left.model),n(`right`,this.map.right.model),n(`top`,this.map.top.model),n(`bottom`,this.map.bottom.model),n(`diagonal`,this.map.diagonal.model,{up:this.diagonalUp,down:this.diagonalDown}),this.model=t?e:void 0}return!1}};let of={ReadingOrder:{LeftToRight:1,RightToLeft:2}},sf={horizontalValues:[`left`,`center`,`right`,`fill`,`centerContinuous`,`distributed`,`justify`].reduce((e,t)=>(e[t]=!0,e),{}),horizontal(e){return this.horizontalValues[e]?e:void 0},verticalValues:[`top`,`middle`,`bottom`,`distributed`,`justify`].reduce((e,t)=>(e[t]=!0,e),{}),vertical(e){return e===`middle`?`center`:this.verticalValues[e]?e:void 0},wrapText(e){return e?!0:void 0},shrinkToFit(e){return e?!0:void 0},textRotation(e){switch(e){case`vertical`:return e;default:{let t=Jc(e);return t!==void 0&&t>=-90&&t<=90?t:void 0}}},indent(e){let t=Jc(e);return Math.max(0,t)},readingOrder(e){switch(e){case`ltr`:return of.ReadingOrder.LeftToRight;case`rtl`:return of.ReadingOrder.RightToLeft;default:return}}},cf={toXml(e){let t=sf.textRotation(e);if(t){if(t===`vertical`)return 255;let e=Math.round(t);if(e>=0&&e<=90)return e;if(e<0&&e>=-90)return 90-e}},toModel(e){let t=Jc(e);if(t!==void 0){if(t===255)return`vertical`;if(t>=0&&t<=90)return t;if(t>90&&t<=180)return 90-t}}};var lf=class extends N{get tag(){return`alignment`}render(e,t){let n={};function r(e,t){t&&(n[e]=t)}r(`horizontal`,sf.horizontal(t.horizontal)),r(`vertical`,sf.vertical(t.vertical)),r(`wrapText`,sf.wrapText(t.wrapText)?`1`:!1),r(`shrinkToFit`,sf.shrinkToFit(t.shrinkToFit)?`1`:!1),r(`indent`,sf.indent(t.indent)),r(`textRotation`,cf.toXml(t.textRotation)),r(`readingOrder`,sf.readingOrder(t.readingOrder)),Object.keys(n).length>0&&e.leafNode(`alignment`,n)}parseOpen(e){let t={},n=!1;function r(e,r,i){e&&(t[r]=i,n=!0)}r(e.attributes.horizontal,`horizontal`,e.attributes.horizontal),r(e.attributes.vertical,`vertical`,e.attributes.vertical===`center`?`middle`:e.attributes.vertical),r(e.attributes.wrapText,`wrapText`,el(e.attributes.wrapText)),r(e.attributes.shrinkToFit,`shrinkToFit`,el(e.attributes.shrinkToFit)),r(e.attributes.indent,`indent`,parseInt(e.attributes.indent,10)),r(e.attributes.textRotation,`textRotation`,cf.toModel(e.attributes.textRotation)),r(e.attributes.readingOrder,`readingOrder`,e.attributes.readingOrder===`2`?`rtl`:`ltr`),this.model=n?t:null}parseText(){}parseClose(){return!1}},uf=class extends N{constructor(){super(),this.map={color:new nf}}get tag(){return`stop`}render(e,t){e.openNode(`stop`),e.addAttribute(`position`,t.position),this.map.color.render(e,t.color),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`stop`:return this.model={position:parseFloat(e.attributes.position)},!0;case`color`:return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(){}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.model.color=this.parser.model,this.parser=void 0),!0):!1}},df=class extends N{constructor(){super(),this.map={fgColor:new nf(`fgColor`),bgColor:new nf(`bgColor`)}}get name(){return`pattern`}get tag(){return`patternFill`}render(e,t){e.openNode(`patternFill`),e.addAttribute(`patternType`,t.pattern),t.fgColor&&this.map.fgColor.render(e,t.fgColor),t.bgColor&&this.map.bgColor.render(e,t.bgColor),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`patternFill`:return this.model={type:`pattern`,pattern:e.attributes.patternType},!0;default:return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser.model&&(this.model[e]=this.parser.model),this.parser=void 0),!0):!1}},ff=class extends N{constructor(){super(),this.map={stop:new uf}}get name(){return`gradient`}get tag(){return`gradientFill`}render(e,t){switch(e.openNode(`gradientFill`),t.gradient){case`angle`:e.addAttribute(`degree`,t.degree);break;case`path`:e.addAttribute(`type`,`path`),t.center.left&&(e.addAttribute(`left`,t.center.left),t.center.right===void 0&&e.addAttribute(`right`,t.center.left)),t.center.right&&e.addAttribute(`right`,t.center.right),t.center.top&&(e.addAttribute(`top`,t.center.top),t.center.bottom===void 0&&e.addAttribute(`bottom`,t.center.top)),t.center.bottom&&e.addAttribute(`bottom`,t.center.bottom);break;default:break}let n=this.map.stop;t.stops.forEach(t=>{n.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`gradientFill`:{let t=this.model={stops:[]};return e.attributes.degree?(t.gradient=`angle`,t.degree=parseInt(e.attributes.degree,10)):e.attributes.type===`path`&&(t.gradient=`path`,t.center={left:e.attributes.left?parseFloat(e.attributes.left):0,top:e.attributes.top?parseFloat(e.attributes.top):0},e.attributes.right!==e.attributes.left&&(t.center.right=e.attributes.right?parseFloat(e.attributes.right):0),e.attributes.bottom!==e.attributes.top&&(t.center.bottom=e.attributes.bottom?parseFloat(e.attributes.bottom):0)),!0}case`stop`:return this.parser=this.map.stop,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.model.stops.push(this.parser.model),this.parser=void 0),!0):!1}},pf=class e extends N{constructor(){super(),this.map={patternFill:new df,gradientFill:new ff}}get tag(){return`fill`}render(e,t){t.type!==`pattern`&&t.type!==`gradient`||(e.openNode(`fill`),t.type===`pattern`?this.map.patternFill.render(e,t):this.map.gradientFill.render(e,t),e.closeNode())}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`fill`:return this.model={},!0;default:return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.model=this.parser.model,this.model.type=this.parser.name,this.parser=void 0),!0):!1}validStyle(t){return e.validPatternValues[t]}static{this.validPatternValues=[`none`,`solid`,`darkVertical`,`darkGray`,`mediumGray`,`lightGray`,`gray125`,`gray0625`,`darkHorizontal`,`darkVertical`,`darkDown`,`darkUp`,`darkGrid`,`darkTrellis`,`lightHorizontal`,`lightVertical`,`lightDown`,`lightUp`,`lightGrid`,`lightTrellis`,`lightGrid`].reduce((e,t)=>(e[t]=!0,e),{})}static{this.StopXform=uf}static{this.PatternFillXform=df}static{this.GradientFillXform=ff}},mf=class extends N{constructor(e){super(),this.tag=e.tag,this.attr=e.attr}render(e,t){t&&(e.openNode(this.tag),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.model=!0)}parseText(){}parseClose(){return!1}},hf=class extends N{constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this.zero=e.zero,this.text=[]}render(e,t){(t||this.zero)&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,t):e.writeText(t),e.closeNode())}parseOpen(e){return e.name===this.tag?(this.attr?this.model=parseInt(e.attributes[this.attr],10):this.text=[],!0):!1}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=parseInt(this.text.join(``)||`0`,10)),!1}},gf=class extends N{constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this.text=[]}render(e,t){t!==void 0&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,t):e.writeText(t),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.attr?this.model=e.attributes[this.attr]:this.text=[])}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=this.text.join(``)),!1}},_f=class e extends N{static{this.Attributes={single:{},double:{val:`double`},singleAccounting:{val:`singleAccounting`},doubleAccounting:{val:`doubleAccounting`}}}constructor(e){super(),this.model=e}get tag(){return`u`}render(t,n){if(n||=this.model,n===!0)t.leafNode(`u`);else{let r=e.Attributes[n];r&&t.leafNode(`u`,r)}}parseOpen(e){e.name===`u`&&(this.model=e.attributes.val||!0)}parseText(){}parseClose(){return!1}},vf=class e extends N{constructor(t){super(),this.options=t||e.OPTIONS;let n=[{tag:`b`,prop:`bold`,xform:new mf({tag:`b`,attr:`val`})},{tag:`i`,prop:`italic`,xform:new mf({tag:`i`,attr:`val`})},{tag:`u`,prop:`underline`,xform:new _f},{tag:`strike`,prop:`strike`,xform:new mf({tag:`strike`,attr:`val`})},{tag:`condense`,prop:`condense`,xform:new mf({tag:`condense`,attr:`val`})},{tag:`extend`,prop:`extend`,xform:new mf({tag:`extend`,attr:`val`})},{tag:`outline`,prop:`outline`,xform:new mf({tag:`outline`,attr:`val`})},{tag:`shadow`,prop:`shadow`,xform:new mf({tag:`shadow`,attr:`val`})},{tag:`sz`,prop:`size`,xform:new hf({tag:`sz`,attr:`val`})},{tag:`color`,prop:`color`,xform:new nf},{tag:this.options.fontNameTag,prop:`name`,xform:new gf({tag:this.options.fontNameTag,attr:`val`})},{tag:`family`,prop:`family`,xform:new hf({tag:`family`,attr:`val`})},{tag:`scheme`,prop:`scheme`,xform:new gf({tag:`scheme`,attr:`val`})},{tag:`charset`,prop:`charset`,xform:new hf({tag:`charset`,attr:`val`})},{tag:`vertAlign`,prop:`vertAlign`,xform:new gf({tag:`vertAlign`,attr:`val`})}];this.map=Object.fromEntries(n.map(e=>[e.tag,{prop:e.prop,xform:e.xform}])),this.renderOrder=n.map(e=>e.tag)}get tag(){return this.options.tagName}render(e,t){let{map:n,renderOrder:r}=this;e.openNode(this.options.tagName),r.forEach(r=>{n[r].xform.render(e,t[n[r].prop])}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(this.map[e.name])return this.parser=this.map[e.name].xform,this.parser.parseOpen(e);switch(e.name){case this.options.tagName:return this.model={},!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser&&!this.parser.parseClose(e)){let t=this.map[e];return this.parser.model&&(this.model[t.prop]=this.parser.model),this.parser=void 0,!0}switch(e){case this.options.tagName:return!1;default:return!0}}static{this.OPTIONS={tagName:`font`,fontNameTag:`name`}}};let yf={0:{f:`General`},1:{f:`0`},2:{f:`0.00`},3:{f:`#,##0`},4:{f:`#,##0.00`},9:{f:`0%`},10:{f:`0.00%`},11:{f:`0.00E+00`},12:{f:`# ?/?`},13:{f:`# ??/??`},14:{f:`mm-dd-yy`},15:{f:`d-mmm-yy`},16:{f:`d-mmm`},17:{f:`mmm-yy`},18:{f:`h:mm AM/PM`},19:{f:`h:mm:ss AM/PM`},20:{f:`h:mm`},21:{f:`h:mm:ss`},22:{f:`m/d/yy h:mm`},27:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},28:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},29:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},30:{"zh-tw":`m/d/yy `,"zh-cn":`m-d-yy`,"ja-jp":`m/d/yy`,"ko-kr":`mm-dd-yy`},31:{"zh-tw":`yyyy"年"m"月"d"日"`,"zh-cn":`yyyy"年"m"月"d"日"`,"ja-jp":`yyyy"年"m"月"d"日"`,"ko-kr":`yyyy"년" mm"월" dd"일"`},32:{"zh-tw":`hh"時"mm"分"`,"zh-cn":`h"时"mm"分"`,"ja-jp":`h"時"mm"分"`,"ko-kr":`h"시" mm"분"`},33:{"zh-tw":`hh"時"mm"分"ss"秒"`,"zh-cn":`h"时"mm"分"ss"秒"`,"ja-jp":`h"時"mm"分"ss"秒"`,"ko-kr":`h"시" mm"분" ss"초"`},34:{"zh-tw":`上午/下午 hh"時"mm"分"`,"zh-cn":`上午/下午 h"时"mm"分"`,"ja-jp":`yyyy"年"m"月"`,"ko-kr":`yyyy-mm-dd`},35:{"zh-tw":`上午/下午 hh"時"mm"分"ss"秒"`,"zh-cn":`上午/下午 h"时"mm"分"ss"秒"`,"ja-jp":`m"月"d"日"`,"ko-kr":`yyyy-mm-dd`},36:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},37:{f:`#,##0 ;(#,##0)`},38:{f:`#,##0 ;[Red](#,##0)`},39:{f:`#,##0.00;(#,##0.00)`},40:{f:`#,##0.00;[Red](#,##0.00)`},45:{f:`mm:ss`},46:{f:`[h]:mm:ss`},47:{f:`mmss.0`},48:{f:`##0.0E+0`},49:{f:`@`},50:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},51:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},52:{"zh-tw":`上午/下午 hh"時"mm"分"`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`yyyy"年"m"月"`,"ko-kr":`yyyy-mm-dd`},53:{"zh-tw":`上午/下午 hh"時"mm"分"ss"秒"`,"zh-cn":`m"月"d"日"`,"ja-jp":`m"月"d"日"`,"ko-kr":`yyyy-mm-dd`},54:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},55:{"zh-tw":`上午/下午 hh"時"mm"分"`,"zh-cn":`上午/下午 h"时"mm"分"`,"ja-jp":`yyyy"年"m"月"`,"ko-kr":`yyyy-mm-dd`},56:{"zh-tw":`上午/下午 hh"時"mm"分"ss"秒"`,"zh-cn":`上午/下午 h"时"mm"分"ss"秒"`,"ja-jp":`m"月"d"日"`,"ko-kr":`yyyy-mm-dd`},57:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},58:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},59:{"th-th":`t0`},60:{"th-th":`t0.00`},61:{"th-th":`t#,##0`},62:{"th-th":`t#,##0.00`},67:{"th-th":`t0%`},68:{"th-th":`t0.00%`},69:{"th-th":`t# ?/?`},70:{"th-th":`t# ??/??`},81:{"th-th":`d/m/bb`}};function bf(){let e={};return Object.entries(yf).forEach(([t,n])=>{n.f&&(e[n.f]=parseInt(t,10))}),e}let xf=null;function Sf(){return xf||=bf(),xf}var Cf=class extends N{constructor(e,t){super(),this.id=e,this.formatCode=t}get tag(){return`numFmt`}render(e,t){e.leafNode(`numFmt`,{numFmtId:t.id,formatCode:t.formatCode})}parseOpen(e){switch(e.name){case`numFmt`:return this.model={id:parseInt(e.attributes.numFmtId,10),formatCode:e.attributes.formatCode.replace(/[\\](.)/g,`$1`)},!0;default:return!1}}parseText(){}parseClose(){return!1}static getDefaultFmtId(e){return Sf()[e]}static getDefaultFmtCode(e){return yf[e]&&yf[e].f}};let wf={boolean(e,t){return e===void 0?t:e}};var Tf=class extends N{get tag(){return`protection`}render(e,t){let n={},r=wf.boolean(t.locked,!0)?void 0:`0`,i=wf.boolean(t.hidden,!1)?`1`:void 0;r!==void 0&&(n.locked=r),i!==void 0&&(n.hidden=i),Object.keys(n).length>0&&e.leafNode(`protection`,n)}parseOpen(e){let t={locked:e.attributes.locked!==`0`,hidden:e.attributes.hidden===`1`},n=!t.locked||t.hidden;this.model=n?t:null}parseText(){}parseClose(){return!1}},Ef=class extends N{constructor(){super(),this.map={alignment:new lf,border:new af,fill:new pf,font:new vf,numFmt:new Cf,protection:new Tf}}get tag(){return`dxf`}render(e,t){if(e.openNode(this.tag),t.font&&this.map.font.render(e,t.font),t.numFmt&&t.numFmtId){let n={id:t.numFmtId,formatCode:t.numFmt};this.map.numFmt.render(e,n)}t.fill&&this.map.fill.render(e,t.fill),t.alignment&&this.map.alignment.render(e,t.alignment),t.border&&this.map.border.render(e,t.border),t.protection&&this.map.protection.render(e,t.protection),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:return this.reset(),!0;default:return this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e===this.tag?(this.model={alignment:this.map.alignment.model,border:this.map.border.model,fill:this.map.fill.model,font:this.map.font.model,numFmt:this.map.numFmt.model,protection:this.map.protection.model},!1):!0}},Df=class extends N{constructor(e){super(),this.xfId=!!(e&&e.xfId),this.map={alignment:new lf,protection:new Tf}}get tag(){return`xf`}render(e,t){e.openNode(`xf`,{numFmtId:t.numFmtId??0,fontId:t.fontId??0,fillId:t.fillId??0,borderId:t.borderId??0}),this.xfId&&e.addAttribute(`xfId`,t.xfId??0),(t.applyNumberFormat||t.numFmtId)&&e.addAttribute(`applyNumberFormat`,`1`),(t.applyFont||t.fontId)&&e.addAttribute(`applyFont`,`1`),(t.applyFill||t.fillId)&&e.addAttribute(`applyFill`,`1`),(t.applyBorder||t.borderId)&&e.addAttribute(`applyBorder`,`1`),(t.applyAlignment||t.alignment)&&e.addAttribute(`applyAlignment`,`1`),(t.applyProtection||t.protection)&&e.addAttribute(`applyProtection`,`1`),t.pivotButton&&e.addAttribute(`pivotButton`,`1`),t.alignment&&this.map.alignment.render(e,t.alignment),t.protection&&this.map.protection.render(e,t.protection),t.checkbox&&t.xfComplementIndex!==void 0&&(e.openNode(`extLst`),e.openNode(`ext`,{"xmlns:xfpb":`http://schemas.microsoft.com/office/spreadsheetml/2022/featurepropertybag`,uri:`{C7286773-470A-42A8-94C5-96B5CB345126}`}),e.leafNode(`xfpb:xfComplement`,{i:t.xfComplementIndex}),e.closeNode(),e.closeNode()),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`xf`:this.model={numFmtId:parseInt(e.attributes.numFmtId,10),fontId:parseInt(e.attributes.fontId,10),fillId:parseInt(e.attributes.fillId,10),borderId:parseInt(e.attributes.borderId,10)},this.xfId&&(this.model.xfId=parseInt(e.attributes.xfId,10)),e.attributes.pivotButton===`1`&&(this.model.pivotButton=!0);for(let t of[`applyNumberFormat`,`applyFont`,`applyFill`,`applyBorder`,`applyAlignment`,`applyProtection`])e.attributes[t]===`1`&&(this.model[t]=!0);return!0;case`alignment`:return this.parser=this.map.alignment,this.parser.parseOpen(e),!0;case`protection`:return this.parser=this.map.protection,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.map.protection===this.parser?this.model.protection=this.parser.model:this.model.alignment=this.parser.model,this.parser=void 0),!0):e!==`xf`}},Of=class e extends N{constructor(t){super(),this.map={numFmts:new P({tag:`numFmts`,count:!0,childXform:new Cf}),fonts:new P({tag:`fonts`,count:!0,childXform:new vf,$:{"x14ac:knownFonts":1}}),fills:new P({tag:`fills`,count:!0,childXform:new pf}),borders:new P({tag:`borders`,count:!0,childXform:new af}),cellStyleXfs:new P({tag:`cellStyleXfs`,count:!0,childXform:new Df}),cellXfs:new P({tag:`cellXfs`,count:!0,childXform:new Df({xfId:!0})}),dxfs:new P({tag:`dxfs`,always:!0,count:!0,childXform:new Ef}),numFmt:new Cf,font:new vf,fill:new pf,border:new af,style:new Df({xfId:!0}),cellStyles:e.STATIC_XFORMS.cellStyles,tableStyles:e.STATIC_XFORMS.tableStyles,extLst:e.STATIC_XFORMS.extLst},t&&this.init()}initIndex(){this.index={style:{},numFmt:{},numFmtNextId:164,font:{},border:{},fill:{}}}init(){this.model={styles:[],numFmts:[],fonts:[],borders:[],fills:[],dxfs:[]},this.initIndex(),this._addBorder({}),this._addStyle({numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}),this._addFill({type:`pattern`,pattern:`none`}),this._addFill({type:`pattern`,pattern:`gray125`}),this.weakMap=new WeakMap,this._hasCheckboxes=!1}setDefaultFont(e){this.defaultFont=e}render(t,n){let r=n||this.model;t.openXml(A),t.openNode(`styleSheet`,e.STYLESHEET_ATTRIBUTES),this.index?(r.numFmts&&r.numFmts.length&&(t.openNode(`numFmts`,{count:r.numFmts.length}),r.numFmts.forEach(e=>{t.writeRaw(e)}),t.closeNode()),r.fonts.length||this._addFont(this.defaultFont||{size:11,color:{theme:1},name:`Calibri`,family:2,scheme:`minor`}),t.openNode(`fonts`,{count:r.fonts.length,"x14ac:knownFonts":1}),r.fonts.forEach(e=>{t.writeRaw(e)}),t.closeNode(),t.openNode(`fills`,{count:r.fills.length}),r.fills.forEach(e=>{t.writeRaw(e)}),t.closeNode(),t.openNode(`borders`,{count:r.borders.length}),r.borders.forEach(e=>{t.writeRaw(e)}),t.closeNode(),this.map.cellStyleXfs.render(t,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),t.openNode(`cellXfs`,{count:r.styles.length}),r.styles.forEach(e=>{t.writeRaw(e)}),t.closeNode()):(this.map.numFmts.render(t,r.numFmts),this.map.fonts.render(t,r.fonts),this.map.fills.render(t,r.fills),this.map.borders.render(t,r.borders),this.map.cellStyleXfs.render(t,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(t,r.styles)),e.STATIC_XFORMS.cellStyles.render(t),this.map.dxfs.render(t,r.dxfs),e.STATIC_XFORMS.tableStyles.render(t),e.STATIC_XFORMS.extLst.render(t),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`styleSheet`:return this.initIndex(),!0;default:return this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`styleSheet`:{this.model={};let e=(e,t)=>{t.model&&t.model.length&&(this.model[e]=t.model)};if(e(`numFmts`,this.map.numFmts),e(`fonts`,this.map.fonts),e(`fills`,this.map.fills),e(`borders`,this.map.borders),e(`styles`,this.map.cellXfs),e(`dxfs`,this.map.dxfs),this.map.fonts.model&&this.map.fonts.model.length>0&&(this.defaultFont=this.map.fonts.model[0]),this.index={model:[],numFmt:{}},this.model.numFmts){let e=this.index.numFmt;this.model.numFmts.forEach(t=>{e[t.id]=t.formatCode})}return!1}default:return!0}}addStyleModel(e,t){if(!e)return 0;this.model.fonts.length||this._addFont(this.defaultFont||{size:11,color:{theme:1},name:`Calibri`,family:2,scheme:`minor`});let n=t||2;if(n!==12&&this.weakMap&&this.weakMap.has(e))return this.weakMap.get(e);let r={};if(e.numFmt)r.numFmtId=this._addNumFmtStr(e.numFmt);else switch(n){case 2:r.numFmtId=this._addNumFmtStr(`General`);break;case 4:r.numFmtId=this._addNumFmtStr(`mm-dd-yy`);break;default:break}e.font&&(r.fontId=this._addFont(e.font)),e.border&&(r.borderId=this._addBorder(e.border)),e.fill&&(r.fillId=this._addFill(e.fill)),e.alignment&&(r.alignment=e.alignment),e.protection&&(r.protection=e.protection);for(let t of[`pivotButton`,`applyNumberFormat`,`applyFont`,`applyFill`,`applyBorder`,`applyAlignment`,`applyProtection`])e[t]&&(r[t]=!0);n===12&&(this._hasCheckboxes=!0,r.alignment=r.alignment||{},r.checkbox=!0,r.xfComplementIndex=0);let i=this._addStyle(r);return n!==12&&this.weakMap&&this.weakMap.set(e,i),i}getStyleModel(e){let t=this.model.styles[e];if(!t)return null;let n=this.index.model[e];if(n)return n;if(n=this.index.model[e]={},t.numFmtId){let e=this.index.numFmt[t.numFmtId]||Cf.getDefaultFmtCode(t.numFmtId);e&&(n.numFmt=e)}function r(e,t,r){if(r||r===0){let i=t[r];i&&(n[e]=i)}}r(`font`,this.model.fonts,t.fontId),r(`border`,this.model.borders,t.borderId),r(`fill`,this.model.fills,t.fillId),t.alignment&&(n.alignment=t.alignment),t.protection&&(n.protection=t.protection);for(let e of[`pivotButton`,`applyNumberFormat`,`applyFont`,`applyFill`,`applyBorder`,`applyAlignment`,`applyProtection`])t[e]&&(n[e]=!0);return n}addDxfStyle(e){return e.numFmt&&(e.numFmtId=this._addNumFmtStr(e.numFmt)),this.model.dxfs.push(e),this.model.dxfs.length-1}getDxfStyle(e){return this.model.dxfs[e]}get hasCheckboxes(){return!!this._hasCheckboxes}_addStyle(e){let t=this.map.style.toXml(e),n=this.index.style[t];return n===void 0&&(n=this.index.style[t]=this.model.styles.length,this.model.styles.push(t)),n}_addNumFmtStr(e){let t=Cf.getDefaultFmtId(e);if(t!==void 0||(t=this.index.numFmt[e],t!==void 0))return t;t=this.index.numFmt[e]=164+this.model.numFmts.length;let n=this.map.numFmt.toXml({id:t,formatCode:e});return this.model.numFmts.push(n),t}_addFont(e){let t=this.map.font.toXml(e),n=this.index.font[t];return n===void 0&&(n=this.index.font[t]=this.model.fonts.length,this.model.fonts.push(t)),n}_addBorder(e){let t=this.map.border.toXml(e),n=this.index.border[t];return n===void 0&&(n=this.index.border[t]=this.model.borders.length,this.model.borders.push(t)),n}_addFill(e){let t=this.map.fill.toXml(e),n=this.index.fill[t];return n===void 0&&(n=this.index.fill[t]=this.model.fills.length,this.model.fills.push(t)),n}static{this.STYLESHEET_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x14ac x16r2`,"xmlns:x14ac":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac`,"xmlns:x16r2":`http://schemas.microsoft.com/office/spreadsheetml/2015/02/main`}}static{this.STATIC_XFORMS={cellStyles:new Zd({tag:`cellStyles`,$:{count:1},c:[{tag:`cellStyle`,$:{name:`Normal`,xfId:0,builtinId:0}}]}),dxfs:new Zd({tag:`dxfs`,$:{count:0}}),tableStyles:new Zd({tag:`tableStyles`,$:{count:0,defaultTableStyle:`TableStyleMedium2`,defaultPivotStyle:`PivotStyleLight16`}}),extLst:new Zd({tag:`extLst`,c:[{tag:`ext`,$:{uri:`{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`},c:[{tag:`x14:slicerStyles`,$:{defaultSlicerStyle:`SlicerStyleLight1`}}]},{tag:`ext`,$:{uri:`{9260A510-F301-46a8-8635-F512D64BE5F5}`,"xmlns:x15":`http://schemas.microsoft.com/office/spreadsheetml/2010/11/main`},c:[{tag:`x15:timelineStyles`,$:{defaultTimelineStyle:`TimeSlicerStyleLight1`}}]}]})}}};Of.Mock=class extends Of{constructor(){super(),this.model={styles:[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}],numFmts:[],fonts:[{size:11,color:{theme:1},name:`Calibri`,family:2,scheme:`minor`}],borders:[{}],fills:[{type:`pattern`,pattern:`none`},{type:`pattern`,pattern:`gray125`}]}}parseStream(e){return e.autodrain(),Promise.resolve()}addStyleModel(e,t){switch(t){case 12:throw new Ir(`Checkbox cells`,`require styles to be enabled (useStyles: true)`);case 4:return this.dateStyleId;default:return 0}}get hasCheckboxes(){return!1}get dateStyleId(){if(!this._dateStyleId){let e={numFmtId:Cf.getDefaultFmtId(`mm-dd-yy`)};this._dateStyleId=this.model.styles.length,this.model.styles.push(e)}return this._dateStyleId}getStyleModel(){return{}}};var kf=class extends Pn{getHyperlinkReader(e){return this._hyperlinkReadersBySheetNo?.[String(e)]}getHyperlink(e,t){return this.getHyperlinkReader(e)?.hyperlinks?.[t]}getHyperlinkTarget(e,t){return this.getHyperlink(e,t)?.target}constructor(e,t,n,r){super(),this.hasDynamicArrayMetadata=!1,this._totalBufferedBytes=0,this.input=e,this.WorksheetReaderClass=n,this.HyperlinkReaderClass=r,this._maxBufferedBytes=t.maxBufferedWorksheetBytes??256*1024*1024,this.options={worksheets:`emit`,sharedStrings:`cache`,hyperlinks:`ignore`,styles:`ignore`,entries:`ignore`,...t},this.styles=new Of,this.styles.init()}_getStream(e){if(e instanceof D)return e;if(e&&typeof e==`object`&&typeof e.getReader==`function`){let t=D.fromWeb;if(typeof t==`function`)return t(e);try{return new D({stream:e})}catch{throw new Lr(`<ReadableStream>`,`read`,`Could not recognise input`)}}let t=e;if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t instanceof Uint8Array)return D.from([t]);throw new Lr(String(e),`read`,`Could not recognise input`)}_cleanupWaitingWorksheets(e){for(let t of e)t&&typeof t.cleanup==`function`&&t.cleanup()}_createWorksheetReader(e){return new this.WorksheetReaderClass({workbook:this,id:e.id,iterator:e.iterator,options:e.options})}_createHyperlinkReader(e){return new this.HyperlinkReaderClass({workbook:this,id:e.id,iterator:e.iterator,options:e.options})}async read(e,t){try{for await(let{eventType:n,value:r}of this.parse(e,t))switch(n){case`shared-strings`:this.emit(n,r);break;case`worksheet`:this.emit(n,r),await r.read();break;case`hyperlinks`:this.emit(n,r);break}this.emit(`end`),this.emit(`finished`)}catch(e){this.emit(`error`,e)}}async*[Symbol.asyncIterator](){for await(let{eventType:e,value:t}of this.parse())e===`worksheet`&&(yield t)}async*parse(e,t){t&&(this.options=t);let n=this.stream=this._getStream(e||this.input),r=[];try{for await(let e of this._parseEntries(n))if(e.eventType===`waiting-worksheet`){let t=await this._storeWaitingWorksheet(e.sheetNo,e.entry);r.push(t)}else yield e;yield*this._processWaitingWorksheets(r)}catch(e){throw this._cleanupWaitingWorksheets(r),e}}_emitEntry(e){this.options.entries===`emit`&&this.emit(`entry`,e)}async _parseRels(e){let t=new tf;this.workbookRels=await t.parseStream(pu(e)),this._workbookRelIdByTarget=Object.create(null);for(let e of this.workbookRels??[])e?.Target&&e?.Id&&(this._workbookRelIdByTarget[e.Target]=e.Id)}async _parseWorkbook(e){this._emitEntry({type:`workbook`});let t=new Qd;this.model=await t.parseStream(pu(e)),this.properties=t.map?.workbookPr,this._sheetByRelId=Object.create(null);for(let e of this.model?.sheets??[])this._sheetByRelId[e.rId]=e}async*_parseSharedStrings(e){switch(this._emitEntry({type:`shared-strings`}),this.options.sharedStrings){case`cache`:this.sharedStrings=[];break;case`emit`:break;default:return}let t=null,n=[],r=0,i=null,a=!1;if(this.options.sharedStrings===`cache`){let r=this.sharedStrings,o=new dc({position:!1,invalidCharHandling:`skip`});o.on(`opentag`,e=>{switch(e.name){case`b`:i||={},i.bold=!0;break;case`charset`:i||={},i.charset=parseInt(e.attributes.charset,10);break;case`color`:i||={},i.color={},e.attributes.rgb&&(i.color.argb=e.attributes.rgb),e.attributes.val&&(i.color.argb=e.attributes.val),e.attributes.theme&&(i.color.theme=e.attributes.theme);break;case`family`:i||={},i.family=parseInt(e.attributes.val,10);break;case`i`:i||={},i.italic=!0;break;case`outline`:i||={},i.outline=!0;break;case`rFont`:i||={},i.name=e.attributes.val;break;case`r`:a=!0;break;case`si`:i=null,n=[],t=null,a=!1;break;case`sz`:i||={},i.size=parseInt(e.attributes.val,10);break;case`strike`:i||={},i.strike=!0;break;case`t`:t=null;break;case`u`:i||={},i.underline=!0;break;case`vertAlign`:i||={},i.vertAlign=e.attributes.val;break}}),o.on(`text`,e=>{t=t?t+e:e}),o.on(`closetag`,e=>{switch(e.name){case`t`:t!=null&&t.includes(`_x`)&&(t=Uc(t));break;case`r`:a&&(n.push({font:i,text:t}),i=null,t=null);break;case`si`:r.push(n.length?{richText:n}:t??``),n=[],i=null,t=null,a=!1;break}}),await fc(o,pu(e));return}let o=new dc({invalidCharHandling:`skip`}),s=new TextDecoder(`utf-8`,{fatal:!0}),c=[];o.on(`opentag`,e=>{switch(e.name){case`b`:i||={},i.bold=!0;break;case`charset`:i||={},i.charset=parseInt(e.attributes.charset,10);break;case`color`:i||={},i.color={},e.attributes.rgb&&(i.color.argb=e.attributes.rgb),e.attributes.val&&(i.color.argb=e.attributes.val),e.attributes.theme&&(i.color.theme=e.attributes.theme);break;case`family`:i||={},i.family=parseInt(e.attributes.val,10);break;case`i`:i||={},i.italic=!0;break;case`outline`:i||={},i.outline=!0;break;case`rFont`:i||={},i.name=e.attributes.val;break;case`r`:a=!0;break;case`si`:i=null,n=[],t=null,a=!1;break;case`sz`:i||={},i.size=parseInt(e.attributes.val,10);break;case`strike`:i||={},i.strike=!0;break;case`t`:t=null;break;case`u`:i||={},i.underline=!0;break;case`vertAlign`:i||={},i.vertAlign=e.attributes.val;break}}),o.on(`text`,e=>{t=t?t+e:e}),o.on(`closetag`,e=>{switch(e.name){case`t`:t!=null&&t.includes(`_x`)&&(t=Uc(t));break;case`r`:a&&(n.push({font:i,text:t}),i=null,t=null);break;case`si`:c.push({index:r++,text:n.length?{richText:n}:t??``}),n=[],i=null,t=null,a=!1;break}});for await(let t of pu(e)){let e=typeof t==`string`?t:s.decode(t,{stream:!0});if(o.write(e),c.length>0){for(let e of c)yield e;c=[]}}let l=s.decode();if(l&&o.write(l),o.close(),c.length>0)for(let e of c)yield e}async _parseStyles(e){this._emitEntry({type:`styles`}),this.options.styles===`cache`&&(this.styles=new Of,await this.styles.parseStream(pu(e)))}async _parseMetadata(e){let t=await new $d().parseStream(pu(e));t&&(this.hasDynamicArrayMetadata=!!t.hasDynamicArrays,this.dynamicArrayCmIndices=t.dynamicArrayCmIndices)}*_parseWorksheet(e,t){this._emitEntry({type:`worksheet`,id:t});let n=parseInt(t,10),r=this._createWorksheetReader({id:n,iterator:e,options:this.options});r.sheetNo=n;let i=this._workbookRelIdByTarget?.[rd(t)],a=i?this._sheetByRelId?.[i]:void 0;a&&(r.id=a.id,r.name=a.name,r.state=a.state),this.options.worksheets===`emit`&&(yield{eventType:`worksheet`,value:r})}async*_parseHyperlinks(e,t){this._emitEntry({type:`hyperlinks`,id:t});let n=this._createHyperlinkReader({id:parseInt(t,10),iterator:e,options:this.options});if(this.options.hyperlinks===`cache`){this._hyperlinkReadersBySheetNo||=Object.create(null),this._hyperlinkReadersBySheetNo[t]=n;let e=n.read;typeof e==`function`&&await e.call(n);return}this.options.hyperlinks===`emit`&&(yield{eventType:`hyperlinks`,value:n})}async*_parseEntries(e){let t=Us({forceStream:!0});e.on(`error`,e=>t.emit(`error`,e)),e.pipe(t);for await(let e of pu(t)){let t,n=ju(e.path);switch(n){case M.rootRels:break;case M.xlWorkbookRels:await this._parseRels(e);break;case M.xlWorkbook:await this._parseWorkbook(e);break;case M.xlSharedStrings:for await(let t of this._parseSharedStrings(e))yield{eventType:`shared-strings`,value:t};break;case M.xlStyles:await this._parseStyles(e);break;case M.xlMetadata:await this._parseMetadata(e);break;default:if(t=Mu(n)?.toString(),t)if(this.workbookRels&&this.model&&(this.options.sharedStrings!==`cache`||this.sharedStrings)){yield*this._parseWorksheet(pu(e),t);continue}else{yield{eventType:`waiting-worksheet`,sheetNo:t,entry:e};continue}if(t=Nu(n)?.toString(),t){yield*this._parseHyperlinks(pu(e),t);continue}break}e.autodrain()}}},Af=class extends kf{constructor(e,t={}){super(e,t,fu,pc)}async _storeWaitingWorksheet(e,t){let n=[],r=new TextEncoder;for await(let e of pu(t)){let t;if(e instanceof Uint8Array)t=e;else if(typeof e==`string`)t=r.encode(e);else continue;if(this._totalBufferedBytes+=t.length,this._totalBufferedBytes>this._maxBufferedBytes)throw Error(`Buffered worksheet data exceeds limit of ${this._maxBufferedBytes} bytes. The XLSX file may be malicious (adversarial ZIP entry ordering) or too large for streaming. Increase maxBufferedWorksheetBytes if this is expected.`);n.push(t)}return{sheetNo:e,data:n}}async*_processWaitingWorksheets(e){for(let t of e){let e=(async function*(){for(let e of t.data)yield e})();yield*this._parseWorksheet(e,t.sheetNo)}}};let jf={maxWorkers:typeof navigator<`u`&&navigator.hardwareConcurrency||4,minWorkers:0,idleTimeout:3e4,useTransferables:!0,workerUrl:void 0};function Mf(e){let t=e?.maxWorkers??jf.maxWorkers,n=e?.minWorkers??jf.minWorkers;return{maxWorkers:Math.max(1,t),minWorkers:Math.max(0,Math.min(n,t)),idleTimeout:Math.max(0,e?.idleTimeout??jf.idleTimeout),useTransferables:e?.useTransferables??jf.useTransferables,workerUrl:e?.workerUrl}}let Nf={high:3,normal:2,low:1};function Pf(e){return e?Nf[e]??Nf.normal:Nf.normal}function Ff(){return typeof Worker<`u`&&typeof Blob<`u`}function If(){return`
|
|
117
117
|
'use strict';
|
|
118
118
|
|
|
119
119
|
// Check deflate-raw support once at startup
|
|
@@ -400,54 +400,56 @@ self.onmessage = async function(event) {
|
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
402
|
};
|
|
403
|
-
`}let Sf=null,Cf=0;function wf(){if(Sf===null){let e=xf(),t=new Blob([e],{type:`text/javascript`});Sf=URL.createObjectURL(t)}return Cf++,Sf}function Tf(){if(Sf!==null&&--Cf<=0){try{URL.revokeObjectURL(Sf)}catch{}Sf=null,Cf=0}}let Ef=new Uint8Array,Df={onData:e=>{},onEnd:()=>{},onError:e=>{}};function Of(e){return e.byteOffset===0&&e.byteLength===e.buffer.byteLength}function kf(e){return Of(e)?e:e.slice()}var Af=class{_taskQueueSize(){return this._taskQueue.length-this._taskQueueHead}_compactTaskQueueIfNeeded(){this._taskQueueHead>32&&this._taskQueueHead*2>=this._taskQueue.length&&(this._taskQueue.splice(0,this._taskQueueHead),this._taskQueueHead=0)}_dequeueTask(){if(this._taskQueueHead>=this._taskQueue.length)return;let e=this._taskQueue[this._taskQueueHead++];return this._compactTaskQueueIfNeeded(),e}_compactPendingStreamRequestsIfNeeded(){this._pendingStreamRequestHead>32&&this._pendingStreamRequestHead*2>=this._pendingStreamRequests.length&&(this._pendingStreamRequests.splice(0,this._pendingStreamRequestHead),this._pendingStreamRequestHead=0)}_dequeuePendingStreamRequest(){if(this._pendingStreamRequestHead>=this._pendingStreamRequests.length)return;let e=this._pendingStreamRequests[this._pendingStreamRequestHead++];return this._compactPendingStreamRequestsIfNeeded(),e}_waitForStreamSlot(e){return e.slotWaitPromise||=new Promise(t=>{e.resolveSlotWait=()=>{e.slotWaitPromise=null,e.resolveSlotWait=null,t()}}),e.slotWaitPromise}_waitForStreamDrain(e){return e.drainWaitPromise||=new Promise(t=>{e.resolveDrainWait=()=>{e.drainWaitPromise=null,e.resolveDrainWait=null,t()}}),e.drainWaitPromise}_resolveSlotWaiter(e){e.resolveSlotWait?.()}_resolveDrainWaiter(e){e.resolveDrainWait?.()}constructor(e){this._workers=new Map,this._taskQueue=[],this._taskQueueHead=0,this._pendingTasks=new Map,this._nextTaskId=1,this._nextWorkerId=1,this._terminated=!1,this._completedTasks=0,this._failedTasks=0,this._pendingStreamRequests=[],this._pendingStreamRequestHead=0,this._options=_f(e),this._options.workerUrl?(this._workerUrl=this._options.workerUrl,this._useCustomUrl=!0):(this._workerUrl=wf(),this._useCustomUrl=!1);for(let e=0;e<this._options.minWorkers;e++)this._createWorker()}async execute(e,t,n){if(this._terminated)throw Error(`Worker pool has been terminated`);if(!bf())throw Error(`Web Workers are not supported in this environment`);if(n?.signal?.aborted)throw i();let r=this._nextTaskId++,a=n?.priority??`normal`,o=yf(a);return new Promise((i,s)=>{let c={taskId:r,taskType:e,data:t,level:n?.level,priority:a,priorityValue:o,resolve:i,reject:s,signal:n?.signal,allowTransfer:n?.allowTransfer,startTime:performance.now()};n?.signal&&(c.abortHandler=()=>{this._cancelTask(r)},n.signal.addEventListener(`abort`,c.abortHandler,{once:!0})),this._pendingTasks.set(r,c),this._enqueueTask(c),this._processQueue()})}getStats(){let e=this._workers.size,t=0;for(let e of this._workers.values())e.busy&&t++;return{totalWorkers:e,activeWorkers:t,idleWorkers:e-t,pendingTasks:this._taskQueueSize(),completedTasks:this._completedTasks,failedTasks:this._failedTasks}}terminate(){if(this._terminated)return;this._terminated=!0;for(let e of this._workers.values())this._terminateWorker(e);this._workers.clear();let e=Error(`Worker pool terminated`);for(let t of this._pendingTasks.values())this._cleanupTask(t),t.reject(e);this._pendingTasks.clear(),this._taskQueue.length=0,this._taskQueueHead=0,this._pendingStreamRequests.length=0,this._pendingStreamRequestHead=0,this._useCustomUrl||Tf()}isTerminated(){return this._terminated}_createWorker(){if(this._terminated||this._workers.size>=this._options.maxWorkers)return null;let e=this._nextWorkerId++,t=new Worker(this._workerUrl),n={id:e,worker:t,busy:!1,currentTaskId:null,idleTimer:null,streamSession:null};return t.onmessage=e=>{this._handleWorkerMessage(n,e.data)},t.onerror=e=>{this._handleWorkerError(n,e)},this._workers.set(e,n),n}_terminateWorker(e){this._clearIdleTimer(e);try{e.worker.postMessage({type:`terminate`})}catch{}try{e.worker.terminate()}catch{}this._workers.delete(e.id)}_clearIdleTimer(e){e.idleTimer!==null&&(clearTimeout(e.idleTimer),e.idleTimer=null)}_findIdleWorker(){for(let e of this._workers.values())if(!e.busy)return e}_enqueueTask(e){let t=this._taskQueue,n=e.priorityValue;this._compactTaskQueueIfNeeded();let r=this._taskQueueHead,i=t.length;for(;r<i;){let e=r+i>>>1;t[e].priorityValue>=n?r=e+1:i=e}t.splice(r,0,e)}_processQueue(){for(;!this._terminated&&this._taskQueueSize()>0;){let e=this._findIdleWorker()??this._createWorker()??void 0;if(!e)return;for(;;){let t=this._dequeueTask();if(!t)return;if(t.signal?.aborted){this._pendingTasks.delete(t.taskId),this._cleanupTask(t),t.reject(i());continue}this._assignTask(e,t);break}}}_assignTask(e,t){this._clearIdleTimer(e),e.busy=!0,e.currentTaskId=t.taskId;let n=this._options.useTransferables&&t.allowTransfer===!0,r=n?kf(t.data):t.data,i={type:`task`,taskId:t.taskId,taskType:t.taskType,data:r,level:t.level};n?e.worker.postMessage(i,[r.buffer]):e.worker.postMessage(i)}_handleWorkerMessage(e,t){if(t.type!==`ready`){if(e.streamSession){let n=e.streamSession;switch(t.type){case`started`:if(t.taskId!==n.taskId)return;n.startReady=!0,n.resolveStart?.(),n.resolveStart=null,n.rejectStart=null;return;case`out`:if(t.taskId!==n.taskId)return;n.onData(t.data);return;case`ack`:if(t.taskId!==n.taskId)return;n.inflightChunkCount>0&&n.inflightChunkCount--,this._resolveSlotWaiter(n),n.inflightChunkCount===0&&n.resolveDrainWait&&this._resolveDrainWaiter(n);return;case`done`:if(t.taskId!==n.taskId)return;n.ended=!0,n.inflightChunkCount=0,n.startReady=!0,n.resolveStart?.(),n.resolveStart=null,n.rejectStart=null,this._resolveSlotWaiter(n),this._resolveDrainWaiter(n),this._completedTasks++,t.duration??performance.now()-n.startTime,n.onEnd(),e.streamSession=null,this._workerBecameIdle(e);return;case`error`:{if(t.taskId!==n.taskId)return;let r=Error(t.error??`Unknown worker error`);n.ended=!0,n.inflightChunkCount=0,n.startReady=!0,n.rejectStart?.(r),n.resolveStart=null,n.rejectStart=null,this._resolveSlotWaiter(n),this._resolveDrainWaiter(n),this._failedTasks++,n.onError(r),e.streamSession=null,this._workerBecameIdle(e);return}default:break}}switch(t.type){case`result`:case`error`:{let n=t.taskId;if(typeof n!=`number`)return;let r=this._pendingTasks.get(n);if(!r){this._workerBecameIdle(e);return}if(this._pendingTasks.delete(n),this._cleanupTask(r),t.type===`result`){this._completedTasks++;let e=t.duration??performance.now()-r.startTime;r.resolve({data:t.data,duration:e})}else this._failedTasks++,r.reject(Error(t.error??`Unknown worker error`));this._workerBecameIdle(e);return}default:return}}}_handleWorkerError(e,t){let n=e.currentTaskId;if(this._terminateWorker(e),n!==null){let e=this._pendingTasks.get(n);e&&(this._pendingTasks.delete(n),this._cleanupTask(e),this._failedTasks++,e.reject(Error(t.message||`Worker error`)))}this._processQueue()}_workerBecameIdle(e){if(e.busy=!1,e.currentTaskId=null,this._pendingStreamRequestHead<this._pendingStreamRequests.length){let t=this._dequeuePendingStreamRequest();if(t){t(e);return}}this._taskQueueSize()>0?this._processQueue():this._workers.size>this._options.minWorkers&&this._options.idleTimeout>0&&(e.idleTimer=setTimeout(()=>{!e.busy&&this._workers.size>this._options.minWorkers&&!this._terminated&&this._terminateWorker(e)},this._options.idleTimeout))}openStream(e,t=Df){if(this._terminated)throw Error(`Worker pool has been terminated`);if(!bf())throw Error(`Web Workers are not supported in this environment`);let n=this._nextTaskId++,r=t.allowTransfer===!0,i=this._options.useTransferables&&r,a=i?kf:e=>e,o=i?(e,t,n)=>{e.postMessage(t,[n.buffer])}:(e,t,n)=>{e.postMessage(t)},s=null,c=null,l=async()=>{if(s)return s;if(c)return c;c=(async()=>{let r=this._findIdleWorker()??this._createWorker()??void 0;return r?(s=r,this._bindStreamSession(s,n,e,t.level,t),this._startStreamSession(s),s):(s=await new Promise(e=>{this._pendingStreamRequests.push(e)}),this._bindStreamSession(s,n,e,t.level,t),this._startStreamSession(s),s)})();try{return await c}finally{c=null}};l();let u=(e,t,n)=>{let r=a(n),i=t.chunkMessage;i.data=r,o(e.worker,i,r)},d=(e,t,n)=>{if(t.inflightChunkCount>=8)return this._waitForStreamSlot(t).then(()=>{t.ended||(t.inflightChunkCount++,u(e,t,n))});t.inflightChunkCount++,u(e,t,n)};return{write:async e=>{if(e.byteLength===0)return;let t=s??await l(),n=t.streamSession;if(!n||n.ended)throw Error(`Streaming session is not active`);n.writeChain=n.writeChain.then(()=>{if(!n.ended)return n.startReady?d(t,n,e):n.startPromise.then(()=>{if(!n.ended)return d(t,n,e)})}),await n.writeChain},end:async()=>{let e=await l(),t=e.streamSession;!t||t.ended||(t.startReady||await t.startPromise,await t.writeChain,t.inflightChunkCount>0&&await this._waitForStreamDrain(t),t.ended=!0,e.worker.postMessage(t.endMessage))},abort:e=>{l().then(t=>{let n=t.streamSession;if(!n)return;let r=n.abortMessage;r.error=e,t.worker.postMessage(r)})}}}_bindStreamSession(e,t,n,r,i){this._clearIdleTimer(e),e.busy=!0,e.currentTaskId=t;let a=null,o=null,s=new Promise((e,t)=>{a=e,o=t}),c=setTimeout(()=>{o?.(Error(`Worker stream start timeout`))},5e3);s.finally(()=>clearTimeout(c)),e.streamSession={taskId:t,taskType:n,startTime:performance.now(),started:!1,startReady:!1,startPromise:s,resolveStart:a,rejectStart:o,level:r,writeChain:Promise.resolve(),inflightChunkCount:0,slotWaitPromise:null,resolveSlotWait:null,drainWaitPromise:null,resolveDrainWait:null,chunkMessage:{type:`chunk`,taskId:t,data:Ef},startMessage:{type:`start`,taskId:t,taskType:n,level:r},endMessage:{type:`end`,taskId:t},abortMessage:{type:`abort`,taskId:t,error:void 0},ended:!1,onData:i.onData,onEnd:i.onEnd,onError:i.onError}}_startStreamSession(e){let t=e.streamSession;!t||t.started||(t.started=!0,e.worker.postMessage(t.startMessage))}_cancelTask(e){let t=this._pendingTasks.get(e);if(!t)return;this._pendingTasks.delete(e),this._cleanupTask(t);let n=-1;for(let t=this._taskQueueHead;t<this._taskQueue.length;t++)if(this._taskQueue[t].taskId===e){n=t;break}n>=0&&this._taskQueue.splice(n,1),t.reject(i())}_cleanupTask(e){e.abortHandler&&e.signal&&e.signal.removeEventListener(`abort`,e.abortHandler)}async executeBatch(e){let t=Array(e.length);for(let n=0;n<e.length;n++){let r=e[n];t[n]=this.execute(r.taskType,r.data,r.options)}return Promise.all(t)}};let jf=null;function Mf(e){return(!jf||jf.isTerminated())&&(jf=new Af(e)),jf}async function Nf(e,t){return(await Mf().execute(`inflate`,e,t)).data}function Pf(e,t){let n=bf();if(t.useWorker===!0)return n;if(t.useWorker===!1)return!1;let r=t.autoWorkerThreshold??1048576;return n&&e.length>=r}function Ff(e,t){if(t?.aborted||a(e))throw i(t?.reason??e)}let If={hasNative:si,native:di,worker:Nf,jsFallback:ki};async function Lf(e,t,n){let r=e.hasNative(),i=bf(),a=n.useWorker;if(a===!0&&i)try{return await e.worker(t,{level:n.level,signal:n.signal,allowTransfer:n.allowTransfer})}catch(e){Ff(e,n.signal)}return r?e.native(t):a!==!0&&Pf(t,n)?e.worker(t,{level:n.level,signal:n.signal,allowTransfer:n.allowTransfer}):e.jsFallback(t,n.level)}async function Rf(e,t={}){return Lf(If,e,t)}function zf(e){return ki(e)}new Uint8Array([31,139,8,0,0,0,0,0,0,255]);function Bf(e,t,n){return E([_i(n),e,vi(pi(t))])}function Vf(e,t={}){let n=t.level??6;return Bf(n===0?Ai(e):Fi(e,n),e,n)}let Hf=`write after end`;function Uf(e,t,n){let r=o(t);n?n(r):e.emit(`error`,r)}var Wf=class extends D{constructor(...e){super(...e),this.ended=!1,this.destroyed=!1,this.writeChain=Promise.resolve(),this._backend=null}setBackend(e){this._backend=e}write(e,t){if(this.ended)return Uf(this,Error(Hf),t),!1;if(e.byteLength===0)return t&&queueMicrotask(t),!0;let n=this._backend;if(!n)throw Error(`Backend not initialized`);let r=this.writeChain.then(()=>n.write(e));return this.writeChain=r,r.then(()=>{this.destroyed||t?.()}).catch(e=>{this.destroyed||Uf(this,e,t)}),!0}end(e){if(this.ended){e?.();return}this.ended=!0;let t=this._backend;if(!t)throw Error(`Backend not initialized`);this.writeChain.then(()=>t.close()).then(()=>e?.()).catch(t=>Uf(this,t,e))}destroy(e){this.ended=!0,this.destroyed=!0,this._backend?.abort(e),e&&this.emit(`error`,e)}};function Gf(e,t){let n=t?new CompressionStream(e):new DecompressionStream(e),r=n.writable.getWriter(),i=n.readable.getReader(),a=new Wf,s=null,c=(async()=>{try{for(;;){let{value:e,done:t}=await i.read();if(t)break;e&&a.emit(`data`,e)}a.emit(`end`)}catch(e){let t=o(e);s=t,a.emit(`error`,t)}})();return a.setBackend({write:e=>r.write(e),close:async()=>{if(await r.close(),await c,s)throw o(s)},abort:e=>{i.cancel(e).catch(()=>{}),r.abort(e).catch(()=>{})}}),a}function Kf(e,t,n,r){let i=t??Mf(),a=null,o=null,s=new Promise((e,t)=>{a=e,o=t}),c=new Wf,l=i.openStream(e,{level:n,allowTransfer:r,onData:e=>c.emit(`data`,e),onEnd:()=>{c.emit(`end`),a?.()},onError:e=>{c.emit(`error`,e),o?.(e)}});return c.setBackend({write:e=>l.write(e),close:async()=>{await l.end(),await s},abort:e=>{a?.(),l.abort(e?.message)}}),c}var qf=class extends D{constructor(e){super(),this.process=e,this.chunks=[],this.ended=!1}write(e,t){return this.ended?(Uf(this,Error(Hf),t),!1):e.byteLength===0?(t&&queueMicrotask(t),!0):(this.chunks.push(e),t&&queueMicrotask(t),!0)}end(e){if(this.ended){e?.();return}this.ended=!0;let t=this.chunks.length,n=t===0?P:t===1?this.chunks[0]:E(this.chunks);this.chunks.length=0;try{let t=this.process(n);this.emit(`data`,t),this.emit(`end`),e?.()}catch(t){Uf(this,t,e)}}destroy(e){this.ended=!0,this.chunks.length=0,e&&this.emit(`error`,e)}};function Jf(e,t){let n=e===`deflate`?t.level??6:void 0;return t.useWorker&&bf()?Kf(e,t.workerPool,n,t.allowTransfer):(e===`deflate`?oi():ci())?Gf(`deflate-raw`,e===`deflate`):new qf(e===`deflate`?e=>Fi(e,n):ki)}function Yf(e={}){return Jf(`deflate`,e)}function Xf(){return oi()}function Zf(e){let t={key0:305419896,key1:591751049,key2:878082192},n=typeof e==`string`?Cn(e):e;for(let e=0;e<n.length;e++)Qf(t,n[e]);return t}function Qf(e,t){e.key0=ra(e.key0,t),e.key1=e.key1+(e.key0&255)>>>0,e.key1=(Math.imul(e.key1,134775813)>>>0)+1>>>0,e.key2=ra(e.key2,e.key1>>>24&255)}function $f(e){let t=(e.key2|2)>>>0;return Math.imul(t,t^1)>>>8&255}function ep(e,t){let n=(t^$f(e))&255;return Qf(e,n),n}function tp(e,t){let n=(t^$f(e))&255;return Qf(e,t),n}function np(e,t,n,r){if(t.length!==12)return!1;let i=new Uint8Array(12);for(let n=0;n<12;n++)i[n]=ep(e,t[n]);let a=i[11];return a===(n>>>24&255)||r!==void 0&&a===(r>>>8&255)}function rp(e,t,n){let r=new Uint8Array(12),i=n(11);for(let t=0;t<11;t++)r[t]=tp(e,i[t]);return r[11]=tp(e,t>>>24&255),r}function ip(e,t,n,r){if(e.length<12)return null;let i=Zf(t);if(!np(i,e.subarray(0,12),n,r))return null;let a=e.length-12,o=new Uint8Array(a);for(let t=0;t<a;t++)o[t]=ep(i,e[12+t]);return o}let ap={"aes-128":128,"aes-192":192,"aes-256":256};function op(e){return e in ap}function sp(e){return ap[e]}function cp(e){return e.replace(/\\/g,`/`)}function lp(e){return e.replace(/^\/+/,``)}function up(e){return e.replace(/^[a-zA-Z]:\/?/,``)}function dp(e){let t=e.split(`/`),n=[];for(let e of t)if(!(!e||e===`.`)){if(e===`..`){n.length>0?n.pop():n.push(`..`);continue}n.push(e)}return n.join(`/`)}function fp(e){return e.startsWith(`/`)}function pp(e){return/^[a-zA-Z]:/.test(e)}function mp(e,t={}){let n=t.mode??`legacy`,r=e;r=cp(r);let i=pp(r);if(n===`legacy`)return r=lp(r),t.prependSlash?`/`+r:r;let a=t.stripDrive??!0;if(n===`safe`&&i&&!a)throw Error(`Unsafe ZIP path (drive): ${e}`);a&&(r=up(r));let o=fp(r);if(r=lp(r),r=dp(r),n===`safe`){if(o)throw Error(`Unsafe ZIP path (absolute): ${e}`);if(r===`..`||r.startsWith(`../`))throw Error(`Unsafe ZIP path (traversal): ${e}`)}return t.prependSlash?`/`+r:r}function hp(e){return Math.log(e)/Math.LN2}function gp(e,t){let n=0;for(let r=0;r<256;r++){let i=e[r];if(i===0)continue;let a=i/t;n-=a*hp(a)}return n}function _p(e,t){let n=new Uint32Array(256),r=0,i=0;if(Array.isArray(e))for(let a=0;a<e.length&&!(r>=t);a++){let o=e[a],s=Math.min(o.length,t-r);for(let e=0;e<s;e++){let t=o[e];n[t]===0&&(i+=1),n[t]+=1}r+=s}else for(let a of e){if(r>=t)break;let e=Math.min(a.length,t-r);for(let t=0;t<e;t++){let e=a[t];n[e]===0&&(i+=1),n[e]+=1}r+=e}return{total:r,unique:i,counts:n}}function vp(e,t={}){let n=t.sampleBytes??65536,r=t.minDecisionBytes??16384,{total:i,unique:a,counts:o}=_p(e,n);return i<r||a<200?!1:gp(o,i)>=7.95}function yp(e,t=20){return(e&255)<<8|t&255}function bp(e){switch(e){case`directory`:return Oo;case`symlink`:return Do;default:return 32768}}function xp(e){return e>>>0&65535}function Sp(e,t){let n=e.endsWith(`/`)||e.endsWith(`\\`);return t!==void 0&&Ao(t)?`symlink`:n?`directory`:`file`}function Cp(e){let t=e.kind,n=t===`directory`?16:32,r=(e.msDosAttributes??n)&255,i=e.mode;i!==void 0&&(i&61440||(i=i&4095|bp(t)),i=xp(i));let a=((i??0)&65535)<<16|r,o=yp(i!==void 0||t===`symlink`?3:0);return{externalAttributes:a>>>0,versionMadeBy:o}}function wp(e){if(e.externalAttributes!==void 0)return{externalAttributes:e.externalAttributes,versionMadeBy:e.versionMadeBy};let t=Cp({kind:Sp(e.name,e.mode),mode:e.mode,msDosAttributes:e.msDosAttributes});return{externalAttributes:t.externalAttributes,versionMadeBy:e.versionMadeBy??t.versionMadeBy}}function Tp(e){return e?8:0}function Ep(e,t=!0){let n=0;return t&&(n|=To),e&&(n|=8),n}function Dp(e){let t=da(e.codec),n=t.encode(e.name),r=fa(e.comment,t),{dosTime:i,dosDate:a}=Ma(e.modTime),o=e.atime||e.ctime||e.birthTime?{atime:e.atime,ctime:e.ctime,birthTime:e.birthTime}:void 0,s=ja(e.modTime,e.timestamps,o);return!t.useUtf8Flag&&t.useUnicodeExtraFields&&(e.name&&(s=Vo(s,fo(n,e.name))),e.comment&&(s=Vo(s,po(r,e.comment)))),{nameBytes:n,commentBytes:r,dosTime:i,dosDate:a,extraField:s,compressionMethod:Tp(e.deflate),flags:Ep(e.useDataDescriptor,t.useUtf8Flag)}}function Op(e,t,n,r,i){if(!i)return 0;let a=0;return(e||t>4294967295)&&(a+=8),(e||n>4294967295)&&(a+=8),(e||r>4294967295)&&(a+=8),a>0?4+a:0}function kp(e){let t=e[0];return t?.fileName===void 0?t?.compressedData===void 0?`central`:`processed`:`input`}function Ap(e,t){let n=t.zip64Mode===!0,r=t.zip64Mode===!1,i=kp(e),a=0;for(let t=0;t<e.length;t++){let r=e[t],o=i===`input`?r.fileName:r.name,s=r.extraField,c=r.comment,l=i===`processed`?r.compressedData.length:r.compressedSize,u=r.uncompressedSize,d=i===`input`?r.localHeaderOffset:r.offset,f=i===`processed`?void 0:r.zip64,p=n||f===!0||d>4294967295||l>4294967295||u>4294967295;a+=46+o.length+s.length+Op(n,u,l,d,p)+(c?.length??0)}let o=e.length>65535||t.centralDirOffset>4294967295,s=n||o||a>4294967295;if(r&&s)throw Error(`ZIP64 is required but zip64=false`);let c=s?98+t.zipComment.length:22+t.zipComment.length;return{centralDirSize:a,trailerSize:c,totalSize:a+c,usedZip64:s}}function jp(e,t){let n=t.zip64Mode===!0,r=Ap(e,{zipComment:t.zipComment,zip64Mode:t.zip64Mode,centralDirOffset:t.centralDirOffset}),i=kp(e),a=t.offset,o=new DataView(t.out.buffer,t.out.byteOffset,t.out.byteLength);for(let r=0;r<e.length;r++){let s=e[r],c=i===`input`?s.fileName:s.name,l=s.extraField,u=s.comment,d=s.flags,f=i===`input`?s.crc32:s.crc,p=i===`processed`?s.compressedData.length:s.compressedSize,m=s.uncompressedSize,h=s.compressionMethod,g=i===`processed`?s.modTime:s.dosTime,_=i===`processed`?s.modDate:s.dosDate,v=i===`input`?s.localHeaderOffset:s.offset,y=i===`processed`?void 0:s.zip64,b=s.externalAttributes,x=s.versionMadeBy,S=n||y===!0||v>4294967295||p>4294967295||m>4294967295,C=S?Bo({uncompressedSize:n||m>4294967295?m:void 0,compressedSize:n||p>4294967295?p:void 0,localHeaderOffset:n||v>4294967295?v:void 0}):P,ee=S&&C.length>0?Vo(l,C):l;a+=Fo(t.out,o,a,{fileName:c,extraField:ee,comment:u??P,flags:d,compressionMethod:h,dosTime:g,dosDate:_,crc32:f,compressedSize:S?Mo:p,uncompressedSize:S?Mo:m,localHeaderOffset:S?Mo:v,versionMadeBy:x??20,versionNeeded:S?45:20,externalAttributes:b})}if(r.usedZip64){let n=t.centralDirOffset+r.centralDirSize;a+=Ho(t.out,o,a,{entryCountOnDisk:e.length,entryCountTotal:e.length,centralDirSize:r.centralDirSize,centralDirOffset:t.centralDirOffset}),a+=Uo(t.out,o,a,{zip64EndOfCentralDirectoryOffset:n,totalDisks:1}),Io(t.out,o,a,{entryCount:65535,centralDirSize:Mo,centralDirOffset:Mo,comment:t.zipComment})}else Io(t.out,o,a,{entryCount:e.length,centralDirSize:r.centralDirSize,centralDirOffset:t.centralDirOffset,comment:t.zipComment});return{centralDirSize:r.centralDirSize,trailerSize:r.trailerSize,totalWritten:r.totalSize,usedZip64:r.usedZip64}}let Mp=16*1024,Np=65536;var Pp=class{constructor(e,t){this._deflate=null,this._crc=4294967295,this._uncompressedSize=0,this._compressedSize=0,this._finalized=!1,this._headerEmitted=!1,this._ondata=null,this._onerror=null,this._centralDirEntryInfo=null,this._pendingEnd=!1,this._emittedDataDescriptor=!1,this._localHeader=null,this._zip64Mode=`auto`,this._zip64=!1,this._deflateWanted=null,this._pendingChunks=[],this._sampleLen=0,this._completeResolve=null,this._completeReject=null,this._completePromise=null,this._completeError=null,this._encryptionMethod=`none`,this._zipCryptoState=null,this._aesBuffer=[],this._aesBufferSize=0,this._originalCompressionMethod=0,this._aesExtraField=null,this._dataQueue=[],this._finalQueued=!1,this._pushChain=Promise.resolve(),this._inputBuf=null,this._inputPos=0,this._syncDeflater=null,this._syncZlibReady=!1;let n=t?.path?mp(e,t.path):e;this.name=n;let r=t?.modTime??new Date;if(this._modTime=r,this.level=t?.level??6,this._smartStore=t?.smartStore??!0,this._zip64Mode=t?.zip64??`auto`,this._zip64=this._zip64Mode===!0,this._encryptionMethod=t?.encryptionMethod??`none`,this._password=t?.password,this._encryptionMethod!==`none`&&!this._password)throw Error(`Password is required for encryption`);op(this._encryptionMethod)&&(this._aesKeyStrength=sp(this._encryptionMethod)),this._stringCodec=da(t?.encoding);let i=Dp({name:n,comment:t?.comment,modTime:r,atime:t?.atime,ctime:t?.ctime,birthTime:t?.birthTime,timestamps:t?.timestamps??`dos`,useDataDescriptor:!0,deflate:!1,codec:this._stringCodec});this.nameBytes=i.nameBytes,this.commentBytes=i.commentBytes,this.dosTime=i.dosTime,this.dosDate=i.dosDate,this.extraField=i.extraField,this._flags=i.flags,this._compressionMethod=i.compressionMethod;let a=wp({name:n,mode:t?.mode,msDosAttributes:t?.msDosAttributes,externalAttributes:t?.externalAttributes,versionMadeBy:t?.versionMadeBy});if(this._externalAttributes=a.externalAttributes,this._versionMadeBy=a.versionMadeBy,this._encryptionMethod!==`none`&&(this._flags|=1),!this._smartStore){let e=this.level>0;this._deflateWanted=e,this._compressionMethod=this._buildCompressionMethod(e),e&&this._initDeflateStream();return}this.level===0&&(this._deflateWanted=!1,this._compressionMethod=this._buildCompressionMethod(!1))}_buildCompressionMethod(e){return Tp(e)}_getAesExtraField(){return this._aesKeyStrength?(this._aesExtraField||=io(2,this._aesKeyStrength,this._originalCompressionMethod),this._aesExtraField):P}_initZipCryptoEncryption(){if(this._zipCryptoState||this._encryptionMethod!==`zipcrypto`)return;this._zipCryptoState=Zf(this._password);let e=this.dosTime<<16|this.dosDate,t=rp(this._zipCryptoState,e,Va);this._compressedSize+=t.length,this._enqueueData(t,!1)}_zipCryptoEncryptChunk(e){if(!this._zipCryptoState)return e;let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=tp(this._zipCryptoState,e[n]);return t}_initDeflateStream(){this._deflate||(this._deflate=Yf({level:this.level}),this._deflate.on(`error`,e=>{this._rejectComplete(e)}),this._deflate.on(`data`,e=>{if(this._aesKeyStrength){this._aesBuffer.push(e),this._aesBufferSize+=e.length;return}if(this._encryptionMethod===`zipcrypto`){this._initZipCryptoEncryption();let t=this._zipCryptoEncryptChunk(e);this._compressedSize+=t.length,this._enqueueData(t,!1);return}this._compressedSize+=e.length,this._enqueueData(e,!1)}),this._deflate.on(`end`,()=>{this._pendingEnd&&!this._emittedDataDescriptor&&(this._emittedDataDescriptor=!0,this._finalizeEncryptionAndEmitDescriptor())}))}_finalizeEncryptionAndEmitDescriptor(){if(this._aesKeyStrength&&this._aesBuffer.length>0){this._finalizeAesEncryption().then(()=>this._emitDataDescriptor()).catch(e=>this._rejectComplete(e));return}this._emitDataDescriptor()}async _finalizeAesEncryption(){if(!this._aesKeyStrength||this._aesBufferSize===0)return;let e;if(this._aesBuffer.length===1)e=this._aesBuffer[0];else{e=new Uint8Array(this._aesBufferSize);let t=0;for(let n=0;n<this._aesBuffer.length;n++){let r=this._aesBuffer[n];e.set(r,t),t+=r.length}}this._aesBuffer.length=0,this._aesBufferSize=0;let t=await lo(e,this._password,this._aesKeyStrength);this._compressedSize=t.length,this._enqueueData(t,!1)}_buildLocalHeader(){let e=this.extraField,t=this._compressionMethod;return this._aesKeyStrength&&(this._originalCompressionMethod=this._compressionMethod,t=99,e=Vo(this.extraField,this._getAesExtraField())),Po({fileName:this.nameBytes,extraField:e,flags:this._flags,compressionMethod:t,dosTime:this.dosTime,dosDate:this.dosDate,crc32:0,compressedSize:0,uncompressedSize:0,versionNeeded:this._zip64?45:20})}_accumulateSampleLen(e){if(this._deflateWanted!==null||e.length===0||this._sampleLen>=Mp)return;let t=Math.min(Mp-this._sampleLen,e.length);t<=0||(this._sampleLen+=t)}_shouldDecide(e){return this._deflateWanted===null?e||this._sampleLen>=Mp:!1}_decideCompressionIfNeeded(e,t,n=!1){if(this._deflateWanted!==null)return;if(e&&this._sampleLen===0){this._deflateWanted=!1,this._sampleLen=0,this._compressionMethod=this._buildCompressionMethod(!1),this._localHeader=null;return}let r=vp((function*(e,t){for(let t of e)t.length&&(yield t);t.length&&(yield t)})(this._pendingChunks,t),{sampleBytes:Mp,minDecisionBytes:Mp});this._deflateWanted=!r,this._sampleLen=0,this._compressionMethod=this._buildCompressionMethod(this._deflateWanted),this._localHeader=null,this._deflateWanted&&(n||this._initDeflateStream())}_emitHeaderIfNeeded(){this._headerEmitted||=(this._emitHeader(),!0)}async _flushPendingChunks(){if(this._pendingChunks.length!==0){for(let e of this._pendingChunks)await this._writeData(e);this._pendingChunks.length=0}}_enqueueData(e,t){this._ondata?this._ondata(e,t):(this._dataQueue.push(e),t&&(this._finalQueued=!0))}_flushQueue(){if(!this._ondata)return;let e=this._dataQueue.length,t=this._finalQueued?e-1:-1;for(let n=0;n<e;n++)this._ondata(this._dataQueue[n],n===t);this._dataQueue.length=0,this._finalQueued=!1}get ondata(){return this._ondata}set ondata(e){this._ondata=e,this._flushQueue()}get onerror(){return this._onerror}set onerror(e){this._onerror=e,this._completeError&&e(this._completeError)}_resolveComplete(){this._completeResolve&&this._completeResolve()}_rejectComplete(e){this._completeError||(this._completeError=e,this._onerror&&this._onerror(e),this._completeReject&&this._completeReject(e))}_ensureCompletePromise(){return this._completeError?Promise.reject(this._completeError):this._emittedDataDescriptor?Promise.resolve():(this._completePromise||=new Promise((e,t)=>{this._completeResolve=e,this._completeReject=t}),this._completePromise)}_tapCallback(e,t){t&&e.then(()=>t()).catch(e=>t(e))}_writeDataSync(e,t){if(!(e.length===0&&!t)){if(e.length>0&&(this._crc=ea(this._crc,e),this._uncompressedSize+=e.length),this._deflateWanted){if(this._syncDeflater||=new Gi(this.level),e.length>0){let t=this._syncDeflater.write(e);t.length>0&&(this._compressedSize+=t.length,this._enqueueData(t,!1))}if(t){let e=this._syncDeflater.finish();e.length>0&&(this._compressedSize+=e.length,this._enqueueData(e,!1)),this._syncDeflater=null}return}if(this._aesKeyStrength){this._aesBuffer.push(e),this._aesBufferSize+=e.length;return}if(this._encryptionMethod===`zipcrypto`){this._initZipCryptoEncryption();let t=this._zipCryptoEncryptChunk(e);this._compressedSize+=t.length,this._enqueueData(t,!1);return}e.length>0&&(this._compressedSize+=e.length,this._enqueueData(e,!1))}}_writeData(e){if(e.length===0)return Promise.resolve();if(this._crc=ea(this._crc,e),this._uncompressedSize+=e.length,this._deflate)return new Promise((t,n)=>{this._deflate.write(e,e=>{e?n(e):t()})});if(this._aesKeyStrength)return this._aesBuffer.push(e),this._aesBufferSize+=e.length,Promise.resolve();if(this._encryptionMethod===`zipcrypto`){this._initZipCryptoEncryption();let t=this._zipCryptoEncryptChunk(e);return this._compressedSize+=t.length,this._enqueueData(t,!1),Promise.resolve()}return this._compressedSize+=e.length,this._enqueueData(e,!1),Promise.resolve()}_endDeflateAndWait(){return new Promise((e,t)=>{let n=this._deflate,r=e=>{a(),t(e)},i=()=>{a(),e()},a=()=>{n.off(`error`,r),n.off(`end`,i)};n.once(`error`,r),n.once(`end`,i),n.end()})}_finalizeAfterWrite(e){this._finalized=!0,this._pendingEnd=!0;let t=this._ensureCompletePromise();return this._deflate?e.then(()=>this._endDeflateAndWait()).then(()=>t):this._aesKeyStrength&&this._aesBufferSize>0?(this._emittedDataDescriptor=!0,this._finalizeAesEncryption().then(()=>this._emitDataDescriptor()).catch(e=>this._rejectComplete(e)),t):(this._emittedDataDescriptor=!0,this._emitDataDescriptor(),t)}_pushUnchained(e,t,n){if(this._finalized){let e=Promise.reject(Error(`Cannot push to finalized ZipDeflateFile`));return this._tapCallback(e,n),e}if(this._completeError){let e=Promise.reject(this._completeError);return this._tapCallback(e,n),e}if(this._deflateWanted===null){if(this._accumulateSampleLen(e),!this._shouldDecide(t)){e.length>0&&this._pendingChunks.push(e);let t=Promise.resolve();return this._tapCallback(t,n),t}this._decideCompressionIfNeeded(t,e),this._emitHeaderIfNeeded();let r=this._pendingChunks.length>0,i=this._flushPendingChunks(),a=i;e.length>0&&(a=r?i.then(()=>this._writeData(e)):this._writeData(e));let o=t?this._finalizeAfterWrite(a):a;return this._tapCallback(o,n),o}this._emitHeaderIfNeeded();let r=this._writeData(e),i=t?this._finalizeAfterWrite(r):r;return this._tapCallback(i,n),i}push(e,t=!1,n){if(!this._deflate&&this._encryptionMethod===`none`&&!Xf()){try{this._pushSyncPath(e,t),n?.()}catch(e){return n?.(e instanceof Error?e:Error(String(e))),Promise.reject(e)}return Promise.resolve()}if(!t&&e.length>0&&e.length<Np){if(this._inputBuf||(this._inputBuf=new Uint8Array(Np),this._inputPos=0),this._inputPos+e.length<=Np)return this._inputBuf.set(e,this._inputPos),this._inputPos+=e.length,n?.(),Promise.resolve();let t=new Uint8Array(this._inputPos+e.length);return t.set(this._inputBuf.subarray(0,this._inputPos)),t.set(e,this._inputPos),this._inputPos=0,this._pushAsync(t,!1,n)}if(this._inputPos>0){let r=this._inputBuf.slice(0,this._inputPos);this._inputPos=0;let i=this._pushAsync(r,!1),a=this._pushChain=i.then(()=>this._pushUnchained(e,t,n),()=>this._pushUnchained(e,t,n));return a.catch(()=>{}),a}return this._pushAsync(e,t,n)}_pushAsync(e,t,n){let r=this._pushChain=this._pushChain.then(()=>this._pushUnchained(e,t,n),()=>this._pushUnchained(e,t,n));return r.catch(()=>{}),r}_pushSyncPath(e,t=!1){if(this._finalized)throw Error(`Cannot push to finalized ZipDeflateFile`);if(this._syncZlibReady||=!0,this._deflateWanted===null){if(this._accumulateSampleLen(e),!this._shouldDecide(t)){e.length>0&&this._pendingChunks.push(e);return}this._decideCompressionIfNeeded(t,e,!0),this._emitHeaderIfNeeded();for(let e of this._pendingChunks)this._writeDataSync(e,!1);this._pendingChunks.length=0,e.length>0&&this._writeDataSync(e,t),t&&this._finalizeSyncAfterWrite();return}this._emitHeaderIfNeeded(),this._writeDataSync(e,t),t&&this._finalizeSyncAfterWrite()}_finalizeSyncAfterWrite(){if(this._finalized=!0,this._pendingEnd=!1,this._emittedDataDescriptor=!0,this._aesKeyStrength&&this._aesBufferSize>0)throw Error(`AES encryption is not supported with synchronous push`);if(this._syncDeflater){let e=this._syncDeflater.finish();e.length>0&&(this._compressedSize+=e.length,this._enqueueData(e,!1)),this._syncDeflater=null}if(this._emitDataDescriptor(),this._completeError)throw this._completeError}_emitHeader(){this._localHeader||=this._buildLocalHeader(),this._enqueueData(this._localHeader,!1)}_emitDataDescriptor(){let e=ta(this._crc),t=this._compressedSize>4294967295||this._uncompressedSize>4294967295;if(this._zip64Mode===!1&&t){this._rejectComplete(Error(`ZIP64 is required but zip64=false`));return}(this._zip64Mode===!0||t&&!this._zip64)&&(this._zip64=!0);let n=this._zip64?zo(e,this._compressedSize,this._uncompressedSize):Lo(e,this._compressedSize,this._uncompressedSize),r=this._compressionMethod,i=this.extraField;this._aesKeyStrength&&(r=99,i=Vo(this.extraField,this._getAesExtraField())),this._centralDirEntryInfo={name:this.nameBytes,extraField:i,comment:this.commentBytes,flags:this._flags,crc:e,compressedSize:this._compressedSize,uncompressedSize:this._uncompressedSize,compressionMethod:r,dosTime:this.dosTime,dosDate:this.dosDate,offset:-1,zip64:this._zip64,externalAttributes:this._externalAttributes,versionMadeBy:this._versionMadeBy},this._enqueueData(n,!0),this._resolveComplete()}complete(){return this._ensureCompletePromise()}getEntryInfo(){if(!this._centralDirEntryInfo)return null;let e=this.name,t=e.endsWith(`/`)||e.endsWith(`\\`),n=this._centralDirEntryInfo.externalAttributes,r=ko(n);return{path:e,type:Ao(r)?`symlink`:t?`directory`:`file`,compressedSize:this._centralDirEntryInfo.compressedSize,uncompressedSize:this._centralDirEntryInfo.uncompressedSize,compressionMethod:this._centralDirEntryInfo.compressionMethod,crc32:this._centralDirEntryInfo.crc,lastModified:this._modTime,localHeaderOffset:this._centralDirEntryInfo.offset,comment:this._stringCodec.decode(this._centralDirEntryInfo.comment),externalAttributes:n,mode:r,versionMadeBy:this._centralDirEntryInfo.versionMadeBy,extraField:this._centralDirEntryInfo.extraField,isEncrypted:this._encryptionMethod!==`none`,encryptionMethod:this._aesKeyStrength?`aes`:this._encryptionMethod===`zipcrypto`?`zipcrypto`:void 0,aesKeyStrength:this._aesKeyStrength,originalCompressionMethod:this._aesKeyStrength?this._originalCompressionMethod:void 0}}getCentralDirectoryEntryInfo(){return this._centralDirEntryInfo}isComplete(){return this._emittedDataDescriptor&&this._centralDirEntryInfo!==null}abort(e){if(this._completeError)return;let t=i(e);this._finalized=!0,this._pendingEnd=!0,this._rejectComplete(t);try{let e=this._deflate;e&&typeof e.destroy==`function`&&e.destroy(t)}catch{}}},Fp=class{constructor(e,t){this.entries=[],this.currentOffset=0,this.ended=!1,this.endPending=!1,this.addedEntryCount=0,this.fileQueue=[],this.fileQueueIndex=0,this.activeFile=null,this.callback=e,this._stringCodec=t?.codec??da(t?.encoding),this.zipComment=fa(t?.comment,this._stringCodec),this.zip64Mode=t?.zip64??`auto`}add(e){if(this.ended)throw Error(`Cannot add files after calling end() `);if(this.zip64Mode===!1&&this.addedEntryCount>=65535)throw Error(`ZIP64 is required but zip64=false`);this.addedEntryCount++,this.fileQueue.push(e),this.activeFile||this._processNextFile()}_processNextFile(){if(this.fileQueueIndex>=this.fileQueue.length){this.activeFile=null,this.fileQueue=[],this.fileQueueIndex=0,this.endPending&&this._finalize();return}let e=this.fileQueue[this.fileQueueIndex++];this.activeFile=e;let t=this.currentOffset;if(e.onerror=e=>{this.ended||(this.ended=!0,this.callback(e,P,!0))},e.ondata=(n,r)=>{if(!this.ended&&(this.currentOffset+=n.length,this.callback(null,n,!1),r)){let n=e.getCentralDirectoryEntryInfo();n&&(n.offset=t,this.entries.push(n)),this._processNextFile()}},typeof e.start==`function`)try{e.start().catch(t=>{let n=o(t);try{e.onerror?.(n)}catch{}})}catch(t){let n=o(t);try{e.onerror?.(n)}catch{}}}_finalize(){if(this.ended)return;this.ended=!0;let e=this.currentOffset,t;try{let n=Ap(this.entries,{zipComment:this.zipComment,zip64Mode:this.zip64Mode,centralDirOffset:e});t=new Uint8Array(n.totalSize),jp(this.entries,{zipComment:this.zipComment,zip64Mode:this.zip64Mode,centralDirOffset:e,out:t,offset:0})}catch(e){let t=o(e);this.callback(t,P,!0);return}this.callback(null,t,!0)}end(){this.endPending||this.ended||(this.endPending=!0,this.activeFile||this._finalize())}abort(e){if(this.ended)return;let t=i(e);this.ended=!0,this.endPending=!0;try{this.activeFile?.abort(t)}catch{}this.callback(t,P,!0)}};function Ip(e){return typeof e==`object`&&`nativeCol`in e&&`nativeRow`in e&&`nativeColOff`in e&&`nativeRowOff`in e}function Lp(e){return typeof e==`object`&&`col`in e&&`row`in e}var Rp=class e{constructor(e,t,n=0){if(this.worksheet=e,!t)this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0;else if(typeof t==`string`){let e=M.decodeAddress(t);this.nativeCol=e.col+n,this.nativeColOff=0,this.nativeRow=e.row+n,this.nativeRowOff=0}else Ip(t)?(this.nativeCol=t.nativeCol??0,this.nativeColOff=t.nativeColOff??0,this.nativeRow=t.nativeRow??0,this.nativeRowOff=t.nativeRowOff??0):Lp(t)?(this.col=t.col+n,this.row=t.row+n):(this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0)}static asInstance(t){return t==null?null:t instanceof e?t:new e(void 0,t)}get col(){return this.nativeColOff===0?this.nativeCol:this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth}set col(e){this.nativeCol=Math.floor(e);let t=e-this.nativeCol;this.nativeColOff=t===0?0:Math.floor(t*this.colWidth)}get row(){return this.nativeRowOff===0?this.nativeRow:this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight}set row(e){this.nativeRow=Math.floor(e);let t=e-this.nativeRow;this.nativeRowOff=t===0?0:Math.floor(t*this.rowHeight)}get colWidth(){return this.worksheet&&this.worksheet.getColumn(this.nativeCol+1)&&this.worksheet.getColumn(this.nativeCol+1).isCustomWidth?Math.floor(this.worksheet.getColumn(this.nativeCol+1).width*1e4):64e4}get rowHeight(){let e=this.worksheet?.getRow(this.nativeRow+1)?.height;return e?Math.floor(e*1e4):18e4}get model(){return{nativeCol:this.nativeCol,nativeColOff:this.nativeColOff,nativeRow:this.nativeRow,nativeRowOff:this.nativeRowOff}}set model(e){this.nativeCol=e.nativeCol,this.nativeColOff=e.nativeColOff,this.nativeRow=e.nativeRow,this.nativeRowOff=e.nativeRowOff}clone(t){return new e(t??this.worksheet,this.model)}},zp=class{constructor(e){this.model=e||{}}add(e,t){return this.model[e]=t}find(e){let t=this.model[e];if(t!==void 0)return t;let n;for(let t of Object.keys(this.model)){if(!t.startsWith(`range:`))continue;n||=M.decodeAddress(e);let r=t.slice(6),i=M.decodeEx(r);if(!(`dimensions`in i))continue;let{tl:a,br:o}=i,s=typeof a==`string`?M.decodeAddress(a):a,c=typeof o==`string`?M.decodeAddress(o):o;if(n.row>=s.row&&n.row<=c.row&&n.col>=s.col&&n.col<=c.col)return this.model[t]}}remove(e){this.model[e]=void 0}},Bp=class extends U{get tag(){return`t`}render(e,t){e.openNode(`t`),/^\s|\n|\s$/.test(t)&&e.addAttribute(`xml:space`,`preserve`),e.writeText(Fc(t)),e.closeNode()}parseOpen(e){return e.name===`t`?(this.model=``,!0):!1}parseText(e){this.model=this.model?this.model+e:e}parseClose(){let e=this.model;return e.includes(`_x`)&&(this.model=Pc(e)),!1}},Vp=class e extends U{constructor(e){super(),this.model=e}get tag(){return`r`}get textXform(){return this._textXform||=new Bp}get fontXform(){return this._fontXform||=new nf(e.FONT_OPTIONS)}render(e,t){let n=t||this.model;e.openNode(`r`),n.font&&this.fontXform.render(e,n.font),this.textXform.render(e,n.text),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`r`:return this.model={},!0;case`t`:return this.parser=this.textXform,this.parser.parseOpen(e),!0;case`rPr`:return this.parser=this.fontXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case`r`:return!1;case`t`:return this.model.text=this.parser.model,this.parser=void 0,!0;case`rPr`:return this.model.font=this.parser.model,this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}static{this.FONT_OPTIONS={tagName:`rPr`,fontNameTag:`rFont`}}},Hp=class extends U{constructor(e){super(),this.model=e||{type:`note`,note:{texts:[]},ref:``}}get tag(){return`r`}get richTextXform(){return this._richTextXform||=new Vp,this._richTextXform}render(e,t){let n=t||this.model;e.openNode(`comment`,{ref:n.ref,authorId:n.authorId??0}),e.openNode(`text`),n&&n.note&&n.note.texts&&n.note.texts.forEach(t=>{this.richTextXform.render(e,t)}),e.closeNode(),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`comment`:return this.model={type:`note`,note:{texts:[]},ref:e.attributes.ref,authorId:e.attributes.authorId==null?void 0:Number(e.attributes.authorId)},!0;case`r`:return this.parser=this.richTextXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case`comment`:return!1;case`r`:return this.model.note.texts.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}},Up=class extends U{constructor(e){super(),this._model=e||{},this.model={}}get tag(){return this._model?.tag??``}render(e,t,n){(n&&t===n[2]||n&&this.tag===`x:SizeWithCells`&&t===n[1])&&e.leafNode(this.tag)}parseOpen(e){switch(e.name){case this.tag:return this.model={},this.model[this.tag]=!0,!0;default:return!1}}parseText(){}parseClose(){return!1}},Wp=class extends U{constructor(e){super(),this._model=e||{},this.text=``}get tag(){return this._model?.tag??``}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(e){switch(e.name){case this.tag:return this.text=``,!0;default:return!1}}parseText(e){this.text=e}parseClose(){return!1}},Gp=class extends U{constructor(){super(),this.text=``}get tag(){return`x:Anchor`}getAnchorRect(e){let t=Math.floor(e.left),n=Math.floor((e.left-t)*68),r=Math.floor(e.top),i=Math.floor((e.top-r)*18),a=Math.floor(e.right),o=Math.floor((e.right-a)*68),s=Math.floor(e.bottom);return[t,n,r,i,a,o,s,Math.floor((e.bottom-s)*18)]}getDefaultRect(e){let t=e.col,n=Math.max(e.row-2,0);return[t,6,n,14,t+2,2,n+4,16]}render(e,t){let n=t.anchor?this.getAnchorRect(t.anchor):this.getDefaultRect(t.refAddress);e.leafNode(`x:Anchor`,null,n.join(`, `))}parseOpen(e){switch(e.name){case this.tag:return this.text=``,!0;default:return!1}}parseText(e){this.text=e}parseClose(){return!1}};let Kp=[`twoCells`,`oneCells`,`absolute`];var qp=class extends U{constructor(){super(),this._leafText=``,this.map={"x:Anchor":new Gp,"x:Locked":new Wp({tag:`x:Locked`}),"x:LockText":new Wp({tag:`x:LockText`}),"x:SizeWithCells":new Up({tag:`x:SizeWithCells`}),"x:MoveWithCells":new Up({tag:`x:MoveWithCells`})},this.model={anchor:[],protection:{},editAs:``}}get tag(){return`x:ClientData`}render(e,t){let{protection:n,editAs:r}=t.note;e.openNode(this.tag,{ObjectType:`Note`}),this.map[`x:MoveWithCells`].render(e,r,Kp),this.map[`x:SizeWithCells`].render(e,r,Kp),this.map[`x:Anchor`].render(e,t),this.map[`x:Locked`].render(e,n.locked),e.leafNode(`x:AutoFill`,null,`False`),this.map[`x:LockText`].render(e,n.lockText),e.leafNode(`x:Row`,null,t.refAddress.row-1),e.leafNode(`x:Column`,null,t.refAddress.col-1),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:this.reset(),this.model={anchor:[],protection:{},editAs:``};break;case`x:Row`:case`x:Column`:this._leafName=e.name,this._leafText=``;break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this._leafName?this._leafText+=e:this.parser&&this.parser.parseText(e)}parseClose(e){if(this._leafName){if(e===this._leafName){let t=parseInt(this._leafText,10);e===`x:Row`?this.model.row=t+1:e===`x:Column`&&(this.model.col=t+1),this._leafName=void 0,this._leafText=``}return!0}if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.normalizeModel(),!1;default:return!0}}normalizeModel(){let e=Object.assign({},this.map[`x:MoveWithCells`].model,this.map[`x:SizeWithCells`].model),t=Object.keys(e).length;this.model.editAs=Kp[t],this.model.anchor=this.map[`x:Anchor`].text,this.model.protection.locked=this.map[`x:Locked`].text,this.model.protection.lockText=this.map[`x:LockText`].text}},Jp=class extends U{constructor(){super(),this.model={}}get tag(){return`v:textbox`}conversionUnit(e,t,n){return`${(parseFloat(e.toString())*t).toFixed(2)}${n}`}reverseConversionUnit(e){return(e??``).split(`,`).map(e=>Number(parseFloat(this.conversionUnit(parseFloat(e),.1,``)).toFixed(2)))}render(e,t){let n={style:`mso-direction-alt:auto`};if(t&&t.note){let{inset:e}=t.note&&t.note.margins||{};Array.isArray(e)&&(e=e.map(e=>this.conversionUnit(e,10,`mm`)).join(`,`)),e&&(n.inset=e)}e.openNode(`v:textbox`,n),e.leafNode(`div`,{style:`text-align:left`}),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:return this.model={inset:this.reverseConversionUnit(e.attributes.inset)},!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}},Yp=class e extends U{constructor(){super(),this.map={"v:textbox":new Jp,"x:ClientData":new qp}}get tag(){return`v:shape`}render(t,n,r){t.openNode(`v:shape`,e.V_SHAPE_ATTRIBUTES(n,r??0)),t.leafNode(`v:fill`,{color2:`infoBackground [80]`}),t.leafNode(`v:shadow`,{color:`none [81]`,obscured:`t`}),t.leafNode(`v:path`,{"o:connecttype":`none`}),this.map[`v:textbox`].render(t,n),this.map[`x:ClientData`].render(t,n),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={margins:{insetmode:e.attributes[`o:insetmode`]},anchor:``,editAs:``,protection:{}};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.margins.inset=this.map[`v:textbox`].model&&this.map[`v:textbox`].model.inset,this.model.protection=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.protection,this.model.anchor=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.anchor,this.model.editAs=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.editAs,this.map[`x:ClientData`].model&&(this.model.row=this.map[`x:ClientData`].model.row,this.model.col=this.map[`x:ClientData`].model.col),!1;default:return!0}}static{this.V_SHAPE_ATTRIBUTES=(e,t)=>({id:`_x0000_s${1025+t}`,type:`#_x0000_t202`,style:`position:absolute; margin-left:105.3pt;margin-top:10.5pt;width:97.8pt;height:59.1pt;z-index:1;visibility:hidden`,fillcolor:`infoBackground [80]`,strokecolor:`none [81]`,"o:insetmode":e.note.margins&&e.note.margins.insetmode})}},Xp=class{constructor(e,t,n){this.id=n.id,this.count=0,this._worksheet=e,this._workbook=n.workbook,this._sheetRelsWriter=t}get commentsStream(){return this._commentsStream||=this._workbook._openStream(Wu(this.id)),this._commentsStream}get vmlStream(){return this._vmlStream||=this._workbook._openStream(Ku(this.id)),this._vmlStream}_addRelationships(){let e={Type:F.Comments,Target:dd(this.id)};this._sheetRelsWriter.addRelationship(e);let t={Type:F.VmlDrawing,Target:fd(this.id)};this.vmlRelId=this._sheetRelsWriter.addRelationship(t)}_addCommentRefs(){this._workbook.commentRefs.push({commentName:`comments${this.id}`,vmlDrawing:`vmlDrawing${this.id}`})}_writeOpen(){this.commentsStream.write(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><comments xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><authors><author>Author</author></authors><commentList>`),this.vmlStream.write(`<?xml version="1.0" encoding="UTF-8"?><xml xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1" /></o:shapelayout><v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter" /><v:path gradientshapeok="t" o:connecttype="rect" /></v:shapetype>`)}_writeComment(e,t){let n=new Hp,r=new Sd;n.render(r,e),this.commentsStream.write(r.xml);let i=new Yp,a=new Sd;i.render(a,e,t),this.vmlStream.write(a.xml)}_writeClose(){this.commentsStream.write(`</commentList></comments>`),this.vmlStream.write(`</xml>`)}addComments(e){e&&e.length&&(this.startedData||=(this._worksheet.comments=[],this._writeOpen(),this._addRelationships(),this._addCommentRefs(),!0),e.forEach(e=>{e.refAddress=M.decodeAddress(e.ref)}),e.forEach(e=>{this._writeComment(e,this.count),this.count+=1}))}commit(){this.count&&(this._writeClose(),this.commentsStream.end(),this.vmlStream.end())}},Zp=class extends U{get tag(){return`hyperlink`}render(e,t){t.target&&Qp(t.target)?e.leafNode(`hyperlink`,{ref:t.address,tooltip:t.tooltip,location:t.target.slice(1)}):e.leafNode(`hyperlink`,{ref:t.address,"r:id":t.rId,tooltip:t.tooltip})}parseOpen(e){if(e.name===`hyperlink`){if(this.model={address:e.attributes.ref,rId:e.attributes[`r:id`],tooltip:e.attributes.tooltip},e.attributes.location){let t=e.attributes.location;this.model.target=t.startsWith(`#`)?t:`#${t}`}return!0}return!1}parseText(){}parseClose(){return!1}};function Qp(e){return e.startsWith(`#`)}var $p=class{constructor(e){this.writer=e}push(e){this.writer.addHyperlink(e)}},em=class{constructor(e){this.id=e.id,this.count=0,this._hyperlinks=[],this._workbook=e.workbook}get stream(){return this._stream||=this._workbook._openStream(Hu(this.id)),this._stream}get length(){return this._hyperlinks.length}each(e){return this._hyperlinks.forEach(e)}get hyperlinksProxy(){return this._hyperlinksProxy||=new $p(this)}addHyperlink(e){if(Qp(e.target)){this._hyperlinks.push({address:e.address,target:e.target});return}let t={Target:e.target,Type:F.Hyperlink,TargetMode:`External`},n=this._writeRelationship(t);this._hyperlinks.push({rId:n,address:e.address})}addMedia(e){return this._writeRelationship(e)}addRelationship(e){return this._writeRelationship(e)}commit(){this.count&&(this._writeClose(),this.stream.end())}_writeOpen(){this.stream.write(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
404
|
-
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`)}_writeRelationship(e){this.count||this._writeOpen();let t=`rId${++this.count}`;return e.TargetMode?this.stream.write(`<Relationship Id="${t}" Type="${R(e.Type)}" Target="${R(e.Target)}" TargetMode="${R(e.TargetMode)}"/>`):this.stream.write(`<Relationship Id="${t}" Type="${R(e.Type)}" Target="${R(e.Target)}"/>`),t}_writeClose(){this.stream.write(`</Relationships>`)}};function tm(e){return _d(e.name&&e.extension&&e.name.endsWith(`.${e.extension}`)?e.name:`${e.name}.${e.extension}`)}function nm(e,t,n){let r=[],i=[...t],a={};for(let t of e){let e=String(t.imageId),o=n.getBookImage(t.imageId);if(!o)continue;let s=a[e];s||(s=n.nextRId(i),a[e]=s,i.push({Id:s,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,Target:tm(o)}));let c={picture:{rId:s},range:t.range};if(t.opacity!==void 0){let e=Math.max(0,Math.min(1,t.opacity));c.picture.alphaModFix=Math.round(e*1e5)}if(t.hyperlinks&&t.hyperlinks.hyperlink){let e=n.nextRId(i);c.picture.hyperlinks={tooltip:t.hyperlinks.tooltip,rId:e},i.push({Id:e,Type:F.Hyperlink,Target:t.hyperlinks.hyperlink,TargetMode:`External`})}r.push(c)}return{anchors:r,rels:i}}function rm(e){return e.filter(e=>e==null?!1:e.range?.pos===void 0?e.range?.br&&e.shape?!0:!(!e.range?.br&&!e.picture||e.range?.br&&!e.picture&&!e.shape):!!e.picture)}function im(e,t,n,r,i){let a=i(e,t)?.style?.border,o=r-t+1,s=n-e+1,c=Array(o),l=Array(o),u=Array(s),d=Array(s),f=!1;for(let o=t;o<=r;o++){let r=o-t,s=i(e,o)?.style?.border;c[r]=s?.top||a?.top,n===e?l[r]=s?.bottom||a?.bottom:l[r]=i(n,o)?.style?.border?.bottom||a?.bottom,(c[r]||l[r])&&(f=!0)}for(let o=e;o<=n;o++){let n=o-e,s=i(o,t)?.style?.border;u[n]=s?.left||a?.left,r===t?d[n]=s?.right||a?.right:d[n]=i(o,r)?.style?.border?.right||a?.right,(u[n]||d[n])&&(f=!0)}let p=a?.diagonal,m=a?.color;if(!(!f&&!p))return{topEdges:c,bottomEdges:l,leftEdges:u,rightEdges:d,diagonal:p,color:m}}function am(e,t,n,r,i,a){let{topEdges:o,bottomEdges:s,leftEdges:c,rightEdges:l,diagonal:u,color:d}=i,f=a(e,t).style;for(let i=e;i<=n;i++)for(let p=t;p<=r;p++){let m=a(i,p),h=L(f)||{},g={},_=!1;i===e&&o[p-t]&&(g.top=o[p-t],_=!0),i===n&&s[p-t]&&(g.bottom=s[p-t],_=!0),p===t&&c[i-e]&&(g.left=c[i-e],_=!0),p===r&&l[i-e]&&(g.right=l[i-e],_=!0),u&&(g.diagonal=u,_=!0),_?(d&&(g.color=d),h.border=g):delete h.border,m.style=h}}Ja();function om(e){let t=new Uint8Array(4);return t[0]=e&255,t[1]=e>>8&255,t[2]=e>>16&255,t[3]=e>>24&255,t}let sm={async hash(e,...t){return Ha(e,E(t))},async convertPasswordToHash(e,t,n,r){let i=tl(e),a=kc(n),o=await this.hash(t,a,i);for(let e=0;e<r;e++)o=await this.hash(t,o,om(e));return el(o)},randomBytes(e){return Va(e)}};async function cm(e,t){let n={sheet:!0};return t&&`spinCount`in t&&(t.spinCount=Number.isFinite(t.spinCount)?Math.round(Math.max(0,t.spinCount)):1e5),e&&(n.algorithmName=`SHA-512`,n.saltValue=el(sm.randomBytes(16)),n.spinCount=t&&`spinCount`in t?t.spinCount:1e5,n.hashValue=await sm.convertPasswordToHash(e,`SHA-512`,n.saltValue,n.spinCount)),t&&(Object.assign(n,t),!e&&`spinCount`in t&&delete n.spinCount),n}let lm=new TextEncoder;var um=class{constructor(e){this._buf=new Uint8Array(e&&e.size||16384),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._buf.slice(0,this._inPos),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=new Uint8Array(t);n.set(this._buf),this._buf=n}addText(e){this._buffer=void 0;let t=this._inPos+e.length;t>this._buf.length-4&&this._grow(t);let n=this._buf.subarray(this._inPos),r=lm.encodeInto(e,n);if(r.read<e.length){let t=e.length-r.read;this._grow(this._inPos+r.written+t*3);let n=lm.encodeInto(e.substring(r.read),this._buf.subarray(this._inPos+r.written));this._inPos+=r.written+n.written}else this._inPos+=r.written}addStringBuf(e){e.length&&(this._buffer=void 0,this.length+e.length>this.capacity&&this._grow(this.length+e.length),this._buf.set(e._buf.subarray(0,e.length),this._inPos),this._inPos+=e.length)}},dm=class extends U{get tag(){return`autoFilter`}render(e,t){if(t)if(typeof t==`string`)e.leafNode(`autoFilter`,{ref:t});else{let n=function(e){return typeof e==`string`?e:M.getAddress(e.row,e.col).address},r=n(t.from),i=n(t.to);r&&i&&e.leafNode(`autoFilter`,{ref:`${r}:${i}`})}}parseOpen(e){e.name===`autoFilter`&&(this.model=e.attributes.ref)}},fm=class extends U{createNewModel(e){return{}}parseOpen(e){return this.parser=this.parser||this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.model=this.createNewModel(e),!0):!1}parseText(e){this.parser&&this.parser.parseText(e)}onParserClose(e,t){this.model[e]=t.model}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.onParserClose(e,this.parser),this.parser=void 0),!0):e!==this.tag}get tag(){return``}},pm=class extends U{get tag(){return`cfvo`}render(e,t){e.leafNode(this.tag,{type:t.type,val:t.value})}parseOpen(e){this.model={type:e.attributes.type,value:U.toFloatValue(e.attributes.val)}}parseClose(e){return e!==this.tag}},mm=class extends fm{constructor(){super(),this.map={cfvo:this.cfvoXform=new pm,color:this.colorXform=new Hd}}get tag(){return`colorScale`}render(e,t){e.openNode(this.tag),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),t.color.forEach(t=>{this.colorXform.render(e,t)}),e.closeNode()}createNewModel(e){return{cfvo:[],color:[]}}onParserClose(e,t){this.model[e].push(t.model)}},hm=class extends fm{constructor(){super(),this.map={cfvo:this.cfvoXform=new pm,color:this.colorXform=new Hd}}get tag(){return`dataBar`}render(e,t){e.openNode(this.tag),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),this.colorXform.render(e,t.color),e.closeNode()}createNewModel(){return{cfvo:[]}}onParserClose(e,t){switch(e){case`cfvo`:this.model.cfvo.push(t.model);break;case`color`:this.model.color=t.model;break}}},gm=class extends U{get tag(){return`x14:id`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}},_m=class extends fm{constructor(){super(),this.map={"x14:id":this.idXform=new gm}}get tag(){return`ext`}render(e,t){e.openNode(this.tag,{uri:`{B025F937-C7B1-47D3-B67F-A62EFF666E3E}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`}),this.idXform.render(e,t.x14Id),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){this.model.x14Id=t.model}},vm=class extends fm{constructor(){super(),this.map={ext:new _m}}get tag(){return`extLst`}render(e,t){t.x14Id&&(e.openNode(this.tag),this.map.ext.render(e,t),e.closeNode())}createNewModel(){return{}}onParserClose(e,t){Object.assign(this.model,t.model)}},ym=class extends U{get tag(){return`formula`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}},bm=class extends fm{constructor(){super(),this.map={cfvo:this.cfvoXform=new pm}}get tag(){return`iconSet`}render(e,t){e.openNode(this.tag,{iconSet:U.toStringAttribute(t.iconSet,`3TrafficLights`),reverse:U.toBoolAttribute(t.reverse,!1),showValue:U.toBoolAttribute(t.showValue,!0)}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),e.closeNode()}createNewModel({attributes:e}){return{iconSet:U.toStringValue(e.iconSet,`3TrafficLights`),reverse:U.toBoolValue(e.reverse),showValue:U.toBoolValue(e.showValue),cfvo:[]}}onParserClose(e,t){this.model[e].push(t.model)}};let xm={"3Triangles":!0,"3Stars":!0,"5Boxes":!0},Sm=e=>{if(e.formulae&&e.formulae[0])return e.formulae[0];let{tl:t}=new N(e.ref);switch(e.operator){case`containsText`:return`NOT(ISERROR(SEARCH("${e.text}",${t})))`;case`containsBlanks`:return`LEN(TRIM(${t}))=0`;case`notContainsBlanks`:return`LEN(TRIM(${t}))>0`;case`containsErrors`:return`ISERROR(${t})`;case`notContainsErrors`:return`NOT(ISERROR(${t}))`;default:return}},Cm=e=>{if(e.formulae&&e.formulae[0])return e.formulae[0];let{tl:t}=new N(e.ref);switch(e.timePeriod){case`thisWeek`:return`AND(TODAY()-ROUNDDOWN(${t},0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(${t},0)-TODAY()<=7-WEEKDAY(TODAY()))`;case`lastWeek`:return`AND(TODAY()-ROUNDDOWN(${t},0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(${t},0)<(WEEKDAY(TODAY())+7))`;case`nextWeek`:return`AND(ROUNDDOWN(${t},0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(${t},0)-TODAY()<(15-WEEKDAY(TODAY())))`;case`yesterday`:return`FLOOR(${t},1)=TODAY()-1`;case`today`:return`FLOOR(${t},1)=TODAY()`;case`tomorrow`:return`FLOOR(${t},1)=TODAY()+1`;case`last7Days`:return`AND(TODAY()-FLOOR(${t},1)<=6,FLOOR(${t},1)<=TODAY())`;case`lastMonth`:return`AND(MONTH(${t})=MONTH(EDATE(TODAY(),0-1)),YEAR(${t})=YEAR(EDATE(TODAY(),0-1)))`;case`thisMonth`:return`AND(MONTH(${t})=MONTH(TODAY()),YEAR(${t})=YEAR(TODAY()))`;case`nextMonth`:return`AND(MONTH(${t})=MONTH(EDATE(TODAY(),0+1)),YEAR(${t})=YEAR(EDATE(TODAY(),0+1)))`;default:return}},wm=e=>{let{type:t,operator:n}=e;switch(t){case`containsText`:case`containsBlanks`:case`notContainsBlanks`:case`containsErrors`:case`notContainsErrors`:return{type:`containsText`,operator:t};default:return{type:t,operator:n}}};var Tm=class e extends fm{constructor(){super(),this.map={dataBar:this.databarXform=new hm,extLst:this.extLstRefXform=new vm,formula:this.formulaXform=new ym,colorScale:this.colorScaleXform=new mm,iconSet:this.iconSetXform=new bm}}get tag(){return`cfRule`}static isPrimitive(e){return!(e.type===`iconSet`&&(e.custom||xm[e.iconSet]))}render(e,t){switch(t.type){case`expression`:this.renderExpression(e,t);break;case`cellIs`:this.renderCellIs(e,t);break;case`top10`:this.renderTop10(e,t);break;case`aboveAverage`:this.renderAboveAverage(e,t);break;case`dataBar`:this.renderDataBar(e,t);break;case`colorScale`:this.renderColorScale(e,t);break;case`iconSet`:this.renderIconSet(e,t);break;case`containsText`:this.renderText(e,t);break;case`timePeriod`:this.renderTimePeriod(e,t);break}}renderExpression(e,t){e.openNode(this.tag,{type:`expression`,dxfId:t.dxfId,priority:t.priority}),this.formulaXform.render(e,t.formulae[0]),e.closeNode()}renderCellIs(e,t){e.openNode(this.tag,{type:`cellIs`,dxfId:t.dxfId,priority:t.priority,operator:t.operator}),t.formulae.forEach(t=>{this.formulaXform.render(e,t)}),e.closeNode()}renderTop10(e,t){e.leafNode(this.tag,{type:`top10`,dxfId:t.dxfId,priority:t.priority,percent:U.toBoolAttribute(t.percent,!1),bottom:U.toBoolAttribute(t.bottom,!1),rank:U.toIntValue(t.rank,10)})}renderAboveAverage(e,t){e.leafNode(this.tag,{type:`aboveAverage`,dxfId:t.dxfId,priority:t.priority,aboveAverage:U.toBoolAttribute(t.aboveAverage,!0)})}renderDataBar(e,t){e.openNode(this.tag,{type:`dataBar`,priority:t.priority}),this.databarXform.render(e,t),this.extLstRefXform.render(e,t),e.closeNode()}renderColorScale(e,t){e.openNode(this.tag,{type:`colorScale`,priority:t.priority}),this.colorScaleXform.render(e,t),e.closeNode()}renderIconSet(t,n){e.isPrimitive(n)&&(t.openNode(this.tag,{type:`iconSet`,priority:n.priority}),this.iconSetXform.render(t,n),t.closeNode())}renderText(e,t){e.openNode(this.tag,{type:t.operator,dxfId:t.dxfId,priority:t.priority,operator:U.toStringAttribute(t.operator,`containsText`)});let n=Sm(t);n&&this.formulaXform.render(e,n),e.closeNode()}renderTimePeriod(e,t){e.openNode(this.tag,{type:`timePeriod`,dxfId:t.dxfId,priority:t.priority,timePeriod:t.timePeriod});let n=Cm(t);n&&this.formulaXform.render(e,n),e.closeNode()}createNewModel({attributes:e}){return{...wm(e),dxfId:U.toIntValue(e.dxfId),priority:U.toIntValue(e.priority),timePeriod:e.timePeriod,percent:U.toBoolValue(e.percent),bottom:U.toBoolValue(e.bottom),rank:U.toIntValue(e.rank),aboveAverage:U.toBoolValue(e.aboveAverage)}}onParserClose(e,t){switch(e){case`dataBar`:case`extLst`:case`colorScale`:case`iconSet`:Object.assign(this.model,t.model);break;case`formula`:this.model.formulae=this.model.formulae??[],this.model.formulae.push(t.model);break}}},Em=class extends fm{constructor(){super(),this.map={cfRule:new Tm}}get tag(){return`conditionalFormatting`}render(e,t){t.rules.some(Tm.isPrimitive)&&(e.openNode(this.tag,{sqref:t.ref}),t.rules.forEach(n=>{Tm.isPrimitive(n)&&(n.ref=t.ref,this.map.cfRule.render(e,n))}),e.closeNode())}createNewModel({attributes:e}){return{ref:e.sqref,rules:[]}}onParserClose(e,t){this.model.rules.push(t.model)}},Dm=class extends U{constructor(){super(),this.cfXform=new Em}get tag(){return`conditionalFormatting`}reset(){this.model=[]}prepare(e,t){let n=e.reduce((e,t)=>Math.max(e,...t.rules.map(e=>e.priority??0)),1);e.forEach(e=>{e.rules.forEach(e=>{e.priority||=n++,e.style&&(e.dxfId=t.styles.addDxfStyle(e.style)),e.type===`dataBar`&&((!e.cfvo||e.cfvo.length<2)&&(e.cfvo=[{type:`min`},{type:`max`}]),e.color||={argb:`FF638EC6`})})})}render(e,t){t.forEach(t=>{this.cfXform.render(e,t)})}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`conditionalFormatting`:return this.parser=this.cfXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?this.parser.parseClose(e)?!0:(this.model.push(this.parser.model),this.parser=void 0,!1):!1}reconcile(e,t){e.forEach(e=>{e.rules.forEach(e=>{e.dxfId!==void 0&&(e.style=t.styles.getDxfStyle(e.dxfId),delete e.dxfId)})})}},Om=class extends U{get tag(){return`brk`}render(e,t){e.leafNode(`brk`,t)}parseOpen(e){if(e.name===`brk`){let{id:t,max:n,man:r,min:i}=e.attributes;return this.model={id:+t,max:+n,man:+r},i!==void 0&&(this.model.min=+i),!0}return!1}parseText(){}parseClose(){return!1}},km=class extends W{constructor(){super({tag:`colBreaks`,count:!0,childXform:new Om})}render(e,t){if(t&&t.length){e.openNode(this.tag,this.$),e.addAttribute(this.$count,t.length),e.addAttribute(`manualBreakCount`,t.length);let{childXform:n}=this;for(let r of t)n.render(e,r);e.closeNode()}}},Am=class extends U{get tag(){return`col`}prepare(e,t){let n=t.styles.addStyleModel(e.style||{});n&&(e.styleId=n)}render(e,t){e.openNode(`col`),e.addAttribute(`min`,t.min),e.addAttribute(`max`,t.max),t.width&&e.addAttribute(`width`,t.width),t.styleId&&e.addAttribute(`style`,t.styleId),t.hidden&&e.addAttribute(`hidden`,`1`),t.bestFit&&e.addAttribute(`bestFit`,`1`),t.outlineLevel&&e.addAttribute(`outlineLevel`,t.outlineLevel),t.collapsed&&e.addAttribute(`collapsed`,`1`),e.addAttribute(`customWidth`,`1`),e.closeNode()}parseOpen(e){if(e.name===`col`){let t=this.model={min:parseInt(e.attributes.min??`0`,10),max:parseInt(e.attributes.max??`0`,10),width:e.attributes.width===void 0?void 0:parseFloat(e.attributes.width??`0`)};return e.attributes.style&&(t.styleId=parseInt(e.attributes.style,10)),Gc(e.attributes.hidden)&&(t.hidden=!0),Gc(e.attributes.bestFit)&&(t.bestFit=!0),e.attributes.outlineLevel&&(t.outlineLevel=parseInt(e.attributes.outlineLevel,10)),Gc(e.attributes.collapsed)&&(t.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(e,t){e.styleId!==void 0&&(e.style=t.styles.getStyleModel(e.styleId))}};function jm(e,t,n,r){let i=t[n];i===void 0?r!==void 0&&(e[n]=r):e[n]=i}function Mm(e,t,n,r){let i=t[n];i===void 0?r!==void 0&&(e[n]=r):e[n]=Gc(i)}function Nm(e){if(!e)return[];let t=[],n={};for(let[r,i]of Object.entries(e))if(i!=null)if(r.startsWith(`range:`)){let e=r.slice(6),{sqref:n,...a}=i;t.push({...a,sqref:e})}else n[r]=i;if(Object.keys(n).length===0)return t;let r=Object.entries(n).map(([e,t])=>({address:e,dataValidation:t,marked:!1})).sort((e,t)=>M.compareAddress(e.address,t.address)),i=Object.fromEntries(r.map(e=>[e.address,e])),a=(e,t,r)=>{for(let i=0;i<t;i++){let t=M.encodeAddress(e.row+i,r);if(!n[t]||!fc(n[e.address],n[t]))return!1}return!0},o=r.map(e=>{if(!e.marked){let t=M.decodeEx(e.address);if(t.dimensions)return i[t.dimensions].marked=!0,{...e.dataValidation,sqref:e.address};let r=1,o=M.encodeAddress(t.row+r,t.col);for(;n[o]&&fc(e.dataValidation,n[o]);)r++,o=M.encodeAddress(t.row+r,t.col);let s=1;for(;a(t,r,t.col+s);)s++;for(let e=0;e<r;e++)for(let n=0;n<s;n++)o=M.encodeAddress(t.row+e,t.col+n),i[o].marked=!0;if(r>1||s>1){let n=t.row+(r-1),i=t.col+(s-1);return{...e.dataValidation,sqref:`${e.address}:${M.encodeAddress(n,i)}`}}return{...e.dataValidation,sqref:e.address}}return null}).filter(Boolean);return[...t,...o]}var Pm=class extends U{get tag(){return`dataValidations`}render(e,t){let n=Nm(t);n.length&&(e.openNode(`dataValidations`,{count:n.length}),n.forEach(t=>{e.openNode(`dataValidation`),t.type!==`any`&&(e.addAttribute(`type`,t.type),t.operator&&t.type!==`list`&&t.operator!==`between`&&e.addAttribute(`operator`,t.operator),t.allowBlank&&e.addAttribute(`allowBlank`,`1`)),t.showInputMessage&&e.addAttribute(`showInputMessage`,`1`),t.promptTitle&&e.addAttribute(`promptTitle`,t.promptTitle),t.prompt&&e.addAttribute(`prompt`,t.prompt),t.showErrorMessage&&e.addAttribute(`showErrorMessage`,`1`),t.errorStyle&&e.addAttribute(`errorStyle`,t.errorStyle),t.errorTitle&&e.addAttribute(`errorTitle`,t.errorTitle),t.error&&e.addAttribute(`error`,t.error),e.addAttribute(`sqref`,t.sqref),(t.formulae??[]).forEach((n,r)=>{e.openNode(`formula${r+1}`),t.type===`date`?e.writeText(Ac(new Date(n))):e.writeText(n),e.closeNode()}),e.closeNode()}),e.closeNode())}parseOpen(e){switch(e.name){case`dataValidations`:return this.model={},!0;case`dataValidation`:{this._address=e.attributes.sqref;let t={type:e.attributes.type??`any`,formulae:[]};switch(e.attributes.type&&Mm(t,e.attributes,`allowBlank`),Mm(t,e.attributes,`showInputMessage`),Mm(t,e.attributes,`showErrorMessage`),t.type){case`any`:case`list`:case`custom`:break;default:jm(t,e.attributes,`operator`,`between`);break}return jm(t,e.attributes,`promptTitle`),jm(t,e.attributes,`prompt`),jm(t,e.attributes,`errorStyle`),jm(t,e.attributes,`errorTitle`),jm(t,e.attributes,`error`),this._dataValidation=t,!0}case`formula1`:case`formula2`:return this._formula=[],!0;default:return!1}}parseText(e){this._formula&&this._formula.push(e)}parseClose(e){switch(e){case`dataValidations`:return!1;case`dataValidation`:return(!this._dataValidation.formulae||!this._dataValidation.formulae.length)&&(delete this._dataValidation.formulae,delete this._dataValidation.operator),this._address.split(/\s+/g).forEach(e=>{e.includes(`:`)?this.model[`range:${e}`]=this._dataValidation:this.model[e]=this._dataValidation}),!0;case`formula1`:case`formula2`:{let e=this._formula.join(``);switch(this._dataValidation.type){case`whole`:case`textLength`:e=parseInt(e,10);break;case`decimal`:e=parseFloat(e);break;case`date`:e=jc(parseFloat(e));break;default:break}return this._dataValidation.formulae.push(e),this._formula=void 0,!0}default:return!0}}},Fm=class extends U{get tag(){return`drawing`}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:id`]},!0;default:return!1}}parseText(){}parseClose(){return!1}},Im=class extends U{get tag(){return`xm:f`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}},Lm=class extends fm{constructor(){super(),this.map={"xm:f":this.fExtXform=new Im}}get tag(){return`x14:cfvo`}render(e,t){e.openNode(this.tag,{type:t.type}),t.value!==void 0&&this.fExtXform.render(e,t.value),e.closeNode()}createNewModel(e){return{type:e.attributes.type}}onParserClose(e,t){switch(e){case`xm:f`:this.model.value=t.model?parseFloat(t.model):0;break}}},Rm=class extends fm{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new Lm,"x14:borderColor":this.borderColorXform=new Hd(`x14:borderColor`),"x14:negativeBorderColor":this.negativeBorderColorXform=new Hd(`x14:negativeBorderColor`),"x14:negativeFillColor":this.negativeFillColorXform=new Hd(`x14:negativeFillColor`),"x14:axisColor":this.axisColorXform=new Hd(`x14:axisColor`)}}static isExt(e){return!0}get tag(){return`x14:dataBar`}render(e,t){e.openNode(this.tag,{minLength:U.toIntAttribute(t.minLength,0,!0),maxLength:U.toIntAttribute(t.maxLength,100,!0),border:U.toBoolAttribute(t.border,!1),gradient:U.toBoolAttribute(t.gradient,!0),negativeBarColorSameAsPositive:U.toBoolAttribute(t.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:U.toBoolAttribute(t.negativeBarBorderColorSameAsPositive,!0),axisPosition:U.toAttribute(t.axisPosition,`auto`),direction:U.toAttribute(t.direction,`leftToRight`)}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),this.borderColorXform.render(e,t.borderColor),this.negativeBorderColorXform.render(e,t.negativeBorderColor),this.negativeFillColorXform.render(e,t.negativeFillColor),this.axisColorXform.render(e,t.axisColor),e.closeNode()}createNewModel({attributes:e}){return{cfvo:[],minLength:U.toIntValue(e.minLength,0),maxLength:U.toIntValue(e.maxLength,100),border:U.toBoolValue(e.border,!1),gradient:U.toBoolValue(e.gradient,!0),negativeBarColorSameAsPositive:U.toBoolValue(e.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:U.toBoolValue(e.negativeBarBorderColorSameAsPositive,!0),axisPosition:U.toStringValue(e.axisPosition,`auto`),direction:U.toStringValue(e.direction,`leftToRight`)}}onParserClose(e,t){let[,n]=e.split(`:`);switch(n){case`cfvo`:this.model.cfvo.push(t.model);break;default:this.model[n]=t.model;break}}},zm=class extends U{get tag(){return`x14:cfIcon`}render(e,t){e.leafNode(this.tag,{iconSet:t.iconSet,iconId:t.iconId})}parseOpen({attributes:e}){this.model={iconSet:e.iconSet,iconId:U.toIntValue(e.iconId)}}parseClose(e){return e!==this.tag}},Bm=class extends fm{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new Lm,"x14:cfIcon":this.cfIconXform=new zm}}get tag(){return`x14:iconSet`}render(e,t){e.openNode(this.tag,{iconSet:U.toStringAttribute(t.iconSet),reverse:U.toBoolAttribute(t.reverse,!1),showValue:U.toBoolAttribute(t.showValue,!0),custom:U.toBoolAttribute(t.icons,!1)}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),t.icons&&t.icons.forEach((t,n)=>{t.iconId=n,this.cfIconXform.render(e,t)}),e.closeNode()}createNewModel({attributes:e}){return{cfvo:[],iconSet:U.toStringValue(e.iconSet,`3TrafficLights`),reverse:U.toBoolValue(e.reverse,!1),showValue:U.toBoolValue(e.showValue,!0)}}onParserClose(e,t){let[,n]=e.split(`:`);switch(n){case`cfvo`:this.model.cfvo.push(t.model);break;case`cfIcon`:this.model.icons||(this.model.icons=[]),this.model.icons.push(t.model);break;default:this.model[n]=t.model;break}}};function K(e){return e.toString(16).padStart(2,`0`)}function Vm(e){e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=e;return K(t[0])+K(t[1])+K(t[2])+K(t[3])+`-`+K(t[4])+K(t[5])+`-`+K(t[6])+K(t[7])+`-`+K(t[8])+K(t[9])+`-`+K(t[10])+K(t[11])+K(t[12])+K(t[13])+K(t[14])+K(t[15])}function Hm(){let e=globalThis.crypto;if(e?.randomUUID)return e.randomUUID();let t=new Uint8Array(16);if(e?.getRandomValues)return e.getRandomValues(t),Vm(t);for(let e=0;e<t.length;e++)t[e]=Math.floor(Math.random()*256);return Vm(t)}let Um={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};var Wm=class e extends fm{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new Rm,"x14:iconSet":this.iconSetXform=new Bm}}get tag(){return`x14:cfRule`}static isExt(e){return e.type===`dataBar`?Rm.isExt(e):!!(e.type===`iconSet`&&(e.custom||Um[e.iconSet]))}static prepareRule(t){e.isExt(t)&&!t.x14Id&&(t.x14Id=`{${Hm()}}`.toUpperCase())}prepare(t){e.prepareRule(t)}render(t,n){if(e.isExt(n))switch(n.type){case`dataBar`:this.renderDataBar(t,n);break;case`iconSet`:this.renderIconSet(t,n);break}}renderDataBar(e,t){e.openNode(this.tag,{type:`dataBar`,id:t.x14Id}),this.databarXform.render(e,t),e.closeNode()}renderIconSet(e,t){e.openNode(this.tag,{type:`iconSet`,priority:t.priority,id:t.x14Id??`{${Hm()}}`}),this.iconSetXform.render(e,t),e.closeNode()}createNewModel({attributes:e}){return{type:e.type,x14Id:e.id,priority:U.toIntValue(e.priority)}}onParserClose(e,t){Object.assign(this.model,t.model)}},Gm=class extends U{get tag(){return`xm:sqref`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}},Km=class extends fm{constructor(){super(),this.map={"xm:sqref":this.sqRef=new Gm,"x14:cfRule":this.cfRule=new Wm}}get tag(){return`x14:conditionalFormatting`}prepare(e){e.rules.forEach(e=>{this.cfRule.prepare(e)})}render(e,t){t.rules.some(Wm.isExt)&&(e.openNode(this.tag,{"xmlns:xm":`http://schemas.microsoft.com/office/excel/2006/main`}),t.rules.filter(Wm.isExt).forEach(t=>this.cfRule.render(e,t)),this.sqRef.render(e,t.ref),e.closeNode())}createNewModel(){return{rules:[]}}onParserClose(e,t){switch(e){case`xm:sqref`:this.model.ref=t.model;break;case`x14:cfRule`:this.model.rules.push(t.model);break}}},qm=class extends fm{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new Km}}get tag(){return`x14:conditionalFormattings`}hasContent(e){return e.hasExtContent===void 0&&(e.hasExtContent=e.some(e=>e.rules.some(Wm.isExt))),e.hasExtContent}prepare(e){e.forEach(e=>{this.cfXform.prepare(e)})}render(e,t){this.hasContent(t)&&(e.openNode(this.tag),t.forEach(t=>this.cfXform.render(e,t)),e.closeNode())}createNewModel(){return[]}onParserClose(e,t){this.model.push(t.model)}},Jm=class extends fm{constructor(){super(),this.map={"x14:conditionalFormattings":this.conditionalFormattings=new qm}}get tag(){return`ext`}hasContent(e){return this.conditionalFormattings.hasContent(e.conditionalFormattings)}prepare(e){this.conditionalFormattings.prepare(e.conditionalFormattings)}render(e,t){e.openNode(`ext`,{uri:`{78C0D931-6437-407d-A8EE-F0AAD7539E65}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`}),this.conditionalFormattings.render(e,t.conditionalFormattings),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){this.model[e]=t.model}},Ym=class extends fm{constructor(){super(),this.map={ext:this.ext=new Jm}}get tag(){return`extLst`}prepare(e,t){this.ext.prepare(e)}hasContent(e){return this.ext.hasContent(e)}render(e,t){this.hasContent(t)&&(e.openNode(`extLst`),this.ext.render(e,t),e.closeNode())}createNewModel(){return{}}onParserClose(e,t){this.model[e]=t.model}},Xm=class extends U{get tag(){return`headerFooter`}render(e,t){if(!t)return;let n={},r=[];if(t.differentFirst&&(n.differentFirst=`1`),t.differentOddEven&&(n.differentOddEven=`1`),t.oddHeader&&typeof t.oddHeader==`string`&&r.push({name:`oddHeader`,text:t.oddHeader}),t.oddFooter&&typeof t.oddFooter==`string`&&r.push({name:`oddFooter`,text:t.oddFooter}),t.evenHeader&&typeof t.evenHeader==`string`&&r.push({name:`evenHeader`,text:t.evenHeader}),t.evenFooter&&typeof t.evenFooter==`string`&&r.push({name:`evenFooter`,text:t.evenFooter}),t.firstHeader&&typeof t.firstHeader==`string`&&r.push({name:`firstHeader`,text:t.firstHeader}),t.firstFooter&&typeof t.firstFooter==`string`&&r.push({name:`firstFooter`,text:t.firstFooter}),Object.keys(n).length>0||r.length>0){e.openNode(`headerFooter`,n);for(let t of r)e.leafNode(t.name,null,t.text);e.closeNode()}}parseOpen(e){switch(e.name){case`headerFooter`:return this.model={},e.attributes.differentFirst&&(this.model.differentFirst=parseInt(e.attributes.differentFirst,0)===1),e.attributes.differentOddEven&&(this.model.differentOddEven=parseInt(e.attributes.differentOddEven,0)===1),!0;case`oddHeader`:return this.currentNode=`oddHeader`,!0;case`oddFooter`:return this.currentNode=`oddFooter`,!0;case`evenHeader`:return this.currentNode=`evenHeader`,!0;case`evenFooter`:return this.currentNode=`evenFooter`,!0;case`firstHeader`:return this.currentNode=`firstHeader`,!0;case`firstFooter`:return this.currentNode=`firstFooter`,!0;default:return!1}}parseText(e){switch(this.currentNode){case`oddHeader`:this.model.oddHeader=(this.model.oddHeader??``)+e;break;case`oddFooter`:this.model.oddFooter=(this.model.oddFooter??``)+e;break;case`evenHeader`:this.model.evenHeader=(this.model.evenHeader??``)+e;break;case`evenFooter`:this.model.evenFooter=(this.model.evenFooter??``)+e;break;case`firstHeader`:this.model.firstHeader=(this.model.firstHeader??``)+e;break;case`firstFooter`:this.model.firstFooter=(this.model.firstFooter??``)+e;break;default:break}}parseClose(){switch(this.currentNode){case`oddHeader`:case`oddFooter`:case`evenHeader`:case`evenFooter`:case`firstHeader`:case`firstFooter`:return this.currentNode=void 0,!0;default:return!1}}};let Zm=[`numberStoredAsText`,`formula`,`formulaRange`,`unlockedFormula`,`emptyCellReference`,`listDataValidation`,`calculatedColumn`,`evalError`,`twoDigitTextYear`];var Qm=class extends U{get tag(){return`ignoredErrors`}render(e,t){if(!(!t||t.length===0)){e.openNode(`ignoredErrors`);for(let n of t){let t={sqref:n.ref};for(let e of Zm)n[e]&&(t[e]=1);e.leafNode(`ignoredError`,t)}e.closeNode()}}parseOpen(e){switch(e.name){case`ignoredErrors`:return this.model=[],!0;case`ignoredError`:{let t={ref:e.attributes.sqref??``};for(let n of Zm)(e.attributes[n]===`1`||e.attributes[n]===`true`)&&(t[n]=!0);return this.model.push(t),!0}default:return!0}}parseText(){}parseClose(e){switch(e){case`ignoredErrors`:return!1;default:return!0}}},$m=class extends U{get tag(){return`pageMargins`}render(e,t){if(t){let n={left:t.left,right:t.right,top:t.top,bottom:t.bottom,header:t.header,footer:t.footer};Object.values(n).some(e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={left:parseFloat(e.attributes.left||.7),right:parseFloat(e.attributes.right||.7),top:parseFloat(e.attributes.top||.75),bottom:parseFloat(e.attributes.bottom||.75),header:parseFloat(e.attributes.header||.3),footer:parseFloat(e.attributes.footer||.3)},!0;default:return!1}}parseText(){}parseClose(){return!1}};function eh(e){return e?`1`:void 0}function th(e){switch(e){case`overThenDown`:return e;default:return}}function nh(e){switch(e){case`atEnd`:case`asDisplyed`:return e;default:return}}function rh(e){switch(e){case`dash`:case`blank`:case`NA`:return e;default:return}}function ih(e){return e===void 0?void 0:parseInt(e,10)}var ah=class extends U{get tag(){return`pageSetup`}_dpiToXml(e){if(e!==void 0&&Number.isFinite(e)&&e!==4294967295)return e}render(e,t){if(t){let n={paperSize:t.paperSize,orientation:t.orientation,horizontalDpi:this._dpiToXml(t.horizontalDpi),verticalDpi:this._dpiToXml(t.verticalDpi),pageOrder:th(t.pageOrder),blackAndWhite:eh(t.blackAndWhite),draft:eh(t.draft),cellComments:nh(t.cellComments),errors:rh(t.errors),scale:t.scale===100?void 0:t.scale,fitToWidth:t.fitToWidth===1?void 0:t.fitToWidth,fitToHeight:t.fitToHeight===1?void 0:t.fitToHeight,firstPageNumber:t.firstPageNumber,useFirstPageNumber:eh(!!t.firstPageNumber),usePrinterDefaults:eh(t.usePrinterDefaults),copies:t.copies};Object.values(n).some(e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={paperSize:ih(e.attributes.paperSize),orientation:e.attributes.orientation??`portrait`,horizontalDpi:parseInt(e.attributes.horizontalDpi??`4294967295`,10),verticalDpi:parseInt(e.attributes.verticalDpi??`4294967295`,10),pageOrder:e.attributes.pageOrder??`downThenOver`,blackAndWhite:e.attributes.blackAndWhite===`1`,draft:e.attributes.draft===`1`,cellComments:e.attributes.cellComments??`None`,errors:e.attributes.errors??`displayed`,scale:parseInt(e.attributes.scale??`100`,10),fitToWidth:parseInt(e.attributes.fitToWidth??`1`,10),fitToHeight:parseInt(e.attributes.fitToHeight??`1`,10),firstPageNumber:parseInt(e.attributes.firstPageNumber??`1`,10),useFirstPageNumber:e.attributes.useFirstPageNumber===`1`,usePrinterDefaults:e.attributes.usePrinterDefaults===`1`,copies:parseInt(e.attributes.copies??`1`,10)},!0;default:return!1}}parseText(){}parseClose(){return!1}},oh=class extends U{get tag(){return`picture`}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:id`]},!0;default:return!1}}parseText(){}parseClose(){return!1}},sh=class extends W{constructor(){super({tag:`rowBreaks`,count:!0,childXform:new Om})}render(e,t){if(t&&t.length){e.openNode(this.tag,this.$),e.addAttribute(this.$count,t.length),e.addAttribute(`manualBreakCount`,t.length);let{childXform:n}=this;for(let r of t)n.render(e,r);e.closeNode()}}};function ch(e){if(e==null)return 0;if(e instanceof String||typeof e==`string`)return 3;if(typeof e==`number`)return 2;if(typeof e==`boolean`)return 9;if(e instanceof Date)return 4;if(e.text&&e.hyperlink)return 5;if(e.formula)return 6;if(e.error)return 10;throw new Ar(typeof e,`Could not understand type of value`)}function lh(e){switch(e.type){case 6:return ch(e.result);default:return e.type}}function uh(e){if(e==null)return{text:``};if(typeof e==`string`)return{text:e};if(typeof e==`number`||typeof e==`boolean`)return{text:String(e)};if(typeof e==`object`){let t=e;if(Array.isArray(t.richText)){if(t.richText.length===0)return{text:``};let e=t.richText.map(e=>{let t=e,n={text:typeof t?.text==`string`?t.text:``};return t?.font!==null&&typeof t?.font==`object`&&(n.font=t.font),n});return{text:e.map(e=>e.text).join(``),richText:e}}if(typeof t.error==`string`)return{text:t.error}}return{text:String(e)}}var dh=class extends U{constructor(){super(),this.richTextXform=new Vp}get tag(){return`c`}prepare(e,t){let n=t.styles.addStyleModel(e.style||{},lh(e));switch(n&&(e.styleId=n),e.comment&&t.comments.push({...e.comment,ref:e.address}),e.type){case 3:case 8:t.sharedStrings&&(e.ssId=t.sharedStrings.add(e.value));break;case 4:t.date1904&&(e.date1904=!0);break;case 5:t.sharedStrings&&(Array.isArray(e.richText)&&e.richText.length>0?e.ssId=t.sharedStrings.add({richText:e.richText}):e.text!==void 0&&e.text!==null&&(e.ssId=t.sharedStrings.add(e.text))),t.hyperlinks.push({address:e.address,target:e.hyperlink,tooltip:e.tooltip});break;case 1:t.merges.add(e);break;case 6:if(t.date1904&&(e.date1904=!0),e.isDynamicArray&&(e.cm=1),e.hyperlink&&t.hyperlinks.push({address:e.address,target:e.hyperlink,tooltip:e.tooltip}),e.shareType===`shared`&&(e.si=t.siFormulae++),e.formula)t.formulae[e.address]=e;else if(e.sharedFormula){let n=t.formulae[e.sharedFormula];if(!n)throw new j(`Shared Formula master must exist above and or left of clone for cell ${e.address}`);n.si===void 0?(n.shareType=`shared`,n.si=t.siFormulae++,n.range=new N(n.address,e.address)):n.range&&n.range.expandToAddress(e.address),e.si=n.si}break;default:break}}renderFormula(e,t){let n=null;switch(t.shareType){case`shared`:n={t:`shared`,ref:t.ref||t.range.range,si:t.si};break;case`array`:n={t:`array`,ref:t.ref};break;default:t.si!==void 0&&(n={t:`shared`,si:t.si});break}switch(ch(t.result)){case 0:e.leafNode(`f`,n,t.formula);break;case 3:e.addAttribute(`t`,`str`),e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result);break;case 2:e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result);break;case 9:e.addAttribute(`t`,`b`),e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,+!!t.result);break;case 10:e.addAttribute(`t`,`e`),e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result.error);break;case 4:e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,Ac(t.result,t.date1904));break;default:throw new Ar(String(ch(t.result)),`Could not understand type of value`)}}render(e,t){if(!(t.type===0&&!t.styleId)){switch(e.openNode(`c`),e.addAttribute(`r`,t.address),t.styleId&&e.addAttribute(`s`,t.styleId),t.cm&&e.addAttribute(`cm`,t.cm),t.type){case 0:break;case 2:e.leafNode(`v`,null,t.value);break;case 9:e.addAttribute(`t`,`b`),e.leafNode(`v`,null,t.value?`1`:`0`);break;case 12:e.addAttribute(`t`,`b`),e.leafNode(`v`,null,t.value?`1`:`0`);break;case 10:e.addAttribute(`t`,`e`),e.leafNode(`v`,null,t.value.error);break;case 3:case 8:t.ssId===void 0?t.value&&t.value.richText?(e.addAttribute(`t`,`inlineStr`),e.openNode(`is`),t.value.richText.forEach(t=>{this.richTextXform.render(e,t)}),e.closeNode(`is`)):(e.addAttribute(`t`,`str`),e.leafNode(`v`,null,t.value)):(e.addAttribute(`t`,`s`),e.leafNode(`v`,null,t.ssId));break;case 4:e.leafNode(`v`,null,Ac(t.value,t.date1904));break;case 5:t.formula||t.sharedFormula?this.renderFormula(e,t):t.ssId===void 0?Array.isArray(t.richText)&&t.richText.length>0?(e.addAttribute(`t`,`inlineStr`),e.openNode(`is`),t.richText.forEach(t=>{this.richTextXform.render(e,t)}),e.closeNode(`is`)):(e.addAttribute(`t`,`str`),e.leafNode(`v`,null,t.text)):(e.addAttribute(`t`,`s`),e.leafNode(`v`,null,t.ssId));break;case 6:this.renderFormula(e,t);break;case 1:break;default:break}e.closeNode()}}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`c`:return this.model={address:e.attributes.r},this.t=e.attributes.t,e.attributes.s&&(this.model.styleId=parseInt(e.attributes.s,10)),e.attributes.cm&&(this.model.cm=parseInt(e.attributes.cm,10)),!0;case`f`:return this.currentNode=`f`,this.model.si=e.attributes.si,this.model.shareType=e.attributes.t,this.model.ref=e.attributes.ref,!0;case`v`:return this.currentNode=`v`,!0;case`t`:return this.currentNode=`t`,!0;case`r`:return this.parser=this.richTextXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){if(this.parser){this.parser.parseText(e);return}switch(this.currentNode){case`f`:this.model.formula=this.model.formula?this.model.formula+e:e;break;case`v`:case`t`:this.model.value&&this.model.value.richText?this.model.value.richText.text=this.model.value.richText.text?this.model.value.richText.text+e:e:this.model.value=this.model.value?this.model.value+e:e;break;default:break}}parseClose(e){switch(e){case`c`:{let{model:e}=this;if(e.formula||e.shareType)e.type=6,e.value&&=(this.t===`str`?e.result=e.value:this.t===`b`?e.result=parseInt(e.value,10)!==0:this.t===`e`?e.result={error:e.value}:e.result=parseFloat(e.value),void 0);else if(e.value!==void 0)switch(this.t){case`s`:e.type=3,e.value=parseInt(e.value,10);break;case`str`:e.type=3;break;case`inlineStr`:e.type=3,typeof e.value==`string`&&e.value.includes(`_x`)&&(e.value=Pc(e.value));break;case`b`:e.type=9,e.value=parseInt(e.value,10)!==0;break;case`e`:e.type=10,e.value={error:e.value};break;case`d`:e.type=4,e.value=new Date(e.value);break;default:e.type=2,e.value=parseFloat(e.value);break}else e.styleId?e.type=0:e.type=1;return!1}case`f`:case`v`:case`is`:return this.currentNode=void 0,!0;case`t`:return this.parser?(this.parser.parseClose(e),!0):(this.currentNode=void 0,!0);case`r`:return this.model.value=this.model.value||{},this.model.value.richText=this.model.value.richText??[],this.model.value.richText.push(this.parser.model),this.parser=void 0,this.currentNode=void 0,!0;default:return this.parser?(this.parser.parseClose(e),!0):!1}}reconcile(e,t){let n=e.styleId!==void 0&&t.styles&&t.styles.getStyleModel(e.styleId);switch(n&&(e.style=n),e.styleId!==void 0&&(e.styleId=void 0),e.type){case 3:if(typeof e.value==`number`&&t.sharedStrings){let n=e.value;if(e.value=t.sharedStrings.getString(n),e.value===void 0)throw new j(`Invalid shared string index ${n} in cell ${e.address}: the xlsx file appears to be corrupted`)}e.value&&e.value.richText&&(e.type=8);break;case 2:n&&Wc(n.numFmt)&&(e.type=4,e.value=jc(e.value,t.date1904));break;case 6:e.result!==void 0&&typeof e.result==`number`&&n&&Wc(n.numFmt)&&(e.result=jc(e.result,t.date1904)),e.shareType===`shared`&&(e.ref?t.formulae[e.si]=e.address:(e.sharedFormula=t.formulae[e.si],delete e.shareType),delete e.si),e.cm&&(t.dynamicArrayCmIndices?t.dynamicArrayCmIndices.has(e.cm)&&(e.isDynamicArray=!0):t.hasDynamicArrayMetadata&&(e.isDynamicArray=!0)),delete e.cm;break;default:break}let r=t.hyperlinkMap[e.address];if(r){let t;e.type===6?t=e.result:(t=e.value,e.value=void 0);let n=uh(t);e.text=n.text,n.richText?e.richText=n.richText:delete e.richText,e.type=5,e.hyperlink=r}let i=t.commentsMap&&t.commentsMap[e.address];i&&(e.comment=i)}},fh=class extends U{constructor(e){super(),this.maxItems=e&&e.maxItems,this.map={c:new dh}}get tag(){return`row`}reset(){super.reset(),this.numRowsSeen=0,this.lastCellCol=0}prepare(e,t){let n=t.styles.addStyleModel(e.style);n&&(e.styleId=n);let r=this.map.c;e.cells.forEach(e=>{r.prepare(e,t)})}render(e,t,n){if(!t)return;e.openNode(`row`),e.addAttribute(`r`,t.number),t.height!=null&&t.height>0?(e.addAttribute(`ht`,t.height),t.customHeight!==!1&&e.addAttribute(`customHeight`,`1`)):t.height===0&&e.addAttribute(`ht`,1),t.hidden&&e.addAttribute(`hidden`,`1`),t.min>0&&t.max>0&&t.min<=t.max&&e.addAttribute(`spans`,`${t.min}:${t.max}`),t.styleId&&(e.addAttribute(`s`,t.styleId),e.addAttribute(`customFormat`,`1`)),t.dyDescent!==void 0&&e.addAttribute(`x14ac:dyDescent`,t.dyDescent),t.outlineLevel&&e.addAttribute(`outlineLevel`,t.outlineLevel),t.collapsed&&e.addAttribute(`collapsed`,`1`);let r=this.map.c;t.cells.forEach(t=>{r.render(e,t,n)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(e.name===`row`){this.numRowsSeen+=1,this.lastCellCol=0;let t=e.attributes.spans,n,r;if(t){let e=t.indexOf(`:`);n=parseInt(t,10),r=e>-1?parseInt(t.substring(e+1),10):void 0}let i=e.attributes.r?parseInt(e.attributes.r,10):this.numRowsSeen,a=this.model={number:i,min:n,max:r,cells:[]};return e.attributes.s&&(a.styleId=parseInt(e.attributes.s,10)),Gc(e.attributes.hidden)&&(a.hidden=!0),Gc(e.attributes.bestFit)&&(a.bestFit=!0),e.attributes.ht&&(a.height=parseFloat(e.attributes.ht)),Gc(e.attributes.customHeight)&&(a.customHeight=!0),e.attributes.outlineLevel&&(a.outlineLevel=parseInt(e.attributes.outlineLevel,10)),Gc(e.attributes.collapsed)&&(a.collapsed=!0),e.attributes[`x14ac:dyDescent`]!==void 0&&(a.dyDescent=parseFloat(e.attributes[`x14ac:dyDescent`])),!0}return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){let e=this.parser.model;if(e.address?this.lastCellCol=M.decodeCol(e.address):(this.lastCellCol+=1,e.address=M.encodeAddress(this.model.number,this.lastCellCol)),this.model.cells.push(e),this.maxItems&&this.model.cells.length>this.maxItems)throw new zr(`column`,this.maxItems);this.parser=void 0}return!0}return!1}reconcile(e,t){e.style=e.styleId===void 0?{}:t.styles.getStyleModel(e.styleId),e.styleId!==void 0&&(e.styleId=void 0);let n=this.map.c;e.cells.forEach(e=>{n.reconcile(e,t)})}},ph=class extends U{get tag(){return`sheetFormatPr`}render(e,t){if(t){let n={defaultRowHeight:t.defaultRowHeight,outlineLevelRow:t.outlineLevelRow||void 0,outlineLevelCol:t.outlineLevelCol||void 0,"x14ac:dyDescent":t.dyDescent!==void 0&&t.dyDescent!==0?t.dyDescent:void 0};t.defaultColWidth&&(n.defaultColWidth=t.defaultColWidth),t.customHeight&&(n.customHeight=`1`),Object.values(n).some(e=>e!==void 0)&&e.leafNode(`sheetFormatPr`,n)}}parseOpen(e){return e.name===`sheetFormatPr`?(this.model={defaultRowHeight:parseFloat(e.attributes.defaultRowHeight??`0`),dyDescent:e.attributes[`x14ac:dyDescent`]===void 0?void 0:parseFloat(e.attributes[`x14ac:dyDescent`]),outlineLevelRow:parseInt(e.attributes.outlineLevelRow??`0`,10),outlineLevelCol:parseInt(e.attributes.outlineLevelCol??`0`,10)},e.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(e.attributes.defaultColWidth)),e.attributes.customHeight===`1`&&(this.model.customHeight=!0),!0):!1}parseText(){}parseClose(){return!1}};let mh=e=>e!==void 0;var hh=class extends U{get tag(){return`outlinePr`}render(e,t){return t&&(mh(t.summaryBelow)||mh(t.summaryRight))?(e.leafNode(this.tag,{summaryBelow:mh(t.summaryBelow)?Number(t.summaryBelow):void 0,summaryRight:mh(t.summaryRight)?Number(t.summaryRight):void 0}),!0):!1}parseOpen(e){return e.name===this.tag?(this.model={summaryBelow:mh(e.attributes.summaryBelow)?!!Number(e.attributes.summaryBelow):void 0,summaryRight:mh(e.attributes.summaryRight)?!!Number(e.attributes.summaryRight):void 0},!0):!1}parseText(){}parseClose(){return!1}},gh=class extends U{get tag(){return`pageSetUpPr`}render(e,t){return t&&t.fitToPage?(e.leafNode(this.tag,{fitToPage:t.fitToPage?`1`:void 0}),!0):!1}parseOpen(e){return e.name===this.tag?(this.model={fitToPage:e.attributes.fitToPage===`1`},!0):!1}parseText(){}parseClose(){return!1}},_h=class extends U{constructor(){super(),this.map={tabColor:new Hd(`tabColor`),pageSetUpPr:new gh,outlinePr:new hh}}get tag(){return`sheetPr`}render(e,t){if(!t)return;let n=!!t.tabColor,r=!!(t.pageSetup&&t.pageSetup.fitToPage),i=t.outlineProperties!==void 0&&t.outlineProperties!==null&&(t.outlineProperties.summaryBelow!==void 0||t.outlineProperties.summaryRight!==void 0);(n||r||i)&&(e.openNode(`sheetPr`),this.map.tabColor.render(e,t.tabColor),this.map.pageSetUpPr.render(e,t.pageSetup),this.map.outlinePr.render(e,t.outlineProperties),e.closeNode())}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.reset(),!0):this.map[e.name]?(this.parser=this.map[e.name],this.parser.parseOpen(e),!0):!1}parseText(e){return this.parser?(this.parser.parseText(e),!0):!1}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(this.map.tabColor.model||this.map.pageSetUpPr.model||this.map.outlinePr.model?(this.model={},this.map.tabColor.model&&(this.model.tabColor=this.map.tabColor.model),this.map.pageSetUpPr.model&&(this.model.pageSetup=this.map.pageSetUpPr.model),this.map.outlinePr.model&&(this.model.outlineProperties=this.map.outlinePr.model)):this.model=null,!1)}};function vh(e,t){return e?t:void 0}function yh(e,t){return e===t?!0:void 0}var bh=class extends U{get tag(){return`sheetProtection`}render(e,t){if(t){let n={sheet:vh(t.sheet,`1`),selectLockedCells:t.selectLockedCells===!1?`1`:void 0,selectUnlockedCells:t.selectUnlockedCells===!1?`1`:void 0,formatCells:vh(t.formatCells,`0`),formatColumns:vh(t.formatColumns,`0`),formatRows:vh(t.formatRows,`0`),insertColumns:vh(t.insertColumns,`0`),insertRows:vh(t.insertRows,`0`),insertHyperlinks:vh(t.insertHyperlinks,`0`),deleteColumns:vh(t.deleteColumns,`0`),deleteRows:vh(t.deleteRows,`0`),sort:vh(t.sort,`0`),autoFilter:vh(t.autoFilter,`0`),pivotTables:vh(t.pivotTables,`0`)};t.sheet&&(n.algorithmName=t.algorithmName,n.hashValue=t.hashValue,n.saltValue=t.saltValue,n.spinCount=t.spinCount,n.objects=vh(t.objects===!1,`1`),n.scenarios=vh(t.scenarios===!1,`1`)),Object.values(n).some(e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={sheet:yh(e.attributes.sheet,`1`),objects:e.attributes.objects===`1`?!1:void 0,scenarios:e.attributes.scenarios===`1`?!1:void 0,selectLockedCells:e.attributes.selectLockedCells===`1`?!1:void 0,selectUnlockedCells:e.attributes.selectUnlockedCells===`1`?!1:void 0,formatCells:yh(e.attributes.formatCells,`0`),formatColumns:yh(e.attributes.formatColumns,`0`),formatRows:yh(e.attributes.formatRows,`0`),insertColumns:yh(e.attributes.insertColumns,`0`),insertRows:yh(e.attributes.insertRows,`0`),insertHyperlinks:yh(e.attributes.insertHyperlinks,`0`),deleteColumns:yh(e.attributes.deleteColumns,`0`),deleteRows:yh(e.attributes.deleteRows,`0`),sort:yh(e.attributes.sort,`0`),autoFilter:yh(e.attributes.autoFilter,`0`),pivotTables:yh(e.attributes.pivotTables,`0`)},e.attributes.algorithmName&&(this.model.algorithmName=e.attributes.algorithmName,this.model.hashValue=e.attributes.hashValue,this.model.saltValue=e.attributes.saltValue,this.model.spinCount=parseInt(e.attributes.spinCount,10)),!0;default:return!1}}parseText(){}parseClose(){return!1}};let xh={frozen:`frozen`,frozenSplit:`frozen`,split:`split`};var Sh=class extends U{get tag(){return`sheetView`}prepare(e){switch(e.state){case`frozen`:case`split`:break;default:e.state=`normal`;break}}render(e,t){let n={};t.tabSelected&&(n.tabSelected=`1`),n.workbookViewId=t.workbookViewId??0,e.openNode(`sheetView`,n);let r=function(t,n,r){r&&e.addAttribute(t,n)};r(`rightToLeft`,`1`,t.rightToLeft===!0),r(`showRuler`,`0`,t.showRuler===!1),r(`showRowColHeaders`,`0`,t.showRowColHeaders===!1),r(`showGridLines`,`0`,t.showGridLines===!1),r(`zoomScale`,t.zoomScale,t.zoomScale!==void 0&&t.zoomScale!==100),r(`zoomScaleNormal`,t.zoomScaleNormal,t.zoomScaleNormal!==void 0&&t.zoomScaleNormal!==100),r(`view`,t.style,t.style);let i,a,o,s;switch(t.state){case`frozen`:a=t.xSplit??0,o=t.ySplit??0,i=t.topLeftCell||M.getAddress(o+1,a+1).address,s=t.xSplit&&t.ySplit&&`bottomRight`||t.xSplit&&`topRight`||`bottomLeft`,e.leafNode(`pane`,{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:i,activePane:s,state:`frozen`}),e.leafNode(`selection`,{pane:s,activeCell:t.activeCell,sqref:t.activeCell});break;case`split`:t.activePane===`topLeft`&&(t.activePane=void 0),e.leafNode(`pane`,{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:t.topLeftCell,activePane:t.activePane}),e.leafNode(`selection`,{pane:t.activePane,activeCell:t.activeCell,sqref:t.activeCell});break;case`normal`:t.activeCell&&e.leafNode(`selection`,{activeCell:t.activeCell,sqref:t.activeCell});break;default:break}e.closeNode()}parseOpen(e){switch(e.name){case`sheetView`:return this.sheetView={workbookViewId:parseInt(e.attributes.workbookViewId,10),rightToLeft:e.attributes.rightToLeft===`1`,tabSelected:e.attributes.tabSelected===`1`,showRuler:e.attributes.showRuler!==`0`,showRowColHeaders:e.attributes.showRowColHeaders!==`0`,showGridLines:e.attributes.showGridLines!==`0`,zoomScale:parseInt(e.attributes.zoomScale??`100`,10),zoomScaleNormal:parseInt(e.attributes.zoomScaleNormal??`100`,10),style:e.attributes.view},this.pane=void 0,this.selections={},!0;case`pane`:return this.pane={xSplit:parseInt(e.attributes.xSplit??`0`,10),ySplit:parseInt(e.attributes.ySplit??`0`,10),topLeftCell:e.attributes.topLeftCell,activePane:e.attributes.activePane??`topLeft`,state:e.attributes.state},!0;case`selection`:{let t=e.attributes.pane??`topLeft`;return this.selections[t]={pane:t,activeCell:e.attributes.activeCell},!0}default:return!1}}parseText(){}parseClose(e){let t,n;switch(e){case`sheetView`:return this.sheetView&&this.pane?(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,tabSelected:this.sheetView.tabSelected,state:xh[this.pane.state]??`split`,xSplit:this.pane.xSplit,ySplit:this.pane.ySplit,topLeftCell:this.pane.topLeftCell,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},this.model.state===`split`&&(t.activePane=this.pane.activePane),n=this.selections[this.pane.activePane],n&&n.activeCell&&(t.activeCell=n.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)):(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,tabSelected:this.sheetView.tabSelected,state:`normal`,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},n=this.selections.topLeft,n&&n.activeCell&&(t.activeCell=n.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)),!1;default:return!0}}reconcile(){}};let q=new um,J={dataValidations:new Pm,sheetProperties:new _h,sheetFormatProperties:new ph,columns:new W({tag:`cols`,count:!1,childXform:new Am}),row:new fh,hyperlinks:new W({tag:`hyperlinks`,count:!1,childXform:new Zp}),sheetViews:new W({tag:`sheetViews`,count:!1,childXform:new Sh}),sheetProtection:new bh,pageMargins:new $m,pageSeteup:new ah,autoFilter:new dm,picture:new oh,drawing:new Fm,conditionalFormattings:new Dm,extLst:new Ym,ignoredErrors:new Qm,headerFooter:new Xm,rowBreaks:new sh,colBreaks:new km};var Ch=class{constructor(e){this.id=e.id,this.name=e.name||`Sheet${this.id}`,this.state=e.state??`visible`,this._rows=[],this._columns=[],this._keys={},this._merges=[],this._merges.add=function(){},this._sheetRelsWriter=new em(e),this._sheetCommentsWriter=new Xp(this,this._sheetRelsWriter,e),this._dimensions=new N,this._rowZero=1,this._rowOffset=0,this.committed=!1,this.dataValidations=new zp,this._formulae={},this._siFormulae=0,this.conditionalFormatting=[],this.ignoredErrors=[],this.rowBreaks=[],this.colBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,outlineLevelCol:0,outlineLevelRow:0},e.properties),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},e.headerFooter),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,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},e.pageSetup),this.useSharedStrings=e.useSharedStrings??!1,this._workbook=e.workbook,this.hasComments=!1,this._views=e.views??[],this.autoFilter=e.autoFilter??null,this._media=[],this._watermark=null,this.sheetProtection=null,this._writeOpenWorksheet(),this.startedData=!1}get workbook(){return this._workbook}get stream(){return this._stream||=this._workbook._openStream(Vu(this.id)),this._stream}destroy(){throw new Pr(`destroy`,`Invalid operation for a streaming writer`)}commit(){if(!this.committed){for(let e=this._rowOffset;e<this._rows.length;e++){let t=this._rows[e];t&&this._writeRow(t)}this._rows=null,this.startedData||this._writeOpenSheetData(),this._writeCloseSheetData(),this._writeSheetProtection(),this._writeAutoFilter(),this._writeMergeCells(),this._writeHyperlinks(),this._writeConditionalFormatting(),this._writeDataValidations(),this._writePageMargins(),this._writePageSetup(),this._writeHeaderFooter(),this._writeRowBreaks(),this._writeColBreaks(),this._writeDrawing(),this._writeBackground(),this._writeLegacyData(),this._writeIgnoredErrors(),this._writeExtLst(),this._writeCloseWorksheet(),this.stream.end(),this._sheetCommentsWriter.commit(),this._sheetRelsWriter.commit(),this.committed=!0}}get dimensions(){return this._dimensions}get views(){return this._views}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 gc(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){if(typeof e==`string`){let t=this._keys[e];if(t)return t;e=M.l2n(e)}if(e>this._columns.length){let t=this._columns.length+1;for(;t<=e;)this._columns.push(new gc(this,t++))}return this._columns[e-1]}get _nextRow(){return this._rowZero+(this._rows.length-this._rowOffset)}eachRow(e,t){let n,r;if(typeof e==`function`?(n=e,r=void 0):(n=t,r=e),r&&r.includeEmpty){let e=this._nextRow;for(let t=this._rowZero;t<e;t++)n(this.getRow(t),t)}else this._rows.forEach(e=>{e&&e.hasValues&&n(e,e.number)})}_commitRow(e){let t=!1,n=this._rows;for(;this._rowOffset<n.length&&!t;){let r=n[this._rowOffset];n[this._rowOffset]=void 0,this._rowOffset++,this._rowZero++,r&&(this._writeRow(r),t=r.number===e.number,this._rowZero=r.number+1),this._rowOffset>1024&&this._rowOffset>n.length>>1&&(n.splice(0,this._rowOffset),this._rowOffset=0)}}get lastRow(){let e=this._rows;for(let t=e.length-1;t>=this._rowOffset;t--){let n=e[t];if(n)return n}}findRow(e){let t=e-this._rowZero+this._rowOffset;return this._rows[t]}getRow(e){let t=e-this._rowZero+this._rowOffset;if(t<this._rowOffset)throw new Or(e,`this row has been committed`);let n=this._rows[t];return n||(this._rows[t]=n=new Ql(this,e)),n}addRow(e){let t=new Ql(this,this._nextRow);return this._rows[t.number-this._rowZero+this._rowOffset]=t,t.values=e,t}addRows(e){return e.map(e=>this.addRow(e))}findCell(e,t){let n=M.getAddress(e,t),r=this.findRow(n.row);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 N(e);this._merges.forEach(e=>{if(e.intersects(t))throw new kr});let{top:n,left:r,bottom:i,right:a}=t,o=im(n,r,i,a,(e,t)=>this.findCell(e,t)),s=this.getCell(n,r);for(let e=n;e<=i;e++)for(let t=r;t<=a;t++)(e>n||t>r)&&this.getCell(e,t).merge(s);o&&am(n,r,i,a,o,(e,t)=>this.getCell(e,t)),this._merges.push(t)}addConditionalFormatting(e){this.conditionalFormatting.push(e)}removeConditionalFormatting(e){typeof e==`number`?this.conditionalFormatting.splice(e,1):e instanceof Function?this.conditionalFormatting=this.conditionalFormatting.filter(e):this.conditionalFormatting=[]}addBackgroundImage(e){this._background={imageId:Number(e)}}getBackgroundImageId(){return this._background&&this._background.imageId}addImage(e,t){let n=this._parseImageRange(String(e),t);this._media.push(n)}getImages(){return this._media}addWatermark(e){this._media=this._media.filter(e=>e._watermarkTag!==!0);let t=e.opacity===void 0?.15:Math.max(0,Math.min(1,e.opacity));if(this._watermark={imageId:String(e.imageId),mode:e.mode??`overlay`,opacity:t,headerWidth:e.headerWidth,headerHeight:e.headerHeight,applyTo:e.applyTo},this._watermark.mode===`overlay`){let n={type:`image`,imageId:String(e.imageId),range:{tl:{nativeCol:0,nativeColOff:0,nativeRow:0,nativeRowOff:0},br:{nativeCol:100,nativeColOff:0,nativeRow:200,nativeRowOff:0},editAs:`absolute`},_watermarkTag:!0,opacity:t};this._media.push(n)}}getWatermark(){return this._watermark}removeWatermark(){this._watermark=null,this._media=this._media.filter(e=>e._watermarkTag!==!0)}_parseImageRange(e,t){if(typeof t==`string`){let n=M.decode(t);if(`top`in n)return{type:`image`,imageId:e,range:{tl:new Rp(this,{col:n.left,row:n.top},-1).model,br:new Rp(this,{col:n.right,row:n.bottom},0).model,editAs:`oneCell`}};throw Error(`Invalid image range: "${t}". Expected a range like "A1:C3".`)}if(`pos`in t&&t.pos)return{type:`image`,imageId:e,range:{tl:{nativeCol:0,nativeColOff:0,nativeRow:0,nativeRowOff:0},ext:t.ext,pos:t.pos},hyperlinks:t.hyperlinks};let n=t;return{type:`image`,imageId:e,range:{tl:new Rp(this,n.tl,0).model,br:n.br?new Rp(this,n.br,0).model:void 0,ext:n.ext,editAs:n.editAs},hyperlinks:n.hyperlinks}}async protect(e,t){this.sheetProtection={sheet:!0},this.sheetProtection=await cm(e,t)}unprotect(){this.sheetProtection=null}_write(e){q.reset(),q.addText(e),this.stream.write(q)}_writeSheetProperties(e,t,n){let r={outlineProperties:t&&t.outlineProperties,tabColor:t&&t.tabColor,pageSetup:n&&n.fitToPage?{fitToPage:n.fitToPage}:void 0};e.addText(J.sheetProperties.toXml(r))}_writeSheetFormatProperties(e,t){let n=t?{defaultRowHeight:t.defaultRowHeight,dyDescent:t.dyDescent,outlineLevelCol:t.outlineLevelCol,outlineLevelRow:t.outlineLevelRow}:void 0;t&&t.defaultColWidth&&(n.defaultColWidth=t.defaultColWidth),e.addText(J.sheetFormatProperties.toXml(n))}_writeOpenWorksheet(){q.reset(),q.addText(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>`),q.addText(`<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">`),this._writeSheetProperties(q,this.properties,this.pageSetup),q.addText(J.sheetViews.toXml(this.views)),this._writeSheetFormatProperties(q,this.properties),this.stream.write(q)}_writeColumns(){let e=gc.toModel(this.columns);e&&(J.columns.prepare(e,{styles:this._workbook.styles}),this.stream.write(J.columns.toXml(e)))}_writeOpenSheetData(){this._write(`<sheetData>`)}_writeRow(e){if(this.startedData||=(this._writeColumns(),this._writeOpenSheetData(),!0),e.hasValues||e.height!=null){let{model:t}=e;if(!t)return;let n={styles:this._workbook.styles,sharedStrings:this.useSharedStrings?this._workbook.sharedStrings:void 0,hyperlinks:this._sheetRelsWriter.hyperlinksProxy,merges:this._merges,formulae:this._formulae,siFormulae:this._siFormulae,comments:[]};if(J.row.prepare(t,n),this.stream.write(J.row.toXml(t)),t.cells)for(let e of t.cells)e&&e.isDynamicArray&&this._workbook.dynamicArrayCount++;n.comments.length&&(this.hasComments=!0,this._sheetCommentsWriter.addComments(n.comments))}}_writeCloseSheetData(){this._write(`</sheetData>`)}_writeMergeCells(){this._merges.length&&(q.reset(),q.addText(`<mergeCells count="${this._merges.length}">`),this._merges.forEach(e=>{q.addText(`<mergeCell ref="${e}"/>`)}),q.addText(`</mergeCells>`),this.stream.write(q))}_writeHyperlinks(){this.stream.write(J.hyperlinks.toXml(this._sheetRelsWriter._hyperlinks))}_writeConditionalFormatting(){let e={styles:this._workbook.styles};J.conditionalFormattings.prepare(this.conditionalFormatting,e);let t={conditionalFormattings:this.conditionalFormatting};J.extLst.prepare(t),this.stream.write(J.conditionalFormattings.toXml(this.conditionalFormatting))}_writeExtLst(){let e={conditionalFormattings:this.conditionalFormatting};this.stream.write(J.extLst.toXml(e))}_writeIgnoredErrors(){this.ignoredErrors.length>0&&this.stream.write(J.ignoredErrors.toXml(this.ignoredErrors))}_writeRowBreaks(){this.stream.write(J.rowBreaks.toXml(this.rowBreaks))}_writeColBreaks(){this.stream.write(J.colBreaks.toXml(this.colBreaks))}_writeDataValidations(){this.stream.write(J.dataValidations.toXml(this.dataValidations.model))}_writeSheetProtection(){this.stream.write(J.sheetProtection.toXml(this.sheetProtection))}_writePageMargins(){this.stream.write(J.pageMargins.toXml(this.pageSetup.margins))}_writePageSetup(){this.stream.write(J.pageSeteup.toXml(this.pageSetup))}_writeHeaderFooter(){this.stream.write(J.headerFooter.toXml(this.headerFooter))}_writeAutoFilter(){this.stream.write(J.autoFilter.toXml(this.autoFilter))}_writeDrawing(){if(this._media.length===0)return;for(let e of this._media)if(e._watermarkTag){let t=this._dimensions.model,n=t?Math.max(t.right??100,100):100,r=t?Math.max(t.bottom??200,200):200;e.range.br={nativeCol:n,nativeColOff:0,nativeRow:r,nativeRowOff:0}}let e=`drawing${this.id}`,t=this._sheetRelsWriter.addRelationship({Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing`,Target:md(e)}),{anchors:n,rels:r}=nm(this._media,[],{getBookImage:e=>this._workbook.getImage(Number(e)),nextRId:e=>`rId${e.length+1}`});this._drawing={rId:t,name:e,anchors:n,rels:r},this.stream.write(J.drawing.toXml({rId:t}))}get drawing(){return this._drawing}_writeBackground(){if(this._background){if(this._background.imageId!==void 0){let e=this._workbook.getImage(this._background.imageId);if(!e)return;let t=this._sheetRelsWriter.addMedia({Target:_d(e.name),Type:F.Image});this._background={...this._background,rId:t}}this.stream.write(J.picture.toXml({rId:this._background.rId}))}}_writeLegacyData(){this.hasComments&&(q.reset(),q.addText(`<legacyDrawing r:id="${this._sheetCommentsWriter.vmlRelId}"/>`),this.stream.write(q))}_writeDimensions(){}_writeCloseWorksheet(){this._write(`</worksheet>`)}};function wh(e){if(typeof e!=`object`||!e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(wh).join(`,`)}]`;let t=Object.keys(e).sort(),n=e;return`{${t.map(e=>`${JSON.stringify(e)}:${wh(n[e])}`).join(`,`)}}`}var Th=class{constructor(){this._values=[],this._totalRefs=0,this._hash=Object.create(null)}get count(){return this._values.length}get values(){return this._values}get totalRefs(){return this._totalRefs}getString(e){return this._values[e]}add(e){let t=typeof e==`string`?`s:${e}`:`r:${wh(e.richText)}`,n=this._hash[t];return n===void 0&&(n=this._hash[t]=this._values.length,this._values.push(e)),this._totalRefs++,n}};let Eh=new TextEncoder;var Dh=class{constructor(e){this._data=e}get length(){return this.toBuffer().length}copy(e,t,n,r){let i=this.toBuffer(),a=Math.min(r,i.length-n);return e.set(i.subarray(n,n+a),t),a}toBuffer(){return this._buffer||=Eh.encode(this._data),this._buffer}},Oh=class{constructor(e){this._data=e}get length(){return this._data.length}copy(e,t,n,r){let i=this.toBuffer(),a=Math.min(r,i.length-n);return e.set(i.subarray(n,n+a),t),a}toBuffer(){return this._data.toBuffer()}},kh=class{constructor(e){this._data=e}get length(){return this._data.length}copy(e,t,n,r){let i=Math.min(r,this._data.length-n);return e.set(this._data.subarray(n,n+i),t),i}toBuffer(){return this._data}},Ah=class{constructor(e){this.size=e,this.buffer=new Uint8Array(e),this.iRead=0,this.iWrite=0}toBuffer(){return this.iRead===0&&this.iWrite===this.size?this.buffer:this.buffer.subarray(this.iRead,this.iWrite)}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(e){if(e===0)return null;if(e===void 0||e>=this.length){let e=this.toBuffer();return this.iRead=this.iWrite,e}let t=this.buffer.subarray(this.iRead,this.iRead+e);return 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,r),this.iWrite+=r,r}};let jh=()=>{};var Mh=class extends D{constructor(e){super(),this._writableStreamWriter=null,this._asyncWriteQueue=Promise.resolve(),this.bufSize=e?.bufSize||1024*1024,this.buffers=[],this.batch=e?.batch??!1,this.corked=!1,this.paused=!1,this.encoding=null,this.pipes=[],this._ended=!1}get writable(){return!this._ended}toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:{let e=this.buffers.reduce((e,t)=>e+t.length,0),t=new Uint8Array(e),n=0;for(let e of this.buffers){let r=e.toBuffer();t.set(r,n),n+=r.length}return t}}}_getWritableBuffer(){if(this.buffers.length){let e=this.buffers[this.buffers.length-1];if(!e.full)return e}let e=new Ah(this.bufSize);return this.buffers.push(e),e}async _pipeChunk(e){let t=this.pipes.map(t=>new Promise(n=>{t.write(e.toBuffer(),()=>n())}));await Promise.all(t)}_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){typeof t==`function`&&(n=t),n||=jh;let r;if(e instanceof um||e&&e.constructor?.name===`StringBuf`)r=new Oh(e);else if(e instanceof Uint8Array)r=new kh(e);else if(ArrayBuffer.isView(e))r=new kh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));else if(e instanceof ArrayBuffer)r=new kh(new Uint8Array(e));else if(typeof e==`string`)r=new Dh(e);else throw new Ar(typeof e,`Chunk must be one of type String, Uint8Array, ArrayBuffer or StringBuf.`);if(this.pipes.length)if(this.batch)for(this._writeToBuffers(r);!this.corked&&this.buffers.length>1;){let e=this.buffers.shift();await this._pipeChunk(new kh(e.toBuffer()))}else this.corked?(this._writeToBuffers(r),queueMicrotask(()=>n())):(await this._pipeChunk(r),n());else{let e=r.toBuffer(),t=!1;!this.paused&&this.listenerCount(`data`)>0&&(this.emit(`data`,e),t=!0),this._writableStreamWriter&&(this._asyncWriteQueue=this._asyncWriteQueue.then(()=>this._writableStreamWriter.write(e)),t=!0),t||(this._writeToBuffers(r),this.emit(`readable`)),n()}return!0}cork(){this.corked=!0}_flush(){this.pipes.length&&(async()=>{for(;this.buffers.length;){let e=this.buffers.shift();await this._pipeChunk(new kh(e.toBuffer()))}})().catch(e=>this.emit(`error`,e))}uncork(){this.corked=!1,this._flush()}end(e,t,n){let r=e=>{if(e){n?.(e);return}this._ended=!0,this._flush(),this.pipes.forEach(e=>{typeof e.end==`function`&&e.end()}),this._writableStreamWriter?this._asyncWriteQueue.then(()=>this._writableStreamWriter.close()).then(()=>{this.emit(`finish`),this.emit(`close`)}).catch(e=>{this.emit(`error`,e)}):(this.emit(`finish`),this.emit(`close`))};e?this.write(e,t,r):r()}read(e){if(e){let t=[],n=e;for(;n&&this.buffers.length&&!this.buffers[0].eod;){let e=this.buffers[0],r=e.read(n);r&&(n-=r.length,t.push(r)),e.eod&&e.full&&this.buffers.shift()}return En(Nh(t))}let t=this.buffers.map(e=>e.toBuffer()).filter(Boolean);return this.buffers=[],En(Nh(t))}readString(e){let t=e??this.encoding??`utf-8`,n=this.read();return un(t).decode(n)}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}pipeTo(e){this._writableStreamWriter=e.getWriter()}unpipe(e){this.pipes=this.pipes.filter(t=>t!==e)}unshift(){throw new Mr(`unshift`,`Not implemented`)}wrap(){throw new Mr(`wrap`,`Not implemented`)}push(e){return e!==null&&this.write(e),!0}};function Nh(e){if(e.length===0)return new Uint8Array;if(e.length===1)return e[0];let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}async function Ph(e,t){let n={lockStructure:t?.lockStructure??!0,lockWindows:t?.lockWindows,lockRevision:t?.lockRevision};return e&&(n.algorithmName=`SHA-512`,n.saltValue=el(sm.randomBytes(16)),n.spinCount=t?.spinCount!=null&&Number.isFinite(t.spinCount)?Math.round(Math.max(0,t.spinCount)):1e5,n.hashValue=await sm.convertPasswordToHash(e,`SHA-512`,n.saltValue,n.spinCount)),n}var Fh=class extends U{render(e,t){e.openNode(`HeadingPairs`),e.openNode(`vt:vector`,{size:2,baseType:`variant`}),e.openNode(`vt:variant`),e.leafNode(`vt:lpstr`,void 0,`Worksheets`),e.closeNode(),e.openNode(`vt:variant`),e.leafNode(`vt:i4`,void 0,t.length),e.closeNode(),e.closeNode(),e.closeNode()}parseOpen(e){return e.name===`HeadingPairs`}parseText(){}parseClose(e){return e!==`HeadingPairs`}},Ih=class extends U{render(e,t){e.openNode(`TitlesOfParts`),e.openNode(`vt:vector`,{size:t.length,baseType:`lpstr`}),t.forEach(t=>{e.leafNode(`vt:lpstr`,void 0,t.name)}),e.closeNode(),e.closeNode()}parseOpen(e){return e.name===`TitlesOfParts`}parseText(){}parseClose(e){return e!==`TitlesOfParts`}},Lh=class e extends U{constructor(){super(),this.map={Company:new G({tag:`Company`}),Manager:new G({tag:`Manager`}),HeadingPairs:new Fh,TitlesOfParts:new Ih}}render(t,n){t.openXml(z),t.openNode(`Properties`,e.PROPERTY_ATTRIBUTES),t.leafNode(`Application`,void 0,`Microsoft Excel`),t.leafNode(`DocSecurity`,void 0,`0`),t.leafNode(`ScaleCrop`,void 0,`false`),this.map.HeadingPairs.render(t,n.worksheets),this.map.TitlesOfParts.render(t,n.worksheets),this.map.Company.render(t,n.company??``),this.map.Manager.render(t,n.manager),t.leafNode(`LinksUpToDate`,void 0,`false`),t.leafNode(`SharedDoc`,void 0,`false`),t.leafNode(`HyperlinksChanged`,void 0,`false`),t.leafNode(`AppVersion`,void 0,`16.0300`),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`Properties`:return!0;default:return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`Properties`:return this.model={worksheets:this.map.TitlesOfParts.model,company:this.map.Company.model,manager:this.map.Manager.model},!1;default:return!0}}static{this.DateFormat=function(e){return e.toISOString().replace(/[.]\d{3,6}/,``)}}static{this.DateAttrs={"xsi:type":`dcterms:W3CDTF`}}static{this.PROPERTY_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/officeDocument/2006/extended-properties`,"xmlns:vt":`http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes`}}},Rh=class e extends U{render(t,n){t.openXml(z),t.openNode(`Types`,e.PROPERTY_ATTRIBUTES);let r={};if((n.media??[]).forEach(e=>{if(e.type===`image`){let n=e.extension;r[n]||(r[n]=!0,t.leafNode(`Default`,{Extension:n,ContentType:`image/${n}`}))}}),t.leafNode(`Default`,{Extension:`rels`,ContentType:`application/vnd.openxmlformats-package.relationships+xml`}),t.leafNode(`Default`,{Extension:`xml`,ContentType:`application/xml`}),t.leafNode(`Override`,{PartName:H(V.xlWorkbook),ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml`}),n.worksheets.forEach(e=>{t.leafNode(`Override`,{PartName:H(Vu(e.fileIndex)),ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml`})}),(n.pivotTables??[]).length){let e=new Set;(n.pivotTables??[]).forEach(n=>{let r=n.tableNumber,i=n.cacheId;e.has(i)||(e.add(i),t.leafNode(`Override`,{PartName:H(Qu(r)),ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml`}),(!n.isLoaded||n.cacheRecords)&&t.leafNode(`Override`,{PartName:H(ed(r)),ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml`})),t.leafNode(`Override`,{PartName:H(nd(r)),ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml`})})}if(t.leafNode(`Override`,{PartName:H(V.xlTheme1),ContentType:`application/vnd.openxmlformats-officedocument.theme+xml`}),t.leafNode(`Override`,{PartName:H(V.xlStyles),ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml`}),n.externalLinks&&n.externalLinks.length>0)for(let e of n.externalLinks)t.leafNode(`Override`,{PartName:H(ad(e.index)),ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml`});n.hasCheckboxes&&t.leafNode(`Override`,{PartName:H(V.xlFeaturePropertyBag),ContentType:`application/vnd.ms-excel.featurepropertybag+xml`}),n.hasDynamicArrayFormulas&&t.leafNode(`Override`,{PartName:H(V.xlMetadata),ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml`}),n.sharedStrings&&n.sharedStrings.count&&t.leafNode(`Override`,{PartName:H(V.xlSharedStrings),ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml`}),n.tables&&n.tables.forEach(e=>{t.leafNode(`Override`,{PartName:H(Yu(e.target)),ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml`})}),n.drawings&&n.drawings.forEach(e=>{t.leafNode(`Override`,{PartName:H(Xu(e.name)),ContentType:`application/vnd.openxmlformats-officedocument.drawing+xml`})});let i=n.commentRefs&&n.commentRefs.length>0,a=n.formControlRefs&&n.formControlRefs.length>0,o=n.hasHeaderWatermark===!0;if((i||a||o)&&t.leafNode(`Default`,{Extension:`vml`,ContentType:`application/vnd.openxmlformats-officedocument.vmlDrawing`}),i&&n.commentRefs.forEach(({commentName:e})=>{t.leafNode(`Override`,{PartName:H(Gu(e)),ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml`})}),a)for(let e of n.formControlRefs)t.leafNode(`Override`,{PartName:H(vd(e)),ContentType:`application/vnd.ms-excel.controlproperties+xml`});if(n.passthroughContentTypes)for(let{partName:e,contentType:r}of n.passthroughContentTypes)t.leafNode(`Override`,{PartName:H(e),ContentType:r});t.leafNode(`Override`,{PartName:H(V.docPropsCore),ContentType:`application/vnd.openxmlformats-package.core-properties+xml`}),t.leafNode(`Override`,{PartName:H(V.docPropsApp),ContentType:`application/vnd.openxmlformats-officedocument.extended-properties+xml`}),t.closeNode()}parseOpen(){return!1}parseText(){}parseClose(){return!1}static{this.PROPERTY_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/package/2006/content-types`}}},zh=class extends U{constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this.text=[],this._format=e.format||function(e){try{return Number.isNaN(e.getTime())?``:e.toISOString()}catch{return``}},this._parse=e.parse||function(e){return new Date(e)}}render(e,t){t&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,this._format(t)):e.writeText(this._format(t)),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.attr?this.model=this._parse(e.attributes[this.attr]):this.text=[])}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=this._parse(this.text.join(``))),!1}};let Y={creator:`dc:creator`,title:`dc:title`,subject:`dc:subject`,description:`dc:description`,identifier:`dc:identifier`,language:`dc:language`,keywords:`cp:keywords`,category:`cp:category`,lastModifiedBy:`cp:lastModifiedBy`,lastPrinted:`cp:lastPrinted`,revision:`cp:revision`,version:`cp:version`,contentStatus:`cp:contentStatus`,contentType:`cp:contentType`,created:`dcterms:created`,modified:`dcterms:modified`};var Bh=class e extends U{constructor(){super(),this.map={creator:new G({tag:Y.creator}),title:new G({tag:Y.title}),subject:new G({tag:Y.subject}),description:new G({tag:Y.description}),identifier:new G({tag:Y.identifier}),language:new G({tag:Y.language}),keywords:new G({tag:Y.keywords}),category:new G({tag:Y.category}),lastModifiedBy:new G({tag:Y.lastModifiedBy}),lastPrinted:new zh({tag:Y.lastPrinted,format:e.DateFormat}),revision:new ef({tag:Y.revision}),version:new G({tag:Y.version}),contentStatus:new G({tag:Y.contentStatus}),contentType:new G({tag:Y.contentType}),created:new zh({tag:Y.created,attrs:e.DateAttrs,format:e.DateFormat}),modified:new zh({tag:Y.modified,attrs:e.DateAttrs,format:e.DateFormat})}}render(t,n){t.openXml(z),t.openNode(`cp:coreProperties`,e.CORE_PROPERTY_ATTRIBUTES);for(let e of Object.keys(Y))this.map[e].render(t,n[e]);t.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):(e.name!==`coreProperties`&&(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;if(e===`coreProperties`){this.model={};for(let e of Object.keys(Y)){let t=this.map[e].model;t!==void 0&&t!==``&&(this.model[e]=t)}return!1}return!0}static{this.DateFormat=function(e){return e.toISOString().replace(/[.]\d{3}/,``)}}static{this.DateAttrs={"xsi:type":`dcterms:W3CDTF`}}static{this.CORE_PROPERTY_ATTRIBUTES={"xmlns:cp":`http://schemas.openxmlformats.org/package/2006/metadata/core-properties`,"xmlns:dc":`http://purl.org/dc/elements/1.1/`,"xmlns:dcterms":`http://purl.org/dc/terms/`,"xmlns:dcmitype":`http://purl.org/dc/dcmitype/`,"xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`}}},Vh=class extends U{render(e){e.openXml({version:`1.0`,encoding:`UTF-8`,standalone:`yes`}),e.openNode(`FeaturePropertyBags`,{xmlns:`http://schemas.microsoft.com/office/spreadsheetml/2022/featurepropertybag`}),e.leafNode(`bag`,{type:`Checkbox`}),e.openNode(`bag`,{type:`XFControls`}),e.leafNode(`bagId`,{k:`CellControl`},`0`),e.closeNode(),e.openNode(`bag`,{type:`XFComplement`}),e.leafNode(`bagId`,{k:`XFControls`},`1`),e.closeNode(),e.openNode(`bag`,{type:`XFComplements`,extRef:`XFComplementsMapperExtRef`}),e.openNode(`a`,{k:`MappedFeaturePropertyBags`}),e.leafNode(`bagId`,{},`2`),e.closeNode(),e.closeNode(),e.closeNode()}parseOpen(){return!1}parseText(){}parseClose(){return!1}},Hh=class extends U{parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={range:{editAs:e.attributes.editAs??`oneCell`}};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}reconcilePicture(e,t){if(e&&e.rId){let n=t.rels[e.rId];if(!n)return;let r=n.Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(r){let n=r[1],i=t.mediaIndex[n],a=t.media[i];return a&&e.alphaModFix!==void 0?{...a,alphaModFix:e.alphaModFix}:a}}}};let Uh=9525;var Wh=class extends U{constructor(e){super(),this.tag=e.tag,this.map={},this.model={width:0,height:0}}render(e,t){e.openNode(this.tag);let n=Math.floor(t.width*Uh),r=Math.floor(t.height*Uh);e.addAttribute(`cx`,n),e.addAttribute(`cy`,r),e.closeNode()}parseOpen(e){return e.name===this.tag?(this.model={width:parseInt(e.attributes.cx??`0`,10)/Uh,height:parseInt(e.attributes.cy??`0`,10)/Uh},!0):!1}parseText(e){}parseClose(e){return!1}},Gh=class extends U{constructor(){super(),this.model={rId:``}}get tag(){return`a:blip`}render(e,t){t.alphaModFix!==void 0&&t.alphaModFix<1e5?(e.openNode(this.tag,{"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"r:embed":t.rId,cstate:`print`}),e.leafNode(`a:alphaModFix`,{amt:String(t.alphaModFix)}),e.closeNode()):e.leafNode(this.tag,{"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"r:embed":t.rId,cstate:`print`})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:embed`]},!0;case`a:alphaModFix`:return e.attributes.amt&&(this.model.alphaModFix=parseInt(e.attributes.amt,10)),!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}},Kh=class extends U{constructor(){super(),this.map={"a:blip":new Gh}}get tag(){return`xdr:blipFill`}render(e,t){e.openNode(this.tag),this.map[`a:blip`].render(e,t),e.openNode(`a:stretch`),e.leafNode(`a:fillRect`),e.closeNode(),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model=this.map[`a:blip`].model,!1;default:return!0}}},qh=class extends U{get tag(){return`xdr:cNvPicPr`}render(e){e.openNode(this.tag),e.leafNode(`a:picLocks`,{noChangeAspect:`1`}),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:return!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}},Jh=class extends U{get tag(){return`a:extLst`}render(e){e.openNode(this.tag),e.openNode(`a:ext`,{uri:`{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}`}),e.leafNode(`a16:creationId`,{"xmlns:a16":`http://schemas.microsoft.com/office/drawing/2014/main`,id:`{00000000-0008-0000-0000-000002000000}`}),e.closeNode(),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:return!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}},Yh=class extends U{constructor(){super(),this.model={}}get tag(){return`a:hlinkClick`}render(e,t){t.hyperlinks&&t.hyperlinks.rId&&e.leafNode(this.tag,{"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"r:id":t.hyperlinks.rId,tooltip:t.hyperlinks.tooltip})}parseOpen(e){switch(e.name){case this.tag:return this.model={hyperlinks:{rId:e.attributes[`r:id`],tooltip:e.attributes.tooltip}},!0;default:return!0}}parseText(){}parseClose(){return!1}},Xh=class extends U{constructor(){super(),this.map={"a:hlinkClick":new Yh,"a:extLst":new Jh}}get tag(){return`xdr:cNvPr`}render(e,t){e.openNode(this.tag,{id:t.index,name:`Picture ${t.index}`}),this.map[`a:hlinkClick`].render(e,t),this.map[`a:extLst`].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model=this.map[`a:hlinkClick`].model,!1;default:return!0}}},Zh=class extends U{constructor(){super(),this.map={"xdr:cNvPr":new Xh,"xdr:cNvPicPr":new qh}}get tag(){return`xdr:nvPicPr`}render(e,t){e.openNode(this.tag),this.map[`xdr:cNvPr`].render(e,t),this.map[`xdr:cNvPicPr`].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model=this.map[`xdr:cNvPr`].model,!1;default:return!0}}};let Qh={tag:`xdr:spPr`,c:[{tag:`a:xfrm`,c:[{tag:`a:off`,$:{x:`0`,y:`0`}},{tag:`a:ext`,$:{cx:`0`,cy:`0`}}]},{tag:`a:prstGeom`,$:{prst:`rect`},c:[{tag:`a:avLst`}]}]};var $h=class extends U{constructor(){super(),this.map={"xdr:nvPicPr":new Zh,"xdr:blipFill":new Kh,"xdr:spPr":new Ld(Qh)}}get tag(){return`xdr:pic`}prepare(e,t){e.index=t.index+1}render(e,t){e.openNode(this.tag),this.map[`xdr:nvPicPr`].render(e,t),this.map[`xdr:blipFill`].render(e,{rId:t.rId,alphaModFix:t.alphaModFix}),this.map[`xdr:spPr`].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.mergeModel(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}};let eg=9525;var tg=class extends U{constructor(){super(),this.map={},this.model={x:0,y:0}}get tag(){return`xdr:pos`}render(e,t){e.leafNode(this.tag,{x:Math.floor(t.x*eg),y:Math.floor(t.y*eg)})}parseOpen(e){return e.name===this.tag?(this.model={x:parseInt(e.attributes.x??`0`,10)/eg,y:parseInt(e.attributes.y??`0`,10)/eg},!0):!1}parseText(){}parseClose(){return!1}},ng=class extends Hh{constructor(){super(),this.map={"xdr:pos":new tg,"xdr:ext":new Wh({tag:`xdr:ext`}),"xdr:pic":new $h,"xdr:clientData":new Ld({tag:`xdr:clientData`})}}get tag(){return`xdr:absoluteAnchor`}prepare(e,t){e.picture&&this.map[`xdr:pic`].prepare(e.picture,t)}render(e,t){e.openNode(this.tag),this.map[`xdr:pos`].render(e,t.range.pos??{x:0,y:0}),this.map[`xdr:ext`].render(e,t.range.ext),t.picture&&this.map[`xdr:pic`].render(e,t.picture),this.map[`xdr:clientData`].render(e,{}),e.closeNode()}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.range.pos=this.map[`xdr:pos`].model,this.model.range.ext=this.map[`xdr:ext`].model,this.model.picture=this.map[`xdr:pic`].model,!1;default:return!0}}reconcile(e,t){e.medium=this.reconcilePicture(e.picture,t)}},rg=class extends U{constructor(e){super(),this.tag=e.tag,this.map={"xdr:col":new ef({tag:`xdr:col`,zero:!0}),"xdr:colOff":new ef({tag:`xdr:colOff`,zero:!0}),"xdr:row":new ef({tag:`xdr:row`,zero:!0}),"xdr:rowOff":new ef({tag:`xdr:rowOff`,zero:!0})},this.model={nativeCol:0,nativeColOff:0,nativeRow:0,nativeRowOff:0}}render(e,t){e.openNode(this.tag),this.map[`xdr:col`].render(e,t.nativeCol),this.map[`xdr:colOff`].render(e,t.nativeColOff),this.map[`xdr:row`].render(e,t.nativeRow),this.map[`xdr:rowOff`].render(e,t.nativeRowOff),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model={nativeCol:this.map[`xdr:col`].model,nativeColOff:this.map[`xdr:colOff`].model,nativeRow:this.map[`xdr:row`].model,nativeRowOff:this.map[`xdr:rowOff`].model},!1;default:return!0}}},ig=class extends Hh{constructor(){super(),this.map={"xdr:from":new rg({tag:`xdr:from`}),"xdr:ext":new Wh({tag:`xdr:ext`}),"xdr:pic":new $h,"xdr:clientData":new Ld({tag:`xdr:clientData`})}}get tag(){return`xdr:oneCellAnchor`}prepare(e,t){this.map[`xdr:pic`].prepare(e.picture,t)}render(e,t){e.openNode(this.tag,{editAs:t.range.editAs??`oneCell`}),this.map[`xdr:from`].render(e,t.range.tl),this.map[`xdr:ext`].render(e,t.range.ext),this.map[`xdr:pic`].render(e,t.picture),this.map[`xdr:clientData`].render(e,{}),e.closeNode()}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.range.tl=this.map[`xdr:from`].model,this.model.range.ext=this.map[`xdr:ext`].model,this.model.picture=this.map[`xdr:pic`].model,!1;default:return!0}}reconcile(e,t){e.medium=this.reconcilePicture(e.picture,t)}},ag=class extends U{get tag(){return`xdr:sp`}render(e,t){t&&(e.openNode(this.tag,{macro:``,textlink:``}),e.openNode(`xdr:nvSpPr`),e.openNode(`xdr:cNvPr`,{id:t.cNvPrId,name:t.name,hidden:t.hidden?`1`:void 0}),e.openNode(`a:extLst`),e.openNode(`a:ext`,{uri:`{63B3BB69-23CF-44E3-9099-C40C66FF867C}`}),e.leafNode(`a14:compatExt`,{spid:t.spid,"xmlns:a14":`http://schemas.microsoft.com/office/drawing/2010/main`},void 0),e.closeNode(),e.closeNode(),e.closeNode(),e.leafNode(`xdr:cNvSpPr`),e.closeNode(),e.openNode(`xdr:spPr`,{bwMode:`auto`}),e.openNode(`a:xfrm`),e.leafNode(`a:off`,{x:0,y:0}),e.leafNode(`a:ext`,{cx:0,cy:0}),e.closeNode(),e.openNode(`a:prstGeom`,{prst:`rect`}),e.leafNode(`a:avLst`),e.closeNode(),e.leafNode(`a:noFill`),e.openNode(`a:ln`),e.leafNode(`a:noFill`),e.closeNode(),e.openNode(`a:extLst`),e.openNode(`a:ext`,{uri:`{909E8E84-426E-40DD-AFC4-6F175D3DCCD1}`}),e.openNode(`a14:hiddenFill`,{"xmlns:a14":`http://schemas.microsoft.com/office/drawing/2010/main`}),e.openNode(`a:solidFill`),e.leafNode(`a:srgbClr`,{val:`F0F0F0`}),e.closeNode(),e.closeNode(),e.closeNode(),e.openNode(`a:ext`,{uri:`{91240B29-F687-4F45-9708-019B960494DF}`}),e.openNode(`a14:hiddenLine`,{w:9525,"xmlns:a14":`http://schemas.microsoft.com/office/drawing/2010/main`}),e.openNode(`a:solidFill`),e.leafNode(`a:srgbClr`,{val:`000000`}),e.closeNode(),e.leafNode(`a:miter`,{lim:8e5}),e.leafNode(`a:headEnd`),e.leafNode(`a:tailEnd`),e.closeNode(),e.closeNode(),e.closeNode(),e.closeNode(),e.openNode(`xdr:txBody`),e.leafNode(`a:bodyPr`,{vertOverflow:`clip`,wrap:`square`,lIns:18288,tIns:18288,rIns:0,bIns:18288,anchor:`ctr`,upright:1}),e.leafNode(`a:lstStyle`),e.openNode(`a:p`),e.openNode(`a:pPr`,{algn:`l`,rtl:0}),e.leafNode(`a:defRPr`,{sz:1e3}),e.closeNode(),e.openNode(`a:r`),e.openNode(`a:rPr`,{lang:`en-US`,sz:800,b:0,i:0,u:`none`,strike:`noStrike`,baseline:0}),e.openNode(`a:solidFill`),e.leafNode(`a:srgbClr`,{val:`000000`}),e.closeNode(),e.leafNode(`a:latin`,{typeface:`Tahoma`,pitchFamily:2,charset:0}),e.leafNode(`a:ea`,{typeface:`Tahoma`,pitchFamily:2,charset:0}),e.leafNode(`a:cs`,{typeface:`Tahoma`,pitchFamily:2,charset:0}),e.closeNode(),e.openNode(`a:t`),e.writeText(t.text??``),e.closeNode(),e.closeNode(),e.closeNode(),e.closeNode(),e.closeNode())}},og=class extends Hh{constructor(){super(),this.map={"xdr:from":new rg({tag:`xdr:from`}),"xdr:to":new rg({tag:`xdr:to`}),"xdr:pic":new $h,"xdr:sp":new ag,"xdr:clientData":new Ld({tag:`xdr:clientData`})}}get tag(){return`xdr:twoCellAnchor`}prepare(e,t){e.picture&&this.map[`xdr:pic`].prepare(e.picture,t)}render(e,t){let n=!!t.alternateContent;n&&(e.openNode(`mc:AlternateContent`,{"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`}),e.openNode(`mc:Choice`,{Requires:t.alternateContent?.requires,...t.alternateContent?.requires===`a14`?{"xmlns:a14":`http://schemas.microsoft.com/office/drawing/2010/main`}:{}})),e.openNode(this.tag,{editAs:t.range.editAs??`oneCell`}),this.map[`xdr:from`].render(e,t.range.tl),this.map[`xdr:to`].render(e,t.range.br),t.picture?this.map[`xdr:pic`].render(e,t.picture):t.shape&&this.map[`xdr:sp`].render(e,t.shape),this.map[`xdr:clientData`].render(e,{}),e.closeNode(),n&&(e.closeNode(),e.leafNode(`mc:Fallback`),e.closeNode())}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.range.tl=this.map[`xdr:from`].model,this.model.range.br=this.map[`xdr:to`].model,this.model.picture=this.map[`xdr:pic`].model,!1;default:return!0}}reconcile(e,t){e.medium=this.reconcilePicture(e.picture,t)}};function sg(e){let t=typeof e.range==`string`?M.decode(e.range):e.range;return t.pos===void 0?t.br?`xdr:twoCellAnchor`:`xdr:oneCellAnchor`:`xdr:absoluteAnchor`}var cg=class e extends U{constructor(){super(),this.map={"xdr:twoCellAnchor":new og,"xdr:oneCellAnchor":new ig,"xdr:absoluteAnchor":new ng},this.model={anchors:[]}}prepare(e){e.anchors.forEach((e,t)=>{e.anchorType=sg(e),this.map[e.anchorType].prepare(e,{index:t})})}get tag(){return`xdr:wsDr`}render(t,n){let r=n||this.model;t.openXml(z),t.openNode(this.tag,e.DRAWING_ATTRIBUTES),r.anchors.forEach(e=>{this.map[e.anchorType].render(t,e)}),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={anchors:[]};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.anchors.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}reconcile(e,t){e.anchors.forEach(e=>{e.range?.pos===void 0?e.br?this.map[`xdr:twoCellAnchor`].reconcile(e,t):this.map[`xdr:oneCellAnchor`].reconcile(e,t):this.map[`xdr:absoluteAnchor`].reconcile(e,t)})}static{this.DRAWING_ATTRIBUTES={"xmlns:xdr":`http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing`,"xmlns:a":`http://schemas.openxmlformats.org/drawingml/2006/main`}}},lg=class extends U{constructor(){super(),this.map={r:new Vp,t:new Bp}}get tag(){return`rPh`}render(e,t){if(e.openNode(this.tag,{sb:t.sb??0,eb:t.eb??0}),t&&Object.prototype.hasOwnProperty.call(t,`richText`)&&t.richText){let{r:n}=this.map;t.richText.forEach(t=>{n.render(e,t)})}else t&&this.map.t.render(e,t.text);e.closeNode()}parseOpen(e){let{name:t}=e;return this.parser?(this.parser.parseOpen(e),!0):t===this.tag?(this.model={sb:parseInt(e.attributes.sb,10),eb:parseInt(e.attributes.eb,10)},!0):(this.parser=this.map[t],this.parser?(this.parser.parseOpen(e),!0):!1)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){switch(e){case`r`:{let e=this.model.richText;e||=this.model.richText=[],e.push(this.parser.model);break}case`t`:this.model.text=this.parser.model;break;default:break}this.parser=void 0}return!0}switch(e){case this.tag:return!1;default:return!0}}},ug=class extends U{constructor(e){super(),this.model=e,this.map={r:new Vp,t:new Bp,rPh:new lg}}get tag(){return`si`}render(e,t){e.openNode(this.tag),t&&typeof t==`object`&&Object.prototype.hasOwnProperty.call(t,`richText`)&&t.richText?t.richText.length?t.richText.forEach(t=>{this.map.r.render(e,t)}):this.map.t.render(e,``):t!=null&&this.map.t.render(e,t),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.model={},!0):(this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){switch(e){case`r`:{let e=this.model.richText;e||=this.model.richText=[],e.push(this.parser.model);break}case`t`:this.model=this.parser.model;break;default:break}this.parser=void 0}return!0}switch(e){case this.tag:return!1;default:return!0}}},dg=class extends U{constructor(e){super(),this.model=e||{values:[],count:0},this.hash=Object.create(null),this.rich=Object.create(null)}get sharedStringXform(){return this._sharedStringXform||=new ug}get values(){return this.model.values}get uniqueCount(){return this.model.values.length}get count(){return this.model.count}getString(e){return this.model.values[e]}add(e){return e.richText?this.addRichText(e):this.addText(e)}addText(e){let t=this.hash[e];return t===void 0&&(t=this.hash[e]=this.model.values.length,this.model.values.push(e)),this.model.count++,t}addRichText(e){let t=this.sharedStringXform.toXml(e),n=this.rich[t];return n===void 0&&(n=this.rich[t]=this.model.values.length,this.model.values.push(e)),this.model.count++,n}render(e,t){let n=t||this._values;e.openXml(z),e.openNode(`sst`,{xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,count:n.count,uniqueCount:n.values.length});let r=this.sharedStringXform;n.values.forEach(t=>{r.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`sst`:return!0;case`si`:return this.parser=this.sharedStringXform,this.parser.parseOpen(e),!0;default:throw new jr(`sharedStrings`,`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.values.push(this.parser.model),this.model.count++,this.parser=void 0),!0;switch(e){case`sst`:return!1;default:throw new jr(`sharedStrings`,`Unexpected xml node in parseClose: ${e}`)}}};let fg=new Uint8Array,pg=new TextDecoder;var mg=class{constructor(e,t){this.WorksheetWriterClass=t,this.created=e.created||new Date,this.modified=e.modified||this.created,this.creator=e.creator??`ExcelTS`,this.lastModifiedBy=e.lastModifiedBy??`ExcelTS`,this.lastPrinted=e.lastPrinted,this.useSharedStrings=e.useSharedStrings??!1,this.sharedStrings=new Th,this.styles=e.useStyles?new pf(!0):new pf.Mock(!0),this._definedNames=new $r,this._worksheets=[],this.views=[],this.zipOptions=e.zip;let n=e.zip?.zlib?.level??e.zip?.compressionOptions?.level??6;this.compressionLevel=Math.max(0,Math.min(9,n)),this.media=[],this.commentRefs=[],this.dynamicArrayCount=0,this._trueStreaming=e.trueStreaming??!1,this.zip=new Fp((e,t,n)=>{e?this.stream.emit(`error`,e):(this.stream.write(t),n&&this.stream.end())}),this.stream=this._createOutputStream(e),this.promise=Promise.resolve()}_createOutputStream(e){return e.stream?tr(e.stream):new Mh}get definedNames(){return this._definedNames}get defaultFont(){return this.styles.defaultFont}set defaultFont(e){this.styles.setDefaultFont&&this.styles.setDefaultFont(e)}_openStream(e){let t=new Mh({bufSize:this._trueStreaming?4096:65536,batch:!this._trueStreaming}),n=new Pp(e,{level:this.compressionLevel});this.zip.add(n);let r=e=>n.push(e);return t.on(`data`,r),t.once(`finish`,()=>{t.removeListener(`data`,r),n.push(fg,!0),t.emit(`zipped`)}),t}_addFile(e,t,n){let r=new Pp(t,{level:this.compressionLevel});this.zip.add(r);let i;i=n?kc(typeof e==`string`?e:pg.decode(e)):typeof e==`string`?Cn(e):e,r.push(i,!0)}_commitWorksheets(){let e=this._worksheets.map(e=>e.committed?Promise.resolve():new Promise(t=>{e.stream.once(`zipped`,()=>t()),e.commit()}));return e.length?Promise.all(e).then(()=>{}):Promise.resolve()}async commit(){await this.promise,await this._commitWorksheets(),await this.addMedia(),this.addDrawings(),await Promise.all([this.addThemes(),this.addOfficeRels(),this.addContentTypes(),this.addApp(),this.addCore(),this.addSharedStrings(),this.addStyles(),this.addFeaturePropertyBag(),this.addMetadata(),this.addWorkbookRels()]),await this.addWorkbook(),await this._finalize()}get nextId(){for(let e=1;e<this._worksheets.length;e++)if(!this._worksheets[e])return e;return this._worksheets.length||1}addImage(e){let t=this.media.length,n={...e,type:`image`,name:`image${t}.${e.extension}`};return this.media.push(n),t}getImage(e){return this.media[e]}async protect(e,t){this.protection=await Ph(e,t)}unprotect(){this.protection=void 0}addWorksheet(e,t){let n=t||{},r=n.useSharedStrings===void 0?this.useSharedStrings:n.useSharedStrings;n.tabColor&&(console.trace(`tabColor option has moved to { properties: tabColor: {...} }`),n.properties={tabColor:n.tabColor,...n.properties});let i=this.nextId;e??=`sheet${i}`;let a=new this.WorksheetWriterClass({id:i,name:e,workbook:this,useSharedStrings:r,properties:n.properties,state:n.state,pageSetup:n.pageSetup,views:n.views,autoFilter:n.autoFilter,headerFooter:n.headerFooter});return this._worksheets[i]=a,a}getWorksheet(e){if(e===void 0)return this._worksheets.find(()=>!0);if(typeof e==`number`)return this._worksheets[e];if(typeof e==`string`){let t=e.toLowerCase();return this._worksheets.find(e=>e?.name?.toLowerCase()===t)}}addStyles(){return new Promise(e=>{this._addFile(this.styles.xml,V.xlStyles),e()})}addThemes(){return new Promise(e=>{this._addFile(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
405
|
-
<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> </a:lnStyleLst> <a:effectStyleLst> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="38000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> <a:scene3d> <a:camera prst="orthographicFront"> <a:rot lat="0" lon="0" rev="0"/> </a:camera> <a:lightRig rig="threePt" dir="t"> <a:rot lat="0" lon="0" rev="1200000"/> </a:lightRig> </a:scene3d> <a:sp3d> <a:bevelT w="63500" h="25400"/> </a:sp3d> </a:effectStyle> </a:effectStyleLst> <a:bgFillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="40000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="40000"> <a:schemeClr val="phClr"> <a:tint val="45000"/> <a:shade val="99000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="20000"/> <a:satMod val="255000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="-80000" r="50000" b="180000"/> </a:path> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="80000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="30000"/> <a:satMod val="200000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="50000" r="50000" b="50000"/> </a:path> </a:gradFill> </a:bgFillStyleLst> </a:fmtScheme> </a:themeElements> <a:objectDefaults> <a:spDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="1"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="3"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="2"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="lt1"/> </a:fontRef> </a:style> </a:spDef> <a:lnDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="2"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="0"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="1"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="tx1"/> </a:fontRef> </a:style> </a:lnDef> </a:objectDefaults> <a:extraClrSchemeLst/> </a:theme>`,V.xlTheme1),e()})}addOfficeRels(){return new Promise(e=>{let t=new Vd().toXml([{Id:`rId1`,Type:F.OfficeDocument,Target:V.xlWorkbook},{Id:`rId2`,Type:F.CoreProperties,Target:V.docPropsCore},{Id:`rId3`,Type:F.ExtenderProperties,Target:V.docPropsApp}]);this._addFile(t,V.rootRels),e()})}addContentTypes(){return new Promise(e=>{let t=this._worksheets.filter(Boolean);t.forEach(e=>{e.fileIndex=e.id});let n=t.filter(e=>e.drawing).map(e=>e.drawing),r={worksheets:t,sharedStrings:this.sharedStrings,commentRefs:this.commentRefs,media:this.media,drawings:n,hasCheckboxes:this.styles.hasCheckboxes,hasDynamicArrayFormulas:this.dynamicArrayCount>0},i=new Rh;this._addFile(i.toXml(r),V.contentTypes),e()})}addMedia(){return Promise.all(this.media.map(async e=>{if(e.type===`image`){let t=Bu(e.name);if(e.buffer){this._addFile(e.buffer,t);return}if(e.base64){let n=e.base64.substring(e.base64.indexOf(`,`)+1);this._addFile(n,t,!0);return}if(e.filename)throw new Mr(`Loading images from filename`,`not supported in browser. Use buffer or base64.`)}throw new Rr(`Unsupported media`)}))}addDrawings(){let e=new cg,t=new Vd;for(let n of this._worksheets){if(!n?.drawing)continue;let{drawing:r}=n,i=rm(r.anchors),a={...r,anchors:i};e.prepare(a);let o=e.toXml(a);this._addFile(o,Xu(r.name));let s=t.toXml(r.rels);this._addFile(s,Zu(r.name))}}addApp(){return new Promise(e=>{let t=new Lh;this._addFile(t.toXml({worksheets:this._worksheets.filter(Boolean)}),V.docPropsApp),e()})}addCore(){return new Promise(e=>{let t=new Bh;this._addFile(t.toXml(this),V.docPropsCore),e()})}addSharedStrings(){return this.sharedStrings.count?new Promise(e=>{let t=new dg;this._addFile(t.toXml(this.sharedStrings),V.xlSharedStrings),e()}):Promise.resolve()}addFeaturePropertyBag(){if(this.styles.hasCheckboxes){let e=new Vh;this._addFile(e.toXml({}),V.xlFeaturePropertyBag)}return Promise.resolve()}addMetadata(){if(this.dynamicArrayCount<=0)return Promise.resolve();let e=new zd;return this._addFile(e.toXml({dynamicArrayCount:this.dynamicArrayCount}),V.xlMetadata),Promise.resolve()}addWorkbookRels(){let e=1,t=[{Id:`rId${e++}`,Type:F.Styles,Target:ld.workbookStyles},{Id:`rId${e++}`,Type:F.Theme,Target:ld.workbookTheme1}];return this.sharedStrings.count&&t.push({Id:`rId${e++}`,Type:F.SharedStrings,Target:ld.workbookSharedStrings}),this.styles.hasCheckboxes&&t.push({Id:`rId${e++}`,Type:F.FeaturePropertyBag,Target:ld.workbookFeaturePropertyBag}),this.dynamicArrayCount>0&&t.push({Id:`rId${e++}`,Type:F.SheetMetadata,Target:ld.workbookMetadata}),this._worksheets.forEach(n=>{n&&(n.rId=`rId${e++}`,t.push({Id:n.rId,Type:F.Worksheet,Target:Uu(n.id)}))}),new Promise(e=>{let n=new Vd;this._addFile(n.toXml(t),V.xlWorkbookRels),e()})}addWorkbook(){let e={worksheets:this._worksheets.filter(Boolean),definedNames:this._definedNames.model,views:this.views,properties:{},protection:this.protection,calcProperties:{}};return new Promise(t=>{let n=new Rd;n.prepare(e),this._addFile(n.toXml(e),V.xlWorkbook),t()})}_finalize(){return new Promise((e,t)=>{let n=()=>{this.stream.removeListener(`close`,i),this.stream.removeListener(`error`,r)},r=e=>{n(),t(e)},i=()=>{n(),e(this)};this.stream.once(`error`,r),this.stream.once(`close`,i),this.zip.end()})}},hg=class extends mg{constructor(e={}){super(e,Ch)}};let gg=9525,_g=12700,vg=142875,yg=28575,bg=276225,xg=190500;var Sg=class e{constructor(e,t,n){this.worksheet=e;let{tl:r,br:i}=this._parseRange(t),a=1025+(e.formControls?.length??0),o;n?.link&&(o=this._toAbsoluteRef(n.link)),this.model={shapeId:a,ctrlPropId:0,tl:r,br:i,link:o,checked:n?.checked?`Checked`:`Unchecked`,text:n?.text??``,noThreeD:n?.noThreeD??!0,print:n?.print??!1}}get checked(){return this.model.checked===`Checked`}set checked(e){this.model.checked=e?`Checked`:`Unchecked`}get link(){return this.model.link}set link(e){this.model.link=e?this._toAbsoluteRef(e):void 0}get text(){return this.model.text}set text(e){this.model.text=e}_toAbsoluteRef(e){if(e.includes(`$`))return e;let t=M.decodeAddress(e);return`$${M.n2l(t.col)}$${t.row}`}_parseRange(e){let t,n;if(typeof e==`string`)if(e.includes(`:`)){let r=M.decode(e);if(`top`in r)if(r.left===r.right&&r.top===r.bottom){let e=r.left-1,i=r.top-1;t={col:e,colOff:vg,row:i,rowOff:yg},n={col:e+2,colOff:bg,row:i+1,rowOff:xg}}else t={col:r.left-1,colOff:vg,row:r.top-1,rowOff:yg},n={col:r.right-1,colOff:bg,row:r.bottom-1,rowOff:xg};else t={col:r.col-1,colOff:vg,row:r.row-1,rowOff:yg},n={col:r.col+1,colOff:bg,row:r.row,rowOff:xg}}else{let r=M.decodeAddress(e);t={col:r.col-1,colOff:vg,row:r.row-1,rowOff:yg},n={col:r.col+1,colOff:bg,row:r.row,rowOff:xg}}else if(`startCol`in e)t={col:e.startCol,colOff:e.startColOff??vg,row:e.startRow,rowOff:e.startRowOff??yg},n={col:e.endCol,colOff:e.endColOff??bg,row:e.endRow,rowOff:e.endRowOff??xg};else{if(typeof e.tl==`string`){let n=M.decodeAddress(e.tl);t={col:n.col-1,colOff:vg,row:n.row-1,rowOff:yg}}else t={col:e.tl.col,colOff:e.tl.colOff??vg,row:e.tl.row,rowOff:e.tl.rowOff??yg};if(e.br)if(typeof e.br==`string`){let t=M.decodeAddress(e.br);n={col:t.col-1,colOff:bg,row:t.row-1,rowOff:xg}}else n={col:e.br.col,colOff:e.br.colOff??bg,row:e.br.row,rowOff:e.br.rowOff??xg};else n={col:t.col+2,colOff:bg,row:t.row+1,rowOff:xg}}return{tl:t,br:n}}getVmlAnchor(){return e.getVmlAnchor(this.model)}getVmlStyle(){return e.getVmlStyle(this.model)}getVmlCheckedValue(){return e.getVmlCheckedValue(this.model)}static getVmlAnchor(e){let{tl:t,br:n}=e,r=Math.round(t.colOff/gg),i=Math.round(t.rowOff/gg),a=Math.round(n.colOff/gg),o=Math.round(n.rowOff/gg);return`${t.col}, ${r}, ${t.row}, ${i}, ${n.col}, ${a}, ${n.row}, ${o}`}static getVmlStyle(e){return`position:absolute;margin-left:${Math.round(e.tl.colOff/_g)}pt;margin-top:${Math.round(e.tl.rowOff/_g)}pt;width:96pt;height:18pt;z-index:1;visibility:visible`}static getVmlCheckedValue(e){switch(e.checked){case`Checked`:return 1;case`Mixed`:return 2;default:return 0}}},Cg=class e{constructor(e,t){this.worksheet=e,t&&(this.model=t)}get model(){switch(this.type){case`background`:return{type:this.type,imageId:this.imageId??``};case`watermark`:return{type:this.type,imageId:this.imageId??``,opacity:this.opacity};case`headerImage`:return{type:this.type,imageId:this.imageId??``,headerWidth:this.headerWidth,headerHeight:this.headerHeight,applyTo:this.applyTo};case`image`:{let e=this.range;if(!e)throw new Rr(`Image has no range`);return e.pos?{type:this.type,imageId:this.imageId??``,hyperlinks:e.hyperlinks,range:{tl:{nativeCol:0,nativeColOff:0,nativeRow:0,nativeRowOff:0},ext:e.ext,pos:e.pos}}:{type:this.type,imageId:this.imageId??``,hyperlinks:e.hyperlinks,range:{tl:e.tl.model,br:e.br?.model,ext:e.ext,editAs:e.editAs}}}default:throw new Rr(`Invalid Image Type`)}}set model({type:e,imageId:t,range:n,hyperlinks:r,opacity:i,headerWidth:a,headerHeight:o,applyTo:s}){if(this.type=e,this.imageId=t,this.opacity=i,this.headerWidth=a,this.headerHeight=o,this.applyTo=s,e===`image`)if(typeof n==`string`){let e=M.decode(n);`top`in e&&(this.range={tl:new Rp(this.worksheet,{col:e.left,row:e.top},-1),br:new Rp(this.worksheet,{col:e.right,row:e.bottom},0),editAs:`oneCell`})}else n&&`pos`in n&&n.pos?this.range={tl:new Rp(this.worksheet,null,0),ext:n.ext,hyperlinks:r||(`hyperlinks`in n?n.hyperlinks:void 0),pos:n.pos}:n&&(this.range={tl:new Rp(this.worksheet,n.tl,0),br:n.br?new Rp(this.worksheet,n.br,0):void 0,ext:n.ext,editAs:n.editAs,hyperlinks:r||(`hyperlinks`in n?n.hyperlinks:void 0)})}clone(t){let n=t??this.worksheet,r=new e(n);return r.type=this.type,r.imageId=this.imageId,r.opacity=this.opacity,r.headerWidth=this.headerWidth,r.headerHeight=this.headerHeight,r.applyTo=this.applyTo,this.range&&(r.range={tl:this.range.tl.clone(n),br:this.range.br?this.range.br.clone(n):void 0,ext:this.range.ext?{...this.range.ext}:void 0,editAs:this.range.editAs,hyperlinks:this.range.hyperlinks?{...this.range.hyperlinks}:void 0,pos:this.range.pos?{...this.range.pos}:void 0}),r}},wg=class{constructor(e){this.code=e}toString(){return`#${this.code}`}};let Tg={sum:`Sum`,count:`Count`,average:`Average`,max:`Max`,min:`Min`,product:`Product`,countNums:`Count Numbers`,stdDev:`StdDev`,stdDevP:`StdDevP`,var:`Var`,varP:`VarP`},Eg=new Set(Object.keys(Tg));function Dg(e){let t=e.model;if(t.headerRow===!1)throw new Ir(`Cannot create pivot table from a table without headers. Set headerRow: true on the table.`);if(!t.rows||t.rows.length===0)throw new Ir(`Cannot create pivot table from an empty table. Add data rows to the table.`);let n=t.columns.map(e=>e.name),r=new Set;for(let e of n){if(r.has(e))throw new Ir(`Duplicate column name "${e}" found in table. Pivot tables require unique column names.`);r.add(e)}let i=[void 0,...n],a=t.rows.map(e=>[void 0,...e]),o=t.tl;if(!o)throw Error(`Table "${t.name}" is missing top-left cell address (tl)`);let s=o.row,c=o.col,l=s+t.rows.length,u=c+n.length-1,d=M.encode(s,c,l,u);return{name:e.worksheet.name,tableName:t.name,getRow(e){if(e===1)return{values:i};let t=e-2;return t>=0&&t<a.length?{values:a[t]}:{values:[]}},getColumn(e){if(e<1||e>n.length)return{values:[]};let r=[];r[1]=n[e-1];for(let n=0;n<t.rows.length;n++)r[n+2]=t.rows[n][e-1];return{values:r}},getSheetValues(){let e=[];e[1]=i;for(let t=0;t<a.length;t++)e[t+2]=a[t];return e},dimensions:{shortRange:d}}}function Og(e){if(e.sourceSheet&&e.sourceTable)throw new Ir(`Cannot specify both sourceSheet and sourceTable. Choose one.`);if(e.sourceTable)return Dg(e.sourceTable);if(!e.sourceSheet)throw Error(`Either sourceSheet or sourceTable must be provided.`);return e.sourceSheet}function kg(e){return typeof e==`string`?e:e.name}function Ag(e){return typeof e==`string`?void 0:e.metric}function jg(e,t){let n=Og(t);Mg(t,n);let{rows:r}=t,i=t.columns??[],a=t.pages??[],o=t.values.map(kg),s=t.metric??`sum`,c=t.values.map(e=>Ag(e)??s),l=Pg(n,[...r,...i,...a],o),u={};for(let e=0;e<l.length;e++)u[l[e].name]=e;let d=(e,t)=>{let n=u[e];if(n===void 0)throw Error(`${t} field "${e}" not found in cache fields`);return n},f=r.map(e=>d(e,`Row`)),p=i.map(e=>d(e,`Column`)),m=o.map(e=>d(e,`Value`)),h=a.map(e=>d(e,`Page`)),g=e.workbook.pivotTables.map(e=>e.tableNumber).filter(e=>Number.isFinite(e)),_=g.length>0?g.reduce((e,t)=>e>t?e:t,-1/0)+1:1,v=e.workbook.pivotTables.map(e=>parseInt(e.cacheId,10)).filter(e=>Number.isFinite(e)),y=v.length>0?v.reduce((e,t)=>e>t?e:t,-1/0)+1:10+_-1;return{source:n,rows:f,columns:p,values:m,pages:h,metric:s,valueMetrics:c,cacheFields:l,cacheId:String(y),applyWidthHeightFormats:t.applyWidthHeightFormats??`1`,tableNumber:_}}function Mg(e,t){let n=e.columns??[],r=e.pages??[],i=e.values.map(kg),a=t.getRow(1).values.slice(1);for(let e=0;e<a.length;e++){let n=a[e];if(n==null||n===``||typeof n==`string`&&n.trim()===``)throw Error(`Empty or missing header name at column ${e+1} in ${t.name}. Pivot tables require all columns to have non-empty headers.`)}let o=new Set;for(let e of a){let n=String(e);if(o.has(n))throw Error(`Duplicate header name "${n}" found in ${t.name}. Pivot tables require unique column names.`);o.add(n)}let s=new Set(a.map(String)),c=e=>{if(!s.has(e))throw new Ir(`The header name "${e}" was not found in ${t.name}.`)};for(let t of e.rows)c(t);for(let e of n)c(e);for(let e of i)c(e);for(let e of r)c(e);let l=new Map,u=[{name:`rows`,fields:e.rows},{name:`columns`,fields:n},{name:`pages`,fields:r}];for(let e of u)for(let t of e.fields){let n=l.get(t);if(n===e.name)throw Error(`Duplicate field "${t}" in ${e.name}. Each field can only appear once per axis area.`);if(n)throw Error(`Field "${t}" cannot appear in both ${n} and ${e.name}. Each field can only be assigned to one axis area.`);l.set(t,e.name)}if(!e.rows.length)throw new Ir(`No pivot table rows specified.`);if(e.values.length<1)throw new Ir(`Must have at least one value.`);if(e.metric!==void 0&&!Eg.has(e.metric))throw Error(`Invalid metric "${e.metric}". Must be one of: ${[...Eg].join(`, `)}.`);for(let t of e.values){let e=Ag(t);if(e!==void 0&&!Eg.has(e))throw Error(`Invalid metric "${e}" on value field "${kg(t)}". Must be one of: ${[...Eg].join(`, `)}.`)}let d=new Set;for(let e of i){if(d.has(e))throw Error(`Duplicate value field "${e}". Each value field name must be unique.`);d.add(e)}}function Ng(e){if(e==null)return null;if(typeof e!=`object`||e instanceof Date||e instanceof wg)return e;let t=e;if(typeof t.error==`string`){let e=t.error;return new wg(e.startsWith(`#`)?e.slice(1):e)}if(`formula`in t||`sharedFormula`in t){let e=t.result;return e==null?null:Ng(e)}return Array.isArray(t.richText)?t.richText.map(e=>e.text??``).join(``):typeof t.text==`string`&&typeof t.hyperlink==`string`?t.text:typeof t.checkbox==`boolean`?t.checkbox:String(e)}function Pg(e,t,n){let r=e.getRow(1).values,i=new Set(t),a=new Set(n),o=t=>{let n=e.getColumn(t).values,r=new Set,i=new Map,a=!1;for(let e=2;e<n.length;e++){let t=Ng(n[e]);t===null||typeof t==`number`&&isNaN(t)?a=!0:t instanceof wg?i.has(t.code)||(i.set(t.code,t),r.add(t)):r.add(t)}let o=qc(r);return a&&o.push(null),o},s=t=>{let n=e.getColumn(t).values,r=1/0,i=-1/0,a=!1,o=!0;for(let e=2;e<n.length;e++){let t=Ng(n[e]);typeof t==`number`&&!isNaN(t)&&(a=!0,t<r&&(r=t),t>i&&(i=t),Number.isInteger(t)||(o=!1))}return a?{minValue:r,maxValue:i,allInteger:o}:null},c=[];for(let e of Kc(1,r.length)){let t=r[e],n=String(t);if(i.has(n))c.push({name:n,sharedItems:o(e)});else if(a.has(n)){let t=s(e);c.push({name:n,sharedItems:null,containsNumber:t?`1`:void 0,minValue:t?.minValue,maxValue:t?.maxValue,containsInteger:t?.allInteger?`1`:void 0})}else c.push({name:n,sharedItems:null})}return c}let Fg=/^[A-Za-z]{1,3}\d+$/,Ig=/^[Rr]\d+[Cc]\d+$/,Lg=new Set([`C`,`c`,`R`,`r`]),Rg=/\s/g,zg=/[^\p{L}\p{N}_.]/gu,Bg=/^[\p{L}_\\]/u;function Vg(e){let t=e.replace(Rg,`_`),n=!1;return t.startsWith(`\\`)&&(n=!0,t=t.slice(1)),t=t.replace(zg,``),n&&(t=`\\${t}`),t.length>0&&!Bg.test(t)&&(t=`_${t}`),t.length===0?`_Table`:(t.length===1&&Lg.has(t)&&(t=`_${t}`),(Fg.test(t)||Ig.test(t))&&(t=`_${t}`),t.length>255&&(t=t.slice(0,255)),t)}var Hg=class{constructor(e,t,n){this.table=e,this.column=t,this.index=n}_set(e,t){this.table.cacheState(),this.column[e]=t}get name(){return this.column.name}set name(e){this._set(`name`,e)}get filterButton(){return this.column.filterButton}set filterButton(e){this.column.filterButton=e}get style(){return this.column.style}set style(e){this.column.style=e}get totalsRowLabel(){return this.column.totalsRowLabel}set totalsRowLabel(e){this._set(`totalsRowLabel`,e)}get totalsRowFunction(){return this.column.totalsRowFunction}set totalsRowFunction(e){this._set(`totalsRowFunction`,e)}get totalsRowResult(){return this.column.totalsRowResult}set totalsRowResult(e){this._set(`totalsRowResult`,e)}get totalsRowFormula(){return this.column.totalsRowFormula}set totalsRowFormula(e){this._set(`totalsRowFormula`,e)}},Ug=class e{constructor(e,t){if(this.worksheet=e,t){if(this.table=t,Array.isArray(t.rows)&&t.rows.length===0&&t.tableRef){let n=M.decode(t.tableRef);if(`dimensions`in n){let r=n.top+(t.headerRow===!1?0:1),i=n.bottom-+(t.totalsRow===!0);if(i>=r)for(let a=r;a<=i;a++){let r=e.getRow(a),i=[];for(let e=n.left;e<=n.right;e++)i.push(r.getCell(e).value);t.rows.push(i)}}}this.validate(),this.store()}}static{this.SUBTOTAL_FUNCTIONS={average:101,countNums:102,count:103,max:104,min:105,stdDev:107,var:110,sum:109}}getFormula(t){if(t.totalsRowFunction===`none`)return null;if(t.totalsRowFunction===`custom`)return t.totalsRowFormula??null;let n=t.totalsRowFunction?e.SUBTOTAL_FUNCTIONS[t.totalsRowFunction]:void 0;if(n!==void 0)return`SUBTOTAL(${n},${this.table.name}[${t.name}])`;throw new Lr(`Invalid Totals Row Function: ${t.totalsRowFunction}`)}get width(){return this.table.columns.length}get height(){return this.table.rows.length}get filterHeight(){return this.height+ +!!this.table.headerRow}get tableHeight(){return this.filterHeight+ +!!this.table.totalsRow}validate(){let{table:e}=this,t=(e,t,n)=>{e[t]===void 0&&(e[t]=n)};t(e,`headerRow`,!0),t(e,`totalsRow`,!1),t(e,`style`,{});let n=e.style;t(n,`theme`,`TableStyleMedium2`),t(n,`showFirstColumn`,!1),t(n,`showLastColumn`,!1),t(n,`showRowStripes`,!1),t(n,`showColumnStripes`,!1),e.name&&=Vg(e.name),e.displayName&&=Vg(e.displayName);let r=(e,t)=>{if(!e)throw new Lr(t)};r(!!e.name,`Table must have a name`),r(!!e.ref,`Table must have ref`),r(!!e.columns,`Table must have column definitions`),r(!!e.rows,`Table must have row definitions`),e.tl=M.decodeAddress(e.ref);let{row:i,col:a}=e.tl;r(i>0,`Table must be on valid row`),r(a>0,`Table must be on valid col`);let{width:o,tableHeight:s}=this;e.autoFilterRef=M.encode(i,a,i,a+o-1),e.tableRef=M.encode(i,a,i+s-1,a+o-1),e.columns.forEach((e,n)=>{r(!!e.name,`Column ${n} must have a name`),n===0?t(e,`totalsRowLabel`,`Total`):(t(e,`totalsRowFunction`,`none`),e.totalsRowFormula=this.getFormula(e)??void 0)})}store(){let e=(e,t)=>{t&&Object.assign(e.style,t)},{worksheet:t,table:n}=this,{row:r,col:i}=n.tl,a=0;if(n.headerRow){let o=t.getRow(r+ a++);n.columns.forEach((t,n)=>{let{style:r,name:a}=t,s=o.getCell(i+n);s.value=a,e(s,r)})}if(n.rows.forEach(o=>{let s=t.getRow(r+ a++);o.forEach((t,r)=>{let a=s.getCell(i+r);if(typeof t==`object`&&t&&`formula`in t&&typeof t.formula==`string`){let e=t,r=n.qualifyImplicitStructuredReferences===!0;a.value={...e,formula:r?e.formula.replace(/(^|[^A-Za-z0-9_])\[@\[?([^[\]]+?)\]?\]/g,`$1${n.name}[[#This Row],[$2]]`):e.formula}}else a.value=t;e(a,n.columns[r]?.style)})}),n.totalsRow){let o=t.getRow(r+ a++);n.columns.forEach((t,n)=>{let r=o.getCell(i+n);if(n===0)r.value=t.totalsRowLabel;else{let e=this.getFormula(t);e?r.value={formula:e,result:t.totalsRowResult}:r.value=null}e(r,t.style)})}}load(e){let{table:t}=this,{row:n,col:r}=t.tl,i=0;if(t.headerRow){let a=e.getRow(n+ i++);t.columns.forEach((e,t)=>{let n=a.getCell(r+t);n.value=e.name})}if(t.rows.forEach(t=>{let a=e.getRow(n+ i++);t.forEach((e,t)=>{let n=a.getCell(r+t);n.value=e})}),t.totalsRow){let a=e.getRow(n+ i++);t.columns.forEach((e,t)=>{let n=a.getCell(r+t);if(t===0)n.value=e.totalsRowLabel;else{let t=this.getFormula(e);t&&(n.value={formula:t,result:e.totalsRowResult})}})}}get model(){return this.table}set model(e){this.table=e}cacheState(){this._cache||={ref:this.ref,width:this.width,tableHeight:this.tableHeight}}commit(){if(!this._cache)return;this.validate();let e=M.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let t=0;t<this._cache.tableHeight;t++){let n=this.worksheet.getRow(e.row+t);for(let t=0;t<this._cache.width;t++){let r=n.getCell(e.col+t);r.value=null}}else{for(let t=this.tableHeight;t<this._cache.tableHeight;t++){let n=this.worksheet.getRow(e.row+t);for(let t=0;t<this._cache.width;t++){let r=n.getCell(e.col+t);r.value=null}}for(let t=0;t<this.tableHeight;t++){let n=this.worksheet.getRow(e.row+t);for(let t=this.width;t<this._cache.width;t++){let r=n.getCell(e.col+t);r.value=null}}}this.store(),this._cache=void 0}addRow(e,t,n){this.cacheState(),t===void 0?this.table.rows.push(e):this.table.rows.splice(t,0,e),n?.commit!==!1&&this.commit()}removeRows(e,t=1,n){this.cacheState(),this.table.rows.splice(e,t),n?.commit!==!1&&this.commit()}getColumn(e){let t=this.table.columns[e];return new Hg(this,t,e)}addColumn(e,t,n){this.cacheState(),n===void 0?(this.table.columns.push(e),this.table.rows.forEach((e,n)=>{e.push(t[n])})):(this.table.columns.splice(n,0,e),this.table.rows.forEach((e,r)=>{e.splice(n,0,t[r])}))}removeColumns(e,t=1){this.cacheState(),this.table.columns.splice(e,t),this.table.rows.forEach(n=>{n.splice(e,t)})}_assign(e,t,n){this.cacheState(),e[t]=n}get ref(){return this.table.ref}set ref(e){this._assign(this.table,`ref`,e)}get name(){return this.table.name}set name(e){this.cacheState(),this.table.name=Vg(e)}get displayName(){return this.table.displayName||this.table.name}set displayName(e){this.cacheState(),this.table.displayName=Vg(e)}get headerRow(){return this.table.headerRow}set headerRow(e){this._assign(this.table,`headerRow`,e)}get totalsRow(){return this.table.totalsRow}set totalsRow(e){this._assign(this.table,`totalsRow`,e)}_ensureStyle(){return this.table.style||(this.table.style={}),this.table.style}get theme(){return this.table.style?.theme}set theme(e){this._ensureStyle().theme=e}get showFirstColumn(){return this.table.style?.showFirstColumn}set showFirstColumn(e){this._ensureStyle().showFirstColumn=e}get showLastColumn(){return this.table.style?.showLastColumn}set showLastColumn(e){this._ensureStyle().showLastColumn=e}get showRowStripes(){return this.table.style?.showRowStripes}set showRowStripes(e){this._ensureStyle().showRowStripes=e}get showColumnStripes(){return this.table.style?.showColumnStripes}set showColumnStripes(e){this._ensureStyle().showColumnStripes=e}};function Wg(e){return M.l2n(e.toUpperCase())-1}function Gg(e){return M.n2l(e+1)}function Kg(e){return parseInt(e,10)-1}function qg(e){return String(e+1)}function Jg(e){let t=M.decodeAddress(e.toUpperCase());return{c:t.col-1,r:t.row-1}}function Yg(e){return M.encodeAddress(e.r+1,e.c+1)}function Xg(e){let t=e.indexOf(`:`);if(t===-1){let t=Jg(e);return{s:t,e:{...t}}}return{s:Jg(e.slice(0,t)),e:Jg(e.slice(t+1))}}function Zg(e,t){if(t===void 0){let t=e;return Zg(t.s,t.e)}let n=Yg(e),r=Yg(t);return n===r?n:`${n}:${r}`}let Qg={32:3,33:5,34:6,35:7,36:7,37:11,38:10,39:3,40:5,41:5,42:7,43:7,44:4,45:5,46:4,47:6,48:7,49:7,50:7,51:7,52:7,53:7,54:7,55:7,56:7,57:7,58:4,59:4,60:7,61:7,62:7,63:7,64:13,65:9,66:8,67:8,68:9,69:7,70:7,71:9,72:9,73:4,74:5,75:8,76:6,77:12,78:10,79:10,80:8,81:10,82:8,83:7,84:7,85:9,86:9,87:13,88:8,89:7,90:7,91:5,92:6,93:5,94:7,95:7,96:4,97:7,98:8,99:6,100:8,101:8,102:5,103:7,104:8,105:4,106:4,107:7,108:4,109:12,110:8,111:8,112:8,113:8,114:5,115:6,116:5,117:8,118:7,119:11,120:7,121:7,122:6,123:5,124:7,125:5,126:7},$g={header:{unitsPerEm:2048,usWinAscent:1950,usWinDescent:550,maxDigitAdvance:1038,sTypoAscender:1536,sTypoDescender:-512,sTypoLineGap:452},defaultAdvance:1e3,cjkAdvance:2048,advances:[[32,1,463],[33,1,667],[34,1,821],[35,1,1020],[36,1,1038],[37,1,1464],[38,1,1397],[39,1,452],[40,2,621],[42,2,1020],[44,1,511],[45,1,627],[46,1,517],[47,1,791],[48,10,1038],[58,2,548],[60,3,1020],[63,1,949],[64,1,1831],[65,1,1185],[66,1,1114],[67,1,1092],[68,1,1260],[69,1,1e3],[70,1,941],[71,1,1292],[72,1,1276],[73,1,516],[74,1,653],[75,1,1064],[76,1,861],[77,1,1751],[78,1,1322],[79,1,1356],[80,1,1058],[81,1,1378],[82,1,1112],[83,1,941],[84,1,998],[85,1,1314],[86,1,1162],[87,1,1822],[88,1,1063],[89,1,998],[90,1,959],[91,1,628],[92,1,791],[93,1,628],[94,2,1020],[96,1,596],[97,1,981],[98,1,1076],[99,1,866],[100,1,1076],[101,1,1019],[102,1,625],[103,1,964],[104,1,1076],[105,1,470],[106,1,490],[107,1,931],[108,1,470],[109,1,1636],[110,1,1076],[111,1,1080],[112,2,1076],[114,1,714],[115,1,801],[116,1,686],[117,1,1076],[118,1,925],[119,1,1464],[120,1,887],[121,1,927],[122,1,809],[123,1,644],[124,1,943],[125,1,644],[126,1,1020]]},e_={header:{unitsPerEm:2048,usWinAscent:1854,usWinDescent:434,maxDigitAdvance:1139,sTypoAscender:1491,sTypoDescender:-431,sTypoLineGap:307},defaultAdvance:1024,cjkAdvance:2048,advances:[[32,1,569],[33,1,569],[34,1,727],[35,1,1139],[36,1,1139],[37,1,1821],[38,1,1366],[39,1,391],[40,1,682],[41,1,682],[42,1,797],[43,1,1196],[44,1,569],[45,1,682],[46,1,569],[47,1,569],[48,10,1139],[58,1,569],[59,1,569],[60,1,1196],[61,1,1196],[62,1,1196],[63,1,1139],[64,1,2079],[65,1,1366],[66,1,1366],[67,1,1479],[68,1,1479],[69,1,1366],[70,1,1251],[71,1,1593],[72,1,1479],[73,1,569],[74,1,1024],[75,1,1366],[76,1,1139],[77,1,1706],[78,1,1479],[79,1,1593],[80,1,1366],[81,1,1593],[82,1,1479],[83,1,1366],[84,1,1251],[85,1,1479],[86,1,1366],[87,1,1933],[88,1,1366],[89,1,1366],[90,1,1251],[91,1,569],[92,1,569],[93,1,569],[94,1,961],[95,1,1139],[96,1,682],[97,1,1139],[98,1,1139],[99,1,1024],[100,1,1139],[101,1,1139],[102,1,569],[103,1,1139],[104,1,1139],[105,1,455],[106,1,455],[107,1,1024],[108,1,455],[109,1,1706],[110,1,1139],[111,1,1139],[112,1,1139],[113,1,1139],[114,1,682],[115,1,1024],[116,1,569],[117,1,1139],[118,1,1024],[119,1,1479],[120,1,1024],[121,1,1024],[122,1,1024],[123,1,684],[124,1,532],[125,1,684],[126,1,1196]]},t_={header:{unitsPerEm:2048,usWinAscent:1854,usWinDescent:434,maxDigitAdvance:1139,sTypoAscender:1491,sTypoDescender:-431,sTypoLineGap:307},defaultAdvance:1070,cjkAdvance:2048,advances:[[32,1,569],[33,1,682],[34,1,974],[35,1,1139],[36,1,1139],[37,1,1821],[38,1,1479],[39,1,569],[40,1,682],[41,1,682],[42,1,797],[43,1,1196],[44,1,569],[45,1,682],[46,1,569],[47,1,569],[48,10,1139],[58,1,682],[59,1,682],[60,1,1196],[61,1,1196],[62,1,1196],[63,1,1251],[64,1,1991],[65,1,1479],[66,1,1479],[67,1,1479],[68,1,1479],[69,1,1366],[70,1,1251],[71,1,1593],[72,1,1479],[73,1,682],[74,1,1139],[75,1,1479],[76,1,1251],[77,1,1706],[78,1,1479],[79,1,1593],[80,1,1366],[81,1,1593],[82,1,1479],[83,1,1366],[84,1,1251],[85,1,1479],[86,1,1366],[87,1,1933],[88,1,1366],[89,1,1366],[90,1,1251],[91,1,682],[92,1,569],[93,1,682],[94,1,1196],[95,1,1139],[96,1,682],[97,1,1139],[98,1,1251],[99,1,1024],[100,1,1251],[101,1,1139],[102,1,682],[103,1,1251],[104,1,1251],[105,1,569],[106,1,569],[107,1,1139],[108,1,569],[109,1,1821],[110,1,1251],[111,1,1251],[112,1,1251],[113,1,1251],[114,1,797],[115,1,1024],[116,1,682],[117,1,1251],[118,1,1139],[119,1,1593],[120,1,1139],[121,1,1139],[122,1,1024],[123,1,797],[124,1,569],[125,1,797],[126,1,1196]]},n_={header:{unitsPerEm:2048,usWinAscent:1825,usWinDescent:443,maxDigitAdvance:1024,sTypoAscender:1420,sTypoDescender:-442,sTypoLineGap:307},defaultAdvance:900,cjkAdvance:2048,advances:[[32,1,512],[33,1,682],[34,1,836],[35,1,1024],[36,1,1024],[37,1,1706],[38,1,1593],[39,1,369],[40,1,682],[41,1,682],[42,1,1024],[43,1,1155],[44,1,512],[45,1,682],[46,1,512],[47,1,569],[48,10,1024],[58,1,569],[59,1,569],[60,1,1155],[61,1,1155],[62,1,1155],[63,1,909],[64,1,1886],[65,1,1479],[66,1,1366],[67,1,1366],[68,1,1479],[69,1,1251],[70,1,1139],[71,1,1479],[72,1,1479],[73,1,682],[74,1,797],[75,1,1479],[76,1,1251],[77,1,1821],[78,1,1479],[79,1,1479],[80,1,1139],[81,1,1479],[82,1,1366],[83,1,1139],[84,1,1251],[85,1,1479],[86,1,1479],[87,1,1933],[88,1,1479],[89,1,1479],[90,1,1251],[91,1,682],[92,1,569],[93,1,682],[94,1,961],[95,1,1024],[96,1,682],[97,1,909],[98,1,1024],[99,1,909],[100,1,1024],[101,1,909],[102,1,682],[103,1,1024],[104,1,1024],[105,1,569],[106,1,569],[107,1,1024],[108,1,569],[109,1,1479],[110,1,1024],[111,1,1024],[112,1,1024],[113,1,1024],[114,1,682],[115,1,797],[116,1,569],[117,1,1024],[118,1,1024],[119,1,1479],[120,1,1024],[121,1,1024],[122,1,909],[123,1,983],[124,1,410],[125,1,983],[126,1,1073]]},r_={header:{unitsPerEm:2048,usWinAscent:1705,usWinDescent:615,maxDigitAdvance:1229,sTypoAscender:1255,sTypoDescender:-386,sTypoLineGap:0},defaultAdvance:1229,cjkAdvance:2048,advances:[[32,95,1229]]},i_={header:{unitsPerEm:2048,usWinAscent:2059,usWinDescent:430,maxDigitAdvance:1302,sTypoAscender:1566,sTypoDescender:-423,sTypoLineGap:202},defaultAdvance:1200,cjkAdvance:2048,advances:[[32,1,720],[33,1,756],[34,1,933],[35,1,1521],[36,1,1198],[37,1,1807],[38,1,1487],[39,1,510],[40,1,756],[41,1,756],[42,1,1198],[43,1,1521],[44,1,643],[45,1,811],[46,1,643],[47,1,899],[48,10,1302],[58,1,756],[59,1,756],[60,1,1521],[61,1,1521],[62,1,1521],[63,1,1151],[64,1,1937],[65,1,1362],[66,1,1382],[67,1,1279],[68,1,1490],[69,1,1279],[70,1,1186],[71,1,1458],[72,1,1498],[73,1,924],[74,1,922],[75,1,1362],[76,1,1145],[77,1,1728],[78,1,1498],[79,1,1476],[80,1,1262],[81,1,1476],[82,1,1396],[83,1,1300],[84,1,1185],[85,1,1448],[86,1,1362],[87,1,1864],[88,1,1244],[89,1,1183],[90,1,1204],[91,1,756],[92,1,899],[93,1,756],[94,1,1521],[95,1,1198],[96,1,1198],[97,1,1224],[98,1,1302],[99,1,1075],[100,1,1302],[101,1,1218],[102,1,756],[103,1,1302],[104,1,1317],[105,1,643],[106,1,700],[107,1,1183],[108,1,643],[109,1,1937],[110,1,1317],[111,1,1271],[112,1,1302],[113,1,1302],[114,1,899],[115,1,1075],[116,1,811],[117,1,1317],[118,1,1183],[119,1,1728],[120,1,1183],[121,1,1183],[122,1,1031],[123,1,787],[124,1,756],[125,1,787],[126,1,1521]]},a_={header:{unitsPerEm:2048,usWinAscent:1878,usWinDescent:449,maxDigitAdvance:1257,sTypoAscender:1549,sTypoDescender:-444,sTypoLineGap:198},defaultAdvance:1100,cjkAdvance:2048,advances:[[32,1,504],[33,1,614],[34,1,679],[35,1,1257],[36,1,1024],[37,1,1539],[38,1,1350],[39,1,391],[40,1,614],[41,1,614],[42,1,842],[43,1,1257],[44,1,504],[45,1,751],[46,1,504],[47,1,797],[48,10,1257],[58,1,569],[59,1,569],[60,1,1257],[61,1,1257],[62,1,1257],[63,1,885],[64,1,1614],[65,1,1350],[66,1,1273],[67,1,1161],[68,1,1427],[69,1,1163],[70,1,1074],[71,1,1314],[72,1,1517],[73,1,721],[74,1,772],[75,1,1397],[76,1,1176],[77,1,1770],[78,1,1462],[79,1,1392],[80,1,1118],[81,1,1392],[82,1,1321],[83,1,1019],[84,1,1163],[85,1,1456],[86,1,1321],[87,1,1887],[88,1,1314],[89,1,1220],[90,1,1055],[91,1,614],[92,1,797],[93,1,614],[94,1,1257],[95,1,1024],[96,1,682],[97,1,1019],[98,1,1100],[99,1,866],[100,1,1106],[101,1,958],[102,1,654],[103,1,1006],[104,1,1152],[105,1,606],[106,1,606],[107,1,1048],[108,1,606],[109,1,1700],[110,1,1131],[111,1,1042],[112,1,1100],[113,1,1100],[114,1,772],[115,1,820],[116,1,688],[117,1,1117],[118,1,1019],[119,1,1559],[120,1,1007],[121,1,1012],[122,1,880],[123,1,637],[124,1,583],[125,1,637],[126,1,1257]]},o_={header:{unitsPerEm:2048,usWinAscent:2049,usWinDescent:423,maxDigitAdvance:1118,sTypoAscender:1566,sTypoDescender:-423,sTypoLineGap:59},defaultAdvance:1050,cjkAdvance:2048,advances:[[32,1,461],[33,1,536],[34,1,717],[35,1,1232],[36,1,1014],[37,1,1625],[38,1,1327],[39,1,428],[40,1,616],[41,1,616],[42,1,900],[43,1,1232],[44,1,504],[45,1,700],[46,1,504],[47,1,753],[48,10,1118],[58,1,567],[59,1,567],[60,1,1232],[61,1,1232],[62,1,1232],[63,1,974],[64,1,1810],[65,1,1205],[66,1,1200],[67,1,1130],[68,1,1327],[69,1,1117],[70,1,1032],[71,1,1306],[72,1,1308],[73,1,614],[74,1,794],[75,1,1195],[76,1,1003],[77,1,1500],[78,1,1308],[79,1,1381],[80,1,1103],[81,1,1381],[82,1,1200],[83,1,1117],[84,1,1100],[85,1,1300],[86,1,1205],[87,1,1723],[88,1,1119],[89,1,1130],[90,1,1068],[91,1,616],[92,1,753],[93,1,616],[94,1,1232],[95,1,893],[96,1,1118],[97,1,1066],[98,1,1141],[99,1,942],[100,1,1141],[101,1,1086],[102,1,639],[103,1,1141],[104,1,1126],[105,1,500],[106,1,548],[107,1,1023],[108,1,500],[109,1,1705],[110,1,1126],[111,1,1103],[112,1,1141],[113,1,1141],[114,1,714],[115,1,918],[116,1,700],[117,1,1126],[118,1,1e3],[119,1,1500],[120,1,1e3],[121,1,1e3],[122,1,880],[123,1,616],[124,1,540],[125,1,616],[126,1,1232]]},s_={header:{unitsPerEm:2048,usWinAscent:1923,usWinDescent:455,maxDigitAdvance:1074,sTypoAscender:1510,sTypoDescender:-420,sTypoLineGap:0},defaultAdvance:1e3,cjkAdvance:2048,advances:[[32,1,453],[33,1,545],[34,1,613],[35,1,1107],[36,1,1074],[37,1,1341],[38,1,1213],[39,1,360],[40,1,616],[41,1,616],[42,1,860],[43,1,1107],[44,1,453],[45,1,697],[46,1,453],[47,1,766],[48,10,1074],[58,1,453],[59,1,453],[60,1,1107],[61,1,1107],[62,1,1107],[63,1,860],[64,1,1648],[65,1,1227],[66,1,1227],[67,1,1139],[68,1,1309],[69,1,1139],[70,1,1057],[71,1,1309],[72,1,1395],[73,1,627],[74,1,791],[75,1,1260],[76,1,1057],[77,1,1456],[78,1,1350],[79,1,1395],[80,1,1139],[81,1,1395],[82,1,1215],[83,1,1057],[84,1,1139],[85,1,1350],[86,1,1227],[87,1,1730],[88,1,1260],[89,1,1139],[90,1,1139],[91,1,616],[92,1,766],[93,1,616],[94,1,1107],[95,1,1074],[96,1,860],[97,1,1013],[98,1,1074],[99,1,936],[100,1,1074],[101,1,1013],[102,1,627],[103,1,1074],[104,1,1074],[105,1,545],[106,1,538],[107,1,1013],[108,1,545],[109,1,1539],[110,1,1074],[111,1,1074],[112,1,1074],[113,1,1074],[114,1,715],[115,1,860],[116,1,627],[117,1,1074],[118,1,936],[119,1,1481],[120,1,936],[121,1,936],[122,1,860],[123,1,616],[124,1,604],[125,1,616],[126,1,1107]]},c_={},l_={};function u_(e,t,n){c_[e.toLowerCase()]=t,n&&(l_[e.toLowerCase()]=n)}u_(`calibri`,$g),u_(`arial`,e_,t_),u_(`times new roman`,n_),u_(`courier new`,r_),u_(`verdana`,i_),u_(`georgia`,a_),u_(`tahoma`,o_),u_(`trebuchet ms`,s_);let d_={aptos:[1.03,1.37,1],"aptos display":[.96,1.31,1],"aptos narrow":[.82,1.07,1],"aptos serif":[.98,1.31,1],"calibri light":[.98,1.19,1],cambria:[1.07,1.28,1],"century gothic":[1.19,1.36,1],"comic sans ms":[1.14,1.46,1],consolas:[1.21,1.21,1],constantia:[1.05,1.34,1],corbel:[.97,1.2,1],garamond:[1.16,1.39,1],impact:[.96,1.01,1],"lucida console":[1.21,1.21,1],"lucida sans unicode":[1.16,1.4,1],"microsoft sans serif":[1.07,1.35,1],"palatino linotype":[1.12,1.44,1],"segoe ui":[1.08,1.31,1],"book antiqua":[1.12,1.44,1],candara:[1.02,1.25,1],"franklin gothic medium":[1.08,1.33,1],"goudy old style":[1.02,1.34,1],rockwell:[1.14,1.35,1],"tw cen mt":[.95,1.17,1],"microsoft yahei":[1.18,1.3,1.18],"microsoft yahei ui":[1.18,1.3,1.18],simsun:[1.1,1.1,1.1],宋体:[1.1,1.1,1.1],simhei:[1.1,1.1,1.1],黑体:[1.1,1.1,1.1],nsimsun:[1.1,1.1,1.1],新宋体:[1.1,1.1,1.1],dengxian:[1.05,1.28,1.08],等线:[1.05,1.28,1.08],fangsong:[1.1,1.1,1.1],仿宋:[1.1,1.1,1.1],kaiti:[1.1,1.1,1.1],楷体:[1.1,1.1,1.1],meiryo:[1.18,1.3,1.18],"meiryo ui":[1.1,1.2,1.18],"ms gothic":[1.21,1.21,1.1],"MS ゴシック":[1.21,1.21,1.1],"ms pgothic":[1.07,1.33,1.1],"ms mincho":[1.21,1.21,1.1],"yu gothic":[1.17,1.32,1.18],"yu gothic ui":[1.08,1.22,1.18],"yu mincho":[1.1,1.28,1.18],"malgun gothic":[1.12,1.28,1.14],"맑은 고딕":[1.12,1.28,1.14],batang:[1.1,1.1,1.1],gulim:[1.1,1.1,1.1],dotum:[1.1,1.1,1.1]},f_=new Map;function p_(e){let t=f_.get(e);if(t)return t;t=new Map;for(let[n,r,i]of e.advances)for(let e=0;e<r;e++)t.set(n+e,i);return f_.set(e,t),t}function m_(e,t){let n=e.toLowerCase();return t?l_[n]??c_[n]:c_[n]}function h_(e){return Object.hasOwn(l_,e.toLowerCase())}function g_(){return $g}function __(e,t){return t>=19968&&t<=40959||t>=13312&&t<=19903||t>=63744&&t<=64255||t>=131072&&t<=205743||t>=12288&&t<=12543||t>=44032&&t<=55215||t>=65281&&t<=65376||t>=11904&&t<=12255||t>=12544&&t<=13311?e.cjkAdvance:p_(e).get(t)??e.defaultAdvance}function v_(e){return Qg[e]}function y_(e){return d_[e.toLowerCase()]}function b_(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=63744&&e<=64255||e>=65281&&e<=65376||e>=12288&&e<=12543||e>=11904&&e<=12255||e>=12544&&e<=13311||e>=44032&&e<=55215||e>=131072&&e<=205743}let x_=`Calibri`,S_=1790;function C_(e,t,n,r,i){if(t===`calibri`&&n===11){let t=v_(e);if(t!==void 0)return t}if(i){let t=__(i,e),r=Math.round(n/72*96);return Math.round(t/i.header.unitsPerEm*r)}}function w_(e){return{name:(e?.name??x_).toLowerCase(),size:e?.size??11,bold:e?.bold??!1,italic:e?.italic??!1,vertAlign:e?.vertAlign}}function T_(e,t){if(!e)return 0;let n=w_(t),r=m_(n.name,n.bold),i=e.split(/\r\n|\r|\n/),a=0;for(let e of i){let t=E_(e,n,r);t>a&&(a=t)}return a}function E_(e,t,n){return e?n||t.name===`calibri`&&t.size===11?D_(e,t,n):O_(e,t):0}function D_(e,t,n){let r=0;for(let i of e)r+=R_(i.codePointAt(0),t,n);return t.vertAlign&&(r=Math.ceil(r*.6)),r}function O_(e,t){let n=y_(t.name),r=n?.[0]??1,i=n?.[1]??1.3,a=n?.[2]??1,o=0,s=0,c=0;for(let t of e)b_(t.codePointAt(0))?c+=2:t>=`A`&&t<=`Z`?s++:o++;let l=(o*r+s*i+c*a)*(t.size/11);t.bold&&(l*=1.05),t.italic&&(l*=1.02),t.vertAlign&&(l*=.6);let u=A_({name:t.name,size:t.size});return Math.ceil(l*u)}function k_(e,t){let n=0,r=0;for(let i of e){let e=i.font?{...t,...i.font}:t,a=i.text.split(/\r\n|\r|\n/);for(let t=0;t<a.length;t++)t>0&&(r>n&&(n=r),r=0),a[t]&&(r+=T_(a[t],e))}return r>n&&(n=r),n}function A_(e){let t=(e?.name??x_).toLowerCase(),n=e?.size??11;if(t===`calibri`&&n===11)return 7;let r=m_(t);if(r){let e=Math.round(n/72*96);return Math.round(r.header.maxDigitAdvance/r.header.unitsPerEm*e)}return Math.max(1,Math.round(n/11*7))}function j_(e){return 2*Math.ceil(e/4)+1}function M_(e,t){return t<=0?0:Math.trunc(e/t*256)/256}function N_(e,t){if(t<=0)return 0;let n=j_(t);return e===0?0:e<1?Math.round(e*(t+n)):Math.round(e*t)+n}function P_(e){return e*72/96}function F_(e,t,n){if(e<=0)return 0;let r=e+2*Math.ceil(e*.03+t/4)+1;n&&(r+=16),r>S_&&(r=S_);let i=M_(r,t);return Math.min(i,255)}function I_(e){let t=(e?.name??x_).toLowerCase(),n=e?.size??11,r=Math.round(n/72*96),i=m_(t);if(i){let{unitsPerEm:e,usWinDescent:t}=i.header;return(e+t)/e*r}return r*1.3}function L_(e,t,n){if(!e||t<=0)return 1;let r=w_(n),i=m_(r.name,r.bold),a=e.split(/\r\n|\r|\n/),o=0;for(let e of a){if(!e){o++;continue}o+=z_(e,t,r,i)}return o}function R_(e,t,n){let r;if(n||t.name===`calibri`&&t.size===11){let i=n??g_();r=C_(e,t.name,t.size,t.bold,i)??Math.round(i.defaultAdvance/i.header.unitsPerEm*Math.round(t.size/72*96))}else r=Math.ceil(t.size/11*A_({name:t.name,size:t.size})*(b_(e)?2:1));return t.bold&&!h_(t.name)&&(r=Math.ceil(r*1.05)),t.italic&&(r=Math.ceil(r*1.02)),r}function z_(e,t,n,r){let i=B_(e);if(i.length===0)return 1;let a=1,o=0;for(let e of i){let i=0;for(let t of e)i+=R_(t.codePointAt(0),n,r);o===0?o=i:o+i>t?(a++,o=i):o+=i}return a}function B_(e){let t=[],n=``;for(let r of e)n+=r,(r===` `||r===`-`||r===` `)&&(t.push(n),n=``);return n&&t.push(n),t}function V_(e,t,n,r){if(!e)return P_(I_(t));let i=I_(t),a;return a=n?.wrapText&&r&&r>0?L_(e,r,t):e.split(/\r\n|\r|\n/).length,P_(i*a)}function H_(e,t,n,r){let i=t?.size??11,a=t;for(let n of e){let e=n.font?.size??t?.size??11;e>i&&(i=e,a=n.font?{...t,...n.font}:t)}return V_(e.map(e=>e.text).join(``),a,n,r)}function U_(e,t){let n=N_(e,t),r=j_(t);return Math.max(0,n-r)}function W_(e){let t=e.effectiveType,n=e.font;if(t===8){let t=e.value;if(t&&typeof t==`object`&&`richText`in t)return k_(t.richText,n)}let r=jl(e);return r?T_(r,n):0}function G_(e,t,n){let r=e.font,i=e.alignment;if(e.effectiveType===8){let t=e.value;if(t&&typeof t==`object`&&`richText`in t)return H_(t.richText,r,i,n)}let a=jl(e);return a?V_(a,r,i,i?.wrapText?n:void 0):0}var K_=class{constructor(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=[],this._keys={},this._merges={},this.rowBreaks=[],this.colBreaks=[],this.properties={defaultRowHeight:15,outlineLevelCol:0,outlineLevelRow:0,...e.properties},this.pageSetup={margins:{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},orientation:`portrait`,horizontalDpi:void 0,verticalDpi:void 0,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={differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null,...e.headerFooter},this.dataValidations=new zp,this.views=e.views??[],this.autoFilter=e.autoFilter??null,this._media=[],this.sheetProtection=null,this.tables={},this.pivotTables=[],this.conditionalFormattings=[],this.formControls=[],this.ignoredErrors=[],this._watermark=null}get name(){return this._name}set name(e){if(e===void 0&&(e=`sheet${this.id}`),this._name===e)return;if(typeof e!=`string`)throw new Tr(`The name has to be a string.`);if(e===``)throw new Tr(`The name can't be empty.`);if(e===`History`)throw new Tr(`The name "History" is protected. Please use a different name.`);if(/[*?:/\\[\]]/.test(e))throw new Tr(`Worksheet name ${e} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(e))throw new Tr(`The first or last character of worksheet name cannot be a single quotation mark: ${e}`);e.length>31&&(e=e.substring(0,31));let t=e.toLowerCase();if(this._workbook.worksheets.find(e=>e&&e!==this&&e.name.toLowerCase()===t))throw new Tr(`Worksheet name already exists: ${e}`);this._name=e}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){let e=new N;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=Array.isArray(t.header)?t.header.length:+!!t.header;return Math.max(e,n)},0);let t=1,n=this._columns=[];e.forEach(e=>{let r=new gc(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(t>this._columns.length){let e=this._columns.length+1;for(;e<=t;)this._columns.push(new gc(this,e++))}return this._columns[t-1]}spliceColumns(e,t,...n){for(let e of Object.values(this._merges))for(let t=e.top;t<=e.bottom;t++)for(let n=e.left;n<=e.right;n++){let e=this.findCell(t,n);e&&e.type===1&&e.unmerge()}let r=this._rows.length;if(n.length>0)for(let i=0;i<r;i++){let r=n.map(e=>e[i]??null);this.getRow(i+1).splice(e,t,...r)}else this._rows.forEach(n=>{n&&n.splice(e,t)});let i=n.length-t,a=e+t,o=this._columns.length;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=void 0;if(this.workbook.definedNames.spliceColumns(this.name,e,t,n.length),i!==0){for(let t of this._media)if(t.type===`image`&&t.range){let{tl:n,br:r}=t.range;n&&n.nativeCol>=e-1&&(n.nativeCol=Math.max(0,n.nativeCol+i)),r&&r.nativeCol>=e-1&&(r.nativeCol=Math.max(0,r.nativeCol+i))}}this._spliceMerges(`col`,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 Ql(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=L(r.style)??{},r.eachCell({includeEmpty:n},(e,t)=>{i.getCell(t).style=L(e.style)??{}}),i.height=r.height}duplicateRow(e,t,n=!1){let r=this.getRow(e),i=Array.from({length:t}).fill(r.values),a=[];for(let t of Object.values(this._merges))t.top===e&&t.bottom===e&&a.push(t);let o=[],s=e-1;for(let e of this._media)e.type===`image`&&e.range&&e.range.tl.nativeRow===s&&o.push(e);this.spliceRows(e+1,n?0:t,...i);for(let n=0;n<t;n++){let t=this._rows[e+n];t.style=L(r.style)??{},t.height=r.height,r.eachCell({includeEmpty:!0},(e,n)=>{t.getCell(n).style=L(e.style)??{}})}if(a.length>0)for(let r=0;r<t;r++){let t=e+1+r;if(!n){let e=[];for(let[n,r]of Object.entries(this._merges))r.top<=t&&r.bottom>=t&&e.push(n);for(let t of e)this._unMergeMaster(this.getCell(t))}for(let e of a)this.mergeCellsWithoutStyle(t,e.left,t,e.right)}if(!n){let n=e,r=e+t-1;this._media=this._media.filter(e=>{if(e.type===`image`&&e.range){let t=e.range.tl.nativeRow;return t<n||t>r}return!0})}for(let e=0;e<t;e++){let t=e+1;for(let e of o){let n=e.clone();if(n.range.tl.nativeRow=s+t,n.range.br){let r=e.range.br.nativeRow-s;n.range.br.nativeRow=s+t+r}this._media.push(n)}}}spliceRows(e,t,...n){for(let e of Object.values(this._merges))for(let t=e.top;t<=e.bottom;t++)for(let n=e.left;n<=e.right;n++){let e=this.findCell(t,n);e&&e.type===1&&e.unmerge()}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=L(c.style)??{},e.height=c.height,c.eachCell({includeEmpty:!0},(t,n)=>{e.getCell(n).style=L(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=L(c.style)??{},e.height=c.height,c.eachCell({includeEmpty:!0},(t,n)=>{e.getCell(n).style=L(t.style)??{}})}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]}if(this.workbook.definedNames.spliceRows(this.name,e,t,i),a!==0){for(let t of this._media)if(t.type===`image`&&t.range){let{tl:n,br:r}=t.range;n&&n.nativeRow>=e-1&&(n.nativeRow=Math.max(0,n.nativeRow+a)),r&&r.nativeRow>=e-1&&(r.nativeRow=Math.max(0,r.nativeRow+a))}}this._spliceMerges(`row`,e,t,i)}eachRow(e,t){let n,r;if(typeof e==`function`?r=e:(n=e,r=t),n&&n.includeEmpty){let e=this._rows.length;for(let t=1;t<=e;t++)r(this.getRow(t),t)}else this._rows.forEach(e=>{e&&e.hasValues&&r(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 N(e);this._mergeCellsInternal(t)}mergeCellsWithoutStyle(...e){let t=new N(e);this._mergeCellsInternal(t,!0)}_mergeCellsInternal(e,t){Object.values(this._merges).forEach(t=>{if(t.intersects(e))throw new kr});let{top:n,left:r,bottom:i,right:a}=e,o=t?void 0:im(n,r,i,a,(e,t)=>this.findCell(e,t)),s=this.getCell(e.top,e.left);for(let e=n;e<=i;e++)for(let i=r;i<=a;i++)(e>n||i>r)&&this.getCell(e,i).merge(s,t);o&&am(n,r,i,a,o,(e,t)=>this.getCell(e,t)),this._merges[s.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]}}_spliceMerges(e,t,n,r){let i=r-n;if(i===0&&n===0)return;let a=t+n,o=e===`row`,s={};for(let e of Object.values(this._merges)){let{top:r,left:c,bottom:l,right:u}=e.model,d=o?r:c,f=o?l:u;if(i<=0&&n>0){let n=a-1;if(d>n){let e=o?new N(r+i,c,l+i,u):new N(r,c+i,l,u+i);s[M.encodeAddress(e.top,e.left)]=e}else if(f<t)s[M.encodeAddress(r,c)]=e;else if(!(d>=t&&f<=n)){let e=r,n=c,a=l,d=u;o?(e=r<t?r:t,a=Math.max(e,l+i)):(n=c<t?c:t,d=Math.max(n,u+i));let f=new N(e,n,a,d);e===a&&n===d||(s[M.encodeAddress(f.top,f.left)]=f)}}else if(d>=a){let e=o?new N(r+i,c,l+i,u):new N(r,c+i,l,u+i);s[M.encodeAddress(e.top,e.left)]=e}else f<a||(o?e.model.bottom=l+i:e.model.right=u+i),s[M.encodeAddress(r,c)]=e}this._merges=s;for(let e of Object.values(s)){let t=this.getCell(e.top,e.left);for(let n=e.top;n<=e.bottom;n++)for(let r=e.left;r<=e.right;r++)(n>e.top||r>e.left)&&this.getCell(n,r).merge(t,!0)}}get hasMerges(){return Object.values(this._merges).some(Boolean)}unMergeCells(...e){let t=new N(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===1?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++)if(f){let a=this.getCell(n,i);a.value={shareType:r,formula:t,ref:e,result:d(n,i)},f=!1}else 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 Cg(this,n))}getImages(){return this._media.filter(e=>e.type===`image`)}addBackgroundImage(e){let t={type:`background`,imageId:String(e)};this._media.push(new Cg(this,t))}getBackgroundImageId(){let e=this._media.find(e=>e.type===`background`);return e&&e.imageId}addWatermark(e){if(this._media=this._media.filter(e=>e.type!==`watermark`&&e.type!==`headerImage`),this._watermark={imageId:String(e.imageId),mode:e.mode??`overlay`,opacity:e.opacity,headerWidth:e.headerWidth,headerHeight:e.headerHeight,applyTo:e.applyTo},this._watermark.mode===`overlay`){let t={type:`watermark`,imageId:String(e.imageId),opacity:e.opacity};this._media.push(new Cg(this,t))}else{let t={type:`headerImage`,imageId:String(e.imageId),headerWidth:e.headerWidth,headerHeight:e.headerHeight,applyTo:e.applyTo};this._media.push(new Cg(this,t))}}getWatermark(){return this._watermark}removeWatermark(){this._watermark=null,this._media=this._media.filter(e=>e.type!==`watermark`&&e.type!==`headerImage`)}addFormCheckbox(e,t){let n=new Sg(this,e,t);return this.formControls.push(n),n}getFormCheckboxes(){return this.formControls}async protect(e,t){this.sheetProtection=await cm(e,t)}unprotect(){this.sheetProtection=null}addTable(e){let t=new Ug(this,e),n=t.name.toLowerCase();if(this.tables[t.name])throw new Lr(`Table name "${t.name}" already exists in worksheet "${this.name}".`);if(this.workbook._tableNames.has(n))throw new Lr(`Table name "${t.name}" already exists in another worksheet. Table names must be unique across the entire workbook (case-insensitive).`);return this.tables[t.name]=t,this.workbook._tableNames.add(n),t}getTable(e){return this.tables[e]}removeTable(e){this.tables[e]&&this.workbook._tableNames.delete(e.toLowerCase()),delete this.tables[e]}getTables(){return Object.values(this.tables)}addPivotTable(e){let t=jg(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=[]}autoFitColumn(e){let t=typeof e==`string`?M.l2n(e):e;return this._autoFitColumnImpl(t),this}autoFitColumns(e,t){let n=this.dimensions;if(!n||n.left===void 0)return this;let r=e==null?n.left:typeof e==`string`?M.l2n(e):e,i=t==null?n.right:typeof t==`string`?M.l2n(t):t;for(let e=r;e<=i;e++)this._autoFitColumnImpl(e);return this}autoFitRow(e){return this._autoFitRowImpl(e),this}autoFitRows(e,t){let n=this.dimensions;if(!n||n.top===void 0)return this;let r=e??n.top,i=t??n.bottom;for(let e=r;e<=i;e++)this._autoFitRowImpl(e);return this}_autoFitColumnImpl(e){let t=A_(),n=this._isColumnInAutoFilter(e),r=0;if(this._rows.forEach(n=>{if(!n||n.hidden)return;let i=n.findCell(e);if(!i||i.type===1)return;if(i.isMerged){let e=this._merges[i.address];if(e&&e.left!==e.right)return}if(i.alignment?.shrinkToFit)return;let a=W_(i),o=i.alignment?.indent;o&&o>0&&(a+=o*3*t),a>r&&(r=a)}),r>0){let i=F_(r,t,n);if(i>0){let t=this.getColumn(e);t.width=i,t.bestFit=!0}}}_autoFitRowImpl(e){let t=this._rows[e-1];if(!t)return;let n=A_(),r=0;t.eachCell(e=>{if(e.type===1)return;if(e.isMerged){let t=this._merges[e.address];if(t&&t.top!==t.bottom)return}if(this._columns[e.col-1]?.hidden)return;let t=G_(e,n,this._getColumnContentWidthForCell(e,n));t>r&&(r=t)}),r>0&&(t.height=Math.ceil(r*4)/4,t.customHeight=!0)}_getColumnContentWidthForCell(e,t){if(e.alignment?.wrapText)return U_(this._columns[e.col-1]?.width??this.properties.defaultColWidth??9,t)}_isColumnInAutoFilter(e){if(!this.autoFilter)return!1;if(typeof this.autoFilter==`string`){let t=M.decode(this.autoFilter);return e>=t.left&&e<=t.right}let{from:t,to:n}=this.autoFilter,r=typeof t==`string`?M.decode(t).col:t.col,i=typeof n==`string`?M.decode(n).col:n.col;return e>=r&&e<=i}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,colBreaks:this.colBreaks,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,formControls:this.formControls.map(e=>e.model),ignoredErrors:this.ignoredErrors,watermark:this._watermark,drawing:this._drawing};e.cols=gc.toModel(this.columns);let t=e.rows=[],n=e.dimensions=new N;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.mergeCells=Object.values(this._merges).map(e=>e.range),e}_parseRows(e){this._rows=[],e.rows&&e.rows.forEach(e=>{let t=new Ql(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){if(this.name=e.name,this.state=e.state,this._columns=gc.fromModel(this,e.cols??[]),this._parseRows(e),this._parseMergeCells(e),this.dataValidations=new zp(e.dataValidations),this.properties=e.properties,this.pageSetup=e.pageSetup,this.headerFooter=e.headerFooter,this.rowBreaks=e.rowBreaks??[],this.colBreaks=e.colBreaks??[],this.views=e.views,this.autoFilter=e.autoFilter,this._media=e.media.map(e=>new Cg(this,e)),this._watermark=e.watermark??null,!this._watermark){for(let e of this._media)if(e.type===`watermark`){this._watermark={imageId:e.imageId??``,mode:`overlay`,opacity:e.opacity};break}else if(e.type===`headerImage`){this._watermark={imageId:e.imageId??``,mode:`header`,headerWidth:e.headerWidth,headerHeight:e.headerHeight};break}}this.sheetProtection=e.sheetProtection,this.tables=e.tables.reduce((e,t)=>{let n=new Ug(this,t);return n.model=t,e[t.name]=n,this.workbook._tableNames.add(t.name.toLowerCase()),e},{}),this.pivotTables=e.pivotTables,this.conditionalFormattings=e.conditionalFormattings,this.ignoredErrors=e.ignoredErrors??[],this.formControls=[],this._drawing=e.drawing}toJSON(e){let t=e||{},n=1,r=this.rowCount,i=1,a=this.columnCount;if(t.range!==void 0){if(typeof t.range==`number`)n=t.range+1;else if(typeof t.range==`string`){let e=Xg(t.range);n=e.s.r+1,r=e.e.r+1,i=e.s.c+1,a=e.e.c+1}}if(r<n||a<i)return[];let o=t.header;if(o===1){let e=[],o=t.blankRows!==!1;for(let s=n;s<=r;s++){let n=[],r=!0;for(let e=i;e<=a;e++){let a=this.getCell(s,e),o=t.raw===!1?jl(a,t.dateFormat).trim():a.value;o!=null&&o!==``?(n[e-i]=o,r=!1):t.defaultValue===void 0?n[e-i]=null:n[e-i]=t.defaultValue}(!r||o)&&e.push(n)}return e}if(o===`A`){let e=[],o=t.blankRows===!0;for(let s=n;s<=r;s++){let n={},r=!0;for(let e=i;e<=a;e++){let i=this.getCell(s,e),a=t.raw===!1?jl(i,t.dateFormat).trim():i.value,o=Gg(e-1);a!=null&&a!==``?(n[o]=a,r=!1):t.defaultValue!==void 0&&(n[o]=t.defaultValue)}(!r||o)&&e.push(n)}return e}if(Array.isArray(o)){let e=[],s=t.blankRows===!0;for(let c=n;c<=r;c++){let n={},r=!0;for(let e=i;e<=a;e++){let a=e-i,s=o[a]??`__EMPTY_${a}`,l=this.getCell(c,e),u=t.raw===!1?jl(l,t.dateFormat).trim():l.value;u!=null&&u!==``?(n[s]=u,r=!1):t.defaultValue!==void 0&&(n[s]=t.defaultValue)}(!r||s)&&e.push(n)}return e}let s=[],c={};for(let e=i;e<=a;e++){let t=this.getCell(n,e).value,r=t==null?`__EMPTY_${e-i}`:String(t);c[r]===void 0?c[r]=0:(c[r]++,r=`${r}_${c[r]}`),s.push(r)}let l=[],u=n+1,d=t.blankRows===!0;for(let e=u;e<=r;e++){let n={},r=!0;for(let o=i;o<=a;o++){let a=this.getCell(e,o),c=t.raw===!1?jl(a,t.dateFormat).trim():a.value,l=s[o-i];c!=null&&c!==``?(n[l]=c,r=!1):t.defaultValue!==void 0&&(n[l]=t.defaultValue)}(!r||d)&&l.push(n)}return l}addJSON(e,t){if(e.length===0)return this;let n=t||{},r=1,i=1;if(n.origin!==void 0){let e=q_(n.origin,this.rowCount);r=e.row,i=e.col}let a=new Set;e.forEach(e=>Object.keys(e).forEach(e=>a.add(e)));let o=n.header?[...n.header]:[...a];n.header&&a.forEach(e=>{o.includes(e)||o.push(e)});let s=r;n.skipHeader||(o.forEach((e,t)=>{this.getCell(s,i+t).value=e}),s++);for(let t of e)o.forEach((e,r)=>{let a=t[e];a===null&&n.nullError?this.getCell(s,i+r).value={error:`#NULL!`}:a!=null&&(this.getCell(s,i+r).value=a)}),s++;return this}toAOA(){let e=[];return this.eachRow({includeEmpty:!0},(t,n)=>{let r=[];t.eachCell({includeEmpty:!0},(e,t)=>{r[t-1]=e.value}),e[n-1]=r}),e}addAOA(e,t){if(e.length===0)return this;let n=1,r=1;if(t?.origin!==void 0){let e=q_(t.origin,this.rowCount);n=e.row,r=e.col}return e.forEach((e,t)=>{e&&e.forEach((e,i)=>{e!=null&&(this.getCell(n+t,r+i).value=e)})}),this}};function q_(e,t){if(typeof e==`string`){let t=Jg(e);return{row:t.r+1,col:t.c+1}}return typeof e==`number`?e===-1?{row:t+1,col:1}:{row:e+1,col:1}:{row:e.r+1,col:e.c+1}}let J_=BigInt(2**53-1);function Y_(e,t){if(e>J_)throw Error(`ZIP64 ${t} value ${e} exceeds Number.MAX_SAFE_INTEGER. The archive may be corrupted or malicious.`);return Number(e)}function X_(e){return e.encoding?da(e.encoding):void 0}function Z_(e,t=!1){for(let n=e.length-22;n>=0;n--)if(e[n]===80&&e[n+1]===75&&e[n+2]===5&&e[n+3]===6)if(t){let t=e[n+20]|e[n+21]<<8;if(n+22+t===e.length)return n}else return n;return-1}function Q_(e,t){let n=t-20;return n<0?-1:e[n]===80&&e[n+1]===75&&e[n+2]===6&&e[n+3]===7?n:-1}function $_(e,t,n=!0,r){let i=new ba(e,t);i.skip(4);let a=i.readUint16(),o=i.readUint16(),s=i.readUint16(),c=i.readUint16(),l=i.readUint32(),u=i.readUint32(),d=i.readUint16(),f=``;if(d>0){let e=i.readBytes(d);n&&(f=r?r.decode(e):wn(e))}return{eocd:{diskNumber:a,centralDirDisk:o,entriesOnDisk:s,totalEntries:c,centralDirSize:l,centralDirOffset:u},comment:f}}function ev(e,t){let n=new ba(e,t);return n.readUint32()===117853008?(n.skip(4),Y_(n.readBigUint64(),`EOCD locator offset`)):-1}function tv(e,t){let n=new ba(e,t);return n.readUint32()===101075792?(n.skip(8),n.skip(2),n.skip(2),n.skip(4),n.skip(4),{entriesOnDisk:n.readBigUint64(),totalEntries:n.readBigUint64(),centralDirSize:n.readBigUint64(),centralDirOffset:n.readBigUint64()}):null}function nv(e,t){e.totalEntries===65535&&(e.totalEntries=Y_(t.totalEntries,`totalEntries`)),e.entriesOnDisk===65535&&(e.entriesOnDisk=Y_(t.entriesOnDisk,`entriesOnDisk`)),e.centralDirSize===4294967295&&(e.centralDirSize=Y_(t.centralDirSize,`centralDirSize`)),e.centralDirOffset===4294967295&&(e.centralDirOffset=Y_(t.centralDirOffset,`centralDirOffset`))}function rv(e,t,n){let r=e.readUint16();e.skip(2);let i=e.readUint16(),a=e.readUint16(),o=e.readUint16(),s=e.readUint16(),c=e.readUint32(),l=e.readUint32(),u=e.readUint32(),d=e.readUint16(),f=e.readUint16(),p=e.readUint16();e.skip(2),e.skip(2);let m=e.readUint32(),h=e.readUint32(),g=d>0?e.readBytes(d):new Uint8Array,_={},v=new Uint8Array;if(f>0){v=e.readBytes(f);let t={compressedSize:l,uncompressedSize:u,offsetToLocalFileHeader:h};_=vo(v,t),l=t.compressedSize,u=t.uncompressedSize,h=t.offsetToLocalFileHeader??h}let y=p>0?e.readBytes(p):new Uint8Array,b=t?ha(g,i,_,n):``,x=t?ga(y,i,_,n):``,S=ko(m),C=r>>8&255,ee=Ao(S),te=jo(S)||C===0&&(m&16)!=0||b.endsWith(`/`),ne=(i&1)!=0,re=ee?`symlink`:te?`directory`:`file`,ie=_.mtimeUnixSeconds,ae=Aa(s,o,ie),oe=`none`,se,ce,le;return ne&&(a===99&&_.aesInfo?(oe=`aes`,se=_.aesInfo.version,ce=_.aesInfo.keyStrength,le=_.aesInfo.compressionMethod):oe=`zipcrypto`),{path:b,type:re,compressedSize:l,compressedSize64:_.compressedSize64,uncompressedSize:u,uncompressedSize64:_.uncompressedSize64,compressionMethod:a,crc32:c,lastModified:ae,localHeaderOffset:h,localHeaderOffset64:_.offsetToLocalFileHeader64,comment:x,externalAttributes:m,mode:S,versionMadeBy:r,extraField:v,isEncrypted:ne,encryptionMethod:oe,aesVersion:se,aesKeyStrength:ce,originalCompressionMethod:le,dosTime:o}}function iv(e,t,n,r={}){let i=r.decodeStrings??!0,a=X_(r);if(n===0)return[];let o=Array(n),s=new ba(e,t);for(let e=0;e<n;e++){if(s.readUint32()!==33639248)throw Error(`Invalid Central Directory header signature at entry ${e}`);o[e]=rv(s,i,a)}return o}function av(e,t={}){let n=t.decodeStrings??!0,r=X_(t),i=Z_(e);if(i===-1)throw Error(`Invalid ZIP file: End of Central Directory not found`);let{eocd:a,comment:o}=$_(e,i,n,r),s=Q_(e,i);if(s!==-1){let t=ev(e,s);if(t>=0){let n=tv(e,t);n&&nv(a,n)}}return{entries:iv(e,a.centralDirOffset,a.totalEntries,t),comment:o}}let ov=512*1024*1024;async function sv(e,t,n,r=!1,i=!0){let a;if(i&&e.uncompressedSize>ov)throw Error(`Entry "${e.path}" declares uncompressed size of ${e.uncompressedSize} bytes, which exceeds the maximum allowed size of ${ov} bytes. Use the streaming API for large entries.`);if(e.isEncrypted){if(!n)throw new Xi(e.path);if(e.encryptionMethod===`aes`&&e.aesKeyStrength){let r=await co(t,n,e.aesKeyStrength);if(!r)throw new Yi(e.path);a=await lv(r,e.originalCompressionMethod??0,e.path)}else if(e.encryptionMethod===`zipcrypto`){let r=ip(t,n,e.crc32,e.dosTime);if(!r)throw new Yi(e.path);a=await lv(r,e.compressionMethod,e.path)}else throw new Yi(e.path,`Unsupported encryption method`)}else a=await lv(t,e.compressionMethod,e.path);if(i&&a.length!==e.uncompressedSize){let t=a.length>e.uncompressedSize?`too-many-bytes`:`too-few-bytes`;throw new Ji(e.path,e.uncompressedSize,a.length,t)}if(e.encryptionMethod===`zipcrypto`||r&&e.encryptionMethod!==`aes`){let t=na(a);if(t!==e.crc32)throw new qi(e.path,e.crc32,t)}return a}function cv(e,t,n,r=!0){let i;if(r&&e.uncompressedSize>ov)throw Error(`Entry "${e.path}" declares uncompressed size of ${e.uncompressedSize} bytes, which exceeds the maximum allowed size of ${ov} bytes. Use the streaming API for large entries.`);if(e.isEncrypted){if(!n)throw new Xi(e.path);if(e.encryptionMethod===`aes`)throw Error(`File "${e.path}" uses AES encryption. Use the async extract() method instead of extractSync().`);if(e.encryptionMethod===`zipcrypto`){let r=ip(t,n,e.crc32,e.dosTime);if(!r)throw new Yi(e.path);i=uv(r,e.compressionMethod,e.path);let a=na(i);if(a!==e.crc32)throw new qi(e.path,e.crc32,a)}else throw new Yi(e.path,`Unsupported encryption method`)}else i=uv(t,e.compressionMethod,e.path);if(r&&i.length!==e.uncompressedSize){let t=i.length>e.uncompressedSize?`too-many-bytes`:`too-few-bytes`;throw new Ji(e.path,e.uncompressedSize,i.length,t)}return i}async function lv(e,t,n){if(t===0)return e;if(t===8)return Rf(e);throw new Zi(t)}function uv(e,t,n){if(t===0)return e;if(t===8)return zf(e);throw new Zi(t)}function dv(e,t){if(e.readUint32()!==67324752)throw Error(`Invalid local file header signature at offset ${t}`);e.skip(2),e.skip(2),e.skip(2),e.skip(2),e.skip(2),e.skip(4),e.skip(4),e.skip(4);let n=e.readUint16(),r=e.readUint16();return e.skip(n),e.skip(r),e.position}function fv(e,t){let n=dv(new ba(e,t.localHeaderOffset),t.localHeaderOffset);return e.subarray(n,n+t.compressedSize)}let pv=BigInt(2**53-1);function mv(e){if(e.uncompressedSize64!==void 0&&e.uncompressedSize64>pv||e.compressedSize64!==void 0&&e.compressedSize64>pv)throw Error(`File "${e.path}" is too large to extract into memory (ZIP64 size > 2^53-1)`);if(e.localHeaderOffset64!==void 0&&e.localHeaderOffset64>pv)throw Error(`File "${e.path}" has a ZIP64 offset > 2^53-1 and cannot be extracted by the in-memory parser`)}function hv(e,t={}){return av(e,{decodeStrings:t.decodeStrings,encoding:t.encoding})}async function gv(e,t,n={}){return t.type===`directory`?P:(mv(t),sv(t,fv(e,t),n.password))}function _v(e,t,n={}){return t.type===`directory`?P:(mv(t),cv(t,fv(e,t),n.password))}var vv=class{constructor(e,t={}){this.data=e instanceof ArrayBuffer?new Uint8Array(e):e;let n=hv(this.data,t);this.entries=n.entries,this.archiveComment=n.comment,this.entryMap=new Map(this.entries.map(e=>[e.path,e])),this.password=t.password}setPassword(e){this.password=e}getEntries(){return this.entries}getEntry(e){return this.entryMap.get(e)}getRawCompressedData(e){let t=this.entryMap.get(e);return t?fv(this.data,t):null}getRawEntry(e){let t=this.entryMap.get(e);return t?{info:t,compressedData:fv(this.data,t)}:null}hasEntry(e){return this.entryMap.has(e)}childCount(e){let t=this.entryMap.get(e);if(t&&t.type!==`directory`)return 0;let n=e.endsWith(`/`)?e:e+`/`,r=t?.type===`directory`?t:this.entryMap.get(n),i=(r?.path??n).endsWith(`/`)?r?.path??n:(r?.path??n)+`/`,a=0;for(let e of this.entries)e.path.startsWith(i)&&e.path!==i&&a++;return a}getZipComment(){return this.archiveComment}hasEncryptedEntries(){return this.entries.some(e=>e.isEncrypted)}getEncryptedEntries(){return this.entries.filter(e=>e.isEncrypted)}listFiles(){return this.entries.map(e=>e.path)}async extract(e,t){let n=this.entryMap.get(e);return n?gv(this.data,n,{password:t??this.password}):null}extractSync(e,t){let n=this.entryMap.get(e);return n?_v(this.data,n,{password:t??this.password}):null}async extractAll(e){let t=new Map,n=e??this.password;for(let e of this.entries){let r=await gv(this.data,e,{password:n});t.set(e.path,r)}return t}extractAllSync(e){let t={},n=e??this.password;for(let e of this.entries)t[e.path]=_v(this.data,e,{password:n});return t}async forEach(e,t){let n=t??this.password;for(let t of this.entries){let r=null;if(await e(t,()=>(r||=gv(this.data,t,{password:n}),r))===!1)break}}};let yv=/\[([^\]\\/:*?"<>|\s]+)\]([A-Za-z_\u00A1-\uFFFF][A-Za-z0-9_\u00A1-\uFFFF.]*)!/g,bv=/'\[([^\]]+)\]((?:''|[^'])+)'!/g;function xv(e){if(e.indexOf(`[`)===-1)return[];let t=[],n=Cv(e),r=(e,r,i,a,o,s)=>{if(wv(e,n))return;let c=/^\d+$/.test(i);t.push({match:s,workbook:i,numeric:c,index:c?parseInt(i,10):null,sheet:Tv(a),quoted:o,start:e,end:r})};yv.lastIndex=0;let i;for(;(i=yv.exec(e))!==null;)r(i.index,i.index+i[0].length,i[1],i[2],!1,i[0]);for(bv.lastIndex=0;(i=bv.exec(e))!==null;)r(i.index,i.index+i[0].length,i[1],i[2],!0,i[0]);t.sort((e,t)=>e.start-t.start);let a=[],o=-1;for(let e of t)e.start>=o&&(a.push(e),o=e.end);return a}function Sv(e,t){let n=xv(e);if(n.length===0)return e;let r=``,i=0;for(let a of n){let n=t(a);if(n!==null){if(r+=e.slice(i,a.start),a.quoted){let t=e.slice(a.start+1,a.end-2);r+=`'`+t.replace(/^\[[^\]]*\]/,`[${n}]`)+`'!`}else r+=`[${n}]${a.match.slice(a.match.indexOf(`]`)+1)}`;i=a.end}}return r+=e.slice(i),r}function Cv(e){if(e.indexOf(`"`)===-1)return[];let t=[],n=e.length,r=0;for(;r<n;)if(e[r]===`"`){let i=r;for(r++;r<n;){if(e[r]===`"`){if(r+1<n&&e[r+1]===`"`){r+=2;continue}r++;break}r++}t.push([i,r])}else r++;return t}function wv(e,t){for(let[n,r]of t)if(e>=n&&e<r)return!0;return!1}function Tv(e){return e.replace(/''/g,`'`)}let Ev=new Map([[/^xl\/charts\/chart\d+\.xml$/,`application/vnd.openxmlformats-officedocument.drawingml.chart+xml`],[/^xl\/charts\/style\d+\.xml$/,`application/vnd.ms-office.chartstyle+xml`],[/^xl\/charts\/colors\d+\.xml$/,`application/vnd.ms-office.chartcolorstyle+xml`]]),Dv=[`xl/charts/`];var Ov=class e{constructor(){this.files=new Map}static isPassthroughPath(e){return Dv.some(t=>e.startsWith(t))}static getContentType(e){if(!e.startsWith(`xl/charts/_rels/`)){for(let[t,n]of Ev)if(t.test(e))return n}}add(e,t){this.files.set(e,t)}get(e){return this.files.get(e)}has(e){return this.files.has(e)}getPaths(){return[...this.files.keys()]}toRecord(){let e={};for(let[t,n]of this.files)e[t]=n;return e}fromRecord(e){this.files.clear();for(let[t,n]of Object.entries(e))this.files.set(t,n)}getContentTypes(){let t=[];for(let n of this.files.keys()){let r=e.getContentType(n);r&&t.push({partName:n,contentType:r})}return t}writeToZip(e){for(let[t,n]of this.files)e.append(n,{name:t})}clear(){this.files.clear()}get size(){return this.files.size}};let kv={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`};var Av=class extends U{constructor(...e){super(...e),this.sheetNamesByIndex=[],this.currentSheetCells=null,this.currentSheetName=null,this.currentCellAddress=null,this.currentCellType=`n`,this.currentCellValue=null,this.inV=!1}get tag(){return`externalLink`}reset(){super.reset(),this.sheetNamesByIndex=[],this.currentSheetCells=null,this.currentSheetName=null,this.currentCellAddress=null,this.currentCellType=`n`,this.currentCellValue=null,this.inV=!1}render(e,t){if(e.openXml(z),e.openNode(`externalLink`,kv),e.openNode(`externalBook`,{"r:id":`rId1`}),t.sheetNames.length>0){e.openNode(`sheetNames`);for(let n of t.sheetNames)e.leafNode(`sheetName`,{val:n});e.closeNode()}let n=t.cachedValues??{};if(Object.keys(n).some(e=>{let t=n[e];return t&&Object.keys(t).length>0})){e.openNode(`sheetDataSet`);for(let r=0;r<t.sheetNames.length;r++){let i=n[t.sheetNames[r]];!i||Object.keys(i).length===0||jv(e,r,i)}e.closeNode()}e.closeNode(),e.closeNode()}parseOpen(e){switch(e.name){case`externalLink`:return this.model={externalBookRId:``,sheetNames:[],cachedValues:{}},this.sheetNamesByIndex=[],!0;case`externalBook`:return this.model&&(this.model.externalBookRId=e.attributes[`r:id`]??``),!0;case`sheetName`:if(this.model){let t=e.attributes.val??``;this.model.sheetNames.push(t),this.sheetNamesByIndex.push(t)}return!0;case`sheetData`:{let t=e.attributes.sheetId,n=t===void 0?NaN:parseInt(t,10);return this.currentSheetName=Number.isFinite(n)?this.sheetNamesByIndex[n]??null:null,this.currentSheetCells=this.currentSheetName?{}:null,!0}case`cell`:return this.currentCellAddress=e.attributes.r??null,this.currentCellType=e.attributes.t??`n`,this.currentCellValue=null,!0;case`v`:return this.inV=!0,this.currentCellValue=``,!0;default:return!1}}parseText(e){this.inV&&(this.currentCellValue=(this.currentCellValue??``)+e)}parseClose(e){switch(e){case`v`:return this.inV=!1,!0;case`cell`:return this.model&&this.currentSheetCells&&this.currentCellAddress&&(this.currentSheetCells[this.currentCellAddress.toUpperCase()]=Rv(this.currentCellType,this.currentCellValue)),this.currentCellAddress=null,this.currentCellType=`n`,this.currentCellValue=null,!0;case`sheetData`:return this.model&&this.currentSheetName&&this.currentSheetCells&&Object.keys(this.currentSheetCells).length>0&&(this.model.cachedValues[this.currentSheetName]=this.currentSheetCells),this.currentSheetName=null,this.currentSheetCells=null,!0;case`externalLink`:return!1;default:return!0}}};function jv(e,t,n){let r=Mv(n);e.openNode(`sheetData`,{sheetId:t});for(let t of r){e.openNode(`row`,{r:t.rowNum});for(let{address:n,value:r}of t.cells)Fv(e,n,r);e.closeNode()}e.closeNode()}function Mv(e){let t=new Map;for(let n of Object.keys(e)){let r=n.toUpperCase(),i=Nv(r);if(i===void 0)continue;let a=t.get(i);a||(a={rowNum:i,cells:[]},t.set(i,a)),a.cells.push({address:Pv(r),value:e[n]})}return[...t.values()].sort((e,t)=>e.rowNum-t.rowNum)}function Nv(e){let t=/^\$?[A-Z]+\$?(\d+)$/.exec(e);return t?parseInt(t[1],10):void 0}function Pv(e){return e.replace(/\$/g,``)}function Fv(e,t,n){if(n==null){e.leafNode(`cell`,{r:t});return}if(typeof n==`number`){e.openNode(`cell`,{r:t}),e.leafNode(`v`,void 0,String(n)),e.closeNode();return}if(typeof n==`boolean`){e.openNode(`cell`,{r:t,t:`b`}),e.leafNode(`v`,void 0,n?`1`:`0`),e.closeNode();return}if(Lv(n)){e.openNode(`cell`,{r:t,t:`e`}),e.leafNode(`v`,void 0,n),e.closeNode();return}e.openNode(`cell`,{r:t,t:`str`}),e.leafNode(`v`,void 0,n),e.closeNode()}let Iv=new Set([`#NULL!`,`#DIV/0!`,`#VALUE!`,`#REF!`,`#NAME?`,`#NUM!`,`#N/A`,`#GETTING_DATA`,`#SPILL!`,`#CALC!`,`#CONNECT!`,`#BLOCKED!`,`#UNKNOWN!`,`#FIELD!`,`#PYTHON!`]);function Lv(e){return Iv.has(e)}function Rv(e,t){if(t===null||t===``)return null;switch(e){case`b`:return t!==`0`&&t.toLowerCase()!==`false`;case`e`:return t;case`str`:return t;default:{let e=Number(t);return Number.isFinite(e)?e:t}}}let zv=`Author`;var Bv=class e extends U{constructor(){super(),this._authors=[],this._inAuthors=!1,this._inAuthor=!1,this._currentAuthor=``,this.map={comment:new Hp},this.model={comments:[]}}render(t,n){let r=n||this.model;t.openXml(z),t.openNode(`comments`,e.COMMENTS_ATTRIBUTES);let i=new Set;for(let e of r.comments)i.add(e.author??zv);let a=[...i];t.openNode(`authors`);for(let e of a)t.leafNode(`author`,null,e);t.closeNode(),t.openNode(`commentList`),r.comments.forEach(e=>{let n=a.indexOf(e.author??zv);this.map.comment.render(t,{...e,authorId:n>=0?n:0})}),t.closeNode(),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`authors`:return this._inAuthors=!0,this._authors=[],!0;case`author`:return this._inAuthors&&(this._inAuthor=!0,this._currentAuthor=``),!0;case`commentList`:return this.model={comments:[]},!0;case`comment`:return this.parser=this.map.comment,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this._inAuthor?this._currentAuthor+=e:this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case`authors`:return this._inAuthors=!1,!0;case`author`:return this._inAuthors&&(this._authors.push(this._currentAuthor),this._inAuthor=!1,this._currentAuthor=``),!0;case`commentList`:for(let e of this.model.comments){let{authorId:t}=e;t!=null&&t>=0&&t<this._authors.length&&(e.author=this._authors[t])}return!1;case`comment`:return this.model.comments.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}static{this.COMMENTS_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`}}},Vv=class extends U{_checkedToXmlValue(e){switch(e){case`Checked`:return`1`;case`Mixed`:return`2`;default:return`0`}}get tag(){return`formControlPr`}render(e,t){let n=t||this.model,r={xmlns:`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`,objectType:`CheckBox`,checked:this._checkedToXmlValue(n.checked),lockText:`1`};n.link&&(r.fmlaLink=n.link),n.noThreeD&&(r.noThreeD=`1`),e.openXml({version:`1.0`,encoding:`UTF-8`,standalone:`yes`}),e.leafNode(this.tag,r)}toXml(e){let t=new Sd;return this.render(t,e),t.xml}parseOpen(){return!0}parseText(){}parseClose(){return!1}},Hv=class e extends U{constructor(){super(),this._parsingHeaderImage=!1,this.map={"v:shape":new Yp},this.model={comments:[],formControls:[]}}get tag(){return`xml`}render(t,n){let r=n||this.model,i=r.comments,a=r.formControls,o=r.headerImage,s=i&&i.length>0,c=a&&a.length>0,l=!!o;if(t.openXml(z),t.openNode(this.tag,e.DRAWING_ATTRIBUTES),t.openNode(`o:shapelayout`,{"v:ext":`edit`}),t.leafNode(`o:idmap`,{"v:ext":`edit`,data:1}),t.closeNode(),s&&(t.openNode(`v:shapetype`,{id:`_x0000_t202`,coordsize:`21600,21600`,"o:spt":202,path:`m,l,21600r21600,l21600,xe`}),t.leafNode(`v:stroke`,{joinstyle:`miter`}),t.leafNode(`v:path`,{gradientshapeok:`t`,"o:connecttype":`rect`}),t.closeNode()),c&&(t.openNode(`v:shapetype`,{id:`_x0000_t201`,coordsize:`21600,21600`,"o:spt":`201`,path:`m,l,21600r21600,l21600,xe`}),t.leafNode(`v:stroke`,{joinstyle:`miter`}),t.leafNode(`v:path`,{shadowok:`f`,"o:extrusionok":`f`,strokeok:`f`,fillok:`f`,"o:connecttype":`rect`}),t.leafNode(`o:lock`,{"v:ext":`edit`,shapetype:`t`}),t.closeNode()),l&&(t.openNode(`v:shapetype`,{id:`_x0000_t75`,coordsize:`21600,21600`,"o:spt":`75`,"o:preferrelative":`t`,path:`m@4@5l@4@11@9@11@9@5xe`,filled:`f`,stroked:`f`}),t.leafNode(`v:stroke`,{joinstyle:`miter`}),t.openNode(`v:formulas`),t.leafNode(`v:f`,{eqn:`if lineDrawn pixelLineWidth 0`}),t.leafNode(`v:f`,{eqn:`sum @0 1 0`}),t.leafNode(`v:f`,{eqn:`sum 0 0 @1`}),t.leafNode(`v:f`,{eqn:`prod @2 1 2`}),t.leafNode(`v:f`,{eqn:`prod @3 21600 pixelWidth`}),t.leafNode(`v:f`,{eqn:`prod @3 21600 pixelHeight`}),t.leafNode(`v:f`,{eqn:`sum @0 0 1`}),t.leafNode(`v:f`,{eqn:`prod @6 1 2`}),t.leafNode(`v:f`,{eqn:`prod @7 21600 pixelWidth`}),t.leafNode(`v:f`,{eqn:`sum @8 21600 0`}),t.leafNode(`v:f`,{eqn:`prod @7 21600 pixelHeight`}),t.leafNode(`v:f`,{eqn:`sum @10 21600 0`}),t.closeNode(),t.leafNode(`v:path`,{"o:extrusionok":`f`,gradientshapeok:`t`,"o:connecttype":`rect`}),t.leafNode(`o:lock`,{"v:ext":`edit`,aspectratio:`t`}),t.closeNode()),s)for(let e=0;e<i.length;e++)this.map[`v:shape`].render(t,i[e],e);if(c)for(let e of a)this._renderCheckboxShape(t,e);l&&this._renderHeaderImageShape(t,o),t.closeNode()}_renderHeaderImageShape(e,t){let n=t.width??467.25,r=t.height??311.25;e.openNode(`v:shape`,{id:`CH`,"o:spid":`_x0000_s2049`,type:`#_x0000_t75`,style:`position:absolute;margin-left:0;margin-top:0;width:${n}pt;height:${r}pt;z-index:1`}),e.leafNode(`v:imagedata`,{"o:relid":t.imageRelId,"o:title":`watermark`}),e.leafNode(`o:lock`,{"v:ext":`edit`,rotation:`t`}),e.closeNode()}_renderCheckboxShape(e,t){let n={id:`_x0000_s${t.shapeId}`,type:`#_x0000_t201`,style:Sg.getVmlStyle(t),"o:insetmode":`auto`,fillcolor:`buttonFace [67]`,strokecolor:`windowText [64]`,"o:preferrelative":`t`,filled:`f`,stroked:`f`};e.openNode(`v:shape`,n),e.leafNode(`v:fill`,{"o:detectmouseclick":`t`}),e.leafNode(`o:lock`,{"v:ext":`edit`,text:`t`}),t.text&&(e.openNode(`v:textbox`,{style:`mso-direction-alt:auto`,"o:singleclick":`t`}),e.openNode(`div`,{style:`text-align:left`}),e.openNode(`font`,{face:`Tahoma`,size:`160`,color:`auto`}),e.writeText(t.text),e.closeNode(),e.closeNode(),e.closeNode()),e.openNode(`x:ClientData`,{ObjectType:`Checkbox`}),e.leafNode(`x:MoveWithCells`),e.leafNode(`x:SizeWithCells`),e.openNode(`x:Anchor`),e.writeText(Sg.getVmlAnchor(t)),e.closeNode(),e.leafNode(`x:Locked`,void 0,`False`),e.leafNode(`x:LockText`,void 0,`True`),e.leafNode(`x:PrintObject`,void 0,t.print?`True`:`False`),e.leafNode(`x:AutoFill`,void 0,`False`),e.leafNode(`x:AutoLine`,void 0,`False`),e.leafNode(`x:TextHAlign`,void 0,`Left`),e.leafNode(`x:TextVAlign`,void 0,`Center`),t.link&&e.leafNode(`x:FmlaLink`,void 0,t.link),t.noThreeD&&e.leafNode(`x:NoThreeD`),e.leafNode(`x:Checked`,void 0,String(Sg.getVmlCheckedValue(t))),e.leafNode(`x:Row`,void 0,String(t.tl.row)),e.leafNode(`x:Column`,void 0,String(t.tl.col)),e.closeNode(),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={comments:[],formControls:[]};break;case`v:shape`:if(e.attributes.type===`#_x0000_t75`){this._parsingHeaderImage=!0;let t=e.attributes.style||``,n=/width:([0-9.]+)pt/.exec(t),r=/height:([0-9.]+)pt/.exec(t);this._headerImageWidth=n?parseFloat(n[1]):void 0,this._headerImageHeight=r?parseFloat(r[1]):void 0}else this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break;default:this._parsingHeaderImage&&e.name===`v:imagedata`?this._headerImageRelId=e.attributes[`o:relid`]:(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e));break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.comments.push(this.parser.model),this.parser=void 0),!0;switch(e){case`v:shape`:return this._parsingHeaderImage&&this._headerImageRelId&&(this.model.headerImage={imageRelId:this._headerImageRelId,width:this._headerImageWidth,height:this._headerImageHeight}),this._parsingHeaderImage=!1,this._headerImageRelId=void 0,this._headerImageWidth=void 0,this._headerImageHeight=void 0,!0;case this.tag:return!1;default:return!0}}static{this.DRAWING_ATTRIBUTES={"xmlns:v":`urn:schemas-microsoft-com:vml`,"xmlns:o":`urn:schemas-microsoft-com:office:office`,"xmlns:x":`urn:schemas-microsoft-com:office:excel`}}};function Uv(e){return isNaN(e.getTime())?``:e.toISOString().replace(/\.\d{3}Z$/,``)}function Wv(e){let t=R(e.name),n=e.numFmtId??`0`,r=Kv(e.extraAttrs),i=e.fieldGroupXml?`\n ${e.fieldGroupXml}`:``;if(e.sharedItems===null){if(e.isLoaded)return i?`<cacheField name="${t}" numFmtId="${n}"${r}>${i}\n </cacheField>`:`<cacheField name="${t}" numFmtId="${n}"${r} />`;let a;return a=e.minValue!==void 0&&e.maxValue!==void 0?` containsSemiMixedTypes="0" containsString="0" containsNumber="1"${e.containsInteger?` containsInteger="1"`:``} minValue="${e.minValue}" maxValue="${e.maxValue}"`:``,`<cacheField name="${t}" numFmtId="${n}"${r}>
|
|
403
|
+
`}let Lf=null,Rf=0;function zf(){if(Lf===null){let e=If(),t=new Blob([e],{type:`text/javascript`});Lf=URL.createObjectURL(t)}return Rf++,Lf}function Bf(){if(Lf!==null&&--Rf<=0){try{URL.revokeObjectURL(Lf)}catch{}Lf=null,Rf=0}}let Vf=new Uint8Array,Hf={onData:e=>{},onEnd:()=>{},onError:e=>{}};function Uf(e){return e.byteOffset===0&&e.byteLength===e.buffer.byteLength}function Wf(e){return Uf(e)?e:e.slice()}var Gf=class{_taskQueueSize(){return this._taskQueue.length-this._taskQueueHead}_compactTaskQueueIfNeeded(){this._taskQueueHead>32&&this._taskQueueHead*2>=this._taskQueue.length&&(this._taskQueue.splice(0,this._taskQueueHead),this._taskQueueHead=0)}_dequeueTask(){if(this._taskQueueHead>=this._taskQueue.length)return;let e=this._taskQueue[this._taskQueueHead++];return this._compactTaskQueueIfNeeded(),e}_compactPendingStreamRequestsIfNeeded(){this._pendingStreamRequestHead>32&&this._pendingStreamRequestHead*2>=this._pendingStreamRequests.length&&(this._pendingStreamRequests.splice(0,this._pendingStreamRequestHead),this._pendingStreamRequestHead=0)}_dequeuePendingStreamRequest(){if(this._pendingStreamRequestHead>=this._pendingStreamRequests.length)return;let e=this._pendingStreamRequests[this._pendingStreamRequestHead++];return this._compactPendingStreamRequestsIfNeeded(),e}_waitForStreamSlot(e){return e.slotWaitPromise||=new Promise(t=>{e.resolveSlotWait=()=>{e.slotWaitPromise=null,e.resolveSlotWait=null,t()}}),e.slotWaitPromise}_waitForStreamDrain(e){return e.drainWaitPromise||=new Promise(t=>{e.resolveDrainWait=()=>{e.drainWaitPromise=null,e.resolveDrainWait=null,t()}}),e.drainWaitPromise}_resolveSlotWaiter(e){e.resolveSlotWait?.()}_resolveDrainWaiter(e){e.resolveDrainWait?.()}constructor(e){this._workers=new Map,this._taskQueue=[],this._taskQueueHead=0,this._pendingTasks=new Map,this._nextTaskId=1,this._nextWorkerId=1,this._terminated=!1,this._completedTasks=0,this._failedTasks=0,this._pendingStreamRequests=[],this._pendingStreamRequestHead=0,this._options=Mf(e),this._options.workerUrl?(this._workerUrl=this._options.workerUrl,this._useCustomUrl=!0):(this._workerUrl=zf(),this._useCustomUrl=!1);for(let e=0;e<this._options.minWorkers;e++)this._createWorker()}async execute(e,t,n){if(this._terminated)throw Error(`Worker pool has been terminated`);if(!Ff())throw Error(`Web Workers are not supported in this environment`);if(n?.signal?.aborted)throw i();let r=this._nextTaskId++,a=n?.priority??`normal`,o=Pf(a);return new Promise((i,s)=>{let c={taskId:r,taskType:e,data:t,level:n?.level,priority:a,priorityValue:o,resolve:i,reject:s,signal:n?.signal,allowTransfer:n?.allowTransfer,startTime:performance.now()};n?.signal&&(c.abortHandler=()=>{this._cancelTask(r)},n.signal.addEventListener(`abort`,c.abortHandler,{once:!0})),this._pendingTasks.set(r,c),this._enqueueTask(c),this._processQueue()})}getStats(){let e=this._workers.size,t=0;for(let e of this._workers.values())e.busy&&t++;return{totalWorkers:e,activeWorkers:t,idleWorkers:e-t,pendingTasks:this._taskQueueSize(),completedTasks:this._completedTasks,failedTasks:this._failedTasks}}terminate(){if(this._terminated)return;this._terminated=!0;for(let e of this._workers.values())this._terminateWorker(e);this._workers.clear();let e=Error(`Worker pool terminated`);for(let t of this._pendingTasks.values())this._cleanupTask(t),t.reject(e);this._pendingTasks.clear(),this._taskQueue.length=0,this._taskQueueHead=0,this._pendingStreamRequests.length=0,this._pendingStreamRequestHead=0,this._useCustomUrl||Bf()}isTerminated(){return this._terminated}_createWorker(){if(this._terminated||this._workers.size>=this._options.maxWorkers)return null;let e=this._nextWorkerId++,t=new Worker(this._workerUrl),n={id:e,worker:t,busy:!1,currentTaskId:null,idleTimer:null,streamSession:null};return t.onmessage=e=>{this._handleWorkerMessage(n,e.data)},t.onerror=e=>{this._handleWorkerError(n,e)},this._workers.set(e,n),n}_terminateWorker(e){this._clearIdleTimer(e);try{e.worker.postMessage({type:`terminate`})}catch{}try{e.worker.terminate()}catch{}this._workers.delete(e.id)}_clearIdleTimer(e){e.idleTimer!==null&&(clearTimeout(e.idleTimer),e.idleTimer=null)}_findIdleWorker(){for(let e of this._workers.values())if(!e.busy)return e}_enqueueTask(e){let t=this._taskQueue,n=e.priorityValue;this._compactTaskQueueIfNeeded();let r=this._taskQueueHead,i=t.length;for(;r<i;){let e=r+i>>>1;t[e].priorityValue>=n?r=e+1:i=e}t.splice(r,0,e)}_processQueue(){for(;!this._terminated&&this._taskQueueSize()>0;){let e=this._findIdleWorker()??this._createWorker()??void 0;if(!e)return;for(;;){let t=this._dequeueTask();if(!t)return;if(t.signal?.aborted){this._pendingTasks.delete(t.taskId),this._cleanupTask(t),t.reject(i());continue}this._assignTask(e,t);break}}}_assignTask(e,t){this._clearIdleTimer(e),e.busy=!0,e.currentTaskId=t.taskId;let n=this._options.useTransferables&&t.allowTransfer===!0,r=n?Wf(t.data):t.data,i={type:`task`,taskId:t.taskId,taskType:t.taskType,data:r,level:t.level};n?e.worker.postMessage(i,[r.buffer]):e.worker.postMessage(i)}_handleWorkerMessage(e,t){if(t.type!==`ready`){if(e.streamSession){let n=e.streamSession;switch(t.type){case`started`:if(t.taskId!==n.taskId)return;n.startReady=!0,n.resolveStart?.(),n.resolveStart=null,n.rejectStart=null;return;case`out`:if(t.taskId!==n.taskId)return;n.onData(t.data);return;case`ack`:if(t.taskId!==n.taskId)return;n.inflightChunkCount>0&&n.inflightChunkCount--,this._resolveSlotWaiter(n),n.inflightChunkCount===0&&n.resolveDrainWait&&this._resolveDrainWaiter(n);return;case`done`:if(t.taskId!==n.taskId)return;n.ended=!0,n.inflightChunkCount=0,n.startReady=!0,n.resolveStart?.(),n.resolveStart=null,n.rejectStart=null,this._resolveSlotWaiter(n),this._resolveDrainWaiter(n),this._completedTasks++,t.duration??performance.now()-n.startTime,n.onEnd(),e.streamSession=null,this._workerBecameIdle(e);return;case`error`:{if(t.taskId!==n.taskId)return;let r=Error(t.error??`Unknown worker error`);n.ended=!0,n.inflightChunkCount=0,n.startReady=!0,n.rejectStart?.(r),n.resolveStart=null,n.rejectStart=null,this._resolveSlotWaiter(n),this._resolveDrainWaiter(n),this._failedTasks++,n.onError(r),e.streamSession=null,this._workerBecameIdle(e);return}default:break}}switch(t.type){case`result`:case`error`:{let n=t.taskId;if(typeof n!=`number`)return;let r=this._pendingTasks.get(n);if(!r){this._workerBecameIdle(e);return}if(this._pendingTasks.delete(n),this._cleanupTask(r),t.type===`result`){this._completedTasks++;let e=t.duration??performance.now()-r.startTime;r.resolve({data:t.data,duration:e})}else this._failedTasks++,r.reject(Error(t.error??`Unknown worker error`));this._workerBecameIdle(e);return}default:return}}}_handleWorkerError(e,t){let n=e.currentTaskId;if(this._terminateWorker(e),n!==null){let e=this._pendingTasks.get(n);e&&(this._pendingTasks.delete(n),this._cleanupTask(e),this._failedTasks++,e.reject(Error(t.message||`Worker error`)))}this._processQueue()}_workerBecameIdle(e){if(e.busy=!1,e.currentTaskId=null,this._pendingStreamRequestHead<this._pendingStreamRequests.length){let t=this._dequeuePendingStreamRequest();if(t){t(e);return}}this._taskQueueSize()>0?this._processQueue():this._workers.size>this._options.minWorkers&&this._options.idleTimeout>0&&(e.idleTimer=setTimeout(()=>{!e.busy&&this._workers.size>this._options.minWorkers&&!this._terminated&&this._terminateWorker(e)},this._options.idleTimeout))}openStream(e,t=Hf){if(this._terminated)throw Error(`Worker pool has been terminated`);if(!Ff())throw Error(`Web Workers are not supported in this environment`);let n=this._nextTaskId++,r=t.allowTransfer===!0,i=this._options.useTransferables&&r,a=i?Wf:e=>e,o=i?(e,t,n)=>{e.postMessage(t,[n.buffer])}:(e,t,n)=>{e.postMessage(t)},s=null,c=null,l=async()=>{if(s)return s;if(c)return c;c=(async()=>{let r=this._findIdleWorker()??this._createWorker()??void 0;return r?(s=r,this._bindStreamSession(s,n,e,t.level,t),this._startStreamSession(s),s):(s=await new Promise(e=>{this._pendingStreamRequests.push(e)}),this._bindStreamSession(s,n,e,t.level,t),this._startStreamSession(s),s)})();try{return await c}finally{c=null}};l();let u=(e,t,n)=>{let r=a(n),i=t.chunkMessage;i.data=r,o(e.worker,i,r)},d=(e,t,n)=>{if(t.inflightChunkCount>=8)return this._waitForStreamSlot(t).then(()=>{t.ended||(t.inflightChunkCount++,u(e,t,n))});t.inflightChunkCount++,u(e,t,n)};return{write:async e=>{if(e.byteLength===0)return;let t=s??await l(),n=t.streamSession;if(!n||n.ended)throw Error(`Streaming session is not active`);n.writeChain=n.writeChain.then(()=>{if(!n.ended)return n.startReady?d(t,n,e):n.startPromise.then(()=>{if(!n.ended)return d(t,n,e)})}),await n.writeChain},end:async()=>{let e=await l(),t=e.streamSession;!t||t.ended||(t.startReady||await t.startPromise,await t.writeChain,t.inflightChunkCount>0&&await this._waitForStreamDrain(t),t.ended=!0,e.worker.postMessage(t.endMessage))},abort:e=>{l().then(t=>{let n=t.streamSession;if(!n)return;let r=n.abortMessage;r.error=e,t.worker.postMessage(r)})}}}_bindStreamSession(e,t,n,r,i){this._clearIdleTimer(e),e.busy=!0,e.currentTaskId=t;let a=null,o=null,s=new Promise((e,t)=>{a=e,o=t}),c=setTimeout(()=>{o?.(Error(`Worker stream start timeout`))},5e3);s.finally(()=>clearTimeout(c)),e.streamSession={taskId:t,taskType:n,startTime:performance.now(),started:!1,startReady:!1,startPromise:s,resolveStart:a,rejectStart:o,level:r,writeChain:Promise.resolve(),inflightChunkCount:0,slotWaitPromise:null,resolveSlotWait:null,drainWaitPromise:null,resolveDrainWait:null,chunkMessage:{type:`chunk`,taskId:t,data:Vf},startMessage:{type:`start`,taskId:t,taskType:n,level:r},endMessage:{type:`end`,taskId:t},abortMessage:{type:`abort`,taskId:t,error:void 0},ended:!1,onData:i.onData,onEnd:i.onEnd,onError:i.onError}}_startStreamSession(e){let t=e.streamSession;!t||t.started||(t.started=!0,e.worker.postMessage(t.startMessage))}_cancelTask(e){let t=this._pendingTasks.get(e);if(!t)return;this._pendingTasks.delete(e),this._cleanupTask(t);let n=-1;for(let t=this._taskQueueHead;t<this._taskQueue.length;t++)if(this._taskQueue[t].taskId===e){n=t;break}n>=0&&this._taskQueue.splice(n,1),t.reject(i())}_cleanupTask(e){e.abortHandler&&e.signal&&e.signal.removeEventListener(`abort`,e.abortHandler)}async executeBatch(e){let t=Array(e.length);for(let n=0;n<e.length;n++){let r=e[n];t[n]=this.execute(r.taskType,r.data,r.options)}return Promise.all(t)}};let Kf=null;function qf(e){return(!Kf||Kf.isTerminated())&&(Kf=new Gf(e)),Kf}async function Jf(e,t){return(await qf().execute(`inflate`,e,t)).data}function Yf(e,t){let n=Ff();if(t.useWorker===!0)return n;if(t.useWorker===!1)return!1;let r=t.autoWorkerThreshold??1048576;return n&&e.length>=r}function Xf(e,t){if(t?.aborted||a(e))throw i(t?.reason??e)}let Zf={hasNative:pi,native:_i,worker:Jf,jsFallback:Fi};async function Qf(e,t,n){let r=e.hasNative(),i=Ff(),a=n.useWorker;if(a===!0&&i)try{return await e.worker(t,{level:n.level,signal:n.signal,allowTransfer:n.allowTransfer})}catch(e){Xf(e,n.signal)}return r?e.native(t):a!==!0&&Yf(t,n)?e.worker(t,{level:n.level,signal:n.signal,allowTransfer:n.allowTransfer}):e.jsFallback(t,n.level)}async function $f(e,t={}){return Qf(Zf,e,t)}function ep(e){return Fi(e)}new Uint8Array([31,139,8,0,0,0,0,0,0,255]);function tp(e,t,n){return T([Ci(n),e,wi(yi(t))])}function np(e,t={}){let n=t.level??6;return tp(n===0?Ii(e):Vi(e,n),e,n)}let rp=`write after end`;function ip(e,t,n){let r=o(t);n?n(r):e.emit(`error`,r)}var ap=class extends Pn{constructor(...e){super(...e),this.ended=!1,this.destroyed=!1,this.writeChain=Promise.resolve(),this._backend=null}setBackend(e){this._backend=e}write(e,t){if(this.ended)return ip(this,Error(rp),t),!1;if(e.byteLength===0)return t&&queueMicrotask(t),!0;let n=this._backend;if(!n)throw Error(`Backend not initialized`);let r=this.writeChain.then(()=>n.write(e));return this.writeChain=r,r.then(()=>{this.destroyed||t?.()}).catch(e=>{this.destroyed||ip(this,e,t)}),!0}end(e){if(this.ended){e?.();return}this.ended=!0;let t=this._backend;if(!t)throw Error(`Backend not initialized`);this.writeChain.then(()=>t.close()).then(()=>e?.()).catch(t=>ip(this,t,e))}destroy(e){this.ended=!0,this.destroyed=!0,this._backend?.abort(e),e&&this.emit(`error`,e)}};function op(e,t){let n=t?new CompressionStream(e):new DecompressionStream(e),r=n.writable.getWriter(),i=n.readable.getReader(),a=new ap,s=null,c=(async()=>{try{for(;;){let{value:e,done:t}=await i.read();if(t)break;e&&a.emit(`data`,e)}a.emit(`end`)}catch(e){let t=o(e);s=t,a.emit(`error`,t)}})();return a.setBackend({write:e=>r.write(e),close:async()=>{if(await r.close(),await c,s)throw o(s)},abort:e=>{i.cancel(e).catch(()=>{}),r.abort(e).catch(()=>{})}}),a}function sp(e,t,n,r){let i=t??qf(),a=null,o=null,s=new Promise((e,t)=>{a=e,o=t}),c=new ap,l=i.openStream(e,{level:n,allowTransfer:r,onData:e=>c.emit(`data`,e),onEnd:()=>{c.emit(`end`),a?.()},onError:e=>{c.emit(`error`,e),o?.(e)}});return c.setBackend({write:e=>l.write(e),close:async()=>{await l.end(),await s},abort:e=>{a?.(),l.abort(e?.message)}}),c}var cp=class extends Pn{constructor(e){super(),this.process=e,this.chunks=[],this.ended=!1}write(e,t){return this.ended?(ip(this,Error(rp),t),!1):e.byteLength===0?(t&&queueMicrotask(t),!0):(this.chunks.push(e),t&&queueMicrotask(t),!0)}end(e){if(this.ended){e?.();return}this.ended=!0;let t=this.chunks.length,n=t===0?ai:t===1?this.chunks[0]:T(this.chunks);this.chunks.length=0;try{let t=this.process(n);this.emit(`data`,t),this.emit(`end`),e?.()}catch(t){ip(this,t,e)}}destroy(e){this.ended=!0,this.chunks.length=0,e&&this.emit(`error`,e)}};function lp(e,t){let n=e===`deflate`?t.level??6:void 0;return t.useWorker&&Ff()?sp(e,t.workerPool,n,t.allowTransfer):(e===`deflate`?fi():mi())?op(`deflate-raw`,e===`deflate`):new cp(e===`deflate`?e=>Vi(e,n):Fi)}function up(e={}){return lp(`deflate`,e)}function dp(){return fi()}function fp(e){let t={key0:305419896,key1:591751049,key2:878082192},n=typeof e==`string`?wn(e):e;for(let e=0;e<n.length;e++)pp(t,n[e]);return t}function pp(e,t){e.key0=la(e.key0,t),e.key1=e.key1+(e.key0&255)>>>0,e.key1=(Math.imul(e.key1,134775813)>>>0)+1>>>0,e.key2=la(e.key2,e.key1>>>24&255)}function mp(e){let t=(e.key2|2)>>>0;return Math.imul(t,t^1)>>>8&255}function hp(e,t){let n=(t^mp(e))&255;return pp(e,n),n}function gp(e,t){let n=(t^mp(e))&255;return pp(e,t),n}function _p(e,t,n,r){if(t.length!==12)return!1;let i=new Uint8Array(12);for(let n=0;n<12;n++)i[n]=hp(e,t[n]);let a=i[11];return a===(n>>>24&255)||r!==void 0&&a===(r>>>8&255)}function vp(e,t,n){let r=new Uint8Array(12),i=n(11);for(let t=0;t<11;t++)r[t]=gp(e,i[t]);return r[11]=gp(e,t>>>24&255),r}function yp(e,t,n,r){if(e.length<12)return null;let i=fp(t);if(!_p(i,e.subarray(0,12),n,r))return null;let a=e.length-12,o=new Uint8Array(a);for(let t=0;t<a;t++)o[t]=hp(i,e[12+t]);return o}let bp={"aes-128":128,"aes-192":192,"aes-256":256};function xp(e){return e in bp}function Sp(e){return bp[e]}function Cp(e){return e.replace(/\\/g,`/`)}function wp(e){return e.replace(/^\/+/,``)}function Tp(e){return e.replace(/^[a-zA-Z]:\/?/,``)}function Ep(e){let t=e.split(`/`),n=[];for(let e of t)if(!(!e||e===`.`)){if(e===`..`){n.length>0?n.pop():n.push(`..`);continue}n.push(e)}return n.join(`/`)}function Dp(e){return e.startsWith(`/`)}function Op(e){return/^[a-zA-Z]:/.test(e)}function kp(e,t={}){let n=t.mode??`legacy`,r=e;r=Cp(r);let i=Op(r);if(n===`legacy`)return r=wp(r),t.prependSlash?`/`+r:r;let a=t.stripDrive??!0;if(n===`safe`&&i&&!a)throw Error(`Unsafe ZIP path (drive): ${e}`);a&&(r=Tp(r));let o=Dp(r);if(r=wp(r),r=Ep(r),n===`safe`){if(o)throw Error(`Unsafe ZIP path (absolute): ${e}`);if(r===`..`||r.startsWith(`../`))throw Error(`Unsafe ZIP path (traversal): ${e}`)}return t.prependSlash?`/`+r:r}function Ap(e){return Math.log(e)/Math.LN2}function jp(e,t){let n=0;for(let r=0;r<256;r++){let i=e[r];if(i===0)continue;let a=i/t;n-=a*Ap(a)}return n}function Mp(e,t){let n=new Uint32Array(256),r=0,i=0;if(Array.isArray(e))for(let a=0;a<e.length&&!(r>=t);a++){let o=e[a],s=Math.min(o.length,t-r);for(let e=0;e<s;e++){let t=o[e];n[t]===0&&(i+=1),n[t]+=1}r+=s}else for(let a of e){if(r>=t)break;let e=Math.min(a.length,t-r);for(let t=0;t<e;t++){let e=a[t];n[e]===0&&(i+=1),n[e]+=1}r+=e}return{total:r,unique:i,counts:n}}function Np(e,t={}){let n=t.sampleBytes??65536,r=t.minDecisionBytes??16384,{total:i,unique:a,counts:o}=Mp(e,n);return i<r||a<200?!1:jp(o,i)>=7.95}function Pp(e,t=20){return(e&255)<<8|t&255}function Fp(e){switch(e){case`directory`:return Po;case`symlink`:return No;default:return 32768}}function Ip(e){return e>>>0&65535}function Lp(e,t){let n=e.endsWith(`/`)||e.endsWith(`\\`);return t!==void 0&&Io(t)?`symlink`:n?`directory`:`file`}function Rp(e){let t=e.kind,n=t===`directory`?16:32,r=(e.msDosAttributes??n)&255,i=e.mode;i!==void 0&&(i&61440||(i=i&4095|Fp(t)),i=Ip(i));let a=((i??0)&65535)<<16|r,o=Pp(i!==void 0||t===`symlink`?3:0);return{externalAttributes:a>>>0,versionMadeBy:o}}function zp(e){if(e.externalAttributes!==void 0)return{externalAttributes:e.externalAttributes,versionMadeBy:e.versionMadeBy};let t=Rp({kind:Lp(e.name,e.mode),mode:e.mode,msDosAttributes:e.msDosAttributes});return{externalAttributes:t.externalAttributes,versionMadeBy:e.versionMadeBy??t.versionMadeBy}}function Bp(e){return e?8:0}function Vp(e,t=!0){let n=0;return t&&(n|=jo),e&&(n|=8),n}function Hp(e){let t=_a(e.codec),n=t.encode(e.name),r=va(e.comment,t),{dosTime:i,dosDate:a}=Ra(e.modTime),o=e.atime||e.ctime||e.birthTime?{atime:e.atime,ctime:e.ctime,birthTime:e.birthTime}:void 0,s=La(e.modTime,e.timestamps,o);return!t.useUtf8Flag&&t.useUnicodeExtraFields&&(e.name&&(s=qo(s,vo(n,e.name))),e.comment&&(s=qo(s,yo(r,e.comment)))),{nameBytes:n,commentBytes:r,dosTime:i,dosDate:a,extraField:s,compressionMethod:Bp(e.deflate),flags:Vp(e.useDataDescriptor,t.useUtf8Flag)}}function Up(e,t,n,r,i){if(!i)return 0;let a=0;return(e||t>4294967295)&&(a+=8),(e||n>4294967295)&&(a+=8),(e||r>4294967295)&&(a+=8),a>0?4+a:0}function Wp(e){let t=e[0];return t?.fileName===void 0?t?.compressedData===void 0?`central`:`processed`:`input`}function Gp(e,t){let n=t.zip64Mode===!0,r=t.zip64Mode===!1,i=Wp(e),a=0;for(let t=0;t<e.length;t++){let r=e[t],o=i===`input`?r.fileName:r.name,s=r.extraField,c=r.comment,l=i===`processed`?r.compressedData.length:r.compressedSize,u=r.uncompressedSize,d=i===`input`?r.localHeaderOffset:r.offset,f=i===`processed`?void 0:r.zip64,p=n||f===!0||d>4294967295||l>4294967295||u>4294967295;a+=46+o.length+s.length+Up(n,u,l,d,p)+(c?.length??0)}let o=e.length>65535||t.centralDirOffset>4294967295,s=n||o||a>4294967295;if(r&&s)throw Error(`ZIP64 is required but zip64=false`);let c=s?98+t.zipComment.length:22+t.zipComment.length;return{centralDirSize:a,trailerSize:c,totalSize:a+c,usedZip64:s}}function Kp(e,t){let n=t.zip64Mode===!0,r=Gp(e,{zipComment:t.zipComment,zip64Mode:t.zip64Mode,centralDirOffset:t.centralDirOffset}),i=Wp(e),a=t.offset,o=new DataView(t.out.buffer,t.out.byteOffset,t.out.byteLength);for(let r=0;r<e.length;r++){let s=e[r],c=i===`input`?s.fileName:s.name,l=s.extraField,u=s.comment,d=s.flags,f=i===`input`?s.crc32:s.crc,p=i===`processed`?s.compressedData.length:s.compressedSize,m=s.uncompressedSize,h=s.compressionMethod,g=i===`processed`?s.modTime:s.dosTime,_=i===`processed`?s.modDate:s.dosDate,v=i===`input`?s.localHeaderOffset:s.offset,y=i===`processed`?void 0:s.zip64,b=s.externalAttributes,x=s.versionMadeBy,S=n||y===!0||v>4294967295||p>4294967295||m>4294967295,ee=S?Ko({uncompressedSize:n||m>4294967295?m:void 0,compressedSize:n||p>4294967295?p:void 0,localHeaderOffset:n||v>4294967295?v:void 0}):ai,te=S&&ee.length>0?qo(l,ee):l;a+=Vo(t.out,o,a,{fileName:c,extraField:te,comment:u??ai,flags:d,compressionMethod:h,dosTime:g,dosDate:_,crc32:f,compressedSize:S?Ro:p,uncompressedSize:S?Ro:m,localHeaderOffset:S?Ro:v,versionMadeBy:x??20,versionNeeded:S?45:20,externalAttributes:b})}if(r.usedZip64){let n=t.centralDirOffset+r.centralDirSize;a+=Jo(t.out,o,a,{entryCountOnDisk:e.length,entryCountTotal:e.length,centralDirSize:r.centralDirSize,centralDirOffset:t.centralDirOffset}),a+=Yo(t.out,o,a,{zip64EndOfCentralDirectoryOffset:n,totalDisks:1}),Ho(t.out,o,a,{entryCount:65535,centralDirSize:Ro,centralDirOffset:Ro,comment:t.zipComment})}else Ho(t.out,o,a,{entryCount:e.length,centralDirSize:r.centralDirSize,centralDirOffset:t.centralDirOffset,comment:t.zipComment});return{centralDirSize:r.centralDirSize,trailerSize:r.trailerSize,totalWritten:r.totalSize,usedZip64:r.usedZip64}}let qp=16*1024,Jp=65536;var Yp=class{constructor(e,t){this._deflate=null,this._crc=4294967295,this._uncompressedSize=0,this._compressedSize=0,this._finalized=!1,this._headerEmitted=!1,this._ondata=null,this._onerror=null,this._centralDirEntryInfo=null,this._pendingEnd=!1,this._emittedDataDescriptor=!1,this._localHeader=null,this._zip64Mode=`auto`,this._zip64=!1,this._deflateWanted=null,this._pendingChunks=[],this._sampleLen=0,this._completeResolve=null,this._completeReject=null,this._completePromise=null,this._completeError=null,this._encryptionMethod=`none`,this._zipCryptoState=null,this._aesBuffer=[],this._aesBufferSize=0,this._originalCompressionMethod=0,this._aesExtraField=null,this._dataQueue=[],this._finalQueued=!1,this._pushChain=Promise.resolve(),this._inputBuf=null,this._inputPos=0,this._syncDeflater=null,this._syncZlibReady=!1;let n=t?.path?kp(e,t.path):e;this.name=n;let r=t?.modTime??new Date;if(this._modTime=r,this.level=t?.level??6,this._smartStore=t?.smartStore??!0,this._zip64Mode=t?.zip64??`auto`,this._zip64=this._zip64Mode===!0,this._encryptionMethod=t?.encryptionMethod??`none`,this._password=t?.password,this._encryptionMethod!==`none`&&!this._password)throw Error(`Password is required for encryption`);xp(this._encryptionMethod)&&(this._aesKeyStrength=Sp(this._encryptionMethod)),this._stringCodec=_a(t?.encoding);let i=Hp({name:n,comment:t?.comment,modTime:r,atime:t?.atime,ctime:t?.ctime,birthTime:t?.birthTime,timestamps:t?.timestamps??`dos`,useDataDescriptor:!0,deflate:!1,codec:this._stringCodec});this.nameBytes=i.nameBytes,this.commentBytes=i.commentBytes,this.dosTime=i.dosTime,this.dosDate=i.dosDate,this.extraField=i.extraField,this._flags=i.flags,this._compressionMethod=i.compressionMethod;let a=zp({name:n,mode:t?.mode,msDosAttributes:t?.msDosAttributes,externalAttributes:t?.externalAttributes,versionMadeBy:t?.versionMadeBy});if(this._externalAttributes=a.externalAttributes,this._versionMadeBy=a.versionMadeBy,this._encryptionMethod!==`none`&&(this._flags|=1),!this._smartStore){let e=this.level>0;this._deflateWanted=e,this._compressionMethod=this._buildCompressionMethod(e),e&&this._initDeflateStream();return}this.level===0&&(this._deflateWanted=!1,this._compressionMethod=this._buildCompressionMethod(!1))}_buildCompressionMethod(e){return Bp(e)}_getAesExtraField(){return this._aesKeyStrength?(this._aesExtraField||=uo(2,this._aesKeyStrength,this._originalCompressionMethod),this._aesExtraField):ai}_initZipCryptoEncryption(){if(this._zipCryptoState||this._encryptionMethod!==`zipcrypto`)return;this._zipCryptoState=fp(this._password);let e=this.dosTime<<16|this.dosDate,t=vp(this._zipCryptoState,e,qa);this._compressedSize+=t.length,this._enqueueData(t,!1)}_zipCryptoEncryptChunk(e){if(!this._zipCryptoState)return e;let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=gp(this._zipCryptoState,e[n]);return t}_initDeflateStream(){this._deflate||(this._deflate=up({level:this.level}),this._deflate.on(`error`,e=>{this._rejectComplete(e)}),this._deflate.on(`data`,e=>{if(this._aesKeyStrength){this._aesBuffer.push(e),this._aesBufferSize+=e.length;return}if(this._encryptionMethod===`zipcrypto`){this._initZipCryptoEncryption();let t=this._zipCryptoEncryptChunk(e);this._compressedSize+=t.length,this._enqueueData(t,!1);return}this._compressedSize+=e.length,this._enqueueData(e,!1)}),this._deflate.on(`end`,()=>{this._pendingEnd&&!this._emittedDataDescriptor&&(this._emittedDataDescriptor=!0,this._finalizeEncryptionAndEmitDescriptor())}))}_finalizeEncryptionAndEmitDescriptor(){if(this._aesKeyStrength&&this._aesBuffer.length>0){this._finalizeAesEncryption().then(()=>this._emitDataDescriptor()).catch(e=>this._rejectComplete(e));return}this._emitDataDescriptor()}async _finalizeAesEncryption(){if(!this._aesKeyStrength||this._aesBufferSize===0)return;let e;if(this._aesBuffer.length===1)e=this._aesBuffer[0];else{e=new Uint8Array(this._aesBufferSize);let t=0;for(let n=0;n<this._aesBuffer.length;n++){let r=this._aesBuffer[n];e.set(r,t),t+=r.length}}this._aesBuffer.length=0,this._aesBufferSize=0;let t=await go(e,this._password,this._aesKeyStrength);this._compressedSize=t.length,this._enqueueData(t,!1)}_buildLocalHeader(){let e=this.extraField,t=this._compressionMethod;return this._aesKeyStrength&&(this._originalCompressionMethod=this._compressionMethod,t=99,e=qo(this.extraField,this._getAesExtraField())),Bo({fileName:this.nameBytes,extraField:e,flags:this._flags,compressionMethod:t,dosTime:this.dosTime,dosDate:this.dosDate,crc32:0,compressedSize:0,uncompressedSize:0,versionNeeded:this._zip64?45:20})}_accumulateSampleLen(e){if(this._deflateWanted!==null||e.length===0||this._sampleLen>=qp)return;let t=Math.min(qp-this._sampleLen,e.length);t<=0||(this._sampleLen+=t)}_shouldDecide(e){return this._deflateWanted===null?e||this._sampleLen>=qp:!1}_decideCompressionIfNeeded(e,t,n=!1){if(this._deflateWanted!==null)return;if(e&&this._sampleLen===0){this._deflateWanted=!1,this._sampleLen=0,this._compressionMethod=this._buildCompressionMethod(!1),this._localHeader=null;return}let r=Np((function*(e,t){for(let t of e)t.length&&(yield t);t.length&&(yield t)})(this._pendingChunks,t),{sampleBytes:qp,minDecisionBytes:qp});this._deflateWanted=!r,this._sampleLen=0,this._compressionMethod=this._buildCompressionMethod(this._deflateWanted),this._localHeader=null,this._deflateWanted&&(n||this._initDeflateStream())}_emitHeaderIfNeeded(){this._headerEmitted||=(this._emitHeader(),!0)}async _flushPendingChunks(){if(this._pendingChunks.length!==0){for(let e of this._pendingChunks)await this._writeData(e);this._pendingChunks.length=0}}_enqueueData(e,t){this._ondata?this._ondata(e,t):(this._dataQueue.push(e),t&&(this._finalQueued=!0))}_flushQueue(){if(!this._ondata)return;let e=this._dataQueue.length,t=this._finalQueued?e-1:-1;for(let n=0;n<e;n++)this._ondata(this._dataQueue[n],n===t);this._dataQueue.length=0,this._finalQueued=!1}get ondata(){return this._ondata}set ondata(e){this._ondata=e,this._flushQueue()}get onerror(){return this._onerror}set onerror(e){this._onerror=e,this._completeError&&e(this._completeError)}_resolveComplete(){this._completeResolve&&this._completeResolve()}_rejectComplete(e){this._completeError||(this._completeError=e,this._onerror&&this._onerror(e),this._completeReject&&this._completeReject(e))}_ensureCompletePromise(){return this._completeError?Promise.reject(this._completeError):this._emittedDataDescriptor?Promise.resolve():(this._completePromise||=new Promise((e,t)=>{this._completeResolve=e,this._completeReject=t}),this._completePromise)}_tapCallback(e,t){t&&e.then(()=>t()).catch(e=>t(e))}_writeDataSync(e,t){if(!(e.length===0&&!t)){if(e.length>0&&(this._crc=oa(this._crc,e),this._uncompressedSize+=e.length),this._deflateWanted){if(this._syncDeflater||=new Zi(this.level),e.length>0){let t=this._syncDeflater.write(e);t.length>0&&(this._compressedSize+=t.length,this._enqueueData(t,!1))}if(t){let e=this._syncDeflater.finish();e.length>0&&(this._compressedSize+=e.length,this._enqueueData(e,!1)),this._syncDeflater=null}return}if(this._aesKeyStrength){this._aesBuffer.push(e),this._aesBufferSize+=e.length;return}if(this._encryptionMethod===`zipcrypto`){this._initZipCryptoEncryption();let t=this._zipCryptoEncryptChunk(e);this._compressedSize+=t.length,this._enqueueData(t,!1);return}e.length>0&&(this._compressedSize+=e.length,this._enqueueData(e,!1))}}_writeData(e){if(e.length===0)return Promise.resolve();if(this._crc=oa(this._crc,e),this._uncompressedSize+=e.length,this._deflate)return new Promise((t,n)=>{this._deflate.write(e,e=>{e?n(e):t()})});if(this._aesKeyStrength)return this._aesBuffer.push(e),this._aesBufferSize+=e.length,Promise.resolve();if(this._encryptionMethod===`zipcrypto`){this._initZipCryptoEncryption();let t=this._zipCryptoEncryptChunk(e);return this._compressedSize+=t.length,this._enqueueData(t,!1),Promise.resolve()}return this._compressedSize+=e.length,this._enqueueData(e,!1),Promise.resolve()}_endDeflateAndWait(){return new Promise((e,t)=>{let n=this._deflate,r=e=>{a(),t(e)},i=()=>{a(),e()},a=()=>{n.off(`error`,r),n.off(`end`,i)};n.once(`error`,r),n.once(`end`,i),n.end()})}_finalizeAfterWrite(e){this._finalized=!0,this._pendingEnd=!0;let t=this._ensureCompletePromise();return this._deflate?e.then(()=>this._endDeflateAndWait()).then(()=>t):this._aesKeyStrength&&this._aesBufferSize>0?(this._emittedDataDescriptor=!0,this._finalizeAesEncryption().then(()=>this._emitDataDescriptor()).catch(e=>this._rejectComplete(e)),t):(this._emittedDataDescriptor=!0,this._emitDataDescriptor(),t)}_pushUnchained(e,t,n){if(this._finalized){let e=Promise.reject(Error(`Cannot push to finalized ZipDeflateFile`));return this._tapCallback(e,n),e}if(this._completeError){let e=Promise.reject(this._completeError);return this._tapCallback(e,n),e}if(this._deflateWanted===null){if(this._accumulateSampleLen(e),!this._shouldDecide(t)){e.length>0&&this._pendingChunks.push(e);let t=Promise.resolve();return this._tapCallback(t,n),t}this._decideCompressionIfNeeded(t,e),this._emitHeaderIfNeeded();let r=this._pendingChunks.length>0,i=this._flushPendingChunks(),a=i;e.length>0&&(a=r?i.then(()=>this._writeData(e)):this._writeData(e));let o=t?this._finalizeAfterWrite(a):a;return this._tapCallback(o,n),o}this._emitHeaderIfNeeded();let r=this._writeData(e),i=t?this._finalizeAfterWrite(r):r;return this._tapCallback(i,n),i}push(e,t=!1,n){if(!this._deflate&&this._encryptionMethod===`none`&&!dp()){try{this._pushSyncPath(e,t),n?.()}catch(e){return n?.(e instanceof Error?e:Error(String(e))),Promise.reject(e)}return Promise.resolve()}if(!t&&e.length>0&&e.length<Jp){if(this._inputBuf||(this._inputBuf=new Uint8Array(Jp),this._inputPos=0),this._inputPos+e.length<=Jp)return this._inputBuf.set(e,this._inputPos),this._inputPos+=e.length,n?.(),Promise.resolve();let t=new Uint8Array(this._inputPos+e.length);return t.set(this._inputBuf.subarray(0,this._inputPos)),t.set(e,this._inputPos),this._inputPos=0,this._pushAsync(t,!1,n)}if(this._inputPos>0){let r=this._inputBuf.slice(0,this._inputPos);this._inputPos=0;let i=this._pushAsync(r,!1),a=this._pushChain=i.then(()=>this._pushUnchained(e,t,n),()=>this._pushUnchained(e,t,n));return a.catch(()=>{}),a}return this._pushAsync(e,t,n)}_pushAsync(e,t,n){let r=this._pushChain=this._pushChain.then(()=>this._pushUnchained(e,t,n),()=>this._pushUnchained(e,t,n));return r.catch(()=>{}),r}_pushSyncPath(e,t=!1){if(this._finalized)throw Error(`Cannot push to finalized ZipDeflateFile`);if(this._syncZlibReady||=!0,this._deflateWanted===null){if(this._accumulateSampleLen(e),!this._shouldDecide(t)){e.length>0&&this._pendingChunks.push(e);return}this._decideCompressionIfNeeded(t,e,!0),this._emitHeaderIfNeeded();for(let e of this._pendingChunks)this._writeDataSync(e,!1);this._pendingChunks.length=0,e.length>0&&this._writeDataSync(e,t),t&&this._finalizeSyncAfterWrite();return}this._emitHeaderIfNeeded(),this._writeDataSync(e,t),t&&this._finalizeSyncAfterWrite()}_finalizeSyncAfterWrite(){if(this._finalized=!0,this._pendingEnd=!1,this._emittedDataDescriptor=!0,this._aesKeyStrength&&this._aesBufferSize>0)throw Error(`AES encryption is not supported with synchronous push`);if(this._syncDeflater){let e=this._syncDeflater.finish();e.length>0&&(this._compressedSize+=e.length,this._enqueueData(e,!1)),this._syncDeflater=null}if(this._emitDataDescriptor(),this._completeError)throw this._completeError}_emitHeader(){this._localHeader||=this._buildLocalHeader(),this._enqueueData(this._localHeader,!1)}_emitDataDescriptor(){let e=sa(this._crc),t=this._compressedSize>4294967295||this._uncompressedSize>4294967295;if(this._zip64Mode===!1&&t){this._rejectComplete(Error(`ZIP64 is required but zip64=false`));return}(this._zip64Mode===!0||t&&!this._zip64)&&(this._zip64=!0);let n=this._zip64?Go(e,this._compressedSize,this._uncompressedSize):Uo(e,this._compressedSize,this._uncompressedSize),r=this._compressionMethod,i=this.extraField;this._aesKeyStrength&&(r=99,i=qo(this.extraField,this._getAesExtraField())),this._centralDirEntryInfo={name:this.nameBytes,extraField:i,comment:this.commentBytes,flags:this._flags,crc:e,compressedSize:this._compressedSize,uncompressedSize:this._uncompressedSize,compressionMethod:r,dosTime:this.dosTime,dosDate:this.dosDate,offset:-1,zip64:this._zip64,externalAttributes:this._externalAttributes,versionMadeBy:this._versionMadeBy},this._enqueueData(n,!0),this._resolveComplete()}complete(){return this._ensureCompletePromise()}getEntryInfo(){if(!this._centralDirEntryInfo)return null;let e=this.name,t=e.endsWith(`/`)||e.endsWith(`\\`),n=this._centralDirEntryInfo.externalAttributes,r=Fo(n);return{path:e,type:Io(r)?`symlink`:t?`directory`:`file`,compressedSize:this._centralDirEntryInfo.compressedSize,uncompressedSize:this._centralDirEntryInfo.uncompressedSize,compressionMethod:this._centralDirEntryInfo.compressionMethod,crc32:this._centralDirEntryInfo.crc,lastModified:this._modTime,localHeaderOffset:this._centralDirEntryInfo.offset,comment:this._stringCodec.decode(this._centralDirEntryInfo.comment),externalAttributes:n,mode:r,versionMadeBy:this._centralDirEntryInfo.versionMadeBy,extraField:this._centralDirEntryInfo.extraField,isEncrypted:this._encryptionMethod!==`none`,encryptionMethod:this._aesKeyStrength?`aes`:this._encryptionMethod===`zipcrypto`?`zipcrypto`:void 0,aesKeyStrength:this._aesKeyStrength,originalCompressionMethod:this._aesKeyStrength?this._originalCompressionMethod:void 0}}getCentralDirectoryEntryInfo(){return this._centralDirEntryInfo}isComplete(){return this._emittedDataDescriptor&&this._centralDirEntryInfo!==null}abort(e){if(this._completeError)return;let t=i(e);this._finalized=!0,this._pendingEnd=!0,this._rejectComplete(t);try{let e=this._deflate;e&&typeof e.destroy==`function`&&e.destroy(t)}catch{}}},Xp=class{constructor(e,t){this.entries=[],this.currentOffset=0,this.ended=!1,this.endPending=!1,this.addedEntryCount=0,this.fileQueue=[],this.fileQueueIndex=0,this.activeFile=null,this.callback=e,this._stringCodec=t?.codec??_a(t?.encoding),this.zipComment=va(t?.comment,this._stringCodec),this.zip64Mode=t?.zip64??`auto`}add(e){if(this.ended)throw Error(`Cannot add files after calling end() `);if(this.zip64Mode===!1&&this.addedEntryCount>=65535)throw Error(`ZIP64 is required but zip64=false`);this.addedEntryCount++,this.fileQueue.push(e),this.activeFile||this._processNextFile()}_processNextFile(){if(this.fileQueueIndex>=this.fileQueue.length){this.activeFile=null,this.fileQueue=[],this.fileQueueIndex=0,this.endPending&&this._finalize();return}let e=this.fileQueue[this.fileQueueIndex++];this.activeFile=e;let t=this.currentOffset;if(e.onerror=e=>{this.ended||(this.ended=!0,this.callback(e,ai,!0))},e.ondata=(n,r)=>{if(!this.ended&&(this.currentOffset+=n.length,this.callback(null,n,!1),r)){let n=e.getCentralDirectoryEntryInfo();n&&(n.offset=t,this.entries.push(n)),this._processNextFile()}},typeof e.start==`function`)try{e.start().catch(t=>{let n=o(t);try{e.onerror?.(n)}catch{}})}catch(t){let n=o(t);try{e.onerror?.(n)}catch{}}}_finalize(){if(this.ended)return;this.ended=!0;let e=this.currentOffset,t;try{let n=Gp(this.entries,{zipComment:this.zipComment,zip64Mode:this.zip64Mode,centralDirOffset:e});t=new Uint8Array(n.totalSize),Kp(this.entries,{zipComment:this.zipComment,zip64Mode:this.zip64Mode,centralDirOffset:e,out:t,offset:0})}catch(e){let t=o(e);this.callback(t,ai,!0);return}this.callback(null,t,!0)}end(){this.endPending||this.ended||(this.endPending=!0,this.activeFile||this._finalize())}abort(e){if(this.ended)return;let t=i(e);this.ended=!0,this.endPending=!0;try{this.activeFile?.abort(t)}catch{}this.callback(t,ai,!0)}};function Zp(e){return typeof e==`object`&&`nativeCol`in e&&`nativeRow`in e&&`nativeColOff`in e&&`nativeRowOff`in e}function Qp(e){return typeof e==`object`&&`col`in e&&`row`in e}var $p=class e{constructor(e,t,n=0){if(this.worksheet=e,!t)this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0;else if(typeof t==`string`){let e=O.decodeAddress(t);this.nativeCol=e.col+n,this.nativeColOff=0,this.nativeRow=e.row+n,this.nativeRowOff=0}else Zp(t)?(this.nativeCol=t.nativeCol??0,this.nativeColOff=t.nativeColOff??0,this.nativeRow=t.nativeRow??0,this.nativeRowOff=t.nativeRowOff??0):Qp(t)?(this.col=t.col+n,this.row=t.row+n):(this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0)}static asInstance(t){return t==null?null:t instanceof e?t:new e(void 0,t)}get col(){return this.nativeColOff===0?this.nativeCol:this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth}set col(e){this.nativeCol=Math.floor(e);let t=e-this.nativeCol;this.nativeColOff=t===0?0:Math.floor(t*this.colWidth)}get row(){return this.nativeRowOff===0?this.nativeRow:this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight}set row(e){this.nativeRow=Math.floor(e);let t=e-this.nativeRow;this.nativeRowOff=t===0?0:Math.floor(t*this.rowHeight)}get colWidth(){return this.worksheet&&this.worksheet.getColumn(this.nativeCol+1)&&this.worksheet.getColumn(this.nativeCol+1).isCustomWidth?Math.floor(this.worksheet.getColumn(this.nativeCol+1).width*1e4):64e4}get rowHeight(){let e=this.worksheet?.getRow(this.nativeRow+1)?.height;return e?Math.floor(e*1e4):18e4}get model(){return{nativeCol:this.nativeCol,nativeColOff:this.nativeColOff,nativeRow:this.nativeRow,nativeRowOff:this.nativeRowOff}}set model(e){this.nativeCol=e.nativeCol,this.nativeColOff=e.nativeColOff,this.nativeRow=e.nativeRow,this.nativeRowOff=e.nativeRowOff}clone(t){return new e(t??this.worksheet,this.model)}},em=class{constructor(e){this.model=e||{}}add(e,t){return this.model[e]=t}find(e){let t=this.model[e];if(t!==void 0)return t;let n;for(let t of Object.keys(this.model)){if(!t.startsWith(`range:`))continue;n||=O.decodeAddress(e);let r=t.slice(6),i=O.decodeEx(r);if(!(`dimensions`in i))continue;let{tl:a,br:o}=i,s=typeof a==`string`?O.decodeAddress(a):a,c=typeof o==`string`?O.decodeAddress(o):o;if(n.row>=s.row&&n.row<=c.row&&n.col>=s.col&&n.col<=c.col)return this.model[t]}}remove(e){this.model[e]=void 0}},tm=class extends N{get tag(){return`t`}render(e,t){e.openNode(`t`),/^\s|\n|\s$/.test(t)&&e.addAttribute(`xml:space`,`preserve`),e.writeText(Wc(t)),e.closeNode()}parseOpen(e){return e.name===`t`?(this.model=``,!0):!1}parseText(e){this.model=this.model?this.model+e:e}parseClose(){let e=this.model;return e.includes(`_x`)&&(this.model=Uc(e)),!1}},nm=class e extends N{constructor(e){super(),this.model=e}get tag(){return`r`}get textXform(){return this._textXform||=new tm}get fontXform(){return this._fontXform||=new vf(e.FONT_OPTIONS)}render(e,t){let n=t||this.model;e.openNode(`r`),n.font&&this.fontXform.render(e,n.font),this.textXform.render(e,n.text),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`r`:return this.model={},!0;case`t`:return this.parser=this.textXform,this.parser.parseOpen(e),!0;case`rPr`:return this.parser=this.fontXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case`r`:return!1;case`t`:return this.model.text=this.parser.model,this.parser=void 0,!0;case`rPr`:return this.model.font=this.parser.model,this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}static{this.FONT_OPTIONS={tagName:`rPr`,fontNameTag:`rFont`}}},rm=class extends N{constructor(e){super(),this.model=e||{type:`note`,note:{texts:[]},ref:``}}get tag(){return`r`}get richTextXform(){return this._richTextXform||=new nm,this._richTextXform}render(e,t){let n=t||this.model;e.openNode(`comment`,{ref:n.ref,authorId:n.authorId??0}),e.openNode(`text`),n&&n.note&&n.note.texts&&n.note.texts.forEach(t=>{this.richTextXform.render(e,t)}),e.closeNode(),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`comment`:return this.model={type:`note`,note:{texts:[]},ref:e.attributes.ref,authorId:e.attributes.authorId==null?void 0:Number(e.attributes.authorId)},!0;case`r`:return this.parser=this.richTextXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case`comment`:return!1;case`r`:return this.model.note.texts.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}},im=class extends N{constructor(e){super(),this._model=e||{},this.model={}}get tag(){return this._model?.tag??``}render(e,t,n){(n&&t===n[2]||n&&this.tag===`x:SizeWithCells`&&t===n[1])&&e.leafNode(this.tag)}parseOpen(e){switch(e.name){case this.tag:return this.model={},this.model[this.tag]=!0,!0;default:return!1}}parseText(){}parseClose(){return!1}},am=class extends N{constructor(e){super(),this._model=e||{},this.text=``}get tag(){return this._model?.tag??``}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(e){switch(e.name){case this.tag:return this.text=``,!0;default:return!1}}parseText(e){this.text=e}parseClose(){return!1}},om=class extends N{constructor(){super(),this.text=``}get tag(){return`x:Anchor`}getAnchorRect(e){let t=Math.floor(e.left),n=Math.floor((e.left-t)*68),r=Math.floor(e.top),i=Math.floor((e.top-r)*18),a=Math.floor(e.right),o=Math.floor((e.right-a)*68),s=Math.floor(e.bottom);return[t,n,r,i,a,o,s,Math.floor((e.bottom-s)*18)]}getDefaultRect(e){let t=e.col,n=Math.max(e.row-2,0);return[t,6,n,14,t+2,2,n+4,16]}render(e,t){let n=t.anchor?this.getAnchorRect(t.anchor):this.getDefaultRect(t.refAddress);e.leafNode(`x:Anchor`,null,n.join(`, `))}parseOpen(e){switch(e.name){case this.tag:return this.text=``,!0;default:return!1}}parseText(e){this.text=e}parseClose(){return!1}};let sm=[`twoCells`,`oneCells`,`absolute`];var cm=class extends N{constructor(){super(),this._leafText=``,this.map={"x:Anchor":new om,"x:Locked":new am({tag:`x:Locked`}),"x:LockText":new am({tag:`x:LockText`}),"x:SizeWithCells":new im({tag:`x:SizeWithCells`}),"x:MoveWithCells":new im({tag:`x:MoveWithCells`})},this.model={anchor:[],protection:{},editAs:``}}get tag(){return`x:ClientData`}render(e,t){let{protection:n,editAs:r}=t.note;e.openNode(this.tag,{ObjectType:`Note`}),this.map[`x:MoveWithCells`].render(e,r,sm),this.map[`x:SizeWithCells`].render(e,r,sm),this.map[`x:Anchor`].render(e,t),this.map[`x:Locked`].render(e,n.locked),e.leafNode(`x:AutoFill`,null,`False`),this.map[`x:LockText`].render(e,n.lockText),e.leafNode(`x:Row`,null,t.refAddress.row-1),e.leafNode(`x:Column`,null,t.refAddress.col-1),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:this.reset(),this.model={anchor:[],protection:{},editAs:``};break;case`x:Row`:case`x:Column`:this._leafName=e.name,this._leafText=``;break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this._leafName?this._leafText+=e:this.parser&&this.parser.parseText(e)}parseClose(e){if(this._leafName){if(e===this._leafName){let t=parseInt(this._leafText,10);e===`x:Row`?this.model.row=t+1:e===`x:Column`&&(this.model.col=t+1),this._leafName=void 0,this._leafText=``}return!0}if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.normalizeModel(),!1;default:return!0}}normalizeModel(){let e=Object.assign({},this.map[`x:MoveWithCells`].model,this.map[`x:SizeWithCells`].model),t=Object.keys(e).length;this.model.editAs=sm[t],this.model.anchor=this.map[`x:Anchor`].text,this.model.protection.locked=this.map[`x:Locked`].text,this.model.protection.lockText=this.map[`x:LockText`].text}},lm=class extends N{constructor(){super(),this.model={}}get tag(){return`v:textbox`}conversionUnit(e,t,n){return`${(parseFloat(e.toString())*t).toFixed(2)}${n}`}reverseConversionUnit(e){return(e??``).split(`,`).map(e=>Number(parseFloat(this.conversionUnit(parseFloat(e),.1,``)).toFixed(2)))}render(e,t){let n={style:`mso-direction-alt:auto`};if(t&&t.note){let{inset:e}=t.note&&t.note.margins||{};Array.isArray(e)&&(e=e.map(e=>this.conversionUnit(e,10,`mm`)).join(`,`)),e&&(n.inset=e)}e.openNode(`v:textbox`,n),e.leafNode(`div`,{style:`text-align:left`}),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:return this.model={inset:this.reverseConversionUnit(e.attributes.inset)},!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}},um=class e extends N{constructor(){super(),this.map={"v:textbox":new lm,"x:ClientData":new cm}}get tag(){return`v:shape`}render(t,n,r){t.openNode(`v:shape`,e.V_SHAPE_ATTRIBUTES(n,r??0)),t.leafNode(`v:fill`,{color2:`infoBackground [80]`}),t.leafNode(`v:shadow`,{color:`none [81]`,obscured:`t`}),t.leafNode(`v:path`,{"o:connecttype":`none`}),this.map[`v:textbox`].render(t,n),this.map[`x:ClientData`].render(t,n),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={margins:{insetmode:e.attributes[`o:insetmode`]},anchor:``,editAs:``,protection:{}};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.margins.inset=this.map[`v:textbox`].model&&this.map[`v:textbox`].model.inset,this.model.protection=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.protection,this.model.anchor=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.anchor,this.model.editAs=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.editAs,this.map[`x:ClientData`].model&&(this.model.row=this.map[`x:ClientData`].model.row,this.model.col=this.map[`x:ClientData`].model.col),!1;default:return!0}}static{this.V_SHAPE_ATTRIBUTES=(e,t)=>({id:`_x0000_s${1025+t}`,type:`#_x0000_t202`,style:`position:absolute; margin-left:105.3pt;margin-top:10.5pt;width:97.8pt;height:59.1pt;z-index:1;visibility:hidden`,fillcolor:`infoBackground [80]`,strokecolor:`none [81]`,"o:insetmode":e.note.margins&&e.note.margins.insetmode})}},dm=class{constructor(e,t,n){this.id=n.id,this.count=0,this._worksheet=e,this._workbook=n.workbook,this._sheetRelsWriter=t}get commentsStream(){return this._commentsStream||=this._workbook._openStream(id(this.id)),this._commentsStream}get vmlStream(){return this._vmlStream||=this._workbook._openStream(od(this.id)),this._vmlStream}_addRelationships(){let e={Type:k.Comments,Target:Td(this.id)};this._sheetRelsWriter.addRelationship(e);let t={Type:k.VmlDrawing,Target:Ed(this.id)};this.vmlRelId=this._sheetRelsWriter.addRelationship(t)}_addCommentRefs(){this._workbook.commentRefs.push({commentName:`comments${this.id}`,vmlDrawing:`vmlDrawing${this.id}`})}_writeOpen(){this.commentsStream.write(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><comments xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><authors><author>Author</author></authors><commentList>`),this.vmlStream.write(`<?xml version="1.0" encoding="UTF-8"?><xml xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1" /></o:shapelayout><v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter" /><v:path gradientshapeok="t" o:connecttype="rect" /></v:shapetype>`)}_writeComment(e,t){let n=new rm,r=new Id;n.render(r,e),this.commentsStream.write(r.xml);let i=new um,a=new Id;i.render(a,e,t),this.vmlStream.write(a.xml)}_writeClose(){this.commentsStream.write(`</commentList></comments>`),this.vmlStream.write(`</xml>`)}addComments(e){e&&e.length&&(this.startedData||=(this._worksheet.comments=[],this._writeOpen(),this._addRelationships(),this._addCommentRefs(),!0),e.forEach(e=>{e.refAddress=O.decodeAddress(e.ref)}),e.forEach(e=>{this._writeComment(e,this.count),this.count+=1}))}commit(){this.count&&(this._writeClose(),this.commentsStream.end(),this.vmlStream.end())}},fm=class extends N{get tag(){return`hyperlink`}render(e,t){t.target&&pm(t.target)?e.leafNode(`hyperlink`,{ref:t.address,tooltip:t.tooltip,location:t.target.slice(1)}):e.leafNode(`hyperlink`,{ref:t.address,"r:id":t.rId,tooltip:t.tooltip})}parseOpen(e){if(e.name===`hyperlink`){if(this.model={address:e.attributes.ref,rId:e.attributes[`r:id`],tooltip:e.attributes.tooltip},e.attributes.location){let t=e.attributes.location;this.model.target=t.startsWith(`#`)?t:`#${t}`}return!0}return!1}parseText(){}parseClose(){return!1}};function pm(e){return e.startsWith(`#`)}var mm=class{constructor(e){this.writer=e}push(e){this.writer.addHyperlink(e)}},hm=class{constructor(e){this.id=e.id,this.count=0,this._hyperlinks=[],this._workbook=e.workbook}get stream(){return this._stream||=this._workbook._openStream(nd(this.id)),this._stream}get length(){return this._hyperlinks.length}each(e){return this._hyperlinks.forEach(e)}get hyperlinksProxy(){return this._hyperlinksProxy||=new mm(this)}addHyperlink(e){if(pm(e.target)){this._hyperlinks.push({address:e.address,target:e.target});return}let t={Target:e.target,Type:k.Hyperlink,TargetMode:`External`},n=this._writeRelationship(t);this._hyperlinks.push({rId:n,address:e.address})}addMedia(e){return this._writeRelationship(e)}addRelationship(e){return this._writeRelationship(e)}commit(){this.count&&(this._writeClose(),this.stream.end())}_writeOpen(){this.stream.write(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
404
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`)}_writeRelationship(e){this.count||this._writeOpen();let t=`rId${++this.count}`;return e.TargetMode?this.stream.write(`<Relationship Id="${t}" Type="${Mc(e.Type)}" Target="${Mc(e.Target)}" TargetMode="${Mc(e.TargetMode)}"/>`):this.stream.write(`<Relationship Id="${t}" Type="${Mc(e.Type)}" Target="${Mc(e.Target)}"/>`),t}_writeClose(){this.stream.write(`</Relationships>`)}};function gm(e){return jd(e.name&&e.extension&&e.name.endsWith(`.${e.extension}`)?e.name:`${e.name}.${e.extension}`)}function _m(e,t,n){let r=[],i=[...t],a={};for(let t of e){let e=String(t.imageId),o=n.getBookImage(t.imageId);if(!o)continue;let s=a[e];s||(s=n.nextRId(i),a[e]=s,i.push({Id:s,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,Target:gm(o)}));let c={picture:{rId:s},range:t.range};if(t.opacity!==void 0){let e=Math.max(0,Math.min(1,t.opacity));c.picture.alphaModFix=Math.round(e*1e5)}if(t.hyperlinks&&t.hyperlinks.hyperlink){let e=n.nextRId(i);c.picture.hyperlinks={tooltip:t.hyperlinks.tooltip,rId:e},i.push({Id:e,Type:k.Hyperlink,Target:t.hyperlinks.hyperlink,TargetMode:`External`})}r.push(c)}return{anchors:r,rels:i}}function vm(e){return e.filter(e=>e==null?!1:e.range?.pos===void 0?e.range?.br&&e.shape?!0:!(!e.range?.br&&!e.picture||e.range?.br&&!e.picture&&!e.shape):!!e.picture)}function ym(e,t,n,r,i){let a=i(e,t)?.style?.border,o=r-t+1,s=n-e+1,c=Array(o),l=Array(o),u=Array(s),d=Array(s),f=!1;for(let o=t;o<=r;o++){let r=o-t,s=i(e,o)?.style?.border;c[r]=s?.top||a?.top,n===e?l[r]=s?.bottom||a?.bottom:l[r]=i(n,o)?.style?.border?.bottom||a?.bottom,(c[r]||l[r])&&(f=!0)}for(let o=e;o<=n;o++){let n=o-e,s=i(o,t)?.style?.border;u[n]=s?.left||a?.left,r===t?d[n]=s?.right||a?.right:d[n]=i(o,r)?.style?.border?.right||a?.right,(u[n]||d[n])&&(f=!0)}let p=a?.diagonal,m=a?.color;if(!(!f&&!p))return{topEdges:c,bottomEdges:l,leftEdges:u,rightEdges:d,diagonal:p,color:m}}function bm(e,t,n,r,i,a){let{topEdges:o,bottomEdges:s,leftEdges:c,rightEdges:l,diagonal:u,color:d}=i,f=a(e,t).style;for(let i=e;i<=n;i++)for(let p=t;p<=r;p++){let m=a(i,p),h=_c(f)||{},g={},_=!1;i===e&&o[p-t]&&(g.top=o[p-t],_=!0),i===n&&s[p-t]&&(g.bottom=s[p-t],_=!0),p===t&&c[i-e]&&(g.left=c[i-e],_=!0),p===r&&l[i-e]&&(g.right=l[i-e],_=!0),u&&(g.diagonal=u,_=!0),_?(d&&(g.color=d),h.border=g):delete h.border,m.style=h}}eo();function xm(e){let t=new Uint8Array(4);return t[0]=e&255,t[1]=e>>8&255,t[2]=e>>16&255,t[3]=e>>24&255,t}let Sm={async hash(e,...t){return Ja(e,T(t))},async convertPasswordToHash(e,t,n,r){let i=ul(e),a=Rc(n),o=await this.hash(t,a,i);for(let e=0;e<r;e++)o=await this.hash(t,o,xm(e));return ll(o)},randomBytes(e){return qa(e)}};async function Cm(e,t){let n={sheet:!0};return t&&`spinCount`in t&&(t.spinCount=Number.isFinite(t.spinCount)?Math.round(Math.max(0,t.spinCount)):1e5),e&&(n.algorithmName=`SHA-512`,n.saltValue=ll(Sm.randomBytes(16)),n.spinCount=t&&`spinCount`in t?t.spinCount:1e5,n.hashValue=await Sm.convertPasswordToHash(e,`SHA-512`,n.saltValue,n.spinCount)),t&&(Object.assign(n,t),!e&&`spinCount`in t&&delete n.spinCount),n}let wm=new TextEncoder;var Tm=class{constructor(e){this._buf=new Uint8Array(e&&e.size||16384),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._buf.slice(0,this._inPos),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=new Uint8Array(t);n.set(this._buf),this._buf=n}addText(e){this._buffer=void 0;let t=this._inPos+e.length;t>this._buf.length-4&&this._grow(t);let n=this._buf.subarray(this._inPos),r=wm.encodeInto(e,n);if(r.read<e.length){let t=e.length-r.read;this._grow(this._inPos+r.written+t*3);let n=wm.encodeInto(e.substring(r.read),this._buf.subarray(this._inPos+r.written));this._inPos+=r.written+n.written}else this._inPos+=r.written}addStringBuf(e){e.length&&(this._buffer=void 0,this.length+e.length>this.capacity&&this._grow(this.length+e.length),this._buf.set(e._buf.subarray(0,e.length),this._inPos),this._inPos+=e.length)}},Em=class extends N{get tag(){return`autoFilter`}render(e,t){if(t)if(typeof t==`string`)e.leafNode(`autoFilter`,{ref:t});else{let n=function(e){return typeof e==`string`?e:O.getAddress(e.row,e.col).address},r=n(t.from),i=n(t.to);r&&i&&e.leafNode(`autoFilter`,{ref:`${r}:${i}`})}}parseOpen(e){e.name===`autoFilter`&&(this.model=e.attributes.ref)}},Dm=class extends N{createNewModel(e){return{}}parseOpen(e){return this.parser=this.parser||this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.model=this.createNewModel(e),!0):!1}parseText(e){this.parser&&this.parser.parseText(e)}onParserClose(e,t){this.model[e]=t.model}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.onParserClose(e,this.parser),this.parser=void 0),!0):e!==this.tag}get tag(){return``}},Om=class extends N{get tag(){return`cfvo`}render(e,t){e.leafNode(this.tag,{type:t.type,val:t.value})}parseOpen(e){this.model={type:e.attributes.type,value:N.toFloatValue(e.attributes.val)}}parseClose(e){return e!==this.tag}},km=class extends Dm{constructor(){super(),this.map={cfvo:this.cfvoXform=new Om,color:this.colorXform=new nf}}get tag(){return`colorScale`}render(e,t){e.openNode(this.tag),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),t.color.forEach(t=>{this.colorXform.render(e,t)}),e.closeNode()}createNewModel(e){return{cfvo:[],color:[]}}onParserClose(e,t){this.model[e].push(t.model)}},Am=class extends Dm{constructor(){super(),this.map={cfvo:this.cfvoXform=new Om,color:this.colorXform=new nf}}get tag(){return`dataBar`}render(e,t){e.openNode(this.tag),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),this.colorXform.render(e,t.color),e.closeNode()}createNewModel(){return{cfvo:[]}}onParserClose(e,t){switch(e){case`cfvo`:this.model.cfvo.push(t.model);break;case`color`:this.model.color=t.model;break}}},jm=class extends N{get tag(){return`x14:id`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}},Mm=class extends Dm{constructor(){super(),this.map={"x14:id":this.idXform=new jm}}get tag(){return`ext`}render(e,t){e.openNode(this.tag,{uri:`{B025F937-C7B1-47D3-B67F-A62EFF666E3E}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`}),this.idXform.render(e,t.x14Id),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){this.model.x14Id=t.model}},Nm=class extends Dm{constructor(){super(),this.map={ext:new Mm}}get tag(){return`extLst`}render(e,t){t.x14Id&&(e.openNode(this.tag),this.map.ext.render(e,t),e.closeNode())}createNewModel(){return{}}onParserClose(e,t){Object.assign(this.model,t.model)}},Pm=class extends N{get tag(){return`formula`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}},Fm=class extends Dm{constructor(){super(),this.map={cfvo:this.cfvoXform=new Om}}get tag(){return`iconSet`}render(e,t){e.openNode(this.tag,{iconSet:N.toStringAttribute(t.iconSet,`3TrafficLights`),reverse:N.toBoolAttribute(t.reverse,!1),showValue:N.toBoolAttribute(t.showValue,!0)}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),e.closeNode()}createNewModel({attributes:e}){return{iconSet:N.toStringValue(e.iconSet,`3TrafficLights`),reverse:N.toBoolValue(e.reverse),showValue:N.toBoolValue(e.showValue),cfvo:[]}}onParserClose(e,t){this.model[e].push(t.model)}};let Im={"3Triangles":!0,"3Stars":!0,"5Boxes":!0},Lm=e=>{if(e.formulae&&e.formulae[0])return e.formulae[0];let{tl:t}=new Gr(e.ref);switch(e.operator){case`containsText`:return`NOT(ISERROR(SEARCH("${e.text}",${t})))`;case`containsBlanks`:return`LEN(TRIM(${t}))=0`;case`notContainsBlanks`:return`LEN(TRIM(${t}))>0`;case`containsErrors`:return`ISERROR(${t})`;case`notContainsErrors`:return`NOT(ISERROR(${t}))`;default:return}},Rm=e=>{if(e.formulae&&e.formulae[0])return e.formulae[0];let{tl:t}=new Gr(e.ref);switch(e.timePeriod){case`thisWeek`:return`AND(TODAY()-ROUNDDOWN(${t},0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(${t},0)-TODAY()<=7-WEEKDAY(TODAY()))`;case`lastWeek`:return`AND(TODAY()-ROUNDDOWN(${t},0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(${t},0)<(WEEKDAY(TODAY())+7))`;case`nextWeek`:return`AND(ROUNDDOWN(${t},0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(${t},0)-TODAY()<(15-WEEKDAY(TODAY())))`;case`yesterday`:return`FLOOR(${t},1)=TODAY()-1`;case`today`:return`FLOOR(${t},1)=TODAY()`;case`tomorrow`:return`FLOOR(${t},1)=TODAY()+1`;case`last7Days`:return`AND(TODAY()-FLOOR(${t},1)<=6,FLOOR(${t},1)<=TODAY())`;case`lastMonth`:return`AND(MONTH(${t})=MONTH(EDATE(TODAY(),0-1)),YEAR(${t})=YEAR(EDATE(TODAY(),0-1)))`;case`thisMonth`:return`AND(MONTH(${t})=MONTH(TODAY()),YEAR(${t})=YEAR(TODAY()))`;case`nextMonth`:return`AND(MONTH(${t})=MONTH(EDATE(TODAY(),0+1)),YEAR(${t})=YEAR(EDATE(TODAY(),0+1)))`;default:return}},zm=e=>{let{type:t,operator:n}=e;switch(t){case`containsText`:case`containsBlanks`:case`notContainsBlanks`:case`containsErrors`:case`notContainsErrors`:return{type:`containsText`,operator:t};default:return{type:t,operator:n}}};var Bm=class e extends Dm{constructor(){super(),this.map={dataBar:this.databarXform=new Am,extLst:this.extLstRefXform=new Nm,formula:this.formulaXform=new Pm,colorScale:this.colorScaleXform=new km,iconSet:this.iconSetXform=new Fm}}get tag(){return`cfRule`}static isPrimitive(e){return!(e.type===`iconSet`&&(e.custom||Im[e.iconSet]))}render(e,t){switch(t.type){case`expression`:this.renderExpression(e,t);break;case`cellIs`:this.renderCellIs(e,t);break;case`top10`:this.renderTop10(e,t);break;case`aboveAverage`:this.renderAboveAverage(e,t);break;case`dataBar`:this.renderDataBar(e,t);break;case`colorScale`:this.renderColorScale(e,t);break;case`iconSet`:this.renderIconSet(e,t);break;case`containsText`:this.renderText(e,t);break;case`timePeriod`:this.renderTimePeriod(e,t);break}}renderExpression(e,t){e.openNode(this.tag,{type:`expression`,dxfId:t.dxfId,priority:t.priority}),this.formulaXform.render(e,t.formulae[0]),e.closeNode()}renderCellIs(e,t){e.openNode(this.tag,{type:`cellIs`,dxfId:t.dxfId,priority:t.priority,operator:t.operator}),t.formulae.forEach(t=>{this.formulaXform.render(e,t)}),e.closeNode()}renderTop10(e,t){e.leafNode(this.tag,{type:`top10`,dxfId:t.dxfId,priority:t.priority,percent:N.toBoolAttribute(t.percent,!1),bottom:N.toBoolAttribute(t.bottom,!1),rank:N.toIntValue(t.rank,10)})}renderAboveAverage(e,t){e.leafNode(this.tag,{type:`aboveAverage`,dxfId:t.dxfId,priority:t.priority,aboveAverage:N.toBoolAttribute(t.aboveAverage,!0)})}renderDataBar(e,t){e.openNode(this.tag,{type:`dataBar`,priority:t.priority}),this.databarXform.render(e,t),this.extLstRefXform.render(e,t),e.closeNode()}renderColorScale(e,t){e.openNode(this.tag,{type:`colorScale`,priority:t.priority}),this.colorScaleXform.render(e,t),e.closeNode()}renderIconSet(t,n){e.isPrimitive(n)&&(t.openNode(this.tag,{type:`iconSet`,priority:n.priority}),this.iconSetXform.render(t,n),t.closeNode())}renderText(e,t){e.openNode(this.tag,{type:t.operator,dxfId:t.dxfId,priority:t.priority,operator:N.toStringAttribute(t.operator,`containsText`)});let n=Lm(t);n&&this.formulaXform.render(e,n),e.closeNode()}renderTimePeriod(e,t){e.openNode(this.tag,{type:`timePeriod`,dxfId:t.dxfId,priority:t.priority,timePeriod:t.timePeriod});let n=Rm(t);n&&this.formulaXform.render(e,n),e.closeNode()}createNewModel({attributes:e}){return{...zm(e),dxfId:N.toIntValue(e.dxfId),priority:N.toIntValue(e.priority),timePeriod:e.timePeriod,percent:N.toBoolValue(e.percent),bottom:N.toBoolValue(e.bottom),rank:N.toIntValue(e.rank),aboveAverage:N.toBoolValue(e.aboveAverage)}}onParserClose(e,t){switch(e){case`dataBar`:case`extLst`:case`colorScale`:case`iconSet`:Object.assign(this.model,t.model);break;case`formula`:this.model.formulae=this.model.formulae??[],this.model.formulae.push(t.model);break}}},Vm=class extends Dm{constructor(){super(),this.map={cfRule:new Bm}}get tag(){return`conditionalFormatting`}render(e,t){t.rules.some(Bm.isPrimitive)&&(e.openNode(this.tag,{sqref:t.ref}),t.rules.forEach(n=>{Bm.isPrimitive(n)&&(n.ref=t.ref,this.map.cfRule.render(e,n))}),e.closeNode())}createNewModel({attributes:e}){return{ref:e.sqref,rules:[]}}onParserClose(e,t){this.model.rules.push(t.model)}},Hm=class extends N{constructor(){super(),this.cfXform=new Vm}get tag(){return`conditionalFormatting`}reset(){this.model=[]}prepare(e,t){let n=e.reduce((e,t)=>Math.max(e,...t.rules.map(e=>e.priority??0)),1);e.forEach(e=>{e.rules.forEach(e=>{e.priority||=n++,e.style&&(e.dxfId=t.styles.addDxfStyle(e.style)),e.type===`dataBar`&&((!e.cfvo||e.cfvo.length<2)&&(e.cfvo=[{type:`min`},{type:`max`}]),e.color||={argb:`FF638EC6`})})})}render(e,t){t.forEach(t=>{this.cfXform.render(e,t)})}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`conditionalFormatting`:return this.parser=this.cfXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?this.parser.parseClose(e)?!0:(this.model.push(this.parser.model),this.parser=void 0,!1):!1}reconcile(e,t){e.forEach(e=>{e.rules.forEach(e=>{e.dxfId!==void 0&&(e.style=t.styles.getDxfStyle(e.dxfId),delete e.dxfId)})})}},Um=class extends N{get tag(){return`brk`}render(e,t){e.leafNode(`brk`,t)}parseOpen(e){if(e.name===`brk`){let{id:t,max:n,man:r,min:i}=e.attributes;return this.model={id:+t,max:+n,man:+r},i!==void 0&&(this.model.min=+i),!0}return!1}parseText(){}parseClose(){return!1}},Wm=class extends P{constructor(){super({tag:`colBreaks`,count:!0,childXform:new Um})}render(e,t){if(t&&t.length){e.openNode(this.tag,this.$),e.addAttribute(this.$count,t.length),e.addAttribute(`manualBreakCount`,t.length);let{childXform:n}=this;for(let r of t)n.render(e,r);e.closeNode()}}},Gm=class extends N{get tag(){return`col`}prepare(e,t){let n=t.styles.addStyleModel(e.style||{});n&&(e.styleId=n)}render(e,t){e.openNode(`col`),e.addAttribute(`min`,t.min),e.addAttribute(`max`,t.max),t.width&&e.addAttribute(`width`,t.width),t.styleId&&e.addAttribute(`style`,t.styleId),t.hidden&&e.addAttribute(`hidden`,`1`),t.bestFit&&e.addAttribute(`bestFit`,`1`),t.outlineLevel&&e.addAttribute(`outlineLevel`,t.outlineLevel),t.collapsed&&e.addAttribute(`collapsed`,`1`),e.addAttribute(`customWidth`,`1`),e.closeNode()}parseOpen(e){if(e.name===`col`){let t=this.model={min:parseInt(e.attributes.min??`0`,10),max:parseInt(e.attributes.max??`0`,10),width:e.attributes.width===void 0?void 0:parseFloat(e.attributes.width??`0`)};return e.attributes.style&&(t.styleId=parseInt(e.attributes.style,10)),el(e.attributes.hidden)&&(t.hidden=!0),el(e.attributes.bestFit)&&(t.bestFit=!0),e.attributes.outlineLevel&&(t.outlineLevel=parseInt(e.attributes.outlineLevel,10)),el(e.attributes.collapsed)&&(t.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(e,t){e.styleId!==void 0&&(e.style=t.styles.getStyleModel(e.styleId))}};function Km(e,t,n,r){let i=t[n];i===void 0?r!==void 0&&(e[n]=r):e[n]=i}function qm(e,t,n,r){let i=t[n];i===void 0?r!==void 0&&(e[n]=r):e[n]=el(i)}function Jm(e){if(!e)return[];let t=[],n={};for(let[r,i]of Object.entries(e))if(i!=null)if(r.startsWith(`range:`)){let e=r.slice(6),{sqref:n,...a}=i;t.push({...a,sqref:e})}else n[r]=i;if(Object.keys(n).length===0)return t;let r=Object.entries(n).map(([e,t])=>({address:e,dataValidation:t,marked:!1})).sort((e,t)=>O.compareAddress(e.address,t.address)),i=Object.fromEntries(r.map(e=>[e.address,e])),a=(e,t,r)=>{for(let i=0;i<t;i++){let t=O.encodeAddress(e.row+i,r);if(!n[t]||!bc(n[e.address],n[t]))return!1}return!0},o=r.map(e=>{if(!e.marked){let t=O.decodeEx(e.address);if(t.dimensions)return i[t.dimensions].marked=!0,{...e.dataValidation,sqref:e.address};let r=1,o=O.encodeAddress(t.row+r,t.col);for(;n[o]&&bc(e.dataValidation,n[o]);)r++,o=O.encodeAddress(t.row+r,t.col);let s=1;for(;a(t,r,t.col+s);)s++;for(let e=0;e<r;e++)for(let n=0;n<s;n++)o=O.encodeAddress(t.row+e,t.col+n),i[o].marked=!0;if(r>1||s>1){let n=t.row+(r-1),i=t.col+(s-1);return{...e.dataValidation,sqref:`${e.address}:${O.encodeAddress(n,i)}`}}return{...e.dataValidation,sqref:e.address}}return null}).filter(Boolean);return[...t,...o]}var Ym=class extends N{get tag(){return`dataValidations`}render(e,t){let n=Jm(t);n.length&&(e.openNode(`dataValidations`,{count:n.length}),n.forEach(t=>{e.openNode(`dataValidation`),t.type!==`any`&&(e.addAttribute(`type`,t.type),t.operator&&t.type!==`list`&&t.operator!==`between`&&e.addAttribute(`operator`,t.operator),t.allowBlank&&e.addAttribute(`allowBlank`,`1`)),t.showInputMessage&&e.addAttribute(`showInputMessage`,`1`),t.promptTitle&&e.addAttribute(`promptTitle`,t.promptTitle),t.prompt&&e.addAttribute(`prompt`,t.prompt),t.showErrorMessage&&e.addAttribute(`showErrorMessage`,`1`),t.errorStyle&&e.addAttribute(`errorStyle`,t.errorStyle),t.errorTitle&&e.addAttribute(`errorTitle`,t.errorTitle),t.error&&e.addAttribute(`error`,t.error),e.addAttribute(`sqref`,t.sqref),(t.formulae??[]).forEach((n,r)=>{e.openNode(`formula${r+1}`),t.type===`date`?e.writeText(zc(new Date(n))):e.writeText(n),e.closeNode()}),e.closeNode()}),e.closeNode())}parseOpen(e){switch(e.name){case`dataValidations`:return this.model={},!0;case`dataValidation`:{this._address=e.attributes.sqref;let t={type:e.attributes.type??`any`,formulae:[]};switch(e.attributes.type&&qm(t,e.attributes,`allowBlank`),qm(t,e.attributes,`showInputMessage`),qm(t,e.attributes,`showErrorMessage`),t.type){case`any`:case`list`:case`custom`:break;default:Km(t,e.attributes,`operator`,`between`);break}return Km(t,e.attributes,`promptTitle`),Km(t,e.attributes,`prompt`),Km(t,e.attributes,`errorStyle`),Km(t,e.attributes,`errorTitle`),Km(t,e.attributes,`error`),this._dataValidation=t,!0}case`formula1`:case`formula2`:return this._formula=[],!0;default:return!1}}parseText(e){this._formula&&this._formula.push(e)}parseClose(e){switch(e){case`dataValidations`:return!1;case`dataValidation`:return(!this._dataValidation.formulae||!this._dataValidation.formulae.length)&&(delete this._dataValidation.formulae,delete this._dataValidation.operator),this._address.split(/\s+/g).forEach(e=>{e.includes(`:`)?this.model[`range:${e}`]=this._dataValidation:this.model[e]=this._dataValidation}),!0;case`formula1`:case`formula2`:{let e=this._formula.join(``);switch(this._dataValidation.type){case`whole`:case`textLength`:e=parseInt(e,10);break;case`decimal`:e=parseFloat(e);break;case`date`:e=Bc(parseFloat(e));break;default:break}return this._dataValidation.formulae.push(e),this._formula=void 0,!0}default:return!0}}},Xm=class extends N{get tag(){return`drawing`}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:id`]},!0;default:return!1}}parseText(){}parseClose(){return!1}},Zm=class extends N{get tag(){return`xm:f`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}},Qm=class extends Dm{constructor(){super(),this.map={"xm:f":this.fExtXform=new Zm}}get tag(){return`x14:cfvo`}render(e,t){e.openNode(this.tag,{type:t.type}),t.value!==void 0&&this.fExtXform.render(e,t.value),e.closeNode()}createNewModel(e){return{type:e.attributes.type}}onParserClose(e,t){switch(e){case`xm:f`:this.model.value=t.model?parseFloat(t.model):0;break}}},$m=class extends Dm{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new Qm,"x14:borderColor":this.borderColorXform=new nf(`x14:borderColor`),"x14:negativeBorderColor":this.negativeBorderColorXform=new nf(`x14:negativeBorderColor`),"x14:negativeFillColor":this.negativeFillColorXform=new nf(`x14:negativeFillColor`),"x14:axisColor":this.axisColorXform=new nf(`x14:axisColor`)}}static isExt(e){return!0}get tag(){return`x14:dataBar`}render(e,t){e.openNode(this.tag,{minLength:N.toIntAttribute(t.minLength,0,!0),maxLength:N.toIntAttribute(t.maxLength,100,!0),border:N.toBoolAttribute(t.border,!1),gradient:N.toBoolAttribute(t.gradient,!0),negativeBarColorSameAsPositive:N.toBoolAttribute(t.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:N.toBoolAttribute(t.negativeBarBorderColorSameAsPositive,!0),axisPosition:N.toAttribute(t.axisPosition,`auto`),direction:N.toAttribute(t.direction,`leftToRight`)}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),this.borderColorXform.render(e,t.borderColor),this.negativeBorderColorXform.render(e,t.negativeBorderColor),this.negativeFillColorXform.render(e,t.negativeFillColor),this.axisColorXform.render(e,t.axisColor),e.closeNode()}createNewModel({attributes:e}){return{cfvo:[],minLength:N.toIntValue(e.minLength,0),maxLength:N.toIntValue(e.maxLength,100),border:N.toBoolValue(e.border,!1),gradient:N.toBoolValue(e.gradient,!0),negativeBarColorSameAsPositive:N.toBoolValue(e.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:N.toBoolValue(e.negativeBarBorderColorSameAsPositive,!0),axisPosition:N.toStringValue(e.axisPosition,`auto`),direction:N.toStringValue(e.direction,`leftToRight`)}}onParserClose(e,t){let[,n]=e.split(`:`);switch(n){case`cfvo`:this.model.cfvo.push(t.model);break;default:this.model[n]=t.model;break}}},eh=class extends N{get tag(){return`x14:cfIcon`}render(e,t){e.leafNode(this.tag,{iconSet:t.iconSet,iconId:t.iconId})}parseOpen({attributes:e}){this.model={iconSet:e.iconSet,iconId:N.toIntValue(e.iconId)}}parseClose(e){return e!==this.tag}},th=class extends Dm{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new Qm,"x14:cfIcon":this.cfIconXform=new eh}}get tag(){return`x14:iconSet`}render(e,t){e.openNode(this.tag,{iconSet:N.toStringAttribute(t.iconSet),reverse:N.toBoolAttribute(t.reverse,!1),showValue:N.toBoolAttribute(t.showValue,!0),custom:N.toBoolAttribute(t.icons,!1)}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),t.icons&&t.icons.forEach((t,n)=>{t.iconId=n,this.cfIconXform.render(e,t)}),e.closeNode()}createNewModel({attributes:e}){return{cfvo:[],iconSet:N.toStringValue(e.iconSet,`3TrafficLights`),reverse:N.toBoolValue(e.reverse,!1),showValue:N.toBoolValue(e.showValue,!0)}}onParserClose(e,t){let[,n]=e.split(`:`);switch(n){case`cfvo`:this.model.cfvo.push(t.model);break;case`cfIcon`:this.model.icons||(this.model.icons=[]),this.model.icons.push(t.model);break;default:this.model[n]=t.model;break}}};function nh(e){return e.toString(16).padStart(2,`0`)}function rh(e){e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=e;return nh(t[0])+nh(t[1])+nh(t[2])+nh(t[3])+`-`+nh(t[4])+nh(t[5])+`-`+nh(t[6])+nh(t[7])+`-`+nh(t[8])+nh(t[9])+`-`+nh(t[10])+nh(t[11])+nh(t[12])+nh(t[13])+nh(t[14])+nh(t[15])}function ih(){let e=globalThis.crypto;if(e?.randomUUID)return e.randomUUID();let t=new Uint8Array(16);if(e?.getRandomValues)return e.getRandomValues(t),rh(t);for(let e=0;e<t.length;e++)t[e]=Math.floor(Math.random()*256);return rh(t)}let ah={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};var oh=class e extends Dm{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new $m,"x14:iconSet":this.iconSetXform=new th}}get tag(){return`x14:cfRule`}static isExt(e){return e.type===`dataBar`?$m.isExt(e):!!(e.type===`iconSet`&&(e.custom||ah[e.iconSet]))}static prepareRule(t){e.isExt(t)&&!t.x14Id&&(t.x14Id=`{${ih()}}`.toUpperCase())}prepare(t){e.prepareRule(t)}render(t,n){if(e.isExt(n))switch(n.type){case`dataBar`:this.renderDataBar(t,n);break;case`iconSet`:this.renderIconSet(t,n);break}}renderDataBar(e,t){e.openNode(this.tag,{type:`dataBar`,id:t.x14Id}),this.databarXform.render(e,t),e.closeNode()}renderIconSet(e,t){e.openNode(this.tag,{type:`iconSet`,priority:t.priority,id:t.x14Id??`{${ih()}}`}),this.iconSetXform.render(e,t),e.closeNode()}createNewModel({attributes:e}){return{type:e.type,x14Id:e.id,priority:N.toIntValue(e.priority)}}onParserClose(e,t){Object.assign(this.model,t.model)}},sh=class extends N{get tag(){return`xm:sqref`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}},ch=class extends Dm{constructor(){super(),this.map={"xm:sqref":this.sqRef=new sh,"x14:cfRule":this.cfRule=new oh}}get tag(){return`x14:conditionalFormatting`}prepare(e){e.rules.forEach(e=>{this.cfRule.prepare(e)})}render(e,t){t.rules.some(oh.isExt)&&(e.openNode(this.tag,{"xmlns:xm":`http://schemas.microsoft.com/office/excel/2006/main`}),t.rules.filter(oh.isExt).forEach(t=>this.cfRule.render(e,t)),this.sqRef.render(e,t.ref),e.closeNode())}createNewModel(){return{rules:[]}}onParserClose(e,t){switch(e){case`xm:sqref`:this.model.ref=t.model;break;case`x14:cfRule`:this.model.rules.push(t.model);break}}},lh=class extends Dm{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new ch}}get tag(){return`x14:conditionalFormattings`}hasContent(e){return e.hasExtContent===void 0&&(e.hasExtContent=e.some(e=>e.rules.some(oh.isExt))),e.hasExtContent}prepare(e){e.forEach(e=>{this.cfXform.prepare(e)})}render(e,t){this.hasContent(t)&&(e.openNode(this.tag),t.forEach(t=>this.cfXform.render(e,t)),e.closeNode())}createNewModel(){return[]}onParserClose(e,t){this.model.push(t.model)}},uh=class extends Dm{constructor(){super(),this.map={"x14:conditionalFormattings":this.conditionalFormattings=new lh}}get tag(){return`ext`}hasContent(e){return this.conditionalFormattings.hasContent(e.conditionalFormattings)}prepare(e){this.conditionalFormattings.prepare(e.conditionalFormattings)}render(e,t){e.openNode(`ext`,{uri:`{78C0D931-6437-407d-A8EE-F0AAD7539E65}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`}),this.conditionalFormattings.render(e,t.conditionalFormattings),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){this.model[e]=t.model}},dh=class extends Dm{constructor(){super(),this.map={ext:this.ext=new uh}}get tag(){return`extLst`}prepare(e,t){this.ext.prepare(e)}hasContent(e){return this.ext.hasContent(e)}render(e,t){this.hasContent(t)&&(e.openNode(`extLst`),this.ext.render(e,t),e.closeNode())}createNewModel(){return{}}onParserClose(e,t){this.model[e]=t.model}},fh=class extends N{get tag(){return`headerFooter`}render(e,t){if(!t)return;let n={},r=[];if(t.differentFirst&&(n.differentFirst=`1`),t.differentOddEven&&(n.differentOddEven=`1`),t.oddHeader&&typeof t.oddHeader==`string`&&r.push({name:`oddHeader`,text:t.oddHeader}),t.oddFooter&&typeof t.oddFooter==`string`&&r.push({name:`oddFooter`,text:t.oddFooter}),t.evenHeader&&typeof t.evenHeader==`string`&&r.push({name:`evenHeader`,text:t.evenHeader}),t.evenFooter&&typeof t.evenFooter==`string`&&r.push({name:`evenFooter`,text:t.evenFooter}),t.firstHeader&&typeof t.firstHeader==`string`&&r.push({name:`firstHeader`,text:t.firstHeader}),t.firstFooter&&typeof t.firstFooter==`string`&&r.push({name:`firstFooter`,text:t.firstFooter}),Object.keys(n).length>0||r.length>0){e.openNode(`headerFooter`,n);for(let t of r)e.leafNode(t.name,null,t.text);e.closeNode()}}parseOpen(e){switch(e.name){case`headerFooter`:return this.model={},e.attributes.differentFirst&&(this.model.differentFirst=parseInt(e.attributes.differentFirst,0)===1),e.attributes.differentOddEven&&(this.model.differentOddEven=parseInt(e.attributes.differentOddEven,0)===1),!0;case`oddHeader`:return this.currentNode=`oddHeader`,!0;case`oddFooter`:return this.currentNode=`oddFooter`,!0;case`evenHeader`:return this.currentNode=`evenHeader`,!0;case`evenFooter`:return this.currentNode=`evenFooter`,!0;case`firstHeader`:return this.currentNode=`firstHeader`,!0;case`firstFooter`:return this.currentNode=`firstFooter`,!0;default:return!1}}parseText(e){switch(this.currentNode){case`oddHeader`:this.model.oddHeader=(this.model.oddHeader??``)+e;break;case`oddFooter`:this.model.oddFooter=(this.model.oddFooter??``)+e;break;case`evenHeader`:this.model.evenHeader=(this.model.evenHeader??``)+e;break;case`evenFooter`:this.model.evenFooter=(this.model.evenFooter??``)+e;break;case`firstHeader`:this.model.firstHeader=(this.model.firstHeader??``)+e;break;case`firstFooter`:this.model.firstFooter=(this.model.firstFooter??``)+e;break;default:break}}parseClose(){switch(this.currentNode){case`oddHeader`:case`oddFooter`:case`evenHeader`:case`evenFooter`:case`firstHeader`:case`firstFooter`:return this.currentNode=void 0,!0;default:return!1}}};let ph=[`numberStoredAsText`,`formula`,`formulaRange`,`unlockedFormula`,`emptyCellReference`,`listDataValidation`,`calculatedColumn`,`evalError`,`twoDigitTextYear`];var mh=class extends N{get tag(){return`ignoredErrors`}render(e,t){if(!(!t||t.length===0)){e.openNode(`ignoredErrors`);for(let n of t){let t={sqref:n.ref};for(let e of ph)n[e]&&(t[e]=1);e.leafNode(`ignoredError`,t)}e.closeNode()}}parseOpen(e){switch(e.name){case`ignoredErrors`:return this.model=[],!0;case`ignoredError`:{let t={ref:e.attributes.sqref??``};for(let n of ph)(e.attributes[n]===`1`||e.attributes[n]===`true`)&&(t[n]=!0);return this.model.push(t),!0}default:return!0}}parseText(){}parseClose(e){switch(e){case`ignoredErrors`:return!1;default:return!0}}},hh=class extends N{get tag(){return`pageMargins`}render(e,t){if(t){let n={left:t.left,right:t.right,top:t.top,bottom:t.bottom,header:t.header,footer:t.footer};Object.values(n).some(e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={left:parseFloat(e.attributes.left||.7),right:parseFloat(e.attributes.right||.7),top:parseFloat(e.attributes.top||.75),bottom:parseFloat(e.attributes.bottom||.75),header:parseFloat(e.attributes.header||.3),footer:parseFloat(e.attributes.footer||.3)},!0;default:return!1}}parseText(){}parseClose(){return!1}};function gh(e){return e?`1`:void 0}function _h(e){switch(e){case`overThenDown`:return e;default:return}}function vh(e){switch(e){case`atEnd`:case`asDisplyed`:return e;default:return}}function yh(e){switch(e){case`dash`:case`blank`:case`NA`:return e;default:return}}function bh(e){return e===void 0?void 0:parseInt(e,10)}var xh=class extends N{get tag(){return`pageSetup`}_dpiToXml(e){if(e!==void 0&&Number.isFinite(e)&&e!==4294967295)return e}render(e,t){if(t){let n={paperSize:t.paperSize,orientation:t.orientation,horizontalDpi:this._dpiToXml(t.horizontalDpi),verticalDpi:this._dpiToXml(t.verticalDpi),pageOrder:_h(t.pageOrder),blackAndWhite:gh(t.blackAndWhite),draft:gh(t.draft),cellComments:vh(t.cellComments),errors:yh(t.errors),scale:t.scale===100?void 0:t.scale,fitToWidth:t.fitToWidth===1?void 0:t.fitToWidth,fitToHeight:t.fitToHeight===1?void 0:t.fitToHeight,firstPageNumber:t.firstPageNumber,useFirstPageNumber:gh(!!t.firstPageNumber),usePrinterDefaults:gh(t.usePrinterDefaults),copies:t.copies};Object.values(n).some(e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={paperSize:bh(e.attributes.paperSize),orientation:e.attributes.orientation??`portrait`,horizontalDpi:parseInt(e.attributes.horizontalDpi??`4294967295`,10),verticalDpi:parseInt(e.attributes.verticalDpi??`4294967295`,10),pageOrder:e.attributes.pageOrder??`downThenOver`,blackAndWhite:e.attributes.blackAndWhite===`1`,draft:e.attributes.draft===`1`,cellComments:e.attributes.cellComments??`None`,errors:e.attributes.errors??`displayed`,scale:parseInt(e.attributes.scale??`100`,10),fitToWidth:parseInt(e.attributes.fitToWidth??`1`,10),fitToHeight:parseInt(e.attributes.fitToHeight??`1`,10),firstPageNumber:parseInt(e.attributes.firstPageNumber??`1`,10),useFirstPageNumber:e.attributes.useFirstPageNumber===`1`,usePrinterDefaults:e.attributes.usePrinterDefaults===`1`,copies:parseInt(e.attributes.copies??`1`,10)},!0;default:return!1}}parseText(){}parseClose(){return!1}},Sh=class extends N{get tag(){return`picture`}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:id`]},!0;default:return!1}}parseText(){}parseClose(){return!1}},Ch=class extends P{constructor(){super({tag:`rowBreaks`,count:!0,childXform:new Um})}render(e,t){if(t&&t.length){e.openNode(this.tag,this.$),e.addAttribute(this.$count,t.length),e.addAttribute(`manualBreakCount`,t.length);let{childXform:n}=this;for(let r of t)n.render(e,r);e.closeNode()}}};function wh(e){if(e==null)return 0;if(e instanceof String||typeof e==`string`)return 3;if(typeof e==`number`)return 2;if(typeof e==`boolean`)return 9;if(e instanceof Date)return 4;if(e.text&&e.hyperlink)return 5;if(e.formula)return 6;if(e.error)return 10;throw new Pr(typeof e,`Could not understand type of value`)}function Th(e){switch(e.type){case 6:return wh(e.result);default:return e.type}}function Eh(e){if(e==null)return{text:``};if(typeof e==`string`)return{text:e};if(typeof e==`number`||typeof e==`boolean`)return{text:String(e)};if(typeof e==`object`){let t=e;if(Array.isArray(t.richText)){if(t.richText.length===0)return{text:``};let e=t.richText.map(e=>{let t=e,n={text:typeof t?.text==`string`?t.text:``};return t?.font!==null&&typeof t?.font==`object`&&(n.font=t.font),n});return{text:e.map(e=>e.text).join(``),richText:e}}if(typeof t.error==`string`)return{text:t.error}}return{text:String(e)}}var Dh=class extends N{constructor(){super(),this.richTextXform=new nm}get tag(){return`c`}prepare(e,t){let n=t.styles.addStyleModel(e.style||{},Th(e));switch(n&&(e.styleId=n),e.comment&&t.comments.push({...e.comment,ref:e.address}),e.type){case 3:case 8:t.sharedStrings&&(e.ssId=t.sharedStrings.add(e.value));break;case 4:t.date1904&&(e.date1904=!0);break;case 5:t.sharedStrings&&(Array.isArray(e.richText)&&e.richText.length>0?e.ssId=t.sharedStrings.add({richText:e.richText}):e.text!==void 0&&e.text!==null&&(e.ssId=t.sharedStrings.add(e.text))),t.hyperlinks.push({address:e.address,target:e.hyperlink,tooltip:e.tooltip});break;case 1:t.merges.add(e);break;case 6:if(t.date1904&&(e.date1904=!0),e.isDynamicArray&&(e.cm=1),e.hyperlink&&t.hyperlinks.push({address:e.address,target:e.hyperlink,tooltip:e.tooltip}),e.shareType===`shared`&&(e.si=t.siFormulae++),e.formula)t.formulae[e.address]=e;else if(e.sharedFormula){let n=t.formulae[e.sharedFormula];if(!n)throw new Dr(`Shared Formula master must exist above and or left of clone for cell ${e.address}`);n.si===void 0?(n.shareType=`shared`,n.si=t.siFormulae++,n.range=new Gr(n.address,e.address)):n.range&&n.range.expandToAddress(e.address),e.si=n.si}break;default:break}}renderFormula(e,t){let n=null;switch(t.shareType){case`shared`:n={t:`shared`,ref:t.ref||t.range.range,si:t.si};break;case`array`:n={t:`array`,ref:t.ref};break;default:t.si!==void 0&&(n={t:`shared`,si:t.si});break}switch(wh(t.result)){case 0:e.leafNode(`f`,n,t.formula);break;case 3:e.addAttribute(`t`,`str`),e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result);break;case 2:e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result);break;case 9:e.addAttribute(`t`,`b`),e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,+!!t.result);break;case 10:e.addAttribute(`t`,`e`),e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result.error);break;case 4:e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,zc(t.result,t.date1904));break;default:throw new Pr(String(wh(t.result)),`Could not understand type of value`)}}render(e,t){if(!(t.type===0&&!t.styleId)){switch(e.openNode(`c`),e.addAttribute(`r`,t.address),t.styleId&&e.addAttribute(`s`,t.styleId),t.cm&&e.addAttribute(`cm`,t.cm),t.type){case 0:break;case 2:e.leafNode(`v`,null,t.value);break;case 9:e.addAttribute(`t`,`b`),e.leafNode(`v`,null,t.value?`1`:`0`);break;case 12:e.addAttribute(`t`,`b`),e.leafNode(`v`,null,t.value?`1`:`0`);break;case 10:e.addAttribute(`t`,`e`),e.leafNode(`v`,null,t.value.error);break;case 3:case 8:t.ssId===void 0?t.value&&t.value.richText?(e.addAttribute(`t`,`inlineStr`),e.openNode(`is`),t.value.richText.forEach(t=>{this.richTextXform.render(e,t)}),e.closeNode(`is`)):(e.addAttribute(`t`,`str`),e.leafNode(`v`,null,t.value)):(e.addAttribute(`t`,`s`),e.leafNode(`v`,null,t.ssId));break;case 4:e.leafNode(`v`,null,zc(t.value,t.date1904));break;case 5:t.formula||t.sharedFormula?this.renderFormula(e,t):t.ssId===void 0?Array.isArray(t.richText)&&t.richText.length>0?(e.addAttribute(`t`,`inlineStr`),e.openNode(`is`),t.richText.forEach(t=>{this.richTextXform.render(e,t)}),e.closeNode(`is`)):(e.addAttribute(`t`,`str`),e.leafNode(`v`,null,t.text)):(e.addAttribute(`t`,`s`),e.leafNode(`v`,null,t.ssId));break;case 6:this.renderFormula(e,t);break;case 1:break;default:break}e.closeNode()}}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`c`:return this.model={address:e.attributes.r},this.t=e.attributes.t,e.attributes.s&&(this.model.styleId=parseInt(e.attributes.s,10)),e.attributes.cm&&(this.model.cm=parseInt(e.attributes.cm,10)),!0;case`f`:return this.currentNode=`f`,this.model.si=e.attributes.si,this.model.shareType=e.attributes.t,this.model.ref=e.attributes.ref,!0;case`v`:return this.currentNode=`v`,!0;case`t`:return this.currentNode=`t`,!0;case`r`:return this.parser=this.richTextXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){if(this.parser){this.parser.parseText(e);return}switch(this.currentNode){case`f`:this.model.formula=this.model.formula?this.model.formula+e:e;break;case`v`:case`t`:this.model.value&&this.model.value.richText?this.model.value.richText.text=this.model.value.richText.text?this.model.value.richText.text+e:e:this.model.value=this.model.value?this.model.value+e:e;break;default:break}}parseClose(e){switch(e){case`c`:{let{model:e}=this;if(e.formula||e.shareType)e.type=6,e.value&&=(this.t===`str`?e.result=e.value:this.t===`b`?e.result=parseInt(e.value,10)!==0:this.t===`e`?e.result={error:e.value}:e.result=parseFloat(e.value),void 0);else if(e.value!==void 0)switch(this.t){case`s`:e.type=3,e.value=parseInt(e.value,10);break;case`str`:e.type=3;break;case`inlineStr`:e.type=3,typeof e.value==`string`&&e.value.includes(`_x`)&&(e.value=Uc(e.value));break;case`b`:e.type=9,e.value=parseInt(e.value,10)!==0;break;case`e`:e.type=10,e.value={error:e.value};break;case`d`:e.type=4,e.value=new Date(e.value);break;default:e.type=2,e.value=parseFloat(e.value);break}else e.styleId?e.type=0:e.type=1;return!1}case`f`:case`v`:case`is`:return this.currentNode=void 0,!0;case`t`:return this.parser?(this.parser.parseClose(e),!0):(this.currentNode=void 0,!0);case`r`:return this.model.value=this.model.value||{},this.model.value.richText=this.model.value.richText??[],this.model.value.richText.push(this.parser.model),this.parser=void 0,this.currentNode=void 0,!0;default:return this.parser?(this.parser.parseClose(e),!0):!1}}reconcile(e,t){let n=e.styleId!==void 0&&t.styles&&t.styles.getStyleModel(e.styleId);switch(n&&(e.style=n),e.styleId!==void 0&&(e.styleId=void 0),e.type){case 3:if(typeof e.value==`number`&&t.sharedStrings){let n=e.value;if(e.value=t.sharedStrings.getString(n),e.value===void 0)throw new Dr(`Invalid shared string index ${n} in cell ${e.address}: the xlsx file appears to be corrupted`)}e.value&&e.value.richText&&(e.type=8);break;case 2:n&&$c(n.numFmt)&&(e.type=4,e.value=Bc(e.value,t.date1904));break;case 6:e.result!==void 0&&typeof e.result==`number`&&n&&$c(n.numFmt)&&(e.result=Bc(e.result,t.date1904)),e.shareType===`shared`&&(e.ref?t.formulae[e.si]=e.address:(e.sharedFormula=t.formulae[e.si],delete e.shareType),delete e.si),e.cm&&(t.dynamicArrayCmIndices?t.dynamicArrayCmIndices.has(e.cm)&&(e.isDynamicArray=!0):t.hasDynamicArrayMetadata&&(e.isDynamicArray=!0)),delete e.cm;break;default:break}let r=t.hyperlinkMap[e.address];if(r){let t;e.type===6?t=e.result:(t=e.value,e.value=void 0);let n=Eh(t);e.text=n.text,n.richText?e.richText=n.richText:delete e.richText,e.type=5,e.hyperlink=r}let i=t.commentsMap&&t.commentsMap[e.address];i&&(e.comment=i)}},Oh=class extends N{constructor(e){super(),this.maxItems=e&&e.maxItems,this.map={c:new Dh}}get tag(){return`row`}reset(){super.reset(),this.numRowsSeen=0,this.lastCellCol=0}prepare(e,t){let n=t.styles.addStyleModel(e.style);n&&(e.styleId=n);let r=this.map.c;e.cells.forEach(e=>{r.prepare(e,t)})}render(e,t,n){if(!t)return;e.openNode(`row`),e.addAttribute(`r`,t.number),t.height!=null&&t.height>0?(e.addAttribute(`ht`,t.height),t.customHeight!==!1&&e.addAttribute(`customHeight`,`1`)):t.height===0&&e.addAttribute(`ht`,1),t.hidden&&e.addAttribute(`hidden`,`1`),t.min>0&&t.max>0&&t.min<=t.max&&e.addAttribute(`spans`,`${t.min}:${t.max}`),t.styleId&&(e.addAttribute(`s`,t.styleId),e.addAttribute(`customFormat`,`1`)),t.dyDescent!==void 0&&e.addAttribute(`x14ac:dyDescent`,t.dyDescent),t.outlineLevel&&e.addAttribute(`outlineLevel`,t.outlineLevel),t.collapsed&&e.addAttribute(`collapsed`,`1`);let r=this.map.c;t.cells.forEach(t=>{r.render(e,t,n)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(e.name===`row`){this.numRowsSeen+=1,this.lastCellCol=0;let t=e.attributes.spans,n,r;if(t){let e=t.indexOf(`:`);n=parseInt(t,10),r=e>-1?parseInt(t.substring(e+1),10):void 0}let i=e.attributes.r?parseInt(e.attributes.r,10):this.numRowsSeen,a=this.model={number:i,min:n,max:r,cells:[]};return e.attributes.s&&(a.styleId=parseInt(e.attributes.s,10)),el(e.attributes.hidden)&&(a.hidden=!0),el(e.attributes.bestFit)&&(a.bestFit=!0),e.attributes.ht&&(a.height=parseFloat(e.attributes.ht)),el(e.attributes.customHeight)&&(a.customHeight=!0),e.attributes.outlineLevel&&(a.outlineLevel=parseInt(e.attributes.outlineLevel,10)),el(e.attributes.collapsed)&&(a.collapsed=!0),e.attributes[`x14ac:dyDescent`]!==void 0&&(a.dyDescent=parseFloat(e.attributes[`x14ac:dyDescent`])),!0}return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){let e=this.parser.model;if(e.address?this.lastCellCol=O.decodeCol(e.address):(this.lastCellCol+=1,e.address=O.encodeAddress(this.model.number,this.lastCellCol)),this.model.cells.push(e),this.maxItems&&this.model.cells.length>this.maxItems)throw new Ur(`column`,this.maxItems);this.parser=void 0}return!0}return!1}reconcile(e,t){e.style=e.styleId===void 0?{}:t.styles.getStyleModel(e.styleId),e.styleId!==void 0&&(e.styleId=void 0);let n=this.map.c;e.cells.forEach(e=>{n.reconcile(e,t)})}},kh=class extends N{get tag(){return`sheetFormatPr`}render(e,t){if(t){let n={defaultRowHeight:t.defaultRowHeight,outlineLevelRow:t.outlineLevelRow||void 0,outlineLevelCol:t.outlineLevelCol||void 0,"x14ac:dyDescent":t.dyDescent!==void 0&&t.dyDescent!==0?t.dyDescent:void 0};t.defaultColWidth&&(n.defaultColWidth=t.defaultColWidth),t.customHeight&&(n.customHeight=`1`),Object.values(n).some(e=>e!==void 0)&&e.leafNode(`sheetFormatPr`,n)}}parseOpen(e){return e.name===`sheetFormatPr`?(this.model={defaultRowHeight:parseFloat(e.attributes.defaultRowHeight??`0`),dyDescent:e.attributes[`x14ac:dyDescent`]===void 0?void 0:parseFloat(e.attributes[`x14ac:dyDescent`]),outlineLevelRow:parseInt(e.attributes.outlineLevelRow??`0`,10),outlineLevelCol:parseInt(e.attributes.outlineLevelCol??`0`,10)},e.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(e.attributes.defaultColWidth)),e.attributes.customHeight===`1`&&(this.model.customHeight=!0),!0):!1}parseText(){}parseClose(){return!1}};let Ah=e=>e!==void 0;var jh=class extends N{get tag(){return`outlinePr`}render(e,t){return t&&(Ah(t.summaryBelow)||Ah(t.summaryRight))?(e.leafNode(this.tag,{summaryBelow:Ah(t.summaryBelow)?Number(t.summaryBelow):void 0,summaryRight:Ah(t.summaryRight)?Number(t.summaryRight):void 0}),!0):!1}parseOpen(e){return e.name===this.tag?(this.model={summaryBelow:Ah(e.attributes.summaryBelow)?!!Number(e.attributes.summaryBelow):void 0,summaryRight:Ah(e.attributes.summaryRight)?!!Number(e.attributes.summaryRight):void 0},!0):!1}parseText(){}parseClose(){return!1}},Mh=class extends N{get tag(){return`pageSetUpPr`}render(e,t){return t&&t.fitToPage?(e.leafNode(this.tag,{fitToPage:t.fitToPage?`1`:void 0}),!0):!1}parseOpen(e){return e.name===this.tag?(this.model={fitToPage:e.attributes.fitToPage===`1`},!0):!1}parseText(){}parseClose(){return!1}},Nh=class extends N{constructor(){super(),this.map={tabColor:new nf(`tabColor`),pageSetUpPr:new Mh,outlinePr:new jh}}get tag(){return`sheetPr`}render(e,t){if(!t)return;let n=!!t.tabColor,r=!!(t.pageSetup&&t.pageSetup.fitToPage),i=t.outlineProperties!==void 0&&t.outlineProperties!==null&&(t.outlineProperties.summaryBelow!==void 0||t.outlineProperties.summaryRight!==void 0);(n||r||i)&&(e.openNode(`sheetPr`),this.map.tabColor.render(e,t.tabColor),this.map.pageSetUpPr.render(e,t.pageSetup),this.map.outlinePr.render(e,t.outlineProperties),e.closeNode())}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.reset(),!0):this.map[e.name]?(this.parser=this.map[e.name],this.parser.parseOpen(e),!0):!1}parseText(e){return this.parser?(this.parser.parseText(e),!0):!1}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(this.map.tabColor.model||this.map.pageSetUpPr.model||this.map.outlinePr.model?(this.model={},this.map.tabColor.model&&(this.model.tabColor=this.map.tabColor.model),this.map.pageSetUpPr.model&&(this.model.pageSetup=this.map.pageSetUpPr.model),this.map.outlinePr.model&&(this.model.outlineProperties=this.map.outlinePr.model)):this.model=null,!1)}};function Ph(e,t){return e?t:void 0}function Fh(e,t){return e===t?!0:void 0}var Ih=class extends N{get tag(){return`sheetProtection`}render(e,t){if(t){let n={sheet:Ph(t.sheet,`1`),selectLockedCells:t.selectLockedCells===!1?`1`:void 0,selectUnlockedCells:t.selectUnlockedCells===!1?`1`:void 0,formatCells:Ph(t.formatCells,`0`),formatColumns:Ph(t.formatColumns,`0`),formatRows:Ph(t.formatRows,`0`),insertColumns:Ph(t.insertColumns,`0`),insertRows:Ph(t.insertRows,`0`),insertHyperlinks:Ph(t.insertHyperlinks,`0`),deleteColumns:Ph(t.deleteColumns,`0`),deleteRows:Ph(t.deleteRows,`0`),sort:Ph(t.sort,`0`),autoFilter:Ph(t.autoFilter,`0`),pivotTables:Ph(t.pivotTables,`0`)};t.sheet&&(n.algorithmName=t.algorithmName,n.hashValue=t.hashValue,n.saltValue=t.saltValue,n.spinCount=t.spinCount,n.objects=Ph(t.objects===!1,`1`),n.scenarios=Ph(t.scenarios===!1,`1`)),Object.values(n).some(e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={sheet:Fh(e.attributes.sheet,`1`),objects:e.attributes.objects===`1`?!1:void 0,scenarios:e.attributes.scenarios===`1`?!1:void 0,selectLockedCells:e.attributes.selectLockedCells===`1`?!1:void 0,selectUnlockedCells:e.attributes.selectUnlockedCells===`1`?!1:void 0,formatCells:Fh(e.attributes.formatCells,`0`),formatColumns:Fh(e.attributes.formatColumns,`0`),formatRows:Fh(e.attributes.formatRows,`0`),insertColumns:Fh(e.attributes.insertColumns,`0`),insertRows:Fh(e.attributes.insertRows,`0`),insertHyperlinks:Fh(e.attributes.insertHyperlinks,`0`),deleteColumns:Fh(e.attributes.deleteColumns,`0`),deleteRows:Fh(e.attributes.deleteRows,`0`),sort:Fh(e.attributes.sort,`0`),autoFilter:Fh(e.attributes.autoFilter,`0`),pivotTables:Fh(e.attributes.pivotTables,`0`)},e.attributes.algorithmName&&(this.model.algorithmName=e.attributes.algorithmName,this.model.hashValue=e.attributes.hashValue,this.model.saltValue=e.attributes.saltValue,this.model.spinCount=parseInt(e.attributes.spinCount,10)),!0;default:return!1}}parseText(){}parseClose(){return!1}};let Lh={frozen:`frozen`,frozenSplit:`frozen`,split:`split`};var Rh=class extends N{get tag(){return`sheetView`}prepare(e){switch(e.state){case`frozen`:case`split`:break;default:e.state=`normal`;break}}render(e,t){let n={};t.tabSelected&&(n.tabSelected=`1`),n.workbookViewId=t.workbookViewId??0,e.openNode(`sheetView`,n);let r=function(t,n,r){r&&e.addAttribute(t,n)};r(`rightToLeft`,`1`,t.rightToLeft===!0),r(`showRuler`,`0`,t.showRuler===!1),r(`showRowColHeaders`,`0`,t.showRowColHeaders===!1),r(`showGridLines`,`0`,t.showGridLines===!1),r(`zoomScale`,t.zoomScale,t.zoomScale!==void 0&&t.zoomScale!==100),r(`zoomScaleNormal`,t.zoomScaleNormal,t.zoomScaleNormal!==void 0&&t.zoomScaleNormal!==100),r(`view`,t.style,t.style);let i,a,o,s;switch(t.state){case`frozen`:a=t.xSplit??0,o=t.ySplit??0,i=t.topLeftCell||O.getAddress(o+1,a+1).address,s=t.xSplit&&t.ySplit&&`bottomRight`||t.xSplit&&`topRight`||`bottomLeft`,e.leafNode(`pane`,{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:i,activePane:s,state:`frozen`}),e.leafNode(`selection`,{pane:s,activeCell:t.activeCell,sqref:t.activeCell});break;case`split`:t.activePane===`topLeft`&&(t.activePane=void 0),e.leafNode(`pane`,{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:t.topLeftCell,activePane:t.activePane}),e.leafNode(`selection`,{pane:t.activePane,activeCell:t.activeCell,sqref:t.activeCell});break;case`normal`:t.activeCell&&e.leafNode(`selection`,{activeCell:t.activeCell,sqref:t.activeCell});break;default:break}e.closeNode()}parseOpen(e){switch(e.name){case`sheetView`:return this.sheetView={workbookViewId:parseInt(e.attributes.workbookViewId,10),rightToLeft:e.attributes.rightToLeft===`1`,tabSelected:e.attributes.tabSelected===`1`,showRuler:e.attributes.showRuler!==`0`,showRowColHeaders:e.attributes.showRowColHeaders!==`0`,showGridLines:e.attributes.showGridLines!==`0`,zoomScale:parseInt(e.attributes.zoomScale??`100`,10),zoomScaleNormal:parseInt(e.attributes.zoomScaleNormal??`100`,10),style:e.attributes.view},this.pane=void 0,this.selections={},!0;case`pane`:return this.pane={xSplit:parseInt(e.attributes.xSplit??`0`,10),ySplit:parseInt(e.attributes.ySplit??`0`,10),topLeftCell:e.attributes.topLeftCell,activePane:e.attributes.activePane??`topLeft`,state:e.attributes.state},!0;case`selection`:{let t=e.attributes.pane??`topLeft`;return this.selections[t]={pane:t,activeCell:e.attributes.activeCell},!0}default:return!1}}parseText(){}parseClose(e){let t,n;switch(e){case`sheetView`:return this.sheetView&&this.pane?(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,tabSelected:this.sheetView.tabSelected,state:Lh[this.pane.state]??`split`,xSplit:this.pane.xSplit,ySplit:this.pane.ySplit,topLeftCell:this.pane.topLeftCell,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},this.model.state===`split`&&(t.activePane=this.pane.activePane),n=this.selections[this.pane.activePane],n&&n.activeCell&&(t.activeCell=n.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)):(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,tabSelected:this.sheetView.tabSelected,state:`normal`,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},n=this.selections.topLeft,n&&n.activeCell&&(t.activeCell=n.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)),!1;default:return!0}}reconcile(){}};let zh=new Tm,F={dataValidations:new Ym,sheetProperties:new Nh,sheetFormatProperties:new kh,columns:new P({tag:`cols`,count:!1,childXform:new Gm}),row:new Oh,hyperlinks:new P({tag:`hyperlinks`,count:!1,childXform:new fm}),sheetViews:new P({tag:`sheetViews`,count:!1,childXform:new Rh}),sheetProtection:new Ih,pageMargins:new hh,pageSeteup:new xh,autoFilter:new Em,picture:new Sh,drawing:new Xm,conditionalFormattings:new Hm,extLst:new dh,ignoredErrors:new mh,headerFooter:new fh,rowBreaks:new Ch,colBreaks:new Wm};var Bh=class{constructor(e){this.id=e.id,this.name=e.name||`Sheet${this.id}`,this.state=e.state??`visible`,this._rows=[],this._columns=[],this._keys={},this._merges=[],this._merges.add=function(){},this._sheetRelsWriter=new hm(e),this._sheetCommentsWriter=new dm(this,this._sheetRelsWriter,e),this._dimensions=new Gr,this._rowZero=1,this._rowOffset=0,this.committed=!1,this.dataValidations=new em,this._formulae={},this._siFormulae=0,this.conditionalFormatting=[],this.ignoredErrors=[],this.rowBreaks=[],this.colBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,outlineLevelCol:0,outlineLevelRow:0},e.properties),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},e.headerFooter),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,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},e.pageSetup),this.useSharedStrings=e.useSharedStrings??!1,this._workbook=e.workbook,this.hasComments=!1,this._views=e.views??[],this.autoFilter=e.autoFilter??null,this._media=[],this._watermark=null,this.sheetProtection=null,this._writeOpenWorksheet(),this.startedData=!1}get workbook(){return this._workbook}get stream(){return this._stream||=this._workbook._openStream(td(this.id)),this._stream}destroy(){throw new Rr(`destroy`,`Invalid operation for a streaming writer`)}commit(){if(!this.committed){for(let e=this._rowOffset;e<this._rows.length;e++){let t=this._rows[e];t&&this._writeRow(t)}this._rows=null,this.startedData||this._writeOpenSheetData(),this._writeCloseSheetData(),this._writeSheetProtection(),this._writeAutoFilter(),this._writeMergeCells(),this._writeHyperlinks(),this._writeConditionalFormatting(),this._writeDataValidations(),this._writePageMargins(),this._writePageSetup(),this._writeHeaderFooter(),this._writeRowBreaks(),this._writeColBreaks(),this._writeDrawing(),this._writeBackground(),this._writeLegacyData(),this._writeIgnoredErrors(),this._writeExtLst(),this._writeCloseWorksheet(),this.stream.end(),this._sheetCommentsWriter.commit(),this._sheetRelsWriter.commit(),this.committed=!0}}get dimensions(){return this._dimensions}get views(){return this._views}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 wc(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){if(typeof e==`string`){let t=this._keys[e];if(t)return t;e=O.l2n(e)}if(e>this._columns.length){let t=this._columns.length+1;for(;t<=e;)this._columns.push(new wc(this,t++))}return this._columns[e-1]}get _nextRow(){return this._rowZero+(this._rows.length-this._rowOffset)}eachRow(e,t){let n,r;if(typeof e==`function`?(n=e,r=void 0):(n=t,r=e),r&&r.includeEmpty){let e=this._nextRow;for(let t=this._rowZero;t<e;t++)n(this.getRow(t),t)}else this._rows.forEach(e=>{e&&e.hasValues&&n(e,e.number)})}_commitRow(e){let t=!1,n=this._rows;for(;this._rowOffset<n.length&&!t;){let r=n[this._rowOffset];n[this._rowOffset]=void 0,this._rowOffset++,this._rowZero++,r&&(this._writeRow(r),t=r.number===e.number,this._rowZero=r.number+1),this._rowOffset>1024&&this._rowOffset>n.length>>1&&(n.splice(0,this._rowOffset),this._rowOffset=0)}}get lastRow(){let e=this._rows;for(let t=e.length-1;t>=this._rowOffset;t--){let n=e[t];if(n)return n}}findRow(e){let t=e-this._rowZero+this._rowOffset;return this._rows[t]}getRow(e){let t=e-this._rowZero+this._rowOffset;if(t<this._rowOffset)throw new Mr(e,`this row has been committed`);let n=this._rows[t];return n||(this._rows[t]=n=new du(this,e)),n}addRow(e){let t=new du(this,this._nextRow);return this._rows[t.number-this._rowZero+this._rowOffset]=t,t.values=e,t}addRows(e){return e.map(e=>this.addRow(e))}findCell(e,t){let n=O.getAddress(e,t),r=this.findRow(n.row);return r?r.findCell(n.col):void 0}getCell(e,t){let n=O.getAddress(e,t);return this.getRow(n.row).getCellEx(n)}mergeCells(...e){let t=new Gr(e);this._merges.forEach(e=>{if(e.intersects(t))throw new Nr});let{top:n,left:r,bottom:i,right:a}=t,o=ym(n,r,i,a,(e,t)=>this.findCell(e,t)),s=this.getCell(n,r);for(let e=n;e<=i;e++)for(let t=r;t<=a;t++)(e>n||t>r)&&this.getCell(e,t).merge(s);o&&bm(n,r,i,a,o,(e,t)=>this.getCell(e,t)),this._merges.push(t)}addConditionalFormatting(e){this.conditionalFormatting.push(e)}removeConditionalFormatting(e){typeof e==`number`?this.conditionalFormatting.splice(e,1):e instanceof Function?this.conditionalFormatting=this.conditionalFormatting.filter(e):this.conditionalFormatting=[]}addBackgroundImage(e){this._background={imageId:Number(e)}}getBackgroundImageId(){return this._background&&this._background.imageId}addImage(e,t){let n=this._parseImageRange(String(e),t);this._media.push(n)}getImages(){return this._media}addWatermark(e){this._media=this._media.filter(e=>e._watermarkTag!==!0);let t=e.opacity===void 0?.15:Math.max(0,Math.min(1,e.opacity));if(this._watermark={imageId:String(e.imageId),mode:e.mode??`overlay`,opacity:t,headerWidth:e.headerWidth,headerHeight:e.headerHeight,applyTo:e.applyTo},this._watermark.mode===`overlay`){let n={type:`image`,imageId:String(e.imageId),range:{tl:{nativeCol:0,nativeColOff:0,nativeRow:0,nativeRowOff:0},br:{nativeCol:100,nativeColOff:0,nativeRow:200,nativeRowOff:0},editAs:`absolute`},_watermarkTag:!0,opacity:t};this._media.push(n)}}getWatermark(){return this._watermark}removeWatermark(){this._watermark=null,this._media=this._media.filter(e=>e._watermarkTag!==!0)}_parseImageRange(e,t){if(typeof t==`string`){let n=O.decode(t);if(`top`in n)return{type:`image`,imageId:e,range:{tl:new $p(this,{col:n.left,row:n.top},-1).model,br:new $p(this,{col:n.right,row:n.bottom},0).model,editAs:`oneCell`}};throw Error(`Invalid image range: "${t}". Expected a range like "A1:C3".`)}if(`pos`in t&&t.pos)return{type:`image`,imageId:e,range:{tl:{nativeCol:0,nativeColOff:0,nativeRow:0,nativeRowOff:0},ext:t.ext,pos:t.pos},hyperlinks:t.hyperlinks};let n=t;return{type:`image`,imageId:e,range:{tl:new $p(this,n.tl,0).model,br:n.br?new $p(this,n.br,0).model:void 0,ext:n.ext,editAs:n.editAs},hyperlinks:n.hyperlinks}}async protect(e,t){this.sheetProtection={sheet:!0},this.sheetProtection=await Cm(e,t)}unprotect(){this.sheetProtection=null}_write(e){zh.reset(),zh.addText(e),this.stream.write(zh)}_writeSheetProperties(e,t,n){let r={outlineProperties:t&&t.outlineProperties,tabColor:t&&t.tabColor,pageSetup:n&&n.fitToPage?{fitToPage:n.fitToPage}:void 0};e.addText(F.sheetProperties.toXml(r))}_writeSheetFormatProperties(e,t){let n=t?{defaultRowHeight:t.defaultRowHeight,dyDescent:t.dyDescent,outlineLevelCol:t.outlineLevelCol,outlineLevelRow:t.outlineLevelRow}:void 0;t&&t.defaultColWidth&&(n.defaultColWidth=t.defaultColWidth),e.addText(F.sheetFormatProperties.toXml(n))}_writeOpenWorksheet(){zh.reset(),zh.addText(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>`),zh.addText(`<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">`),this._writeSheetProperties(zh,this.properties,this.pageSetup),zh.addText(F.sheetViews.toXml(this.views)),this._writeSheetFormatProperties(zh,this.properties),this.stream.write(zh)}_writeColumns(){let e=wc.toModel(this.columns);e&&(F.columns.prepare(e,{styles:this._workbook.styles}),this.stream.write(F.columns.toXml(e)))}_writeOpenSheetData(){this._write(`<sheetData>`)}_writeRow(e){if(this.startedData||=(this._writeColumns(),this._writeOpenSheetData(),!0),e.hasValues||e.height!=null){let{model:t}=e;if(!t)return;let n={styles:this._workbook.styles,sharedStrings:this.useSharedStrings?this._workbook.sharedStrings:void 0,hyperlinks:this._sheetRelsWriter.hyperlinksProxy,merges:this._merges,formulae:this._formulae,siFormulae:this._siFormulae,comments:[]};if(F.row.prepare(t,n),this.stream.write(F.row.toXml(t)),t.cells)for(let e of t.cells)e&&e.isDynamicArray&&this._workbook.dynamicArrayCount++;n.comments.length&&(this.hasComments=!0,this._sheetCommentsWriter.addComments(n.comments))}}_writeCloseSheetData(){this._write(`</sheetData>`)}_writeMergeCells(){this._merges.length&&(zh.reset(),zh.addText(`<mergeCells count="${this._merges.length}">`),this._merges.forEach(e=>{zh.addText(`<mergeCell ref="${e}"/>`)}),zh.addText(`</mergeCells>`),this.stream.write(zh))}_writeHyperlinks(){this.stream.write(F.hyperlinks.toXml(this._sheetRelsWriter._hyperlinks))}_writeConditionalFormatting(){let e={styles:this._workbook.styles};F.conditionalFormattings.prepare(this.conditionalFormatting,e);let t={conditionalFormattings:this.conditionalFormatting};F.extLst.prepare(t),this.stream.write(F.conditionalFormattings.toXml(this.conditionalFormatting))}_writeExtLst(){let e={conditionalFormattings:this.conditionalFormatting};this.stream.write(F.extLst.toXml(e))}_writeIgnoredErrors(){this.ignoredErrors.length>0&&this.stream.write(F.ignoredErrors.toXml(this.ignoredErrors))}_writeRowBreaks(){this.stream.write(F.rowBreaks.toXml(this.rowBreaks))}_writeColBreaks(){this.stream.write(F.colBreaks.toXml(this.colBreaks))}_writeDataValidations(){this.stream.write(F.dataValidations.toXml(this.dataValidations.model))}_writeSheetProtection(){this.stream.write(F.sheetProtection.toXml(this.sheetProtection))}_writePageMargins(){this.stream.write(F.pageMargins.toXml(this.pageSetup.margins))}_writePageSetup(){this.stream.write(F.pageSeteup.toXml(this.pageSetup))}_writeHeaderFooter(){this.stream.write(F.headerFooter.toXml(this.headerFooter))}_writeAutoFilter(){this.stream.write(F.autoFilter.toXml(this.autoFilter))}_writeDrawing(){if(this._media.length===0)return;for(let e of this._media)if(e._watermarkTag){let t=this._dimensions.model,n=t?Math.max(t.right??100,100):100,r=t?Math.max(t.bottom??200,200):200;e.range.br={nativeCol:n,nativeColOff:0,nativeRow:r,nativeRowOff:0}}let e=`drawing${this.id}`,t=this._sheetRelsWriter.addRelationship({Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing`,Target:Od(e)}),{anchors:n,rels:r}=_m(this._media,[],{getBookImage:e=>this._workbook.getImage(Number(e)),nextRId:e=>`rId${e.length+1}`});this._drawing={rId:t,name:e,anchors:n,rels:r},this.stream.write(F.drawing.toXml({rId:t}))}get drawing(){return this._drawing}_writeBackground(){if(this._background){if(this._background.imageId!==void 0){let e=this._workbook.getImage(this._background.imageId);if(!e)return;let t=this._sheetRelsWriter.addMedia({Target:jd(e.name),Type:k.Image});this._background={...this._background,rId:t}}this.stream.write(F.picture.toXml({rId:this._background.rId}))}}_writeLegacyData(){this.hasComments&&(zh.reset(),zh.addText(`<legacyDrawing r:id="${this._sheetCommentsWriter.vmlRelId}"/>`),this.stream.write(zh))}_writeDimensions(){}_writeCloseWorksheet(){this._write(`</worksheet>`)}};function Vh(e){if(typeof e!=`object`||!e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(Vh).join(`,`)}]`;let t=Object.keys(e).sort(),n=e;return`{${t.map(e=>`${JSON.stringify(e)}:${Vh(n[e])}`).join(`,`)}}`}var Hh=class{constructor(){this._values=[],this._totalRefs=0,this._hash=Object.create(null)}get count(){return this._values.length}get values(){return this._values}get totalRefs(){return this._totalRefs}getString(e){return this._values[e]}add(e){let t=typeof e==`string`?`s:${e}`:`r:${Vh(e.richText)}`,n=this._hash[t];return n===void 0&&(n=this._hash[t]=this._values.length,this._values.push(e)),this._totalRefs++,n}};let Uh=new TextEncoder;var Wh=class{constructor(e){this._data=e}get length(){return this.toBuffer().length}copy(e,t,n,r){let i=this.toBuffer(),a=Math.min(r,i.length-n);return e.set(i.subarray(n,n+a),t),a}toBuffer(){return this._buffer||=Uh.encode(this._data),this._buffer}},Gh=class{constructor(e){this._data=e}get length(){return this._data.length}copy(e,t,n,r){let i=this.toBuffer(),a=Math.min(r,i.length-n);return e.set(i.subarray(n,n+a),t),a}toBuffer(){return this._data.toBuffer()}},Kh=class{constructor(e){this._data=e}get length(){return this._data.length}copy(e,t,n,r){let i=Math.min(r,this._data.length-n);return e.set(this._data.subarray(n,n+i),t),i}toBuffer(){return this._data}},qh=class{constructor(e){this.size=e,this.buffer=new Uint8Array(e),this.iRead=0,this.iWrite=0}toBuffer(){return this.iRead===0&&this.iWrite===this.size?this.buffer:this.buffer.subarray(this.iRead,this.iWrite)}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(e){if(e===0)return null;if(e===void 0||e>=this.length){let e=this.toBuffer();return this.iRead=this.iWrite,e}let t=this.buffer.subarray(this.iRead,this.iRead+e);return 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,r),this.iWrite+=r,r}};let Jh=()=>{};var Yh=class extends Pn{constructor(e){super(),this._writableStreamWriter=null,this._asyncWriteQueue=Promise.resolve(),this.bufSize=e?.bufSize||1024*1024,this.buffers=[],this.batch=e?.batch??!1,this.corked=!1,this.paused=!1,this.encoding=null,this.pipes=[],this._ended=!1}get writable(){return!this._ended}toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:{let e=this.buffers.reduce((e,t)=>e+t.length,0),t=new Uint8Array(e),n=0;for(let e of this.buffers){let r=e.toBuffer();t.set(r,n),n+=r.length}return t}}}_getWritableBuffer(){if(this.buffers.length){let e=this.buffers[this.buffers.length-1];if(!e.full)return e}let e=new qh(this.bufSize);return this.buffers.push(e),e}async _pipeChunk(e){let t=this.pipes.map(t=>new Promise(n=>{t.write(e.toBuffer(),()=>n())}));await Promise.all(t)}_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){typeof t==`function`&&(n=t),n||=Jh;let r;if(e instanceof Tm||e&&e.constructor?.name===`StringBuf`)r=new Gh(e);else if(e instanceof Uint8Array)r=new Kh(e);else if(ArrayBuffer.isView(e))r=new Kh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));else if(e instanceof ArrayBuffer)r=new Kh(new Uint8Array(e));else if(typeof e==`string`)r=new Wh(e);else throw new Pr(typeof e,`Chunk must be one of type String, Uint8Array, ArrayBuffer or StringBuf.`);if(this.pipes.length)if(this.batch)for(this._writeToBuffers(r);!this.corked&&this.buffers.length>1;){let e=this.buffers.shift();await this._pipeChunk(new Kh(e.toBuffer()))}else this.corked?(this._writeToBuffers(r),queueMicrotask(()=>n())):(await this._pipeChunk(r),n());else{let e=r.toBuffer(),t=!1;!this.paused&&this.listenerCount(`data`)>0&&(this.emit(`data`,e),t=!0),this._writableStreamWriter&&(this._asyncWriteQueue=this._asyncWriteQueue.then(()=>this._writableStreamWriter.write(e)),t=!0),t||(this._writeToBuffers(r),this.emit(`readable`)),n()}return!0}cork(){this.corked=!0}_flush(){this.pipes.length&&(async()=>{for(;this.buffers.length;){let e=this.buffers.shift();await this._pipeChunk(new Kh(e.toBuffer()))}})().catch(e=>this.emit(`error`,e))}uncork(){this.corked=!1,this._flush()}end(e,t,n){let r=e=>{if(e){n?.(e);return}this._ended=!0,this._flush(),this.pipes.forEach(e=>{typeof e.end==`function`&&e.end()}),this._writableStreamWriter?this._asyncWriteQueue.then(()=>this._writableStreamWriter.close()).then(()=>{this.emit(`finish`),this.emit(`close`)}).catch(e=>{this.emit(`error`,e)}):(this.emit(`finish`),this.emit(`close`))};e?this.write(e,t,r):r()}read(e){if(e){let t=[],n=e;for(;n&&this.buffers.length&&!this.buffers[0].eod;){let e=this.buffers[0],r=e.read(n);r&&(n-=r.length,t.push(r)),e.eod&&e.full&&this.buffers.shift()}return Dn(Xh(t))}let t=this.buffers.map(e=>e.toBuffer()).filter(Boolean);return this.buffers=[],Dn(Xh(t))}readString(e){let t=e??this.encoding??`utf-8`,n=this.read();return dn(t).decode(n)}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}pipeTo(e){this._writableStreamWriter=e.getWriter()}unpipe(e){this.pipes=this.pipes.filter(t=>t!==e)}unshift(){throw new Ir(`unshift`,`Not implemented`)}wrap(){throw new Ir(`wrap`,`Not implemented`)}push(e){return e!==null&&this.write(e),!0}};function Xh(e){if(e.length===0)return new Uint8Array;if(e.length===1)return e[0];let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}async function Zh(e,t){let n={lockStructure:t?.lockStructure??!0,lockWindows:t?.lockWindows,lockRevision:t?.lockRevision};return e&&(n.algorithmName=`SHA-512`,n.saltValue=ll(Sm.randomBytes(16)),n.spinCount=t?.spinCount!=null&&Number.isFinite(t.spinCount)?Math.round(Math.max(0,t.spinCount)):1e5,n.hashValue=await Sm.convertPasswordToHash(e,`SHA-512`,n.saltValue,n.spinCount)),n}var Qh=class extends N{render(e,t){e.openNode(`HeadingPairs`),e.openNode(`vt:vector`,{size:2,baseType:`variant`}),e.openNode(`vt:variant`),e.leafNode(`vt:lpstr`,void 0,`Worksheets`),e.closeNode(),e.openNode(`vt:variant`),e.leafNode(`vt:i4`,void 0,t.length),e.closeNode(),e.closeNode(),e.closeNode()}parseOpen(e){return e.name===`HeadingPairs`}parseText(){}parseClose(e){return e!==`HeadingPairs`}},$h=class extends N{render(e,t){e.openNode(`TitlesOfParts`),e.openNode(`vt:vector`,{size:t.length,baseType:`lpstr`}),t.forEach(t=>{e.leafNode(`vt:lpstr`,void 0,t.name)}),e.closeNode(),e.closeNode()}parseOpen(e){return e.name===`TitlesOfParts`}parseText(){}parseClose(e){return e!==`TitlesOfParts`}},eg=class e extends N{constructor(){super(),this.map={Company:new gf({tag:`Company`}),Manager:new gf({tag:`Manager`}),HeadingPairs:new Qh,TitlesOfParts:new $h}}render(t,n){t.openXml(A),t.openNode(`Properties`,e.PROPERTY_ATTRIBUTES),t.leafNode(`Application`,void 0,`Microsoft Excel`),t.leafNode(`DocSecurity`,void 0,`0`),t.leafNode(`ScaleCrop`,void 0,`false`),this.map.HeadingPairs.render(t,n.worksheets),this.map.TitlesOfParts.render(t,n.worksheets),this.map.Company.render(t,n.company??``),this.map.Manager.render(t,n.manager),t.leafNode(`LinksUpToDate`,void 0,`false`),t.leafNode(`SharedDoc`,void 0,`false`),t.leafNode(`HyperlinksChanged`,void 0,`false`),t.leafNode(`AppVersion`,void 0,`16.0300`),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`Properties`:return!0;default:return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`Properties`:return this.model={worksheets:this.map.TitlesOfParts.model,company:this.map.Company.model,manager:this.map.Manager.model},!1;default:return!0}}static{this.DateFormat=function(e){return e.toISOString().replace(/[.]\d{3,6}/,``)}}static{this.DateAttrs={"xsi:type":`dcterms:W3CDTF`}}static{this.PROPERTY_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/officeDocument/2006/extended-properties`,"xmlns:vt":`http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes`}}},tg=class e extends N{render(t,n){t.openXml(A),t.openNode(`Types`,e.PROPERTY_ATTRIBUTES);let r={};if((n.media??[]).forEach(e=>{if(e.type===`image`){let n=e.extension;r[n]||(r[n]=!0,t.leafNode(`Default`,{Extension:n,ContentType:`image/${n}`}))}}),t.leafNode(`Default`,{Extension:`rels`,ContentType:`application/vnd.openxmlformats-package.relationships+xml`}),t.leafNode(`Default`,{Extension:`xml`,ContentType:`application/xml`}),t.leafNode(`Override`,{PartName:Qu(M.xlWorkbook),ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml`}),n.worksheets.forEach(e=>{t.leafNode(`Override`,{PartName:Qu(td(e.fileIndex)),ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml`})}),(n.pivotTables??[]).length){let e=new Set;(n.pivotTables??[]).forEach(n=>{let r=n.tableNumber,i=n.cacheId;e.has(i)||(e.add(i),t.leafNode(`Override`,{PartName:Qu(fd(r)),ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml`}),(!n.isLoaded||n.cacheRecords)&&t.leafNode(`Override`,{PartName:Qu(md(r)),ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml`})),t.leafNode(`Override`,{PartName:Qu(gd(r)),ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml`})})}if(t.leafNode(`Override`,{PartName:Qu(M.xlTheme1),ContentType:`application/vnd.openxmlformats-officedocument.theme+xml`}),t.leafNode(`Override`,{PartName:Qu(M.xlStyles),ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml`}),n.externalLinks&&n.externalLinks.length>0)for(let e of n.externalLinks)t.leafNode(`Override`,{PartName:Qu(yd(e.index)),ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml`});n.hasCheckboxes&&t.leafNode(`Override`,{PartName:Qu(M.xlFeaturePropertyBag),ContentType:`application/vnd.ms-excel.featurepropertybag+xml`}),n.hasDynamicArrayFormulas&&t.leafNode(`Override`,{PartName:Qu(M.xlMetadata),ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml`}),n.sharedStrings&&n.sharedStrings.count&&t.leafNode(`Override`,{PartName:Qu(M.xlSharedStrings),ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml`}),n.tables&&n.tables.forEach(e=>{t.leafNode(`Override`,{PartName:Qu(ld(e.target)),ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml`})}),n.drawings&&n.drawings.forEach(e=>{t.leafNode(`Override`,{PartName:Qu(ud(e.name)),ContentType:`application/vnd.openxmlformats-officedocument.drawing+xml`})});let i=n.commentRefs&&n.commentRefs.length>0,a=n.formControlRefs&&n.formControlRefs.length>0,o=n.hasHeaderWatermark===!0;if((i||a||o)&&t.leafNode(`Default`,{Extension:`vml`,ContentType:`application/vnd.openxmlformats-officedocument.vmlDrawing`}),i&&n.commentRefs.forEach(({commentName:e})=>{t.leafNode(`Override`,{PartName:Qu(ad(e)),ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml`})}),a)for(let e of n.formControlRefs)t.leafNode(`Override`,{PartName:Qu(Md(e)),ContentType:`application/vnd.ms-excel.controlproperties+xml`});if(n.passthroughContentTypes)for(let{partName:e,contentType:r}of n.passthroughContentTypes)t.leafNode(`Override`,{PartName:Qu(e),ContentType:r});t.leafNode(`Override`,{PartName:Qu(M.docPropsCore),ContentType:`application/vnd.openxmlformats-package.core-properties+xml`}),t.leafNode(`Override`,{PartName:Qu(M.docPropsApp),ContentType:`application/vnd.openxmlformats-officedocument.extended-properties+xml`}),t.closeNode()}parseOpen(){return!1}parseText(){}parseClose(){return!1}static{this.PROPERTY_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/package/2006/content-types`}}},ng=class extends N{constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this.text=[],this._format=e.format||function(e){try{return Number.isNaN(e.getTime())?``:e.toISOString()}catch{return``}},this._parse=e.parse||function(e){return new Date(e)}}render(e,t){t&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,this._format(t)):e.writeText(this._format(t)),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.attr?this.model=this._parse(e.attributes[this.attr]):this.text=[])}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=this._parse(this.text.join(``))),!1}};let rg={creator:`dc:creator`,title:`dc:title`,subject:`dc:subject`,description:`dc:description`,identifier:`dc:identifier`,language:`dc:language`,keywords:`cp:keywords`,category:`cp:category`,lastModifiedBy:`cp:lastModifiedBy`,lastPrinted:`cp:lastPrinted`,revision:`cp:revision`,version:`cp:version`,contentStatus:`cp:contentStatus`,contentType:`cp:contentType`,created:`dcterms:created`,modified:`dcterms:modified`};var ig=class e extends N{constructor(){super(),this.map={creator:new gf({tag:rg.creator}),title:new gf({tag:rg.title}),subject:new gf({tag:rg.subject}),description:new gf({tag:rg.description}),identifier:new gf({tag:rg.identifier}),language:new gf({tag:rg.language}),keywords:new gf({tag:rg.keywords}),category:new gf({tag:rg.category}),lastModifiedBy:new gf({tag:rg.lastModifiedBy}),lastPrinted:new ng({tag:rg.lastPrinted,format:e.DateFormat}),revision:new hf({tag:rg.revision}),version:new gf({tag:rg.version}),contentStatus:new gf({tag:rg.contentStatus}),contentType:new gf({tag:rg.contentType}),created:new ng({tag:rg.created,attrs:e.DateAttrs,format:e.DateFormat}),modified:new ng({tag:rg.modified,attrs:e.DateAttrs,format:e.DateFormat})}}render(t,n){t.openXml(A),t.openNode(`cp:coreProperties`,e.CORE_PROPERTY_ATTRIBUTES);for(let e of Object.keys(rg))this.map[e].render(t,n[e]);t.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):(e.name!==`coreProperties`&&(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;if(e===`coreProperties`){this.model={};for(let e of Object.keys(rg)){let t=this.map[e].model;t!==void 0&&t!==``&&(this.model[e]=t)}return!1}return!0}static{this.DateFormat=function(e){return e.toISOString().replace(/[.]\d{3}/,``)}}static{this.DateAttrs={"xsi:type":`dcterms:W3CDTF`}}static{this.CORE_PROPERTY_ATTRIBUTES={"xmlns:cp":`http://schemas.openxmlformats.org/package/2006/metadata/core-properties`,"xmlns:dc":`http://purl.org/dc/elements/1.1/`,"xmlns:dcterms":`http://purl.org/dc/terms/`,"xmlns:dcmitype":`http://purl.org/dc/dcmitype/`,"xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`}}},ag=class extends N{render(e){e.openXml({version:`1.0`,encoding:`UTF-8`,standalone:`yes`}),e.openNode(`FeaturePropertyBags`,{xmlns:`http://schemas.microsoft.com/office/spreadsheetml/2022/featurepropertybag`}),e.leafNode(`bag`,{type:`Checkbox`}),e.openNode(`bag`,{type:`XFControls`}),e.leafNode(`bagId`,{k:`CellControl`},`0`),e.closeNode(),e.openNode(`bag`,{type:`XFComplement`}),e.leafNode(`bagId`,{k:`XFControls`},`1`),e.closeNode(),e.openNode(`bag`,{type:`XFComplements`,extRef:`XFComplementsMapperExtRef`}),e.openNode(`a`,{k:`MappedFeaturePropertyBags`}),e.leafNode(`bagId`,{},`2`),e.closeNode(),e.closeNode(),e.closeNode()}parseOpen(){return!1}parseText(){}parseClose(){return!1}},og=class extends N{parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={range:{editAs:e.attributes.editAs??`oneCell`}};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}reconcilePicture(e,t){if(e&&e.rId){let n=t.rels[e.rId];if(!n)return;let r=n.Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(r){let n=r[1],i=t.mediaIndex[n],a=t.media[i];return a&&e.alphaModFix!==void 0?{...a,alphaModFix:e.alphaModFix}:a}}}};let sg=9525;var cg=class extends N{constructor(e){super(),this.tag=e.tag,this.map={},this.model={width:0,height:0}}render(e,t){e.openNode(this.tag);let n=Math.floor(t.width*sg),r=Math.floor(t.height*sg);e.addAttribute(`cx`,n),e.addAttribute(`cy`,r),e.closeNode()}parseOpen(e){return e.name===this.tag?(this.model={width:parseInt(e.attributes.cx??`0`,10)/sg,height:parseInt(e.attributes.cy??`0`,10)/sg},!0):!1}parseText(e){}parseClose(e){return!1}},lg=class extends N{constructor(){super(),this.model={rId:``}}get tag(){return`a:blip`}render(e,t){t.alphaModFix!==void 0&&t.alphaModFix<1e5?(e.openNode(this.tag,{"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"r:embed":t.rId,cstate:`print`}),e.leafNode(`a:alphaModFix`,{amt:String(t.alphaModFix)}),e.closeNode()):e.leafNode(this.tag,{"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"r:embed":t.rId,cstate:`print`})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:embed`]},!0;case`a:alphaModFix`:return e.attributes.amt&&(this.model.alphaModFix=parseInt(e.attributes.amt,10)),!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}},ug=class extends N{constructor(){super(),this.map={"a:blip":new lg}}get tag(){return`xdr:blipFill`}render(e,t){e.openNode(this.tag),this.map[`a:blip`].render(e,t),e.openNode(`a:stretch`),e.leafNode(`a:fillRect`),e.closeNode(),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model=this.map[`a:blip`].model,!1;default:return!0}}},dg=class extends N{get tag(){return`xdr:cNvPicPr`}render(e){e.openNode(this.tag),e.leafNode(`a:picLocks`,{noChangeAspect:`1`}),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:return!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}},fg=class extends N{get tag(){return`a:extLst`}render(e){e.openNode(this.tag),e.openNode(`a:ext`,{uri:`{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}`}),e.leafNode(`a16:creationId`,{"xmlns:a16":`http://schemas.microsoft.com/office/drawing/2014/main`,id:`{00000000-0008-0000-0000-000002000000}`}),e.closeNode(),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:return!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}},pg=class extends N{constructor(){super(),this.model={}}get tag(){return`a:hlinkClick`}render(e,t){t.hyperlinks&&t.hyperlinks.rId&&e.leafNode(this.tag,{"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"r:id":t.hyperlinks.rId,tooltip:t.hyperlinks.tooltip})}parseOpen(e){switch(e.name){case this.tag:return this.model={hyperlinks:{rId:e.attributes[`r:id`],tooltip:e.attributes.tooltip}},!0;default:return!0}}parseText(){}parseClose(){return!1}},mg=class extends N{constructor(){super(),this.map={"a:hlinkClick":new pg,"a:extLst":new fg}}get tag(){return`xdr:cNvPr`}render(e,t){e.openNode(this.tag,{id:t.index,name:`Picture ${t.index}`}),this.map[`a:hlinkClick`].render(e,t),this.map[`a:extLst`].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model=this.map[`a:hlinkClick`].model,!1;default:return!0}}},hg=class extends N{constructor(){super(),this.map={"xdr:cNvPr":new mg,"xdr:cNvPicPr":new dg}}get tag(){return`xdr:nvPicPr`}render(e,t){e.openNode(this.tag),this.map[`xdr:cNvPr`].render(e,t),this.map[`xdr:cNvPicPr`].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model=this.map[`xdr:cNvPr`].model,!1;default:return!0}}};let gg={tag:`xdr:spPr`,c:[{tag:`a:xfrm`,c:[{tag:`a:off`,$:{x:`0`,y:`0`}},{tag:`a:ext`,$:{cx:`0`,cy:`0`}}]},{tag:`a:prstGeom`,$:{prst:`rect`},c:[{tag:`a:avLst`}]}]};var _g=class extends N{constructor(){super(),this.map={"xdr:nvPicPr":new hg,"xdr:blipFill":new ug,"xdr:spPr":new Zd(gg)}}get tag(){return`xdr:pic`}prepare(e,t){e.index=t.index+1}render(e,t){e.openNode(this.tag),this.map[`xdr:nvPicPr`].render(e,t),this.map[`xdr:blipFill`].render(e,{rId:t.rId,alphaModFix:t.alphaModFix}),this.map[`xdr:spPr`].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.mergeModel(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}};let vg=9525;var yg=class extends N{constructor(){super(),this.map={},this.model={x:0,y:0}}get tag(){return`xdr:pos`}render(e,t){e.leafNode(this.tag,{x:Math.floor(t.x*vg),y:Math.floor(t.y*vg)})}parseOpen(e){return e.name===this.tag?(this.model={x:parseInt(e.attributes.x??`0`,10)/vg,y:parseInt(e.attributes.y??`0`,10)/vg},!0):!1}parseText(){}parseClose(){return!1}},bg=class extends og{constructor(){super(),this.map={"xdr:pos":new yg,"xdr:ext":new cg({tag:`xdr:ext`}),"xdr:pic":new _g,"xdr:clientData":new Zd({tag:`xdr:clientData`})}}get tag(){return`xdr:absoluteAnchor`}prepare(e,t){e.picture&&this.map[`xdr:pic`].prepare(e.picture,t)}render(e,t){e.openNode(this.tag),this.map[`xdr:pos`].render(e,t.range.pos??{x:0,y:0}),this.map[`xdr:ext`].render(e,t.range.ext),t.picture&&this.map[`xdr:pic`].render(e,t.picture),this.map[`xdr:clientData`].render(e,{}),e.closeNode()}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.range.pos=this.map[`xdr:pos`].model,this.model.range.ext=this.map[`xdr:ext`].model,this.model.picture=this.map[`xdr:pic`].model,!1;default:return!0}}reconcile(e,t){e.medium=this.reconcilePicture(e.picture,t)}},xg=class extends N{constructor(e){super(),this.tag=e.tag,this.map={"xdr:col":new hf({tag:`xdr:col`,zero:!0}),"xdr:colOff":new hf({tag:`xdr:colOff`,zero:!0}),"xdr:row":new hf({tag:`xdr:row`,zero:!0}),"xdr:rowOff":new hf({tag:`xdr:rowOff`,zero:!0})},this.model={nativeCol:0,nativeColOff:0,nativeRow:0,nativeRowOff:0}}render(e,t){e.openNode(this.tag),this.map[`xdr:col`].render(e,t.nativeCol),this.map[`xdr:colOff`].render(e,t.nativeColOff),this.map[`xdr:row`].render(e,t.nativeRow),this.map[`xdr:rowOff`].render(e,t.nativeRowOff),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model={nativeCol:this.map[`xdr:col`].model,nativeColOff:this.map[`xdr:colOff`].model,nativeRow:this.map[`xdr:row`].model,nativeRowOff:this.map[`xdr:rowOff`].model},!1;default:return!0}}},Sg=class extends og{constructor(){super(),this.map={"xdr:from":new xg({tag:`xdr:from`}),"xdr:ext":new cg({tag:`xdr:ext`}),"xdr:pic":new _g,"xdr:clientData":new Zd({tag:`xdr:clientData`})}}get tag(){return`xdr:oneCellAnchor`}prepare(e,t){this.map[`xdr:pic`].prepare(e.picture,t)}render(e,t){e.openNode(this.tag,{editAs:t.range.editAs??`oneCell`}),this.map[`xdr:from`].render(e,t.range.tl),this.map[`xdr:ext`].render(e,t.range.ext),this.map[`xdr:pic`].render(e,t.picture),this.map[`xdr:clientData`].render(e,{}),e.closeNode()}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.range.tl=this.map[`xdr:from`].model,this.model.range.ext=this.map[`xdr:ext`].model,this.model.picture=this.map[`xdr:pic`].model,!1;default:return!0}}reconcile(e,t){e.medium=this.reconcilePicture(e.picture,t)}},Cg=class extends N{get tag(){return`xdr:sp`}render(e,t){t&&(e.openNode(this.tag,{macro:``,textlink:``}),e.openNode(`xdr:nvSpPr`),e.openNode(`xdr:cNvPr`,{id:t.cNvPrId,name:t.name,hidden:t.hidden?`1`:void 0}),e.openNode(`a:extLst`),e.openNode(`a:ext`,{uri:`{63B3BB69-23CF-44E3-9099-C40C66FF867C}`}),e.leafNode(`a14:compatExt`,{spid:t.spid,"xmlns:a14":`http://schemas.microsoft.com/office/drawing/2010/main`},void 0),e.closeNode(),e.closeNode(),e.closeNode(),e.leafNode(`xdr:cNvSpPr`),e.closeNode(),e.openNode(`xdr:spPr`,{bwMode:`auto`}),e.openNode(`a:xfrm`),e.leafNode(`a:off`,{x:0,y:0}),e.leafNode(`a:ext`,{cx:0,cy:0}),e.closeNode(),e.openNode(`a:prstGeom`,{prst:`rect`}),e.leafNode(`a:avLst`),e.closeNode(),e.leafNode(`a:noFill`),e.openNode(`a:ln`),e.leafNode(`a:noFill`),e.closeNode(),e.openNode(`a:extLst`),e.openNode(`a:ext`,{uri:`{909E8E84-426E-40DD-AFC4-6F175D3DCCD1}`}),e.openNode(`a14:hiddenFill`,{"xmlns:a14":`http://schemas.microsoft.com/office/drawing/2010/main`}),e.openNode(`a:solidFill`),e.leafNode(`a:srgbClr`,{val:`F0F0F0`}),e.closeNode(),e.closeNode(),e.closeNode(),e.openNode(`a:ext`,{uri:`{91240B29-F687-4F45-9708-019B960494DF}`}),e.openNode(`a14:hiddenLine`,{w:9525,"xmlns:a14":`http://schemas.microsoft.com/office/drawing/2010/main`}),e.openNode(`a:solidFill`),e.leafNode(`a:srgbClr`,{val:`000000`}),e.closeNode(),e.leafNode(`a:miter`,{lim:8e5}),e.leafNode(`a:headEnd`),e.leafNode(`a:tailEnd`),e.closeNode(),e.closeNode(),e.closeNode(),e.closeNode(),e.openNode(`xdr:txBody`),e.leafNode(`a:bodyPr`,{vertOverflow:`clip`,wrap:`square`,lIns:18288,tIns:18288,rIns:0,bIns:18288,anchor:`ctr`,upright:1}),e.leafNode(`a:lstStyle`),e.openNode(`a:p`),e.openNode(`a:pPr`,{algn:`l`,rtl:0}),e.leafNode(`a:defRPr`,{sz:1e3}),e.closeNode(),e.openNode(`a:r`),e.openNode(`a:rPr`,{lang:`en-US`,sz:800,b:0,i:0,u:`none`,strike:`noStrike`,baseline:0}),e.openNode(`a:solidFill`),e.leafNode(`a:srgbClr`,{val:`000000`}),e.closeNode(),e.leafNode(`a:latin`,{typeface:`Tahoma`,pitchFamily:2,charset:0}),e.leafNode(`a:ea`,{typeface:`Tahoma`,pitchFamily:2,charset:0}),e.leafNode(`a:cs`,{typeface:`Tahoma`,pitchFamily:2,charset:0}),e.closeNode(),e.openNode(`a:t`),e.writeText(t.text??``),e.closeNode(),e.closeNode(),e.closeNode(),e.closeNode(),e.closeNode())}},wg=class extends og{constructor(){super(),this.map={"xdr:from":new xg({tag:`xdr:from`}),"xdr:to":new xg({tag:`xdr:to`}),"xdr:pic":new _g,"xdr:sp":new Cg,"xdr:clientData":new Zd({tag:`xdr:clientData`})}}get tag(){return`xdr:twoCellAnchor`}prepare(e,t){e.picture&&this.map[`xdr:pic`].prepare(e.picture,t)}render(e,t){let n=!!t.alternateContent;n&&(e.openNode(`mc:AlternateContent`,{"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`}),e.openNode(`mc:Choice`,{Requires:t.alternateContent?.requires,...t.alternateContent?.requires===`a14`?{"xmlns:a14":`http://schemas.microsoft.com/office/drawing/2010/main`}:{}})),e.openNode(this.tag,{editAs:t.range.editAs??`oneCell`}),this.map[`xdr:from`].render(e,t.range.tl),this.map[`xdr:to`].render(e,t.range.br),t.picture?this.map[`xdr:pic`].render(e,t.picture):t.shape&&this.map[`xdr:sp`].render(e,t.shape),this.map[`xdr:clientData`].render(e,{}),e.closeNode(),n&&(e.closeNode(),e.leafNode(`mc:Fallback`),e.closeNode())}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.range.tl=this.map[`xdr:from`].model,this.model.range.br=this.map[`xdr:to`].model,this.model.picture=this.map[`xdr:pic`].model,!1;default:return!0}}reconcile(e,t){e.medium=this.reconcilePicture(e.picture,t)}};function Tg(e){let t=typeof e.range==`string`?O.decode(e.range):e.range;return t.pos===void 0?t.br?`xdr:twoCellAnchor`:`xdr:oneCellAnchor`:`xdr:absoluteAnchor`}var Eg=class e extends N{constructor(){super(),this.map={"xdr:twoCellAnchor":new wg,"xdr:oneCellAnchor":new Sg,"xdr:absoluteAnchor":new bg},this.model={anchors:[]}}prepare(e){e.anchors.forEach((e,t)=>{e.anchorType=Tg(e),this.map[e.anchorType].prepare(e,{index:t})})}get tag(){return`xdr:wsDr`}render(t,n){let r=n||this.model;t.openXml(A),t.openNode(this.tag,e.DRAWING_ATTRIBUTES),r.anchors.forEach(e=>{this.map[e.anchorType].render(t,e)}),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={anchors:[]};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.anchors.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}reconcile(e,t){e.anchors.forEach(e=>{e.range?.pos===void 0?e.br?this.map[`xdr:twoCellAnchor`].reconcile(e,t):this.map[`xdr:oneCellAnchor`].reconcile(e,t):this.map[`xdr:absoluteAnchor`].reconcile(e,t)})}static{this.DRAWING_ATTRIBUTES={"xmlns:xdr":`http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing`,"xmlns:a":`http://schemas.openxmlformats.org/drawingml/2006/main`}}},Dg=class extends N{constructor(){super(),this.map={r:new nm,t:new tm}}get tag(){return`rPh`}render(e,t){if(e.openNode(this.tag,{sb:t.sb??0,eb:t.eb??0}),t&&Object.prototype.hasOwnProperty.call(t,`richText`)&&t.richText){let{r:n}=this.map;t.richText.forEach(t=>{n.render(e,t)})}else t&&this.map.t.render(e,t.text);e.closeNode()}parseOpen(e){let{name:t}=e;return this.parser?(this.parser.parseOpen(e),!0):t===this.tag?(this.model={sb:parseInt(e.attributes.sb,10),eb:parseInt(e.attributes.eb,10)},!0):(this.parser=this.map[t],this.parser?(this.parser.parseOpen(e),!0):!1)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){switch(e){case`r`:{let e=this.model.richText;e||=this.model.richText=[],e.push(this.parser.model);break}case`t`:this.model.text=this.parser.model;break;default:break}this.parser=void 0}return!0}switch(e){case this.tag:return!1;default:return!0}}},Og=class extends N{constructor(e){super(),this.model=e,this.map={r:new nm,t:new tm,rPh:new Dg}}get tag(){return`si`}render(e,t){e.openNode(this.tag),t&&typeof t==`object`&&Object.prototype.hasOwnProperty.call(t,`richText`)&&t.richText?t.richText.length?t.richText.forEach(t=>{this.map.r.render(e,t)}):this.map.t.render(e,``):t!=null&&this.map.t.render(e,t),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.model={},!0):(this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){switch(e){case`r`:{let e=this.model.richText;e||=this.model.richText=[],e.push(this.parser.model);break}case`t`:this.model=this.parser.model;break;default:break}this.parser=void 0}return!0}switch(e){case this.tag:return!1;default:return!0}}},kg=class extends N{constructor(e){super(),this.model=e||{values:[],count:0},this.hash=Object.create(null),this.rich=Object.create(null)}get sharedStringXform(){return this._sharedStringXform||=new Og}get values(){return this.model.values}get uniqueCount(){return this.model.values.length}get count(){return this.model.count}getString(e){return this.model.values[e]}add(e){return e.richText?this.addRichText(e):this.addText(e)}addText(e){let t=this.hash[e];return t===void 0&&(t=this.hash[e]=this.model.values.length,this.model.values.push(e)),this.model.count++,t}addRichText(e){let t=this.sharedStringXform.toXml(e),n=this.rich[t];return n===void 0&&(n=this.rich[t]=this.model.values.length,this.model.values.push(e)),this.model.count++,n}render(e,t){let n=t||this._values;e.openXml(A),e.openNode(`sst`,{xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,count:n.count,uniqueCount:n.values.length});let r=this.sharedStringXform;n.values.forEach(t=>{r.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`sst`:return!0;case`si`:return this.parser=this.sharedStringXform,this.parser.parseOpen(e),!0;default:throw new Fr(`sharedStrings`,`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.values.push(this.parser.model),this.model.count++,this.parser=void 0),!0;switch(e){case`sst`:return!1;default:throw new Fr(`sharedStrings`,`Unexpected xml node in parseClose: ${e}`)}}};let Ag=new Uint8Array,jg=new TextDecoder;var Mg=class{constructor(e,t){this.WorksheetWriterClass=t,this.created=e.created||new Date,this.modified=e.modified||this.created,this.creator=e.creator??`ExcelTS`,this.lastModifiedBy=e.lastModifiedBy??`ExcelTS`,this.lastPrinted=e.lastPrinted,this.useSharedStrings=e.useSharedStrings??!1,this.sharedStrings=new Hh,this.styles=e.useStyles?new Of(!0):new Of.Mock(!0),this._definedNames=new ii,this._worksheets=[],this.views=[],this.zipOptions=e.zip;let n=e.zip?.zlib?.level??e.zip?.compressionOptions?.level??6;this.compressionLevel=Math.max(0,Math.min(9,n)),this.media=[],this.commentRefs=[],this.dynamicArrayCount=0,this._trueStreaming=e.trueStreaming??!1,this.zip=new Xp((e,t,n)=>{e?this.stream.emit(`error`,e):(this.stream.write(t),n&&this.stream.end())}),this.stream=this._createOutputStream(e),this.promise=Promise.resolve()}_createOutputStream(e){return e.stream?ir(e.stream):new Yh}get definedNames(){return this._definedNames}get defaultFont(){return this.styles.defaultFont}set defaultFont(e){this.styles.setDefaultFont&&this.styles.setDefaultFont(e)}_openStream(e){let t=new Yh({bufSize:this._trueStreaming?4096:65536,batch:!this._trueStreaming}),n=new Yp(e,{level:this.compressionLevel});this.zip.add(n);let r=e=>n.push(e);return t.on(`data`,r),t.once(`finish`,()=>{t.removeListener(`data`,r),n.push(Ag,!0),t.emit(`zipped`)}),t}_addFile(e,t,n){let r=new Yp(t,{level:this.compressionLevel});this.zip.add(r);let i;i=n?Rc(typeof e==`string`?e:jg.decode(e)):typeof e==`string`?wn(e):e,r.push(i,!0)}_commitWorksheets(){let e=this._worksheets.map(e=>e.committed?Promise.resolve():new Promise(t=>{e.stream.once(`zipped`,()=>t()),e.commit()}));return e.length?Promise.all(e).then(()=>{}):Promise.resolve()}async commit(){await this.promise,await this._commitWorksheets(),await this.addMedia(),this.addDrawings(),await Promise.all([this.addThemes(),this.addOfficeRels(),this.addContentTypes(),this.addApp(),this.addCore(),this.addSharedStrings(),this.addStyles(),this.addFeaturePropertyBag(),this.addMetadata(),this.addWorkbookRels()]),await this.addWorkbook(),await this._finalize()}get nextId(){for(let e=1;e<this._worksheets.length;e++)if(!this._worksheets[e])return e;return this._worksheets.length||1}addImage(e){let t=this.media.length,n={...e,type:`image`,name:`image${t}.${e.extension}`};return this.media.push(n),t}getImage(e){return this.media[e]}async protect(e,t){this.protection=await Zh(e,t)}unprotect(){this.protection=void 0}addWorksheet(e,t){let n=t||{},r=n.useSharedStrings===void 0?this.useSharedStrings:n.useSharedStrings;n.tabColor&&(console.trace(`tabColor option has moved to { properties: tabColor: {...} }`),n.properties={tabColor:n.tabColor,...n.properties});let i=this.nextId;e??=`sheet${i}`;let a=new this.WorksheetWriterClass({id:i,name:e,workbook:this,useSharedStrings:r,properties:n.properties,state:n.state,pageSetup:n.pageSetup,views:n.views,autoFilter:n.autoFilter,headerFooter:n.headerFooter});return this._worksheets[i]=a,a}getWorksheet(e){if(e===void 0)return this._worksheets.find(()=>!0);if(typeof e==`number`)return this._worksheets[e];if(typeof e==`string`){let t=e.toLowerCase();return this._worksheets.find(e=>e?.name?.toLowerCase()===t)}}addStyles(){return new Promise(e=>{this._addFile(this.styles.xml,M.xlStyles),e()})}addThemes(){return new Promise(e=>{this._addFile(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
405
|
+
<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> </a:lnStyleLst> <a:effectStyleLst> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="38000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> <a:scene3d> <a:camera prst="orthographicFront"> <a:rot lat="0" lon="0" rev="0"/> </a:camera> <a:lightRig rig="threePt" dir="t"> <a:rot lat="0" lon="0" rev="1200000"/> </a:lightRig> </a:scene3d> <a:sp3d> <a:bevelT w="63500" h="25400"/> </a:sp3d> </a:effectStyle> </a:effectStyleLst> <a:bgFillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="40000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="40000"> <a:schemeClr val="phClr"> <a:tint val="45000"/> <a:shade val="99000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="20000"/> <a:satMod val="255000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="-80000" r="50000" b="180000"/> </a:path> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="80000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="30000"/> <a:satMod val="200000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="50000" r="50000" b="50000"/> </a:path> </a:gradFill> </a:bgFillStyleLst> </a:fmtScheme> </a:themeElements> <a:objectDefaults> <a:spDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="1"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="3"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="2"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="lt1"/> </a:fontRef> </a:style> </a:spDef> <a:lnDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="2"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="0"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="1"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="tx1"/> </a:fontRef> </a:style> </a:lnDef> </a:objectDefaults> <a:extraClrSchemeLst/> </a:theme>`,M.xlTheme1),e()})}addOfficeRels(){return new Promise(e=>{let t=new tf().toXml([{Id:`rId1`,Type:k.OfficeDocument,Target:M.xlWorkbook},{Id:`rId2`,Type:k.CoreProperties,Target:M.docPropsCore},{Id:`rId3`,Type:k.ExtenderProperties,Target:M.docPropsApp}]);this._addFile(t,M.rootRels),e()})}addContentTypes(){return new Promise(e=>{let t=this._worksheets.filter(Boolean);t.forEach(e=>{e.fileIndex=e.id});let n=t.filter(e=>e.drawing).map(e=>e.drawing),r={worksheets:t,sharedStrings:this.sharedStrings,commentRefs:this.commentRefs,media:this.media,drawings:n,hasCheckboxes:this.styles.hasCheckboxes,hasDynamicArrayFormulas:this.dynamicArrayCount>0},i=new tg;this._addFile(i.toXml(r),M.contentTypes),e()})}addMedia(){return Promise.all(this.media.map(async e=>{if(e.type===`image`){let t=ed(e.name);if(e.buffer){this._addFile(e.buffer,t);return}if(e.base64){let n=e.base64.substring(e.base64.indexOf(`,`)+1);this._addFile(n,t,!0);return}if(e.filename)throw new Ir(`Loading images from filename`,`not supported in browser. Use buffer or base64.`)}throw new Hr(`Unsupported media`)}))}addDrawings(){let e=new Eg,t=new tf;for(let n of this._worksheets){if(!n?.drawing)continue;let{drawing:r}=n,i=vm(r.anchors),a={...r,anchors:i};e.prepare(a);let o=e.toXml(a);this._addFile(o,ud(r.name));let s=t.toXml(r.rels);this._addFile(s,dd(r.name))}}addApp(){return new Promise(e=>{let t=new eg;this._addFile(t.toXml({worksheets:this._worksheets.filter(Boolean)}),M.docPropsApp),e()})}addCore(){return new Promise(e=>{let t=new ig;this._addFile(t.toXml(this),M.docPropsCore),e()})}addSharedStrings(){return this.sharedStrings.count?new Promise(e=>{let t=new kg;this._addFile(t.toXml(this.sharedStrings),M.xlSharedStrings),e()}):Promise.resolve()}addFeaturePropertyBag(){if(this.styles.hasCheckboxes){let e=new ag;this._addFile(e.toXml({}),M.xlFeaturePropertyBag)}return Promise.resolve()}addMetadata(){if(this.dynamicArrayCount<=0)return Promise.resolve();let e=new $d;return this._addFile(e.toXml({dynamicArrayCount:this.dynamicArrayCount}),M.xlMetadata),Promise.resolve()}addWorkbookRels(){let e=1,t=[{Id:`rId${e++}`,Type:k.Styles,Target:Cd.workbookStyles},{Id:`rId${e++}`,Type:k.Theme,Target:Cd.workbookTheme1}];return this.sharedStrings.count&&t.push({Id:`rId${e++}`,Type:k.SharedStrings,Target:Cd.workbookSharedStrings}),this.styles.hasCheckboxes&&t.push({Id:`rId${e++}`,Type:k.FeaturePropertyBag,Target:Cd.workbookFeaturePropertyBag}),this.dynamicArrayCount>0&&t.push({Id:`rId${e++}`,Type:k.SheetMetadata,Target:Cd.workbookMetadata}),this._worksheets.forEach(n=>{n&&(n.rId=`rId${e++}`,t.push({Id:n.rId,Type:k.Worksheet,Target:rd(n.id)}))}),new Promise(e=>{let n=new tf;this._addFile(n.toXml(t),M.xlWorkbookRels),e()})}addWorkbook(){let e={worksheets:this._worksheets.filter(Boolean),definedNames:this._definedNames.model,views:this.views,properties:{},protection:this.protection,calcProperties:{}};return new Promise(t=>{let n=new Qd;n.prepare(e),this._addFile(n.toXml(e),M.xlWorkbook),t()})}_finalize(){return new Promise((e,t)=>{let n=()=>{this.stream.removeListener(`close`,i),this.stream.removeListener(`error`,r)},r=e=>{n(),t(e)},i=()=>{n(),e(this)};this.stream.once(`error`,r),this.stream.once(`close`,i),this.zip.end()})}},Ng=class extends Mg{constructor(e={}){super(e,Bh)}};let Pg=9525,Fg=12700,Ig=142875,Lg=28575,Rg=276225,zg=190500;var Bg=class e{constructor(e,t,n){this.worksheet=e;let{tl:r,br:i}=this._parseRange(t),a=1025+(e.formControls?.length??0),o;n?.link&&(o=this._toAbsoluteRef(n.link)),this.model={shapeId:a,ctrlPropId:0,tl:r,br:i,link:o,checked:n?.checked?`Checked`:`Unchecked`,text:n?.text??``,noThreeD:n?.noThreeD??!0,print:n?.print??!1}}get checked(){return this.model.checked===`Checked`}set checked(e){this.model.checked=e?`Checked`:`Unchecked`}get link(){return this.model.link}set link(e){this.model.link=e?this._toAbsoluteRef(e):void 0}get text(){return this.model.text}set text(e){this.model.text=e}_toAbsoluteRef(e){if(e.includes(`$`))return e;let t=O.decodeAddress(e);return`$${O.n2l(t.col)}$${t.row}`}_parseRange(e){let t,n;if(typeof e==`string`)if(e.includes(`:`)){let r=O.decode(e);if(`top`in r)if(r.left===r.right&&r.top===r.bottom){let e=r.left-1,i=r.top-1;t={col:e,colOff:Ig,row:i,rowOff:Lg},n={col:e+2,colOff:Rg,row:i+1,rowOff:zg}}else t={col:r.left-1,colOff:Ig,row:r.top-1,rowOff:Lg},n={col:r.right-1,colOff:Rg,row:r.bottom-1,rowOff:zg};else t={col:r.col-1,colOff:Ig,row:r.row-1,rowOff:Lg},n={col:r.col+1,colOff:Rg,row:r.row,rowOff:zg}}else{let r=O.decodeAddress(e);t={col:r.col-1,colOff:Ig,row:r.row-1,rowOff:Lg},n={col:r.col+1,colOff:Rg,row:r.row,rowOff:zg}}else if(`startCol`in e)t={col:e.startCol,colOff:e.startColOff??Ig,row:e.startRow,rowOff:e.startRowOff??Lg},n={col:e.endCol,colOff:e.endColOff??Rg,row:e.endRow,rowOff:e.endRowOff??zg};else{if(typeof e.tl==`string`){let n=O.decodeAddress(e.tl);t={col:n.col-1,colOff:Ig,row:n.row-1,rowOff:Lg}}else t={col:e.tl.col,colOff:e.tl.colOff??Ig,row:e.tl.row,rowOff:e.tl.rowOff??Lg};if(e.br)if(typeof e.br==`string`){let t=O.decodeAddress(e.br);n={col:t.col-1,colOff:Rg,row:t.row-1,rowOff:zg}}else n={col:e.br.col,colOff:e.br.colOff??Rg,row:e.br.row,rowOff:e.br.rowOff??zg};else n={col:t.col+2,colOff:Rg,row:t.row+1,rowOff:zg}}return{tl:t,br:n}}getVmlAnchor(){return e.getVmlAnchor(this.model)}getVmlStyle(){return e.getVmlStyle(this.model)}getVmlCheckedValue(){return e.getVmlCheckedValue(this.model)}static getVmlAnchor(e){let{tl:t,br:n}=e,r=Math.round(t.colOff/Pg),i=Math.round(t.rowOff/Pg),a=Math.round(n.colOff/Pg),o=Math.round(n.rowOff/Pg);return`${t.col}, ${r}, ${t.row}, ${i}, ${n.col}, ${a}, ${n.row}, ${o}`}static getVmlStyle(e){return`position:absolute;margin-left:${Math.round(e.tl.colOff/Fg)}pt;margin-top:${Math.round(e.tl.rowOff/Fg)}pt;width:96pt;height:18pt;z-index:1;visibility:visible`}static getVmlCheckedValue(e){switch(e.checked){case`Checked`:return 1;case`Mixed`:return 2;default:return 0}}},Vg=class e{constructor(e,t){this.worksheet=e,t&&(this.model=t)}get model(){switch(this.type){case`background`:return{type:this.type,imageId:this.imageId??``};case`watermark`:return{type:this.type,imageId:this.imageId??``,opacity:this.opacity};case`headerImage`:return{type:this.type,imageId:this.imageId??``,headerWidth:this.headerWidth,headerHeight:this.headerHeight,applyTo:this.applyTo};case`image`:{let e=this.range;if(!e)throw new Hr(`Image has no range`);return e.pos?{type:this.type,imageId:this.imageId??``,hyperlinks:e.hyperlinks,range:{tl:{nativeCol:0,nativeColOff:0,nativeRow:0,nativeRowOff:0},ext:e.ext,pos:e.pos}}:{type:this.type,imageId:this.imageId??``,hyperlinks:e.hyperlinks,range:{tl:e.tl.model,br:e.br?.model,ext:e.ext,editAs:e.editAs}}}default:throw new Hr(`Invalid Image Type`)}}set model({type:e,imageId:t,range:n,hyperlinks:r,opacity:i,headerWidth:a,headerHeight:o,applyTo:s}){if(this.type=e,this.imageId=t,this.opacity=i,this.headerWidth=a,this.headerHeight=o,this.applyTo=s,e===`image`)if(typeof n==`string`){let e=O.decode(n);`top`in e&&(this.range={tl:new $p(this.worksheet,{col:e.left,row:e.top},-1),br:new $p(this.worksheet,{col:e.right,row:e.bottom},0),editAs:`oneCell`})}else n&&`pos`in n&&n.pos?this.range={tl:new $p(this.worksheet,null,0),ext:n.ext,hyperlinks:r||(`hyperlinks`in n?n.hyperlinks:void 0),pos:n.pos}:n&&(this.range={tl:new $p(this.worksheet,n.tl,0),br:n.br?new $p(this.worksheet,n.br,0):void 0,ext:n.ext,editAs:n.editAs,hyperlinks:r||(`hyperlinks`in n?n.hyperlinks:void 0)})}clone(t){let n=t??this.worksheet,r=new e(n);return r.type=this.type,r.imageId=this.imageId,r.opacity=this.opacity,r.headerWidth=this.headerWidth,r.headerHeight=this.headerHeight,r.applyTo=this.applyTo,this.range&&(r.range={tl:this.range.tl.clone(n),br:this.range.br?this.range.br.clone(n):void 0,ext:this.range.ext?{...this.range.ext}:void 0,editAs:this.range.editAs,hyperlinks:this.range.hyperlinks?{...this.range.hyperlinks}:void 0,pos:this.range.pos?{...this.range.pos}:void 0}),r}},Hg=class{constructor(e){this.code=e}toString(){return`#${this.code}`}};let Ug={sum:`Sum`,count:`Count`,average:`Average`,max:`Max`,min:`Min`,product:`Product`,countNums:`Count Numbers`,stdDev:`StdDev`,stdDevP:`StdDevP`,var:`Var`,varP:`VarP`},Wg=new Set(Object.keys(Ug));function Gg(e){let t=e.model;if(t.headerRow===!1)throw new Br(`Cannot create pivot table from a table without headers. Set headerRow: true on the table.`);if(!t.rows||t.rows.length===0)throw new Br(`Cannot create pivot table from an empty table. Add data rows to the table.`);let n=t.columns.map(e=>e.name),r=new Set;for(let e of n){if(r.has(e))throw new Br(`Duplicate column name "${e}" found in table. Pivot tables require unique column names.`);r.add(e)}let i=[void 0,...n],a=t.rows.map(e=>[void 0,...e]),o=t.tl;if(!o)throw Error(`Table "${t.name}" is missing top-left cell address (tl)`);let s=o.row,c=o.col,l=s+t.rows.length,u=c+n.length-1,d=O.encode(s,c,l,u);return{name:e.worksheet.name,tableName:t.name,getRow(e){if(e===1)return{values:i};let t=e-2;return t>=0&&t<a.length?{values:a[t]}:{values:[]}},getColumn(e){if(e<1||e>n.length)return{values:[]};let r=[];r[1]=n[e-1];for(let n=0;n<t.rows.length;n++)r[n+2]=t.rows[n][e-1];return{values:r}},getSheetValues(){let e=[];e[1]=i;for(let t=0;t<a.length;t++)e[t+2]=a[t];return e},dimensions:{shortRange:d}}}function Kg(e){if(e.sourceSheet&&e.sourceTable)throw new Br(`Cannot specify both sourceSheet and sourceTable. Choose one.`);if(e.sourceTable)return Gg(e.sourceTable);if(!e.sourceSheet)throw Error(`Either sourceSheet or sourceTable must be provided.`);return e.sourceSheet}function qg(e){return typeof e==`string`?e:e.name}function Jg(e){return typeof e==`string`?void 0:e.metric}function Yg(e,t){let n=Kg(t);Xg(t,n);let{rows:r}=t,i=t.columns??[],a=t.pages??[],o=t.values.map(qg),s=t.metric??`sum`,c=t.values.map(e=>Jg(e)??s),l=Qg(n,[...r,...i,...a],o),u={};for(let e=0;e<l.length;e++)u[l[e].name]=e;let d=(e,t)=>{let n=u[e];if(n===void 0)throw Error(`${t} field "${e}" not found in cache fields`);return n},f=r.map(e=>d(e,`Row`)),p=i.map(e=>d(e,`Column`)),m=o.map(e=>d(e,`Value`)),h=a.map(e=>d(e,`Page`)),g=e.workbook.pivotTables.map(e=>e.tableNumber).filter(e=>Number.isFinite(e)),_=g.length>0?g.reduce((e,t)=>e>t?e:t,-1/0)+1:1,v=e.workbook.pivotTables.map(e=>parseInt(e.cacheId,10)).filter(e=>Number.isFinite(e)),y=v.length>0?v.reduce((e,t)=>e>t?e:t,-1/0)+1:10+_-1;return{source:n,rows:f,columns:p,values:m,pages:h,metric:s,valueMetrics:c,cacheFields:l,cacheId:String(y),applyWidthHeightFormats:t.applyWidthHeightFormats??`1`,tableNumber:_}}function Xg(e,t){let n=e.columns??[],r=e.pages??[],i=e.values.map(qg),a=t.getRow(1).values.slice(1);for(let e=0;e<a.length;e++){let n=a[e];if(n==null||n===``||typeof n==`string`&&n.trim()===``)throw Error(`Empty or missing header name at column ${e+1} in ${t.name}. Pivot tables require all columns to have non-empty headers.`)}let o=new Set;for(let e of a){let n=String(e);if(o.has(n))throw Error(`Duplicate header name "${n}" found in ${t.name}. Pivot tables require unique column names.`);o.add(n)}let s=new Set(a.map(String)),c=e=>{if(!s.has(e))throw new Br(`The header name "${e}" was not found in ${t.name}.`)};for(let t of e.rows)c(t);for(let e of n)c(e);for(let e of i)c(e);for(let e of r)c(e);let l=new Map,u=[{name:`rows`,fields:e.rows},{name:`columns`,fields:n},{name:`pages`,fields:r}];for(let e of u)for(let t of e.fields){let n=l.get(t);if(n===e.name)throw Error(`Duplicate field "${t}" in ${e.name}. Each field can only appear once per axis area.`);if(n)throw Error(`Field "${t}" cannot appear in both ${n} and ${e.name}. Each field can only be assigned to one axis area.`);l.set(t,e.name)}if(!e.rows.length)throw new Br(`No pivot table rows specified.`);if(e.values.length<1)throw new Br(`Must have at least one value.`);if(e.metric!==void 0&&!Wg.has(e.metric))throw Error(`Invalid metric "${e.metric}". Must be one of: ${[...Wg].join(`, `)}.`);for(let t of e.values){let e=Jg(t);if(e!==void 0&&!Wg.has(e))throw Error(`Invalid metric "${e}" on value field "${qg(t)}". Must be one of: ${[...Wg].join(`, `)}.`)}let d=new Set;for(let e of i){if(d.has(e))throw Error(`Duplicate value field "${e}". Each value field name must be unique.`);d.add(e)}}function Zg(e){if(e==null)return null;if(typeof e!=`object`||e instanceof Date||e instanceof Hg)return e;let t=e;if(typeof t.error==`string`){let e=t.error;return new Hg(e.startsWith(`#`)?e.slice(1):e)}if(`formula`in t||`sharedFormula`in t){let e=t.result;return e==null?null:Zg(e)}return Array.isArray(t.richText)?t.richText.map(e=>e.text??``).join(``):typeof t.text==`string`&&typeof t.hyperlink==`string`?t.text:typeof t.checkbox==`boolean`?t.checkbox:String(e)}function Qg(e,t,n){let r=e.getRow(1).values,i=new Set(t),a=new Set(n),o=t=>{let n=e.getColumn(t).values,r=new Set,i=new Map,a=!1;for(let e=2;e<n.length;e++){let t=Zg(n[e]);t===null||typeof t==`number`&&isNaN(t)?a=!0:t instanceof Hg?i.has(t.code)||(i.set(t.code,t),r.add(t)):r.add(t)}let o=nl(r);return a&&o.push(null),o},s=t=>{let n=e.getColumn(t).values,r=1/0,i=-1/0,a=!1,o=!0;for(let e=2;e<n.length;e++){let t=Zg(n[e]);typeof t==`number`&&!isNaN(t)&&(a=!0,t<r&&(r=t),t>i&&(i=t),Number.isInteger(t)||(o=!1))}return a?{minValue:r,maxValue:i,allInteger:o}:null},c=[];for(let e of tl(1,r.length)){let t=r[e],n=String(t);if(i.has(n))c.push({name:n,sharedItems:o(e)});else if(a.has(n)){let t=s(e);c.push({name:n,sharedItems:null,containsNumber:t?`1`:void 0,minValue:t?.minValue,maxValue:t?.maxValue,containsInteger:t?.allInteger?`1`:void 0})}else c.push({name:n,sharedItems:null})}return c}let $g=/^[A-Za-z]{1,3}\d+$/,e_=/^[Rr]\d+[Cc]\d+$/,t_=new Set([`C`,`c`,`R`,`r`]),n_=/\s/g,r_=/[^\p{L}\p{N}_.]/gu,i_=/^[\p{L}_\\]/u;function a_(e){let t=e.replace(n_,`_`),n=!1;return t.startsWith(`\\`)&&(n=!0,t=t.slice(1)),t=t.replace(r_,``),n&&(t=`\\${t}`),t.length>0&&!i_.test(t)&&(t=`_${t}`),t.length===0?`_Table`:(t.length===1&&t_.has(t)&&(t=`_${t}`),($g.test(t)||e_.test(t))&&(t=`_${t}`),t.length>255&&(t=t.slice(0,255)),t)}var o_=class{constructor(e,t,n){this.table=e,this.column=t,this.index=n}_set(e,t){this.table.cacheState(),this.column[e]=t}get name(){return this.column.name}set name(e){this._set(`name`,e)}get filterButton(){return this.column.filterButton}set filterButton(e){this.column.filterButton=e}get style(){return this.column.style}set style(e){this.column.style=e}get totalsRowLabel(){return this.column.totalsRowLabel}set totalsRowLabel(e){this._set(`totalsRowLabel`,e)}get totalsRowFunction(){return this.column.totalsRowFunction}set totalsRowFunction(e){this._set(`totalsRowFunction`,e)}get totalsRowResult(){return this.column.totalsRowResult}set totalsRowResult(e){this._set(`totalsRowResult`,e)}get totalsRowFormula(){return this.column.totalsRowFormula}set totalsRowFormula(e){this._set(`totalsRowFormula`,e)}},s_=class e{constructor(e,t){if(this.worksheet=e,t){if(this.table=t,Array.isArray(t.rows)&&t.rows.length===0&&t.tableRef){let n=O.decode(t.tableRef);if(`dimensions`in n){let r=n.top+(t.headerRow===!1?0:1),i=n.bottom-+(t.totalsRow===!0);if(i>=r)for(let a=r;a<=i;a++){let r=e.getRow(a),i=[];for(let e=n.left;e<=n.right;e++)i.push(r.getCell(e).value);t.rows.push(i)}}}this.validate(),this.store()}}static{this.SUBTOTAL_FUNCTIONS={average:101,countNums:102,count:103,max:104,min:105,stdDev:107,var:110,sum:109}}getFormula(t){if(t.totalsRowFunction===`none`)return null;if(t.totalsRowFunction===`custom`)return t.totalsRowFormula??null;let n=t.totalsRowFunction?e.SUBTOTAL_FUNCTIONS[t.totalsRowFunction]:void 0;if(n!==void 0)return`SUBTOTAL(${n},${this.table.name}[${t.name}])`;throw new Vr(`Invalid Totals Row Function: ${t.totalsRowFunction}`)}get width(){return this.table.columns.length}get height(){return this.table.rows.length}get filterHeight(){return this.height+ +!!this.table.headerRow}get tableHeight(){return this.filterHeight+ +!!this.table.totalsRow}validate(){let{table:e}=this,t=(e,t,n)=>{e[t]===void 0&&(e[t]=n)};t(e,`headerRow`,!0),t(e,`totalsRow`,!1),t(e,`style`,{});let n=e.style;t(n,`theme`,`TableStyleMedium2`),t(n,`showFirstColumn`,!1),t(n,`showLastColumn`,!1),t(n,`showRowStripes`,!1),t(n,`showColumnStripes`,!1),e.name&&=a_(e.name),e.displayName&&=a_(e.displayName);let r=(e,t)=>{if(!e)throw new Vr(t)};r(!!e.name,`Table must have a name`),r(!!e.ref,`Table must have ref`),r(!!e.columns,`Table must have column definitions`),r(!!e.rows,`Table must have row definitions`),e.tl=O.decodeAddress(e.ref);let{row:i,col:a}=e.tl;r(i>0,`Table must be on valid row`),r(a>0,`Table must be on valid col`);let{width:o,tableHeight:s}=this;e.autoFilterRef=O.encode(i,a,i,a+o-1),e.tableRef=O.encode(i,a,i+s-1,a+o-1),e.columns.forEach((e,n)=>{r(!!e.name,`Column ${n} must have a name`),n===0?t(e,`totalsRowLabel`,`Total`):(t(e,`totalsRowFunction`,`none`),e.totalsRowFormula=this.getFormula(e)??void 0)})}store(){let e=(e,t)=>{t&&Object.assign(e.style,t)},{worksheet:t,table:n}=this,{row:r,col:i}=n.tl,a=0;if(n.headerRow){let o=t.getRow(r+ a++);n.columns.forEach((t,n)=>{let{style:r,name:a}=t,s=o.getCell(i+n);s.value=a,e(s,r)})}if(n.rows.forEach(o=>{let s=t.getRow(r+ a++);o.forEach((t,r)=>{let a=s.getCell(i+r);if(typeof t==`object`&&t&&`formula`in t&&typeof t.formula==`string`){let e=t,r=n.qualifyImplicitStructuredReferences===!0;a.value={...e,formula:r?e.formula.replace(/(^|[^A-Za-z0-9_])\[@\[?([^[\]]+?)\]?\]/g,`$1${n.name}[[#This Row],[$2]]`):e.formula}}else a.value=t;e(a,n.columns[r]?.style)})}),n.totalsRow){let o=t.getRow(r+ a++);n.columns.forEach((t,n)=>{let r=o.getCell(i+n);if(n===0)r.value=t.totalsRowLabel;else{let e=this.getFormula(t);e?r.value={formula:e,result:t.totalsRowResult}:r.value=null}e(r,t.style)})}}load(e){let{table:t}=this,{row:n,col:r}=t.tl,i=0;if(t.headerRow){let a=e.getRow(n+ i++);t.columns.forEach((e,t)=>{let n=a.getCell(r+t);n.value=e.name})}if(t.rows.forEach(t=>{let a=e.getRow(n+ i++);t.forEach((e,t)=>{let n=a.getCell(r+t);n.value=e})}),t.totalsRow){let a=e.getRow(n+ i++);t.columns.forEach((e,t)=>{let n=a.getCell(r+t);if(t===0)n.value=e.totalsRowLabel;else{let t=this.getFormula(e);t&&(n.value={formula:t,result:e.totalsRowResult})}})}}get model(){return this.table}set model(e){this.table=e}cacheState(){this._cache||={ref:this.ref,width:this.width,tableHeight:this.tableHeight}}commit(){if(!this._cache)return;this.validate();let e=O.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let t=0;t<this._cache.tableHeight;t++){let n=this.worksheet.getRow(e.row+t);for(let t=0;t<this._cache.width;t++){let r=n.getCell(e.col+t);r.value=null}}else{for(let t=this.tableHeight;t<this._cache.tableHeight;t++){let n=this.worksheet.getRow(e.row+t);for(let t=0;t<this._cache.width;t++){let r=n.getCell(e.col+t);r.value=null}}for(let t=0;t<this.tableHeight;t++){let n=this.worksheet.getRow(e.row+t);for(let t=this.width;t<this._cache.width;t++){let r=n.getCell(e.col+t);r.value=null}}}this.store(),this._cache=void 0}addRow(e,t,n){this.cacheState(),t===void 0?this.table.rows.push(e):this.table.rows.splice(t,0,e),n?.commit!==!1&&this.commit()}removeRows(e,t=1,n){this.cacheState(),this.table.rows.splice(e,t),n?.commit!==!1&&this.commit()}getColumn(e){let t=this.table.columns[e];return new o_(this,t,e)}addColumn(e,t,n){this.cacheState(),n===void 0?(this.table.columns.push(e),this.table.rows.forEach((e,n)=>{e.push(t[n])})):(this.table.columns.splice(n,0,e),this.table.rows.forEach((e,r)=>{e.splice(n,0,t[r])}))}removeColumns(e,t=1){this.cacheState(),this.table.columns.splice(e,t),this.table.rows.forEach(n=>{n.splice(e,t)})}_assign(e,t,n){this.cacheState(),e[t]=n}get ref(){return this.table.ref}set ref(e){this._assign(this.table,`ref`,e)}get name(){return this.table.name}set name(e){this.cacheState(),this.table.name=a_(e)}get displayName(){return this.table.displayName||this.table.name}set displayName(e){this.cacheState(),this.table.displayName=a_(e)}get headerRow(){return this.table.headerRow}set headerRow(e){this._assign(this.table,`headerRow`,e)}get totalsRow(){return this.table.totalsRow}set totalsRow(e){this._assign(this.table,`totalsRow`,e)}_ensureStyle(){return this.table.style||(this.table.style={}),this.table.style}get theme(){return this.table.style?.theme}set theme(e){this._ensureStyle().theme=e}get showFirstColumn(){return this.table.style?.showFirstColumn}set showFirstColumn(e){this._ensureStyle().showFirstColumn=e}get showLastColumn(){return this.table.style?.showLastColumn}set showLastColumn(e){this._ensureStyle().showLastColumn=e}get showRowStripes(){return this.table.style?.showRowStripes}set showRowStripes(e){this._ensureStyle().showRowStripes=e}get showColumnStripes(){return this.table.style?.showColumnStripes}set showColumnStripes(e){this._ensureStyle().showColumnStripes=e}};function c_(e){return O.l2n(e.toUpperCase())-1}function l_(e){return O.n2l(e+1)}function u_(e){return parseInt(e,10)-1}function d_(e){return String(e+1)}function f_(e){let t=O.decodeAddress(e.toUpperCase());return{c:t.col-1,r:t.row-1}}function p_(e){return O.encodeAddress(e.r+1,e.c+1)}function m_(e){let t=e.indexOf(`:`);if(t===-1){let t=f_(e);return{s:t,e:{...t}}}return{s:f_(e.slice(0,t)),e:f_(e.slice(t+1))}}function h_(e,t){if(t===void 0){let t=e;return h_(t.s,t.e)}let n=p_(e),r=p_(t);return n===r?n:`${n}:${r}`}let g_={32:3,33:5,34:6,35:7,36:7,37:11,38:10,39:3,40:5,41:5,42:7,43:7,44:4,45:5,46:4,47:6,48:7,49:7,50:7,51:7,52:7,53:7,54:7,55:7,56:7,57:7,58:4,59:4,60:7,61:7,62:7,63:7,64:13,65:9,66:8,67:8,68:9,69:7,70:7,71:9,72:9,73:4,74:5,75:8,76:6,77:12,78:10,79:10,80:8,81:10,82:8,83:7,84:7,85:9,86:9,87:13,88:8,89:7,90:7,91:5,92:6,93:5,94:7,95:7,96:4,97:7,98:8,99:6,100:8,101:8,102:5,103:7,104:8,105:4,106:4,107:7,108:4,109:12,110:8,111:8,112:8,113:8,114:5,115:6,116:5,117:8,118:7,119:11,120:7,121:7,122:6,123:5,124:7,125:5,126:7},__={header:{unitsPerEm:2048,usWinAscent:1950,usWinDescent:550,maxDigitAdvance:1038,sTypoAscender:1536,sTypoDescender:-512,sTypoLineGap:452},defaultAdvance:1e3,cjkAdvance:2048,advances:[[32,1,463],[33,1,667],[34,1,821],[35,1,1020],[36,1,1038],[37,1,1464],[38,1,1397],[39,1,452],[40,2,621],[42,2,1020],[44,1,511],[45,1,627],[46,1,517],[47,1,791],[48,10,1038],[58,2,548],[60,3,1020],[63,1,949],[64,1,1831],[65,1,1185],[66,1,1114],[67,1,1092],[68,1,1260],[69,1,1e3],[70,1,941],[71,1,1292],[72,1,1276],[73,1,516],[74,1,653],[75,1,1064],[76,1,861],[77,1,1751],[78,1,1322],[79,1,1356],[80,1,1058],[81,1,1378],[82,1,1112],[83,1,941],[84,1,998],[85,1,1314],[86,1,1162],[87,1,1822],[88,1,1063],[89,1,998],[90,1,959],[91,1,628],[92,1,791],[93,1,628],[94,2,1020],[96,1,596],[97,1,981],[98,1,1076],[99,1,866],[100,1,1076],[101,1,1019],[102,1,625],[103,1,964],[104,1,1076],[105,1,470],[106,1,490],[107,1,931],[108,1,470],[109,1,1636],[110,1,1076],[111,1,1080],[112,2,1076],[114,1,714],[115,1,801],[116,1,686],[117,1,1076],[118,1,925],[119,1,1464],[120,1,887],[121,1,927],[122,1,809],[123,1,644],[124,1,943],[125,1,644],[126,1,1020]]},v_={header:{unitsPerEm:2048,usWinAscent:1854,usWinDescent:434,maxDigitAdvance:1139,sTypoAscender:1491,sTypoDescender:-431,sTypoLineGap:307},defaultAdvance:1024,cjkAdvance:2048,advances:[[32,1,569],[33,1,569],[34,1,727],[35,1,1139],[36,1,1139],[37,1,1821],[38,1,1366],[39,1,391],[40,1,682],[41,1,682],[42,1,797],[43,1,1196],[44,1,569],[45,1,682],[46,1,569],[47,1,569],[48,10,1139],[58,1,569],[59,1,569],[60,1,1196],[61,1,1196],[62,1,1196],[63,1,1139],[64,1,2079],[65,1,1366],[66,1,1366],[67,1,1479],[68,1,1479],[69,1,1366],[70,1,1251],[71,1,1593],[72,1,1479],[73,1,569],[74,1,1024],[75,1,1366],[76,1,1139],[77,1,1706],[78,1,1479],[79,1,1593],[80,1,1366],[81,1,1593],[82,1,1479],[83,1,1366],[84,1,1251],[85,1,1479],[86,1,1366],[87,1,1933],[88,1,1366],[89,1,1366],[90,1,1251],[91,1,569],[92,1,569],[93,1,569],[94,1,961],[95,1,1139],[96,1,682],[97,1,1139],[98,1,1139],[99,1,1024],[100,1,1139],[101,1,1139],[102,1,569],[103,1,1139],[104,1,1139],[105,1,455],[106,1,455],[107,1,1024],[108,1,455],[109,1,1706],[110,1,1139],[111,1,1139],[112,1,1139],[113,1,1139],[114,1,682],[115,1,1024],[116,1,569],[117,1,1139],[118,1,1024],[119,1,1479],[120,1,1024],[121,1,1024],[122,1,1024],[123,1,684],[124,1,532],[125,1,684],[126,1,1196]]},y_={header:{unitsPerEm:2048,usWinAscent:1854,usWinDescent:434,maxDigitAdvance:1139,sTypoAscender:1491,sTypoDescender:-431,sTypoLineGap:307},defaultAdvance:1070,cjkAdvance:2048,advances:[[32,1,569],[33,1,682],[34,1,974],[35,1,1139],[36,1,1139],[37,1,1821],[38,1,1479],[39,1,569],[40,1,682],[41,1,682],[42,1,797],[43,1,1196],[44,1,569],[45,1,682],[46,1,569],[47,1,569],[48,10,1139],[58,1,682],[59,1,682],[60,1,1196],[61,1,1196],[62,1,1196],[63,1,1251],[64,1,1991],[65,1,1479],[66,1,1479],[67,1,1479],[68,1,1479],[69,1,1366],[70,1,1251],[71,1,1593],[72,1,1479],[73,1,682],[74,1,1139],[75,1,1479],[76,1,1251],[77,1,1706],[78,1,1479],[79,1,1593],[80,1,1366],[81,1,1593],[82,1,1479],[83,1,1366],[84,1,1251],[85,1,1479],[86,1,1366],[87,1,1933],[88,1,1366],[89,1,1366],[90,1,1251],[91,1,682],[92,1,569],[93,1,682],[94,1,1196],[95,1,1139],[96,1,682],[97,1,1139],[98,1,1251],[99,1,1024],[100,1,1251],[101,1,1139],[102,1,682],[103,1,1251],[104,1,1251],[105,1,569],[106,1,569],[107,1,1139],[108,1,569],[109,1,1821],[110,1,1251],[111,1,1251],[112,1,1251],[113,1,1251],[114,1,797],[115,1,1024],[116,1,682],[117,1,1251],[118,1,1139],[119,1,1593],[120,1,1139],[121,1,1139],[122,1,1024],[123,1,797],[124,1,569],[125,1,797],[126,1,1196]]},b_={header:{unitsPerEm:2048,usWinAscent:1825,usWinDescent:443,maxDigitAdvance:1024,sTypoAscender:1420,sTypoDescender:-442,sTypoLineGap:307},defaultAdvance:900,cjkAdvance:2048,advances:[[32,1,512],[33,1,682],[34,1,836],[35,1,1024],[36,1,1024],[37,1,1706],[38,1,1593],[39,1,369],[40,1,682],[41,1,682],[42,1,1024],[43,1,1155],[44,1,512],[45,1,682],[46,1,512],[47,1,569],[48,10,1024],[58,1,569],[59,1,569],[60,1,1155],[61,1,1155],[62,1,1155],[63,1,909],[64,1,1886],[65,1,1479],[66,1,1366],[67,1,1366],[68,1,1479],[69,1,1251],[70,1,1139],[71,1,1479],[72,1,1479],[73,1,682],[74,1,797],[75,1,1479],[76,1,1251],[77,1,1821],[78,1,1479],[79,1,1479],[80,1,1139],[81,1,1479],[82,1,1366],[83,1,1139],[84,1,1251],[85,1,1479],[86,1,1479],[87,1,1933],[88,1,1479],[89,1,1479],[90,1,1251],[91,1,682],[92,1,569],[93,1,682],[94,1,961],[95,1,1024],[96,1,682],[97,1,909],[98,1,1024],[99,1,909],[100,1,1024],[101,1,909],[102,1,682],[103,1,1024],[104,1,1024],[105,1,569],[106,1,569],[107,1,1024],[108,1,569],[109,1,1479],[110,1,1024],[111,1,1024],[112,1,1024],[113,1,1024],[114,1,682],[115,1,797],[116,1,569],[117,1,1024],[118,1,1024],[119,1,1479],[120,1,1024],[121,1,1024],[122,1,909],[123,1,983],[124,1,410],[125,1,983],[126,1,1073]]},x_={header:{unitsPerEm:2048,usWinAscent:1705,usWinDescent:615,maxDigitAdvance:1229,sTypoAscender:1255,sTypoDescender:-386,sTypoLineGap:0},defaultAdvance:1229,cjkAdvance:2048,advances:[[32,95,1229]]},S_={header:{unitsPerEm:2048,usWinAscent:2059,usWinDescent:430,maxDigitAdvance:1302,sTypoAscender:1566,sTypoDescender:-423,sTypoLineGap:202},defaultAdvance:1200,cjkAdvance:2048,advances:[[32,1,720],[33,1,756],[34,1,933],[35,1,1521],[36,1,1198],[37,1,1807],[38,1,1487],[39,1,510],[40,1,756],[41,1,756],[42,1,1198],[43,1,1521],[44,1,643],[45,1,811],[46,1,643],[47,1,899],[48,10,1302],[58,1,756],[59,1,756],[60,1,1521],[61,1,1521],[62,1,1521],[63,1,1151],[64,1,1937],[65,1,1362],[66,1,1382],[67,1,1279],[68,1,1490],[69,1,1279],[70,1,1186],[71,1,1458],[72,1,1498],[73,1,924],[74,1,922],[75,1,1362],[76,1,1145],[77,1,1728],[78,1,1498],[79,1,1476],[80,1,1262],[81,1,1476],[82,1,1396],[83,1,1300],[84,1,1185],[85,1,1448],[86,1,1362],[87,1,1864],[88,1,1244],[89,1,1183],[90,1,1204],[91,1,756],[92,1,899],[93,1,756],[94,1,1521],[95,1,1198],[96,1,1198],[97,1,1224],[98,1,1302],[99,1,1075],[100,1,1302],[101,1,1218],[102,1,756],[103,1,1302],[104,1,1317],[105,1,643],[106,1,700],[107,1,1183],[108,1,643],[109,1,1937],[110,1,1317],[111,1,1271],[112,1,1302],[113,1,1302],[114,1,899],[115,1,1075],[116,1,811],[117,1,1317],[118,1,1183],[119,1,1728],[120,1,1183],[121,1,1183],[122,1,1031],[123,1,787],[124,1,756],[125,1,787],[126,1,1521]]},C_={header:{unitsPerEm:2048,usWinAscent:1878,usWinDescent:449,maxDigitAdvance:1257,sTypoAscender:1549,sTypoDescender:-444,sTypoLineGap:198},defaultAdvance:1100,cjkAdvance:2048,advances:[[32,1,504],[33,1,614],[34,1,679],[35,1,1257],[36,1,1024],[37,1,1539],[38,1,1350],[39,1,391],[40,1,614],[41,1,614],[42,1,842],[43,1,1257],[44,1,504],[45,1,751],[46,1,504],[47,1,797],[48,10,1257],[58,1,569],[59,1,569],[60,1,1257],[61,1,1257],[62,1,1257],[63,1,885],[64,1,1614],[65,1,1350],[66,1,1273],[67,1,1161],[68,1,1427],[69,1,1163],[70,1,1074],[71,1,1314],[72,1,1517],[73,1,721],[74,1,772],[75,1,1397],[76,1,1176],[77,1,1770],[78,1,1462],[79,1,1392],[80,1,1118],[81,1,1392],[82,1,1321],[83,1,1019],[84,1,1163],[85,1,1456],[86,1,1321],[87,1,1887],[88,1,1314],[89,1,1220],[90,1,1055],[91,1,614],[92,1,797],[93,1,614],[94,1,1257],[95,1,1024],[96,1,682],[97,1,1019],[98,1,1100],[99,1,866],[100,1,1106],[101,1,958],[102,1,654],[103,1,1006],[104,1,1152],[105,1,606],[106,1,606],[107,1,1048],[108,1,606],[109,1,1700],[110,1,1131],[111,1,1042],[112,1,1100],[113,1,1100],[114,1,772],[115,1,820],[116,1,688],[117,1,1117],[118,1,1019],[119,1,1559],[120,1,1007],[121,1,1012],[122,1,880],[123,1,637],[124,1,583],[125,1,637],[126,1,1257]]},w_={header:{unitsPerEm:2048,usWinAscent:2049,usWinDescent:423,maxDigitAdvance:1118,sTypoAscender:1566,sTypoDescender:-423,sTypoLineGap:59},defaultAdvance:1050,cjkAdvance:2048,advances:[[32,1,461],[33,1,536],[34,1,717],[35,1,1232],[36,1,1014],[37,1,1625],[38,1,1327],[39,1,428],[40,1,616],[41,1,616],[42,1,900],[43,1,1232],[44,1,504],[45,1,700],[46,1,504],[47,1,753],[48,10,1118],[58,1,567],[59,1,567],[60,1,1232],[61,1,1232],[62,1,1232],[63,1,974],[64,1,1810],[65,1,1205],[66,1,1200],[67,1,1130],[68,1,1327],[69,1,1117],[70,1,1032],[71,1,1306],[72,1,1308],[73,1,614],[74,1,794],[75,1,1195],[76,1,1003],[77,1,1500],[78,1,1308],[79,1,1381],[80,1,1103],[81,1,1381],[82,1,1200],[83,1,1117],[84,1,1100],[85,1,1300],[86,1,1205],[87,1,1723],[88,1,1119],[89,1,1130],[90,1,1068],[91,1,616],[92,1,753],[93,1,616],[94,1,1232],[95,1,893],[96,1,1118],[97,1,1066],[98,1,1141],[99,1,942],[100,1,1141],[101,1,1086],[102,1,639],[103,1,1141],[104,1,1126],[105,1,500],[106,1,548],[107,1,1023],[108,1,500],[109,1,1705],[110,1,1126],[111,1,1103],[112,1,1141],[113,1,1141],[114,1,714],[115,1,918],[116,1,700],[117,1,1126],[118,1,1e3],[119,1,1500],[120,1,1e3],[121,1,1e3],[122,1,880],[123,1,616],[124,1,540],[125,1,616],[126,1,1232]]},T_={header:{unitsPerEm:2048,usWinAscent:1923,usWinDescent:455,maxDigitAdvance:1074,sTypoAscender:1510,sTypoDescender:-420,sTypoLineGap:0},defaultAdvance:1e3,cjkAdvance:2048,advances:[[32,1,453],[33,1,545],[34,1,613],[35,1,1107],[36,1,1074],[37,1,1341],[38,1,1213],[39,1,360],[40,1,616],[41,1,616],[42,1,860],[43,1,1107],[44,1,453],[45,1,697],[46,1,453],[47,1,766],[48,10,1074],[58,1,453],[59,1,453],[60,1,1107],[61,1,1107],[62,1,1107],[63,1,860],[64,1,1648],[65,1,1227],[66,1,1227],[67,1,1139],[68,1,1309],[69,1,1139],[70,1,1057],[71,1,1309],[72,1,1395],[73,1,627],[74,1,791],[75,1,1260],[76,1,1057],[77,1,1456],[78,1,1350],[79,1,1395],[80,1,1139],[81,1,1395],[82,1,1215],[83,1,1057],[84,1,1139],[85,1,1350],[86,1,1227],[87,1,1730],[88,1,1260],[89,1,1139],[90,1,1139],[91,1,616],[92,1,766],[93,1,616],[94,1,1107],[95,1,1074],[96,1,860],[97,1,1013],[98,1,1074],[99,1,936],[100,1,1074],[101,1,1013],[102,1,627],[103,1,1074],[104,1,1074],[105,1,545],[106,1,538],[107,1,1013],[108,1,545],[109,1,1539],[110,1,1074],[111,1,1074],[112,1,1074],[113,1,1074],[114,1,715],[115,1,860],[116,1,627],[117,1,1074],[118,1,936],[119,1,1481],[120,1,936],[121,1,936],[122,1,860],[123,1,616],[124,1,604],[125,1,616],[126,1,1107]]},E_={},D_={};function O_(e,t,n){E_[e.toLowerCase()]=t,n&&(D_[e.toLowerCase()]=n)}O_(`calibri`,__),O_(`arial`,v_,y_),O_(`times new roman`,b_),O_(`courier new`,x_),O_(`verdana`,S_),O_(`georgia`,C_),O_(`tahoma`,w_),O_(`trebuchet ms`,T_);let k_={aptos:[1.03,1.37,1],"aptos display":[.96,1.31,1],"aptos narrow":[.82,1.07,1],"aptos serif":[.98,1.31,1],"calibri light":[.98,1.19,1],cambria:[1.07,1.28,1],"century gothic":[1.19,1.36,1],"comic sans ms":[1.14,1.46,1],consolas:[1.21,1.21,1],constantia:[1.05,1.34,1],corbel:[.97,1.2,1],garamond:[1.16,1.39,1],impact:[.96,1.01,1],"lucida console":[1.21,1.21,1],"lucida sans unicode":[1.16,1.4,1],"microsoft sans serif":[1.07,1.35,1],"palatino linotype":[1.12,1.44,1],"segoe ui":[1.08,1.31,1],"book antiqua":[1.12,1.44,1],candara:[1.02,1.25,1],"franklin gothic medium":[1.08,1.33,1],"goudy old style":[1.02,1.34,1],rockwell:[1.14,1.35,1],"tw cen mt":[.95,1.17,1],"microsoft yahei":[1.18,1.3,1.18],"microsoft yahei ui":[1.18,1.3,1.18],simsun:[1.1,1.1,1.1],宋体:[1.1,1.1,1.1],simhei:[1.1,1.1,1.1],黑体:[1.1,1.1,1.1],nsimsun:[1.1,1.1,1.1],新宋体:[1.1,1.1,1.1],dengxian:[1.05,1.28,1.08],等线:[1.05,1.28,1.08],fangsong:[1.1,1.1,1.1],仿宋:[1.1,1.1,1.1],kaiti:[1.1,1.1,1.1],楷体:[1.1,1.1,1.1],meiryo:[1.18,1.3,1.18],"meiryo ui":[1.1,1.2,1.18],"ms gothic":[1.21,1.21,1.1],"MS ゴシック":[1.21,1.21,1.1],"ms pgothic":[1.07,1.33,1.1],"ms mincho":[1.21,1.21,1.1],"yu gothic":[1.17,1.32,1.18],"yu gothic ui":[1.08,1.22,1.18],"yu mincho":[1.1,1.28,1.18],"malgun gothic":[1.12,1.28,1.14],"맑은 고딕":[1.12,1.28,1.14],batang:[1.1,1.1,1.1],gulim:[1.1,1.1,1.1],dotum:[1.1,1.1,1.1]},A_=new Map;function j_(e){let t=A_.get(e);if(t)return t;t=new Map;for(let[n,r,i]of e.advances)for(let e=0;e<r;e++)t.set(n+e,i);return A_.set(e,t),t}function M_(e,t){let n=e.toLowerCase();return t?D_[n]??E_[n]:E_[n]}function N_(e){return Object.hasOwn(D_,e.toLowerCase())}function P_(){return __}function F_(e,t){return t>=19968&&t<=40959||t>=13312&&t<=19903||t>=63744&&t<=64255||t>=131072&&t<=205743||t>=12288&&t<=12543||t>=44032&&t<=55215||t>=65281&&t<=65376||t>=11904&&t<=12255||t>=12544&&t<=13311?e.cjkAdvance:j_(e).get(t)??e.defaultAdvance}function I_(e){return g_[e]}function L_(e){return k_[e.toLowerCase()]}function R_(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=63744&&e<=64255||e>=65281&&e<=65376||e>=12288&&e<=12543||e>=11904&&e<=12255||e>=12544&&e<=13311||e>=44032&&e<=55215||e>=131072&&e<=205743}let z_=`Calibri`,B_=1790;function V_(e,t,n,r,i){if(t===`calibri`&&n===11){let t=I_(e);if(t!==void 0)return t}if(i){let t=F_(i,e),r=Math.round(n/72*96);return Math.round(t/i.header.unitsPerEm*r)}}function H_(e){return{name:(e?.name??z_).toLowerCase(),size:e?.size??11,bold:e?.bold??!1,italic:e?.italic??!1,vertAlign:e?.vertAlign}}function U_(e,t){if(!e)return 0;let n=H_(t),r=M_(n.name,n.bold),i=e.split(/\r\n|\r|\n/),a=0;for(let e of i){let t=W_(e,n,r);t>a&&(a=t)}return a}function W_(e,t,n){return e?n||t.name===`calibri`&&t.size===11?G_(e,t,n):K_(e,t):0}function G_(e,t,n){let r=0;for(let i of e)r+=nv(i.codePointAt(0),t,n);return t.vertAlign&&(r=Math.ceil(r*.6)),r}function K_(e,t){let n=L_(t.name),r=n?.[0]??1,i=n?.[1]??1.3,a=n?.[2]??1,o=0,s=0,c=0;for(let t of e)R_(t.codePointAt(0))?c+=2:t>=`A`&&t<=`Z`?s++:o++;let l=(o*r+s*i+c*a)*(t.size/11);t.bold&&(l*=1.05),t.italic&&(l*=1.02),t.vertAlign&&(l*=.6);let u=J_({name:t.name,size:t.size});return Math.ceil(l*u)}function q_(e,t){let n=0,r=0;for(let i of e){let e=i.font?{...t,...i.font}:t,a=i.text.split(/\r\n|\r|\n/);for(let t=0;t<a.length;t++)t>0&&(r>n&&(n=r),r=0),a[t]&&(r+=U_(a[t],e))}return r>n&&(n=r),n}function J_(e){let t=(e?.name??z_).toLowerCase(),n=e?.size??11;if(t===`calibri`&&n===11)return 7;let r=M_(t);if(r){let e=Math.round(n/72*96);return Math.round(r.header.maxDigitAdvance/r.header.unitsPerEm*e)}return Math.max(1,Math.round(n/11*7))}function Y_(e){return 2*Math.ceil(e/4)+1}function X_(e,t){return t<=0?0:Math.trunc(e/t*256)/256}function Z_(e,t){if(t<=0)return 0;let n=Y_(t);return e===0?0:e<1?Math.round(e*(t+n)):Math.round(e*t)+n}function Q_(e){return e*72/96}function $_(e,t,n){if(e<=0)return 0;let r=e+2*Math.ceil(e*.03+t/4)+1;n&&(r+=16),r>B_&&(r=B_);let i=X_(r,t);return Math.min(i,255)}function ev(e){let t=(e?.name??z_).toLowerCase(),n=e?.size??11,r=Math.round(n/72*96),i=M_(t);if(i){let{unitsPerEm:e,usWinDescent:t}=i.header;return(e+t)/e*r}return r*1.3}function tv(e,t,n){if(!e||t<=0)return 1;let r=H_(n),i=M_(r.name,r.bold),a=e.split(/\r\n|\r|\n/),o=0;for(let e of a){if(!e){o++;continue}o+=rv(e,t,r,i)}return o}function nv(e,t,n){let r;if(n||t.name===`calibri`&&t.size===11){let i=n??P_();r=V_(e,t.name,t.size,t.bold,i)??Math.round(i.defaultAdvance/i.header.unitsPerEm*Math.round(t.size/72*96))}else r=Math.ceil(t.size/11*J_({name:t.name,size:t.size})*(R_(e)?2:1));return t.bold&&!N_(t.name)&&(r=Math.ceil(r*1.05)),t.italic&&(r=Math.ceil(r*1.02)),r}function rv(e,t,n,r){let i=iv(e);if(i.length===0)return 1;let a=1,o=0;for(let e of i){let i=0;for(let t of e)i+=nv(t.codePointAt(0),n,r);o===0?o=i:o+i>t?(a++,o=i):o+=i}return a}function iv(e){let t=[],n=``;for(let r of e)n+=r,(r===` `||r===`-`||r===` `)&&(t.push(n),n=``);return n&&t.push(n),t}function av(e,t,n,r){if(!e)return Q_(ev(t));let i=ev(t),a;return a=n?.wrapText&&r&&r>0?tv(e,r,t):e.split(/\r\n|\r|\n/).length,Q_(i*a)}function ov(e,t,n,r){let i=t?.size??11,a=t;for(let n of e){let e=n.font?.size??t?.size??11;e>i&&(i=e,a=n.font?{...t,...n.font}:t)}return av(e.map(e=>e.text).join(``),a,n,r)}function sv(e,t){let n=Z_(e,t),r=Y_(t);return Math.max(0,n-r)}function cv(e){let t=e.effectiveType,n=e.font;if(t===8){let t=e.value;if(t&&typeof t==`object`&&`richText`in t)return q_(t.richText,n)}let r=Wl(e);return r?U_(r,n):0}function lv(e,t,n){let r=e.font,i=e.alignment;if(e.effectiveType===8){let t=e.value;if(t&&typeof t==`object`&&`richText`in t)return ov(t.richText,r,i,n)}let a=Wl(e);return a?av(a,r,i,i?.wrapText?n:void 0):0}var uv=class{constructor(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=[],this._keys={},this._merges={},this.rowBreaks=[],this.colBreaks=[],this.properties={defaultRowHeight:15,outlineLevelCol:0,outlineLevelRow:0,...e.properties},this.pageSetup={margins:{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},orientation:`portrait`,horizontalDpi:void 0,verticalDpi:void 0,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={differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null,...e.headerFooter},this.dataValidations=new em,this.views=e.views??[],this.autoFilter=e.autoFilter??null,this._media=[],this.sheetProtection=null,this.tables={},this.pivotTables=[],this.conditionalFormattings=[],this.formControls=[],this.ignoredErrors=[],this._watermark=null}get name(){return this._name}set name(e){if(e===void 0&&(e=`sheet${this.id}`),this._name===e)return;if(typeof e!=`string`)throw new kr(`The name has to be a string.`);if(e===``)throw new kr(`The name can't be empty.`);if(e===`History`)throw new kr(`The name "History" is protected. Please use a different name.`);if(/[*?:/\\[\]]/.test(e))throw new kr(`Worksheet name ${e} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(e))throw new kr(`The first or last character of worksheet name cannot be a single quotation mark: ${e}`);e.length>31&&(e=e.substring(0,31));let t=e.toLowerCase();if(this._workbook.worksheets.find(e=>e&&e!==this&&e.name.toLowerCase()===t))throw new kr(`Worksheet name already exists: ${e}`);this._name=e}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){let e=new Gr;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=Array.isArray(t.header)?t.header.length:+!!t.header;return Math.max(e,n)},0);let t=1,n=this._columns=[];e.forEach(e=>{let r=new wc(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=O.l2n(e)}else t=e;if(t>this._columns.length){let e=this._columns.length+1;for(;e<=t;)this._columns.push(new wc(this,e++))}return this._columns[t-1]}spliceColumns(e,t,...n){for(let e of Object.values(this._merges))for(let t=e.top;t<=e.bottom;t++)for(let n=e.left;n<=e.right;n++){let e=this.findCell(t,n);e&&e.type===1&&e.unmerge()}let r=this._rows.length;if(n.length>0)for(let i=0;i<r;i++){let r=n.map(e=>e[i]??null);this.getRow(i+1).splice(e,t,...r)}else this._rows.forEach(n=>{n&&n.splice(e,t)});let i=n.length-t,a=e+t,o=this._columns.length;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=void 0;if(this.workbook.definedNames.spliceColumns(this.name,e,t,n.length),i!==0){for(let t of this._media)if(t.type===`image`&&t.range){let{tl:n,br:r}=t.range;n&&n.nativeCol>=e-1&&(n.nativeCol=Math.max(0,n.nativeCol+i)),r&&r.nativeCol>=e-1&&(r.nativeCol=Math.max(0,r.nativeCol+i))}}this._spliceMerges(`col`,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 du(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=_c(r.style)??{},r.eachCell({includeEmpty:n},(e,t)=>{i.getCell(t).style=_c(e.style)??{}}),i.height=r.height}duplicateRow(e,t,n=!1){let r=this.getRow(e),i=Array.from({length:t}).fill(r.values),a=[];for(let t of Object.values(this._merges))t.top===e&&t.bottom===e&&a.push(t);let o=[],s=e-1;for(let e of this._media)e.type===`image`&&e.range&&e.range.tl.nativeRow===s&&o.push(e);this.spliceRows(e+1,n?0:t,...i);for(let n=0;n<t;n++){let t=this._rows[e+n];t.style=_c(r.style)??{},t.height=r.height,r.eachCell({includeEmpty:!0},(e,n)=>{t.getCell(n).style=_c(e.style)??{}})}if(a.length>0)for(let r=0;r<t;r++){let t=e+1+r;if(!n){let e=[];for(let[n,r]of Object.entries(this._merges))r.top<=t&&r.bottom>=t&&e.push(n);for(let t of e)this._unMergeMaster(this.getCell(t))}for(let e of a)this.mergeCellsWithoutStyle(t,e.left,t,e.right)}if(!n){let n=e,r=e+t-1;this._media=this._media.filter(e=>{if(e.type===`image`&&e.range){let t=e.range.tl.nativeRow;return t<n||t>r}return!0})}for(let e=0;e<t;e++){let t=e+1;for(let e of o){let n=e.clone();if(n.range.tl.nativeRow=s+t,n.range.br){let r=e.range.br.nativeRow-s;n.range.br.nativeRow=s+t+r}this._media.push(n)}}}spliceRows(e,t,...n){for(let e of Object.values(this._merges))for(let t=e.top;t<=e.bottom;t++)for(let n=e.left;n<=e.right;n++){let e=this.findCell(t,n);e&&e.type===1&&e.unmerge()}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(c.style)??{},e.height=c.height,c.eachCell({includeEmpty:!0},(t,n)=>{e.getCell(n).style=_c(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(c.style)??{},e.height=c.height,c.eachCell({includeEmpty:!0},(t,n)=>{e.getCell(n).style=_c(t.style)??{}})}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]}if(this.workbook.definedNames.spliceRows(this.name,e,t,i),a!==0){for(let t of this._media)if(t.type===`image`&&t.range){let{tl:n,br:r}=t.range;n&&n.nativeRow>=e-1&&(n.nativeRow=Math.max(0,n.nativeRow+a)),r&&r.nativeRow>=e-1&&(r.nativeRow=Math.max(0,r.nativeRow+a))}}this._spliceMerges(`row`,e,t,i)}eachRow(e,t){let n,r;if(typeof e==`function`?r=e:(n=e,r=t),n&&n.includeEmpty){let e=this._rows.length;for(let t=1;t<=e;t++)r(this.getRow(t),t)}else this._rows.forEach(e=>{e&&e.hasValues&&r(e,e.number)})}getSheetValues(){let e=[];return this._rows.forEach(t=>{t&&(e[t.number]=t.values)}),e}findCell(e,t){let n=O.getAddress(e,t),r=this._rows[n.row-1];return r?r.findCell(n.col):void 0}getCell(e,t){let n=O.getAddress(e,t);return this.getRow(n.row).getCellEx(n)}mergeCells(...e){let t=new Gr(e);this._mergeCellsInternal(t)}mergeCellsWithoutStyle(...e){let t=new Gr(e);this._mergeCellsInternal(t,!0)}_mergeCellsInternal(e,t){Object.values(this._merges).forEach(t=>{if(t.intersects(e))throw new Nr});let{top:n,left:r,bottom:i,right:a}=e,o=t?void 0:ym(n,r,i,a,(e,t)=>this.findCell(e,t)),s=this.getCell(e.top,e.left);for(let e=n;e<=i;e++)for(let i=r;i<=a;i++)(e>n||i>r)&&this.getCell(e,i).merge(s,t);o&&bm(n,r,i,a,o,(e,t)=>this.getCell(e,t)),this._merges[s.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]}}_spliceMerges(e,t,n,r){let i=r-n;if(i===0&&n===0)return;let a=t+n,o=e===`row`,s={};for(let e of Object.values(this._merges)){let{top:r,left:c,bottom:l,right:u}=e.model,d=o?r:c,f=o?l:u;if(i<=0&&n>0){let n=a-1;if(d>n){let e=o?new Gr(r+i,c,l+i,u):new Gr(r,c+i,l,u+i);s[O.encodeAddress(e.top,e.left)]=e}else if(f<t)s[O.encodeAddress(r,c)]=e;else if(!(d>=t&&f<=n)){let e=r,n=c,a=l,d=u;o?(e=r<t?r:t,a=Math.max(e,l+i)):(n=c<t?c:t,d=Math.max(n,u+i));let f=new Gr(e,n,a,d);e===a&&n===d||(s[O.encodeAddress(f.top,f.left)]=f)}}else if(d>=a){let e=o?new Gr(r+i,c,l+i,u):new Gr(r,c+i,l,u+i);s[O.encodeAddress(e.top,e.left)]=e}else f<a||(o?e.model.bottom=l+i:e.model.right=u+i),s[O.encodeAddress(r,c)]=e}this._merges=s;for(let e of Object.values(s)){let t=this.getCell(e.top,e.left);for(let n=e.top;n<=e.bottom;n++)for(let r=e.left;r<=e.right;r++)(n>e.top||r>e.left)&&this.getCell(n,r).merge(t,!0)}}get hasMerges(){return Object.values(this._merges).some(Boolean)}unMergeCells(...e){let t=new Gr(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===1?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}=O.decode(e),c=s-a+1,l=O.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++)if(f){let a=this.getCell(n,i);a.value={shareType:r,formula:t,ref:e,result:d(n,i)},f=!1}else 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 Vg(this,n))}getImages(){return this._media.filter(e=>e.type===`image`)}addBackgroundImage(e){let t={type:`background`,imageId:String(e)};this._media.push(new Vg(this,t))}getBackgroundImageId(){let e=this._media.find(e=>e.type===`background`);return e&&e.imageId}addWatermark(e){if(this._media=this._media.filter(e=>e.type!==`watermark`&&e.type!==`headerImage`),this._watermark={imageId:String(e.imageId),mode:e.mode??`overlay`,opacity:e.opacity,headerWidth:e.headerWidth,headerHeight:e.headerHeight,applyTo:e.applyTo},this._watermark.mode===`overlay`){let t={type:`watermark`,imageId:String(e.imageId),opacity:e.opacity};this._media.push(new Vg(this,t))}else{let t={type:`headerImage`,imageId:String(e.imageId),headerWidth:e.headerWidth,headerHeight:e.headerHeight,applyTo:e.applyTo};this._media.push(new Vg(this,t))}}getWatermark(){return this._watermark}removeWatermark(){this._watermark=null,this._media=this._media.filter(e=>e.type!==`watermark`&&e.type!==`headerImage`)}addFormCheckbox(e,t){let n=new Bg(this,e,t);return this.formControls.push(n),n}getFormCheckboxes(){return this.formControls}async protect(e,t){this.sheetProtection=await Cm(e,t)}unprotect(){this.sheetProtection=null}addTable(e){let t=new s_(this,e),n=t.name.toLowerCase();if(this.tables[t.name])throw new Vr(`Table name "${t.name}" already exists in worksheet "${this.name}".`);if(this.workbook._tableNames.has(n))throw new Vr(`Table name "${t.name}" already exists in another worksheet. Table names must be unique across the entire workbook (case-insensitive).`);return this.tables[t.name]=t,this.workbook._tableNames.add(n),t}getTable(e){return this.tables[e]}removeTable(e){this.tables[e]&&this.workbook._tableNames.delete(e.toLowerCase()),delete this.tables[e]}getTables(){return Object.values(this.tables)}addPivotTable(e){let t=Yg(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=[]}autoFitColumn(e){let t=typeof e==`string`?O.l2n(e):e;return this._autoFitColumnImpl(t),this}autoFitColumns(e,t){let n=this.dimensions;if(!n||n.left===void 0)return this;let r=e==null?n.left:typeof e==`string`?O.l2n(e):e,i=t==null?n.right:typeof t==`string`?O.l2n(t):t;for(let e=r;e<=i;e++)this._autoFitColumnImpl(e);return this}autoFitRow(e){return this._autoFitRowImpl(e),this}autoFitRows(e,t){let n=this.dimensions;if(!n||n.top===void 0)return this;let r=e??n.top,i=t??n.bottom;for(let e=r;e<=i;e++)this._autoFitRowImpl(e);return this}_autoFitColumnImpl(e){let t=J_(),n=this._isColumnInAutoFilter(e),r=0;if(this._rows.forEach(n=>{if(!n||n.hidden)return;let i=n.findCell(e);if(!i||i.type===1)return;if(i.isMerged){let e=this._merges[i.address];if(e&&e.left!==e.right)return}if(i.alignment?.shrinkToFit)return;let a=cv(i),o=i.alignment?.indent;o&&o>0&&(a+=o*3*t),a>r&&(r=a)}),r>0){let i=$_(r,t,n);if(i>0){let t=this.getColumn(e);t.width=i,t.bestFit=!0}}}_autoFitRowImpl(e){let t=this._rows[e-1];if(!t)return;let n=J_(),r=0;t.eachCell(e=>{if(e.type===1)return;if(e.isMerged){let t=this._merges[e.address];if(t&&t.top!==t.bottom)return}if(this._columns[e.col-1]?.hidden)return;let t=lv(e,n,this._getColumnContentWidthForCell(e,n));t>r&&(r=t)}),r>0&&(t.height=Math.ceil(r*4)/4,t.customHeight=!0)}_getColumnContentWidthForCell(e,t){if(e.alignment?.wrapText)return sv(this._columns[e.col-1]?.width??this.properties.defaultColWidth??9,t)}_isColumnInAutoFilter(e){if(!this.autoFilter)return!1;if(typeof this.autoFilter==`string`){let t=O.decode(this.autoFilter);return e>=t.left&&e<=t.right}let{from:t,to:n}=this.autoFilter,r=typeof t==`string`?O.decode(t).col:t.col,i=typeof n==`string`?O.decode(n).col:n.col;return e>=r&&e<=i}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,colBreaks:this.colBreaks,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,formControls:this.formControls.map(e=>e.model),ignoredErrors:this.ignoredErrors,watermark:this._watermark,drawing:this._drawing};e.cols=wc.toModel(this.columns);let t=e.rows=[],n=e.dimensions=new Gr;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.mergeCells=Object.values(this._merges).map(e=>e.range),e}_parseRows(e){this._rows=[],e.rows&&e.rows.forEach(e=>{let t=new du(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){if(this.name=e.name,this.state=e.state,this._columns=wc.fromModel(this,e.cols??[]),this._parseRows(e),this._parseMergeCells(e),this.dataValidations=new em(e.dataValidations),this.properties=e.properties,this.pageSetup=e.pageSetup,this.headerFooter=e.headerFooter,this.rowBreaks=e.rowBreaks??[],this.colBreaks=e.colBreaks??[],this.views=e.views,this.autoFilter=e.autoFilter,this._media=e.media.map(e=>new Vg(this,e)),this._watermark=e.watermark??null,!this._watermark){for(let e of this._media)if(e.type===`watermark`){this._watermark={imageId:e.imageId??``,mode:`overlay`,opacity:e.opacity};break}else if(e.type===`headerImage`){this._watermark={imageId:e.imageId??``,mode:`header`,headerWidth:e.headerWidth,headerHeight:e.headerHeight};break}}this.sheetProtection=e.sheetProtection,this.tables=e.tables.reduce((e,t)=>{let n=new s_(this,t);return n.model=t,e[t.name]=n,this.workbook._tableNames.add(t.name.toLowerCase()),e},{}),this.pivotTables=e.pivotTables,this.conditionalFormattings=e.conditionalFormattings,this.ignoredErrors=e.ignoredErrors??[],this.formControls=[],this._drawing=e.drawing}toJSON(e){let t=e||{},n=1,r=this.rowCount,i=1,a=this.columnCount;if(t.range!==void 0){if(typeof t.range==`number`)n=t.range+1;else if(typeof t.range==`string`){let e=m_(t.range);n=e.s.r+1,r=e.e.r+1,i=e.s.c+1,a=e.e.c+1}}if(r<n||a<i)return[];let o=t.header;if(o===1){let e=[],o=t.blankRows!==!1;for(let s=n;s<=r;s++){let n=[],r=!0;for(let e=i;e<=a;e++){let a=this.getCell(s,e),o=t.raw===!1?Wl(a,t.dateFormat).trim():a.value;o!=null&&o!==``?(n[e-i]=o,r=!1):t.defaultValue===void 0?n[e-i]=null:n[e-i]=t.defaultValue}(!r||o)&&e.push(n)}return e}if(o===`A`){let e=[],o=t.blankRows===!0;for(let s=n;s<=r;s++){let n={},r=!0;for(let e=i;e<=a;e++){let i=this.getCell(s,e),a=t.raw===!1?Wl(i,t.dateFormat).trim():i.value,o=l_(e-1);a!=null&&a!==``?(n[o]=a,r=!1):t.defaultValue!==void 0&&(n[o]=t.defaultValue)}(!r||o)&&e.push(n)}return e}if(Array.isArray(o)){let e=[],s=t.blankRows===!0;for(let c=n;c<=r;c++){let n={},r=!0;for(let e=i;e<=a;e++){let a=e-i,s=o[a]??`__EMPTY_${a}`,l=this.getCell(c,e),u=t.raw===!1?Wl(l,t.dateFormat).trim():l.value;u!=null&&u!==``?(n[s]=u,r=!1):t.defaultValue!==void 0&&(n[s]=t.defaultValue)}(!r||s)&&e.push(n)}return e}let s=[],c={};for(let e=i;e<=a;e++){let t=this.getCell(n,e).value,r=t==null?`__EMPTY_${e-i}`:String(t);c[r]===void 0?c[r]=0:(c[r]++,r=`${r}_${c[r]}`),s.push(r)}let l=[],u=n+1,d=t.blankRows===!0;for(let e=u;e<=r;e++){let n={},r=!0;for(let o=i;o<=a;o++){let a=this.getCell(e,o),c=t.raw===!1?Wl(a,t.dateFormat).trim():a.value,l=s[o-i];c!=null&&c!==``?(n[l]=c,r=!1):t.defaultValue!==void 0&&(n[l]=t.defaultValue)}(!r||d)&&l.push(n)}return l}addJSON(e,t){if(e.length===0)return this;let n=t||{},r=1,i=1;if(n.origin!==void 0){let e=dv(n.origin,this.rowCount);r=e.row,i=e.col}let a=new Set;e.forEach(e=>Object.keys(e).forEach(e=>a.add(e)));let o=n.header?[...n.header]:[...a];n.header&&a.forEach(e=>{o.includes(e)||o.push(e)});let s=r;n.skipHeader||(o.forEach((e,t)=>{this.getCell(s,i+t).value=e}),s++);for(let t of e)o.forEach((e,r)=>{let a=t[e];a===null&&n.nullError?this.getCell(s,i+r).value={error:`#NULL!`}:a!=null&&(this.getCell(s,i+r).value=a)}),s++;return this}toAOA(){let e=[];return this.eachRow({includeEmpty:!0},(t,n)=>{let r=[];t.eachCell({includeEmpty:!0},(e,t)=>{r[t-1]=e.value}),e[n-1]=r}),e}addAOA(e,t){if(e.length===0)return this;let n=1,r=1;if(t?.origin!==void 0){let e=dv(t.origin,this.rowCount);n=e.row,r=e.col}return e.forEach((e,t)=>{e&&e.forEach((e,i)=>{e!=null&&(this.getCell(n+t,r+i).value=e)})}),this}};function dv(e,t){if(typeof e==`string`){let t=f_(e);return{row:t.r+1,col:t.c+1}}return typeof e==`number`?e===-1?{row:t+1,col:1}:{row:e+1,col:1}:{row:e.r+1,col:e.c+1}}let fv=BigInt(2**53-1);function pv(e,t){if(e>fv)throw Error(`ZIP64 ${t} value ${e} exceeds Number.MAX_SAFE_INTEGER. The archive may be corrupted or malicious.`);return Number(e)}function mv(e){return e.encoding?_a(e.encoding):void 0}function hv(e,t=!1){for(let n=e.length-22;n>=0;n--)if(e[n]===80&&e[n+1]===75&&e[n+2]===5&&e[n+3]===6)if(t){let t=e[n+20]|e[n+21]<<8;if(n+22+t===e.length)return n}else return n;return-1}function gv(e,t){let n=t-20;return n<0?-1:e[n]===80&&e[n+1]===75&&e[n+2]===6&&e[n+3]===7?n:-1}function _v(e,t,n=!0,r){let i=new Ea(e,t);i.skip(4);let a=i.readUint16(),o=i.readUint16(),s=i.readUint16(),c=i.readUint16(),l=i.readUint32(),u=i.readUint32(),d=i.readUint16(),f=``;if(d>0){let e=i.readBytes(d);n&&(f=r?r.decode(e):Tn(e))}return{eocd:{diskNumber:a,centralDirDisk:o,entriesOnDisk:s,totalEntries:c,centralDirSize:l,centralDirOffset:u},comment:f}}function vv(e,t){let n=new Ea(e,t);return n.readUint32()===117853008?(n.skip(4),pv(n.readBigUint64(),`EOCD locator offset`)):-1}function yv(e,t){let n=new Ea(e,t);return n.readUint32()===101075792?(n.skip(8),n.skip(2),n.skip(2),n.skip(4),n.skip(4),{entriesOnDisk:n.readBigUint64(),totalEntries:n.readBigUint64(),centralDirSize:n.readBigUint64(),centralDirOffset:n.readBigUint64()}):null}function bv(e,t){e.totalEntries===65535&&(e.totalEntries=pv(t.totalEntries,`totalEntries`)),e.entriesOnDisk===65535&&(e.entriesOnDisk=pv(t.entriesOnDisk,`entriesOnDisk`)),e.centralDirSize===4294967295&&(e.centralDirSize=pv(t.centralDirSize,`centralDirSize`)),e.centralDirOffset===4294967295&&(e.centralDirOffset=pv(t.centralDirOffset,`centralDirOffset`))}function xv(e,t,n){let r=e.readUint16();e.skip(2);let i=e.readUint16(),a=e.readUint16(),o=e.readUint16(),s=e.readUint16(),c=e.readUint32(),l=e.readUint32(),u=e.readUint32(),d=e.readUint16(),f=e.readUint16(),p=e.readUint16();e.skip(2),e.skip(2);let m=e.readUint32(),h=e.readUint32(),g=d>0?e.readBytes(d):new Uint8Array,_={},v=new Uint8Array;if(f>0){v=e.readBytes(f);let t={compressedSize:l,uncompressedSize:u,offsetToLocalFileHeader:h};_=wo(v,t),l=t.compressedSize,u=t.uncompressedSize,h=t.offsetToLocalFileHeader??h}let y=p>0?e.readBytes(p):new Uint8Array,b=t?xa(g,i,_,n):``,x=t?Sa(y,i,_,n):``,S=Fo(m),ee=r>>8&255,te=Io(S),ne=Lo(S)||ee===0&&(m&16)!=0||b.endsWith(`/`),re=(i&1)!=0,ie=te?`symlink`:ne?`directory`:`file`,ae=_.mtimeUnixSeconds,oe=Ia(s,o,ae),se=`none`,ce,le,ue;return re&&(a===99&&_.aesInfo?(se=`aes`,ce=_.aesInfo.version,le=_.aesInfo.keyStrength,ue=_.aesInfo.compressionMethod):se=`zipcrypto`),{path:b,type:ie,compressedSize:l,compressedSize64:_.compressedSize64,uncompressedSize:u,uncompressedSize64:_.uncompressedSize64,compressionMethod:a,crc32:c,lastModified:oe,localHeaderOffset:h,localHeaderOffset64:_.offsetToLocalFileHeader64,comment:x,externalAttributes:m,mode:S,versionMadeBy:r,extraField:v,isEncrypted:re,encryptionMethod:se,aesVersion:ce,aesKeyStrength:le,originalCompressionMethod:ue,dosTime:o}}function Sv(e,t,n,r={}){let i=r.decodeStrings??!0,a=mv(r);if(n===0)return[];let o=Array(n),s=new Ea(e,t);for(let e=0;e<n;e++){if(s.readUint32()!==33639248)throw Error(`Invalid Central Directory header signature at entry ${e}`);o[e]=xv(s,i,a)}return o}function Cv(e,t={}){let n=t.decodeStrings??!0,r=mv(t),i=hv(e);if(i===-1)throw Error(`Invalid ZIP file: End of Central Directory not found`);let{eocd:a,comment:o}=_v(e,i,n,r),s=gv(e,i);if(s!==-1){let t=vv(e,s);if(t>=0){let n=yv(e,t);n&&bv(a,n)}}return{entries:Sv(e,a.centralDirOffset,a.totalEntries,t),comment:o}}let wv=512*1024*1024;async function Tv(e,t,n,r=!1,i=!0){let a;if(i&&e.uncompressedSize>wv)throw Error(`Entry "${e.path}" declares uncompressed size of ${e.uncompressedSize} bytes, which exceeds the maximum allowed size of ${wv} bytes. Use the streaming API for large entries.`);if(e.isEncrypted){if(!n)throw new na(e.path);if(e.encryptionMethod===`aes`&&e.aesKeyStrength){let r=await ho(t,n,e.aesKeyStrength);if(!r)throw new ta(e.path);a=await Dv(r,e.originalCompressionMethod??0,e.path)}else if(e.encryptionMethod===`zipcrypto`){let r=yp(t,n,e.crc32,e.dosTime);if(!r)throw new ta(e.path);a=await Dv(r,e.compressionMethod,e.path)}else throw new ta(e.path,`Unsupported encryption method`)}else a=await Dv(t,e.compressionMethod,e.path);if(i&&a.length!==e.uncompressedSize){let t=a.length>e.uncompressedSize?`too-many-bytes`:`too-few-bytes`;throw new ea(e.path,e.uncompressedSize,a.length,t)}if(e.encryptionMethod===`zipcrypto`||r&&e.encryptionMethod!==`aes`){let t=ca(a);if(t!==e.crc32)throw new $i(e.path,e.crc32,t)}return a}function Ev(e,t,n,r=!0){let i;if(r&&e.uncompressedSize>wv)throw Error(`Entry "${e.path}" declares uncompressed size of ${e.uncompressedSize} bytes, which exceeds the maximum allowed size of ${wv} bytes. Use the streaming API for large entries.`);if(e.isEncrypted){if(!n)throw new na(e.path);if(e.encryptionMethod===`aes`)throw Error(`File "${e.path}" uses AES encryption. Use the async extract() method instead of extractSync().`);if(e.encryptionMethod===`zipcrypto`){let r=yp(t,n,e.crc32,e.dosTime);if(!r)throw new ta(e.path);i=Ov(r,e.compressionMethod,e.path);let a=ca(i);if(a!==e.crc32)throw new $i(e.path,e.crc32,a)}else throw new ta(e.path,`Unsupported encryption method`)}else i=Ov(t,e.compressionMethod,e.path);if(r&&i.length!==e.uncompressedSize){let t=i.length>e.uncompressedSize?`too-many-bytes`:`too-few-bytes`;throw new ea(e.path,e.uncompressedSize,i.length,t)}return i}async function Dv(e,t,n){if(t===0)return e;if(t===8)return $f(e);throw new ra(t)}function Ov(e,t,n){if(t===0)return e;if(t===8)return ep(e);throw new ra(t)}function kv(e,t){if(e.readUint32()!==67324752)throw Error(`Invalid local file header signature at offset ${t}`);e.skip(2),e.skip(2),e.skip(2),e.skip(2),e.skip(2),e.skip(4),e.skip(4),e.skip(4);let n=e.readUint16(),r=e.readUint16();return e.skip(n),e.skip(r),e.position}function Av(e,t){let n=kv(new Ea(e,t.localHeaderOffset),t.localHeaderOffset);return e.subarray(n,n+t.compressedSize)}let jv=BigInt(2**53-1);function Mv(e){if(e.uncompressedSize64!==void 0&&e.uncompressedSize64>jv||e.compressedSize64!==void 0&&e.compressedSize64>jv)throw Error(`File "${e.path}" is too large to extract into memory (ZIP64 size > 2^53-1)`);if(e.localHeaderOffset64!==void 0&&e.localHeaderOffset64>jv)throw Error(`File "${e.path}" has a ZIP64 offset > 2^53-1 and cannot be extracted by the in-memory parser`)}function Nv(e,t={}){return Cv(e,{decodeStrings:t.decodeStrings,encoding:t.encoding})}async function Pv(e,t,n={}){return t.type===`directory`?ai:(Mv(t),Tv(t,Av(e,t),n.password))}function Fv(e,t,n={}){return t.type===`directory`?ai:(Mv(t),Ev(t,Av(e,t),n.password))}var Iv=class{constructor(e,t={}){this.data=e instanceof ArrayBuffer?new Uint8Array(e):e;let n=Nv(this.data,t);this.entries=n.entries,this.archiveComment=n.comment,this.entryMap=new Map(this.entries.map(e=>[e.path,e])),this.password=t.password}setPassword(e){this.password=e}getEntries(){return this.entries}getEntry(e){return this.entryMap.get(e)}getRawCompressedData(e){let t=this.entryMap.get(e);return t?Av(this.data,t):null}getRawEntry(e){let t=this.entryMap.get(e);return t?{info:t,compressedData:Av(this.data,t)}:null}hasEntry(e){return this.entryMap.has(e)}childCount(e){let t=this.entryMap.get(e);if(t&&t.type!==`directory`)return 0;let n=e.endsWith(`/`)?e:e+`/`,r=t?.type===`directory`?t:this.entryMap.get(n),i=(r?.path??n).endsWith(`/`)?r?.path??n:(r?.path??n)+`/`,a=0;for(let e of this.entries)e.path.startsWith(i)&&e.path!==i&&a++;return a}getZipComment(){return this.archiveComment}hasEncryptedEntries(){return this.entries.some(e=>e.isEncrypted)}getEncryptedEntries(){return this.entries.filter(e=>e.isEncrypted)}listFiles(){return this.entries.map(e=>e.path)}async extract(e,t){let n=this.entryMap.get(e);return n?Pv(this.data,n,{password:t??this.password}):null}extractSync(e,t){let n=this.entryMap.get(e);return n?Fv(this.data,n,{password:t??this.password}):null}async extractAll(e){let t=new Map,n=e??this.password;for(let e of this.entries){let r=await Pv(this.data,e,{password:n});t.set(e.path,r)}return t}extractAllSync(e){let t={},n=e??this.password;for(let e of this.entries)t[e.path]=Fv(this.data,e,{password:n});return t}async forEach(e,t){let n=t??this.password;for(let t of this.entries){let r=null;if(await e(t,()=>(r||=Pv(this.data,t,{password:n}),r))===!1)break}}};let Lv=/\[([^\]\\/:*?"<>|\s]+)\]([A-Za-z_\u00A1-\uFFFF][A-Za-z0-9_\u00A1-\uFFFF.]*)!/g,Rv=/'\[([^\]]+)\]((?:''|[^'])+)'!/g;function zv(e){if(e.indexOf(`[`)===-1)return[];let t=[],n=Vv(e),r=(e,r,i,a,o,s)=>{if(Hv(e,n))return;let c=/^\d+$/.test(i);t.push({match:s,workbook:i,numeric:c,index:c?parseInt(i,10):null,sheet:Uv(a),quoted:o,start:e,end:r})};Lv.lastIndex=0;let i;for(;(i=Lv.exec(e))!==null;)r(i.index,i.index+i[0].length,i[1],i[2],!1,i[0]);for(Rv.lastIndex=0;(i=Rv.exec(e))!==null;)r(i.index,i.index+i[0].length,i[1],i[2],!0,i[0]);t.sort((e,t)=>e.start-t.start);let a=[],o=-1;for(let e of t)e.start>=o&&(a.push(e),o=e.end);return a}function Bv(e,t){let n=zv(e);if(n.length===0)return e;let r=``,i=0;for(let a of n){let n=t(a);if(n!==null){if(r+=e.slice(i,a.start),a.quoted){let t=e.slice(a.start+1,a.end-2);r+=`'`+t.replace(/^\[[^\]]*\]/,`[${n}]`)+`'!`}else r+=`[${n}]${a.match.slice(a.match.indexOf(`]`)+1)}`;i=a.end}}return r+=e.slice(i),r}function Vv(e){if(e.indexOf(`"`)===-1)return[];let t=[],n=e.length,r=0;for(;r<n;)if(e[r]===`"`){let i=r;for(r++;r<n;){if(e[r]===`"`){if(r+1<n&&e[r+1]===`"`){r+=2;continue}r++;break}r++}t.push([i,r])}else r++;return t}function Hv(e,t){for(let[n,r]of t)if(e>=n&&e<r)return!0;return!1}function Uv(e){return e.replace(/''/g,`'`)}let Wv=new Map([[/^xl\/charts\/chart\d+\.xml$/,`application/vnd.openxmlformats-officedocument.drawingml.chart+xml`],[/^xl\/charts\/style\d+\.xml$/,`application/vnd.ms-office.chartstyle+xml`],[/^xl\/charts\/colors\d+\.xml$/,`application/vnd.ms-office.chartcolorstyle+xml`]]),Gv=[`xl/charts/`];var Kv=class e{constructor(){this.files=new Map}static isPassthroughPath(e){return Gv.some(t=>e.startsWith(t))}static getContentType(e){if(!e.startsWith(`xl/charts/_rels/`)){for(let[t,n]of Wv)if(t.test(e))return n}}add(e,t){this.files.set(e,t)}get(e){return this.files.get(e)}has(e){return this.files.has(e)}getPaths(){return[...this.files.keys()]}toRecord(){let e={};for(let[t,n]of this.files)e[t]=n;return e}fromRecord(e){this.files.clear();for(let[t,n]of Object.entries(e))this.files.set(t,n)}getContentTypes(){let t=[];for(let n of this.files.keys()){let r=e.getContentType(n);r&&t.push({partName:n,contentType:r})}return t}writeToZip(e){for(let[t,n]of this.files)e.append(n,{name:t})}clear(){this.files.clear()}get size(){return this.files.size}};let qv={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`};var Jv=class extends N{constructor(...e){super(...e),this.sheetNamesByIndex=[],this.currentSheetCells=null,this.currentSheetName=null,this.currentCellAddress=null,this.currentCellType=`n`,this.currentCellValue=null,this.inV=!1}get tag(){return`externalLink`}reset(){super.reset(),this.sheetNamesByIndex=[],this.currentSheetCells=null,this.currentSheetName=null,this.currentCellAddress=null,this.currentCellType=`n`,this.currentCellValue=null,this.inV=!1}render(e,t){if(e.openXml(A),e.openNode(`externalLink`,qv),e.openNode(`externalBook`,{"r:id":`rId1`}),t.sheetNames.length>0){e.openNode(`sheetNames`);for(let n of t.sheetNames)e.leafNode(`sheetName`,{val:n});e.closeNode()}let n=t.cachedValues??{};if(Object.keys(n).some(e=>{let t=n[e];return t&&Object.keys(t).length>0})){e.openNode(`sheetDataSet`);for(let r=0;r<t.sheetNames.length;r++){let i=n[t.sheetNames[r]];!i||Object.keys(i).length===0||Yv(e,r,i)}e.closeNode()}e.closeNode(),e.closeNode()}parseOpen(e){switch(e.name){case`externalLink`:return this.model={externalBookRId:``,sheetNames:[],cachedValues:{}},this.sheetNamesByIndex=[],!0;case`externalBook`:return this.model&&(this.model.externalBookRId=e.attributes[`r:id`]??``),!0;case`sheetName`:if(this.model){let t=e.attributes.val??``;this.model.sheetNames.push(t),this.sheetNamesByIndex.push(t)}return!0;case`sheetData`:{let t=e.attributes.sheetId,n=t===void 0?NaN:parseInt(t,10);return this.currentSheetName=Number.isFinite(n)?this.sheetNamesByIndex[n]??null:null,this.currentSheetCells=this.currentSheetName?{}:null,!0}case`cell`:return this.currentCellAddress=e.attributes.r??null,this.currentCellType=e.attributes.t??`n`,this.currentCellValue=null,!0;case`v`:return this.inV=!0,this.currentCellValue=``,!0;default:return!1}}parseText(e){this.inV&&(this.currentCellValue=(this.currentCellValue??``)+e)}parseClose(e){switch(e){case`v`:return this.inV=!1,!0;case`cell`:return this.model&&this.currentSheetCells&&this.currentCellAddress&&(this.currentSheetCells[this.currentCellAddress.toUpperCase()]=ny(this.currentCellType,this.currentCellValue)),this.currentCellAddress=null,this.currentCellType=`n`,this.currentCellValue=null,!0;case`sheetData`:return this.model&&this.currentSheetName&&this.currentSheetCells&&Object.keys(this.currentSheetCells).length>0&&(this.model.cachedValues[this.currentSheetName]=this.currentSheetCells),this.currentSheetName=null,this.currentSheetCells=null,!0;case`externalLink`:return!1;default:return!0}}};function Yv(e,t,n){let r=Xv(n);e.openNode(`sheetData`,{sheetId:t});for(let t of r){e.openNode(`row`,{r:t.rowNum});for(let{address:n,value:r}of t.cells)$v(e,n,r);e.closeNode()}e.closeNode()}function Xv(e){let t=new Map;for(let n of Object.keys(e)){let r=n.toUpperCase(),i=Zv(r);if(i===void 0)continue;let a=t.get(i);a||(a={rowNum:i,cells:[]},t.set(i,a)),a.cells.push({address:Qv(r),value:e[n]})}return[...t.values()].sort((e,t)=>e.rowNum-t.rowNum)}function Zv(e){let t=/^\$?[A-Z]+\$?(\d+)$/.exec(e);return t?parseInt(t[1],10):void 0}function Qv(e){return e.replace(/\$/g,``)}function $v(e,t,n){if(n==null){e.leafNode(`cell`,{r:t});return}if(typeof n==`number`){e.openNode(`cell`,{r:t}),e.leafNode(`v`,void 0,String(n)),e.closeNode();return}if(typeof n==`boolean`){e.openNode(`cell`,{r:t,t:`b`}),e.leafNode(`v`,void 0,n?`1`:`0`),e.closeNode();return}if(ty(n)){e.openNode(`cell`,{r:t,t:`e`}),e.leafNode(`v`,void 0,n),e.closeNode();return}e.openNode(`cell`,{r:t,t:`str`}),e.leafNode(`v`,void 0,n),e.closeNode()}let ey=new Set([`#NULL!`,`#DIV/0!`,`#VALUE!`,`#REF!`,`#NAME?`,`#NUM!`,`#N/A`,`#GETTING_DATA`,`#SPILL!`,`#CALC!`,`#CONNECT!`,`#BLOCKED!`,`#UNKNOWN!`,`#FIELD!`,`#PYTHON!`]);function ty(e){return ey.has(e)}function ny(e,t){if(t===null||t===``)return null;switch(e){case`b`:return t!==`0`&&t.toLowerCase()!==`false`;case`e`:return t;case`str`:return t;default:{let e=Number(t);return Number.isFinite(e)?e:t}}}let ry=`Author`;var iy=class e extends N{constructor(){super(),this._authors=[],this._inAuthors=!1,this._inAuthor=!1,this._currentAuthor=``,this.map={comment:new rm},this.model={comments:[]}}render(t,n){let r=n||this.model;t.openXml(A),t.openNode(`comments`,e.COMMENTS_ATTRIBUTES);let i=new Set;for(let e of r.comments)i.add(e.author??ry);let a=[...i];t.openNode(`authors`);for(let e of a)t.leafNode(`author`,null,e);t.closeNode(),t.openNode(`commentList`),r.comments.forEach(e=>{let n=a.indexOf(e.author??ry);this.map.comment.render(t,{...e,authorId:n>=0?n:0})}),t.closeNode(),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`authors`:return this._inAuthors=!0,this._authors=[],!0;case`author`:return this._inAuthors&&(this._inAuthor=!0,this._currentAuthor=``),!0;case`commentList`:return this.model={comments:[]},!0;case`comment`:return this.parser=this.map.comment,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this._inAuthor?this._currentAuthor+=e:this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case`authors`:return this._inAuthors=!1,!0;case`author`:return this._inAuthors&&(this._authors.push(this._currentAuthor),this._inAuthor=!1,this._currentAuthor=``),!0;case`commentList`:for(let e of this.model.comments){let{authorId:t}=e;t!=null&&t>=0&&t<this._authors.length&&(e.author=this._authors[t])}return!1;case`comment`:return this.model.comments.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}static{this.COMMENTS_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`}}},ay=class extends N{_checkedToXmlValue(e){switch(e){case`Checked`:return`1`;case`Mixed`:return`2`;default:return`0`}}get tag(){return`formControlPr`}render(e,t){let n=t||this.model,r={xmlns:`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`,objectType:`CheckBox`,checked:this._checkedToXmlValue(n.checked),lockText:`1`};n.link&&(r.fmlaLink=n.link),n.noThreeD&&(r.noThreeD=`1`),e.openXml({version:`1.0`,encoding:`UTF-8`,standalone:`yes`}),e.leafNode(this.tag,r)}toXml(e){let t=new Id;return this.render(t,e),t.xml}parseOpen(){return!0}parseText(){}parseClose(){return!1}},oy=class e extends N{constructor(){super(),this._parsingHeaderImage=!1,this.map={"v:shape":new um},this.model={comments:[],formControls:[]}}get tag(){return`xml`}render(t,n){let r=n||this.model,i=r.comments,a=r.formControls,o=r.headerImage,s=i&&i.length>0,c=a&&a.length>0,l=!!o;if(t.openXml(A),t.openNode(this.tag,e.DRAWING_ATTRIBUTES),t.openNode(`o:shapelayout`,{"v:ext":`edit`}),t.leafNode(`o:idmap`,{"v:ext":`edit`,data:1}),t.closeNode(),s&&(t.openNode(`v:shapetype`,{id:`_x0000_t202`,coordsize:`21600,21600`,"o:spt":202,path:`m,l,21600r21600,l21600,xe`}),t.leafNode(`v:stroke`,{joinstyle:`miter`}),t.leafNode(`v:path`,{gradientshapeok:`t`,"o:connecttype":`rect`}),t.closeNode()),c&&(t.openNode(`v:shapetype`,{id:`_x0000_t201`,coordsize:`21600,21600`,"o:spt":`201`,path:`m,l,21600r21600,l21600,xe`}),t.leafNode(`v:stroke`,{joinstyle:`miter`}),t.leafNode(`v:path`,{shadowok:`f`,"o:extrusionok":`f`,strokeok:`f`,fillok:`f`,"o:connecttype":`rect`}),t.leafNode(`o:lock`,{"v:ext":`edit`,shapetype:`t`}),t.closeNode()),l&&(t.openNode(`v:shapetype`,{id:`_x0000_t75`,coordsize:`21600,21600`,"o:spt":`75`,"o:preferrelative":`t`,path:`m@4@5l@4@11@9@11@9@5xe`,filled:`f`,stroked:`f`}),t.leafNode(`v:stroke`,{joinstyle:`miter`}),t.openNode(`v:formulas`),t.leafNode(`v:f`,{eqn:`if lineDrawn pixelLineWidth 0`}),t.leafNode(`v:f`,{eqn:`sum @0 1 0`}),t.leafNode(`v:f`,{eqn:`sum 0 0 @1`}),t.leafNode(`v:f`,{eqn:`prod @2 1 2`}),t.leafNode(`v:f`,{eqn:`prod @3 21600 pixelWidth`}),t.leafNode(`v:f`,{eqn:`prod @3 21600 pixelHeight`}),t.leafNode(`v:f`,{eqn:`sum @0 0 1`}),t.leafNode(`v:f`,{eqn:`prod @6 1 2`}),t.leafNode(`v:f`,{eqn:`prod @7 21600 pixelWidth`}),t.leafNode(`v:f`,{eqn:`sum @8 21600 0`}),t.leafNode(`v:f`,{eqn:`prod @7 21600 pixelHeight`}),t.leafNode(`v:f`,{eqn:`sum @10 21600 0`}),t.closeNode(),t.leafNode(`v:path`,{"o:extrusionok":`f`,gradientshapeok:`t`,"o:connecttype":`rect`}),t.leafNode(`o:lock`,{"v:ext":`edit`,aspectratio:`t`}),t.closeNode()),s)for(let e=0;e<i.length;e++)this.map[`v:shape`].render(t,i[e],e);if(c)for(let e of a)this._renderCheckboxShape(t,e);l&&this._renderHeaderImageShape(t,o),t.closeNode()}_renderHeaderImageShape(e,t){let n=t.width??467.25,r=t.height??311.25;e.openNode(`v:shape`,{id:`CH`,"o:spid":`_x0000_s2049`,type:`#_x0000_t75`,style:`position:absolute;margin-left:0;margin-top:0;width:${n}pt;height:${r}pt;z-index:1`}),e.leafNode(`v:imagedata`,{"o:relid":t.imageRelId,"o:title":`watermark`}),e.leafNode(`o:lock`,{"v:ext":`edit`,rotation:`t`}),e.closeNode()}_renderCheckboxShape(e,t){let n={id:`_x0000_s${t.shapeId}`,type:`#_x0000_t201`,style:Bg.getVmlStyle(t),"o:insetmode":`auto`,fillcolor:`buttonFace [67]`,strokecolor:`windowText [64]`,"o:preferrelative":`t`,filled:`f`,stroked:`f`};e.openNode(`v:shape`,n),e.leafNode(`v:fill`,{"o:detectmouseclick":`t`}),e.leafNode(`o:lock`,{"v:ext":`edit`,text:`t`}),t.text&&(e.openNode(`v:textbox`,{style:`mso-direction-alt:auto`,"o:singleclick":`t`}),e.openNode(`div`,{style:`text-align:left`}),e.openNode(`font`,{face:`Tahoma`,size:`160`,color:`auto`}),e.writeText(t.text),e.closeNode(),e.closeNode(),e.closeNode()),e.openNode(`x:ClientData`,{ObjectType:`Checkbox`}),e.leafNode(`x:MoveWithCells`),e.leafNode(`x:SizeWithCells`),e.openNode(`x:Anchor`),e.writeText(Bg.getVmlAnchor(t)),e.closeNode(),e.leafNode(`x:Locked`,void 0,`False`),e.leafNode(`x:LockText`,void 0,`True`),e.leafNode(`x:PrintObject`,void 0,t.print?`True`:`False`),e.leafNode(`x:AutoFill`,void 0,`False`),e.leafNode(`x:AutoLine`,void 0,`False`),e.leafNode(`x:TextHAlign`,void 0,`Left`),e.leafNode(`x:TextVAlign`,void 0,`Center`),t.link&&e.leafNode(`x:FmlaLink`,void 0,t.link),t.noThreeD&&e.leafNode(`x:NoThreeD`),e.leafNode(`x:Checked`,void 0,String(Bg.getVmlCheckedValue(t))),e.leafNode(`x:Row`,void 0,String(t.tl.row)),e.leafNode(`x:Column`,void 0,String(t.tl.col)),e.closeNode(),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={comments:[],formControls:[]};break;case`v:shape`:if(e.attributes.type===`#_x0000_t75`){this._parsingHeaderImage=!0;let t=e.attributes.style||``,n=/width:([0-9.]+)pt/.exec(t),r=/height:([0-9.]+)pt/.exec(t);this._headerImageWidth=n?parseFloat(n[1]):void 0,this._headerImageHeight=r?parseFloat(r[1]):void 0}else this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break;default:this._parsingHeaderImage&&e.name===`v:imagedata`?this._headerImageRelId=e.attributes[`o:relid`]:(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e));break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.comments.push(this.parser.model),this.parser=void 0),!0;switch(e){case`v:shape`:return this._parsingHeaderImage&&this._headerImageRelId&&(this.model.headerImage={imageRelId:this._headerImageRelId,width:this._headerImageWidth,height:this._headerImageHeight}),this._parsingHeaderImage=!1,this._headerImageRelId=void 0,this._headerImageWidth=void 0,this._headerImageHeight=void 0,!0;case this.tag:return!1;default:return!0}}static{this.DRAWING_ATTRIBUTES={"xmlns:v":`urn:schemas-microsoft-com:vml`,"xmlns:o":`urn:schemas-microsoft-com:office:office`,"xmlns:x":`urn:schemas-microsoft-com:office:excel`}}};function sy(e){return isNaN(e.getTime())?``:e.toISOString().replace(/\.\d{3}Z$/,``)}function cy(e){let t=Mc(e.name),n=e.numFmtId??`0`,r=uy(e.extraAttrs),i=e.fieldGroupXml?`\n ${e.fieldGroupXml}`:``;if(e.sharedItems===null){if(e.isLoaded)return i?`<cacheField name="${t}" numFmtId="${n}"${r}>${i}\n </cacheField>`:`<cacheField name="${t}" numFmtId="${n}"${r} />`;let a;return a=e.minValue!==void 0&&e.maxValue!==void 0?` containsSemiMixedTypes="0" containsString="0" containsNumber="1"${e.containsInteger?` containsInteger="1"`:``} minValue="${e.minValue}" maxValue="${e.maxValue}"`:``,`<cacheField name="${t}" numFmtId="${n}"${r}>
|
|
406
406
|
<sharedItems${a} />${i}
|
|
407
407
|
</cacheField>`}if(e.isLoaded&&e.sharedItems.length===0)return`<cacheField name="${t}" numFmtId="${n}"${r}>
|
|
408
|
-
<sharedItems${
|
|
409
|
-
</cacheField>`;if(e.isLoaded){let a=
|
|
410
|
-
<sharedItems${
|
|
408
|
+
<sharedItems${dy(e)} />${i}
|
|
409
|
+
</cacheField>`;if(e.isLoaded){let a=ly(e.sharedItems);return`<cacheField name="${t}" numFmtId="${n}"${r}>
|
|
410
|
+
<sharedItems${dy(e)} count="${e.sharedItems.length}">
|
|
411
411
|
${a}
|
|
412
412
|
</sharedItems>${i}
|
|
413
|
-
</cacheField>`}let a=!1,o=!1,s=!1,c=!1,l=!1,u=!1,d=!0,f=1/0,p=-1/0;for(let t of e.sharedItems)t===null?l=!0:t instanceof
|
|
413
|
+
</cacheField>`}let a=!1,o=!1,s=!1,c=!1,l=!1,u=!1,d=!0,f=1/0,p=-1/0;for(let t of e.sharedItems)t===null?l=!0:t instanceof Hg?u=!0:typeof t==`string`?a=!0:typeof t==`number`?Number.isFinite(t)?(o=!0,t<f&&(f=t),t>p&&(p=t),Number.isInteger(t)||(d=!1)):l=!0:typeof t==`boolean`?s=!0:t instanceof Date&&(c=!0);let m=[];a||(m.push(`containsSemiMixedTypes="0"`),m.push(`containsString="0"`)),+!!a+ +!!o+ +!!s+ +!!c+ +!!u>1&&m.push(`containsMixedTypes="1"`),o&&(m.push(`containsNumber="1"`),d&&m.push(`containsInteger="1"`),m.push(`minValue="${f}"`),m.push(`maxValue="${p}"`)),c&&m.push(`containsDate="1"`),l&&m.push(`containsBlank="1"`);let h=ly(e.sharedItems);return`<cacheField name="${t}" numFmtId="${n}"${r}>
|
|
414
414
|
<sharedItems${m.length>0?` ${m.join(` `)}`:``} count="${e.sharedItems.length}">
|
|
415
415
|
${h}
|
|
416
416
|
</sharedItems>${i}
|
|
417
|
-
</cacheField>`}function Gv(e){let t=[];for(let n of e)n===null?t.push(`<m />`):n instanceof wg?t.push(`<e v="${R(n.code)}" />`):typeof n==`number`?Number.isFinite(n)?t.push(`<n v="${n}" />`):t.push(`<m />`):typeof n==`boolean`?t.push(`<b v="${n?`1`:`0`}" />`):n instanceof Date?t.push(`<d v="${Uv(n)}" />`):t.push(`<s v="${R(n)}" />`);return t.join(``)}function Kv(e){return e?Object.entries(e).map(([e,t])=>` ${e}="${R(t)}"`).join(``):``}function qv(e){let t=[];return e.containsSemiMixedTypes!==void 0&&t.push(`containsSemiMixedTypes="${e.containsSemiMixedTypes}"`),e.containsNonDate!==void 0&&t.push(`containsNonDate="${e.containsNonDate}"`),e.containsString!==void 0&&t.push(`containsString="${e.containsString}"`),e.containsBlank!==void 0&&t.push(`containsBlank="${e.containsBlank}"`),e.containsMixedTypes!==void 0&&t.push(`containsMixedTypes="${e.containsMixedTypes}"`),e.containsNumber!==void 0&&t.push(`containsNumber="${e.containsNumber}"`),e.containsInteger!==void 0&&t.push(`containsInteger="${e.containsInteger}"`),e.minValue!==void 0&&t.push(`minValue="${e.minValue}"`),e.maxValue!==void 0&&t.push(`maxValue="${e.maxValue}"`),e.containsDate!==void 0&&t.push(`containsDate="${e.containsDate}"`),t.length>0?` ${t.join(` `)}`:``}var Jv=class{constructor(e){this.active=!1,this.depth=0,this.buffer=[],this.lastOpenIndex=-1,this.rootTag=e}start(e){this.active=!0,this.depth=0;let t=Yv(e);this.buffer=[`<${this.rootTag}${t?` `+t:``}>`]}startAs(e,t){this.rootTag=e,this.start(t)}reset(){this.active=!1,this.depth=0,this.buffer.length=0,this.lastOpenIndex=-1}feedOpen(e,t){let n=Yv(t);this.buffer.push(`<${e}${n?` `+n:``}>`),this.depth++,this.lastOpenIndex=this.buffer.length-1}feedText(e){this.buffer.push(R(e)),this.lastOpenIndex=-1}feedClose(e){if(e===this.rootTag&&this.depth===0)return this.buffer.push(`</${e}>`),this.active=!1,this.lastOpenIndex=-1,!0;if(this.depth>0&&this.depth--,this.lastOpenIndex>=0&&this.lastOpenIndex===this.buffer.length-1){let e=this.buffer[this.lastOpenIndex];return this.buffer[this.lastOpenIndex]=e.slice(0,-1)+` />`,this.lastOpenIndex=-1,!1}return this.lastOpenIndex=-1,this.buffer.push(`</${e}>`),!1}get result(){return this.buffer.join(``)}};function Yv(e){if(!e)return``;let t=Object.entries(e);return t.length===0?``:t.filter(([,e])=>e!=null).map(([e,t])=>`${e}="${R(String(t))}"`).join(` `)}let Xv=new Set([`name`,`numFmtId`]);var Zv=class extends U{constructor(){super(),this.inSharedItems=!1,this.fieldGroupCollector=new Jv(`fieldGroup`),this.model=null}get tag(){return`cacheField`}reset(){this.model=null,this.inSharedItems=!1,this.fieldGroupCollector.reset()}parseOpen(e){let{name:t,attributes:n}=e;if(this.fieldGroupCollector.active)return this.fieldGroupCollector.feedOpen(t,n),!0;switch(t){case`cacheField`:{let e={};for(let[t,r]of Object.entries(n))Xv.has(t)||(e[t]=String(r));this.model={name:n.name??``,sharedItems:null,numFmtId:n.numFmtId,isLoaded:!0,extraAttrs:Object.keys(e).length>0?e:void 0};break}case`fieldGroup`:this.model&&this.fieldGroupCollector.start(n);break;case`sharedItems`:if(this.inSharedItems=!0,this.model){if(n.containsNumber!==void 0&&(this.model.containsNumber=n.containsNumber),n.containsInteger!==void 0&&(this.model.containsInteger=n.containsInteger),n.minValue!==void 0){let e=parseFloat(n.minValue);Number.isFinite(e)&&(this.model.minValue=e)}if(n.maxValue!==void 0){let e=parseFloat(n.maxValue);Number.isFinite(e)&&(this.model.maxValue=e)}n.containsSemiMixedTypes!==void 0&&(this.model.containsSemiMixedTypes=n.containsSemiMixedTypes),n.containsNonDate!==void 0&&(this.model.containsNonDate=n.containsNonDate),n.containsString!==void 0&&(this.model.containsString=n.containsString),n.containsBlank!==void 0&&(this.model.containsBlank=n.containsBlank),n.containsDate!==void 0&&(this.model.containsDate=n.containsDate),n.containsMixedTypes!==void 0&&(this.model.containsMixedTypes=n.containsMixedTypes),this.model.sharedItems=[]}break;case`s`:case`n`:case`b`:case`e`:case`m`:case`d`:this.inSharedItems&&this.model&&this.model.sharedItems!==null&&this.model.sharedItems.push(Qv(t,n));break}return!0}parseText(e){this.fieldGroupCollector.active&&this.fieldGroupCollector.feedText(e)}parseClose(e){if(this.fieldGroupCollector.active)return this.fieldGroupCollector.feedClose(e)&&(this.model&&(this.model.fieldGroupXml=this.fieldGroupCollector.result),this.fieldGroupCollector.reset()),!0;switch(e){case`cacheField`:return!1;case`sharedItems`:this.inSharedItems=!1;break}return!0}};function Qv(e,t){switch(e){case`s`:return t.v??``;case`n`:return t.v===void 0||t.v===``?null:parseFloat(t.v);case`b`:return t.v===`1`;case`e`:return new wg(t.v??``);case`m`:return null;case`d`:{if(!t.v)return null;let e=Mc(t.v);return isNaN(e.getTime())?null:e}default:return null}}let $v=new Set([`xmlns`,`xmlns:r`,`r:id`,`refreshOnLoad`,`createdVersion`,`refreshedVersion`,`minRefreshableVersion`,`recordCount`,`backgroundQuery`,`supportSubquery`,`supportAdvancedDrill`]);var ey=class e extends U{constructor(){super(),this.currentCacheField=null,this.inCacheFields=!1,this.inCacheSource=!1,this.extLstCollector=new Jv(`extLst`),this.unknownCollector=new Jv(``),this.unknownElementsXmlParts=[],this.cacheSourceChildCollector=new Jv(``),this.cacheSourceXmlParts=[],this.model=null}get tag(){return`pivotCacheDefinition`}reset(){this.model=null,this.currentCacheField=null,this.inCacheFields=!1,this.inCacheSource=!1,this.extLstCollector.reset(),this.unknownCollector.reset(),this.unknownElementsXmlParts=[],this.cacheSourceChildCollector.reset(),this.cacheSourceXmlParts=[]}render(e,t){`isLoaded`in t&&t.isLoaded||!(`source`in t)?this.renderLoaded(e,t):this.renderNew(e,t)}renderNew(t,n){let{source:r,cacheFields:i}=n,a=r.getSheetValues().slice(2).filter(Array.isArray).length;t.openXml(z),t.openNode(this.tag,{...e.PIVOT_CACHE_DEFINITION_ATTRIBUTES,"r:id":`rId1`,refreshOnLoad:`1`,createdVersion:`8`,refreshedVersion:`8`,minRefreshableVersion:`3`,recordCount:a}),t.openNode(`cacheSource`,{type:`worksheet`});let o=r.tableName?{name:r.tableName}:{ref:r.dimensions.shortRange,sheet:r.name};t.leafNode(`worksheetSource`,o),t.closeNode(),t.openNode(`cacheFields`,{count:i.length}),t.writeRaw(e.renderCacheFieldsXml(i)),t.closeNode(),t.closeNode()}renderLoaded(t,n){let{cacheFields:r,sourceRef:i,sourceSheet:a,sourceTableName:o,recordCount:s}=n;t.openXml(z);let c={...e.PIVOT_CACHE_DEFINITION_ATTRIBUTES,"r:id":n.rId??`rId1`};if(n.refreshOnLoad&&(c.refreshOnLoad=n.refreshOnLoad),c.createdVersion=n.createdVersion??`8`,c.refreshedVersion=n.refreshedVersion??`8`,c.minRefreshableVersion=n.minRefreshableVersion??`3`,s!==void 0&&(c.recordCount=s),n.backgroundQuery&&(c.backgroundQuery=n.backgroundQuery),n.supportSubquery&&(c.supportSubquery=n.supportSubquery),n.supportAdvancedDrill&&(c.supportAdvancedDrill=n.supportAdvancedDrill),n.extraRootAttrs)for(let[e,t]of Object.entries(n.extraRootAttrs))c[e]=t;if(t.openNode(this.tag,c),t.openNode(`cacheSource`,{type:n.cacheSourceType??`worksheet`}),!n.cacheSourceType||n.cacheSourceType===`worksheet`){let e=o?{name:o}:{ref:i,sheet:a};n.worksheetSourceRId&&(e[`r:id`]=n.worksheetSourceRId),Object.values(e).some(e=>e!==void 0)&&t.leafNode(`worksheetSource`,e)}n.cacheSourceXml&&t.writeRaw(n.cacheSourceXml),t.closeNode(),t.openNode(`cacheFields`,{count:r.length}),t.writeRaw(e.renderCacheFieldsXml(r)),t.closeNode(),n.unknownElementsXml&&t.writeRaw(n.unknownElementsXml),n.extLstXml&&t.writeRaw(n.extLstXml),t.closeNode()}parseOpen(e){let{name:t,attributes:n}=e;if(this.extLstCollector.active)return this.extLstCollector.feedOpen(t,n),!0;if(this.unknownCollector.active)return this.unknownCollector.feedOpen(t,n),!0;if(this.cacheSourceChildCollector.active)return this.cacheSourceChildCollector.feedOpen(t,n),!0;if(this.currentCacheField)return this.currentCacheField.parseOpen(e),!0;switch(t){case this.tag:{this.reset();let e={};for(let[t,r]of Object.entries(n))$v.has(t)||(e[t]=String(r));this.model={cacheFields:[],rId:n[`r:id`],refreshOnLoad:n.refreshOnLoad,createdVersion:n.createdVersion,refreshedVersion:n.refreshedVersion,minRefreshableVersion:n.minRefreshableVersion,recordCount:n.recordCount?parseInt(n.recordCount,10):void 0,backgroundQuery:n.backgroundQuery,supportSubquery:n.supportSubquery,supportAdvancedDrill:n.supportAdvancedDrill,extraRootAttrs:Object.keys(e).length>0?e:void 0,isLoaded:!0};break}case`cacheSource`:this.inCacheSource=!0,this.model&&(this.model.cacheSourceType=n.type);break;case`worksheetSource`:this.inCacheSource&&this.model&&(this.model.sourceRef=n.ref,this.model.sourceSheet=n.sheet,this.model.sourceTableName=n.name,n[`r:id`]&&(this.model.worksheetSourceRId=n[`r:id`]));break;case`cacheFields`:this.inCacheFields=!0;break;case`cacheField`:this.inCacheFields&&(this.currentCacheField=new Zv,this.currentCacheField.parseOpen(e));break;case`extLst`:this.model&&this.extLstCollector.start(n);break;default:if(this.inCacheSource&&this.model){this.cacheSourceChildCollector.startAs(t,n);break}this.model&&this.unknownCollector.startAs(t,n);break}return!0}parseText(e){if(this.extLstCollector.active){this.extLstCollector.feedText(e);return}if(this.unknownCollector.active){this.unknownCollector.feedText(e);return}if(this.cacheSourceChildCollector.active){this.cacheSourceChildCollector.feedText(e);return}this.currentCacheField&&this.currentCacheField.parseText(e)}parseClose(e){if(this.extLstCollector.active)return this.extLstCollector.feedClose(e)&&(this.model&&(this.model.extLstXml=this.extLstCollector.result),this.extLstCollector.reset()),!0;if(this.unknownCollector.active)return this.unknownCollector.feedClose(e)&&(this.unknownElementsXmlParts.push(this.unknownCollector.result),this.unknownCollector.reset()),!0;if(this.cacheSourceChildCollector.active)return this.cacheSourceChildCollector.feedClose(e)&&(this.cacheSourceXmlParts.push(this.cacheSourceChildCollector.result),this.cacheSourceChildCollector.reset()),!0;if(this.currentCacheField)return this.currentCacheField.parseClose(e)||(this.model&&this.currentCacheField.model&&this.model.cacheFields.push(this.currentCacheField.model),this.currentCacheField=null),!0;switch(e){case this.tag:return this.model&&this.unknownElementsXmlParts.length>0&&(this.model.unknownElementsXml=this.unknownElementsXmlParts.join(``)),!1;case`cacheSource`:this.inCacheSource=!1,this.model&&this.cacheSourceXmlParts.length>0&&(this.model.cacheSourceXml=this.cacheSourceXmlParts.join(``));break;case`cacheFields`:this.inCacheFields=!1;break}return!0}static renderCacheFieldsXml(e){return`
|
|
418
|
-
`+e.map(e=>
|
|
419
|
-
`)}static{this.PIVOT_CACHE_DEFINITION_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`}}};let
|
|
417
|
+
</cacheField>`}function ly(e){let t=[];for(let n of e)n===null?t.push(`<m />`):n instanceof Hg?t.push(`<e v="${Mc(n.code)}" />`):typeof n==`number`?Number.isFinite(n)?t.push(`<n v="${n}" />`):t.push(`<m />`):typeof n==`boolean`?t.push(`<b v="${n?`1`:`0`}" />`):n instanceof Date?t.push(`<d v="${sy(n)}" />`):t.push(`<s v="${Mc(n)}" />`);return t.join(``)}function uy(e){return e?Object.entries(e).map(([e,t])=>` ${e}="${Mc(t)}"`).join(``):``}function dy(e){let t=[];return e.containsSemiMixedTypes!==void 0&&t.push(`containsSemiMixedTypes="${e.containsSemiMixedTypes}"`),e.containsNonDate!==void 0&&t.push(`containsNonDate="${e.containsNonDate}"`),e.containsString!==void 0&&t.push(`containsString="${e.containsString}"`),e.containsBlank!==void 0&&t.push(`containsBlank="${e.containsBlank}"`),e.containsMixedTypes!==void 0&&t.push(`containsMixedTypes="${e.containsMixedTypes}"`),e.containsNumber!==void 0&&t.push(`containsNumber="${e.containsNumber}"`),e.containsInteger!==void 0&&t.push(`containsInteger="${e.containsInteger}"`),e.minValue!==void 0&&t.push(`minValue="${e.minValue}"`),e.maxValue!==void 0&&t.push(`maxValue="${e.maxValue}"`),e.containsDate!==void 0&&t.push(`containsDate="${e.containsDate}"`),t.length>0?` ${t.join(` `)}`:``}var fy=class{constructor(e){this.active=!1,this.depth=0,this.buffer=[],this.lastOpenIndex=-1,this.rootTag=e}start(e){this.active=!0,this.depth=0;let t=py(e);this.buffer=[`<${this.rootTag}${t?` `+t:``}>`]}startAs(e,t){this.rootTag=e,this.start(t)}reset(){this.active=!1,this.depth=0,this.buffer.length=0,this.lastOpenIndex=-1}feedOpen(e,t){let n=py(t);this.buffer.push(`<${e}${n?` `+n:``}>`),this.depth++,this.lastOpenIndex=this.buffer.length-1}feedText(e){this.buffer.push(Mc(e)),this.lastOpenIndex=-1}feedClose(e){if(e===this.rootTag&&this.depth===0)return this.buffer.push(`</${e}>`),this.active=!1,this.lastOpenIndex=-1,!0;if(this.depth>0&&this.depth--,this.lastOpenIndex>=0&&this.lastOpenIndex===this.buffer.length-1){let e=this.buffer[this.lastOpenIndex];return this.buffer[this.lastOpenIndex]=e.slice(0,-1)+` />`,this.lastOpenIndex=-1,!1}return this.lastOpenIndex=-1,this.buffer.push(`</${e}>`),!1}get result(){return this.buffer.join(``)}};function py(e){if(!e)return``;let t=Object.entries(e);return t.length===0?``:t.filter(([,e])=>e!=null).map(([e,t])=>`${e}="${Mc(String(t))}"`).join(` `)}let my=new Set([`name`,`numFmtId`]);var hy=class extends N{constructor(){super(),this.inSharedItems=!1,this.fieldGroupCollector=new fy(`fieldGroup`),this.model=null}get tag(){return`cacheField`}reset(){this.model=null,this.inSharedItems=!1,this.fieldGroupCollector.reset()}parseOpen(e){let{name:t,attributes:n}=e;if(this.fieldGroupCollector.active)return this.fieldGroupCollector.feedOpen(t,n),!0;switch(t){case`cacheField`:{let e={};for(let[t,r]of Object.entries(n))my.has(t)||(e[t]=String(r));this.model={name:n.name??``,sharedItems:null,numFmtId:n.numFmtId,isLoaded:!0,extraAttrs:Object.keys(e).length>0?e:void 0};break}case`fieldGroup`:this.model&&this.fieldGroupCollector.start(n);break;case`sharedItems`:if(this.inSharedItems=!0,this.model){if(n.containsNumber!==void 0&&(this.model.containsNumber=n.containsNumber),n.containsInteger!==void 0&&(this.model.containsInteger=n.containsInteger),n.minValue!==void 0){let e=parseFloat(n.minValue);Number.isFinite(e)&&(this.model.minValue=e)}if(n.maxValue!==void 0){let e=parseFloat(n.maxValue);Number.isFinite(e)&&(this.model.maxValue=e)}n.containsSemiMixedTypes!==void 0&&(this.model.containsSemiMixedTypes=n.containsSemiMixedTypes),n.containsNonDate!==void 0&&(this.model.containsNonDate=n.containsNonDate),n.containsString!==void 0&&(this.model.containsString=n.containsString),n.containsBlank!==void 0&&(this.model.containsBlank=n.containsBlank),n.containsDate!==void 0&&(this.model.containsDate=n.containsDate),n.containsMixedTypes!==void 0&&(this.model.containsMixedTypes=n.containsMixedTypes),this.model.sharedItems=[]}break;case`s`:case`n`:case`b`:case`e`:case`m`:case`d`:this.inSharedItems&&this.model&&this.model.sharedItems!==null&&this.model.sharedItems.push(gy(t,n));break}return!0}parseText(e){this.fieldGroupCollector.active&&this.fieldGroupCollector.feedText(e)}parseClose(e){if(this.fieldGroupCollector.active)return this.fieldGroupCollector.feedClose(e)&&(this.model&&(this.model.fieldGroupXml=this.fieldGroupCollector.result),this.fieldGroupCollector.reset()),!0;switch(e){case`cacheField`:return!1;case`sharedItems`:this.inSharedItems=!1;break}return!0}};function gy(e,t){switch(e){case`s`:return t.v??``;case`n`:return t.v===void 0||t.v===``?null:parseFloat(t.v);case`b`:return t.v===`1`;case`e`:return new Hg(t.v??``);case`m`:return null;case`d`:{if(!t.v)return null;let e=Vc(t.v);return isNaN(e.getTime())?null:e}default:return null}}let _y=new Set([`xmlns`,`xmlns:r`,`r:id`,`refreshOnLoad`,`createdVersion`,`refreshedVersion`,`minRefreshableVersion`,`recordCount`,`backgroundQuery`,`supportSubquery`,`supportAdvancedDrill`]);var vy=class e extends N{constructor(){super(),this.currentCacheField=null,this.inCacheFields=!1,this.inCacheSource=!1,this.extLstCollector=new fy(`extLst`),this.unknownCollector=new fy(``),this.unknownElementsXmlParts=[],this.cacheSourceChildCollector=new fy(``),this.cacheSourceXmlParts=[],this.model=null}get tag(){return`pivotCacheDefinition`}reset(){this.model=null,this.currentCacheField=null,this.inCacheFields=!1,this.inCacheSource=!1,this.extLstCollector.reset(),this.unknownCollector.reset(),this.unknownElementsXmlParts=[],this.cacheSourceChildCollector.reset(),this.cacheSourceXmlParts=[]}render(e,t){`isLoaded`in t&&t.isLoaded||!(`source`in t)?this.renderLoaded(e,t):this.renderNew(e,t)}renderNew(t,n){let{source:r,cacheFields:i}=n,a=r.getSheetValues().slice(2).filter(Array.isArray).length;t.openXml(A),t.openNode(this.tag,{...e.PIVOT_CACHE_DEFINITION_ATTRIBUTES,"r:id":`rId1`,refreshOnLoad:`1`,createdVersion:`8`,refreshedVersion:`8`,minRefreshableVersion:`3`,recordCount:a}),t.openNode(`cacheSource`,{type:`worksheet`});let o=r.tableName?{name:r.tableName}:{ref:r.dimensions.shortRange,sheet:r.name};t.leafNode(`worksheetSource`,o),t.closeNode(),t.openNode(`cacheFields`,{count:i.length}),t.writeRaw(e.renderCacheFieldsXml(i)),t.closeNode(),t.closeNode()}renderLoaded(t,n){let{cacheFields:r,sourceRef:i,sourceSheet:a,sourceTableName:o,recordCount:s}=n;t.openXml(A);let c={...e.PIVOT_CACHE_DEFINITION_ATTRIBUTES,"r:id":n.rId??`rId1`};if(n.refreshOnLoad&&(c.refreshOnLoad=n.refreshOnLoad),c.createdVersion=n.createdVersion??`8`,c.refreshedVersion=n.refreshedVersion??`8`,c.minRefreshableVersion=n.minRefreshableVersion??`3`,s!==void 0&&(c.recordCount=s),n.backgroundQuery&&(c.backgroundQuery=n.backgroundQuery),n.supportSubquery&&(c.supportSubquery=n.supportSubquery),n.supportAdvancedDrill&&(c.supportAdvancedDrill=n.supportAdvancedDrill),n.extraRootAttrs)for(let[e,t]of Object.entries(n.extraRootAttrs))c[e]=t;if(t.openNode(this.tag,c),t.openNode(`cacheSource`,{type:n.cacheSourceType??`worksheet`}),!n.cacheSourceType||n.cacheSourceType===`worksheet`){let e=o?{name:o}:{ref:i,sheet:a};n.worksheetSourceRId&&(e[`r:id`]=n.worksheetSourceRId),Object.values(e).some(e=>e!==void 0)&&t.leafNode(`worksheetSource`,e)}n.cacheSourceXml&&t.writeRaw(n.cacheSourceXml),t.closeNode(),t.openNode(`cacheFields`,{count:r.length}),t.writeRaw(e.renderCacheFieldsXml(r)),t.closeNode(),n.unknownElementsXml&&t.writeRaw(n.unknownElementsXml),n.extLstXml&&t.writeRaw(n.extLstXml),t.closeNode()}parseOpen(e){let{name:t,attributes:n}=e;if(this.extLstCollector.active)return this.extLstCollector.feedOpen(t,n),!0;if(this.unknownCollector.active)return this.unknownCollector.feedOpen(t,n),!0;if(this.cacheSourceChildCollector.active)return this.cacheSourceChildCollector.feedOpen(t,n),!0;if(this.currentCacheField)return this.currentCacheField.parseOpen(e),!0;switch(t){case this.tag:{this.reset();let e={};for(let[t,r]of Object.entries(n))_y.has(t)||(e[t]=String(r));this.model={cacheFields:[],rId:n[`r:id`],refreshOnLoad:n.refreshOnLoad,createdVersion:n.createdVersion,refreshedVersion:n.refreshedVersion,minRefreshableVersion:n.minRefreshableVersion,recordCount:n.recordCount?parseInt(n.recordCount,10):void 0,backgroundQuery:n.backgroundQuery,supportSubquery:n.supportSubquery,supportAdvancedDrill:n.supportAdvancedDrill,extraRootAttrs:Object.keys(e).length>0?e:void 0,isLoaded:!0};break}case`cacheSource`:this.inCacheSource=!0,this.model&&(this.model.cacheSourceType=n.type);break;case`worksheetSource`:this.inCacheSource&&this.model&&(this.model.sourceRef=n.ref,this.model.sourceSheet=n.sheet,this.model.sourceTableName=n.name,n[`r:id`]&&(this.model.worksheetSourceRId=n[`r:id`]));break;case`cacheFields`:this.inCacheFields=!0;break;case`cacheField`:this.inCacheFields&&(this.currentCacheField=new hy,this.currentCacheField.parseOpen(e));break;case`extLst`:this.model&&this.extLstCollector.start(n);break;default:if(this.inCacheSource&&this.model){this.cacheSourceChildCollector.startAs(t,n);break}this.model&&this.unknownCollector.startAs(t,n);break}return!0}parseText(e){if(this.extLstCollector.active){this.extLstCollector.feedText(e);return}if(this.unknownCollector.active){this.unknownCollector.feedText(e);return}if(this.cacheSourceChildCollector.active){this.cacheSourceChildCollector.feedText(e);return}this.currentCacheField&&this.currentCacheField.parseText(e)}parseClose(e){if(this.extLstCollector.active)return this.extLstCollector.feedClose(e)&&(this.model&&(this.model.extLstXml=this.extLstCollector.result),this.extLstCollector.reset()),!0;if(this.unknownCollector.active)return this.unknownCollector.feedClose(e)&&(this.unknownElementsXmlParts.push(this.unknownCollector.result),this.unknownCollector.reset()),!0;if(this.cacheSourceChildCollector.active)return this.cacheSourceChildCollector.feedClose(e)&&(this.cacheSourceXmlParts.push(this.cacheSourceChildCollector.result),this.cacheSourceChildCollector.reset()),!0;if(this.currentCacheField)return this.currentCacheField.parseClose(e)||(this.model&&this.currentCacheField.model&&this.model.cacheFields.push(this.currentCacheField.model),this.currentCacheField=null),!0;switch(e){case this.tag:return this.model&&this.unknownElementsXmlParts.length>0&&(this.model.unknownElementsXml=this.unknownElementsXmlParts.join(``)),!1;case`cacheSource`:this.inCacheSource=!1,this.model&&this.cacheSourceXmlParts.length>0&&(this.model.cacheSourceXml=this.cacheSourceXmlParts.join(``));break;case`cacheFields`:this.inCacheFields=!1;break}return!0}static renderCacheFieldsXml(e){return`
|
|
418
|
+
`+e.map(e=>cy(e)).join(`
|
|
419
|
+
`)}static{this.PIVOT_CACHE_DEFINITION_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`}}};let yy=new Set([`xmlns`,`xmlns:r`,`count`]);var by=class e extends N{constructor(){super(),this.model=null,this.currentRecord=null}get tag(){return`pivotCacheRecords`}reset(){this.model=null,this.currentRecord=null}render(e,t){`isLoaded`in t&&t.isLoaded||!(`source`in t)?this.renderLoaded(e,t):this.renderNew(e,t)}renderNew(t,n){let{source:r,cacheFields:i}=n,a=r.getSheetValues().slice(2).filter(Array.isArray);t.openXml(A),t.openNode(this.tag,{...e.PIVOT_CACHE_RECORDS_ATTRIBUTES,count:a.length}),t.writeRaw(this.renderTableNew(a,i)),t.closeNode()}renderLoaded(t,n){t.openXml(A);let r={xmlns:e.PIVOT_CACHE_RECORDS_ATTRIBUTES.xmlns,"xmlns:r":e.PIVOT_CACHE_RECORDS_ATTRIBUTES[`xmlns:r`]};if(n.extraRootAttrs)for(let[e,t]of Object.entries(n.extraRootAttrs))r[e]=t;else r[`xmlns:mc`]=e.PIVOT_CACHE_RECORDS_ATTRIBUTES[`xmlns:mc`],r[`mc:Ignorable`]=e.PIVOT_CACHE_RECORDS_ATTRIBUTES[`mc:Ignorable`],r[`xmlns:xr`]=e.PIVOT_CACHE_RECORDS_ATTRIBUTES[`xmlns:xr`];r.count=n.records.length,t.openNode(this.tag,r);for(let e of n.records){t.writeRaw(`
|
|
420
420
|
<r>`);for(let n of e)t.writeRaw(`
|
|
421
421
|
`),t.writeRaw(this.renderRecordValue(n));t.writeRaw(`
|
|
422
|
-
</r>`)}t.closeNode()}renderRecordValue(e){switch(e.type){case`x`:return`<x v="${e.value}" />`;case`n`:return Number.isFinite(e.value)?`<n v="${e.value}" />`:`<m />`;case`s`:return`<s v="${
|
|
422
|
+
</r>`)}t.closeNode()}renderRecordValue(e){switch(e.type){case`x`:return`<x v="${e.value}" />`;case`n`:return Number.isFinite(e.value)?`<n v="${e.value}" />`:`<m />`;case`s`:return`<s v="${Mc(e.value)}" />`;case`b`:return`<b v="${e.value?`1`:`0`}" />`;case`m`:return`<m />`;case`d`:return`<d v="${sy(e.value)}" />`;case`e`:return`<e v="${Mc(e.value)}" />`;default:throw Error(`Unhandled record value type: ${e.type}`)}}renderTableNew(e,t){let n=[];for(let r of e){let e=r.slice(1);n.push(`
|
|
423
423
|
<r>`);let i=Math.min(e.length,t.length);for(let r=0;r<i;r++)n.push(`
|
|
424
424
|
`+this.renderCellNew(e[r],t[r].sharedItems));for(let e=i;e<t.length;e++)n.push(`
|
|
425
425
|
<m />`);n.push(`
|
|
426
|
-
</r>`)}return n.join(``)}renderCellNew(e,t){if(e==null||typeof e==`number`&&!Number.isFinite(e)){if(t===null)return`<m />`;let e=t.indexOf(null);return e>=0?`<x v="${e}" />`:`<m />`}if(t===null)return e instanceof wg?`<e v="${R(e.code)}" />`:typeof e==`boolean`?`<b v="${e?`1`:`0`}" />`:e instanceof Date?`<d v="${Uv(e)}" />`:Number.isFinite(e)?`<n v="${e}" />`:`<s v="${R(String(e))}" />`;let n=ry(t,e);if(n<0)throw new Ir(`${JSON.stringify(e)} not in sharedItems ${JSON.stringify(t)}`);return`<x v="${n}" />`}parseOpen(e){let{name:t,attributes:n}=e;switch(t){case this.tag:{this.reset();let e={};for(let[t,r]of Object.entries(n))ty.has(t)||(e[t]=String(r));this.model={records:[],count:parseInt(n.count??`0`,10),isLoaded:!0,extraRootAttrs:Object.keys(e).length>0?e:void 0};break}case`r`:this.currentRecord=[];break;case`x`:this.currentRecord&&this.currentRecord.push({type:`x`,value:parseInt(n.v??`0`,10)});break;case`n`:this.currentRecord&&(n.v===void 0||n.v===``?this.currentRecord.push({type:`m`}):this.currentRecord.push({type:`n`,value:parseFloat(n.v)}));break;case`s`:this.currentRecord&&this.currentRecord.push({type:`s`,value:n.v??``});break;case`b`:this.currentRecord&&this.currentRecord.push({type:`b`,value:n.v===`1`});break;case`m`:this.currentRecord&&this.currentRecord.push({type:`m`});break;case`d`:if(this.currentRecord)if(!n.v)this.currentRecord.push({type:`m`});else{let e=Mc(n.v);isNaN(e.getTime())?this.currentRecord.push({type:`m`}):this.currentRecord.push({type:`d`,value:e})}break;case`e`:this.currentRecord&&this.currentRecord.push({type:`e`,value:n.v??``});break}return!0}parseText(e){}parseClose(e){switch(e){case this.tag:return!1;case`r`:this.model&&this.currentRecord&&(this.model.records.push(this.currentRecord),this.currentRecord=null);break}return!0}static{this.PIVOT_CACHE_RECORDS_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`xr`,"xmlns:xr":`http://schemas.microsoft.com/office/spreadsheetml/2014/revision`}}};function ry(e,t){if(t instanceof Date){let n=t.getTime();for(let t=0;t<e.length;t++){let r=e[t];if(r instanceof Date&&r.getTime()===n)return t}return-1}if(t instanceof wg){for(let n=0;n<e.length;n++){let r=e[n];if(r instanceof wg&&r.code===t.code)return n}return-1}return e.indexOf(t)}let iy=`PivotStyleLight16`,ay=new Set([`axisRow`,`axisCol`,`axisPage`,`axisValues`]),oy=[`x`,`t`,`h`,`sd`,`f`,`m`,`c`,`d`];function sy(){return{currentSection:null,inPivotArea:!1,inAutoSortScope:!1}}let cy=new Set([`axis`,`dataField`,`compact`,`outline`,`showAll`,`defaultSubtotal`,`numFmtId`,`sortType`,`subtotalTop`,`insertBlankRow`,`multipleItemSelectionAllowed`]);var ly=class e extends U{constructor(){super(),this.state=sy(),this.currentPivotField=null,this.currentRowItem=null,this.currentColItem=null,this.currentChartFormat=null,this.pivotAreaXmlBuffer=[],this.autoSortScopeXmlBuffer=[],this.extLstCollector=new Jv(`extLst`),this.formatsCollector=new Jv(`formats`),this.conditionalFormatsCollector=new Jv(`conditionalFormats`),this.filtersCollector=new Jv(`filters`),this.unknownCollector=new Jv(``),this.unknownElementsXmlParts=[],this.model=null}get tag(){return`pivotTableDefinition`}reset(){this.model=null,this.state=sy(),this.currentPivotField=null,this.currentRowItem=null,this.currentColItem=null,this.currentChartFormat=null,this.pivotAreaXmlBuffer=[],this.autoSortScopeXmlBuffer=[],this.extLstCollector.reset(),this.formatsCollector.reset(),this.conditionalFormatsCollector.reset(),this.filtersCollector.reset(),this.unknownCollector.reset(),this.unknownElementsXmlParts=[]}render(e,t){`isLoaded`in t&&t.isLoaded?this.renderLoaded(e,t):this.renderNew(e,t)}renderNew(t,n){let{rows:r,columns:i,values:a,pages:o=[],cacheFields:s,cacheId:c,tableNumber:l,applyWidthHeightFormats:u}=n,d=i.length===0&&a.length>1,f=o.length,p=f>0?f+1:0,m=r.length,h=3+p,g=h+1,_=m+(d?a.length:1),v=`A${h}:${M.n2l(_)}${g}`;t.openXml(z),t.openNode(this.tag,{...e.PIVOT_TABLE_ATTRIBUTES,name:`PivotTable${l}`,cacheId:c,applyNumberFormats:`0`,applyBorderFormats:`0`,applyFontFormats:`0`,applyPatternFormats:`0`,applyAlignmentFormats:`0`,applyWidthHeightFormats:u,dataCaption:`Values`,updatedVersion:`8`,minRefreshableVersion:`3`,useAutoFormatting:`1`,itemPrintTitles:`1`,createdVersion:`8`,indent:`0`,compact:`0`,compactData:`0`,multipleFieldFilters:`0`});let y={ref:v,firstHeaderRow:1,firstDataRow:1,firstDataCol:m};f>0&&(y.rowPageCount=f,y.colPageCount=1),t.leafNode(`location`,y),fy(t,n),t.openNode(`rowFields`,{count:r.length});for(let e of r)t.leafNode(`field`,{x:e});if(t.closeNode(),t.openNode(`rowItems`,{count:1}),t.openNode(`i`,{t:`grand`}),t.leafNode(`x`),t.closeNode(),t.closeNode(),i.length>0){let e=a.length>1?i.length+1:i.length;t.openNode(`colFields`,{count:e});for(let e of i)t.leafNode(`field`,{x:e});a.length>1&&t.leafNode(`field`,{x:-2}),t.closeNode()}else d&&(t.openNode(`colFields`,{count:1}),t.leafNode(`field`,{x:-2}),t.closeNode());if(d){t.openNode(`colItems`,{count:a.length+1});for(let e=0;e<a.length;e++)t.openNode(`i`),t.leafNode(`x`,e===0?void 0:{v:e}),t.closeNode();t.openNode(`i`,{t:`grand`}),t.leafNode(`x`),t.closeNode(),t.closeNode()}else t.openNode(`colItems`,{count:1}),t.leafNode(`i`),t.closeNode();if(f>0){t.openNode(`pageFields`,{count:f});for(let e of o)t.leafNode(`pageField`,{fld:e,hier:-1});t.closeNode()}dy(t,s,a,n.valueMetrics),t.leafNode(`pivotTableStyleInfo`,{name:iy,showRowHeaders:`1`,showColHeaders:`1`,showRowStripes:`0`,showColStripes:`0`,showLastColumn:`1`}),t.writeRaw(e.EXTLST_XML),t.closeNode()}renderLoaded(t,n){let r=this.buildLoadedRootAttributes(n);if(t.openXml(z),t.openNode(this.tag,r),n.location){let e={ref:n.location.ref,firstHeaderRow:n.location.firstHeaderRow,firstDataRow:n.location.firstDataRow,firstDataCol:n.location.firstDataCol};n.location.rowPageCount!==void 0&&(e.rowPageCount=n.location.rowPageCount),n.location.colPageCount!==void 0&&(e.colPageCount=n.location.colPageCount),t.leafNode(`location`,e)}if(n.pivotFields.length>0){t.openNode(`pivotFields`,{count:n.pivotFields.length});for(let e of n.pivotFields)this.renderPivotFieldLoaded(t,e);t.closeNode()}if(n.rowFields.length>0){t.openNode(`rowFields`,{count:n.rowFields.length});for(let e of n.rowFields)t.leafNode(`field`,{x:e});t.closeNode()}if(n.rowItems&&n.rowItems.length>0){t.openNode(`rowItems`,{count:n.rowItems.length});for(let e of n.rowItems)this.renderRowColItem(t,e);t.closeNode()}else n.hasRowItems&&t.writeRaw(`<rowItems count="1"><i t="grand"><x/></i></rowItems>`);if(n.hasColFields||n.colFields.length>0)if(n.colFields.length===0&&n.dataFields.length<=1)t.leafNode(`colFields`,{count:0});else{let e=n.colFields.length===0?1:n.colFields.length;if(t.openNode(`colFields`,{count:e}),n.colFields.length===0)t.leafNode(`field`,{x:-2});else for(let e of n.colFields)t.leafNode(`field`,{x:e});t.closeNode()}if(n.colItems&&n.colItems.length>0){t.openNode(`colItems`,{count:n.colItems.length});for(let e of n.colItems)this.renderRowColItem(t,e);t.closeNode()}else n.hasColItems&&t.writeRaw(`<colItems count="1"><i t="grand"><x/></i></colItems>`);if(n.pageFields&&n.pageFields.length>0){t.openNode(`pageFields`,{count:n.pageFields.length});for(let e of n.pageFields){let n={fld:e.fld};e.item!==void 0&&(n.item=e.item),e.hier!==void 0&&(n.hier=e.hier),e.name!==void 0&&(n.name=e.name),t.leafNode(`pageField`,n)}t.closeNode()}if(n.dataFields.length>0){t.openNode(`dataFields`,{count:n.dataFields.length});for(let e of n.dataFields){let n={name:e.name,fld:e.fld};e.baseField!==void 0&&(n.baseField=e.baseField),e.baseItem!==void 0&&(n.baseItem=e.baseItem),e.subtotal!==void 0&&e.subtotal!==`sum`&&(n.subtotal=e.subtotal),e.numFmtId!==void 0&&(n.numFmtId=e.numFmtId),t.leafNode(`dataField`,n)}t.closeNode()}n.formatsXml&&t.writeRaw(n.formatsXml),n.conditionalFormatsXml&&t.writeRaw(n.conditionalFormatsXml),n.chartFormats&&n.chartFormats.length>0&&this.renderChartFormats(t,n.chartFormats);let i=n.styleInfo;t.leafNode(`pivotTableStyleInfo`,{name:i?.name??n.styleName??iy,showRowHeaders:i?.showRowHeaders??`1`,showColHeaders:i?.showColHeaders??`1`,showRowStripes:i?.showRowStripes??`0`,showColStripes:i?.showColStripes??`0`,showLastColumn:i?.showLastColumn??`1`}),n.filtersXml&&t.writeRaw(n.filtersXml),n.unknownElementsXml&&t.writeRaw(n.unknownElementsXml);let a=n.extLstXml??(n.isLoaded?``:e.EXTLST_XML);a&&t.writeRaw(a),t.closeNode()}buildLoadedRootAttributes(t){let n={...e.PIVOT_TABLE_ATTRIBUTES,name:t.name??`PivotTable1`,cacheId:String(t.cacheId),applyNumberFormats:t.applyNumberFormats??`0`,applyBorderFormats:t.applyBorderFormats??`0`,applyFontFormats:t.applyFontFormats??`0`,applyPatternFormats:t.applyPatternFormats??`0`,applyAlignmentFormats:t.applyAlignmentFormats??`0`,applyWidthHeightFormats:t.applyWidthHeightFormats??`0`,dataCaption:t.dataCaption??`Values`,updatedVersion:t.updatedVersion??`8`,minRefreshableVersion:t.minRefreshableVersion??`3`};return t.useAutoFormatting!==void 0&&(n.useAutoFormatting=t.useAutoFormatting),t.itemPrintTitles!==void 0&&(n.itemPrintTitles=t.itemPrintTitles),t.multipleFieldFilters!==void 0&&(n.multipleFieldFilters=t.multipleFieldFilters),n.createdVersion=t.createdVersion??`8`,t.indent!==void 0&&(n.indent=String(t.indent)),t.uid&&(n[`xmlns:xr`]=`http://schemas.microsoft.com/office/spreadsheetml/2014/revision`,n[`xr:uid`]=t.uid),t.outline&&(n.outline=`1`),t.outlineData&&(n.outlineData=`1`),t.chartFormat!==void 0&&(n.chartFormat=String(t.chartFormat)),t.colGrandTotals!==void 0&&(n.colGrandTotals=t.colGrandTotals),t.rowGrandTotals!==void 0&&(n.rowGrandTotals=t.rowGrandTotals),t.showError!==void 0&&(n.showError=t.showError),t.errorCaption!==void 0&&(n.errorCaption=t.errorCaption),t.showMissing!==void 0&&(n.showMissing=t.showMissing),t.missingCaption!==void 0&&(n.missingCaption=t.missingCaption),t.grandTotalCaption!==void 0&&(n.grandTotalCaption=t.grandTotalCaption),t.compact===!1&&(n.compact=`0`),t.compactData===!1&&(n.compactData=`0`),n}renderChartFormats(e,t){e.openNode(`chartFormats`,{count:t.length});for(let n of t)e.openNode(`chartFormat`,{chart:n.chart,format:n.format,series:n.series===!0?`1`:n.series===!1?`0`:void 0}),n.pivotAreaXml?e.writeRaw(n.pivotAreaXml):e.writeRaw(`<pivotArea type="data" outline="0" fieldPosition="0"><references count="1"><reference field="4294967294" count="1" selected="0"><x v="0"/></reference></references></pivotArea>`),e.closeNode();e.closeNode()}renderRowColItem(e,t){let n={};if(t.t!==void 0&&(n.t=t.t),t.r!==void 0&&(n.r=t.r),t.i!==void 0&&(n.i=t.i),t.x.length>0){e.openNode(`i`,n);for(let n of t.x)n.v===0?e.leafNode(`x`):e.leafNode(`x`,{v:n.v});e.closeNode()}else e.leafNode(`i`,n)}renderPivotFieldLoaded(e,t){let n={};if(t.axis&&(n.axis=t.axis),t.dataField&&(n.dataField=`1`),t.numFmtId!==void 0&&(n.numFmtId=String(t.numFmtId)),t.sortType&&(n.sortType=t.sortType),t.compact===!1&&(n.compact=`0`),t.outline===!1&&(n.outline=`0`),n.showAll=t.showAll?`1`:`0`,t.defaultSubtotal===!1&&(n.defaultSubtotal=`0`),t.subtotalTop===!1&&(n.subtotalTop=`0`),t.insertBlankRow===!0&&(n.insertBlankRow=`1`),t.multipleItemSelectionAllowed===!0&&(n.multipleItemSelectionAllowed=`1`),t.extraAttrs)for(let[e,r]of Object.entries(t.extraAttrs))n[e]=r;if(t.items!==void 0&&t.items.length>0||t.autoSortScopeXml!==void 0){if(e.openNode(`pivotField`,n),t.items!==void 0&&t.items.length>0){e.openNode(`items`,{count:t.items.length});for(let n of t.items){let t={};for(let e of oy)n[e]!==void 0&&(t[e]=n[e]);e.leafNode(`item`,t)}e.closeNode()}t.autoSortScopeXml&&e.writeRaw(t.autoSortScopeXml),e.closeNode()}else e.leafNode(`pivotField`,n)}parseOpen(e){let{name:t,attributes:n}=e;if(this.extLstCollector.active)return this.extLstCollector.feedOpen(t,n),!0;if(this.formatsCollector.active)return this.formatsCollector.feedOpen(t,n),!0;if(this.conditionalFormatsCollector.active)return this.conditionalFormatsCollector.feedOpen(t,n),!0;if(this.filtersCollector.active)return this.filtersCollector.feedOpen(t,n),!0;if(this.unknownCollector.active)return this.unknownCollector.feedOpen(t,n),!0;switch(t){case this.tag:this.reset(),this.model={name:n.name,cacheId:parseInt(n.cacheId??`0`,10),uid:n[`xr:uid`],pivotFields:[],rowFields:[],colFields:[],pageFields:[],dataFields:[],applyNumberFormats:n.applyNumberFormats,applyBorderFormats:n.applyBorderFormats,applyFontFormats:n.applyFontFormats,applyPatternFormats:n.applyPatternFormats,applyAlignmentFormats:n.applyAlignmentFormats,applyWidthHeightFormats:n.applyWidthHeightFormats,dataCaption:n.dataCaption,updatedVersion:n.updatedVersion,minRefreshableVersion:n.minRefreshableVersion,createdVersion:n.createdVersion,useAutoFormatting:n.useAutoFormatting,itemPrintTitles:n.itemPrintTitles,indent:n.indent===void 0?void 0:parseInt(n.indent,10),compact:n.compact!==`0`,compactData:n.compactData!==`0`,multipleFieldFilters:n.multipleFieldFilters,outline:n.outline===`1`,outlineData:n.outlineData===`1`,chartFormat:n.chartFormat===void 0?void 0:parseInt(n.chartFormat,10),colGrandTotals:n.colGrandTotals,rowGrandTotals:n.rowGrandTotals,showError:n.showError,errorCaption:n.errorCaption,showMissing:n.showMissing,missingCaption:n.missingCaption,grandTotalCaption:n.grandTotalCaption,rowItems:[],colItems:[],chartFormats:[],isLoaded:!0};break;case`location`:this.model&&(this.model.location={ref:n.ref,firstHeaderRow:n.firstHeaderRow===void 0?void 0:parseInt(n.firstHeaderRow,10),firstDataRow:n.firstDataRow===void 0?void 0:parseInt(n.firstDataRow,10),firstDataCol:n.firstDataCol===void 0?void 0:parseInt(n.firstDataCol,10),rowPageCount:n.rowPageCount===void 0?void 0:parseInt(n.rowPageCount,10),colPageCount:n.colPageCount===void 0?void 0:parseInt(n.colPageCount,10)});break;case`pivotFields`:this.state.currentSection=`pivotFields`;break;case`pivotField`:if(this.state.currentSection===`pivotFields`){let e={};for(let[t,r]of Object.entries(n))cy.has(t)||(e[t]=String(r));this.currentPivotField={axis:ay.has(n.axis)?n.axis:void 0,dataField:n.dataField===`1`,items:[],compact:n.compact!==`0`,outline:n.outline!==`0`,showAll:n.showAll!==`0`,defaultSubtotal:n.defaultSubtotal!==`0`,numFmtId:n.numFmtId===void 0?void 0:parseInt(n.numFmtId,10),sortType:n.sortType,subtotalTop:n.subtotalTop===void 0?void 0:n.subtotalTop===`1`,insertBlankRow:n.insertBlankRow===`1`?!0:void 0,multipleItemSelectionAllowed:n.multipleItemSelectionAllowed===`1`?!0:void 0,extraAttrs:Object.keys(e).length>0?e:void 0}}break;case`items`:break;case`item`:if(this.currentPivotField){let e={};n.x!==void 0&&(e.x=parseInt(n.x,10));for(let t of oy)t!==`x`&&n[t]!==void 0&&(e[t]=n[t]);this.currentPivotField.items.push(e)}break;case`autoSortScope`:this.currentPivotField&&(this.state.inAutoSortScope=!0,this.autoSortScopeXmlBuffer=[`<autoSortScope>`]);break;case`rowFields`:this.state.currentSection=`rowFields`;break;case`colFields`:this.state.currentSection=`colFields`,this.model&&(this.model.hasColFields=!0);break;case`dataFields`:this.state.currentSection=`dataFields`;break;case`pageFields`:this.state.currentSection=`pageFields`;break;case`pageField`:this.state.currentSection===`pageFields`&&this.model&&this.model.pageFields.push({fld:parseInt(n.fld??`0`,10),item:n.item===void 0?void 0:parseInt(n.item,10),hier:n.hier===void 0?void 0:parseInt(n.hier,10),name:n.name});break;case`rowItems`:this.state.currentSection=`rowItems`,this.model&&(this.model.hasRowItems=!0);break;case`colItems`:this.state.currentSection=`colItems`,this.model&&(this.model.hasColItems=!0);break;case`i`:if(this.model){let e=this.state.currentSection===`rowItems`||this.state.currentSection===`colItems`?uy(n):null;this.state.currentSection===`rowItems`?this.currentRowItem=e:this.state.currentSection===`colItems`&&(this.currentColItem=e)}break;case`x`:if(this.state.inPivotArea){let e=Yv(n);this.state.inAutoSortScope?this.autoSortScopeXmlBuffer.push(e?`<x ${e}/>`:`<x/>`):this.pivotAreaXmlBuffer.push(e?`<x ${e}/>`:`<x/>`)}else this.currentRowItem?this.currentRowItem.x.push({v:parseInt(n.v??`0`,10)}):this.currentColItem&&this.currentColItem.x.push({v:parseInt(n.v??`0`,10)});break;case`chartFormats`:this.state.currentSection=`chartFormats`;break;case`chartFormat`:this.state.currentSection===`chartFormats`&&this.model&&(this.currentChartFormat={chart:parseInt(n.chart??`0`,10),format:parseInt(n.format??`0`,10),series:n.series===void 0?void 0:n.series===`1`});break;case`pivotArea`:if(this.currentChartFormat){this.state.inPivotArea=!0;let e=Yv(n);this.pivotAreaXmlBuffer=[e?`<pivotArea ${e}>`:`<pivotArea>`]}else if(this.state.inAutoSortScope){this.state.inPivotArea=!0;let e=Yv(n);this.autoSortScopeXmlBuffer.push(e?`<pivotArea ${e}>`:`<pivotArea>`)}break;case`references`:case`reference`:if(this.state.inPivotArea){let e=Yv(n);this.state.inAutoSortScope?this.autoSortScopeXmlBuffer.push(`<${t}${e?` `+e:``}>`):this.pivotAreaXmlBuffer.push(`<${t}${e?` `+e:``}>`)}break;case`field`:if(this.model){let e=parseInt(n.x??`0`,10);this.state.currentSection===`rowFields`?this.model.rowFields.push(e):this.state.currentSection===`colFields`&&this.model.colFields.push(e)}break;case`dataField`:this.state.currentSection===`dataFields`&&this.model&&this.model.dataFields.push({name:n.name??``,fld:parseInt(n.fld??`0`,10),baseField:n.baseField===void 0?void 0:parseInt(n.baseField,10),baseItem:n.baseItem===void 0?void 0:parseInt(n.baseItem,10),subtotal:Eg.has(n.subtotal)?n.subtotal:void 0,numFmtId:n.numFmtId===void 0?void 0:parseInt(n.numFmtId,10)});break;case`pivotTableStyleInfo`:this.model&&(this.model.styleName=n.name,this.model.styleInfo={name:n.name,showRowHeaders:n.showRowHeaders,showColHeaders:n.showColHeaders,showRowStripes:n.showRowStripes,showColStripes:n.showColStripes,showLastColumn:n.showLastColumn});break;case`extLst`:this.model&&this.extLstCollector.start(n);break;case`formats`:this.model&&this.formatsCollector.start(n);break;case`conditionalFormats`:this.model&&this.conditionalFormatsCollector.start(n);break;case`filters`:this.model&&this.filtersCollector.start(n);break;default:this.model&&this.state.currentSection===null&&!this.state.inPivotArea&&!this.state.inAutoSortScope&&this.unknownCollector.startAs(t,n);break}return!0}parseText(e){this.extLstCollector.active?this.extLstCollector.feedText(e):this.formatsCollector.active?this.formatsCollector.feedText(e):this.conditionalFormatsCollector.active?this.conditionalFormatsCollector.feedText(e):this.filtersCollector.active?this.filtersCollector.feedText(e):this.unknownCollector.active&&this.unknownCollector.feedText(e)}tryCloseCollector(e,t,n){e.feedClose(t)&&(this.model&&(this.model[n]=e.result),e.reset())}parseClose(e){if(this.extLstCollector.active)return this.tryCloseCollector(this.extLstCollector,e,`extLstXml`),!0;if(this.formatsCollector.active)return this.tryCloseCollector(this.formatsCollector,e,`formatsXml`),!0;if(this.conditionalFormatsCollector.active)return this.tryCloseCollector(this.conditionalFormatsCollector,e,`conditionalFormatsXml`),!0;if(this.filtersCollector.active)return this.tryCloseCollector(this.filtersCollector,e,`filtersXml`),!0;if(this.unknownCollector.active)return this.unknownCollector.feedClose(e)&&(this.unknownElementsXmlParts.push(this.unknownCollector.result),this.unknownCollector.reset()),!0;if(this.state.inPivotArea)return e===`pivotArea`?(this.state.inAutoSortScope?this.autoSortScopeXmlBuffer.push(`</pivotArea>`):(this.pivotAreaXmlBuffer.push(`</pivotArea>`),this.currentChartFormat&&(this.currentChartFormat.pivotAreaXml=this.pivotAreaXmlBuffer.join(``)),this.pivotAreaXmlBuffer=[]),this.state.inPivotArea=!1,!0):((e===`references`||e===`reference`)&&(this.state.inAutoSortScope?this.autoSortScopeXmlBuffer.push(`</${e}>`):this.pivotAreaXmlBuffer.push(`</${e}>`)),!0);switch(e){case this.tag:return this.model&&this.unknownElementsXmlParts.length>0&&(this.model.unknownElementsXml=this.unknownElementsXmlParts.join(``)),!1;case`pivotFields`:case`rowFields`:case`colFields`:case`dataFields`:case`pageFields`:case`rowItems`:case`colItems`:case`chartFormats`:this.state.currentSection=null;break;case`pivotField`:this.currentPivotField&&this.model&&(this.model.pivotFields.push(this.currentPivotField),this.currentPivotField=null);break;case`items`:break;case`autoSortScope`:this.state.inAutoSortScope&&this.currentPivotField&&(this.autoSortScopeXmlBuffer.push(`</autoSortScope>`),this.currentPivotField.autoSortScopeXml=this.autoSortScopeXmlBuffer.join(``),this.autoSortScopeXmlBuffer=[],this.state.inAutoSortScope=!1);break;case`i`:this.currentRowItem&&this.model?(this.model.rowItems?.push(this.currentRowItem),this.currentRowItem=null):this.currentColItem&&this.model&&(this.model.colItems?.push(this.currentColItem),this.currentColItem=null);break;case`chartFormat`:this.currentChartFormat&&this.model&&(this.model.chartFormats?.push(this.currentChartFormat),this.currentChartFormat=null);break}return!0}static{this.PIVOT_TABLE_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`}}static{this.EXTLST_XML=`<extLst><ext uri="{962EF5D1-5CA2-4c93-8EF4-DBF5C05439D2}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"><x14:pivotTableDefinition hideValuesRow="1" xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main"/></ext><ext uri="{747A6164-185A-40DC-8AA5-F01512510D54}" xmlns:xpdl="http://schemas.microsoft.com/office/spreadsheetml/2016/pivotdefaultlayout"><xpdl:pivotTableDefinition16 EnabledSubtotalsDefault="0" SubtotalsOnTopDefault="0"/></ext></extLst>`}};function uy(e){return{t:e.t,r:e.r===void 0?void 0:parseInt(e.r,10),i:e.i===void 0?void 0:parseInt(e.i,10),x:[]}}function dy(e,t,n,r){e.openNode(`dataFields`,{count:n.length});for(let i=0;i<n.length;i++){let a=n[i],o=r[i]??`sum`,s=Tg[o],c=t[a];if(!c)throw Error(`Value field index ${a} is out of bounds (cacheFields has ${t.length} entries)`);let l={name:`${s} of ${c.name}`,fld:a,baseField:0,baseItem:0};o!==`sum`&&(l.subtotal=o),e.leafNode(`dataField`,l)}e.closeNode()}function fy(e,t){let n=new Set(t.rows),r=new Set(t.columns),i=new Set(t.values),a=new Set(t.pages??[]);e.openNode(`pivotFields`,{count:t.cacheFields.length});for(let o=0;o<t.cacheFields.length;o++){let s=t.cacheFields[o];py(e,n.has(o),r.has(o),i.has(o),a.has(o),s.sharedItems)}e.closeNode()}function py(e,t,n,r,i,a){if(t||n||i){if(!a)throw Error(`sharedItems is required for axis field (row/column/page)`);let i={axis:t?`axisRow`:n?`axisCol`:`axisPage`};r&&(i.dataField=`1`),i.compact=`0`,i.outline=`0`,i.showAll=`0`,e.openNode(`pivotField`,i),e.openNode(`items`,{count:a.length+1});for(let t=0;t<a.length;t++)e.leafNode(`item`,{x:t});e.leafNode(`item`,{t:`default`}),e.closeNode(),e.closeNode();return}let o={};r&&(o.dataField=`1`),o.compact=`0`,o.outline=`0`,o.showAll=`0`,o.defaultSubtotal=`0`,e.leafNode(`pivotField`,o)}var my=class extends U{get tag(){return`dimension`}render(e,t){t&&e.leafNode(`dimension`,{ref:t})}parseOpen(e){return e.name===`dimension`?(this.model=e.attributes.ref,!0):!1}parseText(){}parseClose(){return!1}},hy=class extends U{get tag(){return`mergeCell`}render(e,t){e.leafNode(`mergeCell`,{ref:t})}parseOpen(e){return e.name===`mergeCell`?(this.model=e.attributes.ref,!0):!1}parseText(){}parseClose(){return!1}},gy=class{constructor(){this.merges={}}add(e){if(this.merges[e.master])this.merges[e.master].expandToAddress(e.address);else{let t=`${e.master}:${e.address}`;this.merges[e.master]=new N(t)}}get mergeCells(){return Object.values(this.merges).map(e=>e.range)}reconcile(e,t){e.forEach(e=>{let n=M.decode(e);for(let e=n.top;e<=n.bottom;e++){let r=t[e-1];for(let t=n.left;t<=n.right;t++){let i=r.cells[t-1];i?i.type===1&&(i.master=n.tl):r.cells[t]={type:0,address:M.encodeAddress(e,t)}}}})}getMasterAddress(e){let t=this.hash[e];return t&&t.tl}};function _y(e){return e?`1`:void 0}var vy=class extends U{get tag(){return`printOptions`}render(e,t){if(t){let n={headings:_y(t.showRowColHeaders),gridLines:_y(t.showGridLines),horizontalCentered:_y(t.horizontalCentered),verticalCentered:_y(t.verticalCentered)};Object.values(n).some(e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={showRowColHeaders:e.attributes.headings===`1`,showGridLines:e.attributes.gridLines===`1`,horizontalCentered:e.attributes.horizontalCentered===`1`,verticalCentered:e.attributes.verticalCentered===`1`},!0;default:return!1}}parseText(){}parseClose(){return!1}},yy=class extends U{get tag(){return`tablePart`}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:id`]},!0;default:return!1}}parseText(){}parseClose(){return!1}};let by=(e,t)=>{Object.keys(t).forEach(n=>{let r=e[n],i=t[n];r===void 0&&i!==void 0&&(e[n]=i)})},xy=(e,t)=>{if(!t||!t.length)return e;if(!e||!e.length)return t;let n={},r={};return e.forEach(e=>{n[e.ref]=e,e.rules.forEach(e=>{let{x14Id:t}=e;t&&(r[t]=e)})}),t.forEach(t=>{t.rules.forEach(i=>{let a=r[i.x14Id];a?by(a,i):n[t.ref]?n[t.ref].rules.push(i):e.push({ref:t.ref,rules:[i]})})}),e};var Sy=class e extends U{static{this.WORKSHEET_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"xmlns:x14ac":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac`,"mc:Ignorable":`x14ac`}}constructor(e){super();let{maxRows:t,maxCols:n,ignoreNodes:r}=e||{};this.ignoreNodes=r??[],this.map={sheetPr:new _h,dimension:new my,sheetViews:new W({tag:`sheetViews`,count:!1,childXform:new Sh}),sheetFormatPr:new ph,cols:new W({tag:`cols`,count:!1,childXform:new Am}),sheetData:new W({tag:`sheetData`,count:!1,empty:!0,childXform:new fh({maxItems:n}),maxItems:t}),autoFilter:new dm,mergeCells:new W({tag:`mergeCells`,count:!0,childXform:new hy}),rowBreaks:new sh,colBreaks:new km,hyperlinks:new W({tag:`hyperlinks`,count:!1,childXform:new Zp}),pageMargins:new $m,dataValidations:new Pm,pageSetup:new ah,headerFooter:new Xm,printOptions:new vy,picture:new oh,drawing:new Fm,sheetProtection:new bh,tableParts:new W({tag:`tableParts`,count:!0,childXform:new yy}),conditionalFormatting:new Dm,extLst:new Ym,ignoredErrors:new Qm}}prepare(e,t){t.merges=new gy,e.hyperlinks=t.hyperlinks=[],e.comments=t.comments=[],e.formControls&&e.formControls.length>0&&(!e.views||e.views.length===0)&&(e.views=[{workbookViewId:0}]),t.formulae={},t.siFormulae=0,this.map.cols.prepare(e.cols,t),this.map.sheetData.prepare(e.rows,t),this.map.conditionalFormatting.prepare(e.conditionalFormattings,t),e.mergeCells=t.merges.mergeCells;let n=e.rels=[];function r(e){return`rId${e.length+1}`}e.hyperlinks.forEach(e=>{if(Qp(e.target))return;let t=r(n);e.rId=t,n.push({Id:t,Type:F.Hyperlink,Target:e.target,TargetMode:`External`})});let{fileIndex:i}=e;if(e.comments.length>0){let a={Id:r(n),Type:F.Comments,Target:dd(i)};n.push(a);let o={Id:r(n),Type:F.VmlDrawing,Target:fd(i)};n.push(o),e.comments.forEach(e=>{e.refAddress=M.decodeAddress(e.ref)}),t.commentRefs.push({commentName:`comments${i}`,vmlDrawing:`vmlDrawing${i}`})}if(e.drawing&&e.drawing.anchors){let i=e.drawing;i.rId=r(n),i.name||=`drawing${++t.drawingsCount}`;let a=(i.rels??[]).some(e=>e.Target&&e.Target.includes(`/charts/`));i.anchors=[],a||(i.rels=[]),t.drawings.push(i),n.push({Id:i.rId,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing`,Target:md(i.name)})}let a=[],o=[],s=[],c=[];if(e.media.forEach(e=>{e.type===`background`?a.push(e):e.type===`image`?o.push(e):e.type===`watermark`?s.push(e):e.type===`headerImage`&&c.push(e)}),a.forEach(i=>{let a=r(n),o=t.media[i.imageId];n.push({Id:a,Type:F.Image,Target:tm(o)}),e.background={rId:a},e.image=t.media[i.imageId]}),o.length>0){let{drawing:i}=e;i||(i=e.drawing={rId:r(n),name:`drawing${++t.drawingsCount}`,anchors:[],rels:[]},t.drawings.push(i),n.push({Id:i.rId,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing`,Target:md(i.name)}));let a=nm(o,i.rels,{getBookImage:e=>t.media[e],nextRId:e=>r(e)});i.anchors.push(...a.anchors),i.rels=a.rels}if(s.length>0){let{drawing:i}=e;i||(i=e.drawing={rId:r(n),name:`drawing${++t.drawingsCount}`,anchors:[],rels:[]},t.drawings.push(i),n.push({Id:i.rId,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing`,Target:md(i.name)}));for(let n of s){let a=t.media[n.imageId];if(!a)continue;let o=r(i.rels);i.rels.push({Id:o,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,Target:tm(a)});let s=n.opacity===void 0?.15:n.opacity,c=Math.round(Math.max(0,Math.min(1,s))*1e5),l=e.dimensions,u=l?Math.max(l.model?.right??100,100):100,d=l?Math.max(l.model?.bottom??200,200):200;i.anchors.push({picture:{rId:o,alphaModFix:c},range:{editAs:`absolute`,tl:{nativeCol:0,nativeColOff:0,nativeRow:0,nativeRowOff:0},br:{nativeCol:u,nativeColOff:0,nativeRow:d,nativeRowOff:0}}})}}if(c.length>0){let a=c[0],o=t.media[a.imageId];if(o){let s=r(n);n.push({Id:s,Type:F.VmlDrawing,Target:pd(i)}),e.headerImage={vmlRelId:s,imageId:a.imageId,bookImage:o,headerWidth:a.headerWidth,headerHeight:a.headerHeight},t.hasHeaderWatermark=!0,e.headerFooter||={};let c=a.applyTo||`all`,l=t=>{let n=e.headerFooter[t]||``;return n.includes(`&G`)?n:n.includes(`&C`)?n.replace(`&C`,`&C&G`):n+`&C&G`};(c===`all`||c===`odd`)&&(e.headerFooter.oddHeader=l(`oddHeader`)),(c===`all`||c===`even`)&&(e.headerFooter.evenHeader=l(`evenHeader`),e.headerFooter.differentOddEven=!0),(c===`all`||c===`first`)&&(e.headerFooter.firstHeader=l(`firstHeader`),e.headerFooter.differentFirst=!0)}}if(e.tables.forEach(e=>{let i=r(n);e.rId=i,n.push({Id:i,Type:F.Table,Target:gd(e.target)}),e.columns.forEach(e=>{let{style:n}=e;n&&(e.dxfId=t.styles.addDxfStyle(n))})}),(e.pivotTables??[]).forEach(e=>{n.push({Id:r(n),Type:F.PivotTable,Target:hd(e.tableNumber)})}),e.formControls&&e.formControls.length>0){let{drawing:a}=e;a||(a=e.drawing={rId:r(n),name:`drawing${++t.drawingsCount}`,anchors:[],rels:[]},t.drawings.push(a),n.push({Id:a.rId,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing`,Target:md(a.name)})),e.comments.length===0&&n.push({Id:r(n),Type:F.VmlDrawing,Target:fd(i)});let o=e=>({nativeCol:e.col,nativeColOff:e.colOff,nativeRow:e.row,nativeRowOff:e.rowOff});for(let i of e.formControls){let e=t.formControlRefs.length+1;i.ctrlPropId=e;let s=r(n);i.ctrlPropRelId=s,n.push({Id:s,Type:F.CtrlProp,Target:yd(e)}),t.formControlRefs.push(e);let c=`Check Box ${Math.max(1,i.shapeId-1024)}`;a.anchors.push({range:{editAs:`absolute`,tl:o(i.tl),br:o(i.br)},alternateContent:{requires:`a14`},shape:{cNvPrId:i.shapeId,name:i.name||c,hidden:!0,spid:`_x0000_s${i.shapeId}`,text:i.text}})}}this.map.extLst.prepare(e,t)}render(t,n){t.openXml(z);let r={...e.WORKSHEET_ATTRIBUTES};n.formControls&&n.formControls.length>0&&(r[`xmlns:x14`]=`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`,r[`xmlns:xdr`]=`http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing`,r[`mc:Ignorable`]=`${r[`mc:Ignorable`]} x14`),t.openNode(`worksheet`,r);let i=n.properties?{defaultRowHeight:n.properties.defaultRowHeight,dyDescent:n.properties.dyDescent,outlineLevelCol:n.properties.outlineLevelCol,outlineLevelRow:n.properties.outlineLevelRow,customHeight:n.properties.customHeight}:void 0;n.properties&&n.properties.defaultColWidth&&(i.defaultColWidth=n.properties.defaultColWidth);let a={outlineProperties:n.properties&&n.properties.outlineProperties,tabColor:n.properties&&n.properties.tabColor,pageSetup:n.pageSetup&&n.pageSetup.fitToPage?{fitToPage:n.pageSetup.fitToPage}:void 0},o=n.pageSetup&&n.pageSetup.margins,s={showRowColHeaders:n.pageSetup&&n.pageSetup.showRowColHeaders,showGridLines:n.pageSetup&&n.pageSetup.showGridLines,horizontalCentered:n.pageSetup&&n.pageSetup.horizontalCentered,verticalCentered:n.pageSetup&&n.pageSetup.verticalCentered},c=n.sheetProtection;if(this.map.sheetPr.render(t,a),this.map.dimension.render(t,n.dimensions),this.map.sheetViews.render(t,n.views),this.map.sheetFormatPr.render(t,i),this.map.cols.render(t,n.cols),this.map.sheetData.render(t,n.rows),this.map.sheetProtection.render(t,c),this.map.autoFilter.render(t,n.autoFilter),this.map.mergeCells.render(t,n.mergeCells),this.map.conditionalFormatting.render(t,n.conditionalFormattings),this.map.dataValidations.render(t,n.dataValidations),this.map.hyperlinks.render(t,n.hyperlinks),this.map.printOptions.render(t,s),this.map.pageMargins.render(t,o),this.map.pageSetup.render(t,n.pageSetup),this.map.headerFooter.render(t,n.headerFooter),this.map.rowBreaks.render(t,n.rowBreaks),this.map.colBreaks.render(t,n.colBreaks),this.map.drawing.render(t,n.drawing),this.map.picture.render(t,n.background),n.rels&&n.rels.forEach(e=>{if(e.Type===F.VmlDrawing){if(n.headerImage&&e.Id===n.headerImage.vmlRelId)return;t.leafNode(`legacyDrawing`,{"r:id":e.Id})}}),n.headerImage&&t.leafNode(`legacyDrawingHF`,{"r:id":n.headerImage.vmlRelId}),n.formControls&&n.formControls.length>0){t.openNode(`mc:AlternateContent`),t.openNode(`mc:Choice`,{Requires:`x14`}),t.openNode(`controls`);for(let e of n.formControls){if(!e.ctrlPropRelId)continue;let n=`Check Box ${Math.max(1,e.shapeId-1024)}`;t.openNode(`mc:AlternateContent`),t.openNode(`mc:Choice`,{Requires:`x14`}),t.openNode(`control`,{shapeId:e.shapeId,"r:id":e.ctrlPropRelId,name:e.name||n}),t.openNode(`controlPr`,{locked:0,defaultSize:0,print:+!!e.print,autoFill:0,autoLine:0,autoPict:0}),t.openNode(`anchor`),t.openNode(`from`),t.leafNode(`xdr:col`,void 0,e.tl.col),t.leafNode(`xdr:colOff`,void 0,e.tl.colOff),t.leafNode(`xdr:row`,void 0,e.tl.row),t.leafNode(`xdr:rowOff`,void 0,e.tl.rowOff),t.closeNode(),t.openNode(`to`),t.leafNode(`xdr:col`,void 0,e.br.col),t.leafNode(`xdr:colOff`,void 0,e.br.colOff),t.leafNode(`xdr:row`,void 0,e.br.row),t.leafNode(`xdr:rowOff`,void 0,e.br.rowOff),t.closeNode(),t.closeNode(),t.closeNode(),t.closeNode(),t.closeNode(),t.leafNode(`mc:Fallback`),t.closeNode()}t.closeNode(),t.closeNode(),t.leafNode(`mc:Fallback`),t.closeNode()}this.map.ignoredErrors.render(t,n.ignoredErrors),this.map.tableParts.render(t,n.tables),this.map.extLst.render(t,n),t.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===`worksheet`?(Object.values(this.map).forEach(e=>{e.reset()}),!0):(this.map[e.name]&&!this.ignoreNodes.includes(e.name)&&(this.parser=this.map[e.name],this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`worksheet`:{let e=this.map.sheetFormatPr.model||{};this.map.sheetPr.model&&this.map.sheetPr.model.tabColor&&(e.tabColor=this.map.sheetPr.model.tabColor),this.map.sheetPr.model&&this.map.sheetPr.model.outlineProperties&&(e.outlineProperties=this.map.sheetPr.model.outlineProperties);let t={fitToPage:this.map.sheetPr.model&&this.map.sheetPr.model.pageSetup&&this.map.sheetPr.model.pageSetup.fitToPage||!1,margins:this.map.pageMargins.model},n=Object.assign(t,this.map.pageSetup.model,this.map.printOptions.model),r=xy(this.map.conditionalFormatting.model,this.map.extLst.model&&this.map.extLst.model[`x14:conditionalFormattings`]);return this.model={dimensions:this.map.dimension.model,cols:this.map.cols.model,rows:this.map.sheetData.model,mergeCells:this.map.mergeCells.model,hyperlinks:this.map.hyperlinks.model,dataValidations:this.map.dataValidations.model,properties:e,views:this.map.sheetViews.model,pageSetup:n,headerFooter:this.map.headerFooter.model,background:this.map.picture.model,drawing:this.map.drawing.model,tables:this.map.tableParts.model,conditionalFormattings:r,rowBreaks:this.map.rowBreaks.model??[],colBreaks:this.map.colBreaks.model??[],ignoredErrors:this.map.ignoredErrors.model??[]},this.map.autoFilter.model&&(this.model.autoFilter=this.map.autoFilter.model),this.map.sheetProtection.model&&(this.model.sheetProtection=this.map.sheetProtection.model),!1}default:return!0}}reconcile(e,t){let n=e.relationships??[],r=n.reduce((e,t)=>(e[t.Id]=t,e),{});for(let r of n)if(r.Type===F.Comments){let n=bd(`xl/worksheets/`,r.Target),i=t.comments?.[n];i&&(e.comments=i.comments)}if(e.comments&&e.comments.length){for(let r of n)if(r.Type===F.VmlDrawing){let n=bd(`xl/worksheets/`,r.Target),i=t.vmlDrawings?.[n];if(i){let t=i.comments,n={},r=!1;for(let e of t)if(e.row!=null&&e.col!=null){let t=M.encodeAddress(e.row,e.col);n[t]=e,r=!0}if(r)for(let t of e.comments){let e=n[t.ref];e&&(t.note=Object.assign({},t.note,e))}else e.comments.forEach((e,n)=>{n<t.length&&(e.note=Object.assign({},e.note,t[n]))})}}}if(t.commentsMap=(e.comments??[]).reduce((e,t)=>(t.ref&&(e[t.ref]=t),e),{}),t.hyperlinkMap=(e.hyperlinks??[]).reduce((e,t)=>{if(t.rId){let n=r[t.rId];n&&(e[t.address]=n.Target)}else t.target&&(e[t.address]=t.target);return e},{}),t.formulae={},e.rows){e.rows.includes(void 0)&&(e.rows=e.rows.filter(Boolean));for(let t=0;t<e.rows.length;t++){let n=e.rows[t];n.cells?.includes(void 0)&&(n.cells=n.cells.filter(Boolean))}}else e.rows=[];if(this.map.cols.reconcile(e.cols,t),this.map.sheetData.reconcile(e.rows,t),this.map.conditionalFormatting.reconcile(e.conditionalFormattings,t),e.media=[],e.drawing){let n=r[e.drawing.rId];if(n){let r=n.Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if(r){let n=r[1],i=t.drawings[n];i?(e.drawing={...i,name:n,rels:t.drawingRels?.[n]??i.rels??[]},i.anchors.forEach(t=>{t.medium&&(t.medium.alphaModFix!==void 0&&t.medium.alphaModFix<1e5?e.media.push({type:`watermark`,imageId:t.medium.index,opacity:t.medium.alphaModFix/1e5}):e.media.push({type:`image`,imageId:t.medium.index,range:t.range,hyperlinks:t.picture.hyperlinks}))})):e.drawing=void 0}else e.drawing=void 0}else e.drawing=void 0}let i=e.background&&r[e.background.rId];if(i){let n=i.Target.split(`/media/`)[1],r=t.mediaIndex&&t.mediaIndex[n];r!==void 0&&e.media.push({type:`background`,imageId:r})}else e.background&&=void 0;e.tables=(e.tables??[]).reduce((e,n)=>{let i=r[n.rId];if(i){let n=bd(`xl/worksheets/`,i.Target),r=t.tables[n];r&&e.push(r)}return e},[]),e.pivotTables=[],(e.relationships??[]).forEach(n=>{if(n.Type===F.PivotTable&&t.pivotTables){let r=bd(`xl/worksheets/`,n.Target),i=t.pivotTables[r];i&&e.pivotTables.push(i)}}),delete e.relationships,delete e.hyperlinks,delete e.comments}},Cy=class extends U{constructor(){super(),this.model={val:``}}get tag(){return`customFilter`}render(e,t){e.leafNode(this.tag,{val:t.val,operator:t.operator})}parseOpen(e){return e.name===this.tag?(this.model={val:e.attributes.val,operator:e.attributes.operator},!0):!1}parseText(){}parseClose(){return!1}},wy=class extends U{constructor(){super(),this.model={val:``}}get tag(){return`filter`}render(e,t){e.leafNode(this.tag,{val:t.val})}parseOpen(e){return e.name===this.tag?(this.model={val:e.attributes.val},!0):!1}parseText(){}parseClose(){return!1}},Ty=class extends U{constructor(){super(),this.map={customFilters:new W({tag:`customFilters`,count:!1,empty:!0,childXform:new Cy}),filters:new W({tag:`filters`,count:!1,empty:!0,childXform:new wy})},this.model={filterButton:!1}}get tag(){return`filterColumn`}prepare(e,t){e.colId=t.index.toString()}render(e,t){if(t.customFilters){e.openNode(this.tag,{colId:t.colId,hiddenButton:t.filterButton?`0`:`1`}),this.map.customFilters.render(e,t.customFilters),e.closeNode();return}e.leafNode(this.tag,{colId:t.colId,hiddenButton:t.filterButton?`0`:`1`})}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;let{attributes:t}=e;switch(e.name){case this.tag:return this.model={filterButton:t.hiddenButton===`0`},!0;case`dynamicFilter`:return!0;default:if(this.parser=this.map[e.name],this.parser)return this.parseOpen(e),!0;throw new jr(`filterColumn`,`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.customFilters=this.map.customFilters.model,!1;default:return!0}}},Ey=class extends U{constructor(){super(),this.map={filterColumn:new Ty},this.model={autoFilterRef:``,columns:[]}}get tag(){return`autoFilter`}prepare(e){e.columns.forEach((e,t)=>{this.map.filterColumn.prepare(e,{index:t})})}render(e,t){e.openNode(this.tag,{ref:t.autoFilterRef}),t.columns.forEach(t=>{this.map.filterColumn.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:return this.model={autoFilterRef:e.attributes.ref,columns:[]},!0;default:if(this.parser=this.map[e.name],this.parser)return this.parseOpen(e),!0;throw new jr(`autoFilter`,`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.columns.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:throw new jr(`autoFilter`,`Unexpected xml node in parseClose: ${e}`)}}},Dy=class extends U{constructor(){super(),this._childText=``,this.model={name:``}}get tag(){return`tableColumn`}prepare(e,t){e.id=t.index+1}_renderAttributes(e){return{id:e.id.toString(),name:Rc(e.name),totalsRowLabel:e.totalsRowLabel?Rc(e.totalsRowLabel):void 0,totalsRowFunction:e.totalsRowFunction===`none`?void 0:e.totalsRowFunction,dxfId:e.dxfId}}render(e,t){t.calculatedColumnFormula||t.totalsRowFormula?(e.openNode(this.tag,this._renderAttributes(t)),t.calculatedColumnFormula&&e.leafNode(`calculatedColumnFormula`,void 0,t.calculatedColumnFormula),t.totalsRowFormula&&e.leafNode(`totalsRowFormula`,void 0,t.totalsRowFormula),e.closeNode()):e.leafNode(this.tag,this._renderAttributes(t))}parseOpen(e){if(e.name===this.tag){let{attributes:t}=e;return this.model={name:Pc(t.name),totalsRowLabel:t.totalsRowLabel?Pc(t.totalsRowLabel):void 0,totalsRowFunction:t.totalsRowFunction,dxfId:t.dxfId},!0}return(e.name===`calculatedColumnFormula`||e.name===`totalsRowFormula`)&&(this._childTag=e.name,this._childText=``),!0}parseText(e){this._childTag&&(this._childText+=e)}parseClose(e){return e===this.tag?!1:(this._childTag&&e===this._childTag&&(this.model[this._childTag]=this._childText,this._childTag=void 0),!0)}},Oy=class extends U{constructor(){super(),this.model={theme:null,showFirstColumn:!1,showLastColumn:!1,showRowStripes:!1,showColumnStripes:!1}}get tag(){return`tableStyleInfo`}render(e,t){e.leafNode(this.tag,{name:t.theme?t.theme:void 0,showFirstColumn:t.showFirstColumn?`1`:`0`,showLastColumn:t.showLastColumn?`1`:`0`,showRowStripes:t.showRowStripes?`1`:`0`,showColumnStripes:t.showColumnStripes?`1`:`0`})}parseOpen(e){if(e.name===this.tag){let{attributes:t}=e;return this.model={theme:t.name?t.name:null,showFirstColumn:t.showFirstColumn===`1`,showLastColumn:t.showLastColumn===`1`,showRowStripes:t.showRowStripes===`1`,showColumnStripes:t.showColumnStripes===`1`},!0}return!1}parseText(){}parseClose(){return!1}},ky=class e extends U{constructor(){super(),this.map={autoFilter:new Ey,tableColumns:new W({tag:`tableColumns`,count:!0,empty:!0,childXform:new Dy}),tableStyleInfo:new Oy},this.model={id:0,name:``,tableRef:``,columns:[]}}prepare(e,t){this.map.autoFilter.prepare(e),this.map.tableColumns.prepare(e.columns,t)}get tag(){return`table`}render(t,n){t.openXml(z),t.openNode(this.tag,{...e.TABLE_ATTRIBUTES,id:n.id,name:n.name,displayName:n.displayName||n.name,ref:n.tableRef,totalsRowCount:n.totalsRow?`1`:void 0,headerRowCount:n.headerRow?void 0:`0`}),this.map.autoFilter.render(t,n),this.map.tableColumns.render(t,n.columns),this.map.tableStyleInfo.render(t,n.style),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;let{name:t,attributes:n}=e;switch(t){case this.tag:this.reset(),this.model={name:n.name,displayName:n.displayName||n.name,tableRef:n.ref,totalsRow:n.totalsRowCount===`1`,headerRow:n.headerRowCount!==`0`};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.columns=this.map.tableColumns.model,this.map.autoFilter.model&&(this.model.autoFilterRef=this.map.autoFilter.model.autoFilterRef,this.map.autoFilter.model.columns.forEach((e,t)=>{this.model.columns[t].filterButton=e.filterButton})),this.model.style=this.map.tableStyleInfo.model,!1;default:return!0}}reconcile(e,t){e.tableRef&&!e.ref&&(e.ref=e.tableRef),e.rows||=[],e.columns.forEach(e=>{e.dxfId!==void 0&&(e.style=t.styles.getDxfStyle(e.dxfId))})}static{this.TABLE_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`}}},Ay=class{constructor(e){this._stack=[],this._leaf=!1,this._open=!1,this._pending=``,this._target=e}get depth(){return this._stack.length}get currentElement(){return this._stack.length>0?this._stack[this._stack.length-1]:void 0}_flushOpen(e){this._target.write(this._pending+e),this._pending=``,this._open=!1}openXml(e){let t=e?{...z,...e}:z,n=`<?xml`;for(let e in t){let r=t[e];r!==void 0&&(Ec(e),n+=` ${e}="${wc(String(r))}"`)}this._target.write(n+`?>
|
|
427
|
-
`)}openNode(e,t){Ec(e),this._open&&this._flushOpen(`>`);let n=`<${e}`;if(t)for(let e in t){let r=t[e];r!==void 0&&(Ec(e),n+=` ${e}="${wc(String(r))}"`)}this._pending=n,this._stack.push(e),this._leaf=!0,this._open=!0}addAttribute(e,t){if(!this._open)throw new qs(`add attribute`,`no element is open`);Ec(e),this._pending+=` ${e}="${wc(String(t))}"`}addAttributes(e){if(!this._open)throw new qs(`add attributes`,`no element is open`);if(e)for(let t in e){let n=e[t];n!==void 0&&(Ec(t),this._pending+=` ${t}="${wc(String(n))}"`)}}writeText(e){this._open&&this._flushOpen(`>`),this._leaf=!1,this._target.write(R(String(e)))}writeRaw(e){this._open&&this._flushOpen(`>`),this._leaf=!1,this._target.write(e)}writeCData(e){this._open&&this._flushOpen(`>`),this._leaf=!1,this._target.write(Dc(e))}writeComment(e){this._open&&this._flushOpen(`>`),this._leaf=!1,Oc(e),this._target.write(`<!--${e}-->`)}closeNode(){let e=this._stack.pop();if(e===void 0)throw new qs(`close node`,`no element is open`);this._leaf&&this._open?this._flushOpen(`/>`):(this._open&&this._flushOpen(`>`),this._target.write(`</${e}>`)),this._open=!1,this._leaf=!1}leafNode(e,t,n){Ec(e),this._open&&this._flushOpen(`>`);let r=`<${e}`;if(t)for(let e in t){let n=t[e];n!==void 0&&(Ec(e),r+=` ${e}="${wc(String(n))}"`)}n===void 0?r+=`/>`:r+=`>${R(String(n))}</${e}>`,this._target.write(r),this._leaf=!1}closeAll(){for(;this._stack.length>0;)this.closeNode()}},jy=class e{static{this.textEncoder=new TextEncoder}constructor(e){this.events=new Map,this.pipedStream=null,this.finalized=!1,this._needsDrain=!1,this._drainResolvers=[],this._pendingWrites=0,this._pendingWriteResolvers=[],this._earlyError=null,this.level=e?.level??6,this.modTime=e?.modTime,this.timestamps=e?.timestamps,this.zip=new Fp((e,t,n)=>{if(e){this._emit(`error`,e);return}t&&t.length>0&&(this._emit(`data`,t),this.pipedStream&&this._checkBackpressure(this.pipedStream.write(t))),n&&(this.pipedStream&&this.pipedStream.end(),this._emit(`finish`))})}_emit(e,...t){if(e===`error`){let n=this.events.get(e);if(!n||n.size===0){this._earlyError=t[0]instanceof Error?t[0]:Error(String(t[0]));return}}let n=this.events.get(e);if(n)for(let e of n)e(...t)}_checkBackpressure(e){if(e instanceof Promise){this._pendingWrites++,e.then(e=>{e||(this._needsDrain=!0)},()=>{}).finally(()=>{if(this._pendingWrites--,this._pendingWrites===0){let e=this._pendingWriteResolvers.splice(0);for(let t of e)t()}});return}e===!1&&(this._needsDrain=!0)}on(e,t){let n=this.events.get(e)||new Set;if(n.add(t),this.events.set(e,n),e===`error`&&this._earlyError){let e=this._earlyError;this._earlyError=null,t(e)}return this}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};return this.on(e,n)}off(e,t){let n=this.events.get(e);return n?(n.delete(t),n.size===0&&this.events.delete(e),this):this}pipe(e){this.pipedStream=e,e&&typeof e.on==`function`&&e.on(`drain`,()=>{this._needsDrain=!1;let e=this._drainResolvers.splice(0);for(let t of e)t()})}async waitForDrain(){if(this._pendingWrites>0&&await new Promise(e=>{this._pendingWriteResolvers.push(e)}),!(!this._needsDrain||!this.pipedStream))return new Promise(e=>{this._drainResolvers.push(e)})}append(t,n){if(this.finalized)throw new Pr(`append`,`stream already finalized`);let r;r=n.base64?kc(typeof t==`string`?t:String(t)):typeof t==`string`?e.textEncoder.encode(t):t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t instanceof ArrayBuffer?new Uint8Array(t):t;let i=new Pp(n.name,{level:this.level,modTime:this.modTime,timestamps:this.timestamps});this.zip.add(i),i.push(r,!0)}createEntry(t){if(this.finalized)throw new Pr(`createEntry`,`stream already finalized`);let n=new Pp(t,{level:this.level,modTime:this.modTime,timestamps:this.timestamps});this.zip.add(n);let r=e.textEncoder;return{write(e){n.push(r.encode(e))},end(){n.push(new Uint8Array,!0)}}}finalize(){this.finalized||(this.finalized=!0,this.zip.end())}};function My(e){let t=/(?:^|\/)externalLink(\d+)[.]xml$/.exec(e);return t?parseInt(t[1],10):void 0}function Ny(e,t){t&&(e.sheetNames.includes(t)||e.sheetNames.push(t))}var Py=class e{static{this.RelType=F}constructor(e){this.workbook=e}createBinaryStream(e){let t=new or;return t.end(e),t}createTextStream(e){let t=new or;return t.end(e),t}createStreamBuf(){return new Mh}bufferToString(e){return $c(e)}createZipWriter(e){return new jy(e)}async writeToZip(e,t){let{model:n}=this.workbook;this.prepareModel(n,t),await this.addContentTypes(e,n),await this.addOfficeRels(e,n),await this.addWorkbookRels(e,n),await this.addWorkbook(e,n),await this.addWorksheets(e,n),await this.addSharedStrings(e,n),await this.addDrawings(e,n),await this.addTables(e,n),await this.addPivotTables(e,n),await this.addExternalLinks(e,n),this.addPassthrough(e,n),await this.addThemes(e,n),await this.addStyles(e,n),await this.addFeaturePropertyBag(e,n),await this.addMetadata(e,n),await this.addMedia(e,n),await this.addApp(e,n),await this.addCore(e,n)}async read(e,t){let n=[];return await new Promise((t,r)=>{let i=e=>{n.push(e)},a=()=>{e.off(`data`,i),e.off(`end`,a),e.off(`error`,o),t()},o=t=>{e.off(`data`,i),e.off(`end`,a),e.off(`error`,o),r(t)};e.on(`data`,i),e.on(`end`,a),e.on(`error`,o)}),this.loadBuffer(E(n),t)}async write(e,t){t||={},t.zip=t.zip||{},t.zip.modTime??=this.workbook.modified??this.workbook.created;let n=this.createZipWriter(t.zip);return n.pipe(e),await this.writeToZip(n,t),this._finalize(n)}async load(e,t){if(e==null)throw new Nr(`<input>`,`read`,`Can't read the data of 'the loaded zip file'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?`);let n;if(typeof e==`string`){if(!t?.base64)throw new Nr(`<input>`,`read`,`Can't read the data of 'the loaded zip file'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ? String input requires options.base64 === true (base64-encoded zip archive).`);n=kc(e)}else if(e instanceof Uint8Array)n=e;else if(e instanceof ArrayBuffer)n=new Uint8Array(e);else if(ArrayBuffer.isView(e))n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);else throw new Nr(`<input>`,`read`,`Can't read the data of 'the loaded zip file'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?`);return this.loadBuffer(n,t)}async loadBuffer(e,t){let n=await new vv(e).extractAll(),r={};for(let[e,t]of n)r[e]=t;return this.loadFromFiles(r,t)}createEmptyModel(){return{worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},rawDrawings:{},comments:{},tables:{},vmlDrawings:{},pivotTables:{},pivotTableRels:{},pivotCacheDefinitions:{},pivotCacheRecords:{},passthrough:{},externalLinksByIndex:{},externalLinkRelsByIndex:{}}}async collectStreamData(e){let t=[];return await new Promise((n,r)=>{e.on(`data`,e=>{typeof e==`string`?t.push(new TextEncoder().encode(e)):e instanceof Uint8Array?t.push(e):t.push(new Uint8Array(e))}),e.on(`end`,()=>n()),e.on(`error`,r)}),E(t)}drawingHasChartReference(e){return e.rels&&e.rels.some(e=>e.Target&&e.Target.includes(`/charts/`))}drawingRelsHasChartReference(e){return Array.isArray(e)&&e.some(e=>typeof e?.Target==`string`&&e.Target.includes(`/charts/`))}async _processKnownEntry(e,t,n,r){let i=yu(n);if(i!==void 0)return await this._processWorksheetEntry(e,t,i,r,n),!0;switch(n){case V.rootRels:return t.globalRels=await this.parseRels(e),!0;case V.xlWorkbook:{let n=await this.parseWorkbook(e);return t.sheets=n.sheets,t.definedNames=n.definedNames,t.views=n.views,t.properties=n.properties,t.protection=n.protection,t.calcProperties=n.calcProperties,t.pivotCaches=n.pivotCaches,t.externalReferences=n.externalReferences,!0}case V.xlSharedStrings:return t.sharedStrings=new dg,await t.sharedStrings.parseStream(e),!0;case V.xlWorkbookRels:return t.workbookRels=await this.parseRels(e),!0;case V.docPropsApp:{let n=await new Lh().parseStream(e);return n&&(t.company=n.company,t.manager=n.manager),!0}case V.docPropsCore:{let n=await new Bh().parseStream(e);return Object.assign(t,n),!0}case V.xlStyles:return t.styles=new pf,await t.styles.parseStream(e),!0;case V.xlMetadata:{let n=await new zd().parseStream(e);return n&&(t.metadata=n),!0}default:return!1}}async loadFromZipEntries(e,t){let n=this.createEmptyModel();for await(let r of e){let e=!1,i=async()=>{e||(e=!0,await r.drain())};if(r.type===`Directory`){await i();continue}let a=vu(r.name),o=r.stream;try{await this._processKnownEntry(o,n,a,t)||await this._processDefaultEntry(o,n,a)||await i()}finally{try{await i()}catch{}}}return this.reconcile(n,t),this.workbook.model=n,this.workbook}async writeBuffer(e){e||={},e.zip=e.zip||{},e.zip.modTime??=this.workbook.modified??this.workbook.created;let t=this.createZipWriter(e.zip),n=this.createStreamBuf();return t.pipe(n),await this.writeToZip(t,e),await this._finalize(t),n.read()||new Uint8Array}async addMedia(e,t){await Promise.all(t.media.map(async t=>{if(t.type!==`image`)throw new Rr(`Unsupported media`);let n=Bu(`${t.name??`undefined`}.${t.extension}`);if(t.filename){if(this.readFileAsync){let r=await this.readFileAsync(t.filename);return e.append(r,{name:n})}throw new Mr(`Loading images from filename`,`not supported in this environment`)}if(t.buffer)return e.append(t.buffer,{name:n});if(t.base64){let r=t.base64.substring(t.base64.indexOf(`,`)+1);return e.append(r,{name:n,base64:!0})}throw new Rr(`Unsupported media`)}))}parseRels(e){return new Vd().parseStream(e)}parseWorkbook(e){return new Rd().parseStream(e)}parseSharedStrings(e){return new dg().parseStream(e)}reconcile(e,t){let n=new Rd,r=new Sy(t),i=new cg,a=new ky;n.reconcile(e);let o={media:e.media,mediaIndex:e.mediaIndex};if(Object.keys(e.drawings).forEach(t=>{let n=e.drawings[t],r=e.drawingRels[t];r&&(o.rels=r.reduce((e,t)=>(e[t.Id]=t,e),{}),(n.anchors??[]).forEach(e=>{let t=e.picture&&e.picture.hyperlinks;t&&o.rels[t.rId]&&(t.hyperlink=o.rels[t.rId].Target,delete t.rId)}),i.reconcile(n,o))}),e.rawDrawings&&e.drawingRels)for(let t of Object.keys(e.rawDrawings)){let n=e.drawingRels[t];n&&!this.drawingRelsHasChartReference(n)&&delete e.rawDrawings[t]}let s={styles:e.styles};Object.values(e.tables).forEach(e=>{a.reconcile(e,s)}),this._reconcilePivotTables(e);let c={styles:e.styles,sharedStrings:e.sharedStrings,media:e.media,mediaIndex:e.mediaIndex,date1904:e.properties?.date1904,drawings:e.drawings,drawingRels:e.drawingRels,comments:e.comments,tables:e.tables,vmlDrawings:e.vmlDrawings,pivotTables:e.pivotTablesIndexed,hasDynamicArrayMetadata:!!e.metadata?.hasDynamicArrays,dynamicArrayCmIndices:e.metadata?.dynamicArrayCmIndices};e.worksheets.forEach(t=>{t.relationships=e.worksheetRels[t.sheetNo],r.reconcile(t,c)}),this._reconcileExternalLinks(e),delete e.worksheetHash,delete e.worksheetRels,delete e.globalRels,delete e.sharedStrings,delete e.workbookRels,delete e.sheetDefs,e.defaultFont=e.styles?.defaultFont,delete e.styles,delete e.mediaIndex,delete e.drawings,delete e.drawingRels,delete e.vmlDrawings,delete e.pivotTableRels,delete e.metadata,delete e.externalReferences,delete e.externalLinksByIndex,delete e.externalLinkRelsByIndex}_reconcileExternalLinks(e){let t=e.externalReferences;if(!t||t.length===0){e.externalLinks||=[];return}let n=e.workbookRels??[],r=new Map;for(let e of n)e.Type===F.ExternalLink&&r.set(e.Id,e);let i=[];for(let n=0;n<t.length;n++){let a=t[n],o=r.get(a.rId);if(!o)continue;let s=My(o.Target);if(s===void 0)continue;let c=e.externalLinksByIndex[s],l=e.externalLinkRelsByIndex[s]??[],u=l.find(e=>e.Type===F.ExternalLinkPath)??l.find(e=>e.TargetMode===`External`);i.push({index:n+1,rId:a.rId,target:u?.Target??``,targetMode:u?.TargetMode??`External`,sheetNames:c?.sheetNames??[],cachedValues:c?.cachedValues??{}})}e.externalLinks=i}_normaliseExternalLinks(e){let t=this.workbook._collectExternalLinksForWrite(),n=new Map;for(let e of t)e.target&&n.set(e.target.toLowerCase(),e);let r={links:t,byTarget:n,workbook:this.workbook};for(let t of e.worksheets??[])for(let e of t.rows??[])for(let t of e.cells??[])typeof t?.formula==`string`&&t.formula.length>0&&(t.formula=this._normaliseFormulaExternalRefs(t.formula,r)),typeof t?.sharedFormula==`string`&&t.sharedFormula.length>0&&(t.sharedFormula=this._normaliseFormulaExternalRefs(t.sharedFormula,r));e.externalLinks=t}_normaliseFormulaExternalRefs(e,t){return Sv(e,e=>{if(e.numeric)return e.index!==null&&e.index>=1&&e.index<=t.links.length?(Ny(t.links[e.index-1],e.sheet),e.index):null;let n=e.workbook.toLowerCase(),r=t.byTarget.get(n);return r?(Ny(r,e.sheet),e.sheet&&t.workbook._recordAutoExternalLink(e.workbook,e.sheet)):(r={index:t.workbook._recordAutoExternalLink(e.workbook,e.sheet),target:e.workbook,targetMode:`External`,sheetNames:e.sheet?[e.sheet]:[],cachedValues:{}},t.links.push(r),t.byTarget.set(n,r)),r.index})}_reconcilePivotTables(e){let t=e.pivotTables||{};if(typeof t!=`object`||Object.keys(t).length===0){e.pivotTables=[],e.pivotTablesIndexed={};return}let n=this._buildDefinitionToCacheIdMap(e),r=new Map;Object.entries(e.pivotCacheDefinitions||{}).forEach(([t,i])=>{let a=n.get(t);if(a!==void 0){let n=t.replace(`Definition`,`Records`);r.set(a,{definition:i,records:e.pivotCacheRecords?.[n],definitionName:t})}});let i=[],a={};Object.entries(t).forEach(([e,t])=>{let n=this._extractTableNumber(e),o=r.get(t.cacheId),s=this._determineMetric(t.dataFields),c={...t,tableNumber:n,cacheId:String(t.cacheId),cacheDefinition:o?.definition,cacheRecords:o?.records,cacheFields:o?.definition?.cacheFields??[],rows:t.rowFields.filter(e=>e>=0),columns:t.colFields.filter(e=>e>=0&&e!==-2),values:t.dataFields.map(e=>e.fld),pages:t.pageFields.map(e=>e.fld),metric:s,valueMetrics:this._determineValueMetrics(t.dataFields,s),applyWidthHeightFormats:t.applyWidthHeightFormats===`1`?`1`:`0`};i.push(c),a[rd(e)]=c}),i.sort((e,t)=>e.tableNumber-t.tableNumber),e.pivotTables=i,e.pivotTablesIndexed=a}_extractTableNumber(e){let t=e.match(/pivotTable(\d+)/);return t?parseInt(t[1],10):1}_buildCacheIdMap(e){let t=new Map,n=e.pivotCaches??[];for(let e of n)e.cacheId&&e.rId&&t.set(e.rId,parseInt(e.cacheId,10));return t}_buildDefinitionToCacheIdMap(t){let n=new Map,r=this._buildCacheIdMap(t),i=t.workbookRels??[];for(let t of i)if(t.Type===e.RelType.PivotCacheDefinition&&t.Target){let e=t.Target.match(/pivotCacheDefinition(\d+)\.xml/);if(e){let i=`pivotCacheDefinition${e[1]}`,a=r.get(t.Id);a!==void 0&&n.set(i,a)}}return n}_determineMetric(e){return e.length>0&&e[0].subtotal?e[0].subtotal:`sum`}_determineValueMetrics(e,t){return e.map(e=>e.subtotal||t)}async _processWorksheetEntry(e,t,n,r,i){let a=await new Sy(r).parseStream(e);if(!a)throw new jr(i,`Failed to parse worksheet`);a.sheetNo=n,t.worksheetHash[i]=a,t.worksheets.push(a)}async _processCommentEntry(e,t,n){let r=await new Bv().parseStream(e);t.comments[n]=r}async _processTableEntry(e,t,n){let r=await new ky().parseStream(e);t.tables[n]=r}async _processWorksheetRelsEntry(e,t,n){let r=await new Vd().parseStream(e);t.worksheetRels[n]=r}async _processMediaEntry(e,t,n){let r=n.lastIndexOf(`.`);if(r>=1){let i=n.substr(r+1),a=n.substr(0,r);await new Promise((r,o)=>{let s=this.createStreamBuf(),c=()=>{e.off(`error`,u),s.off(`error`,u),s.off(`finish`,l)},l=()=>{c(),t.mediaIndex[n]=t.media.length,t.mediaIndex[a]=t.media.length;let e={type:`image`,name:a,extension:i,buffer:s.read()};t.media.push(e),r()},u=e=>{c(),o(e)};s.once(`finish`,l),e.on(`error`,u),s.on(`error`,u),e.pipe(s)})}}async _processDrawingEntry(e,t,n,r){let i=r??await this.collectStreamData(e),a=new cg,o=this.bufferToString(i),s=await a.parseStream(this.createTextStream(o));t.drawings[n]=s,t.rawDrawings[n]=i}async _processDrawingRelsEntry(e,t,n){let r=await new Vd().parseStream(e);t.drawingRels[n]=r}async _processVmlDrawingEntry(e,t,n){let r=await new Hv().parseStream(e);t.vmlDrawings[n]=r}async _processVmlDrawingHFEntry(e,t,n){let r=await new Hv().parseStream(e);r&&r.headerImage&&(t.vmlDrawingHF||={},t.vmlDrawingHF[n]=r.headerImage)}async _processThemeEntry(e,t,n){await new Promise((r,i)=>{let a=this.createStreamBuf(),o=()=>{e.off(`error`,c),a.off(`error`,c),a.off(`finish`,s)},s=()=>{o();let e=a.read();t.themes[n]=e?typeof e==`string`?e:this.bufferToString(e):``,r()},c=e=>{o(),i(e)};a.once(`finish`,s),e.on(`error`,c),a.on(`error`,c),e.pipe(a)})}async _processPivotTableEntry(e,t,n){let r=await new ly().parseStream(e);r&&(t.pivotTables[n]=r)}async _processPivotTableRelsEntry(e,t,n){let r=await new Vd().parseStream(e);t.pivotTableRels[n]=r}async _processPivotCacheDefinitionEntry(e,t,n){let r=await new ey().parseStream(e);r&&(t.pivotCacheDefinitions[n]=r)}async _processPivotCacheRecordsEntry(e,t,n){let r=await new ny().parseStream(e);r&&(t.pivotCacheRecords[n]=r)}async _processExternalLinkEntry(e,t,n){let r=await new Av().parseStream(e);r&&(t.externalLinksByIndex[n]=r)}async _processExternalLinkRelsEntry(e,t,n){let r=await this.parseRels(e);t.externalLinkRelsByIndex[n]=r??[]}async loadFromFiles(e,t){let n=this.createEmptyModel(),r=Object.keys(e).map(t=>({name:t,dir:t.endsWith(`/`),data:e[t]}));for(let e of r)if(!e.dir){let r=vu(e.name),i=Tu(r)?this.createBinaryStream(e.data):this.createTextStream(this.bufferToString(e.data));await this._processKnownEntry(i,n,r,t)||await this._processDefaultEntry(i,n,r,e.data)}return this.reconcile(n,t),this.workbook.model=n,this.workbook}async _processDefaultEntry(e,t,n,r){let i=bu(n);if(i!==void 0)return await this._processWorksheetRelsEntry(e,t,i),!0;let a=Su(n);if(a)return await this._processMediaEntry(e,t,a),!0;let o=Eu(n);if(o)return await this._processDrawingEntry(e,t,o,r),!0;let s=Du(n);if(s)return await this._processDrawingRelsEntry(e,t,s),!0;if(Ou(n))return await this._processVmlDrawingEntry(e,t,n),!0;let c=ku(n);if(c)return await this._processVmlDrawingHFEntry(e,t,c),!0;if(Au(n))return await this._processCommentEntry(e,t,n),!0;if(ju(n))return await this._processTableEntry(e,t,n),!0;let l=wu(n);if(l)return await this._processThemeEntry(e,t,l),!0;let u=Mu(n);if(u)return await this._processPivotTableEntry(e,t,u),!0;let d=Nu(n);if(d)return await this._processPivotTableRelsEntry(e,t,d),!0;let f=Pu(n);if(f)return await this._processPivotCacheDefinitionEntry(e,t,f),!0;if(Fu(n))return!0;let p=Iu(n);if(p)return await this._processPivotCacheRecordsEntry(e,t,p),!0;let m=Lu(n);if(m!==void 0)return await this._processExternalLinkEntry(e,t,m),!0;let h=Ru(n);return h===void 0?Ov.isPassthroughPath(n)?(r?t.passthrough[n]=r:await this._processPassthroughEntry(e,t,n),!0):!1:(await this._processExternalLinkRelsEntry(e,t,h),!0)}async _processPassthroughEntry(e,t,n){let r=await this.collectStreamData(e);t.passthrough[n]=r}async _renderToZip(e,t,n,r){let i=e.createEntry(t),a=new Ay(i);n.render(a,r),i.end(),await e.waitForDrain()}async addContentTypes(e,t){await this._renderToZip(e,V.contentTypes,new Rh,t)}async addApp(e,t){await this._renderToZip(e,V.docPropsApp,new Lh,t)}async addCore(e,t){await this._renderToZip(e,V.docPropsCore,new Bh,t)}async addThemes(e,t){let n=t.themes||{theme1:`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
428
|
-
<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> </a:lnStyleLst> <a:effectStyleLst> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="38000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> <a:scene3d> <a:camera prst="orthographicFront"> <a:rot lat="0" lon="0" rev="0"/> </a:camera> <a:lightRig rig="threePt" dir="t"> <a:rot lat="0" lon="0" rev="1200000"/> </a:lightRig> </a:scene3d> <a:sp3d> <a:bevelT w="63500" h="25400"/> </a:sp3d> </a:effectStyle> </a:effectStyleLst> <a:bgFillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="40000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="40000"> <a:schemeClr val="phClr"> <a:tint val="45000"/> <a:shade val="99000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="20000"/> <a:satMod val="255000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="-80000" r="50000" b="180000"/> </a:path> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="80000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="30000"/> <a:satMod val="200000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="50000" r="50000" b="50000"/> </a:path> </a:gradFill> </a:bgFillStyleLst> </a:fmtScheme> </a:themeElements> <a:objectDefaults> <a:spDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="1"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="3"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="2"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="lt1"/> </a:fontRef> </a:style> </a:spDef> <a:lnDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="2"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="0"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="1"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="tx1"/> </a:fontRef> </a:style> </a:lnDef> </a:objectDefaults> <a:extraClrSchemeLst/> </a:theme>`};Object.keys(n).forEach(t=>{let r=n[t];e.append(r,{name:zu(t)})})}async addOfficeRels(t,n){await this._renderToZip(t,V.rootRels,new Vd,[{Id:`rId1`,Type:e.RelType.OfficeDocument,Target:V.xlWorkbook},{Id:`rId2`,Type:e.RelType.CoreProperties,Target:V.docPropsCore},{Id:`rId3`,Type:e.RelType.ExtenderProperties,Target:V.docPropsApp}])}async addWorkbookRels(t,n){let r=1,i=[{Id:`rId${r++}`,Type:e.RelType.Styles,Target:ld.workbookStyles},{Id:`rId${r++}`,Type:e.RelType.Theme,Target:ld.workbookTheme1}];n.sharedStrings.count&&i.push({Id:`rId${r++}`,Type:e.RelType.SharedStrings,Target:ld.workbookSharedStrings}),n.hasCheckboxes&&i.push({Id:`rId${r++}`,Type:e.RelType.FeaturePropertyBag,Target:ld.workbookFeaturePropertyBag}),n.hasDynamicArrayFormulas&&i.push({Id:`rId${r++}`,Type:e.RelType.SheetMetadata,Target:ld.workbookMetadata});let a=new Map;(n.pivotTables??[]).forEach(t=>{let n=a.get(t.cacheId);n?t.rId=n:(t.rId=`rId${r++}`,a.set(t.cacheId,t.rId),i.push({Id:t.rId,Type:e.RelType.PivotCacheDefinition,Target:ud(t.tableNumber)}))}),n.worksheets.forEach(t=>{t.rId=`rId${r++}`,i.push({Id:t.rId,Type:e.RelType.Worksheet,Target:Uu(t.fileIndex)})});let o=n.externalLinks??[];for(let t of o)t.rId=`rId${r++}`,i.push({Id:t.rId,Type:e.RelType.ExternalLink,Target:sd(t.index)});let s=new Vd;await this._renderToZip(t,V.xlWorkbookRels,s,i)}async addFeaturePropertyBag(e,t){t.hasCheckboxes&&await this._renderToZip(e,V.xlFeaturePropertyBag,new Vh,{})}async addMetadata(e,t){t.hasDynamicArrayFormulas&&await this._renderToZip(e,V.xlMetadata,new zd,{dynamicArrayCount:t.dynamicArrayCount})}async addSharedStrings(e,t){t.sharedStrings&&t.sharedStrings.count&&await this._renderToZip(e,V.xlSharedStrings,t.sharedStrings,t.sharedStrings.model)}async addStyles(e,t){t.styles&&await this._renderToZip(e,V.xlStyles,t.styles,t.styles.model)}async addWorkbook(e,t){await this._renderToZip(e,V.xlWorkbook,new Rd,t)}async addWorksheets(e,t){let n=new Sy,r=new Vd,i=new Bv,a=new Hv,o=new Vv;for(let s of t.worksheets){let{fileIndex:t}=s,c=e.createEntry(Vu(t)),l=new Ay(c);n.render(l,s),c.end(),await e.waitForDrain(),s.rels&&s.rels.length&&await this._renderToZip(e,Hu(t),r,s.rels),s.comments.length>0&&await this._renderToZip(e,Wu(t),i,s);let u=s.comments.length>0,d=s.formControls&&s.formControls.length>0;if((u||d)&&await this._renderToZip(e,Ku(t),a,{comments:u?s.comments:[],formControls:d?s.formControls:[]}),s.headerImage){let n=s.headerImage,i=n.bookImage,o=`../media/${i.name&&i.extension&&i.name.endsWith(`.${i.extension}`)?i.name:`${i.name}.${i.extension}`}`;await this._renderToZip(e,qu(t),a,{comments:[],formControls:[],headerImage:{imageRelId:`rId1`,width:n.headerWidth,height:n.headerHeight}}),await this._renderToZip(e,Ju(t),r,[{Id:`rId1`,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,Target:o}])}if(d)for(let t of s.formControls)await this._renderToZip(e,vd(t.ctrlPropId),o,t)}}async addDrawings(e,t){let n=new cg,r=new Vd,i=t.rawDrawings||{};for(let a of t.worksheets){let{drawing:t}=a;if(t){if(this.drawingHasChartReference(t)&&i[t.name])e.append(i[t.name],{name:Xu(t.name)});else{let r=rm(t.anchors??[]),i=t.anchors?{...t,anchors:r}:t;n.prepare(i),await this._renderToZip(e,Xu(t.name),n,i)}await this._renderToZip(e,Zu(t.name),r,t.rels)}}}async addTables(e,t){let n=new ky;for(let r of t.worksheets)for(let t of r.tables)n.prepare(t,{}),await this._renderToZip(e,Yu(t.target),n,t)}async addExternalLinks(t,n){let r=n.externalLinks??[];if(r.length===0)return;let i=new Av,a=new Vd;for(let n of r)await this._renderToZip(t,ad(n.index),i,n),await this._renderToZip(t,od(n.index),a,[{Id:`rId1`,Type:e.RelType.ExternalLinkPath,Target:n.target,TargetMode:n.targetMode??`External`}])}addPassthrough(e,t){let n=new Ov;n.fromRecord(t.passthrough||{}),n.writeToZip(e)}async addPivotTables(t,n){if(!n.pivotTables.length)return;let r=new ny,i=new ey,a=new ly,o=new Vd,s=new Map;for(let c of n.pivotTables){let n=c.tableNumber,l=c.isLoaded,u=c.cacheId;if(!s.has(u)&&(s.set(u,n),l?(c.cacheDefinition&&await this._renderToZip(t,Qu(n),i,c.cacheDefinition),c.cacheRecords&&await this._renderToZip(t,ed(n),r,c.cacheRecords)):(await this._renderToZip(t,ed(n),r,c),await this._renderToZip(t,Qu(n),i,c)),!l||c.cacheRecords)){let r=(l?c.cacheDefinition?.rId:void 0)??`rId1`;await this._renderToZip(t,$u(n),o,[{Id:r,Type:e.RelType.PivotCacheRecords,Target:td(n)}])}await this._renderToZip(t,nd(n),a,c);let d=s.get(u);await this._renderToZip(t,id(n),o,[{Id:`rId1`,Type:e.RelType.PivotCacheDefinition,Target:cd(d)}])}}_finalize(e){return new Promise((t,n)=>{e.on(`finish`,()=>{t(this)}),e.on(`error`,n),e.finalize()})}prepareModel(e,t){e.creator=e.creator??`ExcelTS`,e.lastModifiedBy=e.lastModifiedBy??`ExcelTS`,e.created=e.created??new Date,e.modified=e.modified??new Date,e.useSharedStrings=t.useSharedStrings===void 0?!0:t.useSharedStrings,e.useStyles=t.useStyles===void 0?!0:t.useStyles,e.sharedStrings=new dg;let n=e.defaultFont;e.styles=e.useStyles?new pf(!0):new pf.Mock,n&&e.styles.setDefaultFont&&e.styles.setDefaultFont(n);let r=new Rd,i=new Sy;r.prepare(e),this._normaliseExternalLinks(e);let a={sharedStrings:e.sharedStrings,styles:e.styles,date1904:e.properties?.date1904,drawingsCount:0,media:e.media};a.drawings=e.drawings=[],a.commentRefs=e.commentRefs=[],a.formControlRefs=e.formControlRefs=[],e.hasHeaderWatermark=!1;let o=0;e.tables=[];let s=new Map;e.worksheets.forEach((t,n)=>{t.fileIndex=n+1,t.tables.forEach(n=>{let r=n.name.toLowerCase(),i=s.get(r);if(i!==void 0)throw new Lr(`Duplicate table name "${n.name}": already used in worksheet "${i}". Table names must be unique across the entire workbook (case-insensitive).`);s.set(r,t.name),o++,n.target=`table${o}.xml`,n.id=o,e.tables.push(n)}),i.prepare(t,a)}),e.hasCheckboxes=e.styles.hasCheckboxes;let c=0;e.worksheets.forEach(e=>{(e.rows??[]).forEach(e=>{(e.cells??[]).forEach(e=>{e.isDynamicArray&&c++})})}),e.hasDynamicArrayFormulas=c>0,e.dynamicArrayCount=c,a.hasHeaderWatermark&&(e.hasHeaderWatermark=!0);let l=e.passthrough||{},u=new Ov;u.fromRecord(l),e.passthroughContentTypes=u.getContentTypes()}};function Fy(e){throw Error("No formula engine is installed. Call `installFormulaEngine()` from `@cj-tech-master/excelts/formula` once at startup to enable `Workbook.calculateFormulas()` and automatic recalculation during `excelToPdf()`.")}let Iy=/\r\n|\r|\n/,Ly=/\r\n|[|\\\r\n]/g,Ry=/\\([|\\])/g,zy=/<br\s*\/?>/gi,By=/\r\n|\r|\n/g;function Vy(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r>=55296&&r<=56319&&n+1<e.length){let r=e.charCodeAt(n+1);if(r>=56320&&r<=57343){t+=2,n++;continue}}if(!(r===8203||r===8204||r===8205||r===65279)&&!(r>=768&&r<=879||r>=6832&&r<=6911||r>=7616&&r<=7679||r>=8400&&r<=8447||r>=65056&&r<=65071)){if(r>=4352&&r<=4447||r>=11904&&r<=12350||r>=12352&&r<=13247||r>=13312&&r<=19903||r>=19968&&r<=42191||r>=43360&&r<=43391||r>=44032&&r<=55215||r>=63744&&r<=64255||r>=65040&&r<=65049||r>=65072&&r<=65135||r>=65281&&r<=65376||r>=65504&&r<=65510){t+=2;continue}t+=1}}return t}function Hy(e){if(e==null)return``;if(e instanceof Date)return e.toISOString();if(typeof e==`object`)try{return JSON.stringify(e)}catch{return`[object Object]`}return String(e)}function Uy(e){return e.replace(Ly,e=>e===`|`||e===`\\`?`\\`+e:`<br>`)}function Wy(e){return e.indexOf(`
|
|
429
|
-
`)!==-1||e.indexOf(`\r`)!==-1?e.replace(
|
|
426
|
+
</r>`)}return n.join(``)}renderCellNew(e,t){if(e==null||typeof e==`number`&&!Number.isFinite(e)){if(t===null)return`<m />`;let e=t.indexOf(null);return e>=0?`<x v="${e}" />`:`<m />`}if(t===null)return e instanceof Hg?`<e v="${Mc(e.code)}" />`:typeof e==`boolean`?`<b v="${e?`1`:`0`}" />`:e instanceof Date?`<d v="${sy(e)}" />`:Number.isFinite(e)?`<n v="${e}" />`:`<s v="${Mc(String(e))}" />`;let n=xy(t,e);if(n<0)throw new Br(`${JSON.stringify(e)} not in sharedItems ${JSON.stringify(t)}`);return`<x v="${n}" />`}parseOpen(e){let{name:t,attributes:n}=e;switch(t){case this.tag:{this.reset();let e={};for(let[t,r]of Object.entries(n))yy.has(t)||(e[t]=String(r));this.model={records:[],count:parseInt(n.count??`0`,10),isLoaded:!0,extraRootAttrs:Object.keys(e).length>0?e:void 0};break}case`r`:this.currentRecord=[];break;case`x`:this.currentRecord&&this.currentRecord.push({type:`x`,value:parseInt(n.v??`0`,10)});break;case`n`:this.currentRecord&&(n.v===void 0||n.v===``?this.currentRecord.push({type:`m`}):this.currentRecord.push({type:`n`,value:parseFloat(n.v)}));break;case`s`:this.currentRecord&&this.currentRecord.push({type:`s`,value:n.v??``});break;case`b`:this.currentRecord&&this.currentRecord.push({type:`b`,value:n.v===`1`});break;case`m`:this.currentRecord&&this.currentRecord.push({type:`m`});break;case`d`:if(this.currentRecord)if(!n.v)this.currentRecord.push({type:`m`});else{let e=Vc(n.v);isNaN(e.getTime())?this.currentRecord.push({type:`m`}):this.currentRecord.push({type:`d`,value:e})}break;case`e`:this.currentRecord&&this.currentRecord.push({type:`e`,value:n.v??``});break}return!0}parseText(e){}parseClose(e){switch(e){case this.tag:return!1;case`r`:this.model&&this.currentRecord&&(this.model.records.push(this.currentRecord),this.currentRecord=null);break}return!0}static{this.PIVOT_CACHE_RECORDS_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`xr`,"xmlns:xr":`http://schemas.microsoft.com/office/spreadsheetml/2014/revision`}}};function xy(e,t){if(t instanceof Date){let n=t.getTime();for(let t=0;t<e.length;t++){let r=e[t];if(r instanceof Date&&r.getTime()===n)return t}return-1}if(t instanceof Hg){for(let n=0;n<e.length;n++){let r=e[n];if(r instanceof Hg&&r.code===t.code)return n}return-1}return e.indexOf(t)}let Sy=`PivotStyleLight16`,Cy=new Set([`axisRow`,`axisCol`,`axisPage`,`axisValues`]),wy=[`x`,`t`,`h`,`sd`,`f`,`m`,`c`,`d`];function Ty(){return{currentSection:null,inPivotArea:!1,inAutoSortScope:!1}}let Ey=new Set([`axis`,`dataField`,`compact`,`outline`,`showAll`,`defaultSubtotal`,`numFmtId`,`sortType`,`subtotalTop`,`insertBlankRow`,`multipleItemSelectionAllowed`]);var Dy=class e extends N{constructor(){super(),this.state=Ty(),this.currentPivotField=null,this.currentRowItem=null,this.currentColItem=null,this.currentChartFormat=null,this.pivotAreaXmlBuffer=[],this.autoSortScopeXmlBuffer=[],this.extLstCollector=new fy(`extLst`),this.formatsCollector=new fy(`formats`),this.conditionalFormatsCollector=new fy(`conditionalFormats`),this.filtersCollector=new fy(`filters`),this.unknownCollector=new fy(``),this.unknownElementsXmlParts=[],this.model=null}get tag(){return`pivotTableDefinition`}reset(){this.model=null,this.state=Ty(),this.currentPivotField=null,this.currentRowItem=null,this.currentColItem=null,this.currentChartFormat=null,this.pivotAreaXmlBuffer=[],this.autoSortScopeXmlBuffer=[],this.extLstCollector.reset(),this.formatsCollector.reset(),this.conditionalFormatsCollector.reset(),this.filtersCollector.reset(),this.unknownCollector.reset(),this.unknownElementsXmlParts=[]}render(e,t){`isLoaded`in t&&t.isLoaded?this.renderLoaded(e,t):this.renderNew(e,t)}renderNew(t,n){let{rows:r,columns:i,values:a,pages:o=[],cacheFields:s,cacheId:c,tableNumber:l,applyWidthHeightFormats:u}=n,d=i.length===0&&a.length>1,f=o.length,p=f>0?f+1:0,m=r.length,h=3+p,g=h+1,_=m+(d?a.length:1),v=`A${h}:${O.n2l(_)}${g}`;t.openXml(A),t.openNode(this.tag,{...e.PIVOT_TABLE_ATTRIBUTES,name:`PivotTable${l}`,cacheId:c,applyNumberFormats:`0`,applyBorderFormats:`0`,applyFontFormats:`0`,applyPatternFormats:`0`,applyAlignmentFormats:`0`,applyWidthHeightFormats:u,dataCaption:`Values`,updatedVersion:`8`,minRefreshableVersion:`3`,useAutoFormatting:`1`,itemPrintTitles:`1`,createdVersion:`8`,indent:`0`,compact:`0`,compactData:`0`,multipleFieldFilters:`0`});let y={ref:v,firstHeaderRow:1,firstDataRow:1,firstDataCol:m};f>0&&(y.rowPageCount=f,y.colPageCount=1),t.leafNode(`location`,y),Ay(t,n),t.openNode(`rowFields`,{count:r.length});for(let e of r)t.leafNode(`field`,{x:e});if(t.closeNode(),t.openNode(`rowItems`,{count:1}),t.openNode(`i`,{t:`grand`}),t.leafNode(`x`),t.closeNode(),t.closeNode(),i.length>0){let e=a.length>1?i.length+1:i.length;t.openNode(`colFields`,{count:e});for(let e of i)t.leafNode(`field`,{x:e});a.length>1&&t.leafNode(`field`,{x:-2}),t.closeNode()}else d&&(t.openNode(`colFields`,{count:1}),t.leafNode(`field`,{x:-2}),t.closeNode());if(d){t.openNode(`colItems`,{count:a.length+1});for(let e=0;e<a.length;e++)t.openNode(`i`),t.leafNode(`x`,e===0?void 0:{v:e}),t.closeNode();t.openNode(`i`,{t:`grand`}),t.leafNode(`x`),t.closeNode(),t.closeNode()}else t.openNode(`colItems`,{count:1}),t.leafNode(`i`),t.closeNode();if(f>0){t.openNode(`pageFields`,{count:f});for(let e of o)t.leafNode(`pageField`,{fld:e,hier:-1});t.closeNode()}ky(t,s,a,n.valueMetrics),t.leafNode(`pivotTableStyleInfo`,{name:Sy,showRowHeaders:`1`,showColHeaders:`1`,showRowStripes:`0`,showColStripes:`0`,showLastColumn:`1`}),t.writeRaw(e.EXTLST_XML),t.closeNode()}renderLoaded(t,n){let r=this.buildLoadedRootAttributes(n);if(t.openXml(A),t.openNode(this.tag,r),n.location){let e={ref:n.location.ref,firstHeaderRow:n.location.firstHeaderRow,firstDataRow:n.location.firstDataRow,firstDataCol:n.location.firstDataCol};n.location.rowPageCount!==void 0&&(e.rowPageCount=n.location.rowPageCount),n.location.colPageCount!==void 0&&(e.colPageCount=n.location.colPageCount),t.leafNode(`location`,e)}if(n.pivotFields.length>0){t.openNode(`pivotFields`,{count:n.pivotFields.length});for(let e of n.pivotFields)this.renderPivotFieldLoaded(t,e);t.closeNode()}if(n.rowFields.length>0){t.openNode(`rowFields`,{count:n.rowFields.length});for(let e of n.rowFields)t.leafNode(`field`,{x:e});t.closeNode()}if(n.rowItems&&n.rowItems.length>0){t.openNode(`rowItems`,{count:n.rowItems.length});for(let e of n.rowItems)this.renderRowColItem(t,e);t.closeNode()}else n.hasRowItems&&t.writeRaw(`<rowItems count="1"><i t="grand"><x/></i></rowItems>`);if(n.hasColFields||n.colFields.length>0)if(n.colFields.length===0&&n.dataFields.length<=1)t.leafNode(`colFields`,{count:0});else{let e=n.colFields.length===0?1:n.colFields.length;if(t.openNode(`colFields`,{count:e}),n.colFields.length===0)t.leafNode(`field`,{x:-2});else for(let e of n.colFields)t.leafNode(`field`,{x:e});t.closeNode()}if(n.colItems&&n.colItems.length>0){t.openNode(`colItems`,{count:n.colItems.length});for(let e of n.colItems)this.renderRowColItem(t,e);t.closeNode()}else n.hasColItems&&t.writeRaw(`<colItems count="1"><i t="grand"><x/></i></colItems>`);if(n.pageFields&&n.pageFields.length>0){t.openNode(`pageFields`,{count:n.pageFields.length});for(let e of n.pageFields){let n={fld:e.fld};e.item!==void 0&&(n.item=e.item),e.hier!==void 0&&(n.hier=e.hier),e.name!==void 0&&(n.name=e.name),t.leafNode(`pageField`,n)}t.closeNode()}if(n.dataFields.length>0){t.openNode(`dataFields`,{count:n.dataFields.length});for(let e of n.dataFields){let n={name:e.name,fld:e.fld};e.baseField!==void 0&&(n.baseField=e.baseField),e.baseItem!==void 0&&(n.baseItem=e.baseItem),e.subtotal!==void 0&&e.subtotal!==`sum`&&(n.subtotal=e.subtotal),e.numFmtId!==void 0&&(n.numFmtId=e.numFmtId),t.leafNode(`dataField`,n)}t.closeNode()}n.formatsXml&&t.writeRaw(n.formatsXml),n.conditionalFormatsXml&&t.writeRaw(n.conditionalFormatsXml),n.chartFormats&&n.chartFormats.length>0&&this.renderChartFormats(t,n.chartFormats);let i=n.styleInfo;t.leafNode(`pivotTableStyleInfo`,{name:i?.name??n.styleName??Sy,showRowHeaders:i?.showRowHeaders??`1`,showColHeaders:i?.showColHeaders??`1`,showRowStripes:i?.showRowStripes??`0`,showColStripes:i?.showColStripes??`0`,showLastColumn:i?.showLastColumn??`1`}),n.filtersXml&&t.writeRaw(n.filtersXml),n.unknownElementsXml&&t.writeRaw(n.unknownElementsXml);let a=n.extLstXml??(n.isLoaded?``:e.EXTLST_XML);a&&t.writeRaw(a),t.closeNode()}buildLoadedRootAttributes(t){let n={...e.PIVOT_TABLE_ATTRIBUTES,name:t.name??`PivotTable1`,cacheId:String(t.cacheId),applyNumberFormats:t.applyNumberFormats??`0`,applyBorderFormats:t.applyBorderFormats??`0`,applyFontFormats:t.applyFontFormats??`0`,applyPatternFormats:t.applyPatternFormats??`0`,applyAlignmentFormats:t.applyAlignmentFormats??`0`,applyWidthHeightFormats:t.applyWidthHeightFormats??`0`,dataCaption:t.dataCaption??`Values`,updatedVersion:t.updatedVersion??`8`,minRefreshableVersion:t.minRefreshableVersion??`3`};return t.useAutoFormatting!==void 0&&(n.useAutoFormatting=t.useAutoFormatting),t.itemPrintTitles!==void 0&&(n.itemPrintTitles=t.itemPrintTitles),t.multipleFieldFilters!==void 0&&(n.multipleFieldFilters=t.multipleFieldFilters),n.createdVersion=t.createdVersion??`8`,t.indent!==void 0&&(n.indent=String(t.indent)),t.uid&&(n[`xmlns:xr`]=`http://schemas.microsoft.com/office/spreadsheetml/2014/revision`,n[`xr:uid`]=t.uid),t.outline&&(n.outline=`1`),t.outlineData&&(n.outlineData=`1`),t.chartFormat!==void 0&&(n.chartFormat=String(t.chartFormat)),t.colGrandTotals!==void 0&&(n.colGrandTotals=t.colGrandTotals),t.rowGrandTotals!==void 0&&(n.rowGrandTotals=t.rowGrandTotals),t.showError!==void 0&&(n.showError=t.showError),t.errorCaption!==void 0&&(n.errorCaption=t.errorCaption),t.showMissing!==void 0&&(n.showMissing=t.showMissing),t.missingCaption!==void 0&&(n.missingCaption=t.missingCaption),t.grandTotalCaption!==void 0&&(n.grandTotalCaption=t.grandTotalCaption),t.compact===!1&&(n.compact=`0`),t.compactData===!1&&(n.compactData=`0`),n}renderChartFormats(e,t){e.openNode(`chartFormats`,{count:t.length});for(let n of t)e.openNode(`chartFormat`,{chart:n.chart,format:n.format,series:n.series===!0?`1`:n.series===!1?`0`:void 0}),n.pivotAreaXml?e.writeRaw(n.pivotAreaXml):e.writeRaw(`<pivotArea type="data" outline="0" fieldPosition="0"><references count="1"><reference field="4294967294" count="1" selected="0"><x v="0"/></reference></references></pivotArea>`),e.closeNode();e.closeNode()}renderRowColItem(e,t){let n={};if(t.t!==void 0&&(n.t=t.t),t.r!==void 0&&(n.r=t.r),t.i!==void 0&&(n.i=t.i),t.x.length>0){e.openNode(`i`,n);for(let n of t.x)n.v===0?e.leafNode(`x`):e.leafNode(`x`,{v:n.v});e.closeNode()}else e.leafNode(`i`,n)}renderPivotFieldLoaded(e,t){let n={};if(t.axis&&(n.axis=t.axis),t.dataField&&(n.dataField=`1`),t.numFmtId!==void 0&&(n.numFmtId=String(t.numFmtId)),t.sortType&&(n.sortType=t.sortType),t.compact===!1&&(n.compact=`0`),t.outline===!1&&(n.outline=`0`),n.showAll=t.showAll?`1`:`0`,t.defaultSubtotal===!1&&(n.defaultSubtotal=`0`),t.subtotalTop===!1&&(n.subtotalTop=`0`),t.insertBlankRow===!0&&(n.insertBlankRow=`1`),t.multipleItemSelectionAllowed===!0&&(n.multipleItemSelectionAllowed=`1`),t.extraAttrs)for(let[e,r]of Object.entries(t.extraAttrs))n[e]=r;if(t.items!==void 0&&t.items.length>0||t.autoSortScopeXml!==void 0){if(e.openNode(`pivotField`,n),t.items!==void 0&&t.items.length>0){e.openNode(`items`,{count:t.items.length});for(let n of t.items){let t={};for(let e of wy)n[e]!==void 0&&(t[e]=n[e]);e.leafNode(`item`,t)}e.closeNode()}t.autoSortScopeXml&&e.writeRaw(t.autoSortScopeXml),e.closeNode()}else e.leafNode(`pivotField`,n)}parseOpen(e){let{name:t,attributes:n}=e;if(this.extLstCollector.active)return this.extLstCollector.feedOpen(t,n),!0;if(this.formatsCollector.active)return this.formatsCollector.feedOpen(t,n),!0;if(this.conditionalFormatsCollector.active)return this.conditionalFormatsCollector.feedOpen(t,n),!0;if(this.filtersCollector.active)return this.filtersCollector.feedOpen(t,n),!0;if(this.unknownCollector.active)return this.unknownCollector.feedOpen(t,n),!0;switch(t){case this.tag:this.reset(),this.model={name:n.name,cacheId:parseInt(n.cacheId??`0`,10),uid:n[`xr:uid`],pivotFields:[],rowFields:[],colFields:[],pageFields:[],dataFields:[],applyNumberFormats:n.applyNumberFormats,applyBorderFormats:n.applyBorderFormats,applyFontFormats:n.applyFontFormats,applyPatternFormats:n.applyPatternFormats,applyAlignmentFormats:n.applyAlignmentFormats,applyWidthHeightFormats:n.applyWidthHeightFormats,dataCaption:n.dataCaption,updatedVersion:n.updatedVersion,minRefreshableVersion:n.minRefreshableVersion,createdVersion:n.createdVersion,useAutoFormatting:n.useAutoFormatting,itemPrintTitles:n.itemPrintTitles,indent:n.indent===void 0?void 0:parseInt(n.indent,10),compact:n.compact!==`0`,compactData:n.compactData!==`0`,multipleFieldFilters:n.multipleFieldFilters,outline:n.outline===`1`,outlineData:n.outlineData===`1`,chartFormat:n.chartFormat===void 0?void 0:parseInt(n.chartFormat,10),colGrandTotals:n.colGrandTotals,rowGrandTotals:n.rowGrandTotals,showError:n.showError,errorCaption:n.errorCaption,showMissing:n.showMissing,missingCaption:n.missingCaption,grandTotalCaption:n.grandTotalCaption,rowItems:[],colItems:[],chartFormats:[],isLoaded:!0};break;case`location`:this.model&&(this.model.location={ref:n.ref,firstHeaderRow:n.firstHeaderRow===void 0?void 0:parseInt(n.firstHeaderRow,10),firstDataRow:n.firstDataRow===void 0?void 0:parseInt(n.firstDataRow,10),firstDataCol:n.firstDataCol===void 0?void 0:parseInt(n.firstDataCol,10),rowPageCount:n.rowPageCount===void 0?void 0:parseInt(n.rowPageCount,10),colPageCount:n.colPageCount===void 0?void 0:parseInt(n.colPageCount,10)});break;case`pivotFields`:this.state.currentSection=`pivotFields`;break;case`pivotField`:if(this.state.currentSection===`pivotFields`){let e={};for(let[t,r]of Object.entries(n))Ey.has(t)||(e[t]=String(r));this.currentPivotField={axis:Cy.has(n.axis)?n.axis:void 0,dataField:n.dataField===`1`,items:[],compact:n.compact!==`0`,outline:n.outline!==`0`,showAll:n.showAll!==`0`,defaultSubtotal:n.defaultSubtotal!==`0`,numFmtId:n.numFmtId===void 0?void 0:parseInt(n.numFmtId,10),sortType:n.sortType,subtotalTop:n.subtotalTop===void 0?void 0:n.subtotalTop===`1`,insertBlankRow:n.insertBlankRow===`1`?!0:void 0,multipleItemSelectionAllowed:n.multipleItemSelectionAllowed===`1`?!0:void 0,extraAttrs:Object.keys(e).length>0?e:void 0}}break;case`items`:break;case`item`:if(this.currentPivotField){let e={};n.x!==void 0&&(e.x=parseInt(n.x,10));for(let t of wy)t!==`x`&&n[t]!==void 0&&(e[t]=n[t]);this.currentPivotField.items.push(e)}break;case`autoSortScope`:this.currentPivotField&&(this.state.inAutoSortScope=!0,this.autoSortScopeXmlBuffer=[`<autoSortScope>`]);break;case`rowFields`:this.state.currentSection=`rowFields`;break;case`colFields`:this.state.currentSection=`colFields`,this.model&&(this.model.hasColFields=!0);break;case`dataFields`:this.state.currentSection=`dataFields`;break;case`pageFields`:this.state.currentSection=`pageFields`;break;case`pageField`:this.state.currentSection===`pageFields`&&this.model&&this.model.pageFields.push({fld:parseInt(n.fld??`0`,10),item:n.item===void 0?void 0:parseInt(n.item,10),hier:n.hier===void 0?void 0:parseInt(n.hier,10),name:n.name});break;case`rowItems`:this.state.currentSection=`rowItems`,this.model&&(this.model.hasRowItems=!0);break;case`colItems`:this.state.currentSection=`colItems`,this.model&&(this.model.hasColItems=!0);break;case`i`:if(this.model){let e=this.state.currentSection===`rowItems`||this.state.currentSection===`colItems`?Oy(n):null;this.state.currentSection===`rowItems`?this.currentRowItem=e:this.state.currentSection===`colItems`&&(this.currentColItem=e)}break;case`x`:if(this.state.inPivotArea){let e=py(n);this.state.inAutoSortScope?this.autoSortScopeXmlBuffer.push(e?`<x ${e}/>`:`<x/>`):this.pivotAreaXmlBuffer.push(e?`<x ${e}/>`:`<x/>`)}else this.currentRowItem?this.currentRowItem.x.push({v:parseInt(n.v??`0`,10)}):this.currentColItem&&this.currentColItem.x.push({v:parseInt(n.v??`0`,10)});break;case`chartFormats`:this.state.currentSection=`chartFormats`;break;case`chartFormat`:this.state.currentSection===`chartFormats`&&this.model&&(this.currentChartFormat={chart:parseInt(n.chart??`0`,10),format:parseInt(n.format??`0`,10),series:n.series===void 0?void 0:n.series===`1`});break;case`pivotArea`:if(this.currentChartFormat){this.state.inPivotArea=!0;let e=py(n);this.pivotAreaXmlBuffer=[e?`<pivotArea ${e}>`:`<pivotArea>`]}else if(this.state.inAutoSortScope){this.state.inPivotArea=!0;let e=py(n);this.autoSortScopeXmlBuffer.push(e?`<pivotArea ${e}>`:`<pivotArea>`)}break;case`references`:case`reference`:if(this.state.inPivotArea){let e=py(n);this.state.inAutoSortScope?this.autoSortScopeXmlBuffer.push(`<${t}${e?` `+e:``}>`):this.pivotAreaXmlBuffer.push(`<${t}${e?` `+e:``}>`)}break;case`field`:if(this.model){let e=parseInt(n.x??`0`,10);this.state.currentSection===`rowFields`?this.model.rowFields.push(e):this.state.currentSection===`colFields`&&this.model.colFields.push(e)}break;case`dataField`:this.state.currentSection===`dataFields`&&this.model&&this.model.dataFields.push({name:n.name??``,fld:parseInt(n.fld??`0`,10),baseField:n.baseField===void 0?void 0:parseInt(n.baseField,10),baseItem:n.baseItem===void 0?void 0:parseInt(n.baseItem,10),subtotal:Wg.has(n.subtotal)?n.subtotal:void 0,numFmtId:n.numFmtId===void 0?void 0:parseInt(n.numFmtId,10)});break;case`pivotTableStyleInfo`:this.model&&(this.model.styleName=n.name,this.model.styleInfo={name:n.name,showRowHeaders:n.showRowHeaders,showColHeaders:n.showColHeaders,showRowStripes:n.showRowStripes,showColStripes:n.showColStripes,showLastColumn:n.showLastColumn});break;case`extLst`:this.model&&this.extLstCollector.start(n);break;case`formats`:this.model&&this.formatsCollector.start(n);break;case`conditionalFormats`:this.model&&this.conditionalFormatsCollector.start(n);break;case`filters`:this.model&&this.filtersCollector.start(n);break;default:this.model&&this.state.currentSection===null&&!this.state.inPivotArea&&!this.state.inAutoSortScope&&this.unknownCollector.startAs(t,n);break}return!0}parseText(e){this.extLstCollector.active?this.extLstCollector.feedText(e):this.formatsCollector.active?this.formatsCollector.feedText(e):this.conditionalFormatsCollector.active?this.conditionalFormatsCollector.feedText(e):this.filtersCollector.active?this.filtersCollector.feedText(e):this.unknownCollector.active&&this.unknownCollector.feedText(e)}tryCloseCollector(e,t,n){e.feedClose(t)&&(this.model&&(this.model[n]=e.result),e.reset())}parseClose(e){if(this.extLstCollector.active)return this.tryCloseCollector(this.extLstCollector,e,`extLstXml`),!0;if(this.formatsCollector.active)return this.tryCloseCollector(this.formatsCollector,e,`formatsXml`),!0;if(this.conditionalFormatsCollector.active)return this.tryCloseCollector(this.conditionalFormatsCollector,e,`conditionalFormatsXml`),!0;if(this.filtersCollector.active)return this.tryCloseCollector(this.filtersCollector,e,`filtersXml`),!0;if(this.unknownCollector.active)return this.unknownCollector.feedClose(e)&&(this.unknownElementsXmlParts.push(this.unknownCollector.result),this.unknownCollector.reset()),!0;if(this.state.inPivotArea)return e===`pivotArea`?(this.state.inAutoSortScope?this.autoSortScopeXmlBuffer.push(`</pivotArea>`):(this.pivotAreaXmlBuffer.push(`</pivotArea>`),this.currentChartFormat&&(this.currentChartFormat.pivotAreaXml=this.pivotAreaXmlBuffer.join(``)),this.pivotAreaXmlBuffer=[]),this.state.inPivotArea=!1,!0):((e===`references`||e===`reference`)&&(this.state.inAutoSortScope?this.autoSortScopeXmlBuffer.push(`</${e}>`):this.pivotAreaXmlBuffer.push(`</${e}>`)),!0);switch(e){case this.tag:return this.model&&this.unknownElementsXmlParts.length>0&&(this.model.unknownElementsXml=this.unknownElementsXmlParts.join(``)),!1;case`pivotFields`:case`rowFields`:case`colFields`:case`dataFields`:case`pageFields`:case`rowItems`:case`colItems`:case`chartFormats`:this.state.currentSection=null;break;case`pivotField`:this.currentPivotField&&this.model&&(this.model.pivotFields.push(this.currentPivotField),this.currentPivotField=null);break;case`items`:break;case`autoSortScope`:this.state.inAutoSortScope&&this.currentPivotField&&(this.autoSortScopeXmlBuffer.push(`</autoSortScope>`),this.currentPivotField.autoSortScopeXml=this.autoSortScopeXmlBuffer.join(``),this.autoSortScopeXmlBuffer=[],this.state.inAutoSortScope=!1);break;case`i`:this.currentRowItem&&this.model?(this.model.rowItems?.push(this.currentRowItem),this.currentRowItem=null):this.currentColItem&&this.model&&(this.model.colItems?.push(this.currentColItem),this.currentColItem=null);break;case`chartFormat`:this.currentChartFormat&&this.model&&(this.model.chartFormats?.push(this.currentChartFormat),this.currentChartFormat=null);break}return!0}static{this.PIVOT_TABLE_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`}}static{this.EXTLST_XML=`<extLst><ext uri="{962EF5D1-5CA2-4c93-8EF4-DBF5C05439D2}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"><x14:pivotTableDefinition hideValuesRow="1" xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main"/></ext><ext uri="{747A6164-185A-40DC-8AA5-F01512510D54}" xmlns:xpdl="http://schemas.microsoft.com/office/spreadsheetml/2016/pivotdefaultlayout"><xpdl:pivotTableDefinition16 EnabledSubtotalsDefault="0" SubtotalsOnTopDefault="0"/></ext></extLst>`}};function Oy(e){return{t:e.t,r:e.r===void 0?void 0:parseInt(e.r,10),i:e.i===void 0?void 0:parseInt(e.i,10),x:[]}}function ky(e,t,n,r){e.openNode(`dataFields`,{count:n.length});for(let i=0;i<n.length;i++){let a=n[i],o=r[i]??`sum`,s=Ug[o],c=t[a];if(!c)throw Error(`Value field index ${a} is out of bounds (cacheFields has ${t.length} entries)`);let l={name:`${s} of ${c.name}`,fld:a,baseField:0,baseItem:0};o!==`sum`&&(l.subtotal=o),e.leafNode(`dataField`,l)}e.closeNode()}function Ay(e,t){let n=new Set(t.rows),r=new Set(t.columns),i=new Set(t.values),a=new Set(t.pages??[]);e.openNode(`pivotFields`,{count:t.cacheFields.length});for(let o=0;o<t.cacheFields.length;o++){let s=t.cacheFields[o];jy(e,n.has(o),r.has(o),i.has(o),a.has(o),s.sharedItems)}e.closeNode()}function jy(e,t,n,r,i,a){if(t||n||i){if(!a)throw Error(`sharedItems is required for axis field (row/column/page)`);let i={axis:t?`axisRow`:n?`axisCol`:`axisPage`};r&&(i.dataField=`1`),i.compact=`0`,i.outline=`0`,i.showAll=`0`,e.openNode(`pivotField`,i),e.openNode(`items`,{count:a.length+1});for(let t=0;t<a.length;t++)e.leafNode(`item`,{x:t});e.leafNode(`item`,{t:`default`}),e.closeNode(),e.closeNode();return}let o={};r&&(o.dataField=`1`),o.compact=`0`,o.outline=`0`,o.showAll=`0`,o.defaultSubtotal=`0`,e.leafNode(`pivotField`,o)}var My=class extends N{get tag(){return`dimension`}render(e,t){t&&e.leafNode(`dimension`,{ref:t})}parseOpen(e){return e.name===`dimension`?(this.model=e.attributes.ref,!0):!1}parseText(){}parseClose(){return!1}},Ny=class extends N{get tag(){return`mergeCell`}render(e,t){e.leafNode(`mergeCell`,{ref:t})}parseOpen(e){return e.name===`mergeCell`?(this.model=e.attributes.ref,!0):!1}parseText(){}parseClose(){return!1}},Py=class{constructor(){this.merges={}}add(e){if(this.merges[e.master])this.merges[e.master].expandToAddress(e.address);else{let t=`${e.master}:${e.address}`;this.merges[e.master]=new Gr(t)}}get mergeCells(){return Object.values(this.merges).map(e=>e.range)}reconcile(e,t){e.forEach(e=>{let n=O.decode(e);for(let e=n.top;e<=n.bottom;e++){let r=t[e-1];for(let t=n.left;t<=n.right;t++){let i=r.cells[t-1];i?i.type===1&&(i.master=n.tl):r.cells[t]={type:0,address:O.encodeAddress(e,t)}}}})}getMasterAddress(e){let t=this.hash[e];return t&&t.tl}};function Fy(e){return e?`1`:void 0}var Iy=class extends N{get tag(){return`printOptions`}render(e,t){if(t){let n={headings:Fy(t.showRowColHeaders),gridLines:Fy(t.showGridLines),horizontalCentered:Fy(t.horizontalCentered),verticalCentered:Fy(t.verticalCentered)};Object.values(n).some(e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={showRowColHeaders:e.attributes.headings===`1`,showGridLines:e.attributes.gridLines===`1`,horizontalCentered:e.attributes.horizontalCentered===`1`,verticalCentered:e.attributes.verticalCentered===`1`},!0;default:return!1}}parseText(){}parseClose(){return!1}},Ly=class extends N{get tag(){return`tablePart`}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:id`]},!0;default:return!1}}parseText(){}parseClose(){return!1}};let Ry=(e,t)=>{Object.keys(t).forEach(n=>{let r=e[n],i=t[n];r===void 0&&i!==void 0&&(e[n]=i)})},zy=(e,t)=>{if(!t||!t.length)return e;if(!e||!e.length)return t;let n={},r={};return e.forEach(e=>{n[e.ref]=e,e.rules.forEach(e=>{let{x14Id:t}=e;t&&(r[t]=e)})}),t.forEach(t=>{t.rules.forEach(i=>{let a=r[i.x14Id];a?Ry(a,i):n[t.ref]?n[t.ref].rules.push(i):e.push({ref:t.ref,rules:[i]})})}),e};var By=class e extends N{static{this.WORKSHEET_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"xmlns:x14ac":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac`,"mc:Ignorable":`x14ac`}}constructor(e){super();let{maxRows:t,maxCols:n,ignoreNodes:r}=e||{};this.ignoreNodes=r??[],this.map={sheetPr:new Nh,dimension:new My,sheetViews:new P({tag:`sheetViews`,count:!1,childXform:new Rh}),sheetFormatPr:new kh,cols:new P({tag:`cols`,count:!1,childXform:new Gm}),sheetData:new P({tag:`sheetData`,count:!1,empty:!0,childXform:new Oh({maxItems:n}),maxItems:t}),autoFilter:new Em,mergeCells:new P({tag:`mergeCells`,count:!0,childXform:new Ny}),rowBreaks:new Ch,colBreaks:new Wm,hyperlinks:new P({tag:`hyperlinks`,count:!1,childXform:new fm}),pageMargins:new hh,dataValidations:new Ym,pageSetup:new xh,headerFooter:new fh,printOptions:new Iy,picture:new Sh,drawing:new Xm,sheetProtection:new Ih,tableParts:new P({tag:`tableParts`,count:!0,childXform:new Ly}),conditionalFormatting:new Hm,extLst:new dh,ignoredErrors:new mh}}prepare(e,t){t.merges=new Py,e.hyperlinks=t.hyperlinks=[],e.comments=t.comments=[],e.formControls&&e.formControls.length>0&&(!e.views||e.views.length===0)&&(e.views=[{workbookViewId:0}]),t.formulae={},t.siFormulae=0,this.map.cols.prepare(e.cols,t),this.map.sheetData.prepare(e.rows,t),this.map.conditionalFormatting.prepare(e.conditionalFormattings,t),e.mergeCells=t.merges.mergeCells;let n=e.rels=[];function r(e){return`rId${e.length+1}`}e.hyperlinks.forEach(e=>{if(pm(e.target))return;let t=r(n);e.rId=t,n.push({Id:t,Type:k.Hyperlink,Target:e.target,TargetMode:`External`})});let{fileIndex:i}=e;if(e.comments.length>0){let a={Id:r(n),Type:k.Comments,Target:Td(i)};n.push(a);let o={Id:r(n),Type:k.VmlDrawing,Target:Ed(i)};n.push(o),e.comments.forEach(e=>{e.refAddress=O.decodeAddress(e.ref)}),t.commentRefs.push({commentName:`comments${i}`,vmlDrawing:`vmlDrawing${i}`})}if(e.drawing&&e.drawing.anchors){let i=e.drawing;i.rId=r(n),i.name||=`drawing${++t.drawingsCount}`;let a=(i.rels??[]).some(e=>e.Target&&e.Target.includes(`/charts/`));i.anchors=[],a||(i.rels=[]),t.drawings.push(i),n.push({Id:i.rId,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing`,Target:Od(i.name)})}let a=[],o=[],s=[],c=[];if(e.media.forEach(e=>{e.type===`background`?a.push(e):e.type===`image`?o.push(e):e.type===`watermark`?s.push(e):e.type===`headerImage`&&c.push(e)}),a.forEach(i=>{let a=r(n),o=t.media[i.imageId];n.push({Id:a,Type:k.Image,Target:gm(o)}),e.background={rId:a},e.image=t.media[i.imageId]}),o.length>0){let{drawing:i}=e;i||(i=e.drawing={rId:r(n),name:`drawing${++t.drawingsCount}`,anchors:[],rels:[]},t.drawings.push(i),n.push({Id:i.rId,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing`,Target:Od(i.name)}));let a=_m(o,i.rels,{getBookImage:e=>t.media[e],nextRId:e=>r(e)});i.anchors.push(...a.anchors),i.rels=a.rels}if(s.length>0){let{drawing:i}=e;i||(i=e.drawing={rId:r(n),name:`drawing${++t.drawingsCount}`,anchors:[],rels:[]},t.drawings.push(i),n.push({Id:i.rId,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing`,Target:Od(i.name)}));for(let n of s){let a=t.media[n.imageId];if(!a)continue;let o=r(i.rels);i.rels.push({Id:o,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,Target:gm(a)});let s=n.opacity===void 0?.15:n.opacity,c=Math.round(Math.max(0,Math.min(1,s))*1e5),l=e.dimensions,u=l?Math.max(l.model?.right??100,100):100,d=l?Math.max(l.model?.bottom??200,200):200;i.anchors.push({picture:{rId:o,alphaModFix:c},range:{editAs:`absolute`,tl:{nativeCol:0,nativeColOff:0,nativeRow:0,nativeRowOff:0},br:{nativeCol:u,nativeColOff:0,nativeRow:d,nativeRowOff:0}}})}}if(c.length>0){let a=c[0],o=t.media[a.imageId];if(o){let s=r(n);n.push({Id:s,Type:k.VmlDrawing,Target:Dd(i)}),e.headerImage={vmlRelId:s,imageId:a.imageId,bookImage:o,headerWidth:a.headerWidth,headerHeight:a.headerHeight},t.hasHeaderWatermark=!0,e.headerFooter||={};let c=a.applyTo||`all`,l=t=>{let n=e.headerFooter[t]||``;return n.includes(`&G`)?n:n.includes(`&C`)?n.replace(`&C`,`&C&G`):n+`&C&G`};(c===`all`||c===`odd`)&&(e.headerFooter.oddHeader=l(`oddHeader`)),(c===`all`||c===`even`)&&(e.headerFooter.evenHeader=l(`evenHeader`),e.headerFooter.differentOddEven=!0),(c===`all`||c===`first`)&&(e.headerFooter.firstHeader=l(`firstHeader`),e.headerFooter.differentFirst=!0)}}if(e.tables.forEach(e=>{let i=r(n);e.rId=i,n.push({Id:i,Type:k.Table,Target:Ad(e.target)}),e.columns.forEach(e=>{let{style:n}=e;n&&(e.dxfId=t.styles.addDxfStyle(n))})}),(e.pivotTables??[]).forEach(e=>{n.push({Id:r(n),Type:k.PivotTable,Target:kd(e.tableNumber)})}),e.formControls&&e.formControls.length>0){let{drawing:a}=e;a||(a=e.drawing={rId:r(n),name:`drawing${++t.drawingsCount}`,anchors:[],rels:[]},t.drawings.push(a),n.push({Id:a.rId,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing`,Target:Od(a.name)})),e.comments.length===0&&n.push({Id:r(n),Type:k.VmlDrawing,Target:Ed(i)});let o=e=>({nativeCol:e.col,nativeColOff:e.colOff,nativeRow:e.row,nativeRowOff:e.rowOff});for(let i of e.formControls){let e=t.formControlRefs.length+1;i.ctrlPropId=e;let s=r(n);i.ctrlPropRelId=s,n.push({Id:s,Type:k.CtrlProp,Target:Nd(e)}),t.formControlRefs.push(e);let c=`Check Box ${Math.max(1,i.shapeId-1024)}`;a.anchors.push({range:{editAs:`absolute`,tl:o(i.tl),br:o(i.br)},alternateContent:{requires:`a14`},shape:{cNvPrId:i.shapeId,name:i.name||c,hidden:!0,spid:`_x0000_s${i.shapeId}`,text:i.text}})}}this.map.extLst.prepare(e,t)}render(t,n){t.openXml(A);let r={...e.WORKSHEET_ATTRIBUTES};n.formControls&&n.formControls.length>0&&(r[`xmlns:x14`]=`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`,r[`xmlns:xdr`]=`http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing`,r[`mc:Ignorable`]=`${r[`mc:Ignorable`]} x14`),t.openNode(`worksheet`,r);let i=n.properties?{defaultRowHeight:n.properties.defaultRowHeight,dyDescent:n.properties.dyDescent,outlineLevelCol:n.properties.outlineLevelCol,outlineLevelRow:n.properties.outlineLevelRow,customHeight:n.properties.customHeight}:void 0;n.properties&&n.properties.defaultColWidth&&(i.defaultColWidth=n.properties.defaultColWidth);let a={outlineProperties:n.properties&&n.properties.outlineProperties,tabColor:n.properties&&n.properties.tabColor,pageSetup:n.pageSetup&&n.pageSetup.fitToPage?{fitToPage:n.pageSetup.fitToPage}:void 0},o=n.pageSetup&&n.pageSetup.margins,s={showRowColHeaders:n.pageSetup&&n.pageSetup.showRowColHeaders,showGridLines:n.pageSetup&&n.pageSetup.showGridLines,horizontalCentered:n.pageSetup&&n.pageSetup.horizontalCentered,verticalCentered:n.pageSetup&&n.pageSetup.verticalCentered},c=n.sheetProtection;if(this.map.sheetPr.render(t,a),this.map.dimension.render(t,n.dimensions),this.map.sheetViews.render(t,n.views),this.map.sheetFormatPr.render(t,i),this.map.cols.render(t,n.cols),this.map.sheetData.render(t,n.rows),this.map.sheetProtection.render(t,c),this.map.autoFilter.render(t,n.autoFilter),this.map.mergeCells.render(t,n.mergeCells),this.map.conditionalFormatting.render(t,n.conditionalFormattings),this.map.dataValidations.render(t,n.dataValidations),this.map.hyperlinks.render(t,n.hyperlinks),this.map.printOptions.render(t,s),this.map.pageMargins.render(t,o),this.map.pageSetup.render(t,n.pageSetup),this.map.headerFooter.render(t,n.headerFooter),this.map.rowBreaks.render(t,n.rowBreaks),this.map.colBreaks.render(t,n.colBreaks),this.map.drawing.render(t,n.drawing),this.map.picture.render(t,n.background),n.rels&&n.rels.forEach(e=>{if(e.Type===k.VmlDrawing){if(n.headerImage&&e.Id===n.headerImage.vmlRelId)return;t.leafNode(`legacyDrawing`,{"r:id":e.Id})}}),n.headerImage&&t.leafNode(`legacyDrawingHF`,{"r:id":n.headerImage.vmlRelId}),n.formControls&&n.formControls.length>0){t.openNode(`mc:AlternateContent`),t.openNode(`mc:Choice`,{Requires:`x14`}),t.openNode(`controls`);for(let e of n.formControls){if(!e.ctrlPropRelId)continue;let n=`Check Box ${Math.max(1,e.shapeId-1024)}`;t.openNode(`mc:AlternateContent`),t.openNode(`mc:Choice`,{Requires:`x14`}),t.openNode(`control`,{shapeId:e.shapeId,"r:id":e.ctrlPropRelId,name:e.name||n}),t.openNode(`controlPr`,{locked:0,defaultSize:0,print:+!!e.print,autoFill:0,autoLine:0,autoPict:0}),t.openNode(`anchor`),t.openNode(`from`),t.leafNode(`xdr:col`,void 0,e.tl.col),t.leafNode(`xdr:colOff`,void 0,e.tl.colOff),t.leafNode(`xdr:row`,void 0,e.tl.row),t.leafNode(`xdr:rowOff`,void 0,e.tl.rowOff),t.closeNode(),t.openNode(`to`),t.leafNode(`xdr:col`,void 0,e.br.col),t.leafNode(`xdr:colOff`,void 0,e.br.colOff),t.leafNode(`xdr:row`,void 0,e.br.row),t.leafNode(`xdr:rowOff`,void 0,e.br.rowOff),t.closeNode(),t.closeNode(),t.closeNode(),t.closeNode(),t.closeNode(),t.leafNode(`mc:Fallback`),t.closeNode()}t.closeNode(),t.closeNode(),t.leafNode(`mc:Fallback`),t.closeNode()}this.map.ignoredErrors.render(t,n.ignoredErrors),this.map.tableParts.render(t,n.tables),this.map.extLst.render(t,n),t.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===`worksheet`?(Object.values(this.map).forEach(e=>{e.reset()}),!0):(this.map[e.name]&&!this.ignoreNodes.includes(e.name)&&(this.parser=this.map[e.name],this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`worksheet`:{let e=this.map.sheetFormatPr.model||{};this.map.sheetPr.model&&this.map.sheetPr.model.tabColor&&(e.tabColor=this.map.sheetPr.model.tabColor),this.map.sheetPr.model&&this.map.sheetPr.model.outlineProperties&&(e.outlineProperties=this.map.sheetPr.model.outlineProperties);let t={fitToPage:this.map.sheetPr.model&&this.map.sheetPr.model.pageSetup&&this.map.sheetPr.model.pageSetup.fitToPage||!1,margins:this.map.pageMargins.model},n=Object.assign(t,this.map.pageSetup.model,this.map.printOptions.model),r=zy(this.map.conditionalFormatting.model,this.map.extLst.model&&this.map.extLst.model[`x14:conditionalFormattings`]);return this.model={dimensions:this.map.dimension.model,cols:this.map.cols.model,rows:this.map.sheetData.model,mergeCells:this.map.mergeCells.model,hyperlinks:this.map.hyperlinks.model,dataValidations:this.map.dataValidations.model,properties:e,views:this.map.sheetViews.model,pageSetup:n,headerFooter:this.map.headerFooter.model,background:this.map.picture.model,drawing:this.map.drawing.model,tables:this.map.tableParts.model,conditionalFormattings:r,rowBreaks:this.map.rowBreaks.model??[],colBreaks:this.map.colBreaks.model??[],ignoredErrors:this.map.ignoredErrors.model??[]},this.map.autoFilter.model&&(this.model.autoFilter=this.map.autoFilter.model),this.map.sheetProtection.model&&(this.model.sheetProtection=this.map.sheetProtection.model),!1}default:return!0}}reconcile(e,t){let n=e.relationships??[],r=n.reduce((e,t)=>(e[t.Id]=t,e),{});for(let r of n)if(r.Type===k.Comments){let n=Pd(`xl/worksheets/`,r.Target),i=t.comments?.[n];i&&(e.comments=i.comments)}if(e.comments&&e.comments.length){for(let r of n)if(r.Type===k.VmlDrawing){let n=Pd(`xl/worksheets/`,r.Target),i=t.vmlDrawings?.[n];if(i){let t=i.comments,n={},r=!1;for(let e of t)if(e.row!=null&&e.col!=null){let t=O.encodeAddress(e.row,e.col);n[t]=e,r=!0}if(r)for(let t of e.comments){let e=n[t.ref];e&&(t.note=Object.assign({},t.note,e))}else e.comments.forEach((e,n)=>{n<t.length&&(e.note=Object.assign({},e.note,t[n]))})}}}if(t.commentsMap=(e.comments??[]).reduce((e,t)=>(t.ref&&(e[t.ref]=t),e),{}),t.hyperlinkMap=(e.hyperlinks??[]).reduce((e,t)=>{if(t.rId){let n=r[t.rId];n&&(e[t.address]=n.Target)}else t.target&&(e[t.address]=t.target);return e},{}),t.formulae={},e.rows){e.rows.includes(void 0)&&(e.rows=e.rows.filter(Boolean));for(let t=0;t<e.rows.length;t++){let n=e.rows[t];n.cells?.includes(void 0)&&(n.cells=n.cells.filter(Boolean))}}else e.rows=[];if(this.map.cols.reconcile(e.cols,t),this.map.sheetData.reconcile(e.rows,t),this.map.conditionalFormatting.reconcile(e.conditionalFormattings,t),e.media=[],e.drawing){let n=r[e.drawing.rId];if(n){let r=n.Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if(r){let n=r[1],i=t.drawings[n];i?(e.drawing={...i,name:n,rels:t.drawingRels?.[n]??i.rels??[]},i.anchors.forEach(t=>{t.medium&&(t.medium.alphaModFix!==void 0&&t.medium.alphaModFix<1e5?e.media.push({type:`watermark`,imageId:t.medium.index,opacity:t.medium.alphaModFix/1e5}):e.media.push({type:`image`,imageId:t.medium.index,range:t.range,hyperlinks:t.picture.hyperlinks}))})):e.drawing=void 0}else e.drawing=void 0}else e.drawing=void 0}let i=e.background&&r[e.background.rId];if(i){let n=i.Target.split(`/media/`)[1],r=t.mediaIndex&&t.mediaIndex[n];r!==void 0&&e.media.push({type:`background`,imageId:r})}else e.background&&=void 0;e.tables=(e.tables??[]).reduce((e,n)=>{let i=r[n.rId];if(i){let n=Pd(`xl/worksheets/`,i.Target),r=t.tables[n];r&&e.push(r)}return e},[]),e.pivotTables=[],(e.relationships??[]).forEach(n=>{if(n.Type===k.PivotTable&&t.pivotTables){let r=Pd(`xl/worksheets/`,n.Target),i=t.pivotTables[r];i&&e.pivotTables.push(i)}}),delete e.relationships,delete e.hyperlinks,delete e.comments}},Vy=class extends N{constructor(){super(),this.model={val:``}}get tag(){return`customFilter`}render(e,t){e.leafNode(this.tag,{val:t.val,operator:t.operator})}parseOpen(e){return e.name===this.tag?(this.model={val:e.attributes.val,operator:e.attributes.operator},!0):!1}parseText(){}parseClose(){return!1}},Hy=class extends N{constructor(){super(),this.model={val:``}}get tag(){return`filter`}render(e,t){e.leafNode(this.tag,{val:t.val})}parseOpen(e){return e.name===this.tag?(this.model={val:e.attributes.val},!0):!1}parseText(){}parseClose(){return!1}},Uy=class extends N{constructor(){super(),this.map={customFilters:new P({tag:`customFilters`,count:!1,empty:!0,childXform:new Vy}),filters:new P({tag:`filters`,count:!1,empty:!0,childXform:new Hy})},this.model={filterButton:!1}}get tag(){return`filterColumn`}prepare(e,t){e.colId=t.index.toString()}render(e,t){if(t.customFilters){e.openNode(this.tag,{colId:t.colId,hiddenButton:t.filterButton?`0`:`1`}),this.map.customFilters.render(e,t.customFilters),e.closeNode();return}e.leafNode(this.tag,{colId:t.colId,hiddenButton:t.filterButton?`0`:`1`})}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;let{attributes:t}=e;switch(e.name){case this.tag:return this.model={filterButton:t.hiddenButton===`0`},!0;case`dynamicFilter`:return!0;default:if(this.parser=this.map[e.name],this.parser)return this.parseOpen(e),!0;throw new Fr(`filterColumn`,`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.customFilters=this.map.customFilters.model,!1;default:return!0}}},Wy=class extends N{constructor(){super(),this.map={filterColumn:new Uy},this.model={autoFilterRef:``,columns:[]}}get tag(){return`autoFilter`}prepare(e){e.columns.forEach((e,t)=>{this.map.filterColumn.prepare(e,{index:t})})}render(e,t){e.openNode(this.tag,{ref:t.autoFilterRef}),t.columns.forEach(t=>{this.map.filterColumn.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:return this.model={autoFilterRef:e.attributes.ref,columns:[]},!0;default:if(this.parser=this.map[e.name],this.parser)return this.parseOpen(e),!0;throw new Fr(`autoFilter`,`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.columns.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:throw new Fr(`autoFilter`,`Unexpected xml node in parseClose: ${e}`)}}},Gy=class extends N{constructor(){super(),this._childText=``,this.model={name:``}}get tag(){return`tableColumn`}prepare(e,t){e.id=t.index+1}_renderAttributes(e){return{id:e.id.toString(),name:qc(e.name),totalsRowLabel:e.totalsRowLabel?qc(e.totalsRowLabel):void 0,totalsRowFunction:e.totalsRowFunction===`none`?void 0:e.totalsRowFunction,dxfId:e.dxfId}}render(e,t){t.calculatedColumnFormula||t.totalsRowFormula?(e.openNode(this.tag,this._renderAttributes(t)),t.calculatedColumnFormula&&e.leafNode(`calculatedColumnFormula`,void 0,t.calculatedColumnFormula),t.totalsRowFormula&&e.leafNode(`totalsRowFormula`,void 0,t.totalsRowFormula),e.closeNode()):e.leafNode(this.tag,this._renderAttributes(t))}parseOpen(e){if(e.name===this.tag){let{attributes:t}=e;return this.model={name:Uc(t.name),totalsRowLabel:t.totalsRowLabel?Uc(t.totalsRowLabel):void 0,totalsRowFunction:t.totalsRowFunction,dxfId:t.dxfId},!0}return(e.name===`calculatedColumnFormula`||e.name===`totalsRowFormula`)&&(this._childTag=e.name,this._childText=``),!0}parseText(e){this._childTag&&(this._childText+=e)}parseClose(e){return e===this.tag?!1:(this._childTag&&e===this._childTag&&(this.model[this._childTag]=this._childText,this._childTag=void 0),!0)}},Ky=class extends N{constructor(){super(),this.model={theme:null,showFirstColumn:!1,showLastColumn:!1,showRowStripes:!1,showColumnStripes:!1}}get tag(){return`tableStyleInfo`}render(e,t){e.leafNode(this.tag,{name:t.theme?t.theme:void 0,showFirstColumn:t.showFirstColumn?`1`:`0`,showLastColumn:t.showLastColumn?`1`:`0`,showRowStripes:t.showRowStripes?`1`:`0`,showColumnStripes:t.showColumnStripes?`1`:`0`})}parseOpen(e){if(e.name===this.tag){let{attributes:t}=e;return this.model={theme:t.name?t.name:null,showFirstColumn:t.showFirstColumn===`1`,showLastColumn:t.showLastColumn===`1`,showRowStripes:t.showRowStripes===`1`,showColumnStripes:t.showColumnStripes===`1`},!0}return!1}parseText(){}parseClose(){return!1}},qy=class e extends N{constructor(){super(),this.map={autoFilter:new Wy,tableColumns:new P({tag:`tableColumns`,count:!0,empty:!0,childXform:new Gy}),tableStyleInfo:new Ky},this.model={id:0,name:``,tableRef:``,columns:[]}}prepare(e,t){this.map.autoFilter.prepare(e),this.map.tableColumns.prepare(e.columns,t)}get tag(){return`table`}render(t,n){t.openXml(A),t.openNode(this.tag,{...e.TABLE_ATTRIBUTES,id:n.id,name:n.name,displayName:n.displayName||n.name,ref:n.tableRef,totalsRowCount:n.totalsRow?`1`:void 0,headerRowCount:n.headerRow?void 0:`0`}),this.map.autoFilter.render(t,n),this.map.tableColumns.render(t,n.columns),this.map.tableStyleInfo.render(t,n.style),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;let{name:t,attributes:n}=e;switch(t){case this.tag:this.reset(),this.model={name:n.name,displayName:n.displayName||n.name,tableRef:n.ref,totalsRow:n.totalsRowCount===`1`,headerRow:n.headerRowCount!==`0`};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.columns=this.map.tableColumns.model,this.map.autoFilter.model&&(this.model.autoFilterRef=this.map.autoFilter.model.autoFilterRef,this.map.autoFilter.model.columns.forEach((e,t)=>{this.model.columns[t].filterButton=e.filterButton})),this.model.style=this.map.tableStyleInfo.model,!1;default:return!0}}reconcile(e,t){e.tableRef&&!e.ref&&(e.ref=e.tableRef),e.rows||=[],e.columns.forEach(e=>{e.dxfId!==void 0&&(e.style=t.styles.getDxfStyle(e.dxfId))})}static{this.TABLE_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`}}},Jy=class{constructor(e){this._stack=[],this._leaf=!1,this._open=!1,this._pending=``,this._target=e}get depth(){return this._stack.length}get currentElement(){return this._stack.length>0?this._stack[this._stack.length-1]:void 0}_flushOpen(e){this._target.write(this._pending+e),this._pending=``,this._open=!1}openXml(e){let t=e?{...A,...e}:A,n=`<?xml`;for(let e in t){let r=t[e];r!==void 0&&(Fc(e),n+=` ${e}="${Nc(String(r))}"`)}this._target.write(n+`?>
|
|
427
|
+
`)}openNode(e,t){Fc(e),this._open&&this._flushOpen(`>`);let n=`<${e}`;if(t)for(let e in t){let r=t[e];r!==void 0&&(Fc(e),n+=` ${e}="${Nc(String(r))}"`)}this._pending=n,this._stack.push(e),this._leaf=!0,this._open=!0}addAttribute(e,t){if(!this._open)throw new $s(`add attribute`,`no element is open`);Fc(e),this._pending+=` ${e}="${Nc(String(t))}"`}addAttributes(e){if(!this._open)throw new $s(`add attributes`,`no element is open`);if(e)for(let t in e){let n=e[t];n!==void 0&&(Fc(t),this._pending+=` ${t}="${Nc(String(n))}"`)}}writeText(e){this._open&&this._flushOpen(`>`),this._leaf=!1,this._target.write(Mc(String(e)))}writeRaw(e){this._open&&this._flushOpen(`>`),this._leaf=!1,this._target.write(e)}writeCData(e){this._open&&this._flushOpen(`>`),this._leaf=!1,this._target.write(Ic(e))}writeComment(e){this._open&&this._flushOpen(`>`),this._leaf=!1,Lc(e),this._target.write(`<!--${e}-->`)}closeNode(){let e=this._stack.pop();if(e===void 0)throw new $s(`close node`,`no element is open`);this._leaf&&this._open?this._flushOpen(`/>`):(this._open&&this._flushOpen(`>`),this._target.write(`</${e}>`)),this._open=!1,this._leaf=!1}leafNode(e,t,n){Fc(e),this._open&&this._flushOpen(`>`);let r=`<${e}`;if(t)for(let e in t){let n=t[e];n!==void 0&&(Fc(e),r+=` ${e}="${Nc(String(n))}"`)}n===void 0?r+=`/>`:r+=`>${Mc(String(n))}</${e}>`,this._target.write(r),this._leaf=!1}closeAll(){for(;this._stack.length>0;)this.closeNode()}},Yy=class e{static{this.textEncoder=new TextEncoder}constructor(e){this.events=new Map,this.pipedStream=null,this.finalized=!1,this._needsDrain=!1,this._drainResolvers=[],this._pendingWrites=0,this._pendingWriteResolvers=[],this._earlyError=null,this.level=e?.level??6,this.modTime=e?.modTime,this.timestamps=e?.timestamps,this.zip=new Xp((e,t,n)=>{if(e){this._emit(`error`,e);return}t&&t.length>0&&(this._emit(`data`,t),this.pipedStream&&this._checkBackpressure(this.pipedStream.write(t))),n&&(this.pipedStream&&this.pipedStream.end(),this._emit(`finish`))})}_emit(e,...t){if(e===`error`){let n=this.events.get(e);if(!n||n.size===0){this._earlyError=t[0]instanceof Error?t[0]:Error(String(t[0]));return}}let n=this.events.get(e);if(n)for(let e of n)e(...t)}_checkBackpressure(e){if(e instanceof Promise){this._pendingWrites++,e.then(e=>{e||(this._needsDrain=!0)},()=>{}).finally(()=>{if(this._pendingWrites--,this._pendingWrites===0){let e=this._pendingWriteResolvers.splice(0);for(let t of e)t()}});return}e===!1&&(this._needsDrain=!0)}on(e,t){let n=this.events.get(e)||new Set;if(n.add(t),this.events.set(e,n),e===`error`&&this._earlyError){let e=this._earlyError;this._earlyError=null,t(e)}return this}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};return this.on(e,n)}off(e,t){let n=this.events.get(e);return n?(n.delete(t),n.size===0&&this.events.delete(e),this):this}pipe(e){this.pipedStream=e,e&&typeof e.on==`function`&&e.on(`drain`,()=>{this._needsDrain=!1;let e=this._drainResolvers.splice(0);for(let t of e)t()})}async waitForDrain(){if(this._pendingWrites>0&&await new Promise(e=>{this._pendingWriteResolvers.push(e)}),!(!this._needsDrain||!this.pipedStream))return new Promise(e=>{this._drainResolvers.push(e)})}append(t,n){if(this.finalized)throw new Rr(`append`,`stream already finalized`);let r;r=n.base64?Rc(typeof t==`string`?t:String(t)):typeof t==`string`?e.textEncoder.encode(t):t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t instanceof ArrayBuffer?new Uint8Array(t):t;let i=new Yp(n.name,{level:this.level,modTime:this.modTime,timestamps:this.timestamps});this.zip.add(i),i.push(r,!0)}createEntry(t){if(this.finalized)throw new Rr(`createEntry`,`stream already finalized`);let n=new Yp(t,{level:this.level,modTime:this.modTime,timestamps:this.timestamps});this.zip.add(n);let r=e.textEncoder;return{write(e){n.push(r.encode(e))},end(){n.push(new Uint8Array,!0)}}}finalize(){this.finalized||(this.finalized=!0,this.zip.end())}};function Xy(e){let t=/(?:^|\/)externalLink(\d+)[.]xml$/.exec(e);return t?parseInt(t[1],10):void 0}function Zy(e,t){t&&(e.sheetNames.includes(t)||e.sheetNames.push(t))}var Qy=class e{static{this.RelType=k}constructor(e){this.workbook=e}createBinaryStream(e){let t=new lr;return t.end(e),t}createTextStream(e){let t=new lr;return t.end(e),t}createStreamBuf(){return new Yh}bufferToString(e){return cl(e)}createZipWriter(e){return new Yy(e)}async writeToZip(e,t){let{model:n}=this.workbook;this.prepareModel(n,t),await this.addContentTypes(e,n),await this.addOfficeRels(e,n),await this.addWorkbookRels(e,n),await this.addWorkbook(e,n),await this.addWorksheets(e,n),await this.addSharedStrings(e,n),await this.addDrawings(e,n),await this.addTables(e,n),await this.addPivotTables(e,n),await this.addExternalLinks(e,n),this.addPassthrough(e,n),await this.addThemes(e,n),await this.addStyles(e,n),await this.addFeaturePropertyBag(e,n),await this.addMetadata(e,n),await this.addMedia(e,n),await this.addApp(e,n),await this.addCore(e,n)}async read(e,t){let n=[];return await new Promise((t,r)=>{let i=e=>{n.push(e)},a=()=>{e.off(`data`,i),e.off(`end`,a),e.off(`error`,o),t()},o=t=>{e.off(`data`,i),e.off(`end`,a),e.off(`error`,o),r(t)};e.on(`data`,i),e.on(`end`,a),e.on(`error`,o)}),this.loadBuffer(T(n),t)}async write(e,t){t||={},t.zip=t.zip||{},t.zip.modTime??=this.workbook.modified??this.workbook.created;let n=this.createZipWriter(t.zip);return n.pipe(e),await this.writeToZip(n,t),this._finalize(n)}async load(e,t){if(e==null)throw new Lr(`<input>`,`read`,`Can't read the data of 'the loaded zip file'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?`);let n;if(typeof e==`string`){if(!t?.base64)throw new Lr(`<input>`,`read`,`Can't read the data of 'the loaded zip file'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ? String input requires options.base64 === true (base64-encoded zip archive).`);n=Rc(e)}else if(e instanceof Uint8Array)n=e;else if(e instanceof ArrayBuffer)n=new Uint8Array(e);else if(ArrayBuffer.isView(e))n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);else throw new Lr(`<input>`,`read`,`Can't read the data of 'the loaded zip file'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?`);return this.loadBuffer(n,t)}async loadBuffer(e,t){let n=await new Iv(e).extractAll(),r={};for(let[e,t]of n)r[e]=t;return this.loadFromFiles(r,t)}createEmptyModel(){return{worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},rawDrawings:{},comments:{},tables:{},vmlDrawings:{},pivotTables:{},pivotTableRels:{},pivotCacheDefinitions:{},pivotCacheRecords:{},passthrough:{},externalLinksByIndex:{},externalLinkRelsByIndex:{}}}async collectStreamData(e){let t=[];return await new Promise((n,r)=>{e.on(`data`,e=>{typeof e==`string`?t.push(new TextEncoder().encode(e)):e instanceof Uint8Array?t.push(e):t.push(new Uint8Array(e))}),e.on(`end`,()=>n()),e.on(`error`,r)}),T(t)}drawingHasChartReference(e){return e.rels&&e.rels.some(e=>e.Target&&e.Target.includes(`/charts/`))}drawingRelsHasChartReference(e){return Array.isArray(e)&&e.some(e=>typeof e?.Target==`string`&&e.Target.includes(`/charts/`))}async _processKnownEntry(e,t,n,r){let i=Mu(n);if(i!==void 0)return await this._processWorksheetEntry(e,t,i,r,n),!0;switch(n){case M.rootRels:return t.globalRels=await this.parseRels(e),!0;case M.xlWorkbook:{let n=await this.parseWorkbook(e);return t.sheets=n.sheets,t.definedNames=n.definedNames,t.views=n.views,t.properties=n.properties,t.protection=n.protection,t.calcProperties=n.calcProperties,t.pivotCaches=n.pivotCaches,t.externalReferences=n.externalReferences,!0}case M.xlSharedStrings:return t.sharedStrings=new kg,await t.sharedStrings.parseStream(e),!0;case M.xlWorkbookRels:return t.workbookRels=await this.parseRels(e),!0;case M.docPropsApp:{let n=await new eg().parseStream(e);return n&&(t.company=n.company,t.manager=n.manager),!0}case M.docPropsCore:{let n=await new ig().parseStream(e);return Object.assign(t,n),!0}case M.xlStyles:return t.styles=new Of,await t.styles.parseStream(e),!0;case M.xlMetadata:{let n=await new $d().parseStream(e);return n&&(t.metadata=n),!0}default:return!1}}async loadFromZipEntries(e,t){let n=this.createEmptyModel();for await(let r of e){let e=!1,i=async()=>{e||(e=!0,await r.drain())};if(r.type===`Directory`){await i();continue}let a=ju(r.name),o=r.stream;try{await this._processKnownEntry(o,n,a,t)||await this._processDefaultEntry(o,n,a)||await i()}finally{try{await i()}catch{}}}return this.reconcile(n,t),this.workbook.model=n,this.workbook}async writeBuffer(e){e||={},e.zip=e.zip||{},e.zip.modTime??=this.workbook.modified??this.workbook.created;let t=this.createZipWriter(e.zip),n=this.createStreamBuf();return t.pipe(n),await this.writeToZip(t,e),await this._finalize(t),n.read()||new Uint8Array}async addMedia(e,t){await Promise.all(t.media.map(async t=>{if(t.type!==`image`)throw new Hr(`Unsupported media`);let n=ed(`${t.name??`undefined`}.${t.extension}`);if(t.filename){if(this.readFileAsync){let r=await this.readFileAsync(t.filename);return e.append(r,{name:n})}throw new Ir(`Loading images from filename`,`not supported in this environment`)}if(t.buffer)return e.append(t.buffer,{name:n});if(t.base64){let r=t.base64.substring(t.base64.indexOf(`,`)+1);return e.append(r,{name:n,base64:!0})}throw new Hr(`Unsupported media`)}))}parseRels(e){return new tf().parseStream(e)}parseWorkbook(e){return new Qd().parseStream(e)}parseSharedStrings(e){return new kg().parseStream(e)}reconcile(e,t){let n=new Qd,r=new By(t),i=new Eg,a=new qy;n.reconcile(e);let o={media:e.media,mediaIndex:e.mediaIndex};if(Object.keys(e.drawings).forEach(t=>{let n=e.drawings[t],r=e.drawingRels[t];r&&(o.rels=r.reduce((e,t)=>(e[t.Id]=t,e),{}),(n.anchors??[]).forEach(e=>{let t=e.picture&&e.picture.hyperlinks;t&&o.rels[t.rId]&&(t.hyperlink=o.rels[t.rId].Target,delete t.rId)}),i.reconcile(n,o))}),e.rawDrawings&&e.drawingRels)for(let t of Object.keys(e.rawDrawings)){let n=e.drawingRels[t];n&&!this.drawingRelsHasChartReference(n)&&delete e.rawDrawings[t]}let s={styles:e.styles};Object.values(e.tables).forEach(e=>{a.reconcile(e,s)}),this._reconcilePivotTables(e);let c={styles:e.styles,sharedStrings:e.sharedStrings,media:e.media,mediaIndex:e.mediaIndex,date1904:e.properties?.date1904,drawings:e.drawings,drawingRels:e.drawingRels,comments:e.comments,tables:e.tables,vmlDrawings:e.vmlDrawings,pivotTables:e.pivotTablesIndexed,hasDynamicArrayMetadata:!!e.metadata?.hasDynamicArrays,dynamicArrayCmIndices:e.metadata?.dynamicArrayCmIndices};e.worksheets.forEach(t=>{t.relationships=e.worksheetRels[t.sheetNo],r.reconcile(t,c)}),this._reconcileExternalLinks(e),delete e.worksheetHash,delete e.worksheetRels,delete e.globalRels,delete e.sharedStrings,delete e.workbookRels,delete e.sheetDefs,e.defaultFont=e.styles?.defaultFont,delete e.styles,delete e.mediaIndex,delete e.drawings,delete e.drawingRels,delete e.vmlDrawings,delete e.pivotTableRels,delete e.metadata,delete e.externalReferences,delete e.externalLinksByIndex,delete e.externalLinkRelsByIndex}_reconcileExternalLinks(e){let t=e.externalReferences;if(!t||t.length===0){e.externalLinks||=[];return}let n=e.workbookRels??[],r=new Map;for(let e of n)e.Type===k.ExternalLink&&r.set(e.Id,e);let i=[];for(let n=0;n<t.length;n++){let a=t[n],o=r.get(a.rId);if(!o)continue;let s=Xy(o.Target);if(s===void 0)continue;let c=e.externalLinksByIndex[s],l=e.externalLinkRelsByIndex[s]??[],u=l.find(e=>e.Type===k.ExternalLinkPath)??l.find(e=>e.TargetMode===`External`);i.push({index:n+1,rId:a.rId,target:u?.Target??``,targetMode:u?.TargetMode??`External`,sheetNames:c?.sheetNames??[],cachedValues:c?.cachedValues??{}})}e.externalLinks=i}_normaliseExternalLinks(e){let t=this.workbook._collectExternalLinksForWrite(),n=new Map;for(let e of t)e.target&&n.set(e.target.toLowerCase(),e);let r={links:t,byTarget:n,workbook:this.workbook};for(let t of e.worksheets??[])for(let e of t.rows??[])for(let t of e.cells??[])typeof t?.formula==`string`&&t.formula.length>0&&(t.formula=this._normaliseFormulaExternalRefs(t.formula,r)),typeof t?.sharedFormula==`string`&&t.sharedFormula.length>0&&(t.sharedFormula=this._normaliseFormulaExternalRefs(t.sharedFormula,r));e.externalLinks=t}_normaliseFormulaExternalRefs(e,t){return Bv(e,e=>{if(e.numeric)return e.index!==null&&e.index>=1&&e.index<=t.links.length?(Zy(t.links[e.index-1],e.sheet),e.index):null;let n=e.workbook.toLowerCase(),r=t.byTarget.get(n);return r?(Zy(r,e.sheet),e.sheet&&t.workbook._recordAutoExternalLink(e.workbook,e.sheet)):(r={index:t.workbook._recordAutoExternalLink(e.workbook,e.sheet),target:e.workbook,targetMode:`External`,sheetNames:e.sheet?[e.sheet]:[],cachedValues:{}},t.links.push(r),t.byTarget.set(n,r)),r.index})}_reconcilePivotTables(e){let t=e.pivotTables||{};if(typeof t!=`object`||Object.keys(t).length===0){e.pivotTables=[],e.pivotTablesIndexed={};return}let n=this._buildDefinitionToCacheIdMap(e),r=new Map;Object.entries(e.pivotCacheDefinitions||{}).forEach(([t,i])=>{let a=n.get(t);if(a!==void 0){let n=t.replace(`Definition`,`Records`);r.set(a,{definition:i,records:e.pivotCacheRecords?.[n],definitionName:t})}});let i=[],a={};Object.entries(t).forEach(([e,t])=>{let n=this._extractTableNumber(e),o=r.get(t.cacheId),s=this._determineMetric(t.dataFields),c={...t,tableNumber:n,cacheId:String(t.cacheId),cacheDefinition:o?.definition,cacheRecords:o?.records,cacheFields:o?.definition?.cacheFields??[],rows:t.rowFields.filter(e=>e>=0),columns:t.colFields.filter(e=>e>=0&&e!==-2),values:t.dataFields.map(e=>e.fld),pages:t.pageFields.map(e=>e.fld),metric:s,valueMetrics:this._determineValueMetrics(t.dataFields,s),applyWidthHeightFormats:t.applyWidthHeightFormats===`1`?`1`:`0`};i.push(c),a[_d(e)]=c}),i.sort((e,t)=>e.tableNumber-t.tableNumber),e.pivotTables=i,e.pivotTablesIndexed=a}_extractTableNumber(e){let t=e.match(/pivotTable(\d+)/);return t?parseInt(t[1],10):1}_buildCacheIdMap(e){let t=new Map,n=e.pivotCaches??[];for(let e of n)e.cacheId&&e.rId&&t.set(e.rId,parseInt(e.cacheId,10));return t}_buildDefinitionToCacheIdMap(t){let n=new Map,r=this._buildCacheIdMap(t),i=t.workbookRels??[];for(let t of i)if(t.Type===e.RelType.PivotCacheDefinition&&t.Target){let e=t.Target.match(/pivotCacheDefinition(\d+)\.xml/);if(e){let i=`pivotCacheDefinition${e[1]}`,a=r.get(t.Id);a!==void 0&&n.set(i,a)}}return n}_determineMetric(e){return e.length>0&&e[0].subtotal?e[0].subtotal:`sum`}_determineValueMetrics(e,t){return e.map(e=>e.subtotal||t)}async _processWorksheetEntry(e,t,n,r,i){let a=await new By(r).parseStream(e);if(!a)throw new Fr(i,`Failed to parse worksheet`);a.sheetNo=n,t.worksheetHash[i]=a,t.worksheets.push(a)}async _processCommentEntry(e,t,n){let r=await new iy().parseStream(e);t.comments[n]=r}async _processTableEntry(e,t,n){let r=await new qy().parseStream(e);t.tables[n]=r}async _processWorksheetRelsEntry(e,t,n){let r=await new tf().parseStream(e);t.worksheetRels[n]=r}async _processMediaEntry(e,t,n){let r=n.lastIndexOf(`.`);if(r>=1){let i=n.substr(r+1),a=n.substr(0,r);await new Promise((r,o)=>{let s=this.createStreamBuf(),c=()=>{e.off(`error`,u),s.off(`error`,u),s.off(`finish`,l)},l=()=>{c(),t.mediaIndex[n]=t.media.length,t.mediaIndex[a]=t.media.length;let e={type:`image`,name:a,extension:i,buffer:s.read()};t.media.push(e),r()},u=e=>{c(),o(e)};s.once(`finish`,l),e.on(`error`,u),s.on(`error`,u),e.pipe(s)})}}async _processDrawingEntry(e,t,n,r){let i=r??await this.collectStreamData(e),a=new Eg,o=this.bufferToString(i),s=await a.parseStream(this.createTextStream(o));t.drawings[n]=s,t.rawDrawings[n]=i}async _processDrawingRelsEntry(e,t,n){let r=await new tf().parseStream(e);t.drawingRels[n]=r}async _processVmlDrawingEntry(e,t,n){let r=await new oy().parseStream(e);t.vmlDrawings[n]=r}async _processVmlDrawingHFEntry(e,t,n){let r=await new oy().parseStream(e);r&&r.headerImage&&(t.vmlDrawingHF||={},t.vmlDrawingHF[n]=r.headerImage)}async _processThemeEntry(e,t,n){await new Promise((r,i)=>{let a=this.createStreamBuf(),o=()=>{e.off(`error`,c),a.off(`error`,c),a.off(`finish`,s)},s=()=>{o();let e=a.read();t.themes[n]=e?typeof e==`string`?e:this.bufferToString(e):``,r()},c=e=>{o(),i(e)};a.once(`finish`,s),e.on(`error`,c),a.on(`error`,c),e.pipe(a)})}async _processPivotTableEntry(e,t,n){let r=await new Dy().parseStream(e);r&&(t.pivotTables[n]=r)}async _processPivotTableRelsEntry(e,t,n){let r=await new tf().parseStream(e);t.pivotTableRels[n]=r}async _processPivotCacheDefinitionEntry(e,t,n){let r=await new vy().parseStream(e);r&&(t.pivotCacheDefinitions[n]=r)}async _processPivotCacheRecordsEntry(e,t,n){let r=await new by().parseStream(e);r&&(t.pivotCacheRecords[n]=r)}async _processExternalLinkEntry(e,t,n){let r=await new Jv().parseStream(e);r&&(t.externalLinksByIndex[n]=r)}async _processExternalLinkRelsEntry(e,t,n){let r=await this.parseRels(e);t.externalLinkRelsByIndex[n]=r??[]}async loadFromFiles(e,t){let n=this.createEmptyModel(),r=Object.keys(e).map(t=>({name:t,dir:t.endsWith(`/`),data:e[t]}));for(let e of r)if(!e.dir){let r=ju(e.name),i=Ru(r)?this.createBinaryStream(e.data):this.createTextStream(this.bufferToString(e.data));await this._processKnownEntry(i,n,r,t)||await this._processDefaultEntry(i,n,r,e.data)}return this.reconcile(n,t),this.workbook.model=n,this.workbook}async _processDefaultEntry(e,t,n,r){let i=Nu(n);if(i!==void 0)return await this._processWorksheetRelsEntry(e,t,i),!0;let a=Fu(n);if(a)return await this._processMediaEntry(e,t,a),!0;let o=zu(n);if(o)return await this._processDrawingEntry(e,t,o,r),!0;let s=Bu(n);if(s)return await this._processDrawingRelsEntry(e,t,s),!0;if(Vu(n))return await this._processVmlDrawingEntry(e,t,n),!0;let c=Hu(n);if(c)return await this._processVmlDrawingHFEntry(e,t,c),!0;if(Uu(n))return await this._processCommentEntry(e,t,n),!0;if(Wu(n))return await this._processTableEntry(e,t,n),!0;let l=Lu(n);if(l)return await this._processThemeEntry(e,t,l),!0;let u=Gu(n);if(u)return await this._processPivotTableEntry(e,t,u),!0;let d=Ku(n);if(d)return await this._processPivotTableRelsEntry(e,t,d),!0;let f=qu(n);if(f)return await this._processPivotCacheDefinitionEntry(e,t,f),!0;if(Ju(n))return!0;let p=Yu(n);if(p)return await this._processPivotCacheRecordsEntry(e,t,p),!0;let m=Xu(n);if(m!==void 0)return await this._processExternalLinkEntry(e,t,m),!0;let h=Zu(n);return h===void 0?Kv.isPassthroughPath(n)?(r?t.passthrough[n]=r:await this._processPassthroughEntry(e,t,n),!0):!1:(await this._processExternalLinkRelsEntry(e,t,h),!0)}async _processPassthroughEntry(e,t,n){let r=await this.collectStreamData(e);t.passthrough[n]=r}async _renderToZip(e,t,n,r){let i=e.createEntry(t),a=new Jy(i);n.render(a,r),i.end(),await e.waitForDrain()}async addContentTypes(e,t){await this._renderToZip(e,M.contentTypes,new tg,t)}async addApp(e,t){await this._renderToZip(e,M.docPropsApp,new eg,t)}async addCore(e,t){await this._renderToZip(e,M.docPropsCore,new ig,t)}async addThemes(e,t){let n=t.themes||{theme1:`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
428
|
+
<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> </a:lnStyleLst> <a:effectStyleLst> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="38000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> <a:scene3d> <a:camera prst="orthographicFront"> <a:rot lat="0" lon="0" rev="0"/> </a:camera> <a:lightRig rig="threePt" dir="t"> <a:rot lat="0" lon="0" rev="1200000"/> </a:lightRig> </a:scene3d> <a:sp3d> <a:bevelT w="63500" h="25400"/> </a:sp3d> </a:effectStyle> </a:effectStyleLst> <a:bgFillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="40000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="40000"> <a:schemeClr val="phClr"> <a:tint val="45000"/> <a:shade val="99000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="20000"/> <a:satMod val="255000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="-80000" r="50000" b="180000"/> </a:path> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="80000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="30000"/> <a:satMod val="200000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="50000" r="50000" b="50000"/> </a:path> </a:gradFill> </a:bgFillStyleLst> </a:fmtScheme> </a:themeElements> <a:objectDefaults> <a:spDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="1"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="3"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="2"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="lt1"/> </a:fontRef> </a:style> </a:spDef> <a:lnDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="2"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="0"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="1"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="tx1"/> </a:fontRef> </a:style> </a:lnDef> </a:objectDefaults> <a:extraClrSchemeLst/> </a:theme>`};Object.keys(n).forEach(t=>{let r=n[t];e.append(r,{name:$u(t)})})}async addOfficeRels(t,n){await this._renderToZip(t,M.rootRels,new tf,[{Id:`rId1`,Type:e.RelType.OfficeDocument,Target:M.xlWorkbook},{Id:`rId2`,Type:e.RelType.CoreProperties,Target:M.docPropsCore},{Id:`rId3`,Type:e.RelType.ExtenderProperties,Target:M.docPropsApp}])}async addWorkbookRels(t,n){let r=1,i=[{Id:`rId${r++}`,Type:e.RelType.Styles,Target:Cd.workbookStyles},{Id:`rId${r++}`,Type:e.RelType.Theme,Target:Cd.workbookTheme1}];n.sharedStrings.count&&i.push({Id:`rId${r++}`,Type:e.RelType.SharedStrings,Target:Cd.workbookSharedStrings}),n.hasCheckboxes&&i.push({Id:`rId${r++}`,Type:e.RelType.FeaturePropertyBag,Target:Cd.workbookFeaturePropertyBag}),n.hasDynamicArrayFormulas&&i.push({Id:`rId${r++}`,Type:e.RelType.SheetMetadata,Target:Cd.workbookMetadata});let a=new Map;(n.pivotTables??[]).forEach(t=>{let n=a.get(t.cacheId);n?t.rId=n:(t.rId=`rId${r++}`,a.set(t.cacheId,t.rId),i.push({Id:t.rId,Type:e.RelType.PivotCacheDefinition,Target:wd(t.tableNumber)}))}),n.worksheets.forEach(t=>{t.rId=`rId${r++}`,i.push({Id:t.rId,Type:e.RelType.Worksheet,Target:rd(t.fileIndex)})});let o=n.externalLinks??[];for(let t of o)t.rId=`rId${r++}`,i.push({Id:t.rId,Type:e.RelType.ExternalLink,Target:xd(t.index)});let s=new tf;await this._renderToZip(t,M.xlWorkbookRels,s,i)}async addFeaturePropertyBag(e,t){t.hasCheckboxes&&await this._renderToZip(e,M.xlFeaturePropertyBag,new ag,{})}async addMetadata(e,t){t.hasDynamicArrayFormulas&&await this._renderToZip(e,M.xlMetadata,new $d,{dynamicArrayCount:t.dynamicArrayCount})}async addSharedStrings(e,t){t.sharedStrings&&t.sharedStrings.count&&await this._renderToZip(e,M.xlSharedStrings,t.sharedStrings,t.sharedStrings.model)}async addStyles(e,t){t.styles&&await this._renderToZip(e,M.xlStyles,t.styles,t.styles.model)}async addWorkbook(e,t){await this._renderToZip(e,M.xlWorkbook,new Qd,t)}async addWorksheets(e,t){let n=new By,r=new tf,i=new iy,a=new oy,o=new ay;for(let s of t.worksheets){let{fileIndex:t}=s,c=e.createEntry(td(t)),l=new Jy(c);n.render(l,s),c.end(),await e.waitForDrain(),s.rels&&s.rels.length&&await this._renderToZip(e,nd(t),r,s.rels),s.comments.length>0&&await this._renderToZip(e,id(t),i,s);let u=s.comments.length>0,d=s.formControls&&s.formControls.length>0;if((u||d)&&await this._renderToZip(e,od(t),a,{comments:u?s.comments:[],formControls:d?s.formControls:[]}),s.headerImage){let n=s.headerImage,i=n.bookImage,o=`../media/${i.name&&i.extension&&i.name.endsWith(`.${i.extension}`)?i.name:`${i.name}.${i.extension}`}`;await this._renderToZip(e,sd(t),a,{comments:[],formControls:[],headerImage:{imageRelId:`rId1`,width:n.headerWidth,height:n.headerHeight}}),await this._renderToZip(e,cd(t),r,[{Id:`rId1`,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,Target:o}])}if(d)for(let t of s.formControls)await this._renderToZip(e,Md(t.ctrlPropId),o,t)}}async addDrawings(e,t){let n=new Eg,r=new tf,i=t.rawDrawings||{};for(let a of t.worksheets){let{drawing:t}=a;if(t){if(this.drawingHasChartReference(t)&&i[t.name])e.append(i[t.name],{name:ud(t.name)});else{let r=vm(t.anchors??[]),i=t.anchors?{...t,anchors:r}:t;n.prepare(i),await this._renderToZip(e,ud(t.name),n,i)}await this._renderToZip(e,dd(t.name),r,t.rels)}}}async addTables(e,t){let n=new qy;for(let r of t.worksheets)for(let t of r.tables)n.prepare(t,{}),await this._renderToZip(e,ld(t.target),n,t)}async addExternalLinks(t,n){let r=n.externalLinks??[];if(r.length===0)return;let i=new Jv,a=new tf;for(let n of r)await this._renderToZip(t,yd(n.index),i,n),await this._renderToZip(t,bd(n.index),a,[{Id:`rId1`,Type:e.RelType.ExternalLinkPath,Target:n.target,TargetMode:n.targetMode??`External`}])}addPassthrough(e,t){let n=new Kv;n.fromRecord(t.passthrough||{}),n.writeToZip(e)}async addPivotTables(t,n){if(!n.pivotTables.length)return;let r=new by,i=new vy,a=new Dy,o=new tf,s=new Map;for(let c of n.pivotTables){let n=c.tableNumber,l=c.isLoaded,u=c.cacheId;if(!s.has(u)&&(s.set(u,n),l?(c.cacheDefinition&&await this._renderToZip(t,fd(n),i,c.cacheDefinition),c.cacheRecords&&await this._renderToZip(t,md(n),r,c.cacheRecords)):(await this._renderToZip(t,md(n),r,c),await this._renderToZip(t,fd(n),i,c)),!l||c.cacheRecords)){let r=(l?c.cacheDefinition?.rId:void 0)??`rId1`;await this._renderToZip(t,pd(n),o,[{Id:r,Type:e.RelType.PivotCacheRecords,Target:hd(n)}])}await this._renderToZip(t,gd(n),a,c);let d=s.get(u);await this._renderToZip(t,vd(n),o,[{Id:`rId1`,Type:e.RelType.PivotCacheDefinition,Target:Sd(d)}])}}_finalize(e){return new Promise((t,n)=>{e.on(`finish`,()=>{t(this)}),e.on(`error`,n),e.finalize()})}prepareModel(e,t){e.creator=e.creator??`ExcelTS`,e.lastModifiedBy=e.lastModifiedBy??`ExcelTS`,e.created=e.created??new Date,e.modified=e.modified??new Date,e.useSharedStrings=t.useSharedStrings===void 0?!0:t.useSharedStrings,e.useStyles=t.useStyles===void 0?!0:t.useStyles,e.sharedStrings=new kg;let n=e.defaultFont;e.styles=e.useStyles?new Of(!0):new Of.Mock,n&&e.styles.setDefaultFont&&e.styles.setDefaultFont(n);let r=new Qd,i=new By;r.prepare(e),this._normaliseExternalLinks(e);let a={sharedStrings:e.sharedStrings,styles:e.styles,date1904:e.properties?.date1904,drawingsCount:0,media:e.media};a.drawings=e.drawings=[],a.commentRefs=e.commentRefs=[],a.formControlRefs=e.formControlRefs=[],e.hasHeaderWatermark=!1;let o=0;e.tables=[];let s=new Map;e.worksheets.forEach((t,n)=>{t.fileIndex=n+1,t.tables.forEach(n=>{let r=n.name.toLowerCase(),i=s.get(r);if(i!==void 0)throw new Vr(`Duplicate table name "${n.name}": already used in worksheet "${i}". Table names must be unique across the entire workbook (case-insensitive).`);s.set(r,t.name),o++,n.target=`table${o}.xml`,n.id=o,e.tables.push(n)}),i.prepare(t,a)}),e.hasCheckboxes=e.styles.hasCheckboxes;let c=0;e.worksheets.forEach(e=>{(e.rows??[]).forEach(e=>{(e.cells??[]).forEach(e=>{e.isDynamicArray&&c++})})}),e.hasDynamicArrayFormulas=c>0,e.dynamicArrayCount=c,a.hasHeaderWatermark&&(e.hasHeaderWatermark=!0);let l=e.passthrough||{},u=new Kv;u.fromRecord(l),e.passthroughContentTypes=u.getContentTypes()}};function $y(e){throw Error("No formula engine is installed. Call `installFormulaEngine()` from `@cj-tech-master/excelts/formula` once at startup to enable `Workbook.calculateFormulas()` and automatic recalculation during `excelToPdf()`.")}let eb=/\r\n|\r|\n/,tb=/\r\n|[|\\\r\n]/g,nb=/\\([|\\])/g,rb=/<br\s*\/?>/gi,ib=/\r\n|\r|\n/g;function ab(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r>=55296&&r<=56319&&n+1<e.length){let r=e.charCodeAt(n+1);if(r>=56320&&r<=57343){t+=2,n++;continue}}if(!(r===8203||r===8204||r===8205||r===65279)&&!(r>=768&&r<=879||r>=6832&&r<=6911||r>=7616&&r<=7679||r>=8400&&r<=8447||r>=65056&&r<=65071)){if(r>=4352&&r<=4447||r>=11904&&r<=12350||r>=12352&&r<=13247||r>=13312&&r<=19903||r>=19968&&r<=42191||r>=43360&&r<=43391||r>=44032&&r<=55215||r>=63744&&r<=64255||r>=65040&&r<=65049||r>=65072&&r<=65135||r>=65281&&r<=65376||r>=65504&&r<=65510){t+=2;continue}t+=1}}return t}function ob(e){if(e==null)return``;if(e instanceof Date)return e.toISOString();if(typeof e==`object`)try{return JSON.stringify(e)}catch{return`[object Object]`}return String(e)}function sb(e){return e.replace(tb,e=>e===`|`||e===`\\`?`\\`+e:`<br>`)}function cb(e){return e.indexOf(`
|
|
429
|
+
`)!==-1||e.indexOf(`\r`)!==-1?e.replace(ib,`<br>`):e}function lb(e,t){switch(e){case`left`:return`:`+`-`.repeat(t-1);case`right`:return`-`.repeat(t-1)+`:`;case`center`:return`:`+`-`.repeat(Math.max(t-2,1))+`:`;default:return`-`.repeat(t)}}function ub(e,t,n){let r=ab(e);if(r>=t)return e;let i=t-r;switch(n){case`right`:return` `.repeat(i)+e;case`center`:{let t=Math.floor(i/2),n=i-t;return` `.repeat(t)+e+` `.repeat(n)}default:return e+` `.repeat(i)}}function db(e,t){let n=e.length,r=t.alignment??`left`,i=Array(n),a=Array(n),o=Array(n);if(t.columns&&t.columns.length>0)for(let s=0;s<n;s++){let n=s<t.columns.length?t.columns[s]:void 0;typeof n==`string`?(i[s]=n,a[s]=r,o[s]=3):n?(i[s]=n.header,a[s]=n.alignment??r,o[s]=n.minWidth??3):(i[s]=e[s]??``,a[s]=r,o[s]=3)}else for(let t=0;t<n;t++)i[t]=e[t]??``,a[t]=r,o[t]=3;return{displayHeaders:i,alignments:a,minWidths:o}}function fb(e,t,n={}){let{padding:r=!0,trailingNewline:i=!0,escapeContent:a=!0,stringify:o=ob}=n,s=e.length;if(s===0)return``;let{displayHeaders:c,alignments:l,minWidths:u}=db(e,n),d=Array(s),f=Array(s);for(let e=0;e<s;e++){let t=a?sb(c[e]):cb(c[e]);d[e]=t,f[e]=r?Math.max(ab(t),u[e]):Math.max(u[e],3)}let p=Array(t.length);for(let e=0;e<t.length;e++){let n=t[e],i=Array(s);for(let e=0;e<s;e++){let t=e<n.length?o(n[e]):``,s=a?sb(t):cb(t);if(i[e]=s,r){let t=ab(s);t>f[e]&&(f[e]=t)}}p[e]=i}let m=2+p.length,h=Array(m),g=Array(s);for(let e=0;e<s;e++)g[e]=r?` `+ub(d[e],f[e],l[e])+` `:` `+d[e]+` `;h[0]=`|`+g.join(`|`)+`|`;let _=Array(s);for(let e=0;e<s;e++)_[e]=lb(l[e],f[e]+2);h[1]=`|`+_.join(`|`)+`|`;for(let e=0;e<p.length;e++){let t=Array(s);for(let n=0;n<s;n++)t[n]=r?` `+ub(p[e][n],f[n],l[n])+` `:` `+p[e][n]+` `;h[e+2]=`|`+t.join(`|`)+`|`}let v=h.join(`
|
|
430
430
|
`);return i&&(v+=`
|
|
431
|
-
`),v}var
|
|
432
|
-
`)),n}function rb(e,t,n){let r=Array(t);for(let i=0;i<t;i++)r[i]=i<e.length?nb(e[i],n):``;return r}function ib(e){for(let t=0;t<e.length;t++)if(e[t]!==``)return!1;return!0}function ab(e){return e.indexOf(`|`)!==-1}function ob(e){let t=e.length,n=0;for(;n<t;){let t=e.charCodeAt(n);if(t!==32&&t!==9)return t===124;n++}return!1}function sb(e){return e.indexOf(`-`)!==-1}function cb(e,t,n,r){if(t>=n-1)return null;let i=e[t].trim();if(i===``||!ab(i))return null;let a=Qy(i);if(a.length<1)return null;let o=e[t+1].trim();if(o===``||!sb(o))return null;let s=Qy(o);if(!tb(s))return null;let c=a.length,l=Array(c),u=Array(c);for(let e=0;e<c;e++)l[e]=nb(a[e],r),u[e]=e<s.length?$y(s[e]):`none`;let d=ob(i),f=[],p=t+2;for(;p<n;p++){let t=e[p].trim();if(t===``||!ab(t)||d&&!ob(t))break;if(r.maxRows!==void 0&&f.length>=r.maxRows){for(;p<n;){let t=e[p].trim();if(t===``||!ab(t)||d&&!ob(t))break;p++}break}let i=rb(Qy(t),c,r);r.skipEmpty&&ib(i)||f.push(i)}return{result:{headers:l,rows:f,alignments:u},endLine:p}}function lb(e,t={}){let n=Zy(t),r=e.split(Iy),i=r.length;for(let e=0;e<i-1;e++){let t=cb(r,e,i,n);if(t)return t.result}throw new Xy(`No valid Markdown table found in input`,i>0?i:1)}function ub(e,t={}){let n=Zy(t),r=e.split(Iy),i=r.length,a=[],o=0;for(;o<i-1;){let e=cb(r,o,i,n);e?(a.push(e.result),o=e.endLine):o++}return a}let db=[`YYYY-MM-DD[T]HH:mm:ssZ`,`YYYY-MM-DD[T]HH:mm:ss`,`MM-DD-YYYY`,`YYYY-MM-DD`],fb={true:!0,false:!1,"#N/A":{error:`#N/A`},"#REF!":{error:`#REF!`},"#NAME?":{error:`#NAME?`},"#DIV/0!":{error:`#DIV/0!`},"#NULL!":{error:`#NULL!`},"#VALUE!":{error:`#VALUE!`},"#NUM!":{error:`#NUM!`}};function pb(e,t){let n=$e.create(e),r=t?.decimalSeparator??`.`;return function(e){if(e===``)return null;if(typeof e==`string`){let t=ae(e,r);if(!Number.isNaN(t)&&t!==1/0)return t}else{let t=Number(e);if(!Number.isNaN(t)&&t!==1/0)return t}if(typeof e==`string`){let t=n.parse(e);if(t)return t;let r=fb[e];if(r!==void 0)return r}return e}}function mb(e,t){let n=e?tt.create(e,{utc:t}):tt.iso(t);return function(e){if(e==null)return e;if(e instanceof Date)return n.format(e);if(typeof e!=`object`)return e;let t=e;if(typeof t.hyperlink==`string`||typeof t.text==`string`){let e=typeof t.hyperlink==`string`?t.hyperlink:``,n=typeof t.text==`string`?t.text:``;return e||n||``}return`formula`in e||`sharedFormula`in e?e.result??``:`richText`in e&&Array.isArray(e.richText)?e.richText.map(e=>e.text).join(``):`checkbox`in e&&typeof e.checkbox==`boolean`?e.checkbox:`error`in e&&typeof e.error==`string`?e.error:JSON.stringify(e)}}function hb(e,t){let n=e?tt.create(e,{utc:t}):tt.iso(t);return function(e){if(e==null)return``;if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`bigint`)return String(e);if(typeof e==`boolean`)return e?`true`:`false`;if(e instanceof Date)return n.format(e);if(typeof e==`object`){let t=e;if(t.text||t.hyperlink)return t.hyperlink||t.text||``;if(t.formula||t.result)return t.result==null?``:String(t.result);if(t.richText&&Array.isArray(t.richText))return t.richText.map(e=>e.text).join(``);if(t.error)return t.error;try{return JSON.stringify(e)}catch{return`[object Object]`}}return String(e)}}function gb(e){return typeof e==`string`&&/^https?:\/\//i.test(e)}function _b(e){return typeof File<`u`&&e instanceof File}function vb(e){return typeof Blob<`u`&&e instanceof Blob&&!_b(e)}function yb(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t[Symbol.asyncIterator]==`function`||typeof t.pipe==`function`&&typeof t.on==`function`}function bb(e){return{delimiter:e?.delimiter??`,`,quote:e?.quote,escape:e?.escape,delimitersToGuess:e?.delimitersToGuess,lineEnding:e?.lineEnding,headers:e?.headers,skipEmptyLines:e?.skipEmptyLines,trim:e?.trim,ltrim:e?.ltrim,rtrim:e?.rtrim,comment:e?.comment,maxRows:e?.maxRows,toLine:e?.toLine,skipLines:e?.skipLines,skipRows:e?.skipRows,columnMismatch:e?.columnMismatch,groupColumnsByName:e?.groupColumnsByName,relaxQuotes:e?.relaxQuotes,fastMode:e?.fastMode,info:e?.info,raw:e?.raw,skipRecordsWithError:e?.skipRecordsWithError,skipRecordsWithEmptyValues:e?.skipRecordsWithEmptyValues,onSkip:e?.onSkip}}function xb(e){return{delimiter:e?.delimiter??`,`,quote:e?.quote,escape:e?.escape,lineEnding:e?.lineEnding,quoteColumns:e?.quoteColumns,quoteHeaders:e?.quoteHeaders,decimalSeparator:e?.decimalSeparator??`.`,escapeFormulae:e?.escapeFormulae??!0,writeHeaders:e?.writeHeaders}}var Sb=class{static{this.Writer=hg}static{this.Reader=hf}constructor(e){this._tableNames=new Set,this.category=``,this.company=``,this.created=new Date,this.description=``,this.keywords=``,this.manager=``,this.modified=this.created,this.properties={},this.calcProperties={},this._worksheets=[],this.subject=``,this.title=``,this.views=[],this.media=[],this.pivotTables=[],this.externalLinks=[],this._passthrough={},this._rawDrawings={},this._writerExternalLinkCache=new Map,this._definedNames=new $r(e?.formulaSyntaxProbe)}get defaultFont(){return this._defaultFont}set defaultFont(e){this._defaultFont=e}importSheet(e,t){let n=this.addWorksheet(t??e.name);return n.model={...e.model,id:n.id,name:n.name},n}async protect(e,t){this.protection=await Ph(e,t)}unprotect(){this.protection=void 0}get xlsx(){return this._xlsx||=new Py(this),this._xlsx}async readCsv(e,t){return gb(e)?this._readCsvUrl(e,t):_b(e)?this._readCsvFile(e,t):vb(e)?this._readCsvBlob(e,t):yb(e)?this._readCsvStream(e,t):this._readCsvContent(e,t)}writeCsv(e,t){return e&&typeof e.write==`function`?this._writeCsvStream(e,t):this._writeCsvString(e)}async writeCsvBuffer(e){let t=this._writeCsvString(e);return new TextEncoder().encode(t)}async readCsvFile(e,t){throw new Mr(`readCsvFile()`,`not available in browser. Use readCsv(url) or readCsv(file) instead.`)}async writeCsvFile(e,t){throw new Mr(`writeCsvFile()`,`not available in browser. Use writeCsv() and trigger a download instead.`)}createCsvReadStream(e){let t=this.getWorksheet(e?.sheetName||e?.sheetId),n=e?.map||mb(e?.dateFormat,e?.dateUTC),r=e?.includeEmptyRows!==!1,i=new Sr(xb(e));return setTimeout(t?()=>{let e=1;t.eachRow((t,a)=>{if(r)for(;e++<a-1;)i.write([]);let{values:o}=t;o.shift(),i.write(o.map(n)),e=a}),i.end()}:()=>i.end(),0),i}createCsvWriteStream(e){let t=this.addWorksheet(e?.sheetName),n=e?.dateFormats??db,r=e?.decimalSeparator,i=e?.map||pb(n,{decimalSeparator:r}),a=new br(bb(e)),o=!!e?.headers,s=null;return o&&a.on(`headers`,e=>{s=e,t.addRow(e)}),a.on(`data`,e=>{if(o&&s&&e&&typeof e==`object`&&!Array.isArray(e)){let n=e,r=s.map(e=>n[e]);t.addRow(r.map(i))}else Array.isArray(e)&&t.addRow(e.map(i))}),a}_readCsvContent(e,t){let n;n=typeof e==`string`?e:e instanceof ArrayBuffer||e instanceof Uint8Array?new TextDecoder().decode(e):String(e);let r=this.addWorksheet(t?.sheetName),i=t?.dateFormats??db,a=t?.decimalSeparator,o=t?.map||pb(i,{decimalSeparator:a}),s=tn(n,bb(t));if(Array.isArray(s))for(let e of s)r.addRow(e.map(o));else{s.headers&&r.addRow(s.headers);for(let e of s.rows){let t=s.headers.map(t=>e[t]);r.addRow(t.map(o))}}return r}async _readCsvStream(e,t){let n=this.addWorksheet(t?.sheetName),r=t?.dateFormats??db,i=t?.decimalSeparator,a=t?.map||pb(r,{decimalSeparator:i}),o=new br(bb(t)),s=!!t?.headers,c=null;return new Promise((t,r)=>{s&&o.on(`headers`,e=>{c=e,n.addRow(e)}),o.on(`data`,e=>{if(s&&c&&e&&typeof e==`object`&&!Array.isArray(e)){let t=e,r=c.map(e=>t[e]);n.addRow(r.map(a))}else Array.isArray(e)&&n.addRow(e.map(a))}),gr(e,o).then(()=>t(n)).catch(r)})}async _readCsvUrl(e,t){let n={method:t?.requestBody?`POST`:`GET`,headers:t?.requestHeaders,body:t?.requestBody,credentials:t?.withCredentials?`include`:`same-origin`,signal:t?.signal},r=await fetch(e,n);if(!r.ok)throw new Fr(e,r.status,r.statusText);if(t?.stream&&r.body){let e=Dn(r.body);return this._readCsvStream(e,t)}let i=await r.text();return this._readCsvContent(i,t)}async _readCsvFile(e,t){if((t?.stream||e.size>10*1024*1024)&&typeof e.stream==`function`){let n=Dn(e.stream());return this._readCsvStream(n,t)}return new Promise((n,r)=>{let i=new FileReader,a=t?.encoding??`UTF-8`;t?.onProgress&&(i.onprogress=n=>{t.onProgress(n.loaded,n.total||e.size)}),i.onload=e=>{try{let r=e.target?.result;n(this._readCsvContent(r,t))}catch(e){r(e)}},i.onerror=()=>r(Error(`Failed to read file: ${e.name}`)),i.readAsText(e,a)})}async _readCsvBlob(e,t){let n=await e.text();return this._readCsvContent(n,t)}_writeCsvString(e){let t=this.getWorksheet(e?.sheetName||e?.sheetId);if(!t)return``;let n=e?.map||mb(e?.dateFormat,e?.dateUTC),r=e?.includeEmptyRows!==!1,i=[],a=1;return t.eachRow((e,t)=>{if(r)for(;a++<t-1;)i.push([]);let{values:o}=e;o.shift(),i.push(o.map(n)),a=t}),ke(i,xb(e))}async _writeCsvStream(e,t){let n=this.getWorksheet(t?.sheetName||t?.sheetId);if(!n){e.end();return}let r=t?.map||mb(t?.dateFormat,t?.dateUTC),i=t?.includeEmptyRows!==!1,a=new Sr(xb(t)),o=gr(a,e),s=1;n.eachRow((e,t)=>{if(i)for(;s++<t-1;)a.write([]);let{values:n}=e;n.shift(),a.write(n.map(r)),s=t}),a.end(),await o}_populateMarkdownWorksheet(e,t,n){e.addRow(t.headers),e._markdownAlignments=t.alignments;for(let r of t.rows)n?e.addRow(r.map((e,t)=>n(e,t))):e.addRow(r)}readMarkdown(e,t){let n=lb(e,{trim:t?.trim,unescape:t?.unescape,skipEmptyRows:t?.skipEmptyRows,maxRows:t?.maxRows,convertBr:t?.convertBr}),r=this.addWorksheet(t?.sheetName);return this._populateMarkdownWorksheet(r,n,t?.map),r}readMarkdownAll(e,t){let n=ub(e,{trim:t?.trim,unescape:t?.unescape,skipEmptyRows:t?.skipEmptyRows,maxRows:t?.maxRows,convertBr:t?.convertBr}),r=t?.sheetName,i=t?.map,a=[];for(let e=0;e<n.length;e++){let t=r?e===0?r:`${r}_${e+1}`:void 0,o=this.addWorksheet(t);this._populateMarkdownWorksheet(o,n[e],i),a.push(o)}return a}writeMarkdown(e){let t=this.getWorksheet(e?.sheetName||e?.sheetId);if(!t)return``;let n=e?.dateFormat,r=e?.dateUTC,i=e?.includeEmptyRows!==!1,a=e?.stringify??hb(n,r),o=[],s=1;if(t.eachRow((e,t)=>{if(i)for(;s++<t-1;)o.push([]);let n=Array.from(e.values).slice(1);o.push(n),s=t}),o.length===0)return``;let c=o[0].map(e=>a(e)),l=o.slice(1),u=t._markdownAlignments,d=e?.columns,f;return!d&&u&&(f=c.map((e,t)=>({header:e,alignment:t<u.length?u[t]:void 0}))),Jy(c,l,{columns:f??d,alignment:e?.alignment,padding:e?.padding,trailingNewline:e?.trailingNewline,escapeContent:e?.escapeContent,stringify:a})}writeMarkdownBuffer(e){let t=this.writeMarkdown(e);return new TextEncoder().encode(t)}async readMarkdownFile(e,t){throw new Mr(`readMarkdownFile()`,`not available in browser. Use readMarkdown(string) instead.`)}async readMarkdownAllFile(e,t){throw new Mr(`readMarkdownAllFile()`,`not available in browser. Use readMarkdownAll(string) instead.`)}async writeMarkdownFile(e,t){throw new Mr(`writeMarkdownFile()`,`not available in browser. Use writeMarkdown() and trigger a download instead.`)}static createStreamWriter(e){return new hg(e)}static createStreamReader(e,t){return new hf(e,t)}get nextId(){for(let e=1;e<this._worksheets.length;e++)if(!this._worksheets[e])return e;return this._worksheets.length||1}addWorksheet(e,t){let n=this.nextId,r=this._worksheets.reduce((e,t)=>(t&&t.orderNo)>e?t.orderNo:e,0),i=new K_({...t,id:n,name:e,orderNo:r+1,workbook:this});return this._worksheets[n]=i,i}removeWorksheetEx(e){this._worksheets[e.id]=void 0}removeWorksheet(e){let t=this.getWorksheet(e);t&&t.destroy()}getWorksheet(e){if(e===void 0)return this._worksheets.find(Boolean);if(typeof e==`number`)return this._worksheets[e];if(typeof e==`string`){let t=e.toLowerCase();return this._worksheets.find(e=>e&&e.name.toLowerCase()===t)}}get worksheets(){return this._worksheets.slice(1).sort((e,t)=>e.orderNo-t.orderNo).filter(Boolean)}eachSheet(e){this.worksheets.forEach(t=>{e(t,t.id)})}get definedNames(){return this._definedNames}calculateFormulas(){Fy(this)}registerFunction(e,t,n){this.userFunctions||=new Map,this.userFunctions.set(e.toUpperCase(),{minArity:n?.minArity??0,maxArity:n?.maxArity??255,invoke:t,volatile:n?.volatile??!1})}unregisterFunction(e){return this.userFunctions?.delete(e.toUpperCase())??!1}clearThemes(){this._themes=void 0}addImage(e){let t=this.media.length;return this.media.push({...e,type:`image`}),t}getImage(e){return this.media[Number(e)]}addExternalLink(e){let t={index:this.externalLinks.length+1,target:e.target,targetMode:e.targetMode??`External`,sheetNames:e.sheetNames?[...e.sheetNames]:[],cachedValues:e.cachedValues?{...e.cachedValues}:{}};return this.externalLinks.push(t),t}getExternalLink(e){if(typeof e==`number`)return this.externalLinks[e-1];let t=e.toLowerCase();return this.externalLinks.find(e=>e.target.toLowerCase()===t)}_collectExternalLinksForWrite(){let e=new Set(this.externalLinks.map(e=>e.target.toLowerCase())),t=this.externalLinks.map((e,t)=>({...e,index:t+1,sheetNames:[...e.sheetNames??[]],cachedValues:{...e.cachedValues??{}},targetMode:e.targetMode??`External`}));for(let n of this._writerExternalLinkCache.values())e.has(n.target.toLowerCase())||t.push({...n,index:t.length+1,sheetNames:[...n.sheetNames],cachedValues:{...n.cachedValues}});return t}_recordAutoExternalLink(e,t){let n=e.toLowerCase(),r=this.externalLinks.findIndex(e=>e.target.toLowerCase()===n);if(r!==-1)return r+1;let i=this._writerExternalLinkCache.get(n);i||(i={index:0,target:e,targetMode:`External`,sheetNames:[],cachedValues:{}},this._writerExternalLinkCache.set(n,i)),t&&!i.sheetNames.includes(t)&&i.sheetNames.push(t);let a=this.externalLinks.length,o=0;for(let e of this._writerExternalLinkCache.keys())if(o++,e===n)return a+o;return a+this._writerExternalLinkCache.size}get model(){return{creator:this.creator||`Unknown`,lastModifiedBy:this.lastModifiedBy||`Unknown`,lastPrinted:this.lastPrinted,created:this.created,modified:this.modified,properties:this.properties,protection:this.protection,worksheets:this.worksheets.map(e=>e.model),sheets:this.worksheets.map(e=>e.model).filter(Boolean),definedNames:this._definedNames.model,views:this.views,company:this.company,manager:this.manager,title:this.title,subject:this.subject,keywords:this.keywords,category:this.category,description:this.description,language:this.language,revision:this.revision,contentStatus:this.contentStatus,themes:this._themes,media:this.media,pivotTables:this.pivotTables,calcProperties:this.calcProperties,passthrough:this._passthrough,rawDrawings:this._rawDrawings,defaultFont:this._defaultFont,externalLinks:this.externalLinks}}set model(e){this.creator=e.creator,this.lastModifiedBy=e.lastModifiedBy,this.lastPrinted=e.lastPrinted,this.created=e.created,this.modified=e.modified,this.company=e.company,this.manager=e.manager,this.title=e.title,this.subject=e.subject,this.keywords=e.keywords,this.category=e.category,this.description=e.description,this.language=e.language,this.revision=e.revision,this.contentStatus=e.contentStatus,this.properties=e.properties,this.protection=e.protection,this.calcProperties=e.calcProperties,this._worksheets=[],this._tableNames.clear(),e.worksheets.forEach(t=>{let{id:n,name:r,state:i}=t,a=e.sheets&&e.sheets.findIndex(e=>e.id===n),o=this._worksheets[n]=new K_({id:n,name:r,orderNo:a===-1?void 0:a,state:i,workbook:this});o.model=t}),this._definedNames.model=e.definedNames,this.views=e.views,this._themes=e.themes,this.media=e.media||[],this.pivotTables=e.pivotTables||e.loadedPivotTables||[],this._passthrough=e.passthrough||{},this._rawDrawings=e.rawDrawings||{},this._defaultFont=e.defaultFont,this.externalLinks=e.externalLinks?[...e.externalLinks]:[],this._writerExternalLinkCache=new Map}};let Cb=function(e){return e[e.Legal=5]=`Legal`,e[e.Executive=7]=`Executive`,e[e.A4=9]=`A4`,e[e.A5=11]=`A5`,e[e.B5=13]=`B5`,e[e.Envelope_10=20]=`Envelope_10`,e[e.Envelope_DL=27]=`Envelope_DL`,e[e.Envelope_C5=28]=`Envelope_C5`,e[e.Envelope_B5=34]=`Envelope_B5`,e[e.Envelope_Monarch=37]=`Envelope_Monarch`,e[e.Double_Japan_Postcard_Rotated=82]=`Double_Japan_Postcard_Rotated`,e[e.K16_197x273_mm=119]=`K16_197x273_mm`,e}({});function wb(e,t){let n=t?.fontSize??48,r=t?.color??{r:128,g:128,b:128},i=Math.max(0,Math.min(100,t?.opacity??40)),a=t?.rotation??-45,o=t?.padding??20,{width:s,height:c,pixels:l}=Db(e,Math.max(1,Math.round(n/Tb))),u=s+o*2,d=c+o*2,f=new Uint8Array(u*d);for(let e=0;e<c;e++)for(let t=0;t<s;t++)f[(e+o)*u+(t+o)]=l[e*s+t];let{width:p,height:m,pixels:h}=Ob(f,u,d,a),g=Math.round(i/100*255),_=new Uint8Array(p*m*4);for(let e=0;e<p*m;e++){let t=h[e];t>0&&(_[e*4]=r.r,_[e*4+1]=r.g,_[e*4+2]=r.b,_[e*4+3]=Math.round(t/255*g))}return kb(_,p,m)}let Tb=8,Eb={32:[0,0,0,0,0,0,0,0],33:[4,4,4,4,4,0,4,0],34:[10,10,10,0,0,0,0,0],35:[10,10,31,10,31,10,10,0],36:[4,15,20,14,5,30,4,0],37:[24,25,2,4,8,19,3,0],38:[12,18,20,8,21,18,13,0],39:[4,4,8,0,0,0,0,0],40:[2,4,8,8,8,4,2,0],41:[8,4,2,2,2,4,8,0],42:[0,4,21,14,21,4,0,0],43:[0,4,4,31,4,4,0,0],44:[0,0,0,0,0,4,4,8],45:[0,0,0,31,0,0,0,0],46:[0,0,0,0,0,0,4,0],47:[0,1,2,4,8,16,0,0],48:[14,17,19,21,25,17,14,0],49:[4,12,4,4,4,4,14,0],50:[14,17,1,2,4,8,31,0],51:[31,2,4,2,1,17,14,0],52:[2,6,10,18,31,2,2,0],53:[31,16,30,1,1,17,14,0],54:[6,8,16,30,17,17,14,0],55:[31,1,2,4,8,8,8,0],56:[14,17,17,14,17,17,14,0],57:[14,17,17,15,1,2,12,0],58:[0,0,4,0,0,4,0,0],59:[0,0,4,0,0,4,4,8],60:[2,4,8,16,8,4,2,0],61:[0,0,31,0,31,0,0,0],62:[8,4,2,1,2,4,8,0],63:[14,17,1,2,4,0,4,0],64:[14,17,23,21,23,16,14,0],65:[14,17,17,31,17,17,17,0],66:[30,17,17,30,17,17,30,0],67:[14,17,16,16,16,17,14,0],68:[28,18,17,17,17,18,28,0],69:[31,16,16,30,16,16,31,0],70:[31,16,16,30,16,16,16,0],71:[14,17,16,23,17,17,15,0],72:[17,17,17,31,17,17,17,0],73:[14,4,4,4,4,4,14,0],74:[7,2,2,2,2,18,12,0],75:[17,18,20,24,20,18,17,0],76:[16,16,16,16,16,16,31,0],77:[17,27,21,21,17,17,17,0],78:[17,25,21,19,17,17,17,0],79:[14,17,17,17,17,17,14,0],80:[30,17,17,30,16,16,16,0],81:[14,17,17,17,21,18,13,0],82:[30,17,17,30,20,18,17,0],83:[15,16,16,14,1,1,30,0],84:[31,4,4,4,4,4,4,0],85:[17,17,17,17,17,17,14,0],86:[17,17,17,17,17,10,4,0],87:[17,17,17,21,21,27,17,0],88:[17,17,10,4,10,17,17,0],89:[17,17,10,4,4,4,4,0],90:[31,1,2,4,8,16,31,0],91:[14,8,8,8,8,8,14,0],92:[0,16,8,4,2,1,0,0],93:[14,2,2,2,2,2,14,0],94:[4,10,17,0,0,0,0,0],95:[0,0,0,0,0,0,31,0],96:[8,4,2,0,0,0,0,0],97:[0,0,14,1,15,17,15,0],98:[16,16,22,25,17,17,30,0],99:[0,0,14,16,16,17,14,0],100:[1,1,13,19,17,17,15,0],101:[0,0,14,17,31,16,14,0],102:[6,9,8,28,8,8,8,0],103:[0,0,15,17,15,1,14,0],104:[16,16,22,25,17,17,17,0],105:[4,0,12,4,4,4,14,0],106:[2,0,6,2,2,18,12,0],107:[16,16,18,20,24,20,18,0],108:[12,4,4,4,4,4,14,0],109:[0,0,26,21,21,17,17,0],110:[0,0,22,25,17,17,17,0],111:[0,0,14,17,17,17,14,0],112:[0,0,30,17,30,16,16,0],113:[0,0,13,19,15,1,1,0],114:[0,0,22,25,16,16,16,0],115:[0,0,14,16,14,1,30,0],116:[8,8,28,8,8,9,6,0],117:[0,0,17,17,17,19,13,0],118:[0,0,17,17,17,10,4,0],119:[0,0,17,17,21,21,10,0],120:[0,0,17,10,4,10,17,0],121:[0,0,17,17,15,1,14,0],122:[0,0,31,2,4,8,31,0],123:[2,4,4,8,4,4,2,0],124:[4,4,4,4,4,4,4,0],125:[8,4,4,2,4,4,8,0],126:[0,0,8,21,2,0,0,0]};function Db(e,t){let n=6*t,r=8*t,i=e.length*n,a=r,o=new Uint8Array(i*a);for(let r=0;r<e.length;r++){let s=Eb[e.charCodeAt(r)]??Eb[63],c=r*n;for(let e=0;e<8;e++){let n=s[e];for(let r=0;r<6;r++)if(n&1<<5-r)for(let n=0;n<t;n++)for(let s=0;s<t;s++){let l=c+r*t+s,u=e*t+n;l<i&&u<a&&(o[u*i+l]=255)}}}return{width:i,height:a,pixels:o}}function Ob(e,t,n,r){if(r===0)return{width:t,height:n,pixels:e};let i=r*Math.PI/180,a=Math.cos(i),o=Math.sin(i),s=[{x:0,y:0},{x:t,y:0},{x:t,y:n},{x:0,y:n}],c=1/0,l=1/0,u=-1/0,d=-1/0;for(let e of s){let t=e.x*a-e.y*o,n=e.x*o+e.y*a;c=Math.min(c,t),l=Math.min(l,n),u=Math.max(u,t),d=Math.max(d,n)}let f=Math.ceil(u-c),p=Math.ceil(d-l),m=new Uint8Array(f*p),h=a,g=-o;for(let r=0;r<p;r++)for(let i=0;i<f;i++){let a=i+c,o=r+l,s=Math.round(a*h-o*g),u=Math.round(a*g+o*h);s>=0&&s<t&&u>=0&&u<n&&(m[r*f+i]=e[u*t+s])}return{width:f,height:p,pixels:m}}function kb(e,t,n){let r=1+t*4,i=new Uint8Array(r*n);for(let a=0;a<n;a++)i[a*r]=0,i.set(e.subarray(a*t*4,(a+1)*t*4),a*r+1);let a=Mb(i),o=new Uint8Array([137,80,78,71,13,10,26,10]),s=new Uint8Array(13);jb(s,0,t),jb(s,4,n),s[8]=8,s[9]=6,s[10]=0,s[11]=0,s[12]=0;let c=Ab(1229472850,s),l=Ab(1229209940,a),u=Ab(1229278788,new Uint8Array),d=new Uint8Array(o.length+c.length+l.length+u.length),f=0;return d.set(o,f),f+=o.length,d.set(c,f),f+=c.length,d.set(l,f),f+=l.length,d.set(u,f),d}function Ab(e,t){let n=new Uint8Array(12+t.length);jb(n,0,t.length),jb(n,4,e),n.set(t,8);let r=Fb(n.subarray(4,8+t.length));return jb(n,8+t.length,r),n}function jb(e,t,n){e[t]=n>>>24&255,e[t+1]=n>>>16&255,e[t+2]=n>>>8&255,e[t+3]=n&255}function Mb(e){let t=Fi(e,6),n=Nb(e),r=new Uint8Array(2+t.length+4);return r[0]=120,r[1]=1,r.set(t,2),jb(r,2+t.length,n),r}function Nb(e){let t=1,n=0;for(let r=0;r<e.length;r++)t=(t+e[r])%65521,n=(n+t)%65521;return n<<16|t}let Pb=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e})();function Fb(e){let t=4294967295;for(let n=0;n<e.length;n++)t=Pb[(t^e[n])&255]^t>>>8;return(t^4294967295)>>>0}function Ib(e){return Vb(e)?`(${e.replace(/\\/g,`\\\\`).replace(/\(/g,`\\(`).replace(/\)/g,`\\)`).replace(/\r\n/g,`\\n`).replace(/\r/g,`\\n`).replace(/\n/g,`\\n`)})`:Lb(Hb(e))}function Lb(e){let t=`<`;for(let n=0;n<e.length;n++)t+=e[n].toString(16).padStart(2,`0`);return t+`>`}function Rb(e){let t=`/`;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r<33||r>126||r===35||r===40||r===41||r===60||r===62||r===91||r===93||r===123||r===125||r===47?t+=`#`+r.toString(16).padStart(2,`0`):t+=e[n]}return t}function X(e){return Number.isFinite(e)?Number.isInteger(e)?e.toString():(Math.round(e*1e4)/1e4).toString():`0`}function zb(e){return`[`+e.join(` `)+`]`}function Z(e,t=0){return`${e} ${t} R`}function Bb(e){return`(D:${e.getUTCFullYear().toString().padStart(4,`0`)}${(e.getUTCMonth()+1).toString().padStart(2,`0`)}${e.getUTCDate().toString().padStart(2,`0`)}${e.getUTCHours().toString().padStart(2,`0`)}${e.getUTCMinutes().toString().padStart(2,`0`)}${e.getUTCSeconds().toString().padStart(2,`0`)}Z)`}function Vb(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127)return!1;return!0}function Hb(e){let t=new Uint8Array(2+e.length*2);t[0]=254,t[1]=255;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[2+n*2]=r>>8&255,t[3+n*2]=r&255}return t}var Q=class e{constructor(){this.entries=[],this._raw=null}static fromRawString(t){let n=new e;return n._raw=t,n}set(e,t){if(this._raw!==null){let n=RegExp(`(/${e})\\s+\\S+(?:\\s+\\d+\\s+R)?`);return n.test(this._raw)?this._raw=this._raw.replace(n,`/${e} ${t}`):this._raw=this._raw.replace(/>>$/,`\n${Rb(e)} ${t}\n>>`),this}let n=this.entries.findIndex(([t])=>t===e);return n>=0?this.entries[n]=[e,t]:this.entries.push([e,t]),this}setIf(e,t,n){return e&&this.set(t,n),this}delete(e){let t=this.entries.findIndex(([t])=>t===e);return t>=0&&this.entries.splice(t,1),this}toString(){if(this._raw!==null)return this._raw;let e=[`<<`];for(let[t,n]of this.entries)e.push(`${Rb(t)} ${n}`);return e.push(`>>`),e.join(`
|
|
433
|
-
`)}};let
|
|
434
|
-
`)}toUint8Array(){return new TextEncoder().encode(this.toString())}};function
|
|
431
|
+
`),v}var pb=class extends n{constructor(...e){super(...e),this.name=`MarkdownError`}},mb=class extends pb{constructor(e,t,n){super(`Line ${t}: ${e}`,n),this.name=`MarkdownParseError`,this.line=t}};function hb(e){return{trim:e.trim!==!1,unescape:e.unescape!==!1,skipEmpty:e.skipEmptyRows!==!1,maxRows:e.maxRows,convertBr:e.convertBr===!0}}function gb(e){let t=[],n=e.length,r=+(n>0&&e.charCodeAt(0)===124),i=n;if(n>1&&e.charCodeAt(n-1)===124){let t=0,r=n-2;for(;r>=0&&e.charCodeAt(r)===92;)t++,r--;t%2==0&&(i=n-1)}let a=r,o=``,s=!1;for(;r<i;){let n=e.charCodeAt(r);n===92&&r+1<i?(s=!0,r>a&&(o+=e.slice(a,r)),o+=e.slice(r,r+2),r+=2,a=r):n===124?(s?(r>a&&(o+=e.slice(a,r)),t.push(o),o=``,s=!1):t.push(e.slice(a,r)),r++,a=r):r++}return s?(i>a&&(o+=e.slice(a,i)),t.push(o)):t.push(e.slice(a,i)),t}function _b(e){let t=e.trim(),n=t.length;if(n===0)return`none`;let r=t.charCodeAt(0)===58,i=t.charCodeAt(n-1)===58;return r&&i?`center`:r?`left`:i?`right`:`none`}function vb(e){let t=e.length,n=0;for(;n<t;){let t=e.charCodeAt(n);if(t!==32&&t!==9)break;n++}n<t&&e.charCodeAt(n)===58&&n++;let r=n;for(;n<t&&e.charCodeAt(n)===45;)n++;if(n===r)return!1;for(n<t&&e.charCodeAt(n)===58&&n++;n<t;){let t=e.charCodeAt(n);if(t!==32&&t!==9)return!1;n++}return!0}function yb(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++)if(!vb(e[t]))return!1;return!0}function bb(e,t){let n=t.trim?e.trim():e;return t.unescape&&(n=n.replace(nb,`$1`)),t.convertBr&&(n=n.replace(rb,`
|
|
432
|
+
`)),n}function xb(e,t,n){let r=Array(t);for(let i=0;i<t;i++)r[i]=i<e.length?bb(e[i],n):``;return r}function Sb(e){for(let t=0;t<e.length;t++)if(e[t]!==``)return!1;return!0}function Cb(e){return e.indexOf(`|`)!==-1}function wb(e){let t=e.length,n=0;for(;n<t;){let t=e.charCodeAt(n);if(t!==32&&t!==9)return t===124;n++}return!1}function Tb(e){return e.indexOf(`-`)!==-1}function Eb(e,t,n,r){if(t>=n-1)return null;let i=e[t].trim();if(i===``||!Cb(i))return null;let a=gb(i);if(a.length<1)return null;let o=e[t+1].trim();if(o===``||!Tb(o))return null;let s=gb(o);if(!yb(s))return null;let c=a.length,l=Array(c),u=Array(c);for(let e=0;e<c;e++)l[e]=bb(a[e],r),u[e]=e<s.length?_b(s[e]):`none`;let d=wb(i),f=[],p=t+2;for(;p<n;p++){let t=e[p].trim();if(t===``||!Cb(t)||d&&!wb(t))break;if(r.maxRows!==void 0&&f.length>=r.maxRows){for(;p<n;){let t=e[p].trim();if(t===``||!Cb(t)||d&&!wb(t))break;p++}break}let i=xb(gb(t),c,r);r.skipEmpty&&Sb(i)||f.push(i)}return{result:{headers:l,rows:f,alignments:u},endLine:p}}function Db(e,t={}){let n=hb(t),r=e.split(eb),i=r.length;for(let e=0;e<i-1;e++){let t=Eb(r,e,i,n);if(t)return t.result}throw new mb(`No valid Markdown table found in input`,i>0?i:1)}function Ob(e,t={}){let n=hb(t),r=e.split(eb),i=r.length,a=[],o=0;for(;o<i-1;){let e=Eb(r,o,i,n);e?(a.push(e.result),o=e.endLine):o++}return a}let kb=[`YYYY-MM-DD[T]HH:mm:ssZ`,`YYYY-MM-DD[T]HH:mm:ss`,`MM-DD-YYYY`,`YYYY-MM-DD`],Ab={true:!0,false:!1,"#N/A":{error:`#N/A`},"#REF!":{error:`#REF!`},"#NAME?":{error:`#NAME?`},"#DIV/0!":{error:`#DIV/0!`},"#NULL!":{error:`#NULL!`},"#VALUE!":{error:`#VALUE!`},"#NUM!":{error:`#NUM!`}};function jb(e,t){let n=et.create(e),r=t?.decimalSeparator??`.`;return function(e){if(e===``)return null;if(typeof e==`string`){let t=oe(e,r);if(!Number.isNaN(t)&&t!==1/0)return t}else{let t=Number(e);if(!Number.isNaN(t)&&t!==1/0)return t}if(typeof e==`string`){let t=n.parse(e);if(t)return t;let r=Ab[e];if(r!==void 0)return r}return e}}function Mb(e,t){let n=e?nt.create(e,{utc:t}):nt.iso(t);return function(e){if(e==null)return e;if(e instanceof Date)return n.format(e);if(typeof e!=`object`)return e;let t=e;if(typeof t.hyperlink==`string`||typeof t.text==`string`){let e=typeof t.hyperlink==`string`?t.hyperlink:``,n=typeof t.text==`string`?t.text:``;return e||n||``}return`formula`in e||`sharedFormula`in e?e.result??``:`richText`in e&&Array.isArray(e.richText)?e.richText.map(e=>e.text).join(``):`checkbox`in e&&typeof e.checkbox==`boolean`?e.checkbox:`error`in e&&typeof e.error==`string`?e.error:JSON.stringify(e)}}function Nb(e,t){let n=e?nt.create(e,{utc:t}):nt.iso(t);return function(e){if(e==null)return``;if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`bigint`)return String(e);if(typeof e==`boolean`)return e?`true`:`false`;if(e instanceof Date)return n.format(e);if(typeof e==`object`){let t=e;if(t.text||t.hyperlink)return t.hyperlink||t.text||``;if(t.formula||t.result)return t.result==null?``:String(t.result);if(t.richText&&Array.isArray(t.richText))return t.richText.map(e=>e.text).join(``);if(t.error)return t.error;try{return JSON.stringify(e)}catch{return`[object Object]`}}return String(e)}}function Pb(e){return typeof e==`string`&&/^https?:\/\//i.test(e)}function Fb(e){return typeof File<`u`&&e instanceof File}function Ib(e){return typeof Blob<`u`&&e instanceof Blob&&!Fb(e)}function Lb(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t[Symbol.asyncIterator]==`function`||typeof t.pipe==`function`&&typeof t.on==`function`}function Rb(e){return{delimiter:e?.delimiter??`,`,quote:e?.quote,escape:e?.escape,delimitersToGuess:e?.delimitersToGuess,lineEnding:e?.lineEnding,headers:e?.headers,skipEmptyLines:e?.skipEmptyLines,trim:e?.trim,ltrim:e?.ltrim,rtrim:e?.rtrim,comment:e?.comment,maxRows:e?.maxRows,toLine:e?.toLine,skipLines:e?.skipLines,skipRows:e?.skipRows,columnMismatch:e?.columnMismatch,groupColumnsByName:e?.groupColumnsByName,relaxQuotes:e?.relaxQuotes,fastMode:e?.fastMode,info:e?.info,raw:e?.raw,skipRecordsWithError:e?.skipRecordsWithError,skipRecordsWithEmptyValues:e?.skipRecordsWithEmptyValues,onSkip:e?.onSkip}}function zb(e){return{delimiter:e?.delimiter??`,`,quote:e?.quote,escape:e?.escape,lineEnding:e?.lineEnding,quoteColumns:e?.quoteColumns,quoteHeaders:e?.quoteHeaders,decimalSeparator:e?.decimalSeparator??`.`,escapeFormulae:e?.escapeFormulae??!0,writeHeaders:e?.writeHeaders}}var Bb=class{static{this.Writer=Ng}static{this.Reader=Af}constructor(e){this._tableNames=new Set,this.category=``,this.company=``,this.created=new Date,this.description=``,this.keywords=``,this.manager=``,this.modified=this.created,this.properties={},this.calcProperties={},this._worksheets=[],this.subject=``,this.title=``,this.views=[],this.media=[],this.pivotTables=[],this.externalLinks=[],this._passthrough={},this._rawDrawings={},this._writerExternalLinkCache=new Map,this._definedNames=new ii(e?.formulaSyntaxProbe)}get defaultFont(){return this._defaultFont}set defaultFont(e){this._defaultFont=e}importSheet(e,t){let n=this.addWorksheet(t??e.name);return n.model={...e.model,id:n.id,name:n.name},n}async protect(e,t){this.protection=await Zh(e,t)}unprotect(){this.protection=void 0}get xlsx(){return this._xlsx||=new Qy(this),this._xlsx}async readCsv(e,t){return Pb(e)?this._readCsvUrl(e,t):Fb(e)?this._readCsvFile(e,t):Ib(e)?this._readCsvBlob(e,t):Lb(e)?this._readCsvStream(e,t):this._readCsvContent(e,t)}writeCsv(e,t){return e&&typeof e.write==`function`?this._writeCsvStream(e,t):this._writeCsvString(e)}async writeCsvBuffer(e){let t=this._writeCsvString(e);return new TextEncoder().encode(t)}async readCsvFile(e,t){throw new Ir(`readCsvFile()`,`not available in browser. Use readCsv(url) or readCsv(file) instead.`)}async writeCsvFile(e,t){throw new Ir(`writeCsvFile()`,`not available in browser. Use writeCsv() and trigger a download instead.`)}createCsvReadStream(e){let t=this.getWorksheet(e?.sheetName||e?.sheetId),n=e?.map||Mb(e?.dateFormat,e?.dateUTC),r=e?.includeEmptyRows!==!1,i=new Tr(zb(e));return setTimeout(t?()=>{let e=1;t.eachRow((t,a)=>{if(r)for(;e++<a-1;)i.write([]);let{values:o}=t;o.shift(),i.write(o.map(n)),e=a}),i.end()}:()=>i.end(),0),i}createCsvWriteStream(e){let t=this.addWorksheet(e?.sheetName),n=e?.dateFormats??kb,r=e?.decimalSeparator,i=e?.map||jb(n,{decimalSeparator:r}),a=new Cr(Rb(e)),o=!!e?.headers,s=null;return o&&a.on(`headers`,e=>{s=e,t.addRow(e)}),a.on(`data`,e=>{if(o&&s&&e&&typeof e==`object`&&!Array.isArray(e)){let n=e,r=s.map(e=>n[e]);t.addRow(r.map(i))}else Array.isArray(e)&&t.addRow(e.map(i))}),a}_readCsvContent(e,t){let n;n=typeof e==`string`?e:e instanceof ArrayBuffer||e instanceof Uint8Array?new TextDecoder().decode(e):String(e);let r=this.addWorksheet(t?.sheetName),i=t?.dateFormats??kb,a=t?.decimalSeparator,o=t?.map||jb(i,{decimalSeparator:a}),s=nn(n,Rb(t));if(Array.isArray(s))for(let e of s)r.addRow(e.map(o));else{s.headers&&r.addRow(s.headers);for(let e of s.rows){let t=s.headers.map(t=>e[t]);r.addRow(t.map(o))}}return r}async _readCsvStream(e,t){let n=this.addWorksheet(t?.sheetName),r=t?.dateFormats??kb,i=t?.decimalSeparator,a=t?.map||jb(r,{decimalSeparator:i}),o=new Cr(Rb(t)),s=!!t?.headers,c=null;return new Promise((t,r)=>{s&&o.on(`headers`,e=>{c=e,n.addRow(e)}),o.on(`data`,e=>{if(s&&c&&e&&typeof e==`object`&&!Array.isArray(e)){let t=e,r=c.map(e=>t[e]);n.addRow(r.map(a))}else Array.isArray(e)&&n.addRow(e.map(a))}),yr(e,o).then(()=>t(n)).catch(r)})}async _readCsvUrl(e,t){let n={method:t?.requestBody?`POST`:`GET`,headers:t?.requestHeaders,body:t?.requestBody,credentials:t?.withCredentials?`include`:`same-origin`,signal:t?.signal},r=await fetch(e,n);if(!r.ok)throw new zr(e,r.status,r.statusText);if(t?.stream&&r.body){let e=On(r.body);return this._readCsvStream(e,t)}let i=await r.text();return this._readCsvContent(i,t)}async _readCsvFile(e,t){if((t?.stream||e.size>10*1024*1024)&&typeof e.stream==`function`){let n=On(e.stream());return this._readCsvStream(n,t)}return new Promise((n,r)=>{let i=new FileReader,a=t?.encoding??`UTF-8`;t?.onProgress&&(i.onprogress=n=>{t.onProgress(n.loaded,n.total||e.size)}),i.onload=e=>{try{let r=e.target?.result;n(this._readCsvContent(r,t))}catch(e){r(e)}},i.onerror=()=>r(Error(`Failed to read file: ${e.name}`)),i.readAsText(e,a)})}async _readCsvBlob(e,t){let n=await e.text();return this._readCsvContent(n,t)}_writeCsvString(e){let t=this.getWorksheet(e?.sheetName||e?.sheetId);if(!t)return``;let n=e?.map||Mb(e?.dateFormat,e?.dateUTC),r=e?.includeEmptyRows!==!1,i=[],a=1;return t.eachRow((e,t)=>{if(r)for(;a++<t-1;)i.push([]);let{values:o}=e;o.shift(),i.push(o.map(n)),a=t}),Ae(i,zb(e))}async _writeCsvStream(e,t){let n=this.getWorksheet(t?.sheetName||t?.sheetId);if(!n){e.end();return}let r=t?.map||Mb(t?.dateFormat,t?.dateUTC),i=t?.includeEmptyRows!==!1,a=new Tr(zb(t)),o=yr(a,e),s=1;n.eachRow((e,t)=>{if(i)for(;s++<t-1;)a.write([]);let{values:n}=e;n.shift(),a.write(n.map(r)),s=t}),a.end(),await o}_populateMarkdownWorksheet(e,t,n){e.addRow(t.headers),e._markdownAlignments=t.alignments;for(let r of t.rows)n?e.addRow(r.map((e,t)=>n(e,t))):e.addRow(r)}readMarkdown(e,t){let n=Db(e,{trim:t?.trim,unescape:t?.unescape,skipEmptyRows:t?.skipEmptyRows,maxRows:t?.maxRows,convertBr:t?.convertBr}),r=this.addWorksheet(t?.sheetName);return this._populateMarkdownWorksheet(r,n,t?.map),r}readMarkdownAll(e,t){let n=Ob(e,{trim:t?.trim,unescape:t?.unescape,skipEmptyRows:t?.skipEmptyRows,maxRows:t?.maxRows,convertBr:t?.convertBr}),r=t?.sheetName,i=t?.map,a=[];for(let e=0;e<n.length;e++){let t=r?e===0?r:`${r}_${e+1}`:void 0,o=this.addWorksheet(t);this._populateMarkdownWorksheet(o,n[e],i),a.push(o)}return a}writeMarkdown(e){let t=this.getWorksheet(e?.sheetName||e?.sheetId);if(!t)return``;let n=e?.dateFormat,r=e?.dateUTC,i=e?.includeEmptyRows!==!1,a=e?.stringify??Nb(n,r),o=[],s=1;if(t.eachRow((e,t)=>{if(i)for(;s++<t-1;)o.push([]);let n=Array.from(e.values).slice(1);o.push(n),s=t}),o.length===0)return``;let c=o[0].map(e=>a(e)),l=o.slice(1),u=t._markdownAlignments,d=e?.columns,f;return!d&&u&&(f=c.map((e,t)=>({header:e,alignment:t<u.length?u[t]:void 0}))),fb(c,l,{columns:f??d,alignment:e?.alignment,padding:e?.padding,trailingNewline:e?.trailingNewline,escapeContent:e?.escapeContent,stringify:a})}writeMarkdownBuffer(e){let t=this.writeMarkdown(e);return new TextEncoder().encode(t)}async readMarkdownFile(e,t){throw new Ir(`readMarkdownFile()`,`not available in browser. Use readMarkdown(string) instead.`)}async readMarkdownAllFile(e,t){throw new Ir(`readMarkdownAllFile()`,`not available in browser. Use readMarkdownAll(string) instead.`)}async writeMarkdownFile(e,t){throw new Ir(`writeMarkdownFile()`,`not available in browser. Use writeMarkdown() and trigger a download instead.`)}static createStreamWriter(e){return new Ng(e)}static createStreamReader(e,t){return new Af(e,t)}get nextId(){for(let e=1;e<this._worksheets.length;e++)if(!this._worksheets[e])return e;return this._worksheets.length||1}addWorksheet(e,t){let n=this.nextId,r=this._worksheets.reduce((e,t)=>(t&&t.orderNo)>e?t.orderNo:e,0),i=new uv({...t,id:n,name:e,orderNo:r+1,workbook:this});return this._worksheets[n]=i,i}removeWorksheetEx(e){this._worksheets[e.id]=void 0}removeWorksheet(e){let t=this.getWorksheet(e);t&&t.destroy()}getWorksheet(e){if(e===void 0)return this._worksheets.find(Boolean);if(typeof e==`number`)return this._worksheets[e];if(typeof e==`string`){let t=e.toLowerCase();return this._worksheets.find(e=>e&&e.name.toLowerCase()===t)}}get worksheets(){return this._worksheets.slice(1).sort((e,t)=>e.orderNo-t.orderNo).filter(Boolean)}eachSheet(e){this.worksheets.forEach(t=>{e(t,t.id)})}get definedNames(){return this._definedNames}calculateFormulas(){$y(this)}registerFunction(e,t,n){this.userFunctions||=new Map,this.userFunctions.set(e.toUpperCase(),{minArity:n?.minArity??0,maxArity:n?.maxArity??255,invoke:t,volatile:n?.volatile??!1})}unregisterFunction(e){return this.userFunctions?.delete(e.toUpperCase())??!1}clearThemes(){this._themes=void 0}addImage(e){let t=this.media.length;return this.media.push({...e,type:`image`}),t}getImage(e){return this.media[Number(e)]}addExternalLink(e){let t={index:this.externalLinks.length+1,target:e.target,targetMode:e.targetMode??`External`,sheetNames:e.sheetNames?[...e.sheetNames]:[],cachedValues:e.cachedValues?{...e.cachedValues}:{}};return this.externalLinks.push(t),t}getExternalLink(e){if(typeof e==`number`)return this.externalLinks[e-1];let t=e.toLowerCase();return this.externalLinks.find(e=>e.target.toLowerCase()===t)}_collectExternalLinksForWrite(){let e=new Set(this.externalLinks.map(e=>e.target.toLowerCase())),t=this.externalLinks.map((e,t)=>({...e,index:t+1,sheetNames:[...e.sheetNames??[]],cachedValues:{...e.cachedValues??{}},targetMode:e.targetMode??`External`}));for(let n of this._writerExternalLinkCache.values())e.has(n.target.toLowerCase())||t.push({...n,index:t.length+1,sheetNames:[...n.sheetNames],cachedValues:{...n.cachedValues}});return t}_recordAutoExternalLink(e,t){let n=e.toLowerCase(),r=this.externalLinks.findIndex(e=>e.target.toLowerCase()===n);if(r!==-1)return r+1;let i=this._writerExternalLinkCache.get(n);i||(i={index:0,target:e,targetMode:`External`,sheetNames:[],cachedValues:{}},this._writerExternalLinkCache.set(n,i)),t&&!i.sheetNames.includes(t)&&i.sheetNames.push(t);let a=this.externalLinks.length,o=0;for(let e of this._writerExternalLinkCache.keys())if(o++,e===n)return a+o;return a+this._writerExternalLinkCache.size}get model(){return{creator:this.creator||`Unknown`,lastModifiedBy:this.lastModifiedBy||`Unknown`,lastPrinted:this.lastPrinted,created:this.created,modified:this.modified,properties:this.properties,protection:this.protection,worksheets:this.worksheets.map(e=>e.model),sheets:this.worksheets.map(e=>e.model).filter(Boolean),definedNames:this._definedNames.model,views:this.views,company:this.company,manager:this.manager,title:this.title,subject:this.subject,keywords:this.keywords,category:this.category,description:this.description,language:this.language,revision:this.revision,contentStatus:this.contentStatus,themes:this._themes,media:this.media,pivotTables:this.pivotTables,calcProperties:this.calcProperties,passthrough:this._passthrough,rawDrawings:this._rawDrawings,defaultFont:this._defaultFont,externalLinks:this.externalLinks}}set model(e){this.creator=e.creator,this.lastModifiedBy=e.lastModifiedBy,this.lastPrinted=e.lastPrinted,this.created=e.created,this.modified=e.modified,this.company=e.company,this.manager=e.manager,this.title=e.title,this.subject=e.subject,this.keywords=e.keywords,this.category=e.category,this.description=e.description,this.language=e.language,this.revision=e.revision,this.contentStatus=e.contentStatus,this.properties=e.properties,this.protection=e.protection,this.calcProperties=e.calcProperties,this._worksheets=[],this._tableNames.clear(),e.worksheets.forEach(t=>{let{id:n,name:r,state:i}=t,a=e.sheets&&e.sheets.findIndex(e=>e.id===n),o=this._worksheets[n]=new uv({id:n,name:r,orderNo:a===-1?void 0:a,state:i,workbook:this});o.model=t}),this._definedNames.model=e.definedNames,this.views=e.views,this._themes=e.themes,this.media=e.media||[],this.pivotTables=e.pivotTables||e.loadedPivotTables||[],this._passthrough=e.passthrough||{},this._rawDrawings=e.rawDrawings||{},this._defaultFont=e.defaultFont,this.externalLinks=e.externalLinks?[...e.externalLinks]:[],this._writerExternalLinkCache=new Map}};let Vb=function(e){return e[e.Legal=5]=`Legal`,e[e.Executive=7]=`Executive`,e[e.A4=9]=`A4`,e[e.A5=11]=`A5`,e[e.B5=13]=`B5`,e[e.Envelope_10=20]=`Envelope_10`,e[e.Envelope_DL=27]=`Envelope_DL`,e[e.Envelope_C5=28]=`Envelope_C5`,e[e.Envelope_B5=34]=`Envelope_B5`,e[e.Envelope_Monarch=37]=`Envelope_Monarch`,e[e.Double_Japan_Postcard_Rotated=82]=`Double_Japan_Postcard_Rotated`,e[e.K16_197x273_mm=119]=`K16_197x273_mm`,e}({});function Hb(e,t){let n=t?.fontSize??48,r=t?.color??{r:128,g:128,b:128},i=Math.max(0,Math.min(100,t?.opacity??40)),a=t?.rotation??-45,o=t?.padding??20,{width:s,height:c,pixels:l}=Gb(e,Math.max(1,Math.round(n/Ub))),u=s+o*2,d=c+o*2,f=new Uint8Array(u*d);for(let e=0;e<c;e++)for(let t=0;t<s;t++)f[(e+o)*u+(t+o)]=l[e*s+t];let{width:p,height:m,pixels:h}=Kb(f,u,d,a),g=Math.round(i/100*255),_=new Uint8Array(p*m*4);for(let e=0;e<p*m;e++){let t=h[e];t>0&&(_[e*4]=r.r,_[e*4+1]=r.g,_[e*4+2]=r.b,_[e*4+3]=Math.round(t/255*g))}return qb(_,p,m)}let Ub=8,Wb={32:[0,0,0,0,0,0,0,0],33:[4,4,4,4,4,0,4,0],34:[10,10,10,0,0,0,0,0],35:[10,10,31,10,31,10,10,0],36:[4,15,20,14,5,30,4,0],37:[24,25,2,4,8,19,3,0],38:[12,18,20,8,21,18,13,0],39:[4,4,8,0,0,0,0,0],40:[2,4,8,8,8,4,2,0],41:[8,4,2,2,2,4,8,0],42:[0,4,21,14,21,4,0,0],43:[0,4,4,31,4,4,0,0],44:[0,0,0,0,0,4,4,8],45:[0,0,0,31,0,0,0,0],46:[0,0,0,0,0,0,4,0],47:[0,1,2,4,8,16,0,0],48:[14,17,19,21,25,17,14,0],49:[4,12,4,4,4,4,14,0],50:[14,17,1,2,4,8,31,0],51:[31,2,4,2,1,17,14,0],52:[2,6,10,18,31,2,2,0],53:[31,16,30,1,1,17,14,0],54:[6,8,16,30,17,17,14,0],55:[31,1,2,4,8,8,8,0],56:[14,17,17,14,17,17,14,0],57:[14,17,17,15,1,2,12,0],58:[0,0,4,0,0,4,0,0],59:[0,0,4,0,0,4,4,8],60:[2,4,8,16,8,4,2,0],61:[0,0,31,0,31,0,0,0],62:[8,4,2,1,2,4,8,0],63:[14,17,1,2,4,0,4,0],64:[14,17,23,21,23,16,14,0],65:[14,17,17,31,17,17,17,0],66:[30,17,17,30,17,17,30,0],67:[14,17,16,16,16,17,14,0],68:[28,18,17,17,17,18,28,0],69:[31,16,16,30,16,16,31,0],70:[31,16,16,30,16,16,16,0],71:[14,17,16,23,17,17,15,0],72:[17,17,17,31,17,17,17,0],73:[14,4,4,4,4,4,14,0],74:[7,2,2,2,2,18,12,0],75:[17,18,20,24,20,18,17,0],76:[16,16,16,16,16,16,31,0],77:[17,27,21,21,17,17,17,0],78:[17,25,21,19,17,17,17,0],79:[14,17,17,17,17,17,14,0],80:[30,17,17,30,16,16,16,0],81:[14,17,17,17,21,18,13,0],82:[30,17,17,30,20,18,17,0],83:[15,16,16,14,1,1,30,0],84:[31,4,4,4,4,4,4,0],85:[17,17,17,17,17,17,14,0],86:[17,17,17,17,17,10,4,0],87:[17,17,17,21,21,27,17,0],88:[17,17,10,4,10,17,17,0],89:[17,17,10,4,4,4,4,0],90:[31,1,2,4,8,16,31,0],91:[14,8,8,8,8,8,14,0],92:[0,16,8,4,2,1,0,0],93:[14,2,2,2,2,2,14,0],94:[4,10,17,0,0,0,0,0],95:[0,0,0,0,0,0,31,0],96:[8,4,2,0,0,0,0,0],97:[0,0,14,1,15,17,15,0],98:[16,16,22,25,17,17,30,0],99:[0,0,14,16,16,17,14,0],100:[1,1,13,19,17,17,15,0],101:[0,0,14,17,31,16,14,0],102:[6,9,8,28,8,8,8,0],103:[0,0,15,17,15,1,14,0],104:[16,16,22,25,17,17,17,0],105:[4,0,12,4,4,4,14,0],106:[2,0,6,2,2,18,12,0],107:[16,16,18,20,24,20,18,0],108:[12,4,4,4,4,4,14,0],109:[0,0,26,21,21,17,17,0],110:[0,0,22,25,17,17,17,0],111:[0,0,14,17,17,17,14,0],112:[0,0,30,17,30,16,16,0],113:[0,0,13,19,15,1,1,0],114:[0,0,22,25,16,16,16,0],115:[0,0,14,16,14,1,30,0],116:[8,8,28,8,8,9,6,0],117:[0,0,17,17,17,19,13,0],118:[0,0,17,17,17,10,4,0],119:[0,0,17,17,21,21,10,0],120:[0,0,17,10,4,10,17,0],121:[0,0,17,17,15,1,14,0],122:[0,0,31,2,4,8,31,0],123:[2,4,4,8,4,4,2,0],124:[4,4,4,4,4,4,4,0],125:[8,4,4,2,4,4,8,0],126:[0,0,8,21,2,0,0,0]};function Gb(e,t){let n=6*t,r=8*t,i=e.length*n,a=r,o=new Uint8Array(i*a);for(let r=0;r<e.length;r++){let s=Wb[e.charCodeAt(r)]??Wb[63],c=r*n;for(let e=0;e<8;e++){let n=s[e];for(let r=0;r<6;r++)if(n&1<<5-r)for(let n=0;n<t;n++)for(let s=0;s<t;s++){let l=c+r*t+s,u=e*t+n;l<i&&u<a&&(o[u*i+l]=255)}}}return{width:i,height:a,pixels:o}}function Kb(e,t,n,r){if(r===0)return{width:t,height:n,pixels:e};let i=r*Math.PI/180,a=Math.cos(i),o=Math.sin(i),s=[{x:0,y:0},{x:t,y:0},{x:t,y:n},{x:0,y:n}],c=1/0,l=1/0,u=-1/0,d=-1/0;for(let e of s){let t=e.x*a-e.y*o,n=e.x*o+e.y*a;c=Math.min(c,t),l=Math.min(l,n),u=Math.max(u,t),d=Math.max(d,n)}let f=Math.ceil(u-c),p=Math.ceil(d-l),m=new Uint8Array(f*p),h=a,g=-o;for(let r=0;r<p;r++)for(let i=0;i<f;i++){let a=i+c,o=r+l,s=Math.round(a*h-o*g),u=Math.round(a*g+o*h);s>=0&&s<t&&u>=0&&u<n&&(m[r*f+i]=e[u*t+s])}return{width:f,height:p,pixels:m}}function qb(e,t,n){let r=1+t*4,i=new Uint8Array(r*n);for(let a=0;a<n;a++)i[a*r]=0,i.set(e.subarray(a*t*4,(a+1)*t*4),a*r+1);let a=Xb(i),o=new Uint8Array([137,80,78,71,13,10,26,10]),s=new Uint8Array(13);Yb(s,0,t),Yb(s,4,n),s[8]=8,s[9]=6,s[10]=0,s[11]=0,s[12]=0;let c=Jb(1229472850,s),l=Jb(1229209940,a),u=Jb(1229278788,new Uint8Array),d=new Uint8Array(o.length+c.length+l.length+u.length),f=0;return d.set(o,f),f+=o.length,d.set(c,f),f+=c.length,d.set(l,f),f+=l.length,d.set(u,f),d}function Jb(e,t){let n=new Uint8Array(12+t.length);Yb(n,0,t.length),Yb(n,4,e),n.set(t,8);let r=$b(n.subarray(4,8+t.length));return Yb(n,8+t.length,r),n}function Yb(e,t,n){e[t]=n>>>24&255,e[t+1]=n>>>16&255,e[t+2]=n>>>8&255,e[t+3]=n&255}function Xb(e){let t=Vi(e,6),n=Zb(e),r=new Uint8Array(2+t.length+4);return r[0]=120,r[1]=1,r.set(t,2),Yb(r,2+t.length,n),r}function Zb(e){let t=1,n=0;for(let r=0;r<e.length;r++)t=(t+e[r])%65521,n=(n+t)%65521;return n<<16|t}let Qb=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e})();function $b(e){let t=4294967295;for(let n=0;n<e.length;n++)t=Qb[(t^e[n])&255]^t>>>8;return(t^4294967295)>>>0}function ex(e){return ax(e)?`(${e.replace(/\\/g,`\\\\`).replace(/\(/g,`\\(`).replace(/\)/g,`\\)`).replace(/\r\n/g,`\\n`).replace(/\r/g,`\\n`).replace(/\n/g,`\\n`)})`:tx(ox(e))}function tx(e){let t=`<`;for(let n=0;n<e.length;n++)t+=e[n].toString(16).padStart(2,`0`);return t+`>`}function nx(e){let t=`/`;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r<33||r>126||r===35||r===40||r===41||r===60||r===62||r===91||r===93||r===123||r===125||r===47?t+=`#`+r.toString(16).padStart(2,`0`):t+=e[n]}return t}function I(e){return Number.isFinite(e)?Number.isInteger(e)?e.toString():(Math.round(e*1e4)/1e4).toString():`0`}function rx(e){return`[`+e.join(` `)+`]`}function L(e,t=0){return`${e} ${t} R`}function ix(e){return`(D:${e.getUTCFullYear().toString().padStart(4,`0`)}${(e.getUTCMonth()+1).toString().padStart(2,`0`)}${e.getUTCDate().toString().padStart(2,`0`)}${e.getUTCHours().toString().padStart(2,`0`)}${e.getUTCMinutes().toString().padStart(2,`0`)}${e.getUTCSeconds().toString().padStart(2,`0`)}Z)`}function ax(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127)return!1;return!0}function ox(e){let t=new Uint8Array(2+e.length*2);t[0]=254,t[1]=255;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[2+n*2]=r>>8&255,t[3+n*2]=r&255}return t}var R=class e{constructor(){this.entries=[],this._raw=null}static fromRawString(t){let n=new e;return n._raw=t,n}set(e,t){if(this._raw!==null){let n=RegExp(`(/${e})\\s+\\S+(?:\\s+\\d+\\s+R)?`);return n.test(this._raw)?this._raw=this._raw.replace(n,`/${e} ${t}`):this._raw=this._raw.replace(/>>$/,`\n${nx(e)} ${t}\n>>`),this}let n=this.entries.findIndex(([t])=>t===e);return n>=0?this.entries[n]=[e,t]:this.entries.push([e,t]),this}setIf(e,t,n){return e&&this.set(t,n),this}delete(e){let t=this.entries.findIndex(([t])=>t===e);return t>=0&&this.entries.splice(t,1),this}toString(){if(this._raw!==null)return this._raw;let e=[`<<`];for(let[t,n]of this.entries)e.push(`${nx(t)} ${n}`);return e.push(`>>`),e.join(`
|
|
433
|
+
`)}};let sx=1e8;function cx(e){if(e.length<8||e[0]!==137||e[1]!==80||e[2]!==78||e[3]!==71)throw Error(`Invalid PNG signature`);let t=8,n=0,r=0,i=0,a=0,o=[],s=null,c=null;for(;t+8<=e.length;){let l=new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(t,!1),u=String.fromCharCode(e[t+4],e[t+5],e[t+6],e[t+7]),d=e.subarray(t+8,t+8+l);switch(t+=8+l+4,u){case`IHDR`:{let e=new DataView(d.buffer,d.byteOffset,d.byteLength);if(n=e.getUint32(0,!1),r=e.getUint32(4,!1),i=d[8],a=d[9],d[12]!==0)throw Error(`Interlaced PNG is not supported`);if(i!==8)throw Error(`Unsupported PNG bit depth: ${i}. Only 8-bit PNGs are supported.`);if(n===0||r===0)throw Error(`Invalid PNG dimensions: ${n}x${r}`);let t=n*r;if(t>sx)throw Error(`PNG dimensions too large: ${n}x${r} (${t} pixels). Maximum allowed: ${sx} pixels.`);break}case`PLTE`:s=new Uint8Array(d);break;case`tRNS`:c=new Uint8Array(d);break;case`IDAT`:o.push(d);break;case`IEND`:break}}if(n===0||r===0)throw Error(`PNG missing IHDR chunk`);let l=T(o),u;u=l.length>6&&(l[0]&15)==8?l.subarray(2,l.length-4):l;let d=ep(u),f=dx(a),p=Math.max(1,f*i/8),m=Math.ceil(n*f*i/8);return fx(lx(d,n,r,m,p),n,r,a,i,s,c)}function lx(e,t,n,r,i){let a=new Uint8Array(n*r),o=Math.max(1,Math.floor(i)),s=0;for(let t=0;t<n;t++){let n=e[s++],i=t*r,c=t>0?(t-1)*r:-1;for(let t=0;t<r;t++){let r=e[s++]??0,l=t>=o?a[i+t-o]:0,u=c>=0?a[c+t]:0,d=c>=0&&t>=o?a[c+t-o]:0;switch(n){case 0:a[i+t]=r;break;case 1:a[i+t]=r+l&255;break;case 2:a[i+t]=r+u&255;break;case 3:a[i+t]=r+Math.floor((l+u)/2)&255;break;case 4:a[i+t]=r+ux(l,u,d)&255;break;default:a[i+t]=r}}}return a}function ux(e,t,n){let r=e+t-n,i=Math.abs(r-e),a=Math.abs(r-t),o=Math.abs(r-n);return i<=a&&i<=o?e:a<=o?t:n}function dx(e){switch(e){case 0:return 1;case 2:return 3;case 3:return 1;case 4:return 2;case 6:return 4;default:return 3}}function fx(e,t,n,r,i,a,o){let s=t*n,c=new Uint8Array(s*3),l=null;switch(r){case 2:if(c.set(e.subarray(0,s*3)),o&&o.length>=6){let t=o[1],n=o[3],r=o[5];l=new Uint8Array(s),l.fill(255);for(let i=0;i<s;i++)e[i*3]===t&&e[i*3+1]===n&&e[i*3+2]===r&&(l[i]=0)}break;case 6:l=new Uint8Array(s);for(let t=0;t<s;t++)c[t*3]=e[t*4],c[t*3+1]=e[t*4+1],c[t*3+2]=e[t*4+2],l[t]=e[t*4+3];break;case 0:{let t=-1;o&&o.length>=2&&(t=o[1]),t>=0&&(l=new Uint8Array(s),l.fill(255));for(let n=0;n<s;n++){let r=e[n];c[n*3]=r,c[n*3+1]=r,c[n*3+2]=r,l&&r===t&&(l[n]=0)}break}case 4:l=new Uint8Array(s);for(let t=0;t<s;t++){let n=e[t*2];c[t*3]=n,c[t*3+1]=n,c[t*3+2]=n,l[t]=e[t*2+1]}break;case 3:if(!a)throw Error(`PNG palette color type (3) but missing PLTE chunk`);o&&o.length>0&&(l=new Uint8Array(s));for(let t=0;t<s;t++){let n=e[t];c[t*3]=a[n*3]??0,c[t*3+1]=a[n*3+1]??0,c[t*3+2]=a[n*3+2]??0,l&&(l[t]=n<o.length?o[n]:255)}break;default:throw Error(`Unsupported PNG color type: ${r}`)}if(l){let e=!0;for(let t=0;t<l.length;t++)if(l[t]!==255){e=!1;break}e&&(l=null)}return{width:t,height:n,pixels:c,alpha:l,bitsPerComponent:8}}function px(e,t){return t===`png`?mx(e):hx(e)}function mx(e){return e.length>=24&&e[12]===73&&e[13]===72&&e[14]===68&&e[15]===82?{width:e[16]<<24|e[17]<<16|e[18]<<8|e[19],height:e[20]<<24|e[21]<<16|e[22]<<8|e[23]}:{width:1,height:1}}function hx(e){let t=2;for(;t<e.length-1;){for(;t<e.length&&e[t]===255&&e[t+1]===255;)t++;if(t>=e.length-1||e[t]!==255)break;let n=e[t+1];if(n>=192&&n<=207&&n!==196&&n!==200&&n!==204&&t+8<e.length)return{width:e[t+7]<<8|e[t+8],height:e[t+5]<<8|e[t+6]};if(t+3>=e.length)break;let r=e[t+2]<<8|e[t+3];t+=2+r}return{width:1,height:1}}function gx(e,t,n){return n===`png`?vx(e,t):_x(e,t)}function _x(e,t){let n=e.allocObject(),r=hx(t),i=new R().set(`Type`,`/XObject`).set(`Subtype`,`/Image`).set(`Width`,I(r.width)).set(`Height`,I(r.height)).set(`ColorSpace`,`/DeviceRGB`).set(`BitsPerComponent`,`8`).set(`Filter`,`/DCTDecode`);return e.addStreamObject(n,i,t),n}function vx(e,t){let n=cx(t),r=e.allocObject(),i=new R().set(`Type`,`/XObject`).set(`Subtype`,`/Image`).set(`Width`,I(n.width)).set(`Height`,I(n.height)).set(`ColorSpace`,`/DeviceRGB`).set(`BitsPerComponent`,I(n.bitsPerComponent));if(n.alpha){let t=e.allocObject(),r=new R().set(`Type`,`/XObject`).set(`Subtype`,`/Image`).set(`Width`,I(n.width)).set(`Height`,I(n.height)).set(`ColorSpace`,`/DeviceGray`).set(`BitsPerComponent`,`8`);e.addStreamObject(t,r,n.alpha),i.set(`SMask`,L(t))}return e.addStreamObject(r,i,n.pixels),r}eo();function yx(e){return Ka(e)}eo();function bx(e){let t=Sx(e.userPassword??``),n=Sx(e.ownerPassword),r=Cx(e.permissions),i=qa(32),a=qa(8),o=qa(8),s=qa(8),c=qa(8),l=T([yx(T([t,a])),a,o]),u=yx(T([t,o])),d=new Uint8Array(16),f=Ua(i,u,d),p=T([yx(T([n,s,l])),s,c]),m=Ua(i,yx(T([n,c,l])),d),h=new Uint8Array(16);return new DataView(h.buffer).setInt32(0,r,!0),h[4]=255,h[5]=255,h[6]=255,h[7]=255,h[8]=84,h[9]=97,h[10]=100,h[11]=98,{encryptionKey:i,oValue:p,uValue:l,oeValue:m,ueValue:f,permsValue:Wa(h,i),permissions:r,fileId:qa(16)}}function xx(e,t,n,r){let i=qa(16),a=Ha(e,r,i),o=new Uint8Array(16+a.length);return o.set(i),o.set(a,16),o}function Sx(e){let t=new TextEncoder().encode(e);return t.length>127?t.subarray(0,127):t}function Cx(e){let t=-3904;return e?.print&&(t|=4),e?.modify&&(t|=8),e?.copy&&(t|=16),e?.annotate&&(t|=32),e?.fillForms&&(t|=256),e?.accessibility&&(t|=512),e?.assemble&&(t|=1024),e?.printHighQuality&&(t|=2048),t|0}var wx=class{constructor(){this.parts=[]}raw(e){return this.parts.push(e),this}save(){return this.parts.push(`q`),this}restore(){return this.parts.push(`Q`),this}setGraphicsState(e){return this.parts.push(`/${e} gs`),this}setStrokeColor(e){return this.parts.push(`${I(e.r)} ${I(e.g)} ${I(e.b)} RG`),this}setFillColor(e){return this.parts.push(`${I(e.r)} ${I(e.g)} ${I(e.b)} rg`),this}setLineWidth(e){return this.parts.push(`${I(e)} w`),this}setDashPattern(e,t=0){let n=e.map(I).join(` `);return this.parts.push(`[${n}] ${I(t)} d`),this}setLineCap(e){return this.parts.push(`${e} J`),this}setLineJoin(e){return this.parts.push(`${e} j`),this}moveTo(e,t){return this.parts.push(`${I(e)} ${I(t)} m`),this}lineTo(e,t){return this.parts.push(`${I(e)} ${I(t)} l`),this}rect(e,t,n,r){return this.parts.push(`${I(e)} ${I(t)} ${I(n)} ${I(r)} re`),this}curveTo(e,t,n,r,i,a){return this.parts.push(`${I(e)} ${I(t)} ${I(n)} ${I(r)} ${I(i)} ${I(a)} c`),this}curveToV(e,t,n,r){return this.parts.push(`${I(e)} ${I(t)} ${I(n)} ${I(r)} v`),this}curveToY(e,t,n,r){return this.parts.push(`${I(e)} ${I(t)} ${I(n)} ${I(r)} y`),this}stroke(){return this.parts.push(`S`),this}fill(){return this.parts.push(`f`),this}fillAndStroke(){return this.parts.push(`B`),this}closePath(){return this.parts.push(`h`),this}endPath(){return this.parts.push(`n`),this}clip(){return this.parts.push(`W`),this}beginText(){return this.parts.push(`BT`),this}endText(){return this.parts.push(`ET`),this}setFont(e,t){return this.parts.push(`/${e} ${I(t)} Tf`),this}setTextMatrix(e,t,n,r,i,a){return this.parts.push(`${I(e)} ${I(t)} ${I(n)} ${I(r)} ${I(i)} ${I(a)} Tm`),this}moveText(e,t){return this.parts.push(`${I(e)} ${I(t)} Td`),this}setTextLeading(e){return this.parts.push(`${I(e)} TL`),this}showText(e){return Ex(e)?this.showTextWinAnsi(e):(this.parts.push(`(${Tx(e)}) Tj`),this)}showTextWinAnsi(e){let t=`<`;for(let n=0;n<e.length;n++){let r=e.codePointAt(n);r>65535&&n++;let i=Ox(r);t+=i.toString(16).padStart(2,`0`)}return t+=`>`,this.parts.push(`${t} Tj`),this}showTextHex(e){return this.parts.push(`${e} Tj`),this}nextLineShowText(e){if(Ex(e)){let t=`<`;for(let n=0;n<e.length;n++){let r=e.codePointAt(n);r>65535&&n++;let i=Ox(r);t+=i.toString(16).padStart(2,`0`)}return t+=`>`,this.parts.push(`${t} '`),this}return this.parts.push(`(${Tx(e)}) '`),this}setTextRise(e){return this.parts.push(`${I(e)} Ts`),this}setCharacterSpacing(e){return this.parts.push(`${I(e)} Tc`),this}setWordSpacing(e){return this.parts.push(`${I(e)} Tw`),this}drawImage(e,t,n,r,i){return this.save().concat(r,0,0,i,t,n).doXObject(e).restore()}concat(e,t,n,r,i,a){return this.parts.push(`${I(e)} ${I(t)} ${I(n)} ${I(r)} ${I(i)} ${I(a)} cm`),this}doXObject(e){return this.parts.push(`/${e} Do`),this}fillRect(e,t,n,r,i){return this.save().setFillColor(i).rect(e,t,n,r).fill().restore()}drawLine(e,t,n,r,i,a,o=[]){return this.save().setStrokeColor(i).setLineWidth(a),o.length>0&&this.setDashPattern(o),this.moveTo(e,t).lineTo(n,r).stroke().restore()}ellipse(e,t,n,r){let i=.5522847,a=i*n,o=i*r;return this.moveTo(e+n,t),this.curveTo(e+n,t+o,e+a,t+r,e,t+r),this.curveTo(e-a,t+r,e-n,t+o,e-n,t),this.curveTo(e-n,t-o,e-a,t-r,e,t-r),this.curveTo(e+a,t-r,e+n,t-o,e+n,t),this}circle(e,t,n){return this.ellipse(e,t,n,n)}roundedRect(e,t,n,r,i){let a=.5522847*i;return this.moveTo(e+i,t),this.lineTo(e+n-i,t),this.curveTo(e+n-i+a,t,e+n,t+i-a,e+n,t+i),this.lineTo(e+n,t+r-i),this.curveTo(e+n,t+r-i+a,e+n-i+a,t+r,e+n-i,t+r),this.lineTo(e+i,t+r),this.curveTo(e+i-a,t+r,e,t+r-i+a,e,t+r-i),this.lineTo(e,t+i),this.curveTo(e,t+i-a,e+i-a,t,e+i,t),this}toString(){return this.parts.join(`
|
|
434
|
+
`)}toUint8Array(){return new TextEncoder().encode(this.toString())}};function Tx(e){return e.replace(/\\/g,`\\\\`).replace(/\(/g,`\\(`).replace(/\)/g,`\\)`).replace(/\r\n/g,`\\n`).replace(/\r/g,`\\n`).replace(/\n/g,`\\n`)}function Ex(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127)return!0;return!1}let Dx=new Map([[8364,128],[8218,130],[402,131],[8222,132],[8230,133],[8224,134],[8225,135],[710,136],[8240,137],[352,138],[8249,139],[338,140],[381,142],[8216,145],[8217,146],[8220,147],[8221,148],[8226,149],[8211,150],[8212,151],[732,152],[8482,153],[353,154],[8250,155],[339,156],[382,158],[376,159]]);function Ox(e){if(e<128||e>=160&&e<=255)return e;let t=Dx.get(e);return t===void 0?32:t}function kx(e){return e<128||e>=160&&e<=255?!0:Dx.has(e)}function Ax(e){for(let t=0;t<e.length;t++){let n=e.codePointAt(t);if(n>65535&&t++,!kx(n))return!0}return!1}var jx=class extends n{constructor(...e){super(...e),this.name=`PdfError`}},Mx=class extends jx{constructor(...e){super(...e),this.name=`PdfRenderError`}},Nx=class extends jx{constructor(...e){super(...e),this.name=`PdfFontError`}},Px=class extends jx{constructor(...e){super(...e),this.name=`PdfStructureError`}};function Fx(e){return e instanceof jx}var Ix=class{constructor(){this.nextObjectNumber=1,this.objects=[],this.catalogRef=0,this.infoRef=0,this.encryption=null,this.pdfVersion=`2.0`}setVersion(e){this.pdfVersion=e}setEncryption(e){this.encryption=e}allocObject(){return this.nextObjectNumber++}addObject(e,t){this.objects.push({objectNumber:e,offset:0,content:typeof t==`string`?t:t.toString()})}addStreamObject(e,t,n,r){let i=n instanceof Uint8Array?n:n.toUint8Array();if((r?.compress??!0)&&i.length>256&&!t.toString().includes(`/Filter`)){let e=np(i,{level:6});e.length<i.length&&(t.set(`Filter`,`/FlateDecode`),i=e)}t.set(`Length`,I(i.length)),this.objects.push({objectNumber:e,offset:0,content:t.toString(),streamData:i})}getObjects(){return this.objects.map(e=>{let t={objectNumber:e.objectNumber,content:e.content};return`streamData`in e&&(t.streamData=e.streamData),t})}setCatalog(e){this.catalogRef=e}addInfoDict(e){let t=this.allocObject(),n=new R;return e.title&&n.set(`Title`,ex(e.title)),e.author&&n.set(`Author`,ex(e.author)),e.subject&&n.set(`Subject`,ex(e.subject)),e.creator&&n.set(`Creator`,ex(e.creator)),n.set(`Producer`,ex(`excelts`)),n.set(`CreationDate`,ix(new Date)),this.addObject(t,n),this.infoRef=t,t}addPage(e){let t=this.allocObject(),n=`[0 0 ${I(e.width)} ${I(e.height)}]`,r=typeof e.contentsRef==`string`?e.contentsRef:L(e.contentsRef),i=new R().set(`Type`,`/Page`).set(`Parent`,L(e.parentRef)).set(`MediaBox`,n).set(`Contents`,r).set(`Resources`,L(e.resourcesRef));return e.annotRefs&&e.annotRefs.length>0&&i.set(`Annots`,`[`+e.annotRefs.map(e=>L(e)).join(` `)+`]`),this.addObject(t,i),t}addCatalog(e,t){let n=typeof t==`number`?{outlinesRef:t}:t??{},r=this.allocObject(),i=new R().set(`Type`,`/Catalog`).set(`Pages`,L(e));if(n.outlinesRef&&(i.set(`Outlines`,L(n.outlinesRef)),i.set(`PageMode`,`/UseOutlines`)),n.extraEntries)for(let[e,t]of n.extraEntries)i.set(e,t);return this.addObject(r,i),this.setCatalog(r),r}build(){if(this.catalogRef===0)throw new Px(`No catalog object set. Call addCatalog() before build().`);let e=new TextEncoder,t=[],n=0,r=`%PDF-${this.pdfVersion}\n`,i=e.encode(r);t.push(i),n+=i.length;let a=new Uint8Array([37,226,227,207,211,10]);t.push(a),n+=a.length,this.objects.sort((e,t)=>e.objectNumber-t.objectNumber);let o=this.encryption?this.allocObject():0;for(let r of this.objects){r.offset=n;let i=`${r.objectNumber} 0 obj\n`,a=e.encode(i);t.push(a),n+=a.length;let s=r.content;this.encryption&&r.objectNumber!==o&&(s=Lx(s,r.objectNumber,0,this.encryption.encryptionKey));let c=null;`streamData`in r&&r.streamData&&(c=r.streamData,this.encryption&&r.objectNumber!==o&&(c=xx(c,r.objectNumber,0,this.encryption.encryptionKey),s=s.replace(/\/Length \d+/,`/Length ${c.length}`)));let l=e.encode(s+`
|
|
435
435
|
`);if(t.push(l),n+=l.length,c){let r=e.encode(`stream
|
|
436
436
|
`);t.push(r),n+=r.length,t.push(c),n+=c.length;let i=e.encode(`
|
|
437
437
|
endstream
|
|
438
438
|
`);t.push(i),n+=i.length}let u=e.encode(`endobj
|
|
439
|
-
`);t.push(u),n+=u.length}if(this.encryption){let r=new
|
|
439
|
+
`);t.push(u),n+=u.length}if(this.encryption){let r=new R().set(`Filter`,`/Standard`).set(`V`,`5`).set(`R`,`5`).set(`Length`,`256`).set(`P`,String(this.encryption.permissions)).set(`O`,tx(this.encryption.oValue)).set(`U`,tx(this.encryption.uValue)).set(`OE`,tx(this.encryption.oeValue)).set(`UE`,tx(this.encryption.ueValue)).set(`Perms`,tx(this.encryption.permsValue)).set(`EncryptMetadata`,`true`).set(`CF`,`<< /StdCF << /Type /CryptFilter /CFM /AESV3 /AuthEvent /DocOpen /Length 32 >> >>`).set(`StmF`,`/StdCF`).set(`StrF`,`/StdCF`).toString(),i={objectNumber:o,offset:n,content:r};this.objects.push(i);let a=e.encode(`${o} 0 obj\n`);t.push(a),n+=a.length;let s=e.encode(r+`
|
|
440
440
|
`);t.push(s),n+=s.length;let c=e.encode(`endobj
|
|
441
441
|
`);t.push(c),n+=c.length}let s=n,c=new Map;for(let e of this.objects)c.set(e.objectNumber,e);let l=this.objects.reduce((e,t)=>Math.max(e,t.objectNumber),0),u=[];u.push(`xref`),u.push(`0 ${l+1}`);let d=[0];for(let e=1;e<=l;e++)c.has(e)||d.push(e);let f=new Map;for(let e=0;e<d.length-1;e++)f.set(d[e],d[e+1]);f.set(d[d.length-1],0);let p=(f.get(0)??0).toString().padStart(10,`0`);u.push(`${p} 65535 f `);for(let e=1;e<=l;e++){let t=c.get(e);if(t){let e=t.offset.toString().padStart(10,`0`);u.push(`${e} 00000 n `)}else{let t=(f.get(e)??0).toString().padStart(10,`0`);u.push(`${t} 65535 f `)}}let m=u.join(`
|
|
442
442
|
`)+`
|
|
443
443
|
`,h=e.encode(m);t.push(h);let g=`trailer
|
|
444
444
|
<<
|
|
445
|
-
`;g+=`/Size ${l+1}\n`,g+=`/Root ${
|
|
445
|
+
`;g+=`/Size ${l+1}\n`,g+=`/Root ${L(this.catalogRef)}\n`,this.infoRef>0&&(g+=`/Info ${L(this.infoRef)}\n`),o>0&&(g+=`/Encrypt ${L(o)}\n`,g+=`/ID [${tx(this.encryption.fileId)} ${tx(this.encryption.fileId)}]\n`),g+=`>>
|
|
446
446
|
`,g+=`startxref
|
|
447
447
|
`,g+=`${s}\n`,g+=`%%EOF
|
|
448
|
-
`;let _=e.encode(g);return t.push(_),
|
|
449
|
-
`;break;case`r`:t+=`\r`;break;case`t`:t+=` `;break;case`(`:t+=`(`;break;case`)`:t+=`)`;break;case`\\`:t+=`\\`;break;default:t+=i;break}n++}return t}function
|
|
450
|
-
`);return new TextEncoder().encode(i)}function Ex(e,t){if(e.length===0)return`[]`;let n=1e3/t;return`[0 [${e.map(e=>X(Math.round(e*n))).join(` `)}]]`}function Dx(e,t,n){let r=e.glyphOffsets[t];if(e.glyphOffsets[t+1]-r<4)return[];let i=new DataView(e.data.buffer,e.data.byteOffset,e.data.byteLength),a=n+r;if(i.getInt16(a,!1)>=0)return[];let o=a+10,s=[];for(;;){let e=i.getUint16(o,!1);o+=2;let t=i.getUint16(o,!1);if(o+=2,s.push(t),e&1?o+=4:o+=2,e&8?o+=2:e&64?o+=4:e&128&&(o+=8),!(e&32))break}return s}function Ox(e,t){if(e.length<10||new DataView(e.buffer,e.byteOffset,e.byteLength).getInt16(0,!1)>=0)return e;let n=new Uint8Array(e.length);n.set(e);let r=new DataView(n.buffer,n.byteOffset,n.byteLength),i=10;for(;;){let e=r.getUint16(i,!1);i+=2;let n=r.getUint16(i,!1),a=t.get(n)??0;if(r.setUint16(i,a,!1),i+=2,e&1?i+=4:i+=2,e&8?i+=2:e&64?i+=4:e&128&&(i+=8),!(e&32))break}return n}let kx={32:278,33:278,34:355,35:556,36:556,37:889,38:667,39:191,40:333,41:333,42:389,43:584,44:278,45:333,46:278,47:278,48:556,49:556,50:556,51:556,52:556,53:556,54:556,55:556,56:556,57:556,58:278,59:278,60:584,61:584,62:584,63:556,64:1015,65:667,66:667,67:722,68:722,69:667,70:611,71:778,72:722,73:278,74:500,75:667,76:556,77:833,78:722,79:778,80:667,81:778,82:722,83:667,84:611,85:722,86:667,87:944,88:667,89:667,90:611,91:278,92:278,93:278,94:469,95:556,96:333,97:556,98:556,99:500,100:556,101:556,102:278,103:556,104:556,105:222,106:222,107:500,108:222,109:833,110:556,111:556,112:556,113:556,114:333,115:500,116:278,117:556,118:500,119:722,120:500,121:500,122:500,123:334,124:260,125:334,126:584},Ax={32:278,33:333,34:474,35:556,36:556,37:889,38:722,39:238,40:333,41:333,42:389,43:584,44:278,45:333,46:278,47:278,48:556,49:556,50:556,51:556,52:556,53:556,54:556,55:556,56:556,57:556,58:333,59:333,60:584,61:584,62:584,63:611,64:975,65:722,66:722,67:722,68:722,69:667,70:611,71:778,72:722,73:278,74:556,75:722,76:611,77:833,78:722,79:778,80:667,81:778,82:722,83:667,84:611,85:722,86:667,87:944,88:667,89:667,90:611,91:333,92:278,93:333,94:584,95:556,96:333,97:556,98:611,99:556,100:611,101:556,102:333,103:611,104:611,105:278,106:278,107:556,108:278,109:889,110:611,111:611,112:611,113:611,114:389,115:556,116:333,117:611,118:556,119:778,120:556,121:556,122:500,123:389,124:280,125:389,126:584},jx={32:250,33:333,34:408,35:500,36:500,37:833,38:778,39:180,40:333,41:333,42:500,43:564,44:250,45:333,46:250,47:278,48:500,49:500,50:500,51:500,52:500,53:500,54:500,55:500,56:500,57:500,58:278,59:278,60:564,61:564,62:564,63:444,64:921,65:722,66:667,67:667,68:722,69:611,70:556,71:722,72:722,73:333,74:389,75:722,76:611,77:889,78:722,79:722,80:556,81:722,82:667,83:556,84:611,85:722,86:722,87:944,88:722,89:722,90:611,91:333,92:278,93:333,94:469,95:500,96:333,97:444,98:500,99:444,100:500,101:444,102:333,103:500,104:500,105:278,106:278,107:500,108:278,109:778,110:500,111:500,112:500,113:500,114:333,115:389,116:278,117:500,118:500,119:722,120:500,121:500,122:444,123:480,124:200,125:480,126:541},Mx={32:250,33:333,34:555,35:500,36:500,37:1e3,38:833,39:278,40:333,41:333,42:500,43:570,44:250,45:333,46:250,47:278,48:500,49:500,50:500,51:500,52:500,53:500,54:500,55:500,56:500,57:500,58:333,59:333,60:570,61:570,62:570,63:500,64:930,65:722,66:667,67:722,68:722,69:667,70:611,71:778,72:778,73:389,74:500,75:778,76:667,77:944,78:722,79:778,80:611,81:778,82:722,83:556,84:667,85:722,86:722,87:1e3,88:722,89:722,90:667,91:333,92:278,93:333,94:581,95:500,96:333,97:500,98:556,99:444,100:556,101:444,102:333,103:500,104:556,105:278,106:333,107:556,108:278,109:833,110:556,111:500,112:556,113:556,114:444,115:389,116:333,117:556,118:500,119:722,120:500,121:500,122:444,123:394,124:220,125:394,126:520},Nx={Helvetica:{ascent:718,descent:-207,capHeight:718,avgWidth:513,widths:kx},"Helvetica-Bold":{ascent:718,descent:-207,capHeight:718,avgWidth:535,widths:Ax},"Helvetica-Oblique":{ascent:718,descent:-207,capHeight:718,avgWidth:513,widths:kx},"Helvetica-BoldOblique":{ascent:718,descent:-207,capHeight:718,avgWidth:535,widths:Ax},"Times-Roman":{ascent:683,descent:-217,capHeight:662,avgWidth:478,widths:jx},"Times-Bold":{ascent:683,descent:-217,capHeight:676,avgWidth:505,widths:Mx},"Times-Italic":{ascent:683,descent:-217,capHeight:653,avgWidth:478,widths:jx},"Times-BoldItalic":{ascent:683,descent:-217,capHeight:669,avgWidth:505,widths:Mx},Courier:{ascent:629,descent:-157,capHeight:562,avgWidth:600,widths:null,monoWidth:600},"Courier-Bold":{ascent:629,descent:-157,capHeight:562,avgWidth:600,widths:null,monoWidth:600},"Courier-Oblique":{ascent:629,descent:-157,capHeight:562,avgWidth:600,widths:null,monoWidth:600},"Courier-BoldOblique":{ascent:629,descent:-157,capHeight:562,avgWidth:600,widths:null,monoWidth:600}};function Px(e,t){let n=Nx[t];return n?n.monoWidth===void 0?n.widths?.[e]??n.avgWidth:n.monoWidth:Px(e,`Helvetica`)}function Fx(e,t,n){let r=0;for(let n=0;n<e.length;n++)r+=Px(e.charCodeAt(n),t);return r/1e3*n}function Ix(e,t){return(Nx[e]??Nx.Helvetica).ascent/1e3*t}function Lx(e,t){return(Nx[e]??Nx.Helvetica).descent/1e3*t}function Rx(e,t){let n=Nx[e]??Nx.Helvetica;return(n.ascent-n.descent)/1e3*t}let zx={helvetica:`Helvetica`,arial:`Helvetica`,calibri:`Helvetica`,"segoe ui":`Helvetica`,"trebuchet ms":`Helvetica`,verdana:`Helvetica`,tahoma:`Helvetica`,"gill sans":`Helvetica`,"franklin gothic":`Helvetica`,"lucida sans":`Helvetica`,aptos:`Helvetica`,"times new roman":`Times`,times:`Times`,georgia:`Times`,garamond:`Times`,"book antiqua":`Times`,palatino:`Times`,"palatino linotype":`Times`,cambria:`Times`,"century schoolbook":`Times`,"courier new":`Courier`,courier:`Courier`,consolas:`Courier`,"lucida console":`Courier`,monaco:`Courier`,"andale mono":`Courier`,"cascadia code":`Courier`,"cascadia mono":`Courier`,menlo:`Courier`};function Bx(e){return zx[e.toLowerCase().trim()]??`Helvetica`}function Vx(e,t,n){let r=Bx(e);return r===`Helvetica`?t&&n?`Helvetica-BoldOblique`:t?`Helvetica-Bold`:n?`Helvetica-Oblique`:`Helvetica`:r===`Times`?t&&n?`Times-BoldItalic`:t?`Times-Bold`:n?`Times-Italic`:`Times-Roman`:r===`Courier`?t&&n?`Courier-BoldOblique`:t?`Courier-Bold`:n?`Courier-Oblique`:`Courier`:`Helvetica`}var Hx=class{constructor(){this.type1Map=new Map,this.resourceToType1=new Map,this.nextType1Id=1,this.embeddedFont=null,this.embeddedResourceName=``,this.usedCodePoints=new Set,this.nextEmbeddedId=1,this._embeddedResult=null}registerEmbeddedFont(e){return this.embeddedFont=e,this.embeddedResourceName=`EF${this.nextEmbeddedId++}`,this.embeddedResourceName}hasEmbeddedFont(){return this.embeddedFont!==null}getEmbeddedResourceName(){return this.embeddedResourceName}trackText(e){if(this.embeddedFont)for(let t=0;t<e.length;t++){let n=e.codePointAt(t);this.usedCodePoints.add(n),n>65535&&t++}}ensureFont(e){let t=this.type1Map.get(e);return t||(t=`F${this.nextType1Id++}`,this.type1Map.set(e,t),this.resourceToType1.set(t,e)),t}resolveFont(e,t,n){if(this.embeddedFont)return this.embeddedResourceName;let r=Vx(e,t,n);return this.ensureFont(r)}getPdfFontName(e){return this.resourceToType1.get(e)??`Helvetica`}measureText(e,t,n){return this.embeddedFont&&t===this.embeddedResourceName?Wx(e,this.embeddedFont,n):Fx(e,this.getPdfFontName(t),n)}getFontAscent(e,t){return this.embeddedFont&&e===this.embeddedResourceName?this.embeddedFont.ascent/this.embeddedFont.unitsPerEm*t:Ix(this.getPdfFontName(e),t)}getFontDescent(e,t){return this.embeddedFont&&e===this.embeddedResourceName?this.embeddedFont.descent/this.embeddedFont.unitsPerEm*t:Lx(this.getPdfFontName(e),t)}getLineHeight(e,t){if(this.embeddedFont&&e===this.embeddedResourceName){let e=this.embeddedFont;return(e.ascent-e.descent)/e.unitsPerEm*t}return Rx(this.getPdfFontName(e),t)}isEmbeddedFont(e){return this.embeddedFont!==null&&e===this.embeddedResourceName}encodeText(e,t){if(!this.embeddedFont||t!==this.embeddedResourceName)return null;if(this._embeddedResult)return Ux(e,this._embeddedResult.unicodeToCid);throw new px(`encodeText called before writeFontResources — subset mapping not available`)}writeFontResources(e){let t=new Map;for(let[n,r]of this.type1Map){let i=e.allocObject(),a=new Q().set(`Type`,`/Font`).set(`Subtype`,`/Type1`).set(`BaseFont`,Rb(n)).set(`Encoding`,`/WinAnsiEncoding`);e.addObject(i,a),t.set(r,i)}if(this.embeddedFont&&this.embeddedResourceName){let n=yx(e,this.embeddedFont,this.usedCodePoints,this.embeddedResourceName);t.set(this.embeddedResourceName,n.fontObjNum),this._embeddedResult=n}return t}getEmbeddedResult(){return this._embeddedResult}buildFontDictString(e){let t=[`<<`];for(let[n,r]of e)t.push(`${Rb(n)} ${Z(r)}`);return t.push(`>>`),t.join(`
|
|
451
|
-
`)}getRegisteredFonts(){let e=[];for(let[t,n]of this.type1Map)e.push({resourceName:n,pdfFontName:t});return e}};function Ux(e,t){let n=`<`;for(let r=0;r<e.length;r++){let i=e.codePointAt(r);i>65535&&r++;let a=t.get(i)??0;n+=a.toString(16).toUpperCase().padStart(4,`0`)}return n+=`>`,n}function Wx(e,t,n){let r=0;for(let n=0;n<e.length;n++){let i=e.codePointAt(n);i>65535&&n++;let a=t.cmap.get(i)??0;r+=t.advanceWidths[a]??0}return r/t.unitsPerEm*n}let Gx=65536,Kx=2e6;var qx=class e{constructor(e,t=0){this.data=e,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.offset=t}u8(){let e=this.view.getUint8(this.offset);return this.offset+=1,e}u16(){let e=this.view.getUint16(this.offset,!1);return this.offset+=2,e}i16(){let e=this.view.getInt16(this.offset,!1);return this.offset+=2,e}u32(){let e=this.view.getUint32(this.offset,!1);return this.offset+=4,e}i32(){let e=this.view.getInt32(this.offset,!1);return this.offset+=4,e}fixed(){return this.i32()/65536}bytes(e){let t=this.data.subarray(this.offset,this.offset+e);return this.offset+=e,t}tag(){return String.fromCharCode(this.u8(),this.u8(),this.u8(),this.u8())}skip(e){this.offset+=e}at(t){return new e(this.data,t)}u16At(e){return this.view.getUint16(e,!1)}u32At(e){return this.view.getUint32(e,!1)}i16At(e){return this.view.getInt16(e,!1)}};function Jx(e){let t=new qx(e),n=t.u32();if(n!==65536&&n!==1953658213)throw n===1330926671?new px(`CFF-flavored OpenType (.otf) is not supported. Use a TrueType (.ttf) font.`):new px(`Invalid TrueType font: bad sfVersion 0x${n.toString(16)}`);let r=t.u16();t.skip(6);let i=new Map;for(let e=0;e<r;e++){let e=t.tag();t.skip(4);let n=t.u32(),r=t.u32();i.set(e,{offset:n,length:r})}for(let e of[`head`,`hhea`,`maxp`,`cmap`,`hmtx`])if(!i.has(e))throw new px(`Missing required table '${e}' in TrueType font`);let a=Yx(t,i.get(`head`)),o=Xx(t,i.get(`hhea`)),s=Zx(t,i.get(`maxp`)),c=i.has(`OS/2`)?Qx(t,i.get(`OS/2`)):null,l=i.has(`post`)?$x(t,i.get(`post`)):null,u=i.has(`name`)?eS(t,i.get(`name`)):null,d=tS(t,i.get(`cmap`)),f=iS(t,i.get(`hmtx`),o.numHMetrics,s.numGlyphs),p=i.has(`loca`)&&i.has(`glyf`)?aS(t,i.get(`loca`),s.numGlyphs,a.indexToLocFormat):new Uint32Array(s.numGlyphs+1),m=c?.sTypoAscender??o.ascent,h=c?.sTypoDescender??o.descent,g=c?.sCapHeight??Math.round(m*.7),_=0;l?.isFixedPitch&&(_|=1),a.macStyle&2&&(_|=64),_|=32;let v=c?.usWeightClass??400,y=Math.round(50+(v/65)**2),b=u?.familyName??`Unknown`;return{data:e,familyName:b,postScriptName:u?.postScriptName??b.replace(/\s+/g,``),unitsPerEm:a.unitsPerEm,ascent:m,descent:h,capHeight:g,italicAngle:l?.italicAngle??0,flags:_,bbox:[a.xMin,a.yMin,a.xMax,a.yMax],stemV:y,numGlyphs:s.numGlyphs,indexToLocFormat:a.indexToLocFormat,numHMetrics:o.numHMetrics,tables:i,cmap:d,advanceWidths:f,glyphOffsets:p}}function Yx(e,t){let n=e.at(t.offset);n.skip(4),n.skip(4),n.skip(4),n.skip(4),n.skip(2);let r=n.u16();n.skip(16);let i=n.i16(),a=n.i16(),o=n.i16(),s=n.i16(),c=n.u16();return n.skip(2),n.skip(2),{unitsPerEm:r,xMin:i,yMin:a,xMax:o,yMax:s,macStyle:c,indexToLocFormat:n.i16()}}function Xx(e,t){let n=e.at(t.offset);n.skip(4);let r=n.i16(),i=n.i16(),a=n.i16();return n.skip(2),n.skip(22),{ascent:r,descent:i,lineGap:a,numHMetrics:n.u16()}}function Zx(e,t){let n=e.at(t.offset);return n.skip(4),{numGlyphs:n.u16()}}function Qx(e,t){let n=e.at(t.offset),r=n.u16();n.skip(2);let i=n.u16();n.skip(2),n.skip(2),n.skip(22),n.skip(10),n.skip(16),n.skip(4),n.skip(2),n.skip(2),n.skip(2);let a=n.i16(),o=n.i16();n.skip(2),n.skip(2),n.skip(2);let s;return r>=2?(n.skip(8),n.skip(2),s=n.i16()):s=Math.round(a*.7),{usWeightClass:i,sTypoAscender:a,sTypoDescender:o,sCapHeight:s}}function $x(e,t){let n=e.at(t.offset);n.skip(4);let r=n.fixed();return n.skip(2),n.skip(2),{italicAngle:r,isFixedPitch:n.u32()!==0}}function eS(e,t){let n=t.offset,r=e.at(n);r.skip(2);let i=r.u16(),a=n+r.u16(),o=``,s=``;for(let t=0;t<i;t++){let t=r.u16(),n=r.u16();r.skip(2);let i=r.u16(),c=r.u16(),l=r.u16();if(i!==1&&i!==6)continue;let u=e.at(a+l).bytes(c),d;if(t===3||t===0)d=oS(u);else if(t===1&&n===0)d=sS(u);else continue;i===1&&!o&&(o=d),i===6&&!s&&(s=d)}return{familyName:o||`Unknown`,postScriptName:s||o||`Unknown`}}function tS(e,t){let n=t.offset,r=e.at(n);r.skip(2);let i=r.u16(),a=-1,o=-1;for(let t=0;t<i;t++){let t=r.u16(),i=r.u16(),s=r.u32();if(!(t===0||t===3&&(i===1||i===10)))continue;let c=e.u16At(n+s);c===12&&o<0&&(o=n+s),c===4&&a<0&&(a=n+s)}if(o>=0)return rS(e,o);if(a>=0)return nS(e,a);throw new px(`No usable Unicode cmap subtable found in font`)}function nS(e,t){let n=e.at(t);n.skip(2),n.skip(2),n.skip(2);let r=n.u16()/2;n.skip(6);let i=[];for(let e=0;e<r;e++)i.push(n.u16());n.skip(2);let a=[];for(let e=0;e<r;e++)a.push(n.u16());let o=[];for(let e=0;e<r;e++)o.push(n.i16());let s=n.offset,c=[];for(let e=0;e<r;e++)c.push(n.u16());let l=new Map;for(let t=0;t<r;t++){let n=a[t],r=i[t],u=o[t],d=c[t];if(n===65535)break;for(let i=n;i<=r;i++){let r;if(d===0)r=i+u&65535;else{let a=s+t*2+d+(i-n)*2;r=e.u16At(a),r!==0&&(r=r+u&65535)}r!==0&&l.set(i,r)}}return l}function rS(e,t){let n=e.at(t);n.skip(2),n.skip(2),n.skip(4),n.skip(4);let r=n.u32();if(r>Gx)throw new px(`cmap format 12 has ${r} groups, exceeding limit of ${Gx}. The font file may be malicious or corrupted.`);let i=new Map,a=0;for(let e=0;e<r;e++){let e=n.u32(),t=n.u32(),r=n.u32(),o=t>=e?t-e+1:0;if(a+=o,a>Kx)throw new px(`cmap format 12 maps too many codepoints (>${Kx}). The font file may be malicious or corrupted.`);for(let n=e;n<=t;n++)i.set(n,r+(n-e))}return i}function iS(e,t,n,r){let i=e.at(t.offset),a=new Uint16Array(r),o=0;for(let e=0;e<n;e++)o=i.u16(),i.skip(2),a[e]=o;for(let e=n;e<r;e++)a[e]=o;return a}function aS(e,t,n,r){let i=e.at(t.offset),a=new Uint32Array(n+1);if(r===0)for(let e=0;e<=n;e++)a[e]=i.u16()*2;else for(let e=0;e<=n;e++)a[e]=i.u32();return a}function oS(e){let t=[];for(let n=0;n+1<e.length;n+=2){let r=e[n]<<8|e[n+1];if(r>=55296&&r<=56319&&n+3<e.length){let i=e[n+2]<<8|e[n+3];if(i>=56320&&i<=57343){t.push(String.fromCodePoint((r-55296<<10)+(i-56320)+65536)),n+=2;continue}}t.push(String.fromCharCode(r))}return t.join(``)}function sS(e){let t=[];for(let n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join(``)}let $={Empty:0,String:1,Number:2,Boolean:3,Date:4,RichText:5,Error:6,Formula:7,Hyperlink:8,Merge:9},cS={A3:{width:841.89,height:1190.55},A4:{width:595.28,height:841.89},A5:{width:419.53,height:595.28},LETTER:{width:612,height:792},LEGAL:{width:612,height:1008},TABLOID:{width:792,height:1224}},lS=1.2,uS=72/96;function dS(e,t=1){return{left:(3+e.borderInsets.left)*t,right:(3+e.borderInsets.right)*t,top:(2+e.borderInsets.top)*t,bottom:(2+e.borderInsets.bottom)*t}}function fS(e,t,n,r){let i=new ox,a=new Set;t.showGridLines&&pS(i,e,t);for(let t of e.cells)t.fillColor&&mS(i,t,a);for(let t of e.cells)_S(i,t);let o=e.scaleFactor;for(let t of e.cells)t.text&&yS(i,t,n,a,o);return t.showSheetNames&&MS(i,e,t,n),t.showPageNumbers&&NS(i,e,t,n,r),{stream:i,alphaValues:a}}function pS(e,t,n){if(t.columnWidths.length===0||t.rowHeights.length===0)return;let r=n.gridLineColor;e.save(),e.setStrokeColor(r),e.setLineWidth(.25);let i=t.rowYPositions[0],a=t.rowYPositions.length-1,o=t.rowYPositions[a]-t.rowHeights[a];for(let n=0;n<=t.columnWidths.length;n++){let r=n<t.columnWidths.length?t.columnOffsets[n]:t.columnOffsets[n-1]+t.columnWidths[n-1];e.moveTo(r,i),e.lineTo(r,o)}let s=t.columnOffsets[0],c=t.columnOffsets.length-1,l=t.columnOffsets[c]+t.columnWidths[c];for(let n=0;n<=t.rowYPositions.length;n++){let r=n<t.rowYPositions.length?t.rowYPositions[n]:t.rowYPositions[n-1]-t.rowHeights[n-1];e.moveTo(s,r),e.lineTo(l,r)}e.stroke(),e.restore()}function mS(e,t,n){if(!t.fillColor)return;let r=t.fillColor.a;if(r!==void 0&&r<1){let i=DS(r);n.add(r),e.save(),e.setGraphicsState(i),e.fillRect(t.rect.x,t.rect.y,t.rect.width,t.rect.height,t.fillColor),e.restore()}else e.fillRect(t.rect.x,t.rect.y,t.rect.width,t.rect.height,t.fillColor)}function hS(e){return typeof e==`number`?e<=90?e:-(e-90):0}function gS(e,t){let n=hS(e);if(n===0)return 0;let r=Math.abs(n);if(r<.01||r>89.99)return 0;let i=r*Math.PI/180,a=t*Math.cos(i)/Math.sin(i);return n<0?-a:a}function _S(e,t){let{rect:n,borders:r,textRotation:i}=t,{x:a,y:o,width:s,height:c}=n,l=gS(i,c);r.top&&vS(e,r.top,a+l,o+c,a+s+l,o+c,!0),r.bottom&&vS(e,r.bottom,a,o,a+s,o,!0),r.left&&vS(e,r.left,a,o,a+l,o+c,!1),r.right&&vS(e,r.right,a+s,o,a+s+l,o+c,!1)}function vS(e,t,n,r,i,a,o){if(t.isDouble){let s=.4,c=Math.min(t.width,.25);o?(e.drawLine(n,r+s,i,a+s,t.color,c,t.dashPattern),e.drawLine(n,r-s,i,a-s,t.color,c,t.dashPattern)):(e.drawLine(n+s,r,i+s,a,t.color,c,t.dashPattern),e.drawLine(n-s,r,i-s,a,t.color,c,t.dashPattern))}else e.drawLine(n,r,i,a,t.color,t.width,t.dashPattern)}function yS(e,t,n,r,i=1){let{rect:a,text:o,fontSize:s,horizontalAlign:c,verticalAlign:l,wrapText:u}=t;if(!o&&!t.richText)return;let d=dS(t,i),f=a.width-d.left-d.right,p=a.height-d.top-d.bottom;if(f<=0||p<=0)return;let m=t.indent*10*i,h=a.width+(t.textOverflowWidth||0);e.save();let g=gS(t.textRotation,a.height);g===0?e.rect(a.x,a.y,h,a.height):(e.moveTo(a.x,a.y),e.lineTo(a.x+h,a.y),e.lineTo(a.x+h+g,a.y+a.height),e.lineTo(a.x+g,a.y+a.height),e.closePath()),e.clip(),e.endPath();let _=t.textColor.a;if(_!==void 0&&_<1&&(r.add(_),e.setGraphicsState(DS(_))),t.textRotation===`vertical`){ES(e,t,n,m,i),e.restore();return}if(typeof t.textRotation==`number`&&t.textRotation!==0){xS(e,t,n,m,i),e.restore();return}if(t.richText&&t.richText.length>0){bS(e,t,n,m,i),e.restore();return}let v=n.hasEmbeddedFont()?n.getEmbeddedResourceName():n.ensureFont(Vx(t.fontFamily,t.bold,t.italic)),y=e=>n.measureText(e,v,s),b=f-m,x=u?jS(o,y,b):o.split(/\r?\n/),S=s*lS,C=n.getFontAscent(v,s),ee=OS(l,a,x.length*S,C,d.top,d.bottom);e.setFillColor(t.textColor),e.beginText(),e.setFont(v,s);for(let t=0;t<x.length;t++){let r=x[t],i=ee-t*S,o=kS(c,a,y(r),m,d.left,d.right);e.setTextMatrix(1,0,0,1,o,i);let s=n.encodeText(r,v);s?e.showTextHex(s):e.showText(r)}e.endText(),AS(e,t,x,S,ee,y,v,n,m,d),e.restore()}function bS(e,t,n,r,i=1){let{rect:a,horizontalAlign:o,verticalAlign:s,wrapText:c}=t,l=t.richText,u=dS(t,i),d=t.fontSize;for(let e of l)e.fontSize>d&&(d=e.fontSize);let f=d,p=f*lS,m=n.hasEmbeddedFont(),h=e=>m?n.getEmbeddedResourceName():n.ensureFont(Vx(e.fontFamily,e.bold,e.italic));if(c){let t=a.width-u.left-u.right-r;if(t<=0)return;let i=l.map(e=>e.text).join(``),c=h(l[0]),d=jS(i,e=>n.measureText(e,c,f),t),m=[];for(let e=0;e<l.length;e++)for(let t=0;t<l[e].text.length;t++)m.push(e);let g=h(l[0]),_=n.getFontAscent(g,f),v=OS(s,a,d.length*p,_,u.top,u.bottom),y=0;for(let t=0;t<d.length;t++){let s=v-t*p,c=d[t].length,f=[],g=y;for(let e=0;e<c;e++){let n=m[y+e]??m.length-1,r=f[f.length-1];r&&r.run===l[n]?r.text+=d[t][e]:f.push({run:l[n],text:d[t][e],resourceName:h(l[n])})}for(y+=c;y<m.length&&y<g+c+1;){let e=t+1<d.length?i.indexOf(d[t+1],y):i.length;if(e>y){y=e;break}break}let _=0;for(let e of f)_+=n.measureText(e.text,e.resourceName,e.run.fontSize);let b=kS(o,a,_,r,u.left,u.right);for(let t of f){let{run:r,text:i,resourceName:a}=t,o=n.measureText(i,a,r.fontSize);e.setFillColor(r.textColor),e.beginText(),e.setFont(a,r.fontSize),e.setTextMatrix(1,0,0,1,b,s);let c=n.encodeText(i,a);if(c?e.showTextHex(c):e.showText(i),e.endText(),r.strike){let t=s+n.getFontDescent(a,r.fontSize)+r.fontSize*.3;e.drawLine(b,t,b+o,t,r.textColor,.5)}if(r.underline){let t=s+n.getFontDescent(a,r.fontSize)*.5;e.drawLine(b,t,b+o,t,r.textColor,.5)}b+=o}}return}let g=0,_=[];for(let e of l){let t=h(e),r=n.measureText(e.text,t,e.fontSize);_.push({resourceName:t,width:r}),g+=r}let v=_[0]?.resourceName??`F1`,y=OS(s,a,p,n.getFontAscent(v,f),u.top,u.bottom),b=kS(o,a,g,r,u.left,u.right);for(let t=0;t<l.length;t++){let r=l[t],{resourceName:i}=_[t];e.setFillColor(r.textColor),e.beginText(),e.setFont(i,r.fontSize),e.setTextMatrix(1,0,0,1,b,y);let a=n.encodeText(r.text,i);a?e.showTextHex(a):e.showText(r.text),e.endText();let o=_[t].width;if(r.strike){let t=y+n.getFontDescent(i,r.fontSize)+r.fontSize*.3;e.drawLine(b,t,b+o,t,r.textColor,.5)}if(r.underline){let t=y+n.getFontDescent(i,r.fontSize)*.5;e.drawLine(b,t,b+o,t,r.textColor,.5)}b+=_[t].width}}function xS(e,t,n,r,i=1){let{rect:a,wrapText:o}=t,{fontSize:s}=t,c=dS(t,i),l=n.hasEmbeddedFont()?n.getEmbeddedResourceName():n.ensureFont(Vx(t.fontFamily,t.bold,t.italic)),u=hS(t.textRotation),d=u*Math.PI/180,f=Math.cos(d),p=Math.sin(d),m=Math.abs(p),h=Math.abs(f),g=a.width-c.left-c.right,_=a.height-c.top-c.bottom,v;v=m>.01&&h>.01?Math.min(_/m,g/h):m>.01?_/m:g;let y=e=>n.measureText(e,l,s),b;b=o?jS(t.text,y,Math.max(v-1,1)):t.text.split(/\r?\n/);let x=s*lS,S=b.length*x;if(!o){let e=0;for(let t of b){let n=y(t);n>e&&(e=n)}let t=e*h+S*m,n=e*m+S*h;if(g>0&&_>0&&(t>g||n>_)){let e=Math.min(g/t,_/n);e<1&&(s*=e)}}let C=s*lS,ee=n.getFontAscent(l,s),te=Math.abs(u-90)<.01,ne=Math.abs(u+90)<.01;e.setFillColor(t.textColor),te?SS(e,t,b,n,l,s,C,ee,c):ne?CS(e,t,b,n,l,s,C,ee,c):wS(e,t,b,n,l,s,C,ee,f,p,r)}function SS(e,t,n,r,i,a,o,s,c){let{rect:l,horizontalAlign:u,verticalAlign:d}=t,f=n.length*o,p;p=u===`center`?l.x+l.width/2-f/2+s:u===`right`?l.x+l.width-c.right-f+s:l.x+c.left+s;for(let t=0;t<n.length;t++){let s=n[t],u=r.measureText(s,i,a),f=p+t*o,m;m=d===`top`?l.y+l.height-c.top-u:d===`middle`?l.y+(l.height-u)/2:l.y+c.bottom,m=Math.max(m,l.y+c.bottom),e.beginText(),e.setFont(i,a),e.setTextMatrix(0,1,-1,0,f,m),TS(e,r,s,i),e.endText()}}function CS(e,t,n,r,i,a,o,s,c){let{rect:l,horizontalAlign:u,verticalAlign:d}=t,f=n.length*o,p;p=u===`center`?l.x+l.width/2+f/2-o+s:u===`right`?l.x+l.width-c.right-o+s:l.x+c.left+f-o+s;for(let t=0;t<n.length;t++){let s=n[t],u=r.measureText(s,i,a),f=p-t*o,m;m=d===`top`?l.y+l.height-c.top:d===`middle`?l.y+(l.height+u)/2:l.y+c.bottom+u,m=Math.min(m,l.y+l.height-c.top),e.beginText(),e.setFont(i,a),e.setTextMatrix(0,-1,1,0,f,m),TS(e,r,s,i),e.endText()}}function wS(e,t,n,r,i,a,o,s,c,l,u){let{rect:d,horizontalAlign:f,verticalAlign:p}=t,m=dS(t),h=0;for(let e of n){let t=r.measureText(e,i,a);t>h&&(h=t)}let g=n.length*o,_=Math.abs(l),v=Math.abs(c),y=h*v+g*_,b=h*_+g*v,x=gS(t.textRotation,d.height)/2,S=f===`left`?u/2:f===`right`?-u/2:0,C;C=p===`top`?d.y+d.height-m.top-b/2:p===`bottom`?d.y+m.bottom+b/2:d.y+d.height/2;let ee=d.height>0?(C-d.y)/d.height:.5,te=x*2*ee,ne;ne=f===`right`?d.x+d.width-m.right-y/2+S+te:f===`left`?d.x+m.left+y/2+S+te:d.x+d.width/2+S+te;for(let t=0;t<n.length;t++){let u=n[t],d=r.measureText(u,i,a),f=(t-(n.length-1)/2)*o,p=-d/2,m=-s/2-f,h=ne+p*c-m*l,g=C+p*l+m*c;e.beginText(),e.setFont(i,a),e.setTextMatrix(c,l,-l,c,h,g),TS(e,r,u,i),e.endText()}}function TS(e,t,n,r){let i=t.encodeText(n,r);i?e.showTextHex(i):e.showText(n)}function ES(e,t,n,r,i=1){let{rect:a,text:o,fontSize:s,horizontalAlign:c,verticalAlign:l}=t,u=dS(t,i),d=n.hasEmbeddedFont()?n.getEmbeddedResourceName():n.ensureFont(Vx(t.fontFamily,t.bold,t.italic)),f=s*1.3,p=n.getFontAscent(d,s),m=o.split(/\r?\n/),h=s*1.4,g=m.length*h,_;_=c===`center`?a.x+a.width/2-g/2+h/2:c===`right`?a.x+a.width-u.right-g+h/2:a.x+u.left+h/2,e.setFillColor(t.textColor);for(let t=0;t<m.length;t++){let r=m[t],i=_+t*h,o=r.length*f,c;c=l===`middle`?a.y+a.height/2+o/2-p:l===`bottom`?a.y+u.bottom+o-p:a.y+a.height-u.top-p;for(let t of r){if(c<a.y+u.bottom)break;let r=n.measureText(t,d,s);e.beginText(),e.setFont(d,s),e.setTextMatrix(1,0,0,1,i-r/2,c),TS(e,n,t,d),e.endText(),c-=f}}}function DS(e){return`GS${Math.round(e*1e4)}`}function OS(e,t,n,r,i=2,a=i){let o;switch(e){case`top`:o=t.y+t.height-i-r;break;case`middle`:o=t.y+t.height/2+n/2-r;break;default:o=t.y+a+(n-r);break}let s=t.y+t.height-i-r;o>s&&(o=s);let c=t.y+a;return o<c&&(o=c),o}function kS(e,t,n,r=0,i=3,a=i){let o;switch(e){case`center`:o=t.x+(t.width-n)/2;break;case`right`:o=t.x+t.width-a-n;break;default:o=t.x+i+r;break}let s=t.x+i;return o<s&&(o=s),o}function AS(e,t,n,r,i,a,o,s,c,l){if(t.strike){let u=i+s.getFontDescent(o,t.fontSize)+t.fontSize*.3;for(let i=0;i<n.length;i++){let o=u-i*r,s=a(n[i]),d=kS(t.horizontalAlign,t.rect,s,c,l?.left,l?.right);e.drawLine(d,o,d+s,o,t.textColor,.5)}}if(t.underline){let u=s.getFontDescent(o,t.fontSize)*.5;for(let o=0;o<n.length;o++){let s=i-o*r+u,d=a(n[o]),f=kS(t.horizontalAlign,t.rect,d,c,l?.left,l?.right);e.drawLine(f,s,f+d,s,t.textColor,.5)}}}function jS(e,t,n){if(!e)return[``];let r=e.split(/\r?\n/),i=[];for(let e of r){if(!e){i.push(``);continue}let r=e.split(/\s+/),a=``;for(let e of r){if(!a){a=e;continue}let r=a+` `+e;t(r)<=n?a=r:(i.push(a),a=e)}a&&i.push(a)}return i.length>0?i:[``]}function MS(e,t,n,r){let i=t.sheetName,a=r.hasEmbeddedFont()?r.getEmbeddedResourceName():r.ensureFont(Vx(n.defaultFontFamily,!0,!1)),o=r.measureText(i,a,10),s=(t.width-o)/2,c=t.height-n.margins.top+5;e.save(),e.setFillColor({r:.3,g:.3,b:.3}),e.beginText(),e.setFont(a,10),e.setTextMatrix(1,0,0,1,s,c);let l=r.encodeText(i,a);l?e.showTextHex(l):e.showText(i),e.endText(),e.restore()}function NS(e,t,n,r,i){let a=`Page ${t.pageNumber} of ${i}`,o=r.ensureFont(Vx(n.defaultFontFamily,!1,!1)),s=r.measureText(a,o,9),c=(t.width-s)/2,l=Math.max(5,n.margins.bottom-15);e.save(),e.setFillColor({r:.5,g:.5,b:.5}),e.beginText(),e.setFont(o,9),e.setTextMatrix(1,0,0,1,c,l),e.showText(a),e.endText(),e.restore()}let PS={fontSize:54,color:{r:.75,g:.75,b:.75},opacity:.15,rotation:-45,fontFamily:`Helvetica`,bold:!1,italic:!1,repeatSpacingX:200,repeatSpacingY:200},FS={opacity:.15,rotation:0,scale:.5,repeatSpacingX:200,repeatSpacingY:200};function IS(e,t,n,r){return n.type===`text`?BS(e,t,LS(n),r):VS(e,t,RS(n))}function LS(e){return{...e,opacity:zS(e.opacity??PS.opacity),fontSize:Math.max(1,e.fontSize??PS.fontSize),repeatSpacingX:Math.max(10,e.repeatSpacingX??PS.repeatSpacingX),repeatSpacingY:Math.max(10,e.repeatSpacingY??PS.repeatSpacingY)}}function RS(e){return{...e,opacity:zS(e.opacity??FS.opacity),scale:Math.max(.01,e.scale??FS.scale),width:e.width===void 0?void 0:Math.max(1,e.width),height:e.height===void 0?void 0:Math.max(1,e.height),repeatSpacingX:Math.max(10,e.repeatSpacingX??FS.repeatSpacingX),repeatSpacingY:Math.max(10,e.repeatSpacingY??FS.repeatSpacingY)}}function zS(e){return Math.max(0,Math.min(1,e))}function BS(e,t,n,r){let i=n.fontSize??PS.fontSize,a=n.color??PS.color,o=n.opacity??PS.opacity,s=n.rotation??PS.rotation,c=n.fontFamily??PS.fontFamily,l=n.bold??PS.bold,u=n.italic??PS.italic,d=r.hasEmbeddedFont()?r.getEmbeddedResourceName():r.ensureFont(Vx(c,l,u)),f=r.measureText(n.text,d,i),p=i*.7,m=s*Math.PI/180,h=Math.cos(m),g=Math.sin(m),_=o<1,v=_?DS(o):``,y=(t,o)=>{let s=f/2,c=p/2,l=t-s*h+c*g,u=o-s*g-c*h;e.save(),_&&e.setGraphicsState(v),e.setFillColor(a),e.beginText(),e.setFont(d,i),e.setTextMatrix(h,g,-g,h,l,u);let m=r.encodeText(n.text,d);m?e.showTextHex(m):e.showText(n.text),e.endText(),e.restore()};if(n.repeat){let e=n.repeatSpacingX??PS.repeatSpacingX,r=n.repeatSpacingY??PS.repeatSpacingY;US(t.width,t.height,e,r,y)}else{let{cx:e,cy:r}=HS(t,n.position);y(e,r)}return{alphaValues:_?[o]:[],imageXObjects:[]}}function VS(e,t,n){let r=n.opacity??FS.opacity,i=n.rotation??FS.rotation,a=n.scale??FS.scale,o=r<1,s,c;if(n.width!==void 0&&n.height!==void 0)s=n.width,c=n.height;else{let e=Yb(n.data,n.format),r=Math.min(t.width,t.height)*a,i=Math.max(e.width,e.height),o=i>0?r/i:1;s=e.width*o,c=e.height*o}let l=i*Math.PI/180,u=Math.cos(l),d=Math.sin(l),f=o?DS(r):``,p=`WmImg`,m=(t,n)=>{e.save(),o&&e.setGraphicsState(f);let r=s/2,i=c/2,a=t-r*u+i*d,l=n-r*d-i*u;e.concat(s*u,s*d,-c*d,c*u,a,l),e.doXObject(p),e.restore()};if(n.repeat){let e=n.repeatSpacingX??FS.repeatSpacingX,r=n.repeatSpacingY??FS.repeatSpacingY;US(t.width,t.height,e,r,m)}else{let{cx:e,cy:r}=HS(t,n.position);m(e,r)}return{alphaValues:o?[r]:[],imageXObjects:[{name:p,data:n.data,format:n.format}]}}function HS(e,t){return!t||t===`center`?{cx:e.width/2,cy:e.height/2}:{cx:t.x,cy:t.y}}function US(e,t,n,r,i){let a=Math.max(e,t)*.5,o=0;for(let s=-a;s<t+a;s+=r){let t=o%2==1?n/2:0;for(let r=-a;r<e+a;r+=n)i(r+t,s);o++}}function WS(e){if(!e||e.length<6)return null;let t,n,r,i;if(e.length>=8?(t=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),r=parseInt(e.substring(4,6),16),i=parseInt(e.substring(6,8),16)):(t=255,n=parseInt(e.substring(0,2),16),r=parseInt(e.substring(2,4),16),i=parseInt(e.substring(4,6),16)),isNaN(n)||isNaN(r)||isNaN(i))return null;let a=t/255;return{r:n/255,g:r/255,b:i/255,...a<1?{a}:{}}}function GS(e){if(!e)return null;if(e.argb)return WS(e.argb);if(e.theme!==void 0){let t=KS(e.theme);if(!t)return null;let n=e.tint;return n!==void 0&&n!==0?qS(t,n):t}return null}function KS(e){let t=[{r:1,g:1,b:1},{r:0,g:0,b:0},{r:.906,g:.902,b:.902},{r:.267,g:.329,b:.416},{r:.267,g:.447,b:.769},{r:.929,g:.49,b:.192},{r:.647,g:.647,b:.647},{r:1,g:.753,b:0},{r:.357,g:.608,b:.835},{r:.439,g:.678,b:.278}];return e>=0&&e<t.length?t[e]:null}function qS(e,t){let n=e=>t<0?e*(1+t):e+(1-e)*t;return{r:Math.max(0,Math.min(1,n(e.r))),g:Math.max(0,Math.min(1,n(e.g))),b:Math.max(0,Math.min(1,n(e.b)))}}let JS={black:{r:0,g:0,b:0},white:{r:1,g:1,b:1},gridLine:{r:.816,g:.816,b:.816}};function YS(e,t,n){return{fontFamily:e?.name??t,fontSize:e?.size??n,bold:e?.bold??!1,italic:e?.italic??!1,strike:e?.strike??!1,underline:!!(e?.underline&&e.underline!==`none`),textColor:GS(e?.color)??JS.black}}function XS(e){if(!e)return null;if(e.type===`pattern`){if(e.pattern===`solid`&&e.fgColor)return GS(e.fgColor);if(e.pattern===`none`)return null;if(e.fgColor)return GS(e.fgColor)}return e.type===`gradient`&&e.stops&&e.stops.length>0?GS(e.stops[0].color):null}function ZS(e){switch(e){case`thin`:return .25;case`medium`:return .5;case`thick`:return 1;case`double`:return .25;case`hair`:return .1;case`dotted`:return .25;case`dashed`:return .25;case`dashDot`:return .25;case`dashDotDot`:return .25;case`slantDashDot`:return .25;case`mediumDashed`:return .5;case`mediumDashDot`:return .5;case`mediumDashDotDot`:return .5;default:return .25}}function QS(e){switch(e){case`dotted`:return[1,1];case`dashed`:case`mediumDashed`:return[3,2];case`dashDot`:case`mediumDashDot`:return[3,1,1,1];case`dashDotDot`:case`mediumDashDotDot`:return[3,1,1,1,1,1];case`slantDashDot`:return[4,2,1,2];case`hair`:return[.5,.5];default:return[]}}function $S(e){return!e||!e.style?null:{width:ZS(e.style),color:GS(e.color)??JS.black,dashPattern:QS(e.style),isDouble:e.style===`double`}}function eC(e){return e?{top:$S(e.top),right:$S(e.right),bottom:$S(e.bottom),left:$S(e.left)}:{top:null,right:null,bottom:null,left:null}}function tC(e){if(!e?.horizontal)return`left`;switch(e.horizontal){case`center`:case`centerContinuous`:return`center`;case`right`:return`right`;default:return`left`}}function nC(e){if(!e?.vertical)return`bottom`;switch(e.vertical){case`top`:return`top`;case`middle`:return`middle`;default:return`bottom`}}let rC=8.43;function iC(e,t,n){if(e?.horizontal&&e.horizontal!==`general`)return tC(e);if(t!==void 0)switch(t){case $.Number:case $.Date:return`right`;case $.Boolean:case $.Error:return`center`;case $.Formula:return typeof n==`number`||n instanceof Date?`right`:typeof n==`boolean`?`center`:`left`;default:return`left`}return`left`}async function aC(e,t,n){let r=oC(e,t,n);if(!r)return[cC(e,t)];let i=[],a=r.rowPages.length*r.colGroups.length;for(let o of r.rowPages)for(let s of r.colGroups)i.push(sC(r,o,s,i.length,e,t,n)),i.length<a&&await nl();return i.length>0&&e.images&&CC(e.images,i,r.scaleFactor),i}function oC(e,t,n){let{margins:r}=t,i=t.pageSize.width,a=t.pageSize.height;t.orientation===`landscape`&&([i,a]=[a,i]);let o=i-r.left-r.right,s=a-r.top-r.bottom,c=t.showSheetNames?20:0,l=t.showPageNumbers?20:0,u=s-c-l,d=dC(e),{columnWidths:f,visibleCols:p}=fC(e,d);if(p.length===0)return null;let m=f.reduce((e,t)=>e+t,0),h=t.scale;if(t.fitToPage&&m>0){let e=o/m;e<1&&(h*=e)}let g=f.map(e=>e*h),{rowHeights:_,visibleRows:v}=pC(e,h,d,n,t),y=_C(e),b=vC(_,u,typeof t.repeatRows==`number`?t.repeatRows:0,gC(e,v)),x=yC(g,o,e,p);return{pageWidth:i,pageHeight:a,contentWidth:o,headerHeight:c,scaleFactor:h,scaledColumnWidths:g,rowHeights:_,visibleRows:v,visibleCols:p,mergeMap:y,rowPages:b,colGroups:x,margins:r}}function sC(e,t,n,r,i,a,o){let{scaledColumnWidths:s,rowHeights:c,visibleRows:l,visibleCols:u,mergeMap:d,pageWidth:f,pageHeight:p,contentWidth:m,headerHeight:h,scaleFactor:g,margins:_}=e,v=[],y=n.map(e=>s[e]),b=y.reduce((e,t)=>e+t,0),x=[],S=_.left;b<m&&(S=_.left+(m-b)/2);for(let e of y)x.push(S),S+=e;let C=[],ee=[],te=p-_.top-h;for(let e of t){let t=c[e]??15*g;C.push(te),ee.push(t),te-=t}let ne=new Map;for(let e=0;e<t.length;e++){let r=t[e],s=l[r];for(let t=0;t<n.length;t++){let c=u[n[t]],f=`${s}:${c}`,p=d.get(f);if(p&&!p.isMaster)continue;let m=i.rows.get(s)?.cells.get(c),h=1,_=1;if(p&&p.isMaster){let e=c+p.colSpan-1;h=0;for(let r=t;r<n.length&&u[n[r]]<=e;r++)h++;let i=s+p.rowSpan-1;_=0;for(let e=r;e<l.length&&l[e]<=i;e++)_++;h=Math.max(h,1),_=Math.max(_,1)}let b=x[t],S=C[e],te=0;for(let e=0;e<h&&t+e<y.length;e++)te+=y[t+e];let re=0;for(let t=0;t<_&&e+t<ee.length;t++)re+=ee[e+t];let ie=S-re;v.push(bC(m,b,ie,te,re,h,_,a,o,g));let ae=v[v.length-1];p?.isMaster&&wC(ae,p,s,c,i),ne.set(`${e}:${t}`,ae)}}return SC(ne,t.length,n.length),TC(ne,t,n,l,u,y,d,o),{pageNumber:r+1,options:a,cells:v,width:f,height:p,sheetName:i.name,sheetCols:n.map(e=>u[e]),columnOffsets:x,columnWidths:y,sheetRows:t.map(e=>l[e]),rowYPositions:C,rowHeights:ee,images:[],scaleFactor:g}}function cC(e,t){let n=t.pageSize.width,r=t.pageSize.height;return t.orientation===`landscape`&&([n,r]=[r,n]),{pageNumber:1,options:t,cells:[],width:n,height:r,sheetName:e.name,sheetCols:[],columnOffsets:[],columnWidths:[],sheetRows:[],rowYPositions:[],rowHeights:[],images:[],scaleFactor:1}}function lC(e){let t=e.replace(/\$/g,``).toUpperCase(),n=0,r=0;for(;r<t.length&&t.charCodeAt(r)>=65&&t.charCodeAt(r)<=90;)n=n*26+(t.charCodeAt(r)-64),r++;let i=parseInt(t.substring(r),10);return{c:n-1,r:i-1}}function uC(e){let t=e.indexOf(`:`);if(t===-1){let t=lC(e);return{s:t,e:{...t}}}return{s:lC(e.slice(0,t)),e:lC(e.slice(t+1))}}function dC(e){let t=e.pageSetup?.printArea;if(!t||typeof t!=`string`)return null;let n=t.split(`&&`)[0].trim();if(!n)return null;try{let e=uC(n);return{startRow:e.s.r+1,endRow:e.e.r+1,startCol:e.s.c+1,endCol:e.e.c+1}}catch{return null}}function fC(e,t){let n=e.bounds;if(!(n.top>0&&n.left>0))return{columnWidths:[],visibleCols:[]};let r=t?.startCol??n.left,i=t?.endCol??n.right,a=[],o=[];for(let t=r;t<=i;t++){let n=e.columns.get(t);if(n?.hidden)continue;let r=(n?.width??rC)*7+5,i=Math.max(r*uS,3);a.push(i),o.push(t)}return{columnWidths:a,visibleCols:o}}function pC(e,t,n,r,i){let a=e.bounds;if(a.top<=0)return{rowHeights:[],visibleRows:[]};let o=n?.startRow??a.top,s=n?.endRow??a.bottom,c=[],l=[];for(let n=o;n<=s;n++){let a=e.rows.get(n);if(a?.hidden)continue;let o;if(a?.height&&a.customHeight)o=a.height;else if(a?.height)o=a.height;else if(o=15,a)for(let n of a.cells.values()){let a=mC(n),s=hC(n,a,t,e,r,i),c=a*lS,l=n.style?.border?.top?.style?ZS(n.style.border.top.style)/2:0,u=n.style?.border?.bottom?.style?ZS(n.style.border.bottom.style)/2:0,d=a+(s-1)*c+(2+l+u)*2;d>o&&(o=d)}c.push(o*t),l.push(n)}return{rowHeights:c,visibleRows:l}}function mC(e){let t=e.style?.font?.size??11;if(e.type===$.RichText){let n=e.value;if(n&&typeof n==`object`&&`richText`in n){let e=n.richText;for(let n of e){let e=n.font?.size??t;e>t&&(t=e)}}}return t}function hC(e,t,n,r,i,a){let o=typeof e.text==`string`?e.text:String(e.text??``),s=Math.max(1,(o.match(/\n/g)??[]).length+1);if(!e.style?.alignment?.wrapText||o.length===0)return s;let c=((r.columns.get(e.col)?.width??rC)*7+5)*uS*n,l=e.style.alignment.indent??0,u=e.style?.border?.left?.style?ZS(e.style.border.left.style)/2:0,d=e.style?.border?.right?.style?ZS(e.style.border.right.style)/2:0,f=3+u+(3+d)+l*10,p=Math.max(c-f,1),m=t*n,h=YS(e.style.font,a.defaultFontFamily,a.defaultFontSize),g=Vx(h.fontFamily,h.bold,h.italic),_=i.hasEmbeddedFont()?i.getEmbeddedResourceName():i.ensureFont(g),v=jS(o,e=>i.measureText(e,_,m),p);return Math.max(s,v.length)}function gC(e,t){let n=new Set,r=e.rowBreaks??[];if(r.length===0)return n;let i=new Map;for(let e=0;e<t.length;e++)i.set(t[e],e);for(let e of r){let t=i.get(e);t!==void 0&&n.add(t+1)}return n}function _C(e){let t=new Map,n=e.merges;if(!n||n.length===0)return t;for(let e of n){let n=uC(e),r=n.s.r+1,i=n.s.c+1,a=n.e.r+1,o=n.e.c+1,s=a-r+1,c=o-i+1;for(let e=r;e<=a;e++)for(let n=i;n<=o;n++)t.set(`${e}:${n}`,{isMaster:e===r&&n===i,rowSpan:s,colSpan:c})}return t}function vC(e,t,n,r){if(e.length===0)return[[]];let i=[],a=[],o=0,s=!0,c=0,l=()=>{c=0;for(let r=0;r<n&&r<e.length&&!(o+e[r]>t&&a.length>0);r++)a.push(r),o+=e[r],c++};for(let u=0;u<e.length;u++){let d=e[u],f=t;for(;;){let e=r.has(u)&&a.length>0;if((e||o+d>f)&&a.length>0){if(!e&&!s&&a.length>0&&a.length===c){a=[],o=0,c=0;continue}i.push(a),a=[],o=0,c=0,s=!1,l();continue}if(!s&&u<n&&a.includes(u))break;a.push(u),o+=d;break}}return a.length>0&&i.push(a),i.length>0?i:[[]]}function yC(e,t,n,r){if(e.length===0)return[[]];let i=new Set,a=n.colBreaks??[];if(a.length>0){let e=new Map;for(let t=0;t<r.length;t++)e.set(r[t],t);for(let t of a){let n=e.get(t);n!==void 0&&i.add(n+1)}}let o=[],s=[],c=0;for(let n=0;n<e.length;n++){let r=e[n];(i.has(n)&&s.length>0||c+r>t+.01)&&s.length>0&&(o.push(s),s=[],c=0),s.push(n),c+=r}return s.length>0&&o.push(s),o.length>0?o:[Array.from({length:e.length},(e,t)=>t)]}function bC(e,t,n,r,i,a,o,s,c,l){let u=e?.text??``,d=e?.style??{},f=YS(d.font,s.defaultFontFamily,s.defaultFontSize),p=f.fontSize*l;if(c.hasEmbeddedFont())c.trackText(u);else{let e=Vx(f.fontFamily,f.bold,f.italic);c.ensureFont(e)}let m=EC(e,s,c,l),h=eC(d.border);return{text:u,rect:{x:t,y:n,width:r,height:i},fontFamily:f.fontFamily,fontSize:p,bold:f.bold,italic:f.italic,strike:f.strike,underline:f.underline,textColor:f.textColor,fillColor:XS(d.fill),horizontalAlign:iC(d.alignment,e?.type,e?.result),verticalAlign:nC(d.alignment),wrapText:d.alignment?.wrapText??!1,borders:h,borderInsets:{top:(h.top?.width??0)/2,right:(h.right?.width??0)/2,bottom:(h.bottom?.width??0)/2,left:(h.left?.width??0)/2},colSpan:a,rowSpan:o,hyperlink:e?.hyperlink??null,richText:m,indent:d.alignment?.indent??0,textRotation:d.alignment?.textRotation===255?`vertical`:d.alignment?.textRotation??0,textOverflowWidth:0}}function xC(e){let t=e.width*1e3;e.dashPattern.length===0&&(t+=100),e.isDouble&&(t+=50);let n=e.color.r+e.color.g+e.color.b;return t+=(3-n)*10,t}function SC(e,t,n){for(let r=0;r<t;r++)for(let t=0;t<n;t++){let n=e.get(`${r}:${t}`);if(n){if(n.borders.right){let i=e.get(`${r}:${t+1}`);if(i?.borders.left){let e=xC(n.borders.right);xC(i.borders.left)>e?(n.borderInsets.right=i.borders.left.width/2,n.borders.right=null):(i.borderInsets.left=n.borders.right.width/2,i.borders.left=null)}}if(n.borders.bottom){let i=e.get(`${r+1}:${t}`);if(i?.borders.top){let e=xC(n.borders.bottom);xC(i.borders.top)>e?(n.borderInsets.bottom=i.borders.top.width/2,n.borders.bottom=null):(i.borderInsets.top=n.borders.bottom.width/2,i.borders.top=null)}}}}}function CC(e,t,n){for(let r of e){let e=r.range.tl,i=(e.nativeCol??e.col??0)+1,a=(e.nativeRow??e.row??0)+1,o=t.find(e=>e.sheetCols.includes(i)&&e.sheetRows.includes(a));if(!o)continue;let s=o.sheetCols.indexOf(i),c=o.sheetRows.indexOf(a),l=o.columnOffsets[s]??o.options.margins.left,u=o.rowYPositions[c]??o.height-o.options.margins.top-(o.options.showSheetNames?20:0),d=((e.nativeColOff??0)/12700||0)*n,f=((e.nativeRowOff??0)/12700||0)*n,p=l+d,m=u-f,h=100,g=100;if(r.range.ext)h=(r.range.ext.width??100)*.75*n,g=(r.range.ext.height??100)*.75*n;else if(r.range.br){let e=r.range.br,t=(e.nativeCol??e.col??0)+1,i=(e.nativeRow??e.row??0)+1,a=o.sheetCols.indexOf(t),l=o.sheetRows.indexOf(i),u=a>=0?o.columnOffsets[a]:p+(o.columnWidths[s]??100),d=l>=0?o.rowYPositions[l]:m-(o.rowHeights[c]??100),f=((e.nativeColOff??0)/12700||0)*n,_=((e.nativeRowOff??0)/12700||0)*n,v=u+f,y=d-_;h=v-p,g=m-y}o.images.push({data:r.data,format:r.format,rect:{x:p,y:m-g,width:Math.abs(h),height:Math.abs(g)}})}}function wC(e,t,n,r,i){if(t.colSpan>1){let a=r+t.colSpan-1,o=i.rows.get(n)?.cells.get(a);if(o?.style?.border?.right){let t=eC({right:o.style.border.right});t.right&&(e.borders.right=t.right,e.borderInsets.right=t.right.width/2)}}if(t.rowSpan>1){let a=n+t.rowSpan-1,o=i.rows.get(a)?.cells.get(r);if(o?.style?.border?.bottom){let t=eC({bottom:o.style.border.bottom});t.bottom&&(e.borders.bottom=t.bottom,e.borderInsets.bottom=t.bottom.width/2)}}}function TC(e,t,n,r,i,a,o,s){for(let c=0;c<t.length;c++)for(let l=0;l<n.length;l++){let u=e.get(`${c}:${l}`);if(!u||u.wrapText||u.colSpan>1||!u.text||u.richText||typeof u.textRotation==`number`&&u.textRotation!==0||u.textRotation===`vertical`)continue;let d=s.hasEmbeddedFont()?s.getEmbeddedResourceName():s.ensureFont(Vx(u.fontFamily,u.bold,u.italic)),f=s.measureText(u.text,d,u.fontSize),p=u.rect.width-(3+u.borderInsets.left)-(3+u.borderInsets.right);if(f<=p)continue;let m=f-p,h=0;for(let s=l+1;s<n.length;s++){let l=r[t[c]],u=i[n[s]];if(o.has(`${l}:${u}`)||e.get(`${c}:${s}`)?.text||(h+=a[s],h>=m))break}h>0&&(u.textOverflowWidth=Math.min(m,h))}}function EC(e,t,n,r){if(!e||e.type!==$.RichText)return null;let i=e.value;if(!i||typeof i!=`object`||!(`richText`in i))return null;let a=i.richText;return a.length===0?null:a.map(e=>{let i=YS(e.font,t.defaultFontFamily,t.defaultFontSize);if(n.hasEmbeddedFont())n.trackText(e.text);else{let e=Vx(i.fontFamily,i.bold,i.italic);n.ensureFont(e)}return{text:e.text,fontFamily:i.fontFamily,fontSize:i.fontSize*r,bold:i.bold,italic:i.italic,strike:i.strike,underline:i.underline,textColor:i.textColor}})}async function DC(e,t){let n=OC(e,t);for(let e of n.sheets)await kC(n,e,t);return AC(n,e,t)}function OC(e,t){let n=LC(e,t?.sheets);if(n.length===0)throw new dx(`No sheets to export. The workbook is empty or no sheets matched.`);let r=new Hx,i=new gx;if(t?.font)try{let e=Jx(t.font);r.registerEmbeddedFont(e)}catch(e){throw new fx(`Failed to parse TrueType font`,{cause:e})}return{sheets:n,fontManager:r,writer:i,allPages:[]}}async function kC(e,t,n){try{let r=await aC(t,RC(n,t),e.fontManager);e.allPages.push(...r)}catch(e){throw new fx(`Failed to layout sheet "${t.name}"`,{cause:e})}}async function AC(e,t,n){let{allPages:r,fontManager:i,writer:a,sheets:o}=e,s=RC(n,o[0]);jC(r,s,o),MC(r),NC(r,i);let c=s.watermark;if(c&&c.type===`text`){let e=c.fontFamily??`Helvetica`,t=c.bold??!1,n=c.italic??!1;i.hasEmbeddedFont()?i.trackText(c.text):i.ensureFont(Vx(e,t,n))}let{pageObjNums:l,sheetFirstPage:u,pagesTreeObjNum:d}=await PC(r,i,a,i.writeFontResources(a),c);return IC(a,l,d,u,s,t,n)}function jC(e,t,n){e.length===0&&e.push({pageNumber:1,options:t,cells:[],width:t.pageSize.width,height:t.pageSize.height,sheetName:n[0]?.name??`Sheet1`,sheetCols:[],columnOffsets:[],columnWidths:[],sheetRows:[],rowYPositions:[],rowHeights:[],images:[],scaleFactor:1})}function MC(e){for(let t=0;t<e.length;t++)e[t].pageNumber=t+1}function NC(e,t){if(t.hasEmbeddedFont())for(let n of e)n.options.showSheetNames&&t.trackText(n.sheetName);for(let n of e)n.options.showPageNumbers&&t.ensureFont(Vx(n.options.defaultFontFamily,!1,!1));if(!t.hasEmbeddedFont())for(let n of e)n.options.showSheetNames&&t.ensureFont(Vx(n.options.defaultFontFamily,!0,!1))}async function PC(e,t,n,r,i){let a=[],o=n.allocObject(),s=new Map,c=e.length;for(let l=0;l<e.length;l++)FC(e[l],t,n,r,c,a,o,s,i),l<e.length-1&&await nl();return{pageObjNums:a,sheetFirstPage:s,pagesTreeObjNum:o}}function FC(e,t,n,r,i,a,o,s,c){try{let{stream:l,alphaValues:u}=fS(e,e.options,t,i),d=new Map;if(e.images.length>0)for(let t=0;t<e.images.length;t++){let r=e.images[t],i=`Im${t+1}`,a=Qb(n,r.data,r.format);d.set(i,a),l.drawImage(i,r.rect.x,r.rect.y,r.rect.width,r.rect.height)}let f;if(c&&UC(c,e)){let r=new ox,i=IS(r,e,c,t);for(let e of i.alphaValues)u.add(e);for(let e of i.imageXObjects){let t=Qb(n,e.data,e.format);d.set(e.name,t)}f=n.allocObject(),n.addStreamObject(f,new Q,r)}let p=n.allocObject();n.addStreamObject(p,new Q,l);let m;m=f?(c?.placement??`under`)===`over`?`[${Z(p)} ${Z(f)}]`:`[${Z(f)} ${Z(p)}]`:Z(p);let h=n.allocObject(),g=t.buildFontDictString(r),_=new Q().set(`Font`,g);if(d.size>0){let e=[`<<`];for(let[t,n]of d)e.push(`/${t} ${Z(n)}`);e.push(`>>`),_.set(`XObject`,e.join(`
|
|
452
|
-
`))}if(
|
|
453
|
-
`))}n.addObject(h,_);let v=[];for(let t of e.cells)if(t.hyperlink){let e=n.allocObject(),r=`[${X(t.rect.x)} ${X(t.rect.y)} ${X(t.rect.x+t.rect.width)} ${X(t.rect.y+t.rect.height)}]`,i=new Q().set(`Type`,`/Annot`).set(`Subtype`,`/Link`).set(`Rect`,r).set(`Border`,`[0 0 0]`).set(`A`,`<< /Type /Action /S /URI /URI (${t.hyperlink.replace(/[()\\]/g,`\\$&`)}) >>`);n.addObject(e,i),v.push(e)}let y=n.addPage({parentRef:o,width:e.width,height:e.height,contentsRef:m,resourcesRef:h,annotRefs:v.length>0?v:void 0});a.push(y),s.has(e.sheetName)||s.set(e.sheetName,a.length-1)}catch(t){throw new fx(`Failed to render page ${e.pageNumber} of "${e.sheetName}"`,{cause:t})}}function IC(e,t,n,r,i,a,o){let s=`[`+t.map(e=>Z(e)).join(` `)+`]`,c=new Q().set(`Type`,`/Pages`).set(`Kids`,s).set(`Count`,String(t.length));e.addObject(n,c);let l;if(r.size>1&&(l=HC(e,r,t)),e.addCatalog(n,l),e.addInfoDict({title:i.title||a.title||void 0,author:i.author||a.creator||void 0,subject:i.subject||a.subject||void 0,creator:i.creator}),o?.encryption){let t=nx(o.encryption);e.setEncryption(t)}return e.build()}function LC(e,t){let n=e.sheets;if(!t||t.length===0)return n.filter(e=>e.state!==`hidden`&&e.state!==`veryHidden`);let r=[];for(let e of t)if(typeof e==`string`){let t=n.find(t=>t.name.toLowerCase()===e.toLowerCase());t&&r.push(t)}else if(typeof e==`number`){let t=n[e-1];t&&r.push(t)}return r}function RC(e,t){let n=t?.pageSetup,r=BC(e?.pageSize,n?.paperSize),i=e?.orientation??(n?.orientation===`landscape`?`landscape`:`portrait`),a=VC(e?.margins,n?.margins),o=WS(e?.gridLineColor??`FFD0D0D0`)??{r:.816,g:.816,b:.816},s=e?.repeatRows??!1;if(s===!1&&n?.printTitlesRow){let e=n.printTitlesRow.match(/^(\d+)(?::(\d+))?$/);e&&(s=parseInt(e[2]??e[1],10))}return{pageSize:r,orientation:i,margins:a,fitToPage:e?.fitToPage===void 0?!0:e.fitToPage,scale:Math.max(.1,Math.min(3,e?.scale??(e?.fitToPage===void 0||e.fitToPage?1:n?.scale?n.scale/100:1))),showGridLines:e?.showGridLines??n?.showGridLines??!1,gridLineColor:o,repeatRows:s,defaultFontFamily:e?.defaultFontFamily??`Helvetica`,defaultFontSize:e?.defaultFontSize??11,showSheetNames:e?.showSheetNames??!1,showPageNumbers:e?.showPageNumbers??!1,title:e?.title??``,author:e?.author??``,subject:e?.subject??``,creator:e?.creator??`excelts`,watermark:e?.watermark}}let zC={1:cS.LETTER,5:cS.LEGAL,9:cS.A4,8:cS.A3,11:cS.A5,17:cS.TABLOID};function BC(e,t){return e?typeof e==`string`?cS[e]??cS.A4:e:t===void 0?cS.A4:zC[t]??cS.A4}function VC(e,t){let n=t?{top:t.top*72,right:t.right*72,bottom:t.bottom*72,left:t.left*72}:{top:72,right:72,bottom:72,left:72};return e?{top:e.top??n.top,right:e.right??n.right,bottom:e.bottom??n.bottom,left:e.left??n.left}:n}function HC(e,t,n){let r=e.allocObject(),i=Array.from(t.entries()),a=[];for(let t=0;t<i.length;t++)a.push(e.allocObject());for(let t=0;t<i.length;t++){let[o,s]=i[t],c=n[s],l=new Q().set(`Title`,Ib(o)).set(`Parent`,Z(r)).set(`Dest`,`[${Z(c)} /Fit]`);t>0&&l.set(`Prev`,Z(a[t-1])),t<i.length-1&&l.set(`Next`,Z(a[t+1])),e.addObject(a[t],l)}let o=new Q().set(`Type`,`/Outlines`).set(`First`,Z(a[0])).set(`Last`,Z(a[a.length-1])).set(`Count`,String(i.length));return e.addObject(r,o),r}function UC(e,t){if(e.pages&&e.pages.length>0&&!e.pages.includes(t.pageNumber))return!1;if(e.sheets&&e.sheets.length>0){let n=t.sheetName.toLowerCase();if(!e.sheets.some(e=>e.toLowerCase()===n))return!1}return!0}async function WC(e,t){return DC(GC(e),t)}function GC(e){return Array.isArray(e)?{sheets:[KC({data:e})]}:`sheets`in e?{title:e.title,creator:e.author,sheets:e.sheets.map((e,t)=>KC(e,t))}:{sheets:[KC(e)]}}function KC(e,t){let n=e.data,r=e.name??`Sheet${(t??0)+1}`,i=e.columns?.map(e=>typeof e==`number`?void 0:e.header),a=i?.some(e=>e!==void 0)??!1,o=0;for(let e of n)e.length>o&&(o=e.length);let s=Math.max(o,e.columns?.length??0),c=n.length+ +!!a;if(e.images)for(let t of e.images){let e=t.col+1,n=t.row+1;e>s&&(s=e),n>c&&(c=n)}if(s===0)return{name:r,bounds:{top:0,left:0,bottom:0,right:0},columns:new Map,rows:new Map};let l=new Map;if(e.columns)for(let t=0;t<e.columns.length;t++){let n=e.columns[t],r=typeof n==`number`?n:n.width;l.set(t+1,{width:r??12})}for(let e=1;e<=s;e++)l.has(e)||l.set(e,{width:12});let u=new Map,d=1;if(a&&i){let e=new Map;for(let t=0;t<i.length;t++){let n=i[t];n!==void 0&&e.set(t+1,{type:$.String,value:n,text:n,col:t+1,style:{font:{bold:!0}}})}u.set(1,{cells:e}),d=2}for(let e=0;e<n.length;e++){let t=e+d,r=n[e],i=new Map;for(let e=0;e<r.length;e++){let t=qC(r[e],e+1);t&&i.set(e+1,t)}u.set(t,{cells:i})}let f;if(e.images&&e.images.length>0){f=e.images.map(e=>({data:e.data,format:e.format,range:{tl:{col:e.col,row:e.row},ext:{width:e.width,height:e.height}}}));for(let e=1;e<=s;e++)l.has(e)||l.set(e,{width:12});for(let e=1;e<=c;e++)u.has(e)||u.set(e,{cells:new Map})}return{name:r,bounds:{top:1,left:1,bottom:c,right:s},columns:l,rows:u,images:f}}function qC(e,t){if(e==null)return null;if(typeof e==`object`&&!(e instanceof Date)&&`value`in e){let n=e,r=qC(n.value,t);if(!r)return null;let i={};return(n.bold||n.italic||n.fontSize||n.fontColor)&&(i.font={bold:n.bold,italic:n.italic,size:n.fontSize,color:n.fontColor?{argb:n.fontColor}:void 0}),n.fillColor&&(i.fill={type:`pattern`,pattern:`solid`,fgColor:{argb:n.fillColor}}),n.align&&(i.alignment={horizontal:n.align}),r.style=i,r}return typeof e==`string`?{type:$.String,value:e,text:e,col:t}:typeof e==`number`?{type:$.Number,value:e,text:String(e),col:t}:typeof e==`boolean`?{type:$.Boolean,value:e,text:e?`TRUE`:`FALSE`,col:t}:e instanceof Date?{type:$.Date,value:e,text:e.toLocaleDateString(),col:t}:null}async function JC(e,t){return DC(YC(e),t)}function YC(e){return{title:e.title||void 0,creator:e.creator||void 0,subject:e.subject||void 0,sheets:e.worksheets.map(t=>XC(t,e))}}function XC(e,t){let n=e.dimensions,r=n&&n.model.top>0&&n.model.left>0,i=r?{top:n.model.top,left:n.model.left,bottom:n.model.bottom,right:n.model.right}:{top:0,left:0,bottom:0,right:0},a=new Map;if(r)for(let t=i.left;t<=i.right;t++){let n=e.getColumn(t);a.set(t,{hidden:n.hidden||void 0,width:n.width??void 0})}let o=new Map;if(r)for(let t=i.top;t<=i.bottom;t++){let n=e.findRow(t);if(!n)continue;let r=new Map;n.eachCell({includeEmpty:!0},e=>{let t=e.type!==0&&e.type!==1,n=e.style&&(e.style.border&&(e.style.border.top||e.style.border.right||e.style.border.bottom||e.style.border.left)||e.style.fill||e.style.font);(t||n)&&r.set(e.col,ZC(e))}),o.set(t,{hidden:n.hidden||void 0,height:n.height??void 0,customHeight:n.customHeight||void 0,cells:r})}let s=e.hasMerges&&e.model.mergeCells?[...e.model.mergeCells]:void 0,c=e.pageSetup,l=c?{orientation:c.orientation,paperSize:c.paperSize,margins:c.margins?{left:c.margins.left,right:c.margins.right,top:c.margins.top,bottom:c.margins.bottom}:void 0,scale:c.scale,printTitlesRow:c.printTitlesRow,showGridLines:c.showGridLines,printArea:c.printArea}:void 0,u=e.rowBreaks?.map(e=>e.id),d=e.colBreaks?.map(e=>e.id),f=lw(e,t);if(f){for(let e of f){let t=e.range.tl,n=(t.nativeCol??t.col??0)+1,r=(t.nativeRow??t.row??0)+1;if(i.top===0&&i.left===0&&(i.top=1,i.left=1),n>i.right&&(i.right=n),r>i.bottom&&(i.bottom=r),e.range.br){let t=e.range.br,n=(t.nativeCol??t.col??0)+1,r=(t.nativeRow??t.row??0)+1;n>i.right&&(i.right=n),r>i.bottom&&(i.bottom=r)}}for(let t=i.left;t<=i.right;t++)if(!a.has(t)){let n=e.getColumn(t);a.set(t,{hidden:n.hidden||void 0,width:n.width??void 0})}for(let e=i.top;e<=i.bottom;e++)o.has(e)||o.set(e,{cells:new Map})}return{name:e.name,state:e.state??`visible`,bounds:i,columns:a,rows:o,merges:s,pageSetup:l,rowBreaks:u,colBreaks:d,images:f}}function ZC(e){let t=QC(e.type),n=$C(e),r=nw(e.style);return{type:t,value:tw(e),text:n,style:r,hyperlink:e.hyperlink||void 0,result:e.result??void 0,col:e.col}}function QC(e){switch(e){case 0:return $.Empty;case 1:return $.Merge;case 2:return $.Number;case 3:case 7:return $.String;case 4:return $.Date;case 5:return $.Hyperlink;case 6:return $.Formula;case 8:return $.RichText;case 9:return $.Boolean;case 10:return $.Error;default:return $.String}}function $C(e){if(!e)return``;switch(e.type){case 0:case 1:return``;case 8:case 5:return e.text??``;case 10:return e.value?.error??e.text??``;case 6:{let t=e.result;return t==null?e.text??``:typeof t==`object`&&`error`in t?t.error:ew(t,e.style?.numFmt)}default:{let t=e.value;return t==null?``:ew(t,e.style?.numFmt)}}}function ew(e,t){let n=typeof t==`string`?t:t?.formatCode;if(n&&(typeof e==`number`||e instanceof Date||typeof e==`boolean`))try{return Al(e,n)}catch{}return e instanceof Date?e.toLocaleDateString():String(e)}function tw(e){if(e.type===8){let t=e.value;if(t?.richText)return{richText:t.richText.map(e=>({text:e.text,font:e.font?rw(e.font):void 0}))}}return e.value}function nw(e){if(e)return{font:e.font?rw(e.font):void 0,numFmt:e.numFmt,fill:e.fill?aw(e.fill):void 0,border:e.border?sw(e.border):void 0,alignment:e.alignment?cw(e.alignment):void 0}}function rw(e){return{name:e.name,size:e.size,bold:e.bold,italic:e.italic,strike:e.strike,underline:e.underline,color:e.color?iw(e.color):void 0}}function iw(e){return{argb:e.argb,theme:e.theme,tint:e.tint}}function aw(e){let t={type:e.type??`pattern`,pattern:e.pattern,fgColor:e.fgColor?iw(e.fgColor):void 0};return e.stops&&(t.stops=e.stops.map(e=>({color:iw(e.color)}))),t}function ow(e){return{style:e.style,color:e.color?iw(e.color):void 0}}function sw(e){return{top:e.top?ow(e.top):void 0,right:e.right?ow(e.right):void 0,bottom:e.bottom?ow(e.bottom):void 0,left:e.left?ow(e.left):void 0}}function cw(e){return{horizontal:e.horizontal,vertical:e.vertical,wrapText:e.wrapText,indent:e.indent,textRotation:e.textRotation}}function lw(e,t){let n=e.getImages?.();if(!n||!Array.isArray(n)||n.length===0)return;let r=[];for(let e of n){if(!e.range?.tl)continue;let n=e.imageId,i=t.getImage?.(Number(n));if(!i)continue;let a;if(i.buffer instanceof Uint8Array?a=i.buffer:i.base64&&(a=kc(i.base64)),!a||a.length===0)continue;let o=i.extension;o!==`jpeg`&&o!==`png`||r.push({data:a,format:o,range:{tl:{col:e.range.tl.col??0,row:e.range.tl.row??0,nativeCol:e.range.tl.nativeCol,nativeRow:e.range.tl.nativeRow,nativeColOff:e.range.tl.nativeColOff,nativeRowOff:e.range.tl.nativeRowOff},br:e.range.br?{col:e.range.br.col??0,row:e.range.br.row??0,nativeCol:e.range.br.nativeCol,nativeRow:e.range.br.nativeRow,nativeColOff:e.range.br.nativeColOff,nativeRowOff:e.range.br.nativeRowOff}:void 0,ext:e.range.ext?{width:e.range.ext.width,height:e.range.ext.height}:void 0}})}return r.length>0?r:void 0}return e.Anchor=Rp,e.BaseError=n,e.Cell=B,e.Column=gc,e.ColumnOutOfBoundsError=Dr,e.CsvFormatterStream=Sr,e.CsvParserStream=br,e.DataValidations=zp,e.DateFormatter=tt,e.DateParser=$e,e.DefinedNames=$r,e.DocumentType=Vs,e.Enums=Ws,e.ErrorValue=Us,e.ExcelDownloadError=Fr,e.ExcelError=j,e.ExcelFileError=Nr,e.ExcelNotSupportedError=Mr,e.ExcelStreamStateError=Pr,e.FormCheckbox=Sg,e.FormulaType=zs,e.Image=Cg,e.ImageError=Rr,e.InvalidAddressError=Er,e.InvalidValueTypeError=Ar,e.MarkdownError=Yy,e.MarkdownParseError=Xy,e.MaxItemsExceededError=zr,e.MergeConflictError=kr,e.Note=_c,e.PageSizes=cS,e.PaperSize=Cb,e.PdfError=dx,e.PdfFontError=px,e.PdfRenderError=fx,e.PdfStructureError=mx,e.PivotTableError=Ir,e.Range=N,e.ReadingOrder=Hs,e.RelationshipType=Bs,e.Row=Ql,e.RowOutOfBoundsError=Or,e.Table=Ug,e.TableError=Lr,e.ValueType=Rs,e.Workbook=Sb,e.WorkbookReader=hf,e.WorkbookWriter=hg,e.Worksheet=K_,e.WorksheetNameError=Tr,e.WorksheetReader=$l,e.WorksheetWriter=Ch,e.XmlParseError=jr,e.base64ToUint8Array=kc,e.concatUint8Arrays=E,e.createCsvFormatterStream=Cr,e.createCsvParserStream=xr,e.createTextWatermarkImage=wb,e.dateToExcel=Ac,e.decodeCell=Jg,e.decodeCol=Wg,e.decodeRange=Xg,e.decodeRow=Kg,e.encodeCell=Yg,e.encodeCol=Gg,e.encodeRange=Zg,e.encodeRow=qg,e.errorToJSON=s,e.excelToDate=jc,e.excelToPdf=JC,e.getErrorChain=c,e.getRootCause=l,e.getSupportedFormats=nt,e.isExcelError=wr,e.isPdfError=hx,e.pdf=WC,e.stringToUint8Array=Cn,e.toError=o,e.toUint8Array=Tn,e.uint8ArrayToBase64=el,e.uint8ArrayToString=wn,e.xmlDecode=Cc,e.xmlEncode=R,e})({});
|
|
448
|
+
`;let _=e.encode(g);return t.push(_),T(t)}};function Lx(e,t,n,r){let i=new TextEncoder,a=[],o=0;for(;o<e.length;)if(e[o]===`(`){let s=o;o++;let c=``,l=1;for(;o<e.length&&l>0;){let t=e[o];t===`\\`?(c+=e[o]+(e[o+1]??``),o+=2):t===`(`?(l++,c+=t,o++):t===`)`?(l--,l>0&&(c+=t),o++):(c+=t,o++)}if(l!==0){a.push(e.slice(s,o));continue}let u=Rx(c),d=xx(i.encode(u),t,n,r);a.push(tx(d))}else if(e[o]===`<`&&e[o+1]===`<`)a.push(`<<`),o+=2;else if(e[o]===`>`&&e[o+1]===`>`)a.push(`>>`),o+=2;else if(e[o]===`<`){o++;let i=``;for(;o<e.length&&e[o]!==`>`;)i+=e[o],o++;o<e.length&&o++;let s=i.replace(/\s/g,``);if(s.length===0){a.push(`<>`);continue}let c=new Uint8Array(Math.ceil(s.length/2));for(let e=0;e<c.length;e++)c[e]=parseInt(s.substring(e*2,e*2+2).padEnd(2,`0`),16);let l=xx(c,t,n,r);a.push(tx(l))}else a.push(e[o]),o++;return a.join(``)}function Rx(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(r!==`\\`){t+=r;continue}let i=e[n+1];if(i===void 0){t+=`\\`;break}switch(i){case`n`:t+=`
|
|
449
|
+
`;break;case`r`:t+=`\r`;break;case`t`:t+=` `;break;case`(`:t+=`(`;break;case`)`:t+=`)`;break;case`\\`:t+=`\\`;break;default:t+=i;break}n++}return t}function zx(e,t,n,r){let{oldToNewGid:i,unicodeToCid:a,cidWidths:o,usedGlyphIds:s}=Bx(t,n),c=Vx(t,s,i),l=np(c,{level:6}),u=e.allocObject(),d=new R().set(`Length`,I(l.length)).set(`Length1`,I(c.length)).set(`Filter`,`/FlateDecode`);e.addStreamObject(u,d,l);let f=1e3/t.unitsPerEm,p=e.allocObject(),m=new R().set(`Type`,`/FontDescriptor`).set(`FontName`,nx(t.postScriptName+`-Subset`)).set(`Flags`,I(t.flags)).set(`FontBBox`,rx(t.bbox.map(e=>I(Math.round(e*f))))).set(`ItalicAngle`,I(t.italicAngle)).set(`Ascent`,I(Math.round(t.ascent*f))).set(`Descent`,I(Math.round(t.descent*f))).set(`CapHeight`,I(Math.round(t.capHeight*f))).set(`StemV`,I(t.stemV)).set(`FontFile2`,L(u));e.addObject(p,m);let h=Kx(o,t.unitsPerEm),g=e.allocObject(),_=new R().set(`Type`,`/Font`).set(`Subtype`,`/CIDFontType2`).set(`BaseFont`,nx(t.postScriptName+`-Subset`)).set(`CIDSystemInfo`,`<< /Registry (Adobe) /Ordering (Identity) /Supplement 0 >>`).set(`FontDescriptor`,L(p)).set(`DW`,I(1e3)).set(`W`,h).set(`CIDToGIDMap`,`/Identity`);e.addObject(g,_);let v=np(Gx(a),{level:6}),y=e.allocObject(),b=new R().set(`Length`,I(v.length)).set(`Filter`,`/FlateDecode`);e.addStreamObject(y,b,v);let x=e.allocObject(),S=new R().set(`Type`,`/Font`).set(`Subtype`,`/Type0`).set(`BaseFont`,nx(t.postScriptName+`-Subset`)).set(`Encoding`,`/Identity-H`).set(`DescendantFonts`,rx([L(g)])).set(`ToUnicode`,L(y));return e.addObject(x,S),{resourceName:r,fontObjNum:x,font:t,unicodeToCid:a,cidWidths:o}}function Bx(e,t){let n=new Set,r=new Map;n.add(0);for(let i of t){let t=e.cmap.get(i);t!==void 0&&t>0&&(n.add(t),r.set(i,t))}let i=e.tables.get(`glyf`);if(i){let t=i.offset,r=new Set(n),a=Array.from(r);for(;a.length>0;){let i=qx(e,a.pop(),t);for(let e of i)r.has(e)||(r.add(e),n.add(e),a.push(e))}}let a=Array.from(n).sort((e,t)=>e-t),o=new Map;for(let e=0;e<a.length;e++)o.set(a[e],e);let s=new Map,c=Array(a.length).fill(0);c[0]=e.advanceWidths[0]??0;for(let[t,n]of r){let r=o.get(n);s.set(t,r),c[r]=e.advanceWidths[n]??0}return{oldToNewGid:o,unicodeToCid:s,cidWidths:c,usedGlyphIds:n}}function Vx(e,t,n){let r=n.size,i=Array.from(t).sort((e,t)=>e-t),a=e.tables.get(`glyf`)?.offset??0,o=[],s=[],c=0;for(let t of i){s.push(c);let r=e.glyphOffsets[t],i=e.glyphOffsets[t+1],l=i-r;if(l>0){let t=Jx(e.data.subarray(a+r,a+i),n);o.push(t),c+=l;let s=(4-l%4)%4;s>0&&(o.push(new Uint8Array(s)),c+=s)}}s.push(c);let l=T(o),u=new Uint8Array((r+1)*4),d=new DataView(u.buffer);for(let e=0;e<=r;e++)d.setUint32(e*4,s[e]??c,!1);let f=new Uint8Array(r*4),p=new DataView(f.buffer);for(let t=0;t<i.length;t++){let n=i[t];p.setUint16(t*4,e.advanceWidths[n]??0,!1),p.setInt16(t*4+2,0,!1)}let m=Hx(n,e.cmap),h=e.tables.get(`head`),g=new Uint8Array(e.data.subarray(h.offset,h.offset+h.length));new DataView(g.buffer,g.byteOffset,g.byteLength).setInt16(50,1,!1);let _=e.tables.get(`hhea`),v=new Uint8Array(e.data.subarray(_.offset,_.offset+_.length));new DataView(v.buffer,v.byteOffset,v.byteLength).setUint16(34,r,!1);let y=e.tables.get(`maxp`),b=new Uint8Array(e.data.subarray(y.offset,y.offset+y.length));new DataView(b.buffer,b.byteOffset,b.byteLength).setUint16(4,r,!1);let x=new Uint8Array(32);return new DataView(x.buffer).setUint32(0,196608,!1),Ux([[`head`,g],[`hhea`,v],[`maxp`,b],[`post`,x],[`cmap`,m],[`hmtx`,f],[`loca`,u],[`glyf`,l]])}function Hx(e,t){let n=[];for(let[r,i]of t){let t=e.get(i);t!==void 0&&n.push([r,t])}n.sort((e,t)=>e[0]-t[0]);let r=[];for(let[e,t]of n){let n=r[r.length-1];n&&e===n.endCP+1&&t===n.startGID+(e-n.startCP)?n.endCP=e:r.push({startCP:e,endCP:e,startGID:t})}let i=16+r.length*12,a=12+i,o=new Uint8Array(a),s=new DataView(o.buffer),c=0;s.setUint16(c,0,!1),c+=2,s.setUint16(c,1,!1),c+=2,s.setUint16(c,3,!1),c+=2,s.setUint16(c,10,!1),c+=2,s.setUint32(c,12,!1),c+=4,s.setUint16(c,12,!1),c+=2,s.setUint16(c,0,!1),c+=2,s.setUint32(c,i,!1),c+=4,s.setUint32(c,0,!1),c+=4,s.setUint32(c,r.length,!1),c+=4;for(let e of r)s.setUint32(c,e.startCP,!1),c+=4,s.setUint32(c,e.endCP,!1),c+=4,s.setUint32(c,e.startGID,!1),c+=4;return o}function Ux(e){let t=e.length,n=12+t*16,r=[];for(let[t,i]of e){let e=i.length,a=e+3&-4,o=new Uint8Array(a);o.set(i),r.push({tag:t,data:o,originalLength:e,offset:n,checksum:Wx(o)}),n+=a}let i=new Uint8Array(n),a=new DataView(i.buffer),o=0;a.setUint32(o,65536,!1),o+=4,a.setUint16(o,t,!1),o+=2;let s=2**Math.floor(Math.log2(t));a.setUint16(o,s*16,!1),o+=2,a.setUint16(o,Math.floor(Math.log2(t)),!1),o+=2,a.setUint16(o,t*16-s*16,!1),o+=2;for(let e of r){for(let t=0;t<4;t++)i[o++]=e.tag.charCodeAt(t);a.setUint32(o,e.checksum,!1),o+=4,a.setUint32(o,e.offset,!1),o+=4,a.setUint32(o,e.originalLength,!1),o+=4}for(let e of r)i.set(e.data,e.offset);return i}function Wx(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=0,r=Math.floor(e.length/4);for(let e=0;e<r;e++)n=n+t.getUint32(e*4,!1)>>>0;return n}function Gx(e){let t=new Map;for(let[n,r]of e)t.set(r,n);let n=Array.from(t.entries()).sort((e,t)=>e[0]-t[0]),r=[];r.push(`/CIDInit /ProcSet findresource begin`),r.push(`12 dict begin`),r.push(`begincmap`),r.push(`/CIDSystemInfo`),r.push(`<< /Registry (Adobe) /Ordering (UCS) /Supplement 0 >> def`),r.push(`/CMapName /Adobe-Identity-UCS def`),r.push(`/CMapType 2 def`),r.push(`1 begincodespacerange`),r.push(`<0000> <FFFF>`),r.push(`endcodespacerange`);for(let e=0;e<n.length;e+=100){let t=n.slice(e,e+100);r.push(`${t.length} beginbfchar`);for(let[e,n]of t){let t=e.toString(16).toUpperCase().padStart(4,`0`),i;if(n>65535){let e=55296+(n-65536>>10),t=56320+(n-65536&1023);i=e.toString(16).toUpperCase().padStart(4,`0`)+t.toString(16).toUpperCase().padStart(4,`0`)}else i=n.toString(16).toUpperCase().padStart(4,`0`);r.push(`<${t}> <${i}>`)}r.push(`endbfchar`)}r.push(`endcmap`),r.push(`CMapName currentdict /CMap defineresource pop`),r.push(`end`),r.push(`end`);let i=r.join(`
|
|
450
|
+
`);return new TextEncoder().encode(i)}function Kx(e,t){if(e.length===0)return`[]`;let n=1e3/t;return`[0 [${e.map(e=>I(Math.round(e*n))).join(` `)}]]`}function qx(e,t,n){let r=e.glyphOffsets[t];if(e.glyphOffsets[t+1]-r<4)return[];let i=new DataView(e.data.buffer,e.data.byteOffset,e.data.byteLength),a=n+r;if(i.getInt16(a,!1)>=0)return[];let o=a+10,s=[];for(;;){let e=i.getUint16(o,!1);o+=2;let t=i.getUint16(o,!1);if(o+=2,s.push(t),e&1?o+=4:o+=2,e&8?o+=2:e&64?o+=4:e&128&&(o+=8),!(e&32))break}return s}function Jx(e,t){if(e.length<10||new DataView(e.buffer,e.byteOffset,e.byteLength).getInt16(0,!1)>=0)return e;let n=new Uint8Array(e.length);n.set(e);let r=new DataView(n.buffer,n.byteOffset,n.byteLength),i=10;for(;;){let e=r.getUint16(i,!1);i+=2;let n=r.getUint16(i,!1),a=t.get(n)??0;if(r.setUint16(i,a,!1),i+=2,e&1?i+=4:i+=2,e&8?i+=2:e&64?i+=4:e&128&&(i+=8),!(e&32))break}return n}let Yx={32:278,33:278,34:355,35:556,36:556,37:889,38:667,39:191,40:333,41:333,42:389,43:584,44:278,45:333,46:278,47:278,48:556,49:556,50:556,51:556,52:556,53:556,54:556,55:556,56:556,57:556,58:278,59:278,60:584,61:584,62:584,63:556,64:1015,65:667,66:667,67:722,68:722,69:667,70:611,71:778,72:722,73:278,74:500,75:667,76:556,77:833,78:722,79:778,80:667,81:778,82:722,83:667,84:611,85:722,86:667,87:944,88:667,89:667,90:611,91:278,92:278,93:278,94:469,95:556,96:333,97:556,98:556,99:500,100:556,101:556,102:278,103:556,104:556,105:222,106:222,107:500,108:222,109:833,110:556,111:556,112:556,113:556,114:333,115:500,116:278,117:556,118:500,119:722,120:500,121:500,122:500,123:334,124:260,125:334,126:584},Xx={32:278,33:333,34:474,35:556,36:556,37:889,38:722,39:238,40:333,41:333,42:389,43:584,44:278,45:333,46:278,47:278,48:556,49:556,50:556,51:556,52:556,53:556,54:556,55:556,56:556,57:556,58:333,59:333,60:584,61:584,62:584,63:611,64:975,65:722,66:722,67:722,68:722,69:667,70:611,71:778,72:722,73:278,74:556,75:722,76:611,77:833,78:722,79:778,80:667,81:778,82:722,83:667,84:611,85:722,86:667,87:944,88:667,89:667,90:611,91:333,92:278,93:333,94:584,95:556,96:333,97:556,98:611,99:556,100:611,101:556,102:333,103:611,104:611,105:278,106:278,107:556,108:278,109:889,110:611,111:611,112:611,113:611,114:389,115:556,116:333,117:611,118:556,119:778,120:556,121:556,122:500,123:389,124:280,125:389,126:584},Zx={32:250,33:333,34:408,35:500,36:500,37:833,38:778,39:180,40:333,41:333,42:500,43:564,44:250,45:333,46:250,47:278,48:500,49:500,50:500,51:500,52:500,53:500,54:500,55:500,56:500,57:500,58:278,59:278,60:564,61:564,62:564,63:444,64:921,65:722,66:667,67:667,68:722,69:611,70:556,71:722,72:722,73:333,74:389,75:722,76:611,77:889,78:722,79:722,80:556,81:722,82:667,83:556,84:611,85:722,86:722,87:944,88:722,89:722,90:611,91:333,92:278,93:333,94:469,95:500,96:333,97:444,98:500,99:444,100:500,101:444,102:333,103:500,104:500,105:278,106:278,107:500,108:278,109:778,110:500,111:500,112:500,113:500,114:333,115:389,116:278,117:500,118:500,119:722,120:500,121:500,122:444,123:480,124:200,125:480,126:541},Qx={32:250,33:333,34:555,35:500,36:500,37:1e3,38:833,39:278,40:333,41:333,42:500,43:570,44:250,45:333,46:250,47:278,48:500,49:500,50:500,51:500,52:500,53:500,54:500,55:500,56:500,57:500,58:333,59:333,60:570,61:570,62:570,63:500,64:930,65:722,66:667,67:722,68:722,69:667,70:611,71:778,72:778,73:389,74:500,75:778,76:667,77:944,78:722,79:778,80:611,81:778,82:722,83:556,84:667,85:722,86:722,87:1e3,88:722,89:722,90:667,91:333,92:278,93:333,94:581,95:500,96:333,97:500,98:556,99:444,100:556,101:444,102:333,103:500,104:556,105:278,106:333,107:556,108:278,109:833,110:556,111:500,112:556,113:556,114:444,115:389,116:333,117:556,118:500,119:722,120:500,121:500,122:444,123:394,124:220,125:394,126:520},$x={Helvetica:{ascent:718,descent:-207,capHeight:718,avgWidth:513,widths:Yx},"Helvetica-Bold":{ascent:718,descent:-207,capHeight:718,avgWidth:535,widths:Xx},"Helvetica-Oblique":{ascent:718,descent:-207,capHeight:718,avgWidth:513,widths:Yx},"Helvetica-BoldOblique":{ascent:718,descent:-207,capHeight:718,avgWidth:535,widths:Xx},"Times-Roman":{ascent:683,descent:-217,capHeight:662,avgWidth:478,widths:Zx},"Times-Bold":{ascent:683,descent:-217,capHeight:676,avgWidth:505,widths:Qx},"Times-Italic":{ascent:683,descent:-217,capHeight:653,avgWidth:478,widths:Zx},"Times-BoldItalic":{ascent:683,descent:-217,capHeight:669,avgWidth:505,widths:Qx},Courier:{ascent:629,descent:-157,capHeight:562,avgWidth:600,widths:null,monoWidth:600},"Courier-Bold":{ascent:629,descent:-157,capHeight:562,avgWidth:600,widths:null,monoWidth:600},"Courier-Oblique":{ascent:629,descent:-157,capHeight:562,avgWidth:600,widths:null,monoWidth:600},"Courier-BoldOblique":{ascent:629,descent:-157,capHeight:562,avgWidth:600,widths:null,monoWidth:600}};function eS(e,t){let n=$x[t];return n?n.monoWidth===void 0?n.widths?.[e]??n.avgWidth:n.monoWidth:eS(e,`Helvetica`)}function tS(e,t,n){let r=0;for(let n=0;n<e.length;n++)r+=eS(e.charCodeAt(n),t);return r/1e3*n}function nS(e,t){return($x[e]??$x.Helvetica).ascent/1e3*t}function rS(e,t){return($x[e]??$x.Helvetica).descent/1e3*t}function iS(e,t){let n=$x[e]??$x.Helvetica;return(n.ascent-n.descent)/1e3*t}function z(e,t,n,r){return{width:600,draw:i=>{e&&(i.lineWidth(e),i.M(0,250),i.L(300,250),i.stroke()),t&&(i.lineWidth(t),i.M(300,250),i.L(600,250),i.stroke()),n&&(i.lineWidth(n),i.M(300,250),i.L(300,500),i.stroke()),r&&(i.lineWidth(r),i.M(300,250),i.L(300,0),i.stroke())}}}function B(e,t,n,r){return{width:600,draw:i=>{i.lineWidth(30),e&&(i.M(0,220),i.L(300,220),i.stroke(),i.M(0,280),i.L(300,280),i.stroke()),t&&(i.M(300,220),i.L(600,220),i.stroke(),i.M(300,280),i.L(600,280),i.stroke()),n&&(i.M(270,250),i.L(270,500),i.stroke(),i.M(330,250),i.L(330,500),i.stroke()),r&&(i.M(270,250),i.L(270,0),i.stroke(),i.M(330,250),i.L(330,0),i.stroke())}}}let aS={9472:z(40,40,0,0),9473:z(80,80,0,0),9474:z(0,0,40,40),9475:z(0,0,80,80),9476:z(40,40,0,0),9477:z(80,80,0,0),9478:z(0,0,40,40),9479:z(0,0,80,80),9480:z(40,40,0,0),9481:z(80,80,0,0),9482:z(0,0,40,40),9483:z(0,0,80,80),9484:z(0,40,0,40),9485:z(0,80,0,40),9486:z(0,40,0,80),9487:z(0,80,0,80),9488:z(40,0,0,40),9489:z(80,0,0,40),9490:z(40,0,0,80),9491:z(80,0,0,80),9492:z(0,40,40,0),9493:z(0,80,40,0),9494:z(0,40,80,0),9495:z(0,80,80,0),9496:z(40,0,40,0),9497:z(80,0,40,0),9498:z(40,0,80,0),9499:z(80,0,80,0),9500:z(0,40,40,40),9501:z(0,80,40,40),9502:z(0,40,80,40),9503:z(0,40,40,80),9504:z(0,40,80,80),9505:z(0,80,80,40),9506:z(0,80,40,80),9507:z(0,80,80,80),9508:z(40,0,40,40),9509:z(80,0,40,40),9510:z(40,0,80,40),9511:z(40,0,40,80),9512:z(40,0,80,80),9513:z(80,0,80,40),9514:z(80,0,40,80),9515:z(80,0,80,80),9516:z(40,40,0,40),9517:z(80,40,0,40),9518:z(40,80,0,40),9519:z(80,80,0,40),9520:z(40,40,0,80),9521:z(80,40,0,80),9522:z(40,80,0,80),9523:z(80,80,0,80),9524:z(40,40,40,0),9525:z(80,40,40,0),9526:z(40,80,40,0),9527:z(80,80,40,0),9528:z(40,40,80,0),9529:z(80,40,80,0),9530:z(40,80,80,0),9531:z(80,80,80,0),9532:z(40,40,40,40),9533:z(80,40,40,40),9534:z(40,80,40,40),9535:z(80,80,40,40),9536:z(40,40,80,40),9537:z(40,40,40,80),9538:z(40,40,80,80),9539:z(80,40,80,40),9540:z(40,80,80,40),9541:z(80,40,40,80),9542:z(40,80,40,80),9543:z(80,80,80,40),9544:z(80,80,40,80),9545:z(80,40,80,80),9546:z(40,80,80,80),9547:z(80,80,80,80),9552:B(!0,!0,!1,!1),9553:B(!1,!1,!0,!0),9554:B(!1,!0,!1,!0),9555:B(!1,!0,!1,!0),9556:B(!1,!0,!1,!0),9557:B(!0,!1,!1,!0),9558:B(!0,!1,!1,!0),9559:B(!0,!1,!1,!0),9560:B(!1,!0,!0,!1),9561:B(!1,!0,!0,!1),9562:B(!1,!0,!0,!1),9563:B(!0,!1,!0,!1),9564:B(!0,!1,!0,!1),9565:B(!0,!1,!0,!1),9566:B(!1,!0,!0,!0),9567:B(!1,!0,!0,!0),9568:B(!1,!0,!0,!0),9569:B(!0,!1,!0,!0),9570:B(!0,!1,!0,!0),9571:B(!0,!1,!0,!0),9572:B(!0,!0,!1,!0),9573:B(!0,!0,!1,!0),9574:B(!0,!0,!1,!0),9575:B(!0,!0,!0,!1),9576:B(!0,!0,!0,!1),9577:B(!0,!0,!0,!1),9578:B(!0,!0,!0,!0),9579:B(!0,!0,!0,!0),9580:B(!0,!0,!0,!0),9581:z(0,40,0,40),9582:z(40,0,0,40),9583:z(40,0,40,0),9584:z(0,40,40,0),9585:{width:600,draw:e=>{e.lineWidth(40),e.M(0,0),e.L(600,500),e.stroke()}},9586:{width:600,draw:e=>{e.lineWidth(40),e.M(0,500),e.L(600,0),e.stroke()}},9587:{width:600,draw:e=>{e.lineWidth(40),e.M(0,0),e.L(600,500),e.stroke(),e.M(0,500),e.L(600,0),e.stroke()}},9588:z(40,0,0,0),9589:z(0,0,40,0),9590:z(0,40,0,0),9591:z(0,0,0,40),9592:z(80,0,0,0),9593:z(0,0,80,0),9594:z(0,80,0,0),9595:z(0,0,0,80),9596:z(40,80,0,0),9597:z(0,0,40,80),9598:z(80,40,0,0),9599:z(0,0,80,40)};function oS(e,t,n,r){return{width:600,draw:i=>{i.rect(e,t,n,r),i.fill()}}}let sS={9600:oS(0,250,600,250),9601:oS(0,0,600,62),9602:oS(0,0,600,125),9603:oS(0,0,600,187),9604:oS(0,0,600,250),9605:oS(0,0,600,312),9606:oS(0,0,600,375),9607:oS(0,0,600,437),9608:oS(0,0,600,500),9609:oS(0,0,525,500),9610:oS(0,0,450,500),9611:oS(0,0,375,500),9612:oS(0,0,300,500),9613:oS(0,0,225,500),9614:oS(0,0,150,500),9615:oS(0,0,75,500),9616:oS(300,0,300,500),9617:{width:600,draw:e=>{e.lineWidth(10);for(let t=10;t<500;t+=40)for(let n=10;n<600;n+=40)e.rect(n,t,5,5);e.fill()}},9618:{width:600,draw:e=>{e.lineWidth(10);for(let t=5;t<500;t+=20)for(let n=5;n<600;n+=20)e.rect(n,t,8,8);e.fill()}},9619:{width:600,draw:e=>{e.lineWidth(10);for(let t=3;t<500;t+=12)for(let n=3;n<600;n+=12)e.rect(n,t,10,10);e.fill()}},9620:oS(0,437,600,63),9621:oS(525,0,75,500),9622:oS(0,0,300,250),9623:oS(300,0,300,250),9624:oS(0,250,300,250),9625:{width:600,draw:e=>{e.rect(0,0,300,250),e.fill(),e.rect(0,250,300,250),e.fill(),e.rect(300,0,300,250),e.fill()}},9626:{width:600,draw:e=>{e.rect(0,250,300,250),e.fill(),e.rect(300,0,300,250),e.fill()}},9627:{width:600,draw:e=>{e.rect(0,0,300,250),e.fill(),e.rect(0,250,600,250),e.fill()}},9628:{width:600,draw:e=>{e.rect(300,0,300,250),e.fill(),e.rect(0,250,600,250),e.fill()}},9629:oS(300,250,300,250),9630:{width:600,draw:e=>{e.rect(300,250,300,250),e.fill(),e.rect(0,0,300,250),e.fill()}},9631:{width:600,draw:e=>{e.rect(300,0,300,500),e.fill(),e.rect(0,0,300,250),e.fill()}}};function cS(e){let t=[200,400],n=[400,300,200,100],r=[[0,0],[0,1],[0,2],[1,0],[1,1],[1,2],[0,3],[1,3]];return{width:600,draw:i=>{for(let a=0;a<8;a++)if(e&1<<a){let[e,o]=r[a];i.circle(t[e],n[o],40),i.fill()}}}}let lS={};for(let e=0;e<256;e++)lS[10240+e]=cS(e);let uS={8451:{width:700,draw:e=>{e.lineWidth(40),e.circle(120,450,60),e.stroke(),e.M(550,450),e.C(350,450,250,350,250,250),e.C(250,150,350,50,550,50),e.stroke()}},8453:{width:600,draw:e=>{e.lineWidth(40),e.M(150,350),e.C(80,350,50,400,50,430),e.C(50,470,100,500,150,500),e.C(200,500,250,470,250,430),e.C(250,400,200,350,150,350),e.stroke(),e.M(450,0),e.L(150,500),e.stroke(),e.M(450,150),e.C(380,150,350,100,350,70),e.C(350,30,400,0,450,0),e.C(500,0,550,30,550,70),e.C(550,100,500,150,450,150),e.stroke()}},8457:{width:700,draw:e=>{e.lineWidth(40),e.circle(120,450,60),e.stroke(),e.M(280,0),e.L(280,500),e.stroke(),e.M(280,500),e.L(550,500),e.stroke(),e.M(280,280),e.L(480,280),e.stroke()}},8467:{width:600,draw:e=>{e.lineWidth(45),e.M(350,500),e.C(200,500,200,400,250,200),e.C(280,100,200,0,150,50),e.stroke()}},8470:{width:700,draw:e=>{e.lineWidth(45),e.M(80,0),e.L(80,500),e.stroke(),e.M(80,500),e.L(350,0),e.stroke(),e.M(350,0),e.L(350,500),e.stroke(),e.lineWidth(35),e.circle(530,70,70),e.stroke(),e.M(380,170),e.L(680,170),e.stroke()}},8480:{width:600,draw:e=>{e.lineWidth(30),e.M(150,400),e.C(150,500,350,500,350,450),e.C(350,400,150,350,150,300),e.C(150,250,350,250,350,350),e.stroke(),e.M(400,500),e.L(400,250),e.L(475,400),e.L(550,250),e.L(550,500),e.stroke()}},8482:{width:600,draw:e=>{e.lineWidth(30),e.M(50,500),e.L(200,500),e.stroke(),e.M(125,500),e.L(125,300),e.stroke(),e.M(250,500),e.L(250,300),e.L(350,450),e.L(450,300),e.L(450,500),e.stroke()}},8486:{width:600,draw:e=>{e.lineWidth(45),e.M(100,50),e.L(200,50),e.L(200,150),e.C(120,200,80,300,80,350),e.C(80,450,180,520,300,520),e.C(420,520,520,450,520,350),e.C(520,300,480,200,400,150),e.L(400,50),e.L(500,50),e.stroke()}},8494:{width:600,draw:e=>{e.lineWidth(40),e.M(480,220),e.L(150,220),e.C(150,400,250,500,350,500),e.C(450,500,530,400,500,300),e.C(470,100,400,0,250,0),e.C(150,0,100,80,100,150),e.stroke()}},8505:{width:600,draw:e=>{e.circle(300,450,40),e.fill(),e.lineWidth(55),e.M(300,350),e.L(300,50),e.stroke()}},8543:{width:600,draw:e=>{e.lineWidth(40),e.M(150,500),e.L(200,500),e.L(200,350),e.stroke(),e.M(450,500),e.L(150,0),e.stroke()}}};function dS(e,t){return{width:600,draw:n=>{n.lineWidth(35),n.M(450,500),n.L(150,0),n.stroke();let r=e.length,i=t.length;for(let e=0;e<r;e++)n.circle(150+e*80,420,30),n.fill();for(let e=0;e<i;e++)n.circle(350+e*80,80,30),n.fill()}}}let fS={8528:dS(`1`,`7`),8529:dS(`1`,`9`),8530:dS(`1`,`10`),8531:dS(`1`,`3`),8532:dS(`2`,`3`),8533:dS(`1`,`5`),8534:dS(`2`,`5`),8535:dS(`3`,`5`),8536:dS(`4`,`5`),8537:dS(`1`,`6`),8538:dS(`5`,`6`),8539:dS(`1`,`8`),8540:dS(`3`,`8`),8541:dS(`5`,`8`),8542:dS(`7`,`8`),8544:{width:600,draw:e=>{e.lineWidth(50),e.M(300,0),e.L(300,500),e.stroke()}},8545:{width:600,draw:e=>{e.lineWidth(50),e.M(200,0),e.L(200,500),e.stroke(),e.M(400,0),e.L(400,500),e.stroke()}},8546:{width:600,draw:e=>{e.lineWidth(45),e.M(120,0),e.L(120,500),e.stroke(),e.M(300,0),e.L(300,500),e.stroke(),e.M(480,0),e.L(480,500),e.stroke()}},8547:{width:600,draw:e=>{e.lineWidth(50),e.M(180,500),e.L(300,0),e.L(420,500),e.stroke()}},8548:{width:600,draw:e=>{e.lineWidth(50),e.M(150,500),e.L(300,0),e.L(450,500),e.stroke()}}},pS={};for(let e=0;e<20;e++)pS[9312+e]={width:600,draw:e=>{e.lineWidth(35),e.circle(300,250,220),e.stroke()}};for(let e=0;e<12;e++)pS[9332+e]={width:600,draw:e=>{e.lineWidth(30),e.M(180,480),e.C(120,480,80,380,80,250),e.C(80,120,120,20,180,20),e.stroke(),e.M(420,20),e.C(480,20,520,120,520,250),e.C(520,380,480,480,420,480),e.stroke()}};for(let e=0;e<26;e++)pS[9398+e]={width:600,draw:e=>{e.lineWidth(35),e.circle(300,250,220),e.stroke()}};for(let e=0;e<26;e++)pS[9424+e]={width:600,draw:e=>{e.lineWidth(30),e.circle(300,250,200),e.stroke()}};pS[9450]={width:600,draw:e=>{e.lineWidth(35),e.circle(300,250,220),e.stroke()}};let mS={8208:{width:600,draw:e=>{e.lineWidth(50),e.M(150,250),e.L(450,250),e.stroke()}},8209:{width:600,draw:e=>{e.lineWidth(50),e.M(150,250),e.L(450,250),e.stroke()}},8210:{width:600,draw:e=>{e.lineWidth(50),e.M(100,250),e.L(500,250),e.stroke()}},8211:{width:600,draw:e=>{e.lineWidth(50),e.M(80,250),e.L(520,250),e.stroke()}},8212:{width:700,draw:e=>{e.lineWidth(50),e.M(0,250),e.L(700,250),e.stroke()}},8214:{width:600,draw:e=>{e.lineWidth(40),e.M(230,0),e.L(230,500),e.stroke(),e.M(370,0),e.L(370,500),e.stroke()}},8215:{width:600,draw:e=>{e.lineWidth(30),e.M(50,30),e.L(550,30),e.stroke(),e.M(50,80),e.L(550,80),e.stroke()}},8216:{width:300,draw:e=>{e.circle(150,450,40),e.fill(),e.lineWidth(30),e.M(150,410),e.C(120,370,100,350,80,340),e.stroke()}},8217:{width:300,draw:e=>{e.circle(150,450,40),e.fill(),e.lineWidth(30),e.M(150,410),e.C(180,370,200,350,220,340),e.stroke()}},8223:{width:400,draw:e=>{e.circle(120,450,35),e.fill(),e.circle(280,450,35),e.fill()}},8224:{width:600,draw:e=>{e.lineWidth(50),e.M(300,500),e.L(300,0),e.stroke(),e.M(150,380),e.L(450,380),e.stroke()}},8225:{width:600,draw:e=>{e.lineWidth(45),e.M(300,500),e.L(300,0),e.stroke(),e.M(150,380),e.L(450,380),e.stroke(),e.M(150,180),e.L(450,180),e.stroke()}},8229:{width:600,draw:e=>{e.circle(200,50,35),e.fill(),e.circle(400,50,35),e.fill()}},8231:{width:300,draw:e=>{e.circle(150,250,35),e.fill()}},8240:{width:700,draw:e=>{e.lineWidth(35),e.M(550,0),e.L(150,500),e.stroke(),e.circle(180,400,70),e.stroke(),e.circle(400,100,60),e.stroke(),e.circle(560,100,60),e.stroke()}},8241:{width:700,draw:e=>{e.lineWidth(35),e.M(550,0),e.L(150,500),e.stroke(),e.circle(180,400,60),e.stroke(),e.circle(350,100,50),e.stroke(),e.circle(470,100,50),e.stroke(),e.circle(590,100,50),e.stroke()}},8242:{width:300,draw:e=>{e.lineWidth(40),e.M(180,500),e.L(140,350),e.stroke()}},8243:{width:400,draw:e=>{e.lineWidth(40),e.M(150,500),e.L(110,350),e.stroke(),e.M(300,500),e.L(260,350),e.stroke()}},8249:{width:350,draw:e=>{e.lineWidth(40),e.M(250,400),e.L(100,250),e.L(250,100),e.stroke()}},8250:{width:350,draw:e=>{e.lineWidth(40),e.M(100,400),e.L(250,250),e.L(100,100),e.stroke()}},8252:{width:600,draw:e=>{e.lineWidth(50),e.M(200,500),e.L(200,130),e.stroke(),e.circle(200,40,30),e.fill(),e.M(400,500),e.L(400,130),e.stroke(),e.circle(400,40,30),e.fill()}},8260:{width:600,draw:e=>{e.lineWidth(40),e.M(450,500),e.L(150,0),e.stroke()}},8271:{width:300,draw:e=>{e.circle(150,350,35),e.fill(),e.circle(150,130,35),e.fill(),e.lineWidth(30),e.M(150,95),e.C(180,50,200,20,220,0),e.stroke()}}},hS={8602:{width:600,draw:e=>{e.lineWidth(45),e.M(500,250),e.L(100,250),e.stroke(),e.M(100,250),e.L(250,380),e.L(250,120),e.Z(),e.fill(),e.lineWidth(50),e.M(350,120),e.L(250,380),e.stroke()}},8603:{width:600,draw:e=>{e.lineWidth(45),e.M(100,250),e.L(500,250),e.stroke(),e.M(500,250),e.L(350,380),e.L(350,120),e.Z(),e.fill(),e.lineWidth(50),e.M(250,120),e.L(350,380),e.stroke()}},8605:{width:600,draw:e=>{e.lineWidth(45),e.M(100,250),e.C(200,350,300,150,400,250),e.L(500,250),e.stroke(),e.M(500,250),e.L(400,330),e.L(400,170),e.Z(),e.fill()}},8606:{width:600,draw:e=>{e.lineWidth(45),e.M(500,250),e.L(100,250),e.stroke(),e.M(100,250),e.L(220,370),e.L(220,130),e.Z(),e.fill(),e.M(200,250),e.L(320,370),e.L(320,130),e.Z(),e.fill()}},8607:{width:600,draw:e=>{e.lineWidth(45),e.M(300,50),e.L(300,470),e.stroke(),e.M(300,470),e.L(180,350),e.L(420,350),e.Z(),e.fill(),e.M(300,370),e.L(180,250),e.L(420,250),e.Z(),e.fill()}},8608:{width:600,draw:e=>{e.lineWidth(45),e.M(100,250),e.L(500,250),e.stroke(),e.M(500,250),e.L(380,370),e.L(380,130),e.Z(),e.fill(),e.M(400,250),e.L(280,370),e.L(280,130),e.Z(),e.fill()}},8609:{width:600,draw:e=>{e.lineWidth(45),e.M(300,450),e.L(300,30),e.stroke(),e.M(300,30),e.L(180,150),e.L(420,150),e.Z(),e.fill(),e.M(300,130),e.L(180,250),e.L(420,250),e.Z(),e.fill()}},8612:{width:600,draw:e=>{e.lineWidth(45),e.M(480,250),e.L(130,250),e.stroke(),e.M(130,250),e.L(260,370),e.L(260,130),e.Z(),e.fill(),e.M(500,100),e.L(500,400),e.stroke()}},8613:{width:600,draw:e=>{e.lineWidth(45),e.M(300,30),e.L(300,420),e.stroke(),e.M(300,420),e.L(180,290),e.L(420,290),e.Z(),e.fill(),e.M(150,30),e.L(450,30),e.stroke()}},8614:{width:600,draw:e=>{e.lineWidth(45),e.M(120,250),e.L(470,250),e.stroke(),e.M(470,250),e.L(340,370),e.L(340,130),e.Z(),e.fill(),e.M(100,100),e.L(100,400),e.stroke()}},8615:{width:600,draw:e=>{e.lineWidth(45),e.M(300,470),e.L(300,80),e.stroke(),e.M(300,80),e.L(180,210),e.L(420,210),e.Z(),e.fill(),e.M(150,470),e.L(450,470),e.stroke()}},8624:{width:600,draw:e=>{e.lineWidth(45),e.M(400,50),e.L(400,350),e.L(150,350),e.stroke(),e.M(400,450),e.L(280,330),e.L(520,330),e.Z(),e.fill()}},8625:{width:600,draw:e=>{e.lineWidth(45),e.M(200,50),e.L(200,350),e.L(450,350),e.stroke(),e.M(200,450),e.L(80,330),e.L(320,330),e.Z(),e.fill()}},8626:{width:600,draw:e=>{e.lineWidth(45),e.M(400,450),e.L(400,150),e.L(150,150),e.stroke(),e.M(400,50),e.L(280,170),e.L(520,170),e.Z(),e.fill()}},8627:{width:600,draw:e=>{e.lineWidth(45),e.M(200,450),e.L(200,150),e.L(450,150),e.stroke(),e.M(200,50),e.L(80,170),e.L(320,170),e.Z(),e.fill()}},8629:{width:600,draw:e=>{e.lineWidth(45),e.M(450,450),e.L(450,150),e.L(150,150),e.stroke(),e.M(150,150),e.L(280,260),e.L(280,40),e.Z(),e.fill()}},8634:{width:600,draw:e=>{e.lineWidth(45),e.M(160,350),e.C(160,450,300,500,400,450),e.C(500,400,520,250,450,150),e.C(380,50,200,50,160,150),e.stroke(),e.M(160,350),e.L(80,250),e.L(250,270),e.Z(),e.fill()}},8635:{width:600,draw:e=>{e.lineWidth(45),e.M(440,350),e.C(440,450,300,500,200,450),e.C(100,400,80,250,150,150),e.C(220,50,400,50,440,150),e.stroke(),e.M(440,350),e.L(520,250),e.L(350,270),e.Z(),e.fill()}}},gS={8723:{width:600,draw:e=>{e.lineWidth(50),e.M(120,350),e.L(480,350),e.stroke(),e.M(300,200),e.L(300,0),e.stroke(),e.M(120,100),e.L(480,100),e.stroke()}},8729:{width:600,draw:e=>{e.circle(300,250,50),e.fill()}},8733:{width:600,draw:e=>{e.lineWidth(45),e.M(80,250),e.C(80,450,250,450,300,250),e.C(350,50,520,50,520,250),e.stroke()}},8735:{width:600,draw:e=>{e.lineWidth(50),e.M(120,450),e.L(120,50),e.L(480,50),e.stroke()}},8739:{width:600,draw:e=>{e.lineWidth(50),e.M(300,0),e.L(300,500),e.stroke()}},8740:{width:600,draw:e=>{e.lineWidth(50),e.M(300,0),e.L(300,500),e.stroke(),e.M(200,100),e.L(400,400),e.stroke()}},8741:{width:600,draw:e=>{e.lineWidth(45),e.M(220,0),e.L(220,500),e.stroke(),e.M(380,0),e.L(380,500),e.stroke()}},8742:{width:600,draw:e=>{e.lineWidth(45),e.M(220,0),e.L(220,500),e.stroke(),e.M(380,0),e.L(380,500),e.stroke(),e.M(150,100),e.L(450,400),e.stroke()}},8728:{width:600,draw:e=>{e.lineWidth(35),e.circle(300,250,70),e.stroke()}},8756:{width:600,draw:e=>{e.circle(300,400,40),e.fill(),e.circle(180,150,40),e.fill(),e.circle(420,150,40),e.fill()}},8757:{width:600,draw:e=>{e.circle(300,100,40),e.fill(),e.circle(180,350,40),e.fill(),e.circle(420,350,40),e.fill()}},8758:{width:300,draw:e=>{e.circle(150,350,40),e.fill(),e.circle(150,150,40),e.fill()}},8759:{width:600,draw:e=>{e.circle(200,350,35),e.fill(),e.circle(200,150,35),e.fill(),e.circle(400,350,35),e.fill(),e.circle(400,150,35),e.fill()}},8780:{width:600,draw:e=>{e.lineWidth(40),e.M(120,400),e.C(200,460,400,460,480,400),e.stroke(),e.M(120,280),e.C(200,340,400,340,480,280),e.stroke(),e.M(120,160),e.L(480,160),e.stroke()}},8773:{width:600,draw:e=>{e.lineWidth(45),e.M(120,350),e.C(200,430,400,430,480,350),e.stroke(),e.M(120,180),e.L(480,180),e.stroke()}},8796:{width:600,draw:e=>{e.lineWidth(40),e.M(120,200),e.L(480,200),e.stroke(),e.M(120,120),e.L(480,120),e.stroke(),e.M(300,450),e.L(200,280),e.L(400,280),e.Z(),e.stroke()}},8810:{width:600,draw:e=>{e.lineWidth(45),e.M(350,420),e.L(100,250),e.L(350,80),e.stroke(),e.M(500,420),e.L(250,250),e.L(500,80),e.stroke()}},8811:{width:600,draw:e=>{e.lineWidth(45),e.M(100,420),e.L(350,250),e.L(100,80),e.stroke(),e.M(250,420),e.L(500,250),e.L(250,80),e.stroke()}},8836:{width:600,draw:e=>{e.lineWidth(45),e.M(470,450),e.C(200,450,130,350,130,250),e.C(130,150,200,50,470,50),e.stroke(),e.M(200,50),e.L(400,450),e.stroke()}},8837:{width:600,draw:e=>{e.lineWidth(45),e.M(130,450),e.C(400,450,470,350,470,250),e.C(470,150,400,50,130,50),e.stroke(),e.M(200,50),e.L(400,450),e.stroke()}},8838:{width:600,draw:e=>{e.lineWidth(45),e.M(470,420),e.C(200,420,130,340,130,250),e.C(130,160,200,80,470,80),e.stroke(),e.M(130,30),e.L(470,30),e.stroke()}},8839:{width:600,draw:e=>{e.lineWidth(45),e.M(130,420),e.C(400,420,470,340,470,250),e.C(470,160,400,80,130,80),e.stroke(),e.M(130,30),e.L(470,30),e.stroke()}},8869:{width:600,draw:e=>{e.lineWidth(50),e.M(120,50),e.L(480,50),e.stroke(),e.M(300,50),e.L(300,450),e.stroke()}},8895:{width:600,draw:e=>{e.lineWidth(45),e.M(120,50),e.L(480,50),e.L(120,450),e.Z(),e.stroke()}}},_S={9729:{width:600,draw:e=>{e.lineWidth(40),e.M(120,200),e.C(120,350,200,400,280,400),e.C(300,470,400,470,430,400),e.C(500,400,520,300,480,200),e.L(120,200),e.stroke()}},9742:{width:600,draw:e=>{e.lineWidth(45),e.M(120,100),e.C(120,50,480,50,480,100),e.stroke(),e.M(150,100),e.C(150,350,200,450,250,450),e.stroke(),e.M(450,100),e.C(450,350,400,450,350,450),e.stroke()}},9774:{width:600,draw:e=>{e.lineWidth(45),e.circle(300,250,220),e.stroke(),e.M(300,470),e.L(300,30),e.stroke(),e.M(300,250),e.L(145,95),e.stroke(),e.M(300,250),e.L(455,95),e.stroke()}},9775:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,220),e.stroke(),e.circle(300,350,20),e.fill(),e.circle(300,150,20),e.fill()}},9785:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,220),e.stroke(),e.circle(210,330,25),e.fill(),e.circle(390,330,25),e.fill(),e.M(200,130),e.C(250,80,350,80,400,130),e.stroke()}},9786:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,220),e.stroke(),e.circle(210,330,25),e.fill(),e.circle(390,330,25),e.fill(),e.M(190,170),e.C(220,110,380,110,410,170),e.stroke()}},9787:{width:600,draw:e=>{e.circle(300,250,230),e.fill()}},9872:{width:600,draw:e=>{e.lineWidth(40),e.M(150,0),e.L(150,500),e.stroke(),e.M(150,500),e.L(480,400),e.L(150,300),e.stroke()}},9873:{width:600,draw:e=>{e.lineWidth(40),e.M(150,0),e.L(150,500),e.stroke(),e.M(150,500),e.L(480,400),e.L(150,300),e.Z(),e.fill()}},9888:{width:600,draw:e=>{e.lineWidth(45),e.M(300,480),e.L(80,50),e.L(520,50),e.Z(),e.stroke(),e.lineWidth(40),e.M(300,350),e.L(300,180),e.stroke(),e.circle(300,110,25),e.fill()}},9889:{width:600,draw:e=>{e.M(350,500),e.L(200,280),e.L(310,280),e.L(250,0),e.L(420,220),e.L(300,220),e.L(350,500),e.Z(),e.fill()}},9898:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,180),e.stroke()}},9899:{width:600,draw:e=>{e.circle(300,250,180),e.fill()}}},vS={9985:{width:600,draw:e=>{e.lineWidth(35),e.circle(180,150,80),e.stroke(),e.circle(180,350,80),e.stroke(),e.M(250,200),e.L(500,400),e.stroke(),e.M(250,300),e.L(500,100),e.stroke()}},9986:{width:600,draw:e=>{e.lineWidth(40),e.circle(170,130,80),e.stroke(),e.circle(170,370,80),e.stroke(),e.M(240,180),e.L(520,420),e.stroke(),e.M(240,320),e.L(520,80),e.stroke()}},9990:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,220),e.stroke(),e.M(200,150),e.C(200,100,400,100,400,150),e.stroke(),e.M(220,150),e.C(220,350,250,400,280,400),e.stroke(),e.M(380,150),e.C(380,350,350,400,320,400),e.stroke()}},9991:{width:600,draw:e=>{e.lineWidth(35),e.rect(80,50,440,400),e.stroke(),e.circle(300,250,120),e.stroke()}},9992:{width:600,draw:e=>{e.M(300,480),e.L(260,300),e.L(80,250),e.L(260,210),e.L(260,80),e.L(220,30),e.L(380,30),e.L(340,80),e.L(340,210),e.L(520,250),e.L(340,300),e.Z(),e.fill()}},9993:{width:600,draw:e=>{e.lineWidth(35),e.rect(80,80,440,340),e.stroke(),e.M(80,420),e.L(300,220),e.L(520,420),e.stroke()}},9998:{width:600,draw:e=>{e.lineWidth(40),e.M(100,50),e.L(480,430),e.stroke(),e.M(100,50),e.L(130,130),e.stroke()}},9999:{width:600,draw:e=>{e.M(130,30),e.L(100,80),e.L(420,470),e.L(480,470),e.L(480,430),e.L(160,30),e.Z(),e.fill()}},1e4:{width:600,draw:e=>{e.lineWidth(40),e.M(100,450),e.L(480,70),e.stroke(),e.M(100,450),e.L(130,370),e.stroke()}},10013:{width:600,draw:e=>{e.lineWidth(55),e.M(300,0),e.L(300,500),e.stroke(),e.M(140,370),e.L(460,370),e.stroke()}},10014:{width:600,draw:e=>{e.lineWidth(65),e.M(300,0),e.L(300,500),e.stroke(),e.M(130,370),e.L(470,370),e.stroke()}},10022:{width:600,draw:e=>{e.M(300,480),e.L(230,280),e.L(80,250),e.L(230,220),e.L(300,20),e.L(370,220),e.L(520,250),e.L(370,280),e.Z(),e.fill()}},10023:{width:600,draw:e=>{e.lineWidth(35),e.M(300,480),e.L(230,280),e.L(80,250),e.L(230,220),e.L(300,20),e.L(370,220),e.L(520,250),e.L(370,280),e.Z(),e.stroke()}},10032:{width:600,draw:e=>{e.lineWidth(40);for(let t=0;t<5;t++){let n=(t*72-90)*Math.PI/180,r=(t*72+36-90)*Math.PI/180;t===0?e.M(300+220*Math.cos(n),260+220*Math.sin(n)):e.L(300+220*Math.cos(n),260+220*Math.sin(n)),e.L(300+100*Math.cos(r),260+100*Math.sin(r))}e.Z(),e.stroke()}},10132:{width:600,draw:e=>{e.M(500,250),e.L(300,430),e.L(300,310),e.L(80,310),e.L(80,190),e.L(300,190),e.L(300,70),e.Z(),e.fill()}},10140:{width:600,draw:e=>{e.M(520,250),e.L(320,430),e.L(320,310),e.C(200,310,80,290,80,250),e.C(80,210,200,190,320,190),e.L(320,70),e.Z(),e.fill()}},10145:{width:600,draw:e=>{e.M(520,250),e.L(350,420),e.L(350,300),e.L(80,300),e.L(80,200),e.L(350,200),e.L(350,80),e.Z(),e.fill()}}},yS={8976:{width:600,draw:e=>{e.lineWidth(45),e.M(480,350),e.L(120,350),e.L(120,150),e.stroke()}},8981:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,200),e.stroke(),e.circle(300,250,50),e.fill()}},8986:{width:600,draw:e=>{e.lineWidth(35),e.rect(150,50,300,400),e.stroke(),e.M(300,450),e.L(300,500),e.stroke(),e.M(300,50),e.L(300,0),e.stroke(),e.lineWidth(30),e.M(300,250),e.L(300,350),e.stroke(),e.M(300,250),e.L(380,250),e.stroke()}},9e3:{width:600,draw:e=>{e.lineWidth(35),e.rect(50,80,500,340),e.stroke(),e.lineWidth(20);for(let t=100;t<=500;t+=80)e.M(t,340),e.L(t+40,340),e.L(t+40,300),e.L(t,300),e.Z(),e.stroke();e.M(150,200),e.L(450,200),e.L(450,160),e.L(150,160),e.Z(),e.stroke()}},9115:{width:300,draw:e=>{e.lineWidth(40),e.M(250,500),e.C(100,400,100,300,150,250),e.stroke()}},9116:{width:300,draw:e=>{e.lineWidth(40),e.M(150,500),e.L(150,0),e.stroke()}},9117:{width:300,draw:e=>{e.lineWidth(40),e.M(150,250),e.C(100,200,100,100,250,0),e.stroke()}},9167:{width:600,draw:e=>{e.M(120,150),e.L(480,150),e.L(300,420),e.Z(),e.fill(),e.rect(120,50,360,60),e.fill()}},9193:{width:600,draw:e=>{e.M(80,430),e.L(300,250),e.L(80,70),e.Z(),e.fill(),e.M(300,430),e.L(520,250),e.L(300,70),e.Z(),e.fill()}},9194:{width:600,draw:e=>{e.M(520,430),e.L(300,250),e.L(520,70),e.Z(),e.fill(),e.M(300,430),e.L(80,250),e.L(300,70),e.Z(),e.fill()}},9195:{width:600,draw:e=>{e.M(100,230),e.L(300,450),e.L(500,230),e.Z(),e.fill(),e.M(100,30),e.L(300,250),e.L(500,30),e.Z(),e.fill()}},9196:{width:600,draw:e=>{e.M(100,270),e.L(300,50),e.L(500,270),e.Z(),e.fill(),e.M(100,470),e.L(300,250),e.L(500,470),e.Z(),e.fill()}},9197:{width:600,draw:e=>{e.M(60,430),e.L(250,250),e.L(60,70),e.Z(),e.fill(),e.M(250,430),e.L(440,250),e.L(250,70),e.Z(),e.fill(),e.rect(460,70,50,360),e.fill()}},9198:{width:600,draw:e=>{e.M(540,430),e.L(350,250),e.L(540,70),e.Z(),e.fill(),e.M(350,430),e.L(160,250),e.L(350,70),e.Z(),e.fill(),e.rect(90,70,50,360),e.fill()}},9199:{width:600,draw:e=>{e.M(80,430),e.L(330,250),e.L(80,70),e.Z(),e.fill(),e.rect(370,70,50,360),e.fill(),e.rect(460,70,50,360),e.fill()}},9201:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,230,200),e.stroke(),e.M(260,470),e.L(340,470),e.stroke(),e.M(300,430),e.L(300,480),e.stroke(),e.M(300,230),e.L(300,350),e.stroke(),e.M(300,230),e.L(400,280),e.stroke()}},9202:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,230,200),e.stroke(),e.M(300,230),e.L(300,370),e.stroke(),e.M(300,230),e.L(420,230),e.stroke(),e.M(430,400),e.L(470,440),e.stroke()}},9208:{width:600,draw:e=>{e.rect(140,60,100,380),e.fill(),e.rect(360,60,100,380),e.fill()}},9209:{width:600,draw:e=>{e.rect(100,50,400,400),e.fill()}},9210:{width:600,draw:e=>{e.circle(300,250,200),e.fill()}}},bS={8352:{width:600,draw:e=>{e.lineWidth(45),e.M(480,430),e.C(350,480,180,430,150,300),e.C(120,170,200,50,400,30),e.stroke(),e.M(80,320),e.L(380,320),e.stroke(),e.M(80,220),e.L(380,220),e.stroke()}},8353:{width:600,draw:e=>{e.lineWidth(45),e.M(450,430),e.C(350,480,180,430,150,250),e.C(150,70,350,20,450,70),e.stroke(),e.M(300,520),e.L(300,-20),e.stroke()}},8354:{width:600,draw:e=>{e.lineWidth(45),e.M(450,430),e.C(350,480,180,430,150,250),e.C(150,70,350,20,450,70),e.stroke(),e.M(380,0),e.L(250,500),e.stroke()}},8355:{width:600,draw:e=>{e.lineWidth(50),e.M(200,0),e.L(200,500),e.stroke(),e.M(200,500),e.L(480,500),e.stroke(),e.M(200,300),e.L(400,300),e.stroke(),e.M(120,200),e.L(350,200),e.stroke()}},8356:{width:600,draw:e=>{e.lineWidth(50),e.M(200,0),e.C(200,0,400,0,400,0),e.stroke(),e.M(200,0),e.L(200,500),e.C(200,500,150,520,120,500),e.stroke(),e.M(120,300),e.L(380,300),e.stroke(),e.M(120,180),e.L(380,180),e.stroke()}},8357:{width:600,draw:e=>{e.lineWidth(40),e.M(100,0),e.L(100,350),e.L(200,200),e.L(300,350),e.L(300,0),e.stroke(),e.M(300,500),e.L(300,-30),e.stroke()}},8358:{width:600,draw:e=>{e.lineWidth(45),e.M(130,0),e.L(130,500),e.stroke(),e.M(130,500),e.L(470,0),e.stroke(),e.M(470,0),e.L(470,500),e.stroke(),e.M(80,350),e.L(520,350),e.stroke(),e.M(80,200),e.L(520,200),e.stroke()}},8359:{width:600,draw:e=>{e.lineWidth(45),e.M(150,0),e.L(150,500),e.stroke(),e.M(150,500),e.L(350,500),e.C(450,500,480,400,350,350),e.L(150,350),e.stroke(),e.M(350,0),e.L(500,0),e.stroke()}},8360:{width:600,draw:e=>{e.lineWidth(45),e.M(150,0),e.L(150,500),e.stroke(),e.M(150,500),e.L(350,500),e.C(450,500,480,400,350,350),e.L(150,350),e.stroke(),e.M(280,350),e.L(450,0),e.stroke()}},8361:{width:600,draw:e=>{e.lineWidth(40),e.M(60,500),e.L(180,0),e.L(300,350),e.L(420,0),e.L(540,500),e.stroke(),e.M(80,250),e.L(520,250),e.stroke(),e.M(80,150),e.L(520,150),e.stroke()}},8362:{width:600,draw:e=>{e.lineWidth(45),e.M(150,500),e.L(150,100),e.C(150,30,250,0,300,50),e.stroke(),e.M(450,0),e.L(450,400),e.C(450,470,350,500,300,450),e.stroke()}},8363:{width:600,draw:e=>{e.lineWidth(45),e.M(250,50),e.L(250,500),e.stroke(),e.M(250,400),e.L(350,400),e.C(470,400,470,200,350,200),e.L(250,200),e.stroke(),e.M(150,50),e.L(400,50),e.stroke(),e.M(170,120),e.L(420,120),e.stroke()}},8366:{width:600,draw:e=>{e.lineWidth(50),e.M(120,500),e.L(480,500),e.stroke(),e.M(300,500),e.L(300,0),e.stroke(),e.M(120,350),e.L(480,350),e.stroke(),e.M(120,200),e.L(480,200),e.stroke()}},8369:{width:600,draw:e=>{e.lineWidth(45),e.M(150,0),e.L(150,500),e.stroke(),e.M(150,500),e.L(350,500),e.C(480,500,480,300,350,300),e.L(150,300),e.stroke(),e.M(100,420),e.L(450,420),e.stroke()}},8370:{width:600,draw:e=>{e.lineWidth(45),e.M(450,400),e.C(400,480,200,480,150,350),e.C(100,200,200,50,400,50),e.L(400,250),e.L(250,250),e.stroke(),e.M(300,520),e.L(300,0),e.stroke()}},8371:{width:600,draw:e=>{e.lineWidth(45),e.M(100,0),e.L(300,500),e.L(500,0),e.stroke(),e.M(160,180),e.L(440,180),e.stroke(),e.M(180,280),e.L(420,280),e.stroke()}},8372:{width:600,draw:e=>{e.lineWidth(45),e.M(420,450),e.C(380,500,200,500,180,400),e.C(160,300,400,250,420,150),e.C(440,50,250,0,180,50),e.stroke(),e.M(100,330),e.L(480,330),e.stroke(),e.M(100,220),e.L(480,220),e.stroke()}},8374:{width:600,draw:e=>{e.lineWidth(45),e.M(250,0),e.L(250,480),e.C(250,500,200,520,180,500),e.stroke(),e.M(250,350),e.L(450,350),e.stroke()}},8376:{width:600,draw:e=>{e.lineWidth(50),e.M(100,500),e.L(500,500),e.stroke(),e.M(100,400),e.L(500,400),e.stroke(),e.M(300,400),e.L(300,0),e.stroke()}}},xS={10216:{width:350,draw:e=>{e.lineWidth(40),e.M(280,500),e.L(100,250),e.L(280,0),e.stroke()}},10217:{width:350,draw:e=>{e.lineWidth(40),e.M(100,500),e.L(280,250),e.L(100,0),e.stroke()}},10218:{width:450,draw:e=>{e.lineWidth(35),e.M(250,500),e.L(70,250),e.L(250,0),e.stroke(),e.M(380,500),e.L(200,250),e.L(380,0),e.stroke()}},10219:{width:450,draw:e=>{e.lineWidth(35),e.M(70,500),e.L(250,250),e.L(70,0),e.stroke(),e.M(200,500),e.L(380,250),e.L(200,0),e.stroke()}}},SS={10229:{width:700,draw:e=>{e.lineWidth(45),e.M(650,250),e.L(100,250),e.stroke(),e.M(100,250),e.L(250,380),e.L(250,120),e.Z(),e.fill()}},10230:{width:700,draw:e=>{e.lineWidth(45),e.M(50,250),e.L(600,250),e.stroke(),e.M(600,250),e.L(450,380),e.L(450,120),e.Z(),e.fill()}},10231:{width:700,draw:e=>{e.lineWidth(40),e.M(150,250),e.L(550,250),e.stroke(),e.M(100,250),e.L(230,370),e.L(230,130),e.Z(),e.fill(),e.M(600,250),e.L(470,370),e.L(470,130),e.Z(),e.fill()}},10232:{width:700,draw:e=>{e.M(80,250),e.L(250,430),e.L(250,310),e.L(620,310),e.L(620,190),e.L(250,190),e.L(250,70),e.Z(),e.fill()}},10233:{width:700,draw:e=>{e.M(620,250),e.L(450,430),e.L(450,310),e.L(80,310),e.L(80,190),e.L(450,190),e.L(450,70),e.Z(),e.fill()}},10234:{width:700,draw:e=>{e.M(80,250),e.L(200,400),e.L(200,300),e.L(500,300),e.L(500,400),e.L(620,250),e.L(500,100),e.L(500,200),e.L(200,200),e.L(200,100),e.Z(),e.fill()}}},CS={9639:{width:600,draw:e=>{e.lineWidth(35),e.rect(100,50,400,400),e.stroke(),e.lineWidth(20);for(let t=-3;t<=3;t++){let n=t*100;e.M(100+n,450),e.L(500+n,50),e.stroke()}}},9641:{width:600,draw:e=>{e.lineWidth(35),e.rect(100,50,400,400),e.stroke(),e.lineWidth(15);for(let t=-3;t<=3;t++){let n=t*100;e.M(100+n,450),e.L(500+n,50),e.stroke(),e.M(100+n,50),e.L(500+n,450),e.stroke()}}},9649:{width:600,draw:e=>{e.lineWidth(40),e.M(180,50),e.L(500,50),e.L(420,450),e.L(100,450),e.Z(),e.stroke()}},9657:{width:600,draw:e=>{e.lineWidth(35),e.M(200,380),e.L(430,250),e.L(200,120),e.Z(),e.stroke()}},9658:{width:600,draw:e=>{e.M(150,420),e.L(480,250),e.L(150,80),e.Z(),e.fill()}},9659:{width:600,draw:e=>{e.lineWidth(40),e.M(150,420),e.L(480,250),e.L(150,80),e.Z(),e.stroke()}},9663:{width:600,draw:e=>{e.lineWidth(35),e.M(180,380),e.L(420,380),e.L(300,120),e.Z(),e.stroke()}},9667:{width:600,draw:e=>{e.lineWidth(35),e.M(400,380),e.L(170,250),e.L(400,120),e.Z(),e.stroke()}},9668:{width:600,draw:e=>{e.M(450,420),e.L(120,250),e.L(450,80),e.Z(),e.fill()}},9669:{width:600,draw:e=>{e.lineWidth(40),e.M(450,420),e.L(120,250),e.L(450,80),e.Z(),e.stroke()}},9698:{width:600,draw:e=>{e.M(500,450),e.L(500,50),e.L(100,50),e.Z(),e.fill()}},9699:{width:600,draw:e=>{e.M(100,450),e.L(100,50),e.L(500,50),e.Z(),e.fill()}},9700:{width:600,draw:e=>{e.M(100,50),e.L(100,450),e.L(500,450),e.Z(),e.fill()}},9701:{width:600,draw:e=>{e.M(500,50),e.L(500,450),e.L(100,450),e.Z(),e.fill()}},9703:{width:600,draw:e=>{e.lineWidth(35),e.rect(100,50,400,400),e.stroke(),e.rect(100,50,400/2,400),e.fill()}},9704:{width:600,draw:e=>{e.lineWidth(35),e.rect(100,50,400,400),e.stroke(),e.rect(300,50,400/2,400),e.fill()}},9705:{width:600,draw:e=>{e.lineWidth(35),e.rect(100,50,400,400),e.stroke(),e.M(100,50),e.L(100,450),e.L(500,450),e.Z(),e.fill()}},9706:{width:600,draw:e=>{e.lineWidth(35),e.rect(100,50,400,400),e.stroke(),e.M(500,450),e.L(500,50),e.L(100,50),e.Z(),e.fill()}},9707:{width:600,draw:e=>{e.lineWidth(35),e.rect(100,50,400,400),e.stroke(),e.M(300,50),e.L(300,450),e.stroke()}},9708:{width:600,draw:e=>{e.lineWidth(40),e.M(300,470),e.L(100,50),e.L(500,50),e.Z(),e.stroke(),e.circle(300,190,30),e.fill()}},9709:{width:600,draw:e=>{e.lineWidth(40),e.M(300,470),e.L(100,50),e.L(500,50),e.Z(),e.stroke(),e.M(300,470),e.L(100,50),e.L(300,50),e.Z(),e.fill()}},9710:{width:600,draw:e=>{e.lineWidth(40),e.M(300,470),e.L(100,50),e.L(500,50),e.Z(),e.stroke(),e.M(300,470),e.L(500,50),e.L(300,50),e.Z(),e.fill()}},9712:{width:600,draw:e=>{e.lineWidth(35),e.rect(100,50,400,400),e.stroke(),e.rect(100,250,400/2,400/2),e.fill()}},9713:{width:600,draw:e=>{e.lineWidth(35),e.rect(100,50,400,400),e.stroke(),e.rect(100,50,400/2,400/2),e.fill()}},9714:{width:600,draw:e=>{e.lineWidth(35),e.rect(100,50,400,400),e.stroke(),e.rect(300,50,400/2,400/2),e.fill()}},9715:{width:600,draw:e=>{e.lineWidth(35),e.rect(100,50,400,400),e.stroke(),e.rect(300,250,400/2,400/2),e.fill()}},9716:{width:600,draw:e=>{e.lineWidth(35),e.circle(300,250,220),e.stroke(),e.M(300,250),e.L(300,470),e.C(179,470,80,371,80,250),e.L(300,250),e.Z(),e.fill()}},9717:{width:600,draw:e=>{e.lineWidth(35),e.circle(300,250,220),e.stroke(),e.M(300,250),e.L(80,250),e.C(80,129,179,30,300,30),e.L(300,250),e.Z(),e.fill()}},9718:{width:600,draw:e=>{e.lineWidth(35),e.circle(300,250,220),e.stroke(),e.M(300,250),e.L(300,30),e.C(421,30,520,129,520,250),e.L(300,250),e.Z(),e.fill()}},9719:{width:600,draw:e=>{e.lineWidth(35),e.circle(300,250,220),e.stroke(),e.M(300,250),e.L(520,250),e.C(520,371,421,470,300,470),e.L(300,250),e.Z(),e.fill()}},9720:{width:600,draw:e=>{e.lineWidth(35),e.M(100,450),e.L(500,450),e.L(100,50),e.Z(),e.stroke()}},9721:{width:600,draw:e=>{e.lineWidth(35),e.M(100,450),e.L(500,450),e.L(500,50),e.Z(),e.stroke()}},9722:{width:600,draw:e=>{e.lineWidth(35),e.M(100,450),e.L(100,50),e.L(500,50),e.Z(),e.stroke()}},9723:{width:600,draw:e=>{e.lineWidth(35),e.rect(130,80,340,340),e.stroke()}},9724:{width:600,draw:e=>{e.rect(130,80,340,340),e.fill()}},9725:{width:600,draw:e=>{e.lineWidth(30),e.rect(170,120,260,260),e.stroke()}},9726:{width:600,draw:e=>{e.rect(170,120,260,260),e.fill()}},9727:{width:600,draw:e=>{e.lineWidth(35),e.M(500,450),e.L(500,50),e.L(100,50),e.Z(),e.stroke()}}};function V(e,t,n,r){e.M(t,n),e.L(t,r),e.stroke()}function wS(e,t,n,r){e.M(t-80,r),e.L(t,n),e.L(t+80,r),e.stroke()}function TS(e,t,n,r){e.M(t-70,n),e.L(t+70,r),e.stroke(),e.M(t+70,n),e.L(t-70,r),e.stroke()}function ES(e,t,n,r){e.M(t,r),e.L(n,r),e.stroke()}function DS(e){return{width:600,draw:t=>{if(t.lineWidth(45),e<=3){let n=e,r=300-(n-1)*120/2;for(let e=0;e<n;e++)V(t,r+e*120,0,500)}else e===4?(V(t,200,0,500),wS(t,380,0,500)):e===5?wS(t,300,0,500):e===6?(wS(t,200,0,500),V(t,400,0,500)):e===7?(wS(t,160,0,500),V(t,340,0,500),V(t,460,0,500)):e===8?(t.lineWidth(40),wS(t,140,0,500),V(t,300,0,500),V(t,400,0,500),V(t,500,0,500)):e===9?(V(t,200,0,500),TS(t,400,0,500)):e===10?TS(t,300,0,500):e===11?(TS(t,220,0,500),V(t,430,0,500)):e===12?(TS(t,180,0,500),V(t,370,0,500),V(t,480,0,500)):e===50?(V(t,200,0,500),ES(t,200,450,0)):e===100?(ES(t,180,450,500),V(t,180,0,500),ES(t,180,450,0)):e===500?(V(t,180,0,500),t.M(180,500),t.C(480,500,480,0,180,0),t.stroke()):e===1e3&&(V(t,100,0,500),t.M(100,500),t.L(230,200),t.L(300,500),t.stroke(),t.M(300,500),t.L(370,200),t.L(500,500),t.stroke(),V(t,500,0,500))}}}function OS(e){return{width:600,draw:t=>{if(t.lineWidth(40),e<=3){let n=e,r=300-(n-1)*100/2;for(let e=0;e<n;e++)V(t,r+e*100,0,350)}else e===4?(V(t,200,0,350),wS(t,380,0,350)):e===5?wS(t,300,0,350):e===6?(wS(t,200,0,350),V(t,400,0,350)):e===7?(wS(t,160,0,350),V(t,340,0,350),V(t,450,0,350)):e===8?(t.lineWidth(35),wS(t,130,0,350),V(t,280,0,350),V(t,380,0,350),V(t,480,0,350)):e===9?(V(t,200,0,350),TS(t,400,0,350)):e===10?TS(t,300,0,350):e===11?(TS(t,220,0,350),V(t,430,0,350)):e===12?(TS(t,180,0,350),V(t,370,0,350),V(t,480,0,350)):e===50?(V(t,200,0,350),ES(t,200,450,0)):e===100?(ES(t,180,450,350),V(t,180,0,350),ES(t,180,450,0)):e===500?(V(t,180,0,350),t.M(180,350),t.C(480,350,480,0,180,0),t.stroke()):e===1e3&&(V(t,100,0,350),t.M(100,350),t.L(230,140),t.L(300,350),t.stroke(),t.M(300,350),t.L(370,140),t.L(500,350),t.stroke(),V(t,500,0,350))}}}let kS=[[8549,6],[8550,7],[8551,8],[8552,9],[8553,10],[8554,11],[8555,12],[8556,50],[8557,100],[8558,500],[8559,1e3]],AS=[[8560,1],[8561,2],[8562,3],[8563,4],[8564,5],[8565,6],[8566,7],[8567,8],[8568,9],[8569,10],[8570,11],[8571,12],[8572,50],[8573,100],[8574,500],[8575,1e3]],jS={};for(let[e,t]of kS)jS[e]=DS(t);for(let[e,t]of AS)jS[e]=OS(t);jS[8576]={width:600,draw:e=>{e.lineWidth(45),e.circle(300,250,220),e.stroke(),e.M(300,470),e.L(300,30),e.stroke()}},jS[8577]={width:600,draw:e=>{e.lineWidth(45),e.M(180,500),e.L(180,0),e.stroke(),e.M(180,500),e.C(520,500,520,0,180,0),e.stroke(),e.M(300,500),e.L(300,0),e.stroke()}},jS[8578]={width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,220),e.stroke(),e.circle(300,250,150),e.stroke()}},jS[8579]={width:600,draw:e=>{e.lineWidth(45),e.M(150,450),e.C(450,450,450,50,150,50),e.stroke()}};let MS={},NS=[(e,t,n,r)=>{e.ellipse(t,n,r*.28,r*.42),e.stroke()},(e,t,n,r)=>{e.M(t,n+r*.42),e.L(t,n-r*.42),e.stroke()},(e,t,n,r)=>{e.M(t-r*.25,n+r*.25),e.C(t-r*.25,n+r*.45,t+r*.25,n+r*.45,t+r*.25,n+r*.15),e.L(t-r*.25,n-r*.42),e.L(t+r*.25,n-r*.42),e.stroke()},(e,t,n,r)=>{e.M(t-r*.22,n+r*.42),e.L(t+r*.22,n+r*.42),e.L(t+r*.22,n),e.L(t-r*.1,n),e.stroke(),e.M(t+r*.22,n),e.L(t+r*.22,n-r*.42),e.L(t-r*.22,n-r*.42),e.stroke()},(e,t,n,r)=>{e.M(t+r*.2,n+r*.42),e.L(t-r*.25,n-r*.05),e.L(t+r*.25,n-r*.05),e.stroke(),e.M(t+r*.2,n+r*.42),e.L(t+r*.2,n-r*.42),e.stroke()},(e,t,n,r)=>{e.M(t+r*.22,n+r*.42),e.L(t-r*.22,n+r*.42),e.L(t-r*.22,n+r*.05),e.L(t+r*.22,n+r*.05),e.C(t+r*.35,n+r*.05,t+r*.35,n-r*.42,t-r*.22,n-r*.42),e.stroke()},(e,t,n,r)=>{e.M(t+r*.2,n+r*.35),e.C(t-r*.1,n+r*.45,t-r*.3,n+r*.15,t-r*.25,n-r*.1),e.C(t-r*.2,n-r*.45,t+r*.25,n-r*.45,t+r*.25,n-r*.1),e.C(t+r*.25,n+r*.1,t-r*.25,n+r*.1,t-r*.25,n-r*.1),e.stroke()},(e,t,n,r)=>{e.M(t-r*.22,n+r*.42),e.L(t+r*.22,n+r*.42),e.L(t-r*.05,n-r*.42),e.stroke()},(e,t,n,r)=>{e.ellipse(t,n+r*.22,r*.2,r*.2),e.stroke(),e.ellipse(t,n-r*.22,r*.22,r*.22),e.stroke()},(e,t,n,r)=>{e.M(t-r*.2,n-r*.35),e.C(t+r*.1,n-r*.45,t+r*.3,n-r*.15,t+r*.25,n+r*.1),e.C(t+r*.2,n+r*.45,t-r*.25,n+r*.45,t-r*.25,n+r*.1),e.C(t-r*.25,n-r*.1,t+r*.25,n-r*.1,t+r*.25,n+r*.1),e.stroke()}];function PS(e,t,n,r,i){NS[t](e,n,r,i)}let FS=[(e,t,n,r)=>{e.M(t+r*.25,n-r*.3),e.C(t+r*.1,n-r*.45,t-r*.25,n-r*.35,t-r*.25,n-r*.1),e.C(t-r*.25,n+r*.1,t+r*.25,n+r*.1,t+r*.25,n-r*.1),e.L(t+r*.25,n-r*.35),e.stroke()},(e,t,n,r)=>{e.M(t-r*.2,n+r*.45),e.L(t-r*.2,n-r*.45),e.stroke(),e.M(t-r*.2,n-r*.05),e.C(t-r*.2,n-r*.45,t+r*.25,n-r*.45,t+r*.25,n-r*.15),e.C(t+r*.25,n+r*.1,t-r*.2,n+r*.1,t-r*.2,n-r*.05),e.stroke()},(e,t,n,r)=>{e.M(t+r*.2,n-r*.25),e.C(t+r*.05,n-r*.45,t-r*.25,n-r*.35,t-r*.25,n-r*.1),e.C(t-r*.25,n+r*.15,t+r*.05,n+r*.15,t+r*.2,n+r*.05),e.stroke()},(e,t,n,r)=>{e.M(t+r*.2,n+r*.45),e.L(t+r*.2,n-r*.45),e.stroke(),e.M(t+r*.2,n-r*.05),e.C(t+r*.2,n-r*.45,t-r*.25,n-r*.45,t-r*.25,n-r*.15),e.C(t-r*.25,n+r*.1,t+r*.2,n+r*.1,t+r*.2,n-r*.05),e.stroke()},(e,t,n,r)=>{e.M(t-r*.25,n-r*.08),e.L(t+r*.25,n-r*.08),e.C(t+r*.25,n+r*.15,t-r*.25,n+r*.15,t-r*.25,n-r*.08),e.C(t-r*.25,n-r*.4,t+r*.25,n-r*.4,t+r*.25,n-r*.25),e.stroke()},(e,t,n,r)=>{e.M(t+r*.1,n+r*.4),e.C(t+r*.1,n+r*.5,t-r*.1,n+r*.5,t-r*.1,n+r*.4),e.L(t-r*.1,n-r*.4),e.stroke(),e.M(t-r*.2,n+r*.15),e.L(t+r*.15,n+r*.15),e.stroke()},(e,t,n,r)=>{e.M(t+r*.22,n+r*.1),e.C(t+r*.22,n+r*.4,t-r*.22,n+r*.4,t-r*.22,n+r*.1),e.C(t-r*.22,n-r*.2,t+r*.22,n-r*.2,t+r*.22,n+r*.1),e.L(t+r*.22,n-r*.3),e.C(t+r*.22,n-r*.5,t-r*.22,n-r*.5,t-r*.22,n-r*.35),e.stroke()},(e,t,n,r)=>{e.M(t-r*.2,n+r*.45),e.L(t-r*.2,n-r*.45),e.stroke(),e.M(t-r*.2,n+r*.05),e.C(t-r*.2,n+r*.25,t+r*.2,n+r*.25,t+r*.2,n+r*.05),e.L(t+r*.2,n-r*.45),e.stroke()},(e,t,n,r)=>{e.M(t,n+r*.15),e.L(t,n-r*.35),e.stroke(),e.circle(t,n+r*.3,r*.06),e.fill()},(e,t,n,r)=>{e.M(t+r*.05,n+r*.15),e.L(t+r*.05,n-r*.35),e.C(t+r*.05,n-r*.5,t-r*.15,n-r*.5,t-r*.15,n-r*.35),e.stroke(),e.circle(t+r*.05,n+r*.3,r*.06),e.fill()},(e,t,n,r)=>{e.M(t-r*.2,n+r*.45),e.L(t-r*.2,n-r*.45),e.stroke(),e.M(t+r*.2,n+r*.15),e.L(t-r*.2,n-r*.1),e.L(t+r*.2,n-r*.35),e.stroke()},(e,t,n,r)=>{e.M(t,n+r*.45),e.L(t,n-r*.45),e.stroke()},(e,t,n,r)=>{e.M(t-r*.3,n-r*.35),e.L(t-r*.3,n+r*.15),e.C(t-r*.3,n+r*.25,t-r*.05,n+r*.25,t-r*.05,n+r*.15),e.L(t-r*.05,n-r*.35),e.stroke(),e.M(t-r*.05,n+r*.15),e.C(t-r*.05,n+r*.25,t+r*.2,n+r*.25,t+r*.2,n+r*.15),e.L(t+r*.2,n-r*.35),e.stroke()},(e,t,n,r)=>{e.M(t-r*.2,n-r*.35),e.L(t-r*.2,n+r*.15),e.C(t-r*.2,n+r*.25,t+r*.2,n+r*.25,t+r*.2,n+r*.15),e.L(t+r*.2,n-r*.35),e.stroke()},(e,t,n,r)=>{e.ellipse(t,n-r*.1,r*.22,r*.28),e.stroke()},(e,t,n,r)=>{e.M(t-r*.2,n-r*.45),e.L(t-r*.2,n+r*.15),e.stroke(),e.M(t-r*.2,n+r*.05),e.C(t-r*.2,n+r*.35,t+r*.25,n+r*.35,t+r*.25,n+r*.05),e.C(t+r*.25,n-r*.2,t-r*.2,n-r*.2,t-r*.2,n+r*.05),e.stroke()},(e,t,n,r)=>{e.M(t+r*.2,n-r*.45),e.L(t+r*.2,n+r*.15),e.stroke(),e.M(t+r*.2,n+r*.05),e.C(t+r*.2,n+r*.35,t-r*.25,n+r*.35,t-r*.25,n+r*.05),e.C(t-r*.25,n-r*.2,t+r*.2,n-r*.2,t+r*.2,n+r*.05),e.stroke()},(e,t,n,r)=>{e.M(t-r*.15,n-r*.35),e.L(t-r*.15,n+r*.15),e.stroke(),e.M(t-r*.15,n+r*.05),e.C(t-r*.15,n+r*.25,t+r*.15,n+r*.25,t+r*.2,n+r*.1),e.stroke()},(e,t,n,r)=>{e.M(t+r*.18,n+r*.08),e.C(t+r*.18,n+r*.22,t-r*.18,n+r*.22,t-r*.18,n+r*.05),e.C(t-r*.18,n-r*.1,t+r*.18,n-r*.1,t+r*.18,n-r*.22),e.C(t+r*.18,n-r*.38,t-r*.18,n-r*.38,t-r*.18,n-r*.25),e.stroke()},(e,t,n,r)=>{e.M(t,n+r*.35),e.L(t,n-r*.35),e.C(t,n-r*.5,t+r*.15,n-r*.5,t+r*.15,n-r*.4),e.stroke(),e.M(t-r*.15,n+r*.15),e.L(t+r*.15,n+r*.15),e.stroke()},(e,t,n,r)=>{e.M(t-r*.2,n+r*.15),e.L(t-r*.2,n-r*.15),e.C(t-r*.2,n-r*.4,t+r*.2,n-r*.4,t+r*.2,n-r*.15),e.L(t+r*.2,n+r*.15),e.L(t+r*.2,n-r*.35),e.stroke()},(e,t,n,r)=>{e.M(t-r*.22,n+r*.15),e.L(t,n-r*.35),e.L(t+r*.22,n+r*.15),e.stroke()},(e,t,n,r)=>{e.M(t-r*.3,n+r*.15),e.L(t-r*.15,n-r*.35),e.L(t,n),e.L(t+r*.15,n-r*.35),e.L(t+r*.3,n+r*.15),e.stroke()},(e,t,n,r)=>{e.M(t-r*.2,n+r*.15),e.L(t+r*.2,n-r*.35),e.stroke(),e.M(t+r*.2,n+r*.15),e.L(t-r*.2,n-r*.35),e.stroke()},(e,t,n,r)=>{e.M(t-r*.2,n+r*.15),e.L(t,n-r*.1),e.L(t+r*.2,n+r*.15),e.stroke(),e.M(t,n-r*.1),e.L(t-r*.1,n-r*.45),e.stroke()},(e,t,n,r)=>{e.M(t-r*.2,n+r*.15),e.L(t+r*.2,n+r*.15),e.L(t-r*.2,n-r*.35),e.L(t+r*.2,n-r*.35),e.stroke()}];function IS(e,t,n,r,i){FS[t](e,n,r,i)}function LS(e){e.M(160,480),e.C(100,480,60,380,60,250),e.C(60,120,100,20,160,20),e.stroke(),e.M(440,20),e.C(500,20,540,120,540,250),e.C(540,380,500,480,440,480),e.stroke()}for(let e=0;e<20;e++){let t=e+1;MS[9332+e]={width:600,draw:e=>{if(e.lineWidth(25),LS(e),e.lineWidth(24),t<=9)PS(e,t,300,250,200);else{let n=Math.floor(t/10),r=t%10;PS(e,n,240,250,150),PS(e,r,380,250,150)}}}}for(let e=0;e<20;e++){let t=e+1;MS[9352+e]={width:600,draw:e=>{if(e.lineWidth(26),t<=9)PS(e,t,260,250,210);else{let n=Math.floor(t/10),r=t%10;PS(e,n,200,250,160),PS(e,r,340,250,160)}e.circle(t<=9?400:460,80,28),e.fill()}}}for(let e=0;e<26;e++)MS[9372+e]={width:600,draw:t=>{t.lineWidth(25),LS(t),t.lineWidth(24),IS(t,e,300,250,200)}};for(let e=0;e<=20;e++){let t=e+11;MS[9451+e]={width:600,draw:n=>{if(n.lineWidth(55),n.circle(300,250,215),n.stroke(),n.lineWidth(24),e<=9){let e=Math.floor(t/10),r=t%10;PS(n,e,230,250,150),PS(n,r,370,250,150)}else if(e<=19){let t=e-9;t<=9?PS(n,t,300,250,170):(PS(n,1,230,250,140),PS(n,0,370,250,140))}else PS(n,0,300,250,170)}}}function RS(e,t,n,r,i,a,o=35){return{width:600,draw:s=>{a||s.lineWidth(o);for(let a=0;a<e;a++){let o=(a*360/e-90)*(Math.PI/180),c=(a*360/e+180/e-90)*(Math.PI/180);a===0?s.M(t+r*Math.cos(o),n+r*Math.sin(o)):s.L(t+r*Math.cos(o),n+r*Math.sin(o)),s.L(t+i*Math.cos(c),n+i*Math.sin(c))}s.Z(),a?s.fill():s.stroke()}}}let zS={8636:{width:600,draw:e=>{e.lineWidth(45),e.M(500,250),e.L(100,250),e.stroke(),e.M(100,250),e.L(250,380),e.L(250,250),e.Z(),e.fill()}},8637:{width:600,draw:e=>{e.lineWidth(45),e.M(500,250),e.L(100,250),e.stroke(),e.M(100,250),e.L(250,120),e.L(250,250),e.Z(),e.fill()}},8638:{width:600,draw:e=>{e.lineWidth(45),e.M(300,50),e.L(300,450),e.stroke(),e.M(300,450),e.L(430,300),e.L(300,300),e.Z(),e.fill()}},8639:{width:600,draw:e=>{e.lineWidth(45),e.M(300,50),e.L(300,450),e.stroke(),e.M(300,450),e.L(170,300),e.L(300,300),e.Z(),e.fill()}},8640:{width:600,draw:e=>{e.lineWidth(45),e.M(100,250),e.L(500,250),e.stroke(),e.M(500,250),e.L(350,380),e.L(350,250),e.Z(),e.fill()}},8641:{width:600,draw:e=>{e.lineWidth(45),e.M(100,250),e.L(500,250),e.stroke(),e.M(500,250),e.L(350,120),e.L(350,250),e.Z(),e.fill()}},8642:{width:600,draw:e=>{e.lineWidth(45),e.M(300,450),e.L(300,50),e.stroke(),e.M(300,50),e.L(430,200),e.L(300,200),e.Z(),e.fill()}},8643:{width:600,draw:e=>{e.lineWidth(45),e.M(300,450),e.L(300,50),e.stroke(),e.M(300,50),e.L(170,200),e.L(300,200),e.Z(),e.fill()}},8644:{width:600,draw:e=>{e.lineWidth(35),e.M(100,330),e.L(500,330),e.stroke(),e.M(500,330),e.L(380,400),e.L(380,260),e.Z(),e.fill(),e.M(500,170),e.L(100,170),e.stroke(),e.M(100,170),e.L(220,240),e.L(220,100),e.Z(),e.fill()}},8645:{width:600,draw:e=>{e.lineWidth(35),e.M(200,80),e.L(200,420),e.stroke(),e.M(200,420),e.L(130,310),e.L(270,310),e.Z(),e.fill(),e.M(400,420),e.L(400,80),e.stroke(),e.M(400,80),e.L(330,190),e.L(470,190),e.Z(),e.fill()}},8646:{width:600,draw:e=>{e.lineWidth(35),e.M(500,330),e.L(100,330),e.stroke(),e.M(100,330),e.L(220,400),e.L(220,260),e.Z(),e.fill(),e.M(100,170),e.L(500,170),e.stroke(),e.M(500,170),e.L(380,240),e.L(380,100),e.Z(),e.fill()}},8647:{width:600,draw:e=>{e.lineWidth(35),e.M(500,330),e.L(130,330),e.stroke(),e.M(130,330),e.L(250,400),e.L(250,260),e.Z(),e.fill(),e.M(500,170),e.L(130,170),e.stroke(),e.M(130,170),e.L(250,240),e.L(250,100),e.Z(),e.fill()}},8648:{width:600,draw:e=>{e.lineWidth(35),e.M(200,80),e.L(200,420),e.stroke(),e.M(200,420),e.L(130,310),e.L(270,310),e.Z(),e.fill(),e.M(400,80),e.L(400,420),e.stroke(),e.M(400,420),e.L(330,310),e.L(470,310),e.Z(),e.fill()}},8649:{width:600,draw:e=>{e.lineWidth(35),e.M(100,330),e.L(470,330),e.stroke(),e.M(470,330),e.L(350,400),e.L(350,260),e.Z(),e.fill(),e.M(100,170),e.L(470,170),e.stroke(),e.M(470,170),e.L(350,240),e.L(350,100),e.Z(),e.fill()}},8650:{width:600,draw:e=>{e.lineWidth(35),e.M(200,420),e.L(200,80),e.stroke(),e.M(200,80),e.L(130,190),e.L(270,190),e.Z(),e.fill(),e.M(400,420),e.L(400,80),e.stroke(),e.M(400,80),e.L(330,190),e.L(470,190),e.Z(),e.fill()}},8651:{width:600,draw:e=>{e.lineWidth(35),e.M(500,330),e.L(100,330),e.stroke(),e.M(100,330),e.L(220,410),e.L(220,330),e.Z(),e.fill(),e.M(100,170),e.L(500,170),e.stroke(),e.M(500,170),e.L(380,90),e.L(380,170),e.Z(),e.fill()}},8652:{width:600,draw:e=>{e.lineWidth(35),e.M(100,330),e.L(500,330),e.stroke(),e.M(500,330),e.L(380,410),e.L(380,330),e.Z(),e.fill(),e.M(500,170),e.L(100,170),e.stroke(),e.M(100,170),e.L(220,90),e.L(220,170),e.Z(),e.fill()}},8653:{width:600,draw:e=>{e.M(100,250),e.L(280,420),e.L(280,300),e.L(500,300),e.L(500,200),e.L(280,200),e.L(280,80),e.Z(),e.fill(),e.lineWidth(50),e.M(350,120),e.L(250,380),e.stroke()}},8654:{width:600,draw:e=>{e.M(80,250),e.L(220,400),e.L(220,300),e.L(380,300),e.L(380,400),e.L(520,250),e.L(380,100),e.L(380,200),e.L(220,200),e.L(220,100),e.Z(),e.fill(),e.lineWidth(50),e.M(350,120),e.L(250,380),e.stroke()}},8655:{width:600,draw:e=>{e.M(500,250),e.L(320,420),e.L(320,300),e.L(100,300),e.L(100,200),e.L(320,200),e.L(320,80),e.Z(),e.fill(),e.lineWidth(50),e.M(250,120),e.L(350,380),e.stroke()}},8661:{width:600,draw:e=>{e.M(300,480),e.L(460,340),e.L(360,340),e.L(360,160),e.L(460,160),e.L(300,20),e.L(140,160),e.L(240,160),e.L(240,340),e.L(140,340),e.Z(),e.fill()}},8662:{width:600,draw:e=>{e.M(100,460),e.L(100,260),e.L(200,310),e.L(380,130),e.L(430,180),e.L(250,360),e.L(300,460),e.Z(),e.fill()}},8663:{width:600,draw:e=>{e.M(500,460),e.L(300,460),e.L(350,360),e.L(170,180),e.L(220,130),e.L(400,310),e.L(500,260),e.Z(),e.fill()}},8664:{width:600,draw:e=>{e.M(500,40),e.L(500,240),e.L(400,190),e.L(220,370),e.L(170,320),e.L(350,140),e.L(300,40),e.Z(),e.fill()}},8665:{width:600,draw:e=>{e.M(100,40),e.L(300,40),e.L(250,140),e.L(430,320),e.L(380,370),e.L(200,190),e.L(100,240),e.Z(),e.fill()}},8666:{width:600,draw:e=>{e.lineWidth(30),e.M(500,310),e.L(200,310),e.stroke(),e.M(500,250),e.L(200,250),e.stroke(),e.M(500,190),e.L(200,190),e.stroke(),e.M(100,250),e.L(250,400),e.L(250,100),e.Z(),e.fill()}},8667:{width:600,draw:e=>{e.lineWidth(30),e.M(100,310),e.L(400,310),e.stroke(),e.M(100,250),e.L(400,250),e.stroke(),e.M(100,190),e.L(400,190),e.stroke(),e.M(500,250),e.L(350,400),e.L(350,100),e.Z(),e.fill()}},8668:{width:600,draw:e=>{e.lineWidth(40),e.M(500,250),e.C(440,330,380,170,300,250),e.C(220,330,180,170,130,250),e.stroke(),e.M(130,250),e.L(230,350),e.L(230,150),e.Z(),e.fill()}},8669:{width:600,draw:e=>{e.lineWidth(40),e.M(100,250),e.C(160,330,220,170,300,250),e.C(380,330,420,170,470,250),e.stroke(),e.M(470,250),e.L(370,350),e.L(370,150),e.Z(),e.fill()}},8670:{width:600,draw:e=>{e.lineWidth(45),e.M(300,50),e.L(300,450),e.stroke(),e.M(300,450),e.L(180,320),e.L(420,320),e.Z(),e.fill(),e.lineWidth(40),e.M(200,200),e.L(400,200),e.stroke(),e.M(200,130),e.L(400,130),e.stroke()}},8671:{width:600,draw:e=>{e.lineWidth(45),e.M(300,450),e.L(300,50),e.stroke(),e.M(300,50),e.L(180,180),e.L(420,180),e.Z(),e.fill(),e.lineWidth(40),e.M(200,300),e.L(400,300),e.stroke(),e.M(200,370),e.L(400,370),e.stroke()}},8672:{width:600,draw:e=>{e.lineWidth(45),e.M(500,250),e.L(430,250),e.stroke(),e.M(370,250),e.L(300,250),e.stroke(),e.M(240,250),e.L(170,250),e.stroke(),e.M(100,250),e.L(230,370),e.L(230,130),e.Z(),e.fill()}},8673:{width:600,draw:e=>{e.lineWidth(45),e.M(300,50),e.L(300,120),e.stroke(),e.M(300,180),e.L(300,250),e.stroke(),e.M(300,310),e.L(300,380),e.stroke(),e.M(300,450),e.L(180,320),e.L(420,320),e.Z(),e.fill()}},8674:{width:600,draw:e=>{e.lineWidth(45),e.M(100,250),e.L(170,250),e.stroke(),e.M(230,250),e.L(300,250),e.stroke(),e.M(360,250),e.L(430,250),e.stroke(),e.M(500,250),e.L(370,370),e.L(370,130),e.Z(),e.fill()}},8675:{width:600,draw:e=>{e.lineWidth(45),e.M(300,450),e.L(300,380),e.stroke(),e.M(300,320),e.L(300,250),e.stroke(),e.M(300,190),e.L(300,120),e.stroke(),e.M(300,50),e.L(180,180),e.L(420,180),e.Z(),e.fill()}},8676:{width:600,draw:e=>{e.lineWidth(45),e.M(500,250),e.L(150,250),e.stroke(),e.M(150,250),e.L(280,370),e.L(280,130),e.Z(),e.fill(),e.M(100,100),e.L(100,400),e.stroke()}},8677:{width:600,draw:e=>{e.lineWidth(45),e.M(100,250),e.L(450,250),e.stroke(),e.M(450,250),e.L(320,370),e.L(320,130),e.Z(),e.fill(),e.M(500,100),e.L(500,400),e.stroke()}},8678:{width:600,draw:e=>{e.lineWidth(40),e.M(80,250),e.L(250,430),e.L(250,320),e.L(520,320),e.L(520,180),e.L(250,180),e.L(250,70),e.Z(),e.stroke()}},8679:{width:600,draw:e=>{e.lineWidth(40),e.M(300,470),e.L(500,270),e.L(390,270),e.L(390,30),e.L(210,30),e.L(210,270),e.L(100,270),e.Z(),e.stroke()}},8680:{width:600,draw:e=>{e.lineWidth(40),e.M(520,250),e.L(350,430),e.L(350,320),e.L(80,320),e.L(80,180),e.L(350,180),e.L(350,70),e.Z(),e.stroke()}},8681:{width:600,draw:e=>{e.lineWidth(40),e.M(300,30),e.L(100,230),e.L(210,230),e.L(210,470),e.L(390,470),e.L(390,230),e.L(500,230),e.Z(),e.stroke()}},8682:{width:600,draw:e=>{e.lineWidth(40),e.M(300,470),e.L(490,280),e.L(380,280),e.L(380,100),e.L(220,100),e.L(220,280),e.L(110,280),e.Z(),e.stroke(),e.M(130,40),e.L(470,40),e.stroke()}},8693:{width:600,draw:e=>{e.lineWidth(35),e.M(200,420),e.L(200,80),e.stroke(),e.M(200,80),e.L(130,190),e.L(270,190),e.Z(),e.fill(),e.M(400,80),e.L(400,420),e.stroke(),e.M(400,420),e.L(330,310),e.L(470,310),e.Z(),e.fill()}}},BS={10024:{width:600,draw:e=>{e.M(300,420),e.L(270,300),e.L(180,280),e.L(270,260),e.L(300,140),e.L(330,260),e.L(420,280),e.L(330,300),e.Z(),e.fill(),e.M(440,460),e.L(430,420),e.L(400,410),e.L(430,400),e.L(440,360),e.L(450,400),e.L(480,410),e.L(450,420),e.Z(),e.fill(),e.M(160,170),e.L(150,130),e.L(120,120),e.L(150,110),e.L(160,70),e.L(170,110),e.L(200,120),e.L(170,130),e.Z(),e.fill()}},10025:RS(5,300,260,220,90,!1,40),10026:{width:600,draw:e=>{e.lineWidth(35),e.circle(300,260,230),e.stroke();for(let t=0;t<5;t++){let n=(t*72-90)*Math.PI/180,r=(t*72+36-90)*Math.PI/180;t===0?e.M(300+180*Math.cos(n),260+180*Math.sin(n)):e.L(300+180*Math.cos(n),260+180*Math.sin(n)),e.L(300+70*Math.cos(r),260+70*Math.sin(r))}e.Z(),e.stroke()}},10027:RS(5,300,260,230,110,!0),10028:{width:600,draw:e=>{e.lineWidth(40);for(let t=0;t<5;t++){let n=(t*72-90)*Math.PI/180,r=(t*72+36-90)*Math.PI/180;t===0?e.M(300+220*Math.cos(n),260+220*Math.sin(n)):e.L(300+220*Math.cos(n),260+220*Math.sin(n)),e.L(300+90*Math.cos(r),260+90*Math.sin(r))}e.Z(),e.stroke(),e.circle(300,260,60),e.fill()}},10029:RS(5,300,260,230,100,!0),10030:RS(5,300,260,240,105,!0),10031:RS(5,300,260,220,80,!1,30),10033:{width:600,draw:e=>{e.lineWidth(60);for(let t=0;t<360;t+=60){let n=t*Math.PI/180;e.M(300,250),e.L(300+200*Math.cos(n),250+200*Math.sin(n))}e.stroke()}},10034:{width:600,draw:e=>{e.lineWidth(40);for(let t=0;t<360;t+=60){let n=t*Math.PI/180;e.M(300+60*Math.cos(n),250+60*Math.sin(n)),e.L(300+200*Math.cos(n),250+200*Math.sin(n))}e.stroke()}},10035:{width:600,draw:e=>{e.lineWidth(45);for(let t=0;t<360;t+=45){let n=t*Math.PI/180;e.M(300,250),e.L(300+190*Math.cos(n),250+190*Math.sin(n))}e.stroke()}},10036:RS(8,300,260,220,100,!0),10037:RS(8,300,260,220,80,!1,30),10038:RS(6,300,260,220,110,!0),10039:RS(8,300,260,220,90,!0),10040:RS(8,300,260,230,80,!0),10041:RS(12,300,260,220,130,!0),10042:RS(16,300,260,220,140,!0),10043:RS(6,300,260,220,80,!0),10044:RS(6,300,260,220,80,!1,35),10045:RS(6,300,260,230,70,!0),10046:RS(6,300,260,210,120,!1,40),10047:RS(6,300,260,210,120,!0),10048:RS(6,300,260,210,120,!1,35),10049:RS(8,300,260,210,130,!1,40),10050:{width:600,draw:e=>{e.lineWidth(30),e.circle(300,260,230),e.stroke();for(let t=0;t<8;t++){let n=(t*45-90)*Math.PI/180,r=(t*45+22.5-90)*Math.PI/180;t===0?e.M(300+190*Math.cos(n),260+190*Math.sin(n)):e.L(300+190*Math.cos(n),260+190*Math.sin(n)),e.L(300+100*Math.cos(r),260+100*Math.sin(r))}e.Z(),e.stroke()}},10051:RS(8,300,260,220,70,!0),10052:{width:600,draw:e=>{e.lineWidth(35);for(let t=0;t<360;t+=60){let n=t*Math.PI/180;e.M(300,250),e.L(300+200*Math.cos(n),250+200*Math.sin(n))}e.stroke(),e.lineWidth(25);for(let t=0;t<360;t+=60){let n=t*Math.PI/180,r=300+130*Math.cos(n),i=250+130*Math.sin(n),a=n+Math.PI/2;e.M(r+40*Math.cos(a),i+40*Math.sin(a)),e.L(r-40*Math.cos(a),i-40*Math.sin(a))}e.stroke()}},10053:{width:600,draw:e=>{e.lineWidth(40);for(let t=0;t<360;t+=60){let n=t*Math.PI/180;e.M(300,250),e.L(300+190*Math.cos(n),250+190*Math.sin(n))}e.stroke()}},10054:{width:600,draw:e=>{e.lineWidth(45);for(let t=0;t<360;t+=60){let n=t*Math.PI/180;e.M(300,250),e.L(300+200*Math.cos(n),250+200*Math.sin(n))}e.stroke()}},10055:{width:600,draw:e=>{e.M(300,480),e.L(260,290),e.L(100,250),e.L(260,210),e.L(300,20),e.L(340,210),e.L(500,250),e.L(340,290),e.Z(),e.fill()}},10056:{width:600,draw:e=>{e.M(300,490),e.L(250,300),e.L(80,250),e.L(250,200),e.L(300,10),e.L(350,200),e.L(520,250),e.L(350,300),e.Z(),e.fill()}},10057:{width:600,draw:e=>{e.lineWidth(55);for(let t=0;t<360;t+=45){let n=t*Math.PI/180;e.M(300,250),e.L(300+180*Math.cos(n),250+180*Math.sin(n))}e.stroke()}},10058:RS(8,300,260,220,60,!0),10059:RS(8,300,260,230,50,!0),10060:{width:600,draw:e=>{e.lineWidth(80),e.M(120,70),e.L(480,430),e.stroke(),e.M(120,430),e.L(480,70),e.stroke()}},10061:{width:600,draw:e=>{e.lineWidth(50),e.circle(300,260,190),e.stroke(),e.lineWidth(25),e.M(420,100),e.C(500,140,530,240,490,340),e.stroke()}},10062:{width:600,draw:e=>{e.rect(80,30,440,440),e.fill()}},10067:{width:600,draw:e=>{e.lineWidth(65),e.M(200,400),e.C(200,500,400,500,400,400),e.C(400,320,300,300,300,220),e.stroke(),e.circle(300,100,40),e.fill()}},10068:{width:600,draw:e=>{e.lineWidth(50),e.M(200,400),e.C(200,500,400,500,400,400),e.C(400,320,300,300,300,220),e.stroke(),e.lineWidth(40),e.circle(300,100,35),e.stroke()}},10069:{width:600,draw:e=>{e.lineWidth(50),e.M(300,480),e.L(300,180),e.stroke(),e.lineWidth(40),e.circle(300,80,35),e.stroke()}},10071:{width:600,draw:e=>{e.lineWidth(75),e.M(300,480),e.L(300,180),e.stroke(),e.circle(300,70,45),e.fill()}},10082:{width:600,draw:e=>{e.lineWidth(55),e.M(300,480),e.L(300,200),e.stroke(),e.circle(300,100,35),e.fill(),e.circle(300,500,20),e.fill()}},10083:{width:600,draw:e=>{e.M(300,320),e.C(300,320,180,400,180,450),e.C(180,490,240,510,300,510),e.C(360,510,420,490,420,450),e.C(420,400,300,320,300,320),e.Z(),e.fill(),e.lineWidth(55),e.M(300,300),e.L(300,130),e.stroke(),e.circle(300,50,35),e.fill()}},10085:{width:600,draw:e=>{e.M(250,80),e.C(250,80,80,200,80,310),e.C(80,400,160,440,250,440),e.C(340,440,400,400,400,310),e.C(400,200,250,80,250,80),e.Z(),e.fill()}},10086:{width:600,draw:e=>{e.lineWidth(35),e.M(300,80),e.C(300,80,100,220,100,340),e.C(100,440,190,490,300,490),e.C(410,490,500,440,500,340),e.C(500,220,300,80,300,80),e.Z(),e.stroke(),e.M(300,150),e.C(250,200,200,300,300,400),e.C(400,300,350,200,300,150),e.stroke()}},10087:{width:600,draw:e=>{e.lineWidth(35),e.M(250,80),e.C(250,80,80,200,80,310),e.C(80,400,160,440,250,440),e.C(340,440,400,400,400,310),e.C(400,200,250,80,250,80),e.Z(),e.stroke()}},10133:{width:600,draw:e=>{e.rect(220,50,160,400),e.fill(),e.rect(100,170,400,160),e.fill()}},10134:{width:600,draw:e=>{e.rect(100,180,400,140),e.fill()}},10135:{width:600,draw:e=>{e.rect(100,200,400,100),e.fill(),e.circle(300,400,50),e.fill(),e.circle(300,100,50),e.fill()}},10136:{width:600,draw:e=>{e.M(480,50),e.L(480,250),e.L(320,200),e.L(140,430),e.L(100,400),e.L(280,170),e.L(230,50),e.Z(),e.fill()}},10137:{width:600,draw:e=>{e.M(520,250),e.L(340,430),e.L(340,310),e.L(80,310),e.L(80,190),e.L(340,190),e.L(340,70),e.Z(),e.fill()}},10138:{width:600,draw:e=>{e.M(480,450),e.L(230,450),e.L(280,330),e.L(100,100),e.L(140,70),e.L(320,300),e.L(480,250),e.Z(),e.fill()}},10139:{width:600,draw:e=>{e.M(520,250),e.L(350,400),e.L(350,280),e.L(80,250),e.L(350,220),e.L(350,100),e.Z(),e.fill()}},10141:{width:600,draw:e=>{e.lineWidth(40),e.M(80,250),e.L(400,250),e.stroke(),e.M(520,250),e.L(370,380),e.L(370,120),e.Z(),e.fill()}},10142:{width:600,draw:e=>{e.lineWidth(50),e.M(80,250),e.L(380,250),e.stroke(),e.M(530,250),e.L(350,420),e.L(350,80),e.Z(),e.fill()}},10143:{width:600,draw:e=>{e.lineWidth(40),e.M(80,250),e.L(160,250),e.stroke(),e.M(210,250),e.L(290,250),e.stroke(),e.M(340,250),e.L(400,250),e.stroke(),e.M(520,250),e.L(370,380),e.L(370,120),e.Z(),e.fill()}},10144:{width:600,draw:e=>{e.lineWidth(55),e.M(80,250),e.L(170,250),e.stroke(),e.M(230,250),e.L(350,250),e.stroke(),e.M(530,250),e.L(350,420),e.L(350,80),e.Z(),e.fill()}},10146:{width:600,draw:e=>{e.M(520,250),e.L(200,430),e.L(280,250),e.L(200,70),e.Z(),e.fill()}},10147:{width:600,draw:e=>{e.lineWidth(40),e.M(520,250),e.L(200,430),e.L(280,250),e.L(200,70),e.Z(),e.stroke()}},10148:{width:600,draw:e=>{e.M(520,250),e.L(100,450),e.L(100,50),e.Z(),e.fill()}},10149:{width:600,draw:e=>{e.M(500,200),e.L(380,320),e.L(380,240),e.C(300,240,200,280,150,380),e.L(100,380),e.C(140,220,260,150,380,150),e.L(380,80),e.Z(),e.fill()}},10150:{width:600,draw:e=>{e.M(500,300),e.L(380,420),e.L(380,350),e.C(260,350,140,280,100,120),e.L(150,120),e.C(200,220,300,260,380,260),e.L(380,180),e.Z(),e.fill()}},10151:{width:600,draw:e=>{e.M(500,250),e.L(350,380),e.L(350,310),e.L(100,310),e.L(100,190),e.L(350,190),e.L(350,120),e.Z(),e.fill()}},10152:{width:600,draw:e=>{e.M(520,250),e.L(320,440),e.L(320,310),e.L(80,310),e.C(150,250,150,250,80,190),e.L(320,190),e.L(320,60),e.Z(),e.fill()}},10153:{width:600,draw:e=>{e.lineWidth(35),e.M(520,250),e.L(340,430),e.L(340,310),e.L(80,310),e.L(80,190),e.L(340,190),e.L(340,70),e.Z(),e.stroke()}},10154:{width:600,draw:e=>{e.lineWidth(35),e.M(520,250),e.L(340,430),e.L(340,310),e.L(80,310),e.L(80,190),e.L(340,190),e.L(340,70),e.Z(),e.fillStroke()}},10155:{width:600,draw:e=>{e.M(520,250),e.L(340,440),e.L(340,310),e.L(100,310),e.L(100,190),e.L(340,190),e.L(340,60),e.Z(),e.fill()}},10156:{width:600,draw:e=>{e.lineWidth(40),e.M(520,250),e.L(340,440),e.L(340,310),e.L(100,310),e.L(100,190),e.L(340,190),e.L(340,60),e.Z(),e.fillStroke()}},10157:{width:600,draw:e=>{e.lineWidth(45),e.M(510,250),e.L(340,420),e.L(340,310),e.L(90,310),e.L(90,190),e.L(340,190),e.L(340,80),e.Z(),e.stroke()}},10158:{width:600,draw:e=>{e.lineWidth(50),e.M(510,250),e.L(340,420),e.L(340,310),e.L(90,310),e.L(90,190),e.L(340,190),e.L(340,80),e.Z(),e.stroke()}},10159:{width:600,draw:e=>{e.M(520,250),e.L(350,430),e.L(350,310),e.L(100,310),e.L(140,250),e.L(100,190),e.L(350,190),e.L(350,70),e.Z(),e.fill()}},10161:{width:600,draw:e=>{e.lineWidth(40),e.M(520,250),e.L(350,430),e.L(350,310),e.L(100,310),e.L(140,250),e.L(100,190),e.L(350,190),e.L(350,70),e.Z(),e.stroke()}},10162:{width:600,draw:e=>{e.circle(300,250,230),e.fill()}},10163:{width:600,draw:e=>{e.lineWidth(30),e.M(80,250),e.L(450,250),e.stroke(),e.M(520,250),e.L(400,350),e.L(400,150),e.Z(),e.fill(),e.lineWidth(20),e.M(120,250),e.L(80,320),e.stroke(),e.M(120,250),e.L(80,180),e.stroke()}},10164:{width:600,draw:e=>{e.M(480,50),e.L(480,220),e.L(200,400),e.L(250,50),e.Z(),e.fill()}},10165:{width:600,draw:e=>{e.M(520,250),e.L(390,360),e.L(390,275),e.L(80,275),e.L(120,250),e.L(80,225),e.L(390,225),e.L(390,140),e.Z(),e.fill()}},10166:{width:600,draw:e=>{e.M(480,450),e.L(250,450),e.L(200,100),e.L(480,280),e.Z(),e.fill()}},10167:{width:600,draw:e=>{e.M(500,50),e.L(500,240),e.L(180,420),e.L(230,50),e.Z(),e.fill()}},10168:{width:600,draw:e=>{e.M(530,250),e.L(380,380),e.L(380,290),e.L(70,290),e.L(120,250),e.L(70,210),e.L(380,210),e.L(380,120),e.Z(),e.fill()}},10169:{width:600,draw:e=>{e.M(500,450),e.L(230,450),e.L(180,80),e.L(500,260),e.Z(),e.fill()}},10170:{width:600,draw:e=>{e.M(520,250),e.L(370,380),e.L(370,270),e.C(200,270,120,260,80,250),e.C(120,240,200,230,370,230),e.L(370,120),e.Z(),e.fill()}},10171:{width:600,draw:e=>{e.M(530,250),e.L(380,400),e.L(380,290),e.C(250,290,150,280,70,250),e.C(150,220,250,210,380,210),e.L(380,100),e.Z(),e.fill()}},10172:{width:600,draw:e=>{e.lineWidth(35),e.M(80,310),e.L(400,260),e.stroke(),e.M(80,190),e.L(400,240),e.stroke(),e.M(520,250),e.L(380,370),e.L(380,130),e.Z(),e.fill()}},10173:{width:600,draw:e=>{e.M(530,250),e.L(380,400),e.L(380,280),e.L(70,320),e.L(70,180),e.L(380,220),e.L(380,100),e.Z(),e.fill()}},10174:{width:600,draw:e=>{e.lineWidth(35),e.M(510,250),e.L(340,420),e.L(340,310),e.L(90,310),e.L(90,190),e.L(340,190),e.L(340,80),e.Z(),e.stroke()}}},VS={9730:{width:600,draw:e=>{e.lineWidth(40),e.M(80,280),e.C(80,480,300,520,300,520),e.C(300,520,520,480,520,280),e.L(80,280),e.stroke(),e.M(300,280),e.L(300,80),e.C(300,30,260,20,240,50),e.stroke()}},9731:{width:600,draw:e=>{e.lineWidth(35),e.circle(300,100,80),e.stroke(),e.circle(300,260,110),e.stroke(),e.circle(300,430,70),e.stroke()}},9732:{width:600,draw:e=>{e.circle(420,380,70),e.fill(),e.lineWidth(30),e.M(370,420),e.C(250,470,100,480,80,460),e.stroke(),e.M(380,440),e.C(280,490,120,500,80,490),e.stroke()}},9748:{width:600,draw:e=>{e.lineWidth(35),e.M(80,300),e.C(80,480,300,500,300,500),e.C(300,500,520,480,520,300),e.L(80,300),e.stroke(),e.M(300,300),e.L(300,100),e.C(300,50,260,40,240,70),e.stroke(),e.lineWidth(25),e.M(150,200),e.L(130,160),e.stroke(),e.M(300,180),e.L(280,140),e.stroke(),e.M(450,200),e.L(430,160),e.stroke()}},9749:{width:600,draw:e=>{e.lineWidth(40),e.M(120,50),e.L(120,300),e.L(400,300),e.L(400,50),e.stroke(),e.M(400,250),e.C(480,250,500,180,480,120),e.C(460,80,400,80,400,100),e.stroke(),e.lineWidth(25),e.M(200,340),e.C(200,380,220,400,200,440),e.stroke(),e.M(300,340),e.C(300,380,320,400,300,440),e.stroke()}},9752:{width:600,draw:e=>{e.circle(300,370,80),e.fill(),e.circle(220,280,80),e.fill(),e.circle(380,280,80),e.fill(),e.lineWidth(30),e.M(300,290),e.C(300,200,280,100,260,50),e.stroke()}},9760:{width:600,draw:e=>{e.lineWidth(35),e.circle(300,350,120),e.stroke(),e.circle(260,370,25),e.fill(),e.circle(340,370,25),e.fill(),e.M(250,260),e.L(350,260),e.stroke(),e.lineWidth(30),e.M(130,100),e.L(470,200),e.stroke(),e.M(130,200),e.L(470,100),e.stroke()}},9762:{width:600,draw:e=>{e.circle(300,250,40),e.fill(),e.lineWidth(35);for(let t=0;t<3;t++){let n=(t*120-90)*Math.PI/180,r=300+70*Math.cos(n-.4),i=250+70*Math.sin(n-.4),a=300+200*Math.cos(n-.4),o=250+200*Math.sin(n-.4),s=300+200*Math.cos(n+.4),c=250+200*Math.sin(n+.4),l=300+70*Math.cos(n+.4),u=250+70*Math.sin(n+.4);e.M(r,i),e.L(a,o),e.L(s,c),e.L(l,u),e.Z(),e.fill()}}},9763:{width:600,draw:e=>{e.lineWidth(35);for(let t=0;t<3;t++){let n=(t*120-90)*Math.PI/180;e.circle(300+90*Math.cos(n),250+90*Math.sin(n),110),e.stroke()}e.circle(300,250,25),e.fill()}},9766:{width:600,draw:e=>{e.lineWidth(45),e.M(300,0),e.L(300,500),e.stroke(),e.M(180,400),e.L(420,400),e.stroke(),e.M(180,120),e.L(420,80),e.stroke(),e.M(220,460),e.L(380,460),e.stroke()}},9784:{width:600,draw:e=>{e.lineWidth(35),e.circle(300,250,200),e.stroke();for(let t=0;t<360;t+=45){let n=t*Math.PI/180;e.M(300,250),e.L(300+200*Math.cos(n),250+200*Math.sin(n))}e.stroke(),e.circle(300,250,40),e.fill()}},9788:{width:600,draw:e=>{e.lineWidth(35),e.circle(300,250,110),e.stroke();for(let t=0;t<360;t+=30){let n=t*Math.PI/180;e.M(300+130*Math.cos(n),250+130*Math.sin(n)),e.L(300+210*Math.cos(n),250+210*Math.sin(n))}e.stroke()}},9800:{width:600,draw:e=>{e.lineWidth(45),e.M(150,50),e.C(150,300,300,400,300,480),e.stroke(),e.M(450,50),e.C(450,300,300,400,300,480),e.stroke()}},9801:{width:600,draw:e=>{e.lineWidth(45),e.circle(300,200,150),e.stroke(),e.M(100,430),e.C(200,500,400,500,500,430),e.stroke()}},9802:{width:600,draw:e=>{e.lineWidth(45),e.M(120,450),e.C(200,500,400,500,480,450),e.stroke(),e.M(120,50),e.C(200,0,400,0,480,50),e.stroke(),e.M(220,450),e.L(220,50),e.stroke(),e.M(380,450),e.L(380,50),e.stroke()}},9803:{width:600,draw:e=>{e.lineWidth(45),e.M(480,380),e.C(300,500,120,380,120,300),e.stroke(),e.circle(200,350,60),e.fill(),e.M(120,120),e.C(300,0,480,120,480,200),e.stroke(),e.circle(400,150,60),e.fill()}},9804:{width:600,draw:e=>{e.lineWidth(45),e.circle(200,150,100),e.stroke(),e.M(300,150),e.C(400,150,480,250,480,350),e.C(480,450,420,480,380,430),e.stroke()}},9805:{width:600,draw:e=>{e.lineWidth(40),e.M(100,50),e.L(100,400),e.C(100,480,200,480,200,400),e.L(200,50),e.stroke(),e.M(200,400),e.C(200,480,300,480,300,400),e.L(300,50),e.stroke(),e.M(300,300),e.L(480,100),e.stroke()}},9806:{width:600,draw:e=>{e.lineWidth(45),e.M(100,50),e.L(500,50),e.stroke(),e.M(100,200),e.L(500,200),e.stroke(),e.M(300,200),e.C(150,200,100,350,200,420),e.stroke(),e.M(300,200),e.C(450,200,500,350,400,420),e.stroke()}},9807:{width:600,draw:e=>{e.lineWidth(40),e.M(100,50),e.L(100,400),e.C(100,480,200,480,200,400),e.L(200,50),e.stroke(),e.M(200,400),e.C(200,480,300,480,300,400),e.L(300,50),e.stroke(),e.M(300,50),e.L(400,50),e.L(350,100),e.stroke()}},9808:{width:600,draw:e=>{e.lineWidth(45),e.M(120,80),e.L(480,440),e.stroke(),e.M(480,440),e.L(350,440),e.stroke(),e.M(480,440),e.L(480,310),e.stroke(),e.M(200,260),e.L(380,160),e.stroke()}},9809:{width:600,draw:e=>{e.lineWidth(45),e.M(100,450),e.L(100,200),e.C(100,100,200,50,300,100),e.C(400,150,450,100,450,50),e.stroke(),e.M(450,50),e.C(500,100,500,200,420,250),e.stroke()}},9810:{width:600,draw:e=>{e.lineWidth(45),e.M(80,350),e.C(150,400,250,300,300,350),e.C(350,400,450,300,520,350),e.stroke(),e.M(80,200),e.C(150,250,250,150,300,200),e.C(350,250,450,150,520,200),e.stroke()}},9811:{width:600,draw:e=>{e.lineWidth(45),e.M(120,100),e.C(200,250,200,250,120,400),e.stroke(),e.M(480,100),e.C(400,250,400,250,480,400),e.stroke(),e.M(120,250),e.L(480,250),e.stroke()}},9825:{width:600,draw:e=>{e.lineWidth(35),e.M(300,80),e.C(300,80,80,200,80,340),e.C(80,440,180,490,300,490),e.C(420,490,520,440,520,340),e.C(520,200,300,80,300,80),e.Z(),e.stroke()}},9826:{width:600,draw:e=>{e.lineWidth(35),e.M(300,500),e.L(500,250),e.L(300,0),e.L(100,250),e.Z(),e.stroke()}},9828:{width:600,draw:e=>{e.lineWidth(35),e.M(300,500),e.C(300,500,80,350,80,200),e.C(80,100,200,50,300,180),e.C(400,50,520,100,520,200),e.C(520,350,300,500,300,500),e.Z(),e.stroke(),e.lineWidth(30),e.M(280,0),e.L(320,0),e.L(310,140),e.L(290,140),e.Z(),e.stroke()}},9831:{width:600,draw:e=>{e.lineWidth(35),e.circle(300,370,100),e.stroke(),e.circle(195,240,90),e.stroke(),e.circle(405,240,90),e.stroke(),e.lineWidth(30),e.M(280,0),e.L(320,0),e.L(310,180),e.L(290,180),e.Z(),e.stroke()}},9851:{width:600,draw:e=>{e.lineWidth(40);for(let t=0;t<3;t++){let n=(t*120+30)*Math.PI/180,r=(t*120+90)*Math.PI/180;e.M(300+180*Math.cos(n),240+180*Math.sin(n)),e.C(300+180*1.2*Math.cos((n+r)/2),240+180*1.2*Math.sin((n+r)/2),300+180*1.2*Math.cos((n+r)/2),240+180*1.2*Math.sin((n+r)/2),300+180*Math.cos(r),240+180*Math.sin(r))}e.stroke();for(let t=0;t<3;t++){let n=(t*120+90)*Math.PI/180,r=(t*120+120)*Math.PI/180,i=300+180*Math.cos(n),a=240+180*Math.sin(n);e.M(i,a),e.L(i+40*Math.cos(r+2.5),a+40*Math.sin(r+2.5)),e.L(i+40*Math.cos(r-2.5),a+40*Math.sin(r-2.5)),e.Z(),e.fill()}}},9854:{width:600,draw:e=>{e.lineWidth(35),e.M(300,250),e.C(300,350,420,380,450,300),e.C(480,220,420,150,380,180),e.C(340,210,300,250,300,250),e.C(300,250,260,290,220,320),e.C(180,350,120,280,150,200),e.C(180,120,300,150,300,250),e.stroke()}},9855:{width:600,draw:e=>{e.lineWidth(40),e.circle(280,420,40),e.fill(),e.M(280,380),e.L(280,220),e.L(380,220),e.stroke(),e.circle(300,160,100),e.stroke(),e.M(380,220),e.L(420,80),e.stroke()}},9874:{width:600,draw:e=>{e.lineWidth(40),e.M(150,80),e.L(400,380),e.stroke(),e.M(450,80),e.L(200,380),e.stroke(),e.M(350,350),e.L(450,420),e.stroke(),e.M(150,420),e.L(250,350),e.stroke()}},9875:{width:600,draw:e=>{e.lineWidth(45),e.circle(300,440,40),e.stroke(),e.M(300,400),e.L(300,80),e.stroke(),e.M(180,320),e.L(420,320),e.stroke(),e.M(300,80),e.C(150,80,100,150,130,200),e.stroke(),e.M(300,80),e.C(450,80,500,150,470,200),e.stroke()}},9876:{width:600,draw:e=>{e.lineWidth(40),e.M(100,50),e.L(500,450),e.stroke(),e.M(500,50),e.L(100,450),e.stroke(),e.lineWidth(30),e.M(140,130),e.L(200,70),e.stroke(),e.M(460,130),e.L(400,70),e.stroke()}},9877:{width:600,draw:e=>{e.lineWidth(40),e.M(300,20),e.L(300,480),e.stroke(),e.lineWidth(30),e.M(300,380),e.C(400,380,420,320,300,300),e.C(180,280,200,220,300,200),e.C(400,180,380,120,300,120),e.stroke()}},9878:{width:600,draw:e=>{e.lineWidth(35),e.M(100,350),e.L(500,350),e.stroke(),e.M(300,350),e.L(300,80),e.stroke(),e.M(200,80),e.L(400,80),e.stroke(),e.M(100,350),e.C(100,250,180,220,220,250),e.stroke(),e.M(500,350),e.C(500,250,420,220,380,250),e.stroke()}},9879:{width:600,draw:e=>{e.lineWidth(35),e.M(200,50),e.L(400,50),e.L(480,250),e.C(500,300,460,350,400,350),e.L(200,350),e.C(140,350,100,300,120,250),e.L(200,50),e.Z(),e.stroke(),e.M(250,350),e.L(250,450),e.stroke(),e.M(350,350),e.L(350,450),e.stroke()}},9881:{width:600,draw:e=>{e.lineWidth(30),e.circle(300,250,100),e.stroke();for(let t=0;t<8;t++){let n=t*360/8*(Math.PI/180),r=15*Math.PI/180;e.M(300+130*Math.cos(n-r),250+130*Math.sin(n-r)),e.L(300+200*Math.cos(n-r*.7),250+200*Math.sin(n-r*.7)),e.L(300+200*Math.cos(n+r*.7),250+200*Math.sin(n+r*.7)),e.L(300+130*Math.cos(n+r),250+130*Math.sin(n+r))}e.fill(),e.circle(300,250,130),e.stroke()}},9883:{width:600,draw:e=>{e.lineWidth(30),e.ellipse(300,250,220,80),e.stroke(),e.M(130,100),e.C(200,50,440,300,470,400),e.C(440,450,200,200,130,100),e.stroke(),e.M(470,100),e.C(400,50,160,300,130,400),e.C(160,450,400,200,470,100),e.stroke(),e.circle(300,250,25),e.fill()}},9884:{width:600,draw:e=>{e.lineWidth(30),e.M(300,480),e.C(280,400,260,300,300,200),e.C(340,300,320,400,300,480),e.stroke(),e.M(300,300),e.C(200,350,100,400,100,350),e.C(100,300,180,250,250,200),e.stroke(),e.M(300,300),e.C(400,350,500,400,500,350),e.C(500,300,420,250,350,200),e.stroke(),e.M(200,100),e.L(400,100),e.stroke(),e.M(300,200),e.L(300,100),e.stroke()}},9893:{width:600,draw:e=>{e.lineWidth(40),e.circle(280,270,120),e.stroke(),e.M(280,150),e.L(280,30),e.stroke(),e.M(220,90),e.L(340,90),e.stroke(),e.M(370,350),e.L(490,460),e.stroke(),e.M(420,460),e.L(490,460),e.L(490,390),e.stroke()}},9895:{width:600,draw:e=>{e.lineWidth(35),e.circle(300,220,110),e.stroke(),e.M(375,295),e.L(480,420),e.stroke(),e.M(420,420),e.L(480,420),e.L(480,360),e.stroke(),e.M(300,110),e.L(300,20),e.stroke(),e.M(250,60),e.L(350,60),e.stroke()}},9904:{width:600,draw:e=>{e.lineWidth(40),e.M(200,480),e.L(140,300),e.L(200,20),e.L(400,20),e.L(460,300),e.L(400,480),e.Z(),e.stroke()}},9917:{width:600,draw:e=>{e.lineWidth(35),e.circle(300,250,200),e.stroke();for(let t=0;t<5;t++){let n=(t*72-90)*Math.PI/180,r=((t+1)*72-90)*Math.PI/180;t===0&&e.M(300+80*Math.cos(n),250+80*Math.sin(n)),e.L(300+80*Math.cos(r),250+80*Math.sin(r))}e.Z(),e.fill()}},9918:{width:600,draw:e=>{e.lineWidth(35),e.circle(300,250,200),e.stroke(),e.lineWidth(25),e.M(150,400),e.C(200,300,200,200,150,100),e.stroke(),e.M(450,400),e.C(400,300,400,200,450,100),e.stroke()}},9924:{width:600,draw:e=>{e.circle(300,140,100),e.fill(),e.circle(300,350,70),e.fill()}},9925:{width:600,draw:e=>{e.lineWidth(30),e.M(420,420),e.C(480,420,520,380,520,320),e.stroke();for(let t=-30;t<=60;t+=30){let n=t*Math.PI/180;e.M(460+60*Math.cos(n),360+60*Math.sin(n)),e.L(460+100*Math.cos(n),360+100*Math.sin(n))}e.stroke(),e.lineWidth(35),e.M(100,220),e.C(100,370,180,400,260,380),e.C(280,430,380,430,400,380),e.C(460,380,480,300,440,220),e.L(100,220),e.fill(),e.M(100,220),e.C(100,370,180,400,260,380),e.C(280,430,380,430,400,380),e.C(460,380,480,300,440,220),e.L(100,220),e.stroke()}},9934:{width:600,draw:e=>{e.lineWidth(45),e.M(150,450),e.L(150,200),e.C(150,50,450,50,450,200),e.L(450,450),e.stroke(),e.M(100,250),e.L(500,250),e.stroke()}},9940:{width:600,draw:e=>{e.circle(300,250,220),e.fill()}},9962:{width:600,draw:e=>{e.lineWidth(35),e.rect(150,50,300,250),e.stroke(),e.M(130,300),e.L(300,420),e.L(470,300),e.Z(),e.stroke(),e.M(300,420),e.L(300,490),e.stroke(),e.M(270,460),e.L(330,460),e.stroke(),e.M(260,50),e.L(260,150),e.L(340,150),e.L(340,50),e.stroke()}},9970:{width:600,draw:e=>{e.lineWidth(35),e.M(100,50),e.L(500,50),e.stroke(),e.M(150,50),e.L(150,200),e.stroke(),e.M(450,50),e.L(450,200),e.stroke(),e.M(100,200),e.L(500,200),e.stroke(),e.M(300,200),e.L(300,380),e.stroke(),e.M(300,380),e.C(200,420,150,300,150,200),e.stroke(),e.M(300,380),e.C(400,420,450,300,450,200),e.stroke()}},9971:{width:600,draw:e=>{e.lineWidth(35),e.M(250,30),e.L(250,480),e.stroke(),e.M(250,480),e.L(450,420),e.L(250,360),e.Z(),e.fill(),e.M(120,30),e.C(200,60,300,60,380,30),e.stroke()}},9973:{width:600,draw:e=>{e.lineWidth(35),e.M(80,150),e.L(520,150),e.L(450,50),e.L(150,50),e.Z(),e.stroke(),e.M(300,150),e.L(300,470),e.stroke(),e.M(300,460),e.L(450,200),e.L(300,200),e.Z(),e.stroke()}},9978:{width:600,draw:e=>{e.lineWidth(40),e.M(80,50),e.L(300,450),e.L(520,50),e.Z(),e.stroke(),e.M(300,450),e.L(300,50),e.stroke()}}},HS={8961:{width:600,draw:e=>{e.lineWidth(40),e.M(100,250),e.L(200,350),e.L(280,200),e.L(380,350),e.L(450,250),e.stroke(),e.M(450,250),e.L(500,320),e.L(500,180),e.Z(),e.fill()}},8963:{width:600,draw:e=>{e.lineWidth(50),e.M(130,100),e.L(300,400),e.L(470,100),e.stroke()}},8964:{width:600,draw:e=>{e.lineWidth(50),e.M(130,400),e.L(300,100),e.L(470,400),e.stroke()}},8965:{width:600,draw:e=>{e.lineWidth(45),e.M(100,100),e.L(500,100),e.stroke(),e.M(300,100),e.L(300,450),e.stroke(),e.M(200,350),e.L(400,350),e.stroke()}},8966:{width:600,draw:e=>{e.lineWidth(45),e.M(100,100),e.L(500,100),e.stroke(),e.M(100,250),e.L(500,250),e.stroke(),e.M(300,100),e.L(300,450),e.stroke()}},8967:{width:600,draw:e=>{e.lineWidth(40),e.M(100,250),e.C(180,350,260,150,340,250),e.C(420,350,500,150,520,250),e.stroke()}},8968:{width:600,draw:e=>{e.lineWidth(50),e.M(400,450),e.L(200,450),e.L(200,50),e.stroke()}},8969:{width:600,draw:e=>{e.lineWidth(50),e.M(200,450),e.L(400,450),e.L(400,50),e.stroke()}},8970:{width:600,draw:e=>{e.lineWidth(50),e.M(200,450),e.L(200,50),e.L(400,50),e.stroke()}},8971:{width:600,draw:e=>{e.lineWidth(50),e.M(400,450),e.L(400,50),e.L(200,50),e.stroke()}},8972:{width:600,draw:e=>{e.lineWidth(45),e.M(300,100),e.L(450,100),e.L(450,250),e.stroke()}},8973:{width:600,draw:e=>{e.lineWidth(45),e.M(300,100),e.L(150,100),e.L(150,250),e.stroke()}},8974:{width:600,draw:e=>{e.lineWidth(45),e.M(300,400),e.L(450,400),e.L(450,250),e.stroke()}},8975:{width:600,draw:e=>{e.lineWidth(45),e.M(300,400),e.L(150,400),e.L(150,250),e.stroke()}},8977:{width:600,draw:e=>{e.lineWidth(40),e.M(300,450),e.L(500,250),e.L(300,50),e.L(100,250),e.Z(),e.stroke()}},8978:{width:600,draw:e=>{e.lineWidth(50),e.M(80,100),e.C(80,400,520,400,520,100),e.stroke()}},8979:{width:600,draw:e=>{e.lineWidth(45),e.M(80,200),e.C(80,450,520,450,520,200),e.stroke(),e.M(80,200),e.L(520,200),e.stroke()}},8980:{width:600,draw:e=>{e.lineWidth(45),e.M(300,100),e.L(120,400),e.C(200,500,400,500,480,400),e.L(300,100),e.stroke()}},8982:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,120),e.stroke(),e.M(300,50),e.L(300,450),e.stroke(),e.M(100,250),e.L(500,250),e.stroke()}},8983:{width:600,draw:e=>{e.lineWidth(40),e.rect(120,70,360,360),e.stroke(),e.M(300,70),e.L(300,430),e.stroke(),e.M(120,250),e.L(480,250),e.stroke()}},8985:{width:600,draw:e=>{e.lineWidth(50),e.M(120,350),e.L(480,350),e.L(480,150),e.stroke()}},8988:{width:600,draw:e=>{e.lineWidth(45),e.M(150,300),e.L(150,420),e.L(300,420),e.stroke()}},8989:{width:600,draw:e=>{e.lineWidth(45),e.M(300,420),e.L(450,420),e.L(450,300),e.stroke()}},8990:{width:600,draw:e=>{e.lineWidth(45),e.M(150,200),e.L(150,80),e.L(300,80),e.stroke()}},8991:{width:600,draw:e=>{e.lineWidth(45),e.M(300,80),e.L(450,80),e.L(450,200),e.stroke()}},8992:{width:600,draw:e=>{e.lineWidth(50),e.M(380,480),e.C(350,480,300,450,300,400),e.L(300,50),e.stroke()}},8993:{width:600,draw:e=>{e.lineWidth(50),e.M(300,450),e.L(300,100),e.C(300,50,250,20,220,20),e.stroke()}},8994:{width:600,draw:e=>{e.lineWidth(50),e.M(80,350),e.C(200,100,400,100,520,350),e.stroke()}},8995:{width:600,draw:e=>{e.lineWidth(50),e.M(80,200),e.C(200,450,400,450,520,200),e.stroke()}},8996:{width:600,draw:e=>{e.lineWidth(45),e.M(100,100),e.L(500,100),e.stroke(),e.M(100,400),e.L(500,400),e.stroke(),e.M(200,200),e.L(300,350),e.L(400,200),e.stroke()}},8997:{width:600,draw:e=>{e.lineWidth(45),e.M(100,100),e.L(250,100),e.L(400,400),e.L(500,400),e.stroke(),e.M(300,400),e.L(500,400),e.stroke(),e.M(100,400),e.L(300,400),e.stroke()}},8998:{width:600,draw:e=>{e.lineWidth(40),e.M(80,250),e.L(200,420),e.L(520,420),e.L(520,80),e.L(200,80),e.Z(),e.stroke(),e.M(280,180),e.L(440,320),e.stroke(),e.M(280,320),e.L(440,180),e.stroke()}},8999:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,70,400,360),e.stroke(),e.M(180,150),e.L(420,350),e.stroke(),e.M(180,350),e.L(420,150),e.stroke()}},9003:{width:600,draw:e=>{e.lineWidth(40),e.M(520,250),e.L(400,420),e.L(80,420),e.L(80,80),e.L(400,80),e.Z(),e.stroke(),e.M(160,180),e.L(320,320),e.stroke(),e.M(160,320),e.L(320,180),e.stroke()}},9001:{width:600,draw:e=>{e.lineWidth(45),e.M(400,450),e.L(200,250),e.L(400,50),e.stroke()}},9002:{width:600,draw:e=>{e.lineWidth(45),e.M(200,450),e.L(400,250),e.L(200,50),e.stroke()}},9004:{width:600,draw:e=>{e.lineWidth(35);for(let t=0;t<6;t++){let n=(t*60-90)*Math.PI/180,r=((t+1)*60-90)*Math.PI/180;e.M(300+180*Math.cos(n),250+180*Math.sin(n)),e.L(300+180*Math.cos(r),250+180*Math.sin(r))}e.stroke(),e.circle(300,250,100),e.stroke()}},9005:{width:600,draw:e=>{e.lineWidth(40),e.M(150,420),e.L(150,80),e.stroke(),e.M(450,420),e.L(450,80),e.stroke(),e.ellipse(300,420,150,40),e.stroke(),e.ellipse(300,80,150,40),e.stroke()}},9006:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,200),e.stroke(),e.M(300,450),e.L(300,480),e.stroke()}},9007:{width:600,draw:e=>{e.lineWidth(40),e.M(100,250),e.L(500,250),e.stroke(),e.M(300,100),e.L(300,400),e.stroke(),e.M(250,350),e.L(300,400),e.L(350,350),e.stroke()}},9008:{width:600,draw:e=>{e.lineWidth(45),e.M(150,400),e.L(150,100),e.L(450,100),e.stroke(),e.M(150,250),e.L(350,250),e.stroke()}},9009:{width:600,draw:e=>{e.lineWidth(45),e.M(100,100),e.L(500,400),e.stroke()}},9010:{width:600,draw:e=>{e.lineWidth(40),e.M(100,350),e.L(500,300),e.stroke(),e.M(100,150),e.L(500,200),e.stroke()}},9011:{width:600,draw:e=>{e.lineWidth(45),e.M(100,100),e.L(100,400),e.L(500,250),e.stroke()}},9012:{width:600,draw:e=>{e.lineWidth(40),e.M(200,400),e.L(200,250),e.L(100,250),e.L(100,100),e.L(500,100),e.L(500,250),e.L(400,250),e.L(400,400),e.stroke()}},9013:{width:600,draw:e=>{e.lineWidth(40),e.M(200,100),e.L(100,300),e.L(100,400),e.stroke(),e.M(400,100),e.L(500,300),e.L(500,400),e.stroke(),e.M(200,100),e.L(400,100),e.stroke()}},9014:{width:600,draw:e=>{e.lineWidth(45),e.M(150,420),e.L(450,420),e.stroke(),e.M(150,80),e.L(450,80),e.stroke(),e.M(300,420),e.L(300,80),e.stroke()}},9015:{width:600,draw:e=>{e.lineWidth(40),e.rect(150,80,300,340),e.stroke()}},9016:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.M(180,300),e.L(420,300),e.stroke(),e.M(180,200),e.L(420,200),e.stroke()}},9017:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.M(180,250),e.L(420,250),e.stroke(),e.circle(300,340,30),e.fill(),e.circle(300,160,30),e.fill()}},9018:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.M(300,380),e.L(420,250),e.L(300,120),e.L(180,250),e.Z(),e.stroke()}},9019:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.circle(300,250,80),e.stroke()}},9020:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.circle(300,250,130),e.stroke()}},9021:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,180),e.stroke(),e.M(300,430),e.L(300,70),e.stroke()}},9022:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,180),e.stroke(),e.circle(300,250,70),e.stroke()}},9023:{width:600,draw:e=>{e.lineWidth(45),e.M(400,420),e.L(200,80),e.stroke(),e.M(120,250),e.L(480,250),e.stroke()}},9024:{width:600,draw:e=>{e.lineWidth(45),e.M(200,420),e.L(400,80),e.stroke(),e.M(120,250),e.L(480,250),e.stroke()}},9025:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.M(400,380),e.L(200,120),e.stroke()}},9026:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.M(200,380),e.L(400,120),e.stroke()}},9027:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.M(380,370),e.L(220,250),e.L(380,130),e.stroke()}},9028:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.M(220,370),e.L(380,250),e.L(220,130),e.stroke()}},9029:{width:600,draw:e=>{e.lineWidth(45),e.M(500,250),e.L(100,250),e.stroke(),e.M(100,250),e.L(250,400),e.stroke()}},9030:{width:600,draw:e=>{e.lineWidth(45),e.M(100,250),e.L(500,250),e.stroke(),e.M(500,250),e.L(350,400),e.stroke()}},9031:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.M(420,250),e.L(180,250),e.stroke(),e.M(180,250),e.L(270,330),e.L(270,170),e.Z(),e.fill()}},9032:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.M(180,250),e.L(420,250),e.stroke(),e.M(420,250),e.L(330,330),e.L(330,170),e.Z(),e.fill()}},9033:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,180),e.stroke(),e.M(170,120),e.L(430,380),e.stroke()}},9034:{width:600,draw:e=>{e.lineWidth(45),e.M(100,80),e.L(500,80),e.stroke(),e.M(300,80),e.L(300,350),e.stroke(),e.M(150,350),e.L(450,350),e.stroke(),e.M(100,420),e.L(500,420),e.stroke()}},9035:{width:600,draw:e=>{e.lineWidth(40),e.M(300,420),e.L(150,120),e.L(450,120),e.Z(),e.stroke(),e.M(300,450),e.L(300,50),e.stroke()}},9036:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.M(200,350),e.L(300,150),e.L(400,350),e.stroke()}},9037:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.M(300,370),e.L(190,140),e.L(410,140),e.Z(),e.stroke()}},9038:{width:600,draw:e=>{e.lineWidth(45),e.M(150,400),e.L(450,400),e.stroke(),e.M(300,400),e.L(300,150),e.stroke(),e.circle(300,100,50),e.stroke()}},9039:{width:600,draw:e=>{e.lineWidth(45),e.M(300,80),e.L(300,420),e.stroke(),e.M(300,420),e.L(180,300),e.stroke()}},9040:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.M(300,120),e.L(300,380),e.stroke(),e.M(300,380),e.L(220,300),e.L(380,300),e.Z(),e.fill()}},9041:{width:600,draw:e=>{e.lineWidth(45),e.M(100,420),e.L(500,420),e.stroke(),e.M(300,420),e.L(300,150),e.stroke(),e.M(150,150),e.L(450,150),e.stroke(),e.M(100,80),e.L(500,80),e.stroke()}},9042:{width:600,draw:e=>{e.lineWidth(40),e.M(300,80),e.L(150,380),e.L(450,380),e.Z(),e.stroke(),e.M(300,50),e.L(300,450),e.stroke()}},9043:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.M(200,150),e.L(300,350),e.L(400,150),e.stroke()}},9044:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.M(300,130),e.L(190,360),e.L(410,360),e.Z(),e.stroke()}},9045:{width:600,draw:e=>{e.lineWidth(45),e.M(150,100),e.L(450,100),e.stroke(),e.M(300,100),e.L(300,350),e.stroke(),e.circle(300,400,50),e.stroke()}},9046:{width:600,draw:e=>{e.lineWidth(45),e.M(300,420),e.L(300,80),e.stroke(),e.M(300,80),e.L(420,200),e.stroke()}},9047:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.M(300,380),e.L(300,120),e.stroke(),e.M(300,120),e.L(220,200),e.L(380,200),e.Z(),e.fill()}},9048:{width:600,draw:e=>{e.lineWidth(45),e.M(260,420),e.L(260,200),e.stroke(),e.M(340,420),e.L(340,200),e.stroke(),e.M(120,100),e.L(480,100),e.stroke()}},9049:{width:600,draw:e=>{e.lineWidth(40),e.M(300,430),e.L(150,160),e.L(450,160),e.Z(),e.stroke(),e.M(120,80),e.L(480,80),e.stroke()}},9050:{width:600,draw:e=>{e.lineWidth(40),e.M(300,430),e.L(430,280),e.L(300,150),e.L(170,280),e.Z(),e.stroke(),e.M(120,80),e.L(480,80),e.stroke()}},9051:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,310,100),e.stroke(),e.M(120,100),e.L(480,100),e.stroke()}},9052:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,310,130),e.stroke(),e.M(100,100),e.L(500,100),e.stroke()}},9053:{width:600,draw:e=>{e.lineWidth(40),e.M(120,100),e.C(120,350,480,350,480,100),e.stroke(),e.circle(300,300,50),e.stroke()}},9054:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.M(100,250),e.L(50,250),e.stroke()}},9055:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,180),e.stroke();for(let t=0;t<5;t++){let n=(t*72-90)*Math.PI/180,r=(t*72+36-90)*Math.PI/180;t===0?e.M(300+100*Math.cos(n),250+100*Math.sin(n)):e.L(300+100*Math.cos(n),250+100*Math.sin(n)),e.L(300+40*Math.cos(r),250+40*Math.sin(r))}e.Z(),e.stroke()}},9056:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.circle(300,330,35),e.fill(),e.circle(300,170,35),e.fill()}},9057:{width:600,draw:e=>{e.lineWidth(45),e.M(150,150),e.L(450,150),e.stroke(),e.M(300,150),e.L(300,350),e.stroke(),e.circle(250,420,30),e.fill(),e.circle(350,420,30),e.fill()}},9058:{width:600,draw:e=>{e.lineWidth(40),e.M(300,120),e.L(150,370),e.L(450,370),e.Z(),e.stroke(),e.circle(250,80,25),e.fill(),e.circle(350,80,25),e.fill()}},9059:{width:600,draw:e=>{e.lineWidth(45),e.M(300,380),e.L(300,180),e.stroke(),e.M(200,340),e.L(400,220),e.stroke(),e.M(200,220),e.L(400,340),e.stroke(),e.circle(250,430,25),e.fill(),e.circle(350,430,25),e.fill()}},9060:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,200,80),e.stroke(),e.circle(250,400,30),e.fill(),e.circle(350,400,30),e.fill()}},9061:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,200,120),e.stroke(),e.circle(250,420,30),e.fill(),e.circle(350,420,30),e.fill()}},9062:{width:600,draw:e=>{e.lineWidth(40),e.M(120,400),e.C(120,150,480,150,480,400),e.stroke(),e.M(300,50),e.L(300,450),e.stroke()}},9063:{width:600,draw:e=>{e.lineWidth(40),e.M(450,100),e.C(200,100,200,400,450,400),e.stroke(),e.M(100,250),e.L(500,250),e.stroke()}},9064:{width:600,draw:e=>{e.lineWidth(40),e.M(120,250),e.C(200,350,400,150,480,250),e.stroke(),e.circle(250,400,30),e.fill(),e.circle(350,400,30),e.fill()}},9065:{width:600,draw:e=>{e.lineWidth(40),e.M(180,370),e.L(380,250),e.L(180,130),e.stroke(),e.circle(430,200,25),e.fill(),e.circle(430,300,25),e.fill()}},9066:{width:600,draw:e=>{e.lineWidth(45),e.circle(300,300,40),e.fill(),e.M(300,260),e.L(260,180),e.stroke(),e.M(120,120),e.L(480,120),e.stroke()}},9067:{width:600,draw:e=>{e.lineWidth(40),e.M(300,80),e.L(150,380),e.L(450,380),e.Z(),e.stroke(),e.lineWidth(35),e.M(220,250),e.C(260,300,340,200,380,250),e.stroke()}},9068:{width:600,draw:e=>{e.lineWidth(40),e.ellipse(300,250,150,200),e.stroke(),e.M(200,250),e.L(400,250),e.stroke()}},9069:{width:600,draw:e=>{e.lineWidth(40),e.M(300,80),e.L(300,420),e.stroke(),e.M(180,250),e.C(220,320,380,180,420,250),e.stroke()}},9070:{width:600,draw:e=>{e.circle(300,350,35),e.fill(),e.circle(300,250,35),e.fill(),e.M(300,215),e.L(270,160),e.stroke(),e.lineWidth(40),e.M(150,100),e.L(450,100),e.stroke()}},9071:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.M(200,310),e.L(400,310),e.stroke(),e.M(200,190),e.L(400,190),e.stroke(),e.M(350,370),e.L(250,130),e.stroke()}},9072:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.lineWidth(35),e.M(230,350),e.C(230,400,370,400,370,340),e.C(370,290,300,270,300,220),e.stroke(),e.circle(300,160,25),e.fill()}},9073:{width:600,draw:e=>{e.lineWidth(45),e.M(130,400),e.L(300,130),e.L(470,400),e.stroke(),e.lineWidth(35),e.M(220,280),e.C(260,330,340,230,380,280),e.stroke()}},9074:{width:600,draw:e=>{e.lineWidth(45),e.M(130,100),e.L(300,370),e.L(470,100),e.stroke(),e.lineWidth(35),e.M(220,220),e.C(260,270,340,170,380,220),e.stroke()}},9075:{width:600,draw:e=>{e.lineWidth(45),e.M(250,400),e.L(250,150),e.C(250,80,350,80,350,150),e.stroke()}},9076:{width:600,draw:e=>{e.lineWidth(45),e.M(200,80),e.L(200,400),e.C(200,450,400,450,400,400),e.C(400,300,200,300,200,350),e.stroke()}},9077:{width:600,draw:e=>{e.lineWidth(45),e.M(120,400),e.L(200,150),e.C(200,80,400,80,400,150),e.L(480,400),e.stroke()}},9078:{width:600,draw:e=>{e.lineWidth(40),e.M(400,400),e.C(400,300,200,300,200,350),e.C(200,400,400,400,400,350),e.L(400,200),e.stroke(),e.M(120,120),e.L(480,120),e.stroke()}},9079:{width:600,draw:e=>{e.lineWidth(40),e.M(420,400),e.L(220,400),e.C(160,400,160,200,220,200),e.L(420,200),e.stroke(),e.M(220,300),e.L(380,300),e.stroke(),e.M(120,120),e.L(480,120),e.stroke()}},9080:{width:600,draw:e=>{e.lineWidth(40),e.M(250,430),e.L(250,200),e.C(250,150,350,150,350,200),e.stroke(),e.M(120,100),e.L(480,100),e.stroke()}},9081:{width:600,draw:e=>{e.lineWidth(40),e.M(120,420),e.L(200,200),e.C(200,150,400,150,400,200),e.L(480,420),e.stroke(),e.M(120,100),e.L(480,100),e.stroke()}},9082:{width:600,draw:e=>{e.lineWidth(45),e.M(400,400),e.C(400,300,200,300,200,350),e.C(200,400,400,400,400,350),e.L(400,150),e.stroke()}},9083:{width:600,draw:e=>{e.lineWidth(50),e.M(130,250),e.L(250,100),e.L(470,400),e.stroke(),e.M(180,380),e.L(420,120),e.stroke()}},9084:{width:600,draw:e=>{e.lineWidth(45),e.M(150,400),e.L(150,100),e.L(450,100),e.stroke(),e.M(150,100),e.L(200,200),e.L(250,100),e.L(300,200),e.stroke()}},9085:{width:600,draw:e=>{e.lineWidth(45),e.M(100,350),e.L(100,150),e.L(200,150),e.stroke(),e.M(400,150),e.L(500,150),e.L(500,350),e.stroke()}},9086:{width:600,draw:e=>{e.lineWidth(40),e.M(150,100),e.C(150,350,300,450,300,450),e.C(300,450,450,350,450,100),e.stroke(),e.M(120,100),e.L(480,100),e.stroke(),e.circle(300,60,25),e.fill()}},9087:{width:600,draw:e=>{e.lineWidth(45),e.M(200,80),e.L(300,420),e.L(400,80),e.stroke()}},9088:{width:600,draw:e=>{e.lineWidth(45),e.M(200,100),e.L(300,380),e.L(400,100),e.stroke(),e.M(150,100),e.L(450,100),e.stroke()}},9089:{width:600,draw:e=>{e.lineWidth(50),e.M(80,100),e.L(520,100),e.stroke()}},9090:{width:600,draw:e=>{e.lineWidth(50),e.M(80,100),e.L(230,100),e.stroke(),e.M(370,100),e.L(520,100),e.stroke()}},9091:{width:600,draw:e=>{e.lineWidth(50),e.M(80,100),e.L(520,100),e.stroke(),e.circle(300,200,30),e.fill()}},9092:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,300,120),e.stroke(),e.M(300,180),e.L(300,420),e.stroke()}},9093:{width:600,draw:e=>{e.lineWidth(40),e.rect(120,70,360,360),e.stroke(),e.M(300,70),e.L(300,430),e.stroke()}},9094:{width:600,draw:e=>{e.lineWidth(40),e.M(420,400),e.L(420,200),e.L(180,200),e.stroke(),e.M(180,200),e.L(280,280),e.L(280,120),e.Z(),e.fill()}},9095:{width:600,draw:e=>{e.lineWidth(40),e.M(100,150),e.L(250,150),e.L(350,350),e.L(500,350),e.stroke(),e.M(100,350),e.L(250,350),e.L(350,150),e.L(500,150),e.stroke()}},9096:{width:600,draw:e=>{e.lineWidth(35),e.circle(300,250,160),e.stroke(),e.circle(300,250,50),e.fill();for(let t=0;t<360;t+=45){let n=t*Math.PI/180;e.M(300+50*Math.cos(n),250+50*Math.sin(n)),e.L(300+180*Math.cos(n),250+180*Math.sin(n))}e.stroke()}},9097:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,180),e.stroke(),e.M(120,250),e.L(260,250),e.stroke(),e.M(340,250),e.L(480,250),e.stroke(),e.M(260,250),e.L(260,300),e.L(340,300),e.L(340,250),e.stroke()}},9098:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,180),e.stroke(),e.M(300,430),e.L(300,70),e.stroke(),e.circle(220,250,30),e.fill(),e.circle(380,250,30),e.fill()}},9099:{width:600,draw:e=>{e.lineWidth(40),e.M(200,410),e.C(120,380,80,300,100,200),e.C(120,120,200,80,300,70),e.C(400,80,480,120,500,200),e.C(520,300,480,380,400,420),e.stroke(),e.M(160,430),e.L(160,350),e.L(240,350),e.stroke()}},9100:{width:600,draw:e=>{e.lineWidth(40),e.M(450,380),e.C(450,200,350,120,250,120),e.C(200,120,150,180,150,250),e.stroke(),e.M(150,250),e.L(80,170),e.L(220,170),e.Z(),e.fill()}},9101:{width:600,draw:e=>{e.lineWidth(45),e.M(100,150),e.L(250,150),e.L(250,350),e.L(400,350),e.L(400,150),e.L(500,150),e.stroke()}},9102:{width:600,draw:e=>{e.lineWidth(40),e.M(100,150),e.L(300,150),e.L(300,350),e.L(500,350),e.stroke(),e.M(100,350),e.L(300,350),e.stroke(),e.M(300,150),e.L(500,150),e.stroke()}},9103:{width:600,draw:e=>{e.lineWidth(40),e.M(100,250),e.L(250,250),e.stroke(),e.circle(300,250,50),e.stroke(),e.M(350,250),e.L(500,250),e.stroke()}},9104:{width:600,draw:e=>{e.lineWidth(40),e.M(100,250),e.L(250,250),e.stroke(),e.M(350,250),e.L(500,250),e.stroke(),e.M(250,250),e.L(350,250),e.stroke(),e.M(300,250),e.L(300,350),e.stroke()}},9105:{width:600,draw:e=>{e.lineWidth(40),e.M(100,350),e.L(250,350),e.L(250,150),e.L(350,150),e.L(350,350),e.L(500,350),e.stroke()}},9106:{width:600,draw:e=>{e.lineWidth(40),e.M(100,150),e.L(250,150),e.L(250,350),e.L(350,350),e.L(350,150),e.L(500,150),e.stroke()}},9107:{width:600,draw:e=>{e.lineWidth(45),e.M(100,300),e.L(500,300),e.stroke(),e.lineWidth(35),e.M(100,200),e.L(200,200),e.stroke(),e.M(250,200),e.L(350,200),e.stroke(),e.M(400,200),e.L(500,200),e.stroke()}},9108:{width:600,draw:e=>{e.lineWidth(40),e.M(100,100),e.L(100,400),e.L(500,400),e.L(500,100),e.stroke()}},9109:{width:600,draw:e=>{e.lineWidth(45),e.rect(120,50,360,400),e.stroke()}},9110:{width:600,draw:e=>{e.lineWidth(40),e.rect(120,80,360,340),e.stroke(),e.circle(300,180,35),e.fill()}},9111:{width:600,draw:e=>{e.lineWidth(40),e.rect(130,50,340,400),e.stroke(),e.M(130,380),e.L(220,380),e.L(220,450),e.stroke()}},9112:{width:600,draw:e=>{e.lineWidth(40),e.rect(130,50,340,400),e.stroke(),e.M(470,120),e.L(380,120),e.L(380,50),e.stroke()}},9113:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,100,400,300),e.stroke(),e.rect(180,180,240,140),e.stroke()}},9114:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,100,400,300),e.stroke(),e.M(200,200),e.L(400,300),e.stroke(),e.M(200,300),e.L(400,200),e.stroke()}},9118:{width:600,draw:e=>{e.lineWidth(45),e.M(200,450),e.C(350,450,400,350,400,250),e.stroke()}},9119:{width:600,draw:e=>{e.lineWidth(45),e.M(400,450),e.L(400,50),e.stroke()}},9120:{width:600,draw:e=>{e.lineWidth(45),e.M(400,250),e.C(400,150,350,50,200,50),e.stroke()}},9121:{width:600,draw:e=>{e.lineWidth(45),e.M(350,450),e.L(200,450),e.L(200,50),e.stroke()}},9122:{width:600,draw:e=>{e.lineWidth(45),e.M(200,450),e.L(200,50),e.stroke()}},9123:{width:600,draw:e=>{e.lineWidth(45),e.M(200,450),e.L(200,50),e.L(350,50),e.stroke()}},9124:{width:600,draw:e=>{e.lineWidth(45),e.M(250,450),e.L(400,450),e.L(400,50),e.stroke()}},9125:{width:600,draw:e=>{e.lineWidth(45),e.M(400,450),e.L(400,50),e.stroke()}},9126:{width:600,draw:e=>{e.lineWidth(45),e.M(400,450),e.L(400,50),e.L(250,50),e.stroke()}},9127:{width:600,draw:e=>{e.lineWidth(45),e.M(350,450),e.C(250,450,250,350,250,250),e.stroke()}},9128:{width:600,draw:e=>{e.lineWidth(45),e.M(250,450),e.L(250,300),e.C(250,250,200,250,150,250),e.stroke(),e.M(250,200),e.C(250,250,200,250,150,250),e.stroke(),e.M(250,200),e.L(250,50),e.stroke()}},9129:{width:600,draw:e=>{e.lineWidth(45),e.M(250,250),e.C(250,150,250,50,350,50),e.stroke()}},9130:{width:600,draw:e=>{e.lineWidth(45),e.M(300,450),e.L(300,50),e.stroke()}},9131:{width:600,draw:e=>{e.lineWidth(45),e.M(250,450),e.C(350,450,350,350,350,250),e.stroke()}},9132:{width:600,draw:e=>{e.lineWidth(45),e.M(350,450),e.L(350,300),e.C(350,250,400,250,450,250),e.stroke(),e.M(350,200),e.C(350,250,400,250,450,250),e.stroke(),e.M(350,200),e.L(350,50),e.stroke()}},9133:{width:600,draw:e=>{e.lineWidth(45),e.M(350,250),e.C(350,150,350,50,250,50),e.stroke()}},9134:{width:600,draw:e=>{e.lineWidth(45),e.M(300,450),e.L(300,50),e.stroke()}},9136:{width:600,draw:e=>{e.lineWidth(45),e.M(350,50),e.C(250,50,250,250,250,450),e.stroke()}},9137:{width:600,draw:e=>{e.lineWidth(45),e.M(250,50),e.C(350,50,350,250,350,450),e.stroke()}},9138:{width:600,draw:e=>{e.lineWidth(45),e.M(480,450),e.L(120,450),e.L(300,250),e.stroke()}},9139:{width:600,draw:e=>{e.lineWidth(45),e.M(300,250),e.L(120,50),e.L(480,50),e.stroke()}},9140:{width:600,draw:e=>{e.lineWidth(45),e.M(100,200),e.L(100,350),e.L(500,350),e.L(500,200),e.stroke()}},9141:{width:600,draw:e=>{e.lineWidth(45),e.M(100,300),e.L(100,150),e.L(500,150),e.L(500,300),e.stroke()}},9142:{width:600,draw:e=>{e.lineWidth(40),e.M(100,300),e.L(100,200),e.L(500,200),e.L(500,300),e.stroke(),e.M(100,350),e.L(100,250),e.L(500,250),e.L(500,350),e.stroke()}},9146:{width:600,draw:e=>{e.lineWidth(30),e.M(0,450),e.L(600,450),e.stroke()}},9147:{width:600,draw:e=>{e.lineWidth(30),e.M(0,350),e.L(600,350),e.stroke()}},9148:{width:600,draw:e=>{e.lineWidth(30),e.M(0,150),e.L(600,150),e.stroke()}},9149:{width:600,draw:e=>{e.lineWidth(30),e.M(0,50),e.L(600,50),e.stroke()}},9150:{width:600,draw:e=>{e.lineWidth(40),e.M(300,450),e.L(300,250),e.L(500,250),e.stroke()}},9151:{width:600,draw:e=>{e.lineWidth(40),e.M(300,50),e.L(300,250),e.L(500,250),e.stroke()}},9152:{width:600,draw:e=>{e.lineWidth(40),e.M(300,450),e.L(300,50),e.stroke(),e.circle(300,250,60),e.stroke()}},9153:{width:600,draw:e=>{e.lineWidth(40),e.M(100,350),e.L(500,350),e.stroke(),e.M(300,350),e.L(300,100),e.stroke(),e.circle(300,250,60),e.stroke()}},9161:{width:600,draw:e=>{e.lineWidth(40),e.M(150,350),e.L(450,350),e.stroke(),e.M(300,350),e.L(300,100),e.stroke()}},9162:{width:600,draw:e=>{e.lineWidth(40),e.M(150,150),e.L(450,150),e.stroke(),e.M(300,150),e.L(300,400),e.stroke()}},9163:{width:600,draw:e=>{e.lineWidth(40),e.M(300,450),e.L(300,50),e.stroke(),e.M(300,310),e.L(400,200),e.L(300,200),e.Z(),e.stroke()}},9164:{width:600,draw:e=>{e.lineWidth(40),e.M(100,350),e.L(500,350),e.stroke(),e.M(300,350),e.L(300,120),e.stroke(),e.M(250,250),e.L(350,250),e.L(300,180),e.Z(),e.fill()}},9165:{width:600,draw:e=>{e.lineWidth(45),e.M(150,400),e.L(150,100),e.L(450,100),e.stroke()}},9168:{width:600,draw:e=>{e.lineWidth(45),e.M(300,480),e.L(300,20),e.stroke()}},9178:{width:600,draw:e=>{e.lineWidth(40),e.M(300,450),e.L(300,200),e.stroke(),e.M(150,200),e.L(450,200),e.stroke(),e.M(200,140),e.L(400,140),e.stroke(),e.M(250,80),e.L(350,80),e.stroke()}},9179:{width:600,draw:e=>{e.lineWidth(40),e.M(80,250),e.L(180,250),e.stroke(),e.rect(180,180,240,140),e.stroke(),e.M(420,250),e.L(520,250),e.stroke()}},9180:{width:600,draw:e=>{e.lineWidth(45),e.M(80,150),e.C(80,400,520,400,520,150),e.stroke()}},9181:{width:600,draw:e=>{e.lineWidth(45),e.M(80,350),e.C(80,100,520,100,520,350),e.stroke()}},9182:{width:600,draw:e=>{e.lineWidth(40),e.M(80,150),e.C(80,300,200,350,300,400),e.C(400,350,520,300,520,150),e.stroke()}},9183:{width:600,draw:e=>{e.lineWidth(40),e.M(80,350),e.C(80,200,200,150,300,100),e.C(400,150,520,200,520,350),e.stroke()}},9184:{width:600,draw:e=>{e.lineWidth(40),e.M(80,150),e.C(150,380,450,380,520,150),e.stroke()}},9185:{width:600,draw:e=>{e.lineWidth(40),e.M(80,350),e.C(150,120,450,120,520,350),e.stroke()}},9186:{width:600,draw:e=>{e.lineWidth(40),e.M(150,100),e.L(450,100),e.L(500,400),e.L(100,400),e.Z(),e.stroke()}},9187:{width:600,draw:e=>{e.lineWidth(35);for(let t=0;t<6;t++){let n=(t*60-90)*Math.PI/180,r=((t+1)*60-90)*Math.PI/180;e.M(300+180*Math.cos(n),250+180*Math.sin(n)),e.L(300+180*Math.cos(r),250+180*Math.sin(r))}e.stroke(),e.circle(300,250,110),e.stroke()}},9188:{width:600,draw:e=>{e.lineWidth(45),e.M(100,250),e.L(500,250),e.stroke()}},9189:{width:600,draw:e=>{e.lineWidth(45),e.M(100,200),e.L(500,200),e.stroke(),e.M(100,300),e.L(500,300),e.stroke()}},9190:{width:600,draw:e=>{e.lineWidth(45),e.M(100,250),e.C(200,420,300,80,400,250),e.C(440,340,480,250,500,250),e.stroke()}},9191:{width:600,draw:e=>{e.lineWidth(40),e.M(100,100),e.L(100,300),e.C(100,430,500,430,500,300),e.L(500,100),e.stroke()}},9192:{width:600,draw:e=>{e.lineWidth(40),e.M(400,400),e.L(200,400),e.L(200,100),e.L(400,100),e.stroke(),e.M(200,250),e.L(370,250),e.stroke()}},9200:{width:600,draw:e=>{e.lineWidth(35),e.circle(300,230,180),e.stroke(),e.M(300,230),e.L(300,340),e.stroke(),e.M(300,230),e.L(380,230),e.stroke(),e.M(160,400),e.L(120,440),e.stroke(),e.M(440,400),e.L(480,440),e.stroke(),e.M(200,50),e.L(180,20),e.stroke(),e.M(400,50),e.L(420,20),e.stroke()}},9203:{width:600,draw:e=>{e.lineWidth(40),e.M(120,480),e.L(480,480),e.stroke(),e.M(120,20),e.L(480,20),e.stroke(),e.M(150,480),e.L(300,250),e.L(450,480),e.stroke(),e.M(150,20),e.L(300,250),e.L(450,20),e.stroke(),e.circle(270,120,15),e.fill(),e.circle(330,120,15),e.fill(),e.circle(300,90,15),e.fill(),e.lineWidth(20),e.M(300,250),e.L(300,160),e.stroke()}},9204:{width:600,draw:e=>{e.M(450,450),e.L(150,250),e.L(450,50),e.Z(),e.fill()}},9205:{width:600,draw:e=>{e.M(150,450),e.L(450,250),e.L(150,50),e.Z(),e.fill()}},9206:{width:600,draw:e=>{e.M(100,100),e.L(500,100),e.L(300,420),e.Z(),e.fill()}},9207:{width:600,draw:e=>{e.M(100,400),e.L(500,400),e.L(300,80),e.Z(),e.fill()}},9211:{width:600,draw:e=>{e.lineWidth(45),e.M(200,380),e.C(120,330,80,230,120,150),e.C(160,70,260,40,300,40),e.C(340,40,440,70,480,150),e.C(520,230,480,330,400,380),e.stroke(),e.M(300,320),e.L(300,150),e.stroke()}},9212:{width:600,draw:e=>{e.lineWidth(45),e.circle(300,250,200),e.stroke(),e.M(300,350),e.L(300,150),e.stroke()}},9213:{width:600,draw:e=>{e.lineWidth(50),e.M(300,420),e.L(300,80),e.stroke()}},9214:{width:600,draw:e=>{e.lineWidth(45),e.M(180,400),e.C(100,300,100,150,200,80),e.C(300,10,430,50,480,150),e.C(530,250,470,380,380,420),e.stroke()}},9215:{width:600,draw:e=>{e.lineWidth(40),e.M(100,250),e.L(250,100),e.L(500,250),e.stroke(),e.circle(250,200,40),e.fill()}}},US={10496:{width:600,draw:e=>{e.lineWidth(40),e.M(100,250),e.L(500,250),e.stroke(),e.M(500,250),e.L(400,350),e.L(400,150),e.Z(),e.fill(),e.M(100,250),e.L(200,350),e.L(200,150),e.Z(),e.fill(),e.M(300,150),e.L(300,350),e.stroke()}},10497:{width:600,draw:e=>{e.lineWidth(35),e.M(80,250),e.L(520,250),e.stroke(),e.M(520,250),e.L(420,350),e.L(420,150),e.Z(),e.fill(),e.M(80,250),e.L(180,350),e.L(180,150),e.Z(),e.fill(),e.M(280,150),e.L(280,350),e.stroke(),e.M(320,150),e.L(320,350),e.stroke()}},10498:{width:600,draw:e=>{e.M(100,250),e.L(240,380),e.L(240,300),e.L(500,300),e.L(500,200),e.L(240,200),e.L(240,120),e.Z(),e.fill(),e.lineWidth(40),e.M(340,150),e.L(340,350),e.stroke()}},10499:{width:600,draw:e=>{e.M(500,250),e.L(360,380),e.L(360,300),e.L(100,300),e.L(100,200),e.L(360,200),e.L(360,120),e.Z(),e.fill(),e.lineWidth(40),e.M(260,150),e.L(260,350),e.stroke()}},10500:{width:600,draw:e=>{e.M(80,250),e.L(200,380),e.L(200,300),e.L(400,300),e.L(400,380),e.L(520,250),e.L(400,120),e.L(400,200),e.L(200,200),e.L(200,120),e.Z(),e.fill(),e.lineWidth(40),e.M(300,150),e.L(300,350),e.stroke()}},10501:{width:600,draw:e=>{e.lineWidth(40),e.M(100,150),e.L(100,350),e.stroke(),e.M(100,250),e.L(500,250),e.stroke(),e.M(500,250),e.L(400,350),e.L(400,150),e.Z(),e.fill(),e.M(200,250),e.L(250,330),e.L(250,170),e.Z(),e.fill()}},10502:{width:600,draw:e=>{e.lineWidth(40),e.M(500,150),e.L(500,350),e.stroke(),e.M(100,250),e.L(280,380),e.L(280,300),e.L(500,300),e.L(500,200),e.L(280,200),e.L(280,120),e.Z(),e.fill()}},10503:{width:600,draw:e=>{e.lineWidth(40),e.M(100,150),e.L(100,350),e.stroke(),e.M(500,250),e.L(320,380),e.L(320,300),e.L(100,300),e.L(100,200),e.L(320,200),e.L(320,120),e.Z(),e.fill()}},10504:{width:600,draw:e=>{e.lineWidth(40),e.M(300,450),e.L(300,100),e.stroke(),e.M(300,100),e.L(200,200),e.L(400,200),e.Z(),e.fill(),e.M(200,350),e.L(400,250),e.stroke()}},10505:{width:600,draw:e=>{e.lineWidth(40),e.M(300,50),e.L(300,400),e.stroke(),e.M(300,400),e.L(200,300),e.L(400,300),e.Z(),e.fill(),e.M(200,250),e.L(400,150),e.stroke()}},10506:{width:600,draw:e=>{e.lineWidth(35),e.M(300,50),e.L(300,450),e.stroke(),e.M(300,450),e.L(200,340),e.L(400,340),e.Z(),e.fill(),e.M(300,50),e.L(200,100),e.L(400,100),e.stroke()}},10507:{width:600,draw:e=>{e.lineWidth(35),e.M(300,450),e.L(300,50),e.stroke(),e.M(300,50),e.L(200,160),e.L(400,160),e.Z(),e.fill(),e.M(300,450),e.L(200,400),e.L(400,400),e.stroke()}},10508:{width:600,draw:e=>{e.lineWidth(40),e.M(500,250),e.L(400,250),e.stroke(),e.M(350,250),e.L(250,250),e.stroke(),e.M(100,250),e.L(230,370),e.L(230,130),e.Z(),e.fill()}},10509:{width:600,draw:e=>{e.lineWidth(40),e.M(100,250),e.L(200,250),e.stroke(),e.M(250,250),e.L(350,250),e.stroke(),e.M(500,250),e.L(370,370),e.L(370,130),e.Z(),e.fill()}},10510:{width:600,draw:e=>{e.lineWidth(35),e.M(500,250),e.L(430,250),e.stroke(),e.M(380,250),e.L(310,250),e.stroke(),e.M(260,250),e.L(190,250),e.stroke(),e.M(100,250),e.L(220,360),e.L(220,140),e.Z(),e.fill()}},10511:{width:600,draw:e=>{e.lineWidth(35),e.M(100,250),e.L(170,250),e.stroke(),e.M(220,250),e.L(290,250),e.stroke(),e.M(340,250),e.L(410,250),e.stroke(),e.M(500,250),e.L(380,360),e.L(380,140),e.Z(),e.fill()}},10512:{width:600,draw:e=>{e.lineWidth(35),e.M(80,250),e.L(150,250),e.stroke(),e.M(200,250),e.L(270,250),e.stroke(),e.M(320,250),e.L(390,250),e.stroke(),e.M(520,250),e.L(400,360),e.L(400,140),e.Z(),e.fill(),e.M(80,250),e.L(160,330),e.L(160,170),e.Z(),e.fill()}},10513:{width:600,draw:e=>{e.circle(150,250,20),e.fill(),e.circle(230,250,20),e.fill(),e.circle(310,250,20),e.fill(),e.lineWidth(40),e.M(370,250),e.L(430,250),e.stroke(),e.M(500,250),e.L(380,350),e.L(380,150),e.Z(),e.fill()}},10514:{width:600,draw:e=>{e.lineWidth(45),e.M(300,50),e.L(300,380),e.stroke(),e.M(300,380),e.L(200,280),e.L(400,280),e.Z(),e.fill(),e.M(150,430),e.L(450,430),e.stroke()}},10515:{width:600,draw:e=>{e.lineWidth(45),e.M(300,420),e.L(300,100),e.stroke(),e.M(300,100),e.L(200,200),e.L(400,200),e.Z(),e.fill(),e.M(150,50),e.L(450,50),e.stroke()}},10518:{width:600,draw:e=>{e.lineWidth(40),e.M(100,250),e.L(500,250),e.stroke(),e.M(500,250),e.L(400,350),e.L(400,150),e.Z(),e.fill(),e.M(100,250),e.L(180,340),e.L(180,160),e.Z(),e.fill(),e.M(100,350),e.L(100,150),e.stroke()}},10525:{width:600,draw:e=>{e.lineWidth(40),e.M(500,250),e.L(200,250),e.stroke(),e.M(100,250),e.L(200,350),e.L(200,150),e.Z(),e.fill(),e.M(500,350),e.L(500,150),e.stroke()}},10526:{width:600,draw:e=>{e.lineWidth(40),e.M(100,250),e.L(400,250),e.stroke(),e.M(500,250),e.L(400,350),e.L(400,150),e.Z(),e.fill(),e.M(100,350),e.L(100,150),e.stroke()}},10527:{width:600,draw:e=>{e.lineWidth(35),e.M(500,150),e.L(500,350),e.stroke(),e.M(500,250),e.L(200,250),e.stroke(),e.M(100,250),e.L(150,300),e.L(200,250),e.L(150,200),e.Z(),e.fill()}},10528:{width:600,draw:e=>{e.lineWidth(35),e.M(100,150),e.L(100,350),e.stroke(),e.M(100,250),e.L(400,250),e.stroke(),e.M(500,250),e.L(450,300),e.L(400,250),e.L(450,200),e.Z(),e.fill()}},10529:{width:600,draw:e=>{e.lineWidth(40),e.M(120,420),e.L(480,80),e.stroke(),e.M(120,420),e.L(120,320),e.L(220,420),e.Z(),e.fill(),e.M(480,80),e.L(480,180),e.L(380,80),e.Z(),e.fill()}},10530:{width:600,draw:e=>{e.lineWidth(40),e.M(480,420),e.L(120,80),e.stroke(),e.M(480,420),e.L(380,420),e.L(480,320),e.Z(),e.fill(),e.M(120,80),e.L(220,80),e.L(120,180),e.Z(),e.fill()}},10531:{width:600,draw:e=>{e.lineWidth(40),e.M(150,420),e.L(450,120),e.C(480,80,500,120,480,180),e.stroke(),e.M(150,420),e.L(150,310),e.L(260,420),e.Z(),e.fill()}},10532:{width:600,draw:e=>{e.lineWidth(40),e.M(450,420),e.L(150,120),e.C(120,80,100,120,120,180),e.stroke(),e.M(450,420),e.L(450,310),e.L(340,420),e.Z(),e.fill()}},10533:{width:600,draw:e=>{e.lineWidth(40),e.M(450,80),e.L(150,380),e.C(120,420,100,380,120,320),e.stroke(),e.M(450,80),e.L(450,190),e.L(340,80),e.Z(),e.fill()}},10534:{width:600,draw:e=>{e.lineWidth(40),e.M(150,80),e.L(450,380),e.C(480,420,500,380,480,320),e.stroke(),e.M(150,80),e.L(150,190),e.L(260,80),e.Z(),e.fill()}},10535:{width:600,draw:e=>{e.lineWidth(35),e.M(300,100),e.L(120,400),e.stroke(),e.M(120,400),e.L(120,300),e.L(220,400),e.Z(),e.fill(),e.M(300,100),e.L(480,400),e.stroke(),e.M(480,400),e.L(480,300),e.L(380,400),e.Z(),e.fill()}},10536:{width:600,draw:e=>{e.lineWidth(35),e.M(100,250),e.L(480,420),e.stroke(),e.M(480,420),e.L(380,420),e.L(480,330),e.Z(),e.fill(),e.M(100,250),e.L(480,80),e.stroke(),e.M(480,80),e.L(380,80),e.L(480,170),e.Z(),e.fill()}},10537:{width:600,draw:e=>{e.lineWidth(35),e.M(300,400),e.L(120,100),e.stroke(),e.M(120,100),e.L(220,100),e.L(120,200),e.Z(),e.fill(),e.M(300,400),e.L(480,100),e.stroke(),e.M(480,100),e.L(380,100),e.L(480,200),e.Z(),e.fill()}},10538:{width:600,draw:e=>{e.lineWidth(35),e.M(500,250),e.L(120,80),e.stroke(),e.M(120,80),e.L(120,180),e.L(220,80),e.Z(),e.fill(),e.M(500,250),e.L(120,420),e.stroke(),e.M(120,420),e.L(120,320),e.L(220,420),e.Z(),e.fill()}},10548:{width:600,draw:e=>{e.lineWidth(45),e.M(100,150),e.L(350,150),e.C(430,150,450,250,450,350),e.stroke(),e.M(450,350),e.L(380,230),e.L(520,230),e.Z(),e.fill()}},10549:{width:600,draw:e=>{e.lineWidth(45),e.M(100,350),e.L(350,350),e.C(430,350,450,250,450,150),e.stroke(),e.M(450,150),e.L(380,270),e.L(520,270),e.Z(),e.fill()}},10550:{width:600,draw:e=>{e.lineWidth(45),e.M(500,400),e.L(300,400),e.C(200,400,150,300,150,200),e.stroke(),e.M(150,200),e.L(80,300),e.L(220,300),e.Z(),e.fill()}},10551:{width:600,draw:e=>{e.lineWidth(45),e.M(100,400),e.L(300,400),e.C(400,400,450,300,450,200),e.stroke(),e.M(450,200),e.L(380,300),e.L(520,300),e.Z(),e.fill()}},10552:{width:600,draw:e=>{e.lineWidth(40),e.M(400,400),e.C(500,350,500,150,400,100),e.C(300,50,200,100,150,200),e.stroke(),e.M(400,400),e.L(330,340),e.L(450,340),e.Z(),e.fill()}},10553:{width:600,draw:e=>{e.lineWidth(40),e.M(200,400),e.C(100,350,100,150,200,100),e.C(300,50,400,100,450,200),e.stroke(),e.M(200,400),e.L(270,340),e.L(150,340),e.Z(),e.fill()}},10554:{width:600,draw:e=>{e.lineWidth(40),e.M(100,200),e.C(100,350,250,430,400,380),e.C(480,340,500,250,450,180),e.stroke(),e.M(100,200),e.L(170,270),e.L(170,130),e.Z(),e.fill()}},10555:{width:600,draw:e=>{e.lineWidth(40),e.M(500,300),e.C(500,150,350,70,200,120),e.C(120,160,100,250,150,320),e.stroke(),e.M(500,300),e.L(430,230),e.L(430,370),e.Z(),e.fill()}},10560:{width:600,draw:e=>{e.lineWidth(40),e.M(300,430),e.C(180,430,100,350,100,250),e.C(100,150,180,70,300,70),e.C(420,70,500,150,500,250),e.C(500,350,420,430,340,430),e.stroke(),e.M(300,430),e.L(240,370),e.L(240,480),e.Z(),e.fill()}},10561:{width:600,draw:e=>{e.lineWidth(40),e.M(300,430),e.C(420,430,500,350,500,250),e.C(500,150,420,70,300,70),e.C(180,70,100,150,100,250),e.C(100,350,180,430,260,430),e.stroke(),e.M(300,430),e.L(360,370),e.L(360,480),e.Z(),e.fill()}},10562:{width:600,draw:e=>{e.lineWidth(30),e.M(100,320),e.L(460,320),e.stroke(),e.M(500,320),e.L(400,380),e.L(400,260),e.Z(),e.fill(),e.M(400,180),e.L(180,180),e.stroke(),e.M(140,180),e.L(240,240),e.L(240,120),e.Z(),e.fill()}},10563:{width:600,draw:e=>{e.lineWidth(30),e.M(500,320),e.L(140,320),e.stroke(),e.M(100,320),e.L(200,380),e.L(200,260),e.Z(),e.fill(),e.M(200,180),e.L(420,180),e.stroke(),e.M(460,180),e.L(360,240),e.L(360,120),e.Z(),e.fill()}},10564:{width:600,draw:e=>{e.lineWidth(30),e.M(200,320),e.L(420,320),e.stroke(),e.M(460,320),e.L(360,380),e.L(360,260),e.Z(),e.fill(),e.M(500,180),e.L(140,180),e.stroke(),e.M(100,180),e.L(200,240),e.L(200,120),e.Z(),e.fill()}},10565:{width:600,draw:e=>{e.lineWidth(40),e.M(100,300),e.L(460,300),e.stroke(),e.M(500,300),e.L(400,380),e.L(400,220),e.Z(),e.fill(),e.lineWidth(30),e.M(270,100),e.L(330,100),e.stroke(),e.M(300,70),e.L(300,130),e.stroke()}},10568:{width:600,draw:e=>{e.lineWidth(35),e.M(100,350),e.L(460,350),e.stroke(),e.M(500,350),e.L(400,410),e.L(400,290),e.Z(),e.fill(),e.lineWidth(30),e.M(140,200),e.C(220,240,360,160,460,200),e.stroke(),e.M(140,130),e.C(220,170,360,90,460,130),e.stroke()}},10570:{width:600,draw:e=>{e.lineWidth(40),e.M(100,250),e.L(500,250),e.stroke(),e.M(100,250),e.L(200,370),e.L(200,250),e.Z(),e.fill(),e.M(500,250),e.L(400,130),e.L(400,250),e.Z(),e.fill()}},10571:{width:600,draw:e=>{e.lineWidth(40),e.M(100,250),e.L(500,250),e.stroke(),e.M(100,250),e.L(200,130),e.L(200,250),e.Z(),e.fill(),e.M(500,250),e.L(400,370),e.L(400,250),e.Z(),e.fill()}},10572:{width:600,draw:e=>{e.lineWidth(40),e.M(300,50),e.L(300,450),e.stroke(),e.M(300,450),e.L(400,350),e.L(300,350),e.Z(),e.fill(),e.M(300,50),e.L(200,150),e.L(300,150),e.Z(),e.fill()}},10573:{width:600,draw:e=>{e.lineWidth(40),e.M(300,50),e.L(300,450),e.stroke(),e.M(300,450),e.L(200,350),e.L(300,350),e.Z(),e.fill(),e.M(300,50),e.L(400,150),e.L(300,150),e.Z(),e.fill()}},10574:{width:600,draw:e=>{e.lineWidth(40),e.M(100,250),e.L(500,250),e.stroke(),e.M(100,250),e.L(200,370),e.L(200,250),e.Z(),e.fill(),e.M(500,250),e.L(400,370),e.L(400,250),e.Z(),e.fill()}},10575:{width:600,draw:e=>{e.lineWidth(40),e.M(300,50),e.L(300,450),e.stroke(),e.M(300,450),e.L(400,350),e.L(300,350),e.Z(),e.fill(),e.M(300,50),e.L(400,150),e.L(300,150),e.Z(),e.fill()}},10576:{width:600,draw:e=>{e.lineWidth(40),e.M(100,250),e.L(500,250),e.stroke(),e.M(100,250),e.L(200,130),e.L(200,250),e.Z(),e.fill(),e.M(500,250),e.L(400,130),e.L(400,250),e.Z(),e.fill()}},10577:{width:600,draw:e=>{e.lineWidth(40),e.M(300,50),e.L(300,450),e.stroke(),e.M(300,450),e.L(200,350),e.L(300,350),e.Z(),e.fill(),e.M(300,50),e.L(200,150),e.L(300,150),e.Z(),e.fill()}},10594:{width:600,draw:e=>{e.lineWidth(40),e.M(500,250),e.L(150,250),e.stroke(),e.M(150,250),e.L(260,370),e.L(260,250),e.Z(),e.fill(),e.M(500,150),e.L(500,350),e.stroke()}},10596:{width:600,draw:e=>{e.lineWidth(40),e.M(100,250),e.L(450,250),e.stroke(),e.M(450,250),e.L(340,370),e.L(340,250),e.Z(),e.fill(),e.M(100,150),e.L(100,350),e.stroke()}},10602:{width:600,draw:e=>{e.lineWidth(35),e.M(100,300),e.L(500,300),e.stroke(),e.M(100,300),e.L(200,400),e.L(200,300),e.Z(),e.fill(),e.M(100,200),e.L(500,200),e.stroke(),e.M(500,200),e.L(400,300),e.L(400,200),e.Z(),e.fill()}},10603:{width:600,draw:e=>{e.lineWidth(35),e.M(100,200),e.L(500,200),e.stroke(),e.M(100,200),e.L(200,100),e.L(200,200),e.Z(),e.fill(),e.M(100,300),e.L(500,300),e.stroke(),e.M(500,300),e.L(400,200),e.L(400,300),e.Z(),e.fill()}},10604:{width:600,draw:e=>{e.lineWidth(35),e.M(100,200),e.L(500,200),e.stroke(),e.M(100,200),e.L(200,300),e.L(200,200),e.Z(),e.fill(),e.M(100,300),e.L(500,300),e.stroke(),e.M(500,300),e.L(400,200),e.L(400,300),e.Z(),e.fill()}},10605:{width:600,draw:e=>{e.lineWidth(35),e.M(100,200),e.L(500,200),e.stroke(),e.M(100,200),e.L(200,100),e.L(200,200),e.Z(),e.fill(),e.M(100,300),e.L(500,300),e.stroke(),e.M(500,300),e.L(400,400),e.L(400,300),e.Z(),e.fill()}},10606:{width:600,draw:e=>{e.lineWidth(35),e.M(230,80),e.L(230,420),e.stroke(),e.M(230,420),e.L(150,320),e.L(230,320),e.Z(),e.fill(),e.M(370,420),e.L(370,80),e.stroke(),e.M(370,80),e.L(450,180),e.L(370,180),e.Z(),e.fill()}},10607:{width:600,draw:e=>{e.lineWidth(35),e.M(230,420),e.L(230,80),e.stroke(),e.M(230,80),e.L(150,180),e.L(230,180),e.Z(),e.fill(),e.M(370,80),e.L(370,420),e.stroke(),e.M(370,420),e.L(450,320),e.L(370,320),e.Z(),e.fill()}},10608:{width:600,draw:e=>{e.lineWidth(35),e.M(100,300),e.L(420,300),e.stroke(),e.M(100,200),e.L(420,200),e.stroke(),e.M(500,250),e.C(480,300,440,350,420,350),e.stroke(),e.M(500,250),e.C(480,200,440,150,420,150),e.stroke()}},10612:{width:600,draw:e=>{e.lineWidth(35),e.M(100,350),e.L(460,350),e.stroke(),e.M(500,350),e.L(400,410),e.L(400,290),e.Z(),e.fill(),e.lineWidth(30),e.M(460,200),e.C(380,240,220,160,140,200),e.stroke(),e.M(460,130),e.C(380,170,220,90,140,130),e.stroke()}},10613:{width:600,draw:e=>{e.lineWidth(35),e.M(100,350),e.L(460,350),e.stroke(),e.M(500,350),e.L(400,410),e.L(400,290),e.Z(),e.fill(),e.lineWidth(35),e.M(140,170),e.C(220,230,380,110,460,170),e.stroke()}},10614:{width:600,draw:e=>{e.lineWidth(35),e.M(500,350),e.L(140,350),e.stroke(),e.M(100,350),e.L(200,410),e.L(200,290),e.Z(),e.fill(),e.lineWidth(35),e.M(140,170),e.C(220,230,380,110,460,170),e.stroke()}},10615:{width:600,draw:e=>{e.lineWidth(35),e.M(500,350),e.L(140,350),e.stroke(),e.M(100,350),e.L(200,410),e.L(200,290),e.Z(),e.fill(),e.lineWidth(30),e.M(140,200),e.C(220,240,360,160,460,200),e.stroke(),e.M(140,130),e.C(220,170,360,90,460,130),e.stroke()}},10616:{width:600,draw:e=>{e.lineWidth(35),e.M(100,380),e.L(460,380),e.stroke(),e.M(500,380),e.L(400,440),e.L(400,320),e.Z(),e.fill(),e.lineWidth(30),e.M(140,220),e.C(220,260,360,180,460,220),e.stroke(),e.M(140,150),e.C(220,190,360,110,460,150),e.stroke(),e.M(350,260),e.L(250,100),e.stroke()}},10617:{width:600,draw:e=>{e.lineWidth(35),e.M(120,250),e.L(480,250),e.stroke(),e.M(100,250),e.L(200,350),e.L(200,150),e.Z(),e.fill(),e.M(500,250),e.L(400,350),e.L(400,150),e.Z(),e.fill()}},10618:{width:600,draw:e=>{e.lineWidth(40),e.M(500,250),e.L(130,250),e.stroke(),e.M(100,250),e.L(210,350),e.L(210,150),e.Z(),e.fill(),e.M(280,180),e.L(370,320),e.stroke(),e.M(370,180),e.L(280,320),e.stroke()}},10619:{width:600,draw:e=>{e.lineWidth(40),e.M(100,250),e.L(470,250),e.stroke(),e.M(500,250),e.L(390,350),e.L(390,150),e.Z(),e.fill(),e.M(230,180),e.L(320,320),e.stroke(),e.M(320,180),e.L(230,320),e.stroke()}},10620:{width:600,draw:e=>{e.lineWidth(40),e.M(80,250),e.L(520,250),e.stroke(),e.M(520,250),e.L(420,370),e.L(420,250),e.Z(),e.fill()}},10621:{width:600,draw:e=>{e.lineWidth(40),e.M(80,250),e.L(520,250),e.stroke(),e.M(520,250),e.L(420,130),e.L(420,250),e.Z(),e.fill()}},10622:{width:600,draw:e=>{e.lineWidth(40),e.M(300,50),e.L(300,450),e.stroke(),e.M(300,450),e.L(400,350),e.L(300,350),e.Z(),e.fill()}},10623:{width:600,draw:e=>{e.lineWidth(40),e.M(300,50),e.L(300,450),e.stroke(),e.M(300,450),e.L(200,350),e.L(300,350),e.Z(),e.fill()}}},WS={10176:{width:600,draw:e=>{e.lineWidth(45),e.M(450,80),e.L(150,80),e.L(350,420),e.stroke(),e.M(150,80),e.L(250,200),e.stroke()}},10177:{width:600,draw:e=>{e.lineWidth(40),e.M(300,470),e.L(100,50),e.L(500,50),e.Z(),e.stroke(),e.M(300,320),e.L(220,140),e.L(380,140),e.Z(),e.stroke()}},10178:{width:600,draw:e=>{e.lineWidth(50),e.M(100,80),e.L(500,80),e.stroke(),e.M(300,80),e.L(300,420),e.stroke()}},10179:{width:600,draw:e=>{e.lineWidth(45),e.M(450,420),e.C(250,420,150,350,150,250),e.C(150,150,250,80,450,80),e.stroke()}},10180:{width:600,draw:e=>{e.lineWidth(45),e.M(150,420),e.C(350,420,450,350,450,250),e.C(450,150,350,80,150,80),e.stroke()}},10181:{width:600,draw:e=>{e.lineWidth(45),e.M(350,460),e.C(200,460,200,300,300,250),e.C(400,200,400,40,250,40),e.stroke()}},10182:{width:600,draw:e=>{e.lineWidth(45),e.M(250,460),e.C(400,460,400,300,300,250),e.C(200,200,200,40,350,40),e.stroke()}},10183:{width:600,draw:e=>{e.lineWidth(50),e.M(100,420),e.L(300,80),e.L(500,420),e.stroke(),e.circle(300,280,30),e.fill()}},10184:{width:600,draw:e=>{e.lineWidth(45),e.M(150,420),e.L(300,80),e.stroke(),e.M(450,420),e.C(350,420,300,350,300,250),e.C(300,150,350,80,450,80),e.stroke()}},10185:{width:600,draw:e=>{e.lineWidth(45),e.M(150,420),e.C(250,420,300,350,300,250),e.C(300,150,250,80,150,80),e.stroke(),e.M(450,420),e.L(300,80),e.stroke()}},10186:{width:600,draw:e=>{e.lineWidth(50),e.M(300,80),e.L(300,420),e.stroke(),e.M(150,250),e.L(450,250),e.stroke()}},10187:{width:600,draw:e=>{e.lineWidth(45),e.M(120,80),e.L(480,420),e.stroke()}},10188:{width:600,draw:e=>{e.lineWidth(45),e.M(200,80),e.C(150,80,120,120,120,200),e.L(120,420),e.stroke(),e.M(200,420),e.L(500,420),e.stroke()}},10189:{width:600,draw:e=>{e.lineWidth(45),e.M(120,420),e.L(480,80),e.stroke()}},10190:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.M(200,150),e.L(300,380),e.L(400,150),e.stroke()}},10191:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.M(200,350),e.L(300,120),e.L(400,350),e.stroke()}},10192:{width:600,draw:e=>{e.lineWidth(40),e.M(300,470),e.L(510,250),e.L(300,30),e.L(90,250),e.Z(),e.stroke(),e.circle(300,250,30),e.fill()}},10193:{width:600,draw:e=>{e.lineWidth(50),e.M(100,80),e.L(300,420),e.L(500,80),e.stroke(),e.circle(300,250,30),e.fill()}},10194:{width:600,draw:e=>{e.lineWidth(45),e.M(150,80),e.L(450,80),e.stroke(),e.M(300,80),e.L(300,420),e.stroke()}},10195:{width:600,draw:e=>{e.lineWidth(45),e.M(150,420),e.L(450,420),e.L(450,80),e.stroke(),e.circle(300,250,30),e.fill()}},10196:{width:600,draw:e=>{e.lineWidth(45),e.M(150,80),e.L(150,420),e.stroke(),e.M(150,420),e.L(450,420),e.stroke(),e.circle(300,250,30),e.fill()}},10197:{width:600,draw:e=>{e.lineWidth(40),e.M(300,420),e.L(500,250),e.L(300,80),e.stroke(),e.M(100,420),e.L(300,420),e.stroke(),e.M(100,80),e.L(300,80),e.stroke(),e.M(100,80),e.L(100,420),e.stroke()}},10198:{width:600,draw:e=>{e.lineWidth(40),e.M(300,420),e.L(100,250),e.L(300,80),e.stroke(),e.M(300,420),e.L(500,420),e.stroke(),e.M(300,80),e.L(500,80),e.stroke(),e.M(500,80),e.L(500,420),e.stroke()}},10199:{width:600,draw:e=>{e.lineWidth(40),e.M(300,420),e.L(500,250),e.L(300,80),e.L(100,250),e.Z(),e.stroke()}},10200:{width:600,draw:e=>{e.lineWidth(50),e.M(100,80),e.L(500,80),e.stroke(),e.M(300,80),e.L(300,420),e.stroke()}},10201:{width:600,draw:e=>{e.lineWidth(50),e.M(100,420),e.L(500,420),e.stroke(),e.M(300,420),e.L(300,80),e.stroke()}},10202:{width:600,draw:e=>{e.lineWidth(40),e.M(200,80),e.L(200,420),e.stroke(),e.M(250,80),e.L(250,420),e.stroke(),e.M(350,80),e.L(350,420),e.stroke(),e.M(400,80),e.L(400,420),e.stroke(),e.M(250,250),e.L(350,250),e.stroke()}},10203:{width:600,draw:e=>{e.lineWidth(45),e.M(200,80),e.L(200,420),e.stroke(),e.M(400,80),e.L(400,420),e.stroke(),e.M(200,250),e.L(400,250),e.stroke()}},10204:{width:600,draw:e=>{e.lineWidth(45),e.M(150,250),e.L(400,250),e.stroke(),e.circle(450,250,50),e.stroke()}},10205:{width:600,draw:e=>{e.lineWidth(45),e.M(150,80),e.L(150,420),e.stroke(),e.M(150,250),e.L(500,250),e.stroke()}},10206:{width:600,draw:e=>{e.lineWidth(45),e.M(450,80),e.L(450,420),e.stroke(),e.M(100,250),e.L(450,250),e.stroke()}},10207:{width:600,draw:e=>{e.lineWidth(45),e.M(100,100),e.L(500,100),e.stroke(),e.M(300,100),e.L(300,320),e.stroke(),e.circle(300,390,50),e.stroke()}},10208:{width:600,draw:e=>{e.lineWidth(40),e.M(300,470),e.L(510,250),e.L(300,30),e.L(90,250),e.Z(),e.stroke(),e.M(90,250),e.L(510,250),e.stroke()}},10209:{width:600,draw:e=>{e.lineWidth(40),e.M(300,450),e.C(250,300,100,250,100,250),e.C(100,250,250,200,300,50),e.C(350,200,500,250,500,250),e.C(500,250,350,300,300,450),e.stroke()}},10210:{width:600,draw:e=>{e.lineWidth(40),e.M(300,450),e.L(100,250),e.L(300,50),e.L(500,250),e.Z(),e.stroke(),e.M(400,250),e.L(300,250),e.stroke()}},10211:{width:600,draw:e=>{e.lineWidth(40),e.M(300,450),e.C(250,350,100,300,100,250),e.C(100,200,250,150,300,50),e.C(350,150,500,200,500,250),e.C(500,300,350,350,300,450),e.stroke()}},10212:{width:600,draw:e=>{e.lineWidth(40),e.M(300,450),e.C(250,350,100,300,100,250),e.C(100,200,250,150,300,50),e.C(350,150,500,200,500,250),e.C(500,300,350,350,300,450),e.stroke(),e.M(200,250),e.L(300,250),e.stroke()}},10213:{width:600,draw:e=>{e.lineWidth(40),e.M(300,450),e.C(250,350,100,300,100,250),e.C(100,200,250,150,300,50),e.C(350,150,500,200,500,250),e.C(500,300,350,350,300,450),e.stroke(),e.M(300,250),e.L(400,250),e.stroke()}},10214:{width:600,draw:e=>{e.lineWidth(45),e.M(380,470),e.L(200,470),e.L(200,30),e.L(380,30),e.stroke(),e.M(260,470),e.L(260,30),e.stroke()}},10215:{width:600,draw:e=>{e.lineWidth(45),e.M(220,470),e.L(400,470),e.L(400,30),e.L(220,30),e.stroke(),e.M(340,470),e.L(340,30),e.stroke()}},10220:{width:600,draw:e=>{e.lineWidth(45),e.M(380,470),e.C(200,400,200,100,380,30),e.stroke(),e.M(340,460),e.C(180,400,180,100,340,40),e.stroke()}},10221:{width:600,draw:e=>{e.lineWidth(45),e.M(220,470),e.C(400,400,400,100,220,30),e.stroke(),e.M(260,460),e.C(420,400,420,100,260,40),e.stroke()}},10222:{width:600,draw:e=>{e.lineWidth(45),e.M(370,470),e.C(230,380,230,120,370,30),e.stroke()}},10223:{width:600,draw:e=>{e.lineWidth(45),e.M(230,470),e.C(370,380,370,120,230,30),e.stroke()}}},GS={11008:{width:600,draw:e=>{e.lineWidth(40),e.M(120,80),e.L(480,420),e.stroke(),e.M(480,420),e.L(350,420),e.L(480,290),e.Z(),e.stroke()}},11009:{width:600,draw:e=>{e.lineWidth(40),e.M(480,80),e.L(120,420),e.stroke(),e.M(120,420),e.L(120,290),e.L(250,420),e.Z(),e.stroke()}},11010:{width:600,draw:e=>{e.lineWidth(40),e.M(120,420),e.L(480,80),e.stroke(),e.M(480,80),e.L(480,210),e.L(350,80),e.Z(),e.stroke()}},11011:{width:600,draw:e=>{e.lineWidth(40),e.M(480,420),e.L(120,80),e.stroke(),e.M(120,80),e.L(250,80),e.L(120,210),e.Z(),e.stroke()}},11012:{width:600,draw:e=>{e.lineWidth(40),e.M(60,250),e.L(200,400),e.L(200,310),e.L(400,310),e.L(400,400),e.L(540,250),e.L(400,100),e.L(400,190),e.L(200,190),e.L(200,100),e.Z(),e.stroke()}},11016:{width:600,draw:e=>{e.M(120,80),e.L(480,420),e.L(350,420),e.L(480,290),e.Z(),e.fill(),e.lineWidth(50),e.M(140,100),e.L(440,400),e.stroke()}},11017:{width:600,draw:e=>{e.M(480,80),e.L(120,420),e.L(120,290),e.L(250,420),e.Z(),e.fill(),e.lineWidth(50),e.M(460,100),e.L(160,400),e.stroke()}},11018:{width:600,draw:e=>{e.M(120,420),e.L(480,80),e.L(480,210),e.L(350,80),e.Z(),e.fill(),e.lineWidth(50),e.M(140,400),e.L(460,100),e.stroke()}},11019:{width:600,draw:e=>{e.M(480,420),e.L(120,80),e.L(250,80),e.L(120,210),e.Z(),e.fill(),e.lineWidth(50),e.M(460,400),e.L(160,100),e.stroke()}},11020:{width:600,draw:e=>{e.M(60,250),e.L(200,400),e.L(200,310),e.L(400,310),e.L(400,400),e.L(540,250),e.L(400,100),e.L(400,190),e.L(200,190),e.L(200,100),e.Z(),e.fill()}},11021:{width:600,draw:e=>{e.M(300,480),e.L(450,340),e.L(370,340),e.L(370,160),e.L(450,160),e.L(300,20),e.L(150,160),e.L(230,160),e.L(230,340),e.L(150,340),e.Z(),e.fill()}},11022:{width:600,draw:e=>{e.lineWidth(40),e.M(100,350),e.L(400,350),e.L(400,150),e.stroke(),e.M(400,150),e.L(330,250),e.L(470,250),e.Z(),e.fill()}},11023:{width:600,draw:e=>{e.lineWidth(40),e.M(100,150),e.L(400,150),e.L(400,350),e.stroke(),e.M(400,350),e.L(330,250),e.L(470,250),e.Z(),e.fill()}},11024:{width:600,draw:e=>{e.lineWidth(40),e.M(500,350),e.L(200,350),e.L(200,150),e.stroke(),e.M(200,150),e.L(130,250),e.L(270,250),e.Z(),e.fill()}},11025:{width:600,draw:e=>{e.lineWidth(40),e.M(500,150),e.L(200,150),e.L(200,350),e.stroke(),e.M(200,350),e.L(130,250),e.L(270,250),e.Z(),e.fill()}},11026:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.rect(100,250,400,200),e.fill()}},11027:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.rect(100,50,400,200),e.fill()}},11028:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.M(100,450),e.L(500,450),e.L(500,50),e.Z(),e.fill()}},11029:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.M(100,50),e.L(100,450),e.L(500,50),e.Z(),e.fill()}},11030:{width:600,draw:e=>{e.lineWidth(40),e.M(300,470),e.L(510,250),e.L(300,30),e.L(90,250),e.Z(),e.stroke(),e.M(300,470),e.L(90,250),e.L(300,30),e.Z(),e.fill()}},11031:{width:600,draw:e=>{e.lineWidth(40),e.M(300,470),e.L(510,250),e.L(300,30),e.L(90,250),e.Z(),e.stroke(),e.M(300,470),e.L(510,250),e.L(300,30),e.Z(),e.fill()}},11032:{width:600,draw:e=>{e.lineWidth(40),e.M(300,470),e.L(510,250),e.L(300,30),e.L(90,250),e.Z(),e.stroke(),e.M(90,250),e.L(300,470),e.L(510,250),e.Z(),e.fill()}},11033:{width:600,draw:e=>{e.lineWidth(40),e.M(300,470),e.L(510,250),e.L(300,30),e.L(90,250),e.Z(),e.stroke(),e.M(90,250),e.L(300,30),e.L(510,250),e.Z(),e.fill()}},11034:{width:600,draw:e=>{e.lineWidth(25);for(let t=0;t<8;t++){let n=100+t*50;e.M(n,450),e.L(n+30,450)}for(let t=0;t<8;t++){let n=100+t*50;e.M(n,50),e.L(n+30,50)}for(let t=0;t<8;t++){let n=50+t*50;e.M(100,n),e.L(100,n+30)}for(let t=0;t<8;t++){let n=50+t*50;e.M(500,n),e.L(500,n+30)}e.stroke()}},11037:{width:600,draw:e=>{e.rect(240,190,120,120),e.fill()}},11038:{width:600,draw:e=>{e.lineWidth(30),e.rect(240,190,120,120),e.stroke()}},11039:{width:600,draw:e=>{for(let t=0;t<5;t++){let n=(t*72-90)*Math.PI/180;t===0?e.M(300+200*Math.cos(n),250+200*Math.sin(n)):e.L(300+200*Math.cos(n),250+200*Math.sin(n))}e.Z(),e.fill()}},11040:{width:600,draw:e=>{e.lineWidth(40);for(let t=0;t<5;t++){let n=(t*72-90)*Math.PI/180;t===0?e.M(300+200*Math.cos(n),250+200*Math.sin(n)):e.L(300+200*Math.cos(n),250+200*Math.sin(n))}e.Z(),e.stroke()}},11041:{width:600,draw:e=>{e.lineWidth(40);for(let t=0;t<6;t++){let n=(t*60-90)*Math.PI/180;t===0?e.M(300+200*Math.cos(n),250+200*Math.sin(n)):e.L(300+200*Math.cos(n),250+200*Math.sin(n))}e.Z(),e.stroke()}},11042:{width:600,draw:e=>{for(let t=0;t<6;t++){let n=(t*60-90)*Math.PI/180;t===0?e.M(300+200*Math.cos(n),250+200*Math.sin(n)):e.L(300+200*Math.cos(n),250+200*Math.sin(n))}e.Z(),e.fill()}},11043:{width:600,draw:e=>{for(let t=0;t<6;t++){let n=t*60*Math.PI/180;t===0?e.M(300+200*Math.cos(n),250+200*Math.sin(n)):e.L(300+200*Math.cos(n),250+200*Math.sin(n))}e.Z(),e.fill()}},11044:{width:600,draw:e=>{e.circle(300,250,230),e.fill()}},11045:{width:600,draw:e=>{e.M(300,470),e.L(480,250),e.L(300,30),e.L(120,250),e.Z(),e.fill()}},11046:{width:600,draw:e=>{e.lineWidth(40),e.M(300,470),e.L(480,250),e.L(300,30),e.L(120,250),e.Z(),e.stroke()}},11047:{width:600,draw:e=>{e.M(300,490),e.L(460,250),e.L(300,10),e.L(140,250),e.Z(),e.fill()}},11048:{width:600,draw:e=>{e.lineWidth(40),e.M(300,490),e.L(460,250),e.L(300,10),e.L(140,250),e.Z(),e.stroke()}},11049:{width:600,draw:e=>{e.M(300,380),e.L(400,250),e.L(300,120),e.L(200,250),e.Z(),e.fill()}},11050:{width:600,draw:e=>{e.M(300,400),e.L(380,250),e.L(300,100),e.L(220,250),e.Z(),e.fill()}},11051:{width:600,draw:e=>{e.lineWidth(35),e.M(300,400),e.L(380,250),e.L(300,100),e.L(220,250),e.Z(),e.stroke()}},11052:{width:600,draw:e=>{e.ellipse(300,250,220,120),e.fill()}},11053:{width:600,draw:e=>{e.lineWidth(40),e.ellipse(300,250,220,120),e.stroke()}},11054:{width:600,draw:e=>{e.ellipse(300,250,120,220),e.fill()}},11055:{width:600,draw:e=>{e.lineWidth(40),e.ellipse(300,250,120,220),e.stroke()}},11056:{width:600,draw:e=>{e.lineWidth(40),e.M(480,250),e.L(180,250),e.stroke(),e.M(100,250),e.L(230,370),e.L(230,130),e.Z(),e.fill(),e.circle(510,250,30),e.fill()}},11057:{width:600,draw:e=>{e.lineWidth(25);for(let t=150;t<=350;t+=100)e.M(500,t),e.L(200,t),e.stroke(),e.M(120,t),e.L(220,t+60),e.L(220,t-60),e.Z(),e.fill()}},11058:{width:600,draw:e=>{e.lineWidth(35),e.M(460,250),e.L(200,250),e.stroke(),e.M(120,250),e.L(220,350),e.L(220,150),e.Z(),e.fill(),e.circle(500,250,40),e.stroke(),e.M(480,250),e.L(520,250),e.stroke(),e.M(500,230),e.L(500,270),e.stroke()}},11059:{width:600,draw:e=>{e.lineWidth(35),e.M(520,250),e.C(480,330,420,170,360,250),e.C(300,330,240,170,180,250),e.stroke(),e.M(100,250),e.L(200,340),e.L(200,160),e.Z(),e.fill()}},11060:{width:600,draw:e=>{e.lineWidth(40),e.M(500,250),e.L(100,250),e.stroke(),e.M(100,250),e.L(200,350),e.L(200,150),e.Z(),e.fill(),e.M(500,250),e.L(400,350),e.L(400,150),e.Z(),e.fill(),e.M(300,150),e.L(300,350),e.stroke()}},11061:{width:600,draw:e=>{e.lineWidth(35),e.M(500,250),e.L(100,250),e.stroke(),e.M(100,250),e.L(200,350),e.L(200,150),e.Z(),e.fill(),e.M(500,250),e.L(400,350),e.L(400,150),e.Z(),e.fill(),e.M(280,150),e.L(280,350),e.stroke(),e.M(320,150),e.L(320,350),e.stroke()}},11062:{width:600,draw:e=>{e.lineWidth(40),e.M(500,150),e.L(500,350),e.stroke(),e.M(500,250),e.L(100,250),e.stroke(),e.M(100,250),e.L(200,350),e.L(200,150),e.Z(),e.fill(),e.M(400,250),e.L(450,320),e.L(450,180),e.Z(),e.fill()}},11063:{width:600,draw:e=>{e.lineWidth(35),e.M(500,250),e.L(430,250),e.stroke(),e.M(380,250),e.L(310,250),e.stroke(),e.M(260,250),e.L(190,250),e.stroke(),e.M(100,250),e.L(200,350),e.L(200,150),e.Z(),e.fill(),e.M(500,250),e.L(430,330),e.L(430,170),e.Z(),e.fill()}},11064:{width:600,draw:e=>{e.circle(450,250,20),e.fill(),e.circle(370,250,20),e.fill(),e.circle(290,250,20),e.fill(),e.lineWidth(40),e.M(230,250),e.L(170,250),e.stroke(),e.M(100,250),e.L(220,350),e.L(220,150),e.Z(),e.fill()}},11065:{width:600,draw:e=>{e.lineWidth(40),e.M(500,250),e.L(150,250),e.stroke(),e.M(100,250),e.L(200,350),e.L(200,150),e.Z(),e.fill(),e.M(500,350),e.L(500,150),e.stroke(),e.M(350,150),e.L(350,350),e.stroke()}},11066:{width:600,draw:e=>{e.lineWidth(35),e.M(500,250),e.L(150,250),e.stroke(),e.M(100,250),e.L(200,340),e.L(200,160),e.Z(),e.fill(),e.M(500,340),e.L(500,160),e.stroke(),e.M(330,160),e.L(330,340),e.stroke(),e.M(370,160),e.L(370,340),e.stroke()}},11067:{width:600,draw:e=>{e.lineWidth(40),e.M(500,250),e.L(100,250),e.stroke(),e.M(100,250),e.L(200,350),e.L(200,150),e.Z(),e.fill(),e.M(500,250),e.L(400,350),e.L(400,150),e.Z(),e.fill(),e.M(500,350),e.L(500,150),e.stroke()}},11068:{width:600,draw:e=>{e.lineWidth(35),e.M(520,250),e.L(80,250),e.stroke(),e.M(80,250),e.L(170,340),e.L(170,160),e.Z(),e.fill(),e.M(520,250),e.L(430,340),e.L(430,160),e.Z(),e.fill(),e.M(520,340),e.L(520,160),e.stroke(),e.M(300,160),e.L(300,340),e.stroke()}},11069:{width:600,draw:e=>{e.lineWidth(30),e.M(530,250),e.L(70,250),e.stroke(),e.M(70,250),e.L(160,340),e.L(160,160),e.Z(),e.fill(),e.M(530,250),e.L(440,340),e.L(440,160),e.Z(),e.fill(),e.M(530,340),e.L(530,160),e.stroke(),e.M(280,160),e.L(280,340),e.stroke(),e.M(320,160),e.L(320,340),e.stroke()}},11070:{width:600,draw:e=>{e.lineWidth(40),e.M(500,250),e.L(130,250),e.stroke(),e.M(100,250),e.L(210,350),e.L(210,150),e.Z(),e.fill(),e.M(310,180),e.L(390,320),e.stroke(),e.M(390,180),e.L(310,320),e.stroke()}},11071:{width:600,draw:e=>{e.lineWidth(35),e.M(500,250),e.C(440,330,380,170,300,250),e.C(240,330,200,170,160,250),e.stroke(),e.M(100,250),e.L(200,340),e.L(200,160),e.Z(),e.fill()}},11072:{width:600,draw:e=>{e.lineWidth(35),e.M(500,200),e.L(140,200),e.stroke(),e.M(100,200),e.L(200,270),e.L(200,130),e.Z(),e.fill(),e.M(150,350),e.L(470,350),e.stroke(),e.M(150,400),e.L(470,400),e.stroke()}},11073:{width:600,draw:e=>{e.lineWidth(35),e.M(500,200),e.L(140,200),e.stroke(),e.M(100,200),e.L(200,270),e.L(200,130),e.Z(),e.fill(),e.M(470,380),e.C(400,430,200,330,140,380),e.stroke()}},11077:{width:600,draw:e=>{e.lineWidth(25),e.M(500,330),e.L(200,330),e.stroke(),e.M(500,280),e.L(200,280),e.stroke(),e.M(500,230),e.L(200,230),e.stroke(),e.M(500,180),e.L(200,180),e.stroke(),e.M(100,250),e.L(230,400),e.L(230,100),e.Z(),e.fill()}},11078:{width:600,draw:e=>{e.lineWidth(25),e.M(100,330),e.L(400,330),e.stroke(),e.M(100,280),e.L(400,280),e.stroke(),e.M(100,230),e.L(400,230),e.stroke(),e.M(100,180),e.L(400,180),e.stroke(),e.M(500,250),e.L(370,400),e.L(370,100),e.Z(),e.fill()}},11089:{width:600,draw:e=>{for(let t=0;t<5;t++){let n=(t*72-90)*Math.PI/180,r=(t*72+36-90)*Math.PI/180;t===0?e.M(300+200*Math.cos(n),260+200*Math.sin(n)):e.L(300+200*Math.cos(n),260+200*Math.sin(n)),e.L(300+80*Math.cos(r),260+80*Math.sin(r))}e.Z(),e.fill()}},11090:{width:600,draw:e=>{e.lineWidth(35);for(let t=0;t<5;t++){let n=(t*72-90)*Math.PI/180,r=(t*72+36-90)*Math.PI/180;t===0?e.M(300+200*Math.cos(n),260+200*Math.sin(n)):e.L(300+200*Math.cos(n),260+200*Math.sin(n)),e.L(300+80*Math.cos(r),260+80*Math.sin(r))}e.Z(),e.stroke()}},11091:{width:600,draw:e=>{for(let t=0;t<4;t++){let n=(t*90-90)*Math.PI/180,r=(t*90+45-90)*Math.PI/180;t===0?e.M(300+210*Math.cos(n),260+210*Math.sin(n)):e.L(300+210*Math.cos(n),260+210*Math.sin(n)),e.L(300+90*Math.cos(r),260+90*Math.sin(r))}e.Z(),e.fill()}},11092:{width:600,draw:e=>{e.lineWidth(40);for(let t=0;t<4;t++){let n=(t*90-90)*Math.PI/180,r=(t*90+45-90)*Math.PI/180;t===0?e.M(300+210*Math.cos(n),260+210*Math.sin(n)):e.L(300+210*Math.cos(n),260+210*Math.sin(n)),e.L(300+90*Math.cos(r),260+90*Math.sin(r))}e.Z(),e.stroke()}},11093:{width:600,draw:e=>{e.lineWidth(60),e.circle(300,250,210),e.stroke()}},11094:{width:600,draw:e=>{e.circle(300,250,40),e.fill()}},11095:{width:600,draw:e=>{e.lineWidth(50),e.circle(300,250,180),e.stroke()}},11096:{width:600,draw:e=>{e.lineWidth(45),e.circle(300,250,200),e.stroke()}},11097:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,200),e.stroke(),e.circle(300,250,100),e.stroke()}},11104:{width:600,draw:e=>{e.lineWidth(40),e.M(500,250),e.L(200,250),e.stroke(),e.M(100,250),e.L(230,380),e.L(230,120),e.Z(),e.fill()}},11105:{width:600,draw:e=>{e.lineWidth(40),e.M(300,50),e.L(300,350),e.stroke(),e.M(300,450),e.L(180,320),e.L(420,320),e.Z(),e.fill()}},11106:{width:600,draw:e=>{e.lineWidth(40),e.M(100,250),e.L(400,250),e.stroke(),e.M(500,250),e.L(370,380),e.L(370,120),e.Z(),e.fill()}},11107:{width:600,draw:e=>{e.lineWidth(40),e.M(300,450),e.L(300,150),e.stroke(),e.M(300,50),e.L(180,180),e.L(420,180),e.Z(),e.fill()}},11108:{width:600,draw:e=>{e.lineWidth(35),e.M(180,250),e.L(420,250),e.stroke(),e.M(100,250),e.L(210,350),e.L(210,150),e.Z(),e.fill(),e.M(500,250),e.L(390,350),e.L(390,150),e.Z(),e.fill()}},11109:{width:600,draw:e=>{e.lineWidth(35),e.M(300,140),e.L(300,360),e.stroke(),e.M(300,460),e.L(200,350),e.L(400,350),e.Z(),e.fill(),e.M(300,40),e.L(200,150),e.L(400,150),e.Z(),e.fill()}},11120:{width:600,draw:e=>{e.lineWidth(30),e.M(500,280),e.L(200,280),e.stroke(),e.M(500,220),e.L(200,220),e.stroke(),e.M(100,250),e.L(230,380),e.L(230,120),e.Z(),e.fill()}},11122:{width:600,draw:e=>{e.lineWidth(30),e.M(100,280),e.L(400,280),e.stroke(),e.M(100,220),e.L(400,220),e.stroke(),e.M(500,250),e.L(370,380),e.L(370,120),e.Z(),e.fill()}},11157:{width:600,draw:e=>{e.M(550,250),e.L(370,420),e.L(370,310),e.L(50,310),e.L(50,190),e.L(370,190),e.L(370,80),e.Z(),e.fill()}},11118:{width:600,draw:e=>{e.lineWidth(40),e.M(150,400),e.L(150,200),e.C(150,80,300,50,450,80),e.C(500,100,520,200,450,250),e.stroke(),e.M(150,400),e.L(80,300),e.L(220,300),e.Z(),e.fill()}},11119:{width:600,draw:e=>{e.lineWidth(40),e.M(450,400),e.L(450,200),e.C(450,80,300,50,150,80),e.C(100,100,80,200,150,250),e.stroke(),e.M(450,400),e.L(380,300),e.L(520,300),e.Z(),e.fill()}},11134:{width:600,draw:e=>{e.lineWidth(40),e.M(100,250),e.L(430,250),e.stroke(),e.M(500,250),e.L(380,360),e.L(380,140),e.Z(),e.fill(),e.M(100,150),e.L(100,350),e.stroke()}},11135:{width:600,draw:e=>{e.lineWidth(40),e.M(500,250),e.L(170,250),e.stroke(),e.M(100,250),e.L(220,360),e.L(220,140),e.Z(),e.fill(),e.M(500,150),e.L(500,350),e.stroke()}},11144:{width:600,draw:e=>{e.circle(300,250,220),e.fill()}},11146:{width:600,draw:e=>{e.circle(300,250,220),e.fill()}},11148:{width:600,draw:e=>{e.lineWidth(40),e.M(350,430),e.C(200,430,100,350,100,250),e.C(100,150,200,70,350,70),e.C(480,70,520,200,500,300),e.stroke(),e.M(350,430),e.L(290,370),e.L(400,370),e.Z(),e.fill()}},11150:{width:600,draw:e=>{e.lineWidth(40),e.M(250,430),e.C(400,430,500,350,500,250),e.C(500,150,400,70,250,70),e.C(120,70,80,200,100,300),e.stroke(),e.M(250,430),e.L(200,370),e.L(310,370),e.Z(),e.fill()}},11152:{width:600,draw:e=>{e.lineWidth(40),e.M(480,250),e.L(200,250),e.stroke(),e.M(120,250),e.L(170,300),e.L(220,250),e.L(170,200),e.Z(),e.fill()}},11153:{width:600,draw:e=>{e.lineWidth(40),e.M(120,250),e.L(400,250),e.stroke(),e.M(480,250),e.L(430,300),e.L(380,250),e.L(430,200),e.Z(),e.fill()}},11165:{width:600,draw:e=>{e.M(300,450),e.L(150,100),e.L(450,100),e.Z(),e.fill()}},11166:{width:600,draw:e=>{e.M(150,450),e.L(500,250),e.L(150,50),e.Z(),e.fill()}},11167:{width:600,draw:e=>{e.M(150,400),e.L(450,400),e.L(300,50),e.Z(),e.fill()}},11168:{width:600,draw:e=>{e.M(450,450),e.L(100,250),e.L(450,50),e.Z(),e.fill()}},11169:{width:600,draw:e=>{e.lineWidth(40),e.M(300,450),e.L(150,100),e.L(450,100),e.Z(),e.stroke()}},11170:{width:600,draw:e=>{e.lineWidth(40),e.M(150,450),e.L(500,250),e.L(150,50),e.Z(),e.stroke()}},11171:{width:600,draw:e=>{e.lineWidth(40),e.M(150,400),e.L(450,400),e.L(300,50),e.Z(),e.stroke()}},11172:{width:600,draw:e=>{e.lineWidth(40),e.M(450,450),e.L(100,250),e.L(450,50),e.Z(),e.stroke()}}};function H(e,t,n,r,i,a){return{width:600,draw:o=>{a||o.lineWidth(30);for(let a=0;a<e;a++){let s=(a*360/e-90)*Math.PI/180,c=(a*360/e+180/e-90)*Math.PI/180;a===0?o.M(t+r*Math.cos(s),n+r*Math.sin(s)):o.L(t+r*Math.cos(s),n+r*Math.sin(s)),o.L(t+i*Math.cos(c),n+i*Math.sin(c))}o.Z(),a?o.fill():o.stroke()}}}let U={9690:{width:600,draw:e=>{e.lineWidth(45),e.M(80,250),e.C(80,390,180,470,300,470),e.C(420,470,520,390,520,250),e.stroke()}},9691:{width:600,draw:e=>{e.lineWidth(45),e.M(520,250),e.C(520,110,420,30,300,30),e.C(180,30,80,110,80,250),e.stroke()}},10690:{width:600,draw:e=>{e.lineWidth(35),e.circle(260,250,180),e.stroke(),e.circle(470,250,50),e.stroke()}},10691:{width:600,draw:e=>{e.lineWidth(35),e.circle(260,250,180),e.stroke(),e.M(440,290),e.L(540,290),e.stroke(),e.M(440,210),e.L(540,210),e.stroke()}},10692:{width:600,draw:e=>{e.lineWidth(38),e.rect(80,30,440,440),e.stroke(),e.M(160,100),e.L(440,400),e.stroke()}},10693:{width:600,draw:e=>{e.lineWidth(38),e.rect(80,30,440,440),e.stroke(),e.M(160,400),e.L(440,100),e.stroke()}},10694:{width:600,draw:e=>{e.lineWidth(38),e.rect(80,30,440,440),e.stroke(),e.lineWidth(35),e.M(300,100),e.L(300,400),e.stroke(),e.M(160,250),e.L(440,250),e.stroke(),e.M(180,120),e.L(420,380),e.stroke(),e.M(180,380),e.L(420,120),e.stroke()}},9548:{width:600,draw:e=>{e.lineWidth(40),e.M(0,250),e.L(120,250),e.stroke(),e.M(200,250),e.L(400,250),e.stroke(),e.M(480,250),e.L(600,250),e.stroke()}},9549:{width:600,draw:e=>{e.lineWidth(80),e.M(0,250),e.L(120,250),e.stroke(),e.M(200,250),e.L(400,250),e.stroke(),e.M(480,250),e.L(600,250),e.stroke()}},9550:{width:600,draw:e=>{e.lineWidth(40),e.M(300,0),e.L(300,100),e.stroke(),e.M(300,180),e.L(300,320),e.stroke(),e.M(300,400),e.L(300,500),e.stroke()}},9551:{width:600,draw:e=>{e.lineWidth(80),e.M(300,0),e.L(300,100),e.stroke(),e.M(300,180),e.L(300,320),e.stroke(),e.M(300,400),e.L(300,500),e.stroke()}},8456:{width:600,draw:e=>{e.lineWidth(40),e.M(180,450),e.L(420,450),e.L(420,250),e.L(250,250),e.stroke(),e.M(420,250),e.L(420,50),e.L(180,50),e.stroke()}},8483:{width:600,draw:e=>{e.lineWidth(45),e.M(150,480),e.L(300,20),e.L(450,480),e.stroke()}},8506:{width:600,draw:e=>{e.lineWidth(40),e.ellipse(300,260,180,200),e.stroke(),e.M(380,140),e.L(480,40),e.stroke()}},8507:{width:600,draw:e=>{e.lineWidth(40),e.M(80,50),e.L(80,480),e.L(200,480),e.stroke(),e.M(80,280),e.L(180,280),e.stroke(),e.M(230,50),e.L(300,480),e.L(370,50),e.stroke(),e.M(255,200),e.L(345,200),e.stroke(),e.M(400,480),e.L(520,50),e.stroke(),e.M(520,480),e.L(400,50),e.stroke()}},9135:{width:600,draw:e=>{e.lineWidth(40),e.M(0,250),e.L(600,250),e.stroke()}},9143:{width:600,draw:e=>{e.lineWidth(45),e.M(80,250),e.L(200,250),e.L(300,0),e.L(520,500),e.stroke()}},9144:{width:300,draw:e=>{e.lineWidth(40),e.M(80,0),e.L(80,500),e.stroke()}},9145:{width:300,draw:e=>{e.lineWidth(40),e.M(220,0),e.L(220,500),e.stroke()}},9154:{width:600,draw:e=>{e.lineWidth(35),e.M(300,0),e.L(300,500),e.stroke(),e.M(100,250),e.C(150,300,250,200,300,250),e.C(350,300,450,200,500,250),e.stroke()}}};for(let e of[9155,9156,9157,9158,9159,9160,9169,9170,9171,9172,9173,9174,9175,9176,9177])U[e]={width:600,draw:e=>{e.lineWidth(35),e.M(300,0),e.L(300,500),e.stroke(),e.M(150,250),e.L(450,250),e.stroke()}};U[10063]={width:600,draw:e=>{e.lineWidth(30),e.rect(120,80,360,360),e.stroke(),e.lineWidth(50),e.M(140,80),e.L(500,80),e.L(500,420),e.stroke()}},U[10064]={width:600,draw:e=>{e.lineWidth(30),e.rect(120,80,360,360),e.stroke(),e.lineWidth(50),e.M(480,440),e.L(480,80),e.L(120,80),e.stroke()}},U[10065]={width:600,draw:e=>{e.lineWidth(30),e.rect(120,80,360,360),e.stroke(),e.lineWidth(50),e.M(460,440),e.L(100,440),e.L(100,80),e.stroke()}},U[10066]={width:600,draw:e=>{e.lineWidth(30),e.rect(120,80,360,360),e.stroke(),e.lineWidth(50),e.M(120,60),e.L(120,420),e.L(480,420),e.stroke()}},U[10072]={width:250,draw:e=>{e.lineWidth(35),e.M(125,0),e.L(125,500),e.stroke()}},U[10073]={width:300,draw:e=>{e.lineWidth(55),e.M(150,0),e.L(150,500),e.stroke()}},U[10074]={width:350,draw:e=>{e.lineWidth(80),e.M(175,0),e.L(175,500),e.stroke()}},U[10075]={width:300,draw:e=>{e.circle(150,430,55),e.fill(),e.lineWidth(40),e.M(150,375),e.C(110,320,90,290,70,270),e.stroke()}},U[10076]={width:300,draw:e=>{e.circle(150,430,55),e.fill(),e.lineWidth(40),e.M(150,375),e.C(190,320,210,290,230,270),e.stroke()}},U[10077]={width:450,draw:e=>{e.circle(120,430,50),e.fill(),e.circle(300,430,50),e.fill(),e.lineWidth(35),e.M(120,380),e.C(80,320,60,290,40,270),e.stroke(),e.M(300,380),e.C(260,320,240,290,220,270),e.stroke()}},U[10078]={width:450,draw:e=>{e.circle(150,430,50),e.fill(),e.circle(330,430,50),e.fill(),e.lineWidth(35),e.M(150,380),e.C(190,320,210,290,230,270),e.stroke(),e.M(330,380),e.C(370,320,390,290,410,270),e.stroke()}},U[10079]={width:300,draw:e=>{e.circle(150,80,50),e.fill(),e.lineWidth(40),e.M(150,130),e.C(190,190,210,220,230,250),e.stroke()}},U[10080]={width:450,draw:e=>{e.circle(130,80,45),e.fill(),e.circle(310,80,45),e.fill(),e.lineWidth(35),e.M(130,125),e.C(170,190,190,220,210,250),e.stroke(),e.M(310,125),e.C(350,190,370,220,390,250),e.stroke()}},U[10081]={width:600,draw:e=>{e.lineWidth(45),e.M(300,480),e.L(300,100),e.stroke(),e.M(180,380),e.L(420,380),e.stroke(),e.circle(300,50,30),e.fill()}};for(let[e,t,n,r]of[[10088,10089,!1,!1],[10090,10091,!1,!0],[10092,10093,!0,!1],[10094,10095,!0,!1],[10096,10097,!0,!0],[10098,10099,!1,!0],[10100,10101,!1,!1]]){let i=r?55:38;n?(U[e]={width:350,draw:e=>{e.lineWidth(i),e.M(280,480),e.L(100,250),e.L(280,20),e.stroke()}},U[t]={width:350,draw:e=>{e.lineWidth(i),e.M(70,480),e.L(250,250),e.L(70,20),e.stroke()}}):(U[e]={width:350,draw:e=>{e.lineWidth(i),e.M(260,480),e.C(100,400,100,100,260,20),e.stroke()}},U[t]={width:350,draw:e=>{e.lineWidth(i),e.M(90,480),e.C(250,400,250,100,90,20),e.stroke()}})}{let e=(e,t,n,r,i)=>{[e=>{e.ellipse(n,r,i*.28,i*.42),e.stroke()},e=>{e.M(n,r+i*.42),e.L(n,r-i*.42),e.stroke()},e=>{e.M(n-i*.25,r+i*.25),e.C(n-i*.25,r+i*.45,n+i*.25,r+i*.45,n+i*.25,r+i*.15),e.L(n-i*.25,r-i*.42),e.L(n+i*.25,r-i*.42),e.stroke()},e=>{e.M(n-i*.22,r+i*.42),e.L(n+i*.22,r+i*.42),e.L(n+i*.22,r),e.L(n-i*.1,r),e.stroke(),e.M(n+i*.22,r),e.L(n+i*.22,r-i*.42),e.L(n-i*.22,r-i*.42),e.stroke()},e=>{e.M(n+i*.2,r+i*.42),e.L(n-i*.25,r-i*.05),e.L(n+i*.25,r-i*.05),e.stroke(),e.M(n+i*.2,r+i*.42),e.L(n+i*.2,r-i*.42),e.stroke()},e=>{e.M(n+i*.22,r+i*.42),e.L(n-i*.22,r+i*.42),e.L(n-i*.22,r+i*.05),e.L(n+i*.22,r+i*.05),e.C(n+i*.35,r+i*.05,n+i*.35,r-i*.42,n-i*.22,r-i*.42),e.stroke()},e=>{e.M(n+i*.2,r+i*.35),e.C(n-i*.1,r+i*.45,n-i*.3,r+i*.15,n-i*.25,r-i*.1),e.C(n-i*.2,r-i*.45,n+i*.25,r-i*.45,n+i*.25,r-i*.1),e.C(n+i*.25,r+i*.1,n-i*.25,r+i*.1,n-i*.25,r-i*.1),e.stroke()},e=>{e.M(n-i*.22,r+i*.42),e.L(n+i*.22,r+i*.42),e.L(n-i*.05,r-i*.42),e.stroke()},e=>{e.ellipse(n,r+i*.22,i*.2,i*.2),e.stroke(),e.ellipse(n,r-i*.22,i*.22,i*.22),e.stroke()},e=>{e.M(n-i*.2,r-i*.35),e.C(n+i*.1,r-i*.45,n+i*.3,r-i*.15,n+i*.25,r+i*.1),e.C(n+i*.2,r+i*.45,n-i*.25,r+i*.45,n-i*.25,r+i*.1),e.C(n-i*.25,r-i*.1,n+i*.25,r-i*.1,n+i*.25,r+i*.1),e.stroke()}][t](e)};for(let t=0;t<10;t++){let n=t+1;U[10112+t]={width:600,draw:t=>{t.lineWidth(28),t.circle(300,250,220),t.stroke(),t.lineWidth(26),n<=9?e(t,n,300,250,210):(e(t,1,225,250,155),e(t,0,375,250,155))}}}for(let t=0;t<10;t++){let n=t+1;U[10122+t]={width:600,draw:t=>{t.rect(70,20,460,460),t.fill(),t.lineWidth(24),n<=9?e(t,n,300,250,200):(e(t,1,225,250,150),e(t,0,375,250,150))}}}}U[10160]={width:600,draw:e=>{e.lineWidth(40),e.M(150,100),e.C(150,400,450,400,450,250),e.C(450,100,250,100,250,250),e.C(250,350,350,400,450,350),e.stroke()}},U[10175]={width:600,draw:e=>{e.lineWidth(35),e.M(80,150),e.C(80,400,300,400,300,250),e.C(300,100,150,100,150,250),e.stroke(),e.M(300,150),e.C(300,400,520,400,520,250),e.C(520,100,370,100,370,250),e.stroke()}};function KS(e,t){let n=Math.sqrt(e*e+t*t),r=e/n,i=t/n,a=-i,o=r,s=300+r*220,c=250+i*220,l=300-r*220,u=250-i*220,d=300-r*60,f=250-i*60;return{width:600,draw:e=>{e.M(l-a*50,u-o*50),e.L(d-a*50,f-o*50),e.L(d-a*120,f-o*120),e.L(s,c),e.L(d+a*120,f+o*120),e.L(d+a*50,f+o*50),e.L(l+a*50,u+o*50),e.Z(),e.fill()}}}function qS(e){let t={1:[[300,250]],2:[[200,350],[400,150]],3:[[200,350],[300,250],[400,150]],4:[[200,350],[400,350],[200,150],[400,150]],5:[[200,350],[400,350],[300,250],[200,150],[400,150]],6:[[200,350],[400,350],[200,250],[400,250],[200,150],[400,150]]};return{width:600,draw:n=>{n.lineWidth(35),n.rect(100,50,400,400),n.stroke();let r=t[e]??[];for(let[e,t]of r)n.circle(e,t,30),n.fill()}}}function JS(e,t){return{width:600,draw:n=>{switch(t||n.lineWidth(30),n.rect(180,30,240,40),t?n.fill():n.stroke(),e){case`king`:n.M(220,70),n.L(220,350),n.L(380,350),n.L(380,70),n.Z(),t?n.fill():n.stroke(),n.lineWidth(35),n.M(300,350),n.L(300,450),n.stroke(),n.M(260,420),n.L(340,420),n.stroke();break;case`queen`:n.M(220,70),n.L(200,350),n.L(400,350),n.L(380,70),n.Z(),t?n.fill():n.stroke(),n.lineWidth(25),n.M(200,350),n.L(160,430),n.stroke(),n.M(270,350),n.L(250,440),n.stroke(),n.M(300,350),n.L(300,460),n.stroke(),n.M(330,350),n.L(350,440),n.stroke(),n.M(400,350),n.L(440,430),n.stroke();break;case`rook`:n.M(200,70),n.L(200,350),n.L(400,350),n.L(400,70),n.Z(),t?n.fill():n.stroke(),n.rect(180,350,60,80),t?n.fill():n.stroke(),n.rect(270,350,60,80),t?n.fill():n.stroke(),n.rect(360,350,60,80),t?n.fill():n.stroke();break;case`bishop`:n.M(230,70),n.L(200,300),n.C(200,400,400,400,400,300),n.L(370,70),n.Z(),t?n.fill():n.stroke(),n.M(300,300),n.L(300,460),t||n.lineWidth(25),n.stroke();break;case`knight`:n.M(220,70),n.L(220,300),n.L(280,350),n.L(280,420),n.L(350,460),n.L(420,400),n.L(380,300),n.L(380,70),n.Z(),t?n.fill():n.stroke();break;case`pawn`:n.M(230,70),n.L(230,200),n.L(370,200),n.L(370,70),n.Z(),t?n.fill():n.stroke(),n.circle(300,320,90),t?n.fill():n.stroke();break}}}}function YS(e,t){return{width:600,draw:n=>{n.lineWidth(t);for(let t=0;t<e;t++){let r=t*180/e*Math.PI/180;n.M(300-180*Math.cos(r),250-180*Math.sin(r)),n.L(300+180*Math.cos(r),250+180*Math.sin(r))}n.stroke()}}}let W={10025:H(4,300,250,220,80,!1),10026:{width:600,draw:e=>{e.lineWidth(30),e.circle(300,250,230),e.stroke(),H(5,300,250,180,70,!0).draw(e)}},10027:H(4,300,250,220,100,!0),10028:H(4,300,250,220,100,!1),10029:H(5,300,250,220,100,!1),10030:H(6,300,250,220,130,!1),10031:H(6,300,250,220,100,!1),10033:YS(6,45),10034:YS(4,30),10035:YS(8,25),10036:H(8,300,250,200,100,!0),10037:H(8,300,250,200,80,!0),10038:H(6,300,250,220,110,!0),10039:H(6,300,250,220,110,!1),10040:H(8,300,250,220,90,!0),10041:YS(12,40),10042:YS(6,35),10043:YS(8,20),10044:YS(8,15),10045:YS(4,50),10046:H(6,300,250,200,140,!1),10047:H(8,300,250,200,140,!0),10048:H(8,300,250,200,140,!1),10049:H(8,300,250,210,160,!1),10050:H(16,300,250,220,160,!1),10051:YS(6,50),10052:H(6,300,250,220,120,!1),10053:H(6,300,250,200,100,!1),10054:H(4,300,250,220,60,!1),10055:H(4,300,250,200,50,!0),10056:H(4,300,250,220,50,!0),10057:H(4,300,250,180,80,!0),10058:H(8,300,250,200,130,!0),10059:H(8,300,250,220,100,!0),9984:{width:600,draw:e=>{e.lineWidth(35),e.circle(170,370,80),e.stroke(),e.circle(170,130,80),e.stroke(),e.M(240,320),e.L(520,80),e.stroke(),e.M(240,180),e.L(520,420),e.stroke()}},9987:{width:600,draw:e=>{e.lineWidth(40),e.circle(170,370,80),e.stroke(),e.circle(170,130,80),e.stroke(),e.M(240,320),e.L(520,80),e.stroke(),e.M(240,180),e.L(520,420),e.stroke()}},9988:{width:600,draw:e=>{e.lineWidth(30),e.circle(160,350,70),e.stroke(),e.circle(160,150,70),e.stroke(),e.M(220,300),e.L(500,100),e.stroke(),e.M(220,200),e.L(500,400),e.stroke()}},9989:{width:600,draw:e=>{e.lineWidth(70),e.M(100,250),e.L(240,80),e.L(500,450),e.stroke()}},9994:{width:600,draw:e=>{e.circle(300,250,200),e.fill()}},9995:{width:600,draw:e=>{e.lineWidth(40),e.M(180,50),e.L(180,350),e.stroke(),e.M(250,50),e.L(250,400),e.stroke(),e.M(320,50),e.L(320,400),e.stroke(),e.M(390,50),e.L(390,350),e.stroke(),e.M(450,100),e.L(450,300),e.stroke()}},9996:{width:600,draw:e=>{e.lineWidth(40),e.M(220,50),e.L(250,400),e.stroke(),e.M(380,50),e.L(350,400),e.stroke()}},9997:{width:600,draw:e=>{e.lineWidth(40),e.M(120,50),e.L(460,430),e.stroke(),e.M(120,50),e.L(150,130),e.stroke()}},10001:{width:600,draw:e=>{e.lineWidth(40),e.M(140,30),e.L(460,430),e.stroke(),e.M(120,80),e.L(190,30),e.stroke()}},10002:{width:600,draw:e=>{e.M(140,30),e.L(110,80),e.L(440,470),e.L(490,470),e.L(490,430),e.L(170,30),e.Z(),e.fill()}},10009:{width:600,draw:e=>{e.lineWidth(50),e.M(300,30),e.L(300,470),e.stroke(),e.M(90,250),e.L(510,250),e.stroke()}},10011:{width:600,draw:e=>{e.lineWidth(65),e.M(300,30),e.L(300,470),e.stroke(),e.M(80,250),e.L(520,250),e.stroke()}},10015:{width:600,draw:e=>{e.lineWidth(45),e.M(300,0),e.L(300,500),e.stroke(),e.M(120,370),e.L(480,370),e.stroke()}},10017:H(6,300,250,230,115,!1),10018:H(4,300,250,220,60,!0),10019:H(4,300,250,220,80,!1),10020:H(4,300,250,200,100,!0),10021:H(4,300,250,220,40,!0),10060:{width:600,draw:e=>{e.lineWidth(70),e.M(130,60),e.L(470,440),e.stroke(),e.M(130,440),e.L(470,60),e.stroke()}},10061:{width:600,draw:e=>{e.lineWidth(50),e.circle(300,250,210),e.stroke()}},10062:{width:600,draw:e=>{e.rect(80,30,440,440),e.fill()}},10067:{width:600,draw:e=>{e.lineWidth(55),e.M(200,400),e.C(200,480,400,480,400,380),e.C(400,300,300,280,300,220),e.stroke(),e.circle(300,120,35),e.fill()}},10068:{width:600,draw:e=>{e.lineWidth(45),e.M(200,400),e.C(200,480,400,480,400,380),e.C(400,300,300,280,300,220),e.stroke(),e.circle(300,120,30),e.fill()}},10069:{width:600,draw:e=>{e.lineWidth(50),e.M(200,400),e.C(200,480,400,480,400,380),e.C(400,300,300,280,300,220),e.stroke(),e.circle(300,120,35),e.fill()}},10070:H(4,300,250,230,50,!0),10071:{width:600,draw:e=>{e.lineWidth(60),e.M(300,480),e.L(300,150),e.stroke(),e.circle(300,60,38),e.fill()}},10082:{width:600,draw:e=>{e.lineWidth(55),e.M(300,480),e.L(300,150),e.stroke(),e.circle(300,60,35),e.fill()}},10083:{width:600,draw:e=>{e.lineWidth(55),e.M(300,480),e.L(300,200),e.stroke(),e.M(300,100),e.C(300,100,200,130,200,70),e.C(200,20,300,20,300,100),e.C(300,20,400,20,400,70),e.C(400,130,300,100,300,100),e.fill()}},10084:{width:600,draw:e=>{e.M(300,80),e.C(300,80,60,220,60,350),e.C(60,470,180,500,300,500),e.C(420,500,540,470,540,350),e.C(540,220,300,80,300,80),e.Z(),e.fill()}},10085:{width:600,draw:e=>{e.lineWidth(35),e.M(300,370),e.L(300,100),e.stroke(),e.M(300,460),e.C(300,460,200,490,200,430),e.C(200,380,300,380,300,460),e.C(300,380,400,380,400,430),e.C(400,490,300,460,300,460),e.fill()}},10086:{width:600,draw:e=>{e.lineWidth(30),e.M(300,80),e.C(300,80,100,200,100,300),e.C(100,400,200,450,300,400),e.C(400,450,500,400,500,300),e.C(500,200,300,80,300,80),e.stroke()}},10087:{width:600,draw:e=>{e.lineWidth(35),e.M(300,80),e.C(300,80,80,220,80,340),e.C(80,460,200,500,300,490),e.C(400,500,520,460,520,340),e.C(520,220,300,80,300,80),e.Z(),e.stroke()}},10133:{width:600,draw:e=>{e.rect(240,50,120,400),e.fill(),e.rect(100,190,400,120),e.fill()}},10134:{width:600,draw:e=>{e.rect(100,200,400,100),e.fill()}},10135:{width:600,draw:e=>{e.lineWidth(50),e.M(120,50),e.L(480,450),e.stroke(),e.circle(200,370,35),e.fill(),e.circle(400,130,35),e.fill()}}};function XS(e,t,n,r,i){let a=Math.sqrt(e*e+t*t),o=e/a,s=t/a,c=-s,l=o,u=300+o*220,d=250+s*220,f=300-o*220,p=250-s*220,m=u-o*r,h=d-s*r;return{width:600,draw:e=>{e.M(f-c*i,p-l*i),e.L(m-c*i,h-l*i),e.L(m-c*n,h-l*n),e.L(u,d),e.L(m+c*n,h+l*n),e.L(m+c*i,h+l*i),e.L(f+c*i,p+l*i),e.Z(),e.fill()}}}function ZS(e,t,n){let r=Math.sqrt(e*e+t*t),i=e/r,a=t/r,o=-a,s=i,c=300+i*200,l=250+a*200,u=300-i*200,d=250-a*200,f=c-i*140,p=l-a*140;return{width:600,draw:e=>{let t=n,r=-n;e.M(u+t-o*45,d+r-s*45),e.L(f+t-o*45,p+r-s*45),e.L(f+t-o*110,p+r-s*110),e.L(c+t,l+r),e.L(f+t+o*110,p+r+s*110),e.L(f+t+o*45,p+r+s*45),e.L(u+t+o*45,d+r+s*45),e.Z(),e.fill(),e.M(u-o*45,d-s*45),e.L(f-o*45,p-s*45),e.L(f-o*110,p-s*110),e.L(c,l),e.L(f+o*110,p+s*110),e.L(f+o*45,p+s*45),e.L(u+o*45,d+s*45),e.Z(),e.fill()}}}function QS(e){return{width:600,draw:t=>{let n=e>0?400:100;t.lineWidth(50),t.M(100,n),t.C(100,250,300,250,480,250),t.stroke(),t.M(480,250),t.L(400,180),t.L(400,320),t.Z(),t.fill()}}}function $S(e,t,n){return{width:600,draw:r=>{r.lineWidth(n),r.M(80,250-t),r.L(360,250-t),r.L(360,250-e),r.L(520,250),r.L(360,250+e),r.L(360,250+t),r.L(80,250+t),r.Z(),r.stroke()}}}W[10136]||=KS(1,-1),W[10137]||=XS(1,0,100,180,40),W[10138]||=XS(1,0,130,200,55),W[10139]||=XS(1,0,140,220,30),W[10140]||=XS(1,0,110,160,50),W[10141]||=XS(1,0,90,180,60),W[10142]||=XS(1,0,120,240,65),W[10143]||=XS(1,0,80,150,70),W[10144]||=XS(1,0,150,200,35),W[10146]||=ZS(1,0,15),W[10147]||=ZS(1,0,25),W[10148]||=ZS(1,0,10),W[10149]||=QS(1),W[10150]||=QS(-1),W[10151]||=$S(100,40,30),W[10152]||=XS(1,0,160,260,45),W[10153]||=$S(120,50,35),W[10154]||=XS(1,0,100,140,55),W[10155]||=ZS(1,0,20),W[10156]||=ZS(1,0,30),W[10157]||=$S(90,35,28),W[10158]||=XS(1,0,130,180,60),W[10159]||={width:600,draw:e=>{e.lineWidth(45),e.M(100,400),e.C(150,150,350,150,480,250),e.stroke(),e.M(480,250),e.L(420,180),e.L(420,320),e.Z(),e.fill()}},W[10161]||=XS(1,0,95,170,35),W[10162]||=XS(1,0,145,230,50),W[10163]||=$S(80,30,25),W[10164]||=XS(1,0,110,190,25),W[10165]||=XS(1,0,135,210,40),W[10166]||=$S(110,45,32),W[10167]||=XS(1,0,120,200,70),W[10168]||=XS(1,0,140,250,20),W[10169]||=$S(130,55,38),W[10170]||=XS(1,0,105,170,45),W[10171]||=$S(100,40,40),W[10172]||=XS(1,0,90,160,55),W[10173]||=XS(1,0,150,240,30),W[10174]||=$S(115,48,30);let G={9730:{width:600,draw:e=>{e.lineWidth(35),e.M(100,250),e.C(100,420,250,450,300,450),e.C(350,450,500,420,500,250),e.stroke(),e.M(300,250),e.L(300,80),e.C(300,30,230,30,230,80),e.stroke()}},9731:{width:600,draw:e=>{e.lineWidth(30),e.circle(300,100,80),e.stroke(),e.circle(300,250,100),e.stroke(),e.circle(300,420,70),e.stroke()}},9732:{width:600,draw:e=>{e.circle(180,250,80),e.fill(),e.lineWidth(25),e.M(260,250),e.C(350,300,450,350,530,400),e.stroke(),e.M(260,270),e.C(350,250,450,200,530,150),e.stroke()}},9748:{width:600,draw:e=>{e.lineWidth(35),e.M(100,300),e.C(100,450,300,480,300,480),e.C(300,480,500,450,500,300),e.stroke(),e.M(300,300),e.L(300,100),e.C(300,50,230,50,230,100),e.stroke(),e.lineWidth(20),e.M(200,150),e.L(180,80),e.stroke(),e.M(400,150),e.L(380,80),e.stroke()}},9749:{width:600,draw:e=>{e.lineWidth(35),e.rect(150,50,250,250),e.stroke(),e.M(400,230),e.C(470,230,470,120,400,120),e.stroke(),e.lineWidth(25),e.M(200,350),e.C(220,400,350,400,370,350),e.stroke(),e.M(250,450),e.L(320,450),e.stroke()}},9752:{width:600,draw:e=>{e.lineWidth(30),e.M(300,50),e.L(300,250),e.stroke(),e.M(300,250),e.C(200,350,100,400,150,450),e.C(200,500,300,400,300,250),e.stroke(),e.M(300,250),e.C(400,350,500,400,450,450),e.C(400,500,300,400,300,250),e.stroke(),e.M(300,250),e.C(250,300,200,250,250,200),e.C(280,170,300,250,300,250),e.stroke()}}},eC=[[9800,e=>{e.lineWidth(45),e.M(150,100),e.C(150,300,300,500,300,500),e.stroke(),e.M(450,100),e.C(450,300,300,500,300,500),e.stroke()}],[9801,e=>{e.lineWidth(45),e.circle(300,200,150),e.stroke(),e.M(150,350),e.C(150,450,300,500,300,500),e.stroke(),e.M(450,350),e.C(450,450,300,500,300,500),e.stroke()}],[9802,e=>{e.lineWidth(40),e.M(180,80),e.L(420,80),e.stroke(),e.M(180,420),e.L(420,420),e.stroke(),e.M(220,80),e.L(220,420),e.stroke(),e.M(380,80),e.L(380,420),e.stroke()}],[9803,e=>{e.lineWidth(45),e.M(180,350),e.C(180,450,300,450,300,350),e.C(300,250,180,250,180,350),e.stroke(),e.M(420,150),e.C(420,50,300,50,300,150),e.C(300,250,420,250,420,150),e.stroke()}],[9804,e=>{e.lineWidth(45),e.circle(200,380,80),e.stroke(),e.M(280,380),e.C(350,380,400,300,400,200),e.C(400,100,300,50,250,100),e.stroke()}],[9805,e=>{e.lineWidth(40),e.M(120,450),e.L(120,150),e.C(120,50,220,50,220,150),e.L(220,450),e.stroke(),e.M(220,150),e.C(220,50,320,50,320,150),e.L(320,400),e.C(320,450,380,450,400,400),e.stroke()}],[9806,e=>{e.lineWidth(45),e.M(100,250),e.L(500,250),e.stroke(),e.M(100,350),e.C(200,300,400,300,500,350),e.stroke()}],[9807,e=>{e.lineWidth(40),e.M(100,400),e.L(100,150),e.C(100,50,200,50,200,150),e.L(200,400),e.stroke(),e.M(200,150),e.C(200,50,300,50,300,150),e.L(300,400),e.stroke(),e.M(300,400),e.L(400,300),e.stroke(),e.M(370,340),e.L(400,300),e.L(430,340),e.stroke()}],[9808,e=>{e.lineWidth(50),e.M(100,100),e.L(480,400),e.stroke(),e.M(400,400),e.L(480,400),e.L(480,320),e.stroke(),e.M(100,250),e.L(350,250),e.stroke(),e.M(100,350),e.L(350,350),e.stroke()}],[9809,e=>{e.lineWidth(40),e.M(120,400),e.C(120,200,250,100,350,100),e.C(450,100,480,200,480,300),e.C(480,400,420,450,380,400),e.C(340,350,380,300,420,350),e.stroke()}],[9810,e=>{e.lineWidth(45),e.M(100,330),e.C(200,380,300,280,400,330),e.C(500,380,500,330,500,330),e.stroke(),e.M(100,200),e.C(200,250,300,150,400,200),e.C(500,250,500,200,500,200),e.stroke()}],[9811,e=>{e.lineWidth(45),e.M(150,400),e.C(150,250,300,250,300,250),e.C(300,250,450,250,450,100),e.stroke(),e.M(150,100),e.C(150,250,300,250,300,250),e.C(300,250,450,250,450,400),e.stroke(),e.M(100,250),e.L(500,250),e.stroke()}]];for(let[e,t]of eC)G[e]={width:600,draw:t};for(let[e,t,n]of[[9812,`king`,!1],[9813,`queen`,!1],[9814,`rook`,!1],[9815,`bishop`,!1],[9816,`knight`,!1],[9817,`pawn`,!1],[9818,`king`,!0],[9819,`queen`,!0],[9820,`rook`,!0],[9821,`bishop`,!0],[9822,`knight`,!0],[9823,`pawn`,!0]])G[e]=JS(t,n);G[9825]={width:600,draw:e=>{e.lineWidth(35),e.M(300,60),e.C(300,60,80,200,80,320),e.C(80,440,180,480,300,480),e.C(420,480,520,440,520,320),e.C(520,200,300,60,300,60),e.Z(),e.stroke()}},G[9826]={width:600,draw:e=>{e.lineWidth(35),e.M(300,480),e.L(500,250),e.L(300,20),e.L(100,250),e.Z(),e.stroke()}},G[9828]={width:600,draw:e=>{e.lineWidth(35),e.M(300,490),e.C(300,490,50,340,70,200),e.C(80,100,180,60,300,200),e.C(420,60,520,100,530,200),e.C(550,340,300,490,300,490),e.Z(),e.stroke(),e.rect(260,20,80,160),e.stroke()}},G[9831]={width:600,draw:e=>{e.lineWidth(30),e.circle(300,370,100),e.stroke(),e.circle(195,230,90),e.stroke(),e.circle(405,230,90),e.stroke(),e.rect(275,20,50,180),e.stroke()}};for(let e=1;e<=6;e++)G[9855+e]=qS(e);G[9851]={width:600,draw:e=>{e.lineWidth(40),e.M(300,450),e.L(150,180),e.stroke(),e.M(150,180),e.L(450,180),e.stroke(),e.M(450,180),e.L(300,450),e.stroke(),e.M(270,430),e.L(300,480),e.L(330,430),e.stroke(),e.M(170,220),e.L(130,190),e.L(160,150),e.stroke(),e.M(430,220),e.L(470,190),e.L(440,150),e.stroke()}},G[9855]={width:600,draw:e=>{e.lineWidth(40),e.circle(280,200,130),e.stroke(),e.circle(280,400,40),e.fill(),e.M(280,360),e.L(280,250),e.L(380,250),e.stroke(),e.M(380,250),e.L(420,130),e.stroke()}},G[9735]={width:600,draw:e=>{e.lineWidth(45),e.M(350,480),e.L(220,310),e.L(370,280),e.L(250,60),e.stroke()}},G[9736]={width:600,draw:e=>{e.lineWidth(30),e.M(120,280),e.C(120,400,200,430,300,430),e.C(400,430,480,400,480,280),e.C(480,200,400,170,350,200),e.C(340,140,280,130,230,170),e.C(180,150,120,200,120,280),e.stroke(),e.lineWidth(35),e.M(330,430),e.L(270,350),e.L(340,330),e.L(280,250),e.stroke()}},G[9737]={width:600,draw:e=>{e.lineWidth(30),e.circle(300,250,120),e.stroke();for(let t=0;t<8;t++){let n=t*Math.PI/4;e.M(300+150*Math.cos(n),250+150*Math.sin(n)),e.L(300+200*Math.cos(n),250+200*Math.sin(n))}e.stroke()}},G[9738]={width:600,draw:e=>{e.lineWidth(35),e.circle(300,250,140),e.stroke(),e.M(140,370),e.L(460,130),e.stroke()}},G[9739]={width:600,draw:e=>{e.lineWidth(35),e.circle(300,250,140),e.stroke(),e.M(140,130),e.L(460,370),e.stroke()}},G[9740]={width:600,draw:e=>{e.lineWidth(35),e.circle(300,250,130),e.stroke(),e.M(120,250),e.L(480,250),e.stroke()}},G[9741]={width:600,draw:e=>{e.lineWidth(35),e.circle(300,250,130),e.stroke(),e.M(300,70),e.L(300,430),e.stroke()}},G[9743]={width:600,draw:e=>{e.lineWidth(30),e.M(150,80),e.C(120,200,120,350,180,430),e.C(250,480,350,480,420,430),e.C(480,350,480,200,450,80),e.C(430,30,370,50,370,120),e.C(370,180,340,200,300,200),e.C(260,200,230,180,230,120),e.C(230,50,170,30,150,80),e.Z(),e.stroke()}},G[9750]={width:600,draw:e=>{e.lineWidth(35),e.circle(300,250,150),e.stroke(),e.M(300,100),e.L(300,400),e.stroke(),e.M(150,250),e.L(450,250),e.stroke()}},G[9751]={width:600,draw:e=>{e.lineWidth(30),e.circle(300,250,150),e.stroke(),e.M(300,100),e.L(300,400),e.stroke(),e.M(150,200),e.L(450,200),e.stroke(),e.M(150,300),e.L(450,300),e.stroke()}},G[9753]={width:600,draw:e=>{e.M(300,100),e.C(300,100,100,220,100,330),e.C(100,440,190,480,300,480),e.C(410,480,500,440,500,330),e.C(500,220,300,100,300,100),e.Z(),e.fill()}},G[9754]={width:600,draw:e=>{e.rect(120,100,360,300),e.fill(),e.M(120,250),e.L(60,200),e.L(60,300),e.Z(),e.fill()}},G[9755]={width:600,draw:e=>{e.rect(120,100,360,300),e.fill(),e.M(480,250),e.L(540,200),e.L(540,300),e.Z(),e.fill()}},G[9756]={width:600,draw:e=>{e.lineWidth(35),e.rect(120,100,360,300),e.stroke(),e.M(120,250),e.L(60,200),e.L(60,300),e.Z(),e.stroke()}},G[9757]={width:600,draw:e=>{e.lineWidth(35),e.rect(150,100,300,320),e.stroke(),e.M(300,420),e.L(250,480),e.L(350,480),e.Z(),e.stroke()}},G[9758]={width:600,draw:e=>{e.lineWidth(35),e.rect(120,100,360,300),e.stroke(),e.M(480,250),e.L(540,200),e.L(540,300),e.Z(),e.stroke()}},G[9759]={width:600,draw:e=>{e.lineWidth(35),e.rect(150,100,300,320),e.stroke(),e.M(300,100),e.L(250,40),e.L(350,40),e.Z(),e.stroke()}},G[9760]={width:600,draw:e=>{e.lineWidth(30),e.circle(300,320,130),e.stroke(),e.M(180,220),e.L(420,60),e.stroke(),e.M(420,220),e.L(180,60),e.stroke()}},G[9761]={width:600,draw:e=>{e.lineWidth(35),e.M(300,450),e.L(80,50),e.L(520,50),e.Z(),e.stroke(),e.lineWidth(30),e.M(300,350),e.L(300,200),e.stroke(),e.circle(300,140,20),e.fill()}},G[9762]={width:600,draw:e=>{e.circle(300,250,40),e.fill(),e.lineWidth(25);for(let t=0;t<3;t++){let n=(t*120-90)*Math.PI/180,r=n-.4,i=n+.4;e.M(300+60*Math.cos(r),250+60*Math.sin(r)),e.L(300+190*Math.cos(r),250+190*Math.sin(r)),e.C(300+200*Math.cos(n),250+200*Math.sin(n),300+200*Math.cos(n),250+200*Math.sin(n),300+190*Math.cos(i),250+190*Math.sin(i)),e.L(300+60*Math.cos(i),250+60*Math.sin(i)),e.Z(),e.fill()}}},G[9763]={width:600,draw:e=>{e.lineWidth(25),e.circle(300,250,30),e.stroke();for(let t=0;t<3;t++){let n=(t*120-90)*Math.PI/180,r=300+110*Math.cos(n),i=250+110*Math.sin(n);e.circle(r,i,80),e.stroke()}}},G[9764]={width:600,draw:e=>{e.lineWidth(30),e.M(300,50),e.L(300,450),e.stroke(),e.M(200,400),e.C(200,330,400,280,400,210),e.stroke(),e.M(400,400),e.C(400,330,200,280,200,210),e.stroke(),e.M(300,400),e.L(200,440),e.stroke(),e.M(300,400),e.L(400,440),e.stroke()}},G[9765]={width:600,draw:e=>{e.lineWidth(40),e.M(300,50),e.L(300,270),e.stroke(),e.M(180,270),e.L(420,270),e.stroke(),e.ellipse(300,380,80,100),e.stroke()}},G[9766]={width:600,draw:e=>{e.lineWidth(35),e.M(300,50),e.L(300,460),e.stroke(),e.M(170,350),e.L(430,350),e.stroke(),e.M(200,420),e.L(400,420),e.stroke(),e.M(220,210),e.L(380,170),e.stroke()}},G[9767]={width:600,draw:e=>{e.lineWidth(35),e.M(140,100),e.L(460,420),e.stroke(),e.M(460,100),e.L(140,420),e.stroke(),e.M(300,420),e.L(300,480),e.stroke(),e.M(370,360),e.C(430,400,430,460,370,480),e.stroke()}},G[9768]={width:600,draw:e=>{e.lineWidth(35),e.M(300,50),e.L(300,460),e.stroke(),e.M(170,310),e.L(430,310),e.stroke(),e.M(200,180),e.L(400,180),e.stroke()}},G[9769]={width:600,draw:e=>{e.lineWidth(30),e.M(300,50),e.L(300,450),e.stroke(),e.M(100,250),e.L(500,250),e.stroke(),e.lineWidth(15);for(let[t,n]of[[190,350],[410,350],[190,150],[410,150]])e.M(t,n-35),e.L(t,n+35),e.stroke(),e.M(t-35,n),e.L(t+35,n),e.stroke()}},G[9770]={width:600,draw:e=>{e.lineWidth(30),e.circle(280,250,170),e.stroke(),e.M(370,250),e.circle(350,250,140),e.stroke(),H(5,440,380,50,20,!0).draw(e)}},G[9771]={width:600,draw:e=>{e.lineWidth(35),e.rect(120,70,360,360),e.stroke(),e.circle(300,250,40),e.fill()}},G[9772]={width:600,draw:e=>{e.lineWidth(30),e.M(300,50),e.L(300,450),e.stroke(),e.circle(300,250,130),e.stroke(),e.M(150,200),e.C(180,350,420,350,450,200),e.stroke()}},G[9773]={width:600,draw:e=>{e.lineWidth(35),e.M(350,80),e.L(200,430),e.stroke(),e.M(140,120),e.L(250,120),e.stroke(),e.M(350,400),e.C(450,350,500,250,430,150),e.C(380,80,300,100,280,180),e.stroke()}};for(let[e,t,n,r]of[[9776,!0,!0,!0],[9777,!0,!0,!1],[9778,!0,!1,!0],[9779,!0,!1,!1],[9780,!1,!0,!0],[9781,!1,!0,!1],[9782,!1,!1,!0],[9783,!1,!1,!1]])G[e]={width:600,draw:e=>{e.lineWidth(40);let i=[t,n,r],a=[380,250,120];for(let t=0;t<3;t++)i[t]?(e.M(120,a[t]),e.L(480,a[t]),e.stroke()):(e.M(120,a[t]),e.L(260,a[t]),e.stroke(),e.M(340,a[t]),e.L(480,a[t]),e.stroke())}};G[9788]={width:600,draw:e=>{e.lineWidth(25),e.circle(300,250,90),e.stroke();for(let t=0;t<12;t++){let n=t*Math.PI/6;e.M(300+110*Math.cos(n),250+110*Math.sin(n)),e.L(300+160*Math.cos(n),250+160*Math.sin(n))}e.stroke()}},G[9789]={width:600,draw:e=>{e.lineWidth(30),e.circle(300,250,180),e.stroke(),e.M(300,70),e.C(180,70,120,150,120,250),e.C(120,350,180,430,300,430),e.Z(),e.fill()}},G[9790]={width:600,draw:e=>{e.lineWidth(30),e.circle(300,250,180),e.stroke(),e.M(300,70),e.C(420,70,480,150,480,250),e.C(480,350,420,430,300,430),e.Z(),e.fill()}},G[9791]={width:600,draw:e=>{e.lineWidth(30),e.circle(300,270,100),e.stroke(),e.M(300,170),e.L(300,70),e.stroke(),e.M(250,120),e.L(350,120),e.stroke(),e.M(230,420),e.C(230,480,300,480,300,430),e.stroke(),e.M(370,420),e.C(370,480,300,480,300,430),e.stroke()}},G[9793]={width:600,draw:e=>{e.lineWidth(35),e.circle(300,250,170),e.stroke(),e.M(300,80),e.L(300,420),e.stroke(),e.M(130,250),e.L(470,250),e.stroke()}},G[9795]={width:600,draw:e=>{e.lineWidth(40),e.M(380,80),e.L(380,460),e.stroke(),e.M(150,280),e.L(480,280),e.stroke(),e.M(380,280),e.L(150,450),e.stroke()}},G[9796]={width:600,draw:e=>{e.lineWidth(35),e.M(230,460),e.L(230,100),e.stroke(),e.M(230,280),e.C(300,250,370,250,370,310),e.C(370,370,330,400,280,400),e.stroke(),e.M(170,460),e.L(290,460),e.stroke()}},G[9797]={width:600,draw:e=>{e.lineWidth(30),e.circle(300,200,100),e.stroke(),e.circle(300,200,20),e.fill(),e.M(300,300),e.L(300,460),e.stroke(),e.M(260,430),e.L(300,460),e.L(340,430),e.stroke()}},G[9798]={width:600,draw:e=>{e.lineWidth(35),e.M(300,80),e.L(300,460),e.stroke(),e.M(200,460),e.L(400,460),e.stroke(),e.M(180,350),e.L(180,460),e.stroke(),e.M(300,350),e.L(300,460),e.stroke(),e.M(420,350),e.L(420,460),e.stroke(),e.M(180,350),e.L(420,350),e.stroke()}},G[9799]={width:600,draw:e=>{e.lineWidth(30),e.circle(300,290,90),e.stroke(),e.M(210,290),e.C(210,430,390,430,390,290),e.stroke(),e.M(300,200),e.L(300,80),e.stroke(),e.M(250,140),e.L(350,140),e.stroke()}},G[9832]={width:600,draw:e=>{e.lineWidth(30),e.M(120,200),e.C(120,80,480,80,480,200),e.stroke(),e.lineWidth(25);for(let t of[200,300,400])e.M(t,220),e.C(t-30,280,t+30,340,t,400),e.stroke()}},G[9835]={width:600,draw:e=>{e.lineWidth(30),e.M(200,80),e.L(200,400),e.stroke(),e.M(400,80),e.L(400,350),e.stroke(),e.lineWidth(45),e.M(200,400),e.L(400,400),e.stroke(),e.ellipse(200,120,50,40),e.fill(),e.ellipse(400,120,50,40),e.fill()}},G[9836]={width:600,draw:e=>{e.lineWidth(25),e.M(200,80),e.L(200,400),e.stroke(),e.M(400,80),e.L(400,350),e.stroke(),e.lineWidth(35),e.M(200,400),e.L(400,400),e.stroke(),e.M(200,340),e.L(400,340),e.stroke(),e.ellipse(200,120,45,35),e.fill(),e.ellipse(400,120,45,35),e.fill()}},G[9838]={width:600,draw:e=>{e.lineWidth(30),e.M(220,50),e.L(220,400),e.stroke(),e.M(380,100),e.L(380,450),e.stroke(),e.lineWidth(35),e.M(220,200),e.L(380,250),e.stroke(),e.M(220,300),e.L(380,350),e.stroke()}},G[9840]={width:600,draw:e=>{e.lineWidth(30),e.M(300,50),e.L(300,450),e.stroke(),e.M(120,280),e.L(480,280),e.stroke(),e.circle(300,50,20),e.fill(),e.circle(300,450,20),e.fill(),e.circle(120,280,20),e.fill(),e.circle(480,280,20),e.fill()}},G[9841]={width:600,draw:e=>{e.lineWidth(35),e.M(300,50),e.L(300,450),e.stroke(),e.M(120,280),e.L(480,280),e.stroke(),e.M(280,50),e.L(320,50),e.stroke(),e.M(280,450),e.L(320,450),e.stroke(),e.M(120,260),e.L(120,300),e.stroke(),e.M(480,260),e.L(480,300),e.stroke()}};for(let e=0;e<=8;e++){let t=9842+e,n=e<=6?e+1:0;G[t]={width:600,draw:e=>{e.lineWidth(30),e.M(300,420),e.L(130,130),e.stroke(),e.M(130,130),e.L(470,130),e.stroke(),e.M(470,130),e.L(300,420),e.stroke(),e.M(270,400),e.L(300,440),e.L(330,400),e.stroke(),e.M(155,165),e.L(115,140),e.L(150,110),e.stroke(),e.M(445,165),e.L(485,140),e.L(450,110),e.stroke(),n>0&&(e.lineWidth(25),e.M(280,220),e.L(320,220),e.stroke(),e.M(300,200),e.L(300,280),e.stroke())}}}G[9852]={width:600,draw:e=>{e.lineWidth(35),e.M(300,430),e.L(120,120),e.L(480,120),e.Z(),e.stroke(),e.M(270,410),e.L(300,450),e.L(330,410),e.stroke()}},G[9853]={width:600,draw:e=>{e.lineWidth(30),e.M(300,430),e.L(210,260),e.stroke(),e.M(170,190),e.L(120,120),e.L(270,120),e.stroke(),e.M(350,120),e.L(480,120),e.L(390,260),e.stroke(),e.M(360,330),e.L(300,430),e.stroke()}},G[9854]={width:600,draw:e=>{e.lineWidth(30),e.circle(300,250,190),e.stroke(),e.M(300,250),e.C(350,340,450,340,450,250),e.C(450,160,350,160,300,250),e.C(250,340,150,340,150,250),e.C(150,160,250,160,300,250),e.stroke()}},G[9862]={width:600,draw:e=>{e.lineWidth(50),e.M(120,250),e.L(480,250),e.stroke()}},G[9863]={width:600,draw:e=>{e.lineWidth(50),e.M(120,250),e.L(260,250),e.stroke(),e.M(340,250),e.L(480,250),e.stroke()}},G[9864]={width:600,draw:e=>{e.lineWidth(45),e.M(120,320),e.L(480,320),e.stroke(),e.M(120,180),e.L(480,180),e.stroke()}},G[9865]={width:600,draw:e=>{e.lineWidth(45),e.M(120,320),e.L(480,320),e.stroke(),e.M(120,180),e.L(260,180),e.stroke(),e.M(340,180),e.L(480,180),e.stroke()}};for(let[e,t,n]of[[9866,!0,!0],[9867,!1,!1],[9868,!0,!1],[9869,!1,!0],[9870,!0,!0],[9871,!1,!1]])G[e]={width:600,draw:e=>{e.lineWidth(45);let r=[320,180],i=[t,n];for(let t=0;t<2;t++)i[t]?(e.M(120,r[t]),e.L(480,r[t]),e.stroke()):(e.M(120,r[t]),e.L(260,r[t]),e.stroke(),e.M(340,r[t]),e.L(480,r[t]),e.stroke())}};G[9880]={width:600,draw:e=>{e.lineWidth(25),e.circle(300,250,30),e.fill();for(let t=0;t<5;t++){let n=(t*72-90)*Math.PI/180;e.circle(300+80*Math.cos(n),250+80*Math.sin(n),50),e.stroke()}}},G[9882]={width:600,draw:e=>{e.lineWidth(35),e.M(300,80),e.L(300,450),e.stroke(),e.M(180,350),e.L(300,400),e.L(420,350),e.stroke(),e.M(200,300),e.L(300,350),e.L(400,300),e.stroke()}},G[9885]=H(5,300,250,200,80,!1),G[9886]={width:600,draw:e=>{e.lineWidth(30),e.M(450,250),e.L(100,100),e.stroke(),e.M(450,250),e.L(100,250),e.stroke(),e.M(450,250),e.L(100,400),e.stroke()}},G[9887]={width:600,draw:e=>{e.lineWidth(28),e.M(450,250),e.L(100,80),e.stroke(),e.M(450,250),e.L(100,190),e.stroke(),e.M(450,250),e.L(100,310),e.stroke(),e.M(450,250),e.L(100,420),e.stroke()}},G[9890]={width:600,draw:e=>{e.lineWidth(28),e.circle(220,290,90),e.stroke(),e.M(220,200),e.L(220,100),e.stroke(),e.M(180,140),e.L(260,140),e.stroke(),e.circle(380,290,90),e.stroke(),e.M(380,200),e.L(380,100),e.stroke(),e.M(340,140),e.L(420,140),e.stroke()}},G[9891]={width:600,draw:e=>{e.lineWidth(28),e.circle(230,250,90),e.stroke(),e.M(295,185),e.L(400,80),e.stroke(),e.M(350,80),e.L(400,80),e.L(400,130),e.stroke(),e.circle(370,250,90),e.stroke(),e.M(435,185),e.L(510,110),e.stroke(),e.M(460,110),e.L(510,110),e.L(510,160),e.stroke()}},G[9892]={width:600,draw:e=>{e.lineWidth(28),e.circle(250,270,100),e.stroke(),e.M(250,170),e.L(250,70),e.stroke(),e.M(210,120),e.L(290,120),e.stroke(),e.M(320,200),e.L(440,80),e.stroke(),e.M(390,80),e.L(440,80),e.L(440,130),e.stroke()}},G[9894]={width:600,draw:e=>{e.lineWidth(30),e.circle(250,260,110),e.stroke(),e.M(330,185),e.L(450,80),e.stroke(),e.M(395,80),e.L(450,80),e.L(450,135),e.stroke(),e.M(350,160),e.L(420,200),e.stroke()}},G[9896]={width:600,draw:e=>{e.lineWidth(30),e.circle(300,220,110),e.stroke(),e.M(300,330),e.L(300,460),e.stroke(),e.M(260,420),e.L(300,460),e.L(340,420),e.stroke(),e.M(340,370),e.L(410,390),e.stroke()}},G[9897]={width:600,draw:e=>{e.lineWidth(30),e.circle(260,250,110),e.stroke(),e.M(370,250),e.L(500,250),e.stroke(),e.M(460,210),e.L(500,250),e.L(460,290),e.stroke(),e.M(420,290),e.L(440,350),e.stroke()}},G[9900]={width:600,draw:e=>{e.lineWidth(30),e.circle(300,250,120),e.stroke()}},G[9901]={width:600,draw:e=>{e.lineWidth(30),e.circle(230,250,110),e.stroke(),e.circle(370,250,110),e.stroke()}},G[9902]={width:600,draw:e=>{e.lineWidth(30),e.circle(190,250,90),e.stroke(),e.circle(410,250,90),e.stroke(),e.lineWidth(25),e.M(300,150),e.L(300,350),e.stroke()}},G[9903]={width:600,draw:e=>{e.lineWidth(30),e.circle(230,250,100),e.stroke(),e.circle(370,250,100),e.stroke(),e.M(300,120),e.L(300,380),e.stroke()}},G[9905]={width:600,draw:e=>{e.lineWidth(30),e.M(180,100),e.L(180,350),e.C(180,430,300,450,300,450),e.C(300,450,420,430,420,350),e.L(420,100),e.Z(),e.stroke(),e.M(250,100),e.C(250,60,350,60,350,100),e.stroke()}},G[9906]={width:600,draw:e=>{e.lineWidth(30),e.circle(300,280,120),e.stroke(),e.M(300,160),e.L(300,60),e.stroke(),e.M(250,110),e.L(350,110),e.stroke()}},G[9907]={width:600,draw:e=>{e.lineWidth(30),e.M(300,80),e.L(300,320),e.stroke(),e.M(200,180),e.L(400,180),e.stroke(),e.M(220,320),e.C(220,440,380,440,380,320),e.stroke()}},G[9908]={width:600,draw:e=>{e.lineWidth(28),e.M(300,100),e.L(300,280),e.stroke(),e.M(230,190),e.L(370,190),e.stroke(),e.M(300,280),e.L(380,370),e.L(300,460),e.L(220,370),e.Z(),e.stroke()}},G[9909]={width:600,draw:e=>{e.lineWidth(28),e.M(300,80),e.L(300,250),e.stroke(),e.M(230,160),e.L(370,160),e.stroke(),H(5,300,370,80,32,!1).draw(e)}},G[9910]={width:600,draw:e=>{e.lineWidth(35),e.M(180,450),e.L(300,200),e.L(420,450),e.stroke(),e.M(180,120),e.L(420,120),e.stroke()}},G[9911]={width:600,draw:e=>{e.lineWidth(28),e.circle(300,200,100),e.stroke(),e.M(300,300),e.L(300,80),e.stroke(),e.M(300,200),e.L(400,300),e.stroke(),e.M(300,200),e.L(400,100),e.stroke()}},G[9912]={width:600,draw:e=>{e.lineWidth(28),e.M(300,80),e.L(300,250),e.stroke(),e.M(240,160),e.L(360,160),e.stroke(),e.M(220,350),e.C(220,450,380,450,380,350),e.C(380,290,320,270,300,310),e.C(280,270,220,290,220,350),e.stroke()}},G[9913]={width:600,draw:e=>{e.lineWidth(28),H(6,300,250,180,100,!1).draw(e)}},G[9914]={width:600,draw:e=>{e.lineWidth(35),e.M(150,400),e.L(300,150),e.L(450,400),e.stroke()}},G[9915]={width:600,draw:e=>{e.lineWidth(25),e.rect(120,80,360,340),e.stroke(),e.circle(200,160,25),e.fill(),e.circle(400,160,25),e.fill(),e.circle(300,250,25),e.fill(),e.circle(200,340,25),e.fill(),e.circle(400,340,25),e.fill()}},G[9916]={width:600,draw:e=>{e.lineWidth(30),e.rect(130,80,340,340),e.stroke(),e.M(130,80),e.L(470,420),e.stroke()}},G[9919]={width:600,draw:e=>{e.lineWidth(28),e.rect(100,70,400,360),e.stroke(),e.circle(240,250,60),e.stroke(),e.M(300,250),e.L(440,250),e.stroke(),e.M(400,250),e.L(400,210),e.stroke(),e.M(430,250),e.L(430,210),e.stroke()}},G[9920]={width:600,draw:e=>{e.lineWidth(30),e.circle(300,250,160),e.stroke(),e.circle(300,250,80),e.stroke()}},G[9921]={width:600,draw:e=>{e.lineWidth(28),e.circle(300,230,140),e.stroke(),e.circle(300,230,70),e.stroke(),e.M(220,400),e.L(260,370),e.L(300,400),e.L(340,370),e.L(380,400),e.stroke()}},G[9922]={width:600,draw:e=>{e.circle(300,250,160),e.fill()}},G[9923]={width:600,draw:e=>{e.circle(300,230,150),e.fill(),e.lineWidth(30),e.M(200,410),e.L(240,380),e.L(300,420),e.L(360,380),e.L(400,410),e.stroke()}},G[9926]={width:600,draw:e=>{e.lineWidth(30);for(let t of[200,300,400])e.M(t,400),e.C(t-40,300,t,200,t,200),e.C(t,200,t+40,300,t,400),e.Z(),e.stroke()}},G[9927]={width:600,draw:e=>{e.circle(300,130,70),e.fill(),e.circle(300,290,95),e.fill(),e.circle(300,430,60),e.fill()}},G[9928]={width:600,draw:e=>{e.lineWidth(25),e.M(100,280),e.C(100,400,250,420,300,420),e.C(350,420,500,400,500,280),e.C(500,200,400,170,350,200),e.C(340,140,280,130,230,170),e.C(180,150,100,200,100,280),e.stroke(),e.lineWidth(20),e.M(220,150),e.L(200,80),e.stroke(),e.M(380,150),e.L(360,80),e.stroke(),e.M(300,420),e.L(260,340),e.L(320,320),e.L(280,250),e.stroke()}},G[9929]={width:600,draw:e=>{e.lineWidth(30),e.M(200,420),e.L(300,100),e.L(400,420),e.Z(),e.stroke()}},G[9930]={width:600,draw:e=>{e.M(200,420),e.L(300,100),e.L(400,420),e.Z(),e.fill()}},G[9931]={width:600,draw:e=>{e.lineWidth(28),e.rect(100,50,400,400),e.stroke(),e.M(300,100),e.L(450,250),e.L(300,400),e.L(150,250),e.Z(),e.stroke()}},G[9932]={width:600,draw:e=>{e.lineWidth(50),e.M(100,80),e.L(500,420),e.stroke(),e.M(500,80),e.L(100,420),e.stroke()}},G[9933]={width:600,draw:e=>{e.lineWidth(28),e.rect(100,150,400,200),e.stroke(),e.circle(200,360,40),e.stroke(),e.circle(400,360,40),e.stroke(),e.M(200,200),e.L(400,300),e.stroke(),e.M(400,200),e.L(200,300),e.stroke()}},G[9935]={width:600,draw:e=>{e.lineWidth(35),e.M(150,100),e.L(450,400),e.stroke(),e.M(200,100),e.C(320,100,400,180,400,250),e.stroke()}},G[9936]={width:600,draw:e=>{e.lineWidth(28),e.rect(150,150,300,160),e.stroke(),e.circle(220,320,35),e.stroke(),e.circle(380,320,35),e.stroke(),e.M(120,400),e.C(200,370,350,430,480,400),e.stroke()}},G[9937]={width:600,draw:e=>{e.lineWidth(30),e.M(120,200),e.C(120,400,300,450,300,450),e.C(300,450,480,400,480,200),e.stroke(),e.M(300,200),e.L(300,400),e.stroke(),e.M(200,300),e.L(400,300),e.stroke()}},G[9938]={width:600,draw:e=>{e.lineWidth(30),e.circle(300,250,180),e.stroke(),e.M(160,120),e.L(440,380),e.stroke(),e.M(440,120),e.L(160,380),e.stroke()}},G[9939]={width:600,draw:e=>{e.lineWidth(30),e.ellipse(230,250,100,140),e.stroke(),e.ellipse(370,250,100,140),e.stroke()}},G[9941]={width:600,draw:e=>{e.lineWidth(35),e.M(480,250),e.L(120,250),e.stroke(),e.M(120,250),e.L(220,170),e.L(220,330),e.Z(),e.fill()}},G[9942]={width:600,draw:e=>{e.lineWidth(35),e.circle(300,250,180),e.stroke(),e.M(140,250),e.L(460,250),e.stroke()}},G[9943]={width:600,draw:e=>{e.lineWidth(28),e.rect(120,80,360,340),e.stroke(),e.circle(300,250,50),e.fill()}},G[9944]={width:600,draw:e=>{e.lineWidth(35),e.M(400,80),e.L(200,250),e.L(400,420),e.stroke(),e.M(200,250),e.L(480,250),e.stroke()}},G[9945]={width:600,draw:e=>{e.lineWidth(35),e.M(200,80),e.L(400,250),e.L(200,420),e.stroke(),e.M(400,250),e.L(120,250),e.stroke()}},G[9946]={width:600,draw:e=>{e.lineWidth(30),e.circle(300,250,180),e.stroke(),e.M(220,350),e.C(220,300,380,250,380,200),e.C(380,150,220,150,220,200),e.stroke()}},G[9947]={width:600,draw:e=>{e.lineWidth(40),e.M(120,400),e.L(480,400),e.L(300,100),e.Z(),e.stroke()}},G[9948]={width:600,draw:e=>{e.lineWidth(35),e.M(120,100),e.L(120,400),e.stroke(),e.M(120,250),e.L(480,250),e.stroke(),e.M(480,250),e.L(380,180),e.stroke(),e.M(480,250),e.L(380,320),e.stroke()}},G[9949]={width:600,draw:e=>{e.lineWidth(30),e.rect(100,60,400,380),e.stroke(),e.M(100,60),e.L(500,440),e.stroke(),e.M(500,60),e.L(100,440),e.stroke()}},G[9950]={width:600,draw:e=>{e.rect(80,40,440,420),e.fill()}},G[9951]={width:600,draw:e=>{e.M(100,350),e.L(100,180),e.L(350,180),e.L(350,130),e.L(500,130),e.L(500,350),e.Z(),e.fill(),e.lineWidth(25),e.circle(180,370,35),e.stroke(),e.circle(420,370,35),e.stroke()}},G[9952]={width:600,draw:e=>{e.lineWidth(28),e.M(300,450),e.L(500,250),e.L(300,50),e.L(100,250),e.Z(),e.stroke(),e.M(300,450),e.L(300,50),e.L(100,250),e.Z(),e.fill()}},G[9953]={width:600,draw:e=>{e.lineWidth(28),e.M(300,450),e.L(500,250),e.L(300,50),e.L(100,250),e.Z(),e.stroke(),e.M(300,450),e.L(300,50),e.L(500,250),e.Z(),e.fill()}},G[9954]={width:600,draw:e=>{e.M(300,450),e.L(500,250),e.L(300,50),e.L(100,250),e.Z(),e.fill(),e.lineWidth(25),e.M(300,450),e.L(260,400),e.stroke(),e.M(300,450),e.L(340,400),e.stroke()}},G[9955]={width:600,draw:e=>{e.lineWidth(35),e.circle(300,280,140),e.stroke(),e.M(190,170),e.L(410,390),e.stroke(),e.circle(230,120,20),e.fill(),e.circle(370,120,20),e.fill()}},G[9956]={width:600,draw:e=>{e.lineWidth(28),e.circle(300,250,180),e.stroke(),H(5,300,250,170,65,!1).draw(e)}},G[9957]={width:600,draw:e=>{e.lineWidth(30),H(5,300,250,190,75,!1).draw(e)}},G[9958]={width:600,draw:e=>{e.lineWidth(30),H(5,300,250,190,75,!0).draw(e)}},G[9959]={width:600,draw:e=>{e.lineWidth(28);for(let t=0;t<5;t++){let n=(t*360/5+90)*Math.PI/180,r=(t*360/5+126)*Math.PI/180;t===0?e.M(300+190*Math.cos(n),250+190*Math.sin(n)):e.L(300+190*Math.cos(n),250+190*Math.sin(n)),e.L(300+75*Math.cos(r),250+75*Math.sin(r))}e.Z(),e.stroke()}},G[9960]={width:600,draw:e=>{e.lineWidth(28),e.M(150,420),e.L(150,200),e.L(300,100),e.L(450,200),e.L(450,420),e.Z(),e.stroke(),e.lineWidth(40),e.M(300,180),e.L(300,380),e.stroke(),e.M(210,280),e.L(390,280),e.stroke()}},G[9961]={width:600,draw:e=>{e.lineWidth(35),e.M(140,100),e.L(140,420),e.stroke(),e.M(460,100),e.L(460,420),e.stroke(),e.M(100,400),e.L(500,400),e.stroke(),e.M(120,320),e.L(480,320),e.stroke()}},G[9963]={width:600,draw:e=>{e.lineWidth(28),e.rect(120,100,360,300),e.stroke();for(let t=120;t<480;t+=72)e.rect(t,400,36,50),e.stroke()}},G[9964]={width:600,draw:e=>{e.lineWidth(30),e.M(200,100),e.L(200,400),e.stroke(),e.M(300,100),e.L(300,400),e.stroke(),e.M(400,100),e.L(400,400),e.stroke(),e.M(140,100),e.L(460,100),e.stroke(),e.M(140,400),e.L(460,400),e.stroke(),e.M(140,400),e.L(300,470),e.L(460,400),e.stroke()}},G[9965]={width:600,draw:e=>{e.lineWidth(35),e.circle(300,250,150),e.stroke();for(let t=0;t<8;t++){let n=t*Math.PI/4;e.M(300+150*Math.cos(n),250+150*Math.sin(n)),e.L(300+190*Math.cos(n),250+190*Math.sin(n))}e.stroke()}},G[9966]={width:600,draw:e=>{e.lineWidth(30),e.circle(300,250,120),e.stroke(),e.circle(300,250,30),e.fill(),e.M(300,130),e.L(300,80),e.stroke(),e.M(300,370),e.L(300,420),e.stroke()}},G[9967]={width:600,draw:e=>{e.lineWidth(30),e.M(200,100),e.L(250,380),e.L(350,380),e.L(400,100),e.Z(),e.stroke(),e.M(300,380),e.L(300,460),e.stroke(),e.M(200,430),e.L(400,430),e.stroke()}},G[9968]={width:600,draw:e=>{e.lineWidth(35),e.M(80,100),e.L(250,400),e.L(350,280),e.L(520,100),e.stroke()}},G[9969]={width:600,draw:e=>{e.lineWidth(30),e.M(120,280),e.C(120,420,300,450,300,450),e.C(300,450,480,420,480,280),e.stroke(),e.M(300,280),e.L(300,100),e.stroke(),e.M(240,100),e.L(360,100),e.stroke()}},G[9972]={width:600,draw:e=>{e.lineWidth(30),e.M(100,250),e.C(100,150,200,120,300,120),e.C(400,120,500,150,500,250),e.stroke(),e.M(100,250),e.L(500,250),e.stroke(),e.M(350,120),e.L(350,300),e.stroke(),e.rect(330,300,40,80),e.stroke()}},G[9974]={width:600,draw:e=>{e.lineWidth(28),e.rect(120,80,360,340),e.stroke(),e.circle(120,80,20),e.fill(),e.circle(480,80,20),e.fill(),e.circle(120,420,20),e.fill(),e.circle(480,420,20),e.fill()}},G[9975]={width:600,draw:e=>{e.lineWidth(28),e.circle(300,420,35),e.fill(),e.M(300,385),e.L(300,240),e.stroke(),e.M(300,320),e.L(220,250),e.stroke(),e.M(300,320),e.L(380,250),e.stroke(),e.M(300,240),e.L(220,140),e.stroke(),e.M(300,240),e.L(380,140),e.stroke(),e.lineWidth(15),e.M(180,290),e.L(420,100),e.stroke()}},G[9976]={width:600,draw:e=>{e.lineWidth(30),e.M(150,350),e.L(150,200),e.L(300,150),e.L(400,200),e.L(400,350),e.Z(),e.stroke(),e.lineWidth(20),e.M(120,130),e.L(450,130),e.stroke()}},G[9977]={width:600,draw:e=>{e.lineWidth(28),e.circle(300,420,35),e.fill(),e.M(300,385),e.L(300,220),e.stroke(),e.M(300,300),e.L(220,230),e.stroke(),e.M(300,300),e.L(380,230),e.stroke(),e.M(300,220),e.L(230,120),e.stroke(),e.M(300,220),e.L(370,120),e.stroke(),e.circle(420,200,40),e.stroke()}},G[9979]={width:600,draw:e=>{e.lineWidth(30),e.circle(300,250,180),e.stroke(),e.M(150,200),e.L(450,200),e.stroke(),e.M(150,300),e.L(450,300),e.stroke()}},G[9980]={width:600,draw:e=>{e.lineWidth(30),e.M(180,100),e.L(180,350),e.C(180,430,420,430,420,350),e.L(420,100),e.Z(),e.stroke()}},G[9981]={width:600,draw:e=>{e.lineWidth(30),e.rect(130,100,240,330),e.stroke(),e.rect(170,180,160,100),e.stroke(),e.M(370,200),e.L(430,200),e.C(460,200,460,300,430,300),e.L(430,350),e.stroke(),e.M(130,100),e.L(430,100),e.stroke()}},G[9982]={width:600,draw:e=>{e.rect(80,50,440,400),e.fill()}},G[9983]={width:600,draw:e=>{e.lineWidth(28),e.M(150,450),e.L(150,80),e.L(480,80),e.L(480,320),e.L(150,320),e.stroke(),e.rect(150,170,330,80),e.fill()}};for(let e=9728;e<=9983;e++)if(!G[e]){let t=(e-9728)%7;G[e]={width:600,draw:e=>{switch(e.lineWidth(30),t){case 0:e.circle(300,250,170),e.stroke(),e.M(130,250),e.L(470,250),e.stroke();break;case 1:e.rect(120,70,360,360),e.stroke(),e.M(120,70),e.L(480,430),e.stroke();break;case 2:e.M(300,430),e.L(100,70),e.L(500,70),e.Z(),e.stroke(),e.circle(300,200,25),e.fill();break;case 3:e.M(300,450),e.L(500,250),e.L(300,50),e.L(100,250),e.Z(),e.stroke(),e.M(300,150),e.L(300,350),e.stroke(),e.M(200,250),e.L(400,250),e.stroke();break;case 4:e.circle(300,250,170),e.stroke(),e.M(300,80),e.L(300,420),e.stroke();break;case 5:e.M(300,440),e.L(470,340),e.L(470,160),e.L(300,60),e.L(130,160),e.L(130,340),e.Z(),e.stroke();break;default:e.circle(300,250,180),e.stroke(),e.circle(300,250,100),e.stroke();break}}}}let tC={};for(let[e,t,n,r]of[[11008,1,1,!0],[11009,-1,1,!0],[11010,1,1,!1],[11011,-1,1,!1],[11012,0,0,!1],[11016,1,1,!0],[11017,-1,1,!0],[11018,1,-1,!0],[11019,-1,-1,!0],[11020,0,0,!0],[11021,0,0,!0]])t===0&&n===0?tC[e]={width:600,draw:e=>{r?(e.rect(100,200,400,100),e.fill()):(e.lineWidth(40),e.M(80,250),e.L(520,250),e.stroke(),e.M(80,250),e.L(180,350),e.L(180,150),e.Z(),e.fill(),e.M(520,250),e.L(420,350),e.L(420,150),e.Z(),e.fill())}}:tC[e]=KS(t,n);for(let e=11026;e<=11039;e++){let t=e<=11033;tC[e]={width:600,draw:n=>{n.lineWidth(30),t?(n.rect(100,50,400,400),n.stroke(),(e-11026)%2==0?(n.rect(100,250,400,200),n.fill()):(n.rect(100,50,400,200),n.fill())):(n.M(300,450),n.L(500,50),n.L(100,50),n.Z(),n.stroke(),(e-11034)%2==0&&(n.M(200,50),n.L(300,250),n.L(400,50),n.Z(),n.fill()))}}}for(let e=11040;e<=11263;e++)tC[e]||(e&1?tC[e]={width:600,draw:e=>{e.lineWidth(35),e.M(300,470),e.L(500,250),e.L(300,30),e.L(100,250),e.Z(),e.stroke()}}:tC[e]=KS(1,0));let K={};for(let e=10224;e<=10239;e++)if(!K[e]){let t=e<=10228;K[e]={width:700,draw:e=>{e.lineWidth(40),t?(e.M(350,30),e.L(350,470),e.stroke(),e.M(350,470),e.L(230,350),e.L(470,350),e.Z(),e.fill()):(e.M(50,250),e.L(600,250),e.stroke(),e.M(600,250),e.L(470,370),e.L(470,130),e.Z(),e.fill())}}}function nC(e,t){let n=Math.sqrt(e*e+t*t),r=e/n,i=t/n,a=-i,o=r;return{width:600,draw:e=>{e.lineWidth(35);let t=300-r*200,n=250-i*200,s=300+r*200,c=250+i*200;e.M(t,n),e.L(s,c),e.stroke(),e.M(s,c),e.L(s-r*90+a*60,c-i*90+o*60),e.L(s-r*90-a*60,c-i*90-o*60),e.Z(),e.fill(),e.M(t+a*70,n+o*70),e.L(t-a*70,n-o*70),e.stroke()}}}function rC(e,t){let n=Math.sqrt(e*e+t*t),r=e/n,i=t/n,a=-i,o=r;return{width:600,draw:e=>{e.lineWidth(35);let t=300-r*200,n=250-i*200,s=300+r*200,c=250+i*200;e.M(t,n),e.L(s,c),e.stroke(),e.M(s,c),e.L(s-r*90+a*55,c-i*90+o*55),e.L(s-r*90-a*55,c-i*90-o*55),e.Z(),e.fill(),e.M(t,n),e.L(t+r*90+a*55,n+i*90+o*55),e.L(t+r*90-a*55,n+i*90-o*55),e.Z(),e.fill()}}}function iC(e,t){let n=Math.sqrt(e*e+t*t),r=e/n,i=t/n,a=-i,o=r;return{width:600,draw:e=>{e.lineWidth(35);let t=300-r*200,n=250-i*200,s=300+r*200,c=250+i*200;e.M(t,n),e.L(s,c),e.stroke(),e.M(s,c),e.L(s-r*90+a*55,c-i*90+o*55),e.L(s-r*90-a*55,c-i*90-o*55),e.Z(),e.fill(),e.M(300+a*60+r*30,250+o*60+i*30),e.L(300-a*60-r*30,250-o*60-i*30),e.stroke()}}}function aC(e,t,n,r){let i=Math.sqrt(e*e+t*t),a=e/i,o=t/i,s=-o,c=a,l=Math.sqrt(n*n+r*r),u=n/l,d=r/l,f=-d,p=u;return{width:600,draw:e=>{e.lineWidth(28);let t=300-a*180+s*50,n=250-o*180+c*50,r=300+a*180+s*50,i=250+o*180+c*50;e.M(t,n),e.L(r,i),e.stroke(),e.M(r,i),e.L(r-a*70+s*45,i-o*70+c*45),e.L(r-a*70-s*45,i-o*70-c*45),e.Z(),e.fill();let l=300-u*180-f*50,m=250-d*180-p*50,h=300+u*180-f*50,g=250+d*180-p*50;e.M(l,m),e.L(h,g),e.stroke(),e.M(h,g),e.L(h-u*70+f*45,g-d*70+p*45),e.L(h-u*70-f*45,g-d*70-p*45),e.Z(),e.fill()}}}function oC(e,t){let n=Math.sqrt(e*e+t*t),r=e/n,i=t/n,a=-i,o=r;return{width:600,draw:e=>{e.lineWidth(35);let t=300-r*160,n=250-i*160,s=300+r*200,c=250+i*200;e.M(t,n),e.L(s,c),e.stroke(),e.M(s,c),e.L(s-r*90+a*55,c-i*90+o*55),e.L(s-r*90-a*55,c-i*90-o*55),e.Z(),e.fill();let l=t-r*40,u=n-i*40;e.circle(l,u,40),e.stroke()}}}function sC(e,t){let n=Math.sqrt(e*e+t*t),r=e/n,i=t/n,a=-i,o=r;return{width:600,draw:e=>{e.lineWidth(35);let t=300-r*200,n=250-i*200,s=300+r*200,c=250+i*200;e.M(t,n),e.L(s,c),e.stroke(),e.M(s,c),e.L(s-r*90+a*55,c-i*90+o*55),e.L(s-r*90-a*55,c-i*90-o*55),e.Z(),e.fill(),e.lineWidth(22),e.M(300-r*50+a*50,250-i*50+o*50),e.C(300-r*25+a*70,250-i*25+o*70,300+r*25+a*30,250+i*25+o*30,300+r*50+a*50,250+i*50+o*50),e.stroke()}}}function cC(e,t,n){let r=Math.sqrt(e*e+t*t),i=e/r,a=t/r,o=-a,s=i;return{width:600,draw:e=>{e.lineWidth(n);let t=300-i*200,r=250-a*200,c=300+i*200,l=250+a*200;e.M(t,r),e.L(c,l),e.stroke(),e.M(c-i*90+o*60,l-a*90+s*60),e.L(c,l),e.L(c-i*90-o*60,l-a*90-s*60),e.stroke()}}}function lC(e,t){let n=Math.sqrt(e*e+t*t),r=e/n,i=t/n,a=-i,o=r;return{width:600,draw:e=>{e.lineWidth(35);let t=300-r*200,n=250-i*200,s=300+r*200,c=250+i*200;e.M(t,n),e.L(s,c),e.stroke(),e.M(s-r*80+a*55,c-i*80+o*55),e.L(s,c),e.L(s-r*80-a*55,c-i*80-o*55),e.stroke(),e.M(t+a*70,n+o*70),e.L(t-a*70,n-o*70),e.stroke(),e.M(s+a*70,c+o*70),e.L(s-a*70,c-o*70),e.stroke()}}}K[10516]=nC(1,0),K[10517]=lC(1,0),K[10519]=rC(1,0),K[10520]=(()=>{let e=rC(1,0);return{width:600,draw:t=>{e.draw(t),t.lineWidth(35),t.M(300,150),t.L(300,350),t.stroke()}}})(),K[10521]=cC(-1,0,35),K[10522]=cC(1,0,35),K[10523]=rC(-1,0),K[10524]=rC(1,0),K[10539]=aC(1,1,1,-1),K[10540]=aC(1,-1,-1,-1),K[10541]=aC(1,-1,1,1),K[10542]=aC(1,1,1,-1),K[10543]={width:600,draw:e=>{e.lineWidth(30),e.M(120,420),e.L(480,80),e.stroke(),e.M(120,80),e.L(480,420),e.stroke(),e.M(480,420),e.L(400,410),e.L(470,340),e.Z(),e.fill()}},K[10544]={width:600,draw:e=>{e.lineWidth(30),e.M(120,80),e.L(480,420),e.stroke(),e.M(480,80),e.L(120,420),e.stroke(),e.M(120,420),e.L(200,410),e.L(130,340),e.Z(),e.fill()}},K[10545]=aC(1,1,-1,1),K[10546]=aC(-1,1,1,1),K[10547]={width:600,draw:e=>{e.lineWidth(35),e.M(80,250),e.C(160,350,240,150,320,250),e.C(360,300,420,250,480,250),e.stroke(),e.M(480,250),e.L(400,180),e.L(400,320),e.Z(),e.fill()}},K[10556]=oC(-1,0),K[10557]=oC(0,-1),K[10558]=iC(1,0),K[10559]={width:600,draw:e=>{oC(1,0).draw(e),e.lineWidth(25),e.M(280,380),e.L(320,380),e.stroke(),e.M(300,360),e.L(300,400),e.stroke()}},K[10566]=aC(-1,0,1,0),K[10567]=iC(1,0),K[10569]=nC(0,-1),K[10578]=lC(0,1),K[10579]=lC(0,-1),K[10580]=lC(1,0),K[10581]=lC(-1,0),K[10582]=nC(0,1),K[10583]=nC(0,-1),K[10584]=nC(1,0),K[10585]=nC(-1,0),K[10586]=cC(0,1,30),K[10587]=cC(0,-1,30),K[10588]=cC(1,0,30),K[10589]=cC(-1,0,30),K[10590]=cC(0,1,40),K[10591]=cC(0,-1,40),K[10592]=cC(1,0,40),K[10593]=cC(-1,0,40),K[10595]=aC(0,1,0,1),K[10597]=aC(0,-1,0,-1),K[10598]=aC(-1,0,-1,0),K[10599]=aC(1,0,1,0),K[10600]=aC(-1,0,1,0),K[10601]=aC(1,0,-1,0),K[10609]=sC(1,0),K[10610]=sC(1,0),K[10611]=sC(-1,0);let uC={8213:{width:700,draw:e=>{e.lineWidth(50),e.M(0,250),e.L(700,250),e.stroke()}},8218:{width:300,draw:e=>{e.circle(150,80,35),e.fill(),e.lineWidth(25),e.M(150,45),e.C(170,10,190,-10,210,-20),e.stroke()}},8219:{width:300,draw:e=>{e.circle(150,450,35),e.fill(),e.lineWidth(25),e.M(150,415),e.C(130,380,110,365,90,360),e.stroke()}},8220:{width:400,draw:e=>{e.circle(130,450,30),e.fill(),e.circle(270,450,30),e.fill(),e.lineWidth(22),e.M(130,415),e.C(100,380,80,365,60,360),e.stroke(),e.M(270,415),e.C(240,380,220,365,200,360),e.stroke()}},8221:{width:400,draw:e=>{e.circle(130,450,30),e.fill(),e.circle(270,450,30),e.fill(),e.lineWidth(22),e.M(130,415),e.C(160,380,180,365,200,360),e.stroke(),e.M(270,415),e.C(300,380,320,365,340,360),e.stroke()}},8222:{width:400,draw:e=>{e.circle(130,80,30),e.fill(),e.circle(270,80,30),e.fill(),e.lineWidth(22),e.M(130,45),e.C(160,10,180,-5,200,-10),e.stroke(),e.M(270,45),e.C(300,10,320,-5,340,-10),e.stroke()}},8228:{width:300,draw:e=>{e.circle(150,50,40),e.fill()}},8256:{width:600,draw:e=>{e.lineWidth(30),e.M(120,380),e.C(200,450,400,450,480,380),e.stroke()}},8257:{width:600,draw:e=>{e.lineWidth(30),e.M(120,420),e.C(200,350,400,350,480,420),e.stroke()}},8258:dC(3,50),8263:{width:600,draw:e=>{e.lineWidth(35),fC(e,200,250),fC(e,400,250)}},8264:{width:600,draw:e=>{e.lineWidth(35),fC(e,200,250),pC(e,400,250)}},8265:{width:600,draw:e=>{e.lineWidth(35),pC(e,200,250),fC(e,400,250)}},8273:{width:600,draw:e=>{dC(6,35).draw(e),e.M(300,50),e.L(300,50)}},8274:{width:600,draw:e=>{e.lineWidth(40),e.M(120,400),e.L(480,100),e.stroke(),e.circle(300,350,40),e.fill(),e.circle(300,150,40),e.fill()}},8275:{width:600,draw:e=>{e.lineWidth(45),e.M(100,250),e.C(200,350,400,150,500,250),e.stroke()}},8279:{width:500,draw:e=>{e.lineWidth(35);for(let t=0;t<4;t++)e.M(100+t*90,480),e.L(70+t*90,350);e.stroke()}}};function dC(e,t){return{width:600,draw:n=>{n.lineWidth(t);for(let t=0;t<e;t++){let r=t*Math.PI/e;n.M(300-120*Math.cos(r),400-120*Math.sin(r)),n.L(300+120*Math.cos(r),400+120*Math.sin(r))}n.stroke()}}}function fC(e,t,n){e.M(t-60,400),e.C(t-60,480,t+60,480,t+60,400),e.C(t+60,320,t,300,t,240),e.stroke(),e.circle(t,150,25),e.fill()}function pC(e,t,n){e.M(t,480),e.L(t,200),e.stroke(),e.circle(t,130,28),e.fill()}for(let e=8192;e<=8303;e++)uC[e]||(uC[e]={width:0,draw:()=>{}});let mC={};for(let e=8528;e<=8591;e++)if(!mC[e]){let t=(e-8528)%4+1;mC[e]={width:600,draw:e=>{e.lineWidth(40);let n=300-(t-1)*80/2;for(let r=0;r<t;r++)e.M(n+r*80,50),e.L(n+r*80,450);e.stroke()}}}function q(e){return{width:e,draw:()=>{}}}let hC={8192:q(500),8193:q(1e3),8194:q(500),8195:q(1e3),8196:q(333),8197:q(250),8198:q(167),8199:q(500),8200:q(250),8201:q(200),8202:q(100),8203:q(0),8204:q(0),8205:q(0),8206:q(0),8207:q(0),8232:q(0),8233:q(0),8234:q(0),8235:q(0),8236:q(0),8237:q(0),8238:q(0),8239:q(200),8287:q(222),8288:q(0),8289:q(0),8290:q(0),8291:q(0),8292:q(0),65279:q(0)},gC=[(e,t,n,r)=>{e.ellipse(t,n,r*.35,r*.5),e.stroke()},(e,t,n,r)=>{e.M(t-r*.15,n+r*.3),e.L(t,n+r*.5),e.L(t,n-r*.5),e.stroke()},(e,t,n,r)=>{e.M(t-r*.3,n+r*.25),e.C(t-r*.3,n+r*.55,t+r*.3,n+r*.55,t+r*.3,n+r*.2),e.C(t+r*.3,n,t-r*.3,n-r*.2,t-r*.3,n-r*.5),e.L(t+r*.3,n-r*.5),e.stroke()},(e,t,n,r)=>{e.M(t-r*.25,n+r*.45),e.C(t,n+r*.55,t+r*.35,n+r*.35,t+r*.1,n+r*.05),e.C(t+r*.35,n-r*.1,t+r*.35,n-r*.5,t-r*.25,n-r*.45),e.stroke()},(e,t,n,r)=>{e.M(t+r*.2,n-r*.5),e.L(t+r*.2,n+r*.5),e.L(t-r*.3,n-r*.1),e.L(t+r*.35,n-r*.1),e.stroke()},(e,t,n,r)=>{e.M(t+r*.3,n+r*.5),e.L(t-r*.25,n+r*.5),e.L(t-r*.3,n+r*.05),e.C(t+r*.1,n+r*.2,t+r*.4,n,t+r*.3,n-r*.2),e.C(t+r*.2,n-r*.5,t-r*.3,n-r*.5,t-r*.3,n-r*.35),e.stroke()},(e,t,n,r)=>{e.M(t+r*.2,n+r*.4),e.C(t-r*.1,n+r*.55,t-r*.35,n+r*.2,t-r*.35,n-r*.1),e.C(t-r*.35,n-r*.5,t+r*.35,n-r*.5,t+r*.35,n-r*.15),e.C(t+r*.35,n+r*.15,t-r*.35,n+r*.15,t-r*.35,n-r*.1),e.stroke()},(e,t,n,r)=>{e.M(t-r*.3,n+r*.5),e.L(t+r*.3,n+r*.5),e.L(t-r*.1,n-r*.5),e.stroke()},(e,t,n,r)=>{e.ellipse(t,n+r*.25,r*.25,r*.22),e.stroke(),e.ellipse(t,n-r*.22,r*.28,r*.25),e.stroke()},(e,t,n,r)=>{e.M(t-r*.2,n-r*.4),e.C(t+r*.1,n-r*.55,t+r*.35,n-r*.2,t+r*.35,n+r*.1),e.C(t+r*.35,n+r*.5,t-r*.35,n+r*.5,t-r*.35,n+r*.15),e.C(t-r*.35,n-r*.15,t+r*.35,n-r*.15,t+r*.35,n+r*.1),e.stroke()}];function _C(e,t,n,r,i){gC[t](e,n,r,i)}let vC=[(e,t,n,r)=>{e.M(t-r*.35,n-r*.5),e.L(t,n+r*.5),e.L(t+r*.35,n-r*.5),e.stroke(),e.M(t-r*.2,n-r*.05),e.L(t+r*.2,n-r*.05),e.stroke()},(e,t,n,r)=>{e.M(t-r*.25,n-r*.5),e.L(t-r*.25,n+r*.5),e.L(t+r*.1,n+r*.5),e.C(t+r*.35,n+r*.5,t+r*.35,n+r*.05,t+r*.05,n+r*.05),e.L(t+r*.1,n+r*.05),e.C(t+r*.4,n+r*.05,t+r*.4,n-r*.5,t+r*.1,n-r*.5),e.Z(),e.stroke()},(e,t,n,r)=>{e.M(t+r*.3,n+r*.35),e.C(t+r*.1,n+r*.55,t-r*.35,n+r*.35,t-r*.35,n),e.C(t-r*.35,n-r*.35,t+r*.1,n-r*.55,t+r*.3,n-r*.35),e.stroke()},(e,t,n,r)=>{e.M(t-r*.25,n-r*.5),e.L(t-r*.25,n+r*.5),e.L(t,n+r*.5),e.C(t+r*.4,n+r*.5,t+r*.4,n-r*.5,t,n-r*.5),e.Z(),e.stroke()},(e,t,n,r)=>{e.M(t+r*.25,n+r*.5),e.L(t-r*.25,n+r*.5),e.L(t-r*.25,n-r*.5),e.L(t+r*.25,n-r*.5),e.stroke(),e.M(t-r*.25,n),e.L(t+r*.15,n),e.stroke()},(e,t,n,r)=>{e.M(t+r*.25,n+r*.5),e.L(t-r*.25,n+r*.5),e.L(t-r*.25,n-r*.5),e.stroke(),e.M(t-r*.25,n+r*.05),e.L(t+r*.15,n+r*.05),e.stroke()},(e,t,n,r)=>{e.M(t+r*.3,n+r*.35),e.C(t+r*.1,n+r*.55,t-r*.35,n+r*.35,t-r*.35,n),e.C(t-r*.35,n-r*.35,t+r*.1,n-r*.55,t+r*.3,n-r*.35),e.L(t+r*.3,n-r*.05),e.L(t+r*.05,n-r*.05),e.stroke()},(e,t,n,r)=>{e.M(t-r*.3,n+r*.5),e.L(t-r*.3,n-r*.5),e.stroke(),e.M(t+r*.3,n+r*.5),e.L(t+r*.3,n-r*.5),e.stroke(),e.M(t-r*.3,n),e.L(t+r*.3,n),e.stroke()},(e,t,n,r)=>{e.M(t,n+r*.5),e.L(t,n-r*.5),e.stroke()},(e,t,n,r)=>{e.M(t+r*.15,n+r*.5),e.L(t+r*.15,n-r*.25),e.C(t+r*.15,n-r*.55,t-r*.3,n-r*.55,t-r*.3,n-r*.25),e.stroke()},(e,t,n,r)=>{e.M(t-r*.25,n+r*.5),e.L(t-r*.25,n-r*.5),e.stroke(),e.M(t+r*.3,n+r*.5),e.L(t-r*.25,n),e.L(t+r*.3,n-r*.5),e.stroke()},(e,t,n,r)=>{e.M(t-r*.25,n+r*.5),e.L(t-r*.25,n-r*.5),e.L(t+r*.25,n-r*.5),e.stroke()},(e,t,n,r)=>{e.M(t-r*.35,n-r*.5),e.L(t-r*.35,n+r*.5),e.L(t,n),e.L(t+r*.35,n+r*.5),e.L(t+r*.35,n-r*.5),e.stroke()},(e,t,n,r)=>{e.M(t-r*.3,n-r*.5),e.L(t-r*.3,n+r*.5),e.L(t+r*.3,n-r*.5),e.L(t+r*.3,n+r*.5),e.stroke()},(e,t,n,r)=>{e.ellipse(t,n,r*.35,r*.5),e.stroke()},(e,t,n,r)=>{e.M(t-r*.25,n-r*.5),e.L(t-r*.25,n+r*.5),e.L(t+r*.1,n+r*.5),e.C(t+r*.4,n+r*.5,t+r*.4,n+r*.05,t+r*.1,n+r*.05),e.L(t-r*.25,n+r*.05),e.stroke()},(e,t,n,r)=>{e.ellipse(t,n+r*.05,r*.35,r*.45),e.stroke(),e.M(t+r*.1,n-r*.2),e.L(t+r*.35,n-r*.5),e.stroke()},(e,t,n,r)=>{e.M(t-r*.25,n-r*.5),e.L(t-r*.25,n+r*.5),e.L(t+r*.1,n+r*.5),e.C(t+r*.4,n+r*.5,t+r*.4,n+r*.05,t+r*.1,n+r*.05),e.L(t-r*.25,n+r*.05),e.stroke(),e.M(t+r*.05,n+r*.05),e.L(t+r*.3,n-r*.5),e.stroke()},(e,t,n,r)=>{e.M(t+r*.25,n+r*.35),e.C(t+r*.1,n+r*.55,t-r*.35,n+r*.4,t-r*.25,n+r*.15),e.C(t-r*.15,n-r*.05,t+r*.2,n-r*.05,t+r*.25,n-r*.2),e.C(t+r*.35,n-r*.45,t-r*.1,n-r*.55,t-r*.25,n-r*.4),e.stroke()},(e,t,n,r)=>{e.M(t-r*.3,n+r*.5),e.L(t+r*.3,n+r*.5),e.stroke(),e.M(t,n+r*.5),e.L(t,n-r*.5),e.stroke()},(e,t,n,r)=>{e.M(t-r*.3,n+r*.5),e.L(t-r*.3,n-r*.15),e.C(t-r*.3,n-r*.55,t+r*.3,n-r*.55,t+r*.3,n-r*.15),e.L(t+r*.3,n+r*.5),e.stroke()},(e,t,n,r)=>{e.M(t-r*.35,n+r*.5),e.L(t,n-r*.5),e.L(t+r*.35,n+r*.5),e.stroke()},(e,t,n,r)=>{e.M(t-r*.4,n+r*.5),e.L(t-r*.2,n-r*.5),e.L(t,n+r*.1),e.L(t+r*.2,n-r*.5),e.L(t+r*.4,n+r*.5),e.stroke()},(e,t,n,r)=>{e.M(t-r*.3,n+r*.5),e.L(t+r*.3,n-r*.5),e.stroke(),e.M(t+r*.3,n+r*.5),e.L(t-r*.3,n-r*.5),e.stroke()},(e,t,n,r)=>{e.M(t-r*.3,n+r*.5),e.L(t,n),e.L(t+r*.3,n+r*.5),e.stroke(),e.M(t,n),e.L(t,n-r*.5),e.stroke()},(e,t,n,r)=>{e.M(t-r*.3,n+r*.5),e.L(t+r*.3,n+r*.5),e.L(t-r*.3,n-r*.5),e.L(t+r*.3,n-r*.5),e.stroke()}];function J(e,t,n,r,i){vC[t](e,n,r,i)}let yC={};for(let e=1;e<=9;e++)yC[9311+e]={width:600,draw:t=>{t.lineWidth(30),t.circle(300,250,220),t.stroke(),t.lineWidth(28),_C(t,e,300,250,210)}};for(let e=10;e<=19;e++){let t=e-10;yC[9311+e]={width:600,draw:e=>{e.lineWidth(30),e.circle(300,250,220),e.stroke(),e.lineWidth(24),_C(e,1,230,250,160),_C(e,t,370,250,160)}}}yC[9331]={width:600,draw:e=>{e.lineWidth(30),e.circle(300,250,220),e.stroke(),e.lineWidth(24),_C(e,2,230,250,160),_C(e,0,370,250,160)}},yC[9450]={width:600,draw:e=>{e.lineWidth(30),e.circle(300,250,220),e.stroke(),e.lineWidth(28),_C(e,0,300,250,210)}};let bC={};for(let e=0;e<26;e++)bC[9398+e]={width:600,draw:t=>{t.lineWidth(28),t.circle(300,250,220),t.stroke(),t.lineWidth(24),J(t,e,300,250,200)}};let xC={};for(let e=0;e<26;e++)xC[9424+e]={width:600,draw:t=>{t.lineWidth(25),t.circle(300,250,200),t.stroke(),t.lineWidth(22),J(t,e,300,250,175)}};let SC={};for(let e=1;e<=9;e++)SC[10101+e]={width:600,draw:e=>{e.circle(300,250,240),e.fill()}};let CC={10003:{width:600,draw:e=>{e.lineWidth(60),e.M(90,250),e.C(90,250,200,100,230,70),e.C(260,40,350,250,510,460),e.stroke()}},10004:{width:600,draw:e=>{e.lineWidth(80),e.M(80,250),e.C(80,250,190,100,220,70),e.C(250,40,350,250,520,470),e.stroke()}},10007:{width:600,draw:e=>{e.lineWidth(55),e.M(120,60),e.L(480,440),e.stroke(),e.M(480,60),e.L(120,440),e.stroke()}},10008:{width:600,draw:e=>{e.lineWidth(75),e.M(120,60),e.L(480,440),e.stroke(),e.M(480,60),e.L(120,440),e.stroke()}},9733:{width:600,draw:e=>{for(let t=0;t<5;t++){let n=(t*72-90)*Math.PI/180,r=(t*72+36-90)*Math.PI/180;t===0?e.M(300+230*Math.cos(n),250+230*Math.sin(n)):e.L(300+230*Math.cos(n),250+230*Math.sin(n)),e.L(300+95*Math.cos(r),250+95*Math.sin(r))}e.Z(),e.fill()}},9734:{width:600,draw:e=>{e.lineWidth(30);for(let t=0;t<5;t++){let n=(t*72-90)*Math.PI/180,r=(t*72+36-90)*Math.PI/180;t===0?e.M(300+230*Math.cos(n),250+230*Math.sin(n)):e.L(300+230*Math.cos(n),250+230*Math.sin(n)),e.L(300+95*Math.cos(r),250+95*Math.sin(r))}e.Z(),e.stroke()}},9829:{width:600,draw:e=>{e.M(300,60),e.C(300,60,120,120,80,260),e.C(50,370,120,450,300,480),e.C(480,450,550,370,520,260),e.C(480,120,300,60,300,60),e.Z(),e.fill()}},9824:{width:600,draw:e=>{e.M(300,490),e.C(300,490,50,340,70,200),e.C(80,100,180,60,300,200),e.C(420,60,520,100,530,200),e.C(550,340,300,490,300,490),e.Z(),e.fill(),e.M(260,200),e.L(260,20),e.L(340,20),e.L(340,200),e.Z(),e.fill()}},8594:{width:600,draw:e=>{e.lineWidth(45),e.M(80,250),e.L(430,250),e.stroke(),e.M(520,250),e.L(380,370),e.L(380,130),e.Z(),e.fill()}},8592:{width:600,draw:e=>{e.lineWidth(45),e.M(520,250),e.L(170,250),e.stroke(),e.M(80,250),e.L(220,370),e.L(220,130),e.Z(),e.fill()}},8593:{width:600,draw:e=>{e.lineWidth(45),e.M(300,30),e.L(300,380),e.stroke(),e.M(300,470),e.L(170,330),e.L(430,330),e.Z(),e.fill()}},8595:{width:600,draw:e=>{e.lineWidth(45),e.M(300,470),e.L(300,120),e.stroke(),e.M(300,30),e.L(170,170),e.L(430,170),e.Z(),e.fill()}},9679:{width:600,draw:e=>{e.circle(300,250,230),e.fill()}},9675:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,220),e.stroke()}},9632:{width:600,draw:e=>{e.rect(80,30,440,440),e.fill()}},9633:{width:600,draw:e=>{e.lineWidth(40),e.rect(80,30,440,440),e.stroke()}},9744:{width:600,draw:e=>{e.lineWidth(42),e.rect(90,25,420,420),e.stroke()}},9745:{width:600,draw:e=>{e.lineWidth(42),e.rect(90,25,420,420),e.stroke(),e.lineWidth(52),e.M(180,230),e.C(180,230,250,130,270,110),e.C(290,90,350,220,440,370),e.stroke()}},9746:{width:600,draw:e=>{e.lineWidth(42),e.rect(90,25,420,420),e.stroke(),e.lineWidth(48),e.M(165,95),e.L(435,375),e.stroke(),e.M(165,375),e.L(435,95),e.stroke()}},10695:{width:600,draw:e=>{e.lineWidth(38),e.rect(80,30,440,440),e.stroke(),e.circle(300,250,130),e.stroke()}}};function wC(e){return{width:600,draw:t=>{t.lineWidth(35),t.circle(300,250,200),t.stroke(),t.lineWidth(40),e(t)}}}function TC(e){return{width:600,draw:e}}let EC={};EC[10752]=wC(e=>{e.circle(300,250,40),e.fill()}),EC[10753]=wC(e=>{e.M(100,250),e.L(500,250),e.stroke(),e.M(300,50),e.L(300,450),e.stroke()}),EC[10754]=wC(e=>{e.M(160,110),e.L(440,390),e.stroke(),e.M(160,390),e.L(440,110),e.stroke()}),EC[10755]=TC(e=>{e.lineWidth(40),e.M(120,450),e.L(120,200),e.C(120,30,480,30,480,200),e.L(480,450),e.stroke(),e.circle(300,200,35),e.fill()}),EC[10756]=TC(e=>{e.lineWidth(40),e.M(120,450),e.L(120,200),e.C(120,30,480,30,480,200),e.L(480,450),e.stroke(),e.M(230,200),e.L(370,200),e.stroke(),e.M(300,130),e.L(300,270),e.stroke()}),EC[10757]=TC(e=>{e.lineWidth(45),e.M(120,50),e.L(120,450),e.L(480,450),e.L(480,50),e.stroke()}),EC[10758]=TC(e=>{e.lineWidth(45),e.M(120,450),e.L(120,50),e.L(480,50),e.L(480,450),e.stroke()});for(let e=10759;e<=10762;e++)EC[e]=TC(e=>{e.lineWidth(40),e.M(200,480),e.C(180,480,160,450,160,400),e.L(160,100),e.C(160,50,180,20,200,20),e.stroke(),e.M(400,480),e.C(380,480,360,450,360,400),e.L(360,100),e.C(360,50,380,20,400,20),e.stroke()});for(let e=10763;e<=10780;e++)EC[e]||(EC[e]=TC(e=>{e.lineWidth(45),e.M(380,480),e.C(350,480,300,450,300,400),e.L(300,100),e.C(300,50,250,20,220,20),e.stroke()}));for(let e=10781;e<=10815;e++)EC[e]||(EC[e]=TC(e=>{e.lineWidth(40),e.M(120,450),e.L(480,250),e.L(120,50),e.stroke(),e.M(480,450),e.L(120,250),e.L(480,50),e.stroke()}));for(let e=10816;e<=10847;e++)EC[e]||(EC[e]=TC(e=>{e.lineWidth(40),e.M(120,320),e.L(480,320),e.stroke(),e.M(120,180),e.L(480,180),e.stroke()}));for(let e=10848;e<=10879;e++)EC[e]||(EC[e]=TC(e=>{e.lineWidth(40),e.M(120,350),e.C(200,420,400,420,480,350),e.stroke(),e.M(120,200),e.L(480,200),e.stroke()}));for(let e=10880;e<=10911;e++)EC[e]||(EC[e]=TC(e=>{e.lineWidth(40),e.M(480,420),e.C(200,420,120,320,120,250),e.C(120,180,200,80,480,80),e.stroke()}));for(let e=10912;e<=10943;e++)EC[e]||(EC[e]=TC(e=>{e.lineWidth(40),e.M(460,420),e.C(200,420,140,320,140,250),e.C(140,180,200,80,460,80),e.stroke(),e.M(140,30),e.L(460,30),e.stroke()}));for(let e=10944;e<=11007;e++)EC[e]||(EC[e]=TC(e=>{e.lineWidth(40),e.M(140,350),e.L(460,350),e.stroke(),e.M(140,200),e.L(460,200),e.stroke(),e.circle(300,275,30),e.fill()}));let DC={};DC[10624]={width:600,draw:e=>{e.lineWidth(35),e.M(200,0),e.L(200,500),e.stroke(),e.M(300,0),e.L(300,500),e.stroke(),e.M(400,0),e.L(400,500),e.stroke()}},DC[10625]={width:600,draw:e=>{e.circle(300,250,60),e.fill()}},DC[10626]={width:300,draw:e=>{e.circle(150,370,40),e.fill(),e.circle(150,130,40),e.fill()}};for(let[e,t]of[[10627,!0],[10628,!1],[10629,!0],[10630,!1]])DC[e]={width:350,draw:e=>{e.lineWidth(35),t?(e.M(250,500),e.C(80,400,80,100,250,0),e.stroke()):(e.M(100,500),e.C(270,400,270,100,100,0),e.stroke())}};for(let e=10631;e<=10642;e++)if(!DC[e]){let t=(e-10631)%2==0;DC[e]={width:350,draw:e=>{e.lineWidth(35),t?(e.M(250,500),e.L(100,250),e.L(250,0),e.stroke()):(e.M(100,500),e.L(250,250),e.L(100,0),e.stroke())}}}for(let e=10643;e<=10648;e++)if(!DC[e]){let t=(e-10643)%2==0;DC[e]={width:350,draw:e=>{e.lineWidth(30),t?(e.M(250,500),e.C(100,400,100,100,250,0),e.stroke()):(e.M(100,500),e.C(250,400,250,100,100,0),e.stroke())}}}DC[10649]={width:200,draw:e=>{for(let t=50;t<=450;t+=80)e.circle(100,t,20),e.fill()}},DC[10650]={width:300,draw:e=>{e.lineWidth(35),e.M(100,500),e.L(200,400),e.L(100,300),e.L(200,200),e.L(100,100),e.L(200,0),e.stroke()}};for(let e=10651;e<=10654;e++)DC[e]={width:600,draw:e=>{e.lineWidth(40),e.M(480,50),e.L(120,50),e.L(380,400),e.stroke(),e.M(200,50),e.C(200,150,250,200,280,180),e.stroke()}};for(let e=10655;e<=10661;e++)DC[e]={width:600,draw:e=>{e.lineWidth(40),e.M(120,50),e.L(120,450),e.L(480,50),e.stroke()}};for(let e=10662;e<=10671;e++)DC[e]={width:600,draw:e=>{e.lineWidth(40),e.M(120,50),e.L(480,50),e.stroke(),e.M(120,50),e.L(120,400),e.stroke(),e.M(300,50),e.L(300,350),e.stroke()}};for(let e=10672;e<=10687;e++)DC[e]=wC(e=>{e.M(160,110),e.L(440,390),e.stroke()});for(let e=10696;e<=10703;e++)e===10696||e===10697||(DC[e]={width:600,draw:e=>{e.lineWidth(35),e.rect(100,50,400,400),e.stroke(),e.M(200,150),e.L(400,350),e.stroke()}});for(let e=10704;e<=10719;e++)DC[e]={width:600,draw:e=>{e.lineWidth(40),e.M(300,450),e.L(500,250),e.L(300,50),e.L(100,250),e.Z(),e.stroke()}};for(let e=10720;e<=10751;e++)DC[e]||(DC[e]={width:600,draw:e=>{e.lineWidth(35),e.rect(100,50,400,400),e.stroke(),e.circle(300,250,100),e.stroke()}});let Y={};function OC(e){return{width:600,draw:t=>{t.lineWidth(38),t.M(120,320),t.L(480,320),t.stroke(),t.M(120,180),t.L(480,180),t.stroke(),e&&e(t)}}}function X(e){e.lineWidth(35),e.M(200,420),e.L(400,80),e.stroke()}function kC(e,t){return{width:600,draw:n=>{n.lineWidth(40),n.M(460,400),n.C(200,400,140,320,140,250),n.C(140,180,200,100,460,100),n.stroke(),e&&(n.M(140,55),n.L(460,55),n.stroke()),t&&X(n)}}}function AC(e,t){return{width:600,draw:n=>{n.lineWidth(40),n.M(140,400),n.C(400,400,460,320,460,250),n.C(460,180,400,100,140,100),n.stroke(),e&&(n.M(140,55),n.L(460,55),n.stroke()),t&&X(n)}}}function jC(e){return{width:600,draw:t=>{t.lineWidth(35),t.circle(300,250,190),t.stroke(),t.lineWidth(38),e(t)}}}Y[8705]={width:600,draw:e=>{e.lineWidth(42),e.M(420,400),e.C(380,470,220,470,180,400),e.C(140,320,140,180,180,100),e.C(220,30,380,30,420,100),e.stroke()}},Y[8708]={width:600,draw:e=>{e.lineWidth(42),e.M(420,60),e.L(180,60),e.L(180,450),e.L(420,450),e.stroke(),e.M(180,250),e.L(380,250),e.stroke(),X(e)}},Y[8714]={width:600,draw:e=>{e.lineWidth(35),e.M(440,380),e.C(300,430,160,370,160,250),e.C(160,130,300,70,440,120),e.stroke(),e.M(160,250),e.L(400,250),e.stroke()}},Y[8716]={width:600,draw:e=>{e.lineWidth(42),e.M(160,400),e.C(300,460,440,380,440,250),e.C(440,120,300,40,160,100),e.stroke(),e.M(440,250),e.L(200,250),e.stroke(),X(e)}},Y[8717]={width:600,draw:e=>{e.lineWidth(35),e.M(160,380),e.C(300,430,440,370,440,250),e.C(440,130,300,70,160,120),e.stroke(),e.M(440,250),e.L(200,250),e.stroke()}},Y[8720]={width:600,draw:e=>{e.lineWidth(45),e.M(140,60),e.L(140,450),e.L(460,450),e.L(460,60),e.stroke()}},Y[8724]={width:600,draw:e=>{e.lineWidth(42),e.M(120,250),e.L(480,250),e.stroke(),e.M(300,120),e.L(300,380),e.stroke(),e.circle(300,430,25),e.fill()}},Y[8725]={width:600,draw:e=>{e.lineWidth(42),e.M(440,470),e.L(160,30),e.stroke()}},Y[8726]={width:600,draw:e=>{e.lineWidth(42),e.M(160,470),e.L(440,30),e.stroke()}},Y[8731]={width:600,draw:e=>{e.lineWidth(40),e.M(80,250),e.L(180,250),e.L(260,30),e.L(350,470),e.L(520,470),e.stroke(),e.lineWidth(22),e.M(80,440),e.C(80,470,130,470,130,445),e.C(130,420,80,420,80,395),e.stroke()}},Y[8732]={width:600,draw:e=>{e.lineWidth(40),e.M(80,250),e.L(180,250),e.L(260,30),e.L(350,470),e.L(520,470),e.stroke(),e.lineWidth(22),e.M(120,395),e.L(120,470),e.L(80,430),e.L(130,430),e.stroke()}},Y[8737]={width:600,draw:e=>{e.lineWidth(40),e.M(480,60),e.L(120,60),e.L(420,440),e.stroke(),e.lineWidth(28),e.M(220,60),e.C(220,160,260,200,290,180),e.stroke()}},Y[8738]={width:600,draw:e=>{e.lineWidth(40),e.M(420,440),e.L(120,60),e.L(420,60),e.stroke(),e.lineWidth(28),e.M(200,140),e.C(240,200,320,200,360,140),e.stroke()}},Y[8748]={width:600,draw:e=>{e.lineWidth(40),e.M(320,470),e.C(290,470,260,440,260,400),e.L(260,100),e.C(260,60,230,30,200,30),e.stroke(),e.M(440,470),e.C(410,470,380,440,380,400),e.L(380,100),e.C(380,60,350,30,320,30),e.stroke()}},Y[8749]={width:600,draw:e=>{e.lineWidth(35);for(let t=0;t<3;t++){let n=180+t*100;e.M(n+40,470),e.C(n+20,470,n,440,n,400),e.L(n,100),e.C(n,60,n-20,30,n-40,30),e.stroke()}}},Y[8750]={width:600,draw:e=>{e.lineWidth(40),e.M(360,470),e.C(330,470,300,440,300,400),e.L(300,100),e.C(300,60,270,30,240,30),e.stroke(),e.lineWidth(28),e.ellipse(300,250,80,60),e.stroke()}},Y[8751]={width:600,draw:e=>{e.lineWidth(35);for(let t=0;t<2;t++){let n=220+t*110;e.M(n+40,470),e.C(n+20,470,n,440,n,400),e.L(n,100),e.C(n,60,n-20,30,n-40,30),e.stroke()}e.lineWidth(25),e.ellipse(300,250,70,50),e.stroke()}},Y[8752]={width:600,draw:e=>{e.lineWidth(32);for(let t=0;t<3;t++){let n=180+t*100;e.M(n+35,470),e.C(n+15,470,n,440,n,400),e.L(n,100),e.C(n,60,n-15,30,n-35,30),e.stroke()}e.lineWidth(22),e.ellipse(280,250,60,45),e.stroke()}},Y[8753]={width:600,draw:e=>{e.lineWidth(40),e.M(360,470),e.C(330,470,300,440,300,400),e.L(300,100),e.C(300,60,270,30,240,30),e.stroke(),e.lineWidth(25),e.M(370,230),e.C(370,300,230,300,230,250),e.C(230,200,310,200,340,230),e.stroke()}},Y[8754]={width:600,draw:e=>{e.lineWidth(40),e.M(360,470),e.C(330,470,300,440,300,400),e.L(300,100),e.C(300,60,270,30,240,30),e.stroke(),e.lineWidth(25),e.M(230,230),e.C(230,300,370,300,370,250),e.C(370,200,290,200,260,230),e.stroke()}},Y[8755]=Y[8753],Y[8760]={width:600,draw:e=>{e.lineWidth(42),e.M(120,250),e.L(480,250),e.stroke(),e.circle(300,360,28),e.fill()}},Y[8761]={width:600,draw:e=>{e.lineWidth(42),e.M(120,250),e.L(480,250),e.stroke(),e.circle(300,370,28),e.fill(),e.circle(300,130,28),e.fill()}},Y[8762]={width:600,draw:e=>{e.circle(180,350,28),e.fill(),e.circle(420,350,28),e.fill(),e.circle(180,150,28),e.fill(),e.circle(420,150,28),e.fill(),e.lineWidth(38),e.M(120,250),e.L(480,250),e.stroke()}},Y[8763]={width:600,draw:e=>{e.lineWidth(38),e.M(120,300),e.C(200,380,400,380,480,300),e.stroke(),e.M(120,180),e.C(200,260,400,260,480,180),e.stroke(),e.circle(300,400,25),e.fill()}},Y[8764]={width:600,draw:e=>{e.lineWidth(45),e.M(120,280),e.C(200,380,400,120,480,220),e.stroke()}},Y[8765]={width:600,draw:e=>{e.lineWidth(45),e.M(120,220),e.C(200,120,400,380,480,280),e.stroke()}},Y[8766]={width:600,draw:e=>{e.lineWidth(40),e.M(120,250),e.C(120,400,300,400,300,250),e.C(300,100,480,100,480,250),e.stroke()}},Y[8767]={width:600,draw:e=>{e.lineWidth(40),e.M(80,250),e.C(160,450,300,450,300,250),e.C(300,50,440,50,520,250),e.stroke()}},Y[8768]={width:600,draw:e=>{e.lineWidth(40),e.M(300,460),e.C(200,380,400,120,300,40),e.stroke()}},Y[8769]={width:600,draw:e=>{e.lineWidth(42),e.M(120,280),e.C(200,380,400,120,480,220),e.stroke(),X(e)}},Y[8770]={width:600,draw:e=>{e.lineWidth(40),e.M(120,320),e.C(200,400,400,400,480,320),e.stroke(),e.M(120,180),e.L(480,180),e.stroke()}},Y[8771]={width:600,draw:e=>{e.lineWidth(40),e.M(120,320),e.C(200,420,400,120,480,220),e.stroke(),e.M(120,150),e.L(480,150),e.stroke()}},Y[8772]={width:600,draw:e=>{e.lineWidth(40),e.M(120,320),e.C(200,420,400,120,480,220),e.stroke(),e.M(120,150),e.L(480,150),e.stroke(),X(e)}},Y[8774]={width:600,draw:e=>{e.lineWidth(38),e.M(120,370),e.C(200,440,400,440,480,370),e.stroke(),e.M(120,250),e.C(200,320,400,320,480,250),e.stroke(),e.M(120,130),e.L(480,130),e.stroke(),X(e)}},Y[8775]=Y[8774],Y[8777]={width:600,draw:e=>{e.lineWidth(40),e.M(120,320),e.C(200,400,400,400,480,320),e.stroke(),e.M(120,180),e.C(200,260,400,260,480,180),e.stroke(),X(e)}},Y[8778]={width:600,draw:e=>{e.lineWidth(36),e.M(120,370),e.C(200,440,400,440,480,370),e.stroke(),e.M(120,260),e.C(200,330,400,330,480,260),e.stroke(),e.M(120,150),e.L(480,150),e.stroke()}},Y[8779]={width:600,draw:e=>{e.lineWidth(35);for(let t of[370,250,130])e.M(120,t),e.C(200,t+70,400,t+70,480,t),e.stroke()}},Y[8781]={width:600,draw:e=>{e.lineWidth(40),e.M(120,340),e.C(200,420,400,420,480,340),e.stroke(),e.M(120,160),e.C(200,80,400,80,480,160),e.stroke()}},Y[8782]={width:600,draw:e=>{e.lineWidth(40),e.M(120,320),e.C(200,420,400,420,480,320),e.stroke(),e.M(120,180),e.C(200,80,400,80,480,180),e.stroke()}},Y[8783]={width:600,draw:e=>{e.lineWidth(40),e.M(120,320),e.C(200,400,400,400,480,320),e.stroke(),e.M(120,180),e.L(480,180),e.stroke()}},Y[8784]={width:600,draw:e=>{e.lineWidth(40),e.M(120,300),e.L(480,300),e.stroke(),e.M(120,180),e.L(480,180),e.stroke(),e.circle(300,410,25),e.fill()}},Y[8785]={width:600,draw:e=>{e.lineWidth(40),e.M(120,300),e.L(480,300),e.stroke(),e.M(120,180),e.L(480,180),e.stroke(),e.circle(300,410,25),e.fill(),e.circle(300,80,25),e.fill()}},Y[8786]={width:600,draw:e=>{e.lineWidth(40),e.M(120,310),e.C(200,370,400,370,480,310),e.stroke(),e.M(120,190),e.C(200,130,400,130,480,190),e.stroke()}},Y[8787]={width:600,draw:e=>{e.lineWidth(40),e.M(120,310),e.C(200,250,400,250,480,310),e.stroke(),e.M(120,190),e.C(200,250,400,250,480,190),e.stroke()}},Y[8788]={width:600,draw:e=>{e.circle(180,330,30),e.fill(),e.circle(180,170,30),e.fill(),e.lineWidth(40),e.M(260,320),e.L(480,320),e.stroke(),e.M(260,180),e.L(480,180),e.stroke()}},Y[8789]={width:600,draw:e=>{e.circle(420,330,30),e.fill(),e.circle(420,170,30),e.fill(),e.lineWidth(40),e.M(120,320),e.L(340,320),e.stroke(),e.M(120,180),e.L(340,180),e.stroke()}},Y[8790]=OC(e=>{e.lineWidth(25),e.circle(300,250,35),e.stroke()}),Y[8791]={width:600,draw:e=>{e.lineWidth(40),e.M(120,280),e.L(480,280),e.stroke(),e.M(120,170),e.L(480,170),e.stroke(),e.lineWidth(25),e.circle(300,390,35),e.stroke()}},Y[8792]={width:600,draw:e=>{e.lineWidth(40),e.M(120,280),e.L(480,280),e.stroke(),e.M(120,170),e.L(480,170),e.stroke(),e.lineWidth(28),e.M(240,390),e.L(300,430),e.L(360,390),e.stroke()}},Y[8793]={width:600,draw:e=>{e.lineWidth(40),e.M(120,260),e.L(480,260),e.stroke(),e.M(120,150),e.L(480,150),e.stroke(),e.lineWidth(28),e.M(240,370),e.L(300,420),e.L(360,370),e.stroke()}},Y[8794]={width:600,draw:e=>{e.lineWidth(40),e.M(120,260),e.L(480,260),e.stroke(),e.M(120,150),e.L(480,150),e.stroke(),e.lineWidth(28),e.M(240,420),e.L(300,370),e.L(360,420),e.stroke()}},Y[8795]={width:600,draw:e=>{e.lineWidth(40),e.M(120,250),e.L(480,250),e.stroke(),e.M(120,140),e.L(480,140),e.stroke(),e.circle(300,380,35),e.fill()}},Y[8797]={width:600,draw:e=>{e.lineWidth(40),e.M(120,250),e.L(480,250),e.stroke(),e.M(120,140),e.L(480,140),e.stroke(),e.lineWidth(25),e.M(260,360),e.L(300,440),e.L(340,360),e.Z(),e.stroke()}},Y[8798]={width:600,draw:e=>{e.lineWidth(40),e.M(120,250),e.L(480,250),e.stroke(),e.M(120,140),e.L(480,140),e.stroke(),e.lineWidth(22),e.M(230,360),e.L(230,430),e.L(270,390),e.L(310,430),e.L(310,360),e.stroke()}},Y[8799]={width:600,draw:e=>{e.lineWidth(40),e.M(120,230),e.L(480,230),e.stroke(),e.M(120,120),e.L(480,120),e.stroke(),e.lineWidth(25),e.M(260,360),e.C(260,430,340,430,340,390),e.C(340,360,300,340,300,310),e.stroke(),e.circle(300,290,15),e.fill()}},Y[8802]={width:600,draw:e=>{e.lineWidth(38),e.M(120,350),e.L(480,350),e.stroke(),e.M(120,250),e.L(480,250),e.stroke(),e.M(120,150),e.L(480,150),e.stroke(),X(e)}},Y[8803]={width:600,draw:e=>{e.lineWidth(36),e.M(120,370),e.L(480,370),e.stroke(),e.M(120,290),e.L(480,290),e.stroke(),e.M(120,210),e.L(480,210),e.stroke(),e.M(120,130),e.L(480,130),e.stroke()}},Y[8806]={width:600,draw:e=>{e.lineWidth(40),e.M(460,420),e.L(140,260),e.L(460,100),e.stroke(),e.M(140,60),e.L(460,60),e.stroke()}},Y[8807]={width:600,draw:e=>{e.lineWidth(40),e.M(140,420),e.L(460,260),e.L(140,100),e.stroke(),e.M(140,60),e.L(460,60),e.stroke()}},Y[8808]={width:600,draw:e=>{Y[8806].draw(e),X(e)}},Y[8809]={width:600,draw:e=>{Y[8807].draw(e),X(e)}},Y[8812]={width:600,draw:e=>{e.lineWidth(40),e.M(200,420),e.L(400,250),e.L(200,80),e.stroke(),e.M(400,420),e.L(200,250),e.L(400,80),e.stroke()}},Y[8813]={width:600,draw:e=>{e.lineWidth(40),e.M(120,340),e.C(200,420,400,420,480,340),e.stroke(),e.M(120,160),e.C(200,80,400,80,480,160),e.stroke(),X(e)}},Y[8814]={width:600,draw:e=>{e.lineWidth(42),e.M(460,400),e.L(140,250),e.L(460,100),e.stroke(),X(e)}},Y[8815]={width:600,draw:e=>{e.lineWidth(42),e.M(140,400),e.L(460,250),e.L(140,100),e.stroke(),X(e)}},Y[8816]={width:600,draw:e=>{e.lineWidth(38),e.M(460,420),e.L(140,260),e.L(460,100),e.stroke(),e.M(140,60),e.L(460,60),e.stroke(),X(e)}},Y[8817]={width:600,draw:e=>{e.lineWidth(38),e.M(140,420),e.L(460,260),e.L(140,100),e.stroke(),e.M(140,60),e.L(460,60),e.stroke(),X(e)}},Y[8818]={width:600,draw:e=>{e.lineWidth(38),e.M(460,420),e.L(140,260),e.L(460,100),e.stroke(),e.M(140,60),e.C(220,30,380,30,460,60),e.stroke()}},Y[8819]={width:600,draw:e=>{e.lineWidth(38),e.M(140,420),e.L(460,260),e.L(140,100),e.stroke(),e.M(140,60),e.C(220,30,380,30,460,60),e.stroke()}},Y[8820]={width:600,draw:e=>{Y[8818].draw(e),X(e)}},Y[8821]={width:600,draw:e=>{Y[8819].draw(e),X(e)}},Y[8822]={width:600,draw:e=>{e.lineWidth(38),e.M(460,430),e.L(140,330),e.L(460,230),e.stroke(),e.M(140,230),e.L(460,130),e.L(140,60),e.stroke()}},Y[8823]={width:600,draw:e=>{e.lineWidth(38),e.M(140,430),e.L(460,330),e.L(140,230),e.stroke(),e.M(460,230),e.L(140,130),e.L(460,60),e.stroke()}},Y[8824]={width:600,draw:e=>{Y[8822].draw(e),X(e)}},Y[8825]={width:600,draw:e=>{Y[8823].draw(e),X(e)}},Y[8826]={width:600,draw:e=>{e.lineWidth(42),e.M(460,400),e.C(200,400,140,300,140,250),e.C(140,200,200,100,460,100),e.stroke()}},Y[8827]={width:600,draw:e=>{e.lineWidth(42),e.M(140,400),e.C(400,400,460,300,460,250),e.C(460,200,400,100,140,100),e.stroke()}},Y[8828]={width:600,draw:e=>{e.lineWidth(40),e.M(460,420),e.C(200,420,140,320,140,280),e.C(140,240,200,140,460,140),e.stroke(),e.M(140,80),e.L(460,80),e.stroke()}},Y[8829]={width:600,draw:e=>{e.lineWidth(40),e.M(140,420),e.C(400,420,460,320,460,280),e.C(460,240,400,140,140,140),e.stroke(),e.M(140,80),e.L(460,80),e.stroke()}},Y[8830]={width:600,draw:e=>{e.lineWidth(38),e.M(460,420),e.C(200,420,140,320,140,280),e.C(140,240,200,140,460,140),e.stroke(),e.M(140,80),e.C(220,50,380,50,460,80),e.stroke()}},Y[8831]={width:600,draw:e=>{e.lineWidth(38),e.M(140,420),e.C(400,420,460,320,460,280),e.C(460,240,400,140,140,140),e.stroke(),e.M(140,80),e.C(220,50,380,50,460,80),e.stroke()}},Y[8832]={width:600,draw:e=>{Y[8826].draw(e),X(e)}},Y[8833]={width:600,draw:e=>{Y[8827].draw(e),X(e)}},Y[8840]=kC(!0,!0),Y[8841]=AC(!0,!0),Y[8842]=kC(!0,!0),Y[8843]=AC(!0,!0),Y[8844]={width:600,draw:e=>{e.lineWidth(40),e.M(140,450),e.L(140,200),e.C(140,50,460,50,460,200),e.L(460,450),e.stroke(),e.M(230,280),e.L(370,280),e.stroke()}},Y[8845]={width:600,draw:e=>{e.lineWidth(40),e.M(140,450),e.L(140,200),e.C(140,50,460,50,460,200),e.L(460,450),e.stroke(),e.circle(300,250,30),e.fill()}},Y[8846]={width:600,draw:e=>{e.lineWidth(40),e.M(140,450),e.L(140,200),e.C(140,50,460,50,460,200),e.L(460,450),e.stroke(),e.M(240,250),e.L(360,250),e.stroke(),e.M(300,190),e.L(300,310),e.stroke()}},Y[8847]={width:600,draw:e=>{e.lineWidth(42),e.M(460,420),e.L(140,420),e.L(140,80),e.L(460,80),e.stroke()}},Y[8848]={width:600,draw:e=>{e.lineWidth(42),e.M(140,420),e.L(460,420),e.L(460,80),e.L(140,80),e.stroke()}},Y[8849]={width:600,draw:e=>{e.lineWidth(40),e.M(460,440),e.L(140,440),e.L(140,140),e.L(460,140),e.stroke(),e.M(140,80),e.L(460,80),e.stroke()}},Y[8850]={width:600,draw:e=>{e.lineWidth(40),e.M(140,440),e.L(460,440),e.L(460,140),e.L(140,140),e.stroke(),e.M(140,80),e.L(460,80),e.stroke()}},Y[8851]={width:600,draw:e=>{e.lineWidth(45),e.M(140,60),e.L(140,440),e.L(460,440),e.L(460,60),e.stroke()}},Y[8852]={width:600,draw:e=>{e.lineWidth(45),e.M(140,440),e.L(140,60),e.L(460,60),e.L(460,440),e.stroke()}},Y[8858]=jC(e=>{e.lineWidth(28),e.circle(300,250,60),e.stroke()}),Y[8859]=jC(e=>{e.lineWidth(32);for(let t=0;t<3;t++){let n=t*60*Math.PI/180;e.M(300+80*Math.cos(n),250+80*Math.sin(n)),e.L(300-80*Math.cos(n),250-80*Math.sin(n)),e.stroke()}}),Y[8860]=jC(e=>{e.M(200,280),e.L(400,280),e.stroke(),e.M(200,220),e.L(400,220),e.stroke()}),Y[8861]=jC(e=>{e.M(200,250),e.L(400,250),e.stroke()}),Y[8862]={width:600,draw:e=>{e.lineWidth(38),e.rect(100,50,400,400),e.stroke(),e.M(100,250),e.L(500,250),e.stroke(),e.M(300,50),e.L(300,450),e.stroke()}},Y[8863]={width:600,draw:e=>{e.lineWidth(38),e.rect(100,50,400,400),e.stroke(),e.M(160,250),e.L(440,250),e.stroke()}},Y[8864]={width:600,draw:e=>{e.lineWidth(38),e.rect(100,50,400,400),e.stroke(),e.M(100,50),e.L(500,450),e.stroke(),e.M(500,50),e.L(100,450),e.stroke()}},Y[8865]={width:600,draw:e=>{e.lineWidth(38),e.rect(100,50,400,400),e.stroke(),e.circle(300,250,40),e.fill()}},Y[8866]={width:600,draw:e=>{e.lineWidth(42),e.M(140,440),e.L(140,60),e.stroke(),e.M(140,250),e.L(480,250),e.stroke()}},Y[8867]={width:600,draw:e=>{e.lineWidth(42),e.M(460,440),e.L(460,60),e.stroke(),e.M(460,250),e.L(120,250),e.stroke()}},Y[8868]={width:600,draw:e=>{e.lineWidth(42),e.M(120,440),e.L(480,440),e.stroke(),e.M(300,440),e.L(300,60),e.stroke()}},Y[8870]={width:600,draw:e=>{e.lineWidth(42),e.M(160,440),e.L(160,60),e.stroke(),e.M(160,250),e.L(460,250),e.stroke(),e.M(220,440),e.L(220,60),e.stroke()}},Y[8871]={width:600,draw:e=>{e.lineWidth(42),e.M(140,440),e.L(140,60),e.stroke(),e.M(140,310),e.L(460,310),e.stroke(),e.M(140,190),e.L(460,190),e.stroke()}},Y[8872]={width:600,draw:e=>{e.lineWidth(42),e.M(140,440),e.L(140,60),e.stroke(),e.M(200,440),e.L(200,60),e.stroke(),e.M(200,250),e.L(460,250),e.stroke()}},Y[8873]={width:600,draw:e=>{e.lineWidth(40),e.M(140,440),e.L(140,60),e.stroke(),e.M(200,440),e.L(200,60),e.stroke(),e.M(200,250),e.L(460,250),e.stroke()}},Y[8874]={width:600,draw:e=>{e.lineWidth(36),e.M(130,440),e.L(130,60),e.stroke(),e.M(190,440),e.L(190,60),e.stroke(),e.M(250,440),e.L(250,60),e.stroke(),e.M(250,250),e.L(460,250),e.stroke()}},Y[8875]={width:600,draw:e=>{e.lineWidth(38),e.M(130,440),e.L(130,60),e.stroke(),e.M(200,440),e.L(200,60),e.stroke(),e.M(200,300),e.L(460,300),e.stroke(),e.M(200,200),e.L(460,200),e.stroke()}},Y[8876]={width:600,draw:e=>{Y[8866].draw(e),X(e)}},Y[8877]={width:600,draw:e=>{Y[8872].draw(e),X(e)}},Y[8878]={width:600,draw:e=>{Y[8873].draw(e),X(e)}},Y[8879]={width:600,draw:e=>{Y[8875].draw(e),X(e)}},Y[8880]={width:600,draw:e=>{e.lineWidth(40),e.M(460,400),e.C(200,400,140,300,140,250),e.C(140,200,200,100,460,100),e.stroke(),e.M(140,50),e.L(460,50),e.stroke()}},Y[8881]={width:600,draw:e=>{e.lineWidth(40),e.M(140,400),e.C(400,400,460,300,460,250),e.C(460,200,400,100,140,100),e.stroke(),e.M(140,50),e.L(460,50),e.stroke()}},Y[8882]={width:600,draw:e=>{e.lineWidth(42),e.M(460,420),e.L(140,250),e.L(460,80),e.Z(),e.stroke()}},Y[8883]={width:600,draw:e=>{e.lineWidth(42),e.M(140,420),e.L(460,250),e.L(140,80),e.Z(),e.stroke()}},Y[8884]={width:600,draw:e=>{e.lineWidth(40),e.M(460,440),e.L(140,260),e.L(460,100),e.Z(),e.stroke(),e.M(140,55),e.L(460,55),e.stroke()}},Y[8885]={width:600,draw:e=>{e.lineWidth(40),e.M(140,440),e.L(460,260),e.L(140,100),e.Z(),e.stroke(),e.M(140,55),e.L(460,55),e.stroke()}},Y[8886]={width:600,draw:e=>{e.lineWidth(40),e.M(420,400),e.L(200,250),e.L(420,100),e.stroke(),e.circle(160,250,40),e.fill()}},Y[8887]={width:600,draw:e=>{e.lineWidth(40),e.M(180,400),e.L(400,250),e.L(180,100),e.stroke(),e.circle(440,250,40),e.fill()}},Y[8888]={width:600,draw:e=>{e.lineWidth(42),e.M(120,250),e.L(430,250),e.stroke(),e.lineWidth(28),e.circle(470,250,40),e.stroke()}},Y[8889]={width:600,draw:e=>{e.lineWidth(38),e.rect(120,80,360,340),e.stroke(),e.circle(300,250,30),e.fill()}},Y[8890]={width:600,draw:e=>{e.lineWidth(42),e.M(120,60),e.L(480,60),e.stroke(),e.M(300,60),e.L(300,440),e.stroke()}},Y[8891]={width:600,draw:e=>{e.lineWidth(42),e.M(140,80),e.L(300,440),e.L(460,80),e.stroke(),e.M(140,60),e.L(460,60),e.stroke()}},Y[8892]={width:600,draw:e=>{e.lineWidth(42),e.M(140,420),e.L(300,60),e.L(460,420),e.stroke(),e.M(140,440),e.L(460,440),e.stroke()}},Y[8893]={width:600,draw:e=>{e.lineWidth(42),e.M(140,80),e.L(300,440),e.L(460,80),e.stroke(),e.M(140,60),e.L(460,60),e.stroke()}},Y[8894]={width:600,draw:e=>{e.lineWidth(42),e.M(140,440),e.L(140,80),e.L(460,80),e.stroke(),e.lineWidth(28),e.M(140,300),e.C(250,300,320,200,320,80),e.stroke()}},Y[8896]={width:600,draw:e=>{e.lineWidth(45),e.M(120,60),e.L(300,440),e.L(480,60),e.stroke()}},Y[8897]={width:600,draw:e=>{e.lineWidth(45),e.M(120,440),e.L(300,60),e.L(480,440),e.stroke()}},Y[8898]={width:600,draw:e=>{e.lineWidth(45),e.M(140,60),e.L(140,250),e.C(140,460,460,460,460,250),e.L(460,60),e.stroke()}},Y[8899]={width:600,draw:e=>{e.lineWidth(45),e.M(140,440),e.L(140,250),e.C(140,40,460,40,460,250),e.L(460,440),e.stroke()}},Y[8900]={width:600,draw:e=>{e.lineWidth(38),e.M(300,420),e.L(460,250),e.L(300,80),e.L(140,250),e.Z(),e.stroke()}},Y[8901]={width:600,draw:e=>{e.circle(300,250,35),e.fill()}},Y[8902]={width:600,draw:e=>{for(let t=0;t<5;t++){let n=(t*72-90)*Math.PI/180,r=(t*72+36-90)*Math.PI/180;t===0?e.M(300+140*Math.cos(n),250+140*Math.sin(n)):e.L(300+140*Math.cos(n),250+140*Math.sin(n)),e.L(300+60*Math.cos(r),250+60*Math.sin(r))}e.Z(),e.fill()}},Y[8903]={width:600,draw:e=>{e.lineWidth(40),e.M(160,400),e.L(440,100),e.stroke(),e.M(440,400),e.L(160,100),e.stroke(),e.circle(300,420,28),e.fill(),e.circle(300,80,28),e.fill()}},Y[8904]={width:600,draw:e=>{e.lineWidth(40),e.M(120,400),e.L(300,250),e.L(120,100),e.Z(),e.stroke(),e.M(480,400),e.L(300,250),e.L(480,100),e.Z(),e.stroke()}},Y[8905]={width:600,draw:e=>{e.lineWidth(40),e.M(140,400),e.L(380,250),e.L(140,100),e.Z(),e.stroke(),e.M(380,400),e.L(380,100),e.stroke()}},Y[8906]={width:600,draw:e=>{e.lineWidth(40),e.M(460,400),e.L(220,250),e.L(460,100),e.Z(),e.stroke(),e.M(220,400),e.L(220,100),e.stroke()}},Y[8907]={width:600,draw:e=>{e.lineWidth(40),e.M(140,400),e.L(380,250),e.L(140,100),e.stroke(),e.M(380,400),e.L(380,100),e.stroke()}},Y[8908]={width:600,draw:e=>{e.lineWidth(40),e.M(460,400),e.L(220,250),e.L(460,100),e.stroke(),e.M(220,400),e.L(220,100),e.stroke()}},Y[8909]={width:600,draw:e=>{e.lineWidth(40),e.M(120,220),e.C(200,120,400,380,480,280),e.stroke(),e.M(120,140),e.L(480,140),e.stroke()}},Y[8910]={width:600,draw:e=>{e.lineWidth(42),e.M(120,440),e.C(200,200,260,100,300,60),e.C(340,100,400,200,480,440),e.stroke()}},Y[8911]={width:600,draw:e=>{e.lineWidth(42),e.M(120,60),e.C(200,300,260,400,300,440),e.C(340,400,400,300,480,60),e.stroke()}},Y[8912]={width:600,draw:e=>{e.lineWidth(35),e.M(440,400),e.C(250,400,180,320,180,250),e.C(180,180,250,100,440,100),e.stroke(),e.M(480,400),e.C(290,400,220,320,220,250),e.C(220,180,290,100,480,100),e.stroke()}},Y[8913]={width:600,draw:e=>{e.lineWidth(35),e.M(160,400),e.C(350,400,420,320,420,250),e.C(420,180,350,100,160,100),e.stroke(),e.M(120,400),e.C(310,400,380,320,380,250),e.C(380,180,310,100,120,100),e.stroke()}},Y[8914]={width:600,draw:e=>{e.lineWidth(38),e.M(120,60),e.L(120,230),e.C(120,460,480,460,480,230),e.L(480,60),e.stroke(),e.M(200,60),e.L(200,230),e.C(200,400,400,400,400,230),e.L(400,60),e.stroke()}},Y[8915]={width:600,draw:e=>{e.lineWidth(38),e.M(120,440),e.L(120,270),e.C(120,40,480,40,480,270),e.L(480,440),e.stroke(),e.M(200,440),e.L(200,270),e.C(200,100,400,100,400,270),e.L(400,440),e.stroke()}},Y[8916]={width:600,draw:e=>{e.lineWidth(42),e.M(300,60),e.L(300,440),e.stroke(),e.M(140,60),e.L(140,250),e.C(140,400,460,400,460,250),e.L(460,60),e.stroke()}},Y[8917]={width:600,draw:e=>{e.lineWidth(38),e.M(120,310),e.L(480,310),e.stroke(),e.M(120,200),e.L(480,200),e.stroke(),e.M(200,440),e.L(200,60),e.stroke(),e.M(400,440),e.L(400,60),e.stroke()}},Y[8918]={width:600,draw:e=>{e.lineWidth(42),e.M(460,400),e.L(140,250),e.L(460,100),e.stroke(),e.circle(300,250,30),e.fill()}},Y[8919]={width:600,draw:e=>{e.lineWidth(42),e.M(140,400),e.L(460,250),e.L(140,100),e.stroke(),e.circle(300,250,30),e.fill()}},Y[8920]={width:600,draw:e=>{e.lineWidth(35);for(let t of[160,280,400])e.M(t+80,400),e.L(t,250),e.L(t+80,100),e.stroke()}},Y[8921]={width:600,draw:e=>{e.lineWidth(35);for(let t of[440,320,200])e.M(t-80,400),e.L(t,250),e.L(t-80,100),e.stroke()}},Y[8922]={width:600,draw:e=>{e.lineWidth(36),e.M(460,460),e.L(140,370),e.L(460,280),e.stroke(),e.M(140,240),e.L(460,240),e.stroke(),e.M(140,200),e.L(460,110),e.L(140,40),e.stroke()}},Y[8923]={width:600,draw:e=>{e.lineWidth(36),e.M(140,460),e.L(460,370),e.L(140,280),e.stroke(),e.M(140,240),e.L(460,240),e.stroke(),e.M(460,200),e.L(140,110),e.L(460,40),e.stroke()}},Y[8924]={width:600,draw:e=>{e.lineWidth(40),e.M(460,420),e.L(140,260),e.L(460,100),e.stroke(),e.M(140,440),e.L(460,440),e.stroke()}},Y[8925]={width:600,draw:e=>{e.lineWidth(40),e.M(140,420),e.L(460,260),e.L(140,100),e.stroke(),e.M(140,440),e.L(460,440),e.stroke()}},Y[8926]={width:600,draw:e=>{e.lineWidth(38),e.M(460,420),e.C(200,420,140,320,140,280),e.C(140,240,200,140,460,140),e.stroke(),e.M(140,80),e.L(460,80),e.stroke()}},Y[8927]={width:600,draw:e=>{e.lineWidth(38),e.M(140,420),e.C(400,420,460,320,460,280),e.C(460,240,400,140,140,140),e.stroke(),e.M(140,80),e.L(460,80),e.stroke()}},Y[8928]={width:600,draw:e=>{Y[8926].draw(e),X(e)}},Y[8929]={width:600,draw:e=>{Y[8927].draw(e),X(e)}},Y[8930]={width:600,draw:e=>{Y[8849].draw(e),X(e)}},Y[8931]={width:600,draw:e=>{Y[8850].draw(e),X(e)}},Y[8932]={width:600,draw:e=>{Y[8849].draw(e),X(e)}},Y[8933]={width:600,draw:e=>{Y[8850].draw(e),X(e)}},Y[8934]={width:600,draw:e=>{Y[8818].draw(e),X(e)}},Y[8935]={width:600,draw:e=>{Y[8819].draw(e),X(e)}},Y[8936]={width:600,draw:e=>{Y[8830].draw(e),X(e)}},Y[8937]={width:600,draw:e=>{Y[8831].draw(e),X(e)}},Y[8938]={width:600,draw:e=>{Y[8882].draw(e),X(e)}},Y[8939]={width:600,draw:e=>{Y[8883].draw(e),X(e)}},Y[8940]={width:600,draw:e=>{Y[8884].draw(e),X(e)}},Y[8941]={width:600,draw:e=>{Y[8885].draw(e),X(e)}},Y[8942]={width:600,draw:e=>{e.circle(300,380,28),e.fill(),e.circle(300,250,28),e.fill(),e.circle(300,120,28),e.fill()}},Y[8943]={width:600,draw:e=>{e.circle(150,250,28),e.fill(),e.circle(300,250,28),e.fill(),e.circle(450,250,28),e.fill()}},Y[8944]={width:600,draw:e=>{e.circle(170,120,28),e.fill(),e.circle(300,250,28),e.fill(),e.circle(430,380,28),e.fill()}},Y[8945]={width:600,draw:e=>{e.circle(170,380,28),e.fill(),e.circle(300,250,28),e.fill(),e.circle(430,120,28),e.fill()}};for(let e=8946;e<=8959;e++)if(!Y[e]){let t=(e-8946)%2==0;Y[e]={width:600,draw:e=>{e.lineWidth(40),t?(e.M(440,400),e.C(200,430,140,340,140,250),e.C(140,160,200,70,440,100),e.stroke(),e.M(140,250),e.L(400,250),e.stroke()):(e.M(160,400),e.C(400,430,460,340,460,250),e.C(460,160,400,70,160,100),e.stroke(),e.M(460,250),e.L(200,250),e.stroke())}}}let Z={};function MC(e,t=18){return{width:600,draw:n=>{n.lineWidth(28),e(n,300-t/2,250,280),e(n,300+t/2,250,280)}}}function NC(e){return{width:600,draw:t=>{t.lineWidth(26),e(t,300,250,300)}}}function PC(e){return{width:600,draw:t=>{t.lineWidth(36),e(t,300,250,300)}}}Z[8448]={width:600,draw:e=>{e.lineWidth(24),J(e,0,190,340,150),J(e,2,410,160,150),e.lineWidth(30),e.M(380,450),e.L(220,50),e.stroke()}},Z[8449]={width:600,draw:e=>{e.lineWidth(24),J(e,0,190,340,150),J(e,18,410,160,150),e.lineWidth(30),e.M(380,450),e.L(220,50),e.stroke()}},Z[8450]=MC((e,t,n,r)=>{e.M(t+r*.3,n+r*.35),e.C(t+r*.1,n+r*.55,t-r*.35,n+r*.35,t-r*.35,n),e.C(t-r*.35,n-r*.35,t+r*.1,n-r*.55,t+r*.3,n-r*.35),e.stroke()}),Z[8452]={width:600,draw:e=>{e.lineWidth(40),e.M(200,440),e.L(300,250),e.L(400,440),e.stroke(),e.M(300,250),e.L(300,60),e.stroke()}},Z[8454]={width:600,draw:e=>{e.lineWidth(24),J(e,2,190,340,150),J(e,20,410,160,150),e.lineWidth(30),e.M(380,450),e.L(220,50),e.stroke()}},Z[8455]={width:600,draw:e=>{e.lineWidth(42),e.M(180,440),e.L(420,440),e.L(420,60),e.L(180,60),e.stroke(),e.M(420,250),e.L(220,250),e.stroke()}},Z[8458]={width:600,draw:e=>{e.lineWidth(30),e.ellipse(280,280,120,100),e.stroke(),e.M(400,380),e.L(400,80),e.C(400,20,300,20,240,60),e.stroke()}},Z[8459]=NC((e,t,n,r)=>{e.M(t-r*.3,n-r*.5),e.L(t-r*.3,n+r*.5),e.stroke(),e.M(t+r*.3,n+r*.5),e.L(t+r*.3,n-r*.5),e.stroke(),e.M(t-r*.3,n),e.C(t-r*.1,n+r*.15,t+r*.1,n-r*.15,t+r*.3,n),e.stroke()}),Z[8460]=PC((e,t,n,r)=>{e.M(t-r*.3,n-r*.5),e.L(t-r*.3,n+r*.5),e.stroke(),e.M(t+r*.3,n+r*.5),e.L(t+r*.3,n-r*.5),e.stroke(),e.M(t-r*.3,n),e.L(t+r*.3,n),e.stroke()}),Z[8461]=MC((e,t,n,r)=>{e.M(t-r*.3,n+r*.5),e.L(t-r*.3,n-r*.5),e.stroke(),e.M(t+r*.3,n+r*.5),e.L(t+r*.3,n-r*.5),e.stroke(),e.M(t-r*.3,n),e.L(t+r*.3,n),e.stroke()}),Z[8462]={width:600,draw:e=>{e.lineWidth(35),e.M(220,60),e.L(200,450),e.stroke(),e.M(200,300),e.C(280,400,380,400,400,300),e.L(420,60),e.stroke()}},Z[8463]={width:600,draw:e=>{e.lineWidth(35),e.M(220,60),e.L(200,450),e.stroke(),e.M(200,300),e.C(280,400,380,400,400,300),e.L(420,60),e.stroke(),e.M(140,370),e.L(280,370),e.stroke()}},Z[8464]=NC((e,t,n,r)=>{e.M(t,n+r*.5),e.L(t,n-r*.5),e.stroke(),e.M(t-r*.2,n+r*.5),e.L(t+r*.2,n+r*.5),e.stroke(),e.M(t-r*.2,n-r*.5),e.L(t+r*.2,n-r*.5),e.stroke()}),Z[8465]=PC((e,t,n,r)=>{e.M(t,n+r*.5),e.L(t,n-r*.5),e.stroke(),e.M(t-r*.25,n+r*.5),e.L(t+r*.25,n+r*.5),e.stroke(),e.M(t-r*.25,n-r*.5),e.L(t+r*.25,n-r*.5),e.stroke()}),Z[8466]=NC((e,t,n,r)=>{e.M(t-r*.25,n+r*.5),e.L(t-r*.25,n-r*.5),e.C(t-r*.25,n-r*.55,t+r*.3,n-r*.55,t+r*.3,n-r*.5),e.stroke()}),Z[8468]={width:600,draw:e=>{e.lineWidth(30),J(e,11,200,250,260),J(e,1,400,250,260),e.lineWidth(28),e.M(120,100),e.L(480,100),e.stroke()}},Z[8469]=MC((e,t,n,r)=>{e.M(t-r*.3,n-r*.5),e.L(t-r*.3,n+r*.5),e.L(t+r*.3,n-r*.5),e.L(t+r*.3,n+r*.5),e.stroke()}),Z[8471]={width:600,draw:e=>{e.lineWidth(30),e.circle(300,250,220),e.stroke(),e.lineWidth(28),J(e,15,300,250,200)}},Z[8472]={width:600,draw:e=>{e.lineWidth(38),e.M(200,60),e.L(200,350),e.C(200,450,350,450,400,350),e.C(450,250,350,180,280,200),e.C(210,220,180,300,200,350),e.stroke()}},Z[8473]=MC((e,t,n,r)=>{e.M(t-r*.25,n-r*.5),e.L(t-r*.25,n+r*.5),e.L(t+r*.1,n+r*.5),e.C(t+r*.4,n+r*.5,t+r*.4,n+r*.05,t+r*.1,n+r*.05),e.L(t-r*.25,n+r*.05),e.stroke()}),Z[8474]=MC((e,t,n,r)=>{e.ellipse(t,n+r*.05,r*.35,r*.45),e.stroke(),e.M(t+r*.1,n-r*.2),e.L(t+r*.35,n-r*.5),e.stroke()}),Z[8475]=NC((e,t,n,r)=>{e.M(t-r*.25,n-r*.5),e.L(t-r*.25,n+r*.5),e.L(t+r*.1,n+r*.5),e.C(t+r*.4,n+r*.5,t+r*.4,n+r*.05,t+r*.1,n+r*.05),e.L(t-r*.25,n+r*.05),e.stroke(),e.M(t+r*.05,n+r*.05),e.L(t+r*.3,n-r*.5),e.stroke()}),Z[8476]=PC((e,t,n,r)=>{e.M(t-r*.25,n-r*.5),e.L(t-r*.25,n+r*.5),e.L(t+r*.1,n+r*.5),e.C(t+r*.4,n+r*.5,t+r*.4,n+r*.05,t+r*.1,n+r*.05),e.L(t-r*.25,n+r*.05),e.stroke(),e.M(t+r*.05,n+r*.05),e.L(t+r*.3,n-r*.5),e.stroke()}),Z[8477]=MC((e,t,n,r)=>{e.M(t-r*.25,n-r*.5),e.L(t-r*.25,n+r*.5),e.L(t+r*.1,n+r*.5),e.C(t+r*.4,n+r*.5,t+r*.4,n+r*.05,t+r*.1,n+r*.05),e.L(t-r*.25,n+r*.05),e.stroke(),e.M(t+r*.05,n+r*.05),e.L(t+r*.3,n-r*.5),e.stroke()}),Z[8478]={width:600,draw:e=>{e.lineWidth(38),J(e,17,250,260,300),e.lineWidth(32),e.M(350,200),e.L(480,60),e.stroke()}},Z[8479]={width:600,draw:e=>{e.lineWidth(38),J(e,17,300,250,300)}},Z[8481]={width:600,draw:e=>{e.lineWidth(22),J(e,19,150,250,180),J(e,4,300,250,180),J(e,11,450,250,180)}},Z[8484]=MC((e,t,n,r)=>{e.M(t-r*.3,n+r*.5),e.L(t+r*.3,n+r*.5),e.L(t-r*.3,n-r*.5),e.L(t+r*.3,n-r*.5),e.stroke()}),Z[8485]={width:600,draw:e=>{e.lineWidth(36),e.M(200,440),e.L(400,440),e.L(200,60),e.L(400,60),e.stroke(),e.M(180,250),e.L(420,250),e.stroke()}},Z[8487]={width:600,draw:e=>{e.lineWidth(42),e.M(140,440),e.L(200,440),e.L(200,350),e.C(200,150,400,150,400,350),e.L(400,440),e.L(460,440),e.stroke()}},Z[8488]=PC((e,t,n,r)=>{e.M(t-r*.3,n+r*.5),e.L(t+r*.3,n+r*.5),e.L(t-r*.3,n-r*.5),e.L(t+r*.3,n-r*.5),e.stroke()}),Z[8489]={width:600,draw:e=>{e.lineWidth(38),e.M(300,440),e.L(300,160),e.C(300,60,220,60,220,120),e.stroke()}},Z[8490]={width:600,draw:e=>{e.lineWidth(40),J(e,10,300,250,300)}},Z[8491]={width:600,draw:e=>{e.lineWidth(38),J(e,0,300,220,280),e.lineWidth(22),e.circle(300,440,30),e.stroke()}},Z[8492]=NC((e,t,n,r)=>{e.M(t-r*.25,n-r*.5),e.L(t-r*.25,n+r*.5),e.L(t+r*.1,n+r*.5),e.C(t+r*.35,n+r*.5,t+r*.35,n+r*.05,t+r*.05,n+r*.05),e.L(t+r*.1,n+r*.05),e.C(t+r*.4,n+r*.05,t+r*.4,n-r*.5,t+r*.1,n-r*.5),e.Z(),e.stroke()}),Z[8493]=PC((e,t,n,r)=>{e.M(t+r*.3,n+r*.35),e.C(t+r*.1,n+r*.55,t-r*.35,n+r*.35,t-r*.35,n),e.C(t-r*.35,n-r*.35,t+r*.1,n-r*.55,t+r*.3,n-r*.35),e.stroke()}),Z[8495]={width:600,draw:e=>{e.lineWidth(30),e.M(420,250),e.L(180,250),e.C(180,400,300,450,400,380),e.stroke(),e.M(180,250),e.C(180,100,300,50,420,120),e.stroke()}},Z[8496]=NC((e,t,n,r)=>{e.M(t+r*.25,n+r*.5),e.L(t-r*.25,n+r*.5),e.L(t-r*.25,n-r*.5),e.L(t+r*.25,n-r*.5),e.stroke(),e.M(t-r*.25,n),e.L(t+r*.15,n),e.stroke()}),Z[8497]=NC((e,t,n,r)=>{e.M(t+r*.25,n+r*.5),e.L(t-r*.25,n+r*.5),e.L(t-r*.25,n-r*.5),e.stroke(),e.M(t-r*.25,n+r*.05),e.L(t+r*.15,n+r*.05),e.stroke()}),Z[8498]={width:600,draw:e=>{e.lineWidth(42),e.M(180,60),e.L(420,60),e.L(420,440),e.stroke(),e.M(420,250),e.L(220,250),e.stroke()}},Z[8499]=NC((e,t,n,r)=>{e.M(t-r*.35,n-r*.5),e.L(t-r*.35,n+r*.5),e.L(t,n),e.L(t+r*.35,n+r*.5),e.L(t+r*.35,n-r*.5),e.stroke()}),Z[8500]={width:600,draw:e=>{e.lineWidth(30),e.ellipse(300,250,150,180),e.stroke()}},Z[8501]={width:600,draw:e=>{e.lineWidth(42),e.M(200,60),e.C(250,200,350,300,400,440),e.stroke(),e.M(180,440),e.L(250,300),e.stroke(),e.M(420,60),e.L(350,200),e.stroke()}},Z[8502]={width:600,draw:e=>{e.lineWidth(42),e.M(160,440),e.L(440,440),e.L(440,60),e.C(440,60,300,80,200,160),e.stroke()}},Z[8503]={width:600,draw:e=>{e.lineWidth(42),e.M(350,440),e.L(350,160),e.C(350,60,250,60,200,100),e.stroke(),e.M(350,300),e.L(250,60),e.stroke()}},Z[8504]={width:600,draw:e=>{e.lineWidth(42),e.M(180,440),e.L(420,440),e.L(420,60),e.stroke()}},Z[8508]={width:600,draw:e=>{e.lineWidth(30),e.M(140,380),e.L(460,380),e.stroke(),e.M(230,380),e.L(230,60),e.stroke(),e.M(370,380),e.L(370,60),e.stroke(),e.M(248,380),e.L(248,60),e.stroke(),e.M(388,380),e.L(388,60),e.stroke()}},Z[8509]={width:600,draw:e=>{e.lineWidth(30),e.M(160,440),e.L(300,150),e.L(440,440),e.stroke(),e.M(300,150),e.L(300,60),e.stroke(),e.M(170,440),e.L(310,150),e.stroke()}},Z[8510]={width:600,draw:e=>{e.lineWidth(30),e.M(180,60),e.L(180,440),e.L(420,440),e.stroke(),e.M(198,60),e.L(198,440),e.stroke()}},Z[8511]={width:600,draw:e=>{e.lineWidth(30),e.M(140,440),e.L(460,440),e.stroke(),e.M(200,440),e.L(200,60),e.stroke(),e.M(218,440),e.L(218,60),e.stroke(),e.M(400,440),e.L(400,60),e.stroke(),e.M(418,440),e.L(418,60),e.stroke()}},Z[8512]={width:600,draw:e=>{e.lineWidth(30),e.M(440,440),e.L(160,440),e.L(300,250),e.L(160,60),e.L(440,60),e.stroke(),e.M(450,440),e.L(170,440),e.L(310,250),e.L(170,60),e.L(450,60),e.stroke()}},Z[8513]={width:600,draw:e=>{e.lineWidth(42),e.M(200,100),e.C(280,40,460,100,460,250),e.C(460,400,280,460,200,400),e.L(200,270),e.L(350,270),e.stroke()}},Z[8514]={width:600,draw:e=>{e.lineWidth(42),e.M(400,60),e.L(400,440),e.L(200,440),e.stroke()}},Z[8515]={width:600,draw:e=>{e.lineWidth(42),e.M(400,440),e.L(400,60),e.L(200,60),e.stroke()}},Z[8516]={width:600,draw:e=>{e.lineWidth(42),e.M(180,440),e.L(300,250),e.L(420,440),e.stroke(),e.M(300,250),e.L(300,60),e.stroke()}},Z[8517]=MC((e,t,n,r)=>{e.M(t-r*.25,n-r*.5),e.L(t-r*.25,n+r*.5),e.L(t,n+r*.5),e.C(t+r*.4,n+r*.5,t+r*.4,n-r*.5,t,n-r*.5),e.Z(),e.stroke()}),Z[8518]={width:600,draw:e=>{e.lineWidth(28),e.ellipse(270,200,110,130),e.stroke(),e.M(380,60),e.L(380,440),e.stroke(),e.M(398,60),e.L(398,440),e.stroke()}},Z[8519]={width:600,draw:e=>{e.lineWidth(28),e.M(420,250),e.L(180,250),e.C(180,400,300,450,400,380),e.stroke(),e.M(180,250),e.C(180,100,300,50,420,120),e.stroke(),e.M(430,260),e.L(190,260),e.stroke()}},Z[8520]={width:600,draw:e=>{e.lineWidth(30),e.M(300,340),e.L(300,60),e.stroke(),e.M(318,340),e.L(318,60),e.stroke(),e.circle(309,400,25),e.fill()}},Z[8521]={width:600,draw:e=>{e.lineWidth(30),e.M(320,340),e.L(320,120),e.C(320,60,260,60,220,80),e.stroke(),e.M(338,340),e.L(338,120),e.stroke(),e.circle(329,400,25),e.fill()}},Z[8522]={width:600,draw:e=>{e.lineWidth(42),e.M(120,320),e.L(480,320),e.stroke(),e.M(120,180),e.L(480,180),e.stroke(),e.M(300,440),e.L(300,60),e.stroke()}},Z[8523]={width:600,draw:e=>{e.lineWidth(38),e.M(420,60),e.L(180,320),e.C(140,370,160,440,220,440),e.C(320,440,360,380,300,300),e.L(160,180),e.C(120,130,160,60,260,60),e.C(360,60,380,130,340,180),e.stroke()}},Z[8524]={width:600,draw:e=>{e.lineWidth(38),e.M(440,440),e.L(160,60),e.stroke(),e.circle(200,360,50),e.stroke(),e.circle(400,140,50),e.stroke()}},Z[8525]={width:600,draw:e=>{e.lineWidth(34),J(e,0,200,250,260),J(e,18,400,250,260)}},Z[8526]={width:600,draw:e=>{e.lineWidth(38),e.M(380,440),e.L(220,440),e.L(220,60),e.stroke(),e.M(220,250),e.L(380,250),e.stroke()}},Z[8527]={width:600,draw:e=>{e.lineWidth(38),e.M(200,60),e.L(200,440),e.L(400,440),e.L(400,60),e.stroke(),e.M(200,250),e.L(400,250),e.stroke()}};let FC={};FC[8364]={width:600,draw:e=>{e.lineWidth(40),e.M(460,400),e.C(400,470,220,470,180,370),e.C(140,270,140,180,180,120),e.C(220,40,400,40,460,100),e.stroke(),e.M(120,300),e.L(400,300),e.stroke(),e.M(120,210),e.L(400,210),e.stroke()}},FC[8365]={width:600,draw:e=>{e.lineWidth(40),J(e,10,300,250,300),e.M(140,250),e.L(460,250),e.stroke()}},FC[8367]={width:600,draw:e=>{e.lineWidth(38),J(e,3,300,250,300),e.M(400,470),e.L(400,30),e.stroke()}},FC[8368]={width:600,draw:e=>{e.lineWidth(38),J(e,3,300,250,300),e.lineWidth(22),e.circle(420,400,30),e.stroke()}},FC[8373]={width:600,draw:e=>{e.lineWidth(40),e.M(420,400),e.C(380,470,220,470,180,370),e.C(140,270,140,180,180,120),e.C(220,40,380,40,420,100),e.stroke(),e.M(300,490),e.L(300,10),e.stroke()}},FC[8375]={width:600,draw:e=>{e.lineWidth(38),J(e,18,300,250,300),e.M(140,300),e.L(460,300),e.stroke()}},FC[8379]={width:600,draw:e=>{e.lineWidth(38),J(e,12,300,250,300),e.M(120,60),e.L(480,60),e.stroke()}},FC[8380]={width:600,draw:e=>{e.lineWidth(38),e.M(180,60),e.L(180,350),e.C(180,460,420,460,420,350),e.L(420,60),e.stroke(),e.M(120,250),e.L(480,250),e.stroke()}},FC[8382]={width:600,draw:e=>{e.lineWidth(40),e.M(400,440),e.C(400,440,200,400,200,250),e.C(200,100,400,60,400,60),e.stroke(),e.M(140,250),e.L(460,250),e.stroke()}},FC[8383]={width:600,draw:e=>{e.lineWidth(38),J(e,1,300,250,290),e.M(260,480),e.L(260,20),e.stroke(),e.M(340,480),e.L(340,20),e.stroke()}};for(let e=8384;e<=8399;e++)FC[e]={width:600,draw:e=>{e.lineWidth(35),e.circle(300,250,180),e.stroke(),e.M(160,280),e.L(440,280),e.stroke(),e.M(160,220),e.L(440,220),e.stroke()}};let Q={};Q[8604]={width:600,draw:e=>{e.lineWidth(38),e.M(480,250),e.C(420,330,340,170,280,250),e.C(220,330,160,250,160,250),e.stroke(),e.M(80,250),e.L(180,350),e.L(180,150),e.Z(),e.fill()}},Q[8610]={width:600,draw:e=>{e.lineWidth(40),e.M(480,250),e.L(180,250),e.stroke(),e.M(100,250),e.L(200,350),e.L(200,150),e.Z(),e.fill(),e.lineWidth(30),e.M(480,250),e.L(520,350),e.stroke()}},Q[8611]={width:600,draw:e=>{e.lineWidth(40),e.M(120,250),e.L(420,250),e.stroke(),e.M(500,250),e.L(400,350),e.L(400,150),e.Z(),e.fill(),e.lineWidth(30),e.M(120,250),e.L(80,350),e.stroke()}},Q[8616]={width:600,draw:e=>{e.lineWidth(38),e.M(300,440),e.L(300,120),e.stroke(),e.M(300,470),e.L(200,370),e.L(400,370),e.Z(),e.fill(),e.M(300,60),e.L(200,160),e.L(400,160),e.Z(),e.fill(),e.M(180,30),e.L(420,30),e.stroke()}},Q[8619]={width:600,draw:e=>{e.lineWidth(38),e.M(480,250),e.L(200,250),e.stroke(),e.M(100,250),e.L(200,350),e.L(200,150),e.Z(),e.fill(),e.lineWidth(30),e.M(480,250),e.C(520,250,520,150,480,150),e.C(440,150,440,250,480,250),e.stroke()}},Q[8620]={width:600,draw:e=>{e.lineWidth(38),e.M(120,250),e.L(400,250),e.stroke(),e.M(500,250),e.L(400,350),e.L(400,150),e.Z(),e.fill(),e.lineWidth(30),e.M(120,250),e.C(80,250,80,150,120,150),e.C(160,150,160,250,120,250),e.stroke()}},Q[8621]={width:600,draw:e=>{e.lineWidth(35),e.M(140,250),e.C(200,350,300,150,360,250),e.L(460,250),e.stroke(),e.M(100,250),e.L(170,330),e.L(170,170),e.Z(),e.fill(),e.M(500,250),e.L(430,330),e.L(430,170),e.Z(),e.fill()}},Q[8622]={width:600,draw:e=>{e.lineWidth(38),e.M(150,250),e.L(450,250),e.stroke(),e.M(100,250),e.L(180,340),e.L(180,160),e.Z(),e.fill(),e.M(500,250),e.L(420,340),e.L(420,160),e.Z(),e.fill(),X(e)}},Q[8623]={width:600,draw:e=>{e.lineWidth(38),e.M(300,470),e.L(400,380),e.L(200,260),e.L(400,140),e.L(300,60),e.stroke(),e.M(300,30),e.L(220,120),e.L(380,120),e.Z(),e.fill()}},Q[8628]={width:600,draw:e=>{e.lineWidth(40),e.M(120,400),e.L(400,400),e.L(400,120),e.stroke(),e.M(400,60),e.L(320,160),e.L(480,160),e.Z(),e.fill()}},Q[8630]={width:600,draw:e=>{e.lineWidth(38),e.M(460,250),e.C(460,420,140,420,140,250),e.stroke(),e.M(100,250),e.L(180,330),e.L(180,170),e.Z(),e.fill()}},Q[8631]={width:600,draw:e=>{e.lineWidth(38),e.M(140,250),e.C(140,420,460,420,460,250),e.stroke(),e.M(500,250),e.L(420,330),e.L(420,170),e.Z(),e.fill()}},Q[8632]={width:600,draw:e=>{e.lineWidth(38),e.M(400,100),e.L(180,350),e.stroke(),e.M(140,400),e.L(230,310),e.L(140,310),e.Z(),e.fill(),e.M(120,440),e.L(480,440),e.stroke()}},Q[8633]={width:600,draw:e=>{e.lineWidth(32),e.M(460,340),e.L(180,340),e.stroke(),e.M(120,340),e.L(200,390),e.L(200,290),e.Z(),e.fill(),e.M(140,160),e.L(420,160),e.stroke(),e.M(480,160),e.L(400,210),e.L(400,110),e.Z(),e.fill(),e.M(120,380),e.L(120,300),e.stroke(),e.M(480,200),e.L(480,120),e.stroke()}},Q[8683]={width:600,draw:e=>{e.lineWidth(38),e.M(300,130),e.L(300,380),e.stroke(),e.M(300,470),e.L(180,330),e.L(420,330),e.Z(),e.stroke(),e.M(200,60),e.L(400,60),e.stroke(),e.M(300,60),e.L(300,130),e.stroke()}},Q[8684]={width:600,draw:e=>{e.lineWidth(35),e.M(300,160),e.L(300,400),e.stroke(),e.M(300,470),e.L(180,350),e.L(420,350),e.Z(),e.stroke(),e.M(200,60),e.L(400,60),e.stroke(),e.M(200,110),e.L(400,110),e.stroke(),e.M(300,60),e.L(300,160),e.stroke()}},Q[8685]={width:600,draw:e=>{e.lineWidth(35),e.M(300,130),e.L(300,380),e.stroke(),e.M(300,470),e.L(180,350),e.L(420,350),e.Z(),e.stroke(),e.M(200,60),e.L(400,60),e.stroke(),e.M(300,60),e.L(300,130),e.stroke(),e.M(200,40),e.L(200,80),e.stroke(),e.M(400,40),e.L(400,80),e.stroke()}},Q[8686]={width:600,draw:e=>{e.lineWidth(38),e.M(300,60),e.L(300,400),e.stroke(),e.M(300,470),e.L(180,350),e.L(420,350),e.Z(),e.stroke(),e.M(300,370),e.L(200,270),e.L(400,270),e.Z(),e.stroke()}},Q[8687]={width:600,draw:e=>{e.lineWidth(35),e.M(300,130),e.L(300,400),e.stroke(),e.M(300,470),e.L(180,370),e.L(420,370),e.Z(),e.stroke(),e.M(300,350),e.L(200,270),e.L(400,270),e.Z(),e.stroke(),e.M(200,60),e.L(400,60),e.stroke(),e.M(300,60),e.L(300,130),e.stroke()}},Q[8688]={width:600,draw:e=>{e.lineWidth(38),e.M(120,250),e.L(380,250),e.stroke(),e.M(480,250),e.L(360,370),e.L(360,130),e.Z(),e.stroke(),e.M(100,420),e.L(100,80),e.stroke()}},Q[8689]={width:600,draw:e=>{e.lineWidth(38),e.M(420,100),e.L(180,380),e.stroke(),e.M(140,420),e.L(220,340),e.L(140,340),e.Z(),e.fill(),e.M(120,460),e.L(120,420),e.L(480,420),e.stroke()}},Q[8690]={width:600,draw:e=>{e.lineWidth(38),e.M(180,400),e.L(420,120),e.stroke(),e.M(460,80),e.L(380,160),e.L(460,160),e.Z(),e.fill(),e.M(120,80),e.L(480,80),e.L(480,40),e.stroke()}},Q[8691]={width:600,draw:e=>{e.lineWidth(38),e.M(300,130),e.L(300,370),e.stroke(),e.M(300,470),e.L(190,350),e.L(410,350),e.Z(),e.stroke(),e.M(300,30),e.L(190,150),e.L(410,150),e.Z(),e.stroke()}},Q[8692]={width:600,draw:e=>{e.lineWidth(38),e.M(170,250),e.L(420,250),e.stroke(),e.M(500,250),e.L(400,350),e.L(400,150),e.Z(),e.fill(),e.lineWidth(25),e.circle(130,250,35),e.stroke()}},Q[8694]={width:600,draw:e=>{e.lineWidth(28);for(let t of[370,250,130])e.M(100,t),e.L(400,t),e.stroke(),e.M(480,t),e.L(400,t+50),e.L(400,t-50),e.Z(),e.fill()}},Q[8695]={width:600,draw:e=>{e.lineWidth(38),e.M(480,250),e.L(180,250),e.stroke(),e.M(100,250),e.L(200,350),e.L(200,150),e.Z(),e.fill(),e.M(330,370),e.L(330,130),e.stroke()}},Q[8696]={width:600,draw:e=>{e.lineWidth(38),e.M(120,250),e.L(420,250),e.stroke(),e.M(500,250),e.L(400,350),e.L(400,150),e.Z(),e.fill(),e.M(270,370),e.L(270,130),e.stroke()}},Q[8697]={width:600,draw:e=>{e.lineWidth(35),e.M(160,250),e.L(440,250),e.stroke(),e.M(100,250),e.L(180,330),e.L(180,170),e.Z(),e.fill(),e.M(500,250),e.L(420,330),e.L(420,170),e.Z(),e.fill(),e.M(300,370),e.L(300,130),e.stroke()}},Q[8698]={width:600,draw:e=>{e.lineWidth(35),e.M(480,250),e.L(180,250),e.stroke(),e.M(100,250),e.L(200,340),e.L(200,160),e.Z(),e.fill(),e.M(310,370),e.L(310,130),e.stroke(),e.M(350,370),e.L(350,130),e.stroke()}},Q[8699]={width:600,draw:e=>{e.lineWidth(35),e.M(120,250),e.L(420,250),e.stroke(),e.M(500,250),e.L(400,340),e.L(400,160),e.Z(),e.fill(),e.M(250,370),e.L(250,130),e.stroke(),e.M(290,370),e.L(290,130),e.stroke()}},Q[8700]={width:600,draw:e=>{e.lineWidth(32),e.M(160,250),e.L(440,250),e.stroke(),e.M(100,250),e.L(180,330),e.L(180,170),e.Z(),e.fill(),e.M(500,250),e.L(420,330),e.L(420,170),e.Z(),e.fill(),e.M(285,370),e.L(285,130),e.stroke(),e.M(315,370),e.L(315,130),e.stroke()}},Q[8701]={width:600,draw:e=>{e.lineWidth(40),e.M(480,250),e.L(140,250),e.stroke(),e.M(80,250),e.L(200,370),e.stroke(),e.M(80,250),e.L(200,130),e.stroke()}},Q[8702]={width:600,draw:e=>{e.lineWidth(40),e.M(120,250),e.L(460,250),e.stroke(),e.M(520,250),e.L(400,370),e.stroke(),e.M(520,250),e.L(400,130),e.stroke()}},Q[8703]={width:600,draw:e=>{e.lineWidth(38),e.M(140,250),e.L(460,250),e.stroke(),e.M(80,250),e.L(180,350),e.stroke(),e.M(80,250),e.L(180,150),e.stroke(),e.M(520,250),e.L(420,350),e.stroke(),e.M(520,250),e.L(420,150),e.stroke()}};function IC(e,t,n,r){return{width:600,draw:i=>{i.rect(e,t,n,r),i.fill()}}}function LC(e,t,n,r,i=50){return{width:600,draw:a=>{a.lineWidth(i),a.rect(e,t,n,r),a.stroke()}}}function RC(e,t,n){return{width:600,draw:r=>{r.circle(e,t,n),r.fill()}}}function zC(e,t,n,r=50){return{width:600,draw:i=>{i.lineWidth(r),i.circle(e,t,n),i.stroke()}}}let BC=LC(80,0,440,700,40),VC=[{9632:IC(100,50,400,400),9633:LC(100,50,400,400),9634:{width:600,draw:e=>{e.lineWidth(50),e.M(150,50),e.L(450,50),e.C(480,50,500,70,500,100),e.L(500,400),e.C(500,430,480,450,450,450),e.L(150,450),e.C(120,450,100,430,100,400),e.L(100,100),e.C(100,70,120,50,150,50),e.Z(),e.stroke()}},9635:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.rect(200,150,200,200),e.fill()}},9636:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.lineWidth(30);for(let t=100;t<=400;t+=80)e.M(100,t),e.L(500,t);e.stroke()}},9637:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.lineWidth(30);for(let t=150;t<=450;t+=80)e.M(t,50),e.L(t,450);e.stroke()}},9638:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.lineWidth(20);for(let t=100;t<=400;t+=80)e.M(100,t),e.L(500,t);for(let t=150;t<=450;t+=80)e.M(t,50),e.L(t,450);e.stroke()}},9640:{width:600,draw:e=>{e.lineWidth(40),e.rect(100,50,400,400),e.stroke(),e.lineWidth(20);for(let t=-400;t<=400;t+=80)e.M(Math.max(100,100+t),Math.min(450,450+t)),e.L(Math.min(500,500+t),Math.max(50,50+t));e.stroke()}},9642:IC(175,125,250,250),9643:LC(175,125,250,250,40),9644:IC(80,150,440,200),9645:LC(80,150,440,200),9646:IC(175,0,250,500),9647:LC(175,0,250,500),9648:{width:600,draw:e=>{e.M(150,100),e.L(520,100),e.L(450,400),e.L(80,400),e.Z(),e.fill()}},9650:{width:600,draw:e=>{e.M(300,500),e.L(500,50),e.L(100,50),e.Z(),e.fill()}},9651:{width:600,draw:e=>{e.lineWidth(40),e.M(300,500),e.L(500,50),e.L(100,50),e.Z(),e.stroke()}},9652:{width:600,draw:e=>{e.M(300,450),e.L(450,100),e.L(150,100),e.Z(),e.fill()}},9653:{width:600,draw:e=>{e.lineWidth(35),e.M(300,450),e.L(450,100),e.L(150,100),e.Z(),e.stroke()}},9654:{width:600,draw:e=>{e.M(100,500),e.L(500,250),e.L(100,0),e.Z(),e.fill()}},9655:{width:600,draw:e=>{e.lineWidth(40),e.M(100,500),e.L(500,250),e.L(100,0),e.Z(),e.stroke()}},9656:{width:600,draw:e=>{e.M(150,450),e.L(450,250),e.L(150,50),e.Z(),e.fill()}},9660:{width:600,draw:e=>{e.M(100,500),e.L(500,500),e.L(300,50),e.Z(),e.fill()}},9661:{width:600,draw:e=>{e.lineWidth(40),e.M(100,500),e.L(500,500),e.L(300,50),e.Z(),e.stroke()}},9662:{width:600,draw:e=>{e.M(150,400),e.L(450,400),e.L(300,100),e.Z(),e.fill()}},9664:{width:600,draw:e=>{e.M(500,500),e.L(100,250),e.L(500,0),e.Z(),e.fill()}},9665:{width:600,draw:e=>{e.lineWidth(40),e.M(500,500),e.L(100,250),e.L(500,0),e.Z(),e.stroke()}},9666:{width:600,draw:e=>{e.M(450,450),e.L(150,250),e.L(450,50),e.Z(),e.fill()}},9670:{width:600,draw:e=>{e.M(300,500),e.L(530,250),e.L(300,0),e.L(70,250),e.Z(),e.fill()}},9671:{width:600,draw:e=>{e.lineWidth(40),e.M(300,500),e.L(530,250),e.L(300,0),e.L(70,250),e.Z(),e.stroke()}},9672:{width:600,draw:e=>{e.lineWidth(40),e.M(300,500),e.L(530,250),e.L(300,0),e.L(70,250),e.Z(),e.stroke(),e.M(300,380),e.L(410,250),e.L(300,120),e.L(190,250),e.Z(),e.fill()}},9673:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,220),e.stroke(),e.circle(300,250,120),e.fill()}},9674:{width:600,draw:e=>{e.lineWidth(40),e.M(300,550),e.L(500,250),e.L(300,-50),e.L(100,250),e.Z(),e.stroke()}},9675:zC(300,250,220),9676:zC(300,250,220,30),9677:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,220),e.stroke(),e.M(80,250),e.C(80,371,179,470,300,470),e.C(421,470,520,371,520,250),e.Z(),e.fill()}},9678:{width:600,draw:e=>{e.lineWidth(35),e.circle(300,250,220),e.stroke(),e.circle(300,250,140),e.stroke()}},9679:RC(300,250,220),9680:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,220),e.stroke(),e.M(300,30),e.C(179,30,80,129,80,250),e.C(80,371,179,470,300,470),e.Z(),e.fill()}},9681:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,220),e.stroke(),e.M(300,470),e.C(421,470,520,371,520,250),e.C(520,129,421,30,300,30),e.Z(),e.fill()}},9682:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,220),e.stroke(),e.M(520,250),e.C(520,129,421,30,300,30),e.C(179,30,80,129,80,250),e.Z(),e.fill()}},9683:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,220),e.stroke(),e.M(80,250),e.C(80,371,179,470,300,470),e.C(421,470,520,371,520,250),e.Z(),e.fill()}},9684:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,220),e.stroke(),e.M(300,250),e.L(300,470),e.C(421,470,520,371,520,250),e.Z(),e.fill()}},9685:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,220),e.stroke(),e.M(300,250),e.L(300,470),e.C(179,470,80,371,80,250),e.Z(),e.fill(),e.M(300,250),e.L(520,250),e.C(520,129,421,30,300,30),e.C(179,30,80,129,80,250),e.Z(),e.fill()}},9686:{width:600,draw:e=>{e.M(300,30),e.C(179,30,80,129,80,250),e.C(80,371,179,470,300,470),e.Z(),e.fill()}},9687:{width:600,draw:e=>{e.M(300,470),e.C(421,470,520,371,520,250),e.C(520,129,421,30,300,30),e.Z(),e.fill()}},9688:{width:600,draw:e=>{e.rect(80,30,440,440),e.fill()}},9689:{width:600,draw:e=>{e.circle(300,250,240),e.fill()}},9692:{width:600,draw:e=>{e.lineWidth(50),e.M(300,470),e.C(179,470,80,371,80,250),e.stroke()}},9693:{width:600,draw:e=>{e.lineWidth(50),e.M(520,250),e.C(520,371,421,470,300,470),e.stroke()}},9694:{width:600,draw:e=>{e.lineWidth(50),e.M(300,30),e.C(421,30,520,129,520,250),e.stroke()}},9695:{width:600,draw:e=>{e.lineWidth(50),e.M(80,250),e.C(80,129,179,30,300,30),e.stroke()}},9696:{width:600,draw:e=>{e.lineWidth(50),e.M(80,250),e.C(80,371,179,470,300,470),e.C(421,470,520,371,520,250),e.stroke()}},9697:{width:600,draw:e=>{e.lineWidth(50),e.M(520,250),e.C(520,129,421,30,300,30),e.C(179,30,80,129,80,250),e.stroke()}},9702:zC(300,250,100,40),9711:zC(300,250,280,40)},{8592:{width:600,draw:e=>{e.lineWidth(50),e.M(500,250),e.L(100,250),e.stroke(),e.M(100,250),e.L(250,380),e.L(250,120),e.Z(),e.fill()}},8593:{width:600,draw:e=>{e.lineWidth(50),e.M(300,50),e.L(300,450),e.stroke(),e.M(300,450),e.L(170,300),e.L(430,300),e.Z(),e.fill()}},8594:{width:600,draw:e=>{e.lineWidth(50),e.M(100,250),e.L(500,250),e.stroke(),e.M(500,250),e.L(350,380),e.L(350,120),e.Z(),e.fill()}},8595:{width:600,draw:e=>{e.lineWidth(50),e.M(300,450),e.L(300,50),e.stroke(),e.M(300,50),e.L(170,200),e.L(430,200),e.Z(),e.fill()}},8596:{width:600,draw:e=>{e.lineWidth(40),e.M(150,250),e.L(450,250),e.stroke(),e.M(100,250),e.L(220,360),e.L(220,140),e.Z(),e.fill(),e.M(500,250),e.L(380,360),e.L(380,140),e.Z(),e.fill()}},8597:{width:600,draw:e=>{e.lineWidth(40),e.M(300,100),e.L(300,400),e.stroke(),e.M(300,450),e.L(190,330),e.L(410,330),e.Z(),e.fill(),e.M(300,50),e.L(190,170),e.L(410,170),e.Z(),e.fill()}},8598:{width:600,draw:e=>{e.lineWidth(50),e.M(480,50),e.L(120,410),e.stroke(),e.M(120,450),e.L(120,320),e.L(250,450),e.Z(),e.fill()}},8599:{width:600,draw:e=>{e.lineWidth(50),e.M(120,50),e.L(480,410),e.stroke(),e.M(480,450),e.L(350,450),e.L(480,320),e.Z(),e.fill()}},8600:{width:600,draw:e=>{e.lineWidth(50),e.M(120,450),e.L(480,90),e.stroke(),e.M(480,50),e.L(480,180),e.L(350,50),e.Z(),e.fill()}},8601:{width:600,draw:e=>{e.lineWidth(50),e.M(480,450),e.L(120,90),e.stroke(),e.M(120,50),e.L(250,50),e.L(120,180),e.Z(),e.fill()}},8617:{width:600,draw:e=>{e.lineWidth(50),e.M(500,350),e.L(200,350),e.C(120,350,80,300,80,250),e.C(80,200,120,150,200,150),e.L(350,150),e.stroke(),e.M(100,350),e.L(230,430),e.L(230,270),e.Z(),e.fill()}},8618:{width:600,draw:e=>{e.lineWidth(50),e.M(100,350),e.L(400,350),e.C(480,350,520,300,520,250),e.C(520,200,480,150,400,150),e.L(250,150),e.stroke(),e.M(500,350),e.L(370,430),e.L(370,270),e.Z(),e.fill()}},8656:{width:600,draw:e=>{e.M(100,250),e.L(280,420),e.L(280,300),e.L(500,300),e.L(500,200),e.L(280,200),e.L(280,80),e.Z(),e.fill()}},8657:{width:600,draw:e=>{e.M(300,480),e.L(480,280),e.L(370,280),e.L(370,30),e.L(230,30),e.L(230,280),e.L(120,280),e.Z(),e.fill()}},8658:{width:600,draw:e=>{e.M(500,250),e.L(320,420),e.L(320,300),e.L(100,300),e.L(100,200),e.L(320,200),e.L(320,80),e.Z(),e.fill()}},8659:{width:600,draw:e=>{e.M(300,20),e.L(120,220),e.L(230,220),e.L(230,470),e.L(370,470),e.L(370,220),e.L(480,220),e.Z(),e.fill()}},8660:{width:600,draw:e=>{e.M(80,250),e.L(220,400),e.L(220,300),e.L(380,300),e.L(380,400),e.L(520,250),e.L(380,100),e.L(380,200),e.L(220,200),e.L(220,100),e.Z(),e.fill()}}},{8704:{width:600,draw:e=>{e.lineWidth(50),e.M(100,500),e.L(300,0),e.L(500,500),e.stroke(),e.M(170,200),e.L(430,200),e.stroke()}},8706:{width:600,draw:e=>{e.lineWidth(50),e.circle(300,200,150),e.stroke(),e.M(450,200),e.L(450,450),e.C(450,500,400,520,350,500),e.stroke()}},8707:{width:600,draw:e=>{e.lineWidth(50),e.M(450,500),e.L(150,500),e.L(150,0),e.L(450,0),e.stroke(),e.M(150,250),e.L(400,250),e.stroke()}},8709:{width:600,draw:e=>{e.lineWidth(50),e.ellipse(300,250,180,220),e.stroke(),e.M(150,50),e.L(450,450),e.stroke()}},8710:{width:600,draw:e=>{e.lineWidth(50),e.M(300,500),e.L(100,0),e.L(500,0),e.Z(),e.stroke()}},8711:{width:600,draw:e=>{e.lineWidth(50),e.M(100,500),e.L(500,500),e.L(300,0),e.Z(),e.stroke()}},8712:{width:600,draw:e=>{e.lineWidth(50),e.M(480,450),e.C(250,450,120,380,120,250),e.C(120,120,250,50,480,50),e.stroke(),e.M(120,250),e.L(430,250),e.stroke()}},8713:{width:600,draw:e=>{e.lineWidth(50),e.M(480,450),e.C(250,450,120,380,120,250),e.C(120,120,250,50,480,50),e.stroke(),e.M(120,250),e.L(430,250),e.stroke(),e.M(160,50),e.L(440,450),e.stroke()}},8715:{width:600,draw:e=>{e.lineWidth(50),e.M(120,450),e.C(350,450,480,380,480,250),e.C(480,120,350,50,120,50),e.stroke(),e.M(170,250),e.L(480,250),e.stroke()}},8718:IC(150,50,300,400),8719:{width:600,draw:e=>{e.lineWidth(50),e.M(120,500),e.L(480,500),e.stroke(),e.M(170,500),e.L(170,0),e.stroke(),e.M(430,500),e.L(430,0),e.stroke()}},8721:{width:600,draw:e=>{e.lineWidth(50),e.M(480,500),e.L(120,500),e.L(300,250),e.L(120,0),e.L(480,0),e.stroke()}},8722:{width:600,draw:e=>{e.lineWidth(60),e.M(120,250),e.L(480,250),e.stroke()}},8723:{width:600,draw:e=>{e.lineWidth(50),e.M(120,350),e.L(480,350),e.stroke(),e.M(300,200),e.L(300,0),e.stroke(),e.M(120,100),e.L(480,100),e.stroke()}},8727:{width:600,draw:e=>{e.lineWidth(50),e.M(300,400),e.L(300,100),e.stroke(),e.M(140,350),e.L(460,150),e.stroke(),e.M(140,150),e.L(460,350),e.stroke()}},8730:{width:600,draw:e=>{e.lineWidth(50),e.M(60,250),e.L(150,200),e.L(250,0),e.L(540,500),e.stroke()}},8734:{width:700,draw:e=>{e.lineWidth(50),e.M(350,250),e.C(350,400,500,450,550,350),e.C(600,250,550,100,500,100),e.C(450,100,350,250,350,250),e.C(350,250,250,400,200,400),e.C(150,400,100,250,150,150),e.C(200,50,350,100,350,250),e.stroke()}},8736:{width:600,draw:e=>{e.lineWidth(50),e.M(480,50),e.L(120,50),e.L(380,450),e.stroke()}},8743:{width:600,draw:e=>{e.lineWidth(50),e.M(100,50),e.L(300,450),e.L(500,50),e.stroke()}},8744:{width:600,draw:e=>{e.lineWidth(50),e.M(100,450),e.L(300,50),e.L(500,450),e.stroke()}},8745:{width:600,draw:e=>{e.lineWidth(50),e.M(120,50),e.L(120,300),e.C(120,470,250,500,300,500),e.C(350,500,480,470,480,300),e.L(480,50),e.stroke()}},8746:{width:600,draw:e=>{e.lineWidth(50),e.M(120,450),e.L(120,200),e.C(120,30,250,0,300,0),e.C(350,0,480,30,480,200),e.L(480,450),e.stroke()}},8747:{width:600,draw:e=>{e.lineWidth(50),e.M(380,530),e.C(350,530,300,500,300,450),e.L(300,50),e.C(300,0,250,-30,220,-30),e.stroke()}},8776:{width:600,draw:e=>{e.lineWidth(50),e.M(120,350),e.C(200,430,350,430,480,350),e.stroke(),e.M(120,200),e.C(200,280,350,280,480,200),e.stroke()}},8800:{width:600,draw:e=>{e.lineWidth(50),e.M(120,330),e.L(480,330),e.stroke(),e.M(120,170),e.L(480,170),e.stroke(),e.M(380,450),e.L(220,50),e.stroke()}},8801:{width:600,draw:e=>{e.lineWidth(50),e.M(120,380),e.L(480,380),e.stroke(),e.M(120,250),e.L(480,250),e.stroke(),e.M(120,120),e.L(480,120),e.stroke()}},8804:{width:600,draw:e=>{e.lineWidth(50),e.M(480,420),e.L(120,250),e.L(480,80),e.stroke(),e.M(120,30),e.L(480,30),e.stroke()}},8805:{width:600,draw:e=>{e.lineWidth(50),e.M(120,420),e.L(480,250),e.L(120,80),e.stroke(),e.M(120,30),e.L(480,30),e.stroke()}},8834:{width:600,draw:e=>{e.lineWidth(50),e.M(470,450),e.C(200,450,130,350,130,250),e.C(130,150,200,50,470,50),e.stroke()}},8835:{width:600,draw:e=>{e.lineWidth(50),e.M(130,450),e.C(400,450,470,350,470,250),e.C(470,150,400,50,130,50),e.stroke()}},8853:{width:600,draw:e=>{e.lineWidth(45),e.circle(300,250,200),e.stroke(),e.M(100,250),e.L(500,250),e.stroke(),e.M(300,50),e.L(300,450),e.stroke()}},8854:{width:600,draw:e=>{e.lineWidth(45),e.circle(300,250,200),e.stroke(),e.M(100,250),e.L(500,250),e.stroke()}},8855:{width:600,draw:e=>{e.lineWidth(45),e.circle(300,250,200),e.stroke(),e.M(160,110),e.L(440,390),e.stroke(),e.M(160,390),e.L(440,110),e.stroke()}},8856:{width:600,draw:e=>{e.lineWidth(45),e.circle(300,250,200),e.stroke(),e.M(160,100),e.L(440,400),e.stroke()}},8857:{width:600,draw:e=>{e.lineWidth(45),e.circle(300,250,200),e.stroke(),e.circle(300,250,40),e.fill()}}},{9728:{width:600,draw:e=>{e.circle(300,250,130),e.fill(),e.lineWidth(40);for(let t=0;t<360;t+=45){let n=t*Math.PI/180;e.M(300+160*Math.cos(n),250+160*Math.sin(n)),e.L(300+240*Math.cos(n),250+240*Math.sin(n))}e.stroke()}},9733:{width:600,draw:e=>{for(let t=0;t<5;t++){let n=(t*72-90)*Math.PI/180,r=(t*72+36-90)*Math.PI/180;t===0?e.M(300+230*Math.cos(n),260+230*Math.sin(n)):e.L(300+230*Math.cos(n),260+230*Math.sin(n)),e.L(300+90*Math.cos(r),260+90*Math.sin(r))}e.Z(),e.fill()}},9734:{width:600,draw:e=>{e.lineWidth(35);for(let t=0;t<5;t++){let n=(t*72-90)*Math.PI/180,r=(t*72+36-90)*Math.PI/180;t===0?e.M(300+230*Math.cos(n),260+230*Math.sin(n)):e.L(300+230*Math.cos(n),260+230*Math.sin(n)),e.L(300+90*Math.cos(r),260+90*Math.sin(r))}e.Z(),e.stroke()}},9744:LC(100,30,400,400,45),9745:{width:600,draw:e=>{e.lineWidth(45),e.rect(100,30,400,400),e.stroke(),e.lineWidth(55),e.M(180,230),e.L(280,130),e.L(430,350),e.stroke()}},9746:{width:600,draw:e=>{e.lineWidth(45),e.rect(100,30,400,400),e.stroke(),e.lineWidth(50),e.M(170,100),e.L(430,360),e.stroke(),e.M(170,360),e.L(430,100),e.stroke()}},9747:{width:600,draw:e=>{e.lineWidth(55),e.M(120,50),e.L(480,450),e.stroke(),e.M(120,450),e.L(480,50),e.stroke()}},9755:{width:600,draw:e=>{e.M(500,250),e.L(300,400),e.L(300,300),e.L(100,300),e.L(100,200),e.L(300,200),e.L(300,100),e.Z(),e.fill()}},9758:{width:600,draw:e=>{e.lineWidth(40),e.M(500,250),e.L(300,400),e.L(300,300),e.L(100,300),e.L(100,200),e.L(300,200),e.L(300,100),e.Z(),e.stroke()}},9792:{width:600,draw:e=>{e.lineWidth(50),e.circle(300,330,150),e.stroke(),e.M(300,180),e.L(300,0),e.stroke(),e.M(220,90),e.L(380,90),e.stroke()}},9794:{width:600,draw:e=>{e.lineWidth(50),e.circle(250,220,150),e.stroke(),e.M(360,330),e.L(500,470),e.stroke(),e.M(400,470),e.L(500,470),e.L(500,370),e.stroke()}},9824:{width:600,draw:e=>{e.M(300,500),e.C(300,500,80,350,80,200),e.C(80,100,200,50,300,180),e.C(400,50,520,100,520,200),e.C(520,350,300,500,300,500),e.Z(),e.fill(),e.M(250,0),e.L(350,0),e.L(320,150),e.L(280,150),e.Z(),e.fill()}},9827:{width:600,draw:e=>{e.circle(300,370,110),e.fill(),e.circle(190,230,100),e.fill(),e.circle(410,230,100),e.fill(),e.rect(270,0,60,200),e.fill()}},9829:{width:600,draw:e=>{e.M(300,80),e.C(300,80,80,200,80,340),e.C(80,440,180,490,300,490),e.C(420,490,520,440,520,340),e.C(520,200,300,80,300,80),e.Z(),e.fill()}},9830:{width:600,draw:e=>{e.M(300,500),e.L(500,250),e.L(300,0),e.L(100,250),e.Z(),e.fill()}},9833:{width:600,draw:e=>{e.ellipse(230,80,100,70),e.fill(),e.lineWidth(40),e.M(330,80),e.L(330,480),e.stroke()}},9834:{width:600,draw:e=>{e.ellipse(200,80,100,70),e.fill(),e.lineWidth(35),e.M(300,80),e.L(300,480),e.stroke(),e.M(300,480),e.C(350,450,430,400,430,350),e.stroke()}},9837:{width:600,draw:e=>{e.lineWidth(40),e.M(200,0),e.L(200,500),e.stroke(),e.M(200,200),e.C(350,200,400,100,200,0),e.stroke()}},9839:{width:600,draw:e=>{e.lineWidth(40),e.M(220,0),e.L(220,500),e.stroke(),e.M(380,0),e.L(380,500),e.stroke(),e.lineWidth(50),e.M(140,180),e.L(460,240),e.stroke(),e.M(140,310),e.L(460,370),e.stroke()}},10003:{width:600,draw:e=>{e.lineWidth(65),e.M(100,250),e.L(240,80),e.L(500,450),e.stroke()}},10004:{width:600,draw:e=>{e.lineWidth(85),e.M(100,250),e.L(240,80),e.L(500,450),e.stroke()}},10005:{width:600,draw:e=>{e.lineWidth(55),e.M(140,70),e.L(460,430),e.stroke(),e.M(140,430),e.L(460,70),e.stroke()}},10006:{width:600,draw:e=>{e.lineWidth(75),e.M(140,70),e.L(460,430),e.stroke(),e.M(140,430),e.L(460,70),e.stroke()}},10007:{width:600,draw:e=>{e.lineWidth(60),e.M(130,60),e.L(470,440),e.stroke(),e.M(130,440),e.L(470,60),e.stroke()}},10008:{width:600,draw:e=>{e.lineWidth(80),e.M(130,60),e.L(470,440),e.stroke(),e.M(130,440),e.L(470,60),e.stroke()}},10010:{width:600,draw:e=>{e.rect(210,30,180,440),e.fill(),e.rect(90,160,420,180),e.fill()}},10012:{width:600,draw:e=>{e.lineWidth(60),e.M(300,30),e.L(300,470),e.stroke(),e.M(90,250),e.L(510,250),e.stroke()}},10016:{width:600,draw:e=>{e.M(300,480),e.L(250,320),e.L(100,350),e.L(200,250),e.L(100,150),e.L(250,180),e.L(300,20),e.L(350,180),e.L(500,150),e.L(400,250),e.L(500,350),e.L(350,320),e.Z(),e.fill()}},10084:{width:600,draw:e=>{e.M(300,80),e.C(300,80,60,220,60,350),e.C(60,470,180,500,300,500),e.C(420,500,540,470,540,350),e.C(540,220,300,80,300,80),e.Z(),e.fill()}},...(()=>{let e={};for(let t=0;t<10;t++){let n=10102+t;e[n]={width:600,draw:e=>{e.circle(300,250,240),e.fill()}}}return e})(),...(()=>{let e={};for(let t=0;t<10;t++)e[9312+t]={width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,220),e.stroke()}};return e})()},{8960:{width:600,draw:e=>{e.lineWidth(45),e.circle(300,250,200),e.stroke(),e.M(140,90),e.L(460,410),e.stroke()}},8962:{width:600,draw:e=>{e.lineWidth(45),e.M(300,480),e.L(520,250),e.L(520,30),e.L(80,30),e.L(80,250),e.Z(),e.stroke()}},8984:{width:600,draw:e=>{e.lineWidth(45),e.rect(180,130,240,240),e.stroke(),e.circle(180,370,70),e.stroke(),e.circle(420,370,70),e.stroke(),e.circle(180,130,70),e.stroke(),e.circle(420,130,70),e.stroke()}},8987:{width:600,draw:e=>{e.lineWidth(45),e.M(120,480),e.L(480,480),e.stroke(),e.M(120,20),e.L(480,20),e.stroke(),e.M(150,480),e.L(300,250),e.L(450,480),e.stroke(),e.M(150,20),e.L(300,250),e.L(450,20),e.stroke()}},9166:{width:600,draw:e=>{e.lineWidth(45),e.M(480,420),e.L(480,200),e.L(150,200),e.stroke(),e.M(150,200),e.L(280,310),e.L(280,90),e.Z(),e.fill()}}},{9472:{width:600,draw:e=>{e.lineWidth(40),e.M(0,250),e.L(600,250),e.stroke()}},9473:{width:600,draw:e=>{e.lineWidth(80),e.M(0,250),e.L(600,250),e.stroke()}},9474:{width:600,draw:e=>{e.lineWidth(40),e.M(300,0),e.L(300,500),e.stroke()}},9475:{width:600,draw:e=>{e.lineWidth(80),e.M(300,0),e.L(300,500),e.stroke()}},9484:{width:600,draw:e=>{e.lineWidth(40),e.M(300,0),e.L(300,250),e.L(600,250),e.stroke()}},9488:{width:600,draw:e=>{e.lineWidth(40),e.M(300,0),e.L(300,250),e.L(0,250),e.stroke()}},9492:{width:600,draw:e=>{e.lineWidth(40),e.M(300,500),e.L(300,250),e.L(600,250),e.stroke()}},9496:{width:600,draw:e=>{e.lineWidth(40),e.M(300,500),e.L(300,250),e.L(0,250),e.stroke()}},9500:{width:600,draw:e=>{e.lineWidth(40),e.M(300,0),e.L(300,500),e.stroke(),e.M(300,250),e.L(600,250),e.stroke()}},9508:{width:600,draw:e=>{e.lineWidth(40),e.M(300,0),e.L(300,500),e.stroke(),e.M(300,250),e.L(0,250),e.stroke()}},9516:{width:600,draw:e=>{e.lineWidth(40),e.M(0,250),e.L(600,250),e.stroke(),e.M(300,250),e.L(300,0),e.stroke()}},9524:{width:600,draw:e=>{e.lineWidth(40),e.M(0,250),e.L(600,250),e.stroke(),e.M(300,250),e.L(300,500),e.stroke()}},9532:{width:600,draw:e=>{e.lineWidth(40),e.M(0,250),e.L(600,250),e.stroke(),e.M(300,0),e.L(300,500),e.stroke()}},9556:{width:600,draw:e=>{e.lineWidth(30),e.M(270,0),e.L(270,270),e.L(600,270),e.stroke(),e.M(330,0),e.L(330,230),e.L(600,230),e.stroke()}},9559:{width:600,draw:e=>{e.lineWidth(30),e.M(330,0),e.L(330,270),e.L(0,270),e.stroke(),e.M(270,0),e.L(270,230),e.L(0,230),e.stroke()}},9562:{width:600,draw:e=>{e.lineWidth(30),e.M(270,500),e.L(270,230),e.L(600,230),e.stroke(),e.M(330,500),e.L(330,270),e.L(600,270),e.stroke()}},9565:{width:600,draw:e=>{e.lineWidth(30),e.M(330,500),e.L(330,230),e.L(0,230),e.stroke(),e.M(270,500),e.L(270,270),e.L(0,270),e.stroke()}},9552:{width:600,draw:e=>{e.lineWidth(30),e.M(0,270),e.L(600,270),e.stroke(),e.M(0,230),e.L(600,230),e.stroke()}},9553:{width:600,draw:e=>{e.lineWidth(30),e.M(270,0),e.L(270,500),e.stroke(),e.M(330,0),e.L(330,500),e.stroke()}}},{9600:IC(0,250,600,250),9604:IC(0,0,600,250),9608:IC(0,0,600,500),9612:IC(0,0,300,500),9616:IC(300,0,300,500),9617:{width:600,draw:e=>{e.lineWidth(15),e.rect(0,0,600,500),e.stroke();for(let t=0;t<=500;t+=60)e.M(0,t),e.L(600,t);e.stroke()}},9618:{width:600,draw:e=>{e.lineWidth(25),e.rect(0,0,600,500),e.stroke();for(let t=0;t<=500;t+=50)e.M(0,t),e.L(600,t);for(let t=0;t<=600;t+=60)e.M(t,0),e.L(t,500);e.stroke()}},9619:{width:600,draw:e=>{e.lineWidth(35),e.rect(0,0,600,500),e.fill()}}},{11014:{width:600,draw:e=>{e.M(300,500),e.L(100,280),e.L(230,280),e.L(230,0),e.L(370,0),e.L(370,280),e.L(500,280),e.Z(),e.fill()}},11015:{width:600,draw:e=>{e.M(300,0),e.L(100,220),e.L(230,220),e.L(230,500),e.L(370,500),e.L(370,220),e.L(500,220),e.Z(),e.fill()}},11013:{width:600,draw:e=>{e.M(0,250),e.L(220,430),e.L(220,320),e.L(550,320),e.L(550,180),e.L(220,180),e.L(220,70),e.Z(),e.fill()}},11035:IC(60,10,480,480),11036:LC(60,10,480,480,45),11088:{width:600,draw:e=>{e.lineWidth(35);for(let t=0;t<5;t++){let n=(t*72-90)*Math.PI/180,r=(t*72+36-90)*Math.PI/180;t===0?e.M(300+230*Math.cos(n),260+230*Math.sin(n)):e.L(300+230*Math.cos(n),260+230*Math.sin(n)),e.L(300+90*Math.cos(r),260+90*Math.sin(r))}e.Z(),e.stroke()}}},{10688:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,220),e.stroke(),e.lineWidth(45),e.M(400,380),e.L(200,250),e.L(400,120),e.stroke()}},10689:{width:600,draw:e=>{e.lineWidth(40),e.circle(300,250,220),e.stroke(),e.lineWidth(45),e.M(200,380),e.L(400,250),e.L(200,120),e.stroke()}},10695:{width:600,draw:e=>{e.lineWidth(40),e.rect(80,30,440,440),e.stroke(),e.circle(300,250,130),e.stroke()}},10696:{width:600,draw:e=>{e.lineWidth(40),e.rect(80,30,440,440),e.stroke(),e.rect(190,140,220,220),e.stroke()}},10697:{width:600,draw:e=>{e.lineWidth(35),e.rect(80,80,300,300),e.stroke(),e.rect(220,120,300,300),e.stroke()}}},{8377:{width:600,draw:e=>{e.lineWidth(50),e.M(130,480),e.L(470,480),e.stroke(),e.M(130,380),e.L(470,380),e.stroke(),e.M(230,480),e.C(350,480,420,400,420,350),e.C(420,280,350,200,230,200),e.stroke(),e.M(200,380),e.L(400,0),e.stroke()}},8378:{width:600,draw:e=>{e.lineWidth(50),e.M(350,480),e.L(350,50),e.C(350,0,200,0,150,50),e.stroke(),e.M(150,330),e.L(450,250),e.stroke(),e.M(150,230),e.L(450,150),e.stroke()}},8381:{width:600,draw:e=>{e.lineWidth(50),e.M(180,0),e.L(180,500),e.stroke(),e.M(180,500),e.L(350,500),e.C(480,500,480,350,350,300),e.L(180,300),e.stroke(),e.M(120,200),e.L(400,200),e.stroke()}}},{8226:RC(300,250,100),8230:{width:600,draw:e=>{e.circle(120,100,40),e.fill(),e.circle(300,100,40),e.fill(),e.circle(480,100,40),e.fill()}},8227:{width:600,draw:e=>{e.M(150,400),e.L(450,250),e.L(150,100),e.Z(),e.fill()}},8259:{width:600,draw:e=>{e.lineWidth(60),e.M(150,250),e.L(450,250),e.stroke()}},8260:{width:600,draw:e=>{e.lineWidth(40),e.M(450,500),e.L(150,0),e.stroke()}}},aS,sS,lS,uS,fS,pS,mS,hS,gS,_S,vS,yS,bS,xS,SS,CS,jS,MS,zS,BS,VS,HS,US,WS,GS,W,G,tC,K,uC,mC,U,hC,EC,DC,Y,Z,FC,Q,yC,bC,xC,SC,CC],HC=null;function UC(){if(!HC){HC=new Map;for(let e of VC)for(let[t,n]of Object.entries(e))HC.set(Number(t),n)}return HC}function WC(e){return UC().get(e)}let GC=1e3;function KC(e,t,n=`T3F`){let r=new Map,i=new Map,a=new Map;if(t.size===0)return{fontObjects:i,encoding:r,widths:a};let o=[...t].sort((e,t)=>e-t),s=1;for(let t=0;t<o.length;t+=255){let c=o.slice(t,t+255),l=`${n}${s}`;s++;let{objNum:u,fontWidths:d}=qC(e,c,l);i.set(l,u),a.set(l,d);for(let e=0;e<c.length;e++)r.set(c[e],{resourceName:l,charCode:1+e})}return{fontObjects:i,encoding:r,widths:a}}function qC(e,t,n){let r=[],i=[],a=Array(1+t.length).fill(0),o=new Map,s=JC(e,BC);r.push({name:`.notdef`,objNum:s}),a[0]=BC.width;for(let n=0;n<t.length;n++){let s=t[n],c=WC(s)??BC,l=`uni${s.toString(16).toUpperCase().padStart(4,`0`)}`,u=JC(e,c);r.push({name:l,objNum:u}),i.push(l);let d=1+n;a[d]=c.width,o.set(d,c.width)}let c=[];for(let{name:e,objNum:t}of r)c.push(`${nx(e)} ${L(t)}`);let l=`<<\n${c.join(`
|
|
451
|
+
`)}\n>>`,u=[];u.push(`1`);for(let e of i)u.push(nx(e));let d=e.allocObject(),f=new R().set(`Type`,`/Encoding`).set(`Differences`,`[${u.join(` `)}]`);e.addObject(d,f);let p=XC(e,t),m=e.allocObject(),h=`[0 0 ${GC} ${GC}]`,g=new R().set(`Type`,`/Font`).set(`Subtype`,`/Type3`).set(`Name`,nx(n)).set(`FontBBox`,h).set(`FontMatrix`,`[0.001 0 0 0.001 0 0]`).set(`FirstChar`,I(0)).set(`LastChar`,I(a.length-1)).set(`Widths`,rx(a.map(e=>I(e)))).set(`CharProcs`,l).set(`Encoding`,L(d)).set(`ToUnicode`,L(p));return e.addObject(m,g),{objNum:m,fontWidths:o}}function JC(e,t){let n=new wx;n.raw(`${t.width} 0 0 0 ${GC} ${GC} d1`);let r=YC(n);t.draw(r);let i=e.allocObject();return e.addStreamObject(i,new R,n),i}function YC(e){return{M:(t,n)=>{e.moveTo(t,n)},L:(t,n)=>{e.lineTo(t,n)},C:(t,n,r,i,a,o)=>{e.curveTo(t,n,r,i,a,o)},Z:()=>{e.closePath()},rect:(t,n,r,i)=>{e.rect(t,n,r,i)},circle:(t,n,r)=>{e.circle(t,n,r)},ellipse:(t,n,r,i)=>{e.ellipse(t,n,r,i)},stroke:()=>{e.stroke()},fill:()=>{e.fill()},fillStroke:()=>{e.fillAndStroke()},lineWidth:t=>{e.setLineWidth(t)}}}function XC(e,t){let n=[];n.push(`/CIDInit /ProcSet findresource begin`),n.push(`12 dict begin`),n.push(`begincmap`),n.push(`/CIDSystemInfo`),n.push(`<< /Registry (Adobe) /Ordering (UCS) /Supplement 0 >> def`),n.push(`/CMapName /Adobe-Identity-UCS def`),n.push(`/CMapType 2 def`),n.push(`1 begincodespacerange`),n.push(`<00> <FF>`),n.push(`endcodespacerange`);for(let e=0;e<t.length;e+=100){let r=t.slice(e,e+100);n.push(`${r.length} beginbfchar`);for(let t=0;t<r.length;t++){let i=1+e+t,a=r[t],o=i.toString(16).toUpperCase().padStart(2,`0`);if(a>65535){let e=Math.floor((a-65536)/1024)+55296,t=(a-65536)%1024+56320,r=e.toString(16).toUpperCase().padStart(4,`0`),i=t.toString(16).toUpperCase().padStart(4,`0`);n.push(`<${o}> <${r}${i}>`)}else{let e=a.toString(16).toUpperCase().padStart(4,`0`);n.push(`<${o}> <${e}>`)}}n.push(`endbfchar`)}n.push(`endcmap`),n.push(`CMapName currentdict /CMap defineresource pop`),n.push(`end`),n.push(`end`);let r=n.join(`
|
|
452
|
+
`),i=new TextEncoder().encode(r),a=e.allocObject();return e.addStreamObject(a,new R,i),a}let ZC={helvetica:`Helvetica`,arial:`Helvetica`,calibri:`Helvetica`,"segoe ui":`Helvetica`,"trebuchet ms":`Helvetica`,verdana:`Helvetica`,tahoma:`Helvetica`,"gill sans":`Helvetica`,"franklin gothic":`Helvetica`,"lucida sans":`Helvetica`,aptos:`Helvetica`,"times new roman":`Times`,times:`Times`,georgia:`Times`,garamond:`Times`,"book antiqua":`Times`,palatino:`Times`,"palatino linotype":`Times`,cambria:`Times`,"century schoolbook":`Times`,"courier new":`Courier`,courier:`Courier`,consolas:`Courier`,"lucida console":`Courier`,monaco:`Courier`,"andale mono":`Courier`,"cascadia code":`Courier`,"cascadia mono":`Courier`,menlo:`Courier`};function QC(e){return ZC[e.toLowerCase().trim()]??`Helvetica`}function $C(e,t,n){let r=QC(e);return r===`Helvetica`?t&&n?`Helvetica-BoldOblique`:t?`Helvetica-Bold`:n?`Helvetica-Oblique`:`Helvetica`:r===`Times`?t&&n?`Times-BoldItalic`:t?`Times-Bold`:n?`Times-Italic`:`Times-Roman`:r===`Courier`?t&&n?`Courier-BoldOblique`:t?`Courier-Bold`:n?`Courier-Oblique`:`Courier`:`Helvetica`}var ew=class{constructor(){this.type1Map=new Map,this.resourceToType1=new Map,this.nextType1Id=1,this.embeddedFont=null,this.embeddedResourceName=``,this.usedCodePoints=new Set,this.nextEmbeddedId=1,this.type3CodePoints=new Set,this._type3Result=null,this._embeddedResult=null}registerEmbeddedFont(e){return this.embeddedFont=e,this.embeddedResourceName=`EF${this.nextEmbeddedId++}`,this.embeddedResourceName}hasEmbeddedFont(){return this.embeddedFont!==null}getEmbeddedResourceName(){return this.embeddedResourceName}trackText(e){if(this.embeddedFont)for(let t=0;t<e.length;t++){let n=e.codePointAt(t);this.usedCodePoints.add(n),n>65535&&t++}else for(let t=0;t<e.length;t++){let n=e.codePointAt(t);n>65535&&t++,kx(n)||this.type3CodePoints.add(n)}}ensureFont(e){let t=this.type1Map.get(e);return t||(t=`F${this.nextType1Id++}`,this.type1Map.set(e,t),this.resourceToType1.set(t,e)),t}resolveFont(e,t,n){if(this.embeddedFont)return this.embeddedResourceName;let r=$C(e,t,n);return this.ensureFont(r)}getPdfFontName(e){return this.resourceToType1.get(e)??`Helvetica`}hasType3Fonts(){return this._type3Result!==null&&this._type3Result.fontObjects.size>0}resolveType3(e){return this._type3Result?this._type3Result.encoding.get(e)??null:null}needsType3(e){return!this.embeddedFont&&!kx(e)}measureText(e,t,n){if(this.embeddedFont&&t===this.embeddedResourceName)return nw(e,this.embeddedFont,n);if(!this._type3Result||!Ax(e))return tS(e,this.getPdfFontName(t),n);let r=0,i=this.getPdfFontName(t);for(let t=0;t<e.length;t++){let a=e.codePointAt(t);if(a>65535&&t++,kx(a))r+=tS(String.fromCodePoint(a),i,n);else{let e=this._type3Result.encoding.get(a);if(e){let t=this._type3Result.widths.get(e.resourceName)?.get(e.charCode)??600;r+=t/1e3*n}else r+=600/1e3*n}}return r}getFontAscent(e,t){return this.embeddedFont&&e===this.embeddedResourceName?this.embeddedFont.ascent/this.embeddedFont.unitsPerEm*t:nS(this.isType3Resource(e)?`Helvetica`:this.getPdfFontName(e),t)}getFontDescent(e,t){return this.embeddedFont&&e===this.embeddedResourceName?this.embeddedFont.descent/this.embeddedFont.unitsPerEm*t:rS(this.isType3Resource(e)?`Helvetica`:this.getPdfFontName(e),t)}getLineHeight(e,t){if(this.embeddedFont&&e===this.embeddedResourceName){let e=this.embeddedFont;return(e.ascent-e.descent)/e.unitsPerEm*t}return iS(this.isType3Resource(e)?`Helvetica`:this.getPdfFontName(e),t)}isEmbeddedFont(e){return this.embeddedFont!==null&&e===this.embeddedResourceName}isType3Resource(e){return this._type3Result?.fontObjects.has(e)??!1}encodeText(e,t){if(!this.embeddedFont||t!==this.embeddedResourceName)return null;if(this._embeddedResult)return tw(e,this._embeddedResult.unicodeToCid);throw new Nx(`encodeText called before writeFontResources — subset mapping not available`)}encodeType3Char(e){if(!this._type3Result)return null;let t=this._type3Result.encoding.get(e);return t?`<${t.charCode.toString(16).toUpperCase().padStart(2,`0`)}>`:null}writeFontResources(e){let t=new Map;for(let[n,r]of this.type1Map){let i=e.allocObject(),a=new R().set(`Type`,`/Font`).set(`Subtype`,`/Type1`).set(`BaseFont`,nx(n)).set(`Encoding`,`/WinAnsiEncoding`);e.addObject(i,a),t.set(r,i)}if(this.embeddedFont&&this.embeddedResourceName){let n=zx(e,this.embeddedFont,this.usedCodePoints,this.embeddedResourceName);t.set(this.embeddedResourceName,n.fontObjNum),this._embeddedResult=n}if(!this.embeddedFont&&this.type3CodePoints.size>0){this._type3Result=KC(e,this.type3CodePoints);for(let[e,n]of this._type3Result.fontObjects)t.set(e,n)}return t}getEmbeddedResult(){return this._embeddedResult}buildFontDictString(e){let t=[`<<`];for(let[n,r]of e)t.push(`${nx(n)} ${L(r)}`);return t.push(`>>`),t.join(`
|
|
453
|
+
`)}getRegisteredFonts(){let e=[];for(let[t,n]of this.type1Map)e.push({resourceName:n,pdfFontName:t});return e}};function tw(e,t){let n=`<`;for(let r=0;r<e.length;r++){let i=e.codePointAt(r);i>65535&&r++;let a=t.get(i)??0;n+=a.toString(16).toUpperCase().padStart(4,`0`)}return n+=`>`,n}function nw(e,t,n){let r=0;for(let n=0;n<e.length;n++){let i=e.codePointAt(n);i>65535&&n++;let a=t.cmap.get(i)??0;r+=t.advanceWidths[a]??0}return r/t.unitsPerEm*n}function rw(){let e=typeof process<`u`?process.platform:``,t=typeof process<`u`?process.env.HOME??process.env.USERPROFILE??``:``,n=[];switch(e){case`darwin`:n.push(`/System/Library/Fonts`,`/System/Library/Fonts/Supplemental`,`/Library/Fonts`,`${t}/Library/Fonts`);break;case`win32`:{let e=process.env.WINDIR??process.env.SystemRoot??`C:\\Windows`;n.push(`${e}\\Fonts`,`${process.env.LOCALAPPDATA??``}\\Microsoft\\Windows\\Fonts`);break}default:n.push(`/usr/share/fonts`,`/usr/local/share/fonts`,`/usr/share/fonts/truetype`,`/usr/share/fonts/opentype`,`/usr/share/fonts/TTF`,`/usr/share/fonts/noto`,`/usr/share/fonts/noto-cjk`,`/usr/share/fonts/google-noto`,`/usr/share/fonts/google-noto-cjk`,`/usr/share/fonts/truetype/noto`,`/usr/share/fonts/truetype/dejavu`,`/usr/share/fonts/truetype/liberation`,`/usr/share/fonts/truetype/droid`,`/usr/share/fonts/wqy`,`${t}/.local/share/fonts`,`${t}/.fonts`);break}return n}let iw=`NotoSansCJKsc-Regular.ttf,NotoSansCJK-Regular.ttc,NotoSansCJKSC-Regular.otf,NotoSansSC-Regular.ttf,NotoSansTC-Regular.ttf,NotoSansJP-Regular.ttf,NotoSansKR-Regular.ttf,NotoSans-Regular.ttf,Arial Unicode.ttf,Arial Unicode MS.ttf,ArialUnicode.ttf,arialuni.ttf,PingFang.ttc,Hiragino Sans GB.ttc,STHeiti Light.ttc,STHeiti Medium.ttc,Songti.ttc,AppleSDGothicNeo.ttc,msyh.ttc,msyhbd.ttc,msjh.ttc,simsun.ttc,simhei.ttf,malgun.ttf,meiryo.ttc,yugothic.ttf,segoeui.ttf,arial.ttf,DejaVuSans.ttf,LiberationSans-Regular.ttf,FreeSans.ttf,DroidSansFallbackFull.ttf,DroidSansFallback.ttf,wqy-microhei.ttc,wqy-zenhei.ttc,uming.ttc,NanumGothic.ttf,IPAexGothic.ttf`.split(`,`),aw;function ow(){if(aw!==void 0)return aw;if(typeof process>`u`||!process.platform)return aw=[],aw;let e=[],t=new Set,n=rw();for(let r of iw)for(let i of n){let n=`${i}/${r}`;if(!t.has(n)&&ml(n)){let r=sw(n);r&&(e.push(r),t.add(n))}}let r=/noto|unicode|cjk|yahei|heiti|gothic|sans|serif|ming|song|dejavu|liberation|droid|wqy/i;for(let i of n)try{let n=pl(i,{recursive:!0,filter:e=>!e.isDirectory}).filter(e=>/\.tt[cf]$/i.test(e.absolutePath)&&!t.has(e.absolutePath)),a=n.filter(e=>r.test(e.absolutePath)),o=n.filter(e=>!r.test(e.absolutePath)&&e.size>5e4);for(let n of[...a,...o]){if(t.has(n.absolutePath))continue;let r=sw(n.absolutePath);r&&(e.push(r),t.add(n.absolutePath))}}catch{}return aw=e,e}function sw(e){try{return hl(e)}catch{return null}}let cw=65536,lw=2e6;var uw=class e{constructor(e,t=0){this.data=e,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.offset=t}u8(){let e=this.view.getUint8(this.offset);return this.offset+=1,e}u16(){let e=this.view.getUint16(this.offset,!1);return this.offset+=2,e}i16(){let e=this.view.getInt16(this.offset,!1);return this.offset+=2,e}u32(){let e=this.view.getUint32(this.offset,!1);return this.offset+=4,e}i32(){let e=this.view.getInt32(this.offset,!1);return this.offset+=4,e}fixed(){return this.i32()/65536}bytes(e){let t=this.data.subarray(this.offset,this.offset+e);return this.offset+=e,t}tag(){return String.fromCharCode(this.u8(),this.u8(),this.u8(),this.u8())}skip(e){this.offset+=e}at(t){return new e(this.data,t)}u16At(e){return this.view.getUint16(e,!1)}u32At(e){return this.view.getUint32(e,!1)}i16At(e){return this.view.getInt16(e,!1)}};function dw(e){let t=new uw(e),n=t.u32();if(n===1953784678){if(t.skip(4),t.u32()===0)throw new Nx(`TrueType Collection is empty (0 fonts)`);return fw(e,t.u32())}return pw(e,t,n)}function fw(e,t){let n=new uw(e,t);return pw(e,n,n.u32())}function pw(e,t,n){if(n!==65536&&n!==1953658213)throw n===1330926671?new Nx(`CFF-flavored OpenType (.otf) is not supported. Use a TrueType (.ttf) font.`):new Nx(`Invalid TrueType font: bad sfVersion 0x${n.toString(16)}`);let r=t.u16();t.skip(6);let i=new Map;for(let e=0;e<r;e++){let e=t.tag();t.skip(4);let n=t.u32(),r=t.u32();i.set(e,{offset:n,length:r})}for(let e of[`head`,`hhea`,`maxp`,`cmap`,`hmtx`])if(!i.has(e))throw new Nx(`Missing required table '${e}' in TrueType font`);let a=mw(t,i.get(`head`)),o=hw(t,i.get(`hhea`)),s=gw(t,i.get(`maxp`)),c=i.has(`OS/2`)?_w(t,i.get(`OS/2`)):null,l=i.has(`post`)?vw(t,i.get(`post`)):null,u=i.has(`name`)?yw(t,i.get(`name`)):null,d=bw(t,i.get(`cmap`)),f=Cw(t,i.get(`hmtx`),o.numHMetrics,s.numGlyphs),p=i.has(`loca`)&&i.has(`glyf`)?ww(t,i.get(`loca`),s.numGlyphs,a.indexToLocFormat):new Uint32Array(s.numGlyphs+1),m=c?.sTypoAscender??o.ascent,h=c?.sTypoDescender??o.descent,g=c?.sCapHeight??Math.round(m*.7),_=0;l?.isFixedPitch&&(_|=1),a.macStyle&2&&(_|=64),_|=32;let v=c?.usWeightClass??400,y=Math.round(50+(v/65)**2),b=u?.familyName??`Unknown`;return{data:e,familyName:b,postScriptName:u?.postScriptName??b.replace(/\s+/g,``),unitsPerEm:a.unitsPerEm,ascent:m,descent:h,capHeight:g,italicAngle:l?.italicAngle??0,flags:_,bbox:[a.xMin,a.yMin,a.xMax,a.yMax],stemV:y,numGlyphs:s.numGlyphs,indexToLocFormat:a.indexToLocFormat,numHMetrics:o.numHMetrics,tables:i,cmap:d,advanceWidths:f,glyphOffsets:p}}function mw(e,t){let n=e.at(t.offset);n.skip(4),n.skip(4),n.skip(4),n.skip(4),n.skip(2);let r=n.u16();n.skip(16);let i=n.i16(),a=n.i16(),o=n.i16(),s=n.i16(),c=n.u16();return n.skip(2),n.skip(2),{unitsPerEm:r,xMin:i,yMin:a,xMax:o,yMax:s,macStyle:c,indexToLocFormat:n.i16()}}function hw(e,t){let n=e.at(t.offset);n.skip(4);let r=n.i16(),i=n.i16(),a=n.i16();return n.skip(2),n.skip(22),{ascent:r,descent:i,lineGap:a,numHMetrics:n.u16()}}function gw(e,t){let n=e.at(t.offset);return n.skip(4),{numGlyphs:n.u16()}}function _w(e,t){let n=e.at(t.offset),r=n.u16();n.skip(2);let i=n.u16();n.skip(2),n.skip(2),n.skip(22),n.skip(10),n.skip(16),n.skip(4),n.skip(2),n.skip(2),n.skip(2);let a=n.i16(),o=n.i16();n.skip(2),n.skip(2),n.skip(2);let s;return r>=2?(n.skip(8),n.skip(2),s=n.i16()):s=Math.round(a*.7),{usWeightClass:i,sTypoAscender:a,sTypoDescender:o,sCapHeight:s}}function vw(e,t){let n=e.at(t.offset);n.skip(4);let r=n.fixed();return n.skip(2),n.skip(2),{italicAngle:r,isFixedPitch:n.u32()!==0}}function yw(e,t){let n=t.offset,r=e.at(n);r.skip(2);let i=r.u16(),a=n+r.u16(),o=``,s=``;for(let t=0;t<i;t++){let t=r.u16(),n=r.u16();r.skip(2);let i=r.u16(),c=r.u16(),l=r.u16();if(i!==1&&i!==6)continue;let u=e.at(a+l).bytes(c),d;if(t===3||t===0)d=Tw(u);else if(t===1&&n===0)d=Ew(u);else continue;i===1&&!o&&(o=d),i===6&&!s&&(s=d)}return{familyName:o||`Unknown`,postScriptName:s||o||`Unknown`}}function bw(e,t){let n=t.offset,r=e.at(n);r.skip(2);let i=r.u16(),a=-1,o=-1;for(let t=0;t<i;t++){let t=r.u16(),i=r.u16(),s=r.u32();if(!(t===0||t===3&&(i===1||i===10)))continue;let c=e.u16At(n+s);c===12&&o<0&&(o=n+s),c===4&&a<0&&(a=n+s)}if(o>=0)return Sw(e,o);if(a>=0)return xw(e,a);throw new Nx(`No usable Unicode cmap subtable found in font`)}function xw(e,t){let n=e.at(t);n.skip(2),n.skip(2),n.skip(2);let r=n.u16()/2;n.skip(6);let i=[];for(let e=0;e<r;e++)i.push(n.u16());n.skip(2);let a=[];for(let e=0;e<r;e++)a.push(n.u16());let o=[];for(let e=0;e<r;e++)o.push(n.i16());let s=n.offset,c=[];for(let e=0;e<r;e++)c.push(n.u16());let l=new Map;for(let t=0;t<r;t++){let n=a[t],r=i[t],u=o[t],d=c[t];if(n===65535)break;for(let i=n;i<=r;i++){let r;if(d===0)r=i+u&65535;else{let a=s+t*2+d+(i-n)*2;r=e.u16At(a),r!==0&&(r=r+u&65535)}r!==0&&l.set(i,r)}}return l}function Sw(e,t){let n=e.at(t);n.skip(2),n.skip(2),n.skip(4),n.skip(4);let r=n.u32();if(r>cw)throw new Nx(`cmap format 12 has ${r} groups, exceeding limit of ${cw}. The font file may be malicious or corrupted.`);let i=new Map,a=0;for(let e=0;e<r;e++){let e=n.u32(),t=n.u32(),r=n.u32(),o=t>=e?t-e+1:0;if(a+=o,a>lw)throw new Nx(`cmap format 12 maps too many codepoints (>${lw}). The font file may be malicious or corrupted.`);for(let n=e;n<=t;n++)i.set(n,r+(n-e))}return i}function Cw(e,t,n,r){let i=e.at(t.offset),a=new Uint16Array(r),o=0;for(let e=0;e<n;e++)o=i.u16(),i.skip(2),a[e]=o;for(let e=n;e<r;e++)a[e]=o;return a}function ww(e,t,n,r){let i=e.at(t.offset),a=new Uint32Array(n+1);if(r===0)for(let e=0;e<=n;e++)a[e]=i.u16()*2;else for(let e=0;e<=n;e++)a[e]=i.u32();return a}function Tw(e){let t=[];for(let n=0;n+1<e.length;n+=2){let r=e[n]<<8|e[n+1];if(r>=55296&&r<=56319&&n+3<e.length){let i=e[n+2]<<8|e[n+3];if(i>=56320&&i<=57343){t.push(String.fromCodePoint((r-55296<<10)+(i-56320)+65536)),n+=2;continue}}t.push(String.fromCharCode(r))}return t.join(``)}function Ew(e){let t=[];for(let n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join(``)}let $={Empty:0,String:1,Number:2,Boolean:3,Date:4,RichText:5,Error:6,Formula:7,Hyperlink:8,Merge:9},Dw={A3:{width:841.89,height:1190.55},A4:{width:595.28,height:841.89},A5:{width:419.53,height:595.28},LETTER:{width:612,height:792},LEGAL:{width:612,height:1008},TABLOID:{width:792,height:1224}},Ow=1.2,kw=72/96;function Aw(e,t=1){return{left:(3+e.borderInsets.left)*t,right:(3+e.borderInsets.right)*t,top:(2+e.borderInsets.top)*t,bottom:(2+e.borderInsets.bottom)*t}}function jw(e,t,n,r){let i=new wx,a=new Set;t.showGridLines&&Mw(i,e,t);for(let t of e.cells)t.fillColor&&Nw(i,t,a);for(let t of e.cells)Iw(i,t);let o=e.scaleFactor;for(let t of e.cells)t.text&&Rw(i,t,n,a,o);return t.showSheetNames&&eT(i,e,t,n),t.showPageNumbers&&tT(i,e,t,n,r),{stream:i,alphaValues:a}}function Mw(e,t,n){if(t.columnWidths.length===0||t.rowHeights.length===0)return;let r=n.gridLineColor;e.save(),e.setStrokeColor(r),e.setLineWidth(.25);let i=t.rowYPositions[0],a=t.rowYPositions.length-1,o=t.rowYPositions[a]-t.rowHeights[a];for(let n=0;n<=t.columnWidths.length;n++){let r=n<t.columnWidths.length?t.columnOffsets[n]:t.columnOffsets[n-1]+t.columnWidths[n-1];e.moveTo(r,i),e.lineTo(r,o)}let s=t.columnOffsets[0],c=t.columnOffsets.length-1,l=t.columnOffsets[c]+t.columnWidths[c];for(let n=0;n<=t.rowYPositions.length;n++){let r=n<t.rowYPositions.length?t.rowYPositions[n]:t.rowYPositions[n-1]-t.rowHeights[n-1];e.moveTo(s,r),e.lineTo(l,r)}e.stroke(),e.restore()}function Nw(e,t,n){if(!t.fillColor)return;let r=t.fillColor.a;if(r!==void 0&&r<1){let i=Yw(r);n.add(r),e.save(),e.setGraphicsState(i),e.fillRect(t.rect.x,t.rect.y,t.rect.width,t.rect.height,t.fillColor),e.restore()}else e.fillRect(t.rect.x,t.rect.y,t.rect.width,t.rect.height,t.fillColor)}function Pw(e){return typeof e==`number`?e<=90?e:-(e-90):0}function Fw(e,t){let n=Pw(e);if(n===0)return 0;let r=Math.abs(n);if(r<.01||r>89.99)return 0;let i=r*Math.PI/180,a=t*Math.cos(i)/Math.sin(i);return n<0?-a:a}function Iw(e,t){let{rect:n,borders:r,textRotation:i}=t,{x:a,y:o,width:s,height:c}=n,l=Fw(i,c);r.top&&Lw(e,r.top,a+l,o+c,a+s+l,o+c,!0),r.bottom&&Lw(e,r.bottom,a,o,a+s,o,!0),r.left&&Lw(e,r.left,a,o,a+l,o+c,!1),r.right&&Lw(e,r.right,a+s,o,a+s+l,o+c,!1)}function Lw(e,t,n,r,i,a,o){if(t.isDouble){let s=.4,c=Math.min(t.width,.25);o?(e.drawLine(n,r+s,i,a+s,t.color,c,t.dashPattern),e.drawLine(n,r-s,i,a-s,t.color,c,t.dashPattern)):(e.drawLine(n+s,r,i+s,a,t.color,c,t.dashPattern),e.drawLine(n-s,r,i-s,a,t.color,c,t.dashPattern))}else e.drawLine(n,r,i,a,t.color,t.width,t.dashPattern)}function Rw(e,t,n,r,i=1){let{rect:a,text:o,fontSize:s,horizontalAlign:c,verticalAlign:l,wrapText:u}=t;if(!o&&!t.richText)return;let d=Aw(t,i),f=a.width-d.left-d.right,p=a.height-d.top-d.bottom;if(f<=0||p<=0)return;let m=t.indent*10*i,h=a.width+(t.textOverflowWidth||0);e.save();let g=Fw(t.textRotation,a.height);g===0?e.rect(a.x,a.y,h,a.height):(e.moveTo(a.x,a.y),e.lineTo(a.x+h,a.y),e.lineTo(a.x+h+g,a.y+a.height),e.lineTo(a.x+g,a.y+a.height),e.closePath()),e.clip(),e.endPath();let _=t.textColor.a;if(_!==void 0&&_<1&&(r.add(_),e.setGraphicsState(Yw(_))),t.textRotation===`vertical`){Jw(e,t,n,m,i),e.restore();return}if(typeof t.textRotation==`number`&&t.textRotation!==0){Bw(e,t,n,m,i),e.restore();return}if(t.richText&&t.richText.length>0){zw(e,t,n,m,i),e.restore();return}let v=n.hasEmbeddedFont(),y=v?n.getEmbeddedResourceName():n.ensureFont($C(t.fontFamily,t.bold,t.italic)),b=e=>n.measureText(e,y,s),x=f-m,S=u?$w(o,b,x):o.split(/\r?\n/),ee=s*Ow,te=n.getFontAscent(y,s),ne=Xw(l,a,S.length*ee,te,d.top,d.bottom);e.setFillColor(t.textColor);let re=n.hasType3Fonts()&&!v;for(let t=0;t<S.length;t++){let r=S[t],i=ne-t*ee;qw(e,r,Zw(c,a,b(r),m,d.left,d.right),i,y,s,n,re)}Qw(e,t,S,ee,ne,b,y,n,m,d),e.restore()}function zw(e,t,n,r,i=1){let{rect:a,horizontalAlign:o,verticalAlign:s,wrapText:c}=t,l=t.richText,u=Aw(t,i),d=t.fontSize;for(let e of l)e.fontSize>d&&(d=e.fontSize);let f=d,p=f*Ow,m=n.hasEmbeddedFont(),h=e=>m?n.getEmbeddedResourceName():n.ensureFont($C(e.fontFamily,e.bold,e.italic));if(c){let t=a.width-u.left-u.right-r;if(t<=0)return;let i=l.map(e=>e.text).join(``),c=h(l[0]),d=$w(i,e=>n.measureText(e,c,f),t),g=[];for(let e=0;e<l.length;e++)for(let t=0;t<l[e].text.length;t++)g.push(e);let _=h(l[0]),v=n.getFontAscent(_,f),y=Xw(s,a,d.length*p,v,u.top,u.bottom),b=0;for(let t=0;t<d.length;t++){let s=y-t*p,c=d[t].length,f=[],_=b;for(let e=0;e<c;e++){let n=g[b+e]??g.length-1,r=f[f.length-1];r&&r.run===l[n]?r.text+=d[t][e]:f.push({run:l[n],text:d[t][e],resourceName:h(l[n])})}for(b+=c;b<g.length&&b<_+c+1;){let e=t+1<d.length?i.indexOf(d[t+1],b):i.length;if(e>b){b=e;break}break}let v=0;for(let e of f)v+=n.measureText(e.text,e.resourceName,e.run.fontSize);let x=Zw(o,a,v,r,u.left,u.right),S=n.hasType3Fonts()&&!m;for(let t of f){let{run:r,text:i,resourceName:a}=t;e.setFillColor(r.textColor);let o=qw(e,i,x,s,a,r.fontSize,n,S);if(r.strike){let t=s+n.getFontDescent(a,r.fontSize)+r.fontSize*.3;e.drawLine(x,t,x+o,t,r.textColor,.5)}if(r.underline){let t=s+n.getFontDescent(a,r.fontSize)*.5;e.drawLine(x,t,x+o,t,r.textColor,.5)}x+=o}}return}let g=0,_=[];for(let e of l){let t=h(e),r=n.measureText(e.text,t,e.fontSize);_.push({resourceName:t,width:r}),g+=r}let v=_[0]?.resourceName??`F1`,y=Xw(s,a,p,n.getFontAscent(v,f),u.top,u.bottom),b=Zw(o,a,g,r,u.left,u.right),x=n.hasType3Fonts()&&!m;for(let t=0;t<l.length;t++){let r=l[t],{resourceName:i}=_[t];e.setFillColor(r.textColor);let a=qw(e,r.text,b,y,i,r.fontSize,n,x);if(r.strike){let t=y+n.getFontDescent(i,r.fontSize)+r.fontSize*.3;e.drawLine(b,t,b+a,t,r.textColor,.5)}if(r.underline){let t=y+n.getFontDescent(i,r.fontSize)*.5;e.drawLine(b,t,b+a,t,r.textColor,.5)}b+=a}}function Bw(e,t,n,r,i=1){let{rect:a,wrapText:o}=t,{fontSize:s}=t,c=Aw(t,i),l=n.hasEmbeddedFont()?n.getEmbeddedResourceName():n.ensureFont($C(t.fontFamily,t.bold,t.italic)),u=Pw(t.textRotation),d=u*Math.PI/180,f=Math.cos(d),p=Math.sin(d),m=Math.abs(p),h=Math.abs(f),g=a.width-c.left-c.right,_=a.height-c.top-c.bottom,v;v=m>.01&&h>.01?Math.min(_/m,g/h):m>.01?_/m:g;let y=e=>n.measureText(e,l,s),b;b=o?$w(t.text,y,Math.max(v-1,1)):t.text.split(/\r?\n/);let x=s*Ow,S=b.length*x;if(!o){let e=0;for(let t of b){let n=y(t);n>e&&(e=n)}let t=e*h+S*m,n=e*m+S*h;if(g>0&&_>0&&(t>g||n>_)){let e=Math.min(g/t,_/n);e<1&&(s*=e)}}let ee=s*Ow,te=n.getFontAscent(l,s),ne=Math.abs(u-90)<.01,re=Math.abs(u+90)<.01;e.setFillColor(t.textColor),ne?Vw(e,t,b,n,l,s,ee,te,c):re?Hw(e,t,b,n,l,s,ee,te,c):Uw(e,t,b,n,l,s,ee,te,f,p,r)}function Vw(e,t,n,r,i,a,o,s,c){let{rect:l,horizontalAlign:u,verticalAlign:d}=t,f=n.length*o,p;p=u===`center`?l.x+l.width/2-f/2+s:u===`right`?l.x+l.width-c.right-f+s:l.x+c.left+s;let m=r.hasType3Fonts()&&!r.hasEmbeddedFont();for(let t=0;t<n.length;t++){let s=n[t],u=r.measureText(s,i,a),f=p+t*o,h;h=d===`top`?l.y+l.height-c.top-u:d===`middle`?l.y+(l.height-u)/2:l.y+c.bottom,h=Math.max(h,l.y+c.bottom),Gw(e,s,0,1,-1,0,f,h,i,a,r,m)}}function Hw(e,t,n,r,i,a,o,s,c){let{rect:l,horizontalAlign:u,verticalAlign:d}=t,f=n.length*o,p;p=u===`center`?l.x+l.width/2+f/2-o+s:u===`right`?l.x+l.width-c.right-o+s:l.x+c.left+f-o+s;let m=r.hasType3Fonts()&&!r.hasEmbeddedFont();for(let t=0;t<n.length;t++){let s=n[t],u=r.measureText(s,i,a),f=p-t*o,h;h=d===`top`?l.y+l.height-c.top:d===`middle`?l.y+(l.height+u)/2:l.y+c.bottom+u,h=Math.min(h,l.y+l.height-c.top),Gw(e,s,0,-1,1,0,f,h,i,a,r,m)}}function Uw(e,t,n,r,i,a,o,s,c,l,u){let{rect:d,horizontalAlign:f,verticalAlign:p}=t,m=Aw(t),h=0;for(let e of n){let t=r.measureText(e,i,a);t>h&&(h=t)}let g=n.length*o,_=Math.abs(l),v=Math.abs(c),y=h*v+g*_,b=h*_+g*v,x=Fw(t.textRotation,d.height)/2,S=f===`left`?u/2:f===`right`?-u/2:0,ee;ee=p===`top`?d.y+d.height-m.top-b/2:p===`bottom`?d.y+m.bottom+b/2:d.y+d.height/2;let te=d.height>0?(ee-d.y)/d.height:.5,ne=x*2*te,re;re=f===`right`?d.x+d.width-m.right-y/2+S+ne:f===`left`?d.x+m.left+y/2+S+ne:d.x+d.width/2+S+ne;let ie=r.hasType3Fonts()&&!r.hasEmbeddedFont();for(let t=0;t<n.length;t++){let u=n[t],d=r.measureText(u,i,a),f=(t-(n.length-1)/2)*o,p=-d/2,m=-s/2-f,h=re+p*c-m*l,g=ee+p*l+m*c;Gw(e,u,c,l,-l,c,h,g,i,a,r,ie)}}function Ww(e,t,n,r){let i=t.encodeText(n,r);i?e.showTextHex(i):e.showText(n)}function Gw(e,t,n,r,i,a,o,s,c,l,u,d){if(!d){e.beginText(),e.setFont(c,l),e.setTextMatrix(n,r,i,a,o,s),Ww(e,u,t,c),e.endText();return}let f=Kw(t,u),p=o,m=s;for(let t of f){e.beginText(),t.type3?(e.setFont(t.type3.resourceName,l),e.setTextMatrix(n,r,i,a,p,m),e.showTextHex(t.type3.hex)):(e.setFont(c,l),e.setTextMatrix(n,r,i,a,p,m),Ww(e,u,t.text,c)),e.endText();let o=u.measureText(t.text,t.type3?.resourceName??c,l);p+=n*o,m+=r*o}}function Kw(e,t){let n=[],r=``,i=()=>{r&&=(n.push({text:r,type3:null}),``)};for(let a=0;a<e.length;a++){let o=e.codePointAt(a),s=String.fromCodePoint(o);if(o>65535&&a++,t.needsType3(o)){i();let e=t.resolveType3(o);if(e){let r=t.encodeType3Char(o);n.push({text:s,type3:{resourceName:e.resourceName,hex:r??`<00>`}})}else n.push({text:s,type3:null})}else r+=s}return i(),n}function qw(e,t,n,r,i,a,o,s){return Gw(e,t,1,0,0,1,n,r,i,a,o,s),o.measureText(t,i,a)}function Jw(e,t,n,r,i=1){let{rect:a,text:o,fontSize:s,horizontalAlign:c,verticalAlign:l}=t,u=Aw(t,i),d=n.hasEmbeddedFont(),f=d?n.getEmbeddedResourceName():n.ensureFont($C(t.fontFamily,t.bold,t.italic)),p=s*1.3,m=n.getFontAscent(f,s),h=o.split(/\r?\n/),g=s*1.4,_=h.length*g,v;v=c===`center`?a.x+a.width/2-_/2+g/2:c===`right`?a.x+a.width-u.right-_+g/2:a.x+u.left+g/2,e.setFillColor(t.textColor);let y=n.hasType3Fonts()&&!d;for(let t=0;t<h.length;t++){let r=h[t],i=v+t*g,o=r.length*p,c;c=l===`middle`?a.y+a.height/2+o/2-m:l===`bottom`?a.y+u.bottom+o-m:a.y+a.height-u.top-m;for(let t of r){if(c<a.y+u.bottom)break;Gw(e,t,1,0,0,1,i-n.measureText(t,f,s)/2,c,f,s,n,y),c-=p}}}function Yw(e){return`GS${Math.round(e*1e4)}`}function Xw(e,t,n,r,i=2,a=i){let o;switch(e){case`top`:o=t.y+t.height-i-r;break;case`middle`:o=t.y+t.height/2+n/2-r;break;default:o=t.y+a+(n-r);break}let s=t.y+t.height-i-r;o>s&&(o=s);let c=t.y+a;return o<c&&(o=c),o}function Zw(e,t,n,r=0,i=3,a=i){let o;switch(e){case`center`:o=t.x+(t.width-n)/2;break;case`right`:o=t.x+t.width-a-n;break;default:o=t.x+i+r;break}let s=t.x+i;return o<s&&(o=s),o}function Qw(e,t,n,r,i,a,o,s,c,l){if(t.strike){let u=i+s.getFontDescent(o,t.fontSize)+t.fontSize*.3;for(let i=0;i<n.length;i++){let o=u-i*r,s=a(n[i]),d=Zw(t.horizontalAlign,t.rect,s,c,l?.left,l?.right);e.drawLine(d,o,d+s,o,t.textColor,.5)}}if(t.underline){let u=s.getFontDescent(o,t.fontSize)*.5;for(let o=0;o<n.length;o++){let s=i-o*r+u,d=a(n[o]),f=Zw(t.horizontalAlign,t.rect,d,c,l?.left,l?.right);e.drawLine(f,s,f+d,s,t.textColor,.5)}}}function $w(e,t,n){if(!e)return[``];let r=e.split(/\r?\n/),i=[];for(let e of r){if(!e){i.push(``);continue}let r=e.split(/\s+/),a=``;for(let e of r){if(!a){a=e;continue}let r=a+` `+e;t(r)<=n?a=r:(i.push(a),a=e)}a&&i.push(a)}return i.length>0?i:[``]}function eT(e,t,n,r){let i=t.sheetName,a=r.hasEmbeddedFont()?r.getEmbeddedResourceName():r.ensureFont($C(n.defaultFontFamily,!0,!1)),o=r.measureText(i,a,10),s=(t.width-o)/2,c=t.height-n.margins.top+5;e.save(),e.setFillColor({r:.3,g:.3,b:.3}),Gw(e,i,1,0,0,1,s,c,a,10,r,r.hasType3Fonts()&&!r.hasEmbeddedFont()),e.restore()}function tT(e,t,n,r,i){let a=`Page ${t.pageNumber} of ${i}`,o=r.ensureFont($C(n.defaultFontFamily,!1,!1)),s=r.measureText(a,o,9),c=(t.width-s)/2,l=Math.max(5,n.margins.bottom-15);e.save(),e.setFillColor({r:.5,g:.5,b:.5}),e.beginText(),e.setFont(o,9),e.setTextMatrix(1,0,0,1,c,l),e.showText(a),e.endText(),e.restore()}let nT={fontSize:54,color:{r:.75,g:.75,b:.75},opacity:.15,rotation:-45,fontFamily:`Helvetica`,bold:!1,italic:!1,repeatSpacingX:200,repeatSpacingY:200},rT={opacity:.15,rotation:0,scale:.5,repeatSpacingX:200,repeatSpacingY:200};function iT(e,t,n,r){return n.type===`text`?cT(e,t,aT(n),r):lT(e,t,oT(n))}function aT(e){return{...e,opacity:sT(e.opacity??nT.opacity),fontSize:Math.max(1,e.fontSize??nT.fontSize),repeatSpacingX:Math.max(10,e.repeatSpacingX??nT.repeatSpacingX),repeatSpacingY:Math.max(10,e.repeatSpacingY??nT.repeatSpacingY)}}function oT(e){return{...e,opacity:sT(e.opacity??rT.opacity),scale:Math.max(.01,e.scale??rT.scale),width:e.width===void 0?void 0:Math.max(1,e.width),height:e.height===void 0?void 0:Math.max(1,e.height),repeatSpacingX:Math.max(10,e.repeatSpacingX??rT.repeatSpacingX),repeatSpacingY:Math.max(10,e.repeatSpacingY??rT.repeatSpacingY)}}function sT(e){return Math.max(0,Math.min(1,e))}function cT(e,t,n,r){let i=n.fontSize??nT.fontSize,a=n.color??nT.color,o=n.opacity??nT.opacity,s=n.rotation??nT.rotation,c=n.fontFamily??nT.fontFamily,l=n.bold??nT.bold,u=n.italic??nT.italic,d=r.hasEmbeddedFont(),f=d?r.getEmbeddedResourceName():r.ensureFont($C(c,l,u)),p=r.measureText(n.text,f,i),m=i*.7,h=s*Math.PI/180,g=Math.cos(h),_=Math.sin(h),v=o<1,y=v?Yw(o):``,b=r.hasType3Fonts()&&!d,x=(t,o)=>{let s=p/2,c=m/2,l=t-s*g+c*_,u=o-s*_-c*g;e.save(),v&&e.setGraphicsState(y),e.setFillColor(a),Gw(e,n.text,g,_,-_,g,l,u,f,i,r,b),e.restore()};if(n.repeat){let e=n.repeatSpacingX??nT.repeatSpacingX,r=n.repeatSpacingY??nT.repeatSpacingY;dT(t.width,t.height,e,r,x)}else{let{cx:e,cy:r}=uT(t,n.position);x(e,r)}return{alphaValues:v?[o]:[],imageXObjects:[]}}function lT(e,t,n){let r=n.opacity??rT.opacity,i=n.rotation??rT.rotation,a=n.scale??rT.scale,o=r<1,s,c;if(n.width!==void 0&&n.height!==void 0)s=n.width,c=n.height;else{let e=px(n.data,n.format),r=Math.min(t.width,t.height)*a,i=Math.max(e.width,e.height),o=i>0?r/i:1;s=e.width*o,c=e.height*o}let l=i*Math.PI/180,u=Math.cos(l),d=Math.sin(l),f=o?Yw(r):``,p=`WmImg`,m=(t,n)=>{e.save(),o&&e.setGraphicsState(f);let r=s/2,i=c/2,a=t-r*u+i*d,l=n-r*d-i*u;e.concat(s*u,s*d,-c*d,c*u,a,l),e.doXObject(p),e.restore()};if(n.repeat){let e=n.repeatSpacingX??rT.repeatSpacingX,r=n.repeatSpacingY??rT.repeatSpacingY;dT(t.width,t.height,e,r,m)}else{let{cx:e,cy:r}=uT(t,n.position);m(e,r)}return{alphaValues:o?[r]:[],imageXObjects:[{name:p,data:n.data,format:n.format}]}}function uT(e,t){return!t||t===`center`?{cx:e.width/2,cy:e.height/2}:{cx:t.x,cy:t.y}}function dT(e,t,n,r,i){let a=Math.max(e,t)*.5,o=0;for(let s=-a;s<t+a;s+=r){let t=o%2==1?n/2:0;for(let r=-a;r<e+a;r+=n)i(r+t,s);o++}}function fT(e){if(!e||e.length<6)return null;let t,n,r,i;if(e.length>=8?(t=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),r=parseInt(e.substring(4,6),16),i=parseInt(e.substring(6,8),16)):(t=255,n=parseInt(e.substring(0,2),16),r=parseInt(e.substring(2,4),16),i=parseInt(e.substring(4,6),16)),isNaN(n)||isNaN(r)||isNaN(i))return null;let a=t/255;return{r:n/255,g:r/255,b:i/255,...a<1?{a}:{}}}function pT(e){if(!e)return null;if(e.argb)return fT(e.argb);if(e.theme!==void 0){let t=mT(e.theme);if(!t)return null;let n=e.tint;return n!==void 0&&n!==0?hT(t,n):t}return null}function mT(e){let t=[{r:1,g:1,b:1},{r:0,g:0,b:0},{r:.906,g:.902,b:.902},{r:.267,g:.329,b:.416},{r:.267,g:.447,b:.769},{r:.929,g:.49,b:.192},{r:.647,g:.647,b:.647},{r:1,g:.753,b:0},{r:.357,g:.608,b:.835},{r:.439,g:.678,b:.278}];return e>=0&&e<t.length?t[e]:null}function hT(e,t){let n=e=>t<0?e*(1+t):e+(1-e)*t;return{r:Math.max(0,Math.min(1,n(e.r))),g:Math.max(0,Math.min(1,n(e.g))),b:Math.max(0,Math.min(1,n(e.b)))}}let gT={black:{r:0,g:0,b:0},white:{r:1,g:1,b:1},gridLine:{r:.816,g:.816,b:.816}};function _T(e,t,n){return{fontFamily:e?.name??t,fontSize:e?.size??n,bold:e?.bold??!1,italic:e?.italic??!1,strike:e?.strike??!1,underline:!!(e?.underline&&e.underline!==`none`),textColor:pT(e?.color)??gT.black}}function vT(e){if(!e)return null;if(e.type===`pattern`){if(e.pattern===`solid`&&e.fgColor)return pT(e.fgColor);if(e.pattern===`none`)return null;if(e.fgColor)return pT(e.fgColor)}return e.type===`gradient`&&e.stops&&e.stops.length>0?pT(e.stops[0].color):null}function yT(e){switch(e){case`thin`:return .25;case`medium`:return .5;case`thick`:return 1;case`double`:return .25;case`hair`:return .1;case`dotted`:return .25;case`dashed`:return .25;case`dashDot`:return .25;case`dashDotDot`:return .25;case`slantDashDot`:return .25;case`mediumDashed`:return .5;case`mediumDashDot`:return .5;case`mediumDashDotDot`:return .5;default:return .25}}function bT(e){switch(e){case`dotted`:return[1,1];case`dashed`:case`mediumDashed`:return[3,2];case`dashDot`:case`mediumDashDot`:return[3,1,1,1];case`dashDotDot`:case`mediumDashDotDot`:return[3,1,1,1,1,1];case`slantDashDot`:return[4,2,1,2];case`hair`:return[.5,.5];default:return[]}}function xT(e){return!e||!e.style?null:{width:yT(e.style),color:pT(e.color)??gT.black,dashPattern:bT(e.style),isDouble:e.style===`double`}}function ST(e){return e?{top:xT(e.top),right:xT(e.right),bottom:xT(e.bottom),left:xT(e.left)}:{top:null,right:null,bottom:null,left:null}}function CT(e){if(!e?.horizontal)return`left`;switch(e.horizontal){case`center`:case`centerContinuous`:return`center`;case`right`:return`right`;default:return`left`}}function wT(e){if(!e?.vertical)return`bottom`;switch(e.vertical){case`top`:return`top`;case`middle`:return`middle`;default:return`bottom`}}let TT=8.43;function ET(e,t,n){if(e?.horizontal&&e.horizontal!==`general`)return CT(e);if(t!==void 0)switch(t){case $.Number:case $.Date:return`right`;case $.Boolean:case $.Error:return`center`;case $.Formula:return typeof n==`number`||n instanceof Date?`right`:typeof n==`boolean`?`center`:`left`;default:return`left`}return`left`}async function DT(e,t,n){let r=OT(e,t,n);if(!r)return[AT(e,t)];let i=[],a=r.rowPages.length*r.colGroups.length;for(let o of r.rowPages)for(let s of r.colGroups)i.push(kT(r,o,s,i.length,e,t,n)),i.length<a&&await dl();return i.length>0&&e.images&&KT(e.images,i,r.scaleFactor),i}function OT(e,t,n){let{margins:r}=t,i=t.pageSize.width,a=t.pageSize.height;t.orientation===`landscape`&&([i,a]=[a,i]);let o=i-r.left-r.right,s=a-r.top-r.bottom,c=t.showSheetNames?20:0,l=t.showPageNumbers?20:0,u=s-c-l,d=NT(e),{columnWidths:f,visibleCols:p}=PT(e,d);if(p.length===0)return null;let m=f.reduce((e,t)=>e+t,0),h=t.scale;if(t.fitToPage&&m>0){let e=o/m;e<1&&(h*=e)}let g=f.map(e=>e*h),{rowHeights:_,visibleRows:v}=FT(e,h,d,n,t),y=BT(e),b=VT(_,u,typeof t.repeatRows==`number`?t.repeatRows:0,zT(e,v)),x=HT(g,o,e,p);return{pageWidth:i,pageHeight:a,contentWidth:o,headerHeight:c,scaleFactor:h,scaledColumnWidths:g,rowHeights:_,visibleRows:v,visibleCols:p,mergeMap:y,rowPages:b,colGroups:x,margins:r}}function kT(e,t,n,r,i,a,o){let{scaledColumnWidths:s,rowHeights:c,visibleRows:l,visibleCols:u,mergeMap:d,pageWidth:f,pageHeight:p,contentWidth:m,headerHeight:h,scaleFactor:g,margins:_}=e,v=[],y=n.map(e=>s[e]),b=y.reduce((e,t)=>e+t,0),x=[],S=_.left;b<m&&(S=_.left+(m-b)/2);for(let e of y)x.push(S),S+=e;let ee=[],te=[],ne=p-_.top-h;for(let e of t){let t=c[e]??15*g;ee.push(ne),te.push(t),ne-=t}let re=new Map;for(let e=0;e<t.length;e++){let r=t[e],s=l[r];for(let t=0;t<n.length;t++){let c=u[n[t]],f=`${s}:${c}`,p=d.get(f);if(p&&!p.isMaster)continue;let m=i.rows.get(s)?.cells.get(c),h=1,_=1;if(p&&p.isMaster){let e=c+p.colSpan-1;h=0;for(let r=t;r<n.length&&u[n[r]]<=e;r++)h++;let i=s+p.rowSpan-1;_=0;for(let e=r;e<l.length&&l[e]<=i;e++)_++;h=Math.max(h,1),_=Math.max(_,1)}let b=x[t],S=ee[e],ne=0;for(let e=0;e<h&&t+e<y.length;e++)ne+=y[t+e];let ie=0;for(let t=0;t<_&&e+t<te.length;t++)ie+=te[e+t];let ae=S-ie;v.push(UT(m,b,ae,ne,ie,h,_,a,o,g));let oe=v[v.length-1];p?.isMaster&&qT(oe,p,s,c,i),re.set(`${e}:${t}`,oe)}}return GT(re,t.length,n.length),JT(re,t,n,l,u,y,d,o),{pageNumber:r+1,options:a,cells:v,width:f,height:p,sheetName:i.name,sheetCols:n.map(e=>u[e]),columnOffsets:x,columnWidths:y,sheetRows:t.map(e=>l[e]),rowYPositions:ee,rowHeights:te,images:[],scaleFactor:g}}function AT(e,t){let n=t.pageSize.width,r=t.pageSize.height;return t.orientation===`landscape`&&([n,r]=[r,n]),{pageNumber:1,options:t,cells:[],width:n,height:r,sheetName:e.name,sheetCols:[],columnOffsets:[],columnWidths:[],sheetRows:[],rowYPositions:[],rowHeights:[],images:[],scaleFactor:1}}function jT(e){let t=e.replace(/\$/g,``).toUpperCase(),n=0,r=0;for(;r<t.length&&t.charCodeAt(r)>=65&&t.charCodeAt(r)<=90;)n=n*26+(t.charCodeAt(r)-64),r++;let i=parseInt(t.substring(r),10);return{c:n-1,r:i-1}}function MT(e){let t=e.indexOf(`:`);if(t===-1){let t=jT(e);return{s:t,e:{...t}}}return{s:jT(e.slice(0,t)),e:jT(e.slice(t+1))}}function NT(e){let t=e.pageSetup?.printArea;if(!t||typeof t!=`string`)return null;let n=t.split(`&&`)[0].trim();if(!n)return null;try{let e=MT(n);return{startRow:e.s.r+1,endRow:e.e.r+1,startCol:e.s.c+1,endCol:e.e.c+1}}catch{return null}}function PT(e,t){let n=e.bounds;if(!(n.top>0&&n.left>0))return{columnWidths:[],visibleCols:[]};let r=t?.startCol??n.left,i=t?.endCol??n.right,a=[],o=[];for(let t=r;t<=i;t++){let n=e.columns.get(t);if(n?.hidden)continue;let r=(n?.width??TT)*7+5,i=Math.max(r*kw,3);a.push(i),o.push(t)}return{columnWidths:a,visibleCols:o}}function FT(e,t,n,r,i){let a=e.bounds;if(a.top<=0)return{rowHeights:[],visibleRows:[]};let o=n?.startRow??a.top,s=n?.endRow??a.bottom,c=[],l=[];for(let n=o;n<=s;n++){let a=e.rows.get(n);if(a?.hidden)continue;let o;o=a?.height&&a.customHeight?a.height:a?.height?Math.max(a.height,IT(a,t,e,r,i)):IT(a,t,e,r,i),c.push(o*t),l.push(n)}return{rowHeights:c,visibleRows:l}}function IT(e,t,n,r,i){let a=15;if(e)for(let o of e.cells.values()){let e=LT(o),s=RT(o,e,t,n,r,i),c=e*Ow,l=o.style?.border?.top?.style?yT(o.style.border.top.style)/2:0,u=o.style?.border?.bottom?.style?yT(o.style.border.bottom.style)/2:0,d=e+(s-1)*c+(2+l+u)*2;d>a&&(a=d)}return a}function LT(e){let t=e.style?.font?.size??11;if(e.type===$.RichText){let n=e.value;if(n&&typeof n==`object`&&`richText`in n){let e=n.richText;for(let n of e){let e=n.font?.size??t;e>t&&(t=e)}}}return t}function RT(e,t,n,r,i,a){let o=typeof e.text==`string`?e.text:String(e.text??``),s=Math.max(1,(o.match(/\n/g)??[]).length+1);if(!e.style?.alignment?.wrapText||o.length===0)return s;let c=((r.columns.get(e.col)?.width??TT)*7+5)*kw*n,l=e.style.alignment.indent??0,u=e.style?.border?.left?.style?yT(e.style.border.left.style)/2:0,d=e.style?.border?.right?.style?yT(e.style.border.right.style)/2:0,f=3+u+(3+d)+l*10,p=Math.max(c-f,1),m=t*n,h=_T(e.style.font,a.defaultFontFamily,a.defaultFontSize),g=$C(h.fontFamily,h.bold,h.italic),_=i.hasEmbeddedFont()?i.getEmbeddedResourceName():i.ensureFont(g),v=$w(o,e=>i.measureText(e,_,m),p);return Math.max(s,v.length)}function zT(e,t){let n=new Set,r=e.rowBreaks??[];if(r.length===0)return n;let i=new Map;for(let e=0;e<t.length;e++)i.set(t[e],e);for(let e of r){let t=i.get(e);t!==void 0&&n.add(t+1)}return n}function BT(e){let t=new Map,n=e.merges;if(!n||n.length===0)return t;for(let e of n){let n=MT(e),r=n.s.r+1,i=n.s.c+1,a=n.e.r+1,o=n.e.c+1,s=a-r+1,c=o-i+1;for(let e=r;e<=a;e++)for(let n=i;n<=o;n++)t.set(`${e}:${n}`,{isMaster:e===r&&n===i,rowSpan:s,colSpan:c})}return t}function VT(e,t,n,r){if(e.length===0)return[[]];let i=[],a=[],o=0,s=!0,c=0,l=()=>{c=0;for(let r=0;r<n&&r<e.length&&!(o+e[r]>t&&a.length>0);r++)a.push(r),o+=e[r],c++};for(let u=0;u<e.length;u++){let d=e[u],f=t;for(;;){let e=r.has(u)&&a.length>0;if((e||o+d>f)&&a.length>0){if(!e&&!s&&a.length>0&&a.length===c){a=[],o=0,c=0;continue}i.push(a),a=[],o=0,c=0,s=!1,l();continue}if(!s&&u<n&&a.includes(u))break;a.push(u),o+=d;break}}return a.length>0&&i.push(a),i.length>0?i:[[]]}function HT(e,t,n,r){if(e.length===0)return[[]];let i=new Set,a=n.colBreaks??[];if(a.length>0){let e=new Map;for(let t=0;t<r.length;t++)e.set(r[t],t);for(let t of a){let n=e.get(t);n!==void 0&&i.add(n+1)}}let o=[],s=[],c=0;for(let n=0;n<e.length;n++){let r=e[n];(i.has(n)&&s.length>0||c+r>t+.01)&&s.length>0&&(o.push(s),s=[],c=0),s.push(n),c+=r}return s.length>0&&o.push(s),o.length>0?o:[Array.from({length:e.length},(e,t)=>t)]}function UT(e,t,n,r,i,a,o,s,c,l){let u=e?.text??``,d=e?.style??{},f=_T(d.font,s.defaultFontFamily,s.defaultFontSize),p=f.fontSize*l;if(c.hasEmbeddedFont())c.trackText(u);else{let e=$C(f.fontFamily,f.bold,f.italic);c.ensureFont(e),c.trackText(u)}let m=YT(e,s,c,l),h=ST(d.border);return{text:u,rect:{x:t,y:n,width:r,height:i},fontFamily:f.fontFamily,fontSize:p,bold:f.bold,italic:f.italic,strike:f.strike,underline:f.underline,textColor:f.textColor,fillColor:vT(d.fill),horizontalAlign:ET(d.alignment,e?.type,e?.result),verticalAlign:wT(d.alignment),wrapText:d.alignment?.wrapText??!1,borders:h,borderInsets:{top:(h.top?.width??0)/2,right:(h.right?.width??0)/2,bottom:(h.bottom?.width??0)/2,left:(h.left?.width??0)/2},colSpan:a,rowSpan:o,hyperlink:e?.hyperlink??null,richText:m,indent:d.alignment?.indent??0,textRotation:d.alignment?.textRotation===255?`vertical`:d.alignment?.textRotation??0,textOverflowWidth:0}}function WT(e){let t=e.width*1e3;e.dashPattern.length===0&&(t+=100),e.isDouble&&(t+=50);let n=e.color.r+e.color.g+e.color.b;return t+=(3-n)*10,t}function GT(e,t,n){for(let r=0;r<t;r++)for(let t=0;t<n;t++){let n=e.get(`${r}:${t}`);if(n){if(n.borders.right){let i=e.get(`${r}:${t+1}`);if(i?.borders.left){let e=WT(n.borders.right);WT(i.borders.left)>e?(n.borderInsets.right=i.borders.left.width/2,n.borders.right=null):(i.borderInsets.left=n.borders.right.width/2,i.borders.left=null)}}if(n.borders.bottom){let i=e.get(`${r+1}:${t}`);if(i?.borders.top){let e=WT(n.borders.bottom);WT(i.borders.top)>e?(n.borderInsets.bottom=i.borders.top.width/2,n.borders.bottom=null):(i.borderInsets.top=n.borders.bottom.width/2,i.borders.top=null)}}}}}function KT(e,t,n){for(let r of e){let e=r.range.tl,i=(e.nativeCol??e.col??0)+1,a=(e.nativeRow??e.row??0)+1,o=t.find(e=>e.sheetCols.includes(i)&&e.sheetRows.includes(a));if(!o)continue;let s=o.sheetCols.indexOf(i),c=o.sheetRows.indexOf(a),l=o.columnOffsets[s]??o.options.margins.left,u=o.rowYPositions[c]??o.height-o.options.margins.top-(o.options.showSheetNames?20:0),d=((e.nativeColOff??0)/12700||0)*n,f=((e.nativeRowOff??0)/12700||0)*n,p=l+d,m=u-f,h=100,g=100;if(r.range.ext)h=(r.range.ext.width??100)*.75*n,g=(r.range.ext.height??100)*.75*n;else if(r.range.br){let e=r.range.br,t=(e.nativeCol??e.col??0)+1,i=(e.nativeRow??e.row??0)+1,a=o.sheetCols.indexOf(t),l=o.sheetRows.indexOf(i),u=a>=0?o.columnOffsets[a]:p+(o.columnWidths[s]??100),d=l>=0?o.rowYPositions[l]:m-(o.rowHeights[c]??100),f=((e.nativeColOff??0)/12700||0)*n,_=((e.nativeRowOff??0)/12700||0)*n,v=u+f,y=d-_;h=v-p,g=m-y}o.images.push({data:r.data,format:r.format,rect:{x:p,y:m-g,width:Math.abs(h),height:Math.abs(g)}})}}function qT(e,t,n,r,i){if(t.colSpan>1){let a=r+t.colSpan-1,o=i.rows.get(n)?.cells.get(a);if(o?.style?.border?.right){let t=ST({right:o.style.border.right});t.right&&(e.borders.right=t.right,e.borderInsets.right=t.right.width/2)}}if(t.rowSpan>1){let a=n+t.rowSpan-1,o=i.rows.get(a)?.cells.get(r);if(o?.style?.border?.bottom){let t=ST({bottom:o.style.border.bottom});t.bottom&&(e.borders.bottom=t.bottom,e.borderInsets.bottom=t.bottom.width/2)}}}function JT(e,t,n,r,i,a,o,s){for(let c=0;c<t.length;c++)for(let l=0;l<n.length;l++){let u=e.get(`${c}:${l}`);if(!u||u.wrapText||u.colSpan>1||!u.text||u.richText||typeof u.textRotation==`number`&&u.textRotation!==0||u.textRotation===`vertical`)continue;let d=s.hasEmbeddedFont()?s.getEmbeddedResourceName():s.ensureFont($C(u.fontFamily,u.bold,u.italic)),f=s.measureText(u.text,d,u.fontSize),p=u.rect.width-(3+u.borderInsets.left)-(3+u.borderInsets.right);if(f<=p)continue;let m=f-p,h=0;for(let s=l+1;s<n.length;s++){let l=r[t[c]],u=i[n[s]];if(o.has(`${l}:${u}`)||e.get(`${c}:${s}`)?.text||(h+=a[s],h>=m))break}h>0&&(u.textOverflowWidth=Math.min(m,h))}}function YT(e,t,n,r){if(!e||e.type!==$.RichText)return null;let i=e.value;if(!i||typeof i!=`object`||!(`richText`in i))return null;let a=i.richText;return a.length===0?null:a.map(e=>{let i=_T(e.font,t.defaultFontFamily,t.defaultFontSize);if(n.hasEmbeddedFont())n.trackText(e.text);else{let e=$C(i.fontFamily,i.bold,i.italic);n.ensureFont(e)}return{text:e.text,fontFamily:i.fontFamily,fontSize:i.fontSize*r,bold:i.bold,italic:i.italic,strike:i.strike,underline:i.underline,textColor:i.textColor}})}async function XT(e,t){let n=ZT(e,t);for(let e of n.sheets)await QT(n,e,t);return $T(n,e,t)}function ZT(e,t){let n=oE(e,t?.sheets);if(n.length===0)throw new jx(`No sheets to export. The workbook is empty or no sheets matched.`);let r=new ew,i=new Ix,a=t?.font??null;if(!a){let e=pE(n);if(e.size>0)for(let t of ow())try{let n=dw(t);if([...e].every(e=>n.cmap.has(e))){a=t;break}}catch{}}if(a)try{let e=dw(a);r.registerEmbeddedFont(e)}catch(e){if(t?.font)throw new Mx(`Failed to parse TrueType font`,{cause:e})}return{sheets:n,fontManager:r,writer:i,allPages:[]}}async function QT(e,t,n){try{let r=await DT(t,sE(n,t),e.fontManager);e.allPages.push(...r)}catch(e){throw new Mx(`Failed to layout sheet "${t.name}"`,{cause:e})}}async function $T(e,t,n){let{allPages:r,fontManager:i,writer:a,sheets:o}=e,s=sE(n,o[0]);eE(r,s,o),tE(r),nE(r,i);let c=s.watermark;if(c&&c.type===`text`){let e=c.fontFamily??`Helvetica`,t=c.bold??!1,n=c.italic??!1;i.hasEmbeddedFont()?i.trackText(c.text):i.ensureFont($C(e,t,n))}let{pageObjNums:l,sheetFirstPage:u,pagesTreeObjNum:d}=await rE(r,i,a,i.writeFontResources(a),c);return aE(a,l,d,u,s,t,n)}function eE(e,t,n){e.length===0&&e.push({pageNumber:1,options:t,cells:[],width:t.pageSize.width,height:t.pageSize.height,sheetName:n[0]?.name??`Sheet1`,sheetCols:[],columnOffsets:[],columnWidths:[],sheetRows:[],rowYPositions:[],rowHeights:[],images:[],scaleFactor:1})}function tE(e){for(let t=0;t<e.length;t++)e[t].pageNumber=t+1}function nE(e,t){if(t.hasEmbeddedFont())for(let n of e)n.options.showSheetNames&&t.trackText(n.sheetName);for(let n of e)n.options.showPageNumbers&&t.ensureFont($C(n.options.defaultFontFamily,!1,!1));if(!t.hasEmbeddedFont())for(let n of e)n.options.showSheetNames&&t.ensureFont($C(n.options.defaultFontFamily,!0,!1))}async function rE(e,t,n,r,i){let a=[],o=n.allocObject(),s=new Map,c=e.length;for(let l=0;l<e.length;l++)iE(e[l],t,n,r,c,a,o,s,i),l<e.length-1&&await dl();return{pageObjNums:a,sheetFirstPage:s,pagesTreeObjNum:o}}function iE(e,t,n,r,i,a,o,s,c){try{let{stream:l,alphaValues:u}=jw(e,e.options,t,i),d=new Map;if(e.images.length>0)for(let t=0;t<e.images.length;t++){let r=e.images[t],i=`Im${t+1}`,a=gx(n,r.data,r.format);d.set(i,a),l.drawImage(i,r.rect.x,r.rect.y,r.rect.width,r.rect.height)}let f;if(c&&fE(c,e)){let r=new wx,i=iT(r,e,c,t);for(let e of i.alphaValues)u.add(e);for(let e of i.imageXObjects){let t=gx(n,e.data,e.format);d.set(e.name,t)}f=n.allocObject(),n.addStreamObject(f,new R,r)}let p=n.allocObject();n.addStreamObject(p,new R,l);let m;m=f?(c?.placement??`under`)===`over`?`[${L(p)} ${L(f)}]`:`[${L(f)} ${L(p)}]`:L(p);let h=n.allocObject(),g=t.buildFontDictString(r),_=new R().set(`Font`,g);if(d.size>0){let e=[`<<`];for(let[t,n]of d)e.push(`/${t} ${L(n)}`);e.push(`>>`),_.set(`XObject`,e.join(`
|
|
454
|
+
`))}if(u.size>0){let e=[`<<`];for(let t of u){let r=n.allocObject(),i=new R().set(`Type`,`/ExtGState`).set(`ca`,I(t)).set(`CA`,I(t));n.addObject(r,i),e.push(`/${Yw(t)} ${L(r)}`)}e.push(`>>`),_.set(`ExtGState`,e.join(`
|
|
455
|
+
`))}n.addObject(h,_);let v=[];for(let t of e.cells)if(t.hyperlink){let e=n.allocObject(),r=`[${I(t.rect.x)} ${I(t.rect.y)} ${I(t.rect.x+t.rect.width)} ${I(t.rect.y+t.rect.height)}]`,i=new R().set(`Type`,`/Annot`).set(`Subtype`,`/Link`).set(`Rect`,r).set(`Border`,`[0 0 0]`).set(`A`,`<< /Type /Action /S /URI /URI (${t.hyperlink.replace(/[()\\]/g,`\\$&`)}) >>`);n.addObject(e,i),v.push(e)}let y=n.addPage({parentRef:o,width:e.width,height:e.height,contentsRef:m,resourcesRef:h,annotRefs:v.length>0?v:void 0});a.push(y),s.has(e.sheetName)||s.set(e.sheetName,a.length-1)}catch(t){throw new Mx(`Failed to render page ${e.pageNumber} of "${e.sheetName}"`,{cause:t})}}function aE(e,t,n,r,i,a,o){let s=`[`+t.map(e=>L(e)).join(` `)+`]`,c=new R().set(`Type`,`/Pages`).set(`Kids`,s).set(`Count`,String(t.length));e.addObject(n,c);let l;if(r.size>1&&(l=dE(e,r,t)),e.addCatalog(n,l),e.addInfoDict({title:i.title||a.title||void 0,author:i.author||a.creator||void 0,subject:i.subject||a.subject||void 0,creator:i.creator}),o?.encryption){let t=bx(o.encryption);e.setEncryption(t)}return e.build()}function oE(e,t){let n=e.sheets;if(!t||t.length===0)return n.filter(e=>e.state!==`hidden`&&e.state!==`veryHidden`);let r=[];for(let e of t)if(typeof e==`string`){let t=n.find(t=>t.name.toLowerCase()===e.toLowerCase());t&&r.push(t)}else if(typeof e==`number`){let t=n[e-1];t&&r.push(t)}return r}function sE(e,t){let n=t?.pageSetup,r=lE(e?.pageSize,n?.paperSize),i=e?.orientation??(n?.orientation===`landscape`?`landscape`:`portrait`),a=uE(e?.margins,n?.margins),o=fT(e?.gridLineColor??`FFD0D0D0`)??{r:.816,g:.816,b:.816},s=e?.repeatRows??!1;if(s===!1&&n?.printTitlesRow){let e=n.printTitlesRow.match(/^(\d+)(?::(\d+))?$/);e&&(s=parseInt(e[2]??e[1],10))}return{pageSize:r,orientation:i,margins:a,fitToPage:e?.fitToPage===void 0?!0:e.fitToPage,scale:Math.max(.1,Math.min(3,e?.scale??(e?.fitToPage===void 0||e.fitToPage?1:n?.scale?n.scale/100:1))),showGridLines:e?.showGridLines??n?.showGridLines??!1,gridLineColor:o,repeatRows:s,defaultFontFamily:e?.defaultFontFamily??`Helvetica`,defaultFontSize:e?.defaultFontSize??11,showSheetNames:e?.showSheetNames??!1,showPageNumbers:e?.showPageNumbers??!1,title:e?.title??``,author:e?.author??``,subject:e?.subject??``,creator:e?.creator??`excelts`,watermark:e?.watermark}}let cE={1:Dw.LETTER,5:Dw.LEGAL,9:Dw.A4,8:Dw.A3,11:Dw.A5,17:Dw.TABLOID};function lE(e,t){return e?typeof e==`string`?Dw[e]??Dw.A4:e:t===void 0?Dw.A4:cE[t]??Dw.A4}function uE(e,t){let n=t?{top:t.top*72,right:t.right*72,bottom:t.bottom*72,left:t.left*72}:{top:72,right:72,bottom:72,left:72};return e?{top:e.top??n.top,right:e.right??n.right,bottom:e.bottom??n.bottom,left:e.left??n.left}:n}function dE(e,t,n){let r=e.allocObject(),i=Array.from(t.entries()),a=[];for(let t=0;t<i.length;t++)a.push(e.allocObject());for(let t=0;t<i.length;t++){let[o,s]=i[t],c=n[s],l=new R().set(`Title`,ex(o)).set(`Parent`,L(r)).set(`Dest`,`[${L(c)} /Fit]`);t>0&&l.set(`Prev`,L(a[t-1])),t<i.length-1&&l.set(`Next`,L(a[t+1])),e.addObject(a[t],l)}let o=new R().set(`Type`,`/Outlines`).set(`First`,L(a[0])).set(`Last`,L(a[a.length-1])).set(`Count`,String(i.length));return e.addObject(r,o),r}function fE(e,t){if(e.pages&&e.pages.length>0&&!e.pages.includes(t.pageNumber))return!1;if(e.sheets&&e.sheets.length>0){let n=t.sheetName.toLowerCase();if(!e.sheets.some(e=>e.toLowerCase()===n))return!1}return!0}function pE(e){let t=new Set;for(let n of e)for(let e of n.rows.values())for(let n of e.cells.values())if(mE(n.text,t),n.type===$.RichText&&n.value&&typeof n.value==`object`&&`richText`in n.value){let e=n.value.richText;for(let n of e)mE(n.text,t)}return t}function mE(e,t){if(e)for(let n=0;n<e.length;n++){let r=e.codePointAt(n);r>65535&&n++,kx(r)||t.add(r)}}async function hE(e,t){return XT(gE(e),t)}function gE(e){return Array.isArray(e)?{sheets:[_E({data:e})]}:`sheets`in e?{title:e.title,creator:e.author,sheets:e.sheets.map((e,t)=>_E(e,t))}:{sheets:[_E(e)]}}function _E(e,t){let n=e.data,r=e.name??`Sheet${(t??0)+1}`,i=e.columns?.map(e=>typeof e==`number`?void 0:e.header),a=i?.some(e=>e!==void 0)??!1,o=0;for(let e of n)e.length>o&&(o=e.length);let s=Math.max(o,e.columns?.length??0),c=n.length+ +!!a;if(e.images)for(let t of e.images){let e=t.col+1,n=t.row+1;e>s&&(s=e),n>c&&(c=n)}if(s===0)return{name:r,bounds:{top:0,left:0,bottom:0,right:0},columns:new Map,rows:new Map};let l=new Map;if(e.columns)for(let t=0;t<e.columns.length;t++){let n=e.columns[t],r=typeof n==`number`?n:n.width;l.set(t+1,{width:r??12})}for(let e=1;e<=s;e++)l.has(e)||l.set(e,{width:12});let u=new Map,d=1;if(a&&i){let e=new Map;for(let t=0;t<i.length;t++){let n=i[t];n!==void 0&&e.set(t+1,{type:$.String,value:n,text:n,col:t+1,style:{font:{bold:!0}}})}u.set(1,{cells:e}),d=2}for(let e=0;e<n.length;e++){let t=e+d,r=n[e],i=new Map;for(let e=0;e<r.length;e++){let t=vE(r[e],e+1);t&&i.set(e+1,t)}u.set(t,{cells:i})}let f;if(e.images&&e.images.length>0){f=e.images.map(e=>({data:e.data,format:e.format,range:{tl:{col:e.col,row:e.row},ext:{width:e.width,height:e.height}}}));for(let e=1;e<=s;e++)l.has(e)||l.set(e,{width:12});for(let e=1;e<=c;e++)u.has(e)||u.set(e,{cells:new Map})}return{name:r,bounds:{top:1,left:1,bottom:c,right:s},columns:l,rows:u,images:f}}function vE(e,t){if(e==null)return null;if(typeof e==`object`&&!(e instanceof Date)&&`value`in e){let n=e,r=vE(n.value,t);if(!r)return null;let i={};return(n.bold||n.italic||n.fontSize||n.fontColor)&&(i.font={bold:n.bold,italic:n.italic,size:n.fontSize,color:n.fontColor?{argb:n.fontColor}:void 0}),n.fillColor&&(i.fill={type:`pattern`,pattern:`solid`,fgColor:{argb:n.fillColor}}),n.align&&(i.alignment={horizontal:n.align}),r.style=i,r}return typeof e==`string`?{type:$.String,value:e,text:e,col:t}:typeof e==`number`?{type:$.Number,value:e,text:String(e),col:t}:typeof e==`boolean`?{type:$.Boolean,value:e,text:e?`TRUE`:`FALSE`,col:t}:e instanceof Date?{type:$.Date,value:e,text:e.toLocaleDateString(),col:t}:null}async function yE(e,t){return XT(bE(e),t)}function bE(e){return{title:e.title||void 0,creator:e.creator||void 0,subject:e.subject||void 0,sheets:e.worksheets.map(t=>xE(t,e))}}function xE(e,t){let n=e.dimensions,r=n&&n.model.top>0&&n.model.left>0,i=r?{top:n.model.top,left:n.model.left,bottom:n.model.bottom,right:n.model.right}:{top:0,left:0,bottom:0,right:0},a=new Map;if(r)for(let t=i.left;t<=i.right;t++){let n=e.getColumn(t);a.set(t,{hidden:n.hidden||void 0,width:n.width??void 0})}let o=new Map;if(r)for(let t=i.top;t<=i.bottom;t++){let n=e.findRow(t);if(!n)continue;let r=new Map;n.eachCell({includeEmpty:!0},e=>{let t=e.type!==0&&e.type!==1,n=e.style&&(e.style.border&&(e.style.border.top||e.style.border.right||e.style.border.bottom||e.style.border.left)||e.style.fill||e.style.font);(t||n)&&r.set(e.col,SE(e))}),o.set(t,{hidden:n.hidden||void 0,height:n.height??void 0,customHeight:n.customHeight||void 0,cells:r})}let s=e.hasMerges&&e.model.mergeCells?[...e.model.mergeCells]:void 0,c=e.pageSetup,l=c?{orientation:c.orientation,paperSize:c.paperSize,margins:c.margins?{left:c.margins.left,right:c.margins.right,top:c.margins.top,bottom:c.margins.bottom}:void 0,scale:c.scale,printTitlesRow:c.printTitlesRow,showGridLines:c.showGridLines,printArea:c.printArea}:void 0,u=e.rowBreaks?.map(e=>e.id),d=e.colBreaks?.map(e=>e.id),f=PE(e,t);if(f){for(let e of f){let t=e.range.tl,n=(t.nativeCol??t.col??0)+1,r=(t.nativeRow??t.row??0)+1;if(i.top===0&&i.left===0&&(i.top=1,i.left=1),n>i.right&&(i.right=n),r>i.bottom&&(i.bottom=r),e.range.br){let t=e.range.br,n=(t.nativeCol??t.col??0)+1,r=(t.nativeRow??t.row??0)+1;n>i.right&&(i.right=n),r>i.bottom&&(i.bottom=r)}}for(let t=i.left;t<=i.right;t++)if(!a.has(t)){let n=e.getColumn(t);a.set(t,{hidden:n.hidden||void 0,width:n.width??void 0})}for(let e=i.top;e<=i.bottom;e++)o.has(e)||o.set(e,{cells:new Map})}return{name:e.name,state:e.state??`visible`,bounds:i,columns:a,rows:o,merges:s,pageSetup:l,rowBreaks:u,colBreaks:d,images:f}}function SE(e){let t=CE(e.type),n=wE(e),r=DE(e.style);return{type:t,value:EE(e),text:n,style:r,hyperlink:e.hyperlink||void 0,result:e.result??void 0,col:e.col}}function CE(e){switch(e){case 0:return $.Empty;case 1:return $.Merge;case 2:return $.Number;case 3:case 7:return $.String;case 4:return $.Date;case 5:return $.Hyperlink;case 6:return $.Formula;case 8:return $.RichText;case 9:return $.Boolean;case 10:return $.Error;default:return $.String}}function wE(e){if(!e)return``;switch(e.type){case 0:case 1:return``;case 8:case 5:return e.text??``;case 10:return e.value?.error??e.text??``;case 6:{let t=e.result;return t==null?e.text??``:typeof t==`object`&&`error`in t?t.error:TE(t,e.style?.numFmt)}default:{let t=e.value;return t==null?``:TE(t,e.style?.numFmt)}}}function TE(e,t){let n=typeof t==`string`?t:t?.formatCode;if(n&&(typeof e==`number`||e instanceof Date||typeof e==`boolean`))try{return Ul(e,n)}catch{}return e instanceof Date?e.toLocaleDateString():String(e)}function EE(e){if(e.type===8){let t=e.value;if(t?.richText)return{richText:t.richText.map(e=>({text:e.text,font:e.font?OE(e.font):void 0}))}}return e.value}function DE(e){if(e)return{font:e.font?OE(e.font):void 0,numFmt:e.numFmt,fill:e.fill?AE(e.fill):void 0,border:e.border?ME(e.border):void 0,alignment:e.alignment?NE(e.alignment):void 0}}function OE(e){return{name:e.name,size:e.size,bold:e.bold,italic:e.italic,strike:e.strike,underline:e.underline,color:e.color?kE(e.color):void 0}}function kE(e){return{argb:e.argb,theme:e.theme,tint:e.tint}}function AE(e){let t={type:e.type??`pattern`,pattern:e.pattern,fgColor:e.fgColor?kE(e.fgColor):void 0};return e.stops&&(t.stops=e.stops.map(e=>({color:kE(e.color)}))),t}function jE(e){return{style:e.style,color:e.color?kE(e.color):void 0}}function ME(e){return{top:e.top?jE(e.top):void 0,right:e.right?jE(e.right):void 0,bottom:e.bottom?jE(e.bottom):void 0,left:e.left?jE(e.left):void 0}}function NE(e){return{horizontal:e.horizontal,vertical:e.vertical,wrapText:e.wrapText,indent:e.indent,textRotation:e.textRotation}}function PE(e,t){let n=e.getImages?.();if(!n||!Array.isArray(n)||n.length===0)return;let r=[];for(let e of n){if(!e.range?.tl)continue;let n=e.imageId,i=t.getImage?.(Number(n));if(!i)continue;let a;if(i.buffer instanceof Uint8Array?a=i.buffer:i.base64&&(a=Rc(i.base64)),!a||a.length===0)continue;let o=i.extension;o!==`jpeg`&&o!==`png`||r.push({data:a,format:o,range:{tl:{col:e.range.tl.col??0,row:e.range.tl.row??0,nativeCol:e.range.tl.nativeCol,nativeRow:e.range.tl.nativeRow,nativeColOff:e.range.tl.nativeColOff,nativeRowOff:e.range.tl.nativeRowOff},br:e.range.br?{col:e.range.br.col??0,row:e.range.br.row??0,nativeCol:e.range.br.nativeCol,nativeRow:e.range.br.nativeRow,nativeColOff:e.range.br.nativeColOff,nativeRowOff:e.range.br.nativeRowOff}:void 0,ext:e.range.ext?{width:e.range.ext.width,height:e.range.ext.height}:void 0}})}return r.length>0?r:void 0}return e.Anchor=$p,e.BaseError=n,e.Cell=j,e.Column=wc,e.ColumnOutOfBoundsError=jr,e.CsvFormatterStream=Tr,e.CsvParserStream=Cr,e.DataValidations=em,e.DateFormatter=nt,e.DateParser=et,e.DefinedNames=ii,e.DocumentType=qs,e.Enums=Xs,e.ErrorValue=Ys,e.ExcelDownloadError=zr,e.ExcelError=Dr,e.ExcelFileError=Lr,e.ExcelNotSupportedError=Ir,e.ExcelStreamStateError=Rr,e.FormCheckbox=Bg,e.FormulaType=Gs,e.Image=Vg,e.ImageError=Hr,e.InvalidAddressError=Ar,e.InvalidValueTypeError=Pr,e.MarkdownError=pb,e.MarkdownParseError=mb,e.MaxItemsExceededError=Ur,e.MergeConflictError=Nr,e.Note=Tc,e.PageSizes=Dw,e.PaperSize=Vb,e.PdfError=jx,e.PdfFontError=Nx,e.PdfRenderError=Mx,e.PdfStructureError=Px,e.PivotTableError=Br,e.Range=Gr,e.ReadingOrder=Js,e.RelationshipType=Ks,e.Row=du,e.RowOutOfBoundsError=Mr,e.Table=s_,e.TableError=Vr,e.ValueType=Ws,e.Workbook=Bb,e.WorkbookReader=Af,e.WorkbookWriter=Ng,e.Worksheet=uv,e.WorksheetNameError=kr,e.WorksheetReader=fu,e.WorksheetWriter=Bh,e.XmlParseError=Fr,e.base64ToUint8Array=Rc,e.concatUint8Arrays=T,e.createCsvFormatterStream=Er,e.createCsvParserStream=wr,e.createTextWatermarkImage=Hb,e.dateToExcel=zc,e.decodeCell=f_,e.decodeCol=c_,e.decodeRange=m_,e.decodeRow=u_,e.encodeCell=p_,e.encodeCol=l_,e.encodeRange=h_,e.encodeRow=d_,e.errorToJSON=s,e.excelToDate=Bc,e.excelToPdf=yE,e.getErrorChain=c,e.getRootCause=l,e.getSupportedFormats=rt,e.isExcelError=Or,e.isPdfError=Fx,e.pdf=hE,e.stringToUint8Array=wn,e.toError=o,e.toUint8Array=En,e.uint8ArrayToBase64=ll,e.uint8ArrayToString=Tn,e.xmlDecode=jc,e.xmlEncode=Mc,e})({});
|