@odoo/o-spreadsheet 18.3.24 → 18.3.25
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.
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 18.3.
|
|
6
|
-
* @date 2025-10-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.3.25
|
|
6
|
+
* @date 2025-10-30T12:24:11.774Z
|
|
7
|
+
* @hash def7778
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -35352,8 +35352,10 @@ const LEGACY_VERSION_MAPPING = {
|
|
|
35352
35352
|
17: "17.4",
|
|
35353
35353
|
16: "17.3",
|
|
35354
35354
|
15: "17.2",
|
|
35355
|
+
"14.5": "16.4.1",
|
|
35355
35356
|
14: "16.4",
|
|
35356
35357
|
13: "16.3",
|
|
35358
|
+
"12.5": "15.4.1",
|
|
35357
35359
|
12: "15.4",
|
|
35358
35360
|
// not accurate starting at this point
|
|
35359
35361
|
11: "0.10",
|
|
@@ -81055,6 +81057,6 @@ exports.tokenColors = tokenColors;
|
|
|
81055
81057
|
exports.tokenize = tokenize;
|
|
81056
81058
|
|
|
81057
81059
|
|
|
81058
|
-
__info__.version = "18.3.
|
|
81059
|
-
__info__.date = "2025-10-
|
|
81060
|
-
__info__.hash = "
|
|
81060
|
+
__info__.version = "18.3.25";
|
|
81061
|
+
__info__.date = "2025-10-30T12:24:11.774Z";
|
|
81062
|
+
__info__.hash = "def7778";
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 18.3.
|
|
6
|
-
* @date 2025-10-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.3.25
|
|
6
|
+
* @date 2025-10-30T12:24:11.774Z
|
|
7
|
+
* @hash def7778
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, App, blockDom, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
|
|
@@ -35350,8 +35350,10 @@ const LEGACY_VERSION_MAPPING = {
|
|
|
35350
35350
|
17: "17.4",
|
|
35351
35351
|
16: "17.3",
|
|
35352
35352
|
15: "17.2",
|
|
35353
|
+
"14.5": "16.4.1",
|
|
35353
35354
|
14: "16.4",
|
|
35354
35355
|
13: "16.3",
|
|
35356
|
+
"12.5": "15.4.1",
|
|
35355
35357
|
12: "15.4",
|
|
35356
35358
|
// not accurate starting at this point
|
|
35357
35359
|
11: "0.10",
|
|
@@ -81007,6 +81009,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
|
|
|
81007
81009
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, CoreViewPlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, chartHelpers, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
81008
81010
|
|
|
81009
81011
|
|
|
81010
|
-
__info__.version = "18.3.
|
|
81011
|
-
__info__.date = "2025-10-
|
|
81012
|
-
__info__.hash = "
|
|
81012
|
+
__info__.version = "18.3.25";
|
|
81013
|
+
__info__.date = "2025-10-30T12:24:11.774Z";
|
|
81014
|
+
__info__.hash = "def7778";
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 18.3.
|
|
6
|
-
* @date 2025-10-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.3.25
|
|
6
|
+
* @date 2025-10-30T12:24:11.774Z
|
|
7
|
+
* @hash def7778
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function (exports, owl) {
|
|
@@ -35351,8 +35351,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
35351
35351
|
17: "17.4",
|
|
35352
35352
|
16: "17.3",
|
|
35353
35353
|
15: "17.2",
|
|
35354
|
+
"14.5": "16.4.1",
|
|
35354
35355
|
14: "16.4",
|
|
35355
35356
|
13: "16.3",
|
|
35357
|
+
"12.5": "15.4.1",
|
|
35356
35358
|
12: "15.4",
|
|
35357
35359
|
// not accurate starting at this point
|
|
35358
35360
|
11: "0.10",
|
|
@@ -81054,9 +81056,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
81054
81056
|
exports.tokenize = tokenize;
|
|
81055
81057
|
|
|
81056
81058
|
|
|
81057
|
-
__info__.version = "18.3.
|
|
81058
|
-
__info__.date = "2025-10-
|
|
81059
|
-
__info__.hash = "
|
|
81059
|
+
__info__.version = "18.3.25";
|
|
81060
|
+
__info__.date = "2025-10-30T12:24:11.774Z";
|
|
81061
|
+
__info__.hash = "def7778";
|
|
81060
81062
|
|
|
81061
81063
|
|
|
81062
81064
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
font-size: 14px;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
`;const jx="M256 9 a247 247 0 1 0.1 0 0",Yx={arrowGood:{template:"ARROW_UP",svg:{width:448,height:512,fillColor:"#6AA84F",path:"M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z"}},arrowNeutral:{template:"ARROW_RIGHT",svg:{width:448,height:512,fillColor:"#F0AD4E",path:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"}},arrowBad:{template:"ARROW_DOWN",svg:{width:448,height:512,fillColor:"#E06666",path:"M413.1 222.5l22.2 22.2c9.4 9.4 9.4 24.6 0 33.9L241 473c-9.4 9.4-24.6 9.4-33.9 0L12.7 278.6c-9.4-9.4-9.4-24.6 0-33.9l22.2-22.2c9.5-9.5 25-9.3 34.3.4L184 343.4V56c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24v287.4l114.8-120.5c9.3-9.8 24.8-10 34.3-.4z"}},smileyGood:{template:"SMILE",svg:{width:496,height:512,fillColor:"#6AA84F",path:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 448c-110.3 0-200-89.7-200-200S137.7 56 248 56s200 89.7 200 200-89.7 200-200 200zm-80-216c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm4 72.6c-20.8 25-51.5 39.4-84 39.4s-63.2-14.3-84-39.4c-8.5-10.2-23.7-11.5-33.8-3.1-10.2 8.5-11.5 23.6-3.1 33.8 30 36 74.1 56.6 120.9 56.6s90.9-20.6 120.9-56.6c8.5-10.2 7.1-25.3-3.1-33.8-10.1-8.4-25.3-7.1-33.8 3.1z"}},smileyNeutral:{template:"MEH",svg:{width:496,height:512,fillColor:"#F0AD4E",path:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 448c-110.3 0-200-89.7-200-200S137.7 56 248 56s200 89.7 200 200-89.7 200-200 200zm-80-216c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm160-64c-17.7 0-32 14.3-32 32s14.3 32 32 32 32-14.3 32-32-14.3-32-32-32zm8 144H160c-13.2 0-24 10.8-24 24s10.8 24 24 24h176c13.2 0 24-10.8 24-24s-10.8-24-24-24z"}},smileyBad:{template:"FROWN",svg:{width:496,height:512,fillColor:"#E06666",path:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 448c-110.3 0-200-89.7-200-200S137.7 56 248 56s200 89.7 200 200-89.7 200-200 200zm-80-216c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm160-64c-17.7 0-32 14.3-32 32s14.3 32 32 32 32-14.3 32-32-14.3-32-32-32zm-80 128c-40.2 0-78 17.7-103.8 48.6-8.5 10.2-7.1 25.3 3.1 33.8 10.2 8.4 25.3 7.1 33.8-3.1 16.6-19.9 41-31.4 66.9-31.4s50.3 11.4 66.9 31.4c8.1 9.7 23.1 11.9 33.8 3.1 10.2-8.5 11.5-23.6 3.1-33.8C326 321.7 288.2 304 248 304z"}},dotGood:{template:"GREEN_DOT",svg:{width:512,height:512,fillColor:"#6AA84F",path:jx}},dotNeutral:{template:"YELLOW_DOT",svg:{width:512,height:512,fillColor:"#F0AD4E",path:jx}},dotBad:{template:"RED_DOT",svg:{width:512,height:512,fillColor:"#E06666",path:jx}}},Xx={arrows:{good:"arrowGood",neutral:"arrowNeutral",bad:"arrowBad"},smiley:{good:"smileyGood",neutral:"smileyNeutral",bad:"smileyBad"},dots:{good:"dotGood",neutral:"dotNeutral",bad:"dotBad"}};function Kx(e,t){const o=e.split("/"),s=t.split("/");let i="",n=0;for(let e=0;e<o.length-1;e++)o[e]===s[e]?n++:i+="../";return i+=s.slice(n).join("/"),i}function Jx(e,t=0){const o={};for(let s=0;s<e.length;s++)e[s]&&(o[s+t]=e[s]);return o}function Qx(e){return e.replace(/_x([0-9a-zA-Z]{4})_/g,((e,t)=>String.fromCharCode(parseInt(t,16))))}function eE(e,t,o){return"COL"===t?(e.cols[o]||(e.cols[o]={}),e.cols[o]):(e.rows[o]||(e.rows[o]={}),e.rows[o])}function tE(e){if("="===e[0])return e;const t=ol(e);return 1===t.length&&"REFERENCE"!==t[0].type?e:"="+e}var oE;Zx.add("conditional_formatting",((e,t)=>{const o=e.getConditionalIcon(t);if(o)return Yx[o].svg})),function(e){e.DiagonalBorderNotSupported="Diagonal Borders",e.BorderStyleNotSupported="Border style",e.FillStyleNotSupported="Fill Style",e.FontNotSupported="Font",e.HorizontalAlignmentNotSupported="Horizontal Alignment",e.VerticalAlignmentNotSupported="Vertical Alignments",e.MultipleRulesCfNotSupported="Multiple rules conditional formats",e.CfTypeNotSupported="Conditional format type",e.CfFormatBorderNotSupported="Borders in conditional formats",e.CfFormatAlignmentNotSupported="Alignment in conditional formats",e.CfFormatNumFmtNotSupported="Num formats in conditional formats",e.CfIconSetEmptyIconNotSupported="IconSets with empty icons",e.BadlyFormattedHyperlink="Badly formatted hyperlink",e.NumFmtIdNotSupported="Number format",e.TimeDataValidationNotSupported="Time data validation rules",e.TextLengthDataValidationNotSupported="Text length data validation rules",e.WholeNumberDataValidationNotSupported="Whole number data validation rules",e.NotEqualDateDataValidationNotSupported="Not equal date data validation rules"}(oE||(oE={}));class sE{_parsingWarnings=new Set;_conversionWarnings=new Set;addParsingWarning(e){this._parsingWarnings.add(e)}addConversionWarning(e){this._conversionWarnings.add(e)}get warnings(){return[...this._parsingWarnings,...this._conversionWarnings]}generateNotSupportedWarning(e,t,o){let s=`${e} ${t?'"'+t+'" is':"are"} not yet supported. `;o&&(s+=`Only ${o.join(", ")} are currently supported.`),this._conversionWarnings.has(s)||this._conversionWarnings.add(s)}}const iE=["thin","medium","thick","dashed","dotted"],nE=["general","left","center","right"],rE=["top","center","bottom"],aE=["Arial"],lE=["solid","none"],cE=["expression","cellIs","colorScale","iconSet","containsText","notContainsText","beginsWith","endsWith","containsBlanks","notContainsBlanks"],hE={b:"boolean",d:"date",e:"error",inlineStr:"inlineStr",n:"number",s:"sharedString",str:"str"},dE={dashDot:"thin",dashDotDot:"thin",dashed:"dashed",dotted:"dotted",double:"thin",hair:"thin",medium:"medium",mediumDashDot:"thin",mediumDashDotDot:"thin",mediumDashed:"thin",none:void 0,slantDashDot:"thin",thick:"thick",thin:"thin"},uE={general:void 0,left:"left",center:"center",right:"right",fill:"left",justify:"left",centerContinuous:"center",distributed:"center"},gE={top:"top",center:"middle",bottom:"bottom",justify:"middle",distributed:"middle"},pE={top:"top",middle:"center",bottom:"bottom"};const mE={aboveAverage:void 0,expression:void 0,cellIs:void 0,colorScale:void 0,dataBar:void 0,iconSet:void 0,top10:void 0,uniqueValues:void 0,duplicateValues:void 0,containsText:"ContainsText",notContainsText:"NotContains",beginsWith:"BeginsWith",endsWith:"EndsWith",containsBlanks:"IsEmpty",notContainsBlanks:"IsNotEmpty",containsErrors:void 0,notContainsErrors:void 0,timePeriod:void 0},fE={num:"number",percent:"percentage",max:"value",min:"value",percentile:"percentile",formula:"formula"},vE={NoIcons:void 0,"3Arrows":"arrows","3ArrowsGray":"arrows","3Symbols":"smiley","3Symbols2":"smiley","3Signs":"dots","3Flags":"dots","3TrafficLights1":"dots","3TrafficLights2":"dots","4Arrows":"arrows","4ArrowsGray":"arrows","4RedToBlack":"dots","4Rating":"smiley","4TrafficLights":"dots","5Arrows":"arrows","5ArrowsGray":"arrows","5Rating":"smiley","5Quarters":"dots","3Stars":"smiley","3Triangles":"arrows","5Boxes":"dots"},bE={none:"none",b:"bottom",t:"top",l:"left",r:"right",tr:"right"},SE={areaChart:void 0,area3DChart:void 0,lineChart:"line",line3DChart:void 0,stockChart:void 0,radarChart:"radar",scatterChart:"scatter",pieChart:"pie",pie3DChart:void 0,doughnutChart:"pie",barChart:"bar",bar3DChart:void 0,ofPieChart:void 0,surfaceChart:void 0,surface3DChart:void 0,bubbleChart:void 0,comboChart:"combo"},yE={1:"AVERAGE",2:"COUNT",3:"COUNTA",4:"MAX",5:"MIN",6:"PRODUCT",7:"STDEV",8:"STDEVP",9:"SUM",10:"VAR",11:"VARP",101:"AVERAGE",102:"COUNT",103:"COUNTA",104:"MAX",105:"MIN",106:"PRODUCT",107:"STDEV",108:"STDEVP",109:"SUM",110:"VAR",111:"VARP"},CE={0:"General",1:"0",2:"0.00",3:"#,#00",4:"#,##0.00",9:"0%",10:"0.00%",11:void 0,12:void 0,13:void 0,14:"m/d/yyyy",15:"m/d/yyyy",16:"m/d/yyyy",17:"m/d/yyyy",18:"hh:mm:ss a",19:"hh:mm:ss a",20:"hhhh:mm:ss",21:"hhhh:mm:ss",22:"m/d/yy h:mm",37:void 0,38:void 0,39:void 0,40:void 0,45:"hhhh:mm:ss",46:"hhhh:mm:ss",47:"hhhh:mm:ss",48:void 0,49:"@"},wE={0:1,"0.00":2,"#,#00":3,"#,##0.00":4,"0%":9,"0.00%":10,"0.00E+00":11,"# ?/?":12,"# ??/??":13,"mm-dd-yy":14,"d-mm-yy":15,"mm-yy":16,"mmm-yy":17,"h:mm AM/PM":18,"h:mm:ss AM/PM":19,"h:mm":20,"h:mm:ss":21,"m/d/yy h:mm":22,"#,##0 ;(#,##0)":37,"#,##0 ;[Red](#,##0)":38,"#,##0.00;(#,##0.00)":39,"#,##0.00;[Red](#,##0.00)":40,"mm:ss":45,"[h]:mm:ss":46,"mmss.0":47,"##0.0E+0":48,"@":49,"hh:mm:ss a":19},IE={0:"000000",1:"FFFFFF",2:"FF0000",3:"00FF00",4:"0000FF",5:"FFFF00",6:"FF00FF",7:"00FFFF",8:"000000",9:"FFFFFF",10:"FF0000",11:"00FF00",12:"0000FF",13:"FFFF00",14:"FF00FF",15:"00FFFF",16:"800000",17:"008000",18:"000080",19:"808000",20:"800080",21:"008080",22:"C0C0C0",23:"808080",24:"9999FF",25:"993366",26:"FFFFCC",27:"CCFFFF",28:"660066",29:"FF8080",30:"0066CC",31:"CCCCFF",32:"000080",33:"FF00FF",34:"FFFF00",35:"00FFFF",36:"800080",37:"800000",38:"008080",39:"0000FF",40:"00CCFF",41:"CCFFFF",42:"CCFFCC",43:"FFFF99",44:"99CCFF",45:"FF99CC",46:"CC99FF",47:"FFCC99",48:"3366FF",49:"33CCCC",50:"99CC00",51:"FFCC00",52:"FF9900",53:"FF6600",54:"666699",55:"969696",56:"003366",57:"339966",58:"003300",59:"333300",60:"993300",61:"993366",62:"333399",63:"333333",64:"000000",65:"FFFFFF"},xE={"image/avif":"avif","image/bmp":"bmp","image/gif":"gif","image/vnd.microsoft.icon":"ico","image/jpeg":"jpeg","image/png":"png","image/tiff":"tiff","image/webp":"webp"},EE={avif:"image/avif",bmp:"image/bmp",gif:"image/gif",ico:"image/vnd.microsoft.icon",jpeg:"image/jpeg",png:"image/png",tiff:"image/tiff",webp:"image/webp",jpg:"image/jpeg"},RE={between:"isBetween",notBetween:"isNotBetween",equal:"isEqual",notEqual:"isNotEqual",greaterThan:"isGreaterThan",greaterThanOrEqual:"isGreaterOrEqualTo",lessThan:"isLessThan",lessThanOrEqual:"isLessOrEqualTo"},TE={between:"dateIsBetween",notBetween:"dateIsNotBetween",equal:"dateIs",greaterThan:"dateIsAfter",greaterThanOrEqual:"dateIsOnOrAfter",lessThan:"dateIsBefore",lessThanOrEqual:"dateIsOnOrBefore"};function AE(e){if(!e)return;let t;if(e.rgb)t=e.rgb;else if(e.auto)t=Ax;else{if(!e.indexed)return;t=IE[e.indexed]}var o;return t=6===(o=t).length?"#"+o+"FF":"#"+o.slice(2)+o.slice(0,2),e.tint&&(t=function(e,t){const o=Kt(e),s=Qt(o);t<0&&(s.l=s.l*(1+t));t>0&&(s.l=s.l*(1-t)+(100-100*(1-t)));return Xt(Jt(s))}(t,e.tint)),t=t.toUpperCase(),9===t.length&&t.endsWith("FF")&&(t=t.slice(0,7)),t}function DE(e){return 9===e.length&&(e=e.slice(0,7)),parseInt(e.replace("#",""),16)}const _E=/^(yy|yyyy|m{1,5}|d{1,4}|h{1,2}|s{1,2}|am\/pm|a\/m|\s|-|\/|\.|:)+$/i;function OE(e,t,o){let s=CE[e]||t.find((t=>t.id===e))?.format;if("General"!==s){if(s)try{let e=s.replace(/\[(.*)-[A-Z0-9]{3}\]/g,"[$1]");if(e=e.replace(/\[\$\]/g,""),e=e.replace(/_.{1}/g,""),e=e.replace(/\*.{1}/g,""),function(e){return _E.test(e)}(e)&&(e=function(e){return e=e.toLowerCase(),e=e.replace(/mmmmm/g,"mmm"),e=e.replace(/am\/pm|a\/m/g,"a"),e=e.replace(/hhhh/g,"hh"),e=e.replace(/\bh\b/g,"hh"),e}(e)),function(e){try{return sr(0,{format:e,locale:Ci}),!0}catch(e){return!1}}(e))return e}catch(e){}o.generateNotSupportedWarning(oE.NumFmtIdNotSupported,s||`nmFmtId ${e}`)}}function FE(e,t){const o=e.borders.map((e=>{!function(e,t){e.diagonal&&t.generateNotSupportedWarning(oE.DiagonalBorderNotSupported)}(e,t);const o={top:ME(e.top,t),bottom:ME(e.bottom,t),left:ME(e.left,t),right:ME(e.right,t)};return Object.keys(o).forEach((e=>void 0===o[e]&&delete o[e])),o}));return Jx(o,1)}function ME(e,t){if(!e)return;!function(e,t){iE.includes(e.style)||t.generateNotSupportedWarning(oE.BorderStyleNotSupported,e.style,iE)}(e,t);const o=dE[e.style];return o?{style:o,color:AE(e.color)}:void 0}function PE(e,t){return Jx(e.styles.map((o=>NE({fontStyle:e.fonts[o.fontId],fillStyle:e.fills[o.fillId],alignment:o.alignment},t))),1)}function NE(e,t){return function(e,t,o){e&&e.name&&!aE.includes(e.name)&&o.generateNotSupportedWarning(oE.FontNotSupported,e.name,aE);t&&t.patternType&&!lE.includes(t.patternType)&&o.generateNotSupportedWarning(oE.FillStyleNotSupported,t.patternType,lE)}(e?.fontStyle,e?.fillStyle,t),function(e,t){e&&!nE.includes(e)&&t.generateNotSupportedWarning(oE.HorizontalAlignmentNotSupported,e,nE)}(e?.alignment?.horizontal,t),function(e,t){e&&!rE.includes(e)&&t.generateNotSupportedWarning(oE.VerticalAlignmentNotSupported,e,rE)}(e?.alignment?.vertical,t),{bold:e.fontStyle?.bold,italic:e.fontStyle?.italic,strikethrough:e.fontStyle?.strike,underline:e.fontStyle?.underline,verticalAlign:e.alignment?.vertical?gE[e.alignment.vertical]:void 0,align:e.alignment?.horizontal?uE[e.alignment.horizontal]:void 0,fillColor:"solid"===e.fillStyle?.patternType?AE(e.fillStyle?.fgColor):AE(e.fillStyle?.bgColor),textColor:AE(e.fontStyle?.color),fontSize:e.fontStyle?.size,wrapping:e.alignment?.wrapText?"wrap":"overflow"}}function kE(e,t){const o=[];for(let s of e.styles){const i=OE(s.numFmtId,e.numFmts,t);i&&(o[s.numFmtId]=i)}return Jx(o,1)}function VE(e,t,o){const s=[];let i=1;for(let r of e){if(0===r.cfRules.length)continue;zE(r,t,o);const e=r.cfRules[0];let a;const l=[];if(void 0!==e.dxfId||"colorScale"===e.type||"iconSet"===e.type||"dataBar"===e.type){switch(e.type){case"aboveAverage":case"containsErrors":case"notContainsErrors":case"duplicateValues":case"expression":case"top10":case"uniqueValues":case"timePeriod":continue;case"dataBar":const t=LE(i++,r);t&&s.push(t);continue;case"colorScale":const c=HE(i++,r);c&&s.push(c);continue;case"iconSet":const h=UE(i++,r,o);h&&s.push(h);continue;case"containsText":case"notContainsText":case"beginsWith":case"endsWith":if(!e.text)continue;a=mE[e.type],l.push(e.text);break;case"containsBlanks":case"notContainsBlanks":a=mE[e.type];break;case"cellIs":if(!e.operator||!e.formula||0===e.formula.length)continue;a=(n=e.operator).slice(0,1).toUpperCase()+n.slice(1),l.push(tE(e.formula[0])),2===e.formula.length&&l.push(tE(e.formula[1]))}a&&void 0!==e.dxfId&&s.push({id:(i++).toString(),ranges:r.sqref,stopIfTrue:e.stopIfTrue,rule:{type:"CellIsRule",operator:a,values:l,style:NE({fontStyle:t[e.dxfId].font,fillStyle:t[e.dxfId].fill},o)}})}}var n;return s}function LE(e,t){const o=t.cfRules[0].dataBar;if(!o)return;const s=DE(AE(o.color)||"#FFFFFF");return{id:e.toString(),stopIfTrue:t.cfRules[0].stopIfTrue,ranges:t.sqref,rule:{type:"DataBarRule",color:s}}}function HE(e,t){const o=t.cfRules[0].colorScale;if(!o||o.cfvos.length!==o.colors.length||o.cfvos.length<2||o.cfvos.length>3)return;const s=[];for(let e=0;e<o.cfvos.length;e++)s.push({color:DE(AE(o.colors[e])||"#FFFFFF"),type:fE[o.cfvos[e].type],value:o.cfvos[e].value});const i=s[0],n=2===s.length?s[1]:s[2],r=3===s.length?s[1]:void 0;return{id:e.toString(),stopIfTrue:t.cfRules[0].stopIfTrue,ranges:t.sqref,rule:{type:"ColorScaleRule",minimum:i,midpoint:r,maximum:n}}}function UE(e,t,o){const s=t.cfRules[0].iconSet;if(!s)return;let i=s.cfvos,n=s.cfIcons;if(i.length<3||n&&n.length<3)return;i.length>3&&(i=[i[0],i[Math.floor(i.length/2)],i[i.length-1]]),n&&n.length>3&&(n=[n[0],n[Math.floor(n.length/2)],n[n.length-1]]);const r=[];for(let e=1;e<=2;e++){const t=fE[i[e].type];if("value"===t)return;r.push({value:i[e].value||"",operator:i[e].gte?"ge":"gt",type:t})}let a={lower:n?BE(n[0].iconSet,n[0].iconId):BE(s.iconSet,0),middle:n?BE(n[1].iconSet,n[1].iconId):BE(s.iconSet,1),upper:n?BE(n[2].iconSet,n[2].iconId):BE(s.iconSet,2)};s.reverse&&(a={upper:a.lower,middle:a.middle,lower:a.upper});for(let e of Object.keys(a))if(!a[e])switch(o.generateNotSupportedWarning(oE.CfIconSetEmptyIconNotSupported),e){case"upper":a[e]=Xx.dots.good;break;case"middle":a[e]=Xx.dots.neutral;break;case"lower":a[e]=Xx.dots.bad}return{id:e.toString(),stopIfTrue:t.cfRules[0].stopIfTrue,ranges:t.sqref,rule:{type:"IconSetRule",icons:a,upperInflectionPoint:r[1],lowerInflectionPoint:r[0]}}}function BE(e,t){const o=vE[e];return o?0===t?Xx[o].bad:1===t?Xx[o].neutral:Xx[o].good:""}function zE(e,t,o){if(e.cfRules.length>1&&o.generateNotSupportedWarning(oE.MultipleRulesCfNotSupported),cE.includes(e.cfRules[0].type)||o.generateNotSupportedWarning(oE.CfTypeNotSupported,e.cfRules[0].type),e.cfRules[0].dxfId){const s=t[e.cfRules[0].dxfId];s.border&&o.generateNotSupportedWarning(oE.CfFormatBorderNotSupported),s.alignment&&o.generateNotSupportedWarning(oE.CfFormatAlignmentNotSupported),s.numFmt&&o.generateNotSupportedWarning(oE.CfFormatNumFmtNotSupported)}}function $E(e){switch(e){case"IsNotEmpty":case"NotContains":return"notContainsBlanks";case"IsEmpty":return"containsBlanks";default:return e.charAt(0).toLowerCase()+e.slice(1)}}function GE(e){return Math.round(Vx*e*100)/100}function WE(e){return Math.round(Lx*e*100)/100}function qE(e,t,o,s,i){const n=o?e.styles[o]:{},r=s?e.formats[s]:void 0,a={font:{size:n?.fontSize||fe,color:{rgb:n?.textColor?n.textColor:"000000"},family:2,name:"Arial"},fill:n?.fillColor?{fgColor:{rgb:n.fillColor}}:{reservedAttribute:"none"},numFmt:r?{format:r,id:0}:void 0,border:i||0,alignment:{horizontal:n.align,vertical:n.verticalAlign?pE[n.verticalAlign]:void 0,wrapText:!("wrap"!==n.wrapping&&!t?.includes(Ne))||void 0}};return a.font.strike=!!n?.strikethrough||void 0,a.font.underline=!!n?.underline||void 0,a.font.bold=!!n?.bold||void 0,a.font.italic=!!n?.italic||void 0,a}function ZE(e,t){const o=function(e,t){if(!e)return 0;let o=wE[e.format];o||(o=XE(e,t)+$x);return o}(t.numFmt,e.numFmts),s={fontId:XE(t.font,e.fonts),fillId:XE(t.fill,e.fills),borderId:t.border,numFmtId:o,alignment:{vertical:t.alignment.vertical,horizontal:t.alignment.horizontal,wrapText:t.alignment.wrapText}};return XE(s,e.styles)}function jE(e,t,o){let s,i=e.find((e=>e.path===t));return i?(s=`rId${(i.rels.length+1).toString()}`,i.rels.push({...o,id:s})):(s="rId1",e.push({path:t,rels:[{...o,id:s}]})),s}const YE=new WeakMap;function XE(e,t){let o=YE.get(t);if(!o){o=new Map;for(let e=0;e<t.length;e++){const s=bs(t[e]);o.set(s,e)}YE.set(t,o)}const s=bs(e);if(o.has(s))return o.get(s);const i=t.length;return t.push(e),o.set(s,i),i}const KE=[];function JE(e){const t=KE.findIndex((t=>t===e));return-1===t?(KE.push(e),KE.length):t+1}const QE=[];function eR(e){const t=QE.findIndex((t=>t===e));return-1===t?(QE.push(e),QE.length):t+1}function tR(e){return Math.round(914400*e/96)}function oR(e,t,o){let s,i,n=e;if(({xc:n,sheetName:s}=Jr(e)),s){const e=o.sheets.findIndex((e=>na(e.name,s)));if(e<0)throw new Error("Unable to find a sheet with the name "+s);i=e}else i=Number(t);const r=Lo(n);return void 0===r.right&&(r.right=o.sheets[i].colNumber),void 0===r.bottom&&(r.bottom=o.sheets[i].rowNumber),(r.right-r.left+1)*(r.bottom-r.top+1)}function sR(e){return Math.round(96*e/914400)}function iR(e,t){let o=0;for(let s=0;s<e;s++){const e=t.cols.find((e=>s>=e.min&&s<=e.max));e?.width?o+=e.width:t.sheetFormat?.defaultColWidth?o+=t.sheetFormat.defaultColWidth:o+=Hx}return o/Lx}function nR(e,t){let o=0;for(let s=0;s<e;s++){const e=t.rows.find((e=>e.index-1===s));e?.height?o+=e.height:t.sheetFormat?.defaultRowHeight?o+=t.sheetFormat.defaultRowHeight:o+=Ux}return o/Vx}function rR(e){let t=1;return e.figures.map((o=>function(e,t,o){let s,i,n,r,a;if(1===e.anchors.length)({col:s,row:i,offset:n}=cR(e.anchors[0])),a=sR(e.figureSize.cx),r=sR(e.figureSize.cy);else{({col:s,row:i,offset:n}=cR(e.anchors[0]));const{x:t,y:l}=hR(e.anchors[0],o),{x:c,y:h}=hR(e.anchors[1],o);a=c-t,r=h-l}const l={id:t,col:s,row:i,offset:n};if("dataSets"in(c=e.data)&&c.dataSets.length>0)return{...l,width:a,height:r,tag:"chart",data:aR(e.data)};if(function(e){return"imageSrc"in e}(e.data))return{...l,width:sR(e.data.size.cx),height:sR(e.data.size.cy),tag:"image",data:{path:e.data.imageSrc,mimetype:e.data.mimetype}};var c;return}(o,(t++).toString(),e))).filter(lt)}function aR(e){const t=e.dataSets.some((e=>"reference"in(e.label??{}))),o=e.labelRange?lR(e.labelRange,t):void 0,s=e.dataSets.map((e=>{let o;return e.label&&"text"in e.label&&(o=e.label.text),{dataRange:lR(e.range,t),label:o,backgroundColor:e.backgroundColor}}));"pie"===e.type&&s.reverse();const i={range:s,dataSetsHaveTitle:t,auxiliaryRange:o,title:e.title??{text:""},background:AE({rgb:e.backgroundColor})||"#FFFFFF",legendPosition:e.legendPosition,stacked:e.stacked||!1,aggregated:!1,cumulative:e.cumulative||!1,labelsAsText:!1};try{return OI.get(e.type).getChartDefinitionFromContextCreation(i)}catch(e){return}}function lR(e,t){let{sheetName:o,xc:s}=Jr(e),i=Lo(s);if(t&&void 0!==i.bottom&&void 0!==i.right){const e=i.bottom-i.top+1,t=i.right-i.left+1;1===e?i={...i,left:i.left-1}:1===t&&(i={...i,top:i.top-1})}return Qr(o,zo(i))}function cR(e){const t={x:sR(e.colOffset)-Ce,y:sR(e.rowOffset)-Ce};return{col:e.col,row:e.row,offset:t}}function hR(e,t){return{x:iR(e.col,t)+sR(e.colOffset),y:nR(e.row,t)+sR(e.rowOffset)}}function dR(e,t){const o=[];let s=1;for(const i of e)if(i)switch(i.type){case"time":t.generateNotSupportedWarning(oE.TimeDataValidationNotSupported);break;case"textLength":t.generateNotSupportedWarning(oE.TextLengthDataValidationNotSupported);break;case"whole":t.generateNotSupportedWarning(oE.WholeNumberDataValidationNotSupported);break;case"decimal":const e=uR(s++,i);o.push(e);break;case"list":const n=gR(s++,i);o.push(n);break;case"date":if("notEqual"===i.operator){t.generateNotSupportedWarning(oE.NotEqualDateDataValidationNotSupported);break}const r=pR(s++,i);o.push(r);break;case"custom":const a=mR(s++,i);o.push(a)}return o}function uR(e,t){const o=[tE(t.formula1.toString())];return t.formula2&&o.push(tE(t.formula2.toString())),{id:e.toString(),ranges:t.sqref,isBlocking:"warning"!==t.errorStyle,criterion:{type:RE[t.operator],values:o}}}function gR(e,t){const o=t.formula1.toString(),s=Zr.test(o);return{id:e.toString(),ranges:t.sqref,isBlocking:"warning"!==t.errorStyle,criterion:{type:s?"isValueInRange":"isValueInList",values:s?[o]:o.replaceAll('"',"").split(","),displayStyle:"arrow"}}}function pR(e,t){let o;const s=[tE(t.formula1.toString())];return t.formula2?(s.push(tE(t.formula2.toString())),o={type:TE[t.operator],values:Hr(s,Ci)}):o={type:TE[t.operator],values:Hr(s,Ci),dateValue:"exactDate"},{id:e.toString(),ranges:t.sqref,isBlocking:"warning"!==t.errorStyle,criterion:o}}function mR(e,t){return{id:e.toString(),ranges:t.sqref,isBlocking:"warning"!==t.errorStyle,criterion:{type:"customFormula",values:[tE(t.formula1.toString())]}}}const fR=new RegExp(/'?\[([0-9]*)\](.*)'?!(\$?[a-zA-Z]*\$?[0-9]*)/g),vR=new RegExp(/SUBTOTAL\(([0-9]*),/g),bR=new RegExp(Br.source,"ig");function SR(e,t){const o=function(e){const t={};for(let o of e.rows)for(let e of o.cells)e.formula&&void 0!==e.formula.sharedIndex&&e.formula.content&&(t[e.formula.sharedIndex]={refCellXc:e.xc,formula:e.formula.content});return t}(e);for(let s of e.rows.map((e=>e.cells)).flat())s?.formula&&(s.formula.content=void 0===s.formula.sharedIndex||s.formula.content?"="+s.formula.content:"="+CR(s.xc,o[s.formula.sharedIndex]),s.formula.content=yR(s.formula.content,t))}function yR(e,t){return e=(e=(e=(e=e.replace("_xlfn.","")).replace(/#REF!/g,"#REF")).replace(vR,((e,t)=>{const o=yE[t];return o?o+"(":e}))).replace(fR,((e,o,s,i)=>{o=Number(o)-1,i=i.replace(/\$/g,"");const n=t.externalBooks[o].sheetNames.findIndex((e=>na(e,s)));if(-1===n)return e;const r=t.externalBooks[o].datasets.find((e=>e.sheetId===n))?.data;if(!r)return e;const a=r&&r[i];return(Number(a)?a:`"${a}"`)||e}))}function CR(e,t){const o=_o(t.refCellXc);let s,i=t.formula.slice();do{if(s=bR.exec(i),s){const t=_o(s[0].replace("$","")),n=_o(e),r={colFixed:s[0].startsWith("$"),rowFixed:s[0].includes("$",1)},a={col:n.col-o.col,row:n.row-o.row},l={col:r.colFixed?t.col:t.col+a.col,row:r.rowFixed?t.row:t.row+a.row};i=i.slice(0,s.index)+Oo(l.col,l.row,r)+i.slice(s.index+s[0].length)}}while(s);return i}function wR(e,t){return e.sheets.map((o=>{SR(o,e);const s=function(e){const t=[0,0];for(let o of e.rows)t[0]=Math.max(t[0],Mt(o.cells.map((e=>_o(e.xc).col)))),t[1]=Math.max(t[1],o.index);for(const o of e.figures)t[0]=Math.max(t[0],o.anchors[o.anchors.length-1]?.col??0),t[1]=Math.max(t[1],o.anchors[o.anchors.length-1]?.row??0);return t[0]=Math.max(t[0]+5,Bx),t[1]=Math.max(t[1]+5,zx),t}(o),i=o.sheetViews[0],n=TR(o,"ROW",s[1]),r=TR(o,"COL",s[0]);return{id:o.sheetName,areGridLinesVisible:!i||i.showGridLines,name:o.sheetName,colNumber:s[0],rowNumber:s[1],...ER(o,e,s,t),merges:o.merges,cols:IR(o,s[0],r),rows:xR(o,s[1],n),conditionalFormats:VE(o.cfs,e.dxfs,t),dataValidationRules:dR(o.dataValidations,t),figures:rR(o),isVisible:o.isVisible,panes:i?{xSplit:i.pane.xSplit,ySplit:i.pane.ySplit}:{xSplit:0,ySplit:0},tables:[],headerGroups:{COL:r,ROW:n},color:AE(o.sheetProperties?.tabColor)}}))}function IR(e,t,o){const s={};for(let n=1;n<t+1;n++){const t=e.cols.find((e=>e.min<=n&&n<=e.max));let r;r=t&&t.width?t.width:e.sheetFormat?.defaultColWidth?e.sheetFormat.defaultColWidth:Hx;const a=n-1,l=o.some((e=>e.isFolded&&e.start<=a&&a<=e.end));s[a]={size:(i=r,i?Math.round(i/Lx*100)/100:i),isHidden:!l&&t?.hidden}}var i;return s}function xR(e,t,o){const s={};for(let n=1;n<t+1;n++){const t=e.rows.find((e=>e.index===n));let r;r=t&&t.height?t.height:e.sheetFormat?.defaultRowHeight?e.sheetFormat.defaultRowHeight:Ux;const a=n-1,l=o.some((e=>e.isFolded&&e.start<=a&&a<=e.end));s[a]={size:(i=r,i?Math.round(i/Vx*100)/100:i),isHidden:!l&&t?.hidden}}var i;return s}function ER(e,t,o,s){const i={},n={},r={},a={},l=t.sharedStrings.map(xt);const c=e.hyperlinks.reduce(((e,t)=>(e[t.xc]=t,e)),{});for(let o of e.rows)for(let e of o.cells)i[e.xc]=RR(e,c,l,s),e.styleIndex&&(n[e.xc]=e.styleIndex+1,r[e.xc]=t.styles[e.styleIndex].numFmtId+1,a[e.xc]=t.styles[e.styleIndex].borderId+1);for(let s of e.rows.filter((e=>e.styleIndex)))for(let e=1;e<=o[0];e++){const o=Oo(e-1,s.index-1);n[o]??=s.styleIndex+1,a[o]??=t.styles[s.styleIndex].borderId+1,r[o]??=t.styles[s.styleIndex].numFmtId+1}for(let s of e.cols.filter((e=>e.styleIndex)))for(let e=s.min;e<=Math.min(s.max,o[0]);e++)for(let i=1;i<=o[1];i++){const o=Oo(e-1,i-1);n[o]??=s.styleIndex+1,a[o]??=t.styles[s.styleIndex].borderId+1,r[o]??=t.styles[s.styleIndex].numFmtId+1}return{cells:i,styles:n,formats:r,borders:a}}function RR(e,t,o,s){let i;switch(e.type){case"sharedString":i=o[parseInt(e.value,10)];break;case"boolean":i=Number(e.value)?"TRUE":"FALSE";break;case"date":case"error":case"inlineStr":case"number":case"str":i=e.value}return i&&t[e.xc]&&(i=function(e,t,o){const s=e.display||t;e.relTarget||e.location||o.generateNotSupportedWarning(oE.BadlyFormattedHyperlink);const i=e.relTarget?e.relTarget:rt(Jr(e.location).sheetName);return ot(s,i)}(t[e.xc],i,s)),e.formula&&(i=e.formula.content),i}function TR(e,t,o){const s=e?.sheetProperties?.outlinePr,i=[];let n=0;for(let r=0;r<o;r++){const o=DR(e,t,r),a=o?.outlineLevel||0;if(a>n){const o=AR(e,t,r,("ROW"===t?s?.summaryBelow:s?.summaryRight)??!0);o&&i.push(o)}n=a}return i}function AR(e,t,o,s){const i=DR(e,t,o),n=i?.outlineLevel;if(!n||!n)return;let r=n,a=o,l=i;for(;l&&r>=n;)a++,l=DR(e,t,a),r=l?.outlineLevel||0;const c=o,h=a-1,d=DR(e,t,s?h+1:c-1);return{start:c-1,end:h-1,isFolded:d?.collapsed||!1}}function DR(e,t,o){return"COL"===t?e.cols.find((e=>e.min<=o&&o<=e.max)):e.rows.find((e=>e.index===o))}const _R={light:ni("Light"),medium:ni("Medium"),dark:ni("Dark"),custom:ni("Custom")},OR={hasFilters:!1,totalRow:!1,firstColumn:!1,lastColumn:!1,numberOfHeaders:1,bandedRows:!0,bandedColumns:!1,automaticAutofill:!0,styleId:"TableStyleMedium2"};function FR(e,t){return{coloredText:io(t,.3),light:so(t,.8),medium:so(t,.6),dark:io(t,.3),mediumBorder:so(t,.45),highlight:t,name:e}}const MR={black:{name:ni("Black"),coloredText:"#000000",light:"#D9D9D9",medium:"#A6A6A6",dark:"#404040",mediumBorder:"#000000",highlight:"#000000"},lightBlue:FR(ni("Light blue"),"#346B90"),red:FR(ni("Red"),"#C53628"),lightGreen:FR(ni("Light green"),"#748747"),purple:FR(ni("Purple"),"#6C4E65"),gray:{name:ni("Gray"),coloredText:"#666666",light:"#EEEEEE",medium:"#DDDDDD",dark:"#767676",mediumBorder:"#D0D0D0",highlight:"#A9A9A9"},orange:FR(ni("Orange"),"#C37034")},PR={black:MR.black,orangeBlue:{...MR.lightBlue,highlight:MR.orange.highlight},purpleGreen:{...MR.lightGreen,highlight:MR.purple.highlight},redBlue:{...MR.lightBlue,highlight:MR.red.highlight}},NR=e=>({category:"light",templateName:"lightColoredText",primaryColor:e.highlight,wholeTable:{style:{textColor:e.coloredText},border:{top:{color:e.highlight,style:"thin"},bottom:{color:e.highlight,style:"thin"}}},headerRow:{border:{bottom:{color:e.highlight,style:"thin"}}},totalRow:{border:{top:{color:e.highlight,style:"thin"}}},firstRowStripe:{style:{fillColor:e.light}}}),kR=e=>({category:"light",templateName:"lightWithHeader",primaryColor:e.highlight,wholeTable:{border:{top:{color:e.highlight,style:"thin"},bottom:{color:e.highlight,style:"thin"},left:{color:e.highlight,style:"thin"},right:{color:e.highlight,style:"thin"}}},headerRow:{style:{fillColor:e.highlight,textColor:"#FFFFFF"},border:{bottom:{color:e.highlight,style:"thin"}}},totalRow:{border:{top:{color:e.highlight,style:"medium"}}},firstRowStripe:{border:{bottom:{color:e.highlight,style:"thin"}}},secondRowStripe:{border:{bottom:{color:e.highlight,style:"thin"}}}}),VR=e=>({category:"light",templateName:"lightAllBorders",primaryColor:e.highlight,wholeTable:{border:{top:{color:e.highlight,style:"thin"},bottom:{color:e.highlight,style:"thin"},left:{color:e.highlight,style:"thin"},right:{color:e.highlight,style:"thin"},horizontal:{color:e.highlight,style:"thin"},vertical:{color:e.highlight,style:"thin"}}},headerRow:{border:{bottom:{color:e.highlight,style:"medium"}}},totalRow:{border:{top:{color:e.highlight,style:"medium"}}},firstRowStripe:{style:{fillColor:e.light}},firstColumnStripe:{style:{fillColor:e.light}}}),LR=e=>({category:"medium",templateName:"mediumBandedBorders",primaryColor:e.highlight,wholeTable:{border:{top:{color:e.mediumBorder,style:"thin"},bottom:{color:e.mediumBorder,style:"thin"},left:{color:e.mediumBorder,style:"thin"},right:{color:e.mediumBorder,style:"thin"},horizontal:{color:e.mediumBorder,style:"thin"}}},headerRow:{style:{fillColor:e.highlight,textColor:"#FFFFFF"}},totalRow:{border:{top:{color:e.highlight,style:"medium"}}},firstRowStripe:{style:{fillColor:e.light}},firstColumnStripe:{style:{fillColor:e.light}}}),HR=e=>({category:"medium",templateName:"mediumWhiteBorders",primaryColor:e.highlight,wholeTable:{border:{horizontal:{color:"#FFFFFF",style:"thin"},vertical:{color:"#FFFFFF",style:"thin"}},style:{fillColor:e.light}},headerRow:{border:{bottom:{color:"#FFFFFF",style:"thick"}},style:{fillColor:e.highlight,textColor:"#FFFFFF"}},totalRow:{border:{top:{color:"#FFFFFF",style:"thick"}},style:{fillColor:e.highlight,textColor:"#FFFFFF"}},firstColumn:{style:{fillColor:e.highlight,textColor:"#FFFFFF"}},lastColumn:{style:{fillColor:e.highlight,textColor:"#FFFFFF"}},firstRowStripe:{style:{fillColor:e.medium}},firstColumnStripe:{style:{fillColor:e.medium}}}),UR=e=>({category:"medium",templateName:"mediumMinimalBorders",primaryColor:e.highlight,wholeTable:{border:{top:{color:"#000000",style:"medium"},bottom:{color:"#000000",style:"medium"}}},totalRow:{border:{top:{color:"#000000",style:"medium"}}},headerRow:{style:{fillColor:e.highlight,textColor:"#FFFFFF"},border:{bottom:{color:"#000000",style:"medium"}}},firstColumn:{style:{fillColor:e.highlight,textColor:"#FFFFFF"}},lastColumn:{style:{fillColor:e.highlight,textColor:"#FFFFFF"}},firstRowStripe:{style:{fillColor:MR.black.light}},firstColumnStripe:{style:{fillColor:MR.black.light}}}),BR=e=>({category:"medium",templateName:"mediumAllBorders",primaryColor:e.highlight,wholeTable:{border:{top:{color:e.mediumBorder,style:"thin"},bottom:{color:e.mediumBorder,style:"thin"},left:{color:e.mediumBorder,style:"thin"},right:{color:e.mediumBorder,style:"thin"},horizontal:{color:e.mediumBorder,style:"thin"},vertical:{color:e.mediumBorder,style:"thin"}},style:{fillColor:e.light}},totalRow:{border:{top:{color:e.highlight,style:"medium"}}},firstRowStripe:{style:{fillColor:e.medium}},firstColumnStripe:{style:{fillColor:e.medium}}}),zR=e=>({category:"dark",templateName:"dark",primaryColor:e.highlight,wholeTable:{style:{fillColor:e.highlight,textColor:"#FFFFFF"}},totalRow:{style:{fillColor:e.dark,textColor:"#FFFFFF"},border:{top:{color:"#FFFFFF",style:"thick"}}},headerRow:{style:{fillColor:"#000000"},border:{bottom:{color:"#FFFFFF",style:"thick"}}},firstColumn:{style:{fillColor:e.dark},border:{right:{color:"#FFFFFF",style:"thick"}}},lastColumn:{style:{fillColor:e.dark},border:{left:{color:"#FFFFFF",style:"thick"}}},firstRowStripe:{style:{fillColor:e.dark}},firstColumnStripe:{style:{fillColor:e.dark}}}),$R=e=>({category:"dark",templateName:"darkNoBorders",primaryColor:e.highlight,wholeTable:{style:{fillColor:e.light}},totalRow:{border:{top:{color:"#000000",style:"medium"}}},headerRow:{style:{fillColor:e.highlight,textColor:"#FFFFFF"}},firstRowStripe:{style:{fillColor:e.medium}},firstColumnStripe:{style:{fillColor:e.medium}}}),GR=zR(MR.black);GR.wholeTable.style.fillColor="#737373";const WR=UR(MR.black);function qR(e,t,o){return{...t(o),displayName:`${o.name}, ${e}`}}WR.wholeTable.border={...WR.wholeTable.border,left:{color:"#000000",style:"thin"},right:{color:"#000000",style:"thin"},horizontal:{color:"#000000",style:"thin"},vertical:{color:"#000000",style:"thin"}};const ZR={None:{category:"light",templateName:"none",primaryColor:"",displayName:"none"},TableStyleLight1:qR("TableStyleLight1",NR,MR.black),TableStyleLight2:qR("TableStyleLight2",NR,MR.lightBlue),TableStyleLight3:qR("TableStyleLight3",NR,MR.red),TableStyleLight4:qR("TableStyleLight4",NR,MR.lightGreen),TableStyleLight5:qR("TableStyleLight5",NR,MR.purple),TableStyleLight6:qR("TableStyleLight6",NR,MR.gray),TableStyleLight7:qR("TableStyleLight7",NR,MR.orange),TableStyleLight8:qR("TableStyleLight8",kR,MR.black),TableStyleLight9:qR("TableStyleLight9",kR,MR.lightBlue),TableStyleLight10:qR("TableStyleLight10",kR,MR.red),TableStyleLight11:qR("TableStyleLight11",kR,MR.lightGreen),TableStyleLight12:qR("TableStyleLight12",kR,MR.purple),TableStyleLight13:qR("TableStyleLight13",kR,MR.gray),TableStyleLight14:qR("TableStyleLight14",kR,MR.orange),TableStyleLight15:qR("TableStyleLight15",VR,MR.black),TableStyleLight16:qR("TableStyleLight16",VR,MR.lightBlue),TableStyleLight17:qR("TableStyleLight17",VR,MR.red),TableStyleLight18:qR("TableStyleLight18",VR,MR.lightGreen),TableStyleLight19:qR("TableStyleLight19",VR,MR.purple),TableStyleLight20:qR("TableStyleLight20",VR,MR.gray),TableStyleLight21:qR("TableStyleLight21",VR,MR.orange),TableStyleMedium1:qR("TableStyleMedium1",LR,MR.black),TableStyleMedium2:qR("TableStyleMedium2",LR,MR.lightBlue),TableStyleMedium3:qR("TableStyleMedium3",LR,MR.red),TableStyleMedium4:qR("TableStyleMedium4",LR,MR.lightGreen),TableStyleMedium5:qR("TableStyleMedium5",LR,MR.purple),TableStyleMedium6:qR("TableStyleMedium6",LR,MR.gray),TableStyleMedium7:qR("TableStyleMedium7",LR,MR.orange),TableStyleMedium8:qR("TableStyleMedium8",HR,MR.black),TableStyleMedium9:qR("TableStyleMedium9",HR,MR.lightBlue),TableStyleMedium10:qR("TableStyleMedium10",HR,MR.red),TableStyleMedium11:qR("TableStyleMedium11",HR,MR.lightGreen),TableStyleMedium12:qR("TableStyleMedium12",HR,MR.purple),TableStyleMedium13:qR("TableStyleMedium13",HR,MR.gray),TableStyleMedium14:qR("TableStyleMedium14",HR,MR.orange),TableStyleMedium15:{...WR,displayName:"Black, TableStyleMedium15"},TableStyleMedium16:qR("TableStyleMedium16",UR,MR.lightBlue),TableStyleMedium17:qR("TableStyleMedium17",UR,MR.red),TableStyleMedium18:qR("TableStyleMedium18",UR,MR.lightGreen),TableStyleMedium19:qR("TableStyleMedium19",UR,MR.purple),TableStyleMedium20:qR("TableStyleMedium20",UR,MR.gray),TableStyleMedium21:qR("TableStyleMedium21",UR,MR.orange),TableStyleMedium22:qR("TableStyleMedium22",BR,MR.black),TableStyleMedium23:qR("TableStyleMedium23",BR,MR.lightBlue),TableStyleMedium24:qR("TableStyleMedium24",BR,MR.red),TableStyleMedium25:qR("TableStyleMedium25",BR,MR.lightGreen),TableStyleMedium26:qR("TableStyleMedium26",BR,MR.purple),TableStyleMedium27:qR("TableStyleMedium27",BR,MR.gray),TableStyleMedium28:qR("TableStyleMedium28",BR,MR.orange),TableStyleDark1:{...GR,displayName:"Black, TableStyleDark1"},TableStyleDark2:qR("TableStyleDark2",zR,MR.lightBlue),TableStyleDark3:qR("TableStyleDark3",zR,MR.red),TableStyleDark4:qR("TableStyleDark4",zR,MR.lightGreen),TableStyleDark5:qR("TableStyleDark5",zR,MR.purple),TableStyleDark6:qR("TableStyleDark6",zR,MR.gray),TableStyleDark7:qR("TableStyleDark7",zR,MR.orange),TableStyleDark8:qR("TableStyleDark8",$R,PR.black),TableStyleDark9:qR("TableStyleDark9",$R,PR.redBlue),TableStyleDark10:qR("TableStyleDark10",$R,PR.purpleGreen),TableStyleDark11:qR("TableStyleDark11",$R,PR.orangeBlue)},jR={none:()=>({category:"none",templateName:"none",primaryColor:"",name:"none"}),lightColoredText:NR,lightAllBorders:VR,mediumAllBorders:BR,lightWithHeader:kR,mediumBandedBorders:LR,mediumMinimalBorders:UR,darkNoBorders:$R,mediumWhiteBorders:HR,dark:zR};function YR(e,t,o){const s=FR("",o);return{...jR[t](s),category:"custom",displayName:e}}function XR(e,t){for(const o of t.sheets){const t=e.sheets.find((e=>e.name===o.sheetName));if(t){t.tables||(t.tables=[]);for(const e of o.tables)t.tables.push({range:e.ref,config:KR(e)});for(const e of o.pivotTables)t.tables.push({range:e.location.ref,config:JR(e)})}}!function(e,t){let o=null;for(let s of e){const i=t.find((e=>na(e.sheetName,s.name))).tables;if(i&&0!==i.length){o||(o=QR(e));for(let t of i)for(let i in o){const n=e.find((e=>e.id===i));for(let e in o[i]){for(let r=o[i][e].length-3;r>=0;r-=2){const a=o[i][e][r];if(!a.endsWith(t.name))continue;const l=o[i][e][r+1],c=eT(s.id===n.id?"":s.name+"!",l,t,e);o[i][e][r+2]=a.slice(0,a.indexOf(t.name))+c+o[i][e][r+2],o[i][e].splice(r,2)}}}}}if(!o)return;for(let t in o){const s=e.find((e=>e.id===t));for(let e in o[t]){const i=o[t][e];if(1===i.length){s.cells[e]=i[0];continue}let n="";for(let e=0;e<i.length;e+=2)n+=i[e]+"["+i[e+1]+"]";n+=i[i.length-1],s.cells[e]=n}}}(e.sheets,t.sheets)}function KR(e){const t=e.style?.name||"";return{hasFilters:void 0!==e.autoFilter,numberOfHeaders:e.headerRowCount,totalRow:e.totalsRowCount>0,firstColumn:e.style?.showFirstColumn||!1,lastColumn:e.style?.showLastColumn||!1,bandedRows:e.style?.showRowStripes||!1,bandedColumns:e.style?.showColumnStripes||!1,styleId:ZR[t]?t:OR.styleId}}function JR(e){return{hasFilters:!1,numberOfHeaders:e.location.firstDataRow,totalRow:e.rowGrandTotals,firstColumn:!0,lastColumn:e.style?.showLastColumn||!1,bandedRows:e.style?.showRowStripes||!1,bandedColumns:e.style?.showColStripes||!1,styleId:OR.styleId}}function QR(e){const t={};for(let o of e)for(let e in o.cells){const s=o.cells[e];if(!s||!s.startsWith("="))continue;const i=s.indexOf("[");if(-1===i)continue;const n=[];let r=s.slice(0,i),a="",l=1,c=0,h=i;for(let e=i+1;e<s.length;e++)"["!==s[e]?"]"===s[e]&&(l--,0===l&&(a=s.slice(h+1,e),n.push(r),n.push(a),c=e+1)):(0===l&&(r=s.slice(c,e),h=e),l++);n.length&&(t[o.id]||(t[o.id]={}),n.push(s.slice(c)),t[o.id][e]=[...n])}return t}function eT(e,t,o,s){const i=t.split(",").map((e=>e.trim())),n=Ho(o.ref),r=[],a=[],l=[];for(const e of i)if(tT(e).startsWith("#")){const t=tT(e);switch(l.push(t),t){case"#All":a.push(n.top,n.bottom);break;case"#Data":const e=o.headerRowCount?n.top+o.headerRowCount:n.top,t=o.totalsRowCount?n.bottom-o.totalsRowCount:n.bottom;a.push(e,t);break;case"#This Row":a.push(_o(s).row);break;case"#Headers":if(!o.headerRowCount)return Ti.InvalidReference;a.push(n.top);break;case"#Totals":if(!o.totalsRowCount)return Ti.InvalidReference;a.push(n.bottom)}}else{const t=e.split(":").map((e=>e.trim())).map(tT);if(r.length)return Ti.InvalidReference;const s=o.cols.findIndex((e=>e.name===t[0]));if(-1===s)return Ti.InvalidReference;if(r.push(s+n.left),t[1]){const e=o.cols.findIndex((e=>e.name===t[1]));if(-1===e)return Ti.InvalidReference;r.push(e+n.left)}}if(!function(e){if(e.length<2)return!0;if(e.length>2)return!1;if(e.includes("#Data")&&e.includes("#Totals"))return!0;if(e.includes("#Headers")&&e.includes("#Data"))return!0;return!1}(l))return Ti.InvalidReference;if(0===a.length){const e=o.headerRowCount?n.top+o.headerRowCount:n.top,t=o.totalsRowCount?n.bottom-o.totalsRowCount:n.bottom;a.push(e,t)}0===r.length&&r.push(n.left,n.right);return e+zo({top:Math.min(...a),left:Math.min(...r),bottom:Math.max(...a),right:Math.max(...r)})}function tT(e){return e.startsWith("[")&&e.endsWith("]")?e.slice(1,e.length-1):e}class oT{value;constructor(e){this.value=e}asString(){return Qx(String(this.value))}asBool(){return"true"===this.value||"false"!==this.value&&Boolean(Number(this.value))}asNum(){return Number(this.value)}}class sT{rootFile;xlsxFileStructure;warningManager;relationships;currentFile=void 0;constructor(e,t,o){this.rootFile=e,this.currentFile=e.file.fileName,this.xlsxFileStructure=t,this.warningManager=o,this.relationships={},e.rels&&this.extractRelationships(e.rels).map((e=>{this.relationships[e.id]=e}))}extractRelationships(e){return this.mapOnElements({parent:e.xml,query:"Relationship"},(e=>({id:this.extractAttr(e,"Id",{required:!0}).asString(),target:this.extractAttr(e,"Target",{required:!0}).asString(),type:this.extractAttr(e,"Type",{required:!0}).asString()})))}getListOfXMLFiles(){return Object.entries(this.xlsxFileStructure).filter((([e])=>"images"!==e)).map((([e,t])=>t)).flat().filter(lt)}mapOnElements(e,t){const o=[],s=this.currentFile;let i;if(e.children){const t=this.querySelector(e.parent,e.query)?.children;i=t||[]}else i=this.querySelectorAll(e.parent,e.query);if(i)for(let e of i)try{o.push(t(e))}catch(t){this.catchErrorOnElement(t,e)}return this.currentFile=s,o}catchErrorOnElement(e,t){const o=t?`Error when parsing an element <${t.tagName}> of file ${this.currentFile}, skip this element. \n${e.stack}`:`Error when parsing file ${this.currentFile}.`;this.warningManager.addParsingWarning([o,e.message].join("\n"))}extractAttr(e,t,o){const s=e.attributes[t];s||this.handleMissingValue(e,`attribute "${t}"`,o);const i=s?.value?s.value:o?.default;return void 0===i?void 0:new oT(i)}extractTextContent(e,t){if(void 0!==t?.default&&"string"!=typeof t.default)throw new Error("extractTextContent default value should be a string");const o="preserve"===e?.attributes["xml:space"]?.value;let s=e?.textContent;return e&&null!==s||this.handleMissingValue(e,"text content",t),s&&(s=o?s:s.trim()),s?Qx(s):t?.default}extractChildAttr(e,t,o,s){let i;i="number"==typeof t?e.children[t]:this.querySelector(e,t),i||this.handleMissingValue(e,"number"==typeof t?`child at index ${t}`:`child <${t}>`,s);const n=i?this.extractAttr(i,o,s)?.asString():s?.default;return void 0!==n?new oT(n):void 0}extractChildTextContent(e,t,o){if(void 0!==o?.default&&"string"!=typeof o.default)throw new Error("extractTextContent default value should be a string");let s=this.querySelector(e,t);return s||this.handleMissingValue(e,`child <${t}>`,o),s?this.extractTextContent(s,o):o?.default}handleMissingValue(e,t,o){if(o?.required){if(void 0===o?.default)throw new Error(`Missing required ${t} in element <${e.tagName}> of ${this.currentFile}, and no default value was set`);this.warningManager.addParsingWarning(`Missing required ${t} in element <${e.tagName}> of ${this.currentFile}, replacing it by the default value ${o.default}`)}}extractColor(e,t,o){if(!e)return o?{rgb:o}:void 0;const s=this.extractAttr(e,"theme")?.asString();let i;if(void 0!==s){if(!t||!t.clrScheme)throw new Error("Color referencing a theme but no theme was provided");i=this.getThemeColor(s,t.clrScheme)}else i=this.extractAttr(e,"rgb")?.asString(),i="FF000000"===i?void 0:i;return{rgb:i||o,auto:this.extractAttr(e,"auto")?.asBool(),indexed:this.extractAttr(e,"indexed")?.asNum(),tint:this.extractAttr(e,"tint")?.asNum()}}getTargetXmlFile(e){if(!e)throw new Error("Undefined target file");const t=this.processRelationshipTargetName(e.target),o=this.getListOfXMLFiles().find((e=>e.file.fileName.endsWith(t)));if(!o||!o.file)throw new Error("Cannot find target file");return o}getTargetImageFile(e){if(!e)throw new Error("Undefined target file");const t=this.processRelationshipTargetName(e.target),o=this.xlsxFileStructure.images.find((e=>e.fileName.endsWith(t)));if(!o)throw new Error("Cannot find target file");return o}querySelector(e,t){const o=bx(t);return e.querySelector(o)}querySelectorAll(e,t){const o=bx(t);return e.querySelectorAll(o)}getThemeColor(e,t){switch(e){case"0":return"FFFFFF";case"1":return"000000";case"2":return t[3].value;case"3":return t[2].value;default:return t[e].value}}processRelationshipTargetName(e){return e.replace(/\.+\//,"")}}class iT extends sT{getTheme(){return{clrScheme:this.mapOnElements({query:"a:clrScheme",parent:this.rootFile.file.xml,children:!0},(e=>({name:e.tagName,value:this.extractChildAttr(e,0,"val",{required:!0,default:Ax}).asString(),lastClr:this.extractChildAttr(e,0,"lastClr",{default:Ax}).asString()})))}}getSharedStrings(){return this.mapOnElements({parent:this.rootFile.file.xml,query:"si"},(e=>this.mapOnElements({parent:e,query:"t"},(e=>this.extractTextContent(e)||"")).join("")))}}class nT extends sT{theme;constructor(e,t,o,s){super(e,t,o),this.theme=s}extractConditionalFormattings(){const e=this.mapOnElements({parent:this.rootFile.file.xml,query:"worksheet > conditionalFormatting"},(e=>({sqref:this.extractAttr(e,"sqref",{required:!0}).asString().split(" "),pivot:this.extractAttr(e,"pivot")?.asBool(),cfRules:this.extractCFRules(e,this.theme)})));return e.push(...this.mapOnElements({parent:this.rootFile.file.xml,query:"extLst x14:conditionalFormatting"},(e=>({sqref:this.extractChildTextContent(e,"xm:sqref",{required:!0}).split(" "),pivot:this.extractAttr(e,"xm:pivot")?.asBool(),cfRules:this.extractCFRules(e,this.theme)})))),e}extractCFRules(e,t){return this.mapOnElements({parent:e,query:"cfRule, x14:cfRule"},(e=>({type:this.extractAttr(e,"type",{required:!0}).asString(),priority:this.extractAttr(e,"priority",{required:!0}).asNum(),colorScale:this.extractCfColorScale(e,t),formula:this.extractCfFormula(e),iconSet:this.extractCfIconSet(e),dxfId:this.extractAttr(e,"dxfId")?.asNum(),stopIfTrue:this.extractAttr(e,"stopIfTrue")?.asBool(),aboveAverage:this.extractAttr(e,"aboveAverage")?.asBool(),percent:this.extractAttr(e,"percent")?.asBool(),bottom:this.extractAttr(e,"bottom")?.asBool(),operator:this.extractAttr(e,"operator")?.asString(),text:this.extractAttr(e,"text")?.asString(),timePeriod:this.extractAttr(e,"timePeriod")?.asString(),rank:this.extractAttr(e,"rank")?.asNum(),stdDev:this.extractAttr(e,"stdDev")?.asNum(),equalAverage:this.extractAttr(e,"equalAverage")?.asBool(),dataBar:this.extractCfDataBar(e,t)})))}extractCfFormula(e){return this.mapOnElements({parent:e,query:"formula"},(e=>this.extractTextContent(e,{required:!0})))}extractCfColorScale(e,t){const o=this.querySelector(e,"colorScale");if(o)return{colors:this.mapOnElements({parent:o,query:"color"},(e=>this.extractColor(e,t,"ffffff"))),cfvos:this.extractCFVos(o)}}extractCfDataBar(e,t){const o=this.querySelector(e,"dataBar");if(o)return{color:this.extractColor(o.querySelector("color"),t,"EFF7FF"),cfvos:this.extractCFVos(o)}}extractCfIconSet(e){const t=this.querySelector(e,"iconSet, x14:iconSet");if(t)return{iconSet:this.extractAttr(t,"iconSet",{default:"3TrafficLights1"}).asString(),showValue:this.extractAttr(t,"showValue",{default:!0}).asBool(),percent:this.extractAttr(t,"percent",{default:!0}).asBool(),reverse:this.extractAttr(t,"reverse")?.asBool(),custom:this.extractAttr(t,"custom")?.asBool(),cfvos:this.extractCFVos(t),cfIcons:this.extractCfIcons(t)}}extractCfIcons(e){const t=this.mapOnElements({parent:e,query:"cfIcon, x14:cfIcon"},(e=>({iconSet:this.extractAttr(e,"iconSet",{required:!0}).asString(),iconId:this.extractAttr(e,"iconId",{required:!0}).asNum()})));return 0===t.length?void 0:t}extractCFVos(e){return this.mapOnElements({parent:e,query:"cfvo, x14:cfvo"},(e=>({type:this.extractAttr(e,"type",{required:!0}).asString(),gte:this.extractAttr(e,"gte",{default:!0})?.asBool(),value:e.attributes.val?this.extractAttr(e,"val")?.asString():this.extractChildTextContent(e,"f, xm:f")})))}}class rT extends sT{theme;constructor(e,t,o,s){super(e,t,o),this.theme=s}extractDataValidations(){return this.mapOnElements({parent:this.rootFile.file.xml,query:"worksheet > dataValidations > dataValidation"},(e=>({type:this.extractAttr(e,"type",{required:!0}).asString(),operator:this.extractAttr(e,"operator",{default:"between"})?.asString(),sqref:this.extractAttr(e,"sqref",{required:!0}).asString().split(" "),errorStyle:this.extractAttr(e,"errorStyle")?.asString(),formula1:this.extractDataValidationFormula(e,1)[0],formula2:this.extractDataValidationFormula(e,2)[0],showErrorMessage:this.extractAttr(e,"showErrorMessage")?.asBool(),errorTitle:this.extractAttr(e,"errorTitle")?.asString(),error:this.extractAttr(e,"error")?.asString(),showInputMessage:this.extractAttr(e,"showInputMessage")?.asBool(),promptTitle:this.extractAttr(e,"promptTitle")?.asString(),prompt:this.extractAttr(e,"prompt")?.asString(),allowBlank:this.extractAttr(e,"allowBlank")?.asBool()})))}extractDataValidationFormula(e,t){return this.mapOnElements({parent:e,query:`formula${t}`},(e=>this.extractTextContent(e,{required:!0})))}}class aT extends sT{extractChart(){return this.mapOnElements({parent:this.rootFile.file.xml,query:"c:chartSpace"},(e=>{const t=this.getChartType(e);if(!SE[t])throw new Error(`Unsupported chart type ${t}`);if("combo"===SE[t])return this.extractComboChart(e);const o=this.mapOnElements({parent:e,query:"c:chart > c:title a:t"},(e=>e.textContent||"")).join(""),s=this.extractChildAttr(e,"c:grouping","val",{default:"clustered"}).asString();return{title:{text:o},type:SE[t],dataSets:this.extractChartDatasets(this.querySelectorAll(e,`c:${t}`),t),labelRange:this.extractLabelRange(t,e),backgroundColor:this.extractChildAttr(e,"c:chartSpace > c:spPr a:srgbClr","val",{default:"ffffff"}).asString(),legendPosition:bE[this.extractChildAttr(e,"c:legendPos","val",{default:"none"}).asString()],stacked:"stacked"===s,fontColor:"000000"}}))[0]}extractLabelRange(e,t){return"scatterChart"===e?this.extractChildTextContent(t,"c:ser c:strRef c:f")||this.extractChildTextContent(t,"c:ser c:numRef c:f"):this.extractChildTextContent(t,"c:ser c:cat c:f")}extractComboChart(e){const t=this.mapOnElements({parent:e,query:"c:title a:t"},(e=>e.textContent||"")).join(""),o=this.extractChildAttr(e,"c:grouping","val",{default:"clustered"}).asString();return{title:{text:t},type:"combo",dataSets:[...this.extractChartDatasets(this.querySelectorAll(e,"c:barChart"),"comboChart"),...this.extractChartDatasets(this.querySelectorAll(e,"c:lineChart"),"comboChart")],labelRange:this.extractChildTextContent(e,"c:ser c:cat c:f"),backgroundColor:this.extractChildAttr(e,"c:chartSpace > c:spPr a:srgbClr","val",{default:"ffffff"}).asString(),legendPosition:bE[this.extractChildAttr(e,"c:legendPos","val",{default:"none"}).asString()],stacked:"stacked"===o,fontColor:"000000"}}extractChartDatasets(e,t){return Array.from(e).map((e=>"scatterChart"===t?this.extractScatterChartDatasets(e):this.mapOnElements({parent:e,query:"c:ser"},(e=>{let t={};const o=this.extractChildTextContent(e,"c:tx c:f");if(o)t={reference:o};else{const o=this.extractChildTextContent(e,"c:tx c:v");o&&(t={text:o})}const s=this.extractChildAttr(e,"c:spPr a:solidFill a:srgbClr","val");return{label:t,range:this.extractChildTextContent(e,"c:val c:f",{required:!0}),backgroundColor:s?`${Wt(s.asString())}`:void 0}})))).flat()}extractScatterChartDatasets(e){return this.mapOnElements({parent:e,query:"c:ser"},(e=>{let t={};const o=this.extractChildTextContent(e,"c:tx c:f");if(o)t={reference:o};else{const o=this.extractChildTextContent(e,"c:tx c:v");o&&(t={text:o})}return{label:t,range:this.extractChildTextContent(e,"c:yVal c:f",{required:!0})}}))}getChartType(e){const t=this.querySelector(e,"c:plotArea");if(!t)throw new Error("Missing plot area in the chart definition.");let o;for(let e of t.children){const t=vx(e.tagName);lx.some((e=>e===t))&&(o?o!==t&&(o="comboChart"):o=t)}if(o)return o;throw new Error("Unknown chart type")}}const lT="oneCellAnchor",cT="twoCellAnchor";class hT extends sT{extractFigures(){return this.mapOnElements({parent:this.rootFile.file.xml,query:"xdr:wsDr",children:!0},(e=>{const t=vx(e.tagName),o=this.extractFigureAnchorsByType(e,t),s=this.querySelector(e,"c:chart"),i=this.querySelector(e,"a:blip");if(!s&&!i)throw new Error("Only chart and image figures are currently supported.");return{anchors:o,data:s?this.extractChart(s):this.extractImage(e),figureSize:t===lT?this.extractFigureSizeFromSizeTag(e,"xdr:ext"):void 0}}))}extractFigureAnchorsByType(e,t){switch(t){case lT:return[this.extractFigureAnchor("xdr:from",e)];case cT:return[this.extractFigureAnchor("xdr:from",e),this.extractFigureAnchor("xdr:to",e)];default:throw new Error(`${t} is not supported for xlsx drawings. `)}}extractFigureSizeFromSizeTag(e,t){const o=this.querySelector(e,t);if(!o)throw new Error(`Missing size element '${t}'`);return{cx:this.extractAttr(o,"cx",{required:!0}).asNum(),cy:this.extractAttr(o,"cy",{required:!0}).asNum()}}extractFigureAnchor(e,t){const o=this.querySelector(t,e);if(!o)throw new Error(`Missing anchor element ${e}`);return{col:Number(this.extractChildTextContent(o,"xdr:col",{required:!0})),colOffset:Number(this.extractChildTextContent(o,"xdr:colOff",{required:!0})),row:Number(this.extractChildTextContent(o,"xdr:row",{required:!0})),rowOffset:Number(this.extractChildTextContent(o,"xdr:rowOff",{required:!0}))}}extractChart(e){const t=this.extractAttr(e,"r:id",{required:!0}).asString(),o=this.getTargetXmlFile(this.relationships[t]),s=new aT(o,this.xlsxFileStructure,this.warningManager).extractChart();if(!s)throw new Error("Unable to extract chart definition");return s}extractImage(e){const t=this.querySelector(e,"a:blip"),o=this.extractAttr(t,"r:embed",{required:!0}).asString(),s=this.getTargetImageFile(this.relationships[o]);if(!s)throw new Error("Unable to extract image");const i=s.fileName.split(".").at(-1),n=vx(e.tagName),r=n===cT?this.querySelector(e,"a:xfrm"):e,a=n===cT?"a:ext":"xdr:ext",l=this.extractFigureSizeFromSizeTag(r,a);return{imageSrc:s.imageSrc,mimetype:i?EE[i]:void 0,size:l}}}class dT extends sT{getPivotTable(){return this.mapOnElements({query:":root",parent:this.rootFile.file.xml},(e=>({name:this.extractAttr(e,"name",{required:!0}).asString(),rowGrandTotals:this.extractAttr(e,"rowGrandTotals",{default:!0}).asBool(),location:this.extractPivotLocation(e),style:this.extractPivotStyleInfo(e)})))[0]}extractPivotLocation(e){return this.mapOnElements({query:"location",parent:e},(e=>({ref:this.extractAttr(e,"ref",{required:!0}).asString(),firstHeaderRow:this.extractAttr(e,"firstHeaderRow",{required:!0}).asNum(),firstDataRow:this.extractAttr(e,"firstDataRow",{required:!0}).asNum(),firstDataCol:this.extractAttr(e,"firstDataCol",{required:!0}).asNum()})))[0]}extractPivotStyleInfo(e){return this.mapOnElements({query:"pivotTableStyleInfo",parent:e},(e=>({name:this.extractAttr(e,"name",{required:!0}).asString(),showRowHeaders:this.extractAttr(e,"showRowHeaders",{required:!0}).asBool(),showColHeaders:this.extractAttr(e,"showColHeaders",{required:!0}).asBool(),showRowStripes:this.extractAttr(e,"showRowStripes",{required:!0}).asBool(),showColStripes:this.extractAttr(e,"showColStripes",{required:!0}).asBool(),showLastColumn:this.extractAttr(e,"showLastColumn")?.asBool()})))[0]}}class uT extends sT{getTable(){return this.mapOnElements({query:"table",parent:this.rootFile.file.xml},(e=>({displayName:this.extractAttr(e,"displayName",{required:!0}).asString(),name:this.extractAttr(e,"name")?.asString(),id:this.extractAttr(e,"id",{required:!0}).asString(),ref:this.extractAttr(e,"ref",{required:!0}).asString(),headerRowCount:this.extractAttr(e,"headerRowCount",{default:1}).asNum(),totalsRowCount:this.extractAttr(e,"totalsRowCount",{default:0}).asNum(),cols:this.extractTableCols(e),style:this.extractTableStyleInfo(e),autoFilter:this.extractTableAutoFilter(e)})))[0]}extractTableCols(e){return this.mapOnElements({query:"tableColumn",parent:e},(e=>({id:this.extractAttr(e,"id",{required:!0}).asString(),name:this.extractAttr(e,"name",{required:!0}).asString(),colFormula:this.extractChildTextContent(e,"calculatedColumnFormula")})))}extractTableStyleInfo(e){return this.mapOnElements({query:"tableStyleInfo",parent:e},(e=>({name:this.extractAttr(e,"name")?.asString(),showFirstColumn:this.extractAttr(e,"showFirstColumn")?.asBool(),showLastColumn:this.extractAttr(e,"showLastColumn")?.asBool(),showRowStripes:this.extractAttr(e,"showRowStripes")?.asBool(),showColumnStripes:this.extractAttr(e,"showColumnStripes")?.asBool()})))[0]}extractTableAutoFilter(e){return this.mapOnElements({query:"autoFilter",parent:e},(e=>({columns:this.extractFilterColumns(e),zone:this.extractAttr(e,"ref",{required:!0}).asString()})))[0]}extractFilterColumns(e){return this.mapOnElements({query:"tableColumn",parent:e},(t=>({colId:this.extractAttr(e,"colId",{required:!0}).asNum(),hiddenButton:this.extractAttr(e,"hiddenButton",{default:!1}).asBool(),filters:this.extractSimpleFilter(t)})))}extractSimpleFilter(e){return this.mapOnElements({query:"filter",parent:e},(e=>({val:this.extractAttr(e,"val",{required:!0}).asString()})))}}class gT extends sT{theme;constructor(e,t,o,s){super(e,t,o),this.theme=s}getSheet(){return this.mapOnElements({query:"worksheet",parent:this.rootFile.file.xml},(e=>{const t=this.getSheetWorkbookInfo();return{sheetName:this.extractSheetName(),sheetViews:this.extractSheetViews(e),sheetFormat:this.extractSheetFormat(e),sheetProperties:this.extractSheetProperties(e),cols:this.extractCols(e),rows:this.extractRows(e),sharedFormulas:this.extractSharedFormulas(e),merges:this.extractMerges(e),cfs:this.extractConditionalFormats(),dataValidations:this.extractDataValidations(),figures:this.extractFigures(e),hyperlinks:this.extractHyperLinks(e),tables:this.extractTables(e),pivotTables:this.extractPivotTables(),isVisible:"visible"===t.state}}))[0]}extractSheetViews(e){return this.mapOnElements({parent:e,query:"sheetView"},(e=>{const t=this.querySelector(e,"pane");return{tabSelected:this.extractAttr(e,"tabSelected",{default:!1}).asBool(),showFormulas:this.extractAttr(e,"showFormulas",{default:!1}).asBool(),showGridLines:this.extractAttr(e,"showGridLines",{default:!0}).asBool(),showRowColHeaders:this.extractAttr(e,"showRowColHeaders",{default:!0}).asBool(),pane:{xSplit:t?this.extractAttr(t,"xSplit",{default:0}).asNum():0,ySplit:t?this.extractAttr(t,"ySplit",{default:0}).asNum():0}}}))}extractSheetName(){const e=Kx(this.xlsxFileStructure.workbook.file.fileName,this.rootFile.file.fileName),t=this.extractRelationships(this.xlsxFileStructure.workbook.rels).find((t=>t.target===e)).id;for(let e of this.querySelectorAll(this.xlsxFileStructure.workbook.file.xml,"sheet"))if(e.attributes["r:id"].value===t)return e.attributes.name.value;throw new Error("Missing sheet name")}getSheetWorkbookInfo(){const e=Kx(this.xlsxFileStructure.workbook.file.fileName,this.rootFile.file.fileName),t=this.extractRelationships(this.xlsxFileStructure.workbook.rels).find((t=>t.target===e)).id,o=this.mapOnElements({parent:this.xlsxFileStructure.workbook.file.xml,query:"sheet"},(e=>({relationshipId:this.extractAttr(e,"r:id",{required:!0}).asString(),sheetId:this.extractAttr(e,"sheetId",{required:!0}).asString(),sheetName:this.extractAttr(e,"name",{required:!0}).asString(),state:this.extractAttr(e,"state",{default:"visible"}).asString()}))).find((e=>e.relationshipId===t));if(!o)throw new Error("Cannot find corresponding workbook sheet");return o}extractConditionalFormats(){return new nT(this.rootFile,this.xlsxFileStructure,this.warningManager,this.theme).extractConditionalFormattings()}extractDataValidations(){return new rT(this.rootFile,this.xlsxFileStructure,this.warningManager,this.theme).extractDataValidations()}extractFigures(e){return this.mapOnElements({parent:e,query:"drawing"},(e=>{const t=this.extractAttr(e,"r:id",{required:!0})?.asString(),o=this.getTargetXmlFile(this.relationships[t]);return new hT(o,this.xlsxFileStructure,this.warningManager).extractFigures()}))[0]||[]}extractTables(e){return this.mapOnElements({query:"tablePart",parent:e},(e=>{const t=this.extractAttr(e,"r:id",{required:!0})?.asString(),o=this.getTargetXmlFile(this.relationships[t]);return new uT(o,this.xlsxFileStructure,this.warningManager).getTable()}))}extractPivotTables(){try{return Object.values(this.relationships).filter((e=>e.type.endsWith("pivotTable"))).map((e=>{const t=this.getTargetXmlFile(e);return new dT(t,this.xlsxFileStructure,this.warningManager).getPivotTable()}))}catch(e){return this.catchErrorOnElement(e),[]}}extractMerges(e){return this.mapOnElements({parent:e,query:"mergeCell"},(e=>this.extractAttr(e,"ref",{required:!0}).asString()))}extractSheetFormat(e){const t=this.querySelector(e,"sheetFormatPr");if(t)return{defaultColWidth:this.extractAttr(t,"defaultColWidth",{default:Hx.toString()}).asNum(),defaultRowHeight:this.extractAttr(t,"defaultRowHeight",{default:Ux.toString()}).asNum()}}extractSheetProperties(e){const t=this.querySelector(e,"sheetPr");if(t)return{outlinePr:this.extractSheetOutlineProperties(t),tabColor:this.extractColor(this.querySelector(t,"tabColor"),this.theme)}}extractSheetOutlineProperties(e){const t=this.querySelector(e,"outlinePr");if(t)return{summaryBelow:this.extractAttr(t,"summaryBelow",{default:!0}).asBool(),summaryRight:this.extractAttr(t,"summaryRight",{default:!0}).asBool()}}extractCols(e){return this.mapOnElements({parent:e,query:"cols col"},(e=>({width:this.extractAttr(e,"width")?.asNum(),customWidth:this.extractAttr(e,"customWidth")?.asBool(),bestFit:this.extractAttr(e,"bestFit")?.asBool(),hidden:this.extractAttr(e,"hidden")?.asBool(),min:this.extractAttr(e,"min",{required:!0})?.asNum(),max:this.extractAttr(e,"max",{required:!0})?.asNum(),styleIndex:this.extractAttr(e,"style")?.asNum(),outlineLevel:this.extractAttr(e,"outlineLevel")?.asNum(),collapsed:this.extractAttr(e,"collapsed")?.asBool()})))}extractRows(e){const t=new Set;return this.mapOnElements({parent:e,query:"sheetData row"},(e=>({index:this.extractAttr(e,"r",{required:!0})?.asNum(),cells:this.extractCells(e,t),height:this.extractAttr(e,"ht")?.asNum(),customHeight:this.extractAttr(e,"customHeight")?.asBool(),hidden:this.extractAttr(e,"hidden")?.asBool(),styleIndex:this.extractAttr(e,"s")?.asNum(),outlineLevel:this.extractAttr(e,"outlineLevel")?.asNum(),collapsed:this.extractAttr(e,"collapsed")?.asBool()})))}extractCells(e,t){return this.mapOnElements({parent:e,query:"c"},(e=>{const o=this.extractAttr(e,"r",{required:!0})?.asString(),s=this.extractCellFormula(e);if(s?.ref&&void 0===s.sharedIndex){const e=Ho(s.ref);for(const{col:s,row:i}of os(e)){const e=Oo(s,i);e!==o&&t.add(e)}}const i=t.has(o);return{xc:o,styleIndex:this.extractAttr(e,"s")?.asNum(),type:hE[this.extractAttr(e,"t",{default:"n"})?.asString()],value:i?void 0:this.extractChildTextContent(e,"v")??void 0,formula:i?void 0:s}}))}extractCellFormula(e){const t=this.querySelector(e,"f");if(!t)return;const o=this.extractTextContent(t),s=this.extractAttr(t,"si")?.asNum(),i=this.extractAttr(t,"ref")?.asString();return void 0!==o&&""!==o.trim()||void 0!==s?{content:o,sharedIndex:s,ref:i}:void 0}extractHyperLinks(e){return this.mapOnElements({parent:e,query:"hyperlink"},(e=>{const t=this.extractAttr(e,"r:id")?.asString();return{xc:this.extractAttr(e,"ref",{required:!0})?.asString(),location:this.extractAttr(e,"location")?.asString(),display:this.extractAttr(e,"display")?.asString(),relTarget:t?this.relationships[t].target:void 0}}))}extractSharedFormulas(e){const t=this.querySelectorAll(e,"f[si][ref]"),o={};for(let e of t){const t=this.extractAttr(e,"si",{required:!0}).asNum(),s=this.extractTextContent(e,{required:!0});o[t]=s}const s=[];for(let e=0;e<Object.keys(o).length;e++)o[e]?s.push(o[e]):(this.warningManager.addParsingWarning(`Missing shared formula ${e}, replacing it by empty formula`),s.push(""));return s}}class pT extends sT{theme;constructor(e,t,o){super(e.styles,e,t),this.theme=o}getNumFormats(){return this.mapOnElements({parent:this.rootFile.file.xml,query:"numFmt"},(e=>this.extractNumFormats(e)))}extractNumFormats(e){return{id:this.extractAttr(e,"numFmtId",{required:!0}).asNum(),format:this.extractAttr(e,"formatCode",{required:!0,default:""}).asString()}}getFonts(){return this.mapOnElements({parent:this.rootFile.file.xml,query:"font"},(e=>this.extractFont(e)))}extractFont(e){const t=this.extractChildAttr(e,"name","val",{default:"Arial"}).asString(),o=this.extractChildAttr(e,"sz","val",{default:fe.toString()}).asNum(),s=this.extractColor(this.querySelector(e,"color"),this.theme),i=this.querySelector(e,"i")||void 0,n=i&&"0"!==i.attributes.val?.value,r=this.querySelector(e,"b")||void 0,a=r&&"0"!==r.attributes.val?.value,l=this.querySelector(e,"strike")||void 0,c=l&&"0"!==l.attributes.val?.value,h=this.querySelector(e,"u")||void 0;return{name:t,size:o,color:s,italic:n,bold:a,underline:h&&"none"!==h.attributes.val?.value,strike:c}}getFills(){return this.mapOnElements({parent:this.rootFile.file.xml,query:"fill"},(e=>this.extractFill(e)))}extractFill(e){const t=e.children[0];return"patternFill"===t.tagName?{patternType:t.attributes.patternType?.value,bgColor:this.extractColor(this.querySelector(t,"bgColor"),this.theme),fgColor:this.extractColor(this.querySelector(t,"fgColor"),this.theme)}:{patternType:"solid",fgColor:this.extractColor(this.querySelectorAll(t,"color")[1],this.theme)}}getBorders(){return this.mapOnElements({parent:this.rootFile.file.xml,query:"border"},(e=>this.extractBorder(e)))}extractBorder(e){const t={left:this.extractSingleBorder(e,"left",this.theme),right:this.extractSingleBorder(e,"right",this.theme),top:this.extractSingleBorder(e,"top",this.theme),bottom:this.extractSingleBorder(e,"bottom",this.theme),diagonal:this.extractSingleBorder(e,"diagonal",this.theme)};return t.diagonal&&(t.diagonalUp=this.extractAttr(e,"diagonalUp")?.asBool(),t.diagonalDown=this.extractAttr(e,"diagonalDown")?.asBool()),t}extractSingleBorder(e,t,o){const s=this.querySelector(e,t);if(s&&s.attributes.style)return{style:this.extractAttr(s,"style",{required:!0,default:"thin"}).asString(),color:this.extractColor(s.children[0],o,"000000")}}extractAlignment(e){return{horizontal:this.extractAttr(e,"horizontal",{default:"general"}).asString(),vertical:this.extractAttr(e,"vertical",{default:"bottom"}).asString(),textRotation:this.extractAttr(e,"textRotation")?.asNum(),wrapText:this.extractAttr(e,"wrapText")?.asBool(),indent:this.extractAttr(e,"indent")?.asNum(),relativeIndent:this.extractAttr(e,"relativeIndent")?.asNum(),justifyLastLine:this.extractAttr(e,"justifyLastLine")?.asBool(),shrinkToFit:this.extractAttr(e,"shrinkToFit")?.asBool(),readingOrder:this.extractAttr(e,"readingOrder")?.asNum()}}getDxfs(){return this.mapOnElements({query:"dxf",parent:this.rootFile.file.xml},(e=>{const t=this.querySelector(e,"font"),o=this.querySelector(e,"fill"),s=this.querySelector(e,"border"),i=this.querySelector(e,"numFmt"),n=this.querySelector(e,"alignment");return{font:t?this.extractFont(t):void 0,fill:o?this.extractFill(o):void 0,numFmt:i?this.extractNumFormats(i):void 0,alignment:n?this.extractAlignment(n):void 0,border:s?this.extractBorder(s):void 0}}))}getStyles(){return this.mapOnElements({query:"cellXfs xf",parent:this.rootFile.file.xml},(e=>{const t=this.querySelector(e,"alignment");return{fontId:this.extractAttr(e,"fontId",{required:!0,default:0}).asNum(),fillId:this.extractAttr(e,"fillId",{required:!0,default:0}).asNum(),borderId:this.extractAttr(e,"borderId",{required:!0,default:0}).asNum(),numFmtId:this.extractAttr(e,"numFmtId",{required:!0,default:0}).asNum(),alignment:t?this.extractAlignment(t):void 0}}))}}class mT extends sT{getExternalBook(){return this.mapOnElements({parent:this.rootFile.file.xml,query:"externalBook"},(e=>({rId:this.extractAttr(e,"r:id",{required:!0}).asString(),sheetNames:this.mapOnElements({parent:e,query:"sheetName"},(e=>this.extractAttr(e,"val",{required:!0}).asString())),datasets:this.extractExternalSheetData(e)})))[0]}extractExternalSheetData(e){return this.mapOnElements({parent:e,query:"sheetData"},(e=>{const t=this.mapOnElements({parent:e,query:"cell"},(e=>({xc:this.extractAttr(e,"r",{required:!0}).asString(),value:this.extractChildTextContent(e,"v",{required:!0})}))),o={};for(let e of t)o[e.xc]=e.value;return{sheetId:this.extractAttr(e,"sheetId",{required:!0}).asNum(),data:o}}))}}function fT(e,t){const o=function(e,t){const o=t[qx],s=o.querySelectorAll(`Override[ContentType="${e}"]`),i=[];for(let e of s){const t=e?.attributes.PartName.value;i.push(t.substring(1))}return i}(e,t);return function(e,t){const o=[];for(let s of e){const e=vT(s,t);o.push({file:{fileName:s,xml:t[s]},rels:e?{fileName:e,xml:t[e]}:void 0})}return o}(o,t)}function vT(e,t){if(e===qx)return"_rels/.rels";let o="";const s=e.split("/");for(let e=0;e<s.length-1;e++)o+=s[e]+"/";return o+="_rels/",o+=s[s.length-1]+".rels",t[o]||(o=void 0),o}class bT{warningManager;xmls;images;constructor(e){this.warningManager=new sE,this.xmls={},this.images=[];for(let t of Object.keys(e))if(t.endsWith(".xml")||t.endsWith(".rels")){const o=e[t].replaceAll(/(<\/?)([a-zA-Z0-9]+):([a-zA-Z0-9]+)/g,"$1NAMESPACE$2NAMESPACE$3");this.xmls[t]=ux(new ax(o))}else t.includes("media/image")&&this.images.push({fileName:t,imageSrc:e[t].imageSrc})}convertXlsx(){const e=this.getXlsxData();return this.convertImportedData(e)}getXlsxData(){const e=this.buildXlsxFileStructure(),t=e.theme?new iT(e.theme,e,this.warningManager).getTheme():void 0,o=e.sharedStrings?new iT(e.sharedStrings,e,this.warningManager).getSharedStrings():[],s=e.sheets.sort(((e,t)=>e.file.fileName.localeCompare(t.file.fileName,void 0,{numeric:!0}))).map((o=>new gT(o,e,this.warningManager,t).getSheet())),i=e.externalLinks.map((t=>new mT(t,e,this.warningManager).getExternalBook())),n=new pT(e,this.warningManager,t);return{fonts:n.getFonts(),fills:n.getFills(),borders:n.getBorders(),dxfs:n.getDxfs(),numFmts:n.getNumFormats(),styles:n.getStyles(),sheets:s,sharedStrings:o,externalBooks:i}}buildXlsxFileStructure(){const e={sheets:fT(Mx.sheet,this.xmls),workbook:fT(Mx.workbook,this.xmls)[0]||fT(Mx.macroEnabledWorkbook,this.xmls)[0]||fT(Mx.templateWorkbook,this.xmls)[0]||fT(Mx.macroEnabledTemplateWorkbook,this.xmls)[0]||fT(Mx.excelAddInWorkbook,this.xmls)[0],styles:fT(Mx.styles,this.xmls)[0],sharedStrings:fT(Mx.sharedStrings,this.xmls)[0],theme:fT(Mx.themes,this.xmls)[0],charts:fT(Mx.chart,this.xmls),figures:fT(Mx.drawing,this.xmls),tables:fT(Mx.table,this.xmls),pivots:fT(Mx.pivot,this.xmls),externalLinks:fT(Mx.externalLink,this.xmls),images:this.images};if(!e.workbook.rels)throw Error(ni("Cannot find workbook relations file"));return e}convertImportedData(e){const t={version:"18.3.1",sheets:wR(e,this.warningManager),styles:PE(e,this.warningManager),formats:kE(e,this.warningManager),borders:FE(e,this.warningManager),revisionId:ye};return XR(t,e),Object.keys(e.styles).map((t=>{e.styles[t]=St(e.styles[t])})),t}}function ST(e){const t=Rf(e);let o=[];return{text:"".concat(...t.map((e=>{if("REFERENCE"===e.type&&Br.test(e.value)){const t=e.value.trim();return o.includes(t)||o.push(t),`${Oe}${o.indexOf(t)}${Oe}`}return e.value}))),dependencies:o}}const yT={am_ET:7,ar_001:6,ar_SY:6,az_AZ:1,eu_ES:1,be_BY:1,bn_IN:1,bs_BA:1,bg_BG:1,ca_ES:1,zh_CN:7,zh_HK:7,zh_TW:7,hr_HR:1,cs_CZ:1,da_DK:1,nl_BE:1,nl_NL:1,en_AU:7,en_CA:7,en_GB:1,en_IN:7,en_NZ:7,et_EE:1,fi_FI:1,fr_BE:1,fr_CA:7,fr_CH:1,fr_FR:1,gl_ES:1,ka_GE:1,de_DE:1,de_CH:1,el_GR:1,gu_IN:7,he_IL:7,hi_IN:7,hu_HU:1,id_ID:7,it_IT:1,ja_JP:7,kab_DZ:6,km_KH:7,ko_KP:1,ko_KR:7,lo_LA:7,lv_LV:1,lt_LT:1,lb_LU:1,mk_MK:1,ml_IN:1,mn_MN:7,ms_MY:1,nb_NO:1,fa_IR:6,pl_PL:1,pt_AO:1,pt_BR:7,pt_PT:1,ro_RO:1,ru_RU:1,sr_RS:7,"sr@latin":7,sk_SK:1,sl_SI:1,es_AR:7,es_BO:1,es_CL:1,es_CO:7,es_CR:1,es_DO:1,es_EC:1,es_GT:7,es_MX:7,es_PA:7,es_PE:7,es_PY:7,es_UY:1,es_VE:7,sw:1,sv_SE:1,th_TH:7,tl_PH:1,tr_TR:1,uk_UA:1,vi_VN:1,sq_AL:1,te_IN:7,en_US:7,my_MM:7,es_ES:1,es_419:1},CT=new n;function wT(e){for(let t of e.sheets||[]){let e=[];for(let o of t.filterTables||[]){const t=Ho(o.range),s=e.findIndex((e=>Xo(e,t)));-1!==s?e[s]=t:e.push(t)}t.filterTables=e.map((e=>({range:zo(e)})))}return e}function IT(){return xT().at(-1)}function xT(){return CT.getKeys().sort(AT)}CT.add("0.1",{migrate:e=>(e.sheets&&e.sheets[0]&&(e.activeSheet=e.sheets[0].name),e)}).add("0.2",{migrate(e){if(e.sheets&&e.sheets.length)for(let t of e.sheets)t.id=t.id||t.name;return e}}).add("0.3",{migrate(e){if(e.sheets&&e.activeSheet){const t=e.sheets.find((t=>t.name===e.activeSheet));e.activeSheet=t.id}return e}}).add("0.4",{migrate(e){for(let t of e.sheets||[])t.figures=t.figures||[];return e}}).add("0.5",{migrate(e){for(let t of e.sheets||[])for(let e in t.cells||[]){const o=t.cells[e];o.content&&o.content.startsWith("=")&&(o.formula=ST(o.content))}return e}}).add("0.6",{migrate(e){for(let t of e.sheets||[])for(let e in t.figures||[]){const{dataSets:o,...s}=t.figures[e].data,i=[];for(let e of o)if(e.labelCell){const t=Ho(e.dataRange),o=e.labelCell+":"+Oo(t.right,t.bottom);i.push(o)}else i.push(e.dataRange);s.dataSetsHaveTitle=Boolean(o[0].labelCell),s.dataSets=i,t.figures[e].data=s}return e}}).add("0.7",{migrate(e){const t=[];for(let o of e.sheets||[]){if(!o.name)continue;const e=o.name,s=Lt(qe(e,"_"),t,{compute:(e,t)=>`${e}${t}`});o.name=s,t.push(s);const i=t=>{if(void 0===t)return t;let o=t.replace(e,s),i=t;for(;i!==o;)i=o,o=i.replace(e,s);return i};for(let e in o.cells){const t=o.cells[e];t.formula&&(t.formula.dependencies=t.formula.dependencies.map(i))}for(let e of o.figures||[])if("chart"===e.type){const t=e.data.dataSets.map(i),o=i(e.data.labelRange);e.data={...e.data,dataSets:t,labelRange:o}}for(let e of o.conditionalFormats||[]){e.ranges=e.ranges.map(i);for(const t of["minimum","maximum","midpoint","upperInflectionPoint","lowerInflectionPoint"])"formula"===e.rule[t]?.type&&(e.rule[t].value=i(e.rule[t].value))}}return e}}).add("0.8",{migrate(e){for(const t of e.sheets||[])for(const e of t.figures||[])e.data.background=m,e.data.verticalAxisPosition="left",e.data.legendPosition="top",e.data.stacked=!1;return e}}).add("0.9",{migrate(e){for(let t of e.sheets||[])for(let e in t.cells||[]){const o=t.cells[e];if(o.formula){let{text:e,dependencies:t}=o.formula;for(let[o,s]of Object.entries(t)){const t=`\\${Oe}${o}\\${Oe}`;e=e.replace(new RegExp(t,"g"),s)}o.content=e,delete o.formula}}return e}}).add("0.10",{migrate(e){const t={};for(let o of e.sheets||[])for(let e in o.cells||[]){const s=o.cells[e];s.format&&(s.format=ms(s.format,t))}return e.formats=t,e}}).add("15.4",{migrate(e){for(let t of e.sheets||[])t.isVisible=!0;return e}}).add("15.4.1",{migrate:e=>wT(e)}).add("16.3",{migrate(e){for(const t in e.borders){const o=e.borders[t];for(const e in o)Array.isArray(o[e])&&(o[e]={style:o[e][0],color:o[e][1]})}return e}}).add("16.4",{migrate:e=>(e.settings||(e.settings={}),e.settings.locale||(e.settings.locale=Ci),e)}).add("16.4.1",{migrate:e=>wT(e)}).add("17.2",{migrate(e){for(const t of e.sheets||[])t.tables=t.tables||t.filterTables||[],delete t.filterTables;return e}}).add("17.3",{migrate:e=>(e.pivots||(e.pivots={}),e.pivotNextId||(e.pivotNextId=Hc(e.pivots)+1),e)}).add("17.4",{migrate(e){for(const t of e.sheets||[])for(const e in t.figures||[]){const o=t.figures[e];"title"in o.data&&"string"==typeof o.data.title&&(o.data.title={text:o.data.title});const s=o.data.type;if(!["line","bar","pie","scatter","waterfall","combo"].includes(s))continue;const{dataSets:i,...n}=t.figures[e].data,r=i.map((e=>({dataRange:e})));n.dataSets=r,t.figures[e].data=n}return e}}).add("18.0",{migrate:e=>e}).add("18.0.1",{migrate(e){for(const t of Object.values(e.pivots||{}))t.measures=t.measures.map((e=>({id:e.name,fieldName:e.name,aggregator:e.aggregator}))),t.columns=t.columns.map((e=>({fieldName:e.name,order:e.order,granularity:e.granularity}))),t.rows=t.rows.map((e=>({fieldName:e.name,order:e.order,granularity:e.granularity})));return e}}).add("18.0.2",{migrate(e){const t=e.settings?.locale;if(t){const e=t.code;t.weekStart=yT[e]||1}return e}}).add("18.0.3",{migrate(e){for(const t of e.sheets||[]){t.styles={},t.formats={},t.borders={};for(const e in t.cells)t.styles[e]=t.cells[e].style,t.formats[e]=t.cells[e].format,t.borders[e]=t.cells[e].border,delete t.cells[e].style,delete t.cells[e].format,delete t.cells[e].border}return e}}).add("18.0.4",{migrate(e){for(const t of e.sheets||[])for(const e of t.figures||[]){if("chart"!==e.tag||"gauge"!==e.data.type)continue;const t=e.data;t?.sectionRule?.lowerInflectionPoint&&(t.sectionRule.lowerInflectionPoint.operator="<="),t?.sectionRule?.upperInflectionPoint&&(t.sectionRule.upperInflectionPoint.operator="<=")}return e}}).add("18.1",{migrate(e){for(const t of e.sheets||[])for(const e of t.tables||[])e.config||(e.config={...OR,hasFilters:!0});return e}}).add("18.1.1",{migrate(e){for(const t of e.sheets||[])for(const e in t.cells){const o=t.cells[e];o&&(t.cells[e]=o.content)}return e}}).add("18.2",{migrate:e=>e}).add("18.3",{migrate(e){if(!e.pivots)return e;for(const t of Object.values(e.pivots)){if(!t.sortedColumn)continue;t.measures.map((e=>e.id)).includes(t.sortedColumn.measure)||delete t.sortedColumn}return e}}).add("18.3.1",{migrate(e){for(const t of e.sheets||[])for(const e of t.figures||[]){const t=e;e.offset={x:t.x||0,y:t.y||0},e.col=0,e.row=0,delete e.x,delete e.y}return e}});const ET="Sheet1";function RT(e,t){if(!e)return FT();console.debug("### Loading data ###");const o=performance.now();if(e["[Content_Types].xml"]){const o=new bT(e);if(e=o.convertXlsx(),t)for(let e of o.warningManager.warnings.sort())console.warn(e)}return"version"in e&&(function(e){return"number"==typeof e.version}(e)&&(e.version=TT[e.version]),e.version!==IT()&&(console.debug("Migrating data from version",e.version),e=function(e){const t=performance.now(),o=xT();for(let t=o.findIndex((t=>t===e.version))+1;t<o.length;t++){const s=o[t];e=CT.get(s).migrate(e)}return console.debug("Data migrated in",performance.now()-t,"ms"),e}(e))),e=function(e){return e=function(e){if(e.uniqueFigureIds)return e;const t=new Set,o=new Ga;for(const s of e.sheets||[])for(const e of s.figures||[])t.has(e.id)&&(e.id+=o.smallUuid()),t.add(e.id);return e.uniqueFigureIds=!0,e}(e),e=function(e){const t=Object.assign(FT(),e,{version:IT()});t.sheets=t.sheets?t.sheets.map(((e,t)=>Object.assign(OT(`Sheet${t+1}`,`Sheet${t+1}`),e))):[],0===t.sheets.length&&t.sheets.push(OT(ET,"Sheet1"));bl(t.settings.locale)||(t.settings.locale=Ci);return t}(e),e}(e),console.debug("Data loaded in",performance.now()-o,"ms"),console.debug("###"),e}const TT={25:"18.2",24:"18.1.1",23:"18.1",22:"18.0.4",21:"18.0.3",20:"18.0.2",19:"18.0.1",18:"18.0",17:"17.4",16:"17.3",15:"17.2",14:"16.4",13:"16.3",12:"15.4",11:"0.10",10:"0.9",9:"0.8",8:"0.7",7:"0.6",6:"0.5",5:"0.4",4:"0.3",3:"0.2",2:"0.1",1:"0"};function AT(e,t){const o=e.split(".").map(Number),s=t.split(".").map(Number);for(let e=0;e<Math.max(o.length,s.length);e++){const t=o[e]||0,i=s[e]||0;if(t>i)return 1;if(t<i)return-1}return 0}function DT(e,t){return t=function(e,t){if(0!==Object.keys(e).length)return t;const o=[],s=[],i=e=>{if("CREATE_SHEET"===e.type)o.push(e.sheetId);else if("sheetId"in e&&!o.includes(e.sheetId))return{...e,sheetId:ET};return e};for(const e of t)"REMOTE_REVISION"===e.type?s.push({...e,commands:e.commands.map(i)}):s.push(e);return s}(e,t),t=_T(t,"SORT_CELLS"),t=function(e,t){const o=[],s={};for(const t of e.sheets||[])t.figures?.forEach((e=>{"chart"===e.tag&&(s[e.id]=e.data)}));for(const e of t)if("REMOTE_REVISION"===e.type){const t=[];for(const o of e.commands){let e=o;switch(o.type){case"CREATE_CHART":s[o.figureId]=o.definition;break;case"UPDATE_CHART":if(!s[o.figureId]){console.log(`Fix chart definition: chart with id ${o.figureId} not found.`);continue}const t={...s[o.figureId],...o.definition};e={...o,definition:t},s[o.figureId]=t}t.push(e)}o.push({...e,commands:t})}else o.push(e);return o}(e,t=_T(t,"SET_DECIMAL")),t=function(e,t){const o={};for(const t of e.sheets||[])t.figures?.forEach((e=>{o[e.id]=e.offset}));for(const e of t)if("REMOTE_REVISION"===e.type)for(const t of e.commands)switch(t.type){case"UPDATE_FIGURE":t.offset&&(void 0===t.offset.x&&(t.offset.x=o[t.figureId]||0),void 0===t.offset.y&&(t.offset.y=o[t.figureId]||0),o[t.figureId]=o);break;case"CREATE_IMAGE":case"CREATE_CHART":case"CREATE_FIGURE":o[t.figureId]=t.offset}return t}(e,t),t=function(e,t){const o={};for(const t of e.sheets||[])o[t.id]=t.name;const s=[];for(const e of t)if("REMOTE_REVISION"===e.type){const t=[];for(const s of e.commands){switch(s.type){case"DUPLICATE_SHEET":s.sheetNameTo=s.sheetNameTo??ia(o[s.sheetId],Object.values(o));break;case"CREATE_SHEET":o[s.sheetId]=s.name||sa(Object.values(o));break;case"RENAME_SHEET":o[s.sheetId]=s.newName||sa(Object.values(o))}t.push(s)}s.push({...e,commands:t})}else s.push(e);return t}(e,t),t}function _T(e,t){const o=[];for(const s of e)"REMOTE_REVISION"===s.type?o.push({...s,commands:s.commands.filter((e=>e.type!==t))}):o.push(s);return o}function OT(e,t){return{id:e,name:t,colNumber:26,rowNumber:100,cells:{},styles:{},formats:{},borders:{},cols:{},rows:{},merges:[],conditionalFormats:[],dataValidationRules:[],figures:[],tables:[],isVisible:!0}}function FT(e="Sheet1"){return{version:IT(),sheets:[OT(ET,e)],styles:{},formats:{},borders:{},revisionId:ye,uniqueFigureIds:!0,settings:{locale:Ci},pivots:{},pivotNextId:1,customTableStyles:{}}}function MT(e,t){return{...OT(e,t),charts:[],images:[],cellValues:{}}}const PT={wrongPasteSelection:ni("This operation is not allowed with multiple selections."),willRemoveExistingMerge:kC.Errors.WillRemoveExistingMerge,wrongFigurePasteOption:ni("Cannot do a special paste of a figure."),frozenPaneOverlap:ni("This operation is not allowed due to an overlapping frozen pane.")};function NT(e,t){t.isSuccessful||(t.reasons.includes("WrongPasteSelection")?e.raiseError(PT.wrongPasteSelection):t.reasons.includes("WillRemoveExistingMerge")?e.raiseError(PT.willRemoveExistingMerge):t.reasons.includes("WrongFigurePasteOption")?e.raiseError(PT.wrongFigurePasteOption):t.reasons.includes("FrozenPaneOverlap")&&e.raiseError(PT.frozenPaneOverlap))}function kT(e,t,o){const s=e.model.dispatch("PASTE",{target:t,pasteOption:o});NT(e,s)}async function VT(e,t,o,s){let i;try{const n=o;if(o.imageBlob){try{const t=await(e.imageProvider?.uploadFile(o.imageBlob));n.imageData=t}catch(t){const o=ni("An error occurred while uploading the image. %s",t.message);console.error(t),e.raiseError(o)}delete o.imageBlob}i=e.model.dispatch("PASTE_FROM_OS_CLIPBOARD",{target:t,clipboardContent:o,pasteOption:s})}catch(n){const r=o.data;r?.version!==IT()?e.raiseError(ni("An unexpected error occurred while pasting content. This is probably due to a spreadsheet version mismatch.")):(e.raiseError(ni("An unexpected error occurred while pasting content. Additional information can be found in the browser console.")),console.error(n)),i=e.model.dispatch("PASTE_FROM_OS_CLIPBOARD",{target:t,clipboardContent:{text:o.text},pasteOption:s})}NT(e,i)}class LT extends yh{mutators=["clear","hover"];col;row;handle(e){if("ACTIVATE_SHEET"===e.type)this.clear()}hover(e){if(e.col===this.col&&e.row===this.row)return"noStateChange";this.col=e.col,this.row=e.row}clear(){if(void 0===this.col&&void 0===this.row)return"noStateChange";this.col=void 0,this.row=void 0}}class HT extends yh{mutators=["open","close"];persistentPopover;hoveredCell=this.get(LT);handle(e){if("ACTIVATE_SHEET"===e.type)this.close()}open({col:e,row:t},o){const s=this.getters.getActiveSheetId();lC.contains(o)&&(this.persistentPopover={col:e,row:t,sheetId:s,type:o})}close(){if(!this.persistentPopover)return"noStateChange";this.persistentPopover=void 0}get persistentCellPopover(){return this.persistentPopover&&{isOpen:!0,...this.persistentPopover}||{isOpen:!1}}get isOpen(){return void 0!==this.persistentPopover}get cellPopover(){const e=this.getters.getActiveSheetId();if(this.persistentPopover&&this.getters.isVisibleInViewport(this.persistentPopover)){const e=this.getters.getMainCellPosition(this.persistentPopover),t=lC.get(this.persistentPopover.type).onOpen?.(e,this.getters);return t?.isOpen?{...t,anchorRect:this.computePopoverAnchorRect(this.persistentPopover)}:{isOpen:!1}}const{col:t,row:o}=this.hoveredCell;if(void 0===t||void 0===o||!this.getters.isVisibleInViewport({sheetId:e,col:t,row:o}))return{isOpen:!1};const s=this.getters.getMainCellPosition({sheetId:e,col:t,row:o}),i=lC.getAll().map((e=>e.onHover?.(s,this.getters))).find((e=>e?.isOpen));return i?.isOpen?{...i,anchorRect:this.computePopoverAnchorRect(s)}:{isOpen:!1}}computePopoverAnchorRect({col:e,row:t}){const o=this.getters.getActiveSheetId(),s=this.getters.getMerge({sheetId:o,col:e,row:t});return s?this.getters.getVisibleRect(s):this.getters.getVisibleRect(rs({col:e,row:t}))}}function UT(e){return{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height}}function BT(e){if(e)return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function zT(){const e=t.useState({x:0,y:0,width:0,height:0});let o=null;function s(){if(o||(o=document.querySelector(".o-spreadsheet")),o){const{top:t,left:s,width:i,height:n}=o.getBoundingClientRect();e.x=s,e.y=t,e.width=i,e.height=n}}return t.onMounted(s),t.onPatched(s),e}function $T(e){const o=t.useState({x:0,y:0,width:0,height:0});function s(){const t=e.el;if(null===t)return;const{top:s,left:i,width:n,height:r}=t.getBoundingClientRect();o.x=i,o.y=s,o.width=n,o.height=r}return t.onMounted(s),t.onPatched(s),o}Eh`
|
|
39
|
+
`;const jx="M256 9 a247 247 0 1 0.1 0 0",Yx={arrowGood:{template:"ARROW_UP",svg:{width:448,height:512,fillColor:"#6AA84F",path:"M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z"}},arrowNeutral:{template:"ARROW_RIGHT",svg:{width:448,height:512,fillColor:"#F0AD4E",path:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"}},arrowBad:{template:"ARROW_DOWN",svg:{width:448,height:512,fillColor:"#E06666",path:"M413.1 222.5l22.2 22.2c9.4 9.4 9.4 24.6 0 33.9L241 473c-9.4 9.4-24.6 9.4-33.9 0L12.7 278.6c-9.4-9.4-9.4-24.6 0-33.9l22.2-22.2c9.5-9.5 25-9.3 34.3.4L184 343.4V56c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24v287.4l114.8-120.5c9.3-9.8 24.8-10 34.3-.4z"}},smileyGood:{template:"SMILE",svg:{width:496,height:512,fillColor:"#6AA84F",path:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 448c-110.3 0-200-89.7-200-200S137.7 56 248 56s200 89.7 200 200-89.7 200-200 200zm-80-216c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm4 72.6c-20.8 25-51.5 39.4-84 39.4s-63.2-14.3-84-39.4c-8.5-10.2-23.7-11.5-33.8-3.1-10.2 8.5-11.5 23.6-3.1 33.8 30 36 74.1 56.6 120.9 56.6s90.9-20.6 120.9-56.6c8.5-10.2 7.1-25.3-3.1-33.8-10.1-8.4-25.3-7.1-33.8 3.1z"}},smileyNeutral:{template:"MEH",svg:{width:496,height:512,fillColor:"#F0AD4E",path:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 448c-110.3 0-200-89.7-200-200S137.7 56 248 56s200 89.7 200 200-89.7 200-200 200zm-80-216c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm160-64c-17.7 0-32 14.3-32 32s14.3 32 32 32 32-14.3 32-32-14.3-32-32-32zm8 144H160c-13.2 0-24 10.8-24 24s10.8 24 24 24h176c13.2 0 24-10.8 24-24s-10.8-24-24-24z"}},smileyBad:{template:"FROWN",svg:{width:496,height:512,fillColor:"#E06666",path:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 448c-110.3 0-200-89.7-200-200S137.7 56 248 56s200 89.7 200 200-89.7 200-200 200zm-80-216c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm160-64c-17.7 0-32 14.3-32 32s14.3 32 32 32 32-14.3 32-32-14.3-32-32-32zm-80 128c-40.2 0-78 17.7-103.8 48.6-8.5 10.2-7.1 25.3 3.1 33.8 10.2 8.4 25.3 7.1 33.8-3.1 16.6-19.9 41-31.4 66.9-31.4s50.3 11.4 66.9 31.4c8.1 9.7 23.1 11.9 33.8 3.1 10.2-8.5 11.5-23.6 3.1-33.8C326 321.7 288.2 304 248 304z"}},dotGood:{template:"GREEN_DOT",svg:{width:512,height:512,fillColor:"#6AA84F",path:jx}},dotNeutral:{template:"YELLOW_DOT",svg:{width:512,height:512,fillColor:"#F0AD4E",path:jx}},dotBad:{template:"RED_DOT",svg:{width:512,height:512,fillColor:"#E06666",path:jx}}},Xx={arrows:{good:"arrowGood",neutral:"arrowNeutral",bad:"arrowBad"},smiley:{good:"smileyGood",neutral:"smileyNeutral",bad:"smileyBad"},dots:{good:"dotGood",neutral:"dotNeutral",bad:"dotBad"}};function Kx(e,t){const o=e.split("/"),s=t.split("/");let i="",n=0;for(let e=0;e<o.length-1;e++)o[e]===s[e]?n++:i+="../";return i+=s.slice(n).join("/"),i}function Jx(e,t=0){const o={};for(let s=0;s<e.length;s++)e[s]&&(o[s+t]=e[s]);return o}function Qx(e){return e.replace(/_x([0-9a-zA-Z]{4})_/g,((e,t)=>String.fromCharCode(parseInt(t,16))))}function eE(e,t,o){return"COL"===t?(e.cols[o]||(e.cols[o]={}),e.cols[o]):(e.rows[o]||(e.rows[o]={}),e.rows[o])}function tE(e){if("="===e[0])return e;const t=ol(e);return 1===t.length&&"REFERENCE"!==t[0].type?e:"="+e}var oE;Zx.add("conditional_formatting",((e,t)=>{const o=e.getConditionalIcon(t);if(o)return Yx[o].svg})),function(e){e.DiagonalBorderNotSupported="Diagonal Borders",e.BorderStyleNotSupported="Border style",e.FillStyleNotSupported="Fill Style",e.FontNotSupported="Font",e.HorizontalAlignmentNotSupported="Horizontal Alignment",e.VerticalAlignmentNotSupported="Vertical Alignments",e.MultipleRulesCfNotSupported="Multiple rules conditional formats",e.CfTypeNotSupported="Conditional format type",e.CfFormatBorderNotSupported="Borders in conditional formats",e.CfFormatAlignmentNotSupported="Alignment in conditional formats",e.CfFormatNumFmtNotSupported="Num formats in conditional formats",e.CfIconSetEmptyIconNotSupported="IconSets with empty icons",e.BadlyFormattedHyperlink="Badly formatted hyperlink",e.NumFmtIdNotSupported="Number format",e.TimeDataValidationNotSupported="Time data validation rules",e.TextLengthDataValidationNotSupported="Text length data validation rules",e.WholeNumberDataValidationNotSupported="Whole number data validation rules",e.NotEqualDateDataValidationNotSupported="Not equal date data validation rules"}(oE||(oE={}));class sE{_parsingWarnings=new Set;_conversionWarnings=new Set;addParsingWarning(e){this._parsingWarnings.add(e)}addConversionWarning(e){this._conversionWarnings.add(e)}get warnings(){return[...this._parsingWarnings,...this._conversionWarnings]}generateNotSupportedWarning(e,t,o){let s=`${e} ${t?'"'+t+'" is':"are"} not yet supported. `;o&&(s+=`Only ${o.join(", ")} are currently supported.`),this._conversionWarnings.has(s)||this._conversionWarnings.add(s)}}const iE=["thin","medium","thick","dashed","dotted"],nE=["general","left","center","right"],rE=["top","center","bottom"],aE=["Arial"],lE=["solid","none"],cE=["expression","cellIs","colorScale","iconSet","containsText","notContainsText","beginsWith","endsWith","containsBlanks","notContainsBlanks"],hE={b:"boolean",d:"date",e:"error",inlineStr:"inlineStr",n:"number",s:"sharedString",str:"str"},dE={dashDot:"thin",dashDotDot:"thin",dashed:"dashed",dotted:"dotted",double:"thin",hair:"thin",medium:"medium",mediumDashDot:"thin",mediumDashDotDot:"thin",mediumDashed:"thin",none:void 0,slantDashDot:"thin",thick:"thick",thin:"thin"},uE={general:void 0,left:"left",center:"center",right:"right",fill:"left",justify:"left",centerContinuous:"center",distributed:"center"},gE={top:"top",center:"middle",bottom:"bottom",justify:"middle",distributed:"middle"},pE={top:"top",middle:"center",bottom:"bottom"};const mE={aboveAverage:void 0,expression:void 0,cellIs:void 0,colorScale:void 0,dataBar:void 0,iconSet:void 0,top10:void 0,uniqueValues:void 0,duplicateValues:void 0,containsText:"ContainsText",notContainsText:"NotContains",beginsWith:"BeginsWith",endsWith:"EndsWith",containsBlanks:"IsEmpty",notContainsBlanks:"IsNotEmpty",containsErrors:void 0,notContainsErrors:void 0,timePeriod:void 0},fE={num:"number",percent:"percentage",max:"value",min:"value",percentile:"percentile",formula:"formula"},vE={NoIcons:void 0,"3Arrows":"arrows","3ArrowsGray":"arrows","3Symbols":"smiley","3Symbols2":"smiley","3Signs":"dots","3Flags":"dots","3TrafficLights1":"dots","3TrafficLights2":"dots","4Arrows":"arrows","4ArrowsGray":"arrows","4RedToBlack":"dots","4Rating":"smiley","4TrafficLights":"dots","5Arrows":"arrows","5ArrowsGray":"arrows","5Rating":"smiley","5Quarters":"dots","3Stars":"smiley","3Triangles":"arrows","5Boxes":"dots"},bE={none:"none",b:"bottom",t:"top",l:"left",r:"right",tr:"right"},SE={areaChart:void 0,area3DChart:void 0,lineChart:"line",line3DChart:void 0,stockChart:void 0,radarChart:"radar",scatterChart:"scatter",pieChart:"pie",pie3DChart:void 0,doughnutChart:"pie",barChart:"bar",bar3DChart:void 0,ofPieChart:void 0,surfaceChart:void 0,surface3DChart:void 0,bubbleChart:void 0,comboChart:"combo"},yE={1:"AVERAGE",2:"COUNT",3:"COUNTA",4:"MAX",5:"MIN",6:"PRODUCT",7:"STDEV",8:"STDEVP",9:"SUM",10:"VAR",11:"VARP",101:"AVERAGE",102:"COUNT",103:"COUNTA",104:"MAX",105:"MIN",106:"PRODUCT",107:"STDEV",108:"STDEVP",109:"SUM",110:"VAR",111:"VARP"},CE={0:"General",1:"0",2:"0.00",3:"#,#00",4:"#,##0.00",9:"0%",10:"0.00%",11:void 0,12:void 0,13:void 0,14:"m/d/yyyy",15:"m/d/yyyy",16:"m/d/yyyy",17:"m/d/yyyy",18:"hh:mm:ss a",19:"hh:mm:ss a",20:"hhhh:mm:ss",21:"hhhh:mm:ss",22:"m/d/yy h:mm",37:void 0,38:void 0,39:void 0,40:void 0,45:"hhhh:mm:ss",46:"hhhh:mm:ss",47:"hhhh:mm:ss",48:void 0,49:"@"},wE={0:1,"0.00":2,"#,#00":3,"#,##0.00":4,"0%":9,"0.00%":10,"0.00E+00":11,"# ?/?":12,"# ??/??":13,"mm-dd-yy":14,"d-mm-yy":15,"mm-yy":16,"mmm-yy":17,"h:mm AM/PM":18,"h:mm:ss AM/PM":19,"h:mm":20,"h:mm:ss":21,"m/d/yy h:mm":22,"#,##0 ;(#,##0)":37,"#,##0 ;[Red](#,##0)":38,"#,##0.00;(#,##0.00)":39,"#,##0.00;[Red](#,##0.00)":40,"mm:ss":45,"[h]:mm:ss":46,"mmss.0":47,"##0.0E+0":48,"@":49,"hh:mm:ss a":19},IE={0:"000000",1:"FFFFFF",2:"FF0000",3:"00FF00",4:"0000FF",5:"FFFF00",6:"FF00FF",7:"00FFFF",8:"000000",9:"FFFFFF",10:"FF0000",11:"00FF00",12:"0000FF",13:"FFFF00",14:"FF00FF",15:"00FFFF",16:"800000",17:"008000",18:"000080",19:"808000",20:"800080",21:"008080",22:"C0C0C0",23:"808080",24:"9999FF",25:"993366",26:"FFFFCC",27:"CCFFFF",28:"660066",29:"FF8080",30:"0066CC",31:"CCCCFF",32:"000080",33:"FF00FF",34:"FFFF00",35:"00FFFF",36:"800080",37:"800000",38:"008080",39:"0000FF",40:"00CCFF",41:"CCFFFF",42:"CCFFCC",43:"FFFF99",44:"99CCFF",45:"FF99CC",46:"CC99FF",47:"FFCC99",48:"3366FF",49:"33CCCC",50:"99CC00",51:"FFCC00",52:"FF9900",53:"FF6600",54:"666699",55:"969696",56:"003366",57:"339966",58:"003300",59:"333300",60:"993300",61:"993366",62:"333399",63:"333333",64:"000000",65:"FFFFFF"},xE={"image/avif":"avif","image/bmp":"bmp","image/gif":"gif","image/vnd.microsoft.icon":"ico","image/jpeg":"jpeg","image/png":"png","image/tiff":"tiff","image/webp":"webp"},EE={avif:"image/avif",bmp:"image/bmp",gif:"image/gif",ico:"image/vnd.microsoft.icon",jpeg:"image/jpeg",png:"image/png",tiff:"image/tiff",webp:"image/webp",jpg:"image/jpeg"},RE={between:"isBetween",notBetween:"isNotBetween",equal:"isEqual",notEqual:"isNotEqual",greaterThan:"isGreaterThan",greaterThanOrEqual:"isGreaterOrEqualTo",lessThan:"isLessThan",lessThanOrEqual:"isLessOrEqualTo"},TE={between:"dateIsBetween",notBetween:"dateIsNotBetween",equal:"dateIs",greaterThan:"dateIsAfter",greaterThanOrEqual:"dateIsOnOrAfter",lessThan:"dateIsBefore",lessThanOrEqual:"dateIsOnOrBefore"};function AE(e){if(!e)return;let t;if(e.rgb)t=e.rgb;else if(e.auto)t=Ax;else{if(!e.indexed)return;t=IE[e.indexed]}var o;return t=6===(o=t).length?"#"+o+"FF":"#"+o.slice(2)+o.slice(0,2),e.tint&&(t=function(e,t){const o=Kt(e),s=Qt(o);t<0&&(s.l=s.l*(1+t));t>0&&(s.l=s.l*(1-t)+(100-100*(1-t)));return Xt(Jt(s))}(t,e.tint)),t=t.toUpperCase(),9===t.length&&t.endsWith("FF")&&(t=t.slice(0,7)),t}function DE(e){return 9===e.length&&(e=e.slice(0,7)),parseInt(e.replace("#",""),16)}const _E=/^(yy|yyyy|m{1,5}|d{1,4}|h{1,2}|s{1,2}|am\/pm|a\/m|\s|-|\/|\.|:)+$/i;function OE(e,t,o){let s=CE[e]||t.find((t=>t.id===e))?.format;if("General"!==s){if(s)try{let e=s.replace(/\[(.*)-[A-Z0-9]{3}\]/g,"[$1]");if(e=e.replace(/\[\$\]/g,""),e=e.replace(/_.{1}/g,""),e=e.replace(/\*.{1}/g,""),function(e){return _E.test(e)}(e)&&(e=function(e){return e=e.toLowerCase(),e=e.replace(/mmmmm/g,"mmm"),e=e.replace(/am\/pm|a\/m/g,"a"),e=e.replace(/hhhh/g,"hh"),e=e.replace(/\bh\b/g,"hh"),e}(e)),function(e){try{return sr(0,{format:e,locale:Ci}),!0}catch(e){return!1}}(e))return e}catch(e){}o.generateNotSupportedWarning(oE.NumFmtIdNotSupported,s||`nmFmtId ${e}`)}}function FE(e,t){const o=e.borders.map((e=>{!function(e,t){e.diagonal&&t.generateNotSupportedWarning(oE.DiagonalBorderNotSupported)}(e,t);const o={top:ME(e.top,t),bottom:ME(e.bottom,t),left:ME(e.left,t),right:ME(e.right,t)};return Object.keys(o).forEach((e=>void 0===o[e]&&delete o[e])),o}));return Jx(o,1)}function ME(e,t){if(!e)return;!function(e,t){iE.includes(e.style)||t.generateNotSupportedWarning(oE.BorderStyleNotSupported,e.style,iE)}(e,t);const o=dE[e.style];return o?{style:o,color:AE(e.color)}:void 0}function PE(e,t){return Jx(e.styles.map((o=>NE({fontStyle:e.fonts[o.fontId],fillStyle:e.fills[o.fillId],alignment:o.alignment},t))),1)}function NE(e,t){return function(e,t,o){e&&e.name&&!aE.includes(e.name)&&o.generateNotSupportedWarning(oE.FontNotSupported,e.name,aE);t&&t.patternType&&!lE.includes(t.patternType)&&o.generateNotSupportedWarning(oE.FillStyleNotSupported,t.patternType,lE)}(e?.fontStyle,e?.fillStyle,t),function(e,t){e&&!nE.includes(e)&&t.generateNotSupportedWarning(oE.HorizontalAlignmentNotSupported,e,nE)}(e?.alignment?.horizontal,t),function(e,t){e&&!rE.includes(e)&&t.generateNotSupportedWarning(oE.VerticalAlignmentNotSupported,e,rE)}(e?.alignment?.vertical,t),{bold:e.fontStyle?.bold,italic:e.fontStyle?.italic,strikethrough:e.fontStyle?.strike,underline:e.fontStyle?.underline,verticalAlign:e.alignment?.vertical?gE[e.alignment.vertical]:void 0,align:e.alignment?.horizontal?uE[e.alignment.horizontal]:void 0,fillColor:"solid"===e.fillStyle?.patternType?AE(e.fillStyle?.fgColor):AE(e.fillStyle?.bgColor),textColor:AE(e.fontStyle?.color),fontSize:e.fontStyle?.size,wrapping:e.alignment?.wrapText?"wrap":"overflow"}}function kE(e,t){const o=[];for(let s of e.styles){const i=OE(s.numFmtId,e.numFmts,t);i&&(o[s.numFmtId]=i)}return Jx(o,1)}function VE(e,t,o){const s=[];let i=1;for(let r of e){if(0===r.cfRules.length)continue;zE(r,t,o);const e=r.cfRules[0];let a;const l=[];if(void 0!==e.dxfId||"colorScale"===e.type||"iconSet"===e.type||"dataBar"===e.type){switch(e.type){case"aboveAverage":case"containsErrors":case"notContainsErrors":case"duplicateValues":case"expression":case"top10":case"uniqueValues":case"timePeriod":continue;case"dataBar":const t=LE(i++,r);t&&s.push(t);continue;case"colorScale":const c=HE(i++,r);c&&s.push(c);continue;case"iconSet":const h=UE(i++,r,o);h&&s.push(h);continue;case"containsText":case"notContainsText":case"beginsWith":case"endsWith":if(!e.text)continue;a=mE[e.type],l.push(e.text);break;case"containsBlanks":case"notContainsBlanks":a=mE[e.type];break;case"cellIs":if(!e.operator||!e.formula||0===e.formula.length)continue;a=(n=e.operator).slice(0,1).toUpperCase()+n.slice(1),l.push(tE(e.formula[0])),2===e.formula.length&&l.push(tE(e.formula[1]))}a&&void 0!==e.dxfId&&s.push({id:(i++).toString(),ranges:r.sqref,stopIfTrue:e.stopIfTrue,rule:{type:"CellIsRule",operator:a,values:l,style:NE({fontStyle:t[e.dxfId].font,fillStyle:t[e.dxfId].fill},o)}})}}var n;return s}function LE(e,t){const o=t.cfRules[0].dataBar;if(!o)return;const s=DE(AE(o.color)||"#FFFFFF");return{id:e.toString(),stopIfTrue:t.cfRules[0].stopIfTrue,ranges:t.sqref,rule:{type:"DataBarRule",color:s}}}function HE(e,t){const o=t.cfRules[0].colorScale;if(!o||o.cfvos.length!==o.colors.length||o.cfvos.length<2||o.cfvos.length>3)return;const s=[];for(let e=0;e<o.cfvos.length;e++)s.push({color:DE(AE(o.colors[e])||"#FFFFFF"),type:fE[o.cfvos[e].type],value:o.cfvos[e].value});const i=s[0],n=2===s.length?s[1]:s[2],r=3===s.length?s[1]:void 0;return{id:e.toString(),stopIfTrue:t.cfRules[0].stopIfTrue,ranges:t.sqref,rule:{type:"ColorScaleRule",minimum:i,midpoint:r,maximum:n}}}function UE(e,t,o){const s=t.cfRules[0].iconSet;if(!s)return;let i=s.cfvos,n=s.cfIcons;if(i.length<3||n&&n.length<3)return;i.length>3&&(i=[i[0],i[Math.floor(i.length/2)],i[i.length-1]]),n&&n.length>3&&(n=[n[0],n[Math.floor(n.length/2)],n[n.length-1]]);const r=[];for(let e=1;e<=2;e++){const t=fE[i[e].type];if("value"===t)return;r.push({value:i[e].value||"",operator:i[e].gte?"ge":"gt",type:t})}let a={lower:n?BE(n[0].iconSet,n[0].iconId):BE(s.iconSet,0),middle:n?BE(n[1].iconSet,n[1].iconId):BE(s.iconSet,1),upper:n?BE(n[2].iconSet,n[2].iconId):BE(s.iconSet,2)};s.reverse&&(a={upper:a.lower,middle:a.middle,lower:a.upper});for(let e of Object.keys(a))if(!a[e])switch(o.generateNotSupportedWarning(oE.CfIconSetEmptyIconNotSupported),e){case"upper":a[e]=Xx.dots.good;break;case"middle":a[e]=Xx.dots.neutral;break;case"lower":a[e]=Xx.dots.bad}return{id:e.toString(),stopIfTrue:t.cfRules[0].stopIfTrue,ranges:t.sqref,rule:{type:"IconSetRule",icons:a,upperInflectionPoint:r[1],lowerInflectionPoint:r[0]}}}function BE(e,t){const o=vE[e];return o?0===t?Xx[o].bad:1===t?Xx[o].neutral:Xx[o].good:""}function zE(e,t,o){if(e.cfRules.length>1&&o.generateNotSupportedWarning(oE.MultipleRulesCfNotSupported),cE.includes(e.cfRules[0].type)||o.generateNotSupportedWarning(oE.CfTypeNotSupported,e.cfRules[0].type),e.cfRules[0].dxfId){const s=t[e.cfRules[0].dxfId];s.border&&o.generateNotSupportedWarning(oE.CfFormatBorderNotSupported),s.alignment&&o.generateNotSupportedWarning(oE.CfFormatAlignmentNotSupported),s.numFmt&&o.generateNotSupportedWarning(oE.CfFormatNumFmtNotSupported)}}function $E(e){switch(e){case"IsNotEmpty":case"NotContains":return"notContainsBlanks";case"IsEmpty":return"containsBlanks";default:return e.charAt(0).toLowerCase()+e.slice(1)}}function GE(e){return Math.round(Vx*e*100)/100}function WE(e){return Math.round(Lx*e*100)/100}function qE(e,t,o,s,i){const n=o?e.styles[o]:{},r=s?e.formats[s]:void 0,a={font:{size:n?.fontSize||fe,color:{rgb:n?.textColor?n.textColor:"000000"},family:2,name:"Arial"},fill:n?.fillColor?{fgColor:{rgb:n.fillColor}}:{reservedAttribute:"none"},numFmt:r?{format:r,id:0}:void 0,border:i||0,alignment:{horizontal:n.align,vertical:n.verticalAlign?pE[n.verticalAlign]:void 0,wrapText:!("wrap"!==n.wrapping&&!t?.includes(Ne))||void 0}};return a.font.strike=!!n?.strikethrough||void 0,a.font.underline=!!n?.underline||void 0,a.font.bold=!!n?.bold||void 0,a.font.italic=!!n?.italic||void 0,a}function ZE(e,t){const o=function(e,t){if(!e)return 0;let o=wE[e.format];o||(o=XE(e,t)+$x);return o}(t.numFmt,e.numFmts),s={fontId:XE(t.font,e.fonts),fillId:XE(t.fill,e.fills),borderId:t.border,numFmtId:o,alignment:{vertical:t.alignment.vertical,horizontal:t.alignment.horizontal,wrapText:t.alignment.wrapText}};return XE(s,e.styles)}function jE(e,t,o){let s,i=e.find((e=>e.path===t));return i?(s=`rId${(i.rels.length+1).toString()}`,i.rels.push({...o,id:s})):(s="rId1",e.push({path:t,rels:[{...o,id:s}]})),s}const YE=new WeakMap;function XE(e,t){let o=YE.get(t);if(!o){o=new Map;for(let e=0;e<t.length;e++){const s=bs(t[e]);o.set(s,e)}YE.set(t,o)}const s=bs(e);if(o.has(s))return o.get(s);const i=t.length;return t.push(e),o.set(s,i),i}const KE=[];function JE(e){const t=KE.findIndex((t=>t===e));return-1===t?(KE.push(e),KE.length):t+1}const QE=[];function eR(e){const t=QE.findIndex((t=>t===e));return-1===t?(QE.push(e),QE.length):t+1}function tR(e){return Math.round(914400*e/96)}function oR(e,t,o){let s,i,n=e;if(({xc:n,sheetName:s}=Jr(e)),s){const e=o.sheets.findIndex((e=>na(e.name,s)));if(e<0)throw new Error("Unable to find a sheet with the name "+s);i=e}else i=Number(t);const r=Lo(n);return void 0===r.right&&(r.right=o.sheets[i].colNumber),void 0===r.bottom&&(r.bottom=o.sheets[i].rowNumber),(r.right-r.left+1)*(r.bottom-r.top+1)}function sR(e){return Math.round(96*e/914400)}function iR(e,t){let o=0;for(let s=0;s<e;s++){const e=t.cols.find((e=>s>=e.min&&s<=e.max));e?.width?o+=e.width:t.sheetFormat?.defaultColWidth?o+=t.sheetFormat.defaultColWidth:o+=Hx}return o/Lx}function nR(e,t){let o=0;for(let s=0;s<e;s++){const e=t.rows.find((e=>e.index-1===s));e?.height?o+=e.height:t.sheetFormat?.defaultRowHeight?o+=t.sheetFormat.defaultRowHeight:o+=Ux}return o/Vx}function rR(e){let t=1;return e.figures.map((o=>function(e,t,o){let s,i,n,r,a;if(1===e.anchors.length)({col:s,row:i,offset:n}=cR(e.anchors[0])),a=sR(e.figureSize.cx),r=sR(e.figureSize.cy);else{({col:s,row:i,offset:n}=cR(e.anchors[0]));const{x:t,y:l}=hR(e.anchors[0],o),{x:c,y:h}=hR(e.anchors[1],o);a=c-t,r=h-l}const l={id:t,col:s,row:i,offset:n};if("dataSets"in(c=e.data)&&c.dataSets.length>0)return{...l,width:a,height:r,tag:"chart",data:aR(e.data)};if(function(e){return"imageSrc"in e}(e.data))return{...l,width:sR(e.data.size.cx),height:sR(e.data.size.cy),tag:"image",data:{path:e.data.imageSrc,mimetype:e.data.mimetype}};var c;return}(o,(t++).toString(),e))).filter(lt)}function aR(e){const t=e.dataSets.some((e=>"reference"in(e.label??{}))),o=e.labelRange?lR(e.labelRange,t):void 0,s=e.dataSets.map((e=>{let o;return e.label&&"text"in e.label&&(o=e.label.text),{dataRange:lR(e.range,t),label:o,backgroundColor:e.backgroundColor}}));"pie"===e.type&&s.reverse();const i={range:s,dataSetsHaveTitle:t,auxiliaryRange:o,title:e.title??{text:""},background:AE({rgb:e.backgroundColor})||"#FFFFFF",legendPosition:e.legendPosition,stacked:e.stacked||!1,aggregated:!1,cumulative:e.cumulative||!1,labelsAsText:!1};try{return OI.get(e.type).getChartDefinitionFromContextCreation(i)}catch(e){return}}function lR(e,t){let{sheetName:o,xc:s}=Jr(e),i=Lo(s);if(t&&void 0!==i.bottom&&void 0!==i.right){const e=i.bottom-i.top+1,t=i.right-i.left+1;1===e?i={...i,left:i.left-1}:1===t&&(i={...i,top:i.top-1})}return Qr(o,zo(i))}function cR(e){const t={x:sR(e.colOffset)-Ce,y:sR(e.rowOffset)-Ce};return{col:e.col,row:e.row,offset:t}}function hR(e,t){return{x:iR(e.col,t)+sR(e.colOffset),y:nR(e.row,t)+sR(e.rowOffset)}}function dR(e,t){const o=[];let s=1;for(const i of e)if(i)switch(i.type){case"time":t.generateNotSupportedWarning(oE.TimeDataValidationNotSupported);break;case"textLength":t.generateNotSupportedWarning(oE.TextLengthDataValidationNotSupported);break;case"whole":t.generateNotSupportedWarning(oE.WholeNumberDataValidationNotSupported);break;case"decimal":const e=uR(s++,i);o.push(e);break;case"list":const n=gR(s++,i);o.push(n);break;case"date":if("notEqual"===i.operator){t.generateNotSupportedWarning(oE.NotEqualDateDataValidationNotSupported);break}const r=pR(s++,i);o.push(r);break;case"custom":const a=mR(s++,i);o.push(a)}return o}function uR(e,t){const o=[tE(t.formula1.toString())];return t.formula2&&o.push(tE(t.formula2.toString())),{id:e.toString(),ranges:t.sqref,isBlocking:"warning"!==t.errorStyle,criterion:{type:RE[t.operator],values:o}}}function gR(e,t){const o=t.formula1.toString(),s=Zr.test(o);return{id:e.toString(),ranges:t.sqref,isBlocking:"warning"!==t.errorStyle,criterion:{type:s?"isValueInRange":"isValueInList",values:s?[o]:o.replaceAll('"',"").split(","),displayStyle:"arrow"}}}function pR(e,t){let o;const s=[tE(t.formula1.toString())];return t.formula2?(s.push(tE(t.formula2.toString())),o={type:TE[t.operator],values:Hr(s,Ci)}):o={type:TE[t.operator],values:Hr(s,Ci),dateValue:"exactDate"},{id:e.toString(),ranges:t.sqref,isBlocking:"warning"!==t.errorStyle,criterion:o}}function mR(e,t){return{id:e.toString(),ranges:t.sqref,isBlocking:"warning"!==t.errorStyle,criterion:{type:"customFormula",values:[tE(t.formula1.toString())]}}}const fR=new RegExp(/'?\[([0-9]*)\](.*)'?!(\$?[a-zA-Z]*\$?[0-9]*)/g),vR=new RegExp(/SUBTOTAL\(([0-9]*),/g),bR=new RegExp(Br.source,"ig");function SR(e,t){const o=function(e){const t={};for(let o of e.rows)for(let e of o.cells)e.formula&&void 0!==e.formula.sharedIndex&&e.formula.content&&(t[e.formula.sharedIndex]={refCellXc:e.xc,formula:e.formula.content});return t}(e);for(let s of e.rows.map((e=>e.cells)).flat())s?.formula&&(s.formula.content=void 0===s.formula.sharedIndex||s.formula.content?"="+s.formula.content:"="+CR(s.xc,o[s.formula.sharedIndex]),s.formula.content=yR(s.formula.content,t))}function yR(e,t){return e=(e=(e=(e=e.replace("_xlfn.","")).replace(/#REF!/g,"#REF")).replace(vR,((e,t)=>{const o=yE[t];return o?o+"(":e}))).replace(fR,((e,o,s,i)=>{o=Number(o)-1,i=i.replace(/\$/g,"");const n=t.externalBooks[o].sheetNames.findIndex((e=>na(e,s)));if(-1===n)return e;const r=t.externalBooks[o].datasets.find((e=>e.sheetId===n))?.data;if(!r)return e;const a=r&&r[i];return(Number(a)?a:`"${a}"`)||e}))}function CR(e,t){const o=_o(t.refCellXc);let s,i=t.formula.slice();do{if(s=bR.exec(i),s){const t=_o(s[0].replace("$","")),n=_o(e),r={colFixed:s[0].startsWith("$"),rowFixed:s[0].includes("$",1)},a={col:n.col-o.col,row:n.row-o.row},l={col:r.colFixed?t.col:t.col+a.col,row:r.rowFixed?t.row:t.row+a.row};i=i.slice(0,s.index)+Oo(l.col,l.row,r)+i.slice(s.index+s[0].length)}}while(s);return i}function wR(e,t){return e.sheets.map((o=>{SR(o,e);const s=function(e){const t=[0,0];for(let o of e.rows)t[0]=Math.max(t[0],Mt(o.cells.map((e=>_o(e.xc).col)))),t[1]=Math.max(t[1],o.index);for(const o of e.figures)t[0]=Math.max(t[0],o.anchors[o.anchors.length-1]?.col??0),t[1]=Math.max(t[1],o.anchors[o.anchors.length-1]?.row??0);return t[0]=Math.max(t[0]+5,Bx),t[1]=Math.max(t[1]+5,zx),t}(o),i=o.sheetViews[0],n=TR(o,"ROW",s[1]),r=TR(o,"COL",s[0]);return{id:o.sheetName,areGridLinesVisible:!i||i.showGridLines,name:o.sheetName,colNumber:s[0],rowNumber:s[1],...ER(o,e,s,t),merges:o.merges,cols:IR(o,s[0],r),rows:xR(o,s[1],n),conditionalFormats:VE(o.cfs,e.dxfs,t),dataValidationRules:dR(o.dataValidations,t),figures:rR(o),isVisible:o.isVisible,panes:i?{xSplit:i.pane.xSplit,ySplit:i.pane.ySplit}:{xSplit:0,ySplit:0},tables:[],headerGroups:{COL:r,ROW:n},color:AE(o.sheetProperties?.tabColor)}}))}function IR(e,t,o){const s={};for(let n=1;n<t+1;n++){const t=e.cols.find((e=>e.min<=n&&n<=e.max));let r;r=t&&t.width?t.width:e.sheetFormat?.defaultColWidth?e.sheetFormat.defaultColWidth:Hx;const a=n-1,l=o.some((e=>e.isFolded&&e.start<=a&&a<=e.end));s[a]={size:(i=r,i?Math.round(i/Lx*100)/100:i),isHidden:!l&&t?.hidden}}var i;return s}function xR(e,t,o){const s={};for(let n=1;n<t+1;n++){const t=e.rows.find((e=>e.index===n));let r;r=t&&t.height?t.height:e.sheetFormat?.defaultRowHeight?e.sheetFormat.defaultRowHeight:Ux;const a=n-1,l=o.some((e=>e.isFolded&&e.start<=a&&a<=e.end));s[a]={size:(i=r,i?Math.round(i/Vx*100)/100:i),isHidden:!l&&t?.hidden}}var i;return s}function ER(e,t,o,s){const i={},n={},r={},a={},l=t.sharedStrings.map(xt);const c=e.hyperlinks.reduce(((e,t)=>(e[t.xc]=t,e)),{});for(let o of e.rows)for(let e of o.cells)i[e.xc]=RR(e,c,l,s),e.styleIndex&&(n[e.xc]=e.styleIndex+1,r[e.xc]=t.styles[e.styleIndex].numFmtId+1,a[e.xc]=t.styles[e.styleIndex].borderId+1);for(let s of e.rows.filter((e=>e.styleIndex)))for(let e=1;e<=o[0];e++){const o=Oo(e-1,s.index-1);n[o]??=s.styleIndex+1,a[o]??=t.styles[s.styleIndex].borderId+1,r[o]??=t.styles[s.styleIndex].numFmtId+1}for(let s of e.cols.filter((e=>e.styleIndex)))for(let e=s.min;e<=Math.min(s.max,o[0]);e++)for(let i=1;i<=o[1];i++){const o=Oo(e-1,i-1);n[o]??=s.styleIndex+1,a[o]??=t.styles[s.styleIndex].borderId+1,r[o]??=t.styles[s.styleIndex].numFmtId+1}return{cells:i,styles:n,formats:r,borders:a}}function RR(e,t,o,s){let i;switch(e.type){case"sharedString":i=o[parseInt(e.value,10)];break;case"boolean":i=Number(e.value)?"TRUE":"FALSE";break;case"date":case"error":case"inlineStr":case"number":case"str":i=e.value}return i&&t[e.xc]&&(i=function(e,t,o){const s=e.display||t;e.relTarget||e.location||o.generateNotSupportedWarning(oE.BadlyFormattedHyperlink);const i=e.relTarget?e.relTarget:rt(Jr(e.location).sheetName);return ot(s,i)}(t[e.xc],i,s)),e.formula&&(i=e.formula.content),i}function TR(e,t,o){const s=e?.sheetProperties?.outlinePr,i=[];let n=0;for(let r=0;r<o;r++){const o=DR(e,t,r),a=o?.outlineLevel||0;if(a>n){const o=AR(e,t,r,("ROW"===t?s?.summaryBelow:s?.summaryRight)??!0);o&&i.push(o)}n=a}return i}function AR(e,t,o,s){const i=DR(e,t,o),n=i?.outlineLevel;if(!n||!n)return;let r=n,a=o,l=i;for(;l&&r>=n;)a++,l=DR(e,t,a),r=l?.outlineLevel||0;const c=o,h=a-1,d=DR(e,t,s?h+1:c-1);return{start:c-1,end:h-1,isFolded:d?.collapsed||!1}}function DR(e,t,o){return"COL"===t?e.cols.find((e=>e.min<=o&&o<=e.max)):e.rows.find((e=>e.index===o))}const _R={light:ni("Light"),medium:ni("Medium"),dark:ni("Dark"),custom:ni("Custom")},OR={hasFilters:!1,totalRow:!1,firstColumn:!1,lastColumn:!1,numberOfHeaders:1,bandedRows:!0,bandedColumns:!1,automaticAutofill:!0,styleId:"TableStyleMedium2"};function FR(e,t){return{coloredText:io(t,.3),light:so(t,.8),medium:so(t,.6),dark:io(t,.3),mediumBorder:so(t,.45),highlight:t,name:e}}const MR={black:{name:ni("Black"),coloredText:"#000000",light:"#D9D9D9",medium:"#A6A6A6",dark:"#404040",mediumBorder:"#000000",highlight:"#000000"},lightBlue:FR(ni("Light blue"),"#346B90"),red:FR(ni("Red"),"#C53628"),lightGreen:FR(ni("Light green"),"#748747"),purple:FR(ni("Purple"),"#6C4E65"),gray:{name:ni("Gray"),coloredText:"#666666",light:"#EEEEEE",medium:"#DDDDDD",dark:"#767676",mediumBorder:"#D0D0D0",highlight:"#A9A9A9"},orange:FR(ni("Orange"),"#C37034")},PR={black:MR.black,orangeBlue:{...MR.lightBlue,highlight:MR.orange.highlight},purpleGreen:{...MR.lightGreen,highlight:MR.purple.highlight},redBlue:{...MR.lightBlue,highlight:MR.red.highlight}},NR=e=>({category:"light",templateName:"lightColoredText",primaryColor:e.highlight,wholeTable:{style:{textColor:e.coloredText},border:{top:{color:e.highlight,style:"thin"},bottom:{color:e.highlight,style:"thin"}}},headerRow:{border:{bottom:{color:e.highlight,style:"thin"}}},totalRow:{border:{top:{color:e.highlight,style:"thin"}}},firstRowStripe:{style:{fillColor:e.light}}}),kR=e=>({category:"light",templateName:"lightWithHeader",primaryColor:e.highlight,wholeTable:{border:{top:{color:e.highlight,style:"thin"},bottom:{color:e.highlight,style:"thin"},left:{color:e.highlight,style:"thin"},right:{color:e.highlight,style:"thin"}}},headerRow:{style:{fillColor:e.highlight,textColor:"#FFFFFF"},border:{bottom:{color:e.highlight,style:"thin"}}},totalRow:{border:{top:{color:e.highlight,style:"medium"}}},firstRowStripe:{border:{bottom:{color:e.highlight,style:"thin"}}},secondRowStripe:{border:{bottom:{color:e.highlight,style:"thin"}}}}),VR=e=>({category:"light",templateName:"lightAllBorders",primaryColor:e.highlight,wholeTable:{border:{top:{color:e.highlight,style:"thin"},bottom:{color:e.highlight,style:"thin"},left:{color:e.highlight,style:"thin"},right:{color:e.highlight,style:"thin"},horizontal:{color:e.highlight,style:"thin"},vertical:{color:e.highlight,style:"thin"}}},headerRow:{border:{bottom:{color:e.highlight,style:"medium"}}},totalRow:{border:{top:{color:e.highlight,style:"medium"}}},firstRowStripe:{style:{fillColor:e.light}},firstColumnStripe:{style:{fillColor:e.light}}}),LR=e=>({category:"medium",templateName:"mediumBandedBorders",primaryColor:e.highlight,wholeTable:{border:{top:{color:e.mediumBorder,style:"thin"},bottom:{color:e.mediumBorder,style:"thin"},left:{color:e.mediumBorder,style:"thin"},right:{color:e.mediumBorder,style:"thin"},horizontal:{color:e.mediumBorder,style:"thin"}}},headerRow:{style:{fillColor:e.highlight,textColor:"#FFFFFF"}},totalRow:{border:{top:{color:e.highlight,style:"medium"}}},firstRowStripe:{style:{fillColor:e.light}},firstColumnStripe:{style:{fillColor:e.light}}}),HR=e=>({category:"medium",templateName:"mediumWhiteBorders",primaryColor:e.highlight,wholeTable:{border:{horizontal:{color:"#FFFFFF",style:"thin"},vertical:{color:"#FFFFFF",style:"thin"}},style:{fillColor:e.light}},headerRow:{border:{bottom:{color:"#FFFFFF",style:"thick"}},style:{fillColor:e.highlight,textColor:"#FFFFFF"}},totalRow:{border:{top:{color:"#FFFFFF",style:"thick"}},style:{fillColor:e.highlight,textColor:"#FFFFFF"}},firstColumn:{style:{fillColor:e.highlight,textColor:"#FFFFFF"}},lastColumn:{style:{fillColor:e.highlight,textColor:"#FFFFFF"}},firstRowStripe:{style:{fillColor:e.medium}},firstColumnStripe:{style:{fillColor:e.medium}}}),UR=e=>({category:"medium",templateName:"mediumMinimalBorders",primaryColor:e.highlight,wholeTable:{border:{top:{color:"#000000",style:"medium"},bottom:{color:"#000000",style:"medium"}}},totalRow:{border:{top:{color:"#000000",style:"medium"}}},headerRow:{style:{fillColor:e.highlight,textColor:"#FFFFFF"},border:{bottom:{color:"#000000",style:"medium"}}},firstColumn:{style:{fillColor:e.highlight,textColor:"#FFFFFF"}},lastColumn:{style:{fillColor:e.highlight,textColor:"#FFFFFF"}},firstRowStripe:{style:{fillColor:MR.black.light}},firstColumnStripe:{style:{fillColor:MR.black.light}}}),BR=e=>({category:"medium",templateName:"mediumAllBorders",primaryColor:e.highlight,wholeTable:{border:{top:{color:e.mediumBorder,style:"thin"},bottom:{color:e.mediumBorder,style:"thin"},left:{color:e.mediumBorder,style:"thin"},right:{color:e.mediumBorder,style:"thin"},horizontal:{color:e.mediumBorder,style:"thin"},vertical:{color:e.mediumBorder,style:"thin"}},style:{fillColor:e.light}},totalRow:{border:{top:{color:e.highlight,style:"medium"}}},firstRowStripe:{style:{fillColor:e.medium}},firstColumnStripe:{style:{fillColor:e.medium}}}),zR=e=>({category:"dark",templateName:"dark",primaryColor:e.highlight,wholeTable:{style:{fillColor:e.highlight,textColor:"#FFFFFF"}},totalRow:{style:{fillColor:e.dark,textColor:"#FFFFFF"},border:{top:{color:"#FFFFFF",style:"thick"}}},headerRow:{style:{fillColor:"#000000"},border:{bottom:{color:"#FFFFFF",style:"thick"}}},firstColumn:{style:{fillColor:e.dark},border:{right:{color:"#FFFFFF",style:"thick"}}},lastColumn:{style:{fillColor:e.dark},border:{left:{color:"#FFFFFF",style:"thick"}}},firstRowStripe:{style:{fillColor:e.dark}},firstColumnStripe:{style:{fillColor:e.dark}}}),$R=e=>({category:"dark",templateName:"darkNoBorders",primaryColor:e.highlight,wholeTable:{style:{fillColor:e.light}},totalRow:{border:{top:{color:"#000000",style:"medium"}}},headerRow:{style:{fillColor:e.highlight,textColor:"#FFFFFF"}},firstRowStripe:{style:{fillColor:e.medium}},firstColumnStripe:{style:{fillColor:e.medium}}}),GR=zR(MR.black);GR.wholeTable.style.fillColor="#737373";const WR=UR(MR.black);function qR(e,t,o){return{...t(o),displayName:`${o.name}, ${e}`}}WR.wholeTable.border={...WR.wholeTable.border,left:{color:"#000000",style:"thin"},right:{color:"#000000",style:"thin"},horizontal:{color:"#000000",style:"thin"},vertical:{color:"#000000",style:"thin"}};const ZR={None:{category:"light",templateName:"none",primaryColor:"",displayName:"none"},TableStyleLight1:qR("TableStyleLight1",NR,MR.black),TableStyleLight2:qR("TableStyleLight2",NR,MR.lightBlue),TableStyleLight3:qR("TableStyleLight3",NR,MR.red),TableStyleLight4:qR("TableStyleLight4",NR,MR.lightGreen),TableStyleLight5:qR("TableStyleLight5",NR,MR.purple),TableStyleLight6:qR("TableStyleLight6",NR,MR.gray),TableStyleLight7:qR("TableStyleLight7",NR,MR.orange),TableStyleLight8:qR("TableStyleLight8",kR,MR.black),TableStyleLight9:qR("TableStyleLight9",kR,MR.lightBlue),TableStyleLight10:qR("TableStyleLight10",kR,MR.red),TableStyleLight11:qR("TableStyleLight11",kR,MR.lightGreen),TableStyleLight12:qR("TableStyleLight12",kR,MR.purple),TableStyleLight13:qR("TableStyleLight13",kR,MR.gray),TableStyleLight14:qR("TableStyleLight14",kR,MR.orange),TableStyleLight15:qR("TableStyleLight15",VR,MR.black),TableStyleLight16:qR("TableStyleLight16",VR,MR.lightBlue),TableStyleLight17:qR("TableStyleLight17",VR,MR.red),TableStyleLight18:qR("TableStyleLight18",VR,MR.lightGreen),TableStyleLight19:qR("TableStyleLight19",VR,MR.purple),TableStyleLight20:qR("TableStyleLight20",VR,MR.gray),TableStyleLight21:qR("TableStyleLight21",VR,MR.orange),TableStyleMedium1:qR("TableStyleMedium1",LR,MR.black),TableStyleMedium2:qR("TableStyleMedium2",LR,MR.lightBlue),TableStyleMedium3:qR("TableStyleMedium3",LR,MR.red),TableStyleMedium4:qR("TableStyleMedium4",LR,MR.lightGreen),TableStyleMedium5:qR("TableStyleMedium5",LR,MR.purple),TableStyleMedium6:qR("TableStyleMedium6",LR,MR.gray),TableStyleMedium7:qR("TableStyleMedium7",LR,MR.orange),TableStyleMedium8:qR("TableStyleMedium8",HR,MR.black),TableStyleMedium9:qR("TableStyleMedium9",HR,MR.lightBlue),TableStyleMedium10:qR("TableStyleMedium10",HR,MR.red),TableStyleMedium11:qR("TableStyleMedium11",HR,MR.lightGreen),TableStyleMedium12:qR("TableStyleMedium12",HR,MR.purple),TableStyleMedium13:qR("TableStyleMedium13",HR,MR.gray),TableStyleMedium14:qR("TableStyleMedium14",HR,MR.orange),TableStyleMedium15:{...WR,displayName:"Black, TableStyleMedium15"},TableStyleMedium16:qR("TableStyleMedium16",UR,MR.lightBlue),TableStyleMedium17:qR("TableStyleMedium17",UR,MR.red),TableStyleMedium18:qR("TableStyleMedium18",UR,MR.lightGreen),TableStyleMedium19:qR("TableStyleMedium19",UR,MR.purple),TableStyleMedium20:qR("TableStyleMedium20",UR,MR.gray),TableStyleMedium21:qR("TableStyleMedium21",UR,MR.orange),TableStyleMedium22:qR("TableStyleMedium22",BR,MR.black),TableStyleMedium23:qR("TableStyleMedium23",BR,MR.lightBlue),TableStyleMedium24:qR("TableStyleMedium24",BR,MR.red),TableStyleMedium25:qR("TableStyleMedium25",BR,MR.lightGreen),TableStyleMedium26:qR("TableStyleMedium26",BR,MR.purple),TableStyleMedium27:qR("TableStyleMedium27",BR,MR.gray),TableStyleMedium28:qR("TableStyleMedium28",BR,MR.orange),TableStyleDark1:{...GR,displayName:"Black, TableStyleDark1"},TableStyleDark2:qR("TableStyleDark2",zR,MR.lightBlue),TableStyleDark3:qR("TableStyleDark3",zR,MR.red),TableStyleDark4:qR("TableStyleDark4",zR,MR.lightGreen),TableStyleDark5:qR("TableStyleDark5",zR,MR.purple),TableStyleDark6:qR("TableStyleDark6",zR,MR.gray),TableStyleDark7:qR("TableStyleDark7",zR,MR.orange),TableStyleDark8:qR("TableStyleDark8",$R,PR.black),TableStyleDark9:qR("TableStyleDark9",$R,PR.redBlue),TableStyleDark10:qR("TableStyleDark10",$R,PR.purpleGreen),TableStyleDark11:qR("TableStyleDark11",$R,PR.orangeBlue)},jR={none:()=>({category:"none",templateName:"none",primaryColor:"",name:"none"}),lightColoredText:NR,lightAllBorders:VR,mediumAllBorders:BR,lightWithHeader:kR,mediumBandedBorders:LR,mediumMinimalBorders:UR,darkNoBorders:$R,mediumWhiteBorders:HR,dark:zR};function YR(e,t,o){const s=FR("",o);return{...jR[t](s),category:"custom",displayName:e}}function XR(e,t){for(const o of t.sheets){const t=e.sheets.find((e=>e.name===o.sheetName));if(t){t.tables||(t.tables=[]);for(const e of o.tables)t.tables.push({range:e.ref,config:KR(e)});for(const e of o.pivotTables)t.tables.push({range:e.location.ref,config:JR(e)})}}!function(e,t){let o=null;for(let s of e){const i=t.find((e=>na(e.sheetName,s.name))).tables;if(i&&0!==i.length){o||(o=QR(e));for(let t of i)for(let i in o){const n=e.find((e=>e.id===i));for(let e in o[i]){for(let r=o[i][e].length-3;r>=0;r-=2){const a=o[i][e][r];if(!a.endsWith(t.name))continue;const l=o[i][e][r+1],c=eT(s.id===n.id?"":s.name+"!",l,t,e);o[i][e][r+2]=a.slice(0,a.indexOf(t.name))+c+o[i][e][r+2],o[i][e].splice(r,2)}}}}}if(!o)return;for(let t in o){const s=e.find((e=>e.id===t));for(let e in o[t]){const i=o[t][e];if(1===i.length){s.cells[e]=i[0];continue}let n="";for(let e=0;e<i.length;e+=2)n+=i[e]+"["+i[e+1]+"]";n+=i[i.length-1],s.cells[e]=n}}}(e.sheets,t.sheets)}function KR(e){const t=e.style?.name||"";return{hasFilters:void 0!==e.autoFilter,numberOfHeaders:e.headerRowCount,totalRow:e.totalsRowCount>0,firstColumn:e.style?.showFirstColumn||!1,lastColumn:e.style?.showLastColumn||!1,bandedRows:e.style?.showRowStripes||!1,bandedColumns:e.style?.showColumnStripes||!1,styleId:ZR[t]?t:OR.styleId}}function JR(e){return{hasFilters:!1,numberOfHeaders:e.location.firstDataRow,totalRow:e.rowGrandTotals,firstColumn:!0,lastColumn:e.style?.showLastColumn||!1,bandedRows:e.style?.showRowStripes||!1,bandedColumns:e.style?.showColStripes||!1,styleId:OR.styleId}}function QR(e){const t={};for(let o of e)for(let e in o.cells){const s=o.cells[e];if(!s||!s.startsWith("="))continue;const i=s.indexOf("[");if(-1===i)continue;const n=[];let r=s.slice(0,i),a="",l=1,c=0,h=i;for(let e=i+1;e<s.length;e++)"["!==s[e]?"]"===s[e]&&(l--,0===l&&(a=s.slice(h+1,e),n.push(r),n.push(a),c=e+1)):(0===l&&(r=s.slice(c,e),h=e),l++);n.length&&(t[o.id]||(t[o.id]={}),n.push(s.slice(c)),t[o.id][e]=[...n])}return t}function eT(e,t,o,s){const i=t.split(",").map((e=>e.trim())),n=Ho(o.ref),r=[],a=[],l=[];for(const e of i)if(tT(e).startsWith("#")){const t=tT(e);switch(l.push(t),t){case"#All":a.push(n.top,n.bottom);break;case"#Data":const e=o.headerRowCount?n.top+o.headerRowCount:n.top,t=o.totalsRowCount?n.bottom-o.totalsRowCount:n.bottom;a.push(e,t);break;case"#This Row":a.push(_o(s).row);break;case"#Headers":if(!o.headerRowCount)return Ti.InvalidReference;a.push(n.top);break;case"#Totals":if(!o.totalsRowCount)return Ti.InvalidReference;a.push(n.bottom)}}else{const t=e.split(":").map((e=>e.trim())).map(tT);if(r.length)return Ti.InvalidReference;const s=o.cols.findIndex((e=>e.name===t[0]));if(-1===s)return Ti.InvalidReference;if(r.push(s+n.left),t[1]){const e=o.cols.findIndex((e=>e.name===t[1]));if(-1===e)return Ti.InvalidReference;r.push(e+n.left)}}if(!function(e){if(e.length<2)return!0;if(e.length>2)return!1;if(e.includes("#Data")&&e.includes("#Totals"))return!0;if(e.includes("#Headers")&&e.includes("#Data"))return!0;return!1}(l))return Ti.InvalidReference;if(0===a.length){const e=o.headerRowCount?n.top+o.headerRowCount:n.top,t=o.totalsRowCount?n.bottom-o.totalsRowCount:n.bottom;a.push(e,t)}0===r.length&&r.push(n.left,n.right);return e+zo({top:Math.min(...a),left:Math.min(...r),bottom:Math.max(...a),right:Math.max(...r)})}function tT(e){return e.startsWith("[")&&e.endsWith("]")?e.slice(1,e.length-1):e}class oT{value;constructor(e){this.value=e}asString(){return Qx(String(this.value))}asBool(){return"true"===this.value||"false"!==this.value&&Boolean(Number(this.value))}asNum(){return Number(this.value)}}class sT{rootFile;xlsxFileStructure;warningManager;relationships;currentFile=void 0;constructor(e,t,o){this.rootFile=e,this.currentFile=e.file.fileName,this.xlsxFileStructure=t,this.warningManager=o,this.relationships={},e.rels&&this.extractRelationships(e.rels).map((e=>{this.relationships[e.id]=e}))}extractRelationships(e){return this.mapOnElements({parent:e.xml,query:"Relationship"},(e=>({id:this.extractAttr(e,"Id",{required:!0}).asString(),target:this.extractAttr(e,"Target",{required:!0}).asString(),type:this.extractAttr(e,"Type",{required:!0}).asString()})))}getListOfXMLFiles(){return Object.entries(this.xlsxFileStructure).filter((([e])=>"images"!==e)).map((([e,t])=>t)).flat().filter(lt)}mapOnElements(e,t){const o=[],s=this.currentFile;let i;if(e.children){const t=this.querySelector(e.parent,e.query)?.children;i=t||[]}else i=this.querySelectorAll(e.parent,e.query);if(i)for(let e of i)try{o.push(t(e))}catch(t){this.catchErrorOnElement(t,e)}return this.currentFile=s,o}catchErrorOnElement(e,t){const o=t?`Error when parsing an element <${t.tagName}> of file ${this.currentFile}, skip this element. \n${e.stack}`:`Error when parsing file ${this.currentFile}.`;this.warningManager.addParsingWarning([o,e.message].join("\n"))}extractAttr(e,t,o){const s=e.attributes[t];s||this.handleMissingValue(e,`attribute "${t}"`,o);const i=s?.value?s.value:o?.default;return void 0===i?void 0:new oT(i)}extractTextContent(e,t){if(void 0!==t?.default&&"string"!=typeof t.default)throw new Error("extractTextContent default value should be a string");const o="preserve"===e?.attributes["xml:space"]?.value;let s=e?.textContent;return e&&null!==s||this.handleMissingValue(e,"text content",t),s&&(s=o?s:s.trim()),s?Qx(s):t?.default}extractChildAttr(e,t,o,s){let i;i="number"==typeof t?e.children[t]:this.querySelector(e,t),i||this.handleMissingValue(e,"number"==typeof t?`child at index ${t}`:`child <${t}>`,s);const n=i?this.extractAttr(i,o,s)?.asString():s?.default;return void 0!==n?new oT(n):void 0}extractChildTextContent(e,t,o){if(void 0!==o?.default&&"string"!=typeof o.default)throw new Error("extractTextContent default value should be a string");let s=this.querySelector(e,t);return s||this.handleMissingValue(e,`child <${t}>`,o),s?this.extractTextContent(s,o):o?.default}handleMissingValue(e,t,o){if(o?.required){if(void 0===o?.default)throw new Error(`Missing required ${t} in element <${e.tagName}> of ${this.currentFile}, and no default value was set`);this.warningManager.addParsingWarning(`Missing required ${t} in element <${e.tagName}> of ${this.currentFile}, replacing it by the default value ${o.default}`)}}extractColor(e,t,o){if(!e)return o?{rgb:o}:void 0;const s=this.extractAttr(e,"theme")?.asString();let i;if(void 0!==s){if(!t||!t.clrScheme)throw new Error("Color referencing a theme but no theme was provided");i=this.getThemeColor(s,t.clrScheme)}else i=this.extractAttr(e,"rgb")?.asString(),i="FF000000"===i?void 0:i;return{rgb:i||o,auto:this.extractAttr(e,"auto")?.asBool(),indexed:this.extractAttr(e,"indexed")?.asNum(),tint:this.extractAttr(e,"tint")?.asNum()}}getTargetXmlFile(e){if(!e)throw new Error("Undefined target file");const t=this.processRelationshipTargetName(e.target),o=this.getListOfXMLFiles().find((e=>e.file.fileName.endsWith(t)));if(!o||!o.file)throw new Error("Cannot find target file");return o}getTargetImageFile(e){if(!e)throw new Error("Undefined target file");const t=this.processRelationshipTargetName(e.target),o=this.xlsxFileStructure.images.find((e=>e.fileName.endsWith(t)));if(!o)throw new Error("Cannot find target file");return o}querySelector(e,t){const o=bx(t);return e.querySelector(o)}querySelectorAll(e,t){const o=bx(t);return e.querySelectorAll(o)}getThemeColor(e,t){switch(e){case"0":return"FFFFFF";case"1":return"000000";case"2":return t[3].value;case"3":return t[2].value;default:return t[e].value}}processRelationshipTargetName(e){return e.replace(/\.+\//,"")}}class iT extends sT{getTheme(){return{clrScheme:this.mapOnElements({query:"a:clrScheme",parent:this.rootFile.file.xml,children:!0},(e=>({name:e.tagName,value:this.extractChildAttr(e,0,"val",{required:!0,default:Ax}).asString(),lastClr:this.extractChildAttr(e,0,"lastClr",{default:Ax}).asString()})))}}getSharedStrings(){return this.mapOnElements({parent:this.rootFile.file.xml,query:"si"},(e=>this.mapOnElements({parent:e,query:"t"},(e=>this.extractTextContent(e)||"")).join("")))}}class nT extends sT{theme;constructor(e,t,o,s){super(e,t,o),this.theme=s}extractConditionalFormattings(){const e=this.mapOnElements({parent:this.rootFile.file.xml,query:"worksheet > conditionalFormatting"},(e=>({sqref:this.extractAttr(e,"sqref",{required:!0}).asString().split(" "),pivot:this.extractAttr(e,"pivot")?.asBool(),cfRules:this.extractCFRules(e,this.theme)})));return e.push(...this.mapOnElements({parent:this.rootFile.file.xml,query:"extLst x14:conditionalFormatting"},(e=>({sqref:this.extractChildTextContent(e,"xm:sqref",{required:!0}).split(" "),pivot:this.extractAttr(e,"xm:pivot")?.asBool(),cfRules:this.extractCFRules(e,this.theme)})))),e}extractCFRules(e,t){return this.mapOnElements({parent:e,query:"cfRule, x14:cfRule"},(e=>({type:this.extractAttr(e,"type",{required:!0}).asString(),priority:this.extractAttr(e,"priority",{required:!0}).asNum(),colorScale:this.extractCfColorScale(e,t),formula:this.extractCfFormula(e),iconSet:this.extractCfIconSet(e),dxfId:this.extractAttr(e,"dxfId")?.asNum(),stopIfTrue:this.extractAttr(e,"stopIfTrue")?.asBool(),aboveAverage:this.extractAttr(e,"aboveAverage")?.asBool(),percent:this.extractAttr(e,"percent")?.asBool(),bottom:this.extractAttr(e,"bottom")?.asBool(),operator:this.extractAttr(e,"operator")?.asString(),text:this.extractAttr(e,"text")?.asString(),timePeriod:this.extractAttr(e,"timePeriod")?.asString(),rank:this.extractAttr(e,"rank")?.asNum(),stdDev:this.extractAttr(e,"stdDev")?.asNum(),equalAverage:this.extractAttr(e,"equalAverage")?.asBool(),dataBar:this.extractCfDataBar(e,t)})))}extractCfFormula(e){return this.mapOnElements({parent:e,query:"formula"},(e=>this.extractTextContent(e,{required:!0})))}extractCfColorScale(e,t){const o=this.querySelector(e,"colorScale");if(o)return{colors:this.mapOnElements({parent:o,query:"color"},(e=>this.extractColor(e,t,"ffffff"))),cfvos:this.extractCFVos(o)}}extractCfDataBar(e,t){const o=this.querySelector(e,"dataBar");if(o)return{color:this.extractColor(o.querySelector("color"),t,"EFF7FF"),cfvos:this.extractCFVos(o)}}extractCfIconSet(e){const t=this.querySelector(e,"iconSet, x14:iconSet");if(t)return{iconSet:this.extractAttr(t,"iconSet",{default:"3TrafficLights1"}).asString(),showValue:this.extractAttr(t,"showValue",{default:!0}).asBool(),percent:this.extractAttr(t,"percent",{default:!0}).asBool(),reverse:this.extractAttr(t,"reverse")?.asBool(),custom:this.extractAttr(t,"custom")?.asBool(),cfvos:this.extractCFVos(t),cfIcons:this.extractCfIcons(t)}}extractCfIcons(e){const t=this.mapOnElements({parent:e,query:"cfIcon, x14:cfIcon"},(e=>({iconSet:this.extractAttr(e,"iconSet",{required:!0}).asString(),iconId:this.extractAttr(e,"iconId",{required:!0}).asNum()})));return 0===t.length?void 0:t}extractCFVos(e){return this.mapOnElements({parent:e,query:"cfvo, x14:cfvo"},(e=>({type:this.extractAttr(e,"type",{required:!0}).asString(),gte:this.extractAttr(e,"gte",{default:!0})?.asBool(),value:e.attributes.val?this.extractAttr(e,"val")?.asString():this.extractChildTextContent(e,"f, xm:f")})))}}class rT extends sT{theme;constructor(e,t,o,s){super(e,t,o),this.theme=s}extractDataValidations(){return this.mapOnElements({parent:this.rootFile.file.xml,query:"worksheet > dataValidations > dataValidation"},(e=>({type:this.extractAttr(e,"type",{required:!0}).asString(),operator:this.extractAttr(e,"operator",{default:"between"})?.asString(),sqref:this.extractAttr(e,"sqref",{required:!0}).asString().split(" "),errorStyle:this.extractAttr(e,"errorStyle")?.asString(),formula1:this.extractDataValidationFormula(e,1)[0],formula2:this.extractDataValidationFormula(e,2)[0],showErrorMessage:this.extractAttr(e,"showErrorMessage")?.asBool(),errorTitle:this.extractAttr(e,"errorTitle")?.asString(),error:this.extractAttr(e,"error")?.asString(),showInputMessage:this.extractAttr(e,"showInputMessage")?.asBool(),promptTitle:this.extractAttr(e,"promptTitle")?.asString(),prompt:this.extractAttr(e,"prompt")?.asString(),allowBlank:this.extractAttr(e,"allowBlank")?.asBool()})))}extractDataValidationFormula(e,t){return this.mapOnElements({parent:e,query:`formula${t}`},(e=>this.extractTextContent(e,{required:!0})))}}class aT extends sT{extractChart(){return this.mapOnElements({parent:this.rootFile.file.xml,query:"c:chartSpace"},(e=>{const t=this.getChartType(e);if(!SE[t])throw new Error(`Unsupported chart type ${t}`);if("combo"===SE[t])return this.extractComboChart(e);const o=this.mapOnElements({parent:e,query:"c:chart > c:title a:t"},(e=>e.textContent||"")).join(""),s=this.extractChildAttr(e,"c:grouping","val",{default:"clustered"}).asString();return{title:{text:o},type:SE[t],dataSets:this.extractChartDatasets(this.querySelectorAll(e,`c:${t}`),t),labelRange:this.extractLabelRange(t,e),backgroundColor:this.extractChildAttr(e,"c:chartSpace > c:spPr a:srgbClr","val",{default:"ffffff"}).asString(),legendPosition:bE[this.extractChildAttr(e,"c:legendPos","val",{default:"none"}).asString()],stacked:"stacked"===s,fontColor:"000000"}}))[0]}extractLabelRange(e,t){return"scatterChart"===e?this.extractChildTextContent(t,"c:ser c:strRef c:f")||this.extractChildTextContent(t,"c:ser c:numRef c:f"):this.extractChildTextContent(t,"c:ser c:cat c:f")}extractComboChart(e){const t=this.mapOnElements({parent:e,query:"c:title a:t"},(e=>e.textContent||"")).join(""),o=this.extractChildAttr(e,"c:grouping","val",{default:"clustered"}).asString();return{title:{text:t},type:"combo",dataSets:[...this.extractChartDatasets(this.querySelectorAll(e,"c:barChart"),"comboChart"),...this.extractChartDatasets(this.querySelectorAll(e,"c:lineChart"),"comboChart")],labelRange:this.extractChildTextContent(e,"c:ser c:cat c:f"),backgroundColor:this.extractChildAttr(e,"c:chartSpace > c:spPr a:srgbClr","val",{default:"ffffff"}).asString(),legendPosition:bE[this.extractChildAttr(e,"c:legendPos","val",{default:"none"}).asString()],stacked:"stacked"===o,fontColor:"000000"}}extractChartDatasets(e,t){return Array.from(e).map((e=>"scatterChart"===t?this.extractScatterChartDatasets(e):this.mapOnElements({parent:e,query:"c:ser"},(e=>{let t={};const o=this.extractChildTextContent(e,"c:tx c:f");if(o)t={reference:o};else{const o=this.extractChildTextContent(e,"c:tx c:v");o&&(t={text:o})}const s=this.extractChildAttr(e,"c:spPr a:solidFill a:srgbClr","val");return{label:t,range:this.extractChildTextContent(e,"c:val c:f",{required:!0}),backgroundColor:s?`${Wt(s.asString())}`:void 0}})))).flat()}extractScatterChartDatasets(e){return this.mapOnElements({parent:e,query:"c:ser"},(e=>{let t={};const o=this.extractChildTextContent(e,"c:tx c:f");if(o)t={reference:o};else{const o=this.extractChildTextContent(e,"c:tx c:v");o&&(t={text:o})}return{label:t,range:this.extractChildTextContent(e,"c:yVal c:f",{required:!0})}}))}getChartType(e){const t=this.querySelector(e,"c:plotArea");if(!t)throw new Error("Missing plot area in the chart definition.");let o;for(let e of t.children){const t=vx(e.tagName);lx.some((e=>e===t))&&(o?o!==t&&(o="comboChart"):o=t)}if(o)return o;throw new Error("Unknown chart type")}}const lT="oneCellAnchor",cT="twoCellAnchor";class hT extends sT{extractFigures(){return this.mapOnElements({parent:this.rootFile.file.xml,query:"xdr:wsDr",children:!0},(e=>{const t=vx(e.tagName),o=this.extractFigureAnchorsByType(e,t),s=this.querySelector(e,"c:chart"),i=this.querySelector(e,"a:blip");if(!s&&!i)throw new Error("Only chart and image figures are currently supported.");return{anchors:o,data:s?this.extractChart(s):this.extractImage(e),figureSize:t===lT?this.extractFigureSizeFromSizeTag(e,"xdr:ext"):void 0}}))}extractFigureAnchorsByType(e,t){switch(t){case lT:return[this.extractFigureAnchor("xdr:from",e)];case cT:return[this.extractFigureAnchor("xdr:from",e),this.extractFigureAnchor("xdr:to",e)];default:throw new Error(`${t} is not supported for xlsx drawings. `)}}extractFigureSizeFromSizeTag(e,t){const o=this.querySelector(e,t);if(!o)throw new Error(`Missing size element '${t}'`);return{cx:this.extractAttr(o,"cx",{required:!0}).asNum(),cy:this.extractAttr(o,"cy",{required:!0}).asNum()}}extractFigureAnchor(e,t){const o=this.querySelector(t,e);if(!o)throw new Error(`Missing anchor element ${e}`);return{col:Number(this.extractChildTextContent(o,"xdr:col",{required:!0})),colOffset:Number(this.extractChildTextContent(o,"xdr:colOff",{required:!0})),row:Number(this.extractChildTextContent(o,"xdr:row",{required:!0})),rowOffset:Number(this.extractChildTextContent(o,"xdr:rowOff",{required:!0}))}}extractChart(e){const t=this.extractAttr(e,"r:id",{required:!0}).asString(),o=this.getTargetXmlFile(this.relationships[t]),s=new aT(o,this.xlsxFileStructure,this.warningManager).extractChart();if(!s)throw new Error("Unable to extract chart definition");return s}extractImage(e){const t=this.querySelector(e,"a:blip"),o=this.extractAttr(t,"r:embed",{required:!0}).asString(),s=this.getTargetImageFile(this.relationships[o]);if(!s)throw new Error("Unable to extract image");const i=s.fileName.split(".").at(-1),n=vx(e.tagName),r=n===cT?this.querySelector(e,"a:xfrm"):e,a=n===cT?"a:ext":"xdr:ext",l=this.extractFigureSizeFromSizeTag(r,a);return{imageSrc:s.imageSrc,mimetype:i?EE[i]:void 0,size:l}}}class dT extends sT{getPivotTable(){return this.mapOnElements({query:":root",parent:this.rootFile.file.xml},(e=>({name:this.extractAttr(e,"name",{required:!0}).asString(),rowGrandTotals:this.extractAttr(e,"rowGrandTotals",{default:!0}).asBool(),location:this.extractPivotLocation(e),style:this.extractPivotStyleInfo(e)})))[0]}extractPivotLocation(e){return this.mapOnElements({query:"location",parent:e},(e=>({ref:this.extractAttr(e,"ref",{required:!0}).asString(),firstHeaderRow:this.extractAttr(e,"firstHeaderRow",{required:!0}).asNum(),firstDataRow:this.extractAttr(e,"firstDataRow",{required:!0}).asNum(),firstDataCol:this.extractAttr(e,"firstDataCol",{required:!0}).asNum()})))[0]}extractPivotStyleInfo(e){return this.mapOnElements({query:"pivotTableStyleInfo",parent:e},(e=>({name:this.extractAttr(e,"name",{required:!0}).asString(),showRowHeaders:this.extractAttr(e,"showRowHeaders",{required:!0}).asBool(),showColHeaders:this.extractAttr(e,"showColHeaders",{required:!0}).asBool(),showRowStripes:this.extractAttr(e,"showRowStripes",{required:!0}).asBool(),showColStripes:this.extractAttr(e,"showColStripes",{required:!0}).asBool(),showLastColumn:this.extractAttr(e,"showLastColumn")?.asBool()})))[0]}}class uT extends sT{getTable(){return this.mapOnElements({query:"table",parent:this.rootFile.file.xml},(e=>({displayName:this.extractAttr(e,"displayName",{required:!0}).asString(),name:this.extractAttr(e,"name")?.asString(),id:this.extractAttr(e,"id",{required:!0}).asString(),ref:this.extractAttr(e,"ref",{required:!0}).asString(),headerRowCount:this.extractAttr(e,"headerRowCount",{default:1}).asNum(),totalsRowCount:this.extractAttr(e,"totalsRowCount",{default:0}).asNum(),cols:this.extractTableCols(e),style:this.extractTableStyleInfo(e),autoFilter:this.extractTableAutoFilter(e)})))[0]}extractTableCols(e){return this.mapOnElements({query:"tableColumn",parent:e},(e=>({id:this.extractAttr(e,"id",{required:!0}).asString(),name:this.extractAttr(e,"name",{required:!0}).asString(),colFormula:this.extractChildTextContent(e,"calculatedColumnFormula")})))}extractTableStyleInfo(e){return this.mapOnElements({query:"tableStyleInfo",parent:e},(e=>({name:this.extractAttr(e,"name")?.asString(),showFirstColumn:this.extractAttr(e,"showFirstColumn")?.asBool(),showLastColumn:this.extractAttr(e,"showLastColumn")?.asBool(),showRowStripes:this.extractAttr(e,"showRowStripes")?.asBool(),showColumnStripes:this.extractAttr(e,"showColumnStripes")?.asBool()})))[0]}extractTableAutoFilter(e){return this.mapOnElements({query:"autoFilter",parent:e},(e=>({columns:this.extractFilterColumns(e),zone:this.extractAttr(e,"ref",{required:!0}).asString()})))[0]}extractFilterColumns(e){return this.mapOnElements({query:"tableColumn",parent:e},(t=>({colId:this.extractAttr(e,"colId",{required:!0}).asNum(),hiddenButton:this.extractAttr(e,"hiddenButton",{default:!1}).asBool(),filters:this.extractSimpleFilter(t)})))}extractSimpleFilter(e){return this.mapOnElements({query:"filter",parent:e},(e=>({val:this.extractAttr(e,"val",{required:!0}).asString()})))}}class gT extends sT{theme;constructor(e,t,o,s){super(e,t,o),this.theme=s}getSheet(){return this.mapOnElements({query:"worksheet",parent:this.rootFile.file.xml},(e=>{const t=this.getSheetWorkbookInfo();return{sheetName:this.extractSheetName(),sheetViews:this.extractSheetViews(e),sheetFormat:this.extractSheetFormat(e),sheetProperties:this.extractSheetProperties(e),cols:this.extractCols(e),rows:this.extractRows(e),sharedFormulas:this.extractSharedFormulas(e),merges:this.extractMerges(e),cfs:this.extractConditionalFormats(),dataValidations:this.extractDataValidations(),figures:this.extractFigures(e),hyperlinks:this.extractHyperLinks(e),tables:this.extractTables(e),pivotTables:this.extractPivotTables(),isVisible:"visible"===t.state}}))[0]}extractSheetViews(e){return this.mapOnElements({parent:e,query:"sheetView"},(e=>{const t=this.querySelector(e,"pane");return{tabSelected:this.extractAttr(e,"tabSelected",{default:!1}).asBool(),showFormulas:this.extractAttr(e,"showFormulas",{default:!1}).asBool(),showGridLines:this.extractAttr(e,"showGridLines",{default:!0}).asBool(),showRowColHeaders:this.extractAttr(e,"showRowColHeaders",{default:!0}).asBool(),pane:{xSplit:t?this.extractAttr(t,"xSplit",{default:0}).asNum():0,ySplit:t?this.extractAttr(t,"ySplit",{default:0}).asNum():0}}}))}extractSheetName(){const e=Kx(this.xlsxFileStructure.workbook.file.fileName,this.rootFile.file.fileName),t=this.extractRelationships(this.xlsxFileStructure.workbook.rels).find((t=>t.target===e)).id;for(let e of this.querySelectorAll(this.xlsxFileStructure.workbook.file.xml,"sheet"))if(e.attributes["r:id"].value===t)return e.attributes.name.value;throw new Error("Missing sheet name")}getSheetWorkbookInfo(){const e=Kx(this.xlsxFileStructure.workbook.file.fileName,this.rootFile.file.fileName),t=this.extractRelationships(this.xlsxFileStructure.workbook.rels).find((t=>t.target===e)).id,o=this.mapOnElements({parent:this.xlsxFileStructure.workbook.file.xml,query:"sheet"},(e=>({relationshipId:this.extractAttr(e,"r:id",{required:!0}).asString(),sheetId:this.extractAttr(e,"sheetId",{required:!0}).asString(),sheetName:this.extractAttr(e,"name",{required:!0}).asString(),state:this.extractAttr(e,"state",{default:"visible"}).asString()}))).find((e=>e.relationshipId===t));if(!o)throw new Error("Cannot find corresponding workbook sheet");return o}extractConditionalFormats(){return new nT(this.rootFile,this.xlsxFileStructure,this.warningManager,this.theme).extractConditionalFormattings()}extractDataValidations(){return new rT(this.rootFile,this.xlsxFileStructure,this.warningManager,this.theme).extractDataValidations()}extractFigures(e){return this.mapOnElements({parent:e,query:"drawing"},(e=>{const t=this.extractAttr(e,"r:id",{required:!0})?.asString(),o=this.getTargetXmlFile(this.relationships[t]);return new hT(o,this.xlsxFileStructure,this.warningManager).extractFigures()}))[0]||[]}extractTables(e){return this.mapOnElements({query:"tablePart",parent:e},(e=>{const t=this.extractAttr(e,"r:id",{required:!0})?.asString(),o=this.getTargetXmlFile(this.relationships[t]);return new uT(o,this.xlsxFileStructure,this.warningManager).getTable()}))}extractPivotTables(){try{return Object.values(this.relationships).filter((e=>e.type.endsWith("pivotTable"))).map((e=>{const t=this.getTargetXmlFile(e);return new dT(t,this.xlsxFileStructure,this.warningManager).getPivotTable()}))}catch(e){return this.catchErrorOnElement(e),[]}}extractMerges(e){return this.mapOnElements({parent:e,query:"mergeCell"},(e=>this.extractAttr(e,"ref",{required:!0}).asString()))}extractSheetFormat(e){const t=this.querySelector(e,"sheetFormatPr");if(t)return{defaultColWidth:this.extractAttr(t,"defaultColWidth",{default:Hx.toString()}).asNum(),defaultRowHeight:this.extractAttr(t,"defaultRowHeight",{default:Ux.toString()}).asNum()}}extractSheetProperties(e){const t=this.querySelector(e,"sheetPr");if(t)return{outlinePr:this.extractSheetOutlineProperties(t),tabColor:this.extractColor(this.querySelector(t,"tabColor"),this.theme)}}extractSheetOutlineProperties(e){const t=this.querySelector(e,"outlinePr");if(t)return{summaryBelow:this.extractAttr(t,"summaryBelow",{default:!0}).asBool(),summaryRight:this.extractAttr(t,"summaryRight",{default:!0}).asBool()}}extractCols(e){return this.mapOnElements({parent:e,query:"cols col"},(e=>({width:this.extractAttr(e,"width")?.asNum(),customWidth:this.extractAttr(e,"customWidth")?.asBool(),bestFit:this.extractAttr(e,"bestFit")?.asBool(),hidden:this.extractAttr(e,"hidden")?.asBool(),min:this.extractAttr(e,"min",{required:!0})?.asNum(),max:this.extractAttr(e,"max",{required:!0})?.asNum(),styleIndex:this.extractAttr(e,"style")?.asNum(),outlineLevel:this.extractAttr(e,"outlineLevel")?.asNum(),collapsed:this.extractAttr(e,"collapsed")?.asBool()})))}extractRows(e){const t=new Set;return this.mapOnElements({parent:e,query:"sheetData row"},(e=>({index:this.extractAttr(e,"r",{required:!0})?.asNum(),cells:this.extractCells(e,t),height:this.extractAttr(e,"ht")?.asNum(),customHeight:this.extractAttr(e,"customHeight")?.asBool(),hidden:this.extractAttr(e,"hidden")?.asBool(),styleIndex:this.extractAttr(e,"s")?.asNum(),outlineLevel:this.extractAttr(e,"outlineLevel")?.asNum(),collapsed:this.extractAttr(e,"collapsed")?.asBool()})))}extractCells(e,t){return this.mapOnElements({parent:e,query:"c"},(e=>{const o=this.extractAttr(e,"r",{required:!0})?.asString(),s=this.extractCellFormula(e);if(s?.ref&&void 0===s.sharedIndex){const e=Ho(s.ref);for(const{col:s,row:i}of os(e)){const e=Oo(s,i);e!==o&&t.add(e)}}const i=t.has(o);return{xc:o,styleIndex:this.extractAttr(e,"s")?.asNum(),type:hE[this.extractAttr(e,"t",{default:"n"})?.asString()],value:i?void 0:this.extractChildTextContent(e,"v")??void 0,formula:i?void 0:s}}))}extractCellFormula(e){const t=this.querySelector(e,"f");if(!t)return;const o=this.extractTextContent(t),s=this.extractAttr(t,"si")?.asNum(),i=this.extractAttr(t,"ref")?.asString();return void 0!==o&&""!==o.trim()||void 0!==s?{content:o,sharedIndex:s,ref:i}:void 0}extractHyperLinks(e){return this.mapOnElements({parent:e,query:"hyperlink"},(e=>{const t=this.extractAttr(e,"r:id")?.asString();return{xc:this.extractAttr(e,"ref",{required:!0})?.asString(),location:this.extractAttr(e,"location")?.asString(),display:this.extractAttr(e,"display")?.asString(),relTarget:t?this.relationships[t].target:void 0}}))}extractSharedFormulas(e){const t=this.querySelectorAll(e,"f[si][ref]"),o={};for(let e of t){const t=this.extractAttr(e,"si",{required:!0}).asNum(),s=this.extractTextContent(e,{required:!0});o[t]=s}const s=[];for(let e=0;e<Object.keys(o).length;e++)o[e]?s.push(o[e]):(this.warningManager.addParsingWarning(`Missing shared formula ${e}, replacing it by empty formula`),s.push(""));return s}}class pT extends sT{theme;constructor(e,t,o){super(e.styles,e,t),this.theme=o}getNumFormats(){return this.mapOnElements({parent:this.rootFile.file.xml,query:"numFmt"},(e=>this.extractNumFormats(e)))}extractNumFormats(e){return{id:this.extractAttr(e,"numFmtId",{required:!0}).asNum(),format:this.extractAttr(e,"formatCode",{required:!0,default:""}).asString()}}getFonts(){return this.mapOnElements({parent:this.rootFile.file.xml,query:"font"},(e=>this.extractFont(e)))}extractFont(e){const t=this.extractChildAttr(e,"name","val",{default:"Arial"}).asString(),o=this.extractChildAttr(e,"sz","val",{default:fe.toString()}).asNum(),s=this.extractColor(this.querySelector(e,"color"),this.theme),i=this.querySelector(e,"i")||void 0,n=i&&"0"!==i.attributes.val?.value,r=this.querySelector(e,"b")||void 0,a=r&&"0"!==r.attributes.val?.value,l=this.querySelector(e,"strike")||void 0,c=l&&"0"!==l.attributes.val?.value,h=this.querySelector(e,"u")||void 0;return{name:t,size:o,color:s,italic:n,bold:a,underline:h&&"none"!==h.attributes.val?.value,strike:c}}getFills(){return this.mapOnElements({parent:this.rootFile.file.xml,query:"fill"},(e=>this.extractFill(e)))}extractFill(e){const t=e.children[0];return"patternFill"===t.tagName?{patternType:t.attributes.patternType?.value,bgColor:this.extractColor(this.querySelector(t,"bgColor"),this.theme),fgColor:this.extractColor(this.querySelector(t,"fgColor"),this.theme)}:{patternType:"solid",fgColor:this.extractColor(this.querySelectorAll(t,"color")[1],this.theme)}}getBorders(){return this.mapOnElements({parent:this.rootFile.file.xml,query:"border"},(e=>this.extractBorder(e)))}extractBorder(e){const t={left:this.extractSingleBorder(e,"left",this.theme),right:this.extractSingleBorder(e,"right",this.theme),top:this.extractSingleBorder(e,"top",this.theme),bottom:this.extractSingleBorder(e,"bottom",this.theme),diagonal:this.extractSingleBorder(e,"diagonal",this.theme)};return t.diagonal&&(t.diagonalUp=this.extractAttr(e,"diagonalUp")?.asBool(),t.diagonalDown=this.extractAttr(e,"diagonalDown")?.asBool()),t}extractSingleBorder(e,t,o){const s=this.querySelector(e,t);if(s&&s.attributes.style)return{style:this.extractAttr(s,"style",{required:!0,default:"thin"}).asString(),color:this.extractColor(s.children[0],o,"000000")}}extractAlignment(e){return{horizontal:this.extractAttr(e,"horizontal",{default:"general"}).asString(),vertical:this.extractAttr(e,"vertical",{default:"bottom"}).asString(),textRotation:this.extractAttr(e,"textRotation")?.asNum(),wrapText:this.extractAttr(e,"wrapText")?.asBool(),indent:this.extractAttr(e,"indent")?.asNum(),relativeIndent:this.extractAttr(e,"relativeIndent")?.asNum(),justifyLastLine:this.extractAttr(e,"justifyLastLine")?.asBool(),shrinkToFit:this.extractAttr(e,"shrinkToFit")?.asBool(),readingOrder:this.extractAttr(e,"readingOrder")?.asNum()}}getDxfs(){return this.mapOnElements({query:"dxf",parent:this.rootFile.file.xml},(e=>{const t=this.querySelector(e,"font"),o=this.querySelector(e,"fill"),s=this.querySelector(e,"border"),i=this.querySelector(e,"numFmt"),n=this.querySelector(e,"alignment");return{font:t?this.extractFont(t):void 0,fill:o?this.extractFill(o):void 0,numFmt:i?this.extractNumFormats(i):void 0,alignment:n?this.extractAlignment(n):void 0,border:s?this.extractBorder(s):void 0}}))}getStyles(){return this.mapOnElements({query:"cellXfs xf",parent:this.rootFile.file.xml},(e=>{const t=this.querySelector(e,"alignment");return{fontId:this.extractAttr(e,"fontId",{required:!0,default:0}).asNum(),fillId:this.extractAttr(e,"fillId",{required:!0,default:0}).asNum(),borderId:this.extractAttr(e,"borderId",{required:!0,default:0}).asNum(),numFmtId:this.extractAttr(e,"numFmtId",{required:!0,default:0}).asNum(),alignment:t?this.extractAlignment(t):void 0}}))}}class mT extends sT{getExternalBook(){return this.mapOnElements({parent:this.rootFile.file.xml,query:"externalBook"},(e=>({rId:this.extractAttr(e,"r:id",{required:!0}).asString(),sheetNames:this.mapOnElements({parent:e,query:"sheetName"},(e=>this.extractAttr(e,"val",{required:!0}).asString())),datasets:this.extractExternalSheetData(e)})))[0]}extractExternalSheetData(e){return this.mapOnElements({parent:e,query:"sheetData"},(e=>{const t=this.mapOnElements({parent:e,query:"cell"},(e=>({xc:this.extractAttr(e,"r",{required:!0}).asString(),value:this.extractChildTextContent(e,"v",{required:!0})}))),o={};for(let e of t)o[e.xc]=e.value;return{sheetId:this.extractAttr(e,"sheetId",{required:!0}).asNum(),data:o}}))}}function fT(e,t){const o=function(e,t){const o=t[qx],s=o.querySelectorAll(`Override[ContentType="${e}"]`),i=[];for(let e of s){const t=e?.attributes.PartName.value;i.push(t.substring(1))}return i}(e,t);return function(e,t){const o=[];for(let s of e){const e=vT(s,t);o.push({file:{fileName:s,xml:t[s]},rels:e?{fileName:e,xml:t[e]}:void 0})}return o}(o,t)}function vT(e,t){if(e===qx)return"_rels/.rels";let o="";const s=e.split("/");for(let e=0;e<s.length-1;e++)o+=s[e]+"/";return o+="_rels/",o+=s[s.length-1]+".rels",t[o]||(o=void 0),o}class bT{warningManager;xmls;images;constructor(e){this.warningManager=new sE,this.xmls={},this.images=[];for(let t of Object.keys(e))if(t.endsWith(".xml")||t.endsWith(".rels")){const o=e[t].replaceAll(/(<\/?)([a-zA-Z0-9]+):([a-zA-Z0-9]+)/g,"$1NAMESPACE$2NAMESPACE$3");this.xmls[t]=ux(new ax(o))}else t.includes("media/image")&&this.images.push({fileName:t,imageSrc:e[t].imageSrc})}convertXlsx(){const e=this.getXlsxData();return this.convertImportedData(e)}getXlsxData(){const e=this.buildXlsxFileStructure(),t=e.theme?new iT(e.theme,e,this.warningManager).getTheme():void 0,o=e.sharedStrings?new iT(e.sharedStrings,e,this.warningManager).getSharedStrings():[],s=e.sheets.sort(((e,t)=>e.file.fileName.localeCompare(t.file.fileName,void 0,{numeric:!0}))).map((o=>new gT(o,e,this.warningManager,t).getSheet())),i=e.externalLinks.map((t=>new mT(t,e,this.warningManager).getExternalBook())),n=new pT(e,this.warningManager,t);return{fonts:n.getFonts(),fills:n.getFills(),borders:n.getBorders(),dxfs:n.getDxfs(),numFmts:n.getNumFormats(),styles:n.getStyles(),sheets:s,sharedStrings:o,externalBooks:i}}buildXlsxFileStructure(){const e={sheets:fT(Mx.sheet,this.xmls),workbook:fT(Mx.workbook,this.xmls)[0]||fT(Mx.macroEnabledWorkbook,this.xmls)[0]||fT(Mx.templateWorkbook,this.xmls)[0]||fT(Mx.macroEnabledTemplateWorkbook,this.xmls)[0]||fT(Mx.excelAddInWorkbook,this.xmls)[0],styles:fT(Mx.styles,this.xmls)[0],sharedStrings:fT(Mx.sharedStrings,this.xmls)[0],theme:fT(Mx.themes,this.xmls)[0],charts:fT(Mx.chart,this.xmls),figures:fT(Mx.drawing,this.xmls),tables:fT(Mx.table,this.xmls),pivots:fT(Mx.pivot,this.xmls),externalLinks:fT(Mx.externalLink,this.xmls),images:this.images};if(!e.workbook.rels)throw Error(ni("Cannot find workbook relations file"));return e}convertImportedData(e){const t={version:"18.3.1",sheets:wR(e,this.warningManager),styles:PE(e,this.warningManager),formats:kE(e,this.warningManager),borders:FE(e,this.warningManager),revisionId:ye};return XR(t,e),Object.keys(e.styles).map((t=>{e.styles[t]=St(e.styles[t])})),t}}function ST(e){const t=Rf(e);let o=[];return{text:"".concat(...t.map((e=>{if("REFERENCE"===e.type&&Br.test(e.value)){const t=e.value.trim();return o.includes(t)||o.push(t),`${Oe}${o.indexOf(t)}${Oe}`}return e.value}))),dependencies:o}}const yT={am_ET:7,ar_001:6,ar_SY:6,az_AZ:1,eu_ES:1,be_BY:1,bn_IN:1,bs_BA:1,bg_BG:1,ca_ES:1,zh_CN:7,zh_HK:7,zh_TW:7,hr_HR:1,cs_CZ:1,da_DK:1,nl_BE:1,nl_NL:1,en_AU:7,en_CA:7,en_GB:1,en_IN:7,en_NZ:7,et_EE:1,fi_FI:1,fr_BE:1,fr_CA:7,fr_CH:1,fr_FR:1,gl_ES:1,ka_GE:1,de_DE:1,de_CH:1,el_GR:1,gu_IN:7,he_IL:7,hi_IN:7,hu_HU:1,id_ID:7,it_IT:1,ja_JP:7,kab_DZ:6,km_KH:7,ko_KP:1,ko_KR:7,lo_LA:7,lv_LV:1,lt_LT:1,lb_LU:1,mk_MK:1,ml_IN:1,mn_MN:7,ms_MY:1,nb_NO:1,fa_IR:6,pl_PL:1,pt_AO:1,pt_BR:7,pt_PT:1,ro_RO:1,ru_RU:1,sr_RS:7,"sr@latin":7,sk_SK:1,sl_SI:1,es_AR:7,es_BO:1,es_CL:1,es_CO:7,es_CR:1,es_DO:1,es_EC:1,es_GT:7,es_MX:7,es_PA:7,es_PE:7,es_PY:7,es_UY:1,es_VE:7,sw:1,sv_SE:1,th_TH:7,tl_PH:1,tr_TR:1,uk_UA:1,vi_VN:1,sq_AL:1,te_IN:7,en_US:7,my_MM:7,es_ES:1,es_419:1},CT=new n;function wT(e){for(let t of e.sheets||[]){let e=[];for(let o of t.filterTables||[]){const t=Ho(o.range),s=e.findIndex((e=>Xo(e,t)));-1!==s?e[s]=t:e.push(t)}t.filterTables=e.map((e=>({range:zo(e)})))}return e}function IT(){return xT().at(-1)}function xT(){return CT.getKeys().sort(AT)}CT.add("0.1",{migrate:e=>(e.sheets&&e.sheets[0]&&(e.activeSheet=e.sheets[0].name),e)}).add("0.2",{migrate(e){if(e.sheets&&e.sheets.length)for(let t of e.sheets)t.id=t.id||t.name;return e}}).add("0.3",{migrate(e){if(e.sheets&&e.activeSheet){const t=e.sheets.find((t=>t.name===e.activeSheet));e.activeSheet=t.id}return e}}).add("0.4",{migrate(e){for(let t of e.sheets||[])t.figures=t.figures||[];return e}}).add("0.5",{migrate(e){for(let t of e.sheets||[])for(let e in t.cells||[]){const o=t.cells[e];o.content&&o.content.startsWith("=")&&(o.formula=ST(o.content))}return e}}).add("0.6",{migrate(e){for(let t of e.sheets||[])for(let e in t.figures||[]){const{dataSets:o,...s}=t.figures[e].data,i=[];for(let e of o)if(e.labelCell){const t=Ho(e.dataRange),o=e.labelCell+":"+Oo(t.right,t.bottom);i.push(o)}else i.push(e.dataRange);s.dataSetsHaveTitle=Boolean(o[0].labelCell),s.dataSets=i,t.figures[e].data=s}return e}}).add("0.7",{migrate(e){const t=[];for(let o of e.sheets||[]){if(!o.name)continue;const e=o.name,s=Lt(qe(e,"_"),t,{compute:(e,t)=>`${e}${t}`});o.name=s,t.push(s);const i=t=>{if(void 0===t)return t;let o=t.replace(e,s),i=t;for(;i!==o;)i=o,o=i.replace(e,s);return i};for(let e in o.cells){const t=o.cells[e];t.formula&&(t.formula.dependencies=t.formula.dependencies.map(i))}for(let e of o.figures||[])if("chart"===e.type){const t=e.data.dataSets.map(i),o=i(e.data.labelRange);e.data={...e.data,dataSets:t,labelRange:o}}for(let e of o.conditionalFormats||[]){e.ranges=e.ranges.map(i);for(const t of["minimum","maximum","midpoint","upperInflectionPoint","lowerInflectionPoint"])"formula"===e.rule[t]?.type&&(e.rule[t].value=i(e.rule[t].value))}}return e}}).add("0.8",{migrate(e){for(const t of e.sheets||[])for(const e of t.figures||[])e.data.background=m,e.data.verticalAxisPosition="left",e.data.legendPosition="top",e.data.stacked=!1;return e}}).add("0.9",{migrate(e){for(let t of e.sheets||[])for(let e in t.cells||[]){const o=t.cells[e];if(o.formula){let{text:e,dependencies:t}=o.formula;for(let[o,s]of Object.entries(t)){const t=`\\${Oe}${o}\\${Oe}`;e=e.replace(new RegExp(t,"g"),s)}o.content=e,delete o.formula}}return e}}).add("0.10",{migrate(e){const t={};for(let o of e.sheets||[])for(let e in o.cells||[]){const s=o.cells[e];s.format&&(s.format=ms(s.format,t))}return e.formats=t,e}}).add("15.4",{migrate(e){for(let t of e.sheets||[])t.isVisible=!0;return e}}).add("15.4.1",{migrate:e=>wT(e)}).add("16.3",{migrate(e){for(const t in e.borders){const o=e.borders[t];for(const e in o)Array.isArray(o[e])&&(o[e]={style:o[e][0],color:o[e][1]})}return e}}).add("16.4",{migrate:e=>(e.settings||(e.settings={}),e.settings.locale||(e.settings.locale=Ci),e)}).add("16.4.1",{migrate:e=>wT(e)}).add("17.2",{migrate(e){for(const t of e.sheets||[])t.tables=t.tables||t.filterTables||[],delete t.filterTables;return e}}).add("17.3",{migrate:e=>(e.pivots||(e.pivots={}),e.pivotNextId||(e.pivotNextId=Hc(e.pivots)+1),e)}).add("17.4",{migrate(e){for(const t of e.sheets||[])for(const e in t.figures||[]){const o=t.figures[e];"title"in o.data&&"string"==typeof o.data.title&&(o.data.title={text:o.data.title});const s=o.data.type;if(!["line","bar","pie","scatter","waterfall","combo"].includes(s))continue;const{dataSets:i,...n}=t.figures[e].data,r=i.map((e=>({dataRange:e})));n.dataSets=r,t.figures[e].data=n}return e}}).add("18.0",{migrate:e=>e}).add("18.0.1",{migrate(e){for(const t of Object.values(e.pivots||{}))t.measures=t.measures.map((e=>({id:e.name,fieldName:e.name,aggregator:e.aggregator}))),t.columns=t.columns.map((e=>({fieldName:e.name,order:e.order,granularity:e.granularity}))),t.rows=t.rows.map((e=>({fieldName:e.name,order:e.order,granularity:e.granularity})));return e}}).add("18.0.2",{migrate(e){const t=e.settings?.locale;if(t){const e=t.code;t.weekStart=yT[e]||1}return e}}).add("18.0.3",{migrate(e){for(const t of e.sheets||[]){t.styles={},t.formats={},t.borders={};for(const e in t.cells)t.styles[e]=t.cells[e].style,t.formats[e]=t.cells[e].format,t.borders[e]=t.cells[e].border,delete t.cells[e].style,delete t.cells[e].format,delete t.cells[e].border}return e}}).add("18.0.4",{migrate(e){for(const t of e.sheets||[])for(const e of t.figures||[]){if("chart"!==e.tag||"gauge"!==e.data.type)continue;const t=e.data;t?.sectionRule?.lowerInflectionPoint&&(t.sectionRule.lowerInflectionPoint.operator="<="),t?.sectionRule?.upperInflectionPoint&&(t.sectionRule.upperInflectionPoint.operator="<=")}return e}}).add("18.1",{migrate(e){for(const t of e.sheets||[])for(const e of t.tables||[])e.config||(e.config={...OR,hasFilters:!0});return e}}).add("18.1.1",{migrate(e){for(const t of e.sheets||[])for(const e in t.cells){const o=t.cells[e];o&&(t.cells[e]=o.content)}return e}}).add("18.2",{migrate:e=>e}).add("18.3",{migrate(e){if(!e.pivots)return e;for(const t of Object.values(e.pivots)){if(!t.sortedColumn)continue;t.measures.map((e=>e.id)).includes(t.sortedColumn.measure)||delete t.sortedColumn}return e}}).add("18.3.1",{migrate(e){for(const t of e.sheets||[])for(const e of t.figures||[]){const t=e;e.offset={x:t.x||0,y:t.y||0},e.col=0,e.row=0,delete e.x,delete e.y}return e}});const ET="Sheet1";function RT(e,t){if(!e)return FT();console.debug("### Loading data ###");const o=performance.now();if(e["[Content_Types].xml"]){const o=new bT(e);if(e=o.convertXlsx(),t)for(let e of o.warningManager.warnings.sort())console.warn(e)}return"version"in e&&(function(e){return"number"==typeof e.version}(e)&&(e.version=TT[e.version]),e.version!==IT()&&(console.debug("Migrating data from version",e.version),e=function(e){const t=performance.now(),o=xT();for(let t=o.findIndex((t=>t===e.version))+1;t<o.length;t++){const s=o[t];e=CT.get(s).migrate(e)}return console.debug("Data migrated in",performance.now()-t,"ms"),e}(e))),e=function(e){return e=function(e){if(e.uniqueFigureIds)return e;const t=new Set,o=new Ga;for(const s of e.sheets||[])for(const e of s.figures||[])t.has(e.id)&&(e.id+=o.smallUuid()),t.add(e.id);return e.uniqueFigureIds=!0,e}(e),e=function(e){const t=Object.assign(FT(),e,{version:IT()});t.sheets=t.sheets?t.sheets.map(((e,t)=>Object.assign(OT(`Sheet${t+1}`,`Sheet${t+1}`),e))):[],0===t.sheets.length&&t.sheets.push(OT(ET,"Sheet1"));bl(t.settings.locale)||(t.settings.locale=Ci);return t}(e),e}(e),console.debug("Data loaded in",performance.now()-o,"ms"),console.debug("###"),e}const TT={25:"18.2",24:"18.1.1",23:"18.1",22:"18.0.4",21:"18.0.3",20:"18.0.2",19:"18.0.1",18:"18.0",17:"17.4",16:"17.3",15:"17.2",14.5:"16.4.1",14:"16.4",13:"16.3",12.5:"15.4.1",12:"15.4",11:"0.10",10:"0.9",9:"0.8",8:"0.7",7:"0.6",6:"0.5",5:"0.4",4:"0.3",3:"0.2",2:"0.1",1:"0"};function AT(e,t){const o=e.split(".").map(Number),s=t.split(".").map(Number);for(let e=0;e<Math.max(o.length,s.length);e++){const t=o[e]||0,i=s[e]||0;if(t>i)return 1;if(t<i)return-1}return 0}function DT(e,t){return t=function(e,t){if(0!==Object.keys(e).length)return t;const o=[],s=[],i=e=>{if("CREATE_SHEET"===e.type)o.push(e.sheetId);else if("sheetId"in e&&!o.includes(e.sheetId))return{...e,sheetId:ET};return e};for(const e of t)"REMOTE_REVISION"===e.type?s.push({...e,commands:e.commands.map(i)}):s.push(e);return s}(e,t),t=_T(t,"SORT_CELLS"),t=function(e,t){const o=[],s={};for(const t of e.sheets||[])t.figures?.forEach((e=>{"chart"===e.tag&&(s[e.id]=e.data)}));for(const e of t)if("REMOTE_REVISION"===e.type){const t=[];for(const o of e.commands){let e=o;switch(o.type){case"CREATE_CHART":s[o.figureId]=o.definition;break;case"UPDATE_CHART":if(!s[o.figureId]){console.log(`Fix chart definition: chart with id ${o.figureId} not found.`);continue}const t={...s[o.figureId],...o.definition};e={...o,definition:t},s[o.figureId]=t}t.push(e)}o.push({...e,commands:t})}else o.push(e);return o}(e,t=_T(t,"SET_DECIMAL")),t=function(e,t){const o={};for(const t of e.sheets||[])t.figures?.forEach((e=>{o[e.id]=e.offset}));for(const e of t)if("REMOTE_REVISION"===e.type)for(const t of e.commands)switch(t.type){case"UPDATE_FIGURE":t.offset&&(void 0===t.offset.x&&(t.offset.x=o[t.figureId]||0),void 0===t.offset.y&&(t.offset.y=o[t.figureId]||0),o[t.figureId]=o);break;case"CREATE_IMAGE":case"CREATE_CHART":case"CREATE_FIGURE":o[t.figureId]=t.offset}return t}(e,t),t=function(e,t){const o={};for(const t of e.sheets||[])o[t.id]=t.name;const s=[];for(const e of t)if("REMOTE_REVISION"===e.type){const t=[];for(const s of e.commands){switch(s.type){case"DUPLICATE_SHEET":s.sheetNameTo=s.sheetNameTo??ia(o[s.sheetId],Object.values(o));break;case"CREATE_SHEET":o[s.sheetId]=s.name||sa(Object.values(o));break;case"RENAME_SHEET":o[s.sheetId]=s.newName||sa(Object.values(o))}t.push(s)}s.push({...e,commands:t})}else s.push(e);return t}(e,t),t}function _T(e,t){const o=[];for(const s of e)"REMOTE_REVISION"===s.type?o.push({...s,commands:s.commands.filter((e=>e.type!==t))}):o.push(s);return o}function OT(e,t){return{id:e,name:t,colNumber:26,rowNumber:100,cells:{},styles:{},formats:{},borders:{},cols:{},rows:{},merges:[],conditionalFormats:[],dataValidationRules:[],figures:[],tables:[],isVisible:!0}}function FT(e="Sheet1"){return{version:IT(),sheets:[OT(ET,e)],styles:{},formats:{},borders:{},revisionId:ye,uniqueFigureIds:!0,settings:{locale:Ci},pivots:{},pivotNextId:1,customTableStyles:{}}}function MT(e,t){return{...OT(e,t),charts:[],images:[],cellValues:{}}}const PT={wrongPasteSelection:ni("This operation is not allowed with multiple selections."),willRemoveExistingMerge:kC.Errors.WillRemoveExistingMerge,wrongFigurePasteOption:ni("Cannot do a special paste of a figure."),frozenPaneOverlap:ni("This operation is not allowed due to an overlapping frozen pane.")};function NT(e,t){t.isSuccessful||(t.reasons.includes("WrongPasteSelection")?e.raiseError(PT.wrongPasteSelection):t.reasons.includes("WillRemoveExistingMerge")?e.raiseError(PT.willRemoveExistingMerge):t.reasons.includes("WrongFigurePasteOption")?e.raiseError(PT.wrongFigurePasteOption):t.reasons.includes("FrozenPaneOverlap")&&e.raiseError(PT.frozenPaneOverlap))}function kT(e,t,o){const s=e.model.dispatch("PASTE",{target:t,pasteOption:o});NT(e,s)}async function VT(e,t,o,s){let i;try{const n=o;if(o.imageBlob){try{const t=await(e.imageProvider?.uploadFile(o.imageBlob));n.imageData=t}catch(t){const o=ni("An error occurred while uploading the image. %s",t.message);console.error(t),e.raiseError(o)}delete o.imageBlob}i=e.model.dispatch("PASTE_FROM_OS_CLIPBOARD",{target:t,clipboardContent:o,pasteOption:s})}catch(n){const r=o.data;r?.version!==IT()?e.raiseError(ni("An unexpected error occurred while pasting content. This is probably due to a spreadsheet version mismatch.")):(e.raiseError(ni("An unexpected error occurred while pasting content. Additional information can be found in the browser console.")),console.error(n)),i=e.model.dispatch("PASTE_FROM_OS_CLIPBOARD",{target:t,clipboardContent:{text:o.text},pasteOption:s})}NT(e,i)}class LT extends yh{mutators=["clear","hover"];col;row;handle(e){if("ACTIVATE_SHEET"===e.type)this.clear()}hover(e){if(e.col===this.col&&e.row===this.row)return"noStateChange";this.col=e.col,this.row=e.row}clear(){if(void 0===this.col&&void 0===this.row)return"noStateChange";this.col=void 0,this.row=void 0}}class HT extends yh{mutators=["open","close"];persistentPopover;hoveredCell=this.get(LT);handle(e){if("ACTIVATE_SHEET"===e.type)this.close()}open({col:e,row:t},o){const s=this.getters.getActiveSheetId();lC.contains(o)&&(this.persistentPopover={col:e,row:t,sheetId:s,type:o})}close(){if(!this.persistentPopover)return"noStateChange";this.persistentPopover=void 0}get persistentCellPopover(){return this.persistentPopover&&{isOpen:!0,...this.persistentPopover}||{isOpen:!1}}get isOpen(){return void 0!==this.persistentPopover}get cellPopover(){const e=this.getters.getActiveSheetId();if(this.persistentPopover&&this.getters.isVisibleInViewport(this.persistentPopover)){const e=this.getters.getMainCellPosition(this.persistentPopover),t=lC.get(this.persistentPopover.type).onOpen?.(e,this.getters);return t?.isOpen?{...t,anchorRect:this.computePopoverAnchorRect(this.persistentPopover)}:{isOpen:!1}}const{col:t,row:o}=this.hoveredCell;if(void 0===t||void 0===o||!this.getters.isVisibleInViewport({sheetId:e,col:t,row:o}))return{isOpen:!1};const s=this.getters.getMainCellPosition({sheetId:e,col:t,row:o}),i=lC.getAll().map((e=>e.onHover?.(s,this.getters))).find((e=>e?.isOpen));return i?.isOpen?{...i,anchorRect:this.computePopoverAnchorRect(s)}:{isOpen:!1}}computePopoverAnchorRect({col:e,row:t}){const o=this.getters.getActiveSheetId(),s=this.getters.getMerge({sheetId:o,col:e,row:t});return s?this.getters.getVisibleRect(s):this.getters.getVisibleRect(rs({col:e,row:t}))}}function UT(e){return{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height}}function BT(e){if(e)return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function zT(){const e=t.useState({x:0,y:0,width:0,height:0});let o=null;function s(){if(o||(o=document.querySelector(".o-spreadsheet")),o){const{top:t,left:s,width:i,height:n}=o.getBoundingClientRect();e.x=s,e.y=t,e.width=i,e.height=n}}return t.onMounted(s),t.onPatched(s),e}function $T(e){const o=t.useState({x:0,y:0,width:0,height:0});function s(){const t=e.el;if(null===t)return;const{top:s,left:i,width:n,height:r}=t.getBoundingClientRect();o.x=i,o.y=s,o.width=n,o.height=r}return t.onMounted(s),t.onPatched(s),o}Eh`
|
|
40
40
|
.o-popover {
|
|
41
41
|
position: absolute;
|
|
42
42
|
z-index: ${Fe.Popover};
|
|
@@ -3313,4 +3313,4 @@
|
|
|
3313
3313
|
<tableParts count="${e.tables.length}">
|
|
3314
3314
|
${mx(a)}
|
|
3315
3315
|
</tableParts>
|
|
3316
|
-
`}var yH;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(yH||(yH={}));function CH(e,t={}){const o=ze(t);return o.type=e,o}const wH={},IH={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:te,HEADER_WIDTH:oe,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:se,DEFAULT_CELL_HEIGHT:ie,SCROLLBAR_WIDTH:ne},xH={autoCompleteProviders:Vy,autofillModifiersRegistry:eC,autofillRulesRegistry:tC,cellMenuRegistry:zD,colMenuRegistry:AO,errorTypes:Ai,linkMenuRegistry:dA,functionRegistry:eS,featurePluginRegistry:EV,iconsOnCellRegistry:Zx,statefulUIPluginRegistry:RV,coreViewsPluginRegistry:TV,corePluginRegistry:xV,rowMenuRegistry:FO,sidePanelRegistry:BP,figureRegistry:Sx,chartSidePanelComponentRegistry:tM,chartComponentRegistry:FI,chartRegistry:OI,chartSubtypeRegistry:PI,topbarMenuRegistry:PO,topbarComponentRegistry:zP,clickableCellRegistry:AV,otRegistry:NO,inverseCommandRegistry:Ix,urlRegistry:Tn,cellPopoverRegistry:lC,numberFormatMenuRegistry:DO,repeatLocalCommandTransformRegistry:bV,repeatCommandTransformRegistry:vV,clipboardHandlersRegistries:ih,pivotRegistry:gP,pivotTimeAdapterRegistry:yc,pivotSidePanelRegistry:vP,pivotNormalizationValueRegistry:Kc,supportedPivotPositionalFormulaRegistry:Qy,pivotToFunctionValueRegistry:Jc,migrationStepRegistry:CT,chartJsExtensionRegistry:Dh},EH={arg:Vh,isEvaluationError:Hi,toBoolean:Qi,toJsDate:en,toNumber:zi,toString:Xi,toNormalizedPivotValue:Zc,toFunctionPivotValue:Yc,toXC:Oo,toZone:Ho,toUnboundedZone:Lo,toCartesian:_o,numberToLetters:yo,lettersToNumber:Co,UuidGenerator:Ga,formatValue:sr,createCurrencyFormat:vr,ColorGenerator:mo,computeTextWidth:_a,createEmptyWorkbookData:FT,createEmptySheet:OT,createEmptyExcelSheet:MT,rgbaToHex:Xt,colorToRGBA:Kt,positionToZone:rs,isDefined:lt,isMatrix:Ii,lazy:gt,genericRepeat:SV,createAction:i,createActions:o,transformRangeData:rh,deepEquals:ft,overlap:Xo,union:Zo,isInside:Ko,deepCopy:ze,expandZoneOnInsertion:$o,reduceZoneOnDeletion:qo,unquote:Ge,getMaxObjectId:Hc,getFunctionsFromTokens:bS,getFirstPivotFunction:Ky,getNumberOfPivotFunctions:Jy,parseDimension:zc,isDateOrDatetimeField:$c,makeFieldProposal:Zy,insertTokenAfterArgSeparator:jy,insertTokenAfterLeftParenthesis:Yy,mergeContiguousZones:us,getPivotHighlights:MO,pivotTimeAdapter:Cc,UNDO_REDO_PIVOT_COMMANDS:Bk,createPivotFormula:qc,areDomainArgsFieldsValid:Wc,splitReference:Jr,sanitizeSheetName:qe,getUniqueText:Lt,isNumber:Xs,isDateTime:Ms},RH={isMarkdownLink:et,parseMarkdownLink:st,markdownLink:ot,openLink:Fn,urlRepresentation:On},TH={Checkbox:XT,Section:kO,RoundColorPicker:gF,ChartDataSeries:jO,ChartErrorSection:XO,ChartLabelRange:KO,ChartTitle:hF,ChartPanel:iM,ChartFigure:kI,ChartJsComponent:Cy,Grid:GN,GridOverlay:CN,ScorecardChart:ky,LineConfigPanel:$F,BarConfigPanel:QO,PieChartDesignPanel:GF,GenericChartConfigPanel:JO,ChartWithAxisDesignPanel:bF,GaugeChartConfigPanel:CF,GaugeChartDesignPanel:VF,ScorecardChartConfigPanel:qF,ScorecardChartDesignPanel:ZF,GeoChartDesignPanel:BF,RadarChartDesignPanel:WF,WaterfallChartDesignPanel:eM,ComboChartDesignPanel:SF,FunnelChartDesignPanel:yF,ChartTypePicker:oM,FigureComponent:$P,Menu:uA,Popover:GT,SelectionInput:ZO,ValidationMessages:YO,AddDimensionButton:zM,PivotDimensionGranularity:qM,PivotDimensionOrder:ZM,PivotDimension:WM,PivotLayoutConfigurator:XM,PivotHTMLRenderer:WN,PivotDeferUpdate:UM,PivotTitleSection:KM,CogWheelMenu:GM,TextInput:$M,SidePanelCollapsible:tF,RadioSelection:uF,GeoChartRegionSelectSection:LF},AH={useDragAndDropListItems:LO,useHighlights:lM,useHighlightsOnHover:aM},DH={useStoreProvider:dh,DependencyContainer:lh,CellPopoverStore:HT,ComposerFocusStore:wh,CellComposerStore:oN,FindAndReplaceStore:PM,HighlightStore:Uy,DelayedHoveredCellStore:LT,HoveredTableStore:SN,ModelStore:vh,NotificationStore:By,RendererStore:Sh,SelectionInputStore:qO,SpreadsheetStore:yh,useStore:uh,useLocalStore:gh,SidePanelStore:UN,PivotSidePanelStore:mP,PivotMeasureDisplayPanelStore:LM};const _H={DEFAULT_LOCALE:Ci,HIGHLIGHT_COLOR:a,PIVOT_TABLE_CONFIG:Ve,ChartTerms:OC},OH={...ix,...nI};e.AbstractCellClipboardHandler=Qa,e.AbstractChart=wy,e.AbstractFigureClipboardHandler=sh,e.CellErrorType=Ti,e.CorePlugin=ZN,e.CoreViewPlugin=tk,e.DispatchResult=vi,e.EvaluationError=Di,e.Model=class extends ah{corePlugins=[];statefulUIPlugins=[];range;session;isReplayingCommand=!1;renderers={};status=0;config;corePluginConfig;coreViewPluginConfig;uiPluginConfig;state;selection;getters;coreGetters;uuidGenerator;handlers=[];uiHandlers=[];coreHandlers=[];constructor(e={},o={},s=[],i=new Ga,n=!1){const r=performance.now();console.debug("##### Model creation #####"),super(),oi===ei&&si===ti&&(si=()=>!0),s=DT(e,s);const a=RT(e,n);this.state=new yL,this.uuidGenerator=i,this.config=this.setupConfig(o),this.session=this.setupSession(a.revisionId),this.coreGetters={},this.range=new QN(this.coreGetters),this.coreGetters.getRangeString=this.range.getRangeString.bind(this.range),this.coreGetters.getRangeFromSheetXC=this.range.getRangeFromSheetXC.bind(this.range),this.coreGetters.createAdaptedRanges=this.range.createAdaptedRanges.bind(this.range),this.coreGetters.getRangeData=this.range.getRangeData.bind(this.range),this.coreGetters.getRangeDataFromXc=this.range.getRangeDataFromXc.bind(this.range),this.coreGetters.getRangeDataFromZone=this.range.getRangeDataFromZone.bind(this.range),this.coreGetters.getRangeFromRangeData=this.range.getRangeFromRangeData.bind(this.range),this.coreGetters.getRangeFromZone=this.range.getRangeFromZone.bind(this.range),this.coreGetters.recomputeRanges=this.range.recomputeRanges.bind(this.range),this.coreGetters.isRangeValid=this.range.isRangeValid.bind(this.range),this.coreGetters.extendRange=this.range.extendRange.bind(this.range),this.coreGetters.getRangesUnion=this.range.getRangesUnion.bind(this.range),this.coreGetters.removeRangesSheetPrefix=this.range.removeRangesSheetPrefix.bind(this.range),this.coreGetters.adaptFormulaStringDependencies=this.range.adaptFormulaStringDependencies.bind(this.range),this.coreGetters.copyFormulaStringForSheet=this.range.copyFormulaStringForSheet.bind(this.range),this.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode},this.selection=new bL(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.coreViewPluginConfig=this.setupCoreViewPluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of xV.getAll())this.setupCorePlugin(e,a);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(s);for(let e of TV.getAll()){const t=this.setupCoreViewPlugin(e);this.handlers.push(t),this.uiHandlers.push(t),this.coreHandlers.push(t)}for(let e of RV.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of EV.getAll()){const t=this.setupUiPlugin(e);this.handlers.push(t),this.uiHandlers.push(t)}if(this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.setupSessionEvents(),this.joinSession(),o.snapshotRequested||e["[Content_Types].xml"]&&!this.getters.isReadonly()){const e=performance.now();console.debug("Snapshot requested"),this.session.snapshot(this.exportData()),this.garbageCollectExternalResources(),console.debug("Snapshot taken in",performance.now()-e,"ms")}t.markRaw(this),console.debug("Model created in",performance.now()-r,"ms"),console.debug("######")}joinSession(){this.session.join(this.config.client)}async leaveSession(){const e=this.getters.isReadonly()?void 0:gt((()=>this.exportData()));await this.session.leave(e)}setupUiPlugin(e){const t=new e(this.uiPluginConfig);for(let o of e.getters){if(!(o in t))throw new Error(`Invalid getter name: ${o} for plugin ${t.constructor}`);if(o in this.getters)throw new Error(`Getter "${o}" is already defined.`);this.getters[o]=t[o].bind(t)}for(const o of e.layers)this.renderers[o]||(this.renderers[o]=[]),this.renderers[o].push(t);return t}setupCoreViewPlugin(e){const t=new e(this.coreViewPluginConfig);for(let o of e.getters){if(!(o in t))throw new Error(`Invalid getter name: ${o} for plugin ${t.constructor}`);if(o in this.getters)throw new Error(`Getter "${o}" is already defined.`);this.getters[o]=t[o].bind(t)}return t}setupCorePlugin(e,t){const o=new e(this.corePluginConfig);for(let t of e.getters){if(!(t in o))throw new Error(`Invalid getter name: ${t} for plugin ${o.constructor}`);if(t in this.coreGetters)throw new Error(`Getter "${t}" is already defined.`);this.coreGetters[t]=o[t].bind(o)}o.import(t),this.corePlugins.push(o),this.coreHandlers.push(o),this.handlers.push(o)}onRemoteRevisionReceived({commands:e}){for(let t of e){const e=this.status;this.status=2,this.dispatchToHandlers(this.statefulUIPlugins,t),this.status=e}this.finalize()}setupSession(e){return new nV(mL({initialRevisionId:e,recordChanges:this.state.recordChanges.bind(this.state),dispatch:e=>{this.checkDispatchAllowed(e).isSuccessful?(this.isReplayingCommand=!0,this.dispatchToHandlers(this.coreHandlers,e),this.isReplayingCommand=!1):this.dispatchToHandlers(this.coreHandlers,{type:"UNDO",commands:[e]})}}),this.config.transportService,e)}setupSessionEvents(){this.session.on("remote-revision-received",this,this.onRemoteRevisionReceived),this.session.on("revision-undone",this,(({commands:e})=>{this.dispatchFromCorePlugin("UNDO",{commands:e}),this.finalize()})),this.session.on("revision-redone",this,(({commands:e})=>{this.dispatchFromCorePlugin("REDO",{commands:e}),this.finalize()})),this.session.on("unexpected-revision-id",this,(()=>this.trigger("unexpected-revision-id"))),this.session.on("collaborative-event-received",this,(()=>{this.trigger("update")}))}setupConfig(e){const t=e.client||{id:this.uuidGenerator.smallUuid(),name:ni("Anonymous").toString()},o=e.transportService||new aL;return{...e,mode:e.mode||"normal",custom:e.custom||{},external:this.setupExternalConfig(e.external||{}),transportService:o,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger("notify-ui",e),raiseBlockingErrorUI:e=>this.trigger("raise-error-ui",{text:e}),customColors:e.customColors||[]}}setupExternalConfig(e){const t=e.loadLocales||(()=>Promise.resolve(yi));return{...e,loadLocales:t}}setupCorePluginConfig(){return{getters:this.coreGetters,stateObserver:this.state,range:this.range,dispatch:this.dispatchFromCorePlugin,canDispatch:this.canDispatch,custom:this.config.custom,external:this.config.external}}setupCoreViewPluginConfig(){return{getters:this.getters,stateObserver:this.state,selection:this.selection,moveClient:this.session.move.bind(this.session),custom:this.config.custom,uiActions:this.config,session:this.session,defaultCurrency:this.config.defaultCurrency,customColors:this.config.customColors||[],external:this.config.external}}setupUiPluginConfig(){return{getters:this.getters,stateObserver:this.state,dispatch:this.dispatch,canDispatch:this.canDispatch,selection:this.selection,moveClient:this.session.move.bind(this.session),custom:this.config.custom,uiActions:this.config,session:this.session,defaultCurrency:this.config.defaultCurrency,customColors:this.config.customColors||[],external:this.config.external}}checkDispatchAllowed(e){const t=fi(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e);return t.some((e=>"Success"!==e))?new vi(t.flat()):vi.Success}checkDispatchAllowedCoreCommand(e){const t=this.corePlugins.map((t=>t.allowDispatch(e)));return t.push(this.range.allowDispatch(e)),t}checkDispatchAllowedLocalCommand(e){return this.uiHandlers.map((t=>t.allowDispatch(e)))}finalize(){this.status=3;for(const e of this.handlers)e.finalize();this.status=0,this.trigger("command-finalized")}canDispatch=(e,t)=>this.checkDispatchAllowed(CH(e,t));dispatch=(e,t)=>{const o=CH(e,t);let s=this.status;if(this.getters.isReadonly()&&(i=o,!pi.has(i.type)))return new vi("Readonly");var i;if(!this.session.canApplyOptimisticUpdate())return new vi("WaitingSessionConfirmation");switch(s){case 0:const t=this.checkDispatchAllowed(o);if(!t.isSuccessful)return this.trigger("update"),t;this.status=1;const{changes:s,commands:i}=this.state.recordChanges((()=>{const t=performance.now();fi(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize();const s=performance.now()-t;s>5&&console.debug(e,s,"ms")}));this.session.save(o,i,s),this.status=0,this.trigger("update");break;case 1:if(fi(o)){const e=this.checkDispatchAllowed(o);if(!e.isSuccessful)return e;this.state.addCommand(o)}this.dispatchToHandlers(this.handlers,o);break;case 3:throw new Error("Cannot dispatch commands in the finalize state");case 2:if(fi(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return vi.Success};dispatchFromCorePlugin=(e,t)=>{const o=CH(e,t),s=this.status;this.status=2;const i=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(i,o),this.status=s,vi.Success};dispatchToHandlers(e,t){const o=fi(t);for(const s of e)!o&&s instanceof ZN||s.beforeHandle(t);for(const s of e)!o&&s instanceof ZN||s.handle(t);this.trigger("command-dispatched",t)}drawLayer(e,t){const o=this.renderers[t];if(o)for(const s of o)e.ctx.save(),s.drawLayer(e,t),e.ctx.restore()}exportData(){let e=FT();for(let t of this.handlers)t instanceof ZN&&t.export(e);return e.revisionId=this.session.getRevisionId()||ye,e=ze(e),e}updateMode(e){this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...FT(),sheets:[MT(ET,"Sheet1")]};for(let t of this.handlers)t instanceof qN&&t.exportForExcel(e);return e=ze(e),bH(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.PivotRuntimeDefinition=JM,e.Registry=n,e.Revision=sV,e.SPREADSHEET_DIMENSIONS=IH,e.Spreadsheet=rL,e.SpreadsheetPivotTable=tP,e.UIPlugin=$k,e.__info__=wH,e.addFunction=function e(t,o){return eS.add(t,o),{addFunction:(t,o)=>e(t,o)}},e.addRenderingLayer=function(e,t){if(Ei[e])throw new Error(`Layer ${e} already exists`);Ei[e]=t},e.astToFormula=$f,e.chartHelpers=OH,e.compile=gS,e.compileTokens=pS,e.components=TH,e.constants=_H,e.convertAstNodes=Hf,e.coreTypes=mi,e.findCellInNewZone=ns,e.functionCache=uS,e.helpers=EH,e.hooks=AH,e.invalidateCFEvaluationCommands=ui,e.invalidateChartEvaluationCommands=hi,e.invalidateDependenciesCommands=di,e.invalidateEvaluationCommands=ci,e.iterateAstNodes=Uf,e.links=RH,e.load=RT,e.parse=Vf,e.parseTokens=Lf,e.readonlyAllowedCommands=pi,e.registries=xH,e.setDefaultSheetViewSize=function(e){Me=e},e.setTranslationMethod=function(e,t=(()=>!0)){oi=e,si=t},e.stores=DH,e.tokenColors=Gy,e.tokenize=ol,wH.version="18.3.24",wH.date="2025-10-16T06:38:12.942Z",wH.hash="f13dd1c"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
|
|
3316
|
+
`}var yH;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(yH||(yH={}));function CH(e,t={}){const o=ze(t);return o.type=e,o}const wH={},IH={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:te,HEADER_WIDTH:oe,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:se,DEFAULT_CELL_HEIGHT:ie,SCROLLBAR_WIDTH:ne},xH={autoCompleteProviders:Vy,autofillModifiersRegistry:eC,autofillRulesRegistry:tC,cellMenuRegistry:zD,colMenuRegistry:AO,errorTypes:Ai,linkMenuRegistry:dA,functionRegistry:eS,featurePluginRegistry:EV,iconsOnCellRegistry:Zx,statefulUIPluginRegistry:RV,coreViewsPluginRegistry:TV,corePluginRegistry:xV,rowMenuRegistry:FO,sidePanelRegistry:BP,figureRegistry:Sx,chartSidePanelComponentRegistry:tM,chartComponentRegistry:FI,chartRegistry:OI,chartSubtypeRegistry:PI,topbarMenuRegistry:PO,topbarComponentRegistry:zP,clickableCellRegistry:AV,otRegistry:NO,inverseCommandRegistry:Ix,urlRegistry:Tn,cellPopoverRegistry:lC,numberFormatMenuRegistry:DO,repeatLocalCommandTransformRegistry:bV,repeatCommandTransformRegistry:vV,clipboardHandlersRegistries:ih,pivotRegistry:gP,pivotTimeAdapterRegistry:yc,pivotSidePanelRegistry:vP,pivotNormalizationValueRegistry:Kc,supportedPivotPositionalFormulaRegistry:Qy,pivotToFunctionValueRegistry:Jc,migrationStepRegistry:CT,chartJsExtensionRegistry:Dh},EH={arg:Vh,isEvaluationError:Hi,toBoolean:Qi,toJsDate:en,toNumber:zi,toString:Xi,toNormalizedPivotValue:Zc,toFunctionPivotValue:Yc,toXC:Oo,toZone:Ho,toUnboundedZone:Lo,toCartesian:_o,numberToLetters:yo,lettersToNumber:Co,UuidGenerator:Ga,formatValue:sr,createCurrencyFormat:vr,ColorGenerator:mo,computeTextWidth:_a,createEmptyWorkbookData:FT,createEmptySheet:OT,createEmptyExcelSheet:MT,rgbaToHex:Xt,colorToRGBA:Kt,positionToZone:rs,isDefined:lt,isMatrix:Ii,lazy:gt,genericRepeat:SV,createAction:i,createActions:o,transformRangeData:rh,deepEquals:ft,overlap:Xo,union:Zo,isInside:Ko,deepCopy:ze,expandZoneOnInsertion:$o,reduceZoneOnDeletion:qo,unquote:Ge,getMaxObjectId:Hc,getFunctionsFromTokens:bS,getFirstPivotFunction:Ky,getNumberOfPivotFunctions:Jy,parseDimension:zc,isDateOrDatetimeField:$c,makeFieldProposal:Zy,insertTokenAfterArgSeparator:jy,insertTokenAfterLeftParenthesis:Yy,mergeContiguousZones:us,getPivotHighlights:MO,pivotTimeAdapter:Cc,UNDO_REDO_PIVOT_COMMANDS:Bk,createPivotFormula:qc,areDomainArgsFieldsValid:Wc,splitReference:Jr,sanitizeSheetName:qe,getUniqueText:Lt,isNumber:Xs,isDateTime:Ms},RH={isMarkdownLink:et,parseMarkdownLink:st,markdownLink:ot,openLink:Fn,urlRepresentation:On},TH={Checkbox:XT,Section:kO,RoundColorPicker:gF,ChartDataSeries:jO,ChartErrorSection:XO,ChartLabelRange:KO,ChartTitle:hF,ChartPanel:iM,ChartFigure:kI,ChartJsComponent:Cy,Grid:GN,GridOverlay:CN,ScorecardChart:ky,LineConfigPanel:$F,BarConfigPanel:QO,PieChartDesignPanel:GF,GenericChartConfigPanel:JO,ChartWithAxisDesignPanel:bF,GaugeChartConfigPanel:CF,GaugeChartDesignPanel:VF,ScorecardChartConfigPanel:qF,ScorecardChartDesignPanel:ZF,GeoChartDesignPanel:BF,RadarChartDesignPanel:WF,WaterfallChartDesignPanel:eM,ComboChartDesignPanel:SF,FunnelChartDesignPanel:yF,ChartTypePicker:oM,FigureComponent:$P,Menu:uA,Popover:GT,SelectionInput:ZO,ValidationMessages:YO,AddDimensionButton:zM,PivotDimensionGranularity:qM,PivotDimensionOrder:ZM,PivotDimension:WM,PivotLayoutConfigurator:XM,PivotHTMLRenderer:WN,PivotDeferUpdate:UM,PivotTitleSection:KM,CogWheelMenu:GM,TextInput:$M,SidePanelCollapsible:tF,RadioSelection:uF,GeoChartRegionSelectSection:LF},AH={useDragAndDropListItems:LO,useHighlights:lM,useHighlightsOnHover:aM},DH={useStoreProvider:dh,DependencyContainer:lh,CellPopoverStore:HT,ComposerFocusStore:wh,CellComposerStore:oN,FindAndReplaceStore:PM,HighlightStore:Uy,DelayedHoveredCellStore:LT,HoveredTableStore:SN,ModelStore:vh,NotificationStore:By,RendererStore:Sh,SelectionInputStore:qO,SpreadsheetStore:yh,useStore:uh,useLocalStore:gh,SidePanelStore:UN,PivotSidePanelStore:mP,PivotMeasureDisplayPanelStore:LM};const _H={DEFAULT_LOCALE:Ci,HIGHLIGHT_COLOR:a,PIVOT_TABLE_CONFIG:Ve,ChartTerms:OC},OH={...ix,...nI};e.AbstractCellClipboardHandler=Qa,e.AbstractChart=wy,e.AbstractFigureClipboardHandler=sh,e.CellErrorType=Ti,e.CorePlugin=ZN,e.CoreViewPlugin=tk,e.DispatchResult=vi,e.EvaluationError=Di,e.Model=class extends ah{corePlugins=[];statefulUIPlugins=[];range;session;isReplayingCommand=!1;renderers={};status=0;config;corePluginConfig;coreViewPluginConfig;uiPluginConfig;state;selection;getters;coreGetters;uuidGenerator;handlers=[];uiHandlers=[];coreHandlers=[];constructor(e={},o={},s=[],i=new Ga,n=!1){const r=performance.now();console.debug("##### Model creation #####"),super(),oi===ei&&si===ti&&(si=()=>!0),s=DT(e,s);const a=RT(e,n);this.state=new yL,this.uuidGenerator=i,this.config=this.setupConfig(o),this.session=this.setupSession(a.revisionId),this.coreGetters={},this.range=new QN(this.coreGetters),this.coreGetters.getRangeString=this.range.getRangeString.bind(this.range),this.coreGetters.getRangeFromSheetXC=this.range.getRangeFromSheetXC.bind(this.range),this.coreGetters.createAdaptedRanges=this.range.createAdaptedRanges.bind(this.range),this.coreGetters.getRangeData=this.range.getRangeData.bind(this.range),this.coreGetters.getRangeDataFromXc=this.range.getRangeDataFromXc.bind(this.range),this.coreGetters.getRangeDataFromZone=this.range.getRangeDataFromZone.bind(this.range),this.coreGetters.getRangeFromRangeData=this.range.getRangeFromRangeData.bind(this.range),this.coreGetters.getRangeFromZone=this.range.getRangeFromZone.bind(this.range),this.coreGetters.recomputeRanges=this.range.recomputeRanges.bind(this.range),this.coreGetters.isRangeValid=this.range.isRangeValid.bind(this.range),this.coreGetters.extendRange=this.range.extendRange.bind(this.range),this.coreGetters.getRangesUnion=this.range.getRangesUnion.bind(this.range),this.coreGetters.removeRangesSheetPrefix=this.range.removeRangesSheetPrefix.bind(this.range),this.coreGetters.adaptFormulaStringDependencies=this.range.adaptFormulaStringDependencies.bind(this.range),this.coreGetters.copyFormulaStringForSheet=this.range.copyFormulaStringForSheet.bind(this.range),this.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode},this.selection=new bL(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.coreViewPluginConfig=this.setupCoreViewPluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of xV.getAll())this.setupCorePlugin(e,a);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(s);for(let e of TV.getAll()){const t=this.setupCoreViewPlugin(e);this.handlers.push(t),this.uiHandlers.push(t),this.coreHandlers.push(t)}for(let e of RV.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of EV.getAll()){const t=this.setupUiPlugin(e);this.handlers.push(t),this.uiHandlers.push(t)}if(this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.setupSessionEvents(),this.joinSession(),o.snapshotRequested||e["[Content_Types].xml"]&&!this.getters.isReadonly()){const e=performance.now();console.debug("Snapshot requested"),this.session.snapshot(this.exportData()),this.garbageCollectExternalResources(),console.debug("Snapshot taken in",performance.now()-e,"ms")}t.markRaw(this),console.debug("Model created in",performance.now()-r,"ms"),console.debug("######")}joinSession(){this.session.join(this.config.client)}async leaveSession(){const e=this.getters.isReadonly()?void 0:gt((()=>this.exportData()));await this.session.leave(e)}setupUiPlugin(e){const t=new e(this.uiPluginConfig);for(let o of e.getters){if(!(o in t))throw new Error(`Invalid getter name: ${o} for plugin ${t.constructor}`);if(o in this.getters)throw new Error(`Getter "${o}" is already defined.`);this.getters[o]=t[o].bind(t)}for(const o of e.layers)this.renderers[o]||(this.renderers[o]=[]),this.renderers[o].push(t);return t}setupCoreViewPlugin(e){const t=new e(this.coreViewPluginConfig);for(let o of e.getters){if(!(o in t))throw new Error(`Invalid getter name: ${o} for plugin ${t.constructor}`);if(o in this.getters)throw new Error(`Getter "${o}" is already defined.`);this.getters[o]=t[o].bind(t)}return t}setupCorePlugin(e,t){const o=new e(this.corePluginConfig);for(let t of e.getters){if(!(t in o))throw new Error(`Invalid getter name: ${t} for plugin ${o.constructor}`);if(t in this.coreGetters)throw new Error(`Getter "${t}" is already defined.`);this.coreGetters[t]=o[t].bind(o)}o.import(t),this.corePlugins.push(o),this.coreHandlers.push(o),this.handlers.push(o)}onRemoteRevisionReceived({commands:e}){for(let t of e){const e=this.status;this.status=2,this.dispatchToHandlers(this.statefulUIPlugins,t),this.status=e}this.finalize()}setupSession(e){return new nV(mL({initialRevisionId:e,recordChanges:this.state.recordChanges.bind(this.state),dispatch:e=>{this.checkDispatchAllowed(e).isSuccessful?(this.isReplayingCommand=!0,this.dispatchToHandlers(this.coreHandlers,e),this.isReplayingCommand=!1):this.dispatchToHandlers(this.coreHandlers,{type:"UNDO",commands:[e]})}}),this.config.transportService,e)}setupSessionEvents(){this.session.on("remote-revision-received",this,this.onRemoteRevisionReceived),this.session.on("revision-undone",this,(({commands:e})=>{this.dispatchFromCorePlugin("UNDO",{commands:e}),this.finalize()})),this.session.on("revision-redone",this,(({commands:e})=>{this.dispatchFromCorePlugin("REDO",{commands:e}),this.finalize()})),this.session.on("unexpected-revision-id",this,(()=>this.trigger("unexpected-revision-id"))),this.session.on("collaborative-event-received",this,(()=>{this.trigger("update")}))}setupConfig(e){const t=e.client||{id:this.uuidGenerator.smallUuid(),name:ni("Anonymous").toString()},o=e.transportService||new aL;return{...e,mode:e.mode||"normal",custom:e.custom||{},external:this.setupExternalConfig(e.external||{}),transportService:o,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger("notify-ui",e),raiseBlockingErrorUI:e=>this.trigger("raise-error-ui",{text:e}),customColors:e.customColors||[]}}setupExternalConfig(e){const t=e.loadLocales||(()=>Promise.resolve(yi));return{...e,loadLocales:t}}setupCorePluginConfig(){return{getters:this.coreGetters,stateObserver:this.state,range:this.range,dispatch:this.dispatchFromCorePlugin,canDispatch:this.canDispatch,custom:this.config.custom,external:this.config.external}}setupCoreViewPluginConfig(){return{getters:this.getters,stateObserver:this.state,selection:this.selection,moveClient:this.session.move.bind(this.session),custom:this.config.custom,uiActions:this.config,session:this.session,defaultCurrency:this.config.defaultCurrency,customColors:this.config.customColors||[],external:this.config.external}}setupUiPluginConfig(){return{getters:this.getters,stateObserver:this.state,dispatch:this.dispatch,canDispatch:this.canDispatch,selection:this.selection,moveClient:this.session.move.bind(this.session),custom:this.config.custom,uiActions:this.config,session:this.session,defaultCurrency:this.config.defaultCurrency,customColors:this.config.customColors||[],external:this.config.external}}checkDispatchAllowed(e){const t=fi(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e);return t.some((e=>"Success"!==e))?new vi(t.flat()):vi.Success}checkDispatchAllowedCoreCommand(e){const t=this.corePlugins.map((t=>t.allowDispatch(e)));return t.push(this.range.allowDispatch(e)),t}checkDispatchAllowedLocalCommand(e){return this.uiHandlers.map((t=>t.allowDispatch(e)))}finalize(){this.status=3;for(const e of this.handlers)e.finalize();this.status=0,this.trigger("command-finalized")}canDispatch=(e,t)=>this.checkDispatchAllowed(CH(e,t));dispatch=(e,t)=>{const o=CH(e,t);let s=this.status;if(this.getters.isReadonly()&&(i=o,!pi.has(i.type)))return new vi("Readonly");var i;if(!this.session.canApplyOptimisticUpdate())return new vi("WaitingSessionConfirmation");switch(s){case 0:const t=this.checkDispatchAllowed(o);if(!t.isSuccessful)return this.trigger("update"),t;this.status=1;const{changes:s,commands:i}=this.state.recordChanges((()=>{const t=performance.now();fi(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize();const s=performance.now()-t;s>5&&console.debug(e,s,"ms")}));this.session.save(o,i,s),this.status=0,this.trigger("update");break;case 1:if(fi(o)){const e=this.checkDispatchAllowed(o);if(!e.isSuccessful)return e;this.state.addCommand(o)}this.dispatchToHandlers(this.handlers,o);break;case 3:throw new Error("Cannot dispatch commands in the finalize state");case 2:if(fi(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return vi.Success};dispatchFromCorePlugin=(e,t)=>{const o=CH(e,t),s=this.status;this.status=2;const i=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(i,o),this.status=s,vi.Success};dispatchToHandlers(e,t){const o=fi(t);for(const s of e)!o&&s instanceof ZN||s.beforeHandle(t);for(const s of e)!o&&s instanceof ZN||s.handle(t);this.trigger("command-dispatched",t)}drawLayer(e,t){const o=this.renderers[t];if(o)for(const s of o)e.ctx.save(),s.drawLayer(e,t),e.ctx.restore()}exportData(){let e=FT();for(let t of this.handlers)t instanceof ZN&&t.export(e);return e.revisionId=this.session.getRevisionId()||ye,e=ze(e),e}updateMode(e){this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...FT(),sheets:[MT(ET,"Sheet1")]};for(let t of this.handlers)t instanceof qN&&t.exportForExcel(e);return e=ze(e),bH(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.PivotRuntimeDefinition=JM,e.Registry=n,e.Revision=sV,e.SPREADSHEET_DIMENSIONS=IH,e.Spreadsheet=rL,e.SpreadsheetPivotTable=tP,e.UIPlugin=$k,e.__info__=wH,e.addFunction=function e(t,o){return eS.add(t,o),{addFunction:(t,o)=>e(t,o)}},e.addRenderingLayer=function(e,t){if(Ei[e])throw new Error(`Layer ${e} already exists`);Ei[e]=t},e.astToFormula=$f,e.chartHelpers=OH,e.compile=gS,e.compileTokens=pS,e.components=TH,e.constants=_H,e.convertAstNodes=Hf,e.coreTypes=mi,e.findCellInNewZone=ns,e.functionCache=uS,e.helpers=EH,e.hooks=AH,e.invalidateCFEvaluationCommands=ui,e.invalidateChartEvaluationCommands=hi,e.invalidateDependenciesCommands=di,e.invalidateEvaluationCommands=ci,e.iterateAstNodes=Uf,e.links=RH,e.load=RT,e.parse=Vf,e.parseTokens=Lf,e.readonlyAllowedCommands=pi,e.registries=xH,e.setDefaultSheetViewSize=function(e){Me=e},e.setTranslationMethod=function(e,t=(()=>!0)){oi=e,si=t},e.stores=DH,e.tokenColors=Gy,e.tokenize=ol,wH.version="18.3.25",wH.date="2025-10-30T12:24:11.774Z",wH.hash="def7778"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
|
package/dist/o_spreadsheet.xml
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
3
3
|
@see https://github.com/odoo/o-spreadsheet
|
|
4
|
-
@version 18.3.
|
|
5
|
-
@date 2025-10-
|
|
6
|
-
@hash
|
|
4
|
+
@version 18.3.25
|
|
5
|
+
@date 2025-10-30T12:24:58.427Z
|
|
6
|
+
@hash def7778
|
|
7
7
|
-->
|
|
8
8
|
<odoo>
|
|
9
9
|
<t t-name="o-spreadsheet-ValidationMessages">
|