@mescius/wijmo.xlsx 5.20232.939

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.
@@ -0,0 +1,14 @@
1
+ /*!
2
+ *
3
+ * Wijmo Library 5.20232.939
4
+ * https://developer.mescius.com/wijmo
5
+ *
6
+ * Copyright(c) MESCIUS inc. All rights reserved.
7
+ *
8
+ * Licensed under the End-User License Agreement For MESCIUS Wijmo Software.
9
+ * us.sales@mescius.com
10
+ * https://developer.mescius.com/wijmo/licensing
11
+ *
12
+ */
13
+
14
+ "use strict";var __importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)Object.hasOwnProperty.call(e,s)&&(t[s]=e[s]);t.default=e;return t},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const wijmo_1=require("@mescius/wijmo"),selfModule=__importStar(require("@mescius/wijmo.xlsx")),jszip_1=__importDefault(require("jszip"));class Workbook{constructor(){this._externalCancellation=null}get sheets(){null==this._sheets&&(this._sheets=[]);return this._sheets}get styles(){null==this._styles&&(this._styles=[]);return this._styles}get definedNames(){null==this._definedNames&&(this._definedNames=[]);return this._definedNames}get colorThemes(){null==this._colorThemes&&(this._colorThemes=[]);return this._colorThemes}get reservedContent(){null==this._reservedContent&&(this._reservedContent={});return this._reservedContent}set reservedContent(e){this._reservedContent=e}save(e){var t=_xlsx.save(this),s=!(!this._reservedContent||!this._reservedContent.macros);e&&Workbook._saveToFile(t.base64,e,s);return t.base64}saveAsync(e,t,s,l){this.cancelAsync(()=>{this._cs=wijmo_1.isFunction(this._externalCancellation)?this._externalCancellation():new _SyncPromise;_xlsx.saveAsync(this,this._cs,s,l).then(s=>{if(e){let t=!(!this._reservedContent||!this._reservedContent.macros);Workbook._saveToFile(s,e,t)}this._cs=null;wijmo_1.isFunction(l)&&l(100);t&&t(s)},()=>this._cs=null)})}cancelAsync(e){if(this._cs){this._cs.cancel();setTimeout(()=>{this._cs=null;wijmo_1.isFunction(e)&&e()},100)}else wijmo_1.isFunction(e)&&e()}load(e,t=!0){wijmo_1.isString(e)&&(e=this._getBase64String(e));let s=_xlsx.load(e,t);this._deserialize(s);e=null;s=null}loadAsync(e,t,s,l=!0){wijmo_1.isString(e)&&(e=this._getBase64String(e));_xlsx.loadAsync(e,l).then(s=>{this._deserialize(s);e=null;s=null;t(this)}).catch(s)}_serialize(){var e={sheets:[]};e.sheets=this._serializeWorkSheets();this._styles&&this._styles.length>0&&(e.styles=this._serializeWorkbookStyles());this._reservedContent&&(e.reservedContent=this._reservedContent);null!=this.activeWorksheet&&!isNaN(this.activeWorksheet)&&this.activeWorksheet>=0&&(e.activeWorksheet=this.activeWorksheet);this.application&&(e.application=this.application);this.company&&(e.company=this.company);null!=this.created&&(e.created=this.created);this.creator&&(e.creator=this.creator);this.lastModifiedBy&&(e.lastModifiedBy=this.lastModifiedBy);null!=this.modified&&(e.modified=this.modified);this._definedNames&&this._definedNames.length>0&&(e.definedNames=this._serializeDefinedNames());this._colorThemes&&this._colorThemes.length>0&&(e.colorThemes=this._colorThemes.slice());return e}_deserialize(e){this._deserializeWorkSheets(e.sheets);e.styles&&e.styles.length>0&&this._deserializeWorkbookStyles(e.styles);this.activeWorksheet=e.activeWorksheet;this.application=e.application;this.company=e.company;this.created=e.created;this.creator=e.creator;this.lastModifiedBy=e.lastModifiedBy;this.modified=e.modified;this.reservedContent=e.reservedContent;e.definedNames&&e.definedNames.length>0&&this._deserializeDefinedNames(e.definedNames);e.colorThemes&&e.colorThemes.length>0&&(this._colorThemes=e.colorThemes.slice())}_addWorkSheet(e,t){null==this._sheets&&(this._sheets=[]);null==t||isNaN(t)?this._sheets.push(e):this._sheets[t]=e}static _saveToFile(e,t,s){var l,i,r=s?"xlsm":"xlsx",o="xlsm"===r?"application/vnd.ms-excel.sheet.macroEnabled.12":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";if((i=t.lastIndexOf("."))<0)t+="."+r;else{if(0===i)throw"Invalid file name.";""===(l=t.substring(i+1))?t+="."+r:l!==r&&(t+="."+r)}wijmo_1.saveFile(new Blob([_Base64.toArray(e)],{type:o}),t)}_getBase64String(e){if(null==e||0===e.length)throw"Invalid xlsx file content.";let t=e.search(/base64,/i);return-1!==t?e.substring(t+7):e}static toXlsxDateFormat(e){var t;if(1===e.length)switch(e){case"r":case"R":return"ddd, dd MMM yyyy HH:mm:ss &quot;GMT&quot;";case"u":return"yyyy-MM-dd&quot;T&quot;HH:mm:ss&quot;Z&quot;";case"o":case"O":t=(t=wijmo_1.culture.Globalize.calendar.patterns[e]).replace(/f+k/gi,"000");break;default:t=wijmo_1.culture.Globalize.calendar.patterns[e]}t||(t=e);t=t.replace(/"/g,"").replace(/tt/,"AM/PM").replace(/t/,"A/P").replace(/M+/gi,e=>e.toLowerCase()).replace(/g+y+/gi,e=>e.substring(0,e.indexOf("y"))+"e");return/FY|Q/i.test(t)?"General":t}static toXlsxNumberFormat(e){let t,s,l,i=e?e.toLowerCase():"";if(/^[ncpfdgex]\d*.*,*$/.test(i)){t=i[0];s=this._formatMap[t]}if("x"===t)return"";if(s){let r=i.split(",");if("c"===t){let t=wijmo_1.culture.Globalize.numberFormat.currency,l=e?e.match(/([a-z])(\d*)(,*)(.*)/i):null,i=l&&l[4]?l[4]:t.symbol;"​"===i&&(i="");let r=this._formatMap.n,o=t.pattern,a=o[0].replace("n",r).replace("$","{1}"),n=o[1].replace("n",r).replace("$","{1}");")"===a[a.length-1]&&(n+="_)");s=(s=n+";"+a).replace(/\{1\}/g,i)}let o=-1;i.length>1?o=parseInt(r[0].substr(1)):"d"!==t&&(o="e"===t?6:2);let a="";if(!isNaN(o))for(let e=0;e<o;e++)a+="0";for(let e=0;e<r.length-1;e++)a+=",";l=a.length>0?"d"===t?s.replace(/\{0\}/g,a):s.replace(/\{0\}/g,(!isNaN(o)&&o>0?".":"")+a):"d"===t?s.replace(/\{0\}/g,"0"):s.replace(/\{0\}/g,"")}else l=i;return l}static fromXlsxFormat(e){var t,s,l,i,r,o,a,n,h,c=[],d=wijmo_1.culture.Globalize.numberFormat.currency.symbol;if(!e||"General"===e)return[""];s=(e=e.replace(/;@/g,"").replace(/&quot;?/g,"")).split(";");for(i=0;i<s.length;i++){l=s[i];if(/[hsmy\:]/i.test(l))t=this._fromXlsxDateFormat(l);else{o=l.lastIndexOf(".");a=l.lastIndexOf("0");n=l.lastIndexOf(",");if(l.search(/\[\$([^\-\]]+)[^\]]*\]/)>-1||l.indexOf(d)>-1&&-1===l.search(/\[\$([\-\]]+)[^\]]*\]/))t="c";else if("%"===l[e.length-1])t="p";else if(l.search("E+")>0){t="e";a=l.lastIndexOf("E")-1}else t="n";t+=o>-1&&o<a?l.substring(o,a).length:"0";/^0+,*$/.test(l)&&(t="d"+((a=l.lastIndexOf("0"))+1));if(n>-1&&a>-1&&a<n){h=l.substring(a+1,n+1).split("");for(r=0;r<h.length;r++)t+=","}}c.push(t)}return c}static _fromXlsxDateFormat(e){return e.replace(/\[\$\-.+\]/g,"").replace(/(\\)(.)/g,"$2").replace(/H+/g,e=>e.toLowerCase()).replace(/m+/g,e=>e.toUpperCase()).replace(/S+/g,e=>e.toLowerCase()).replace(/AM\/PM/gi,"tt").replace(/A\/P/gi,"t").replace(/\.000/g,".fff").replace(/\.00/g,".ff").replace(/\.0/g,".f").replace(/\\[\-\s,]/g,e=>e.substring(1)).replace(/Y+/g,e=>e.toLowerCase()).replace(/D+/g,e=>e.toLowerCase()).replace(/M+:?|:?M+/gi,e=>e.indexOf(":")>-1?e.toLowerCase():e).replace(/g+e/gi,e=>e.substring(0,e.length-1)+"yy")}static _parseCellFormat(e,t){return t?this.toXlsxDateFormat(e):this.toXlsxNumberFormat(e)}static _parseExcelFormat(e){if(null!=e){var t=e&&e.style&&e.style.format;if((null!=e.value||t)&&!isNaN(e.value)){var s=wijmo_1.isNumber(e.value);return!s||t&&"General"!==t?e.isDate||wijmo_1.isDate(e.value)||s||""===e.value||e.isNumber?this.fromXlsxFormat(t)[0]:t:wijmo_1.isInt(e.value)?"d":"f2"}}}static xlsxAddress(e,t,s,l,i){var r=s?"$":"",o=null==l?r:l?"$":"";return!0===i?"":(isNaN(t)?"":o+this._numAlpha(t))+(!1===i?"":isNaN(e)?"":r+(e+1).toString())}static tableAddress(e){var t=e&&/^((\$?)([A-Za-z]+))?((\$?)(\d+))?$/.exec(e),s={};if(!t)return null;if(t[3]){s.col=this._alphaNum(t[3]);s.absCol=!!t[2]}if(t[6]){s.row=+t[6]-1;s.absRow=!!t[5]}return s}static _parseHAlignToString(e){switch(e){case HAlign.Left:return"left";case HAlign.Center:return"center";case HAlign.Right:return"right";case HAlign.Justify:return"justify";default:return"general"}}static _parseStringToHAlign(e){var t=e?e.toLowerCase():"";return"left"===t?HAlign.Left:"center"===t?HAlign.Center:"right"===t?HAlign.Right:"justify"===t?HAlign.Justify:HAlign.General}static _parseVAlignToString(e){switch(e){case VAlign.Bottom:return"bottom";case VAlign.Center:return"center";case VAlign.Top:return"top";default:return null}}static _parseStringToVAlign(e){var t=e?e.toLowerCase():"";return"top"===t?VAlign.Top:"center"===t||"middle"===t?VAlign.Center:"bottom"===t?VAlign.Bottom:null}static _parseBorderTypeToString(e){switch(e){case BorderStyle.Dashed:return"dashed";case BorderStyle.Dotted:return"dotted";case BorderStyle.Double:return"double";case BorderStyle.Hair:return"hair";case BorderStyle.Medium:return"medium";case BorderStyle.MediumDashDotDotted:return"mediumDashDotDot";case BorderStyle.MediumDashDotted:return"mediumDashDot";case BorderStyle.MediumDashed:return"mediumDashed";case BorderStyle.SlantedMediumDashDotted:return"slantDashDot";case BorderStyle.Thick:return"thick";case BorderStyle.Thin:return"thin";case BorderStyle.ThinDashDotDotted:return"dashDotDot";case BorderStyle.ThinDashDotted:return"dashDot";case BorderStyle.None:default:return"none"}}static _parseStringToBorderType(e){return"dashed"===e?BorderStyle.Dashed:"dotted"===e?BorderStyle.Dotted:"double"===e?BorderStyle.Double:"hair"===e?BorderStyle.Hair:"medium"===e?BorderStyle.Medium:"mediumDashDotDot"===e?BorderStyle.MediumDashDotDotted:"mediumDashDot"===e?BorderStyle.MediumDashDotted:"mediumDashed"===e?BorderStyle.MediumDashed:"slantDashDot"===e?BorderStyle.SlantedMediumDashDotted:"thick"===e?BorderStyle.Thick:"thin"===e?BorderStyle.Thin:"dashDotDot"===e?BorderStyle.ThinDashDotDotted:"dashDot"===e?BorderStyle.ThinDashDotted:null}static _escapeXML(e){return"string"==typeof e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):""}static _unescapeXML(e){return"string"==typeof e?e.indexOf("&")>=0?e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x27;/g,"'").replace(/&#x2F;/g,"/").replace(/&amp;/g,"&"):e:""}static _numAlpha(e){var t=Math.floor(e/26)-1;return(t>-1?this._numAlpha(t):"")+this._alphabet.charAt(e%26)}static _alphaNum(e){var t=0;e&&(e=e.toUpperCase());2===e.length&&(t=this._alphaNum(e.charAt(0))+1);return 26*t+this._alphabet.indexOf(e.substr(-1))}_serializeWorkSheets(){var e,t,s=[];for(t=0;t<this._sheets.length;t++)(e=this._sheets[t])&&(s[t]=e._serialize());return s}_serializeWorkbookStyles(){var e,t,s=[];for(t=0;t<this._styles.length;t++)(e=this._styles[t])&&(s[t]=e._serialize());return s}_serializeDefinedNames(){var e,t,s=[];for(t=0;t<this._definedNames.length;t++)(e=this._definedNames[t])&&(s[t]=e._serialize());return s}_serializeTableStyles(){var e,t,s=[];for(t=0;t<this._tableStyles.length;t++)(e=this._tableStyles[t])&&(s[t]=e._serialize());return s}_deserializeWorkSheets(e){var t,s,l;this._sheets=[];wijmo_1.assert(null!=e,"workSheets should not be null.");for(l=0;l<e.length;l++)if(s=e[l]){(t=new WorkSheet)._deserialize(s);this._sheets[l]=t}}_deserializeWorkbookStyles(e){var t,s,l;this._styles=[];for(l=0;l<e.length;l++)if(s=e[l]){(t=new WorkbookStyle)._deserialize(s);this._styles[l]=t}}_deserializeDefinedNames(e){var t,s,l;this._definedNames=[];for(l=0;l<e.length;l++)if(s=e[l]){(t=new DefinedName)._deserialize(s);this._definedNames[l]=t}}_deserializeTableStyles(e){var t,s,l;this._tableStyles=[];for(l=0;l<e.length;l++)if(s=e[l]){(t=new WorkbookTableStyle)._deserialize(s);this._tableStyles[l]=t}}}Workbook._alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ";Workbook._formatMap={n:"#,##0{0}",c:"{1}#,##0{0}_);({1}#,##0{0})",e:"0{0}E+0",p:"#,##0{0}%",f:"0{0}",d:"{0}",g:"0{0}"};exports.Workbook=Workbook;class WorkSheet{constructor(){}get columns(){null==this._columns&&(this._columns=[]);return this._columns}get rows(){null==this._rows&&(this._rows=[]);return this._rows}get tables(){null==this._tables&&(this._tables=[]);return this._tables}_serialize(){if(this._checkEmptyWorkSheet())return null;let e={};this.style&&(e.style=this.style._serialize());this._columns&&this._columns.length>0&&(e.columns=this._serializeWorkbookColumns());this._rows&&this._rows.length>0&&(e.rows=this._serializeWorkbookRows());this.frozenPane&&(e.frozenPane=this.frozenPane._serialize());this.name&&(e.name=this.name);null!=this.summaryBelow&&(e.summaryBelow=this.summaryBelow);null!=this.visible&&(e.visible=this.visible);this._tables&&this._tables.length>0&&(e.tables=this._serializeTables());this._extraColumn&&(e._extraColumn=this._extraColumn._serialize());e.rightToLeft=this.rightToLeft;return e}_deserialize(e){let t,s;if(e.style){(s=new WorkbookStyle)._deserialize(e.style);this.style=s}e.columns&&e.columns.length>0&&this._deserializeWorkbookColumns(e.columns);e.rows&&e.rows.length>0&&this._deserializeWorkbookRows(e.rows);if(e.frozenPane){(t=new WorkbookFrozenPane)._deserialize(e.frozenPane);this.frozenPane=t}this.name=e.name;this.summaryBelow=e.summaryBelow;this.visible=e.visible;e.tables&&e.tables.length>0&&this._deserializeTables(e.tables);if(e._extraColumn){this._extraColumn=new _WorkbookExtraColumn;this._extraColumn._deserialize(e._extraColumn)}this.rightToLeft=e.rightToLeft}_addWorkbookColumn(e,t){null==this._columns&&(this._columns=[]);null==t||isNaN(t)?this._columns.push(e):this._columns[t]=e}_addWorkbookRow(e,t){null==this._rows&&(this._rows=[]);null==t||isNaN(t)?this._rows.push(e):this._rows[t]=e}_serializeWorkbookColumns(){var e,t,s=[];for(t=0;t<this._columns.length;t++)(e=this._columns[t])&&(s[t]=e._serialize());return s}_serializeWorkbookRows(){var e,t,s=[];for(t=0;t<this._rows.length;t++)(e=this._rows[t])&&(s[t]=e._serialize());return s}_serializeTables(){var e,t,s=[];for(t=0;t<this._tables.length;t++)(e=this._tables[t])&&(s[t]=e._serialize());return s}_deserializeWorkbookColumns(e){var t,s,l;this._columns=[];for(l=0;l<e.length;l++)if(t=e[l]){(s=new WorkbookColumn)._deserialize(t);this._columns[l]=s}}_deserializeWorkbookRows(e){var t,s,l;this._rows=[];for(l=0;l<e.length;l++)if(t=e[l]){(s=new WorkbookRow)._deserialize(t);this._rows[l]=s}}_deserializeTables(e){var t,s,l;this._tables=[];for(l=0;l<e.length;l++)if(s=e[l]){(t=new WorkbookTable)._deserialize(s);this._tables[l]=t}}_checkEmptyWorkSheet(){return!(null!=this._rows||null!=this._columns||null!=this.visible||null!=this.summaryBelow||null!=this.frozenPane||null!=this.style||null!=this.name&&""!==this.name||null!=this._tables&&0!=this._tables.length)}}exports.WorkSheet=WorkSheet;class WorkbookColumn{constructor(){}_serialize(){var e;if(this._checkEmptyWorkbookColumn())return null;e={};this.style&&(e.style=this.style._serialize());null!=this.autoWidth&&(e.autoWidth=this.autoWidth);null!=this.width&&(e.width=this.width);null!=this.visible&&(e.visible=this.visible);return e}_deserialize(e){var t;if(e.style){(t=new WorkbookStyle)._deserialize(e.style);this.style=t}this.autoWidth=e.autoWidth;this.visible=e.visible;this.width=e.width}_checkEmptyWorkbookColumn(){return null==this.style&&null==this.width&&null==this.autoWidth&&null==this.visible}}exports.WorkbookColumn=WorkbookColumn;class _WorkbookExtraColumn extends WorkbookColumn{constructor(){super()}_serialize(){var e=super._serialize();e.min=this.min;e.max=this.max;return e}_deserialize(e){super._deserialize(e);this.min=e.min;this.max=e.max}}exports._WorkbookExtraColumn=_WorkbookExtraColumn;class WorkbookRow{constructor(){}get cells(){null==this._cells&&(this._cells=[]);return this._cells}_serialize(){var e;if(this._checkEmptyWorkbookRow())return null;e={};this._cells&&this._cells.length>0&&(e.cells=this._serializeWorkbookCells());this.style&&(e.style=this.style._serialize());null!=this.collapsed&&(e.collapsed=this.collapsed);null==this.groupLevel||isNaN(this.groupLevel)||(e.groupLevel=this.groupLevel);null==this.height||isNaN(this.height)||(e.height=this.height);null!=this.visible&&(e.visible=this.visible);return e}_deserialize(e){var t;e.cells&&e.cells.length>0&&this._deserializeWorkbookCells(e.cells);if(e.style){(t=new WorkbookStyle)._deserialize(e.style);this.style=t}this.collapsed=e.collapsed;this.groupLevel=e.groupLevel;this.height=e.height;this.visible=e.visible}_addWorkbookCell(e,t){null==this._cells&&(this._cells=[]);null==t||isNaN(t)?this._cells.push(e):this._cells[t]=e}_serializeWorkbookCells(){var e,t,s=[];for(t=0;t<this._cells.length;t++)(e=this._cells[t])&&(s[t]=e._serialize());return s}_deserializeWorkbookCells(e){var t,s,l;this._cells=[];for(l=0;l<e.length;l++)if(t=e[l]){(s=new WorkbookCell)._deserialize(t);this._cells[l]=s}}_checkEmptyWorkbookRow(){return null==this._cells&&null==this.style&&null==this.collapsed&&null==this.visible&&(null==this.height||isNaN(this.height))&&(null==this.groupLevel||isNaN(this.groupLevel))}}exports.WorkbookRow=WorkbookRow;class WorkbookCell{constructor(){}_serialize(){var e;if(this._checkEmptyWorkbookCell())return null;e={};this.style&&(e.style=this.style._serialize());null!=this.value&&(e.value=this.value);this.formula&&(e.formula=this.formula);null!=this.isDate&&(e.isDate=this.isDate);null!=this.isNumber&&(e.isNumber=this.isNumber);null!=this.colSpan&&!isNaN(this.colSpan)&&this.colSpan>1&&(e.colSpan=this.colSpan);null!=this.rowSpan&&!isNaN(this.rowSpan)&&this.rowSpan>1&&(e.rowSpan=this.rowSpan);this.link&&(e.link=this.link);e.textRuns=_TextRunsSerializer.serialize(this.textRuns);this.note&&(e.note=this.note._serialize());return e}_deserialize(e){var t;if(e.style){(t=new WorkbookStyle)._deserialize(e.style);this.style=t}this.value=e.value;this.formula=e.formula;this.isDate=e.isDate;this.isNumber=e.isNumber;this.colSpan=e.colSpan;this.rowSpan=e.rowSpan;this.link=e.link;this.textRuns=_TextRunsSerializer.deserialize(e.textRuns);if(e.note){this.note=new WorkbookNote;this.note._deserialize(e.note)}}_checkEmptyWorkbookCell(){return null==this.style&&null==this.value&&null==this.isDate&&null==this.isNumber&&(null==this.formula||""===this.formula)&&(null==this.colSpan||isNaN(this.colSpan)||this.colSpan<=1)&&(null==this.rowSpan||isNaN(this.rowSpan)||this.rowSpan<=1)&&(null==this.link||""===this.link)}}exports.WorkbookCell=WorkbookCell;class WorkbookNote{constructor(){}_serialize(){if(!(null!=this.text||this.textRuns&&this.textRuns.length))return null;let e={};null!=this.author&&(e.author=this.author);null!=this.text&&(e.text=this.text);e.textRuns=_TextRunsSerializer.serialize(this.textRuns);null!=this.visible&&(e.visible=this.visible);null!=this.offsetX&&(e.offsetX=this.offsetX);null!=this.offsetY&&(e.offsetY=this.offsetY);null!=this.width&&(e.width=this.width);null!=this.height&&(e.height=this.height);return e}_deserialize(e){this.author=e.author;this.text=e.text;this.textRuns=_TextRunsSerializer.deserialize(e.textRuns);this.visible=e.visible;this.offsetX=e.offsetX;this.offsetY=e.offsetY;this.width=e.width;this.height=e.height}}exports.WorkbookNote=WorkbookNote;class WorkbookFrozenPane{constructor(){}_serialize(){return null!=this.columns&&!isNaN(this.columns)&&0!==this.columns||null!=this.rows&&!isNaN(this.rows)&&0!==this.rows?{columns:this.columns,rows:this.rows}:null}_deserialize(e){this.columns=e.columns;this.rows=e.rows}}exports.WorkbookFrozenPane=WorkbookFrozenPane;class WorkbookStyle{constructor(){}_serialize(){var e;if(this._checkEmptyWorkbookStyle())return null;e={};this.basedOn&&(e.basedOn=this.basedOn._serialize());this.fill&&(e.fill=this.fill._serialize());this.font&&(e.font=this.font._serialize());this.borders&&(e.borders=this.borders._serialize());this.format&&(e.format=this.format);null!=this.hAlign&&(e.hAlign=wijmo_1.asEnum(this.hAlign,HAlign,!1));null!=this.vAlign&&(e.vAlign=wijmo_1.asEnum(this.vAlign,VAlign,!1));null==this.indent||isNaN(this.indent)||(e.indent=this.indent);this.wordWrap&&(e.wordWrap=this.wordWrap);return e}_deserialize(e){var t,s,l,i;if(e.basedOn){(t=new WorkbookStyle)._deserialize(e.basedOn);this.basedOn=t}if(e.fill){(s=new WorkbookFill)._deserialize(e.fill);this.fill=s}if(e.font){(l=new WorkbookFont)._deserialize(e.font);this.font=l}if(e.borders){(i=new WorkbookBorder)._deserialize(e.borders);this.borders=i}this.format=e.format;null!=e.hAlign&&(this.hAlign=wijmo_1.asEnum(e.hAlign,HAlign,!1));null!=e.vAlign&&(this.vAlign=wijmo_1.asEnum(e.vAlign,VAlign,!1));null==e.indent||isNaN(e.indent)||(this.indent=e.indent);e.wordWrap&&(this.wordWrap=e.wordWrap)}_checkEmptyWorkbookStyle(){return null==this.basedOn&&null==this.fill&&null==this.font&&null==this.borders&&(null==this.format||""===this.format)&&null==this.hAlign&&null==this.vAlign&&null==this.wordWrap}}exports.WorkbookStyle=WorkbookStyle;class WorkbookFont{constructor(){}_serialize(){var e;if(this._checkEmptyWorkbookFont())return null;e={};null!=this.bold&&(e.bold=this.bold);null!=this.italic&&(e.italic=this.italic);null!=this.underline&&(e.underline=this.underline);this.color&&(e.color=this.color);this.family&&(e.family=this.family);null==this.size||isNaN(this.size)||(e.size=this.size);return e}_deserialize(e){this.bold=e.bold;null!=e.color&&(this.color=e.color);this.family=e.family;this.italic=e.italic;this.size=e.size;this.underline=e.underline}_checkEmptyWorkbookFont(){return null==this.bold&&null==this.italic&&null==this.underline&&(null==this.color||""===this.color)&&(null==this.family||""===this.family)&&(null==this.size||isNaN(this.size))}}exports.WorkbookFont=WorkbookFont;class WorkbookFill{constructor(){}_serialize(){return this.color?{color:this.color}:null}_deserialize(e){null!=e.color&&(this.color=e.color)}}exports.WorkbookFill=WorkbookFill;class WorkbookBorder{constructor(){}_serialize(){var e;if(this._checkEmptyWorkbookBorder())return null;e={};this.top&&(e.top=this.top._serialize());this.bottom&&(e.bottom=this.bottom._serialize());this.left&&(e.left=this.left._serialize());this.right&&(e.right=this.right._serialize());this.diagonal&&(e.diagonal=this.diagonal._serialize());return e}_deserialize(e){var t,s,l,i,r;if(e.top){(t=new WorkbookBorderSetting)._deserialize(e.top);this.top=t}if(e.bottom){(s=new WorkbookBorderSetting)._deserialize(e.bottom);this.bottom=s}if(e.left){(l=new WorkbookBorderSetting)._deserialize(e.left);this.left=l}if(e.right){(i=new WorkbookBorderSetting)._deserialize(e.right);this.right=i}if(e.diagonal){(r=new WorkbookBorderSetting)._deserialize(e.diagonal);this.diagonal=r}}_checkEmptyWorkbookBorder(){return null==this.top&&null==this.bottom&&null==this.left&&null==this.right&&null==this.diagonal}}exports.WorkbookBorder=WorkbookBorder;class WorkbookBorderSetting{constructor(){}_serialize(){var e;if((null==this.color||""===this.color)&&null==this.style)return null;e={};this.color&&(e.color=this.color);null!=this.style&&(e.style=wijmo_1.asEnum(this.style,BorderStyle,!1));return e}_deserialize(e){if(null!=e.color||null!=e.style){this.color=e.color;null!=e.style&&(this.style=wijmo_1.asEnum(e.style,BorderStyle,!1))}}}exports.WorkbookBorderSetting=WorkbookBorderSetting;class DefinedName{constructor(){}_serialize(){var e;if(null==this.name)return null;e={name:this.name,value:this.value};null!=this.sheetName&&(e.sheetName=this.sheetName);return e}_deserialize(e){this.name=e.name;this.value=e.value;this.sheetName=e.sheetName}}exports.DefinedName=DefinedName;class WorkbookTable{get columns(){null==this._columns&&(this._columns=[]);return this._columns}constructor(){}_serialize(){var e,t;if(null==this.name||null==this.range||null==this._columns)return null;null!=this.style&&(t=this.style._serialize());(e={name:this.name,range:this.range,showHeaderRow:this.showHeaderRow,showTotalRow:this.showTotalRow,style:t,showBandedColumns:this.showBandedColumns,showBandedRows:this.showBandedRows,alterFirstColumn:this.alterFirstColumn,alterLastColumn:this.alterLastColumn,columns:[]}).columns=this._serializeTableColumns();return e}_deserialize(e){var t;this.name=e.name;this.range=e.range;this.showHeaderRow=e.showHeaderRow;this.showTotalRow=e.showTotalRow;if(null!=e.style){(t=new WorkbookTableStyle)._deserialize(e.style);this.style=t}this.showBandedColumns=e.showBandedColumns;this.showBandedRows=e.showBandedRows;this.alterFirstColumn=e.alterFirstColumn;this.alterLastColumn=e.alterLastColumn;this._deserializeTableColumns(e.columns)}_serializeTableColumns(){var e,t,s=[];for(t=0;t<this._columns.length;t++)(e=this._columns[t])&&(s[t]=e._serialize());return s}_deserializeTableColumns(e){var t,s,l;wijmo_1.assert(null!=e,"table Columns should not be null.");this._columns=[];for(l=0;l<e.length;l++)if(s=e[l]){(t=new WorkbookTableColumn)._deserialize(s);this._columns[l]=t}}}exports.WorkbookTable=WorkbookTable;class WorkbookTableColumn{constructor(){}_serialize(){return null==this.name?null:{name:this.name,totalRowLabel:this.totalRowLabel,totalRowFunction:this.totalRowFunction,showFilterButton:this.showFilterButton}}_deserialize(e){this.name=e.name;this.totalRowLabel=e.totalRowLabel;this.totalRowFunction=e.totalRowFunction;this.showFilterButton=e.showFilterButton}}exports.WorkbookTableColumn=WorkbookTableColumn;class WorkbookTableStyle{constructor(){}_serialize(){var e;if(this._checkEmptyWorkbookTableStyle())return null;e={name:this.name};this.wholeTableStyle&&(e.wholeTableStyle=this.wholeTableStyle._serialize());this.firstBandedColumnStyle&&(e.firstBandedColumnStyle=this.firstBandedColumnStyle._serialize());this.firstBandedRowStyle&&(e.firstBandedRowStyle=this.firstBandedRowStyle._serialize());this.secondBandedColumnStyle&&(e.secondBandedColumnStyle=this.secondBandedColumnStyle._serialize());this.secondBandedRowStyle&&(e.secondBandedRowStyle=this.secondBandedRowStyle._serialize());this.headerRowStyle&&(e.headerRowStyle=this.headerRowStyle._serialize());this.totalRowStyle&&(e.totalRowStyle=this.totalRowStyle._serialize());this.firstColumnStyle&&(e.firstColumnStyle=this.firstColumnStyle._serialize());this.lastColumnStyle&&(e.lastColumnStyle=this.lastColumnStyle._serialize());this.firstHeaderCellStyle&&(e.firstHeaderCellStyle=this.firstHeaderCellStyle._serialize());this.lastHeaderCellStyle&&(e.lastHeaderCellStyle=this.lastHeaderCellStyle._serialize());this.firstTotalCellStyle&&(e.firstTotalCellStyle=this.firstTotalCellStyle._serialize());this.lastTotalCellStyle&&(e.lastTotalCellStyle=this.lastTotalCellStyle._serialize());return e}_deserialize(e){this.name=e.name;if(e.wholeTableStyle){this.wholeTableStyle=new WorkbookTableCommonStyle;this.wholeTableStyle._deserialize(e.wholeTableStyle)}if(e.firstBandedColumnStyle){this.firstBandedColumnStyle=new WorkbookTableBandedStyle;this.firstBandedColumnStyle._deserialize(e.firstBandedColumnStyle)}if(e.firstBandedRowStyle){this.firstBandedRowStyle=new WorkbookTableBandedStyle;this.firstBandedRowStyle._deserialize(e.firstBandedRowStyle)}if(e.secondBandedColumnStyle){this.secondBandedColumnStyle=new WorkbookTableBandedStyle;this.secondBandedColumnStyle._deserialize(e.secondBandedColumnStyle)}if(e.secondBandedRowStyle){this.secondBandedRowStyle=new WorkbookTableBandedStyle;this.secondBandedRowStyle._deserialize(e.secondBandedRowStyle)}if(e.headerRowStyle){this.headerRowStyle=new WorkbookTableCommonStyle;this.headerRowStyle._deserialize(e.headerRowStyle)}if(e.totalRowStyle){this.totalRowStyle=new WorkbookTableCommonStyle;this.totalRowStyle._deserialize(e.totalRowStyle)}if(e.firstColumnStyle){this.firstColumnStyle=new WorkbookTableCommonStyle;this.firstColumnStyle._deserialize(e.firstColumnStyle)}if(e.lastColumnStyle){this.lastColumnStyle=new WorkbookTableCommonStyle;this.lastColumnStyle._deserialize(e.lastColumnStyle)}if(e.firstHeaderCellStyle){this.firstHeaderCellStyle=new WorkbookTableCommonStyle;this.firstHeaderCellStyle._deserialize(e.firstHeaderCellStyle)}if(e.lastHeaderCellStyle){this.lastHeaderCellStyle=new WorkbookTableCommonStyle;this.lastHeaderCellStyle._deserialize(e.lastHeaderCellStyle)}if(e.firstTotalCellStyle){this.firstTotalCellStyle=new WorkbookTableCommonStyle;this.firstTotalCellStyle._deserialize(e.firstTotalCellStyle)}if(e.lastTotalCellStyle){this.lastTotalCellStyle=new WorkbookTableCommonStyle;this.lastTotalCellStyle._deserialize(e.lastTotalCellStyle)}}_checkEmptyWorkbookTableStyle(){return null==this.name||null==this.wholeTableStyle&&null==this.firstBandedColumnStyle&&null==this.firstBandedRowStyle&&null==this.secondBandedColumnStyle&&null==this.secondBandedRowStyle&&null==this.headerRowStyle&&null==this.totalRowStyle&&null==this.firstColumnStyle&&null==this.lastColumnStyle&&null==this.firstHeaderCellStyle&&null==this.lastHeaderCellStyle&&null==this.firstTotalCellStyle&&null==this.lastTotalCellStyle}}exports.WorkbookTableStyle=WorkbookTableStyle;class WorkbookTableCommonStyle extends WorkbookStyle{constructor(){super()}_deserialize(e){var t;super._deserialize(e);if(e.borders){(t=new WorkbookTableBorder)._deserialize(e.borders);this.borders=t}}}exports.WorkbookTableCommonStyle=WorkbookTableCommonStyle;class WorkbookTableBandedStyle extends WorkbookTableCommonStyle{constructor(){super()}_serialize(){var e;(e=super._serialize()).size=this.size;return e}_deserialize(e){super._deserialize(e);null!=e.size&&(this.size=e.size)}}exports.WorkbookTableBandedStyle=WorkbookTableBandedStyle;class WorkbookTableBorder extends WorkbookBorder{constructor(){super()}_serialize(){var e;null!=(e=super._serialize())||this.vertical&&this.horizontal||(e={});this.vertical&&(e.vertical=this.vertical._serialize());this.horizontal&&(e.horizontal=this.horizontal._serialize());return e}_deserialize(e){var t,s;super._deserialize(e);if(e.vertical){(t=new WorkbookBorderSetting)._deserialize(e.vertical);this.vertical=t}if(e.horizontal){(s=new WorkbookBorderSetting)._deserialize(e.horizontal);this.horizontal=s}}}exports.WorkbookTableBorder=WorkbookTableBorder;class WorkbookTextRun{constructor(){}_serialize(){var e={text:this.text};this.font&&(e.font=this.font._serialize());return e}_deserialize(e){if(e.font){this.font=new WorkbookFont;this.font._deserialize(e.font)}this.text=e.text}}exports.WorkbookTextRun=WorkbookTextRun;class _Base64{static toArray(e){let t=atob(e),s=t.length,l=new Uint8Array(s);for(let e=0;e<s;e++)l[e]=t.charCodeAt(e);return l}}class _TextRunsSerializer{static deserialize(e){return e&&e.length?e.map(e=>{let t=new WorkbookTextRun;t._deserialize(e);return t}):null}static serialize(e){return e&&e.length?e.map(e=>e._serialize()):null}}var HAlign,VAlign,TextDirection,TextOrientation,BorderStyle;!function(e){e[e.General=0]="General";e[e.Left=1]="Left";e[e.Center=2]="Center";e[e.Right=3]="Right";e[e.Fill=4]="Fill";e[e.Justify=5]="Justify"}(HAlign=exports.HAlign||(exports.HAlign={}));!function(e){e[e.Top=0]="Top";e[e.Center=1]="Center";e[e.Bottom=2]="Bottom";e[e.Justify=3]="Justify"}(VAlign=exports.VAlign||(exports.VAlign={}));!function(e){e[e.Context=0]="Context";e[e.LeftToRight=1]="LeftToRight";e[e.RightToLeft=2]="RightToLeft"}(TextDirection=exports.TextDirection||(exports.TextDirection={}));!function(e){e[e.Horizontal=0]="Horizontal";e[e.Vertical=1]="Vertical";e[e.RotateUp=2]="RotateUp";e[e.RotateDown=3]="RotateDown"}(TextOrientation=exports.TextOrientation||(exports.TextOrientation={}));!function(e){e[e.None=0]="None";e[e.Thin=1]="Thin";e[e.Medium=2]="Medium";e[e.Dashed=3]="Dashed";e[e.Dotted=4]="Dotted";e[e.Thick=5]="Thick";e[e.Double=6]="Double";e[e.Hair=7]="Hair";e[e.MediumDashed=8]="MediumDashed";e[e.ThinDashDotted=9]="ThinDashDotted";e[e.MediumDashDotted=10]="MediumDashDotted";e[e.ThinDashDotDotted=11]="ThinDashDotDotted";e[e.MediumDashDotDotted=12]="MediumDashDotDotted";e[e.SlantedMediumDashDotted=13]="SlantedMediumDashDotted"}(BorderStyle=exports.BorderStyle||(exports.BorderStyle={}));let JSZip=jszip_1.default;function useJSZip(e){JSZip=e}exports.useJSZip=useJSZip;class _xlsx{static load(e,t=!0){let s=new JSZip;wijmo_1.assert(null==s.loadAsync,"Please use JSZip 2.5 to load excel files synchronously.");let l,i=new _JsZipWrapper(s);this._loadImpl(i,e,t).then(e=>l=e);return l}static loadAsync(e,t=!0){let s=new JSZip;wijmo_1.assert(null!=s.loadAsync,"Please use JSZip 3.0 to load excel files asynchrounously.");return this._loadImpl(s,e,t)}static save(e){let t,s=Date.now();this._saveWorkbookToZip(e,null,!1).then(e=>t=e);s=Date.now()-s;var l="";l=this._macroEnabled?"application/vnd.ms-excel.sheet.macroEnabled.12;":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;";let i=Date.now(),r=t.generate({compression:"DEFLATE"});return{base64:r,zipTime:Date.now()-i,processTime:s,href:()=>"data:"+l+"base64,"+r}}static saveAsync(e,t,s,l){let i=new _SyncPromise(t);wijmo_1.isFunction(l)&&l(0);this._saveWorkbookToZip(e,t,!0,e=>{wijmo_1.isFunction(l)&&l(Math.round(_map(e,0,100,0,90)))}).then(e=>{wijmo_1.isFunction(l)&&l(91);let r=e.generateAsync({type:"base64",compression:"DEFLATE"});r.catch(e=>{s&&s(e);i.reject(e)});r.then(e=>{if(t&&t.cancelled)i.cancel();else{wijmo_1.isFunction(l)&&l(100);i.resolve(e)}})},e=>{i.reject(e)});return i}static _loadImpl(e,t,s){let l,i=this,r=Date.now(),o={sheets:[]},a=e.loadAsync(t,{base64:wijmo_1.isString(t)}).then(e=>l=e);t=null;let n=a.constructor;return(a=(a=(a=(a=(a=(a=(a=(a=a.then(()=>{let e=l.file("xl/theme/theme1.xml");if(e)return e.async("string").then(e=>{i._getTheme(e);o.colorThemes=i._colorThemes})})).then(()=>{let e=l.file("xl/styles.xml");if(e)return e.async("string").then(e=>{i._getStyle(e,s);if(s){o.styles=i._styles;null!=i._tableStyles&&(o.tableStyles=i._tableStyles)}})})).then(()=>{let e=l.file("xl/sharedStrings.xml");if(e)return e.async("string").then(e=>{i._getSharedString(e)})})).then(()=>{let e=l.file("xl/workbook.xml");if(e)return e.async("string").then(e=>{i._getWorkbook(e,o)})})).then(()=>{i._tables=null;let e=n.resolve();l.folder("xl/tables").forEach((t,s)=>{null==i._tables&&(i._tables=[]);e=e.then(()=>s.async("string").then(e=>{let t=i._getTable(e);t.fileName=s.name.substring(s.name.lastIndexOf("/")+1);i._tables.push(t)}))});return e})).then(()=>{let e=l.file("docProps/core.xml");if(e)return e.async("string").then(e=>{i._getCoreSetting(e,o)})})).then(()=>{let e=l.file("xl/vbaProject.bin");if(e)return e.async("uint8array").then(e=>{null==o.reservedContent&&(o.reservedContent={});o.reservedContent.macros=e})})).then(()=>{let e=n.resolve();l.folder("xl/worksheets").forEach((t,r)=>{if(t&&-1===t.indexOf("/")){let t=i._getSheetIndex(r.name);isNaN(t)||(e=e.then(()=>r.async("string").then(e=>{i._getSheet(e,t-1,o,s);let r=l.file("xl/worksheets/_rels/sheet"+t+".xml.rels");if(r)return r.async("string").then(e=>{let s,r,a=e.split("<Relationship "),h=a.length;for(;--h;){let e=a[h],l=i._getAttr(e,"Id");if(o.sheets[t-1].tableRIds&&-1!==o.sheets[t-1].tableRIds.indexOf(l)){null==o.sheets[t-1].tables&&(o.sheets[t-1].tables=[]);o.sheets[t-1].tables.push(i._getSheetRelatedTable(e))}else if(o.sheets[t-1].hyperlinkRIds)i._getSheetRelatedHyperlink(e,l,o.sheets[t-1]);else{let t=i._getAttr(e,"Type");/\/comments$/.test(t)?s={id:i._getAttr(e,"Id"),target:i._getAttr(e,"Target")}:/\/vmlDrawing$/.test(t)&&(r={id:i._getAttr(e,"Id"),target:i._getAttr(e,"Target")})}}if(s&&r)return(e=>{let t=n.resolve();return i._readNotes(e,s,r,l,t).then(()=>{})})(o.sheets[t-1])})})))}});return e})).then(()=>{o.processTime=Date.now()-r;l=null;this._sharedStrings=null;this._colorThemes=null;this._styles=null;this._sharedFormulas=null;this._borders=null;this._fonts=null;this._fills=null;this._contentTypes=null;this._props=null;this._xlRels=null;this._worksheets=null;this._tableStyles=null;this._dxfs=null;this._tables=null;this._notes=null;return o})}static _readNotes(e,t,s,l,i){let absPath=e=>e&&e.replace(/^..\//,"xl/"),r=l.file(absPath(t.target));r&&(i=i.then(()=>r.async("string").then(t=>{let i=t.substring(t.indexOf("<authors>"),t.indexOf("</authors>")).split("<author>"),r=[];for(let e=1;e<i.length;e++)r.push(i[e].substring(0,i[e].indexOf("</author>")));i=t.substring(t.indexOf("<commentList>"),t.indexOf("</commentList>")).split("<comment ");for(let t=1;t<i.length;t++){let s=_xlsx._getAttr(i[t],"ref"),l=this._alphaNum(s.match(/[a-zA-Z]*/g)[0]),o=+s.match(/\d*/g).join("")-1,a=i[t],n=a.substring(a.indexOf("<text>")+"<text>".length,a.lastIndexOf("</text>")),h=this._extractTextRuns(n),c=e.rows[o].cells[l];null==c&&(e.rows[o].cells[l]=c={});c.note={author:r[_xlsx._getAttr(a,"authorId")],textRuns:h,text:this._getTextOfTextRuns(h)}}let o=l.file(absPath(s.target));if(o)return o.async("string").then(t=>{let s={};t.substring(0,t.indexOf(">")).split("xmlns:").forEach(e=>{e.indexOf("vml")>=0?s.vml=e.substring(0,e.indexOf("=")):e.indexOf("office:office")>=0?s.office=e.substring(0,e.indexOf("=")):e.indexOf("office:excel")>=0&&(s.excel=e.substring(0,e.indexOf("=")))});let l=t.split(`<${s.vml}:shape `),i=new _NotePositionConverter(e);for(let t=1;t<l.length;t++){let r=l[t],o=`${s.excel}:ClientData`,a=r.indexOf(o);if(a>0){a+=o.length+1;let t=r.substring(a,r.indexOf("</"+o,a));if("Note"===this._getAttr(t,"ObjectType")){let l=+this._getElementValue(t,`${s.excel}:Row`,null,null),r=+this._getElementValue(t,`${s.excel}:Column`,null,null),o=e.rows[l].cells[r].note;wijmo_1.assert(null!=o,"No related note was found, row=${row}, col=${col}.");o.visible=this._getElementValue(t,`${s.excel}:Visible`,!1,!0);let a=this._getElementValue(t,`${s.excel}:Anchor`,null,null).split(",").map(e=>parseFloat(e));i.fromAnchor(a,o,l,r)}}}s=null})})));return i}static _saveWorkbookToZip(e,t,s,l){let i=new JSZip;s?wijmo_1.assert(null!=i.generateAsync,"Please use JSZip 3.0 to save excel files asynchrounously."):wijmo_1.assert(null==i.generateAsync,"Please use JSZip 2.5 to save excel files synchronously.");wijmo_1.isFunction(l)&&l(0);i.folder("_rels").file(".rels",this._xmlDescription+this._generateRelsDoc());var r=i.folder("docProps"),o=i.folder("xl");this._colorThemes=e.colorThemes;o.folder("theme").file("theme1.xml",this._xmlDescription+this._generateThemeDoc());this._macroEnabled=!(!e.reservedContent||!e.reservedContent.macros);this._macroEnabled&&o.file("vbaProject.bin",e.reservedContent.macros);r.file("core.xml",this._xmlDescription+this._generateCoreDoc(e));this._sharedStrings=[[],0];this._styles=new Array(1);this._borders=new Array(1);this._fonts=new Array(1);this._fills=new Array(2);this._tableStyles=new Array;this._dxfs=new Array;this._contentTypes=[];this._props=[];this._xlRels=[];this._worksheets=[];this._tables=[];this._tableStyles=[];this._notes={};let a=new _SyncPromise(t);this._generateWorksheets(e,o,t,s,l).then(()=>{this._writeNotes(e.sheets,o);o.file("styles.xml",this._xmlDescription+this._generateStyleDoc());i.file("[Content_Types].xml",this._xmlDescription+this._generateContentTypesDoc(e));r.file("app.xml",this._xmlDescription+this._generateAppDoc(e));o.folder("_rels").file("workbook.xml.rels",this._xmlDescription+this._generateWorkbookRels());var t=this._xmlDescription+this._generateSharedStringsDoc();this._sharedStrings=[[],0];o.file("sharedStrings.xml",t);t=null;o.file("workbook.xml",this._xmlDescription+this._generateWorkbook(e));wijmo_1.isFunction(l)&&l(100);a.resolve(i)});return a}static _writeNotes(e,t){e.forEach((e,s)=>{let l=this._notes[s];if(l){t.folder("drawings").file(`vmlDrawing${s+1}.vml`,(e=>{let t='<xml xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel">\r\n';t+='<o:shapelayout v:ext="edit">\r\n';t+='<o:idmap v:ext="edit" data="1"/>\r\n';t+="</o:shapelayout>\r\n";t+='<v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe">\r\n';t+='<v:stroke joinstyle="miter"/>\r\n';t+='<v:path gradientshapeok="t" o:connecttype="rect"/>\r\n';t+="</v:shapetype>\r\n";let i=1e3*(s+1)+50,r=new _NotePositionConverter(e);l.forEach((e,s)=>{wijmo_1.assert(e._row>=0&&e._col>=0,"Invalid cell's indicies.");let l=null==e.visible||!0===e.visible,o=`position:absolute; visibility:${l?"visible":"hidden"}; z-index:${s+1};`;t+=`<v:shape id="_x0000_s${i++}" type="#_x0000_t202" style='${o}' fillcolor="infoBackground [80]" o:insetmode="auto">\r\n`;t+='<v:fill color2="infoBackground [80]"/>\r\n';t+='<v:shadow color="none [81]" obscured="t"/>\r\n';t+='<v:path o:connecttype="none"/>\r\n';let a="",n="";a+="text-align:left;";n+="mso-direction-alt:auto;";t+='<v:textbox style="mso-direction-alt:auto;" ';t+=">\r\n";t+='<div style="text-align:left;"></div>\r\n';t+="</v:textbox>\r\n";t+='<x:ClientData ObjectType="Note">\r\n';t+="<x:MoveWithCells/>\r\n";t+="<x:SizeWithCells/>\r\n";null==e.width&&(e.width=144);null==e.height&&(e.height=79);null==e.offsetX&&(e.offsetX=15);null==e.offsetY&&(e.offsetY=0==e._row?2:15);let h=r.toAnchor(e,e._row,e._col);t+=`<x:Anchor>${h.toString()}</x:Anchor>\r\n`;t+="<x:AutoFill>False</x:AutoFill>\r\n";t+=`<x:Row>${e._row}</x:Row>\r\n`;t+=`<x:Column>${e._col}</x:Column>\r\n`;l&&(t+="<x:Visible/>\r\n");t+="</x:ClientData>\r\n";t+="</v:shape>\r\n"});return t+"</xml>"})(e));t.file(`comments${s+1}.xml`,(e=>{let t='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n';t+='<comments xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="xr" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision">\r\n';let s={},i=[],r={family:"Tahoma",size:12};l.forEach(e=>{let t=e.author||"";if(null==s[t]){s[t]=i.length;i.push(t)}});t+="<authors>\r\n";i.forEach(e=>t+=`<author>${e}</author>\r\n`);t+="</authors>\r\n";t+="<commentList>\r\n";l.forEach(e=>{let l=this._numAlpha(e._col)+(e._row+1);t+=`<comment ref="${l}" authorId="${s[e.author||""]}" shapeId="0" xr:uid="${_guid()}">\r\n`;t+="<text>\r\n";let i=e.textRuns&&e.textRuns.length?e.textRuns:[{text:e.text}];i=i.map(e=>{e.font=e.font||r;return e});t+=this._generateTextRuns(i,this._defaultFontName.toLowerCase());t+="</text>";t+="</comment>\r\n"});return(t+="</commentList>\r\n")+"</comments>"})())}})}static _generateWorksheets(e,t,s,l,i){let r,o=t.folder("worksheets"),a=e.sheets.length,n=[],h=e.sheets.map(e=>e.rows.length).reduce((e,t)=>e+t),c=e.sheets.map(e=>e.rows.length/h),d=a-1,f=0,u=0;for(;a--;){let h=a;n.push(()=>{let a=new _SyncPromise(s);this._generateWorkSheet(h,e,o,s,l,e=>{if(wijmo_1.isFunction(i)){e=Math.round(e*c[h]);if(d!==h){d=h;u+=f}f=e;i(u+e)}}).then(()=>{let s=e.sheets[h],l=s&&s.externalLinks,i=this._sheetHasNotes(h);if(s&&(s.tables&&s.tables.length>0||l&&l.length>0||i)){let e=1,a='<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">';if(i){a+=`<Relationship Id="rId${e++}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing" Target="../drawings/vmlDrawing${h+1}.vml" />`;a+=`<Relationship Id="rId${e++}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments" Target="../comments${h+1}.xml" />`}if(l&&l.length>0){a+=this._generateHyperlinkRel(l,e);e+=l.length}if(s.tables&&s.tables.length>0){null==r&&(r=t.folder("tables"));for(let t=0;t<s.tables.length;t++){let l=s.tables[t];this._generateTable(l,r);a+='<Relationship Target="../tables/'+l.fileName+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/table" Id="rId'+(t+e)+'"/>'}}a+="</Relationships>";o.folder("_rels").file("sheet"+(h+1)+".xml.rels",this._xmlDescription+a)}a.resolve()});return a})}return _SyncPromise.serial(s,n).then(()=>{wijmo_1.isFunction(i)&&i(100)})}static _getSharedString(e){var t=e.split(/<si.*?>/g),s=t.length;this._sharedStrings=[];for(;--s;)if(t[s].search(/<r>/gi)>-1)this._sharedStrings[s-1]=this._extractTextRuns(t[s]);else{let e=this._getElementValue(t[s],"t","","");this._sharedStrings[s-1]=this._unescape(e)}}static _extractTextRuns(e){let t=[],s=e.split(/<r>/g);for(var l=1;l<s.length;l++){let e;-1!==s[l].indexOf("<rPr>")&&(e=this._getTextRunFont(s[l]));let i=this._getElementValue(s[l],"t","","");t.push({font:e,text:this._unescape(i)})}return t}static _getInlineString(e){let t=e.split("<t"),s=t.length,l="";for(;--s;){let e=t[s];if(" "===e[0]||">"===e[0]){let t=e.indexOf("</t>");t>0&&(l=e.substring(e.indexOf(">")+1,t)+l)}}return l}static _escape(e){return"string"==typeof e?(e=e.replace(/[\u0000-\u001F]/g,e=>this._asciiCtrlReplacements[e.charCodeAt(0)])).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):""}static _unescape(e){if(!e)return e;-1!==e.indexOf("&#")&&(e=this._unescapeNumericEntities(e));-1!==e.indexOf("&")&&(e=e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&amp;/g,"&"));-1!==e.indexOf("_x")&&(e=e.replace(/_x([0-9A-F]{4})_/gi,(e,t)=>fromCodePointImpl(parseInt(t,16))));return e}static _unescapeNumericEntities(e){if(wijmo_1.isIE())return e.replace(/&#(x?)([0-9A-F]{1,6});/gi,(e,t,s)=>{s=t?parseInt(s,16):+s;return fromCodePointImpl(s)});let t,s=0,l="";for(;(t=e.indexOf("&#",s))>=0;){let i="x"===e[t+2],r=i?3:2,o=e.indexOf(";",t+r);if(-1===o)break;let a,n=o-t-r,h=n>0&&n<8;if(h){let s=e.substr(t+r,n);h=i?(a=parseInt(s,16))==a:(a=+s)==s}if(h){l+=e.substring(s,t);l+=fromCodePointImpl(a);s=o+1}else{l+=e.substr(s,r);s+=r}}s!==e.length&&(l+=e.substr(s));return l||e}static _getCoreSetting(e,t){var s,l;if((l=e.indexOf("<dc:creator>"))>=0){s=e.substr(l+12);t.creator=s.substring(0,s.indexOf("</dc:creator>"))}if((l=e.indexOf("<cp:lastModifiedBy>"))>=0){s=e.substr(l+19);t.lastModifiedBy=s.substring(0,s.indexOf("</cp:lastModifiedBy>"))}if((l=e.indexOf('<dcterms:created xsi:type="dcterms:W3CDTF">'))>=0){s=e.substr(l+43);t.created=new Date(s.substring(0,s.indexOf("</dcterms:created>")))}if((l=e.indexOf('<dcterms:modified xsi:type="dcterms:W3CDTF">'))>=0){s=e.substr(l+44);t.modified=new Date(s.substring(0,s.indexOf("</dcterms:modified>")))}}static _getWorkbook(e,t){var s,l,i,r,o,a,n,h,c=e.substring(e.indexOf("<bookViews>"),e.indexOf("</bookViews>")),d="",f=e.indexOf("<definedNames>");c&&(d=this._getAttr(c,"activeTab"));t.activeWorksheet=+d;a=(o=e.split("<sheet ")).length;for(;--a;){n=this._getAttr(o[a],"name");h="hidden"!==this._getAttr(o[a],"state");t.sheets.unshift({name:n,visible:h,columns:[],rows:[]})}if(f>-1){t.definedNames=[];a=(o=e.substring(f,e.indexOf("</definedNames>")).split("<definedName ")).length;for(;--a;){n=this._getAttr(o[a],"name");if(l=o[a].match(/.*>.+(?=<\/definedName>)/)){l=l[0].replace(/(.*>)(.+)/,"$2");l=isNaN(+l)?l:+l}s={name:n,value:l};""!==(i=this._getAttr(o[a],"localSheetId"))&&(r=t.sheets[+i])&&(s.sheetName=r.name);t.definedNames.unshift(s)}}}static _getTheme(e){e=e.substring(e.indexOf("<a:clrScheme"),e.indexOf("</a:clrScheme>"));this._colorThemes=this._defaultColorThemes.slice();this._colorThemes[0]=this._getAttr(e.substring(e.indexOf("a:lt1"),e.indexOf("</a:lt1>")),"lastClr")||this._getAttr(e.substring(e.indexOf("a:lt1"),e.indexOf("</a:lt1>")),"val");this._colorThemes[1]=this._getAttr(e.substring(e.indexOf("a:dk1"),e.indexOf("</a:dk1>")),"lastClr")||this._getAttr(e.substring(e.indexOf("a:dk1"),e.indexOf("</a:dk1>")),"val");this._colorThemes[2]=this._getAttr(e.substring(e.indexOf("a:lt2"),e.indexOf("</a:lt2>")),"val");this._colorThemes[3]=this._getAttr(e.substring(e.indexOf("a:dk2"),e.indexOf("</a:dk2>")),"val");for(var t=e.substring(e.indexOf("<a:accent1"),e.indexOf("</a:accent6>")).split("<a:accent"),s=t.length;--s;)this._colorThemes[s+3]=this._getAttr(t[s],"val")}static _getStyle(e,t){let s=[],l=[],i=[],r=this._numFmts.slice();this._styles=[];let o=e.indexOf("<numFmts");if(o>=0){let t=e.substring(o+8,e.indexOf("</numFmts>")).split("<numFmt"),s=t.length;for(;--s;){let e=t[s];r[+this._getAttr(e,"numFmtId")]=this._getAttr(e,"formatCode")}}if(t){if((o=e.indexOf("<fonts"))>=0){let t=e.substring(o,e.indexOf("</fonts>")).split("<font>"),l=t.length;for(;--l;){let e,i=t[l],r=this._getChildNodeValue(i,"sz");s[l-1]={bold:/<b\s*\/>/.test(i)||"true"===this._getChildNodeValue(i,"b"),italic:/<i\s*\/>/.test(i)||"true"===this._getChildNodeValue(i,"i"),underline:/<u\s*\/>/.test(i)||!!(e=this._getChildNodeValue(i,"u"))&&"none"!==e,size:Math.round(r?96*+r/72:14),family:this._getChildNodeValue(i,"name"),color:this._getColor(i,!1)};r=null}}if((o=e.indexOf("<fills"))>=0){let t=e.substring(o,e.indexOf("</fills>")).split("<fill>"),s=t.length;for(;--s;)l[s-1]=this._getColor(t[s],!0)}if((o=e.indexOf("<borders"))>=0){let t=e.substring(o+8,e.indexOf("</borders>")).split("<border"),s=t.length;for(;--s;){let e=t[s];i[s-1]={left:this._getEdgeBorder(e,"left"),right:this._getEdgeBorder(e,"right"),top:this._getEdgeBorder(e,"top"),bottom:this._getEdgeBorder(e,"bottom")}}}}if((o=e.indexOf("<cellXfs"))>=0){let a=e.substring(o,e.indexOf("</cellXfs>")).split("<xf"),n=a.length;for(;--n;){let e=a[n],h=+this._getAttr(e,"numFmtId"),c=r[h],d="unknown";c&&(/[hsmy\:]/i.test(c)?d="date":c.indexOf("0")>-1?d="number":"@"===c&&(d="string"));let f={formatCode:c,type:d,quotePrefix:1==+this._getAttr(e,"quotePrefix")};if(t){let t=(h=+this._getAttr(e,"fontId"))>0?s[h]:null,r=(h=+this._getAttr(e,"fillId"))>1?l[h]:null,a=(h=+this._getAttr(e,"borderId"))>0?i[h]:null;o=e.indexOf("<alignment");f.font=t;f.fillColor=r;f.borders=a;f.hAlign=o>=0?Workbook._parseStringToHAlign(this._getAttr(e,"horizontal")):null;f.vAlign=o>=0?Workbook._parseStringToVAlign(this._getAttr(e,"vertical")):null;f.wordWrap=o>=0?"1"===this._getAttr(e,"wrapText"):null}this._styles.unshift(f)}}if(t&&e.indexOf("<tableStyle ")>-1){this._tableStyles=[];let t=e.substring(e.indexOf("<tableStyles "),e.indexOf("</tableStyles>")),s=e.substring(e.indexOf("<dxfs "),e.indexOf("</dxfs>"));this._getTableStyles(t,s.split("<dxf>"))}}static _getEdgeBorder(e,t){var s,l,i,r,o=e.indexOf("<"+t),a=e.indexOf("</"+t+">");if(o>=0){l=e.substring(o);l=a>=0?l.substring(0,a):l.substring(0,l.indexOf("/>"));var n=this._getAttr(l,"style");if(n){i=Workbook._parseStringToBorderType(n);r=this._getColor(l,!1);if(i!==BorderStyle.Thin||!r||"#c6c6c6"!==r.toLowerCase()){(s={}).style=i;s.color=r}}}return s}static _getSheet(e,t,s,l){var i,r=[];if(e.indexOf("<mergeCells")>-1)for(var o=e.substring(e.indexOf("<mergeCells"),e.indexOf("</mergeCells>")).split("<mergeCell "),a=o.length;--a;)2===(i=this._getAttr(o[a],"ref").split(":")).length&&r.unshift({topRow:+i[0].match(/\d*/g).join("")-1,leftCol:this._alphaNum(i[0].match(/[a-zA-Z]*/g)[0]),bottomRow:+i[1].match(/\d*/g).join("")-1,rightCol:this._alphaNum(i[1].match(/[a-zA-Z]*/g)[0])});this._getsBaseSharedFormulas(e);var n=e.split("<row "),h=s.sheets[t];if(n[0].indexOf("<dimension")>=0){var c=this._getAttr(n[0].substr(n[0].indexOf("<dimension")),"ref");if(c){c=c.substr(c.indexOf(":")+1);h.maxCol=this._alphaNum(c.match(/[a-zA-Z]*/g)[0])+1;h.maxRow=+c.match(/\d*/g).join("")}}let d=this._getElementValue(e,"sheetView",null,null);h.rightToLeft=d&&"1"===this._getAttr(d,"rightToLeft");var f,u=e.indexOf("<tableParts");if(u>-1){var m=e.substring(u,e.indexOf("</tableParts>")).split("<tablePart "),_=m.length;h.tableRIds=[];for(;--_;)h.tableRIds.unshift(this._getAttr(m[_],"r:id"))}if(n.length>0&&n[0].indexOf("<pane")>-1&&"frozen"===this._getAttr(n[0].substr(n[0].indexOf("<pane")),"state")){var g=this._getAttr(n[0].substr(n[0].indexOf("<pane")),"ySplit"),p=this._getAttr(n[0].substr(n[0].indexOf("<pane")),"xSplit");h.frozenPane={rows:g?+g:NaN,columns:p?+p:NaN}}h.summaryBelow="0"!==this._getAttr(n[0],"summaryBelow");a=n.length;if(n.length<=1){h.maxCol=20;h.maxRow=200}else(null==h.maxRow||h.maxRow<a-1)&&(h.maxRow=a-1);for(;--a;){var y=h.rows[+this._getAttr(n[a],"r")-1]={visible:!0,groupLevel:NaN,cells:[]};n[a].substring(0,n[a].indexOf(">")).indexOf("hidden")>-1&&"1"===this._getAttr(n[a],"hidden")&&(y.visible=!1);if("1"===this._getAttr(n[a],"customHeight")){var b=+this._getAttr(n[a].substring(0,n[a].indexOf(">")).replace("customHeight",""),"ht");y.height=96*b/72}let e=null;if("1"===this._getAttr(n[a],"customFormat")){let t=this._styles[+this._getAttr(n[a].substring(n[a].indexOf(" s=")),"s")]||{type:"General",formatCode:null};t.formatCode&&"General"!==t.formatCode&&(e={format:t.formatCode&&"General"!==t.formatCode?t.formatCode:null});if(l&&(t.font||t.fillColor||t.hAlign||t.vAlign||t.wordWrap||t.borders)){(e=e||{}).font=t.font;e.fill={color:t.fillColor};e.borders=t.borders;e.hAlign=t.hAlign;e.vAlign=t.vAlign;e.wordWrap=t.wordWrap}}y.style=e;var x=this._getAttr(n[a],"outlineLevel");y.groupLevel=x&&""!==x?+x:NaN;y.collapsed="1"===this._getAttr(n[a],"collapsed");var w=n[a].split("<c "),S=w.length;(null==h.maxCol||h.maxCol<S-1)&&(h.maxCol=S-1);for(;--S;){let e=w[S],t=null,s=this._styles[+this._getAttr(e,"s")]||{type:"General",formatCode:null};s.formatCode&&"General"!==s.formatCode&&(t={format:s.formatCode&&"General"!==s.formatCode?s.formatCode:null});if(l&&(s.font||s.fillColor||s.hAlign||s.vAlign||s.wordWrap||s.borders)){(t=t||{}).font=s.font;t.fill={color:s.fillColor};t.borders=s.borders;t.hAlign=s.hAlign;t.vAlign=s.vAlign;t.wordWrap=s.wordWrap}var v=this._getAttr(e.substring(0,e.indexOf(">")),"t")||s.type,C=null,k="inlineStr"===v||e.indexOf("<is>")>=0;C=k?this._getInlineString(e):this._getElementValue(e,"v",null,null);C=this._unescape(C);var T=null,F=null,A=null;if(e.indexOf("<f")>-1)if(e.indexOf("</f>")>-1)(T=e.match(/<f.*>.+(?=<\/f>)/))&&(T=T[0].replace(/(\<f.*>)(.+)/,"$2"));else if(F=this._getAttr(e,"si")){A=this._getAttr(e,"r");T=this._getSharedFormula(F,A)}null!=T&&(T=T.replace(/\[\#This Row\]\s*,\s*/gi,"@"));"str"===v||"e"===v||k||(C=C?+C:C);f=this._alphaNum(this._getAttr(e,"r").match(/[a-zA-Z]*/g)[0]);var z=null;switch(v){case"s":if(null!=(C=this._sharedStrings[C]))if(wijmo_1.isString(C))s&&s.quotePrefix&&(C="'"+C);else{z=C.slice();C=this._getTextOfTextRuns(z)}break;case"b":C=1===C;break;case"date":C=null!=C?this._convertDate(C):null}if(wijmo_1.isNumber(C)){null==t&&(t={format:""});wijmo_1.isInt(C)?t.format=t.format||"#,##0":t.format=t.format||"#,##0.00"}y.cells[f]={value:C,textRuns:z,isDate:"date"===v,isNumber:"number"===v,formula:Workbook._unescapeXML(T),style:t}}}var R=[],W=[];if(n.length>0&&n[0].indexOf("<cols>")>-1)for(var D=(R=n[0].substring(n[0].indexOf("<cols>")+6,n[0].indexOf("</cols>")).split("<col ")).length-1;D>0;D--){let e=this._parseCharWidthToPixel(+this._getAttr(R[D],"width")),t=null,s=null;R[D].indexOf("style")>-1&&(t=this._styles[+this._getAttr(R[D],"style")]||{type:"General",formatCode:null});t&&t.formatCode&&"General"!==t.formatCode&&(s={format:t.formatCode&&"General"!==t.formatCode?t.formatCode:null});if(l&&t&&(t.font||t.fillColor||t.hAlign||t.vAlign||t.wordWrap||t.borders)){(s=s||{}).font=t.font;s.fill={color:t.fillColor};s.borders=t.borders;s.hAlign=t.hAlign;s.vAlign=t.vAlign;s.wordWrap=t.wordWrap}var N=+this._getAttr(R[D],"min"),O=+this._getAttr(R[D],"max");if(O>h.maxCol)h._extraColumn={min:N,max:O,width:e,style:s};else for(f=N-1;f<O&&f<h.maxCol;f++)W[f]={visible:"1"!==this._getAttr(R[D],"hidden"),autoWidth:"1"===this._getAttr(R[D],"bestFit"),width:e,style:s}}h.columns=W;var B,j=e.indexOf("<hyperlinks");if(j>-1)for(var E=e.substring(j,e.indexOf("</hyperlinks>")).split("<hyperlink "),I=E.length;--I;)this._getHyperlink(h,E[I]);if(h.frozenPane){if(!isNaN(h.frozenPane.rows))for(a=0;a<h.rows.length&&a<h.frozenPane.rows;a++)h.rows[a]&&!h.rows[a].visible&&h.frozenPane.rows++;if(!isNaN(h.frozenPane.columns))for(a=0;a<W.length&&a<h.frozenPane.columns;a++)W[a]&&!W[a].visible&&h.frozenPane.columns++}for(S=0;S<r.length;S++){B=r[S];h.rows[B.topRow]||(h.rows[B.topRow]={cells:[]});h.rows[B.topRow].cells||(h.rows[B.topRow].cells=[]);h.rows[B.topRow].cells[B.leftCol]||(h.rows[B.topRow].cells[B.leftCol]={});h.rows[B.topRow].cells[B.leftCol].rowSpan=B.bottomRow<h.maxRow?B.bottomRow-B.topRow+1:200;h.rows[B.topRow].cells[B.leftCol].colSpan=B.rightCol<h.maxCol?B.rightCol-B.leftCol+1:20}}static _getTable(e){var t={};t.name=this._getAttr(e,"name");t.range=this._getAttr(e,"ref");var s=this._getAttr(e,"headerRowCount");t.showHeaderRow=""==s||"1"===s;var l=this._getAttr(e,"totalsRowCount");t.showTotalRow="1"===l;var i=e.substring(e.indexOf("<tableStyleInfo")),r=this._getAttr(i,"name");this._isBuiltInStyleName(r)?t.style={name:r}:t.style=this._getTableStyleByName(r);t.showBandedColumns="1"===this._getAttr(i,"showColumnStripes");t.showBandedRows="1"===this._getAttr(i,"showRowStripes");t.alterFirstColumn="1"===this._getAttr(i,"showFirstColumn");t.alterLastColumn="1"===this._getAttr(i,"showLastColumn");var o=e.split("<tableColumn ");t.columns=[];for(var a=1;a<o.length;a++){var n=o[a];t.columns.push(this._getTableColumn(n))}if(e.indexOf("filterColumn")>-1)for(var h=e.substring(e.indexOf("<autoFilter"),e.indexOf("</autoFilter>")).split("<filterColumn"),c=1;c<h.length;c++){var d=h[c],f=+this._getAttr(d,"colId");t.columns[f].showFilterButton="1"!==this._getAttr(d,"hiddenButton")}return t}static _getTableColumn(e){var t={};t.name=this._getAttr(e,"name");var s=this._getAttr(e,"totalsRowLabel");if(s)t.totalRowLabel=s;else{var l=this._getAttr(e,"totalsRowFunction");"custom"===l&&(l=e.substring(e.indexOf("<totalsRowFormula>")+2+"totalsRowFormula".length,e.indexOf("</totalsRowFormula>")));t.totalRowFunction=l}return t}static _getSheetRelatedTable(e){var t=this._getAttr(e,"Target");t=t.substring(t.lastIndexOf("/")+1);for(var s=0;s<this._tables.length;s++){var l=this._tables[s];if(t===l.fileName)return l}return null}static _getSheetRelatedHyperlink(e,t,s){for(var l=0;l<s.hyperlinkRIds.length;l++){var i=s.hyperlinkRIds[l];if(i.rId===t){var r=this._getAttr(e,"Target");s.rows[i.ref.row]&&s.rows[i.ref.row].cells[i.ref.col]&&(s.rows[i.ref.row].cells[i.ref.col].link=r)}}}static _getTableStyles(e,t){for(var s=e.split("<tableStyle "),l=s.length;--l;){var i={},r=s[l];i.name=this._getAttr(r,"name");for(var o=r.split("<tableStyleElement "),a=o.length;--a;){var n=o[a],h=this._getAttr(n,"type");switch(h){case"firstRowStripe":h="firstBandedRowStyle";break;case"secondRowStripe":h="secondBandedRowStyle";break;case"firstColumnStripe":h="firstBandedColumnStyle";break;case"secondColumnStripe":h="secondBandedColumnStyle";break;default:h+="Style"}var c=this._getAttr(n,"dxfId");""!==c&&(i[h]=this._getTableStyleElement(t[+c+1]));var d=this._getAttr(n,"size");if(d){null==i[h]&&(i[h]={});i[h].size=+d}}this._tableStyles.push(i)}}static _getTableStyleElement(e){var t=null,s=null,l=null,i=null,r=e.indexOf("<font>");if(r>=0){t=e.substring(r,e.indexOf("</font>"));var o=this._getChildNodeValue(t,"sz");s={bold:"1"===this._getChildNodeValue(t,"b"),italic:"1"===this._getChildNodeValue(t,"i"),underline:"1"===this._getChildNodeValue(t,"u"),size:Math.round(o?96*+o/72:14),family:this._getChildNodeValue(t,"name"),color:this._getColor(t,!1)}}t=null;if((r=e.indexOf("<fill>"))>=0){t=e.substring(r,e.indexOf("</fill>"));l={color:this._getColor(t,!0)}}t=null;if((r=e.indexOf("<border>"))>=0){t=e.substring(r,e.indexOf("</border>"));i={left:this._getEdgeBorder(t,"left"),right:this._getEdgeBorder(t,"right"),top:this._getEdgeBorder(t,"top"),bottom:this._getEdgeBorder(t,"bottom"),vertical:this._getEdgeBorder(t,"vertical"),horizontal:this._getEdgeBorder(t,"horizontal")}}return{font:s,fill:l,borders:i}}static _getTableStyleByName(e){var t,s;if(null==this._tableStyles||0===this._tableStyles.length)return null;for(t=0;t<this._tableStyles.length;t++)if((s=this._tableStyles[t])&&s.name.toLowerCase()===e.toLowerCase())return s;return null}static _getHyperlink(e,t){var s,l,i,r,o,a;if(null!=(s=this._getAttr(t,"ref"))){i=s.split(":");null==(o=this._getAttr(t,"r:id"))&&(a=this._getAttr(t,"location"));for(var n=0;n<i.length;n++){l=i[n];r=Workbook.tableAddress(l);if(o){null==e.hyperlinkRIds&&(e.hyperlinkRIds=[]);e.hyperlinkRIds.push({ref:r,rId:o})}else a&&e.rows[r.row]&&e.rows[r.row].cells[r.col]&&(e.rows[r.row].cells[r.col].link=a)}}}static _getTextRunFont(e){var t,s=this._getChildNodeValue(e,"sz");return{bold:e.indexOf("<b/>")>=0||"true"===this._getChildNodeValue(e,"b"),italic:e.indexOf("<i/>")>=0||"true"===this._getChildNodeValue(e,"i"),underline:e.indexOf("<u/>")>=0||(t=this._getChildNodeValue(e,"u"))&&"none"!==t,size:Math.round(s?96*+s/72:14),family:this._getChildNodeValue(e,"rFont"),color:this._getColor(e,!1)}}static _getTextOfTextRuns(e){var t,s,l="";for(t=0;t<e.length;t++)(s=e[t])&&(l+=s.text);return l}static _isBuiltInStyleName(e){var t;if(0===e.search(/TableStyleLight/i)){t=+e.substring(15);if(!isNaN(t)&&t>=1&&t<=21)return!0}else if(0===e.search(/TableStyleMedium/i)){t=+e.substring(16);if(!isNaN(t)&&t>=1&&t<=28)return!0}else if(0===e.search(/TableStyleDark/i)){t=+e.substring(14);if(!isNaN(t)&&t>=1&&t<=11)return!0}return!1}static _generateRelsDoc(){return'<Relationships xmlns="'+this._relationshipsNS+'"><Relationship Target="docProps/app.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Id="rId3"/><Relationship Target="docProps/core.xml" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Id="rId2"/><Relationship Target="xl/workbook.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Id="rId1"/></Relationships>'}static _generateThemeDoc(){return'<a:theme name="Office Theme" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:themeElements>'+this._generateClrScheme()+this._generateFontScheme()+this._generateFmtScheme()+"</a:themeElements><a:objectDefaults/><a:extraClrSchemeLst/></a:theme>"}static _generateClrScheme(){null===this._colorThemes&&(this._colorThemes=[]);return'<a:clrScheme name="Office"><a:dk1><a:sysClr lastClr="'+(this._colorThemes[1]||"000000")+'" val="windowText"/></a:dk1><a:lt1><a:sysClr lastClr="'+(this._colorThemes[0]||"FFFFFF")+'" val="window"/></a:lt1><a:dk2><a:srgbClr val="'+(this._colorThemes[3]||"1F497D")+'"/></a:dk2><a:lt2><a:srgbClr val="'+(this._colorThemes[2]||"EEECE1")+'"/></a:lt2><a:accent1><a:srgbClr val="'+(this._colorThemes[4]||"4F81BD")+'"/></a:accent1><a:accent2><a:srgbClr val="'+(this._colorThemes[5]||"C0504D")+'"/></a:accent2><a:accent3><a:srgbClr val="'+(this._colorThemes[6]||"9BBB59")+'"/></a:accent3><a:accent4><a:srgbClr val="'+(this._colorThemes[7]||"8064A2")+'"/></a:accent4><a:accent5><a:srgbClr val="'+(this._colorThemes[8]||"4BACC6")+'"/></a:accent5><a:accent6><a:srgbClr val="'+(this._colorThemes[9]||"F79646")+'"/></a:accent6><a:hlink><a:srgbClr val="0000FF"/></a:hlink><a:folHlink><a:srgbClr val="800080"/></a:folHlink></a:clrScheme>'}static _generateFontScheme(){return'<a:fontScheme name="Office"><a:majorFont><a:latin typeface="Cambria"/><a:ea typeface=""/><a:cs typeface=""/><a:font typeface="MS Pゴシック" script="Jpan"/><a:font typeface="맑은 고딕" script="Hang"/><a:font typeface="宋体" script="Hans"/><a:font typeface="新細明體" script="Hant"/><a:font typeface="Times New Roman" script="Arab"/><a:font typeface="Times New Roman" script="Hebr"/><a:font typeface="Tahoma" script="Thai"/><a:font typeface="Nyala" script="Ethi"/><a:font typeface="Vrinda" script="Beng"/><a:font typeface="Shruti" script="Gujr"/><a:font typeface="MoolBoran" script="Khmr"/><a:font typeface="Tunga" script="Knda"/><a:font typeface="Raavi" script="Guru"/><a:font typeface="Euphemia" script="Cans"/><a:font typeface="Plantagenet Cherokee" script="Cher"/><a:font typeface="Microsoft Yi Baiti" script="Yiii"/><a:font typeface="Microsoft Himalaya" script="Tibt"/><a:font typeface="MV Boli" script="Thaa"/><a:font typeface="Mangal" script="Deva"/><a:font typeface="Gautami" script="Telu"/><a:font typeface="Latha" script="Taml"/><a:font typeface="Estrangelo Edessa" script="Syrc"/><a:font typeface="Kalinga" script="Orya"/><a:font typeface="Kartika" script="Mlym"/><a:font typeface="DokChampa" script="Laoo"/><a:font typeface="Iskoola Pota" script="Sinh"/><a:font typeface="Mongolian Baiti" script="Mong"/><a:font typeface="Times New Roman" script="Viet"/><a:font typeface="Microsoft Uighur" script="Uigh"/><a:font typeface="Sylfaen" script="Geor"/></a:majorFont><a:minorFont><a:latin typeface="Calibri"/><a:ea typeface=""/><a:cs typeface=""/><a:font typeface="MS Pゴシック" script="Jpan"/><a:font typeface="맑은 고딕" script="Hang"/><a:font typeface="宋体" script="Hans"/><a:font typeface="新細明體" script="Hant"/><a:font typeface="Arial" script="Arab"/><a:font typeface="Arial" script="Hebr"/><a:font typeface="Tahoma" script="Thai"/><a:font typeface="Nyala" script="Ethi"/><a:font typeface="Vrinda" script="Beng"/><a:font typeface="Shruti" script="Gujr"/><a:font typeface="DaunPenh" script="Khmr"/><a:font typeface="Tunga" script="Knda"/><a:font typeface="Raavi" script="Guru"/><a:font typeface="Euphemia" script="Cans"/><a:font typeface="Plantagenet Cherokee" script="Cher"/><a:font typeface="Microsoft Yi Baiti" script="Yiii"/><a:font typeface="Microsoft Himalaya" script="Tibt"/><a:font typeface="MV Boli" script="Thaa"/><a:font typeface="Mangal" script="Deva"/><a:font typeface="Gautami" script="Telu"/><a:font typeface="Latha" script="Taml"/><a:font typeface="Estrangelo Edessa" script="Syrc"/><a:font typeface="Kalinga" script="Orya"/><a:font typeface="Kartika" script="Mlym"/><a:font typeface="DokChampa" script="Laoo"/><a:font typeface="Iskoola Pota" script="Sinh"/><a:font typeface="Mongolian Baiti" script="Mong"/><a:font typeface="Arial" script="Viet"/><a:font typeface="Microsoft Uighur" script="Uigh"/><a:font typeface="Sylfaen" script="Geor"/></a:minorFont></a:fontScheme>'}static _generateFmtScheme(){return'<a:fmtScheme name="Office">'+this._generateFillScheme()+this._generateLineStyles()+this._generateEffectScheme()+this._generateBgFillScheme()+"</a:fmtScheme>"}static _generateFillScheme(){return'<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:satMod val="350000"/></a:schemeClr></a:gs></a:gsLst><a:lin scaled="1" ang="16200000"/></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="51000"/><a:satMod val="130000"/></a:schemeClr></a:gs><a:gs pos="80000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="130000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="94000"/><a:satMod val="135000"/></a:schemeClr></a:gs></a:gsLst><a:lin scaled="1" ang="16200000"/></a:gradFill></a:fillStyleLst>'}static _generateLineStyles(){return'<a:lnStyleLst><a:ln algn="ctr" cmpd="sng" cap="flat" w="9525"><a:solidFill><a:schemeClr val="phClr"><a:shade val="9500"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln><a:ln algn="ctr" cmpd="sng" cap="flat" w="25400"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln><a:ln algn="ctr" cmpd="sng" cap="flat" w="38100"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln></a:lnStyleLst>'}static _generateEffectScheme(){return'<a:effectStyleLst><a:effectStyle><a:effectLst><a:outerShdw dir="5400000" rotWithShape="0" dist="23000" blurRad="40000"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw dir="5400000" rotWithShape="0" dist="23000" blurRad="40000"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw dir="5400000" rotWithShape="0" dist="23000" blurRad="40000"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw></a:effectLst><a:scene3d><a:camera prst="orthographicFront"><a:rot rev="0" lon="0" lat="0"/></a:camera><a:lightRig dir="t" rig="threePt"><a:rot rev="1200000" lon="0" lat="0"/></a:lightRig></a:scene3d><a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d></a:effectStyle></a:effectStyleLst>'}static _generateBgFillScheme(){return'<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:tint 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:satMod val="300000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="80000"/><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>'}static _generateCoreDoc(e){var t='<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">';e.creator?t+="<dc:creator>"+e.creator+"</dc:creator>":t+="<dc:creator/>";e.lastModifiedBy?t+="<cp:lastModifiedBy>"+e.lastModifiedBy+"</cp:lastModifiedBy>":t+="<cp:lastModifiedBy/>";return t+='<dcterms:created xsi:type="dcterms:W3CDTF">'+(e.created||new Date).toISOString()+'</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">'+(e.modified||new Date).toISOString()+"</dcterms:modified></cp:coreProperties>"}static _generateSheetGlobalSetting(e,t,s){var l=t.rows&&t.rows[0]&&t.rows[0].cells?t.rows[0].cells.length:0,i=' xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"';this._sheetHasNotes(e)&&(i+=' xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"');i+=' xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">';i+='<sheetPr><outlinePr summaryBelow="0"/></sheetPr>';i+='<dimension ref="A1'+(l>0?":"+this._numAlpha(l-1)+t.rows.length:"")+'"/>';i+='<sheetViews><sheetView workbookViewId="0"';e===s.activeWorksheet&&(i+=' tabSelected="1"');t.rightToLeft&&(i+=' rightToLeft="1"');let r=0,o=0;if(t.frozenPane){r=t.frozenPane.rows;o=t.frozenPane.columns}if(r||o){i+=">";i+='<pane state="frozen" activePane="'+(0!==r&&0!==o?"bottomRight":0!==r?"bottomLeft":"topRight")+'" topLeftCell="'+(this._numAlpha(o)+(r+1))+'" ySplit="'+r.toString()+'" xSplit="'+o.toString()+'"/>';i+="</sheetView>"}else i+="/>";i+="</sheetViews>";return i+='<sheetFormatPr defaultRowHeight="15" x14ac:dyDescent="0.25"/>'}static _generateCell(e,t,s,l,i,r){var o='<c r="'+this._numAlpha(t)+(e+1)+'" s="'+s.toString()+'"';l&&(o+=' t="'+l+'"');var a="";if(r){"="===r[0]&&(r=r.substring(1));r=r.replace(/\@\s*/gi,"[#This Row], ");a+="<f>"+Workbook._escapeXML(r)+"</f>"}null!=i&&""!==i&&(a+="<v>"+i+"</v>");return o+(a?">"+a+"</c>":"/>")}static _generateMergeSetting(e){for(var t='<mergeCells count="'+e.length.toString()+'">',s=0;s<e.length;s++)t+='<mergeCell ref="'+e[s].join(":")+'"/>';return t+"</mergeCells>"}static _generateStyleDoc(){var e='<styleSheet xmlns="'+this._workbookNS+'" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac">',t="",s="",l=[],i=0,r=0,o="",a="";a=this._generateFontStyle({},!0);var n="",h="";h+=this._generateFillStyle("none",null);h+=this._generateFillStyle("gray125",null);var c="",d="";d+=this._generateBorderStyle({});var f="",u="";u+=this._generateCellXfs(0,0,0,0,{});for(;i<this._styles.length;){var m=this._styles[i];if(m){var _=0;if((m=JSON.parse(m)).format&&"General"!==m.format&&(_=this._numFmts.indexOf(m.format))<0){var g=l.indexOf(m.format);if(-1===g){l.push(m.format);s+='<numFmt numFmtId="'+(_=164+r).toString()+'" formatCode="'+Workbook._escapeXML(m.format)+'"/>';r++}else _=164+g}var p=0;if(m.borders){var y=JSON.stringify(m.borders);if((p=this._borders.indexOf(y))<0){p=this._borders.push(y)-1;d+=this._generateBorderStyle(m.borders)}}var b=0;if(m.font){var x=JSON.stringify(m.font);if((b=this._fonts.indexOf(x))<0){b=this._fonts.push(x)-1;a+=this._generateFontStyle(m.font)}}var w=0;if(m.fill&&m.fill.color){var S=JSON.stringify(m.fill);if((w=this._fills.indexOf(S))<0){w=this._fills.push(S)-1;h+=this._generateFillStyle("solid",m.fill.color)}}u+=this._generateCellXfs(_,p,b,w,m)}i++}l=null;if(r>0){t='<numFmts count="'+r+'">';t+=s;t+="</numFmts>"}else t='<numFmts count="0"/>';e+=t;o='<fonts count="'+this._fonts.length+'" x14ac:knownFonts="1">';o+=a;e+=o+="</fonts>";n='<fills count="'+this._fills.length+'">';n+=h;e+=n+="</fills>";c='<borders count="'+this._borders.length+'">';c+=d;e+=c+="</borders>";e+='<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>';f='<cellXfs count="'+this._styles.length+'">';f+=u;f+="</cellXfs>";var v="",C="";if(this._tableStyles.length>0){this._getDxfs();this._dxfs.length>0&&(v=this._generateDxfs());C=this._generateTableStyles()}return e+=f+'<cellStyles count="1"><cellStyle xfId="0" builtinId="0" name="Normal"/></cellStyles>'+(""===v?'<dxfs count="0"/>':v)+(""===C?'<tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleLight16"/>':C)+'<extLst><ext uri="{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}"><x14ac:slicerStyles defaultSlicerStyle="SlicerStyleLight1" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"/></ext></extLst></styleSheet>'}static _generateBorderStyle(e,t=!1){var s,l,i="<border>";for(var r in{left:0,right:0,top:0,bottom:0,diagonal:0,vertical:0,horizontal:0})if(t||"vertical"!==r&&"horizontal"!==r){if(e[r]){s="<"+r+' style="'+e[r].style+'">';"";6===(l=(l=e[r].color)?"#"===l[0]?l.substring(1):l:"").length&&(l="FF"+l);l||(l="FF000000");s+='<color rgb="'+l+'"/>';s+="</"+r+">"}else s="<"+r+"/>";i+=s}return i+="</border>"}static _generateFontStyle(e,t=!1,s=!1){var l=s?"<rPr>":"<font>";e.bold&&(l+="<b/>");e.italic&&(l+="<i/>");e.underline&&(l+="<u/>");l+='<sz val="'+(e.size?Math.round(72*e.size/96):this._defaultFontSize)+'"/>';e.color?l+='<color rgb="FF'+this._parseColor(e.color).substring(1)+'"/>':l+='<color theme="1"/>';l+=`<${s?"rFont":"name"} val="${e.family||this._defaultFontName}" />`;l+='<family val="2"/>';t&&(l+='<scheme val="minor"/>');return l+=s?"</rPr>":"</font>"}static _generateFillStyle(e,t,s=!1){var l,i='<fill><patternFill patternType="'+e+'">';if(t){l=s?"<bgColor ":"<fgColor ";i+=l+='rgb="FF'+("#"===t[0]?t.substring(1):t)+'"/>'}return i+="</patternFill></fill>"}static _generateCellXfs(e,t,s,l,i){var r='<xf xfId="0" ';r+='numFmtId="'+e.toString()+'" ';e>0&&(r+='applyNumberFormat="1" ');r+='borderId="'+t.toString()+'" ';t>0&&(r+='applyBorder="1" ');r+='fontId="'+s.toString()+'" ';s>0&&(r+='applyFont="1" ');r+='fillId="'+l.toString()+'" ';l>0&&(r+='applyFill="1" ');i.quotePrefix&&(r+='quotePrefix="1" ');if(i.hAlign||i.vAlign||i.indent||i.wordWrap){r+='applyAlignment="1">';var o="<alignment ";i.hAlign&&(o+='horizontal="'+i.hAlign+'" ');i.vAlign&&(o+='vertical="'+i.vAlign+'" ');i.indent&&(o+='indent="'+i.indent+'" ');i.wordWrap&&(o+='wrapText="1"');r+=o+="/>";r+="</xf>"}else r+="/>";return r}static _generateContentTypesDoc(e){var t='<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">',s=e.sheets,l=s.reduce((e,t,s)=>e||this._sheetHasNotes(s),this._sheetHasNotes(0));this._macroEnabled&&(t+='<Default ContentType="application/vnd.ms-office.vbaProject" Extension="bin"/>');l&&(t+='<Default Extension="vml" ContentType = "application/vnd.openxmlformats-officedocument.vmlDrawing" />');t+='<Default ContentType="application/vnd.openxmlformats-package.relationships+xml" Extension="rels"/><Default ContentType="application/xml" Extension="xml"/><Override ContentType="'+(this._macroEnabled?"application/vnd.ms-excel.sheet.macroEnabled.main+xml":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml")+'" PartName="/xl/workbook.xml"/>';for(let e=0;e<this._contentTypes.length;e++)t+=this._contentTypes[e];t+='<Override ContentType="application/vnd.openxmlformats-officedocument.theme+xml" PartName="/xl/theme/theme1.xml"/><Override ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" PartName="/xl/styles.xml"/><Override ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml" PartName="/xl/sharedStrings.xml"/><Override ContentType="application/vnd.openxmlformats-package.core-properties+xml" PartName="/docProps/core.xml"/><Override ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" PartName="/docProps/app.xml"/>';if(l)for(let e=0;e<s.length;e++)this._sheetHasNotes(e)&&(t+=`<Override PartName="/xl/comments${e+1}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"/>`);for(let e=0;e<this._tables.length;e++)t+='<Override ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml" PartName="/xl/tables/'+this._tables[e]+'"/>';return t+="</Types>"}static _generateAppDoc(e){for(var t='<Properties xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes" xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"><Application>'+(e.application||"wijmo.xlsx")+'</Application><DocSecurity>0</DocSecurity><ScaleCrop>false</ScaleCrop><HeadingPairs><vt:vector baseType="variant" size="2"><vt:variant><vt:lpstr>Worksheets</vt:lpstr></vt:variant><vt:variant><vt:i4>'+this._props.length+'</vt:i4></vt:variant></vt:vector></HeadingPairs><TitlesOfParts><vt:vector baseType="lpstr" size="'+this._props.length+'">',s=0;s<this._props.length;s++)t+="<vt:lpstr>"+this._props[s]+"</vt:lpstr>";return t+="</vt:vector></TitlesOfParts><Manager/><Company>"+(e.company||"GrapeCity, Inc.")+"</Company><LinksUpToDate>false</LinksUpToDate><SharedDoc>false</SharedDoc><HyperlinksChanged>false</HyperlinksChanged><AppVersion>1.0</AppVersion></Properties>"}static _generateWorkbookRels(){for(var e='<Relationships xmlns="'+this._relationshipsNS+'">',t=0;t<this._xlRels.length;t++)e+=this._xlRels[t];e+='<Relationship Target="sharedStrings.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Id="rId'+(this._xlRels.length+1)+'"/><Relationship Target="styles.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Id="rId'+(this._xlRels.length+2)+'"/><Relationship Target="theme/theme1.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Id="rId'+(this._xlRels.length+3)+'"/>';this._macroEnabled&&(e+='<Relationship Target="vbaProject.bin" Type="http://schemas.microsoft.com/office/2006/relationships/vbaProject" Id="rId'+(this._xlRels.length+4)+'"/>');return e+="</Relationships>"}static _generateWorkbook(e){for(var t='<workbook xmlns="'+this._workbookNS+'" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><fileVersion rupBuild="9303" lowestEdited="5" lastEdited="5" appName="xl"/><workbookPr/><bookViews><workbookView xWindow="480" yWindow="60" windowWidth="18195" windowHeight="8505"'+(null!=e.activeWorksheet?' activeTab="'+e.activeWorksheet.toString()+'"':"")+"/></bookViews><sheets>",s=0;s<this._worksheets.length;s++)t+=this._worksheets[s];t+="</sheets>";if(e.definedNames&&e.definedNames.length>0){t+="<definedNames>";for(s=0;s<e.definedNames.length;s++){var l=-1;e.definedNames[s].sheetName&&(l=this._getSheetIndexBySheetName(e,e.definedNames[s].sheetName));t+='<definedName name="'+e.definedNames[s].name+'" '+(l>-1?'localSheetId="'+l+'"':"")+">"+e.definedNames[s].value+"</definedName>"}t+="</definedNames>"}return t+='<calcPr fullCalcOnLoad="1"/></workbook>'}static _generateWorksheetRows(e,t,s,l,i,r,o,a,n,h){let c=s.rows;for(let f=t,u=c.length;f<u;f++){if(o&&o.cancelled)return;if(a&&f-t>100&&Date.now()-e>100){setTimeout(()=>{if(!o||!o.cancelled){n(Math.round((f+1)/c.length*100));this._generateWorksheetRows(Date.now(),f,s,l,i,r,o,a,n,h)}},0);return}let u=-1,m=c[f]&&c[f].cells?c[f].cells.length:0,_=null;r.sheetData+='<row x14ac:dyDescent="0.25" r="'+(f+1).toString()+'"';if(c[f]){c[f].height&&(r.sheetData+=' customHeight="1" ht="'+(72*+c[f].height/96).toString()+'"');c[f].groupLevel&&(r.sheetData+=' outlineLevel="'+c[f].groupLevel.toString()+'"');if(_=c[f].style?this._cloneStyle(c[f].style):null){(_=this._resolveStyleInheritance(_)).font&&_.font.color&&(_.font.color=this._parseColor(_.font.color));_.fill&&_.fill.color&&(_.fill.color=this._parseColor(_.fill.color));null==_.hAlign||wijmo_1.isString(_.hAlign)||(_.hAlign=Workbook._parseHAlignToString(wijmo_1.asEnum(_.hAlign,HAlign)));null==_.vAlign||wijmo_1.isString(_.vAlign)||(_.vAlign=Workbook._parseVAlignToString(wijmo_1.asEnum(_.vAlign,VAlign)));let e=JSON.stringify(_),t=this._styles.indexOf(e);t<0&&(t=this._styles.push(e)-1);r.sheetData+=' customFormat="1" s="'+t.toString()+'"'}}c[f]&&!1===c[f].visible&&(r.sheetData+=' hidden="1"');c[f]&&!0===c[f].collapsed&&(r.sheetData+=' collapsed="1"');r.sheetData+=">";for(;++u<m;){let e=c[f].cells[u];if(null==e)continue;let t="",s=-1,o=e?e.textRuns:null,a=e&&e.hasOwnProperty("value")?e.value:e,n=e&&e.style?this._cloneStyle(e.style):{};n=this._resolveStyleInheritance(n);let h=i[u];if(h){h=this._resolveStyleInheritance(h);n=this._extend(n,h)}_&&(n=this._extend(n,_));if(l){l=this._resolveStyleInheritance(l);n=this._extend(n,l)}null==n.hAlign||wijmo_1.isString(n.hAlign)||(n.hAlign=Workbook._parseHAlignToString(wijmo_1.asEnum(n.hAlign,HAlign)));null==n.vAlign||wijmo_1.isString(n.vAlign)||(n.vAlign=Workbook._parseVAlignToString(wijmo_1.asEnum(n.vAlign,VAlign)));n.font&&n.font.color&&(n.font.color=this._parseColor(n.font.color));n.fill&&n.fill.color&&(n.fill.color=this._parseColor(n.fill.color));this._applyDefaultBorder(n);if(n.borders){n.borders=this._extend({},n.borders);this._parseBorder(n.borders,!!n.fill&&!!n.fill.color)}if(e&&e.isDate&&!wijmo_1.isDate(a)){var d=new Date(a);wijmo_1.isDate(d)&&(a=d)}!wijmo_1.isNumber(a)||!isNaN(a)&&isFinite(a)||(a=a.toString());if(o||a&&wijmo_1.isString(a)&&("@"===n.format||"General"===n.format||(+a).toString()!==a||!isFinite(+a))){this._sharedStrings[1]++;if("'"===(a=o?"{RichTextMark}"+JSON.stringify(o):a)[0]){n.quotePrefix=!0;a=a.substring(1)}(s=this._sharedStrings[0].indexOf(a))<0&&(s=this._sharedStrings[0].push(a)-1);a=s;t="s"}else if(wijmo_1.isBoolean(a)){a=a?1:0;t="b"}else if(wijmo_1.isDate(a)){a=this._convertDate(a);n.format=n.format||"mm-dd-yy"}else wijmo_1.isObject(a)&&(a=null);let m=JSON.stringify(n),g=this._styles.indexOf(m);g<0&&(g=this._styles.push(m)-1);if(e&&(e.colSpan>1||e.rowSpan>1)){e.colSpan=e.colSpan||1;e.rowSpan=e.rowSpan||1;this._checkRangeForIntersections(r.merges,f,e.rowSpan,u,e.colSpan)&&r.merges.push([f,e.rowSpan,u,e.colSpan])}if(e&&e.link){null==r.hyperlinks&&(r.hyperlinks=[]);r.hyperlinks.push({ref:Workbook.xlsxAddress(f,u),value:a,href:e.link})}n=null;r.sheetData+=this._generateCell(f,u,g,t,a,e&&e.formula?e.formula:null)}r.sheetData+="</row>"}r.merges&&(r.merges=r.merges.map(e=>{let t=e[0],s=e[1],l=e[2],i=e[3];return[this._numAlpha(l)+(t+1),this._numAlpha(l+i-1)+(t+s)]}));wijmo_1.isFunction(h)&&h()}static _generateWorkSheet(e,t,s,l,i,r){let o=t.sheets[e];if(!o)throw"Worksheet should not be empty!";r(0);this._collectNotes(o,e);let a=new _SyncPromise(l),n=o.columns,h=this._cloneColumnsStyle(n),c=o.style?this._cloneStyle(o.style):null,d='<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"'+this._generateSheetGlobalSetting(e,o,t),f={hyperlinks:[],merges:[],sheetData:"<sheetData>"};this._generateWorksheetRows(Date.now(),0,o,c,h,f,l,i,r,()=>{let t=e+1;f.sheetData+="</sheetData>";if(n&&n.length>0){d+="<cols>";for(let e=0;e<n.length;e++)d+=this._generateWorksheetColumn(h[e],n[e],e);let e=o._extraColumn;if(e){e.min=Math.max(n.length,e.min);e.min<=e.max&&(d+=this._generateWorksheetColumn(e.style,e,-1))}d+="</cols>"}f.sheetData=d+f.sheetData;d=f.sheetData;f.sheetData=null;f.merges.length>0&&(d+=this._generateMergeSetting(f.merges));let l=1,i=0;this._sheetHasNotes(e)&&(i=l++);let c=f.hyperlinks;if(c&&c.length>0){d+="<hyperlinks>";for(let e=0;e<c.length;e++)if(/\'?(\w+)\'?\!\$?[A-Za-z]{1,2}\$?\d+(:\$?[A-Za-z]{1,2}\$?\d+)?/.test(c[e].href)||/^\$?[A-Za-z]{1,2}\$?\d+(:\$?[A-Za-z]{1,2}\$?\d+)?$/.test(c[e].href))d+='<hyperlink ref="'+c[e].ref+'" display="'+c[e].value+'" location="'+c[e].href+'"/>';else{null==o.externalLinks&&(o.externalLinks=[]);o.externalLinks.push(c[e].href);d+='<hyperlink ref="'+c[e].ref+'" r:id="rId'+l+'"/>';l++}d+="</hyperlinks>"}d+='<pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/>';if(o.tables&&o.tables.length>0){d+='<tableParts count="'+o.tables.length+'">';for(let e=0;e<o.tables.length;e++){d+='<tablePart r:id="rId'+l+'"/>';l++}d+="</tableParts>"}i>0&&(d+=`<legacyDrawing r:id="rId${i}"/>`);d+="</worksheet>";s.file("sheet"+t+".xml",this._xmlDescription+d);d=null;var u='<Override ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" PartName="/xl/worksheets/sheet'+t+'.xml"/>';this._contentTypes.unshift(u);this._props.unshift(this._escape(o.name)||"Sheet"+t);var m='<Relationship Target="worksheets/sheet'+t+'.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Id="rId'+t+'"/>';this._xlRels.unshift(m);var _='<sheet r:id="rId'+t+'" sheetId="'+t+'" name="'+(this._escape(o.name)||"Sheet"+t)+'"'+(!1===o.visible?' state="hidden"':"")+"/>";this._worksheets.unshift(_);r(100);a.resolve()});return a}static _generateWorksheetColumn(e,t,s){let l=-1,i="";if(!this._isEmpty(e)){(e=this._resolveStyleInheritance(e)).font&&e.font.color&&(e.font.color=this._parseColor(e.font.color));e.fill&&e.fill.color&&(e.fill.color=this._parseColor(e.fill.color));null==e.hAlign||wijmo_1.isString(e.hAlign)||(e.hAlign=Workbook._parseHAlignToString(wijmo_1.asEnum(e.hAlign,HAlign)));null==e.vAlign||wijmo_1.isString(e.vAlign)||(e.vAlign=Workbook._parseVAlignToString(wijmo_1.asEnum(e.vAlign,VAlign)));let t=JSON.stringify(e);(l=this._styles.indexOf(t))<0&&(l=this._styles.push(t)-1)}if(!this._isEmpty(t)){let e=t.width;e=null!=e?"string"==typeof e&&e.indexOf("ch")>-1?this._parseCharCountToCharWidth(e.substring(0,e.indexOf("ch"))):this._parsePixelToCharWidth(e):8.43;if(-1==s)i+='<col min="'+t.min+'" max="'+t.max+'"';else{var r=(s+1).toString();i+='<col min="'+r+'" max="'+r+'"'}l>=0&&(i+=' style="'+l.toString()+'"');e&&(i+=' width="'+e+'" customWidth="1"');!1!==t.autoWidth&&(i+=' bestFit="1"');!1===t.visible&&(i+=' hidden="1"');i+="/>"}return i}static _generateSharedStringsDoc(){for(var e='<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="'+this._sharedStrings[1]+'" uniqueCount="'+this._sharedStrings[0].length+'">',t=0;t<this._sharedStrings[0].length;t++){e+="<si>";var s=this._sharedStrings[0][t];if(s&&0===s.indexOf("{RichTextMark}"))try{var l=JSON.parse(s.substring(14));e+=this._generateTextRuns(l,this._defaultFontName.toLowerCase())+"</si>"}catch(t){e+=this._generatePlainText(s)+"</si>"}else e+=this._generatePlainText(s)+"</si>"}return e+"</sst>"}static _generateTextRuns(e,t){let s="";if(e&&e.length>0)for(var l=0;l<e.length;l++){s+="<r>";let i=e[l];if(i.font){let e=!i.font.family||i.font.family.toLowerCase()===t;s+=this._generateFontStyle(i.font,e,!0)}s+=this._generatePlainText(i.text);s+="</r>"}return s}static _generatePlainText(e){if(""===e)return"<t/>";var t="<t";(wijmo_1.isNullOrWhiteSpace(e)||/^\s+\w*|\w*\s+$/.test(e))&&(t+=' xml:space="preserve"');return t+=">"+this._escape(e)+"</t>"}static _generateTable(e,t){var s=this._tables.length+1,l="table"+s+".xml";e.fileName=l;this._tables.push(l);var i='<table ref="'+e.range+'" displayName="'+e.name+'" name="'+e.name+'" id="'+s+'" '+(!1===e.showHeaderRow?'headerRowCount="0" ':"")+(!0===e.showTotalRow?'totalsRowCount="1" ':'totalsRowShown="0" ')+' xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">';!1!==e.showHeaderRow&&(i+=this._generateTableFilterSetting(e.range,e.showTotalRow,e.columns));i+='<tableColumns count="'+e.columns.length+'">';for(var r="",o=0;o<e.columns.length;o++){var a=e.columns[o];r+='<tableColumn name="'+a.name+'" id="'+(o+1)+'" ';a.totalRowFunction?this._tableColumnFunctions.indexOf(a.totalRowFunction)>-1?r+='totalsRowFunction="'+a.totalRowFunction+'"/>':r+='totalsRowFunction="custom"><totalsRowFormula>'+a.totalRowFunction+"</totalsRowFormula></tableColumn>":r+=(a.totalRowLabel?'totalsRowLabel="'+a.totalRowLabel+'"':"")+"/>"}i+=r+"</tableColumns>";i+='<tableStyleInfo name="'+e.style.name+'" showColumnStripes="'+(e.showBandedColumns?"1":"0")+'" showRowStripes="'+(e.showBandedRows?"1":"0")+'" showLastColumn="'+(e.alterLastColumn?"1":"0")+'" showFirstColumn="'+(e.alterFirstColumn?"1":"0")+'"/></table>';if(!this._isBuiltInStyleName(e.style.name)){var n=JSON.stringify(e.style);-1===this._tableStyles.indexOf(n)&&this._tableStyles.push(n)}t.file(l,this._xmlDescription+i);i=null}static _generateTableFilterSetting(e,t,s){var l=e;if(t){var i=l.indexOf(":")+1,r=Workbook.tableAddress(l.substring(l.indexOf(":")+1));r.row-=1;l=l.substring(0,i)+Workbook.xlsxAddress(r.row,r.col)}for(var o='<autoFilter ref="'+l+'"',a="",n=0;n<s.length;n++)!1===s[n].showFilterButton&&(a+='<filterColumn hiddenButton="1" colId="'+n+'"/>');return o+=""===a?"/>":">"+a+"</autoFilter>"}static _generateHyperlinkRel(e,t){for(var s="",l=0;l<e.length;l++)s+='<Relationship TargetMode="External" Target="'+e[l]+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Id="rId'+(t+l)+'"/>';return s}static _getDxfs(){for(var e,t=0;t<this._tableStyles.length;t++){e=JSON.parse(this._tableStyles[t]);Object.keys(e).forEach(t=>{var s,l,i=e[t];if(i&&!wijmo_1.isString(i)&&!this._isEmptyStyleEle(i)){s=JSON.stringify(i);if(-1===(l=this._dxfs.indexOf(s))){l=this._dxfs.push(s)-1;i.styleIndex=l}}});this._tableStyles[t]=e}}static _generateDxfs(){for(var e,t='<dxfs count="'+this._dxfs.length+'">',s=0;s<this._dxfs.length;s++){t+="<dxf>";(e=JSON.parse(this._dxfs[s])).font&&(t+=this._generateFontStyle(e.font));e.fill&&e.fill.color&&(t+=this._generateFillStyle("solid",e.fill.color,!0));if(e.borders&&!this._isEmpty(e.borders)){e.borders=this._extend({},e.borders);this._parseBorder(e.borders,!1);t+=this._generateBorderStyle(e.borders,!0)}t+="</dxf>"}return t+="</dxfs>"}static _generateTableStyles(){for(var e,t,s,l,i,r,o='<tableStyles count="'+this._tableStyles.length+'" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleLight16">',a=0;a<this._tableStyles.length;a++){e=this._tableStyles[a];t=Object.keys(e);i="";r=0;for(var n=0;n<t.length;n++){l=e[s=t[n]];if(!wijmo_1.isString(l)){r++;i+="<tableStyleElement";null!=l.styleIndex&&(i+=' dxfId="'+l.styleIndex+'"');switch(s){case"firstBandedColumnStyle":i+=' type="firstColumnStripe"';null!=l.size&&(i+=' size="'+l.size+'"');break;case"secondBandedColumnStyle":i+=' type="secondColumnStripe"';null!=l.size&&(i+=' size="'+l.size+'"');break;case"firstBandedRowStyle":i+=' type="firstRowStripe"';null!=l.size&&(i+=' size="'+l.size+'"');break;case"secondBandedRowStyle":i+=' type="secondRowStripe"';null!=l.size&&(i+=' size="'+l.size+'"');break;default:i+=' type="'+s.substring(0,s.length-5)+'"'}i+="/>"}}if(r>0){o+='<tableStyle count="'+r+'" name="'+e.name+'" pivot="0">';o+=i+"</tableStyle>"}}return o+="</tableStyles>"}static _isEmptyStyleEle(e){return this._isEmpty(e.borders)&&(this._isEmpty(e.fill)||wijmo_1.isNullOrWhiteSpace(e.fill.color))&&(this._isEmpty(e.font)||!0!==e.font.bold&&wijmo_1.isNullOrWhiteSpace(e.font.color)&&wijmo_1.isNullOrWhiteSpace(e.font.family)&&!0!==e.font.italic&&null==e.font.size&&!0!==e.font.underline)}static _getTableFileName(e,t){for(var s="",l=0;l<e.length;l++){var i=e[l];if(i.name===t){s=i.fileName;break}}return s}static _getColor(e,t){let s,l=-1,i=-1,r=-1;if(t&&-1===(l=e.search(/<fgcolor/i))&&-1===(i=e.search(/<bgcolor/i))||!t&&-1===(r=e.search(/<color/i)))return null;if(t){let t=l>=0?l:i,s=t>=0?e.search(/<\/fgc/i):e.indexOf(/<\/bgc/i);s=s>0?s:e.indexOf("/>");e=e.substring(t,s)}else e=e.substring(r);if(-1!==e.indexOf("rgb="))(s=this._getAttr(e,"rgb"))&&8===s.length&&(s=s.substring(2));else if(-1!==e.indexOf("indexed")){var o=+this._getAttr(e,"indexed");s=this._indexedColors[o]||""}else if(-1!==e.indexOf("auto")&&"1"===this._getAttr(e,"auto"))s="#000000";else{var a,n=+this._getAttr(e,"theme");-1!==e.indexOf("tint")&&(a=+this._getAttr(e,"tint"));s=this._getThemeColor(n,a)}return s&&"#"===s[0]?s:"#"+s}static _getThemeColor(e,t){if(!this._colorThemes)return"#000000";let s=this._colorThemes[e];if(null!=t){let e=new wijmo_1.Color("#"+s),l=e.getHsl();l[2]=t<0?l[2]*(1+t):l[2]*(1-t)+(1-1*(1-t));return(e=wijmo_1.Color.fromHsl(l[0],l[1],l[2])).toString().substring(1)}return s}static _parseColor(e){let t=this._parsedColors[e];if(!t){let s=new wijmo_1.Color(e);s.a<1&&(s=wijmo_1.Color.toOpaque(s));this._parsedColors[e]=t=s.toString()}return t}static _getsBaseSharedFormulas(e){var t,s,l,i=e.match(/\<f[^<]*ref[^<]*>[^<]+(?=\<\/f>)/g);this._sharedFormulas=[];if(i&&i.length>0)for(var r=0;r<i.length;r++){t=i[r];s=this._getAttr(t,"si");l=(l=this._getAttr(t,"ref"))?l.substring(0,l.indexOf(":")):"";t=t.replace(/(\<f.*>)(.+)/,"$2");this._sharedFormulas[+s]=this._parseSharedFormulaInfo(l,t)}}static _parseSharedFormulaInfo(e,t){var s,l,i,r,o,a=t.match(/(\'?\w+\'?\!)?(\$?[A-Za-z]+)(\$?\d+)/g);r=Workbook.tableAddress(e);if(a&&a.length>0){o=[];for(var n=0;n<a.length;n++){s=a[n];t=t.replace(s,"{"+n+"}");if((l=s.indexOf("!"))>0){i=s.substring(0,l);s=s.substring(l+1)}o[n]={cellAddress:Workbook.tableAddress(s),sheetRef:i}}}return{cellRef:r,formula:t,formulaRefs:o}}static _getSharedFormula(e,t){var s,l,i,r,o,a,n,h,c,d,f,u;if(this._sharedFormulas&&this._sharedFormulas.length>0&&(s=this._sharedFormulas[+e])){c=s.formula;if((d=s.formulaRefs)&&d.length>0){l=Workbook.tableAddress(t);n=s.cellRef?s.cellRef.row:0;h=s.cellRef?s.cellRef.col:0;i=l.row-n;r=l.col-h;for(var m=0;m<d.length;m++){o=(f=d[m]).cellAddress.row+(f.cellAddress.absRow?0:i);a=f.cellAddress.col+(f.cellAddress.absCol?0:r);u=Workbook.xlsxAddress(o,a,f.cellAddress.absRow,f.cellAddress.absCol);null!=f.sheetRef&&""!==f.sheetRef&&(u=f.sheetRef+"!"+u);c=c.replace("{"+m+"}",u)}}return c}return""}static _convertDate(e){var t,s,l=new Date(1900,0,0),i=Date.UTC(1900,0,0),r="[object Date]"===Object.prototype.toString.call(e),o=6e4*((r?e.getTimezoneOffset():(new Date).getTimezoneOffset())-l.getTimezoneOffset()),a=l.getTime()-i-6e4*l.getTimezoneOffset();if(r)return(e.getTime()-l.getTime()-o+a)/864e5+1;if(wijmo_1.isNumber(e)){t=e>59?1:0;return 0!==(o=6e4*((s=new Date(1e3*Math.round((+l+864e5*(e-t))/1e3))).getTimezoneOffset()-l.getTimezoneOffset()))?new Date(1e3*Math.round((+l+o-a+864e5*(e-t))/1e3)):s}return null}static _parseBorder(e,t){for(var s in{left:0,right:0,top:0,bottom:0,diagonal:0}){var l=e[s];if(l){wijmo_1.isString(l.color)&&(l.color=this._parseColor(l.color));null==l.style||wijmo_1.isString(l.style)||(l.style=Workbook._parseBorderTypeToString(wijmo_1.asEnum(l.style,BorderStyle,!1)));!t&&l.color&&"#c6c6c6"===l.color.toLowerCase()&&"thin"===l.style&&(e[s]=null)}}}static _applyDefaultBorder(e){if(e.fill&&e.fill.color){null==e.borders&&(e.borders={});for(var t in{left:0,right:0,top:0,bottom:0})null==e.borders[t]&&(e.borders[t]={style:BorderStyle.Thin,color:"#C6C6C6"})}}static _resolveStyleInheritance(e){var t;if(!e.basedOn)return e;for(var s in e.basedOn)if("basedOn"===s){t=this._resolveStyleInheritance(e.basedOn);for(s in t){var l=t[s];e[s]=null==e[s]?l:this._extend(e[s],l)}}else{l=e.basedOn[s];e[s]=null==e[s]?l:this._extend(e[s],l)}delete e.basedOn;return e}static _parsePixelToCharWidth(e){return null==e||isNaN(+e)?null:e<5?0:((+e-5)/7*100+.5)/100}static _parseCharWidthToPixel(e){return null==e||isNaN(+e)?null:Math.floor((256*+e+128/7)/256*7)+5}static _parseCharCountToCharWidth(e){return null==e||isNaN(+e)?null:(7*+e+5)/7*256/256}static _numAlpha(e){let t="",s=this._alphabet;for(;e>=0;){t=s[e%26]+t;e=Math.floor(e/26)-1}return t}static _alphaNum(e){for(var t=0,s=e.length,l=this._alphabetMap,i=0;i<s-1;i++)t+=(l[e[i]]+1)*Math.pow(26,s-(i+1));return t+=l[e[s-1]]}static _typeOf(e){return{}.toString.call(e).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}static _extend(e,t){if(wijmo_1.isObject(e)&&wijmo_1.isObject(t)){for(var s in t){var l=t[s];wijmo_1.isObject(l)&&null!=e[s]?this._extend(e[s],l):null!=l&&null==e[s]&&(e[s]=l)}return e}return t}static _isEmpty(e){var t=Object.prototype.hasOwnProperty;if(null==e)return!0;if(e.length>0)return!1;if(0===e.length)return!0;for(var s in e)if(t.call(e,s))return!1;return!0}static _cloneStyle(e){var t;if(null==e||"object"!=typeof e)return e;t={};for(var s in e)e.hasOwnProperty(s)&&(t[s]=this._cloneStyle(e[s]));return t}static _cloneColumnsStyle(e){for(var t,s=[],l=0;l<e.length;l++)(t=e[l])&&t.style&&(s[l]=this._cloneStyle(t.style));return s}static _getSheetIndex(e){return+(e=e.substring(0,e.lastIndexOf(".xml"))).substring(e.lastIndexOf("sheet")+5)}static _checkRangeForIntersections(e,t,s,l,i){for(let r=0;r<e.length;r++){let o=e[r],a=o[0],n=a+o[1]-1,h=o[2],c=h+o[3]-1;if(!(t>n||t+s-1<a||l>c||l+i-1<h))return!1}return!0}static _getAttr(e,t){var s=e.indexOf(t+'="');if(s>=0){s+=t.length+2;return e.substring(s,e.indexOf('"',s))}return""}static _getChildNodeValue(e,t){var s=e.indexOf(t+' val="');if(s>=0){s+=t.length+6;return e.substring(s,e.indexOf('"',s))}return""}static _getElementValue(e,t,s,l){let i=e.indexOf("<"+t);if(i>=0){let s;(i=e.indexOf(">",i+1+t.length))>0&&"/"!==e[i-1]&&(s=e.substring(i+1,e.indexOf("</",i+1)));return s||l}return s}static _getSubElement(e,t){if(e){let s=e.indexOf("<"+t);if(s>=0){let l=s+1+t.length,i=e.indexOf("</"+t,l);i<0&&(i=e.indexOf("/>",l));return e.substring(l,i)}}}static _getSheetIndexBySheetName(e,t){for(var s=0;s<e.sheets.length;s++)if(e.sheets[s].name===t)return s;return-1}static _sheetHasNotes(e){return!!this._notes[e]}static _collectNotes(e,t){let s,l=e.rows;for(let e=0,i=l.length;e<i;e++){let i=l[e];if(i)for(let l=0,r=i.cells.length;l<r;l++){let r=i.cells[l];if(!r)continue;let o=r.note;if(o&&(null!=o.text||o.textRuns&&o.textRuns.length>0)){s||(s=this._notes[t])||(this._notes[t]=s=[]);o._row=e;o._col=l;s.push(o)}}}}}_xlsx._alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ";_xlsx._alphabetMap="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("").reduce((e,t,s)=>(e[t]=s,e),{});_xlsx._indexedColors=["000000","FFFFFF","FF0000","00FF00","0000FF","FFFF00","FF00FF","00FFFF","000000","FFFFFF","FF0000","00FF00","0000FF","FFFF00","FF00FF","00FFFF","800000","008000","000080","808000","800080","008080","C0C0C0","808080","9999FF","993366","FFFFCC","CCFFFF","660066","FF8080","0066CC","CCCCFF","000080","FF00FF","FFFF00","00FFFF","800080","800000","008080","0000FF","00CCFF","CCFFFF","CCFFCC","FFFF99","99CCFF","FF99CC","CC99FF","FFCC99","3366FF","33CCCC","99CC00","FFCC00","FF9900","FF6600","666699","969696","003366","339966","003300","333300","993300","993366","333399","333333","000000","FFFFFF"];_xlsx._numFmts=["General","0","0.00","#,##0","#,##0.00",,,"$#,##0.00_);($#,##0.00)",,"0%","0.00%","0.00E+00","# ?/?","# ??/??","m/d/yyyy","d-mmm-yy","d-mmm","mmm-yy","h:mm AM/PM","h:mm:ss AM/PM","h:mm","h:mm:ss","m/d/yy h:mm",,,,,,,,,,,,,,,"#,##0 ;(#,##0)","#,##0 ;[Red](#,##0)","#,##0.00;(#,##0.00)","#,##0.00;[Red](#,##0.00)",,,,,"mm:ss","[h]:mm:ss","mmss.0","##0.0E+0","@"];_xlsx._tableColumnFunctions="average, count, countNums, max, min, stdDev, sum, var";_xlsx._xmlDescription='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';_xlsx._workbookNS="http://schemas.openxmlformats.org/spreadsheetml/2006/main";_xlsx._relationshipsNS="http://schemas.openxmlformats.org/package/2006/relationships";_xlsx._defaultFontName="Calibri";_xlsx._defaultFontSize=11;_xlsx._macroEnabled=!1;_xlsx._defaultColorThemes=["FFFFFF","000000","EEECE1","1F497D","4F818D","C0504D","9BBB59","8064A2","4BACC6","F79646"];_xlsx._asciiCtrlReplacements=["_x0000_","_x0001_","_x0002_","_x0003_","_x0004_","_x0005_","_x0006_","_x0007_","_x0008_","\t","\n","_x000B_","_x000C_","\r","_x000E_","_x000F_","_x0010_","_x0011_","_x0012_","_x0013_","_x0014_","_x0015_","_x0016_","_x0017_","_x0018_","_x0019_","_x001A_","_x001B_","_x001C_","_x001D_","_x001E_","_x001F_"];_xlsx._parsedColors={};exports._xlsx=_xlsx;class _JSZipSyncPromise{constructor(e){this.value=e}then(e,t){return new _JSZipSyncPromise(e?e(this.value):null)}catch(e){return this.then(null,e)}static resolve(){return new _JSZipSyncPromise}}class _JsZipWrapper{constructor(e){this._obj=e}loadAsync(...e){let t=this._obj.load(...e);return new _JSZipSyncPromise(this._wrapOrNull(t))}file(...e){let t=this._obj.file(...e);return this._wrapOrNull(t)}get name(){return this._obj.name}async(...e){let t;t=e&&e.length>0&&"uint8array"===e[0].toLowerCase()?this._obj.asUint8Array():this._obj.asText();return new _JSZipSyncPromise(t)}folder(e){let t=this._obj.folder(e);return this._wrapOrNull(t)}forEach(e){let t=this._obj.root,s=t.length,l=this._obj.files;for(let i in l)i.length>s&&i.substr(0,s).toLowerCase()===t&&e(i.substr(s),new _JsZipWrapper(l[i]))}_wrapOrNull(e){return null!=e?new _JsZipWrapper(e):null}}class _SyncPromise{constructor(e,t){this._callbacks=[];this._cs=e;this._onCancel=t}static serial(e,t){t=t.slice();let s=new _SyncPromise(e),l=[],drain=()=>{s.cancelled?t=[]:t.length?t.shift()().then(e=>{l.push(e);drain()},e=>{t=[];s.reject(e)}):s.resolve(l)};drain();return s}cancel(e=!0){this._cancelled=!0;e&&this._onCancel&&this._onCancel()}get cancelled(){return this._cancelled||this._cs&&this._cs.cancelled}then(e,t){this._callbacks.push({onFulfilled:e,onRejected:t});this._resolved&&this.resolve(this._resolved.value);return this}catch(e){return this.then(null,e)}resolve(e){if(this.cancelled)return this;this._resolved={value:e};try{this.onFulfilled(e)}catch(e){this.onRejected(e)}return this}reject(e){if(this.cancelled)return this;this.onRejected(e);return this}onFulfilled(e){for(;this._callbacks.length;){let t=this._callbacks[0];t.onFulfilled&&t.onFulfilled(e);this._callbacks.shift()}}onRejected(e){let t;for(;t=this._callbacks.shift();)t.onRejected&&t.onRejected(e)}}exports._SyncPromise=_SyncPromise;class _NotePositionConverter{constructor(e){this._colsWidthCnt=0;this._colsWidth=[];this._rowsHeightCnt=0;this._rowsHeight=[];this._cols=e.columns;this._rows=e.rows}toAnchor(e,t,s){let l,i,r,o,a,n,h,c,d=e.offsetX,f=e.offsetY;if(d<0){let e;for(l=s,i=-d;l>=0&&!(i<=(e=this._getColWidth(l)));l--)i-=e;i=e-i}else for(l=s+1,i=d;i>=0;l++){let e=this._getColWidth(l);if(i<=e)break;i-=e}if(f<0)for(r=t-1,o=-f;r>=0;r--){let e=this._getRowHeight(r);if(o<=e)break;o-=e}else for(r=t,o=f;o>=0;r++){let e=this._getRowHeight(r);if(o<=e)break;o-=e}for(a=l,n=i+e.width;n>=0;a++){let e=this._getColWidth(a);if(n<=e)break;n-=e}for(h=r,c=o+e.height;c>=0;h++){let e=this._getRowHeight(h);if(c<=e)break;c-=e}return[l,i,r,o,a,n,h,c]}fromAnchor(e,t,s,l){let i=e[0],r=e[1],o=e[2],a=e[3],n=e[4],h=e[5],c=e[6],d=e[7],f=0;if(l===i)f=-(this._getColWidth(l)-r);else if(i>l){f+=r;for(let e=l+1,t=i-1;e<=t;e++)f+=this._getColWidth(e)}else{for(let e=i+1,t=l;e<=t;e++)f-=this._getColWidth(e);f-=this._getColWidth(i)-r}let u=0;if(s===o)u=a;else if(o>s){for(let e=s,t=o-1;e<=t;e++)u+=this._getRowHeight(e);u+=a}else{for(let e=o+1,t=s;e<t;e++)u-=this._getRowHeight(e);u-=this._getRowHeight(o)-a}let m=0;if(i===n)m=h-r;else{for(let e=i+1,t=n-1;e<=t;e++)m+=this._getColWidth(e);m+=this._getColWidth(i)-r;m+=h}let _=0;if(o===c)_=d-a;else{for(let e=o+1,t=c-1;e<=t;e++)_+=this._getRowHeight(e);_+=this._getRowHeight(o)-a;_+=d}t.offsetX=f;t.offsetY=u;t.width=m;t.height=_}_getColWidth(e){let t=this._colsWidth[e];if(null==t){if(this._colsWidthCnt>1e3){this._colsWidth=[];this._colsWidthCnt=0}let s=this._cols[e];t=!s||null==s.visible||s.visible?s&&null!=s.width?Math.max(s.width-5,0):64:0;this._colsWidth[e]=t;this._colsWidthCnt++}return t}_getRowHeight(e){let t=this._rowsHeight[e];if(null==t){if(this._rowsHeightCnt>1e3){this._rowsHeight=[];this._rowsHeightCnt=0}let s=this._rows[e];t=!s||null==s.visible||s.visible?s&&null!=s.height?s.height:20:0;this._rowsHeight[e]=t;this._rowsHeightCnt++}return t}}function _map(e,t,s,l,i){let r=s-t;0==r&&(r=1);return(e-t)*((i-l)/r)+l}exports._map=_map;var fromCodePointImpl=String.fromCodePoint||(e=>{if(e<=65535)return String.fromCharCode(e);e-=65536;return String.fromCharCode(55296+(e>>10),e%1024+56320)});let _uid=0;function _guid(){_uid>4294967295&&(_uid=0);let e=(65535&_uid|65536).toString(16).substr(1),t=(_uid>>16&65535|65536).toString(16).substr(1);_uid++;return`{00000000-0000-0000-0000${t}${e}}`}wijmo_1._registerModule("wijmo.xlsx",selfModule);