@luzmo/analytics-components-kit 1.2.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -3
- package/angular/components/add-to-dashboard.ts +20 -6
- package/angular/components/data-fields-select.ts +5 -0
- package/angular/components/interactive-viz-item.ts +89 -24
- package/angular/components/item-grid-item-actions-menu.ts +5 -0
- package/angular/components/item-grid.ts +7 -0
- package/angular/components/item-option-color-picker.ts +28 -28
- package/angular/components/item-option-guidelines.ts +22 -1
- package/angular/components/item-option-multi-language-field.ts +7 -7
- package/angular/components/item-option-number-field.ts +14 -14
- package/angular/components/item-option-positions-number-field.ts +14 -14
- package/angular/components/item-option-radio-button-group.ts +7 -7
- package/angular/components/item-option-text-field.ts +7 -7
- package/angular/components/item-slot-picker-panel.ts +1 -1
- package/angular/components/item-slot-picker.ts +7 -7
- package/angular/esm/components/add-to-dashboard.d.ts +8 -4
- package/angular/esm/components/add-to-dashboard.js +23 -7
- package/angular/esm/components/data-fields-select.d.ts +2 -0
- package/angular/esm/components/data-fields-select.js +4 -0
- package/angular/esm/components/interactive-viz-item.d.ts +32 -11
- package/angular/esm/components/interactive-viz-item.js +99 -28
- package/angular/esm/components/item-grid-item-actions-menu.d.ts +2 -0
- package/angular/esm/components/item-grid-item-actions-menu.js +4 -0
- package/angular/esm/components/item-grid.d.ts +3 -1
- package/angular/esm/components/item-grid.js +9 -1
- package/angular/esm/components/item-option-color-picker.d.ts +10 -10
- package/angular/esm/components/item-option-color-picker.js +34 -34
- package/angular/esm/components/item-option-guidelines.d.ts +8 -2
- package/angular/esm/components/item-option-guidelines.js +26 -2
- package/angular/esm/components/item-option-multi-language-field.d.ts +3 -3
- package/angular/esm/components/item-option-multi-language-field.js +10 -10
- package/angular/esm/components/item-option-number-field.d.ts +5 -5
- package/angular/esm/components/item-option-number-field.js +18 -18
- package/angular/esm/components/item-option-positions-number-field.d.ts +5 -5
- package/angular/esm/components/item-option-positions-number-field.js +18 -18
- package/angular/esm/components/item-option-radio-button-group.d.ts +3 -3
- package/angular/esm/components/item-option-radio-button-group.js +10 -10
- package/angular/esm/components/item-option-text-field.d.ts +3 -3
- package/angular/esm/components/item-option-text-field.js +10 -10
- package/angular/esm/components/item-slot-picker-panel.d.ts +1 -1
- package/angular/esm/components/item-slot-picker-panel.js +1 -1
- package/angular/esm/components/item-slot-picker.d.ts +3 -3
- package/angular/esm/components/item-slot-picker.js +9 -9
- package/angular/package.json +2 -2
- package/components/add-to-dashboard/dashboard-actions.d.ts +2 -1
- package/components/add-to-dashboard/index.cjs +1 -1
- package/components/add-to-dashboard/index.js +1 -1
- package/components/{add-to-dashboard-NwsCPIlg.cjs → add-to-dashboard-BtzTZdjN.cjs} +1 -1
- package/components/{add-to-dashboard-NcVHlqrc.js → add-to-dashboard-Bu6S3qVz.js} +125 -120
- package/components/chart-helpers-BHxQbLBw.cjs +20 -0
- package/components/{chart-helpers-Dng_LGfq.js → chart-helpers-BKeMLhov.js} +53 -39
- package/components/filters/index.cjs +1 -1
- package/components/filters/index.js +1 -1
- package/components/{filters-CxIzuI5q.js → filters-DEpmh9Nj.js} +113 -102
- package/components/filters-LDXhe1Bp.cjs +187 -0
- package/components/index.cjs +1 -1
- package/components/index.js +6 -6
- package/components/interactive-viz-item/helpers/chart-helpers.d.ts +2 -1
- package/components/interactive-viz-item/index.cjs +1 -1
- package/components/interactive-viz-item/index.d.ts +1 -1
- package/components/interactive-viz-item/index.js +3 -3
- package/components/interactive-viz-item/interactive-viz-item.d.ts +47 -1
- package/components/interactive-viz-item/types.d.ts +4 -0
- package/components/interactive-viz-item-Cc3Ix95e.js +630 -0
- package/components/interactive-viz-item-SF12d97t.cjs +269 -0
- package/components/item-grid/item-grid.d.ts +1 -0
- package/components/item-slot-picker-panel/index.cjs +1 -1
- package/components/item-slot-picker-panel/index.js +1 -1
- package/components/item-slot-picker-panel/item-slot-picker-panel.d.ts +19 -1
- package/components/item-slot-picker-panel-Cw3UCK03.cjs +84 -0
- package/components/{item-slot-picker-panel-fJqEmxeD.js → item-slot-picker-panel-DprM9Rli.js} +64 -33
- package/custom-elements.json +3051 -2531
- package/grid-core/item-grid-base.d.ts +5 -4
- package/package.json +2 -2
- package/react/package.json +2 -2
- package/standalone/add-to-dashboard.js +40 -40
- package/standalone/chunks/{chart-helpers-DsIGsaDc.js → chart-helpers-DZsidiCl.js} +2 -2
- package/standalone/chunks/{choropleth-map-options.config-rUJsEJcm.js → choropleth-map-options.config-CDMjKnJD.js} +1 -1
- package/standalone/chunks/{color-range-utils-DxOtqAKB.js → color-range-utils-BVyHBRiq.js} +1 -1
- package/standalone/chunks/data-broker-DpSrH3IP.js +2 -0
- package/standalone/chunks/de-BkB0q1Eg.js +2 -0
- package/standalone/chunks/display-settings-binning-DhHlclWH.js +38 -0
- package/standalone/chunks/display-settings-datetime-C8xvOvi4.js +199 -0
- package/standalone/chunks/display-settings-grand-totals-CUpigDcs.js +26 -0
- package/standalone/chunks/display-settings-numeric-BLWF54Jx.js +172 -0
- package/standalone/chunks/display-settings-period-over-period-COd4tvUw.js +209 -0
- package/standalone/chunks/embed-Bv1ps-EM.js +260 -0
- package/standalone/chunks/en-DNsyAwgq.js +2 -0
- package/standalone/chunks/en-GB-Di3OzVdL.js +2 -0
- package/standalone/chunks/en-US-DNsyAwgq.js +2 -0
- package/standalone/chunks/es-Bo0jStZn.js +2 -0
- package/standalone/chunks/{filters-DKgJcQGP.js → filters-lhg_WVDK.js} +108 -108
- package/standalone/chunks/{formula-codemirror-BbyvNEVD.js → formula-codemirror-DZMzLE2I.js} +17 -17
- package/standalone/chunks/fr-Co_qVhhV.js +2 -0
- package/standalone/chunks/{heat-map-options.config-D93AeYFi.js → heat-map-options.config-DDQMD38W.js} +1 -1
- package/standalone/chunks/{heat-table-options.config-ZVML76FK.js → heat-table-options.config-B4K0Ygug.js} +1 -1
- package/standalone/chunks/{is-same-option-value-Di-A7Wmg.js → is-same-option-value-7kXNF4st.js} +1 -1
- package/standalone/chunks/item-option-action-button-group-Bl1HR1JK.js +35 -0
- package/standalone/chunks/item-option-base-DF24wTyv.js +38 -0
- package/standalone/chunks/item-option-color-palette-picker-MkIIn56p.js +22 -0
- package/standalone/chunks/item-option-color-picker-CxosMo_p.js +19 -0
- package/standalone/chunks/item-option-color-range-C7C70r4J.js +83 -0
- package/standalone/chunks/item-option-guidelines-iu8yWRzr.js +120 -0
- package/standalone/chunks/{item-option-multi-language-field-DPPpN2qg.js → item-option-multi-language-field-foanqCdr.js} +1 -1
- package/standalone/chunks/{item-option-number-field-CkqJjInE.js → item-option-number-field-ByVD4oq0.js} +1 -1
- package/standalone/chunks/item-option-panel-Bya-K7HH.js +316 -0
- package/standalone/chunks/{item-option-picker-BnwQPT9A.js → item-option-picker-CqNNVIML.js} +1 -1
- package/standalone/chunks/item-option-position-picker-BjCFVtDH.js +14 -0
- package/standalone/chunks/item-option-positions-number-field-BJJtXZL-.js +31 -0
- package/standalone/chunks/{item-option-radio-button-group-BkymJq3E.js → item-option-radio-button-group-C5bxsD85.js} +1 -1
- package/standalone/chunks/item-option-slider-DUXWz70B.js +18 -0
- package/standalone/chunks/item-option-switch-BHyJuOkP.js +12 -0
- package/standalone/chunks/{item-option-text-field-D7bkuhsv.js → item-option-text-field-rBZY9OX4.js} +1 -1
- package/standalone/chunks/{item-slot-picker-panel-D4BMxGs9.js → item-slot-picker-panel-BM82vSXi.js} +101 -99
- package/standalone/chunks/load-data-fields-for-datasets-DS9O1oyy.js +25 -0
- package/standalone/chunks/localize-DLl7tgQp.js +2 -0
- package/standalone/chunks/localized-decorator-DosMCCQo.js +2 -0
- package/standalone/chunks/{version-BW4Ixl63.js → localized-mixin-BWJj88bd.js} +1 -1
- package/standalone/chunks/nl-CQz2jrVx.js +2 -0
- package/standalone/chunks/{option-interaction-controller-BslAXAHF.js → option-interaction-controller-BuwRr21c.js} +1 -1
- package/standalone/chunks/{route-map-options.config-Dwy0JSVq.js → route-map-options.config-CGBkHnhM.js} +1 -1
- package/standalone/chunks/{spike-map-options.config-DFmuNxym.js → spike-map-options.config-CSenlJ_F.js} +1 -1
- package/standalone/interactive-viz-item.js +88 -84
- package/standalone/item-grid.js +10 -10
- package/standalone/manifest.json +46 -46
- package/types.d.ts +1 -1
- package/components/chart-helpers-ufZ6VbXs.cjs +0 -20
- package/components/filters-BPbPFOu5.cjs +0 -187
- package/components/interactive-viz-item-CwRRaCZB.js +0 -583
- package/components/interactive-viz-item-CxdrGRKc.cjs +0 -265
- package/components/item-slot-picker-panel-BhhN54IM.cjs +0 -82
- package/standalone/chunks/data-broker-DXDyIrj_.js +0 -2
- package/standalone/chunks/de-mdZT2W1G.js +0 -2
- package/standalone/chunks/display-settings-binning-Byffw2Kl.js +0 -38
- package/standalone/chunks/display-settings-datetime-CD52d6Sv.js +0 -199
- package/standalone/chunks/display-settings-grand-totals-Cky99LX9.js +0 -26
- package/standalone/chunks/display-settings-numeric-C9ea7Tgc.js +0 -172
- package/standalone/chunks/display-settings-period-over-period-BLSGumkD.js +0 -209
- package/standalone/chunks/embed-CBu7iQRx.js +0 -231
- package/standalone/chunks/en-CSboh17P.js +0 -2
- package/standalone/chunks/en-GB-HoXKQBOY.js +0 -2
- package/standalone/chunks/en-US-CSboh17P.js +0 -2
- package/standalone/chunks/es-Di5D8JFd.js +0 -2
- package/standalone/chunks/fr-DZku7iB9.js +0 -2
- package/standalone/chunks/item-option-action-button-group-BEAwPHVw.js +0 -35
- package/standalone/chunks/item-option-base-CRUxNhJQ.js +0 -38
- package/standalone/chunks/item-option-color-palette-picker-CBz61iZb.js +0 -22
- package/standalone/chunks/item-option-color-picker-lLvBPnKA.js +0 -19
- package/standalone/chunks/item-option-color-range-BqeatOei.js +0 -83
- package/standalone/chunks/item-option-guidelines-Cop8rM8y.js +0 -120
- package/standalone/chunks/item-option-panel-CzSKFCVl.js +0 -316
- package/standalone/chunks/item-option-position-picker-Bkc4JvJX.js +0 -14
- package/standalone/chunks/item-option-positions-number-field-Dr_315TE.js +0 -31
- package/standalone/chunks/item-option-slider-K_bsNci8.js +0 -18
- package/standalone/chunks/item-option-switch-DeihDHhM.js +0 -12
- package/standalone/chunks/load-data-fields-for-datasets-ClctSj6y.js +0 -25
- package/standalone/chunks/localize-DXRmGRe-.js +0 -2
- package/standalone/chunks/localized-decorator-DJVBmJVH.js +0 -2
- package/standalone/chunks/nl-CViTevL3.js +0 -2
package/standalone/chunks/{item-slot-picker-panel-D4BMxGs9.js → item-slot-picker-panel-BM82vSXi.js}
RENAMED
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
|
|
2
|
-
import{i as e,n as t,r as n}from"./version-BW4Ixl63.js";import{t as r}from"./localized-decorator-DJVBmJVH.js";import{n as i,t as a}from"./luzmoCog-C4v4vc5N.js";import{t as o}from"./luzmoTrashOutline-DXZpJx7f.js";import{c as s,l as c,n as l,t as u}from"./load-data-fields-for-datasets-ClctSj6y.js";import{t as d}from"./luzmoPlus-Dyrrz0v8.js";import{t as f}from"./luzmo-icon-markup-ByaNI6dg.js";import{d as p,f as m,p as h}from"./chart-helpers-DsIGsaDc.js";import{c as g,i as _,l as v,n as y,o as b}from"./data-broker-DXDyIrj_.js";import{t as x}from"./localize-DXRmGRe-.js";import{t as S}from"./create-lazy-loader-DC0rJePE.js";import{t as C}from"./task-BlhDPTQS.js";import{AsyncDirective as w,directive as ee,guard as T,html as E,ifDefined as D,nothing as O,property as k,query as te,queryAll as ne,state as A,unsafeCSS as re}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/lit.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/action-button.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/button.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/divider.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/icon.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/overlay.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/progress-circle.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/tooltip.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/field-label.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/select.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/text-field.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/multi-language-field.js";var ie=Object.defineProperty,ae=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),oe=(e,t)=>{let n={};for(var r in e)ie(n,r,{get:e[r],enumerable:!0});return t||ie(n,Symbol.toStringTag,{value:`Module`}),n},se={icon:[24,24,`m6 6 16 16M3.3 4.7l7.3 7.3-7.3 7.3c-1 1 .5 2.3 1.4 1.4l7.3-7.3 7.3 7.3c1 1 2.3-.5 1.4-1.4L13.4 12l7.3-7.3c1-1-.5-2.3-1.4-1.4L12 10.6 4.7 3.3c-.9-1-2.3.5-1.4 1.4Z`],name:`close-12`},ce={icon:[32,32,`M16 0a16 16 0 1 0 0 32 16 16 0 0 0 0-32Zm0 2a14 14 0 0 1 14 14 14 14 0 0 1-14 14A14 14 0 0 1 2 16 14 14 0 0 1 16 2Zm0 5.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3ZM15 15v9c0 1.3 2 1.3 2 0v-9c0-1.3-2-1.3-2 0z`],name:`info-circle-outline`},le={icon:[32,32,`M12 3v9H3c-1.3 0-1.3 2 0 2h10q1 0 1-1V3c0-1.3-2-1.3-2 0m6 0v10q0 1 1 1h10c1.3 0 1.3-2 0-2h-9V3c0-1.3-2-1.3-2 0M3 18c-1.3 0-1.3 2 0 2h9v9c0 1.3 2 1.3 2 0V19q0-1-1-1zm16 0a1 1 0 0 0-1 1v10c0 1.3 2 1.3 2 0v-9h9c1.3 0 1.3-2 0-2z`],name:`scope-grouped`},ue={icon:[32,32,`M1 0a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1 1 1 0 0 0 1-1V2h7a1 1 0 0 0 1-1 1 1 0 0 0-1-1H8Zm22 0a1 1 0 0 0-1 1 1 1 0 0 0 1 1h7v7a1 1 0 0 0 1 1 1 1 0 0 0 1-1V1a1 1 0 0 0-1-1ZM.98 22a1 1 0 0 0-1 1v1L0 31a1 1 0 0 0 1 1l8-.02a1 1 0 0 0 1-1 1 1 0 0 0-1-1L2 30l-.01-6v-1a1 1 0 0 0-1-1Zm30 0a1 1 0 0 0-1 1l.02 7-6 .02h-1a1 1 0 0 0-1 1 1 1 0 0 0 1 1h1l7-.02a1 1 0 0 0 1-1l-.02-8a1 1 0 0 0-1-1z`],name:`scope-full`},de={icon:[32,32,`M15 2v2A12 12 0 0 0 4 15H2c-1.3 0-1.3 2 0 2h2a12 12 0 0 0 11 11v2c0 1.3 2 1.3 2 0v-2a12 12 0 0 0 11-11h2c1.3 0 1.3-2 0-2h-2A12 12 0 0 0 17 4V2c0-1.3-2-1.3-2 0m0 4v2c0 1.3 2 1.3 2 0V6a10 10 0 0 1 9 9h-2c-1.3 0-1.3 2 0 2h2a10 10 0 0 1-9 9v-2c0-1.3-2-1.3-2 0v2a10 10 0 0 1-9-9h2c1.3 0 1.3-2 0-2H6a10 10 0 0 1 9-9m1 8a2 2 0 1 0 0 4 2 2 0 0 0 0-4`],name:`scope-fixed`},fe={"area-chart":()=>import(`./area-chart-slots.config-Bxvau_Ii.js`),"bar-chart":()=>import(`./bar-chart-slots.config-BWQoKCYJ.js`),"box-plot":()=>import(`./box-plot-slots.config-4hmeA6nr.js`),"bubble-chart":()=>import(`./bubble-chart-slots.config-CqTUMwvW.js`),"bullet-chart":()=>import(`./bullet-chart-slots.config-BiFMJsgN.js`),"choropleth-map":()=>import(`./choropleth-map-slots.config-CRF7J3QP.js`),"circle-pack-chart":()=>import(`./circle-pack-chart-slots.config-Deq7IUoK.js`),"circular-gauge":()=>import(`./circular-gauge-slots.config-C7yUFfFJ.js`),"column-chart":()=>import(`./column-chart-slots.config-ZBLvqhEb.js`),"combination-chart":()=>import(`./combination-chart-slots.config-BNVJfRB2.js`),"conditional-number":()=>import(`./conditional-number-slots.config-B4kqODqw.js`),"date-comparison-filter":()=>import(`./date-comparison-filter-slots.config-GxZF3vb3.js`),"date-filter":()=>import(`./date-filter-slots.config-DHaOkULx.js`),"donut-chart":()=>import(`./donut-chart-slots.config-7pDpzNBG.js`),"dropdown-filter":()=>import(`./dropdown-filter-slots.config-DkqLjilE.js`),"evolution-number":()=>import(`./evolution-number-slots.config-IqPfnCrw.js`),"funnel-chart":()=>import(`./funnel-chart-slots.config-DfeuNGEL.js`),"heat-map":()=>import(`./heat-map-slots.config-BVBzVjJJ.js`),"heat-table":()=>import(`./heat-table-slots.config-CcOl-PCp.js`),"hexbin-map":()=>import(`./hexbin-map-slots.config-D6qVm4nj.js`),image:()=>import(`./image-slots.config-CdWEUY0l.js`),kpi:()=>import(`./kpi-slots.config-DAjLHdEj.js`),"line-chart":()=>import(`./line-chart-slots.config-CavGuJXK.js`),"marker-map":()=>import(`./marker-map-slots.config-CtzpU-rK.js`),"ohlc-chart":()=>import(`./ohlc-chart-slots.config-xYpPbmg2.js`),"parallel-coordinates-plot":()=>import(`./parallel-coordinates-plot-slots.config-DvJljfr8.js`),"pivot-table":()=>import(`./pivot-table-slots.config-DZOE04Ea.js`),"pyramid-chart":()=>import(`./pyramid-chart-slots.config-DKBFy-TL.js`),"radar-chart":()=>import(`./radar-chart-slots.config-CHauNDhi.js`),"regular-table":()=>import(`./regular-table-slots.config-BqEJgzhG.js`),"route-map":()=>import(`./route-map-slots.config-B5G4JVnI.js`),"sankey-diagram":()=>import(`./sankey-diagram-slots.config-jyKqjUsV.js`),"scatter-plot":()=>import(`./scatter-plot-slots.config-CF2Ii2Ez.js`),"search-filter":()=>import(`./search-filter-slots.config-BcTF-DAh.js`),"slicer-filter":()=>import(`./slicer-filter-slots.config-DL3Q0Zbm.js`),"slider-filter":()=>import(`./slider-filter-slots.config-52Bs7zu3.js`),"speedometer-chart":()=>import(`./speedometer-chart-slots.config-Cfsna_2O.js`),"spike-map":()=>import(`./spike-map-slots.config-FfXNX2O3.js`),"strip-plot":()=>import(`./strip-plot-slots.config-DQrrby2Y.js`),"sunburst-chart":()=>import(`./sunburst-chart-slots.config-DqW1e0nf.js`),"symbol-map":()=>import(`./symbol-map-slots.config-B_UtYexb.js`),text:()=>import(`./text-slots.config-D33nu0FP.js`),"treemap-chart":()=>import(`./treemap-chart-slots.config-CaearczZ.js`),"venn-diagram":()=>import(`./venn-diagram-slots.config-GnP5AAAL.js`),video:()=>import(`./video-slots.config-ufoVcXKL.js`),"wordcloud-chart":()=>import(`./wordcloud-chart-slots.config-g7QwS2dG.js`)},pe=e=>`${e.replaceAll(/-([a-z])/g,(e,t)=>t.toUpperCase())}SlotsConfig`,me=async e=>{try{let t=fe[e];return t?(await t())[pe(e)]??null:null}catch{return null}},he=e=>e?me(e):Promise.resolve(null),ge=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function _e(e){return typeof e==`string`&&ge.test(e)}function ve(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function ye(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function be(e){return e=ye(Math.abs(e)),e?e[1]:NaN}function xe(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Se(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var Ce=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function we(e){if(!(t=Ce.exec(e)))throw Error(`invalid format: `+e);var t;return new Te({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}we.prototype=Te.prototype;function Te(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}Te.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function Ee(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(i+1):e}var De;function Oe(e,t){var n=ye(e,t);if(!n)return De=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(De=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+ye(e,Math.max(0,t+a-1))[0]}function ke(e,t){var n=ye(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var Ae={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:ve,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>ke(e*100,t),r:ke,s:Oe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function je(e){return e}var Me=Array.prototype.map,Ne=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function Pe(e){var t=e.grouping===void 0||e.thousands===void 0?je:xe(Me.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?je:Se(Me.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=we(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):Ae[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=Ae[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=Ee(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&De!==void 0?Ne[8+De/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var ee=n.length+e.length+r.length,T=ee<h?Array(h-ee+1).join(u):``;switch(g&&m&&(e=t(T+e,T.length?h-r.length:1/0),T=``),d){case`<`:e=n+e+r+T;break;case`=`:e=n+T+e+r;break;case`^`:e=T.slice(0,ee=T.length>>1)+n+e+r+T.slice(ee);break;default:e=T+n+e+r}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(be(t)/3)))*3,r=10**-n,i=l((e=we(e),e.type=`f`,e),{suffix:Ne[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var Fe=/* @__PURE__ */ new Date,Ie=/* @__PURE__ */ new Date;function j(e,t,n,r){function i(t){return e(t=arguments.length===0?/* @__PURE__ */ new Date:/* @__PURE__ */ new Date(+t)),t}return i.floor=t=>(e(t=/* @__PURE__ */ new Date(+t)),t),i.ceil=n=>(e(n=/* @__PURE__ */ new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=/* @__PURE__ */ new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=/* @__PURE__ */ new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>j(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e){if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}}),n&&(i.count=(t,r)=>(Fe.setTime(+t),Ie.setTime(+r),e(Fe),e(Ie),Math.floor(n(Fe,Ie))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var Le=1e3,M=Le*60,Re=M*60,ze=Re*24,Be=ze*7,Ve=j(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Le)},(e,t)=>(t-e)/Le,e=>e.getUTCSeconds());Ve.range;var He=j(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Le)},(e,t)=>{e.setTime(+e+t*M)},(e,t)=>(t-e)/M,e=>e.getMinutes());He.range,j(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*M)},(e,t)=>(t-e)/M,e=>e.getUTCMinutes()).range;var Ue=j(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Le-e.getMinutes()*M)},(e,t)=>{e.setTime(+e+t*Re)},(e,t)=>(t-e)/Re,e=>e.getHours());Ue.range,j(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Re)},(e,t)=>(t-e)/Re,e=>e.getUTCHours()).range;var We=j(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*M)/ze,e=>e.getDate()-1);We.range;var Ge=j(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ze,e=>e.getUTCDate()-1);Ge.range,j(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ze,e=>Math.floor(e/ze)).range;function N(e){return j(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*M)/Be)}var Ke=N(0),qe=N(1),Je=N(2),Ye=N(3),Xe=N(4),Ze=N(5),Qe=N(6);Ke.range,qe.range,Je.range,Ye.range,Xe.range,Ze.range,Qe.range;function P(e){return j(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/Be)}var $e=P(0),et=P(1),tt=P(2),nt=P(3),rt=P(4),it=P(5),at=P(6);$e.range,et.range,tt.range,nt.range,rt.range,it.range,at.range;var ot=j(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());ot.range,j(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()).range;var F=j(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());F.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:j(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),F.range;var I=j(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());I.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:j(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),I.range;function st(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function ct(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function lt(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function ut(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=ht(i),u=gt(i),d=ht(a),f=gt(a),p=ht(o),m=gt(o),h=ht(s),g=gt(s),_=ht(c),v=gt(c),y={a:A,A:re,b:ie,B:ae,c:null,d:Lt,e:Lt,f:Ht,g:$t,G:tn,H:Rt,I:zt,j:Bt,L:Vt,m:Ut,M:Wt,p:oe,q:se,Q:Tn,s:En,S:Gt,u:Kt,U:qt,V:Yt,w:Xt,W:Zt,x:null,X:null,y:Qt,Y:en,Z:nn,"%":wn},b={a:ce,A:le,b:ue,B:de,c:null,d:rn,e:rn,f:ln,g:bn,G:Sn,H:an,I:on,j:sn,L:cn,m:un,M:dn,p:fe,q:pe,Q:Tn,s:En,S:fn,u:pn,U:mn,V:gn,w:_n,W:vn,x:null,X:null,y:yn,Y:xn,Z:Cn,"%":wn},x={a:T,A:E,b:D,B:O,c:k,d:Dt,e:Dt,f:Nt,g:Ct,G:St,H:kt,I:kt,j:Ot,L:Mt,m:Et,M:At,p:ee,q:Tt,Q:Ft,s:It,S:jt,u:vt,U:yt,V:bt,w:_t,W:xt,x:te,X:ne,y:Ct,Y:St,Z:wt,"%":Pt};y.x=S(n,y),y.X=S(r,y),y.c=S(t,y),b.x=S(n,b),b.X=S(r,b),b.c=S(t,b);function S(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=/* @__PURE__ */ new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(c=dt[s=e.charAt(++i)])==null?c=s===`e`?` `:`0`:s=e.charAt(++i),(l=t[s])&&(s=l(n,c)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function C(e,t){return function(n){var r=lt(1900,void 0,1),i=w(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=ct(lt(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?et.ceil(a):et(a),a=Ge.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=st(lt(r.y,0,1)),o=a.getDay(),a=o>4||o===0?qe.ceil(a):qe(a),a=We.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else(`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?ct(lt(r.y,0,1)).getUTCDay():st(lt(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,ct(r)):st(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in dt?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function ee(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function T(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,n,r){return w(e,t,n,r)}function te(e,t,r){return w(e,n,t,r)}function ne(e,t,n){return w(e,r,t,n)}function A(e){return o[e.getDay()]}function re(e){return a[e.getDay()]}function ie(e){return c[e.getMonth()]}function ae(e){return s[e.getMonth()]}function oe(e){return i[+(e.getHours()>=12)]}function se(e){return 1+~~(e.getMonth()/3)}function ce(e){return o[e.getUTCDay()]}function le(e){return a[e.getUTCDay()]}function ue(e){return c[e.getUTCMonth()]}function de(e){return s[e.getUTCMonth()]}function fe(e){return i[+(e.getUTCHours()>=12)]}function pe(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}var dt={"-":``,_:` `,0:`0`},L=/^\s*\d+/,ft=/^%/,pt=/[\\^$*+?|[\]().{}]/g;function R(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function mt(e){return e.replace(pt,`\\$&`)}function ht(e){return RegExp(`^(?:`+e.map(mt).join(`|`)+`)`,`i`)}function gt(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function _t(e,t,n){var r=L.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function vt(e,t,n){var r=L.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function yt(e,t,n){var r=L.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function bt(e,t,n){var r=L.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function xt(e,t,n){var r=L.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function St(e,t,n){var r=L.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Ct(e,t,n){var r=L.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function wt(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function Tt(e,t,n){var r=L.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Et(e,t,n){var r=L.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Dt(e,t,n){var r=L.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Ot(e,t,n){var r=L.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function kt(e,t,n){var r=L.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function At(e,t,n){var r=L.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function jt(e,t,n){var r=L.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Mt(e,t,n){var r=L.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Nt(e,t,n){var r=L.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Pt(e,t,n){var r=ft.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Ft(e,t,n){var r=L.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function It(e,t,n){var r=L.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Lt(e,t){return R(e.getDate(),t,2)}function Rt(e,t){return R(e.getHours(),t,2)}function zt(e,t){return R(e.getHours()%12||12,t,2)}function Bt(e,t){return R(1+We.count(F(e),e),t,3)}function Vt(e,t){return R(e.getMilliseconds(),t,3)}function Ht(e,t){return Vt(e,t)+`000`}function Ut(e,t){return R(e.getMonth()+1,t,2)}function Wt(e,t){return R(e.getMinutes(),t,2)}function Gt(e,t){return R(e.getSeconds(),t,2)}function Kt(e){var t=e.getDay();return t===0?7:t}function qt(e,t){return R(Ke.count(F(e)-1,e),t,2)}function Jt(e){var t=e.getDay();return t>=4||t===0?Xe(e):Xe.ceil(e)}function Yt(e,t){return e=Jt(e),R(Xe.count(F(e),e)+(F(e).getDay()===4),t,2)}function Xt(e){return e.getDay()}function Zt(e,t){return R(qe.count(F(e)-1,e),t,2)}function Qt(e,t){return R(e.getFullYear()%100,t,2)}function $t(e,t){return e=Jt(e),R(e.getFullYear()%100,t,2)}function en(e,t){return R(e.getFullYear()%1e4,t,4)}function tn(e,t){var n=e.getDay();return e=n>=4||n===0?Xe(e):Xe.ceil(e),R(e.getFullYear()%1e4,t,4)}function nn(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+R(t/60|0,`0`,2)+R(t%60,`0`,2)}function rn(e,t){return R(e.getUTCDate(),t,2)}function an(e,t){return R(e.getUTCHours(),t,2)}function on(e,t){return R(e.getUTCHours()%12||12,t,2)}function sn(e,t){return R(1+Ge.count(I(e),e),t,3)}function cn(e,t){return R(e.getUTCMilliseconds(),t,3)}function ln(e,t){return cn(e,t)+`000`}function un(e,t){return R(e.getUTCMonth()+1,t,2)}function dn(e,t){return R(e.getUTCMinutes(),t,2)}function fn(e,t){return R(e.getUTCSeconds(),t,2)}function pn(e){var t=e.getUTCDay();return t===0?7:t}function mn(e,t){return R($e.count(I(e)-1,e),t,2)}function hn(e){var t=e.getUTCDay();return t>=4||t===0?rt(e):rt.ceil(e)}function gn(e,t){return e=hn(e),R(rt.count(I(e),e)+(I(e).getUTCDay()===4),t,2)}function _n(e){return e.getUTCDay()}function vn(e,t){return R(et.count(I(e)-1,e),t,2)}function yn(e,t){return R(e.getUTCFullYear()%100,t,2)}function bn(e,t){return e=hn(e),R(e.getUTCFullYear()%100,t,2)}function xn(e,t){return R(e.getUTCFullYear()%1e4,t,4)}function Sn(e,t){var n=e.getUTCDay();return e=n>=4||n===0?rt(e):rt.ceil(e),R(e.getUTCFullYear()%1e4,t,4)}function Cn(){return`+0000`}function wn(){return`%`}function Tn(e){return+e}function En(e){return Math.floor(e/1e3)}var Dn,z;On({dateTime:`%x, %X`,date:`%-m/%-d/%Y`,time:`%-I:%M:%S %p`,periods:[`AM`,`PM`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`]});function On(e){return Dn=ut(e),z=Dn.format,Dn.parse,Dn.utcFormat,Dn.utcParse,Dn}var kn=[[1,4,12,52,365,8760,525600,31536e3,31536e6],[1/4,1,3,13,91,2184,131040,7862400,78624e5],[1/12,1/3,1,4,30,720,43200,2592e3,2592e6],[1/52,1/13,1/4,1,7,168,10080,604800,6048e5],[1/365,1/91,1/30,1/7,1,24,1440,86400,864e5],[1/8760,1/2184,1/720,1/168,1/24,1,60,3600,36e5],[1/525600,1/131040,1/43200,1/10080,1/1440,1/60,1,60,6e4],[1/31536e3,1/7862400,1/2592e3,1/604800,1/86400,1/3600,1/60,1,1e3],[1/31536e6,1/78624e5,1/2592e6,1/6048e5,1/864e5,1/36e5,1/6e4,1/1e3,1]];function An(e,t,n){if(_(e))return;if(!t||!n||t===n)return e;let r=kn[t-1][n-1];if(r)return e*r}function jn(e,t,n,r){if(_(e)||!t.lowestLevel||n.length===0)return``;let i=[],a=0,o=Math.round(e*kn[t.lowestLevel-1][8]);for(let[,t]of n.entries())if(e){o-=a;let e=kn[t-1][8],n=Math.floor(o/e);a=n*e,i.push({level:t,value:n})}else i.push({level:t,value:0});let s=``;for(let[e,n]of i.entries())if(t.duration.format===`time`){let t=n.value;[6,7,8].includes(n.level)&&n.value<10?t=`0`+n.value.toString():n.level===9&&n.value<10?t=`00`+n.value.toString():n.level===9&&n.value<100&&(t=`0`+n.value.toString()),s+=(e===0?``:n.level===9?`.`:`:`)+t}else if(t.duration.format===`long`){let t=r.durationLongSuffix;s+=n.value+` `+t[n.level]+(e===i.length-1?``:` `)}else{let t=r.durationShortSuffix;s+=n.value+``+t[n.level]+(e===i.length-1?``:` `)}return s}function Mn(e){let t=/(?:([^{])?([<>=^]))?([+\- ()])?([$#])?(0)?(\d+)?([,_])?(\.-?\d+)?([a-z%]{1,2})?/i.exec(e)??[];return{fill:t[1]||` `,align:t[2]||`>`,sign:t[3]||`-`,symbol:t[4]||``,zfill:t[5],width:+t[6],comma:t[7],precision:t[8],typeFormat:t[9]}}var Nn={decimal:`.`,thousands:`,`,grouping:[3],currency:[`$`,``],dateTime:`%a %b %e %X %Y`,date:`%m/%d/%Y`,dateSeparator:`/`,time:`%H:%M:%S`,periods:[`AM`,`PM`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],levels:[`All`,`Year`,`Quarter`,`Month`,`Week`,`Date`,`Hour`,`Minute`,`Second`,`Millisecond`],shortLevels:[`All`,`Yr`,`Qtr`,`Mth`,`Wk`,`Date`,`Hr`,`Min`,`Sec`,`Msec`],durationLongSuffix:[``,`years`,`quarters`,`months`,`weeks`,`days`,`hours`,`minutes`,`seconds`,`milliseconds`],durationShortSuffix:[``,`y`,`q`,`mo`,`w`,`d`,`h`,`m`,`s`,`ms`],multi:[`.%L`,`:%S`,`%I:%M`,`%I %p`,`%a %d`,`W%G`,`%b %d`,`%B`,`%Y`]},Pn=`%d-%m-%Y`,Fn=[{key:`%a %e %b %Y`,lev1:`%Y`,lev2:`Q%q-%Y`,lev3:`%b %Y`,lev4:`Wk %V-%G`,lev5:`%a %e %b %Y`,monthType:`name`,longText:!1,weekday:!0},{key:`%e %b %Y`,lev1:`%Y`,lev2:`Q%q-%Y`,lev3:`%b %Y`,lev4:`Wk %V-%G`,lev5:`%e %b %Y`,monthType:`name`,longText:!1,weekday:!1},{key:`%a %e %B %Y`,lev1:`%Y`,lev2:`Q%q-%Y`,lev3:`%B %Y`,lev4:`Week %V, %G`,lev5:`%a %e %B %Y`,monthType:`name`,longText:!0,weekday:!0},{key:`%e %B %Y`,lev1:`%Y`,lev2:`Q%q-%Y`,lev3:`%B %Y`,lev4:`Week %V, %G`,lev5:`%e %B %Y`,monthType:`name`,longText:!0,weekday:!1},{key:`%d/%m/%Y`,lev1:`%Y`,lev2:`Q%q/%Y`,lev3:`%m/%Y`,lev4:`W%V/%G`,lev5:`%d/%m/%Y`,monthType:`number`,mmdd:!1,separator:`/`},{key:`%d-%m-%Y`,lev1:`%Y`,lev2:`Q%q-%Y`,lev3:`%m-%Y`,lev4:`W%V-%G`,lev5:`%d-%m-%Y`,monthType:`number`,mmdd:!1,separator:`-`},{key:`%d.%m.%Y`,lev1:`%Y`,lev2:`Q%q.%Y`,lev3:`%m.%Y`,lev4:`W%V.%G`,lev5:`%d.%m.%Y`,monthType:`number`,mmdd:!1,separator:`.`},{key:`%d~%m~%Y`,lev1:`%Y`,lev2:`Q%q~%Y`,lev3:`%m~%Y`,lev4:`W%V~%G`,lev5:`%d~%m~%Y`,monthType:`number`,mmdd:!1,separator:`~`},{key:`%m/%d/%Y`,lev1:`%Y`,lev2:`Q%q/%Y`,lev3:`%m/%Y`,lev4:`%G/W%V`,lev5:`%m/%d/%Y`,monthType:`number`,mmdd:!0,separator:`/`},{key:`%m-%d-%Y`,lev1:`%Y`,lev2:`Q%q-%Y`,lev3:`%m-%Y`,lev4:`%G-W%V`,lev5:`%m-%d-%Y`,monthType:`number`,mmdd:!0,separator:`-`},{key:`%m.%d.%Y`,lev1:`%Y`,lev2:`Q%q.%Y`,lev3:`%m.%Y`,lev4:`%G.W%V`,lev5:`%m.%d.%Y`,monthType:`number`,mmdd:!0,separator:`.`},{key:`%m~%d~%Y`,lev1:`%Y`,lev2:`Q%q~%Y`,lev3:`%m~%Y`,lev4:`%G~W%V`,lev5:`%m~%d~%Y`,monthType:`number`,mmdd:!0,separator:`~`},{key:`%amd/%Y`,lev1:`%Y`,lev2:`Q%q/%Y`,lev3:`%m/%Y`,lev4:`%G/W%V`,lev5:`%amd/%Y`,monthType:`number`,mmdd:null,separator:`/`},{key:`%amd-%Y`,lev1:`%Y`,lev2:`Q%q-%Y`,lev3:`%m-%Y`,lev4:`%G-W%V`,lev5:`%amd-%Y`,monthType:`number`,mmdd:null,separator:`-`},{key:`%amd.%Y`,lev1:`%Y`,lev2:`Q%q.%Y`,lev3:`%m.%Y`,lev4:`%G.W%V`,lev5:`%amd.%Y`,monthType:`number`,mmdd:null,separator:`.`},{key:`%amd~%Y`,lev1:`%Y`,lev2:`Q%q~%Y`,lev3:`%m~%Y`,lev4:`%G~W%V`,lev5:`%amd~%Y`,monthType:`number`,mmdd:null,separator:`~`}],In=[{key:`%H:%M:%S.%L`,lev6:`%H:00`,lev7:`%H:%M`,lev8:`%H:%M:%S`,lev9:`%H:%M:%S.%L`,ampm:!1},{key:`%I:%M:%S.%L %p`,lev6:`%I:00 %p`,lev7:`%I:%M %p`,lev8:`%I:%M:%S %p`,lev9:`%I:%M:%S.%L %p`,ampm:!0}],Ln=(e,t,n)=>t===`letter`?e.shortNames?.length>0&&e.shortNames[n]?.length>0?e.shortNames[n]?.charAt(0):`N/A`:t===`short`?e.shortNames?.length>0&&e.shortNames[n]?e.shortNames[n]:`N/A`:e.longNames?.length>0&&e.longNames[n]?e.longNames[n]:`N/A`;function Rn(e,t){t||={};let n=t.localFormats||Nn,r,i,a,o=[],s=[],c=`datetime`,l;t&&t.multi&&(c=`datetime`),e&&e.format||(c=`hierarchy`),e&&e.type&&(c=e.type),l=e&&e.format?e.format:c===`numeric`?`,.0f`:c===`datetime`?Pn:``;let u=Mn(l);switch(u.precision&&u.typeFormat&&(c=`numeric`),c){case`numeric`:if(e.subtype===`duration`&&e.duration&&e.duration.levels&&e.duration.levels.length>1&&!t.hideDuration)r=t=>_(t)?``:jn(t,e,e.duration.levels,n);else{let a={...n},o=u.typeFormat,s=!1;switch(o.length===2&&o.startsWith(`a`)&&(s=!0,o=o.slice(1,2),l=l.replace(/a/,``)),s?(a.decimal=n.decimal,a.thousands=n.thousands):[`z`,`y`,`w`].includes(o)?(a.decimal=`,`,a.thousands=`.`):(a.decimal=`.`,a.thousands=`,`),o){case`z`:l=l.replace(`z`,`f`);break;case`y`:l=l.replace(`y`,`%`);break;case`w`:l=l.replace(`w`,`s`)}if(e?.subtype===`currency`&&e.currency){let t=a.currency.findIndex(e=>e.length>0),n=a.currency[t].startsWith(`\xA0`),r=a.currency[t].endsWith(`\xA0`),i=`${n?`\xA0`:``}${e.currency}${r?`\xA0`:``}`;a.currency[t]=i}let c=Pe(a);o!==`%`&&e?.subtype===`currency`&&e.currency&&a.currency&&!t?.hideCurrency&&![`count`,`distinctcount`].includes(e.aggregationFunc)&&(e.aggregationFunc!==`rate`||e.aggregationWeight?.columnSubType!==`currency`)&&e.periodOverPeriod?.type!==`percentageChange`&&(l=`$`+l),i=t?.trimZero&&[`y`,`%`].includes(o)&&a.decimal===`,`?e=>c.format(l)(e).replace(/(,\d*?)0+%$/,`$1%`).replace(/,%$/,`%`):t?.trimZero&&[`y`,`%`].includes(o)&&a.decimal===`.`?e=>c.format(l)(e).replace(/(\.\d*?)0+%$/,`$1%`).replace(/\.%$/,`%`):t?.trimZero&&[`z`,`f`].includes(o)&&a.decimal===`,`?e=>c.format(l)(e).replace(/(,\d*?)0+$/,`$1`).replace(/,$/,``):t?.trimZero&&[`z`,`f`].includes(o)&&a.decimal===`.`?e=>c.format(l)(e).replace(/(\.\d*?)0+$/,`$1`).replace(/\.$/,``):e?.subtype===`currency`&&e.currency&&a.currency&&o===`s`?e=>c.format(l)(e).replace(/G/,`B`):_(u.precision)?c.format(`,.0f`):c.format(l),r=r=>{if(_(r))return``;if(e.subtype===`duration`&&e.duration&&!t.hideDuration){let t=e.duration.levels?e.duration.levels[0]:e.lowestLevel;return t!==e.lowestLevel&&(r=An(r,e.lowestLevel,t)),i(r)+n?.durationShortSuffix?.[t]}return i(r)}}break;case`datetime`:if(o=n?.smartDateFormats??Fn,s=n?.smartTimeFormats??In,_(e.datetimeDisplayMode)||e.datetimeDisplayMode==="default"){if(t?.level){let e=t.level,r=o.find(e=>l.includes(e.key)),i=s.find(e=>l.includes(e.key)),a=r?r[`lev`+Math.min(e,5)]:o[0][`lev`+Math.min(e,5)],c=e>5?i?i[`lev`+e]:s[0][`lev`+e]:``;l=e>5?a+`, `+c:a;let u=l.includes(`%amd`)&&t.level>=5,d=r?t.level>=2&&r.separator===`~`:!1;l=u?d?l.replaceAll(/%amd[.~/-]%Y/g,n.date.slice(0,8)):l.replaceAll(/%amd[.~/-]%Y/g,n.date.slice(0,8).replaceAll(/[.~/-]/g,r.separator)):d?l.replaceAll(/[~]/g,n.dateSeparator):l}if(t?.multi){let e=z(n.multi[0]),t=z(n.multi[1]),r=z(n.multi[2]),i=z(n.multi[3]),o=z(n.multi[4]),s=z(n.multi[6]),c=z(n.multi[7]),l=z(n.multi[8]);a=n=>{let a;return a=Ve(n)<n?e:He(n)<n?t:Ue(n)<n?r:We(n)<n?i:ot(n)<n?Ke(n)<n?o:s:F(n)<n?c:l,a(n)}}else a=ut(n).format(l)}else{let t={quarter_number:{min:1,max:4},month_name:{min:1,max:12},month_number:{min:1,max:12},week_number:{min:1,max:53},day_in_month:{min:1,max:31},day_in_year:{min:1,max:366},weekday_name:{min:0,max:7},weekday_number:{min:0,max:7},hour_in_day:{min:0,max:23},minute_in_hour:{min:0,max:59},second_in_minute:{min:0,max:59}};a=[`quarter_number`,`month_number`,`week_number`,`day_in_month`,`day_in_year`,`weekday_number`,`hour_in_day`,`minute_in_hour`,`second_in_minute`].includes(e.datetimeDisplayMode)?n=>b(n)&&n>=t[e.datetimeDisplayMode].min&&n<=t[e.datetimeDisplayMode].max?n:`N/A`:e.datetimeDisplayMode===`month_name`?r=>{let i=[...n.shortMonths],a=[...n.months];return b(r)&&r>=t[e.datetimeDisplayMode].min&&r<=t[e.datetimeDisplayMode].max?Ln({shortNames:i,longNames:a},e.monthNameFormat,r-1):`N/A`}:e.datetimeDisplayMode===`weekday_name`?r=>{let i=[...n.shortDays],a=[...n.days];return e.weekStart===`monday`&&(i.push(i.shift()??``),a.push(a.shift()??``)),b(r)&&r>=t[e.datetimeDisplayMode].min&&r<=t[e.datetimeDisplayMode].max?Ln({shortNames:i,longNames:a},e.weekDayNameFormat,r-1):`N/A`}:ut(n).format(l)}r=e=>{if(_(e))return``;let t=a(e);return g(t)?t.trim():t};break;case`hierarchy`:r=e=>x(e,t?t.locale:void 0);break;default:r=e=>e}return r}var zn={HasDatetimeColumnAndNoComparisonFilters:`hasDatetimeColumnAndNoComparisonFilters`,NoDatetimeColumnAndNoComparisonFilters:`noDatetimeColumnAndNoComparisonFilters`,NoDatetimeColumnButComparisonFilters:`noDatetimeColumnButComparisonFilters`,HasDatetimeColumnAndComparisonFilters:`hasDatetimeColumnAndComparisonFilters`,OldImplementation:`oldImplementation`},Bn=/* @__PURE__ */ new Set([`x-axis`,`y-axis`,`category`,`name`,`row`,`levels`]),Vn=/* @__PURE__ */ new Set([`legend`,`color`,`column`]),Hn=/* @__PURE__ */ new Set([`measure`,`comparison-measure`]),Un={dimension:`mainGroupBy`,time:`mainGroupBy`,identifier:`mainGroupBy`,evolution:`mainGroupBy`,source:`mainGroupBy`,destination:`secondaryGroupBy`,open:`measure`,high:`measure`,low:`measure`,close:`measure`,target:`measure`,slidermetric:`measure`,geo:`other`,coordinates:`other`};function Wn(e){return e.type===`numeric`||e.type===`array[numeric]`?`numeric`:`dimension`}function Gn(e){return Un[e.slotName]||(Hn.has(e.slotName)?`measure`:Vn.has(e.slotName)?`secondaryGroupBy`:Bn.has(e.slotName)?`mainGroupBy`:e.slotType===`numeric`?`measure`:e.slotType===`categorical`?`mainGroupBy`:e.slotType===`mixed`?e.contentKind===`numeric`?`measure`:`mainGroupBy`:`other`)}function Kn(e){if(Array.isArray(e))return e}function qn(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Jn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Yn(e,t){if(e){if(typeof e==`string`)return Jn(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jn(e,t):void 0}}function Xn(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
import{n as e,r as t,t as n}from"./localized-mixin-BWJj88bd.js";import{t as r}from"./localized-decorator-DosMCCQo.js";import{n as i,t as a}from"./luzmoCog-C4v4vc5N.js";import{t as o}from"./luzmoTrashOutline-DXZpJx7f.js";import{c as s,l as c,n as l,t as u}from"./load-data-fields-for-datasets-DS9O1oyy.js";import{t as d}from"./luzmoPlus-Dyrrz0v8.js";import{t as f}from"./luzmo-icon-markup-ByaNI6dg.js";import{S as p,_ as m,b as h,h as g,p as _,v,x as y}from"./chart-helpers-DZsidiCl.js";import{n as b}from"./data-broker-DpSrH3IP.js";import{t as x}from"./localize-DLl7tgQp.js";import{t as S}from"./create-lazy-loader-DC0rJePE.js";import{t as ee}from"./task-BlhDPTQS.js";import{AsyncDirective as C,directive as te,guard as w,html as T,ifDefined as E,nothing as D,property as O,query as ne,queryAll as re,state as k,unsafeCSS as A}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/lit.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/action-button.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/button.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/divider.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/icon.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/overlay.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/progress-circle.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/tooltip.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/field-label.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/select.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/text-field.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/multi-language-field.js";var ie=Object.defineProperty,ae=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),oe=(e,t)=>{let n={};for(var r in e)ie(n,r,{get:e[r],enumerable:!0});return t||ie(n,Symbol.toStringTag,{value:`Module`}),n},se={icon:[24,24,`m6 6 16 16M3.3 4.7l7.3 7.3-7.3 7.3c-1 1 .5 2.3 1.4 1.4l7.3-7.3 7.3 7.3c1 1 2.3-.5 1.4-1.4L13.4 12l7.3-7.3c1-1-.5-2.3-1.4-1.4L12 10.6 4.7 3.3c-.9-1-2.3.5-1.4 1.4Z`],name:`close-12`},ce={icon:[32,32,`M16 0a16 16 0 1 0 0 32 16 16 0 0 0 0-32Zm0 2a14 14 0 0 1 14 14 14 14 0 0 1-14 14A14 14 0 0 1 2 16 14 14 0 0 1 16 2Zm0 5.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3ZM15 15v9c0 1.3 2 1.3 2 0v-9c0-1.3-2-1.3-2 0z`],name:`info-circle-outline`},le={icon:[32,32,`M12 3v9H3c-1.3 0-1.3 2 0 2h10q1 0 1-1V3c0-1.3-2-1.3-2 0m6 0v10q0 1 1 1h10c1.3 0 1.3-2 0-2h-9V3c0-1.3-2-1.3-2 0M3 18c-1.3 0-1.3 2 0 2h9v9c0 1.3 2 1.3 2 0V19q0-1-1-1zm16 0a1 1 0 0 0-1 1v10c0 1.3 2 1.3 2 0v-9h9c1.3 0 1.3-2 0-2z`],name:`scope-grouped`},ue={icon:[32,32,`M1 0a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1 1 1 0 0 0 1-1V2h7a1 1 0 0 0 1-1 1 1 0 0 0-1-1H8Zm22 0a1 1 0 0 0-1 1 1 1 0 0 0 1 1h7v7a1 1 0 0 0 1 1 1 1 0 0 0 1-1V1a1 1 0 0 0-1-1ZM.98 22a1 1 0 0 0-1 1v1L0 31a1 1 0 0 0 1 1l8-.02a1 1 0 0 0 1-1 1 1 0 0 0-1-1L2 30l-.01-6v-1a1 1 0 0 0-1-1Zm30 0a1 1 0 0 0-1 1l.02 7-6 .02h-1a1 1 0 0 0-1 1 1 1 0 0 0 1 1h1l7-.02a1 1 0 0 0 1-1l-.02-8a1 1 0 0 0-1-1z`],name:`scope-full`},de={icon:[32,32,`M15 2v2A12 12 0 0 0 4 15H2c-1.3 0-1.3 2 0 2h2a12 12 0 0 0 11 11v2c0 1.3 2 1.3 2 0v-2a12 12 0 0 0 11-11h2c1.3 0 1.3-2 0-2h-2A12 12 0 0 0 17 4V2c0-1.3-2-1.3-2 0m0 4v2c0 1.3 2 1.3 2 0V6a10 10 0 0 1 9 9h-2c-1.3 0-1.3 2 0 2h2a10 10 0 0 1-9 9v-2c0-1.3-2-1.3-2 0v2a10 10 0 0 1-9-9h2c1.3 0 1.3-2 0-2H6a10 10 0 0 1 9-9m1 8a2 2 0 1 0 0 4 2 2 0 0 0 0-4`],name:`scope-fixed`},fe={"area-chart":()=>import(`./area-chart-slots.config-Bxvau_Ii.js`),"bar-chart":()=>import(`./bar-chart-slots.config-BWQoKCYJ.js`),"box-plot":()=>import(`./box-plot-slots.config-4hmeA6nr.js`),"bubble-chart":()=>import(`./bubble-chart-slots.config-CqTUMwvW.js`),"bullet-chart":()=>import(`./bullet-chart-slots.config-BiFMJsgN.js`),"choropleth-map":()=>import(`./choropleth-map-slots.config-CRF7J3QP.js`),"circle-pack-chart":()=>import(`./circle-pack-chart-slots.config-Deq7IUoK.js`),"circular-gauge":()=>import(`./circular-gauge-slots.config-C7yUFfFJ.js`),"column-chart":()=>import(`./column-chart-slots.config-ZBLvqhEb.js`),"combination-chart":()=>import(`./combination-chart-slots.config-BNVJfRB2.js`),"conditional-number":()=>import(`./conditional-number-slots.config-B4kqODqw.js`),"date-comparison-filter":()=>import(`./date-comparison-filter-slots.config-GxZF3vb3.js`),"date-filter":()=>import(`./date-filter-slots.config-DHaOkULx.js`),"donut-chart":()=>import(`./donut-chart-slots.config-7pDpzNBG.js`),"dropdown-filter":()=>import(`./dropdown-filter-slots.config-DkqLjilE.js`),"evolution-number":()=>import(`./evolution-number-slots.config-IqPfnCrw.js`),"funnel-chart":()=>import(`./funnel-chart-slots.config-DfeuNGEL.js`),"heat-map":()=>import(`./heat-map-slots.config-BVBzVjJJ.js`),"heat-table":()=>import(`./heat-table-slots.config-CcOl-PCp.js`),"hexbin-map":()=>import(`./hexbin-map-slots.config-D6qVm4nj.js`),image:()=>import(`./image-slots.config-CdWEUY0l.js`),kpi:()=>import(`./kpi-slots.config-DAjLHdEj.js`),"line-chart":()=>import(`./line-chart-slots.config-CavGuJXK.js`),"marker-map":()=>import(`./marker-map-slots.config-CtzpU-rK.js`),"ohlc-chart":()=>import(`./ohlc-chart-slots.config-xYpPbmg2.js`),"parallel-coordinates-plot":()=>import(`./parallel-coordinates-plot-slots.config-DvJljfr8.js`),"pivot-table":()=>import(`./pivot-table-slots.config-DZOE04Ea.js`),"pyramid-chart":()=>import(`./pyramid-chart-slots.config-DKBFy-TL.js`),"radar-chart":()=>import(`./radar-chart-slots.config-CHauNDhi.js`),"regular-table":()=>import(`./regular-table-slots.config-BqEJgzhG.js`),"route-map":()=>import(`./route-map-slots.config-B5G4JVnI.js`),"sankey-diagram":()=>import(`./sankey-diagram-slots.config-jyKqjUsV.js`),"scatter-plot":()=>import(`./scatter-plot-slots.config-CF2Ii2Ez.js`),"search-filter":()=>import(`./search-filter-slots.config-BcTF-DAh.js`),"slicer-filter":()=>import(`./slicer-filter-slots.config-DL3Q0Zbm.js`),"slider-filter":()=>import(`./slider-filter-slots.config-52Bs7zu3.js`),"speedometer-chart":()=>import(`./speedometer-chart-slots.config-Cfsna_2O.js`),"spike-map":()=>import(`./spike-map-slots.config-FfXNX2O3.js`),"strip-plot":()=>import(`./strip-plot-slots.config-DQrrby2Y.js`),"sunburst-chart":()=>import(`./sunburst-chart-slots.config-DqW1e0nf.js`),"symbol-map":()=>import(`./symbol-map-slots.config-B_UtYexb.js`),text:()=>import(`./text-slots.config-D33nu0FP.js`),"treemap-chart":()=>import(`./treemap-chart-slots.config-CaearczZ.js`),"venn-diagram":()=>import(`./venn-diagram-slots.config-GnP5AAAL.js`),video:()=>import(`./video-slots.config-ufoVcXKL.js`),"wordcloud-chart":()=>import(`./wordcloud-chart-slots.config-g7QwS2dG.js`)},pe=e=>`${e.replaceAll(/-([a-z])/g,(e,t)=>t.toUpperCase())}SlotsConfig`,me=async e=>{try{let t=fe[e];return t?(await t())[pe(e)]??null:null}catch{return null}},he=e=>e?me(e):Promise.resolve(null),ge=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function _e(e){return typeof e==`string`&&ge.test(e)}function ve(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function ye(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function be(e){return e=ye(Math.abs(e)),e?e[1]:NaN}function xe(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Se(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var Ce=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function we(e){if(!(t=Ce.exec(e)))throw Error(`invalid format: `+e);var t;return new Te({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}we.prototype=Te.prototype;function Te(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}Te.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function Ee(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(i+1):e}var De;function Oe(e,t){var n=ye(e,t);if(!n)return De=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(De=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+ye(e,Math.max(0,t+a-1))[0]}function ke(e,t){var n=ye(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var Ae={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:ve,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>ke(e*100,t),r:ke,s:Oe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function je(e){return e}var Me=Array.prototype.map,Ne=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function Pe(e){var t=e.grouping===void 0||e.thousands===void 0?je:xe(Me.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?je:Se(Me.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=we(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):Ae[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=Ae[y],ee=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function C(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var C=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=Ee(e)),C&&+e==0&&f!==`+`&&(C=!1),n=(C?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&De!==void 0?Ne[8+De/3]:``)+r+(C&&f===`(`?`)`:``),ee){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var te=n.length+e.length+r.length,w=te<h?Array(h-te+1).join(u):``;switch(g&&m&&(e=t(w+e,w.length?h-r.length:1/0),w=``),d){case`<`:e=n+e+r+w;break;case`=`:e=n+w+e+r;break;case`^`:e=w.slice(0,te=w.length>>1)+n+e+r+w.slice(te);break;default:e=w+n+e+r}return a(e)}return C.toString=function(){return e+``},C}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(be(t)/3)))*3,r=10**-n,i=l((e=we(e),e.type=`f`,e),{suffix:Ne[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var Fe=/* @__PURE__ */ new Date,Ie=/* @__PURE__ */ new Date;function j(e,t,n,r){function i(t){return e(t=arguments.length===0?/* @__PURE__ */ new Date:/* @__PURE__ */ new Date(+t)),t}return i.floor=t=>(e(t=/* @__PURE__ */ new Date(+t)),t),i.ceil=n=>(e(n=/* @__PURE__ */ new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=/* @__PURE__ */ new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=/* @__PURE__ */ new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>j(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e){if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}}),n&&(i.count=(t,r)=>(Fe.setTime(+t),Ie.setTime(+r),e(Fe),e(Ie),Math.floor(n(Fe,Ie))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var Le=1e3,M=Le*60,Re=M*60,ze=Re*24,Be=ze*7,Ve=j(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Le)},(e,t)=>(t-e)/Le,e=>e.getUTCSeconds());Ve.range;var He=j(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Le)},(e,t)=>{e.setTime(+e+t*M)},(e,t)=>(t-e)/M,e=>e.getMinutes());He.range,j(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*M)},(e,t)=>(t-e)/M,e=>e.getUTCMinutes()).range;var Ue=j(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Le-e.getMinutes()*M)},(e,t)=>{e.setTime(+e+t*Re)},(e,t)=>(t-e)/Re,e=>e.getHours());Ue.range,j(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Re)},(e,t)=>(t-e)/Re,e=>e.getUTCHours()).range;var We=j(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*M)/ze,e=>e.getDate()-1);We.range;var Ge=j(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ze,e=>e.getUTCDate()-1);Ge.range,j(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ze,e=>Math.floor(e/ze)).range;function N(e){return j(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*M)/Be)}var Ke=N(0),qe=N(1),Je=N(2),Ye=N(3),Xe=N(4),Ze=N(5),Qe=N(6);Ke.range,qe.range,Je.range,Ye.range,Xe.range,Ze.range,Qe.range;function P(e){return j(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/Be)}var $e=P(0),et=P(1),tt=P(2),nt=P(3),rt=P(4),it=P(5),at=P(6);$e.range,et.range,tt.range,nt.range,rt.range,it.range,at.range;var ot=j(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());ot.range,j(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()).range;var F=j(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());F.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:j(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),F.range;var I=j(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());I.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:j(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),I.range;function st(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function ct(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function lt(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function ut(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=ht(i),u=gt(i),d=ht(a),f=gt(a),p=ht(o),m=gt(o),h=ht(s),g=gt(s),_=ht(c),v=gt(c),y={a:k,A,b:ie,B:ae,c:null,d:Lt,e:Lt,f:Ht,g:$t,G:tn,H:Rt,I:zt,j:Bt,L:Vt,m:Ut,M:Wt,p:oe,q:se,Q:Tn,s:En,S:Gt,u:Kt,U:qt,V:Yt,w:Xt,W:Zt,x:null,X:null,y:Qt,Y:en,Z:nn,"%":wn},b={a:ce,A:le,b:ue,B:de,c:null,d:rn,e:rn,f:ln,g:bn,G:Sn,H:an,I:on,j:sn,L:cn,m:un,M:dn,p:fe,q:pe,Q:Tn,s:En,S:fn,u:pn,U:mn,V:gn,w:_n,W:vn,x:null,X:null,y:yn,Y:xn,Z:Cn,"%":wn},x={a:w,A:T,b:E,B:D,c:O,d:Dt,e:Dt,f:Nt,g:Ct,G:St,H:kt,I:kt,j:Ot,L:Mt,m:Et,M:At,p:te,q:Tt,Q:Ft,s:It,S:jt,u:vt,U:yt,V:bt,w:_t,W:xt,x:ne,X:re,y:Ct,Y:St,Z:wt,"%":Pt};y.x=S(n,y),y.X=S(r,y),y.c=S(t,y),b.x=S(n,b),b.X=S(r,b),b.c=S(t,b);function S(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=/* @__PURE__ */ new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(c=dt[s=e.charAt(++i)])==null?c=s===`e`?` `:`0`:s=e.charAt(++i),(l=t[s])&&(s=l(n,c)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function ee(e,t){return function(n){var r=lt(1900,void 0,1),i=C(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=ct(lt(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?et.ceil(a):et(a),a=Ge.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=st(lt(r.y,0,1)),o=a.getDay(),a=o>4||o===0?qe.ceil(a):qe(a),a=We.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else(`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?ct(lt(r.y,0,1)).getUTCDay():st(lt(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,ct(r)):st(r)}}function C(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in dt?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function te(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function w(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function T(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,n,r){return C(e,t,n,r)}function ne(e,t,r){return C(e,n,t,r)}function re(e,t,n){return C(e,r,t,n)}function k(e){return o[e.getDay()]}function A(e){return a[e.getDay()]}function ie(e){return c[e.getMonth()]}function ae(e){return s[e.getMonth()]}function oe(e){return i[+(e.getHours()>=12)]}function se(e){return 1+~~(e.getMonth()/3)}function ce(e){return o[e.getUTCDay()]}function le(e){return a[e.getUTCDay()]}function ue(e){return c[e.getUTCMonth()]}function de(e){return s[e.getUTCMonth()]}function fe(e){return i[+(e.getUTCHours()>=12)]}function pe(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=ee(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=ee(e+=``,!0);return t.toString=function(){return e},t}}}var dt={"-":``,_:` `,0:`0`},L=/^\s*\d+/,ft=/^%/,pt=/[\\^$*+?|[\]().{}]/g;function R(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function mt(e){return e.replace(pt,`\\$&`)}function ht(e){return RegExp(`^(?:`+e.map(mt).join(`|`)+`)`,`i`)}function gt(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function _t(e,t,n){var r=L.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function vt(e,t,n){var r=L.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function yt(e,t,n){var r=L.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function bt(e,t,n){var r=L.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function xt(e,t,n){var r=L.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function St(e,t,n){var r=L.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Ct(e,t,n){var r=L.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function wt(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function Tt(e,t,n){var r=L.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Et(e,t,n){var r=L.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Dt(e,t,n){var r=L.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Ot(e,t,n){var r=L.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function kt(e,t,n){var r=L.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function At(e,t,n){var r=L.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function jt(e,t,n){var r=L.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Mt(e,t,n){var r=L.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Nt(e,t,n){var r=L.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Pt(e,t,n){var r=ft.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Ft(e,t,n){var r=L.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function It(e,t,n){var r=L.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Lt(e,t){return R(e.getDate(),t,2)}function Rt(e,t){return R(e.getHours(),t,2)}function zt(e,t){return R(e.getHours()%12||12,t,2)}function Bt(e,t){return R(1+We.count(F(e),e),t,3)}function Vt(e,t){return R(e.getMilliseconds(),t,3)}function Ht(e,t){return Vt(e,t)+`000`}function Ut(e,t){return R(e.getMonth()+1,t,2)}function Wt(e,t){return R(e.getMinutes(),t,2)}function Gt(e,t){return R(e.getSeconds(),t,2)}function Kt(e){var t=e.getDay();return t===0?7:t}function qt(e,t){return R(Ke.count(F(e)-1,e),t,2)}function Jt(e){var t=e.getDay();return t>=4||t===0?Xe(e):Xe.ceil(e)}function Yt(e,t){return e=Jt(e),R(Xe.count(F(e),e)+(F(e).getDay()===4),t,2)}function Xt(e){return e.getDay()}function Zt(e,t){return R(qe.count(F(e)-1,e),t,2)}function Qt(e,t){return R(e.getFullYear()%100,t,2)}function $t(e,t){return e=Jt(e),R(e.getFullYear()%100,t,2)}function en(e,t){return R(e.getFullYear()%1e4,t,4)}function tn(e,t){var n=e.getDay();return e=n>=4||n===0?Xe(e):Xe.ceil(e),R(e.getFullYear()%1e4,t,4)}function nn(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+R(t/60|0,`0`,2)+R(t%60,`0`,2)}function rn(e,t){return R(e.getUTCDate(),t,2)}function an(e,t){return R(e.getUTCHours(),t,2)}function on(e,t){return R(e.getUTCHours()%12||12,t,2)}function sn(e,t){return R(1+Ge.count(I(e),e),t,3)}function cn(e,t){return R(e.getUTCMilliseconds(),t,3)}function ln(e,t){return cn(e,t)+`000`}function un(e,t){return R(e.getUTCMonth()+1,t,2)}function dn(e,t){return R(e.getUTCMinutes(),t,2)}function fn(e,t){return R(e.getUTCSeconds(),t,2)}function pn(e){var t=e.getUTCDay();return t===0?7:t}function mn(e,t){return R($e.count(I(e)-1,e),t,2)}function hn(e){var t=e.getUTCDay();return t>=4||t===0?rt(e):rt.ceil(e)}function gn(e,t){return e=hn(e),R(rt.count(I(e),e)+(I(e).getUTCDay()===4),t,2)}function _n(e){return e.getUTCDay()}function vn(e,t){return R(et.count(I(e)-1,e),t,2)}function yn(e,t){return R(e.getUTCFullYear()%100,t,2)}function bn(e,t){return e=hn(e),R(e.getUTCFullYear()%100,t,2)}function xn(e,t){return R(e.getUTCFullYear()%1e4,t,4)}function Sn(e,t){var n=e.getUTCDay();return e=n>=4||n===0?rt(e):rt.ceil(e),R(e.getUTCFullYear()%1e4,t,4)}function Cn(){return`+0000`}function wn(){return`%`}function Tn(e){return+e}function En(e){return Math.floor(e/1e3)}var Dn,z;On({dateTime:`%x, %X`,date:`%-m/%-d/%Y`,time:`%-I:%M:%S %p`,periods:[`AM`,`PM`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`]});function On(e){return Dn=ut(e),z=Dn.format,Dn.parse,Dn.utcFormat,Dn.utcParse,Dn}var kn=[[1,4,12,52,365,8760,525600,31536e3,31536e6],[1/4,1,3,13,91,2184,131040,7862400,78624e5],[1/12,1/3,1,4,30,720,43200,2592e3,2592e6],[1/52,1/13,1/4,1,7,168,10080,604800,6048e5],[1/365,1/91,1/30,1/7,1,24,1440,86400,864e5],[1/8760,1/2184,1/720,1/168,1/24,1,60,3600,36e5],[1/525600,1/131040,1/43200,1/10080,1/1440,1/60,1,60,6e4],[1/31536e3,1/7862400,1/2592e3,1/604800,1/86400,1/3600,1/60,1,1e3],[1/31536e6,1/78624e5,1/2592e6,1/6048e5,1/864e5,1/36e5,1/6e4,1/1e3,1]];function An(e,t,n){if(_(e))return;if(!t||!n||t===n)return e;let r=kn[t-1][n-1];if(r)return e*r}function jn(e,t,n,r){if(_(e)||!t.lowestLevel||n.length===0)return``;let i=[],a=0,o=Math.round(e*kn[t.lowestLevel-1][8]);for(let[,t]of n.entries())if(e){o-=a;let e=kn[t-1][8],n=Math.floor(o/e);a=n*e,i.push({level:t,value:n})}else i.push({level:t,value:0});let s=``;for(let[e,n]of i.entries())if(t.duration.format===`time`){let t=n.value;[6,7,8].includes(n.level)&&n.value<10?t=`0`+n.value.toString():n.level===9&&n.value<10?t=`00`+n.value.toString():n.level===9&&n.value<100&&(t=`0`+n.value.toString()),s+=(e===0?``:n.level===9?`.`:`:`)+t}else if(t.duration.format===`long`){let t=r.durationLongSuffix;s+=n.value+` `+t[n.level]+(e===i.length-1?``:` `)}else{let t=r.durationShortSuffix;s+=n.value+``+t[n.level]+(e===i.length-1?``:` `)}return s}function Mn(e){let t=/(?:([^{])?([<>=^]))?([+\- ()])?([$#])?(0)?(\d+)?([,_])?(\.-?\d+)?([a-z%]{1,2})?/i.exec(e)??[];return{fill:t[1]||` `,align:t[2]||`>`,sign:t[3]||`-`,symbol:t[4]||``,zfill:t[5],width:+t[6],comma:t[7],precision:t[8],typeFormat:t[9]}}var Nn={decimal:`.`,thousands:`,`,grouping:[3],currency:[`$`,``],dateTime:`%a %b %e %X %Y`,date:`%m/%d/%Y`,dateSeparator:`/`,time:`%H:%M:%S`,periods:[`AM`,`PM`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],levels:[`All`,`Year`,`Quarter`,`Month`,`Week`,`Date`,`Hour`,`Minute`,`Second`,`Millisecond`],shortLevels:[`All`,`Yr`,`Qtr`,`Mth`,`Wk`,`Date`,`Hr`,`Min`,`Sec`,`Msec`],durationLongSuffix:[``,`years`,`quarters`,`months`,`weeks`,`days`,`hours`,`minutes`,`seconds`,`milliseconds`],durationShortSuffix:[``,`y`,`q`,`mo`,`w`,`d`,`h`,`m`,`s`,`ms`],multi:[`.%L`,`:%S`,`%I:%M`,`%I %p`,`%a %d`,`W%G`,`%b %d`,`%B`,`%Y`]},Pn=`%d-%m-%Y`,Fn=[{key:`%a %e %b %Y`,lev1:`%Y`,lev2:`Q%q-%Y`,lev3:`%b %Y`,lev4:`Wk %V-%G`,lev5:`%a %e %b %Y`,monthType:`name`,longText:!1,weekday:!0},{key:`%e %b %Y`,lev1:`%Y`,lev2:`Q%q-%Y`,lev3:`%b %Y`,lev4:`Wk %V-%G`,lev5:`%e %b %Y`,monthType:`name`,longText:!1,weekday:!1},{key:`%a %e %B %Y`,lev1:`%Y`,lev2:`Q%q-%Y`,lev3:`%B %Y`,lev4:`Week %V, %G`,lev5:`%a %e %B %Y`,monthType:`name`,longText:!0,weekday:!0},{key:`%e %B %Y`,lev1:`%Y`,lev2:`Q%q-%Y`,lev3:`%B %Y`,lev4:`Week %V, %G`,lev5:`%e %B %Y`,monthType:`name`,longText:!0,weekday:!1},{key:`%d/%m/%Y`,lev1:`%Y`,lev2:`Q%q/%Y`,lev3:`%m/%Y`,lev4:`W%V/%G`,lev5:`%d/%m/%Y`,monthType:`number`,mmdd:!1,separator:`/`},{key:`%d-%m-%Y`,lev1:`%Y`,lev2:`Q%q-%Y`,lev3:`%m-%Y`,lev4:`W%V-%G`,lev5:`%d-%m-%Y`,monthType:`number`,mmdd:!1,separator:`-`},{key:`%d.%m.%Y`,lev1:`%Y`,lev2:`Q%q.%Y`,lev3:`%m.%Y`,lev4:`W%V.%G`,lev5:`%d.%m.%Y`,monthType:`number`,mmdd:!1,separator:`.`},{key:`%d~%m~%Y`,lev1:`%Y`,lev2:`Q%q~%Y`,lev3:`%m~%Y`,lev4:`W%V~%G`,lev5:`%d~%m~%Y`,monthType:`number`,mmdd:!1,separator:`~`},{key:`%m/%d/%Y`,lev1:`%Y`,lev2:`Q%q/%Y`,lev3:`%m/%Y`,lev4:`%G/W%V`,lev5:`%m/%d/%Y`,monthType:`number`,mmdd:!0,separator:`/`},{key:`%m-%d-%Y`,lev1:`%Y`,lev2:`Q%q-%Y`,lev3:`%m-%Y`,lev4:`%G-W%V`,lev5:`%m-%d-%Y`,monthType:`number`,mmdd:!0,separator:`-`},{key:`%m.%d.%Y`,lev1:`%Y`,lev2:`Q%q.%Y`,lev3:`%m.%Y`,lev4:`%G.W%V`,lev5:`%m.%d.%Y`,monthType:`number`,mmdd:!0,separator:`.`},{key:`%m~%d~%Y`,lev1:`%Y`,lev2:`Q%q~%Y`,lev3:`%m~%Y`,lev4:`%G~W%V`,lev5:`%m~%d~%Y`,monthType:`number`,mmdd:!0,separator:`~`},{key:`%amd/%Y`,lev1:`%Y`,lev2:`Q%q/%Y`,lev3:`%m/%Y`,lev4:`%G/W%V`,lev5:`%amd/%Y`,monthType:`number`,mmdd:null,separator:`/`},{key:`%amd-%Y`,lev1:`%Y`,lev2:`Q%q-%Y`,lev3:`%m-%Y`,lev4:`%G-W%V`,lev5:`%amd-%Y`,monthType:`number`,mmdd:null,separator:`-`},{key:`%amd.%Y`,lev1:`%Y`,lev2:`Q%q.%Y`,lev3:`%m.%Y`,lev4:`%G.W%V`,lev5:`%amd.%Y`,monthType:`number`,mmdd:null,separator:`.`},{key:`%amd~%Y`,lev1:`%Y`,lev2:`Q%q~%Y`,lev3:`%m~%Y`,lev4:`%G~W%V`,lev5:`%amd~%Y`,monthType:`number`,mmdd:null,separator:`~`}],In=[{key:`%H:%M:%S.%L`,lev6:`%H:00`,lev7:`%H:%M`,lev8:`%H:%M:%S`,lev9:`%H:%M:%S.%L`,ampm:!1},{key:`%I:%M:%S.%L %p`,lev6:`%I:00 %p`,lev7:`%I:%M %p`,lev8:`%I:%M:%S %p`,lev9:`%I:%M:%S.%L %p`,ampm:!0}],Ln=(e,t,n)=>t===`letter`?e.shortNames?.length>0&&e.shortNames[n]?.length>0?e.shortNames[n]?.charAt(0):`N/A`:t===`short`?e.shortNames?.length>0&&e.shortNames[n]?e.shortNames[n]:`N/A`:e.longNames?.length>0&&e.longNames[n]?e.longNames[n]:`N/A`;function Rn(e,t){t||={};let n=t.localFormats||Nn,r,i,a,o=[],s=[],c=`datetime`,l;t&&t.multi&&(c=`datetime`),e&&e.format||(c=`hierarchy`),e&&e.type&&(c=e.type),l=e&&e.format?e.format:c===`numeric`?`,.0f`:c===`datetime`?Pn:``;let u=Mn(l);switch(u.precision&&u.typeFormat&&(c=`numeric`),c){case`numeric`:if(e.subtype===`duration`&&e.duration&&e.duration.levels&&e.duration.levels.length>1&&!t.hideDuration)r=t=>_(t)?``:jn(t,e,e.duration.levels,n);else{let a={...n},o=u.typeFormat,s=!1;switch(o.length===2&&o.startsWith(`a`)&&(s=!0,o=o.slice(1,2),l=l.replace(/a/,``)),s?(a.decimal=n.decimal,a.thousands=n.thousands):[`z`,`y`,`w`].includes(o)?(a.decimal=`,`,a.thousands=`.`):(a.decimal=`.`,a.thousands=`,`),o){case`z`:l=l.replace(`z`,`f`);break;case`y`:l=l.replace(`y`,`%`);break;case`w`:l=l.replace(`w`,`s`)}if(e?.subtype===`currency`&&e.currency){let t=a.currency.findIndex(e=>e.length>0),n=a.currency[t].startsWith(`\xA0`),r=a.currency[t].endsWith(`\xA0`),i=`${n?`\xA0`:``}${e.currency}${r?`\xA0`:``}`;a.currency[t]=i}let c=Pe(a);o!==`%`&&e?.subtype===`currency`&&e.currency&&a.currency&&!t?.hideCurrency&&![`count`,`distinctcount`].includes(e.aggregationFunc)&&(e.aggregationFunc!==`rate`||e.aggregationWeight?.columnSubType!==`currency`)&&e.periodOverPeriod?.type!==`percentageChange`&&(l=`$`+l),i=t?.trimZero&&[`y`,`%`].includes(o)&&a.decimal===`,`?e=>c.format(l)(e).replace(/(,\d*?)0+%$/,`$1%`).replace(/,%$/,`%`):t?.trimZero&&[`y`,`%`].includes(o)&&a.decimal===`.`?e=>c.format(l)(e).replace(/(\.\d*?)0+%$/,`$1%`).replace(/\.%$/,`%`):t?.trimZero&&[`z`,`f`].includes(o)&&a.decimal===`,`?e=>c.format(l)(e).replace(/(,\d*?)0+$/,`$1`).replace(/,$/,``):t?.trimZero&&[`z`,`f`].includes(o)&&a.decimal===`.`?e=>c.format(l)(e).replace(/(\.\d*?)0+$/,`$1`).replace(/\.$/,``):e?.subtype===`currency`&&e.currency&&a.currency&&o===`s`?e=>c.format(l)(e).replace(/G/,`B`):_(u.precision)?c.format(`,.0f`):c.format(l),r=r=>{if(_(r))return``;if(e.subtype===`duration`&&e.duration&&!t.hideDuration){let t=e.duration.levels?e.duration.levels[0]:e.lowestLevel;return t!==e.lowestLevel&&(r=An(r,e.lowestLevel,t)),i(r)+n?.durationShortSuffix?.[t]}return i(r)}}break;case`datetime`:if(o=n?.smartDateFormats??Fn,s=n?.smartTimeFormats??In,_(e.datetimeDisplayMode)||e.datetimeDisplayMode==="default"){if(t?.level){let e=t.level,r=o.find(e=>l.includes(e.key)),i=s.find(e=>l.includes(e.key)),a=r?r[`lev`+Math.min(e,5)]:o[0][`lev`+Math.min(e,5)],c=e>5?i?i[`lev`+e]:s[0][`lev`+e]:``;l=e>5?a+`, `+c:a;let u=l.includes(`%amd`)&&t.level>=5,d=r?t.level>=2&&r.separator===`~`:!1;l=u?d?l.replaceAll(/%amd[.~/-]%Y/g,n.date.slice(0,8)):l.replaceAll(/%amd[.~/-]%Y/g,n.date.slice(0,8).replaceAll(/[.~/-]/g,r.separator)):d?l.replaceAll(/[~]/g,n.dateSeparator):l}if(t?.multi){let e=z(n.multi[0]),t=z(n.multi[1]),r=z(n.multi[2]),i=z(n.multi[3]),o=z(n.multi[4]),s=z(n.multi[6]),c=z(n.multi[7]),l=z(n.multi[8]);a=n=>{let a;return a=Ve(n)<n?e:He(n)<n?t:Ue(n)<n?r:We(n)<n?i:ot(n)<n?Ke(n)<n?o:s:F(n)<n?c:l,a(n)}}else a=ut(n).format(l)}else{let t={quarter_number:{min:1,max:4},month_name:{min:1,max:12},month_number:{min:1,max:12},week_number:{min:1,max:53},day_in_month:{min:1,max:31},day_in_year:{min:1,max:366},weekday_name:{min:0,max:7},weekday_number:{min:0,max:7},hour_in_day:{min:0,max:23},minute_in_hour:{min:0,max:59},second_in_minute:{min:0,max:59}};a=[`quarter_number`,`month_number`,`week_number`,`day_in_month`,`day_in_year`,`weekday_number`,`hour_in_day`,`minute_in_hour`,`second_in_minute`].includes(e.datetimeDisplayMode)?n=>g(n)&&n>=t[e.datetimeDisplayMode].min&&n<=t[e.datetimeDisplayMode].max?n:`N/A`:e.datetimeDisplayMode===`month_name`?r=>{let i=[...n.shortMonths],a=[...n.months];return g(r)&&r>=t[e.datetimeDisplayMode].min&&r<=t[e.datetimeDisplayMode].max?Ln({shortNames:i,longNames:a},e.monthNameFormat,r-1):`N/A`}:e.datetimeDisplayMode===`weekday_name`?r=>{let i=[...n.shortDays],a=[...n.days];return e.weekStart===`monday`&&(i.push(i.shift()??``),a.push(a.shift()??``)),g(r)&&r>=t[e.datetimeDisplayMode].min&&r<=t[e.datetimeDisplayMode].max?Ln({shortNames:i,longNames:a},e.weekDayNameFormat,r-1):`N/A`}:ut(n).format(l)}r=e=>{if(_(e))return``;let t=a(e);return m(t)?t.trim():t};break;case`hierarchy`:r=e=>x(e,t?t.locale:void 0);break;default:r=e=>e}return r}var zn={HasDatetimeColumnAndNoComparisonFilters:`hasDatetimeColumnAndNoComparisonFilters`,NoDatetimeColumnAndNoComparisonFilters:`noDatetimeColumnAndNoComparisonFilters`,NoDatetimeColumnButComparisonFilters:`noDatetimeColumnButComparisonFilters`,HasDatetimeColumnAndComparisonFilters:`hasDatetimeColumnAndComparisonFilters`,OldImplementation:`oldImplementation`},Bn=/* @__PURE__ */ new Set([`x-axis`,`y-axis`,`category`,`name`,`row`,`levels`]),Vn=/* @__PURE__ */ new Set([`legend`,`color`,`column`]),Hn=/* @__PURE__ */ new Set([`measure`,`comparison-measure`]),Un={dimension:`mainGroupBy`,time:`mainGroupBy`,identifier:`mainGroupBy`,evolution:`mainGroupBy`,source:`mainGroupBy`,destination:`secondaryGroupBy`,open:`measure`,high:`measure`,low:`measure`,close:`measure`,target:`measure`,slidermetric:`measure`,geo:`other`,coordinates:`other`};function Wn(e){return e.type===`numeric`||e.type===`array[numeric]`?`numeric`:`dimension`}function Gn(e){return Un[e.slotName]||(Hn.has(e.slotName)?`measure`:Vn.has(e.slotName)?`secondaryGroupBy`:Bn.has(e.slotName)?`mainGroupBy`:e.slotType===`numeric`?`measure`:e.slotType===`categorical`?`mainGroupBy`:e.slotType===`mixed`?e.contentKind===`numeric`?`measure`:`mainGroupBy`:`other`)}function Kn(e){if(Array.isArray(e))return e}function qn(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Jn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Yn(e,t){if(e){if(typeof e==`string`)return Jn(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jn(e,t):void 0}}function Xn(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zn(e,t){return Kn(e)||qn(e,t)||Yn(e,t)||Xn()}var Qn=/* @__PURE__ */ ae((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.bind=void 0;function t(e,t){var n=t.type,r=t.listener,i=t.options;return e.addEventListener(n,r,i),function(){e.removeEventListener(n,r,i)}}e.bind=t})),$n=/* @__PURE__ */ ae(((e,t,n)=>{var r=n&&n.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=void 0;var i=Qn();function a(e){if(e!==void 0)return typeof e==`boolean`?{capture:e}:e}function o(e,t){return t==null?e:r(r({},e),{options:r(r({},a(t)),a(e.options))})}function s(e,t,n){var r=t.map(function(t){var r=o(t,n);return(0,i.bind)(e,r)});return function(){r.forEach(function(e){return e()})}}e.bindAll=s})),er=/* @__PURE__ */ ae((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=e.bind=void 0;var t=Qn();Object.defineProperty(e,"bind",{enumerable:!0,get:function(){return t.bind}});var n=$n();Object.defineProperty(e,"bindAll",{enumerable:!0,get:function(){return n.bindAll}})}));function tr(e){"@babel/helpers - typeof";return tr=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},tr(e)}function nr(e,t){if(tr(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(tr(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function rr(e){var t=nr(e,`string`);return tr(t)==`symbol`?t:t+``}function ir(e,t,n){return(t=rr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ar=er(),or=2147483647,sr=`data-pdnd-honey-pot`;function cr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?cr(Object(n),!0).forEach(function(t){ir(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ur=2,dr=ur/2;function fr(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function pr(e){return{x:e.x-dr,y:e.y-dr}}function mr(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function hr(e){return{x:Math.min(e.x,window.innerWidth-ur),y:Math.min(e.y,window.innerHeight-ur)}}function gr(e){var t=e.client,n=hr(mr(pr(fr(t))));return DOMRect.fromRect({x:n.x,y:n.y,width:ur,height:ur})}function _r(e){var t=e.clientRect;return{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`}}function vr(e){var t=e.client,n=e.clientRect;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function yr(e){var t=e.initial,n=document.createElement(`div`);n.setAttribute(sr,`true`);var r=gr({client:t});Object.assign(n.style,lr(lr({backgroundColor:`transparent`,position:`fixed`,padding:0,margin:0,boxSizing:`border-box`},_r({clientRect:r})),{},{pointerEvents:`auto`,zIndex:or})),document.body.appendChild(n);var i=(0,ar.bind)(window,{type:`pointermove`,listener:function(e){r=gr({client:{x:e.clientX,y:e.clientY}}),Object.assign(n.style,_r({clientRect:r}))},options:{capture:!0}});return function(e){var t=e.current;if(i(),vr({client:t,clientRect:r})){n.remove();return}function a(){o(),n.remove()}var o=(0,ar.bindAll)(window,[{type:`pointerdown`,listener:a},{type:`pointermove`,listener:a},{type:`focusin`,listener:a},{type:`focusout`,listener:a},{type:`dragstart`,listener:a},{type:`dragenter`,listener:a},{type:`dragover`,listener:a}],{capture:!0})}}function br(){var e=null;function t(){return e=null,(0,ar.bind)(window,{type:`pointermove`,listener:function(t){e={x:t.clientX,y:t.clientY}},options:{capture:!0}})}function n(){var t=null;return function(n){var r=n.eventName,i=n.payload;if(r===`onDragStart`){var a=i.location.initial.input;t=yr({initial:e??{x:a.clientX,y:a.clientY}})}if(r===`onDrop`){var o,s=i.location.current.input;(o=t)==null||o({current:{x:s.clientX,y:s.clientY}}),t=null,e=null}}}return{bindEvents:t,getOnPostDispatch:n}}function xr(e){if(Array.isArray(e))return Jn(e)}function Sr(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Cr(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wr(e){return xr(e)||Sr(e)||Yn(e)||Cr()}function Tr(e){return e instanceof Element&&e.hasAttribute(`data-pdnd-honey-pot`)}function Er(e){var t=Zn(document.elementsFromPoint(e.x,e.y),2),n=t[0],r=t[1];return n?Tr(n)?r??null:n:null}function Dr(e){var t=null;return function(){if(!t){var n=[...arguments];t={result:e.apply(this,n)}}return t.result}}var Or=Dr(function(){return navigator.userAgent.includes(`Firefox`)}),kr=Dr(function(){var e=navigator.userAgent;return e.includes(`AppleWebKit`)&&!e.includes(`Chrome`)}),Ar={isLeavingWindow:Symbol(`leaving`),isEnteringWindow:Symbol(`entering`)};function jr(e){var t=e.dragLeave;return kr()?t.hasOwnProperty(Ar.isLeavingWindow):!1}(function(){if(typeof window>`u`||!kr())return;function e(){return{enterCount:0,isOverWindow:!1}}var t=e();function n(){t=e()}(0,ar.bindAll)(window,[{type:`dragstart`,listener:function(){t.enterCount=0,t.isOverWindow=!0}},{type:`drop`,listener:n},{type:`dragend`,listener:n},{type:`dragenter`,listener:function(e){!t.isOverWindow&&t.enterCount===0&&(e[Ar.isEnteringWindow]=!0),t.isOverWindow=!0,t.enterCount++}},{type:`dragleave`,listener:function(e){t.enterCount--,t.isOverWindow&&t.enterCount===0&&(e[Ar.isLeavingWindow]=!0,t.isOverWindow=!1)}}],{capture:!0})})();function Mr(e){return`nodeName`in e}function Nr(e){return Mr(e)&&e.ownerDocument!==document}function Pr(e){var t=e.dragLeave,n=t.type,r=t.relatedTarget;return n===`dragleave`?kr()?jr({dragLeave:t}):r==null?!0:Or()?Nr(r):r instanceof HTMLIFrameElement:!1}function Fr(e){var t=e.onDragEnd;return[{type:`pointermove`,listener:function(){var e=0;return function(){e<20?e++:t()}}()},{type:`pointerdown`,listener:t}]}function Ir(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var Lr=function(e){var t=[],n=null,r=function(){t=[...arguments],!n&&(n=requestAnimationFrame(function(){n=null,e.apply(void 0,t)}))};return r.cancel=function(){n&&=(cancelAnimationFrame(n),null)},r}(function(e){return e()}),Rr=function(){var e=null;function t(t){e={frameId:requestAnimationFrame(function(){e=null,t()}),fn:t}}function n(){e&&=(cancelAnimationFrame(e.frameId),e.fn(),null)}return{schedule:t,flush:n}}();function zr(e){var t=e.source,n=e.initial,r=e.dispatchEvent,i={dropTargets:[]};function a(e){r(e),i={dropTargets:e.payload.location.current.dropTargets}}return{start:function(e){var r=e.nativeSetDragImage,o={current:n,previous:i,initial:n};a({eventName:`onGenerateDragPreview`,payload:{source:t,location:o,nativeSetDragImage:r}}),Rr.schedule(function(){a({eventName:`onDragStart`,payload:{source:t,location:o}})})},dragUpdate:function(e){var r=e.current;Rr.flush(),Lr.cancel(),a({eventName:`onDropTargetChange`,payload:{source:t,location:{initial:n,previous:i,current:r}}})},drag:function(e){var r=e.current;Lr(function(){Rr.flush(),a({eventName:`onDrag`,payload:{source:t,location:{initial:n,previous:i,current:r}}})})},drop:function(e){var r=e.current,o=e.updatedSourcePayload;Rr.flush(),Lr.cancel(),a({eventName:`onDrop`,payload:{source:o??t,location:{current:r,previous:i,initial:n}}})}}}var Br={isActive:!1};function Vr(){return!Br.isActive}function Hr(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function Ur(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var r=0;r<t.length;r++)if(t[r].element!==n[r].element)return!0;return!1}function Wr(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=e.dispatchEvent;if(!Vr())return;var a=Kr({event:t,dragType:n,getDropTargetsOver:r});Br.isActive=!0;var o={current:a};Gr({event:t,current:a.dropTargets});var s=zr({source:n.payload,dispatchEvent:i,initial:a});function c(e){var t=Ur({current:o.current.dropTargets,next:e.dropTargets});o.current=e,t&&s.dragUpdate({current:o.current})}function l(e){var t=Ir(e),i=r({target:Tr(e.target)?Er({x:t.clientX,y:t.clientY}):e.target,event:e,input:t,source:n.payload,current:o.current.dropTargets});i.length&&(e.cancelable&&e.preventDefault(),Gr({event:e,current:i})),c({dropTargets:i,input:t})}function u(){o.current.dropTargets.length&&c({dropTargets:[],input:o.current.input}),s.drop({current:o.current,updatedSourcePayload:null}),d()}function d(){Br.isActive=!1,f()}var f=(0,ar.bindAll)(window,[{type:`dragover`,listener:function(e){l(e),s.drag({current:o.current})}},{type:`dragenter`,listener:l},{type:`dragleave`,listener:function(e){Pr({dragLeave:e})&&(c({input:o.current.input,dropTargets:[]}),n.startedFrom===`external`&&u())}},{type:`drop`,listener:function(e){o.current={dropTargets:o.current.dropTargets,input:Ir(e)},o.current.dropTargets.length?(e.cancelable&&e.preventDefault(),Gr({event:e,current:o.current.dropTargets}),s.drop({current:o.current,updatedSourcePayload:n.type===`external`?n.getDropPayload(e):null}),d()):u()}},{type:`dragend`,listener:function(e){o.current={dropTargets:o.current.dropTargets,input:Ir(e)},u()}}].concat(wr(Fr({onDragEnd:u}))),{capture:!0});s.start({nativeSetDragImage:Hr(t)})}function Gr(e){var t=e.event,n=e.current[0]?.dropEffect;n!=null&&t.dataTransfer&&(t.dataTransfer.dropEffect=n)}function Kr(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=Ir(t);return n.startedFrom===`external`?{input:i,dropTargets:[]}:{input:i,dropTargets:r({input:i,source:n.payload,target:t.target,event:t,current:[]})}}var qr={canStart:Vr,start:Wr},Jr=/* @__PURE__ */ new Map;function Yr(e){var t=e.typeKey,n=e.mount,r=Jr.get(t);if(r)return r.usageCount++,r;var i={typeKey:t,unmount:n(),usageCount:1};return Jr.set(t,i),i}function Xr(e){var t=Yr(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),Jr.delete(e.typeKey))}}function Zr(){var e=[...arguments];return function(){e.forEach(function(e){return e()})}}function Qr(e,t){var n=t.attribute,r=t.value;return e.setAttribute(n,r),function(){return e.removeAttribute(n)}}function $r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?$r(Object(n),!0).forEach(function(t){ir(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ei(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=ti(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
5
5
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function ti(e,t){if(e){if(typeof e==`string`)return ni(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ni(e,t):void 0}}function ni(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ri(e){return e.slice(0).reverse()}function ii(e){var t=e.typeKey,n=e.defaultDropEffect,r=/* @__PURE__ */ new WeakMap,i=`data-drop-target-for-${t}`,a=`[${i}]`;function o(e){return r.set(e.element,e),function(){return r.delete(e.element)}}function s(e){return Zr(Qr(e.element,{attribute:i,value:`true`}),o(e))}function c(e){var t=e.source,i=e.target,o=e.input,s=e.event,l=e.result,u=l===void 0?[]:l;if(s===void 0)return u;let d=s.composedPath();if(i=d.find(e=>e instanceof Element&&e.hasAttribute(`data-drop-target-for-element`)),i??=d[0],!(i instanceof Element))return i instanceof Node?c({source:t,target:i.parentElement,input:o,result:u}):u;var f=i.closest(a);if(f==null)return u;var p=r.get(f);if(p==null)return u;var m={input:o,source:t,element:p.element};if(p.canDrop&&!p.canDrop(m))return c({source:t,target:p.element.parentElement,input:o,result:u});var h=p.getData?.call(p,m)??{},g=p.getDropEffect?.call(p,m)??n,_={data:h,element:p.element,dropEffect:g,isActiveDueToStickiness:!1};return c({source:t,target:p.element.parentElement,input:o,result:[].concat(wr(u),[_])})}function l(e){var t=e.eventName,n=e.payload,i=ei(n.location.current.dropTargets),a;try{for(i.s();!(a=i.n()).done;){var o,s=a.value,c=r.get(s.element),l=B(B({},n),{},{self:s});c==null||(o=c[t])==null||o.call(c,l)}}catch(e){i.e(e)}finally{i.f()}}var u={onGenerateDragPreview:l,onDrag:l,onDragStart:l,onDrop:l,onDropTargetChange:function(e){var t=e.payload,n=new Set(t.location.current.dropTargets.map(function(e){return e.element})),i=/* @__PURE__ */ new Set,a=ei(t.location.previous.dropTargets),o;try{for(a.s();!(o=a.n()).done;){var s,c=o.value;i.add(c.element);var l=r.get(c.element),u=n.has(c.element),d=B(B({},t),{},{self:c});if(l==null||(s=l.onDropTargetChange)==null||s.call(l,d),!u){var f;l==null||(f=l.onDragLeave)==null||f.call(l,d)}}}catch(e){a.e(e)}finally{a.f()}var p=ei(t.location.current.dropTargets),m;try{for(p.s();!(m=p.n()).done;){var h,g,_=m.value;if(!i.has(_.element)){var v=B(B({},t),{},{self:_}),y=r.get(_.element);y==null||(h=y.onDropTargetChange)==null||h.call(y,v),y==null||(g=y.onDragEnter)==null||g.call(y,v)}}}catch(e){p.e(e)}finally{p.f()}}};function d(e){u[e.eventName](e)}function f(e){var t=e.source,n=e.target,i=e.input,a=e.event,o=e.current,s=c({source:t,target:n,event:a,input:i});if(s.length>=o.length)return s;for(var l=ri(o),u=ri(s),d=[],f=0;f<l.length;f++){var p,m=l[f],h=u[f];if(h!=null)d.push(h);else{var g=d[f-1],_=l[f-1];if(g?.element!==_?.element)break;var v=r.get(m.element);if(!v)break;var y={input:i,source:t,element:v.element};if(v.canDrop&&!v.canDrop(y)||!((p=v.getIsSticky)!=null&&p.call(v,y)))break;d.push(B(B({},m),{},{isActiveDueToStickiness:!0}))}}return ri(d)}return{dropTargetForConsumers:s,getIsOver:f,dispatchEvent:d}}function ai(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=oi(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
6
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function oi(e,t){if(e){if(typeof e==`string`)return si(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?si(e,t):void 0}}function si(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ci(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function li(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ci(Object(n),!0).forEach(function(t){ir(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ci(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ui(){var e=/* @__PURE__ */ new Set,t=null;function n(e){t&&(!e.canMonitor||e.canMonitor(t.canMonitorArgs))&&t.active.add(e)}function r(r){var i=li({},r);return e.add(i),n(i),function(){e.delete(i),t&&t.active.delete(i)}}function i(r){var i=r.eventName,a=r.payload;if(i===`onGenerateDragPreview`){t={canMonitorArgs:{initial:a.location.initial,source:a.source},active:/* @__PURE__ */ new Set};var o=ai(e),s;try{for(o.s();!(s=o.n()).done;){var c=s.value;n(c)}}catch(e){o.e(e)}finally{o.f()}}if(t){for(var l=Array.from(t.active),u=0,d=l;u<d.length;u++){var f=d[u];if(t.active.has(f)){var p;(p=f[i])==null||p.call(f,a)}}i===`onDrop`&&(t.active.clear(),t=null)}}return{dispatchEvent:i,monitorForConsumers:r}}function di(e){var t=e.typeKey,n=e.mount,r=e.dispatchEventToSource,i=e.onPostDispatch,a=e.defaultDropEffect,o=ui(),s=ii({typeKey:t,defaultDropEffect:a});function c(e){r?.(e),s.dispatchEvent(e),o.dispatchEvent(e),i?.(e)}function l(e){var t=e.event,n=e.dragType;qr.start({event:t,dragType:n,getDropTargetsOver:s.getIsOver,dispatchEvent:c})}function u(){function e(){return n({canStart:qr.canStart,start:l})}return Xr({typeKey:t,mount:e})}return{registerUsage:u,dropTarget:s.dropTargetForConsumers,monitor:o.monitorForConsumers}}var fi=Dr(function(){return navigator.userAgent.toLocaleLowerCase().includes(`android`)}),pi=`pdnd:android-fallback`,mi=`text/plain`,hi=`application/vnd.pdnd`,gi=/* @__PURE__ */ new WeakMap;function _i(e){return gi.set(e.element,e),function(){gi.delete(e.element)}}var vi=br(),yi=di({typeKey:`element`,defaultDropEffect:`move`,mount:function(e){return Zr(vi.bindEvents(),(0,ar.bind)(document,{type:`dragstart`,listener:function(t){if(!e.canStart(t)||t.defaultPrevented||!t.dataTransfer)return;let n=t.composedPath().find(e=>e instanceof HTMLElement&&gi.has(e));if(!n)return null;let r=gi.get(n);if(!r)return null;var i=Ir(t),a={element:r.element,dragHandle:r.dragHandle??null,input:i};if(r.canDrag&&!r.canDrag(a))return t.preventDefault(),null;if(r.dragHandle){let e=(n.shadowRoot||document).elementFromPoint(i.clientX,i.clientY);if(!r.dragHandle.contains(e))return t.preventDefault(),null}var o=r.getInitialDataForExternal?.call(r,a)??null;if(o)for(var s=0,c=Object.entries(o);s<c.length;s++){var l=Zn(c[s],2),u=l[0],d=l[1];t.dataTransfer.setData(u,d??``)}fi()&&!t.dataTransfer.types.includes(`text/plain`)&&!t.dataTransfer.types.includes(`text/uri-list`)&&t.dataTransfer.setData(mi,pi),t.dataTransfer.setData(hi,``);var f={type:`element`,payload:{element:r.element,dragHandle:r.dragHandle??null,data:r.getInitialData?.call(r,a)??{}},startedFrom:`internal`};e.start({event:t,dragType:f})}}))},dispatchEventToSource:function(e){var t,n,r=e.eventName,i=e.payload;(t=gi.get(i.source.element))==null||(n=t[r])==null||n.call(t,i)},onPostDispatch:vi.getOnPostDispatch()}),bi=yi.dropTarget,xi=yi.monitor;function Si(e){return Zr(yi.registerUsage(),_i(e),Qr(e.element,{attribute:`draggable`,value:`true`}))}var Ci=/* @__PURE__ */ oe({draggable:()=>Si,dropTargetForElements:()=>bi,monitorForElements:()=>xi}),wi=Symbol.for(`@luzmo/analytics-components-kit/drag/element-adapter`),Ti=globalThis,Ei=Ti[wi];Ei===void 0&&(Ei=Ci,Ti[wi]=Ci);var{draggable:Di,dropTargetForElements:Oi,monitorForElements:ki}=Ei;function Ai(e,t,n){return{icon:l({type:e?.type??`hierarchy`,subtype:e?.subtype,lowestLevel:e?.lowestLevel},`s`),label:e?x(e.name,t):n}}var V=String.raw`[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}`,ji=RegExp(`##EMPTYARG-(${V})##|{(${V}:${V})}|##AGGR-(${V})##`,`gm`),Mi=RegExp(`##EMPTYARG-(${V})##|{(${V}:${V})}`,`gm`),Ni=/((GROUPFULL|GROUPINEX)\()?(AVG|COUNT|COUNTD|COUNTR|MAX|MIN|SUM)\(/m,Pi=RegExp(`##AGGR-(${V})##`,`m`),Fi=/\[(.*?)\]/gm,Ii=RegExp(`{(${V}:${V})}`,`gm`),Li=[`AVG`,`COUNT`,`COUNTD`,`COUNTR`,`MAX`,`MIN`,`SUM`];function Ri(){return{AVG:{arity:1,label:()=>e(`Average`,{desc:`Aggregation label`}),description:()=>e(`Calculates the average of the values.`,{desc:`Formula aggregation description for AVG`}),example:()=>`AVG(⟨numeric⟩ Order Value)`,exampleHasIcons:!0},COUNT:{arity:1,label:()=>e(`Count`,{desc:`Aggregation label`}),description:()=>e(`Counts the number of non-empty values.`,{desc:`Formula aggregation description for COUNT`}),example:()=>`COUNT(⟨numeric⟩ Order Number)`,exampleHasIcons:!0},COUNTD:{arity:1,label:()=>e(`Count distinct`,{desc:`Aggregation label`}),description:()=>e(`Counts the number of distinct values.`,{desc:`Formula aggregation description for COUNTD`}),example:()=>`COUNTD(⟨numeric⟩ Customer ID)`,exampleHasIcons:!0},COUNTR:{arity:0,label:()=>e(`Count rows`,{desc:`Aggregation label`}),description:()=>e(`Counts the number of rows.`,{desc:`Formula aggregation description for COUNTR`}),example:()=>`COUNTR()`},MAX:{arity:1,label:()=>e(`Maximum`,{desc:`Aggregation label`}),description:()=>e(`Returns the largest value.`,{desc:`Formula aggregation description for MAX`}),example:()=>`MAX(⟨numeric⟩ Order Value)`,exampleHasIcons:!0},MIN:{arity:1,label:()=>e(`Minimum`,{desc:`Aggregation label`}),description:()=>e(`Returns the smallest value.`,{desc:`Formula aggregation description for MIN`}),example:()=>`MIN(⟨numeric⟩ Order Value)`,exampleHasIcons:!0},SUM:{arity:1,label:()=>e(`Sum`,{desc:`Aggregation label`}),description:()=>e(`Adds up all the values.`,{desc:`Formula aggregation description for SUM`}),example:()=>`SUM(⟨numeric⟩ Quantity Sold)`,exampleHasIcons:!0}}}var H=/* @__PURE__ */ function(e){return e.GROUP=``,e.GROUPFULL=`GROUPFULL`,e.GROUPINEX=`GROUPINEX`,e}({}),zi=[H.GROUP,H.GROUPFULL,H.GROUPINEX];function Bi(){return{[H.GROUP]:{label:()=>e(`Grouped`,{desc:`Formula aggregation grouping label for grouped scope`}),description:()=>e(`Aggregates within the current grouping of the chart.`,{desc:`Formula aggregation grouping description for grouped scope`}),icon:le,color:`var(--luzmo-formula-grouping-color-grouped, #625df6)`},[H.GROUPFULL]:{label:()=>e(`Full`,{desc:`Formula aggregation grouping label for full scope`}),description:()=>e(`Aggregates across the entire dataset, ignoring the chart grouping.`,{desc:`Formula aggregation grouping description for full scope`}),icon:ue,color:`var(--luzmo-formula-grouping-color-full, #0ca789)`},[H.GROUPINEX]:{label:()=>e(`Include / exclude`,{desc:`Formula aggregation grouping label for include/exclude scope`}),description:()=>e(`Aggregates over a custom grouping built from included and excluded columns.`,{desc:`Formula aggregation grouping description for include/exclude scope`}),icon:de,color:`var(--luzmo-formula-grouping-color-include-exclude, #f00f65)`}}}var Vi=S(()=>import(`./formula-codemirror-BbyvNEVD.js`));async function Hi(){await Vi.load()}function Ui(){return Vi.isLoaded()}var Wi={Category:()=>e(`Category`,{desc:`Category slot label`}),Measure:()=>e(`Measure`,{desc:`Measure slot label`}),Measures:()=>e(`Measures`,{desc:`Measures slot label`}),Legend:()=>e(`Legend`,{desc:`Legend slot label`}),"Group by":()=>e(`Group by`,{desc:`Group by slot label`}),"Y-Axis":()=>e(`Y-Axis`,{desc:`Y-Axis slot label`}),"X-Axis":()=>e(`X-Axis`,{desc:`X-Axis slot label`}),Dimension:()=>e(`Dimension`,{desc:`Dimension slot label`}),Datetime:()=>e(`Datetime`,{desc:`Datetime slot label`}),"Slider metric":()=>e(`Slider metric`,{desc:`Slider metric slot label`}),Bins:()=>e(`Bins`,{desc:`Bins slot label`}),Circles:()=>e(`Circles`,{desc:`Circles slot label`}),Close:()=>e(`Close`,{desc:`Close slot label`}),Color:()=>e(`Color`,{desc:`Color slot label`}),Columns:()=>e(`Columns`,{desc:`Columns slot label`}),Coordinates:()=>e(`Coordinates`,{desc:`Coordinates slot label`}),Destination:()=>e(`Destination`,{desc:`Destination slot label`}),Evolution:()=>e(`Evolution`,{desc:`Evolution slot label`}),Geography:()=>e(`Geography`,{desc:`Geography slot label`}),High:()=>e(`High`,{desc:`High slot label`}),Identifier:()=>e(`Identifier`,{desc:`Identifier slot label`}),Levels:()=>e(`Levels`,{desc:`Levels slot label`}),Low:()=>e(`Low`,{desc:`Low slot label`}),Name:()=>e(`Name`,{id:`slot-label-name`,desc:`Name slot label`}),Open:()=>e(`Open`,{desc:`Open slot label`}),Order:()=>e(`Order`,{desc:`Order slot label`}),Route:()=>e(`Route`,{desc:`Route slot label`}),Rows:()=>e(`Rows`,{desc:`Rows slot label`}),Size:()=>e(`Size`,{desc:`Size slot label`}),Source:()=>e(`Source`,{desc:`Source slot label`}),Target:()=>e(`Target`,{desc:`Target slot label`}),Time:()=>e(`Time`,{id:`slot-label-time`,desc:`Time slot label`})},Gi=class extends Event{constructor(e,t,n,r){super(`context-request`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t,this.callback=n,this.subscribe=r??!1}};function Ki(e){return e}var qi=class{constructor(e,t,n,r){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(e,t)=>{this.unsubscribe&&(this.unsubscribe!==t&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=e,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(e,t)),this.unsubscribe=t},this.host=e,t.context!==void 0){let e=t;this.context=e.context,this.callback=e.callback,this.subscribe=e.subscribe??!1}else this.context=t,this.callback=n,this.subscribe=r??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&=(this.unsubscribe(),void 0)}dispatchRequest(){this.host.dispatchEvent(new Gi(this.context,this.host,this.t,this.subscribe))}},Ji=class{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,t=!1){let n=t||!Object.is(e,this.o);this.o=e,n&&this.updateObservers()}constructor(e){this.subscriptions=/* @__PURE__ */ new Map,this.updateObservers=()=>{for(let[e,{disposer:t}]of this.subscriptions)e(this.o,t)},e!==void 0&&(this.value=e)}addCallback(e,t,n){if(!n)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:t});let{disposer:r}=this.subscriptions.get(e);e(this.value,r)}clearCallbacks(){this.subscriptions.clear()}},Yi=class extends Event{constructor(e,t){super(`context-provider`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t}},Xi=class extends Ji{constructor(e,t,n){super(t.context===void 0?n:t.initialValue),this.onContextRequest=e=>{if(e.context!==this.context)return;let t=e.contextTarget??e.composedPath()[0];t!==this.host&&(e.stopPropagation(),this.addCallback(e.callback,t,e.subscribe))},this.onProviderRequest=e=>{if(e.context!==this.context||(e.contextTarget??e.composedPath()[0])===this.host)return;let t=/* @__PURE__ */ new Set;for(let[e,{consumerHost:n}]of this.subscriptions)t.has(e)||(t.add(e),n.dispatchEvent(new Gi(this.context,n,e,!0)));e.stopPropagation()},this.host=e,this.context=t.context===void 0?t:t.context,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener(`context-request`,this.onContextRequest),this.host.addEventListener(`context-provider`,this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new Yi(this.context,this.host))}};function Zi({context:e,subscribe:t}){return(n,r)=>{typeof r==`object`?r.addInitializer((function(){new qi(this,{context:e,callback:e=>{n.set.call(this,e)},subscribe:t})})):n.constructor.addInitializer((n=>{new qi(n,{context:e,callback:e=>{n[r]=e},subscribe:t})}))}}var Qi=[`datetime`,`hierarchy`,`numeric`,`spatial`,`array[datetime]`,`array[numeric]`,`array[hierarchy]`,`array[spatial]`],$i=Ki(Symbol(`slot-store-context`)),ea=Object.defineProperty,ta=(e,t,n)=>t in e?ea(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,na=(e,t,n)=>(ta(e,typeof t==`symbol`?t:t+``,n),n),ra=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},ia=(e,t)=>{if(Object(t)!==t)throw TypeError(`Cannot use the "in" operator on this value`);return e.has(t)},aa=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},oa=(e,t,n)=>(ra(e,t,`access private method`),n);function sa(e,t){return Object.is(e,t)}var U=null,ca=!1,la=1,ua=/* @__PURE__ */ Symbol(`SIGNAL`);function da(e){let t=U;return U=e,t}function fa(){return U}function pa(){return ca}var ma={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function ha(e){if(ca)throw Error(typeof ngDevMode<`u`&&ngDevMode?`Assertion error: signal read during notification phase`:``);if(U===null)return;U.consumerOnSignalRead(e);let t=U.nextProducerIndex++;if(Da(U),t<U.producerNode.length&&U.producerNode[t]!==e&&Ea(U)){let e=U.producerNode[t];Ta(e,U.producerIndexOfThis[t])}U.producerNode[t]!==e&&(U.producerNode[t]=e,U.producerIndexOfThis[t]=Ea(U)?wa(e,U,t):0),U.producerLastReadVersion[t]=e.version}function ga(){la++}function _a(e){(e.dirty||e.lastCleanEpoch!==la)&&(!e.producerMustRecompute(e)&&!Ca(e)?(e.dirty=!1,e.lastCleanEpoch=la):(e.producerRecomputeValue(e),e.dirty=!1,e.lastCleanEpoch=la))}function va(e){if(e.liveConsumerNode===void 0)return;let t=ca;ca=!0;try{for(let t of e.liveConsumerNode)t.dirty||ba(t)}finally{ca=t}}function ya(){return U?.consumerAllowSignalWrites!==!1}function ba(e){var t;e.dirty=!0,va(e),(t=e.consumerMarkedDirty)==null||t.call(e.wrapper??e)}function xa(e){return e&&(e.nextProducerIndex=0),da(e)}function Sa(e,t){if(da(t),e&&e.producerNode!==void 0&&e.producerIndexOfThis!==void 0&&e.producerLastReadVersion!==void 0){if(Ea(e))for(let t=e.nextProducerIndex;t<e.producerNode.length;t++)Ta(e.producerNode[t],e.producerIndexOfThis[t]);for(;e.producerNode.length>e.nextProducerIndex;)e.producerNode.pop(),e.producerLastReadVersion.pop(),e.producerIndexOfThis.pop()}}function Ca(e){Da(e);for(let t=0;t<e.producerNode.length;t++){let n=e.producerNode[t],r=e.producerLastReadVersion[t];if(r!==n.version||(_a(n),r!==n.version))return!0}return!1}function wa(e,t,n){var r;if(Oa(e),Da(e),e.liveConsumerNode.length===0){(r=e.watched)==null||r.call(e.wrapper);for(let t=0;t<e.producerNode.length;t++)e.producerIndexOfThis[t]=wa(e.producerNode[t],e,t)}return e.liveConsumerIndexOfThis.push(n),e.liveConsumerNode.push(t)-1}function Ta(e,t){var n;if(Oa(e),Da(e),typeof ngDevMode<`u`&&ngDevMode&&t>=e.liveConsumerNode.length)throw Error(`Assertion error: active consumer index ${t} is out of bounds of ${e.liveConsumerNode.length} consumers)`);if(e.liveConsumerNode.length===1){(n=e.unwatched)==null||n.call(e.wrapper);for(let t=0;t<e.producerNode.length;t++)Ta(e.producerNode[t],e.producerIndexOfThis[t])}let r=e.liveConsumerNode.length-1;if(e.liveConsumerNode[t]=e.liveConsumerNode[r],e.liveConsumerIndexOfThis[t]=e.liveConsumerIndexOfThis[r],e.liveConsumerNode.length--,e.liveConsumerIndexOfThis.length--,t<e.liveConsumerNode.length){let n=e.liveConsumerIndexOfThis[t],r=e.liveConsumerNode[t];Da(r),r.producerIndexOfThis[n]=t}}function Ea(e){return e.consumerIsAlwaysLive||(e?.liveConsumerNode?.length??0)>0}function Da(e){e.producerNode??=[],e.producerIndexOfThis??=[],e.producerLastReadVersion??=[]}function Oa(e){e.liveConsumerNode??=[],e.liveConsumerIndexOfThis??=[]}function ka(e){if(_a(e),ha(e),e.value===Na)throw e.error;return e.value}function Aa(e){let t=Object.create(Pa);t.computation=e;let n=()=>ka(t);return n[ua]=t,n}var ja=/* @__PURE__ */ Symbol(`UNSET`),Ma=/* @__PURE__ */ Symbol(`COMPUTING`),Na=/* @__PURE__ */ Symbol(`ERRORED`),Pa={...ma,value:ja,dirty:!0,error:null,equal:sa,producerMustRecompute(e){return e.value===ja||e.value===Ma},producerRecomputeValue(e){if(e.value===Ma)throw Error(`Detected cycle in computations.`);let t=e.value;e.value=Ma;let n=xa(e),r,i=!1;try{r=e.computation.call(e.wrapper),i=t!==ja&&t!==Na&&e.equal.call(e.wrapper,t,r)}catch(t){r=Na,e.error=t}finally{Sa(e,n)}i?e.value=t:(e.value=r,e.version++)}};function Fa(){throw Error()}var Ia=Fa;function La(){Ia()}function Ra(e){let t=Object.create(Va);t.value=e;let n=()=>(ha(t),t.value);return n[ua]=t,n}function za(){return ha(this),this.value}function Ba(e,t){ya()||La(),e.equal.call(e.wrapper,e.value,t)||(e.value=t,Ha(e))}var Va={...ma,equal:sa,value:void 0};function Ha(e){e.version++,ga(),va(e)}var W=Symbol(`node`),G;(e=>{var t,n,r,i;class a{constructor(r,i={}){aa(this,n),na(this,t);let a=Ra(r)[ua];if(this[W]=a,a.wrapper=this,i){let t=i.equals;t&&(a.equal=t),a.watched=i[e.subtle.watched],a.unwatched=i[e.subtle.unwatched]}}get(){if(!(0,e.isState)(this))throw TypeError(`Wrong receiver type for Signal.State.prototype.get`);return za.call(this[W])}set(t){if(!(0,e.isState)(this))throw TypeError(`Wrong receiver type for Signal.State.prototype.set`);if(pa())throw Error(`Writes to signals not permitted during Watcher callback`);let n=this[W];Ba(n,t)}}t=W,n=/* @__PURE__ */ new WeakSet,e.isState=e=>typeof e==`object`&&ia(n,e),e.State=a;class o{constructor(t,n){aa(this,i),na(this,r);let a=Aa(t)[ua];if(a.consumerAllowSignalWrites=!0,this[W]=a,a.wrapper=this,n){let t=n.equals;t&&(a.equal=t),a.watched=n[e.subtle.watched],a.unwatched=n[e.subtle.unwatched]}}get(){if(!(0,e.isComputed)(this))throw TypeError(`Wrong receiver type for Signal.Computed.prototype.get`);return ka(this[W])}}r=W,i=/* @__PURE__ */ new WeakSet,e.isComputed=e=>typeof e==`object`&&ia(i,e),e.Computed=o,(t=>{var n,r,i,a;function o(e){let t,n=null;try{n=da(null),t=e()}finally{da(n)}return t}t.untrack=o;function s(t){if(!(0,e.isComputed)(t)&&!(0,e.isWatcher)(t))throw TypeError(`Called introspectSources without a Computed or Watcher argument`);return t[W].producerNode?.map(e=>e.wrapper)??[]}t.introspectSources=s;function c(t){if(!(0,e.isComputed)(t)&&!(0,e.isState)(t))throw TypeError(`Called introspectSinks without a Signal argument`);return t[W].liveConsumerNode?.map(e=>e.wrapper)??[]}t.introspectSinks=c;function l(t){if(!(0,e.isComputed)(t)&&!(0,e.isState)(t))throw TypeError(`Called hasSinks without a Signal argument`);let n=t[W].liveConsumerNode;return n?n.length>0:!1}t.hasSinks=l;function u(t){if(!(0,e.isComputed)(t)&&!(0,e.isWatcher)(t))throw TypeError(`Called hasSources without a Computed or Watcher argument`);let n=t[W].producerNode;return n?n.length>0:!1}t.hasSources=u;class d{constructor(e){aa(this,r),aa(this,i),na(this,n);let t=Object.create(ma);t.wrapper=this,t.consumerMarkedDirty=e,t.consumerIsAlwaysLive=!0,t.consumerAllowSignalWrites=!1,t.producerNode=[],this[W]=t}watch(...t){if(!(0,e.isWatcher)(this))throw TypeError(`Called unwatch without Watcher receiver`);oa(this,i,a).call(this,t);let n=this[W];n.dirty=!1;let r=da(n);for(let e of t)ha(e[W]);da(r)}unwatch(...t){if(!(0,e.isWatcher)(this))throw TypeError(`Called unwatch without Watcher receiver`);oa(this,i,a).call(this,t);let n=this[W];Da(n);for(let e=n.producerNode.length-1;e>=0;e--)if(t.includes(n.producerNode[e].wrapper)){Ta(n.producerNode[e],n.producerIndexOfThis[e]);let t=n.producerNode.length-1;if(n.producerNode[e]=n.producerNode[t],n.producerIndexOfThis[e]=n.producerIndexOfThis[t],n.producerNode.length--,n.producerIndexOfThis.length--,n.nextProducerIndex--,e<n.producerNode.length){let t=n.producerIndexOfThis[e],r=n.producerNode[e];Oa(r),r.liveConsumerIndexOfThis[t]=e}}}getPending(){if(!(0,e.isWatcher)(this))throw TypeError(`Called getPending without Watcher receiver`);return this[W].producerNode.filter(e=>e.dirty).map(e=>e.wrapper)}}n=W,r=/* @__PURE__ */ new WeakSet,i=/* @__PURE__ */ new WeakSet,a=function(t){for(let n of t)if(!(0,e.isComputed)(n)&&!(0,e.isState)(n))throw TypeError(`Called watch/unwatch without a Computed or State argument`)},e.isWatcher=e=>ia(r,e),t.Watcher=d;function f(){return fa()?.wrapper}t.currentComputed=f,t.watched=Symbol(`watched`),t.unwatched=Symbol(`unwatched`)})(e.subtle||={})})(G||={});var Ua=Symbol(`SignalWatcherBrand`),Wa=new FinalizationRegistry((({watcher:e,signal:t})=>{e.unwatch(t)})),Ga=/* @__PURE__ */ new WeakMap;function Ka(e){return!0===e[Ua]?(console.warn(`SignalWatcher should not be applied to the same class more than once.`),e):class extends e{constructor(){super(...arguments),this._$St=new G.State(0),this._$Si=!1,this._$So=!0,this._$Sh=/* @__PURE__ */ new Set}_$Sl(){if(this._$Su!==void 0)return;this._$Sv=new G.Computed((()=>{this._$St.get(),super.performUpdate()}));let e=this._$Su=new G.subtle.Watcher((function(){let e=Ga.get(this);e!==void 0&&(!1===e._$Si&&e.requestUpdate(),this.watch())}));Ga.set(e,this),Wa.register(this,{watcher:e,signal:this._$Sv}),e.watch(this._$Sv)}_$Sp(){this._$Su!==void 0&&(this._$Su.unwatch(this._$Sv),this._$Sv=void 0,this._$Su=void 0)}performUpdate(){this.isUpdatePending&&(this._$Sl(),this._$Si=!0,this._$St.set(this._$St.get()+1),this._$Si=!1,this._$Sv.get())}update(e){try{this._$So?(this._$So=!1,super.update(e)):this._$Sh.forEach((e=>e.commit()))}finally{this.isUpdatePending=!1,this._$Sh.clear()}}requestUpdate(e,t,n){this._$So=!0,super.requestUpdate(e,t,n)}connectedCallback(){super.connectedCallback(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),queueMicrotask((()=>{!1===this.isConnected&&this._$Sp()}))}_(e){this._$Sh.add(e);let t=this._$So;this.requestUpdate(),this._$So=t}m(e){this._$Sh.delete(e)}}}ee(class extends w{_$Sl(){if(this._$Su!==void 0)return;this._$SW=new G.Computed((()=>this._$Sj?.get()));let e=this._$Su=new G.subtle.Watcher((()=>{var t;(t=this._$SO)==null||t._(this),e.watch()}));e.watch(this._$SW)}_$Sp(){var e;this._$Su!==void 0&&(this._$Su.unwatch(this._$SW),this._$SW=void 0,this._$Su=void 0,(e=this._$SO)==null||e.m(this))}commit(){this.setValue(G.subtle.untrack((()=>this._$SW?.get())))}render(e){return G.subtle.untrack((()=>e.get()))}update(e,[t]){return this._$SO??=e.options?.host,t!==this._$Sj&&this._$Sj!==void 0&&this._$Sp(),this._$Sj=t,this._$Sl(),G.subtle.untrack((()=>this._$SW.get()))}disconnected(){this._$Sp()}reconnected(){this._$Sl()}}),G.State,G.Computed;var K=(e,t)=>new G.State(e,t),qa=(e,t)=>new G.Computed(e,t),Ja=class{constructor(){this.slotContents=K([]),this.slotsContents=K([]),this.periodOverPeriodUiType=K(null),this.periodOverPeriodAllowsPeriodsWithoutDatetimeColumn=K(!1),this.periodOverPeriodHidesPastValue=K(!1),this.linkedDataset=K([]),this._popEnabledChartTypes=[`area-chart`,`bar-chart`,`combination-chart`,`column-chart`,`line-chart`],this._popPeriodsWithoutDatetimeColumnItemTypes=[`kpi`],this._popWithoutPastValueItemTypes=[`kpi`],this.activeSlotContents=qa(()=>this.slotContents.get()[this.activeIndex.get()]),this.activeIndex=K(0)}isArrayColumnType(e){return e.startsWith(`array[`)}setPeriodOverPeriodCondition(e,t){this.periodOverPeriodAllowsPeriodsWithoutDatetimeColumn.set(this._popPeriodsWithoutDatetimeColumnItemTypes.includes(e)),this.periodOverPeriodHidesPastValue.set(this._popWithoutPastValueItemTypes.includes(e)),t?.periodOverPeriod?.newUi?this.periodOverPeriodUiType.set(this.getUiConditionToApply(t)):this.periodOverPeriodUiType.set(this.oldConditionalLogic(e))}getUiConditionToApply(e){let t=this.hasDatetimeColumnOnCategoryOrXAxis(),n=e?.periodOverPeriod?.hasConnectedComparisonFilter,r=this.linkedDataset.get().some(({columns:e})=>e?.some(e=>e.type===`datetime`));return!t&&!n&&!r?null:t&&n?zn.HasDatetimeColumnAndComparisonFilters:t&&!n?zn.HasDatetimeColumnAndNoComparisonFilters:!t&&n?zn.NoDatetimeColumnButComparisonFilters:zn.NoDatetimeColumnAndNoComparisonFilters}oldConditionalLogic(e){let t=this.slotsContents.get()??[],n=(t.find(e=>[`y-axis`,`x-axis`,`row`].includes(e.name))?.content??[])?.[0]??null,r=t.find(e=>e.name===`measure`)?.content??[];return n&&this._popEnabledChartTypes.includes(e)&&n.type===`datetime`&&!this.isArrayColumnType(n.type)&&(!n.datetimeDisplayMode||n.datetimeDisplayMode==="default")&&n.level!==4&&r.length>0?zn.OldImplementation:null}hasDatetimeColumnOnCategoryOrXAxis(){let e=((this.slotsContents.get()??[]).find(e=>[`y-axis`,`x-axis`].includes(e.name))?.content??[])?.[0]??null;return!(!e||e.type!==`datetime`||this.isArrayColumnType(e.type))}setContents(e,t){if(this.slotContents.set(e),this.activeIndex.get()>=e.length&&this.activeIndex.set(e.length>0?e.length-1:0),t){let n=structuredClone(this.slotsContents.get())??[],r=n.find(e=>e.name===t);r&&(r.content=e),this.setFullContents(n)}}setFullContents(e){this.slotsContents.set(e)}updateActive(e){e>=0&&e<this.slotContents.get().length&&this.activeIndex.set(e)}updateContent(e,t=this.activeIndex.get()){if(t<0||t>=this.slotContents.get().length)return;let n=[...this.slotContents.get()];n[t]=structuredClone(e),this.slotContents.set(n)}removeContent(e){if(e<0||e>=this.slotContents.get().length)return;let t=this.slotContents.get().filter((t,n)=>n!==e);this.slotContents.set(t),this.activeIndex.get()>=t.length&&this.activeIndex.set(t.length>0?t.length-1:0)}},Ya=e=>typeof e==`string`&&e.trim().length>0,Xa=e=>!(!e||!Ya(e.formula)||e.formulaId||v(e.formula)),Za=e=>!(!e||!Ya(e.expression)||e.columnId||e.column||e.formulaId||e.formula),Qa=e=>Za(e)?e?.expression:Xa(e)?e?.formula:void 0,$a=e=>e?.columnId??e?.formulaId??e?.column??e?.formula??e?.expression,q=(e,t)=>Za(e)?!0:!e||!Xa(e)?!1:Gn({slotName:String(t.name??``),slotType:t.type,contentKind:Wn(e)})===`measure`,eo=t=>{let n=Xa(t);return E`<span class="calculation-label">
|
|
6
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function oi(e,t){if(e){if(typeof e==`string`)return si(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?si(e,t):void 0}}function si(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ci(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function li(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ci(Object(n),!0).forEach(function(t){ir(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ci(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ui(){var e=/* @__PURE__ */ new Set,t=null;function n(e){t&&(!e.canMonitor||e.canMonitor(t.canMonitorArgs))&&t.active.add(e)}function r(r){var i=li({},r);return e.add(i),n(i),function(){e.delete(i),t&&t.active.delete(i)}}function i(r){var i=r.eventName,a=r.payload;if(i===`onGenerateDragPreview`){t={canMonitorArgs:{initial:a.location.initial,source:a.source},active:/* @__PURE__ */ new Set};var o=ai(e),s;try{for(o.s();!(s=o.n()).done;){var c=s.value;n(c)}}catch(e){o.e(e)}finally{o.f()}}if(t){for(var l=Array.from(t.active),u=0,d=l;u<d.length;u++){var f=d[u];if(t.active.has(f)){var p;(p=f[i])==null||p.call(f,a)}}i===`onDrop`&&(t.active.clear(),t=null)}}return{dispatchEvent:i,monitorForConsumers:r}}function di(e){var t=e.typeKey,n=e.mount,r=e.dispatchEventToSource,i=e.onPostDispatch,a=e.defaultDropEffect,o=ui(),s=ii({typeKey:t,defaultDropEffect:a});function c(e){r?.(e),s.dispatchEvent(e),o.dispatchEvent(e),i?.(e)}function l(e){var t=e.event,n=e.dragType;qr.start({event:t,dragType:n,getDropTargetsOver:s.getIsOver,dispatchEvent:c})}function u(){function e(){return n({canStart:qr.canStart,start:l})}return Xr({typeKey:t,mount:e})}return{registerUsage:u,dropTarget:s.dropTargetForConsumers,monitor:o.monitorForConsumers}}var fi=Dr(function(){return navigator.userAgent.toLocaleLowerCase().includes(`android`)}),pi=`pdnd:android-fallback`,mi=`text/plain`,hi=`application/vnd.pdnd`,gi=/* @__PURE__ */ new WeakMap;function _i(e){return gi.set(e.element,e),function(){gi.delete(e.element)}}var vi=br(),yi=di({typeKey:`element`,defaultDropEffect:`move`,mount:function(e){return Zr(vi.bindEvents(),(0,ar.bind)(document,{type:`dragstart`,listener:function(t){if(!e.canStart(t)||t.defaultPrevented||!t.dataTransfer)return;let n=t.composedPath().find(e=>e instanceof HTMLElement&&gi.has(e));if(!n)return null;let r=gi.get(n);if(!r)return null;var i=Ir(t),a={element:r.element,dragHandle:r.dragHandle??null,input:i};if(r.canDrag&&!r.canDrag(a))return t.preventDefault(),null;if(r.dragHandle){let e=(n.shadowRoot||document).elementFromPoint(i.clientX,i.clientY);if(!r.dragHandle.contains(e))return t.preventDefault(),null}var o=r.getInitialDataForExternal?.call(r,a)??null;if(o)for(var s=0,c=Object.entries(o);s<c.length;s++){var l=Zn(c[s],2),u=l[0],d=l[1];t.dataTransfer.setData(u,d??``)}fi()&&!t.dataTransfer.types.includes(`text/plain`)&&!t.dataTransfer.types.includes(`text/uri-list`)&&t.dataTransfer.setData(mi,pi),t.dataTransfer.setData(hi,``);var f={type:`element`,payload:{element:r.element,dragHandle:r.dragHandle??null,data:r.getInitialData?.call(r,a)??{}},startedFrom:`internal`};e.start({event:t,dragType:f})}}))},dispatchEventToSource:function(e){var t,n,r=e.eventName,i=e.payload;(t=gi.get(i.source.element))==null||(n=t[r])==null||n.call(t,i)},onPostDispatch:vi.getOnPostDispatch()}),bi=yi.dropTarget,xi=yi.monitor;function Si(e){return Zr(yi.registerUsage(),_i(e),Qr(e.element,{attribute:`draggable`,value:`true`}))}var Ci=/* @__PURE__ */ oe({draggable:()=>Si,dropTargetForElements:()=>bi,monitorForElements:()=>xi}),wi=Symbol.for(`@luzmo/analytics-components-kit/drag/element-adapter`),Ti=globalThis,Ei=Ti[wi];Ei===void 0&&(Ei=Ci,Ti[wi]=Ci);var{draggable:Di,dropTargetForElements:Oi,monitorForElements:ki}=Ei;function Ai(e,t,n){return{icon:l({type:e?.type??`hierarchy`,subtype:e?.subtype,lowestLevel:e?.lowestLevel},`s`),label:e?x(e.name,t):n}}var V=String.raw`[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}`,ji=RegExp(`##EMPTYARG-(${V})##|{(${V}:${V})}|##AGGR-(${V})##`,`gm`),Mi=RegExp(`##EMPTYARG-(${V})##|{(${V}:${V})}`,`gm`),Ni=/((GROUPFULL|GROUPINEX)\()?(AVG|COUNT|COUNTD|COUNTR|MAX|MIN|SUM)\(/m,Pi=RegExp(`##AGGR-(${V})##`,`m`),Fi=/\[(.*?)\]/gm,Ii=RegExp(`{(${V}:${V})}`,`gm`),Li=[`AVG`,`COUNT`,`COUNTD`,`COUNTR`,`MAX`,`MIN`,`SUM`];function Ri(){return{AVG:{arity:1,label:()=>t(`Average`,{desc:`Aggregation label`}),description:()=>t(`Calculates the average of the values.`,{desc:`Formula aggregation description for AVG`}),example:()=>`AVG(⟨numeric⟩ Order Value)`,exampleHasIcons:!0},COUNT:{arity:1,label:()=>t(`Count`,{desc:`Aggregation label`}),description:()=>t(`Counts the number of non-empty values.`,{desc:`Formula aggregation description for COUNT`}),example:()=>`COUNT(⟨numeric⟩ Order Number)`,exampleHasIcons:!0},COUNTD:{arity:1,label:()=>t(`Count distinct`,{desc:`Aggregation label`}),description:()=>t(`Counts the number of distinct values.`,{desc:`Formula aggregation description for COUNTD`}),example:()=>`COUNTD(⟨numeric⟩ Customer ID)`,exampleHasIcons:!0},COUNTR:{arity:0,label:()=>t(`Count rows`,{desc:`Aggregation label`}),description:()=>t(`Counts the number of rows.`,{desc:`Formula aggregation description for COUNTR`}),example:()=>`COUNTR()`},MAX:{arity:1,label:()=>t(`Maximum`,{desc:`Aggregation label`}),description:()=>t(`Returns the largest value.`,{desc:`Formula aggregation description for MAX`}),example:()=>`MAX(⟨numeric⟩ Order Value)`,exampleHasIcons:!0},MIN:{arity:1,label:()=>t(`Minimum`,{desc:`Aggregation label`}),description:()=>t(`Returns the smallest value.`,{desc:`Formula aggregation description for MIN`}),example:()=>`MIN(⟨numeric⟩ Order Value)`,exampleHasIcons:!0},SUM:{arity:1,label:()=>t(`Sum`,{desc:`Aggregation label`}),description:()=>t(`Adds up all the values.`,{desc:`Formula aggregation description for SUM`}),example:()=>`SUM(⟨numeric⟩ Quantity Sold)`,exampleHasIcons:!0}}}var H=/* @__PURE__ */ function(e){return e.GROUP=``,e.GROUPFULL=`GROUPFULL`,e.GROUPINEX=`GROUPINEX`,e}({}),zi=[H.GROUP,H.GROUPFULL,H.GROUPINEX];function Bi(){return{[H.GROUP]:{label:()=>t(`Grouped`,{desc:`Formula aggregation grouping label for grouped scope`}),description:()=>t(`Aggregates within the current grouping of the chart.`,{desc:`Formula aggregation grouping description for grouped scope`}),icon:le,color:`var(--luzmo-formula-grouping-color-grouped, #625df6)`},[H.GROUPFULL]:{label:()=>t(`Full`,{desc:`Formula aggregation grouping label for full scope`}),description:()=>t(`Aggregates across the entire dataset, ignoring the chart grouping.`,{desc:`Formula aggregation grouping description for full scope`}),icon:ue,color:`var(--luzmo-formula-grouping-color-full, #0ca789)`},[H.GROUPINEX]:{label:()=>t(`Include / exclude`,{desc:`Formula aggregation grouping label for include/exclude scope`}),description:()=>t(`Aggregates over a custom grouping built from included and excluded columns.`,{desc:`Formula aggregation grouping description for include/exclude scope`}),icon:de,color:`var(--luzmo-formula-grouping-color-include-exclude, #f00f65)`}}}var Vi=S(()=>import(`./formula-codemirror-DZMzLE2I.js`));async function Hi(){await Vi.load()}function Ui(){return Vi.isLoaded()}var Wi={Category:()=>t(`Category`,{desc:`Category slot label`}),Measure:()=>t(`Measure`,{desc:`Measure slot label`}),Measures:()=>t(`Measures`,{desc:`Measures slot label`}),Legend:()=>t(`Legend`,{desc:`Legend slot label`}),"Group by":()=>t(`Group by`,{desc:`Group by slot label`}),"Y-Axis":()=>t(`Y-Axis`,{desc:`Y-Axis slot label`}),"X-Axis":()=>t(`X-Axis`,{desc:`X-Axis slot label`}),Dimension:()=>t(`Dimension`,{desc:`Dimension slot label`}),Datetime:()=>t(`Datetime`,{desc:`Datetime slot label`}),"Slider metric":()=>t(`Slider metric`,{desc:`Slider metric slot label`}),Bins:()=>t(`Bins`,{desc:`Bins slot label`}),Circles:()=>t(`Circles`,{desc:`Circles slot label`}),Close:()=>t(`Close`,{desc:`Close slot label`}),Color:()=>t(`Color`,{desc:`Color slot label`}),Columns:()=>t(`Columns`,{desc:`Columns slot label`}),Coordinates:()=>t(`Coordinates`,{desc:`Coordinates slot label`}),Destination:()=>t(`Destination`,{desc:`Destination slot label`}),Evolution:()=>t(`Evolution`,{desc:`Evolution slot label`}),Geography:()=>t(`Geography`,{desc:`Geography slot label`}),High:()=>t(`High`,{desc:`High slot label`}),Identifier:()=>t(`Identifier`,{desc:`Identifier slot label`}),Levels:()=>t(`Levels`,{desc:`Levels slot label`}),Low:()=>t(`Low`,{desc:`Low slot label`}),Name:()=>t(`Name`,{id:`slot-label-name`,desc:`Name slot label`}),Open:()=>t(`Open`,{desc:`Open slot label`}),Order:()=>t(`Order`,{desc:`Order slot label`}),Route:()=>t(`Route`,{desc:`Route slot label`}),Rows:()=>t(`Rows`,{desc:`Rows slot label`}),Size:()=>t(`Size`,{desc:`Size slot label`}),Source:()=>t(`Source`,{desc:`Source slot label`}),Target:()=>t(`Target`,{desc:`Target slot label`}),Time:()=>t(`Time`,{id:`slot-label-time`,desc:`Time slot label`})},Gi=class extends Event{constructor(e,t,n,r){super(`context-request`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t,this.callback=n,this.subscribe=r??!1}};function Ki(e){return e}var qi=class{constructor(e,t,n,r){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(e,t)=>{this.unsubscribe&&(this.unsubscribe!==t&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=e,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(e,t)),this.unsubscribe=t},this.host=e,t.context!==void 0){let e=t;this.context=e.context,this.callback=e.callback,this.subscribe=e.subscribe??!1}else this.context=t,this.callback=n,this.subscribe=r??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&=(this.unsubscribe(),void 0)}dispatchRequest(){this.host.dispatchEvent(new Gi(this.context,this.host,this.t,this.subscribe))}},Ji=class{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,t=!1){let n=t||!Object.is(e,this.o);this.o=e,n&&this.updateObservers()}constructor(e){this.subscriptions=/* @__PURE__ */ new Map,this.updateObservers=()=>{for(let[e,{disposer:t}]of this.subscriptions)e(this.o,t)},e!==void 0&&(this.value=e)}addCallback(e,t,n){if(!n)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:t});let{disposer:r}=this.subscriptions.get(e);e(this.value,r)}clearCallbacks(){this.subscriptions.clear()}},Yi=class extends Event{constructor(e,t){super(`context-provider`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t}},Xi=class extends Ji{constructor(e,t,n){super(t.context===void 0?n:t.initialValue),this.onContextRequest=e=>{if(e.context!==this.context)return;let t=e.contextTarget??e.composedPath()[0];t!==this.host&&(e.stopPropagation(),this.addCallback(e.callback,t,e.subscribe))},this.onProviderRequest=e=>{if(e.context!==this.context||(e.contextTarget??e.composedPath()[0])===this.host)return;let t=/* @__PURE__ */ new Set;for(let[e,{consumerHost:n}]of this.subscriptions)t.has(e)||(t.add(e),n.dispatchEvent(new Gi(this.context,n,e,!0)));e.stopPropagation()},this.host=e,this.context=t.context===void 0?t:t.context,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener(`context-request`,this.onContextRequest),this.host.addEventListener(`context-provider`,this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new Yi(this.context,this.host))}};function Zi({context:e,subscribe:t}){return(n,r)=>{typeof r==`object`?r.addInitializer((function(){new qi(this,{context:e,callback:e=>{n.set.call(this,e)},subscribe:t})})):n.constructor.addInitializer((n=>{new qi(n,{context:e,callback:e=>{n[r]=e},subscribe:t})}))}}var Qi=[`datetime`,`hierarchy`,`numeric`,`spatial`,`array[datetime]`,`array[numeric]`,`array[hierarchy]`,`array[spatial]`],$i=Ki(Symbol(`slot-store-context`)),ea=Object.defineProperty,ta=(e,t,n)=>t in e?ea(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,na=(e,t,n)=>(ta(e,typeof t==`symbol`?t:t+``,n),n),ra=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},ia=(e,t)=>{if(Object(t)!==t)throw TypeError(`Cannot use the "in" operator on this value`);return e.has(t)},aa=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},oa=(e,t,n)=>(ra(e,t,`access private method`),n);function sa(e,t){return Object.is(e,t)}var U=null,ca=!1,la=1,ua=/* @__PURE__ */ Symbol(`SIGNAL`);function da(e){let t=U;return U=e,t}function fa(){return U}function pa(){return ca}var ma={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function ha(e){if(ca)throw Error(typeof ngDevMode<`u`&&ngDevMode?`Assertion error: signal read during notification phase`:``);if(U===null)return;U.consumerOnSignalRead(e);let t=U.nextProducerIndex++;if(Da(U),t<U.producerNode.length&&U.producerNode[t]!==e&&Ea(U)){let e=U.producerNode[t];Ta(e,U.producerIndexOfThis[t])}U.producerNode[t]!==e&&(U.producerNode[t]=e,U.producerIndexOfThis[t]=Ea(U)?wa(e,U,t):0),U.producerLastReadVersion[t]=e.version}function ga(){la++}function _a(e){(e.dirty||e.lastCleanEpoch!==la)&&(!e.producerMustRecompute(e)&&!Ca(e)?(e.dirty=!1,e.lastCleanEpoch=la):(e.producerRecomputeValue(e),e.dirty=!1,e.lastCleanEpoch=la))}function va(e){if(e.liveConsumerNode===void 0)return;let t=ca;ca=!0;try{for(let t of e.liveConsumerNode)t.dirty||ba(t)}finally{ca=t}}function ya(){return U?.consumerAllowSignalWrites!==!1}function ba(e){var t;e.dirty=!0,va(e),(t=e.consumerMarkedDirty)==null||t.call(e.wrapper??e)}function xa(e){return e&&(e.nextProducerIndex=0),da(e)}function Sa(e,t){if(da(t),e&&e.producerNode!==void 0&&e.producerIndexOfThis!==void 0&&e.producerLastReadVersion!==void 0){if(Ea(e))for(let t=e.nextProducerIndex;t<e.producerNode.length;t++)Ta(e.producerNode[t],e.producerIndexOfThis[t]);for(;e.producerNode.length>e.nextProducerIndex;)e.producerNode.pop(),e.producerLastReadVersion.pop(),e.producerIndexOfThis.pop()}}function Ca(e){Da(e);for(let t=0;t<e.producerNode.length;t++){let n=e.producerNode[t],r=e.producerLastReadVersion[t];if(r!==n.version||(_a(n),r!==n.version))return!0}return!1}function wa(e,t,n){var r;if(Oa(e),Da(e),e.liveConsumerNode.length===0){(r=e.watched)==null||r.call(e.wrapper);for(let t=0;t<e.producerNode.length;t++)e.producerIndexOfThis[t]=wa(e.producerNode[t],e,t)}return e.liveConsumerIndexOfThis.push(n),e.liveConsumerNode.push(t)-1}function Ta(e,t){var n;if(Oa(e),Da(e),typeof ngDevMode<`u`&&ngDevMode&&t>=e.liveConsumerNode.length)throw Error(`Assertion error: active consumer index ${t} is out of bounds of ${e.liveConsumerNode.length} consumers)`);if(e.liveConsumerNode.length===1){(n=e.unwatched)==null||n.call(e.wrapper);for(let t=0;t<e.producerNode.length;t++)Ta(e.producerNode[t],e.producerIndexOfThis[t])}let r=e.liveConsumerNode.length-1;if(e.liveConsumerNode[t]=e.liveConsumerNode[r],e.liveConsumerIndexOfThis[t]=e.liveConsumerIndexOfThis[r],e.liveConsumerNode.length--,e.liveConsumerIndexOfThis.length--,t<e.liveConsumerNode.length){let n=e.liveConsumerIndexOfThis[t],r=e.liveConsumerNode[t];Da(r),r.producerIndexOfThis[n]=t}}function Ea(e){return e.consumerIsAlwaysLive||(e?.liveConsumerNode?.length??0)>0}function Da(e){e.producerNode??=[],e.producerIndexOfThis??=[],e.producerLastReadVersion??=[]}function Oa(e){e.liveConsumerNode??=[],e.liveConsumerIndexOfThis??=[]}function ka(e){if(_a(e),ha(e),e.value===Na)throw e.error;return e.value}function Aa(e){let t=Object.create(Pa);t.computation=e;let n=()=>ka(t);return n[ua]=t,n}var ja=/* @__PURE__ */ Symbol(`UNSET`),Ma=/* @__PURE__ */ Symbol(`COMPUTING`),Na=/* @__PURE__ */ Symbol(`ERRORED`),Pa={...ma,value:ja,dirty:!0,error:null,equal:sa,producerMustRecompute(e){return e.value===ja||e.value===Ma},producerRecomputeValue(e){if(e.value===Ma)throw Error(`Detected cycle in computations.`);let t=e.value;e.value=Ma;let n=xa(e),r,i=!1;try{r=e.computation.call(e.wrapper),i=t!==ja&&t!==Na&&e.equal.call(e.wrapper,t,r)}catch(t){r=Na,e.error=t}finally{Sa(e,n)}i?e.value=t:(e.value=r,e.version++)}};function Fa(){throw Error()}var Ia=Fa;function La(){Ia()}function Ra(e){let t=Object.create(Va);t.value=e;let n=()=>(ha(t),t.value);return n[ua]=t,n}function za(){return ha(this),this.value}function Ba(e,t){ya()||La(),e.equal.call(e.wrapper,e.value,t)||(e.value=t,Ha(e))}var Va={...ma,equal:sa,value:void 0};function Ha(e){e.version++,ga(),va(e)}var W=Symbol(`node`),G;(e=>{var t,n,r,i;class a{constructor(r,i={}){aa(this,n),na(this,t);let a=Ra(r)[ua];if(this[W]=a,a.wrapper=this,i){let t=i.equals;t&&(a.equal=t),a.watched=i[e.subtle.watched],a.unwatched=i[e.subtle.unwatched]}}get(){if(!(0,e.isState)(this))throw TypeError(`Wrong receiver type for Signal.State.prototype.get`);return za.call(this[W])}set(t){if(!(0,e.isState)(this))throw TypeError(`Wrong receiver type for Signal.State.prototype.set`);if(pa())throw Error(`Writes to signals not permitted during Watcher callback`);let n=this[W];Ba(n,t)}}t=W,n=/* @__PURE__ */ new WeakSet,e.isState=e=>typeof e==`object`&&ia(n,e),e.State=a;class o{constructor(t,n){aa(this,i),na(this,r);let a=Aa(t)[ua];if(a.consumerAllowSignalWrites=!0,this[W]=a,a.wrapper=this,n){let t=n.equals;t&&(a.equal=t),a.watched=n[e.subtle.watched],a.unwatched=n[e.subtle.unwatched]}}get(){if(!(0,e.isComputed)(this))throw TypeError(`Wrong receiver type for Signal.Computed.prototype.get`);return ka(this[W])}}r=W,i=/* @__PURE__ */ new WeakSet,e.isComputed=e=>typeof e==`object`&&ia(i,e),e.Computed=o,(t=>{var n,r,i,a;function o(e){let t,n=null;try{n=da(null),t=e()}finally{da(n)}return t}t.untrack=o;function s(t){if(!(0,e.isComputed)(t)&&!(0,e.isWatcher)(t))throw TypeError(`Called introspectSources without a Computed or Watcher argument`);return t[W].producerNode?.map(e=>e.wrapper)??[]}t.introspectSources=s;function c(t){if(!(0,e.isComputed)(t)&&!(0,e.isState)(t))throw TypeError(`Called introspectSinks without a Signal argument`);return t[W].liveConsumerNode?.map(e=>e.wrapper)??[]}t.introspectSinks=c;function l(t){if(!(0,e.isComputed)(t)&&!(0,e.isState)(t))throw TypeError(`Called hasSinks without a Signal argument`);let n=t[W].liveConsumerNode;return n?n.length>0:!1}t.hasSinks=l;function u(t){if(!(0,e.isComputed)(t)&&!(0,e.isWatcher)(t))throw TypeError(`Called hasSources without a Computed or Watcher argument`);let n=t[W].producerNode;return n?n.length>0:!1}t.hasSources=u;class d{constructor(e){aa(this,r),aa(this,i),na(this,n);let t=Object.create(ma);t.wrapper=this,t.consumerMarkedDirty=e,t.consumerIsAlwaysLive=!0,t.consumerAllowSignalWrites=!1,t.producerNode=[],this[W]=t}watch(...t){if(!(0,e.isWatcher)(this))throw TypeError(`Called unwatch without Watcher receiver`);oa(this,i,a).call(this,t);let n=this[W];n.dirty=!1;let r=da(n);for(let e of t)ha(e[W]);da(r)}unwatch(...t){if(!(0,e.isWatcher)(this))throw TypeError(`Called unwatch without Watcher receiver`);oa(this,i,a).call(this,t);let n=this[W];Da(n);for(let e=n.producerNode.length-1;e>=0;e--)if(t.includes(n.producerNode[e].wrapper)){Ta(n.producerNode[e],n.producerIndexOfThis[e]);let t=n.producerNode.length-1;if(n.producerNode[e]=n.producerNode[t],n.producerIndexOfThis[e]=n.producerIndexOfThis[t],n.producerNode.length--,n.producerIndexOfThis.length--,n.nextProducerIndex--,e<n.producerNode.length){let t=n.producerIndexOfThis[e],r=n.producerNode[e];Oa(r),r.liveConsumerIndexOfThis[t]=e}}}getPending(){if(!(0,e.isWatcher)(this))throw TypeError(`Called getPending without Watcher receiver`);return this[W].producerNode.filter(e=>e.dirty).map(e=>e.wrapper)}}n=W,r=/* @__PURE__ */ new WeakSet,i=/* @__PURE__ */ new WeakSet,a=function(t){for(let n of t)if(!(0,e.isComputed)(n)&&!(0,e.isState)(n))throw TypeError(`Called watch/unwatch without a Computed or State argument`)},e.isWatcher=e=>ia(r,e),t.Watcher=d;function f(){return fa()?.wrapper}t.currentComputed=f,t.watched=Symbol(`watched`),t.unwatched=Symbol(`unwatched`)})(e.subtle||={})})(G||={});var Ua=Symbol(`SignalWatcherBrand`),Wa=new FinalizationRegistry((({watcher:e,signal:t})=>{e.unwatch(t)})),Ga=/* @__PURE__ */ new WeakMap;function Ka(e){return!0===e[Ua]?(console.warn(`SignalWatcher should not be applied to the same class more than once.`),e):class extends e{constructor(){super(...arguments),this._$St=new G.State(0),this._$Si=!1,this._$So=!0,this._$Sh=/* @__PURE__ */ new Set}_$Sl(){if(this._$Su!==void 0)return;this._$Sv=new G.Computed((()=>{this._$St.get(),super.performUpdate()}));let e=this._$Su=new G.subtle.Watcher((function(){let e=Ga.get(this);e!==void 0&&(!1===e._$Si&&e.requestUpdate(),this.watch())}));Ga.set(e,this),Wa.register(this,{watcher:e,signal:this._$Sv}),e.watch(this._$Sv)}_$Sp(){this._$Su!==void 0&&(this._$Su.unwatch(this._$Sv),this._$Sv=void 0,this._$Su=void 0)}performUpdate(){this.isUpdatePending&&(this._$Sl(),this._$Si=!0,this._$St.set(this._$St.get()+1),this._$Si=!1,this._$Sv.get())}update(e){try{this._$So?(this._$So=!1,super.update(e)):this._$Sh.forEach((e=>e.commit()))}finally{this.isUpdatePending=!1,this._$Sh.clear()}}requestUpdate(e,t,n){this._$So=!0,super.requestUpdate(e,t,n)}connectedCallback(){super.connectedCallback(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),queueMicrotask((()=>{!1===this.isConnected&&this._$Sp()}))}_(e){this._$Sh.add(e);let t=this._$So;this.requestUpdate(),this._$So=t}m(e){this._$Sh.delete(e)}}}te(class extends C{_$Sl(){if(this._$Su!==void 0)return;this._$SW=new G.Computed((()=>this._$Sj?.get()));let e=this._$Su=new G.subtle.Watcher((()=>{var t;(t=this._$SO)==null||t._(this),e.watch()}));e.watch(this._$SW)}_$Sp(){var e;this._$Su!==void 0&&(this._$Su.unwatch(this._$SW),this._$SW=void 0,this._$Su=void 0,(e=this._$SO)==null||e.m(this))}commit(){this.setValue(G.subtle.untrack((()=>this._$SW?.get())))}render(e){return G.subtle.untrack((()=>e.get()))}update(e,[t]){return this._$SO??=e.options?.host,t!==this._$Sj&&this._$Sj!==void 0&&this._$Sp(),this._$Sj=t,this._$Sl(),G.subtle.untrack((()=>this._$SW.get()))}disconnected(){this._$Sp()}reconnected(){this._$Sl()}}),G.State,G.Computed;var K=(e,t)=>new G.State(e,t),qa=(e,t)=>new G.Computed(e,t),Ja=class{constructor(){this.slotContents=K([]),this.slotsContents=K([]),this.periodOverPeriodUiType=K(null),this.periodOverPeriodAllowsPeriodsWithoutDatetimeColumn=K(!1),this.periodOverPeriodHidesPastValue=K(!1),this.linkedDataset=K([]),this._popEnabledChartTypes=[`area-chart`,`bar-chart`,`combination-chart`,`column-chart`,`line-chart`],this._popPeriodsWithoutDatetimeColumnItemTypes=[`kpi`],this._popWithoutPastValueItemTypes=[`kpi`],this.activeSlotContents=qa(()=>this.slotContents.get()[this.activeIndex.get()]),this.activeIndex=K(0)}isArrayColumnType(e){return e.startsWith(`array[`)}setPeriodOverPeriodCondition(e,t){this.periodOverPeriodAllowsPeriodsWithoutDatetimeColumn.set(this._popPeriodsWithoutDatetimeColumnItemTypes.includes(e)),this.periodOverPeriodHidesPastValue.set(this._popWithoutPastValueItemTypes.includes(e)),t?.periodOverPeriod?.newUi?this.periodOverPeriodUiType.set(this.getUiConditionToApply(t)):this.periodOverPeriodUiType.set(this.oldConditionalLogic(e))}getUiConditionToApply(e){let t=this.hasDatetimeColumnOnCategoryOrXAxis(),n=e?.periodOverPeriod?.hasConnectedComparisonFilter,r=this.linkedDataset.get().some(({columns:e})=>e?.some(e=>e.type===`datetime`));return!t&&!n&&!r?null:t&&n?zn.HasDatetimeColumnAndComparisonFilters:t&&!n?zn.HasDatetimeColumnAndNoComparisonFilters:!t&&n?zn.NoDatetimeColumnButComparisonFilters:zn.NoDatetimeColumnAndNoComparisonFilters}oldConditionalLogic(e){let t=this.slotsContents.get()??[],n=(t.find(e=>[`y-axis`,`x-axis`,`row`].includes(e.name))?.content??[])?.[0]??null,r=t.find(e=>e.name===`measure`)?.content??[];return n&&this._popEnabledChartTypes.includes(e)&&n.type===`datetime`&&!this.isArrayColumnType(n.type)&&(!n.datetimeDisplayMode||n.datetimeDisplayMode==="default")&&n.level!==4&&r.length>0?zn.OldImplementation:null}hasDatetimeColumnOnCategoryOrXAxis(){let e=((this.slotsContents.get()??[]).find(e=>[`y-axis`,`x-axis`].includes(e.name))?.content??[])?.[0]??null;return!(!e||e.type!==`datetime`||this.isArrayColumnType(e.type))}setContents(e,t){if(this.slotContents.set(e),this.activeIndex.get()>=e.length&&this.activeIndex.set(e.length>0?e.length-1:0),t){let n=structuredClone(this.slotsContents.get())??[],r=n.find(e=>e.name===t);r&&(r.content=e),this.setFullContents(n)}}setFullContents(e){this.slotsContents.set(e)}updateActive(e){e>=0&&e<this.slotContents.get().length&&this.activeIndex.set(e)}updateContent(e,t=this.activeIndex.get()){if(t<0||t>=this.slotContents.get().length)return;let n=[...this.slotContents.get()];n[t]=structuredClone(e),this.slotContents.set(n)}removeContent(e){if(e<0||e>=this.slotContents.get().length)return;let t=this.slotContents.get().filter((t,n)=>n!==e);this.slotContents.set(t),this.activeIndex.get()>=t.length&&this.activeIndex.set(t.length>0?t.length-1:0)}},Ya=e=>typeof e==`string`&&e.trim().length>0,Xa=e=>!(!e||!Ya(e.formula)||e.formulaId||v(e.formula)),Za=e=>!(!e||!Ya(e.expression)||e.columnId||e.column||e.formulaId||e.formula),Qa=e=>Za(e)?e?.expression:Xa(e)?e?.formula:void 0,$a=e=>e?.columnId??e?.formulaId??e?.column??e?.formula??e?.expression,q=(e,t)=>Za(e)?!0:!e||!Xa(e)?!1:Gn({slotName:String(t.name??``),slotType:t.type,contentKind:Wn(e)})===`measure`,eo=e=>{let n=Xa(e);return T`<span class="calculation-label">
|
|
7
7
|
<span class="calculation-label-icon" aria-hidden="true">${f(n?s:c)}</span>
|
|
8
|
-
<span>${n?
|
|
9
|
-
</span>`},to=(e,t)=>{let n={type:e.type,datasetId:e.datasetId,set:e.datasetId};`columnId`in e&&!_(e.columnId)&&e.columnId!==``?(n.columnId=e.columnId,n.column=e.columnId):`formulaId`in e&&!_(e.formulaId)&&e.formulaId!==``?(n.formulaId=e.formulaId,n.formula=e.formulaId):`formula`in e&&typeof e.formula==`string`&&e.formula!==``&&(n.formula=e.formula);let r=e.type===`datetime`||e.type===`array[datetime]`,i={...e.name??{en:`Untitled`}},a=e.level;if(r&&(a=a??e.lowestLevel??9,t)){let e=Nn.shortLevels?.filter(e=>e!==`All`)??[],t=e[Math.max(0,Math.min(e.length-1,(a??1)-1))];if(t){let e=`(${t})`,n=Object.keys(i);for(let t of n)i[t]=`${i[t]} ${e}`}}return n.label=i,_(e.subtype)||(n.subtype=e.subtype),`lowestLevel`in e&&!_(e.lowestLevel)&&(n.lowestLevel=e.lowestLevel),_(e.format)||(n.format=e.format),_(a)||(n.level=a),_(e.lowestLevel)||(n.lowestLevel=e.lowestLevel),e.type===`numeric`&&e.subtype===`currency`&&e.currency?.symbol&&(n.currency=e.currency.symbol),Array.isArray(e.duration_levels)&&e.duration_format&&(n.duration={levels:e.duration_levels,format:e.duration_format}),n};function no(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}function ro(e){return`##AGGR-${e}##`}function io(e,t){let{aggregationFunction:n,content:r,grouping:i,includedColumns:a,excludedColumns:o}=e??{},s=`${n}(${t[n]?.arity>0?r:``})`;switch(i){case H.GROUPFULL:return`GROUPFULL(${s})`;case H.GROUPINEX:return`GROUPINEX(${s}, [${a?.map(e=>`{${e}}`).join(`, `)||``}], [${o?.map(e=>`{${e}}`).join(`, `)||``}])`;default:return s}}function ao(e){let t=e.split(``),n=null;for(let e=0;e<t.length;e++){let r=t[e];n?r===n?n=null:t[e]=` `:(r===`'`||r===`"`)&&(n=r)}return t.join(``)}function oo(e,t=0){let n=0,r=-1,i=null;for(let a=t,o=e.length;a<o;a++){let t=e[a];if(i)t===i&&(i=null);else if(t===`'`||t===`"`)i=t;else if(t===`(`)n++;else if(t===`)`){if(n===0){r=a;break}n--}}return r}function so(e){let t=e.match(Fi),n=t?.[0],r=t?.[1];return{includedColumns:n?.match(Ii)?.map(e=>e.slice(1,-1))??[],excludedColumns:r?.match(Ii)?.map(e=>e.slice(1,-1))??[]}}function co(e=`light`){return!e||e===`light`?[`#0E89E0`,`#F45000`,`#15BF49`,`#685AC2`,`#636363`]:[`#BDDCF9`,`#FFCFA1`,`#C1F3B7`,`#D7D7EF`,`#D7D7EF`]}function lo(e){let t=co(`light`),n=e.length>1;return e.map((e,r)=>{let i=[];return`dataFields`in e&&Array.isArray(e.dataFields)&&e.dataFields.length>0?i=e.dataFields.filter(e=>!!e.columnId):`columns`in e&&Array.isArray(e.columns)&&(i=e.columns.map(t=>{let n=`columnId`in t&&typeof t.columnId==`string`?t.columnId:`id`in t&&typeof t.id==`string`?t.id:void 0;if(n)return{...t,columnId:n,datasetId:e.id}}).filter(e=>!!e)),{id:e.id,name:e.name,description:`description`in e?e.description:void 0,color:n?t[r%t.length]:void 0,columns:i}})}var J=class extends t(m(h,{validSizes:[`s`,`m`,`l`,`xl`]})){constructor(){super(),this.expression=``,this.datasetsDataFields=[],this.datasetIds=[],this.apiUrl=`https://api.luzmo.com`,this.showAggregations=!0,this.contentLanguage=`en`,this.multiStageAggregation=!0,this.nestedAggregation=!0,this._datasets=[],this._codeMirrorLoaded=Ui(),this._rootContent=``,this._lastEmittedExpression=null,this._applyingExternalExpression=!1,this._handleWidgetsChanged=()=>{this._recomputeExpression()},this._store=this._createStore()}connectedCallback(){super.connectedCallback(),this._store.addEventListener(`widgets-changed`,this._handleWidgetsChanged)}disconnectedCallback(){super.disconnectedCallback(),this._store.removeEventListener(`widgets-changed`,this._handleWidgetsChanged),this._emitTimer&&clearTimeout(this._emitTimer)}firstUpdated(e){super.firstUpdated(e),this._pushRootContent()}updated(e){super.updated(e),e.has(`_codeMirrorLoaded`)&&this._codeMirrorLoaded&&this._pushRootContent()}_pushRootContent(){this._rootContent&&this._codeMirrorElement?.setContent(this._rootContent)}get _codeMirrorElement(){return this.renderRoot?.querySelector(`luzmo-formula-codemirror`)}async _ensureCodeMirrorLoaded(){this._codeMirrorLoaded||=(await Hi(),!0)}willUpdate(e){super.willUpdate(e),this._shouldLoadInput()&&this._ensureCodeMirrorLoaded(),(e.has(`multiStageAggregation`)||e.has(`nestedAggregation`)||e.has(`contentLanguage`)||e.has(`size`))&&(this._store.multiStageAggregation=this.multiStageAggregation,this._store.nestedAggregation=this.nestedAggregation,this._store.contentLanguage=this.contentLanguage,this._store.size=this.size),(e.has(`datasetsDataFields`)||e.has(`datasetIds`)||e.has(`apiUrl`)||e.has(`authKey`)||e.has(`authToken`))&&this._loadDatasets(),e.has(`showAggregations`)&&this._rebuildAutoCompletion(),e.has(`expression`)&&this._applyExternalExpression()}async _loadDatasets(){if(this.datasetsDataFields.length===0&&this.datasetIds.length===0)this._datasets=[],this._store.datasets=[],this._store.refreshDecorations(),this._setLoading(!1),this._rebuildAutoCompletion();else if(this.datasetsDataFields.length>0)this._datasets=lo(this.datasetsDataFields),this._store.datasets=this._datasets,this._store.refreshDecorations(),this._setLoading(!1),this._rebuildAutoCompletion();else if(this.datasetIds.length>0){this._setLoading(!0);try{let e=await u(this.datasetIds,{dataBrokerConfig:{apiUrl:this.apiUrl,authKey:this.authKey,authToken:this.authToken}});this._datasets=lo(e),this._store.datasets=this._datasets,this._store.refreshDecorations(),this._rebuildAutoCompletion()}catch(e){console.warn(`[${this.localName}] Failed to load datasets:`,e),this.dispatchEvent(new CustomEvent(`luzmo-datasets-error`,{bubbles:!0,composed:!0,detail:{error:e}}))}finally{this._setLoading(!1)}}}_rebuildAutoCompletion(){}_syncExpressionToStore(){return this.expression===this._lastEmittedExpression?null:(this._store.clearWidgets(),this._rootContent=this.multiStageAggregation?this._store.transformToAggregationWidgetSyntax(this.expression):this.expression,this._rootContent)}_applyExternalExpression(){this._applyingExternalExpression=!0;try{this._syncExpressionToStore()}finally{this._applyingExternalExpression=!1}}_recomputeExpression(){if(this._applyingExternalExpression||!this._canEmitExpression())return;let e=this.multiStageAggregation?this._store.transformToAggregationFunctionSyntax(this._rootContent):this._rootContent;this._emitTimer&&clearTimeout(this._emitTimer),this._emitTimer=setTimeout(()=>this._onExpressionComputed(e),this._emitDebounceMs)}_emitExpressionChanged(e){this._lastEmittedExpression=e,this.dispatchEvent(new CustomEvent(`luzmo-expression-changed`,{bubbles:!0,composed:!0,detail:{expression:e}}))}_shouldLoadInput(){return!0}_canEmitExpression(){return!0}get _emitDebounceMs(){return 300}_onExpressionComputed(e){e!==this._lastEmittedExpression&&this._emitExpressionChanged(e)}_setLoading(e){}};n([k({type:String})],J.prototype,`expression`,void 0),n([k({attribute:!1})],J.prototype,`datasetsDataFields`,void 0),n([k({type:Array,attribute:`dataset-ids`})],J.prototype,`datasetIds`,void 0),n([k({type:String,attribute:`api-url`})],J.prototype,`apiUrl`,void 0),n([k({type:String,attribute:`auth-key`})],J.prototype,`authKey`,void 0),n([k({type:String,attribute:`auth-token`})],J.prototype,`authToken`,void 0),n([k({type:Boolean,attribute:`show-aggregations`,reflect:!0})],J.prototype,`showAggregations`,void 0),n([k({type:String,attribute:`content-language`,reflect:!0})],J.prototype,`contentLanguage`,void 0),n([k({type:Boolean,attribute:`multi-stage-aggregation`})],J.prototype,`multiStageAggregation`,void 0),n([k({type:Boolean,attribute:`nested-aggregation`})],J.prototype,`nestedAggregation`,void 0),n([A()],J.prototype,`_datasets`,void 0),n([A()],J.prototype,`_codeMirrorLoaded`,void 0);function uo(){let t=2026;return{"+":{type:`infix`,arity:2,label:()=>e(`Addition`,{desc:`Formula function label for addition`}),description:()=>e(`Adds two numeric values.`,{desc:`Formula function description for addition operator`}),example:()=>`42.0 + ⟨numeric⟩ Average burrito price`,exampleHasIcons:!0},"-":{type:`infix`,arity:2,label:()=>e(`Difference`,{desc:`Formula function label for subtraction`}),description:()=>e(`Subtracts the second value from the first value.`,{desc:`Formula function description for subtraction operator`}),example:()=>`⟨numeric⟩ Burrito weight - 42`,exampleHasIcons:!0},"*":{type:`infix`,arity:2,label:()=>e(`Multiplication`,{desc:`Formula function label for multiplication`}),description:()=>e(`Multiplies two numeric values.`,{desc:`Formula function description for multiplication operator`}),example:()=>`⟨numeric⟩ Number of burritos * 2`,exampleHasIcons:!0},"/":{type:`infix`,arity:2,label:()=>e(`Division`,{desc:`Formula function label for division`}),description:()=>e(`Divides the first numeric value by the second numeric value.`,{desc:`Formula function description for division operator`}),example:()=>`⟨numeric⟩ Number of burritos / 2`,exampleHasIcons:!0},"%":{type:`infix`,arity:2,label:()=>e(`Modulo`,{desc:`Formula function label for modulo`}),description:()=>e(`Returns the remainder after dividing the first value by the second value.`,{desc:`Formula function description for modulo operator`}),example:()=>`5 % 2`},">":{type:`infix`,arity:2,label:()=>e(`Greater than`,{desc:`Formula function label for greater than comparison`}),description:()=>e(`Checks whether the first value is greater than the second value.`,{desc:`Formula function description for greater than operator`}),example:()=>`⟨numeric⟩ Burrito weight > 50`,exampleHasIcons:!0},"<":{type:`infix`,arity:2,label:()=>e(`Less than`,{desc:`Formula function label for less than comparison`}),description:()=>e(`Checks whether the first value is less than the second value.`,{desc:`Formula function description for less than operator`}),example:()=>`⟨numeric⟩ Burrito weight < 50`,exampleHasIcons:!0},">=":{type:`infix`,arity:2,label:()=>e(`Greater than or equal`,{desc:`Formula function label for greater than or equal comparison`}),description:()=>e(`Checks whether the first value is greater than or equal to the second value.`,{desc:`Formula function description for greater than or equal operator`}),example:()=>`⟨numeric⟩ Burrito weight >= 50`,exampleHasIcons:!0},"<=":{type:`infix`,arity:2,label:()=>e(`Less than or equal`,{desc:`Formula function label for less than or equal comparison`}),description:()=>e(`Checks whether the first value is less than or equal to the second value.`,{desc:`Formula function description for less than or equal operator`}),example:()=>`⟨numeric⟩ Burrito weight <= 50`,exampleHasIcons:!0},"=":{type:`infix`,arity:2,label:()=>e(`Equal`,{desc:`Formula function label for equality comparison`}),description:()=>e(`Checks whether both values are equal.`,{desc:`Formula function description for equality operator`}),example:()=>`⟨hierarchy⟩ Burrito type = 'Savoury'`,exampleHasIcons:!0},"<>":{type:`infix`,arity:2,label:()=>e(`Not equal`,{desc:`Formula function label for inequality comparison`}),description:()=>e(`Checks whether two values are different.`,{desc:`Formula function description for inequality operator`}),example:()=>`⟨hierarchy⟩ Burrito type <> 'Sweet'`,exampleHasIcons:!0},ABS:{type:`prefix`,arity:1,label:()=>e(`Absolute value`,{desc:`Formula function label for ABS`}),description:()=>e(`Returns the absolute value of a number.`,{desc:`Formula function description for ABS`}),example:()=>`ABS(-5.0)`},CEIL:{type:`prefix`,arity:1,label:()=>e(`Round up`,{desc:`Formula function label for CEIL`}),description:()=>e(`Rounds a number up to the nearest integer.`,{desc:`Formula function description for CEIL`}),example:()=>`CEIL(11.3)`},E:{type:`prefix`,arity:0,label:()=>e(`Euler's number`,{desc:`Formula function label for E`}),description:()=>e(`Returns Euler's constant e.`,{desc:`Formula function description for E`}),example:()=>`E()`},EXP:{type:`prefix`,arity:1,label:()=>e(`Exponential`,{desc:`Formula function label for EXP`}),description:()=>e(`Returns e raised to the specified power.`,{desc:`Formula function description for EXP`}),example:()=>`EXP(11.3)`},FLOOR:{type:`prefix`,arity:1,label:()=>e(`Round down`,{desc:`Formula function label for FLOOR`}),description:()=>e(`Rounds a number down to the nearest integer.`,{desc:`Formula function description for FLOOR`}),example:()=>`FLOOR(11.7)`},LN:{type:`prefix`,arity:1,label:()=>e(`Natural logarithm`,{desc:`Formula function label for LN`}),description:()=>e(`Returns the natural logarithm of a number.`,{desc:`Formula function description for LN`}),example:()=>`LN(11.7)`},LOG:{type:`prefix`,arity:2,label:()=>e(`Logarithm`,{desc:`Formula function label for LOG`}),description:()=>e(`Returns the logarithm of a number for a specific base.`,{desc:`Formula function description for LOG`}),example:()=>`LOG(3.6, 10)`},PI:{type:`prefix`,arity:0,label:()=>e(`Pi`,{desc:`Formula function label for PI`}),description:()=>e(`Returns the mathematical constant pi.`,{desc:`Formula function description for PI`}),example:()=>`PI()`},POW:{type:`prefix`,arity:2,label:()=>e(`Power`,{desc:`Formula function label for POW`}),description:()=>e(`Raises a number to a given power.`,{desc:`Formula function description for POW`}),example:()=>`POW(2.35, 2)`},RAND:{type:`prefix`,arity:0,label:()=>e(`Random number`,{desc:`Formula function label for RAND`}),description:()=>e(`Returns a random number between 0 and 1.`,{desc:`Formula function description for RAND`}),example:()=>`RAND()`},ROUND:{type:`prefix`,arity:2,label:()=>e(`Round`,{desc:`Formula function label for ROUND`}),description:()=>e(`Rounds a number to a specified number of decimal places.`,{desc:`Formula function description for ROUND`}),example:()=>`ROUND(4.567, 1)`},SQRT:{type:`prefix`,arity:1,label:()=>e(`Square root`,{desc:`Formula function label for SQRT`}),description:()=>e(`Returns the square root of a number.`,{desc:`Formula function description for SQRT`}),example:()=>`SQRT(4)`},CAST:{type:`prefix`,arity:2,label:()=>e(`Convert value`,{desc:`Formula function label for CAST`}),description:()=>e(`Converts the first argument to the type given by the second argument. Possible types are 'hierarchy', 'numeric', 'datetime' and 'boolean'.`,{desc:`Formula function description for CAST`}),example:()=>`CAST(⟨numeric⟩ Burrito weight, hierarchy)`,exampleHasIcons:!0},IF:{type:`prefix`,arity:3,label:()=>e(`If`,{desc:`Formula function label for IF`}),description:()=>e(`Returns one value when a condition is true and another value when false.`,{desc:`Formula function description for IF`}),example:()=>`IF(⟨numeric⟩ Burrito weight < 200,'Small','Large')`,exampleHasIcons:!0},COALESCE:{type:`prefix`,arity:2,label:()=>e(`Is empty`,{desc:`Formula function label for COALESCE`}),description:()=>e(`Returns the first non-null value from the provided arguments.`,{desc:`Formula function description for COALESCE`}),example:()=>`COALESCE(⟨hierarchy⟩ Burrito type, 'Unknown type')`,exampleHasIcons:!0},AND:{type:`infix`,arity:2,label:()=>e(`Logical and`,{desc:`Formula function label for AND`}),description:()=>e(`Returns true when both conditions are true.`,{desc:`Formula function description for AND`}),example:()=>`Burrito weight > 50 AND Burrito weight < 75`},OR:{type:`infix`,arity:2,label:()=>e(`Logical or`,{desc:`Formula function label for OR`}),description:()=>e(`Returns true when at least one condition is true.`,{desc:`Formula function description for OR`}),example:()=>`Burrito price > 10.1 OR Burrito weight >= 50`},NOT:{type:`prefix_op`,arity:1,label:()=>e(`Logical not`,{desc:`Formula function label for NOT`}),description:()=>e(`Negates a boolean condition.`,{desc:`Formula function description for NOT`}),example:()=>`NOT (Burrito type = 'Salty')`},SIN:{type:`prefix`,arity:1,label:()=>e(`Sine`,{desc:`Formula function label for SIN`}),description:()=>e(`Returns the sine of an angle in radians.`,{desc:`Formula function description for SIN`}),example:()=>`SIN(3.14)`},COS:{type:`prefix`,arity:1,label:()=>e(`Cosine`,{desc:`Formula function label for COS`}),description:()=>e(`Returns the cosine of an angle in radians.`,{desc:`Formula function description for COS`}),example:()=>`COS(3.14)`},TAN:{type:`prefix`,arity:1,label:()=>e(`Tangent`,{desc:`Formula function label for TAN`}),description:()=>e(`Returns the tangent of an angle in radians.`,{desc:`Formula function description for TAN`}),example:()=>`TAN(3.14)`},ASIN:{type:`prefix`,arity:1,label:()=>e(`Arcsine`,{desc:`Formula function label for ASIN`}),description:()=>e(`Returns the arcsine of a number.`,{desc:`Formula function description for ASIN`}),example:()=>`ASIN(3.14)`},ACOS:{type:`prefix`,arity:1,label:()=>e(`Arccosine`,{desc:`Formula function label for ACOS`}),description:()=>e(`Returns the arccosine of a number.`,{desc:`Formula function description for ACOS`}),example:()=>`ACOS(3.14)`},ATAN:{type:`prefix`,arity:1,label:()=>e(`Arctangent`,{desc:`Formula function label for ATAN`}),description:()=>e(`Returns the arctangent of a number.`,{desc:`Formula function description for ATAN`}),example:()=>`ATAN(3.14)`},SINH:{type:`prefix`,arity:1,label:()=>e(`Hyperbolic sine`,{desc:`Formula function label for SINH`}),description:()=>e(`Returns the hyperbolic sine of a number.`,{desc:`Formula function description for SINH`}),example:()=>`SINH(3.14)`},COSH:{type:`prefix`,arity:1,label:()=>e(`Hyperbolic cosine`,{desc:`Formula function label for COSH`}),description:()=>e(`Returns the hyperbolic cosine of a number.`,{desc:`Formula function description for COSH`}),example:()=>`COSH(3.14)`},TANH:{type:`prefix`,arity:1,label:()=>e(`Hyperbolic tangent`,{desc:`Formula function label for TANH`}),description:()=>e(`Returns the hyperbolic tangent of a number.`,{desc:`Formula function description for TANH`}),example:()=>`TANH(3.14)`},MEAN:{type:`prefix`,arity:1,label:()=>e(`Mean`,{desc:`Formula function label for MEAN`}),description:()=>e(`Returns the arithmetic mean of all values in a numeric column. The value is calculated over the entire dataset and does not change when filtering.`,{desc:`Formula function description for MEAN`}),example:()=>`MEAN(⟨numeric⟩ Burrito weight)`,exampleHasIcons:!0},STDDEV:{type:`prefix`,arity:1,label:()=>e(`Standard deviation`,{desc:`Aggregation label`}),description:()=>e(`Returns the sample standard deviation over all values in a numeric column. The value is calculated over the entire dataset and does not change when filtering.`,{desc:`Formula function description for STDDEV`}),example:()=>`STDDEV(⟨numeric⟩ Burrito weight)`,exampleHasIcons:!0},"||":{type:`infix`,arity:2,label:()=>e(`Concatenate`,{desc:`Formula function label for concatenate operator`}),description:()=>e(`Concatenates two strings.`,{desc:`Formula function description for concatenate operator`}),example:()=>`'Tasty' || ' burrito'`},LENGTH:{type:`prefix`,arity:1,label:()=>e(`String length`,{desc:`Formula function label for LENGTH`}),description:()=>e(`Returns the number of characters in a string.`,{desc:`Formula function description for LENGTH`}),example:()=>`LENGTH('Burrito')`},LOWER:{type:`prefix`,arity:1,label:()=>e(`Lowercase`,{desc:`Formula function label for LOWER`}),description:()=>e(`Converts a string to lowercase.`,{desc:`Formula function description for LOWER`}),example:()=>`LOWER('BURRITO')`},UPPER:{type:`prefix`,arity:1,label:()=>e(`Uppercase`,{desc:`Formula function label for UPPER`}),description:()=>e(`Converts a string to uppercase.`,{desc:`Formula function description for UPPER`}),example:()=>`UPPER('burrito')`},LTRIM:{type:`prefix`,arity:1,label:()=>e(`Trim left`,{desc:`Formula function label for LTRIM`}),description:()=>e(`Removes leading spaces from a string.`,{desc:`Formula function description for LTRIM`}),example:()=>`LTRIM(' Burrito')`},RTRIM:{type:`prefix`,arity:1,label:()=>e(`Trim right`,{desc:`Formula function label for RTRIM`}),description:()=>e(`Removes trailing spaces from a string.`,{desc:`Formula function description for RTRIM`}),example:()=>`RTRIM('Burrito ')`},TRIM:{type:`prefix`,arity:1,label:()=>e(`Trim`,{desc:`Formula function label for TRIM`}),description:()=>e(`Removes leading and trailing spaces from a string.`,{desc:`Formula function description for TRIM`}),example:()=>`TRIM('Burrito ')`},REPLACE:{type:`prefix`,arity:3,label:()=>e(`Replace text`,{desc:`Formula function label for REPLACE`}),description:()=>e(`Replaces occurrences of a substring with another substring.`,{desc:`Formula function description for REPLACE`}),example:()=>`REPLACE('Sweet burrito','Sweet', 'Savoury')`},STRPOS:{type:`prefix`,arity:2,label:()=>e(`Find substring`,{desc:`Formula function label for STRPOS`}),description:()=>e(`Returns the position of a substring in a string.`,{desc:`Formula function description for STRPOS`}),example:()=>`STRPOS('Sweet burrito','burrito')`},SUBSTR:{type:`prefix`,arity:3,label:()=>e(`Take substring`,{desc:`Formula function label for SUBSTR`}),description:()=>e(`Extracts part of a string. The first argument is the text, the second the starting position (the first character is 1; a negative position counts from the end), and the third the length.`,{desc:`Formula function description for SUBSTR`}),example:()=>`SUBSTR('Sweet burrito',7,3)`},SPLIT_PART:{type:`prefix`,arity:3,label:()=>e(`Split part`,{desc:`Formula function label for SPLIT_PART`}),description:()=>e(`Splits a string into parts using a delimiter. The first argument is the text to split, the second the delimiter, and the third the position of the part to return (starting from 1).`,{desc:`Formula function description for SPLIT_PART`}),example:()=>`SPLIT_PART('Sweet burrito', ' ', 2)`},NOW:{type:`prefix`,arity:0,label:()=>e(`Current date and time`,{desc:`Formula function label for NOW`}),description:()=>e(`Returns the current date and time.`,{desc:`Formula function description for NOW`}),example:()=>`NOW()`},YEAR:{type:`prefix`,arity:1,label:()=>e(`Year`,{desc:`Time unit`}),description:()=>e(`Extracts the year from a date value.`,{desc:`Formula function description for YEAR`}),example:()=>`YEAR('${t}-02-17')`},YEAR_UTC:{type:`prefix`,arity:1,label:()=>e(`Year (UTC)`,{desc:`Formula function label for YEAR_UTC`}),description:()=>e(`Extracts the year from a date value in UTC.`,{desc:`Formula function description for YEAR_UTC`}),example:()=>`YEAR_UTC('${t}-02-17')`},QUARTER:{type:`prefix`,arity:1,label:()=>e(`Quarter`,{desc:`Time unit`}),description:()=>e(`Extracts the quarter from a date value.`,{desc:`Formula function description for QUARTER`}),example:()=>`QUARTER('${t}-02-17')`},QUARTER_UTC:{type:`prefix`,arity:1,label:()=>e(`Quarter (UTC)`,{desc:`Formula function label for QUARTER_UTC`}),description:()=>e(`Extracts the quarter from a date value in UTC.`,{desc:`Formula function description for QUARTER_UTC`}),example:()=>`QUARTER_UTC('${t}-02-17')`},MONTH:{type:`prefix`,arity:1,label:()=>e(`Month`,{desc:`Time unit`}),description:()=>e(`Extracts the month from a date or datetime value.`,{desc:`Formula function description for MONTH`}),example:()=>`MONTH('${t}-02-17 15:36:59')`},MONTH_UTC:{type:`prefix`,arity:1,label:()=>e(`Month (UTC)`,{desc:`Formula function label for MONTH_UTC`}),description:()=>e(`Extracts the month from a date or datetime value in UTC.`,{desc:`Formula function description for MONTH_UTC`}),example:()=>`MONTH_UTC('${t}-02-17 15:36:59')`},WEEK:{type:`prefix`,arity:1,label:()=>e(`Week`,{desc:`Time unit`}),description:()=>e(`Extracts the ISO 8601 week number (1-53) from a date or datetime value.`,{desc:`Formula function description for WEEK`}),example:()=>`WEEK('${t}-02-17 15:36:59')`},WEEK_UTC:{type:`prefix`,arity:1,label:()=>e(`Week (UTC)`,{desc:`Formula function label for WEEK_UTC`}),description:()=>e(`Extracts the ISO 8601 week number (1-53) from a date or datetime value in UTC.`,{desc:`Formula function description for WEEK_UTC`}),example:()=>`WEEK_UTC('${t}-02-17 15:36:59')`},DAY:{type:`prefix`,arity:1,label:()=>e(`Day of month`,{desc:`Formula function label for DAY`}),description:()=>e(`Extracts the day of month from a date or datetime value.`,{desc:`Formula function description for DAY`}),example:()=>`DAY('${t}-02-17 15:36:59')`},DAY_UTC:{type:`prefix`,arity:1,label:()=>e(`Day of month (UTC)`,{desc:`Formula function label for DAY_UTC`}),description:()=>e(`Extracts the day of month from a date or datetime value in UTC.`,{desc:`Formula function description for DAY_UTC`}),example:()=>`DAY_UTC('${t}-02-17 15:36:59')`},DAY_OF_WEEK:{type:`prefix`,arity:1,label:()=>e(`Day of week`,{desc:`Formula function label for DAY_OF_WEEK`}),description:()=>e(`Extracts the day of week (1-7, where 1 is Monday) from a date or datetime value.`,{desc:`Formula function description for DAY_OF_WEEK`}),example:()=>`DAY_OF_WEEK('${t}-02-17 15:36:59')`},DAY_OF_WEEK_UTC:{type:`prefix`,arity:1,label:()=>e(`Day of week (UTC)`,{desc:`Formula function label for DAY_OF_WEEK_UTC`}),description:()=>e(`Extracts the day of week (1-7, where 1 is Monday) from a date or datetime value in UTC.`,{desc:`Formula function description for DAY_OF_WEEK_UTC`}),example:()=>`DAY_OF_WEEK_UTC('${t}-02-17 15:36:59')`},DAY_OF_YEAR:{type:`prefix`,arity:1,label:()=>e(`Day of year`,{desc:`Formula function label for DAY_OF_YEAR`}),description:()=>e(`Extracts the day of year from a date or datetime value.`,{desc:`Formula function description for DAY_OF_YEAR`}),example:()=>`DAY_OF_YEAR('${t}-02-17 15:36:59')`},DAY_OF_YEAR_UTC:{type:`prefix`,arity:1,label:()=>e(`Day of year (UTC)`,{desc:`Formula function label for DAY_OF_YEAR_UTC`}),description:()=>e(`Extracts the day of year from a date or datetime value in UTC.`,{desc:`Formula function description for DAY_OF_YEAR_UTC`}),example:()=>`DAY_OF_YEAR_UTC('${t}-02-17 15:36:59')`},YEAR_OF_WEEK:{type:`prefix`,arity:1,label:()=>e(`Year of ISO week`,{desc:`Formula function label for YEAR_OF_WEEK`}),description:()=>e(`Extracts the ISO week-numbering year from a date or datetime value.`,{desc:`Formula function description for YEAR_OF_WEEK`}),example:()=>`YEAR_OF_WEEK('${t}-02-17 15:36:59')`},YEAR_OF_WEEK_UTC:{type:`prefix`,arity:1,label:()=>e(`Year of ISO week (UTC)`,{desc:`Formula function label for YEAR_OF_WEEK_UTC`}),description:()=>e(`Extracts the ISO week-numbering year from a date or datetime value in UTC.`,{desc:`Formula function description for YEAR_OF_WEEK_UTC`}),example:()=>`YEAR_OF_WEEK_UTC('${t}-02-17 15:36:59')`},HOUR:{type:`prefix`,arity:1,label:()=>e(`Hour`,{desc:`Time unit`}),description:()=>e(`Extracts the hour from a datetime value.`,{desc:`Formula function description for HOUR`}),example:()=>`HOUR('${t}-02-17 15:36:59')`},HOUR_UTC:{type:`prefix`,arity:1,label:()=>e(`Hour (UTC)`,{desc:`Formula function label for HOUR_UTC`}),description:()=>e(`Extracts the hour from a datetime value in UTC.`,{desc:`Formula function description for HOUR_UTC`}),example:()=>`HOUR_UTC('${t}-02-17 15:36:59')`},MINUTE:{type:`prefix`,arity:1,label:()=>e(`Minute`,{desc:`Time unit`}),description:()=>e(`Extracts the minute from a datetime value.`,{desc:`Formula function description for MINUTE`}),example:()=>`MINUTE('${t}-02-17 15:36:59')`},MINUTE_UTC:{type:`prefix`,arity:1,label:()=>e(`Minute (UTC)`,{desc:`Formula function label for MINUTE_UTC`}),description:()=>e(`Extracts the minute from a datetime value in UTC.`,{desc:`Formula function description for MINUTE_UTC`}),example:()=>`MINUTE_UTC('${t}-02-17 15:36:59')`},SECOND:{type:`prefix`,arity:1,label:()=>e(`Second`,{desc:`Time unit`}),description:()=>e(`Extracts the second from a datetime value.`,{desc:`Formula function description for SECOND`}),example:()=>`SECOND('${t}-02-17 15:36:59')`},SECOND_UTC:{type:`prefix`,arity:1,label:()=>e(`Second (UTC)`,{desc:`Formula function label for SECOND_UTC`}),description:()=>e(`Extracts the second from a datetime value in UTC.`,{desc:`Formula function description for SECOND_UTC`}),example:()=>`SECOND_UTC('${t}-02-17 15:36:59')`},DATE_ADD:{type:`prefix`,arity:3,label:()=>e(`Add/subtract duration`,{desc:`Formula function label for DATE_ADD`}),description:()=>e(`Adds a duration to (or subtracts it from) a date or datetime value. The first argument is the unit ('millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'quarter' or 'year'), the second the number of units to add (negative to subtract), and the third the date or datetime to start from.`,{desc:`Formula function description for DATE_ADD`}),example:()=>`DATE_ADD('hour', 2, ⟨datetime⟩ Arrival time)`,exampleHasIcons:!0},DATE_DIFF:{type:`prefix`,arity:3,label:()=>e(`Difference between dates`,{desc:`Formula function label for DATE_DIFF`}),description:()=>e(`Returns the difference between two dates or datetimes in the selected unit. The first argument is the unit ('millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'quarter' or 'year'); the difference is calculated from the second date towards the third date.`,{desc:`Formula function description for DATE_DIFF`}),example:()=>`DATE_DIFF('day', ⟨datetime⟩ Arrival date, '${t}-02-17 15:36:59')`,exampleHasIcons:!0},COORDS:{type:`prefix`,arity:3,label:()=>e(`Coordinates`,{id:`formula-function-label-coords`,desc:`Formula function label for COORDS`}),description:()=>e(`Builds a geography value from latitude, longitude, and spatial reference.`,{desc:`Formula function description for COORDS`}),example:()=>`COORDS(⟨numeric⟩ Latitude, ⟨numeric⟩ Longitude, 'wgs84')`,exampleHasIcons:!0}}}var fo=class extends EventTarget{constructor(...e){super(...e),this.functionDataMap=uo(),this.aggregationFunctionDataMap=Ri(),this.multiStageAggregation=!0,this.nestedAggregation=!0,this.readonly=!1,this.contentLanguage=`en`,this.size=`m`,this.datasets=[],this.loading=!1,this.lastFocusedAggregationWidgetId=null,this.lastFocusedEmptyArgumentId=null,this.pendingFocusAggregationWidgetId=null,this._aggregationWidgets=[]}get aggregationWidgets(){return this._aggregationWidgets}addWidgets(e){e&&e.length!==0&&(this._aggregationWidgets=[...this._aggregationWidgets,...e],this._notifyWidgetsChanged())}removeWidgets(e){this._aggregationWidgets=this._aggregationWidgets.filter(({widgetId:t})=>!e.includes(t)),this._notifyWidgetsChanged()}updateWidget(e){this._aggregationWidgets=this._aggregationWidgets.map(t=>t.widgetId===e.widgetId?e:t),this._notifyWidgetsChanged()}getWidget(e){return this._aggregationWidgets.find(t=>t.widgetId===e)}clearWidgets(){this._aggregationWidgets.length!==0&&(this._aggregationWidgets=[],this._notifyWidgetsChanged())}_notifyWidgetsChanged(){this.dispatchEvent(new CustomEvent(`widgets-changed`))}setReadonly(e){this.readonly!==e&&(this.readonly=e,this.dispatchEvent(new CustomEvent(`widgets-changed`)))}setLoading(e){this.loading!==e&&(this.loading=e,this.refreshDecorations())}refreshDecorations(){this.dispatchEvent(new CustomEvent(`refresh-decorations`))}_markAggregationForFocus(e){let t=e[0];t&&(this.aggregationFunctionDataMap[t.aggregationFunction]?.arity??0)>0&&(this.pendingFocusAggregationWidgetId=t.widgetId)}transformToAggregationWidgetSyntax(e){let t=ao(e).match(Ni);if(!t)return e;let n=!!t[1],r=t.index??0,i=oo(e,r+(n?t[1].length:t[0].length)-1+1),a=oo(e,r+t[0].length);if(i===-1)return e;let o=e.slice(r+t[0].length,a),s=this.transformToAggregationWidgetSyntax(o),c={widgetId:no(),grouping:t[2]??H.GROUP,aggregationFunction:t[3],content:s};if(c.grouping===H.GROUPINEX){let{includedColumns:t,excludedColumns:n}=so(e.slice(a+1,i));c.includedColumns=t,c.excludedColumns=n}let l=ro(c.widgetId),u=`${e.slice(0,r)}${l}${e.slice(i+1)}`;return this.addWidgets([c]),this.transformToAggregationWidgetSyntax(u)}transformToAggregationFunctionSyntax(e){let t=e.match(Pi);if(!t)return e;let n=t.index??0,r=n+t[0].length-1,i=t[1],a=this.getWidget(i),o=a?this.transformToAggregationFunctionSyntax(io(a,this.aggregationFunctionDataMap)):``,s=`${e.slice(0,n)}${o}${e.slice(r+1)}`;return this.transformToAggregationFunctionSyntax(s)}},po=`:host{box-sizing:border-box;font-family:var(--luzmo-font-family);color:var(--luzmo-font-color);display:inline-block}.formula-text{font-size:var(--luzmo-formula-font-size,var(--luzmo-font-size));white-space:pre-wrap;word-break:break-word;line-height:1.5}.formula-text-column{white-space:nowrap}.formula-text-column-icon{margin-inline-end:var(--luzmo-spacing-1)}.formula-pills{align-items:center;gap:var(--luzmo-spacing-1) 0;font-size:var(--luzmo-formula-font-size,var(--luzmo-font-size));flex-wrap:wrap;line-height:1.5;display:inline-flex}.formula-operator{white-space:pre-wrap}.column-pill-wrapper{vertical-align:middle;padding-inline-end:var(--luzmo-formula-column-pill-trailing-space,var(--luzmo-spacing-1));display:inline-flex}.column-pill{justify-content:center;align-items:center;gap:var(--luzmo-spacing-2);box-sizing:border-box;max-width:16rem;min-height:var(--luzmo-formula-control-height,1.375rem);padding:0 var(--luzmo-formula-column-pill-padding-inline,calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1)));border-radius:var(--luzmo-border-radius-s);background-color:var(--luzmo-formula-column-pill-background,var(--luzmo-background-color-highlight));color:var(--luzmo-font-color);white-space:nowrap;font-size:.85em;line-height:1.2;display:inline-flex}.column-pill-icon{flex:none;display:inline-flex}.column-pill-label{text-overflow:ellipsis;overflow:hidden}.column-pill-loading{--luzmo-progress-circle-size:1em;align-items:center;display:inline-flex}.agg-pill{padding-block:var(--luzmo-spacing-1);border-radius:var(--luzmo-border-radius);background-color:var(--agg-accent,var(--luzmo-primary));color:var(--luzmo-primary-inverse-color);font-size:var(--luzmo-formula-font-size,var(--luzmo-font-size));vertical-align:middle;padding-inline:0;display:inline-flex}.agg-pill-row{align-items:center;gap:var(--luzmo-spacing-1);min-height:var(--luzmo-formula-control-height,1.375rem);display:inline-flex}.agg-fn{text-transform:uppercase;padding-inline-start:var(--luzmo-spacing-3);padding-inline-end:var(--luzmo-spacing-3);font-size:.85em}.agg-value{min-height:var(--luzmo-formula-control-height,1.375rem);padding:0 var(--luzmo-spacing-2);border-radius:var(--luzmo-border-radius-s);background-color:var(--luzmo-background-color);color:var(--luzmo-font-color);--luzmo-formula-column-pill-background:transparent;--luzmo-formula-column-pill-padding-inline:0px;align-items:center;line-height:1;display:inline-flex}.agg-grouping{align-items:center;gap:var(--luzmo-spacing-1);padding-inline:var(--luzmo-spacing-2) var(--luzmo-spacing-3);font-size:var(--luzmo-formula-grouping-icon-size,var(--luzmo-icon-size-m));display:inline-flex}.agg-grouping--no-value{padding-inline-start:0}.agg-grouping-count{border-radius:var(--luzmo-border-radius-full,999rem);background:var(--luzmo-primary-inverse-color);min-width:1.25em;color:var(--agg-accent,var(--luzmo-primary));font-size:.6875rem;font-weight:var(--luzmo-font-weight-bold);justify-content:center;align-items:center;padding:0 .25em;line-height:1.4;display:inline-flex}:host{--luzmo-formula-font-size:var(--luzmo-font-size);--luzmo-formula-grouping-icon-size:var(--luzmo-icon-size-m);--luzmo-formula-control-height:calc(var(--luzmo-component-height) - 2 * var(--luzmo-spacing-1))}:host([size=s]){--luzmo-formula-font-size:var(--luzmo-font-size-s);--luzmo-formula-grouping-icon-size:var(--luzmo-icon-size-s);--luzmo-formula-control-height:calc(var(--luzmo-component-height-s) - 2 * var(--luzmo-spacing-1))}:host([size=l]){--luzmo-formula-font-size:var(--luzmo-font-size-l);--luzmo-formula-grouping-icon-size:var(--luzmo-icon-size-l);--luzmo-formula-control-height:calc(var(--luzmo-component-height-l) - 2 * var(--luzmo-spacing-1))}:host([size=xl]){--luzmo-formula-font-size:var(--luzmo-font-size-xl);--luzmo-formula-grouping-icon-size:var(--luzmo-icon-size-xl);--luzmo-formula-control-height:calc(var(--luzmo-component-height-xl) - 2 * var(--luzmo-spacing-1))}`,mo=class extends J{constructor(...e){super(...e),this.display=`rich`,this._groupingDataMap=Bi()}static{this.styles=re(po)}_createStore(){return new fo}_shouldLoadInput(){return!1}_canEmitExpression(){return!1}_applyExternalExpression(){this.display===`text`?this._rootContent=``:(this._store.clearWidgets(),this._rootContent=this._store.transformToAggregationWidgetSyntax(this.expression??``))}willUpdate(e){super.willUpdate(e),e.has(`display`)&&!e.has(`expression`)&&this._applyExternalExpression()}render(){return this.display===`text`?this._renderTextFormula():this._renderPillFormula()}_renderPillFormula(){return E`<span class="formula-pills" part="formula">${this._renderPillNodes(this._rootContent)}</span>`}_renderPillNodes(e){let t=[],n=new RegExp(ji.source,`gm`),r=0,i;for(;(i=n.exec(e))!==null;){i.index>r&&t.push(this._renderOperatorText(e.slice(r,i.index)));let a=i[2],o=i[3];a?t.push(this._renderColumnPill(a)):o&&t.push(this._renderAggregationPill(o)),r=n.lastIndex}return r<e.length&&t.push(this._renderOperatorText(e.slice(r))),t}_renderOperatorText(e){return E`<span class="formula-operator">${e}</span>`}_renderColumnPill(t){let[n,r]=t.split(`:`),i=this._datasets.find(e=>e.id===n)?.columns.find(e=>e.columnId===r);if(this._store.loading&&!i){let t=e(`Loading column`,{desc:`Accessible label for a column pill whose label is still loading`});return E`<span class="column-pill-wrapper"
|
|
10
|
-
><span class="column-pill" title=${
|
|
8
|
+
<span>${n?t(`Formula`,{desc:`Label for the formula type`}):t(`Expression`,{desc:`Label for the expression type`})}</span>
|
|
9
|
+
</span>`},to=(e,t)=>{let n={type:e.type,datasetId:e.datasetId,set:e.datasetId};`columnId`in e&&!_(e.columnId)&&e.columnId!==``?(n.columnId=e.columnId,n.column=e.columnId):`formulaId`in e&&!_(e.formulaId)&&e.formulaId!==``?(n.formulaId=e.formulaId,n.formula=e.formulaId):`formula`in e&&typeof e.formula==`string`&&e.formula!==``&&(n.formula=e.formula);let r=e.type===`datetime`||e.type===`array[datetime]`,i={...e.name??{en:`Untitled`}},a=e.level;if(r&&(a=a??e.lowestLevel??9,t)){let e=Nn.shortLevels?.filter(e=>e!==`All`)??[],t=e[Math.max(0,Math.min(e.length-1,(a??1)-1))];if(t){let e=`(${t})`,n=Object.keys(i);for(let t of n)i[t]=`${i[t]} ${e}`}}return n.label=i,_(e.subtype)||(n.subtype=e.subtype),`lowestLevel`in e&&!_(e.lowestLevel)&&(n.lowestLevel=e.lowestLevel),_(e.format)||(n.format=e.format),_(a)||(n.level=a),_(e.lowestLevel)||(n.lowestLevel=e.lowestLevel),e.type===`numeric`&&e.subtype===`currency`&&e.currency?.symbol&&(n.currency=e.currency.symbol),Array.isArray(e.duration_levels)&&e.duration_format&&(n.duration={levels:e.duration_levels,format:e.duration_format}),n};function no(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}function ro(e){return`##AGGR-${e}##`}function io(e,t){let{aggregationFunction:n,content:r,grouping:i,includedColumns:a,excludedColumns:o}=e??{},s=`${n}(${t[n]?.arity>0?r:``})`;switch(i){case H.GROUPFULL:return`GROUPFULL(${s})`;case H.GROUPINEX:return`GROUPINEX(${s}, [${a?.map(e=>`{${e}}`).join(`, `)||``}], [${o?.map(e=>`{${e}}`).join(`, `)||``}])`;default:return s}}function ao(e){let t=e.split(``),n=null;for(let e=0;e<t.length;e++){let r=t[e];n?r===n?n=null:t[e]=` `:(r===`'`||r===`"`)&&(n=r)}return t.join(``)}function oo(e,t=0){let n=0,r=-1,i=null;for(let a=t,o=e.length;a<o;a++){let t=e[a];if(i)t===i&&(i=null);else if(t===`'`||t===`"`)i=t;else if(t===`(`)n++;else if(t===`)`){if(n===0){r=a;break}n--}}return r}function so(e){let t=e.match(Fi),n=t?.[0],r=t?.[1];return{includedColumns:n?.match(Ii)?.map(e=>e.slice(1,-1))??[],excludedColumns:r?.match(Ii)?.map(e=>e.slice(1,-1))??[]}}function co(e=`light`){return!e||e===`light`?[`#0E89E0`,`#F45000`,`#15BF49`,`#685AC2`,`#636363`]:[`#BDDCF9`,`#FFCFA1`,`#C1F3B7`,`#D7D7EF`,`#D7D7EF`]}function lo(e){let t=co(`light`),n=e.length>1;return e.map((e,r)=>{let i=[];return`dataFields`in e&&Array.isArray(e.dataFields)&&e.dataFields.length>0?i=e.dataFields.filter(e=>!!e.columnId):`columns`in e&&Array.isArray(e.columns)&&(i=e.columns.map(t=>{let n=`columnId`in t&&typeof t.columnId==`string`?t.columnId:`id`in t&&typeof t.id==`string`?t.id:void 0;if(n)return{...t,columnId:n,datasetId:e.id}}).filter(e=>!!e)),{id:e.id,name:e.name,description:`description`in e?e.description:void 0,color:n?t[r%t.length]:void 0,columns:i}})}var J=class extends n(y(p,{validSizes:[`s`,`m`,`l`,`xl`]})){constructor(){super(),this.expression=``,this.datasetsDataFields=[],this.datasetIds=[],this.apiUrl=`https://api.luzmo.com`,this.showAggregations=!0,this.contentLanguage=`en`,this.multiStageAggregation=!0,this.nestedAggregation=!0,this._datasets=[],this._codeMirrorLoaded=Ui(),this._rootContent=``,this._lastEmittedExpression=null,this._applyingExternalExpression=!1,this._handleWidgetsChanged=()=>{this._recomputeExpression()},this._store=this._createStore()}connectedCallback(){super.connectedCallback(),this._store.addEventListener(`widgets-changed`,this._handleWidgetsChanged)}disconnectedCallback(){super.disconnectedCallback(),this._store.removeEventListener(`widgets-changed`,this._handleWidgetsChanged),this._emitTimer&&clearTimeout(this._emitTimer)}firstUpdated(e){super.firstUpdated(e),this._pushRootContent()}updated(e){super.updated(e),e.has(`_codeMirrorLoaded`)&&this._codeMirrorLoaded&&this._pushRootContent()}_pushRootContent(){this._rootContent&&this._codeMirrorElement?.setContent(this._rootContent)}get _codeMirrorElement(){return this.renderRoot?.querySelector(`luzmo-formula-codemirror`)}async _ensureCodeMirrorLoaded(){this._codeMirrorLoaded||=(await Hi(),!0)}willUpdate(e){super.willUpdate(e),this._shouldLoadInput()&&this._ensureCodeMirrorLoaded(),(e.has(`multiStageAggregation`)||e.has(`nestedAggregation`)||e.has(`contentLanguage`)||e.has(`size`))&&(this._store.multiStageAggregation=this.multiStageAggregation,this._store.nestedAggregation=this.nestedAggregation,this._store.contentLanguage=this.contentLanguage,this._store.size=this.size),(e.has(`datasetsDataFields`)||e.has(`datasetIds`)||e.has(`apiUrl`)||e.has(`authKey`)||e.has(`authToken`))&&this._loadDatasets(),e.has(`showAggregations`)&&this._rebuildAutoCompletion(),e.has(`expression`)&&this._applyExternalExpression()}async _loadDatasets(){if(this.datasetsDataFields.length===0&&this.datasetIds.length===0)this._datasets=[],this._store.datasets=[],this._store.refreshDecorations(),this._setLoading(!1),this._rebuildAutoCompletion();else if(this.datasetsDataFields.length>0)this._datasets=lo(this.datasetsDataFields),this._store.datasets=this._datasets,this._store.refreshDecorations(),this._setLoading(!1),this._rebuildAutoCompletion();else if(this.datasetIds.length>0){this._setLoading(!0);try{let e=await u(this.datasetIds,{dataBrokerConfig:{apiUrl:this.apiUrl,authKey:this.authKey,authToken:this.authToken}});this._datasets=lo(e),this._store.datasets=this._datasets,this._store.refreshDecorations(),this._rebuildAutoCompletion()}catch(e){console.warn(`[${this.localName}] Failed to load datasets:`,e),this.dispatchEvent(new CustomEvent(`luzmo-datasets-error`,{bubbles:!0,composed:!0,detail:{error:e}}))}finally{this._setLoading(!1)}}}_rebuildAutoCompletion(){}_syncExpressionToStore(){return this.expression===this._lastEmittedExpression?null:(this._store.clearWidgets(),this._rootContent=this.multiStageAggregation?this._store.transformToAggregationWidgetSyntax(this.expression):this.expression,this._rootContent)}_applyExternalExpression(){this._applyingExternalExpression=!0;try{this._syncExpressionToStore()}finally{this._applyingExternalExpression=!1}}_recomputeExpression(){if(this._applyingExternalExpression||!this._canEmitExpression())return;let e=this.multiStageAggregation?this._store.transformToAggregationFunctionSyntax(this._rootContent):this._rootContent;this._emitTimer&&clearTimeout(this._emitTimer),this._emitTimer=setTimeout(()=>this._onExpressionComputed(e),this._emitDebounceMs)}_emitExpressionChanged(e){this._lastEmittedExpression=e,this.dispatchEvent(new CustomEvent(`luzmo-expression-changed`,{bubbles:!0,composed:!0,detail:{expression:e}}))}_shouldLoadInput(){return!0}_canEmitExpression(){return!0}get _emitDebounceMs(){return 300}_onExpressionComputed(e){e!==this._lastEmittedExpression&&this._emitExpressionChanged(e)}_setLoading(e){}};e([O({type:String})],J.prototype,`expression`,void 0),e([O({attribute:!1})],J.prototype,`datasetsDataFields`,void 0),e([O({type:Array,attribute:`dataset-ids`})],J.prototype,`datasetIds`,void 0),e([O({type:String,attribute:`api-url`})],J.prototype,`apiUrl`,void 0),e([O({type:String,attribute:`auth-key`})],J.prototype,`authKey`,void 0),e([O({type:String,attribute:`auth-token`})],J.prototype,`authToken`,void 0),e([O({type:Boolean,attribute:`show-aggregations`,reflect:!0})],J.prototype,`showAggregations`,void 0),e([O({type:String,attribute:`content-language`,reflect:!0})],J.prototype,`contentLanguage`,void 0),e([O({type:Boolean,attribute:`multi-stage-aggregation`})],J.prototype,`multiStageAggregation`,void 0),e([O({type:Boolean,attribute:`nested-aggregation`})],J.prototype,`nestedAggregation`,void 0),e([k()],J.prototype,`_datasets`,void 0),e([k()],J.prototype,`_codeMirrorLoaded`,void 0);function uo(){let e=2026;return{"+":{type:`infix`,arity:2,label:()=>t(`Addition`,{desc:`Formula function label for addition`}),description:()=>t(`Adds two numeric values.`,{desc:`Formula function description for addition operator`}),example:()=>`42.0 + ⟨numeric⟩ Average burrito price`,exampleHasIcons:!0},"-":{type:`infix`,arity:2,label:()=>t(`Difference`,{desc:`Formula function label for subtraction`}),description:()=>t(`Subtracts the second value from the first value.`,{desc:`Formula function description for subtraction operator`}),example:()=>`⟨numeric⟩ Burrito weight - 42`,exampleHasIcons:!0},"*":{type:`infix`,arity:2,label:()=>t(`Multiplication`,{desc:`Formula function label for multiplication`}),description:()=>t(`Multiplies two numeric values.`,{desc:`Formula function description for multiplication operator`}),example:()=>`⟨numeric⟩ Number of burritos * 2`,exampleHasIcons:!0},"/":{type:`infix`,arity:2,label:()=>t(`Division`,{desc:`Formula function label for division`}),description:()=>t(`Divides the first numeric value by the second numeric value.`,{desc:`Formula function description for division operator`}),example:()=>`⟨numeric⟩ Number of burritos / 2`,exampleHasIcons:!0},"%":{type:`infix`,arity:2,label:()=>t(`Modulo`,{desc:`Formula function label for modulo`}),description:()=>t(`Returns the remainder after dividing the first value by the second value.`,{desc:`Formula function description for modulo operator`}),example:()=>`5 % 2`},">":{type:`infix`,arity:2,label:()=>t(`Greater than`,{desc:`Formula function label for greater than comparison`}),description:()=>t(`Checks whether the first value is greater than the second value.`,{desc:`Formula function description for greater than operator`}),example:()=>`⟨numeric⟩ Burrito weight > 50`,exampleHasIcons:!0},"<":{type:`infix`,arity:2,label:()=>t(`Less than`,{desc:`Formula function label for less than comparison`}),description:()=>t(`Checks whether the first value is less than the second value.`,{desc:`Formula function description for less than operator`}),example:()=>`⟨numeric⟩ Burrito weight < 50`,exampleHasIcons:!0},">=":{type:`infix`,arity:2,label:()=>t(`Greater than or equal`,{desc:`Formula function label for greater than or equal comparison`}),description:()=>t(`Checks whether the first value is greater than or equal to the second value.`,{desc:`Formula function description for greater than or equal operator`}),example:()=>`⟨numeric⟩ Burrito weight >= 50`,exampleHasIcons:!0},"<=":{type:`infix`,arity:2,label:()=>t(`Less than or equal`,{desc:`Formula function label for less than or equal comparison`}),description:()=>t(`Checks whether the first value is less than or equal to the second value.`,{desc:`Formula function description for less than or equal operator`}),example:()=>`⟨numeric⟩ Burrito weight <= 50`,exampleHasIcons:!0},"=":{type:`infix`,arity:2,label:()=>t(`Equal`,{desc:`Formula function label for equality comparison`}),description:()=>t(`Checks whether both values are equal.`,{desc:`Formula function description for equality operator`}),example:()=>`⟨hierarchy⟩ Burrito type = 'Savoury'`,exampleHasIcons:!0},"<>":{type:`infix`,arity:2,label:()=>t(`Not equal`,{desc:`Formula function label for inequality comparison`}),description:()=>t(`Checks whether two values are different.`,{desc:`Formula function description for inequality operator`}),example:()=>`⟨hierarchy⟩ Burrito type <> 'Sweet'`,exampleHasIcons:!0},ABS:{type:`prefix`,arity:1,label:()=>t(`Absolute value`,{desc:`Formula function label for ABS`}),description:()=>t(`Returns the absolute value of a number.`,{desc:`Formula function description for ABS`}),example:()=>`ABS(-5.0)`},CEIL:{type:`prefix`,arity:1,label:()=>t(`Round up`,{desc:`Formula function label for CEIL`}),description:()=>t(`Rounds a number up to the nearest integer.`,{desc:`Formula function description for CEIL`}),example:()=>`CEIL(11.3)`},E:{type:`prefix`,arity:0,label:()=>t(`Euler's number`,{desc:`Formula function label for E`}),description:()=>t(`Returns Euler's constant e.`,{desc:`Formula function description for E`}),example:()=>`E()`},EXP:{type:`prefix`,arity:1,label:()=>t(`Exponential`,{desc:`Formula function label for EXP`}),description:()=>t(`Returns e raised to the specified power.`,{desc:`Formula function description for EXP`}),example:()=>`EXP(11.3)`},FLOOR:{type:`prefix`,arity:1,label:()=>t(`Round down`,{desc:`Formula function label for FLOOR`}),description:()=>t(`Rounds a number down to the nearest integer.`,{desc:`Formula function description for FLOOR`}),example:()=>`FLOOR(11.7)`},LN:{type:`prefix`,arity:1,label:()=>t(`Natural logarithm`,{desc:`Formula function label for LN`}),description:()=>t(`Returns the natural logarithm of a number.`,{desc:`Formula function description for LN`}),example:()=>`LN(11.7)`},LOG:{type:`prefix`,arity:2,label:()=>t(`Logarithm`,{desc:`Formula function label for LOG`}),description:()=>t(`Returns the logarithm of a number for a specific base.`,{desc:`Formula function description for LOG`}),example:()=>`LOG(3.6, 10)`},PI:{type:`prefix`,arity:0,label:()=>t(`Pi`,{desc:`Formula function label for PI`}),description:()=>t(`Returns the mathematical constant pi.`,{desc:`Formula function description for PI`}),example:()=>`PI()`},POW:{type:`prefix`,arity:2,label:()=>t(`Power`,{desc:`Formula function label for POW`}),description:()=>t(`Raises a number to a given power.`,{desc:`Formula function description for POW`}),example:()=>`POW(2.35, 2)`},RAND:{type:`prefix`,arity:0,label:()=>t(`Random number`,{desc:`Formula function label for RAND`}),description:()=>t(`Returns a random number between 0 and 1.`,{desc:`Formula function description for RAND`}),example:()=>`RAND()`},ROUND:{type:`prefix`,arity:2,label:()=>t(`Round`,{desc:`Formula function label for ROUND`}),description:()=>t(`Rounds a number to a specified number of decimal places.`,{desc:`Formula function description for ROUND`}),example:()=>`ROUND(4.567, 1)`},SQRT:{type:`prefix`,arity:1,label:()=>t(`Square root`,{desc:`Formula function label for SQRT`}),description:()=>t(`Returns the square root of a number.`,{desc:`Formula function description for SQRT`}),example:()=>`SQRT(4)`},CAST:{type:`prefix`,arity:2,label:()=>t(`Convert value`,{desc:`Formula function label for CAST`}),description:()=>t(`Converts the first argument to the type given by the second argument. Possible types are 'hierarchy', 'numeric', 'datetime' and 'boolean'.`,{desc:`Formula function description for CAST`}),example:()=>`CAST(⟨numeric⟩ Burrito weight, hierarchy)`,exampleHasIcons:!0},IF:{type:`prefix`,arity:3,label:()=>t(`If`,{desc:`Formula function label for IF`}),description:()=>t(`Returns one value when a condition is true and another value when false.`,{desc:`Formula function description for IF`}),example:()=>`IF(⟨numeric⟩ Burrito weight < 200,'Small','Large')`,exampleHasIcons:!0},COALESCE:{type:`prefix`,arity:2,label:()=>t(`Is empty`,{desc:`Formula function label for COALESCE`}),description:()=>t(`Returns the first non-null value from the provided arguments.`,{desc:`Formula function description for COALESCE`}),example:()=>`COALESCE(⟨hierarchy⟩ Burrito type, 'Unknown type')`,exampleHasIcons:!0},AND:{type:`infix`,arity:2,label:()=>t(`Logical and`,{desc:`Formula function label for AND`}),description:()=>t(`Returns true when both conditions are true.`,{desc:`Formula function description for AND`}),example:()=>`Burrito weight > 50 AND Burrito weight < 75`},OR:{type:`infix`,arity:2,label:()=>t(`Logical or`,{desc:`Formula function label for OR`}),description:()=>t(`Returns true when at least one condition is true.`,{desc:`Formula function description for OR`}),example:()=>`Burrito price > 10.1 OR Burrito weight >= 50`},NOT:{type:`prefix_op`,arity:1,label:()=>t(`Logical not`,{desc:`Formula function label for NOT`}),description:()=>t(`Negates a boolean condition.`,{desc:`Formula function description for NOT`}),example:()=>`NOT (Burrito type = 'Salty')`},SIN:{type:`prefix`,arity:1,label:()=>t(`Sine`,{desc:`Formula function label for SIN`}),description:()=>t(`Returns the sine of an angle in radians.`,{desc:`Formula function description for SIN`}),example:()=>`SIN(3.14)`},COS:{type:`prefix`,arity:1,label:()=>t(`Cosine`,{desc:`Formula function label for COS`}),description:()=>t(`Returns the cosine of an angle in radians.`,{desc:`Formula function description for COS`}),example:()=>`COS(3.14)`},TAN:{type:`prefix`,arity:1,label:()=>t(`Tangent`,{desc:`Formula function label for TAN`}),description:()=>t(`Returns the tangent of an angle in radians.`,{desc:`Formula function description for TAN`}),example:()=>`TAN(3.14)`},ASIN:{type:`prefix`,arity:1,label:()=>t(`Arcsine`,{desc:`Formula function label for ASIN`}),description:()=>t(`Returns the arcsine of a number.`,{desc:`Formula function description for ASIN`}),example:()=>`ASIN(3.14)`},ACOS:{type:`prefix`,arity:1,label:()=>t(`Arccosine`,{desc:`Formula function label for ACOS`}),description:()=>t(`Returns the arccosine of a number.`,{desc:`Formula function description for ACOS`}),example:()=>`ACOS(3.14)`},ATAN:{type:`prefix`,arity:1,label:()=>t(`Arctangent`,{desc:`Formula function label for ATAN`}),description:()=>t(`Returns the arctangent of a number.`,{desc:`Formula function description for ATAN`}),example:()=>`ATAN(3.14)`},SINH:{type:`prefix`,arity:1,label:()=>t(`Hyperbolic sine`,{desc:`Formula function label for SINH`}),description:()=>t(`Returns the hyperbolic sine of a number.`,{desc:`Formula function description for SINH`}),example:()=>`SINH(3.14)`},COSH:{type:`prefix`,arity:1,label:()=>t(`Hyperbolic cosine`,{desc:`Formula function label for COSH`}),description:()=>t(`Returns the hyperbolic cosine of a number.`,{desc:`Formula function description for COSH`}),example:()=>`COSH(3.14)`},TANH:{type:`prefix`,arity:1,label:()=>t(`Hyperbolic tangent`,{desc:`Formula function label for TANH`}),description:()=>t(`Returns the hyperbolic tangent of a number.`,{desc:`Formula function description for TANH`}),example:()=>`TANH(3.14)`},MEAN:{type:`prefix`,arity:1,label:()=>t(`Mean`,{desc:`Formula function label for MEAN`}),description:()=>t(`Returns the arithmetic mean of all values in a numeric column. The value is calculated over the entire dataset and does not change when filtering.`,{desc:`Formula function description for MEAN`}),example:()=>`MEAN(⟨numeric⟩ Burrito weight)`,exampleHasIcons:!0},STDDEV:{type:`prefix`,arity:1,label:()=>t(`Standard deviation`,{desc:`Aggregation label`}),description:()=>t(`Returns the sample standard deviation over all values in a numeric column. The value is calculated over the entire dataset and does not change when filtering.`,{desc:`Formula function description for STDDEV`}),example:()=>`STDDEV(⟨numeric⟩ Burrito weight)`,exampleHasIcons:!0},"||":{type:`infix`,arity:2,label:()=>t(`Concatenate`,{desc:`Formula function label for concatenate operator`}),description:()=>t(`Concatenates two strings.`,{desc:`Formula function description for concatenate operator`}),example:()=>`'Tasty' || ' burrito'`},LENGTH:{type:`prefix`,arity:1,label:()=>t(`String length`,{desc:`Formula function label for LENGTH`}),description:()=>t(`Returns the number of characters in a string.`,{desc:`Formula function description for LENGTH`}),example:()=>`LENGTH('Burrito')`},LOWER:{type:`prefix`,arity:1,label:()=>t(`Lowercase`,{desc:`Formula function label for LOWER`}),description:()=>t(`Converts a string to lowercase.`,{desc:`Formula function description for LOWER`}),example:()=>`LOWER('BURRITO')`},UPPER:{type:`prefix`,arity:1,label:()=>t(`Uppercase`,{desc:`Formula function label for UPPER`}),description:()=>t(`Converts a string to uppercase.`,{desc:`Formula function description for UPPER`}),example:()=>`UPPER('burrito')`},LTRIM:{type:`prefix`,arity:1,label:()=>t(`Trim left`,{desc:`Formula function label for LTRIM`}),description:()=>t(`Removes leading spaces from a string.`,{desc:`Formula function description for LTRIM`}),example:()=>`LTRIM(' Burrito')`},RTRIM:{type:`prefix`,arity:1,label:()=>t(`Trim right`,{desc:`Formula function label for RTRIM`}),description:()=>t(`Removes trailing spaces from a string.`,{desc:`Formula function description for RTRIM`}),example:()=>`RTRIM('Burrito ')`},TRIM:{type:`prefix`,arity:1,label:()=>t(`Trim`,{desc:`Formula function label for TRIM`}),description:()=>t(`Removes leading and trailing spaces from a string.`,{desc:`Formula function description for TRIM`}),example:()=>`TRIM('Burrito ')`},REPLACE:{type:`prefix`,arity:3,label:()=>t(`Replace text`,{desc:`Formula function label for REPLACE`}),description:()=>t(`Replaces occurrences of a substring with another substring.`,{desc:`Formula function description for REPLACE`}),example:()=>`REPLACE('Sweet burrito','Sweet', 'Savoury')`},STRPOS:{type:`prefix`,arity:2,label:()=>t(`Find substring`,{desc:`Formula function label for STRPOS`}),description:()=>t(`Returns the position of a substring in a string.`,{desc:`Formula function description for STRPOS`}),example:()=>`STRPOS('Sweet burrito','burrito')`},SUBSTR:{type:`prefix`,arity:3,label:()=>t(`Take substring`,{desc:`Formula function label for SUBSTR`}),description:()=>t(`Extracts part of a string. The first argument is the text, the second the starting position (the first character is 1; a negative position counts from the end), and the third the length.`,{desc:`Formula function description for SUBSTR`}),example:()=>`SUBSTR('Sweet burrito',7,3)`},SPLIT_PART:{type:`prefix`,arity:3,label:()=>t(`Split part`,{desc:`Formula function label for SPLIT_PART`}),description:()=>t(`Splits a string into parts using a delimiter. The first argument is the text to split, the second the delimiter, and the third the position of the part to return (starting from 1).`,{desc:`Formula function description for SPLIT_PART`}),example:()=>`SPLIT_PART('Sweet burrito', ' ', 2)`},NOW:{type:`prefix`,arity:0,label:()=>t(`Current date and time`,{desc:`Formula function label for NOW`}),description:()=>t(`Returns the current date and time.`,{desc:`Formula function description for NOW`}),example:()=>`NOW()`},YEAR:{type:`prefix`,arity:1,label:()=>t(`Year`,{desc:`Time unit`}),description:()=>t(`Extracts the year from a date value.`,{desc:`Formula function description for YEAR`}),example:()=>`YEAR('${e}-02-17')`},YEAR_UTC:{type:`prefix`,arity:1,label:()=>t(`Year (UTC)`,{desc:`Formula function label for YEAR_UTC`}),description:()=>t(`Extracts the year from a date value in UTC.`,{desc:`Formula function description for YEAR_UTC`}),example:()=>`YEAR_UTC('${e}-02-17')`},QUARTER:{type:`prefix`,arity:1,label:()=>t(`Quarter`,{desc:`Time unit`}),description:()=>t(`Extracts the quarter from a date value.`,{desc:`Formula function description for QUARTER`}),example:()=>`QUARTER('${e}-02-17')`},QUARTER_UTC:{type:`prefix`,arity:1,label:()=>t(`Quarter (UTC)`,{desc:`Formula function label for QUARTER_UTC`}),description:()=>t(`Extracts the quarter from a date value in UTC.`,{desc:`Formula function description for QUARTER_UTC`}),example:()=>`QUARTER_UTC('${e}-02-17')`},MONTH:{type:`prefix`,arity:1,label:()=>t(`Month`,{desc:`Time unit`}),description:()=>t(`Extracts the month from a date or datetime value.`,{desc:`Formula function description for MONTH`}),example:()=>`MONTH('${e}-02-17 15:36:59')`},MONTH_UTC:{type:`prefix`,arity:1,label:()=>t(`Month (UTC)`,{desc:`Formula function label for MONTH_UTC`}),description:()=>t(`Extracts the month from a date or datetime value in UTC.`,{desc:`Formula function description for MONTH_UTC`}),example:()=>`MONTH_UTC('${e}-02-17 15:36:59')`},WEEK:{type:`prefix`,arity:1,label:()=>t(`Week`,{desc:`Time unit`}),description:()=>t(`Extracts the ISO 8601 week number (1-53) from a date or datetime value.`,{desc:`Formula function description for WEEK`}),example:()=>`WEEK('${e}-02-17 15:36:59')`},WEEK_UTC:{type:`prefix`,arity:1,label:()=>t(`Week (UTC)`,{desc:`Formula function label for WEEK_UTC`}),description:()=>t(`Extracts the ISO 8601 week number (1-53) from a date or datetime value in UTC.`,{desc:`Formula function description for WEEK_UTC`}),example:()=>`WEEK_UTC('${e}-02-17 15:36:59')`},DAY:{type:`prefix`,arity:1,label:()=>t(`Day of month`,{desc:`Formula function label for DAY`}),description:()=>t(`Extracts the day of month from a date or datetime value.`,{desc:`Formula function description for DAY`}),example:()=>`DAY('${e}-02-17 15:36:59')`},DAY_UTC:{type:`prefix`,arity:1,label:()=>t(`Day of month (UTC)`,{desc:`Formula function label for DAY_UTC`}),description:()=>t(`Extracts the day of month from a date or datetime value in UTC.`,{desc:`Formula function description for DAY_UTC`}),example:()=>`DAY_UTC('${e}-02-17 15:36:59')`},DAY_OF_WEEK:{type:`prefix`,arity:1,label:()=>t(`Day of week`,{desc:`Formula function label for DAY_OF_WEEK`}),description:()=>t(`Extracts the day of week (1-7, where 1 is Monday) from a date or datetime value.`,{desc:`Formula function description for DAY_OF_WEEK`}),example:()=>`DAY_OF_WEEK('${e}-02-17 15:36:59')`},DAY_OF_WEEK_UTC:{type:`prefix`,arity:1,label:()=>t(`Day of week (UTC)`,{desc:`Formula function label for DAY_OF_WEEK_UTC`}),description:()=>t(`Extracts the day of week (1-7, where 1 is Monday) from a date or datetime value in UTC.`,{desc:`Formula function description for DAY_OF_WEEK_UTC`}),example:()=>`DAY_OF_WEEK_UTC('${e}-02-17 15:36:59')`},DAY_OF_YEAR:{type:`prefix`,arity:1,label:()=>t(`Day of year`,{desc:`Formula function label for DAY_OF_YEAR`}),description:()=>t(`Extracts the day of year from a date or datetime value.`,{desc:`Formula function description for DAY_OF_YEAR`}),example:()=>`DAY_OF_YEAR('${e}-02-17 15:36:59')`},DAY_OF_YEAR_UTC:{type:`prefix`,arity:1,label:()=>t(`Day of year (UTC)`,{desc:`Formula function label for DAY_OF_YEAR_UTC`}),description:()=>t(`Extracts the day of year from a date or datetime value in UTC.`,{desc:`Formula function description for DAY_OF_YEAR_UTC`}),example:()=>`DAY_OF_YEAR_UTC('${e}-02-17 15:36:59')`},YEAR_OF_WEEK:{type:`prefix`,arity:1,label:()=>t(`Year of ISO week`,{desc:`Formula function label for YEAR_OF_WEEK`}),description:()=>t(`Extracts the ISO week-numbering year from a date or datetime value.`,{desc:`Formula function description for YEAR_OF_WEEK`}),example:()=>`YEAR_OF_WEEK('${e}-02-17 15:36:59')`},YEAR_OF_WEEK_UTC:{type:`prefix`,arity:1,label:()=>t(`Year of ISO week (UTC)`,{desc:`Formula function label for YEAR_OF_WEEK_UTC`}),description:()=>t(`Extracts the ISO week-numbering year from a date or datetime value in UTC.`,{desc:`Formula function description for YEAR_OF_WEEK_UTC`}),example:()=>`YEAR_OF_WEEK_UTC('${e}-02-17 15:36:59')`},HOUR:{type:`prefix`,arity:1,label:()=>t(`Hour`,{desc:`Time unit`}),description:()=>t(`Extracts the hour from a datetime value.`,{desc:`Formula function description for HOUR`}),example:()=>`HOUR('${e}-02-17 15:36:59')`},HOUR_UTC:{type:`prefix`,arity:1,label:()=>t(`Hour (UTC)`,{desc:`Formula function label for HOUR_UTC`}),description:()=>t(`Extracts the hour from a datetime value in UTC.`,{desc:`Formula function description for HOUR_UTC`}),example:()=>`HOUR_UTC('${e}-02-17 15:36:59')`},MINUTE:{type:`prefix`,arity:1,label:()=>t(`Minute`,{desc:`Time unit`}),description:()=>t(`Extracts the minute from a datetime value.`,{desc:`Formula function description for MINUTE`}),example:()=>`MINUTE('${e}-02-17 15:36:59')`},MINUTE_UTC:{type:`prefix`,arity:1,label:()=>t(`Minute (UTC)`,{desc:`Formula function label for MINUTE_UTC`}),description:()=>t(`Extracts the minute from a datetime value in UTC.`,{desc:`Formula function description for MINUTE_UTC`}),example:()=>`MINUTE_UTC('${e}-02-17 15:36:59')`},SECOND:{type:`prefix`,arity:1,label:()=>t(`Second`,{desc:`Time unit`}),description:()=>t(`Extracts the second from a datetime value.`,{desc:`Formula function description for SECOND`}),example:()=>`SECOND('${e}-02-17 15:36:59')`},SECOND_UTC:{type:`prefix`,arity:1,label:()=>t(`Second (UTC)`,{desc:`Formula function label for SECOND_UTC`}),description:()=>t(`Extracts the second from a datetime value in UTC.`,{desc:`Formula function description for SECOND_UTC`}),example:()=>`SECOND_UTC('${e}-02-17 15:36:59')`},DATE_ADD:{type:`prefix`,arity:3,label:()=>t(`Add/subtract duration`,{desc:`Formula function label for DATE_ADD`}),description:()=>t(`Adds a duration to (or subtracts it from) a date or datetime value. The first argument is the unit ('millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'quarter' or 'year'), the second the number of units to add (negative to subtract), and the third the date or datetime to start from.`,{desc:`Formula function description for DATE_ADD`}),example:()=>`DATE_ADD('hour', 2, ⟨datetime⟩ Arrival time)`,exampleHasIcons:!0},DATE_DIFF:{type:`prefix`,arity:3,label:()=>t(`Difference between dates`,{desc:`Formula function label for DATE_DIFF`}),description:()=>t(`Returns the difference between two dates or datetimes in the selected unit. The first argument is the unit ('millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'quarter' or 'year'); the difference is calculated from the second date towards the third date.`,{desc:`Formula function description for DATE_DIFF`}),example:()=>`DATE_DIFF('day', ⟨datetime⟩ Arrival date, '${e}-02-17 15:36:59')`,exampleHasIcons:!0},COORDS:{type:`prefix`,arity:3,label:()=>t(`Coordinates`,{id:`formula-function-label-coords`,desc:`Formula function label for COORDS`}),description:()=>t(`Builds a geography value from latitude, longitude, and spatial reference.`,{desc:`Formula function description for COORDS`}),example:()=>`COORDS(⟨numeric⟩ Latitude, ⟨numeric⟩ Longitude, 'wgs84')`,exampleHasIcons:!0}}}var fo=class extends EventTarget{constructor(...e){super(...e),this.functionDataMap=uo(),this.aggregationFunctionDataMap=Ri(),this.multiStageAggregation=!0,this.nestedAggregation=!0,this.readonly=!1,this.contentLanguage=`en`,this.size=`m`,this.datasets=[],this.loading=!1,this.lastFocusedAggregationWidgetId=null,this.lastFocusedEmptyArgumentId=null,this.pendingFocusAggregationWidgetId=null,this._aggregationWidgets=[]}get aggregationWidgets(){return this._aggregationWidgets}addWidgets(e){e&&e.length!==0&&(this._aggregationWidgets=[...this._aggregationWidgets,...e],this._notifyWidgetsChanged())}removeWidgets(e){this._aggregationWidgets=this._aggregationWidgets.filter(({widgetId:t})=>!e.includes(t)),this._notifyWidgetsChanged()}updateWidget(e){this._aggregationWidgets=this._aggregationWidgets.map(t=>t.widgetId===e.widgetId?e:t),this._notifyWidgetsChanged()}getWidget(e){return this._aggregationWidgets.find(t=>t.widgetId===e)}clearWidgets(){this._aggregationWidgets.length!==0&&(this._aggregationWidgets=[],this._notifyWidgetsChanged())}_notifyWidgetsChanged(){this.dispatchEvent(new CustomEvent(`widgets-changed`))}setReadonly(e){this.readonly!==e&&(this.readonly=e,this.dispatchEvent(new CustomEvent(`widgets-changed`)))}setLoading(e){this.loading!==e&&(this.loading=e,this.refreshDecorations())}refreshDecorations(){this.dispatchEvent(new CustomEvent(`refresh-decorations`))}_markAggregationForFocus(e){let t=e[0];t&&(this.aggregationFunctionDataMap[t.aggregationFunction]?.arity??0)>0&&(this.pendingFocusAggregationWidgetId=t.widgetId)}transformToAggregationWidgetSyntax(e){let t=ao(e).match(Ni);if(!t)return e;let n=!!t[1],r=t.index??0,i=oo(e,r+(n?t[1].length:t[0].length)-1+1),a=oo(e,r+t[0].length);if(i===-1)return e;let o=e.slice(r+t[0].length,a),s=this.transformToAggregationWidgetSyntax(o),c={widgetId:no(),grouping:t[2]??H.GROUP,aggregationFunction:t[3],content:s};if(c.grouping===H.GROUPINEX){let{includedColumns:t,excludedColumns:n}=so(e.slice(a+1,i));c.includedColumns=t,c.excludedColumns=n}let l=ro(c.widgetId),u=`${e.slice(0,r)}${l}${e.slice(i+1)}`;return this.addWidgets([c]),this.transformToAggregationWidgetSyntax(u)}transformToAggregationFunctionSyntax(e){let t=e.match(Pi);if(!t)return e;let n=t.index??0,r=n+t[0].length-1,i=t[1],a=this.getWidget(i),o=a?this.transformToAggregationFunctionSyntax(io(a,this.aggregationFunctionDataMap)):``,s=`${e.slice(0,n)}${o}${e.slice(r+1)}`;return this.transformToAggregationFunctionSyntax(s)}},po=`:host{box-sizing:border-box;font-family:var(--luzmo-font-family);color:var(--luzmo-font-color);display:inline-block}.formula-text{font-size:var(--luzmo-formula-font-size,var(--luzmo-font-size));white-space:pre-wrap;word-break:break-word;line-height:1.5}.formula-text-column{white-space:nowrap}.formula-text-column-icon{margin-inline-end:var(--luzmo-spacing-1)}.formula-pills{align-items:center;gap:var(--luzmo-spacing-1) 0;font-size:var(--luzmo-formula-font-size,var(--luzmo-font-size));flex-wrap:wrap;line-height:1.5;display:inline-flex}.formula-operator{white-space:pre-wrap}.column-pill-wrapper{vertical-align:middle;padding-inline-end:var(--luzmo-formula-column-pill-trailing-space,var(--luzmo-spacing-1));display:inline-flex}.column-pill{justify-content:center;align-items:center;gap:var(--luzmo-spacing-2);box-sizing:border-box;max-width:16rem;min-height:var(--luzmo-formula-control-height,1.375rem);padding:0 var(--luzmo-formula-column-pill-padding-inline,calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1)));border-radius:var(--luzmo-border-radius-s);background-color:var(--luzmo-formula-column-pill-background,var(--luzmo-background-color-highlight));color:var(--luzmo-font-color);white-space:nowrap;font-size:.85em;line-height:1.2;display:inline-flex}.column-pill-icon{flex:none;display:inline-flex}.column-pill-label{text-overflow:ellipsis;overflow:hidden}.column-pill-loading{--luzmo-progress-circle-size:1em;align-items:center;display:inline-flex}.agg-pill{padding-block:var(--luzmo-spacing-1);border-radius:var(--luzmo-border-radius);background-color:var(--agg-accent,var(--luzmo-primary));color:var(--luzmo-primary-inverse-color);font-size:var(--luzmo-formula-font-size,var(--luzmo-font-size));vertical-align:middle;padding-inline:0;display:inline-flex}.agg-pill-row{align-items:center;gap:var(--luzmo-spacing-1);min-height:var(--luzmo-formula-control-height,1.375rem);display:inline-flex}.agg-fn{text-transform:uppercase;padding-inline-start:var(--luzmo-spacing-3);padding-inline-end:var(--luzmo-spacing-3);font-size:.85em}.agg-value{min-height:var(--luzmo-formula-control-height,1.375rem);padding:0 var(--luzmo-spacing-2);border-radius:var(--luzmo-border-radius-s);background-color:var(--luzmo-background-color);color:var(--luzmo-font-color);--luzmo-formula-column-pill-background:transparent;--luzmo-formula-column-pill-padding-inline:0px;align-items:center;line-height:1;display:inline-flex}.agg-grouping{align-items:center;gap:var(--luzmo-spacing-1);padding-inline:var(--luzmo-spacing-2) var(--luzmo-spacing-3);font-size:var(--luzmo-formula-grouping-icon-size,var(--luzmo-icon-size-m));display:inline-flex}.agg-grouping--no-value{padding-inline-start:0}.agg-grouping-count{border-radius:var(--luzmo-border-radius-full,999rem);background:var(--luzmo-primary-inverse-color);min-width:1.25em;color:var(--agg-accent,var(--luzmo-primary));font-size:.6875rem;font-weight:var(--luzmo-font-weight-bold);justify-content:center;align-items:center;padding:0 .25em;line-height:1.4;display:inline-flex}:host{--luzmo-formula-font-size:var(--luzmo-font-size);--luzmo-formula-grouping-icon-size:var(--luzmo-icon-size-m);--luzmo-formula-control-height:calc(var(--luzmo-component-height) - 2 * var(--luzmo-spacing-1))}:host([size=s]){--luzmo-formula-font-size:var(--luzmo-font-size-s);--luzmo-formula-grouping-icon-size:var(--luzmo-icon-size-s);--luzmo-formula-control-height:calc(var(--luzmo-component-height-s) - 2 * var(--luzmo-spacing-1))}:host([size=l]){--luzmo-formula-font-size:var(--luzmo-font-size-l);--luzmo-formula-grouping-icon-size:var(--luzmo-icon-size-l);--luzmo-formula-control-height:calc(var(--luzmo-component-height-l) - 2 * var(--luzmo-spacing-1))}:host([size=xl]){--luzmo-formula-font-size:var(--luzmo-font-size-xl);--luzmo-formula-grouping-icon-size:var(--luzmo-icon-size-xl);--luzmo-formula-control-height:calc(var(--luzmo-component-height-xl) - 2 * var(--luzmo-spacing-1))}`,mo=class extends J{constructor(...e){super(...e),this.display=`rich`,this._groupingDataMap=Bi()}static{this.styles=A(po)}_createStore(){return new fo}_shouldLoadInput(){return!1}_canEmitExpression(){return!1}_applyExternalExpression(){this.display===`text`?this._rootContent=``:(this._store.clearWidgets(),this._rootContent=this._store.transformToAggregationWidgetSyntax(this.expression??``))}willUpdate(e){super.willUpdate(e),e.has(`display`)&&!e.has(`expression`)&&this._applyExternalExpression()}render(){return this.display===`text`?this._renderTextFormula():this._renderPillFormula()}_renderPillFormula(){return T`<span class="formula-pills" part="formula">${this._renderPillNodes(this._rootContent)}</span>`}_renderPillNodes(e){let t=[],n=new RegExp(ji.source,`gm`),r=0,i;for(;(i=n.exec(e))!==null;){i.index>r&&t.push(this._renderOperatorText(e.slice(r,i.index)));let a=i[2],o=i[3];a?t.push(this._renderColumnPill(a)):o&&t.push(this._renderAggregationPill(o)),r=n.lastIndex}return r<e.length&&t.push(this._renderOperatorText(e.slice(r))),t}_renderOperatorText(e){return T`<span class="formula-operator">${e}</span>`}_renderColumnPill(e){let[n,r]=e.split(`:`),i=this._datasets.find(e=>e.id===n)?.columns.find(e=>e.columnId===r);if(this._store.loading&&!i){let e=t(`Loading column`,{desc:`Accessible label for a column pill whose label is still loading`});return T`<span class="column-pill-wrapper"
|
|
10
|
+
><span class="column-pill" title=${e}
|
|
11
11
|
><span class="column-pill-loading">
|
|
12
|
-
<luzmo-progress-circle indeterminate size="s" .label=${
|
|
12
|
+
<luzmo-progress-circle indeterminate size="s" .label=${e}></luzmo-progress-circle></span
|
|
13
13
|
></span
|
|
14
|
-
></span>`}let{icon:a,label:o}=Ai(i,this.contentLanguage,r);return
|
|
14
|
+
></span>`}let{icon:a,label:o}=Ai(i,this.contentLanguage,r);return T`<span class="column-pill-wrapper"
|
|
15
15
|
><span class="column-pill" title=${o}
|
|
16
16
|
><span class="column-pill-icon">${f(a)}</span
|
|
17
17
|
><span class="column-pill-label">${o}</span></span
|
|
18
|
-
></span>`}_renderAggregationPill(e){let t=this._store.getWidget(e);if(!t)return
|
|
18
|
+
></span>`}_renderAggregationPill(e){let t=this._store.getWidget(e);if(!t)return T`${D}`;let n=this._groupingDataMap[t.grouping],r=n?.color??``,i=this._store.aggregationFunctionDataMap[t.aggregationFunction]?.arity??0,a=n?.label()??``,o=t.grouping===H.GROUPINEX?(t.includedColumns?.length??0)+(t.excludedColumns?.length??0):0;return T`<span class="agg-pill" style=${r?`--agg-accent: ${r}`:``}>
|
|
19
19
|
<span class="agg-pill-row">
|
|
20
20
|
<span class="agg-fn">${t.aggregationFunction}</span>
|
|
21
|
-
${i>0?
|
|
21
|
+
${i>0?T`<span class="agg-value">${this._renderPillNodes(t.content)}</span>`:D}
|
|
22
22
|
<span
|
|
23
23
|
class="agg-grouping${i>0?``:` agg-grouping--no-value`}"
|
|
24
24
|
title=${a}
|
|
25
25
|
aria-label=${a}
|
|
26
26
|
>
|
|
27
|
-
${n?.icon?f(n.icon):
|
|
28
|
-
${o>0?
|
|
27
|
+
${n?.icon?f(n.icon):D}
|
|
28
|
+
${o>0?T`<span class="agg-grouping-count">${o}</span>`:D}
|
|
29
29
|
</span>
|
|
30
30
|
</span>
|
|
31
|
-
</span>`}_renderTextFormula(){let e=this.expression??``,t=[],n=new RegExp(Ii.source,`g`),r=0,i;for(;(i=n.exec(e))!==null;){i.index>r&&t.push(e.slice(r,i.index));let[a,o]=i[1].split(`:`);t.push(this._renderColumnReference(a,o)),r=n.lastIndex}return r<e.length&&t.push(e.slice(r)),
|
|
31
|
+
</span>`}_renderTextFormula(){let e=this.expression??``,t=[],n=new RegExp(Ii.source,`g`),r=0,i;for(;(i=n.exec(e))!==null;){i.index>r&&t.push(e.slice(r,i.index));let[a,o]=i[1].split(`:`);t.push(this._renderColumnReference(a,o)),r=n.lastIndex}return r<e.length&&t.push(e.slice(r)),T`<span class="formula-text" part="formula-text">${t}</span>`}_renderColumnReference(e,t){let n=this._datasets.find(t=>t.id===e),r=n?.columns.find(e=>e.columnId===t),i=r?x(r.name,this.contentLanguage):t,a=n?x(n.name,this.contentLanguage):``,o=a?`${a} · ${i}`:i,s=l({type:r?.type??`hierarchy`},`s`);return T`<span class="formula-text-column" part="formula-text-column" title=${o}>
|
|
32
32
|
<span class="formula-text-column-icon">${f(s)}</span>
|
|
33
33
|
<span class="formula-text-column-name">${i}</span>
|
|
34
|
-
</span>`}};n([k({type:String,reflect:!0})],mo.prototype,`display`,void 0),mo=n([r()],mo),customElements.get(`luzmo-formula`)||customElements.define(`luzmo-formula`,mo);var ho=`:host{font-family:var(--luzmo-display-settings-font-family,var(--luzmo-font-family));font-size:var(--luzmo-display-settings-font-size,var(--display-settings-font-size));color:var(--luzmo-display-settings-font-color,var(--luzmo-font-color))}.settings-container{gap:var(--luzmo-display-settings-vertical-gap,var(--luzmo-spacing-2));flex-direction:column;display:flex}.settings-row{justify-content:flex-start;align-items:center;gap:var(--luzmo-display-settings-gap,var(--display-settings-gap));display:flex}.label-container{align-items:center;gap:var(--luzmo-display-settings-gap,var(--display-settings-gap));min-width:0;display:flex}.label-container.stacked{flex-direction:column;flex:1;align-items:stretch;gap:0}.label-container.stacked luzmo-multi-language-field{width:100%}.calculation-preview luzmo-formula{max-block-size:6em;max-inline-size:var(--luzmo-display-settings-calculation-max-width,var(--display-settings-calculation-max-width));overflow-wrap:anywhere;align-items:flex-start;min-width:0;display:inline-flex;overflow-y:auto}.calculation-preview luzmo-formula::-webkit-scrollbar{width:var(--luzmo-scrollbar-size)}.calculation-preview luzmo-formula::-webkit-scrollbar-track{background:var(--luzmo-scrollbar-track-background);border-radius:var(--luzmo-scrollbar-track-border-radius)}.calculation-preview luzmo-formula::-webkit-scrollbar-thumb{background:var(--luzmo-scrollbar-thumb-background);border-radius:var(--luzmo-scrollbar-thumb-border-radius)}.calculation-preview luzmo-formula::-webkit-scrollbar-thumb:hover{background:var(--luzmo-scrollbar-thumb-hover-background)}.calculation-preview luzmo-formula{scrollbar-width:var(--luzmo-scrollbar-width,thin);scrollbar-color:var(--luzmo-scrollbar-thumb-background) var(--luzmo-scrollbar-track-background)}luzmo-divider{margin:var(--luzmo-display-settings-ids-container-vertical-margin,var(--display-settings-ids-container-vertical-margin)) 0}luzmo-tooltip{--tooltip-font-size:var(--luzmo-display-settings-tooltip-font-size,var(--tooltip-font-size))}.setting{flex:1;align-items:flex-end;min-width:0;display:flex}.label-action-container{justify-content:space-between;align-items:center;gap:var(--luzmo-display-settings-info-to-remove-icon-gap,var(--display-settings-info-to-remove-icon-gap));display:flex}.label-action-container luzmo-action-button{margin-inline-start:var(--luzmo-spacing-2)}.ids-container{gap:var(--luzmo-display-settings-ids-container-gap,var(--luzmo-spacing-2));border-radius:50%;flex-direction:column;display:flex}.id-label{text-transform:var(--luzmo-display-settings-id-label-text-transform,var(--display-settings-id-label-text-transform));font-weight:var(--luzmo-display-settings-id-label-font-weight,var(--display-settings-id-label-font-weight));font-size:var(--luzmo-display-settings-id-label-font-size,var(--display-settings-id-label-font-size));color:var(--luzmo-display-settings-id-label-color,var(--display-settings-id-label-color))}.id-value{-webkit-user-select:text;user-select:text;cursor:text}.example-container{line-height:var(--luzmo-display-settings-example-height,var(--display-settings-example-height));font-size:var(--luzmo-display-settings-example-font-size,var(--display-settings-example-font-size));color:var(--luzmo-display-settings-example-color,var(--display-settings-example-color))}.example-container .example-label{font-weight:var(--luzmo-display-settings-example-label-font-weight,var(--display-settings-example-label-font-weight));color:var(--luzmo-display-settings-example-label-color,var(--display-settings-example-label-color))}.example-container .example-language{text-transform:uppercase;color:var(--luzmo-display-settings-example-language-color,var(--display-settings-example-language-color))}.example-container{gap:var(--luzmo-display-settings-example-container-gap,var(--luzmo-spacing-2))}:host{--display-settings-font-family:var(--luzmo-font-family);--display-settings-id-label-text-transform:none;--display-settings-id-label-font-weight:bold;--display-settings-id-label-color:var(--luzmo-primary);--display-settings-font-size:var(--luzmo-font-size);--display-settings-id-label-font-size:var(--luzmo-font-size);--display-settings-gap:var(--luzmo-spacing-3);--display-settings-ids-container-vertical-margin:var(--luzmo-spacing-4);--display-settings-info-to-remove-icon-gap:var(--luzmo-spacing-1);--display-settings-calculation-max-width:20rem}:host([size=s]){--display-settings-id-label-font-size:var(--luzmo-font-size-s);--display-settings-font-size:var(--luzmo-font-size-s);--display-settings-gap:var(--luzmo-spacing-3);--display-settings-ids-container-vertical-margin:var(--luzmo-spacing-3);--display-settings-info-to-remove-icon-gap:var(--luzmo-spacing-1);--display-settings-calculation-max-width:16rem}:host([size=l]){--display-settings-id-label-font-size:var(--luzmo-font-size);--display-settings-font-size:var(--luzmo-font-size-l);--display-settings-gap:var(--luzmo-spacing-4);--display-settings-ids-container-vertical-margin:var(--luzmo-spacing-5);--display-settings-info-to-remove-icon-gap:var(--luzmo-spacing-1);--display-settings-calculation-max-width:24rem}:host([size=xl]){--display-settings-id-label-font-size:var(--luzmo-font-size-l);--display-settings-font-size:var(--luzmo-font-size-xl);--display-settings-gap:var(--luzmo-spacing-5);--display-settings-ids-container-vertical-margin:calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--display-settings-info-to-remove-icon-gap:var(--luzmo-spacing-1);--display-settings-calculation-max-width:28rem}:host{--display-settings-example-font-size:var(--luzmo-font-size);--display-settings-example-color:var(--luzmo-font-color);--display-settings-example-label-font-weight:bold;--display-settings-example-label-color:var(--luzmo-primary);--display-settings-example-language-color:var(--luzmo-primary);--display-settings-example-height:var(--luzmo-component-height)}:host([size=s]){--display-settings-example-height:var(--luzmo-component-height-s);--display-settings-example-font-size:var(--luzmo-font-size-s)}:host([size=l]){--display-settings-example-height:var(--luzmo-component-height-l);--display-settings-example-font-size:var(--luzmo-font-size)}:host([size=xl]){--display-settings-example-height:var(--luzmo-component-height-xl);--display-settings-example-font-size:var(--luzmo-font-size-l)}`,Y=class extends Ka(m(h,{validSizes:Object.values(p)})){constructor(...e){super(...e),this._loadDisplaySettings=new C(this,{task:async([e,t,n,r,i,a])=>{let o=[];a&&o.push(`grandTotals`),n&&o.push(`periodOverPeriod`),(e===`numeric`||e===`mixed`&&this._currentSlotContent?.type===`numeric`)&&o.push(`numeric`),e!==`numeric`&&this._currentSlotContent?.type===`datetime`&&o.push(`datetime`),![`numeric`,`mixed`].includes(e??``)&&this._currentSlotContent?.type===`numeric`&&!r&&o.push(`binning`),n&&!this._settingsTypeLoaded.periodOverPeriod&&(await import(`./display-settings-period-over-period-BLSGumkD.js`),this._settingsTypeLoaded.periodOverPeriod=!0),o.length>0&&!t&&(o.includes(`numeric`)&&!this._settingsTypeLoaded.numeric?(await import(`./display-settings-numeric-C9ea7Tgc.js`),this._settingsTypeLoaded.numeric=!0):o.includes(`datetime`)&&!this._settingsTypeLoaded.datetime&&i?(await import(`./display-settings-datetime-CD52d6Sv.js`),this._settingsTypeLoaded.datetime=!0):o.includes(`binning`)&&!this._settingsTypeLoaded.binning?(await import(`./display-settings-binning-Byffw2Kl.js`),this._settingsTypeLoaded.binning=!0):o.includes(`grandTotals`)&&!this._settingsTypeLoaded.grandTotals&&(await import(`./display-settings-grand-totals-Cky99LX9.js`),this._settingsTypeLoaded.grandTotals=!0))},args:()=>[this.slotType,this.hideDisplaySettings,this._store?.periodOverPeriodUiType.get(),this.isBinningDisabled,this.areDatetimeOptionsEnabled,this.areGrandTotalsEnabled,this.slotContent]}),this.language=`en`,this.contentLanguage=`en`,this.slotType=`numeric`,this.slotName=`measure`,this.slotContent={},this.datasetsDataFields=[],this.apiUrl=`https://api.luzmo.com`,this.authKey=``,this.authToken=``,this._showIds=!1,this.measureColumns=[],this._settingsTypeLoaded={binning:!1,datetime:!1,numeric:!1,grandTotals:!1,periodOverPeriod:!1,hierarchy:!0},this._currentSlotContent={}}static get styles(){return[re(ho)]}_datasetDatetimeColumns(){return this._store?.linkedDataset.get().flatMap(e=>e.columns?.filter(e=>e.type===`datetime`).map(t=>({...t,datasetId:e.id})))}willUpdate(e){let t=this._store?.activeSlotContents.get(),n=this._store?.periodOverPeriodUiType.get();if(this.periodOverPeriodUiType!==n&&(this.periodOverPeriodUiType=n),this._store)t!==this._lastStoreContent&&(this._lastStoreContent=t,this._currentSlotContent=t?structuredClone(t):{});else if(e.has(`slotContent`)||Object.keys(this._currentSlotContent).length===0){let e=this.slotContent;e&&(this._currentSlotContent=structuredClone(e))}}get datasetId(){return this._currentSlotContent.datasetId??this._currentSlotContent.set}get formulaOrColumnId(){return this._currentSlotContent.formulaId??this._currentSlotContent.expression??this._currentSlotContent.formula??this._currentSlotContent.columnId??this._currentSlotContent.column}resetInfoVisibility(e){this._showIds&&this._toggleIds(e)}_onSlotContentChange(e){e.stopPropagation(),e.preventDefault(),this._currentSlotContent=structuredClone(e.detail.slotContent),this._sendEvent(),this.requestUpdate()}_onLabelChange(){this._currentSlotContent=structuredClone(this._currentSlotContent),this._currentSlotContent.label=this._multiLanguageFieldElement.value||{},this._sendEvent(),this.requestUpdate()}_sendEvent(){this.dispatchEvent(new CustomEvent(`luzmo-slot-content-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:{...this._currentSlotContent}}})),this._store&&(this._store.updateContent({...this._currentSlotContent}),this._lastStoreContent=this._store.activeSlotContents.get())}_removeEvent(){this.dispatchEvent(new CustomEvent(`luzmo-remove-slot-content`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:this._currentSlotContent}}))}_toggleIds(e=!0){this._showIds=!this._showIds,e&&this.dispatchEvent(new CustomEvent(`luzmo-info-visibility-changed`,{detail:{isVisible:this._showIds,slotContent:{...this._currentSlotContent}}}))}_renderExampleRow(){let t=this.slotType===`numeric`||this.slotType===`mixed`&&this._currentSlotContent.type===`numeric`,n=this.slotType!==`datetime`&&this._currentSlotContent.type===`datetime`&&this.areDatetimeOptionsEnabled;if(!(t||n))return O;let r=!this._currentSlotContent.datetimeDisplayMode||this._currentSlotContent.datetimeDisplayMode==="default",i=t?1234.56:r?/* @__PURE__ */ new Date:1,a=Rn({...this._currentSlotContent,type:t?`numeric`:`datetime`},{locale:this.contentLanguage,level:this._currentSlotContent.level})(i);return E`<div class="settings-row example-container">
|
|
34
|
+
</span>`}};e([O({type:String,reflect:!0})],mo.prototype,`display`,void 0),mo=e([r()],mo),customElements.get(`luzmo-formula`)||customElements.define(`luzmo-formula`,mo);var ho=`:host{font-family:var(--luzmo-display-settings-font-family,var(--luzmo-font-family));font-size:var(--luzmo-display-settings-font-size,var(--display-settings-font-size));color:var(--luzmo-display-settings-font-color,var(--luzmo-font-color))}.settings-container{gap:var(--luzmo-display-settings-vertical-gap,var(--luzmo-spacing-2));flex-direction:column;display:flex}.settings-row{justify-content:flex-start;align-items:center;gap:var(--luzmo-display-settings-gap,var(--display-settings-gap));display:flex}.label-container{align-items:center;gap:var(--luzmo-display-settings-gap,var(--display-settings-gap));min-width:0;display:flex}.label-container.stacked{flex-direction:column;flex:1;align-items:stretch;gap:0}.label-container.stacked luzmo-multi-language-field{width:100%}.calculation-preview luzmo-formula{max-block-size:6em;max-inline-size:var(--luzmo-display-settings-calculation-max-width,var(--display-settings-calculation-max-width));overflow-wrap:anywhere;align-items:flex-start;min-width:0;display:inline-flex;overflow-y:auto}.calculation-preview luzmo-formula::-webkit-scrollbar{width:var(--luzmo-scrollbar-size)}.calculation-preview luzmo-formula::-webkit-scrollbar-track{background:var(--luzmo-scrollbar-track-background);border-radius:var(--luzmo-scrollbar-track-border-radius)}.calculation-preview luzmo-formula::-webkit-scrollbar-thumb{background:var(--luzmo-scrollbar-thumb-background);border-radius:var(--luzmo-scrollbar-thumb-border-radius)}.calculation-preview luzmo-formula::-webkit-scrollbar-thumb:hover{background:var(--luzmo-scrollbar-thumb-hover-background)}.calculation-preview luzmo-formula{scrollbar-width:var(--luzmo-scrollbar-width,thin);scrollbar-color:var(--luzmo-scrollbar-thumb-background) var(--luzmo-scrollbar-track-background)}luzmo-divider{margin:var(--luzmo-display-settings-ids-container-vertical-margin,var(--display-settings-ids-container-vertical-margin)) 0}luzmo-tooltip{--tooltip-font-size:var(--luzmo-display-settings-tooltip-font-size,var(--tooltip-font-size))}.setting{flex:1;align-items:flex-end;min-width:0;display:flex}.label-action-container{justify-content:space-between;align-items:center;gap:var(--luzmo-display-settings-info-to-remove-icon-gap,var(--display-settings-info-to-remove-icon-gap));display:flex}.label-action-container luzmo-action-button{margin-inline-start:var(--luzmo-spacing-2)}.ids-container{gap:var(--luzmo-display-settings-ids-container-gap,var(--luzmo-spacing-2));border-radius:50%;flex-direction:column;display:flex}.id-label{text-transform:var(--luzmo-display-settings-id-label-text-transform,var(--display-settings-id-label-text-transform));font-weight:var(--luzmo-display-settings-id-label-font-weight,var(--display-settings-id-label-font-weight));font-size:var(--luzmo-display-settings-id-label-font-size,var(--display-settings-id-label-font-size));color:var(--luzmo-display-settings-id-label-color,var(--display-settings-id-label-color))}.id-value{-webkit-user-select:text;user-select:text;cursor:text}.example-container{line-height:var(--luzmo-display-settings-example-height,var(--display-settings-example-height));font-size:var(--luzmo-display-settings-example-font-size,var(--display-settings-example-font-size));color:var(--luzmo-display-settings-example-color,var(--display-settings-example-color))}.example-container .example-label{font-weight:var(--luzmo-display-settings-example-label-font-weight,var(--display-settings-example-label-font-weight));color:var(--luzmo-display-settings-example-label-color,var(--display-settings-example-label-color))}.example-container .example-language{text-transform:uppercase;color:var(--luzmo-display-settings-example-language-color,var(--display-settings-example-language-color))}.example-container{gap:var(--luzmo-display-settings-example-container-gap,var(--luzmo-spacing-2))}:host{--display-settings-font-family:var(--luzmo-font-family);--display-settings-id-label-text-transform:none;--display-settings-id-label-font-weight:bold;--display-settings-id-label-color:var(--luzmo-primary);--display-settings-font-size:var(--luzmo-font-size);--display-settings-id-label-font-size:var(--luzmo-font-size);--display-settings-gap:var(--luzmo-spacing-3);--display-settings-ids-container-vertical-margin:var(--luzmo-spacing-4);--display-settings-info-to-remove-icon-gap:var(--luzmo-spacing-1);--display-settings-calculation-max-width:20rem}:host([size=s]){--display-settings-id-label-font-size:var(--luzmo-font-size-s);--display-settings-font-size:var(--luzmo-font-size-s);--display-settings-gap:var(--luzmo-spacing-3);--display-settings-ids-container-vertical-margin:var(--luzmo-spacing-3);--display-settings-info-to-remove-icon-gap:var(--luzmo-spacing-1);--display-settings-calculation-max-width:16rem}:host([size=l]){--display-settings-id-label-font-size:var(--luzmo-font-size);--display-settings-font-size:var(--luzmo-font-size-l);--display-settings-gap:var(--luzmo-spacing-4);--display-settings-ids-container-vertical-margin:var(--luzmo-spacing-5);--display-settings-info-to-remove-icon-gap:var(--luzmo-spacing-1);--display-settings-calculation-max-width:24rem}:host([size=xl]){--display-settings-id-label-font-size:var(--luzmo-font-size-l);--display-settings-font-size:var(--luzmo-font-size-xl);--display-settings-gap:var(--luzmo-spacing-5);--display-settings-ids-container-vertical-margin:calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--display-settings-info-to-remove-icon-gap:var(--luzmo-spacing-1);--display-settings-calculation-max-width:28rem}:host{--display-settings-example-font-size:var(--luzmo-font-size);--display-settings-example-color:var(--luzmo-font-color);--display-settings-example-label-font-weight:bold;--display-settings-example-label-color:var(--luzmo-primary);--display-settings-example-language-color:var(--luzmo-primary);--display-settings-example-height:var(--luzmo-component-height)}:host([size=s]){--display-settings-example-height:var(--luzmo-component-height-s);--display-settings-example-font-size:var(--luzmo-font-size-s)}:host([size=l]){--display-settings-example-height:var(--luzmo-component-height-l);--display-settings-example-font-size:var(--luzmo-font-size)}:host([size=xl]){--display-settings-example-height:var(--luzmo-component-height-xl);--display-settings-example-font-size:var(--luzmo-font-size-l)}`,Y=class extends Ka(y(p,{validSizes:Object.values(h)})){constructor(...e){super(...e),this._loadDisplaySettings=new ee(this,{task:async([e,t,n,r,i,a])=>{let o=[];a&&o.push(`grandTotals`),n&&o.push(`periodOverPeriod`),(e===`numeric`||e===`mixed`&&this._currentSlotContent?.type===`numeric`)&&o.push(`numeric`),e!==`numeric`&&this._currentSlotContent?.type===`datetime`&&o.push(`datetime`),![`numeric`,`mixed`].includes(e??``)&&this._currentSlotContent?.type===`numeric`&&!r&&o.push(`binning`),n&&!this._settingsTypeLoaded.periodOverPeriod&&(await import(`./display-settings-period-over-period-COd4tvUw.js`),this._settingsTypeLoaded.periodOverPeriod=!0),o.length>0&&!t&&(o.includes(`numeric`)&&!this._settingsTypeLoaded.numeric?(await import(`./display-settings-numeric-BLWF54Jx.js`),this._settingsTypeLoaded.numeric=!0):o.includes(`datetime`)&&!this._settingsTypeLoaded.datetime&&i?(await import(`./display-settings-datetime-C8xvOvi4.js`),this._settingsTypeLoaded.datetime=!0):o.includes(`binning`)&&!this._settingsTypeLoaded.binning?(await import(`./display-settings-binning-DhHlclWH.js`),this._settingsTypeLoaded.binning=!0):o.includes(`grandTotals`)&&!this._settingsTypeLoaded.grandTotals&&(await import(`./display-settings-grand-totals-CUpigDcs.js`),this._settingsTypeLoaded.grandTotals=!0))},args:()=>[this.slotType,this.hideDisplaySettings,this._store?.periodOverPeriodUiType.get(),this.isBinningDisabled,this.areDatetimeOptionsEnabled,this.areGrandTotalsEnabled,this.slotContent]}),this.language=`en`,this.contentLanguage=`en`,this.slotType=`numeric`,this.slotName=`measure`,this.slotContent={},this.datasetsDataFields=[],this.apiUrl=`https://api.luzmo.com`,this.authKey=``,this.authToken=``,this._showIds=!1,this.measureColumns=[],this._settingsTypeLoaded={binning:!1,datetime:!1,numeric:!1,grandTotals:!1,periodOverPeriod:!1,hierarchy:!0},this._currentSlotContent={}}static get styles(){return[A(ho)]}_datasetDatetimeColumns(){return this._store?.linkedDataset.get().flatMap(e=>e.columns?.filter(e=>e.type===`datetime`).map(t=>({...t,datasetId:e.id})))}willUpdate(e){let t=this._store?.activeSlotContents.get(),n=this._store?.periodOverPeriodUiType.get();if(this.periodOverPeriodUiType!==n&&(this.periodOverPeriodUiType=n),this._store)t!==this._lastStoreContent&&(this._lastStoreContent=t,this._currentSlotContent=t?structuredClone(t):{});else if(e.has(`slotContent`)||Object.keys(this._currentSlotContent).length===0){let e=this.slotContent;e&&(this._currentSlotContent=structuredClone(e))}}get datasetId(){return this._currentSlotContent.datasetId??this._currentSlotContent.set}get formulaOrColumnId(){return this._currentSlotContent.formulaId??this._currentSlotContent.expression??this._currentSlotContent.formula??this._currentSlotContent.columnId??this._currentSlotContent.column}resetInfoVisibility(e){this._showIds&&this._toggleIds(e)}_onSlotContentChange(e){e.stopPropagation(),e.preventDefault(),this._currentSlotContent=structuredClone(e.detail.slotContent),this._sendEvent(),this.requestUpdate()}_onLabelChange(){this._currentSlotContent=structuredClone(this._currentSlotContent),this._currentSlotContent.label=this._multiLanguageFieldElement.value||{},this._sendEvent(),this.requestUpdate()}_sendEvent(){this.dispatchEvent(new CustomEvent(`luzmo-slot-content-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:{...this._currentSlotContent}}})),this._store&&(this._store.updateContent({...this._currentSlotContent}),this._lastStoreContent=this._store.activeSlotContents.get())}_removeEvent(){this.dispatchEvent(new CustomEvent(`luzmo-remove-slot-content`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:this._currentSlotContent}}))}_toggleIds(e=!0){this._showIds=!this._showIds,e&&this.dispatchEvent(new CustomEvent(`luzmo-info-visibility-changed`,{detail:{isVisible:this._showIds,slotContent:{...this._currentSlotContent}}}))}_renderExampleRow(){let e=this.slotType===`numeric`||this.slotType===`mixed`&&this._currentSlotContent.type===`numeric`,n=this.slotType!==`datetime`&&this._currentSlotContent.type===`datetime`&&this.areDatetimeOptionsEnabled;if(!(e||n))return D;let r=!this._currentSlotContent.datetimeDisplayMode||this._currentSlotContent.datetimeDisplayMode==="default",i=e?1234.56:r?/* @__PURE__ */ new Date:1,a=Rn({...this._currentSlotContent,type:e?`numeric`:`datetime`},{locale:this.contentLanguage,level:this._currentSlotContent.level})(i);return T`<div class="settings-row example-container">
|
|
35
35
|
<span class="example-label"
|
|
36
|
-
>${
|
|
36
|
+
>${t(`Example`,{desc:`Label for example`})}:</span
|
|
37
37
|
>
|
|
38
38
|
<span class="example">${a}</span>
|
|
39
|
-
</div>`}_renderDisplaySettings(){let
|
|
39
|
+
</div>`}_renderDisplaySettings(){let e={name:this.slotName,type:this.slotType},n=q(this._currentSlotContent,e)?Qa(this._currentSlotContent):void 0,r=Xa(this._currentSlotContent)?t(`Formula`,{desc:`Label for the formula type`}):t(`Expression`,{desc:`Label for the expression type`}),i=this._currentSlotContent.datasetId??this._currentSlotContent.set;return T`<div class="settings-container">
|
|
40
40
|
<div class="settings-row">
|
|
41
41
|
<div class="setting">
|
|
42
42
|
<div class="label-container stacked">
|
|
43
43
|
<luzmo-field-label .size=${this.size} for="slot-label">
|
|
44
|
-
${
|
|
44
|
+
${t(`Label`,{desc:`Label for the slot label setting`})}
|
|
45
45
|
</luzmo-field-label>
|
|
46
46
|
<luzmo-multi-language-field
|
|
47
47
|
id="slot-label"
|
|
48
|
-
label=${
|
|
48
|
+
label=${t(`Label`,{desc:`Label for the slot label setting`})}
|
|
49
49
|
.language=${this.contentLanguage}
|
|
50
50
|
.value=${this._currentSlotContent.label??{}}
|
|
51
51
|
.size=${this.size}
|
|
@@ -54,26 +54,26 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
54
54
|
></luzmo-multi-language-field>
|
|
55
55
|
</div>
|
|
56
56
|
<div class="label-action-container">
|
|
57
|
-
<luzmo-action-button quiet .size=${this.size} .label=${
|
|
57
|
+
<luzmo-action-button quiet .size=${this.size} .label=${t(`Show dataset and column IDs`,{desc:`Show IDs button label`})} aria-expanded=${this._showIds} ?selected=${this._showIds} @click=${this._toggleIds}>
|
|
58
58
|
${f(ce)}
|
|
59
59
|
<luzmo-tooltip self-managed placement="top" size=${this.size}>
|
|
60
|
-
${
|
|
60
|
+
${t(`Show dataset and column IDs`,{desc:`Show IDs button label`})}
|
|
61
61
|
</luzmo-tooltip>
|
|
62
62
|
</luzmo-action-button>
|
|
63
|
-
${this.showRemoveButton?
|
|
63
|
+
${this.showRemoveButton?T`<luzmo-action-button quiet .size=${this.size} .label=${t(`Remove`,{desc:`Remove button label`})} @click=${this._removeEvent}>
|
|
64
64
|
${f(o)}
|
|
65
65
|
<luzmo-tooltip
|
|
66
66
|
self-managed
|
|
67
67
|
placement="top"
|
|
68
68
|
size=${this.size}
|
|
69
69
|
>
|
|
70
|
-
${
|
|
70
|
+
${t(`Remove`,{desc:`Remove button label`})}
|
|
71
71
|
</luzmo-tooltip>
|
|
72
72
|
</luzmo-action-button>`:``}
|
|
73
73
|
</div>
|
|
74
74
|
</div>
|
|
75
75
|
</div>
|
|
76
|
-
${n?
|
|
76
|
+
${n?T`<div class="settings-row">
|
|
77
77
|
<div class="setting">
|
|
78
78
|
<div class="label-container stacked calculation-preview">
|
|
79
79
|
<luzmo-field-label .size=${this.size}>${r}</luzmo-field-label>
|
|
@@ -91,13 +91,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
91
91
|
</div>
|
|
92
92
|
</div>
|
|
93
93
|
</div>`:``}
|
|
94
|
-
${this.areGrandTotalsEnabled?
|
|
94
|
+
${this.areGrandTotalsEnabled?T`<luzmo-display-settings-grand-totals
|
|
95
95
|
.language=${this.language}
|
|
96
96
|
.slotContent=${this._currentSlotContent}
|
|
97
97
|
.size=${this.size}
|
|
98
98
|
@luzmo-slot-content-changed=${this._onSlotContentChange}
|
|
99
99
|
></luzmo-display-settings-grand-totals>`:``}
|
|
100
|
-
${this.slotType===`numeric`||this.slotType===`mixed`&&this._currentSlotContent.type===`numeric`?
|
|
100
|
+
${this.slotType===`numeric`||this.slotType===`mixed`&&this._currentSlotContent.type===`numeric`?T`<luzmo-display-settings-numeric
|
|
101
101
|
.language=${this.language}
|
|
102
102
|
.slotContent=${this._currentSlotContent}
|
|
103
103
|
.size=${this.size}
|
|
@@ -106,20 +106,20 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
106
106
|
.isCumulativeSumEnabled=${this.isCumulativeSumEnabled}
|
|
107
107
|
@luzmo-slot-content-changed=${this._onSlotContentChange}
|
|
108
108
|
></luzmo-display-settings-numeric>`:``}
|
|
109
|
-
${this.slotType!==`numeric`&&this._currentSlotContent.type===`datetime`&&this.areDatetimeOptionsEnabled?
|
|
109
|
+
${this.slotType!==`numeric`&&this._currentSlotContent.type===`datetime`&&this.areDatetimeOptionsEnabled?T`<luzmo-display-settings-datetime
|
|
110
110
|
.language=${this.language}
|
|
111
111
|
.contentLanguage=${this.contentLanguage}
|
|
112
112
|
.slotContent=${this._currentSlotContent}
|
|
113
113
|
.size=${this.size}
|
|
114
114
|
@luzmo-slot-content-changed=${this._onSlotContentChange}
|
|
115
115
|
></luzmo-display-settings-datetime>`:``}
|
|
116
|
-
${![`numeric`,`mixed`].includes(this.slotType??``)&&this._currentSlotContent.type===`numeric`&&!this.isBinningDisabled?
|
|
116
|
+
${![`numeric`,`mixed`].includes(this.slotType??``)&&this._currentSlotContent.type===`numeric`&&!this.isBinningDisabled?T`<luzmo-display-settings-binning
|
|
117
117
|
.language=${this.language}
|
|
118
118
|
.slotContent=${this._currentSlotContent}
|
|
119
119
|
.size=${this.size}
|
|
120
120
|
@luzmo-slot-content-changed=${this._onSlotContentChange}
|
|
121
121
|
></luzmo-display-settings-binning>`:``}
|
|
122
|
-
${this.periodOverPeriodUiType?
|
|
122
|
+
${this.periodOverPeriodUiType?T`<luzmo-display-settings-period-over-period
|
|
123
123
|
.language=${this.language}
|
|
124
124
|
.slotContent=${this._currentSlotContent}
|
|
125
125
|
.size=${this.size}
|
|
@@ -131,11 +131,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
131
131
|
></luzmo-display-settings-period-over-period>`:``}
|
|
132
132
|
${this._renderExampleRow()}
|
|
133
133
|
</div>
|
|
134
|
-
${this._showIds?
|
|
134
|
+
${this._showIds?T` <luzmo-divider></luzmo-divider>
|
|
135
135
|
<div class="ids-container">
|
|
136
136
|
<div>
|
|
137
137
|
<span class="id-label"
|
|
138
|
-
>${this._currentSlotContent.formula||this._currentSlotContent.formulaId||this._currentSlotContent.expression?
|
|
138
|
+
>${this._currentSlotContent.formula||this._currentSlotContent.formulaId||this._currentSlotContent.expression?t(`Formula`,{desc:`Label for the formula type`}):t(`Column`,{desc:`Label for column type`})}:
|
|
139
139
|
</span>
|
|
140
140
|
<span class="id-value">
|
|
141
141
|
${this.formulaOrColumnId}
|
|
@@ -143,18 +143,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
143
143
|
</div>
|
|
144
144
|
<div>
|
|
145
145
|
<span class="id-label"
|
|
146
|
-
>${
|
|
146
|
+
>${t(`Dataset`)}:
|
|
147
147
|
</span>
|
|
148
148
|
<span class="id-value">
|
|
149
149
|
${this.datasetId}
|
|
150
150
|
</span>
|
|
151
151
|
</div>
|
|
152
152
|
<div></div>
|
|
153
|
-
</div>`:``}`}render(){return this._loadDisplaySettings.render({pending:()=>
|
|
153
|
+
</div>`:``}`}render(){return this._loadDisplaySettings.render({pending:()=>T`<luzmo-progress-circle
|
|
154
154
|
indeterminate
|
|
155
|
-
.label=${
|
|
155
|
+
.label=${t(`Loading`,{desc:`Loading spinner label`})}
|
|
156
156
|
.size=${this.size}
|
|
157
|
-
></luzmo-progress-circle>`,complete:()=>this._renderDisplaySettings(),error:()=>this._renderDisplaySettings()})}disconnectedCallback(){super.disconnectedCallback?.(),this._loadDisplaySettings.abort?.()}};n([k({type:String})],Y.prototype,`language`,void 0),n([k({type:String,attribute:`content-language`})],Y.prototype,`contentLanguage`,void 0),n([k({type:Boolean,attribute:`hide-display-settings`})],Y.prototype,`hideDisplaySettings`,void 0),n([k({type:Boolean})],Y.prototype,`isBinningDisabled`,void 0),n([k({type:Boolean})],Y.prototype,`areDatetimeOptionsEnabled`,void 0),n([k({type:Boolean})],Y.prototype,`areGrandTotalsEnabled`,void 0),n([k({type:Boolean})],Y.prototype,`isAggregationDisabled`,void 0),n([k({type:Boolean})],Y.prototype,`isCumulativeSumEnabled`,void 0),n([k({type:String})],Y.prototype,`periodOverPeriodUiType`,void 0),n([k({type:Boolean,attribute:`show-remove-button`})],Y.prototype,`showRemoveButton`,void 0),n([k({type:String,attribute:`slot-type`})],Y.prototype,`slotType`,void 0),n([k({type:String,attribute:`slot-name`})],Y.prototype,`slotName`,void 0),n([k({type:Object,attribute:!1})],Y.prototype,`slotContent`,void 0),n([k({attribute:!1})],Y.prototype,`datasetsDataFields`,void 0),n([k({type:String,attribute:`api-url`,reflect:!0})],Y.prototype,`apiUrl`,void 0),n([k({type:String,attribute:`auth-key`,reflect:!0})],Y.prototype,`authKey`,void 0),n([k({type:String,attribute:`auth-token`,reflect:!0})],Y.prototype,`authToken`,void 0),n([A()],Y.prototype,`_showIds`,void 0),n([k({type:Array,reflect:!1})],Y.prototype,`measureColumns`,void 0),n([te(`luzmo-multi-language-field`)],Y.prototype,`_multiLanguageFieldElement`,void 0),n([Zi({context:$i,subscribe:!0})],Y.prototype,`_store`,void 0),customElements.get(`luzmo-display-settings`)||customElements.define(`luzmo-display-settings`,Y);function go({element:e,handle:t,boundary:n=document.documentElement,onDragStart:r,onDragEnd:i}){if(!e||!t)throw Error(`makeDraggable: element and handle are required`);let a=e.ownerDocument??document,o=-1,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=t=>{if(t.pointerId!==o)return;let r=t.clientX-s,i=t.clientY-c,a=(n??document.documentElement).getBoundingClientRect(),h=l+r,g=u+i;h=Math.min(Math.max(h,a.left),a.right-d),g=Math.min(Math.max(g,a.top),a.bottom-f);let _=h-l,v=g-u,y=p+_,b=m+v;e.style.transform=`translate3d(${y}px, ${b}px, 0)`},g=e=>{e.pointerId===o&&(a.removeEventListener(`pointermove`,h),a.removeEventListener(`pointerup`,g),o=-1,i?.())},_=n=>{if(n.button!==0)return;o=n.pointerId;let i=e.getBoundingClientRect();l=i.left,u=i.top,d=i.width,f=i.height,s=n.clientX,c=n.clientY;try{let t=a.defaultView?.getComputedStyle(e);if(t){let e=new DOMMatrixReadOnly(t.transform);p=e.m41,m=e.m42}}catch{p=0,m=0}t.setPointerCapture(o),a.addEventListener(`pointermove`,h),a.addEventListener(`pointerup`,g),r?.()};return t.addEventListener(`pointerdown`,_),()=>{t.removeEventListener(`pointerdown`,_),a.removeEventListener(`pointermove`,h),a.removeEventListener(`pointerup`,g)}}var _o={none:0,small:100,medium:350,large:700},vo=.5;_o.none,_o.small*vo,_o.medium*vo,_o.large*vo;function yo(e){e.animate([{backgroundColor:`var(--ds-background-selected, #E9F2FF)`},{}],{duration:_o.large,easing:`cubic-bezier(0.25, 0.1, 0.25, 1.0)`,iterations:1})}function bo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?bo(Object(n),!0).forEach(function(t){ir(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var So={top:function(e,t){return Math.abs(t.y-e.top)},right:function(e,t){return Math.abs(e.right-t.x)},bottom:function(e,t){return Math.abs(e.bottom-t.y)},left:function(e,t){return Math.abs(t.x-e.left)}},Co=Symbol(`closestEdge`);function wo(e,t){var n=t.element,r=t.input,i=t.allowedEdges,a={x:r.clientX,y:r.clientY},o=n.getBoundingClientRect(),s=i.map(function(e){return{edge:e,value:So[e](o,a)}}).sort(function(e,t){return e.value-t.value})[0]?.edge??null;return xo(xo({},e),{},ir({},Co,s))}function To(e){return e[Co]??null}function Eo(){return{x:0,y:0}}function Do(e){var t=e.render,n=e.nativeSetDragImage,r=e.getOffset,i=r===void 0?Eo:r,a=document.createElement(`div`);Object.assign(a.style,{position:`fixed`,top:0,left:0,zIndex:or,pointerEvents:`none`}),document.body.append(a);var o=t({container:a});queueMicrotask(function(){var e=i({container:a});if(kr()){var t=a.getBoundingClientRect();if(t.width===0)return;a.style.left=`-${t.width-1e-4}px`}n?.(a,e.x,e.y)});function s(){c(),o?.(),document.body.removeChild(a)}var c=xi({onDragStart:s,onDrop:s})}var Oo=(e,t)=>{let n=getComputedStyle(e).getPropertyValue(t);for(;!n&&e.parentElement;)e=e.parentElement,n=getComputedStyle(e).getPropertyValue(t);return n.trim()},ko=`:host{font-family:var(--luzmo-slot-menu-list-font-family,var(--luzmo-font-family));font-size:var(--luzmo-slot-menu-list-font-size,var(--slot-menu-list-font-size));color:var(--luzmo-slot-menu-list-font-color,var(--luzmo-font-color))}ul{margin:0;padding:0;list-style:none}:host{max-height:var(--luzmo-slot-menu-list-max-height,var(--slot-menu-list-max-height));margin:0;padding:0;list-style:none;overflow-y:auto}:host::-webkit-scrollbar{width:var(--luzmo-slot-menu-list-scrollbar-width,var(--slot-menu-list-scrollbar-width))}:host::-webkit-scrollbar-track{background:var(--luzmo-slot-menu-list-scrollbar-track-background,var(--slot-menu-list-scrollbar-track-background));border-radius:var(--luzmo-slot-menu-list-scrollbar-track-border-radius,var(--slot-menu-list-scrollbar-track-border-radius))}:host::-webkit-scrollbar-thumb{background:var(--luzmo-slot-menu-list-scrollbar-thumb-background,var(--slot-menu-list-scrollbar-thumb-background));border-radius:var(--luzmo-slot-menu-list-scrollbar-thumb-border-radius,var(--slot-menu-list-scrollbar-thumb-border-radius))}:host::-webkit-scrollbar-thumb:hover{background:var(--luzmo-slot-menu-list-scrollbar-thumb-hover-background,var(--slot-menu-list-scrollbar-thumb-hover-background))}:host{scrollbar-width:var(--luzmo-scrollbar-width,thin);scrollbar-color:var(--luzmo-slot-menu-list-scrollbar-thumb-background,var(--slot-menu-list-scrollbar-thumb-background)) var(--luzmo-slot-menu-list-scrollbar-track-background,var(--slot-menu-list-scrollbar-track-background));border-right:var(--luzmo-slot-menu-list-border-right-width,var(--luzmo-border-width)) solid var(--luzmo-slot-menu-list-border-right-color,var(--luzmo-border-color))}:host li{cursor:pointer;position:relative}:host li:hover{background-color:var(--luzmo-slot-menu-list-background-color-hover,var(--slot-menu-list-background-color-hover))}:host li{border-bottom:var(--luzmo-slot-menu-list-border-bottom-width,var(--slot-menu-list-border-bottom-width)) solid var(--luzmo-slot-menu-list-border-bottom-color,var(--slot-menu-list-border-bottom-color))}:host .active{background-color:var(--luzmo-slot-menu-list-active-background-color,var(--slot-menu-list-active-background-color));color:var(--luzmo-slot-menu-list-active-color,var(--slot-menu-list-active-color))}:host .active:hover{background-color:var(--luzmo-slot-menu-list-active-background-color-hover,var(--slot-menu-list-active-background-color-hover))}:host .active .draggable-slot-content:focus-visible{background-color:var(--luzmo-slot-menu-list-active-background-color-hover,var(--slot-menu-list-active-background-color-hover));outline:none}:host .active .draggable-slot-content-remove:focus-visible{outline-color:var(--luzmo-slot-menu-list-active-color,var(--slot-menu-list-active-color));background-color:var(--luzmo-slot-menu-list-active-background-color-hover,var(--slot-menu-list-active-background-color-hover))}.calculation-label{align-items:center;gap:var(--luzmo-spacing-3);display:inline-flex}.calculation-label-icon{flex:none;display:inline-flex}.drop-indicator{height:var(--luzmo-slot-menu-list-drop-indicator-height,var(--slot-menu-list-drop-indicator-height));background-color:var(--luzmo-slot-menu-list-drop-indicator-color,var(--slot-menu-list-drop-indicator-color));position:absolute;left:0;right:0}.drop-indicator:before{content:"";border:var(--luzmo-slot-menu-list-drop-indicator-height,var(--slot-menu-list-drop-indicator-height)) solid var(--luzmo-slot-menu-list-drop-indicator-color,var(--slot-menu-list-drop-indicator-color));background:var(--luzmo-slot-menu-list-drop-indicator-background,var(--luzmo-background-color));width:100%;left:calc(-.5 * (var(--luzmo-slot-menu-list-drop-indicator-circle-size,var(--slot-menu-list-drop-indicator-circle-size)) + var(--luzmo-slot-menu-list-drop-indicator-height,var(--slot-menu-list-drop-indicator-height))));top:calc(-.5 * (var(--luzmo-slot-menu-list-drop-indicator-circle-size,var(--slot-menu-list-drop-indicator-circle-size)) + var(--luzmo-slot-menu-list-drop-indicator-height,var(--slot-menu-list-drop-indicator-height))));height:var(--luzmo-slot-menu-list-drop-indicator-circle-size,var(--slot-menu-list-drop-indicator-circle-size));width:var(--luzmo-slot-menu-list-drop-indicator-circle-size,var(--slot-menu-list-drop-indicator-circle-size));border-radius:50%;display:block;position:absolute}.drop-indicator[data-edge=top]{top:calc(-.5 * var(--luzmo-slot-menu-list-drop-indicator-height,var(--slot-menu-list-drop-indicator-height)))}.drop-indicator[data-edge=bottom]{bottom:calc(-.5 * var(--luzmo-slot-menu-list-drop-indicator-height,var(--slot-menu-list-drop-indicator-height)))}.draggable-slot-content{justify-content:space-between;gap:var(--luzmo-slot-menu-label-to-icon-gap,var(--slot-menu-label-to-icon-gap));touch-action:none;cursor:pointer;align-items:center;display:flex}.draggable-slot-content:focus-visible{background-color:color-mix(in srgb, var(--luzmo-primary) 20%, transparent);outline:none}.draggable-slot-content .draggable-slot-content-label{padding-block:var(--luzmo-slot-menu-list-item-vertical-padding,var(--slot-menu-list-item-vertical-padding));text-overflow:ellipsis;white-space:nowrap;font:inherit;color:inherit;cursor:inherit;text-align:start;background:0 0;border:none;flex:auto;padding-inline-start:var(--luzmo-slot-menu-list-item-horizontal-padding,var(--slot-menu-list-item-horizontal-padding));overflow:hidden}.draggable-slot-content .draggable-slot-content-remove{padding:var(--luzmo-spacing-1);font:inherit;color:inherit;cursor:inherit;border-radius:var(--luzmo-border-radius);background:0 0;border:none;flex:none;justify-content:center;align-items:center;margin-inline-end:var(--luzmo-slot-menu-list-item-horizontal-padding,var(--slot-menu-list-item-horizontal-padding));display:flex}.draggable-slot-content .draggable-slot-content-remove:focus-visible{outline:var(--luzmo-indicator-width) solid var(--luzmo-indicator-color);outline-offset:1px}:host{--slot-menu-list-active-background-color:var(--luzmo-primary);--slot-menu-list-active-background-color-hover:var(--luzmo-primary-hover);--slot-menu-list-active-color:var(--luzmo-primary-inverse-color);--slot-menu-list-background-color-hover:var(--luzmo-background-color-hover);--slot-menu-list-drop-indicator-color:var(--luzmo-font-color-down);--slot-menu-list-drop-indicator-height:2px;--slot-menu-list-drop-indicator-circle-size:4px;--slot-menu-list-border-bottom-width:0px;--slot-menu-list-border-bottom-color:transparent;--slot-menu-list-max-height:calc(var(--luzmo-component-height) * 4);--slot-menu-list-scrollbar-width:var(--luzmo-scrollbar-size);--slot-menu-list-scrollbar-track-background:var(--luzmo-scrollbar-track-background);--slot-menu-list-scrollbar-track-border-radius:var(--luzmo-scrollbar-track-border-radius);--slot-menu-list-scrollbar-thumb-background:var(--luzmo-scrollbar-thumb-background);--slot-menu-list-scrollbar-thumb-border-radius:var(--luzmo-scrollbar-thumb-border-radius);--slot-menu-list-scrollbar-thumb-hover-background:var(--luzmo-scrollbar-thumb-hover-background);--slot-menu-display-settings-min-width:19rem;--slot-menu-min-height:calc(var(--luzmo-component-height) * 2);--slot-menu-font-size:var(--luzmo-font-size);--slot-menu-list-item-horizontal-padding:var(--luzmo-spacing-4);--slot-menu-list-item-vertical-padding:var(--luzmo-spacing-3);--slot-menu-label-to-icon-gap:var(--luzmo-spacing-3)}:host([size=s]){--slot-menu-display-settings-min-width:16rem;--slot-menu-min-height:calc(var(--luzmo-component-height-s) * 2);--slot-menu-font-size:var(--luzmo-font-size-s);--slot-menu-list-item-horizontal-padding:var(--luzmo-spacing-3);--slot-menu-list-item-vertical-padding:var(--luzmo-spacing-3);--slot-menu-label-to-icon-gap:var(--luzmo-spacing-2)}:host([size=l]){--slot-menu-display-settings-min-width:23rem;--slot-menu-min-height:calc(var(--luzmo-component-height-l) * 2);--slot-menu-font-size:var(--luzmo-font-size-l);--slot-menu-list-item-horizontal-padding:var(--luzmo-spacing-5);--slot-menu-list-item-vertical-padding:var(--luzmo-spacing-3);--slot-menu-label-to-icon-gap:var(--luzmo-spacing-4)}:host([size=xl]){--slot-menu-display-settings-min-width:26rem;--slot-menu-min-height:calc(var(--luzmo-component-height-xl) * 2);--slot-menu-font-size:var(--luzmo-font-size-xl);--slot-menu-list-item-horizontal-padding:var(--luzmo-spacing-5);--slot-menu-list-item-vertical-padding:var(--luzmo-spacing-4);--slot-menu-label-to-icon-gap:var(--luzmo-spacing-5)}`,X=class extends m(h,{validSizes:Object.values(p)}){constructor(...e){super(...e),this.language=`en`,this.contentLanguage=`en`,this.slotContents=[],this.slotName=`measure`,this.slotType=`numeric`,this.activeIndex=0,this._sendChangeEvent=()=>{this.dispatchEvent(new CustomEvent(`luzmo-slot-list-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContents:structuredClone(this.slotContents),activeIndex:this.activeIndex}}))},this._cleanupFns=[],this._attachAll=()=>{[...this._draggableSlotContentElements].forEach(e=>{let t=this._sendChangeEvent.bind(this),n=this,r=Di({element:e,onGenerateDragPreview({nativeSetDragImage:t}){Do({nativeSetDragImage:t,render({container:t}){let n=document.createElement(`div`);n.classList.add(`drag-preview`);let r={};[[`borderColor`,`--luzmo-slot-menu-list-border-color`,`--luzmo-border-color`],[`backgroundColor`,`--luzmo-slot-menu-list-background-color`,`--luzmo-background-color`],[`color`,`--luzmo-slot-menu-list-font-color`,`--slot-menu-list-font-color`],[`fontSize`,`--luzmo-slot-menu-list-font-size`,`--slot-menu-list-font-size`],[`horizontalPadding`,`--luzmo-slot-menu-list-item-horizontal-padding`,`--slot-menu-list-item-horizontal-padding`],[`verticalPadding`,`--luzmo-slot-menu-list-item-vertical-padding`,`--slot-menu-list-item-vertical-padding`],[`borderRadius`,`--luzmo-slot-menu-list-border-radius`,`--luzmo-border-radius`],[`fontFamily`,`--luzmo-slot-menu-list-font-family`,`--luzmo-font-family`]].forEach(([t,n,i])=>{let a=Oo(e,n)||Oo(e,i);r[t]=a}),n.textContent=e.querySelector(`[data-task-content]`)?.textContent||e.dataset.taskLabel||e.textContent,Object.assign(n.style,{border:`1px solid ${r.borderColor}`,backgroundColor:r.backgroundColor,borderRadius:r.borderRadius,fontFamily:r.fontFamily,fontSize:r.fontSize,color:r.color,paddingInline:`${r.horizontalPadding}`,paddingBlock:`${r.verticalPadding}`}),t.append(n)}})},getInitialData(){let t=e.parentElement,n=0;return t&&(n=[...t.parentElement?.children??[]].indexOf(t)),{index:n}},onDragStart(){e.style.opacity=`0.5`},onDrop(){e.style.opacity=`1`}});this._cleanupFns.push(r);let i=Oi({element:e,canDrop({source:t}){return t.element!==e&&t?.element?.classList.contains(`draggable-slot-content`)},getData(t){return wo({},{element:e,input:t.input,allowedEdges:[`top`,`bottom`]})},getIsSticky(){return!0},onDragEnter({self:t}){let n=To(t.data);if(!n)return;let r=document.createElement(`div`);r.classList.add(`drop-indicator`),r.dataset.edge=n,e.after(r)},onDrag({self:t}){let n=To(t.data);if(!n){e.nextElementSibling?.remove();return}if(e.nextElementSibling?.getAttribute(`data-edge`)===n)return;e.nextElementSibling?.remove();let r=document.createElement(`div`);r.classList.add(`drop-indicator`),r.dataset.edge=n,e.after(r)},onDragLeave(){e.nextElementSibling?.remove()},onDrop({self:r,source:i}){e.nextElementSibling?.remove();let a=To(r.data),o=r.element.parentElement;if(typeof i.data.index==`number`&&o){let e=[...o.parentElement?.children??[]].indexOf(o);a===`bottom`&&i.data.index>=e&&e<(o?.parentElement?.children?.length??0)-1?e+=1:a===`top`&&e>i.data.index&&--e;let t=n.activeIndex,r=i.data.index,s=e,c=n.slotContents[r];n.slotContents.splice(r,1),n.slotContents.splice(s,0,c),r===t?n.activeIndex=s:r<t&&s>=t?n.activeIndex=t-1:r>t&&s<=t&&(n.activeIndex=t+1)}a&&(yo(i.element),n.requestUpdate(),t())}});this._cleanupFns.push(i)})},this._detachAll=()=>{this._cleanupFns.forEach(e=>e()),this._cleanupFns=[]}}static get styles(){return[re(ko)]}willUpdate(){this._detachAll()}updated(){this._attachAll()}disconnectedCallback(){super.disconnectedCallback(),this._detachAll()}setActiveIndex(e){this.activeIndex=e,this._sendChangeEvent()}removeSlotContent(e){this.slotContents=this.slotContents.filter((t,n)=>n!==e),this.activeIndex=this.slotContents.length===0?0:Math.min(this.activeIndex,this.slotContents.length-1),this._sendChangeEvent()}_moveItem(e,t){let n=this.slotContents[e],r=[...this.slotContents];r.splice(e,1),r.splice(t,0,n),this.slotContents=r,this.activeIndex===e?this.activeIndex=t:e<this.activeIndex&&t>=this.activeIndex?--this.activeIndex:e>this.activeIndex&&t<=this.activeIndex&&(this.activeIndex+=1),this._sendChangeEvent(),this.updateComplete.then(()=>this._draggableSlotContentElements[t]?.focus())}_handleContentKeydown(e,t){switch(t.key){case` `:case`Enter`:t.preventDefault(),this.setActiveIndex(e);break;case`ArrowUp`:t.preventDefault(),t.altKey&&e>0?this._moveItem(e,e-1):!t.altKey&&e>0&&this._draggableSlotContentElements[e-1]?.focus();break;case`ArrowDown`:t.preventDefault(),t.altKey&&e<this.slotContents.length-1?this._moveItem(e,e+1):!t.altKey&&e<this.slotContents.length-1&&this._draggableSlotContentElements[e+1]?.focus()}}_handleTrashClick(e,t){t.stopPropagation(),this.removeSlotContent(e)}_handleTrashKeydown(e){(e.key===` `||e.key===`Enter`)&&e.stopPropagation()}render(){let t={name:this.slotName,type:this.slotType},n=this.slotContents.map((n,r)=>{let i=x(n.label??{},this.contentLanguage)??e(`Untitled`,{desc:`Fallback label for a slot content without a name`}),a=q(n,t)?Qa(n):void 0,s=r===this.activeIndex;return E`<li class=${s?`active`:``}>
|
|
157
|
+
></luzmo-progress-circle>`,complete:()=>this._renderDisplaySettings(),error:()=>this._renderDisplaySettings()})}disconnectedCallback(){super.disconnectedCallback?.(),this._loadDisplaySettings.abort?.()}};e([O({type:String})],Y.prototype,`language`,void 0),e([O({type:String,attribute:`content-language`})],Y.prototype,`contentLanguage`,void 0),e([O({type:Boolean,attribute:`hide-display-settings`})],Y.prototype,`hideDisplaySettings`,void 0),e([O({type:Boolean})],Y.prototype,`isBinningDisabled`,void 0),e([O({type:Boolean})],Y.prototype,`areDatetimeOptionsEnabled`,void 0),e([O({type:Boolean})],Y.prototype,`areGrandTotalsEnabled`,void 0),e([O({type:Boolean})],Y.prototype,`isAggregationDisabled`,void 0),e([O({type:Boolean})],Y.prototype,`isCumulativeSumEnabled`,void 0),e([O({type:String})],Y.prototype,`periodOverPeriodUiType`,void 0),e([O({type:Boolean,attribute:`show-remove-button`})],Y.prototype,`showRemoveButton`,void 0),e([O({type:String,attribute:`slot-type`})],Y.prototype,`slotType`,void 0),e([O({type:String,attribute:`slot-name`})],Y.prototype,`slotName`,void 0),e([O({type:Object,attribute:!1})],Y.prototype,`slotContent`,void 0),e([O({attribute:!1})],Y.prototype,`datasetsDataFields`,void 0),e([O({type:String,attribute:`api-url`,reflect:!0})],Y.prototype,`apiUrl`,void 0),e([O({type:String,attribute:`auth-key`,reflect:!0})],Y.prototype,`authKey`,void 0),e([O({type:String,attribute:`auth-token`,reflect:!0})],Y.prototype,`authToken`,void 0),e([k()],Y.prototype,`_showIds`,void 0),e([O({type:Array,reflect:!1})],Y.prototype,`measureColumns`,void 0),e([ne(`luzmo-multi-language-field`)],Y.prototype,`_multiLanguageFieldElement`,void 0),e([Zi({context:$i,subscribe:!0})],Y.prototype,`_store`,void 0),customElements.get(`luzmo-display-settings`)||customElements.define(`luzmo-display-settings`,Y);function go({element:e,handle:t,boundary:n=document.documentElement,onDragStart:r,onDragEnd:i}){if(!e||!t)throw Error(`makeDraggable: element and handle are required`);let a=e.ownerDocument??document,o=-1,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=t=>{if(t.pointerId!==o)return;let r=t.clientX-s,i=t.clientY-c,a=(n??document.documentElement).getBoundingClientRect(),h=l+r,g=u+i;h=Math.min(Math.max(h,a.left),a.right-d),g=Math.min(Math.max(g,a.top),a.bottom-f);let _=h-l,v=g-u,y=p+_,b=m+v;e.style.transform=`translate3d(${y}px, ${b}px, 0)`},g=e=>{e.pointerId===o&&(a.removeEventListener(`pointermove`,h),a.removeEventListener(`pointerup`,g),o=-1,i?.())},_=n=>{if(n.button!==0)return;o=n.pointerId;let i=e.getBoundingClientRect();l=i.left,u=i.top,d=i.width,f=i.height,s=n.clientX,c=n.clientY;try{let t=a.defaultView?.getComputedStyle(e);if(t){let e=new DOMMatrixReadOnly(t.transform);p=e.m41,m=e.m42}}catch{p=0,m=0}t.setPointerCapture(o),a.addEventListener(`pointermove`,h),a.addEventListener(`pointerup`,g),r?.()};return t.addEventListener(`pointerdown`,_),()=>{t.removeEventListener(`pointerdown`,_),a.removeEventListener(`pointermove`,h),a.removeEventListener(`pointerup`,g)}}var _o={none:0,small:100,medium:350,large:700},vo=.5;_o.none,_o.small*vo,_o.medium*vo,_o.large*vo;function yo(e){e.animate([{backgroundColor:`var(--ds-background-selected, #E9F2FF)`},{}],{duration:_o.large,easing:`cubic-bezier(0.25, 0.1, 0.25, 1.0)`,iterations:1})}function bo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?bo(Object(n),!0).forEach(function(t){ir(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var So={top:function(e,t){return Math.abs(t.y-e.top)},right:function(e,t){return Math.abs(e.right-t.x)},bottom:function(e,t){return Math.abs(e.bottom-t.y)},left:function(e,t){return Math.abs(t.x-e.left)}},Co=Symbol(`closestEdge`);function wo(e,t){var n=t.element,r=t.input,i=t.allowedEdges,a={x:r.clientX,y:r.clientY},o=n.getBoundingClientRect(),s=i.map(function(e){return{edge:e,value:So[e](o,a)}}).sort(function(e,t){return e.value-t.value})[0]?.edge??null;return xo(xo({},e),{},ir({},Co,s))}function To(e){return e[Co]??null}function Eo(){return{x:0,y:0}}function Do(e){var t=e.render,n=e.nativeSetDragImage,r=e.getOffset,i=r===void 0?Eo:r,a=document.createElement(`div`);Object.assign(a.style,{position:`fixed`,top:0,left:0,zIndex:or,pointerEvents:`none`}),document.body.append(a);var o=t({container:a});queueMicrotask(function(){var e=i({container:a});if(kr()){var t=a.getBoundingClientRect();if(t.width===0)return;a.style.left=`-${t.width-1e-4}px`}n?.(a,e.x,e.y)});function s(){c(),o?.(),document.body.removeChild(a)}var c=xi({onDragStart:s,onDrop:s})}var Oo=(e,t)=>{let n=getComputedStyle(e).getPropertyValue(t);for(;!n&&e.parentElement;)e=e.parentElement,n=getComputedStyle(e).getPropertyValue(t);return n.trim()},ko=`:host{font-family:var(--luzmo-slot-menu-list-font-family,var(--luzmo-font-family));font-size:var(--luzmo-slot-menu-list-font-size,var(--slot-menu-list-font-size));color:var(--luzmo-slot-menu-list-font-color,var(--luzmo-font-color))}ul{margin:0;padding:0;list-style:none}:host{max-height:var(--luzmo-slot-menu-list-max-height,var(--slot-menu-list-max-height));margin:0;padding:0;list-style:none;overflow-y:auto}:host::-webkit-scrollbar{width:var(--luzmo-slot-menu-list-scrollbar-width,var(--slot-menu-list-scrollbar-width))}:host::-webkit-scrollbar-track{background:var(--luzmo-slot-menu-list-scrollbar-track-background,var(--slot-menu-list-scrollbar-track-background));border-radius:var(--luzmo-slot-menu-list-scrollbar-track-border-radius,var(--slot-menu-list-scrollbar-track-border-radius))}:host::-webkit-scrollbar-thumb{background:var(--luzmo-slot-menu-list-scrollbar-thumb-background,var(--slot-menu-list-scrollbar-thumb-background));border-radius:var(--luzmo-slot-menu-list-scrollbar-thumb-border-radius,var(--slot-menu-list-scrollbar-thumb-border-radius))}:host::-webkit-scrollbar-thumb:hover{background:var(--luzmo-slot-menu-list-scrollbar-thumb-hover-background,var(--slot-menu-list-scrollbar-thumb-hover-background))}:host{scrollbar-width:var(--luzmo-scrollbar-width,thin);scrollbar-color:var(--luzmo-slot-menu-list-scrollbar-thumb-background,var(--slot-menu-list-scrollbar-thumb-background)) var(--luzmo-slot-menu-list-scrollbar-track-background,var(--slot-menu-list-scrollbar-track-background));border-right:var(--luzmo-slot-menu-list-border-right-width,var(--luzmo-border-width)) solid var(--luzmo-slot-menu-list-border-right-color,var(--luzmo-border-color))}:host li{cursor:pointer;position:relative}:host li:hover{background-color:var(--luzmo-slot-menu-list-background-color-hover,var(--slot-menu-list-background-color-hover))}:host li{border-bottom:var(--luzmo-slot-menu-list-border-bottom-width,var(--slot-menu-list-border-bottom-width)) solid var(--luzmo-slot-menu-list-border-bottom-color,var(--slot-menu-list-border-bottom-color))}:host .active{background-color:var(--luzmo-slot-menu-list-active-background-color,var(--slot-menu-list-active-background-color));color:var(--luzmo-slot-menu-list-active-color,var(--slot-menu-list-active-color))}:host .active:hover{background-color:var(--luzmo-slot-menu-list-active-background-color-hover,var(--slot-menu-list-active-background-color-hover))}:host .active .draggable-slot-content:focus-visible{background-color:var(--luzmo-slot-menu-list-active-background-color-hover,var(--slot-menu-list-active-background-color-hover));outline:none}:host .active .draggable-slot-content-remove:focus-visible{outline-color:var(--luzmo-slot-menu-list-active-color,var(--slot-menu-list-active-color));background-color:var(--luzmo-slot-menu-list-active-background-color-hover,var(--slot-menu-list-active-background-color-hover))}.calculation-label{align-items:center;gap:var(--luzmo-spacing-3);display:inline-flex}.calculation-label-icon{flex:none;display:inline-flex}.drop-indicator{height:var(--luzmo-slot-menu-list-drop-indicator-height,var(--slot-menu-list-drop-indicator-height));background-color:var(--luzmo-slot-menu-list-drop-indicator-color,var(--slot-menu-list-drop-indicator-color));position:absolute;left:0;right:0}.drop-indicator:before{content:"";border:var(--luzmo-slot-menu-list-drop-indicator-height,var(--slot-menu-list-drop-indicator-height)) solid var(--luzmo-slot-menu-list-drop-indicator-color,var(--slot-menu-list-drop-indicator-color));background:var(--luzmo-slot-menu-list-drop-indicator-background,var(--luzmo-background-color));width:100%;left:calc(-.5 * (var(--luzmo-slot-menu-list-drop-indicator-circle-size,var(--slot-menu-list-drop-indicator-circle-size)) + var(--luzmo-slot-menu-list-drop-indicator-height,var(--slot-menu-list-drop-indicator-height))));top:calc(-.5 * (var(--luzmo-slot-menu-list-drop-indicator-circle-size,var(--slot-menu-list-drop-indicator-circle-size)) + var(--luzmo-slot-menu-list-drop-indicator-height,var(--slot-menu-list-drop-indicator-height))));height:var(--luzmo-slot-menu-list-drop-indicator-circle-size,var(--slot-menu-list-drop-indicator-circle-size));width:var(--luzmo-slot-menu-list-drop-indicator-circle-size,var(--slot-menu-list-drop-indicator-circle-size));border-radius:50%;display:block;position:absolute}.drop-indicator[data-edge=top]{top:calc(-.5 * var(--luzmo-slot-menu-list-drop-indicator-height,var(--slot-menu-list-drop-indicator-height)))}.drop-indicator[data-edge=bottom]{bottom:calc(-.5 * var(--luzmo-slot-menu-list-drop-indicator-height,var(--slot-menu-list-drop-indicator-height)))}.draggable-slot-content{justify-content:space-between;gap:var(--luzmo-slot-menu-label-to-icon-gap,var(--slot-menu-label-to-icon-gap));touch-action:none;cursor:pointer;align-items:center;display:flex}.draggable-slot-content:focus-visible{background-color:color-mix(in srgb, var(--luzmo-primary) 20%, transparent);outline:none}.draggable-slot-content .draggable-slot-content-label{padding-block:var(--luzmo-slot-menu-list-item-vertical-padding,var(--slot-menu-list-item-vertical-padding));text-overflow:ellipsis;white-space:nowrap;font:inherit;color:inherit;cursor:inherit;text-align:start;background:0 0;border:none;flex:auto;padding-inline-start:var(--luzmo-slot-menu-list-item-horizontal-padding,var(--slot-menu-list-item-horizontal-padding));overflow:hidden}.draggable-slot-content .draggable-slot-content-remove{padding:var(--luzmo-spacing-1);font:inherit;color:inherit;cursor:inherit;border-radius:var(--luzmo-border-radius);background:0 0;border:none;flex:none;justify-content:center;align-items:center;margin-inline-end:var(--luzmo-slot-menu-list-item-horizontal-padding,var(--slot-menu-list-item-horizontal-padding));display:flex}.draggable-slot-content .draggable-slot-content-remove:focus-visible{outline:var(--luzmo-indicator-width) solid var(--luzmo-indicator-color);outline-offset:1px}:host{--slot-menu-list-active-background-color:var(--luzmo-primary);--slot-menu-list-active-background-color-hover:var(--luzmo-primary-hover);--slot-menu-list-active-color:var(--luzmo-primary-inverse-color);--slot-menu-list-background-color-hover:var(--luzmo-background-color-hover);--slot-menu-list-drop-indicator-color:var(--luzmo-font-color-down);--slot-menu-list-drop-indicator-height:2px;--slot-menu-list-drop-indicator-circle-size:4px;--slot-menu-list-border-bottom-width:0px;--slot-menu-list-border-bottom-color:transparent;--slot-menu-list-max-height:calc(var(--luzmo-component-height) * 4);--slot-menu-list-scrollbar-width:var(--luzmo-scrollbar-size);--slot-menu-list-scrollbar-track-background:var(--luzmo-scrollbar-track-background);--slot-menu-list-scrollbar-track-border-radius:var(--luzmo-scrollbar-track-border-radius);--slot-menu-list-scrollbar-thumb-background:var(--luzmo-scrollbar-thumb-background);--slot-menu-list-scrollbar-thumb-border-radius:var(--luzmo-scrollbar-thumb-border-radius);--slot-menu-list-scrollbar-thumb-hover-background:var(--luzmo-scrollbar-thumb-hover-background);--slot-menu-display-settings-min-width:19rem;--slot-menu-min-height:calc(var(--luzmo-component-height) * 2);--slot-menu-font-size:var(--luzmo-font-size);--slot-menu-list-item-horizontal-padding:var(--luzmo-spacing-4);--slot-menu-list-item-vertical-padding:var(--luzmo-spacing-3);--slot-menu-label-to-icon-gap:var(--luzmo-spacing-3)}:host([size=s]){--slot-menu-display-settings-min-width:16rem;--slot-menu-min-height:calc(var(--luzmo-component-height-s) * 2);--slot-menu-font-size:var(--luzmo-font-size-s);--slot-menu-list-item-horizontal-padding:var(--luzmo-spacing-3);--slot-menu-list-item-vertical-padding:var(--luzmo-spacing-3);--slot-menu-label-to-icon-gap:var(--luzmo-spacing-2)}:host([size=l]){--slot-menu-display-settings-min-width:23rem;--slot-menu-min-height:calc(var(--luzmo-component-height-l) * 2);--slot-menu-font-size:var(--luzmo-font-size-l);--slot-menu-list-item-horizontal-padding:var(--luzmo-spacing-5);--slot-menu-list-item-vertical-padding:var(--luzmo-spacing-3);--slot-menu-label-to-icon-gap:var(--luzmo-spacing-4)}:host([size=xl]){--slot-menu-display-settings-min-width:26rem;--slot-menu-min-height:calc(var(--luzmo-component-height-xl) * 2);--slot-menu-font-size:var(--luzmo-font-size-xl);--slot-menu-list-item-horizontal-padding:var(--luzmo-spacing-5);--slot-menu-list-item-vertical-padding:var(--luzmo-spacing-4);--slot-menu-label-to-icon-gap:var(--luzmo-spacing-5)}`,X=class extends y(p,{validSizes:Object.values(h)}){constructor(...e){super(...e),this.language=`en`,this.contentLanguage=`en`,this.slotContents=[],this.slotName=`measure`,this.slotType=`numeric`,this.activeIndex=0,this._sendChangeEvent=()=>{this.dispatchEvent(new CustomEvent(`luzmo-slot-list-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContents:structuredClone(this.slotContents),activeIndex:this.activeIndex}}))},this._cleanupFns=[],this._attachAll=()=>{[...this._draggableSlotContentElements].forEach(e=>{let t=this._sendChangeEvent.bind(this),n=this,r=Di({element:e,onGenerateDragPreview({nativeSetDragImage:t}){Do({nativeSetDragImage:t,render({container:t}){let n=document.createElement(`div`);n.classList.add(`drag-preview`);let r={};[[`borderColor`,`--luzmo-slot-menu-list-border-color`,`--luzmo-border-color`],[`backgroundColor`,`--luzmo-slot-menu-list-background-color`,`--luzmo-background-color`],[`color`,`--luzmo-slot-menu-list-font-color`,`--slot-menu-list-font-color`],[`fontSize`,`--luzmo-slot-menu-list-font-size`,`--slot-menu-list-font-size`],[`horizontalPadding`,`--luzmo-slot-menu-list-item-horizontal-padding`,`--slot-menu-list-item-horizontal-padding`],[`verticalPadding`,`--luzmo-slot-menu-list-item-vertical-padding`,`--slot-menu-list-item-vertical-padding`],[`borderRadius`,`--luzmo-slot-menu-list-border-radius`,`--luzmo-border-radius`],[`fontFamily`,`--luzmo-slot-menu-list-font-family`,`--luzmo-font-family`]].forEach(([t,n,i])=>{let a=Oo(e,n)||Oo(e,i);r[t]=a}),n.textContent=e.querySelector(`[data-task-content]`)?.textContent||e.dataset.taskLabel||e.textContent,Object.assign(n.style,{border:`1px solid ${r.borderColor}`,backgroundColor:r.backgroundColor,borderRadius:r.borderRadius,fontFamily:r.fontFamily,fontSize:r.fontSize,color:r.color,paddingInline:`${r.horizontalPadding}`,paddingBlock:`${r.verticalPadding}`}),t.append(n)}})},getInitialData(){let t=e.parentElement,n=0;return t&&(n=[...t.parentElement?.children??[]].indexOf(t)),{index:n}},onDragStart(){e.style.opacity=`0.5`},onDrop(){e.style.opacity=`1`}});this._cleanupFns.push(r);let i=Oi({element:e,canDrop({source:t}){return t.element!==e&&t?.element?.classList.contains(`draggable-slot-content`)},getData(t){return wo({},{element:e,input:t.input,allowedEdges:[`top`,`bottom`]})},getIsSticky(){return!0},onDragEnter({self:t}){let n=To(t.data);if(!n)return;let r=document.createElement(`div`);r.classList.add(`drop-indicator`),r.dataset.edge=n,e.after(r)},onDrag({self:t}){let n=To(t.data);if(!n){e.nextElementSibling?.remove();return}if(e.nextElementSibling?.getAttribute(`data-edge`)===n)return;e.nextElementSibling?.remove();let r=document.createElement(`div`);r.classList.add(`drop-indicator`),r.dataset.edge=n,e.after(r)},onDragLeave(){e.nextElementSibling?.remove()},onDrop({self:r,source:i}){e.nextElementSibling?.remove();let a=To(r.data),o=r.element.parentElement;if(typeof i.data.index==`number`&&o){let e=[...o.parentElement?.children??[]].indexOf(o);a===`bottom`&&i.data.index>=e&&e<(o?.parentElement?.children?.length??0)-1?e+=1:a===`top`&&e>i.data.index&&--e;let t=n.activeIndex,r=i.data.index,s=e,c=n.slotContents[r];n.slotContents.splice(r,1),n.slotContents.splice(s,0,c),r===t?n.activeIndex=s:r<t&&s>=t?n.activeIndex=t-1:r>t&&s<=t&&(n.activeIndex=t+1)}a&&(yo(i.element),n.requestUpdate(),t())}});this._cleanupFns.push(i)})},this._detachAll=()=>{this._cleanupFns.forEach(e=>e()),this._cleanupFns=[]}}static get styles(){return[A(ko)]}willUpdate(){this._detachAll()}updated(){this._attachAll()}disconnectedCallback(){super.disconnectedCallback(),this._detachAll()}setActiveIndex(e){this.activeIndex=e,this._sendChangeEvent()}removeSlotContent(e){this.slotContents=this.slotContents.filter((t,n)=>n!==e),this.activeIndex=this.slotContents.length===0?0:Math.min(this.activeIndex,this.slotContents.length-1),this._sendChangeEvent()}_moveItem(e,t){let n=this.slotContents[e],r=[...this.slotContents];r.splice(e,1),r.splice(t,0,n),this.slotContents=r,this.activeIndex===e?this.activeIndex=t:e<this.activeIndex&&t>=this.activeIndex?--this.activeIndex:e>this.activeIndex&&t<=this.activeIndex&&(this.activeIndex+=1),this._sendChangeEvent(),this.updateComplete.then(()=>this._draggableSlotContentElements[t]?.focus())}_handleContentKeydown(e,t){switch(t.key){case` `:case`Enter`:t.preventDefault(),this.setActiveIndex(e);break;case`ArrowUp`:t.preventDefault(),t.altKey&&e>0?this._moveItem(e,e-1):!t.altKey&&e>0&&this._draggableSlotContentElements[e-1]?.focus();break;case`ArrowDown`:t.preventDefault(),t.altKey&&e<this.slotContents.length-1?this._moveItem(e,e+1):!t.altKey&&e<this.slotContents.length-1&&this._draggableSlotContentElements[e+1]?.focus()}}_handleTrashClick(e,t){t.stopPropagation(),this.removeSlotContent(e)}_handleTrashKeydown(e){(e.key===` `||e.key===`Enter`)&&e.stopPropagation()}render(){let e={name:this.slotName,type:this.slotType},n=this.slotContents.map((n,r)=>{let i=x(n.label??{},this.contentLanguage)??t(`Untitled`,{desc:`Fallback label for a slot content without a name`}),a=q(n,e)?Qa(n):void 0,s=r===this.activeIndex;return T`<li class=${s?`active`:``}>
|
|
158
158
|
<div class="draggable-slot-content"
|
|
159
159
|
data-task-label=${a??i}
|
|
160
160
|
tabindex="0"
|
|
@@ -168,20 +168,20 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
168
168
|
</span>
|
|
169
169
|
<button
|
|
170
170
|
class="draggable-slot-content-remove"
|
|
171
|
-
aria-label=${
|
|
171
|
+
aria-label=${t(`Remove`,{desc:`Remove button label`})}
|
|
172
172
|
@click=${this._handleTrashClick.bind(this,r)}
|
|
173
173
|
@keydown=${this._handleTrashKeydown}
|
|
174
174
|
>
|
|
175
175
|
${f(o)}
|
|
176
176
|
</button>
|
|
177
177
|
</div>
|
|
178
|
-
</li>`});return E`<ul role="listbox" aria-label=${e(`Slot contents`,{desc:`Accessible label for slot menu content list`})}>${n}</ul>`}};n([k({type:String,reflect:!0})],X.prototype,`language`,void 0),n([k({type:String,attribute:`content-language`,reflect:!0})],X.prototype,`contentLanguage`,void 0),n([ne(`.draggable-slot-content`)],X.prototype,`_draggableSlotContentElements`,void 0),n([k({type:Array})],X.prototype,`slotContents`,void 0),n([k({type:String,attribute:`slot-name`,reflect:!0})],X.prototype,`slotName`,void 0),n([k({type:String,attribute:`slot-type`,reflect:!0})],X.prototype,`slotType`,void 0),n([k({type:Number})],X.prototype,`activeIndex`,void 0),customElements.get(`luzmo-slot-menu-list`)||customElements.define(`luzmo-slot-menu-list`,X);var Ao=`:host{font-family:var(--luzmo-slot-menu-font-family,var(--luzmo-font-family));font-size:var(--luzmo-slot-menu-font-size,var(--slot-menu-font-size));color:var(--luzmo-slot-menu-font-color,var(--luzmo-font-color));width:fit-content;display:block}luzmo-slot-menu-list{min-width:var(--luzmo-slot-menu-list-min-width,var(--slot-menu-list-min-width));max-width:var(--luzmo-slot-menu-list-max-width,var(--slot-menu-list-max-width));background-color:var(--luzmo-slot-menu-list-background-color,var(--slot-menu-list-background-color));border-bottom-left-radius:var(--luzmo-slot-menu-list-border-radius,var(--slot-menu-list-border-radius))}.slot-contents-container{border:var(--luzmo-slot-menu-border-width,var(--luzmo-border-width)) solid var(--luzmo-slot-menu-border-color,var(--luzmo-border-color));border-radius:var(--luzmo-slot-menu-border-radius,var(--luzmo-border-radius));background:var(--luzmo-slot-menu-background-color,var(--luzmo-background-color));--slot-menu-popup-filter:drop-shadow(var(--luzmo-slot-menu-popup-shadow-horizontal,var(--slot-menu-popup-shadow-horizontal)) var(--luzmo-slot-menu-popup-shadow-vertical,var(--slot-menu-popup-shadow-vertical)) var(--luzmo-slot-menu-popup-shadow-blur,var(--slot-menu-popup-shadow-blur)) var(--luzmo-slot-menu-popup-shadow-color,var(--slot-menu-popup-shadow-color)));filter:var(--luzmo-slot-menu-popup-filter,var(--slot-menu-popup-filter));border-top-left-radius:0;position:relative}.slot-contents-container .inner-container{align-items:stretch;display:flex}.slot-contents-container .inner-container luzmo-display-settings{min-width:var(--luzmo-slot-menu-display-settings-min-width,var(--slot-menu-display-settings-min-width));padding:var(--luzmo-slot-menu-display-settings-vertical-padding,var(--slot-menu-display-settings-vertical-padding)) var(--luzmo-slot-menu-display-settings-horizontal-padding,var(--slot-menu-display-settings-horizontal-padding))}.slot-contents-container:has(>.close) .inner-container luzmo-display-settings{padding-block-start:var(--luzmo-slot-menu-close-button-clearance,var(--slot-menu-close-button-clearance))}:host([variant=popup]) .slot-contents-container{border-top-left-radius:var(--luzmo-slot-menu-border-radius,var(--luzmo-border-radius));overflow:hidden}.slot-menu-top-menu{border-radius:var(--luzmo-slot-menu-border-radius,var(--luzmo-border-radius));z-index:1;width:fit-content;margin-bottom:calc(-1 * var(--luzmo-slot-menu-border-width,var(--luzmo-border-width)));border-bottom-right-radius:0;border-bottom-left-radius:0;align-items:center;display:flex;position:relative;overflow:hidden}.drag-handle{background-color:var(--luzmo-slot-menu-drag-handle-background-color,var(--luzmo-background-color-highlight));cursor:move;border:var(--luzmo-slot-menu-drag-handle-border-width,var(--slot-menu-drag-handle-border-width)) solid var(--luzmo-slot-menu-border-color,var(--luzmo-background-color-highlight));width:fit-content;font-size:var(--luzmo-slot-menu-drag-handle-size,var(--slot-menu-drag-handle-size));padding:var(--luzmo-slot-menu-drag-handle-vertical-padding,var(--slot-menu-drag-handle-vertical-padding)) var(--luzmo-slot-menu-drag-handle-horizontal-padding,var(--slot-menu-drag-handle-horizontal-padding));border-bottom:none}.drag-handle:hover{background-color:var(--luzmo-slot-menu-drag-handle-background-color-hover,var(--luzmo-background-color-highlight-hover))}.drag-handle:focus-visible{box-shadow:0 0 0 var(--luzmo-indicator-width) var(--luzmo-indicator-color)}.slot-content-action{max-width:var(--luzmo-slot-menu-top-menu-label-max-width,var(--slot-menu-top-menu-label-max-width));gap:var(--luzmo-slot-menu-label-to-icon-gap,var(--slot-menu-label-to-icon-gap));background-color:var(--luzmo-slot-menu-content-label-background-color,var(--luzmo-primary));color:var(--luzmo-slot-menu-content-label-color,var(--luzmo-primary-inverse-color));border:var(--luzmo-slot-menu-border-width,var(--luzmo-border-width)) solid var(--luzmo-slot-menu-content-label-border-color,var(--luzmo-primary));padding:var(--luzmo-slot-menu-drag-handle-vertical-padding,var(--slot-menu-drag-handle-vertical-padding)) var(--luzmo-slot-menu-drag-handle-horizontal-padding,var(--slot-menu-drag-handle-horizontal-padding));border-bottom:none;flex:0 auto;display:flex}.slot-content-action:hover{background-color:var(--luzmo-slot-menu-content-label-background-color-hover,var(--luzmo-primary-hover))}.slot-content-action:focus{background-color:var(--luzmo-slot-menu-content-label-background-color-focus,var(--luzmo-primary-focus))}.slot-content-action .slot-content-label{white-space:nowrap;text-overflow:ellipsis;flex:auto;overflow:hidden}.slot-content-action .slot-content-remove{cursor:pointer;border-radius:var(--luzmo-slot-menu-border-radius,var(--luzmo-border-radius));font:inherit;color:inherit;background:0 0;border:none;flex:none;padding:0}.slot-content-action .slot-content-remove:focus-visible{background-color:var(--luzmo-slot-menu-content-label-background-color-focus,var(--luzmo-primary-focus));box-shadow:0 0 0 var(--luzmo-indicator-width) var(--luzmo-slot-menu-content-label-color,var(--luzmo-primary-inverse-color));outline:none}.calculation-label{align-items:center;gap:var(--luzmo-spacing-3);display:inline-flex}.calculation-label-icon{flex:none;display:inline-flex}.close{font:inherit;color:inherit;right:var(--luzmo-slot-menu-close-icon-right,var(--slot-menu-close-icon-right));cursor:pointer;top:calc(-2 * var(--luzmo-slot-menu-border-width,var(--luzmo-border-width)));background:0 0;background-color:var(--luzmo-slot-menu-close-button-background-color,var(--luzmo-background-color-highlight));font-size:var(--luzmo-slot-menu-close-button-size,var(--slot-menu-close-button-size));border:none;border:var(--luzmo-slot-menu-border-width,var(--luzmo-border-width)) solid var(--luzmo-slot-menu-border-color,var(--luzmo-border-color));border-radius:var(--luzmo-slot-menu-border-radius,var(--luzmo-border-radius));padding:0;padding:var(--luzmo-slot-menu-close-button-vertical-padding,var(--slot-menu-close-button-vertical-padding)) var(--luzmo-slot-menu-close-button-horizontal-padding,var(--slot-menu-close-button-horizontal-padding));border-top-left-radius:0;border-top-right-radius:0;position:absolute}.close:hover{background-color:var(--luzmo-slot-menu-close-button-background-color-hover,var(--luzmo-background-color-highlight-hover))}.close:focus-visible{border-color:var(--luzmo-indicator-color);outline:none}:host{--slot-menu-display-settings-min-width:19rem;--slot-menu-min-height:calc(var(--luzmo-component-height) * 2);--slot-menu-font-size:var(--luzmo-font-size);--slot-menu-display-settings-horizontal-padding:var(--luzmo-spacing-5);--slot-menu-display-settings-vertical-padding:var(--luzmo-spacing-4);--slot-menu-top-menu-label-max-width:12rem;--slot-menu-list-min-width:8rem;--slot-menu-list-max-width:12rem;--slot-menu-label-to-icon-gap:var(--luzmo-spacing-3);--slot-menu-drag-handle-size:var(--luzmo-font-size);--slot-menu-drag-handle-vertical-padding:var(--luzmo-spacing-2);--slot-menu-drag-handle-horizontal-padding:var(--luzmo-spacing-3);--slot-menu-drag-handle-border-width:var(--luzmo-border-width);--slot-menu-close-button-size:var(--luzmo-font-size-s);--slot-menu-close-button-vertical-padding:var(--luzmo-spacing-2);--slot-menu-close-button-horizontal-padding:calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--slot-menu-close-button-clearance:calc(var(--luzmo-slot-menu-close-button-size,var(--slot-menu-close-button-size)) + 2 * var(--luzmo-slot-menu-close-button-vertical-padding,var(--slot-menu-close-button-vertical-padding)) + 2 * var(--luzmo-slot-menu-border-width,var(--luzmo-border-width)) + var(--luzmo-spacing-2));--slot-menu-popup-shadow-horizontal:0;--slot-menu-popup-shadow-vertical:1px;--slot-menu-popup-shadow-blur:4px;--slot-menu-popup-shadow-color:var(--luzmo-border-color);--slot-menu-popup-box-shadow:var(--slot-menu-popup-shadow-horizontal) var(--slot-menu-popup-shadow-vertical) var(--slot-menu-popup-shadow-blur) var(--slot-menu-popup-shadow-color);--slot-menu-close-icon-right:1rem;--slot-menu-list-border-radius:var(--luzmo-border-radius)}:host([size=s]){--slot-menu-display-settings-min-width:16rem;--slot-menu-min-height:calc(var(--luzmo-component-height-s) * 2);--slot-menu-font-size:var(--luzmo-font-size-s);--slot-menu-display-settings-horizontal-padding:var(--luzmo-spacing-4);--slot-menu-display-settings-vertical-padding:var(--luzmo-spacing-3);--slot-menu-top-menu-label-max-width:10rem;--slot-menu-list-min-width:6rem;--slot-menu-list-max-width:10rem;--slot-menu-label-to-icon-gap:var(--luzmo-spacing-2);--slot-menu-drag-handle-size:var(--luzmo-font-size-s);--slot-menu-drag-handle-vertical-padding:var(--luzmo-spacing-2);--slot-menu-drag-handle-horizontal-padding:var(--luzmo-spacing-3);--slot-menu-close-button-size:var(--luzmo-font-size-xs);--slot-menu-close-button-vertical-padding:var(--luzmo-spacing-2);--slot-menu-close-button-horizontal-padding:calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1))}:host([size=l]){--slot-menu-display-settings-min-width:23rem;--slot-menu-min-height:calc(var(--luzmo-component-height-l) * 2);--slot-menu-font-size:var(--luzmo-font-size-l);--slot-menu-display-settings-horizontal-padding:calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--slot-menu-display-settings-vertical-padding:var(--luzmo-spacing-5);--slot-menu-top-menu-label-max-width:14rem;--slot-menu-list-min-width:9rem;--slot-menu-list-max-width:14rem;--slot-menu-label-to-icon-gap:var(--luzmo-spacing-4);--slot-menu-drag-handle-size:var(--luzmo-font-size-l);--slot-menu-drag-handle-vertical-padding:var(--luzmo-spacing-3);--slot-menu-drag-handle-horizontal-padding:var(--luzmo-spacing-3);--slot-menu-close-button-size:var(--luzmo-font-size);--slot-menu-close-button-vertical-padding:calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--slot-menu-close-button-horizontal-padding:var(--luzmo-spacing-3)}:host([size=xl]){--slot-menu-display-settings-min-width:26rem;--slot-menu-min-height:calc(var(--luzmo-component-height-xl) * 2);--slot-menu-font-size:var(--luzmo-font-size-xl);--slot-menu-display-settings-horizontal-padding:calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-2));--slot-menu-display-settings-vertical-padding:var(--luzmo-spacing-5);--slot-menu-top-menu-label-max-width:16rem;--slot-menu-list-min-width:10rem;--slot-menu-list-max-width:16rem;--slot-menu-label-to-icon-gap:var(--luzmo-spacing-5);--slot-menu-drag-handle-size:var(--luzmo-font-size-xl);--slot-menu-drag-handle-vertical-padding:var(--luzmo-spacing-3);--slot-menu-drag-handle-horizontal-padding:var(--luzmo-spacing-4);--slot-menu-close-button-size:var(--luzmo-font-size-l);--slot-menu-close-button-vertical-padding:var(--luzmo-spacing-3);--slot-menu-close-button-horizontal-padding:var(--luzmo-spacing-3)}`,Z=class extends Ka(m(h,{validSizes:Object.values(p)})){constructor(...e){super(...e),this.language=`en`,this.contentLanguage=`en`,this.slotType=`numeric`,this.variant=`draggable`,this._periodOverPeriodUiType=null,this.measureColumns=[],this.apiUrl=`https://api.luzmo.com`,this.authKey=``,this.authToken=``,this.datasetsDataFields=[],this._slotContents=[],this._activeIndex=this.slotIndex??0,this._linkedDatasetsIds=[]}static get styles(){return[re(Ao)]}get _store(){return this._consumedStore?this._consumedStore:(this._ownStore||(this._ownStore=new Ja,new Xi(this,{context:$i,initialValue:this._ownStore})),this._ownStore)}get _currentSlotContent(){return this._slotContents[this.slotIndex??this._activeIndex]??{}}get _showRemoveButton(){return!this.noRemove&&this.variant===`popup`&&(typeof this.slotIndex==`number`||this._slotContents?.length===1)}get _currentLabel(){return x(this._currentSlotContent.label,this.contentLanguage)??`Untitled`}_renderCurrentLabel(){let e={name:this.slotName,type:this.slotType};return q(this._currentSlotContent,e)?eo(this._currentSlotContent):this._currentLabel}connectedCallback(){let e={};this.apiUrl&&(e.apiUrl=this.apiUrl),this.authKey&&this.authToken&&(e.authKey=this.authKey,e.authToken=this.authToken),y.configure(e),super.connectedCallback(),this._attachDragHandle()}disconnectedCallback(){super.disconnectedCallback(),this._cleanupDrag&&=(this._cleanupDrag(),void 0),this._panelResizeObserver?.disconnect(),this._panelResizeObserver=void 0}_syncListMaxHeight(){let e=this.displaySettingsElement,t=this.slotMenuListElement;if(!e||!t)return;let n=e.offsetHeight;n>0&&t.style.setProperty(`--luzmo-slot-menu-list-max-height`,`${n}px`)}_observePanelResize(){let e=this.displaySettingsElement;e&&(this._panelResizeObserver||=new ResizeObserver(()=>this._syncListMaxHeight()),this._panelResizeObserver.disconnect(),this._panelResizeObserver.observe(e),this._syncListMaxHeight())}_attachDragHandle(){if(this._cleanupDrag||this.variant!==`draggable`||this.noDrag)return;let e=this.renderRoot.querySelector(`.drag-handle`);if(!e)return;let t=this.dragBoundary?document.querySelector(this.dragBoundary):document.documentElement;this._cleanupDrag=go({element:this,handle:e,boundary:t})}_sendChangeEvent(){let e=this._store.slotContents.get();this.dispatchEvent(new CustomEvent(`luzmo-slot-contents-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContents:structuredClone(e),linkedDatasetsIds:[...this._linkedDatasetsIds]}}))}resetInfoVisibility(){this.displaySettingsElement?.resetInfoVisibility&&this.displaySettingsElement.resetInfoVisibility(!1)}_sendCloseEvent(){this.dispatchEvent(new CustomEvent(`luzmo-close`,{bubbles:!0,composed:!0,cancelable:!0}))}isArrayColumnType(e){return e.startsWith(`array[`)}async willUpdate(e){let t=this._store,n=t.slotContents.get(),r=e.has(`slotContents`);Array.isArray(this.slotContents)&&(n.length===0||r)&&t.setContents(structuredClone(this.slotContents),this.slotName);let i=t.slotContents.get();if(i!==this._slotContents){this._slotContents=i;let{set:e,column:n}=this._currentSlotContent;if(e&&_e(e)&&e!==this._lastFetchedDatasetId){if(this._lastFetchedDatasetId=e,await y.fetchDatasetsRecursive([e]),!this.isConnected)return;this._linkedDatasetsIds=y.getLinkedDatasetsIds(e)}let r=y.getAvailableDatasets();this.measureColumns=r.map(e=>({datasetId:e.id,datasetName:e.name,columns:e.columns?.filter(e=>e.type===`numeric`&&e.id!==n)})),typeof this.slotIndex!=`number`&&t.activeIndex.get()!==this._activeIndex&&t.updateActive(this._activeIndex);let a=this.itemType===`kpi`?`comparison-measure`:`measure`;if(this.slotName===a){t.linkedDataset.set(r.filter(t=>t.id===e)),t.setPeriodOverPeriodCondition(this.itemType,this._currentSlotContent);let n=this._currentSlotContent.subtype===`duration`&&this.isArrayColumnType(this._currentSlotContent.type);this._periodOverPeriodUiType=n?null:t.periodOverPeriodUiType.get()}}}updated(){this.displaySettingsElement&&(this.displaySettingsElement.periodOverPeriodUiType=this._periodOverPeriodUiType,this.displaySettingsElement.measureColumns=this.measureColumns,this.displaySettingsElement.showRemoveButton=this._showRemoveButton),this._observePanelResize()}_handleSlotListChange(e){let t=this._store,n=structuredClone(e.detail.slotContents),r=e.detail.activeIndex;r!==this._activeIndex&&(this._activeIndex=r,t.updateActive(r)),t.setContents(n,this.slotName),this._slotContents=t.slotContents.get();let i=this._slotContents[this._activeIndex],a=i?.column??i?.columnId,o=i?.set??i?.datasetId,s=i?.formulaId??(v(i?.formula)?i.formula:void 0);(a||s)&&o&&(this.dispatchEvent(new CustomEvent(`luzmo-slot-menu-active`,{bubbles:!0,composed:!0,detail:{datasetId:o}})),setTimeout(()=>{this.dispatchEvent(new CustomEvent(`luzmo-slot-menu-highlight`,{bubbles:!0,composed:!0,detail:{datasetId:o,level:i?.level??0,...a&&{columnId:a},...s&&{formulaId:s}}}))})),this._slotContents.length<=1&&this.requestUpdate(),this._sendChangeEvent()}_handleSlotContentChange(e){let t=this._store,n=this.slotIndex??this._activeIndex;t.updateContent(structuredClone(e.detail.slotContent),n),this._slotContents=t.slotContents.get(),this.slotMenuListElement&&(this.slotMenuListElement.slotContents=this._slotContents),this._sendChangeEvent()}removeSlotContent(e){let t=this._store;t.removeContent(e),this._slotContents=t.slotContents.get(),this._slotContents.length===0&&this.dispatchEvent(new CustomEvent(`luzmo-slot-menu-inactive`,{bubbles:!0,composed:!0})),this._sendChangeEvent(),this.close(),this.requestUpdate()}close(){this._sendCloseEvent(),this.resetInfoVisibility()}_removeActiveSlotContent(){this.removeSlotContent(this.slotIndex??this._activeIndex)}_handleInfoVisibilityChanged(e){this.dispatchEvent(new CustomEvent(`luzmo-info-visibility-changed`,{detail:e.detail}))}render(){let t=`${this.slotType}-${this._currentSlotContent?.type??``}`;return E`<div class="slot-menu-top-menu" role="region" aria-label=${e(`Slot menu`,{desc:`Accessible label for slot menu region`})}>
|
|
179
|
-
${this.variant===`draggable`?
|
|
180
|
-
${this._slotContents&&this._slotContents.length===1&&this.variant!==`popup`?
|
|
178
|
+
</li>`});return T`<ul role="listbox" aria-label=${t(`Slot contents`,{desc:`Accessible label for slot menu content list`})}>${n}</ul>`}};e([O({type:String,reflect:!0})],X.prototype,`language`,void 0),e([O({type:String,attribute:`content-language`,reflect:!0})],X.prototype,`contentLanguage`,void 0),e([re(`.draggable-slot-content`)],X.prototype,`_draggableSlotContentElements`,void 0),e([O({type:Array})],X.prototype,`slotContents`,void 0),e([O({type:String,attribute:`slot-name`,reflect:!0})],X.prototype,`slotName`,void 0),e([O({type:String,attribute:`slot-type`,reflect:!0})],X.prototype,`slotType`,void 0),e([O({type:Number})],X.prototype,`activeIndex`,void 0),customElements.get(`luzmo-slot-menu-list`)||customElements.define(`luzmo-slot-menu-list`,X);var Ao=`:host{font-family:var(--luzmo-slot-menu-font-family,var(--luzmo-font-family));font-size:var(--luzmo-slot-menu-font-size,var(--slot-menu-font-size));color:var(--luzmo-slot-menu-font-color,var(--luzmo-font-color));width:fit-content;display:block}luzmo-slot-menu-list{min-width:var(--luzmo-slot-menu-list-min-width,var(--slot-menu-list-min-width));max-width:var(--luzmo-slot-menu-list-max-width,var(--slot-menu-list-max-width));background-color:var(--luzmo-slot-menu-list-background-color,var(--slot-menu-list-background-color));border-bottom-left-radius:var(--luzmo-slot-menu-list-border-radius,var(--slot-menu-list-border-radius))}.slot-contents-container{border:var(--luzmo-slot-menu-border-width,var(--luzmo-border-width)) solid var(--luzmo-slot-menu-border-color,var(--luzmo-border-color));border-radius:var(--luzmo-slot-menu-border-radius,var(--luzmo-border-radius));background:var(--luzmo-slot-menu-background-color,var(--luzmo-background-color));--slot-menu-popup-filter:drop-shadow(var(--luzmo-slot-menu-popup-shadow-horizontal,var(--slot-menu-popup-shadow-horizontal)) var(--luzmo-slot-menu-popup-shadow-vertical,var(--slot-menu-popup-shadow-vertical)) var(--luzmo-slot-menu-popup-shadow-blur,var(--slot-menu-popup-shadow-blur)) var(--luzmo-slot-menu-popup-shadow-color,var(--slot-menu-popup-shadow-color)));filter:var(--luzmo-slot-menu-popup-filter,var(--slot-menu-popup-filter));border-top-left-radius:0;position:relative}.slot-contents-container .inner-container{align-items:stretch;display:flex}.slot-contents-container .inner-container luzmo-display-settings{min-width:var(--luzmo-slot-menu-display-settings-min-width,var(--slot-menu-display-settings-min-width));padding:var(--luzmo-slot-menu-display-settings-vertical-padding,var(--slot-menu-display-settings-vertical-padding)) var(--luzmo-slot-menu-display-settings-horizontal-padding,var(--slot-menu-display-settings-horizontal-padding))}.slot-contents-container:has(>.close) .inner-container luzmo-display-settings{padding-block-start:var(--luzmo-slot-menu-close-button-clearance,var(--slot-menu-close-button-clearance))}:host([variant=popup]) .slot-contents-container{border-top-left-radius:var(--luzmo-slot-menu-border-radius,var(--luzmo-border-radius));overflow:hidden}.slot-menu-top-menu{border-radius:var(--luzmo-slot-menu-border-radius,var(--luzmo-border-radius));z-index:1;width:fit-content;margin-bottom:calc(-1 * var(--luzmo-slot-menu-border-width,var(--luzmo-border-width)));border-bottom-right-radius:0;border-bottom-left-radius:0;align-items:center;display:flex;position:relative;overflow:hidden}.drag-handle{background-color:var(--luzmo-slot-menu-drag-handle-background-color,var(--luzmo-background-color-highlight));cursor:move;border:var(--luzmo-slot-menu-drag-handle-border-width,var(--slot-menu-drag-handle-border-width)) solid var(--luzmo-slot-menu-border-color,var(--luzmo-background-color-highlight));width:fit-content;font-size:var(--luzmo-slot-menu-drag-handle-size,var(--slot-menu-drag-handle-size));padding:var(--luzmo-slot-menu-drag-handle-vertical-padding,var(--slot-menu-drag-handle-vertical-padding)) var(--luzmo-slot-menu-drag-handle-horizontal-padding,var(--slot-menu-drag-handle-horizontal-padding));border-bottom:none}.drag-handle:hover{background-color:var(--luzmo-slot-menu-drag-handle-background-color-hover,var(--luzmo-background-color-highlight-hover))}.drag-handle:focus-visible{box-shadow:0 0 0 var(--luzmo-indicator-width) var(--luzmo-indicator-color)}.slot-content-action{max-width:var(--luzmo-slot-menu-top-menu-label-max-width,var(--slot-menu-top-menu-label-max-width));gap:var(--luzmo-slot-menu-label-to-icon-gap,var(--slot-menu-label-to-icon-gap));background-color:var(--luzmo-slot-menu-content-label-background-color,var(--luzmo-primary));color:var(--luzmo-slot-menu-content-label-color,var(--luzmo-primary-inverse-color));border:var(--luzmo-slot-menu-border-width,var(--luzmo-border-width)) solid var(--luzmo-slot-menu-content-label-border-color,var(--luzmo-primary));padding:var(--luzmo-slot-menu-drag-handle-vertical-padding,var(--slot-menu-drag-handle-vertical-padding)) var(--luzmo-slot-menu-drag-handle-horizontal-padding,var(--slot-menu-drag-handle-horizontal-padding));border-bottom:none;flex:0 auto;display:flex}.slot-content-action:hover{background-color:var(--luzmo-slot-menu-content-label-background-color-hover,var(--luzmo-primary-hover))}.slot-content-action:focus{background-color:var(--luzmo-slot-menu-content-label-background-color-focus,var(--luzmo-primary-focus))}.slot-content-action .slot-content-label{white-space:nowrap;text-overflow:ellipsis;flex:auto;overflow:hidden}.slot-content-action .slot-content-remove{cursor:pointer;border-radius:var(--luzmo-slot-menu-border-radius,var(--luzmo-border-radius));font:inherit;color:inherit;background:0 0;border:none;flex:none;padding:0}.slot-content-action .slot-content-remove:focus-visible{background-color:var(--luzmo-slot-menu-content-label-background-color-focus,var(--luzmo-primary-focus));box-shadow:0 0 0 var(--luzmo-indicator-width) var(--luzmo-slot-menu-content-label-color,var(--luzmo-primary-inverse-color));outline:none}.calculation-label{align-items:center;gap:var(--luzmo-spacing-3);display:inline-flex}.calculation-label-icon{flex:none;display:inline-flex}.close{font:inherit;color:inherit;right:var(--luzmo-slot-menu-close-icon-right,var(--slot-menu-close-icon-right));cursor:pointer;top:calc(-2 * var(--luzmo-slot-menu-border-width,var(--luzmo-border-width)));background:0 0;background-color:var(--luzmo-slot-menu-close-button-background-color,var(--luzmo-background-color-highlight));font-size:var(--luzmo-slot-menu-close-button-size,var(--slot-menu-close-button-size));border:none;border:var(--luzmo-slot-menu-border-width,var(--luzmo-border-width)) solid var(--luzmo-slot-menu-border-color,var(--luzmo-border-color));border-radius:var(--luzmo-slot-menu-border-radius,var(--luzmo-border-radius));padding:0;padding:var(--luzmo-slot-menu-close-button-vertical-padding,var(--slot-menu-close-button-vertical-padding)) var(--luzmo-slot-menu-close-button-horizontal-padding,var(--slot-menu-close-button-horizontal-padding));border-top-left-radius:0;border-top-right-radius:0;position:absolute}.close:hover{background-color:var(--luzmo-slot-menu-close-button-background-color-hover,var(--luzmo-background-color-highlight-hover))}.close:focus-visible{border-color:var(--luzmo-indicator-color);outline:none}:host{--slot-menu-display-settings-min-width:19rem;--slot-menu-min-height:calc(var(--luzmo-component-height) * 2);--slot-menu-font-size:var(--luzmo-font-size);--slot-menu-display-settings-horizontal-padding:var(--luzmo-spacing-5);--slot-menu-display-settings-vertical-padding:var(--luzmo-spacing-4);--slot-menu-top-menu-label-max-width:12rem;--slot-menu-list-min-width:8rem;--slot-menu-list-max-width:12rem;--slot-menu-label-to-icon-gap:var(--luzmo-spacing-3);--slot-menu-drag-handle-size:var(--luzmo-font-size);--slot-menu-drag-handle-vertical-padding:var(--luzmo-spacing-2);--slot-menu-drag-handle-horizontal-padding:var(--luzmo-spacing-3);--slot-menu-drag-handle-border-width:var(--luzmo-border-width);--slot-menu-close-button-size:var(--luzmo-font-size-s);--slot-menu-close-button-vertical-padding:var(--luzmo-spacing-2);--slot-menu-close-button-horizontal-padding:calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--slot-menu-close-button-clearance:calc(var(--luzmo-slot-menu-close-button-size,var(--slot-menu-close-button-size)) + 2 * var(--luzmo-slot-menu-close-button-vertical-padding,var(--slot-menu-close-button-vertical-padding)) + 2 * var(--luzmo-slot-menu-border-width,var(--luzmo-border-width)) + var(--luzmo-spacing-2));--slot-menu-popup-shadow-horizontal:0;--slot-menu-popup-shadow-vertical:1px;--slot-menu-popup-shadow-blur:4px;--slot-menu-popup-shadow-color:var(--luzmo-border-color);--slot-menu-popup-box-shadow:var(--slot-menu-popup-shadow-horizontal) var(--slot-menu-popup-shadow-vertical) var(--slot-menu-popup-shadow-blur) var(--slot-menu-popup-shadow-color);--slot-menu-close-icon-right:1rem;--slot-menu-list-border-radius:var(--luzmo-border-radius)}:host([size=s]){--slot-menu-display-settings-min-width:16rem;--slot-menu-min-height:calc(var(--luzmo-component-height-s) * 2);--slot-menu-font-size:var(--luzmo-font-size-s);--slot-menu-display-settings-horizontal-padding:var(--luzmo-spacing-4);--slot-menu-display-settings-vertical-padding:var(--luzmo-spacing-3);--slot-menu-top-menu-label-max-width:10rem;--slot-menu-list-min-width:6rem;--slot-menu-list-max-width:10rem;--slot-menu-label-to-icon-gap:var(--luzmo-spacing-2);--slot-menu-drag-handle-size:var(--luzmo-font-size-s);--slot-menu-drag-handle-vertical-padding:var(--luzmo-spacing-2);--slot-menu-drag-handle-horizontal-padding:var(--luzmo-spacing-3);--slot-menu-close-button-size:var(--luzmo-font-size-xs);--slot-menu-close-button-vertical-padding:var(--luzmo-spacing-2);--slot-menu-close-button-horizontal-padding:calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1))}:host([size=l]){--slot-menu-display-settings-min-width:23rem;--slot-menu-min-height:calc(var(--luzmo-component-height-l) * 2);--slot-menu-font-size:var(--luzmo-font-size-l);--slot-menu-display-settings-horizontal-padding:calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--slot-menu-display-settings-vertical-padding:var(--luzmo-spacing-5);--slot-menu-top-menu-label-max-width:14rem;--slot-menu-list-min-width:9rem;--slot-menu-list-max-width:14rem;--slot-menu-label-to-icon-gap:var(--luzmo-spacing-4);--slot-menu-drag-handle-size:var(--luzmo-font-size-l);--slot-menu-drag-handle-vertical-padding:var(--luzmo-spacing-3);--slot-menu-drag-handle-horizontal-padding:var(--luzmo-spacing-3);--slot-menu-close-button-size:var(--luzmo-font-size);--slot-menu-close-button-vertical-padding:calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--slot-menu-close-button-horizontal-padding:var(--luzmo-spacing-3)}:host([size=xl]){--slot-menu-display-settings-min-width:26rem;--slot-menu-min-height:calc(var(--luzmo-component-height-xl) * 2);--slot-menu-font-size:var(--luzmo-font-size-xl);--slot-menu-display-settings-horizontal-padding:calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-2));--slot-menu-display-settings-vertical-padding:var(--luzmo-spacing-5);--slot-menu-top-menu-label-max-width:16rem;--slot-menu-list-min-width:10rem;--slot-menu-list-max-width:16rem;--slot-menu-label-to-icon-gap:var(--luzmo-spacing-5);--slot-menu-drag-handle-size:var(--luzmo-font-size-xl);--slot-menu-drag-handle-vertical-padding:var(--luzmo-spacing-3);--slot-menu-drag-handle-horizontal-padding:var(--luzmo-spacing-4);--slot-menu-close-button-size:var(--luzmo-font-size-l);--slot-menu-close-button-vertical-padding:var(--luzmo-spacing-3);--slot-menu-close-button-horizontal-padding:var(--luzmo-spacing-3)}`,Z=class extends Ka(y(p,{validSizes:Object.values(h)})){constructor(...e){super(...e),this.language=`en`,this.contentLanguage=`en`,this.slotType=`numeric`,this.variant=`draggable`,this._periodOverPeriodUiType=null,this.measureColumns=[],this.apiUrl=`https://api.luzmo.com`,this.authKey=``,this.authToken=``,this.datasetsDataFields=[],this._slotContents=[],this._activeIndex=this.slotIndex??0,this._linkedDatasetsIds=[]}static get styles(){return[A(Ao)]}get _store(){return this._consumedStore?this._consumedStore:(this._ownStore||(this._ownStore=new Ja,new Xi(this,{context:$i,initialValue:this._ownStore})),this._ownStore)}get _currentSlotContent(){return this._slotContents[this.slotIndex??this._activeIndex]??{}}get _showRemoveButton(){return!this.noRemove&&this.variant===`popup`&&(typeof this.slotIndex==`number`||this._slotContents?.length===1)}get _currentLabel(){return x(this._currentSlotContent.label,this.contentLanguage)??`Untitled`}_renderCurrentLabel(){let e={name:this.slotName,type:this.slotType};return q(this._currentSlotContent,e)?eo(this._currentSlotContent):this._currentLabel}connectedCallback(){let e={};this.apiUrl&&(e.apiUrl=this.apiUrl),this.authKey&&this.authToken&&(e.authKey=this.authKey,e.authToken=this.authToken),b.configure(e),super.connectedCallback(),this._attachDragHandle()}disconnectedCallback(){super.disconnectedCallback(),this._cleanupDrag&&=(this._cleanupDrag(),void 0),this._panelResizeObserver?.disconnect(),this._panelResizeObserver=void 0}_syncListMaxHeight(){let e=this.displaySettingsElement,t=this.slotMenuListElement;if(!e||!t)return;let n=e.offsetHeight;n>0&&t.style.setProperty(`--luzmo-slot-menu-list-max-height`,`${n}px`)}_observePanelResize(){let e=this.displaySettingsElement;e&&(this._panelResizeObserver||=new ResizeObserver(()=>this._syncListMaxHeight()),this._panelResizeObserver.disconnect(),this._panelResizeObserver.observe(e),this._syncListMaxHeight())}_attachDragHandle(){if(this._cleanupDrag||this.variant!==`draggable`||this.noDrag)return;let e=this.renderRoot.querySelector(`.drag-handle`);if(!e)return;let t=this.dragBoundary?document.querySelector(this.dragBoundary):document.documentElement;this._cleanupDrag=go({element:this,handle:e,boundary:t})}_sendChangeEvent(){let e=this._store.slotContents.get();this.dispatchEvent(new CustomEvent(`luzmo-slot-contents-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContents:structuredClone(e),linkedDatasetsIds:[...this._linkedDatasetsIds]}}))}resetInfoVisibility(){this.displaySettingsElement?.resetInfoVisibility&&this.displaySettingsElement.resetInfoVisibility(!1)}_sendCloseEvent(){this.dispatchEvent(new CustomEvent(`luzmo-close`,{bubbles:!0,composed:!0,cancelable:!0}))}isArrayColumnType(e){return e.startsWith(`array[`)}async willUpdate(e){let t=this._store,n=t.slotContents.get(),r=e.has(`slotContents`);Array.isArray(this.slotContents)&&(n.length===0||r)&&t.setContents(structuredClone(this.slotContents),this.slotName);let i=t.slotContents.get();if(i!==this._slotContents){this._slotContents=i;let{set:e,column:n}=this._currentSlotContent;if(e&&_e(e)&&e!==this._lastFetchedDatasetId){if(this._lastFetchedDatasetId=e,await b.fetchDatasetsRecursive([e]),!this.isConnected)return;this._linkedDatasetsIds=b.getLinkedDatasetsIds(e)}let r=b.getAvailableDatasets();this.measureColumns=r.map(e=>({datasetId:e.id,datasetName:e.name,columns:e.columns?.filter(e=>e.type===`numeric`&&e.id!==n)})),typeof this.slotIndex!=`number`&&t.activeIndex.get()!==this._activeIndex&&t.updateActive(this._activeIndex);let a=this.itemType===`kpi`?`comparison-measure`:`measure`;if(this.slotName===a){t.linkedDataset.set(r.filter(t=>t.id===e)),t.setPeriodOverPeriodCondition(this.itemType,this._currentSlotContent);let n=this._currentSlotContent.subtype===`duration`&&this.isArrayColumnType(this._currentSlotContent.type);this._periodOverPeriodUiType=n?null:t.periodOverPeriodUiType.get()}}}updated(){this.displaySettingsElement&&(this.displaySettingsElement.periodOverPeriodUiType=this._periodOverPeriodUiType,this.displaySettingsElement.measureColumns=this.measureColumns,this.displaySettingsElement.showRemoveButton=this._showRemoveButton),this._observePanelResize()}_handleSlotListChange(e){let t=this._store,n=structuredClone(e.detail.slotContents),r=e.detail.activeIndex;r!==this._activeIndex&&(this._activeIndex=r,t.updateActive(r)),t.setContents(n,this.slotName),this._slotContents=t.slotContents.get();let i=this._slotContents[this._activeIndex],a=i?.column??i?.columnId,o=i?.set??i?.datasetId,s=i?.formulaId??(v(i?.formula)?i.formula:void 0);(a||s)&&o&&(this.dispatchEvent(new CustomEvent(`luzmo-slot-menu-active`,{bubbles:!0,composed:!0,detail:{datasetId:o}})),setTimeout(()=>{this.dispatchEvent(new CustomEvent(`luzmo-slot-menu-highlight`,{bubbles:!0,composed:!0,detail:{datasetId:o,level:i?.level??0,...a&&{columnId:a},...s&&{formulaId:s}}}))})),this._slotContents.length<=1&&this.requestUpdate(),this._sendChangeEvent()}_handleSlotContentChange(e){let t=this._store,n=this.slotIndex??this._activeIndex;t.updateContent(structuredClone(e.detail.slotContent),n),this._slotContents=t.slotContents.get(),this.slotMenuListElement&&(this.slotMenuListElement.slotContents=this._slotContents),this._sendChangeEvent()}removeSlotContent(e){let t=this._store;t.removeContent(e),this._slotContents=t.slotContents.get(),this._slotContents.length===0&&this.dispatchEvent(new CustomEvent(`luzmo-slot-menu-inactive`,{bubbles:!0,composed:!0})),this._sendChangeEvent(),this.close(),this.requestUpdate()}close(){this._sendCloseEvent(),this.resetInfoVisibility()}_removeActiveSlotContent(){this.removeSlotContent(this.slotIndex??this._activeIndex)}_handleInfoVisibilityChanged(e){this.dispatchEvent(new CustomEvent(`luzmo-info-visibility-changed`,{detail:e.detail}))}render(){let e=`${this.slotType}-${this._currentSlotContent?.type??``}`;return T`<div class="slot-menu-top-menu" role="region" aria-label=${t(`Slot menu`,{desc:`Accessible label for slot menu region`})}>
|
|
179
|
+
${this.variant===`draggable`?T`<div class="drag-handle">${f(i)}</div>`:``}
|
|
180
|
+
${this._slotContents&&this._slotContents.length===1&&this.variant!==`popup`?T` <div class="slot-content-action">
|
|
181
181
|
<div class="slot-content-label">${this._renderCurrentLabel()}</div>
|
|
182
182
|
<button
|
|
183
183
|
class="slot-content-remove"
|
|
184
|
-
aria-label=${
|
|
184
|
+
aria-label=${t(`Remove`,{desc:`Remove button label`})}
|
|
185
185
|
@click=${this.removeSlotContent.bind(this,0)}
|
|
186
186
|
>
|
|
187
187
|
${f(o)}
|
|
@@ -191,11 +191,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
191
191
|
<div
|
|
192
192
|
class="slot-contents-container ${this._slotContents?.length>1?`multiple`:``}"
|
|
193
193
|
>
|
|
194
|
-
${this.variant===`popup`?``:
|
|
194
|
+
${this.variant===`popup`?``:T`<button class="close" aria-label=${t(`Close`,{id:`close-action`,desc:`Close button label`})} @click=${this.close}>
|
|
195
195
|
${f(se)}
|
|
196
196
|
</button>`}
|
|
197
197
|
<div class="inner-container">
|
|
198
|
-
${this._slotContents?.length>1&&typeof this.slotIndex!=`number`?
|
|
198
|
+
${this._slotContents?.length>1&&typeof this.slotIndex!=`number`?T`<luzmo-slot-menu-list
|
|
199
199
|
.slotContents=${this._slotContents}
|
|
200
200
|
.contentLanguage=${this.contentLanguage}
|
|
201
201
|
.slotName=${this.slotName}
|
|
@@ -203,7 +203,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
203
203
|
.activeIndex=${this.slotIndex??this._activeIndex}
|
|
204
204
|
@luzmo-slot-list-changed=${this._handleSlotListChange}
|
|
205
205
|
></luzmo-slot-menu-list>`:``}
|
|
206
|
-
${
|
|
206
|
+
${w([this.variant,this.language,this.contentLanguage,this._periodOverPeriodUiType,this._activeIndex,this.size,e,this.slotName,this.datasetsDataFields,this.apiUrl,this.authKey,this.authToken],()=>T`<luzmo-display-settings
|
|
207
207
|
.size=${this.size}
|
|
208
208
|
.language=${this.language}
|
|
209
209
|
.contentLanguage=${this.contentLanguage}
|
|
@@ -213,9 +213,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
213
213
|
.showRemoveButton=${this._showRemoveButton}
|
|
214
214
|
.slotContent=${this._currentSlotContent}
|
|
215
215
|
.datasetsDataFields=${this.datasetsDataFields}
|
|
216
|
-
api-url=${
|
|
217
|
-
auth-key=${
|
|
218
|
-
auth-token=${
|
|
216
|
+
api-url=${E(this.apiUrl)}
|
|
217
|
+
auth-key=${E(this.authKey)}
|
|
218
|
+
auth-token=${E(this.authToken)}
|
|
219
219
|
.areGrandTotalsEnabled=${this.areGrandTotalsEnabled}
|
|
220
220
|
.areDatetimeOptionsEnabled=${this.areDatetimeOptionsEnabled}
|
|
221
221
|
.isBinningDisabled=${this.isBinningDisabled}
|
|
@@ -226,56 +226,56 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
226
226
|
@luzmo-info-visibility-changed=${this._handleInfoVisibilityChanged}
|
|
227
227
|
></luzmo-display-settings>`)}
|
|
228
228
|
</div>
|
|
229
|
-
</div>`}firstUpdated(){this._attachDragHandle(),this._observePanelResize()}resetPosition(){this.style.transform=``}};n([k({type:String,reflect:!0})],Z.prototype,`language`,void 0),n([k({type:String,attribute:`content-language`,reflect:!0})],Z.prototype,`contentLanguage`,void 0),n([k({type:String,attribute:`slot-type`,reflect:!0})],Z.prototype,`slotType`,void 0),n([k({type:String,attribute:`slot-name`,reflect:!0})],Z.prototype,`slotName`,void 0),n([k({type:String,attribute:`item-type`,reflect:!0})],Z.prototype,`itemType`,void 0),n([k({type:Boolean,attribute:`no-drag`,reflect:!0})],Z.prototype,`noDrag`,void 0),n([k({type:Boolean,attribute:`no-close`,reflect:!0})],Z.prototype,`noClose`,void 0),n([k({type:String,reflect:!0})],Z.prototype,`variant`,void 0),n([k({type:Boolean,attribute:`no-top-menu-label`,reflect:!0})],Z.prototype,`noTopMenuLabel`,void 0),n([k({type:Boolean,attribute:`no-remove`,reflect:!0})],Z.prototype,`noRemove`,void 0),n([Zi({context:$i,subscribe:!0})],Z.prototype,`_consumedStore`,void 0),n([k({type:String,attribute:`drag-boundary`,reflect:!1})],Z.prototype,`dragBoundary`,void 0),n([k({type:Boolean})],Z.prototype,`areGrandTotalsEnabled`,void 0),n([k({type:Boolean})],Z.prototype,`areDatetimeOptionsEnabled`,void 0),n([k({type:Boolean})],Z.prototype,`isBinningDisabled`,void 0),n([k({type:Boolean})],Z.prototype,`isAggregationDisabled`,void 0),n([k({type:Boolean})],Z.prototype,`isCumulativeSumEnabled`,void 0),n([k({type:Array,reflect:!1,attribute:`slot-contents`})],Z.prototype,`slotContents`,void 0),n([A()],Z.prototype,`_periodOverPeriodUiType`,void 0),n([A()],Z.prototype,`measureColumns`,void 0),n([k({type:Number,reflect:!1,attribute:`slot-index`})],Z.prototype,`slotIndex`,void 0),n([te(`luzmo-display-settings`)],Z.prototype,`displaySettingsElement`,void 0),n([te(`luzmo-slot-menu-list`)],Z.prototype,`slotMenuListElement`,void 0),n([k({type:String,attribute:`api-url`,reflect:!0})],Z.prototype,`apiUrl`,void 0),n([k({type:String,attribute:`auth-key`,reflect:!0})],Z.prototype,`authKey`,void 0),n([k({type:String,attribute:`auth-token`,reflect:!0})],Z.prototype,`authToken`,void 0),n([k({attribute:!1})],Z.prototype,`datasetsDataFields`,void 0),n([A()],Z.prototype,`_slotContents`,void 0),customElements.get(`luzmo-slot-menu`)||customElements.define(`luzmo-slot-menu`,Z);var jo=`:host{--luzmo-select-inline-size:100%;font-family:var(--luzmo-item-slot-picker-font-family,var(--luzmo-font-family))}.container{gap:var(--luzmo-item-slot-picker-gap,var(--item-slot-picker-gap,var(--luzmo-spacing-3)));flex-direction:column;width:fit-content;display:flex}.select-container{flex-direction:column;display:flex}.select-container .select-controls{align-items:center;gap:var(--luzmo-item-slot-picker-controls-gap,var(--item-slot-picker-controls-gap));flex-direction:row;flex:auto;display:flex}luzmo-data-fields-select{flex-grow:var(--luzmo-item-slot-picker-data-fields-select-flex-grow,var(--item-slot-picker-data-fields-select-flex-grow))}.calculation-control{align-items:center;gap:var(--luzmo-item-slot-picker-controls-gap,var(--item-slot-picker-controls-gap));flex:auto;min-width:0;display:flex}.calculation-label{align-items:center;gap:var(--luzmo-spacing-3);flex:auto;min-width:0;display:inline-flex}.calculation-label-icon{flex:none;display:inline-flex}.calculations-list{gap:var(--luzmo-item-slot-picker-gap,var(--item-slot-picker-gap,var(--luzmo-spacing-3)));flex-direction:column;flex:auto;min-width:0;display:flex}:host([grows]){--item-slot-picker-data-fields-select-flex-grow:1}:host([grows]) .container{width:100%}:host([grows]) .select-container{flex:auto}.inline-slot-menu{margin-block-start:var(--luzmo-item-slot-picker-inline-slot-menu-gap,var(--item-slot-picker-inline-slot-menu-gap))}.inline-slot-menu[hidden]{display:none}.inline-slot-menu luzmo-slot-menu{--luzmo-slot-menu-popup-filter:none;--luzmo-slot-menu-display-settings-min-width:0;--luzmo-slot-menu-background-color:var(--luzmo-item-slot-picker-inline-slot-menu-background-color,var(--item-slot-picker-inline-slot-menu-background-color));width:100%}.extra-data-field-button-container{justify-content:flex-start;align-items:center;display:flex}.item-slot-picker-label{font-size:var(--luzmo-item-slot-picker-label-font-size,var(--item-slot-picker-label-font-size));margin-right:var(--luzmo-item-slot-picker-text-to-controls,var(--item-slot-picker-text-to-controls));text-overflow:ellipsis;white-space:nowrap;flex-grow:1;overflow:hidden}.controls{align-items:center;gap:var(--luzmo-item-slot-picker-controls-gap,var(--item-slot-picker-controls-gap));background-color:var(--luzmo-item-slot-picker-controls-background-color,var(--item-slot-picker-controls-background-color));height:100%;color:var(--luzmo-item-slot-picker-controls-color,var(--item-slot-picker-controls-color));margin-right:var(--luzmo-item-slot-picker-controls-to-edge,var(--item-slot-picker-controls-to-edge));padding:0 var(--luzmo-item-slot-picker-controls-horizontal-padding,var(--item-slot-picker-controls-horizontal-padding));margin-inline-start:var(--luzmo-item-slot-picker-select-to-controls,var(--item-slot-picker-select-to-controls));display:flex}.controls div{cursor:pointer;height:100%;padding:0 var(--luzmo-item-slot-picker-controls-control-horizontal-padding,var(--item-slot-picker-controls-control-horizontal-padding));align-items:center;display:flex}luzmo-slot-menu[placement=bottom],luzmo-slot-menu[placement=top],luzmo-slot-menu[placement=bottom-start],luzmo-slot-menu[placement=top-start],luzmo-slot-menu[placement=bottom-end],luzmo-slot-menu[placement=top-end]{margin:var(--luzmo-item-slot-picker-overlay-vertical-gap,var(--item-slot-picker-overlay-vertical-gap)) 0}luzmo-slot-menu[placement=left],luzmo-slot-menu[placement=right],luzmo-slot-menu[placement=left-start],luzmo-slot-menu[placement=right-start],luzmo-slot-menu[placement=left-end],luzmo-slot-menu[placement=right-end]{margin:0 var(--luzmo-item-slot-picker-overlay-horizontal-gap,var(--item-slot-picker-overlay-horizontal-gap))}:host{--item-slot-picker-border-width:var(--luzmo-border-width);--item-slot-picker-border-style:dashed;--item-slot-picker-border-color:var(--luzmo-border-color);--item-slot-picker-accept-drag-controls-background-color:transparent;--item-slot-picker-font-color:var(--luzmo-font-color);--item-slot-picker-controls-background-color:transparent;--item-slot-picker-text-to-controls:var(--luzmo-spacing-3);--item-slot-picker-controls-to-edge:0;--item-slot-picker-select-to-controls:var(--luzmo-spacing-2);--item-slot-picker-controls-gap:0;--item-slot-picker-controls-horizontal-padding:0;--item-slot-picker-controls-control-horizontal-padding:var(--luzmo-spacing-3);--item-slot-picker-label-font-size:var(--luzmo-font-size);--item-slot-picker-inline-slot-menu-gap:var(--luzmo-spacing-2);--item-slot-picker-inline-slot-menu-background-color:var(--luzmo-background-color);--item-slot-picker-horizontal-padding:var(--luzmo-spacing-4);--item-slot-picker-overlay-horizontal-gap:var(--luzmo-spacing-4);--item-slot-picker-overlay-vertical-gap:var(--luzmo-spacing-4)}:host([size=s]){--item-slot-picker-horizontal-padding:var(--luzmo-spacing-4);--item-slot-picker-overlay-horizontal-gap:var(--luzmo-spacing-4);--item-slot-picker-overlay-vertical-gap:var(--luzmo-spacing-4)}:host([size=l]),:host([size=xl]){--item-slot-picker-horizontal-padding:var(--luzmo-spacing-5);--item-slot-picker-overlay-horizontal-gap:var(--luzmo-spacing-5);--item-slot-picker-overlay-vertical-gap:var(--luzmo-spacing-5)}:host{box-sizing:border-box}`,Mo=e=>{if(`columnId`in e&&e.columnId)return e.columnId;if(`formulaId`in e&&e.formulaId)return e.formulaId;if(`formula`in e&&e.formula)return e.formula},No=e=>$a(e),Po=`::level::`,Fo=(e,t)=>`${e}${Po}${t}`,Q=class extends t(m(h,{validSizes:[`s`,`m`,`l`,`xl`],noDefaultSize:!0})){static{this.styles=re(jo)}_isAdHocFormula(e){return`formula`in e&&typeof e.formula==`string`}constructor(){super(),this._loadSlotsConfig=new C(this,{task:async([e])=>{if(!e)return this._slotsConfig;if(e!==this._itemTypeLoaded){this._itemTypeLoaded=e;let t=await he(e);return this._slotsConfig=t??[],this._slotsConfig}return this._slotsConfig},args:()=>[this.itemType,this.language]}),this._slotsConfig=[],this.slotConfiguration={},this.slotContents=[],this.contentLanguage=`en`,this.disabled=!1,this.grows=!1,this.menu=`default`,this.hasLabel=!1,this.selects=`multiple`,this.search=`auto`,this.icons=`menu-only`,this.datasetsDataFields=[],this.placement=`bottom-start`,this.slotMenuPlacement=`bottom-end`,this.slotMenuMode=`overlay`,this.hideClear=!1,this._hasExtraEmptySelects=!1,this._currentSlotContents=[],this._store=new Ja,this._changedSlotContents=(e,t=[])=>{let n=new CustomEvent(`luzmo-slot-contents-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContents:e,linkedDatasetsIds:t}});return this.dispatchEvent(n),n},new Xi(this,{context:$i,initialValue:this._store})}willUpdate(e){super.willUpdate(e),e.has(`slotContents`)&&(this._currentSlotContents=structuredClone(this.slotContents??[]),this._store?.setContents(this._currentSlotContents??[],this.slotName),this._expandedIndex!==void 0&&this._expandedIndex>=this._currentSlotContents.length&&(this._expandedIndex=void 0)),(e.has(`slotMenuMode`)||e.has(`selects`)||e.has(`disabled`)&&this.disabled)&&(this._expandedIndex=void 0)}_onSlotMenuChanges(e){e.preventDefault(),e.stopPropagation(),(this.slotContents?.length??0)===(e.detail.slotContents?.length??0)?(this._currentSlotContents=structuredClone(e.detail.slotContents??[]),this.slotContents=structuredClone(e.detail.slotContents??[]),this._store?.setContents(this._currentSlotContents??[],this.slotName),this._changedSlotContents(this._currentSlotContents,e.detail.linkedDatasetsIds??[])):(this.slotContents=e.detail.slotContents??[],this._store?.setContents(this.slotContents??[],this.slotName),this._changedSlotContents(this.slotContents,e.detail.linkedDatasetsIds??[]))}_setSlotContentAtIndex(e,t){let n=e.detail?.dataFields??[],r=n.length===0;t>=this._currentSlotContents.length&&this._removeEmptySelect();for(let e=this._currentSlotContents.length;e<=t;e++)this._currentSlotContents[e]||this._currentSlotContents.push({});if(n.length>0){let e=n[0],r=Mo(e),i=this._currentSlotContents[t],a=No(i),o=i?.level,s=e.level;if(r&&(r!==a||o!==s)){let n=typeof e.level==`number`;this._currentSlotContents[t]=to(e,n)}}else r&&(this._shiftExpandedIndexAfterRemoval(t),this._currentSlotContents.splice(t,1));this.slotContents=structuredClone(this._currentSlotContents.filter(e=>!!No(e))),this._changedSlotContents(this.slotContents)}_setSlotContents(e){let t=e.detail.dataFields??[],n=this._currentSlotContents.filter(e=>q(e,this.slotConfiguration));this.slotConfiguration?.canAcceptMultipleDataFields&&t.length>1||(t=t.slice(0,1));let r=this._getFilteredDatasetsDataFields(),i=t.map(e=>{let t=to(e,typeof e.level==`number`),n=this._getSelectValueForSlotContent(t,r);if(n)return{selectionValue:n,slotContent:t}}).filter(e=>!!e),a=new Set(i.map(e=>e.selectionValue));this._currentSlotContents=this._currentSlotContents?.filter(e=>!q(e,this.slotConfiguration)).filter(e=>{let t=this._getSelectValueForSlotContent(e,r);return t?a.has(t):!1})??[],i.forEach(({selectionValue:e,slotContent:t})=>{let n=this._currentSlotContents.findIndex(t=>this._getSelectValueForSlotContent(t,r)===e);n===-1?this._currentSlotContents.push(t):this._currentSlotContents[n]=t}),this._currentSlotContents=[...n,...this._currentSlotContents],this.slotContents=structuredClone(this._currentSlotContents),this._changedSlotContents(this._currentSlotContents)}_renderFieldLabel(){return E`<luzmo-field-label for="data-fields" size=${this.size}
|
|
230
|
-
>${this.label??
|
|
231
|
-
</luzmo-field-label>`}_removeEmptySelect(){this._hasExtraEmptySelects=!1}_getAcceptableDataFields(){let e=[],t=this.slotConfiguration?.acceptableDataFieldTypes?.length?this.slotConfiguration.acceptableDataFieldTypes:Qi;return this.datasetsDataFields.forEach(n=>{(n.columns?.filter(e=>t.includes(e.type??``))??[]).forEach(t=>{e.push({datasetId:n.id,type:t.type,name:t.name,columnId:t.id,description:t.description,subtype:t.subtype,format:t.format,lowestLevel:t.lowestLevel,duration_levels:t.duration_levels,duration_format:t.duration_format,expression:t.expression,hierarchyLevels:t.hierarchyLevels,currency:t.currency})}),this.slotConfiguration?.canAcceptFormula&&(n.formulas??[]).forEach(t=>{t.type&&(this._isAdHocFormula(t)?e.push({datasetId:n.id,type:t.type,name:t.label??{en:`Ad-hoc formula`},formula:t.formula,subtype:t.subtype??void 0,format:t.format}):e.push({datasetId:n.id,type:t.type,name:t.name,formulaId:t.id,description:t.description,subtype:t.subtype,format:t.format,lowestLevel:t.lowestLevel,duration_levels:t.duration_levels,duration_format:t.duration_format,expression:t.expression,currency:t.currency}))})}),e}_getFirstAvailableDataField(){let e=this._getAcceptableDataFields(),t=new Set(this._currentSlotContents.map(e=>e.columnId??e.formulaId??e.column??e.formula));return e.find(e=>{let n=Mo(e);return n?!t.has(n):!1})}_hasAvailableDataFields(){return!!this._getFirstAvailableDataField()}_addDataField(){let e=this._getFirstAvailableDataField();if(e){let t=to(e,!1);this._currentSlotContents.push(t),this.slotContents=structuredClone(this._currentSlotContents),this._changedSlotContents(this.slotContents)}else this._hasExtraEmptySelects=!0}_renderExtraDataFieldButton(){return this._hasAvailableDataFields()?
|
|
229
|
+
</div>`}firstUpdated(){this._attachDragHandle(),this._observePanelResize()}resetPosition(){this.style.transform=``}};e([O({type:String,reflect:!0})],Z.prototype,`language`,void 0),e([O({type:String,attribute:`content-language`,reflect:!0})],Z.prototype,`contentLanguage`,void 0),e([O({type:String,attribute:`slot-type`,reflect:!0})],Z.prototype,`slotType`,void 0),e([O({type:String,attribute:`slot-name`,reflect:!0})],Z.prototype,`slotName`,void 0),e([O({type:String,attribute:`item-type`,reflect:!0})],Z.prototype,`itemType`,void 0),e([O({type:Boolean,attribute:`no-drag`,reflect:!0})],Z.prototype,`noDrag`,void 0),e([O({type:Boolean,attribute:`no-close`,reflect:!0})],Z.prototype,`noClose`,void 0),e([O({type:String,reflect:!0})],Z.prototype,`variant`,void 0),e([O({type:Boolean,attribute:`no-top-menu-label`,reflect:!0})],Z.prototype,`noTopMenuLabel`,void 0),e([O({type:Boolean,attribute:`no-remove`,reflect:!0})],Z.prototype,`noRemove`,void 0),e([Zi({context:$i,subscribe:!0})],Z.prototype,`_consumedStore`,void 0),e([O({type:String,attribute:`drag-boundary`,reflect:!1})],Z.prototype,`dragBoundary`,void 0),e([O({type:Boolean})],Z.prototype,`areGrandTotalsEnabled`,void 0),e([O({type:Boolean})],Z.prototype,`areDatetimeOptionsEnabled`,void 0),e([O({type:Boolean})],Z.prototype,`isBinningDisabled`,void 0),e([O({type:Boolean})],Z.prototype,`isAggregationDisabled`,void 0),e([O({type:Boolean})],Z.prototype,`isCumulativeSumEnabled`,void 0),e([O({type:Array,reflect:!1,attribute:`slot-contents`})],Z.prototype,`slotContents`,void 0),e([k()],Z.prototype,`_periodOverPeriodUiType`,void 0),e([k()],Z.prototype,`measureColumns`,void 0),e([O({type:Number,reflect:!1,attribute:`slot-index`})],Z.prototype,`slotIndex`,void 0),e([ne(`luzmo-display-settings`)],Z.prototype,`displaySettingsElement`,void 0),e([ne(`luzmo-slot-menu-list`)],Z.prototype,`slotMenuListElement`,void 0),e([O({type:String,attribute:`api-url`,reflect:!0})],Z.prototype,`apiUrl`,void 0),e([O({type:String,attribute:`auth-key`,reflect:!0})],Z.prototype,`authKey`,void 0),e([O({type:String,attribute:`auth-token`,reflect:!0})],Z.prototype,`authToken`,void 0),e([O({attribute:!1})],Z.prototype,`datasetsDataFields`,void 0),e([k()],Z.prototype,`_slotContents`,void 0),customElements.get(`luzmo-slot-menu`)||customElements.define(`luzmo-slot-menu`,Z);var jo=`:host{--luzmo-select-inline-size:100%;font-family:var(--luzmo-item-slot-picker-font-family,var(--luzmo-font-family))}.container{gap:var(--luzmo-item-slot-picker-gap,var(--item-slot-picker-gap,var(--luzmo-spacing-3)));flex-direction:column;width:fit-content;display:flex}.select-container{flex-direction:column;display:flex}.select-container .select-controls{align-items:center;gap:var(--luzmo-item-slot-picker-controls-gap,var(--item-slot-picker-controls-gap));flex-direction:row;flex:auto;display:flex}luzmo-data-fields-select{flex-grow:var(--luzmo-item-slot-picker-data-fields-select-flex-grow,var(--item-slot-picker-data-fields-select-flex-grow))}.calculation-control{align-items:center;gap:var(--luzmo-item-slot-picker-controls-gap,var(--item-slot-picker-controls-gap));flex:auto;min-width:0;display:flex}.calculation-label{align-items:center;gap:var(--luzmo-spacing-3);flex:auto;min-width:0;display:inline-flex}.calculation-label-icon{flex:none;display:inline-flex}.calculations-list{gap:var(--luzmo-item-slot-picker-gap,var(--item-slot-picker-gap,var(--luzmo-spacing-3)));flex-direction:column;flex:auto;min-width:0;display:flex}:host([grows]){--item-slot-picker-data-fields-select-flex-grow:1}:host([grows]) .container{width:100%}:host([grows]) .select-container{flex:auto}.inline-slot-menu{margin-block-start:var(--luzmo-item-slot-picker-inline-slot-menu-gap,var(--item-slot-picker-inline-slot-menu-gap))}.inline-slot-menu[hidden]{display:none}.inline-slot-menu luzmo-slot-menu{--luzmo-slot-menu-popup-filter:none;--luzmo-slot-menu-display-settings-min-width:0;--luzmo-slot-menu-background-color:var(--luzmo-item-slot-picker-inline-slot-menu-background-color,var(--item-slot-picker-inline-slot-menu-background-color));width:100%}.extra-data-field-button-container{justify-content:flex-start;align-items:center;display:flex}.item-slot-picker-label{font-size:var(--luzmo-item-slot-picker-label-font-size,var(--item-slot-picker-label-font-size));margin-right:var(--luzmo-item-slot-picker-text-to-controls,var(--item-slot-picker-text-to-controls));text-overflow:ellipsis;white-space:nowrap;flex-grow:1;overflow:hidden}.controls{align-items:center;gap:var(--luzmo-item-slot-picker-controls-gap,var(--item-slot-picker-controls-gap));background-color:var(--luzmo-item-slot-picker-controls-background-color,var(--item-slot-picker-controls-background-color));height:100%;color:var(--luzmo-item-slot-picker-controls-color,var(--item-slot-picker-controls-color));margin-right:var(--luzmo-item-slot-picker-controls-to-edge,var(--item-slot-picker-controls-to-edge));padding:0 var(--luzmo-item-slot-picker-controls-horizontal-padding,var(--item-slot-picker-controls-horizontal-padding));margin-inline-start:var(--luzmo-item-slot-picker-select-to-controls,var(--item-slot-picker-select-to-controls));display:flex}.controls div{cursor:pointer;height:100%;padding:0 var(--luzmo-item-slot-picker-controls-control-horizontal-padding,var(--item-slot-picker-controls-control-horizontal-padding));align-items:center;display:flex}luzmo-slot-menu[placement=bottom],luzmo-slot-menu[placement=top],luzmo-slot-menu[placement=bottom-start],luzmo-slot-menu[placement=top-start],luzmo-slot-menu[placement=bottom-end],luzmo-slot-menu[placement=top-end]{margin:var(--luzmo-item-slot-picker-overlay-vertical-gap,var(--item-slot-picker-overlay-vertical-gap)) 0}luzmo-slot-menu[placement=left],luzmo-slot-menu[placement=right],luzmo-slot-menu[placement=left-start],luzmo-slot-menu[placement=right-start],luzmo-slot-menu[placement=left-end],luzmo-slot-menu[placement=right-end]{margin:0 var(--luzmo-item-slot-picker-overlay-horizontal-gap,var(--item-slot-picker-overlay-horizontal-gap))}:host{--item-slot-picker-border-width:var(--luzmo-border-width);--item-slot-picker-border-style:dashed;--item-slot-picker-border-color:var(--luzmo-border-color);--item-slot-picker-accept-drag-controls-background-color:transparent;--item-slot-picker-font-color:var(--luzmo-font-color);--item-slot-picker-controls-background-color:transparent;--item-slot-picker-text-to-controls:var(--luzmo-spacing-3);--item-slot-picker-controls-to-edge:0;--item-slot-picker-select-to-controls:var(--luzmo-spacing-2);--item-slot-picker-controls-gap:0;--item-slot-picker-controls-horizontal-padding:0;--item-slot-picker-controls-control-horizontal-padding:var(--luzmo-spacing-3);--item-slot-picker-label-font-size:var(--luzmo-font-size);--item-slot-picker-inline-slot-menu-gap:var(--luzmo-spacing-2);--item-slot-picker-inline-slot-menu-background-color:var(--luzmo-background-color);--item-slot-picker-horizontal-padding:var(--luzmo-spacing-4);--item-slot-picker-overlay-horizontal-gap:var(--luzmo-spacing-4);--item-slot-picker-overlay-vertical-gap:var(--luzmo-spacing-4)}:host([size=s]){--item-slot-picker-horizontal-padding:var(--luzmo-spacing-4);--item-slot-picker-overlay-horizontal-gap:var(--luzmo-spacing-4);--item-slot-picker-overlay-vertical-gap:var(--luzmo-spacing-4)}:host([size=l]),:host([size=xl]){--item-slot-picker-horizontal-padding:var(--luzmo-spacing-5);--item-slot-picker-overlay-horizontal-gap:var(--luzmo-spacing-5);--item-slot-picker-overlay-vertical-gap:var(--luzmo-spacing-5)}:host{box-sizing:border-box}`,Mo=e=>{if(`columnId`in e&&e.columnId)return e.columnId;if(`formulaId`in e&&e.formulaId)return e.formulaId;if(`formula`in e&&e.formula)return e.formula},No=e=>$a(e),Po=`::level::`,Fo=(e,t)=>`${e}${Po}${t}`,Q=class extends n(y(p,{validSizes:[`s`,`m`,`l`,`xl`],noDefaultSize:!0})){static{this.styles=A(jo)}_isAdHocFormula(e){return`formula`in e&&typeof e.formula==`string`}constructor(){super(),this._loadSlotsConfig=new ee(this,{task:async([e])=>{if(!e)return this._slotsConfig;if(e!==this._itemTypeLoaded){this._itemTypeLoaded=e;let t=await he(e);return this._slotsConfig=t??[],this._slotsConfig}return this._slotsConfig},args:()=>[this.itemType,this.language]}),this._slotsConfig=[],this.slotConfiguration={},this.slotContents=[],this.contentLanguage=`en`,this.disabled=!1,this.grows=!1,this.menu=`default`,this.hasLabel=!1,this.selects=`multiple`,this.search=`auto`,this.icons=`menu-only`,this.datasetsDataFields=[],this.placement=`bottom-start`,this.slotMenuPlacement=`bottom-end`,this.slotMenuMode=`overlay`,this.hideClear=!1,this._hasExtraEmptySelects=!1,this._currentSlotContents=[],this._store=new Ja,this._changedSlotContents=(e,t=[])=>{let n=new CustomEvent(`luzmo-slot-contents-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContents:e,linkedDatasetsIds:t}});return this.dispatchEvent(n),n},new Xi(this,{context:$i,initialValue:this._store})}willUpdate(e){super.willUpdate(e),e.has(`slotContents`)&&(this._currentSlotContents=structuredClone(this.slotContents??[]),this._store?.setContents(this._currentSlotContents??[],this.slotName),this._expandedIndex!==void 0&&this._expandedIndex>=this._currentSlotContents.length&&(this._expandedIndex=void 0)),(e.has(`slotMenuMode`)||e.has(`selects`)||e.has(`disabled`)&&this.disabled)&&(this._expandedIndex=void 0)}_onSlotMenuChanges(e){e.preventDefault(),e.stopPropagation(),(this.slotContents?.length??0)===(e.detail.slotContents?.length??0)?(this._currentSlotContents=structuredClone(e.detail.slotContents??[]),this.slotContents=structuredClone(e.detail.slotContents??[]),this._store?.setContents(this._currentSlotContents??[],this.slotName),this._changedSlotContents(this._currentSlotContents,e.detail.linkedDatasetsIds??[])):(this.slotContents=e.detail.slotContents??[],this._store?.setContents(this.slotContents??[],this.slotName),this._changedSlotContents(this.slotContents,e.detail.linkedDatasetsIds??[]))}_setSlotContentAtIndex(e,t){let n=e.detail?.dataFields??[],r=n.length===0;t>=this._currentSlotContents.length&&this._removeEmptySelect();for(let e=this._currentSlotContents.length;e<=t;e++)this._currentSlotContents[e]||this._currentSlotContents.push({});if(n.length>0){let e=n[0],r=Mo(e),i=this._currentSlotContents[t],a=No(i),o=i?.level,s=e.level;if(r&&(r!==a||o!==s)){let n=typeof e.level==`number`;this._currentSlotContents[t]=to(e,n)}}else r&&(this._shiftExpandedIndexAfterRemoval(t),this._currentSlotContents.splice(t,1));this.slotContents=structuredClone(this._currentSlotContents.filter(e=>!!No(e))),this._changedSlotContents(this.slotContents)}_setSlotContents(e){let t=e.detail.dataFields??[],n=this._currentSlotContents.filter(e=>q(e,this.slotConfiguration));this.slotConfiguration?.canAcceptMultipleDataFields&&t.length>1||(t=t.slice(0,1));let r=this._getFilteredDatasetsDataFields(),i=t.map(e=>{let t=to(e,typeof e.level==`number`),n=this._getSelectValueForSlotContent(t,r);if(n)return{selectionValue:n,slotContent:t}}).filter(e=>!!e),a=new Set(i.map(e=>e.selectionValue));this._currentSlotContents=this._currentSlotContents?.filter(e=>!q(e,this.slotConfiguration)).filter(e=>{let t=this._getSelectValueForSlotContent(e,r);return t?a.has(t):!1})??[],i.forEach(({selectionValue:e,slotContent:t})=>{let n=this._currentSlotContents.findIndex(t=>this._getSelectValueForSlotContent(t,r)===e);n===-1?this._currentSlotContents.push(t):this._currentSlotContents[n]=t}),this._currentSlotContents=[...n,...this._currentSlotContents],this.slotContents=structuredClone(this._currentSlotContents),this._changedSlotContents(this._currentSlotContents)}_renderFieldLabel(){return T`<luzmo-field-label for="data-fields" size=${this.size}
|
|
230
|
+
>${this.label??t(`Select...`)}
|
|
231
|
+
</luzmo-field-label>`}_removeEmptySelect(){this._hasExtraEmptySelects=!1}_getAcceptableDataFields(){let e=[],t=this.slotConfiguration?.acceptableDataFieldTypes?.length?this.slotConfiguration.acceptableDataFieldTypes:Qi;return this.datasetsDataFields.forEach(n=>{(n.columns?.filter(e=>t.includes(e.type??``))??[]).forEach(t=>{e.push({datasetId:n.id,type:t.type,name:t.name,columnId:t.id,description:t.description,subtype:t.subtype,format:t.format,lowestLevel:t.lowestLevel,duration_levels:t.duration_levels,duration_format:t.duration_format,expression:t.expression,hierarchyLevels:t.hierarchyLevels,currency:t.currency})}),this.slotConfiguration?.canAcceptFormula&&(n.formulas??[]).forEach(t=>{t.type&&(this._isAdHocFormula(t)?e.push({datasetId:n.id,type:t.type,name:t.label??{en:`Ad-hoc formula`},formula:t.formula,subtype:t.subtype??void 0,format:t.format}):e.push({datasetId:n.id,type:t.type,name:t.name,formulaId:t.id,description:t.description,subtype:t.subtype,format:t.format,lowestLevel:t.lowestLevel,duration_levels:t.duration_levels,duration_format:t.duration_format,expression:t.expression,currency:t.currency}))})}),e}_getFirstAvailableDataField(){let e=this._getAcceptableDataFields(),t=new Set(this._currentSlotContents.map(e=>e.columnId??e.formulaId??e.column??e.formula));return e.find(e=>{let n=Mo(e);return n?!t.has(n):!1})}_hasAvailableDataFields(){return!!this._getFirstAvailableDataField()}_addDataField(){let e=this._getFirstAvailableDataField();if(e){let t=to(e,!1);this._currentSlotContents.push(t),this.slotContents=structuredClone(this._currentSlotContents),this._changedSlotContents(this.slotContents)}else this._hasExtraEmptySelects=!0}_renderExtraDataFieldButton(){return this._hasAvailableDataFields()?T`<div class="extra-data-field-button-container">
|
|
232
232
|
<luzmo-button
|
|
233
233
|
variant="neutral"
|
|
234
234
|
treatment="fill"
|
|
235
235
|
.size=${this._oneSizeSmaller}
|
|
236
|
-
.label=${
|
|
236
|
+
.label=${t(`Add data field`,{desc:`Aria label for add data field button`})}
|
|
237
237
|
@click=${this._addDataField}
|
|
238
238
|
?disabled=${this._hasExtraEmptySelects||this.disabled}
|
|
239
239
|
>
|
|
240
240
|
<luzmo-icon slot="icon" .icon=${d} .size=${this._oneSizeSmaller}></luzmo-icon>
|
|
241
|
-
${
|
|
241
|
+
${t(`Add`,{id:`item-slot-picker-add`,desc:`Add data field button label`})}
|
|
242
242
|
</luzmo-button>
|
|
243
|
-
</div>`:
|
|
243
|
+
</div>`:T`
|
|
244
244
|
|
|
245
|
-
`}get _oneSizeSmaller(){return{s:`xs`,m:`s`,l:`m`,xl:`l`}[this.size]??`s`}_renderControls(
|
|
246
|
-
${this.hideConfiguration?``:
|
|
245
|
+
`}get _oneSizeSmaller(){return{s:`xs`,m:`s`,l:`m`,xl:`l`}[this.size]??`s`}_renderControls(e,n,r=0){if(this.hideConfiguration&&this.hideClear)return``;let i=this._hasInlineSlotMenu,s=i&&this._expandedIndex===r;return T`<div class="controls">
|
|
246
|
+
${this.hideConfiguration?``:T`<luzmo-action-button
|
|
247
247
|
.size=${this.size}
|
|
248
248
|
quiet
|
|
249
|
-
id=${
|
|
250
|
-
.label=${
|
|
249
|
+
id=${e}
|
|
250
|
+
.label=${t(`Edit`,{desc:`Edit action label`})}
|
|
251
251
|
.selected=${s}
|
|
252
252
|
?emphasized=${s}
|
|
253
|
-
aria-expanded=${
|
|
254
|
-
aria-controls=${
|
|
253
|
+
aria-expanded=${E(i?String(s):void 0)}
|
|
254
|
+
aria-controls=${E(i?this._inlineSlotMenuId(r):void 0)}
|
|
255
255
|
?disabled=${this.disabled}
|
|
256
256
|
@click=${()=>this._handleEditClick(r)}
|
|
257
257
|
>
|
|
258
258
|
${f(a)}
|
|
259
259
|
<luzmo-tooltip self-managed placement="top" size=${this.size}>
|
|
260
|
-
${
|
|
260
|
+
${t(`Edit`,{desc:`Edit action label`})}
|
|
261
261
|
</luzmo-tooltip>
|
|
262
262
|
</luzmo-action-button>`}
|
|
263
|
-
${this.hideClear?``:
|
|
263
|
+
${this.hideClear?``:T`<luzmo-action-button
|
|
264
264
|
class="delete-button"
|
|
265
265
|
.size=${this.size}
|
|
266
266
|
quiet
|
|
267
|
-
.label=${
|
|
267
|
+
.label=${t(`Delete`,{desc:`Delete action label`})}
|
|
268
268
|
?disabled=${this.disabled}
|
|
269
269
|
@click=${n}
|
|
270
270
|
>
|
|
271
271
|
${f(o)}
|
|
272
272
|
<luzmo-tooltip self-managed placement="top" size=${this.size}>
|
|
273
|
-
${
|
|
273
|
+
${t(`Delete`,{desc:`Delete action label`})}
|
|
274
274
|
</luzmo-tooltip>
|
|
275
275
|
</luzmo-action-button>`}
|
|
276
|
-
</div>`}_renderSingleSelect(){let e=this._renderFieldLabel(),t=this._currentSlotContents.length>0;if(!t&&!this._hasExtraEmptySelects)return
|
|
276
|
+
</div>`}_renderSingleSelect(){let e=this._renderFieldLabel(),t=this._currentSlotContents.length>0;if(!t&&!this._hasExtraEmptySelects)return T`<div class="select-container">
|
|
277
277
|
${this.hasLabel?e:``} ${this._renderSelectMenu(0)}
|
|
278
|
-
</div>`;let n=this._currentSlotContents.map((t,n)=>
|
|
278
|
+
</div>`;let n=this._currentSlotContents.map((t,n)=>T` <div class="select-container">
|
|
279
279
|
${this.hasLabel&&n===0?e:``}
|
|
280
280
|
<div class="select-controls">
|
|
281
281
|
${this._renderSelectMenu(n)}
|
|
@@ -283,9 +283,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
283
283
|
${this.slotContents?.length>0&&!this._hasInlineSlotMenu?this._renderOverlaySlotMenu(`trigger-${n}`,n):``}
|
|
284
284
|
</div>
|
|
285
285
|
${this.slotContents?.length>0&&this._hasInlineSlotMenu?this._renderInlineSlotMenu(n):``}
|
|
286
|
-
</div>`);return this._hasExtraEmptySelects&&n.push(
|
|
286
|
+
</div>`);return this._hasExtraEmptySelects&&n.push(T`<div class="select-container">
|
|
287
287
|
${this._renderSelectMenu(this._currentSlotContents.length)}
|
|
288
|
-
</div>`),t&&this.slotConfiguration?.canAcceptMultipleDataFields&&n.push(this._renderExtraDataFieldButton()),n}_renderMultipleSelect(){let e=this._renderFieldLabel();return
|
|
288
|
+
</div>`),t&&this.slotConfiguration?.canAcceptMultipleDataFields&&n.push(this._renderExtraDataFieldButton()),n}_renderMultipleSelect(){let e=this._renderFieldLabel();return T`<div class="select-container">
|
|
289
289
|
${this.hasLabel?e:``}
|
|
290
290
|
|
|
291
291
|
<div class="select-controls">
|
|
@@ -293,16 +293,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
293
293
|
${this.slotContents?.length>0?this._renderControls(`trigger`,()=>this._removeAllSlotContents()):``}
|
|
294
294
|
${this.slotContents?.length>0?this._renderOverlaySlotMenu(`trigger`):``}
|
|
295
295
|
</div>
|
|
296
|
-
</div>`}_renderSlotMenu(e){return
|
|
296
|
+
</div>`}_renderSlotMenu(e){return T`<luzmo-slot-menu
|
|
297
297
|
?no-remove=${!this.hideClear}
|
|
298
298
|
language=${this.language}
|
|
299
299
|
content-language=${this.contentLanguage}
|
|
300
300
|
slot-type=${this.slotConfiguration?.type}
|
|
301
|
-
slot-name=${
|
|
302
|
-
item-type=${
|
|
303
|
-
api-url=${
|
|
304
|
-
auth-key=${
|
|
305
|
-
auth-token=${
|
|
301
|
+
slot-name=${E(this.slotName)}
|
|
302
|
+
item-type=${E(this.itemType)}
|
|
303
|
+
api-url=${E(this.apiUrl)}
|
|
304
|
+
auth-key=${E(this.authKey)}
|
|
305
|
+
auth-token=${E(this.authToken)}
|
|
306
306
|
.datasetsDataFields=${this.datasetsDataFields}
|
|
307
307
|
.areGrandTotalsEnabled=${this.slotConfiguration?.options?.areGrandTotalsEnabled}
|
|
308
308
|
.areDatetimeOptionsEnabled=${this.slotConfiguration?.options?.areDatetimeOptionsEnabled}
|
|
@@ -313,9 +313,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
313
313
|
variant="popup"
|
|
314
314
|
.size=${this.size}
|
|
315
315
|
@luzmo-slot-contents-changed=${this._onSlotMenuChanges}
|
|
316
|
-
></luzmo-slot-menu>`}_renderOverlaySlotMenu(e,t){return
|
|
316
|
+
></luzmo-slot-menu>`}_renderOverlaySlotMenu(e,t){return T`<luzmo-overlay trigger=${`${e}@click`} .placement=${this.slotMenuPlacement}>
|
|
317
317
|
${this._renderSlotMenu(t)}
|
|
318
|
-
</luzmo-overlay>`}_renderInlineSlotMenu(e){return
|
|
318
|
+
</luzmo-overlay>`}_renderInlineSlotMenu(e){return T`<div
|
|
319
319
|
class="inline-slot-menu"
|
|
320
320
|
id=${this._inlineSlotMenuId(e)}
|
|
321
321
|
?hidden=${this._expandedIndex!==e}
|
|
@@ -323,26 +323,26 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
323
323
|
@keydown=${this._handleInlineSlotMenuKeydown}
|
|
324
324
|
>
|
|
325
325
|
${this._renderSlotMenu(e)}
|
|
326
|
-
</div>`}get _hasInlineSlotMenu(){return this.slotMenuMode===`inline`&&this.selects===`single`}_inlineSlotMenuId(e){return`inline-slot-menu-${e}`}_handleEditClick(e){this.selects===`single`&&this._store.updateActive(e),this._hasInlineSlotMenu&&(this._expandedIndex=this._expandedIndex===e?void 0:e)}_handleInlineSlotMenuClose(e){e.stopPropagation(),this._expandedIndex=void 0}_handleInlineSlotMenuKeydown(e){if(e.key!==`Escape`||e.defaultPrevented||this._expandedIndex===void 0)return;let t=e.composedPath();if(t.slice(0,t.indexOf(e.currentTarget)).some(e=>e.open===!0))return;e.preventDefault(),e.stopPropagation();let n=this._expandedIndex;this._expandedIndex=void 0,this._focusEditButton(n)}async _focusEditButton(e){await this.updateComplete;let t=this.shadowRoot?.getElementById(`trigger-${e}`);await t?.updateComplete,t?.focus()}_renderMultipleSelectionControl(){let e=this._currentSlotContents.map((e,t)=>({content:e,index:t})).filter(({content:e})=>q(e,this.slotConfiguration));return e.length===0?this._renderSelectMenu():
|
|
326
|
+
</div>`}get _hasInlineSlotMenu(){return this.slotMenuMode===`inline`&&this.selects===`single`}_inlineSlotMenuId(e){return`inline-slot-menu-${e}`}_handleEditClick(e){this.selects===`single`&&this._store.updateActive(e),this._hasInlineSlotMenu&&(this._expandedIndex=this._expandedIndex===e?void 0:e)}_handleInlineSlotMenuClose(e){e.stopPropagation(),this._expandedIndex=void 0}_handleInlineSlotMenuKeydown(e){if(e.key!==`Escape`||e.defaultPrevented||this._expandedIndex===void 0)return;let t=e.composedPath();if(t.slice(0,t.indexOf(e.currentTarget)).some(e=>e.open===!0))return;e.preventDefault(),e.stopPropagation();let n=this._expandedIndex;this._expandedIndex=void 0,this._focusEditButton(n)}async _focusEditButton(e){await this.updateComplete;let t=this.shadowRoot?.getElementById(`trigger-${e}`);await t?.updateComplete,t?.focus()}_renderMultipleSelectionControl(){let e=this._currentSlotContents.map((e,t)=>({content:e,index:t})).filter(({content:e})=>q(e,this.slotConfiguration));return e.length===0?this._renderSelectMenu():T`<div class="calculations-list">
|
|
327
327
|
${e.map(({content:e,index:t})=>this._renderCalculation(e,t,this._currentSlotContents.length>1))}
|
|
328
328
|
</div>
|
|
329
|
-
${e.length<this._currentSlotContents.length?this._renderSelectMenu(void 0,!0):``}`}_getSelectValueForSlotContent(e,t){let n=No(e);if(!n)return;let r=e.columnId,i=e.level;if(!r||typeof i!=`number`||Number.isNaN(i))return n;let a;for(let e of t)if(a=e.columns?.find(e=>e.id===r),a)break;return a&&(Array.isArray(a.hierarchyLevels)&&a.hierarchyLevels.length>2&&a.hierarchy_enabled===!0&&i>=1||(a.type===`datetime`||a.type===`array[datetime]`)&&typeof a.lowestLevel==`number`)?Fo(r,i):n}_getFilteredDatasetsDataFields(){let e=this.slotConfiguration?.acceptableDataFieldTypes?.length?this.slotConfiguration.acceptableDataFieldTypes:Qi;return this.datasetsDataFields.map(t=>({...t,columns:t.columns?.filter(t=>e.includes(t.type??``))??[],formulas:this.slotConfiguration?.canAcceptFormula?t.formulas??[]:[]}))}_removeSlotContentAt(e){let t=this.matches(`:focus-within`);this._shiftExpandedIndexAfterRemoval(e),this._currentSlotContents.splice(e,1),this.slotContents=structuredClone(this._currentSlotContents),this._store?.setContents(this.slotContents,this.slotName),this._changedSlotContents(this.slotContents),t&&this._focusRowAfterRemoval(e)}_shiftExpandedIndexAfterRemoval(e){this._expandedIndex===void 0||this._expandedIndex<e||(this._expandedIndex=this._expandedIndex===e?void 0:this._expandedIndex-1,this._expandedIndex!==void 0&&this._store.updateActive(this._expandedIndex))}_removeAllSlotContents(){let e=this.matches(`:focus-within`);this._currentSlotContents=[],this.slotContents=[],this._store?.setContents(this.slotContents,this.slotName),this._changedSlotContents(this.slotContents),e&&this._focusRowAfterRemoval(0)}async _focusRowAfterRemoval(e){await this.updateComplete;let t=[...this.shadowRoot?.querySelectorAll(`.container > .select-container`)??[]],n=t[Math.min(e,t.length-1)]?.querySelector(`luzmo-data-fields-select, luzmo-action-button`);await n?.updateComplete,n?.focus()}_renderCalculation(
|
|
330
|
-
${eo(
|
|
331
|
-
${this.hideClear||!r?``:
|
|
329
|
+
${e.length<this._currentSlotContents.length?this._renderSelectMenu(void 0,!0):``}`}_getSelectValueForSlotContent(e,t){let n=No(e);if(!n)return;let r=e.columnId,i=e.level;if(!r||typeof i!=`number`||Number.isNaN(i))return n;let a;for(let e of t)if(a=e.columns?.find(e=>e.id===r),a)break;return a&&(Array.isArray(a.hierarchyLevels)&&a.hierarchyLevels.length>2&&a.hierarchy_enabled===!0&&i>=1||(a.type===`datetime`||a.type===`array[datetime]`)&&typeof a.lowestLevel==`number`)?Fo(r,i):n}_getFilteredDatasetsDataFields(){let e=this.slotConfiguration?.acceptableDataFieldTypes?.length?this.slotConfiguration.acceptableDataFieldTypes:Qi;return this.datasetsDataFields.map(t=>({...t,columns:t.columns?.filter(t=>e.includes(t.type??``))??[],formulas:this.slotConfiguration?.canAcceptFormula?t.formulas??[]:[]}))}_removeSlotContentAt(e){let t=this.matches(`:focus-within`);this._shiftExpandedIndexAfterRemoval(e),this._currentSlotContents.splice(e,1),this.slotContents=structuredClone(this._currentSlotContents),this._store?.setContents(this.slotContents,this.slotName),this._changedSlotContents(this.slotContents),t&&this._focusRowAfterRemoval(e)}_shiftExpandedIndexAfterRemoval(e){this._expandedIndex===void 0||this._expandedIndex<e||(this._expandedIndex=this._expandedIndex===e?void 0:this._expandedIndex-1,this._expandedIndex!==void 0&&this._store.updateActive(this._expandedIndex))}_removeAllSlotContents(){let e=this.matches(`:focus-within`);this._currentSlotContents=[],this.slotContents=[],this._store?.setContents(this.slotContents,this.slotName),this._changedSlotContents(this.slotContents),e&&this._focusRowAfterRemoval(0)}async _focusRowAfterRemoval(e){await this.updateComplete;let t=[...this.shadowRoot?.querySelectorAll(`.container > .select-container`)??[]],n=t[Math.min(e,t.length-1)]?.querySelector(`luzmo-data-fields-select, luzmo-action-button`);await n?.updateComplete,n?.focus()}_renderCalculation(e,n,r=!1){return T`<div class="calculation-control">
|
|
330
|
+
${eo(e)}
|
|
331
|
+
${this.hideClear||!r?``:T`<luzmo-action-button
|
|
332
332
|
quiet
|
|
333
333
|
.size=${this.size}
|
|
334
|
-
.label=${
|
|
334
|
+
.label=${t(`Clear calculation`,{desc:`Clear an ad-hoc slot calculation and return to column selection`})}
|
|
335
335
|
?disabled=${this.disabled}
|
|
336
336
|
@click=${()=>this._removeSlotContentAt(n)}
|
|
337
337
|
>
|
|
338
338
|
${f(se)}
|
|
339
339
|
</luzmo-action-button>`}
|
|
340
|
-
</div>`}_renderSelectMenu(
|
|
340
|
+
</div>`}_renderSelectMenu(e,n=!1){let r=e??0,i=this._currentSlotContents[r];if(!n&&i&&(e!==void 0||this._currentSlotContents.length===1)&&q(i,this.slotConfiguration))return this._renderCalculation(i,r);let a=[],o=this._getFilteredDatasetsDataFields();if(e!==void 0&&e>=this._currentSlotContents.length)a=[];else if(a=this._currentSlotContents.filter(e=>!n||!q(e,this.slotConfiguration)).map(e=>this._getSelectValueForSlotContent(e,o)).filter(e=>typeof e==`string`&&e.length>0),this.selects===`single`&&a?.length>0){let t=a[e??0];a=t?[t]:[]}return T`<luzmo-data-fields-select
|
|
341
341
|
.language=${this.language}
|
|
342
342
|
.contentLanguage=${this.contentLanguage}
|
|
343
343
|
.size=${this.size}
|
|
344
344
|
.icons=${this.icons}
|
|
345
|
-
.placeholder=${this.placeholder??
|
|
345
|
+
.placeholder=${this.placeholder??t(`Add a data field...`,{desc:`Placeholder for an empty data field select`})}
|
|
346
346
|
.placement=${this.placement}
|
|
347
347
|
.search=${this.search}
|
|
348
348
|
?disabled=${this.disabled}
|
|
@@ -350,29 +350,29 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
350
350
|
.datasetsDataFields=${o}
|
|
351
351
|
.value=${a}
|
|
352
352
|
.selects=${this.selects===`multiple`&&this.slotConfiguration?.canAcceptMultipleDataFields?`multiple`:`single`}
|
|
353
|
-
data-index=${
|
|
353
|
+
data-index=${e??0}
|
|
354
354
|
@luzmo-data-fields-selected=${this._handleSelectChange}
|
|
355
355
|
>
|
|
356
|
-
</luzmo-data-fields-select>`}_handleSelectChange(e){if(this.selects===`single`){let t=e.currentTarget?.dataset?.index,n=t?Number.parseInt(t,10):0;this._setSlotContentAtIndex(e,Number.isNaN(n)?0:n)}else this._setSlotContents(e)}_itemSlotPickerMarkup(){return
|
|
356
|
+
</luzmo-data-fields-select>`}_handleSelectChange(e){if(this.selects===`single`){let t=e.currentTarget?.dataset?.index,n=t?Number.parseInt(t,10):0;this._setSlotContentAtIndex(e,Number.isNaN(n)?0:n)}else this._setSlotContents(e)}_itemSlotPickerMarkup(){return T`
|
|
357
357
|
<div class="container">
|
|
358
358
|
${this.selects===`multiple`?this._renderMultipleSelect():this._renderSingleSelect()}
|
|
359
359
|
</div>
|
|
360
|
-
`}render(){return this._loadSlotsConfig.render({pending:()=>
|
|
360
|
+
`}render(){return this._loadSlotsConfig.render({pending:()=>T`
|
|
361
361
|
<p>Loading...</p>
|
|
362
|
-
`,complete:e=>{if(this.slotName&&this.itemType&&e){let t=e.find(e=>e.name===this.slotName);t&&(this.slotConfiguration=t)}return this._itemSlotPickerMarkup()},error:e=>
|
|
362
|
+
`,complete:e=>{if(this.slotName&&this.itemType&&e){let t=e.find(e=>e.name===this.slotName);t&&(this.slotConfiguration=t)}return this._itemSlotPickerMarkup()},error:e=>T`
|
|
363
363
|
<div>
|
|
364
364
|
Could not load item-slot-picker: '${this.slotName}' of chart
|
|
365
365
|
'${this.itemType}': ${e}.
|
|
366
366
|
</div>
|
|
367
|
-
`})}};n([k({type:String,attribute:`api-url`,reflect:!0})],Q.prototype,`apiUrl`,void 0),n([k({type:String,attribute:`auth-key`,reflect:!0})],Q.prototype,`authKey`,void 0),n([k({type:String,attribute:`auth-token`,reflect:!0})],Q.prototype,`authToken`,void 0),n([k({type:String,reflect:!0,attribute:`item-type`})],Q.prototype,`itemType`,void 0),n([k({type:String,reflect:!0,attribute:`slot-name`})],Q.prototype,`slotName`,void 0),n([k({type:Object})],Q.prototype,`slotConfiguration`,void 0),n([k({type:Array})],Q.prototype,`slotContents`,void 0),n([k({type:String,attribute:`content-language`,reflect:!0})],Q.prototype,`contentLanguage`,void 0),n([k({type:Boolean,attribute:`disabled`,reflect:!0})],Q.prototype,`disabled`,void 0),n([k({type:Boolean,attribute:`grows`,reflect:!0})],Q.prototype,`grows`,void 0),n([k({type:String,reflect:!0})],Q.prototype,`menu`,void 0),n([k({type:Boolean,attribute:`has-label`,reflect:!0})],Q.prototype,`hasLabel`,void 0),n([k({type:String,reflect:!0})],Q.prototype,`label`,void 0),n([k({type:String,reflect:!0})],Q.prototype,`selects`,void 0),n([k({type:String,reflect:!0})],Q.prototype,`search`,void 0),n([k({type:String,reflect:!0})],Q.prototype,`icons`,void 0),n([k({type:String,attribute:`placeholder`,reflect:!0})],Q.prototype,`placeholder`,void 0),n([k({type:Array,reflect:!1})],Q.prototype,`datasetsDataFields`,void 0),n([k({type:String,reflect:!0})],Q.prototype,`placement`,void 0),n([k({type:String,reflect:!0,attribute:`slot-menu-placement`})],Q.prototype,`slotMenuPlacement`,void 0),n([k({type:String,reflect:!0,attribute:`slot-menu-mode`})],Q.prototype,`slotMenuMode`,void 0),n([k({type:Boolean,reflect:!0,attribute:`hide-configuration`})],Q.prototype,`hideConfiguration`,void 0),n([k({type:Boolean,reflect:!0,attribute:`hide-clear`})],Q.prototype,`hideClear`,void 0),n([A()],Q.prototype,`_hasExtraEmptySelects`,void 0),n([A()],Q.prototype,`_expandedIndex`,void 0),Q=n([r()],Q),customElements.get(`luzmo-item-slot-picker`)||customElements.define(`luzmo-item-slot-picker`,Q);var Io=`:host{font-size:var(--luzmo-item-slot-picker-panel-font-size,var(--luzmo-font-size));font-family:var(--luzmo-font-family,sans-serif);color:var(--luzmo-font-color,inherit);display:block}:host([size=s]){font-size:var(--luzmo-item-slot-picker-panel-font-size-s,var(--luzmo-font-size-s))}:host([size=l]){font-size:var(--luzmo-item-slot-picker-panel-font-size-l,var(--luzmo-font-size-l))}:host([size=xl]){font-size:var(--luzmo-item-slot-picker-panel-font-size-xl,var(--luzmo-font-size-xl))}.container{flex-direction:column;align-items:flex-start;display:flex}.dataset-picker{align-self:stretch;align-items:flex-start;gap:var(--luzmo-item-slot-picker-panel-dataset-picker-gap,var(--luzmo-spacing-2));border-bottom-style:solid;border-bottom-width:var(--luzmo-item-slot-picker-panel-dataset-picker-border-width,1px);border-bottom-color:var(--luzmo-item-slot-picker-panel-dataset-picker-border-color,var(--luzmo-border-color));flex-direction:column;flex-shrink:0;margin-block-end:var(--luzmo-item-slot-picker-panel-dataset-picker-margin-block-end,var(--luzmo-spacing-4));padding-block-end:var(--luzmo-item-slot-picker-panel-dataset-picker-padding-block-end,var(--luzmo-spacing-4));display:flex}.slots-panel{gap:var(--luzmo-item-slot-picker-panel-gap,var(--luzmo-spacing-5));flex-direction:column;display:flex}.slot-container{gap:var(--luzmo-item-slot-picker-panel-slot-gap,var(--luzmo-spacing-2));flex-direction:column;display:flex}luzmo-field-label{margin:0}luzmo-item-slot-picker{display:block}:host([grows]) .container{align-items:stretch;width:100%}:host([grows]) .dataset-picker{align-items:stretch}:host([grows]) .dataset-picker luzmo-select{width:100%}`,Lo=50,$=class extends t(m(h,{validSizes:[`s`,`m`,`l`,`xl`],noDefaultSize:!0})){constructor(...e){super(...e),this._loadSlotsConfig=new C(this,{task:async([e])=>{if(e&&e!==this._itemTypeLoaded){this._itemTypeLoaded=e;let t=await he(e);return this._slotsConfig=t??[],this._slotsConfig}return this._slotsConfig},args:()=>[this.itemType,this.language]}),this._slotsConfig=[],this._datasetListItems=[],this._datasetListRetrieving=!1,this._datasetListPending=!1,this._datasetNamesFetchAttempted=!1,this._hasMoreDatasets=!0,this._fetchedDatasetsDataFields=[],this._failedDatasetIds=/* @__PURE__ */ new Set,this._loadDataFieldsTask=new C(this,{args:()=>[this._currentDatasetId,this.apiUrl,this.authKey,this.authToken,this.datasetsDataFields.length],task:async([e,t,n,r,i])=>{if(i>0||!e)return null;if(!v(e))return console.warn(`[LuzmoItemSlotPickerPanel] Invalid dataset ID provided (not a valid UUID): ${e}`),this._failedDatasetIds.add(e),null;if(this._failedDatasetIds.has(e))return null;let a=this._fetchedDatasetsDataFields.find(t=>t.id===e);if(a&&a.columns&&a.columns.length>0)return a;try{let t=await y.fetchDatasetsWithColumnsAndFormulas([e]);if(t.length===0)return this._failedDatasetIds.add(e),null;let n=t[0],r=this._fetchedDatasetsDataFields.findIndex(t=>t.id===e);return r===-1?this._fetchedDatasetsDataFields=[...this._fetchedDatasetsDataFields,n]:this._fetchedDatasetsDataFields[r]=n,n}catch(t){return console.warn(`Failed to fetch dataset data fields:`,t),this._failedDatasetIds.add(e),null}}}),this.contentLanguage=`en`,this.slotsContents=[],this.selects=`multiple`,this.dataFieldsSearch=`auto`,this.datasetSearch=`auto`,this.icons=`menu-only`,this.datasetsDataFields=[],this.datasetIds=[],this.datasetPicker=!1,this.apiUrl=`https://api.luzmo.com`,this.placement=`bottom-start`,this.slotMenuPlacement=`bottom-end`,this.slotMenuMode=`overlay`,this.constraintMode=`auto`,this.grows=!1,this._currentSlotsContents=[],this._createSlotChangeHandler=e=>t=>{t.preventDefault(),t.stopPropagation();let n=t.detail.slotContents??[],r=this._applySlotConstraints(e,n);r!==null&&(this._currentSlotsContents=r,this.slotsContents=structuredClone(r),this.dispatchEvent(new CustomEvent(`luzmo-slots-contents-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotsContents:r}})))}}static{this.styles=re(Io)}get _availableDatasets(){return this.datasetsDataFields.length>0?this.datasetsDataFields:this.datasetIds.length>0?this.datasetIds.map(e=>{let t=this._datasetListItems.find(t=>t.id===e);return t?{id:t.id,name:t.name,description:t.description}:{id:e,name:{en:e}}}):this._datasetListItems.length>0?this._datasetListItems.map(e=>({id:e.id,name:e.name,description:e.description})):[]}get _currentDatasetsDataFields(){if(this.datasetsDataFields.length>0){if(!this._currentDatasetId)return this.datasetsDataFields;let e=this.datasetsDataFields.find(e=>e.id===this._currentDatasetId);return e?[e]:this.datasetsDataFields}let e=this._loadDataFieldsTask.value;if(e)return[{id:e.id,name:e.name,description:e.description,columns:e.columns??[],formulas:e.formulas??[]}];if(this._fetchedDatasetsDataFields.length>0&&this._currentDatasetId){let e=this._fetchedDatasetsDataFields.find(e=>e.id===this._currentDatasetId);if(e)return[{id:e.id,name:e.name,description:e.description,columns:e.columns??[],formulas:e.formulas??[]}]}return[]}get _shouldFetchDatasetList(){return this.datasetPicker&&this.datasetsDataFields.length===0}_areDatasetsLinked(e,t){return e===t}_getUsedDatasetIds(){let e=/* @__PURE__ */ new Set;for(let t of this._currentSlotsContents)for(let n of t.content)n.datasetId&&e.add(n.datasetId);return[...e]}willUpdate(e){super.willUpdate(e),e.has(`slotsContents`)&&(this._currentSlotsContents=structuredClone(this.slotsContents??[]));let t=e.has(`selectedDatasetId`),n=e.has(`datasetsDataFields`),r=e.has(`datasetIds`),i=e.has(`datasetPicker`),a=e.has(`authKey`),o=e.has(`authToken`),s=e.has(`apiUrl`);(r||a||o||s)&&(this._datasetListItems=[],this._hasMoreDatasets=!0,this._datasetNamesFetchAttempted=!1,this._fetchedDatasetsDataFields=[],this._failedDatasetIds.clear(),y.configure({apiUrl:this.apiUrl,authKey:this.authKey??``,authToken:this.authToken??``})),n&&this.datasetsDataFields.length>0&&(this._datasetListItems=[],this._hasMoreDatasets=!0,this._fetchedDatasetsDataFields=[],this._failedDatasetIds.clear()),(t||n||r)&&this._updateCurrentDatasetId(),(r||a||o||s||i)&&this.datasetIds.length>0&&this.datasetPicker&&this.datasetsDataFields.length===0&&this._datasetListItems.length===0&&this._fetchDatasetNamesForPicker()}_updateCurrentDatasetId(){let e=this._availableDatasets;this._currentDatasetId=this.selectedDatasetId&&e.some(e=>e.id===this.selectedDatasetId)||this.selectedDatasetId&&this.datasetIds.includes(this.selectedDatasetId)?this.selectedDatasetId:e.length>0?e[0].id:void 0}async _fetchDatasetNamesForPicker(){if(this.datasetIds.length!==0){this._datasetListPending=!0;try{let e=await y.fetchDatasetNames(this.datasetIds);this._datasetListItems=e}catch(e){console.warn(`Failed to fetch dataset names:`,e)}finally{this._datasetListPending=!1,this._datasetNamesFetchAttempted=!0}}}async _loadMoreDatasets(e){if(!this._datasetListRetrieving&&this._hasMoreDatasets){this._datasetListRetrieving=!0,e&&(e.retrieving=!0);try{let e=this._datasetListItems.length,t=await y.fetchAllDatasets({offset:e,limit:Lo});this._datasetListItems=[...this._datasetListItems,...t.data],this._hasMoreDatasets=e+Lo<(t.pagination?.total??0),!this._currentDatasetId&&this._datasetListItems.length>0&&this._updateCurrentDatasetId()}catch(e){console.warn(`Failed to load dataset list:`,e),this._hasMoreDatasets=!1}finally{this._datasetListRetrieving=!1,e&&(e.retrieving=!1)}}}_handlePickerScrolled(e){if(this.datasetIds.length>0)return;let t=e.target,{last:n}=e.detail;n>=this._datasetListItems.length-10&&this._hasMoreDatasets&&this._loadMoreDatasets(t)}async _handlePickerOpened(e){let t=e.target;if(this._datasetListItems.length===0&&this._shouldFetchDatasetList&&this.datasetIds.length===0&&this._hasMoreDatasets){t.pending=!0;try{await this._loadMoreDatasets(t)}finally{t.pending=!1}}}_handleDatasetChange(e){let t=e.detail?.value?.[0];if(!t||t===this._currentDatasetId)return;let n=this._getUsedDatasetIds(),r=this._currentSlotsContents.some(e=>e.content.length>0),i=n.every(e=>this._areDatasetsLinked(e,t));if(r&&!i){if(this.constraintMode===`event-only`){this.dispatchEvent(new CustomEvent(`luzmo-dataset-constraint-triggered`,{bubbles:!0,composed:!0,detail:{previousDatasetId:this._currentDatasetId,newDatasetId:t,currentSlotsContents:structuredClone(this._currentSlotsContents),wouldClearSlots:!0}}));return}this._currentSlotsContents=[],this.slotsContents=[],this.dispatchEvent(new CustomEvent(`luzmo-slots-contents-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotsContents:[]}}))}this._currentDatasetId=t,this.dispatchEvent(new CustomEvent(`luzmo-dataset-changed`,{bubbles:!0,composed:!0,detail:{datasetId:t}}))}_getSlotContents(e){return this._currentSlotsContents?.find(t=>t.name===e)?.content??[]}_applySlotConstraints(e,t){let n=this.slotsConfiguration??this._slotsConfig,r=structuredClone(this._currentSlotsContents),i=structuredClone(this._currentSlotsContents),a=i.findIndex(t=>t.name===e);a===-1?i.push({name:e,content:t}):i[a].content=t;let o=[];for(let r of n){if(r.keepOnlyFirstWhenOtherSlotFilled?.includes(e)&&t.length>0){let t=i.findIndex(e=>e.name===r.name);t!==-1&&i[t].content.length>1&&(o.push({type:`keepOnlyFirstWhenOtherSlotFilled`,affectedSlotName:r.name,triggeredBySlotName:e}),i[t].content=[i[t].content[0]])}if(r.clearWhenOtherSlotHasMultipleItems?.includes(e)&&t.length>1){let t=i.findIndex(e=>e.name===r.name);t!==-1&&i[t].content.length>0&&(o.push({type:`clearWhenOtherSlotHasMultipleItems`,affectedSlotName:r.name,triggeredBySlotName:e}),i[t].content=[])}}if(this.constraintMode===`event-only`&&o.length>0){let n={triggerSlotName:e,proposedTriggerContents:t,originalSlotsContents:r,proposedSlotsContents:i,constraints:o};return this.dispatchEvent(new CustomEvent(`luzmo-slot-constraint-triggered`,{detail:n,bubbles:!0,composed:!0})),null}return i}_getTranslatedLabel(e){let t=(typeof e.label==`string`?e.label:e.label?x(e.label,this.language):void 0)??e.name;return Wi[t]?Wi[t]():t}_renderDatasetPicker(){if(!this.datasetPicker)return O;let t=this._availableDatasets,n=t.length>1,r=this.datasetIds.length>0,i=this._shouldFetchDatasetList;if(!n&&!r&&!i)return O;let a=this._datasetListPending||this.datasetIds.length>0&&this._datasetListItems.length===0&&this.datasetsDataFields.length===0&&!this._datasetNamesFetchAttempted,o=a?[]:t.map(e=>({value:e.id,label:x(e.name,this.contentLanguage)||e.id})),s=a?[]:this._currentDatasetId?[this._currentDatasetId]:[],c=e(a?`Loading datasets...`:`Select dataset...`);return E`
|
|
367
|
+
`})}};e([O({type:String,attribute:`api-url`,reflect:!0})],Q.prototype,`apiUrl`,void 0),e([O({type:String,attribute:`auth-key`,reflect:!0})],Q.prototype,`authKey`,void 0),e([O({type:String,attribute:`auth-token`,reflect:!0})],Q.prototype,`authToken`,void 0),e([O({type:String,reflect:!0,attribute:`item-type`})],Q.prototype,`itemType`,void 0),e([O({type:String,reflect:!0,attribute:`slot-name`})],Q.prototype,`slotName`,void 0),e([O({type:Object})],Q.prototype,`slotConfiguration`,void 0),e([O({type:Array})],Q.prototype,`slotContents`,void 0),e([O({type:String,attribute:`content-language`,reflect:!0})],Q.prototype,`contentLanguage`,void 0),e([O({type:Boolean,attribute:`disabled`,reflect:!0})],Q.prototype,`disabled`,void 0),e([O({type:Boolean,attribute:`grows`,reflect:!0})],Q.prototype,`grows`,void 0),e([O({type:String,reflect:!0})],Q.prototype,`menu`,void 0),e([O({type:Boolean,attribute:`has-label`,reflect:!0})],Q.prototype,`hasLabel`,void 0),e([O({type:String,reflect:!0})],Q.prototype,`label`,void 0),e([O({type:String,reflect:!0})],Q.prototype,`selects`,void 0),e([O({type:String,reflect:!0})],Q.prototype,`search`,void 0),e([O({type:String,reflect:!0})],Q.prototype,`icons`,void 0),e([O({type:String,attribute:`placeholder`,reflect:!0})],Q.prototype,`placeholder`,void 0),e([O({type:Array,reflect:!1})],Q.prototype,`datasetsDataFields`,void 0),e([O({type:String,reflect:!0})],Q.prototype,`placement`,void 0),e([O({type:String,reflect:!0,attribute:`slot-menu-placement`})],Q.prototype,`slotMenuPlacement`,void 0),e([O({type:String,reflect:!0,attribute:`slot-menu-mode`})],Q.prototype,`slotMenuMode`,void 0),e([O({type:Boolean,reflect:!0,attribute:`hide-configuration`})],Q.prototype,`hideConfiguration`,void 0),e([O({type:Boolean,reflect:!0,attribute:`hide-clear`})],Q.prototype,`hideClear`,void 0),e([k()],Q.prototype,`_hasExtraEmptySelects`,void 0),e([k()],Q.prototype,`_expandedIndex`,void 0),Q=e([r()],Q),customElements.get(`luzmo-item-slot-picker`)||customElements.define(`luzmo-item-slot-picker`,Q);var Io=`:host{font-size:var(--luzmo-item-slot-picker-panel-font-size,var(--luzmo-font-size));font-family:var(--luzmo-font-family,sans-serif);color:var(--luzmo-font-color,inherit);display:block}:host([size=s]){font-size:var(--luzmo-item-slot-picker-panel-font-size-s,var(--luzmo-font-size-s))}:host([size=l]){font-size:var(--luzmo-item-slot-picker-panel-font-size-l,var(--luzmo-font-size-l))}:host([size=xl]){font-size:var(--luzmo-item-slot-picker-panel-font-size-xl,var(--luzmo-font-size-xl))}.container{flex-direction:column;align-items:flex-start;display:flex}.dataset-picker{align-self:stretch;align-items:flex-start;gap:var(--luzmo-item-slot-picker-panel-dataset-picker-gap,var(--luzmo-spacing-2));border-bottom-style:solid;border-bottom-width:var(--luzmo-item-slot-picker-panel-dataset-picker-border-width,1px);border-bottom-color:var(--luzmo-item-slot-picker-panel-dataset-picker-border-color,var(--luzmo-border-color));flex-direction:column;flex-shrink:0;margin-block-end:var(--luzmo-item-slot-picker-panel-dataset-picker-margin-block-end,var(--luzmo-spacing-4));padding-block-end:var(--luzmo-item-slot-picker-panel-dataset-picker-padding-block-end,var(--luzmo-spacing-4));display:flex}.slots-panel{gap:var(--luzmo-item-slot-picker-panel-gap,var(--luzmo-spacing-5));flex-direction:column;display:flex}.slot-container{gap:var(--luzmo-item-slot-picker-panel-slot-gap,var(--luzmo-spacing-2));flex-direction:column;display:flex}luzmo-field-label{margin:0}luzmo-item-slot-picker{display:block}:host([grows]) .container{align-items:stretch;width:100%}:host([grows]) .dataset-picker{align-items:stretch}:host([grows]) .dataset-picker luzmo-select{width:100%}`,Lo=50,Ro=400,$=class extends n(y(p,{validSizes:[`s`,`m`,`l`,`xl`],noDefaultSize:!0})){constructor(...e){super(...e),this._loadSlotsConfig=new ee(this,{task:async([e])=>{if(e&&e!==this._itemTypeLoaded){this._itemTypeLoaded=e;let t=await he(e);return this._slotsConfig=t??[],this._slotsConfig}return this._slotsConfig},args:()=>[this.itemType,this.language]}),this._slotsConfig=[],this._datasetListItems=[],this._datasetSearchItems=[],this._datasetSearchValue=``,this._datasetSearchRequestId=0,this._datasetSearchDebounceTimer=null,this._datasetListRetrieving=!1,this._datasetListPending=!1,this._datasetNamesFetchAttempted=!1,this._hasMoreDatasets=!0,this._fetchedDatasetsDataFields=[],this._failedDatasetIds=/* @__PURE__ */ new Set,this._loadDataFieldsTask=new ee(this,{args:()=>[this._currentDatasetId,this.apiUrl,this.authKey,this.authToken,this.datasetsDataFields.length],task:async([e,t,n,r,i])=>{if(i>0||!e)return null;if(!v(e))return console.warn(`[LuzmoItemSlotPickerPanel] Invalid dataset ID provided (not a valid UUID): ${e}`),this._failedDatasetIds.add(e),null;if(this._failedDatasetIds.has(e))return null;let a=this._fetchedDatasetsDataFields.find(t=>t.id===e);if(a&&a.columns&&a.columns.length>0)return a;try{let t=await b.fetchDatasetsWithColumnsAndFormulas([e]);if(t.length===0)return this._failedDatasetIds.add(e),null;let n=t[0],r=this._fetchedDatasetsDataFields.findIndex(t=>t.id===e);return r===-1?this._fetchedDatasetsDataFields=[...this._fetchedDatasetsDataFields,n]:this._fetchedDatasetsDataFields[r]=n,n}catch(t){return console.warn(`Failed to fetch dataset data fields:`,t),this._failedDatasetIds.add(e),null}}}),this.contentLanguage=`en`,this.slotsContents=[],this.selects=`multiple`,this.dataFieldsSearch=`auto`,this.datasetSearch=`auto`,this.icons=`menu-only`,this.datasetsDataFields=[],this.datasetIds=[],this.datasetPicker=!1,this.apiUrl=`https://api.luzmo.com`,this.placement=`bottom-start`,this.slotMenuPlacement=`bottom-end`,this.slotMenuMode=`overlay`,this.constraintMode=`auto`,this.grows=!1,this._currentSlotsContents=[],this._createSlotChangeHandler=e=>t=>{t.preventDefault(),t.stopPropagation();let n=t.detail.slotContents??[],r=this._applySlotConstraints(e,n);r!==null&&(this._currentSlotsContents=r,this.slotsContents=structuredClone(r),this.dispatchEvent(new CustomEvent(`luzmo-slots-contents-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotsContents:r}})))}}static{this.styles=A(Io)}get _availableDatasets(){if(this.datasetsDataFields.length>0)return this.datasetsDataFields;if(this.datasetIds.length>0)return this.datasetIds.map(e=>{let t=this._datasetListItems.find(t=>t.id===e);return t?{id:t.id,name:t.name,description:t.description}:{id:e,name:{en:e}}});let e=[...this._datasetListItems,...this._datasetSearchItems.filter(e=>!this._datasetListItems.some(t=>t.id===e.id))];return e.length>0?e.map(e=>({id:e.id,name:e.name,description:e.description})):[]}get _currentDatasetsDataFields(){if(this.datasetsDataFields.length>0){if(!this._currentDatasetId)return this.datasetsDataFields;let e=this.datasetsDataFields.find(e=>e.id===this._currentDatasetId);return e?[e]:this.datasetsDataFields}let e=this._loadDataFieldsTask.value;if(e)return[{id:e.id,name:e.name,description:e.description,columns:e.columns??[],formulas:e.formulas??[]}];if(this._fetchedDatasetsDataFields.length>0&&this._currentDatasetId){let e=this._fetchedDatasetsDataFields.find(e=>e.id===this._currentDatasetId);if(e)return[{id:e.id,name:e.name,description:e.description,columns:e.columns??[],formulas:e.formulas??[]}]}return[]}get _shouldFetchDatasetList(){return this.datasetPicker&&this.datasetsDataFields.length===0}_areDatasetsLinked(e,t){return e===t}_getUsedDatasetIds(){let e=/* @__PURE__ */ new Set;for(let t of this._currentSlotsContents)for(let n of t.content)n.datasetId&&e.add(n.datasetId);return[...e]}disconnectedCallback(){super.disconnectedCallback(),this._clearDatasetSearchTimer()}willUpdate(e){super.willUpdate(e),e.has(`slotsContents`)&&(this._currentSlotsContents=structuredClone(this.slotsContents??[]));let t=e.has(`selectedDatasetId`),n=e.has(`datasetsDataFields`),r=e.has(`datasetIds`),i=e.has(`datasetPicker`),a=e.has(`authKey`),o=e.has(`authToken`),s=e.has(`apiUrl`);(r||a||o||s)&&(this._datasetListItems=[],this._datasetSearchItems=[],this._datasetSearchValue=``,this._datasetSearchRequestId++,this._clearDatasetSearchTimer(),this._hasMoreDatasets=!0,this._datasetNamesFetchAttempted=!1,this._fetchedDatasetsDataFields=[],this._failedDatasetIds.clear(),b.configure({apiUrl:this.apiUrl,authKey:this.authKey??``,authToken:this.authToken??``})),n&&this.datasetsDataFields.length>0&&(this._datasetListItems=[],this._hasMoreDatasets=!0,this._fetchedDatasetsDataFields=[],this._failedDatasetIds.clear()),(t||n||r)&&this._updateCurrentDatasetId(),(r||a||o||s||i)&&this.datasetIds.length>0&&this.datasetPicker&&this.datasetsDataFields.length===0&&this._datasetListItems.length===0&&this._fetchDatasetNamesForPicker()}_updateCurrentDatasetId(){let e=this._availableDatasets;this._currentDatasetId=this.selectedDatasetId&&e.some(e=>e.id===this.selectedDatasetId)||this.selectedDatasetId&&this.datasetIds.includes(this.selectedDatasetId)?this.selectedDatasetId:e.length>0?e[0].id:void 0}async _fetchDatasetNamesForPicker(){if(this.datasetIds.length!==0){this._datasetListPending=!0;try{let e=await b.fetchDatasetNames(this.datasetIds);this._datasetListItems=e}catch(e){console.warn(`Failed to fetch dataset names:`,e)}finally{this._datasetListPending=!1,this._datasetNamesFetchAttempted=!0}}}async _loadMoreDatasets(e){if(!this._datasetListRetrieving&&this._hasMoreDatasets){this._datasetListRetrieving=!0,e&&(e.retrieving=!0);try{let e=this._datasetListItems.length,t=await b.fetchAllDatasets({offset:e,limit:Lo});if(this._datasetListItems=[...this._datasetListItems,...t.data],this._hasMoreDatasets=e+Lo<(t.pagination?.total??0),!this._currentDatasetId){let e=this.selectedDatasetId??this._getUsedDatasetIds()[0];e&&this._datasetListItems.some(t=>t.id===e)&&(this._currentDatasetId=e)}}catch(e){console.warn(`Failed to load dataset list:`,e),this._hasMoreDatasets=!1}finally{this._datasetListRetrieving=!1,e&&(e.retrieving=!1)}}}_handlePickerScrolled(e){if(this.datasetIds.length>0||this._datasetSearchValue)return;let t=e.target,{last:n}=e.detail;n>=this._datasetListItems.length-10&&this._hasMoreDatasets&&this._loadMoreDatasets(t)}async _handlePickerOpened(e){let t=e.target;this._datasetListItems.length===0&&this._shouldFetchDatasetList&&this.datasetIds.length===0&&this._hasMoreDatasets&&await this._loadMoreDatasets(t)}_handleDatasetSearch(e){if(!this._shouldFetchDatasetList||this.datasetIds.length>0)return;let t=e.target,n=(e.detail?.string??``).trim();if(n===this._datasetSearchValue)return;this._datasetSearchValue=n,this._clearDatasetSearchTimer();let r=++this._datasetSearchRequestId;n?(t.retrieving=!0,this._datasetSearchDebounceTimer=window.setTimeout(async()=>{this._datasetSearchDebounceTimer=null;try{let e=await b.searchDatasets(n,{limit:Lo});r===this._datasetSearchRequestId&&(this._keepOnlySelectedSearchItem(),this._datasetSearchItems=[...this._datasetSearchItems,...e.data.filter(e=>!this._datasetSearchItems.some(t=>t.id===e.id))])}catch(e){console.warn(`Failed to search datasets:`,e)}finally{r===this._datasetSearchRequestId&&(t.retrieving=!1)}},Ro)):(this._keepOnlySelectedSearchItem(),t.retrieving=!1)}_handleDatasetPickerClosed(e){this._clearDatasetSearchTimer(),this._datasetSearchRequestId++,this._datasetSearchValue=``,e.target.retrieving=!1,this._keepOnlySelectedSearchItem()}_keepOnlySelectedSearchItem(){this._datasetSearchItems=this._datasetSearchItems.filter(e=>e.id===this._currentDatasetId)}_clearDatasetSearchTimer(){this._datasetSearchDebounceTimer!==null&&(clearTimeout(this._datasetSearchDebounceTimer),this._datasetSearchDebounceTimer=null)}_handleDatasetChange(e){let t=e.detail?.value?.[0];if(!t||t===this._currentDatasetId)return;let n=this._getUsedDatasetIds(),r=this._currentSlotsContents.some(e=>e.content.length>0),i=n.every(e=>this._areDatasetsLinked(e,t));if(r&&!i){if(this.constraintMode===`event-only`){this.dispatchEvent(new CustomEvent(`luzmo-dataset-constraint-triggered`,{bubbles:!0,composed:!0,detail:{previousDatasetId:this._currentDatasetId,newDatasetId:t,currentSlotsContents:structuredClone(this._currentSlotsContents),wouldClearSlots:!0}}));return}this._currentSlotsContents=[],this.slotsContents=[],this.dispatchEvent(new CustomEvent(`luzmo-slots-contents-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotsContents:[]}}))}this._currentDatasetId=t,this.dispatchEvent(new CustomEvent(`luzmo-dataset-changed`,{bubbles:!0,composed:!0,detail:{datasetId:t}}))}_getSlotContents(e){return this._currentSlotsContents?.find(t=>t.name===e)?.content??[]}_applySlotConstraints(e,t){let n=this.slotsConfiguration??this._slotsConfig,r=structuredClone(this._currentSlotsContents),i=structuredClone(this._currentSlotsContents),a=i.findIndex(t=>t.name===e);a===-1?i.push({name:e,content:t}):i[a].content=t;let o=[];for(let r of n){if(r.keepOnlyFirstWhenOtherSlotFilled?.includes(e)&&t.length>0){let t=i.findIndex(e=>e.name===r.name);t!==-1&&i[t].content.length>1&&(o.push({type:`keepOnlyFirstWhenOtherSlotFilled`,affectedSlotName:r.name,triggeredBySlotName:e}),i[t].content=[i[t].content[0]])}if(r.clearWhenOtherSlotHasMultipleItems?.includes(e)&&t.length>1){let t=i.findIndex(e=>e.name===r.name);t!==-1&&i[t].content.length>0&&(o.push({type:`clearWhenOtherSlotHasMultipleItems`,affectedSlotName:r.name,triggeredBySlotName:e}),i[t].content=[])}}if(this.constraintMode===`event-only`&&o.length>0){let n={triggerSlotName:e,proposedTriggerContents:t,originalSlotsContents:r,proposedSlotsContents:i,constraints:o};return this.dispatchEvent(new CustomEvent(`luzmo-slot-constraint-triggered`,{detail:n,bubbles:!0,composed:!0})),null}return i}_getTranslatedLabel(e){let t=(typeof e.label==`string`?e.label:e.label?x(e.label,this.language):void 0)??e.name;return Wi[t]?Wi[t]():t}_renderDatasetPicker(){if(!this.datasetPicker)return D;let e=this._availableDatasets,n=e.length>1,r=this.datasetIds.length>0,i=this._shouldFetchDatasetList;if(!n&&!r&&!i)return D;let a=this._datasetListPending||this.datasetIds.length>0&&this._datasetListItems.length===0&&this.datasetsDataFields.length===0&&!this._datasetNamesFetchAttempted,o=a?[]:e.map(e=>({value:e.id,label:x(e.name,this.contentLanguage)||e.id})),s=a?[]:this._currentDatasetId?[this._currentDatasetId]:[],c=t(a?`Loading datasets...`:`Select dataset...`);return T`
|
|
368
368
|
<div class="dataset-picker" part="dataset-picker">
|
|
369
369
|
<luzmo-field-label part="dataset-field-label" size=${this.size}>
|
|
370
|
-
${this.datasetPickerLabel??
|
|
370
|
+
${this.datasetPickerLabel??t(`Dataset`)}
|
|
371
371
|
</luzmo-field-label>
|
|
372
372
|
<luzmo-select
|
|
373
373
|
selects="single"
|
|
374
374
|
variant="highlight"
|
|
375
|
-
search=${
|
|
375
|
+
search=${E(this.datasetSearch)}
|
|
376
376
|
placement=${this.placement}
|
|
377
377
|
.size=${this.size}
|
|
378
378
|
.options=${o}
|
|
@@ -382,48 +382,50 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
382
382
|
@change=${this._handleDatasetChange}
|
|
383
383
|
@luzmo-opened=${this._handlePickerOpened}
|
|
384
384
|
@luzmo-scrolled=${this._handlePickerScrolled}
|
|
385
|
+
@luzmo-search=${this._handleDatasetSearch}
|
|
386
|
+
@luzmo-closed=${this._handleDatasetPickerClosed}
|
|
385
387
|
></luzmo-select>
|
|
386
388
|
</div>
|
|
387
|
-
`}_renderSlot(e){let t=this._getSlotContents(e.name),n=this._createSlotChangeHandler(e.name),r=this._getTranslatedLabel(e);return
|
|
389
|
+
`}_renderSlot(e){let t=this._getSlotContents(e.name),n=this._createSlotChangeHandler(e.name),r=this._getTranslatedLabel(e);return T`
|
|
388
390
|
<div class="slot-container" part="slot-container">
|
|
389
391
|
<luzmo-field-label part="field-label" size=${this.size}>
|
|
390
392
|
${r}
|
|
391
393
|
</luzmo-field-label>
|
|
392
394
|
<luzmo-item-slot-picker
|
|
393
395
|
part="item-slot-picker"
|
|
394
|
-
item-type=${
|
|
396
|
+
item-type=${E(this.itemType)}
|
|
395
397
|
slot-name=${e.name}
|
|
396
398
|
language=${this.language}
|
|
397
399
|
content-language=${this.contentLanguage}
|
|
398
|
-
api-url=${
|
|
399
|
-
auth-key=${
|
|
400
|
-
auth-token=${
|
|
400
|
+
api-url=${E(this.apiUrl)}
|
|
401
|
+
auth-key=${E(this.authKey)}
|
|
402
|
+
auth-token=${E(this.authToken)}
|
|
401
403
|
size=${this.size}
|
|
402
404
|
selects=${this.selects}
|
|
403
|
-
search=${
|
|
404
|
-
icons=${
|
|
405
|
+
search=${E(this.dataFieldsSearch)}
|
|
406
|
+
icons=${E(this.icons)}
|
|
405
407
|
placement=${this.placement}
|
|
406
408
|
slot-menu-placement=${this.slotMenuPlacement}
|
|
407
409
|
slot-menu-mode=${this.slotMenuMode}
|
|
408
410
|
?grows=${this.grows}
|
|
409
|
-
aria-required=${e.isRequired?`true`:
|
|
411
|
+
aria-required=${e.isRequired?`true`:D}
|
|
410
412
|
.slotConfiguration=${e}
|
|
411
413
|
.slotContents=${t}
|
|
412
414
|
.datasetsDataFields=${this._currentDatasetsDataFields}
|
|
413
415
|
@luzmo-slot-contents-changed=${n}
|
|
414
416
|
></luzmo-item-slot-picker>
|
|
415
417
|
</div>
|
|
416
|
-
`}_renderSlots(e){let t=e.map(e=>this._renderSlot(e));return
|
|
418
|
+
`}_renderSlots(e){let t=e.map(e=>this._renderSlot(e));return T`
|
|
417
419
|
<div class="slots-panel" part="slots-panel">
|
|
418
420
|
${t}
|
|
419
421
|
</div>
|
|
420
|
-
`}_renderContent(e){return
|
|
422
|
+
`}_renderContent(e){return T`
|
|
421
423
|
<div class="container" part="container">
|
|
422
424
|
${this._renderDatasetPicker()}
|
|
423
425
|
${this._renderSlots(e)}
|
|
424
426
|
</div>
|
|
425
|
-
`}render(){return this.slotsConfiguration&&this.slotsConfiguration.length>0?this._renderContent(this.slotsConfiguration):this._loadSlotsConfig.render({pending:()=>
|
|
427
|
+
`}render(){return this.slotsConfiguration&&this.slotsConfiguration.length>0?this._renderContent(this.slotsConfiguration):this._loadSlotsConfig.render({pending:()=>T`
|
|
426
428
|
<p role="status">Loading...</p>
|
|
427
|
-
`,complete:e=>!e||e.length===0?
|
|
429
|
+
`,complete:e=>!e||e.length===0?T`<p>No slots configuration found for ${this.itemType}</p>`:this._renderContent(e),error:e=>T`
|
|
428
430
|
<div role="alert">Could not load slots configuration for '${this.itemType}': ${e}.</div>
|
|
429
|
-
`})}};
|
|
431
|
+
`})}};e([k()],$.prototype,`_datasetListItems`,void 0),e([k()],$.prototype,`_datasetSearchItems`,void 0),e([k()],$.prototype,`_datasetListRetrieving`,void 0),e([k()],$.prototype,`_datasetListPending`,void 0),e([k()],$.prototype,`_currentDatasetId`,void 0),e([k()],$.prototype,`_fetchedDatasetsDataFields`,void 0),e([O({type:String,reflect:!0,attribute:`item-type`})],$.prototype,`itemType`,void 0),e([O({type:String,attribute:`content-language`,reflect:!0})],$.prototype,`contentLanguage`,void 0),e([O({type:Array})],$.prototype,`slotsConfiguration`,void 0),e([O({type:Array})],$.prototype,`slotsContents`,void 0),e([O({type:String,reflect:!0})],$.prototype,`selects`,void 0),e([O({type:String,reflect:!0,attribute:`data-fields-search`})],$.prototype,`dataFieldsSearch`,void 0),e([O({type:String,reflect:!0,attribute:`dataset-search`})],$.prototype,`datasetSearch`,void 0),e([O({type:String,reflect:!0})],$.prototype,`icons`,void 0),e([O({type:Array,reflect:!1})],$.prototype,`datasetsDataFields`,void 0),e([O({type:Array,attribute:`dataset-ids`})],$.prototype,`datasetIds`,void 0),e([O({type:String,attribute:`selected-dataset-id`,reflect:!0})],$.prototype,`selectedDatasetId`,void 0),e([O({type:Boolean,attribute:`dataset-picker`,reflect:!0})],$.prototype,`datasetPicker`,void 0),e([O({type:String,attribute:`dataset-picker-label`})],$.prototype,`datasetPickerLabel`,void 0),e([O({type:String,attribute:`api-url`})],$.prototype,`apiUrl`,void 0),e([O({type:String,attribute:`auth-key`})],$.prototype,`authKey`,void 0),e([O({type:String,attribute:`auth-token`})],$.prototype,`authToken`,void 0),e([O({type:String,reflect:!0})],$.prototype,`placement`,void 0),e([O({type:String,reflect:!0,attribute:`slot-menu-placement`})],$.prototype,`slotMenuPlacement`,void 0),e([O({type:String,reflect:!0,attribute:`slot-menu-mode`})],$.prototype,`slotMenuMode`,void 0),e([O({type:String,reflect:!0,attribute:`constraint-mode`})],$.prototype,`constraintMode`,void 0),e([O({type:Boolean,reflect:!0})],$.prototype,`grows`,void 0),e([k()],$.prototype,`_currentSlotsContents`,void 0),$=e([r()],$);var zo=/* @__PURE__ */ oe({LuzmoItemSlotPickerPanel:()=>$});customElements.get(`luzmo-item-slot-picker-panel`)||customElements.define(`luzmo-item-slot-picker-panel`,$);export{$ as LuzmoItemSlotPickerPanel,Nn as _,Bi as a,oe as b,Ri as c,Ai as d,Oi as f,Fn as g,Pn as h,zi as i,Mi as l,Rn as m,Hi as n,H as o,zn as p,Ui as r,Li as s,zo as t,ji as u,Mn as v,de as y};
|