@odoo/o-spreadsheet 19.1.32 → 19.1.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/o_spreadsheet.css
CHANGED
|
@@ -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 19.1.
|
|
6
|
-
* @date 2026-08-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 19.1.33
|
|
6
|
+
* @date 2026-08-29T09:14:50.804Z
|
|
7
|
+
* @hash 5c5b7a2
|
|
8
8
|
*/
|
|
9
9
|
:root {
|
|
10
10
|
--os-gray-100: light-dark(#f9fafb, #1b1d26);
|
|
@@ -1340,6 +1340,12 @@
|
|
|
1340
1340
|
background-color: var(--os-action-color);
|
|
1341
1341
|
border-color: var(--os-action-color) !important;
|
|
1342
1342
|
}
|
|
1343
|
+
|
|
1344
|
+
&:focus {
|
|
1345
|
+
outline: none;
|
|
1346
|
+
box-shadow: 0 0 0 0.25rem rgba(113, 75, 103, 0.25);
|
|
1347
|
+
border-color: var(--os-action-color);
|
|
1348
|
+
}
|
|
1343
1349
|
}
|
|
1344
1350
|
}
|
|
1345
1351
|
}
|
|
@@ -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 19.1.
|
|
6
|
-
* @date 2026-08-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 19.1.33
|
|
6
|
+
* @date 2026-08-29T09:14:49.301Z
|
|
7
|
+
* @hash 5c5b7a2
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { App, Component, blockDom, markRaw, onMounted, onPatched, onWillPatch, onWillStart, onWillUnmount, onWillUpdateProps, status, toRaw, useChildSubEnv, useComponent, useEffect, useEnv, useExternalListener, useRef, useState, useSubEnv, whenReady, xml } from "@odoo/owl";
|
|
@@ -9096,6 +9096,7 @@ function getRadarChartDatasets(definition, args) {
|
|
|
9096
9096
|
hidden,
|
|
9097
9097
|
borderColor,
|
|
9098
9098
|
backgroundColor: borderColor,
|
|
9099
|
+
pointBackgroundColor: borderColor,
|
|
9099
9100
|
pointRadius: definition.hideDataMarkers ? 0 : 3
|
|
9100
9101
|
};
|
|
9101
9102
|
if (fill) {
|
|
@@ -79195,6 +79196,6 @@ const chartHelpers = {
|
|
|
79195
79196
|
//#endregion
|
|
79196
79197
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, ClientDisconnectedError, CommandResult, CorePlugin, CoreViewPlugin, DEFAULT_LOCALE, DEFAULT_LOCALES, DispatchResult, EvaluationError, LocalTransportService, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, categories, chartHelpers, components, constants, convertAstNodes, coreTypes, createAutocompleteArgumentsProvider, findCellInNewZone, functionCache, getCaretDownSvg, getCaretUpSvg, helpers, hooks, invalidateCFEvaluationCommands, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
79197
79198
|
|
|
79198
|
-
__info__.version = "19.1.
|
|
79199
|
-
__info__.date = "2026-08-
|
|
79200
|
-
__info__.hash = "
|
|
79199
|
+
__info__.version = "19.1.33";
|
|
79200
|
+
__info__.date = "2026-08-29T09:14:49.301Z";
|
|
79201
|
+
__info__.hash = "5c5b7a2";
|
|
@@ -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 19.1.
|
|
6
|
-
* @date 2026-08-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 19.1.33
|
|
6
|
+
* @date 2026-08-29T09:14:49.301Z
|
|
7
|
+
* @hash 5c5b7a2
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function(exports, _odoo_owl) {
|
|
@@ -9098,6 +9098,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
9098
9098
|
hidden,
|
|
9099
9099
|
borderColor,
|
|
9100
9100
|
backgroundColor: borderColor,
|
|
9101
|
+
pointBackgroundColor: borderColor,
|
|
9101
9102
|
pointRadius: definition.hideDataMarkers ? 0 : 3
|
|
9102
9103
|
};
|
|
9103
9104
|
if (fill) {
|
|
@@ -79250,8 +79251,8 @@ exports.stores = stores;
|
|
|
79250
79251
|
exports.tokenColors = tokenColors;
|
|
79251
79252
|
exports.tokenize = tokenize;
|
|
79252
79253
|
|
|
79253
|
-
__info__.version = "19.1.
|
|
79254
|
-
__info__.date = "2026-08-
|
|
79255
|
-
__info__.hash = "
|
|
79254
|
+
__info__.version = "19.1.33";
|
|
79255
|
+
__info__.date = "2026-08-29T09:14:49.301Z";
|
|
79256
|
+
__info__.hash = "5c5b7a2";
|
|
79256
79257
|
|
|
79257
79258
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|
|
@@ -11,7 +11,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
11
11
|
`)?t.split(`
|
|
12
12
|
`):[t];for(let t of a){let a=t.includes(` `)?t.split(` `):[t];if(!r){i.push(t);continue}let o=``,s=r;for(let t of a){let a=Il(e,t,r,n),c=a.pop(),l=Ol(e,c,n);if(a.length)o!==``&&(i.push(o),o=``,s=r),a.forEach(e=>{i.push(e)}),o=c,s=r-l;else{let t=o===``?c:` `+c,a=Ol(e,t,n);a<=s?(o+=t,s-=a):(i.push(o),o=c,s=r-l)}}o!==``&&i.push(o)}return i}function Rl(e,t,n,r=.25){let i=1;if(n(i)>e)return i;if(n(t)<e)return t;let a=(i+t)/2,o=n(a),s=0;for(;Math.abs(o-e)>r&&s<20;)o>=e?t=(i+t)/2:i=(i+t)/2,a=(i+t)/2,o=n(a),s++;return a}function zl(e){return e?e.toLowerCase():``}let Bl=/([0-9\.]*)px/;function Vl(e){return Number(e.match(Bl)?.[1])}function Hl(e,t,n){let r=kl(e,t,e.font);if(r<=n)return t;let i=kl(e,`…`,e.font);if(r<=i)return t;let a=t.length;for(;r>=n-i&&a-->0;)t=t.substring(0,a),r=kl(e,t,e.font);return t+`…`}function Ul(e,t,n,r=!1,i=!1,a=Vl(e.font)/10){if(e.fillText(t,n.x,n.y),!r&&!i)return;let o=e.measureText(t),s=o.width,c=o.actualBoundingBoxAscent+o.actualBoundingBoxDescent,l=o.fontBoundingBoxAscent+o.fontBoundingBoxDescent,{x:u,y:d}=n,f=d,p=d;switch(e.textAlign){case`center`:u-=s/2;break;case`right`:u-=s;break}switch(e.textBaseline){case`top`:p+=l-2*a,f+=l/2-a;break;case`middle`:p+=l/2-a;break;case`alphabetic`:p+=2*a,f-=3*a;break;case`bottom`:p=d,f-=c/2-a/2;break}r&&(e.lineWidth=a,e.strokeStyle=e.fillStyle,e.beginPath(),e.moveTo(u,p),e.lineTo(u+s,p),e.stroke()),i&&(e.lineWidth=a,e.strokeStyle=e.fillStyle,e.beginPath(),e.moveTo(u,f),e.lineTo(u+s,f),e.stroke())}function Wl(e,t,n,r,i=`pt`){if(Ol(e,n,r,i)<=t)return n;let a=Ol(e,`...`,r,i);if(a>=t)return``;let o=1,s=n.length,c;for(;o<=s;){let l=Math.floor((o+s)/2);c=Ol(e,n.slice(0,l),r,i),c+a>t?s=l-1:o=l+1}let l=n.slice(0,Math.max(0,o-1));return l?l+`...`:``}function Gl(e,t){if(!t.rotation||t.rotation%(Math.PI*2)==0)return e;let{x:n,y:r}=e,i=Math.cos(-t.rotation),a=Math.sin(-t.rotation),o=e.textWidth-8,s=e.textHeight,c=t.align===`center`,l=t.align===`left`==a<0,u=a*s,d=Math.abs(a*o),f=i*s;return t.verticalAlign===`top`?c?(r+=d/2,n-=u/2):l?n-=u:r+=d:!t.verticalAlign||t.verticalAlign===`bottom`?(r+=s-f,c?(r-=d/2,n-=u/2):l&&(n-=u,r-=d)):c?(n-=u/2,r-=s/2,l?r+=u:r-=u):l?(n-=u,r-=d/2):r+=d/2+f/4,{x:i*n-a*r,y:i*r+a*n}}var Kl=class{getCrypto(){if(typeof globalThis<`u`&&globalThis.crypto)return globalThis.crypto}smallUuid(){let e=this.getCrypto();return e?`10000000-1000`.replace(/[01]/g,t=>{let n=Number(t);return(n^e.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16)}):`xxxxxxxx-xxxx`.replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}uuidv4(){let e=this.getCrypto();return e?`10000000-1000-4000-8000-100000000000`.replace(/[018]/g,t=>{let n=Number(t);return(n^e.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16)}):`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}};let ql=new B;function Jl(){return globalThis.Chart?!!globalThis.Chart.registry.plugins.get(`chartShowValuesPlugin`):!0}function Yl(){if(!(!globalThis.Chart||Jl()))for(let e of ql.getAll())e.register(globalThis.Chart)}function Xl(){if(globalThis.Chart)for(let e of ql.getAll())e.unregister(globalThis.Chart)}var Zl=class extends hr{mutators=[`disableAnimationForChart`,`enableAnimationForChart`];animationPlayed={};disableAnimationForChart(e,t){return this.animationPlayed[e]=t,`noStateChange`}enableAnimationForChart(e){return this.animationPlayed[e]=void 0,`noStateChange`}};function Ql(){if(!globalThis.Chart)throw Error(`Chart.js library is not loaded`);return class extends globalThis.Chart.BarController{static id=`calendar`;static defaults={...globalThis.Chart?.BarController.defaults,dataElementType:`bar`,animations:{numbers:{type:`number`,properties:[]}}};updateElements(e,t,n,r){super.updateElements(e,t,n,r);let i=this.chart.config.options?.chartBackground||`#ffffff`;for(let a=t;a<t+n;a++)r===`reset`&&this.updateElement(e[a],a,{options:{backgroundColor:i}},r)}}}let $l={id:`chartColorScalePlugin`,afterDatasetsDraw(e,t,n){if(!n.position||n.position===`none`||!n.colorScale.length)return;let r=e.ctx;r.save(),r.textAlign=`center`,r.textBaseline=`middle`,r.miterLimit=1;let i=(e.chartArea.bottom-e.chartArea.top)/2,a=n.position===`left`?20:r.canvas.width-70,o=e.chartArea.top,s=r.createLinearGradient(0,o+i,0,o),c=1/(n.colorScale.length-1);n.colorScale.forEach((e,t)=>{s.addColorStop(t*c,e)}),r.fillStyle=s,r.fillRect(a,o,10,i),r.fillStyle=n.fontColor??`black`,r.font=El(12),r.textAlign=`left`;let l=Math.round(n.minValue*100)/100,u=Math.round(n.maxValue*100)/100;n.minValue===n.maxValue&&(--l,u+=1);let d=gs({value:u,format:void 0},n.locale),f=gs({value:l,format:void 0},n.locale);r.fillText(f,a+10+5,o+i-6),r.fillText(d,a+10+5,o+6),r.restore()}};function eu(){if(!globalThis.Chart)throw Error(`Chart.js library is not loaded`);return class extends globalThis.Chart.BarController{static id=`funnel`;static defaults={...globalThis.Chart?.BarController.defaults,dataElementType:`funnel`,animation:{duration:e=>e.type===`data`?1e3*(e.raw[1]/Math.max(...e.dataset.data.map(e=>e[1]))):1e3}};updateElements(e,t,n,r){super.updateElements(e,t,n,r);for(let i=t;i<t+n;i++){let t=e[i];this.updateElement(t,i,{nextElement:e[i+1]},r)}}}}function tu(){if(!globalThis.Chart)throw Error(`Chart.js library is not loaded`);return class extends globalThis.Chart.BarElement{static id=`funnel`;draw(e){e.save();let{x:t,y:n,height:r,nextElement:i,base:a,options:o}=this.getProps([`x`,`y`,`width`,`height`,`nextElement`,`base`,`options`]),s=nu(this),c=(s-(i?nu(i):0))/2,l=Math.min(t,a),u=n-r/2;e.fillStyle=o.backgroundColor,e.beginPath(),e.moveTo(l,u),e.lineTo(l+s,u),e.lineTo(l+s-c,u+r),e.lineTo(l+c,u+r),e.closePath(),e.fill(),o.borderWidth&&(e.strokeStyle=o.borderColor,e.lineWidth=o.borderWidth,e.stroke()),e.restore()}inRange(e,t){let{x:n,y:r,height:i,nextElement:a,base:o}=this.getProps([`x`,`y`,`width`,`height`,`nextElement`,`base`,`options`]),s=nu(this),c=a?nu(a):0,l=Math.min(n,o),u=r-i/2;if(t<u||t>u+i)return!1;let d=(s-c)/2,f=l+d*(t-u)/i,p=l+s-d*(t-u)/i;return!(e<f||e>p)}}}function nu(e){let{x:t,base:n}=e.getProps([`x`,`base`]);return Math.max(t,n)-Math.min(t,n)}let ru=function(e){if(!e.length)return{x:0,y:0};let{x:t,y:n,base:r,width:i,height:a}=e[0].element.getProps([`x`,`y`,`width`,`height`,`base`]),o=Math.min(t,r),s=n-a/2;return{x:o+i*2/3,y:s+a/2}},iu=`000000`,au={arrows:`3Arrows`,smiley:`3Symbols`,dots:`3TrafficLights1`},ou={styleSheet:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,sst:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,Relationships:`http://schemas.openxmlformats.org/package/2006/relationships`,Types:`http://schemas.openxmlformats.org/package/2006/content-types`,worksheet:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,workbook:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,drawing:`http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing`,table:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,revision:`http://schemas.microsoft.com/office/spreadsheetml/2014/revision`,revision3:`http://schemas.microsoft.com/office/spreadsheetml/2016/revision3`,markupCompatibility:`http://schemas.openxmlformats.org/markup-compatibility/2006`},su=`http://schemas.openxmlformats.org/drawingml/2006/main`,cu=`http://schemas.openxmlformats.org/drawingml/2006/chart`,lu={workbook:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml`,macroEnabledWorkbook:`application/vnd.ms-excel.sheet.macroEnabled.main+xml`,templateWorkbook:`application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml`,macroEnabledTemplateWorkbook:`application/vnd.ms-excel.template.macroEnabled.main+xml`,excelAddInWorkbook:`application/vnd.ms-excel.addin.macroEnabled.main+xml`,sheet:`application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml`,metadata:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml`,sharedStrings:`application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml`,styles:`application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml`,drawing:`application/vnd.openxmlformats-officedocument.drawing+xml`,chart:`application/vnd.openxmlformats-officedocument.drawingml.chart+xml`,themes:`application/vnd.openxmlformats-officedocument.theme+xml`,table:`application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml`,pivot:`application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml`,externalLink:`application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml`},uu={document:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument`,sheet:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet`,metadata:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata`,sharedStrings:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings`,styles:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles`,drawing:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing`,chart:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart`,theme:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme`,table:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/table`,hyperlink:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink`,image:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`},du=`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,fu=.75,pu=.143,mu=8.43,hu=12.75,gu={FLOOR:[{type:`NUMBER`,value:1}],CEILING:[{type:`NUMBER`,value:1}],ROUND:[{type:`NUMBER`,value:0}],ROUNDUP:[{type:`NUMBER`,value:0}],ROUNDDOWN:[{type:`NUMBER`,value:0}],IFERROR:[{type:`NUMBER`,value:0}]},_u=`ACOT,ACOTH,AGGREGATE,ARABIC,BASE,BETA.DIST,BETA.INV,BINOM.DIST,BINOM.DIST.RANGE,BINOM.INV,BITAND,BITLSHIFT,BITOR,BITRSHIFT,BITXOR,BYCOL,BYROW,CEILING.MATH,CEILING.PRECISE,CHISQ.DIST,CHISQ.DIST.RT,CHISQ.INV,CHISQ.INV.RT,CHISQ.TEST,CHOOSECOLS,CHOOSEROWS,COMBINA,CONCAT,CONFIDENCE.NORM,CONFIDENCE.T,COT,COTH,COVARIANCE.P,COVARIANCE.S,CSC,CSCH,DAYS,DECIMAL,DROP,ERF.PRECISE,ERFC.PRECISE,EXPAND,EXPON.DIST,F.DIST,F.DIST.RT,F.INV,F.INV.RT,F.TEST,FIELDVALUE,FILTERXML,FLOOR.MATH,FLOOR.PRECISE,FORECAST.ETS,FORECAST.ETS.CONFINT,FORECAST.ETS.SEASONALITY,FORECAST.ETS.STAT,FORECAST.LINEAR,FORMULATEXT,GAMMA,GAMMA.DIST,GAMMA.INV,GAMMALN.PRECISE,GAUSS,HSTACK,HYPGEOM.DIST,IFNA,IFS,IMCOSH,IMCOT,IMCSC,IMCSCH,IMSEC,IMSECH,IMSINH,IMTAN,ISFORMULA,ISOMITTED,ISOWEEKNUM,LAMBDA,LET,LOGNORM.DIST,LOGNORM.INV,MAKEARRAY,MAP,MAXIFS,MINIFS,MODE.MULT,MODE.SNGL,MUNIT,NEGBINOM.DIST,NORM.DIST,NORM.INV,NORM.S.DIST,NORM.S.INV,NUMBERVALUE,PDURATION,PERCENTILE.EXC,PERCENTILE.INC,PERCENTRANK.EXC,PERCENTRANK.INC,PERMUTATIONA,PHI,POISSON.DIST,PQSOURCE,PYTHON_STR,PYTHON_TYPE,PYTHON_TYPENAME,QUARTILE.EXC,QUARTILE.INC,QUERYSTRING,RANDARRAY,RANK.AVG,RANK.EQ,REDUCE,RRI,SCAN,SEC,SECH,SEQUENCE,SHEET,SHEETS,SKEW.P,SORTBY,STDEV.P,STDEV.S,SWITCH,T.DIST,T.DIST.2T,T.DIST.RT,T.INV,T.INV.2T,T.TEST,TAKE,TEXTAFTER,TEXTBEFORE,TEXTJOIN,TEXTSPLIT,TOCOL,TOROW,UNICHAR,UNICODE,UNIQUE,VAR.P,VAR.S,VSTACK,WEBSERVICE,WEIBULL.DIST,WRAPCOLS,WRAPROWS,XLOOKUP,XOR,Z.TEST`.split(`,`),vu=[`%`],yu=`+,-,*,/,:,=,<>,>=,>,<=,<,^,&`.split(`,`).concat(vu);function bu(e,t=R){e=Tt(e);let n=new It(e),r=[],i=St.test(e)?Fu:Iu;for(;!n.isOver();){let e=Lu(n)||i(n)||Du(n,t)||Eu(n,t)||Tu(n)||Cu(n)||Ou(n)||ju(n)||xu(n)||Ru(n)||Au(n,t)||Pu(n);e||={type:`UNKNOWN`,value:n.shift()},r.push(e)}return r}function xu(e){return e.current===`?`?(e.shift(),{type:`DEBUGGER`,value:`?`}):null}let Su={"(":{type:`LEFT_PAREN`,value:`(`},")":{type:`RIGHT_PAREN`,value:`)`}};function Cu(e){return e.current===`(`||e.current===`)`?Su[e.shift()]:null}let wu={"{":{type:`LEFT_BRACE`,value:`{`},"}":{type:`RIGHT_BRACE`,value:`}`}};function Tu(e){return e.current===`{`||e.current===`}`?wu[e.shift()]:null}function Eu(e,t){return e.current===t.formulaArgSeparator?{type:`ARG_SEPARATOR`,value:e.shift()}:null}function Du(e,t){let n=t.formulaArgSeparator===`;`?`\\`:`;`;return n&&e.current===n?(e.shift(),{type:`ARRAY_ROW_SEPARATOR`,value:n}):null}function Ou(e){for(let t of yu)if(e.currentStartsWith(t))return e.advanceBy(t.length),{type:`OPERATOR`,value:t};return null}let ku=new Set(`0123456789`);function Au(e,t){if(!ku.has(e.current)&&e.current!==t.decimalSeparator)return null;let n=e.remaining().match(Zi(t.decimalSeparator));return n?(e.advanceBy(n[0].length),{type:`NUMBER`,value:n[0]}):null}function ju(e){if(e.current===`"`){let t=e.shift(),n=t;for(;e.current&&(e.current!==t||n[n.length-1]===`\\`);)n+=e.shift();return e.current===`"`&&(n+=e.shift()),{type:`STRING`,value:n}}return null}let Mu=/\p{L}|\p{N}|_|\.|!|\$/u,Nu=new Set(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.!$`);function Pu(e){let t=``;if(e.current===`'`){let n=e.shift();for(t+=n;e.current;)if(n=e.shift(),t+=n,n===`'`)if(e.current&&e.current===`'`)n=e.shift(),t+=n;else break;if(n!==`'`)return{type:`UNKNOWN`,value:t}}for(;e.current&&(Nu.has(e.current)||e.current.match(Mu));)t+=e.shift();if(t.length){let e=t;return kc.test(e)?{type:`REFERENCE`,value:e}:{type:`SYMBOL`,value:e}}return null}function Fu(e){let t=``;for(;e.current===` `||e.current&&e.current.match(St);)t+=e.shift();return t?{type:`SPACE`,value:t}:null}function Iu(e){let t=``;for(;e.current===` `;)t+=e.shift();return t?{type:`SPACE`,value:t}:null}function Lu(e){let t=0;for(;e.current===`
|
|
13
13
|
`;)t++,e.shift();return t?{type:`SPACE`,value:`
|
|
14
|
-
`.repeat(t)}:null}function Ru(e){return e.currentStartsWith(A.InvalidReference)?(e.advanceBy(A.InvalidReference.length),{type:`INVALID_REFERENCE`,value:A.InvalidReference}):null}let zu=(e,t=()=>!0)=>[{goTo:e,guard:t}],Bu=(e,t=()=>!0)=>({goTo:e,guard:t}),Vu={0:{REFERENCE:zu(2),NUMBER:zu(4),SYMBOL:[Bu(3,e=>Ac(e.value)),Bu(4,e=>jc(e.value))]},3:{SPACE:zu(3),OPERATOR:zu(5,e=>e.value===`:`)},4:{SPACE:zu(4),OPERATOR:zu(6,e=>e.value===`:`)},2:{SPACE:zu(2),OPERATOR:zu(1,e=>e.value===`:`)},1:{SPACE:zu(1),NUMBER:zu(7),REFERENCE:zu(7,e=>Pc(e.value)),SYMBOL:zu(7,e=>Mc(e.value)||Nc(e.value))},5:{SPACE:zu(5),SYMBOL:zu(7,e=>Mc(e.value)),REFERENCE:zu(7,e=>Pc(e.value))},6:{SPACE:zu(6),NUMBER:zu(7),REFERENCE:zu(7,e=>Pc(e.value)),SYMBOL:zu(7,e=>Nc(e.value))},7:{}};function Hu(e){let t=0,n=Vu[0],r=``;for(;n!==void 0;){let i=e[t++];if(!i)return null;let a=n[i.type]?.find(e=>e.guard(i)),o=a?a.goTo:void 0;switch(o){case void 0:return null;case 7:return r+=i.value,e.splice(0,t),{type:`REFERENCE`,value:r};default:n=Vu[o],r+=i.value;break}}return null}function Uu(e,t=R){let n=bu(e,t),r=[];for(;n.length;)r.push(Hu(n)||n.shift());return r}function Wu(e,t,n){if(!t.startsWith(`=`))return t;let r=Uu(t);for(let t=1;t<r.length;t++){if(r[t].type!==`REFERENCE`)continue;let i=r[t].value,a=Gu(e,i,n).range;i!==a&&(r[t]={value:a,type:`REFERENCE`})}return pt(r.map(e=>e.value))}function Gu(e,t,n){let r=Fc(t).sheetName;if(r?!bl(r,n.sheetName.old):e!==n.sheetId)return{changeType:`NONE`,range:t};let i=Ju(t,r?n.sheetId:e);if(i.invalidXc)return{changeType:`NONE`,range:t};let a=n.applyChange(i);if(a.changeType===`NONE`||a.changeType===`REMOVE`)return{changeType:a.changeType,range:t};let o=Xc(a.range,e,Ku(n));return o===A.InvalidReference?{changeType:`REMOVE`,range:o}:{changeType:a.changeType,range:o}}function Ku(e){return t=>t===e.sheetId?e.sheetName.current:``}function qu(e){return{numberOfRows:2**53-1,numberOfCols:2**53-1}}function Ju(e,t){return kc.test(e)?Kc({xc:e,sheetId:t},qu):qc(e)}let Yu=`xMovingAverage`,Xu={exponential:`exp`,logarithmic:`log`,polynomial:`poly`,trailingMovingAverage:`movingAvg`};function Zu(e,t,n,r){let i=!1,a=[];for(let r in n){let o=n[r];if(o.labelCell){let e=ed(o.labelCell,t);o.labelCell!==e&&(i=!0,o={...o,labelCell:e})}let s=ed(o.dataRange,t);s===void 0||e.getRangeString(s,s.sheetId)===A.InvalidReference?(i=!0,o=void 0):s!==o.dataRange&&(i=!0,o={...o,dataRange:s}),a[r]=o}let o=r,s=ed(o,t);s!==o&&(i=!0,o=s);let c=a.filter(C);return{isStale:i,dataSets:c,labelRange:o}}function Qu(e,t,n){return n.map(n=>({dataRange:Zc(e,t,n.dataRange),labelCell:n.labelCell?Zc(e,t,n.labelCell):void 0}))}function $u(e,t,n){return n?Zc(e,t,n):void 0}function ed(e,t){if(!e)return;let n=t(e);switch(n.changeType){case`REMOVE`:return;default:return n.range}}function td(e,t,n,r){let i=[];for(let a of t){let{unboundedZone:t,sheetId:o,invalidSheetName:s,invalidXc:c}=e.getRangeFromSheetXC(n,a.dataRange);if(!(s||c))if(t.left!==t.right&&t.top!==t.bottom){if(t.right===void 0)continue;for(let n=t.left;n<=t.right;n++){let s={...t,left:n,right:n};i.push({...nd(e,o,s,r?{top:s.top,bottom:s.top,left:s.left,right:s.left}:void 0),backgroundColor:a.backgroundColor,rightYAxis:a.yAxisId===`y1`,customLabel:a.label,trend:a.trend})}}else i.push({...nd(e,o,t,r?{top:t.top,bottom:t.top,left:t.left,right:t.left}:void 0),backgroundColor:a.backgroundColor,rightYAxis:a.yAxisId===`y1`,customLabel:a.label,trend:a.trend})}return i}function nd(e,t,n,r){if(n.left!==n.right&&n.top!==n.bottom)throw Error(`Zone should be a single column or row: ${hn(n)}`);if(r){let i=hn(n),a=hn(r);return{labelCell:e.getRangeFromSheetXC(t,a),dataRange:e.getRangeFromSheetXC(t,i)}}else return{labelCell:void 0,dataRange:e.getRangeFromSheetXC(t,hn(n))}}function rd(e,t){let n=t.labelCell?.zone,r=t.dataRange.zone;if(n){let{numberOfRows:e,numberOfCols:t}=On(r);e===1?r={...r,left:r.left+1}:t===1&&(r={...r,top:r.top+1})}let i=Gc({...t.dataRange,zone:r},e.getSheetSize),a={};t.customLabel?a={text:t.customLabel}:t.labelCell&&(a={reference:e.getRangeString(t.labelCell,`forceSheetReference`,{useBoundedReference:!0})});let o;return t.trend?.type&&(o={type:t.trend.type===`polynomial`&&t.trend.order===1?`linear`:Xu[t.trend.type],color:t.trend.color,order:t.trend.order?Math.min(t.trend.order,6):void 0,window:t.trend.window||2}),{label:a,range:e.getRangeString(i,`forceSheetReference`,{useBoundedReference:!0}),backgroundColor:t.backgroundColor,rightYAxis:t.rightYAxis,trend:o}}function id(e,t,n){if(!t)return;let r={...t.zone};n&&t.zone.bottom>t.zone.top&&(r.top+=1);let i=Gc({...t,zone:r},e.getSheetSize);return e.getRangeString(i,`forceSheetReference`,{useBoundedReference:!0})}function ad(e,t,n){let r;if(t.labelRange){let{changeType:i,range:a}=Gu(e,t.labelRange,n);i!==`REMOVE`&&(r=a)}let i=[];for(let r of t.dataSets){let t={...r},{changeType:a,range:o}=Gu(e,r.dataRange,n);a!==`REMOVE`&&(t.dataRange=o,i.push(t))}return{...t,dataSets:i,labelRange:r}}function od(e){return e&&kr(e)<.3?`#FFFFFF`:`#000000`}function sd(e){return e&&kr(e)<.3?`#C8C8C8`:`#666666`}function cd(e){return e.dataSets&&(e.dataSets.find(e=>!kc.test(e.dataRange))!==void 0||e.dataSets.map(e=>ln(e.dataRange)).some(e=>e.top!==e.bottom&&zn(e)))?`InvalidDataSet`:`Success`}function ld(e){return e.labelRange&&!kc.test(e.labelRange||``)?`InvalidLabelRange`:`Success`}function ud(e,t,n){if(!n||!e)return!1;if(!t)return!0;let r=Vn(t.dataRange.zone);return!(Vn(e.zone)<r)}function dd(e,t){let{x:n,y:r}=e.getMainViewportCoordinates(),{scrollX:i,scrollY:a}=e.getActiveSheetScrollInfo(),{width:o,height:s}=e.getVisibleRect(e.getActiveMainViewport());return{x:n+i+Math.max(0,(o-t.width)/2),y:r+a+Math.max(0,(s-t.height)/2)}}function fd(e){let t=!1,n=!1;if(`horizontal`in e&&e.horizontal)return{useLeftAxis:!0,useRightAxis:!1};for(let r of e.dataSets||[])r.yAxisId===`y1`?n=!0:t=!0;return t||=!n,{useLeftAxis:t,useRightAxis:n}}function pd(e,t,n=!1){return(r,i)=>{let a=e?.[i];return md({format:a,locale:t},n)(r)}}function md(e,t=!1){return n=>{if(n=Number(n),isNaN(n))return n;let{locale:r,format:i}=e;return _d(t?gs({value:n,format:i},r):z(n,{locale:r,format:!i&&Math.abs(n)>=1e3?`#,##`:i}))}}let hd=[{value:`left`,label:k(`Left`)},{value:`right`,label:k(`Right`)}];function gd(e,t){let n=[],r=Pt(t.map(e=>e.data.length));for(let t=0;t<=r;t++)n.push(e.next());return n}function _d(e,t=20){return e?e.length>t?e.substring(0,t)+`…`:e:``}function vd(e){return e===`x1`||e===`xMovingAverage`}let yd={id:`chartShowValuesPlugin`,afterDatasetsDraw(e,t,n){if(!n.showValues||!e._metasets?.[0]?.data)return;let r=e.ctx;switch(r.save(),r.textAlign=`center`,r.textBaseline=`middle`,r.miterLimit=1,n.type){case`pie`:wd(e,n,r);break;case`line`:case`scatter`:case`combo`:case`waterfall`:case`radar`:xd(e,n,r);break;case`bar`:n.horizontal?Cd(e,n,r):xd(e,n,r);break;case`pyramid`:Cd(e,n,r);break;case`calendar`:Sd(e,n,r);break;case`funnel`:Cd(e,n,r);break}r.restore()}};function bd(e,t,n,r){r.lineWidth=3,r.strokeText(e,t,n),r.lineWidth=1,r.fillText(e,t,n)}function xd(e,t,n){let r={};for(let i of e._metasets){if(vd(i.xAxisID)||i.hidden)continue;let a=e.scales[i.yAxisID];for(let o=0;o<i._parsed.length;o++){let s=i._parsed[o],c=Number(e.config.type===`radar`?s.r:s.y);if(isNaN(c))continue;let l=i.data[o],u=l.x,d=0;if(e.config.type===`line`||e.config.type===`radar`)d=c<0?l.y+10:l.y-10;else{let e=a.getPixelForValue(0),t=Math.abs(e-l.y),n=globalThis.Chart?.defaults.font.size??12;d=t<n?c<0?e+n/2:e-n/2:c<0?l.y-l.height/2:l.y+l.height/2}r[u]||(r[u]=[]);for(let e of r[u]||[])Math.abs(e-d)<13&&(d=c<0?e+13:e-13);r[u].push(d),n.fillStyle=l.options.backgroundColor,n.strokeStyle=t.background(Number(c),i,o)||`#ffffff`,bd(t.callback(Number(c),i,o),u,d,n)}}}function Sd(e,t,n){let r=e.chartArea.bottom,i=e.chartArea.top;for(let a of e._metasets){if(vd(a.xAxisID)||a.hidden)continue;let o=e.scales[a.yAxisID];for(let s=0;s<a._parsed.length;s++){let c=a._parsed[s],l=Number(e.config.type===`radar`?c.r:c.y);if(isNaN(l))continue;let u=a.data[s],d=u.x,f=0,p=o.getPixelForValue(0),m=Math.abs(p-u.y),h=globalThis.Chart?.defaults.font.size??12;f=m<h?l<0?p+h/2:p-h/2:l<0?u.y-u.height/2:u.y+u.height/2,f=Math.min(f,r),f=Math.max(f,i),n.strokeStyle=u.options.backgroundColor,n.fillStyle=t.background(Number(l),a,s)||`#ffffff`;let g=t.callback(Number(l),a,s),_=n.measureText(g);_.actualBoundingBoxAscent+_.actualBoundingBoxDescent+2>Math.abs(u.height)-2||bd(g,d,f,n)}}}function Cd(e,t,n){let r={};for(let i of e._metasets){if(vd(i.xAxisID))return;let a=e.scales[i.xAxisID].getPixelForValue(0);for(let e=0;e<i._parsed.length;e++){let o=Number(i._parsed[e].x);if(isNaN(o))continue;let s=t.callback(o,i,e),c=i.data[e],l=c.y,u=Ol(n,s,{fontSize:globalThis.Chart?.defaults.font.size??12},`px`),d=Math.abs(c.x-a),f;f=d<u?o<0?a-u/2-3:a+u/2+3:o<0?c.x+c.width/2:c.x-c.width/2,r[l]||(r[l]=[]);for(let e of r[l])Math.abs(e-f)<u&&(f=o<0?e-u-3:e+u+3);r[l].push(f),n.strokeStyle=c.options.backgroundColor,n.fillStyle=t.background(Number(o),i,e)||`#ffffff`,bd(s,f,l,n)}}}function wd(e,t,n){for(let r of e._metasets)for(let e=0;e<r._parsed.length;e++){let i=Number(r._parsed[e]);if(isNaN(i)||i===0)continue;let a=r.data[e],{startAngle:o,endAngle:s,innerRadius:c,outerRadius:l}=a,u=(o+s)/2,d=(c+l)/2,f=a.x+d*Math.cos(u),p=a.y+d*Math.sin(u),m=t.callback(i,r,e),h=globalThis.Chart?.defaults.font.size??12,g=Ol(n,m,{fontSize:h},`px`),_=l-c;if(g>=_||_<h)continue;let v=s-o,y=2*d*Math.tan(v/2);if(v<Math.PI/2&&(g>=y||y<h))continue;let ee=t.background(Number(i),r,e);n.fillStyle=od(ee),n.strokeStyle=ee||`#ffffff`,bd(m,f,p,n)}}let Td={showHeaders:!0,headerDesign:{align:`center`,fillColor:`#808080`,bold:!0,fontSize:15},showValues:!0,showLabels:!0,valuesDesign:{align:`left`,verticalAlign:`bottom`,fontSize:12},coloringOptions:{type:`categoryColor`,colors:[],useValueBasedGradient:!0}},Ed={second:1e3,minute:1e3*60,hour:1e3*3600,day:1e3*3600*24,month:1e3*3600*24*30,year:1e3*3600*24*365},Dd={inSeconds:function(e){return Math.floor(e/Ed.second)},inMinutes:function(e){return Math.floor(e/Ed.minute)},inHours:function(e){return Math.floor(e/Ed.hour)},inDays:function(e){return Math.floor(e/Ed.day)},inMonths:function(e){return Math.floor(e/Ed.month)},inYears:function(e){return Math.floor(e/Ed.year)}},Od=/^((d|dd|m|mm|yyyy|yy|hh|h|ss|a)(-|:|\s|\/))*(d|dd|m|mm|yyyy|yy|hh|h|ss|a)$/i;function kd(e,t,n){let r=Ad(t),i=Md(e,r,n),a={};return i&&(a[i]=r),{parser:r,displayFormats:a,unit:i??!1,tooltipFormat:r}}function Ad(e){let t=e.indexOf(`h`);return e=t>=0?e.slice(0,t).replace(/m/g,`M`)+e.slice(t):e.replace(/m/g,`M`),e.includes(`a`)||(e=e.replace(/h/g,`H`)),e}function jd(e){return e.includes(`s`)?`second`:e.includes(`m`)?`minute`:e.includes(`h`)||e.includes(`H`)?`hour`:e.includes(`d`)?`day`:e.includes(`M`)?`month`:`year`}function Md(e,t,n){let r=e.map(e=>Ci(e,n)?.jsDate);if(r.some(e=>e===void 0)||e.length<2)return;let i=r.map(e=>e.getTime()),a=Pt(i)-Ft(i),o=jd(t);return Ed.second>=Ed[o]&&Dd.inSeconds(a)<180?`second`:Ed.minute>=Ed[o]&&Dd.inMinutes(a)<180?`minute`:Ed.hour>=Ed[o]&&Dd.inHours(a)<96?`hour`:Ed.day>=Ed[o]&&Dd.inDays(a)<90?`day`:Ed.month>=Ed[o]&&Dd.inMonths(a)<36?`month`:`year`}function Nd(e,t){let n={},{trendDataSetsValues:r,locale:i,axisFormats:a}=t,o={stacked:e.stacked,locale:i};if(e.horizontal)n.x=Gd(e,`bottom`,`values`,{...o,format:a?.x}),n.y=Gd(e,`left`,`labels`,o);else{n.x=Gd(e,`bottom`,`labels`,o);let t={...o,format:a?.y};n.y=Gd(e,`left`,`values`,t);let r={...o,format:a?.y1};n.y1=Gd(e,`right`,`values`,r)}if(n=bt(n),r&&r.length&&r.some(C)){let e=Math.max(...r.map(e=>e?.length||0));n.x1={...n.x,labels:Array(e).fill(``),offset:!1,display:!1},n[Yu]={...n.x,offset:!0,display:!1}}return n}function Pd(e,t){let n=t.map(e=>e.label||``),r=od(e.background);return{y:{title:Wd(e.axesDesign?.y),stacked:!0,min:0,max:n.length,ticks:{stepSize:.5,color:r,callback:function(e,t,r){if(t%2!=0)return n[Math.floor((t-1)/2)]}},grid:{display:!1},border:{display:!1}},x:{title:Wd(e.axesDesign?.x),stacked:!0,grid:{display:!1},position:`top`,ticks:{color:r},border:{display:!1}}}}function Fd(e,t){let{dataSetsValues:n}=t;if(!n.length||e.legendPosition===`none`)return;let r=n.flatMap(e=>e.data).filter(C),i=Math.min(...r),a=Math.max(...r),o=[];return o=typeof e.colorScale==`object`?[e.colorScale.minColor,e.colorScale.midColor,e.colorScale.maxColor].filter(C):[...ri[e.colorScale??`oranges`]],{position:e.legendPosition===`right`?`right`:`left`,colorScale:o,fontColor:od(e.background),minValue:i,maxValue:a,locale:t.locale}}function Id(e,t){let{locale:n,axisType:r,trendDataSetsValues:i,labels:a,axisFormats:o}=t,s=o?.x,c=e.stacked,l={x:Gd(e,`bottom`,`labels`,{locale:n}),y:Gd(e,`left`,`values`,{locale:n,stacked:c,format:o?.y}),y1:Gd(e,`right`,`values`,{locale:n,stacked:c,format:o?.y1})};if(l=bt(l),r===`time`&&a&&s){let e={type:`time`,time:kd(a,s,n)};Object.assign(l.x,e),l.x.ticks.maxTicksLimit=15,delete l?.x?.ticks?.callback}else r===`linear`&&(l.x.type=`linear`,l.x.ticks.callback=e.humanize?e=>gs({value:e,format:s},n):e=>z(e,{format:s,locale:n}));if(i&&i.length&&i.some(C)&&(l.x1={...l.x,display:!1},l[Yu]={...l.x,display:!1},r===`category`||r===`time`)){let e=Math.max(...i.map(e=>e?.length||0));l.x1.type=`category`,l.x1.labels=S(0,e).map(e=>e.toString()),l.x1.offset=!1,l[Yu].type=`category`,l[Yu].offset=!1}return l}function Ld(e,t){let n=Id(e,t);return{...n,x:{...n.x,grid:{display:!0}}}}function Rd(e,t){let{locale:n,axisFormats:r}=t,i=r?.y||r?.y1;e.dataSets;let a={x:{...Gd(e,`bottom`,`labels`,{locale:n}),grid:{display:!1}},y:{position:e.verticalAxisPosition,ticks:{color:od(e.background),callback:md({locale:n,format:i},e.humanize)},grid:{lineWidth:e=>e.tick.value===0?2:1},title:Wd(e.axesDesign?.y)}},o=a?.y||a?.y1;return o&&(o.grid={lineWidth:e=>e.tick.value===0?2:1}),a}function zd(e,t){let{dataSetsValues:n}=t,r=Nd(e,t),i=r.x.ticks.callback;r.x.ticks.callback=e=>i(Math.abs(e));let a=Math.max(...n.map(e=>Math.max(...e.data.map(Math.abs))));return r.x.suggestedMin=-a,r.x.suggestedMax=a,r}function Bd(e,t){let{locale:n,axisFormats:r,dataSetsValues:i}=t,a=Math.min(...i.map(e=>Math.min(...e.data.filter(e=>!isNaN(e)))));return{r:{beginAtZero:!0,ticks:{callback:md({format:r?.r,locale:n},e.humanize),backdropColor:e.background||`#FFFFFF`},pointLabels:{color:od(e.background),callback:e=>_d(e)},suggestedMin:a<0?a-1:0}}}function Vd(e,t){let{locale:n,axisFormats:r,availableRegions:i}=t,a=Jd(e.legendPosition),o=e.region?i.find(t=>t.id===e.region):i[0],s=r?.y||r?.y1;return{projection:{projection:Ud(o?.defaultProjection||`mercator`),axis:`x`},color:{axis:`x`,display:e.legendPosition!==`none`,border:{color:fe},grid:{color:fe},ticks:{color:od(e.background),callback:md({locale:n,format:s},e.humanize)},legend:{position:a,align:a.includes(`right`)?`left`:`right`,margin:qd(e)},interpolate:Kd(e.colorScale??he),missing:e.missingValueColor||`#ffffff`}}}function Hd(e,t){let n=t.dataSetsValues[0];return{x:{display:!1},y:{grid:{offset:!1},ticks:{callback:function(e){return _d(this.getLabelForValue(e))}},border:{display:!1}},percentages:{position:`right`,border:{display:!1},ticks:{callback:function(e,r,i){let a=n.data?.[r],o=n.data?.[0];return!o||a===void 0?``:z(a/o,{format:`0%`,locale:t.locale})}},grid:{display:!1}}}}function Ud(e){return e===`conicConformal`?globalThis.ChartGeo.geoConicConformal().rotate([100,0]):e}function Wd(e){if(e?.title?.text){let{text:t,color:n,align:r,italic:i,bold:a}=e.title;return{display:!0,text:t,color:n,font:{style:i?`italic`:`normal`,weight:a?`bold`:`normal`,size:e.title.fontSize??12},align:r===`left`?`start`:r===`right`?`end`:`center`}}}function Gd(e,t,n,r){let{useLeftAxis:i,useRightAxis:a}=fd(e);if(t===`left`&&!i||t===`right`&&!a)return;let o=od(e.background),s;if(s=t===`bottom`?e.axesDesign?.x:t===`left`?e.axesDesign?.y:e.axesDesign?.y1,n===`values`){let n=!(t===`right`&&i);return{position:t,title:Wd(s),grid:{display:n},beginAtZero:!0,stacked:r?.stacked,ticks:{color:o,callback:md(r,e.humanize)}}}else return{ticks:{padding:5,color:o,callback:function(e,t,n){return _d(this.getLabelForValue(e))}},grid:{display:!1},stacked:r?.stacked,title:Wd(s)}}function Kd(e,t=0,n=1){if(t===n){let t=e.midColor??e.minColor;return e=>t}let r=[{value:t,color:e.minColor}];return e.midColor&&r.push({value:(t+n)/2,color:e.midColor}),r.push({value:n,color:e.maxColor}),ai(r)}function qd(e){switch(e.legendPosition){case`top`:case`right`:return{top:e.title.text?45:15,left:20,right:20};case`bottom`:case`left`:case`none`:return{left:20,right:20,bottom:10}}}function Jd(e){switch(e){case`top`:return`top-left`;case`right`:return`top-right`;case`bottom`:return`bottom-right`;case`left`:return`bottom-left`;case`none`:return`bottom-left`}}let Yd=`nullValue`;function Xd(e,t){let{dataSetsValues:n}=t,r=[],i=_f(e,n.length),a=[];for(let o in n){let{label:s,data:c,hidden:l}=n[o];s=e.dataSets?.[o].label||s;let u=i.next(),d={label:s,data:c,hidden:l,borderColor:e.background||`#FFFFFF`,borderWidth:+!!e.stacked,backgroundColor:u,yAxisID:e.horizontal?`y`:e.dataSets?.[o].yAxisId||`y`,xAxisID:`x`,barPercentage:.9,categoryPercentage:n.length>1?.8:1,borderRadius:2};r.push(d);let f=e.dataSets?.[o].trend,p=t.trendDataSetsValues?.[o];!f?.display||e.horizontal||!p||a.push(hf(d,f,p))}return r.push(...a),r}function Zd(e,t){let{labels:n,dataSetsValues:r}=t,i=r.map(e=>e.data).flat().filter(C),a=Math.max(...i),o=Math.min(...i),s=Kd(e.colorScale??he,o,a),c=[];for(let t of r)c.push({label:t.label,data:t.data.map(e=>1),backgroundColor:t.data.map(t=>t===void 0?e.missingValueColor||`#00000000`:s(t)),borderColor:e.background||`#FFFFFF`,borderSkipped:!1,borderWidth:1,barPercentage:1,categoryPercentage:1,values:t.data});return{labels:n,datasets:c}}function Qd(e,t){let{dataSetsValues:n,labels:r}=t,i=e.negativeValuesColor||`#EA6175`,a=e.positiveValuesColor||`#4EA7F2`,o=e.subTotalValuesColor||`#AAAAAA`,s=[],c=[],l={label:``,data:c,backgroundColor:s},u=[],d=0;for(let t of n)if(!t.hidden){for(let l=0;l<t.data.length;l++){let f=t.data[l];if(u.push(r[l]),isNaN(Number(f))){c.push([d,d]),s.push(``);continue}c.push([d,f+d]);let p=f>=0?a:i;l===0&&t===n[0]&&e.firstValueAsSubtotal&&(p=o),s.push(p),d+=f}e.showSubTotals&&(u.push(k(`Subtotal`)),c.push([0,d]),s.push(o))}return{datasets:[l],labels:u}}function $d(e,t){let{dataSetsValues:n,axisType:r,labels:i}=t,a=[],o=!!e.fillArea,s=!!e.stacked,c=[],l=_f(e,n.length);for(let u=0;u<n.length;u++){let{label:d,data:f,hidden:p}=n[u];d=e.dataSets?.[u].label||d;let m=l.next();r&&[`linear`,`time`].includes(r)&&(f=f.map((e,t)=>({x:i[t]||void 0,y:e})));let h={label:d,data:f,hidden:p,tension:0,borderColor:m,backgroundColor:o?Br(m,Ae):m,pointBackgroundColor:m,fill:o?gf(u,s):!1,pointRadius:e.hideDataMarkers?0:3,yAxisID:e.dataSets?.[u].yAxisId||`y`};a.push(h);let g=e.dataSets?.[u].trend,_=t.trendDataSetsValues?.[u];!g?.display||!_||c.push(hf(h,g,_))}return a.push(...c),a}function ef(e,t){let n=$d(e,t);for(let e of n)vd(e.xAxisID)||(e.showLine=!1);return n}function tf(e,t){let{dataSetsValues:n}=t,r=[],i=gd(new ei(Math.max(0,...n.map(e=>e?.data?.length??0))),n);for(let{label:t,data:a,hidden:o}of n){if(o)continue;let n={label:t,data:a,borderColor:e.background||`#FFFFFF`,backgroundColor:i,hoverOffset:10};r.push(n)}return r}function nf(e,t){let{dataSetsValues:n}=t,r=[],i=_f(e,n.length),a=[],o=n.filter((t,n)=>(e.dataSets?.[n].type??`line`)===`bar`);for(let s=0;s<n.length;s++){let{label:c,data:l,hidden:u}=n[s];c=e.dataSets?.[s].label||c;let d=e.dataSets?.[s],f=i.next(),p=d?.type??`line`,m={label:c,data:l,hidden:u,borderColor:f,backgroundColor:f,yAxisID:e.dataSets?.[s].yAxisId||`y`,xAxisID:`x`,type:p,order:p===`bar`?n.length+s:s,pointRadius:e.hideDataMarkers?0:3};m.type===`bar`&&(m.barPercentage=.9,m.categoryPercentage=o.length>1?.8:1,m.borderRadius=2),r.push(m);let h=e.dataSets?.[s].trend,g=t.trendDataSetsValues?.[s];!h?.display||!g||a.push(hf(m,h,g))}return r.push(...a),r}function rf(e,t){let{dataSetsValues:n}=t,r=[],i=e.fillArea??!1,a=_f(e,n.length);for(let t=0;t<n.length;t++){let{label:o,data:s,hidden:c}=n[t];e.dataSets?.[t]?.label&&(o=e.dataSets[t].label);let l=a.next(),u={label:o,data:s,hidden:c,borderColor:l,backgroundColor:l,pointRadius:e.hideDataMarkers?0:3};i&&(u.backgroundColor=Br(l,Ae),u.fill=`start`),r.push(u)}return r}function af(e,t){let{availableRegions:n,dataSetsValues:r,labels:i}=t,a=e.region||n[0]?.id,o=a?t.getGeoJsonFeatures(a):void 0,s={outline:o,showOutline:!!o,data:[]};if(o&&a){let e={};if(r[0])for(let n=0;n<r[0].data.length;n++){if(!i[n]||r[0].data[n]===void 0)continue;let o=t.geoFeatureNameToId(a,i[n]);o&&(e[o]={value:r[0].data[n],label:i[n]})}for(let t of o)t.id&&s.data.push({feature:{...t,properties:{name:e[t.id]?.label}},value:e[t.id]?.value})}return[s]}function of(e,t){let n=t.dataSetsValues[0],r=t.labels;if(!n)return[];let{label:i,data:a}=n;return i=e.dataSets?.[0].label||i,[{label:i,data:a.map(e=>e<=0?[0,0]:[-e,e]),backgroundColor:sf(r,e.funnelColors),yAxisID:`y`,xAxisID:`x`,barPercentage:1,categoryPercentage:1,borderColor:e.background||`#FFFFFF`,borderWidth:3}]}function sf(e,t){let n=new ei(e.length,t);return e.map(()=>n.next())}function cf(e,t){let{dataSetsValues:n,labels:r}=t,i=ff(uf(n,r)),a=i[0]||[],o=new ei(a.length,e.groupColors||[]),s=a.map(e=>({label:e.label,color:o.next()})),c=[];for(let t=i.length-1;t>=0;t--){let n={groupColors:s,parsing:{key:`value`},data:i[t],borderColor:t=>{let n=t.type===`data`?t.raw:void 0;return!n||n.label===`nullValue`?ue:e.background||`#FFFFFF`},backgroundColor:e=>{let t=e.type===`data`?e.raw:void 0;if(!t||t.label===`nullValue`)return ue;let n=t.groups[0];return s.find(e=>e.label===n)?.color},hoverOffset:10};c.push(n)}return c}function lf(e,t){let n=[],r=Math.max(...e.map(e=>e.data.length));for(let i=0;i<r;i++){n[i]={};for(let t=0;t<e.length;t++){let r=e[t].data[i]===null?Yd:String(e[t].data[i]);n[i][t]=r}n[i].value=Number(t[i])}return n}function uf(e,t){return df(lf(e,t),0,e.length,[])}function df(e,t,n,r){if(t>=n)return[];let i=Object.groupBy(e,e=>e[t]);return Object.keys(i).map(e=>{let a=i[e]?.reduce((e,t)=>e+Number(t.value),0)||0,o=[...r,e];return{label:e,value:a,children:df(i[e]||[],t+1,n,[...r,e]),groups:o,depth:t}}).sort((e,t)=>t.value-e.value)}function ff(e){let t=[],n=[...e];for(;n.length>0;){let e=n.shift();e&&(t[e.depth]||(t[e.depth]=[]),t[e.depth].push(e),e.children&&n.push(...e.children))}return t}function pf(e,t){let{dataSetsValues:n,labels:r,locale:i,axisFormats:a}=t,o={locale:i,format:a?.y};if(n.length===0)return[];let s=uf(n,r).sort((e,t)=>t.value-e.value),c=vf(e,s),l=[],u=Math.max(...n.map(e=>e.data.length));for(let e=0;e<u;e++){l[e]={};for(let t=0;t<n.length;t++)l[e][t]=n[t].data[e]?String(n[t].data[e]):void 0;l[e].value=Number(r[e])}let d=e.showLabels??Td.showLabels,f=e.showValues??Td.showValues,p=e.coloringOptions||Td.coloringOptions,m;return p?.type===`colorScale`&&(m=yf(s,p)),[{data:[],tree:l,labels:{display:d||f,overflow:`hidden`,...mf(e.valuesDesign,Td.valuesDesign),formatter:e=>[d?e.raw.g:void 0,f?z(e.raw.v,o):void 0].filter(C)},captions:{display:e.showHeaders??Td.showHeaders,padding:6,...mf(e.headerDesign,Td.headerDesign)},key:`value`,groups:S(0,n.length).map(e=>String(e)),borderWidth:0,spacing:1,displayMode:`headerBoxes`,groupColors:c,backgroundColor:t=>{if(t.type!==`data`)return`transparent`;if(!t.raw.isLeaf)return e.headerDesign?.fillColor||Td.headerDesign?.fillColor;if(p.type===`colorScale`)return m?.(t.raw.v)||`#FF0000`;if(p.type===`categoryColor`)return bf(t,s,p,c);throw Error(`Unsupported coloring option type}`)}}]}function mf(e,t){let n=e=>{let t=e.element.options.backgroundColor;return kr(t)>.7?`#666666`:`#FFFFFF`};return{align:e?.align??t?.align,position:e?.verticalAlign??t?.verticalAlign,color:e?.color||n,hoverColor:e?.color||n,font:{weight:e?.bold??t?.bold?`bold`:`normal`,style:e?.italic??t?.italic?`italic`:`normal`,size:e?.fontSize??t?.fontSize}}}function hf(e,t,n){let r=Mr(e.backgroundColor);r.a=1;let i=t.color||Vr(jr(r),.5);return{type:`line`,xAxisID:t.type===`trailingMovingAverage`?Yu:`x1`,yAxisID:e.yAxisID,label:e.label?k(`Trend line for %s`,e.label):``,data:n,order:-1,showLine:!0,pointRadius:0,backgroundColor:i,borderColor:i,borderDash:[5,5],borderWidth:void 0,fill:!1,pointBackgroundColor:i}}function gf(e,t){return t?e===0?`origin`:`-1`:`origin`}function _f(e,t){return new ei(t,e.dataSets?.map(e=>e.backgroundColor)||[])}function vf(e,t){let n=e.coloringOptions?.type===`categoryColor`?e.coloringOptions.colors:[],r=new ei(t.length,n);return t.map(e=>({label:e.label,color:r.next()}))}function yf(e,t){if(e.length===0)return;let n=ff(e),r=n[n.length-1],i=Math.min(...r.map(e=>e.value)),a=Math.max(...r.map(e=>e.value));if(Number.isFinite(i)&&Number.isFinite(a)){let e=[{value:i,color:t.minColor}];if(t.midColor){let n=(i+a)/2;e.push({value:n,color:t.midColor})}return e.push({value:a,color:t.maxColor}),ai(e)}}function bf(e,t,n,r){let i=e.raw._data.children[0][0],a=r.find(e=>e.label===i)?.color;if(!a||!n.useValueBasedGradient)return a||`#FF0000`;let o=t.find(e=>e.label===i);if(!o||!o.children.length)return a;let s=ff(o.children),c=s[s.length-1],l=Math.max(...c.map(e=>e.value)),u=Math.min(...c.map(e=>e.value));return u===l||!isFinite(u)||!isFinite(l)?a:Vr(a,((Number(e.raw.v)||0)-l)/(u-l)*.5)}let xf={id:`sunburstHoverPlugin`,afterEvent(e,t,n){if(!n.enabled)return;let r=e.getActiveElements(),i=r.map(e=>({datasetIndex:e.datasetIndex,index:e.index}));for(let t of r){let n=e.data.datasets[t.datasetIndex].data[t.index];for(let t=0;t<e.data.datasets.length;t++){let r=e.data.datasets[t];for(let e=0;e<r.data.length;e++){let a=r.data[e];Sf(n.groups,a.groups)&&i.push({datasetIndex:t,index:e})}}}i=i.filter(t=>{let{datasetIndex:n,index:r}=t;return e.data.datasets[n].data[r].label!==Yd}),e.setActiveElements(i);for(let t of e.getSortedVisibleDatasetMetas())for(let e of t.data){let t=e.$context,{datasetIndex:n,index:r,dataset:a,raw:o}=t;if(o.label===`nullValue`)continue;let s=typeof a.backgroundColor==`function`?a.backgroundColor(t):a.backgroundColor;i.length&&!i.some(e=>e.datasetIndex===n&&e.index===r)?e.options.backgroundColor=Vr(s,.5):e.options.backgroundColor=s}}};function Sf(e,t){return t.length>e.length&&e.every((e,n)=>e===t[n])}let Cf={id:`sunburstLabelsPlugin`,afterDatasetsDraw(e,t,n){if(!n.showValues&&!n.showLabels||e.config.type!==`doughnut`)return;let r=e.ctx;wf(e,n,r)}};function wf(e,t,n){let r=t.style,i=r.fontSize||13,a=i+3;for(let o of e._metasets)for(let s=0;s<o._dataset.data.length;s++){let c=o._dataset.data[s];if(c.label===`nullValue`)continue;let l=[t.showLabels?c.label:void 0,t.showValues?t.callback(c.value,`y`):void 0].filter(C),u=o.data[s],{startAngle:d,endAngle:f,innerRadius:p,outerRadius:m,circumference:h}=u,g=u.options.offset/4,_=g*(1-Math.sin(Math.min(Math.PI,h||0)));p+=_,m+=_;let v=(d+f)/2,y=(p+m)/2,ee=(m-p)*.9,te=f-d;if((te>=Math.PI?m:Math.sin(te/2)*p*2)<l.length*a)continue;n.save();let ne={x:Math.cos(v)*g,y:Math.sin(v)*g},re=e.chartArea.left+e.chartArea.width/2+ne.x,ie=e.chartArea.top+e.chartArea.height/2+ne.y;n.translate(re,ie);let ae;v>Math.PI/2?(n.rotate(v-Math.PI),ae=-y):(ae=y,n.rotate(v));let oe=u.options.backgroundColor,se=kr(oe)>.7?`#666666`:`#FFFFFF`;n.fillStyle=r.textColor||se,n.textAlign=`center`,n.textBaseline=`middle`,n.font=El(i,r.bold,r.italic);let ce=-((l.length-1)*a)/2;for(let e=0;e<l.length;e++){let t=Wl(n,ee,l[e],r,`px`);n.fillText(t,ae,ce+e*a)}n.restore()}}let Tf={id:`waterfallLinesPlugin`,beforeDraw(e,t,n){if(!n.showConnectorLines)return;let r=e._metasets?.[0]?.data;if(!r)return;let i=e.ctx;i.save(),i.setLineDash([3,2]);for(let e=0;e<r.length;e++){let t=r[e];if(t.height===0)continue;let n=Df(r,e);if(!n)break;let a=Ef(t),o=Ef(n),s=t.$context.raw,c=s[1]-s[0],l=Math.round(c<0?a.bottom-1:a.top),u=Math.round(a.right),d=Math.round(o.left);i.strokeStyle=`#999`,i.beginPath(),i.moveTo(u+1,l+.5),i.lineTo(d,l+.5),i.stroke()}i.restore()}};function Ef(e){let t=e.base<e.y;return{left:e.x-e.width/2,right:e.x+e.width/2,bottom:t?e.base+e.height:e.y+e.height,top:t?e.base:e.y}}function Df(e,t){return e.find((e,n)=>n>t&&e.height!==0)}let Of={id:`zoomWindowPlugin`,afterDatasetsDraw:function(e,t,n){if(!n.getLowerBound||!n.getUpperBound)return;let{ctx:r,chartArea:{left:i,right:a,top:o,bottom:s}}=e,c=n.getLowerBound()??i,l=n.getUpperBound()??a;c>l&&([c,l]=[l,c]),c=Math.max(i,c),l=Math.min(a,l),c===i&&--c,l===a&&(l+=1),r.save(),r.fillStyle=`rgba(255,255,255,0.5)`,r.beginPath(),r.rect(i,s,c-i,o-s),r.rect(l,s,a-l,o-s),r.fill(),r.beginPath(),r.strokeStyle=`#bbb`,r.rect(c,s,l-c,o-s),r.stroke(),r.lineWidth=2,r.beginPath(),r.moveTo(c-3,(o+s)/2-7),r.lineTo(c-3,(o+s)/2+7),r.stroke(),r.beginPath(),r.moveTo(l+3,(o+s)/2-7),r.lineTo(l+3,(o+s)/2+7),r.stroke(),r.restore()}};ql.add(`chartShowValuesPlugin`,{register:e=>e.register(yd),unregister:e=>e.unregister(yd)}),ql.add(`waterfallLinesPlugin`,{register:e=>e.register(Tf),unregister:e=>e.unregister(Tf)}),ql.add(`funnelController`,{register:e=>e.register(eu()),unregister:e=>e.unregister(eu())}),ql.add(`funnelElement`,{register:e=>e.register(tu()),unregister:e=>e.unregister(tu())}),ql.add(`funnelTooltipPositioner`,{register:e=>e.Tooltip.positioners.funnelTooltipPositioner=ru,unregister:e=>e.Tooltip.positioners.funnelTooltipPositioner=void 0}),ql.add(`sunburstLabelsPlugin`,{register:e=>e.register(Cf),unregister:e=>e.unregister(Cf)}),ql.add(`sunburstHoverPlugin`,{register:e=>e.register(xf),unregister:e=>e.unregister(xf)}),ql.add(`chartColorScalePlugin`,{register:e=>e.register($l),unregister:e=>e.unregister($l)}),ql.add(`calendarController`,{register:e=>e.register(Ql()),unregister:e=>e.unregister(Ql())}),ql.add(`zoomWindowPlugin`,{register:e=>e.register(Of),unregister:e=>e.unregister(Of)});var kf=class extends t.Component{static template=`o-spreadsheet-ChartJsComponent`;static props={chartId:String,isFullScreen:{type:Boolean,optional:!0}};canvas=(0,t.useRef)(`graphContainer`);chart;currentRuntime;animationStore;currentDevicePixelRatio=window.devicePixelRatio;get background(){return this.chartRuntime.background}get canvasStyle(){return`background-color: ${this.background}`}get chartRuntime(){let e=this.env.model.getters.getChartRuntime(this.props.chartId);if(!(`chartJsConfig`in e))throw Error(`Unsupported chart runtime`);return e}setup(){this.shouldAnimate&&(this.animationStore=D(Zl)),(0,t.onMounted)(()=>{Yl();let e=this.chartRuntime;this.currentRuntime=e,this.createChart(b(e))}),(0,t.onWillUnmount)(this.unmount.bind(this)),(0,t.useEffect)(()=>{let e=this.chartRuntime;e===this.currentRuntime?this.currentDevicePixelRatio!==window.devicePixelRatio&&(this.currentDevicePixelRatio=window.devicePixelRatio,this.updateChartJs(b(this.currentRuntime))):(e.chartJsConfig.type===this.currentRuntime.chartJsConfig.type?this.updateChartJs(b(e)):(this.chart?.destroy(),this.createChart(b(e))),this.currentRuntime=e)})}unmount(){this.chart?.destroy()}get shouldAnimate(){return this.env.model.getters.isDashboard()}createChart(e){if(!globalThis.Chart)throw Error(`Chart.js library is not loaded`);let t=e.chartJsConfig;if(this.shouldAnimate&&this.animationStore){let e=this.env.model.getters.getChart(this.props.chartId)?.type;e&&this.animationStore.animationPlayed[this.animationChartId]!==e&&(t=this.enableAnimationInChartData(t),this.animationStore.disableAnimationForChart(this.animationChartId,e))}let n=this.canvas.el.getContext(`2d`);this.chart=new globalThis.Chart(n,t)}updateChartJs(e){let t=e.chartJsConfig;if(this.shouldAnimate){let e=this.env.model.getters.getChart(this.props.chartId)?.type;e&&this.hasChartDataChanged()&&this.animationStore&&(t=this.enableAnimationInChartData(t),this.animationStore.disableAnimationForChart(this.animationChartId,e))}t.data&&t.data.datasets?(this.chart.data=t.data,t.options?.plugins?.title&&(this.chart.config.options.plugins.title=t.options.plugins.title)):this.chart.data.datasets=[],this.chart.config.options=t.options,this.chart.update()}hasChartDataChanged(){return!w(this.getChartDataInRuntime(this.currentRuntime),this.getChartDataInRuntime(this.chartRuntime))}enableAnimationInChartData(e){return{...e,options:{...e.options,animation:{animateRotate:!0}}}}getChartDataInRuntime(e){let t=e.chartJsConfig.data;return{labels:t.labels,dataset:t.datasets.map(e=>({data:e.data,label:e.label,tree:e.tree}))}}get animationChartId(){return this.props.isFullScreen?this.props.chartId+`-fullscreen`:this.props.chartId}},Af=class{sheetId;title;getters;humanize;constructor(e,t,n){this.title=e.title,this.sheetId=t,this.getters=n,this.humanize=e.humanize??!0}static validateChartDefinition(e,t){throw Error(`This method should be implemented by sub class`)}static transformDefinition(e,t,n){throw Error(`This method should be implemented by sub class`)}static getDefinitionFromContextCreation(e){throw Error(`This method should be implemented by sub class`)}getCommonDataSetAttributesForExcel(e,t,n){return{dataSets:t.map(e=>rd(this.getters,e)).filter(e=>e.range!==``&&e.range!==A.InvalidReference),labelRange:id(this.getters,e,n)}}};function jf(e,t,n,r,i){if(!e)return``;if(n===`text`||t?.type!==`number`||e.type!==`number`)return r?gs(e,i):e.formattedValue;let{value:a,format:o}=e;return n===`progress`?(a=t.value/a,o=`0.0%`):(a=Math.abs(t.value-a),n===`percentage`&&a!==0&&(a/=e.value),n===`percentage`&&(o=`0.0%`),o||(a=Math.round(a*100)/100)),r?gs({value:a,format:o},i):z(a,{format:o,locale:i})}function Mf(e,t,n){return e?t?gs(e,n):e.formattedValue??String(e.value??``):``}function Nf(e,t,n,r,i){if(t===`text`||t===`progress`||e?.type!==`number`||n?.type!==`number`)return;let a=n.value-e.value;if(a>0)return r;if(a<0)return i}function Pf(e,t,n){if(n===`text`||e?.type!==`number`||t?.type!==`number`)return`neutral`;let r=t.value-e.value;return r>0?`up`:r<0?`down`:`neutral`}function Ff(e){return e.keyValue&&!kc.test(e.keyValue)?`InvalidScorecardKeyValue`:`Success`}function If(e){return e.baseline&&!kc.test(e.baseline)?`InvalidScorecardBaseline`:`Success`}let Lf=globalThis.Path2D,Rf=Lf&&new Lf(`M8.6 4.8a.5.5 0 0 1 0 .75l-3.9 3.9a.5 .5 0 0 1 -.75 0l-3.8 -3.9a.5 .5 0 0 1 0 -.75l.4-.4a.5.5 0 0 1 .75 0l2.3 2.4v-5.7c0-.25.25-.5.5-.5h.6c.25 0 .5.25.5.5v5.8l2.3 -2.4a.5.5 0 0 1 .75 0z`),zf=Lf&&new Lf(`M8.7 5.5a.5.5 0 0 0 0-.75l-3.8-4a.5.5 0 0 0-.75 0l-3.8 4a.5.5 0 0 0 0 .75l.4.4a.5.5 0 0 0 .75 0l2.3-2.4v5.8c0 .25.25.5.5.5h.6c.25 0 .5-.25.5-.5v-5.8l2.2 2.4a.5.5 0 0 0 .75 0z`);var Bf=class e extends Af{keyValue;keyDescr;baseline;baselineMode;baselineDescr;progressBar=!1;background;baselineColorUp;baselineColorDown;fontColor;humanize;type=`scorecard`;constructor(e,t,n){super(e,t,n),this.keyValue=Qc(n,t,e.keyValue),this.keyDescr=e.keyDescr,this.baseline=Qc(n,t,e.baseline),this.baselineMode=e.baselineMode,this.baselineDescr=e.baselineDescr,this.background=e.background,this.baselineColorUp=e.baselineColorUp??`#43C5B1`,this.baselineColorDown=e.baselineColorDown??`#EA6175`,this.humanize=e.humanize??!0}static validateChartDefinition(e,t){return e.checkValidations(t,Ff,If)}static getDefinitionFromContextCreation(e){return{background:e.background,type:`scorecard`,keyValue:e.range?.[0]?.dataRange,title:e.title||{text:``},baselineMode:De,baselineColorUp:Oe,baselineColorDown:ke,baseline:e.auxiliaryRange||``,humanize:e.humanize}}static transformDefinition(e,t,n){let r,i;if(t.baseline){let{changeType:i,range:a}=Gu(e,t.baseline,n);i!==`REMOVE`&&(r=a)}if(t.keyValue){let{changeType:r,range:a}=Gu(e,t.keyValue,n);r!==`REMOVE`&&(i=a)}return{...t,baseline:r,keyValue:i}}duplicateInDuplicatedSheet(t){let n=$u(this.sheetId,t,this.baseline),r=$u(this.sheetId,t,this.keyValue);return new e(this.getDefinitionWithSpecificRanges(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificRanges(this.baseline,this.keyValue,t),t,this.getters)}getDefinition(){return this.getDefinitionWithSpecificRanges(this.baseline,this.keyValue)}getContextCreation(){return{...this,range:this.keyValue?[{dataRange:this.getters.getRangeString(this.keyValue,this.sheetId)}]:void 0,auxiliaryRange:this.baseline?this.getters.getRangeString(this.baseline,this.sheetId):void 0}}getDefinitionWithSpecificRanges(e,t,n){return{baselineColorDown:this.baselineColorDown,baselineColorUp:this.baselineColorUp,baselineMode:this.baselineMode,title:this.title,type:`scorecard`,background:this.background,baseline:e?this.getters.getRangeString(e,n||this.sheetId):void 0,baselineDescr:this.baselineDescr,keyValue:t?this.getters.getRangeString(t,n||this.sheetId):void 0,keyDescr:this.keyDescr,humanize:this.humanize}}getDefinitionForExcel(){}updateRanges({applyChange:t}){let n=ed(this.baseline,t),r=ed(this.keyValue,t);return this.baseline===n&&this.keyValue===r?this:new e(this.getDefinitionWithSpecificRanges(n,r),this.sheetId,this.getters)}};function Vf(e,t,n=1){let r=t.getContext(`2d`);if(!r)throw Error(`Unable to retrieve 2D context from canvas`);let i=typeof globalThis.devicePixelRatio==`number`?globalThis.devicePixelRatio:1;t.width=i*e.canvas.width*n,t.height=i*e.canvas.height*n,r.scale(i*n,i*n);let a=e.canvas.width-20;if(r.fillStyle=e.canvas.backgroundColor,r.fillRect(0,0,e.canvas.width,e.canvas.height),e.title){r.font=e.title.style.font,r.fillStyle=e.title.style.color;let t=r.textBaseline;r.textBaseline=`middle`,r.fillText(Hl(r,e.title.text,a-e.title.position.x),e.title.position.x,e.title.position.y),r.textBaseline=t}if(e.baseline&&(r.font=e.baseline.style.font,r.fillStyle=e.baseline.style.color,Ul(r,e.baseline.text,e.baseline.position,e.baseline.style.underline,e.baseline.style.strikethrough)),e.baselineArrow&&e.baselineArrow.style.size>0&&Lf){r.save(),r.fillStyle=e.baselineArrow.style.color,r.translate(e.baselineArrow.position.x,e.baselineArrow.position.y);let t=e.baselineArrow.style.size/10;switch(r.scale(t,t),e.baselineArrow.direction){case`down`:r.fill(Rf);break;case`up`:r.fill(zf);break}r.restore()}if(e.baselineDescr){let t=e.baselineDescr;r.font=t.style.font,r.fillStyle=t.style.color,r.fillText(Hl(r,t.text,a-t.position.x),t.position.x,t.position.y)}if(e.key&&(r.font=e.key.style.font,r.fillStyle=e.key.style.color,Ul(r,Hl(r,e.key.text,a-e.key.position.x),e.key.position,e.key.style.underline,e.key.style.strikethrough)),e.keyDescr){let t=e.keyDescr;r.font=e.keyDescr?.style.font??t.style.font,r.fillStyle=t.style.color,r.fillText(Hl(r,t.text,a-t.position.x),t.position.x,t.position.y)}if(e.progressBar){if(r.fillStyle=e.progressBar.style.backgroundColor,r.beginPath(),r.roundRect(e.progressBar.position.x,e.progressBar.position.y,e.progressBar.dimension.width,e.progressBar.dimension.height,e.progressBar.dimension.height/2),r.fill(),r.fillStyle=e.progressBar.style.color,r.beginPath(),e.progressBar.value>0)r.roundRect(e.progressBar.position.x,e.progressBar.position.y,e.progressBar.dimension.width*Math.max(0,Math.min(1,e.progressBar.value)),e.progressBar.dimension.height,e.progressBar.dimension.height/2);else{let t=e.progressBar.dimension.width*Math.max(0,Math.min(1,-e.progressBar.value));r.roundRect(e.progressBar.position.x+e.progressBar.dimension.width-t,e.progressBar.position.y,t,e.progressBar.dimension.height,e.progressBar.dimension.height/2)}r.fill()}}function Hf(e,t){let n=``,r,i=t.getLocale();if(e.keyValue){let a={sheetId:e.keyValue.sheetId,col:e.keyValue.zone.left,row:e.keyValue.zone.top};r=t.getEvaluatedCell(a),n=Mf(r,e.humanize??!0,i)}let a,o=e.baseline;if(o){let e={sheetId:o.sheetId,col:o.zone.left,row:o.zone.top};a=t.getEvaluatedCell(e)}let{background:s,fontColor:c}=t.getStyleOfSingleCellChart(e.background,e.keyValue),l=jf(a,r,e.baselineMode,e.humanize??!0,i),u=e.baselineMode===`progress`&&$i(l,i)?N(l,i):0;return{title:{...e.title,text:e.title.text?t.dynamicTranslate(e.title.text):``},keyValue:n,keyDescr:e.keyDescr?.text?t.dynamicTranslate(e.keyDescr.text):``,baselineDisplay:l,baselineArrow:Pf(a,r,e.baselineMode),baselineColor:Nf(a,e.baselineMode,r,e.baselineColorUp,e.baselineColorDown),baselineDescr:e.baselineMode!==`progress`&&e.baselineDescr?.text?t.dynamicTranslate(e.baselineDescr.text):``,fontColor:c,background:s,baselineStyle:{...e.baselineMode!==`percentage`&&e.baselineMode!==`progress`&&o?t.getCellComputedStyle({sheetId:o.sheetId,col:o.zone.left,row:o.zone.top}):void 0,fontSize:e.baselineDescr?.fontSize,align:e.baselineDescr?.align},baselineDescrStyle:{textColor:e.baselineDescr?.color,...e.baselineDescr},keyValueStyle:{...e.keyValue?t.getCellComputedStyle({sheetId:e.keyValue.sheetId,col:e.keyValue.zone.left,row:e.keyValue.zone.top}):void 0,fontSize:e.keyDescr?.fontSize,align:e.keyDescr?.align},keyValueDescrStyle:{textColor:e.keyDescr?.color,...e.keyDescr},progressBar:e.baselineMode===`progress`?{value:u,color:u>0?e.baselineColorUp:e.baselineColorDown}:void 0}}let Uf=.05;function Wf(e,t){let n=e||``;return t&&n?` `+n:n}function Gf({width:e,height:t},n){return new Kf({width:e,height:t},n).computeDesign()}var Kf=class{runtime;context;width;height;constructor({width:e,height:t},n){if(this.runtime=n,this.width=e,this.height=t,typeof OffscreenCanvas>`u`)throw Error(`OffscreenCanvas is not supported in this environment`);let r=new globalThis.OffscreenCanvas(e,t).getContext(`2d`);if(!r)throw Error(`Unable to create scorecard measurement context`);this.context=r}computeDesign(){let e={canvas:{width:this.width,height:this.height,backgroundColor:this.backgroundColor}},t=this.getTextStyles(),n=0;if(this.title){let r,i;switch({height:n,width:i}=this.getFullTextDimensions(this.title,t.title.font),this.runtime.title.align){case`center`:r=(this.width-i)/2;break;case`right`:r=this.width-i-20;break;default:r=20}e.title={text:this.title,style:t.title,position:{x:r,y:10+n/2}}}let r=t.baselineArrow?.size??0,{height:i,width:a}=this.getTextDimensions(this.baseline,t.baselineValue.font);this.baseline||(i=this.getTextDimensions(this.baselineDescr,t.baselineDescr.font).height);let o=this.getTextDimensions(this.baselineDescr,t.baselineDescr.font).width,s;switch(this.runtime.baselineStyle?.align){case`right`:s=this.width-20-o-a;break;case`left`:s=20+r;break;default:s=(this.width-a-o+r)/2}if(this.baseline&&(e.baseline={text:this.baseline,style:t.baselineValue,position:{x:s,y:this.keyValue?this.height*(1-Uf*(this.runtime.progressBar?1:2)):this.height-(this.height-n-i)/2-10}},t.baselineArrow&&!this.runtime.progressBar&&(e.baselineArrow={direction:this.baselineArrow,style:t.baselineArrow,position:{x:e.baseline.position.x-r,y:e.baseline.position.y-(i+r)/2}})),e.baseline&&this.baselineDescr){let n={x:e.baseline.position.x+a,y:e.baseline.position.y};e.baselineDescr={text:this.baselineDescr,style:t.baselineDescr,position:n}}let c=0;this.runtime.progressBar&&(c=this.height*.05,e.progressBar={position:{x:40,y:this.height*(1-2*Uf)-i-c},dimension:{height:c,width:this.width-80},value:this.runtime.progressBar.value,style:{color:this.runtime.progressBar.color,backgroundColor:this.secondaryFontColor}});let{width:l,height:u}=this.getFullTextDimensions(this.keyValue,t.keyValue.font),d=this.getTextDimensions(this.keyDescr,t.keyDescr.font).width,f;switch(this.runtime.keyValueStyle?.align){case`right`:f=this.width-20-d-l;break;case`left`:f=20;break;default:f=(this.width-l-d)/2}if(this.keyValue&&(e.key={text:this.keyValue,style:t.keyValue,position:{x:Math.max(20,f),y:this.height*(.5-Uf*2)+10/2+(n+u/2)/2}}),e.key&&this.keyDescr){let n={x:e.key.position.x+l,y:e.key.position.y};e.keyDescr={text:this.keyDescr,style:t.keyDescr,position:n}}return e}get title(){return this.runtime.title.text??``}get keyValue(){return this.runtime.keyValue}get keyDescr(){return Wf(this.runtime.keyDescr,this.keyValue)}get baseline(){return this.runtime.baselineDisplay}get baselineDescr(){return Wf(this.runtime.baselineDescr,this.baseline)}get baselineArrow(){return this.runtime.baselineArrow}get backgroundColor(){return this.runtime.background}get secondaryFontColor(){return sd(this.backgroundColor)}getTextDimensions(e,t){this.context.font=t;let n=this.context.measureText(e);return{width:n.width,height:n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}}getFullTextDimensions(e,t){this.context.font=t;let n=this.context.measureText(e);return{width:n.width,height:n.fontBoundingBoxAscent+n.fontBoundingBoxDescent}}getTextStyles(){let e=this.runtime.keyValueStyle?.fontSize??32,t=Math.floor(.9*e),n=this.runtime.baselineStyle?.fontSize??16,r=Math.floor(.9*n);return this.runtime.progressBar&&(n/=1.5),{title:{font:El(this.runtime.title.fontSize??14,this.runtime.title.bold,this.runtime.title.italic),color:this.runtime.title.color??this.secondaryFontColor},keyValue:{color:this.runtime.keyValueStyle?.textColor||this.runtime.fontColor,font:El(e,this.runtime.keyValueStyle?.bold,this.runtime.keyValueStyle?.italic),strikethrough:this.runtime.keyValueStyle?.strikethrough,underline:this.runtime.keyValueStyle?.underline},keyDescr:{color:this.runtime.keyValueDescrStyle?.textColor||this.runtime.fontColor,font:El(t,this.runtime.keyValueDescrStyle?.bold,this.runtime.keyValueDescrStyle?.italic),strikethrough:this.runtime.keyValueDescrStyle?.strikethrough,underline:this.runtime.keyValueDescrStyle?.underline},baselineValue:{font:El(n,this.runtime.baselineStyle?.bold,this.runtime.baselineStyle?.italic),strikethrough:this.runtime.baselineStyle?.strikethrough,underline:this.runtime.baselineStyle?.underline,color:this.runtime.baselineColor||this.runtime.baselineStyle?.textColor||this.secondaryFontColor},baselineDescr:{font:El(r,this.runtime.baselineDescrStyle?.bold,this.runtime.baselineDescrStyle?.italic),strikethrough:this.runtime.baselineDescrStyle?.strikethrough,underline:this.runtime.baselineDescrStyle?.underline,color:this.runtime.baselineDescrStyle?.textColor??this.secondaryFontColor},baselineArrow:this.baselineArrow===`neutral`||this.runtime.progressBar?void 0:{size:this.keyValue?.8*n:0,color:this.runtime.baselineColor||this.runtime.baselineStyle?.textColor||this.secondaryFontColor}}}};let qf=/Mac/i,Jf=!1;function Yf(){let e=document.createElement(`div`);e.setAttribute(`style`,`width:10px;height:1px;zoom:2;position:absolute;z-index:-10000`),document.body.appendChild(e),Jf=e.getBoundingClientRect().width!==20,document.body.removeChild(e)}(0,t.whenReady)(Yf);let Xf=[`Shift`,`Control`,`Alt`,`Meta`];function Zf(e,t){return e?!!t.target&&e.contains(t.target):!1}function Qf(e=1){let t=document.querySelector(`.o-grid-overlay`),n=t&&$f(t,e);if(!n)throw Error(`Can't find spreadsheet position`);return n}function $f(e,t){let n=e.closest(`.o-zoomable`),r,i=1;n?(r=n,i=Jf?t:1):r=e;let a=r.getBoundingClientRect();return{x:a.x*i,y:a.y*i,width:a.width*i,height:a.height*i}}function ep(e){return e.el?tp(e.el):{x:0,y:0,width:0,height:0}}function tp(e){let t=e.getBoundingClientRect();return{x:t.x,y:t.y,width:t.width,height:t.height}}function*np(e){if(yield e,e.hasChildNodes())for(let t of e.childNodes)yield*np(t)}function rp(){return Array.from(document.querySelectorAll(`.o-spreadsheet .o-menu`))}function ip(e){let{startElement:t,endElement:n,startSelectionOffset:r,endSelectionOffset:i}=ap(e);return{start:op(e,t,r),end:op(e,n,i)}}function ap(e){let t=document.getSelection();return{startElement:t.anchorNode||e,startSelectionOffset:t.anchorOffset,endElement:t.focusNode||e,endSelectionOffset:t.focusOffset}}function op(e,t,n){let r=0,i=np(e),a=i.next(),o=!0;for(;!a.done&&a.value!==t;)a.value.hasChildNodes()||a.value.textContent&&(r+=a.value.textContent.length),(a.value.nodeName===`P`||a.value.nodeName===`DIV`&&a.value!==e)&&(o?o=!1:r++),a=i.next();if(a.value!==t)return 0;if(!a.value.hasChildNodes())r+=n;else{let e=[...a.value.childNodes].slice(0,n);r+=e.reduce((t,n,r)=>{if(n.textContent!==null){let i=n.textContent.length;return n.nodeName===`P`&&r!==e.length-1&&i++,t+i}else return t},0)}return t.nodeName===`P`&&!o&&t.textContent===``&&r++,r}let sp=/^[a-zA-Z]$/;function cp(e,t=`key`){let n=``;Xf.includes(e.key)||(up(e)&&(n+=`Ctrl+`),e.altKey&&(n+=`Alt+`),e.shiftKey&&(n+=`Shift+`));let r=t===`key`?e.key:e.code;return n+=sp.test(r)?r.toUpperCase():r,n}function lp(){return!!qf.test(navigator.userAgent)}function up(e){return lp()||gp()?e.metaKey:e.ctrlKey}function dp(e){return e.button===1||up(e)&&e.button===0}function fp(e,t){let n=document.createElement(`a`);n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function pp(){return/Firefox/i.test(navigator.userAgent)}function mp(){return navigator.maxTouchPoints||1}function hp(){return/Android/i.test(navigator.userAgent)}function gp(){return/(iPad|iPhone|iPod)/i.test(navigator.userAgent)||navigator.platform===`MacIntel`&&mp()>1}function _p(){return/(webOS|BlackBerry|Windows Phone)/i.test(navigator.userAgent)}function vp(){return hp()||gp()||_p()}function yp(e,t,n){let r=e.model.getters.getViewportZoomLevel();if(n===void 0&&(n=Sp(t,r)),!n)return bp(t);let i=t.clientX-n.x,a=t.clientY-n.y,o=i/r,s=a/r;return{ev:t,clientX:t.clientX-i+o,clientY:t.clientY-a+s,offsetX:o,offsetY:s}}function bp(e){return{ev:e,clientX:e.clientX,clientY:e.clientY,offsetX:e.offsetX,offsetY:e.offsetY}}function xp(e,t){return{height:t.height*e,width:t.width*e,x:t.x*e,y:t.y*e}}function Sp(e,t){let n=e.target;return!n||!(`classList`in n)||!(n instanceof Element)?null:$f(n,t)}var Cp=class extends t.Component{static template=`o-spreadsheet-ScorecardChart`;static props={chartId:String,isFullScreen:{type:Boolean,optional:!0}};canvas=(0,t.useRef)(`chartContainer`);get runtime(){return this.env.model.getters.getChartRuntime(this.props.chartId)}get title(){let e=this.env.model.getters.getChartDefinition(this.props.chartId).title.text;return e?this.env.model.getters.dynamicTranslate(e):``}setup(){(0,t.useEffect)(this.createChart.bind(this),()=>{let e=this.canvas.el.getBoundingClientRect();return[e.width,e.height,this.runtime,this.canvas.el,window.devicePixelRatio]})}createChart(){let e=this.canvas.el,t=this.env.model.getters.getViewportZoomLevel();Vf(Gf(xp(1/t,e.getBoundingClientRect()),this.runtime),e,t)}};function V(e){return e=wr(e).replace(`#`,``),e.length===8?e.slice(6)+e.slice(0,6):e}let wp=`#F3F2F1`;function Tp(e,t,n=1,r){let i=r??Ep(e),a=typeof globalThis.devicePixelRatio==`number`?globalThis.devicePixelRatio:1;e.width=i.width*a,e.height=i.height*a;let o=e.getContext(`2d`);if(!o)throw Error(`Unable to retrieve 2D context from canvas`);o.scale(a*n,a*n);let s=Mp({width:i.width/n,height:i.height/n,x:0,y:0},t,o);Op(o,s),Dp(o,s),Ap(o,s),kp(o,s),jp(o,s)}function Ep(e){if(e instanceof HTMLCanvasElement){let t=e.getBoundingClientRect();return{width:t.width,height:t.height}}return{width:e.width,height:e.height}}function Dp(e,t){e.save();let n=t.gauge,r=n.rect.x+n.rect.width/2,i=n.rect.y+n.rect.height,a=n.rect.height-n.arcWidth/2;if(a<0)return;let o=n.percentage===1?0:Math.PI*(1+n.percentage);e.strokeStyle=wp,e.beginPath(),e.lineWidth=n.arcWidth,e.arc(r,i,a,o,0),e.stroke(),e.strokeStyle=n.color,e.beginPath(),e.arc(r,i,a,Math.PI,o),e.stroke(),e.restore()}function Op(e,t){e.save(),e.fillStyle=t.backgroundColor,e.fillRect(0,0,t.width,t.height),e.restore()}function kp(e,t){for(let n of[t.minLabel,t.maxLabel,t.gaugeValue])e.save(),e.textAlign=`center`,e.fillStyle=n.color,e.font=`${n.fontSize}px ${we}`,e.fillText(n.label,n.textPosition.x,n.textPosition.y),e.restore()}function Ap(e,t){let{x:n,y:r,width:i,height:a}=t.gauge.rect;for(let o of t.inflectionValues){e.save(),e.translate(n+i/2-.5,r+a-.5),e.rotate(Math.PI/2-o.rotation),e.lineWidth=2,e.strokeStyle=sd(t.backgroundColor)+`aa`,e.beginPath(),e.moveTo(0,-(a-t.gauge.arcWidth)),e.lineTo(0,-a-3),e.stroke(),e.textAlign=`center`,e.font=`${o.fontSize}px ${we}`,e.fillStyle=o.color;let s=-a-6-o.offset;e.fillText(o.label,0,s),e.restore()}}function jp(e,t){e.save();let n=t.title;e.font=El(n.fontSize,n.bold,n.italic),e.textBaseline=`middle`,e.fillStyle=n.color,e.fillText(n.label,n.textPosition.x,n.textPosition.y),e.restore()}function Mp(e,t,n){let r=t.maxValue,i=t.minValue,a=Bp(t,`animated`),o=Np(e,t.title.text),s=o.width/6,c=a?(a-i.value)/(r.value-i.value):0,l={x:e.width/2,y:o.y+o.height-o.height/12},u=80;o.height<300&&(u*=o.height/300);let d=o.width/2,f=t.gaugeValue?.label||`-`;Ol(n,f,{fontSize:u},`px`)>d&&(u=Rl(d,u,e=>Ol(n,f,{fontSize:e},`px`)));let p={x:o.x+s/2,y:o.y+o.height+12},m={x:o.x+o.width-s/2,y:o.y+o.height+12},h=sd(t.background),g=Pp(t,o,h,n),_=0,v=0,y=0;switch(t.title.text&&({width:v,height:y}=jl(n,t.title.text,{fontSize:16,...t.title},`px`)),t.title.align){case`right`:_=e.width-v-20;break;case`center`:_=(e.width-v)/2;break;default:_=20;break}return{width:e.width,height:e.height,title:{label:t.title.text??``,fontSize:t.title.fontSize??16,textPosition:{x:_,y:15+y/2},color:t.title.color??h,bold:t.title.bold,italic:t.title.italic},backgroundColor:t.background,gauge:{rect:o,arcWidth:s,percentage:x(c,0,1),color:Fp(t)},inflectionValues:g,gaugeValue:{label:f,textPosition:l,fontSize:u,color:h},minLabel:{label:t.minValue.label,textPosition:p,fontSize:12,color:h},maxLabel:{label:t.maxValue.label,textPosition:m,fontSize:12,color:h}}}function Np(e,t){let n=t?25:0,r=e.height-20-n-10,i=e.width-60,a,o;return i>2*r?(a=2*r,o=r):(a=i,o=i/2),{x:30+(i-a)/2,y:n+10+(r-o)/2,width:a,height:o}}function Pp(e,t,n,r){let i=e.maxValue,a=e.minValue,o={x:t.x+t.width/2,y:t.y+t.height},s={fontSize:12},c=[],l=[];for(let u of e.inflectionValues){let e=(u.value-a.value)/(i.value-a.value),d=Ol(r,u.label,s,`px`),f=Math.PI-Math.PI*e,p=zp(f,t.height+6,o.x,o.y,d+2,12),m=l.some(e=>Rp(e,p))?12:0;l.push(p),c.push({rotation:f,label:u.label,fontSize:12,color:n,offset:m})}return c}function Fp(e){let t=Bp(e,`final`);if(t===void 0)return wp;for(let n=0;n<e.inflectionValues.length;n++){let r=e.inflectionValues[n];if(r.operator===`<`&&t<r.value||r.operator===`<=`&&t<=r.value)return e.colors[n]}return e.colors.at(-1)}function Ip(e){return[{start:e.topLeft,end:e.topRight},{start:e.topRight,end:e.bottomRight},{start:e.bottomRight,end:e.bottomLeft},{start:e.bottomLeft,end:e.topLeft}]}function Lp(e,t){let n=e.start,r=e.end,i=t.start,a=t.end;function o(e,t,n){return(n.y-e.y)*(t.x-e.x)>(t.y-e.y)*(n.x-e.x)}return o(n,i,a)!==o(r,i,a)&&o(n,r,i)!==o(n,r,a)}function Rp(e,t){let n=Ip(e),r=Ip(t);for(let e of n)for(let t of r)if(Lp(e,t))return!0;return!1}function zp(e,t,n,r,i,a){let o=Math.cos(e),s=Math.sin(e),c=o*t,l=s*t,u=i/2*s,d=i/2*o,f={x:c+u+n,y:r-(l-d)},p={x:c-u+n,y:r-(l+d)},m=o*(t+a),h=s*(t+a),g={x:m-u+n,y:r-(h+d)};return{bottomLeft:p,bottomRight:f,topRight:{x:m+u+n,y:r-(h-d)},topLeft:g}}function Bp(e,t){return t===`animated`&&e.animationValue!==void 0?e.animationValue:e.gaugeValue?.value}let Vp={responsive:!0,maintainAspectRatio:!1,elements:{line:{fill:!1},point:{hitRadius:15}},animation:!1,events:[`mousemove`,`mouseout`,`click`,`touchstart`,`touchmove`,`mouseup`]};async function Hp(e,t,n){let r=Gp(t.width,t.height),i;if(`chartJsConfig`in e){if(!globalThis.Chart)return console.log(`Chart.js library is not loaded`),i;let t=Jl();t||Yl();let n=b(e.chartJsConfig);if(n.plugins=[Wp],!globalThis.Chart.registry.controllers.get(n.type))return console.log(`Chart of type "${n.type}" is not registered in Chart.js library.`),t||Xl(),i;let a=new globalThis.Chart(r,n);try{i=await qp(r)}finally{a.destroy(),t||Xl()}}else{if(!globalThis.OffscreenCanvas)throw Error(`converting a ${n} chart to an image using OffscreenCanvas is not supported in this environment`);n===`scorecard`?(Vf(Gf(t,e),r),i=await qp(r)):n===`gauge`&&(Tp(r,e,1,t),i=await qp(r))}return i}async function Up(e,t,n){let r=Gp(t.width,t.height),i=null;if(`chartJsConfig`in e){if(!globalThis.Chart)return console.log(`Chart.js library is not loaded`),i;let t=Jl();t||Yl();let n=b(e.chartJsConfig);if(n.plugins=[Wp],!globalThis.Chart.registry.controllers.get(n.type))return console.log(`Chart of type "${n.type}" is not registered in Chart.js library.`),t||Xl(),i;let a=new globalThis.Chart(r,n);try{i=await Kp(r)}finally{a.destroy(),t||Xl()}}else{if(!globalThis.OffscreenCanvas)throw Error(`converting a ${n} chart to an image using OffscreenCanvas is not supported in this environment`);n===`scorecard`?(Vf(Gf(t,e),r),i=await Kp(r)):n===`gauge`&&(Tp(r,e,1,t),i=await Kp(r))}return i}let Wp={id:`customCanvasBackgroundColor`,beforeDraw:e=>{let{ctx:t}=e;t.save(),t.globalCompositeOperation=`destination-over`,t.fillStyle=`#ffffff`,t.fillRect(0,0,e.width,e.height),t.restore()}};function Gp(e,t){return new OffscreenCanvas(e,t)}async function Kp(e){return`convertToBlob`in e?e.convertToBlob({type:`image/png`}):new Promise(t=>e.toBlob(t,`image/png`))}async function qp(e){let t=await Kp(e);if(t)return new Promise(e=>{let n=new FileReader;n.addEventListener(`load`,()=>{e(n.result)}),n.readAsDataURL(t)})}let Jp={Errors:{InvalidRange:k(`The range is invalid`),FirstArgMissing:k(`The argument is missing. Please provide a value`),SecondArgMissing:k(`The second argument is missing. Please provide a value`),MinNaN:k(`The minpoint must be a number`),MidNaN:k(`The midpoint must be a number`),MaxNaN:k(`The maxpoint must be a number`),ValueUpperInflectionNaN:k(`The first value must be a number`),ValueLowerInflectionNaN:k(`The second value must be a number`),MinBiggerThanMax:k(`Minimum must be smaller then Maximum`),MinBiggerThanMid:k(`Minimum must be smaller then Midpoint`),MidBiggerThanMax:k(`Midpoint must be smaller then Maximum`),LowerBiggerThanUpper:k(`Lower inflection point must be smaller than upper inflection point`),MinInvalidFormula:k(`Invalid Minpoint formula`),MaxInvalidFormula:k(`Invalid Maxpoint formula`),MidInvalidFormula:k(`Invalid Midpoint formula`),ValueUpperInvalidFormula:k(`Invalid upper inflection point formula`),ValueLowerInvalidFormula:k(`Invalid lower inflection point formula`),EmptyRange:k(`A range needs to be defined`),ValueCellIsInvalidFormula:k(`At least one of the provided values is an invalid formula`),Unexpected:k(`The rule is invalid for an unknown reason`)},ColorScale:k(`Color scale`),IconSet:k(`Icon set`),DataBar:k(`Data bar`)},Yp={Series:k(`Series`),BackgroundColor:k(`Background color`),StackedBarChart:k(`Stacked bar chart`),StackedLineChart:k(`Stacked line chart`),StackedAreaChart:k(`Stacked area chart`),StackedColumnChart:k(`Stacked column chart`),CumulativeData:k(`Cumulative data`),TreatLabelsAsText:k(`Treat labels as text`),AggregatedChart:k(`Aggregate`),Errors:{Unexpected:k(`The chart definition is invalid for an unknown reason`),InvalidDataSet:k(`The dataset is invalid`),InvalidLabelRange:k(`Labels are invalid`),InvalidScorecardKeyValue:k(`The key value is invalid`),InvalidScorecardBaseline:k(`The baseline value is invalid`),InvalidGaugeDataRange:k(`The data range is invalid`),EmptyGaugeRangeMin:k(`A minimum range limit value is needed`),GaugeRangeMinNaN:k(`The minimum range limit value must be a number`),EmptyGaugeRangeMax:k(`A maximum range limit value is needed`),GaugeRangeMaxNaN:k(`The maximum range limit value must be a number`),GaugeLowerInflectionPointNaN:k(`The lower inflection point value must be a number`),GaugeUpperInflectionPointNaN:k(`The upper inflection point value must be a number`)},ColorScales:{blues:k(`Blues`),cividis:k(`Cividis`),custom:k(`Custom`),greens:k(`Greens`),greys:k(`Greys`),oranges:k(`Oranges`),purples:k(`Purples`),rainbow:k(`Rainbow`),reds:k(`Reds`),viridis:k(`Viridis`)}},Xp={Custom:k(`Custom`)},Zp=k(`Merged cells are preventing this operation. Unmerge those cells and try again.`),Qp=k(`The header row of a table can't be moved.`),$p={Errors:{Unexpected:k(`Cannot split the selection for an unknown reason`),NoSplitSeparatorInSelection:k(`There is no match for the selected separator in the selection`),MoreThanOneColumnSelected:k(`Only a selection from a single column can be split`),SplitWillOverwriteContent:k(`Splitting will overwrite existing content`)}},em={Errors:{Unexpected:k(`Cannot remove duplicates for an unknown reason`),MoreThanOneRangeSelected:k(`Please select only one range of cells`),EmptyTarget:k(`Please select a range of cells containing values.`),NoColumnsProvided:k(`Please select at latest one column to analyze.`),WillRemoveExistingMerge:k(`This operation is not possible due to a merge. Please remove the merges first than try again.`)}},H={DateIs:{today:k(`today`),yesterday:k(`yesterday`),tomorrow:k(`tomorrow`),lastWeek:k(`in the past week`),lastMonth:k(`in the past month`),lastYear:k(`in the past year`)},DateIsBefore:{today:k(`today`),yesterday:k(`yesterday`),tomorrow:k(`tomorrow`),lastWeek:k(`one week ago`),lastMonth:k(`one month ago`),lastYear:k(`one year ago`)},CriterionError:{notEmptyValue:k(`The value must not be empty`),numberValue:k(`The value must be a number`),dateValue:k(`The value must be a date`),validRange:k(`The value must be a valid range`),validFormula:k(`The formula must be valid`)},Errors:{InvalidRange:k(`The range is invalid.`),InvalidDataValidationCriterionValue:k(`One or more of the provided criteria values are invalid. Please review and correct them.`),InvalidNumberOfCriterionValues:k(`One or more of the provided criteria values are missing.`),Unexpected:k(`The rule is invalid for an unknown reason.`)}},tm={Errors:{Unexpected:k(`The table zone is invalid for an unknown reason`),TableOverlap:k(`You cannot create overlapping tables.`),NonContinuousTargets:k(`A table can only be created on a continuous selection.`),InvalidRange:k(`The range is invalid`),TargetOutOfSheet:k(`The range is out of the sheet`)},Checkboxes:{hasFilters:k(`Filter button`),headerRow:k(`Header row(s)`),bandedRows:k(`Banded rows`),firstColumn:k(`First column`),lastColumn:k(`Last column`),bandedColumns:k(`Banded columns`),automaticAutofill:k(`Automatically autofill formulas`),totalRow:k(`Total row`),isDynamic:k(`Auto-adjust to formula result`)},Tooltips:{filterWithoutHeader:k(`Cannot have filters without a header row`),isDynamic:k(`For tables based on array formulas only`)}},nm={labels:{no_calculations:k(`No calculations`),"%_of_grand_total":k(`% of grand total`),"%_of_col_total":k(`% of column total`),"%_of_row_total":k(`% of row total`),"%_of":k(`% of`),"%_of_parent_row_total":k(`% of parent row total`),"%_of_parent_col_total":k(`% of parent column total`),"%_of_parent_total":k(`% of parent total`),difference_from:k(`Difference from`),"%_difference_from":k(`% difference from`),running_total:k(`Running total`),"%_running_total":k(`% Running total`),rank_asc:k(`Rank smallest to largest`),rank_desc:k(`Rank largest to smallest`),index:k(`Index`)},descriptions:{"%_of_grand_total":()=>k(`Displayed as % of grand total`),"%_of_col_total":()=>k(`Displayed as % of column total`),"%_of_row_total":()=>k(`Displayed as % of row total`),"%_of":e=>k(`Displayed as % of "%s"`,e),"%_of_parent_row_total":e=>k(`Displayed as % of parent row total of "%s"`,e),"%_of_parent_col_total":()=>k(`Displayed as % of parent column total`),"%_of_parent_total":e=>k(`Displayed as % of parent "%s" total`,e),difference_from:e=>k(`Displayed as difference from "%s"`,e),"%_difference_from":e=>k(`Displayed as % difference from "%s"`,e),running_total:e=>k(`Displayed as running total based on "%s"`,e),"%_running_total":e=>k(`Displayed as % running total based on "%s"`,e),rank_asc:e=>k(`Displayed as rank from smallest to largest based on "%s"`,e),rank_desc:e=>k(`Displayed as rank largest to smallest based on "%s"`,e),index:()=>k(`Displayed as index`)},documentation:{no_calculations:k(`Displays the value that is entered in the field.`),"%_of_grand_total":k(`Displays values as a percentage of the grand total of all the values or data points in the report.`),"%_of_col_total":k(`Displays all the values in each column or series as a percentage of the total for the column or series.`),"%_of_row_total":k(`Displays the value in each row or category as a percentage of the total for the row or category.`),"%_of":k(`Displays values as a percentage of the value of the Base item in the Base field.`),"%_of_parent_row_total":k(`Calculates values as follows:
|
|
14
|
+
`.repeat(t)}:null}function Ru(e){return e.currentStartsWith(A.InvalidReference)?(e.advanceBy(A.InvalidReference.length),{type:`INVALID_REFERENCE`,value:A.InvalidReference}):null}let zu=(e,t=()=>!0)=>[{goTo:e,guard:t}],Bu=(e,t=()=>!0)=>({goTo:e,guard:t}),Vu={0:{REFERENCE:zu(2),NUMBER:zu(4),SYMBOL:[Bu(3,e=>Ac(e.value)),Bu(4,e=>jc(e.value))]},3:{SPACE:zu(3),OPERATOR:zu(5,e=>e.value===`:`)},4:{SPACE:zu(4),OPERATOR:zu(6,e=>e.value===`:`)},2:{SPACE:zu(2),OPERATOR:zu(1,e=>e.value===`:`)},1:{SPACE:zu(1),NUMBER:zu(7),REFERENCE:zu(7,e=>Pc(e.value)),SYMBOL:zu(7,e=>Mc(e.value)||Nc(e.value))},5:{SPACE:zu(5),SYMBOL:zu(7,e=>Mc(e.value)),REFERENCE:zu(7,e=>Pc(e.value))},6:{SPACE:zu(6),NUMBER:zu(7),REFERENCE:zu(7,e=>Pc(e.value)),SYMBOL:zu(7,e=>Nc(e.value))},7:{}};function Hu(e){let t=0,n=Vu[0],r=``;for(;n!==void 0;){let i=e[t++];if(!i)return null;let a=n[i.type]?.find(e=>e.guard(i)),o=a?a.goTo:void 0;switch(o){case void 0:return null;case 7:return r+=i.value,e.splice(0,t),{type:`REFERENCE`,value:r};default:n=Vu[o],r+=i.value;break}}return null}function Uu(e,t=R){let n=bu(e,t),r=[];for(;n.length;)r.push(Hu(n)||n.shift());return r}function Wu(e,t,n){if(!t.startsWith(`=`))return t;let r=Uu(t);for(let t=1;t<r.length;t++){if(r[t].type!==`REFERENCE`)continue;let i=r[t].value,a=Gu(e,i,n).range;i!==a&&(r[t]={value:a,type:`REFERENCE`})}return pt(r.map(e=>e.value))}function Gu(e,t,n){let r=Fc(t).sheetName;if(r?!bl(r,n.sheetName.old):e!==n.sheetId)return{changeType:`NONE`,range:t};let i=Ju(t,r?n.sheetId:e);if(i.invalidXc)return{changeType:`NONE`,range:t};let a=n.applyChange(i);if(a.changeType===`NONE`||a.changeType===`REMOVE`)return{changeType:a.changeType,range:t};let o=Xc(a.range,e,Ku(n));return o===A.InvalidReference?{changeType:`REMOVE`,range:o}:{changeType:a.changeType,range:o}}function Ku(e){return t=>t===e.sheetId?e.sheetName.current:``}function qu(e){return{numberOfRows:2**53-1,numberOfCols:2**53-1}}function Ju(e,t){return kc.test(e)?Kc({xc:e,sheetId:t},qu):qc(e)}let Yu=`xMovingAverage`,Xu={exponential:`exp`,logarithmic:`log`,polynomial:`poly`,trailingMovingAverage:`movingAvg`};function Zu(e,t,n,r){let i=!1,a=[];for(let r in n){let o=n[r];if(o.labelCell){let e=ed(o.labelCell,t);o.labelCell!==e&&(i=!0,o={...o,labelCell:e})}let s=ed(o.dataRange,t);s===void 0||e.getRangeString(s,s.sheetId)===A.InvalidReference?(i=!0,o=void 0):s!==o.dataRange&&(i=!0,o={...o,dataRange:s}),a[r]=o}let o=r,s=ed(o,t);s!==o&&(i=!0,o=s);let c=a.filter(C);return{isStale:i,dataSets:c,labelRange:o}}function Qu(e,t,n){return n.map(n=>({dataRange:Zc(e,t,n.dataRange),labelCell:n.labelCell?Zc(e,t,n.labelCell):void 0}))}function $u(e,t,n){return n?Zc(e,t,n):void 0}function ed(e,t){if(!e)return;let n=t(e);switch(n.changeType){case`REMOVE`:return;default:return n.range}}function td(e,t,n,r){let i=[];for(let a of t){let{unboundedZone:t,sheetId:o,invalidSheetName:s,invalidXc:c}=e.getRangeFromSheetXC(n,a.dataRange);if(!(s||c))if(t.left!==t.right&&t.top!==t.bottom){if(t.right===void 0)continue;for(let n=t.left;n<=t.right;n++){let s={...t,left:n,right:n};i.push({...nd(e,o,s,r?{top:s.top,bottom:s.top,left:s.left,right:s.left}:void 0),backgroundColor:a.backgroundColor,rightYAxis:a.yAxisId===`y1`,customLabel:a.label,trend:a.trend})}}else i.push({...nd(e,o,t,r?{top:t.top,bottom:t.top,left:t.left,right:t.left}:void 0),backgroundColor:a.backgroundColor,rightYAxis:a.yAxisId===`y1`,customLabel:a.label,trend:a.trend})}return i}function nd(e,t,n,r){if(n.left!==n.right&&n.top!==n.bottom)throw Error(`Zone should be a single column or row: ${hn(n)}`);if(r){let i=hn(n),a=hn(r);return{labelCell:e.getRangeFromSheetXC(t,a),dataRange:e.getRangeFromSheetXC(t,i)}}else return{labelCell:void 0,dataRange:e.getRangeFromSheetXC(t,hn(n))}}function rd(e,t){let n=t.labelCell?.zone,r=t.dataRange.zone;if(n){let{numberOfRows:e,numberOfCols:t}=On(r);e===1?r={...r,left:r.left+1}:t===1&&(r={...r,top:r.top+1})}let i=Gc({...t.dataRange,zone:r},e.getSheetSize),a={};t.customLabel?a={text:t.customLabel}:t.labelCell&&(a={reference:e.getRangeString(t.labelCell,`forceSheetReference`,{useBoundedReference:!0})});let o;return t.trend?.type&&(o={type:t.trend.type===`polynomial`&&t.trend.order===1?`linear`:Xu[t.trend.type],color:t.trend.color,order:t.trend.order?Math.min(t.trend.order,6):void 0,window:t.trend.window||2}),{label:a,range:e.getRangeString(i,`forceSheetReference`,{useBoundedReference:!0}),backgroundColor:t.backgroundColor,rightYAxis:t.rightYAxis,trend:o}}function id(e,t,n){if(!t)return;let r={...t.zone};n&&t.zone.bottom>t.zone.top&&(r.top+=1);let i=Gc({...t,zone:r},e.getSheetSize);return e.getRangeString(i,`forceSheetReference`,{useBoundedReference:!0})}function ad(e,t,n){let r;if(t.labelRange){let{changeType:i,range:a}=Gu(e,t.labelRange,n);i!==`REMOVE`&&(r=a)}let i=[];for(let r of t.dataSets){let t={...r},{changeType:a,range:o}=Gu(e,r.dataRange,n);a!==`REMOVE`&&(t.dataRange=o,i.push(t))}return{...t,dataSets:i,labelRange:r}}function od(e){return e&&kr(e)<.3?`#FFFFFF`:`#000000`}function sd(e){return e&&kr(e)<.3?`#C8C8C8`:`#666666`}function cd(e){return e.dataSets&&(e.dataSets.find(e=>!kc.test(e.dataRange))!==void 0||e.dataSets.map(e=>ln(e.dataRange)).some(e=>e.top!==e.bottom&&zn(e)))?`InvalidDataSet`:`Success`}function ld(e){return e.labelRange&&!kc.test(e.labelRange||``)?`InvalidLabelRange`:`Success`}function ud(e,t,n){if(!n||!e)return!1;if(!t)return!0;let r=Vn(t.dataRange.zone);return!(Vn(e.zone)<r)}function dd(e,t){let{x:n,y:r}=e.getMainViewportCoordinates(),{scrollX:i,scrollY:a}=e.getActiveSheetScrollInfo(),{width:o,height:s}=e.getVisibleRect(e.getActiveMainViewport());return{x:n+i+Math.max(0,(o-t.width)/2),y:r+a+Math.max(0,(s-t.height)/2)}}function fd(e){let t=!1,n=!1;if(`horizontal`in e&&e.horizontal)return{useLeftAxis:!0,useRightAxis:!1};for(let r of e.dataSets||[])r.yAxisId===`y1`?n=!0:t=!0;return t||=!n,{useLeftAxis:t,useRightAxis:n}}function pd(e,t,n=!1){return(r,i)=>{let a=e?.[i];return md({format:a,locale:t},n)(r)}}function md(e,t=!1){return n=>{if(n=Number(n),isNaN(n))return n;let{locale:r,format:i}=e;return _d(t?gs({value:n,format:i},r):z(n,{locale:r,format:!i&&Math.abs(n)>=1e3?`#,##`:i}))}}let hd=[{value:`left`,label:k(`Left`)},{value:`right`,label:k(`Right`)}];function gd(e,t){let n=[],r=Pt(t.map(e=>e.data.length));for(let t=0;t<=r;t++)n.push(e.next());return n}function _d(e,t=20){return e?e.length>t?e.substring(0,t)+`…`:e:``}function vd(e){return e===`x1`||e===`xMovingAverage`}let yd={id:`chartShowValuesPlugin`,afterDatasetsDraw(e,t,n){if(!n.showValues||!e._metasets?.[0]?.data)return;let r=e.ctx;switch(r.save(),r.textAlign=`center`,r.textBaseline=`middle`,r.miterLimit=1,n.type){case`pie`:wd(e,n,r);break;case`line`:case`scatter`:case`combo`:case`waterfall`:case`radar`:xd(e,n,r);break;case`bar`:n.horizontal?Cd(e,n,r):xd(e,n,r);break;case`pyramid`:Cd(e,n,r);break;case`calendar`:Sd(e,n,r);break;case`funnel`:Cd(e,n,r);break}r.restore()}};function bd(e,t,n,r){r.lineWidth=3,r.strokeText(e,t,n),r.lineWidth=1,r.fillText(e,t,n)}function xd(e,t,n){let r={};for(let i of e._metasets){if(vd(i.xAxisID)||i.hidden)continue;let a=e.scales[i.yAxisID];for(let o=0;o<i._parsed.length;o++){let s=i._parsed[o],c=Number(e.config.type===`radar`?s.r:s.y);if(isNaN(c))continue;let l=i.data[o],u=l.x,d=0;if(e.config.type===`line`||e.config.type===`radar`)d=c<0?l.y+10:l.y-10;else{let e=a.getPixelForValue(0),t=Math.abs(e-l.y),n=globalThis.Chart?.defaults.font.size??12;d=t<n?c<0?e+n/2:e-n/2:c<0?l.y-l.height/2:l.y+l.height/2}r[u]||(r[u]=[]);for(let e of r[u]||[])Math.abs(e-d)<13&&(d=c<0?e+13:e-13);r[u].push(d),n.fillStyle=l.options.backgroundColor,n.strokeStyle=t.background(Number(c),i,o)||`#ffffff`,bd(t.callback(Number(c),i,o),u,d,n)}}}function Sd(e,t,n){let r=e.chartArea.bottom,i=e.chartArea.top;for(let a of e._metasets){if(vd(a.xAxisID)||a.hidden)continue;let o=e.scales[a.yAxisID];for(let s=0;s<a._parsed.length;s++){let c=a._parsed[s],l=Number(e.config.type===`radar`?c.r:c.y);if(isNaN(l))continue;let u=a.data[s],d=u.x,f=0,p=o.getPixelForValue(0),m=Math.abs(p-u.y),h=globalThis.Chart?.defaults.font.size??12;f=m<h?l<0?p+h/2:p-h/2:l<0?u.y-u.height/2:u.y+u.height/2,f=Math.min(f,r),f=Math.max(f,i),n.strokeStyle=u.options.backgroundColor,n.fillStyle=t.background(Number(l),a,s)||`#ffffff`;let g=t.callback(Number(l),a,s),_=n.measureText(g);_.actualBoundingBoxAscent+_.actualBoundingBoxDescent+2>Math.abs(u.height)-2||bd(g,d,f,n)}}}function Cd(e,t,n){let r={};for(let i of e._metasets){if(vd(i.xAxisID))return;let a=e.scales[i.xAxisID].getPixelForValue(0);for(let e=0;e<i._parsed.length;e++){let o=Number(i._parsed[e].x);if(isNaN(o))continue;let s=t.callback(o,i,e),c=i.data[e],l=c.y,u=Ol(n,s,{fontSize:globalThis.Chart?.defaults.font.size??12},`px`),d=Math.abs(c.x-a),f;f=d<u?o<0?a-u/2-3:a+u/2+3:o<0?c.x+c.width/2:c.x-c.width/2,r[l]||(r[l]=[]);for(let e of r[l])Math.abs(e-f)<u&&(f=o<0?e-u-3:e+u+3);r[l].push(f),n.strokeStyle=c.options.backgroundColor,n.fillStyle=t.background(Number(o),i,e)||`#ffffff`,bd(s,f,l,n)}}}function wd(e,t,n){for(let r of e._metasets)for(let e=0;e<r._parsed.length;e++){let i=Number(r._parsed[e]);if(isNaN(i)||i===0)continue;let a=r.data[e],{startAngle:o,endAngle:s,innerRadius:c,outerRadius:l}=a,u=(o+s)/2,d=(c+l)/2,f=a.x+d*Math.cos(u),p=a.y+d*Math.sin(u),m=t.callback(i,r,e),h=globalThis.Chart?.defaults.font.size??12,g=Ol(n,m,{fontSize:h},`px`),_=l-c;if(g>=_||_<h)continue;let v=s-o,y=2*d*Math.tan(v/2);if(v<Math.PI/2&&(g>=y||y<h))continue;let ee=t.background(Number(i),r,e);n.fillStyle=od(ee),n.strokeStyle=ee||`#ffffff`,bd(m,f,p,n)}}let Td={showHeaders:!0,headerDesign:{align:`center`,fillColor:`#808080`,bold:!0,fontSize:15},showValues:!0,showLabels:!0,valuesDesign:{align:`left`,verticalAlign:`bottom`,fontSize:12},coloringOptions:{type:`categoryColor`,colors:[],useValueBasedGradient:!0}},Ed={second:1e3,minute:1e3*60,hour:1e3*3600,day:1e3*3600*24,month:1e3*3600*24*30,year:1e3*3600*24*365},Dd={inSeconds:function(e){return Math.floor(e/Ed.second)},inMinutes:function(e){return Math.floor(e/Ed.minute)},inHours:function(e){return Math.floor(e/Ed.hour)},inDays:function(e){return Math.floor(e/Ed.day)},inMonths:function(e){return Math.floor(e/Ed.month)},inYears:function(e){return Math.floor(e/Ed.year)}},Od=/^((d|dd|m|mm|yyyy|yy|hh|h|ss|a)(-|:|\s|\/))*(d|dd|m|mm|yyyy|yy|hh|h|ss|a)$/i;function kd(e,t,n){let r=Ad(t),i=Md(e,r,n),a={};return i&&(a[i]=r),{parser:r,displayFormats:a,unit:i??!1,tooltipFormat:r}}function Ad(e){let t=e.indexOf(`h`);return e=t>=0?e.slice(0,t).replace(/m/g,`M`)+e.slice(t):e.replace(/m/g,`M`),e.includes(`a`)||(e=e.replace(/h/g,`H`)),e}function jd(e){return e.includes(`s`)?`second`:e.includes(`m`)?`minute`:e.includes(`h`)||e.includes(`H`)?`hour`:e.includes(`d`)?`day`:e.includes(`M`)?`month`:`year`}function Md(e,t,n){let r=e.map(e=>Ci(e,n)?.jsDate);if(r.some(e=>e===void 0)||e.length<2)return;let i=r.map(e=>e.getTime()),a=Pt(i)-Ft(i),o=jd(t);return Ed.second>=Ed[o]&&Dd.inSeconds(a)<180?`second`:Ed.minute>=Ed[o]&&Dd.inMinutes(a)<180?`minute`:Ed.hour>=Ed[o]&&Dd.inHours(a)<96?`hour`:Ed.day>=Ed[o]&&Dd.inDays(a)<90?`day`:Ed.month>=Ed[o]&&Dd.inMonths(a)<36?`month`:`year`}function Nd(e,t){let n={},{trendDataSetsValues:r,locale:i,axisFormats:a}=t,o={stacked:e.stacked,locale:i};if(e.horizontal)n.x=Gd(e,`bottom`,`values`,{...o,format:a?.x}),n.y=Gd(e,`left`,`labels`,o);else{n.x=Gd(e,`bottom`,`labels`,o);let t={...o,format:a?.y};n.y=Gd(e,`left`,`values`,t);let r={...o,format:a?.y1};n.y1=Gd(e,`right`,`values`,r)}if(n=bt(n),r&&r.length&&r.some(C)){let e=Math.max(...r.map(e=>e?.length||0));n.x1={...n.x,labels:Array(e).fill(``),offset:!1,display:!1},n[Yu]={...n.x,offset:!0,display:!1}}return n}function Pd(e,t){let n=t.map(e=>e.label||``),r=od(e.background);return{y:{title:Wd(e.axesDesign?.y),stacked:!0,min:0,max:n.length,ticks:{stepSize:.5,color:r,callback:function(e,t,r){if(t%2!=0)return n[Math.floor((t-1)/2)]}},grid:{display:!1},border:{display:!1}},x:{title:Wd(e.axesDesign?.x),stacked:!0,grid:{display:!1},position:`top`,ticks:{color:r},border:{display:!1}}}}function Fd(e,t){let{dataSetsValues:n}=t;if(!n.length||e.legendPosition===`none`)return;let r=n.flatMap(e=>e.data).filter(C),i=Math.min(...r),a=Math.max(...r),o=[];return o=typeof e.colorScale==`object`?[e.colorScale.minColor,e.colorScale.midColor,e.colorScale.maxColor].filter(C):[...ri[e.colorScale??`oranges`]],{position:e.legendPosition===`right`?`right`:`left`,colorScale:o,fontColor:od(e.background),minValue:i,maxValue:a,locale:t.locale}}function Id(e,t){let{locale:n,axisType:r,trendDataSetsValues:i,labels:a,axisFormats:o}=t,s=o?.x,c=e.stacked,l={x:Gd(e,`bottom`,`labels`,{locale:n}),y:Gd(e,`left`,`values`,{locale:n,stacked:c,format:o?.y}),y1:Gd(e,`right`,`values`,{locale:n,stacked:c,format:o?.y1})};if(l=bt(l),r===`time`&&a&&s){let e={type:`time`,time:kd(a,s,n)};Object.assign(l.x,e),l.x.ticks.maxTicksLimit=15,delete l?.x?.ticks?.callback}else r===`linear`&&(l.x.type=`linear`,l.x.ticks.callback=e.humanize?e=>gs({value:e,format:s},n):e=>z(e,{format:s,locale:n}));if(i&&i.length&&i.some(C)&&(l.x1={...l.x,display:!1},l[Yu]={...l.x,display:!1},r===`category`||r===`time`)){let e=Math.max(...i.map(e=>e?.length||0));l.x1.type=`category`,l.x1.labels=S(0,e).map(e=>e.toString()),l.x1.offset=!1,l[Yu].type=`category`,l[Yu].offset=!1}return l}function Ld(e,t){let n=Id(e,t);return{...n,x:{...n.x,grid:{display:!0}}}}function Rd(e,t){let{locale:n,axisFormats:r}=t,i=r?.y||r?.y1;e.dataSets;let a={x:{...Gd(e,`bottom`,`labels`,{locale:n}),grid:{display:!1}},y:{position:e.verticalAxisPosition,ticks:{color:od(e.background),callback:md({locale:n,format:i},e.humanize)},grid:{lineWidth:e=>e.tick.value===0?2:1},title:Wd(e.axesDesign?.y)}},o=a?.y||a?.y1;return o&&(o.grid={lineWidth:e=>e.tick.value===0?2:1}),a}function zd(e,t){let{dataSetsValues:n}=t,r=Nd(e,t),i=r.x.ticks.callback;r.x.ticks.callback=e=>i(Math.abs(e));let a=Math.max(...n.map(e=>Math.max(...e.data.map(Math.abs))));return r.x.suggestedMin=-a,r.x.suggestedMax=a,r}function Bd(e,t){let{locale:n,axisFormats:r,dataSetsValues:i}=t,a=Math.min(...i.map(e=>Math.min(...e.data.filter(e=>!isNaN(e)))));return{r:{beginAtZero:!0,ticks:{callback:md({format:r?.r,locale:n},e.humanize),backdropColor:e.background||`#FFFFFF`},pointLabels:{color:od(e.background),callback:e=>_d(e)},suggestedMin:a<0?a-1:0}}}function Vd(e,t){let{locale:n,axisFormats:r,availableRegions:i}=t,a=Jd(e.legendPosition),o=e.region?i.find(t=>t.id===e.region):i[0],s=r?.y||r?.y1;return{projection:{projection:Ud(o?.defaultProjection||`mercator`),axis:`x`},color:{axis:`x`,display:e.legendPosition!==`none`,border:{color:fe},grid:{color:fe},ticks:{color:od(e.background),callback:md({locale:n,format:s},e.humanize)},legend:{position:a,align:a.includes(`right`)?`left`:`right`,margin:qd(e)},interpolate:Kd(e.colorScale??he),missing:e.missingValueColor||`#ffffff`}}}function Hd(e,t){let n=t.dataSetsValues[0];return{x:{display:!1},y:{grid:{offset:!1},ticks:{callback:function(e){return _d(this.getLabelForValue(e))}},border:{display:!1}},percentages:{position:`right`,border:{display:!1},ticks:{callback:function(e,r,i){let a=n.data?.[r],o=n.data?.[0];return!o||a===void 0?``:z(a/o,{format:`0%`,locale:t.locale})}},grid:{display:!1}}}}function Ud(e){return e===`conicConformal`?globalThis.ChartGeo.geoConicConformal().rotate([100,0]):e}function Wd(e){if(e?.title?.text){let{text:t,color:n,align:r,italic:i,bold:a}=e.title;return{display:!0,text:t,color:n,font:{style:i?`italic`:`normal`,weight:a?`bold`:`normal`,size:e.title.fontSize??12},align:r===`left`?`start`:r===`right`?`end`:`center`}}}function Gd(e,t,n,r){let{useLeftAxis:i,useRightAxis:a}=fd(e);if(t===`left`&&!i||t===`right`&&!a)return;let o=od(e.background),s;if(s=t===`bottom`?e.axesDesign?.x:t===`left`?e.axesDesign?.y:e.axesDesign?.y1,n===`values`){let n=!(t===`right`&&i);return{position:t,title:Wd(s),grid:{display:n},beginAtZero:!0,stacked:r?.stacked,ticks:{color:o,callback:md(r,e.humanize)}}}else return{ticks:{padding:5,color:o,callback:function(e,t,n){return _d(this.getLabelForValue(e))}},grid:{display:!1},stacked:r?.stacked,title:Wd(s)}}function Kd(e,t=0,n=1){if(t===n){let t=e.midColor??e.minColor;return e=>t}let r=[{value:t,color:e.minColor}];return e.midColor&&r.push({value:(t+n)/2,color:e.midColor}),r.push({value:n,color:e.maxColor}),ai(r)}function qd(e){switch(e.legendPosition){case`top`:case`right`:return{top:e.title.text?45:15,left:20,right:20};case`bottom`:case`left`:case`none`:return{left:20,right:20,bottom:10}}}function Jd(e){switch(e){case`top`:return`top-left`;case`right`:return`top-right`;case`bottom`:return`bottom-right`;case`left`:return`bottom-left`;case`none`:return`bottom-left`}}let Yd=`nullValue`;function Xd(e,t){let{dataSetsValues:n}=t,r=[],i=_f(e,n.length),a=[];for(let o in n){let{label:s,data:c,hidden:l}=n[o];s=e.dataSets?.[o].label||s;let u=i.next(),d={label:s,data:c,hidden:l,borderColor:e.background||`#FFFFFF`,borderWidth:+!!e.stacked,backgroundColor:u,yAxisID:e.horizontal?`y`:e.dataSets?.[o].yAxisId||`y`,xAxisID:`x`,barPercentage:.9,categoryPercentage:n.length>1?.8:1,borderRadius:2};r.push(d);let f=e.dataSets?.[o].trend,p=t.trendDataSetsValues?.[o];!f?.display||e.horizontal||!p||a.push(hf(d,f,p))}return r.push(...a),r}function Zd(e,t){let{labels:n,dataSetsValues:r}=t,i=r.map(e=>e.data).flat().filter(C),a=Math.max(...i),o=Math.min(...i),s=Kd(e.colorScale??he,o,a),c=[];for(let t of r)c.push({label:t.label,data:t.data.map(e=>1),backgroundColor:t.data.map(t=>t===void 0?e.missingValueColor||`#00000000`:s(t)),borderColor:e.background||`#FFFFFF`,borderSkipped:!1,borderWidth:1,barPercentage:1,categoryPercentage:1,values:t.data});return{labels:n,datasets:c}}function Qd(e,t){let{dataSetsValues:n,labels:r}=t,i=e.negativeValuesColor||`#EA6175`,a=e.positiveValuesColor||`#4EA7F2`,o=e.subTotalValuesColor||`#AAAAAA`,s=[],c=[],l={label:``,data:c,backgroundColor:s},u=[],d=0;for(let t of n)if(!t.hidden){for(let l=0;l<t.data.length;l++){let f=t.data[l];if(u.push(r[l]),isNaN(Number(f))){c.push([d,d]),s.push(``);continue}c.push([d,f+d]);let p=f>=0?a:i;l===0&&t===n[0]&&e.firstValueAsSubtotal&&(p=o),s.push(p),d+=f}e.showSubTotals&&(u.push(k(`Subtotal`)),c.push([0,d]),s.push(o))}return{datasets:[l],labels:u}}function $d(e,t){let{dataSetsValues:n,axisType:r,labels:i}=t,a=[],o=!!e.fillArea,s=!!e.stacked,c=[],l=_f(e,n.length);for(let u=0;u<n.length;u++){let{label:d,data:f,hidden:p}=n[u];d=e.dataSets?.[u].label||d;let m=l.next();r&&[`linear`,`time`].includes(r)&&(f=f.map((e,t)=>({x:i[t]||void 0,y:e})));let h={label:d,data:f,hidden:p,tension:0,borderColor:m,backgroundColor:o?Br(m,Ae):m,pointBackgroundColor:m,fill:o?gf(u,s):!1,pointRadius:e.hideDataMarkers?0:3,yAxisID:e.dataSets?.[u].yAxisId||`y`};a.push(h);let g=e.dataSets?.[u].trend,_=t.trendDataSetsValues?.[u];!g?.display||!_||c.push(hf(h,g,_))}return a.push(...c),a}function ef(e,t){let n=$d(e,t);for(let e of n)vd(e.xAxisID)||(e.showLine=!1);return n}function tf(e,t){let{dataSetsValues:n}=t,r=[],i=gd(new ei(Math.max(0,...n.map(e=>e?.data?.length??0))),n);for(let{label:t,data:a,hidden:o}of n){if(o)continue;let n={label:t,data:a,borderColor:e.background||`#FFFFFF`,backgroundColor:i,hoverOffset:10};r.push(n)}return r}function nf(e,t){let{dataSetsValues:n}=t,r=[],i=_f(e,n.length),a=[],o=n.filter((t,n)=>(e.dataSets?.[n].type??`line`)===`bar`);for(let s=0;s<n.length;s++){let{label:c,data:l,hidden:u}=n[s];c=e.dataSets?.[s].label||c;let d=e.dataSets?.[s],f=i.next(),p=d?.type??`line`,m={label:c,data:l,hidden:u,borderColor:f,backgroundColor:f,yAxisID:e.dataSets?.[s].yAxisId||`y`,xAxisID:`x`,type:p,order:p===`bar`?n.length+s:s,pointRadius:e.hideDataMarkers?0:3};m.type===`bar`&&(m.barPercentage=.9,m.categoryPercentage=o.length>1?.8:1,m.borderRadius=2),r.push(m);let h=e.dataSets?.[s].trend,g=t.trendDataSetsValues?.[s];!h?.display||!g||a.push(hf(m,h,g))}return r.push(...a),r}function rf(e,t){let{dataSetsValues:n}=t,r=[],i=e.fillArea??!1,a=_f(e,n.length);for(let t=0;t<n.length;t++){let{label:o,data:s,hidden:c}=n[t];e.dataSets?.[t]?.label&&(o=e.dataSets[t].label);let l=a.next(),u={label:o,data:s,hidden:c,borderColor:l,backgroundColor:l,pointBackgroundColor:l,pointRadius:e.hideDataMarkers?0:3};i&&(u.backgroundColor=Br(l,Ae),u.fill=`start`),r.push(u)}return r}function af(e,t){let{availableRegions:n,dataSetsValues:r,labels:i}=t,a=e.region||n[0]?.id,o=a?t.getGeoJsonFeatures(a):void 0,s={outline:o,showOutline:!!o,data:[]};if(o&&a){let e={};if(r[0])for(let n=0;n<r[0].data.length;n++){if(!i[n]||r[0].data[n]===void 0)continue;let o=t.geoFeatureNameToId(a,i[n]);o&&(e[o]={value:r[0].data[n],label:i[n]})}for(let t of o)t.id&&s.data.push({feature:{...t,properties:{name:e[t.id]?.label}},value:e[t.id]?.value})}return[s]}function of(e,t){let n=t.dataSetsValues[0],r=t.labels;if(!n)return[];let{label:i,data:a}=n;return i=e.dataSets?.[0].label||i,[{label:i,data:a.map(e=>e<=0?[0,0]:[-e,e]),backgroundColor:sf(r,e.funnelColors),yAxisID:`y`,xAxisID:`x`,barPercentage:1,categoryPercentage:1,borderColor:e.background||`#FFFFFF`,borderWidth:3}]}function sf(e,t){let n=new ei(e.length,t);return e.map(()=>n.next())}function cf(e,t){let{dataSetsValues:n,labels:r}=t,i=ff(uf(n,r)),a=i[0]||[],o=new ei(a.length,e.groupColors||[]),s=a.map(e=>({label:e.label,color:o.next()})),c=[];for(let t=i.length-1;t>=0;t--){let n={groupColors:s,parsing:{key:`value`},data:i[t],borderColor:t=>{let n=t.type===`data`?t.raw:void 0;return!n||n.label===`nullValue`?ue:e.background||`#FFFFFF`},backgroundColor:e=>{let t=e.type===`data`?e.raw:void 0;if(!t||t.label===`nullValue`)return ue;let n=t.groups[0];return s.find(e=>e.label===n)?.color},hoverOffset:10};c.push(n)}return c}function lf(e,t){let n=[],r=Math.max(...e.map(e=>e.data.length));for(let i=0;i<r;i++){n[i]={};for(let t=0;t<e.length;t++){let r=e[t].data[i]===null?Yd:String(e[t].data[i]);n[i][t]=r}n[i].value=Number(t[i])}return n}function uf(e,t){return df(lf(e,t),0,e.length,[])}function df(e,t,n,r){if(t>=n)return[];let i=Object.groupBy(e,e=>e[t]);return Object.keys(i).map(e=>{let a=i[e]?.reduce((e,t)=>e+Number(t.value),0)||0,o=[...r,e];return{label:e,value:a,children:df(i[e]||[],t+1,n,[...r,e]),groups:o,depth:t}}).sort((e,t)=>t.value-e.value)}function ff(e){let t=[],n=[...e];for(;n.length>0;){let e=n.shift();e&&(t[e.depth]||(t[e.depth]=[]),t[e.depth].push(e),e.children&&n.push(...e.children))}return t}function pf(e,t){let{dataSetsValues:n,labels:r,locale:i,axisFormats:a}=t,o={locale:i,format:a?.y};if(n.length===0)return[];let s=uf(n,r).sort((e,t)=>t.value-e.value),c=vf(e,s),l=[],u=Math.max(...n.map(e=>e.data.length));for(let e=0;e<u;e++){l[e]={};for(let t=0;t<n.length;t++)l[e][t]=n[t].data[e]?String(n[t].data[e]):void 0;l[e].value=Number(r[e])}let d=e.showLabels??Td.showLabels,f=e.showValues??Td.showValues,p=e.coloringOptions||Td.coloringOptions,m;return p?.type===`colorScale`&&(m=yf(s,p)),[{data:[],tree:l,labels:{display:d||f,overflow:`hidden`,...mf(e.valuesDesign,Td.valuesDesign),formatter:e=>[d?e.raw.g:void 0,f?z(e.raw.v,o):void 0].filter(C)},captions:{display:e.showHeaders??Td.showHeaders,padding:6,...mf(e.headerDesign,Td.headerDesign)},key:`value`,groups:S(0,n.length).map(e=>String(e)),borderWidth:0,spacing:1,displayMode:`headerBoxes`,groupColors:c,backgroundColor:t=>{if(t.type!==`data`)return`transparent`;if(!t.raw.isLeaf)return e.headerDesign?.fillColor||Td.headerDesign?.fillColor;if(p.type===`colorScale`)return m?.(t.raw.v)||`#FF0000`;if(p.type===`categoryColor`)return bf(t,s,p,c);throw Error(`Unsupported coloring option type}`)}}]}function mf(e,t){let n=e=>{let t=e.element.options.backgroundColor;return kr(t)>.7?`#666666`:`#FFFFFF`};return{align:e?.align??t?.align,position:e?.verticalAlign??t?.verticalAlign,color:e?.color||n,hoverColor:e?.color||n,font:{weight:e?.bold??t?.bold?`bold`:`normal`,style:e?.italic??t?.italic?`italic`:`normal`,size:e?.fontSize??t?.fontSize}}}function hf(e,t,n){let r=Mr(e.backgroundColor);r.a=1;let i=t.color||Vr(jr(r),.5);return{type:`line`,xAxisID:t.type===`trailingMovingAverage`?Yu:`x1`,yAxisID:e.yAxisID,label:e.label?k(`Trend line for %s`,e.label):``,data:n,order:-1,showLine:!0,pointRadius:0,backgroundColor:i,borderColor:i,borderDash:[5,5],borderWidth:void 0,fill:!1,pointBackgroundColor:i}}function gf(e,t){return t?e===0?`origin`:`-1`:`origin`}function _f(e,t){return new ei(t,e.dataSets?.map(e=>e.backgroundColor)||[])}function vf(e,t){let n=e.coloringOptions?.type===`categoryColor`?e.coloringOptions.colors:[],r=new ei(t.length,n);return t.map(e=>({label:e.label,color:r.next()}))}function yf(e,t){if(e.length===0)return;let n=ff(e),r=n[n.length-1],i=Math.min(...r.map(e=>e.value)),a=Math.max(...r.map(e=>e.value));if(Number.isFinite(i)&&Number.isFinite(a)){let e=[{value:i,color:t.minColor}];if(t.midColor){let n=(i+a)/2;e.push({value:n,color:t.midColor})}return e.push({value:a,color:t.maxColor}),ai(e)}}function bf(e,t,n,r){let i=e.raw._data.children[0][0],a=r.find(e=>e.label===i)?.color;if(!a||!n.useValueBasedGradient)return a||`#FF0000`;let o=t.find(e=>e.label===i);if(!o||!o.children.length)return a;let s=ff(o.children),c=s[s.length-1],l=Math.max(...c.map(e=>e.value)),u=Math.min(...c.map(e=>e.value));return u===l||!isFinite(u)||!isFinite(l)?a:Vr(a,((Number(e.raw.v)||0)-l)/(u-l)*.5)}let xf={id:`sunburstHoverPlugin`,afterEvent(e,t,n){if(!n.enabled)return;let r=e.getActiveElements(),i=r.map(e=>({datasetIndex:e.datasetIndex,index:e.index}));for(let t of r){let n=e.data.datasets[t.datasetIndex].data[t.index];for(let t=0;t<e.data.datasets.length;t++){let r=e.data.datasets[t];for(let e=0;e<r.data.length;e++){let a=r.data[e];Sf(n.groups,a.groups)&&i.push({datasetIndex:t,index:e})}}}i=i.filter(t=>{let{datasetIndex:n,index:r}=t;return e.data.datasets[n].data[r].label!==Yd}),e.setActiveElements(i);for(let t of e.getSortedVisibleDatasetMetas())for(let e of t.data){let t=e.$context,{datasetIndex:n,index:r,dataset:a,raw:o}=t;if(o.label===`nullValue`)continue;let s=typeof a.backgroundColor==`function`?a.backgroundColor(t):a.backgroundColor;i.length&&!i.some(e=>e.datasetIndex===n&&e.index===r)?e.options.backgroundColor=Vr(s,.5):e.options.backgroundColor=s}}};function Sf(e,t){return t.length>e.length&&e.every((e,n)=>e===t[n])}let Cf={id:`sunburstLabelsPlugin`,afterDatasetsDraw(e,t,n){if(!n.showValues&&!n.showLabels||e.config.type!==`doughnut`)return;let r=e.ctx;wf(e,n,r)}};function wf(e,t,n){let r=t.style,i=r.fontSize||13,a=i+3;for(let o of e._metasets)for(let s=0;s<o._dataset.data.length;s++){let c=o._dataset.data[s];if(c.label===`nullValue`)continue;let l=[t.showLabels?c.label:void 0,t.showValues?t.callback(c.value,`y`):void 0].filter(C),u=o.data[s],{startAngle:d,endAngle:f,innerRadius:p,outerRadius:m,circumference:h}=u,g=u.options.offset/4,_=g*(1-Math.sin(Math.min(Math.PI,h||0)));p+=_,m+=_;let v=(d+f)/2,y=(p+m)/2,ee=(m-p)*.9,te=f-d;if((te>=Math.PI?m:Math.sin(te/2)*p*2)<l.length*a)continue;n.save();let ne={x:Math.cos(v)*g,y:Math.sin(v)*g},re=e.chartArea.left+e.chartArea.width/2+ne.x,ie=e.chartArea.top+e.chartArea.height/2+ne.y;n.translate(re,ie);let ae;v>Math.PI/2?(n.rotate(v-Math.PI),ae=-y):(ae=y,n.rotate(v));let oe=u.options.backgroundColor,se=kr(oe)>.7?`#666666`:`#FFFFFF`;n.fillStyle=r.textColor||se,n.textAlign=`center`,n.textBaseline=`middle`,n.font=El(i,r.bold,r.italic);let ce=-((l.length-1)*a)/2;for(let e=0;e<l.length;e++){let t=Wl(n,ee,l[e],r,`px`);n.fillText(t,ae,ce+e*a)}n.restore()}}let Tf={id:`waterfallLinesPlugin`,beforeDraw(e,t,n){if(!n.showConnectorLines)return;let r=e._metasets?.[0]?.data;if(!r)return;let i=e.ctx;i.save(),i.setLineDash([3,2]);for(let e=0;e<r.length;e++){let t=r[e];if(t.height===0)continue;let n=Df(r,e);if(!n)break;let a=Ef(t),o=Ef(n),s=t.$context.raw,c=s[1]-s[0],l=Math.round(c<0?a.bottom-1:a.top),u=Math.round(a.right),d=Math.round(o.left);i.strokeStyle=`#999`,i.beginPath(),i.moveTo(u+1,l+.5),i.lineTo(d,l+.5),i.stroke()}i.restore()}};function Ef(e){let t=e.base<e.y;return{left:e.x-e.width/2,right:e.x+e.width/2,bottom:t?e.base+e.height:e.y+e.height,top:t?e.base:e.y}}function Df(e,t){return e.find((e,n)=>n>t&&e.height!==0)}let Of={id:`zoomWindowPlugin`,afterDatasetsDraw:function(e,t,n){if(!n.getLowerBound||!n.getUpperBound)return;let{ctx:r,chartArea:{left:i,right:a,top:o,bottom:s}}=e,c=n.getLowerBound()??i,l=n.getUpperBound()??a;c>l&&([c,l]=[l,c]),c=Math.max(i,c),l=Math.min(a,l),c===i&&--c,l===a&&(l+=1),r.save(),r.fillStyle=`rgba(255,255,255,0.5)`,r.beginPath(),r.rect(i,s,c-i,o-s),r.rect(l,s,a-l,o-s),r.fill(),r.beginPath(),r.strokeStyle=`#bbb`,r.rect(c,s,l-c,o-s),r.stroke(),r.lineWidth=2,r.beginPath(),r.moveTo(c-3,(o+s)/2-7),r.lineTo(c-3,(o+s)/2+7),r.stroke(),r.beginPath(),r.moveTo(l+3,(o+s)/2-7),r.lineTo(l+3,(o+s)/2+7),r.stroke(),r.restore()}};ql.add(`chartShowValuesPlugin`,{register:e=>e.register(yd),unregister:e=>e.unregister(yd)}),ql.add(`waterfallLinesPlugin`,{register:e=>e.register(Tf),unregister:e=>e.unregister(Tf)}),ql.add(`funnelController`,{register:e=>e.register(eu()),unregister:e=>e.unregister(eu())}),ql.add(`funnelElement`,{register:e=>e.register(tu()),unregister:e=>e.unregister(tu())}),ql.add(`funnelTooltipPositioner`,{register:e=>e.Tooltip.positioners.funnelTooltipPositioner=ru,unregister:e=>e.Tooltip.positioners.funnelTooltipPositioner=void 0}),ql.add(`sunburstLabelsPlugin`,{register:e=>e.register(Cf),unregister:e=>e.unregister(Cf)}),ql.add(`sunburstHoverPlugin`,{register:e=>e.register(xf),unregister:e=>e.unregister(xf)}),ql.add(`chartColorScalePlugin`,{register:e=>e.register($l),unregister:e=>e.unregister($l)}),ql.add(`calendarController`,{register:e=>e.register(Ql()),unregister:e=>e.unregister(Ql())}),ql.add(`zoomWindowPlugin`,{register:e=>e.register(Of),unregister:e=>e.unregister(Of)});var kf=class extends t.Component{static template=`o-spreadsheet-ChartJsComponent`;static props={chartId:String,isFullScreen:{type:Boolean,optional:!0}};canvas=(0,t.useRef)(`graphContainer`);chart;currentRuntime;animationStore;currentDevicePixelRatio=window.devicePixelRatio;get background(){return this.chartRuntime.background}get canvasStyle(){return`background-color: ${this.background}`}get chartRuntime(){let e=this.env.model.getters.getChartRuntime(this.props.chartId);if(!(`chartJsConfig`in e))throw Error(`Unsupported chart runtime`);return e}setup(){this.shouldAnimate&&(this.animationStore=D(Zl)),(0,t.onMounted)(()=>{Yl();let e=this.chartRuntime;this.currentRuntime=e,this.createChart(b(e))}),(0,t.onWillUnmount)(this.unmount.bind(this)),(0,t.useEffect)(()=>{let e=this.chartRuntime;e===this.currentRuntime?this.currentDevicePixelRatio!==window.devicePixelRatio&&(this.currentDevicePixelRatio=window.devicePixelRatio,this.updateChartJs(b(this.currentRuntime))):(e.chartJsConfig.type===this.currentRuntime.chartJsConfig.type?this.updateChartJs(b(e)):(this.chart?.destroy(),this.createChart(b(e))),this.currentRuntime=e)})}unmount(){this.chart?.destroy()}get shouldAnimate(){return this.env.model.getters.isDashboard()}createChart(e){if(!globalThis.Chart)throw Error(`Chart.js library is not loaded`);let t=e.chartJsConfig;if(this.shouldAnimate&&this.animationStore){let e=this.env.model.getters.getChart(this.props.chartId)?.type;e&&this.animationStore.animationPlayed[this.animationChartId]!==e&&(t=this.enableAnimationInChartData(t),this.animationStore.disableAnimationForChart(this.animationChartId,e))}let n=this.canvas.el.getContext(`2d`);this.chart=new globalThis.Chart(n,t)}updateChartJs(e){let t=e.chartJsConfig;if(this.shouldAnimate){let e=this.env.model.getters.getChart(this.props.chartId)?.type;e&&this.hasChartDataChanged()&&this.animationStore&&(t=this.enableAnimationInChartData(t),this.animationStore.disableAnimationForChart(this.animationChartId,e))}t.data&&t.data.datasets?(this.chart.data=t.data,t.options?.plugins?.title&&(this.chart.config.options.plugins.title=t.options.plugins.title)):this.chart.data.datasets=[],this.chart.config.options=t.options,this.chart.update()}hasChartDataChanged(){return!w(this.getChartDataInRuntime(this.currentRuntime),this.getChartDataInRuntime(this.chartRuntime))}enableAnimationInChartData(e){return{...e,options:{...e.options,animation:{animateRotate:!0}}}}getChartDataInRuntime(e){let t=e.chartJsConfig.data;return{labels:t.labels,dataset:t.datasets.map(e=>({data:e.data,label:e.label,tree:e.tree}))}}get animationChartId(){return this.props.isFullScreen?this.props.chartId+`-fullscreen`:this.props.chartId}},Af=class{sheetId;title;getters;humanize;constructor(e,t,n){this.title=e.title,this.sheetId=t,this.getters=n,this.humanize=e.humanize??!0}static validateChartDefinition(e,t){throw Error(`This method should be implemented by sub class`)}static transformDefinition(e,t,n){throw Error(`This method should be implemented by sub class`)}static getDefinitionFromContextCreation(e){throw Error(`This method should be implemented by sub class`)}getCommonDataSetAttributesForExcel(e,t,n){return{dataSets:t.map(e=>rd(this.getters,e)).filter(e=>e.range!==``&&e.range!==A.InvalidReference),labelRange:id(this.getters,e,n)}}};function jf(e,t,n,r,i){if(!e)return``;if(n===`text`||t?.type!==`number`||e.type!==`number`)return r?gs(e,i):e.formattedValue;let{value:a,format:o}=e;return n===`progress`?(a=t.value/a,o=`0.0%`):(a=Math.abs(t.value-a),n===`percentage`&&a!==0&&(a/=e.value),n===`percentage`&&(o=`0.0%`),o||(a=Math.round(a*100)/100)),r?gs({value:a,format:o},i):z(a,{format:o,locale:i})}function Mf(e,t,n){return e?t?gs(e,n):e.formattedValue??String(e.value??``):``}function Nf(e,t,n,r,i){if(t===`text`||t===`progress`||e?.type!==`number`||n?.type!==`number`)return;let a=n.value-e.value;if(a>0)return r;if(a<0)return i}function Pf(e,t,n){if(n===`text`||e?.type!==`number`||t?.type!==`number`)return`neutral`;let r=t.value-e.value;return r>0?`up`:r<0?`down`:`neutral`}function Ff(e){return e.keyValue&&!kc.test(e.keyValue)?`InvalidScorecardKeyValue`:`Success`}function If(e){return e.baseline&&!kc.test(e.baseline)?`InvalidScorecardBaseline`:`Success`}let Lf=globalThis.Path2D,Rf=Lf&&new Lf(`M8.6 4.8a.5.5 0 0 1 0 .75l-3.9 3.9a.5 .5 0 0 1 -.75 0l-3.8 -3.9a.5 .5 0 0 1 0 -.75l.4-.4a.5.5 0 0 1 .75 0l2.3 2.4v-5.7c0-.25.25-.5.5-.5h.6c.25 0 .5.25.5.5v5.8l2.3 -2.4a.5.5 0 0 1 .75 0z`),zf=Lf&&new Lf(`M8.7 5.5a.5.5 0 0 0 0-.75l-3.8-4a.5.5 0 0 0-.75 0l-3.8 4a.5.5 0 0 0 0 .75l.4.4a.5.5 0 0 0 .75 0l2.3-2.4v5.8c0 .25.25.5.5.5h.6c.25 0 .5-.25.5-.5v-5.8l2.2 2.4a.5.5 0 0 0 .75 0z`);var Bf=class e extends Af{keyValue;keyDescr;baseline;baselineMode;baselineDescr;progressBar=!1;background;baselineColorUp;baselineColorDown;fontColor;humanize;type=`scorecard`;constructor(e,t,n){super(e,t,n),this.keyValue=Qc(n,t,e.keyValue),this.keyDescr=e.keyDescr,this.baseline=Qc(n,t,e.baseline),this.baselineMode=e.baselineMode,this.baselineDescr=e.baselineDescr,this.background=e.background,this.baselineColorUp=e.baselineColorUp??`#43C5B1`,this.baselineColorDown=e.baselineColorDown??`#EA6175`,this.humanize=e.humanize??!0}static validateChartDefinition(e,t){return e.checkValidations(t,Ff,If)}static getDefinitionFromContextCreation(e){return{background:e.background,type:`scorecard`,keyValue:e.range?.[0]?.dataRange,title:e.title||{text:``},baselineMode:De,baselineColorUp:Oe,baselineColorDown:ke,baseline:e.auxiliaryRange||``,humanize:e.humanize}}static transformDefinition(e,t,n){let r,i;if(t.baseline){let{changeType:i,range:a}=Gu(e,t.baseline,n);i!==`REMOVE`&&(r=a)}if(t.keyValue){let{changeType:r,range:a}=Gu(e,t.keyValue,n);r!==`REMOVE`&&(i=a)}return{...t,baseline:r,keyValue:i}}duplicateInDuplicatedSheet(t){let n=$u(this.sheetId,t,this.baseline),r=$u(this.sheetId,t,this.keyValue);return new e(this.getDefinitionWithSpecificRanges(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificRanges(this.baseline,this.keyValue,t),t,this.getters)}getDefinition(){return this.getDefinitionWithSpecificRanges(this.baseline,this.keyValue)}getContextCreation(){return{...this,range:this.keyValue?[{dataRange:this.getters.getRangeString(this.keyValue,this.sheetId)}]:void 0,auxiliaryRange:this.baseline?this.getters.getRangeString(this.baseline,this.sheetId):void 0}}getDefinitionWithSpecificRanges(e,t,n){return{baselineColorDown:this.baselineColorDown,baselineColorUp:this.baselineColorUp,baselineMode:this.baselineMode,title:this.title,type:`scorecard`,background:this.background,baseline:e?this.getters.getRangeString(e,n||this.sheetId):void 0,baselineDescr:this.baselineDescr,keyValue:t?this.getters.getRangeString(t,n||this.sheetId):void 0,keyDescr:this.keyDescr,humanize:this.humanize}}getDefinitionForExcel(){}updateRanges({applyChange:t}){let n=ed(this.baseline,t),r=ed(this.keyValue,t);return this.baseline===n&&this.keyValue===r?this:new e(this.getDefinitionWithSpecificRanges(n,r),this.sheetId,this.getters)}};function Vf(e,t,n=1){let r=t.getContext(`2d`);if(!r)throw Error(`Unable to retrieve 2D context from canvas`);let i=typeof globalThis.devicePixelRatio==`number`?globalThis.devicePixelRatio:1;t.width=i*e.canvas.width*n,t.height=i*e.canvas.height*n,r.scale(i*n,i*n);let a=e.canvas.width-20;if(r.fillStyle=e.canvas.backgroundColor,r.fillRect(0,0,e.canvas.width,e.canvas.height),e.title){r.font=e.title.style.font,r.fillStyle=e.title.style.color;let t=r.textBaseline;r.textBaseline=`middle`,r.fillText(Hl(r,e.title.text,a-e.title.position.x),e.title.position.x,e.title.position.y),r.textBaseline=t}if(e.baseline&&(r.font=e.baseline.style.font,r.fillStyle=e.baseline.style.color,Ul(r,e.baseline.text,e.baseline.position,e.baseline.style.underline,e.baseline.style.strikethrough)),e.baselineArrow&&e.baselineArrow.style.size>0&&Lf){r.save(),r.fillStyle=e.baselineArrow.style.color,r.translate(e.baselineArrow.position.x,e.baselineArrow.position.y);let t=e.baselineArrow.style.size/10;switch(r.scale(t,t),e.baselineArrow.direction){case`down`:r.fill(Rf);break;case`up`:r.fill(zf);break}r.restore()}if(e.baselineDescr){let t=e.baselineDescr;r.font=t.style.font,r.fillStyle=t.style.color,r.fillText(Hl(r,t.text,a-t.position.x),t.position.x,t.position.y)}if(e.key&&(r.font=e.key.style.font,r.fillStyle=e.key.style.color,Ul(r,Hl(r,e.key.text,a-e.key.position.x),e.key.position,e.key.style.underline,e.key.style.strikethrough)),e.keyDescr){let t=e.keyDescr;r.font=e.keyDescr?.style.font??t.style.font,r.fillStyle=t.style.color,r.fillText(Hl(r,t.text,a-t.position.x),t.position.x,t.position.y)}if(e.progressBar){if(r.fillStyle=e.progressBar.style.backgroundColor,r.beginPath(),r.roundRect(e.progressBar.position.x,e.progressBar.position.y,e.progressBar.dimension.width,e.progressBar.dimension.height,e.progressBar.dimension.height/2),r.fill(),r.fillStyle=e.progressBar.style.color,r.beginPath(),e.progressBar.value>0)r.roundRect(e.progressBar.position.x,e.progressBar.position.y,e.progressBar.dimension.width*Math.max(0,Math.min(1,e.progressBar.value)),e.progressBar.dimension.height,e.progressBar.dimension.height/2);else{let t=e.progressBar.dimension.width*Math.max(0,Math.min(1,-e.progressBar.value));r.roundRect(e.progressBar.position.x+e.progressBar.dimension.width-t,e.progressBar.position.y,t,e.progressBar.dimension.height,e.progressBar.dimension.height/2)}r.fill()}}function Hf(e,t){let n=``,r,i=t.getLocale();if(e.keyValue){let a={sheetId:e.keyValue.sheetId,col:e.keyValue.zone.left,row:e.keyValue.zone.top};r=t.getEvaluatedCell(a),n=Mf(r,e.humanize??!0,i)}let a,o=e.baseline;if(o){let e={sheetId:o.sheetId,col:o.zone.left,row:o.zone.top};a=t.getEvaluatedCell(e)}let{background:s,fontColor:c}=t.getStyleOfSingleCellChart(e.background,e.keyValue),l=jf(a,r,e.baselineMode,e.humanize??!0,i),u=e.baselineMode===`progress`&&$i(l,i)?N(l,i):0;return{title:{...e.title,text:e.title.text?t.dynamicTranslate(e.title.text):``},keyValue:n,keyDescr:e.keyDescr?.text?t.dynamicTranslate(e.keyDescr.text):``,baselineDisplay:l,baselineArrow:Pf(a,r,e.baselineMode),baselineColor:Nf(a,e.baselineMode,r,e.baselineColorUp,e.baselineColorDown),baselineDescr:e.baselineMode!==`progress`&&e.baselineDescr?.text?t.dynamicTranslate(e.baselineDescr.text):``,fontColor:c,background:s,baselineStyle:{...e.baselineMode!==`percentage`&&e.baselineMode!==`progress`&&o?t.getCellComputedStyle({sheetId:o.sheetId,col:o.zone.left,row:o.zone.top}):void 0,fontSize:e.baselineDescr?.fontSize,align:e.baselineDescr?.align},baselineDescrStyle:{textColor:e.baselineDescr?.color,...e.baselineDescr},keyValueStyle:{...e.keyValue?t.getCellComputedStyle({sheetId:e.keyValue.sheetId,col:e.keyValue.zone.left,row:e.keyValue.zone.top}):void 0,fontSize:e.keyDescr?.fontSize,align:e.keyDescr?.align},keyValueDescrStyle:{textColor:e.keyDescr?.color,...e.keyDescr},progressBar:e.baselineMode===`progress`?{value:u,color:u>0?e.baselineColorUp:e.baselineColorDown}:void 0}}let Uf=.05;function Wf(e,t){let n=e||``;return t&&n?` `+n:n}function Gf({width:e,height:t},n){return new Kf({width:e,height:t},n).computeDesign()}var Kf=class{runtime;context;width;height;constructor({width:e,height:t},n){if(this.runtime=n,this.width=e,this.height=t,typeof OffscreenCanvas>`u`)throw Error(`OffscreenCanvas is not supported in this environment`);let r=new globalThis.OffscreenCanvas(e,t).getContext(`2d`);if(!r)throw Error(`Unable to create scorecard measurement context`);this.context=r}computeDesign(){let e={canvas:{width:this.width,height:this.height,backgroundColor:this.backgroundColor}},t=this.getTextStyles(),n=0;if(this.title){let r,i;switch({height:n,width:i}=this.getFullTextDimensions(this.title,t.title.font),this.runtime.title.align){case`center`:r=(this.width-i)/2;break;case`right`:r=this.width-i-20;break;default:r=20}e.title={text:this.title,style:t.title,position:{x:r,y:10+n/2}}}let r=t.baselineArrow?.size??0,{height:i,width:a}=this.getTextDimensions(this.baseline,t.baselineValue.font);this.baseline||(i=this.getTextDimensions(this.baselineDescr,t.baselineDescr.font).height);let o=this.getTextDimensions(this.baselineDescr,t.baselineDescr.font).width,s;switch(this.runtime.baselineStyle?.align){case`right`:s=this.width-20-o-a;break;case`left`:s=20+r;break;default:s=(this.width-a-o+r)/2}if(this.baseline&&(e.baseline={text:this.baseline,style:t.baselineValue,position:{x:s,y:this.keyValue?this.height*(1-Uf*(this.runtime.progressBar?1:2)):this.height-(this.height-n-i)/2-10}},t.baselineArrow&&!this.runtime.progressBar&&(e.baselineArrow={direction:this.baselineArrow,style:t.baselineArrow,position:{x:e.baseline.position.x-r,y:e.baseline.position.y-(i+r)/2}})),e.baseline&&this.baselineDescr){let n={x:e.baseline.position.x+a,y:e.baseline.position.y};e.baselineDescr={text:this.baselineDescr,style:t.baselineDescr,position:n}}let c=0;this.runtime.progressBar&&(c=this.height*.05,e.progressBar={position:{x:40,y:this.height*(1-2*Uf)-i-c},dimension:{height:c,width:this.width-80},value:this.runtime.progressBar.value,style:{color:this.runtime.progressBar.color,backgroundColor:this.secondaryFontColor}});let{width:l,height:u}=this.getFullTextDimensions(this.keyValue,t.keyValue.font),d=this.getTextDimensions(this.keyDescr,t.keyDescr.font).width,f;switch(this.runtime.keyValueStyle?.align){case`right`:f=this.width-20-d-l;break;case`left`:f=20;break;default:f=(this.width-l-d)/2}if(this.keyValue&&(e.key={text:this.keyValue,style:t.keyValue,position:{x:Math.max(20,f),y:this.height*(.5-Uf*2)+10/2+(n+u/2)/2}}),e.key&&this.keyDescr){let n={x:e.key.position.x+l,y:e.key.position.y};e.keyDescr={text:this.keyDescr,style:t.keyDescr,position:n}}return e}get title(){return this.runtime.title.text??``}get keyValue(){return this.runtime.keyValue}get keyDescr(){return Wf(this.runtime.keyDescr,this.keyValue)}get baseline(){return this.runtime.baselineDisplay}get baselineDescr(){return Wf(this.runtime.baselineDescr,this.baseline)}get baselineArrow(){return this.runtime.baselineArrow}get backgroundColor(){return this.runtime.background}get secondaryFontColor(){return sd(this.backgroundColor)}getTextDimensions(e,t){this.context.font=t;let n=this.context.measureText(e);return{width:n.width,height:n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}}getFullTextDimensions(e,t){this.context.font=t;let n=this.context.measureText(e);return{width:n.width,height:n.fontBoundingBoxAscent+n.fontBoundingBoxDescent}}getTextStyles(){let e=this.runtime.keyValueStyle?.fontSize??32,t=Math.floor(.9*e),n=this.runtime.baselineStyle?.fontSize??16,r=Math.floor(.9*n);return this.runtime.progressBar&&(n/=1.5),{title:{font:El(this.runtime.title.fontSize??14,this.runtime.title.bold,this.runtime.title.italic),color:this.runtime.title.color??this.secondaryFontColor},keyValue:{color:this.runtime.keyValueStyle?.textColor||this.runtime.fontColor,font:El(e,this.runtime.keyValueStyle?.bold,this.runtime.keyValueStyle?.italic),strikethrough:this.runtime.keyValueStyle?.strikethrough,underline:this.runtime.keyValueStyle?.underline},keyDescr:{color:this.runtime.keyValueDescrStyle?.textColor||this.runtime.fontColor,font:El(t,this.runtime.keyValueDescrStyle?.bold,this.runtime.keyValueDescrStyle?.italic),strikethrough:this.runtime.keyValueDescrStyle?.strikethrough,underline:this.runtime.keyValueDescrStyle?.underline},baselineValue:{font:El(n,this.runtime.baselineStyle?.bold,this.runtime.baselineStyle?.italic),strikethrough:this.runtime.baselineStyle?.strikethrough,underline:this.runtime.baselineStyle?.underline,color:this.runtime.baselineColor||this.runtime.baselineStyle?.textColor||this.secondaryFontColor},baselineDescr:{font:El(r,this.runtime.baselineDescrStyle?.bold,this.runtime.baselineDescrStyle?.italic),strikethrough:this.runtime.baselineDescrStyle?.strikethrough,underline:this.runtime.baselineDescrStyle?.underline,color:this.runtime.baselineDescrStyle?.textColor??this.secondaryFontColor},baselineArrow:this.baselineArrow===`neutral`||this.runtime.progressBar?void 0:{size:this.keyValue?.8*n:0,color:this.runtime.baselineColor||this.runtime.baselineStyle?.textColor||this.secondaryFontColor}}}};let qf=/Mac/i,Jf=!1;function Yf(){let e=document.createElement(`div`);e.setAttribute(`style`,`width:10px;height:1px;zoom:2;position:absolute;z-index:-10000`),document.body.appendChild(e),Jf=e.getBoundingClientRect().width!==20,document.body.removeChild(e)}(0,t.whenReady)(Yf);let Xf=[`Shift`,`Control`,`Alt`,`Meta`];function Zf(e,t){return e?!!t.target&&e.contains(t.target):!1}function Qf(e=1){let t=document.querySelector(`.o-grid-overlay`),n=t&&$f(t,e);if(!n)throw Error(`Can't find spreadsheet position`);return n}function $f(e,t){let n=e.closest(`.o-zoomable`),r,i=1;n?(r=n,i=Jf?t:1):r=e;let a=r.getBoundingClientRect();return{x:a.x*i,y:a.y*i,width:a.width*i,height:a.height*i}}function ep(e){return e.el?tp(e.el):{x:0,y:0,width:0,height:0}}function tp(e){let t=e.getBoundingClientRect();return{x:t.x,y:t.y,width:t.width,height:t.height}}function*np(e){if(yield e,e.hasChildNodes())for(let t of e.childNodes)yield*np(t)}function rp(){return Array.from(document.querySelectorAll(`.o-spreadsheet .o-menu`))}function ip(e){let{startElement:t,endElement:n,startSelectionOffset:r,endSelectionOffset:i}=ap(e);return{start:op(e,t,r),end:op(e,n,i)}}function ap(e){let t=document.getSelection();return{startElement:t.anchorNode||e,startSelectionOffset:t.anchorOffset,endElement:t.focusNode||e,endSelectionOffset:t.focusOffset}}function op(e,t,n){let r=0,i=np(e),a=i.next(),o=!0;for(;!a.done&&a.value!==t;)a.value.hasChildNodes()||a.value.textContent&&(r+=a.value.textContent.length),(a.value.nodeName===`P`||a.value.nodeName===`DIV`&&a.value!==e)&&(o?o=!1:r++),a=i.next();if(a.value!==t)return 0;if(!a.value.hasChildNodes())r+=n;else{let e=[...a.value.childNodes].slice(0,n);r+=e.reduce((t,n,r)=>{if(n.textContent!==null){let i=n.textContent.length;return n.nodeName===`P`&&r!==e.length-1&&i++,t+i}else return t},0)}return t.nodeName===`P`&&!o&&t.textContent===``&&r++,r}let sp=/^[a-zA-Z]$/;function cp(e,t=`key`){let n=``;Xf.includes(e.key)||(up(e)&&(n+=`Ctrl+`),e.altKey&&(n+=`Alt+`),e.shiftKey&&(n+=`Shift+`));let r=t===`key`?e.key:e.code;return n+=sp.test(r)?r.toUpperCase():r,n}function lp(){return!!qf.test(navigator.userAgent)}function up(e){return lp()||gp()?e.metaKey:e.ctrlKey}function dp(e){return e.button===1||up(e)&&e.button===0}function fp(e,t){let n=document.createElement(`a`);n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function pp(){return/Firefox/i.test(navigator.userAgent)}function mp(){return navigator.maxTouchPoints||1}function hp(){return/Android/i.test(navigator.userAgent)}function gp(){return/(iPad|iPhone|iPod)/i.test(navigator.userAgent)||navigator.platform===`MacIntel`&&mp()>1}function _p(){return/(webOS|BlackBerry|Windows Phone)/i.test(navigator.userAgent)}function vp(){return hp()||gp()||_p()}function yp(e,t,n){let r=e.model.getters.getViewportZoomLevel();if(n===void 0&&(n=Sp(t,r)),!n)return bp(t);let i=t.clientX-n.x,a=t.clientY-n.y,o=i/r,s=a/r;return{ev:t,clientX:t.clientX-i+o,clientY:t.clientY-a+s,offsetX:o,offsetY:s}}function bp(e){return{ev:e,clientX:e.clientX,clientY:e.clientY,offsetX:e.offsetX,offsetY:e.offsetY}}function xp(e,t){return{height:t.height*e,width:t.width*e,x:t.x*e,y:t.y*e}}function Sp(e,t){let n=e.target;return!n||!(`classList`in n)||!(n instanceof Element)?null:$f(n,t)}var Cp=class extends t.Component{static template=`o-spreadsheet-ScorecardChart`;static props={chartId:String,isFullScreen:{type:Boolean,optional:!0}};canvas=(0,t.useRef)(`chartContainer`);get runtime(){return this.env.model.getters.getChartRuntime(this.props.chartId)}get title(){let e=this.env.model.getters.getChartDefinition(this.props.chartId).title.text;return e?this.env.model.getters.dynamicTranslate(e):``}setup(){(0,t.useEffect)(this.createChart.bind(this),()=>{let e=this.canvas.el.getBoundingClientRect();return[e.width,e.height,this.runtime,this.canvas.el,window.devicePixelRatio]})}createChart(){let e=this.canvas.el,t=this.env.model.getters.getViewportZoomLevel();Vf(Gf(xp(1/t,e.getBoundingClientRect()),this.runtime),e,t)}};function V(e){return e=wr(e).replace(`#`,``),e.length===8?e.slice(6)+e.slice(0,6):e}let wp=`#F3F2F1`;function Tp(e,t,n=1,r){let i=r??Ep(e),a=typeof globalThis.devicePixelRatio==`number`?globalThis.devicePixelRatio:1;e.width=i.width*a,e.height=i.height*a;let o=e.getContext(`2d`);if(!o)throw Error(`Unable to retrieve 2D context from canvas`);o.scale(a*n,a*n);let s=Mp({width:i.width/n,height:i.height/n,x:0,y:0},t,o);Op(o,s),Dp(o,s),Ap(o,s),kp(o,s),jp(o,s)}function Ep(e){if(e instanceof HTMLCanvasElement){let t=e.getBoundingClientRect();return{width:t.width,height:t.height}}return{width:e.width,height:e.height}}function Dp(e,t){e.save();let n=t.gauge,r=n.rect.x+n.rect.width/2,i=n.rect.y+n.rect.height,a=n.rect.height-n.arcWidth/2;if(a<0)return;let o=n.percentage===1?0:Math.PI*(1+n.percentage);e.strokeStyle=wp,e.beginPath(),e.lineWidth=n.arcWidth,e.arc(r,i,a,o,0),e.stroke(),e.strokeStyle=n.color,e.beginPath(),e.arc(r,i,a,Math.PI,o),e.stroke(),e.restore()}function Op(e,t){e.save(),e.fillStyle=t.backgroundColor,e.fillRect(0,0,t.width,t.height),e.restore()}function kp(e,t){for(let n of[t.minLabel,t.maxLabel,t.gaugeValue])e.save(),e.textAlign=`center`,e.fillStyle=n.color,e.font=`${n.fontSize}px ${we}`,e.fillText(n.label,n.textPosition.x,n.textPosition.y),e.restore()}function Ap(e,t){let{x:n,y:r,width:i,height:a}=t.gauge.rect;for(let o of t.inflectionValues){e.save(),e.translate(n+i/2-.5,r+a-.5),e.rotate(Math.PI/2-o.rotation),e.lineWidth=2,e.strokeStyle=sd(t.backgroundColor)+`aa`,e.beginPath(),e.moveTo(0,-(a-t.gauge.arcWidth)),e.lineTo(0,-a-3),e.stroke(),e.textAlign=`center`,e.font=`${o.fontSize}px ${we}`,e.fillStyle=o.color;let s=-a-6-o.offset;e.fillText(o.label,0,s),e.restore()}}function jp(e,t){e.save();let n=t.title;e.font=El(n.fontSize,n.bold,n.italic),e.textBaseline=`middle`,e.fillStyle=n.color,e.fillText(n.label,n.textPosition.x,n.textPosition.y),e.restore()}function Mp(e,t,n){let r=t.maxValue,i=t.minValue,a=Bp(t,`animated`),o=Np(e,t.title.text),s=o.width/6,c=a?(a-i.value)/(r.value-i.value):0,l={x:e.width/2,y:o.y+o.height-o.height/12},u=80;o.height<300&&(u*=o.height/300);let d=o.width/2,f=t.gaugeValue?.label||`-`;Ol(n,f,{fontSize:u},`px`)>d&&(u=Rl(d,u,e=>Ol(n,f,{fontSize:e},`px`)));let p={x:o.x+s/2,y:o.y+o.height+12},m={x:o.x+o.width-s/2,y:o.y+o.height+12},h=sd(t.background),g=Pp(t,o,h,n),_=0,v=0,y=0;switch(t.title.text&&({width:v,height:y}=jl(n,t.title.text,{fontSize:16,...t.title},`px`)),t.title.align){case`right`:_=e.width-v-20;break;case`center`:_=(e.width-v)/2;break;default:_=20;break}return{width:e.width,height:e.height,title:{label:t.title.text??``,fontSize:t.title.fontSize??16,textPosition:{x:_,y:15+y/2},color:t.title.color??h,bold:t.title.bold,italic:t.title.italic},backgroundColor:t.background,gauge:{rect:o,arcWidth:s,percentage:x(c,0,1),color:Fp(t)},inflectionValues:g,gaugeValue:{label:f,textPosition:l,fontSize:u,color:h},minLabel:{label:t.minValue.label,textPosition:p,fontSize:12,color:h},maxLabel:{label:t.maxValue.label,textPosition:m,fontSize:12,color:h}}}function Np(e,t){let n=t?25:0,r=e.height-20-n-10,i=e.width-60,a,o;return i>2*r?(a=2*r,o=r):(a=i,o=i/2),{x:30+(i-a)/2,y:n+10+(r-o)/2,width:a,height:o}}function Pp(e,t,n,r){let i=e.maxValue,a=e.minValue,o={x:t.x+t.width/2,y:t.y+t.height},s={fontSize:12},c=[],l=[];for(let u of e.inflectionValues){let e=(u.value-a.value)/(i.value-a.value),d=Ol(r,u.label,s,`px`),f=Math.PI-Math.PI*e,p=zp(f,t.height+6,o.x,o.y,d+2,12),m=l.some(e=>Rp(e,p))?12:0;l.push(p),c.push({rotation:f,label:u.label,fontSize:12,color:n,offset:m})}return c}function Fp(e){let t=Bp(e,`final`);if(t===void 0)return wp;for(let n=0;n<e.inflectionValues.length;n++){let r=e.inflectionValues[n];if(r.operator===`<`&&t<r.value||r.operator===`<=`&&t<=r.value)return e.colors[n]}return e.colors.at(-1)}function Ip(e){return[{start:e.topLeft,end:e.topRight},{start:e.topRight,end:e.bottomRight},{start:e.bottomRight,end:e.bottomLeft},{start:e.bottomLeft,end:e.topLeft}]}function Lp(e,t){let n=e.start,r=e.end,i=t.start,a=t.end;function o(e,t,n){return(n.y-e.y)*(t.x-e.x)>(t.y-e.y)*(n.x-e.x)}return o(n,i,a)!==o(r,i,a)&&o(n,r,i)!==o(n,r,a)}function Rp(e,t){let n=Ip(e),r=Ip(t);for(let e of n)for(let t of r)if(Lp(e,t))return!0;return!1}function zp(e,t,n,r,i,a){let o=Math.cos(e),s=Math.sin(e),c=o*t,l=s*t,u=i/2*s,d=i/2*o,f={x:c+u+n,y:r-(l-d)},p={x:c-u+n,y:r-(l+d)},m=o*(t+a),h=s*(t+a),g={x:m-u+n,y:r-(h+d)};return{bottomLeft:p,bottomRight:f,topRight:{x:m+u+n,y:r-(h-d)},topLeft:g}}function Bp(e,t){return t===`animated`&&e.animationValue!==void 0?e.animationValue:e.gaugeValue?.value}let Vp={responsive:!0,maintainAspectRatio:!1,elements:{line:{fill:!1},point:{hitRadius:15}},animation:!1,events:[`mousemove`,`mouseout`,`click`,`touchstart`,`touchmove`,`mouseup`]};async function Hp(e,t,n){let r=Gp(t.width,t.height),i;if(`chartJsConfig`in e){if(!globalThis.Chart)return console.log(`Chart.js library is not loaded`),i;let t=Jl();t||Yl();let n=b(e.chartJsConfig);if(n.plugins=[Wp],!globalThis.Chart.registry.controllers.get(n.type))return console.log(`Chart of type "${n.type}" is not registered in Chart.js library.`),t||Xl(),i;let a=new globalThis.Chart(r,n);try{i=await qp(r)}finally{a.destroy(),t||Xl()}}else{if(!globalThis.OffscreenCanvas)throw Error(`converting a ${n} chart to an image using OffscreenCanvas is not supported in this environment`);n===`scorecard`?(Vf(Gf(t,e),r),i=await qp(r)):n===`gauge`&&(Tp(r,e,1,t),i=await qp(r))}return i}async function Up(e,t,n){let r=Gp(t.width,t.height),i=null;if(`chartJsConfig`in e){if(!globalThis.Chart)return console.log(`Chart.js library is not loaded`),i;let t=Jl();t||Yl();let n=b(e.chartJsConfig);if(n.plugins=[Wp],!globalThis.Chart.registry.controllers.get(n.type))return console.log(`Chart of type "${n.type}" is not registered in Chart.js library.`),t||Xl(),i;let a=new globalThis.Chart(r,n);try{i=await Kp(r)}finally{a.destroy(),t||Xl()}}else{if(!globalThis.OffscreenCanvas)throw Error(`converting a ${n} chart to an image using OffscreenCanvas is not supported in this environment`);n===`scorecard`?(Vf(Gf(t,e),r),i=await Kp(r)):n===`gauge`&&(Tp(r,e,1,t),i=await Kp(r))}return i}let Wp={id:`customCanvasBackgroundColor`,beforeDraw:e=>{let{ctx:t}=e;t.save(),t.globalCompositeOperation=`destination-over`,t.fillStyle=`#ffffff`,t.fillRect(0,0,e.width,e.height),t.restore()}};function Gp(e,t){return new OffscreenCanvas(e,t)}async function Kp(e){return`convertToBlob`in e?e.convertToBlob({type:`image/png`}):new Promise(t=>e.toBlob(t,`image/png`))}async function qp(e){let t=await Kp(e);if(t)return new Promise(e=>{let n=new FileReader;n.addEventListener(`load`,()=>{e(n.result)}),n.readAsDataURL(t)})}let Jp={Errors:{InvalidRange:k(`The range is invalid`),FirstArgMissing:k(`The argument is missing. Please provide a value`),SecondArgMissing:k(`The second argument is missing. Please provide a value`),MinNaN:k(`The minpoint must be a number`),MidNaN:k(`The midpoint must be a number`),MaxNaN:k(`The maxpoint must be a number`),ValueUpperInflectionNaN:k(`The first value must be a number`),ValueLowerInflectionNaN:k(`The second value must be a number`),MinBiggerThanMax:k(`Minimum must be smaller then Maximum`),MinBiggerThanMid:k(`Minimum must be smaller then Midpoint`),MidBiggerThanMax:k(`Midpoint must be smaller then Maximum`),LowerBiggerThanUpper:k(`Lower inflection point must be smaller than upper inflection point`),MinInvalidFormula:k(`Invalid Minpoint formula`),MaxInvalidFormula:k(`Invalid Maxpoint formula`),MidInvalidFormula:k(`Invalid Midpoint formula`),ValueUpperInvalidFormula:k(`Invalid upper inflection point formula`),ValueLowerInvalidFormula:k(`Invalid lower inflection point formula`),EmptyRange:k(`A range needs to be defined`),ValueCellIsInvalidFormula:k(`At least one of the provided values is an invalid formula`),Unexpected:k(`The rule is invalid for an unknown reason`)},ColorScale:k(`Color scale`),IconSet:k(`Icon set`),DataBar:k(`Data bar`)},Yp={Series:k(`Series`),BackgroundColor:k(`Background color`),StackedBarChart:k(`Stacked bar chart`),StackedLineChart:k(`Stacked line chart`),StackedAreaChart:k(`Stacked area chart`),StackedColumnChart:k(`Stacked column chart`),CumulativeData:k(`Cumulative data`),TreatLabelsAsText:k(`Treat labels as text`),AggregatedChart:k(`Aggregate`),Errors:{Unexpected:k(`The chart definition is invalid for an unknown reason`),InvalidDataSet:k(`The dataset is invalid`),InvalidLabelRange:k(`Labels are invalid`),InvalidScorecardKeyValue:k(`The key value is invalid`),InvalidScorecardBaseline:k(`The baseline value is invalid`),InvalidGaugeDataRange:k(`The data range is invalid`),EmptyGaugeRangeMin:k(`A minimum range limit value is needed`),GaugeRangeMinNaN:k(`The minimum range limit value must be a number`),EmptyGaugeRangeMax:k(`A maximum range limit value is needed`),GaugeRangeMaxNaN:k(`The maximum range limit value must be a number`),GaugeLowerInflectionPointNaN:k(`The lower inflection point value must be a number`),GaugeUpperInflectionPointNaN:k(`The upper inflection point value must be a number`)},ColorScales:{blues:k(`Blues`),cividis:k(`Cividis`),custom:k(`Custom`),greens:k(`Greens`),greys:k(`Greys`),oranges:k(`Oranges`),purples:k(`Purples`),rainbow:k(`Rainbow`),reds:k(`Reds`),viridis:k(`Viridis`)}},Xp={Custom:k(`Custom`)},Zp=k(`Merged cells are preventing this operation. Unmerge those cells and try again.`),Qp=k(`The header row of a table can't be moved.`),$p={Errors:{Unexpected:k(`Cannot split the selection for an unknown reason`),NoSplitSeparatorInSelection:k(`There is no match for the selected separator in the selection`),MoreThanOneColumnSelected:k(`Only a selection from a single column can be split`),SplitWillOverwriteContent:k(`Splitting will overwrite existing content`)}},em={Errors:{Unexpected:k(`Cannot remove duplicates for an unknown reason`),MoreThanOneRangeSelected:k(`Please select only one range of cells`),EmptyTarget:k(`Please select a range of cells containing values.`),NoColumnsProvided:k(`Please select at latest one column to analyze.`),WillRemoveExistingMerge:k(`This operation is not possible due to a merge. Please remove the merges first than try again.`)}},H={DateIs:{today:k(`today`),yesterday:k(`yesterday`),tomorrow:k(`tomorrow`),lastWeek:k(`in the past week`),lastMonth:k(`in the past month`),lastYear:k(`in the past year`)},DateIsBefore:{today:k(`today`),yesterday:k(`yesterday`),tomorrow:k(`tomorrow`),lastWeek:k(`one week ago`),lastMonth:k(`one month ago`),lastYear:k(`one year ago`)},CriterionError:{notEmptyValue:k(`The value must not be empty`),numberValue:k(`The value must be a number`),dateValue:k(`The value must be a date`),validRange:k(`The value must be a valid range`),validFormula:k(`The formula must be valid`)},Errors:{InvalidRange:k(`The range is invalid.`),InvalidDataValidationCriterionValue:k(`One or more of the provided criteria values are invalid. Please review and correct them.`),InvalidNumberOfCriterionValues:k(`One or more of the provided criteria values are missing.`),Unexpected:k(`The rule is invalid for an unknown reason.`)}},tm={Errors:{Unexpected:k(`The table zone is invalid for an unknown reason`),TableOverlap:k(`You cannot create overlapping tables.`),NonContinuousTargets:k(`A table can only be created on a continuous selection.`),InvalidRange:k(`The range is invalid`),TargetOutOfSheet:k(`The range is out of the sheet`)},Checkboxes:{hasFilters:k(`Filter button`),headerRow:k(`Header row(s)`),bandedRows:k(`Banded rows`),firstColumn:k(`First column`),lastColumn:k(`Last column`),bandedColumns:k(`Banded columns`),automaticAutofill:k(`Automatically autofill formulas`),totalRow:k(`Total row`),isDynamic:k(`Auto-adjust to formula result`)},Tooltips:{filterWithoutHeader:k(`Cannot have filters without a header row`),isDynamic:k(`For tables based on array formulas only`)}},nm={labels:{no_calculations:k(`No calculations`),"%_of_grand_total":k(`% of grand total`),"%_of_col_total":k(`% of column total`),"%_of_row_total":k(`% of row total`),"%_of":k(`% of`),"%_of_parent_row_total":k(`% of parent row total`),"%_of_parent_col_total":k(`% of parent column total`),"%_of_parent_total":k(`% of parent total`),difference_from:k(`Difference from`),"%_difference_from":k(`% difference from`),running_total:k(`Running total`),"%_running_total":k(`% Running total`),rank_asc:k(`Rank smallest to largest`),rank_desc:k(`Rank largest to smallest`),index:k(`Index`)},descriptions:{"%_of_grand_total":()=>k(`Displayed as % of grand total`),"%_of_col_total":()=>k(`Displayed as % of column total`),"%_of_row_total":()=>k(`Displayed as % of row total`),"%_of":e=>k(`Displayed as % of "%s"`,e),"%_of_parent_row_total":e=>k(`Displayed as % of parent row total of "%s"`,e),"%_of_parent_col_total":()=>k(`Displayed as % of parent column total`),"%_of_parent_total":e=>k(`Displayed as % of parent "%s" total`,e),difference_from:e=>k(`Displayed as difference from "%s"`,e),"%_difference_from":e=>k(`Displayed as % difference from "%s"`,e),running_total:e=>k(`Displayed as running total based on "%s"`,e),"%_running_total":e=>k(`Displayed as % running total based on "%s"`,e),rank_asc:e=>k(`Displayed as rank from smallest to largest based on "%s"`,e),rank_desc:e=>k(`Displayed as rank largest to smallest based on "%s"`,e),index:()=>k(`Displayed as index`)},documentation:{no_calculations:k(`Displays the value that is entered in the field.`),"%_of_grand_total":k(`Displays values as a percentage of the grand total of all the values or data points in the report.`),"%_of_col_total":k(`Displays all the values in each column or series as a percentage of the total for the column or series.`),"%_of_row_total":k(`Displays the value in each row or category as a percentage of the total for the row or category.`),"%_of":k(`Displays values as a percentage of the value of the Base item in the Base field.`),"%_of_parent_row_total":k(`Calculates values as follows:
|
|
15
15
|
(value for the item) / (value for the parent item on rows)`),"%_of_parent_col_total":k(`Calculates values as follows:
|
|
16
16
|
(value for the item) / (value for the parent item on columns)`),"%_of_parent_total":k(`Calculates values as follows:
|
|
17
17
|
(value for the item) / (value for the parent item of the selected Base field)`),difference_from:k(`Displays values as the difference from the value of the Base item in the Base field.`),"%_difference_from":k(`Displays values as the percentage difference from the value of the Base item in the Base field.`),running_total:k(`Displays the value for successive items in the Base field as a running total.`),"%_running_total":k(`Calculates the value as a percentage for successive items in the Base field that are displayed as a running total.`),rank_asc:k(`Displays the rank of selected values in a specific field, listing the smallest item in the field as 1, and each larger value with a higher rank value.`),rank_desc:k(`Displays the rank of selected values in a specific field, listing the largest item in the field as 1, and each smaller value with a higher rank value.`),index:k(`Calculates values as follows:
|
|
@@ -930,4 +930,4 @@ You can download it directly instead.`,5),sticky:!1,type:`warning`});return}r=aw
|
|
|
930
930
|
<Relationships xmlns="${ou.Relationships}">
|
|
931
931
|
<Relationship ${Z(e)} />
|
|
932
932
|
</Relationships>
|
|
933
|
-
`),`_rels/.rels`)}function ZX(e){let t={},n=[];for(let r of e.sheets){let e=r.name.slice(0,31);e=zt(e,n,{compute:(e,t)=>e.slice(0,31-String(t).length)+t}),n.push(e),e!==r.name&&(t[r.name]=e,r.name=e)}if(!Object.keys(t).length)return e;let r=Object.keys(t).sort((e,t)=>t.length-e.length),i=JSON.stringify(e);for(let e of r){let n=RegExp(`'?${Ge(e)}'?!`,`g`);i=i.replaceAll(n,n=>{let r=t[e];return n.replace(e,r)})}return JSON.parse(i)}function QX(e){for(let t of e.sheets)t.tables=t.tables.filter(e=>On(un(e.range)).numberOfRows>1);return e}var $X=class extends er{corePlugins=[];statefulUIPlugins=[];range;session;isReplayingCommand=!1;renderers={};status=0;config;corePluginConfig;coreViewPluginConfig;uiPluginConfig;state;selection;getters;coreGetters;uuidGenerator;handlers=[];uiHandlers=[];coreHandlers=[];constructor(e={},t={},n=[],r=new Kl,i=!1){let a=performance.now();console.debug(`##### Model creation #####`),super(),la(),n=hP(e,n);let o=sP(e,i);this.state=new pY,this.uuidGenerator=r,this.config=this.setupConfig(t),this.session=this.setupSession(o.revisionId),this.coreGetters={},this.range=new uY(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.copyFormulaStringForSheet=this.range.copyFormulaStringForSheet.bind(this.range),this.getters={isReadonly:()=>this.config.mode===`readonly`||this.config.mode===`dashboard`,isDashboard:()=>this.config.mode===`dashboard`},this.selection=new fY(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 dq.getAll())this.setupCorePlugin(e,o);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(n);for(let e of mq.getAll()){let t=this.setupCoreViewPlugin(e);this.handlers.push(t),this.uiHandlers.push(t),this.coreHandlers.push(t)}for(let e of pq.getAll()){let t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of fq.getAll()){let 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(),t.snapshotRequested||e[`[Content_Types].xml`]&&!this.getters.isReadonly()){let e=performance.now();console.debug(`Snapshot requested`),this.session.snapshot(this.exportData()),console.debug(`Snapshot taken in`,performance.now()-e,`ms`)}console.debug(`Model created in`,performance.now()-a,`ms`),console.debug(`######`)}joinSession(){this.session.join(this.config.client)}async leaveSession(){let e=this.getters.isReadonly()?void 0:mt(()=>this.exportData());await this.session.leave(e)}setupUiPlugin(e){let t=new e(this.uiPluginConfig);for(let n of e.getters){if(!(n in t))throw Error(`Invalid getter name: ${n} for plugin ${t.constructor}`);if(n in this.getters)throw Error(`Getter "${n}" is already defined.`);this.getters[n]=t[n].bind(t)}for(let n of e.layers)this.renderers[n]||(this.renderers[n]=[]),this.renderers[n].push(t);return t}setupCoreViewPlugin(e){let t=new e(this.coreViewPluginConfig);for(let n of e.getters){if(!(n in t))throw Error(`Invalid getter name: ${n} for plugin ${t.constructor}`);if(n in this.getters)throw Error(`Getter "${n}" is already defined.`);this.getters[n]=t[n].bind(t)}return t}setupCorePlugin(e,t){let n=new e(this.corePluginConfig);for(let t of e.getters){if(!(t in n))throw Error(`Invalid getter name: ${t} for plugin ${n.constructor}`);if(t in this.coreGetters)throw Error(`Getter "${t}" is already defined.`);this.coreGetters[t]=n[t].bind(n)}n.import(t),this.corePlugins.push(n),this.coreHandlers.push(n),this.handlers.push(n)}onRemoteRevisionReceived({commands:e}){for(let t of e){let e=this.status;this.status=2,this.dispatchToHandlers(this.statefulUIPlugins,t),this.status=e}this.finalize()}setupSession(e){return new NK(sY({initialRevisionId:e,recordChanges:this.state.recordChanges.bind(this.state),dispatch:e=>{if(!this.checkDispatchAllowed(e).isSuccessful){this.dispatchToHandlers(this.coreHandlers,{type:`UNDO`,commands:[e]});return}this.isReplayingCommand=!0,this.dispatchToHandlers(this.coreHandlers,e),this.isReplayingCommand=!1}}),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){let t=e.client||{id:this.uuidGenerator.smallUuid(),name:k(`Anonymous`).toString()},n=e.transportService||new fJ,r=e.mode===`readonly`||e.mode===`dashboard`;return{...e,mode:e.mode||`normal`,custom:e.custom||{},external:this.setupExternalConfig(e.external||{}),transportService:r?new $J(n):n,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){let t=e.loadLocales||(()=>Promise.resolve(fo));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,custom:this.config.custom,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){let t=Us(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e);return t.some(e=>e!==`Success`)?new Gs(t.flat()):Gs.Success}checkDispatchAllowedCoreCommand(e){let 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(let e of this.handlers)e.finalize();this.status=0,this.trigger(`command-finalized`)}canDispatch=(e,t)=>this.checkDispatchAllowed(eZ(e,t));dispatch=(e,t)=>{let n=eZ(e,t),r=this.status;if(this.getters.isReadonly()&&!Ws(n))return new Gs(`Readonly`);if(!this.session.canApplyOptimisticUpdate())return new Gs(`WaitingSessionConfirmation`);switch(r){case 0:let t=this.checkDispatchAllowed(n);if(!t.isSuccessful)return this.trigger(`update`),t;this.status=1;let{changes:r,commands:i}=this.state.recordChanges(()=>{let t=performance.now();Us(n)&&this.state.addCommand(n),this.dispatchToHandlers(this.handlers,n),this.finalize();let r=performance.now()-t;r>5&&console.debug(e,r,`ms`)});this.session.save(n,i,r),this.status=0,this.trigger(`update`);break;case 1:if(Us(n)){let e=this.checkDispatchAllowed(n);if(!e.isSuccessful)return e;this.state.addCommand(n)}this.dispatchToHandlers(this.handlers,n);break;case 3:throw Error(`Cannot dispatch commands in the finalize state`);case 2:if(Us(n))throw Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,n)}return Gs.Success};dispatchFromCorePlugin=(e,t)=>{let n=eZ(e,t),r=this.status;this.status=2;let i=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(i,n),this.status=r,Gs.Success};dispatchToHandlers(e,t){let n=Us(t);for(let r of e)!n&&r instanceof fW||r.beforeHandle(t);for(let r of e)!n&&r instanceof fW||r.handle(t);this.trigger(`command-dispatched`,t)}drawLayer(e,t){let n=this.renderers[t];if(n)for(let r of n)e.ctx.save(),r.drawLayer(e,t),e.ctx.restore()}exportData(){let e=SP();for(let t of this.handlers)t instanceof fW&&t.export(e);return e.revisionId=this.session.getRevisionId()||`START_REVISION`,e=b(e),e}updateMode(e){this.config.mode=e,this.trigger(`update`)}async exportXLSX(){this.dispatch(`EVALUATE_CELLS`);let e=wP();for(let t of this.handlers)t instanceof sb&&await t.exportForExcel(e);return e=b(e),HX(e)}};function eZ(e,t={}){let n=b(t);return n.type=e,n}function tZ(e){return!WV.includes(e.horizontalGroupBy)||!WV.includes(e.verticalGroupBy)?`InvalidChartDefinition`:`Success`}var nZ=class e extends Af{dataSets;labelRange;background;type=`calendar`;showValues;colorScale;axesDesign;horizontalGroupBy;verticalGroupBy;legendPosition;missingValueColor;constructor(e,t,n){super(e,t,n),this.dataSets=td(n,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Qc(n,t,e.labelRange),this.background=e.background,this.showValues=e.showValues,this.colorScale=e.colorScale,this.axesDesign=e.axesDesign,this.horizontalGroupBy=e.horizontalGroupBy,this.verticalGroupBy=e.verticalGroupBy,this.legendPosition=e.legendPosition,this.missingValueColor=e.missingValueColor}static transformDefinition(e,t,n){return ad(e,t,n)}static validateChartDefinition(e,t){return e.checkValidations(t,cd,ld,tZ)}static getDefinitionFromContextCreation(e){let t=`left`;return e.legendPosition===`right`&&(t=`right`),{background:e.background,dataSets:e.range??[],dataSetsHaveTitle:e.dataSetsHaveTitle??!1,title:e.title||{text:``},type:`calendar`,labelRange:e.auxiliaryRange||void 0,showValues:e.showValues,axesDesign:e.axesDesign,legendPosition:t,horizontalGroupBy:`day_of_week`,verticalGroupBy:`month_number`}}getContextCreation(){let e=[{dataRange:this.getters.getRangeString(this.dataSets[0].dataRange,this.sheetId)}];return{...this,range:e,auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}duplicateInDuplicatedSheet(t){let n=Qu(this.sheetId,t,this.dataSets),r=$u(this.sheetId,t,this.labelRange);return new e(this.getDefinitionWithSpecificDataSets(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,t),t,this.getters)}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getDefinitionWithSpecificDataSets(e,t,n){let r=e.map(e=>({dataRange:this.getters.getRangeString(e.dataRange,n||this.sheetId)}));return{type:`calendar`,background:this.background,dataSets:r,dataSetsHaveTitle:e.length?!!e[0].labelCell:!1,labelRange:t?this.getters.getRangeString(t,n||this.sheetId):void 0,title:this.title,showValues:this.showValues,colorScale:this.colorScale,axesDesign:this.axesDesign,horizontalGroupBy:this.horizontalGroupBy,verticalGroupBy:this.verticalGroupBy,legendPosition:this.legendPosition,missingValueColor:this.missingValueColor}}getDefinitionForExcel(){}updateRanges({applyChange:t}){let{dataSets:n,labelRange:r,isStale:i}=Zu(this.getters,t,this.dataSets,this.labelRange);return i?new e(this.getDefinitionWithSpecificDataSets(n,r),this.sheetId,this.getters):this}};function rZ(e,t){let n=e.getDefinition(),r=Hh(n,e.dataSets,e.labelRange,t),{labels:i,datasets:a}=Zd(n,r);return{chartJsConfig:{type:`calendar`,data:{labels:i,datasets:a},options:{...Vp,indexAxis:`x`,layout:Eg(n,r),scales:Pd(n,a),plugins:{title:Gg(n,t),legend:{display:!1},tooltip:Xg(n,r),chartShowValuesPlugin:Bg(n,r),chartColorScalePlugin:Fd(n,r)},chartBackground:n.background||`#FFFFFF`}},background:e.background||`#FFFFFF`}}var iZ=class e extends Af{dataSets;labelRange;background;legendPosition;aggregated;dataSetsHaveTitle;dataSetDesign;axesDesign;type=`combo`;showValues;hideDataMarkers;zoomable;constructor(e,t,n){super(e,t,n),this.dataSets=td(n,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Qc(n,t,e.labelRange),this.background=e.background,this.legendPosition=e.legendPosition,this.aggregated=e.aggregated,this.dataSetsHaveTitle=e.dataSetsHaveTitle,this.dataSetDesign=e.dataSets,this.axesDesign=e.axesDesign,this.showValues=e.showValues,this.hideDataMarkers=e.hideDataMarkers,this.zoomable=e.zoomable}static transformDefinition(e,t,n){return ad(e,t,n)}static validateChartDefinition(e,t){return e.checkValidations(t,cd,ld)}getContextCreation(){let e=[];for(let[t,n]of this.dataSets.entries())e.push({...this.dataSetDesign?.[t],dataRange:this.getters.getRangeString(n.dataRange,this.sheetId)});return{...this,range:e,auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getDefinitionWithSpecificDataSets(e,t,n){let r=[];for(let[t,i]of e.entries())r.push({...this.dataSetDesign?.[t],dataRange:this.getters.getRangeString(i.dataRange,n||this.sheetId),type:this.dataSetDesign?.[t]?.type??(t?`line`:`bar`)});return{type:`combo`,dataSetsHaveTitle:e.length?!!e[0].labelCell:!1,background:this.background,dataSets:r,legendPosition:this.legendPosition,labelRange:t?this.getters.getRangeString(t,n||this.sheetId):void 0,title:this.title,aggregated:this.aggregated,axesDesign:this.axesDesign,showValues:this.showValues,hideDataMarkers:this.hideDataMarkers,zoomable:this.zoomable,humanize:this.humanize}}getDefinitionForExcel(){let{dataSets:e,labelRange:t}=this.getCommonDataSetAttributesForExcel(this.labelRange,this.dataSets,ud(this.labelRange,this.dataSets[0],this.dataSetsHaveTitle)),n=this.getDefinition();return{...n,backgroundColor:V(this.background||`#FFFFFF`),fontColor:V(od(this.background)),dataSets:e,labelRange:t,verticalAxis:fd(n)}}updateRanges({applyChange:t}){let{dataSets:n,labelRange:r,isStale:i}=Zu(this.getters,t,this.dataSets,this.labelRange);return i?new e(this.getDefinitionWithSpecificDataSets(n,r),this.sheetId,this.getters):this}static getDefinitionFromContextCreation(e){let t=(e.range??[]).map((e,t)=>({...e,type:t?`line`:`bar`}));return{background:e.background,dataSets:t,dataSetsHaveTitle:e.dataSetsHaveTitle??!1,aggregated:e.aggregated,legendPosition:e.legendPosition??`top`,title:e.title||{text:``},labelRange:e.auxiliaryRange||void 0,type:`combo`,axesDesign:e.axesDesign,showValues:e.showValues,hideDataMarkers:e.hideDataMarkers,zoomable:e.zoomable,humanize:e.humanize}}duplicateInDuplicatedSheet(t){let n=Qu(this.sheetId,t,this.dataSets),r=$u(this.sheetId,t,this.labelRange);return new e(this.getDefinitionWithSpecificDataSets(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,t),t,this.getters)}};function aZ(e,t){let n=e.getDefinition(),r=zh(n,e.dataSets,e.labelRange,t);return{chartJsConfig:{type:`bar`,data:{labels:r.labels,datasets:nf(n,r)},options:{...Vp,layout:Tg(n,r),scales:Nd(n,r),plugins:{title:Gg(n,t),legend:Mg(n,r),tooltip:Yg(n,r),chartShowValuesPlugin:zg(n,r)}}},background:e.background||`#FFFFFF`}}var oZ=class e extends Af{dataSets;labelRange;background;legendPosition;aggregated;type=`funnel`;dataSetsHaveTitle;dataSetDesign;axesDesign;horizontal=!0;showValues;funnelColors;cumulative;constructor(e,t,n){super(e,t,n),this.dataSets=td(n,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Qc(n,t,e.labelRange),this.background=e.background,this.legendPosition=e.legendPosition,this.aggregated=e.aggregated,this.dataSetsHaveTitle=e.dataSetsHaveTitle,this.dataSetDesign=e.dataSets,this.axesDesign=e.axesDesign,this.showValues=e.showValues,this.horizontal=!0,this.funnelColors=e.funnelColors,this.cumulative=e.cumulative}static transformDefinition(e,t,n){return ad(e,t,n)}static validateChartDefinition(e,t){return e.checkValidations(t,cd,ld)}static getDefinitionFromContextCreation(e){return{background:e.background,dataSets:e.range??[],dataSetsHaveTitle:e.dataSetsHaveTitle??!1,aggregated:e.aggregated??!1,legendPosition:`none`,title:e.title||{text:``},type:`funnel`,labelRange:e.auxiliaryRange||void 0,showValues:e.showValues,axesDesign:e.axesDesign,funnelColors:e.funnelColors,horizontal:!0,cumulative:e.cumulative,humanize:e.humanize}}getContextCreation(){let e=[];for(let[t,n]of this.dataSets.entries())e.push({...this.dataSetDesign?.[t],dataRange:this.getters.getRangeString(n.dataRange,this.sheetId)});return{...this,range:e,auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}duplicateInDuplicatedSheet(t){let n=Qu(this.sheetId,t,this.dataSets),r=$u(this.sheetId,t,this.labelRange);return new e(this.getDefinitionWithSpecificDataSets(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,t),t,this.getters)}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getDefinitionWithSpecificDataSets(e,t,n){let r=[];for(let[t,i]of e.entries())r.push({...this.dataSetDesign?.[t],dataRange:this.getters.getRangeString(i.dataRange,n||this.sheetId)});return{type:`funnel`,dataSetsHaveTitle:e.length?!!e[0].labelCell:!1,background:this.background,dataSets:r,legendPosition:this.legendPosition,labelRange:t?this.getters.getRangeString(t,n||this.sheetId):void 0,title:this.title,aggregated:this.aggregated,horizontal:this.horizontal,axesDesign:this.axesDesign,showValues:this.showValues,funnelColors:this.funnelColors,cumulative:this.cumulative,humanize:this.humanize}}getDefinitionForExcel(){}updateRanges({applyChange:t}){let{dataSets:n,labelRange:r,isStale:i}=Zu(this.getters,t,this.dataSets,this.labelRange);return i?new e(this.getDefinitionWithSpecificDataSets(n,r),this.sheetId,this.getters):this}};function sZ(e,t){let n=e.getDefinition(),r=Jh(n,e.dataSets,e.labelRange,t);return{chartJsConfig:{type:`funnel`,data:{labels:r.labels,datasets:of(n,r)},options:{...Vp,indexAxis:`y`,layout:Tg(n,r),scales:Hd(n,r),plugins:{title:Gg(n,t),legend:{display:!1},tooltip:r_(n,r),chartShowValuesPlugin:zg(n,r)}}},background:e.background||`#FFFFFF`}}var cZ=class e extends Af{dataSets;labelRange;background;legendPosition;type=`geo`;dataSetsHaveTitle;dataSetDesign;colorScale;missingValueColor;region;constructor(e,t,n){super(e,t,n),this.dataSets=td(n,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Qc(n,t,e.labelRange),this.background=e.background,this.legendPosition=e.legendPosition,this.dataSetsHaveTitle=e.dataSetsHaveTitle,this.dataSetDesign=e.dataSets,this.colorScale=e.colorScale,this.missingValueColor=e.missingValueColor,this.region=e.region}static transformDefinition(e,t,n){return ad(e,t,n)}static validateChartDefinition(e,t){return e.checkValidations(t,cd,ld)}static getDefinitionFromContextCreation(e){return{background:e.background,dataSets:e.range??[],dataSetsHaveTitle:e.dataSetsHaveTitle??!1,legendPosition:e.legendPosition??`top`,title:e.title||{text:``},type:`geo`,labelRange:e.auxiliaryRange||void 0,humanize:e.humanize}}getContextCreation(){let e=[];for(let[t,n]of this.dataSets.entries())e.push({...this.dataSetDesign?.[t],dataRange:this.getters.getRangeString(n.dataRange,this.sheetId)});return{...this,range:e,auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}duplicateInDuplicatedSheet(t){let n=Qu(this.sheetId,t,this.dataSets),r=$u(this.sheetId,t,this.labelRange);return new e(this.getDefinitionWithSpecificDataSets(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,t),t,this.getters)}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getDefinitionWithSpecificDataSets(e,t,n){let r=[];for(let[t,i]of e.entries())r.push({...this.dataSetDesign?.[t],dataRange:this.getters.getRangeString(i.dataRange,n||this.sheetId)});return{type:`geo`,dataSetsHaveTitle:e.length?!!e[0].labelCell:!1,background:this.background,dataSets:r,legendPosition:this.legendPosition,labelRange:t?this.getters.getRangeString(t,n||this.sheetId):void 0,title:this.title,colorScale:this.colorScale,missingValueColor:this.missingValueColor,region:this.region,humanize:this.humanize}}getDefinitionForExcel(){}updateRanges({applyChange:t}){let{dataSets:n,labelRange:r,isStale:i}=Zu(this.getters,t,this.dataSets,this.labelRange);return i?new e(this.getDefinitionWithSpecificDataSets(n,r),this.sheetId,this.getters):this}};function lZ(e,t){let n=e.getDefinition(),r=qh(n,e.dataSets,e.labelRange,t);return{chartJsConfig:{type:`choropleth`,data:{datasets:af(n,r)},options:{...Vp,layout:Tg(n,r),scales:Vd(n,r),plugins:{title:Gg(n,t),tooltip:n_(n,r),legend:{display:!1}}}},background:e.background||`#FFFFFF`}}var uZ=class e extends Af{dataSets;labelRange;background;legendPosition;aggregated;type=`pyramid`;dataSetsHaveTitle;dataSetDesign;axesDesign;horizontal=!0;stacked=!0;showValues;constructor(e,t,n){super(e,t,n),this.dataSets=td(n,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Qc(n,t,e.labelRange),this.background=e.background,this.legendPosition=e.legendPosition,this.aggregated=e.aggregated,this.dataSetsHaveTitle=e.dataSetsHaveTitle,this.dataSetDesign=e.dataSets,this.axesDesign=e.axesDesign,this.showValues=e.showValues}static transformDefinition(e,t,n){return ad(e,t,n)}static validateChartDefinition(e,t){return e.checkValidations(t,cd,ld)}static getDefinitionFromContextCreation(e){return{background:e.background,dataSets:e.range??[],dataSetsHaveTitle:e.dataSetsHaveTitle??!1,aggregated:e.aggregated??!1,legendPosition:e.legendPosition??`top`,title:e.title||{text:``},type:`pyramid`,labelRange:e.auxiliaryRange||void 0,axesDesign:e.axesDesign,horizontal:!0,stacked:!0,showValues:e.showValues,humanize:e.humanize}}getContextCreation(){let e=[];for(let[t,n]of this.dataSets.entries())e.push({...this.dataSetDesign?.[t],dataRange:this.getters.getRangeString(n.dataRange,this.sheetId)});return{...this,range:e,auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}duplicateInDuplicatedSheet(t){let n=Qu(this.sheetId,t,this.dataSets),r=$u(this.sheetId,t,this.labelRange);return new e(this.getDefinitionWithSpecificDataSets(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,t),t,this.getters)}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getDefinitionWithSpecificDataSets(e,t,n){let r=[];for(let[t,i]of e.entries())r.push({...this.dataSetDesign?.[t],dataRange:this.getters.getRangeString(i.dataRange,n||this.sheetId)});return{type:`pyramid`,dataSetsHaveTitle:e.length?!!e[0].labelCell:!1,background:this.background,dataSets:r,legendPosition:this.legendPosition,labelRange:t?this.getters.getRangeString(t,n||this.sheetId):void 0,title:this.title,aggregated:this.aggregated,axesDesign:this.axesDesign,horizontal:!0,stacked:!0,showValues:this.showValues,humanize:this.humanize}}getDefinitionForExcel(e){let{dataSets:t,labelRange:n}=this.getCommonDataSetAttributesForExcel(this.labelRange,this.dataSets,ud(this.labelRange,this.dataSets[0],this.dataSetsHaveTitle)),r=this.getDefinition(),{dataSetsValues:i}=Uh(r,this.dataSets,this.labelRange,e),a=Math.max(...i.map(e=>Math.max(...e.data.map(Math.abs))));return{...r,horizontal:!0,backgroundColor:V(this.background||`#FFFFFF`),fontColor:V(od(this.background)),dataSets:t,labelRange:n,verticalAxis:fd(r),maxValue:a}}updateRanges({applyChange:t}){let{dataSets:n,labelRange:r,isStale:i}=Zu(this.getters,t,this.dataSets,this.labelRange);return i?new e(this.getDefinitionWithSpecificDataSets(n,r),this.sheetId,this.getters):this}};function dZ(e,t){let n=e.getDefinition(),r=Uh(n,e.dataSets,e.labelRange,t);return{chartJsConfig:{type:`bar`,data:{labels:r.labels,datasets:Xd(n,r)},options:{...Vp,indexAxis:`y`,layout:Tg(n,r),scales:zd(n,r),plugins:{title:Gg(n,t),legend:Og(n,r),tooltip:e_(n,r),chartShowValuesPlugin:Hg(n,r)}}},background:e.background||`#FFFFFF`}}var fZ=class e extends Af{dataSets;labelRange;background;legendPosition;stacked;aggregated;type=`radar`;dataSetsHaveTitle;dataSetDesign;fillArea;showValues;hideDataMarkers;constructor(e,t,n){super(e,t,n),this.dataSets=td(n,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Qc(n,t,e.labelRange),this.background=e.background,this.legendPosition=e.legendPosition,this.stacked=e.stacked,this.aggregated=e.aggregated,this.dataSetsHaveTitle=e.dataSetsHaveTitle,this.dataSetDesign=e.dataSets,this.fillArea=e.fillArea,this.showValues=e.showValues,this.hideDataMarkers=e.hideDataMarkers}static transformDefinition(e,t,n){return ad(e,t,n)}static validateChartDefinition(e,t){return e.checkValidations(t,cd,ld)}static getDefinitionFromContextCreation(e){return{background:e.background,dataSets:e.range??[],dataSetsHaveTitle:e.dataSetsHaveTitle??!1,stacked:e.stacked??!1,aggregated:e.aggregated??!1,legendPosition:e.legendPosition??`top`,title:e.title||{text:``},type:`radar`,labelRange:e.auxiliaryRange||void 0,fillArea:e.fillArea??!1,showValues:e.showValues??!1,hideDataMarkers:e.hideDataMarkers,humanize:e.humanize}}getContextCreation(){let e=[];for(let[t,n]of this.dataSets.entries())e.push({...this.dataSetDesign?.[t],dataRange:this.getters.getRangeString(n.dataRange,this.sheetId)});return{...this,range:e,auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}duplicateInDuplicatedSheet(t){let n=Qu(this.sheetId,t,this.dataSets),r=$u(this.sheetId,t,this.labelRange);return new e(this.getDefinitionWithSpecificDataSets(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,t),t,this.getters)}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getDefinitionWithSpecificDataSets(e,t,n){let r=[];for(let[t,i]of e.entries())r.push({...this.dataSetDesign?.[t],dataRange:this.getters.getRangeString(i.dataRange,n||this.sheetId)});return{type:`radar`,dataSetsHaveTitle:e.length?!!e[0].labelCell:!1,background:this.background,dataSets:r,legendPosition:this.legendPosition,labelRange:t?this.getters.getRangeString(t,n||this.sheetId):void 0,title:this.title,stacked:this.stacked,aggregated:this.aggregated,fillArea:this.fillArea,showValues:this.showValues,hideDataMarkers:this.hideDataMarkers,humanize:this.humanize}}getDefinitionForExcel(){let{dataSets:e,labelRange:t}=this.getCommonDataSetAttributesForExcel(this.labelRange,this.dataSets,ud(this.labelRange,this.dataSets[0],this.dataSetsHaveTitle));return{...this.getDefinition(),backgroundColor:V(this.background||`#FFFFFF`),fontColor:V(od(this.background)),dataSets:e,labelRange:t}}updateRanges({applyChange:t}){let{dataSets:n,labelRange:r,isStale:i}=Zu(this.getters,t,this.dataSets,this.labelRange);return i?new e(this.getDefinitionWithSpecificDataSets(n,r),this.sheetId,this.getters):this}};function pZ(e,t){let n=e.getDefinition(),r=Kh(n,e.dataSets,e.labelRange,t);return{chartJsConfig:{type:`radar`,data:{labels:r.labels,datasets:rf(n,r)},options:{...Vp,layout:Tg(n,r),scales:Bd(n,r),plugins:{title:Gg(n,t),legend:Pg(n,r),tooltip:t_(n,r),chartShowValuesPlugin:zg(n,r)}}},background:e.background||`#FFFFFF`}}var mZ=class e extends Af{dataSets;labelRange;background;legendPosition;type=`sunburst`;dataSetsHaveTitle;showValues;showLabels;valuesDesign;groupColors;pieHolePercentage;constructor(e,t,n){super(e,t,n),this.dataSets=td(n,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Qc(n,t,e.labelRange),this.background=e.background,this.legendPosition=e.legendPosition,this.dataSetsHaveTitle=e.dataSetsHaveTitle,this.showValues=e.showValues,this.showLabels=e.showLabels,this.valuesDesign=e.valuesDesign,this.groupColors=e.groupColors,this.pieHolePercentage=e.pieHolePercentage}static transformDefinition(e,t,n){return ad(e,t,n)}static validateChartDefinition(e,t){return e.checkValidations(t,cd,ld)}static getDefinitionFromContextCreation(e){let t=[];return e.hierarchicalRanges?.length?t.push(...e.hierarchicalRanges):e.auxiliaryRange&&t.push({...e.range?.[0],dataRange:e.auxiliaryRange}),{background:e.background,dataSets:t,dataSetsHaveTitle:e.dataSetsHaveTitle??!1,legendPosition:e.legendPosition??`top`,title:e.title||{text:``},type:`sunburst`,labelRange:e.range?.[0]?.dataRange,showValues:e.showValues,showLabels:e.showLabels,valuesDesign:e.valuesDesign,groupColors:e.groupColors,humanize:e.humanize}}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getContextCreation(){let e=this.dataSets.at(-1)?.dataRange;return{...this,range:this.labelRange?[{dataRange:this.getters.getRangeString(this.labelRange,this.sheetId)}]:[],auxiliaryRange:e?this.getters.getRangeString(e,this.sheetId):void 0,hierarchicalRanges:this.dataSets.map(e=>({dataRange:this.getters.getRangeString(e.dataRange,this.sheetId)}))}}getDefinitionWithSpecificDataSets(e,t,n){return{type:`sunburst`,dataSetsHaveTitle:e.length?!!e[0].labelCell:!1,background:this.background,dataSets:e.map(e=>({dataRange:this.getters.getRangeString(e.dataRange,n||this.sheetId)})),legendPosition:this.legendPosition,labelRange:t?this.getters.getRangeString(t,n||this.sheetId):void 0,title:this.title,showValues:this.showValues,showLabels:this.showLabels,valuesDesign:this.valuesDesign,groupColors:this.groupColors,pieHolePercentage:this.pieHolePercentage,humanize:this.humanize}}duplicateInDuplicatedSheet(t){let n=Qu(this.sheetId,t,this.dataSets),r=$u(this.sheetId,t,this.labelRange);return new e(this.getDefinitionWithSpecificDataSets(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,t),t,this.getters)}getDefinitionForExcel(){}updateRanges({applyChange:t}){let{dataSets:n,labelRange:r,isStale:i}=Zu(this.getters,t,this.dataSets,this.labelRange);return i?new e(this.getDefinitionWithSpecificDataSets(n,r),this.sheetId,this.getters):this}};function hZ(e,t){let n=e.getDefinition(),r=Yh(n,e.dataSets,e.labelRange,t);return{chartJsConfig:{type:`doughnut`,data:{datasets:cf(n,r)},options:{cutout:e.pieHolePercentage===void 0?`25%`:`${e.pieHolePercentage}%`,...Vp,layout:Tg(n,r),plugins:{title:Gg(n,t),legend:Fg(n,r),tooltip:i_(n,r),sunburstLabelsPlugin:Vg(n,r),sunburstHoverPlugin:{enabled:!0}}}},background:e.background||`#FFFFFF`}}var gZ=class e extends Af{static defaults={background:oe,legendPosition:`top`,dataSetsHaveTitle:!1,showHeaders:!0,headersColor:`#000000`};dataSets;labelRange;background;legendPosition;type=`treemap`;dataSetsHaveTitle;showHeaders;headerDesign;showValues;showLabels;valuesDesign;coloringOptions;constructor(e,t,n){super(e,t,n),this.dataSets=td(n,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Qc(n,t,e.labelRange),this.background=e.background,this.legendPosition=e.legendPosition,this.dataSetsHaveTitle=e.dataSetsHaveTitle,this.showHeaders=e.showHeaders,this.headerDesign=e.headerDesign,this.showValues=e.showValues,this.showLabels=e.showLabels,this.valuesDesign=e.valuesDesign,this.coloringOptions=e.coloringOptions}static transformDefinition(e,t,n){return ad(e,t,n)}static validateChartDefinition(e,t){return e.checkValidations(t,cd,ld)}static getDefinitionFromContextCreation(e){let t=[];return e.hierarchicalRanges?.length?t.push(...e.hierarchicalRanges):e.auxiliaryRange&&t.push({...e.range?.[0],dataRange:e.auxiliaryRange}),{background:e.background,dataSets:t,dataSetsHaveTitle:e.dataSetsHaveTitle??!1,legendPosition:e.legendPosition??`top`,title:e.title||{text:``},type:`treemap`,labelRange:e.range?.[0]?.dataRange,showValues:e.showValues,showHeaders:e.showHeaders,headerDesign:e.headerDesign,showLabels:e.showLabels,valuesDesign:e.valuesDesign,coloringOptions:e.treemapColoringOptions,humanize:e.humanize}}getContextCreation(){let e=this.dataSets.at(-1)?.dataRange;return{...this,range:this.labelRange?[{dataRange:this.getters.getRangeString(this.labelRange,this.sheetId)}]:[],auxiliaryRange:e?this.getters.getRangeString(e,this.sheetId):void 0,hierarchicalRanges:this.dataSets.map(e=>({dataRange:this.getters.getRangeString(e.dataRange,this.sheetId)}))}}duplicateInDuplicatedSheet(t){let n=Qu(this.sheetId,t,this.dataSets),r=$u(this.sheetId,t,this.labelRange);return new e(this.getDefinitionWithSpecificDataSets(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,t),t,this.getters)}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getDefinitionWithSpecificDataSets(e,t,n){let r=e.map(e=>({dataRange:this.getters.getRangeString(e.dataRange,n||this.sheetId)}));return{type:`treemap`,dataSetsHaveTitle:e.length?!!e[0].labelCell:!1,background:this.background,dataSets:r,legendPosition:this.legendPosition,labelRange:t?this.getters.getRangeString(t,n||this.sheetId):void 0,title:this.title,showValues:this.showValues,showHeaders:this.showHeaders,headerDesign:this.headerDesign,showLabels:this.showLabels,valuesDesign:this.valuesDesign,coloringOptions:this.coloringOptions,humanize:this.humanize}}getDefinitionForExcel(){}updateRanges({applyChange:t}){let{dataSets:n,labelRange:r,isStale:i}=Zu(this.getters,t,this.dataSets,this.labelRange);return i?new e(this.getDefinitionWithSpecificDataSets(n,r),this.sheetId,this.getters):this}};function _Z(e,t){let n=e.getDefinition(),r=Yh(n,e.dataSets,e.labelRange,t);return{chartJsConfig:{type:`treemap`,data:{labels:r.labels,datasets:pf(n,r)},options:{...Vp,layout:Tg(n,r),plugins:{title:Gg(n,t),legend:{display:!1},tooltip:a_(n,r)}}},background:e.background||`#FFFFFF`}}f_.add(`bar`,{match:e=>e===`bar`,createChart:(e,t,n)=>new u_(e,t,n),getChartRuntime:d_,validateChartDefinition:u_.validateChartDefinition,transformDefinition:u_.transformDefinition,getChartDefinitionFromContextCreation:u_.getDefinitionFromContextCreation,sequence:10}),f_.add(`combo`,{match:e=>e===`combo`,createChart:(e,t,n)=>new iZ(e,t,n),getChartRuntime:aZ,validateChartDefinition:iZ.validateChartDefinition,transformDefinition:iZ.transformDefinition,getChartDefinitionFromContextCreation:iZ.getDefinitionFromContextCreation,sequence:15}),f_.add(`line`,{match:e=>e===`line`,createChart:(e,t,n)=>new k_(e,t,n),getChartRuntime:A_,validateChartDefinition:k_.validateChartDefinition,transformDefinition:k_.transformDefinition,getChartDefinitionFromContextCreation:k_.getDefinitionFromContextCreation,sequence:20}),f_.add(`pie`,{match:e=>e===`pie`,createChart:(e,t,n)=>new j_(e,t,n),getChartRuntime:M_,validateChartDefinition:j_.validateChartDefinition,transformDefinition:j_.transformDefinition,getChartDefinitionFromContextCreation:j_.getDefinitionFromContextCreation,sequence:30}),f_.add(`scorecard`,{match:e=>e===`scorecard`,createChart:(e,t,n)=>new Bf(e,t,n),getChartRuntime:Hf,validateChartDefinition:Bf.validateChartDefinition,transformDefinition:Bf.transformDefinition,getChartDefinitionFromContextCreation:Bf.getDefinitionFromContextCreation,sequence:40}),f_.add(`gauge`,{match:e=>e===`gauge`,createChart:(e,t,n)=>new C_(e,t,n),getChartRuntime:w_,validateChartDefinition:C_.validateChartDefinition,transformDefinition:C_.transformDefinition,getChartDefinitionFromContextCreation:C_.getDefinitionFromContextCreation,sequence:50}),f_.add(`scatter`,{match:e=>e===`scatter`,createChart:(e,t,n)=>new lH(e,t,n),getChartRuntime:uH,validateChartDefinition:lH.validateChartDefinition,transformDefinition:lH.transformDefinition,getChartDefinitionFromContextCreation:lH.getDefinitionFromContextCreation,sequence:60}),f_.add(`waterfall`,{match:e=>e===`waterfall`,createChart:(e,t,n)=>new N_(e,t,n),getChartRuntime:P_,validateChartDefinition:N_.validateChartDefinition,transformDefinition:N_.transformDefinition,getChartDefinitionFromContextCreation:N_.getDefinitionFromContextCreation,sequence:70}),f_.add(`pyramid`,{match:e=>e===`pyramid`,createChart:(e,t,n)=>new uZ(e,t,n),getChartRuntime:dZ,validateChartDefinition:uZ.validateChartDefinition,transformDefinition:uZ.transformDefinition,getChartDefinitionFromContextCreation:uZ.getDefinitionFromContextCreation,sequence:80,dataSeriesLimit:2}),f_.add(`radar`,{match:e=>e===`radar`,createChart:(e,t,n)=>new fZ(e,t,n),getChartRuntime:pZ,validateChartDefinition:fZ.validateChartDefinition,transformDefinition:fZ.transformDefinition,getChartDefinitionFromContextCreation:fZ.getDefinitionFromContextCreation,sequence:80}),f_.add(`geo`,{match:e=>e===`geo`,createChart:(e,t,n)=>new cZ(e,t,n),getChartRuntime:lZ,validateChartDefinition:cZ.validateChartDefinition,transformDefinition:cZ.transformDefinition,getChartDefinitionFromContextCreation:cZ.getDefinitionFromContextCreation,sequence:90,dataSeriesLimit:1}),f_.add(`funnel`,{match:e=>e===`funnel`,createChart:(e,t,n)=>new oZ(e,t,n),getChartRuntime:sZ,validateChartDefinition:oZ.validateChartDefinition,transformDefinition:oZ.transformDefinition,getChartDefinitionFromContextCreation:oZ.getDefinitionFromContextCreation,sequence:100,dataSeriesLimit:1}),f_.add(`sunburst`,{match:e=>e===`sunburst`,createChart:(e,t,n)=>new mZ(e,t,n),getChartRuntime:hZ,validateChartDefinition:mZ.validateChartDefinition,transformDefinition:mZ.transformDefinition,getChartDefinitionFromContextCreation:mZ.getDefinitionFromContextCreation,sequence:30}),f_.add(`treemap`,{match:e=>e===`treemap`,createChart:(e,t,n)=>new gZ(e,t,n),getChartRuntime:_Z,validateChartDefinition:gZ.validateChartDefinition,transformDefinition:gZ.transformDefinition,getChartDefinitionFromContextCreation:gZ.getDefinitionFromContextCreation,sequence:100}),f_.add(`calendar`,{match:e=>e===`calendar`,createChart:(e,t,n)=>new nZ(e,t,n),getChartRuntime:(e,t)=>rZ(e,t),validateChartDefinition:nZ.validateChartDefinition,transformDefinition:nZ.transformDefinition,getChartDefinitionFromContextCreation:nZ.getDefinitionFromContextCreation,sequence:110,dataSeriesLimit:1}),K_.add(`line`,{matcher:e=>e.type===`line`&&!e.stacked&&!e.fillArea,displayName:k(`Line`),chartType:`line`,chartSubtype:`line`,subtypeDefinition:{stacked:!1,fillArea:!1},category:`line`,preview:`o-spreadsheet-ChartPreview.LINE_CHART`}).add(`stacked_line`,{matcher:e=>e.type===`line`&&!e.fillArea&&!!e.stacked,displayName:k(`Stacked Line`),chartType:`line`,chartSubtype:`stacked_line`,subtypeDefinition:{stacked:!0,fillArea:!1},category:`line`,preview:`o-spreadsheet-ChartPreview.STACKED_LINE_CHART`}).add(`area`,{matcher:e=>e.type===`line`&&!e.stacked&&!!e.fillArea,displayName:k(`Area`),chartType:`line`,chartSubtype:`area`,subtypeDefinition:{stacked:!1,fillArea:!0},category:`area`,preview:`o-spreadsheet-ChartPreview.AREA_CHART`}).add(`stacked_area`,{matcher:e=>e.type===`line`&&e.stacked&&!!e.fillArea,displayName:k(`Stacked Area`),chartType:`line`,chartSubtype:`stacked_area`,subtypeDefinition:{stacked:!0,fillArea:!0},category:`area`,preview:`o-spreadsheet-ChartPreview.STACKED_AREA_CHART`}).add(`scatter`,{displayName:k(`Scatter`),chartType:`scatter`,chartSubtype:`scatter`,category:`misc`,preview:`o-spreadsheet-ChartPreview.SCATTER_CHART`}).add(`column`,{matcher:e=>e.type===`bar`&&!e.stacked&&!e.horizontal,displayName:k(`Column`),chartType:`bar`,chartSubtype:`column`,subtypeDefinition:{stacked:!1,horizontal:!1},category:`column`,preview:`o-spreadsheet-ChartPreview.COLUMN_CHART`}).add(`stacked_column`,{matcher:e=>e.type===`bar`&&e.stacked&&!e.horizontal,displayName:k(`Stacked Column`),chartType:`bar`,chartSubtype:`stacked_column`,subtypeDefinition:{stacked:!0,horizontal:!1},category:`column`,preview:`o-spreadsheet-ChartPreview.STACKED_COLUMN_CHART`}).add(`bar`,{matcher:e=>e.type===`bar`&&!e.stacked&&!!e.horizontal,displayName:k(`Bar`),chartType:`bar`,chartSubtype:`bar`,subtypeDefinition:{horizontal:!0,stacked:!1},category:`bar`,preview:`o-spreadsheet-ChartPreview.BAR_CHART`}).add(`stacked_bar`,{matcher:e=>e.type===`bar`&&e.stacked&&!!e.horizontal,displayName:k(`Stacked Bar`),chartType:`bar`,chartSubtype:`stacked_bar`,subtypeDefinition:{horizontal:!0,stacked:!0},category:`bar`,preview:`o-spreadsheet-ChartPreview.STACKED_BAR_CHART`}).add(`combo`,{displayName:k(`Combo`),chartSubtype:`combo`,chartType:`combo`,category:`line`,preview:`o-spreadsheet-ChartPreview.COMBO_CHART`}).add(`pie`,{matcher:e=>e.type===`pie`&&!e.isDoughnut,displayName:k(`Pie`),chartSubtype:`pie`,chartType:`pie`,subtypeDefinition:{isDoughnut:!1},category:`pie`,preview:`o-spreadsheet-ChartPreview.PIE_CHART`}).add(`doughnut`,{matcher:e=>e.type===`pie`&&!!e.isDoughnut,displayName:k(`Doughnut`),chartSubtype:`doughnut`,chartType:`pie`,subtypeDefinition:{isDoughnut:!0},category:`pie`,preview:`o-spreadsheet-ChartPreview.DOUGHNUT_CHART`}).add(`gauge`,{displayName:k(`Gauge`),chartSubtype:`gauge`,chartType:`gauge`,category:`misc`,preview:`o-spreadsheet-ChartPreview.GAUGE_CHART`}).add(`scorecard`,{displayName:k(`Scorecard`),chartSubtype:`scorecard`,chartType:`scorecard`,category:`misc`,preview:`o-spreadsheet-ChartPreview.SCORECARD_CHART`}).add(`waterfall`,{displayName:k(`Waterfall`),chartSubtype:`waterfall`,chartType:`waterfall`,category:`misc`,preview:`o-spreadsheet-ChartPreview.WATERFALL_CHART`}).add(`pyramid`,{displayName:k(`Population Pyramid`),chartSubtype:`pyramid`,chartType:`pyramid`,category:`misc`,preview:`o-spreadsheet-ChartPreview.POPULATION_PYRAMID_CHART`}).add(`radar`,{matcher:e=>e.type===`radar`&&!e.fillArea,displayName:k(`Radar`),chartSubtype:`radar`,chartType:`radar`,subtypeDefinition:{fillArea:!1},category:`misc`,preview:`o-spreadsheet-ChartPreview.RADAR_CHART`}).add(`filled_radar`,{matcher:e=>e.type===`radar`&&!!e.fillArea,displayName:k(`Filled Radar`),chartType:`radar`,chartSubtype:`filled_radar`,subtypeDefinition:{fillArea:!0},category:`misc`,preview:`o-spreadsheet-ChartPreview.FILLED_RADAR_CHART`}).add(`geo`,{displayName:k(`Geo Chart`),chartSubtype:`geo`,chartType:`geo`,category:`misc`,preview:`o-spreadsheet-ChartPreview.GEO_CHART`}).add(`funnel`,{displayName:k(`Funnel`),chartSubtype:`funnel`,chartType:`funnel`,category:`misc`,preview:`o-spreadsheet-ChartPreview.FUNNEL_CHART`}).add(`sunburst`,{matcher:e=>e.type===`sunburst`,displayName:k(`Sunburst`),chartSubtype:`sunburst`,chartType:`sunburst`,category:`hierarchical`,preview:`o-spreadsheet-ChartPreview.SUNBURST_CHART`}).add(`treemap`,{matcher:e=>e.type===`treemap`,displayName:k(`Tree Map`),chartType:`treemap`,chartSubtype:`treemap`,category:`hierarchical`,preview:`o-spreadsheet-ChartPreview.TREE_MAP_CHART`}).add(`calendar`,{displayName:k(`Calendar`),chartSubtype:`calendar`,chartType:`calendar`,category:`misc`,preview:`o-spreadsheet-ChartPreview.CALENDAR_CHART`});var vZ=class extends OG{queuedBordersToAdd={};copy(e){let t=e.sheetId;if(e.zones.length===0)return;let{rowsIndexes:n,columnsIndexes:r}=e,i=[];for(let e of n){let n=[];for(let i of r){let r={col:i,row:e,sheetId:t};n.push(this.getters.getCellBorder(r))}i.push(n)}return{borders:i}}paste(e,t,n){let r=e.sheetId;if(n.pasteOption===`asValue`)return;let i=e.zones;if(!n.isCutOperation)this.pasteFromCopy(r,i,t.borders);else{let{left:e,top:n}=i[0];this.pasteZone(r,e,n,t.borders)}this.executeQueuedChanges(r)}pasteZone(e,t,n,r){for(let[i,a]of r.entries())for(let[r,o]of a.entries()){let a={col:t+r,row:n+i,sheetId:e};this.pasteBorder(o,a)}}pasteBorder(e,t){let n={...this.getters.getCellBorder(t),...e},r=JSON.stringify(n);this.queuedBordersToAdd[r]||(this.queuedBordersToAdd[r]=[]),this.queuedBordersToAdd[r].push(E(t))}executeQueuedChanges(e){for(let t in this.queuedBordersToAdd){let n=this.queuedBordersToAdd[t],r=JSON.parse(t),i=Qt(n,[]);this.dispatch(`SET_BORDERS_ON_TARGET`,{sheetId:e,target:i,border:r})}this.queuedBordersToAdd={}}},yZ=class extends DG{copy(e){}},bZ=class extends yZ{copy(e){let t=e.sheetId,n=this.getters.getFigure(t,e.figureId);if(!n)throw Error(`No figure for the given id: ${e.figureId}`);if(n.tag!==`carousel`)return;let r={...n},i=this.getters.getCarousel(e.figureId),a={};for(let e of i.items)if(e.type===`chart`){let n=this.getters.getChart(e.chartId);if(!n)throw Error(`No chart for the given id: ${e.chartId}`);a[e.chartId]=n.copyInSheetId(t)}return{figureId:e.figureId,copiedFigure:r,copiedCarousel:i,copiedCharts:a,copiedSheetId:t}}getPasteTarget(e){return{zones:[],figureId:new Kl().smallUuid(),sheetId:e}}paste(e,t,n){if(!e.figureId)return;let{zones:r,figureId:i}=e,a=e.sheetId,{width:o,height:s}=t.copiedFigure,c=this.getters.getMaxAnchorOffset(a,s,o),{left:l,top:u}=r[0],d={x:0,y:0};l>c.col&&(l=c.col,d.x=c.offset.x),u>c.row&&(u=c.row,d.y=c.offset.y),this.dispatch(`CREATE_CAROUSEL`,{figureId:i,sheetId:a,definition:{items:[]},col:l,row:u,offset:d,size:{height:s,width:o}});let f=new Kl,p=b(t.copiedCarousel.items);for(let e of p){if(e.type!==`chart`)continue;let n=t.copiedCharts[e.chartId],r=f.smallUuid(),o=n.copyInSheetId(a).getDefinition();this.dispatch(`CREATE_CHART`,{figureId:i,chartId:r,sheetId:a,definition:o}),e.chartId=r}this.dispatch(`UPDATE_CAROUSEL`,{sheetId:a,figureId:i,definition:{...t.copiedCarousel,items:p}}),n.isCutOperation&&this.dispatch(`DELETE_FIGURE`,{sheetId:t.copiedSheetId,figureId:t.copiedFigure.id}),this.dispatch(`SELECT_FIGURE`,{figureId:i})}isPasteAllowed(e,t,n,r){return t.length===0?`EmptyTarget`:r?.pasteOption===void 0?`Success`:`WrongFigurePasteOption`}},xZ=class extends yZ{copy(e){let t=e.sheetId,n=this.getters.getFigure(t,e.figureId);if(!n)throw Error(`No figure for the given id: ${e.figureId}`);if(n.tag!==`chart`)return;let r={...n},i=this.getters.getChartFromFigureId(e.figureId);if(!i)throw Error(`No chart for the given id: ${e.figureId}`);let a=i.copyInSheetId(t);return{figureId:e.figureId,copiedFigure:r,copiedChart:a}}getPasteTarget(e,t,n,r){return{zones:[],figureId:new Kl().smallUuid(),sheetId:e}}paste(e,t,n){if(!e.figureId)return;let{zones:r,figureId:i}=e,a=e.sheetId,{width:o,height:s}=t.copiedFigure,c=t.copiedChart.copyInSheetId(a),l=this.getters.getMaxAnchorOffset(a,s,o),{left:u,top:d}=r[0],f={x:0,y:0};u>l.col&&(u=l.col,f.x=l.offset.x),d>l.row&&(d=l.row,f.y=l.offset.y),this.dispatch(`CREATE_CHART`,{figureId:i,chartId:new Kl().smallUuid(),sheetId:a,definition:c.getDefinition(),col:u,row:d,offset:f,size:{height:s,width:o}}),n.isCutOperation&&this.dispatch(`DELETE_FIGURE`,{sheetId:t.copiedChart.sheetId,figureId:t.copiedFigure.id}),this.dispatch(`SELECT_FIGURE`,{figureId:i})}isPasteAllowed(e,t,n,r){return t.length===0?`EmptyTarget`:r?.pasteOption===void 0?`Success`:`WrongFigurePasteOption`}},SZ=class extends OG{uuidGenerator=new Kl;queuedChanges={};copy(e){if(!e.zones.length)return;let{rowsIndexes:t,columnsIndexes:n}=e,r=e.sheetId,i=[];for(let e of t){let t=[];for(let i of n){let n=Array.from(this.getters.getRulesByCell(r,i,e));t.push({position:{col:i,row:e,sheetId:r},rules:n})}i.push(t)}return{cfRules:i}}paste(e,t,n){if(this.queuedChanges={},n.pasteOption===`asValue`)return;let r=e.zones,i=e.sheetId;n.isCutOperation?this.pasteFromCut(i,r,t):this.pasteFromCopy(i,r,t.cfRules,n),this.executeQueuedChanges()}pasteFromCut(e,t,n){let r=t[0];this.pasteZone(e,r.left,r.top,n.cfRules,{isCutOperation:!0})}pasteZone(e,t,n,r,i){for(let[a,o]of r.entries())for(let[r,s]of o.entries()){let o={col:t+r,row:n+a,sheetId:e};this.pasteCf(s,o,i?.isCutOperation)}}pasteCf(e,t,n){if(e?.rules&&e.rules.length>0){let r=E(e.position),i=E(t);for(let a of e.rules){let o=[];if(n&&o.push(r),e.position.sheetId===t.sheetId)this.adaptCFRules(e.position.sheetId,a,[i],o);else{this.adaptCFRules(e.position.sheetId,a,[],o);let n=this.getCFToCopyTo(t.sheetId,a);this.adaptCFRules(t.sheetId,n,[i],[])}}}}adaptCFRules(e,t,n,r){this.queuedChanges[e]||(this.queuedChanges[e]=[]);let i=this.queuedChanges[e].find(e=>e.cf.id===t.id);i?(i.toAdd.push(...n),i.toRemove.push(...r)):this.queuedChanges[e].push({toAdd:n,toRemove:r,cf:t})}executeQueuedChanges(){for(let e in this.queuedChanges)for(let{toAdd:t,toRemove:n,cf:r}of this.queuedChanges[e]){let i=this.getters.getAdaptedCfRanges(e,r,t,n);if(i){if(i.length===0){this.dispatch(`REMOVE_CONDITIONAL_FORMAT`,{id:r.id,sheetId:e});continue}this.dispatch(`ADD_CONDITIONAL_FORMAT`,{cf:{id:r.id,rule:r.rule,stopIfTrue:r.stopIfTrue},ranges:i,sheetId:e})}}}getCFToCopyTo(e,t){let n=this.getters.getConditionalFormats(e).find(e=>e.stopIfTrue===t.stopIfTrue&&w(e.rule,t.rule)),r=this.queuedChanges[e];return!n&&r&&(n=r.find(e=>e.cf.stopIfTrue===t.stopIfTrue&&w(e.cf.rule,t.rule))?.cf),n||{...t,id:this.uuidGenerator.smallUuid(),ranges:[]}}},CZ=class extends OG{uuidGenerator=new Kl;queuedChanges={};copy(e){let{rowsIndexes:t,columnsIndexes:n}=e,r=e.sheetId,i=[];for(let e of t){let t=[];for(let i of n){let n={sheetId:r,col:i,row:e},a=this.getters.getValidationRuleForCell(n);t.push({position:n,rule:a})}i.push(t)}return{dvRules:i}}paste(e,t,n){if(this.queuedChanges={},n.pasteOption)return;let r=e.zones,i=e.sheetId;n.isCutOperation?this.pasteFromCut(i,r,t):this.pasteFromCopy(i,r,t.dvRules),this.executeQueuedChanges()}pasteFromCut(e,t,n){let r=t[0];this.pasteZone(e,r.left,r.top,n.dvRules,{isCutOperation:!0})}pasteZone(e,t,n,r,i){for(let[a,o]of r.entries())for(let[r,s]of o.entries()){let o={col:t+r,row:n+a,sheetId:e};this.pasteDataValidation(s,o,i?.isCutOperation)}}pasteDataValidation(e,t,n){if(e){let r=E(t),i=E(e.position),a=e.rule;if(!a){let e=this.getters.getValidationRuleForCell(t);e&&this.adaptDataValidationRule(t.sheetId,e,[],[r]);return}let o=[];if(n&&o.push(i),e.position.sheetId===t.sheetId){let n=this.getDataValidationRuleToCopyTo(t.sheetId,a,!1);this.adaptDataValidationRule(e.position.sheetId,n,[r],o)}else{let n=this.getters.getValidationRuleForCell(e.position);n&&this.adaptDataValidationRule(e.position.sheetId,n,[],o);let i=this.getDataValidationRuleToCopyTo(t.sheetId,a);this.adaptDataValidationRule(t.sheetId,i,[r],[])}}}getDataValidationRuleToCopyTo(e,t,n=!0){let r=this.getters.getDataValidationRules(e).find(e=>w(t.criterion,e.criterion)&&t.isBlocking===e.isBlocking),i=this.queuedChanges[e];return!r&&i&&(r=i.find(e=>w(t.criterion,e.rule.criterion)&&t.isBlocking===e.rule.isBlocking)?.rule),r||{...t,id:n?this.uuidGenerator.smallUuid():t.id,ranges:[]}}adaptDataValidationRule(e,t,n,r){this.queuedChanges[e]||(this.queuedChanges[e]=[]);let i=this.queuedChanges[e].find(e=>e.rule.id===t.id);i?(i.toAdd.push(...n),i.toRemove.push(...r)):this.queuedChanges[e].push({toAdd:n,toRemove:r,rule:t})}executeQueuedChanges(){for(let e in this.queuedChanges)for(let{toAdd:t,toRemove:n,rule:r}of this.queuedChanges[e]){let i=Qt([...Qt(r.ranges.map(e=>e.zone),n),...t],[]);if(i.length===0){this.dispatch(`REMOVE_DATA_VALIDATION_RULE`,{sheetId:e,id:r.id});continue}this.dispatch(`ADD_DATA_VALIDATION_RULE`,{rule:{id:r.id,criterion:r.criterion,isBlocking:r.isBlocking},ranges:i.map(t=>this.getters.getRangeDataFromZone(e,t)),sheetId:e})}}},wZ=class extends yZ{copy(e){let t=e.sheetId,n=this.getters.getFigure(t,e.figureId);if(!n)throw Error(`No figure for the given id: ${e.figureId}`);let r={...n};if(n.tag!==`image`)return;let i=b(this.getters.getImage(e.figureId));return{figureId:e.figureId,copiedFigure:r,copiedImage:i,sheetId:t}}getPasteTarget(e,t,n,r){return{sheetId:e,zones:[],figureId:new Kl().smallUuid()}}paste(e,t,n){if(!e.figureId)return;let{zones:r,figureId:i}=e,a=this.getters.getActiveSheetId(),{width:o,height:s}=t.copiedFigure,c=b(t.copiedImage),l=this.getters.getMaxAnchorOffset(a,s,o),{left:u,top:d}=r[0],f={x:0,y:0};u>l.col&&(u=l.col,f.x=l.offset.x),d>l.row&&(d=l.row,f.y=l.offset.y),this.dispatch(`CREATE_IMAGE`,{figureId:i,sheetId:a,col:u,row:d,offset:f,size:{height:s,width:o},definition:c}),n.isCutOperation&&this.dispatch(`DELETE_FIGURE`,{sheetId:t.sheetId,figureId:t.copiedFigure.id}),this.dispatch(`SELECT_FIGURE`,{figureId:i})}isPasteAllowed(e,t,n,r){return t.length===0?`EmptyTarget`:r?.pasteOption===void 0?`Success`:`WrongFigurePasteOption`}},TZ=class extends OG{copy(e){let t=this.getters.getActiveSheetId(),{rowsIndexes:n,columnsIndexes:r}=e,i=[];for(let e of n){let n=[];for(let i of r){let r={col:i,row:e,sheetId:t};n.push(this.getters.getMerge(r))}i.push(n)}return{merges:i,sheetId:t}}paste(e,t,n){if(n.isCutOperation){let e=t.merges.flat().filter(C);this.dispatch(`REMOVE_MERGE`,{sheetId:t.sheetId,target:e})}this.pasteFromCopy(e.sheetId,e.zones,t.merges,n)}pasteZone(e,t,n,r){for(let[i,a]of r.entries())for(let[r,o]of a.entries()){let a={col:t+r,row:n+i,sheetId:e};this.pasteMerge(o,a)}}pasteMerge(e,t){if(!e||this.getters.isInMerge(t))return;let{sheetId:n,col:r,row:i}=t;this.dispatch(`ADD_MERGE`,{sheetId:n,force:!0,target:[{left:r,top:i,right:r+e.right-e.left,bottom:i+e.bottom-e.top}]})}},EZ=class extends OG{copy(e){return{zones:e.clippedZones,sheetId:e.sheetId}}paste(e,t,n){if(n.isCutOperation){let n=e.zones[0];this.dispatch(`MOVE_RANGES`,{target:t.zones,sheetId:t.sheetId,sheetName:this.getters.getSheetName(t.sheetId),targetSheetId:e.sheetId,col:n.left,row:n.top})}}},DZ=class extends OG{isPasteAllowed(e,t,n,r){if(!(`cells`in n))return`Success`;let{xSplit:i,ySplit:a}=this.getters.getPaneDivisions(e);return Un(rA(t,n.cells),i,a)?`FrozenPaneOverlap`:`Success`}},OZ=class extends OG{copy(e){let t=e.sheetId;if(e.zones.length===0)return;let n=[],r=0;for(let i of Ze(e.columnsIndexes)){let a=0;for(let o of Ze(e.rowsIndexes)){let e={left:i[0],right:i[i.length-1],top:o[0],bottom:o[o.length-1]};n.push(...this.getters.getZoneStyles(t,e).map(t=>({zone:{left:t.zone.left-e.left+r,right:t.zone.right&&t.zone.right-e.left+r,top:t.zone.top-e.top+a,bottom:t.zone.bottom&&t.zone.bottom-e.top+a},style:t.style}))),a+=o.length}r+=i.length}return{styles:n,width:e.columnsIndexes.length,height:e.rowsIndexes.length}}paste(e,t,n){let r=e.sheetId;if(n.pasteOption===`asValue`)return;let i=e.zones;if(n.isCutOperation){let{left:e,top:n}=i[0];this.pasteStyleZone(r,e,n,t.styles)}else for(let e of i)for(let n of nA(e,t.width,t.height))this.pasteStyleZone(r,n.left,n.top,t.styles)}pasteStyleZone(e,t,n,r){for(let i of r){let r={left:i.zone.left+t,right:i.zone.right&&i.zone.right+t||i.zone.left+t,top:i.zone.top+n,bottom:i.zone.bottom&&i.zone.bottom+n||i.zone.top+n};this.dispatch(`SET_FORMATTING`,{sheetId:e,target:[r],style:i.style})}}},kZ=class extends OG{copy(e,t,n=`copyPaste`){let r=e.sheetId,{rowsIndexes:i,columnsIndexes:a,zones:o}=e,s=new Set,c=[];for(let e of i){let l=[];c.push(l);for(let c of a){let a={col:c,row:e,sheetId:r},u=this.getters.getTable(a);if(!u){l.push({});continue}let d=this.getters.getCoreTable(a),f=d?.range.zone,p;if(!s.has(u.id)&&d&&f&&o.some(e=>Dn(f,e))){s.add(u.id);let{numberOfRows:e}=On(f);for(let n=f.top;n<=f.bottom;n++)!t&&!i.includes(n)&&e--;let n=d.range,r=this.getters.extendRange(d.range,`ROW`,n.zone.top+e-1-n.zone.bottom);p={range:this.getters.getRangeData(r),config:d.config,type:d.type}}n!==`shiftCells`&&l.push({table:p,style:this.getTableStyleToCopy(a),isWholeTableCopied:s.has(u.id)})}}return{tableCells:c,sheetId:e.sheetId}}getTableStyleToCopy(e){let t=this.getters.getCellTableStyle(e),n=this.getters.getCellStyle(e),r=this.getters.getCellTableBorder(e),i=this.getters.getCellBorder(e);return{style:{...t,...bt(n)},border:{...r,...bt(i)}}}paste(e,t,n){let r=e.zones,i=e.sheetId;n.isCutOperation?this.pasteFromCut(i,r,t,n):this.pasteFromCopy(i,r,t.tableCells,n)}pasteFromCut(e,t,n,r){for(let e of n.tableCells)for(let t of e)t.table&&this.dispatch(`REMOVE_TABLE`,{sheetId:n.sheetId,target:[this.getters.getRangeFromRangeData(t.table.range).zone]});let i=t[0];this.pasteZone(e,i.left,i.top,n.tableCells,r)}pasteZone(e,t,n,r,i){for(let a=0;a<r.length;a++){let o=r[a];for(let r=0;r<o.length;r++){let s=o[r];if(!s)continue;let c={col:t+r,row:n+a,sheetId:e};this.pasteTableCell(e,s,c,i)}}if(r.length===1)for(let i=0;i<r[0].length;i++)this.dispatch(`AUTOFILL_TABLE_COLUMN`,{col:t+i,row:n,sheetId:e})}pasteTableCell(e,t,n,r){if(t.table&&!r?.pasteOption){let{range:r}=t.table,i=On(this.getters.getRangeFromRangeData(r).zone),a={left:n.col,top:n.row,right:n.col+i.numberOfCols-1,bottom:n.row+i.numberOfRows-1};this.dispatch(`CREATE_TABLE`,{sheetId:n.sheetId,ranges:[this.getters.getRangeDataFromZone(e,a)],config:t.table.config,tableType:t.table.type})}this.getters.getCoreTable(n)||r?.pasteOption===`asValue`||(!r?.pasteOption&&!t.isWholeTableCopied||r?.pasteOption===`onlyFormat`)&&(t.style?.style&&this.dispatch(`UPDATE_CELL`,{...n,style:t.style.style}),t.style?.border&&this.dispatch(`SET_BORDER`,{...n,border:t.style.border}))}};BB.figureHandlers.add(`chart`,xZ).add(`image`,wZ).add(`carousel`,bZ),BB.cellHandlers.add(`dataValidation`,CZ).add(`cell`,kG).add(`sheet`,DZ).add(`merge`,TZ).add(`border`,vZ).add(`table`,kZ).add(`conditionalFormat`,SZ).add(`references`,EZ).add(`style`,OZ);let AZ={},jZ={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:26,HEADER_WIDTH:48,DESKTOP_BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:96,DEFAULT_CELL_HEIGHT:23,SCROLLBAR_WIDTH:15},MZ={autoCompleteProviders:ak,autofillModifiersRegistry:jG,autofillRulesRegistry:MG,cellMenuRegistry:SR,colMenuRegistry:Bz,errorTypes:da,linkMenuRegistry:Qk,functionRegistry:yO,featurePluginRegistry:fq,iconsOnCellRegistry:uG,statefulUIPluginRegistry:pq,coreViewsPluginRegistry:mq,corePluginRegistry:dq,rowMenuRegistry:qz,sidePanelRegistry:nW,figureRegistry:Mv,chartSidePanelComponentRegistry:xH,chartComponentRegistry:dv,chartRegistry:f_,chartSubtypeRegistry:K_,topbarMenuRegistry:Gq,topbarComponentRegistry:dJ,clickableCellRegistry:xq,otRegistry:ZG,inverseCommandRegistry:wq,urlRegistry:Ys,cellPopoverRegistry:Fv,numberFormatMenuRegistry:Bq,repeatLocalCommandTransformRegistry:HK,repeatCommandTransformRegistry:VK,clipboardHandlersRegistries:BB,pivotRegistry:ZL,pivotTimeAdapterRegistry:Um,pivotSidePanelRegistry:IU,pivotNormalizationValueRegistry:xh,supportedPivotPositionalFormulaRegistry:cW,pivotToFunctionValueRegistry:Sh,migrationStepRegistry:nP,chartJsExtensionRegistry:ql},NZ={arg:G,isEvaluationError:M,toBoolean:F,toJsDate:I,toNumber:N,toString:P,toNormalizedPivotValue:_h,toFunctionPivotValue:yh,toXC:T,toZone:un,toUnboundedZone:ln,toCartesian:Zt,numberToLetters:Ht,lettersToNumber:Ut,UuidGenerator:Kl,formatValue:z,createCurrencyFormat:us,ColorGenerator:ei,computeTextWidth:Ol,createEmptyWorkbookData:SP,createEmptySheet:xP,createEmptyExcelSheet:CP,rgbaToHex:jr,colorToRGBA:Mr,positionToZone:E,isDefined:C,isMatrix:xa,lazy:mt,genericRepeat:uJ,createAction:h,createActions:p,transformRangeData:$n,deepEquals:w,overlap:wn,union:bn,isInside:En,deepCopy:b,expandZoneOnInsertion:gn,reduceZoneOnDeletion:yn,unquote:Je,getMaxObjectId:lh,getFunctionsFromTokens:CU,getFirstPivotFunction:EU,getNumberOfPivotFunctions:OU,parseDimension:fh,isDateOrDatetimeField:ph,makeFieldProposal:kU,insertTokenAfterArgSeparator:jU,insertTokenAfterLeftParenthesis:MU,mergeContiguousZones:Xn,getPivotHighlights:GH,pivotTimeAdapter:Wm,UNDO_REDO_PIVOT_COMMANDS:wG,createPivotFormula:gh,areDomainArgsFieldsValid:hh,splitReference:Fc,sanitizeSheetName:Xe,getUniqueText:zt,isNumber:$i,isDateTime:xi,createCustomFields:Oh,schemeToColorScale:Mm,isDateTimeFormat:rs,jsDateToNumber:Fi,numberToJsDate:Ni,DateTime:O,parseFormat:Do,isFormula:Bt,PositionMap:bF},PZ={isMarkdownLink:nt,parseMarkdownLink:at,markdownLink:it,openLink:ec,urlRepresentation:$s},FZ={Checkbox:Fk,Section:q,RoundColorPicker:bk,ChartDataSeries:TV,ChartErrorSection:EV,ChartLabelRange:DV,ChartTitle:jV,ChartPanel:TH,ChartFigure:Av,ChartJsComponent:kf,ClickableCellSortIcon:lW,ZoomableChartJsComponent:rv,Grid:sW,GridOverlay:KB,ScorecardChart:Cp,GaugeChartComponent:lv,LineConfigPanel:iH,BarConfigPanel:kV,PieChartDesignPanel:sH,GenericChartConfigPanel:OV,ChartWithAxisDesignPanel:VV,GenericZoomableChartDesignPanel:HV,LineChartDesignPanel:aH,GaugeChartConfigPanel:QV,GaugeChartDesignPanel:$V,ScorecardChartConfigPanel:fH,ScorecardChartDesignPanel:pH,GeoChartDesignPanel:nH,RadarChartDesignPanel:cH,WaterfallChartDesignPanel:bH,ComboChartDesignPanel:YV,FunnelChartDesignPanel:ZV,SunburstChartDesignPanel:mH,TreeMapChartDesignPanel:yH,ChartTypePicker:CH,FigureComponent:Nv,MenuPopover:Dv,Popover:Cv,SelectionInput:kk,ValidationMessages:IB,AddDimensionButton:XH,PivotDimensionGranularity:QH,PivotDimensionOrder:$H,PivotDimension:ZH,PivotLayoutConfigurator:yU,PivotHTMLRenderer:dW,PivotDeferUpdate:qH,PivotTitleSection:bU,CogWheelMenu:SV,TextInput:gV,SidePanelCollapsible:Vv,RadioSelection:NV,GeoChartRegionSelectSection:eH,ChartDashboardMenu:Ov,FullScreenFigure:uW,NumberInput:LV,TopBar:YJ,Composer:PO},IZ={useDragAndDropListItems:Sk,useHighlights:OH,useHighlightsOnHover:DH},LZ={useStoreProvider:ar,DependencyContainer:tr,CellPopoverStore:Bk,ComposerFocusStore:_r,CellComposerStore:CB,FindAndReplaceStore:LH,HighlightStore:sk,DelayedHoveredCellStore:Pv,HoveredTableStore:UB,ModelStore:ur,NotificationStore:ck,RendererStore:mr,SelectionInputStore:Ok,SpreadsheetStore:hr,useStore:D,useLocalStore:or,SidePanelStore:iW,PivotSidePanelStore:PU,PivotMeasureDisplayPanelStore:UH,ClientFocusStore:Yz,GridRenderer:eV};function RZ(e,t){return yO.add(e,t),{addFunction:(e,t)=>RZ(e,t)}}let zZ={DEFAULT_LOCALE:R,HIGHLIGHT_COLOR:ee,PIVOT_TABLE_CONFIG:Le,ChartTerms:Yp,FIGURE_ID_SPLITTER:`??`,GRID_ICON_EDGE_LENGTH:17,GRID_ICON_MARGIN:2},BZ={...F_,...l_};e.AbstractCellClipboardHandler=OG,e.AbstractChart=Af,e.AbstractFigureClipboardHandler=yZ,e.CellErrorType=A,e.ClientDisconnectedError=MK,e.CommandResult=qs,e.CorePlugin=fW,e.CoreViewPlugin=RW,e.DEFAULT_LOCALE=R,e.DEFAULT_LOCALES=fo,e.DispatchResult=Gs,e.EvaluationError=j,e.LocalTransportService=fJ,e.Model=$X,e.PivotRuntimeDefinition=LL,e.Registry=B,e.Revision=jK,e.SPREADSHEET_DIMENSIONS=jZ,e.Spreadsheet=QJ,e.SpreadsheetPivotTable=zL,e.UIPlugin=cb,e.__info__=AZ,e.addFunction=RZ,e.addRenderingLayer=pr,e.astToFormula=yB,e.categories=bO,e.chartHelpers=BZ,e.components=FZ,e.constants=zZ,e.convertAstNodes=JO,e.coreTypes=Hs,e.createAutocompleteArgumentsProvider=hq,e.findCellInNewZone=Ln,e.functionCache=cU,e.getCaretDownSvg=ZA,e.getCaretUpSvg=QA,e.helpers=NZ,e.hooks=IZ,e.invalidateCFEvaluationCommands=Rs,e.invalidateChartEvaluationCommands=Is,e.invalidateDependenciesCommands=Ls,e.invalidateEvaluationCommands=Fs,e.iterateAstNodes=YO,e.links=PZ,e.load=sP,e.parse=KO,e.parseTokens=qO,e.readonlyAllowedCommands=Vs,e.registries=MZ,e.setDefaultSheetViewSize=Fe,e.setTranslationMethod=ca,e.stores=LZ,e.tokenColors=He,e.tokenize=bu,AZ.version=`19.1.32`,AZ.date=`2026-08-21T15:29:30.638Z`,AZ.hash=`d34d0e7`})(this.o_spreadsheet=this.o_spreadsheet||{},owl);
|
|
933
|
+
`),`_rels/.rels`)}function ZX(e){let t={},n=[];for(let r of e.sheets){let e=r.name.slice(0,31);e=zt(e,n,{compute:(e,t)=>e.slice(0,31-String(t).length)+t}),n.push(e),e!==r.name&&(t[r.name]=e,r.name=e)}if(!Object.keys(t).length)return e;let r=Object.keys(t).sort((e,t)=>t.length-e.length),i=JSON.stringify(e);for(let e of r){let n=RegExp(`'?${Ge(e)}'?!`,`g`);i=i.replaceAll(n,n=>{let r=t[e];return n.replace(e,r)})}return JSON.parse(i)}function QX(e){for(let t of e.sheets)t.tables=t.tables.filter(e=>On(un(e.range)).numberOfRows>1);return e}var $X=class extends er{corePlugins=[];statefulUIPlugins=[];range;session;isReplayingCommand=!1;renderers={};status=0;config;corePluginConfig;coreViewPluginConfig;uiPluginConfig;state;selection;getters;coreGetters;uuidGenerator;handlers=[];uiHandlers=[];coreHandlers=[];constructor(e={},t={},n=[],r=new Kl,i=!1){let a=performance.now();console.debug(`##### Model creation #####`),super(),la(),n=hP(e,n);let o=sP(e,i);this.state=new pY,this.uuidGenerator=r,this.config=this.setupConfig(t),this.session=this.setupSession(o.revisionId),this.coreGetters={},this.range=new uY(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.copyFormulaStringForSheet=this.range.copyFormulaStringForSheet.bind(this.range),this.getters={isReadonly:()=>this.config.mode===`readonly`||this.config.mode===`dashboard`,isDashboard:()=>this.config.mode===`dashboard`},this.selection=new fY(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 dq.getAll())this.setupCorePlugin(e,o);Object.assign(this.getters,this.coreGetters),this.session.loadInitialMessages(n);for(let e of mq.getAll()){let t=this.setupCoreViewPlugin(e);this.handlers.push(t),this.uiHandlers.push(t),this.coreHandlers.push(t)}for(let e of pq.getAll()){let t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t),this.uiHandlers.push(t)}for(let e of fq.getAll()){let 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(),t.snapshotRequested||e[`[Content_Types].xml`]&&!this.getters.isReadonly()){let e=performance.now();console.debug(`Snapshot requested`),this.session.snapshot(this.exportData()),console.debug(`Snapshot taken in`,performance.now()-e,`ms`)}console.debug(`Model created in`,performance.now()-a,`ms`),console.debug(`######`)}joinSession(){this.session.join(this.config.client)}async leaveSession(){let e=this.getters.isReadonly()?void 0:mt(()=>this.exportData());await this.session.leave(e)}setupUiPlugin(e){let t=new e(this.uiPluginConfig);for(let n of e.getters){if(!(n in t))throw Error(`Invalid getter name: ${n} for plugin ${t.constructor}`);if(n in this.getters)throw Error(`Getter "${n}" is already defined.`);this.getters[n]=t[n].bind(t)}for(let n of e.layers)this.renderers[n]||(this.renderers[n]=[]),this.renderers[n].push(t);return t}setupCoreViewPlugin(e){let t=new e(this.coreViewPluginConfig);for(let n of e.getters){if(!(n in t))throw Error(`Invalid getter name: ${n} for plugin ${t.constructor}`);if(n in this.getters)throw Error(`Getter "${n}" is already defined.`);this.getters[n]=t[n].bind(t)}return t}setupCorePlugin(e,t){let n=new e(this.corePluginConfig);for(let t of e.getters){if(!(t in n))throw Error(`Invalid getter name: ${t} for plugin ${n.constructor}`);if(t in this.coreGetters)throw Error(`Getter "${t}" is already defined.`);this.coreGetters[t]=n[t].bind(n)}n.import(t),this.corePlugins.push(n),this.coreHandlers.push(n),this.handlers.push(n)}onRemoteRevisionReceived({commands:e}){for(let t of e){let e=this.status;this.status=2,this.dispatchToHandlers(this.statefulUIPlugins,t),this.status=e}this.finalize()}setupSession(e){return new NK(sY({initialRevisionId:e,recordChanges:this.state.recordChanges.bind(this.state),dispatch:e=>{if(!this.checkDispatchAllowed(e).isSuccessful){this.dispatchToHandlers(this.coreHandlers,{type:`UNDO`,commands:[e]});return}this.isReplayingCommand=!0,this.dispatchToHandlers(this.coreHandlers,e),this.isReplayingCommand=!1}}),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){let t=e.client||{id:this.uuidGenerator.smallUuid(),name:k(`Anonymous`).toString()},n=e.transportService||new fJ,r=e.mode===`readonly`||e.mode===`dashboard`;return{...e,mode:e.mode||`normal`,custom:e.custom||{},external:this.setupExternalConfig(e.external||{}),transportService:r?new $J(n):n,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){let t=e.loadLocales||(()=>Promise.resolve(fo));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,custom:this.config.custom,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){let t=Us(e)?this.checkDispatchAllowedCoreCommand(e):this.checkDispatchAllowedLocalCommand(e);return t.some(e=>e!==`Success`)?new Gs(t.flat()):Gs.Success}checkDispatchAllowedCoreCommand(e){let 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(let e of this.handlers)e.finalize();this.status=0,this.trigger(`command-finalized`)}canDispatch=(e,t)=>this.checkDispatchAllowed(eZ(e,t));dispatch=(e,t)=>{let n=eZ(e,t),r=this.status;if(this.getters.isReadonly()&&!Ws(n))return new Gs(`Readonly`);if(!this.session.canApplyOptimisticUpdate())return new Gs(`WaitingSessionConfirmation`);switch(r){case 0:let t=this.checkDispatchAllowed(n);if(!t.isSuccessful)return this.trigger(`update`),t;this.status=1;let{changes:r,commands:i}=this.state.recordChanges(()=>{let t=performance.now();Us(n)&&this.state.addCommand(n),this.dispatchToHandlers(this.handlers,n),this.finalize();let r=performance.now()-t;r>5&&console.debug(e,r,`ms`)});this.session.save(n,i,r),this.status=0,this.trigger(`update`);break;case 1:if(Us(n)){let e=this.checkDispatchAllowed(n);if(!e.isSuccessful)return e;this.state.addCommand(n)}this.dispatchToHandlers(this.handlers,n);break;case 3:throw Error(`Cannot dispatch commands in the finalize state`);case 2:if(Us(n))throw Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,n)}return Gs.Success};dispatchFromCorePlugin=(e,t)=>{let n=eZ(e,t),r=this.status;this.status=2;let i=this.isReplayingCommand?this.coreHandlers:this.handlers;return this.dispatchToHandlers(i,n),this.status=r,Gs.Success};dispatchToHandlers(e,t){let n=Us(t);for(let r of e)!n&&r instanceof fW||r.beforeHandle(t);for(let r of e)!n&&r instanceof fW||r.handle(t);this.trigger(`command-dispatched`,t)}drawLayer(e,t){let n=this.renderers[t];if(n)for(let r of n)e.ctx.save(),r.drawLayer(e,t),e.ctx.restore()}exportData(){let e=SP();for(let t of this.handlers)t instanceof fW&&t.export(e);return e.revisionId=this.session.getRevisionId()||`START_REVISION`,e=b(e),e}updateMode(e){this.config.mode=e,this.trigger(`update`)}async exportXLSX(){this.dispatch(`EVALUATE_CELLS`);let e=wP();for(let t of this.handlers)t instanceof sb&&await t.exportForExcel(e);return e=b(e),HX(e)}};function eZ(e,t={}){let n=b(t);return n.type=e,n}function tZ(e){return!WV.includes(e.horizontalGroupBy)||!WV.includes(e.verticalGroupBy)?`InvalidChartDefinition`:`Success`}var nZ=class e extends Af{dataSets;labelRange;background;type=`calendar`;showValues;colorScale;axesDesign;horizontalGroupBy;verticalGroupBy;legendPosition;missingValueColor;constructor(e,t,n){super(e,t,n),this.dataSets=td(n,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Qc(n,t,e.labelRange),this.background=e.background,this.showValues=e.showValues,this.colorScale=e.colorScale,this.axesDesign=e.axesDesign,this.horizontalGroupBy=e.horizontalGroupBy,this.verticalGroupBy=e.verticalGroupBy,this.legendPosition=e.legendPosition,this.missingValueColor=e.missingValueColor}static transformDefinition(e,t,n){return ad(e,t,n)}static validateChartDefinition(e,t){return e.checkValidations(t,cd,ld,tZ)}static getDefinitionFromContextCreation(e){let t=`left`;return e.legendPosition===`right`&&(t=`right`),{background:e.background,dataSets:e.range??[],dataSetsHaveTitle:e.dataSetsHaveTitle??!1,title:e.title||{text:``},type:`calendar`,labelRange:e.auxiliaryRange||void 0,showValues:e.showValues,axesDesign:e.axesDesign,legendPosition:t,horizontalGroupBy:`day_of_week`,verticalGroupBy:`month_number`}}getContextCreation(){let e=[{dataRange:this.getters.getRangeString(this.dataSets[0].dataRange,this.sheetId)}];return{...this,range:e,auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}duplicateInDuplicatedSheet(t){let n=Qu(this.sheetId,t,this.dataSets),r=$u(this.sheetId,t,this.labelRange);return new e(this.getDefinitionWithSpecificDataSets(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,t),t,this.getters)}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getDefinitionWithSpecificDataSets(e,t,n){let r=e.map(e=>({dataRange:this.getters.getRangeString(e.dataRange,n||this.sheetId)}));return{type:`calendar`,background:this.background,dataSets:r,dataSetsHaveTitle:e.length?!!e[0].labelCell:!1,labelRange:t?this.getters.getRangeString(t,n||this.sheetId):void 0,title:this.title,showValues:this.showValues,colorScale:this.colorScale,axesDesign:this.axesDesign,horizontalGroupBy:this.horizontalGroupBy,verticalGroupBy:this.verticalGroupBy,legendPosition:this.legendPosition,missingValueColor:this.missingValueColor}}getDefinitionForExcel(){}updateRanges({applyChange:t}){let{dataSets:n,labelRange:r,isStale:i}=Zu(this.getters,t,this.dataSets,this.labelRange);return i?new e(this.getDefinitionWithSpecificDataSets(n,r),this.sheetId,this.getters):this}};function rZ(e,t){let n=e.getDefinition(),r=Hh(n,e.dataSets,e.labelRange,t),{labels:i,datasets:a}=Zd(n,r);return{chartJsConfig:{type:`calendar`,data:{labels:i,datasets:a},options:{...Vp,indexAxis:`x`,layout:Eg(n,r),scales:Pd(n,a),plugins:{title:Gg(n,t),legend:{display:!1},tooltip:Xg(n,r),chartShowValuesPlugin:Bg(n,r),chartColorScalePlugin:Fd(n,r)},chartBackground:n.background||`#FFFFFF`}},background:e.background||`#FFFFFF`}}var iZ=class e extends Af{dataSets;labelRange;background;legendPosition;aggregated;dataSetsHaveTitle;dataSetDesign;axesDesign;type=`combo`;showValues;hideDataMarkers;zoomable;constructor(e,t,n){super(e,t,n),this.dataSets=td(n,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Qc(n,t,e.labelRange),this.background=e.background,this.legendPosition=e.legendPosition,this.aggregated=e.aggregated,this.dataSetsHaveTitle=e.dataSetsHaveTitle,this.dataSetDesign=e.dataSets,this.axesDesign=e.axesDesign,this.showValues=e.showValues,this.hideDataMarkers=e.hideDataMarkers,this.zoomable=e.zoomable}static transformDefinition(e,t,n){return ad(e,t,n)}static validateChartDefinition(e,t){return e.checkValidations(t,cd,ld)}getContextCreation(){let e=[];for(let[t,n]of this.dataSets.entries())e.push({...this.dataSetDesign?.[t],dataRange:this.getters.getRangeString(n.dataRange,this.sheetId)});return{...this,range:e,auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getDefinitionWithSpecificDataSets(e,t,n){let r=[];for(let[t,i]of e.entries())r.push({...this.dataSetDesign?.[t],dataRange:this.getters.getRangeString(i.dataRange,n||this.sheetId),type:this.dataSetDesign?.[t]?.type??(t?`line`:`bar`)});return{type:`combo`,dataSetsHaveTitle:e.length?!!e[0].labelCell:!1,background:this.background,dataSets:r,legendPosition:this.legendPosition,labelRange:t?this.getters.getRangeString(t,n||this.sheetId):void 0,title:this.title,aggregated:this.aggregated,axesDesign:this.axesDesign,showValues:this.showValues,hideDataMarkers:this.hideDataMarkers,zoomable:this.zoomable,humanize:this.humanize}}getDefinitionForExcel(){let{dataSets:e,labelRange:t}=this.getCommonDataSetAttributesForExcel(this.labelRange,this.dataSets,ud(this.labelRange,this.dataSets[0],this.dataSetsHaveTitle)),n=this.getDefinition();return{...n,backgroundColor:V(this.background||`#FFFFFF`),fontColor:V(od(this.background)),dataSets:e,labelRange:t,verticalAxis:fd(n)}}updateRanges({applyChange:t}){let{dataSets:n,labelRange:r,isStale:i}=Zu(this.getters,t,this.dataSets,this.labelRange);return i?new e(this.getDefinitionWithSpecificDataSets(n,r),this.sheetId,this.getters):this}static getDefinitionFromContextCreation(e){let t=(e.range??[]).map((e,t)=>({...e,type:t?`line`:`bar`}));return{background:e.background,dataSets:t,dataSetsHaveTitle:e.dataSetsHaveTitle??!1,aggregated:e.aggregated,legendPosition:e.legendPosition??`top`,title:e.title||{text:``},labelRange:e.auxiliaryRange||void 0,type:`combo`,axesDesign:e.axesDesign,showValues:e.showValues,hideDataMarkers:e.hideDataMarkers,zoomable:e.zoomable,humanize:e.humanize}}duplicateInDuplicatedSheet(t){let n=Qu(this.sheetId,t,this.dataSets),r=$u(this.sheetId,t,this.labelRange);return new e(this.getDefinitionWithSpecificDataSets(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,t),t,this.getters)}};function aZ(e,t){let n=e.getDefinition(),r=zh(n,e.dataSets,e.labelRange,t);return{chartJsConfig:{type:`bar`,data:{labels:r.labels,datasets:nf(n,r)},options:{...Vp,layout:Tg(n,r),scales:Nd(n,r),plugins:{title:Gg(n,t),legend:Mg(n,r),tooltip:Yg(n,r),chartShowValuesPlugin:zg(n,r)}}},background:e.background||`#FFFFFF`}}var oZ=class e extends Af{dataSets;labelRange;background;legendPosition;aggregated;type=`funnel`;dataSetsHaveTitle;dataSetDesign;axesDesign;horizontal=!0;showValues;funnelColors;cumulative;constructor(e,t,n){super(e,t,n),this.dataSets=td(n,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Qc(n,t,e.labelRange),this.background=e.background,this.legendPosition=e.legendPosition,this.aggregated=e.aggregated,this.dataSetsHaveTitle=e.dataSetsHaveTitle,this.dataSetDesign=e.dataSets,this.axesDesign=e.axesDesign,this.showValues=e.showValues,this.horizontal=!0,this.funnelColors=e.funnelColors,this.cumulative=e.cumulative}static transformDefinition(e,t,n){return ad(e,t,n)}static validateChartDefinition(e,t){return e.checkValidations(t,cd,ld)}static getDefinitionFromContextCreation(e){return{background:e.background,dataSets:e.range??[],dataSetsHaveTitle:e.dataSetsHaveTitle??!1,aggregated:e.aggregated??!1,legendPosition:`none`,title:e.title||{text:``},type:`funnel`,labelRange:e.auxiliaryRange||void 0,showValues:e.showValues,axesDesign:e.axesDesign,funnelColors:e.funnelColors,horizontal:!0,cumulative:e.cumulative,humanize:e.humanize}}getContextCreation(){let e=[];for(let[t,n]of this.dataSets.entries())e.push({...this.dataSetDesign?.[t],dataRange:this.getters.getRangeString(n.dataRange,this.sheetId)});return{...this,range:e,auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}duplicateInDuplicatedSheet(t){let n=Qu(this.sheetId,t,this.dataSets),r=$u(this.sheetId,t,this.labelRange);return new e(this.getDefinitionWithSpecificDataSets(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,t),t,this.getters)}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getDefinitionWithSpecificDataSets(e,t,n){let r=[];for(let[t,i]of e.entries())r.push({...this.dataSetDesign?.[t],dataRange:this.getters.getRangeString(i.dataRange,n||this.sheetId)});return{type:`funnel`,dataSetsHaveTitle:e.length?!!e[0].labelCell:!1,background:this.background,dataSets:r,legendPosition:this.legendPosition,labelRange:t?this.getters.getRangeString(t,n||this.sheetId):void 0,title:this.title,aggregated:this.aggregated,horizontal:this.horizontal,axesDesign:this.axesDesign,showValues:this.showValues,funnelColors:this.funnelColors,cumulative:this.cumulative,humanize:this.humanize}}getDefinitionForExcel(){}updateRanges({applyChange:t}){let{dataSets:n,labelRange:r,isStale:i}=Zu(this.getters,t,this.dataSets,this.labelRange);return i?new e(this.getDefinitionWithSpecificDataSets(n,r),this.sheetId,this.getters):this}};function sZ(e,t){let n=e.getDefinition(),r=Jh(n,e.dataSets,e.labelRange,t);return{chartJsConfig:{type:`funnel`,data:{labels:r.labels,datasets:of(n,r)},options:{...Vp,indexAxis:`y`,layout:Tg(n,r),scales:Hd(n,r),plugins:{title:Gg(n,t),legend:{display:!1},tooltip:r_(n,r),chartShowValuesPlugin:zg(n,r)}}},background:e.background||`#FFFFFF`}}var cZ=class e extends Af{dataSets;labelRange;background;legendPosition;type=`geo`;dataSetsHaveTitle;dataSetDesign;colorScale;missingValueColor;region;constructor(e,t,n){super(e,t,n),this.dataSets=td(n,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Qc(n,t,e.labelRange),this.background=e.background,this.legendPosition=e.legendPosition,this.dataSetsHaveTitle=e.dataSetsHaveTitle,this.dataSetDesign=e.dataSets,this.colorScale=e.colorScale,this.missingValueColor=e.missingValueColor,this.region=e.region}static transformDefinition(e,t,n){return ad(e,t,n)}static validateChartDefinition(e,t){return e.checkValidations(t,cd,ld)}static getDefinitionFromContextCreation(e){return{background:e.background,dataSets:e.range??[],dataSetsHaveTitle:e.dataSetsHaveTitle??!1,legendPosition:e.legendPosition??`top`,title:e.title||{text:``},type:`geo`,labelRange:e.auxiliaryRange||void 0,humanize:e.humanize}}getContextCreation(){let e=[];for(let[t,n]of this.dataSets.entries())e.push({...this.dataSetDesign?.[t],dataRange:this.getters.getRangeString(n.dataRange,this.sheetId)});return{...this,range:e,auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}duplicateInDuplicatedSheet(t){let n=Qu(this.sheetId,t,this.dataSets),r=$u(this.sheetId,t,this.labelRange);return new e(this.getDefinitionWithSpecificDataSets(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,t),t,this.getters)}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getDefinitionWithSpecificDataSets(e,t,n){let r=[];for(let[t,i]of e.entries())r.push({...this.dataSetDesign?.[t],dataRange:this.getters.getRangeString(i.dataRange,n||this.sheetId)});return{type:`geo`,dataSetsHaveTitle:e.length?!!e[0].labelCell:!1,background:this.background,dataSets:r,legendPosition:this.legendPosition,labelRange:t?this.getters.getRangeString(t,n||this.sheetId):void 0,title:this.title,colorScale:this.colorScale,missingValueColor:this.missingValueColor,region:this.region,humanize:this.humanize}}getDefinitionForExcel(){}updateRanges({applyChange:t}){let{dataSets:n,labelRange:r,isStale:i}=Zu(this.getters,t,this.dataSets,this.labelRange);return i?new e(this.getDefinitionWithSpecificDataSets(n,r),this.sheetId,this.getters):this}};function lZ(e,t){let n=e.getDefinition(),r=qh(n,e.dataSets,e.labelRange,t);return{chartJsConfig:{type:`choropleth`,data:{datasets:af(n,r)},options:{...Vp,layout:Tg(n,r),scales:Vd(n,r),plugins:{title:Gg(n,t),tooltip:n_(n,r),legend:{display:!1}}}},background:e.background||`#FFFFFF`}}var uZ=class e extends Af{dataSets;labelRange;background;legendPosition;aggregated;type=`pyramid`;dataSetsHaveTitle;dataSetDesign;axesDesign;horizontal=!0;stacked=!0;showValues;constructor(e,t,n){super(e,t,n),this.dataSets=td(n,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Qc(n,t,e.labelRange),this.background=e.background,this.legendPosition=e.legendPosition,this.aggregated=e.aggregated,this.dataSetsHaveTitle=e.dataSetsHaveTitle,this.dataSetDesign=e.dataSets,this.axesDesign=e.axesDesign,this.showValues=e.showValues}static transformDefinition(e,t,n){return ad(e,t,n)}static validateChartDefinition(e,t){return e.checkValidations(t,cd,ld)}static getDefinitionFromContextCreation(e){return{background:e.background,dataSets:e.range??[],dataSetsHaveTitle:e.dataSetsHaveTitle??!1,aggregated:e.aggregated??!1,legendPosition:e.legendPosition??`top`,title:e.title||{text:``},type:`pyramid`,labelRange:e.auxiliaryRange||void 0,axesDesign:e.axesDesign,horizontal:!0,stacked:!0,showValues:e.showValues,humanize:e.humanize}}getContextCreation(){let e=[];for(let[t,n]of this.dataSets.entries())e.push({...this.dataSetDesign?.[t],dataRange:this.getters.getRangeString(n.dataRange,this.sheetId)});return{...this,range:e,auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}duplicateInDuplicatedSheet(t){let n=Qu(this.sheetId,t,this.dataSets),r=$u(this.sheetId,t,this.labelRange);return new e(this.getDefinitionWithSpecificDataSets(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,t),t,this.getters)}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getDefinitionWithSpecificDataSets(e,t,n){let r=[];for(let[t,i]of e.entries())r.push({...this.dataSetDesign?.[t],dataRange:this.getters.getRangeString(i.dataRange,n||this.sheetId)});return{type:`pyramid`,dataSetsHaveTitle:e.length?!!e[0].labelCell:!1,background:this.background,dataSets:r,legendPosition:this.legendPosition,labelRange:t?this.getters.getRangeString(t,n||this.sheetId):void 0,title:this.title,aggregated:this.aggregated,axesDesign:this.axesDesign,horizontal:!0,stacked:!0,showValues:this.showValues,humanize:this.humanize}}getDefinitionForExcel(e){let{dataSets:t,labelRange:n}=this.getCommonDataSetAttributesForExcel(this.labelRange,this.dataSets,ud(this.labelRange,this.dataSets[0],this.dataSetsHaveTitle)),r=this.getDefinition(),{dataSetsValues:i}=Uh(r,this.dataSets,this.labelRange,e),a=Math.max(...i.map(e=>Math.max(...e.data.map(Math.abs))));return{...r,horizontal:!0,backgroundColor:V(this.background||`#FFFFFF`),fontColor:V(od(this.background)),dataSets:t,labelRange:n,verticalAxis:fd(r),maxValue:a}}updateRanges({applyChange:t}){let{dataSets:n,labelRange:r,isStale:i}=Zu(this.getters,t,this.dataSets,this.labelRange);return i?new e(this.getDefinitionWithSpecificDataSets(n,r),this.sheetId,this.getters):this}};function dZ(e,t){let n=e.getDefinition(),r=Uh(n,e.dataSets,e.labelRange,t);return{chartJsConfig:{type:`bar`,data:{labels:r.labels,datasets:Xd(n,r)},options:{...Vp,indexAxis:`y`,layout:Tg(n,r),scales:zd(n,r),plugins:{title:Gg(n,t),legend:Og(n,r),tooltip:e_(n,r),chartShowValuesPlugin:Hg(n,r)}}},background:e.background||`#FFFFFF`}}var fZ=class e extends Af{dataSets;labelRange;background;legendPosition;stacked;aggregated;type=`radar`;dataSetsHaveTitle;dataSetDesign;fillArea;showValues;hideDataMarkers;constructor(e,t,n){super(e,t,n),this.dataSets=td(n,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Qc(n,t,e.labelRange),this.background=e.background,this.legendPosition=e.legendPosition,this.stacked=e.stacked,this.aggregated=e.aggregated,this.dataSetsHaveTitle=e.dataSetsHaveTitle,this.dataSetDesign=e.dataSets,this.fillArea=e.fillArea,this.showValues=e.showValues,this.hideDataMarkers=e.hideDataMarkers}static transformDefinition(e,t,n){return ad(e,t,n)}static validateChartDefinition(e,t){return e.checkValidations(t,cd,ld)}static getDefinitionFromContextCreation(e){return{background:e.background,dataSets:e.range??[],dataSetsHaveTitle:e.dataSetsHaveTitle??!1,stacked:e.stacked??!1,aggregated:e.aggregated??!1,legendPosition:e.legendPosition??`top`,title:e.title||{text:``},type:`radar`,labelRange:e.auxiliaryRange||void 0,fillArea:e.fillArea??!1,showValues:e.showValues??!1,hideDataMarkers:e.hideDataMarkers,humanize:e.humanize}}getContextCreation(){let e=[];for(let[t,n]of this.dataSets.entries())e.push({...this.dataSetDesign?.[t],dataRange:this.getters.getRangeString(n.dataRange,this.sheetId)});return{...this,range:e,auxiliaryRange:this.labelRange?this.getters.getRangeString(this.labelRange,this.sheetId):void 0}}duplicateInDuplicatedSheet(t){let n=Qu(this.sheetId,t,this.dataSets),r=$u(this.sheetId,t,this.labelRange);return new e(this.getDefinitionWithSpecificDataSets(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,t),t,this.getters)}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getDefinitionWithSpecificDataSets(e,t,n){let r=[];for(let[t,i]of e.entries())r.push({...this.dataSetDesign?.[t],dataRange:this.getters.getRangeString(i.dataRange,n||this.sheetId)});return{type:`radar`,dataSetsHaveTitle:e.length?!!e[0].labelCell:!1,background:this.background,dataSets:r,legendPosition:this.legendPosition,labelRange:t?this.getters.getRangeString(t,n||this.sheetId):void 0,title:this.title,stacked:this.stacked,aggregated:this.aggregated,fillArea:this.fillArea,showValues:this.showValues,hideDataMarkers:this.hideDataMarkers,humanize:this.humanize}}getDefinitionForExcel(){let{dataSets:e,labelRange:t}=this.getCommonDataSetAttributesForExcel(this.labelRange,this.dataSets,ud(this.labelRange,this.dataSets[0],this.dataSetsHaveTitle));return{...this.getDefinition(),backgroundColor:V(this.background||`#FFFFFF`),fontColor:V(od(this.background)),dataSets:e,labelRange:t}}updateRanges({applyChange:t}){let{dataSets:n,labelRange:r,isStale:i}=Zu(this.getters,t,this.dataSets,this.labelRange);return i?new e(this.getDefinitionWithSpecificDataSets(n,r),this.sheetId,this.getters):this}};function pZ(e,t){let n=e.getDefinition(),r=Kh(n,e.dataSets,e.labelRange,t);return{chartJsConfig:{type:`radar`,data:{labels:r.labels,datasets:rf(n,r)},options:{...Vp,layout:Tg(n,r),scales:Bd(n,r),plugins:{title:Gg(n,t),legend:Pg(n,r),tooltip:t_(n,r),chartShowValuesPlugin:zg(n,r)}}},background:e.background||`#FFFFFF`}}var mZ=class e extends Af{dataSets;labelRange;background;legendPosition;type=`sunburst`;dataSetsHaveTitle;showValues;showLabels;valuesDesign;groupColors;pieHolePercentage;constructor(e,t,n){super(e,t,n),this.dataSets=td(n,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Qc(n,t,e.labelRange),this.background=e.background,this.legendPosition=e.legendPosition,this.dataSetsHaveTitle=e.dataSetsHaveTitle,this.showValues=e.showValues,this.showLabels=e.showLabels,this.valuesDesign=e.valuesDesign,this.groupColors=e.groupColors,this.pieHolePercentage=e.pieHolePercentage}static transformDefinition(e,t,n){return ad(e,t,n)}static validateChartDefinition(e,t){return e.checkValidations(t,cd,ld)}static getDefinitionFromContextCreation(e){let t=[];return e.hierarchicalRanges?.length?t.push(...e.hierarchicalRanges):e.auxiliaryRange&&t.push({...e.range?.[0],dataRange:e.auxiliaryRange}),{background:e.background,dataSets:t,dataSetsHaveTitle:e.dataSetsHaveTitle??!1,legendPosition:e.legendPosition??`top`,title:e.title||{text:``},type:`sunburst`,labelRange:e.range?.[0]?.dataRange,showValues:e.showValues,showLabels:e.showLabels,valuesDesign:e.valuesDesign,groupColors:e.groupColors,humanize:e.humanize}}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getContextCreation(){let e=this.dataSets.at(-1)?.dataRange;return{...this,range:this.labelRange?[{dataRange:this.getters.getRangeString(this.labelRange,this.sheetId)}]:[],auxiliaryRange:e?this.getters.getRangeString(e,this.sheetId):void 0,hierarchicalRanges:this.dataSets.map(e=>({dataRange:this.getters.getRangeString(e.dataRange,this.sheetId)}))}}getDefinitionWithSpecificDataSets(e,t,n){return{type:`sunburst`,dataSetsHaveTitle:e.length?!!e[0].labelCell:!1,background:this.background,dataSets:e.map(e=>({dataRange:this.getters.getRangeString(e.dataRange,n||this.sheetId)})),legendPosition:this.legendPosition,labelRange:t?this.getters.getRangeString(t,n||this.sheetId):void 0,title:this.title,showValues:this.showValues,showLabels:this.showLabels,valuesDesign:this.valuesDesign,groupColors:this.groupColors,pieHolePercentage:this.pieHolePercentage,humanize:this.humanize}}duplicateInDuplicatedSheet(t){let n=Qu(this.sheetId,t,this.dataSets),r=$u(this.sheetId,t,this.labelRange);return new e(this.getDefinitionWithSpecificDataSets(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,t),t,this.getters)}getDefinitionForExcel(){}updateRanges({applyChange:t}){let{dataSets:n,labelRange:r,isStale:i}=Zu(this.getters,t,this.dataSets,this.labelRange);return i?new e(this.getDefinitionWithSpecificDataSets(n,r),this.sheetId,this.getters):this}};function hZ(e,t){let n=e.getDefinition(),r=Yh(n,e.dataSets,e.labelRange,t);return{chartJsConfig:{type:`doughnut`,data:{datasets:cf(n,r)},options:{cutout:e.pieHolePercentage===void 0?`25%`:`${e.pieHolePercentage}%`,...Vp,layout:Tg(n,r),plugins:{title:Gg(n,t),legend:Fg(n,r),tooltip:i_(n,r),sunburstLabelsPlugin:Vg(n,r),sunburstHoverPlugin:{enabled:!0}}}},background:e.background||`#FFFFFF`}}var gZ=class e extends Af{static defaults={background:oe,legendPosition:`top`,dataSetsHaveTitle:!1,showHeaders:!0,headersColor:`#000000`};dataSets;labelRange;background;legendPosition;type=`treemap`;dataSetsHaveTitle;showHeaders;headerDesign;showValues;showLabels;valuesDesign;coloringOptions;constructor(e,t,n){super(e,t,n),this.dataSets=td(n,e.dataSets,t,e.dataSetsHaveTitle),this.labelRange=Qc(n,t,e.labelRange),this.background=e.background,this.legendPosition=e.legendPosition,this.dataSetsHaveTitle=e.dataSetsHaveTitle,this.showHeaders=e.showHeaders,this.headerDesign=e.headerDesign,this.showValues=e.showValues,this.showLabels=e.showLabels,this.valuesDesign=e.valuesDesign,this.coloringOptions=e.coloringOptions}static transformDefinition(e,t,n){return ad(e,t,n)}static validateChartDefinition(e,t){return e.checkValidations(t,cd,ld)}static getDefinitionFromContextCreation(e){let t=[];return e.hierarchicalRanges?.length?t.push(...e.hierarchicalRanges):e.auxiliaryRange&&t.push({...e.range?.[0],dataRange:e.auxiliaryRange}),{background:e.background,dataSets:t,dataSetsHaveTitle:e.dataSetsHaveTitle??!1,legendPosition:e.legendPosition??`top`,title:e.title||{text:``},type:`treemap`,labelRange:e.range?.[0]?.dataRange,showValues:e.showValues,showHeaders:e.showHeaders,headerDesign:e.headerDesign,showLabels:e.showLabels,valuesDesign:e.valuesDesign,coloringOptions:e.treemapColoringOptions,humanize:e.humanize}}getContextCreation(){let e=this.dataSets.at(-1)?.dataRange;return{...this,range:this.labelRange?[{dataRange:this.getters.getRangeString(this.labelRange,this.sheetId)}]:[],auxiliaryRange:e?this.getters.getRangeString(e,this.sheetId):void 0,hierarchicalRanges:this.dataSets.map(e=>({dataRange:this.getters.getRangeString(e.dataRange,this.sheetId)}))}}duplicateInDuplicatedSheet(t){let n=Qu(this.sheetId,t,this.dataSets),r=$u(this.sheetId,t,this.labelRange);return new e(this.getDefinitionWithSpecificDataSets(n,r,t),t,this.getters)}copyInSheetId(t){return new e(this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange,t),t,this.getters)}getDefinition(){return this.getDefinitionWithSpecificDataSets(this.dataSets,this.labelRange)}getDefinitionWithSpecificDataSets(e,t,n){let r=e.map(e=>({dataRange:this.getters.getRangeString(e.dataRange,n||this.sheetId)}));return{type:`treemap`,dataSetsHaveTitle:e.length?!!e[0].labelCell:!1,background:this.background,dataSets:r,legendPosition:this.legendPosition,labelRange:t?this.getters.getRangeString(t,n||this.sheetId):void 0,title:this.title,showValues:this.showValues,showHeaders:this.showHeaders,headerDesign:this.headerDesign,showLabels:this.showLabels,valuesDesign:this.valuesDesign,coloringOptions:this.coloringOptions,humanize:this.humanize}}getDefinitionForExcel(){}updateRanges({applyChange:t}){let{dataSets:n,labelRange:r,isStale:i}=Zu(this.getters,t,this.dataSets,this.labelRange);return i?new e(this.getDefinitionWithSpecificDataSets(n,r),this.sheetId,this.getters):this}};function _Z(e,t){let n=e.getDefinition(),r=Yh(n,e.dataSets,e.labelRange,t);return{chartJsConfig:{type:`treemap`,data:{labels:r.labels,datasets:pf(n,r)},options:{...Vp,layout:Tg(n,r),plugins:{title:Gg(n,t),legend:{display:!1},tooltip:a_(n,r)}}},background:e.background||`#FFFFFF`}}f_.add(`bar`,{match:e=>e===`bar`,createChart:(e,t,n)=>new u_(e,t,n),getChartRuntime:d_,validateChartDefinition:u_.validateChartDefinition,transformDefinition:u_.transformDefinition,getChartDefinitionFromContextCreation:u_.getDefinitionFromContextCreation,sequence:10}),f_.add(`combo`,{match:e=>e===`combo`,createChart:(e,t,n)=>new iZ(e,t,n),getChartRuntime:aZ,validateChartDefinition:iZ.validateChartDefinition,transformDefinition:iZ.transformDefinition,getChartDefinitionFromContextCreation:iZ.getDefinitionFromContextCreation,sequence:15}),f_.add(`line`,{match:e=>e===`line`,createChart:(e,t,n)=>new k_(e,t,n),getChartRuntime:A_,validateChartDefinition:k_.validateChartDefinition,transformDefinition:k_.transformDefinition,getChartDefinitionFromContextCreation:k_.getDefinitionFromContextCreation,sequence:20}),f_.add(`pie`,{match:e=>e===`pie`,createChart:(e,t,n)=>new j_(e,t,n),getChartRuntime:M_,validateChartDefinition:j_.validateChartDefinition,transformDefinition:j_.transformDefinition,getChartDefinitionFromContextCreation:j_.getDefinitionFromContextCreation,sequence:30}),f_.add(`scorecard`,{match:e=>e===`scorecard`,createChart:(e,t,n)=>new Bf(e,t,n),getChartRuntime:Hf,validateChartDefinition:Bf.validateChartDefinition,transformDefinition:Bf.transformDefinition,getChartDefinitionFromContextCreation:Bf.getDefinitionFromContextCreation,sequence:40}),f_.add(`gauge`,{match:e=>e===`gauge`,createChart:(e,t,n)=>new C_(e,t,n),getChartRuntime:w_,validateChartDefinition:C_.validateChartDefinition,transformDefinition:C_.transformDefinition,getChartDefinitionFromContextCreation:C_.getDefinitionFromContextCreation,sequence:50}),f_.add(`scatter`,{match:e=>e===`scatter`,createChart:(e,t,n)=>new lH(e,t,n),getChartRuntime:uH,validateChartDefinition:lH.validateChartDefinition,transformDefinition:lH.transformDefinition,getChartDefinitionFromContextCreation:lH.getDefinitionFromContextCreation,sequence:60}),f_.add(`waterfall`,{match:e=>e===`waterfall`,createChart:(e,t,n)=>new N_(e,t,n),getChartRuntime:P_,validateChartDefinition:N_.validateChartDefinition,transformDefinition:N_.transformDefinition,getChartDefinitionFromContextCreation:N_.getDefinitionFromContextCreation,sequence:70}),f_.add(`pyramid`,{match:e=>e===`pyramid`,createChart:(e,t,n)=>new uZ(e,t,n),getChartRuntime:dZ,validateChartDefinition:uZ.validateChartDefinition,transformDefinition:uZ.transformDefinition,getChartDefinitionFromContextCreation:uZ.getDefinitionFromContextCreation,sequence:80,dataSeriesLimit:2}),f_.add(`radar`,{match:e=>e===`radar`,createChart:(e,t,n)=>new fZ(e,t,n),getChartRuntime:pZ,validateChartDefinition:fZ.validateChartDefinition,transformDefinition:fZ.transformDefinition,getChartDefinitionFromContextCreation:fZ.getDefinitionFromContextCreation,sequence:80}),f_.add(`geo`,{match:e=>e===`geo`,createChart:(e,t,n)=>new cZ(e,t,n),getChartRuntime:lZ,validateChartDefinition:cZ.validateChartDefinition,transformDefinition:cZ.transformDefinition,getChartDefinitionFromContextCreation:cZ.getDefinitionFromContextCreation,sequence:90,dataSeriesLimit:1}),f_.add(`funnel`,{match:e=>e===`funnel`,createChart:(e,t,n)=>new oZ(e,t,n),getChartRuntime:sZ,validateChartDefinition:oZ.validateChartDefinition,transformDefinition:oZ.transformDefinition,getChartDefinitionFromContextCreation:oZ.getDefinitionFromContextCreation,sequence:100,dataSeriesLimit:1}),f_.add(`sunburst`,{match:e=>e===`sunburst`,createChart:(e,t,n)=>new mZ(e,t,n),getChartRuntime:hZ,validateChartDefinition:mZ.validateChartDefinition,transformDefinition:mZ.transformDefinition,getChartDefinitionFromContextCreation:mZ.getDefinitionFromContextCreation,sequence:30}),f_.add(`treemap`,{match:e=>e===`treemap`,createChart:(e,t,n)=>new gZ(e,t,n),getChartRuntime:_Z,validateChartDefinition:gZ.validateChartDefinition,transformDefinition:gZ.transformDefinition,getChartDefinitionFromContextCreation:gZ.getDefinitionFromContextCreation,sequence:100}),f_.add(`calendar`,{match:e=>e===`calendar`,createChart:(e,t,n)=>new nZ(e,t,n),getChartRuntime:(e,t)=>rZ(e,t),validateChartDefinition:nZ.validateChartDefinition,transformDefinition:nZ.transformDefinition,getChartDefinitionFromContextCreation:nZ.getDefinitionFromContextCreation,sequence:110,dataSeriesLimit:1}),K_.add(`line`,{matcher:e=>e.type===`line`&&!e.stacked&&!e.fillArea,displayName:k(`Line`),chartType:`line`,chartSubtype:`line`,subtypeDefinition:{stacked:!1,fillArea:!1},category:`line`,preview:`o-spreadsheet-ChartPreview.LINE_CHART`}).add(`stacked_line`,{matcher:e=>e.type===`line`&&!e.fillArea&&!!e.stacked,displayName:k(`Stacked Line`),chartType:`line`,chartSubtype:`stacked_line`,subtypeDefinition:{stacked:!0,fillArea:!1},category:`line`,preview:`o-spreadsheet-ChartPreview.STACKED_LINE_CHART`}).add(`area`,{matcher:e=>e.type===`line`&&!e.stacked&&!!e.fillArea,displayName:k(`Area`),chartType:`line`,chartSubtype:`area`,subtypeDefinition:{stacked:!1,fillArea:!0},category:`area`,preview:`o-spreadsheet-ChartPreview.AREA_CHART`}).add(`stacked_area`,{matcher:e=>e.type===`line`&&e.stacked&&!!e.fillArea,displayName:k(`Stacked Area`),chartType:`line`,chartSubtype:`stacked_area`,subtypeDefinition:{stacked:!0,fillArea:!0},category:`area`,preview:`o-spreadsheet-ChartPreview.STACKED_AREA_CHART`}).add(`scatter`,{displayName:k(`Scatter`),chartType:`scatter`,chartSubtype:`scatter`,category:`misc`,preview:`o-spreadsheet-ChartPreview.SCATTER_CHART`}).add(`column`,{matcher:e=>e.type===`bar`&&!e.stacked&&!e.horizontal,displayName:k(`Column`),chartType:`bar`,chartSubtype:`column`,subtypeDefinition:{stacked:!1,horizontal:!1},category:`column`,preview:`o-spreadsheet-ChartPreview.COLUMN_CHART`}).add(`stacked_column`,{matcher:e=>e.type===`bar`&&e.stacked&&!e.horizontal,displayName:k(`Stacked Column`),chartType:`bar`,chartSubtype:`stacked_column`,subtypeDefinition:{stacked:!0,horizontal:!1},category:`column`,preview:`o-spreadsheet-ChartPreview.STACKED_COLUMN_CHART`}).add(`bar`,{matcher:e=>e.type===`bar`&&!e.stacked&&!!e.horizontal,displayName:k(`Bar`),chartType:`bar`,chartSubtype:`bar`,subtypeDefinition:{horizontal:!0,stacked:!1},category:`bar`,preview:`o-spreadsheet-ChartPreview.BAR_CHART`}).add(`stacked_bar`,{matcher:e=>e.type===`bar`&&e.stacked&&!!e.horizontal,displayName:k(`Stacked Bar`),chartType:`bar`,chartSubtype:`stacked_bar`,subtypeDefinition:{horizontal:!0,stacked:!0},category:`bar`,preview:`o-spreadsheet-ChartPreview.STACKED_BAR_CHART`}).add(`combo`,{displayName:k(`Combo`),chartSubtype:`combo`,chartType:`combo`,category:`line`,preview:`o-spreadsheet-ChartPreview.COMBO_CHART`}).add(`pie`,{matcher:e=>e.type===`pie`&&!e.isDoughnut,displayName:k(`Pie`),chartSubtype:`pie`,chartType:`pie`,subtypeDefinition:{isDoughnut:!1},category:`pie`,preview:`o-spreadsheet-ChartPreview.PIE_CHART`}).add(`doughnut`,{matcher:e=>e.type===`pie`&&!!e.isDoughnut,displayName:k(`Doughnut`),chartSubtype:`doughnut`,chartType:`pie`,subtypeDefinition:{isDoughnut:!0},category:`pie`,preview:`o-spreadsheet-ChartPreview.DOUGHNUT_CHART`}).add(`gauge`,{displayName:k(`Gauge`),chartSubtype:`gauge`,chartType:`gauge`,category:`misc`,preview:`o-spreadsheet-ChartPreview.GAUGE_CHART`}).add(`scorecard`,{displayName:k(`Scorecard`),chartSubtype:`scorecard`,chartType:`scorecard`,category:`misc`,preview:`o-spreadsheet-ChartPreview.SCORECARD_CHART`}).add(`waterfall`,{displayName:k(`Waterfall`),chartSubtype:`waterfall`,chartType:`waterfall`,category:`misc`,preview:`o-spreadsheet-ChartPreview.WATERFALL_CHART`}).add(`pyramid`,{displayName:k(`Population Pyramid`),chartSubtype:`pyramid`,chartType:`pyramid`,category:`misc`,preview:`o-spreadsheet-ChartPreview.POPULATION_PYRAMID_CHART`}).add(`radar`,{matcher:e=>e.type===`radar`&&!e.fillArea,displayName:k(`Radar`),chartSubtype:`radar`,chartType:`radar`,subtypeDefinition:{fillArea:!1},category:`misc`,preview:`o-spreadsheet-ChartPreview.RADAR_CHART`}).add(`filled_radar`,{matcher:e=>e.type===`radar`&&!!e.fillArea,displayName:k(`Filled Radar`),chartType:`radar`,chartSubtype:`filled_radar`,subtypeDefinition:{fillArea:!0},category:`misc`,preview:`o-spreadsheet-ChartPreview.FILLED_RADAR_CHART`}).add(`geo`,{displayName:k(`Geo Chart`),chartSubtype:`geo`,chartType:`geo`,category:`misc`,preview:`o-spreadsheet-ChartPreview.GEO_CHART`}).add(`funnel`,{displayName:k(`Funnel`),chartSubtype:`funnel`,chartType:`funnel`,category:`misc`,preview:`o-spreadsheet-ChartPreview.FUNNEL_CHART`}).add(`sunburst`,{matcher:e=>e.type===`sunburst`,displayName:k(`Sunburst`),chartSubtype:`sunburst`,chartType:`sunburst`,category:`hierarchical`,preview:`o-spreadsheet-ChartPreview.SUNBURST_CHART`}).add(`treemap`,{matcher:e=>e.type===`treemap`,displayName:k(`Tree Map`),chartType:`treemap`,chartSubtype:`treemap`,category:`hierarchical`,preview:`o-spreadsheet-ChartPreview.TREE_MAP_CHART`}).add(`calendar`,{displayName:k(`Calendar`),chartSubtype:`calendar`,chartType:`calendar`,category:`misc`,preview:`o-spreadsheet-ChartPreview.CALENDAR_CHART`});var vZ=class extends OG{queuedBordersToAdd={};copy(e){let t=e.sheetId;if(e.zones.length===0)return;let{rowsIndexes:n,columnsIndexes:r}=e,i=[];for(let e of n){let n=[];for(let i of r){let r={col:i,row:e,sheetId:t};n.push(this.getters.getCellBorder(r))}i.push(n)}return{borders:i}}paste(e,t,n){let r=e.sheetId;if(n.pasteOption===`asValue`)return;let i=e.zones;if(!n.isCutOperation)this.pasteFromCopy(r,i,t.borders);else{let{left:e,top:n}=i[0];this.pasteZone(r,e,n,t.borders)}this.executeQueuedChanges(r)}pasteZone(e,t,n,r){for(let[i,a]of r.entries())for(let[r,o]of a.entries()){let a={col:t+r,row:n+i,sheetId:e};this.pasteBorder(o,a)}}pasteBorder(e,t){let n={...this.getters.getCellBorder(t),...e},r=JSON.stringify(n);this.queuedBordersToAdd[r]||(this.queuedBordersToAdd[r]=[]),this.queuedBordersToAdd[r].push(E(t))}executeQueuedChanges(e){for(let t in this.queuedBordersToAdd){let n=this.queuedBordersToAdd[t],r=JSON.parse(t),i=Qt(n,[]);this.dispatch(`SET_BORDERS_ON_TARGET`,{sheetId:e,target:i,border:r})}this.queuedBordersToAdd={}}},yZ=class extends DG{copy(e){}},bZ=class extends yZ{copy(e){let t=e.sheetId,n=this.getters.getFigure(t,e.figureId);if(!n)throw Error(`No figure for the given id: ${e.figureId}`);if(n.tag!==`carousel`)return;let r={...n},i=this.getters.getCarousel(e.figureId),a={};for(let e of i.items)if(e.type===`chart`){let n=this.getters.getChart(e.chartId);if(!n)throw Error(`No chart for the given id: ${e.chartId}`);a[e.chartId]=n.copyInSheetId(t)}return{figureId:e.figureId,copiedFigure:r,copiedCarousel:i,copiedCharts:a,copiedSheetId:t}}getPasteTarget(e){return{zones:[],figureId:new Kl().smallUuid(),sheetId:e}}paste(e,t,n){if(!e.figureId)return;let{zones:r,figureId:i}=e,a=e.sheetId,{width:o,height:s}=t.copiedFigure,c=this.getters.getMaxAnchorOffset(a,s,o),{left:l,top:u}=r[0],d={x:0,y:0};l>c.col&&(l=c.col,d.x=c.offset.x),u>c.row&&(u=c.row,d.y=c.offset.y),this.dispatch(`CREATE_CAROUSEL`,{figureId:i,sheetId:a,definition:{items:[]},col:l,row:u,offset:d,size:{height:s,width:o}});let f=new Kl,p=b(t.copiedCarousel.items);for(let e of p){if(e.type!==`chart`)continue;let n=t.copiedCharts[e.chartId],r=f.smallUuid(),o=n.copyInSheetId(a).getDefinition();this.dispatch(`CREATE_CHART`,{figureId:i,chartId:r,sheetId:a,definition:o}),e.chartId=r}this.dispatch(`UPDATE_CAROUSEL`,{sheetId:a,figureId:i,definition:{...t.copiedCarousel,items:p}}),n.isCutOperation&&this.dispatch(`DELETE_FIGURE`,{sheetId:t.copiedSheetId,figureId:t.copiedFigure.id}),this.dispatch(`SELECT_FIGURE`,{figureId:i})}isPasteAllowed(e,t,n,r){return t.length===0?`EmptyTarget`:r?.pasteOption===void 0?`Success`:`WrongFigurePasteOption`}},xZ=class extends yZ{copy(e){let t=e.sheetId,n=this.getters.getFigure(t,e.figureId);if(!n)throw Error(`No figure for the given id: ${e.figureId}`);if(n.tag!==`chart`)return;let r={...n},i=this.getters.getChartFromFigureId(e.figureId);if(!i)throw Error(`No chart for the given id: ${e.figureId}`);let a=i.copyInSheetId(t);return{figureId:e.figureId,copiedFigure:r,copiedChart:a}}getPasteTarget(e,t,n,r){return{zones:[],figureId:new Kl().smallUuid(),sheetId:e}}paste(e,t,n){if(!e.figureId)return;let{zones:r,figureId:i}=e,a=e.sheetId,{width:o,height:s}=t.copiedFigure,c=t.copiedChart.copyInSheetId(a),l=this.getters.getMaxAnchorOffset(a,s,o),{left:u,top:d}=r[0],f={x:0,y:0};u>l.col&&(u=l.col,f.x=l.offset.x),d>l.row&&(d=l.row,f.y=l.offset.y),this.dispatch(`CREATE_CHART`,{figureId:i,chartId:new Kl().smallUuid(),sheetId:a,definition:c.getDefinition(),col:u,row:d,offset:f,size:{height:s,width:o}}),n.isCutOperation&&this.dispatch(`DELETE_FIGURE`,{sheetId:t.copiedChart.sheetId,figureId:t.copiedFigure.id}),this.dispatch(`SELECT_FIGURE`,{figureId:i})}isPasteAllowed(e,t,n,r){return t.length===0?`EmptyTarget`:r?.pasteOption===void 0?`Success`:`WrongFigurePasteOption`}},SZ=class extends OG{uuidGenerator=new Kl;queuedChanges={};copy(e){if(!e.zones.length)return;let{rowsIndexes:t,columnsIndexes:n}=e,r=e.sheetId,i=[];for(let e of t){let t=[];for(let i of n){let n=Array.from(this.getters.getRulesByCell(r,i,e));t.push({position:{col:i,row:e,sheetId:r},rules:n})}i.push(t)}return{cfRules:i}}paste(e,t,n){if(this.queuedChanges={},n.pasteOption===`asValue`)return;let r=e.zones,i=e.sheetId;n.isCutOperation?this.pasteFromCut(i,r,t):this.pasteFromCopy(i,r,t.cfRules,n),this.executeQueuedChanges()}pasteFromCut(e,t,n){let r=t[0];this.pasteZone(e,r.left,r.top,n.cfRules,{isCutOperation:!0})}pasteZone(e,t,n,r,i){for(let[a,o]of r.entries())for(let[r,s]of o.entries()){let o={col:t+r,row:n+a,sheetId:e};this.pasteCf(s,o,i?.isCutOperation)}}pasteCf(e,t,n){if(e?.rules&&e.rules.length>0){let r=E(e.position),i=E(t);for(let a of e.rules){let o=[];if(n&&o.push(r),e.position.sheetId===t.sheetId)this.adaptCFRules(e.position.sheetId,a,[i],o);else{this.adaptCFRules(e.position.sheetId,a,[],o);let n=this.getCFToCopyTo(t.sheetId,a);this.adaptCFRules(t.sheetId,n,[i],[])}}}}adaptCFRules(e,t,n,r){this.queuedChanges[e]||(this.queuedChanges[e]=[]);let i=this.queuedChanges[e].find(e=>e.cf.id===t.id);i?(i.toAdd.push(...n),i.toRemove.push(...r)):this.queuedChanges[e].push({toAdd:n,toRemove:r,cf:t})}executeQueuedChanges(){for(let e in this.queuedChanges)for(let{toAdd:t,toRemove:n,cf:r}of this.queuedChanges[e]){let i=this.getters.getAdaptedCfRanges(e,r,t,n);if(i){if(i.length===0){this.dispatch(`REMOVE_CONDITIONAL_FORMAT`,{id:r.id,sheetId:e});continue}this.dispatch(`ADD_CONDITIONAL_FORMAT`,{cf:{id:r.id,rule:r.rule,stopIfTrue:r.stopIfTrue},ranges:i,sheetId:e})}}}getCFToCopyTo(e,t){let n=this.getters.getConditionalFormats(e).find(e=>e.stopIfTrue===t.stopIfTrue&&w(e.rule,t.rule)),r=this.queuedChanges[e];return!n&&r&&(n=r.find(e=>e.cf.stopIfTrue===t.stopIfTrue&&w(e.cf.rule,t.rule))?.cf),n||{...t,id:this.uuidGenerator.smallUuid(),ranges:[]}}},CZ=class extends OG{uuidGenerator=new Kl;queuedChanges={};copy(e){let{rowsIndexes:t,columnsIndexes:n}=e,r=e.sheetId,i=[];for(let e of t){let t=[];for(let i of n){let n={sheetId:r,col:i,row:e},a=this.getters.getValidationRuleForCell(n);t.push({position:n,rule:a})}i.push(t)}return{dvRules:i}}paste(e,t,n){if(this.queuedChanges={},n.pasteOption)return;let r=e.zones,i=e.sheetId;n.isCutOperation?this.pasteFromCut(i,r,t):this.pasteFromCopy(i,r,t.dvRules),this.executeQueuedChanges()}pasteFromCut(e,t,n){let r=t[0];this.pasteZone(e,r.left,r.top,n.dvRules,{isCutOperation:!0})}pasteZone(e,t,n,r,i){for(let[a,o]of r.entries())for(let[r,s]of o.entries()){let o={col:t+r,row:n+a,sheetId:e};this.pasteDataValidation(s,o,i?.isCutOperation)}}pasteDataValidation(e,t,n){if(e){let r=E(t),i=E(e.position),a=e.rule;if(!a){let e=this.getters.getValidationRuleForCell(t);e&&this.adaptDataValidationRule(t.sheetId,e,[],[r]);return}let o=[];if(n&&o.push(i),e.position.sheetId===t.sheetId){let n=this.getDataValidationRuleToCopyTo(t.sheetId,a,!1);this.adaptDataValidationRule(e.position.sheetId,n,[r],o)}else{let n=this.getters.getValidationRuleForCell(e.position);n&&this.adaptDataValidationRule(e.position.sheetId,n,[],o);let i=this.getDataValidationRuleToCopyTo(t.sheetId,a);this.adaptDataValidationRule(t.sheetId,i,[r],[])}}}getDataValidationRuleToCopyTo(e,t,n=!0){let r=this.getters.getDataValidationRules(e).find(e=>w(t.criterion,e.criterion)&&t.isBlocking===e.isBlocking),i=this.queuedChanges[e];return!r&&i&&(r=i.find(e=>w(t.criterion,e.rule.criterion)&&t.isBlocking===e.rule.isBlocking)?.rule),r||{...t,id:n?this.uuidGenerator.smallUuid():t.id,ranges:[]}}adaptDataValidationRule(e,t,n,r){this.queuedChanges[e]||(this.queuedChanges[e]=[]);let i=this.queuedChanges[e].find(e=>e.rule.id===t.id);i?(i.toAdd.push(...n),i.toRemove.push(...r)):this.queuedChanges[e].push({toAdd:n,toRemove:r,rule:t})}executeQueuedChanges(){for(let e in this.queuedChanges)for(let{toAdd:t,toRemove:n,rule:r}of this.queuedChanges[e]){let i=Qt([...Qt(r.ranges.map(e=>e.zone),n),...t],[]);if(i.length===0){this.dispatch(`REMOVE_DATA_VALIDATION_RULE`,{sheetId:e,id:r.id});continue}this.dispatch(`ADD_DATA_VALIDATION_RULE`,{rule:{id:r.id,criterion:r.criterion,isBlocking:r.isBlocking},ranges:i.map(t=>this.getters.getRangeDataFromZone(e,t)),sheetId:e})}}},wZ=class extends yZ{copy(e){let t=e.sheetId,n=this.getters.getFigure(t,e.figureId);if(!n)throw Error(`No figure for the given id: ${e.figureId}`);let r={...n};if(n.tag!==`image`)return;let i=b(this.getters.getImage(e.figureId));return{figureId:e.figureId,copiedFigure:r,copiedImage:i,sheetId:t}}getPasteTarget(e,t,n,r){return{sheetId:e,zones:[],figureId:new Kl().smallUuid()}}paste(e,t,n){if(!e.figureId)return;let{zones:r,figureId:i}=e,a=this.getters.getActiveSheetId(),{width:o,height:s}=t.copiedFigure,c=b(t.copiedImage),l=this.getters.getMaxAnchorOffset(a,s,o),{left:u,top:d}=r[0],f={x:0,y:0};u>l.col&&(u=l.col,f.x=l.offset.x),d>l.row&&(d=l.row,f.y=l.offset.y),this.dispatch(`CREATE_IMAGE`,{figureId:i,sheetId:a,col:u,row:d,offset:f,size:{height:s,width:o},definition:c}),n.isCutOperation&&this.dispatch(`DELETE_FIGURE`,{sheetId:t.sheetId,figureId:t.copiedFigure.id}),this.dispatch(`SELECT_FIGURE`,{figureId:i})}isPasteAllowed(e,t,n,r){return t.length===0?`EmptyTarget`:r?.pasteOption===void 0?`Success`:`WrongFigurePasteOption`}},TZ=class extends OG{copy(e){let t=this.getters.getActiveSheetId(),{rowsIndexes:n,columnsIndexes:r}=e,i=[];for(let e of n){let n=[];for(let i of r){let r={col:i,row:e,sheetId:t};n.push(this.getters.getMerge(r))}i.push(n)}return{merges:i,sheetId:t}}paste(e,t,n){if(n.isCutOperation){let e=t.merges.flat().filter(C);this.dispatch(`REMOVE_MERGE`,{sheetId:t.sheetId,target:e})}this.pasteFromCopy(e.sheetId,e.zones,t.merges,n)}pasteZone(e,t,n,r){for(let[i,a]of r.entries())for(let[r,o]of a.entries()){let a={col:t+r,row:n+i,sheetId:e};this.pasteMerge(o,a)}}pasteMerge(e,t){if(!e||this.getters.isInMerge(t))return;let{sheetId:n,col:r,row:i}=t;this.dispatch(`ADD_MERGE`,{sheetId:n,force:!0,target:[{left:r,top:i,right:r+e.right-e.left,bottom:i+e.bottom-e.top}]})}},EZ=class extends OG{copy(e){return{zones:e.clippedZones,sheetId:e.sheetId}}paste(e,t,n){if(n.isCutOperation){let n=e.zones[0];this.dispatch(`MOVE_RANGES`,{target:t.zones,sheetId:t.sheetId,sheetName:this.getters.getSheetName(t.sheetId),targetSheetId:e.sheetId,col:n.left,row:n.top})}}},DZ=class extends OG{isPasteAllowed(e,t,n,r){if(!(`cells`in n))return`Success`;let{xSplit:i,ySplit:a}=this.getters.getPaneDivisions(e);return Un(rA(t,n.cells),i,a)?`FrozenPaneOverlap`:`Success`}},OZ=class extends OG{copy(e){let t=e.sheetId;if(e.zones.length===0)return;let n=[],r=0;for(let i of Ze(e.columnsIndexes)){let a=0;for(let o of Ze(e.rowsIndexes)){let e={left:i[0],right:i[i.length-1],top:o[0],bottom:o[o.length-1]};n.push(...this.getters.getZoneStyles(t,e).map(t=>({zone:{left:t.zone.left-e.left+r,right:t.zone.right&&t.zone.right-e.left+r,top:t.zone.top-e.top+a,bottom:t.zone.bottom&&t.zone.bottom-e.top+a},style:t.style}))),a+=o.length}r+=i.length}return{styles:n,width:e.columnsIndexes.length,height:e.rowsIndexes.length}}paste(e,t,n){let r=e.sheetId;if(n.pasteOption===`asValue`)return;let i=e.zones;if(n.isCutOperation){let{left:e,top:n}=i[0];this.pasteStyleZone(r,e,n,t.styles)}else for(let e of i)for(let n of nA(e,t.width,t.height))this.pasteStyleZone(r,n.left,n.top,t.styles)}pasteStyleZone(e,t,n,r){for(let i of r){let r={left:i.zone.left+t,right:i.zone.right&&i.zone.right+t||i.zone.left+t,top:i.zone.top+n,bottom:i.zone.bottom&&i.zone.bottom+n||i.zone.top+n};this.dispatch(`SET_FORMATTING`,{sheetId:e,target:[r],style:i.style})}}},kZ=class extends OG{copy(e,t,n=`copyPaste`){let r=e.sheetId,{rowsIndexes:i,columnsIndexes:a,zones:o}=e,s=new Set,c=[];for(let e of i){let l=[];c.push(l);for(let c of a){let a={col:c,row:e,sheetId:r},u=this.getters.getTable(a);if(!u){l.push({});continue}let d=this.getters.getCoreTable(a),f=d?.range.zone,p;if(!s.has(u.id)&&d&&f&&o.some(e=>Dn(f,e))){s.add(u.id);let{numberOfRows:e}=On(f);for(let n=f.top;n<=f.bottom;n++)!t&&!i.includes(n)&&e--;let n=d.range,r=this.getters.extendRange(d.range,`ROW`,n.zone.top+e-1-n.zone.bottom);p={range:this.getters.getRangeData(r),config:d.config,type:d.type}}n!==`shiftCells`&&l.push({table:p,style:this.getTableStyleToCopy(a),isWholeTableCopied:s.has(u.id)})}}return{tableCells:c,sheetId:e.sheetId}}getTableStyleToCopy(e){let t=this.getters.getCellTableStyle(e),n=this.getters.getCellStyle(e),r=this.getters.getCellTableBorder(e),i=this.getters.getCellBorder(e);return{style:{...t,...bt(n)},border:{...r,...bt(i)}}}paste(e,t,n){let r=e.zones,i=e.sheetId;n.isCutOperation?this.pasteFromCut(i,r,t,n):this.pasteFromCopy(i,r,t.tableCells,n)}pasteFromCut(e,t,n,r){for(let e of n.tableCells)for(let t of e)t.table&&this.dispatch(`REMOVE_TABLE`,{sheetId:n.sheetId,target:[this.getters.getRangeFromRangeData(t.table.range).zone]});let i=t[0];this.pasteZone(e,i.left,i.top,n.tableCells,r)}pasteZone(e,t,n,r,i){for(let a=0;a<r.length;a++){let o=r[a];for(let r=0;r<o.length;r++){let s=o[r];if(!s)continue;let c={col:t+r,row:n+a,sheetId:e};this.pasteTableCell(e,s,c,i)}}if(r.length===1)for(let i=0;i<r[0].length;i++)this.dispatch(`AUTOFILL_TABLE_COLUMN`,{col:t+i,row:n,sheetId:e})}pasteTableCell(e,t,n,r){if(t.table&&!r?.pasteOption){let{range:r}=t.table,i=On(this.getters.getRangeFromRangeData(r).zone),a={left:n.col,top:n.row,right:n.col+i.numberOfCols-1,bottom:n.row+i.numberOfRows-1};this.dispatch(`CREATE_TABLE`,{sheetId:n.sheetId,ranges:[this.getters.getRangeDataFromZone(e,a)],config:t.table.config,tableType:t.table.type})}this.getters.getCoreTable(n)||r?.pasteOption===`asValue`||(!r?.pasteOption&&!t.isWholeTableCopied||r?.pasteOption===`onlyFormat`)&&(t.style?.style&&this.dispatch(`UPDATE_CELL`,{...n,style:t.style.style}),t.style?.border&&this.dispatch(`SET_BORDER`,{...n,border:t.style.border}))}};BB.figureHandlers.add(`chart`,xZ).add(`image`,wZ).add(`carousel`,bZ),BB.cellHandlers.add(`dataValidation`,CZ).add(`cell`,kG).add(`sheet`,DZ).add(`merge`,TZ).add(`border`,vZ).add(`table`,kZ).add(`conditionalFormat`,SZ).add(`references`,EZ).add(`style`,OZ);let AZ={},jZ={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:26,HEADER_WIDTH:48,DESKTOP_BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:96,DEFAULT_CELL_HEIGHT:23,SCROLLBAR_WIDTH:15},MZ={autoCompleteProviders:ak,autofillModifiersRegistry:jG,autofillRulesRegistry:MG,cellMenuRegistry:SR,colMenuRegistry:Bz,errorTypes:da,linkMenuRegistry:Qk,functionRegistry:yO,featurePluginRegistry:fq,iconsOnCellRegistry:uG,statefulUIPluginRegistry:pq,coreViewsPluginRegistry:mq,corePluginRegistry:dq,rowMenuRegistry:qz,sidePanelRegistry:nW,figureRegistry:Mv,chartSidePanelComponentRegistry:xH,chartComponentRegistry:dv,chartRegistry:f_,chartSubtypeRegistry:K_,topbarMenuRegistry:Gq,topbarComponentRegistry:dJ,clickableCellRegistry:xq,otRegistry:ZG,inverseCommandRegistry:wq,urlRegistry:Ys,cellPopoverRegistry:Fv,numberFormatMenuRegistry:Bq,repeatLocalCommandTransformRegistry:HK,repeatCommandTransformRegistry:VK,clipboardHandlersRegistries:BB,pivotRegistry:ZL,pivotTimeAdapterRegistry:Um,pivotSidePanelRegistry:IU,pivotNormalizationValueRegistry:xh,supportedPivotPositionalFormulaRegistry:cW,pivotToFunctionValueRegistry:Sh,migrationStepRegistry:nP,chartJsExtensionRegistry:ql},NZ={arg:G,isEvaluationError:M,toBoolean:F,toJsDate:I,toNumber:N,toString:P,toNormalizedPivotValue:_h,toFunctionPivotValue:yh,toXC:T,toZone:un,toUnboundedZone:ln,toCartesian:Zt,numberToLetters:Ht,lettersToNumber:Ut,UuidGenerator:Kl,formatValue:z,createCurrencyFormat:us,ColorGenerator:ei,computeTextWidth:Ol,createEmptyWorkbookData:SP,createEmptySheet:xP,createEmptyExcelSheet:CP,rgbaToHex:jr,colorToRGBA:Mr,positionToZone:E,isDefined:C,isMatrix:xa,lazy:mt,genericRepeat:uJ,createAction:h,createActions:p,transformRangeData:$n,deepEquals:w,overlap:wn,union:bn,isInside:En,deepCopy:b,expandZoneOnInsertion:gn,reduceZoneOnDeletion:yn,unquote:Je,getMaxObjectId:lh,getFunctionsFromTokens:CU,getFirstPivotFunction:EU,getNumberOfPivotFunctions:OU,parseDimension:fh,isDateOrDatetimeField:ph,makeFieldProposal:kU,insertTokenAfterArgSeparator:jU,insertTokenAfterLeftParenthesis:MU,mergeContiguousZones:Xn,getPivotHighlights:GH,pivotTimeAdapter:Wm,UNDO_REDO_PIVOT_COMMANDS:wG,createPivotFormula:gh,areDomainArgsFieldsValid:hh,splitReference:Fc,sanitizeSheetName:Xe,getUniqueText:zt,isNumber:$i,isDateTime:xi,createCustomFields:Oh,schemeToColorScale:Mm,isDateTimeFormat:rs,jsDateToNumber:Fi,numberToJsDate:Ni,DateTime:O,parseFormat:Do,isFormula:Bt,PositionMap:bF},PZ={isMarkdownLink:nt,parseMarkdownLink:at,markdownLink:it,openLink:ec,urlRepresentation:$s},FZ={Checkbox:Fk,Section:q,RoundColorPicker:bk,ChartDataSeries:TV,ChartErrorSection:EV,ChartLabelRange:DV,ChartTitle:jV,ChartPanel:TH,ChartFigure:Av,ChartJsComponent:kf,ClickableCellSortIcon:lW,ZoomableChartJsComponent:rv,Grid:sW,GridOverlay:KB,ScorecardChart:Cp,GaugeChartComponent:lv,LineConfigPanel:iH,BarConfigPanel:kV,PieChartDesignPanel:sH,GenericChartConfigPanel:OV,ChartWithAxisDesignPanel:VV,GenericZoomableChartDesignPanel:HV,LineChartDesignPanel:aH,GaugeChartConfigPanel:QV,GaugeChartDesignPanel:$V,ScorecardChartConfigPanel:fH,ScorecardChartDesignPanel:pH,GeoChartDesignPanel:nH,RadarChartDesignPanel:cH,WaterfallChartDesignPanel:bH,ComboChartDesignPanel:YV,FunnelChartDesignPanel:ZV,SunburstChartDesignPanel:mH,TreeMapChartDesignPanel:yH,ChartTypePicker:CH,FigureComponent:Nv,MenuPopover:Dv,Popover:Cv,SelectionInput:kk,ValidationMessages:IB,AddDimensionButton:XH,PivotDimensionGranularity:QH,PivotDimensionOrder:$H,PivotDimension:ZH,PivotLayoutConfigurator:yU,PivotHTMLRenderer:dW,PivotDeferUpdate:qH,PivotTitleSection:bU,CogWheelMenu:SV,TextInput:gV,SidePanelCollapsible:Vv,RadioSelection:NV,GeoChartRegionSelectSection:eH,ChartDashboardMenu:Ov,FullScreenFigure:uW,NumberInput:LV,TopBar:YJ,Composer:PO},IZ={useDragAndDropListItems:Sk,useHighlights:OH,useHighlightsOnHover:DH},LZ={useStoreProvider:ar,DependencyContainer:tr,CellPopoverStore:Bk,ComposerFocusStore:_r,CellComposerStore:CB,FindAndReplaceStore:LH,HighlightStore:sk,DelayedHoveredCellStore:Pv,HoveredTableStore:UB,ModelStore:ur,NotificationStore:ck,RendererStore:mr,SelectionInputStore:Ok,SpreadsheetStore:hr,useStore:D,useLocalStore:or,SidePanelStore:iW,PivotSidePanelStore:PU,PivotMeasureDisplayPanelStore:UH,ClientFocusStore:Yz,GridRenderer:eV};function RZ(e,t){return yO.add(e,t),{addFunction:(e,t)=>RZ(e,t)}}let zZ={DEFAULT_LOCALE:R,HIGHLIGHT_COLOR:ee,PIVOT_TABLE_CONFIG:Le,ChartTerms:Yp,FIGURE_ID_SPLITTER:`??`,GRID_ICON_EDGE_LENGTH:17,GRID_ICON_MARGIN:2},BZ={...F_,...l_};e.AbstractCellClipboardHandler=OG,e.AbstractChart=Af,e.AbstractFigureClipboardHandler=yZ,e.CellErrorType=A,e.ClientDisconnectedError=MK,e.CommandResult=qs,e.CorePlugin=fW,e.CoreViewPlugin=RW,e.DEFAULT_LOCALE=R,e.DEFAULT_LOCALES=fo,e.DispatchResult=Gs,e.EvaluationError=j,e.LocalTransportService=fJ,e.Model=$X,e.PivotRuntimeDefinition=LL,e.Registry=B,e.Revision=jK,e.SPREADSHEET_DIMENSIONS=jZ,e.Spreadsheet=QJ,e.SpreadsheetPivotTable=zL,e.UIPlugin=cb,e.__info__=AZ,e.addFunction=RZ,e.addRenderingLayer=pr,e.astToFormula=yB,e.categories=bO,e.chartHelpers=BZ,e.components=FZ,e.constants=zZ,e.convertAstNodes=JO,e.coreTypes=Hs,e.createAutocompleteArgumentsProvider=hq,e.findCellInNewZone=Ln,e.functionCache=cU,e.getCaretDownSvg=ZA,e.getCaretUpSvg=QA,e.helpers=NZ,e.hooks=IZ,e.invalidateCFEvaluationCommands=Rs,e.invalidateChartEvaluationCommands=Is,e.invalidateDependenciesCommands=Ls,e.invalidateEvaluationCommands=Fs,e.iterateAstNodes=YO,e.links=PZ,e.load=sP,e.parse=KO,e.parseTokens=qO,e.readonlyAllowedCommands=Vs,e.registries=MZ,e.setDefaultSheetViewSize=Fe,e.setTranslationMethod=ca,e.stores=LZ,e.tokenColors=He,e.tokenize=bu,AZ.version=`19.1.33`,AZ.date=`2026-08-29T09:14:49.301Z`,AZ.hash=`5c5b7a2`})(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 19.1.
|
|
5
|
-
@date 2026-08-
|
|
6
|
-
@hash
|
|
4
|
+
@version 19.1.33
|
|
5
|
+
@date 2026-08-29T09:14:50.099Z
|
|
6
|
+
@hash 5c5b7a2
|
|
7
7
|
-->
|
|
8
8
|
<odoo>
|
|
9
9
|
<t t-name="o-spreadsheet-ValidationMessages">
|