@cj-tech-master/excelts 2.0.0-canary.20251228013952.4f2c3c6 → 2.0.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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @cj-tech-master/excelts v2.0.0-canary.20251228013952.4f2c3c6
2
+ * @cj-tech-master/excelts v2.0.0
3
3
  * TypeScript Excel Workbook Manager - Read and Write xlsx and csv Files.
4
4
  * (c) 2025 cjnoname
5
5
  * Released under the MIT License
@@ -116,10 +116,10 @@ const e=/^[A-Z]+\d+$/,t={_dictionary:`ABCDEFGHIJKLMNOPQRSTUVWXYZ`.split(``),_l2n
116
116
  ${n}
117
117
  />
118
118
  `}var qi=class extends z{constructor(e){super(),this.model=e||{type:`note`,note:{texts:[]},ref:``}}get tag(){return`r`}get richTextXform(){return this._richTextXform||=new Pn,this._richTextXform}render(e,t){let n=t||this.model;e.openNode(`comment`,{ref:n.ref,authorId:0}),e.openNode(`text`),n&&n.note&&n.note.texts&&n.note.texts.forEach(t=>{this.richTextXform.render(e,t)}),e.closeNode(),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`comment`:return this.model={type:`note`,note:{texts:[]},...e.attributes},!0;case`r`:return this.parser=this.richTextXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case`comment`:return!1;case`r`:return this.model.note.texts.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}},Ji=class e extends z{constructor(){super(),this.map={comment:new qi},this.model={comments:[]}}render(t,n){let r=n||this.model;t.openXml(I.StdDocAttributes),t.openNode(`comments`,e.COMMENTS_ATTRIBUTES),t.openNode(`authors`),t.leafNode(`author`,null,`Author`),t.closeNode(),t.openNode(`commentList`),r.comments.forEach(e=>{this.map.comment.render(t,e)}),t.closeNode(),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`commentList`:return this.model={comments:[]},!0;case`comment`:return this.parser=this.map.comment,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case`commentList`:return!1;case`comment`:return this.model.comments.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}static{this.COMMENTS_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`}}},Yi=class extends z{constructor(){super(),this.model={}}get tag(){return`v:textbox`}conversionUnit(e,t,n){return`${(parseFloat(e.toString())*t).toFixed(2)}${n}`}reverseConversionUnit(e){return(e||``).split(`,`).map(e=>Number(parseFloat(this.conversionUnit(parseFloat(e),.1,``)).toFixed(2)))}render(e,t){let n={style:`mso-direction-alt:auto`};if(t&&t.note){let{inset:e}=t.note&&t.note.margins||{};Array.isArray(e)&&(e=e.map(e=>this.conversionUnit(e,10,`mm`)).join(`,`)),e&&(n.inset=e)}e.openNode(`v:textbox`,n),e.leafNode(`div`,{style:`text-align:left`}),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:return this.model={inset:this.reverseConversionUnit(e.attributes.inset)},!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}},Xi=class extends z{constructor(){super(),this.text=``}get tag(){return`x:Anchor`}getAnchorRect(e){let t=Math.floor(e.left),n=Math.floor((e.left-t)*68),r=Math.floor(e.top),i=Math.floor((e.top-r)*18),a=Math.floor(e.right),o=Math.floor((e.right-a)*68),s=Math.floor(e.bottom);return[t,n,r,i,a,o,s,Math.floor((e.bottom-s)*18)]}getDefaultRect(e){let t=e.col,n=Math.max(e.row-2,0);return[t,6,n,14,t+2,2,n+4,16]}render(e,t){let n=t.anchor?this.getAnchorRect(t.anchor):this.getDefaultRect(t.refAddress);e.leafNode(`x:Anchor`,null,n.join(`, `))}parseOpen(e){switch(e.name){case this.tag:return this.text=``,!0;default:return!1}}parseText(e){this.text=e}parseClose(){return!1}},Zi=class extends z{constructor(e){super(),this._model=e||{},this.text=``}get tag(){return this._model&&this._model.tag||``}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(e){switch(e.name){case this.tag:return this.text=``,!0;default:return!1}}parseText(e){this.text=e}parseClose(){return!1}},Qi=class extends z{constructor(e){super(),this._model=e||{},this.model={}}get tag(){return this._model&&this._model.tag||``}render(e,t,n){(n&&t===n[2]||n&&this.tag===`x:SizeWithCells`&&t===n[1])&&e.leafNode(this.tag)}parseOpen(e){switch(e.name){case this.tag:return this.model={},this.model[this.tag]=!0,!0;default:return!1}}parseText(){}parseClose(){return!1}};const $i=[`twoCells`,`oneCells`,`absolute`];var ea=class extends z{constructor(){super(),this.map={"x:Anchor":new Xi,"x:Locked":new Zi({tag:`x:Locked`}),"x:LockText":new Zi({tag:`x:LockText`}),"x:SizeWithCells":new Qi({tag:`x:SizeWithCells`}),"x:MoveWithCells":new Qi({tag:`x:MoveWithCells`})},this.model={anchor:[],protection:{},editAs:``}}get tag(){return`x:ClientData`}render(e,t){let{protection:n,editAs:r}=t.note;e.openNode(this.tag,{ObjectType:`Note`}),this.map[`x:MoveWithCells`].render(e,r,$i),this.map[`x:SizeWithCells`].render(e,r,$i),this.map[`x:Anchor`].render(e,t),this.map[`x:Locked`].render(e,n.locked),e.leafNode(`x:AutoFill`,null,`False`),this.map[`x:LockText`].render(e,n.lockText),e.leafNode(`x:Row`,null,t.refAddress.row-1),e.leafNode(`x:Column`,null,t.refAddress.col-1),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:this.reset(),this.model={anchor:[],protection:{},editAs:``};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.normalizeModel(),!1;default:return!0}}normalizeModel(){let e=Object.assign({},this.map[`x:MoveWithCells`].model,this.map[`x:SizeWithCells`].model),t=Object.keys(e).length;this.model.editAs=$i[t],this.model.anchor=this.map[`x:Anchor`].text,this.model.protection.locked=this.map[`x:Locked`].text,this.model.protection.lockText=this.map[`x:LockText`].text}},ta=class e extends z{constructor(){super(),this.map={"v:textbox":new Yi,"x:ClientData":new ea}}get tag(){return`v:shape`}render(t,n,r){t.openNode(`v:shape`,e.V_SHAPE_ATTRIBUTES(n,r||0)),t.leafNode(`v:fill`,{color2:`infoBackground [80]`}),t.leafNode(`v:shadow`,{color:`none [81]`,obscured:`t`}),t.leafNode(`v:path`,{"o:connecttype":`none`}),this.map[`v:textbox`].render(t,n),this.map[`x:ClientData`].render(t,n),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={margins:{insetmode:e.attributes[`o:insetmode`]},anchor:``,editAs:``,protection:{}};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.margins.inset=this.map[`v:textbox`].model&&this.map[`v:textbox`].model.inset,this.model.protection=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.protection,this.model.anchor=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.anchor,this.model.editAs=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.editAs,!1;default:return!0}}static{this.V_SHAPE_ATTRIBUTES=(e,t)=>({id:`_x0000_s${1025+t}`,type:`#_x0000_t202`,style:`position:absolute; margin-left:105.3pt;margin-top:10.5pt;width:97.8pt;height:59.1pt;z-index:1;visibility:hidden`,fillcolor:`infoBackground [80]`,strokecolor:`none [81]`,"o:insetmode":e.note.margins&&e.note.margins.insetmode})}},na=class e extends z{constructor(){super(),this.map={"v:shape":new ta},this.model={comments:[]}}get tag(){return`xml`}render(t,n){let r=n||this.model;t.openXml(I.StdDocAttributes),t.openNode(this.tag,e.DRAWING_ATTRIBUTES),t.openNode(`o:shapelayout`,{"v:ext":`edit`}),t.leafNode(`o:idmap`,{"v:ext":`edit`,data:1}),t.closeNode(),t.openNode(`v:shapetype`,{id:`_x0000_t202`,coordsize:`21600,21600`,"o:spt":202,path:`m,l,21600r21600,l21600,xe`}),t.leafNode(`v:stroke`,{joinstyle:`miter`}),t.leafNode(`v:path`,{gradientshapeok:`t`,"o:connecttype":`rect`}),t.closeNode(),r.comments.forEach((e,n)=>{this.map[`v:shape`].render(t,e,n)}),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={comments:[]};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.comments.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}reconcile(e,t){e.anchors.forEach(e=>{e.br?this.map[`xdr:twoCellAnchor`].reconcile(e,t):this.map[`xdr:oneCellAnchor`].reconcile(e,t)})}static{this.DRAWING_ATTRIBUTES={"xmlns:v":`urn:schemas-microsoft-com:vml`,"xmlns:o":`urn:schemas-microsoft-com:office:office`,"xmlns:x":`urn:schemas-microsoft-com:office:excel`}}},ra=class e{static{this.RelType=q}constructor(e){this.workbook=e}parseRels(e){return new K().parseStream(e)}parseWorkbook(e){return new er().parseStream(e)}parseSharedStrings(e){return new Ln().parseStream(e)}reconcile(e,t){let n=new er,r=new mi(t),i=new ji,a=new Ri;n.reconcile(e);let o={media:e.media,mediaIndex:e.mediaIndex};Object.keys(e.drawings).forEach(t=>{let n=e.drawings[t],r=e.drawingRels[t];r&&(o.rels=r.reduce((e,t)=>(e[t.Id]=t,e),{}),(n.anchors||[]).forEach(e=>{let t=e.picture&&e.picture.hyperlinks;t&&o.rels[t.rId]&&(t.hyperlink=o.rels[t.rId].Target,delete t.rId)}),i.reconcile(n,o))});let s={styles:e.styles};Object.values(e.tables).forEach(e=>{a.reconcile(e,s)}),this._reconcilePivotTables(e);let c={styles:e.styles,sharedStrings:e.sharedStrings,media:e.media,mediaIndex:e.mediaIndex,date1904:e.properties&&e.properties.date1904,drawings:e.drawings,comments:e.comments,tables:e.tables,vmlDrawings:e.vmlDrawings,pivotTables:e.pivotTablesIndexed};e.worksheets.forEach(t=>{t.relationships=e.worksheetRels[t.sheetNo],r.reconcile(t,c)}),delete e.worksheetHash,delete e.worksheetRels,delete e.globalRels,delete e.sharedStrings,delete e.workbookRels,delete e.sheetDefs,delete e.styles,delete e.mediaIndex,delete e.drawings,delete e.drawingRels,delete e.vmlDrawings,delete e.pivotTableRels,delete e.pivotCacheDefinitionRels}_reconcilePivotTables(e){let t=e.pivotTables||{};if(typeof t!=`object`||Object.keys(t).length===0){e.pivotTables=[],e.pivotTablesIndexed={};return}let n=this._buildDefinitionToCacheIdMap(e),r=new Map;Object.entries(e.pivotCacheDefinitions||{}).forEach(([t,i])=>{let a=n.get(t);if(a!==void 0){let n=t.replace(`Definition`,`Records`);r.set(a,{definition:i,records:e.pivotCacheRecords?.[n],definitionName:t})}});let i=[],a={};Object.entries(t).forEach(([e,t])=>{let n=t,o=this._extractTableNumber(e),s=r.get(n.cacheId),c={...n,tableNumber:o,cacheDefinition:s?.definition,cacheRecords:s?.records,cacheFields:s?.definition?.cacheFields||[],rows:n.rowFields.filter(e=>e>=0),columns:n.colFields.filter(e=>e>=0&&e!==-2),values:n.dataFields.map(e=>e.fld),metric:this._determineMetric(n.dataFields),applyWidthHeightFormats:n.applyWidthHeightFormats||`0`};i.push(c),a[`../pivotTables/${e}.xml`]=c}),i.sort((e,t)=>e.tableNumber-t.tableNumber),e.pivotTables=i,e.pivotTablesIndexed=a,e.loadedPivotTables=i}_extractTableNumber(e){let t=e.match(/pivotTable(\d+)/);return t?parseInt(t[1],10):1}_buildCacheIdMap(e){let t=new Map,n=e.pivotCaches||[];for(let e of n)e.cacheId&&e.rId&&t.set(e.rId,parseInt(e.cacheId,10));return t}_buildDefinitionToCacheIdMap(t){let n=new Map,r=this._buildCacheIdMap(t),i=t.workbookRels||[];for(let t of i)if(t.Type===e.RelType.PivotCacheDefinition&&t.Target){let e=t.Target.match(/pivotCacheDefinition(\d+)\.xml/);if(e){let i=`pivotCacheDefinition${e[1]}`,a=r.get(t.Id);a!==void 0&&n.set(i,a)}}return n}_determineMetric(e){return e.length>0&&e[0].subtotal===`count`?`count`:`sum`}async _processWorksheetEntry(e,t,n,r,i){let a=await new mi(r).parseStream(e);if(!a)throw Error(`Failed to parse worksheet ${i}`);a.sheetNo=n,t.worksheetHash[i]=a,t.worksheets.push(a)}async _processCommentEntry(e,t,n){let r=await new Ji().parseStream(e);t.comments[`../${n}.xml`]=r}async _processTableEntry(e,t,n){let r=await new Ri().parseStream(e);t.tables[`../tables/${n}.xml`]=r}async _processWorksheetRelsEntry(e,t,n){let r=await new K().parseStream(e);t.worksheetRels[n]=r}async _processMediaEntry(e,t,n){let r=n.lastIndexOf(`.`);if(r>=1){let i=n.substr(r+1),a=n.substr(0,r);await new Promise((r,o)=>{let s=this.createStreamBuf(),c=()=>{e.removeListener(`error`,u),s.removeListener(`error`,u),s.removeListener(`finish`,l)},l=()=>{c(),t.mediaIndex[n]=t.media.length,t.mediaIndex[a]=t.media.length;let e={type:`image`,name:a,extension:i,buffer:s.toBuffer?s.toBuffer():s.read()};t.media.push(e),r()},u=e=>{c(),o(e)};s.once(`finish`,l),e.on(`error`,u),s.on(`error`,u),e.pipe(s)})}}async _processDrawingEntry(e,t,n){let r=await new ji().parseStream(e);t.drawings[n]=r}async _processDrawingRelsEntry(e,t,n){let r=await new K().parseStream(e);t.drawingRels[n]=r}async _processVmlDrawingEntry(e,t,n){let r=await new na().parseStream(e);t.vmlDrawings[`../drawings/${n}.vml`]=r}async _processThemeEntry(e,t,n){await new Promise((r,i)=>{let a=this.createStreamBuf(),o=()=>{e.removeListener(`error`,c),a.removeListener(`error`,c),a.removeListener(`finish`,s)},s=()=>{o();let e=a.read();t.themes[n]=e?typeof e==`string`?e:this.bufferToString(e):``,r()},c=e=>{o(),i(e)};a.once(`finish`,s),e.on(`error`,c),a.on(`error`,c),e.pipe(a)})}async _processPivotTableEntry(e,t,n){let r=await new Ui().parseStream(e);r&&(t.pivotTables[n]=r)}async _processPivotTableRelsEntry(e,t,n){let r=await new K().parseStream(e);t.pivotTableRels[n]=r}async _processPivotCacheDefinitionEntry(e,t,n){let r=await new Hi().parseStream(e);r&&(t.pivotCacheDefinitions[n]=r)}async _processPivotCacheDefinitionRelsEntry(e,t,n){let r=await new K().parseStream(e);t.pivotCacheDefinitionRels[n]=r}async _processPivotCacheRecordsEntry(e,t,n){let r=await new zi().parseStream(e);r&&(t.pivotCacheRecords[n]=r)}async loadFromFiles(e,t){let n={worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},comments:{},tables:{},vmlDrawings:{},pivotTables:{},pivotTableRels:{},pivotCacheDefinitions:{},pivotCacheDefinitionRels:{},pivotCacheRecords:{}},r=Object.keys(e).map(t=>({name:t,dir:t.endsWith(`/`),data:e[t]}));for(let e of r)if(!e.dir){let r=e.name;r[0]===`/`&&(r=r.substr(1));let i=r.match(/xl\/media\//)||r.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/)?this.createBinaryStream(e.data):this.createTextStream(this.bufferToString(e.data)),a=r.match(/xl\/worksheets\/sheet(\d+)[.]xml/);if(a){let e=parseInt(a[1],10);await this._processWorksheetEntry(i,n,e,t,r)}else switch(r){case`_rels/.rels`:n.globalRels=await this.parseRels(i);break;case`xl/workbook.xml`:{let e=await this.parseWorkbook(i);n.sheets=e.sheets,n.definedNames=e.definedNames,n.views=e.views,n.properties=e.properties,n.calcProperties=e.calcProperties,n.pivotCaches=e.pivotCaches;break}case`xl/sharedStrings.xml`:n.sharedStrings=new Ln,await n.sharedStrings.parseStream(i);break;case`xl/_rels/workbook.xml.rels`:n.workbookRels=await this.parseRels(i);break;case`docProps/app.xml`:{let e=await new Hn().parseStream(i);n.company=e.company,n.manager=e.manager;break}case`docProps/core.xml`:{let e=await new Mn().parseStream(i);Object.assign(n,e);break}case`xl/styles.xml`:n.styles=new An,await n.styles.parseStream(i);break;default:await this._processDefaultEntry(i,n,r)}}return this.reconcile(n,t),this.workbook.model=n,this.workbook}async _processDefaultEntry(e,t,n){let r;if(r=n.match(/xl\/worksheets\/_rels\/sheet(\d+)[.]xml[.]rels/),r){let n=parseInt(r[1],10);await this._processWorksheetRelsEntry(e,t,n);return}if(r=n.match(/xl\/media\/([a-zA-Z0-9]+[.][a-zA-Z0-9]{3,4})$/),r){await this._processMediaEntry(e,t,r[1]);return}if(r=n.match(/xl\/drawings\/(drawing\d+)[.]xml/),r){await this._processDrawingEntry(e,t,r[1]);return}if(r=n.match(/xl\/drawings\/_rels\/(drawing\d+)[.]xml[.]rels/),r){await this._processDrawingRelsEntry(e,t,r[1]);return}if(r=n.match(/xl\/drawings\/(vmlDrawing\d+)[.]vml/),r){await this._processVmlDrawingEntry(e,t,r[1]);return}if(r=n.match(/xl\/comments(\d+)[.]xml/),r){await this._processCommentEntry(e,t,`comments${r[1]}`);return}if(r=n.match(/xl\/tables\/(table\d+)[.]xml/),r){await this._processTableEntry(e,t,r[1]);return}if(r=n.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/),r){await this._processThemeEntry(e,t,r[1]);return}if(r=n.match(/xl\/pivotTables\/(pivotTable\d+)[.]xml/),r){await this._processPivotTableEntry(e,t,r[1]);return}if(r=n.match(/xl\/pivotTables\/_rels\/(pivotTable\d+)[.]xml[.]rels/),r){await this._processPivotTableRelsEntry(e,t,r[1]);return}if(r=n.match(/xl\/pivotCache\/(pivotCacheDefinition\d+)[.]xml/),r){await this._processPivotCacheDefinitionEntry(e,t,r[1]);return}if(r=n.match(/xl\/pivotCache\/_rels\/(pivotCacheDefinition\d+)[.]xml[.]rels/),r){await this._processPivotCacheDefinitionRelsEntry(e,t,r[1]);return}if(r=n.match(/xl\/pivotCache\/(pivotCacheRecords\d+)[.]xml/),r){await this._processPivotCacheRecordsEntry(e,t,r[1]);return}}async addContentTypes(e,t){let n=new zn().toXml(t);e.append(n,{name:`[Content_Types].xml`})}async addApp(e,t){let n=new Hn().toXml(t);e.append(n,{name:`docProps/app.xml`})}async addCore(e,t){let n=new Mn;e.append(n.toXml(t),{name:`docProps/core.xml`})}async addThemes(e,t){let n=t.themes||{theme1:`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
119
- <a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> </a:lnStyleLst> <a:effectStyleLst> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="38000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> <a:scene3d> <a:camera prst="orthographicFront"> <a:rot lat="0" lon="0" rev="0"/> </a:camera> <a:lightRig rig="threePt" dir="t"> <a:rot lat="0" lon="0" rev="1200000"/> </a:lightRig> </a:scene3d> <a:sp3d> <a:bevelT w="63500" h="25400"/> </a:sp3d> </a:effectStyle> </a:effectStyleLst> <a:bgFillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="40000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="40000"> <a:schemeClr val="phClr"> <a:tint val="45000"/> <a:shade val="99000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="20000"/> <a:satMod val="255000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="-80000" r="50000" b="180000"/> </a:path> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="80000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="30000"/> <a:satMod val="200000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="50000" r="50000" b="50000"/> </a:path> </a:gradFill> </a:bgFillStyleLst> </a:fmtScheme> </a:themeElements> <a:objectDefaults> <a:spDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="1"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="3"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="2"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="lt1"/> </a:fontRef> </a:style> </a:spDef> <a:lnDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="2"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="0"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="1"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="tx1"/> </a:fontRef> </a:style> </a:lnDef> </a:objectDefaults> <a:extraClrSchemeLst/> </a:theme>`};Object.keys(n).forEach(t=>{let r=n[t],i=`xl/theme/${t}.xml`;e.append(r,{name:i})})}async addOfficeRels(t,n){let r=new K().toXml([{Id:`rId1`,Type:e.RelType.OfficeDocument,Target:`xl/workbook.xml`},{Id:`rId2`,Type:e.RelType.CoreProperties,Target:`docProps/core.xml`},{Id:`rId3`,Type:e.RelType.ExtenderProperties,Target:`docProps/app.xml`}]);t.append(r,{name:`_rels/.rels`})}async addWorkbookRels(t,n){let r=1,i=[{Id:`rId${r++}`,Type:e.RelType.Styles,Target:`styles.xml`},{Id:`rId${r++}`,Type:e.RelType.Theme,Target:`theme/theme1.xml`}];n.sharedStrings.count&&i.push({Id:`rId${r++}`,Type:e.RelType.SharedStrings,Target:`sharedStrings.xml`}),(n.pivotTables||[]).forEach(t=>{t.rId=`rId${r++}`,i.push({Id:t.rId,Type:e.RelType.PivotCacheDefinition,Target:`pivotCache/pivotCacheDefinition${t.tableNumber}.xml`})}),n.worksheets.forEach((t,n)=>{t.rId=`rId${r++}`,t.fileIndex=n+1,i.push({Id:t.rId,Type:e.RelType.Worksheet,Target:`worksheets/sheet${t.fileIndex}.xml`})});let a=new K().toXml(i);t.append(a,{name:`xl/_rels/workbook.xml.rels`})}async addSharedStrings(e,t){t.sharedStrings&&t.sharedStrings.count&&e.append(t.sharedStrings.xml,{name:`xl/sharedStrings.xml`})}async addStyles(e,t){let{xml:n}=t.styles;n&&e.append(n,{name:`xl/styles.xml`})}async addWorkbook(e,t){let n=new er;e.append(n.toXml(t),{name:`xl/workbook.xml`})}async addWorksheets(e,t){let n=new mi,r=new K,i=new Ji,a=new na;t.worksheets.forEach((t,o)=>{let s=t.fileIndex||o+1,c=new I;n.render(c,t),e.append(c.xml,{name:`xl/worksheets/sheet${s}.xml`}),t.rels&&t.rels.length&&(c=new I,r.render(c,t.rels),e.append(c.xml,{name:`xl/worksheets/_rels/sheet${s}.xml.rels`})),t.comments.length>0&&(c=new I,i.render(c,t),e.append(c.xml,{name:`xl/comments${s}.xml`}),c=new I,a.render(c,t),e.append(c.xml,{name:`xl/drawings/vmlDrawing${s}.vml`}))})}addDrawings(e,t){let n=new ji,r=new K;t.worksheets.forEach(t=>{let{drawing:i}=t;if(i){n.prepare(i);let t=n.toXml(i);e.append(t,{name:`xl/drawings/${i.name}.xml`}),t=r.toXml(i.rels),e.append(t,{name:`xl/drawings/_rels/${i.name}.xml.rels`})}})}addTables(e,t){let n=new Ri;t.worksheets.forEach(t=>{let{tables:r}=t;r.forEach(t=>{n.prepare(t,{});let r=n.toXml(t);e.append(r,{name:`xl/tables/${t.target}`})})})}addPivotTables(t,n){if(!n.pivotTables.length)return;let r=new zi,i=new Hi,a=new Ui,o=new K;n.pivotTables.forEach(n=>{let s=n.tableNumber;if(n.isLoaded){if(n.cacheDefinition){let e=i.toXml(n.cacheDefinition);t.append(e,{name:`xl/pivotCache/pivotCacheDefinition${s}.xml`})}if(n.cacheRecords){let e=r.toXml(n.cacheRecords);t.append(e,{name:`xl/pivotCache/pivotCacheRecords${s}.xml`})}}else{let e=r.toXml(n);t.append(e,{name:`xl/pivotCache/pivotCacheRecords${s}.xml`}),e=i.toXml(n),t.append(e,{name:`xl/pivotCache/pivotCacheDefinition${s}.xml`})}let c=o.toXml([{Id:`rId1`,Type:e.RelType.PivotCacheRecords,Target:`pivotCacheRecords${s}.xml`}]);t.append(c,{name:`xl/pivotCache/_rels/pivotCacheDefinition${s}.xml.rels`}),c=a.toXml(n),t.append(c,{name:`xl/pivotTables/pivotTable${s}.xml`}),c=o.toXml([{Id:`rId1`,Type:e.RelType.PivotCacheDefinition,Target:`../pivotCache/pivotCacheDefinition${s}.xml`}]),t.append(c,{name:`xl/pivotTables/_rels/pivotTable${s}.xml.rels`})})}_finalize(e){return new Promise((t,n)=>{e.on(`finish`,()=>{t(this)}),e.on(`error`,n),e.finalize()})}prepareModel(e,t){e.creator=e.creator||`ExcelTS`,e.lastModifiedBy=e.lastModifiedBy||`ExcelTS`,e.created=e.created||new Date,e.modified=e.modified||new Date,e.useSharedStrings=t.useSharedStrings===void 0?!0:t.useSharedStrings,e.useStyles=t.useStyles===void 0?!0:t.useStyles,e.sharedStrings=new Ln,e.styles=e.useStyles?new An(!0):new An.Mock;let n=new er,r=new mi;n.prepare(e);let i={sharedStrings:e.sharedStrings,styles:e.styles,date1904:e.properties.date1904,drawingsCount:0,media:e.media};i.drawings=e.drawings=[],i.commentRefs=e.commentRefs=[];let a=0;e.tables=[],e.worksheets.forEach(t=>{t.tables.forEach(t=>{a++,t.target=`table${a}.xml`,t.id=a,e.tables.push(t)}),r.prepare(t,i)})}},ia=class{constructor(e){this.listeners=new Map,this.ended=!1,this.data=e}async*[Symbol.asyncIterator](){yield this.data}on(e,t){let n=this.listeners.get(e)||[];return n.push(t),this.listeners.set(e,n),this.ended||(this.ended=!0,queueMicrotask(()=>{this.emit(`data`,this.data),this.emit(`end`)})),this}removeListener(e,t){let n=this.listeners.get(e)||[],r=n.indexOf(t);return r!==-1&&n.splice(r,1),this}emit(e,...t){(this.listeners.get(e)||[]).forEach(e=>e(...t))}pipe(e){return e.write(this.data instanceof Uint8Array?this.data:new TextEncoder().encode(this.data)),e.end(),e}},aa=class extends ra{createStreamBuf(){return new Gt}createBinaryStream(e){return new ia(e)}createTextStream(e){return new ia(e)}bufferToString(e){return je(e)}async load(e,t){let n;if(!e||typeof e==`object`&&!(e instanceof Uint8Array)&&!(e instanceof ArrayBuffer))throw Error(`Can't read the data of 'the loaded zip file'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?`);n=t&&t.base64?pe(e.toString()):e instanceof ArrayBuffer?new Uint8Array(e):e instanceof Uint8Array?e:new Uint8Array(e);let r=await new At(n).extractAll(),i={};for(let[e,t]of r)i[e]=t;return this.loadFromFiles(i,t)}async writeBuffer(e){e||={};let{model:t}=this.workbook,n=new Jt(e.zip),r=new Gt;return n.pipe(r),this.prepareModel(t,e),await this.addContentTypes(n,t),await this.addOfficeRels(n,t),await this.addWorkbookRels(n,t),await this.addWorksheets(n,t),await this.addSharedStrings(n,t),this.addDrawings(n,t),this.addTables(n,t),this.addPivotTables(n,t),await Promise.all([this.addThemes(n,t),this.addStyles(n,t)]),await this.addMedia(n,t),await Promise.all([this.addApp(n,t),this.addCore(n,t)]),await this.addWorkbook(n,t),await this._finalize(n),me.from(r.read())}async addMedia(e,t){await Promise.all(t.media.map(async t=>{if(t.type===`image`){let n=`xl/media/${t.name}.${t.extension}`;if(t.buffer)return e.append(t.buffer,{name:n});if(t.base64){let r=t.base64,i=r.substring(r.indexOf(`,`)+1);return e.append(i,{name:n,base64:!0})}throw Error(`Loading images from filename is not supported in browser`)}throw Error(`Unsupported media`)}))}};const Z=Array.from({length:60},(e,t)=>t<10?`0${t}`:`${t}`),Q=(e,t)=>(e.charCodeAt(t)-48)*10+e.charCodeAt(t+1)-48|0,oa=(e,t)=>(e.charCodeAt(t)-48)*1e3+(e.charCodeAt(t+1)-48)*100+(e.charCodeAt(t+2)-48)*10+e.charCodeAt(t+3)-48|0,sa=[0,31,29,31,30,31,30,31,31,30,31,30,31];function ca(e,t,n){if(t<1||t>12||n<1||n>sa[t])return null;let r=new Date(e,t-1,n);return r.getMonth()===t-1?r:null}function la(e,t,n,r,i,a){return t<1||t>12||n<1||n>sa[t]||r>23||i>59||a>59?null:new Date(e,t-1,n,r,i,a)}function ua(e){return e.charCodeAt(4)!==45||e.charCodeAt(7)!==45?null:ca(oa(e,0),Q(e,5),Q(e,8))}function da(e){return e.charCodeAt(4)!==45||e.charCodeAt(7)!==45||e.charCodeAt(10)!==84||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58?null:la(oa(e,0),Q(e,5),Q(e,8),Q(e,11),Q(e,14),Q(e,17))}function fa(e){return e.charCodeAt(4)!==45||e.charCodeAt(7)!==45||e.charCodeAt(10)!==32||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58?null:la(oa(e,0),Q(e,5),Q(e,8),Q(e,11),Q(e,14),Q(e,17))}function pa(e){if(e.charCodeAt(19)!==90)return null;let t=new Date(e);return isNaN(t.getTime())?null:t}function ma(e){if(e.charCodeAt(19)!==46||e.charCodeAt(23)!==90)return null;let t=new Date(e);return isNaN(t.getTime())?null:t}function ha(e){let t=e.charCodeAt(19);if(t!==43&&t!==45)return null;let n=new Date(e);return isNaN(n.getTime())?null:n}function ga(e){if(e.charCodeAt(19)!==46)return null;let t=e.charCodeAt(23);if(t!==43&&t!==45)return null;let n=new Date(e);return isNaN(n.getTime())?null:n}function _a(e){let t=e.charCodeAt(2);return t!==45&&t!==47||e.charCodeAt(5)!==t?null:ca(oa(e,6),Q(e,0),Q(e,3))}function va(e){let t=e.charCodeAt(2);return t!==45&&t!==47||e.charCodeAt(5)!==t?null:ca(oa(e,6),Q(e,3),Q(e,0))}function ya(e){let t=e.charCodeAt(2);return t!==45&&t!==47||e.charCodeAt(5)!==t||e.charCodeAt(10)!==32||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58?null:la(oa(e,6),Q(e,0),Q(e,3),Q(e,11),Q(e,14),Q(e,17))}function ba(e){let t=e.charCodeAt(2);return t!==45&&t!==47||e.charCodeAt(5)!==t||e.charCodeAt(10)!==32||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58?null:la(oa(e,6),Q(e,3),Q(e,0),Q(e,11),Q(e,14),Q(e,17))}const xa={"YYYY-MM-DD":ua,"YYYY-MM-DD[T]HH:mm:ss":da,"YYYY-MM-DD HH:mm:ss":fa,"YYYY-MM-DD[T]HH:mm:ssZ":e=>e.length===20?pa(e):e.length===25?ha(e):null,"YYYY-MM-DD[T]HH:mm:ss.SSSZ":e=>e.length===24?ma(e):e.length===29?ga(e):null,"MM-DD-YYYY":_a,"MM-DD-YYYY HH:mm:ss":ya,"MM/DD/YYYY HH:mm:ss":ya,"DD-MM-YYYY":va,"DD-MM-YYYY HH:mm:ss":ba,"DD/MM/YYYY HH:mm:ss":ba},Sa=[[10,[ua]],[19,[da,fa]],[20,[pa]],[24,[ma]],[25,[ha]],[29,[ga]]];var Ca=class e{constructor(e){this.parse=e=>{if(!e)return null;let t=e.trim();if(!t)return null;if(this.single)return this.fn0(t);for(let e=0,n=this.fns.length;e<n;e++){let n=this.fns[e](t);if(n)return n}return null},this.fns=e,this.single=e.length===1,this.fn0=e[0]}static create(t){return new e(t.map(e=>xa[e]).filter(Boolean))}static iso(){let t=[];for(let[,e]of Sa)t.push(...e);return new e(t)}parseAll(e){let t=e.length,n=Array(t),r=this.parse;for(let i=0;i<t;i++)n[i]=r(e[i]);return n}parseValid(e){let t=[],n=this.parse;for(let r=0,i=e.length;r<i;r++){let i=n(e[r]);i&&t.push(i)}return t}};function wa(e){let t=-e.getTimezoneOffset(),n=t>=0?`+`:`-`,r=Math.abs(t)/60|0,i=Math.abs(t)%60;return`${n}${Z[r]}:${Z[i]}`}var Ta=class e{constructor(e){this.format=e=>this.fn(e),this.fn=e}static iso(t=!1){return t?new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();if(t!==t)return``;let n=e.getUTCFullYear(),r=e.getUTCMonth()+1,i=e.getUTCDate(),a=e.getUTCHours(),o=e.getUTCMinutes(),s=e.getUTCSeconds(),c=e.getUTCMilliseconds();return`${n}-${Z[r]}-${Z[i]}T${Z[a]}:${Z[o]}:${Z[s]}.${c<10?`00`+c:c<100?`0`+c:c}Z`}):new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();if(t!==t)return``;let n=e.getFullYear(),r=e.getMonth()+1,i=e.getDate(),a=e.getHours(),o=e.getMinutes(),s=e.getSeconds(),c=e.getMilliseconds();return`${n}-${Z[r]}-${Z[i]}T${Z[a]}:${Z[o]}:${Z[s]}.${c<10?`00`+c:c<100?`0`+c:c}${wa(e)}`})}static create(t,n){let r=n?.utc??!1;if(t===`YYYY-MM-DD`)return r?new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return t===t?`${e.getUTCFullYear()}-${Z[e.getUTCMonth()+1]}-${Z[e.getUTCDate()]}`:``}):new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return t===t?`${e.getFullYear()}-${Z[e.getMonth()+1]}-${Z[e.getDate()]}`:``});if(t===`YYYY-MM-DD HH:mm:ss`)return r?new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return t===t?`${e.getUTCFullYear()}-${Z[e.getUTCMonth()+1]}-${Z[e.getUTCDate()]} ${Z[e.getUTCHours()]}:${Z[e.getUTCMinutes()]}:${Z[e.getUTCSeconds()]}`:``}):new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return t===t?`${e.getFullYear()}-${Z[e.getMonth()+1]}-${Z[e.getDate()]} ${Z[e.getHours()]}:${Z[e.getMinutes()]}:${Z[e.getSeconds()]}`:``});if(t===`MM-DD-YYYY`||t===`MM/DD/YYYY`){let n=t.charAt(2);return r?new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return t===t?`${Z[e.getUTCMonth()+1]}${n}${Z[e.getUTCDate()]}${n}${e.getUTCFullYear()}`:``}):new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return t===t?`${Z[e.getMonth()+1]}${n}${Z[e.getDate()]}${n}${e.getFullYear()}`:``})}if(t===`DD-MM-YYYY`||t===`DD/MM/YYYY`){let n=t.charAt(2);return r?new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return t===t?`${Z[e.getUTCDate()]}${n}${Z[e.getUTCMonth()+1]}${n}${e.getUTCFullYear()}`:``}):new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return t===t?`${Z[e.getDate()]}${n}${Z[e.getMonth()+1]}${n}${e.getFullYear()}`:``})}return e.createGeneric(t,r)}static createGeneric(t,n){let r=[],i=t.replace(/\[([^\]]*)\]/g,(e,t)=>(r.push(t),`\x00${r.length-1}\x00`)),a=i.includes(`YYYY`),o=i.includes(`SSS`),s=i.includes(`MM`),c=i.includes(`DD`),l=i.includes(`HH`),u=i.includes(`mm`),d=i.includes(`ss`),f=i.includes(`Z`);return new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();if(t!==t)return``;let p=i;if(a&&(p=p.replace(/YYYY/g,String(n?e.getUTCFullYear():e.getFullYear()))),o){let t=n?e.getUTCMilliseconds():e.getMilliseconds();p=p.replace(/SSS/g,t<10?`00${t}`:t<100?`0${t}`:String(t))}return s&&(p=p.replace(/MM/g,Z[n?e.getUTCMonth()+1:e.getMonth()+1])),c&&(p=p.replace(/DD/g,Z[n?e.getUTCDate():e.getDate()])),l&&(p=p.replace(/HH/g,Z[n?e.getUTCHours():e.getHours()])),u&&(p=p.replace(/mm/g,Z[n?e.getUTCMinutes():e.getMinutes()])),d&&(p=p.replace(/ss/g,Z[n?e.getUTCSeconds():e.getSeconds()])),f&&(p=p.replace(/Z/g,n?`Z`:wa(e))),r.length&&(p=p.replace(/\x00(\d+)\x00/g,(e,t)=>r[+t])),p})}formatAll(e){let t=e.length,n=Array(t),r=this.fn;for(let i=0;i<t;i++)n[i]=r(e[i]);return n}};function Ea(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Da(e){let t=new Set,n=[];for(let r of e)r!=null&&(t.has(r)&&n.push(r),t.add(r));if(n.length>0)throw Error(`Duplicate headers found ${JSON.stringify(n)}`)}function Oa(e,t,n,r){if(t)return e.trim();let i=e;return n&&(i=i.trimStart()),r&&(i=i.trimEnd()),i}function ka(e,t={}){let{delimiter:n=`,`,quote:r=`"`,escape:i=`"`,skipEmptyLines:a=!1,ignoreEmpty:o=!1,trim:s=!1,ltrim:c=!1,rtrim:l=!1,headers:u=!1,renameHeaders:d=!1,comment:f,maxRows:p,skipLines:m=0,skipRows:h=0,strictColumnHandling:g=!1,discardUnmappedColumns:_=!1,transform:v,validate:y}=t,ee=a||o,b=r!==null&&r!==!1,x=b?String(r):``,S=i!==null&&i!==!1?String(i):``,te=[],C=[],w=[],T=``,ne=!1,E=0,re=0,ie=0,ae=0,D=null,O=0,k=!1,A=!1;u===!0?k=!0:Array.isArray(u)?(D=u,O=u.filter(e=>e!=null).length,Da(u),k=!0,d||(A=!0)):typeof u==`function`&&(k=!0),e=e.replace(/\r\n/g,`
119
+ <a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> </a:lnStyleLst> <a:effectStyleLst> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="38000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> <a:scene3d> <a:camera prst="orthographicFront"> <a:rot lat="0" lon="0" rev="0"/> </a:camera> <a:lightRig rig="threePt" dir="t"> <a:rot lat="0" lon="0" rev="1200000"/> </a:lightRig> </a:scene3d> <a:sp3d> <a:bevelT w="63500" h="25400"/> </a:sp3d> </a:effectStyle> </a:effectStyleLst> <a:bgFillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="40000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="40000"> <a:schemeClr val="phClr"> <a:tint val="45000"/> <a:shade val="99000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="20000"/> <a:satMod val="255000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="-80000" r="50000" b="180000"/> </a:path> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="80000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="30000"/> <a:satMod val="200000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="50000" r="50000" b="50000"/> </a:path> </a:gradFill> </a:bgFillStyleLst> </a:fmtScheme> </a:themeElements> <a:objectDefaults> <a:spDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="1"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="3"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="2"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="lt1"/> </a:fontRef> </a:style> </a:spDef> <a:lnDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="2"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="0"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="1"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="tx1"/> </a:fontRef> </a:style> </a:lnDef> </a:objectDefaults> <a:extraClrSchemeLst/> </a:theme>`};Object.keys(n).forEach(t=>{let r=n[t],i=`xl/theme/${t}.xml`;e.append(r,{name:i})})}async addOfficeRels(t,n){let r=new K().toXml([{Id:`rId1`,Type:e.RelType.OfficeDocument,Target:`xl/workbook.xml`},{Id:`rId2`,Type:e.RelType.CoreProperties,Target:`docProps/core.xml`},{Id:`rId3`,Type:e.RelType.ExtenderProperties,Target:`docProps/app.xml`}]);t.append(r,{name:`_rels/.rels`})}async addWorkbookRels(t,n){let r=1,i=[{Id:`rId${r++}`,Type:e.RelType.Styles,Target:`styles.xml`},{Id:`rId${r++}`,Type:e.RelType.Theme,Target:`theme/theme1.xml`}];n.sharedStrings.count&&i.push({Id:`rId${r++}`,Type:e.RelType.SharedStrings,Target:`sharedStrings.xml`}),(n.pivotTables||[]).forEach(t=>{t.rId=`rId${r++}`,i.push({Id:t.rId,Type:e.RelType.PivotCacheDefinition,Target:`pivotCache/pivotCacheDefinition${t.tableNumber}.xml`})}),n.worksheets.forEach((t,n)=>{t.rId=`rId${r++}`,t.fileIndex=n+1,i.push({Id:t.rId,Type:e.RelType.Worksheet,Target:`worksheets/sheet${t.fileIndex}.xml`})});let a=new K().toXml(i);t.append(a,{name:`xl/_rels/workbook.xml.rels`})}async addSharedStrings(e,t){t.sharedStrings&&t.sharedStrings.count&&e.append(t.sharedStrings.xml,{name:`xl/sharedStrings.xml`})}async addStyles(e,t){let{xml:n}=t.styles;n&&e.append(n,{name:`xl/styles.xml`})}async addWorkbook(e,t){let n=new er;e.append(n.toXml(t),{name:`xl/workbook.xml`})}async addWorksheets(e,t){let n=new mi,r=new K,i=new Ji,a=new na;t.worksheets.forEach((t,o)=>{let s=t.fileIndex||o+1,c=new I;n.render(c,t),e.append(c.xml,{name:`xl/worksheets/sheet${s}.xml`}),t.rels&&t.rels.length&&(c=new I,r.render(c,t.rels),e.append(c.xml,{name:`xl/worksheets/_rels/sheet${s}.xml.rels`})),t.comments.length>0&&(c=new I,i.render(c,t),e.append(c.xml,{name:`xl/comments${s}.xml`}),c=new I,a.render(c,t),e.append(c.xml,{name:`xl/drawings/vmlDrawing${s}.vml`}))})}addDrawings(e,t){let n=new ji,r=new K;t.worksheets.forEach(t=>{let{drawing:i}=t;if(i){n.prepare(i);let t=n.toXml(i);e.append(t,{name:`xl/drawings/${i.name}.xml`}),t=r.toXml(i.rels),e.append(t,{name:`xl/drawings/_rels/${i.name}.xml.rels`})}})}addTables(e,t){let n=new Ri;t.worksheets.forEach(t=>{let{tables:r}=t;r.forEach(t=>{n.prepare(t,{});let r=n.toXml(t);e.append(r,{name:`xl/tables/${t.target}`})})})}addPivotTables(t,n){if(!n.pivotTables.length)return;let r=new zi,i=new Hi,a=new Ui,o=new K;n.pivotTables.forEach(n=>{let s=n.tableNumber;if(n.isLoaded){if(n.cacheDefinition){let e=i.toXml(n.cacheDefinition);t.append(e,{name:`xl/pivotCache/pivotCacheDefinition${s}.xml`})}if(n.cacheRecords){let e=r.toXml(n.cacheRecords);t.append(e,{name:`xl/pivotCache/pivotCacheRecords${s}.xml`})}}else{let e=r.toXml(n);t.append(e,{name:`xl/pivotCache/pivotCacheRecords${s}.xml`}),e=i.toXml(n),t.append(e,{name:`xl/pivotCache/pivotCacheDefinition${s}.xml`})}let c=o.toXml([{Id:`rId1`,Type:e.RelType.PivotCacheRecords,Target:`pivotCacheRecords${s}.xml`}]);t.append(c,{name:`xl/pivotCache/_rels/pivotCacheDefinition${s}.xml.rels`}),c=a.toXml(n),t.append(c,{name:`xl/pivotTables/pivotTable${s}.xml`}),c=o.toXml([{Id:`rId1`,Type:e.RelType.PivotCacheDefinition,Target:`../pivotCache/pivotCacheDefinition${s}.xml`}]),t.append(c,{name:`xl/pivotTables/_rels/pivotTable${s}.xml.rels`})})}_finalize(e){return new Promise((t,n)=>{e.on(`finish`,()=>{t(this)}),e.on(`error`,n),e.finalize()})}prepareModel(e,t){e.creator=e.creator||`ExcelTS`,e.lastModifiedBy=e.lastModifiedBy||`ExcelTS`,e.created=e.created||new Date,e.modified=e.modified||new Date,e.useSharedStrings=t.useSharedStrings===void 0?!0:t.useSharedStrings,e.useStyles=t.useStyles===void 0?!0:t.useStyles,e.sharedStrings=new Ln,e.styles=e.useStyles?new An(!0):new An.Mock;let n=new er,r=new mi;n.prepare(e);let i={sharedStrings:e.sharedStrings,styles:e.styles,date1904:e.properties.date1904,drawingsCount:0,media:e.media};i.drawings=e.drawings=[],i.commentRefs=e.commentRefs=[];let a=0;e.tables=[],e.worksheets.forEach(t=>{t.tables.forEach(t=>{a++,t.target=`table${a}.xml`,t.id=a,e.tables.push(t)}),r.prepare(t,i)})}},ia=class{constructor(e){this.listeners=new Map,this.ended=!1,this.data=e}async*[Symbol.asyncIterator](){yield this.data}on(e,t){let n=this.listeners.get(e)||[];return n.push(t),this.listeners.set(e,n),this.ended||(this.ended=!0,queueMicrotask(()=>{this.emit(`data`,this.data),this.emit(`end`)})),this}removeListener(e,t){let n=this.listeners.get(e)||[],r=n.indexOf(t);return r!==-1&&n.splice(r,1),this}emit(e,...t){(this.listeners.get(e)||[]).forEach(e=>e(...t))}pipe(e){return e.write(this.data instanceof Uint8Array?this.data:new TextEncoder().encode(this.data)),e.end(),e}},aa=class extends ra{createStreamBuf(){return new Gt}createBinaryStream(e){return new ia(e)}createTextStream(e){return new ia(e)}bufferToString(e){return je(e)}async load(e,t){let n;if(!e||typeof e==`object`&&!(e instanceof Uint8Array)&&!(e instanceof ArrayBuffer))throw Error(`Can't read the data of 'the loaded zip file'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?`);n=t&&t.base64?pe(e.toString()):e instanceof ArrayBuffer?new Uint8Array(e):e instanceof Uint8Array?e:new Uint8Array(e);let r=await new At(n).extractAll(),i={};for(let[e,t]of r)i[e]=t;return this.loadFromFiles(i,t)}async writeBuffer(e){e||={};let{model:t}=this.workbook,n=new Jt(e.zip),r=new Gt;return n.pipe(r),this.prepareModel(t,e),await this.addContentTypes(n,t),await this.addOfficeRels(n,t),await this.addWorkbookRels(n,t),await this.addWorksheets(n,t),await this.addSharedStrings(n,t),this.addDrawings(n,t),this.addTables(n,t),this.addPivotTables(n,t),await Promise.all([this.addThemes(n,t),this.addStyles(n,t)]),await this.addMedia(n,t),await Promise.all([this.addApp(n,t),this.addCore(n,t)]),await this.addWorkbook(n,t),await this._finalize(n),me.from(r.read())}async addMedia(e,t){await Promise.all(t.media.map(async t=>{if(t.type===`image`){let n=`xl/media/${t.name}.${t.extension}`;if(t.buffer)return e.append(t.buffer,{name:n});if(t.base64){let r=t.base64,i=r.substring(r.indexOf(`,`)+1);return e.append(i,{name:n,base64:!0})}throw Error(`Loading images from filename is not supported in browser`)}throw Error(`Unsupported media`)}))}};const Z=Array.from({length:60},(e,t)=>t<10?`0${t}`:`${t}`),Q=(e,t)=>(e.charCodeAt(t)-48)*10+e.charCodeAt(t+1)-48|0,oa=(e,t)=>(e.charCodeAt(t)-48)*1e3+(e.charCodeAt(t+1)-48)*100+(e.charCodeAt(t+2)-48)*10+e.charCodeAt(t+3)-48|0,sa=[0,31,29,31,30,31,30,31,31,30,31,30,31];function ca(e,t,n){if(t<1||t>12||n<1||n>sa[t])return null;let r=new Date(e,t-1,n);return r.getMonth()===t-1?r:null}function la(e,t,n,r,i,a){return t<1||t>12||n<1||n>sa[t]||r>23||i>59||a>59?null:new Date(e,t-1,n,r,i,a)}function ua(e){return e.charCodeAt(4)!==45||e.charCodeAt(7)!==45?null:ca(oa(e,0),Q(e,5),Q(e,8))}function da(e){return e.charCodeAt(4)!==45||e.charCodeAt(7)!==45||e.charCodeAt(10)!==84||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58?null:la(oa(e,0),Q(e,5),Q(e,8),Q(e,11),Q(e,14),Q(e,17))}function fa(e){return e.charCodeAt(4)!==45||e.charCodeAt(7)!==45||e.charCodeAt(10)!==32||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58?null:la(oa(e,0),Q(e,5),Q(e,8),Q(e,11),Q(e,14),Q(e,17))}function pa(e){if(e.charCodeAt(19)!==90)return null;let t=new Date(e);return isNaN(t.getTime())?null:t}function ma(e){if(e.charCodeAt(19)!==46||e.charCodeAt(23)!==90)return null;let t=new Date(e);return isNaN(t.getTime())?null:t}function ha(e){let t=e.charCodeAt(19);if(t!==43&&t!==45)return null;let n=new Date(e);return isNaN(n.getTime())?null:n}function ga(e){if(e.charCodeAt(19)!==46)return null;let t=e.charCodeAt(23);if(t!==43&&t!==45)return null;let n=new Date(e);return isNaN(n.getTime())?null:n}function _a(e){let t=e.charCodeAt(2);return t!==45&&t!==47||e.charCodeAt(5)!==t?null:ca(oa(e,6),Q(e,0),Q(e,3))}function va(e){let t=e.charCodeAt(2);return t!==45&&t!==47||e.charCodeAt(5)!==t?null:ca(oa(e,6),Q(e,3),Q(e,0))}function ya(e){let t=e.charCodeAt(2);return t!==45&&t!==47||e.charCodeAt(5)!==t||e.charCodeAt(10)!==32||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58?null:la(oa(e,6),Q(e,0),Q(e,3),Q(e,11),Q(e,14),Q(e,17))}function ba(e){let t=e.charCodeAt(2);return t!==45&&t!==47||e.charCodeAt(5)!==t||e.charCodeAt(10)!==32||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58?null:la(oa(e,6),Q(e,3),Q(e,0),Q(e,11),Q(e,14),Q(e,17))}const xa={"YYYY-MM-DD":ua,"YYYY-MM-DD[T]HH:mm:ss":da,"YYYY-MM-DD HH:mm:ss":fa,"YYYY-MM-DD[T]HH:mm:ssZ":e=>e.length===20?pa(e):e.length===25?ha(e):null,"YYYY-MM-DD[T]HH:mm:ss.SSSZ":e=>e.length===24?ma(e):e.length===29?ga(e):null,"MM-DD-YYYY":_a,"MM-DD-YYYY HH:mm:ss":ya,"MM/DD/YYYY HH:mm:ss":ya,"DD-MM-YYYY":va,"DD-MM-YYYY HH:mm:ss":ba,"DD/MM/YYYY HH:mm:ss":ba},Sa=[[10,[ua]],[19,[da,fa]],[20,[pa]],[24,[ma]],[25,[ha]],[29,[ga]]];function Ca(e){let t=-e.getTimezoneOffset(),n=t>=0?`+`:`-`,r=Math.abs(t)/60|0,i=Math.abs(t)%60;return`${n}${Z[r]}:${Z[i]}`}var wa=class e{constructor(e){this.parse=e=>{if(!e)return null;let t=e.trim();if(!t)return null;if(this.single)return this.fn0(t);for(let e=0,n=this.fns.length;e<n;e++){let n=this.fns[e](t);if(n)return n}return null},this.fns=e,this.single=e.length===1,this.fn0=e[0]}static create(t){return new e(t.map(e=>xa[e]).filter(Boolean))}static iso(){let t=[];for(let[,e]of Sa)t.push(...e);return new e(t)}parseAll(e){let t=e.length,n=Array(t),r=this.parse;for(let i=0;i<t;i++)n[i]=r(e[i]);return n}parseValid(e){let t=[],n=this.parse;for(let r=0,i=e.length;r<i;r++){let i=n(e[r]);i&&t.push(i)}return t}},Ta=class e{constructor(e){this.format=e=>this.fn(e),this.fn=e}static iso(t=!1){return t?new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();if(t!==t)return``;let n=e.getUTCFullYear(),r=e.getUTCMonth()+1,i=e.getUTCDate(),a=e.getUTCHours(),o=e.getUTCMinutes(),s=e.getUTCSeconds(),c=e.getUTCMilliseconds();return`${n}-${Z[r]}-${Z[i]}T${Z[a]}:${Z[o]}:${Z[s]}.${c<10?`00`+c:c<100?`0`+c:c}Z`}):new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();if(t!==t)return``;let n=e.getFullYear(),r=e.getMonth()+1,i=e.getDate(),a=e.getHours(),o=e.getMinutes(),s=e.getSeconds(),c=e.getMilliseconds();return`${n}-${Z[r]}-${Z[i]}T${Z[a]}:${Z[o]}:${Z[s]}.${c<10?`00`+c:c<100?`0`+c:c}${Ca(e)}`})}static create(t,n){let r=n?.utc??!1;if(t===`YYYY-MM-DD`)return r?new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return t===t?`${e.getUTCFullYear()}-${Z[e.getUTCMonth()+1]}-${Z[e.getUTCDate()]}`:``}):new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return t===t?`${e.getFullYear()}-${Z[e.getMonth()+1]}-${Z[e.getDate()]}`:``});if(t===`YYYY-MM-DD HH:mm:ss`)return r?new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return t===t?`${e.getUTCFullYear()}-${Z[e.getUTCMonth()+1]}-${Z[e.getUTCDate()]} ${Z[e.getUTCHours()]}:${Z[e.getUTCMinutes()]}:${Z[e.getUTCSeconds()]}`:``}):new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return t===t?`${e.getFullYear()}-${Z[e.getMonth()+1]}-${Z[e.getDate()]} ${Z[e.getHours()]}:${Z[e.getMinutes()]}:${Z[e.getSeconds()]}`:``});if(t===`MM-DD-YYYY`||t===`MM/DD/YYYY`){let n=t.charAt(2);return r?new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return t===t?`${Z[e.getUTCMonth()+1]}${n}${Z[e.getUTCDate()]}${n}${e.getUTCFullYear()}`:``}):new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return t===t?`${Z[e.getMonth()+1]}${n}${Z[e.getDate()]}${n}${e.getFullYear()}`:``})}if(t===`DD-MM-YYYY`||t===`DD/MM/YYYY`){let n=t.charAt(2);return r?new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return t===t?`${Z[e.getUTCDate()]}${n}${Z[e.getUTCMonth()+1]}${n}${e.getUTCFullYear()}`:``}):new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();return t===t?`${Z[e.getDate()]}${n}${Z[e.getMonth()+1]}${n}${e.getFullYear()}`:``})}return e.createGeneric(t,r)}static createGeneric(t,n){let r=[],i=t.replace(/\[([^\]]*)\]/g,(e,t)=>(r.push(t),`\x00${r.length-1}\x00`)),a=i.includes(`YYYY`),o=i.includes(`SSS`),s=i.includes(`MM`),c=i.includes(`DD`),l=i.includes(`HH`),u=i.includes(`mm`),d=i.includes(`ss`),f=i.includes(`Z`);return new e(e=>{if(!(e instanceof Date))return``;let t=e.getTime();if(t!==t)return``;let p=i;if(a&&(p=p.replace(/YYYY/g,String(n?e.getUTCFullYear():e.getFullYear()))),o){let t=n?e.getUTCMilliseconds():e.getMilliseconds();p=p.replace(/SSS/g,t<10?`00${t}`:t<100?`0${t}`:String(t))}return s&&(p=p.replace(/MM/g,Z[n?e.getUTCMonth()+1:e.getMonth()+1])),c&&(p=p.replace(/DD/g,Z[n?e.getUTCDate():e.getDate()])),l&&(p=p.replace(/HH/g,Z[n?e.getUTCHours():e.getHours()])),u&&(p=p.replace(/mm/g,Z[n?e.getUTCMinutes():e.getMinutes()])),d&&(p=p.replace(/ss/g,Z[n?e.getUTCSeconds():e.getSeconds()])),f&&(p=p.replace(/Z/g,n?`Z`:Ca(e))),r.length&&(p=p.replace(/\x00(\d+)\x00/g,(e,t)=>r[+t])),p})}formatAll(e){let t=e.length,n=Array(t),r=this.fn;for(let i=0;i<t;i++)n[i]=r(e[i]);return n}};function Ea(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Da(e){let t=new Set,n=[];for(let r of e)r!=null&&(t.has(r)&&n.push(r),t.add(r));if(n.length>0)throw Error(`Duplicate headers found ${JSON.stringify(n)}`)}function Oa(e,t,n,r){if(t)return e.trim();let i=e;return n&&(i=i.trimStart()),r&&(i=i.trimEnd()),i}function ka(e,t={}){let{delimiter:n=`,`,quote:r=`"`,escape:i=`"`,skipEmptyLines:a=!1,ignoreEmpty:o=!1,trim:s=!1,ltrim:c=!1,rtrim:l=!1,headers:u=!1,renameHeaders:d=!1,comment:f,maxRows:p,skipLines:m=0,skipRows:h=0,strictColumnHandling:g=!1,discardUnmappedColumns:_=!1,transform:v,validate:y}=t,ee=a||o,b=r!==null&&r!==!1,x=b?String(r):``,S=i!==null&&i!==!1?String(i):``,te=[],C=[],w=[],T=``,ne=!1,E=0,re=0,ie=0,ae=0,D=null,O=0,k=!1,A=!1;u===!0?k=!0:Array.isArray(u)?(D=u,O=u.filter(e=>e!=null).length,Da(u),k=!0,d||(A=!0)):typeof u==`function`&&(k=!0),e=e.replace(/\r\n/g,`
120
120
  `).replace(/\r/g,`
121
121
  `);let oe=e=>{if(k&&!A){if(typeof u==`function`){let t=u(e);Da(t),D=t}else Array.isArray(u)||(Da(e),D=e);return O=D.filter(e=>e!=null).length,A=!0,!1}if(ae<h)return ae++,!1;if(D&&D.length>0){let t=O,n=e.length;if(n>t){if(g&&!_)return C.push({row:e,reason:`Column header mismatch expected: ${t} columns got: ${n}`}),!1;e.length=D.length}else if(n<t){if(g)return C.push({row:e,reason:`Column header mismatch expected: ${t} columns got: ${n}`}),!1;for(;e.length<D.length;)e.push(``)}}return!0};for(;E<e.length;){let t=e[E],r=e[E+1];if(ne&&b)S&&t===S&&r===x?(T+=x,E+=2):t===x?(ne=!1,E++):(T+=t,E++);else if(b&&t===x&&T===``)ne=!0,E++;else if(t===n)w.push(Oa(T,s,c,l)),T=``,E++;else if(t===`
122
122
  `){if(w.push(Oa(T,s,c,l)),T=``,re++,re<=m){w=[],E++;continue}if(f&&w[0]?.startsWith(f)){w=[],E++;continue}let e=w.length===1&&w[0]===``;if(ee&&e){w=[],E++;continue}if(oe(w)&&(te.push(w),ie++),w=[],E++,p!==void 0&&ie>=p)break}else T+=t,E++}if((T!==``||w.length>0)&&(w.push(Oa(T,s,c,l)),re>=m&&!(f&&w[0]?.startsWith(f)))){let e=w.length===1&&w[0]===``;ee&&e||p!==void 0&&ie>=p||oe(w)&&te.push(w)}if(k&&D){let e=te.map(e=>{let t={};return D.forEach((n,r)=>{n!=null&&(t[n]=e[r]??``)}),t});if(v&&(e=e.map(e=>v(e)).filter(e=>e!=null)),y){let t=[];for(let n of e){let e=y(n);typeof e==`boolean`?e?t.push(n):C.push({row:Object.values(n),reason:`Validation failed`}):e.isValid?t.push(n):C.push({row:Object.values(n),reason:e.reason||`Validation failed`})}e=t}return(g||y)&&C.length>0?{headers:D.filter(e=>e!=null),rows:e,invalidRows:C}:{headers:D.filter(e=>e!=null),rows:e}}let j=te;if(v&&(j=j.map(e=>v(e)).filter(e=>e!=null)),y){let e=[],t=[];for(let n of j){let r=y(n);typeof r==`boolean`?r?e.push(n):t.push({row:n,reason:`Validation failed`}):r.isValid?e.push(n):t.push({row:n,reason:r.reason||`Validation failed`})}if(j=e,t.length>0)return{rows:j,invalidRows:t}}return j}function Aa(e,t={}){let{delimiter:n=`,`,quote:r=`"`,escape:i,rowDelimiter:a=`
123
- `,alwaysQuote:o=!1,quoteColumns:s=!1,quoteHeaders:c=!1,headers:l,writeHeaders:u,writeBOM:d=!1,includeEndRowDelimiter:f=!1,alwaysWriteHeaders:p=!1,transform:m}=t,h=u??!0,g=r!==!1&&r!==null,_=g?String(r):``,v=i!==void 0&&i!==!1&&i!==null?String(i):_,y=[],ee=(e,t,n=!1)=>{let r=n?c:s;return typeof r==`boolean`?r:Array.isArray(r)?r[e]===!0:typeof r==`object`&&t?r[t]===!0:!1},b=(e,t,r,i=!1)=>{if(e==null)return``;let a=String(e);if(!g)return a;let s=o||ee(t,r,i),c=RegExp(`[${Ea(n)}${Ea(_)}\r\n]`);return s||c.test(a)?_+a.replace(new RegExp(Ea(_),`g`),v+_)+_:a},x=(e,t,r=!1)=>e.map((e,n)=>b(e,n,t?.[n],r)).join(n),S=null,te=e=>m&&m.length===1?m(e):e;if(e.length>0&&!Array.isArray(e[0])){let t=e;S=l===!0?Object.keys(t[0]):Array.isArray(l)?l:null,S&&h&&y.push(x(S,S,!0));for(let e of t){let t=te(e);if(t==null)continue;let n=S?S.map(e=>t[e]):Object.values(t);y.push(x(n,S??void 0))}}else if(e.length>0){let t=e;Array.isArray(l)&&(S=l,h&&y.push(x(l,l,!0)));for(let e of t){let t=te(e);t!=null&&y.push(x(t,S??void 0))}}else p&&Array.isArray(l)&&h&&y.push(x(l,l,!0));let C=y.join(a);return C.length>0&&f&&(C+=a),d&&(C=``+C),C}const ja={true:!0,false:!1,"#N/A":{error:`#N/A`},"#REF!":{error:`#REF!`},"#NAME?":{error:`#NAME?`},"#DIV/0!":{error:`#DIV/0!`},"#NULL!":{error:`#NULL!`},"#VALUE!":{error:`#VALUE!`},"#NUM!":{error:`#NUM!`}};function Ma(e){let t=Ca.create(e);return function(e){if(e===``)return null;let n=Number(e);if(!Number.isNaN(n)&&n!==1/0)return n;let r=t.parse(e);if(r)return r;let i=ja[e];return i===void 0?e:i}}function Na(e,t){let n=e?Ta.create(e,{utc:t}):Ta.iso(t);return function(e){if(e){if(e.text||e.hyperlink)return e.hyperlink||e.text||``;if(e.formula||e.result)return e.result||``;if(e instanceof Date)return n.format(e);if(e.error)return e.error;if(typeof e==`object`)return JSON.stringify(e)}return e}}function Pa(e,t,n={}){let r=t.addWorksheet(n.sheetName),i=n.dateFormats||[`YYYY-MM-DD[T]HH:mm:ssZ`,`YYYY-MM-DD[T]HH:mm:ss`,`YYYY-MM-DD`],a=n.map||Ma(i),o=ka(e,n.parserOptions);for(let e of o)r.addRow(e.map(a));return r}function Fa(e,t={}){if(!e)return``;let{dateFormat:n,dateUTC:r}=t,i=t.map||Na(n,r),a=t.includeEmptyRows!==!1,o=[],s=1;return e.eachRow((e,t)=>{if(a)for(;s++<t-1;)o.push([]);let{values:n}=e;n.shift(),o.push(n.map(i)),s=t}),Aa(o,t.formatterOptions)}var Ia=class{constructor(e){this.workbook=e}load(e,t){let n;if(typeof e==`string`)n=e;else if(e instanceof ArrayBuffer)n=new TextDecoder(`utf-8`).decode(e);else if(e instanceof Uint8Array)n=new TextDecoder(`utf-8`).decode(e);else throw Error(`Invalid data type. Expected string, ArrayBuffer, or Uint8Array.`);return Pa(n,this.workbook,t)}writeString(e){return Fa(this.workbook.getWorksheet(e?.sheetName||e?.sheetId),e)}writeBuffer(e){let t=this.writeString(e);return new TextEncoder().encode(t)}async readFile(e,t){throw Error(`CSV.readFile() is not available in browser. Use CSV.load() with string or ArrayBuffer instead.`)}async read(e,t){throw Error(`CSV.read() stream is not available in browser. Use CSV.load() with string or ArrayBuffer instead.`)}async writeFile(e,t){throw Error(`CSV.writeFile() is not available in browser. Use CSV.writeString() or CSV.writeBuffer() and handle download manually.`)}write(e,t){throw Error(`CSV.write() stream is not available in browser. Use CSV.writeString() or CSV.writeBuffer() instead.`)}},La=class extends qe{get xlsx(){return this._xlsx||=new aa(this),this._xlsx}get csv(){return this._csv||=new Ia(this),this._csv}static createStreamWriter(e){throw Error("Streaming workbook writer is not available in browser. Use `new Workbook()` with `xlsx.writeBuffer()` instead, or import from 'excelts' (Node.js) for streaming support.")}static createStreamReader(e,t){throw Error("Streaming workbook reader is not available in browser. Use `new Workbook()` with `xlsx.load()` instead, or import from 'excelts' (Node.js) for streaming support.")}};let Ra=function(e){return e[e.Legal=5]=`Legal`,e[e.Executive=7]=`Executive`,e[e.A4=9]=`A4`,e[e.A5=11]=`A5`,e[e.B5=13]=`B5`,e[e.Envelope_10=20]=`Envelope_10`,e[e.Envelope_DL=27]=`Envelope_DL`,e[e.Envelope_C5=28]=`Envelope_C5`,e[e.Envelope_B5=34]=`Envelope_B5`,e[e.Envelope_Monarch=37]=`Envelope_Monarch`,e[e.Double_Japan_Postcard_Rotated=82]=`Double_Japan_Postcard_Rotated`,e[e.K16_197x273_mm=119]=`K16_197x273_mm`,e}({});function za(e,t){let n=Math.round(e).toString();for(;n.length<t;)n=`0`+n;return n}function Ba(e){if(e.length<=3)return e;let t=e.length%3,n=e.substring(0,t);for(let r=t;r<e.length;r+=3)n+=(n.length>0?`,`:``)+e.substring(r,r+3);return n}function Va(e,t){let n=10**t;return Math.round(e*n)/n}function Ha(e){let t=e.replace(/_./g,` `);return t=t.replace(/\*./g,``),t}function Ua(e){return/^General$/i.test(e.trim())}function Wa(e){let t=e.replace(/\[[^\]]*\]/g,``);return/[ymdhs]/i.test(t)&&!/^[#0.,E%$\s()\-+]+$/i.test(t)}const Ga=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Ka=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],qa=[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],Ja=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],Ya=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];function Xa(e,t){let n=Math.round(e*86400)%86400,r=Math.floor(n/3600),i=Math.floor(n%3600/60),a=n%60,o=Ce(e,!1),s=o.getUTCFullYear(),c=o.getUTCMonth(),l=o.getUTCDate(),u=o.getUTCDay(),d=e*86400-Math.floor(e*86400),f=/AM\/PM|A\/P/i.test(t),p=r>=12,m=r%12||12,h=t.replace(/\[(Red|Green|Blue|Yellow|Magenta|Cyan|White|Black|Color\d+)\]/gi,``);h=Ha(h);let g=h.match(/ss\.(0+)/i),_=``;if(g){let e=g[1].length;_=Math.round(d*10**e).toString().padStart(e,`0`),h=h.replace(/ss\.0+/gi,`\0SF\0`)}h=h.replace(/yyyy/gi,`\0Y4\0`),h=h.replace(/yy/gi,`\0Y2\0`),h=h.replace(/mmmmm/gi,`\0MN5\0`),h=h.replace(/mmmm/gi,`\0MN4\0`),h=h.replace(/mmm/gi,`\0MN3\0`),h=h.replace(/dddd/gi,`\0DN4\0`),h=h.replace(/ddd/gi,`\0DN3\0`),h=h.replace(/dd/gi,`\0D2\0`),h=h.replace(/\bd\b/gi,`\0D1\0`),h=h.replace(/hh/gi,`\0H2\0`),h=h.replace(/\bh\b/gi,`\0H1\0`),h=h.replace(/ss/gi,`\0S2\0`),h=h.replace(/\bs\b/gi,`\0S1\0`),h=/\x00H[12]\x00.*mm|mm.*\x00S[12]\x00/i.test(h)?h.replace(/mm/gi,`\0MI2\0`):h.replace(/mm/gi,`\0M2\0`),h=h.replace(/\bm\b/gi,`\0M1\0`),h=h.replace(/AM\/PM/gi,`\0AMPM\0`),h=h.replace(/A\/P/gi,`\0AP\0`);let v=f?m:r;return h=h.replace(/\x00Y4\x00/g,s.toString()).replace(/\x00Y2\x00/g,(s%100).toString().padStart(2,`0`)).replace(/\x00MN5\x00/g,qa[c]).replace(/\x00MN4\x00/g,Ka[c]).replace(/\x00MN3\x00/g,Ga[c]).replace(/\x00M2\x00/g,(c+1).toString().padStart(2,`0`)).replace(/\x00M1\x00/g,(c+1).toString()).replace(/\x00DN4\x00/g,Ya[u]).replace(/\x00DN3\x00/g,Ja[u]).replace(/\x00D2\x00/g,l.toString().padStart(2,`0`)).replace(/\x00D1\x00/g,l.toString()).replace(/\x00H2\x00/g,v.toString().padStart(2,`0`)).replace(/\x00H1\x00/g,v.toString()).replace(/\x00MI2\x00/g,i.toString().padStart(2,`0`)).replace(/\x00S2\x00/g,a.toString().padStart(2,`0`)).replace(/\x00S1\x00/g,a.toString()).replace(/\x00SF\x00/g,a.toString().padStart(2,`0`)+`.`+_).replace(/\x00AMPM\x00/g,p?`PM`:`AM`).replace(/\x00AP\x00/g,p?`P`:`A`),h=h.replace(/\\/g,``),h}function Za(e){return typeof e==`boolean`?e?`TRUE`:`FALSE`:typeof e==`string`?e:Number.isInteger(e)?e.toString():e.toPrecision(11).replace(/\.?0+$/,``).replace(/\.?0+e/,`e`)}function Qa(e,t){let n=(t.match(/%/g)||[]).length;return ro(e*100**n,t.replace(/%/g,``)||`0`)+`%`.repeat(n)}function $a(e,t){let n=e<0?`-`:``,r=Math.abs(e);if(r===0){let e=t.match(/\.([0#]+)E/i),n=e?e[1].length:2;return`0.`+`0`.repeat(n)+`E+00`}let i=t.match(/\.([0#]+)E/i),a=i?i[1].length:2,o=t.includes(`E+`),s=Math.floor(Math.log10(r)),c=Va(r/10**s,a).toFixed(a),l=s>=0?o?`+`:``:`-`,u=za(Math.abs(s),2);return n+c+`E`+l+u}function eo(e,t){let n=e<0?-1:1,r=Math.abs(e),i=Math.floor(r);if(r-=i,r<1e-10)return[n*i,0,1];let a=0,o=1,s=1,c=0,l=Math.floor(r),u=l,d=1;for(;c<t&&(l=Math.floor(r),u=l*o+a,d=l*c+s,!(r-l<1e-10));)r=1/(r-l),a=o,o=u,s=c,c=d;return d>t&&(d=c,u=o),[n*i,n*u,d]}function to(e,t){let n=e<0?`-`:``,r=Math.abs(e),i=t.match(/\?+\s*\/\s*(\d+)/);if(i){let e=parseInt(i[1],10),a=Math.floor(r),o=r-a,s=Math.round(o*e);return t.includes(`#`)||t.includes(`0`)?s===0?n+a.toString():n+(a>0?a+` `:``)+s+`/`+e:n+(a*e+s)+`/`+e}let a=t.match(/\/\s*(\?+)/),[o,s,c]=eo(r,10**(a?a[1].length:2)-1);return t.includes(`#`)&&o!==0?s===0?n+Math.abs(o).toString():n+Math.abs(o)+` `+Math.abs(s)+`/`+c:s===0?o===0?`0`:n+Math.abs(o).toString():n+(Math.abs(o)*c+Math.abs(s))+`/`+c}function no(e,t){let n=Math.round(e*86400),r=Math.floor(n/60),i=Math.floor(r/60),a=n%60,o=r%60,s=i,c=t;return/\[h+\]/i.test(c)&&(c=c.replace(/\[h+\]/gi,s.toString())),/\[m+\]/i.test(c)&&(c=c.replace(/\[m+\]/gi,r.toString())),/\[s+\]/i.test(c)&&(c=c.replace(/\[s+\]/gi,n.toString())),c=c.replace(/mm/gi,o.toString().padStart(2,`0`)),c=c.replace(/ss/gi,a.toString().padStart(2,`0`)),c}function ro(e,t){let n=Math.abs(e),r=e<0?`-`:``,i=0,a=t;for(;a.endsWith(`,`);)i++,a=a.slice(0,-1);let o=n/1e3**i,s=a.indexOf(`.`),c=a,l=``;s!==-1&&(c=a.substring(0,s),l=a.substring(s+1));let u=l.replace(/[^0#?]/g,``).length,[d,f=``]=Va(o,u).toString().split(`.`),p=/[0#?][^0#?,.\s][0#?]/.test(c),m;if(p){let e=c.replace(/[^0#?]/g,``).length,t=d;t.length<e&&(t=`0`.repeat(e-t.length)+t),m=``;let n=t.length-e;for(let e=0;e<c.length;e++){let r=c[e];r===`0`||r===`#`||r===`?`?n<t.length&&(m+=t[n],n++):r!==`,`&&(m+=r)}}else{m=d,c.includes(`,`)&&(m=Ba(d));let e=(c.match(/0/g)||[]).length;m.length<e&&(m=`0`.repeat(e-m.length)+m)}let h=``;return u>0&&(h=`.`+(f+`0`.repeat(u)).substring(0,u)),r+m+h}function io(e){let t=``,n=0;for(;n<e.length;)if(e[n]===`"`){for(n++;n<e.length&&e[n]!==`"`;)t+=e[n],n++;n++}else e[n]===`\\`&&n+1<e.length?(n++,t+=e[n],n++):(t+=e[n],n++);return t}function ao(e,t){let n=t.match(/\[(=|>|<|>=|<=|<>)(-?\d+(?:\.\d*)?)\]/);if(!n)return!1;let r=n[1],i=parseFloat(n[2]);switch(r){case`=`:return e===i;case`>`:return e>i;case`<`:return e<i;case`>=`:return e>=i;case`<=`:return e<=i;case`<>`:return e!==i;default:return!1}}function oo(e,t){if(typeof t==`string`){let n=co(e);return n.length>=4&&n[3]?io(n[3]).replace(/@/g,t):t}if(typeof t==`boolean`)return t?`TRUE`:`FALSE`;let n=co(e),r=/\[(=|>|<|>=|<=|<>)-?\d+(?:\.\d*)?\]/;if((n[0]&&r.test(n[0])||n[1]&&r.test(n[1]))&&n.length>=2){for(let e=0;e<Math.min(n.length,2);e++){let r=n[e].match(/\[(=|>|<|>=|<=|<>)-?\d+(?:\.\d*)?\]/);if(r&&ao(t,r[0]))return n[e]}return n[n.length>2?2:1]}return n.length===1?n[0]:n.length===2?t>=0?n[0]:n[1]:t>0?n[0]:t<0?n[1]:n[2]||n[0]}function so(e,t){let n=co(e);return n.length>=2&&n[1]===t}function co(e){let t=[],n=``,r=!1,i=!1;for(let a=0;a<e.length;a++){let o=e[a];o===`"`&&!i?(r=!r,n+=o):o===`[`&&!r?(i=!0,n+=o):o===`]`&&!r?(i=!1,n+=o):o===`;`&&!r&&!i?(t.push(n),n=``):n+=o}return t.push(n),t}function lo(e,t){if(t==null)return``;if(Ua(e))return Za(t);if(typeof t==`string`)return oo(e,t);if(typeof t==`boolean`)return t?`TRUE`:`FALSE`;let n=t,r=oo(e,n);n<0&&so(e,r)&&(n=Math.abs(n));let i=r.replace(/\[(Red|Green|Blue|Yellow|Magenta|Cyan|White|Black|Color\d+)\]/gi,``);if(i=i.replace(/\[(>|<|>=|<=|=|<>)-?\d+(\.\d+)?\]/g,``),i=i.replace(/\[\$[^\]]*\]/g,``),i=Ha(i),i=io(i),/\[[hms]+\]/i.test(i))return no(n,i);if(Wa(i))return Xa(n,i);if(i.includes(`%`))return Qa(n,i);if(/E[+-]?/i.test(i))return $a(n,i);if(/\?+\s*\/\s*[\d?]+/.test(i))return to(n,i);if(i.includes(`(`)&&i.includes(`)`)&&n<0){let e=i.replace(/\(|\)/g,``);return`(`+ro(-n,e)+`)`}if(i===`@`)return n.toString();let a=``,o=``,s=i.match(/^([^#0?.,]+)/);s&&(a=s[1],i=i.substring(s[0].length));let c=i.match(/([^#0?.,]+)$/);c&&!c[1].includes(`%`)&&(o=c[1],i=i.substring(0,i.length-c[0].length));let l=ro(n,i);return a+l+o}function uo(e){return e.getTime()/(24*3600*1e3)+25569}function fo(e){let t=e.replace(/"[^"]*"/g,``);if(/\[[hms]\]/i.test(t))return!1;let n=t.replace(/\[[^\]]*\]/g,``),r=/[hs]/i.test(n)||/AM\/PM|A\/P/i.test(n);return/[yd]/i.test(n)||/m/i.test(n)&&!r?!1:r}function po(e){let t=e.replace(/"[^"]*"/g,``);if(/\[[hms]\]/i.test(t))return!1;let n=t.replace(/\[[^\]]*\]/g,``);return!!(/[yd]/i.test(n)||/m/i.test(n)&&!(/[hs]/i.test(n)||/AM\/PM|A\/P/i.test(n)))}function mo(e,t,n){if(e instanceof Date){let r=uo(e);return fo(t)?(r%=1,r<0&&(r+=1),lo(t,r)):lo(n&&po(t)?n:t,r)}return lo(t,e)}function ho(e,t){let n=e.value,r=e.numFmt,i=typeof r==`string`?r:r?.formatCode??`General`;if(n==null)return``;if(n instanceof Date||typeof n==`number`||typeof n==`boolean`||typeof n==`string`)return mo(n,i,t);if(typeof n==`object`&&`formula`in n){let e=n.result;if(e==null)return``;if(e instanceof Date||typeof e==`number`||typeof e==`boolean`||typeof e==`string`)return mo(e,i,t)}return e.text}function go(e){return t.l2n(e.toUpperCase())-1}function _o(e){return t.n2l(e+1)}function vo(e){return parseInt(e,10)-1}function yo(e){return String(e+1)}function $(e){let n=t.decodeAddress(e.toUpperCase());return{c:n.col-1,r:n.row-1}}function bo(e){return t.encodeAddress(e.r+1,e.c+1)}function xo(e){let t=e.indexOf(`:`);if(t===-1){let t=$(e);return{s:t,e:{...t}}}return{s:$(e.slice(0,t)),e:$(e.slice(t+1))}}function So(e,t){if(t===void 0){let t=e;return So(t.s,t.e)}let n=bo(e),r=bo(t);return n===r?n:`${n}:${r}`}function Co(e,t){let n=t||{},r=new La().addWorksheet(`Sheet1`);if(e.length===0)return r;let i=new Set;e.forEach(e=>Object.keys(e).forEach(e=>i.add(e)));let a=n.header?[...n.header]:[...i];n.header&&i.forEach(e=>{a.includes(e)||a.push(e)});let o=1;n.skipHeader||(a.forEach((e,t)=>{r.getCell(o,t+1).value=e}),o++);for(let t of e)a.forEach((e,i)=>{let a=t[e];a===null&&n.nullError?r.getCell(o,i+1).value={error:`#NULL!`}:a!=null&&(r.getCell(o,i+1).value=a)}),o++;return r}function wo(e,t,n){let r=n||{};if(t.length===0)return e;let i=1,a=1;if(r.origin!==void 0)if(typeof r.origin==`string`){let e=$(r.origin);i=e.r+1,a=e.c+1}else typeof r.origin==`number`?i=r.origin===-1?e.rowCount+1:r.origin+1:(i=r.origin.r+1,a=r.origin.c+1);let o=new Set;t.forEach(e=>Object.keys(e).forEach(e=>o.add(e)));let s=r.header?[...r.header]:[...o];r.header&&o.forEach(e=>{s.includes(e)||s.push(e)});let c=i;r.skipHeader||(s.forEach((t,n)=>{e.getCell(c,a+n).value=t}),c++);for(let n of t)s.forEach((t,i)=>{let o=n[t];o===null&&r.nullError?e.getCell(c,a+i).value={error:`#NULL!`}:o!=null&&(e.getCell(c,a+i).value=o)}),c++;return e}function To(e,t){let n=t||{},r=1,i=e.rowCount,a=1,o=e.columnCount;if(n.range!==void 0){if(typeof n.range==`number`)r=n.range+1;else if(typeof n.range==`string`){let e=xo(n.range);r=e.s.r+1,i=e.e.r+1,a=e.s.c+1,o=e.e.c+1}}if(i<r||o<a)return[];let s=n.header;if(s===1){let t=[],s=n.blankrows!==!1;for(let c=r;c<=i;c++){let r=[],i=!0;for(let t=a;t<=o;t++){let o=e.getCell(c,t),s=n.raw===!1?ho(o,n.dateFormat).trim():o.value;s!=null&&s!==``?(r[t-a]=s,i=!1):n.defval===void 0?r[t-a]=null:r[t-a]=n.defval}(!i||s)&&t.push(r)}return t}if(s===`A`){let t=[],s=n.blankrows===!0;for(let c=r;c<=i;c++){let r={},i=!0;for(let t=a;t<=o;t++){let a=e.getCell(c,t),o=n.raw===!1?ho(a,n.dateFormat).trim():a.value,s=_o(t-1);o!=null&&o!==``?(r[s]=o,i=!1):n.defval!==void 0&&(r[s]=n.defval)}(!i||s)&&t.push(r)}return t}if(Array.isArray(s)){let t=[],c=n.blankrows===!0;for(let l=r;l<=i;l++){let r={},i=!0;for(let t=a;t<=o;t++){let o=t-a,c=s[o]??`__EMPTY_${o}`,u=e.getCell(l,t),d=n.raw===!1?ho(u,n.dateFormat).trim():u.value;d!=null&&d!==``?(r[c]=d,i=!1):n.defval!==void 0&&(r[c]=n.defval)}(!i||c)&&t.push(r)}return t}let c=[],l={};for(let t=a;t<=o;t++){let n=e.getCell(r,t).value,i=n==null?`__EMPTY_${t-a}`:String(n);l[i]===void 0?l[i]=0:(l[i]++,i=`${i}_${l[i]}`),c.push(i)}let u=[],d=r+1,f=n.blankrows===!0;for(let t=d;t<=i;t++){let r={},i=!0;for(let s=a;s<=o;s++){let o=e.getCell(t,s),l=n.raw===!1?ho(o,n.dateFormat).trim():o.value,u=c[s-a];l!=null&&l!==``?(r[u]=l,i=!1):n.defval!==void 0&&(r[u]=n.defval)}(!i||f)&&u.push(r)}return u}function Eo(e,t){let n=t||{},r=n.FS??`,`,i=n.RS??`
123
+ `,alwaysQuote:o=!1,quoteColumns:s=!1,quoteHeaders:c=!1,headers:l,writeHeaders:u,writeBOM:d=!1,includeEndRowDelimiter:f=!1,alwaysWriteHeaders:p=!1,transform:m}=t,h=u??!0,g=r!==!1&&r!==null,_=g?String(r):``,v=i!==void 0&&i!==!1&&i!==null?String(i):_,y=[],ee=(e,t,n=!1)=>{let r=n?c:s;return typeof r==`boolean`?r:Array.isArray(r)?r[e]===!0:typeof r==`object`&&t?r[t]===!0:!1},b=(e,t,r,i=!1)=>{if(e==null)return``;let a=String(e);if(!g)return a;let s=o||ee(t,r,i),c=RegExp(`[${Ea(n)}${Ea(_)}\r\n]`);return s||c.test(a)?_+a.replace(new RegExp(Ea(_),`g`),v+_)+_:a},x=(e,t,r=!1)=>e.map((e,n)=>b(e,n,t?.[n],r)).join(n),S=null,te=e=>m&&m.length===1?m(e):e;if(e.length>0&&!Array.isArray(e[0])){let t=e;S=l===!0?Object.keys(t[0]):Array.isArray(l)?l:null,S&&h&&y.push(x(S,S,!0));for(let e of t){let t=te(e);if(t==null)continue;let n=S?S.map(e=>t[e]):Object.values(t);y.push(x(n,S??void 0))}}else if(e.length>0){let t=e;Array.isArray(l)&&(S=l,h&&y.push(x(l,l,!0)));for(let e of t){let t=te(e);t!=null&&y.push(x(t,S??void 0))}}else p&&Array.isArray(l)&&h&&y.push(x(l,l,!0));let C=y.join(a);return C.length>0&&f&&(C+=a),d&&(C=``+C),C}const ja={true:!0,false:!1,"#N/A":{error:`#N/A`},"#REF!":{error:`#REF!`},"#NAME?":{error:`#NAME?`},"#DIV/0!":{error:`#DIV/0!`},"#NULL!":{error:`#NULL!`},"#VALUE!":{error:`#VALUE!`},"#NUM!":{error:`#NUM!`}};function Ma(e){let t=wa.create(e);return function(e){if(e===``)return null;let n=Number(e);if(!Number.isNaN(n)&&n!==1/0)return n;let r=t.parse(e);if(r)return r;let i=ja[e];return i===void 0?e:i}}function Na(e,t){let n=e?Ta.create(e,{utc:t}):Ta.iso(t);return function(e){if(e){if(e.text||e.hyperlink)return e.hyperlink||e.text||``;if(e.formula||e.result)return e.result||``;if(e instanceof Date)return n.format(e);if(e.error)return e.error;if(typeof e==`object`)return JSON.stringify(e)}return e}}function Pa(e,t,n={}){let r=t.addWorksheet(n.sheetName),i=n.dateFormats||[`YYYY-MM-DD[T]HH:mm:ssZ`,`YYYY-MM-DD[T]HH:mm:ss`,`YYYY-MM-DD`],a=n.map||Ma(i),o=ka(e,n.parserOptions);for(let e of o)r.addRow(e.map(a));return r}function Fa(e,t={}){if(!e)return``;let{dateFormat:n,dateUTC:r}=t,i=t.map||Na(n,r),a=t.includeEmptyRows!==!1,o=[],s=1;return e.eachRow((e,t)=>{if(a)for(;s++<t-1;)o.push([]);let{values:n}=e;n.shift(),o.push(n.map(i)),s=t}),Aa(o,t.formatterOptions)}var Ia=class{constructor(e){this.workbook=e}load(e,t){let n;if(typeof e==`string`)n=e;else if(e instanceof ArrayBuffer)n=new TextDecoder(`utf-8`).decode(e);else if(e instanceof Uint8Array)n=new TextDecoder(`utf-8`).decode(e);else throw Error(`Invalid data type. Expected string, ArrayBuffer, or Uint8Array.`);return Pa(n,this.workbook,t)}writeString(e){return Fa(this.workbook.getWorksheet(e?.sheetName||e?.sheetId),e)}writeBuffer(e){let t=this.writeString(e);return new TextEncoder().encode(t)}async readFile(e,t){throw Error(`CSV.readFile() is not available in browser. Use CSV.load() with string or ArrayBuffer instead.`)}async read(e,t){throw Error(`CSV.read() stream is not available in browser. Use CSV.load() with string or ArrayBuffer instead.`)}async writeFile(e,t){throw Error(`CSV.writeFile() is not available in browser. Use CSV.writeString() or CSV.writeBuffer() and handle download manually.`)}write(e,t){throw Error(`CSV.write() stream is not available in browser. Use CSV.writeString() or CSV.writeBuffer() instead.`)}},La=class extends qe{get xlsx(){return this._xlsx||=new aa(this),this._xlsx}get csv(){return this._csv||=new Ia(this),this._csv}static createStreamWriter(e){throw Error("Streaming workbook writer is not available in browser. Use `new Workbook()` with `xlsx.writeBuffer()` instead, or import from 'excelts' (Node.js) for streaming support.")}static createStreamReader(e,t){throw Error("Streaming workbook reader is not available in browser. Use `new Workbook()` with `xlsx.load()` instead, or import from 'excelts' (Node.js) for streaming support.")}};let Ra=function(e){return e[e.Legal=5]=`Legal`,e[e.Executive=7]=`Executive`,e[e.A4=9]=`A4`,e[e.A5=11]=`A5`,e[e.B5=13]=`B5`,e[e.Envelope_10=20]=`Envelope_10`,e[e.Envelope_DL=27]=`Envelope_DL`,e[e.Envelope_C5=28]=`Envelope_C5`,e[e.Envelope_B5=34]=`Envelope_B5`,e[e.Envelope_Monarch=37]=`Envelope_Monarch`,e[e.Double_Japan_Postcard_Rotated=82]=`Double_Japan_Postcard_Rotated`,e[e.K16_197x273_mm=119]=`K16_197x273_mm`,e}({});function za(e,t){let n=Math.round(e).toString();for(;n.length<t;)n=`0`+n;return n}function Ba(e){if(e.length<=3)return e;let t=e.length%3,n=e.substring(0,t);for(let r=t;r<e.length;r+=3)n+=(n.length>0?`,`:``)+e.substring(r,r+3);return n}function Va(e,t){let n=10**t;return Math.round(e*n)/n}function Ha(e){let t=e.replace(/_./g,` `);return t=t.replace(/\*./g,``),t}function Ua(e){return/^General$/i.test(e.trim())}function Wa(e){let t=e.replace(/\[[^\]]*\]/g,``);return/[ymdhs]/i.test(t)&&!/^[#0.,E%$\s()\-+]+$/i.test(t)}const Ga=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Ka=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],qa=[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],Ja=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],Ya=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];function Xa(e,t){let n=Math.round(e*86400)%86400,r=Math.floor(n/3600),i=Math.floor(n%3600/60),a=n%60,o=Ce(e,!1),s=o.getUTCFullYear(),c=o.getUTCMonth(),l=o.getUTCDate(),u=o.getUTCDay(),d=e*86400-Math.floor(e*86400),f=/AM\/PM|A\/P/i.test(t),p=r>=12,m=r%12||12,h=t.replace(/\[(Red|Green|Blue|Yellow|Magenta|Cyan|White|Black|Color\d+)\]/gi,``);h=Ha(h);let g=h.match(/ss\.(0+)/i),_=``;if(g){let e=g[1].length;_=Math.round(d*10**e).toString().padStart(e,`0`),h=h.replace(/ss\.0+/gi,`\0SF\0`)}h=h.replace(/yyyy/gi,`\0Y4\0`),h=h.replace(/yy/gi,`\0Y2\0`),h=h.replace(/mmmmm/gi,`\0MN5\0`),h=h.replace(/mmmm/gi,`\0MN4\0`),h=h.replace(/mmm/gi,`\0MN3\0`),h=h.replace(/dddd/gi,`\0DN4\0`),h=h.replace(/ddd/gi,`\0DN3\0`),h=h.replace(/dd/gi,`\0D2\0`),h=h.replace(/\bd\b/gi,`\0D1\0`),h=h.replace(/hh/gi,`\0H2\0`),h=h.replace(/\bh\b/gi,`\0H1\0`),h=h.replace(/ss/gi,`\0S2\0`),h=h.replace(/\bs\b/gi,`\0S1\0`),h=/\x00H[12]\x00.*mm|mm.*\x00S[12]\x00/i.test(h)?h.replace(/mm/gi,`\0MI2\0`):h.replace(/mm/gi,`\0M2\0`),h=h.replace(/\bm\b/gi,`\0M1\0`),h=h.replace(/AM\/PM/gi,`\0AMPM\0`),h=h.replace(/A\/P/gi,`\0AP\0`);let v=f?m:r;return h=h.replace(/\x00Y4\x00/g,s.toString()).replace(/\x00Y2\x00/g,(s%100).toString().padStart(2,`0`)).replace(/\x00MN5\x00/g,qa[c]).replace(/\x00MN4\x00/g,Ka[c]).replace(/\x00MN3\x00/g,Ga[c]).replace(/\x00M2\x00/g,(c+1).toString().padStart(2,`0`)).replace(/\x00M1\x00/g,(c+1).toString()).replace(/\x00DN4\x00/g,Ya[u]).replace(/\x00DN3\x00/g,Ja[u]).replace(/\x00D2\x00/g,l.toString().padStart(2,`0`)).replace(/\x00D1\x00/g,l.toString()).replace(/\x00H2\x00/g,v.toString().padStart(2,`0`)).replace(/\x00H1\x00/g,v.toString()).replace(/\x00MI2\x00/g,i.toString().padStart(2,`0`)).replace(/\x00S2\x00/g,a.toString().padStart(2,`0`)).replace(/\x00S1\x00/g,a.toString()).replace(/\x00SF\x00/g,a.toString().padStart(2,`0`)+`.`+_).replace(/\x00AMPM\x00/g,p?`PM`:`AM`).replace(/\x00AP\x00/g,p?`P`:`A`),h=h.replace(/\\/g,``),h}function Za(e){return typeof e==`boolean`?e?`TRUE`:`FALSE`:typeof e==`string`?e:Number.isInteger(e)?e.toString():e.toPrecision(11).replace(/\.?0+$/,``).replace(/\.?0+e/,`e`)}function Qa(e,t){let n=(t.match(/%/g)||[]).length;return ro(e*100**n,t.replace(/%/g,``)||`0`)+`%`.repeat(n)}function $a(e,t){let n=e<0?`-`:``,r=Math.abs(e);if(r===0){let e=t.match(/\.([0#]+)E/i),n=e?e[1].length:2;return`0.`+`0`.repeat(n)+`E+00`}let i=t.match(/\.([0#]+)E/i),a=i?i[1].length:2,o=t.includes(`E+`),s=Math.floor(Math.log10(r)),c=Va(r/10**s,a).toFixed(a),l=s>=0?o?`+`:``:`-`,u=za(Math.abs(s),2);return n+c+`E`+l+u}function eo(e,t){let n=e<0?-1:1,r=Math.abs(e),i=Math.floor(r);if(r-=i,r<1e-10)return[n*i,0,1];let a=0,o=1,s=1,c=0,l=Math.floor(r),u=l,d=1;for(;c<t&&(l=Math.floor(r),u=l*o+a,d=l*c+s,!(r-l<1e-10));)r=1/(r-l),a=o,o=u,s=c,c=d;return d>t&&(d=c,u=o),[n*i,n*u,d]}function to(e,t){let n=e<0?`-`:``,r=Math.abs(e),i=t.match(/\?+\s*\/\s*(\d+)/);if(i){let e=parseInt(i[1],10),a=Math.floor(r),o=r-a,s=Math.round(o*e);return t.includes(`#`)||t.includes(`0`)?s===0?n+a.toString():n+(a>0?a+` `:``)+s+`/`+e:n+(a*e+s)+`/`+e}let a=t.match(/\/\s*(\?+)/),[o,s,c]=eo(r,10**(a?a[1].length:2)-1);return t.includes(`#`)&&o!==0?s===0?n+Math.abs(o).toString():n+Math.abs(o)+` `+Math.abs(s)+`/`+c:s===0?o===0?`0`:n+Math.abs(o).toString():n+(Math.abs(o)*c+Math.abs(s))+`/`+c}function no(e,t){let n=Math.round(e*86400),r=Math.floor(n/60),i=Math.floor(r/60),a=n%60,o=r%60,s=i,c=t;return/\[h+\]/i.test(c)&&(c=c.replace(/\[h+\]/gi,s.toString())),/\[m+\]/i.test(c)&&(c=c.replace(/\[m+\]/gi,r.toString())),/\[s+\]/i.test(c)&&(c=c.replace(/\[s+\]/gi,n.toString())),c=c.replace(/mm/gi,o.toString().padStart(2,`0`)),c=c.replace(/ss/gi,a.toString().padStart(2,`0`)),c}function ro(e,t){let n=Math.abs(e),r=e<0?`-`:``,i=0,a=t;for(;a.endsWith(`,`);)i++,a=a.slice(0,-1);let o=n/1e3**i,s=a.indexOf(`.`),c=a,l=``;s!==-1&&(c=a.substring(0,s),l=a.substring(s+1));let u=l.replace(/[^0#?]/g,``).length,[d,f=``]=Va(o,u).toString().split(`.`),p=/[0#?][^0#?,.\s][0#?]/.test(c),m;if(p){let e=c.replace(/[^0#?]/g,``).length,t=d;t.length<e&&(t=`0`.repeat(e-t.length)+t),m=``;let n=t.length-e;for(let e=0;e<c.length;e++){let r=c[e];r===`0`||r===`#`||r===`?`?n<t.length&&(m+=t[n],n++):r!==`,`&&(m+=r)}}else{m=d,c.includes(`,`)&&(m=Ba(d));let e=(c.match(/0/g)||[]).length;m.length<e&&(m=`0`.repeat(e-m.length)+m)}let h=``;return u>0&&(h=`.`+(f+`0`.repeat(u)).substring(0,u)),r+m+h}function io(e){let t=``,n=0;for(;n<e.length;)if(e[n]===`"`){for(n++;n<e.length&&e[n]!==`"`;)t+=e[n],n++;n++}else e[n]===`\\`&&n+1<e.length?(n++,t+=e[n],n++):(t+=e[n],n++);return t}function ao(e,t){let n=t.match(/\[(=|>|<|>=|<=|<>)(-?\d+(?:\.\d*)?)\]/);if(!n)return!1;let r=n[1],i=parseFloat(n[2]);switch(r){case`=`:return e===i;case`>`:return e>i;case`<`:return e<i;case`>=`:return e>=i;case`<=`:return e<=i;case`<>`:return e!==i;default:return!1}}function oo(e,t){if(typeof t==`string`){let n=co(e);return n.length>=4&&n[3]?io(n[3]).replace(/@/g,t):t}if(typeof t==`boolean`)return t?`TRUE`:`FALSE`;let n=co(e),r=/\[(=|>|<|>=|<=|<>)-?\d+(?:\.\d*)?\]/;if((n[0]&&r.test(n[0])||n[1]&&r.test(n[1]))&&n.length>=2){for(let e=0;e<Math.min(n.length,2);e++){let r=n[e].match(/\[(=|>|<|>=|<=|<>)-?\d+(?:\.\d*)?\]/);if(r&&ao(t,r[0]))return n[e]}return n[n.length>2?2:1]}return n.length===1?n[0]:n.length===2?t>=0?n[0]:n[1]:t>0?n[0]:t<0?n[1]:n[2]||n[0]}function so(e,t){let n=co(e);return n.length>=2&&n[1]===t}function co(e){let t=[],n=``,r=!1,i=!1;for(let a=0;a<e.length;a++){let o=e[a];o===`"`&&!i?(r=!r,n+=o):o===`[`&&!r?(i=!0,n+=o):o===`]`&&!r?(i=!1,n+=o):o===`;`&&!r&&!i?(t.push(n),n=``):n+=o}return t.push(n),t}function lo(e,t){if(t==null)return``;if(Ua(e))return Za(t);if(typeof t==`string`)return oo(e,t);if(typeof t==`boolean`)return t?`TRUE`:`FALSE`;let n=t,r=oo(e,n);n<0&&so(e,r)&&(n=Math.abs(n));let i=r.replace(/\[(Red|Green|Blue|Yellow|Magenta|Cyan|White|Black|Color\d+)\]/gi,``);if(i=i.replace(/\[(>|<|>=|<=|=|<>)-?\d+(\.\d+)?\]/g,``),i=i.replace(/\[\$[^\]]*\]/g,``),i=Ha(i),i=io(i),/\[[hms]+\]/i.test(i))return no(n,i);if(Wa(i))return Xa(n,i);if(i.includes(`%`))return Qa(n,i);if(/E[+-]?/i.test(i))return $a(n,i);if(/\?+\s*\/\s*[\d?]+/.test(i))return to(n,i);if(i.includes(`(`)&&i.includes(`)`)&&n<0){let e=i.replace(/\(|\)/g,``);return`(`+ro(-n,e)+`)`}if(i===`@`)return n.toString();let a=``,o=``,s=i.match(/^([^#0?.,]+)/);s&&(a=s[1],i=i.substring(s[0].length));let c=i.match(/([^#0?.,]+)$/);c&&!c[1].includes(`%`)&&(o=c[1],i=i.substring(0,i.length-c[0].length));let l=ro(n,i);return a+l+o}function uo(e){return e.getTime()/(24*3600*1e3)+25569}function fo(e){let t=e.replace(/"[^"]*"/g,``);if(/\[[hms]\]/i.test(t))return!1;let n=t.replace(/\[[^\]]*\]/g,``),r=/[hs]/i.test(n)||/AM\/PM|A\/P/i.test(n);return/[yd]/i.test(n)||/m/i.test(n)&&!r?!1:r}function po(e){let t=e.replace(/"[^"]*"/g,``);if(/\[[hms]\]/i.test(t))return!1;let n=t.replace(/\[[^\]]*\]/g,``);return!!(/[yd]/i.test(n)||/m/i.test(n)&&!(/[hs]/i.test(n)||/AM\/PM|A\/P/i.test(n)))}function mo(e,t,n){if(e instanceof Date){let r=uo(e);return fo(t)?(r%=1,r<0&&(r+=1),lo(t,r)):lo(n&&po(t)?n:t,r)}return lo(t,e)}function ho(e,t){let n=e.value,r=e.numFmt,i=typeof r==`string`?r:r?.formatCode??`General`;if(n==null)return``;if(n instanceof Date||typeof n==`number`||typeof n==`boolean`||typeof n==`string`)return mo(n,i,t);if(typeof n==`object`&&`formula`in n){let e=n.result;if(e==null)return``;if(e instanceof Date||typeof e==`number`||typeof e==`boolean`||typeof e==`string`)return mo(e,i,t)}return e.text}function go(e){return t.l2n(e.toUpperCase())-1}function _o(e){return t.n2l(e+1)}function vo(e){return parseInt(e,10)-1}function yo(e){return String(e+1)}function $(e){let n=t.decodeAddress(e.toUpperCase());return{c:n.col-1,r:n.row-1}}function bo(e){return t.encodeAddress(e.r+1,e.c+1)}function xo(e){let t=e.indexOf(`:`);if(t===-1){let t=$(e);return{s:t,e:{...t}}}return{s:$(e.slice(0,t)),e:$(e.slice(t+1))}}function So(e,t){if(t===void 0){let t=e;return So(t.s,t.e)}let n=bo(e),r=bo(t);return n===r?n:`${n}:${r}`}function Co(e,t){let n=t||{},r=new La().addWorksheet(`Sheet1`);if(e.length===0)return r;let i=new Set;e.forEach(e=>Object.keys(e).forEach(e=>i.add(e)));let a=n.header?[...n.header]:[...i];n.header&&i.forEach(e=>{a.includes(e)||a.push(e)});let o=1;n.skipHeader||(a.forEach((e,t)=>{r.getCell(o,t+1).value=e}),o++);for(let t of e)a.forEach((e,i)=>{let a=t[e];a===null&&n.nullError?r.getCell(o,i+1).value={error:`#NULL!`}:a!=null&&(r.getCell(o,i+1).value=a)}),o++;return r}function wo(e,t,n){let r=n||{};if(t.length===0)return e;let i=1,a=1;if(r.origin!==void 0)if(typeof r.origin==`string`){let e=$(r.origin);i=e.r+1,a=e.c+1}else typeof r.origin==`number`?i=r.origin===-1?e.rowCount+1:r.origin+1:(i=r.origin.r+1,a=r.origin.c+1);let o=new Set;t.forEach(e=>Object.keys(e).forEach(e=>o.add(e)));let s=r.header?[...r.header]:[...o];r.header&&o.forEach(e=>{s.includes(e)||s.push(e)});let c=i;r.skipHeader||(s.forEach((t,n)=>{e.getCell(c,a+n).value=t}),c++);for(let n of t)s.forEach((t,i)=>{let o=n[t];o===null&&r.nullError?e.getCell(c,a+i).value={error:`#NULL!`}:o!=null&&(e.getCell(c,a+i).value=o)}),c++;return e}function To(e,t){let n=t||{},r=1,i=e.rowCount,a=1,o=e.columnCount;if(n.range!==void 0){if(typeof n.range==`number`)r=n.range+1;else if(typeof n.range==`string`){let e=xo(n.range);r=e.s.r+1,i=e.e.r+1,a=e.s.c+1,o=e.e.c+1}}if(i<r||o<a)return[];let s=n.header;if(s===1){let t=[],s=n.blankrows!==!1;for(let c=r;c<=i;c++){let r=[],i=!0;for(let t=a;t<=o;t++){let o=e.getCell(c,t),s=n.raw===!1?ho(o,n.dateFormat).trim():o.value;s!=null&&s!==``?(r[t-a]=s,i=!1):n.defval===void 0?r[t-a]=null:r[t-a]=n.defval}(!i||s)&&t.push(r)}return t}if(s===`A`){let t=[],s=n.blankrows===!0;for(let c=r;c<=i;c++){let r={},i=!0;for(let t=a;t<=o;t++){let a=e.getCell(c,t),o=n.raw===!1?ho(a,n.dateFormat).trim():a.value,s=_o(t-1);o!=null&&o!==``?(r[s]=o,i=!1):n.defval!==void 0&&(r[s]=n.defval)}(!i||s)&&t.push(r)}return t}if(Array.isArray(s)){let t=[],c=n.blankrows===!0;for(let l=r;l<=i;l++){let r={},i=!0;for(let t=a;t<=o;t++){let o=t-a,c=s[o]??`__EMPTY_${o}`,u=e.getCell(l,t),d=n.raw===!1?ho(u,n.dateFormat).trim():u.value;d!=null&&d!==``?(r[c]=d,i=!1):n.defval!==void 0&&(r[c]=n.defval)}(!i||c)&&t.push(r)}return t}let c=[],l={};for(let t=a;t<=o;t++){let n=e.getCell(r,t).value,i=n==null?`__EMPTY_${t-a}`:String(n);l[i]===void 0?l[i]=0:(l[i]++,i=`${i}_${l[i]}`),c.push(i)}let u=[],d=r+1,f=n.blankrows===!0;for(let t=d;t<=i;t++){let r={},i=!0;for(let s=a;s<=o;s++){let o=e.getCell(t,s),l=n.raw===!1?ho(o,n.dateFormat).trim():o.value,u=c[s-a];l!=null&&l!==``?(r[u]=l,i=!1):n.defval!==void 0&&(r[u]=n.defval)}(!i||f)&&u.push(r)}return u}function Eo(e,t){let n=t||{},r=n.FS??`,`,i=n.RS??`
124
124
  `,a=[];return e.eachRow({includeEmpty:n.blankrows!==!1},(t,i)=>{let o=[],s=!0;for(t.eachCell({includeEmpty:!0},(e,t)=>{let i=``;e.value!=null&&(i=e.value instanceof Date?e.value.toISOString():typeof e.value==`object`?`result`in e.value?String(e.value.result??``):`text`in e.value?String(e.value.text??``):`richText`in e.value?e.value.richText.map(e=>e.text).join(``):String(e.value):String(e.value),s=!1),(n.forceQuotes||i.includes(r)||i.includes(`"`)||i.includes(`
125
125
  `)||i.includes(`\r`))&&(i=`"${i.replace(/"/g,`""`)}"`),o.push(i)});o.length<e.columnCount;)o.push(``);(!s||n.blankrows!==!1)&&a.push(o.join(r))}),a.join(i)}function Do(){return new La}function Oo(e,t,n){let r=e.addWorksheet(n);t.eachRow({includeEmpty:!0},(e,t)=>{e.eachCell({includeEmpty:!0},(e,n)=>{let i=r.getCell(t,n);i.value=e.value,e.style&&(i.style=e.style)})}),t.columns?.forEach((e,t)=>{e&&r.columns[t]&&e.width&&(r.getColumn(t+1).width=e.width)})}function ko(e,t){let n=new La().addWorksheet(`Sheet1`);if(e.length===0)return n;let r=1,i=1;if(t?.origin!==void 0)if(typeof t.origin==`string`){let e=$(t.origin);r=e.r+1,i=e.c+1}else typeof t.origin==`number`?r=t.origin+1:(r=t.origin.r+1,i=t.origin.c+1);return e.forEach((e,t)=>{e&&e.forEach((e,a)=>{e!=null&&(n.getCell(r+t,i+a).value=e)})}),n}function Ao(e,t,n){if(t.length===0)return e;let r=1,i=1;if(n?.origin!==void 0)if(typeof n.origin==`string`){let e=$(n.origin);r=e.r+1,i=e.c+1}else typeof n.origin==`number`?r=n.origin===-1?e.rowCount+1:n.origin+1:(r=n.origin.r+1,i=n.origin.c+1);return t.forEach((t,n)=>{t&&t.forEach((t,a)=>{t!=null&&(e.getCell(r+n,i+a).value=t)})}),e}function jo(e){let t=[];return e.eachRow({includeEmpty:!0},(e,n)=>{let r=[];e.eachCell({includeEmpty:!0},(e,t)=>{r[t-1]=e.value}),t[n-1]=r}),t}const Mo={decodeCol:go,encodeCol:_o,decodeRow:vo,encodeRow:yo,decodeCell:$,encodeCell:bo,decodeRange:xo,encodeRange:So,jsonToSheet:Co,sheetAddJson:wo,sheetToJson:To,sheetToCsv:Eo,aoaToSheet:ko,sheetAddAoa:Ao,sheetToAoa:jo,bookNew:Do,bookAppendSheet:Oo};export{se as Anchor,b as Cell,A as Column,de as DataValidations,o as DocumentType,l as Enums,c as ErrorValue,i as FormulaType,ce as Image,Ra as PaperSize,n as Range,s as ReadingOrder,a as RelationshipType,k as Row,ue as Table,r as ValueType,La as Workbook,Ve as Worksheet,ko as aoaToSheet,Oo as bookAppendSheet,Do as bookNew,$ as decodeCell,go as decodeCol,xo as decodeRange,vo as decodeRow,bo as encodeCell,_o as encodeCol,So as encodeRange,yo as encodeRow,Co as jsonToSheet,Ao as sheetAddAoa,wo as sheetAddJson,jo as sheetToAoa,Eo as sheetToCsv,To as sheetToJson,Mo as utils};
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @cj-tech-master/excelts v2.0.0-canary.20251228013952.4f2c3c6
2
+ * @cj-tech-master/excelts v2.0.0
3
3
  * TypeScript Excel Workbook Manager - Read and Write xlsx and csv Files.
4
4
  * (c) 2025 cjnoname
5
5
  * Released under the MIT License
@@ -16785,6 +16785,13 @@ var ExcelTS = (function(exports) {
16785
16785
  [25, [parseISOOffset]],
16786
16786
  [29, [parseISOMsOffset]]
16787
16787
  ];
16788
+ function tzOffset(d) {
16789
+ const off = -d.getTimezoneOffset();
16790
+ const sign = off >= 0 ? "+" : "-";
16791
+ const h = Math.abs(off) / 60 | 0;
16792
+ const m = Math.abs(off) % 60;
16793
+ return `${sign}${PAD2[h]}:${PAD2[m]}`;
16794
+ }
16788
16795
  /**
16789
16796
  * Optimized date parser for batch processing
16790
16797
  *
@@ -16838,13 +16845,6 @@ var ExcelTS = (function(exports) {
16838
16845
  return out;
16839
16846
  }
16840
16847
  };
16841
- function tzOffset(d) {
16842
- const off = -d.getTimezoneOffset();
16843
- const sign = off >= 0 ? "+" : "-";
16844
- const h = Math.abs(off) / 60 | 0;
16845
- const m = Math.abs(off) % 60;
16846
- return `${sign}${PAD2[h]}:${PAD2[m]}`;
16847
- }
16848
16848
  /**
16849
16849
  * Optimized date formatter for batch processing
16850
16850
  *