@node-projects/excelforge 3.4.0 → 3.6.0

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/index-min.js CHANGED
@@ -1,4 +1,105 @@
1
- var te=class e{constructor(t){this.error=t}toString(){return this.error}static{this.NULL=new e("#NULL!")}static{this.DIV0=new e("#DIV/0!")}static{this.VALUE=new e("#VALUE!")}static{this.REF=new e("#REF!")}static{this.NAME=new e("#NAME?")}static{this.NUM=new e("#NUM!")}static{this.NA=new e("#N/A")}static{this.GETTING=new e("#GETTING_DATA")}};var Eo=[];function Ut(e){if(Eo[e])return Eo[e];let t="",o=e;for(;o>0;){let n=(o-1)%26;t=String.fromCharCode(65+n)+t,o=Math.floor((o-1)/26)}return Eo[e]=t,t}function qt(e){let t=0;for(let o=0;o<e.length;o++)t=t*26+(e.charCodeAt(o)-64);return t}function Gt(e){let t=e.match(/^(\$?)([A-Z]+)(\$?)(\d+)$/);if(!t)throw new Error(`Invalid cell ref: ${e}`);return{col:qt(t[2]),row:parseInt(t[4],10)}}function ye(e,t,o=!1){let n=o?"$":"";return`${n}${Ut(t)}${n}${e}`}function Kt(e){let[t,o]=e.split(":"),n=Gt(t.replace(/\$/g,"")),s=o?Gt(o.replace(/\$/g,"")):n;return{startRow:n.row,startCol:n.col,endRow:s.row,endCol:s.col}}var Ms={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;"},Bo=/[&<>"']/g;function I(e){return Bo.test(e)?(Bo.lastIndex=0,e.replace(Bo,t=>Ms[t])):e}var Es=new TextEncoder;function rt(e){return Es.encode(e)}function _o(e,t=!1){let o=t?Date.UTC(1904,0,1):Date.UTC(1899,11,30),n=(e.getTime()-o)/864e5;return t||n>=60,n}function jo(e){return Math.round(e*914400/96)}function le(e){let t=atob(e),o=new Uint8Array(t.length);for(let n=0;n<t.length;n++)o[n]=t.charCodeAt(n);return o}function Bs(e){let t=[];for(let o=0;o<e.length;o+=8192)t.push(String.fromCharCode.apply(null,e.subarray(o,o+8192)));return btoa(t.join(""))}function un(e,t,o){let n=e.match(/^(\$?)([A-Z]+)(\$?)(\d+)$/);if(!n)return e;let s=n[1]==="$",r=qt(n[2]),a=n[3]==="$",i=parseInt(n[4],10),l=a?`R${i}`:i===t?"R":`R[${i-t}]`,h=s?`C${r}`:r===o?"C":`C[${r-o}]`;return l+h}function gn(e,t,o){let n=e.match(/^R(\[(-?\d+)\]|(\d+))?C(\[(-?\d+)\]|(\d+))?$/);if(!n)return e;let s,r,a,i;return n[3]!==void 0?(s=parseInt(n[3],10),r=!0):n[2]!==void 0?(s=t+parseInt(n[2],10),r=!1):(s=t,r=!1),n[6]!==void 0?(a=parseInt(n[6],10),i=!0):n[5]!==void 0?(a=o+parseInt(n[5],10),i=!1):(a=o,i=!1),`${i?"$":""}${Ut(a)}${r?"$":""}${s}`}function _s(e,t,o){return e.replace(/(\$?)([A-Z]+)(\$?)(\d+)/g,(n,s,r,a,i)=>un(`${s}${r}${a}${i}`,t,o))}function js(e,t,o){return e.replace(/R(\[(-?\d+)\]|(\d+))?C(\[(-?\d+)\]|(\d+))?/g,n=>gn(n,t,o))}var Oo=/[&<>]/g,Os={"&":"&amp;","<":"&lt;",">":"&gt;"};function Lo(e){return Oo.test(e)?(Oo.lastIndex=0,e.replace(Oo,t=>Os[t])):e}function xn(e){if(e.startsWith("theme:")){let o=e.slice(6),n=o.indexOf(":tint:");if(n>=0){let s=o.slice(0,n),r=o.slice(n+6);return`<color theme="${s}" tint="${r}"/>`}return`<color theme="${o}"/>`}return`<color rgb="${e.startsWith("#")?"FF"+e.slice(1):e}"/>`}var Ls={average:101,count:102,countNums:103,max:104,min:105,stdDev:107,sum:109,var:110,vars:111},Ie=class{constructor(t,o={}){this.cells=new Map,this.merges=[],this.images=[],this.cellImages=[],this.charts=[],this.conditionalFormats=[],this.tables=[],this.pivotTables=[],this.sparklines=[],this.formControls=[],this.shapes=[],this.wordArt=[],this.queryTables=[],this.tableSlicers=[],this.mathEquations=[],this.oleObjects=[],this.colDefs=new Map,this.rowDefs=new Map,this.dataValidations=new Map,this.rowBreaks=[],this.colBreaks=[],this.preservedXml=[],this._nextSharedIdx=0,this._isChartSheet=!1,this._isDialogSheet=!1,this.sheetIndex=0,this.rId="",this.drawingRId="",this.legacyDrawingRId="",this.tableRIds=[],this.ctrlPropRIds=[],this.slicerRId="",this._slicerDrawingInfo=[],this._cellImageVm=new Map,this.ignoreErrors=[],this.oleRIds=[],this.oleIconRIds=[],this.name=t,this.options={...o,name:t}}markDirty(){this._workbook?.markDirty(this.name)}setActive(){this._workbook?.setActiveSheet(this.name)}getCell(t,o){let n=this.cells.get(t);n||(n=new Map,this.cells.set(t,n));let s=n.get(o);return s||(s={},n.set(o,s)),s}getCellByRef(t){let{row:o,col:n}=Gt(t);return this.getCell(o,n)}setCell(t,o,n){let s=this.cells.get(t);return s||(s=new Map,this.cells.set(t,s)),s.set(o,n),this}setValue(t,o,n){let s=this.getCell(t,o);return delete s.formula,delete s.arrayFormula,delete s.richText,delete s._sharedIdx,delete s._sharedRef,delete s._dynamic,s.value=n,this}setFormula(t,o,n){let s=this.getCell(t,o);return delete s.arrayFormula,delete s.richText,delete s._sharedIdx,delete s._sharedRef,delete s._dynamic,s.formula=n,this}setDynamicArrayFormula(t,o,n){let s=this.getCell(t,o);return delete s.formula,delete s.richText,delete s._sharedIdx,delete s._sharedRef,s.arrayFormula=n,s._dynamic=!0,this}setSharedFormula(t,o,n,s){let r=this._nextSharedIdx++,a=this.getCell(t,o);a.formula=n,a._sharedRef=s,a._sharedIdx=r;let{startRow:i,startCol:l,endRow:h,endCol:m}=Kt(s);for(let c=i;c<=h;c++)for(let d=l;d<=m;d++){if(c===t&&d===o)continue;let f=this.getCell(c,d);f._sharedIdx=r}return this}setStyle(t,o,n){return this.getCell(t,o).style=n,this}writeArray(t,o,n){for(let s=0;s<n.length;s++)for(let r=0;r<n[s].length;r++)this.setValue(t+s,o+r,n[s][r]);return this}writeColumn(t,o,n){return n.forEach((s,r)=>this.setValue(t+r,o,s)),this}writeRow(t,o,n){return n.forEach((s,r)=>this.setValue(t,o+r,s)),this}setColumn(t,o){return this.colDefs.set(t,o),this}setColumnWidth(t,o){let n=this.colDefs.get(t)??{};return this.colDefs.set(t,{...n,width:o,customWidth:!0}),this}setRow(t,o){return this.rowDefs.set(t,o),this}setRowHeight(t,o){let n=this.rowDefs.get(t)??{};return this.rowDefs.set(t,{...n,height:o}),this}merge(t,o,n,s){return this.merges.push({startRow:t,startCol:o,endRow:n,endCol:s}),this}mergeByRef(t){let[o,n]=t.split(":"),s=Gt(o),r=Gt(n);return this.merge(s.row,s.col,r.row,r.col)}getMerges(){return this.merges}addImage(t){return this.images.push(t),this}getImages(){return this.images}addCellImage(t){return this.cellImages.push(t),this}getCellImages(){return this.cellImages}getComments(){let t=[];for(let[o,n]of this.cells)for(let[s,r]of n)r.comment&&t.push({row:o,col:s,comment:r.comment});return t}addChart(t){return this.charts.push(t),this}getCharts(){return this.charts}addConditionalFormat(t){return this.conditionalFormats.push(t),this}getConditionalFormats(){return this.conditionalFormats}getDataValidations(){return this.dataValidations}addTable(t){if(this.tables.push(t),t.totalsRow&&t.columns?.length){let{startRow:o,startCol:n,endRow:s}=Kt(t.ref),r=o+1,a=s-1;t.columns.forEach((i,l)=>{let h=n+l;if(i.totalsRowLabel)this.setValue(s,h,i.totalsRowLabel);else if(i.totalsRowFunction&&i.totalsRowFunction!=="none"){let m=Ls[i.totalsRowFunction];if(m!==void 0){let c=Ut(h);this.setFormula(s,h,`SUBTOTAL(${m},${c}${r}:${c}${a})`)}}})}return this}getTables(){return this.tables}addPivotTable(t){return this.pivotTables.push(t),this}getPivotTables(){return this.pivotTables}readRange(t){let{startRow:o,startCol:n,endRow:s,endCol:r}=Kt(t),a=[];for(let i=o;i<=s;i++){let l=[],h=this.cells.get(i);for(let m=n;m<=r;m++){let c=h?.get(m);l.push(c?.value??null)}a.push(l)}return a}readAllCells(){let t=[];for(let[o,n]of this.cells)for(let[s,r]of n)t.push({row:o,col:s,cell:r});return t}getUsedRange(){let t=1/0,o=0,n=1/0,s=0;for(let[r,a]of this.cells)for(let[i]of a)r<t&&(t=r),r>o&&(o=r),i<n&&(n=i),i>s&&(s=i);return o===0?null:{startRow:t,startCol:n,endRow:o,endCol:s}}getColumn(t){return this.colDefs.get(t)}getRow(t){return this.rowDefs.get(t)}insertRows(t,o){let n=[...this.cells.keys()].filter(r=>r>=t).sort((r,a)=>a-r);for(let r of n){let a=this.cells.get(r);this.cells.delete(r),this.cells.set(r+o,a)}let s=[...this.rowDefs.keys()].filter(r=>r>=t).sort((r,a)=>a-r);for(let r of s){let a=this.rowDefs.get(r);this.rowDefs.delete(r),this.rowDefs.set(r+o,a)}for(let r of this.merges)r.startRow>=t&&(r.startRow+=o),r.endRow>=t&&(r.endRow+=o);return this}deleteRows(t,o){for(let r=t;r<t+o;r++)this.cells.delete(r),this.rowDefs.delete(r);let n=[...this.cells.keys()].filter(r=>r>=t+o).sort((r,a)=>r-a);for(let r of n){let a=this.cells.get(r);this.cells.delete(r),this.cells.set(r-o,a)}let s=[...this.rowDefs.keys()].filter(r=>r>=t+o).sort((r,a)=>r-a);for(let r of s){let a=this.rowDefs.get(r);this.rowDefs.delete(r),this.rowDefs.set(r-o,a)}this.merges=this.merges.filter(r=>!(r.startRow>=t&&r.endRow<t+o));for(let r of this.merges)r.startRow>=t+o&&(r.startRow-=o),r.endRow>=t+o&&(r.endRow-=o);return this}insertColumns(t,o){for(let[,s]of this.cells){let r=[...s.keys()].filter(a=>a>=t).sort((a,i)=>i-a);for(let a of r){let i=s.get(a);s.delete(a),s.set(a+o,i)}}let n=[...this.colDefs.keys()].filter(s=>s>=t).sort((s,r)=>r-s);for(let s of n){let r=this.colDefs.get(s);this.colDefs.delete(s),this.colDefs.set(s+o,r)}for(let s of this.merges)s.startCol>=t&&(s.startCol+=o),s.endCol>=t&&(s.endCol+=o);return this}copyRange(t,o,n){let{startRow:s,startCol:r,endRow:a,endCol:i}=Kt(t);for(let l=s;l<=a;l++)for(let h=r;h<=i;h++){let m=this.getCell(l,h),c=o+(l-s),d=n+(h-r);m.value!=null&&this.setValue(c,d,m.value),m.formula&&this.setFormula(c,d,m.formula),m.style&&this.setStyle(c,d,{...m.style})}return this}moveRange(t,o,n){let{startRow:s,startCol:r,endRow:a,endCol:i}=Kt(t);this.copyRange(t,o,n);let l=o+(a-s),h=n+(i-r);for(let m=s;m<=a;m++)for(let c=r;c<=i;c++){let d=o+(m-s),f=n+(c-r);if(d===m&&f===c)continue;let p=this.cells.get(m);p&&p.delete(c)}return this}sortRange(t,o,n="asc"){let{startRow:s,startCol:r,endRow:a,endCol:i}=Kt(t),l=[];for(let h=s;h<=a;h++){let m=this.cells.get(h),c=new Map;for(let d=r;d<=i;d++){let f=m?.get(d);f&&c.set(d,{...f})}l.push({rowIdx:h,cells:c})}l.sort((h,m)=>{let c=h.cells.get(o)?.value,d=m.cells.get(o)?.value,f=typeof c=="number"||typeof c=="string"?c:"",p=typeof d=="number"||typeof d=="string"?d:"",g=0;return typeof f=="number"&&typeof p=="number"?g=f-p:g=String(f).localeCompare(String(p)),n==="desc"?-g:g});for(let h=0;h<l.length;h++){let m=s+h;for(let c=r;c<=i;c++){let d=l[h].cells.get(c),f=this.cells.get(m)??new Map;this.cells.has(m)||this.cells.set(m,f),d?f.set(c,d):f.delete(c)}}return this}fillNumber(t,o,n,s=0,r=1){for(let a=0;a<n;a++)this.setValue(t+a,o,s+a*r);return this}fillDate(t,o,n,s,r="day",a=1){for(let i=0;i<n;i++){let l=new Date(s);switch(r){case"day":l.setDate(l.getDate()+i*a);break;case"week":l.setDate(l.getDate()+i*a*7);break;case"month":l.setMonth(l.getMonth()+i*a);break;case"year":l.setFullYear(l.getFullYear()+i*a);break}this.setValue(t+i,o,l)}return this}fillList(t,o,n,s){for(let r=0;r<s;r++)this.setValue(t+r,o,n[r%n.length]);return this}autoFitColumns(t=8,o=60){let n=this.getUsedRange();if(!n)return this;for(let s=n.startCol;s<=n.endCol;s++){let r=0;for(let a=n.startRow;a<=n.endRow;a++){let i=this.cells.get(a)?.get(s);if(i?.value!=null){let l=String(i.value);l.length>r&&(r=l.length)}if(i?.richText){let l=i.richText.map(h=>h.text).join("");l.length>r&&(r=l.length)}}if(r>0){let a=Math.max(t,Math.min(o,r*1.2+2));this.setColumn(s,{...this.colDefs.get(s)??{},width:a,customWidth:!0})}}return this}duplicateRow(t,o){this.insertRows(o,1);let n=this.cells.get(t>=o?t+1:t);if(n){let r=new Map;for(let[a,i]of n)r.set(a,{...i,style:i.style?{...i.style}:void 0});this.cells.set(o,r)}let s=this.rowDefs.get(t>=o?t+1:t);return s&&this.rowDefs.set(o,{...s}),this}spliceRows(t,o,n){if(o>0&&this.deleteRows(t,o),n&&n.length>0){this.insertRows(t,n.length);for(let s=0;s<n.length;s++)this.writeRow(t+s,1,n[s])}return this}setAutoFilter(t,o){return this.autoFilter={ref:t},o?.columns&&(this._filterColumns=o.columns),this}addSparkline(t){return this.sparklines.push(t),this}getSparklines(){return this.sparklines}addDataValidation(t,o){return this.dataValidations.set(t,o),this}addRowBreak(t,o=!0){return this.rowBreaks.push({id:t,manual:o}),this}addColBreak(t,o=!0){return this.colBreaks.push({id:t,manual:o}),this}getRowBreaks(){return this.rowBreaks}getColBreaks(){return this.colBreaks}addFormControl(t){if(!t.to&&(t.width||t.height)){let s=t.width??100,r=t.height??30,a=t.from.col+s/64,i=t.from.row+r/20;t={...t,to:{col:Math.floor(a),row:Math.floor(i),colOff:Math.round(a%1*64),rowOff:Math.round(i%1*20)}}}return this.formControls.push(t),this}getFormControls(){return this.formControls}addShape(t){return this.shapes.push(t),this}getShapes(){return this.shapes}addOleObject(t){return this.oleObjects.push(t),this}getOleObjects(){return this.oleObjects}addWordArt(t){return this.wordArt.push(t),this}getWordArt(){return this.wordArt}addQueryTable(t){return this.queryTables.push(t),this}getQueryTables(){return this.queryTables}addTableSlicer(t){return this.tableSlicers.push(t),this}getTableSlicers(){return this.tableSlicers}addMathEquation(t){return this.mathEquations.push(t),this}getMathEquations(){return this.mathEquations}addIgnoredError(t,o){return this.ignoreErrors.push({sqref:t,...o}),this}getIgnoredErrors(){return this.ignoreErrors}addPreservedXml(t){return this.preservedXml.push(t),this}freeze(t,o){return this.freezePane={row:t,col:o},this}toXml(t,o){let n=this.pageSetup?.fitToPage,s=this.options?.tabColor,r=n||s?`<sheetPr>${s?`<tabColor rgb="${s}"/>`:""}${n?'<pageSetUpPr fitToPage="1"/>':""}</sheetPr>`:"",a=this._sheetViewXml(),i=this._colsXml(t),l=this._sheetDataXml(t,o),h=this._mergesXml(),m=this._conditionalFormatXml(t),c=this._dataValidationsXml(),d=this.autoFilter&&!this.tables.some(A=>A.ref===this.autoFilter.ref)?this._autoFilterXml():"",f=this.tables.length?`<tableParts count="${this.tables.length}">${this.tableRIds.map(A=>`<tablePart r:id="${A}"/>`).join("")}</tableParts>`:"",p=this.drawingRId?`<drawing r:id="${this.drawingRId}"/>`:"",g=this.legacyDrawingRId?`<legacyDrawing r:id="${this.legacyDrawingRId}"/>`:"",u=this._formControlsXml(),$=this._oleObjectsXml(),x=this._sparklineXml(),b=this._customIconExtXml(),C=this.slicerRId?`<extLst><ext uri="{A8765BA9-456A-4dab-B4F3-ACF838C121DE}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"><x14:slicerList><x14:slicer r:id="${this.slicerRId}"/></x14:slicerList></ext></extLst>`:"",y=this._ignoredErrorsXml(),v=this._protectionXml(),w=this._pageSetupXml(),k=this._pageMarginsXml(),T=this._headerFooterXml(),S=this._printOptionsXml(),D=this._pageBreaksXml("rowBreaks",this.rowBreaks,16383),R=this._pageBreaksXml("colBreaks",this.colBreaks,1048575);return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
1
+ var Js=Object.defineProperty;var we=(e,t)=>()=>(e&&(t=e(e=0)),t);var go=(e,t)=>{for(var o in t)Js(e,o,{get:t[o],enumerable:!0})};function Ut(e){if(Oo[e])return Oo[e];let t="",o=e;for(;o>0;){let n=(o-1)%26;t=String.fromCharCode(65+n)+t,o=Math.floor((o-1)/26)}return Oo[e]=t,t}function Kt(e){let t=0;for(let o=0;o<e.length;o++)t=t*26+(e.charCodeAt(o)-64);return t}function qt(e){let t=e.match(/^(\$?)([A-Z]+)(\$?)(\d+)$/);if(!t)throw new Error(`Invalid cell ref: ${e}`);return{col:Kt(t[2]),row:parseInt(t[4],10)}}function be(e,t,o=!1){let n=o?"$":"";return`${n}${Ut(t)}${n}${e}`}function Zt(e){let[t,o]=e.split(":"),n=qt(t.replace(/\$/g,"")),s=o?qt(o.replace(/\$/g,"")):n;return{startRow:n.row,startCol:n.col,endRow:s.row,endCol:s.col}}function I(e){return Lo.test(e)?(Lo.lastIndex=0,e.replace(Lo,t=>tr[t])):e}function rt(e){return er.encode(e)}function No(e,t=!1){let o=t?Date.UTC(1904,0,1):Date.UTC(1899,11,30),n=(e.getTime()-o)/864e5;return t||n>=60,n}function Xo(e){return Math.round(e*914400/96)}function ce(e){let t=atob(e),o=new Uint8Array(t.length);for(let n=0;n<t.length;n++)o[n]=t.charCodeAt(n);return o}function or(e){let t=[];for(let o=0;o<e.length;o+=8192)t.push(String.fromCharCode.apply(null,e.subarray(o,o+8192)));return btoa(t.join(""))}function In(e,t,o){let n=e.match(/^(\$?)([A-Z]+)(\$?)(\d+)$/);if(!n)return e;let s=n[1]==="$",r=Kt(n[2]),a=n[3]==="$",i=parseInt(n[4],10),l=a?`R${i}`:i===t?"R":`R[${i-t}]`,h=s?`C${r}`:r===o?"C":`C[${r-o}]`;return l+h}function Tn(e,t,o){let n=e.match(/^R(\[(-?\d+)\]|(\d+))?C(\[(-?\d+)\]|(\d+))?$/);if(!n)return e;let s,r,a,i;return n[3]!==void 0?(s=parseInt(n[3],10),r=!0):n[2]!==void 0?(s=t+parseInt(n[2],10),r=!1):(s=t,r=!1),n[6]!==void 0?(a=parseInt(n[6],10),i=!0):n[5]!==void 0?(a=o+parseInt(n[5],10),i=!1):(a=o,i=!1),`${i?"$":""}${Ut(a)}${r?"$":""}${s}`}function nr(e,t,o){return e.replace(/(\$?)([A-Z]+)(\$?)(\d+)/g,(n,s,r,a,i)=>In(`${s}${r}${a}${i}`,t,o))}function sr(e,t,o){return e.replace(/R(\[(-?\d+)\]|(\d+))?C(\[(-?\d+)\]|(\d+))?/g,n=>Tn(n,t,o))}var Oo,tr,Lo,er,Wt=we(()=>{"use strict";Oo=[];tr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;"},Lo=/[&<>"']/g;er=new TextEncoder});var wo,Xn,Un,nn,Vn,sn=we(()=>{"use strict";wo={button:"Button",checkBox:"Checkbox",comboBox:"Drop",listBox:"List",optionButton:"Radio",groupBox:"GBox",label:"Label",scrollBar:"Scroll",spinner:"Spin",dialog:"Dialog"},Xn={...wo,checkBox:"CheckBox",dialog:"Dialog"},Un={...Object.fromEntries(Object.entries(wo).map(([e,t])=>[t,e])),CheckBox:"checkBox"},nn={unchecked:"0",checked:"1",mixed:"2"},Vn={0:"unchecked",1:"checked",2:"mixed"}});function ts(e){return e<=16?4:e<=32?5:e<=64?6:e<=128?7:e<=256?8:e<=512?9:e<=1024?10:e<=2048?11:12}function ln(e){let t=[1],o=0;for(;o<e.length;){let n=o,s=Math.min(o+4096,e.length),r=la(e,n,s);if(r.length<4096){let i=45056|r.length+2-3&4095;t.push(i&255,i>>8&255);for(let l of r)t.push(l)}else{t.push(255,63);for(let i=n;i<s;i++)t.push(e[i]);for(let i=s-n;i<4096;i++)t.push(0)}o=s}return new Uint8Array(t)}function la(e,t,o){let n=[],s=0;for(;t+s<o;){let r=0,a=n.length;n.push(0);for(let i=0;i<8&&t+s<o;i++){if(s===0){n.push(e[t]),s++;continue}let l=ts(s),h=1<<l,m=16-l,c=(1<<m)-1+3,d=Math.max(0,s-h),f=0,p=0;for(let g=d;g<s;g++){let u=0;for(;s+u<o-t&&u<c&&e[t+g+u]===e[t+s+u];)u++;u>p&&(p=u,f=s-g)}if(p>=3){r|=1<<i;let g=f-1<<m|p-3;n.push(g&255,g>>8&255),s+=p}else n.push(e[t+s]),s++}n[a]=r}return n}function cn(e){if(e.length===0||e[0]!==1)throw new Error("Invalid OVBA compressed container (bad signature)");let t=[],o=1;for(;o<e.length&&!(o+1>=e.length);){let n=e[o]|e[o+1]<<8;o+=2;let s=(n&4095)+3,r=n>>15&1,a=s-2,i=o+a;if(r){let l=t.length;for(;o<i&&o<e.length;){let h=e[o++];for(let m=0;m<8&&o<i&&o<e.length;m++)if((h&1<<m)===0)t.push(e[o++]);else{if(o+1>=e.length)break;let c=e[o]|e[o+1]<<8;o+=2;let d=t.length-l,p=16-ts(d),g=(c>>p)+1,u=(c&(1<<p)-1)+3,$=t.length-g;for(let x=0;x<u;x++)t.push(t[$+x])}}}else{for(let l=0;l<4096&&o<e.length;l++)t.push(e[o++]);o=Math.max(o,i)}}return new Uint8Array(t)}var es=we(()=>{"use strict"});function hn(e,t){return e[t]|e[t+1]<<8}function ne(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function We(e,t,o){e[t]=o&255,e[t+1]=o>>8&255}function Et(e,t,o){e[t]=o&255,e[t+1]=o>>8&255,e[t+2]=o>>16&255,e[t+3]=o>>24&255}function ha(e){if(e.length>31)throw new Error(`CFB entry name too long (${e.length} chars, max 31): "${e}"`);let t=new Uint8Array(64),o=0;for(let n of e){let s=n.charCodeAt(0);t[o++]=s&255,t[o++]=s>>8&255}return t[o++]=0,t[o++]=0,{bytes:t,size:o}}function ma(e,t,o){let n="",s=Math.max(0,o-2);for(let r=0;r<s;r+=2){let a=e[t+r]|e[t+r+1]<<8;if(a===0)break;n+=String.fromCharCode(a)}return n}function ao(e,t){let o=[],n=t;for(;n!==Re&&n<e.length;)o.push(n),n=e[n];return o}function Co(e,t){return Math.ceil(e/t)}function ss(e){for(let T=0;T<8;T++)if(e[T]!==os[T])throw new Error("Not a CFB file");let o=1<<hn(e,30),s=1<<hn(e,32),r=ne(e,44),a=ne(e,48),i=ne(e,60),l=T=>512+T*o,h=[];for(let T=0;T<109&&T<r;T++){let S=ne(e,76+T*4);S!==ze&&h.push(S)}let m=Math.floor((e.length-512)/o),c=new Uint32Array(m);c.fill(ze);for(let T=0;T<h.length;T++){let S=l(h[T]),D=o/4;for(let R=0;R<D&&T*D+R<m;R++)c[T*D+R]=ne(e,S+R*4)}let d=ao(c,a),f=new Uint8Array(d.length*o);for(let T=0;T<d.length;T++)f.set(e.subarray(l(d[T]),l(d[T])+o),T*o);let p=f.length/Fo,g=[];for(let T=0;T<p;T++){let S=T*Fo,D=hn(f,S+64);D!==0&&g.push({name:ma(f,S,D),type:f[S+66],child:ne(f,S+76),left:ne(f,S+68),right:ne(f,S+72),startSector:ne(f,S+116),size:ne(f,S+120),index:T})}let u=g.find(T=>T.type===5);if(!u)throw new Error("No root entry in CFB");let $=ao(c,u.startSector),x=new Uint8Array($.length*o);for(let T=0;T<$.length;T++)x.set(e.subarray(l($[T]),l($[T])+o),T*o);let b=ao(c,i),C=b.length*(o/4),y=new Uint32Array(C);y.fill(ze);for(let T=0;T<b.length;T++){let S=l(b[T]),D=o/4;for(let R=0;R<D;R++)y[T*D+R]=ne(e,S+R*4)}let v=new Map;function w(T,S){let D=g.find(A=>A.index===T);if(!D||D.child===He)return;let R=A=>{if(A===He||A>=p)return;let W=g.find(Q=>Q.index===A);W&&(v.set(A,S),W.type===1&&w(A,W.name),R(W.left),R(W.right))};R(D.child)}w(u.index,"");let k=[];for(let T of g){if(T.type!==2)continue;let S;if(T.size<ns){let D=ao(y,T.startSector),R=new Uint8Array(D.length*s);for(let A=0;A<D.length;A++){let W=D[A]*s;R.set(x.subarray(W,W+s),A*s)}S=R.subarray(0,T.size)}else{let D=ao(c,T.startSector),R=new Uint8Array(D.length*o);for(let A=0;A<D.length;A++)R.set(e.subarray(l(D[A]),l(D[A])+o),A*o);S=R.subarray(0,T.size)}k.push({name:T.name,data:S,storage:v.get(T.index)||void 0})}return k}function rs(e){let t={name:"Root Entry",type:5,children:[]},o=new Map;o.set("",t);for(let A of e){let W=A.storage??"",Q=o.get(W);Q||(Q={name:W,type:1,children:[]},o.set(W,Q),t.children.push(Q));let q={name:A.name,type:2,data:A.data};Q.children.push(q)}let n=[],s=[t];for(;s.length;){let A=s.shift();if(n.push({node:A,parentIdx:-1,childIdx:He,leftIdx:He,rightIdx:He,miniStart:0,size:A.data?.length??0}),A.children)for(let W of A.children)s.push(W)}for(let A=0;A<n.length;A++){let W=n[A].node;if(!W.children?.length)continue;let Q=n.map((_,M)=>({e:_,idx:M})).filter(({e:_})=>W.children.includes(_.node)).map(({idx:_})=>_);if(Q.length===0)continue;let q=Q.sort((_,M)=>{let N=n[_].node.name,H=n[M].node.name;return N.length!==H.length?N.length-H.length:N.toUpperCase()<H.toUpperCase()?-1:N.toUpperCase()>H.toUpperCase()?1:0}),E=_=>{if(_.length===0)return He;let M=_.length>>1;return n[_[M]].leftIdx=E(_.slice(0,M)),n[_[M]].rightIdx=E(_.slice(M+1)),_[M]};n[A].childIdx=E(q)}let r=[],a=new Map,i=0;for(let A=0;A<n.length;A++){let W=n[A].node.data;if(!W||W.length===0)continue;let Q=Co(W.length,bo),q=[];for(let E=0;E<Q;E++){q.push(i++);let _=W.subarray(E*bo,Math.min((E+1)*bo,W.length));for(let M of _)r.push(M);for(let M=_.length;M<bo;M++)r.push(0)}n[A].miniStart=q[0],a.set(A,q)}let h=Math.max(i,1),m=Co(h*4,Yt),c=new Uint32Array(m*(Yt/4));c.fill(ze);for(let A of a.values())for(let W=0;W<A.length;W++)c[A[W]]=W+1<A.length?A[W+1]:Re;let d=new Uint8Array(r),f=Co(d.length||1,Yt),p=n.length,g=Co(p*Fo,Yt),u=0,$=1,x=$+g,b=x+m,C=1+g+m+f,y=new Uint32Array(Yt/4);y.fill(ze),y[u]=ca;for(let A=0;A<g;A++)y[$+A]=A+1<g?$+A+1:Re;for(let A=0;A<m;A++)y[x+A]=A+1<m?x+A+1:Re;for(let A=0;A<f;A++)y[b+A]=A+1<f?b+A+1:Re;n[0].miniStart=b,n[0].size=d.length;let v=new Uint8Array(g*Yt);for(let A=0;A<n.length;A++){let W=A*Fo,Q=n[A],{bytes:q,size:E}=ha(Q.node.name);v.set(q,W),We(v,W+64,E),v[W+66]=Q.node.type,v[W+67]=1,Et(v,W+68,Q.leftIdx),Et(v,W+72,Q.rightIdx),Et(v,W+76,Q.childIdx),Q.node.type===5?(Et(v,W+116,b),Et(v,W+120,d.length)):Q.node.type===2&&Q.node.data&&Q.node.data.length>0?(Et(v,W+116,Q.miniStart),Et(v,W+120,Q.node.data.length)):Q.node.type===1?(Et(v,W+116,0),Et(v,W+120,0)):(Et(v,W+116,Re),Et(v,W+120,0))}let w=new Uint8Array(512);w.set(os,0),We(w,24,62),We(w,26,3),We(w,28,65534),We(w,30,9),We(w,32,6),Et(w,44,1),Et(w,48,$),Et(w,56,ns),Et(w,60,x),Et(w,64,m),Et(w,68,Re),Et(w,72,0),Et(w,76,u);for(let A=1;A<109;A++)Et(w,76+A*4,ze);let k=512+C*Yt,T=new Uint8Array(k);T.set(w,0);let S=new Uint8Array(Yt);for(let A=0;A<y.length;A++)Et(S,A*4,y[A]);T.set(S,512+u*Yt),T.set(v,512+$*Yt);let D=new Uint8Array(m*Yt);for(let A=0;A<c.length;A++)Et(D,A*4,c[A]);T.set(D,512+x*Yt);let R=new Uint8Array(f*Yt);return R.set(d),T.set(R,512+b*Yt),T}var os,Re,ze,ca,He,Yt,bo,ns,Fo,as=we(()=>{"use strict";os=new Uint8Array([208,207,17,224,161,177,26,225]),Re=4294967294,ze=4294967295,ca=4294967293,He=4294967295,Yt=512,bo=64,ns=4096,Fo=128});var cs={};go(cs,{VbaProject:()=>So});function Ce(e){return[e&255,e>>8&255]}function vt(e){return[e&255,e>>8&255,e>>16&255,e>>24&255]}function da(e,t){return e[t]|e[t+1]<<8}function is(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function Tt(e,t){let o=t instanceof Uint8Array?Array.from(t):t;return[...Ce(e),...vt(o.length),...o]}function fa(e){let t=[];for(let o of e){let n=o.charCodeAt(0);t.push(n&255,n>>8&255)}return t}function pa(e){let t=[`Attribute VB_Name = "${e.name}"`];if(e.type==="document"){let o=e.name==="ThisWorkbook"?"0{00020819-0000-0000-C000-000000000046}":"0{00020820-0000-0000-C000-000000000046}";t.push(`Attribute VB_Base = "${o}"`,"Attribute VB_GlobalNameSpace = False","Attribute VB_Creatable = False","Attribute VB_PredeclaredId = True","Attribute VB_Exposed = True","Attribute VB_TemplateDerived = False","Attribute VB_Customizable = True")}else e.type==="userform"?t.push('Attribute VB_Base = "0{F8A47041-B2A6-11CE-8027-00AA00611080}"',"Attribute VB_GlobalNameSpace = False","Attribute VB_Creatable = False","Attribute VB_PredeclaredId = True","Attribute VB_Exposed = False","Attribute VB_TemplateDerived = False","Attribute VB_Customizable = False"):e.type==="class"&&t.push("Attribute VB_GlobalNameSpace = False","Attribute VB_Creatable = False","Attribute VB_PredeclaredId = False","Attribute VB_Exposed = False");return t.join(`\r
2
+ `)+`\r
3
+ `}function ua(e){let t=[],o=0,n=null;for(;o+6<=e.length;){let s=da(e,o),r=is(e,o+2);if(o+=6,s===9){o+=6;continue}if(o+r>e.length)break;let a=e.subarray(o,o+r);switch(o+=r,s){case 25:n={name:vo.decode(a),type:"standard",offset:0};break;case 49:n&&a.length>=4&&(n.offset=is(a,0));break;case 33:n&&(n.type="standard");break;case 34:n&&(n.type="document");break;case 43:n?.name&&t.push(n),n=null;break}}return t}function ga(e){let t=e.split(/\r?\n/),o=t.findIndex(s=>!s.startsWith("Attribute "));return o<0?e:t.slice(o).join(`
4
+ `)}function $a(){return new Uint8Array([1,0,254,255,3,10,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,0,0,0,77,105,99,114,111,115,111,102,116,32,70,111,114,109,115,32,50,46,48,32,70,111,114,109,0,16,0,0,0,69,109,98,101,100,100,101,100,32,79,98,106,101,99,116,0,0,0,0,0,244,57,178,113,0,0,0,0,0,0,0,0,0,0,0,0])}function ya(e){return["VERSION 5.00",`Begin ${xa} ${e.name} `,` Caption = "${e.name}"`," ClientHeight = 3015"," ClientLeft = 120"," ClientTop = 465"," ClientWidth = 4560"," StartUpPosition = 1 'CenterOwner"," TypeInfoVer = 2","End"].join(`\r
5
+ `)+`\r
6
+ `}function wa(e){let t=e.controls??[],o=t.length,n=t.map(C=>ls(C)),s=[];s.push(0),s.push(4);let r=s.length;s.push(0,0);let a=8,i=1024,l=2048,h=1<<26,m=1<<27,c=a|i|l|h|m;s.push(c&255,c>>8&255,c>>16&255,c>>24&255),s.push(...vt(o+1)),s.push(...vt(0)),s.push(...vt(32e3));let d=200,f=120;for(let C of t){let y=(C.left??0)+(C.width??72),v=(C.top??0)+(C.height??24);y>d&&(d=y),v>f&&(f=v)}let p=(d+20)*26,g=(f+20)*26;s.push(...vt(p)),s.push(...vt(g)),s.push(...vt(0)),s.push(...vt(0));let u=s.length-4;s[r]=u&255,s[r+1]=u>>8&255,s.push(...Ce(0)),s.push(...vt(o));let $=s.length;s.push(0,0,0,0);let x=s.length;for(let C=0;C<o;C++)s.push(0),s.push(1);for(;(s.length-x)%4!==0;)s.push(0);for(let C=0;C<o;C++){let y=t[C],v=Jt.encode(y.name),w=Io[y.type]??Io.CommandButton;s.push(0,0);let k=s.length;s.push(0,0);let T=485;for(s.push(T&255,T>>8&255,T>>16&255,T>>24&255),s.push(...vt(v.length|2147483648)),s.push(...vt(C+1)),s.push(...vt(n[C].length)),s.push(C&255,C>>8&255),s.push(w&255,w>>8&255),s.push(...v);(s.length-x)%4!==0;)s.push(0);let S=(y.left??10+C*80)*26,D=(y.top??10+C*30)*26;s.push(...vt(S)),s.push(...vt(D));let R=s.length-k-2;s[k]=R&255,s[k+1]=R>>8&255}let b=s.length-x;return s[$]=b&255,s[$+1]=b>>8&255,s[$+2]=b>>16&255,s[$+3]=b>>24&255,new Uint8Array(s)}function ls(e){let t=Io[e.type]??Io.CommandButton;return t===17?ba(e):t===21?Ca(e):Fa(e)}function mn(e){e.push(0,2);let t=e.length;e.push(0,0),e.push(5,0,0,0);let o=Jt.encode("Tahoma");for(e.push(...vt(o.length|2147483648)),e.push(160,0,0,0),e.push(...o);e.length%4!==0;)e.push(0);let n=e.length-t-2;e[t]=n&255,e[t+1]=n>>8&255}function ba(e){let t=[],o=!!e.caption;t.push(0,2);let n=t.length;t.push(0,0);let s=32;if(o&&(s|=8),t.push(s&255,s>>8&255,s>>16&255,s>>24&255),o){let l=Jt.encode(e.caption);t.push(...vt(l.length|2147483648))}if(o){let l=Jt.encode(e.caption);for(t.push(...l);t.length%4!==0;)t.push(0)}let r=(e.width??72)*26,a=(e.height??24)*26;t.push(...vt(r)),t.push(...vt(a));let i=t.length-n-2;return t[n]=i&255,t[n+1]=i>>8&255,mn(t),new Uint8Array(t)}function Ca(e){let t=[],o=!!e.caption;t.push(0,2);let n=t.length;t.push(0,0);let s=32;if(o&&(s|=8),t.push(s&255,s>>8&255,s>>16&255,s>>24&255),o){let l=Jt.encode(e.caption);t.push(...vt(l.length|2147483648))}if(o){let l=Jt.encode(e.caption);for(t.push(...l);t.length%4!==0;)t.push(0)}let r=(e.width??80)*26,a=(e.height??18)*26;t.push(...vt(r)),t.push(...vt(a));let i=t.length-n-2;return t[n]=i&255,t[n+1]=i>>8&255,mn(t),new Uint8Array(t)}function Fa(e){let t=[],o=!!e.caption;t.push(0,2);let n=t.length;t.push(0,0);let s=257;if(o&&(s|=1<<23),s|=1<<31,t.push(s&255,s>>8&255,s>>16&255,s>>>24&255),t.push(0,0,0,0),t.push(27,72,128,44),o){let l=Jt.encode(e.caption);t.push(...vt(l.length|2147483648))}let r=(e.width??72)*26,a=(e.height??24)*26;if(t.push(...vt(r)),t.push(...vt(a)),o){let l=Jt.encode(e.caption);for(t.push(...l);t.length%4!==0;)t.push(0)}let i=t.length-n-2;return t[n]=i&255,t[n+1]=i>>8&255,mn(t),new Uint8Array(t)}function va(e){let t=e.controls??[];if(t.length===0)return new Uint8Array(0);let o=[];for(let a of t)o.push(ls(a));let n=o.reduce((a,i)=>a+i.length,0),s=new Uint8Array(n),r=0;for(let a of o)s.set(a,r),r+=a.length;return s}var Jt,vo,So,xa,Io,dn=we(()=>{"use strict";es();as();Jt=new TextEncoder,vo=new TextDecoder("utf-8");So=class e{constructor(){this.modules=[],this._dirty=!1}addModule(t){return this.modules.push(t),this._dirty=!0,this}removeModule(t){return this.modules=this.modules.filter(o=>o.name!==t),this._dirty=!0,this}getModule(t){return this.modules.find(o=>o.name===t)}build(){if(this._raw&&!this._dirty)return this._raw;let o=this.modules.some(p=>p.name==="ThisWorkbook"&&p.type==="document")?this.modules:[{name:"ThisWorkbook",type:"document",code:""},...this.modules],n=[...o.filter(p=>p.type==="document"),...o.filter(p=>p.type!=="document")],s=[];for(let p of n){let g=pa(p)+p.code,u=ln(Jt.encode(g));s.push({name:p.name,data:u,storage:"VBA"})}let r={name:"_VBA_PROJECT",data:new Uint8Array([204,97,255,255,0,0,0]),storage:"VBA"},a=this._buildDirStream(n),l={name:"dir",data:ln(a),storage:"VBA"},h=this._buildProjectText(n),m={name:"PROJECT",data:Jt.encode(h)},c=this._buildProjectWm(n),d={name:"PROJECTwm",data:new Uint8Array(c)},f=[r,l,...s,m,d];for(let p of n)if(p.type==="userform")if(p._formStreams&&p._formStreams.size>0)for(let[g,u]of p._formStreams)f.push({name:g,data:u,storage:p.name});else f.push({name:"CompObj",data:$a(),storage:p.name}),f.push({name:"VBFrame",data:Jt.encode(ya(p)),storage:p.name}),f.push({name:"f",data:wa(p),storage:p.name}),f.push({name:"o",data:va(p),storage:p.name});return rs(f)}_buildDirStream(t){let o=[],s=Jt.encode("VBAProject");o.push(...Tt(1,vt(1))),o.push(...Tt(2,vt(1033))),o.push(...Tt(20,vt(1033))),o.push(...Tt(3,Ce(1252))),o.push(...Tt(4,Array.from(s))),o.push(...Tt(5,[])),o.push(...Tt(64,[])),o.push(...Tt(6,[])),o.push(...Tt(61,[])),o.push(...Tt(7,vt(0))),o.push(...Tt(8,vt(0))),o.push(...Ce(9),...vt(4),...vt(1443),...Ce(2)),o.push(...Tt(12,[])),o.push(...Tt(60,[])),o.push(...Tt(15,Ce(t.length))),o.push(...Tt(19,Ce(65535)));for(let r of t){let a=Jt.encode(r.name),i=fa(r.name);o.push(...Tt(25,Array.from(a))),o.push(...Tt(71,i)),o.push(...Tt(26,Array.from(a))),o.push(...Tt(50,i)),o.push(...Tt(28,[])),o.push(...Tt(72,[])),o.push(...Tt(49,vt(0))),o.push(...Tt(30,vt(0))),o.push(...Tt(44,Ce(65535))),r.type==="document"||r.type==="userform"?o.push(...Tt(34,[])):o.push(...Tt(33,[])),o.push(...Tt(43,[]))}return o.push(...Tt(16,[])),new Uint8Array(o)}_buildProjectText(t){let o=['ID="{00000000-0000-0000-0000-000000000000}"'],n=t.filter(r=>r.type==="document"),s=t.filter(r=>r.type!=="document");for(let r of n)o.push(`Document=${r.name}/&H00000000`);for(let r of s)r.type==="class"?o.push(`Class=${r.name}`):r.type==="userform"?(o.push("Package={AC9F2F90-E877-11CE-9F68-00AA00574A4F}"),o.push(`BaseClass=${r.name}`)):o.push(`Module=${r.name}`);o.push('Name="VBAProject"',"HelpContextID=0",'VersionCompatible32="393222000"',"","[Host Extender Info]","&H00000001={3832D640-CF90-11CF-8E43-00A0C911005A};VBE;&H00000000","","[Workspace]");for(let r of[...n,...s])o.push(`${r.name}=0, 0, 0, 0, C `);return o.join(`\r
7
+ `)+`\r
8
+ `}_buildProjectWm(t){let o=[];for(let n of t){for(let s of n.name)o.push(s.charCodeAt(0));o.push(0);for(let s of n.name){let r=s.charCodeAt(0);o.push(r&255,r>>8&255)}o.push(0,0)}return o.push(0),o}static fromBytes(t){let o=new e;o._raw=t;let n=ss(t),s=new Map;for(let c of n){let d=c.storage?`${c.storage}/${c.name}`:c.name;s.set(d,c.data)}let r=s.get("VBA/dir");if(!r)return o;let a;try{a=cn(r)}catch{return o}let i=new Set,l=new Set,h=s.get("PROJECT");if(h){let c=vo.decode(h);for(let d of c.split(/\r?\n/)){let f=d.match(/^Class=(.+)$/);f&&i.add(f[1]);let p=d.match(/^BaseClass=(.+)$/);p&&l.add(p[1])}}let m=ua(a);for(let c of m){let d=`VBA/${c.name}`,f=s.get(d);if(!f)continue;let p="";try{let x=f.subarray(c.offset),b=cn(x);p=vo.decode(b)}catch{p=vo.decode(f.subarray(c.offset))}let g=ga(p),u=l.has(c.name)?"userform":i.has(c.name)?"class":c.type,$={name:c.name,type:u,code:g};if(u==="userform"){let x=new Map;for(let[y,v]of s)if(y.startsWith(c.name+"/")){let w=y.substring(c.name.length+1);x.set(w,v)}x.size>0&&($._formStreams=x);let b=`${c.name}/f`,C=s.get(b);C&&($.designerData=C)}o.modules.push($)}return o._dirty=!1,o}};xa="{C62A69F0-16DC-11CE-9E98-00AA00574A4F}",Io={Image:12,Frame:14,SpinButton:16,CommandButton:17,Label:21,TextBox:23,ListBox:24,ComboBox:25,CheckBox:26,OptionButton:27,ToggleButton:28,ScrollBar:47}});var hs={};go(hs,{buildCtrlPropXml:()=>Sa,buildFormControlVmlShape:()=>Ta,buildVmlWithControls:()=>ka});function Sa(e){if(e._ctrlPropXml)return e._ctrlPropXml;let o=[`objectType="${Xn[e.type]??"Button"}"`,'lockText="1"'];if(e.linkedCell&&o.push(`fmlaLink="${I(e.linkedCell)}"`),e.inputRange&&o.push(`fmlaRange="${I(e.inputRange)}"`),e.checked!==void 0&&o.push(`checked="${nn[e.checked]??"0"}"`),e.dropLines!==void 0&&o.push(`dropLines="${e.dropLines}"`),e.min!==void 0&&o.push(`min="${e.min}"`),e.max!==void 0&&o.push(`max="${e.max}"`),e.inc!==void 0&&o.push(`inc="${e.inc}"`),e.page!==void 0&&o.push(`page="${e.page}"`),e.val!==void 0&&o.push(`val="${e.val}"`),e.selType){let n={single:"Single",multi:"Multi",extend:"Extend"};o.push(`selType="${n[e.selType]??"Single"}"`)}return e.noThreeD&&o.push('noThreeD="1"'),`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
9
+ <formControlPr xmlns="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main" ${o.join(" ")}/>`}function Ia(e,t){return`${e.col}, ${e.colOff??0}, ${e.row}, ${e.rowOff??0}, ${t.col}, ${t.colOff??0}, ${t.row}, ${t.rowOff??0}`}function Ta(e,t){if(e._vmlShapeXml)return e._vmlShapeXml;let o=wo[e.type]??"Button",n=Ia(e.from,e.to),s=[];if(s.push(`<x:Anchor>${n}</x:Anchor>`),s.push("<x:PrintObject>False</x:PrintObject>"),s.push("<x:AutoFill>False</x:AutoFill>"),e.macro&&s.push(`<x:FmlaMacro>${I(e.macro)}</x:FmlaMacro>`),e.linkedCell&&s.push(`<x:FmlaLink>${I(e.linkedCell)}</x:FmlaLink>`),e.inputRange&&s.push(`<x:FmlaRange>${I(e.inputRange)}</x:FmlaRange>`),e.checked!==void 0&&s.push(`<x:Checked>${nn[e.checked]??"0"}</x:Checked>`),e.dropLines!==void 0&&s.push(`<x:DropLines>${e.dropLines}</x:DropLines>`),e.dropStyle&&s.push(`<x:DropStyle>${I(e.dropStyle)}</x:DropStyle>`),e.min!==void 0&&s.push(`<x:Min>${e.min}</x:Min>`),e.max!==void 0&&s.push(`<x:Max>${e.max}</x:Max>`),e.inc!==void 0&&s.push(`<x:Inc>${e.inc}</x:Inc>`),e.page!==void 0&&s.push(`<x:Page>${e.page}</x:Page>`),e.val!==void 0&&s.push(`<x:Val>${e.val}</x:Val>`),e.selType){let d={single:"Single",multi:"Multi",extend:"Extend"};s.push(`<x:Sel>${d[e.selType]??"Single"}</x:Sel>`)}e.noThreeD&&s.push("<x:NoThreeD/>"),e.isDefault&&s.push("<x:Default/>"),e.isDismiss&&s.push("<x:Dismiss/>"),e.isCancel&&s.push("<x:Cancel/>");let r="";e.text&&(e.type==="button"||e.type==="checkBox"||e.type==="optionButton"||e.type==="groupBox"||e.type==="label"||e.type==="dialog")&&(r=`<v:textbox style="mso-direction-alt:auto"><div style="text-align:${e.type==="button"?"center":"left"}"><font face="Calibri" size="220" color="#000000">${I(e.text)}</font></div></v:textbox>`,s.push("<x:TextHAlign>Center</x:TextHAlign>"),s.push("<x:TextVAlign>Center</x:TextVAlign>"));let a=(e.from.col*64+(e.from.colOff??0))*.75,i=(e.from.row*20+(e.from.rowOff??0))*.75,l=(e.to.col-e.from.col)*64*.75,h=(e.to.row-e.from.row)*20*.75,m=e.text??`${e.type}_${t}`,c=e.type==="dialog"?"":' filled="f" stroked="f"';return`<v:shape o:spid="_x0000_s${t}" id="${I(m)}" type="#_x0000_t201" style="position:absolute;margin-left:${a.toFixed(1)}pt;margin-top:${i.toFixed(1)}pt;width:${l.toFixed(1)}pt;height:${h.toFixed(1)}pt;z-index:${t}"${c} o:insetmode="auto"><o:lock v:ext="edit" rotation="t"/>${r}<x:ClientData ObjectType="${o}">${s.join("")}</x:ClientData></v:shape>`}function ka(e,t){return`<xml xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel">
10
+ <o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1"/></o:shapelayout>
11
+ <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>
12
+ <v:shapetype id="_x0000_t201" coordsize="21600,21600" o:spt="201" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter"/><v:path shadowok="f" o:extrusionok="f" strokeok="f" fillok="f" o:connecttype="rect"/><o:lock v:ext="edit" shapetype="t"/></v:shapetype>
13
+ ${e.join(`
14
+ `)}
15
+ ${t.join(`
16
+ `)}
17
+ </xml>`}var ms=we(()=>{"use strict";Wt();sn()});var $s={};go($s,{applyChartTemplate:()=>us,buildChartXml:()=>Ba,deserializeChartTemplate:()=>xs,saveChartTemplate:()=>ps,serializeChartTemplate:()=>gs});function Ra(e,t){let o=' xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"',n=e.replace(/^FF/,""),s;t?.fillType==="gradient"&&t.gradientStops?.length?s=`<a:gradFill><a:gsLst>${t.gradientStops.map(l=>`<a:gs pos="${l.pos*1e3}"><a:srgbClr val="${l.color.replace(/^FF/,"").replace(/^#/,"")}"/></a:gs>`).join("")}</a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill>`:s=`<a:solidFill><a:srgbClr val="${n}"/></a:solidFill>`;let r=t?.lineWidth?` w="${Math.round(t.lineWidth*12700)}"`:"",a=r?`<a:ln${r}><a:solidFill><a:srgbClr val="${n}"/></a:solidFill></a:ln>`:"";return`<c:spPr${o}>${s}${a}</c:spPr>`}function fs(e){return e?`<c:dLbls>${[e.numFmt?`<c:numFmt formatCode="${I(e.numFmt)}" sourceLinked="0"/>`:"",e.position?`<c:dLblPos val="${e.position}"/>`:"",'<c:showLegendKey val="0"/>',`<c:showVal val="${e.showValue?"1":"0"}"/>`,`<c:showCatName val="${e.showCategory?"1":"0"}"/>`,`<c:showSerName val="${e.showSeriesName?"1":"0"}"/>`,`<c:showPercent val="${e.showPercent?"1":"0"}"/>`].join("")}</c:dLbls>`:""}function Pe(e,t,o,n){return t.map((s,r)=>{let a=s.color?s.color.startsWith("#")?"FF"+s.color.slice(1):s.color:n?"FF"+n[r%n.length]:ds[r%ds.length],i=s.categories?`<c:cat><c:strRef><c:f>${I(s.categories)}</c:f></c:strRef></c:cat>`:"",l=`<c:val><c:numRef><c:f>${I(s.values)}</c:f></c:numRef></c:val>`,h=s.name?`<c:tx><c:strRef><c:f>"${I(s.name)}"</c:f></c:strRef></c:tx>`:"",m=e.startsWith("line")||e==="scatter"?'<c:marker><c:symbol val="none"/></c:marker>':"",c=fs(s.dataLabels);return`<c:ser><c:idx val="${r}"/><c:order val="${r}"/>${h}${Ra(a,s)}${m}${c}${i}${l}</c:ser>`}).join("")}function Pa(e,t,o,n=!1){if(n)return`<c:valAx><c:axId val="${e}"/><c:scaling><c:orientation val="minMax"/></c:scaling><c:delete val="1"/><c:axPos val="b"/><c:crossAx val="${t}"/></c:valAx>`;let s=o?.title?`<c:title><c:tx><c:rich><a:bodyPr xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"/><a:p xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:r><a:t>${I(o.title)}</a:t></a:r></a:p></c:rich></c:tx><c:overlay val="0"/></c:title>`:"",r=[o?.min!==void 0?`<c:min val="${o.min}"/>`:"",o?.max!==void 0?`<c:max val="${o.max}"/>`:""].join(""),a=o?.numFmt?`<c:numFmt formatCode="${I(o.numFmt)}" sourceLinked="0"/>`:"",i=o?.gridLines!==!1?"<c:majorGridlines/>":"";return`<c:valAx>
18
+ <c:axId val="${e}"/>
19
+ <c:scaling><c:orientation val="minMax"/>${r}</c:scaling>
20
+ <c:delete val="0"/>
21
+ <c:axPos val="l"/>
22
+ ${i}${s}${a}
23
+ <c:crossAx val="${t}"/>
24
+ </c:valAx>`}function Ma(e,t,o){let n=o?.title?`<c:title><c:tx><c:rich><a:bodyPr xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"/><a:p xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:r><a:t>${I(o.title)}</a:t></a:r></a:p></c:rich></c:tx><c:overlay val="0"/></c:title>`:"",s=o?.gridLines?"<c:majorGridlines/>":"";return`<c:catAx>
25
+ <c:axId val="${e}"/>
26
+ <c:scaling><c:orientation val="minMax"/></c:scaling>
27
+ <c:delete val="0"/>
28
+ <c:axPos val="b"/>
29
+ ${s}${n}
30
+ <c:crossAx val="${t}"/>
31
+ </c:catAx>`}function Ea(e){if(e===!1)return"";let t=typeof e=="string"?e:"b";return`<c:legend><c:legendPos val="${{bottom:"b",top:"t",left:"l",right:"r",corner:"tr"}[t]??t}"/></c:legend>`}function Ba(e){let t=e.type,o=e.series,n=e.colorPalette?Aa[e.colorPalette]:void 0,s=e.title?`<c:title><c:tx><c:rich>
32
+ <a:bodyPr xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"/>
33
+ <a:p xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
34
+ <a:r><a:t>${I(e.title)}</a:t></a:r>
35
+ </a:p>
36
+ </c:rich></c:tx><c:overlay val="0"/></c:title>`:"",r=e.varyColors?'<c:varyColors val="1"/>':"",a=fs(e.dataLabels),i="",l=t==="pie"||t==="doughnut",h=t.startsWith("bar")||t.startsWith("column"),m=t.startsWith("line"),c=t.startsWith("scatter")||t==="bubble",d=t.startsWith("area"),f=t.startsWith("radar"),p=t==="stock",g=e.grouping??(t.endsWith("Stacked100")?"percentStacked":t.endsWith("Stacked")?"stacked":h?"clustered":m||d?"standard":void 0);if(l){let w=t==="doughnut"?"doughnutChart":"pieChart",k=t==="doughnut"?'<c:holeSize val="50"/>':"";i=`<c:${w}>${r}${Pe(t,o,0,n)}${a}${k}</c:${w}>`}else h?i=`<c:barChart>
37
+ <c:barDir val="${t.startsWith("bar")?"bar":"col"}"/>
38
+ ${g?`<c:grouping val="${g}"/>`:""}
39
+ ${r}
40
+ ${Pe(t,o,0,n)}
41
+ ${a}
42
+ <c:axId val="1"/><c:axId val="2"/>
43
+ </c:barChart>`:m?i=`<c:lineChart>
44
+ ${g?`<c:grouping val="${g}"/>`:""}
45
+ ${r}
46
+ ${Pe(t,o,0,n)}
47
+ ${a}
48
+ <c:axId val="1"/><c:axId val="2"/>
49
+ </c:lineChart>`:c?i=`<c:scatterChart>
50
+ <c:scatterStyle val="${t==="scatterSmooth"?"smoothMarker":"marker"}"/>
51
+ ${r}
52
+ ${Pe(t,o,0,n)}
53
+ ${a}
54
+ <c:axId val="1"/><c:axId val="2"/>
55
+ </c:scatterChart>`:d?i=`<c:areaChart>
56
+ ${g?`<c:grouping val="${g}"/>`:""}
57
+ ${r}
58
+ ${Pe(t,o,0,n)}
59
+ ${a}
60
+ <c:axId val="1"/><c:axId val="2"/>
61
+ </c:areaChart>`:f?i=`<c:radarChart>
62
+ <c:radarStyle val="${t==="radarFilled"?"filled":"marker"}"/>
63
+ ${r}
64
+ ${Pe(t,o,0,n)}
65
+ ${a}
66
+ <c:axId val="1"/><c:axId val="2"/>
67
+ </c:radarChart>`:i=`<c:barChart>
68
+ <c:barDir val="col"/>
69
+ <c:grouping val="clustered"/>
70
+ ${r}
71
+ ${Pe(t,o,0,n)}
72
+ ${a}
73
+ <c:axId val="1"/><c:axId val="2"/>
74
+ </c:barChart>`;let $=!l?Ma(1,2,e.xAxis)+Pa(2,1,e.yAxis):"",x=Ea(e.legend??"b"),b=e.modernStyle?Math.min(Da[e.modernStyle],48):e.style,C=b?`<c:style val="${b}"/>`:"",y="";if(e.chartFill||e.shadow){let w=e.chartFill==="gradient"?'<a:gradFill><a:gsLst><a:gs pos="0"><a:schemeClr val="lt1"/></a:gs><a:gs pos="100000"><a:schemeClr val="bg1"><a:lumMod val="85000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill>':e.chartFill==="white"?'<a:solidFill><a:srgbClr val="FFFFFF"/></a:solidFill>':e.chartFill==="none"?"<a:noFill/>":"",k=e.shadow?'<a:effectLst><a:outerShdw blurRad="50800" dist="38100" dir="5400000" algn="t" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="40000"/></a:srgbClr></a:outerShdw></a:effectLst>':"";y=`<c:spPr>${w}${k}</c:spPr>`}return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
75
+ <c:chartSpace xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart"
76
+ xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
77
+ xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
78
+ ${e.roundedCorners?'<c:roundedCorners val="1"/>':""}
79
+ ${C}
80
+ <c:chart>
81
+ ${s}
82
+ <c:autoTitleDeleted val="${e.title?"0":"1"}"/>
83
+ <c:plotArea>
84
+ ${i}
85
+ ${$}
86
+ </c:plotArea>
87
+ ${x}
88
+ <c:plotVisOnly val="1"/>
89
+ </c:chart>
90
+ ${y}
91
+ </c:chartSpace>`}function ps(e){return{type:e.type,style:e.style,modernStyle:e.modernStyle,colorPalette:e.colorPalette,legend:e.legend,xAxis:e.xAxis,yAxis:e.yAxis,dataLabels:e.dataLabels,chartFill:e.chartFill,roundedCorners:e.roundedCorners,shadow:e.shadow,varyColors:e.varyColors,grouping:e.grouping}}function us(e,t){return{type:t.type??e.type,title:t.title,series:t.series,from:t.from,to:t.to,xAxis:t.xAxis??e.xAxis,yAxis:t.yAxis??e.yAxis,legend:t.legend??e.legend,style:t.style??e.style,modernStyle:t.modernStyle??e.modernStyle,colorPalette:t.colorPalette??e.colorPalette,dataLabels:t.dataLabels??e.dataLabels,chartFill:t.chartFill??e.chartFill,roundedCorners:t.roundedCorners??e.roundedCorners,shadow:t.shadow??e.shadow,varyColors:t.varyColors??e.varyColors,grouping:t.grouping??e.grouping}}function gs(e){return JSON.stringify(e)}function xs(e){return JSON.parse(e)}var ds,Aa,Da,fn=we(()=>{"use strict";Wt();ds=["FF4472C4","FFED7D31","FFA5A5A5","FFFFC000","FF5B9BD5","FF70AD47","FF264478","FF9E480E","FF636363","FF997300"],Aa={office:["4472C4","ED7D31","A5A5A5","FFC000","5B9BD5","70AD47","264478","9E480E","636363","997300"],blue:["5B9BD5","8FAADC","B4C7E7","D6DCE4","4472C4","2F5597","1F4E79","002060","00B0F0","0070C0"],orange:["ED7D31","F4B183","F8CBAD","FCE4D6","C55A11","843C0C","BF8F00","806000","FFD966","FFC000"],green:["70AD47","A9D18E","C5E0B4","E2F0D9","548235","375623","92D050","00B050","00B0F0","00FF00"],red:["FF0000","FF6161","FF9F9F","FFD2D2","C00000","8B0000","FFC000","FF6600","FF3300","CC0000"],purple:["7030A0","9B59B6","BB8FCE","D7BDE2","5B2C6F","4A235A","8E44AD","6C3483","A569BD","D2B4DE"],teal:["00B0F0","00BCD4","26C6DA","80DEEA","0097A7","006064","009688","00796B","4DB6AC","80CBC4"],gray:["595959","808080","A6A6A6","D9D9D9","404040","262626","BFBFBF","F2F2F2","7F7F7F","C0C0C0"],gold:["FFC000","FFD966","FFE699","FFF2CC","BF8F00","806000","ED7D31","F4B183","DBA13A","C09100"],blueWarm:["4472C4","5B9BD5","9DC3E6","BDD7EE","DEEBF7","2E75B6","1F4E79","2F5597","8FAADC","D6DCE4"],blueGreen:["00B0F0","00B050","70AD47","5B9BD5","4472C4","2E75B6","548235","00B0F0","009688","00796B"],greenYellow:["70AD47","92D050","C9E265","FFD966","FFC000","548235","BF8F00","A9D18E","E2F0D9","C5E0B4"],redOrange:["FF0000","ED7D31","FFC000","FF6600","C00000","843C0C","BF8F00","FF3300","F4B183","FFD966"],redViolet:["FF0000","7030A0","ED7D31","C00000","5B2C6F","843C0C","FF6161","9B59B6","F4B183","BB8FCE"],yellowOrange:["FFC000","ED7D31","FFD966","F4B183","BF8F00","C55A11","FFE699","F8CBAD","806000","843C0C"],slipstream:["4472C4","ED7D31","A5A5A5","FFC000","5B9BD5","70AD47","255E91","9E480E","636363","997300"],marquee:["ED7D31","4472C4","70AD47","FFC000","5B9BD5","A5A5A5","264478","9E480E","636363","997300"],aspect:["5B9BD5","4472C4","ED7D31","FFC000","70AD47","A5A5A5","9E480E","264478","636363","997300"]},Da={colorful1:102,colorful2:103,colorful3:104,colorful4:105,monochromatic1:201,monochromatic2:202,monochromatic3:203,monochromatic4:204,monochromatic5:205,monochromatic6:206,monochromatic7:207,monochromatic8:208,monochromatic9:209,monochromatic10:210,monochromatic11:211,monochromatic12:212}});var ys={};go(ys,{buildPivotTableFiles:()=>ja});function ja(e,t,o,n){let s=(t[0]??[]).map(G=>String(G??"")),r=t.slice(1),a=s.length,i=e.rowGrandTotals!==!1,l=e.colGrandTotals!==!1,h=new Map(s.map((G,X)=>[G,X])),m=e.rowFields.map(G=>h.get(G)??0),c=e.colFields.map(G=>h.get(G)??0),d=e.dataFields.map(G=>h.get(G.field)??0),f=Array.from({length:a},()=>[]),p=Array.from({length:a},()=>new Map),g=new Array(a).fill(!0);for(let G of r)for(let X=0;X<a;X++){let F=G[X],P=F==null?"":String(F);typeof F!="number"&&(g[X]=!1),p[X].has(P)||(p[X].set(P,f[X].length),f[X].push(P))}let{row:u,col:$}=qt(e.targetCell),x=c.length>0,b=x?c.reduce((G,X)=>G*Math.max(f[X].length,1),1):1,y=1+(m.length?m.reduce((G,X)=>G*Math.max(f[X].length,1),1):1)+(i?1:0),v=e.dataFields.length+(e.calculatedFields??[]).length,w=m.length+b*v+(l?v:0),k=`${be(u,$)}:${be(u+y-1,$+w-1)}`,T=m.length+1,S=new Set([...m,...c]),D=e.calculatedFields??[],R=D.map(G=>`<cacheField name="${I(G.name)}" numFmtId="0" formula="${I(G.formula)}" databaseField="0"><sharedItems/></cacheField>`).join(""),A=a+D.length,W=new Map;for(let G of e.fieldGrouping??[]){let X=h.get(G.field);X!==void 0&&W.set(X,G)}let Q=s.map((G,X)=>{let F=W.get(X);if(S.has(X)){let P=f[X].map(Y=>`<s v="${I(Y)}"/>`).join(""),U="";return F&&(F.groupBy==="numeric"?U=`<fieldGroup base="${X}"><rangePr startNum="${F.start??0}" endNum="${F.end??100}" groupInterval="${F.interval??10}"/></fieldGroup>`:U=`<fieldGroup base="${X}"><rangePr groupBy="${{days:"days",months:"months",quarters:"quarters",years:"years"}[F.groupBy]??"months"}"/></fieldGroup>`),`<cacheField name="${I(G)}" numFmtId="0"><sharedItems count="${f[X].length}">${P}</sharedItems>${U}</cacheField>`}if(g[X]){let P=r.map(st=>Number(st[X])).filter(st=>!isNaN(st)),U=P.length?Math.min(...P):0,Y=P.length?Math.max(...P):0;return`<cacheField name="${I(G)}" numFmtId="0"><sharedItems containsSemiMixedTypes="0" containsString="0" containsNumber="1" minValue="${U}" maxValue="${Y}"/></cacheField>`}return`<cacheField name="${I(G)}" numFmtId="0"><sharedItems/></cacheField>`}).join("")+R,q=r.map(G=>`<r>${s.map((F,P)=>{let U=G[P];if(S.has(P)){let Y=U==null?"":String(U);return`<x v="${p[P].get(Y)??0}"/>`}return typeof U=="number"?`<n v="${U}"/>`:typeof U=="boolean"?`<b v="${U?1:0}"/>`:`<s v="${I(String(U??""))}"/>`}).join("")}</r>`).join(""),E=s.map((G,X)=>{let F=m.includes(X),P=c.includes(X),U=d.includes(X);if(F){let Y=f[X].map((st,ht)=>`<item x="${ht}"/>`).join("")+'<item t="default"/>';return`<pivotField axis="axisRow" showAll="0"><items count="${f[X].length+1}">${Y}</items></pivotField>`}if(P){let Y=f[X].map((st,ht)=>`<item x="${ht}"/>`).join("")+'<item t="default"/>';return`<pivotField axis="axisCol" showAll="0"><items count="${f[X].length+1}">${Y}</items></pivotField>`}return U?'<pivotField dataField="1" showAll="0"/>':'<pivotField showAll="0"/>'}).join("")+D.map(()=>'<pivotField dataField="1" showAll="0"/>').join(""),_="",M="";if(m.length){_=`<rowFields count="${m.length}">${m.map(P=>`<field x="${P}"/>`).join("")}</rowFields>`;let G=m[0],X=f[G].map((P,U)=>`<i><x v="${U}"/></i>`).join(""),F=i?'<i t="grand"><x/></i>':"";M=`<rowItems count="${f[G].length+(i?1:0)}">${X}${F}</rowItems>`}let N="",H="";if(x){N=`<colFields count="${c.length}">${c.map(P=>`<field x="${P}"/>`).join("")}</colFields>`;let G=c[0],X=f[G].map((P,U)=>`<i><x v="${U}"/></i>`).join(""),F=l?'<i t="grand"><x/></i>':"";H=`<colItems count="${f[G].length+(l?1:0)}">${X}${F}</colItems>`}else if(v>1){N='<colFields count="1"><field x="-2"/></colFields>';let G=Array.from({length:v},(X,F)=>`<i><x v="${F}"/></i>`).join("");H=`<colItems count="${v}">${G}</colItems>`}let V=[];for(let G=0;G<e.dataFields.length;G++){let X=e.dataFields[G],F=d[G],P=_a[X.func??"sum"]??"sum",U=X.name??`Sum of ${X.field}`;V.push(`<dataField name="${I(U)}" fld="${F}" subtotal="${P}" showDataAs="normal" baseField="0" baseItem="0"/>`)}for(let G=0;G<D.length;G++){let X=D[G],F=a+G;V.push(`<dataField name="${I(X.name)}" fld="${F}" subtotal="sum" showDataAs="normal" baseField="0" baseItem="0"/>`)}let K=`<dataFields count="${V.length}">${V.join("")}</dataFields>`,z=[i?"":'rowGrandTotals="0"',l?"":'colGrandTotals="0"'].filter(Boolean),mt=z.length?" "+z.join(" "):"",it=I(e.style??"PivotStyleMedium9"),gt=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
92
+ <pivotTableDefinition xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="${I(e.name)}" cacheId="${n}" applyNumberFormats="0" applyBorderFormats="0" applyFontFormats="0" applyPatternFormats="0" applyAlignmentFormats="0" applyWidthHeightFormats="1" dataCaption="Values" updatedVersion="6" minRefreshableVersion="3" useAutoFormatting="1" itemPrintTitles="1" createdVersion="6" indent="0" outline="1" outlineData="1" multipleFieldFilters="0"${mt}>
93
+ <location ref="${k}" firstHeaderRow="1" firstDataRow="2" firstDataCol="${T}"/>
94
+ <pivotFields count="${A}">${E}</pivotFields>
95
+ ${_}${M}${N}${H}${K}
96
+ <pivotTableStyleInfo name="${it}" showRowHeaders="1" showColHeaders="1" showRowStripes="0" showColStripes="0" showLastColumn="1"/>
97
+ </pivotTableDefinition>`,St=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
98
+ <pivotCacheDefinition xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:id="rId1" refreshedBy="ExcelForge" refreshedDate="45000" createdVersion="6" refreshedVersion="6" minRefreshableVersion="3" recordCount="${r.length}" saveData="1">
99
+ <cacheSource type="worksheet"><worksheetSource ref="${e.sourceRef}" sheet="${I(e.sourceSheet)}"/></cacheSource>
100
+ <cacheFields count="${A}">${Q}</cacheFields>
101
+ </pivotCacheDefinition>`,J=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
102
+ <pivotCacheRecords xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" count="${r.length}">${q}</pivotCacheRecords>`;return{pivotTableXml:gt,cacheDefXml:St,cacheRecordsXml:J}}var _a,ws=we(()=>{"use strict";Wt();_a={sum:"sum",count:"count",average:"average",max:"max",min:"min",product:"product",countNums:"countNums",stdDev:"stdDev",stdDevp:"stdDevp",var:"var",varp:"varp"}});var ee=class e{constructor(t){this.error=t}toString(){return this.error}static{this.NULL=new e("#NULL!")}static{this.DIV0=new e("#DIV/0!")}static{this.VALUE=new e("#VALUE!")}static{this.REF=new e("#REF!")}static{this.NAME=new e("#NAME?")}static{this.NUM=new e("#NUM!")}static{this.NA=new e("#N/A")}static{this.GETTING=new e("#GETTING_DATA")}};Wt();var Uo=/[&<>]/g,rr={"&":"&amp;","<":"&lt;",">":"&gt;"};function Vo(e){return Uo.test(e)?(Uo.lastIndex=0,e.replace(Uo,t=>rr[t])):e}function kn(e){if(e.startsWith("theme:")){let o=e.slice(6),n=o.indexOf(":tint:");if(n>=0){let s=o.slice(0,n),r=o.slice(n+6);return`<color theme="${s}" tint="${r}"/>`}return`<color theme="${o}"/>`}return`<color rgb="${e.startsWith("#")?"FF"+e.slice(1):e}"/>`}var ar={average:101,count:102,countNums:103,max:104,min:105,stdDev:107,sum:109,var:110,vars:111},ke=class{constructor(t,o={}){this.cells=new Map,this.merges=[],this.images=[],this.cellImages=[],this.charts=[],this.conditionalFormats=[],this.tables=[],this.pivotTables=[],this.sparklines=[],this.formControls=[],this.shapes=[],this.wordArt=[],this.queryTables=[],this.tableSlicers=[],this.mathEquations=[],this.oleObjects=[],this.colDefs=new Map,this.rowDefs=new Map,this.dataValidations=new Map,this.rowBreaks=[],this.colBreaks=[],this.preservedXml=[],this._nextSharedIdx=0,this._isChartSheet=!1,this._isDialogSheet=!1,this.sheetIndex=0,this.rId="",this.drawingRId="",this.legacyDrawingRId="",this.tableRIds=[],this.ctrlPropRIds=[],this.slicerRId="",this._slicerDrawingInfo=[],this._cellImageVm=new Map,this.ignoreErrors=[],this.oleRIds=[],this.oleIconRIds=[],this.name=t,this.options={...o,name:t}}markDirty(){this._workbook?.markDirty(this.name)}setActive(){this._workbook?.setActiveSheet(this.name)}getCell(t,o){let n=this.cells.get(t);n||(n=new Map,this.cells.set(t,n));let s=n.get(o);return s||(s={},n.set(o,s)),s}getCellByRef(t){let{row:o,col:n}=qt(t);return this.getCell(o,n)}setCell(t,o,n){let s=this.cells.get(t);return s||(s=new Map,this.cells.set(t,s)),s.set(o,n),this}setValue(t,o,n){let s=this.getCell(t,o);return delete s.formula,delete s.arrayFormula,delete s.richText,delete s._sharedIdx,delete s._sharedRef,delete s._dynamic,s.value=n,this}setFormula(t,o,n){let s=this.getCell(t,o);return delete s.arrayFormula,delete s.richText,delete s._sharedIdx,delete s._sharedRef,delete s._dynamic,s.formula=n,this}setDynamicArrayFormula(t,o,n){let s=this.getCell(t,o);return delete s.formula,delete s.richText,delete s._sharedIdx,delete s._sharedRef,s.arrayFormula=n,s._dynamic=!0,this}setSharedFormula(t,o,n,s){let r=this._nextSharedIdx++,a=this.getCell(t,o);a.formula=n,a._sharedRef=s,a._sharedIdx=r;let{startRow:i,startCol:l,endRow:h,endCol:m}=Zt(s);for(let c=i;c<=h;c++)for(let d=l;d<=m;d++){if(c===t&&d===o)continue;let f=this.getCell(c,d);f._sharedIdx=r}return this}setStyle(t,o,n){return this.getCell(t,o).style=n,this}writeArray(t,o,n){for(let s=0;s<n.length;s++)for(let r=0;r<n[s].length;r++)this.setValue(t+s,o+r,n[s][r]);return this}writeColumn(t,o,n){return n.forEach((s,r)=>this.setValue(t+r,o,s)),this}writeRow(t,o,n){return n.forEach((s,r)=>this.setValue(t,o+r,s)),this}setColumn(t,o){return this.colDefs.set(t,o),this}setColumnWidth(t,o){let n=this.colDefs.get(t)??{};return this.colDefs.set(t,{...n,width:o,customWidth:!0}),this}setRow(t,o){return this.rowDefs.set(t,o),this}setRowHeight(t,o){let n=this.rowDefs.get(t)??{};return this.rowDefs.set(t,{...n,height:o}),this}merge(t,o,n,s){return this.merges.push({startRow:t,startCol:o,endRow:n,endCol:s}),this}mergeByRef(t){let[o,n]=t.split(":"),s=qt(o),r=qt(n);return this.merge(s.row,s.col,r.row,r.col)}getMerges(){return this.merges}addImage(t){return this.images.push(t),this}getImages(){return this.images}addCellImage(t){return this.cellImages.push(t),this}getCellImages(){return this.cellImages}getComments(){let t=[];for(let[o,n]of this.cells)for(let[s,r]of n)r.comment&&t.push({row:o,col:s,comment:r.comment});return t}addChart(t){return this.charts.push(t),this}getCharts(){return this.charts}addConditionalFormat(t){return this.conditionalFormats.push(t),this}getConditionalFormats(){return this.conditionalFormats}getDataValidations(){return this.dataValidations}addTable(t){if(this.tables.push(t),t.totalsRow&&t.columns?.length){let{startRow:o,startCol:n,endRow:s}=Zt(t.ref),r=o+1,a=s-1;t.columns.forEach((i,l)=>{let h=n+l;if(i.totalsRowLabel)this.setValue(s,h,i.totalsRowLabel);else if(i.totalsRowFunction&&i.totalsRowFunction!=="none"){let m=ar[i.totalsRowFunction];if(m!==void 0){let c=Ut(h);this.setFormula(s,h,`SUBTOTAL(${m},${c}${r}:${c}${a})`)}}})}return this}getTables(){return this.tables}addPivotTable(t){return this.pivotTables.push(t),this}getPivotTables(){return this.pivotTables}readRange(t){let{startRow:o,startCol:n,endRow:s,endCol:r}=Zt(t),a=[];for(let i=o;i<=s;i++){let l=[],h=this.cells.get(i);for(let m=n;m<=r;m++){let c=h?.get(m);l.push(c?.value??null)}a.push(l)}return a}readAllCells(){let t=[];for(let[o,n]of this.cells)for(let[s,r]of n)t.push({row:o,col:s,cell:r});return t}getUsedRange(){let t=1/0,o=0,n=1/0,s=0;for(let[r,a]of this.cells)for(let[i]of a)r<t&&(t=r),r>o&&(o=r),i<n&&(n=i),i>s&&(s=i);return o===0?null:{startRow:t,startCol:n,endRow:o,endCol:s}}getColumn(t){return this.colDefs.get(t)}getRow(t){return this.rowDefs.get(t)}insertRows(t,o){let n=[...this.cells.keys()].filter(r=>r>=t).sort((r,a)=>a-r);for(let r of n){let a=this.cells.get(r);this.cells.delete(r),this.cells.set(r+o,a)}let s=[...this.rowDefs.keys()].filter(r=>r>=t).sort((r,a)=>a-r);for(let r of s){let a=this.rowDefs.get(r);this.rowDefs.delete(r),this.rowDefs.set(r+o,a)}for(let r of this.merges)r.startRow>=t&&(r.startRow+=o),r.endRow>=t&&(r.endRow+=o);return this}deleteRows(t,o){for(let r=t;r<t+o;r++)this.cells.delete(r),this.rowDefs.delete(r);let n=[...this.cells.keys()].filter(r=>r>=t+o).sort((r,a)=>r-a);for(let r of n){let a=this.cells.get(r);this.cells.delete(r),this.cells.set(r-o,a)}let s=[...this.rowDefs.keys()].filter(r=>r>=t+o).sort((r,a)=>r-a);for(let r of s){let a=this.rowDefs.get(r);this.rowDefs.delete(r),this.rowDefs.set(r-o,a)}this.merges=this.merges.filter(r=>!(r.startRow>=t&&r.endRow<t+o));for(let r of this.merges)r.startRow>=t+o&&(r.startRow-=o),r.endRow>=t+o&&(r.endRow-=o);return this}insertColumns(t,o){for(let[,s]of this.cells){let r=[...s.keys()].filter(a=>a>=t).sort((a,i)=>i-a);for(let a of r){let i=s.get(a);s.delete(a),s.set(a+o,i)}}let n=[...this.colDefs.keys()].filter(s=>s>=t).sort((s,r)=>r-s);for(let s of n){let r=this.colDefs.get(s);this.colDefs.delete(s),this.colDefs.set(s+o,r)}for(let s of this.merges)s.startCol>=t&&(s.startCol+=o),s.endCol>=t&&(s.endCol+=o);return this}copyRange(t,o,n){let{startRow:s,startCol:r,endRow:a,endCol:i}=Zt(t);for(let l=s;l<=a;l++)for(let h=r;h<=i;h++){let m=this.getCell(l,h),c=o+(l-s),d=n+(h-r);m.value!=null&&this.setValue(c,d,m.value),m.formula&&this.setFormula(c,d,m.formula),m.style&&this.setStyle(c,d,{...m.style})}return this}moveRange(t,o,n){let{startRow:s,startCol:r,endRow:a,endCol:i}=Zt(t);this.copyRange(t,o,n);let l=o+(a-s),h=n+(i-r);for(let m=s;m<=a;m++)for(let c=r;c<=i;c++){let d=o+(m-s),f=n+(c-r);if(d===m&&f===c)continue;let p=this.cells.get(m);p&&p.delete(c)}return this}sortRange(t,o,n="asc"){let{startRow:s,startCol:r,endRow:a,endCol:i}=Zt(t),l=[];for(let h=s;h<=a;h++){let m=this.cells.get(h),c=new Map;for(let d=r;d<=i;d++){let f=m?.get(d);f&&c.set(d,{...f})}l.push({rowIdx:h,cells:c})}l.sort((h,m)=>{let c=h.cells.get(o)?.value,d=m.cells.get(o)?.value,f=typeof c=="number"||typeof c=="string"?c:"",p=typeof d=="number"||typeof d=="string"?d:"",g=0;return typeof f=="number"&&typeof p=="number"?g=f-p:g=String(f).localeCompare(String(p)),n==="desc"?-g:g});for(let h=0;h<l.length;h++){let m=s+h;for(let c=r;c<=i;c++){let d=l[h].cells.get(c),f=this.cells.get(m)??new Map;this.cells.has(m)||this.cells.set(m,f),d?f.set(c,d):f.delete(c)}}return this}fillNumber(t,o,n,s=0,r=1){for(let a=0;a<n;a++)this.setValue(t+a,o,s+a*r);return this}fillDate(t,o,n,s,r="day",a=1){for(let i=0;i<n;i++){let l=new Date(s);switch(r){case"day":l.setDate(l.getDate()+i*a);break;case"week":l.setDate(l.getDate()+i*a*7);break;case"month":l.setMonth(l.getMonth()+i*a);break;case"year":l.setFullYear(l.getFullYear()+i*a);break}this.setValue(t+i,o,l)}return this}fillList(t,o,n,s){for(let r=0;r<s;r++)this.setValue(t+r,o,n[r%n.length]);return this}autoFitColumns(t=8,o=60){let n=this.getUsedRange();if(!n)return this;for(let s=n.startCol;s<=n.endCol;s++){let r=0;for(let a=n.startRow;a<=n.endRow;a++){let i=this.cells.get(a)?.get(s);if(i?.value!=null){let l=String(i.value);l.length>r&&(r=l.length)}if(i?.richText){let l=i.richText.map(h=>h.text).join("");l.length>r&&(r=l.length)}}if(r>0){let a=Math.max(t,Math.min(o,r*1.2+2));this.setColumn(s,{...this.colDefs.get(s)??{},width:a,customWidth:!0})}}return this}duplicateRow(t,o){this.insertRows(o,1);let n=this.cells.get(t>=o?t+1:t);if(n){let r=new Map;for(let[a,i]of n)r.set(a,{...i,style:i.style?{...i.style}:void 0});this.cells.set(o,r)}let s=this.rowDefs.get(t>=o?t+1:t);return s&&this.rowDefs.set(o,{...s}),this}spliceRows(t,o,n){if(o>0&&this.deleteRows(t,o),n&&n.length>0){this.insertRows(t,n.length);for(let s=0;s<n.length;s++)this.writeRow(t+s,1,n[s])}return this}setAutoFilter(t,o){return this.autoFilter={ref:t},o?.columns&&(this._filterColumns=o.columns),this}addSparkline(t){return this.sparklines.push(t),this}getSparklines(){return this.sparklines}addDataValidation(t,o){return this.dataValidations.set(t,o),this}addRowBreak(t,o=!0){return this.rowBreaks.push({id:t,manual:o}),this}addColBreak(t,o=!0){return this.colBreaks.push({id:t,manual:o}),this}getRowBreaks(){return this.rowBreaks}getColBreaks(){return this.colBreaks}addFormControl(t){if(!t.to&&(t.width||t.height)){let s=t.width??100,r=t.height??30,a=t.from.col+s/64,i=t.from.row+r/20;t={...t,to:{col:Math.floor(a),row:Math.floor(i),colOff:Math.round(a%1*64),rowOff:Math.round(i%1*20)}}}return this.formControls.push(t),this}getFormControls(){return this.formControls}addShape(t){return this.shapes.push(t),this}getShapes(){return this.shapes}addOleObject(t){return this.oleObjects.push(t),this}getOleObjects(){return this.oleObjects}addWordArt(t){return this.wordArt.push(t),this}getWordArt(){return this.wordArt}addQueryTable(t){return this.queryTables.push(t),this}getQueryTables(){return this.queryTables}addTableSlicer(t){return this.tableSlicers.push(t),this}getTableSlicers(){return this.tableSlicers}addMathEquation(t){return this.mathEquations.push(t),this}getMathEquations(){return this.mathEquations}addIgnoredError(t,o){return this.ignoreErrors.push({sqref:t,...o}),this}getIgnoredErrors(){return this.ignoreErrors}addPreservedXml(t){return this.preservedXml.push(t),this}freeze(t,o){return this.freezePane={row:t,col:o},this}toXml(t,o){let n=this.pageSetup?.fitToPage,s=this.options?.tabColor,r=n||s?`<sheetPr>${s?`<tabColor rgb="${s}"/>`:""}${n?'<pageSetUpPr fitToPage="1"/>':""}</sheetPr>`:"",a=this._sheetViewXml(),i=this._colsXml(t),l=this._sheetDataXml(t,o),h=this._mergesXml(),m=this._conditionalFormatXml(t),c=this._dataValidationsXml(),d=this.autoFilter&&!this.tables.some(A=>A.ref===this.autoFilter.ref)?this._autoFilterXml():"",f=this.tables.length?`<tableParts count="${this.tables.length}">${this.tableRIds.map(A=>`<tablePart r:id="${A}"/>`).join("")}</tableParts>`:"",p=this.drawingRId?`<drawing r:id="${this.drawingRId}"/>`:"",g=this.legacyDrawingRId?`<legacyDrawing r:id="${this.legacyDrawingRId}"/>`:"",u=this._formControlsXml(),$=this._oleObjectsXml(),x=this._sparklineXml(),b=this._customIconExtXml(),C=this.slicerRId?`<extLst><ext uri="{A8765BA9-456A-4dab-B4F3-ACF838C121DE}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"><x14:slicerList><x14:slicer r:id="${this.slicerRId}"/></x14:slicerList></ext></extLst>`:"",y=this._ignoredErrorsXml(),v=this._protectionXml(),w=this._pageSetupXml(),k=this._pageMarginsXml(),T=this._headerFooterXml(),S=this._printOptionsXml(),D=this._pageBreaksXml("rowBreaks",this.rowBreaks,16383),R=this._pageBreaksXml("colBreaks",this.colBreaks,1048575);return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
103
  <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
3
104
  xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
4
105
  xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"
@@ -47,8 +148,8 @@ ${o}
47
148
  <sheetProtection sheet="1"/>
48
149
  ${n||'<pageMargins left="0.7" right="0.7" top="0.78740157499999996" bottom="0.78740157499999996" header="0.3" footer="0.3"/>'}
49
150
  ${s}
50
- </dialogsheet>`}_sheetViewXml(){let t=this.view??{},o=['workbookViewId="0"',t.showGridLines===!1?'showGridLines="0"':"",t.showRowColHeaders===!1?'showRowColHeaders="0"':"",t.zoomScale!==void 0?`zoomScale="${t.zoomScale}"`:"",t.rightToLeft?'rightToLeft="1"':"",t.tabSelected?'tabSelected="1"':"",t.view?`view="${t.view}"`:""].filter(Boolean),n="";if(this.freezePane){let{row:s=0,col:r=0}=this.freezePane,a=s&&r?ye(s+1,r+1):s?ye(s+1,1):ye(1,r+1),i=s&&r?"bottomRight":s?"bottomLeft":"topRight";n=`<pane xSplit="${r}" ySplit="${s}" topLeftCell="${a}" activePane="${i}" state="frozen"/>
51
- <selection pane="${i}" activeCell="${a}" sqref="${a}"/>`}return`<sheetViews><sheetView ${o.join(" ")}>${n}</sheetView></sheetViews>`}_colsXml(t){return this.colDefs.size?`<cols>${[...this.colDefs.entries()].sort((s,r)=>s[0]-r[0]).map(([s,r])=>{let a=r.style?t.register(r.style):0;return`<col min="${s}" max="${s}"`+(r.width?` width="${r.width}" customWidth="1"`:"")+(r.hidden?' hidden="1"':"")+(r.bestFit?' bestFit="1"':"")+(r.outlineLevel?` outlineLevel="${r.outlineLevel}"`:"")+(r.collapsed?' collapsed="1"':"")+(a?` style="${a}"`:"")+"/>"}).join("")}</cols>`:""}_sheetDataXml(t,o){let n=[...this.cells.entries()].sort((r,a)=>r[0]-a[0]),s=["<sheetData>"];for(let r=0;r<n.length;r++){let[a,i]=n[r],l=this.rowDefs.get(a),h=l?.style?t.register(l.style):0,m=`r="${a}"`;l?.height&&(m+=` ht="${l.height}" customHeight="1"`),l?.hidden&&(m+=' hidden="1"'),l?.outlineLevel&&(m+=` outlineLevel="${l.outlineLevel}"`),l?.collapsed&&(m+=' collapsed="1"'),h&&(m+=` s="${h}" customFormat="1"`),l?.thickTop&&(m+=' thickTop="1"'),l?.thickBot&&(m+=' thickBot="1"'),s.push(`<row ${m}>`);let c=[...i.entries()].sort((d,f)=>d[0]-f[0]);for(let d=0;d<c.length;d++)s.push(this._cellXml(a,c[d][0],c[d][1],t,o));s.push("</row>")}return s.push("</sheetData>"),s.join("")}_cellXml(t,o,n,s,r){let a=`${Ut(o)}${t}`,i=n.style?s.register(n.style):0,l=i?` s="${i}"`:"",h=this._cellImageVm.get(a),m=h!==void 0?` vm="${h}"`:"";if(n.arrayFormula){let f=`<f t="array" ref="${a}">${Lo(n.arrayFormula)}</f>`;return`<c r="${a}"${l}${m}>${f}<v>0</v></c>`}if(n._sharedIdx!==void 0){let f=n._sharedIdx,p=n._sharedRef;if(n.formula&&p){let g=`<f t="shared" ref="${p}" si="${f}">${Lo(n.formula)}</f>`;return`<c r="${a}"${l}${m}>${g}</c>`}return`<c r="${a}"${l}${m}><f t="shared" si="${f}"/></c>`}if(n.formula){let f=`<f>${Lo(n.formula)}</f>`;return`<c r="${a}"${l}${m}>${f}</c>`}if(n.richText){let f=r.internRichText(n.richText);return`<c r="${a}" t="s"${l}${m}><v>${f}</v></c>`}let c=n.value;if(c==null)return m?`<c r="${a}"${l} t="e"${m}><v>#VALUE!</v></c>`:i?`<c r="${a}"${l}/>`:"";if(c instanceof te)return`<c r="${a}" t="e"${l}${m}><v>${I(c.error)}</v></c>`;if(typeof c=="boolean")return`<c r="${a}" t="b"${l}${m}><v>${c?1:0}</v></c>`;if(c instanceof Date){let f=_o(c);return`<c r="${a}"${l}${m}><v>${f}</v></c>`}if(typeof c=="number")return`<c r="${a}"${l}${m}><v>${c}</v></c>`;let d=r.intern(c);return`<c r="${a}" t="s"${l}${m}><v>${d}</v></c>`}_mergesXml(){if(!this.merges.length)return"";let t=this.merges.map(o=>{let n=`${Ut(o.startCol)}${o.startRow}`,s=`${Ut(o.endCol)}${o.endRow}`;return`<mergeCell ref="${n}:${s}"/>`});return`<mergeCells count="${this.merges.length}">${t.join("")}</mergeCells>`}_conditionalFormatXml(t){return this.conditionalFormats.map(o=>{let n=o.style?t.registerDxf(o.style):void 0,s="";if(o.colorScale?.type==="colorScale"){let l=o.colorScale,h=l.cfvo.map(c=>`<cfvo type="${c.type}"${c.val?` val="${c.val}"`:""}/>`).join(""),m=l.color.map(c=>xn(c)).join("");s=`<colorScale>${h}${m}</colorScale>`}else if(o.dataBar?.type==="dataBar"){let l=o.dataBar,h=`<cfvo type="${l.minType??"min"}"${l.minVal!=null?` val="${l.minVal}"`:""}/>`,m=`<cfvo type="${l.maxType??"max"}"${l.maxVal!=null?` val="${l.maxVal}"`:""}/>`,c=l.color??l.minColor??"FF638EC6";s=`<dataBar${l.showValue===!1?' showValue="0"':""}>${h}${m}${xn(c)}</dataBar>`}else if(o.iconSet?.type==="iconSet"){let l=o.iconSet,h=l.cfvo.map(m=>`<cfvo type="${m.type}"${m.val?` val="${m.val}"`:""}/>`).join("");s=`<iconSet iconSet="${l.iconSet}"${l.showValue===!1?' showValue="0"':""}${l.reverse?' reverse="1"':""}>${h}</iconSet>`}let r=[`type="${o.type}"`,o.operator?`operator="${o.operator}"`:"",n!==void 0?`dxfId="${n}"`:"",`priority="${o.priority??1}"`,o.aboveAverage===!1?'aboveAverage="0"':"",o.percent?'percent="1"':"",o.rank?`rank="${o.rank}"`:"",o.timePeriod?`timePeriod="${o.timePeriod}"`:"",o.text?`text="${I(o.text)}"`:""].filter(Boolean).join(" "),a=o.formula?`<formula>${I(o.formula)}</formula>`:"",i=o.formula2?`<formula>${I(o.formula2)}</formula>`:"";return`<conditionalFormatting sqref="${o.sqref}"><cfRule ${r}>${a}${i}${s}</cfRule></conditionalFormatting>`}).join("")}_dataValidationsXml(){if(!this.dataValidations.size)return"";let t=[...this.dataValidations.entries()].map(([o,n])=>{let s=n.type==="list"&&n.list?`<formula1>"${n.list.join(",")}"</formula1>`:n.formula1?`<formula1>${I(n.formula1)}</formula1>`:"",r=n.formula2?`<formula2>${I(n.formula2)}</formula2>`:"";return`<dataValidation ${[`type="${n.type}"`,n.operator?`operator="${n.operator}"`:"",`sqref="${o}"`,n.showDropDown!==!1&&n.type==="list"?"":'showDropDown="1"',n.allowBlank!==!1?'allowBlank="1"':"",n.showErrorAlert?'showErrorMessage="1"':"",n.errorTitle?`errorTitle="${I(n.errorTitle)}"`:"",n.error?`error="${I(n.error)}"`:"",n.showInputMessage?'showInputMessage="1"':"",n.promptTitle?`promptTitle="${I(n.promptTitle)}"`:"",n.prompt?`prompt="${I(n.prompt)}"`:""].filter(Boolean).join(" ")}>${s}${r}</dataValidation>`});return`<dataValidations count="${this.dataValidations.size}">${t.join("")}</dataValidations>`}_protectionXml(){let t=this.protection;return t?`<sheetProtection ${[t.sheet?'sheet="1"':"",t.password?`password="${Ns(t.password)}"`:"",t.selectLockedCells===!1?'selectLockedCells="0"':"",t.selectUnlockedCells===!1?'selectUnlockedCells="0"':"",t.formatCells?'formatCells="0"':"",t.formatColumns?'formatColumns="0"':"",t.formatRows?'formatRows="0"':"",t.insertColumns?'insertColumns="0"':"",t.insertRows?'insertRows="0"':"",t.insertHyperlinks?'insertHyperlinks="0"':"",t.deleteColumns?'deleteColumns="0"':"",t.deleteRows?'deleteRows="0"':"",t.sort?'sort="0"':"",t.autoFilter?'autoFilter="0"':"",t.pivotTables?'pivotTables="0"':""].filter(Boolean).join(" ")}/>`:""}_pageSetupXml(){let t=this.pageSetup;return t?`<pageSetup ${[t.paperSize?`paperSize="${t.paperSize}"`:"",t.orientation?`orientation="${t.orientation}"`:"",t.fitToWidth!==void 0?`fitToWidth="${t.fitToWidth}"`:"",t.fitToHeight!==void 0?`fitToHeight="${t.fitToHeight}"`:"",t.scale?`scale="${t.scale}"`:"",t.horizontalDpi?`horizontalDpi="${t.horizontalDpi}"`:"",t.verticalDpi?`verticalDpi="${t.verticalDpi}"`:"",t.firstPageNumber?`firstPageNumber="${t.firstPageNumber}" useFirstPageNumber="1"`:""].filter(Boolean).join(" ")}/>`:""}_pageMarginsXml(){let t=this.pageMargins,n={...{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},...t};return`<pageMargins left="${n.left}" right="${n.right}" top="${n.top}" bottom="${n.bottom}" header="${n.header}" footer="${n.footer}"/>`}_headerFooterXml(){let t=this.headerFooter;if(!t)return"";let o=[t.differentOddEven?'differentOddEven="1"':"",t.differentFirst?'differentFirst="1"':""].filter(Boolean).join(" "),n=t.oddHeader?`<oddHeader>${I(t.oddHeader)}</oddHeader>`:"",s=t.oddFooter?`<oddFooter>${I(t.oddFooter)}</oddFooter>`:"",r=t.evenHeader?`<evenHeader>${I(t.evenHeader)}</evenHeader>`:"",a=t.evenFooter?`<evenFooter>${I(t.evenFooter)}</evenFooter>`:"",i=t.firstHeader?`<firstHeader>${I(t.firstHeader)}</firstHeader>`:"",l=t.firstFooter?`<firstFooter>${I(t.firstFooter)}</firstFooter>`:"";return`<headerFooter${o?" "+o:""}>${n}${s}${r}${a}${i}${l}</headerFooter>`}_printOptionsXml(){let t=this.printOptions;if(!t)return"";let o=[t.gridLines?'gridLines="1"':"",t.gridLinesSet?'gridLinesSet="1"':"",t.headings?'headings="1"':"",t.centerHorizontal?'horizontalCentered="1"':"",t.centerVertical?'verticalCentered="1"':""].filter(Boolean).join(" ");return o?`<printOptions ${o}/>`:""}_pageBreaksXml(t,o,n){if(!o.length)return"";let s=o.filter(a=>a.manual!==!1).length,r=o.map(a=>`<brk id="${a.id}" max="${n}"${a.manual!==!1?' man="1"':""}/>`).join("");return`<${t} count="${o.length}" manualBreakCount="${s}">${r}</${t}>`}_formControlsXml(){if(!this.formControls.length||!this.ctrlPropRIds.length)return"";let t=1025+this.sheetIndex*1e3,o=0;for(let s of this.cells.values())for(let r of s.values())r.comment&&o++;return`<mc:AlternateContent><mc:Choice Requires="x14"><controls>${this.formControls.map((s,r)=>{let a=s._shapeId??t+o+r,i=this.ctrlPropRIds[r];if(!i)return"";let l=s.text??`${s.type} ${r+1}`;return`<mc:AlternateContent><mc:Choice Requires="x14"><control shapeId="${a}" r:id="${i}" name="${I(l)}"><controlPr defaultSize="0" print="0" autoFill="0" autoPict="0"${s.macro?` macro="${I(s.macro)}"`:""}><anchor moveWithCells="1"><from><xdr:col>${s.from.col}</xdr:col><xdr:colOff>${s.from.colOff??0}</xdr:colOff><xdr:row>${s.from.row}</xdr:row><xdr:rowOff>${s.from.rowOff??0}</xdr:rowOff></from><to><xdr:col>${s.to.col}</xdr:col><xdr:colOff>${s.to.colOff??0}</xdr:colOff><xdr:row>${s.to.row}</xdr:row><xdr:rowOff>${s.to.rowOff??0}</xdr:rowOff></to></anchor></controlPr></control></mc:Choice></mc:AlternateContent>`}).join("")}</controls></mc:Choice></mc:AlternateContent>`}_oleObjectsXml(){if(!this.oleObjects.length||!this.oleRIds.length)return"";let t=2025+this.sheetIndex*1e3;return`<oleObjects>${this.oleObjects.map((n,s)=>{let r=t+s,a=this.oleRIds[s],i=n.progId??"Package",l=n.linkToFile&&n.linkPath?` link="${I(n.linkPath)}"`:"";return`<oleObject progId="${I(i)}" shapeId="${r}" r:id="${a}"${l}/>`}).join("")}</oleObjects>`}_sparklineXml(){if(!this.sparklines.length)return"";let t=(s,r)=>{if(!r)return"";let a=r.startsWith("#")?"FF"+r.slice(1):r;return`<x14:${s} rgb="${a}"/>`};return`<extLst><ext uri="{05C60535-1F16-4fd2-B633-F4F36F0B64E0}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main">${`<x14:sparklineGroups xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main">${this.sparklines.map(s=>{let a=[`type="${s.type==="bar"?"column":s.type}"`,s.lineWidth!==void 0?`lineWeight="${s.lineWidth}"`:"",s.showMarkers?'markers="1"':"",s.showFirst?'first="1"':"",s.showLast?'last="1"':"",s.showHigh?'high="1"':"",s.showLow?'low="1"':"",s.showNegative?'negative="1"':"",s.minAxisType?`minAxisType="${s.minAxisType}"`:"",s.maxAxisType?`maxAxisType="${s.maxAxisType}"`:""].filter(Boolean).join(" "),i=[t("colorSeries",s.color),t("colorHigh",s.highColor),t("colorLow",s.lowColor),t("colorFirst",s.firstColor),t("colorLast",s.lastColor),t("colorNegative",s.negativeColor),t("colorMarkers",s.markersColor)].join(""),l=s.dataRange.includes("!")?s.dataRange:`${this.name}!${s.dataRange}`,h=`<x14:sparklines><x14:sparkline><xm:f>${I(l)}</xm:f><xm:sqref>${s.location}</xm:sqref></x14:sparkline></x14:sparklines>`;return`<x14:sparklineGroup ${a}>${i}${h}</x14:sparklineGroup>`}).join("")}</x14:sparklineGroups>`}</ext></extLst>`}_customIconExtXml(){let t=this.conditionalFormats.filter(n=>n.iconSet?.type==="iconSet"&&"custom"in n.iconSet&&n.iconSet.custom?.length);return t.length?`<extLst><ext uri="{78C0D931-6437-407d-A8EE-F0AAD7539E65}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main">${t.map((n,s)=>{let r=n.iconSet,a=r.cfvo.map(l=>`<x14:cfvo type="${l.type}"${l.val?` val="${l.val}"`:""}/>`).join(""),i=r.custom.map(l=>`<x14:cfIcon iconSet="${l.iconSet}" iconId="${l.iconId}"/>`).join("");return`<x14:conditionalFormatting xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main"><x14:cfRule type="iconSet" id="{${this._uuid()}}"><x14:iconSet iconSet="${r.iconSet}" custom="1"${r.showValue===!1?' showValue="0"':""}${r.reverse?' reverse="1"':""}>${a}${i}</x14:iconSet></x14:cfRule><xm:sqref>${n.sqref}</xm:sqref></x14:conditionalFormatting>`}).join("")}</ext></extLst>`:""}_uuid(){let t="0123456789ABCDEF",o="";for(let n=0;n<36;n++)n===8||n===13||n===18||n===23?o+="-":n===14?o+="4":n===19?o+=t[(Math.random()*4|0)+8]:o+=t[Math.random()*16|0];return o}_autoFilterXml(){if(!this.autoFilter)return"";let t=this._filterColumns;if(!t||t.length===0)return`<autoFilter ref="${this.autoFilter.ref}"/>`;let o=t.map(n=>{let s=n.col-1,r="";return n.type==="custom"?r=`<customFilters><customFilter operator="${n.operator??"greaterThan"}" val="${n.val??""}"/></customFilters>`:n.type==="top10"?r=`<top10 ${[n.top===!1?'top="0"':"",n.percent?'percent="1"':"",`val="${n.val??10}"`].filter(Boolean).join(" ")}/>`:n.type==="value"&&n.items?r=`<filters>${n.items.map(a=>`<filter val="${I(String(a))}"/>`).join("")}</filters>`:n.type==="dynamic"&&(r=`<dynamicFilter type="${n.dynamicType??"aboveAverage"}"/>`),`<filterColumn colId="${s}">${r}</filterColumn>`}).join("");return`<autoFilter ref="${this.autoFilter.ref}">${o}</autoFilter>`}_ignoredErrorsXml(){return this.ignoreErrors.length?`<ignoredErrors>${this.ignoreErrors.map(o=>{let n=[`sqref="${o.sqref}"`];return o.numberStoredAsText&&n.push('numberStoredAsText="1"'),o.formula&&n.push('formula="1"'),o.formulaRange&&n.push('formulaRange="1"'),o.unlockedFormula&&n.push('unlockedFormula="1"'),o.evalError&&n.push('evalError="1"'),o.twoDigitTextYear&&n.push('twoDigitTextYear="1"'),o.emptyRef&&n.push('emptyRef="1"'),o.listDataValidation&&n.push('listDataValidation="1"'),o.calculatedColumn&&n.push('calculatedColumn="1"'),`<ignoredError ${n.join(" ")}/>`}).join("")}</ignoredErrors>`:""}toDrawingXml(t,o){let n=[],s=jo;this.images.forEach((i,l)=>{let h=t[l],m=s(i.width??100),c=s(i.height??100),d,f;if(i.position)d=`<xdr:absoluteAnchor><xdr:pos x="${s(i.position.x)}" y="${s(i.position.y)}"/><xdr:ext cx="${m}" cy="${c}"/>`,f="</xdr:absoluteAnchor>";else{let g=i.from,u=i.to,$=`<xdr:from><xdr:col>${g.col}</xdr:col><xdr:colOff>${g.colOff??0}</xdr:colOff><xdr:row>${g.row}</xdr:row><xdr:rowOff>${g.rowOff??0}</xdr:rowOff></xdr:from>`;if(u){let x=`<xdr:to><xdr:col>${u.col}</xdr:col><xdr:colOff>${u.colOff??0}</xdr:colOff><xdr:row>${u.row}</xdr:row><xdr:rowOff>${u.rowOff??0}</xdr:rowOff></xdr:to>`;d=`<xdr:twoCellAnchor editAs="oneCell">${$}${x}`,f="</xdr:twoCellAnchor>"}else d=`<xdr:oneCellAnchor>${$}<xdr:ext cx="${m}" cy="${c}"/>`,f="</xdr:oneCellAnchor>"}let p=`<xdr:pic>
151
+ </dialogsheet>`}_sheetViewXml(){let t=this.view??{},o=['workbookViewId="0"',t.showGridLines===!1?'showGridLines="0"':"",t.showRowColHeaders===!1?'showRowColHeaders="0"':"",t.zoomScale!==void 0?`zoomScale="${t.zoomScale}"`:"",t.rightToLeft?'rightToLeft="1"':"",t.tabSelected?'tabSelected="1"':"",t.view?`view="${t.view}"`:""].filter(Boolean),n="";if(this.freezePane){let{row:s=0,col:r=0}=this.freezePane,a=s&&r?be(s+1,r+1):s?be(s+1,1):be(1,r+1),i=s&&r?"bottomRight":s?"bottomLeft":"topRight";n=`<pane xSplit="${r}" ySplit="${s}" topLeftCell="${a}" activePane="${i}" state="frozen"/>
152
+ <selection pane="${i}" activeCell="${a}" sqref="${a}"/>`}return`<sheetViews><sheetView ${o.join(" ")}>${n}</sheetView></sheetViews>`}_colsXml(t){return this.colDefs.size?`<cols>${[...this.colDefs.entries()].sort((s,r)=>s[0]-r[0]).map(([s,r])=>{let a=r.style?t.register(r.style):0;return`<col min="${s}" max="${s}"`+(r.width?` width="${r.width}" customWidth="1"`:"")+(r.hidden?' hidden="1"':"")+(r.bestFit?' bestFit="1"':"")+(r.outlineLevel?` outlineLevel="${r.outlineLevel}"`:"")+(r.collapsed?' collapsed="1"':"")+(a?` style="${a}"`:"")+"/>"}).join("")}</cols>`:""}_sheetDataXml(t,o){let n=[...this.cells.entries()].sort((r,a)=>r[0]-a[0]),s=["<sheetData>"];for(let r=0;r<n.length;r++){let[a,i]=n[r],l=this.rowDefs.get(a),h=l?.style?t.register(l.style):0,m=`r="${a}"`;l?.height&&(m+=` ht="${l.height}" customHeight="1"`),l?.hidden&&(m+=' hidden="1"'),l?.outlineLevel&&(m+=` outlineLevel="${l.outlineLevel}"`),l?.collapsed&&(m+=' collapsed="1"'),h&&(m+=` s="${h}" customFormat="1"`),l?.thickTop&&(m+=' thickTop="1"'),l?.thickBot&&(m+=' thickBot="1"'),s.push(`<row ${m}>`);let c=[...i.entries()].sort((d,f)=>d[0]-f[0]);for(let d=0;d<c.length;d++)s.push(this._cellXml(a,c[d][0],c[d][1],t,o));s.push("</row>")}return s.push("</sheetData>"),s.join("")}_cellXml(t,o,n,s,r){let a=`${Ut(o)}${t}`,i=n.style?s.register(n.style):0,l=i?` s="${i}"`:"",h=this._cellImageVm.get(a),m=h!==void 0?` vm="${h}"`:"";if(n.arrayFormula){let f=`<f t="array" ref="${a}">${Vo(n.arrayFormula)}</f>`;return`<c r="${a}"${l}${m}>${f}<v>0</v></c>`}if(n._sharedIdx!==void 0){let f=n._sharedIdx,p=n._sharedRef;if(n.formula&&p){let g=`<f t="shared" ref="${p}" si="${f}">${Vo(n.formula)}</f>`;return`<c r="${a}"${l}${m}>${g}</c>`}return`<c r="${a}"${l}${m}><f t="shared" si="${f}"/></c>`}if(n.formula){let f=`<f>${Vo(n.formula)}</f>`;return`<c r="${a}"${l}${m}>${f}</c>`}if(n.richText){let f=r.internRichText(n.richText);return`<c r="${a}" t="s"${l}${m}><v>${f}</v></c>`}let c=n.value;if(c==null)return m?`<c r="${a}"${l} t="e"${m}><v>#VALUE!</v></c>`:i?`<c r="${a}"${l}/>`:"";if(c instanceof ee)return`<c r="${a}" t="e"${l}${m}><v>${I(c.error)}</v></c>`;if(typeof c=="boolean")return`<c r="${a}" t="b"${l}${m}><v>${c?1:0}</v></c>`;if(c instanceof Date){let f=No(c);return`<c r="${a}"${l}${m}><v>${f}</v></c>`}if(typeof c=="number")return`<c r="${a}"${l}${m}><v>${c}</v></c>`;let d=r.intern(c);return`<c r="${a}" t="s"${l}${m}><v>${d}</v></c>`}_mergesXml(){if(!this.merges.length)return"";let t=this.merges.map(o=>{let n=`${Ut(o.startCol)}${o.startRow}`,s=`${Ut(o.endCol)}${o.endRow}`;return`<mergeCell ref="${n}:${s}"/>`});return`<mergeCells count="${this.merges.length}">${t.join("")}</mergeCells>`}_conditionalFormatXml(t){return this.conditionalFormats.map(o=>{let n=o.style?t.registerDxf(o.style):void 0,s="";if(o.colorScale?.type==="colorScale"){let l=o.colorScale,h=l.cfvo.map(c=>`<cfvo type="${c.type}"${c.val?` val="${c.val}"`:""}/>`).join(""),m=l.color.map(c=>kn(c)).join("");s=`<colorScale>${h}${m}</colorScale>`}else if(o.dataBar?.type==="dataBar"){let l=o.dataBar,h=`<cfvo type="${l.minType??"min"}"${l.minVal!=null?` val="${l.minVal}"`:""}/>`,m=`<cfvo type="${l.maxType??"max"}"${l.maxVal!=null?` val="${l.maxVal}"`:""}/>`,c=l.color??l.minColor??"FF638EC6";s=`<dataBar${l.showValue===!1?' showValue="0"':""}>${h}${m}${kn(c)}</dataBar>`}else if(o.iconSet?.type==="iconSet"){let l=o.iconSet,h=l.cfvo.map(m=>`<cfvo type="${m.type}"${m.val?` val="${m.val}"`:""}/>`).join("");s=`<iconSet iconSet="${l.iconSet}"${l.showValue===!1?' showValue="0"':""}${l.reverse?' reverse="1"':""}>${h}</iconSet>`}let r=[`type="${o.type}"`,o.operator?`operator="${o.operator}"`:"",n!==void 0?`dxfId="${n}"`:"",`priority="${o.priority??1}"`,o.aboveAverage===!1?'aboveAverage="0"':"",o.percent?'percent="1"':"",o.rank?`rank="${o.rank}"`:"",o.timePeriod?`timePeriod="${o.timePeriod}"`:"",o.text?`text="${I(o.text)}"`:""].filter(Boolean).join(" "),a=o.formula?`<formula>${I(o.formula)}</formula>`:"",i=o.formula2?`<formula>${I(o.formula2)}</formula>`:"";return`<conditionalFormatting sqref="${o.sqref}"><cfRule ${r}>${a}${i}${s}</cfRule></conditionalFormatting>`}).join("")}_dataValidationsXml(){if(!this.dataValidations.size)return"";let t=[...this.dataValidations.entries()].map(([o,n])=>{let s=n.type==="list"&&n.list?`<formula1>"${n.list.join(",")}"</formula1>`:n.formula1?`<formula1>${I(n.formula1)}</formula1>`:"",r=n.formula2?`<formula2>${I(n.formula2)}</formula2>`:"";return`<dataValidation ${[`type="${n.type}"`,n.operator?`operator="${n.operator}"`:"",`sqref="${o}"`,n.showDropDown!==!1&&n.type==="list"?"":'showDropDown="1"',n.allowBlank!==!1?'allowBlank="1"':"",n.showErrorAlert?'showErrorMessage="1"':"",n.errorTitle?`errorTitle="${I(n.errorTitle)}"`:"",n.error?`error="${I(n.error)}"`:"",n.showInputMessage?'showInputMessage="1"':"",n.promptTitle?`promptTitle="${I(n.promptTitle)}"`:"",n.prompt?`prompt="${I(n.prompt)}"`:""].filter(Boolean).join(" ")}>${s}${r}</dataValidation>`});return`<dataValidations count="${this.dataValidations.size}">${t.join("")}</dataValidations>`}_protectionXml(){let t=this.protection;return t?`<sheetProtection ${[t.sheet?'sheet="1"':"",t.password?`password="${ir(t.password)}"`:"",t.selectLockedCells===!1?'selectLockedCells="0"':"",t.selectUnlockedCells===!1?'selectUnlockedCells="0"':"",t.formatCells?'formatCells="0"':"",t.formatColumns?'formatColumns="0"':"",t.formatRows?'formatRows="0"':"",t.insertColumns?'insertColumns="0"':"",t.insertRows?'insertRows="0"':"",t.insertHyperlinks?'insertHyperlinks="0"':"",t.deleteColumns?'deleteColumns="0"':"",t.deleteRows?'deleteRows="0"':"",t.sort?'sort="0"':"",t.autoFilter?'autoFilter="0"':"",t.pivotTables?'pivotTables="0"':""].filter(Boolean).join(" ")}/>`:""}_pageSetupXml(){let t=this.pageSetup;return t?`<pageSetup ${[t.paperSize?`paperSize="${t.paperSize}"`:"",t.orientation?`orientation="${t.orientation}"`:"",t.fitToWidth!==void 0?`fitToWidth="${t.fitToWidth}"`:"",t.fitToHeight!==void 0?`fitToHeight="${t.fitToHeight}"`:"",t.scale?`scale="${t.scale}"`:"",t.horizontalDpi?`horizontalDpi="${t.horizontalDpi}"`:"",t.verticalDpi?`verticalDpi="${t.verticalDpi}"`:"",t.firstPageNumber?`firstPageNumber="${t.firstPageNumber}" useFirstPageNumber="1"`:""].filter(Boolean).join(" ")}/>`:""}_pageMarginsXml(){let t=this.pageMargins,n={...{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},...t};return`<pageMargins left="${n.left}" right="${n.right}" top="${n.top}" bottom="${n.bottom}" header="${n.header}" footer="${n.footer}"/>`}_headerFooterXml(){let t=this.headerFooter;if(!t)return"";let o=[t.differentOddEven?'differentOddEven="1"':"",t.differentFirst?'differentFirst="1"':""].filter(Boolean).join(" "),n=t.oddHeader?`<oddHeader>${I(t.oddHeader)}</oddHeader>`:"",s=t.oddFooter?`<oddFooter>${I(t.oddFooter)}</oddFooter>`:"",r=t.evenHeader?`<evenHeader>${I(t.evenHeader)}</evenHeader>`:"",a=t.evenFooter?`<evenFooter>${I(t.evenFooter)}</evenFooter>`:"",i=t.firstHeader?`<firstHeader>${I(t.firstHeader)}</firstHeader>`:"",l=t.firstFooter?`<firstFooter>${I(t.firstFooter)}</firstFooter>`:"";return`<headerFooter${o?" "+o:""}>${n}${s}${r}${a}${i}${l}</headerFooter>`}_printOptionsXml(){let t=this.printOptions;if(!t)return"";let o=[t.gridLines?'gridLines="1"':"",t.gridLinesSet?'gridLinesSet="1"':"",t.headings?'headings="1"':"",t.centerHorizontal?'horizontalCentered="1"':"",t.centerVertical?'verticalCentered="1"':""].filter(Boolean).join(" ");return o?`<printOptions ${o}/>`:""}_pageBreaksXml(t,o,n){if(!o.length)return"";let s=o.filter(a=>a.manual!==!1).length,r=o.map(a=>`<brk id="${a.id}" max="${n}"${a.manual!==!1?' man="1"':""}/>`).join("");return`<${t} count="${o.length}" manualBreakCount="${s}">${r}</${t}>`}_formControlsXml(){if(!this.formControls.length||!this.ctrlPropRIds.length)return"";let t=1025+this.sheetIndex*1e3,o=0;for(let s of this.cells.values())for(let r of s.values())r.comment&&o++;return`<mc:AlternateContent><mc:Choice Requires="x14"><controls>${this.formControls.map((s,r)=>{let a=s._shapeId??t+o+r,i=this.ctrlPropRIds[r];if(!i)return"";let l=s.text??`${s.type} ${r+1}`;return`<mc:AlternateContent><mc:Choice Requires="x14"><control shapeId="${a}" r:id="${i}" name="${I(l)}"><controlPr defaultSize="0" print="0" autoFill="0" autoPict="0"${s.macro?` macro="${I(s.macro)}"`:""}><anchor moveWithCells="1"><from><xdr:col>${s.from.col}</xdr:col><xdr:colOff>${s.from.colOff??0}</xdr:colOff><xdr:row>${s.from.row}</xdr:row><xdr:rowOff>${s.from.rowOff??0}</xdr:rowOff></from><to><xdr:col>${s.to.col}</xdr:col><xdr:colOff>${s.to.colOff??0}</xdr:colOff><xdr:row>${s.to.row}</xdr:row><xdr:rowOff>${s.to.rowOff??0}</xdr:rowOff></to></anchor></controlPr></control></mc:Choice></mc:AlternateContent>`}).join("")}</controls></mc:Choice></mc:AlternateContent>`}_oleObjectsXml(){if(!this.oleObjects.length||!this.oleRIds.length)return"";let t=2025+this.sheetIndex*1e3;return`<oleObjects>${this.oleObjects.map((n,s)=>{let r=t+s,a=this.oleRIds[s],i=n.progId??"Package",l=n.linkToFile&&n.linkPath?` link="${I(n.linkPath)}"`:"";return`<oleObject progId="${I(i)}" shapeId="${r}" r:id="${a}"${l}/>`}).join("")}</oleObjects>`}_sparklineXml(){if(!this.sparklines.length)return"";let t=(s,r)=>{if(!r)return"";let a=r.startsWith("#")?"FF"+r.slice(1):r;return`<x14:${s} rgb="${a}"/>`};return`<extLst><ext uri="{05C60535-1F16-4fd2-B633-F4F36F0B64E0}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main">${`<x14:sparklineGroups xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main">${this.sparklines.map(s=>{let a=[`type="${s.type==="bar"?"column":s.type}"`,s.lineWidth!==void 0?`lineWeight="${s.lineWidth}"`:"",s.showMarkers?'markers="1"':"",s.showFirst?'first="1"':"",s.showLast?'last="1"':"",s.showHigh?'high="1"':"",s.showLow?'low="1"':"",s.showNegative?'negative="1"':"",s.minAxisType?`minAxisType="${s.minAxisType}"`:"",s.maxAxisType?`maxAxisType="${s.maxAxisType}"`:""].filter(Boolean).join(" "),i=[t("colorSeries",s.color),t("colorHigh",s.highColor),t("colorLow",s.lowColor),t("colorFirst",s.firstColor),t("colorLast",s.lastColor),t("colorNegative",s.negativeColor),t("colorMarkers",s.markersColor)].join(""),l=s.dataRange.includes("!")?s.dataRange:`${this.name}!${s.dataRange}`,h=`<x14:sparklines><x14:sparkline><xm:f>${I(l)}</xm:f><xm:sqref>${s.location}</xm:sqref></x14:sparkline></x14:sparklines>`;return`<x14:sparklineGroup ${a}>${i}${h}</x14:sparklineGroup>`}).join("")}</x14:sparklineGroups>`}</ext></extLst>`}_customIconExtXml(){let t=this.conditionalFormats.filter(n=>n.iconSet?.type==="iconSet"&&"custom"in n.iconSet&&n.iconSet.custom?.length);return t.length?`<extLst><ext uri="{78C0D931-6437-407d-A8EE-F0AAD7539E65}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main">${t.map((n,s)=>{let r=n.iconSet,a=r.cfvo.map(l=>`<x14:cfvo type="${l.type}"${l.val?` val="${l.val}"`:""}/>`).join(""),i=r.custom.map(l=>`<x14:cfIcon iconSet="${l.iconSet}" iconId="${l.iconId}"/>`).join("");return`<x14:conditionalFormatting xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main"><x14:cfRule type="iconSet" id="{${this._uuid()}}"><x14:iconSet iconSet="${r.iconSet}" custom="1"${r.showValue===!1?' showValue="0"':""}${r.reverse?' reverse="1"':""}>${a}${i}</x14:iconSet></x14:cfRule><xm:sqref>${n.sqref}</xm:sqref></x14:conditionalFormatting>`}).join("")}</ext></extLst>`:""}_uuid(){let t="0123456789ABCDEF",o="";for(let n=0;n<36;n++)n===8||n===13||n===18||n===23?o+="-":n===14?o+="4":n===19?o+=t[(Math.random()*4|0)+8]:o+=t[Math.random()*16|0];return o}_autoFilterXml(){if(!this.autoFilter)return"";let t=this._filterColumns;if(!t||t.length===0)return`<autoFilter ref="${this.autoFilter.ref}"/>`;let o=t.map(n=>{let s=n.col-1,r="";return n.type==="custom"?r=`<customFilters><customFilter operator="${n.operator??"greaterThan"}" val="${n.val??""}"/></customFilters>`:n.type==="top10"?r=`<top10 ${[n.top===!1?'top="0"':"",n.percent?'percent="1"':"",`val="${n.val??10}"`].filter(Boolean).join(" ")}/>`:n.type==="value"&&n.items?r=`<filters>${n.items.map(a=>`<filter val="${I(String(a))}"/>`).join("")}</filters>`:n.type==="dynamic"&&(r=`<dynamicFilter type="${n.dynamicType??"aboveAverage"}"/>`),`<filterColumn colId="${s}">${r}</filterColumn>`}).join("");return`<autoFilter ref="${this.autoFilter.ref}">${o}</autoFilter>`}_ignoredErrorsXml(){return this.ignoreErrors.length?`<ignoredErrors>${this.ignoreErrors.map(o=>{let n=[`sqref="${o.sqref}"`];return o.numberStoredAsText&&n.push('numberStoredAsText="1"'),o.formula&&n.push('formula="1"'),o.formulaRange&&n.push('formulaRange="1"'),o.unlockedFormula&&n.push('unlockedFormula="1"'),o.evalError&&n.push('evalError="1"'),o.twoDigitTextYear&&n.push('twoDigitTextYear="1"'),o.emptyRef&&n.push('emptyRef="1"'),o.listDataValidation&&n.push('listDataValidation="1"'),o.calculatedColumn&&n.push('calculatedColumn="1"'),`<ignoredError ${n.join(" ")}/>`}).join("")}</ignoredErrors>`:""}toDrawingXml(t,o){let n=[],s=Xo;this.images.forEach((i,l)=>{let h=t[l],m=s(i.width??100),c=s(i.height??100),d,f;if(i.position)d=`<xdr:absoluteAnchor><xdr:pos x="${s(i.position.x)}" y="${s(i.position.y)}"/><xdr:ext cx="${m}" cy="${c}"/>`,f="</xdr:absoluteAnchor>";else{let g=i.from,u=i.to,$=`<xdr:from><xdr:col>${g.col}</xdr:col><xdr:colOff>${g.colOff??0}</xdr:colOff><xdr:row>${g.row}</xdr:row><xdr:rowOff>${g.rowOff??0}</xdr:rowOff></xdr:from>`;if(u){let x=`<xdr:to><xdr:col>${u.col}</xdr:col><xdr:colOff>${u.colOff??0}</xdr:colOff><xdr:row>${u.row}</xdr:row><xdr:rowOff>${u.rowOff??0}</xdr:rowOff></xdr:to>`;d=`<xdr:twoCellAnchor editAs="oneCell">${$}${x}`,f="</xdr:twoCellAnchor>"}else d=`<xdr:oneCellAnchor>${$}<xdr:ext cx="${m}" cy="${c}"/>`,f="</xdr:oneCellAnchor>"}let p=`<xdr:pic>
52
153
  <xdr:nvPicPr>
53
154
  <xdr:cNvPr id="${l+2}" name="Image ${l+1}"${i.altText?` descr="${I(i.altText)}"`:""}/>
54
155
  <xdr:cNvPicPr><a:picLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1"/></xdr:cNvPicPr>
@@ -67,13 +168,13 @@ ${s}
67
168
  <a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/chart">
68
169
  <c:chart xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" r:id="${h}"/>
69
170
  </a:graphicData>
70
- </a:graphic>`;if(this._isChartSheet)n.push(`<xdr:absoluteAnchor><xdr:pos x="0" y="0"/><xdr:ext cx="9294091" cy="6003636"/><xdr:graphicFrame macro=""><xdr:nvGraphicFramePr><xdr:cNvPr id="${this.images.length+l+2}" name="Chart ${l+1}"/><xdr:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noGrp="1"/></xdr:cNvGraphicFramePr></xdr:nvGraphicFramePr><xdr:xfrm><a:off xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" x="0" y="0"/><a:ext xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" cx="0" cy="0"/></xdr:xfrm>${d}</xdr:graphicFrame><xdr:clientData/></xdr:absoluteAnchor>`);else{let f=`<xdr:from><xdr:col>${m.col}</xdr:col><xdr:colOff>${m.colOff??0}</xdr:colOff><xdr:row>${m.row}</xdr:row><xdr:rowOff>${m.rowOff??0}</xdr:rowOff></xdr:from>`,p=`<xdr:to><xdr:col>${c.col}</xdr:col><xdr:colOff>${c.colOff??0}</xdr:colOff><xdr:row>${c.row}</xdr:row><xdr:rowOff>${c.rowOff??0}</xdr:rowOff></xdr:to>`;n.push(`<xdr:twoCellAnchor editAs="oneCell">${f}${p}<xdr:graphicFrame macro=""><xdr:nvGraphicFramePr><xdr:cNvPr id="${this.images.length+l+2}" name="Chart ${l+1}"/><xdr:cNvGraphicFramePr/></xdr:nvGraphicFramePr><xdr:xfrm><a:off xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" x="0" y="0"/><a:ext xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" cx="0" cy="0"/></xdr:xfrm>${d}</xdr:graphicFrame><xdr:clientData/></xdr:twoCellAnchor>`)}});let r=this.images.length+this.charts.length+2,a=i=>{let l=i.replace(/^#/,"");return l.length===8&&(l=l.substring(2)),l};this.shapes.forEach(i=>{let l=r++,h=i.from,m=i.to,c=`<xdr:from><xdr:col>${h.col}</xdr:col><xdr:colOff>${h.colOff??0}</xdr:colOff><xdr:row>${h.row}</xdr:row><xdr:rowOff>${h.rowOff??0}</xdr:rowOff></xdr:from>`,d=`<xdr:to><xdr:col>${m.col}</xdr:col><xdr:colOff>${m.colOff??0}</xdr:colOff><xdr:row>${m.row}</xdr:row><xdr:rowOff>${m.rowOff??0}</xdr:rowOff></xdr:to>`,f=i.fillColor?`<a:solidFill><a:srgbClr val="${a(i.fillColor)}"/></a:solidFill>`:"<a:noFill/>",p=i.lineColor?`<a:ln${i.lineWidth?` w="${i.lineWidth*12700}"`:""}><a:solidFill><a:srgbClr val="${a(i.lineColor)}"/></a:solidFill></a:ln>`:"",g=i.rotation?` rot="${i.rotation*6e4}"`:"",u=i.text?`<xdr:txBody><a:bodyPr vertOverflow="clip" wrap="square" rtlCol="0" anchor="ctr"/><a:lstStyle/><a:p><a:pPr algn="ctr"/><a:r><a:rPr lang="en-US"${i.font?.bold?' b="1"':""}${i.font?.size?` sz="${i.font.size*100}"`:""}/><a:t>${I(i.text)}</a:t></a:r></a:p></xdr:txBody>`:"";n.push(`<xdr:twoCellAnchor editAs="oneCell">${c}${d}<xdr:sp><xdr:nvSpPr><xdr:cNvPr id="${l}" name="Shape ${l}"/><xdr:cNvSpPr/></xdr:nvSpPr><xdr:spPr><a:xfrm${g}><a:off x="0" y="0"/><a:ext cx="0" cy="0"/></a:xfrm><a:prstGeom prst="${i.type}"><a:avLst/></a:prstGeom>${f}${p}</xdr:spPr>${u}</xdr:sp><xdr:clientData/></xdr:twoCellAnchor>`)}),this.wordArt.forEach(i=>{let l=r++,h=i.from,m=i.to,c=`<xdr:from><xdr:col>${h.col}</xdr:col><xdr:colOff>${h.colOff??0}</xdr:colOff><xdr:row>${h.row}</xdr:row><xdr:rowOff>${h.rowOff??0}</xdr:rowOff></xdr:from>`,d=`<xdr:to><xdr:col>${m.col}</xdr:col><xdr:colOff>${m.colOff??0}</xdr:colOff><xdr:row>${m.row}</xdr:row><xdr:rowOff>${m.rowOff??0}</xdr:rowOff></xdr:to>`,f=i.preset??"textPlain",p=i.font?.size?i.font.size*100:3600,g=i.fillColor?a(i.fillColor):"",u=i.outlineColor?a(i.outlineColor):"",$=g?`<a:solidFill><a:srgbClr val="${g}"/></a:solidFill>`:'<a:solidFill><a:schemeClr val="tx1"/></a:solidFill>',x=u?`<a:ln w="12700"><a:solidFill><a:srgbClr val="${u}"/></a:solidFill><a:prstDash val="solid"/></a:ln>`:"",b='<a:effectLst><a:outerShdw dist="38100" dir="2700000" algn="bl" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="40000"/></a:srgbClr></a:outerShdw></a:effectLst>',C=['lang="en-US"',`sz="${p}"`,(i.font?.bold,'b="1"'),i.font?.italic?'i="1"':"",'cap="none" spc="0"'].filter(Boolean).join(" "),y=i.font?.name??"Calibri",v=f!=="textPlain"?`<a:prstTxWarp prst="${f}"><a:avLst/></a:prstTxWarp>`:"";n.push(`<xdr:twoCellAnchor editAs="oneCell">${c}${d}<xdr:sp macro="" textlink=""><xdr:nvSpPr><xdr:cNvPr id="${l}" name="WordArt ${l}"/><xdr:cNvSpPr/></xdr:nvSpPr><xdr:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom><a:noFill/></xdr:spPr><xdr:txBody><a:bodyPr wrap="square" lIns="91440" tIns="45720" rIns="91440" bIns="45720">${v}<a:spAutoFit/></a:bodyPr><a:lstStyle/><a:p><a:pPr algn="ctr"/><a:r><a:rPr ${C}>${x}${$}${b}<a:latin typeface="${I(y)}"/></a:rPr><a:t>${I(i.text)}</a:t></a:r></a:p></xdr:txBody></xdr:sp><xdr:clientData/></xdr:twoCellAnchor>`)}),this.mathEquations.forEach(i=>{let l=r++,h=i.from,m=`<xdr:from><xdr:col>${h.col}</xdr:col><xdr:colOff>${h.colOff??0}</xdr:colOff><xdr:row>${h.row}</xdr:row><xdr:rowOff>${h.rowOff??0}</xdr:rowOff></xdr:from>`,c=i.width??18e5,d=i.height??5e5,f=`<xdr:ext cx="${c}" cy="${d}"/>`,p=i.fontSize?i.fontSize*100:1100,g=i.fontName??"Cambria Math",u=`<a:rPr lang="en-US" sz="${p}" i="1"><a:latin typeface="${I(g)}" panose="02040503050406030204" pitchFamily="18" charset="0"/></a:rPr>`,$=`<m:ctrlPr>${u}</m:ctrlPr>`,x=w=>{switch(w.type){case"text":return`<m:r>${u}<m:t>${I(w.text??"")}</m:t></m:r>`;case"frac":return`<m:f><m:fPr>${w.hideDegree?'<m:type m:val="noBar"/>':""}${$}</m:fPr><m:num>${(w.base??[]).map(x).join("")}</m:num><m:den>${(w.argument??[]).map(x).join("")}</m:den></m:f>`;case"sup":return`<m:sSup><m:sSupPr>${$}</m:sSupPr><m:e>${(w.base??[]).map(x).join("")}</m:e><m:sup>${(w.argument??[]).map(x).join("")}</m:sup></m:sSup>`;case"sub":return`<m:sSub><m:sSubPr>${$}</m:sSubPr><m:e>${(w.base??[]).map(x).join("")}</m:e><m:sub>${(w.argument??[]).map(x).join("")}</m:sub></m:sSub>`;case"subSup":return`<m:sSubSup><m:sSubSupPr>${$}</m:sSubSupPr><m:e>${(w.base??[]).map(x).join("")}</m:e><m:sub>${(w.subscript??[]).map(x).join("")}</m:sub><m:sup>${(w.superscript??[]).map(x).join("")}</m:sup></m:sSubSup>`;case"nary":{let k=w.operator??"\u2211";return`<m:nary><m:naryPr><m:chr m:val="${I(k)}"/>${$}</m:naryPr><m:sub>${(w.lower??[]).map(x).join("")}</m:sub><m:sup>${(w.upper??[]).map(x).join("")}</m:sup><m:e>${(w.body??[]).map(x).join("")}</m:e></m:nary>`}case"rad":return`<m:rad><m:radPr>${w.hideDegree?'<m:degHide m:val="1"/>':""}${$}</m:radPr><m:deg>${(w.degree??[]).map(x).join("")}</m:deg><m:e>${(w.body??[]).map(x).join("")}</m:e></m:rad>`;case"delim":{let k=w.open??"(",T=w.close??")";return`<m:d><m:dPr>${k!=="("?`<m:begChr m:val="${I(k)}"/>`:""}${T!==")"?`<m:endChr m:val="${I(T)}"/>`:""}${$}</m:dPr><m:e>${(w.body??[]).map(x).join("")}</m:e></m:d>`}case"func":return`<m:func><m:funcPr>${$}</m:funcPr><m:fName>${(w.base??[]).map(x).join("")}</m:fName><m:e>${(w.argument??[]).map(x).join("")}</m:e></m:func>`;case"accent":return`<m:acc><m:accPr>${w.operator?`<m:chr m:val="${I(w.operator)}"/>`:""}${$}</m:accPr><m:e>${(w.body??[]).map(x).join("")}</m:e></m:acc>`;case"bar":return`<m:bar><m:barPr>${$}</m:barPr><m:e>${(w.body??[]).map(x).join("")}</m:e></m:bar>`;case"matrix":return`<m:m><m:mPr>${$}</m:mPr>${(w.rows??[]).map(k=>`<m:mr>${k.map(T=>`<m:e>${x(T)}</m:e>`).join("")}</m:mr>`).join("")}</m:m>`;case"eqArr":return`<m:eqArr><m:eqArrPr>${$}</m:eqArrPr>${(w.rows??[]).map(k=>`<m:e>${k.map(x).join("")}</m:e>`).join("")}</m:eqArr>`;case"limLow":return`<m:limLow><m:limLowPr>${$}</m:limLowPr><m:e>${(w.base??[]).map(x).join("")}</m:e><m:lim>${(w.argument??[]).map(x).join("")}</m:lim></m:limLow>`;case"limUpp":return`<m:limUpp><m:limUppPr>${$}</m:limUppPr><m:e>${(w.base??[]).map(x).join("")}</m:e><m:lim>${(w.argument??[]).map(x).join("")}</m:lim></m:limUpp>`;case"groupChar":return`<m:groupChr><m:groupChrPr>${w.operator?`<m:chr m:val="${I(w.operator)}"/>`:""}${$}</m:groupChrPr><m:e>${(w.body??[]).map(x).join("")}</m:e></m:groupChr>`;default:return`<m:r>${u}<m:t>${I(w.text??"")}</m:t></m:r>`}},C=`<m:oMathPara xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"><m:oMathParaPr><m:jc m:val="centerGroup"/></m:oMathParaPr><m:oMath xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math">${i.elements.map(x).join("")}</m:oMath></m:oMathPara>`,y=w=>{if(w.text)return w.text;let k=[w.base,w.argument,w.body,w.lower,w.upper,w.superscript,w.subscript,w.degree].filter(Boolean).map(T=>T.map(y).join("")).join("");return w.type==="frac"?`(${(w.base??[]).map(y).join("")})/(${(w.argument??[]).map(y).join("")})`:w.type==="sup"?`${(w.base??[]).map(y).join("")}^${(w.argument??[]).map(y).join("")}`:w.type==="nary"?`${w.operator??"\u2211"}(${(w.body??[]).map(y).join("")})`:w.type==="delim"?`${w.open??"("}${(w.body??[]).map(y).join("")}${w.close??")"}`:w.type==="rad"?`\u221A(${(w.body??[]).map(y).join("")})`:k},v=i.elements.map(y).join("");n.push(`<xdr:oneCellAnchor>${m}${f}<mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"><mc:Choice xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" Requires="a14"><xdr:sp macro="" textlink=""><xdr:nvSpPr><xdr:cNvPr id="${l}" name="MathEq ${l}"/><xdr:cNvSpPr txBox="1"/></xdr:nvSpPr><xdr:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${c}" cy="${d}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom><a:noFill/></xdr:spPr><xdr:txBody><a:bodyPr vertOverflow="clip" horzOverflow="clip" wrap="none" lIns="0" tIns="0" rIns="0" bIns="0" rtlCol="0" anchor="t"><a:spAutoFit/></a:bodyPr><a:lstStyle/><a:p><a14:m>${C}</a14:m><a:endParaRPr lang="en-US" sz="${p}"/></a:p></xdr:txBody></xdr:sp></mc:Choice><mc:Fallback><xdr:sp macro="" textlink=""><xdr:nvSpPr><xdr:cNvPr id="${l}" name="MathEq ${l}"/><xdr:cNvSpPr txBox="1"/></xdr:nvSpPr><xdr:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${c}" cy="${d}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom><a:noFill/></xdr:spPr><xdr:txBody><a:bodyPr vertOverflow="clip" horzOverflow="clip" wrap="none" lIns="0" tIns="0" rIns="0" bIns="0" rtlCol="0" anchor="t"><a:spAutoFit/></a:bodyPr><a:lstStyle/><a:p><a:r><a:rPr lang="en-US" sz="${p}" i="0"><a:latin typeface="${I(g)}" panose="02040503050406030204" pitchFamily="18" charset="0"/></a:rPr><a:t>${I(v)}</a:t></a:r><a:endParaRPr lang="en-US" sz="${p}"/></a:p></xdr:txBody></xdr:sp></mc:Fallback></mc:AlternateContent><xdr:clientData/></xdr:oneCellAnchor>`)}),this.oleObjects.forEach((i,l)=>{let h=r++,m=i.from,c=i.to,d=`<xdr:from><xdr:col>${m.col}</xdr:col><xdr:colOff>${m.colOff??0}</xdr:colOff><xdr:row>${m.row}</xdr:row><xdr:rowOff>${m.rowOff??0}</xdr:rowOff></xdr:from>`,f=`<xdr:to><xdr:col>${c.col}</xdr:col><xdr:colOff>${c.colOff??0}</xdr:colOff><xdr:row>${c.row}</xdr:row><xdr:rowOff>${c.rowOff??0}</xdr:rowOff></xdr:to>`,p=this.oleRIds[l]??"",g=this.oleIconRIds[l]??"",u=i.progId??"Package",$=i.displayAsIcon?' showAsIcon="1"':"",x=i.linkToFile&&i.linkPath?` link="${I(i.linkPath)}"`:"",b=g?`<a:blip r:embed="${g}"/><a:stretch><a:fillRect/></a:stretch>`:"<a:blip/><a:stretch><a:fillRect/></a:stretch>";n.push(`<xdr:twoCellAnchor editAs="oneCell">${d}${f}<xdr:sp macro=""><xdr:nvSpPr><xdr:cNvPr id="${h}" name="${I(i.name)}" hidden="1"/><xdr:cNvSpPr/></xdr:nvSpPr><xdr:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></xdr:spPr></xdr:sp><xdr:clientData/></xdr:twoCellAnchor>`)});for(let i of this._slicerDrawingInfo){let l=r++,{row:h,col:m}=i.cell?Gt(i.cell):{row:1,col:6},c=m-1,d=h-1,f=c+2,p=d+12;n.push(`<xdr:twoCellAnchor editAs="oneCell"><xdr:from><xdr:col>${c}</xdr:col><xdr:colOff>0</xdr:colOff><xdr:row>${d}</xdr:row><xdr:rowOff>0</xdr:rowOff></xdr:from><xdr:to><xdr:col>${f}</xdr:col><xdr:colOff>0</xdr:colOff><xdr:row>${p}</xdr:row><xdr:rowOff>0</xdr:rowOff></xdr:to><mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"><mc:Choice xmlns:sle15="http://schemas.microsoft.com/office/drawing/2012/slicer" Requires="sle15"><xdr:graphicFrame macro=""><xdr:nvGraphicFramePr><xdr:cNvPr id="${l}" name="${I(i.name)}"/><xdr:cNvGraphicFramePr/></xdr:nvGraphicFramePr><xdr:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/></xdr:xfrm><a:graphic><a:graphicData uri="http://schemas.microsoft.com/office/drawing/2010/slicer"><sle:slicer xmlns:sle="http://schemas.microsoft.com/office/drawing/2010/slicer" name="${I(i.name)}"/></a:graphicData></a:graphic></xdr:graphicFrame></mc:Choice><mc:Fallback/></mc:AlternateContent><xdr:clientData/></xdr:twoCellAnchor>`)}return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
171
+ </a:graphic>`;if(this._isChartSheet)n.push(`<xdr:absoluteAnchor><xdr:pos x="0" y="0"/><xdr:ext cx="9294091" cy="6003636"/><xdr:graphicFrame macro=""><xdr:nvGraphicFramePr><xdr:cNvPr id="${this.images.length+l+2}" name="Chart ${l+1}"/><xdr:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noGrp="1"/></xdr:cNvGraphicFramePr></xdr:nvGraphicFramePr><xdr:xfrm><a:off xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" x="0" y="0"/><a:ext xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" cx="0" cy="0"/></xdr:xfrm>${d}</xdr:graphicFrame><xdr:clientData/></xdr:absoluteAnchor>`);else{let f=`<xdr:from><xdr:col>${m.col}</xdr:col><xdr:colOff>${m.colOff??0}</xdr:colOff><xdr:row>${m.row}</xdr:row><xdr:rowOff>${m.rowOff??0}</xdr:rowOff></xdr:from>`,p=`<xdr:to><xdr:col>${c.col}</xdr:col><xdr:colOff>${c.colOff??0}</xdr:colOff><xdr:row>${c.row}</xdr:row><xdr:rowOff>${c.rowOff??0}</xdr:rowOff></xdr:to>`;n.push(`<xdr:twoCellAnchor editAs="oneCell">${f}${p}<xdr:graphicFrame macro=""><xdr:nvGraphicFramePr><xdr:cNvPr id="${this.images.length+l+2}" name="Chart ${l+1}"/><xdr:cNvGraphicFramePr/></xdr:nvGraphicFramePr><xdr:xfrm><a:off xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" x="0" y="0"/><a:ext xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" cx="0" cy="0"/></xdr:xfrm>${d}</xdr:graphicFrame><xdr:clientData/></xdr:twoCellAnchor>`)}});let r=this.images.length+this.charts.length+2,a=i=>{let l=i.replace(/^#/,"");return l.length===8&&(l=l.substring(2)),l};this.shapes.forEach(i=>{let l=r++,h=i.from,m=i.to,c=`<xdr:from><xdr:col>${h.col}</xdr:col><xdr:colOff>${h.colOff??0}</xdr:colOff><xdr:row>${h.row}</xdr:row><xdr:rowOff>${h.rowOff??0}</xdr:rowOff></xdr:from>`,d=`<xdr:to><xdr:col>${m.col}</xdr:col><xdr:colOff>${m.colOff??0}</xdr:colOff><xdr:row>${m.row}</xdr:row><xdr:rowOff>${m.rowOff??0}</xdr:rowOff></xdr:to>`,f=i.fillColor?`<a:solidFill><a:srgbClr val="${a(i.fillColor)}"/></a:solidFill>`:"<a:noFill/>",p=i.lineColor?`<a:ln${i.lineWidth?` w="${i.lineWidth*12700}"`:""}><a:solidFill><a:srgbClr val="${a(i.lineColor)}"/></a:solidFill></a:ln>`:"",g=i.rotation?` rot="${i.rotation*6e4}"`:"",u=i.text?`<xdr:txBody><a:bodyPr vertOverflow="clip" wrap="square" rtlCol="0" anchor="ctr"/><a:lstStyle/><a:p><a:pPr algn="ctr"/><a:r><a:rPr lang="en-US"${i.font?.bold?' b="1"':""}${i.font?.size?` sz="${i.font.size*100}"`:""}/><a:t>${I(i.text)}</a:t></a:r></a:p></xdr:txBody>`:"";n.push(`<xdr:twoCellAnchor editAs="oneCell">${c}${d}<xdr:sp><xdr:nvSpPr><xdr:cNvPr id="${l}" name="Shape ${l}"/><xdr:cNvSpPr/></xdr:nvSpPr><xdr:spPr><a:xfrm${g}><a:off x="0" y="0"/><a:ext cx="0" cy="0"/></a:xfrm><a:prstGeom prst="${i.type}"><a:avLst/></a:prstGeom>${f}${p}</xdr:spPr>${u}</xdr:sp><xdr:clientData/></xdr:twoCellAnchor>`)}),this.wordArt.forEach(i=>{let l=r++,h=i.from,m=i.to,c=`<xdr:from><xdr:col>${h.col}</xdr:col><xdr:colOff>${h.colOff??0}</xdr:colOff><xdr:row>${h.row}</xdr:row><xdr:rowOff>${h.rowOff??0}</xdr:rowOff></xdr:from>`,d=`<xdr:to><xdr:col>${m.col}</xdr:col><xdr:colOff>${m.colOff??0}</xdr:colOff><xdr:row>${m.row}</xdr:row><xdr:rowOff>${m.rowOff??0}</xdr:rowOff></xdr:to>`,f=i.preset??"textPlain",p=i.font?.size?i.font.size*100:3600,g=i.fillColor?a(i.fillColor):"",u=i.outlineColor?a(i.outlineColor):"",$=g?`<a:solidFill><a:srgbClr val="${g}"/></a:solidFill>`:'<a:solidFill><a:schemeClr val="tx1"/></a:solidFill>',x=u?`<a:ln w="12700"><a:solidFill><a:srgbClr val="${u}"/></a:solidFill><a:prstDash val="solid"/></a:ln>`:"",b='<a:effectLst><a:outerShdw dist="38100" dir="2700000" algn="bl" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="40000"/></a:srgbClr></a:outerShdw></a:effectLst>',C=['lang="en-US"',`sz="${p}"`,(i.font?.bold,'b="1"'),i.font?.italic?'i="1"':"",'cap="none" spc="0"'].filter(Boolean).join(" "),y=i.font?.name??"Calibri",v=f!=="textPlain"?`<a:prstTxWarp prst="${f}"><a:avLst/></a:prstTxWarp>`:"";n.push(`<xdr:twoCellAnchor editAs="oneCell">${c}${d}<xdr:sp macro="" textlink=""><xdr:nvSpPr><xdr:cNvPr id="${l}" name="WordArt ${l}"/><xdr:cNvSpPr/></xdr:nvSpPr><xdr:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom><a:noFill/></xdr:spPr><xdr:txBody><a:bodyPr wrap="square" lIns="91440" tIns="45720" rIns="91440" bIns="45720">${v}<a:spAutoFit/></a:bodyPr><a:lstStyle/><a:p><a:pPr algn="ctr"/><a:r><a:rPr ${C}>${x}${$}${b}<a:latin typeface="${I(y)}"/></a:rPr><a:t>${I(i.text)}</a:t></a:r></a:p></xdr:txBody></xdr:sp><xdr:clientData/></xdr:twoCellAnchor>`)}),this.mathEquations.forEach(i=>{let l=r++,h=i.from,m=`<xdr:from><xdr:col>${h.col}</xdr:col><xdr:colOff>${h.colOff??0}</xdr:colOff><xdr:row>${h.row}</xdr:row><xdr:rowOff>${h.rowOff??0}</xdr:rowOff></xdr:from>`,c=i.width??18e5,d=i.height??5e5,f=`<xdr:ext cx="${c}" cy="${d}"/>`,p=i.fontSize?i.fontSize*100:1100,g=i.fontName??"Cambria Math",u=`<a:rPr lang="en-US" sz="${p}" i="1"><a:latin typeface="${I(g)}" panose="02040503050406030204" pitchFamily="18" charset="0"/></a:rPr>`,$=`<m:ctrlPr>${u}</m:ctrlPr>`,x=w=>{switch(w.type){case"text":return`<m:r>${u}<m:t>${I(w.text??"")}</m:t></m:r>`;case"frac":return`<m:f><m:fPr>${w.hideDegree?'<m:type m:val="noBar"/>':""}${$}</m:fPr><m:num>${(w.base??[]).map(x).join("")}</m:num><m:den>${(w.argument??[]).map(x).join("")}</m:den></m:f>`;case"sup":return`<m:sSup><m:sSupPr>${$}</m:sSupPr><m:e>${(w.base??[]).map(x).join("")}</m:e><m:sup>${(w.argument??[]).map(x).join("")}</m:sup></m:sSup>`;case"sub":return`<m:sSub><m:sSubPr>${$}</m:sSubPr><m:e>${(w.base??[]).map(x).join("")}</m:e><m:sub>${(w.argument??[]).map(x).join("")}</m:sub></m:sSub>`;case"subSup":return`<m:sSubSup><m:sSubSupPr>${$}</m:sSubSupPr><m:e>${(w.base??[]).map(x).join("")}</m:e><m:sub>${(w.subscript??[]).map(x).join("")}</m:sub><m:sup>${(w.superscript??[]).map(x).join("")}</m:sup></m:sSubSup>`;case"nary":{let k=w.operator??"\u2211";return`<m:nary><m:naryPr><m:chr m:val="${I(k)}"/>${$}</m:naryPr><m:sub>${(w.lower??[]).map(x).join("")}</m:sub><m:sup>${(w.upper??[]).map(x).join("")}</m:sup><m:e>${(w.body??[]).map(x).join("")}</m:e></m:nary>`}case"rad":return`<m:rad><m:radPr>${w.hideDegree?'<m:degHide m:val="1"/>':""}${$}</m:radPr><m:deg>${(w.degree??[]).map(x).join("")}</m:deg><m:e>${(w.body??[]).map(x).join("")}</m:e></m:rad>`;case"delim":{let k=w.open??"(",T=w.close??")";return`<m:d><m:dPr>${k!=="("?`<m:begChr m:val="${I(k)}"/>`:""}${T!==")"?`<m:endChr m:val="${I(T)}"/>`:""}${$}</m:dPr><m:e>${(w.body??[]).map(x).join("")}</m:e></m:d>`}case"func":return`<m:func><m:funcPr>${$}</m:funcPr><m:fName>${(w.base??[]).map(x).join("")}</m:fName><m:e>${(w.argument??[]).map(x).join("")}</m:e></m:func>`;case"accent":return`<m:acc><m:accPr>${w.operator?`<m:chr m:val="${I(w.operator)}"/>`:""}${$}</m:accPr><m:e>${(w.body??[]).map(x).join("")}</m:e></m:acc>`;case"bar":return`<m:bar><m:barPr>${$}</m:barPr><m:e>${(w.body??[]).map(x).join("")}</m:e></m:bar>`;case"matrix":return`<m:m><m:mPr>${$}</m:mPr>${(w.rows??[]).map(k=>`<m:mr>${k.map(T=>`<m:e>${x(T)}</m:e>`).join("")}</m:mr>`).join("")}</m:m>`;case"eqArr":return`<m:eqArr><m:eqArrPr>${$}</m:eqArrPr>${(w.rows??[]).map(k=>`<m:e>${k.map(x).join("")}</m:e>`).join("")}</m:eqArr>`;case"limLow":return`<m:limLow><m:limLowPr>${$}</m:limLowPr><m:e>${(w.base??[]).map(x).join("")}</m:e><m:lim>${(w.argument??[]).map(x).join("")}</m:lim></m:limLow>`;case"limUpp":return`<m:limUpp><m:limUppPr>${$}</m:limUppPr><m:e>${(w.base??[]).map(x).join("")}</m:e><m:lim>${(w.argument??[]).map(x).join("")}</m:lim></m:limUpp>`;case"groupChar":return`<m:groupChr><m:groupChrPr>${w.operator?`<m:chr m:val="${I(w.operator)}"/>`:""}${$}</m:groupChrPr><m:e>${(w.body??[]).map(x).join("")}</m:e></m:groupChr>`;default:return`<m:r>${u}<m:t>${I(w.text??"")}</m:t></m:r>`}},C=`<m:oMathPara xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"><m:oMathParaPr><m:jc m:val="centerGroup"/></m:oMathParaPr><m:oMath xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math">${i.elements.map(x).join("")}</m:oMath></m:oMathPara>`,y=w=>{if(w.text)return w.text;let k=[w.base,w.argument,w.body,w.lower,w.upper,w.superscript,w.subscript,w.degree].filter(Boolean).map(T=>T.map(y).join("")).join("");return w.type==="frac"?`(${(w.base??[]).map(y).join("")})/(${(w.argument??[]).map(y).join("")})`:w.type==="sup"?`${(w.base??[]).map(y).join("")}^${(w.argument??[]).map(y).join("")}`:w.type==="nary"?`${w.operator??"\u2211"}(${(w.body??[]).map(y).join("")})`:w.type==="delim"?`${w.open??"("}${(w.body??[]).map(y).join("")}${w.close??")"}`:w.type==="rad"?`\u221A(${(w.body??[]).map(y).join("")})`:k},v=i.elements.map(y).join("");n.push(`<xdr:oneCellAnchor>${m}${f}<mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"><mc:Choice xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" Requires="a14"><xdr:sp macro="" textlink=""><xdr:nvSpPr><xdr:cNvPr id="${l}" name="MathEq ${l}"/><xdr:cNvSpPr txBox="1"/></xdr:nvSpPr><xdr:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${c}" cy="${d}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom><a:noFill/></xdr:spPr><xdr:txBody><a:bodyPr vertOverflow="clip" horzOverflow="clip" wrap="none" lIns="0" tIns="0" rIns="0" bIns="0" rtlCol="0" anchor="t"><a:spAutoFit/></a:bodyPr><a:lstStyle/><a:p><a14:m>${C}</a14:m><a:endParaRPr lang="en-US" sz="${p}"/></a:p></xdr:txBody></xdr:sp></mc:Choice><mc:Fallback><xdr:sp macro="" textlink=""><xdr:nvSpPr><xdr:cNvPr id="${l}" name="MathEq ${l}"/><xdr:cNvSpPr txBox="1"/></xdr:nvSpPr><xdr:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${c}" cy="${d}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom><a:noFill/></xdr:spPr><xdr:txBody><a:bodyPr vertOverflow="clip" horzOverflow="clip" wrap="none" lIns="0" tIns="0" rIns="0" bIns="0" rtlCol="0" anchor="t"><a:spAutoFit/></a:bodyPr><a:lstStyle/><a:p><a:r><a:rPr lang="en-US" sz="${p}" i="0"><a:latin typeface="${I(g)}" panose="02040503050406030204" pitchFamily="18" charset="0"/></a:rPr><a:t>${I(v)}</a:t></a:r><a:endParaRPr lang="en-US" sz="${p}"/></a:p></xdr:txBody></xdr:sp></mc:Fallback></mc:AlternateContent><xdr:clientData/></xdr:oneCellAnchor>`)}),this.oleObjects.forEach((i,l)=>{let h=r++,m=i.from,c=i.to,d=`<xdr:from><xdr:col>${m.col}</xdr:col><xdr:colOff>${m.colOff??0}</xdr:colOff><xdr:row>${m.row}</xdr:row><xdr:rowOff>${m.rowOff??0}</xdr:rowOff></xdr:from>`,f=`<xdr:to><xdr:col>${c.col}</xdr:col><xdr:colOff>${c.colOff??0}</xdr:colOff><xdr:row>${c.row}</xdr:row><xdr:rowOff>${c.rowOff??0}</xdr:rowOff></xdr:to>`,p=this.oleRIds[l]??"",g=this.oleIconRIds[l]??"",u=i.progId??"Package",$=i.displayAsIcon?' showAsIcon="1"':"",x=i.linkToFile&&i.linkPath?` link="${I(i.linkPath)}"`:"",b=g?`<a:blip r:embed="${g}"/><a:stretch><a:fillRect/></a:stretch>`:"<a:blip/><a:stretch><a:fillRect/></a:stretch>";n.push(`<xdr:twoCellAnchor editAs="oneCell">${d}${f}<xdr:sp macro=""><xdr:nvSpPr><xdr:cNvPr id="${h}" name="${I(i.name)}" hidden="1"/><xdr:cNvSpPr/></xdr:nvSpPr><xdr:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></xdr:spPr></xdr:sp><xdr:clientData/></xdr:twoCellAnchor>`)});for(let i of this._slicerDrawingInfo){let l=r++,{row:h,col:m}=i.cell?qt(i.cell):{row:1,col:6},c=m-1,d=h-1,f=c+2,p=d+12;n.push(`<xdr:twoCellAnchor editAs="oneCell"><xdr:from><xdr:col>${c}</xdr:col><xdr:colOff>0</xdr:colOff><xdr:row>${d}</xdr:row><xdr:rowOff>0</xdr:rowOff></xdr:from><xdr:to><xdr:col>${f}</xdr:col><xdr:colOff>0</xdr:colOff><xdr:row>${p}</xdr:row><xdr:rowOff>0</xdr:rowOff></xdr:to><mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"><mc:Choice xmlns:sle15="http://schemas.microsoft.com/office/drawing/2012/slicer" Requires="sle15"><xdr:graphicFrame macro=""><xdr:nvGraphicFramePr><xdr:cNvPr id="${l}" name="${I(i.name)}"/><xdr:cNvGraphicFramePr/></xdr:nvGraphicFramePr><xdr:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/></xdr:xfrm><a:graphic><a:graphicData uri="http://schemas.microsoft.com/office/drawing/2010/slicer"><sle:slicer xmlns:sle="http://schemas.microsoft.com/office/drawing/2010/slicer" name="${I(i.name)}"/></a:graphicData></a:graphic></xdr:graphicFrame></mc:Choice><mc:Fallback/></mc:AlternateContent><xdr:clientData/></xdr:twoCellAnchor>`)}return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
71
172
  <xdr:wsDr xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"
72
173
  xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
73
174
  xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
74
175
  ${n.join(`
75
176
  `)}
76
- </xdr:wsDr>`}};function Ns(e){let t=0;for(let o=e.length-1;o>=0;o--)t=t>>14&1|t<<1&32767,t^=e.charCodeAt(o);return t=t>>14&1|t<<1&32767,t^=e.length,t^=52811,t.toString(16).toUpperCase().padStart(4,"0")}function to(e,t){if(!t)return"";if(t.startsWith("theme:")){let n=t.slice(6),s=n.indexOf(":tint:");if(s>=0){let r=n.slice(0,s),a=n.slice(s+6);return`<${e} theme="${r}" tint="${a}"/>`}return`<${e} theme="${n}"/>`}let o=t.startsWith("#")?"FF"+t.slice(1):t;return`<${e} rgb="${o}"/>`}function No(e){let t=[];return e.bold&&t.push("<b/>"),e.italic&&t.push("<i/>"),e.strike&&t.push("<strike/>"),e.underline&&e.underline!=="none"&&t.push(`<u val="${e.underline}"/>`),e.vertAlign&&t.push(`<vertAlign val="${e.vertAlign}"/>`),e.size&&t.push(`<sz val="${e.size}"/>`),e.color&&t.push(to("color",e.color)),e.name&&t.push(`<name val="${I(e.name)}"/>`),e.family&&t.push(`<family val="${e.family}"/>`),e.scheme&&t.push(`<scheme val="${e.scheme}"/>`),e.charset&&t.push(`<charset val="${e.charset}"/>`),t.join("")}function uo(e){if(e.type==="pattern"){let s=e,r=to("fgColor",s.fgColor),a=to("bgColor",s.bgColor);return`<patternFill${s.pattern?` patternType="${s.pattern}"`:""}>${r}${a}</patternFill>`}let t=e,o=t.stops.map(s=>`<stop position="${s.position}">${to("color",s.color)}</stop>`).join("");return`<gradientFill ${[t.gradientType?`type="${t.gradientType}"`:"",t.degree!==void 0?`degree="${t.degree}"`:"",t.left!==void 0?`left="${t.left}"`:"",t.right!==void 0?`right="${t.right}"`:"",t.top!==void 0?`top="${t.top}"`:"",t.bottom!==void 0?`bottom="${t.bottom}"`:""].filter(Boolean).join(" ")}>${o}</gradientFill>`}function Je(e,t){if(!t)return`<${e}/>`;let o=to("color",t.color);return t.style?`<${e} style="${t.style}">${o}</${e}>`:`<${e}/>`}function Xo(e){let t=[e.diagonalUp?'diagonalUp="1"':"",e.diagonalDown?'diagonalDown="1"':""].filter(Boolean).join(" ");return`<border${t?" "+t:""}>`+Je("left",e.left)+Je("right",e.right)+Je("top",e.top)+Je("bottom",e.bottom)+Je("diagonal",e.diagonal)+"</border>"}function $n(e){return`<alignment ${[e.horizontal?`horizontal="${e.horizontal}"`:"",e.vertical?`vertical="${e.vertical}"`:"",e.wrapText?'wrapText="1"':"",e.shrinkToFit?'shrinkToFit="1"':"",e.textRotation!==void 0?`textRotation="${e.textRotation}"`:"",e.indent?`indent="${e.indent}"`:"",e.readingOrder!==void 0?`readingOrder="${e.readingOrder}"`:""].filter(Boolean).join(" ")}/>`}var Oe=class{constructor(){this.fonts=[],this.fills=[],this.borders=[],this.fontIdx=new Map,this.fillIdx=new Map,this.borderIdx=new Map,this.numFmts=new Map,this.xfs=[],this.styleKey=new Map,this.dxfs=[],this.nextNumFmtId=164,this.cellStyleXfs=[],this.cellStyleNames=[],this.tableStyleDefs=[];let t=No({name:"Calibri",size:11,scheme:"minor"});this.fonts.push(t),this.fontIdx.set(t,0);let o=uo({type:"pattern",pattern:"none"}),n=uo({type:"pattern",pattern:"gray125"});this.fills.push(o,n),this.fillIdx.set(o,0),this.fillIdx.set(n,1);let s=Xo({});this.borders.push(s),this.borderIdx.set(s,0),this.cellStyleXfs.push('<xf numFmtId="0" fontId="0" fillId="0" borderId="0"/>'),this.cellStyleNames.push({name:"Normal",xfId:0,builtinId:0}),this.xfs.push('<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>')}registerNamedStyle(t,o,n){let s=this.internFont(o.font),r=this.internFill(o.fill),a=this.internBorder(o.border),i=this.internNumFmt(o.numberFormat,o.numFmtId),l=o.font?' applyFont="1"':"",h=o.fill?' applyFill="1"':"",m=o.border?' applyBorder="1"':"",c=o.alignment?' applyAlignment="1"':"",d=o.numberFormat||o.numFmtId!==void 0?' applyNumberFormat="1"':"",f=o.alignment?$n(o.alignment):"",p=`<xf numFmtId="${i}" fontId="${s}" fillId="${r}" borderId="${a}"${l}${h}${m}${c}${d}>${f}</xf>`;this.cellStyleXfs.push(p);let g=this.cellStyleXfs.length-1;return this.cellStyleNames.push({name:t,xfId:g,builtinId:n}),g}internFont(t){if(!t)return 0;let o=No(t),n=this.fontIdx.get(o);if(n!==void 0)return n;let s=this.fonts.length;return this.fonts.push(o),this.fontIdx.set(o,s),s}internFill(t){if(!t)return 0;let o=uo(t),n=this.fillIdx.get(o);if(n!==void 0)return n;let s=this.fills.length;return this.fills.push(o),this.fillIdx.set(o,s),s}internBorder(t){if(!t)return 0;let o=Xo(t),n=this.borderIdx.get(o);if(n!==void 0)return n;let s=this.borders.length;return this.borders.push(o),this.borderIdx.set(o,s),s}internNumFmt(t,o){if(o!==void 0)return o;if(!t)return 0;if(this.numFmts.has(t.formatCode))return this.numFmts.get(t.formatCode);let n=this.nextNumFmtId++;return this.numFmts.set(t.formatCode,n),n}register(t){if(!t)return 0;let o=JSON.stringify(t);if(this.styleKey.has(o))return this.styleKey.get(o);let n=this.internFont(t.font),s=this.internFill(t.fill),r=this.internBorder(t.border),a=this.internNumFmt(t.numberFormat,t.numFmtId),i=t.font?' applyFont="1"':"",l=t.fill?' applyFill="1"':"",h=t.border?' applyBorder="1"':"",m=t.alignment?' applyAlignment="1"':"",c=t.numberFormat||t.numFmtId!==void 0?' applyNumberFormat="1"':"",d=t.locked!==void 0||t.hidden!==void 0?' applyProtection="1"':"",f=t.alignment?$n(t.alignment):"",p=t.locked!==void 0||t.hidden!==void 0?`<protection${t.locked!==void 0?` locked="${t.locked?"1":"0"}"`:""}${t.hidden!==void 0?` hidden="${t.hidden?"1":"0"}"`:""}/>`:"",g=t.namedStyleId??0,u=`<xf numFmtId="${a}" fontId="${n}" fillId="${s}" borderId="${r}" xfId="${g}"${i}${l}${h}${m}${c}${d}>${f}${p}</xf>`;this.xfs.push(u);let $=this.xfs.length-1;return this.styleKey.set(o,$),$}registerDxf(t){let o=[];if(t.font&&o.push(`<font>${No(t.font)}</font>`),t.numberFormat){let s=this.internNumFmt(t.numberFormat);o.push(`<numFmt numFmtId="${s}" formatCode="${I(t.numberFormat.formatCode)}"/>`)}t.fill&&o.push(`<fill>${uo(t.fill)}</fill>`),t.alignment&&o.push(`<alignment${t.alignment.horizontal?` horizontal="${t.alignment.horizontal}"`:""}${t.alignment.vertical?` vertical="${t.alignment.vertical}"`:""}${t.alignment.wrapText?' wrapText="1"':""}${t.alignment.textRotation?` textRotation="${t.alignment.textRotation}"`:""}/>`),t.border&&o.push(Xo(t.border));let n=o.join("");return this.dxfs.push(n),this.dxfs.length-1}prependRawDxfs(t){this.dxfs.unshift(...t)}registerTableStyle(t,o){let n=[];o.headerRow&&n.push({type:"headerRow",dxfId:this.registerDxf(o.headerRow)}),o.totalRow&&n.push({type:"totalRow",dxfId:this.registerDxf(o.totalRow)}),o.dataRow1&&n.push({type:"firstRowStripe",dxfId:this.registerDxf(o.dataRow1)}),o.dataRow2&&n.push({type:"secondRowStripe",dxfId:this.registerDxf(o.dataRow2)}),this.tableStyleDefs.push({name:t,elements:n})}toXml(){return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
177
+ </xdr:wsDr>`}};function ir(e){let t=0;for(let o=e.length-1;o>=0;o--)t=t>>14&1|t<<1&32767,t^=e.charCodeAt(o);return t=t>>14&1|t<<1&32767,t^=e.length,t^=52811,t.toString(16).toUpperCase().padStart(4,"0")}Wt();function oo(e,t){if(!t)return"";if(t.startsWith("theme:")){let n=t.slice(6),s=n.indexOf(":tint:");if(s>=0){let r=n.slice(0,s),a=n.slice(s+6);return`<${e} theme="${r}" tint="${a}"/>`}return`<${e} theme="${n}"/>`}let o=t.startsWith("#")?"FF"+t.slice(1):t;return`<${e} rgb="${o}"/>`}function Wo(e){let t=[];return e.bold&&t.push("<b/>"),e.italic&&t.push("<i/>"),e.strike&&t.push("<strike/>"),e.underline&&e.underline!=="none"&&t.push(`<u val="${e.underline}"/>`),e.vertAlign&&t.push(`<vertAlign val="${e.vertAlign}"/>`),e.size&&t.push(`<sz val="${e.size}"/>`),e.color&&t.push(oo("color",e.color)),e.name&&t.push(`<name val="${I(e.name)}"/>`),e.family&&t.push(`<family val="${e.family}"/>`),e.scheme&&t.push(`<scheme val="${e.scheme}"/>`),e.charset&&t.push(`<charset val="${e.charset}"/>`),t.join("")}function xo(e){if(e.type==="pattern"){let s=e,r=oo("fgColor",s.fgColor),a=oo("bgColor",s.bgColor);return`<patternFill${s.pattern?` patternType="${s.pattern}"`:""}>${r}${a}</patternFill>`}let t=e,o=t.stops.map(s=>`<stop position="${s.position}">${oo("color",s.color)}</stop>`).join("");return`<gradientFill ${[t.gradientType?`type="${t.gradientType}"`:"",t.degree!==void 0?`degree="${t.degree}"`:"",t.left!==void 0?`left="${t.left}"`:"",t.right!==void 0?`right="${t.right}"`:"",t.top!==void 0?`top="${t.top}"`:"",t.bottom!==void 0?`bottom="${t.bottom}"`:""].filter(Boolean).join(" ")}>${o}</gradientFill>`}function eo(e,t){if(!t)return`<${e}/>`;let o=oo("color",t.color);return t.style?`<${e} style="${t.style}">${o}</${e}>`:`<${e}/>`}function Ho(e){let t=[e.diagonalUp?'diagonalUp="1"':"",e.diagonalDown?'diagonalDown="1"':""].filter(Boolean).join(" ");return`<border${t?" "+t:""}>`+eo("left",e.left)+eo("right",e.right)+eo("top",e.top)+eo("bottom",e.bottom)+eo("diagonal",e.diagonal)+"</border>"}function An(e){return`<alignment ${[e.horizontal?`horizontal="${e.horizontal}"`:"",e.vertical?`vertical="${e.vertical}"`:"",e.wrapText?'wrapText="1"':"",e.shrinkToFit?'shrinkToFit="1"':"",e.textRotation!==void 0?`textRotation="${e.textRotation}"`:"",e.indent?`indent="${e.indent}"`:"",e.readingOrder!==void 0?`readingOrder="${e.readingOrder}"`:""].filter(Boolean).join(" ")}/>`}var Ne=class{constructor(){this.fonts=[],this.fills=[],this.borders=[],this.fontIdx=new Map,this.fillIdx=new Map,this.borderIdx=new Map,this.numFmts=new Map,this.xfs=[],this.styleKey=new Map,this.dxfs=[],this.nextNumFmtId=164,this.cellStyleXfs=[],this.cellStyleNames=[],this.tableStyleDefs=[];let t=Wo({name:"Calibri",size:11,scheme:"minor"});this.fonts.push(t),this.fontIdx.set(t,0);let o=xo({type:"pattern",pattern:"none"}),n=xo({type:"pattern",pattern:"gray125"});this.fills.push(o,n),this.fillIdx.set(o,0),this.fillIdx.set(n,1);let s=Ho({});this.borders.push(s),this.borderIdx.set(s,0),this.cellStyleXfs.push('<xf numFmtId="0" fontId="0" fillId="0" borderId="0"/>'),this.cellStyleNames.push({name:"Normal",xfId:0,builtinId:0}),this.xfs.push('<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>')}registerNamedStyle(t,o,n){let s=this.internFont(o.font),r=this.internFill(o.fill),a=this.internBorder(o.border),i=this.internNumFmt(o.numberFormat,o.numFmtId),l=o.font?' applyFont="1"':"",h=o.fill?' applyFill="1"':"",m=o.border?' applyBorder="1"':"",c=o.alignment?' applyAlignment="1"':"",d=o.numberFormat||o.numFmtId!==void 0?' applyNumberFormat="1"':"",f=o.alignment?An(o.alignment):"",p=`<xf numFmtId="${i}" fontId="${s}" fillId="${r}" borderId="${a}"${l}${h}${m}${c}${d}>${f}</xf>`;this.cellStyleXfs.push(p);let g=this.cellStyleXfs.length-1;return this.cellStyleNames.push({name:t,xfId:g,builtinId:n}),g}internFont(t){if(!t)return 0;let o=Wo(t),n=this.fontIdx.get(o);if(n!==void 0)return n;let s=this.fonts.length;return this.fonts.push(o),this.fontIdx.set(o,s),s}internFill(t){if(!t)return 0;let o=xo(t),n=this.fillIdx.get(o);if(n!==void 0)return n;let s=this.fills.length;return this.fills.push(o),this.fillIdx.set(o,s),s}internBorder(t){if(!t)return 0;let o=Ho(t),n=this.borderIdx.get(o);if(n!==void 0)return n;let s=this.borders.length;return this.borders.push(o),this.borderIdx.set(o,s),s}internNumFmt(t,o){if(o!==void 0)return o;if(!t)return 0;if(this.numFmts.has(t.formatCode))return this.numFmts.get(t.formatCode);let n=this.nextNumFmtId++;return this.numFmts.set(t.formatCode,n),n}register(t){if(!t)return 0;let o=JSON.stringify(t);if(this.styleKey.has(o))return this.styleKey.get(o);let n=this.internFont(t.font),s=this.internFill(t.fill),r=this.internBorder(t.border),a=this.internNumFmt(t.numberFormat,t.numFmtId),i=t.font?' applyFont="1"':"",l=t.fill?' applyFill="1"':"",h=t.border?' applyBorder="1"':"",m=t.alignment?' applyAlignment="1"':"",c=t.numberFormat||t.numFmtId!==void 0?' applyNumberFormat="1"':"",d=t.locked!==void 0||t.hidden!==void 0?' applyProtection="1"':"",f=t.alignment?An(t.alignment):"",p=t.locked!==void 0||t.hidden!==void 0?`<protection${t.locked!==void 0?` locked="${t.locked?"1":"0"}"`:""}${t.hidden!==void 0?` hidden="${t.hidden?"1":"0"}"`:""}/>`:"",g=t.namedStyleId??0,u=`<xf numFmtId="${a}" fontId="${n}" fillId="${s}" borderId="${r}" xfId="${g}"${i}${l}${h}${m}${c}${d}>${f}${p}</xf>`;this.xfs.push(u);let $=this.xfs.length-1;return this.styleKey.set(o,$),$}registerDxf(t){let o=[];if(t.font&&o.push(`<font>${Wo(t.font)}</font>`),t.numberFormat){let s=this.internNumFmt(t.numberFormat);o.push(`<numFmt numFmtId="${s}" formatCode="${I(t.numberFormat.formatCode)}"/>`)}t.fill&&o.push(`<fill>${xo(t.fill)}</fill>`),t.alignment&&o.push(`<alignment${t.alignment.horizontal?` horizontal="${t.alignment.horizontal}"`:""}${t.alignment.vertical?` vertical="${t.alignment.vertical}"`:""}${t.alignment.wrapText?' wrapText="1"':""}${t.alignment.textRotation?` textRotation="${t.alignment.textRotation}"`:""}/>`),t.border&&o.push(Ho(t.border));let n=o.join("");return this.dxfs.push(n),this.dxfs.length-1}prependRawDxfs(t){this.dxfs.unshift(...t)}registerTableStyle(t,o){let n=[];o.headerRow&&n.push({type:"headerRow",dxfId:this.registerDxf(o.headerRow)}),o.totalRow&&n.push({type:"totalRow",dxfId:this.registerDxf(o.totalRow)}),o.dataRow1&&n.push({type:"firstRowStripe",dxfId:this.registerDxf(o.dataRow1)}),o.dataRow2&&n.push({type:"secondRowStripe",dxfId:this.registerDxf(o.dataRow2)}),this.tableStyleDefs.push({name:t,elements:n})}toXml(){return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
77
178
  <styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
78
179
  ${this.numFmts.size?`<numFmts count="${this.numFmts.size}">${[...this.numFmts.entries()].map(([o,n])=>`<numFmt numFmtId="${n}" formatCode="${I(o)}"/>`).join("")}</numFmts>`:""}
79
180
  <fonts count="${this.fonts.length}">${this.fonts.map(o=>`<font>${o}</font>`).join("")}</fonts>
@@ -84,119 +185,18 @@ ${this.numFmts.size?`<numFmts count="${this.numFmts.size}">${[...this.numFmts.en
84
185
  <cellStyles count="${this.cellStyleNames.length}">${this.cellStyleNames.map(o=>`<cellStyle name="${I(o.name)}" xfId="${o.xfId}"${o.builtinId!==void 0?` builtinId="${o.builtinId}"`:""}/>`).join("")}</cellStyles>
85
186
  ${this.dxfs.length?`<dxfs count="${this.dxfs.length}">${this.dxfs.map(o=>`<dxf>${o}</dxf>`).join("")}</dxfs>`:""}
86
187
  ${this.tableStyleDefs.length?`<tableStyles count="${this.tableStyleDefs.length}">${this.tableStyleDefs.map(o=>`<tableStyle name="${I(o.name)}" count="${o.elements.length}">${o.elements.map(n=>`<tableStyleElement type="${n.type}" dxfId="${n.dxfId}"/>`).join("")}</tableStyle>`).join("")}</tableStyles>`:""}
87
- </styleSheet>`}};var Le=class{constructor(){this.table=new Map,this.strings=[],this._count=0}get count(){return this._count}get uniqueCount(){return this.strings.length}intern(t){this._count++;let o=this.table.get(t);if(o!==void 0)return o;let n=this.strings.length;return this.strings.push(t),this.table.set(t,n),n}internRichText(t){let o=JSON.stringify(t);this._count++;let n=this.table.get(o);if(n!==void 0)return n;let s=t.map(a=>`<r>${a.font?Xs(a.font):""}<t xml:space="preserve">${I(a.text)}</t></r>`).join(""),r=this.strings.length;return this.strings.push("\0RICH\0"+s),this.table.set(o,r),r}toXml(){let t=this.strings.map(o=>o.startsWith("\0RICH\0")?`<si>${o.slice(6)}</si>`:`<si><t${o!==o.trim()||o.includes(`
188
+ </styleSheet>`}};Wt();var Xe=class{constructor(){this.table=new Map,this.strings=[],this._count=0}get count(){return this._count}get uniqueCount(){return this.strings.length}intern(t){this._count++;let o=this.table.get(t);if(o!==void 0)return o;let n=this.strings.length;return this.strings.push(t),this.table.set(t,n),n}internRichText(t){let o=JSON.stringify(t);this._count++;let n=this.table.get(o);if(n!==void 0)return n;let s=t.map(a=>`<r>${a.font?lr(a.font):""}<t xml:space="preserve">${I(a.text)}</t></r>`).join(""),r=this.strings.length;return this.strings.push("\0RICH\0"+s),this.table.set(o,r),r}toXml(){let t=this.strings.map(o=>o.startsWith("\0RICH\0")?`<si>${o.slice(6)}</si>`:`<si><t${o!==o.trim()||o.includes(`
88
189
  `)?' xml:space="preserve"':""}>${I(o)}</t></si>`).join("");return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
89
190
  <sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="${this._count}" uniqueCount="${this.strings.length}">
90
191
  ${t}
91
- </sst>`}};function Xs(e){let t=[];return e.bold&&t.push("<b/>"),e.italic&&t.push("<i/>"),e.strike&&t.push("<strike/>"),e.underline&&e.underline!=="none"&&t.push(`<u val="${e.underline}"/>`),e.size&&t.push(`<sz val="${e.size}"/>`),e.color&&(e.color.startsWith("theme:")?t.push(`<color theme="${e.color.slice(6)}"/>`):t.push(`<color rgb="${e.color.startsWith("#")?"FF"+e.color.slice(1):e.color}"/>`)),e.name&&t.push(`<name val="${I(e.name)}"/>`),t.length?`<rPr>${t.join("")}</rPr>`:""}var yn=["FF4472C4","FFED7D31","FFA5A5A5","FFFFC000","FF5B9BD5","FF70AD47","FF264478","FF9E480E","FF636363","FF997300"],Us={office:["4472C4","ED7D31","A5A5A5","FFC000","5B9BD5","70AD47","264478","9E480E","636363","997300"],blue:["5B9BD5","8FAADC","B4C7E7","D6DCE4","4472C4","2F5597","1F4E79","002060","00B0F0","0070C0"],orange:["ED7D31","F4B183","F8CBAD","FCE4D6","C55A11","843C0C","BF8F00","806000","FFD966","FFC000"],green:["70AD47","A9D18E","C5E0B4","E2F0D9","548235","375623","92D050","00B050","00B0F0","00FF00"],red:["FF0000","FF6161","FF9F9F","FFD2D2","C00000","8B0000","FFC000","FF6600","FF3300","CC0000"],purple:["7030A0","9B59B6","BB8FCE","D7BDE2","5B2C6F","4A235A","8E44AD","6C3483","A569BD","D2B4DE"],teal:["00B0F0","00BCD4","26C6DA","80DEEA","0097A7","006064","009688","00796B","4DB6AC","80CBC4"],gray:["595959","808080","A6A6A6","D9D9D9","404040","262626","BFBFBF","F2F2F2","7F7F7F","C0C0C0"],gold:["FFC000","FFD966","FFE699","FFF2CC","BF8F00","806000","ED7D31","F4B183","DBA13A","C09100"],blueWarm:["4472C4","5B9BD5","9DC3E6","BDD7EE","DEEBF7","2E75B6","1F4E79","2F5597","8FAADC","D6DCE4"],blueGreen:["00B0F0","00B050","70AD47","5B9BD5","4472C4","2E75B6","548235","00B0F0","009688","00796B"],greenYellow:["70AD47","92D050","C9E265","FFD966","FFC000","548235","BF8F00","A9D18E","E2F0D9","C5E0B4"],redOrange:["FF0000","ED7D31","FFC000","FF6600","C00000","843C0C","BF8F00","FF3300","F4B183","FFD966"],redViolet:["FF0000","7030A0","ED7D31","C00000","5B2C6F","843C0C","FF6161","9B59B6","F4B183","BB8FCE"],yellowOrange:["FFC000","ED7D31","FFD966","F4B183","BF8F00","C55A11","FFE699","F8CBAD","806000","843C0C"],slipstream:["4472C4","ED7D31","A5A5A5","FFC000","5B9BD5","70AD47","255E91","9E480E","636363","997300"],marquee:["ED7D31","4472C4","70AD47","FFC000","5B9BD5","A5A5A5","264478","9E480E","636363","997300"],aspect:["5B9BD5","4472C4","ED7D31","FFC000","70AD47","A5A5A5","9E480E","264478","636363","997300"]},Vs={colorful1:102,colorful2:103,colorful3:104,colorful4:105,monochromatic1:201,monochromatic2:202,monochromatic3:203,monochromatic4:204,monochromatic5:205,monochromatic6:206,monochromatic7:207,monochromatic8:208,monochromatic9:209,monochromatic10:210,monochromatic11:211,monochromatic12:212};function Ws(e,t){let o=' xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"',n=e.replace(/^FF/,""),s;t?.fillType==="gradient"&&t.gradientStops?.length?s=`<a:gradFill><a:gsLst>${t.gradientStops.map(l=>`<a:gs pos="${l.pos*1e3}"><a:srgbClr val="${l.color.replace(/^FF/,"").replace(/^#/,"")}"/></a:gs>`).join("")}</a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill>`:s=`<a:solidFill><a:srgbClr val="${n}"/></a:solidFill>`;let r=t?.lineWidth?` w="${Math.round(t.lineWidth*12700)}"`:"",a=r?`<a:ln${r}><a:solidFill><a:srgbClr val="${n}"/></a:solidFill></a:ln>`:"";return`<c:spPr${o}>${s}${a}</c:spPr>`}function wn(e){return e?`<c:dLbls>${[e.numFmt?`<c:numFmt formatCode="${I(e.numFmt)}" sourceLinked="0"/>`:"",e.position?`<c:dLblPos val="${e.position}"/>`:"",'<c:showLegendKey val="0"/>',`<c:showVal val="${e.showValue?"1":"0"}"/>`,`<c:showCatName val="${e.showCategory?"1":"0"}"/>`,`<c:showSerName val="${e.showSeriesName?"1":"0"}"/>`,`<c:showPercent val="${e.showPercent?"1":"0"}"/>`].join("")}</c:dLbls>`:""}function Te(e,t,o,n){return t.map((s,r)=>{let a=s.color?s.color.startsWith("#")?"FF"+s.color.slice(1):s.color:n?"FF"+n[r%n.length]:yn[r%yn.length],i=s.categories?`<c:cat><c:strRef><c:f>${I(s.categories)}</c:f></c:strRef></c:cat>`:"",l=`<c:val><c:numRef><c:f>${I(s.values)}</c:f></c:numRef></c:val>`,h=s.name?`<c:tx><c:strRef><c:f>"${I(s.name)}"</c:f></c:strRef></c:tx>`:"",m=e.startsWith("line")||e==="scatter"?'<c:marker><c:symbol val="none"/></c:marker>':"",c=wn(s.dataLabels);return`<c:ser><c:idx val="${r}"/><c:order val="${r}"/>${h}${Ws(a,s)}${m}${c}${i}${l}</c:ser>`}).join("")}function Hs(e,t,o,n=!1){if(n)return`<c:valAx><c:axId val="${e}"/><c:scaling><c:orientation val="minMax"/></c:scaling><c:delete val="1"/><c:axPos val="b"/><c:crossAx val="${t}"/></c:valAx>`;let s=o?.title?`<c:title><c:tx><c:rich><a:bodyPr xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"/><a:p xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:r><a:t>${I(o.title)}</a:t></a:r></a:p></c:rich></c:tx><c:overlay val="0"/></c:title>`:"",r=[o?.min!==void 0?`<c:min val="${o.min}"/>`:"",o?.max!==void 0?`<c:max val="${o.max}"/>`:""].join(""),a=o?.numFmt?`<c:numFmt formatCode="${I(o.numFmt)}" sourceLinked="0"/>`:"",i=o?.gridLines!==!1?"<c:majorGridlines/>":"";return`<c:valAx>
92
- <c:axId val="${e}"/>
93
- <c:scaling><c:orientation val="minMax"/>${r}</c:scaling>
94
- <c:delete val="0"/>
95
- <c:axPos val="l"/>
96
- ${i}${s}${a}
97
- <c:crossAx val="${t}"/>
98
- </c:valAx>`}function zs(e,t,o){let n=o?.title?`<c:title><c:tx><c:rich><a:bodyPr xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"/><a:p xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:r><a:t>${I(o.title)}</a:t></a:r></a:p></c:rich></c:tx><c:overlay val="0"/></c:title>`:"",s=o?.gridLines?"<c:majorGridlines/>":"";return`<c:catAx>
99
- <c:axId val="${e}"/>
100
- <c:scaling><c:orientation val="minMax"/></c:scaling>
101
- <c:delete val="0"/>
102
- <c:axPos val="b"/>
103
- ${s}${n}
104
- <c:crossAx val="${t}"/>
105
- </c:catAx>`}function Gs(e){if(e===!1)return"";let t=typeof e=="string"?e:"b";return`<c:legend><c:legendPos val="${{bottom:"b",top:"t",left:"l",right:"r",corner:"tr"}[t]??t}"/></c:legend>`}function bn(e){let t=e.type,o=e.series,n=e.colorPalette?Us[e.colorPalette]:void 0,s=e.title?`<c:title><c:tx><c:rich>
106
- <a:bodyPr xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"/>
107
- <a:p xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
108
- <a:r><a:t>${I(e.title)}</a:t></a:r>
109
- </a:p>
110
- </c:rich></c:tx><c:overlay val="0"/></c:title>`:"",r=e.varyColors?'<c:varyColors val="1"/>':"",a=wn(e.dataLabels),i="",l=t==="pie"||t==="doughnut",h=t.startsWith("bar")||t.startsWith("column"),m=t.startsWith("line"),c=t.startsWith("scatter")||t==="bubble",d=t.startsWith("area"),f=t.startsWith("radar"),p=t==="stock",g=e.grouping??(t.endsWith("Stacked100")?"percentStacked":t.endsWith("Stacked")?"stacked":h?"clustered":m||d?"standard":void 0);if(l){let w=t==="doughnut"?"doughnutChart":"pieChart",k=t==="doughnut"?'<c:holeSize val="50"/>':"";i=`<c:${w}>${r}${Te(t,o,0,n)}${a}${k}</c:${w}>`}else h?i=`<c:barChart>
111
- <c:barDir val="${t.startsWith("bar")?"bar":"col"}"/>
112
- ${g?`<c:grouping val="${g}"/>`:""}
113
- ${r}
114
- ${Te(t,o,0,n)}
115
- ${a}
116
- <c:axId val="1"/><c:axId val="2"/>
117
- </c:barChart>`:m?i=`<c:lineChart>
118
- ${g?`<c:grouping val="${g}"/>`:""}
119
- ${r}
120
- ${Te(t,o,0,n)}
121
- ${a}
122
- <c:axId val="1"/><c:axId val="2"/>
123
- </c:lineChart>`:c?i=`<c:scatterChart>
124
- <c:scatterStyle val="${t==="scatterSmooth"?"smoothMarker":"marker"}"/>
125
- ${r}
126
- ${Te(t,o,0,n)}
127
- ${a}
128
- <c:axId val="1"/><c:axId val="2"/>
129
- </c:scatterChart>`:d?i=`<c:areaChart>
130
- ${g?`<c:grouping val="${g}"/>`:""}
131
- ${r}
132
- ${Te(t,o,0,n)}
133
- ${a}
134
- <c:axId val="1"/><c:axId val="2"/>
135
- </c:areaChart>`:f?i=`<c:radarChart>
136
- <c:radarStyle val="${t==="radarFilled"?"filled":"marker"}"/>
137
- ${r}
138
- ${Te(t,o,0,n)}
139
- ${a}
140
- <c:axId val="1"/><c:axId val="2"/>
141
- </c:radarChart>`:i=`<c:barChart>
142
- <c:barDir val="col"/>
143
- <c:grouping val="clustered"/>
144
- ${r}
145
- ${Te(t,o,0,n)}
146
- ${a}
147
- <c:axId val="1"/><c:axId val="2"/>
148
- </c:barChart>`;let $=!l?zs(1,2,e.xAxis)+Hs(2,1,e.yAxis):"",x=Gs(e.legend??"b"),b=e.modernStyle?Math.min(Vs[e.modernStyle],48):e.style,C=b?`<c:style val="${b}"/>`:"",y="";if(e.chartFill||e.shadow){let w=e.chartFill==="gradient"?'<a:gradFill><a:gsLst><a:gs pos="0"><a:schemeClr val="lt1"/></a:gs><a:gs pos="100000"><a:schemeClr val="bg1"><a:lumMod val="85000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill>':e.chartFill==="white"?'<a:solidFill><a:srgbClr val="FFFFFF"/></a:solidFill>':e.chartFill==="none"?"<a:noFill/>":"",k=e.shadow?'<a:effectLst><a:outerShdw blurRad="50800" dist="38100" dir="5400000" algn="t" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="40000"/></a:srgbClr></a:outerShdw></a:effectLst>':"";y=`<c:spPr>${w}${k}</c:spPr>`}return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
149
- <c:chartSpace xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart"
150
- xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
151
- xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
152
- ${e.roundedCorners?'<c:roundedCorners val="1"/>':""}
153
- ${C}
154
- <c:chart>
155
- ${s}
156
- <c:autoTitleDeleted val="${e.title?"0":"1"}"/>
157
- <c:plotArea>
158
- ${i}
159
- ${$}
160
- </c:plotArea>
161
- ${x}
162
- <c:plotVisOnly val="1"/>
163
- </c:chart>
164
- ${y}
165
- </c:chartSpace>`}function qs(e){return{type:e.type,style:e.style,modernStyle:e.modernStyle,colorPalette:e.colorPalette,legend:e.legend,xAxis:e.xAxis,yAxis:e.yAxis,dataLabels:e.dataLabels,chartFill:e.chartFill,roundedCorners:e.roundedCorners,shadow:e.shadow,varyColors:e.varyColors,grouping:e.grouping}}function Ks(e,t){return{type:t.type??e.type,title:t.title,series:t.series,from:t.from,to:t.to,xAxis:t.xAxis??e.xAxis,yAxis:t.yAxis??e.yAxis,legend:t.legend??e.legend,style:t.style??e.style,modernStyle:t.modernStyle??e.modernStyle,colorPalette:t.colorPalette??e.colorPalette,dataLabels:t.dataLabels??e.dataLabels,chartFill:t.chartFill??e.chartFill,roundedCorners:t.roundedCorners??e.roundedCorners,shadow:t.shadow??e.shadow,varyColors:t.varyColors??e.varyColors,grouping:t.grouping??e.grouping}}function Zs(e){return JSON.stringify(e)}function Ys(e){return JSON.parse(e)}function Uo(e,t){let{startRow:o,startCol:n,endRow:s,endCol:r}=Kt(e.ref),a=e.displayName??e.name,i=e.columns.map((f,p)=>{let g=n+p,u=p+1,$=f.totalsRowFunction??"none",x=e.totalsRow?` totalsRowFunction="${$}"${$!=="none"&&f.totalsRowFormula?` totalsRowFormula="${I(f.totalsRowFormula)}"`:""}`:"",b=e.totalsRow&&f.totalsRowLabel?` totalsRowLabel="${I(f.totalsRowLabel)}"`:"";return`<tableColumn id="${u}" name="${I(f.name)}"${x}${b}/>`}).join(""),l=[`name="${I(e.style??"TableStyleMedium2")}"`,e.showFirstColumn?'showFirstColumn="1"':"",e.showLastColumn?'showLastColumn="1"':"",e.showRowStripes!==!1?'showRowStripes="1"':"",e.showColumnStripes?'showColumnStripes="1"':""].filter(Boolean).join(" "),h=e.totalsRow?1:0,m=Ut(n),c=Ut(r),d=`${m}${o}:${c}${s-h}`;return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
192
+ </sst>`}};function lr(e){let t=[];return e.bold&&t.push("<b/>"),e.italic&&t.push("<i/>"),e.strike&&t.push("<strike/>"),e.underline&&e.underline!=="none"&&t.push(`<u val="${e.underline}"/>`),e.size&&t.push(`<sz val="${e.size}"/>`),e.color&&(e.color.startsWith("theme:")?t.push(`<color theme="${e.color.slice(6)}"/>`):t.push(`<color rgb="${e.color.startsWith("#")?"FF"+e.color.slice(1):e.color}"/>`)),e.name&&t.push(`<name val="${I(e.name)}"/>`),t.length?`<rPr>${t.join("")}</rPr>`:""}Wt();function zo(e,t){let{startRow:o,startCol:n,endRow:s,endCol:r}=Zt(e.ref),a=e.displayName??e.name,i=e.columns.map((f,p)=>{let g=n+p,u=p+1,$=f.totalsRowFunction??"none",x=e.totalsRow?` totalsRowFunction="${$}"${$!=="none"&&f.totalsRowFormula?` totalsRowFormula="${I(f.totalsRowFormula)}"`:""}`:"",b=e.totalsRow&&f.totalsRowLabel?` totalsRowLabel="${I(f.totalsRowLabel)}"`:"";return`<tableColumn id="${u}" name="${I(f.name)}"${x}${b}/>`}).join(""),l=[`name="${I(e.style??"TableStyleMedium2")}"`,e.showFirstColumn?'showFirstColumn="1"':"",e.showLastColumn?'showLastColumn="1"':"",e.showRowStripes!==!1?'showRowStripes="1"':"",e.showColumnStripes?'showColumnStripes="1"':""].filter(Boolean).join(" "),h=e.totalsRow?1:0,m=Ut(n),c=Ut(r),d=`${m}${o}:${c}${s-h}`;return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
166
193
  <table xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
167
194
  id="${t}" name="${I(e.name)}" displayName="${I(a)}"
168
195
  ref="${e.ref}" totalsRowCount="${h}">
169
196
  <autoFilter ref="${d}"/>
170
197
  <tableColumns count="${e.columns.length}">${i}</tableColumns>
171
198
  <tableStyleInfo ${l}/>
172
- </table>`}var Qs={sum:"sum",count:"count",average:"average",max:"max",min:"min",product:"product",countNums:"countNums",stdDev:"stdDev",stdDevp:"stdDevp",var:"var",varp:"varp"};function Cn(e,t,o,n){let s=(t[0]??[]).map(G=>String(G??"")),r=t.slice(1),a=s.length,i=e.rowGrandTotals!==!1,l=e.colGrandTotals!==!1,h=new Map(s.map((G,X)=>[G,X])),m=e.rowFields.map(G=>h.get(G)??0),c=e.colFields.map(G=>h.get(G)??0),d=e.dataFields.map(G=>h.get(G.field)??0),f=Array.from({length:a},()=>[]),p=Array.from({length:a},()=>new Map),g=new Array(a).fill(!0);for(let G of r)for(let X=0;X<a;X++){let F=G[X],P=F==null?"":String(F);typeof F!="number"&&(g[X]=!1),p[X].has(P)||(p[X].set(P,f[X].length),f[X].push(P))}let{row:u,col:$}=Gt(e.targetCell),x=c.length>0,b=x?c.reduce((G,X)=>G*Math.max(f[X].length,1),1):1,y=1+(m.length?m.reduce((G,X)=>G*Math.max(f[X].length,1),1):1)+(i?1:0),v=e.dataFields.length+(e.calculatedFields??[]).length,w=m.length+b*v+(l?v:0),k=`${ye(u,$)}:${ye(u+y-1,$+w-1)}`,T=m.length+1,S=new Set([...m,...c]),D=e.calculatedFields??[],R=D.map(G=>`<cacheField name="${I(G.name)}" numFmtId="0" formula="${I(G.formula)}" databaseField="0"><sharedItems/></cacheField>`).join(""),A=a+D.length,W=new Map;for(let G of e.fieldGrouping??[]){let X=h.get(G.field);X!==void 0&&W.set(X,G)}let Q=s.map((G,X)=>{let F=W.get(X);if(S.has(X)){let P=f[X].map(Y=>`<s v="${I(Y)}"/>`).join(""),U="";return F&&(F.groupBy==="numeric"?U=`<fieldGroup base="${X}"><rangePr startNum="${F.start??0}" endNum="${F.end??100}" groupInterval="${F.interval??10}"/></fieldGroup>`:U=`<fieldGroup base="${X}"><rangePr groupBy="${{days:"days",months:"months",quarters:"quarters",years:"years"}[F.groupBy]??"months"}"/></fieldGroup>`),`<cacheField name="${I(G)}" numFmtId="0"><sharedItems count="${f[X].length}">${P}</sharedItems>${U}</cacheField>`}if(g[X]){let P=r.map(st=>Number(st[X])).filter(st=>!isNaN(st)),U=P.length?Math.min(...P):0,Y=P.length?Math.max(...P):0;return`<cacheField name="${I(G)}" numFmtId="0"><sharedItems containsSemiMixedTypes="0" containsString="0" containsNumber="1" minValue="${U}" maxValue="${Y}"/></cacheField>`}return`<cacheField name="${I(G)}" numFmtId="0"><sharedItems/></cacheField>`}).join("")+R,q=r.map(G=>`<r>${s.map((F,P)=>{let U=G[P];if(S.has(P)){let Y=U==null?"":String(U);return`<x v="${p[P].get(Y)??0}"/>`}return typeof U=="number"?`<n v="${U}"/>`:typeof U=="boolean"?`<b v="${U?1:0}"/>`:`<s v="${I(String(U??""))}"/>`}).join("")}</r>`).join(""),E=s.map((G,X)=>{let F=m.includes(X),P=c.includes(X),U=d.includes(X);if(F){let Y=f[X].map((st,ht)=>`<item x="${ht}"/>`).join("")+'<item t="default"/>';return`<pivotField axis="axisRow" showAll="0"><items count="${f[X].length+1}">${Y}</items></pivotField>`}if(P){let Y=f[X].map((st,ht)=>`<item x="${ht}"/>`).join("")+'<item t="default"/>';return`<pivotField axis="axisCol" showAll="0"><items count="${f[X].length+1}">${Y}</items></pivotField>`}return U?'<pivotField dataField="1" showAll="0"/>':'<pivotField showAll="0"/>'}).join("")+D.map(()=>'<pivotField dataField="1" showAll="0"/>').join(""),_="",M="";if(m.length){_=`<rowFields count="${m.length}">${m.map(P=>`<field x="${P}"/>`).join("")}</rowFields>`;let G=m[0],X=f[G].map((P,U)=>`<i><x v="${U}"/></i>`).join(""),F=i?'<i t="grand"><x/></i>':"";M=`<rowItems count="${f[G].length+(i?1:0)}">${X}${F}</rowItems>`}let N="",H="";if(x){N=`<colFields count="${c.length}">${c.map(P=>`<field x="${P}"/>`).join("")}</colFields>`;let G=c[0],X=f[G].map((P,U)=>`<i><x v="${U}"/></i>`).join(""),F=l?'<i t="grand"><x/></i>':"";H=`<colItems count="${f[G].length+(l?1:0)}">${X}${F}</colItems>`}else if(v>1){N='<colFields count="1"><field x="-2"/></colFields>';let G=Array.from({length:v},(X,F)=>`<i><x v="${F}"/></i>`).join("");H=`<colItems count="${v}">${G}</colItems>`}let V=[];for(let G=0;G<e.dataFields.length;G++){let X=e.dataFields[G],F=d[G],P=Qs[X.func??"sum"]??"sum",U=X.name??`Sum of ${X.field}`;V.push(`<dataField name="${I(U)}" fld="${F}" subtotal="${P}" showDataAs="normal" baseField="0" baseItem="0"/>`)}for(let G=0;G<D.length;G++){let X=D[G],F=a+G;V.push(`<dataField name="${I(X.name)}" fld="${F}" subtotal="sum" showDataAs="normal" baseField="0" baseItem="0"/>`)}let K=`<dataFields count="${V.length}">${V.join("")}</dataFields>`,z=[i?"":'rowGrandTotals="0"',l?"":'colGrandTotals="0"'].filter(Boolean),mt=z.length?" "+z.join(" "):"",it=I(e.style??"PivotStyleMedium9"),gt=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
173
- <pivotTableDefinition xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="${I(e.name)}" cacheId="${n}" applyNumberFormats="0" applyBorderFormats="0" applyFontFormats="0" applyPatternFormats="0" applyAlignmentFormats="0" applyWidthHeightFormats="1" dataCaption="Values" updatedVersion="6" minRefreshableVersion="3" useAutoFormatting="1" itemPrintTitles="1" createdVersion="6" indent="0" outline="1" outlineData="1" multipleFieldFilters="0"${mt}>
174
- <location ref="${k}" firstHeaderRow="1" firstDataRow="2" firstDataCol="${T}"/>
175
- <pivotFields count="${A}">${E}</pivotFields>
176
- ${_}${M}${N}${H}${K}
177
- <pivotTableStyleInfo name="${it}" showRowHeaders="1" showColHeaders="1" showRowStripes="0" showColStripes="0" showLastColumn="1"/>
178
- </pivotTableDefinition>`,St=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
179
- <pivotCacheDefinition xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:id="rId1" refreshedBy="ExcelForge" refreshedDate="45000" createdVersion="6" refreshedVersion="6" minRefreshableVersion="3" recordCount="${r.length}" saveData="1">
180
- <cacheSource type="worksheet"><worksheetSource ref="${e.sourceRef}" sheet="${I(e.sourceSheet)}"/></cacheSource>
181
- <cacheFields count="${A}">${Q}</cacheFields>
182
- </pivotCacheDefinition>`,J=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
183
- <pivotCacheRecords xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" count="${r.length}">${q}</pivotCacheRecords>`;return{pivotTableXml:gt,cacheDefXml:St,cacheRecordsXml:J}}var Vo={button:"Button",checkBox:"Checkbox",comboBox:"Drop",listBox:"List",optionButton:"Radio",groupBox:"GBox",label:"Label",scrollBar:"Scroll",spinner:"Spin",dialog:"Dialog"},Js={...Vo,checkBox:"CheckBox",dialog:"Dialog"},Fn={...Object.fromEntries(Object.entries(Vo).map(([e,t])=>[t,e])),CheckBox:"checkBox"},vn={unchecked:"0",checked:"1",mixed:"2"},Sn={0:"unchecked",1:"checked",2:"mixed"};function In(e){if(e._ctrlPropXml)return e._ctrlPropXml;let o=[`objectType="${Js[e.type]??"Button"}"`,'lockText="1"'];if(e.linkedCell&&o.push(`fmlaLink="${I(e.linkedCell)}"`),e.inputRange&&o.push(`fmlaRange="${I(e.inputRange)}"`),e.checked!==void 0&&o.push(`checked="${vn[e.checked]??"0"}"`),e.dropLines!==void 0&&o.push(`dropLines="${e.dropLines}"`),e.min!==void 0&&o.push(`min="${e.min}"`),e.max!==void 0&&o.push(`max="${e.max}"`),e.inc!==void 0&&o.push(`inc="${e.inc}"`),e.page!==void 0&&o.push(`page="${e.page}"`),e.val!==void 0&&o.push(`val="${e.val}"`),e.selType){let n={single:"Single",multi:"Multi",extend:"Extend"};o.push(`selType="${n[e.selType]??"Single"}"`)}return e.noThreeD&&o.push('noThreeD="1"'),`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
184
- <formControlPr xmlns="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main" ${o.join(" ")}/>`}function tr(e,t){return`${e.col}, ${e.colOff??0}, ${e.row}, ${e.rowOff??0}, ${t.col}, ${t.colOff??0}, ${t.row}, ${t.rowOff??0}`}function Tn(e,t){if(e._vmlShapeXml)return e._vmlShapeXml;let o=Vo[e.type]??"Button",n=tr(e.from,e.to),s=[];if(s.push(`<x:Anchor>${n}</x:Anchor>`),s.push("<x:PrintObject>False</x:PrintObject>"),s.push("<x:AutoFill>False</x:AutoFill>"),e.macro&&s.push(`<x:FmlaMacro>${I(e.macro)}</x:FmlaMacro>`),e.linkedCell&&s.push(`<x:FmlaLink>${I(e.linkedCell)}</x:FmlaLink>`),e.inputRange&&s.push(`<x:FmlaRange>${I(e.inputRange)}</x:FmlaRange>`),e.checked!==void 0&&s.push(`<x:Checked>${vn[e.checked]??"0"}</x:Checked>`),e.dropLines!==void 0&&s.push(`<x:DropLines>${e.dropLines}</x:DropLines>`),e.dropStyle&&s.push(`<x:DropStyle>${I(e.dropStyle)}</x:DropStyle>`),e.min!==void 0&&s.push(`<x:Min>${e.min}</x:Min>`),e.max!==void 0&&s.push(`<x:Max>${e.max}</x:Max>`),e.inc!==void 0&&s.push(`<x:Inc>${e.inc}</x:Inc>`),e.page!==void 0&&s.push(`<x:Page>${e.page}</x:Page>`),e.val!==void 0&&s.push(`<x:Val>${e.val}</x:Val>`),e.selType){let d={single:"Single",multi:"Multi",extend:"Extend"};s.push(`<x:Sel>${d[e.selType]??"Single"}</x:Sel>`)}e.noThreeD&&s.push("<x:NoThreeD/>"),e.isDefault&&s.push("<x:Default/>"),e.isDismiss&&s.push("<x:Dismiss/>"),e.isCancel&&s.push("<x:Cancel/>");let r="";e.text&&(e.type==="button"||e.type==="checkBox"||e.type==="optionButton"||e.type==="groupBox"||e.type==="label"||e.type==="dialog")&&(r=`<v:textbox style="mso-direction-alt:auto"><div style="text-align:${e.type==="button"?"center":"left"}"><font face="Calibri" size="220" color="#000000">${I(e.text)}</font></div></v:textbox>`,s.push("<x:TextHAlign>Center</x:TextHAlign>"),s.push("<x:TextVAlign>Center</x:TextVAlign>"));let a=(e.from.col*64+(e.from.colOff??0))*.75,i=(e.from.row*20+(e.from.rowOff??0))*.75,l=(e.to.col-e.from.col)*64*.75,h=(e.to.row-e.from.row)*20*.75,m=e.text??`${e.type}_${t}`,c=e.type==="dialog"?"":' filled="f" stroked="f"';return`<v:shape o:spid="_x0000_s${t}" id="${I(m)}" type="#_x0000_t201" style="position:absolute;margin-left:${a.toFixed(1)}pt;margin-top:${i.toFixed(1)}pt;width:${l.toFixed(1)}pt;height:${h.toFixed(1)}pt;z-index:${t}"${c} o:insetmode="auto"><o:lock v:ext="edit" rotation="t"/>${r}<x:ClientData ObjectType="${o}">${s.join("")}</x:ClientData></v:shape>`}function kn(e,t){return`<xml xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel">
185
- <o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1"/></o:shapelayout>
186
- <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>
187
- <v:shapetype id="_x0000_t201" coordsize="21600,21600" o:spt="201" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter"/><v:path shadowok="f" o:extrusionok="f" strokeok="f" fillok="f" o:connecttype="rect"/><o:lock v:ext="edit" shapetype="t"/></v:shapetype>
188
- ${e.join(`
189
- `)}
190
- ${t.join(`
191
- `)}
192
- </xml>`}function An(e){return e<=16?4:e<=32?5:e<=64?6:e<=128?7:e<=256?8:e<=512?9:e<=1024?10:e<=2048?11:12}function Wo(e){let t=[1],o=0;for(;o<e.length;){let n=o,s=Math.min(o+4096,e.length),r=er(e,n,s);if(r.length<4096){let i=45056|r.length+2-3&4095;t.push(i&255,i>>8&255);for(let l of r)t.push(l)}else{t.push(255,63);for(let i=n;i<s;i++)t.push(e[i]);for(let i=s-n;i<4096;i++)t.push(0)}o=s}return new Uint8Array(t)}function er(e,t,o){let n=[],s=0;for(;t+s<o;){let r=0,a=n.length;n.push(0);for(let i=0;i<8&&t+s<o;i++){if(s===0){n.push(e[t]),s++;continue}let l=An(s),h=1<<l,m=16-l,c=(1<<m)-1+3,d=Math.max(0,s-h),f=0,p=0;for(let g=d;g<s;g++){let u=0;for(;s+u<o-t&&u<c&&e[t+g+u]===e[t+s+u];)u++;u>p&&(p=u,f=s-g)}if(p>=3){r|=1<<i;let g=f-1<<m|p-3;n.push(g&255,g>>8&255),s+=p}else n.push(e[t+s]),s++}n[a]=r}return n}function Ho(e){if(e.length===0||e[0]!==1)throw new Error("Invalid OVBA compressed container (bad signature)");let t=[],o=1;for(;o<e.length&&!(o+1>=e.length);){let n=e[o]|e[o+1]<<8;o+=2;let s=(n&4095)+3,r=n>>15&1,a=s-2,i=o+a;if(r){let l=t.length;for(;o<i&&o<e.length;){let h=e[o++];for(let m=0;m<8&&o<i&&o<e.length;m++)if((h&1<<m)===0)t.push(e[o++]);else{if(o+1>=e.length)break;let c=e[o]|e[o+1]<<8;o+=2;let d=t.length-l,p=16-An(d),g=(c>>p)+1,u=(c&(1<<p)-1)+3,$=t.length-g;for(let x=0;x<u;x++)t.push(t[$+x])}}}else{for(let l=0;l<4096&&o<e.length;l++)t.push(e[o++]);o=Math.max(o,i)}}return new Uint8Array(t)}var Dn=new Uint8Array([208,207,17,224,161,177,26,225]),ke=4294967294,Ue=4294967295,or=4294967293,Xe=4294967295,Zt=512,go=64,Rn=4096,$o=128;function zo(e,t){return e[t]|e[t+1]<<8}function ee(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function Ne(e,t,o){e[t]=o&255,e[t+1]=o>>8&255}function Et(e,t,o){e[t]=o&255,e[t+1]=o>>8&255,e[t+2]=o>>16&255,e[t+3]=o>>24&255}function nr(e){if(e.length>31)throw new Error(`CFB entry name too long (${e.length} chars, max 31): "${e}"`);let t=new Uint8Array(64),o=0;for(let n of e){let s=n.charCodeAt(0);t[o++]=s&255,t[o++]=s>>8&255}return t[o++]=0,t[o++]=0,{bytes:t,size:o}}function sr(e,t,o){let n="",s=Math.max(0,o-2);for(let r=0;r<s;r+=2){let a=e[t+r]|e[t+r+1]<<8;if(a===0)break;n+=String.fromCharCode(a)}return n}function eo(e,t){let o=[],n=t;for(;n!==ke&&n<e.length;)o.push(n),n=e[n];return o}function xo(e,t){return Math.ceil(e/t)}function Pn(e){for(let T=0;T<8;T++)if(e[T]!==Dn[T])throw new Error("Not a CFB file");let o=1<<zo(e,30),s=1<<zo(e,32),r=ee(e,44),a=ee(e,48),i=ee(e,60),l=T=>512+T*o,h=[];for(let T=0;T<109&&T<r;T++){let S=ee(e,76+T*4);S!==Ue&&h.push(S)}let m=Math.floor((e.length-512)/o),c=new Uint32Array(m);c.fill(Ue);for(let T=0;T<h.length;T++){let S=l(h[T]),D=o/4;for(let R=0;R<D&&T*D+R<m;R++)c[T*D+R]=ee(e,S+R*4)}let d=eo(c,a),f=new Uint8Array(d.length*o);for(let T=0;T<d.length;T++)f.set(e.subarray(l(d[T]),l(d[T])+o),T*o);let p=f.length/$o,g=[];for(let T=0;T<p;T++){let S=T*$o,D=zo(f,S+64);D!==0&&g.push({name:sr(f,S,D),type:f[S+66],child:ee(f,S+76),left:ee(f,S+68),right:ee(f,S+72),startSector:ee(f,S+116),size:ee(f,S+120),index:T})}let u=g.find(T=>T.type===5);if(!u)throw new Error("No root entry in CFB");let $=eo(c,u.startSector),x=new Uint8Array($.length*o);for(let T=0;T<$.length;T++)x.set(e.subarray(l($[T]),l($[T])+o),T*o);let b=eo(c,i),C=b.length*(o/4),y=new Uint32Array(C);y.fill(Ue);for(let T=0;T<b.length;T++){let S=l(b[T]),D=o/4;for(let R=0;R<D;R++)y[T*D+R]=ee(e,S+R*4)}let v=new Map;function w(T,S){let D=g.find(A=>A.index===T);if(!D||D.child===Xe)return;let R=A=>{if(A===Xe||A>=p)return;let W=g.find(Q=>Q.index===A);W&&(v.set(A,S),W.type===1&&w(A,W.name),R(W.left),R(W.right))};R(D.child)}w(u.index,"");let k=[];for(let T of g){if(T.type!==2)continue;let S;if(T.size<Rn){let D=eo(y,T.startSector),R=new Uint8Array(D.length*s);for(let A=0;A<D.length;A++){let W=D[A]*s;R.set(x.subarray(W,W+s),A*s)}S=R.subarray(0,T.size)}else{let D=eo(c,T.startSector),R=new Uint8Array(D.length*o);for(let A=0;A<D.length;A++)R.set(e.subarray(l(D[A]),l(D[A])+o),A*o);S=R.subarray(0,T.size)}k.push({name:T.name,data:S,storage:v.get(T.index)||void 0})}return k}function Mn(e){let t={name:"Root Entry",type:5,children:[]},o=new Map;o.set("",t);for(let A of e){let W=A.storage??"",Q=o.get(W);Q||(Q={name:W,type:1,children:[]},o.set(W,Q),t.children.push(Q));let q={name:A.name,type:2,data:A.data};Q.children.push(q)}let n=[],s=[t];for(;s.length;){let A=s.shift();if(n.push({node:A,parentIdx:-1,childIdx:Xe,leftIdx:Xe,rightIdx:Xe,miniStart:0,size:A.data?.length??0}),A.children)for(let W of A.children)s.push(W)}for(let A=0;A<n.length;A++){let W=n[A].node;if(!W.children?.length)continue;let Q=n.map((_,M)=>({e:_,idx:M})).filter(({e:_})=>W.children.includes(_.node)).map(({idx:_})=>_);if(Q.length===0)continue;let q=Q.sort((_,M)=>{let N=n[_].node.name,H=n[M].node.name;return N.length!==H.length?N.length-H.length:N.toUpperCase()<H.toUpperCase()?-1:N.toUpperCase()>H.toUpperCase()?1:0}),E=_=>{if(_.length===0)return Xe;let M=_.length>>1;return n[_[M]].leftIdx=E(_.slice(0,M)),n[_[M]].rightIdx=E(_.slice(M+1)),_[M]};n[A].childIdx=E(q)}let r=[],a=new Map,i=0;for(let A=0;A<n.length;A++){let W=n[A].node.data;if(!W||W.length===0)continue;let Q=xo(W.length,go),q=[];for(let E=0;E<Q;E++){q.push(i++);let _=W.subarray(E*go,Math.min((E+1)*go,W.length));for(let M of _)r.push(M);for(let M=_.length;M<go;M++)r.push(0)}n[A].miniStart=q[0],a.set(A,q)}let h=Math.max(i,1),m=xo(h*4,Zt),c=new Uint32Array(m*(Zt/4));c.fill(Ue);for(let A of a.values())for(let W=0;W<A.length;W++)c[A[W]]=W+1<A.length?A[W+1]:ke;let d=new Uint8Array(r),f=xo(d.length||1,Zt),p=n.length,g=xo(p*$o,Zt),u=0,$=1,x=$+g,b=x+m,C=1+g+m+f,y=new Uint32Array(Zt/4);y.fill(Ue),y[u]=or;for(let A=0;A<g;A++)y[$+A]=A+1<g?$+A+1:ke;for(let A=0;A<m;A++)y[x+A]=A+1<m?x+A+1:ke;for(let A=0;A<f;A++)y[b+A]=A+1<f?b+A+1:ke;n[0].miniStart=b,n[0].size=d.length;let v=new Uint8Array(g*Zt);for(let A=0;A<n.length;A++){let W=A*$o,Q=n[A],{bytes:q,size:E}=nr(Q.node.name);v.set(q,W),Ne(v,W+64,E),v[W+66]=Q.node.type,v[W+67]=1,Et(v,W+68,Q.leftIdx),Et(v,W+72,Q.rightIdx),Et(v,W+76,Q.childIdx),Q.node.type===5?(Et(v,W+116,b),Et(v,W+120,d.length)):Q.node.type===2&&Q.node.data&&Q.node.data.length>0?(Et(v,W+116,Q.miniStart),Et(v,W+120,Q.node.data.length)):Q.node.type===1?(Et(v,W+116,0),Et(v,W+120,0)):(Et(v,W+116,ke),Et(v,W+120,0))}let w=new Uint8Array(512);w.set(Dn,0),Ne(w,24,62),Ne(w,26,3),Ne(w,28,65534),Ne(w,30,9),Ne(w,32,6),Et(w,44,1),Et(w,48,$),Et(w,56,Rn),Et(w,60,x),Et(w,64,m),Et(w,68,ke),Et(w,72,0),Et(w,76,u);for(let A=1;A<109;A++)Et(w,76+A*4,Ue);let k=512+C*Zt,T=new Uint8Array(k);T.set(w,0);let S=new Uint8Array(Zt);for(let A=0;A<y.length;A++)Et(S,A*4,y[A]);T.set(S,512+u*Zt),T.set(v,512+$*Zt);let D=new Uint8Array(m*Zt);for(let A=0;A<c.length;A++)Et(D,A*4,c[A]);T.set(D,512+x*Zt);let R=new Uint8Array(f*Zt);return R.set(d),T.set(R,512+b*Zt),T}var Yt=new TextEncoder,yo=new TextDecoder("utf-8");function we(e){return[e&255,e>>8&255]}function vt(e){return[e&255,e>>8&255,e>>16&255,e>>24&255]}function rr(e,t){return e[t]|e[t+1]<<8}function En(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function Tt(e,t){let o=t instanceof Uint8Array?Array.from(t):t;return[...we(e),...vt(o.length),...o]}function ar(e){let t=[];for(let o of e){let n=o.charCodeAt(0);t.push(n&255,n>>8&255)}return t}function ir(e){let t=[`Attribute VB_Name = "${e.name}"`];if(e.type==="document"){let o=e.name==="ThisWorkbook"?"0{00020819-0000-0000-C000-000000000046}":"0{00020820-0000-0000-C000-000000000046}";t.push(`Attribute VB_Base = "${o}"`,"Attribute VB_GlobalNameSpace = False","Attribute VB_Creatable = False","Attribute VB_PredeclaredId = True","Attribute VB_Exposed = True","Attribute VB_TemplateDerived = False","Attribute VB_Customizable = True")}else e.type==="userform"?t.push('Attribute VB_Base = "0{F8A47041-B2A6-11CE-8027-00AA00611080}"',"Attribute VB_GlobalNameSpace = False","Attribute VB_Creatable = False","Attribute VB_PredeclaredId = True","Attribute VB_Exposed = False","Attribute VB_TemplateDerived = False","Attribute VB_Customizable = False"):e.type==="class"&&t.push("Attribute VB_GlobalNameSpace = False","Attribute VB_Creatable = False","Attribute VB_PredeclaredId = False","Attribute VB_Exposed = False");return t.join(`\r
193
- `)+`\r
194
- `}var oo=class e{constructor(){this.modules=[],this._dirty=!1}addModule(t){return this.modules.push(t),this._dirty=!0,this}removeModule(t){return this.modules=this.modules.filter(o=>o.name!==t),this._dirty=!0,this}getModule(t){return this.modules.find(o=>o.name===t)}build(){if(this._raw&&!this._dirty)return this._raw;let o=this.modules.some(p=>p.name==="ThisWorkbook"&&p.type==="document")?this.modules:[{name:"ThisWorkbook",type:"document",code:""},...this.modules],n=[...o.filter(p=>p.type==="document"),...o.filter(p=>p.type!=="document")],s=[];for(let p of n){let g=ir(p)+p.code,u=Wo(Yt.encode(g));s.push({name:p.name,data:u,storage:"VBA"})}let r={name:"_VBA_PROJECT",data:new Uint8Array([204,97,255,255,0,0,0]),storage:"VBA"},a=this._buildDirStream(n),l={name:"dir",data:Wo(a),storage:"VBA"},h=this._buildProjectText(n),m={name:"PROJECT",data:Yt.encode(h)},c=this._buildProjectWm(n),d={name:"PROJECTwm",data:new Uint8Array(c)},f=[r,l,...s,m,d];for(let p of n)if(p.type==="userform")if(p._formStreams&&p._formStreams.size>0)for(let[g,u]of p._formStreams)f.push({name:g,data:u,storage:p.name});else f.push({name:"CompObj",data:mr(),storage:p.name}),f.push({name:"VBFrame",data:Yt.encode(dr(p)),storage:p.name}),f.push({name:"f",data:fr(p),storage:p.name}),f.push({name:"o",data:xr(p),storage:p.name});return Mn(f)}_buildDirStream(t){let o=[],s=Yt.encode("VBAProject");o.push(...Tt(1,vt(1))),o.push(...Tt(2,vt(1033))),o.push(...Tt(20,vt(1033))),o.push(...Tt(3,we(1252))),o.push(...Tt(4,Array.from(s))),o.push(...Tt(5,[])),o.push(...Tt(64,[])),o.push(...Tt(6,[])),o.push(...Tt(61,[])),o.push(...Tt(7,vt(0))),o.push(...Tt(8,vt(0))),o.push(...we(9),...vt(4),...vt(1443),...we(2)),o.push(...Tt(12,[])),o.push(...Tt(60,[])),o.push(...Tt(15,we(t.length))),o.push(...Tt(19,we(65535)));for(let r of t){let a=Yt.encode(r.name),i=ar(r.name);o.push(...Tt(25,Array.from(a))),o.push(...Tt(71,i)),o.push(...Tt(26,Array.from(a))),o.push(...Tt(50,i)),o.push(...Tt(28,[])),o.push(...Tt(72,[])),o.push(...Tt(49,vt(0))),o.push(...Tt(30,vt(0))),o.push(...Tt(44,we(65535))),r.type==="document"||r.type==="userform"?o.push(...Tt(34,[])):o.push(...Tt(33,[])),o.push(...Tt(43,[]))}return o.push(...Tt(16,[])),new Uint8Array(o)}_buildProjectText(t){let o=['ID="{00000000-0000-0000-0000-000000000000}"'],n=t.filter(r=>r.type==="document"),s=t.filter(r=>r.type!=="document");for(let r of n)o.push(`Document=${r.name}/&H00000000`);for(let r of s)r.type==="class"?o.push(`Class=${r.name}`):r.type==="userform"?(o.push("Package={AC9F2F90-E877-11CE-9F68-00AA00574A4F}"),o.push(`BaseClass=${r.name}`)):o.push(`Module=${r.name}`);o.push('Name="VBAProject"',"HelpContextID=0",'VersionCompatible32="393222000"',"","[Host Extender Info]","&H00000001={3832D640-CF90-11CF-8E43-00A0C911005A};VBE;&H00000000","","[Workspace]");for(let r of[...n,...s])o.push(`${r.name}=0, 0, 0, 0, C `);return o.join(`\r
195
- `)+`\r
196
- `}_buildProjectWm(t){let o=[];for(let n of t){for(let s of n.name)o.push(s.charCodeAt(0));o.push(0);for(let s of n.name){let r=s.charCodeAt(0);o.push(r&255,r>>8&255)}o.push(0,0)}return o.push(0),o}static fromBytes(t){let o=new e;o._raw=t;let n=Pn(t),s=new Map;for(let c of n){let d=c.storage?`${c.storage}/${c.name}`:c.name;s.set(d,c.data)}let r=s.get("VBA/dir");if(!r)return o;let a;try{a=Ho(r)}catch{return o}let i=new Set,l=new Set,h=s.get("PROJECT");if(h){let c=yo.decode(h);for(let d of c.split(/\r?\n/)){let f=d.match(/^Class=(.+)$/);f&&i.add(f[1]);let p=d.match(/^BaseClass=(.+)$/);p&&l.add(p[1])}}let m=lr(a);for(let c of m){let d=`VBA/${c.name}`,f=s.get(d);if(!f)continue;let p="";try{let x=f.subarray(c.offset),b=Ho(x);p=yo.decode(b)}catch{p=yo.decode(f.subarray(c.offset))}let g=cr(p),u=l.has(c.name)?"userform":i.has(c.name)?"class":c.type,$={name:c.name,type:u,code:g};if(u==="userform"){let x=new Map;for(let[y,v]of s)if(y.startsWith(c.name+"/")){let w=y.substring(c.name.length+1);x.set(w,v)}x.size>0&&($._formStreams=x);let b=`${c.name}/f`,C=s.get(b);C&&($.designerData=C)}o.modules.push($)}return o._dirty=!1,o}};function lr(e){let t=[],o=0,n=null;for(;o+6<=e.length;){let s=rr(e,o),r=En(e,o+2);if(o+=6,s===9){o+=6;continue}if(o+r>e.length)break;let a=e.subarray(o,o+r);switch(o+=r,s){case 25:n={name:yo.decode(a),type:"standard",offset:0};break;case 49:n&&a.length>=4&&(n.offset=En(a,0));break;case 33:n&&(n.type="standard");break;case 34:n&&(n.type="document");break;case 43:n?.name&&t.push(n),n=null;break}}return t}function cr(e){let t=e.split(/\r?\n/),o=t.findIndex(s=>!s.startsWith("Attribute "));return o<0?e:t.slice(o).join(`
197
- `)}var hr="{C62A69F0-16DC-11CE-9E98-00AA00574A4F}",wo={Image:12,Frame:14,SpinButton:16,CommandButton:17,Label:21,TextBox:23,ListBox:24,ComboBox:25,CheckBox:26,OptionButton:27,ToggleButton:28,ScrollBar:47};function mr(){return new Uint8Array([1,0,254,255,3,10,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,0,0,0,77,105,99,114,111,115,111,102,116,32,70,111,114,109,115,32,50,46,48,32,70,111,114,109,0,16,0,0,0,69,109,98,101,100,100,101,100,32,79,98,106,101,99,116,0,0,0,0,0,244,57,178,113,0,0,0,0,0,0,0,0,0,0,0,0])}function dr(e){return["VERSION 5.00",`Begin ${hr} ${e.name} `,` Caption = "${e.name}"`," ClientHeight = 3015"," ClientLeft = 120"," ClientTop = 465"," ClientWidth = 4560"," StartUpPosition = 1 'CenterOwner"," TypeInfoVer = 2","End"].join(`\r
198
- `)+`\r
199
- `}function fr(e){let t=e.controls??[],o=t.length,n=t.map(C=>Bn(C)),s=[];s.push(0),s.push(4);let r=s.length;s.push(0,0);let a=8,i=1024,l=2048,h=1<<26,m=1<<27,c=a|i|l|h|m;s.push(c&255,c>>8&255,c>>16&255,c>>24&255),s.push(...vt(o+1)),s.push(...vt(0)),s.push(...vt(32e3));let d=200,f=120;for(let C of t){let y=(C.left??0)+(C.width??72),v=(C.top??0)+(C.height??24);y>d&&(d=y),v>f&&(f=v)}let p=(d+20)*26,g=(f+20)*26;s.push(...vt(p)),s.push(...vt(g)),s.push(...vt(0)),s.push(...vt(0));let u=s.length-4;s[r]=u&255,s[r+1]=u>>8&255,s.push(...we(0)),s.push(...vt(o));let $=s.length;s.push(0,0,0,0);let x=s.length;for(let C=0;C<o;C++)s.push(0),s.push(1);for(;(s.length-x)%4!==0;)s.push(0);for(let C=0;C<o;C++){let y=t[C],v=Yt.encode(y.name),w=wo[y.type]??wo.CommandButton;s.push(0,0);let k=s.length;s.push(0,0);let T=485;for(s.push(T&255,T>>8&255,T>>16&255,T>>24&255),s.push(...vt(v.length|2147483648)),s.push(...vt(C+1)),s.push(...vt(n[C].length)),s.push(C&255,C>>8&255),s.push(w&255,w>>8&255),s.push(...v);(s.length-x)%4!==0;)s.push(0);let S=(y.left??10+C*80)*26,D=(y.top??10+C*30)*26;s.push(...vt(S)),s.push(...vt(D));let R=s.length-k-2;s[k]=R&255,s[k+1]=R>>8&255}let b=s.length-x;return s[$]=b&255,s[$+1]=b>>8&255,s[$+2]=b>>16&255,s[$+3]=b>>24&255,new Uint8Array(s)}function Bn(e){let t=wo[e.type]??wo.CommandButton;return t===17?pr(e):t===21?ur(e):gr(e)}function Go(e){e.push(0,2);let t=e.length;e.push(0,0),e.push(5,0,0,0);let o=Yt.encode("Tahoma");for(e.push(...vt(o.length|2147483648)),e.push(160,0,0,0),e.push(...o);e.length%4!==0;)e.push(0);let n=e.length-t-2;e[t]=n&255,e[t+1]=n>>8&255}function pr(e){let t=[],o=!!e.caption;t.push(0,2);let n=t.length;t.push(0,0);let s=32;if(o&&(s|=8),t.push(s&255,s>>8&255,s>>16&255,s>>24&255),o){let l=Yt.encode(e.caption);t.push(...vt(l.length|2147483648))}if(o){let l=Yt.encode(e.caption);for(t.push(...l);t.length%4!==0;)t.push(0)}let r=(e.width??72)*26,a=(e.height??24)*26;t.push(...vt(r)),t.push(...vt(a));let i=t.length-n-2;return t[n]=i&255,t[n+1]=i>>8&255,Go(t),new Uint8Array(t)}function ur(e){let t=[],o=!!e.caption;t.push(0,2);let n=t.length;t.push(0,0);let s=32;if(o&&(s|=8),t.push(s&255,s>>8&255,s>>16&255,s>>24&255),o){let l=Yt.encode(e.caption);t.push(...vt(l.length|2147483648))}if(o){let l=Yt.encode(e.caption);for(t.push(...l);t.length%4!==0;)t.push(0)}let r=(e.width??80)*26,a=(e.height??18)*26;t.push(...vt(r)),t.push(...vt(a));let i=t.length-n-2;return t[n]=i&255,t[n+1]=i>>8&255,Go(t),new Uint8Array(t)}function gr(e){let t=[],o=!!e.caption;t.push(0,2);let n=t.length;t.push(0,0);let s=257;if(o&&(s|=1<<23),s|=1<<31,t.push(s&255,s>>8&255,s>>16&255,s>>>24&255),t.push(0,0,0,0),t.push(27,72,128,44),o){let l=Yt.encode(e.caption);t.push(...vt(l.length|2147483648))}let r=(e.width??72)*26,a=(e.height??24)*26;if(t.push(...vt(r)),t.push(...vt(a)),o){let l=Yt.encode(e.caption);for(t.push(...l);t.length%4!==0;)t.push(0)}let i=t.length-n-2;return t[n]=i&255,t[n+1]=i>>8&255,Go(t),new Uint8Array(t)}function xr(e){let t=e.controls??[];if(t.length===0)return new Uint8Array(0);let o=[];for(let a of t)o.push(Bn(a));let n=o.reduce((a,i)=>a+i.length,0),s=new Uint8Array(n),r=0;for(let a of o)s.set(a,r),r+=a.length;return s}var no=null;function $r(){if(no)return no;no=new Uint32Array(256);for(let e=0;e<256;e++){let t=e;for(let o=0;o<8;o++)t=t&1?3988292384^t>>>1:t>>>1;no[e]=t}return no}function yr(e){let t=$r(),o=4294967295;for(let n=0;n<e.length;n++)o=o>>>8^t[(o^e[n])&255];return(o^4294967295)>>>0}var bo=class{constructor(t=65536){this.pos=0,this.bits=0,this.bitLen=0,this.buf=new Uint8Array(t)}grow(){let t=new Uint8Array(this.buf.length*2);t.set(this.buf),this.buf=t}writeBits(t,o){for(this.bits|=(t&(1<<o)-1)<<this.bitLen,this.bitLen+=o;this.bitLen>=8;)this.pos>=this.buf.length&&this.grow(),this.buf[this.pos++]=this.bits&255,this.bits>>>=8,this.bitLen-=8}writeByte(t){this.pos>=this.buf.length&&this.grow(),this.buf[this.pos++]=t}flush(){this.bitLen>0&&(this.writeByte(this.bits&255),this.bits=0,this.bitLen=0)}toBytes(){return this.buf.subarray(0,this.pos)}};function qo(e,t){let o=e.length,n=new Uint8Array(o),s=[];for(let m=0;m<o;m++)e[m]>0&&s.push(m);if(s.length===0)return n;if(s.length===1)return n[s[0]]=1,n;let r=s.map(m=>({freq:e[m],sym:m})),a=(m,c,d)=>{for(;;){let f=c,p=2*c+1,g=2*c+2;if(p<d&&m[p].freq<m[f].freq&&(f=p),g<d&&m[g].freq<m[f].freq&&(f=g),f===c)break;let u=m[c];m[c]=m[f],m[f]=u,c=f}},i=(m,c)=>{for(;c>0;){let d=c-1>>1;if(m[d].freq<=m[c].freq)break;let f=m[c];m[c]=m[d],m[d]=f,c=d}};for(let m=(r.length>>1)-1;m>=0;m--)a(r,m,r.length);let l=r.length;for(;l>1;){let m=r[0];r[0]=r[--l],a(r,0,l);let c=r[0];r[0]={freq:m.freq+c.freq,sym:-1,left:m,right:c},a(r,0,l)}let h=(m,c)=>{if(m){if(m.sym>=0){n[m.sym]=Math.min(c,t);return}h(m.left,c+1),h(m.right,c+1)}};h(r[0],0);{let m=()=>{let f=0;for(let p=0;p<o;p++)n[p]>0&&(f+=1<<t-n[p]);return f},c=1<<t,d=m();if(d>c){let f=d-c;for(let p=t-1;p>=1&&f>0;p--){let g=1<<t-p-1;for(let u=0;u<o&&f>0;u++)n[u]===p&&(n[u]=p+1,f-=g)}}for(d=m();d<c;){let f=!1;for(let p=0;p<o;p++)if(n[p]===t){n[p]--,d++,f=!0;break}if(!f)break}}return n}function so(e){let t=Math.max(...e),o=new Uint32Array(t+1);for(let a of e)a>0&&o[a]++;let n=new Uint32Array(t+1),s=0;for(let a=1;a<=t;a++)s=s+o[a-1]<<1,n[a]=s;let r=new Uint32Array(e.length);for(let a=0;a<e.length;a++)e[a]>0&&(r[a]=n[e[a]]++);return r}function he(e,t){let o=0;for(let n=0;n<t;n++)o=o<<1|e&1,e>>=1;return o}function wr(){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}function br(){let e=new Uint8Array(32);return e.fill(5),e}var Cr=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],Fr=[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,0,0],vr=[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],Sr=[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],Yo=new Array(259);for(let e=0;e<29;e++){let t=Fr[e],o=Cr[e];for(let n=t;n<t+(1<<o);n++)n<=258&&(Yo[n]=[257+e,o,n-t])}Yo[258]=[285,0,0];function _n(e){return Yo[e]}var Xn=new Array(32769);for(let e=0;e<30;e++){let t=Sr[e],o=vr[e];for(let n=t;n<t+(1<<o);n++)n<=32768&&(Xn[n]=[e,o,n-t])}function jn(e){return Xn[e]}var ce=32768,Ko=258,On=3,Ir=8,Tr=32,kr=128;function Ar(e,t){let o=t<=1?Ir:t<=6?Tr:kr,n=e.length,s=Math.min(n+1,65536),r=new Uint16Array(s),a=new Uint16Array(s),i=0,l=()=>{if(i>=s){s=s*2;let u=new Uint16Array(s);u.set(r),r=u;let $=new Uint16Array(s);$.set(a),a=$}},h=65536,m=new Int32Array(h).fill(-1),c=new Int32Array(Math.min(n,ce)).fill(-1),d=u=>((e[u]*4129^e[u+1]*155^e[u+2])&h-1)>>>0,f=0,p=u=>{l(),r[i]=u+1,a[i]=0,i++},g=(u,$)=>{l(),r[i]=u,a[i]=$,i++};for(;f<n;){if(f+2>=n){p(e[f++]);continue}let u=d(f),$=On-1,x=0,b=m[u],C=0;for(;b>=0&&C<o;){let y=f-b;if(y>ce)break;let v=0,w=Math.min(Ko,n-f);for(;v<w&&e[b+v]===e[f+v];)v++;if(v>$&&($=v,x=y),$===Ko)break;b=c[b&ce-1],C++}if(c[f&ce-1]=m[u],m[u]=f,$>=On){if(t>=6&&f+3<n){let y=d(f+1),v=m[y],w=0,k=0,T=0;for(;v>=0&&T<o;){let S=f+1-v;if(S>ce)break;let D=0,R=Math.min(Ko,n-f-1);for(;D<R&&e[v+D]===e[f+1+D];)D++;D>w&&(w=D,k=S),v=c[v&ce-1],T++}if(w>$+1){p(e[f]),f++,c[f&ce-1]=m[y],m[y]=f,g(w,k);for(let S=1;S<w;S++)if(f++,f+2<n){let D=d(f);c[f&ce-1]=m[D],m[D]=f}f++;continue}}g($,x);for(let y=0;y<$;y++)if(f+y+2<n){let v=d(f+y);c[f+y&ce-1]=m[v],m[v]=f+y}f+=$}else p(e[f++])}return{litLen:r,dist:a,count:i}}function Dr(e,t,o,n){let s=0;for(;s<e.length;){let r=e[s];if(r===0){let a=0;for(;s+a<e.length&&e[s+a]===0&&a<138;)a++;a<3?(t.writeBits(he(o[0],n[0]),n[0]),s++):a<=10?(t.writeBits(he(o[17],n[17]),n[17]),t.writeBits(a-3,3),s+=a):(t.writeBits(he(o[18],n[18]),n[18]),t.writeBits(a-11,7),s+=a)}else{t.writeBits(he(o[r],n[r]),n[r]),s++;let a=0;for(;s+a<e.length&&e[s+a]===r&&a<6;)a++;a>=3&&(t.writeBits(he(o[16],n[16]),n[16]),t.writeBits(a-3,2),s+=a)}}}function Ln(e,t,o,n){let s=new Uint32Array(286),r=new Uint32Array(30);s[256]=1;let{litLen:a,dist:i,count:l}=e;for(let p=0;p<l;p++)if(i[p]===0)s[a[p]-1]++;else{let[g]=_n(a[p]);s[g]++;let[u]=jn(i[p]);r[u]++}let h,m,c,d;if(n){h=qo(s,15),m=qo(r,15),m.every(v=>v===0)&&(m[0]=1),c=so(h),d=so(m);let p=Nn(h,257,286)+1,g=Nn(m,1,30)+1,u=[...h.subarray(0,p),...m.subarray(0,g)],$=new Uint32Array(19);Pr(u,$);let x=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],b=qo($,7),C=so(b),y=Rr(x.map(v=>b[v]),4,19)+1;t.writeBits(o?1:0,1),t.writeBits(2,2),t.writeBits(p-257,5),t.writeBits(g-1,5),t.writeBits(y-4,4);for(let v=0;v<y;v++)t.writeBits(b[x[v]],3);Dr(u,t,C,b)}else h=wr(),m=br(),c=so(h),d=so(m),t.writeBits(o?1:0,1),t.writeBits(1,2);for(let p=0;p<l;p++)if(i[p]===0){let g=a[p]-1,u=h[g];t.writeBits(he(c[g],u),u)}else{let[g,u,$]=_n(a[p]),x=h[g];t.writeBits(he(c[g],x),x),u>0&&t.writeBits($,u);let[b,C,y]=jn(i[p]),v=m[b];t.writeBits(he(d[b],v),v),C>0&&t.writeBits(y,C)}let f=h[256];t.writeBits(he(c[256],f),f)}function Nn(e,t,o){let n=t-1;for(let s=t;s<Math.min(e.length,o);s++)e[s]>0&&(n=s);return Math.max(n,t-1)}function Rr(e,t,o){let n=t-1;for(let s=t;s<Math.min(e.length,o);s++)e[s]>0&&(n=s);return Math.max(n,t-1)}function Pr(e,t){let o=0;for(;o<e.length;){let n=e[o];if(n===0){let s=0;for(;o+s<e.length&&e[o+s]===0&&s<138;)s++;s<3?(t[0]++,o++):s<=10?(t[17]++,o+=s):(t[18]++,o+=s)}else{t[n]++,o++;let s=0;for(;o+s<e.length&&e[o+s]===n&&s<6;)s++;s>=3&&(t[16]++,o+=s)}}}var Zo=65536;function Qo(e,t=6){if(t===0){let a=new bo,i=0;for(;i<e.length||e.length===0;){let l=Math.min(Zo,e.length-i),h=i+l>=e.length;a.flush(),a.writeBits(h?1:0,1),a.writeBits(0,2),a.flush();let m=l;for(a.writeByte(m&255),a.writeByte(m>>8&255),a.writeByte(~m&255),a.writeByte(~m>>8&255);a.pos+l>a.buf.length;)a.buf=(()=>{let c=new Uint8Array(a.buf.length*2);return c.set(a.buf),c})();if(a.buf.set(e.subarray(i,i+l),a.pos),a.pos+=l,i+=l,e.length===0)break}return a.toBytes()}let o=Math.max(1,Math.min(9,t)),n=o>=2,s=new bo,r=0;for(;r<e.length||e.length===0;){let a=e.subarray(r,r+Zo),i=r+Zo>=e.length,l=Ar(a,o);if(Ln(l,s,i,n),r+=a.length,e.length===0){Ln({litLen:new Uint16Array(0),dist:new Uint16Array(0),count:0},s,!0,n);break}}return s.flush(),s.toBytes()}function Mt(e,t,o){e[t]=o&255,e[t+1]=o>>8&255}function Qt(e,t,o){e[t]=o&255,e[t+1]=o>>8&255,e[t+2]=o>>16&255,e[t+3]=o>>24&255}var Mr=new TextEncoder,Er=new Set(["png","jpg","jpeg","gif","tiff","emf","wmf","bmp","webp"]);function Jo(e,t={}){let o=t.level??6,n=t.noCompress?new Set(t.noCompress.map(p=>p.toLowerCase())):Er,s=[],r=[],a=0;for(let p of e){let g=Mr.encode(p.name),u=p.name.split(".").pop()?.toLowerCase()??"",$=p.level??(n.has(u)?0:o),x=$>0&&p.data.length>0,b=yr(p.data),C,y;x?(C=Qo(p.data,$),C.length>=p.data.length?(C=p.data,y=0):y=8):(C=p.data,y=0);let v=new Uint8Array(30+g.length);Qt(v,0,67324752),Mt(v,4,20),Mt(v,6,0),Mt(v,8,y),Mt(v,10,0),Mt(v,12,0),Qt(v,14,b),Qt(v,18,C.length),Qt(v,22,p.data.length),Mt(v,26,g.length),Mt(v,28,0),v.set(g,30);let w=new Uint8Array(46+g.length);Qt(w,0,33639248),Mt(w,4,20),Mt(w,6,20),Mt(w,8,0),Mt(w,10,y),Mt(w,12,0),Mt(w,14,0),Qt(w,16,b),Qt(w,20,C.length),Qt(w,24,p.data.length),Mt(w,28,g.length),Mt(w,30,0),Mt(w,32,0),Mt(w,34,0),Mt(w,36,0),Qt(w,38,0),Qt(w,42,a),w.set(g,46),s.push(v,C),r.push(w),a+=v.length+C.length}let i=a,l=r.reduce((p,g)=>p+g.length,0),h=new Uint8Array(22);Qt(h,0,101010256),Mt(h,4,0),Mt(h,6,0),Mt(h,8,r.length),Mt(h,10,r.length),Qt(h,12,l),Qt(h,16,i),Mt(h,20,0);let m=[...s,...r,h],c=m.reduce((p,g)=>p+g.length,0),d=new Uint8Array(c),f=0;for(let p of m)d.set(p,f),f+=p.length;return d}function Ae(e,t){return e[t]|e[t+1]<<8}function Ve(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function Br(e){let t=new DecompressionStream("deflate-raw"),o=t.writable.getWriter(),n=t.readable.getReader();o.write(e),o.close();let s=[],r=!1;for(;!r;){let{value:h,done:m}=await n.read();h&&s.push(h),r=m}let a=s.reduce((h,m)=>h+m.length,0),i=new Uint8Array(a),l=0;for(let h of s)i.set(h,l),l+=h.length;return i}async function tn(e){let t=new TextDecoder("utf-8"),o=new Map,n=-1;for(let i=e.length-22;i>=0;i--)if(e[i]===80&&e[i+1]===75&&e[i+2]===5&&e[i+3]===6){n=i;break}if(n<0)throw new Error("Not a valid ZIP file (EOCD not found)");let s=Ve(e,n+16),r=Ae(e,n+8),a=s;for(let i=0;i<r;i++){if(Ve(e,a)!==33639248)throw new Error("Invalid central directory entry");let l=Ae(e,a+10),h=Ve(e,a+20),m=Ve(e,a+24),c=Ae(e,a+28),d=Ae(e,a+30),f=Ae(e,a+32),p=Ve(e,a+42),g=e.subarray(a+46,a+46+c),u=t.decode(g);a+=46+c+d+f;let $=p;if(Ve(e,$)!==67324752)throw new Error("Invalid local file header");let x=Ae(e,$+26),b=Ae(e,$+28),C=$+30+x+b,y=e.subarray(C,C+h),v;l===0?v=y.slice():l===8?v=await Br(y):v=y.slice(),u.endsWith("/")||o.set(u,{name:u,data:v})}return o}function Co(e){return new TextDecoder("utf-8").decode(e.data)}function ro(e){let t=Object.entries(e.attrs).map(([s,r])=>`${s}="${_r(r)}"`).join(" "),o=t?`<${e.tag} ${t}`:`<${e.tag}`,n=(e.text??"")+e.children.map(ro).join("");return n?`${o}>${n}</${e.tag}>`:`${o}/>`}function _r(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Lt(e){let t=[],o=[],n=0;for(e.startsWith("<?")&&(n=e.indexOf("?>")+2);n<e.length;){if(e[n]!=="<"){let c=e.indexOf("<",n),d=c<0?e.slice(n):e.slice(n,c);if(o.length&&d.trim()){let f=o[o.length-1];f.text=(f.text??"")+Un(d)}n=c<0?e.length:c;continue}if(e.startsWith("<!--",n)){let c=e.indexOf("-->",n);if(o.length){let d=o[o.length-1];d.text=(d.text??"")+e.slice(n,c+3)}n=c+3;continue}if(e.startsWith("<![CDATA[",n)){let c=e.indexOf("]]>",n),d=e.slice(n+9,c);if(o.length){let f=o[o.length-1];f.text=(f.text??"")+d}n=c+3;continue}if(e[n+1]==="/"){let c=e.indexOf(">",n),d=o.pop();o.length?o[o.length-1].children.push(d):t.push(d),n=c+1;continue}if(e[n+1]==="?"){n=e.indexOf("?>",n)+2;continue}let s=jr(e,n),r=e.slice(n+1,s),a=r.endsWith("/"),i=a?r.slice(0,-1).trim():r.trim(),{tag:l,attrs:h}=Or(i),m={tag:l,attrs:h,children:[]};a?o.length?o[o.length-1].children.push(m):t.push(m):o.push(m),n=s+1}for(;o.length>1;){let s=o.pop();o[o.length-1].children.push(s)}if(o.length===1&&t.push(o[0]),t.length===0)throw new Error("Empty XML document");return t[0]}function jr(e,t){let o=null;for(let n=t+1;n<e.length;n++){let s=e[n];if(o)s===o&&(o=null);else if(s==='"'||s==="'")o=s;else if(s===">")return n}return e.length-1}function Or(e){let t={},o=e.search(/\s/),n=o<0?e:e.slice(0,o);if(o<0)return{tag:n,attrs:t};let s=e.slice(o),r=/(\S+?)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,a;for(;(a=r.exec(s))!==null;)t[a[1]]=Un(a[2]??a[3]??"");return{tag:n,attrs:t}}function Un(e){return e.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&#(\d+);/g,(t,o)=>String.fromCharCode(parseInt(o,10))).replace(/&#x([0-9a-fA-F]+);/g,(t,o)=>String.fromCharCode(parseInt(o,16)))}function B(e,t){return e.children.find(o=>ct(o.tag)===t)}function ut(e,t){return e.children.filter(o=>ct(o.tag)===t)}function Vn(e,t){if(e.attrs[t]!==void 0)return e.attrs[t];let o=ct(t);for(let[n,s]of Object.entries(e.attrs))if(ct(n)===o)return s}function ct(e){let t=e.indexOf(":");return t<0?e:e.slice(t+1)}function Lr(e){return e.toISOString()}function en(e){let t=(n,s)=>s!==void 0?`<${n}>${I(s)}</${n}>`:"",o=(n,s)=>s?`<${n} xsi:type="dcterms:W3CDTF">${Lr(s)}</${n}>`:"";return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
199
+ </table>`}var no=null;function cr(){if(no)return no;no=new Uint32Array(256);for(let e=0;e<256;e++){let t=e;for(let o=0;o<8;o++)t=t&1?3988292384^t>>>1:t>>>1;no[e]=t}return no}function hr(e){let t=cr(),o=4294967295;for(let n=0;n<e.length;n++)o=o>>>8^t[(o^e[n])&255];return(o^4294967295)>>>0}var $o=class{constructor(t=65536){this.pos=0,this.bits=0,this.bitLen=0,this.buf=new Uint8Array(t)}grow(){let t=new Uint8Array(this.buf.length*2);t.set(this.buf),this.buf=t}writeBits(t,o){for(this.bits|=(t&(1<<o)-1)<<this.bitLen,this.bitLen+=o;this.bitLen>=8;)this.pos>=this.buf.length&&this.grow(),this.buf[this.pos++]=this.bits&255,this.bits>>>=8,this.bitLen-=8}writeByte(t){this.pos>=this.buf.length&&this.grow(),this.buf[this.pos++]=t}flush(){this.bitLen>0&&(this.writeByte(this.bits&255),this.bits=0,this.bitLen=0)}toBytes(){return this.buf.subarray(0,this.pos)}};function Go(e,t){let o=e.length,n=new Uint8Array(o),s=[];for(let m=0;m<o;m++)e[m]>0&&s.push(m);if(s.length===0)return n;if(s.length===1)return n[s[0]]=1,n;let r=s.map(m=>({freq:e[m],sym:m})),a=(m,c,d)=>{for(;;){let f=c,p=2*c+1,g=2*c+2;if(p<d&&m[p].freq<m[f].freq&&(f=p),g<d&&m[g].freq<m[f].freq&&(f=g),f===c)break;let u=m[c];m[c]=m[f],m[f]=u,c=f}},i=(m,c)=>{for(;c>0;){let d=c-1>>1;if(m[d].freq<=m[c].freq)break;let f=m[c];m[c]=m[d],m[d]=f,c=d}};for(let m=(r.length>>1)-1;m>=0;m--)a(r,m,r.length);let l=r.length;for(;l>1;){let m=r[0];r[0]=r[--l],a(r,0,l);let c=r[0];r[0]={freq:m.freq+c.freq,sym:-1,left:m,right:c},a(r,0,l)}let h=(m,c)=>{if(m){if(m.sym>=0){n[m.sym]=Math.min(c,t);return}h(m.left,c+1),h(m.right,c+1)}};h(r[0],0);{let m=()=>{let f=0;for(let p=0;p<o;p++)n[p]>0&&(f+=1<<t-n[p]);return f},c=1<<t,d=m();if(d>c){let f=d-c;for(let p=t-1;p>=1&&f>0;p--){let g=1<<t-p-1;for(let u=0;u<o&&f>0;u++)n[u]===p&&(n[u]=p+1,f-=g)}}for(d=m();d<c;){let f=!1;for(let p=0;p<o;p++)if(n[p]===t){n[p]--,d++,f=!0;break}if(!f)break}}return n}function so(e){let t=Math.max(...e),o=new Uint32Array(t+1);for(let a of e)a>0&&o[a]++;let n=new Uint32Array(t+1),s=0;for(let a=1;a<=t;a++)s=s+o[a-1]<<1,n[a]=s;let r=new Uint32Array(e.length);for(let a=0;a<e.length;a++)e[a]>0&&(r[a]=n[e[a]]++);return r}function me(e,t){let o=0;for(let n=0;n<t;n++)o=o<<1|e&1,e>>=1;return o}function mr(){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}function dr(){let e=new Uint8Array(32);return e.fill(5),e}var fr=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],pr=[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,0,0],ur=[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],gr=[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],Zo=new Array(259);for(let e=0;e<29;e++){let t=pr[e],o=fr[e];for(let n=t;n<t+(1<<o);n++)n<=258&&(Zo[n]=[257+e,o,n-t])}Zo[258]=[285,0,0];function Dn(e){return Zo[e]}var Bn=new Array(32769);for(let e=0;e<30;e++){let t=gr[e],o=ur[e];for(let n=t;n<t+(1<<o);n++)n<=32768&&(Bn[n]=[e,o,n-t])}function Rn(e){return Bn[e]}var he=32768,qo=258,Pn=3,xr=8,$r=32,yr=128;function wr(e,t){let o=t<=1?xr:t<=6?$r:yr,n=e.length,s=Math.min(n+1,65536),r=new Uint16Array(s),a=new Uint16Array(s),i=0,l=()=>{if(i>=s){s=s*2;let u=new Uint16Array(s);u.set(r),r=u;let $=new Uint16Array(s);$.set(a),a=$}},h=65536,m=new Int32Array(h).fill(-1),c=new Int32Array(Math.min(n,he)).fill(-1),d=u=>((e[u]*4129^e[u+1]*155^e[u+2])&h-1)>>>0,f=0,p=u=>{l(),r[i]=u+1,a[i]=0,i++},g=(u,$)=>{l(),r[i]=u,a[i]=$,i++};for(;f<n;){if(f+2>=n){p(e[f++]);continue}let u=d(f),$=Pn-1,x=0,b=m[u],C=0;for(;b>=0&&C<o;){let y=f-b;if(y>he)break;let v=0,w=Math.min(qo,n-f);for(;v<w&&e[b+v]===e[f+v];)v++;if(v>$&&($=v,x=y),$===qo)break;b=c[b&he-1],C++}if(c[f&he-1]=m[u],m[u]=f,$>=Pn){if(t>=6&&f+3<n){let y=d(f+1),v=m[y],w=0,k=0,T=0;for(;v>=0&&T<o;){let S=f+1-v;if(S>he)break;let D=0,R=Math.min(qo,n-f-1);for(;D<R&&e[v+D]===e[f+1+D];)D++;D>w&&(w=D,k=S),v=c[v&he-1],T++}if(w>$+1){p(e[f]),f++,c[f&he-1]=m[y],m[y]=f,g(w,k);for(let S=1;S<w;S++)if(f++,f+2<n){let D=d(f);c[f&he-1]=m[D],m[D]=f}f++;continue}}g($,x);for(let y=0;y<$;y++)if(f+y+2<n){let v=d(f+y);c[f+y&he-1]=m[v],m[v]=f+y}f+=$}else p(e[f++])}return{litLen:r,dist:a,count:i}}function br(e,t,o,n){let s=0;for(;s<e.length;){let r=e[s];if(r===0){let a=0;for(;s+a<e.length&&e[s+a]===0&&a<138;)a++;a<3?(t.writeBits(me(o[0],n[0]),n[0]),s++):a<=10?(t.writeBits(me(o[17],n[17]),n[17]),t.writeBits(a-3,3),s+=a):(t.writeBits(me(o[18],n[18]),n[18]),t.writeBits(a-11,7),s+=a)}else{t.writeBits(me(o[r],n[r]),n[r]),s++;let a=0;for(;s+a<e.length&&e[s+a]===r&&a<6;)a++;a>=3&&(t.writeBits(me(o[16],n[16]),n[16]),t.writeBits(a-3,2),s+=a)}}}function Mn(e,t,o,n){let s=new Uint32Array(286),r=new Uint32Array(30);s[256]=1;let{litLen:a,dist:i,count:l}=e;for(let p=0;p<l;p++)if(i[p]===0)s[a[p]-1]++;else{let[g]=Dn(a[p]);s[g]++;let[u]=Rn(i[p]);r[u]++}let h,m,c,d;if(n){h=Go(s,15),m=Go(r,15),m.every(v=>v===0)&&(m[0]=1),c=so(h),d=so(m);let p=En(h,257,286)+1,g=En(m,1,30)+1,u=[...h.subarray(0,p),...m.subarray(0,g)],$=new Uint32Array(19);Fr(u,$);let x=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],b=Go($,7),C=so(b),y=Cr(x.map(v=>b[v]),4,19)+1;t.writeBits(o?1:0,1),t.writeBits(2,2),t.writeBits(p-257,5),t.writeBits(g-1,5),t.writeBits(y-4,4);for(let v=0;v<y;v++)t.writeBits(b[x[v]],3);br(u,t,C,b)}else h=mr(),m=dr(),c=so(h),d=so(m),t.writeBits(o?1:0,1),t.writeBits(1,2);for(let p=0;p<l;p++)if(i[p]===0){let g=a[p]-1,u=h[g];t.writeBits(me(c[g],u),u)}else{let[g,u,$]=Dn(a[p]),x=h[g];t.writeBits(me(c[g],x),x),u>0&&t.writeBits($,u);let[b,C,y]=Rn(i[p]),v=m[b];t.writeBits(me(d[b],v),v),C>0&&t.writeBits(y,C)}let f=h[256];t.writeBits(me(c[256],f),f)}function En(e,t,o){let n=t-1;for(let s=t;s<Math.min(e.length,o);s++)e[s]>0&&(n=s);return Math.max(n,t-1)}function Cr(e,t,o){let n=t-1;for(let s=t;s<Math.min(e.length,o);s++)e[s]>0&&(n=s);return Math.max(n,t-1)}function Fr(e,t){let o=0;for(;o<e.length;){let n=e[o];if(n===0){let s=0;for(;o+s<e.length&&e[o+s]===0&&s<138;)s++;s<3?(t[0]++,o++):s<=10?(t[17]++,o+=s):(t[18]++,o+=s)}else{t[n]++,o++;let s=0;for(;o+s<e.length&&e[o+s]===n&&s<6;)s++;s>=3&&(t[16]++,o+=s)}}}var Ko=65536;function Yo(e,t=6){if(t===0){let a=new $o,i=0;for(;i<e.length||e.length===0;){let l=Math.min(Ko,e.length-i),h=i+l>=e.length;a.flush(),a.writeBits(h?1:0,1),a.writeBits(0,2),a.flush();let m=l;for(a.writeByte(m&255),a.writeByte(m>>8&255),a.writeByte(~m&255),a.writeByte(~m>>8&255);a.pos+l>a.buf.length;)a.buf=(()=>{let c=new Uint8Array(a.buf.length*2);return c.set(a.buf),c})();if(a.buf.set(e.subarray(i,i+l),a.pos),a.pos+=l,i+=l,e.length===0)break}return a.toBytes()}let o=Math.max(1,Math.min(9,t)),n=o>=2,s=new $o,r=0;for(;r<e.length||e.length===0;){let a=e.subarray(r,r+Ko),i=r+Ko>=e.length,l=wr(a,o);if(Mn(l,s,i,n),r+=a.length,e.length===0){Mn({litLen:new Uint16Array(0),dist:new Uint16Array(0),count:0},s,!0,n);break}}return s.flush(),s.toBytes()}function Mt(e,t,o){e[t]=o&255,e[t+1]=o>>8&255}function Qt(e,t,o){e[t]=o&255,e[t+1]=o>>8&255,e[t+2]=o>>16&255,e[t+3]=o>>24&255}var vr=new TextEncoder,Sr=new Set(["png","jpg","jpeg","gif","tiff","emf","wmf","bmp","webp"]);function Qo(e,t={}){let o=t.level??6,n=t.noCompress?new Set(t.noCompress.map(p=>p.toLowerCase())):Sr,s=[],r=[],a=0;for(let p of e){let g=vr.encode(p.name),u=p.name.split(".").pop()?.toLowerCase()??"",$=p.level??(n.has(u)?0:o),x=$>0&&p.data.length>0,b=hr(p.data),C,y;x?(C=Yo(p.data,$),C.length>=p.data.length?(C=p.data,y=0):y=8):(C=p.data,y=0);let v=new Uint8Array(30+g.length);Qt(v,0,67324752),Mt(v,4,20),Mt(v,6,0),Mt(v,8,y),Mt(v,10,0),Mt(v,12,0),Qt(v,14,b),Qt(v,18,C.length),Qt(v,22,p.data.length),Mt(v,26,g.length),Mt(v,28,0),v.set(g,30);let w=new Uint8Array(46+g.length);Qt(w,0,33639248),Mt(w,4,20),Mt(w,6,20),Mt(w,8,0),Mt(w,10,y),Mt(w,12,0),Mt(w,14,0),Qt(w,16,b),Qt(w,20,C.length),Qt(w,24,p.data.length),Mt(w,28,g.length),Mt(w,30,0),Mt(w,32,0),Mt(w,34,0),Mt(w,36,0),Qt(w,38,0),Qt(w,42,a),w.set(g,46),s.push(v,C),r.push(w),a+=v.length+C.length}let i=a,l=r.reduce((p,g)=>p+g.length,0),h=new Uint8Array(22);Qt(h,0,101010256),Mt(h,4,0),Mt(h,6,0),Mt(h,8,r.length),Mt(h,10,r.length),Qt(h,12,l),Qt(h,16,i),Mt(h,20,0);let m=[...s,...r,h],c=m.reduce((p,g)=>p+g.length,0),d=new Uint8Array(c),f=0;for(let p of m)d.set(p,f),f+=p.length;return d}Wt();function Ae(e,t){return e[t]|e[t+1]<<8}function Ue(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function Ir(e){let t=new DecompressionStream("deflate-raw"),o=t.writable.getWriter(),n=t.readable.getReader();o.write(e),o.close();let s=[],r=!1;for(;!r;){let{value:h,done:m}=await n.read();h&&s.push(h),r=m}let a=s.reduce((h,m)=>h+m.length,0),i=new Uint8Array(a),l=0;for(let h of s)i.set(h,l),l+=h.length;return i}async function Jo(e){let t=new TextDecoder("utf-8"),o=new Map,n=-1;for(let i=e.length-22;i>=0;i--)if(e[i]===80&&e[i+1]===75&&e[i+2]===5&&e[i+3]===6){n=i;break}if(n<0)throw new Error("Not a valid ZIP file (EOCD not found)");let s=Ue(e,n+16),r=Ae(e,n+8),a=s;for(let i=0;i<r;i++){if(Ue(e,a)!==33639248)throw new Error("Invalid central directory entry");let l=Ae(e,a+10),h=Ue(e,a+20),m=Ue(e,a+24),c=Ae(e,a+28),d=Ae(e,a+30),f=Ae(e,a+32),p=Ue(e,a+42),g=e.subarray(a+46,a+46+c),u=t.decode(g);a+=46+c+d+f;let $=p;if(Ue(e,$)!==67324752)throw new Error("Invalid local file header");let x=Ae(e,$+26),b=Ae(e,$+28),C=$+30+x+b,y=e.subarray(C,C+h),v;l===0?v=y.slice():l===8?v=await Ir(y):v=y.slice(),u.endsWith("/")||o.set(u,{name:u,data:v})}return o}function yo(e){return new TextDecoder("utf-8").decode(e.data)}function ro(e){let t=Object.entries(e.attrs).map(([s,r])=>`${s}="${Tr(r)}"`).join(" "),o=t?`<${e.tag} ${t}`:`<${e.tag}`,n=(e.text??"")+e.children.map(ro).join("");return n?`${o}>${n}</${e.tag}>`:`${o}/>`}function Tr(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Lt(e){let t=[],o=[],n=0;for(e.startsWith("<?")&&(n=e.indexOf("?>")+2);n<e.length;){if(e[n]!=="<"){let c=e.indexOf("<",n),d=c<0?e.slice(n):e.slice(n,c);if(o.length&&d.trim()){let f=o[o.length-1];f.text=(f.text??"")+_n(d)}n=c<0?e.length:c;continue}if(e.startsWith("<!--",n)){let c=e.indexOf("-->",n);if(o.length){let d=o[o.length-1];d.text=(d.text??"")+e.slice(n,c+3)}n=c+3;continue}if(e.startsWith("<![CDATA[",n)){let c=e.indexOf("]]>",n),d=e.slice(n+9,c);if(o.length){let f=o[o.length-1];f.text=(f.text??"")+d}n=c+3;continue}if(e[n+1]==="/"){let c=e.indexOf(">",n),d=o.pop();o.length?o[o.length-1].children.push(d):t.push(d),n=c+1;continue}if(e[n+1]==="?"){n=e.indexOf("?>",n)+2;continue}let s=kr(e,n),r=e.slice(n+1,s),a=r.endsWith("/"),i=a?r.slice(0,-1).trim():r.trim(),{tag:l,attrs:h}=Ar(i),m={tag:l,attrs:h,children:[]};a?o.length?o[o.length-1].children.push(m):t.push(m):o.push(m),n=s+1}for(;o.length>1;){let s=o.pop();o[o.length-1].children.push(s)}if(o.length===1&&t.push(o[0]),t.length===0)throw new Error("Empty XML document");return t[0]}function kr(e,t){let o=null;for(let n=t+1;n<e.length;n++){let s=e[n];if(o)s===o&&(o=null);else if(s==='"'||s==="'")o=s;else if(s===">")return n}return e.length-1}function Ar(e){let t={},o=e.search(/\s/),n=o<0?e:e.slice(0,o);if(o<0)return{tag:n,attrs:t};let s=e.slice(o),r=/(\S+?)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,a;for(;(a=r.exec(s))!==null;)t[a[1]]=_n(a[2]??a[3]??"");return{tag:n,attrs:t}}function _n(e){return e.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&#(\d+);/g,(t,o)=>String.fromCharCode(parseInt(o,10))).replace(/&#x([0-9a-fA-F]+);/g,(t,o)=>String.fromCharCode(parseInt(o,16)))}function B(e,t){return e.children.find(o=>ct(o.tag)===t)}function ut(e,t){return e.children.filter(o=>ct(o.tag)===t)}function jn(e,t){if(e.attrs[t]!==void 0)return e.attrs[t];let o=ct(t);for(let[n,s]of Object.entries(e.attrs))if(ct(n)===o)return s}function ct(e){let t=e.indexOf(":");return t<0?e:e.slice(t+1)}Wt();function Dr(e){return e.toISOString()}function tn(e){let t=(n,s)=>s!==void 0?`<${n}>${I(s)}</${n}>`:"",o=(n,s)=>s?`<${n} xsi:type="dcterms:W3CDTF">${Dr(s)}</${n}>`:"";return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
200
200
  <cp:coreProperties
201
201
  xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
202
202
  xmlns:dc="http://purl.org/dc/elements/1.1/"
@@ -216,7 +216,7 @@ ${t("cp:category",e.category)}
216
216
  ${t("cp:contentStatus",e.contentStatus)}
217
217
  ${o("dcterms:created",e.created??new Date)}
218
218
  ${o("dcterms:modified",e.modified??new Date)}
219
- </cp:coreProperties>`}function on(e,t){let o=(r,a)=>a!==void 0?`<${r}>${I(String(a))}</${r}>`:"",n="",s="";if(e.headingPairs?.length){let r=e.headingPairs.map(a=>`<vt:variant><vt:lpstr>${I(a.name)}</vt:lpstr></vt:variant><vt:variant><vt:i4>${a.count}</vt:i4></vt:variant>`).join("");n=`<HeadingPairs><vt:vector size="${e.headingPairs.length*2}" baseType="variant">${r}</vt:vector></HeadingPairs>`}if(e.titlesOfParts?.length){let r=e.titlesOfParts.map(a=>`<vt:lpstr>${I(a)}</vt:lpstr>`).join("");s=`<TitlesOfParts><vt:vector size="${e.titlesOfParts.length}" baseType="lpstr">${r}</vt:vector></TitlesOfParts>`}return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
219
+ </cp:coreProperties>`}function en(e,t){let o=(r,a)=>a!==void 0?`<${r}>${I(String(a))}</${r}>`:"",n="",s="";if(e.headingPairs?.length){let r=e.headingPairs.map(a=>`<vt:variant><vt:lpstr>${I(a.name)}</vt:lpstr></vt:variant><vt:variant><vt:i4>${a.count}</vt:i4></vt:variant>`).join("");n=`<HeadingPairs><vt:vector size="${e.headingPairs.length*2}" baseType="variant">${r}</vt:vector></HeadingPairs>`}if(e.titlesOfParts?.length){let r=e.titlesOfParts.map(a=>`<vt:lpstr>${I(a)}</vt:lpstr>`).join("");s=`<TitlesOfParts><vt:vector size="${e.titlesOfParts.length}" baseType="lpstr">${r}</vt:vector></TitlesOfParts>`}return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
220
220
  <Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
221
221
  xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
222
222
  ${o("Application",e.application??"ExcelForge")}
@@ -245,13 +245,13 @@ ${o("HyperlinkBase",e.hyperlinkBase)}
245
245
  ${n}
246
246
  ${s}
247
247
  ${t??""}
248
- </Properties>`}function nn(e){let t=2;return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
248
+ </Properties>`}function on(e){let t=2;return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
249
249
  <Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
250
250
  xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
251
251
  ${e.map(n=>{let s,r=n.value;switch(r.type){case"string":s=`<vt:lpwstr>${I(r.value)}</vt:lpwstr>`;break;case"int":s=`<vt:i4>${r.value}</vt:i4>`;break;case"decimal":s=`<vt:decimal>${r.value}</vt:decimal>`;break;case"bool":s=`<vt:bool>${r.value}</vt:bool>`;break;case"date":s=`<vt:filetime>${r.value.toISOString()}</vt:filetime>`;break;case"r8":s=`<vt:r8>${r.value}</vt:r8>`;break;case"i8":s=`<vt:i8>${r.value}</vt:i8>`;break;case"error":s=`<vt:error>${I(r.value)}</vt:error>`;break;default:s="<vt:lpwstr></vt:lpwstr>";break}return`<property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="${t++}" name="${I(n.name)}">${s}</property>`}).join(`
252
252
  `)}
253
- </Properties>`}function Wn(e){let t=Lt(e),o=s=>{let r=t.children.find(a=>ct(a.tag)===s);return r?.text??r?.children[0]?.text},n=s=>{let r=o(s);return r?new Date(r):void 0};return{title:o("title"),subject:o("subject"),creator:o("creator"),keywords:o("keywords"),description:o("description"),lastModifiedBy:o("lastModifiedBy"),revision:o("revision"),created:n("created"),modified:n("modified"),category:o("category"),contentStatus:o("contentStatus"),language:o("language"),identifier:o("identifier"),version:o("version")}}function Hn(e){let t=Lt(e),o=d=>t.children.find(f=>ct(f.tag)===d)?.text,n=d=>{let f=o(d);return f!==void 0?Number(f):void 0},s=d=>{let f=o(d);return f!==void 0?f==="true"||f==="1":void 0},r,a=t.children.find(d=>ct(d.tag)==="HeadingPairs");if(a){let d=a.children[0];if(d){let f=d.children.filter(p=>ct(p.tag)==="variant");r=[];for(let p=0;p<f.length-1;p+=2){let g=f[p].children[0],u=f[p+1].children[0];r.push({name:g?.text??"",count:parseInt(u?.text??"0",10)})}}}let i,l=t.children.find(d=>ct(d.tag)==="TitlesOfParts");if(l){let d=l.children[0];d&&(i=d.children.map(f=>f.text??""))}let h=new Set(["Application","AppVersion","Company","Manager","DocSecurity","ScaleCrop","LinksUpToDate","SharedDoc","HyperlinksChanged","Characters","CharactersWithSpaces","Words","Lines","Paragraphs","Pages","Slides","Notes","HiddenSlides","MMClips","Template","PresentationFormat","TotalTime","HyperlinkBase","HeadingPairs","TitlesOfParts"]),c=t.children.filter(d=>!h.has(ct(d.tag))).map(d=>{let f=Object.entries(d.attrs).map(([g,u])=>` ${g}="${u}"`).join(""),p=d.text??"";return!p&&!d.children.length?`<${d.tag}${f}/>`:`<${d.tag}${f}>${p}</${d.tag}>`}).join(`
254
- `);return{props:{application:o("Application"),appVersion:o("AppVersion"),company:o("Company"),manager:o("Manager"),docSecurity:n("DocSecurity"),scaleCrop:s("ScaleCrop"),linksUpToDate:s("LinksUpToDate"),sharedDoc:s("SharedDoc"),hyperlinksChanged:s("HyperlinksChanged"),characters:n("Characters"),charactersByWord:n("CharactersWithSpaces"),words:n("Words"),lines:n("Lines"),paragraphs:n("Paragraphs"),pages:n("Pages"),slides:n("Slides"),notes:n("Notes"),hiddenSlides:n("HiddenSlides"),mmClips:n("MMClips"),template:o("Template"),presentationFormat:o("PresentationFormat"),totalTime:n("TotalTime"),hyperlinkBase:o("HyperlinkBase"),headingPairs:r,titlesOfParts:i},unknownRaw:c}}function zn(e){return Lt(e).children.filter(o=>ct(o.tag)==="property").map(o=>{let n=o.attrs.name??"",s=o.children[0];if(!s)return null;let r=ct(s.tag),a=s.text??"",i;switch(r){case"lpwstr":case"lpstr":case"bstr":i={type:"string",value:a};break;case"i4":case"int":i={type:"int",value:parseInt(a,10)};break;case"decimal":i={type:"decimal",value:parseFloat(a)};break;case"bool":i={type:"bool",value:a==="true"||a==="1"};break;case"filetime":i={type:"date",value:new Date(a)};break;case"r8":i={type:"r8",value:parseFloat(a)};break;case"i8":i={type:"i8",value:BigInt(a)};break;case"error":i={type:"error",value:a};break;default:i={type:"string",value:a};break}return{name:n,value:i}}).filter(Boolean)}function sn(e){let t=new Map;try{let o=Lt(e);for(let n of o.children)if(ct(n.tag)==="Relationship"){let s={type:n.attrs.Type??"",target:n.attrs.Target??""};n.attrs.TargetMode&&(s.targetMode=n.attrs.TargetMode),t.set(n.attrs.Id??"",s)}}catch{}return t}function Nr(e){let t=new Map;try{let o=Lt(e);for(let n of o.children)if(ct(n.tag)==="Override"){let r=n.attrs.PartName??"",a=n.attrs.ContentType??"";t.set(r.startsWith("/")?r.slice(1):r,a)}}catch{}return t}function Xr(e){let t=Lt(e),o=new Map,n=[],s={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"mm-dd-yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@"},r=oe(t,"numFmts");if(r)for(let g of ut(r,"numFmt")){let u=parseInt(g.attrs.numFmtId??"0",10),$=g.attrs.formatCode??"";o.set(u,$)}let a=oe(t,"fonts"),i=[];if(a)for(let g of ut(a,"font"))i.push(rn(g));let l=oe(t,"fills"),h=[];if(l)for(let g of ut(l,"fill"))h.push(Gn(g));let m=oe(t,"borders"),c=[];if(m)for(let g of ut(m,"border"))c.push(qn(g));let d=oe(t,"cellXfs");if(d)for(let g of ut(d,"xf")){let u=parseInt(g.attrs.fontId??"0",10),$=parseInt(g.attrs.fillId??"0",10),x=parseInt(g.attrs.borderId??"0",10),b=parseInt(g.attrs.numFmtId??"0",10),C=g.attrs.applyFont==="1",y=g.attrs.applyFill==="1",v=g.attrs.applyBorder==="1",w=g.attrs.applyAlignment==="1",k=g.attrs.applyNumberFormat==="1",T=g.attrs.applyProtection==="1",S={};C&&i[u]&&(S.font=i[u]),y&&h[$]&&(S.fill=h[$]),v&&c[x]&&(S.border=c[x]),k&&b!==0&&(o.has(b)?S.numberFormat={formatCode:o.get(b)}:s[b]&&(S.numFmtId=b));let D=B(g,"alignment");w&&D&&(S.alignment=Kn(D));let R=B(g,"protection");T&&R&&(R.attrs.locked!==void 0&&(S.locked=R.attrs.locked!=="0"),R.attrs.hidden!==void 0&&(S.hidden=R.attrs.hidden!=="0")),n.push(S)}let f=[],p=oe(t,"dxfs");if(p)for(let g of ut(p,"dxf")){let u={},$=B(g,"font");$&&(u.font=rn($));let x=B(g,"fill");x&&(u.fill=Gn(x));let b=B(g,"border");b&&(u.border=qn(b));let C=B(g,"numFmt");if(C){let v=C.attrs.formatCode??"";v&&(u.numberFormat={formatCode:v})}let y=B(g,"alignment");y&&(u.alignment=Kn(y)),f.push(u)}return{xfs:n,numFmts:o,dxfs:f}}function oe(e,t){if(ct(e.tag)===t)return e;for(let o of e.children){let n=oe(o,t);if(n)return n}}function rn(e){let t={};for(let o of e.children)switch(ct(o.tag)){case"b":t.bold=o.attrs.val!=="0";break;case"i":t.italic=o.attrs.val!=="0";break;case"strike":t.strike=o.attrs.val!=="0";break;case"u":t.underline=o.attrs.val??"single";break;case"sz":t.size=parseFloat(o.attrs.val??"11");break;case"name":t.name=o.attrs.val;break;case"family":t.family=parseInt(o.attrs.val??"0",10);break;case"scheme":t.scheme=o.attrs.val;break;case"charset":t.charset=parseInt(o.attrs.val??"0",10);break;case"vertAlign":t.vertAlign=o.attrs.val;break;case"color":{let n=o.attrs.rgb,s=o.attrs.theme;n?t.color=n:s&&(t.color=`theme:${s}${o.attrs.tint?":tint:"+o.attrs.tint:""}`);break}}return t}function Gn(e){let t=B(e,"patternFill");if(t){let n=B(t,"fgColor"),s=B(t,"bgColor");return{type:"pattern",pattern:t.attrs.patternType,fgColor:n?.attrs.rgb??(n?.attrs.theme?`theme:${n.attrs.theme}${n.attrs.tint?":tint:"+n.attrs.tint:""}`:void 0),bgColor:s?.attrs.rgb??(s?.attrs.theme?`theme:${s.attrs.theme}${s.attrs.tint?":tint:"+s.attrs.tint:""}`:void 0)}}let o=B(e,"gradientFill");if(o){let n=ut(o,"stop").concat(ut(o,"gradientStop")).map(s=>{let r=B(s,"color");return{position:parseFloat(s.attrs.position??"0"),color:r?.attrs.rgb??(r?.attrs.theme?`theme:${r.attrs.theme}${r.attrs.tint?":tint:"+r.attrs.tint:""}`:"FF000000")}});return{type:"gradient",gradientType:o.attrs.type,degree:o.attrs.degree?parseFloat(o.attrs.degree):void 0,stops:n}}return{type:"pattern",pattern:"none"}}function qn(e){let t=o=>{let n=B(e,o);if(!n)return;let s=n.attrs.style,r=B(n,"color");if(!s&&!r)return;let a=r?.attrs.rgb??(r?.attrs.theme?`theme:${r.attrs.theme}${r.attrs.tint?":tint:"+r.attrs.tint:""}`:void 0);return{style:s,color:a}};return{left:t("left"),right:t("right"),top:t("top"),bottom:t("bottom"),diagonal:t("diagonal"),diagonalUp:e.attrs.diagonalUp==="1",diagonalDown:e.attrs.diagonalDown==="1"}}function Kn(e){let t={};return e.attrs.horizontal&&(t.horizontal=e.attrs.horizontal),e.attrs.vertical&&(t.vertical=e.attrs.vertical),e.attrs.wrapText&&(t.wrapText=e.attrs.wrapText!=="0"),e.attrs.shrinkToFit&&(t.shrinkToFit=e.attrs.shrinkToFit!=="0"),e.attrs.textRotation&&(t.textRotation=parseInt(e.attrs.textRotation,10)),e.attrs.indent&&(t.indent=parseInt(e.attrs.indent,10)),e.attrs.readingOrder&&(t.readingOrder=parseInt(e.attrs.readingOrder,10)),t}function Ur(e){let t=Lt(e);return ut(t,"si").map(o=>{let n=B(o,"t"),s=ut(o,"r");if(n&&!s.length)return{text:n.text??""};let r=s.map(l=>{let h=B(l,"t")?.text??"",m=B(l,"rPr"),c={text:h};return m&&(c.font=rn(m)),c}),a=r.map(l=>l.text).join("");return r.some(l=>l.font&&Object.keys(l.font).length>0)?{text:a,richText:r}:{text:a}})}function Vr(e,t,o,n){let s=new Ie(t),r=Lt(e),a=[],i=[],l="",h="",m=[],c=new Map,d=new Set(["sheetPr","dimension","sheetViews","sheetFormatPr","cols","sheetData","mergeCells","conditionalFormatting","dataValidations","sheetProtection","printOptions","pageMargins","pageSetup","headerFooter","drawing","tableParts","autoFilter","rowBreaks","colBreaks","picture","oleObjects","ctrlProps","legacyDrawing","AlternateContent","extLst"]);for(let f of r.children){let p=ct(f.tag);switch(p){case"sheetViews":Wr(f,s);break;case"cols":Hr(f,s,o);break;case"sheetData":zr(f,s,o,n,c);break;case"mergeCells":Gr(f,s);break;case"autoFilter":s.autoFilter={ref:f.attrs.ref??""};break;case"tableParts":for(let g of ut(f,"tablePart")){let u=g.attrs["r:id"]??"";u&&i.push(u)}break;case"sheetProtection":qr(f,s);break;case"pageMargins":Kr(f,s);break;case"pageSetup":Zr(f,s);break;case"headerFooter":Yr(f,s);break;case"printOptions":Qr(f,s);break;case"conditionalFormatting":Jr(f,s,o);break;case"dataValidations":ta(f,s);break;case"rowBreaks":for(let g of ut(f,"brk")){let u=parseInt(g.attrs.id??"0",10);u>0&&s.addRowBreak(u,g.attrs.man==="1")}break;case"colBreaks":for(let g of ut(f,"brk")){let u=parseInt(g.attrs.id??"0",10);u>0&&s.addColBreak(u,g.attrs.man==="1")}break;case"drawing":h=f.attrs["r:id"]??"";break;case"legacyDrawing":l=f.attrs["r:id"]??"";break;case"AlternateContent":{let g=f.children.find($=>typeof $!="string"&&ct($.tag)==="Choice"),u=g?g.children.find($=>typeof $!="string"&&ct($.tag)==="controls"):void 0;if(u)for(let $ of u.children){if(typeof $=="string")continue;let x;if(ct($.tag)==="control"?x=$:ct($.tag)==="AlternateContent"&&(x=$.children.find(v=>typeof v!="string"&&ct(v.tag)==="Choice")?.children.find(v=>typeof v!="string"&&ct(v.tag)==="control")),!x)continue;let b=x.children.find(y=>typeof y!="string"&&ct(y.tag)==="controlPr"),C=x.attrs["r:id"]??b?.attrs["r:id"]??"";C&&m.push(C)}break}case"extLst":ra(f,s);break;default:d.has(p)||a.push(ro(f));break}}return{ws:s,originalXml:e,unknownParts:a,tableRIds:i,legacyDrawingRId:l,ctrlPropRIds:m,drawingRId:h,vmCells:c}}function Wr(e,t){let o=ut(e,"sheetView")[0];if(!o)return;t.view={showGridLines:o.attrs.showGridLines!=="0",showRowColHeaders:o.attrs.showRowColHeaders!=="0",zoomScale:o.attrs.zoomScale?parseInt(o.attrs.zoomScale,10):void 0,rightToLeft:o.attrs.rightToLeft==="1",tabSelected:o.attrs.tabSelected==="1",view:o.attrs.view};let n=B(o,"pane");n&&n.attrs.state==="frozen"&&(t.freezePane={col:n.attrs.xSplit?parseInt(n.attrs.xSplit,10):void 0,row:n.attrs.ySplit?parseInt(n.attrs.ySplit,10):void 0})}function Hr(e,t,o){for(let n of ut(e,"col")){let s=parseInt(n.attrs.min??"1",10),r=parseInt(n.attrs.max??"1",10),a={width:n.attrs.width?parseFloat(n.attrs.width):void 0,hidden:n.attrs.hidden==="1",customWidth:n.attrs.customWidth==="1",outlineLevel:n.attrs.outlineLevel?parseInt(n.attrs.outlineLevel,10):void 0,style:n.attrs.style?o.xfs[parseInt(n.attrs.style,10)]:void 0};for(let i=s;i<=r;i++)t.setColumn(i,a)}}function zr(e,t,o,n,s){for(let r of ut(e,"row")){let a=parseInt(r.attrs.r??"0",10);if(!a)continue;let i={};r.attrs.ht&&(i.height=parseFloat(r.attrs.ht)),r.attrs.hidden&&(i.hidden=r.attrs.hidden==="1"),r.attrs.outlineLevel&&(i.outlineLevel=parseInt(r.attrs.outlineLevel,10)),r.attrs.collapsed&&(i.collapsed=r.attrs.collapsed==="1"),r.attrs.s&&(i.style=o.xfs[parseInt(r.attrs.s,10)]),Object.keys(i).length&&t.setRow(a,i);for(let l of ut(r,"c")){let h=l.attrs.r??"";if(!h)continue;let{row:m,col:c}=Gt(h),d=l.attrs.s?parseInt(l.attrs.s,10):0,f=d>0?o.xfs[d]:void 0,p=l.attrs.t??"",g=B(l,"f"),u=B(l,"v"),$={};f&&($.style=f);let x=l.attrs.vm;if(x&&s&&s.set(h,parseInt(x,10)),g)g.attrs.t==="array"?$.arrayFormula=g.text??"":$.formula=g.text??"";else if(u){let b=u.text??"";switch(p){case"s":{let C=parseInt(b,10),y=n[C];y?($.value=y.text,y.richText&&($.richText=y.richText)):$.value="";break}case"b":$.value=b==="1"||b==="true";break;case"str":case"inlineStr":{let C=B(l,"is");$.value=C?B(C,"t")?.text??b:b;break}case"e":$.value=new te(b);break;default:{let C=parseFloat(b);$.value=isNaN(C)?b:C;break}}}(Object.keys($).length||$.value!==void 0)&&t.setCell(m,c,$)}}}function Gr(e,t){for(let o of ut(e,"mergeCell")){let n=o.attrs.ref??"";n.includes(":")&&t.mergeByRef(n)}}function qr(e,t){t.protection={sheet:e.attrs.sheet!=="0",password:void 0,selectLockedCells:e.attrs.selectLockedCells!=="0",selectUnlockedCells:e.attrs.selectUnlockedCells!=="0",formatCells:e.attrs.formatCells==="0",formatColumns:e.attrs.formatColumns==="0",formatRows:e.attrs.formatRows==="0",insertColumns:e.attrs.insertColumns==="0",insertRows:e.attrs.insertRows==="0",insertHyperlinks:e.attrs.insertHyperlinks==="0",deleteColumns:e.attrs.deleteColumns==="0",deleteRows:e.attrs.deleteRows==="0",sort:e.attrs.sort==="0",autoFilter:e.attrs.autoFilter==="0",pivotTables:e.attrs.pivotTables==="0"}}function Kr(e,t){t.pageMargins={left:parseFloat(e.attrs.left??"0.7"),right:parseFloat(e.attrs.right??"0.7"),top:parseFloat(e.attrs.top??"0.75"),bottom:parseFloat(e.attrs.bottom??"0.75"),header:parseFloat(e.attrs.header??"0.3"),footer:parseFloat(e.attrs.footer??"0.3")}}function Zr(e,t){t.pageSetup={paperSize:e.attrs.paperSize?parseInt(e.attrs.paperSize,10):void 0,orientation:e.attrs.orientation,fitToPage:e.attrs.fitToPage==="1",fitToWidth:e.attrs.fitToWidth?parseInt(e.attrs.fitToWidth,10):void 0,fitToHeight:e.attrs.fitToHeight?parseInt(e.attrs.fitToHeight,10):void 0,scale:e.attrs.scale?parseInt(e.attrs.scale,10):void 0,horizontalDpi:e.attrs.horizontalDpi?parseInt(e.attrs.horizontalDpi,10):void 0,verticalDpi:e.attrs.verticalDpi?parseInt(e.attrs.verticalDpi,10):void 0}}function Yr(e,t){t.headerFooter={oddHeader:B(e,"oddHeader")?.text,oddFooter:B(e,"oddFooter")?.text,evenHeader:B(e,"evenHeader")?.text,evenFooter:B(e,"evenFooter")?.text,firstHeader:B(e,"firstHeader")?.text,firstFooter:B(e,"firstFooter")?.text,differentOddEven:e.attrs.differentOddEven==="1",differentFirst:e.attrs.differentFirst==="1"}}function Qr(e,t){t.printOptions={gridLines:e.attrs.gridLines==="1",gridLinesSet:e.attrs.gridLinesSet==="1",headings:e.attrs.headings==="1",centerHorizontal:e.attrs.horizontalCentered==="1",centerVertical:e.attrs.verticalCentered==="1"}}function Jr(e,t,o){let n=e.attrs.sqref??"";for(let s of ut(e,"cfRule")){let r=s.attrs.type??"cellIs",a={sqref:n,type:r};if(s.attrs.operator&&(a.operator=s.attrs.operator),s.attrs.priority&&(a.priority=parseInt(s.attrs.priority,10)),s.attrs.text&&(a.text=s.attrs.text),s.attrs.aboveAverage==="0"&&(a.aboveAverage=!1),s.attrs.percent==="1"&&(a.percent=!0),s.attrs.rank&&(a.rank=parseInt(s.attrs.rank,10)),s.attrs.timePeriod&&(a.timePeriod=s.attrs.timePeriod),s.attrs.dxfId!==void 0){let c=parseInt(s.attrs.dxfId,10);o.dxfs[c]&&(a.style=o.dxfs[c])}let i=ut(s,"formula");i[0]?.text&&(a.formula=i[0].text),i[1]?.text&&(a.formula2=i[1].text);let l=B(s,"colorScale");if(l){let c=ut(l,"cfvo").map(f=>({type:f.attrs.type??"min",val:f.attrs.val})),d=ut(l,"color").map(f=>f.attrs.rgb??f.attrs.theme??"");a.colorScale={type:"colorScale",cfvo:c,color:d}}let h=B(s,"dataBar");if(h){let c=ut(h,"cfvo"),d=B(h,"color");a.dataBar={type:"dataBar",showValue:h.attrs.showValue!=="0"?void 0:!1,minType:c[0]?.attrs.type,minVal:c[0]?.attrs.val,maxType:c[1]?.attrs.type,maxVal:c[1]?.attrs.val,color:d?.attrs.rgb}}let m=B(s,"iconSet");if(m){let c=ut(m,"cfvo").map(d=>({type:d.attrs.type??"percent",val:d.attrs.val}));a.iconSet={type:"iconSet",iconSet:m.attrs.iconSet??"3TrafficLights1",cfvo:c,showValue:m.attrs.showValue==="0"?!1:void 0,reverse:m.attrs.reverse==="1"?!0:void 0}}t.addConditionalFormat(a)}}function ta(e,t){for(let o of ut(e,"dataValidation")){let n=o.attrs.sqref??"";if(!n)continue;let s=o.attrs.type??"whole",r={type:s};o.attrs.operator&&(r.operator=o.attrs.operator),o.attrs.allowBlank==="1"&&(r.allowBlank=!0),o.attrs.showErrorMessage==="1"&&(r.showErrorAlert=!0),o.attrs.errorTitle&&(r.errorTitle=o.attrs.errorTitle),o.attrs.error&&(r.error=o.attrs.error),o.attrs.showInputMessage==="1"&&(r.showInputMessage=!0),o.attrs.promptTitle&&(r.promptTitle=o.attrs.promptTitle),o.attrs.prompt&&(r.prompt=o.attrs.prompt),o.attrs.showDropDown==="1"&&(r.showDropDown=!1);let a=B(o,"formula1"),i=B(o,"formula2");a?.text&&(s==="list"&&a.text.startsWith('"')&&a.text.endsWith('"')?r.list=a.text.slice(1,-1).split(","):r.formula1=a.text),i?.text&&(r.formula2=i.text),t.addDataValidation(n,r)}}function ea(e){try{let t=Lt(e);if(ct(t.tag)!=="table")return null;let n=t.attrs.name??"",s=t.attrs.displayName??n,r=t.attrs.ref??"",a=parseInt(t.attrs.totalsRowCount??"0",10),i=[],l=oe(t,"tableColumns");if(l)for(let c of ut(l,"tableColumn")){let d={name:c.attrs.name??""};c.attrs.totalsRowFunction&&(d.totalsRowFunction=c.attrs.totalsRowFunction),c.attrs.totalsRowFormula&&(d.totalsRowFormula=c.attrs.totalsRowFormula),c.attrs.totalsRowLabel&&(d.totalsRowLabel=c.attrs.totalsRowLabel),i.push(d)}let h={name:n,ref:r,columns:i};s&&s!==n&&(h.displayName=s),a>0&&(h.totalsRow=!0);let m=oe(t,"tableStyleInfo");return m&&(m.attrs.name&&(h.style=m.attrs.name),m.attrs.showFirstColumn==="1"&&(h.showFirstColumn=!0),m.attrs.showLastColumn==="1"&&(h.showLastColumn=!0),m.attrs.showRowStripes==="1"&&(h.showRowStripes=!0),m.attrs.showColumnStripes==="1"&&(h.showColumnStripes=!0)),h}catch{return null}}var De=9525;function Zn(e){return{col:parseInt(B(e,"col")?.text??"0",10),row:parseInt(B(e,"row")?.text??"0",10),colOff:parseInt(B(e,"colOff")?.text??"0",10),rowOff:parseInt(B(e,"rowOff")?.text??"0",10)}}function Yn(e){return{png:"png",jpg:"jpeg",jpeg:"jpeg",gif:"gif",emf:"emf",wmf:"wmf",tiff:"tiff",tif:"tiff",svg:"svg",ico:"ico",webp:"webp",bmp:"bmp"}[e.toLowerCase()]??"png"}function oa(e,t,o,n,s){let r=Lt(e);for(let a of r.children){if(typeof a=="string")continue;let i=ct(a.tag);if(i!=="twoCellAnchor"&&i!=="oneCellAnchor"&&i!=="absoluteAnchor")continue;let l=aa(a,i),h=wt(a,"pic");if(h){ia(h,a,i,l,t,o,n,s);continue}let m=wt(a,"graphicFrame");if(m){na(m,a,i,t,o,n,s);continue}let c=wt(a,"oMath");if(c){la(c,a,i,l,s);continue}let d=wt(a,"sp");if(d){sa(d,a,i,s);continue}}}function na(e,t,o,n,s,r,a){let i=wt(e,"chart");if(!i||!n)return;let l=i.attrs["r:id"]??Vn(i,"r:id")??"";if(!l)return;let h=n.get(l);if(!h)return;let m=h.target.startsWith("/")?h.target.slice(1):We(s,h.target),c=r(m);if(!c)return;let f=new TextDecoder().decode(c.data),p=Lt(f),g={col:0,row:0},u={col:8,row:15};if(o==="twoCellAnchor"){let E=B(t,"from"),_=B(t,"to");E&&(g={col:parseInt(B(E,"col")?.text??"0",10),row:parseInt(B(E,"row")?.text??"0",10)}),_&&(u={col:parseInt(B(_,"col")?.text??"0",10),row:parseInt(B(_,"row")?.text??"0",10)})}let $=wt(p,"plotArea");if(!$)return;let x={barChart:"column",bar3DChart:"column",lineChart:"line",line3DChart:"line",areaChart:"area",area3DChart:"area",pieChart:"pie",pie3DChart:"pie",doughnutChart:"doughnut",scatterChart:"scatter",bubbleChart:"bubble",radarChart:"radar",stockChart:"stock"},b="column",C;for(let E of $.children){if(typeof E=="string")continue;let _=ct(E.tag);if(x[_]){if(b=x[_],C=E,_==="barChart"||_==="bar3DChart"){(B(E,"barDir")?.attrs.val??"")==="bar"&&(b="bar");let V=B(E,"grouping")?.attrs.val??"";V==="stacked"&&(b=b==="bar"?"barStacked":"columnStacked"),V==="percentStacked"&&(b=b==="bar"?"barStacked100":"columnStacked100")}if(_==="lineChart"){let M=wt(E,"marker");if(M){let N=B(M,"symbol")?.attrs.val??"";N&&N!=="none"&&(b="lineMarker")}}_==="scatterChart"&&B(E,"scatterStyle")?.attrs.val?.includes("Smooth")&&(b="scatterSmooth"),_==="radarChart"&&B(E,"radarStyle")?.attrs.val==="filled"&&(b="radarFilled");break}}if(!C)return;let y=[];for(let E of ut(C,"ser")){let _={values:""},M=B(E,"tx");if(M){let K=wt(M,"strRef");if(K){let mt=B(K,"f");mt?.text&&(_.name=mt.text);let it=B(K,"strCache");if(it){let gt=wt(it,"pt"),St=gt?wt(gt,"v"):void 0;St?.text&&(_.name=St.text)}}let z=wt(M,"v");z?.text&&!_.name&&(_.name=z.text)}let N=B(E,"val")||B(E,"yVal");if(N){let K=wt(N,"numRef");if(K){let z=B(K,"f");z?.text&&(_.values=z.text)}}let H=B(E,"cat")||B(E,"xVal");if(H){let K=wt(H,"strRef"),z=wt(H,"numRef"),mt=K||z;if(mt){let it=B(mt,"f");it?.text&&(_.categories=it.text)}}let V=B(E,"spPr");if(V){let K=B(V,"solidFill");if(K){let z=B(K,"srgbClr");z?.attrs.val&&(_.color="#"+z.attrs.val)}}_.values&&y.push(_)}if(!y.length)return;let v,w=B(p,"title")||wt(p,"title");if(w){let E=wt(w,"t");E?.text&&(v=E.text)}let k,T,S=wt($,"catAx")||wt($,"dateAx"),D=wt($,"valAx");if(S){k={};let E=wt(S,"title");if(E){let _=wt(E,"t");_?.text&&(k.title=_.text)}}if(D){T={};let E=wt(D,"title");if(E){let M=wt(E,"t");M?.text&&(T.title=M.text)}B(D,"majorGridlines")&&(T.gridLines=!0)}let R=!1,A=wt(p,"legend");A&&(R=B(A,"legendPos")?.attrs.val||!0);let Q=B(C,"varyColors")?.attrs.val!=="0",q={type:b,series:y,from:g,to:u};v&&(q.title=v),k&&(q.xAxis=k),T&&(q.yAxis=T),R!==!1&&(q.legend=R),Q&&(q.varyColors=!0),a.addChart(q)}function sa(e,t,o,n){let s={col:0,row:0},r={col:2,row:2};if(o==="twoCellAnchor"){let u=B(t,"from"),$=B(t,"to");u&&(s={col:parseInt(B(u,"col")?.text??"0",10),row:parseInt(B(u,"row")?.text??"0",10)}),$&&(r={col:parseInt(B($,"col")?.text??"0",10),row:parseInt(B($,"row")?.text??"0",10)})}let a=wt(e,"spPr"),i="rect",l,h,m,c;if(a){let u=wt(a,"prstGeom");if(u){let C=u.attrs.prst??"";new Set(["rect","roundRect","ellipse","triangle","diamond","pentagon","hexagon","octagon","star5","star6","rightArrow","leftArrow","upArrow","downArrow","line","curvedConnector3","callout1","callout2","cloud","heart","lightningBolt","sun","moon","smileyFace","flowChartProcess","flowChartDecision","flowChartTerminator","flowChartDocument"]).has(C)&&(i=C)}let $=B(a,"solidFill");if($){let C=B($,"srgbClr");C?.attrs.val&&(l="#"+C.attrs.val);let y=B($,"schemeClr");y?.attrs.val&&(l="theme:"+y.attrs.val)}let x=B(a,"ln");if(x){let C=x.attrs.w;C&&(m=Math.round(parseInt(C,10)/De));let y=B(x,"solidFill");if(y){let v=B(y,"srgbClr");v?.attrs.val&&(h="#"+v.attrs.val)}}let b=wt(a,"xfrm");b?.attrs.rot&&(c=parseInt(b.attrs.rot,10)/6e4)}let d,f,p=wt(e,"txBody");if(p){let u=B(p,"bodyPr"),x=(u?B(u,"prstTxWarp"):void 0)?.attrs.prst??u?.attrs.prstTxWarp??"",b=[];for(let y of ut(p,"p"))for(let v of ut(y,"r")){let w=B(v,"t");if(w?.text&&b.push(w.text),!f){let k=B(v,"rPr");if(k){f={},k.attrs.sz&&(f.size=parseInt(k.attrs.sz,10)/100),k.attrs.b==="1"&&(f.bold=!0),k.attrs.i==="1"&&(f.italic=!0);let T=wt(k,"latin");T?.attrs.typeface&&(f.name=T.attrs.typeface);let S=B(k,"solidFill");if(S){let D=B(S,"srgbClr");D?.attrs.val&&(f.color="#"+D.attrs.val)}}}}if(d=b.join(""),x&&new Set(["textPlain","textArchUp","textArchDown","textCircle","textWave1","textWave2","textInflate","textDeflate","textFadeUp","textFadeDown","textFadeLeft","textFadeRight","textSlantUp","textSlantDown","textCascadeUp","textCascadeDown","textChevron","textRingInside","textRingOutside","textStop"]).has(x)&&d){let y={text:d,from:s,to:r};x!=="textPlain"&&(y.preset=x),f&&(y.font=f),l&&(y.fillColor=l),h&&(y.outlineColor=h),n.addWordArt(y);return}}let g={type:i,from:s,to:r};d&&(g.text=d),l&&(g.fillColor=l),h&&(g.lineColor=h),m&&(g.lineWidth=m),f&&(g.font=f),c&&(g.rotation=c),n.addShape(g)}function ra(e,t){for(let o of ut(e,"ext")){let n=o.children?.filter(s=>typeof s!="string"&&ct(s.tag)==="sparklineGroups");if(n?.length)for(let s of n)for(let r of ut(s,"sparklineGroup")){let a=r.attrs.type??"line",i=a==="column"?"bar":a==="stacked"?"stacked":"line",l=r.children?.find(D=>typeof D!="string"&&ct(D.tag)==="colorSeries"),h=r.children?.find(D=>typeof D!="string"&&ct(D.tag)==="colorHigh"),m=r.children?.find(D=>typeof D!="string"&&ct(D.tag)==="colorLow"),c=r.children?.find(D=>typeof D!="string"&&ct(D.tag)==="colorFirst"),d=r.children?.find(D=>typeof D!="string"&&ct(D.tag)==="colorLast"),f=r.children?.find(D=>typeof D!="string"&&ct(D.tag)==="colorNegative"),p=r.children?.find(D=>typeof D!="string"&&ct(D.tag)==="colorMarkers"),g=r.attrs.high==="1",u=r.attrs.low==="1",$=r.attrs.first==="1",x=r.attrs.last==="1",b=r.attrs.negative==="1",C=r.attrs.markers==="1",y=r.attrs.lineWeight,v=y?parseFloat(y):void 0,w=r.attrs.minAxisType==="individual"?"individual":r.attrs.minAxisType==="custom"?"custom":void 0,k=r.attrs.maxAxisType==="individual"?"individual":r.attrs.maxAxisType==="custom"?"custom":void 0,T=r.children?.find(D=>typeof D!="string"&&ct(D.tag)==="sparklines");if(!T)continue;let S=T.children?.filter(D=>typeof D!="string"&&ct(D.tag)==="sparkline");if(S)for(let D of S){let R=D.children?.find(E=>typeof E!="string"&&ct(E.tag)==="f"),A=D.children?.find(E=>typeof E!="string"&&ct(E.tag)==="sqref"),W=R?.text??"",Q=A?.text??"";if(!W||!Q)continue;let q={type:i,dataRange:W,location:Q};if(l){let E=l.attrs.rgb;E&&(q.color="#"+E.slice(2));let _=l.attrs.theme;_&&(q.color="theme:"+_)}if(h){let E=h.attrs.rgb;E&&(q.highColor="#"+E.slice(2));let _=h.attrs.theme;_&&(q.highColor="theme:"+_)}if(m){let E=m.attrs.rgb;E&&(q.lowColor="#"+E.slice(2));let _=m.attrs.theme;_&&(q.lowColor="theme:"+_)}if(c){let E=c.attrs.rgb;E&&(q.firstColor="#"+E.slice(2));let _=c.attrs.theme;_&&(q.firstColor="theme:"+_)}if(d){let E=d.attrs.rgb;E&&(q.lastColor="#"+E.slice(2));let _=d.attrs.theme;_&&(q.lastColor="theme:"+_)}if(f){let E=f.attrs.rgb;E&&(q.negativeColor="#"+E.slice(2));let _=f.attrs.theme;_&&(q.negativeColor="theme:"+_)}if(p){let E=p.attrs.rgb;E&&(q.markersColor="#"+E.slice(2));let _=p.attrs.theme;_&&(q.markersColor="theme:"+_)}g&&(q.showHigh=!0),u&&(q.showLow=!0),$&&(q.showFirst=!0),x&&(q.showLast=!0),b&&(q.showNegative=!0),C&&(q.showMarkers=!0),v!==void 0&&(q.lineWidth=v),w&&(q.minAxisType=w),k&&(q.maxAxisType=k),t.addSparkline(q)}}}}function aa(e,t){let o={};if(t==="twoCellAnchor"||t==="oneCellAnchor"){let n=B(e,"from");n&&(o.from={col:parseInt(B(n,"col")?.text??"0",10),row:parseInt(B(n,"row")?.text??"0",10),colOff:parseInt(B(n,"colOff")?.text??"0",10),rowOff:parseInt(B(n,"rowOff")?.text??"0",10)})}if(t==="oneCellAnchor"){let n=wt(e,"ext");n&&(o.width=parseInt(n.attrs.cx??"0",10),o.height=parseInt(n.attrs.cy??"0",10))}return o}function ia(e,t,o,n,s,r,a,i){let l=wt(e,"blipFill"),h=l?wt(l,"blip"):void 0,m=h?.attrs["r:embed"]??h?.attrs.embed??"";if(!m||!s)return;let c=s.get(m);if(!c)return;let d=c.target.startsWith("/")?c.target.slice(1):We(r,c.target),f=a(d);if(!f)return;let p=d.split(".").pop()??"png",g=Yn(p),$=wt(e,"cNvPr")?.attrs.descr||void 0,x={data:f.data,format:g};if($&&(x.altText=$),o==="twoCellAnchor"){let b=B(t,"from"),C=B(t,"to");b&&(x.from=Zn(b)),C&&(x.to=Zn(C))}else if(o==="oneCellAnchor")n.from&&(x.from=n.from),n.width&&(x.width=Math.round(n.width/De)),n.height&&(x.height=Math.round(n.height/De));else{let b=B(t,"pos"),C=B(t,"ext");b&&(x.position={x:Math.round(parseInt(b.attrs.x??"0",10)/De),y:Math.round(parseInt(b.attrs.y??"0",10)/De)}),C&&(x.width=Math.round(parseInt(C.attrs.cx??"0",10)/De),x.height=Math.round(parseInt(C.attrs.cy??"0",10)/De))}i.addImage(x)}function la(e,t,o,n,s){let r=kt(e);if(!r.length)return;let a=n.from??{col:0,row:0},i={elements:r,from:a};n.width&&(i.width=n.width),n.height&&(i.height=n.height);let l=wt(e,"rPr");if(l){let h=l.attrs.sz;h&&(i.fontSize=parseInt(h,10)/100);let m=wt(l,"latin");m?.attrs.typeface&&(i.fontName=m.attrs.typeface)}s.addMathEquation(i)}function kt(e){let t=[];for(let o of e.children){if(typeof o=="string")continue;let n=ca(o);n&&t.push(n)}return t}function ca(e){switch(ct(e.tag)){case"r":return{type:"text",text:wt(e,"t")?.text??""};case"f":{let o=B(e,"num"),n=B(e,"den");return{type:"frac",base:o?kt(o):[],argument:n?kt(n):[]}}case"sSup":{let o=B(e,"e"),n=B(e,"sup");return{type:"sup",base:o?kt(o):[],argument:n?kt(n):[]}}case"sSub":{let o=B(e,"e"),n=B(e,"sub");return{type:"sub",base:o?kt(o):[],argument:n?kt(n):[]}}case"sSubSup":{let o=B(e,"e"),n=B(e,"sub"),s=B(e,"sup");return{type:"subSup",base:o?kt(o):[],subscript:n?kt(n):[],superscript:s?kt(s):[]}}case"nary":{let o=B(e,"naryPr"),n=o?B(o,"chr"):void 0,s=n?.attrs["m:val"]??n?.attrs.val??"\u2211",r=B(e,"sub"),a=B(e,"sup"),i=B(e,"e");return{type:"nary",operator:s,lower:r?kt(r):[],upper:a?kt(a):[],body:i?kt(i):[]}}case"rad":{let o=B(e,"radPr"),n=o?B(o,"degHide"):void 0,s=n?.attrs["m:val"]==="1"||n?.attrs.val==="1",r=B(e,"deg"),a=B(e,"e");return{type:"rad",hideDegree:s,degree:r?kt(r):[],body:a?kt(a):[]}}case"d":{let o=B(e,"dPr"),n=o?B(o,"begChr"):void 0,s=o?B(o,"endChr"):void 0,r=B(e,"e");return{type:"delim",open:n?.attrs["m:val"]??n?.attrs.val??"(",close:s?.attrs["m:val"]??s?.attrs.val??")",body:r?kt(r):[]}}case"func":{let o=B(e,"fName"),n=B(e,"e");return{type:"func",base:o?kt(o):[],argument:n?kt(n):[]}}case"groupChr":{let o=B(e,"groupChrPr"),n=o?B(o,"chr"):void 0,s=B(e,"e");return{type:"groupChar",operator:n?.attrs["m:val"]??n?.attrs.val??"\u23DF",base:s?kt(s):[]}}case"acc":{let o=B(e,"accPr"),n=o?B(o,"chr"):void 0,s=B(e,"e");return{type:"accent",operator:n?.attrs["m:val"]??n?.attrs.val??"\u0302",base:s?kt(s):[]}}case"bar":{let o=B(e,"e");return{type:"bar",base:o?kt(o):[]}}case"limLow":{let o=B(e,"e"),n=B(e,"lim");return{type:"limLow",base:o?kt(o):[],argument:n?kt(n):[]}}case"limUpp":{let o=B(e,"e"),n=B(e,"lim");return{type:"limUpp",base:o?kt(o):[],argument:n?kt(n):[]}}case"m":{let o=[];for(let n of ut(e,"mr")){let s=[];for(let r of ut(n,"e")){let a=kt(r);a.length===1?s.push(a[0]):s.push({type:"text",text:a.map(i=>i.text??"").join("")})}o.push(s)}return{type:"matrix",rows:o}}case"eqArr":{let o=[];for(let n of ut(e,"e"))o.push(kt(n));return{type:"eqArr",rows:o}}default:return null}}function ha(e,t,o,n){let s=t("xl/metadata.xml");if(!s)return;let r=Lt(s),a=B(r,"valueMetadata");if(!a)return;let i=ut(a,"bk"),l=r.children.find(x=>typeof x!="string"&&ct(x.tag)==="futureMetadata"),h=l?ut(l,"bk"):[],m=t("xl/richData/rdrichvalue.xml");if(!m)return;let c=Lt(m),d=ut(c,"rv"),f=t("xl/richData/_rels/richValueRel.xml.rels");if(!f)return;let p=sn(f),g=t("xl/richData/richValueRel.xml");if(!g)return;let u=Lt(g),$=ut(u,"rel");for(let[x,b]of e){let C=i[b-1];if(!C)continue;let y=C.children.find(N=>typeof N!="string"&&ct(N.tag)==="rc");if(!y)continue;let v=parseInt(y.attrs.v??"-1",10);if(v<0)continue;let w=h[v];if(!w)continue;let k=wt(w,"rvb"),T=parseInt(k?.attrs.i??"-1",10);if(T<0)continue;let S=d[T];if(!S)continue;let D=ut(S,"v"),R=parseInt(D[0]?.text??"-1",10);if(R<0)continue;let A=$[R];if(!A)continue;let W=A.attrs["r:id"]??"",Q=p.get(W);if(!Q)continue;let q=Q.target.startsWith("/")?Q.target.slice(1):`xl/richData/${Q.target}`,E=o(q);if(!E)continue;let _=q.split(".").pop()??"png",M=Yn(_);n.addCellImage({data:E.data,format:M,cell:x})}}function wt(e,t){for(let o of e.children){if(typeof o=="string")continue;if(ct(o.tag)===t)return o;let n=wt(o,t);if(n)return n}}function We(e,t){let o=e.replace(/\/$/,"").split("/");for(let n of t.split("/"))n===".."?o.pop():n!=="."&&o.push(n);return o.join("/")}async function Qn(e){let t=await tn(e),o=E=>t.get(E)??t.get(E.replace(/^\//,"")),n=E=>{let _=o(E);return _?Co(_):void 0},s=n("[Content_Types].xml")??"<Types/>",r=Nr(s),a=n("xl/_rels/workbook.xml.rels")??"<Relationships/>",i=sn(a),l=n("xl/workbook.xml")??"<workbook/>",h=n("xl/styles.xml")??"<styleSheet/>",m=Xr(h),c=n("xl/sharedStrings.xml")??"<sst/>",d=c!=="<sst/>"?Ur(c):[],f=n("docProps/core.xml")??"",p=f?Wn(f):{},g=n("docProps/app.xml")??"",u={},$="";if(g){let E=Hn(g);u=E.props,$=E.unknownRaw}let x=n("docProps/custom.xml")??"",b=x?zn(x):[],C=Lt(l),y=oe(C,"sheets"),v=y?ut(y,"sheet"):[],w=[],k=oe(C,"definedNames");if(k)for(let E of ut(k,"definedName")){let _=E.attrs.name??"",M=E.text??"";if(!_||!M)continue;let N={name:_,ref:M};if(E.attrs.localSheetId!==void 0){let H=parseInt(E.attrs.localSheetId,10),V=v[H];V&&(N.scope=V.attrs.name??void 0)}E.attrs.comment&&(N.comment=E.attrs.comment),w.push(N)}let T=new Map;for(let[E,_]of t)E.includes("_rels/")&&T.set(E,sn(Co(_)));let S=[];for(let E of v){let _=E.attrs["r:id"]??Object.values(E.attrs).find(U=>U.startsWith("rId"))??"",M=E.attrs.sheetId??"",N=E.attrs.name??`Sheet${M}`,H=i.get(_);if(!H)continue;let V=H.target.startsWith("/")?H.target.slice(1):`xl/${H.target}`,K=n(V)??"";if(!K)continue;let{ws:z,originalXml:mt,unknownParts:it,tableRIds:gt,legacyDrawingRId:St,ctrlPropRIds:J,drawingRId:G,vmCells:X}=Vr(K,N,m,d);z.sheetIndex=S.length+1,z.rId=_;let F=[],P=[];if(gt.length){let U=V.split("/").pop()??"",Y=V.substring(0,V.lastIndexOf("/")+1),st=`${Y}_rels/${U}.rels`,ht=T.get(st);if(ht){for(let tt of gt){let ft=ht.get(tt);if(!ft)continue;let j=ft.target.startsWith("/")?ft.target.slice(1):We(Y,ft.target),et=n(j);if(et){let L=ea(et);L&&z.addTable(L),F.push(j),P.push(et)}}z.tableRIds=gt}}if(St&&J.length){let U=V.split("/").pop()??"",Y=V.substring(0,V.lastIndexOf("/")+1),st=`${Y}_rels/${U}.rels`,ht=T.get(st);if(ht){let tt=ht.get(St),ft=tt?tt.target.startsWith("/")?tt.target.slice(1):We(Y,tt.target):"",j=ft?n(ft):"",et=[];if(j){let L=Lt(j);for(let $t of L.children){if(typeof $t=="string"||ct($t.tag)!=="shape")continue;let ot=$t.children.find(bt=>typeof bt!="string"&&ct(bt.tag)==="ClientData");if(!ot)continue;let Ft=ot.attrs.ObjectType??"";if(Ft==="Note"||!Ft)continue;let xt=($t.attrs.id??"").replace(/\D/g,""),at=parseInt(xt,10)||0;et.push({objectType:Ft,shapeXml:ro($t),clientData:ot,shapeId:at})}}for(let L=0;L<J.length;L++){let $t=ht.get(J[L]);if(!$t)continue;let ot=$t.target.startsWith("/")?$t.target.slice(1):We(Y,$t.target),Ft=n(ot)??"",xt=Ft?Lt(Ft):null,at=xt?.attrs.objectType??"",bt=Fn[at]??"button",Z=et[L],yt=ma(Z?.clientData),nt={type:bt,from:yt.from,to:yt.to,_ctrlPropXml:Ft||void 0,_vmlShapeXml:Z?.shapeXml,_shapeId:Z?.shapeId};if(xt){if(xt.attrs.fmlaLink&&(nt.linkedCell=xt.attrs.fmlaLink),xt.attrs.fmlaRange&&(nt.inputRange=xt.attrs.fmlaRange),xt.attrs.checked&&(nt.checked=Sn[xt.attrs.checked]??"unchecked"),xt.attrs.dropLines&&(nt.dropLines=parseInt(xt.attrs.dropLines,10)),xt.attrs.min&&(nt.min=parseInt(xt.attrs.min,10)),xt.attrs.max&&(nt.max=parseInt(xt.attrs.max,10)),xt.attrs.inc&&(nt.inc=parseInt(xt.attrs.inc,10)),xt.attrs.page&&(nt.page=parseInt(xt.attrs.page,10)),xt.attrs.val&&(nt.val=parseInt(xt.attrs.val,10)),xt.attrs.selType){let dt={Single:"single",Multi:"multi",Extend:"extend"};nt.selType=dt[xt.attrs.selType]??"single"}xt.attrs.noThreeD==="1"&&(nt.noThreeD=!0)}if(Z?.clientData){let dt=Z.clientData.children.find(pt=>typeof pt!="string"&&ct(pt.tag)==="FmlaMacro");dt&&(nt.macro=dt.text??"")}z.addFormControl(nt)}z.legacyDrawingRId=St,z.ctrlPropRIds=J}}if(G){let U=V.split("/").pop()??"",Y=V.substring(0,V.lastIndexOf("/")+1),st=`${Y}_rels/${U}.rels`,ht=T.get(st);if(ht){let tt=ht.get(G);if(tt){let ft=tt.target.startsWith("/")?tt.target.slice(1):We(Y,tt.target),j=n(ft);if(j){let et=ft.substring(0,ft.lastIndexOf("/")+1),L=ft.split("/").pop()??"",$t=`${et}_rels/${L}.rels`,ot=T.get($t);oa(j,ot,et,o,z)}}}}X.size>0&&ha(X,n,o,z),S.push({ws:z,sheetId:M,rId:_,originalXml:mt,unknownParts:it,tablePaths:F,tableXmls:P})}let D=n("xl/connections.xml")??"",R=[];if(D){let E=Lt(D);for(let _ of ut(E,"connection")){let M=parseInt(_.attrs.id??"0",10),N=_.attrs.name??"",H=parseInt(_.attrs.type??"0",10),V=fa(H);if(!N||!V)continue;let K={id:M,name:N,type:V};_.attrs.description&&(K.description=_.attrs.description),_.attrs.refreshOnLoad==="1"&&(K.refreshOnLoad=!0),_.attrs.background==="1"&&(K.background=!0),_.attrs.saveData==="1"&&(K.saveData=!0),_.attrs.keepAlive==="1"&&(K.keepAlive=!0),_.attrs.interval&&(K.interval=parseInt(_.attrs.interval,10));let z=B(_,"dbPr");z&&(z.attrs.connection&&(K.connectionString=z.attrs.connection),z.attrs.command&&(K.command=z.attrs.command),z.attrs.commandType&&(K.commandType=ua(parseInt(z.attrs.commandType,10)))),K._rawXml=ro(_),R.push(K)}}let A=[];for(let[E,_]of t)if(!(!E.startsWith("customXml/item")||E.includes("Props")||E.includes("_rels")))try{let M=await ga(_.data);if(M.length){A.push(...M);break}}catch{}let W=new Set(["xl/workbook.xml","xl/styles.xml","xl/sharedStrings.xml","xl/worksheets/","docProps/","[Content_Types].xml","_rels/","xl/_rels/","xl/connections.xml"]),Q=new Map;for(let[E,_]of t){if(E.endsWith("_rels/")||E==="[Content_Types].xml")continue;[...W].some(N=>E.startsWith(N))||Q.set(E,_.data)}let q=[];for(let E of w)if(E.name==="_xlnm.Print_Area"&&E.scope){let _=S.find(M=>M.ws.name===E.scope);_&&(_.ws.printArea=E.ref)}else q.push(E);return{sheets:S,styles:m,stylesXml:h,sharedStrings:d,sharedXml:c,workbookXml:l,workbookRels:i,contentTypes:r,contentTypesXml:s,core:p,extended:u,extendedUnknownRaw:$,custom:b,hasCustomProps:b.length>0,namedRanges:q,connections:R,connectionsXml:D,powerQueries:A,unknownParts:Q,allRels:T}}function ma(e){let t={from:{col:0,row:0},to:{col:2,row:2}};if(!e)return t;let o=e.children.find(r=>typeof r!="string"&&ct(r.tag)==="Anchor");if(!o)return t;let s=(o.text??"").split(",").map(r=>parseInt(r.trim(),10));return s.length<8||s.some(isNaN)?t:{from:{col:s[0],colOff:s[1],row:s[2],rowOff:s[3]},to:{col:s[4],colOff:s[5],row:s[6],rowOff:s[7]}}}var Jn={1:"odbc",2:"dao",3:"file",4:"web",5:"oledb",6:"text",7:"dsp"},da=Object.fromEntries(Object.entries(Jn).map(([e,t])=>[t,Number(e)]));function fa(e){return Jn[e]}function ts(e){return da[e]}var es={1:"sql",2:"table",3:"default",4:"web",5:"oledb"},pa=Object.fromEntries(Object.entries(es).map(([e,t])=>[t,Number(e)]));function ua(e){return es[e]}function os(e){return pa[e]}async function ga(e){if(e.length<12)return[];let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.getUint32(0,!0)!==0)return[];let n=t.getUint32(4,!0);if(n<4||8+n>e.length)return[];let s=e.subarray(8,8+n);if(s[0]!==80||s[1]!==75)return[];let r=await tn(s),a=[];for(let[i,l]of r){if(!i.includes("/Formula/")||!i.endsWith(".m"))continue;let h=Co(l);if(!h)continue;let m=i.match(/Formulas\/([^/]+)\//),c=m?m[1]:void 0,d=/shared\s+(?:#"([^"]+)"|(\w+))\s*=/g,f,p=new Set;for(;(f=d.exec(h))!==null;){let g=f[1]??f[2];p.add(g)}if(p.size>0){let g=/shared\s+(?:#"([^"]+)"|(\w+))\s*=\s*([\s\S]*?)(?=,\s*shared\s|\]\s*$)/g,u;for(;(u=g.exec(h))!==null;){let $=u[1]??u[2],x=u[3].replace(/,\s*$/,"").trim();a.push({name:$,formula:x})}a.length===0&&a.push({name:c??"Section1",formula:h})}else c&&a.push({name:c,formula:h})}return a}var ao=class e{constructor(){this.sheets=[],this.namedRanges=[],this.connections=[],this.powerQueries=[],this.externalLinks=[],this.customPivotStyles=[],this.pivotSlicers=[],this.properties={},this.compressionLevel=6,this.coreProperties={},this.extendedProperties={},this.customProperties=[],this.isTemplate=!1,this._dirtySheets=new Set,this._activeTabIndex=0,this._customTableStyles=new Map}markDirty(t){if(typeof t=="string"){let o=this.sheets.findIndex(n=>n.name===t);o>=0&&this._dirtySheets.add(o)}else this._dirtySheets.add(t)}static async fromBytes(t){let o=new e,n=await Qn(t);o._readResult=n,o.coreProperties=n.core,o.extendedProperties=n.extended,o.customProperties=n.custom,o.properties={title:n.core.title,author:n.core.creator,subject:n.core.subject,description:n.core.description,keywords:n.core.keywords,company:n.extended.company,lastModifiedBy:n.core.lastModifiedBy,created:n.core.created,modified:n.core.modified,category:n.core.category,status:n.core.contentStatus},o.sheets=n.sheets.map(a=>a.ws);for(let a=0;a<o.sheets.length;a++){let i=o.sheets[a];i._workbook=o,i.view?.tabSelected&&(o._activeTabIndex=a)}o.namedRanges=n.namedRanges,o.connections=n.connections,o.powerQueries=n.powerQueries;let s=n.unknownParts.get("xl/vbaProject.bin");if(s)try{o.vbaProject=oo.fromBytes(s)}catch{}let r=n.workbookXml.match(/<calcPr([^>]*)\/?>/);if(r){let a=r[1],i={},l=a.match(/calcMode="([^"]+)"/);l&&(i.calcMode=l[1]),/fullCalcOnLoad="1"/.test(a)?i.fullCalcOnLoad=!0:/fullCalcOnLoad="0"/.test(a)&&(i.fullCalcOnLoad=!1),/iterate="1"/.test(a)&&(i.iterate=!0);let h=a.match(/iterateCount="(\d+)"/);h&&(i.iterateCount=parseInt(h[1],10));let m=a.match(/iterateDelta="([^"]+)"/);m&&(i.iterateDelta=parseFloat(m[1])),/fullPrecision="1"/.test(a)?i.fullPrecision=!0:/fullPrecision="0"/.test(a)&&(i.fullPrecision=!1),/calcOnSave="1"/.test(a)?i.calcOnSave=!0:/calcOnSave="0"/.test(a)&&(i.calcOnSave=!1),/concurrentCalc="1"/.test(a)?i.concurrentCalc=!0:/concurrentCalc="0"/.test(a)&&(i.concurrentCalc=!1),Object.keys(i).length>0&&(o.calcSettings=i)}return o}static async fromBase64(t){return e.fromBytes(le(t))}static async fromFile(t){let n=await(await import("fs/promises")).readFile(t);return e.fromBytes(new Uint8Array(n))}static async fromBlob(t){return e.fromBytes(new Uint8Array(await t.arrayBuffer()))}addSheet(t,o={}){let n=new Ie(t,o);return n.sheetIndex=this.sheets.length+1,n._workbook=this,this.sheets.push(n),this._dirtySheets.add(n.sheetIndex-1),n}getSheet(t){return this.sheets.find(o=>o.name===t)}getSheetByIndex(t){return this.sheets[t]}getSheetNames(){return this.sheets.map(t=>t.name)}getSheets(){return this.sheets}removeSheet(t){return this.sheets=this.sheets.filter(o=>o.name!==t),this}setActiveSheet(t){let o=typeof t=="string"?this.sheets.findIndex(n=>n.name===t):t;if(!(o<0||o>=this.sheets.length)){for(let n=0;n<this.sheets.length;n++){let s=this.sheets[n];n===o?s.view={...s.view??{},tabSelected:!0}:s.view?.tabSelected&&(s.view={...s.view,tabSelected:!1})}this._activeTabIndex=o}}addChartSheet(t,o){let n=this.addSheet(t);return n._isChartSheet=!0,n.addChart(o),n}addDialogSheet(t){let o=this.addSheet(t);return o._isDialogSheet=!0,o}copySheet(t,o){let n=this.getSheet(t);if(!n)throw new Error(`Sheet "${t}" not found`);let s=this.addSheet(o),r=n.readAllCells();for(let{row:i,col:l,cell:h}of r){let m=s.getCell(i,l);h.value!=null&&(m.value=h.value),h.formula&&(m.formula=h.formula),h.arrayFormula&&(m.arrayFormula=h.arrayFormula),h.richText&&(m.richText=h.richText.map(c=>({...c,font:c.font?{...c.font}:void 0}))),h.style&&(m.style={...h.style}),h.comment&&(m.comment={...h.comment}),h.hyperlink&&(m.hyperlink={...h.hyperlink})}for(let i of n.getMerges())s.merge(i.startRow,i.startCol,i.endRow,i.endCol);let a=n.getUsedRange();if(a)for(let i=a.startCol;i<=a.endCol;i++){let l=n.getColumn(i);l&&s.setColumn(i,{...l})}return n.pageSetup&&(s.pageSetup={...n.pageSetup}),n.printArea&&(s.printArea=n.printArea),s}registerTableStyle(t,o){return this._customTableStyles.set(t,o),this}addNamedRange(t){return this.namedRanges.push(t),this}getNamedRanges(){return this.namedRanges}getNamedRange(t){return this.namedRanges.find(o=>o.name===t)}removeNamedRange(t){return this.namedRanges=this.namedRanges.filter(o=>o.name!==t),this}addConnection(t){return this.connections.push(t),this}getConnections(){return this.connections}getConnection(t){return this.connections.find(o=>o.name===t)}removeConnection(t){return this.connections=this.connections.filter(o=>o.name!==t),this}getPowerQueries(){return this.powerQueries}getPowerQuery(t){return this.powerQueries.find(o=>o.name===t)}getCustomProperty(t){return this.customProperties.find(o=>o.name===t)}setCustomProperty(t,o){let n=this.customProperties.findIndex(s=>s.name===t);return n>=0?this.customProperties[n]={name:t,value:o}:this.customProperties.push({name:t,value:o}),this}removeCustomProperty(t){return this.customProperties=this.customProperties.filter(o=>o.name!==t),this}addExternalLink(t){return this.externalLinks.push(t),this}getExternalLinks(){return this.externalLinks}registerPivotStyle(t){return this.customPivotStyles.push(t),this}addPivotSlicer(t){return this.pivotSlicers.push(t),this}getPivotSlicers(){return this.pivotSlicers}async build(){return this._syncLegacyProperties(),this._readResult?this._buildPatched():this._buildFresh()}async _buildPatched(){let t=this._readResult,o=[],n=this._dirtySheets.size>0,s=new Oe,r=new Le,a=new Map,i=new Map;if(n){for(let p=0;p<this.sheets.length;p++){let g=this.sheets[p],u=g.getTables();for(let $=0;$<u.length;$++){let x=u[$];i.set(`${p}:${$}`,x.columns.map(v=>v.name));let{startRow:b,startCol:C}=Kt(x.ref),y=new Set;for(let v=0;v<x.columns.length;v++){let w=g.getCell(b,C+v),k=w.value,T=null;k==null?T=null:k instanceof Date?T=k.toISOString():typeof k=="object"&&"error"in k?T=String(k.error):T=String(k);let S=T??x.columns[v].name,D=S,R=2;for(;y.has(D);)D=`${S}${R++}`;y.add(D),x.columns[v].name=D,(k==null||typeof k!="string"||k!==D)&&(w.value=D)}}}let c=/<dxf>([\s\S]*?)<\/dxf>|<dxf\/>/g,d=[],f;for(;(f=c.exec(t.stylesXml))!==null;)d.push(f[1]??"");d.length&&s.prependRawDxfs(d);for(let p=0;p<this.sheets.length;p++)a.set(p,this.sheets[p].toXml(s,r))}o.push({name:"docProps/core.xml",data:rt(en({...t.core,...this.coreProperties,modified:new Date}))}),o.push({name:"docProps/app.xml",data:rt(on({...t.extended,...this.extendedProperties,titlesOfParts:this.sheets.map(c=>c.name),headingPairs:this._headingPairs()},t.extendedUnknownRaw))});let l=this.customProperties.length>0?this.customProperties:t.hasCustomProps?t.custom:null;l&&l.length>0&&o.push({name:"docProps/custom.xml",data:rt(nn(l))}),o.push({name:"xl/workbook.xml",data:rt(this._patchWorkbookXml(t.workbookXml,t))});let h=this._connectionsXml(t.connectionsXml);h&&o.push({name:"xl/connections.xml",data:rt(h)}),n?(o.push({name:"xl/styles.xml",data:rt(s.toXml())}),o.push({name:"xl/sharedStrings.xml",data:rt(r.toXml())})):(o.push({name:"xl/styles.xml",data:rt(t.stylesXml)}),o.push({name:"xl/sharedStrings.xml",data:rt(t.sharedXml)}));for(let c=0;c<this.sheets.length;c++){let d=this.sheets[c],p=`xl/${d._isChartSheet?"chartsheets":d._isDialogSheet?"dialogsheets":"worksheets"}/sheet${c+1}.xml`;n?d._isChartSheet?o.push({name:p,data:rt(d.toChartSheetXml())}):d._isDialogSheet?o.push({name:p,data:rt(d.toDialogSheetXml(s,r))}):o.push({name:p,data:rt(a.get(c)??"")}):o.push({name:p,data:rt(t.sheets[c]?.originalXml??"")})}let m=new Set;for(let c=0;c<this.sheets.length;c++){let f=this.sheets[c].getTables(),p=t.sheets[c]?.tablePaths??[],g=t.sheets[c]?.tableXmls??[];for(let u=0;u<f.length;u++){let $=p[u];if($)if(m.add($),u<g.length){let x=g[u],b=x.match(/\bref="([^"]+)"/);if(b&&b[1]!==f[u].ref&&(x=x.replace(`ref="${b[1]}"`,`ref="${f[u].ref}"`)),n){let C=i.get(`${c}:${u}`);if(C)for(let y=0;y<f[u].columns.length;y++){let v=C[y],w=f[u].columns[y].name;v&&v!==w&&(x=x.replace(`name="${I(v)}"`,`name="${I(w)}"`))}}o.push({name:$,data:rt(x)})}else{let x=$.match(/table(\d+)\.xml$/),b=x?parseInt(x[1],10):u+1;o.push({name:$,data:rt(Uo(f[u],b))})}}}for(let[c,d]of t.unknownParts)m.has(c)||c==="xl/vbaProject.bin"&&this.vbaProject||t.allRels.has(c)||n&&c==="xl/calcChain.xml"||o.push({name:c,data:d});this.vbaProject&&(this._ensureVbaSheetModules(),o.push({name:"xl/vbaProject.bin",data:this.vbaProject.build()})),o.push({name:"_rels/.rels",data:rt(this._buildRootRels(l!=null&&l.length>0))}),o.push({name:"xl/_rels/workbook.xml.rels",data:rt(this._buildWorkbookRels(t,n))});for(let[c,d]of t.allRels)c==="xl/_rels/workbook.xml.rels"||c==="_rels/.rels"||o.push({name:c,data:rt(this._relsToXml(d))});return o.push({name:"[Content_Types].xml",data:rt(this._patchContentTypes(t.contentTypesXml,l!=null&&l.length>0,n))}),Jo(o,{level:this.compressionLevel})}async _buildFresh(){let t=new Oe,o=new Le,n=[];for(let[F,P]of this._customTableStyles)t.registerTableStyle(F,P);let s=1;for(let F of this.sheets)F.rId=`rId${s++}`;let r=[],a=[],i=[],l=[],h=new Map,m=new Map,c=new Map,d=new Map,f=1,p=1,g=1,u=1,$=1,x=0,b=0,C=0;for(let F of this.sheets){let P=F.getImages(),U=F.getCharts(),Y=F.getTables(),st=[],ht=[],tt=[];(P.length||U.length||F.getShapes().length||F.getWordArt().length||F.getMathEquations().length||F.getTableSlicers().length||F.getOleObjects().length)&&(F.drawingRId=`rId${s++}`);let ft=F.getFormControls();(F.getComments().length||ft.length)&&(F.legacyDrawingRId=`rId${s++}`);for(let ot of P){let Ft=`rId${s++}`;st.push(Ft),r.push({ws:F,img:ot,ext:ns(ot.format),idx:f++})}for(let ot=0;ot<U.length;ot++){let Ft=`rId${s++}`;ht.push(Ft),a.push({ws:F,chartIdx:ot,globalIdx:p++})}for(let ot=0;ot<Y.length;ot++){let Ft=`rId${s++}`;tt.push(Ft),i.push({ws:F,tableIdx:ot,globalTableId:g++})}let j=[],et=[];for(let ot of F.getOleObjects())j.push(`rId${s++}`),ot.iconData?et.push(`rId${s++}`):et.push("");F.oleRIds=j,F.oleIconRIds=et;let L=[];for(let ot=0;ot<ft.length;ot++)L.push(`rId${s++}`);F.ctrlPropRIds=L,h.set(F,st),m.set(F,ht),c.set(F,tt),F.tableRIds=tt;let $t=[];for(let ot of F.getPivotTables()){let Ft=`rId${s++}`,xt=`rId${s++}`;$t.push(Ft),l.push({ws:F,pt:ot,pivotIdx:$++,cacheId:x++,pivotRId:Ft,cacheRId:xt})}d.set(F,$t)}let y=[],v=f,w=1;for(let F of this.sheets){F._cellImageVm=new Map;for(let P of F.getCellImages()){let U=ns(P.format);y.push({img:P,ext:U,idx:v++}),F._cellImageVm.set(P.cell,w++),F.getCellByRef(P.cell)}}let k=y.length>0,T=new Map,S=[],D=0,R=0;for(let F of this.sheets)F.getTableSlicers().length&&T.set(F,{tableSlicers:[],pivotSlicers:[],slicerDefRId:"",slicerDefIdx:0});for(let F of this.pivotSlicers)for(let P of this.sheets)if(P.getPivotTables().some(U=>U.name===F.pivotTableName)){T.has(P)||T.set(P,{tableSlicers:[],pivotSlicers:[],slicerDefRId:"",slicerDefIdx:0});break}for(let[F,P]of T){F.drawingRId||(F.drawingRId=`rId${s++}`),P.slicerDefRId=`rId${s++}`,P.slicerDefIdx=++D,F.slicerRId=P.slicerDefRId;let U=[];for(let Y of F.getTableSlicers()){let st=F.getTables().find(j=>j.name===Y.tableName),tt=i.find(j=>j.ws===F&&F.getTables()[j.tableIdx]===st)?.globalTableId??1,ft=st?(st.columns?.findIndex(j=>j.name===Y.columnName)??0)+1:1;P.tableSlicers.push({slicer:Y,tableId:tt,columnIndex:ft}),U.push({name:Y.name,cell:Y.cell}),S.push({name:Y.name+"_cache",sourceName:Y.columnName,type:"table",rId:`rId${s++}`,idx:++R,tableId:tt,columnIndex:ft,sortOrder:Y.sortOrder??"ascending"})}for(let Y of this.pivotSlicers){let st=F.getPivotTables().find(et=>et.name===Y.pivotTableName);if(!st)continue;let ht=l.find(et=>et.ws===F&&et.pt===st),tt=this.sheets.indexOf(F)+1,ft=[],j=this.sheets.find(et=>et.name===st.sourceSheet);if(j){let et=j.readRange(st.sourceRef),$t=(et[0]??[]).map(ot=>String(ot??"")).indexOf(Y.fieldName);if($t>=0){let ot=new Set;for(let Ft=1;Ft<et.length;Ft++)ot.add(String(et[Ft][$t]??""));ft=[...ot]}}P.pivotSlicers.push({slicer:Y,pivotCacheId:ht?.cacheId??0}),U.push({name:Y.name,cell:Y.cell}),S.push({name:Y.name+"_cache",sourceName:Y.fieldName,type:"pivot",rId:`rId${s++}`,idx:++R,pivotTableName:Y.pivotTableName,pivotCacheId:ht?.cacheId??0,tabId:tt,items:ft})}F._slicerDrawingInfo=U}let A=T.size>0,W=this.customProperties.length>0,Q=!!this.vbaProject,q=new Set;for(let{ext:F}of[...r,...y]){let P=xa(F);q.add(`<Default Extension="${F}" ContentType="${P}"/>`)}let E=this.sheets.filter(F=>F.getComments().length),M=this.sheets.filter(F=>F.getComments().length||F.getFormControls().length).length?'<Default Extension="vml" ContentType="application/vnd.openxmlformats-officedocument.vmlDrawing"/>':"",N=0,H=E.map(()=>`<Override PartName="/xl/comments${++N}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"/>`).join(""),V=0,K=[];for(let F of this.sheets)if(!F._isDialogSheet)for(let P=0;P<F.getFormControls().length;P++)K.push(`<Override PartName="/xl/ctrlProps/ctrlProp${++V}.xml" ContentType="application/vnd.ms-excel.controlproperties+xml"/>`);let mt=this.sheets.some(F=>F.getOleObjects().length>0)?'<Default Extension="bin" ContentType="application/vnd.openxmlformats-officedocument.oleObject"/>':"";n.push({name:"[Content_Types].xml",data:rt(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
253
+ </Properties>`}function On(e){let t=Lt(e),o=s=>{let r=t.children.find(a=>ct(a.tag)===s);return r?.text??r?.children[0]?.text},n=s=>{let r=o(s);return r?new Date(r):void 0};return{title:o("title"),subject:o("subject"),creator:o("creator"),keywords:o("keywords"),description:o("description"),lastModifiedBy:o("lastModifiedBy"),revision:o("revision"),created:n("created"),modified:n("modified"),category:o("category"),contentStatus:o("contentStatus"),language:o("language"),identifier:o("identifier"),version:o("version")}}function Ln(e){let t=Lt(e),o=d=>t.children.find(f=>ct(f.tag)===d)?.text,n=d=>{let f=o(d);return f!==void 0?Number(f):void 0},s=d=>{let f=o(d);return f!==void 0?f==="true"||f==="1":void 0},r,a=t.children.find(d=>ct(d.tag)==="HeadingPairs");if(a){let d=a.children[0];if(d){let f=d.children.filter(p=>ct(p.tag)==="variant");r=[];for(let p=0;p<f.length-1;p+=2){let g=f[p].children[0],u=f[p+1].children[0];r.push({name:g?.text??"",count:parseInt(u?.text??"0",10)})}}}let i,l=t.children.find(d=>ct(d.tag)==="TitlesOfParts");if(l){let d=l.children[0];d&&(i=d.children.map(f=>f.text??""))}let h=new Set(["Application","AppVersion","Company","Manager","DocSecurity","ScaleCrop","LinksUpToDate","SharedDoc","HyperlinksChanged","Characters","CharactersWithSpaces","Words","Lines","Paragraphs","Pages","Slides","Notes","HiddenSlides","MMClips","Template","PresentationFormat","TotalTime","HyperlinkBase","HeadingPairs","TitlesOfParts"]),c=t.children.filter(d=>!h.has(ct(d.tag))).map(d=>{let f=Object.entries(d.attrs).map(([g,u])=>` ${g}="${u}"`).join(""),p=d.text??"";return!p&&!d.children.length?`<${d.tag}${f}/>`:`<${d.tag}${f}>${p}</${d.tag}>`}).join(`
254
+ `);return{props:{application:o("Application"),appVersion:o("AppVersion"),company:o("Company"),manager:o("Manager"),docSecurity:n("DocSecurity"),scaleCrop:s("ScaleCrop"),linksUpToDate:s("LinksUpToDate"),sharedDoc:s("SharedDoc"),hyperlinksChanged:s("HyperlinksChanged"),characters:n("Characters"),charactersByWord:n("CharactersWithSpaces"),words:n("Words"),lines:n("Lines"),paragraphs:n("Paragraphs"),pages:n("Pages"),slides:n("Slides"),notes:n("Notes"),hiddenSlides:n("HiddenSlides"),mmClips:n("MMClips"),template:o("Template"),presentationFormat:o("PresentationFormat"),totalTime:n("TotalTime"),hyperlinkBase:o("HyperlinkBase"),headingPairs:r,titlesOfParts:i},unknownRaw:c}}function Nn(e){return Lt(e).children.filter(o=>ct(o.tag)==="property").map(o=>{let n=o.attrs.name??"",s=o.children[0];if(!s)return null;let r=ct(s.tag),a=s.text??"",i;switch(r){case"lpwstr":case"lpstr":case"bstr":i={type:"string",value:a};break;case"i4":case"int":i={type:"int",value:parseInt(a,10)};break;case"decimal":i={type:"decimal",value:parseFloat(a)};break;case"bool":i={type:"bool",value:a==="true"||a==="1"};break;case"filetime":i={type:"date",value:new Date(a)};break;case"r8":i={type:"r8",value:parseFloat(a)};break;case"i8":i={type:"i8",value:BigInt(a)};break;case"error":i={type:"error",value:a};break;default:i={type:"string",value:a};break}return{name:n,value:i}}).filter(Boolean)}Wt();sn();function rn(e){let t=new Map;try{let o=Lt(e);for(let n of o.children)if(ct(n.tag)==="Relationship"){let s={type:n.attrs.Type??"",target:n.attrs.Target??""};n.attrs.TargetMode&&(s.targetMode=n.attrs.TargetMode),t.set(n.attrs.Id??"",s)}}catch{}return t}function Rr(e){let t=new Map;try{let o=Lt(e);for(let n of o.children)if(ct(n.tag)==="Override"){let r=n.attrs.PartName??"",a=n.attrs.ContentType??"";t.set(r.startsWith("/")?r.slice(1):r,a)}}catch{}return t}function Pr(e){let t=Lt(e),o=new Map,n=[],s={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"mm-dd-yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@"},r=oe(t,"numFmts");if(r)for(let g of ut(r,"numFmt")){let u=parseInt(g.attrs.numFmtId??"0",10),$=g.attrs.formatCode??"";o.set(u,$)}let a=oe(t,"fonts"),i=[];if(a)for(let g of ut(a,"font"))i.push(an(g));let l=oe(t,"fills"),h=[];if(l)for(let g of ut(l,"fill"))h.push(Wn(g));let m=oe(t,"borders"),c=[];if(m)for(let g of ut(m,"border"))c.push(Hn(g));let d=oe(t,"cellXfs");if(d)for(let g of ut(d,"xf")){let u=parseInt(g.attrs.fontId??"0",10),$=parseInt(g.attrs.fillId??"0",10),x=parseInt(g.attrs.borderId??"0",10),b=parseInt(g.attrs.numFmtId??"0",10),C=g.attrs.applyFont==="1",y=g.attrs.applyFill==="1",v=g.attrs.applyBorder==="1",w=g.attrs.applyAlignment==="1",k=g.attrs.applyNumberFormat==="1",T=g.attrs.applyProtection==="1",S={};C&&i[u]&&(S.font=i[u]),y&&h[$]&&(S.fill=h[$]),v&&c[x]&&(S.border=c[x]),k&&b!==0&&(o.has(b)?S.numberFormat={formatCode:o.get(b)}:s[b]&&(S.numFmtId=b));let D=B(g,"alignment");w&&D&&(S.alignment=zn(D));let R=B(g,"protection");T&&R&&(R.attrs.locked!==void 0&&(S.locked=R.attrs.locked!=="0"),R.attrs.hidden!==void 0&&(S.hidden=R.attrs.hidden!=="0")),n.push(S)}let f=[],p=oe(t,"dxfs");if(p)for(let g of ut(p,"dxf")){let u={},$=B(g,"font");$&&(u.font=an($));let x=B(g,"fill");x&&(u.fill=Wn(x));let b=B(g,"border");b&&(u.border=Hn(b));let C=B(g,"numFmt");if(C){let v=C.attrs.formatCode??"";v&&(u.numberFormat={formatCode:v})}let y=B(g,"alignment");y&&(u.alignment=zn(y)),f.push(u)}return{xfs:n,numFmts:o,dxfs:f}}function oe(e,t){if(ct(e.tag)===t)return e;for(let o of e.children){let n=oe(o,t);if(n)return n}}function an(e){let t={};for(let o of e.children)switch(ct(o.tag)){case"b":t.bold=o.attrs.val!=="0";break;case"i":t.italic=o.attrs.val!=="0";break;case"strike":t.strike=o.attrs.val!=="0";break;case"u":t.underline=o.attrs.val??"single";break;case"sz":t.size=parseFloat(o.attrs.val??"11");break;case"name":t.name=o.attrs.val;break;case"family":t.family=parseInt(o.attrs.val??"0",10);break;case"scheme":t.scheme=o.attrs.val;break;case"charset":t.charset=parseInt(o.attrs.val??"0",10);break;case"vertAlign":t.vertAlign=o.attrs.val;break;case"color":{let n=o.attrs.rgb,s=o.attrs.theme;n?t.color=n:s&&(t.color=`theme:${s}${o.attrs.tint?":tint:"+o.attrs.tint:""}`);break}}return t}function Wn(e){let t=B(e,"patternFill");if(t){let n=B(t,"fgColor"),s=B(t,"bgColor");return{type:"pattern",pattern:t.attrs.patternType,fgColor:n?.attrs.rgb??(n?.attrs.theme?`theme:${n.attrs.theme}${n.attrs.tint?":tint:"+n.attrs.tint:""}`:void 0),bgColor:s?.attrs.rgb??(s?.attrs.theme?`theme:${s.attrs.theme}${s.attrs.tint?":tint:"+s.attrs.tint:""}`:void 0)}}let o=B(e,"gradientFill");if(o){let n=ut(o,"stop").concat(ut(o,"gradientStop")).map(s=>{let r=B(s,"color");return{position:parseFloat(s.attrs.position??"0"),color:r?.attrs.rgb??(r?.attrs.theme?`theme:${r.attrs.theme}${r.attrs.tint?":tint:"+r.attrs.tint:""}`:"FF000000")}});return{type:"gradient",gradientType:o.attrs.type,degree:o.attrs.degree?parseFloat(o.attrs.degree):void 0,stops:n}}return{type:"pattern",pattern:"none"}}function Hn(e){let t=o=>{let n=B(e,o);if(!n)return;let s=n.attrs.style,r=B(n,"color");if(!s&&!r)return;let a=r?.attrs.rgb??(r?.attrs.theme?`theme:${r.attrs.theme}${r.attrs.tint?":tint:"+r.attrs.tint:""}`:void 0);return{style:s,color:a}};return{left:t("left"),right:t("right"),top:t("top"),bottom:t("bottom"),diagonal:t("diagonal"),diagonalUp:e.attrs.diagonalUp==="1",diagonalDown:e.attrs.diagonalDown==="1"}}function zn(e){let t={};return e.attrs.horizontal&&(t.horizontal=e.attrs.horizontal),e.attrs.vertical&&(t.vertical=e.attrs.vertical),e.attrs.wrapText&&(t.wrapText=e.attrs.wrapText!=="0"),e.attrs.shrinkToFit&&(t.shrinkToFit=e.attrs.shrinkToFit!=="0"),e.attrs.textRotation&&(t.textRotation=parseInt(e.attrs.textRotation,10)),e.attrs.indent&&(t.indent=parseInt(e.attrs.indent,10)),e.attrs.readingOrder&&(t.readingOrder=parseInt(e.attrs.readingOrder,10)),t}function Mr(e){let t=Lt(e);return ut(t,"si").map(o=>{let n=B(o,"t"),s=ut(o,"r");if(n&&!s.length)return{text:n.text??""};let r=s.map(l=>{let h=B(l,"t")?.text??"",m=B(l,"rPr"),c={text:h};return m&&(c.font=an(m)),c}),a=r.map(l=>l.text).join("");return r.some(l=>l.font&&Object.keys(l.font).length>0)?{text:a,richText:r}:{text:a}})}function Er(e,t,o,n){let s=new ke(t),r=Lt(e),a=[],i=[],l="",h="",m=[],c=new Map,d=new Set(["sheetPr","dimension","sheetViews","sheetFormatPr","cols","sheetData","mergeCells","conditionalFormatting","dataValidations","sheetProtection","printOptions","pageMargins","pageSetup","headerFooter","drawing","tableParts","autoFilter","rowBreaks","colBreaks","picture","oleObjects","ctrlProps","legacyDrawing","AlternateContent","extLst"]);for(let f of r.children){let p=ct(f.tag);switch(p){case"sheetViews":Br(f,s);break;case"cols":_r(f,s,o);break;case"sheetData":jr(f,s,o,n,c);break;case"mergeCells":Or(f,s);break;case"autoFilter":s.autoFilter={ref:f.attrs.ref??""};break;case"tableParts":for(let g of ut(f,"tablePart")){let u=g.attrs["r:id"]??"";u&&i.push(u)}break;case"sheetProtection":Lr(f,s);break;case"pageMargins":Nr(f,s);break;case"pageSetup":Xr(f,s);break;case"headerFooter":Ur(f,s);break;case"printOptions":Vr(f,s);break;case"conditionalFormatting":Wr(f,s,o);break;case"dataValidations":Hr(f,s);break;case"rowBreaks":for(let g of ut(f,"brk")){let u=parseInt(g.attrs.id??"0",10);u>0&&s.addRowBreak(u,g.attrs.man==="1")}break;case"colBreaks":for(let g of ut(f,"brk")){let u=parseInt(g.attrs.id??"0",10);u>0&&s.addColBreak(u,g.attrs.man==="1")}break;case"drawing":h=f.attrs["r:id"]??"";break;case"legacyDrawing":l=f.attrs["r:id"]??"";break;case"AlternateContent":{let g=f.children.find($=>typeof $!="string"&&ct($.tag)==="Choice"),u=g?g.children.find($=>typeof $!="string"&&ct($.tag)==="controls"):void 0;if(u)for(let $ of u.children){if(typeof $=="string")continue;let x;if(ct($.tag)==="control"?x=$:ct($.tag)==="AlternateContent"&&(x=$.children.find(v=>typeof v!="string"&&ct(v.tag)==="Choice")?.children.find(v=>typeof v!="string"&&ct(v.tag)==="control")),!x)continue;let b=x.children.find(y=>typeof y!="string"&&ct(y.tag)==="controlPr"),C=x.attrs["r:id"]??b?.attrs["r:id"]??"";C&&m.push(C)}break}case"extLst":Zr(f,s);break;default:d.has(p)||a.push(ro(f));break}}return{ws:s,originalXml:e,unknownParts:a,tableRIds:i,legacyDrawingRId:l,ctrlPropRIds:m,drawingRId:h,vmCells:c}}function Br(e,t){let o=ut(e,"sheetView")[0];if(!o)return;t.view={showGridLines:o.attrs.showGridLines!=="0",showRowColHeaders:o.attrs.showRowColHeaders!=="0",zoomScale:o.attrs.zoomScale?parseInt(o.attrs.zoomScale,10):void 0,rightToLeft:o.attrs.rightToLeft==="1",tabSelected:o.attrs.tabSelected==="1",view:o.attrs.view};let n=B(o,"pane");n&&n.attrs.state==="frozen"&&(t.freezePane={col:n.attrs.xSplit?parseInt(n.attrs.xSplit,10):void 0,row:n.attrs.ySplit?parseInt(n.attrs.ySplit,10):void 0})}function _r(e,t,o){for(let n of ut(e,"col")){let s=parseInt(n.attrs.min??"1",10),r=parseInt(n.attrs.max??"1",10),a={width:n.attrs.width?parseFloat(n.attrs.width):void 0,hidden:n.attrs.hidden==="1",customWidth:n.attrs.customWidth==="1",outlineLevel:n.attrs.outlineLevel?parseInt(n.attrs.outlineLevel,10):void 0,style:n.attrs.style?o.xfs[parseInt(n.attrs.style,10)]:void 0};for(let i=s;i<=r;i++)t.setColumn(i,a)}}function jr(e,t,o,n,s){for(let r of ut(e,"row")){let a=parseInt(r.attrs.r??"0",10);if(!a)continue;let i={};r.attrs.ht&&(i.height=parseFloat(r.attrs.ht)),r.attrs.hidden&&(i.hidden=r.attrs.hidden==="1"),r.attrs.outlineLevel&&(i.outlineLevel=parseInt(r.attrs.outlineLevel,10)),r.attrs.collapsed&&(i.collapsed=r.attrs.collapsed==="1"),r.attrs.s&&(i.style=o.xfs[parseInt(r.attrs.s,10)]),Object.keys(i).length&&t.setRow(a,i);for(let l of ut(r,"c")){let h=l.attrs.r??"";if(!h)continue;let{row:m,col:c}=qt(h),d=l.attrs.s?parseInt(l.attrs.s,10):0,f=d>0?o.xfs[d]:void 0,p=l.attrs.t??"",g=B(l,"f"),u=B(l,"v"),$={};f&&($.style=f);let x=l.attrs.vm;if(x&&s&&s.set(h,parseInt(x,10)),g)g.attrs.t==="array"?$.arrayFormula=g.text??"":$.formula=g.text??"";else if(u){let b=u.text??"";switch(p){case"s":{let C=parseInt(b,10),y=n[C];y?($.value=y.text,y.richText&&($.richText=y.richText)):$.value="";break}case"b":$.value=b==="1"||b==="true";break;case"str":case"inlineStr":{let C=B(l,"is");$.value=C?B(C,"t")?.text??b:b;break}case"e":$.value=new ee(b);break;default:{let C=parseFloat(b);$.value=isNaN(C)?b:C;break}}}(Object.keys($).length||$.value!==void 0)&&t.setCell(m,c,$)}}}function Or(e,t){for(let o of ut(e,"mergeCell")){let n=o.attrs.ref??"";n.includes(":")&&t.mergeByRef(n)}}function Lr(e,t){t.protection={sheet:e.attrs.sheet!=="0",password:void 0,selectLockedCells:e.attrs.selectLockedCells!=="0",selectUnlockedCells:e.attrs.selectUnlockedCells!=="0",formatCells:e.attrs.formatCells==="0",formatColumns:e.attrs.formatColumns==="0",formatRows:e.attrs.formatRows==="0",insertColumns:e.attrs.insertColumns==="0",insertRows:e.attrs.insertRows==="0",insertHyperlinks:e.attrs.insertHyperlinks==="0",deleteColumns:e.attrs.deleteColumns==="0",deleteRows:e.attrs.deleteRows==="0",sort:e.attrs.sort==="0",autoFilter:e.attrs.autoFilter==="0",pivotTables:e.attrs.pivotTables==="0"}}function Nr(e,t){t.pageMargins={left:parseFloat(e.attrs.left??"0.7"),right:parseFloat(e.attrs.right??"0.7"),top:parseFloat(e.attrs.top??"0.75"),bottom:parseFloat(e.attrs.bottom??"0.75"),header:parseFloat(e.attrs.header??"0.3"),footer:parseFloat(e.attrs.footer??"0.3")}}function Xr(e,t){t.pageSetup={paperSize:e.attrs.paperSize?parseInt(e.attrs.paperSize,10):void 0,orientation:e.attrs.orientation,fitToPage:e.attrs.fitToPage==="1",fitToWidth:e.attrs.fitToWidth?parseInt(e.attrs.fitToWidth,10):void 0,fitToHeight:e.attrs.fitToHeight?parseInt(e.attrs.fitToHeight,10):void 0,scale:e.attrs.scale?parseInt(e.attrs.scale,10):void 0,horizontalDpi:e.attrs.horizontalDpi?parseInt(e.attrs.horizontalDpi,10):void 0,verticalDpi:e.attrs.verticalDpi?parseInt(e.attrs.verticalDpi,10):void 0}}function Ur(e,t){t.headerFooter={oddHeader:B(e,"oddHeader")?.text,oddFooter:B(e,"oddFooter")?.text,evenHeader:B(e,"evenHeader")?.text,evenFooter:B(e,"evenFooter")?.text,firstHeader:B(e,"firstHeader")?.text,firstFooter:B(e,"firstFooter")?.text,differentOddEven:e.attrs.differentOddEven==="1",differentFirst:e.attrs.differentFirst==="1"}}function Vr(e,t){t.printOptions={gridLines:e.attrs.gridLines==="1",gridLinesSet:e.attrs.gridLinesSet==="1",headings:e.attrs.headings==="1",centerHorizontal:e.attrs.horizontalCentered==="1",centerVertical:e.attrs.verticalCentered==="1"}}function Wr(e,t,o){let n=e.attrs.sqref??"";for(let s of ut(e,"cfRule")){let r=s.attrs.type??"cellIs",a={sqref:n,type:r};if(s.attrs.operator&&(a.operator=s.attrs.operator),s.attrs.priority&&(a.priority=parseInt(s.attrs.priority,10)),s.attrs.text&&(a.text=s.attrs.text),s.attrs.aboveAverage==="0"&&(a.aboveAverage=!1),s.attrs.percent==="1"&&(a.percent=!0),s.attrs.rank&&(a.rank=parseInt(s.attrs.rank,10)),s.attrs.timePeriod&&(a.timePeriod=s.attrs.timePeriod),s.attrs.dxfId!==void 0){let c=parseInt(s.attrs.dxfId,10);o.dxfs[c]&&(a.style=o.dxfs[c])}let i=ut(s,"formula");i[0]?.text&&(a.formula=i[0].text),i[1]?.text&&(a.formula2=i[1].text);let l=B(s,"colorScale");if(l){let c=ut(l,"cfvo").map(f=>({type:f.attrs.type??"min",val:f.attrs.val})),d=ut(l,"color").map(f=>f.attrs.rgb??f.attrs.theme??"");a.colorScale={type:"colorScale",cfvo:c,color:d}}let h=B(s,"dataBar");if(h){let c=ut(h,"cfvo"),d=B(h,"color");a.dataBar={type:"dataBar",showValue:h.attrs.showValue!=="0"?void 0:!1,minType:c[0]?.attrs.type,minVal:c[0]?.attrs.val,maxType:c[1]?.attrs.type,maxVal:c[1]?.attrs.val,color:d?.attrs.rgb}}let m=B(s,"iconSet");if(m){let c=ut(m,"cfvo").map(d=>({type:d.attrs.type??"percent",val:d.attrs.val}));a.iconSet={type:"iconSet",iconSet:m.attrs.iconSet??"3TrafficLights1",cfvo:c,showValue:m.attrs.showValue==="0"?!1:void 0,reverse:m.attrs.reverse==="1"?!0:void 0}}t.addConditionalFormat(a)}}function Hr(e,t){for(let o of ut(e,"dataValidation")){let n=o.attrs.sqref??"";if(!n)continue;let s=o.attrs.type??"whole",r={type:s};o.attrs.operator&&(r.operator=o.attrs.operator),o.attrs.allowBlank==="1"&&(r.allowBlank=!0),o.attrs.showErrorMessage==="1"&&(r.showErrorAlert=!0),o.attrs.errorTitle&&(r.errorTitle=o.attrs.errorTitle),o.attrs.error&&(r.error=o.attrs.error),o.attrs.showInputMessage==="1"&&(r.showInputMessage=!0),o.attrs.promptTitle&&(r.promptTitle=o.attrs.promptTitle),o.attrs.prompt&&(r.prompt=o.attrs.prompt),o.attrs.showDropDown==="1"&&(r.showDropDown=!1);let a=B(o,"formula1"),i=B(o,"formula2");a?.text&&(s==="list"&&a.text.startsWith('"')&&a.text.endsWith('"')?r.list=a.text.slice(1,-1).split(","):r.formula1=a.text),i?.text&&(r.formula2=i.text),t.addDataValidation(n,r)}}function zr(e){try{let t=Lt(e);if(ct(t.tag)!=="table")return null;let n=t.attrs.name??"",s=t.attrs.displayName??n,r=t.attrs.ref??"",a=parseInt(t.attrs.totalsRowCount??"0",10),i=[],l=oe(t,"tableColumns");if(l)for(let c of ut(l,"tableColumn")){let d={name:c.attrs.name??""};c.attrs.totalsRowFunction&&(d.totalsRowFunction=c.attrs.totalsRowFunction),c.attrs.totalsRowFormula&&(d.totalsRowFormula=c.attrs.totalsRowFormula),c.attrs.totalsRowLabel&&(d.totalsRowLabel=c.attrs.totalsRowLabel),i.push(d)}let h={name:n,ref:r,columns:i};s&&s!==n&&(h.displayName=s),a>0&&(h.totalsRow=!0);let m=oe(t,"tableStyleInfo");return m&&(m.attrs.name&&(h.style=m.attrs.name),m.attrs.showFirstColumn==="1"&&(h.showFirstColumn=!0),m.attrs.showLastColumn==="1"&&(h.showLastColumn=!0),m.attrs.showRowStripes==="1"&&(h.showRowStripes=!0),m.attrs.showColumnStripes==="1"&&(h.showColumnStripes=!0)),h}catch{return null}}var De=9525;function Gn(e){return{col:parseInt(B(e,"col")?.text??"0",10),row:parseInt(B(e,"row")?.text??"0",10),colOff:parseInt(B(e,"colOff")?.text??"0",10),rowOff:parseInt(B(e,"rowOff")?.text??"0",10)}}function qn(e){return{png:"png",jpg:"jpeg",jpeg:"jpeg",gif:"gif",emf:"emf",wmf:"wmf",tiff:"tiff",tif:"tiff",svg:"svg",ico:"ico",webp:"webp",bmp:"bmp"}[e.toLowerCase()]??"png"}function Gr(e,t,o,n,s){let r=Lt(e);for(let a of r.children){if(typeof a=="string")continue;let i=ct(a.tag);if(i!=="twoCellAnchor"&&i!=="oneCellAnchor"&&i!=="absoluteAnchor")continue;let l=Yr(a,i),h=wt(a,"pic");if(h){Qr(h,a,i,l,t,o,n,s);continue}let m=wt(a,"graphicFrame");if(m){qr(m,a,i,t,o,n,s);continue}let c=wt(a,"oMath");if(c){Jr(c,a,i,l,s);continue}let d=wt(a,"sp");if(d){Kr(d,a,i,s);continue}}}function qr(e,t,o,n,s,r,a){let i=wt(e,"chart");if(!i||!n)return;let l=i.attrs["r:id"]??jn(i,"r:id")??"";if(!l)return;let h=n.get(l);if(!h)return;let m=h.target.startsWith("/")?h.target.slice(1):Ve(s,h.target),c=r(m);if(!c)return;let f=new TextDecoder().decode(c.data),p=Lt(f),g={col:0,row:0},u={col:8,row:15};if(o==="twoCellAnchor"){let E=B(t,"from"),_=B(t,"to");E&&(g={col:parseInt(B(E,"col")?.text??"0",10),row:parseInt(B(E,"row")?.text??"0",10)}),_&&(u={col:parseInt(B(_,"col")?.text??"0",10),row:parseInt(B(_,"row")?.text??"0",10)})}let $=wt(p,"plotArea");if(!$)return;let x={barChart:"column",bar3DChart:"column",lineChart:"line",line3DChart:"line",areaChart:"area",area3DChart:"area",pieChart:"pie",pie3DChart:"pie",doughnutChart:"doughnut",scatterChart:"scatter",bubbleChart:"bubble",radarChart:"radar",stockChart:"stock"},b="column",C;for(let E of $.children){if(typeof E=="string")continue;let _=ct(E.tag);if(x[_]){if(b=x[_],C=E,_==="barChart"||_==="bar3DChart"){(B(E,"barDir")?.attrs.val??"")==="bar"&&(b="bar");let V=B(E,"grouping")?.attrs.val??"";V==="stacked"&&(b=b==="bar"?"barStacked":"columnStacked"),V==="percentStacked"&&(b=b==="bar"?"barStacked100":"columnStacked100")}if(_==="lineChart"){let M=wt(E,"marker");if(M){let N=B(M,"symbol")?.attrs.val??"";N&&N!=="none"&&(b="lineMarker")}}_==="scatterChart"&&B(E,"scatterStyle")?.attrs.val?.includes("Smooth")&&(b="scatterSmooth"),_==="radarChart"&&B(E,"radarStyle")?.attrs.val==="filled"&&(b="radarFilled");break}}if(!C)return;let y=[];for(let E of ut(C,"ser")){let _={values:""},M=B(E,"tx");if(M){let K=wt(M,"strRef");if(K){let mt=B(K,"f");mt?.text&&(_.name=mt.text);let it=B(K,"strCache");if(it){let gt=wt(it,"pt"),St=gt?wt(gt,"v"):void 0;St?.text&&(_.name=St.text)}}let z=wt(M,"v");z?.text&&!_.name&&(_.name=z.text)}let N=B(E,"val")||B(E,"yVal");if(N){let K=wt(N,"numRef");if(K){let z=B(K,"f");z?.text&&(_.values=z.text)}}let H=B(E,"cat")||B(E,"xVal");if(H){let K=wt(H,"strRef"),z=wt(H,"numRef"),mt=K||z;if(mt){let it=B(mt,"f");it?.text&&(_.categories=it.text)}}let V=B(E,"spPr");if(V){let K=B(V,"solidFill");if(K){let z=B(K,"srgbClr");z?.attrs.val&&(_.color="#"+z.attrs.val)}}_.values&&y.push(_)}if(!y.length)return;let v,w=B(p,"title")||wt(p,"title");if(w){let E=wt(w,"t");E?.text&&(v=E.text)}let k,T,S=wt($,"catAx")||wt($,"dateAx"),D=wt($,"valAx");if(S){k={};let E=wt(S,"title");if(E){let _=wt(E,"t");_?.text&&(k.title=_.text)}}if(D){T={};let E=wt(D,"title");if(E){let M=wt(E,"t");M?.text&&(T.title=M.text)}B(D,"majorGridlines")&&(T.gridLines=!0)}let R=!1,A=wt(p,"legend");A&&(R=B(A,"legendPos")?.attrs.val||!0);let Q=B(C,"varyColors")?.attrs.val!=="0",q={type:b,series:y,from:g,to:u};v&&(q.title=v),k&&(q.xAxis=k),T&&(q.yAxis=T),R!==!1&&(q.legend=R),Q&&(q.varyColors=!0),a.addChart(q)}function Kr(e,t,o,n){let s={col:0,row:0},r={col:2,row:2};if(o==="twoCellAnchor"){let u=B(t,"from"),$=B(t,"to");u&&(s={col:parseInt(B(u,"col")?.text??"0",10),row:parseInt(B(u,"row")?.text??"0",10)}),$&&(r={col:parseInt(B($,"col")?.text??"0",10),row:parseInt(B($,"row")?.text??"0",10)})}let a=wt(e,"spPr"),i="rect",l,h,m,c;if(a){let u=wt(a,"prstGeom");if(u){let C=u.attrs.prst??"";new Set(["rect","roundRect","ellipse","triangle","diamond","pentagon","hexagon","octagon","star5","star6","rightArrow","leftArrow","upArrow","downArrow","line","curvedConnector3","callout1","callout2","cloud","heart","lightningBolt","sun","moon","smileyFace","flowChartProcess","flowChartDecision","flowChartTerminator","flowChartDocument"]).has(C)&&(i=C)}let $=B(a,"solidFill");if($){let C=B($,"srgbClr");C?.attrs.val&&(l="#"+C.attrs.val);let y=B($,"schemeClr");y?.attrs.val&&(l="theme:"+y.attrs.val)}let x=B(a,"ln");if(x){let C=x.attrs.w;C&&(m=Math.round(parseInt(C,10)/De));let y=B(x,"solidFill");if(y){let v=B(y,"srgbClr");v?.attrs.val&&(h="#"+v.attrs.val)}}let b=wt(a,"xfrm");b?.attrs.rot&&(c=parseInt(b.attrs.rot,10)/6e4)}let d,f,p=wt(e,"txBody");if(p){let u=B(p,"bodyPr"),x=(u?B(u,"prstTxWarp"):void 0)?.attrs.prst??u?.attrs.prstTxWarp??"",b=[];for(let y of ut(p,"p"))for(let v of ut(y,"r")){let w=B(v,"t");if(w?.text&&b.push(w.text),!f){let k=B(v,"rPr");if(k){f={},k.attrs.sz&&(f.size=parseInt(k.attrs.sz,10)/100),k.attrs.b==="1"&&(f.bold=!0),k.attrs.i==="1"&&(f.italic=!0);let T=wt(k,"latin");T?.attrs.typeface&&(f.name=T.attrs.typeface);let S=B(k,"solidFill");if(S){let D=B(S,"srgbClr");D?.attrs.val&&(f.color="#"+D.attrs.val)}}}}if(d=b.join(""),x&&new Set(["textPlain","textArchUp","textArchDown","textCircle","textWave1","textWave2","textInflate","textDeflate","textFadeUp","textFadeDown","textFadeLeft","textFadeRight","textSlantUp","textSlantDown","textCascadeUp","textCascadeDown","textChevron","textRingInside","textRingOutside","textStop"]).has(x)&&d){let y={text:d,from:s,to:r};x!=="textPlain"&&(y.preset=x),f&&(y.font=f),l&&(y.fillColor=l),h&&(y.outlineColor=h),n.addWordArt(y);return}}let g={type:i,from:s,to:r};d&&(g.text=d),l&&(g.fillColor=l),h&&(g.lineColor=h),m&&(g.lineWidth=m),f&&(g.font=f),c&&(g.rotation=c),n.addShape(g)}function Zr(e,t){for(let o of ut(e,"ext")){let n=o.children?.filter(s=>typeof s!="string"&&ct(s.tag)==="sparklineGroups");if(n?.length)for(let s of n)for(let r of ut(s,"sparklineGroup")){let a=r.attrs.type??"line",i=a==="column"?"bar":a==="stacked"?"stacked":"line",l=r.children?.find(D=>typeof D!="string"&&ct(D.tag)==="colorSeries"),h=r.children?.find(D=>typeof D!="string"&&ct(D.tag)==="colorHigh"),m=r.children?.find(D=>typeof D!="string"&&ct(D.tag)==="colorLow"),c=r.children?.find(D=>typeof D!="string"&&ct(D.tag)==="colorFirst"),d=r.children?.find(D=>typeof D!="string"&&ct(D.tag)==="colorLast"),f=r.children?.find(D=>typeof D!="string"&&ct(D.tag)==="colorNegative"),p=r.children?.find(D=>typeof D!="string"&&ct(D.tag)==="colorMarkers"),g=r.attrs.high==="1",u=r.attrs.low==="1",$=r.attrs.first==="1",x=r.attrs.last==="1",b=r.attrs.negative==="1",C=r.attrs.markers==="1",y=r.attrs.lineWeight,v=y?parseFloat(y):void 0,w=r.attrs.minAxisType==="individual"?"individual":r.attrs.minAxisType==="custom"?"custom":void 0,k=r.attrs.maxAxisType==="individual"?"individual":r.attrs.maxAxisType==="custom"?"custom":void 0,T=r.children?.find(D=>typeof D!="string"&&ct(D.tag)==="sparklines");if(!T)continue;let S=T.children?.filter(D=>typeof D!="string"&&ct(D.tag)==="sparkline");if(S)for(let D of S){let R=D.children?.find(E=>typeof E!="string"&&ct(E.tag)==="f"),A=D.children?.find(E=>typeof E!="string"&&ct(E.tag)==="sqref"),W=R?.text??"",Q=A?.text??"";if(!W||!Q)continue;let q={type:i,dataRange:W,location:Q};if(l){let E=l.attrs.rgb;E&&(q.color="#"+E.slice(2));let _=l.attrs.theme;_&&(q.color="theme:"+_)}if(h){let E=h.attrs.rgb;E&&(q.highColor="#"+E.slice(2));let _=h.attrs.theme;_&&(q.highColor="theme:"+_)}if(m){let E=m.attrs.rgb;E&&(q.lowColor="#"+E.slice(2));let _=m.attrs.theme;_&&(q.lowColor="theme:"+_)}if(c){let E=c.attrs.rgb;E&&(q.firstColor="#"+E.slice(2));let _=c.attrs.theme;_&&(q.firstColor="theme:"+_)}if(d){let E=d.attrs.rgb;E&&(q.lastColor="#"+E.slice(2));let _=d.attrs.theme;_&&(q.lastColor="theme:"+_)}if(f){let E=f.attrs.rgb;E&&(q.negativeColor="#"+E.slice(2));let _=f.attrs.theme;_&&(q.negativeColor="theme:"+_)}if(p){let E=p.attrs.rgb;E&&(q.markersColor="#"+E.slice(2));let _=p.attrs.theme;_&&(q.markersColor="theme:"+_)}g&&(q.showHigh=!0),u&&(q.showLow=!0),$&&(q.showFirst=!0),x&&(q.showLast=!0),b&&(q.showNegative=!0),C&&(q.showMarkers=!0),v!==void 0&&(q.lineWidth=v),w&&(q.minAxisType=w),k&&(q.maxAxisType=k),t.addSparkline(q)}}}}function Yr(e,t){let o={};if(t==="twoCellAnchor"||t==="oneCellAnchor"){let n=B(e,"from");n&&(o.from={col:parseInt(B(n,"col")?.text??"0",10),row:parseInt(B(n,"row")?.text??"0",10),colOff:parseInt(B(n,"colOff")?.text??"0",10),rowOff:parseInt(B(n,"rowOff")?.text??"0",10)})}if(t==="oneCellAnchor"){let n=wt(e,"ext");n&&(o.width=parseInt(n.attrs.cx??"0",10),o.height=parseInt(n.attrs.cy??"0",10))}return o}function Qr(e,t,o,n,s,r,a,i){let l=wt(e,"blipFill"),h=l?wt(l,"blip"):void 0,m=h?.attrs["r:embed"]??h?.attrs.embed??"";if(!m||!s)return;let c=s.get(m);if(!c)return;let d=c.target.startsWith("/")?c.target.slice(1):Ve(r,c.target),f=a(d);if(!f)return;let p=d.split(".").pop()??"png",g=qn(p),$=wt(e,"cNvPr")?.attrs.descr||void 0,x={data:f.data,format:g};if($&&(x.altText=$),o==="twoCellAnchor"){let b=B(t,"from"),C=B(t,"to");b&&(x.from=Gn(b)),C&&(x.to=Gn(C))}else if(o==="oneCellAnchor")n.from&&(x.from=n.from),n.width&&(x.width=Math.round(n.width/De)),n.height&&(x.height=Math.round(n.height/De));else{let b=B(t,"pos"),C=B(t,"ext");b&&(x.position={x:Math.round(parseInt(b.attrs.x??"0",10)/De),y:Math.round(parseInt(b.attrs.y??"0",10)/De)}),C&&(x.width=Math.round(parseInt(C.attrs.cx??"0",10)/De),x.height=Math.round(parseInt(C.attrs.cy??"0",10)/De))}i.addImage(x)}function Jr(e,t,o,n,s){let r=kt(e);if(!r.length)return;let a=n.from??{col:0,row:0},i={elements:r,from:a};n.width&&(i.width=n.width),n.height&&(i.height=n.height);let l=wt(e,"rPr");if(l){let h=l.attrs.sz;h&&(i.fontSize=parseInt(h,10)/100);let m=wt(l,"latin");m?.attrs.typeface&&(i.fontName=m.attrs.typeface)}s.addMathEquation(i)}function kt(e){let t=[];for(let o of e.children){if(typeof o=="string")continue;let n=ta(o);n&&t.push(n)}return t}function ta(e){switch(ct(e.tag)){case"r":return{type:"text",text:wt(e,"t")?.text??""};case"f":{let o=B(e,"num"),n=B(e,"den");return{type:"frac",base:o?kt(o):[],argument:n?kt(n):[]}}case"sSup":{let o=B(e,"e"),n=B(e,"sup");return{type:"sup",base:o?kt(o):[],argument:n?kt(n):[]}}case"sSub":{let o=B(e,"e"),n=B(e,"sub");return{type:"sub",base:o?kt(o):[],argument:n?kt(n):[]}}case"sSubSup":{let o=B(e,"e"),n=B(e,"sub"),s=B(e,"sup");return{type:"subSup",base:o?kt(o):[],subscript:n?kt(n):[],superscript:s?kt(s):[]}}case"nary":{let o=B(e,"naryPr"),n=o?B(o,"chr"):void 0,s=n?.attrs["m:val"]??n?.attrs.val??"\u2211",r=B(e,"sub"),a=B(e,"sup"),i=B(e,"e");return{type:"nary",operator:s,lower:r?kt(r):[],upper:a?kt(a):[],body:i?kt(i):[]}}case"rad":{let o=B(e,"radPr"),n=o?B(o,"degHide"):void 0,s=n?.attrs["m:val"]==="1"||n?.attrs.val==="1",r=B(e,"deg"),a=B(e,"e");return{type:"rad",hideDegree:s,degree:r?kt(r):[],body:a?kt(a):[]}}case"d":{let o=B(e,"dPr"),n=o?B(o,"begChr"):void 0,s=o?B(o,"endChr"):void 0,r=B(e,"e");return{type:"delim",open:n?.attrs["m:val"]??n?.attrs.val??"(",close:s?.attrs["m:val"]??s?.attrs.val??")",body:r?kt(r):[]}}case"func":{let o=B(e,"fName"),n=B(e,"e");return{type:"func",base:o?kt(o):[],argument:n?kt(n):[]}}case"groupChr":{let o=B(e,"groupChrPr"),n=o?B(o,"chr"):void 0,s=B(e,"e");return{type:"groupChar",operator:n?.attrs["m:val"]??n?.attrs.val??"\u23DF",base:s?kt(s):[]}}case"acc":{let o=B(e,"accPr"),n=o?B(o,"chr"):void 0,s=B(e,"e");return{type:"accent",operator:n?.attrs["m:val"]??n?.attrs.val??"\u0302",base:s?kt(s):[]}}case"bar":{let o=B(e,"e");return{type:"bar",base:o?kt(o):[]}}case"limLow":{let o=B(e,"e"),n=B(e,"lim");return{type:"limLow",base:o?kt(o):[],argument:n?kt(n):[]}}case"limUpp":{let o=B(e,"e"),n=B(e,"lim");return{type:"limUpp",base:o?kt(o):[],argument:n?kt(n):[]}}case"m":{let o=[];for(let n of ut(e,"mr")){let s=[];for(let r of ut(n,"e")){let a=kt(r);a.length===1?s.push(a[0]):s.push({type:"text",text:a.map(i=>i.text??"").join("")})}o.push(s)}return{type:"matrix",rows:o}}case"eqArr":{let o=[];for(let n of ut(e,"e"))o.push(kt(n));return{type:"eqArr",rows:o}}default:return null}}function ea(e,t,o,n){let s=t("xl/metadata.xml");if(!s)return;let r=Lt(s),a=B(r,"valueMetadata");if(!a)return;let i=ut(a,"bk"),l=r.children.find(x=>typeof x!="string"&&ct(x.tag)==="futureMetadata"),h=l?ut(l,"bk"):[],m=t("xl/richData/rdrichvalue.xml");if(!m)return;let c=Lt(m),d=ut(c,"rv"),f=t("xl/richData/_rels/richValueRel.xml.rels");if(!f)return;let p=rn(f),g=t("xl/richData/richValueRel.xml");if(!g)return;let u=Lt(g),$=ut(u,"rel");for(let[x,b]of e){let C=i[b-1];if(!C)continue;let y=C.children.find(N=>typeof N!="string"&&ct(N.tag)==="rc");if(!y)continue;let v=parseInt(y.attrs.v??"-1",10);if(v<0)continue;let w=h[v];if(!w)continue;let k=wt(w,"rvb"),T=parseInt(k?.attrs.i??"-1",10);if(T<0)continue;let S=d[T];if(!S)continue;let D=ut(S,"v"),R=parseInt(D[0]?.text??"-1",10);if(R<0)continue;let A=$[R];if(!A)continue;let W=A.attrs["r:id"]??"",Q=p.get(W);if(!Q)continue;let q=Q.target.startsWith("/")?Q.target.slice(1):`xl/richData/${Q.target}`,E=o(q);if(!E)continue;let _=q.split(".").pop()??"png",M=qn(_);n.addCellImage({data:E.data,format:M,cell:x})}}function wt(e,t){for(let o of e.children){if(typeof o=="string")continue;if(ct(o.tag)===t)return o;let n=wt(o,t);if(n)return n}}function Ve(e,t){let o=e.replace(/\/$/,"").split("/");for(let n of t.split("/"))n===".."?o.pop():n!=="."&&o.push(n);return o.join("/")}async function Kn(e){let t=await Jo(e),o=E=>t.get(E)??t.get(E.replace(/^\//,"")),n=E=>{let _=o(E);return _?yo(_):void 0},s=n("[Content_Types].xml")??"<Types/>",r=Rr(s),a=n("xl/_rels/workbook.xml.rels")??"<Relationships/>",i=rn(a),l=n("xl/workbook.xml")??"<workbook/>",h=n("xl/styles.xml")??"<styleSheet/>",m=Pr(h),c=n("xl/sharedStrings.xml")??"<sst/>",d=c!=="<sst/>"?Mr(c):[],f=n("docProps/core.xml")??"",p=f?On(f):{},g=n("docProps/app.xml")??"",u={},$="";if(g){let E=Ln(g);u=E.props,$=E.unknownRaw}let x=n("docProps/custom.xml")??"",b=x?Nn(x):[],C=Lt(l),y=oe(C,"sheets"),v=y?ut(y,"sheet"):[],w=[],k=oe(C,"definedNames");if(k)for(let E of ut(k,"definedName")){let _=E.attrs.name??"",M=E.text??"";if(!_||!M)continue;let N={name:_,ref:M};if(E.attrs.localSheetId!==void 0){let H=parseInt(E.attrs.localSheetId,10),V=v[H];V&&(N.scope=V.attrs.name??void 0)}E.attrs.comment&&(N.comment=E.attrs.comment),w.push(N)}let T=new Map;for(let[E,_]of t)E.includes("_rels/")&&T.set(E,rn(yo(_)));let S=[];for(let E of v){let _=E.attrs["r:id"]??Object.values(E.attrs).find(U=>U.startsWith("rId"))??"",M=E.attrs.sheetId??"",N=E.attrs.name??`Sheet${M}`,H=i.get(_);if(!H)continue;let V=H.target.startsWith("/")?H.target.slice(1):`xl/${H.target}`,K=n(V)??"";if(!K)continue;let{ws:z,originalXml:mt,unknownParts:it,tableRIds:gt,legacyDrawingRId:St,ctrlPropRIds:J,drawingRId:G,vmCells:X}=Er(K,N,m,d);z.sheetIndex=S.length+1,z.rId=_;let F=[],P=[];if(gt.length){let U=V.split("/").pop()??"",Y=V.substring(0,V.lastIndexOf("/")+1),st=`${Y}_rels/${U}.rels`,ht=T.get(st);if(ht){for(let tt of gt){let ft=ht.get(tt);if(!ft)continue;let j=ft.target.startsWith("/")?ft.target.slice(1):Ve(Y,ft.target),et=n(j);if(et){let L=zr(et);L&&z.addTable(L),F.push(j),P.push(et)}}z.tableRIds=gt}}if(St&&J.length){let U=V.split("/").pop()??"",Y=V.substring(0,V.lastIndexOf("/")+1),st=`${Y}_rels/${U}.rels`,ht=T.get(st);if(ht){let tt=ht.get(St),ft=tt?tt.target.startsWith("/")?tt.target.slice(1):Ve(Y,tt.target):"",j=ft?n(ft):"",et=[];if(j){let L=Lt(j);for(let $t of L.children){if(typeof $t=="string"||ct($t.tag)!=="shape")continue;let ot=$t.children.find(bt=>typeof bt!="string"&&ct(bt.tag)==="ClientData");if(!ot)continue;let Ft=ot.attrs.ObjectType??"";if(Ft==="Note"||!Ft)continue;let xt=($t.attrs.id??"").replace(/\D/g,""),at=parseInt(xt,10)||0;et.push({objectType:Ft,shapeXml:ro($t),clientData:ot,shapeId:at})}}for(let L=0;L<J.length;L++){let $t=ht.get(J[L]);if(!$t)continue;let ot=$t.target.startsWith("/")?$t.target.slice(1):Ve(Y,$t.target),Ft=n(ot)??"",xt=Ft?Lt(Ft):null,at=xt?.attrs.objectType??"",bt=Un[at]??"button",Z=et[L],yt=oa(Z?.clientData),nt={type:bt,from:yt.from,to:yt.to,_ctrlPropXml:Ft||void 0,_vmlShapeXml:Z?.shapeXml,_shapeId:Z?.shapeId};if(xt){if(xt.attrs.fmlaLink&&(nt.linkedCell=xt.attrs.fmlaLink),xt.attrs.fmlaRange&&(nt.inputRange=xt.attrs.fmlaRange),xt.attrs.checked&&(nt.checked=Vn[xt.attrs.checked]??"unchecked"),xt.attrs.dropLines&&(nt.dropLines=parseInt(xt.attrs.dropLines,10)),xt.attrs.min&&(nt.min=parseInt(xt.attrs.min,10)),xt.attrs.max&&(nt.max=parseInt(xt.attrs.max,10)),xt.attrs.inc&&(nt.inc=parseInt(xt.attrs.inc,10)),xt.attrs.page&&(nt.page=parseInt(xt.attrs.page,10)),xt.attrs.val&&(nt.val=parseInt(xt.attrs.val,10)),xt.attrs.selType){let dt={Single:"single",Multi:"multi",Extend:"extend"};nt.selType=dt[xt.attrs.selType]??"single"}xt.attrs.noThreeD==="1"&&(nt.noThreeD=!0)}if(Z?.clientData){let dt=Z.clientData.children.find(pt=>typeof pt!="string"&&ct(pt.tag)==="FmlaMacro");dt&&(nt.macro=dt.text??"")}z.addFormControl(nt)}z.legacyDrawingRId=St,z.ctrlPropRIds=J}}if(G){let U=V.split("/").pop()??"",Y=V.substring(0,V.lastIndexOf("/")+1),st=`${Y}_rels/${U}.rels`,ht=T.get(st);if(ht){let tt=ht.get(G);if(tt){let ft=tt.target.startsWith("/")?tt.target.slice(1):Ve(Y,tt.target),j=n(ft);if(j){let et=ft.substring(0,ft.lastIndexOf("/")+1),L=ft.split("/").pop()??"",$t=`${et}_rels/${L}.rels`,ot=T.get($t);Gr(j,ot,et,o,z)}}}}X.size>0&&ea(X,n,o,z),S.push({ws:z,sheetId:M,rId:_,originalXml:mt,unknownParts:it,tablePaths:F,tableXmls:P})}let D=n("xl/connections.xml")??"",R=[];if(D){let E=Lt(D);for(let _ of ut(E,"connection")){let M=parseInt(_.attrs.id??"0",10),N=_.attrs.name??"",H=parseInt(_.attrs.type??"0",10),V=sa(H);if(!N||!V)continue;let K={id:M,name:N,type:V};_.attrs.description&&(K.description=_.attrs.description),_.attrs.refreshOnLoad==="1"&&(K.refreshOnLoad=!0),_.attrs.background==="1"&&(K.background=!0),_.attrs.saveData==="1"&&(K.saveData=!0),_.attrs.keepAlive==="1"&&(K.keepAlive=!0),_.attrs.interval&&(K.interval=parseInt(_.attrs.interval,10));let z=B(_,"dbPr");z&&(z.attrs.connection&&(K.connectionString=z.attrs.connection),z.attrs.command&&(K.command=z.attrs.command),z.attrs.commandType&&(K.commandType=aa(parseInt(z.attrs.commandType,10)))),K._rawXml=ro(_),R.push(K)}}let A=[];for(let[E,_]of t)if(!(!E.startsWith("customXml/item")||E.includes("Props")||E.includes("_rels")))try{let M=await ia(_.data);if(M.length){A.push(...M);break}}catch{}let W=new Set(["xl/workbook.xml","xl/styles.xml","xl/sharedStrings.xml","xl/worksheets/","docProps/","[Content_Types].xml","_rels/","xl/_rels/","xl/connections.xml"]),Q=new Map;for(let[E,_]of t){if(E.endsWith("_rels/")||E==="[Content_Types].xml")continue;[...W].some(N=>E.startsWith(N))||Q.set(E,_.data)}let q=[];for(let E of w)if(E.name==="_xlnm.Print_Area"&&E.scope){let _=S.find(M=>M.ws.name===E.scope);_&&(_.ws.printArea=E.ref)}else q.push(E);return{sheets:S,styles:m,stylesXml:h,sharedStrings:d,sharedXml:c,workbookXml:l,workbookRels:i,contentTypes:r,contentTypesXml:s,core:p,extended:u,extendedUnknownRaw:$,custom:b,hasCustomProps:b.length>0,namedRanges:q,connections:R,connectionsXml:D,powerQueries:A,unknownParts:Q,allRels:T}}function oa(e){let t={from:{col:0,row:0},to:{col:2,row:2}};if(!e)return t;let o=e.children.find(r=>typeof r!="string"&&ct(r.tag)==="Anchor");if(!o)return t;let s=(o.text??"").split(",").map(r=>parseInt(r.trim(),10));return s.length<8||s.some(isNaN)?t:{from:{col:s[0],colOff:s[1],row:s[2],rowOff:s[3]},to:{col:s[4],colOff:s[5],row:s[6],rowOff:s[7]}}}var Zn={1:"odbc",2:"dao",3:"file",4:"web",5:"oledb",6:"text",7:"dsp"},na=Object.fromEntries(Object.entries(Zn).map(([e,t])=>[t,Number(e)]));function sa(e){return Zn[e]}function Yn(e){return na[e]}var Qn={1:"sql",2:"table",3:"default",4:"web",5:"oledb"},ra=Object.fromEntries(Object.entries(Qn).map(([e,t])=>[t,Number(e)]));function aa(e){return Qn[e]}function Jn(e){return ra[e]}async function ia(e){if(e.length<12)return[];let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.getUint32(0,!0)!==0)return[];let n=t.getUint32(4,!0);if(n<4||8+n>e.length)return[];let s=e.subarray(8,8+n);if(s[0]!==80||s[1]!==75)return[];let r=await Jo(s),a=[];for(let[i,l]of r){if(!i.includes("/Formula/")||!i.endsWith(".m"))continue;let h=yo(l);if(!h)continue;let m=i.match(/Formulas\/([^/]+)\//),c=m?m[1]:void 0,d=/shared\s+(?:#"([^"]+)"|(\w+))\s*=/g,f,p=new Set;for(;(f=d.exec(h))!==null;){let g=f[1]??f[2];p.add(g)}if(p.size>0){let g=/shared\s+(?:#"([^"]+)"|(\w+))\s*=\s*([\s\S]*?)(?=,\s*shared\s|\]\s*$)/g,u;for(;(u=g.exec(h))!==null;){let $=u[1]??u[2],x=u[3].replace(/,\s*$/,"").trim();a.push({name:$,formula:x})}a.length===0&&a.push({name:c??"Section1",formula:h})}else c&&a.push({name:c,formula:h})}return a}var pn,un,bs,Cs,gn,xn,io=class e{constructor(){this.sheets=[],this.namedRanges=[],this.connections=[],this.powerQueries=[],this.externalLinks=[],this.customPivotStyles=[],this.pivotSlicers=[],this.properties={},this.compressionLevel=6,this.coreProperties={},this.extendedProperties={},this.customProperties=[],this.isTemplate=!1,this._dirtySheets=new Set,this._activeTabIndex=0,this._customTableStyles=new Map}markDirty(t){if(typeof t=="string"){let o=this.sheets.findIndex(n=>n.name===t);o>=0&&this._dirtySheets.add(o)}else this._dirtySheets.add(t)}static async fromBytes(t){let o=new e,n=await Kn(t);o._readResult=n,o.coreProperties=n.core,o.extendedProperties=n.extended,o.customProperties=n.custom,o.properties={title:n.core.title,author:n.core.creator,subject:n.core.subject,description:n.core.description,keywords:n.core.keywords,company:n.extended.company,lastModifiedBy:n.core.lastModifiedBy,created:n.core.created,modified:n.core.modified,category:n.core.category,status:n.core.contentStatus},o.sheets=n.sheets.map(a=>a.ws);for(let a=0;a<o.sheets.length;a++){let i=o.sheets[a];i._workbook=o,i.view?.tabSelected&&(o._activeTabIndex=a)}o.namedRanges=n.namedRanges,o.connections=n.connections,o.powerQueries=n.powerQueries;let s=n.unknownParts.get("xl/vbaProject.bin");if(s){xn||(xn=(await Promise.resolve().then(()=>(dn(),cs))).VbaProject);try{o.vbaProject=xn.fromBytes(s)}catch{}}let r=n.workbookXml.match(/<calcPr([^>]*)\/?>/);if(r){let a=r[1],i={},l=a.match(/calcMode="([^"]+)"/);l&&(i.calcMode=l[1]),/fullCalcOnLoad="1"/.test(a)?i.fullCalcOnLoad=!0:/fullCalcOnLoad="0"/.test(a)&&(i.fullCalcOnLoad=!1),/iterate="1"/.test(a)&&(i.iterate=!0);let h=a.match(/iterateCount="(\d+)"/);h&&(i.iterateCount=parseInt(h[1],10));let m=a.match(/iterateDelta="([^"]+)"/);m&&(i.iterateDelta=parseFloat(m[1])),/fullPrecision="1"/.test(a)?i.fullPrecision=!0:/fullPrecision="0"/.test(a)&&(i.fullPrecision=!1),/calcOnSave="1"/.test(a)?i.calcOnSave=!0:/calcOnSave="0"/.test(a)&&(i.calcOnSave=!1),/concurrentCalc="1"/.test(a)?i.concurrentCalc=!0:/concurrentCalc="0"/.test(a)&&(i.concurrentCalc=!1),Object.keys(i).length>0&&(o.calcSettings=i)}return o}static async fromBase64(t){return e.fromBytes(ce(t))}static async fromFile(t){let n=await(await import("fs/promises")).readFile(t);return e.fromBytes(new Uint8Array(n))}static async fromBlob(t){return e.fromBytes(new Uint8Array(await t.arrayBuffer()))}addSheet(t,o={}){let n=new ke(t,o);return n.sheetIndex=this.sheets.length+1,n._workbook=this,this.sheets.push(n),this._dirtySheets.add(n.sheetIndex-1),n}getSheet(t){return this.sheets.find(o=>o.name===t)}getSheetByIndex(t){return this.sheets[t]}getSheetNames(){return this.sheets.map(t=>t.name)}getSheets(){return this.sheets}removeSheet(t){return this.sheets=this.sheets.filter(o=>o.name!==t),this}setActiveSheet(t){let o=typeof t=="string"?this.sheets.findIndex(n=>n.name===t):t;if(!(o<0||o>=this.sheets.length)){for(let n=0;n<this.sheets.length;n++){let s=this.sheets[n];n===o?s.view={...s.view??{},tabSelected:!0}:s.view?.tabSelected&&(s.view={...s.view,tabSelected:!1})}this._activeTabIndex=o}}addChartSheet(t,o){let n=this.addSheet(t);return n._isChartSheet=!0,n.addChart(o),n}addDialogSheet(t){let o=this.addSheet(t);return o._isDialogSheet=!0,o}copySheet(t,o){let n=this.getSheet(t);if(!n)throw new Error(`Sheet "${t}" not found`);let s=this.addSheet(o),r=n.readAllCells();for(let{row:i,col:l,cell:h}of r){let m=s.getCell(i,l);h.value!=null&&(m.value=h.value),h.formula&&(m.formula=h.formula),h.arrayFormula&&(m.arrayFormula=h.arrayFormula),h.richText&&(m.richText=h.richText.map(c=>({...c,font:c.font?{...c.font}:void 0}))),h.style&&(m.style={...h.style}),h.comment&&(m.comment={...h.comment}),h.hyperlink&&(m.hyperlink={...h.hyperlink})}for(let i of n.getMerges())s.merge(i.startRow,i.startCol,i.endRow,i.endCol);let a=n.getUsedRange();if(a)for(let i=a.startCol;i<=a.endCol;i++){let l=n.getColumn(i);l&&s.setColumn(i,{...l})}return n.pageSetup&&(s.pageSetup={...n.pageSetup}),n.printArea&&(s.printArea=n.printArea),s}registerTableStyle(t,o){return this._customTableStyles.set(t,o),this}addNamedRange(t){return this.namedRanges.push(t),this}getNamedRanges(){return this.namedRanges}getNamedRange(t){return this.namedRanges.find(o=>o.name===t)}removeNamedRange(t){return this.namedRanges=this.namedRanges.filter(o=>o.name!==t),this}addConnection(t){return this.connections.push(t),this}getConnections(){return this.connections}getConnection(t){return this.connections.find(o=>o.name===t)}removeConnection(t){return this.connections=this.connections.filter(o=>o.name!==t),this}getPowerQueries(){return this.powerQueries}getPowerQuery(t){return this.powerQueries.find(o=>o.name===t)}getCustomProperty(t){return this.customProperties.find(o=>o.name===t)}setCustomProperty(t,o){let n=this.customProperties.findIndex(s=>s.name===t);return n>=0?this.customProperties[n]={name:t,value:o}:this.customProperties.push({name:t,value:o}),this}removeCustomProperty(t){return this.customProperties=this.customProperties.filter(o=>o.name!==t),this}addExternalLink(t){return this.externalLinks.push(t),this}getExternalLinks(){return this.externalLinks}registerPivotStyle(t){return this.customPivotStyles.push(t),this}addPivotSlicer(t){return this.pivotSlicers.push(t),this}getPivotSlicers(){return this.pivotSlicers}async build(){return this._syncLegacyProperties(),this._readResult?this._buildPatched():this._buildFresh()}async _buildPatched(){let t=this._readResult,o=[],n=this._dirtySheets.size>0,s=new Ne,r=new Xe,a=new Map,i=new Map;if(n){for(let p=0;p<this.sheets.length;p++){let g=this.sheets[p],u=g.getTables();for(let $=0;$<u.length;$++){let x=u[$];i.set(`${p}:${$}`,x.columns.map(v=>v.name));let{startRow:b,startCol:C}=Zt(x.ref),y=new Set;for(let v=0;v<x.columns.length;v++){let w=g.getCell(b,C+v),k=w.value,T=null;k==null?T=null:k instanceof Date?T=k.toISOString():typeof k=="object"&&"error"in k?T=String(k.error):T=String(k);let S=T??x.columns[v].name,D=S,R=2;for(;y.has(D);)D=`${S}${R++}`;y.add(D),x.columns[v].name=D,(k==null||typeof k!="string"||k!==D)&&(w.value=D)}}}let c=/<dxf>([\s\S]*?)<\/dxf>|<dxf\/>/g,d=[],f;for(;(f=c.exec(t.stylesXml))!==null;)d.push(f[1]??"");d.length&&s.prependRawDxfs(d);for(let p=0;p<this.sheets.length;p++)a.set(p,this.sheets[p].toXml(s,r))}o.push({name:"docProps/core.xml",data:rt(tn({...t.core,...this.coreProperties,modified:new Date}))}),o.push({name:"docProps/app.xml",data:rt(en({...t.extended,...this.extendedProperties,titlesOfParts:this.sheets.map(c=>c.name),headingPairs:this._headingPairs()},t.extendedUnknownRaw))});let l=this.customProperties.length>0?this.customProperties:t.hasCustomProps?t.custom:null;l&&l.length>0&&o.push({name:"docProps/custom.xml",data:rt(on(l))}),o.push({name:"xl/workbook.xml",data:rt(this._patchWorkbookXml(t.workbookXml,t))});let h=this._connectionsXml(t.connectionsXml);h&&o.push({name:"xl/connections.xml",data:rt(h)}),n?(o.push({name:"xl/styles.xml",data:rt(s.toXml())}),o.push({name:"xl/sharedStrings.xml",data:rt(r.toXml())})):(o.push({name:"xl/styles.xml",data:rt(t.stylesXml)}),o.push({name:"xl/sharedStrings.xml",data:rt(t.sharedXml)}));for(let c=0;c<this.sheets.length;c++){let d=this.sheets[c],p=`xl/${d._isChartSheet?"chartsheets":d._isDialogSheet?"dialogsheets":"worksheets"}/sheet${c+1}.xml`;n?d._isChartSheet?o.push({name:p,data:rt(d.toChartSheetXml())}):d._isDialogSheet?o.push({name:p,data:rt(d.toDialogSheetXml(s,r))}):o.push({name:p,data:rt(a.get(c)??"")}):o.push({name:p,data:rt(t.sheets[c]?.originalXml??"")})}let m=new Set;for(let c=0;c<this.sheets.length;c++){let f=this.sheets[c].getTables(),p=t.sheets[c]?.tablePaths??[],g=t.sheets[c]?.tableXmls??[];for(let u=0;u<f.length;u++){let $=p[u];if($)if(m.add($),u<g.length){let x=g[u],b=x.match(/\bref="([^"]+)"/);if(b&&b[1]!==f[u].ref&&(x=x.replace(`ref="${b[1]}"`,`ref="${f[u].ref}"`)),n){let C=i.get(`${c}:${u}`);if(C)for(let y=0;y<f[u].columns.length;y++){let v=C[y],w=f[u].columns[y].name;v&&v!==w&&(x=x.replace(`name="${I(v)}"`,`name="${I(w)}"`))}}o.push({name:$,data:rt(x)})}else{let x=$.match(/table(\d+)\.xml$/),b=x?parseInt(x[1],10):u+1;o.push({name:$,data:rt(zo(f[u],b))})}}}for(let[c,d]of t.unknownParts)m.has(c)||c==="xl/vbaProject.bin"&&this.vbaProject||t.allRels.has(c)||n&&c==="xl/calcChain.xml"||o.push({name:c,data:d});this.vbaProject&&(this._ensureVbaSheetModules(),o.push({name:"xl/vbaProject.bin",data:this.vbaProject.build()})),o.push({name:"_rels/.rels",data:rt(this._buildRootRels(l!=null&&l.length>0))}),o.push({name:"xl/_rels/workbook.xml.rels",data:rt(this._buildWorkbookRels(t,n))});for(let[c,d]of t.allRels)c==="xl/_rels/workbook.xml.rels"||c==="_rels/.rels"||o.push({name:c,data:rt(this._relsToXml(d))});return o.push({name:"[Content_Types].xml",data:rt(this._patchContentTypes(t.contentTypesXml,l!=null&&l.length>0,n))}),Qo(o,{level:this.compressionLevel})}async _buildFresh(){let t=new Ne,o=new Xe,n=[];for(let[F,P]of this._customTableStyles)t.registerTableStyle(F,P);let s=1;for(let F of this.sheets)F.rId=`rId${s++}`;let r=[],a=[],i=[],l=[],h=new Map,m=new Map,c=new Map,d=new Map,f=1,p=1,g=1,u=1,$=1,x=0,b=0,C=0;for(let F of this.sheets){let P=F.getImages(),U=F.getCharts(),Y=F.getTables(),st=[],ht=[],tt=[];(P.length||U.length||F.getShapes().length||F.getWordArt().length||F.getMathEquations().length||F.getTableSlicers().length||F.getOleObjects().length)&&(F.drawingRId=`rId${s++}`);let ft=F.getFormControls();(F.getComments().length||ft.length)&&(F.legacyDrawingRId=`rId${s++}`);for(let ot of P){let Ft=`rId${s++}`;st.push(Ft),r.push({ws:F,img:ot,ext:Fs(ot.format),idx:f++})}for(let ot=0;ot<U.length;ot++){let Ft=`rId${s++}`;ht.push(Ft),a.push({ws:F,chartIdx:ot,globalIdx:p++})}for(let ot=0;ot<Y.length;ot++){let Ft=`rId${s++}`;tt.push(Ft),i.push({ws:F,tableIdx:ot,globalTableId:g++})}let j=[],et=[];for(let ot of F.getOleObjects())j.push(`rId${s++}`),ot.iconData?et.push(`rId${s++}`):et.push("");F.oleRIds=j,F.oleIconRIds=et;let L=[];for(let ot=0;ot<ft.length;ot++)L.push(`rId${s++}`);F.ctrlPropRIds=L,h.set(F,st),m.set(F,ht),c.set(F,tt),F.tableRIds=tt;let $t=[];for(let ot of F.getPivotTables()){let Ft=`rId${s++}`,xt=`rId${s++}`;$t.push(Ft),l.push({ws:F,pt:ot,pivotIdx:$++,cacheId:x++,pivotRId:Ft,cacheRId:xt})}d.set(F,$t)}let y=[],v=f,w=1;for(let F of this.sheets){F._cellImageVm=new Map;for(let P of F.getCellImages()){let U=Fs(P.format);y.push({img:P,ext:U,idx:v++}),F._cellImageVm.set(P.cell,w++),F.getCellByRef(P.cell)}}let k=y.length>0,T=new Map,S=[],D=0,R=0;for(let F of this.sheets)F.getTableSlicers().length&&T.set(F,{tableSlicers:[],pivotSlicers:[],slicerDefRId:"",slicerDefIdx:0});for(let F of this.pivotSlicers)for(let P of this.sheets)if(P.getPivotTables().some(U=>U.name===F.pivotTableName)){T.has(P)||T.set(P,{tableSlicers:[],pivotSlicers:[],slicerDefRId:"",slicerDefIdx:0});break}for(let[F,P]of T){F.drawingRId||(F.drawingRId=`rId${s++}`),P.slicerDefRId=`rId${s++}`,P.slicerDefIdx=++D,F.slicerRId=P.slicerDefRId;let U=[];for(let Y of F.getTableSlicers()){let st=F.getTables().find(j=>j.name===Y.tableName),tt=i.find(j=>j.ws===F&&F.getTables()[j.tableIdx]===st)?.globalTableId??1,ft=st?(st.columns?.findIndex(j=>j.name===Y.columnName)??0)+1:1;P.tableSlicers.push({slicer:Y,tableId:tt,columnIndex:ft}),U.push({name:Y.name,cell:Y.cell}),S.push({name:Y.name+"_cache",sourceName:Y.columnName,type:"table",rId:`rId${s++}`,idx:++R,tableId:tt,columnIndex:ft,sortOrder:Y.sortOrder??"ascending"})}for(let Y of this.pivotSlicers){let st=F.getPivotTables().find(et=>et.name===Y.pivotTableName);if(!st)continue;let ht=l.find(et=>et.ws===F&&et.pt===st),tt=this.sheets.indexOf(F)+1,ft=[],j=this.sheets.find(et=>et.name===st.sourceSheet);if(j){let et=j.readRange(st.sourceRef),$t=(et[0]??[]).map(ot=>String(ot??"")).indexOf(Y.fieldName);if($t>=0){let ot=new Set;for(let Ft=1;Ft<et.length;Ft++)ot.add(String(et[Ft][$t]??""));ft=[...ot]}}P.pivotSlicers.push({slicer:Y,pivotCacheId:ht?.cacheId??0}),U.push({name:Y.name,cell:Y.cell}),S.push({name:Y.name+"_cache",sourceName:Y.fieldName,type:"pivot",rId:`rId${s++}`,idx:++R,pivotTableName:Y.pivotTableName,pivotCacheId:ht?.cacheId??0,tabId:tt,items:ft})}F._slicerDrawingInfo=U}let A=T.size>0,W=this.customProperties.length>0,Q=!!this.vbaProject,q=new Set;for(let{ext:F}of[...r,...y]){let P=Oa(F);q.add(`<Default Extension="${F}" ContentType="${P}"/>`)}let E=this.sheets.filter(F=>F.getComments().length),M=this.sheets.filter(F=>F.getComments().length||F.getFormControls().length).length?'<Default Extension="vml" ContentType="application/vnd.openxmlformats-officedocument.vmlDrawing"/>':"",N=0,H=E.map(()=>`<Override PartName="/xl/comments${++N}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"/>`).join(""),V=0,K=[];for(let F of this.sheets)if(!F._isDialogSheet)for(let P=0;P<F.getFormControls().length;P++)K.push(`<Override PartName="/xl/ctrlProps/ctrlProp${++V}.xml" ContentType="application/vnd.ms-excel.controlproperties+xml"/>`);let mt=this.sheets.some(F=>F.getOleObjects().length>0)?'<Default Extension="bin" ContentType="application/vnd.openxmlformats-officedocument.oleObject"/>':"";n.push({name:"[Content_Types].xml",data:rt(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
255
255
  <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
256
256
  <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
257
257
  <Default Extension="xml" ContentType="application/xml"/>
@@ -324,13 +324,13 @@ ${St}
324
324
  ${this._calcPrXml()}
325
325
  ${J}
326
326
  ${A?(()=>{let F=S.filter(Y=>Y.type==="table"),P=S.filter(Y=>Y.type==="pivot"),U="<extLst>";return P.length&&(U+=`<ext uri="{BBE1A952-AA13-448e-AADC-164F8A28A991}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"><x14:slicerCaches>${P.map(Y=>`<x14:slicerCache r:id="${Y.rId}"/>`).join("")}</x14:slicerCaches></ext>`),F.length&&(U+=`<ext uri="{46BE6895-7355-4a93-B00E-2C351335B9C9}" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"><x15:slicerCaches>${F.map(Y=>`<x14:slicerCache r:id="${Y.rId}"/>`).join("")}</x15:slicerCaches></ext>`),U+="</extLst>",U})():""}
327
- </workbook>`)}),this.connections.length&&n.push({name:"xl/connections.xml",data:rt(this._connectionsXml())});for(let F=0;F<this.sheets.length;F++){let P=this.sheets[F],U=h.get(P)??[],Y=m.get(P)??[],st=i.filter(at=>at.ws===P),ht=c.get(P)??[],tt=P._isChartSheet?"chartsheets":P._isDialogSheet?"dialogsheets":"worksheets",ft=`xl/${tt}/sheet${F+1}.xml`;P._isChartSheet?n.push({name:ft,data:rt(P.toChartSheetXml())}):P._isDialogSheet?n.push({name:ft,data:rt(P.toDialogSheetXml(t,o))}):n.push({name:ft,data:rt(P.toXml(t,o))});let j=[];if(P.drawingRId){let at=this.sheets.filter((bt,Z)=>Z<=F&&bt.drawingRId).length;j.push(`<Relationship Id="${P.drawingRId}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing" Target="../drawings/drawing${at}.xml"/>`)}for(let at=0;at<P.getImages().length;at++){let bt=r.filter(Z=>Z.ws===P)[at];bt&&j.push(`<Relationship Id="${U[at]}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="../media/image${bt.idx}.${bt.ext}"/>`)}for(let at=0;at<st.length;at++)j.push(`<Relationship Id="${ht[at]}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/table" Target="../tables/table${st[at].globalTableId}.xml"/>`);let et=d.get(P)??[],L=l.filter(at=>at.ws===P);for(let at=0;at<L.length;at++)j.push(`<Relationship Id="${et[at]}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable" Target="../pivotTables/pivotTable${L[at].pivotIdx}.xml"/>`);let $t=T.get(P);$t&&j.push(`<Relationship Id="${$t.slicerDefRId}" Type="http://schemas.microsoft.com/office/2007/relationships/slicer" Target="../slicers/slicer${$t.slicerDefIdx}.xml"/>`);let ot=P.getComments(),Ft=P.getFormControls();if((ot.length||Ft.length)&&P.legacyDrawingRId){let at=u++;if(j.push(`<Relationship Id="${P.legacyDrawingRId}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing" Target="../drawings/vmlDrawing${at}.vml"/>`),ot.length){let nt=`rId${s++}`;j.push(`<Relationship Id="${nt}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments" Target="../comments${at}.xml"/>`),n.push({name:`xl/comments${at}.xml`,data:rt(this._buildCommentsXml(ot))})}let bt=ot.map(({row:nt,col:dt},pt)=>{let Rt=(dt+1)*64,Ee=(nt-1)*20;return`<v:shape id="_x0000_s${1025+F*1e3+pt}" type="#_x0000_t202" style="position:absolute;margin-left:${Rt}pt;margin-top:${Ee}pt;width:108pt;height:59.25pt;z-index:${pt+1};visibility:hidden" fillcolor="#ffffe1" o:insetmode="auto">
327
+ </workbook>`)}),this.connections.length&&n.push({name:"xl/connections.xml",data:rt(this._connectionsXml())});for(let F=0;F<this.sheets.length;F++){let P=this.sheets[F],U=h.get(P)??[],Y=m.get(P)??[],st=i.filter(at=>at.ws===P),ht=c.get(P)??[],tt=P._isChartSheet?"chartsheets":P._isDialogSheet?"dialogsheets":"worksheets",ft=`xl/${tt}/sheet${F+1}.xml`;P._isChartSheet?n.push({name:ft,data:rt(P.toChartSheetXml())}):P._isDialogSheet?n.push({name:ft,data:rt(P.toDialogSheetXml(t,o))}):n.push({name:ft,data:rt(P.toXml(t,o))});let j=[];if(P.drawingRId){let at=this.sheets.filter((bt,Z)=>Z<=F&&bt.drawingRId).length;j.push(`<Relationship Id="${P.drawingRId}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing" Target="../drawings/drawing${at}.xml"/>`)}for(let at=0;at<P.getImages().length;at++){let bt=r.filter(Z=>Z.ws===P)[at];bt&&j.push(`<Relationship Id="${U[at]}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="../media/image${bt.idx}.${bt.ext}"/>`)}for(let at=0;at<st.length;at++)j.push(`<Relationship Id="${ht[at]}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/table" Target="../tables/table${st[at].globalTableId}.xml"/>`);let et=d.get(P)??[],L=l.filter(at=>at.ws===P);for(let at=0;at<L.length;at++)j.push(`<Relationship Id="${et[at]}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable" Target="../pivotTables/pivotTable${L[at].pivotIdx}.xml"/>`);let $t=T.get(P);$t&&j.push(`<Relationship Id="${$t.slicerDefRId}" Type="http://schemas.microsoft.com/office/2007/relationships/slicer" Target="../slicers/slicer${$t.slicerDefIdx}.xml"/>`);let ot=P.getComments(),Ft=P.getFormControls();if((ot.length||Ft.length)&&P.legacyDrawingRId){un||({buildCtrlPropXml:un,buildFormControlVmlShape:bs,buildVmlWithControls:Cs}=await Promise.resolve().then(()=>(ms(),hs)));let at=u++;if(j.push(`<Relationship Id="${P.legacyDrawingRId}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing" Target="../drawings/vmlDrawing${at}.vml"/>`),ot.length){let nt=`rId${s++}`;j.push(`<Relationship Id="${nt}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments" Target="../comments${at}.xml"/>`),n.push({name:`xl/comments${at}.xml`,data:rt(this._buildCommentsXml(ot))})}let bt=ot.map(({row:nt,col:dt},pt)=>{let Rt=(dt+1)*64,_e=(nt-1)*20;return`<v:shape id="_x0000_s${1025+F*1e3+pt}" type="#_x0000_t202" style="position:absolute;margin-left:${Rt}pt;margin-top:${_e}pt;width:108pt;height:59.25pt;z-index:${pt+1};visibility:hidden" fillcolor="#ffffe1" o:insetmode="auto">
328
328
  <v:fill color2="#ffffe1"/>
329
329
  <v:shadow color="black" obscured="t"/>
330
330
  <v:path o:connecttype="none"/>
331
331
  <v:textbox style="mso-direction-alt:auto"><div style="text-align:left"/></v:textbox>
332
332
  <x:ClientData ObjectType="Note"><x:MoveWithCells/><x:SizeWithCells/><x:Anchor>${dt+1},15,${nt-1},10,${dt+3},15,${nt+4},4</x:Anchor><x:AutoFill>False</x:AutoFill><x:Row>${nt-1}</x:Row><x:Column>${dt-1}</x:Column></x:ClientData>
333
- </v:shape>`}),Z=1025+P.sheetIndex*1e3+ot.length,yt=Ft.map((nt,dt)=>Tn(nt,Z+dt));if(n.push({name:`xl/drawings/vmlDrawing${at}.vml`,data:rt(kn(bt,yt))}),!P._isDialogSheet){let nt=P.ctrlPropRIds;for(let dt=0;dt<Ft.length;dt++){let pt=++b;j.push(`<Relationship Id="${nt[dt]}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/ctrlProp" Target="../ctrlProps/ctrlProp${pt}.xml"/>`),n.push({name:`xl/ctrlProps/ctrlProp${pt}.xml`,data:rt(In(Ft[dt]))})}}}let xt=P.getOleObjects();for(let at=0;at<xt.length;at++){let bt=xt[at],Z=++C,yt=P.oleRIds[at];if(bt.linkToFile)j.push(`<Relationship Id="${yt}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject" Target="${I(bt.linkPath??"")}" TargetMode="External"/>`);else{let nt=`xl/embeddings/oleObject${Z}.bin`;j.push(`<Relationship Id="${yt}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject" Target="../embeddings/oleObject${Z}.bin"/>`);let dt=bt.data?typeof bt.data=="string"?le(bt.data):bt.data:new Uint8Array(0);n.push({name:nt,data:dt})}if(bt.iconData){let nt=bt.iconFormat??"emf",dt=f++,pt=P.oleIconRIds[at];j.push(`<Relationship Id="${pt}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="../media/image${dt}.${nt}"/>`);let Rt=typeof bt.iconData=="string"?le(bt.iconData):bt.iconData;n.push({name:`xl/media/image${dt}.${nt}`,data:Rt})}}if(j.length&&n.push({name:`xl/${tt}/_rels/sheet${F+1}.xml.rels`,data:rt(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
333
+ </v:shape>`}),Z=1025+P.sheetIndex*1e3+ot.length,yt=Ft.map((nt,dt)=>bs(nt,Z+dt));if(n.push({name:`xl/drawings/vmlDrawing${at}.vml`,data:rt(Cs(bt,yt))}),!P._isDialogSheet){let nt=P.ctrlPropRIds;for(let dt=0;dt<Ft.length;dt++){let pt=++b;j.push(`<Relationship Id="${nt[dt]}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/ctrlProp" Target="../ctrlProps/ctrlProp${pt}.xml"/>`),n.push({name:`xl/ctrlProps/ctrlProp${pt}.xml`,data:rt(un(Ft[dt]))})}}}let xt=P.getOleObjects();for(let at=0;at<xt.length;at++){let bt=xt[at],Z=++C,yt=P.oleRIds[at];if(bt.linkToFile)j.push(`<Relationship Id="${yt}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject" Target="${I(bt.linkPath??"")}" TargetMode="External"/>`);else{let nt=`xl/embeddings/oleObject${Z}.bin`;j.push(`<Relationship Id="${yt}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject" Target="../embeddings/oleObject${Z}.bin"/>`);let dt=bt.data?typeof bt.data=="string"?ce(bt.data):bt.data:new Uint8Array(0);n.push({name:nt,data:dt})}if(bt.iconData){let nt=bt.iconFormat??"emf",dt=f++,pt=P.oleIconRIds[at];j.push(`<Relationship Id="${pt}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="../media/image${dt}.${nt}"/>`);let Rt=typeof bt.iconData=="string"?ce(bt.iconData):bt.iconData;n.push({name:`xl/media/image${dt}.${nt}`,data:Rt})}}if(j.length&&n.push({name:`xl/${tt}/_rels/sheet${F+1}.xml.rels`,data:rt(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
334
334
  <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
335
335
  ${j.join(`
336
336
  `)}
@@ -338,11 +338,11 @@ ${j.join(`
338
338
  <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
339
339
  ${bt.join(`
340
340
  `)}
341
- </Relationships>`)})}}for(let{img:F,ext:P,idx:U}of r)n.push({name:`xl/media/image${U}.${P}`,data:typeof F.data=="string"?le(F.data):F.data});if(k){let F=[],P=[];for(let U=0;U<y.length;U++){let{img:Y,ext:st,idx:ht}=y[U],tt=`rId${U+1}`;F.push(tt),P.push(`<Relationship Id="${tt}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="/xl/media/image${ht}.${st}"/>`),n.push({name:`xl/media/image${ht}.${st}`,data:typeof Y.data=="string"?le(Y.data):Y.data})}n.push({name:"xl/metadata.xml",data:rt($a(y.length))}),n.push({name:"xl/richData/rdrichvalue.xml",data:rt(ya(y.length))}),n.push({name:"xl/richData/richValueRel.xml",data:rt(wa(F))}),n.push({name:"xl/richData/rdRichValueStructure.xml",data:rt(ba())}),n.push({name:"xl/richData/rdRichValueTypes.xml",data:rt(Ca())}),n.push({name:"xl/richData/rdarray.xml",data:rt('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><arrayData xmlns="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata2" count="0"></arrayData>')}),n.push({name:"xl/richData/_rels/richValueRel.xml.rels",data:rt(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
341
+ </Relationships>`)})}}for(let{img:F,ext:P,idx:U}of r)n.push({name:`xl/media/image${U}.${P}`,data:typeof F.data=="string"?ce(F.data):F.data});if(k){let F=[],P=[];for(let U=0;U<y.length;U++){let{img:Y,ext:st,idx:ht}=y[U],tt=`rId${U+1}`;F.push(tt),P.push(`<Relationship Id="${tt}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="/xl/media/image${ht}.${st}"/>`),n.push({name:`xl/media/image${ht}.${st}`,data:typeof Y.data=="string"?ce(Y.data):Y.data})}n.push({name:"xl/metadata.xml",data:rt(La(y.length))}),n.push({name:"xl/richData/rdrichvalue.xml",data:rt(Na(y.length))}),n.push({name:"xl/richData/richValueRel.xml",data:rt(Xa(F))}),n.push({name:"xl/richData/rdRichValueStructure.xml",data:rt(Ua())}),n.push({name:"xl/richData/rdRichValueTypes.xml",data:rt(Va())}),n.push({name:"xl/richData/rdarray.xml",data:rt('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><arrayData xmlns="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata2" count="0"></arrayData>')}),n.push({name:"xl/richData/_rels/richValueRel.xml.rels",data:rt(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
342
342
  <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
343
343
  ${P.join(`
344
344
  `)}
345
- </Relationships>`)})}for(let{ws:F,chartIdx:P,globalIdx:U}of a)n.push({name:`xl/charts/chart${U}.xml`,data:rt(bn(F.getCharts()[P]))});for(let{ws:F,tableIdx:P,globalTableId:U}of i)n.push({name:`xl/tables/table${U}.xml`,data:rt(Uo(F.getTables()[P],U))});for(let{ws:F,pt:P,pivotIdx:U,cacheId:Y}of l){let st=this.sheets.find(L=>L.name===P.sourceSheet),ht=st?st.readRange(P.sourceRef):[[]],{pivotTableXml:tt,cacheDefXml:ft,cacheRecordsXml:j}=Cn(P,ht,U,Y),et=(L,$t)=>`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
345
+ </Relationships>`)})}for(let{ws:F,chartIdx:P,globalIdx:U}of a)pn||(pn=(await Promise.resolve().then(()=>(fn(),$s))).buildChartXml),n.push({name:`xl/charts/chart${U}.xml`,data:rt(pn(F.getCharts()[P]))});for(let{ws:F,tableIdx:P,globalTableId:U}of i)n.push({name:`xl/tables/table${U}.xml`,data:rt(zo(F.getTables()[P],U))});for(let{ws:F,pt:P,pivotIdx:U,cacheId:Y}of l){gn||(gn=(await Promise.resolve().then(()=>(ws(),ys))).buildPivotTableFiles);let st=this.sheets.find(L=>L.name===P.sourceSheet),ht=st?st.readRange(P.sourceRef):[[]],{pivotTableXml:tt,cacheDefXml:ft,cacheRecordsXml:j}=gn(P,ht,U,Y),et=(L,$t)=>`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
346
346
  <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
347
347
  <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/${L}" Target="${$t}"/>
348
348
  </Relationships>`;n.push({name:`xl/pivotTables/pivotTable${U}.xml`,data:rt(tt)}),n.push({name:`xl/pivotTables/_rels/pivotTable${U}.xml.rels`,data:rt(et("pivotCacheDefinition",`../pivotCache/pivotCacheDefinition${U}.xml`))}),n.push({name:`xl/pivotCache/pivotCacheDefinition${U}.xml`,data:rt(ft)}),n.push({name:`xl/pivotCache/_rels/pivotCacheDefinition${U}.xml.rels`,data:rt(et("pivotCacheRecords",`pivotCacheRecords${U}.xml`))}),n.push({name:`xl/pivotCache/pivotCacheRecords${U}.xml`,data:rt(j)})}n.push({name:"xl/styles.xml",data:rt(t.toXml())}),n.push({name:"xl/sharedStrings.xml",data:rt(o.toXml())}),n.push({name:"xl/theme/theme1.xml",data:rt(this._buildThemeXml())});for(let F=0;F<this.externalLinks.length;F++){let P=this.externalLinks[F],U=F+1,Y=P.sheets.map(st=>{let ht=st.definedNames?.map(tt=>`<definedName name="${I(tt.name)}" refersTo="${I(tt.ref)}"/>`).join("")??"";return`<sheetName val="${I(st.name)}"/>${ht?`<sheetDataSet>${ht}</sheetDataSet>`:""}`}).join("");n.push({name:`xl/externalLinks/externalLink${U}.xml`,data:rt(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
@@ -366,8 +366,8 @@ ${(P.columns??[]).map((U,Y)=>`<queryTableField id="${Y+1}" name="${I(U)}" tableC
366
366
  `)}
367
367
  </queryTableFields>
368
368
  </queryTableRefresh>
369
- </queryTable>`)})}let X={...this.coreProperties,created:this.coreProperties.created??new Date,modified:new Date};return!X.creator&&this.properties.author&&(X.creator=this.properties.author),n.push({name:"docProps/core.xml",data:rt(en(X))}),n.push({name:"docProps/app.xml",data:rt(on({...this.extendedProperties,application:this.extendedProperties.application??"ExcelForge",company:this.extendedProperties.company??this.properties.company,titlesOfParts:this.sheets.map(F=>F.name),headingPairs:this._headingPairs()}))}),W&&n.push({name:"docProps/custom.xml",data:rt(nn(this.customProperties))}),Jo(n,{level:this.compressionLevel})}_headingPairs(){let t=this.sheets.filter(r=>!r._isChartSheet&&!r._isDialogSheet).length,o=this.sheets.filter(r=>r._isChartSheet).length,n=this.sheets.filter(r=>r._isDialogSheet).length,s=[];return t&&s.push({name:"Worksheets",count:t}),o&&s.push({name:"Charts",count:o}),n&&s.push({name:"Dialogs",count:n}),s.length||s.push({name:"Worksheets",count:0}),s}_syncLegacyProperties(){let t=this.properties;t.title&&(this.coreProperties.title??=t.title),t.author&&(this.coreProperties.creator??=t.author),t.subject&&(this.coreProperties.subject??=t.subject),t.description&&(this.coreProperties.description??=t.description),t.keywords&&(this.coreProperties.keywords??=t.keywords),t.company&&(this.extendedProperties.company??=t.company),t.lastModifiedBy&&(this.coreProperties.lastModifiedBy??=t.lastModifiedBy),t.created&&(this.coreProperties.created??=t.created),t.category&&(this.coreProperties.category??=t.category),t.status&&(this.coreProperties.contentStatus??=t.status)}_ensureVbaSheetModules(){if(!(!this.vbaProject||this.vbaProject.modules.filter(o=>o.type==="document"&&o.name!=="ThisWorkbook").length>=this.sheets.length))for(let o of this.sheets){let n=o.name.replace(/[^A-Za-z0-9_]/g,"_");this.vbaProject.getModule(n)||this.vbaProject.addModule({name:n,type:"document",code:""})}}_patchWorkbookXml(t,o){let n=t,s=o?.sheets.length??this.sheets.length;for(let a=0;a<Math.min(this.sheets.length,s);a++)n=n.replace(new RegExp(`(<sheet[^>]+sheetId="${a+1}"[^>]+)name="[^"]*"`),`$1name="${I(this.sheets[a].name)}"`);if(o&&this.sheets.length>s){let a=0;for(let[h]of o.workbookRels){let m=parseInt(h.replace(/\D/g,""),10);m>a&&(a=m)}let i=0;for(let h of o.sheets){let m=parseInt(h.sheetId,10);m>i&&(i=m)}let l=[];for(let h=s;h<this.sheets.length;h++){let m=this.sheets[h],c=`rId${++a}`,d=++i;m.rId=c,m.sheetIndex=d;let f=m.options?.state==="hidden"?' state="hidden"':m.options?.state==="veryHidden"?' state="veryHidden"':"";l.push(`<sheet name="${I(m.name)}" sheetId="${d}" r:id="${c}"${f}/>`)}n=n.replace("</sheets>",l.join("")+"</sheets>")}this.vbaProject&&!n.includes("codeName=")&&(n=n.replace("<workbookPr",'<workbookPr codeName="ThisWorkbook"'),n.includes("<workbookPr")||(n=n.replace("<bookViews",'<workbookPr codeName="ThisWorkbook"/><bookViews')));let r=this._definedNamesXml();if(n.includes("<definedNames")?n=n.replace(/<definedNames[\s\S]*?<\/definedNames>/,r):r&&(n=n.replace("</sheets>",`</sheets>${r}`)),this.calcSettings){let a=this._calcPrXml();n.includes("<calcPr")?n=n.replace(/<calcPr[^>]*\/>|<calcPr[^>]*>[\s\S]*?<\/calcPr>/,a):n=n.replace("</workbook>",`${a}</workbook>`)}return n}_definedNamesXml(t){let o=[];for(let r of this.sheets)if(r.printArea){let a=r.printArea.includes("!")?r.printArea:`'${r.name}'!${r.printArea}`;o.push({name:"_xlnm.Print_Area",ref:a,scope:r.name})}let n=(t??[]).map(r=>({name:r.name,ref:"#N/A"})),s=[...this.namedRanges,...o,...n];return s.length?`<definedNames>${s.map(r=>{let a=`name="${I(r.name)}"`;if(r.scope){let i=this.sheets.findIndex(l=>l.name===r.scope);i>=0&&(a+=` localSheetId="${i}"`)}return r.comment&&(a+=` comment="${I(r.comment)}"`),`<definedName ${a}>${I(r.ref)}</definedName>`}).join("")}</definedNames>`:""}_calcPrXml(){let t=this.calcSettings,o='calcId="191028"';return t&&(t.calcMode==="manual"?o+=' calcMode="manual"':t.calcMode==="autoNoTable"&&(o+=' calcMode="autoNoTable"'),t.fullCalcOnLoad&&(o+=' fullCalcOnLoad="1"'),t.iterate&&(o+=' iterate="1"',t.iterateCount!=null&&(o+=` iterateCount="${t.iterateCount}"`),t.iterateDelta!=null&&(o+=` iterateDelta="${t.iterateDelta}"`)),t.fullPrecision===!1&&(o+=' fullPrecision="0"'),t.calcOnSave===!1&&(o+=' calcOnSave="0"'),t.concurrentCalc===!1&&(o+=' concurrentCalc="0"')),`<calcPr ${o}/>`}_connectionsXml(t){return this.connections.length?`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
370
- <connections xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">${this.connections.map(o=>{if(o._rawXml)return o._rawXml;let n=` id="${o.id}" name="${I(o.name)}" type="${ts(o.type)}" refreshedVersion="6"`;o.description&&(n+=` description="${I(o.description)}"`),o.refreshOnLoad&&(n+=' refreshOnLoad="1"'),o.background&&(n+=' background="1"'),o.saveData&&(n+=' saveData="1"'),o.keepAlive&&(n+=' keepAlive="1"'),o.interval&&(n+=` interval="${o.interval}"`);let s=o.connectionString||o.command?`<dbPr${o.connectionString?` connection="${I(o.connectionString)}"`:""}${o.command?` command="${I(o.command)}"`:""}${o.commandType?` commandType="${os(o.commandType)}"`:""}/>`:"";return`<connection${n}>${s}</connection>`}).join("")}</connections>`:""}_buildWorkbookRels(t,o=!1){let n=[...t.workbookRels.entries()].filter(([r,a])=>!(o&&a.type.includes("/calcChain"))).map(([r,a])=>`<Relationship Id="${r}" Type="${a.type}" Target="${a.target}"/>`),s=t.sheets.length;for(let r=s;r<this.sheets.length;r++){let a=this.sheets[r],i=a._isChartSheet?"chartsheets":a._isDialogSheet?"dialogsheets":"worksheets",l=a._isChartSheet?"chartsheet":a._isDialogSheet?"dialogsheet":"worksheet";n.push(`<Relationship Id="${a.rId}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/${l}" Target="${i}/sheet${r+1}.xml"/>`)}return[...t.workbookRels.values()].some(r=>r.type.includes("/styles"))||n.push('<Relationship Id="rIdStyles" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>'),[...t.workbookRels.values()].some(r=>r.type.includes("/sharedStrings"))||n.push('<Relationship Id="rIdShared" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/>'),this.vbaProject&&![...t.workbookRels.values()].some(r=>r.type.includes("vbaProject"))&&n.push('<Relationship Id="rIdVBA" Type="http://schemas.microsoft.com/office/2006/relationships/vbaProject" Target="vbaProject.bin"/>'),this.connections.length&&![...t.workbookRels.values()].some(r=>r.type.includes("/connections"))&&n.push('<Relationship Id="rIdConns" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/connections" Target="connections.xml"/>'),`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
369
+ </queryTable>`)})}let X={...this.coreProperties,created:this.coreProperties.created??new Date,modified:new Date};return!X.creator&&this.properties.author&&(X.creator=this.properties.author),n.push({name:"docProps/core.xml",data:rt(tn(X))}),n.push({name:"docProps/app.xml",data:rt(en({...this.extendedProperties,application:this.extendedProperties.application??"ExcelForge",company:this.extendedProperties.company??this.properties.company,titlesOfParts:this.sheets.map(F=>F.name),headingPairs:this._headingPairs()}))}),W&&n.push({name:"docProps/custom.xml",data:rt(on(this.customProperties))}),Qo(n,{level:this.compressionLevel})}_headingPairs(){let t=this.sheets.filter(r=>!r._isChartSheet&&!r._isDialogSheet).length,o=this.sheets.filter(r=>r._isChartSheet).length,n=this.sheets.filter(r=>r._isDialogSheet).length,s=[];return t&&s.push({name:"Worksheets",count:t}),o&&s.push({name:"Charts",count:o}),n&&s.push({name:"Dialogs",count:n}),s.length||s.push({name:"Worksheets",count:0}),s}_syncLegacyProperties(){let t=this.properties;t.title&&(this.coreProperties.title??=t.title),t.author&&(this.coreProperties.creator??=t.author),t.subject&&(this.coreProperties.subject??=t.subject),t.description&&(this.coreProperties.description??=t.description),t.keywords&&(this.coreProperties.keywords??=t.keywords),t.company&&(this.extendedProperties.company??=t.company),t.lastModifiedBy&&(this.coreProperties.lastModifiedBy??=t.lastModifiedBy),t.created&&(this.coreProperties.created??=t.created),t.category&&(this.coreProperties.category??=t.category),t.status&&(this.coreProperties.contentStatus??=t.status)}_ensureVbaSheetModules(){if(!(!this.vbaProject||this.vbaProject.modules.filter(o=>o.type==="document"&&o.name!=="ThisWorkbook").length>=this.sheets.length))for(let o of this.sheets){let n=o.name.replace(/[^A-Za-z0-9_]/g,"_");this.vbaProject.getModule(n)||this.vbaProject.addModule({name:n,type:"document",code:""})}}_patchWorkbookXml(t,o){let n=t,s=o?.sheets.length??this.sheets.length;for(let a=0;a<Math.min(this.sheets.length,s);a++)n=n.replace(new RegExp(`(<sheet[^>]+sheetId="${a+1}"[^>]+)name="[^"]*"`),`$1name="${I(this.sheets[a].name)}"`);if(o&&this.sheets.length>s){let a=0;for(let[h]of o.workbookRels){let m=parseInt(h.replace(/\D/g,""),10);m>a&&(a=m)}let i=0;for(let h of o.sheets){let m=parseInt(h.sheetId,10);m>i&&(i=m)}let l=[];for(let h=s;h<this.sheets.length;h++){let m=this.sheets[h],c=`rId${++a}`,d=++i;m.rId=c,m.sheetIndex=d;let f=m.options?.state==="hidden"?' state="hidden"':m.options?.state==="veryHidden"?' state="veryHidden"':"";l.push(`<sheet name="${I(m.name)}" sheetId="${d}" r:id="${c}"${f}/>`)}n=n.replace("</sheets>",l.join("")+"</sheets>")}this.vbaProject&&!n.includes("codeName=")&&(n=n.replace("<workbookPr",'<workbookPr codeName="ThisWorkbook"'),n.includes("<workbookPr")||(n=n.replace("<bookViews",'<workbookPr codeName="ThisWorkbook"/><bookViews')));let r=this._definedNamesXml();if(n.includes("<definedNames")?n=n.replace(/<definedNames[\s\S]*?<\/definedNames>/,r):r&&(n=n.replace("</sheets>",`</sheets>${r}`)),this.calcSettings){let a=this._calcPrXml();n.includes("<calcPr")?n=n.replace(/<calcPr[^>]*\/>|<calcPr[^>]*>[\s\S]*?<\/calcPr>/,a):n=n.replace("</workbook>",`${a}</workbook>`)}return n}_definedNamesXml(t){let o=[];for(let r of this.sheets)if(r.printArea){let a=r.printArea.includes("!")?r.printArea:`'${r.name}'!${r.printArea}`;o.push({name:"_xlnm.Print_Area",ref:a,scope:r.name})}let n=(t??[]).map(r=>({name:r.name,ref:"#N/A"})),s=[...this.namedRanges,...o,...n];return s.length?`<definedNames>${s.map(r=>{let a=`name="${I(r.name)}"`;if(r.scope){let i=this.sheets.findIndex(l=>l.name===r.scope);i>=0&&(a+=` localSheetId="${i}"`)}return r.comment&&(a+=` comment="${I(r.comment)}"`),`<definedName ${a}>${I(r.ref)}</definedName>`}).join("")}</definedNames>`:""}_calcPrXml(){let t=this.calcSettings,o='calcId="191028"';return t&&(t.calcMode==="manual"?o+=' calcMode="manual"':t.calcMode==="autoNoTable"&&(o+=' calcMode="autoNoTable"'),t.fullCalcOnLoad&&(o+=' fullCalcOnLoad="1"'),t.iterate&&(o+=' iterate="1"',t.iterateCount!=null&&(o+=` iterateCount="${t.iterateCount}"`),t.iterateDelta!=null&&(o+=` iterateDelta="${t.iterateDelta}"`)),t.fullPrecision===!1&&(o+=' fullPrecision="0"'),t.calcOnSave===!1&&(o+=' calcOnSave="0"'),t.concurrentCalc===!1&&(o+=' concurrentCalc="0"')),`<calcPr ${o}/>`}_connectionsXml(t){return this.connections.length?`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
370
+ <connections xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">${this.connections.map(o=>{if(o._rawXml)return o._rawXml;let n=` id="${o.id}" name="${I(o.name)}" type="${Yn(o.type)}" refreshedVersion="6"`;o.description&&(n+=` description="${I(o.description)}"`),o.refreshOnLoad&&(n+=' refreshOnLoad="1"'),o.background&&(n+=' background="1"'),o.saveData&&(n+=' saveData="1"'),o.keepAlive&&(n+=' keepAlive="1"'),o.interval&&(n+=` interval="${o.interval}"`);let s=o.connectionString||o.command?`<dbPr${o.connectionString?` connection="${I(o.connectionString)}"`:""}${o.command?` command="${I(o.command)}"`:""}${o.commandType?` commandType="${Jn(o.commandType)}"`:""}/>`:"";return`<connection${n}>${s}</connection>`}).join("")}</connections>`:""}_buildWorkbookRels(t,o=!1){let n=[...t.workbookRels.entries()].filter(([r,a])=>!(o&&a.type.includes("/calcChain"))).map(([r,a])=>`<Relationship Id="${r}" Type="${a.type}" Target="${a.target}"/>`),s=t.sheets.length;for(let r=s;r<this.sheets.length;r++){let a=this.sheets[r],i=a._isChartSheet?"chartsheets":a._isDialogSheet?"dialogsheets":"worksheets",l=a._isChartSheet?"chartsheet":a._isDialogSheet?"dialogsheet":"worksheet";n.push(`<Relationship Id="${a.rId}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/${l}" Target="${i}/sheet${r+1}.xml"/>`)}return[...t.workbookRels.values()].some(r=>r.type.includes("/styles"))||n.push('<Relationship Id="rIdStyles" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>'),[...t.workbookRels.values()].some(r=>r.type.includes("/sharedStrings"))||n.push('<Relationship Id="rIdShared" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/>'),this.vbaProject&&![...t.workbookRels.values()].some(r=>r.type.includes("vbaProject"))&&n.push('<Relationship Id="rIdVBA" Type="http://schemas.microsoft.com/office/2006/relationships/vbaProject" Target="vbaProject.bin"/>'),this.connections.length&&![...t.workbookRels.values()].some(r=>r.type.includes("/connections"))&&n.push('<Relationship Id="rIdConns" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/connections" Target="connections.xml"/>'),`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
371
371
  <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
372
372
  ${n.join(`
373
373
  `)}
@@ -418,11 +418,11 @@ ${t.map(({row:s,col:r},a)=>{let i=(r+1)*64,l=(s-1)*20;return`<v:shape id="_x0000
418
418
  <x:ClientData ObjectType="Note"><x:MoveWithCells/><x:SizeWithCells/><x:Anchor>${r+1},15,${s-1},10,${r+3},15,${s+4},4</x:Anchor><x:AutoFill>False</x:AutoFill><x:Row>${s-1}</x:Row><x:Column>${r-1}</x:Column></x:ClientData>
419
419
  </v:shape>`}).join(`
420
420
  `)}
421
- </xml>`}async download(t="workbook.xlsx"){let o=await this.build(),n=new Blob([o.buffer],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),s=URL.createObjectURL(n),r=document.createElement("a");r.href=s,r.download=t,r.click(),URL.revokeObjectURL(s)}};function xa(e){switch(e){case"jpg":return"image/jpeg";case"png":return"image/png";case"gif":return"image/gif";case"bmp":return"image/bmp";case"tiff":return"image/tiff";case"emf":return"image/x-emf";case"wmf":return"image/x-wmf";case"svg":return"image/svg+xml";case"ico":return"image/x-icon";case"webp":return"image/webp";default:return`image/${e}`}}function ns(e){return e==="jpeg"?"jpg":e}function $a(e){let t=Array.from({length:e},(n,s)=>`<bk><extLst><ext uri="{3e2802c4-a4d2-4d8b-9148-e3be6c30e623}"><xlrd:rvb i="${s}"/></ext></extLst></bk>`).join(""),o=Array.from({length:e},(n,s)=>`<bk><rc t="1" v="${s}"/></bk>`).join("");return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><metadata xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:xlrd="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata"><metadataTypes count="1"><metadataType name="XLRICHVALUE" minSupportedVersion="120000" copy="1" pasteAll="1" pasteValues="1" merge="1" splitFirst="1" rowColShift="1" clearFormats="1" clearComments="1" assign="1" coerce="1"/></metadataTypes><futureMetadata name="XLRICHVALUE" count="${e}">${t}</futureMetadata><valueMetadata count="${e}">${o}</valueMetadata></metadata>`}function ya(e){let t=Array.from({length:e},(o,n)=>`<rv s="0"><v>${n}</v><v>5</v><v></v></rv>`).join("");return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><rvData xmlns="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata" count="${e}">${t}</rvData>`}function wa(e){return'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><richValueRels xmlns="http://schemas.microsoft.com/office/spreadsheetml/2022/richvaluerel" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">'+e.map(t=>`<rel r:id="${t}"/>`).join("")+"</richValueRels>"}function ba(){return'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><rvStructures xmlns="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata" count="1"><s t="_localImage"><k n="_rvRel:LocalImageIdentifier" t="i"/><k n="CalcOrigin" t="i"/><k n="Text" t="s"/></s></rvStructures>'}function Ca(){return'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><rvTypesInfo xmlns="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata2" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x" xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><global><keyFlags><key name="_Self"><flag name="ExcludeFromFile" value="1"/><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_DisplayString"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_Flags"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_Format"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_SubLabel"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_Attribution"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_Icon"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_Display"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_CanonicalPropertyNames"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_ClassificationId"><flag name="ExcludeFromCalcComparison" value="1"/></key></keyFlags></global><types></types></rvTypesInfo>'}var Fo=class{constructor(){this.s={}}font(t){return this.s.font={...this.s.font??{},...t},this}fontSize(t){return this.font({size:t})}fontName(t){return this.font({name:t})}bold(t=!0){return this.font({bold:t})}italic(t=!0){return this.font({italic:t})}strike(t=!0){return this.font({strike:t})}underline(t="single"){return this.font({underline:t})}fontColor(t){return this.font({color:t})}fill(t,o,n){return this.s.fill={type:"pattern",pattern:t,fgColor:o,bgColor:n},this}bg(t){return this.fill("solid",t)}border(t,o){let n={style:t,color:o};return this.s.border={left:n,right:n,top:n,bottom:n},this}borderLeft(t,o){return this.s.border={...this.s.border??{},left:{style:t,color:o}},this}borderRight(t,o){return this.s.border={...this.s.border??{},right:{style:t,color:o}},this}borderTop(t,o){return this.s.border={...this.s.border??{},top:{style:t,color:o}},this}borderBottom(t,o){return this.s.border={...this.s.border??{},bottom:{style:t,color:o}},this}align(t,o){return this.s.alignment={...this.s.alignment??{},horizontal:t,vertical:o},this}center(){return this.align("center","center")}wrap(t=!0){return this.s.alignment={...this.s.alignment??{},wrapText:t},this}rotate(t){return this.s.alignment={...this.s.alignment??{},textRotation:t},this}indent(t){return this.s.alignment={...this.s.alignment??{},indent:t},this}shrink(t=!0){return this.s.alignment={...this.s.alignment??{},shrinkToFit:t},this}numFmt(t){return this.s.numberFormat={formatCode:t},this}numFmtId(t){return this.s.numFmtId=t,this}locked(t=!0){return this.s.locked=t,this}hidden(t=!0){return this.s.hidden=t,this}build(){return{...this.s}}};function jt(){return new Fo}var Fa={headerBlue:jt().bold().bg("FF4472C4").fontColor("FFFFFFFF").center().build(),headerGray:jt().bold().bg("FF595959").fontColor("FFFFFFFF").center().build(),headerGreen:jt().bold().bg("FF70AD47").fontColor("FFFFFFFF").center().build(),currency:jt().numFmt('"$"#,##0.00').build(),percent:jt().numFmt("0.00%").build(),integer:jt().numFmt("#,##0").build(),date:jt().numFmtId(14).build(),dateTime:jt().numFmtId(22).build(),bold:jt().bold().build(),centered:jt().center().build(),wrapped:jt().wrap().build(),bordered:jt().border("thin").build(),borderedBlack:jt().border("thin","FF000000").build(),highlight:jt().bg("FFFFFF00").build(),lightBlue:jt().bg("FFDCE6F1").build(),redText:jt().fontColor("FFFF0000").build(),blueText:jt().fontColor("FF0000FF").build(),greenText:jt().fontColor("FF00B050").build(),tableHeader:jt().bold().border("thin").center().bg("FFD9E1F2").build(),deleted:jt().strike().fontColor("FF808080").build()},va={General:"General",Integer:"#,##0",Decimal2:"#,##0.00",Currency:'"$"#,##0.00',CurrencyNeg:'"$"#,##0.00;[Red]("$"#,##0.00)',Percent:"0%",Percent2:"0.00%",Scientific:"0.00E+00",Fraction:"# ?/?",ShortDate:"mm/dd/yyyy",LongDate:"mmmm d, yyyy",Time:"h:mm AM/PM",DateTime:"mm/dd/yyyy h:mm",Text:"@",Accounting:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',FinancialPos:"#,##0;(#,##0)",ZeroDash:'#,##0;(#,##0);"-"',Multiple:'0.0"x"'},Sa={White:"FFFFFFFF",Black:"FF000000",Red:"FFFF0000",Green:"FF00B050",Blue:"FF0070C0",Yellow:"FFFFFF00",Orange:"FFFFA500",Gray:"FF808080",LightGray:"FFD3D3D3",DarkBlue:"FF003366",ExcelBlue:"FF4472C4",ExcelOrange:"FFED7D31",ExcelGreen:"FF70AD47",ExcelRed:"FFFF0000",ExcelPurple:"FF7030A0",Transparent:"00FFFFFF"};function Ia(e,t={}){let o=t.delimiter??",",n=t.lineEnding??`\r
422
- `,s=t.quote??'"',r=[],a=e.readAllCells(),i=0,l=0;for(let{row:m,col:c}of a)m>i&&(i=m),c>l&&(l=c);let h=new Map;for(let{row:m,col:c,cell:d}of a)h.set(`${m},${c}`,d.value??null);for(let m=1;m<=i;m++){let c=[];for(let d=1;d<=l;d++){let f=h.get(`${m},${d}`),p=Ta(f);p.includes(o)||p.includes(s)||p.includes(`
423
- `)||p.includes("\r")?c.push(s+p.replace(new RegExp(s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),s+s)+s):c.push(p)}r.push(c.join(o))}return r.join(n)}function Ta(e){return e==null?"":e instanceof te?e.error:e instanceof Date?e.toISOString():String(e)}function ka(e,t={}){let o=t.delimiter??",",n=t.quote??'"',s=t.sheetName??"Sheet1",r=Aa(e,o,n),a=new ao,i=a.addSheet(s);for(let l=0;l<r.length;l++)for(let h=0;h<r[l].length;h++){let m=r[l][h];if(m==="")continue;let c=Number(m);!isNaN(c)&&m.trim()!==""?i.setValue(l+1,h+1,c):m.toLowerCase()==="true"?i.setValue(l+1,h+1,!0):m.toLowerCase()==="false"?i.setValue(l+1,h+1,!1):i.setValue(l+1,h+1,m)}return a}function Aa(e,t,o){let n=[],s=[],r="",a=!1,i=0,l=e.length;for(;i<l;){let h=e[i];a?h===o?i+1<l&&e[i+1]===o?(r+=o,i+=2):(a=!1,i++):(r+=h,i++):h===o?(a=!0,i++):h===t?(s.push(r),r="",i++):h==="\r"?(s.push(r),r="",n.push(s),s=[],i++,i<l&&e[i]===`
421
+ </xml>`}async download(t="workbook.xlsx"){let o=await this.build(),n=new Blob([o.buffer],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),s=URL.createObjectURL(n),r=document.createElement("a");r.href=s,r.download=t,r.click(),URL.revokeObjectURL(s)}};function Oa(e){switch(e){case"jpg":return"image/jpeg";case"png":return"image/png";case"gif":return"image/gif";case"bmp":return"image/bmp";case"tiff":return"image/tiff";case"emf":return"image/x-emf";case"wmf":return"image/x-wmf";case"svg":return"image/svg+xml";case"ico":return"image/x-icon";case"webp":return"image/webp";default:return`image/${e}`}}function Fs(e){return e==="jpeg"?"jpg":e}function La(e){let t=Array.from({length:e},(n,s)=>`<bk><extLst><ext uri="{3e2802c4-a4d2-4d8b-9148-e3be6c30e623}"><xlrd:rvb i="${s}"/></ext></extLst></bk>`).join(""),o=Array.from({length:e},(n,s)=>`<bk><rc t="1" v="${s}"/></bk>`).join("");return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><metadata xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:xlrd="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata"><metadataTypes count="1"><metadataType name="XLRICHVALUE" minSupportedVersion="120000" copy="1" pasteAll="1" pasteValues="1" merge="1" splitFirst="1" rowColShift="1" clearFormats="1" clearComments="1" assign="1" coerce="1"/></metadataTypes><futureMetadata name="XLRICHVALUE" count="${e}">${t}</futureMetadata><valueMetadata count="${e}">${o}</valueMetadata></metadata>`}function Na(e){let t=Array.from({length:e},(o,n)=>`<rv s="0"><v>${n}</v><v>5</v><v></v></rv>`).join("");return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><rvData xmlns="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata" count="${e}">${t}</rvData>`}function Xa(e){return'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><richValueRels xmlns="http://schemas.microsoft.com/office/spreadsheetml/2022/richvaluerel" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">'+e.map(t=>`<rel r:id="${t}"/>`).join("")+"</richValueRels>"}function Ua(){return'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><rvStructures xmlns="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata" count="1"><s t="_localImage"><k n="_rvRel:LocalImageIdentifier" t="i"/><k n="CalcOrigin" t="i"/><k n="Text" t="s"/></s></rvStructures>'}function Va(){return'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><rvTypesInfo xmlns="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata2" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x" xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><global><keyFlags><key name="_Self"><flag name="ExcludeFromFile" value="1"/><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_DisplayString"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_Flags"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_Format"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_SubLabel"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_Attribution"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_Icon"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_Display"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_CanonicalPropertyNames"><flag name="ExcludeFromCalcComparison" value="1"/></key><key name="_ClassificationId"><flag name="ExcludeFromCalcComparison" value="1"/></key></keyFlags></global><types></types></rvTypesInfo>'}var To=class{constructor(){this.s={}}font(t){return this.s.font={...this.s.font??{},...t},this}fontSize(t){return this.font({size:t})}fontName(t){return this.font({name:t})}bold(t=!0){return this.font({bold:t})}italic(t=!0){return this.font({italic:t})}strike(t=!0){return this.font({strike:t})}underline(t="single"){return this.font({underline:t})}fontColor(t){return this.font({color:t})}fill(t,o,n){return this.s.fill={type:"pattern",pattern:t,fgColor:o,bgColor:n},this}bg(t){return this.fill("solid",t)}border(t,o){let n={style:t,color:o};return this.s.border={left:n,right:n,top:n,bottom:n},this}borderLeft(t,o){return this.s.border={...this.s.border??{},left:{style:t,color:o}},this}borderRight(t,o){return this.s.border={...this.s.border??{},right:{style:t,color:o}},this}borderTop(t,o){return this.s.border={...this.s.border??{},top:{style:t,color:o}},this}borderBottom(t,o){return this.s.border={...this.s.border??{},bottom:{style:t,color:o}},this}align(t,o){return this.s.alignment={...this.s.alignment??{},horizontal:t,vertical:o},this}center(){return this.align("center","center")}wrap(t=!0){return this.s.alignment={...this.s.alignment??{},wrapText:t},this}rotate(t){return this.s.alignment={...this.s.alignment??{},textRotation:t},this}indent(t){return this.s.alignment={...this.s.alignment??{},indent:t},this}shrink(t=!0){return this.s.alignment={...this.s.alignment??{},shrinkToFit:t},this}numFmt(t){return this.s.numberFormat={formatCode:t},this}numFmtId(t){return this.s.numFmtId=t,this}locked(t=!0){return this.s.locked=t,this}hidden(t=!0){return this.s.hidden=t,this}build(){return{...this.s}}};function jt(){return new To}var Wa={headerBlue:jt().bold().bg("FF4472C4").fontColor("FFFFFFFF").center().build(),headerGray:jt().bold().bg("FF595959").fontColor("FFFFFFFF").center().build(),headerGreen:jt().bold().bg("FF70AD47").fontColor("FFFFFFFF").center().build(),currency:jt().numFmt('"$"#,##0.00').build(),percent:jt().numFmt("0.00%").build(),integer:jt().numFmt("#,##0").build(),date:jt().numFmtId(14).build(),dateTime:jt().numFmtId(22).build(),bold:jt().bold().build(),centered:jt().center().build(),wrapped:jt().wrap().build(),bordered:jt().border("thin").build(),borderedBlack:jt().border("thin","FF000000").build(),highlight:jt().bg("FFFFFF00").build(),lightBlue:jt().bg("FFDCE6F1").build(),redText:jt().fontColor("FFFF0000").build(),blueText:jt().fontColor("FF0000FF").build(),greenText:jt().fontColor("FF00B050").build(),tableHeader:jt().bold().border("thin").center().bg("FFD9E1F2").build(),deleted:jt().strike().fontColor("FF808080").build()},Ha={General:"General",Integer:"#,##0",Decimal2:"#,##0.00",Currency:'"$"#,##0.00',CurrencyNeg:'"$"#,##0.00;[Red]("$"#,##0.00)',Percent:"0%",Percent2:"0.00%",Scientific:"0.00E+00",Fraction:"# ?/?",ShortDate:"mm/dd/yyyy",LongDate:"mmmm d, yyyy",Time:"h:mm AM/PM",DateTime:"mm/dd/yyyy h:mm",Text:"@",Accounting:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',FinancialPos:"#,##0;(#,##0)",ZeroDash:'#,##0;(#,##0);"-"',Multiple:'0.0"x"'},za={White:"FFFFFFFF",Black:"FF000000",Red:"FFFF0000",Green:"FF00B050",Blue:"FF0070C0",Yellow:"FFFFFF00",Orange:"FFFFA500",Gray:"FF808080",LightGray:"FFD3D3D3",DarkBlue:"FF003366",ExcelBlue:"FF4472C4",ExcelOrange:"FFED7D31",ExcelGreen:"FF70AD47",ExcelRed:"FFFF0000",ExcelPurple:"FF7030A0",Transparent:"00FFFFFF"};Wt();function Ga(e,t={}){let o=t.delimiter??",",n=t.lineEnding??`\r
422
+ `,s=t.quote??'"',r=[],a=e.readAllCells(),i=0,l=0;for(let{row:m,col:c}of a)m>i&&(i=m),c>l&&(l=c);let h=new Map;for(let{row:m,col:c,cell:d}of a)h.set(`${m},${c}`,d.value??null);for(let m=1;m<=i;m++){let c=[];for(let d=1;d<=l;d++){let f=h.get(`${m},${d}`),p=qa(f);p.includes(o)||p.includes(s)||p.includes(`
423
+ `)||p.includes("\r")?c.push(s+p.replace(new RegExp(s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),s+s)+s):c.push(p)}r.push(c.join(o))}return r.join(n)}function qa(e){return e==null?"":e instanceof ee?e.error:e instanceof Date?e.toISOString():String(e)}function Ka(e,t={}){let o=t.delimiter??",",n=t.quote??'"',s=t.sheetName??"Sheet1",r=Za(e,o,n),a=new io,i=a.addSheet(s);for(let l=0;l<r.length;l++)for(let h=0;h<r[l].length;h++){let m=r[l][h];if(m==="")continue;let c=Number(m);!isNaN(c)&&m.trim()!==""?i.setValue(l+1,h+1,c):m.toLowerCase()==="true"?i.setValue(l+1,h+1,!0):m.toLowerCase()==="false"?i.setValue(l+1,h+1,!1):i.setValue(l+1,h+1,m)}return a}function Za(e,t,o){let n=[],s=[],r="",a=!1,i=0,l=e.length;for(;i<l;){let h=e[i];a?h===o?i+1<l&&e[i+1]===o?(r+=o,i+=2):(a=!1,i++):(r+=h,i++):h===o?(a=!0,i++):h===t?(s.push(r),r="",i++):h==="\r"?(s.push(r),r="",n.push(s),s=[],i++,i<l&&e[i]===`
424
424
  `&&i++):h===`
425
- `?(s.push(r),r="",n.push(s),s=[],i++):(r+=h,i++)}return(r||s.length)&&(s.push(r),n.push(s)),n}function rs(e,t={}){let o=t.header!==!1,n=t.includeEmpty??!1,s=t.range?e.readRange(t.range):Ra(e);if(s.length===0)return[];if(o){let r=s[0].map(a=>String(a??""));return s.slice(1).map(a=>{let i={};for(let l=0;l<r.length;l++){let h=l<a.length?a[l]:null;!n&&h==null||(i[r[l]]=ss(h,t))}return i})}else return s.map(r=>r.map(a=>ss(a,t)))}function Da(e,t={}){let o={};for(let n of e.getSheets())o[n.name]=rs(n,t);return o}function ss(e,t){if(e==null)return null;if(e instanceof te)return e.error;if(e instanceof Date)switch(t.dateFormat){case"epoch":return e.getTime();case"serial":return(e.getTime()-Date.UTC(1899,11,30))/864e5;default:return e.toISOString()}return e}function Ra(e){let t=e.readAllCells();if(t.length===0)return[];let o=0,n=0;for(let{row:a,col:i}of t)a>o&&(o=a),i>n&&(n=i);let s=[],r=new Map;for(let{row:a,col:i,cell:l}of t)r.has(a)||r.set(a,new Map),r.get(a).set(i,l.value??null);for(let a=1;a<=o;a++){let i=[],l=r.get(a);for(let h=1;h<=n;h++)i.push(l?.get(h)??null);s.push(i)}return s}function lt(e){if(typeof e=="number")return e;if(typeof e=="boolean")return e?1:0;if(typeof e=="string"){let t=Number(e);return isNaN(t)?0:t}return 0}var me=class{constructor(){this.calculating=new Set}calculateWorkbook(t){let o=t.getSheets();for(let n of o)this.calculateSheet(n)}calculateSheet(t){this.ws=t;let o=t.readAllCells();for(let{row:n,col:s,cell:r}of o)if(r.formula){this.calculating.clear();let a=this.evaluate(r.formula,n,s);r.value=a}}getCellValue(t,o){let n=this.ws.getCell(t,o);if(n.formula){let s=`${t},${o}`;if(this.calculating.has(s))return 0;this.calculating.add(s);let r=this.evaluate(n.formula,t,o);n.value=r,this.calculating.delete(s)}return n.value??null}resolveRange(t){let n=(t.includes("!")?t.split("!")[1]:t).replace(/\$/g,"");if(n.includes(":")){let{startRow:a,startCol:i,endRow:l,endCol:h}=Kt(n),m=[];for(let c=a;c<=l;c++)for(let d=i;d<=h;d++)m.push(this.getCellValue(c,d));return m}let{row:s,col:r}=Gt(n);return[this.getCellValue(s,r)]}evaluate(t,o,n){try{return this.parseExpression(t.trim(),0,o,n).value}catch{return"#VALUE!"}}parseExpression(t,o,n,s){return this.parseComparison(t,o,n,s)}parseComparison(t,o,n,s){let r=this.parseAddSub(t,o,n,s),{value:a,pos:i}=r;i=this.skipSpaces(t,i);let l=[">=","<=","<>",">","<","="];for(let h of l)if(t.slice(i,i+h.length)===h){let m=this.parseAddSub(t,i+h.length,n,s),c=a,d=m.value;switch(h){case">=":a=lt(c)>=lt(d);break;case"<=":a=lt(c)<=lt(d);break;case"<>":a=c!==d;break;case">":a=lt(c)>lt(d);break;case"<":a=lt(c)<lt(d);break;case"=":a=c===d||lt(c)===lt(d);break}i=m.pos;break}return{value:a,pos:i}}parseAddSub(t,o,n,s){let r=this.parseMulDiv(t,o,n,s),{value:a,pos:i}=r;for(;i<t.length;)if(i=this.skipSpaces(t,i),t[i]==="+"){let l=this.parseMulDiv(t,i+1,n,s);a=lt(a)+lt(l.value),i=l.pos}else if(t[i]==="-"){let l=this.parseMulDiv(t,i+1,n,s);a=lt(a)-lt(l.value),i=l.pos}else if(t[i]==="&"){let l=this.parseMulDiv(t,i+1,n,s);a=String(a??"")+String(l.value??""),i=l.pos}else break;return{value:a,pos:i}}parseMulDiv(t,o,n,s){let r=this.parsePower(t,o,n,s),{value:a,pos:i}=r;for(;i<t.length;)if(i=this.skipSpaces(t,i),t[i]==="*"){let l=this.parsePower(t,i+1,n,s);a=lt(a)*lt(l.value),i=l.pos}else if(t[i]==="/"){let l=this.parsePower(t,i+1,n,s),h=lt(l.value);a=h===0?"#DIV/0!":lt(a)/h,i=l.pos}else break;return{value:a,pos:i}}parsePower(t,o,n,s){let r=this.parseUnary(t,o,n,s),{value:a,pos:i}=r;if(i=this.skipSpaces(t,i),i<t.length&&t[i]==="^"){let l=this.parseUnary(t,i+1,n,s);a=Math.pow(lt(a),lt(l.value)),i=l.pos}return{value:a,pos:i}}parseUnary(t,o,n,s){if(o=this.skipSpaces(t,o),t[o]==="-"){let r=this.parseAtom(t,o+1,n,s);return{value:-lt(r.value),pos:r.pos}}return t[o]==="+"?this.parseAtom(t,o+1,n,s):this.parseAtom(t,o,n,s)}parseAtom(t,o,n,s){if(o=this.skipSpaces(t,o),t[o]==="("){let l=this.parseExpression(t,o+1,n,s),h=this.skipSpaces(t,l.pos);return t[h]===")"&&h++,{value:l.value,pos:h}}if(t[o]==='"'){let l=o+1,h="";for(;l<t.length;){if(t[l]==='"'){if(t[l+1]==='"'){h+='"',l+=2;continue}break}h+=t[l++]}return{value:h,pos:l+1}}if(/[0-9.]/.test(t[o])){let l=o;for(;l<t.length&&/[0-9.eE+-]/.test(t[l])&&!(l>o&&(t[l]==="+"||t[l]==="-")&&!/[eE]/.test(t[l-1]));)l++;return{value:parseFloat(t.slice(o,l)),pos:l}}if(t.slice(o,o+4).toUpperCase()==="TRUE")return{value:!0,pos:o+4};if(t.slice(o,o+5).toUpperCase()==="FALSE")return{value:!1,pos:o+5};let r=o;for(;r<t.length&&/[A-Za-z0-9_$!:]/.test(t[r]);)r++;let a=t.slice(o,r),i=this.skipSpaces(t,r);if(t[i]==="("){let l=a.toUpperCase(),h=this.parseArgList(t,i,n,s);return{value:this.callFunction(l,h.args,n,s),pos:h.pos}}if(a.includes(":")||/^[A-Z]+[0-9]+$/i.test(a.replace(/\$/g,""))||a.includes("!")){let l=this.resolveRange(a);return{value:(l.length===1,l[0]),pos:r}}return{value:a,pos:r}}parseArgList(t,o,n,s){o++;let r=[];if(this.skipSpaces(t,o)<t.length&&t[this.skipSpaces(t,o)]===")")return{args:[],pos:this.skipSpaces(t,o)+1};for(;o<t.length;){o=this.skipSpaces(t,o);let a=t.slice(o).match(/^([A-Z$]+[0-9$]+:[A-Z$]+[0-9$]+|[A-Za-z]+![A-Z$]+[0-9$]+:[A-Z$]+[0-9$]+)/i);if(a){let i=a[1];r.push(this.resolveRange(i)),o+=i.length}else{let i=this.parseExpression(t,o,n,s);r.push([i.value]),o=i.pos}if(o=this.skipSpaces(t,o),t[o]===","){o++;continue}if(t[o]===")"){o++;break}break}return{args:r,pos:o}}skipSpaces(t,o){for(;o<t.length&&t[o]===" ";)o++;return o}callFunction(t,o,n,s){let r=i=>i.flat(),a=i=>r(i).filter(l=>typeof l=="number"||typeof l=="string"&&l!==""&&!isNaN(Number(l))).map(l=>Number(l));switch(t){case"SUM":return a(o).reduce((i,l)=>i+l,0);case"AVERAGE":{let i=a(o);return i.length?i.reduce((l,h)=>l+h,0)/i.length:0}case"COUNT":return a(o).length;case"COUNTA":return r(o).filter(i=>i!=null&&i!=="").length;case"COUNTBLANK":return r(o).filter(i=>i==null||i==="").length;case"MAX":{let i=a(o);return i.length?Math.max(...i):0}case"MIN":{let i=a(o);return i.length?Math.min(...i):0}case"ABS":return Math.abs(lt(r(o)[0]));case"ROUND":{let i=lt(r(o)[0]),l=lt(r(o)[1]??0),h=Math.pow(10,l);return Math.round(i*h)/h}case"ROUNDUP":{let i=lt(r(o)[0]),l=lt(r(o)[1]??0),h=Math.pow(10,l);return Math.ceil(i*h)/h}case"ROUNDDOWN":{let i=lt(r(o)[0]),l=lt(r(o)[1]??0),h=Math.pow(10,l);return Math.floor(i*h)/h}case"INT":return Math.floor(lt(r(o)[0]));case"MOD":return lt(r(o)[0])%lt(r(o)[1]);case"POWER":return Math.pow(lt(r(o)[0]),lt(r(o)[1]));case"SQRT":return Math.sqrt(lt(r(o)[0]));case"PI":return Math.PI;case"RAND":return Math.random();case"RANDBETWEEN":{let i=lt(r(o)[0]),l=lt(r(o)[1]);return Math.floor(Math.random()*(l-i+1))+i}case"SUMPRODUCT":{if(o.length<2)return 0;let i=o[0].length,l=0;for(let h=0;h<i;h++){let m=1;for(let c of o)m*=lt(c[h]??0);l+=m}return l}case"SUMIF":{let i=o[0]??[],l=String(r(o.slice(1,2))[0]??""),h=o[2]??i,m=0;for(let c=0;c<i.length;c++)this.matchCriteria(i[c],l)&&(m+=lt(h[c]??0));return m}case"COUNTIF":{let i=o[0]??[],l=String(r(o.slice(1,2))[0]??"");return i.filter(h=>this.matchCriteria(h,l)).length}case"IF":{let i=r(o.slice(0,1))[0],l=r(o.slice(1,2))[0]??!0,h=o.length>2?r(o.slice(2,3))[0]??!1:!1;return i?l:h}case"AND":return r(o).every(i=>!!i);case"OR":return r(o).some(i=>!!i);case"NOT":return!r(o)[0];case"IFERROR":{let i=r(o.slice(0,1))[0];return typeof i=="string"&&i.startsWith("#")?r(o.slice(1,2))[0]??"":i}case"IFNA":{let i=r(o.slice(0,1))[0];return i==="#N/A"?r(o.slice(1,2))[0]??"":i}case"CONCATENATE":case"CONCAT":return r(o).map(i=>String(i??"")).join("");case"TEXTJOIN":{let i=String(r(o.slice(0,1))[0]??""),l=!!r(o.slice(1,2))[0],h=r(o.slice(2));return(l?h.filter(c=>c!=null&&c!==""):h).map(c=>String(c??"")).join(i)}case"LEN":return String(r(o)[0]??"").length;case"LEFT":return String(r(o)[0]??"").slice(0,lt(r(o)[1])||1);case"RIGHT":{let i=String(r(o)[0]??""),l=lt(r(o)[1])||1;return i.slice(-l)}case"MID":{let i=String(r(o)[0]??""),l=lt(r(o)[1])-1,h=lt(r(o)[2]);return i.slice(l,l+h)}case"UPPER":return String(r(o)[0]??"").toUpperCase();case"LOWER":return String(r(o)[0]??"").toLowerCase();case"TRIM":return String(r(o)[0]??"").trim().replace(/\s+/g," ");case"SUBSTITUTE":{let i=String(r(o)[0]??""),l=String(r(o)[1]??""),h=String(r(o)[2]??"");return i.split(l).join(h)}case"FIND":case"SEARCH":{let i=String(r(o)[0]??""),l=String(r(o)[1]??""),h=lt(r(o)[2])||1,m=t==="SEARCH"?d=>d.toLowerCase():d=>d,c=m(l).indexOf(m(i),h-1);return c>=0?c+1:"#VALUE!"}case"REPLACE":{let i=String(r(o)[0]??""),l=lt(r(o)[1])-1,h=lt(r(o)[2]),m=String(r(o)[3]??"");return i.slice(0,l)+m+i.slice(l+h)}case"REPT":return String(r(o)[0]??"").repeat(lt(r(o)[1]));case"TEXT":return String(r(o)[0]??"");case"VALUE":return lt(r(o)[0]);case"EXACT":return String(r(o)[0]??"")===String(r(o)[1]??"");case"VLOOKUP":{let i=r(o.slice(0,1))[0],l=o[1]??[],h=lt(r(o.slice(2,3))[0])-1;return"#N/A"}case"INDEX":{let i=o[0]??[],l=lt(r(o.slice(1,2))[0])-1;return i[l]??"#REF!"}case"MATCH":{let i=r(o.slice(0,1))[0],h=(o[1]??[]).findIndex(m=>m===i||String(m)===String(i));return h>=0?h+1:"#N/A"}case"ISBLANK":return r(o)[0]==null||r(o)[0]==="";case"ISNUMBER":return typeof r(o)[0]=="number";case"ISTEXT":return typeof r(o)[0]=="string";case"ISLOGICAL":return typeof r(o)[0]=="boolean";case"ISERROR":{let i=r(o)[0];return typeof i=="string"&&i.startsWith("#")}case"ISNA":return r(o)[0]==="#N/A";case"TYPE":{let i=r(o)[0];return typeof i=="number"?1:typeof i=="string"?2:typeof i=="boolean"?4:1}case"ROW":return n;case"COLUMN":return s;case"NA":return"#N/A";case"TODAY":return new Date().toISOString().slice(0,10);case"NOW":return new Date().toISOString();case"YEAR":return new Date(String(r(o)[0])).getFullYear();case"MONTH":return new Date(String(r(o)[0])).getMonth()+1;case"DAY":return new Date(String(r(o)[0])).getDate();case"GETPIVOTDATA":return String(r(o.slice(0,1))[0]??"")||"#REF!";default:return"#NAME?"}}matchCriteria(t,o){let n=[">=","<=","<>",">","<","="];for(let s of n)if(o.startsWith(s)){let r=o.slice(s.length),a=lt(t),i=Number(r);if(!isNaN(i))switch(s){case">=":return a>=i;case"<=":return a<=i;case"<>":return a!==i;case">":return a>i;case"<":return a<i;case"=":return a===i}switch(s){case"<>":return String(t)!==r;case"=":return String(t)===r}}return typeof t=="number"?t===Number(o):String(t)===o}};var Pa=["#000000","#FFFFFF","#44546A","#E7E6E6","#4472C4","#ED7D31","#A5A5A5","#FFC000","#5B9BD5","#70AD47"];function Nt(e){if(!e)return"";if(e.startsWith("#"))return e;if(e.startsWith("theme:")){let t=parseInt(e.slice(6),10);return Pa[t]??"#000"}return e.length===8&&!e.startsWith("#")?"#"+e.slice(2):"#"+e}function as(e){let t=e.replace("#","");return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}function an(e,t,o){let[n,s,r]=as(Nt(e)||"#FFFFFF"),[a,i,l]=as(Nt(t)||"#000000"),h=Math.round(n+(a-n)*o),m=Math.round(s+(i-s)*o),c=Math.round(r+(l-r)*o);return`#${h.toString(16).padStart(2,"0")}${m.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`}function is(e){let t=[];e.bold&&t.push("font-weight:bold"),e.italic&&t.push("font-style:italic");let o=[];return e.underline&&e.underline!=="none"&&o.push("underline"),e.strike&&o.push("line-through"),o.length&&t.push(`text-decoration:${o.join(" ")}`),e.size&&t.push(`font-size:${e.size}pt`),e.color&&t.push(`color:${Nt(e.color)}`),e.name&&t.push(`font-family:'${e.name}',sans-serif`),e.vertAlign==="superscript"?t.push("vertical-align:super;font-size:smaller"):e.vertAlign==="subscript"&&t.push("vertical-align:sub;font-size:smaller"),t.join(";")}function Ma(e){if(e.type==="pattern"){let t=e;if(t.pattern==="solid"&&t.fgColor)return`background-color:${Nt(t.fgColor)}`}if(e.type==="gradient"){let t=e;if(t.stops&&t.stops.length>=2){let o=t.stops.map(s=>`${Nt(s.color)} ${Math.round(s.position*100)}%`).join(",");return`background:linear-gradient(${t.degree??0}deg,${o})`}}return""}function vo(e){if(!e||!e.style)return"";let t={thin:"1px",medium:"2px",thick:"3px",dashed:"1px",dotted:"1px",double:"3px",hair:"1px",mediumDashed:"2px",dashDot:"1px",mediumDashDot:"2px",dashDotDot:"1px",mediumDashDotDot:"2px",slantDashDot:"2px"},o={thin:"solid",medium:"solid",thick:"solid",dashed:"dashed",dotted:"dotted",double:"double",hair:"solid",mediumDashed:"dashed",dashDot:"dashed",mediumDashDot:"dashed",dashDotDot:"dotted",mediumDashDotDot:"dotted",slantDashDot:"dashed"},n=t[e.style]??"1px",s=o[e.style]??"solid",r=e.color?Nt(e.color):"#000";return`${n} ${s} ${r}`}function Ea(e){let t=[];if(e.horizontal){let o={left:"left",center:"center",right:"right",fill:"justify",justify:"justify",distributed:"justify"};t.push(`text-align:${o[e.horizontal]??e.horizontal}`)}if(e.vertical){let o={top:"top",center:"middle",bottom:"bottom",distributed:"middle"};t.push(`vertical-align:${o[e.vertical]??"bottom"}`)}return e.wrapText&&t.push("white-space:normal;word-wrap:break-word"),e.textRotation&&t.push(`transform:rotate(-${e.textRotation}deg)`),e.indent&&t.push(`padding-left:${e.indent*8}px`),t.join(";")}function Ba(e){let t=[];return e.font&&t.push(is(e.font)),e.fill&&t.push(Ma(e.fill)),e.alignment&&t.push(Ea(e.alignment)),e.border&&(e.border.top&&t.push(`border-top:${vo(e.border.top)}`),e.border.bottom&&t.push(`border-bottom:${vo(e.border.bottom)}`),e.border.left&&t.push(`border-left:${vo(e.border.left)}`),e.border.right&&t.push(`border-right:${vo(e.border.right)}`)),t.filter(Boolean).join(";")}function _a(e,t){if(e==null)return"";if(!t||t==="General")return String(e);let o=typeof e=="number"?e:parseFloat(String(e));if(isNaN(o))return String(e);if(t.includes("%")){let r=(t.match(/0\.(0+)%/)??[])[1]?.length??0;return(o*100).toFixed(r)+"%"}let n=t.match(/[$€£¥]|"CHF"/);if(n){let r=n[0].replace(/"/g,""),a=(t.match(/\.(0+)/)??[])[1]?.length??2,i=Math.abs(o).toFixed(a).replace(/\B(?=(\d{3})+(?!\d))/g,",");return t.indexOf(n[0])<t.indexOf("0")?(o<0?"-":"")+r+i:(o<0?"-":"")+i+" "+r}if(t.includes("#,##0")||t.includes("#,###")){let r=(t.match(/\.(0+)/)??[])[1]?.length??0;return o.toFixed(r).replace(/\B(?=(\d{3})+(?!\d))/g,",")}let s=t.match(/^0\.(0+)$/);if(s)return o.toFixed(s[1].length);if(/[ymdh]/i.test(t))return ja(o,t);if(t.includes("?/?")||t.includes("??/??"))return Oa(o);if(/0\.0+E\+0+/i.test(t)){let r=(t.match(/0\.(0+)/)??[])[1]?.length??2;return o.toExponential(r).toUpperCase()}return String(e)}function ja(e,t){let o=new Date(1899,11,30),n=new Date(o.getTime()+e*864e5),s=n.getFullYear(),r=n.getMonth()+1,a=n.getDate(),i=n.getHours(),l=n.getMinutes(),h=n.getSeconds();return t.replace(/yyyy/gi,String(s)).replace(/yy/gi,String(s).slice(-2)).replace(/mmmm/gi,n.toLocaleDateString("en",{month:"long"})).replace(/mmm/gi,n.toLocaleDateString("en",{month:"short"})).replace(/mm/gi,String(r).padStart(2,"0")).replace(/m/gi,String(r)).replace(/dd/gi,String(a).padStart(2,"0")).replace(/d/gi,String(a)).replace(/hh/gi,String(i).padStart(2,"0")).replace(/h/gi,String(i)).replace(/ss/gi,String(h).padStart(2,"0")).replace(/nn|MM/g,String(l).padStart(2,"0"))}function Oa(e){let t=Math.floor(Math.abs(e)),o=Math.abs(e)-t;if(o<1e-4)return String(e<0?-t:t);let n=0,s=1,r=1;for(let i=1;i<=100;i++){let l=Math.round(o*i),h=Math.abs(o-l/i);if(h<r&&(n=l,s=i,r=h),h<1e-4)break}let a=e<0?"-":"";return t>0?`${a}${t} ${n}/${s}`:`${a}${n}/${s}`}function La(e,t,o){if(e.colorScale){let n=[...o].sort((h,m)=>h-m),s=n[0],a=n[n.length-1]-s||1,i=(t-s)/a,l=e.colorScale;if(l.color.length===2)return`background-color:${an(l.color[0],l.color[1],i)}`;if(l.color.length>=3)return i<=.5?`background-color:${an(l.color[0],l.color[1],i*2)}`:`background-color:${an(l.color[1],l.color[2],(i-.5)*2)}`}if(e.dataBar){let n=[...o].sort((l,h)=>l-h),s=n[0],r=n[n.length-1],a=Math.round((t-s)/(r-s||1)*100);return`background:linear-gradient(90deg,${Nt(e.dataBar.color)||"#638EC6"} ${a}%,transparent ${a}%)`}if(e.iconSet){let n=[...o].sort((m,c)=>m-c),s=n[0],r=n[n.length-1],a=(t-s)/(r-s||1),l={"3Arrows":["\u2193","\u2192","\u2191"],"3ArrowsGray":["\u21E9","\u21E8","\u21E7"],"3TrafficLights1":["\u{1F534}","\u{1F7E1}","\u{1F7E2}"],"3TrafficLights2":["\u{1F534}","\u{1F7E1}","\u{1F7E2}"],"3Signs":["\u26D4","\u26A0\uFE0F","\u2705"],"3Symbols":["\u2716","!","\u2714"],"3Symbols2":["\u2716","!","\u2714"],"3Flags":["\u{1F3F4}","\u{1F3F3}","\u{1F3C1}"],"3Stars":["\u2606","\u2605","\u2605"],"4Arrows":["\u2193","\u2198","\u2197","\u2191"],"4ArrowsGray":["\u21E9","\u21D8","\u21D7","\u21E7"],"4Rating":["\u25D4","\u25D1","\u25D5","\u25CF"],"4RedToBlack":["\u2B24","\u2B24","\u2B24","\u2B24"],"4TrafficLights":["\u2B24","\u2B24","\u2B24","\u2B24"],"5Arrows":["\u2193","\u2198","\u2192","\u2197","\u2191"],"5ArrowsGray":["\u21E9","\u21D8","\u21E8","\u21D7","\u21E7"],"5Quarters":["\u25CB","\u25D4","\u25D1","\u25D5","\u25CF"],"5Rating":["\u25D4","\u25D4","\u25D1","\u25D5","\u25CF"]}[e.iconSet.iconSet??"3TrafficLights1"]??["\u{1F534}","\u{1F7E1}","\u{1F7E2}"],h=Math.min(Math.floor(a*l.length),l.length-1);return`data-icon="${l[h]}"`}return""}function Na(e,t){if(!t.length)return"";let o=100,n=20,s=Math.min(...t),a=Math.max(...t)-s||1,i=Nt(e.color)||"#4472C4",l=t.indexOf(Math.max(...t)),h=t.indexOf(Math.min(...t));if(e.type==="bar"||e.type==="stacked"){let g=o/t.length,u=t.map(($,x)=>{let b=e.type==="stacked"?($>=0,n/2):Math.max(1,($-s)/a*n),C=e.type==="stacked"?$>=0?n/2-b:n/2:n-b,y=i;return $<0&&e.negativeColor?y=Nt(e.negativeColor):e.showHigh&&x===l&&e.highColor?y=Nt(e.highColor):e.showLow&&x===h&&e.lowColor?y=Nt(e.lowColor):e.showFirst&&x===0&&e.firstColor?y=Nt(e.firstColor):e.showLast&&x===t.length-1&&e.lastColor&&(y=Nt(e.lastColor)),`<rect x="${x*g+g*.1}" y="${C}" width="${g*.8}" height="${b}" fill="${y}" rx="1"/>`}).join("");return`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${n}" viewBox="0 0 ${o} ${n}" style="display:inline-block;vertical-align:middle">${u}</svg>`}let m=e.lineWidth??1.5,c=t.map((g,u)=>`${u/(t.length-1||1)*o},${n-(g-s)/a*n}`).join(" "),d="";e.showMarkers&&(d=t.map((g,u)=>{let $=u/(t.length-1||1)*o,x=n-(g-s)/a*n;return`<circle cx="${$}" cy="${x}" r="1.5" fill="${Nt(e.markersColor)||i}"/>`}).join(""));let f=[],p=(g,u)=>{let $=g/(t.length-1||1)*o,x=n-(t[g]-s)/a*n;f.push(`<circle cx="${$}" cy="${x}" r="2.5" fill="${u}" stroke="white" stroke-width="0.5"/>`)};return e.showHigh&&e.highColor&&p(l,Nt(e.highColor)),e.showLow&&e.lowColor&&p(h,Nt(e.lowColor)),e.showFirst&&e.firstColor&&p(0,Nt(e.firstColor)),e.showLast&&e.lastColor&&p(t.length-1,Nt(e.lastColor)),e.showNegative&&e.negativeColor&&t.forEach((g,u)=>{if(g<0){let $=u/(t.length-1||1)*o,x=n-(g-s)/a*n;f.push(`<circle cx="${$}" cy="${x}" r="2" fill="${Nt(e.negativeColor)}"/>`)}}),`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${n}" viewBox="0 0 ${o} ${n}" style="display:inline-block;vertical-align:middle"><polyline points="${c}" fill="none" stroke="${i}" stroke-width="${m}"/>${d}${f.join("")}</svg>`}var He=["#4472C4","#ED7D31","#A5A5A5","#FFC000","#5B9BD5","#70AD47","#264478","#9B57A0","#636363","#EB7E3A"];function ls(e,t){let o=[],r=(t.includes("!")?t.split("!")[1]:t).replace(/\$/g,"").match(/^([A-Z]+)(\d+):([A-Z]+)(\d+)$/);if(!r)return o;let a=ne(r[1]),i=parseInt(r[2],10),l=ne(r[3]),h=parseInt(r[4],10);for(let m=i;m<=h;m++)for(let c=a;c<=l;c++){let d=e.getCell(m,c);o.push(typeof d.value=="number"?d.value:null)}return o}function Xa(e,t){let o=[],r=(t.includes("!")?t.split("!")[1]:t).replace(/\$/g,"").match(/^([A-Z]+)(\d+):([A-Z]+)(\d+)$/);if(!r)return o;let a=ne(r[1]),i=parseInt(r[2],10),l=ne(r[3]),h=parseInt(r[4],10);for(let m=i;m<=h;m++)for(let c=a;c<=l;c++){let d=e.getCell(m,c);o.push(d.value!=null?String(d.value):"")}return o}function cs(e,t){let m=e.title??"",c=e.type,d=[],f=[];for(let M=0;M<e.series.length;M++){let N=e.series[M],V=ls(t,N.values).map(K=>K??0);N.categories&&!f.length&&(f=Xa(t,N.categories)),d.push({name:N.name??`Series ${M+1}`,values:V,color:N.color?Nt(N.color):He[M%He.length]})}if(!d.length||!d[0].values.length)return`<div style="display:inline-block;width:520px;height:340px;border:1px solid #ccc;background:#f9f9f9;text-align:center;line-height:340px;color:#666;font-size:14px" data-chart-type="${c}">[Chart: ${I(m||c)} \u2014 no data]</div>`;let p=Math.max(...d.map(M=>M.values.length));if(f.length||(f=Array.from({length:p},(M,N)=>String(N+1))),c==="pie"||c==="doughnut")return Ua(e,d,f,520,340);if(c==="radar"||c==="radarFilled")return Va(e,d,f,520,340);if(c==="scatter"||c==="scatterSmooth"||c==="bubble")return Wa(e,d,t,520,340);let g=d.flatMap(M=>M.values),u=e.yAxis?.min??Math.min(0,...g),$=e.yAxis?.max??Math.max(...g);$===u&&($=u+1);let x=$-u,b=5,C=[],y=[];for(let M=0;M<=b;M++){let N=u+x*M/b,H=285-240*(N-u)/x;C.push(`<line x1="65" y1="${H}" x2="500" y2="${H}" stroke="#e0e0e0" stroke-width="1"/>`);let V=Math.abs(N)>=1e3?(N/1e3).toFixed(1)+"k":Number.isInteger(N)?String(N):N.toFixed(1);y.push(`<text x="57" y="${H+4}" text-anchor="end" font-size="10" fill="#666">${V}</text>`)}let v=285-240*(0-u)/x,w="",k=c==="bar"||c==="barStacked"||c==="barStacked100",T=c==="column"||c==="columnStacked"||c==="columnStacked100",S=c==="area"||c==="areaStacked",D=c==="line"||c==="lineStacked"||c==="lineMarker",R=c.includes("Stacked"),A=c.includes("100");if(k){let M=240/p,N=R?M*.7:M*.7/d.length;for(let H=0;H<p;H++)if(R){let V=0,K=A&&d.reduce((z,mt)=>z+Math.abs(mt.values[H]??0),0)||1;for(let z=0;z<d.length;z++){let mt=d[z].values[H]??0;A&&(mt=mt/K*($-u));let it=Math.abs(mt)/x*435,gt=65+V/x*435,St=45+H*M+M*.15;w+=`<rect x="${gt}" y="${St}" width="${it}" height="${N}" fill="${d[z].color}" rx="2"><title>${d[z].name}: ${d[z].values[H]??0}</title></rect>`,V+=Math.abs(mt)}}else for(let V=0;V<d.length;V++){let K=d[V].values[H]??0,z=Math.abs(K-u)/x*435,mt=45+H*M+M*.15+V*N;w+=`<rect x="65" y="${mt}" width="${z}" height="${N}" fill="${d[V].color}" rx="2"><title>${d[V].name}: ${K}</title></rect>`}for(let H=0;H<p;H++){let V=45+H*M+M/2+4;y.push(`<text x="57" y="${V}" text-anchor="end" font-size="10" fill="#666">${I(f[H]??"")}</text>`)}}else if(T||!D&&!S){let M=435/p,N=R?M*.6:M*.6/d.length;for(let H=0;H<p;H++)if(R){let V=0,K=A&&d.reduce((z,mt)=>z+Math.abs(mt.values[H]??0),0)||1;for(let z=0;z<d.length;z++){let mt=d[z].values[H]??0;A&&(mt=mt/K*x);let it=Math.abs(mt)/x*240,gt=65+H*M+M*.2,St=v-V-it;w+=`<rect x="${gt}" y="${St}" width="${N}" height="${it}" fill="${d[z].color}" rx="2"><title>${d[z].name}: ${d[z].values[H]??0}</title></rect>`,V+=it}}else for(let V=0;V<d.length;V++){let K=d[V].values[H]??0,z=Math.abs(K-u)/x*240,mt=65+H*M+M*.2+V*N,it=285-z;w+=`<rect x="${mt}" y="${it}" width="${N}" height="${z}" fill="${d[V].color}" rx="2"><title>${d[V].name}: ${K}</title></rect>`}}if(S)for(let M=0;M<d.length;M++){let N=[];for(let z=0;z<p;z++){let mt=d[M].values[z]??0,it=65+z/(p-1||1)*435,gt=285-(mt-u)/x*240;N.push(`${it},${gt}`)}let H=65,V=65+(p-1)/(p-1||1)*435,K=`M${H},${v} L${N.join(" L")} L${V},${v} Z`;w+=`<path d="${K}" fill="${d[M].color}" fill-opacity="0.3"/>`,w+=`<polyline points="${N.join(" ")}" fill="none" stroke="${d[M].color}" stroke-width="2"/>`}if(D)for(let M=0;M<d.length;M++){let N=[];for(let H=0;H<p;H++){let V=d[M].values[H]??0,K=65+H/(p-1||1)*435,z=285-(V-u)/x*240;N.push(`${K},${z}`)}if(w+=`<polyline points="${N.join(" ")}" fill="none" stroke="${d[M].color}" stroke-width="2.5"/>`,c==="lineMarker"||d[M].values.length<=20)for(let H=0;H<p;H++){let V=d[M].values[H]??0,K=65+H/(p-1||1)*435,z=285-(V-u)/x*240;w+=`<circle cx="${K}" cy="${z}" r="3.5" fill="${d[M].color}" stroke="white" stroke-width="1.5"><title>${d[M].name}: ${V}</title></circle>`}}let W="";if(!k){let M=p>20?Math.ceil(p/15):1;for(let N=0;N<p;N+=M){let H=T||!D&&!S?65+N*(435/p)+435/p/2:65+N/(p-1||1)*435;W+=`<text x="${H}" y="303" text-anchor="middle" font-size="10" fill="#666" transform="rotate(-30 ${H} 303)">${I((f[N]??"").slice(0,12))}</text>`}}let Q="";if(e.legend!==!1&&d.length>1){let H=(520-d.reduce((V,K)=>V+K.name.length*7+25,0))/2;for(let V of d)Q+=`<rect x="${H}" y="320" width="12" height="12" rx="2" fill="${V.color}"/>`,Q+=`<text x="${H+16}" y="330" font-size="10" fill="#444">${I(V.name)}</text>`,H+=V.name.length*7+25}let q="";return e.xAxis?.title&&(q+=`<text x="${520/2}" y="338" text-anchor="middle" font-size="11" fill="#444">${I(e.xAxis.title)}</text>`),e.yAxis?.title&&(q+=`<text x="14" y="${45+240/2}" text-anchor="middle" font-size="11" fill="#444" transform="rotate(-90 14 ${45+240/2})">${I(e.yAxis.title)}</text>`),`<svg xmlns="http://www.w3.org/2000/svg" width="520" height="340" viewBox="0 0 520 340" style="background:white;border:1px solid #e0e0e0;border-radius:6px;box-shadow:0 1px 4px rgba(0,0,0,.08);margin:4px">
425
+ `?(s.push(r),r="",n.push(s),s=[],i++):(r+=h,i++)}return(r||s.length)&&(s.push(r),n.push(s)),n}function Ss(e,t={}){let o=t.header!==!1,n=t.includeEmpty??!1,s=t.range?e.readRange(t.range):Qa(e);if(s.length===0)return[];if(o){let r=s[0].map(a=>String(a??""));return s.slice(1).map(a=>{let i={};for(let l=0;l<r.length;l++){let h=l<a.length?a[l]:null;!n&&h==null||(i[r[l]]=vs(h,t))}return i})}else return s.map(r=>r.map(a=>vs(a,t)))}function Ya(e,t={}){let o={};for(let n of e.getSheets())o[n.name]=Ss(n,t);return o}function vs(e,t){if(e==null)return null;if(e instanceof ee)return e.error;if(e instanceof Date)switch(t.dateFormat){case"epoch":return e.getTime();case"serial":return(e.getTime()-Date.UTC(1899,11,30))/864e5;default:return e.toISOString()}return e}function Qa(e){let t=e.readAllCells();if(t.length===0)return[];let o=0,n=0;for(let{row:a,col:i}of t)a>o&&(o=a),i>n&&(n=i);let s=[],r=new Map;for(let{row:a,col:i,cell:l}of t)r.has(a)||r.set(a,new Map),r.get(a).set(i,l.value??null);for(let a=1;a<=o;a++){let i=[],l=r.get(a);for(let h=1;h<=n;h++)i.push(l?.get(h)??null);s.push(i)}return s}Wt();Wt();function lt(e){if(typeof e=="number")return e;if(typeof e=="boolean")return e?1:0;if(typeof e=="string"){let t=Number(e);return isNaN(t)?0:t}return 0}var de=class{constructor(){this.calculating=new Set}calculateWorkbook(t){let o=t.getSheets();for(let n of o)this.calculateSheet(n)}calculateSheet(t){this.ws=t;let o=t.readAllCells();for(let{row:n,col:s,cell:r}of o)if(r.formula){this.calculating.clear();let a=this.evaluate(r.formula,n,s);r.value=a}}getCellValue(t,o){let n=this.ws.getCell(t,o);if(n.formula){let s=`${t},${o}`;if(this.calculating.has(s))return 0;this.calculating.add(s);let r=this.evaluate(n.formula,t,o);n.value=r,this.calculating.delete(s)}return n.value??null}resolveRange(t){let n=(t.includes("!")?t.split("!")[1]:t).replace(/\$/g,"");if(n.includes(":")){let{startRow:a,startCol:i,endRow:l,endCol:h}=Zt(n),m=[];for(let c=a;c<=l;c++)for(let d=i;d<=h;d++)m.push(this.getCellValue(c,d));return m}let{row:s,col:r}=qt(n);return[this.getCellValue(s,r)]}evaluate(t,o,n){try{return this.parseExpression(t.trim(),0,o,n).value}catch{return"#VALUE!"}}parseExpression(t,o,n,s){return this.parseComparison(t,o,n,s)}parseComparison(t,o,n,s){let r=this.parseAddSub(t,o,n,s),{value:a,pos:i}=r;i=this.skipSpaces(t,i);let l=[">=","<=","<>",">","<","="];for(let h of l)if(t.slice(i,i+h.length)===h){let m=this.parseAddSub(t,i+h.length,n,s),c=a,d=m.value;switch(h){case">=":a=lt(c)>=lt(d);break;case"<=":a=lt(c)<=lt(d);break;case"<>":a=c!==d;break;case">":a=lt(c)>lt(d);break;case"<":a=lt(c)<lt(d);break;case"=":a=c===d||lt(c)===lt(d);break}i=m.pos;break}return{value:a,pos:i}}parseAddSub(t,o,n,s){let r=this.parseMulDiv(t,o,n,s),{value:a,pos:i}=r;for(;i<t.length;)if(i=this.skipSpaces(t,i),t[i]==="+"){let l=this.parseMulDiv(t,i+1,n,s);a=lt(a)+lt(l.value),i=l.pos}else if(t[i]==="-"){let l=this.parseMulDiv(t,i+1,n,s);a=lt(a)-lt(l.value),i=l.pos}else if(t[i]==="&"){let l=this.parseMulDiv(t,i+1,n,s);a=String(a??"")+String(l.value??""),i=l.pos}else break;return{value:a,pos:i}}parseMulDiv(t,o,n,s){let r=this.parsePower(t,o,n,s),{value:a,pos:i}=r;for(;i<t.length;)if(i=this.skipSpaces(t,i),t[i]==="*"){let l=this.parsePower(t,i+1,n,s);a=lt(a)*lt(l.value),i=l.pos}else if(t[i]==="/"){let l=this.parsePower(t,i+1,n,s),h=lt(l.value);a=h===0?"#DIV/0!":lt(a)/h,i=l.pos}else break;return{value:a,pos:i}}parsePower(t,o,n,s){let r=this.parseUnary(t,o,n,s),{value:a,pos:i}=r;if(i=this.skipSpaces(t,i),i<t.length&&t[i]==="^"){let l=this.parseUnary(t,i+1,n,s);a=Math.pow(lt(a),lt(l.value)),i=l.pos}return{value:a,pos:i}}parseUnary(t,o,n,s){if(o=this.skipSpaces(t,o),t[o]==="-"){let r=this.parseAtom(t,o+1,n,s);return{value:-lt(r.value),pos:r.pos}}return t[o]==="+"?this.parseAtom(t,o+1,n,s):this.parseAtom(t,o,n,s)}parseAtom(t,o,n,s){if(o=this.skipSpaces(t,o),t[o]==="("){let l=this.parseExpression(t,o+1,n,s),h=this.skipSpaces(t,l.pos);return t[h]===")"&&h++,{value:l.value,pos:h}}if(t[o]==='"'){let l=o+1,h="";for(;l<t.length;){if(t[l]==='"'){if(t[l+1]==='"'){h+='"',l+=2;continue}break}h+=t[l++]}return{value:h,pos:l+1}}if(/[0-9.]/.test(t[o])){let l=o;for(;l<t.length&&/[0-9.eE+-]/.test(t[l])&&!(l>o&&(t[l]==="+"||t[l]==="-")&&!/[eE]/.test(t[l-1]));)l++;return{value:parseFloat(t.slice(o,l)),pos:l}}if(t.slice(o,o+4).toUpperCase()==="TRUE")return{value:!0,pos:o+4};if(t.slice(o,o+5).toUpperCase()==="FALSE")return{value:!1,pos:o+5};let r=o;for(;r<t.length&&/[A-Za-z0-9_$!:]/.test(t[r]);)r++;let a=t.slice(o,r),i=this.skipSpaces(t,r);if(t[i]==="("){let l=a.toUpperCase(),h=this.parseArgList(t,i,n,s);return{value:this.callFunction(l,h.args,n,s),pos:h.pos}}if(a.includes(":")||/^[A-Z]+[0-9]+$/i.test(a.replace(/\$/g,""))||a.includes("!")){let l=this.resolveRange(a);return{value:(l.length===1,l[0]),pos:r}}return{value:a,pos:r}}parseArgList(t,o,n,s){o++;let r=[];if(this.skipSpaces(t,o)<t.length&&t[this.skipSpaces(t,o)]===")")return{args:[],pos:this.skipSpaces(t,o)+1};for(;o<t.length;){o=this.skipSpaces(t,o);let a=t.slice(o).match(/^([A-Z$]+[0-9$]+:[A-Z$]+[0-9$]+|[A-Za-z]+![A-Z$]+[0-9$]+:[A-Z$]+[0-9$]+)/i);if(a){let i=a[1];r.push(this.resolveRange(i)),o+=i.length}else{let i=this.parseExpression(t,o,n,s);r.push([i.value]),o=i.pos}if(o=this.skipSpaces(t,o),t[o]===","){o++;continue}if(t[o]===")"){o++;break}break}return{args:r,pos:o}}skipSpaces(t,o){for(;o<t.length&&t[o]===" ";)o++;return o}callFunction(t,o,n,s){let r=i=>i.flat(),a=i=>r(i).filter(l=>typeof l=="number"||typeof l=="string"&&l!==""&&!isNaN(Number(l))).map(l=>Number(l));switch(t){case"SUM":return a(o).reduce((i,l)=>i+l,0);case"AVERAGE":{let i=a(o);return i.length?i.reduce((l,h)=>l+h,0)/i.length:0}case"COUNT":return a(o).length;case"COUNTA":return r(o).filter(i=>i!=null&&i!=="").length;case"COUNTBLANK":return r(o).filter(i=>i==null||i==="").length;case"MAX":{let i=a(o);return i.length?Math.max(...i):0}case"MIN":{let i=a(o);return i.length?Math.min(...i):0}case"ABS":return Math.abs(lt(r(o)[0]));case"ROUND":{let i=lt(r(o)[0]),l=lt(r(o)[1]??0),h=Math.pow(10,l);return Math.round(i*h)/h}case"ROUNDUP":{let i=lt(r(o)[0]),l=lt(r(o)[1]??0),h=Math.pow(10,l);return Math.ceil(i*h)/h}case"ROUNDDOWN":{let i=lt(r(o)[0]),l=lt(r(o)[1]??0),h=Math.pow(10,l);return Math.floor(i*h)/h}case"INT":return Math.floor(lt(r(o)[0]));case"MOD":return lt(r(o)[0])%lt(r(o)[1]);case"POWER":return Math.pow(lt(r(o)[0]),lt(r(o)[1]));case"SQRT":return Math.sqrt(lt(r(o)[0]));case"PI":return Math.PI;case"RAND":return Math.random();case"RANDBETWEEN":{let i=lt(r(o)[0]),l=lt(r(o)[1]);return Math.floor(Math.random()*(l-i+1))+i}case"SUMPRODUCT":{if(o.length<2)return 0;let i=o[0].length,l=0;for(let h=0;h<i;h++){let m=1;for(let c of o)m*=lt(c[h]??0);l+=m}return l}case"SUMIF":{let i=o[0]??[],l=String(r(o.slice(1,2))[0]??""),h=o[2]??i,m=0;for(let c=0;c<i.length;c++)this.matchCriteria(i[c],l)&&(m+=lt(h[c]??0));return m}case"COUNTIF":{let i=o[0]??[],l=String(r(o.slice(1,2))[0]??"");return i.filter(h=>this.matchCriteria(h,l)).length}case"IF":{let i=r(o.slice(0,1))[0],l=r(o.slice(1,2))[0]??!0,h=o.length>2?r(o.slice(2,3))[0]??!1:!1;return i?l:h}case"AND":return r(o).every(i=>!!i);case"OR":return r(o).some(i=>!!i);case"NOT":return!r(o)[0];case"IFERROR":{let i=r(o.slice(0,1))[0];return typeof i=="string"&&i.startsWith("#")?r(o.slice(1,2))[0]??"":i}case"IFNA":{let i=r(o.slice(0,1))[0];return i==="#N/A"?r(o.slice(1,2))[0]??"":i}case"CONCATENATE":case"CONCAT":return r(o).map(i=>String(i??"")).join("");case"TEXTJOIN":{let i=String(r(o.slice(0,1))[0]??""),l=!!r(o.slice(1,2))[0],h=r(o.slice(2));return(l?h.filter(c=>c!=null&&c!==""):h).map(c=>String(c??"")).join(i)}case"LEN":return String(r(o)[0]??"").length;case"LEFT":return String(r(o)[0]??"").slice(0,lt(r(o)[1])||1);case"RIGHT":{let i=String(r(o)[0]??""),l=lt(r(o)[1])||1;return i.slice(-l)}case"MID":{let i=String(r(o)[0]??""),l=lt(r(o)[1])-1,h=lt(r(o)[2]);return i.slice(l,l+h)}case"UPPER":return String(r(o)[0]??"").toUpperCase();case"LOWER":return String(r(o)[0]??"").toLowerCase();case"TRIM":return String(r(o)[0]??"").trim().replace(/\s+/g," ");case"SUBSTITUTE":{let i=String(r(o)[0]??""),l=String(r(o)[1]??""),h=String(r(o)[2]??"");return i.split(l).join(h)}case"FIND":case"SEARCH":{let i=String(r(o)[0]??""),l=String(r(o)[1]??""),h=lt(r(o)[2])||1,m=t==="SEARCH"?d=>d.toLowerCase():d=>d,c=m(l).indexOf(m(i),h-1);return c>=0?c+1:"#VALUE!"}case"REPLACE":{let i=String(r(o)[0]??""),l=lt(r(o)[1])-1,h=lt(r(o)[2]),m=String(r(o)[3]??"");return i.slice(0,l)+m+i.slice(l+h)}case"REPT":return String(r(o)[0]??"").repeat(lt(r(o)[1]));case"TEXT":return String(r(o)[0]??"");case"VALUE":return lt(r(o)[0]);case"EXACT":return String(r(o)[0]??"")===String(r(o)[1]??"");case"VLOOKUP":{let i=r(o.slice(0,1))[0],l=o[1]??[],h=lt(r(o.slice(2,3))[0])-1;return"#N/A"}case"INDEX":{let i=o[0]??[],l=lt(r(o.slice(1,2))[0])-1;return i[l]??"#REF!"}case"MATCH":{let i=r(o.slice(0,1))[0],h=(o[1]??[]).findIndex(m=>m===i||String(m)===String(i));return h>=0?h+1:"#N/A"}case"ISBLANK":return r(o)[0]==null||r(o)[0]==="";case"ISNUMBER":return typeof r(o)[0]=="number";case"ISTEXT":return typeof r(o)[0]=="string";case"ISLOGICAL":return typeof r(o)[0]=="boolean";case"ISERROR":{let i=r(o)[0];return typeof i=="string"&&i.startsWith("#")}case"ISNA":return r(o)[0]==="#N/A";case"TYPE":{let i=r(o)[0];return typeof i=="number"?1:typeof i=="string"?2:typeof i=="boolean"?4:1}case"ROW":return n;case"COLUMN":return s;case"NA":return"#N/A";case"TODAY":return new Date().toISOString().slice(0,10);case"NOW":return new Date().toISOString();case"YEAR":return new Date(String(r(o)[0])).getFullYear();case"MONTH":return new Date(String(r(o)[0])).getMonth()+1;case"DAY":return new Date(String(r(o)[0])).getDate();case"GETPIVOTDATA":return String(r(o.slice(0,1))[0]??"")||"#REF!";default:return"#NAME?"}}matchCriteria(t,o){let n=[">=","<=","<>",">","<","="];for(let s of n)if(o.startsWith(s)){let r=o.slice(s.length),a=lt(t),i=Number(r);if(!isNaN(i))switch(s){case">=":return a>=i;case"<=":return a<=i;case"<>":return a!==i;case">":return a>i;case"<":return a<i;case"=":return a===i}switch(s){case"<>":return String(t)!==r;case"=":return String(t)===r}}return typeof t=="number"?t===Number(o):String(t)===o}};var Ja=["#000000","#FFFFFF","#44546A","#E7E6E6","#4472C4","#ED7D31","#A5A5A5","#FFC000","#5B9BD5","#70AD47"];function Nt(e){if(!e)return"";if(e.startsWith("#"))return e;if(e.startsWith("theme:")){let t=parseInt(e.slice(6),10);return Ja[t]??"#000"}return e.length===8&&!e.startsWith("#")?"#"+e.slice(2):"#"+e}function Is(e){let t=e.replace("#","");return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}function $n(e,t,o){let[n,s,r]=Is(Nt(e)||"#FFFFFF"),[a,i,l]=Is(Nt(t)||"#000000"),h=Math.round(n+(a-n)*o),m=Math.round(s+(i-s)*o),c=Math.round(r+(l-r)*o);return`#${h.toString(16).padStart(2,"0")}${m.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`}function Ts(e){let t=[];e.bold&&t.push("font-weight:bold"),e.italic&&t.push("font-style:italic");let o=[];return e.underline&&e.underline!=="none"&&o.push("underline"),e.strike&&o.push("line-through"),o.length&&t.push(`text-decoration:${o.join(" ")}`),e.size&&t.push(`font-size:${e.size}pt`),e.color&&t.push(`color:${Nt(e.color)}`),e.name&&t.push(`font-family:'${e.name}',sans-serif`),e.vertAlign==="superscript"?t.push("vertical-align:super;font-size:smaller"):e.vertAlign==="subscript"&&t.push("vertical-align:sub;font-size:smaller"),t.join(";")}function ti(e){if(e.type==="pattern"){let t=e;if(t.pattern==="solid"&&t.fgColor)return`background-color:${Nt(t.fgColor)}`}if(e.type==="gradient"){let t=e;if(t.stops&&t.stops.length>=2){let o=t.stops.map(s=>`${Nt(s.color)} ${Math.round(s.position*100)}%`).join(",");return`background:linear-gradient(${t.degree??0}deg,${o})`}}return""}function ko(e){if(!e||!e.style)return"";let t={thin:"1px",medium:"2px",thick:"3px",dashed:"1px",dotted:"1px",double:"3px",hair:"1px",mediumDashed:"2px",dashDot:"1px",mediumDashDot:"2px",dashDotDot:"1px",mediumDashDotDot:"2px",slantDashDot:"2px"},o={thin:"solid",medium:"solid",thick:"solid",dashed:"dashed",dotted:"dotted",double:"double",hair:"solid",mediumDashed:"dashed",dashDot:"dashed",mediumDashDot:"dashed",dashDotDot:"dotted",mediumDashDotDot:"dotted",slantDashDot:"dashed"},n=t[e.style]??"1px",s=o[e.style]??"solid",r=e.color?Nt(e.color):"#000";return`${n} ${s} ${r}`}function ei(e){let t=[];if(e.horizontal){let o={left:"left",center:"center",right:"right",fill:"justify",justify:"justify",distributed:"justify"};t.push(`text-align:${o[e.horizontal]??e.horizontal}`)}if(e.vertical){let o={top:"top",center:"middle",bottom:"bottom",distributed:"middle"};t.push(`vertical-align:${o[e.vertical]??"bottom"}`)}return e.wrapText&&t.push("white-space:normal;word-wrap:break-word"),e.textRotation&&t.push(`transform:rotate(-${e.textRotation}deg)`),e.indent&&t.push(`padding-left:${e.indent*8}px`),t.join(";")}function oi(e){let t=[];return e.font&&t.push(Ts(e.font)),e.fill&&t.push(ti(e.fill)),e.alignment&&t.push(ei(e.alignment)),e.border&&(e.border.top&&t.push(`border-top:${ko(e.border.top)}`),e.border.bottom&&t.push(`border-bottom:${ko(e.border.bottom)}`),e.border.left&&t.push(`border-left:${ko(e.border.left)}`),e.border.right&&t.push(`border-right:${ko(e.border.right)}`)),t.filter(Boolean).join(";")}function ni(e,t){if(e==null)return"";if(!t||t==="General")return String(e);let o=typeof e=="number"?e:parseFloat(String(e));if(isNaN(o))return String(e);if(t.includes("%")){let r=(t.match(/0\.(0+)%/)??[])[1]?.length??0;return(o*100).toFixed(r)+"%"}let n=t.match(/[$€£¥]|"CHF"/);if(n){let r=n[0].replace(/"/g,""),a=(t.match(/\.(0+)/)??[])[1]?.length??2,i=Math.abs(o).toFixed(a).replace(/\B(?=(\d{3})+(?!\d))/g,",");return t.indexOf(n[0])<t.indexOf("0")?(o<0?"-":"")+r+i:(o<0?"-":"")+i+" "+r}if(t.includes("#,##0")||t.includes("#,###")){let r=(t.match(/\.(0+)/)??[])[1]?.length??0;return o.toFixed(r).replace(/\B(?=(\d{3})+(?!\d))/g,",")}let s=t.match(/^0\.(0+)$/);if(s)return o.toFixed(s[1].length);if(/[ymdh]/i.test(t))return si(o,t);if(t.includes("?/?")||t.includes("??/??"))return ri(o);if(/0\.0+E\+0+/i.test(t)){let r=(t.match(/0\.(0+)/)??[])[1]?.length??2;return o.toExponential(r).toUpperCase()}return String(e)}function si(e,t){let o=new Date(1899,11,30),n=new Date(o.getTime()+e*864e5),s=n.getFullYear(),r=n.getMonth()+1,a=n.getDate(),i=n.getHours(),l=n.getMinutes(),h=n.getSeconds();return t.replace(/yyyy/gi,String(s)).replace(/yy/gi,String(s).slice(-2)).replace(/mmmm/gi,n.toLocaleDateString("en",{month:"long"})).replace(/mmm/gi,n.toLocaleDateString("en",{month:"short"})).replace(/mm/gi,String(r).padStart(2,"0")).replace(/m/gi,String(r)).replace(/dd/gi,String(a).padStart(2,"0")).replace(/d/gi,String(a)).replace(/hh/gi,String(i).padStart(2,"0")).replace(/h/gi,String(i)).replace(/ss/gi,String(h).padStart(2,"0")).replace(/nn|MM/g,String(l).padStart(2,"0"))}function ri(e){let t=Math.floor(Math.abs(e)),o=Math.abs(e)-t;if(o<1e-4)return String(e<0?-t:t);let n=0,s=1,r=1;for(let i=1;i<=100;i++){let l=Math.round(o*i),h=Math.abs(o-l/i);if(h<r&&(n=l,s=i,r=h),h<1e-4)break}let a=e<0?"-":"";return t>0?`${a}${t} ${n}/${s}`:`${a}${n}/${s}`}function ai(e,t,o){if(e.colorScale){let n=[...o].sort((h,m)=>h-m),s=n[0],a=n[n.length-1]-s||1,i=(t-s)/a,l=e.colorScale;if(l.color.length===2)return`background-color:${$n(l.color[0],l.color[1],i)}`;if(l.color.length>=3)return i<=.5?`background-color:${$n(l.color[0],l.color[1],i*2)}`:`background-color:${$n(l.color[1],l.color[2],(i-.5)*2)}`}if(e.dataBar){let n=[...o].sort((l,h)=>l-h),s=n[0],r=n[n.length-1],a=Math.round((t-s)/(r-s||1)*100);return`background:linear-gradient(90deg,${Nt(e.dataBar.color)||"#638EC6"} ${a}%,transparent ${a}%)`}if(e.iconSet){let n=[...o].sort((m,c)=>m-c),s=n[0],r=n[n.length-1],a=(t-s)/(r-s||1),l={"3Arrows":["\u2193","\u2192","\u2191"],"3ArrowsGray":["\u21E9","\u21E8","\u21E7"],"3TrafficLights1":["\u{1F534}","\u{1F7E1}","\u{1F7E2}"],"3TrafficLights2":["\u{1F534}","\u{1F7E1}","\u{1F7E2}"],"3Signs":["\u26D4","\u26A0\uFE0F","\u2705"],"3Symbols":["\u2716","!","\u2714"],"3Symbols2":["\u2716","!","\u2714"],"3Flags":["\u{1F3F4}","\u{1F3F3}","\u{1F3C1}"],"3Stars":["\u2606","\u2605","\u2605"],"4Arrows":["\u2193","\u2198","\u2197","\u2191"],"4ArrowsGray":["\u21E9","\u21D8","\u21D7","\u21E7"],"4Rating":["\u25D4","\u25D1","\u25D5","\u25CF"],"4RedToBlack":["\u2B24","\u2B24","\u2B24","\u2B24"],"4TrafficLights":["\u2B24","\u2B24","\u2B24","\u2B24"],"5Arrows":["\u2193","\u2198","\u2192","\u2197","\u2191"],"5ArrowsGray":["\u21E9","\u21D8","\u21E8","\u21D7","\u21E7"],"5Quarters":["\u25CB","\u25D4","\u25D1","\u25D5","\u25CF"],"5Rating":["\u25D4","\u25D4","\u25D1","\u25D5","\u25CF"]}[e.iconSet.iconSet??"3TrafficLights1"]??["\u{1F534}","\u{1F7E1}","\u{1F7E2}"],h=Math.min(Math.floor(a*l.length),l.length-1);return`data-icon="${l[h]}"`}return""}function ii(e,t){if(!t.length)return"";let o=100,n=20,s=Math.min(...t),a=Math.max(...t)-s||1,i=Nt(e.color)||"#4472C4",l=t.indexOf(Math.max(...t)),h=t.indexOf(Math.min(...t));if(e.type==="bar"||e.type==="stacked"){let g=o/t.length,u=t.map(($,x)=>{let b=e.type==="stacked"?($>=0,n/2):Math.max(1,($-s)/a*n),C=e.type==="stacked"?$>=0?n/2-b:n/2:n-b,y=i;return $<0&&e.negativeColor?y=Nt(e.negativeColor):e.showHigh&&x===l&&e.highColor?y=Nt(e.highColor):e.showLow&&x===h&&e.lowColor?y=Nt(e.lowColor):e.showFirst&&x===0&&e.firstColor?y=Nt(e.firstColor):e.showLast&&x===t.length-1&&e.lastColor&&(y=Nt(e.lastColor)),`<rect x="${x*g+g*.1}" y="${C}" width="${g*.8}" height="${b}" fill="${y}" rx="1"/>`}).join("");return`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${n}" viewBox="0 0 ${o} ${n}" style="display:inline-block;vertical-align:middle">${u}</svg>`}let m=e.lineWidth??1.5,c=t.map((g,u)=>`${u/(t.length-1||1)*o},${n-(g-s)/a*n}`).join(" "),d="";e.showMarkers&&(d=t.map((g,u)=>{let $=u/(t.length-1||1)*o,x=n-(g-s)/a*n;return`<circle cx="${$}" cy="${x}" r="1.5" fill="${Nt(e.markersColor)||i}"/>`}).join(""));let f=[],p=(g,u)=>{let $=g/(t.length-1||1)*o,x=n-(t[g]-s)/a*n;f.push(`<circle cx="${$}" cy="${x}" r="2.5" fill="${u}" stroke="white" stroke-width="0.5"/>`)};return e.showHigh&&e.highColor&&p(l,Nt(e.highColor)),e.showLow&&e.lowColor&&p(h,Nt(e.lowColor)),e.showFirst&&e.firstColor&&p(0,Nt(e.firstColor)),e.showLast&&e.lastColor&&p(t.length-1,Nt(e.lastColor)),e.showNegative&&e.negativeColor&&t.forEach((g,u)=>{if(g<0){let $=u/(t.length-1||1)*o,x=n-(g-s)/a*n;f.push(`<circle cx="${$}" cy="${x}" r="2" fill="${Nt(e.negativeColor)}"/>`)}}),`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${n}" viewBox="0 0 ${o} ${n}" style="display:inline-block;vertical-align:middle"><polyline points="${c}" fill="none" stroke="${i}" stroke-width="${m}"/>${d}${f.join("")}</svg>`}var Ge=["#4472C4","#ED7D31","#A5A5A5","#FFC000","#5B9BD5","#70AD47","#264478","#9B57A0","#636363","#EB7E3A"];function ks(e,t){let o=[],r=(t.includes("!")?t.split("!")[1]:t).replace(/\$/g,"").match(/^([A-Z]+)(\d+):([A-Z]+)(\d+)$/);if(!r)return o;let a=se(r[1]),i=parseInt(r[2],10),l=se(r[3]),h=parseInt(r[4],10);for(let m=i;m<=h;m++)for(let c=a;c<=l;c++){let d=e.getCell(m,c);o.push(typeof d.value=="number"?d.value:null)}return o}function li(e,t){let o=[],r=(t.includes("!")?t.split("!")[1]:t).replace(/\$/g,"").match(/^([A-Z]+)(\d+):([A-Z]+)(\d+)$/);if(!r)return o;let a=se(r[1]),i=parseInt(r[2],10),l=se(r[3]),h=parseInt(r[4],10);for(let m=i;m<=h;m++)for(let c=a;c<=l;c++){let d=e.getCell(m,c);o.push(d.value!=null?String(d.value):"")}return o}function As(e,t){let m=e.title??"",c=e.type,d=[],f=[];for(let M=0;M<e.series.length;M++){let N=e.series[M],V=ks(t,N.values).map(K=>K??0);N.categories&&!f.length&&(f=li(t,N.categories)),d.push({name:N.name??`Series ${M+1}`,values:V,color:N.color?Nt(N.color):Ge[M%Ge.length]})}if(!d.length||!d[0].values.length)return`<div style="display:inline-block;width:520px;height:340px;border:1px solid #ccc;background:#f9f9f9;text-align:center;line-height:340px;color:#666;font-size:14px" data-chart-type="${c}">[Chart: ${I(m||c)} \u2014 no data]</div>`;let p=Math.max(...d.map(M=>M.values.length));if(f.length||(f=Array.from({length:p},(M,N)=>String(N+1))),c==="pie"||c==="doughnut")return ci(e,d,f,520,340);if(c==="radar"||c==="radarFilled")return hi(e,d,f,520,340);if(c==="scatter"||c==="scatterSmooth"||c==="bubble")return mi(e,d,t,520,340);let g=d.flatMap(M=>M.values),u=e.yAxis?.min??Math.min(0,...g),$=e.yAxis?.max??Math.max(...g);$===u&&($=u+1);let x=$-u,b=5,C=[],y=[];for(let M=0;M<=b;M++){let N=u+x*M/b,H=285-240*(N-u)/x;C.push(`<line x1="65" y1="${H}" x2="500" y2="${H}" stroke="#e0e0e0" stroke-width="1"/>`);let V=Math.abs(N)>=1e3?(N/1e3).toFixed(1)+"k":Number.isInteger(N)?String(N):N.toFixed(1);y.push(`<text x="57" y="${H+4}" text-anchor="end" font-size="10" fill="#666">${V}</text>`)}let v=285-240*(0-u)/x,w="",k=c==="bar"||c==="barStacked"||c==="barStacked100",T=c==="column"||c==="columnStacked"||c==="columnStacked100",S=c==="area"||c==="areaStacked",D=c==="line"||c==="lineStacked"||c==="lineMarker",R=c.includes("Stacked"),A=c.includes("100");if(k){let M=240/p,N=R?M*.7:M*.7/d.length;for(let H=0;H<p;H++)if(R){let V=0,K=A&&d.reduce((z,mt)=>z+Math.abs(mt.values[H]??0),0)||1;for(let z=0;z<d.length;z++){let mt=d[z].values[H]??0;A&&(mt=mt/K*($-u));let it=Math.abs(mt)/x*435,gt=65+V/x*435,St=45+H*M+M*.15;w+=`<rect x="${gt}" y="${St}" width="${it}" height="${N}" fill="${d[z].color}" rx="2"><title>${d[z].name}: ${d[z].values[H]??0}</title></rect>`,V+=Math.abs(mt)}}else for(let V=0;V<d.length;V++){let K=d[V].values[H]??0,z=Math.abs(K-u)/x*435,mt=45+H*M+M*.15+V*N;w+=`<rect x="65" y="${mt}" width="${z}" height="${N}" fill="${d[V].color}" rx="2"><title>${d[V].name}: ${K}</title></rect>`}for(let H=0;H<p;H++){let V=45+H*M+M/2+4;y.push(`<text x="57" y="${V}" text-anchor="end" font-size="10" fill="#666">${I(f[H]??"")}</text>`)}}else if(T||!D&&!S){let M=435/p,N=R?M*.6:M*.6/d.length;for(let H=0;H<p;H++)if(R){let V=0,K=A&&d.reduce((z,mt)=>z+Math.abs(mt.values[H]??0),0)||1;for(let z=0;z<d.length;z++){let mt=d[z].values[H]??0;A&&(mt=mt/K*x);let it=Math.abs(mt)/x*240,gt=65+H*M+M*.2,St=v-V-it;w+=`<rect x="${gt}" y="${St}" width="${N}" height="${it}" fill="${d[z].color}" rx="2"><title>${d[z].name}: ${d[z].values[H]??0}</title></rect>`,V+=it}}else for(let V=0;V<d.length;V++){let K=d[V].values[H]??0,z=Math.abs(K-u)/x*240,mt=65+H*M+M*.2+V*N,it=285-z;w+=`<rect x="${mt}" y="${it}" width="${N}" height="${z}" fill="${d[V].color}" rx="2"><title>${d[V].name}: ${K}</title></rect>`}}if(S)for(let M=0;M<d.length;M++){let N=[];for(let z=0;z<p;z++){let mt=d[M].values[z]??0,it=65+z/(p-1||1)*435,gt=285-(mt-u)/x*240;N.push(`${it},${gt}`)}let H=65,V=65+(p-1)/(p-1||1)*435,K=`M${H},${v} L${N.join(" L")} L${V},${v} Z`;w+=`<path d="${K}" fill="${d[M].color}" fill-opacity="0.3"/>`,w+=`<polyline points="${N.join(" ")}" fill="none" stroke="${d[M].color}" stroke-width="2"/>`}if(D)for(let M=0;M<d.length;M++){let N=[];for(let H=0;H<p;H++){let V=d[M].values[H]??0,K=65+H/(p-1||1)*435,z=285-(V-u)/x*240;N.push(`${K},${z}`)}if(w+=`<polyline points="${N.join(" ")}" fill="none" stroke="${d[M].color}" stroke-width="2.5"/>`,c==="lineMarker"||d[M].values.length<=20)for(let H=0;H<p;H++){let V=d[M].values[H]??0,K=65+H/(p-1||1)*435,z=285-(V-u)/x*240;w+=`<circle cx="${K}" cy="${z}" r="3.5" fill="${d[M].color}" stroke="white" stroke-width="1.5"><title>${d[M].name}: ${V}</title></circle>`}}let W="";if(!k){let M=p>20?Math.ceil(p/15):1;for(let N=0;N<p;N+=M){let H=T||!D&&!S?65+N*(435/p)+435/p/2:65+N/(p-1||1)*435;W+=`<text x="${H}" y="303" text-anchor="middle" font-size="10" fill="#666" transform="rotate(-30 ${H} 303)">${I((f[N]??"").slice(0,12))}</text>`}}let Q="";if(e.legend!==!1&&d.length>1){let H=(520-d.reduce((V,K)=>V+K.name.length*7+25,0))/2;for(let V of d)Q+=`<rect x="${H}" y="320" width="12" height="12" rx="2" fill="${V.color}"/>`,Q+=`<text x="${H+16}" y="330" font-size="10" fill="#444">${I(V.name)}</text>`,H+=V.name.length*7+25}let q="";return e.xAxis?.title&&(q+=`<text x="${520/2}" y="338" text-anchor="middle" font-size="11" fill="#444">${I(e.xAxis.title)}</text>`),e.yAxis?.title&&(q+=`<text x="14" y="${45+240/2}" text-anchor="middle" font-size="11" fill="#444" transform="rotate(-90 14 ${45+240/2})">${I(e.yAxis.title)}</text>`),`<svg xmlns="http://www.w3.org/2000/svg" width="520" height="340" viewBox="0 0 520 340" style="background:white;border:1px solid #e0e0e0;border-radius:6px;box-shadow:0 1px 4px rgba(0,0,0,.08);margin:4px">
426
426
  ${m?`<text x="${520/2}" y="22" text-anchor="middle" font-size="14" font-weight="600" fill="#333">${I(m)}</text>`:""}
427
427
  ${C.join(`
428
428
  `)}
@@ -433,14 +433,14 @@ ${y.join(`
433
433
  `)}
434
434
  ${Q}
435
435
  ${q}
436
- </svg>`}function Ua(e,t,o,n,s){let r=n/2,a=s/2+10,i=Math.min(n,s)/2-40,l=e.type==="doughnut"?i*.5:0,h=t[0].values,m=h.reduce(($,x)=>$+Math.abs(x),0)||1,c=e.title??"",d=-Math.PI/2,f=[],p=[];for(let $=0;$<h.length;$++){let x=Math.abs(h[$])/m,b=x*Math.PI*2,C=d+b/2,y=b>Math.PI?1:0,v=r+i*Math.cos(d),w=a+i*Math.sin(d),k=r+i*Math.cos(d+b),T=a+i*Math.sin(d+b),S;if(l>0){let R=r+l*Math.cos(d),A=a+l*Math.sin(d),W=r+l*Math.cos(d+b),Q=a+l*Math.sin(d+b);S=`M${v},${w} A${i},${i} 0 ${y} 1 ${k},${T} L${W},${Q} A${l},${l} 0 ${y} 0 ${R},${A} Z`}else S=h.length===1?`M${r-i},${a} A${i},${i} 0 1 1 ${r+i},${a} A${i},${i} 0 1 1 ${r-i},${a} Z`:`M${r},${a} L${v},${w} A${i},${i} 0 ${y} 1 ${k},${T} Z`;let D=He[$%He.length];if(f.push(`<path d="${S}" fill="${D}" stroke="white" stroke-width="1.5"><title>${I(o[$]??"")}: ${h[$]} (${(x*100).toFixed(1)}%)</title></path>`),x>.04){let R=i+16,A=r+R*Math.cos(C),W=a+R*Math.sin(C),Q=C>Math.PI/2&&C<Math.PI*1.5?"end":"start";p.push(`<text x="${A}" y="${W+4}" text-anchor="${Q}" font-size="10" fill="#444">${I((o[$]??"").slice(0,10))} ${(x*100).toFixed(0)}%</text>`)}d+=b}let g="";if(e.legend!==!1){let $=n-10;for(let x=0;x<Math.min(h.length,10);x++){let b=40+x*18;g+=`<rect x="${$-80}" y="${b-8}" width="10" height="10" rx="2" fill="${He[x%He.length]}"/>`,g+=`<text x="${$-65}" y="${b+2}" font-size="10" fill="#444">${I((o[x]??"").slice(0,10))}</text>`}}let u=c?`<text x="${n/2}" y="22" text-anchor="middle" font-size="14" font-weight="600" fill="#333">${I(c)}</text>`:"";return`<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${s}" viewBox="0 0 ${n} ${s}" style="background:white;border:1px solid #e0e0e0;border-radius:6px;box-shadow:0 1px 4px rgba(0,0,0,.08);margin:4px">
436
+ </svg>`}function ci(e,t,o,n,s){let r=n/2,a=s/2+10,i=Math.min(n,s)/2-40,l=e.type==="doughnut"?i*.5:0,h=t[0].values,m=h.reduce(($,x)=>$+Math.abs(x),0)||1,c=e.title??"",d=-Math.PI/2,f=[],p=[];for(let $=0;$<h.length;$++){let x=Math.abs(h[$])/m,b=x*Math.PI*2,C=d+b/2,y=b>Math.PI?1:0,v=r+i*Math.cos(d),w=a+i*Math.sin(d),k=r+i*Math.cos(d+b),T=a+i*Math.sin(d+b),S;if(l>0){let R=r+l*Math.cos(d),A=a+l*Math.sin(d),W=r+l*Math.cos(d+b),Q=a+l*Math.sin(d+b);S=`M${v},${w} A${i},${i} 0 ${y} 1 ${k},${T} L${W},${Q} A${l},${l} 0 ${y} 0 ${R},${A} Z`}else S=h.length===1?`M${r-i},${a} A${i},${i} 0 1 1 ${r+i},${a} A${i},${i} 0 1 1 ${r-i},${a} Z`:`M${r},${a} L${v},${w} A${i},${i} 0 ${y} 1 ${k},${T} Z`;let D=Ge[$%Ge.length];if(f.push(`<path d="${S}" fill="${D}" stroke="white" stroke-width="1.5"><title>${I(o[$]??"")}: ${h[$]} (${(x*100).toFixed(1)}%)</title></path>`),x>.04){let R=i+16,A=r+R*Math.cos(C),W=a+R*Math.sin(C),Q=C>Math.PI/2&&C<Math.PI*1.5?"end":"start";p.push(`<text x="${A}" y="${W+4}" text-anchor="${Q}" font-size="10" fill="#444">${I((o[$]??"").slice(0,10))} ${(x*100).toFixed(0)}%</text>`)}d+=b}let g="";if(e.legend!==!1){let $=n-10;for(let x=0;x<Math.min(h.length,10);x++){let b=40+x*18;g+=`<rect x="${$-80}" y="${b-8}" width="10" height="10" rx="2" fill="${Ge[x%Ge.length]}"/>`,g+=`<text x="${$-65}" y="${b+2}" font-size="10" fill="#444">${I((o[x]??"").slice(0,10))}</text>`}}let u=c?`<text x="${n/2}" y="22" text-anchor="middle" font-size="14" font-weight="600" fill="#333">${I(c)}</text>`:"";return`<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${s}" viewBox="0 0 ${n} ${s}" style="background:white;border:1px solid #e0e0e0;border-radius:6px;box-shadow:0 1px 4px rgba(0,0,0,.08);margin:4px">
437
437
  ${u}
438
438
  ${f.join(`
439
439
  `)}
440
440
  ${p.join(`
441
441
  `)}
442
442
  ${g}
443
- </svg>`}function Va(e,t,o,n,s){let r=n/2,a=s/2+10,i=Math.min(n,s)/2-50,l=o.length||1,h=e.type==="radarFilled",m=t.flatMap(u=>u.values),c=Math.max(...m,1),d=[];for(let u=1;u<=4;u++){let $=i*u/4,x=Array.from({length:l},(b,C)=>{let y=-Math.PI/2+2*Math.PI*C/l;return`${r+$*Math.cos(y)},${a+$*Math.sin(y)}`});d.push(`<polygon points="${x.join(" ")}" fill="none" stroke="#e0e0e0" stroke-width="0.5"/>`)}let f=[];for(let u=0;u<l;u++){let $=-Math.PI/2+2*Math.PI*u/l,x=r+i*Math.cos($),b=a+i*Math.sin($);f.push(`<line x1="${r}" y1="${a}" x2="${x}" y2="${b}" stroke="#ccc" stroke-width="0.5"/>`);let C=r+(i+14)*Math.cos($),y=a+(i+14)*Math.sin($);f.push(`<text x="${C}" y="${y+4}" text-anchor="middle" font-size="9" fill="#666">${I((o[u]??"").slice(0,8))}</text>`)}let p=[];for(let u of t){let $=u.values.map((x,b)=>{let C=-Math.PI/2+2*Math.PI*b/l,y=x/c*i;return`${r+y*Math.cos(C)},${a+y*Math.sin(C)}`});h?p.push(`<polygon points="${$.join(" ")}" fill="${u.color}" fill-opacity="0.2" stroke="${u.color}" stroke-width="2"/>`):p.push(`<polygon points="${$.join(" ")}" fill="none" stroke="${u.color}" stroke-width="2"/>`),u.values.forEach((x,b)=>{let C=-Math.PI/2+2*Math.PI*b/l,y=x/c*i;p.push(`<circle cx="${r+y*Math.cos(C)}" cy="${a+y*Math.sin(C)}" r="3" fill="${u.color}" stroke="white" stroke-width="1"><title>${u.name}: ${x}</title></circle>`)})}let g=e.title?`<text x="${n/2}" y="20" text-anchor="middle" font-size="14" font-weight="600" fill="#333">${I(e.title)}</text>`:"";return`<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${s}" viewBox="0 0 ${n} ${s}" style="background:white;border:1px solid #e0e0e0;border-radius:6px;box-shadow:0 1px 4px rgba(0,0,0,.08);margin:4px">
443
+ </svg>`}function hi(e,t,o,n,s){let r=n/2,a=s/2+10,i=Math.min(n,s)/2-50,l=o.length||1,h=e.type==="radarFilled",m=t.flatMap(u=>u.values),c=Math.max(...m,1),d=[];for(let u=1;u<=4;u++){let $=i*u/4,x=Array.from({length:l},(b,C)=>{let y=-Math.PI/2+2*Math.PI*C/l;return`${r+$*Math.cos(y)},${a+$*Math.sin(y)}`});d.push(`<polygon points="${x.join(" ")}" fill="none" stroke="#e0e0e0" stroke-width="0.5"/>`)}let f=[];for(let u=0;u<l;u++){let $=-Math.PI/2+2*Math.PI*u/l,x=r+i*Math.cos($),b=a+i*Math.sin($);f.push(`<line x1="${r}" y1="${a}" x2="${x}" y2="${b}" stroke="#ccc" stroke-width="0.5"/>`);let C=r+(i+14)*Math.cos($),y=a+(i+14)*Math.sin($);f.push(`<text x="${C}" y="${y+4}" text-anchor="middle" font-size="9" fill="#666">${I((o[u]??"").slice(0,8))}</text>`)}let p=[];for(let u of t){let $=u.values.map((x,b)=>{let C=-Math.PI/2+2*Math.PI*b/l,y=x/c*i;return`${r+y*Math.cos(C)},${a+y*Math.sin(C)}`});h?p.push(`<polygon points="${$.join(" ")}" fill="${u.color}" fill-opacity="0.2" stroke="${u.color}" stroke-width="2"/>`):p.push(`<polygon points="${$.join(" ")}" fill="none" stroke="${u.color}" stroke-width="2"/>`),u.values.forEach((x,b)=>{let C=-Math.PI/2+2*Math.PI*b/l,y=x/c*i;p.push(`<circle cx="${r+y*Math.cos(C)}" cy="${a+y*Math.sin(C)}" r="3" fill="${u.color}" stroke="white" stroke-width="1"><title>${u.name}: ${x}</title></circle>`)})}let g=e.title?`<text x="${n/2}" y="20" text-anchor="middle" font-size="14" font-weight="600" fill="#333">${I(e.title)}</text>`:"";return`<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${s}" viewBox="0 0 ${n} ${s}" style="background:white;border:1px solid #e0e0e0;border-radius:6px;box-shadow:0 1px 4px rgba(0,0,0,.08);margin:4px">
444
444
  ${g}
445
445
  ${d.join(`
446
446
  `)}
@@ -448,7 +448,7 @@ ${f.join(`
448
448
  `)}
449
449
  ${p.join(`
450
450
  `)}
451
- </svg>`}function Wa(e,t,o,n,s){let h=n-60-20,m=s-45-40,c=e.series[0]?.categories?ls(o,e.series[0].categories):[],d=[];for(let w of t)for(let k=0;k<w.values.length;k++)d.push({x:c[k]??k,y:w.values[k],name:w.name,color:w.color});if(!d.length)return"";let f=Math.min(...d.map(w=>w.x)),p=Math.max(...d.map(w=>w.x)),g=Math.min(0,...d.map(w=>w.y)),u=Math.max(...d.map(w=>w.y)),$=p-f||1,x=u-g||1,b=[];for(let w=0;w<=4;w++){let k=45+m-m*w/4;b.push(`<line x1="60" y1="${k}" x2="${n-20}" y2="${k}" stroke="#e0e0e0" stroke-width="0.5"/>`);let T=g+x*w/4;b.push(`<text x="52" y="${k+4}" text-anchor="end" font-size="10" fill="#666">${T.toFixed(0)}</text>`)}let C=d.map(w=>{let k=60+(w.x-f)/$*h,T=45+m-(w.y-g)/x*m,S=e.type==="bubble"?Math.max(4,Math.min(20,Math.sqrt(Math.abs(w.y))*2)):4;return`<circle cx="${k}" cy="${T}" r="${S}" fill="${w.color}" fill-opacity="${e.type==="bubble"?"0.6":"1"}" stroke="white" stroke-width="1"><title>${w.name}: (${w.x}, ${w.y})</title></circle>`}).join(`
451
+ </svg>`}function mi(e,t,o,n,s){let h=n-60-20,m=s-45-40,c=e.series[0]?.categories?ks(o,e.series[0].categories):[],d=[];for(let w of t)for(let k=0;k<w.values.length;k++)d.push({x:c[k]??k,y:w.values[k],name:w.name,color:w.color});if(!d.length)return"";let f=Math.min(...d.map(w=>w.x)),p=Math.max(...d.map(w=>w.x)),g=Math.min(0,...d.map(w=>w.y)),u=Math.max(...d.map(w=>w.y)),$=p-f||1,x=u-g||1,b=[];for(let w=0;w<=4;w++){let k=45+m-m*w/4;b.push(`<line x1="60" y1="${k}" x2="${n-20}" y2="${k}" stroke="#e0e0e0" stroke-width="0.5"/>`);let T=g+x*w/4;b.push(`<text x="52" y="${k+4}" text-anchor="end" font-size="10" fill="#666">${T.toFixed(0)}</text>`)}let C=d.map(w=>{let k=60+(w.x-f)/$*h,T=45+m-(w.y-g)/x*m,S=e.type==="bubble"?Math.max(4,Math.min(20,Math.sqrt(Math.abs(w.y))*2)):4;return`<circle cx="${k}" cy="${T}" r="${S}" fill="${w.color}" fill-opacity="${e.type==="bubble"?"0.6":"1"}" stroke="white" stroke-width="1"><title>${w.name}: (${w.x}, ${w.y})</title></circle>`}).join(`
452
452
  `),y="";if(e.type==="scatterSmooth")for(let w of t){let k=w.values.map((T,S)=>{let R=60+((c[S]??S)-f)/$*h,A=45+m-(T-g)/x*m;return`${R},${A}`});y+=`<polyline points="${k.join(" ")}" fill="none" stroke="${w.color}" stroke-width="2"/>`}let v=e.title?`<text x="${n/2}" y="22" text-anchor="middle" font-size="14" font-weight="600" fill="#333">${I(e.title)}</text>`:"";return`<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${s}" viewBox="0 0 ${n} ${s}" style="background:white;border:1px solid #e0e0e0;border-radius:6px;box-shadow:0 1px 4px rgba(0,0,0,.08);margin:4px">
453
453
  ${v}
454
454
  ${b.join(`
@@ -456,26 +456,26 @@ ${b.join(`
456
456
  <rect x="60" y="45" width="${h}" height="${m}" fill="none" stroke="#ccc" stroke-width="0.5"/>
457
457
  ${y}
458
458
  ${C}
459
- </svg>`}function Ha(e,t){return`<div class="xl-chart" data-from-col="${e.from.col}" data-from-row="${e.from.row}" data-to-col="${e.to.col}" data-to-row="${e.to.row}" style="position:absolute;z-index:4">${cs(e,t)}</div>`}function za(e,t,o){switch(e){case"rect":return`<rect x="0" y="0" width="${t}" height="${o}"/>`;case"roundRect":return`<rect x="0" y="0" width="${t}" height="${o}" rx="${Math.min(t,o)*.15}"/>`;case"ellipse":return`<ellipse cx="${t/2}" cy="${o/2}" rx="${t/2}" ry="${o/2}"/>`;case"triangle":return`<polygon points="${t/2},0 ${t},${o} 0,${o}"/>`;case"diamond":return`<polygon points="${t/2},0 ${t},${o/2} ${t/2},${o} 0,${o/2}"/>`;case"pentagon":return`<polygon points="${Array.from({length:5},(s,r)=>{let a=-Math.PI/2+2*Math.PI*r/5;return`${t/2+t/2*Math.cos(a)},${o/2+o/2*Math.sin(a)}`}).join(" ")}"/>`;case"hexagon":return`<polygon points="${Array.from({length:6},(s,r)=>{let a=-Math.PI/6+2*Math.PI*r/6;return`${t/2+t/2*Math.cos(a)},${o/2+o/2*Math.sin(a)}`}).join(" ")}"/>`;case"octagon":return`<polygon points="${Array.from({length:8},(s,r)=>{let a=-Math.PI/8+2*Math.PI*r/8;return`${t/2+t/2*Math.cos(a)},${o/2+o/2*Math.sin(a)}`}).join(" ")}"/>`;case"star5":case"star6":{let n=e==="star5"?5:6,s=[];for(let r=0;r<n*2;r++){let a=-Math.PI/2+Math.PI*r/n,i=r%2===0?Math.min(t,o)/2:Math.min(t,o)/4.5;s.push(`${t/2+i*Math.cos(a)},${o/2+i*Math.sin(a)}`)}return`<polygon points="${s.join(" ")}"/>`}case"rightArrow":return`<polygon points="0,${o*.25} ${t*.65},${o*.25} ${t*.65},0 ${t},${o/2} ${t*.65},${o} ${t*.65},${o*.75} 0,${o*.75}"/>`;case"leftArrow":return`<polygon points="${t},${o*.25} ${t*.35},${o*.25} ${t*.35},0 0,${o/2} ${t*.35},${o} ${t*.35},${o*.75} ${t},${o*.75}"/>`;case"upArrow":return`<polygon points="${t*.25},${o} ${t*.25},${o*.35} 0,${o*.35} ${t/2},0 ${t},${o*.35} ${t*.75},${o*.35} ${t*.75},${o}"/>`;case"downArrow":return`<polygon points="${t*.25},0 ${t*.75},0 ${t*.75},${o*.65} ${t},${o*.65} ${t/2},${o} 0,${o*.65} ${t*.25},${o*.65}"/>`;case"heart":{let n=t/2,s=o;return`<path d="M${n},${s*.35} C${n},${s*.15} ${n*.5},0 ${n*.25},0 C0,0 0,${s*.35} 0,${s*.35} C0,${s*.6} ${n*.5},${s*.8} ${n},${s} C${n*1.5},${s*.8} ${t},${s*.6} ${t},${s*.35} C${t},${s*.35} ${t},0 ${n*1.75},0 C${n*1.5},0 ${n},${s*.15} ${n},${s*.35} Z"/>`}case"lightningBolt":return`<polygon points="${t*.55},0 ${t*.2},${o*.45} ${t*.45},${o*.45} ${t*.15},${o} ${t*.8},${o*.4} ${t*.55},${o*.4}"/>`;case"sun":return`<circle cx="${t/2}" cy="${o/2}" r="${Math.min(t,o)*.3}"/>`;case"moon":return`<path d="M${t*.6},${o*.1} A${t*.4},${o*.4} 0 1 0 ${t*.6},${o*.9} A${t*.3},${o*.35} 0 1 1 ${t*.6},${o*.1} Z"/>`;case"smileyFace":return`<circle cx="${t/2}" cy="${o/2}" r="${Math.min(t,o)*.45}"/><circle cx="${t*.35}" cy="${o*.38}" r="${Math.min(t,o)*.04}" fill="white"/><circle cx="${t*.65}" cy="${o*.38}" r="${Math.min(t,o)*.04}" fill="white"/><path d="M${t*.3},${o*.58} Q${t/2},${o*.78} ${t*.7},${o*.58}" fill="none" stroke="white" stroke-width="2"/>`;case"cloud":return`<ellipse cx="${t*.35}" cy="${o*.55}" rx="${t*.25}" ry="${o*.25}"/><ellipse cx="${t*.55}" cy="${o*.35}" rx="${t*.22}" ry="${o*.22}"/><ellipse cx="${t*.7}" cy="${o*.5}" rx="${t*.2}" ry="${o*.2}"/><rect x="${t*.15}" y="${o*.5}" width="${t*.7}" height="${o*.25}" rx="4"/>`;case"callout1":return`<path d="M0,0 L${t},0 L${t},${o*.7} L${t*.4},${o*.7} L${t*.25},${o} L${t*.3},${o*.7} L0,${o*.7} Z"/>`;case"callout2":return`<path d="M${t*.1},0 L${t*.9},0 Q${t},0 ${t},${o*.1} L${t},${o*.6} Q${t},${o*.7} ${t*.9},${o*.7} L${t*.4},${o*.7} L${t*.25},${o} L${t*.3},${o*.7} L${t*.1},${o*.7} Q0,${o*.7} 0,${o*.6} L0,${o*.1} Q0,0 ${t*.1},0 Z"/>`;case"flowChartProcess":return`<rect x="0" y="0" width="${t}" height="${o}" rx="2"/>`;case"flowChartDecision":return`<polygon points="${t/2},0 ${t},${o/2} ${t/2},${o} 0,${o/2}"/>`;case"flowChartTerminator":return`<rect x="0" y="0" width="${t}" height="${o}" rx="${o/2}"/>`;case"flowChartDocument":return`<path d="M0,0 L${t},0 L${t},${o*.8} Q${t*.75},${o*.65} ${t*.5},${o*.8} Q${t*.25},${o*.95} 0,${o*.8} Z"/>`;case"line":return`<line x1="0" y1="${o/2}" x2="${t}" y2="${o/2}" stroke-width="2"/>`;case"curvedConnector3":return`<path d="M0,${o/2} C${t*.3},${o*.1} ${t*.7},${o*.9} ${t},${o/2}" fill="none" stroke-width="2"/>`;default:return`<rect x="0" y="0" width="${t}" height="${o}" rx="4"/>`}}function Ga(e){let t=c=>{let d=c.replace(/^#/,"");return d.length===8&&(d=d.substring(2)),"#"+d},o=e.fillColor?t(e.fillColor):"#4472C4",n=e.lineColor?t(e.lineColor):"#2F5496",s=e.lineWidth??2,r=160,a=80,i=e.rotation?` transform="rotate(${e.rotation} ${r/2} ${a/2})"`:"",l=e.text?`<text x="${r/2}" y="${a/2+5}" text-anchor="middle" fill="white" font-size="13" font-weight="600"${e.font?.name?` font-family="'${I(e.font.name)}'"`:""}>${I(e.text)}</text>`:"",m=e.type==="line"||e.type==="curvedConnector3"?`fill="none" stroke="${o}"`:`fill="${o}" stroke="${n}" stroke-width="${s}"`;return`<div class="xl-shape" data-from-col="${e.from.col}" data-from-row="${e.from.row}" data-to-col="${e.to.col}" data-to-row="${e.to.row}" style="position:absolute;z-index:2">
459
+ </svg>`}function di(e,t){return`<div class="xl-chart" data-from-col="${e.from.col}" data-from-row="${e.from.row}" data-to-col="${e.to.col}" data-to-row="${e.to.row}" style="position:absolute;z-index:4">${As(e,t)}</div>`}function fi(e,t,o){switch(e){case"rect":return`<rect x="0" y="0" width="${t}" height="${o}"/>`;case"roundRect":return`<rect x="0" y="0" width="${t}" height="${o}" rx="${Math.min(t,o)*.15}"/>`;case"ellipse":return`<ellipse cx="${t/2}" cy="${o/2}" rx="${t/2}" ry="${o/2}"/>`;case"triangle":return`<polygon points="${t/2},0 ${t},${o} 0,${o}"/>`;case"diamond":return`<polygon points="${t/2},0 ${t},${o/2} ${t/2},${o} 0,${o/2}"/>`;case"pentagon":return`<polygon points="${Array.from({length:5},(s,r)=>{let a=-Math.PI/2+2*Math.PI*r/5;return`${t/2+t/2*Math.cos(a)},${o/2+o/2*Math.sin(a)}`}).join(" ")}"/>`;case"hexagon":return`<polygon points="${Array.from({length:6},(s,r)=>{let a=-Math.PI/6+2*Math.PI*r/6;return`${t/2+t/2*Math.cos(a)},${o/2+o/2*Math.sin(a)}`}).join(" ")}"/>`;case"octagon":return`<polygon points="${Array.from({length:8},(s,r)=>{let a=-Math.PI/8+2*Math.PI*r/8;return`${t/2+t/2*Math.cos(a)},${o/2+o/2*Math.sin(a)}`}).join(" ")}"/>`;case"star5":case"star6":{let n=e==="star5"?5:6,s=[];for(let r=0;r<n*2;r++){let a=-Math.PI/2+Math.PI*r/n,i=r%2===0?Math.min(t,o)/2:Math.min(t,o)/4.5;s.push(`${t/2+i*Math.cos(a)},${o/2+i*Math.sin(a)}`)}return`<polygon points="${s.join(" ")}"/>`}case"rightArrow":return`<polygon points="0,${o*.25} ${t*.65},${o*.25} ${t*.65},0 ${t},${o/2} ${t*.65},${o} ${t*.65},${o*.75} 0,${o*.75}"/>`;case"leftArrow":return`<polygon points="${t},${o*.25} ${t*.35},${o*.25} ${t*.35},0 0,${o/2} ${t*.35},${o} ${t*.35},${o*.75} ${t},${o*.75}"/>`;case"upArrow":return`<polygon points="${t*.25},${o} ${t*.25},${o*.35} 0,${o*.35} ${t/2},0 ${t},${o*.35} ${t*.75},${o*.35} ${t*.75},${o}"/>`;case"downArrow":return`<polygon points="${t*.25},0 ${t*.75},0 ${t*.75},${o*.65} ${t},${o*.65} ${t/2},${o} 0,${o*.65} ${t*.25},${o*.65}"/>`;case"heart":{let n=t/2,s=o;return`<path d="M${n},${s*.35} C${n},${s*.15} ${n*.5},0 ${n*.25},0 C0,0 0,${s*.35} 0,${s*.35} C0,${s*.6} ${n*.5},${s*.8} ${n},${s} C${n*1.5},${s*.8} ${t},${s*.6} ${t},${s*.35} C${t},${s*.35} ${t},0 ${n*1.75},0 C${n*1.5},0 ${n},${s*.15} ${n},${s*.35} Z"/>`}case"lightningBolt":return`<polygon points="${t*.55},0 ${t*.2},${o*.45} ${t*.45},${o*.45} ${t*.15},${o} ${t*.8},${o*.4} ${t*.55},${o*.4}"/>`;case"sun":return`<circle cx="${t/2}" cy="${o/2}" r="${Math.min(t,o)*.3}"/>`;case"moon":return`<path d="M${t*.6},${o*.1} A${t*.4},${o*.4} 0 1 0 ${t*.6},${o*.9} A${t*.3},${o*.35} 0 1 1 ${t*.6},${o*.1} Z"/>`;case"smileyFace":return`<circle cx="${t/2}" cy="${o/2}" r="${Math.min(t,o)*.45}"/><circle cx="${t*.35}" cy="${o*.38}" r="${Math.min(t,o)*.04}" fill="white"/><circle cx="${t*.65}" cy="${o*.38}" r="${Math.min(t,o)*.04}" fill="white"/><path d="M${t*.3},${o*.58} Q${t/2},${o*.78} ${t*.7},${o*.58}" fill="none" stroke="white" stroke-width="2"/>`;case"cloud":return`<ellipse cx="${t*.35}" cy="${o*.55}" rx="${t*.25}" ry="${o*.25}"/><ellipse cx="${t*.55}" cy="${o*.35}" rx="${t*.22}" ry="${o*.22}"/><ellipse cx="${t*.7}" cy="${o*.5}" rx="${t*.2}" ry="${o*.2}"/><rect x="${t*.15}" y="${o*.5}" width="${t*.7}" height="${o*.25}" rx="4"/>`;case"callout1":return`<path d="M0,0 L${t},0 L${t},${o*.7} L${t*.4},${o*.7} L${t*.25},${o} L${t*.3},${o*.7} L0,${o*.7} Z"/>`;case"callout2":return`<path d="M${t*.1},0 L${t*.9},0 Q${t},0 ${t},${o*.1} L${t},${o*.6} Q${t},${o*.7} ${t*.9},${o*.7} L${t*.4},${o*.7} L${t*.25},${o} L${t*.3},${o*.7} L${t*.1},${o*.7} Q0,${o*.7} 0,${o*.6} L0,${o*.1} Q0,0 ${t*.1},0 Z"/>`;case"flowChartProcess":return`<rect x="0" y="0" width="${t}" height="${o}" rx="2"/>`;case"flowChartDecision":return`<polygon points="${t/2},0 ${t},${o/2} ${t/2},${o} 0,${o/2}"/>`;case"flowChartTerminator":return`<rect x="0" y="0" width="${t}" height="${o}" rx="${o/2}"/>`;case"flowChartDocument":return`<path d="M0,0 L${t},0 L${t},${o*.8} Q${t*.75},${o*.65} ${t*.5},${o*.8} Q${t*.25},${o*.95} 0,${o*.8} Z"/>`;case"line":return`<line x1="0" y1="${o/2}" x2="${t}" y2="${o/2}" stroke-width="2"/>`;case"curvedConnector3":return`<path d="M0,${o/2} C${t*.3},${o*.1} ${t*.7},${o*.9} ${t},${o/2}" fill="none" stroke-width="2"/>`;default:return`<rect x="0" y="0" width="${t}" height="${o}" rx="4"/>`}}function pi(e){let t=c=>{let d=c.replace(/^#/,"");return d.length===8&&(d=d.substring(2)),"#"+d},o=e.fillColor?t(e.fillColor):"#4472C4",n=e.lineColor?t(e.lineColor):"#2F5496",s=e.lineWidth??2,r=160,a=80,i=e.rotation?` transform="rotate(${e.rotation} ${r/2} ${a/2})"`:"",l=e.text?`<text x="${r/2}" y="${a/2+5}" text-anchor="middle" fill="white" font-size="13" font-weight="600"${e.font?.name?` font-family="'${I(e.font.name)}'"`:""}>${I(e.text)}</text>`:"",m=e.type==="line"||e.type==="curvedConnector3"?`fill="none" stroke="${o}"`:`fill="${o}" stroke="${n}" stroke-width="${s}"`;return`<div class="xl-shape" data-from-col="${e.from.col}" data-from-row="${e.from.row}" data-to-col="${e.to.col}" data-to-row="${e.to.row}" style="position:absolute;z-index:2">
460
460
  <svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${a}" viewBox="0 0 ${r} ${a}"${i}>
461
- <g ${m}>${za(e.type,r,a)}</g>
461
+ <g ${m}>${fi(e.type,r,a)}</g>
462
462
  ${l}
463
- </svg></div>`}function qa(e){let t=m=>{let c=m.replace(/^#/,"");return c.length===8&&(c=c.substring(2)),"#"+c},o=e.fillColor?t(e.fillColor):"#333",n=e.outlineColor?t(e.outlineColor):"",s=e.font?.name??"Impact",r=e.font?.size??36,a=e.font?.bold!==!1?"font-weight:bold;":"",i=e.font?.italic?"font-style:italic;":"",l=n?`-webkit-text-stroke:1px ${n};paint-order:stroke fill;`:"",h=Ka(e.preset);return`<div class="xl-wordart" data-from-col="${e.from.col}" data-from-row="${e.from.row}" data-to-col="${e.to.col}" data-to-row="${e.to.row}" style="position:absolute;z-index:2;font-family:'${I(s)}',sans-serif;font-size:${r}px;${a}${i}color:${o};${l}text-shadow:2px 2px 4px rgba(0,0,0,.3);${h}padding:8px 16px;white-space:nowrap;line-height:1.2">${I(e.text)}</div>`}function Ka(e){return!e||e==="textPlain"?"":{textArchUp:"letter-spacing:4px;",textArchDown:"letter-spacing:4px;transform:scaleY(-1);",textCircle:"letter-spacing:6px;",textWave1:"letter-spacing:2px;font-style:italic;transform:skewX(-5deg);",textWave2:"letter-spacing:2px;font-style:italic;transform:skewX(5deg);",textInflate:"letter-spacing:3px;transform:scaleY(1.3);",textDeflate:"letter-spacing:1px;transform:scaleY(0.7);",textSlantUp:"transform:perspective(300px) rotateY(-8deg) rotateX(3deg);",textSlantDown:"transform:perspective(300px) rotateY(8deg) rotateX(-3deg);",textFadeUp:"transform:perspective(200px) rotateX(-8deg);",textFadeDown:"transform:perspective(200px) rotateX(8deg);",textFadeLeft:"transform:perspective(200px) rotateY(8deg);",textFadeRight:"transform:perspective(200px) rotateY(-8deg);",textCascadeUp:"letter-spacing:3px;transform:rotate(-5deg) scaleX(1.1);",textCascadeDown:"letter-spacing:3px;transform:rotate(5deg) scaleX(1.1);",textChevron:"letter-spacing:5px;transform:scaleX(1.15);",textRingInside:"letter-spacing:8px;",textRingOutside:"letter-spacing:6px;",textStop:"letter-spacing:2px;transform:scaleY(0.85) scaleX(1.1);"}[e]??""}function Za(e){let t="";for(let o=0;o<e.length;o+=3){let n=e[o],s=e[o+1]??0,r=e[o+2]??0,a=n<<16|s<<8|r,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t+=i[a>>18&63]+i[a>>12&63],t+=o+1<e.length?i[a>>6&63]:"=",t+=o+2<e.length?i[a&63]:"="}return t}function hs(e,t){let o=Ja(t),n=typeof e=="string"?e:Za(e);return`data:${o};base64,${n}`}function Ya(e){let t=hs(e.data,e.format),o=e.altText?` alt="${I(e.altText)}"`:"",n=e.width?`width:${e.width}px;`:"max-width:400px;",s=e.height?`height:${e.height}px;`:"max-height:300px;",r=e.from?.col??0,a=e.from?.row??0;return`<img src="${t}"${o} class="xl-img" data-from-col="${r}" data-from-row="${a}" style="${n}${s}border:1px solid #ddd;border-radius:4px"/>`}function Qa(e){let t=hs(e.data,e.format),o=e.altText?` alt="${I(e.altText)}"`:"";return`<img src="${t}"${o} style="max-width:100%;max-height:100%;object-fit:contain"/>`}function Ja(e){switch(e){case"jpeg":case"jpg":return"image/jpeg";case"gif":return"image/gif";case"svg":return"image/svg+xml";case"webp":return"image/webp";case"bmp":return"image/bmp";default:return"image/png"}}function At(e){switch(e.type){case"text":{let t=I(e.text??"");return e.font==="normal"||/^[a-zA-Z]{2,}$/.test(e.text??"")?`<mi mathvariant="normal">${t}</mi>`:/^[0-9.]+$/.test(e.text??"")?`<mn>${t}</mn>`:e.text&&e.text.length===1&&/[+\-*/=<>±×÷≤≥≠∞∈∉∪∩⊂⊃∧∨¬→←↔∀∃∑∏∫]/.test(e.text)?`<mo>${t}</mo>`:`<mi>${t}</mi>`}case"frac":return`<mfrac><mrow>${(e.base??[]).map(At).join("")}</mrow><mrow>${(e.argument??[]).map(At).join("")}</mrow></mfrac>`;case"sup":return`<msup><mrow>${(e.base??[]).map(At).join("")}</mrow><mrow>${(e.argument??[]).map(At).join("")}</mrow></msup>`;case"sub":return`<msub><mrow>${(e.base??[]).map(At).join("")}</mrow><mrow>${(e.argument??[]).map(At).join("")}</mrow></msub>`;case"subSup":return`<msubsup><mrow>${(e.base??[]).map(At).join("")}</mrow><mrow>${(e.subscript??[]).map(At).join("")}</mrow><mrow>${(e.superscript??[]).map(At).join("")}</mrow></msubsup>`;case"nary":return`<munderover><mo>${I(e.operator??"\u2211")}</mo><mrow>${(e.lower??[]).map(At).join("")}</mrow><mrow>${(e.upper??[]).map(At).join("")}</mrow></munderover><mrow>${(e.body??[]).map(At).join("")}</mrow>`;case"rad":return!e.hideDegree&&e.degree?.length?`<mroot><mrow>${(e.body??[]).map(At).join("")}</mrow><mrow>${e.degree.map(At).join("")}</mrow></mroot>`:`<msqrt><mrow>${(e.body??[]).map(At).join("")}</mrow></msqrt>`;case"delim":return`<mrow><mo>${I(e.open??"(")}</mo>${(e.body??[]).map(At).join("")}<mo>${I(e.close??")")}</mo></mrow>`;case"func":return`<mrow><mi mathvariant="normal">${(e.base??[]).map(t=>I(t.text??"")).join("")}</mi><mo>&#x2061;</mo>${(e.argument??[]).map(At).join("")}</mrow>`;case"groupChar":return`<munder><mrow>${(e.base??[]).map(At).join("")}</mrow><mo>${I(e.operator??"\u23DF")}</mo></munder>`;case"accent":return`<mover accent="true"><mrow>${(e.base??[]).map(At).join("")}</mrow><mo>${I(e.operator??"\u0302")}</mo></mover>`;case"bar":return`<mover><mrow>${(e.base??[]).map(At).join("")}</mrow><mo>\xAF</mo></mover>`;case"limLow":return`<munder><mrow>${(e.base??[]).map(At).join("")}</mrow><mrow>${(e.argument??[]).map(At).join("")}</mrow></munder>`;case"limUpp":return`<mover><mrow>${(e.base??[]).map(At).join("")}</mrow><mrow>${(e.argument??[]).map(At).join("")}</mrow></mover>`;case"eqArr":return`<mtable>${(e.rows??[]).map(t=>`<mtr><mtd>${t.map(At).join("")}</mtd></mtr>`).join("")}</mtable>`;case"matrix":return`<mrow><mo>(</mo><mtable>${(e.rows??[]).map(t=>`<mtr>${t.map(o=>`<mtd>${At(o)}</mtd>`).join("")}</mtr>`).join("")}</mtable><mo>)</mo></mrow>`;default:return e.text?`<mi>${I(e.text)}</mi>`:"<mrow></mrow>"}}function ti(e){let t=e.fontSize??11,o=e.fontName??"Cambria Math";return`<div class="xl-math" data-from-col="${e.from.col}" data-from-row="${e.from.row}" style="position:absolute;z-index:2;font-family:'${I(o)}',serif;font-size:${t}pt;padding:4px;background:white"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>${e.elements.map(At).join("")}</mrow></math></div>`}function ms(e){let t=e.from.col,o=e.from.row,n=e.to?.col,s=e.to?.row,r=n!=null&&s!=null?` data-to-col="${n}" data-to-row="${s}"`:"",a=e.linkedCell?` data-linked-cell="${I(e.linkedCell)}"`:"",i=e.inputRange?` data-input-range="${I(e.inputRange)}"`:"",l=e.macro?` data-macro="${I(e.macro)}"`:"",h="";switch(e.type){case"button":case"dialog":h=`<button style="width:100%;height:100%;padding:4px 12px;font-size:13px;border:1px outset #ccc;background:linear-gradient(180deg,#f8f8f8,#e0e0e0);cursor:pointer;border-radius:3px;white-space:nowrap"${l}>${I(e.text??"Button")}</button>`;break;case"checkBox":{let m=e.checked==="checked"?" checked":"",c=e.checked==="mixed"?' data-indeterminate="true"':"";h=`<label style="font-size:13px;display:inline-flex;align-items:center;gap:4px;width:100%;height:100%;padding:2px 4px;cursor:pointer"><input type="checkbox"${m}${c}${a}/> ${I(e.text??"Checkbox")}</label>`;break}case"optionButton":{h=`<label style="font-size:13px;display:inline-flex;align-items:center;gap:4px;width:100%;height:100%;padding:2px 4px;cursor:pointer"><input type="radio" name="group"${e.checked==="checked"?" checked":""}${a}/> ${I(e.text??"Option")}</label>`;break}case"comboBox":{let m=e.dropLines??8;h=`<select style="width:100%;height:100%;padding:2px 4px;font-size:13px;border:1px solid #aaa;background:white"${a}${i} size="1" data-drop-lines="${m}"><option>${I(e.text??"Select...")}</option></select>`;break}case"listBox":{let m=e.dropLines??5,c=e.selType??"single";h=`<select style="width:100%;height:100%;padding:2px;font-size:13px;border:1px solid #aaa;background:white"${a}${i} size="${m}"${c==="multi"||c==="extend"?" multiple":""}><option>${I(e.text??"Item")}</option></select>`;break}case"spinner":{let m=e.min??0,c=e.max??100,d=e.inc??1;h=`<input type="number" value="${e.val??m}" min="${m}" max="${c}" step="${d}" style="width:100%;height:100%;padding:2px 4px;font-size:13px;border:1px solid #aaa"${a}/>`;break}case"scrollBar":{let m=e.min??0,c=e.max??100,d=e.inc??1;h=`<input type="range" value="${e.val??m}" min="${m}" max="${c}" step="${d}" style="width:100%;height:100%"${a}/>`;break}case"label":h=`<span style="font-size:13px;display:flex;align-items:center;width:100%;height:100%;padding:2px 4px">${I(e.text??"Label")}</span>`;break;case"groupBox":h=`<fieldset style="width:100%;height:100%;padding:8px;border:1px solid #999;font-size:13px;margin:0;box-sizing:border-box"><legend>${I(e.text??"Group")}</legend></fieldset>`;break;default:h=`<span style="font-size:13px">[${I(e.type)}]</span>`}return`<div class="xl-fc" data-from-col="${t}" data-from-row="${o}"${r} style="position:absolute;overflow:hidden">${h}</div>`}function ne(e){let t=0;for(let o=0;o<e.length;o++)t=t*26+(e.charCodeAt(o)-64);return t}function ei(e,t){let o=[],s=(t.includes("!")?t.split("!")[1]:t).match(/^([A-Z]+)(\d+):([A-Z]+)(\d+)$/);if(s){let r=ne(s[1]),a=parseInt(s[2],10),i=ne(s[3]),l=parseInt(s[4],10);for(let h=a;h<=l;h++)for(let m=r;m<=i;m++){let c=e.getCell(h,m);typeof c.value=="number"&&o.push(c.value)}}return o}function ln(e,t={}){t.evaluateFormulas&&new me().calculateSheet(e);let o=e.getUsedRange();if(!o)return t.fullDocument!==!1?`<!DOCTYPE html><html><head><title>${I(t.title??"")}</title></head><body><p>Empty worksheet</p></body></html>`:"<table></table>";let{startRow:n,startCol:s,endRow:r,endCol:a}=o;if(t.printAreaOnly&&e.printArea){let N=e.printArea.match(/^([A-Z]+)(\d+):([A-Z]+)(\d+)$/);N&&(s=ne(N[1]),n=parseInt(N[2],10),a=ne(N[3]),r=parseInt(N[4],10))}let i=e.getMerges(),l=t.includeConditionalFormatting!==!1?e.getConditionalFormats():[],h=t.includeSparklines!==!1?e.getSparklines():[],m=new Map;for(let M of h){let N=M.location.match(/^([A-Z]+)(\d+)$/);N&&m.set(`${parseInt(N[2],10)},${ne(N[1])}`,M)}let c=new Map;for(let M of l){if(!M.colorScale&&!M.dataBar&&!M.iconSet)continue;let N=[],H=M.sqref.split(" ");for(let V of H){let K=V.match(/^([A-Z]+)(\d+):([A-Z]+)(\d+)$/);if(K)for(let z=parseInt(K[2],10);z<=parseInt(K[4],10);z++)for(let mt=ne(K[1]);mt<=ne(K[3]);mt++){let it=e.getCell(z,mt);typeof it.value=="number"&&N.push(it.value)}}c.set(M,N)}let d=new Map;for(let M of i){let N=M.endRow-M.startRow+1,H=M.endCol-M.startCol+1;d.set(`${M.startRow},${M.startCol}`,{rowSpan:N,colSpan:H});for(let V=M.startRow;V<=M.endRow;V++)for(let K=M.startCol;K<=M.endCol;K++)(V!==M.startRow||K!==M.startCol)&&d.set(`${V},${K}`,"skip")}let f=[];if(t.includeColumnWidths!==!1)for(let M=s;M<=a;M++){let N=e.getColumn(M);if(t.skipHidden&&N?.hidden)continue;let H=N?.width?Math.round(N.width*7.5):void 0;f.push(H?`<col style="width:${H}px">`:"<col>")}let p=new Map,g=e.getCellImages?.();if(g)for(let M of g)p.set(M.cell,M);let u=[];for(let M=n;M<=r;M++){let N=e.getRow(M);if(t.skipHidden&&N?.hidden)continue;let H=N?.height?` style="height:${N.height}px"`:"",V=[];for(let K=s;K<=a;K++){let z=e.getColumn(K);if(t.skipHidden&&z?.hidden)continue;let mt=`${M},${K}`,it=d.get(mt);if(it==="skip")continue;let gt=e.getCell(M,K),St="",J=`${Ut(K)}${M}`,G=p.get(J);if(G)St=Qa(G);else if(gt.richText)St=gt.richText.map(ht=>{let tt=ht.font?is(ht.font):"";return tt?`<span style="${tt}">${I(ht.text)}</span>`:I(ht.text)}).join("");else if(gt.value!=null){let ht=gt.style?.numberFormat?_a(gt.value,gt.style.numberFormat.formatCode):String(gt.value);St=I(ht)}if(gt.hyperlink){let ht=I(gt.hyperlink.href??""),tt=gt.hyperlink.tooltip?` title="${I(gt.hyperlink.tooltip)}"`:"";St=`<a href="${ht}"${tt} style="color:#0563C1;text-decoration:underline">${St}</a>`}if(gt.comment){let ht=gt.comment.richText?gt.comment.richText.map(tt=>tt.text).join(""):gt.comment.text;St=`<span title="${I(ht)}" style="cursor:help">${St}</span>`}let X=[];it&&typeof it!="string"&&(it.rowSpan>1&&X.push(`rowspan="${it.rowSpan}"`),it.colSpan>1&&X.push(`colspan="${it.colSpan}"`));let F=[];t.includeStyles!==!1&&gt.style&&F.push(Ba(gt.style));let P="";if(typeof gt.value=="number")for(let ht of l){let tt=c.get(ht);if(!tt)continue;let ft=La(ht,gt.value,tt);ft.startsWith("data-icon=")?P=` ${ft}`:ft&&F.push(ft)}let U=F.filter(Boolean).join(";");U&&X.push(`style="${U}"`),X.push(`data-cell="${Ut(K)}${M}"`);let Y=m.get(mt);Y&&(St+=Na(Y,ei(e,Y.dataRange)));let st=X.length?" "+X.join(" "):"";V.push(`<td${st}${P}>${St}</td>`)}u.push(`<tr${H}>${V.join("")}</tr>`)}let x=`<div class="xl-sheet-wrapper" style="position:relative;display:inline-block"><table border="0" cellpadding="4" cellspacing="0">
463
+ </svg></div>`}function ui(e){let t=m=>{let c=m.replace(/^#/,"");return c.length===8&&(c=c.substring(2)),"#"+c},o=e.fillColor?t(e.fillColor):"#333",n=e.outlineColor?t(e.outlineColor):"",s=e.font?.name??"Impact",r=e.font?.size??36,a=e.font?.bold!==!1?"font-weight:bold;":"",i=e.font?.italic?"font-style:italic;":"",l=n?`-webkit-text-stroke:1px ${n};paint-order:stroke fill;`:"",h=gi(e.preset);return`<div class="xl-wordart" data-from-col="${e.from.col}" data-from-row="${e.from.row}" data-to-col="${e.to.col}" data-to-row="${e.to.row}" style="position:absolute;z-index:2;font-family:'${I(s)}',sans-serif;font-size:${r}px;${a}${i}color:${o};${l}text-shadow:2px 2px 4px rgba(0,0,0,.3);${h}padding:8px 16px;white-space:nowrap;line-height:1.2">${I(e.text)}</div>`}function gi(e){return!e||e==="textPlain"?"":{textArchUp:"letter-spacing:4px;",textArchDown:"letter-spacing:4px;transform:scaleY(-1);",textCircle:"letter-spacing:6px;",textWave1:"letter-spacing:2px;font-style:italic;transform:skewX(-5deg);",textWave2:"letter-spacing:2px;font-style:italic;transform:skewX(5deg);",textInflate:"letter-spacing:3px;transform:scaleY(1.3);",textDeflate:"letter-spacing:1px;transform:scaleY(0.7);",textSlantUp:"transform:perspective(300px) rotateY(-8deg) rotateX(3deg);",textSlantDown:"transform:perspective(300px) rotateY(8deg) rotateX(-3deg);",textFadeUp:"transform:perspective(200px) rotateX(-8deg);",textFadeDown:"transform:perspective(200px) rotateX(8deg);",textFadeLeft:"transform:perspective(200px) rotateY(8deg);",textFadeRight:"transform:perspective(200px) rotateY(-8deg);",textCascadeUp:"letter-spacing:3px;transform:rotate(-5deg) scaleX(1.1);",textCascadeDown:"letter-spacing:3px;transform:rotate(5deg) scaleX(1.1);",textChevron:"letter-spacing:5px;transform:scaleX(1.15);",textRingInside:"letter-spacing:8px;",textRingOutside:"letter-spacing:6px;",textStop:"letter-spacing:2px;transform:scaleY(0.85) scaleX(1.1);"}[e]??""}function xi(e){let t="";for(let o=0;o<e.length;o+=3){let n=e[o],s=e[o+1]??0,r=e[o+2]??0,a=n<<16|s<<8|r,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t+=i[a>>18&63]+i[a>>12&63],t+=o+1<e.length?i[a>>6&63]:"=",t+=o+2<e.length?i[a&63]:"="}return t}function Ds(e,t){let o=wi(t),n=typeof e=="string"?e:xi(e);return`data:${o};base64,${n}`}function $i(e){let t=Ds(e.data,e.format),o=e.altText?` alt="${I(e.altText)}"`:"",n=e.width?`width:${e.width}px;`:"max-width:400px;",s=e.height?`height:${e.height}px;`:"max-height:300px;",r=e.from?.col??0,a=e.from?.row??0;return`<img src="${t}"${o} class="xl-img" data-from-col="${r}" data-from-row="${a}" style="${n}${s}border:1px solid #ddd;border-radius:4px"/>`}function yi(e){let t=Ds(e.data,e.format),o=e.altText?` alt="${I(e.altText)}"`:"";return`<img src="${t}"${o} style="max-width:100%;max-height:100%;object-fit:contain"/>`}function wi(e){switch(e){case"jpeg":case"jpg":return"image/jpeg";case"gif":return"image/gif";case"svg":return"image/svg+xml";case"webp":return"image/webp";case"bmp":return"image/bmp";default:return"image/png"}}function At(e){switch(e.type){case"text":{let t=I(e.text??"");return e.font==="normal"||/^[a-zA-Z]{2,}$/.test(e.text??"")?`<mi mathvariant="normal">${t}</mi>`:/^[0-9.]+$/.test(e.text??"")?`<mn>${t}</mn>`:e.text&&e.text.length===1&&/[+\-*/=<>±×÷≤≥≠∞∈∉∪∩⊂⊃∧∨¬→←↔∀∃∑∏∫]/.test(e.text)?`<mo>${t}</mo>`:`<mi>${t}</mi>`}case"frac":return`<mfrac><mrow>${(e.base??[]).map(At).join("")}</mrow><mrow>${(e.argument??[]).map(At).join("")}</mrow></mfrac>`;case"sup":return`<msup><mrow>${(e.base??[]).map(At).join("")}</mrow><mrow>${(e.argument??[]).map(At).join("")}</mrow></msup>`;case"sub":return`<msub><mrow>${(e.base??[]).map(At).join("")}</mrow><mrow>${(e.argument??[]).map(At).join("")}</mrow></msub>`;case"subSup":return`<msubsup><mrow>${(e.base??[]).map(At).join("")}</mrow><mrow>${(e.subscript??[]).map(At).join("")}</mrow><mrow>${(e.superscript??[]).map(At).join("")}</mrow></msubsup>`;case"nary":return`<munderover><mo>${I(e.operator??"\u2211")}</mo><mrow>${(e.lower??[]).map(At).join("")}</mrow><mrow>${(e.upper??[]).map(At).join("")}</mrow></munderover><mrow>${(e.body??[]).map(At).join("")}</mrow>`;case"rad":return!e.hideDegree&&e.degree?.length?`<mroot><mrow>${(e.body??[]).map(At).join("")}</mrow><mrow>${e.degree.map(At).join("")}</mrow></mroot>`:`<msqrt><mrow>${(e.body??[]).map(At).join("")}</mrow></msqrt>`;case"delim":return`<mrow><mo>${I(e.open??"(")}</mo>${(e.body??[]).map(At).join("")}<mo>${I(e.close??")")}</mo></mrow>`;case"func":return`<mrow><mi mathvariant="normal">${(e.base??[]).map(t=>I(t.text??"")).join("")}</mi><mo>&#x2061;</mo>${(e.argument??[]).map(At).join("")}</mrow>`;case"groupChar":return`<munder><mrow>${(e.base??[]).map(At).join("")}</mrow><mo>${I(e.operator??"\u23DF")}</mo></munder>`;case"accent":return`<mover accent="true"><mrow>${(e.base??[]).map(At).join("")}</mrow><mo>${I(e.operator??"\u0302")}</mo></mover>`;case"bar":return`<mover><mrow>${(e.base??[]).map(At).join("")}</mrow><mo>\xAF</mo></mover>`;case"limLow":return`<munder><mrow>${(e.base??[]).map(At).join("")}</mrow><mrow>${(e.argument??[]).map(At).join("")}</mrow></munder>`;case"limUpp":return`<mover><mrow>${(e.base??[]).map(At).join("")}</mrow><mrow>${(e.argument??[]).map(At).join("")}</mrow></mover>`;case"eqArr":return`<mtable>${(e.rows??[]).map(t=>`<mtr><mtd>${t.map(At).join("")}</mtd></mtr>`).join("")}</mtable>`;case"matrix":return`<mrow><mo>(</mo><mtable>${(e.rows??[]).map(t=>`<mtr>${t.map(o=>`<mtd>${At(o)}</mtd>`).join("")}</mtr>`).join("")}</mtable><mo>)</mo></mrow>`;default:return e.text?`<mi>${I(e.text)}</mi>`:"<mrow></mrow>"}}function bi(e){let t=e.fontSize??11,o=e.fontName??"Cambria Math";return`<div class="xl-math" data-from-col="${e.from.col}" data-from-row="${e.from.row}" style="position:absolute;z-index:2;font-family:'${I(o)}',serif;font-size:${t}pt;padding:4px;background:white"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>${e.elements.map(At).join("")}</mrow></math></div>`}function Rs(e){let t=e.from.col,o=e.from.row,n=e.to?.col,s=e.to?.row,r=n!=null&&s!=null?` data-to-col="${n}" data-to-row="${s}"`:"",a=e.linkedCell?` data-linked-cell="${I(e.linkedCell)}"`:"",i=e.inputRange?` data-input-range="${I(e.inputRange)}"`:"",l=e.macro?` data-macro="${I(e.macro)}"`:"",h="";switch(e.type){case"button":case"dialog":h=`<button style="width:100%;height:100%;padding:4px 12px;font-size:13px;border:1px outset #ccc;background:linear-gradient(180deg,#f8f8f8,#e0e0e0);cursor:pointer;border-radius:3px;white-space:nowrap"${l}>${I(e.text??"Button")}</button>`;break;case"checkBox":{let m=e.checked==="checked"?" checked":"",c=e.checked==="mixed"?' data-indeterminate="true"':"";h=`<label style="font-size:13px;display:inline-flex;align-items:center;gap:4px;width:100%;height:100%;padding:2px 4px;cursor:pointer"><input type="checkbox"${m}${c}${a}/> ${I(e.text??"Checkbox")}</label>`;break}case"optionButton":{h=`<label style="font-size:13px;display:inline-flex;align-items:center;gap:4px;width:100%;height:100%;padding:2px 4px;cursor:pointer"><input type="radio" name="group"${e.checked==="checked"?" checked":""}${a}/> ${I(e.text??"Option")}</label>`;break}case"comboBox":{let m=e.dropLines??8;h=`<select style="width:100%;height:100%;padding:2px 4px;font-size:13px;border:1px solid #aaa;background:white"${a}${i} size="1" data-drop-lines="${m}"><option>${I(e.text??"Select...")}</option></select>`;break}case"listBox":{let m=e.dropLines??5,c=e.selType??"single";h=`<select style="width:100%;height:100%;padding:2px;font-size:13px;border:1px solid #aaa;background:white"${a}${i} size="${m}"${c==="multi"||c==="extend"?" multiple":""}><option>${I(e.text??"Item")}</option></select>`;break}case"spinner":{let m=e.min??0,c=e.max??100,d=e.inc??1;h=`<input type="number" value="${e.val??m}" min="${m}" max="${c}" step="${d}" style="width:100%;height:100%;padding:2px 4px;font-size:13px;border:1px solid #aaa"${a}/>`;break}case"scrollBar":{let m=e.min??0,c=e.max??100,d=e.inc??1;h=`<input type="range" value="${e.val??m}" min="${m}" max="${c}" step="${d}" style="width:100%;height:100%"${a}/>`;break}case"label":h=`<span style="font-size:13px;display:flex;align-items:center;width:100%;height:100%;padding:2px 4px">${I(e.text??"Label")}</span>`;break;case"groupBox":h=`<fieldset style="width:100%;height:100%;padding:8px;border:1px solid #999;font-size:13px;margin:0;box-sizing:border-box"><legend>${I(e.text??"Group")}</legend></fieldset>`;break;default:h=`<span style="font-size:13px">[${I(e.type)}]</span>`}return`<div class="xl-fc" data-from-col="${t}" data-from-row="${o}"${r} style="position:absolute;overflow:hidden">${h}</div>`}function se(e){let t=0;for(let o=0;o<e.length;o++)t=t*26+(e.charCodeAt(o)-64);return t}function Ci(e,t){let o=[],s=(t.includes("!")?t.split("!")[1]:t).match(/^([A-Z]+)(\d+):([A-Z]+)(\d+)$/);if(s){let r=se(s[1]),a=parseInt(s[2],10),i=se(s[3]),l=parseInt(s[4],10);for(let h=a;h<=l;h++)for(let m=r;m<=i;m++){let c=e.getCell(h,m);typeof c.value=="number"&&o.push(c.value)}}return o}function yn(e,t={}){t.evaluateFormulas&&new de().calculateSheet(e);let o=e.getUsedRange();if(!o)return t.fullDocument!==!1?`<!DOCTYPE html><html><head><title>${I(t.title??"")}</title></head><body><p>Empty worksheet</p></body></html>`:"<table></table>";let{startRow:n,startCol:s,endRow:r,endCol:a}=o;if(t.printAreaOnly&&e.printArea){let N=e.printArea.match(/^([A-Z]+)(\d+):([A-Z]+)(\d+)$/);N&&(s=se(N[1]),n=parseInt(N[2],10),a=se(N[3]),r=parseInt(N[4],10))}let i=e.getMerges(),l=t.includeConditionalFormatting!==!1?e.getConditionalFormats():[],h=t.includeSparklines!==!1?e.getSparklines():[],m=new Map;for(let M of h){let N=M.location.match(/^([A-Z]+)(\d+)$/);N&&m.set(`${parseInt(N[2],10)},${se(N[1])}`,M)}let c=new Map;for(let M of l){if(!M.colorScale&&!M.dataBar&&!M.iconSet)continue;let N=[],H=M.sqref.split(" ");for(let V of H){let K=V.match(/^([A-Z]+)(\d+):([A-Z]+)(\d+)$/);if(K)for(let z=parseInt(K[2],10);z<=parseInt(K[4],10);z++)for(let mt=se(K[1]);mt<=se(K[3]);mt++){let it=e.getCell(z,mt);typeof it.value=="number"&&N.push(it.value)}}c.set(M,N)}let d=new Map;for(let M of i){let N=M.endRow-M.startRow+1,H=M.endCol-M.startCol+1;d.set(`${M.startRow},${M.startCol}`,{rowSpan:N,colSpan:H});for(let V=M.startRow;V<=M.endRow;V++)for(let K=M.startCol;K<=M.endCol;K++)(V!==M.startRow||K!==M.startCol)&&d.set(`${V},${K}`,"skip")}let f=[];if(t.includeColumnWidths!==!1)for(let M=s;M<=a;M++){let N=e.getColumn(M);if(t.skipHidden&&N?.hidden)continue;let H=N?.width?Math.round(N.width*7.5):void 0;f.push(H?`<col style="width:${H}px">`:"<col>")}let p=new Map,g=e.getCellImages?.();if(g)for(let M of g)p.set(M.cell,M);let u=[];for(let M=n;M<=r;M++){let N=e.getRow(M);if(t.skipHidden&&N?.hidden)continue;let H=N?.height?` style="height:${N.height}px"`:"",V=[];for(let K=s;K<=a;K++){let z=e.getColumn(K);if(t.skipHidden&&z?.hidden)continue;let mt=`${M},${K}`,it=d.get(mt);if(it==="skip")continue;let gt=e.getCell(M,K),St="",J=`${Ut(K)}${M}`,G=p.get(J);if(G)St=yi(G);else if(gt.richText)St=gt.richText.map(ht=>{let tt=ht.font?Ts(ht.font):"";return tt?`<span style="${tt}">${I(ht.text)}</span>`:I(ht.text)}).join("");else if(gt.value!=null){let ht=gt.style?.numberFormat?ni(gt.value,gt.style.numberFormat.formatCode):String(gt.value);St=I(ht)}if(gt.hyperlink){let ht=I(gt.hyperlink.href??""),tt=gt.hyperlink.tooltip?` title="${I(gt.hyperlink.tooltip)}"`:"";St=`<a href="${ht}"${tt} style="color:#0563C1;text-decoration:underline">${St}</a>`}if(gt.comment){let ht=gt.comment.richText?gt.comment.richText.map(tt=>tt.text).join(""):gt.comment.text;St=`<span title="${I(ht)}" style="cursor:help">${St}</span>`}let X=[];it&&typeof it!="string"&&(it.rowSpan>1&&X.push(`rowspan="${it.rowSpan}"`),it.colSpan>1&&X.push(`colspan="${it.colSpan}"`));let F=[];t.includeStyles!==!1&&gt.style&&F.push(oi(gt.style));let P="";if(typeof gt.value=="number")for(let ht of l){let tt=c.get(ht);if(!tt)continue;let ft=ai(ht,gt.value,tt);ft.startsWith("data-icon=")?P=` ${ft}`:ft&&F.push(ft)}let U=F.filter(Boolean).join(";");U&&X.push(`style="${U}"`),X.push(`data-cell="${Ut(K)}${M}"`);let Y=m.get(mt);Y&&(St+=ii(Y,Ci(e,Y.dataRange)));let st=X.length?" "+X.join(" "):"";V.push(`<td${st}${P}>${St}</td>`)}u.push(`<tr${H}>${V.join("")}</tr>`)}let x=`<div class="xl-sheet-wrapper" style="position:relative;display:inline-block"><table border="0" cellpadding="4" cellspacing="0">
464
464
  ${f.length?`<colgroup>${f.join("")}</colgroup>`:""}
465
465
  ${u.join(`
466
466
  `)}
467
467
  </table>`,b="";if(t.includeCharts!==!1){let M=e.getCharts();M.length&&(b=`
468
- <div class="xl-charts">`+M.map(N=>Ha(N,e)).join(`
468
+ <div class="xl-charts">`+M.map(N=>di(N,e)).join(`
469
469
  `)+"</div>")}let C="",y=e.getImages?.();y?.length&&(C=`
470
- <div class="xl-images">`+y.map(Ya).join(`
470
+ <div class="xl-images">`+y.map($i).join(`
471
471
  `)+"</div>");let v="",w=e.getShapes?.();w?.length&&(v=`
472
- <div class="xl-shapes">`+w.map(Ga).join(`
472
+ <div class="xl-shapes">`+w.map(pi).join(`
473
473
  `)+"</div>");let k="",T=e.getWordArt?.();T?.length&&(k=`
474
- <div class="xl-wordarts">`+T.map(qa).join(`
474
+ <div class="xl-wordarts">`+T.map(ui).join(`
475
475
  `)+"</div>");let S="",D=e.getMathEquations?.();D?.length&&(S=`
476
- <div class="xl-math-equations">`+D.map(ti).join(`
476
+ <div class="xl-math-equations">`+D.map(bi).join(`
477
477
  `)+"</div>");let R="",A=e.getFormControls?.();A?.length&&(R=`
478
- <div class="xl-form-controls">`+A.map(ms).join(`
478
+ <div class="xl-form-controls">`+A.map(Rs).join(`
479
479
  `)+"</div>");let W=b+C+v+k+S+R,Q="</div>";return t.fullDocument===!1?x+W+Q:`<!DOCTYPE html>
480
480
  <html lang="en">
481
481
  <head>
@@ -551,8 +551,8 @@ ${x}${W}${Q}
551
551
  })();
552
552
  </script>
553
553
  </body>
554
- </html>`}function oi(e,t={}){let o=e.getSheets(),n=e.getSheetNames(),s=t.sheets??n,r=t.includeTabs!==!1;t.evaluateFormulas&&new me().calculateWorkbook(e);let a=[];for(let m=0;m<o.length;m++){if(!s.includes(n[m]))continue;if(o[m]._isChartSheet){let d=o[m].getCharts();if(d.length){let f=cs(d[0],o[m]);a.push({name:n[m],html:`<div class="xl-sheet-wrapper" style="position:relative;display:inline-block">${f}</div>`})}continue}if(o[m]._isDialogSheet){let d=o[m].getFormControls?.()??[];if(d.length){let f=d.map(ms).join(`
555
- `);a.push({name:n[m],html:`<div class="xl-sheet-wrapper" style="position:relative;display:inline-block;min-width:400px;min-height:300px"><div class="xl-form-controls">${f}</div></div>`})}else a.push({name:n[m],html:'<div class="xl-sheet-wrapper"><p>Dialog Sheet</p></div>'});continue}let c=ln(o[m],{...t,fullDocument:!1,sheetName:n[m]});a.push({name:n[m],html:c})}if(a.length===1&&!r)return ln(o[0],t);let i=I(t.title??"Workbook Export"),l=a.map((m,c)=>`<button class="tab${c===0?" active":""}" onclick="switchTab(${c})">${I(m.name)}</button>`).join(""),h=a.map((m,c)=>`<div class="panel${c===0?" active":""}" id="panel-${c}">${m.html}</div>`).join(`
554
+ </html>`}function Fi(e,t={}){let o=e.getSheets(),n=e.getSheetNames(),s=t.sheets??n,r=t.includeTabs!==!1;t.evaluateFormulas&&new de().calculateWorkbook(e);let a=[];for(let m=0;m<o.length;m++){if(!s.includes(n[m]))continue;if(o[m]._isChartSheet){let d=o[m].getCharts();if(d.length){let f=As(d[0],o[m]);a.push({name:n[m],html:`<div class="xl-sheet-wrapper" style="position:relative;display:inline-block">${f}</div>`})}continue}if(o[m]._isDialogSheet){let d=o[m].getFormControls?.()??[];if(d.length){let f=d.map(Rs).join(`
555
+ `);a.push({name:n[m],html:`<div class="xl-sheet-wrapper" style="position:relative;display:inline-block;min-width:400px;min-height:300px"><div class="xl-form-controls">${f}</div></div>`})}else a.push({name:n[m],html:'<div class="xl-sheet-wrapper"><p>Dialog Sheet</p></div>'});continue}let c=yn(o[m],{...t,fullDocument:!1,sheetName:n[m]});a.push({name:n[m],html:c})}if(a.length===1&&!r)return yn(o[0],t);let i=I(t.title??"Workbook Export"),l=a.map((m,c)=>`<button class="tab${c===0?" active":""}" onclick="switchTab(${c})">${I(m.name)}</button>`).join(""),h=a.map((m,c)=>`<div class="panel${c===0?" active":""}" id="panel-${c}">${m.html}</div>`).join(`
556
556
  `);return`<!DOCTYPE html>
557
557
  <html lang="en">
558
558
  <head>
@@ -643,17 +643,17 @@ function positionOverlays() {
643
643
  positionOverlays();
644
644
  </script>
645
645
  </body>
646
- </html>`}var Ce={letter:[612,792],legal:[612,1008],a4:[595.28,841.89],a3:[841.89,1190.55],tabloid:[792,1224]},ni=["#000000","#FFFFFF","#44546A","#E7E6E6","#4472C4","#ED7D31","#A5A5A5","#FFC000","#5B9BD5","#70AD47"],si=[278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584],ri=[278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584];function re(e,t,o){let n=o?ri:si,s=0;for(let r=0;r<e.length;r++){let a=e.charCodeAt(r);s+=a>=32&&a<=126?n[a-32]:500}return s/1e3*t}function ai(e){if(!e)return"";if(e.startsWith("#"))return e;if(e.startsWith("theme:")){let t=parseInt(e.slice(6),10);return ni[t]??"#000000"}return e.length===8&&!e.startsWith("#")?"#"+e.slice(2):"#"+e}function ii(e){let t=e.replace("#","");return[parseInt(t.slice(0,2),16)/255,parseInt(t.slice(2,4),16)/255,parseInt(t.slice(4,6),16)/255]}function be(e){let t=ai(e);return t?ii(t):null}function li(e,t){if(e==null)return"";if(!t||t==="General")return String(e);let o=typeof e=="number"?e:parseFloat(String(e));if(isNaN(o))return String(e);if(t.includes("%")){let r=(t.match(/0\.(0+)%/)??[])[1]?.length??0;return(o*100).toFixed(r)+"%"}let n=t.match(/[$€£¥]|"CHF"/);if(n){let r=n[0].replace(/"/g,""),a=(t.match(/\.(0+)/)??[])[1]?.length??2,i=Math.abs(o).toFixed(a).replace(/\B(?=(\d{3})+(?!\d))/g,",");return t.indexOf(n[0])<t.indexOf("0")?(o<0?"-":"")+r+i:(o<0?"-":"")+i+" "+r}if(t.includes("#,##0")||t.includes("#,###")){let r=(t.match(/\.(0+)/)??[])[1]?.length??0;return o.toFixed(r).replace(/\B(?=(\d{3})+(?!\d))/g,",")}let s=t.match(/^0\.(0+)$/);if(s)return o.toFixed(s[1].length);if(/[ymdh]/i.test(t))return ci(o,t);if(/0\.0+E\+0+/i.test(t)){let r=(t.match(/0\.(0+)/)??[])[1]?.length??2;return o.toExponential(r).toUpperCase()}return String(e)}function ci(e,t){let o=new Date(1899,11,30),n=new Date(o.getTime()+e*864e5),s=n.getFullYear(),r=n.getMonth()+1,a=n.getDate(),i=n.getHours(),l=n.getMinutes(),h=n.getSeconds();return t.replace(/yyyy/gi,String(s)).replace(/yy/gi,String(s).slice(-2)).replace(/mmmm/gi,n.toLocaleDateString("en",{month:"long"})).replace(/mmm/gi,n.toLocaleDateString("en",{month:"short"})).replace(/mm/gi,String(r).padStart(2,"0")).replace(/m/gi,String(r)).replace(/dd/gi,String(a).padStart(2,"0")).replace(/d/gi,String(a)).replace(/hh/gi,String(i).padStart(2,"0")).replace(/h/gi,String(i)).replace(/ss/gi,String(h).padStart(2,"0")).replace(/nn|MM/g,String(l).padStart(2,"0"))}function io(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")}function O(e){return+e.toFixed(4)+""}var ze=new TextEncoder,lo=class{constructor(){this.objects=[null],this.streams=[null]}alloc(){return this.objects.push(null),this.streams.push(null),this.objects.length-1}set(t,o,n){for(;this.objects.length<=t;)this.objects.push(null),this.streams.push(null);this.objects[t]=o,this.streams[t]=n??null}add(t,o){let n=this.alloc();return this.set(n,t,o),n}addDeflated(t,o){let n=Qo(o,6),s=new Uint8Array(2+n.length+4);s[0]=120,s[1]=156,s.set(n,2);let r=1,a=0;for(let m=0;m<o.length;m++)r=(r+o[m])%65521,a=(a+r)%65521;let i=(a<<16|r)>>>0,l=2+n.length;s[l]=i>>>24&255,s[l+1]=i>>>16&255,s[l+2]=i>>>8&255,s[l+3]=i&255;let h=`${t}/Filter/FlateDecode/Length ${s.length}>>`;return this.add(h,s)}build(t,o){let n=[],s=f=>n.push(ze.encode(f)),r=f=>n.push(f);s(`%PDF-1.4
646
+ </html>`}Wt();var ve={letter:[612,792],legal:[612,1008],a4:[595.28,841.89],a3:[841.89,1190.55],tabloid:[792,1224]},vi=["#000000","#FFFFFF","#44546A","#E7E6E6","#4472C4","#ED7D31","#A5A5A5","#FFC000","#5B9BD5","#70AD47"],Si=[278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584],Ii=[278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584];function ae(e,t,o){let n=o?Ii:Si,s=0;for(let r=0;r<e.length;r++){let a=e.charCodeAt(r);s+=a>=32&&a<=126?n[a-32]:500}return s/1e3*t}function Ti(e){if(!e)return"";if(e.startsWith("#"))return e;if(e.startsWith("theme:")){let t=parseInt(e.slice(6),10);return vi[t]??"#000000"}return e.length===8&&!e.startsWith("#")?"#"+e.slice(2):"#"+e}function ki(e){let t=e.replace("#","");return[parseInt(t.slice(0,2),16)/255,parseInt(t.slice(2,4),16)/255,parseInt(t.slice(4,6),16)/255]}function Fe(e){let t=Ti(e);return t?ki(t):null}function Ai(e,t){if(e==null)return"";if(!t||t==="General")return String(e);let o=typeof e=="number"?e:parseFloat(String(e));if(isNaN(o))return String(e);if(t.includes("%")){let r=(t.match(/0\.(0+)%/)??[])[1]?.length??0;return(o*100).toFixed(r)+"%"}let n=t.match(/[$€£¥]|"CHF"/);if(n){let r=n[0].replace(/"/g,""),a=(t.match(/\.(0+)/)??[])[1]?.length??2,i=Math.abs(o).toFixed(a).replace(/\B(?=(\d{3})+(?!\d))/g,",");return t.indexOf(n[0])<t.indexOf("0")?(o<0?"-":"")+r+i:(o<0?"-":"")+i+" "+r}if(t.includes("#,##0")||t.includes("#,###")){let r=(t.match(/\.(0+)/)??[])[1]?.length??0;return o.toFixed(r).replace(/\B(?=(\d{3})+(?!\d))/g,",")}let s=t.match(/^0\.(0+)$/);if(s)return o.toFixed(s[1].length);if(/[ymdh]/i.test(t))return Di(o,t);if(/0\.0+E\+0+/i.test(t)){let r=(t.match(/0\.(0+)/)??[])[1]?.length??2;return o.toExponential(r).toUpperCase()}return String(e)}function Di(e,t){let o=new Date(1899,11,30),n=new Date(o.getTime()+e*864e5),s=n.getFullYear(),r=n.getMonth()+1,a=n.getDate(),i=n.getHours(),l=n.getMinutes(),h=n.getSeconds();return t.replace(/yyyy/gi,String(s)).replace(/yy/gi,String(s).slice(-2)).replace(/mmmm/gi,n.toLocaleDateString("en",{month:"long"})).replace(/mmm/gi,n.toLocaleDateString("en",{month:"short"})).replace(/mm/gi,String(r).padStart(2,"0")).replace(/m/gi,String(r)).replace(/dd/gi,String(a).padStart(2,"0")).replace(/d/gi,String(a)).replace(/hh/gi,String(i).padStart(2,"0")).replace(/h/gi,String(i)).replace(/ss/gi,String(h).padStart(2,"0")).replace(/nn|MM/g,String(l).padStart(2,"0"))}function lo(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")}function O(e){return+e.toFixed(4)+""}var qe=new TextEncoder,co=class{constructor(){this.objects=[null],this.streams=[null]}alloc(){return this.objects.push(null),this.streams.push(null),this.objects.length-1}set(t,o,n){for(;this.objects.length<=t;)this.objects.push(null),this.streams.push(null);this.objects[t]=o,this.streams[t]=n??null}add(t,o){let n=this.alloc();return this.set(n,t,o),n}addDeflated(t,o){let n=Yo(o,6),s=new Uint8Array(2+n.length+4);s[0]=120,s[1]=156,s.set(n,2);let r=1,a=0;for(let m=0;m<o.length;m++)r=(r+o[m])%65521,a=(a+r)%65521;let i=(a<<16|r)>>>0,l=2+n.length;s[l]=i>>>24&255,s[l+1]=i>>>16&255,s[l+2]=i>>>8&255,s[l+3]=i&255;let h=`${t}/Filter/FlateDecode/Length ${s.length}>>`;return this.add(h,s)}build(t,o){let n=[],s=f=>n.push(qe.encode(f)),r=f=>n.push(f);s(`%PDF-1.4
647
647
  %\xE2\xE3\xCF\xD3
648
648
  `);let a=0,i=new Array(this.objects.length).fill(0);for(let f of n)a+=f.length;let l=[];for(let f=1;f<this.objects.length;f++){let p=this.objects[f];if(!p)continue;let g=[],u=this.streams[f];i[f]=a;let $=`${f} 0 obj
649
- `;if(g.push(ze.encode($)),a+=$.length,u){let x=p+`
649
+ `;if(g.push(qe.encode($)),a+=$.length,u){let x=p+`
650
650
  stream
651
- `;g.push(ze.encode(x)),a+=x.length,g.push(u),a+=u.length;let b=`
651
+ `;g.push(qe.encode(x)),a+=x.length,g.push(u),a+=u.length;let b=`
652
652
  endstream
653
653
  endobj
654
- `;g.push(ze.encode(b)),a+=b.length}else{let x=p+`
654
+ `;g.push(qe.encode(b)),a+=b.length}else{let x=p+`
655
655
  endobj
656
- `;g.push(ze.encode(x)),a+=x.length}l.push(g)}for(let f of l)for(let p of f)r(p);let h=a;s(`xref
656
+ `;g.push(qe.encode(x)),a+=x.length}l.push(g)}for(let f of l)for(let p of f)r(p);let h=a;s(`xref
657
657
  0 ${this.objects.length}
658
658
  `),s(`0000000000 65535 f
659
659
  `);for(let f=1;f<this.objects.length;f++)s(`${String(i[f]).padStart(10,"0")} 00000 n
@@ -662,9 +662,9 @@ endobj
662
662
  startxref
663
663
  ${h}
664
664
  %%EOF
665
- `);let m=0;for(let f of n)m+=f.length;let c=new Uint8Array(m),d=0;for(let f of n)c.set(f,d),d+=f.length;return c}},Re=class{constructor(){this._parts=[]}raw(t){return this._parts.push(t),this}gsave(){return this._parts.push("q"),this}grestore(){return this._parts.push("Q"),this}fillColor(t,o,n){return this._parts.push(`${O(t)} ${O(o)} ${O(n)} rg`),this}strokeColor(t,o,n){return this._parts.push(`${O(t)} ${O(o)} ${O(n)} RG`),this}lineWidth(t){return this._parts.push(`${O(t)} w`),this}dash(t,o){return this._parts.push(`[${t.map(O).join(" ")}] ${O(o)} d`),this}noDash(){return this._parts.push("[] 0 d"),this}fillRect(t,o,n,s){return this._parts.push(`${O(t)} ${O(o)} ${O(n)} ${O(s)} re f`),this}strokeRect(t,o,n,s){return this._parts.push(`${O(t)} ${O(o)} ${O(n)} ${O(s)} re S`),this}line(t,o,n,s){return this._parts.push(`${O(t)} ${O(o)} m ${O(n)} ${O(s)} l S`),this}beginText(){return this._parts.push("BT"),this}endText(){return this._parts.push("ET"),this}font(t,o){return this._parts.push(`/${t} ${O(o)} Tf`),this}textPos(t,o){return this._parts.push(`${O(t)} ${O(o)} Td`),this}showText(t){return this._parts.push(`(${io(t)}) Tj`),this}drawImage(t,o,n,s,r){return this.gsave(),this._parts.push(`${O(s)} 0 0 ${O(r)} ${O(o)} ${O(n)} cm`),this._parts.push(`/${t} Do`),this.grestore(),this}clipRect(t,o,n,s){return this._parts.push(`${O(t)} ${O(o)} ${O(n)} ${O(s)} re W n`),this}toBytes(){return ze.encode(this._parts.join(`
665
+ `);let m=0;for(let f of n)m+=f.length;let c=new Uint8Array(m),d=0;for(let f of n)c.set(f,d),d+=f.length;return c}},Me=class{constructor(){this._parts=[]}raw(t){return this._parts.push(t),this}gsave(){return this._parts.push("q"),this}grestore(){return this._parts.push("Q"),this}fillColor(t,o,n){return this._parts.push(`${O(t)} ${O(o)} ${O(n)} rg`),this}strokeColor(t,o,n){return this._parts.push(`${O(t)} ${O(o)} ${O(n)} RG`),this}lineWidth(t){return this._parts.push(`${O(t)} w`),this}dash(t,o){return this._parts.push(`[${t.map(O).join(" ")}] ${O(o)} d`),this}noDash(){return this._parts.push("[] 0 d"),this}fillRect(t,o,n,s){return this._parts.push(`${O(t)} ${O(o)} ${O(n)} ${O(s)} re f`),this}strokeRect(t,o,n,s){return this._parts.push(`${O(t)} ${O(o)} ${O(n)} ${O(s)} re S`),this}line(t,o,n,s){return this._parts.push(`${O(t)} ${O(o)} m ${O(n)} ${O(s)} l S`),this}beginText(){return this._parts.push("BT"),this}endText(){return this._parts.push("ET"),this}font(t,o){return this._parts.push(`/${t} ${O(o)} Tf`),this}textPos(t,o){return this._parts.push(`${O(t)} ${O(o)} Td`),this}showText(t){return this._parts.push(`(${lo(t)}) Tj`),this}drawImage(t,o,n,s,r){return this.gsave(),this._parts.push(`${O(s)} 0 0 ${O(r)} ${O(o)} ${O(n)} cm`),this._parts.push(`/${t} Do`),this.grestore(),this}clipRect(t,o,n,s){return this._parts.push(`${O(t)} ${O(o)} ${O(n)} ${O(s)} re W n`),this}toBytes(){return qe.encode(this._parts.join(`
666
666
  `)+`
667
- `)}};function hi(e){return e?{thin:.5,medium:1,thick:1.5,dashed:.5,dotted:.5,double:1.5,hair:.25,mediumDashed:1,dashDot:.5,mediumDashDot:1,dashDotDot:.5,mediumDashDotDot:1,slantDashDot:1}[e]??.5:0}function mi(e){return e?{dashed:[3,2],dotted:[1,1],mediumDashed:[4,2],dashDot:[3,1,1,1],mediumDashDot:[4,1,1,1],dashDotDot:[3,1,1,1,1,1],mediumDashDotDot:[4,1,1,1,1,1],slantDashDot:[4,1,2,1]}[e]??null:null}function ds(e){if(e[0]!==255||e[1]!==216)return null;let t=2;for(;t<e.length-1&&e[t]===255;){let o=e[t+1];if(o===217||o===218)break;let n=e[t+2]<<8|e[t+3];if(o===192||o===193||o===194){let s=e[t+5]<<8|e[t+6];return{width:e[t+7]<<8|e[t+8],height:s}}t+=2+n}return null}function us(e,t={}){let o=e.getUsedRange();if(!o)return bs(t);let{startRow:n,startCol:s,endRow:r,endCol:a}=o;if(t.printAreaOnly&&e.printArea){let j=e.printArea.match(/^'?[^']*'?!?\$?([A-Z]+)\$?(\d+):\$?([A-Z]+)\$?(\d+)$/);j&&(s=qt(j[1]),n=parseInt(j[2],10),a=qt(j[3]),r=parseInt(j[4],10))}let i=e.pageSetup,l=e.pageMargins,h=t.paperSize??(i?.paperSize?$s(i.paperSize):"a4"),m=t.orientation??i?.orientation??"portrait",[c,d]=Ce[h]??Ce.a4,f=m==="landscape"?d:c,p=m==="landscape"?c:d,g={top:(t.margins?.top??l?.top??.75)*72,bottom:(t.margins?.bottom??l?.bottom??.75)*72,left:(t.margins?.left??l?.left??.7)*72,right:(t.margins?.right??l?.right??.7)*72},u=f-g.left-g.right,$=p-g.top-g.bottom,x=t.defaultFontSize??10,b=t.gridLines!==!1,C=t.headings===!0,y=t.repeatRows??0,v=t.headerText??e.headerFooter?.oddHeader,w=t.footerText??e.headerFooter?.oddFooter,k=C?30:0,T=[],S=[];for(let j=s;j<=a;j++){let et=e.getColumn(j);if(t.skipHidden&&et?.hidden)continue;T.push(j);let L=et?.width?et.width*6:48;S.push(L)}let D=S.reduce((j,et)=>j+et,0)+k,R=t.scale??1;t.fitToWidth!==!1&&D*R>u&&(R=u/D),R=Math.max(.1,Math.min(2,R));let A=[],W=[];for(let j=n;j<=r;j++){let et=e.getRow(j);if(t.skipHidden&&et?.hidden)continue;A.push(j);let L=et?.height??x+6;W.push(L)}let Q=e.getMerges(),q=new Map;for(let j of Q){let et=j.endRow-j.startRow+1,L=j.endCol-j.startCol+1;q.set(`${j.startRow},${j.startCol}`,{rowSpan:et,colSpan:L});for(let $t=j.startRow;$t<=j.endRow;$t++)for(let ot=j.startCol;ot<=j.endCol;ot++)($t!==j.startRow||ot!==j.startCol)&&q.set(`${$t},${ot}`,"skip")}let E=new Map,_=e.getSparklines?.()??[];for(let j of _){let et=j.location.match(/^([A-Z]+)(\d+)$/);et&&E.set(`${parseInt(et[2],10)},${qt(et[1])}`,j)}let M=new Map,N=e.getCellImages?.()??[];for(let j of N)M.set(j.cell,j);t.evaluateFormulas&&new me().calculateSheet(e);let H=new Set;for(let j of e.getRowBreaks())H.add(j.id);let V=[],K=0,z=0,mt=A.slice(0,y).reduce((j,et,L)=>j+W[L]*R,0);for(let j=0;j<A.length;j++){let et=W[j]*R,L=$-(V.length>0?mt:0),$t=j>K&&H.has(A[j]);z+et>L&&j>K||$t?(V.push({rowStart:K,rowEnd:j-1}),K=j,z=mt+et):z+=et}K<A.length&&V.push({rowStart:K,rowEnd:A.length-1});let it=new lo,gt=it.alloc(),St=it.alloc(),J=it.add("<</Type/Font/Subtype/Type1/BaseFont/Helvetica/Encoding/WinAnsiEncoding>>"),G=it.add("<</Type/Font/Subtype/Type1/BaseFont/Helvetica-Bold/Encoding/WinAnsiEncoding>>"),X=it.add("<</Type/Font/Subtype/Type1/BaseFont/Helvetica-Oblique/Encoding/WinAnsiEncoding>>"),F=it.add("<</Type/Font/Subtype/Type1/BaseFont/Helvetica-BoldOblique/Encoding/WinAnsiEncoding>>"),P=e.getImages?.()??[],U=[],Y=0;for(let j of P){let et=typeof j.data=="string"?fs(j.data):j.data;if(j.format==="jpeg"||j.format==="png"){if(j.format==="jpeg"){let L=ds(et);if(!L)continue;let $t=`Im${++Y}`,ot=it.add(`<</Type/XObject/Subtype/Image/Width ${L.width}/Height ${L.height}/ColorSpace/DeviceRGB/BitsPerComponent 8/Filter/DCTDecode/Length ${et.length}>>`,et);U.push({id:ot,name:$t,width:L.width,height:L.height})}if(j.format==="png"){let L=ps(et,it);L&&(L.name=`Im${++Y}`,U.push(L))}}}let st=[];function ht(){let j=[...U.map(et=>({name:et.name,id:et.id})),...st];return j.length?"/XObject<<"+j.map(et=>`/${et.name} ${et.id} 0 R`).join("")+">>":""}let tt;if(t.title||t.author){let j=["/Producer(ExcelForge)"];t.title&&j.push(`/Title(${io(t.title)})`),t.author&&j.push(`/Author(${io(t.author)})`),tt=it.add(`<<${j.join("")}>>`)}let ft=[];for(let j=0;j<V.length;j++){let et=V[j],L=new Re;R!==1&&(L.gsave(),L.raw(`${O(R)} 0 0 ${O(R)} ${O(g.left*(1-R))} ${O(g.bottom*(1-R))} cm`));let $t=[];if(j>0&&y>0)for(let Z=0;Z<Math.min(y,A.length);Z++)$t.push({sheetRow:A[Z],height:W[Z],ri:Z});for(let Z=et.rowStart;Z<=et.rowEnd;Z++)$t.push({sheetRow:A[Z],height:W[Z],ri:Z});let ot=p-g.top;for(let Z of $t){let yt=Z.height*R,nt=g.left;if(C){L.gsave(),L.fillColor(.9,.9,.9),L.fillRect(nt,ot-yt,k*R,yt),L.strokeColor(.7,.7,.7).lineWidth(.25),L.strokeRect(nt,ot-yt,k*R,yt),L.fillColor(.3,.3,.3),L.beginText().font("F1",7*R);let dt=String(Z.sheetRow),pt=re(dt,7,!1)*R;L.textPos(nt+(k*R-pt)/2,ot-yt+(yt-7*R)/2+1),L.showText(dt).endText(),L.grestore(),nt+=k*R}for(let dt=0;dt<T.length;dt++){let pt=T[dt],Rt=S[dt]*R,Ee=`${Z.sheetRow},${pt}`,ue=q.get(Ee);if(ue==="skip"){nt+=Rt;continue}let Wt=Rt,_t=yt;if(ue&&typeof ue!="string"){Wt=0;for(let It=0;It<ue.colSpan;It++){let Dt=T.indexOf(pt+It);Dt>=0&&(Wt+=S[Dt]*R)}_t=0;for(let It=0;It<ue.rowSpan;It++){let Dt=A.indexOf(Z.sheetRow+It);Dt>=0&&(_t+=W[Dt]*R)}}let Qe=e.getCell(Z.sheetRow,pt),Xt=Qe.style;if(Xt?.fill&&Xt.fill.type==="pattern"){let It=Xt.fill;if(It.pattern==="solid"&&It.fgColor){let Dt=be(It.fgColor);Dt&&(L.gsave(),L.fillColor(Dt[0],Dt[1],Dt[2]),L.fillRect(nt,ot-_t,Wt,_t),L.grestore())}}b&&!Xt?.border&&(L.gsave(),L.strokeColor(.82,.82,.82).lineWidth(.25),L.strokeRect(nt,ot-_t,Wt,_t),L.grestore()),Xt?.border&&(L.gsave(),xs(L,Xt.border,nt,ot-_t,Wt,_t),L.grestore());let ge=gs(Qe,Xt);if(ge){L.gsave(),L.clipRect(nt+1,ot-_t,Wt-2,_t);let It=(Xt?.font?.size??x)*R,Dt=Xt?.font?.bold??!1,ie=Xt?.font?.italic??!1,ve=Dt&&ie?"F4":Dt?"F2":ie?"F3":"F1",Vt=be(Xt?.font?.color)??[0,0,0];L.fillColor(Vt[0],Vt[1],Vt[2]);let zt=re(ge,It/R,Dt)*R,je=Xt?.alignment?.horizontal??(typeof Qe.value=="number"?"right":"left"),Ps=Xt?.alignment?.vertical??"bottom",$e,po=2*R;switch(je){case"center":case"fill":case"justify":case"distributed":$e=nt+(Wt-zt)/2;break;case"right":$e=nt+Wt-zt-po;break;default:$e=nt+po+(Xt?.alignment?.indent??0)*6*R;break}let Se;switch(Ps){case"top":Se=ot-It-po;break;case"center":case"distributed":Se=ot-_t/2-It*.35;break;default:Se=ot-_t+po;break}if(L.beginText().font(ve,It).textPos($e,Se).showText(ge).endText(),Xt?.font?.underline&&Xt.font.underline!=="none"&&(L.strokeColor(Vt[0],Vt[1],Vt[2]),L.lineWidth(It*.05),L.line($e,Se-It*.15,$e+zt,Se-It*.15)),Xt?.font?.strike){L.strokeColor(Vt[0],Vt[1],Vt[2]),L.lineWidth(It*.05);let pn=Se+It*.3;L.line($e,pn,$e+zt,pn)}L.grestore()}let Be=`${Z.sheetRow},${pt}`,xe=E.get(Be);if(xe){let It=ys(e,xe.dataRange);It.length&&ws(L,xe,It,nt,ot-_t,Wt,_t)}let Rs=`${Ut(pt)}${Z.sheetRow}`,_e=M.get(Rs);if(_e){let It=typeof _e.data=="string"?fs(_e.data):_e.data;if(_e.format==="jpeg"){let Dt=ds(It);if(Dt){let ie=`Ci${Z.sheetRow}_${pt}`,ve=it.add(`<</Type/XObject/Subtype/Image/Width ${Dt.width}/Height ${Dt.height}/ColorSpace/DeviceRGB/BitsPerComponent 8/Filter/DCTDecode/Length ${It.length}>>`,It);st.push({name:ie,id:ve});let Vt=Dt.width/Dt.height,zt=Wt-2,je=_t-2;zt/je>Vt?zt=je*Vt:je=zt/Vt,L.drawImage(ie,nt+1,ot-_t+1,zt,je)}}else if(_e.format==="png"){let Dt=ps(It,it);if(Dt){let ie=`Ci${Z.sheetRow}_${pt}`;Dt.name=ie,st.push({name:ie,id:Dt.id});let ve=Dt.width/Dt.height,Vt=Wt-2,zt=_t-2;Vt/zt>ve?Vt=zt*ve:zt=Vt/ve,L.drawImage(ie,nt+1,ot-_t+1,Vt,zt)}}}nt+=Rt}ot-=yt}if(C){let Z=p-g.top,yt=g.left+k*R;L.gsave();for(let nt=0;nt<T.length;nt++){let dt=S[nt]*R;L.fillColor(.9,.9,.9),L.fillRect(yt,Z,dt,14*R),L.strokeColor(.7,.7,.7).lineWidth(.25),L.strokeRect(yt,Z,dt,14*R),L.fillColor(.3,.3,.3);let pt=Ut(T[nt]),Rt=re(pt,7,!1)*R;L.beginText().font("F1",7*R),L.textPos(yt+(dt-Rt)/2,Z+3*R),L.showText(pt).endText(),yt+=dt}L.grestore()}for(let Z=0;Z<U.length;Z++){let yt=P[Z],nt=U[Z];if(!yt||!nt)continue;let dt=pi(yt,T,A,S,W,R,g,p,s,n);dt&&L.drawImage(nt.name,dt.x,dt.y,dt.w,dt.h)}let Ft=e.getFormControls?.()??[];for(let Z of Ft)cn(L,Z,T,A,S,W,R,g,p);if(v){let Z=Io(v,j+1,V.length);L.gsave(),L.fillColor(.3,.3,.3),L.beginText().font("F1",8);let yt=re(Z,8,!1);L.textPos(f/2-yt/2,p-g.top/2),L.showText(Z).endText(),L.grestore()}if(w){let Z=Io(w,j+1,V.length);L.gsave(),L.fillColor(.3,.3,.3),L.beginText().font("F1",8);let yt=re(Z,8,!1);L.textPos(f/2-yt/2,g.bottom/2),L.showText(Z).endText(),L.grestore()}R!==1&&L.grestore();let xt=L.toBytes(),at=it.addDeflated("<<",xt),bt=it.add(`<</Type/Page/Parent ${St} 0 R/MediaBox[0 0 ${O(f)} ${O(p)}]/Contents ${at} 0 R/Resources<</Font<</F1 ${J} 0 R/F2 ${G} 0 R/F3 ${X} 0 R/F4 ${F} 0 R>>`+ht()+">>>>");ft.push(bt)}return it.set(St,`<</Type/Pages/Kids[${ft.map(j=>`${j} 0 R`).join(" ")}]/Count ${ft.length}>>`),it.set(gt,`<</Type/Catalog/Pages ${St} 0 R>>`),it.build(gt,tt)}function di(e,t={}){let o=e.getSheets(),n=e.getSheetNames(),s=t.sheets??n;t.evaluateFormulas&&new me().calculateWorkbook(e);let r=o.filter((y,v)=>s.includes(n[v]));if(r.length===0)return bs(t);if(r.length===1&&!r[0]._isChartSheet&&!r[0]._isDialogSheet)return us(r[0],t);let a=new lo,i=a.alloc(),l=a.alloc(),h=a.add("<</Type/Font/Subtype/Type1/BaseFont/Helvetica/Encoding/WinAnsiEncoding>>"),m=a.add("<</Type/Font/Subtype/Type1/BaseFont/Helvetica-Bold/Encoding/WinAnsiEncoding>>"),c=a.add("<</Type/Font/Subtype/Type1/BaseFont/Helvetica-Oblique/Encoding/WinAnsiEncoding>>"),d=a.add("<</Type/Font/Subtype/Type1/BaseFont/Helvetica-BoldOblique/Encoding/WinAnsiEncoding>>"),f;if(t.title||t.author){let y=["/Producer(ExcelForge)"];t.title&&y.push(`/Title(${io(t.title)})`),t.author&&y.push(`/Author(${io(t.author)})`),f=a.add(`<<${y.join("")}>>`)}let p=[],g=t.paperSize??"a4",u=t.orientation??"portrait",[$,x]=Ce[g]??Ce.a4,b=u==="landscape"?x:$,C=u==="landscape"?$:x;for(let y of r)if(y._isChartSheet){let v=y.getCharts();if(v.length){let w=new Re;ui(w,v[0],y,40,40,b-80,C-80);let k=w.toBytes(),T=a.addDeflated("<<",k),S=a.add(`<</Type/Page/Parent ${l} 0 R/MediaBox[0 0 ${O(b)} ${O(C)}]/Contents ${T} 0 R/Resources<</Font<</F1 ${h} 0 R/F2 ${m} 0 R>>>>>>`);p.push(S)}}else if(y._isDialogSheet){let v=y.getFormControls?.()??[];if(v.length){let w=new Re,k={left:50,top:50},T=[1],S=[1],D=[48],R=[16];for(let q of v)cn(w,q,T,S,D,R,1,k,C);let A=w.toBytes(),W=a.addDeflated("<<",A),Q=a.add(`<</Type/Page/Parent ${l} 0 R/MediaBox[0 0 ${O(b)} ${O(C)}]/Contents ${W} 0 R/Resources<</Font<</F1 ${h} 0 R/F2 ${m} 0 R>>>>>>`);p.push(Q)}}else{let v=fi(y,t,a,h,m,c,d,l);p.push(...v)}return a.set(l,`<</Type/Pages/Kids[${p.map(y=>`${y} 0 R`).join(" ")}]/Count ${p.length}>>`),a.set(i,`<</Type/Catalog/Pages ${l} 0 R>>`),a.build(i,f)}function fi(e,t,o,n,s,r,a,i){let l=e.getUsedRange();if(!l)return[];let{startRow:h,startCol:m,endRow:c,endCol:d}=l;if(t.printAreaOnly&&e.printArea){let J=e.printArea.match(/^'?[^']*'?!?\$?([A-Z]+)\$?(\d+):\$?([A-Z]+)\$?(\d+)$/);J&&(m=qt(J[1]),h=parseInt(J[2],10),d=qt(J[3]),c=parseInt(J[4],10))}let f=e.pageSetup,p=e.pageMargins,g=t.paperSize??(f?.paperSize?$s(f.paperSize):"a4"),u=t.orientation??f?.orientation??"portrait",[$,x]=Ce[g]??Ce.a4,b=u==="landscape"?x:$,C=u==="landscape"?$:x,y={top:(t.margins?.top??p?.top??.75)*72,bottom:(t.margins?.bottom??p?.bottom??.75)*72,left:(t.margins?.left??p?.left??.7)*72,right:(t.margins?.right??p?.right??.7)*72},v=b-y.left-y.right,w=C-y.top-y.bottom,k=t.defaultFontSize??10,T=t.gridLines!==!1,S=t.repeatRows??0,D=t.headerText??e.headerFooter?.oddHeader,R=t.footerText??e.headerFooter?.oddFooter,A=[],W=[];for(let J=m;J<=d;J++){let G=e.getColumn(J);t.skipHidden&&G?.hidden||(A.push(J),W.push(G?.width?G.width*6:48))}let Q=W.reduce((J,G)=>J+G,0),q=t.scale??1;t.fitToWidth!==!1&&Q*q>v&&(q=v/Q),q=Math.max(.1,Math.min(2,q));let E=[],_=[];for(let J=h;J<=c;J++){let G=e.getRow(J);t.skipHidden&&G?.hidden||(E.push(J),_.push(G?.height??k+6))}let M=e.getMerges(),N=new Map;for(let J of M){N.set(`${J.startRow},${J.startCol}`,{rowSpan:J.endRow-J.startRow+1,colSpan:J.endCol-J.startCol+1});for(let G=J.startRow;G<=J.endRow;G++)for(let X=J.startCol;X<=J.endCol;X++)(G!==J.startRow||X!==J.startCol)&&N.set(`${G},${X}`,"skip")}let H=new Map;for(let J of e.getSparklines?.()??[]){let G=J.location.match(/^([A-Z]+)(\d+)$/);G&&H.set(`${parseInt(G[2],10)},${qt(G[1])}`,J)}let V=new Map;for(let J of e.getCellImages?.()??[])V.set(J.cell,J);let K=new Set;for(let J of e.getRowBreaks())K.add(J.id);let z=[],mt=0,it=0,gt=E.slice(0,S).reduce((J,G,X)=>J+_[X]*q,0);for(let J=0;J<E.length;J++){let G=_[J]*q,X=w-(z.length>0?gt:0),F=J>mt&&K.has(E[J]);it+G>X&&J>mt||F?(z.push({rowStart:mt,rowEnd:J-1}),mt=J,it=gt+G):it+=G}mt<E.length&&z.push({rowStart:mt,rowEnd:E.length-1});let St=[];for(let J=0;J<z.length;J++){let G=z[J],X=new Re,F=[];if(J>0&&S>0)for(let tt=0;tt<Math.min(S,E.length);tt++)F.push({sheetRow:E[tt],height:_[tt]});for(let tt=G.rowStart;tt<=G.rowEnd;tt++)F.push({sheetRow:E[tt],height:_[tt]});let P=C-y.top;for(let tt of F){let ft=tt.height*q,j=y.left;for(let et=0;et<A.length;et++){let L=A[et],$t=W[et]*q,ot=`${tt.sheetRow},${L}`,Ft=N.get(ot);if(Ft==="skip"){j+=$t;continue}let xt=$t,at=ft;if(Ft&&typeof Ft!="string"){xt=0;for(let pt=0;pt<Ft.colSpan;pt++){let Rt=A.indexOf(L+pt);Rt>=0&&(xt+=W[Rt]*q)}at=0;for(let pt=0;pt<Ft.rowSpan;pt++){let Rt=E.indexOf(tt.sheetRow+pt);Rt>=0&&(at+=_[Rt]*q)}}let bt=e.getCell(tt.sheetRow,L),Z=bt.style;if(Z?.fill&&Z.fill.type==="pattern"){let pt=Z.fill;if(pt.pattern==="solid"&&pt.fgColor){let Rt=be(pt.fgColor);Rt&&(X.gsave(),X.fillColor(Rt[0],Rt[1],Rt[2]),X.fillRect(j,P-at,xt,at),X.grestore())}}T&&!Z?.border&&(X.gsave(),X.strokeColor(.82,.82,.82).lineWidth(.25),X.strokeRect(j,P-at,xt,at),X.grestore()),Z?.border&&(X.gsave(),xs(X,Z.border,j,P-at,xt,at),X.grestore());let yt=gs(bt,Z);if(yt){X.gsave(),X.clipRect(j+1,P-at,xt-2,at);let pt=(Z?.font?.size??k)*q,Rt=Z?.font?.bold??!1,Ee=Z?.font?.italic??!1,ue=Rt&&Ee?"F4":Rt?"F2":Ee?"F3":"F1",Wt=be(Z?.font?.color)??[0,0,0];X.fillColor(Wt[0],Wt[1],Wt[2]);let _t=re(yt,pt/q,Rt)*q,Qe=Z?.alignment?.horizontal??(typeof bt.value=="number"?"right":"left"),Xt=Z?.alignment?.vertical??"bottom",ge=2*q,Be;switch(Qe){case"center":case"fill":case"justify":case"distributed":Be=j+(xt-_t)/2;break;case"right":Be=j+xt-_t-ge;break;default:Be=j+ge+(Z?.alignment?.indent??0)*6*q;break}let xe;switch(Xt){case"top":xe=P-pt-ge;break;case"center":case"distributed":xe=P-at/2-pt*.35;break;default:xe=P-at+ge;break}X.beginText().font(ue,pt).textPos(Be,xe).showText(yt).endText(),X.grestore()}let nt=`${tt.sheetRow},${L}`,dt=H.get(nt);if(dt){let pt=ys(e,dt.dataRange);pt.length&&ws(X,dt,pt,j,P-at,xt,at)}j+=$t}P-=ft}let U=e.getFormControls?.()??[];for(let tt of U)cn(X,tt,A,E,W,_,q,y,C);if(D){let tt=Io(D,J+1,z.length);X.gsave().fillColor(.3,.3,.3);let ft=re(tt,8,!1);X.beginText().font("F1",8).textPos(b/2-ft/2,C-y.top/2).showText(tt).endText(),X.grestore()}if(R){let tt=Io(R,J+1,z.length);X.gsave().fillColor(.3,.3,.3);let ft=re(tt,8,!1);X.beginText().font("F1",8).textPos(b/2-ft/2,y.bottom/2).showText(tt).endText(),X.grestore()}let Y=X.toBytes(),st=o.addDeflated("<<",Y),ht=o.add(`<</Type/Page/Parent ${i} 0 R/MediaBox[0 0 ${O(b)} ${O(C)}]/Contents ${st} 0 R/Resources<</Font<</F1 ${n} 0 R/F2 ${s} 0 R/F3 ${r} 0 R/F4 ${a} 0 R>>>>>>`);St.push(ht)}return St}function gs(e,t){return e.richText?e.richText.map(o=>o.text).join(""):e.value==null?"":t?.numberFormat?li(e.value,t.numberFormat.formatCode):String(e.value)}function xs(e,t,o,n,s,r){let a=[[t.bottom,o,n,o+s,n],[t.top,o,n+r,o+s,n+r],[t.left,o,n,o,n+r],[t.right,o+s,n,o+s,n+r]];for(let[i,l,h,m,c]of a){if(!i?.style)continue;let d=hi(i.style),f=be(i.color)??[0,0,0];e.strokeColor(f[0],f[1],f[2]),e.lineWidth(d);let p=mi(i.style);p?e.dash(p,0):e.noDash(),e.line(l,h,m,c)}}function $s(e){return{1:"letter",5:"legal",9:"a4",8:"a3",3:"tabloid"}[e]??"a4"}function Io(e,t,o){let n=e.replace(/&[LCR]/g,"").replace(/&"[^"]*"/g,"").replace(/&\d+/g,"");return n=n.replace(/&P/gi,String(t)).replace(/&N/gi,String(o)).replace(/&D/gi,new Date().toLocaleDateString()).replace(/&T/gi,new Date().toLocaleTimeString()).replace(/&F/gi,"").replace(/&A/gi,""),n.trim()}function pi(e,t,o,n,s,r,a,i,l,h){if(e.position){let m=a.left+e.position.x*.75*r,c=i-a.top-e.position.y*.75*r,d=(e.width??100)*.75*r,f=(e.height??100)*.75*r;return{x:m,y:c-f,w:d,h:f}}if(e.from){let m=a.left;for(let g=0;g<t.length&&!(t[g]>=e.from.col);g++)m+=n[g]*r;let c=0;for(let g=0;g<o.length&&!(o[g]>=e.from.row);g++)c+=s[g]*r;let d=(e.width??100)*.75*r,f=(e.height??100)*.75*r,p=i-a.top-c;return{x:m,y:p-f,w:d,h:f}}return null}function fs(e){return le(e)}function ps(e,t){if(e[0]!==137||e[1]!==80||e[2]!==78||e[3]!==71)return null;let o=8,n=g=>(e[g]<<24|e[g+1]<<16|e[g+2]<<8|e[g+3])>>>0,s=n(o);o+=4;let r=String.fromCharCode(e[o],e[o+1],e[o+2],e[o+3]);if(o+=4,r!=="IHDR"||s!==13)return null;let a=n(o);o+=4;let i=n(o);o+=4;let l=e[o++],h=e[o++];if(o+=7,l!==8||h!==2&&h!==6)return null;let m=[];for(;o<e.length-4;){let g=n(o);o+=4;let u=String.fromCharCode(e[o],e[o+1],e[o+2],e[o+3]);if(o+=4,u==="IDAT"&&m.push(e.subarray(o,o+g)),u==="IEND")break;o+=g+4}if(!m.length)return null;let c=0;for(let g of m)c+=g.length;let d=new Uint8Array(c),f=0;for(let g of m)d.set(g,f),f+=g.length;let p=h===6?4:3;return h===2?{id:t.add(`<</Type/XObject/Subtype/Image/Width ${a}/Height ${i}/ColorSpace/DeviceRGB/BitsPerComponent 8/Filter/FlateDecode/DecodeParms<</Predictor 15/Colors 3/BitsPerComponent 8/Columns ${a}>>/Length ${d.length}>>`,d),name:"",width:a,height:i}:null}function ys(e,t){let o=[],s=(t.includes("!")?t.split("!")[1]:t).match(/^([A-Z]+)(\d+):([A-Z]+)(\d+)$/);if(s){let r=qt(s[1]),a=parseInt(s[2],10),i=qt(s[3]),l=parseInt(s[4],10);for(let h=a;h<=l;h++)for(let m=r;m<=i;m++){let c=e.getCell(h,m);typeof c.value=="number"&&o.push(c.value)}}return o}function ws(e,t,o,n,s,r,a){if(!o.length)return;let i=2,l=n+i,h=s+i,m=r-i*2,c=a-i*2,d=Math.min(...o),p=Math.max(...o)-d||1,g=be(t.color)??[.267,.447,.769];if(e.gsave(),e.clipRect(n,s,r,a),t.type==="bar"||t.type==="stacked"){let u=m/o.length;for(let $=0;$<o.length;$++){let x=o[$],b=Math.max(1,(x-d)/p*c),C=l+$*u+u*.1,y=h+(c-b),v=g;x<0&&t.negativeColor&&(v=be(t.negativeColor)??g),e.fillColor(v[0],v[1],v[2]),e.fillRect(C,y,u*.8,b)}}else{e.strokeColor(g[0],g[1],g[2]),e.lineWidth(t.lineWidth??1);let u=o.map(($,x)=>[l+x/(o.length-1||1)*m,h+($-d)/p*c]);if(u.length>=2){let $=`${O(u[0][0])} ${O(u[0][1])} m`;for(let x=1;x<u.length;x++)$+=` ${O(u[x][0])} ${O(u[x][1])} l`;e.raw($+" S")}if(t.showMarkers&&t.markersColor){let $=be(t.markersColor)??g;e.fillColor($[0],$[1],$[2]);for(let[x,b]of u)e.fillRect(x-1.5,b-1.5,3,3)}}e.grestore()}function cn(e,t,o,n,s,r,a,i,l){let h=i.left,m=0;for(let u=0;u<o.length&&!(o[u]>=t.from.col+1);u++)h+=s[u]*a;for(let u=0;u<n.length&&!(n[u]>=t.from.row+1);u++)m+=r[u]*a;let c=(t.width??80)*.75*a,d=(t.height??24)*.75*a,p=l-i.top-m-d,g=t.text??"";switch(e.gsave(),t.type){case"button":case"dialog":if(e.fillColor(.93,.93,.93),e.fillRect(h,p,c,d),e.strokeColor(.6,.6,.6).lineWidth(.5),e.strokeRect(h,p,c,d),g){e.fillColor(0,0,0);let u=Math.min(9*a,d*.6),$=re(g,u/a,!1)*a;e.beginText().font("F1",u).textPos(h+(c-$)/2,p+(d-u)/2).showText(g).endText()}break;case"checkBox":{e.strokeColor(.4,.4,.4).lineWidth(.5);let u=Math.min(d-2,10*a);if(e.strokeRect(h+2,p+(d-u)/2,u,u),t.checked==="checked"){e.strokeColor(0,0,0).lineWidth(1);let $=h+2,x=p+(d-u)/2;e.line($+2,x+u/2,$+u/2,x+2),e.line($+u/2,x+2,$+u-2,x+u-2)}if(g){e.fillColor(0,0,0);let $=Math.min(8*a,d*.7);e.beginText().font("F1",$).textPos(h+u+6,p+(d-$)/2).showText(g).endText()}break}case"optionButton":{let u=Math.min(d/2-1,5*a),$=h+2+u,x=p+d/2,b=.5523;if(e.strokeColor(.4,.4,.4).lineWidth(.5),e.raw(`${O($+u)} ${O(x)} m ${O($+u)} ${O(x+u*b)} ${O($+u*b)} ${O(x+u)} ${O($)} ${O(x+u)} c`),e.raw(`${O($-u*b)} ${O(x+u)} ${O($-u)} ${O(x+u*b)} ${O($-u)} ${O(x)} c`),e.raw(`${O($-u)} ${O(x-u*b)} ${O($-u*b)} ${O(x-u)} ${O($)} ${O(x-u)} c`),e.raw(`${O($+u*b)} ${O(x-u)} ${O($+u)} ${O(x-u*b)} ${O($+u)} ${O(x)} c S`),t.checked==="checked"){let C=u*.5;e.fillColor(0,0,0),e.raw(`${O($+C)} ${O(x)} m ${O($+C)} ${O(x+C*b)} ${O($+C*b)} ${O(x+C)} ${O($)} ${O(x+C)} c`),e.raw(`${O($-C*b)} ${O(x+C)} ${O($-C)} ${O(x+C*b)} ${O($-C)} ${O(x)} c`),e.raw(`${O($-C)} ${O(x-C*b)} ${O($-C*b)} ${O(x-C)} ${O($)} ${O(x-C)} c`),e.raw(`${O($+C*b)} ${O(x-C)} ${O($+C)} ${O(x-C*b)} ${O($+C)} ${O(x)} c f`)}if(g){e.fillColor(0,0,0);let C=Math.min(8*a,d*.7);e.beginText().font("F1",C).textPos(h+u*2+6,p+(d-C)/2).showText(g).endText()}break}case"label":case"groupBox":if(g){e.fillColor(0,0,0);let u=Math.min(9*a,d*.7);e.beginText().font("F1",u).textPos(h+2,p+(d-u)/2).showText(g).endText()}t.type==="groupBox"&&(e.strokeColor(.7,.7,.7).lineWidth(.5),e.strokeRect(h,p,c,d));break;case"comboBox":case"listBox":if(e.fillColor(1,1,1),e.fillRect(h,p,c,d),e.strokeColor(.7,.7,.7).lineWidth(.5),e.strokeRect(h,p,c,d),t.type==="comboBox"){let u=Math.min(16*a,c*.2);e.strokeRect(h+c-u,p,u,d);let $=h+c-u/2,x=p+d/2;e.fillColor(.3,.3,.3),e.raw(`${O($-3)} ${O(x+2)} m ${O($+3)} ${O(x+2)} l ${O($)} ${O(x-2)} l f`)}break;case"scrollBar":case"spinner":e.fillColor(.92,.92,.92),e.fillRect(h,p,c,d),e.strokeColor(.7,.7,.7).lineWidth(.5),e.strokeRect(h,p,c,d);break;default:if(e.strokeColor(.7,.7,.7).lineWidth(.5),e.strokeRect(h,p,c,d),g){e.fillColor(0,0,0);let u=Math.min(8*a,d*.7);e.beginText().font("F1",u).textPos(h+2,p+(d-u)/2).showText(g).endText()}}e.grestore()}var So=[[.267,.447,.769],[.929,.49,.192],[.647,.647,.647],[1,.753,0],[.357,.608,.835],[.439,.678,.278]];function ui(e,t,o,n,s,r,a){let l=n+10+30,h=s+10,m=r-20-40,c=a-20-20,d=[];for(let x=0;x<t.series.length;x++){let b=t.series[x],C=gi(o,b.values);d.push({name:b.name??`Series ${x+1}`,values:C,color:So[x%So.length]})}if(!d.length||!d[0].values.length)return;if(e.gsave(),t.title){e.fillColor(0,0,0);let x=10,b=re(t.title,x,!0);e.beginText().font("F2",x).textPos(n+(r-b)/2,s+a-8).showText(t.title).endText()}let f=t.type,p=d.flatMap(x=>x.values),g=Math.min(0,...p),$=Math.max(1,...p)-g||1;if(e.strokeColor(.5,.5,.5).lineWidth(.5),e.line(l,h,l,h+c),e.line(l,h,l+m,h),f==="pie"||f==="doughnut"){let x=n+r/2,b=s+a/2,C=Math.min(m,c)/2-5,y=d[0].values.filter(k=>k>0),v=y.reduce((k,T)=>k+T,0)||1,w=0;for(let k=0;k<y.length;k++){let T=y[k]/v*2*Math.PI,S=So[k%So.length];e.fillColor(S[0],S[1],S[2]),e.raw(`${O(x)} ${O(b)} m`);let D=Math.max(8,Math.ceil(T/.2));for(let R=0;R<=D;R++){let A=w+T*R/D;e.raw(`${O(x+C*Math.cos(A))} ${O(b+C*Math.sin(A))} l`)}e.raw("f"),w+=T}}else if(f.startsWith("bar")){let x=d[0].values.length,b=c/x;for(let C=0;C<x;C++)for(let y=0;y<d.length;y++){let w=((d[y].values[C]??0)-g)/$*m,k=h+C*b+b*.1,T=b*.8/d.length,S=d[y].color;e.fillColor(S[0],S[1],S[2]),e.fillRect(l,k+y*T,Math.max(0,w),T)}}else if(f.startsWith("column")||f==="stock"){let x=d[0].values.length,b=m/x;for(let C=0;C<x;C++)for(let y=0;y<d.length;y++){let w=((d[y].values[C]??0)-g)/$*c,k=l+C*b+b*.1,T=b*.8/d.length,S=d[y].color;e.fillColor(S[0],S[1],S[2]),e.fillRect(k+y*T,h,T,Math.max(0,w))}}else for(let x of d){let b=x.values.map((C,y)=>[l+y/(x.values.length-1||1)*m,h+(C-g)/$*c]);if(e.strokeColor(x.color[0],x.color[1],x.color[2]).lineWidth(1.5),b.length>=2){let C=`${O(b[0][0])} ${O(b[0][1])} m`;for(let y=1;y<b.length;y++)C+=` ${O(b[y][0])} ${O(b[y][1])} l`;f.startsWith("area")?(C+=` ${O(b[b.length-1][0])} ${O(h)} l ${O(b[0][0])} ${O(h)} l`,e.fillColor(x.color[0],x.color[1],x.color[2]),e.raw(C+" f")):e.raw(C+" S")}if(f.startsWith("scatter")||f==="bubble"){e.fillColor(x.color[0],x.color[1],x.color[2]);for(let[C,y]of b)e.fillRect(C-2,y-2,4,4)}}e.grestore()}function gi(e,t){let o=[],r=(t.includes("!")?t.split("!")[1]:t).replace(/\$/g,"").match(/^([A-Z]+)(\d+):([A-Z]+)(\d+)$/);if(!r)return o;let a=qt(r[1]),i=parseInt(r[2],10),l=qt(r[3]),h=parseInt(r[4],10);for(let m=i;m<=h;m++)for(let c=a;c<=l;c++){let d=e.getCell(m,c);o.push(typeof d.value=="number"?d.value:0)}return o}function bs(e){let t=new lo,o=t.alloc(),n=t.alloc(),s=e.paperSize??"a4",r=e.orientation??"portrait",[a,i]=Ce[s]??Ce.a4,l=r==="landscape"?i:a,h=r==="landscape"?a:i,m=t.add("<</Type/Font/Subtype/Type1/BaseFont/Helvetica>>"),c=new Re;c.beginText().font("F1",12).fillColor(.5,.5,.5),c.textPos(l/2-40,h/2),c.showText("Empty worksheet").endText();let d=c.toBytes(),f=t.addDeflated("<<",d),p=t.add(`<</Type/Page/Parent ${n} 0 R/MediaBox[0 0 ${O(l)} ${O(h)}]/Contents ${f} 0 R/Resources<</Font<</F1 ${m} 0 R>>>>>>`);return t.set(n,`<</Type/Pages/Kids[${p} 0 R]/Count 1>>`),t.set(o,`<</Type/Catalog/Pages ${n} 0 R>>`),t.build(o)}var hn=new Uint8Array([208,207,17,224,161,177,26,225]),Ht=4294967294,Fe=4294967295,xi=4294967293,ae=512,co=64,Cs=4096,Ao=128;function Pt(e,t,o){e[t]=o&255,e[t+1]=o>>8&255}function Ct(e,t,o){e[t]=o&255,e[t+1]=o>>8&255,e[t+2]=o>>16&255,e[t+3]=o>>24&255}function To(e,t){return e[t]|e[t+1]<<8}function se(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function $i(e){let t=new Uint8Array(64),o=Math.min(e.length,31);for(let n=0;n<o;n++)Pt(t,n*2,e.charCodeAt(n));return Pt(t,o*2,0),{bytes:t,size:(o+1)*2}}function Fs(e){for(let v=0;v<8;v++)if(e[v]!==hn[v])throw new Error("Not a CFB file");let o=1<<To(e,30),s=1<<To(e,32),r=se(e,56),a=se(e,44),i=se(e,48),l=se(e,60),h=v=>o+v*o,m=[];for(let v=0;v<109;v++){let w=se(e,76+v*4);if(w===Fe||w===Ht)break;m.push(w)}let c=[];for(let v of m){let w=h(v);for(let k=0;k<o/4;k++)c.push(se(e,w+k*4))}let d=v=>{let w=[],k=v;for(;k!==Ht&&k!==Fe&&w.length<1e4;)w.push(k),k=c[k]??Ht;return w},f=(v,w)=>{let k=d(v),T=new Uint8Array(w),S=0;for(let D of k){let R=h(D),A=Math.min(o,w-S);T.set(e.subarray(R,R+A),S),S+=A}return T},p=d(i),g=new Uint8Array(p.length*o);p.forEach((v,w)=>g.set(e.subarray(h(v),h(v)+o),w*o));let u=[];for(let v=0;v<g.length/Ao;v++){let w=v*Ao,k=To(g,w+64);if(k===0)continue;let T="";for(let S=0;S<(k-2)/2;S++)T+=String.fromCharCode(To(g,w+S*2));u.push({name:T,type:g[w+66],start:se(g,w+116),size:se(g,w+120),child:se(g,w+76)})}let $=u[0],x=new Uint8Array(0);$&&$.start!==Ht&&(x=new Uint8Array(f($.start,$.size)));let b=[];if(l!==Ht){let v=d(l);for(let w of v){let k=h(w);for(let T=0;T<o/4;T++)b.push(se(e,k+T*4))}}let C=(v,w)=>{let k=new Uint8Array(w),T=v,S=0;for(;T!==Ht&&S<w;){let D=T*s,R=Math.min(s,w-S);k.set(x.subarray(D,D+R),S),S+=R,T=b[T]??Ht}return k},y=[];for(let v=1;v<u.length;v++){let w=u[v];if(w.type!==2)continue;let k;w.size<r?k=C(w.start,w.size):k=f(w.start,w.size),y.push({name:w.name,data:k})}return y}function Me(){if(typeof globalThis.crypto<"u")return globalThis.crypto;throw new Error("Web Crypto API not available. Requires Node.js 18+ or a modern browser.")}function ho(e){return Me().getRandomValues(new Uint8Array(e))}async function pe(e){let t=await Me().subtle.digest("SHA-512",e);return new Uint8Array(t)}async function yi(e,t){let o=await Me().subtle.importKey("raw",e,{name:"HMAC",hash:"SHA-512"},!1,["sign"]),n=await Me().subtle.sign("HMAC",o,t);return new Uint8Array(n)}async function Ke(e,t,o,n,s){let r=new Uint8Array(e.length*2);for(let d=0;d<e.length;d++)r[d*2]=e.charCodeAt(d)&255,r[d*2+1]=e.charCodeAt(d)>>8&255;let a=new Uint8Array(t.length+r.length);a.set(t),a.set(r,t.length);let i=await pe(a);for(let d=0;d<o;d++){let f=new Uint8Array(4+i.length);f[0]=d&255,f[1]=d>>8&255,f[2]=d>>16&255,f[3]=d>>24&255,f.set(i,4),i=await pe(f)}let l=new Uint8Array(i.length+s.length);l.set(i),l.set(s,i.length);let h=await pe(l),m=n/8;if(h.length>=m)return h.subarray(0,m);let c=new Uint8Array(m);return c.set(h),c.fill(54,h.length),c}async function Ge(e,t,o){let n=await Me().subtle.importKey("raw",e,{name:"AES-CBC"},!1,["encrypt"]),s=await Me().subtle.encrypt({name:"AES-CBC",iv:t},n,o);return new Uint8Array(s).subarray(0,o.length)}async function ko(e,t,o){let n=Me().subtle,s=o.subarray(o.length-16),r=new Uint8Array(16).fill(16),a=new Uint8Array(16);for(let f=0;f<16;f++)a[f]=r[f]^s[f];let i=await n.importKey("raw",e,{name:"AES-CBC"},!1,["encrypt"]),l=await n.encrypt({name:"AES-CBC",iv:new Uint8Array(16)},i,a),h=new Uint8Array(l).subarray(0,16),m=fe(o,h),c=await n.importKey("raw",e,{name:"AES-CBC"},!1,["decrypt"]),d=await n.decrypt({name:"AES-CBC",iv:t},c,m);return new Uint8Array(d)}function qe(e,t){let o=e.length%t;if(o===0)return e;let n=new Uint8Array(e.length+(t-o));return n.set(e),n}function fe(...e){let t=0;for(let s of e)t+=s.length;let o=new Uint8Array(t),n=0;for(let s of e)o.set(s,n),n+=s.length;return o}var vs=new Uint8Array([254,167,210,118,59,75,158,121]),Ss=new Uint8Array([215,170,15,109,48,97,52,78]),Is=new Uint8Array([20,110,11,231,171,172,208,214]),wi=new Uint8Array([95,178,173,1,12,185,225,246]),bi=new Uint8Array([160,103,127,2,178,44,132,51]);function Ci(e,t,o,n,s,r,a,i){let l=h=>{let m="",c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let d=0;d<h.length;d+=3){let f=h[d],p=h[d+1]??0,g=h[d+2]??0,u=f<<16|p<<8|g;m+=c[u>>18&63]+c[u>>12&63],m+=d+1<h.length?c[u>>6&63]:"=",m+=d+2<h.length?c[u&63]:"="}return m};return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
667
+ `)}};function Ri(e){return e?{thin:.5,medium:1,thick:1.5,dashed:.5,dotted:.5,double:1.5,hair:.25,mediumDashed:1,dashDot:.5,mediumDashDot:1,dashDotDot:.5,mediumDashDotDot:1,slantDashDot:1}[e]??.5:0}function Pi(e){return e?{dashed:[3,2],dotted:[1,1],mediumDashed:[4,2],dashDot:[3,1,1,1],mediumDashDot:[4,1,1,1],dashDotDot:[3,1,1,1,1,1],mediumDashDotDot:[4,1,1,1,1,1],slantDashDot:[4,1,2,1]}[e]??null:null}function Ps(e){if(e[0]!==255||e[1]!==216)return null;let t=2;for(;t<e.length-1&&e[t]===255;){let o=e[t+1];if(o===217||o===218)break;let n=e[t+2]<<8|e[t+3];if(o===192||o===193||o===194){let s=e[t+5]<<8|e[t+6];return{width:e[t+7]<<8|e[t+8],height:s}}t+=2+n}return null}function Bs(e,t={}){let o=e.getUsedRange();if(!o)return Xs(t);let{startRow:n,startCol:s,endRow:r,endCol:a}=o;if(t.printAreaOnly&&e.printArea){let j=e.printArea.match(/^'?[^']*'?!?\$?([A-Z]+)\$?(\d+):\$?([A-Z]+)\$?(\d+)$/);j&&(s=Kt(j[1]),n=parseInt(j[2],10),a=Kt(j[3]),r=parseInt(j[4],10))}let i=e.pageSetup,l=e.pageMargins,h=t.paperSize??(i?.paperSize?Os(i.paperSize):"a4"),m=t.orientation??i?.orientation??"portrait",[c,d]=ve[h]??ve.a4,f=m==="landscape"?d:c,p=m==="landscape"?c:d,g={top:(t.margins?.top??l?.top??.75)*72,bottom:(t.margins?.bottom??l?.bottom??.75)*72,left:(t.margins?.left??l?.left??.7)*72,right:(t.margins?.right??l?.right??.7)*72},u=f-g.left-g.right,$=p-g.top-g.bottom,x=t.defaultFontSize??10,b=t.gridLines!==!1,C=t.headings===!0,y=t.repeatRows??0,v=t.headerText??e.headerFooter?.oddHeader,w=t.footerText??e.headerFooter?.oddFooter,k=C?30:0,T=[],S=[];for(let j=s;j<=a;j++){let et=e.getColumn(j);if(t.skipHidden&&et?.hidden)continue;T.push(j);let L=et?.width?et.width*6:48;S.push(L)}let D=S.reduce((j,et)=>j+et,0)+k,R=t.scale??1;t.fitToWidth!==!1&&D*R>u&&(R=u/D),R=Math.max(.1,Math.min(2,R));let A=[],W=[];for(let j=n;j<=r;j++){let et=e.getRow(j);if(t.skipHidden&&et?.hidden)continue;A.push(j);let L=et?.height??x+6;W.push(L)}let Q=e.getMerges(),q=new Map;for(let j of Q){let et=j.endRow-j.startRow+1,L=j.endCol-j.startCol+1;q.set(`${j.startRow},${j.startCol}`,{rowSpan:et,colSpan:L});for(let $t=j.startRow;$t<=j.endRow;$t++)for(let ot=j.startCol;ot<=j.endCol;ot++)($t!==j.startRow||ot!==j.startCol)&&q.set(`${$t},${ot}`,"skip")}let E=new Map,_=e.getSparklines?.()??[];for(let j of _){let et=j.location.match(/^([A-Z]+)(\d+)$/);et&&E.set(`${parseInt(et[2],10)},${Kt(et[1])}`,j)}let M=new Map,N=e.getCellImages?.()??[];for(let j of N)M.set(j.cell,j);t.evaluateFormulas&&new de().calculateSheet(e);let H=new Set;for(let j of e.getRowBreaks())H.add(j.id);let V=[],K=0,z=0,mt=A.slice(0,y).reduce((j,et,L)=>j+W[L]*R,0);for(let j=0;j<A.length;j++){let et=W[j]*R,L=$-(V.length>0?mt:0),$t=j>K&&H.has(A[j]);z+et>L&&j>K||$t?(V.push({rowStart:K,rowEnd:j-1}),K=j,z=mt+et):z+=et}K<A.length&&V.push({rowStart:K,rowEnd:A.length-1});let it=new co,gt=it.alloc(),St=it.alloc(),J=it.add("<</Type/Font/Subtype/Type1/BaseFont/Helvetica/Encoding/WinAnsiEncoding>>"),G=it.add("<</Type/Font/Subtype/Type1/BaseFont/Helvetica-Bold/Encoding/WinAnsiEncoding>>"),X=it.add("<</Type/Font/Subtype/Type1/BaseFont/Helvetica-Oblique/Encoding/WinAnsiEncoding>>"),F=it.add("<</Type/Font/Subtype/Type1/BaseFont/Helvetica-BoldOblique/Encoding/WinAnsiEncoding>>"),P=e.getImages?.()??[],U=[],Y=0;for(let j of P){let et=typeof j.data=="string"?Ms(j.data):j.data;if(j.format==="jpeg"||j.format==="png"){if(j.format==="jpeg"){let L=Ps(et);if(!L)continue;let $t=`Im${++Y}`,ot=it.add(`<</Type/XObject/Subtype/Image/Width ${L.width}/Height ${L.height}/ColorSpace/DeviceRGB/BitsPerComponent 8/Filter/DCTDecode/Length ${et.length}>>`,et);U.push({id:ot,name:$t,width:L.width,height:L.height})}if(j.format==="png"){let L=Es(et,it);L&&(L.name=`Im${++Y}`,U.push(L))}}}let st=[];function ht(){let j=[...U.map(et=>({name:et.name,id:et.id})),...st];return j.length?"/XObject<<"+j.map(et=>`/${et.name} ${et.id} 0 R`).join("")+">>":""}let tt;if(t.title||t.author){let j=["/Producer(ExcelForge)"];t.title&&j.push(`/Title(${lo(t.title)})`),t.author&&j.push(`/Author(${lo(t.author)})`),tt=it.add(`<<${j.join("")}>>`)}let ft=[];for(let j=0;j<V.length;j++){let et=V[j],L=new Me;R!==1&&(L.gsave(),L.raw(`${O(R)} 0 0 ${O(R)} ${O(g.left*(1-R))} ${O(g.bottom*(1-R))} cm`));let $t=[];if(j>0&&y>0)for(let Z=0;Z<Math.min(y,A.length);Z++)$t.push({sheetRow:A[Z],height:W[Z],ri:Z});for(let Z=et.rowStart;Z<=et.rowEnd;Z++)$t.push({sheetRow:A[Z],height:W[Z],ri:Z});let ot=p-g.top;for(let Z of $t){let yt=Z.height*R,nt=g.left;if(C){L.gsave(),L.fillColor(.9,.9,.9),L.fillRect(nt,ot-yt,k*R,yt),L.strokeColor(.7,.7,.7).lineWidth(.25),L.strokeRect(nt,ot-yt,k*R,yt),L.fillColor(.3,.3,.3),L.beginText().font("F1",7*R);let dt=String(Z.sheetRow),pt=ae(dt,7,!1)*R;L.textPos(nt+(k*R-pt)/2,ot-yt+(yt-7*R)/2+1),L.showText(dt).endText(),L.grestore(),nt+=k*R}for(let dt=0;dt<T.length;dt++){let pt=T[dt],Rt=S[dt]*R,_e=`${Z.sheetRow},${pt}`,ge=q.get(_e);if(ge==="skip"){nt+=Rt;continue}let Ht=Rt,_t=yt;if(ge&&typeof ge!="string"){Ht=0;for(let It=0;It<ge.colSpan;It++){let Dt=T.indexOf(pt+It);Dt>=0&&(Ht+=S[Dt]*R)}_t=0;for(let It=0;It<ge.rowSpan;It++){let Dt=A.indexOf(Z.sheetRow+It);Dt>=0&&(_t+=W[Dt]*R)}}let to=e.getCell(Z.sheetRow,pt),Xt=to.style;if(Xt?.fill&&Xt.fill.type==="pattern"){let It=Xt.fill;if(It.pattern==="solid"&&It.fgColor){let Dt=Fe(It.fgColor);Dt&&(L.gsave(),L.fillColor(Dt[0],Dt[1],Dt[2]),L.fillRect(nt,ot-_t,Ht,_t),L.grestore())}}b&&!Xt?.border&&(L.gsave(),L.strokeColor(.82,.82,.82).lineWidth(.25),L.strokeRect(nt,ot-_t,Ht,_t),L.grestore()),Xt?.border&&(L.gsave(),js(L,Xt.border,nt,ot-_t,Ht,_t),L.grestore());let xe=_s(to,Xt);if(xe){L.gsave(),L.clipRect(nt+1,ot-_t,Ht-2,_t);let It=(Xt?.font?.size??x)*R,Dt=Xt?.font?.bold??!1,le=Xt?.font?.italic??!1,Ie=Dt&&le?"F4":Dt?"F2":le?"F3":"F1",Vt=Fe(Xt?.font?.color)??[0,0,0];L.fillColor(Vt[0],Vt[1],Vt[2]);let Gt=ae(xe,It/R,Dt)*R,Le=Xt?.alignment?.horizontal??(typeof to.value=="number"?"right":"left"),Qs=Xt?.alignment?.vertical??"bottom",ye,uo=2*R;switch(Le){case"center":case"fill":case"justify":case"distributed":ye=nt+(Ht-Gt)/2;break;case"right":ye=nt+Ht-Gt-uo;break;default:ye=nt+uo+(Xt?.alignment?.indent??0)*6*R;break}let Te;switch(Qs){case"top":Te=ot-It-uo;break;case"center":case"distributed":Te=ot-_t/2-It*.35;break;default:Te=ot-_t+uo;break}if(L.beginText().font(Ie,It).textPos(ye,Te).showText(xe).endText(),Xt?.font?.underline&&Xt.font.underline!=="none"&&(L.strokeColor(Vt[0],Vt[1],Vt[2]),L.lineWidth(It*.05),L.line(ye,Te-It*.15,ye+Gt,Te-It*.15)),Xt?.font?.strike){L.strokeColor(Vt[0],Vt[1],Vt[2]),L.lineWidth(It*.05);let Sn=Te+It*.3;L.line(ye,Sn,ye+Gt,Sn)}L.grestore()}let je=`${Z.sheetRow},${pt}`,$e=E.get(je);if($e){let It=Ls(e,$e.dataRange);It.length&&Ns(L,$e,It,nt,ot-_t,Ht,_t)}let Ys=`${Ut(pt)}${Z.sheetRow}`,Oe=M.get(Ys);if(Oe){let It=typeof Oe.data=="string"?Ms(Oe.data):Oe.data;if(Oe.format==="jpeg"){let Dt=Ps(It);if(Dt){let le=`Ci${Z.sheetRow}_${pt}`,Ie=it.add(`<</Type/XObject/Subtype/Image/Width ${Dt.width}/Height ${Dt.height}/ColorSpace/DeviceRGB/BitsPerComponent 8/Filter/DCTDecode/Length ${It.length}>>`,It);st.push({name:le,id:Ie});let Vt=Dt.width/Dt.height,Gt=Ht-2,Le=_t-2;Gt/Le>Vt?Gt=Le*Vt:Le=Gt/Vt,L.drawImage(le,nt+1,ot-_t+1,Gt,Le)}}else if(Oe.format==="png"){let Dt=Es(It,it);if(Dt){let le=`Ci${Z.sheetRow}_${pt}`;Dt.name=le,st.push({name:le,id:Dt.id});let Ie=Dt.width/Dt.height,Vt=Ht-2,Gt=_t-2;Vt/Gt>Ie?Vt=Gt*Ie:Gt=Vt/Ie,L.drawImage(le,nt+1,ot-_t+1,Vt,Gt)}}}nt+=Rt}ot-=yt}if(C){let Z=p-g.top,yt=g.left+k*R;L.gsave();for(let nt=0;nt<T.length;nt++){let dt=S[nt]*R;L.fillColor(.9,.9,.9),L.fillRect(yt,Z,dt,14*R),L.strokeColor(.7,.7,.7).lineWidth(.25),L.strokeRect(yt,Z,dt,14*R),L.fillColor(.3,.3,.3);let pt=Ut(T[nt]),Rt=ae(pt,7,!1)*R;L.beginText().font("F1",7*R),L.textPos(yt+(dt-Rt)/2,Z+3*R),L.showText(pt).endText(),yt+=dt}L.grestore()}for(let Z=0;Z<U.length;Z++){let yt=P[Z],nt=U[Z];if(!yt||!nt)continue;let dt=Bi(yt,T,A,S,W,R,g,p,s,n);dt&&L.drawImage(nt.name,dt.x,dt.y,dt.w,dt.h)}let Ft=e.getFormControls?.()??[];for(let Z of Ft)wn(L,Z,T,A,S,W,R,g,p);if(v){let Z=Do(v,j+1,V.length);L.gsave(),L.fillColor(.3,.3,.3),L.beginText().font("F1",8);let yt=ae(Z,8,!1);L.textPos(f/2-yt/2,p-g.top/2),L.showText(Z).endText(),L.grestore()}if(w){let Z=Do(w,j+1,V.length);L.gsave(),L.fillColor(.3,.3,.3),L.beginText().font("F1",8);let yt=ae(Z,8,!1);L.textPos(f/2-yt/2,g.bottom/2),L.showText(Z).endText(),L.grestore()}R!==1&&L.grestore();let xt=L.toBytes(),at=it.addDeflated("<<",xt),bt=it.add(`<</Type/Page/Parent ${St} 0 R/MediaBox[0 0 ${O(f)} ${O(p)}]/Contents ${at} 0 R/Resources<</Font<</F1 ${J} 0 R/F2 ${G} 0 R/F3 ${X} 0 R/F4 ${F} 0 R>>`+ht()+">>>>");ft.push(bt)}return it.set(St,`<</Type/Pages/Kids[${ft.map(j=>`${j} 0 R`).join(" ")}]/Count ${ft.length}>>`),it.set(gt,`<</Type/Catalog/Pages ${St} 0 R>>`),it.build(gt,tt)}function Mi(e,t={}){let o=e.getSheets(),n=e.getSheetNames(),s=t.sheets??n;t.evaluateFormulas&&new de().calculateWorkbook(e);let r=o.filter((y,v)=>s.includes(n[v]));if(r.length===0)return Xs(t);if(r.length===1&&!r[0]._isChartSheet&&!r[0]._isDialogSheet)return Bs(r[0],t);let a=new co,i=a.alloc(),l=a.alloc(),h=a.add("<</Type/Font/Subtype/Type1/BaseFont/Helvetica/Encoding/WinAnsiEncoding>>"),m=a.add("<</Type/Font/Subtype/Type1/BaseFont/Helvetica-Bold/Encoding/WinAnsiEncoding>>"),c=a.add("<</Type/Font/Subtype/Type1/BaseFont/Helvetica-Oblique/Encoding/WinAnsiEncoding>>"),d=a.add("<</Type/Font/Subtype/Type1/BaseFont/Helvetica-BoldOblique/Encoding/WinAnsiEncoding>>"),f;if(t.title||t.author){let y=["/Producer(ExcelForge)"];t.title&&y.push(`/Title(${lo(t.title)})`),t.author&&y.push(`/Author(${lo(t.author)})`),f=a.add(`<<${y.join("")}>>`)}let p=[],g=t.paperSize??"a4",u=t.orientation??"portrait",[$,x]=ve[g]??ve.a4,b=u==="landscape"?x:$,C=u==="landscape"?$:x;for(let y of r)if(y._isChartSheet){let v=y.getCharts();if(v.length){let w=new Me;_i(w,v[0],y,40,40,b-80,C-80);let k=w.toBytes(),T=a.addDeflated("<<",k),S=a.add(`<</Type/Page/Parent ${l} 0 R/MediaBox[0 0 ${O(b)} ${O(C)}]/Contents ${T} 0 R/Resources<</Font<</F1 ${h} 0 R/F2 ${m} 0 R>>>>>>`);p.push(S)}}else if(y._isDialogSheet){let v=y.getFormControls?.()??[];if(v.length){let w=new Me,k={left:50,top:50},T=[1],S=[1],D=[48],R=[16];for(let q of v)wn(w,q,T,S,D,R,1,k,C);let A=w.toBytes(),W=a.addDeflated("<<",A),Q=a.add(`<</Type/Page/Parent ${l} 0 R/MediaBox[0 0 ${O(b)} ${O(C)}]/Contents ${W} 0 R/Resources<</Font<</F1 ${h} 0 R/F2 ${m} 0 R>>>>>>`);p.push(Q)}}else{let v=Ei(y,t,a,h,m,c,d,l);p.push(...v)}return a.set(l,`<</Type/Pages/Kids[${p.map(y=>`${y} 0 R`).join(" ")}]/Count ${p.length}>>`),a.set(i,`<</Type/Catalog/Pages ${l} 0 R>>`),a.build(i,f)}function Ei(e,t,o,n,s,r,a,i){let l=e.getUsedRange();if(!l)return[];let{startRow:h,startCol:m,endRow:c,endCol:d}=l;if(t.printAreaOnly&&e.printArea){let J=e.printArea.match(/^'?[^']*'?!?\$?([A-Z]+)\$?(\d+):\$?([A-Z]+)\$?(\d+)$/);J&&(m=Kt(J[1]),h=parseInt(J[2],10),d=Kt(J[3]),c=parseInt(J[4],10))}let f=e.pageSetup,p=e.pageMargins,g=t.paperSize??(f?.paperSize?Os(f.paperSize):"a4"),u=t.orientation??f?.orientation??"portrait",[$,x]=ve[g]??ve.a4,b=u==="landscape"?x:$,C=u==="landscape"?$:x,y={top:(t.margins?.top??p?.top??.75)*72,bottom:(t.margins?.bottom??p?.bottom??.75)*72,left:(t.margins?.left??p?.left??.7)*72,right:(t.margins?.right??p?.right??.7)*72},v=b-y.left-y.right,w=C-y.top-y.bottom,k=t.defaultFontSize??10,T=t.gridLines!==!1,S=t.repeatRows??0,D=t.headerText??e.headerFooter?.oddHeader,R=t.footerText??e.headerFooter?.oddFooter,A=[],W=[];for(let J=m;J<=d;J++){let G=e.getColumn(J);t.skipHidden&&G?.hidden||(A.push(J),W.push(G?.width?G.width*6:48))}let Q=W.reduce((J,G)=>J+G,0),q=t.scale??1;t.fitToWidth!==!1&&Q*q>v&&(q=v/Q),q=Math.max(.1,Math.min(2,q));let E=[],_=[];for(let J=h;J<=c;J++){let G=e.getRow(J);t.skipHidden&&G?.hidden||(E.push(J),_.push(G?.height??k+6))}let M=e.getMerges(),N=new Map;for(let J of M){N.set(`${J.startRow},${J.startCol}`,{rowSpan:J.endRow-J.startRow+1,colSpan:J.endCol-J.startCol+1});for(let G=J.startRow;G<=J.endRow;G++)for(let X=J.startCol;X<=J.endCol;X++)(G!==J.startRow||X!==J.startCol)&&N.set(`${G},${X}`,"skip")}let H=new Map;for(let J of e.getSparklines?.()??[]){let G=J.location.match(/^([A-Z]+)(\d+)$/);G&&H.set(`${parseInt(G[2],10)},${Kt(G[1])}`,J)}let V=new Map;for(let J of e.getCellImages?.()??[])V.set(J.cell,J);let K=new Set;for(let J of e.getRowBreaks())K.add(J.id);let z=[],mt=0,it=0,gt=E.slice(0,S).reduce((J,G,X)=>J+_[X]*q,0);for(let J=0;J<E.length;J++){let G=_[J]*q,X=w-(z.length>0?gt:0),F=J>mt&&K.has(E[J]);it+G>X&&J>mt||F?(z.push({rowStart:mt,rowEnd:J-1}),mt=J,it=gt+G):it+=G}mt<E.length&&z.push({rowStart:mt,rowEnd:E.length-1});let St=[];for(let J=0;J<z.length;J++){let G=z[J],X=new Me,F=[];if(J>0&&S>0)for(let tt=0;tt<Math.min(S,E.length);tt++)F.push({sheetRow:E[tt],height:_[tt]});for(let tt=G.rowStart;tt<=G.rowEnd;tt++)F.push({sheetRow:E[tt],height:_[tt]});let P=C-y.top;for(let tt of F){let ft=tt.height*q,j=y.left;for(let et=0;et<A.length;et++){let L=A[et],$t=W[et]*q,ot=`${tt.sheetRow},${L}`,Ft=N.get(ot);if(Ft==="skip"){j+=$t;continue}let xt=$t,at=ft;if(Ft&&typeof Ft!="string"){xt=0;for(let pt=0;pt<Ft.colSpan;pt++){let Rt=A.indexOf(L+pt);Rt>=0&&(xt+=W[Rt]*q)}at=0;for(let pt=0;pt<Ft.rowSpan;pt++){let Rt=E.indexOf(tt.sheetRow+pt);Rt>=0&&(at+=_[Rt]*q)}}let bt=e.getCell(tt.sheetRow,L),Z=bt.style;if(Z?.fill&&Z.fill.type==="pattern"){let pt=Z.fill;if(pt.pattern==="solid"&&pt.fgColor){let Rt=Fe(pt.fgColor);Rt&&(X.gsave(),X.fillColor(Rt[0],Rt[1],Rt[2]),X.fillRect(j,P-at,xt,at),X.grestore())}}T&&!Z?.border&&(X.gsave(),X.strokeColor(.82,.82,.82).lineWidth(.25),X.strokeRect(j,P-at,xt,at),X.grestore()),Z?.border&&(X.gsave(),js(X,Z.border,j,P-at,xt,at),X.grestore());let yt=_s(bt,Z);if(yt){X.gsave(),X.clipRect(j+1,P-at,xt-2,at);let pt=(Z?.font?.size??k)*q,Rt=Z?.font?.bold??!1,_e=Z?.font?.italic??!1,ge=Rt&&_e?"F4":Rt?"F2":_e?"F3":"F1",Ht=Fe(Z?.font?.color)??[0,0,0];X.fillColor(Ht[0],Ht[1],Ht[2]);let _t=ae(yt,pt/q,Rt)*q,to=Z?.alignment?.horizontal??(typeof bt.value=="number"?"right":"left"),Xt=Z?.alignment?.vertical??"bottom",xe=2*q,je;switch(to){case"center":case"fill":case"justify":case"distributed":je=j+(xt-_t)/2;break;case"right":je=j+xt-_t-xe;break;default:je=j+xe+(Z?.alignment?.indent??0)*6*q;break}let $e;switch(Xt){case"top":$e=P-pt-xe;break;case"center":case"distributed":$e=P-at/2-pt*.35;break;default:$e=P-at+xe;break}X.beginText().font(ge,pt).textPos(je,$e).showText(yt).endText(),X.grestore()}let nt=`${tt.sheetRow},${L}`,dt=H.get(nt);if(dt){let pt=Ls(e,dt.dataRange);pt.length&&Ns(X,dt,pt,j,P-at,xt,at)}j+=$t}P-=ft}let U=e.getFormControls?.()??[];for(let tt of U)wn(X,tt,A,E,W,_,q,y,C);if(D){let tt=Do(D,J+1,z.length);X.gsave().fillColor(.3,.3,.3);let ft=ae(tt,8,!1);X.beginText().font("F1",8).textPos(b/2-ft/2,C-y.top/2).showText(tt).endText(),X.grestore()}if(R){let tt=Do(R,J+1,z.length);X.gsave().fillColor(.3,.3,.3);let ft=ae(tt,8,!1);X.beginText().font("F1",8).textPos(b/2-ft/2,y.bottom/2).showText(tt).endText(),X.grestore()}let Y=X.toBytes(),st=o.addDeflated("<<",Y),ht=o.add(`<</Type/Page/Parent ${i} 0 R/MediaBox[0 0 ${O(b)} ${O(C)}]/Contents ${st} 0 R/Resources<</Font<</F1 ${n} 0 R/F2 ${s} 0 R/F3 ${r} 0 R/F4 ${a} 0 R>>>>>>`);St.push(ht)}return St}function _s(e,t){return e.richText?e.richText.map(o=>o.text).join(""):e.value==null?"":t?.numberFormat?Ai(e.value,t.numberFormat.formatCode):String(e.value)}function js(e,t,o,n,s,r){let a=[[t.bottom,o,n,o+s,n],[t.top,o,n+r,o+s,n+r],[t.left,o,n,o,n+r],[t.right,o+s,n,o+s,n+r]];for(let[i,l,h,m,c]of a){if(!i?.style)continue;let d=Ri(i.style),f=Fe(i.color)??[0,0,0];e.strokeColor(f[0],f[1],f[2]),e.lineWidth(d);let p=Pi(i.style);p?e.dash(p,0):e.noDash(),e.line(l,h,m,c)}}function Os(e){return{1:"letter",5:"legal",9:"a4",8:"a3",3:"tabloid"}[e]??"a4"}function Do(e,t,o){let n=e.replace(/&[LCR]/g,"").replace(/&"[^"]*"/g,"").replace(/&\d+/g,"");return n=n.replace(/&P/gi,String(t)).replace(/&N/gi,String(o)).replace(/&D/gi,new Date().toLocaleDateString()).replace(/&T/gi,new Date().toLocaleTimeString()).replace(/&F/gi,"").replace(/&A/gi,""),n.trim()}function Bi(e,t,o,n,s,r,a,i,l,h){if(e.position){let m=a.left+e.position.x*.75*r,c=i-a.top-e.position.y*.75*r,d=(e.width??100)*.75*r,f=(e.height??100)*.75*r;return{x:m,y:c-f,w:d,h:f}}if(e.from){let m=a.left;for(let g=0;g<t.length&&!(t[g]>=e.from.col);g++)m+=n[g]*r;let c=0;for(let g=0;g<o.length&&!(o[g]>=e.from.row);g++)c+=s[g]*r;let d=(e.width??100)*.75*r,f=(e.height??100)*.75*r,p=i-a.top-c;return{x:m,y:p-f,w:d,h:f}}return null}function Ms(e){return ce(e)}function Es(e,t){if(e[0]!==137||e[1]!==80||e[2]!==78||e[3]!==71)return null;let o=8,n=g=>(e[g]<<24|e[g+1]<<16|e[g+2]<<8|e[g+3])>>>0,s=n(o);o+=4;let r=String.fromCharCode(e[o],e[o+1],e[o+2],e[o+3]);if(o+=4,r!=="IHDR"||s!==13)return null;let a=n(o);o+=4;let i=n(o);o+=4;let l=e[o++],h=e[o++];if(o+=7,l!==8||h!==2&&h!==6)return null;let m=[];for(;o<e.length-4;){let g=n(o);o+=4;let u=String.fromCharCode(e[o],e[o+1],e[o+2],e[o+3]);if(o+=4,u==="IDAT"&&m.push(e.subarray(o,o+g)),u==="IEND")break;o+=g+4}if(!m.length)return null;let c=0;for(let g of m)c+=g.length;let d=new Uint8Array(c),f=0;for(let g of m)d.set(g,f),f+=g.length;let p=h===6?4:3;return h===2?{id:t.add(`<</Type/XObject/Subtype/Image/Width ${a}/Height ${i}/ColorSpace/DeviceRGB/BitsPerComponent 8/Filter/FlateDecode/DecodeParms<</Predictor 15/Colors 3/BitsPerComponent 8/Columns ${a}>>/Length ${d.length}>>`,d),name:"",width:a,height:i}:null}function Ls(e,t){let o=[],s=(t.includes("!")?t.split("!")[1]:t).match(/^([A-Z]+)(\d+):([A-Z]+)(\d+)$/);if(s){let r=Kt(s[1]),a=parseInt(s[2],10),i=Kt(s[3]),l=parseInt(s[4],10);for(let h=a;h<=l;h++)for(let m=r;m<=i;m++){let c=e.getCell(h,m);typeof c.value=="number"&&o.push(c.value)}}return o}function Ns(e,t,o,n,s,r,a){if(!o.length)return;let i=2,l=n+i,h=s+i,m=r-i*2,c=a-i*2,d=Math.min(...o),p=Math.max(...o)-d||1,g=Fe(t.color)??[.267,.447,.769];if(e.gsave(),e.clipRect(n,s,r,a),t.type==="bar"||t.type==="stacked"){let u=m/o.length;for(let $=0;$<o.length;$++){let x=o[$],b=Math.max(1,(x-d)/p*c),C=l+$*u+u*.1,y=h+(c-b),v=g;x<0&&t.negativeColor&&(v=Fe(t.negativeColor)??g),e.fillColor(v[0],v[1],v[2]),e.fillRect(C,y,u*.8,b)}}else{e.strokeColor(g[0],g[1],g[2]),e.lineWidth(t.lineWidth??1);let u=o.map(($,x)=>[l+x/(o.length-1||1)*m,h+($-d)/p*c]);if(u.length>=2){let $=`${O(u[0][0])} ${O(u[0][1])} m`;for(let x=1;x<u.length;x++)$+=` ${O(u[x][0])} ${O(u[x][1])} l`;e.raw($+" S")}if(t.showMarkers&&t.markersColor){let $=Fe(t.markersColor)??g;e.fillColor($[0],$[1],$[2]);for(let[x,b]of u)e.fillRect(x-1.5,b-1.5,3,3)}}e.grestore()}function wn(e,t,o,n,s,r,a,i,l){let h=i.left,m=0;for(let u=0;u<o.length&&!(o[u]>=t.from.col+1);u++)h+=s[u]*a;for(let u=0;u<n.length&&!(n[u]>=t.from.row+1);u++)m+=r[u]*a;let c=(t.width??80)*.75*a,d=(t.height??24)*.75*a,p=l-i.top-m-d,g=t.text??"";switch(e.gsave(),t.type){case"button":case"dialog":if(e.fillColor(.93,.93,.93),e.fillRect(h,p,c,d),e.strokeColor(.6,.6,.6).lineWidth(.5),e.strokeRect(h,p,c,d),g){e.fillColor(0,0,0);let u=Math.min(9*a,d*.6),$=ae(g,u/a,!1)*a;e.beginText().font("F1",u).textPos(h+(c-$)/2,p+(d-u)/2).showText(g).endText()}break;case"checkBox":{e.strokeColor(.4,.4,.4).lineWidth(.5);let u=Math.min(d-2,10*a);if(e.strokeRect(h+2,p+(d-u)/2,u,u),t.checked==="checked"){e.strokeColor(0,0,0).lineWidth(1);let $=h+2,x=p+(d-u)/2;e.line($+2,x+u/2,$+u/2,x+2),e.line($+u/2,x+2,$+u-2,x+u-2)}if(g){e.fillColor(0,0,0);let $=Math.min(8*a,d*.7);e.beginText().font("F1",$).textPos(h+u+6,p+(d-$)/2).showText(g).endText()}break}case"optionButton":{let u=Math.min(d/2-1,5*a),$=h+2+u,x=p+d/2,b=.5523;if(e.strokeColor(.4,.4,.4).lineWidth(.5),e.raw(`${O($+u)} ${O(x)} m ${O($+u)} ${O(x+u*b)} ${O($+u*b)} ${O(x+u)} ${O($)} ${O(x+u)} c`),e.raw(`${O($-u*b)} ${O(x+u)} ${O($-u)} ${O(x+u*b)} ${O($-u)} ${O(x)} c`),e.raw(`${O($-u)} ${O(x-u*b)} ${O($-u*b)} ${O(x-u)} ${O($)} ${O(x-u)} c`),e.raw(`${O($+u*b)} ${O(x-u)} ${O($+u)} ${O(x-u*b)} ${O($+u)} ${O(x)} c S`),t.checked==="checked"){let C=u*.5;e.fillColor(0,0,0),e.raw(`${O($+C)} ${O(x)} m ${O($+C)} ${O(x+C*b)} ${O($+C*b)} ${O(x+C)} ${O($)} ${O(x+C)} c`),e.raw(`${O($-C*b)} ${O(x+C)} ${O($-C)} ${O(x+C*b)} ${O($-C)} ${O(x)} c`),e.raw(`${O($-C)} ${O(x-C*b)} ${O($-C*b)} ${O(x-C)} ${O($)} ${O(x-C)} c`),e.raw(`${O($+C*b)} ${O(x-C)} ${O($+C)} ${O(x-C*b)} ${O($+C)} ${O(x)} c f`)}if(g){e.fillColor(0,0,0);let C=Math.min(8*a,d*.7);e.beginText().font("F1",C).textPos(h+u*2+6,p+(d-C)/2).showText(g).endText()}break}case"label":case"groupBox":if(g){e.fillColor(0,0,0);let u=Math.min(9*a,d*.7);e.beginText().font("F1",u).textPos(h+2,p+(d-u)/2).showText(g).endText()}t.type==="groupBox"&&(e.strokeColor(.7,.7,.7).lineWidth(.5),e.strokeRect(h,p,c,d));break;case"comboBox":case"listBox":if(e.fillColor(1,1,1),e.fillRect(h,p,c,d),e.strokeColor(.7,.7,.7).lineWidth(.5),e.strokeRect(h,p,c,d),t.type==="comboBox"){let u=Math.min(16*a,c*.2);e.strokeRect(h+c-u,p,u,d);let $=h+c-u/2,x=p+d/2;e.fillColor(.3,.3,.3),e.raw(`${O($-3)} ${O(x+2)} m ${O($+3)} ${O(x+2)} l ${O($)} ${O(x-2)} l f`)}break;case"scrollBar":case"spinner":e.fillColor(.92,.92,.92),e.fillRect(h,p,c,d),e.strokeColor(.7,.7,.7).lineWidth(.5),e.strokeRect(h,p,c,d);break;default:if(e.strokeColor(.7,.7,.7).lineWidth(.5),e.strokeRect(h,p,c,d),g){e.fillColor(0,0,0);let u=Math.min(8*a,d*.7);e.beginText().font("F1",u).textPos(h+2,p+(d-u)/2).showText(g).endText()}}e.grestore()}var Ao=[[.267,.447,.769],[.929,.49,.192],[.647,.647,.647],[1,.753,0],[.357,.608,.835],[.439,.678,.278]];function _i(e,t,o,n,s,r,a){let l=n+10+30,h=s+10,m=r-20-40,c=a-20-20,d=[];for(let x=0;x<t.series.length;x++){let b=t.series[x],C=ji(o,b.values);d.push({name:b.name??`Series ${x+1}`,values:C,color:Ao[x%Ao.length]})}if(!d.length||!d[0].values.length)return;if(e.gsave(),t.title){e.fillColor(0,0,0);let x=10,b=ae(t.title,x,!0);e.beginText().font("F2",x).textPos(n+(r-b)/2,s+a-8).showText(t.title).endText()}let f=t.type,p=d.flatMap(x=>x.values),g=Math.min(0,...p),$=Math.max(1,...p)-g||1;if(e.strokeColor(.5,.5,.5).lineWidth(.5),e.line(l,h,l,h+c),e.line(l,h,l+m,h),f==="pie"||f==="doughnut"){let x=n+r/2,b=s+a/2,C=Math.min(m,c)/2-5,y=d[0].values.filter(k=>k>0),v=y.reduce((k,T)=>k+T,0)||1,w=0;for(let k=0;k<y.length;k++){let T=y[k]/v*2*Math.PI,S=Ao[k%Ao.length];e.fillColor(S[0],S[1],S[2]),e.raw(`${O(x)} ${O(b)} m`);let D=Math.max(8,Math.ceil(T/.2));for(let R=0;R<=D;R++){let A=w+T*R/D;e.raw(`${O(x+C*Math.cos(A))} ${O(b+C*Math.sin(A))} l`)}e.raw("f"),w+=T}}else if(f.startsWith("bar")){let x=d[0].values.length,b=c/x;for(let C=0;C<x;C++)for(let y=0;y<d.length;y++){let w=((d[y].values[C]??0)-g)/$*m,k=h+C*b+b*.1,T=b*.8/d.length,S=d[y].color;e.fillColor(S[0],S[1],S[2]),e.fillRect(l,k+y*T,Math.max(0,w),T)}}else if(f.startsWith("column")||f==="stock"){let x=d[0].values.length,b=m/x;for(let C=0;C<x;C++)for(let y=0;y<d.length;y++){let w=((d[y].values[C]??0)-g)/$*c,k=l+C*b+b*.1,T=b*.8/d.length,S=d[y].color;e.fillColor(S[0],S[1],S[2]),e.fillRect(k+y*T,h,T,Math.max(0,w))}}else for(let x of d){let b=x.values.map((C,y)=>[l+y/(x.values.length-1||1)*m,h+(C-g)/$*c]);if(e.strokeColor(x.color[0],x.color[1],x.color[2]).lineWidth(1.5),b.length>=2){let C=`${O(b[0][0])} ${O(b[0][1])} m`;for(let y=1;y<b.length;y++)C+=` ${O(b[y][0])} ${O(b[y][1])} l`;f.startsWith("area")?(C+=` ${O(b[b.length-1][0])} ${O(h)} l ${O(b[0][0])} ${O(h)} l`,e.fillColor(x.color[0],x.color[1],x.color[2]),e.raw(C+" f")):e.raw(C+" S")}if(f.startsWith("scatter")||f==="bubble"){e.fillColor(x.color[0],x.color[1],x.color[2]);for(let[C,y]of b)e.fillRect(C-2,y-2,4,4)}}e.grestore()}function ji(e,t){let o=[],r=(t.includes("!")?t.split("!")[1]:t).replace(/\$/g,"").match(/^([A-Z]+)(\d+):([A-Z]+)(\d+)$/);if(!r)return o;let a=Kt(r[1]),i=parseInt(r[2],10),l=Kt(r[3]),h=parseInt(r[4],10);for(let m=i;m<=h;m++)for(let c=a;c<=l;c++){let d=e.getCell(m,c);o.push(typeof d.value=="number"?d.value:0)}return o}function Xs(e){let t=new co,o=t.alloc(),n=t.alloc(),s=e.paperSize??"a4",r=e.orientation??"portrait",[a,i]=ve[s]??ve.a4,l=r==="landscape"?i:a,h=r==="landscape"?a:i,m=t.add("<</Type/Font/Subtype/Type1/BaseFont/Helvetica>>"),c=new Me;c.beginText().font("F1",12).fillColor(.5,.5,.5),c.textPos(l/2-40,h/2),c.showText("Empty worksheet").endText();let d=c.toBytes(),f=t.addDeflated("<<",d),p=t.add(`<</Type/Page/Parent ${n} 0 R/MediaBox[0 0 ${O(l)} ${O(h)}]/Contents ${f} 0 R/Resources<</Font<</F1 ${m} 0 R>>>>>>`);return t.set(n,`<</Type/Pages/Kids[${p} 0 R]/Count 1>>`),t.set(o,`<</Type/Catalog/Pages ${n} 0 R>>`),t.build(o)}var bn=new Uint8Array([208,207,17,224,161,177,26,225]),zt=4294967294,Se=4294967295,Oi=4294967293,ie=512,ho=64,Us=4096,Mo=128;function Pt(e,t,o){e[t]=o&255,e[t+1]=o>>8&255}function Ct(e,t,o){e[t]=o&255,e[t+1]=o>>8&255,e[t+2]=o>>16&255,e[t+3]=o>>24&255}function Ro(e,t){return e[t]|e[t+1]<<8}function re(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function Li(e){let t=new Uint8Array(64),o=Math.min(e.length,31);for(let n=0;n<o;n++)Pt(t,n*2,e.charCodeAt(n));return Pt(t,o*2,0),{bytes:t,size:(o+1)*2}}function Vs(e){for(let v=0;v<8;v++)if(e[v]!==bn[v])throw new Error("Not a CFB file");let o=1<<Ro(e,30),s=1<<Ro(e,32),r=re(e,56),a=re(e,44),i=re(e,48),l=re(e,60),h=v=>o+v*o,m=[];for(let v=0;v<109;v++){let w=re(e,76+v*4);if(w===Se||w===zt)break;m.push(w)}let c=[];for(let v of m){let w=h(v);for(let k=0;k<o/4;k++)c.push(re(e,w+k*4))}let d=v=>{let w=[],k=v;for(;k!==zt&&k!==Se&&w.length<1e4;)w.push(k),k=c[k]??zt;return w},f=(v,w)=>{let k=d(v),T=new Uint8Array(w),S=0;for(let D of k){let R=h(D),A=Math.min(o,w-S);T.set(e.subarray(R,R+A),S),S+=A}return T},p=d(i),g=new Uint8Array(p.length*o);p.forEach((v,w)=>g.set(e.subarray(h(v),h(v)+o),w*o));let u=[];for(let v=0;v<g.length/Mo;v++){let w=v*Mo,k=Ro(g,w+64);if(k===0)continue;let T="";for(let S=0;S<(k-2)/2;S++)T+=String.fromCharCode(Ro(g,w+S*2));u.push({name:T,type:g[w+66],start:re(g,w+116),size:re(g,w+120),child:re(g,w+76)})}let $=u[0],x=new Uint8Array(0);$&&$.start!==zt&&(x=new Uint8Array(f($.start,$.size)));let b=[];if(l!==zt){let v=d(l);for(let w of v){let k=h(w);for(let T=0;T<o/4;T++)b.push(re(e,k+T*4))}}let C=(v,w)=>{let k=new Uint8Array(w),T=v,S=0;for(;T!==zt&&S<w;){let D=T*s,R=Math.min(s,w-S);k.set(x.subarray(D,D+R),S),S+=R,T=b[T]??zt}return k},y=[];for(let v=1;v<u.length;v++){let w=u[v];if(w.type!==2)continue;let k;w.size<r?k=C(w.start,w.size):k=f(w.start,w.size),y.push({name:w.name,data:k})}return y}function Be(){if(typeof globalThis.crypto<"u")return globalThis.crypto;throw new Error("Web Crypto API not available. Requires Node.js 18+ or a modern browser.")}function mo(e){return Be().getRandomValues(new Uint8Array(e))}async function ue(e){let t=await Be().subtle.digest("SHA-512",e);return new Uint8Array(t)}async function Ni(e,t){let o=await Be().subtle.importKey("raw",e,{name:"HMAC",hash:"SHA-512"},!1,["sign"]),n=await Be().subtle.sign("HMAC",o,t);return new Uint8Array(n)}async function Ye(e,t,o,n,s){let r=new Uint8Array(e.length*2);for(let d=0;d<e.length;d++)r[d*2]=e.charCodeAt(d)&255,r[d*2+1]=e.charCodeAt(d)>>8&255;let a=new Uint8Array(t.length+r.length);a.set(t),a.set(r,t.length);let i=await ue(a);for(let d=0;d<o;d++){let f=new Uint8Array(4+i.length);f[0]=d&255,f[1]=d>>8&255,f[2]=d>>16&255,f[3]=d>>24&255,f.set(i,4),i=await ue(f)}let l=new Uint8Array(i.length+s.length);l.set(i),l.set(s,i.length);let h=await ue(l),m=n/8;if(h.length>=m)return h.subarray(0,m);let c=new Uint8Array(m);return c.set(h),c.fill(54,h.length),c}async function Ke(e,t,o){let n=await Be().subtle.importKey("raw",e,{name:"AES-CBC"},!1,["encrypt"]),s=await Be().subtle.encrypt({name:"AES-CBC",iv:t},n,o);return new Uint8Array(s).subarray(0,o.length)}async function Po(e,t,o){let n=Be().subtle,s=o.subarray(o.length-16),r=new Uint8Array(16).fill(16),a=new Uint8Array(16);for(let f=0;f<16;f++)a[f]=r[f]^s[f];let i=await n.importKey("raw",e,{name:"AES-CBC"},!1,["encrypt"]),l=await n.encrypt({name:"AES-CBC",iv:new Uint8Array(16)},i,a),h=new Uint8Array(l).subarray(0,16),m=pe(o,h),c=await n.importKey("raw",e,{name:"AES-CBC"},!1,["decrypt"]),d=await n.decrypt({name:"AES-CBC",iv:t},c,m);return new Uint8Array(d)}function Ze(e,t){let o=e.length%t;if(o===0)return e;let n=new Uint8Array(e.length+(t-o));return n.set(e),n}function pe(...e){let t=0;for(let s of e)t+=s.length;let o=new Uint8Array(t),n=0;for(let s of e)o.set(s,n),n+=s.length;return o}var Ws=new Uint8Array([254,167,210,118,59,75,158,121]),Hs=new Uint8Array([215,170,15,109,48,97,52,78]),zs=new Uint8Array([20,110,11,231,171,172,208,214]),Xi=new Uint8Array([95,178,173,1,12,185,225,246]),Ui=new Uint8Array([160,103,127,2,178,44,132,51]);function Vi(e,t,o,n,s,r,a,i){let l=h=>{let m="",c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let d=0;d<h.length;d+=3){let f=h[d],p=h[d+1]??0,g=h[d+2]??0,u=f<<16|p<<8|g;m+=c[u>>18&63]+c[u>>12&63],m+=d+1<h.length?c[u>>6&63]:"=",m+=d+2<h.length?c[u&63]:"="}return m};return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
668
668
  <encryption xmlns="http://schemas.microsoft.com/office/2006/encryption"
669
669
  xmlns:p="http://schemas.microsoft.com/office/2006/keyEncryptor/password">
670
670
  <keyData saltSize="16" blockSize="16" keyBits="256" hashSize="64"
@@ -685,10 +685,10 @@ ${h}
685
685
  encryptedKeyValue="${l(t)}"/>
686
686
  </keyEncryptor>
687
687
  </keyEncryptors>
688
- </encryption>`}function Pe(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=new Uint8Array(128);for(let h=0;h<t.length;h++)o[t.charCodeAt(h)]=h;let n=e.replace(/[^A-Za-z0-9+/]/g,""),s=e.endsWith("==")?2:e.endsWith("=")?1:0,a=(n.length+s)/4*3-s,i=new Uint8Array(a),l=0;for(let h=0;h<n.length;h+=4){let m=o[n.charCodeAt(h)],c=o[n.charCodeAt(h+1)],d=o[n.charCodeAt(h+2)],f=o[n.charCodeAt(h+3)],p=m<<18|c<<12|d<<6|f;l<a&&(i[l++]=p>>16&255),l<a&&(i[l++]=p>>8&255),l<a&&(i[l++]=p&255)}return i}function de(e,t){let o=new RegExp(`${t}="([^"]*)"`,"i"),n=e.match(o);return n?n[1]:""}function Fi(e){return{keySalt:Pe(de(e.split("keyData")[1]??e,"saltValue")),passwordSalt:Pe(de(e.split("encryptedKey")[1]??e,"saltValue")),spinCount:parseInt(de(e,"spinCount"),10)||1e5,keyBits:parseInt(de(e.split("encryptedKey")[1]??e,"keyBits"),10)||256,encryptedVerifierInput:Pe(de(e,"encryptedVerifierHashInput")),encryptedVerifierHash:Pe(de(e,"encryptedVerifierHashValue")),encryptedKeyValue:Pe(de(e,"encryptedKeyValue")),encryptedHmacKey:Pe(de(e,"encryptedHmacKey")),encryptedHmacValue:Pe(de(e,"encryptedHmacValue"))}}function mo(e){let t=e.length*2,o=(4-t%4)%4,n=new Uint8Array(4+t+o);Ct(n,0,t);for(let s=0;s<e.length;s++)Pt(n,4+s*2,e.charCodeAt(s));return n}function vi(){let e="Microsoft.Container.DataSpaces",t=e.length*2,o=new Uint8Array(4+t+12);Ct(o,0,t);for(let s=0;s<e.length;s++)Pt(o,4+s*2,e.charCodeAt(s));let n=4+t;return Pt(o,n,1),Pt(o,n+2,0),Pt(o,n+4,1),Pt(o,n+6,0),Pt(o,n+8,1),Pt(o,n+10,0),o}function Si(){let e=mo("EncryptedPackage"),t=mo("StrongEncryptionDataSpace"),o=8+e.length+t.length,n=new Uint8Array(12+o);Ct(n,0,8),Ct(n,4,1),Ct(n,8,o);let s=12;return Ct(n,s,1),s+=4,Ct(n,s,0),s+=4,n.set(e,s),s+=e.length,n.set(t,s),n}function Ii(){let e=mo("StrongEncryptionTransform"),t=new Uint8Array(8+e.length);return Ct(t,0,8),Ct(t,4,1),t.set(e,8),t}function Ti(){let e=mo("{FF9A3F03-56EF-4613-BDD5-5A41C1D07246}"),t=mo("Microsoft.Container.EncryptionTransform"),o=4+e.length+t.length+12,n=new Uint8Array(4+o);Ct(n,0,o);let s=4;return Ct(n,s,1),s+=4,n.set(e,s),s+=e.length,n.set(t,s),s+=t.length,Pt(n,s,1),Pt(n,s+2,0),s+=4,Pt(n,s,1),Pt(n,s+2,0),s+=4,Pt(n,s,1),Pt(n,s+2,0),n}function ki(e,t){let o=vi(),n=Si(),s=Ii(),r=Ti(),a=[{name:"Root Entry",type:5,childId:2,leftId:-1,rightId:-1,size:0},{name:"DataSpaces",type:1,childId:5,leftId:-1,rightId:-1,size:0},{name:"EncryptionInfo",type:2,childId:-1,leftId:1,rightId:3,data:e,size:e.length},{name:"EncryptedPackage",type:2,childId:-1,leftId:-1,rightId:-1,data:t,size:t.length},{name:"Version",type:2,childId:-1,leftId:-1,rightId:-1,data:o,size:o.length},{name:"DataSpaceMap",type:2,childId:-1,leftId:4,rightId:6,data:n,size:n.length},{name:"DataSpaceInfo",type:1,childId:8,leftId:-1,rightId:7,size:0},{name:"TransformInfo",type:1,childId:9,leftId:-1,rightId:-1,size:0},{name:"StrongEncryptionDataSpace",type:2,childId:-1,leftId:-1,rightId:-1,data:s,size:s.length},{name:"StrongEncryptionTransform",type:1,childId:10,leftId:-1,rightId:-1,size:0},{name:"Primary",type:2,childId:-1,leftId:-1,rightId:-1,data:r,size:r.length}],i=new Uint8Array(0),l=0,h=[],m=[];for(let S of a){if(!S.data){h.push({inMini:!1,miniStart:0,regularStart:0});continue}if(S.data.length<Cs){let D=Math.ceil(S.data.length/co)*co,R=new Uint8Array(i.length+D);R.set(i),R.set(S.data,i.length),h.push({inMini:!0,miniStart:l/co,regularStart:0}),l+=D,i=R}else h.push({inMini:!1,miniStart:0,regularStart:0})}let c=a.length,d=Math.ceil(c*Ao/ae),f=Math.ceil(i.length/ae),p=1+d+f;for(let S=0;S<a.length;S++)a[S].data&&!h[S].inMini&&(h[S].regularStart=p,m.push({data:a[S].data,startSector:p}),p+=Math.ceil(a[S].data.length/ae));let g=p+1,u=new Uint32Array(Math.max(g+8,128));u.fill(Fe),u[0]=xi;for(let S=1;S<1+d;S++)u[S]=S<d?S+1:Ht;for(let S=1+d;S<1+d+f;S++)u[S]=S<d+f?S+1:Ht;for(let S of m){let D=Math.ceil(S.data.length/ae);for(let R=0;R<D;R++)u[S.startSector+R]=R<D-1?S.startSector+R+1:Ht}let $=Math.max(Math.ceil(i.length/co),1),x=new Uint32Array(Math.max($,128));x.fill(Fe);for(let S=0;S<a.length;S++)if(a[S].data&&h[S].inMini){let D=Math.ceil(a[S].data.length/co),R=h[S].miniStart;for(let A=0;A<D;A++)x[R+A]=A<D-1?R+A+1:Ht}let b=p;u[b]=Ht;let C=(1+b+1)*ae,y=new Uint8Array(C);y.set(hn,0),Pt(y,24,62),Pt(y,26,3),Pt(y,28,65534),Pt(y,30,9),Pt(y,32,6),Ct(y,44,1),Ct(y,48,1),Ct(y,56,Cs),Ct(y,60,b),Ct(y,64,1),Ct(y,68,Ht),Ct(y,72,0);for(let S=0;S<109;S++)Ct(y,76+S*4,Fe);Ct(y,76,0);let v=ae;for(let S=0;S<128;S++)Ct(y,v+S*4,u[S]);let w=ae*2;for(let S=0;S<a.length;S++){let D=a[S],R=w+S*Ao,A=$i(D.name);y.set(A.bytes,R),Pt(y,R+64,A.size),y[R+66]=D.type,y[R+67]=1,Ct(y,R+68,D.leftId>=0?D.leftId:Fe),Ct(y,R+72,D.rightId>=0?D.rightId:Fe),Ct(y,R+76,D.childId>=0?D.childId:Fe),D.type===5?(Ct(y,R+116,f>0?1+d:Ht),Ct(y,R+120,i.length)):D.data?(h[S].inMini?Ct(y,R+116,h[S].miniStart):Ct(y,R+116,h[S].regularStart),Ct(y,R+120,D.data.length)):(Ct(y,R+116,Ht),Ct(y,R+120,0))}let k=ae*(2+d);y.set(i,k);for(let S of m)y.set(S.data,ae*(1+S.startSector));let T=ae*(1+b);for(let S=0;S<128;S++)Ct(y,T+S*4,x[S]);return y}async function Ai(e,t,o){let n=o?.spinCount??1e5,s=ho(16),r=ho(16),a=ho(16),i=await Ke(t,r,n,256,Is),l=ho(32),h=await Ge(i,r,qe(l,16)),m=await Ke(t,r,n,256,vs),c=await Ge(m,r,qe(a,16)),d=await pe(a),f=await Ke(t,r,n,256,Ss),p=await Ge(f,r,qe(d,16)),g=e,u=4096,$=[];for(let Q=0;Q<g.length;Q+=u){let q=g.subarray(Q,Math.min(Q+u,g.length)),E=qe(q,16),_=Q/u,M=new Uint8Array(4);M[0]=_&255,M[1]=_>>8&255,M[2]=_>>16&255,M[3]=_>>24&255;let H=(await pe(fe(s,M))).subarray(0,16),V=await Ge(l,H,E);$.push(V)}let x=fe(...$),b=new Uint8Array(8);Ct(b,0,e.length);let C=fe(b,x),y=ho(64),v=(await pe(fe(s,wi))).subarray(0,16),w=await Ge(l,v,qe(y,16)),k=await yi(y,C),T=(await pe(fe(s,bi))).subarray(0,16),S=await Ge(l,T,qe(k,16)),D=Ci(s,h,c,p,w,S,r,n),R=new TextEncoder().encode(D),A=new Uint8Array(8);Pt(A,0,4),Pt(A,2,4),Ct(A,4,64);let W=fe(A,R);return ki(W,C)}async function Di(e,t){let o=Fs(e),n=o.find(b=>b.name==="EncryptionInfo"),s=o.find(b=>b.name==="EncryptedPackage");if(!n||!s)throw new Error("Not an encrypted Office file");let r=n.data.subarray(8),a=new TextDecoder().decode(r),i=Fi(a),l=await Ke(t,i.passwordSalt,i.spinCount,i.keyBits,Is),h;try{h=await ko(l,i.passwordSalt,i.encryptedKeyValue),h=h.subarray(0,i.keyBits/8)}catch{throw new Error("Incorrect password")}let m=await Ke(t,i.passwordSalt,i.spinCount,i.keyBits,vs),c;try{c=await ko(m,i.passwordSalt,i.encryptedVerifierInput),c=c.subarray(0,16)}catch{throw new Error("Incorrect password")}let d=await Ke(t,i.passwordSalt,i.spinCount,i.keyBits,Ss);try{let b=await ko(d,i.passwordSalt,i.encryptedVerifierHash),C=await pe(c);for(let y=0;y<64;y++)if(b[y]!==C[y])throw new Error("Incorrect password")}catch(b){throw b.message==="Incorrect password"?b:new Error("Incorrect password")}let f=i.keySalt,p=se(s.data,0),g=s.data.subarray(8),u=4096,$=[];for(let b=0;b<g.length;b+=u){let C=b+u;C>g.length&&(C=g.length);let y=Math.ceil((C-b)/16)*16,v=g.subarray(b,b+y),w=b/u,k=new Uint8Array(4);k[0]=w&255,k[1]=w>>8&255,k[2]=w>>16&255,k[3]=w>>24&255;let S=(await pe(fe(f,k))).subarray(0,16);try{let D=await ko(h,S,v);$.push(D)}catch{throw new Error("Decryption failed \u2014 data may be corrupted")}}return fe(...$).subarray(0,p)}function Ri(e){if(e.length<8)return!1;for(let t=0;t<8;t++)if(e[t]!==hn[t])return!1;try{return Fs(e).some(o=>o.name==="EncryptionInfo")}catch{return!1}}function Pi(e){return e<128?new Uint8Array([e]):e<256?new Uint8Array([129,e]):e<65536?new Uint8Array([130,e>>8,e&255]):new Uint8Array([131,e>>16&255,e>>8&255,e&255])}function Ot(e,t){let o=Pi(t.length),n=new Uint8Array(1+o.length+t.length);return n[0]=e,n.set(o,1),n.set(t,1+o.length),n}function Bt(...e){let t=0;for(let s of e)t+=s.length;let o=new Uint8Array(t),n=0;for(let s of e)o.set(s,n),n+=s.length;return Ot(48,o)}function Ye(...e){let t=0;for(let s of e)t+=s.length;let o=new Uint8Array(t),n=0;for(let s of e)o.set(s,n),n+=s.length;return Ot(49,o)}function Jt(e){let t=[40*e[0]+e[1]];for(let o=2;o<e.length;o++){let n=e[o];if(n<128)t.push(n);else{let s=[];for(;n>0;)s.unshift(n&127),n>>=7;for(let r=0;r<s.length-1;r++)s[r]|=128;t.push(...s)}}return Ot(6,new Uint8Array(t))}function mn(e){if(e===0)return Ot(2,new Uint8Array([0]));let t=[],o=e;for(;o>0;)t.unshift(o&255),o>>=8;return t[0]&128&&t.unshift(0),Ot(2,new Uint8Array(t))}function Do(e){return Ot(4,e)}function Mi(e){return Ot(12,new TextEncoder().encode(e))}function Ro(e,t){return Ot(160|e,t)}var dn=[2,16,840,1,101,3,4,2,1],Ei=[1,2,840,113549,1,1,1],Bi=[1,2,840,113549,1,1,11],_i=[1,2,840,113549,1,7,2];var ji=[1,2,840,113549,1,9,3],Oi=[1,2,840,113549,1,9,4],Li=[1,2,840,113549,1,9,5],Ts=[1,3,6,1,4,1,311,2,1,4];function fo(e){let t=e.replace(/-----[A-Z\s]+-----/g,"").replace(/\s+/g,""),o=atob(t),n=new Uint8Array(o.length);for(let s=0;s<o.length;s++)n[s]=o.charCodeAt(s);return n}function Po(e){let t="";for(let o=0;o<e.length;o++)t+=String.fromCharCode(e[o]);return btoa(t)}function Ze(e,t){let o=e[t],n=t+1,s=e[n++];if(s&128){let r=s&127;s=0;for(let a=0;a<r;a++)s=s<<8|e[n++]}return{tag:o,content:e.slice(n,n+s),next:n+s}}async function Mo(e){let t=await crypto.subtle.digest("SHA-256",e);return new Uint8Array(t)}async function fn(e){return crypto.subtle.importKey("pkcs8",e,{name:"RSASSA-PKCS1-v1_5",hash:"SHA-256"},!1,["sign"])}async function ks(e,t){let o=await crypto.subtle.sign("RSASSA-PKCS1-v1_5",e,t);return new Uint8Array(o)}async function Ni(e,t,o,n){let s=await Mo(t),r=Ze(o,0),a=Ze(r.content,0),i=0,l=Ze(a.content,i);l.tag===160&&(i=l.next,l=Ze(a.content,i));let h=l.content;i=l.next,l=Ze(a.content,i),i=l.next,l=Ze(a.content,i);let m=a.content.slice(i,l.next),d=new Date().toISOString().replace(/[-:T]/g,"").slice(0,14)+"Z",f=new TextEncoder().encode(d),p=Bt(Jt(dn),Ot(5,new Uint8Array(0))),g=[Bt(Jt(ji),Ye(Jt(e))),Bt(Jt(Li),Ye(Ot(23,f))),Bt(Jt(Oi),Ye(Do(s)))],u=new Uint8Array(0);for(let k of g){let T=new Uint8Array(u.length+k.length);T.set(u),T.set(k,u.length),u=T}let $=Ot(49,u),x=Ot(160,u),C=await ks(n,$),y=Bt(mn(1),Bt(m,Ot(2,h)),p,x,Bt(Jt(Ei),Ot(5,new Uint8Array(0))),Do(C)),v=Bt(Jt(e),Ro(0,Do(t))),w=Bt(mn(1),Ye(p),v,Ro(0,o),Ye(y));return Bt(Jt(_i),Ro(0,w))}var Xi=[2,5,4,3];function Ui(e){let t=new Uint8Array(1+e.length);return t[0]=0,t.set(e,1),Ot(3,t)}async function Vi(e,t,o){let n=fo(t),s=await fn(n),r=Bt(Jt(Bi),Ot(5,new Uint8Array(0))),a=Bt(Ye(Bt(Jt(Xi),Mi(e)))),i=new Date,l=new Date(i.getFullYear()+10,i.getMonth(),i.getDate()),h=v=>{let w=v.toISOString().replace(/[-:T]/g,"").slice(2,14)+"Z";return Ot(23,new TextEncoder().encode(w))},m=Bt(h(i),h(l)),c=Ot(2,new Uint8Array([1])),d=Ro(0,mn(2)),f=Bt(d,c,r,a,m,a,Ot(48,o.slice((o.indexOf(48,1)>=0,0)))),g=Bt(d,c,r,a,m,a,o),u=await Mo(g),$=await crypto.subtle.sign("RSASSA-PKCS1-v1_5",s,g),x=new Uint8Array($),b=Bt(g,r,Ui(x));return`-----BEGIN CERTIFICATE-----
689
- ${Po(b).match(/.{1,64}/g).join(`
688
+ </encryption>`}function Ee(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=new Uint8Array(128);for(let h=0;h<t.length;h++)o[t.charCodeAt(h)]=h;let n=e.replace(/[^A-Za-z0-9+/]/g,""),s=e.endsWith("==")?2:e.endsWith("=")?1:0,a=(n.length+s)/4*3-s,i=new Uint8Array(a),l=0;for(let h=0;h<n.length;h+=4){let m=o[n.charCodeAt(h)],c=o[n.charCodeAt(h+1)],d=o[n.charCodeAt(h+2)],f=o[n.charCodeAt(h+3)],p=m<<18|c<<12|d<<6|f;l<a&&(i[l++]=p>>16&255),l<a&&(i[l++]=p>>8&255),l<a&&(i[l++]=p&255)}return i}function fe(e,t){let o=new RegExp(`${t}="([^"]*)"`,"i"),n=e.match(o);return n?n[1]:""}function Wi(e){return{keySalt:Ee(fe(e.split("keyData")[1]??e,"saltValue")),passwordSalt:Ee(fe(e.split("encryptedKey")[1]??e,"saltValue")),spinCount:parseInt(fe(e,"spinCount"),10)||1e5,keyBits:parseInt(fe(e.split("encryptedKey")[1]??e,"keyBits"),10)||256,encryptedVerifierInput:Ee(fe(e,"encryptedVerifierHashInput")),encryptedVerifierHash:Ee(fe(e,"encryptedVerifierHashValue")),encryptedKeyValue:Ee(fe(e,"encryptedKeyValue")),encryptedHmacKey:Ee(fe(e,"encryptedHmacKey")),encryptedHmacValue:Ee(fe(e,"encryptedHmacValue"))}}function fo(e){let t=e.length*2,o=(4-t%4)%4,n=new Uint8Array(4+t+o);Ct(n,0,t);for(let s=0;s<e.length;s++)Pt(n,4+s*2,e.charCodeAt(s));return n}function Hi(){let e="Microsoft.Container.DataSpaces",t=e.length*2,o=new Uint8Array(4+t+12);Ct(o,0,t);for(let s=0;s<e.length;s++)Pt(o,4+s*2,e.charCodeAt(s));let n=4+t;return Pt(o,n,1),Pt(o,n+2,0),Pt(o,n+4,1),Pt(o,n+6,0),Pt(o,n+8,1),Pt(o,n+10,0),o}function zi(){let e=fo("EncryptedPackage"),t=fo("StrongEncryptionDataSpace"),o=8+e.length+t.length,n=new Uint8Array(12+o);Ct(n,0,8),Ct(n,4,1),Ct(n,8,o);let s=12;return Ct(n,s,1),s+=4,Ct(n,s,0),s+=4,n.set(e,s),s+=e.length,n.set(t,s),n}function Gi(){let e=fo("StrongEncryptionTransform"),t=new Uint8Array(8+e.length);return Ct(t,0,8),Ct(t,4,1),t.set(e,8),t}function qi(){let e=fo("{FF9A3F03-56EF-4613-BDD5-5A41C1D07246}"),t=fo("Microsoft.Container.EncryptionTransform"),o=4+e.length+t.length+12,n=new Uint8Array(4+o);Ct(n,0,o);let s=4;return Ct(n,s,1),s+=4,n.set(e,s),s+=e.length,n.set(t,s),s+=t.length,Pt(n,s,1),Pt(n,s+2,0),s+=4,Pt(n,s,1),Pt(n,s+2,0),s+=4,Pt(n,s,1),Pt(n,s+2,0),n}function Ki(e,t){let o=Hi(),n=zi(),s=Gi(),r=qi(),a=[{name:"Root Entry",type:5,childId:2,leftId:-1,rightId:-1,size:0},{name:"DataSpaces",type:1,childId:5,leftId:-1,rightId:-1,size:0},{name:"EncryptionInfo",type:2,childId:-1,leftId:1,rightId:3,data:e,size:e.length},{name:"EncryptedPackage",type:2,childId:-1,leftId:-1,rightId:-1,data:t,size:t.length},{name:"Version",type:2,childId:-1,leftId:-1,rightId:-1,data:o,size:o.length},{name:"DataSpaceMap",type:2,childId:-1,leftId:4,rightId:6,data:n,size:n.length},{name:"DataSpaceInfo",type:1,childId:8,leftId:-1,rightId:7,size:0},{name:"TransformInfo",type:1,childId:9,leftId:-1,rightId:-1,size:0},{name:"StrongEncryptionDataSpace",type:2,childId:-1,leftId:-1,rightId:-1,data:s,size:s.length},{name:"StrongEncryptionTransform",type:1,childId:10,leftId:-1,rightId:-1,size:0},{name:"Primary",type:2,childId:-1,leftId:-1,rightId:-1,data:r,size:r.length}],i=new Uint8Array(0),l=0,h=[],m=[];for(let S of a){if(!S.data){h.push({inMini:!1,miniStart:0,regularStart:0});continue}if(S.data.length<Us){let D=Math.ceil(S.data.length/ho)*ho,R=new Uint8Array(i.length+D);R.set(i),R.set(S.data,i.length),h.push({inMini:!0,miniStart:l/ho,regularStart:0}),l+=D,i=R}else h.push({inMini:!1,miniStart:0,regularStart:0})}let c=a.length,d=Math.ceil(c*Mo/ie),f=Math.ceil(i.length/ie),p=1+d+f;for(let S=0;S<a.length;S++)a[S].data&&!h[S].inMini&&(h[S].regularStart=p,m.push({data:a[S].data,startSector:p}),p+=Math.ceil(a[S].data.length/ie));let g=p+1,u=new Uint32Array(Math.max(g+8,128));u.fill(Se),u[0]=Oi;for(let S=1;S<1+d;S++)u[S]=S<d?S+1:zt;for(let S=1+d;S<1+d+f;S++)u[S]=S<d+f?S+1:zt;for(let S of m){let D=Math.ceil(S.data.length/ie);for(let R=0;R<D;R++)u[S.startSector+R]=R<D-1?S.startSector+R+1:zt}let $=Math.max(Math.ceil(i.length/ho),1),x=new Uint32Array(Math.max($,128));x.fill(Se);for(let S=0;S<a.length;S++)if(a[S].data&&h[S].inMini){let D=Math.ceil(a[S].data.length/ho),R=h[S].miniStart;for(let A=0;A<D;A++)x[R+A]=A<D-1?R+A+1:zt}let b=p;u[b]=zt;let C=(1+b+1)*ie,y=new Uint8Array(C);y.set(bn,0),Pt(y,24,62),Pt(y,26,3),Pt(y,28,65534),Pt(y,30,9),Pt(y,32,6),Ct(y,44,1),Ct(y,48,1),Ct(y,56,Us),Ct(y,60,b),Ct(y,64,1),Ct(y,68,zt),Ct(y,72,0);for(let S=0;S<109;S++)Ct(y,76+S*4,Se);Ct(y,76,0);let v=ie;for(let S=0;S<128;S++)Ct(y,v+S*4,u[S]);let w=ie*2;for(let S=0;S<a.length;S++){let D=a[S],R=w+S*Mo,A=Li(D.name);y.set(A.bytes,R),Pt(y,R+64,A.size),y[R+66]=D.type,y[R+67]=1,Ct(y,R+68,D.leftId>=0?D.leftId:Se),Ct(y,R+72,D.rightId>=0?D.rightId:Se),Ct(y,R+76,D.childId>=0?D.childId:Se),D.type===5?(Ct(y,R+116,f>0?1+d:zt),Ct(y,R+120,i.length)):D.data?(h[S].inMini?Ct(y,R+116,h[S].miniStart):Ct(y,R+116,h[S].regularStart),Ct(y,R+120,D.data.length)):(Ct(y,R+116,zt),Ct(y,R+120,0))}let k=ie*(2+d);y.set(i,k);for(let S of m)y.set(S.data,ie*(1+S.startSector));let T=ie*(1+b);for(let S=0;S<128;S++)Ct(y,T+S*4,x[S]);return y}async function Zi(e,t,o){let n=o?.spinCount??1e5,s=mo(16),r=mo(16),a=mo(16),i=await Ye(t,r,n,256,zs),l=mo(32),h=await Ke(i,r,Ze(l,16)),m=await Ye(t,r,n,256,Ws),c=await Ke(m,r,Ze(a,16)),d=await ue(a),f=await Ye(t,r,n,256,Hs),p=await Ke(f,r,Ze(d,16)),g=e,u=4096,$=[];for(let Q=0;Q<g.length;Q+=u){let q=g.subarray(Q,Math.min(Q+u,g.length)),E=Ze(q,16),_=Q/u,M=new Uint8Array(4);M[0]=_&255,M[1]=_>>8&255,M[2]=_>>16&255,M[3]=_>>24&255;let H=(await ue(pe(s,M))).subarray(0,16),V=await Ke(l,H,E);$.push(V)}let x=pe(...$),b=new Uint8Array(8);Ct(b,0,e.length);let C=pe(b,x),y=mo(64),v=(await ue(pe(s,Xi))).subarray(0,16),w=await Ke(l,v,Ze(y,16)),k=await Ni(y,C),T=(await ue(pe(s,Ui))).subarray(0,16),S=await Ke(l,T,Ze(k,16)),D=Vi(s,h,c,p,w,S,r,n),R=new TextEncoder().encode(D),A=new Uint8Array(8);Pt(A,0,4),Pt(A,2,4),Ct(A,4,64);let W=pe(A,R);return Ki(W,C)}async function Yi(e,t){let o=Vs(e),n=o.find(b=>b.name==="EncryptionInfo"),s=o.find(b=>b.name==="EncryptedPackage");if(!n||!s)throw new Error("Not an encrypted Office file");let r=n.data.subarray(8),a=new TextDecoder().decode(r),i=Wi(a),l=await Ye(t,i.passwordSalt,i.spinCount,i.keyBits,zs),h;try{h=await Po(l,i.passwordSalt,i.encryptedKeyValue),h=h.subarray(0,i.keyBits/8)}catch{throw new Error("Incorrect password")}let m=await Ye(t,i.passwordSalt,i.spinCount,i.keyBits,Ws),c;try{c=await Po(m,i.passwordSalt,i.encryptedVerifierInput),c=c.subarray(0,16)}catch{throw new Error("Incorrect password")}let d=await Ye(t,i.passwordSalt,i.spinCount,i.keyBits,Hs);try{let b=await Po(d,i.passwordSalt,i.encryptedVerifierHash),C=await ue(c);for(let y=0;y<64;y++)if(b[y]!==C[y])throw new Error("Incorrect password")}catch(b){throw b.message==="Incorrect password"?b:new Error("Incorrect password")}let f=i.keySalt,p=re(s.data,0),g=s.data.subarray(8),u=4096,$=[];for(let b=0;b<g.length;b+=u){let C=b+u;C>g.length&&(C=g.length);let y=Math.ceil((C-b)/16)*16,v=g.subarray(b,b+y),w=b/u,k=new Uint8Array(4);k[0]=w&255,k[1]=w>>8&255,k[2]=w>>16&255,k[3]=w>>24&255;let S=(await ue(pe(f,k))).subarray(0,16);try{let D=await Po(h,S,v);$.push(D)}catch{throw new Error("Decryption failed \u2014 data may be corrupted")}}return pe(...$).subarray(0,p)}function Qi(e){if(e.length<8)return!1;for(let t=0;t<8;t++)if(e[t]!==bn[t])return!1;try{return Vs(e).some(o=>o.name==="EncryptionInfo")}catch{return!1}}fn();function Ji(e){return e<128?new Uint8Array([e]):e<256?new Uint8Array([129,e]):e<65536?new Uint8Array([130,e>>8,e&255]):new Uint8Array([131,e>>16&255,e>>8&255,e&255])}function Ot(e,t){let o=Ji(t.length),n=new Uint8Array(1+o.length+t.length);return n[0]=e,n.set(o,1),n.set(t,1+o.length),n}function Bt(...e){let t=0;for(let s of e)t+=s.length;let o=new Uint8Array(t),n=0;for(let s of e)o.set(s,n),n+=s.length;return Ot(48,o)}function Je(...e){let t=0;for(let s of e)t+=s.length;let o=new Uint8Array(t),n=0;for(let s of e)o.set(s,n),n+=s.length;return Ot(49,o)}function te(e){let t=[40*e[0]+e[1]];for(let o=2;o<e.length;o++){let n=e[o];if(n<128)t.push(n);else{let s=[];for(;n>0;)s.unshift(n&127),n>>=7;for(let r=0;r<s.length-1;r++)s[r]|=128;t.push(...s)}}return Ot(6,new Uint8Array(t))}function Cn(e){if(e===0)return Ot(2,new Uint8Array([0]));let t=[],o=e;for(;o>0;)t.unshift(o&255),o>>=8;return t[0]&128&&t.unshift(0),Ot(2,new Uint8Array(t))}function Eo(e){return Ot(4,e)}function tl(e){return Ot(12,new TextEncoder().encode(e))}function Bo(e,t){return Ot(160|e,t)}var Fn=[2,16,840,1,101,3,4,2,1],el=[1,2,840,113549,1,1,1],ol=[1,2,840,113549,1,1,11],nl=[1,2,840,113549,1,7,2];var sl=[1,2,840,113549,1,9,3],rl=[1,2,840,113549,1,9,4],al=[1,2,840,113549,1,9,5],Gs=[1,3,6,1,4,1,311,2,1,4];function po(e){let t=e.replace(/-----[A-Z\s]+-----/g,"").replace(/\s+/g,""),o=atob(t),n=new Uint8Array(o.length);for(let s=0;s<o.length;s++)n[s]=o.charCodeAt(s);return n}function _o(e){let t="";for(let o=0;o<e.length;o++)t+=String.fromCharCode(e[o]);return btoa(t)}function Qe(e,t){let o=e[t],n=t+1,s=e[n++];if(s&128){let r=s&127;s=0;for(let a=0;a<r;a++)s=s<<8|e[n++]}return{tag:o,content:e.slice(n,n+s),next:n+s}}async function jo(e){let t=await crypto.subtle.digest("SHA-256",e);return new Uint8Array(t)}async function vn(e){return crypto.subtle.importKey("pkcs8",e,{name:"RSASSA-PKCS1-v1_5",hash:"SHA-256"},!1,["sign"])}async function qs(e,t){let o=await crypto.subtle.sign("RSASSA-PKCS1-v1_5",e,t);return new Uint8Array(o)}async function il(e,t,o,n){let s=await jo(t),r=Qe(o,0),a=Qe(r.content,0),i=0,l=Qe(a.content,i);l.tag===160&&(i=l.next,l=Qe(a.content,i));let h=l.content;i=l.next,l=Qe(a.content,i),i=l.next,l=Qe(a.content,i);let m=a.content.slice(i,l.next),d=new Date().toISOString().replace(/[-:T]/g,"").slice(0,14)+"Z",f=new TextEncoder().encode(d),p=Bt(te(Fn),Ot(5,new Uint8Array(0))),g=[Bt(te(sl),Je(te(e))),Bt(te(al),Je(Ot(23,f))),Bt(te(rl),Je(Eo(s)))],u=new Uint8Array(0);for(let k of g){let T=new Uint8Array(u.length+k.length);T.set(u),T.set(k,u.length),u=T}let $=Ot(49,u),x=Ot(160,u),C=await qs(n,$),y=Bt(Cn(1),Bt(m,Ot(2,h)),p,x,Bt(te(el),Ot(5,new Uint8Array(0))),Eo(C)),v=Bt(te(e),Bo(0,Eo(t))),w=Bt(Cn(1),Je(p),v,Bo(0,o),Je(y));return Bt(te(nl),Bo(0,w))}var ll=[2,5,4,3];function cl(e){let t=new Uint8Array(1+e.length);return t[0]=0,t.set(e,1),Ot(3,t)}async function hl(e,t,o){let n=po(t),s=await vn(n),r=Bt(te(ol),Ot(5,new Uint8Array(0))),a=Bt(Je(Bt(te(ll),tl(e)))),i=new Date,l=new Date(i.getFullYear()+10,i.getMonth(),i.getDate()),h=v=>{let w=v.toISOString().replace(/[-:T]/g,"").slice(2,14)+"Z";return Ot(23,new TextEncoder().encode(w))},m=Bt(h(i),h(l)),c=Ot(2,new Uint8Array([1])),d=Bo(0,Cn(2)),f=Bt(d,c,r,a,m,a,Ot(48,o.slice((o.indexOf(48,1)>=0,0)))),g=Bt(d,c,r,a,m,a,o),u=await jo(g),$=await crypto.subtle.sign("RSASSA-PKCS1-v1_5",s,g),x=new Uint8Array($),b=Bt(g,r,cl(x));return`-----BEGIN CERTIFICATE-----
689
+ ${_o(b).match(/.{1,64}/g).join(`
690
690
  `)}
691
- -----END CERTIFICATE-----`}async function As(e,t){let o=fo(t.certificate),n=fo(t.privateKey),s=await fn(n),r=new TextEncoder,a=new Map,i=[];for(let[g,u]of e){let $=await Mo(u),x=Po($);i.push(`<Reference URI="/${g}?ContentType=${Wi(g)}">
691
+ -----END CERTIFICATE-----`}async function Ks(e,t){let o=po(t.certificate),n=po(t.privateKey),s=await vn(n),r=new TextEncoder,a=new Map,i=[];for(let[g,u]of e){let $=await jo(u),x=_o($);i.push(`<Reference URI="/${g}?ContentType=${ml(g)}">
692
692
  <DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
693
693
  <DigestValue>${x}</DigestValue>
694
694
  </Reference>`)}let l=`<SignedInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
@@ -696,7 +696,7 @@ ${Po(b).match(/.{1,64}/g).join(`
696
696
  <SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
697
697
  ${i.join(`
698
698
  `)}
699
- </SignedInfo>`,h=r.encode(l),m=await ks(s,h),c=Po(m),d=Po(o),f=`<?xml version="1.0" encoding="UTF-8"?>
699
+ </SignedInfo>`,h=r.encode(l),m=await qs(s,h),c=_o(m),d=_o(o),f=`<?xml version="1.0" encoding="UTF-8"?>
700
700
  <Signature xmlns="http://www.w3.org/2000/09/xmldsig#" Id="idPackageSignature">
701
701
  ${l}
702
702
  <SignatureValue>${c}</SignatureValue>
@@ -719,4 +719,4 @@ ${l}
719
719
  <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
720
720
  <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/signature" Target="sig1.xml"/>
721
721
  </Relationships>`));let p=e.get("_rels/.rels");if(p){let g=new TextDecoder().decode(p);g.includes("digital-signature/origin")||(g=g.replace("</Relationships>",` <Relationship Id="rIdSig" Type="http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/origin" Target="_xmlsignatures/origin.sigs"/>
722
- </Relationships>`),a.set("_rels/.rels",r.encode(g)))}return a}function Wi(e){return e.endsWith(".xml")?"application/xml":e.endsWith(".rels")?"application/vnd.openxmlformats-package.relationships+xml":e.endsWith(".bin")?"application/vnd.ms-office.vbaProject":"application/octet-stream"}async function Ds(e,t){let o=fo(t.certificate),n=fo(t.privateKey),s=await fn(n),r=await Mo(e),a=Bt(Bt(Jt(Ts),Bt(Jt(dn),Ot(5,new Uint8Array(0)))),Bt(Bt(Jt(dn),Ot(5,new Uint8Array(0))),Do(r))),i=await Ni(Ts,a,o,s),l=new Uint8Array(8+i.length),h=new DataView(l.buffer);return h.setUint32(0,3,!0),h.setUint32(4,i.length,!0),l.set(i,8),l}async function Hi(e,t,o){let n=await As(e,t),s;return o&&(s=await Ds(o,t)),{packageSignatureEntries:n,vbaSignature:s}}export{te as CellError,Sa as Colors,me as FormulaEngine,va as NumFmt,Le as SharedStrings,Fo as StyleBuilder,Oe as StyleRegistry,Fa as Styles,oo as VbaProject,ao as Workbook,Ie as Worksheet,un as a1ToR1C1,Ks as applyChartTemplate,le as base64ToBytes,Bs as bytesToBase64,Gt as cellRefToIndices,Ut as colIndexToLetter,qt as colLetterToIndex,ka as csvToWorkbook,_o as dateToSerial,Di as decryptWorkbook,Ys as deserializeChartTemplate,Ai as encryptWorkbook,js as formulaFromR1C1,_s as formulaToR1C1,Vi as generateTestCertificate,ye as indicesToCellRef,Ri as isEncrypted,Kt as parseRange,jo as pxToEmu,gn as r1c1ToA1,qs as saveChartTemplate,Zs as serializeChartTemplate,As as signPackage,Ds as signVbaProject,Hi as signWorkbook,jt as style,oi as workbookToHtml,Da as workbookToJson,di as workbookToPdf,Ia as worksheetToCsv,ln as worksheetToHtml,rs as worksheetToJson,us as worksheetToPdf};
722
+ </Relationships>`),a.set("_rels/.rels",r.encode(g)))}return a}function ml(e){return e.endsWith(".xml")?"application/xml":e.endsWith(".rels")?"application/vnd.openxmlformats-package.relationships+xml":e.endsWith(".bin")?"application/vnd.ms-office.vbaProject":"application/octet-stream"}async function Zs(e,t){let o=po(t.certificate),n=po(t.privateKey),s=await vn(n),r=await jo(e),a=Bt(Bt(te(Gs),Bt(te(Fn),Ot(5,new Uint8Array(0)))),Bt(Bt(te(Fn),Ot(5,new Uint8Array(0))),Eo(r))),i=await il(Gs,a,o,s),l=new Uint8Array(8+i.length),h=new DataView(l.buffer);return h.setUint32(0,3,!0),h.setUint32(4,i.length,!0),l.set(i,8),l}async function dl(e,t,o){let n=await Ks(e,t),s;return o&&(s=await Zs(o,t)),{packageSignatureEntries:n,vbaSignature:s}}dn();Wt();export{ee as CellError,za as Colors,de as FormulaEngine,Ha as NumFmt,Xe as SharedStrings,To as StyleBuilder,Ne as StyleRegistry,Wa as Styles,So as VbaProject,io as Workbook,ke as Worksheet,In as a1ToR1C1,us as applyChartTemplate,ce as base64ToBytes,or as bytesToBase64,qt as cellRefToIndices,Ut as colIndexToLetter,Kt as colLetterToIndex,Ka as csvToWorkbook,No as dateToSerial,Yi as decryptWorkbook,xs as deserializeChartTemplate,Zi as encryptWorkbook,sr as formulaFromR1C1,nr as formulaToR1C1,hl as generateTestCertificate,be as indicesToCellRef,Qi as isEncrypted,Zt as parseRange,Xo as pxToEmu,Tn as r1c1ToA1,ps as saveChartTemplate,gs as serializeChartTemplate,Ks as signPackage,Zs as signVbaProject,dl as signWorkbook,jt as style,Fi as workbookToHtml,Ya as workbookToJson,Mi as workbookToPdf,Ga as worksheetToCsv,yn as worksheetToHtml,Ss as worksheetToJson,Bs as worksheetToPdf};