@luzmo/analytics-components-kit 1.0.9-beta.4 → 1.0.9-beta.6

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.
Files changed (53) hide show
  1. package/README.md +1 -1
  2. package/package.json +2 -2
  3. package/react/package.json +2 -2
  4. package/standalone/chunks/base-CR5wZnQk.js +2 -0
  5. package/standalone/chunks/display-settings-binning-D3wYG0p7.js +38 -0
  6. package/standalone/chunks/display-settings-datetime-D37ERF0v.js +199 -0
  7. package/standalone/chunks/display-settings-grand-totals-CKm9PkBj.js +26 -0
  8. package/standalone/chunks/display-settings-numeric-f9Mdphm-.js +172 -0
  9. package/standalone/chunks/{display-settings-period-over-period-Bwjoji3a.js → display-settings-period-over-period-Cl-vLKk3.js} +1 -1
  10. package/standalone/chunks/{embed-c581fYN4.js → embed-B3y_k1ri.js} +1 -1
  11. package/standalone/chunks/{filters-XL4xRKOk.js → filters-CIOtenxx.js} +1 -1
  12. package/standalone/chunks/{formula-codemirror-BAlhe79s.js → formula-codemirror-BXh_3Te_.js} +1 -1
  13. package/standalone/chunks/item-option-action-button-group-DdbUGL3Q.js +35 -0
  14. package/standalone/chunks/item-option-base-CJwisW9b.js +38 -0
  15. package/standalone/chunks/item-option-color-palette-picker-CIM_beO6.js +22 -0
  16. package/standalone/chunks/{item-option-color-picker-59il-pkm.js → item-option-color-picker-CFeaAV1o.js} +1 -1
  17. package/standalone/chunks/item-option-color-range-DlZPq0gW.js +80 -0
  18. package/standalone/chunks/item-option-guidelines-DTTp08iA.js +117 -0
  19. package/standalone/chunks/{item-option-multi-language-field-BNn4WFUG.js → item-option-multi-language-field-DPrary5L.js} +1 -1
  20. package/standalone/chunks/{item-option-number-field-_lCPA_qC.js → item-option-number-field-DqTWCfQm.js} +1 -1
  21. package/standalone/chunks/{item-option-panel-s1ZKzAZ9.js → item-option-panel-PNWjgMMu.js} +2 -2
  22. package/standalone/chunks/{item-option-picker-CeK7QDTm.js → item-option-picker-dpSAYz4b.js} +1 -1
  23. package/standalone/chunks/item-option-position-picker-CHSKJ29N.js +14 -0
  24. package/standalone/chunks/item-option-positions-number-field-DaUTQCTD.js +31 -0
  25. package/standalone/chunks/{item-option-radio-button-group-DR7gdaTr.js → item-option-radio-button-group-cy5Lc7Yg.js} +1 -1
  26. package/standalone/chunks/item-option-slider-CA-mF5rp.js +15 -0
  27. package/standalone/chunks/{item-option-switch-DJfnhpf_.js → item-option-switch-Dp2L-Owv.js} +1 -1
  28. package/standalone/chunks/{item-option-text-field-DNqL7Evw.js → item-option-text-field-dmwmrTKe.js} +1 -1
  29. package/standalone/chunks/{item-slot-picker-panel-DsZvl6kA.js → item-slot-picker-panel-DRqvLkhG.js} +2 -2
  30. package/standalone/chunks/load-data-fields-for-datasets-D74yX8C2.js +25 -0
  31. package/standalone/chunks/{load-formula-codemirror-Cyqo4LoE.js → load-formula-codemirror-D1TsWHH6.js} +1 -1
  32. package/standalone/chunks/localized-mixin-j1gjzMSn.js +2 -0
  33. package/standalone/chunks/{luzmo-icon-markup-GqF25og5.js → luzmo-icon-markup-BENMHpB_.js} +1 -1
  34. package/standalone/chunks/task-BRrSUTFr.js +2 -0
  35. package/standalone/interactive-viz-item.js +1 -1
  36. package/standalone/item-grid.js +1 -1
  37. package/standalone/manifest.json +33 -33
  38. package/standalone/chunks/base-DOKoeL4P.js +0 -2
  39. package/standalone/chunks/display-settings-binning-CTWsdo0F.js +0 -38
  40. package/standalone/chunks/display-settings-datetime-CdxMI-9Q.js +0 -199
  41. package/standalone/chunks/display-settings-grand-totals-BCW8hefp.js +0 -26
  42. package/standalone/chunks/display-settings-numeric-CSaI0l55.js +0 -172
  43. package/standalone/chunks/item-option-action-button-group-B_XEkUcP.js +0 -35
  44. package/standalone/chunks/item-option-base-R8-N5_rE.js +0 -38
  45. package/standalone/chunks/item-option-color-palette-picker-CMZyo1NH.js +0 -22
  46. package/standalone/chunks/item-option-color-range-BWaElfwS.js +0 -80
  47. package/standalone/chunks/item-option-guidelines-BzvrNruz.js +0 -117
  48. package/standalone/chunks/item-option-position-picker-BAWZpDBA.js +0 -14
  49. package/standalone/chunks/item-option-positions-number-field-BmEtttZL.js +0 -31
  50. package/standalone/chunks/item-option-slider-C_jierlR.js +0 -15
  51. package/standalone/chunks/load-data-fields-for-datasets-_VJWUFPO.js +0 -25
  52. package/standalone/chunks/localized-mixin-BEfBwOPN.js +0 -2
  53. package/standalone/chunks/task-C3c3OWyi.js +0 -2
@@ -1,5 +1,5 @@
1
1
 
2
- import{_ as e,a as t,b as n,c as r,d as i,g as a,h as o,i as s,l as c,m as l,n as u,p as d,s as f,t as p,u as m,v as h,y as g}from"./load-formula-codemirror-Cyqo4LoE.js";import{n as _,t as v}from"./localized-mixin-BEfBwOPN.js";import{n as y}from"./lit-localize-CIGP-NUw.js";import{t as ee}from"./localized-decorator-Buib6Rq1.js";import{n as te,t as ne}from"./luzmoCog-C4v4vc5N.js";import{t as re}from"./luzmoTrashOutline-DXZpJx7f.js";import{i as ie,r as ae,t as oe}from"./calculate-data-field-icon-CrEVAfzJ.js";import{t as se}from"./luzmoPlus-Dyrrz0v8.js";import{t as b}from"./luzmo-icon-markup-GqF25og5.js";import{n as x,r as S,t as ce}from"./base-DOKoeL4P.js";import{t as le}from"./task-C3c3OWyi.js";import{n as C,s as ue}from"./type-check-CC6bgirK.js";import{t as de}from"./formatter-LzhH-XSQ.js";import{t as fe}from"./default-local-formats-CES1ItiK.js";import{t as w}from"./localize-BXHWaHdZ.js";import{t as T}from"./period-over-period-condition.const-AC_onvUf.js";import{t as E}from"./data-broker-CbKNAOhf.js";import{t as pe}from"./load-data-fields-for-datasets-_VJWUFPO.js";import{AsyncDirective as me,directive as he,guard as ge,html as D,ifDefined as O,nothing as k,property as A,query as _e,queryAll as ve,state as j,unsafeCSS as M}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.3.0-beta.0/standalone/lit.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.3.0-beta.0/standalone/action-button.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.3.0-beta.0/standalone/field-label.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.3.0-beta.0/standalone/icon.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.3.0-beta.0/standalone/overlay.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.3.0-beta.0/standalone/progress-circle.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.3.0-beta.0/standalone/tooltip.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.3.0-beta.0/standalone/select.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.3.0-beta.0/standalone/divider.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.3.0-beta.0/standalone/text-field.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.3.0-beta.0/standalone/multi-language-field.js";var ye={"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-DfHq9lB8.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`),"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`)},be=e=>`${e.replaceAll(/-([a-z])/g,(e,t)=>t.toUpperCase())}SlotsConfig`,xe=async e=>{try{let t=ye[e];return t?(await t())[be(e)]??null:null}catch{return null}},Se=e=>e?xe(e):Promise.resolve(null),Ce={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`},we={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`},Te=/^(?:[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 Ee(e){return typeof e==`string`&&Te.test(e)}var De=new Set([`x-axis`,`y-axis`,`category`,`name`,`row`,`levels`]),Oe=new Set([`legend`,`color`,`column`]),ke=new Set([`measure`]),Ae={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 je(e){return e.type===`numeric`||e.type===`array[numeric]`?`numeric`:`dimension`}function Me(e){return Ae[e.slotName]||(ke.has(e.slotName)?`measure`:Oe.has(e.slotName)?`secondaryGroupBy`:De.has(e.slotName)?`mainGroupBy`:e.slotType===`numeric`?`measure`:e.slotType===`categorical`?`mainGroupBy`:e.slotType===`mixed`?e.contentKind===`numeric`?`measure`:`mainGroupBy`:`other`)}var Ne={Category:()=>y(`Category`,{desc:`Category slot label`}),Measure:()=>y(`Measure`,{desc:`Measure slot label`}),Measures:()=>y(`Measures`,{desc:`Measures slot label`}),Legend:()=>y(`Legend`,{desc:`Legend slot label`}),"Group by":()=>y(`Group by`,{desc:`Group by slot label`}),"Y-Axis":()=>y(`Y-Axis`,{desc:`Y-Axis slot label`}),"X-Axis":()=>y(`X-Axis`,{desc:`X-Axis slot label`}),Dimension:()=>y(`Dimension`,{desc:`Dimension slot label`}),Datetime:()=>y(`Datetime`,{desc:`Datetime slot label`}),"Slider metric":()=>y(`Slider metric`,{desc:`Slider metric slot label`}),Bins:()=>y(`Bins`,{desc:`Bins slot label`}),Circles:()=>y(`Circles`,{desc:`Circles slot label`}),Close:()=>y(`Close`,{desc:`Close slot label`}),Color:()=>y(`Color`,{desc:`Color slot label`}),Columns:()=>y(`Columns`,{desc:`Columns slot label`}),Coordinates:()=>y(`Coordinates`,{desc:`Coordinates slot label`}),Destination:()=>y(`Destination`,{desc:`Destination slot label`}),Evolution:()=>y(`Evolution`,{desc:`Evolution slot label`}),Geography:()=>y(`Geography`,{desc:`Geography slot label`}),High:()=>y(`High`,{desc:`High slot label`}),Identifier:()=>y(`Identifier`,{desc:`Identifier slot label`}),Levels:()=>y(`Levels`,{desc:`Levels slot label`}),Low:()=>y(`Low`,{desc:`Low slot label`}),Name:()=>y(`Name`,{id:`slot-label-name`,desc:`Name slot label`}),Open:()=>y(`Open`,{desc:`Open slot label`}),Order:()=>y(`Order`,{desc:`Order slot label`}),Route:()=>y(`Route`,{desc:`Route slot label`}),Rows:()=>y(`Rows`,{desc:`Rows slot label`}),Size:()=>y(`Size`,{desc:`Size slot label`}),Source:()=>y(`Source`,{desc:`Source slot label`}),Target:()=>y(`Target`,{desc:`Target slot label`}),Time:()=>y(`Time`,{id:`slot-label-time`,desc:`Time slot label`})},Pe=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 Fe(e){return e}var Ie=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 Pe(this.context,this.host,this.t,this.subscribe))}},Le=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=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()}},Re=class extends Event{constructor(e,t){super(`context-provider`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t}},ze=class extends Le{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=new Set;for(let[e,{consumerHost:n}]of this.subscriptions)t.has(e)||(t.add(e),n.dispatchEvent(new Pe(this.context,n,e,!0)));e.stopPropagation()},this.host=e,t.context===void 0?this.context=t:this.context=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 Re(this.context,this.host))}};function Be({context:e,subscribe:t}){return(n,r)=>{typeof r==`object`?r.addInitializer((function(){new Ie(this,{context:e,callback:e=>{n.set.call(this,e)},subscribe:t})})):n.constructor.addInitializer((n=>{new Ie(n,{context:e,callback:e=>{n[r]=e},subscribe:t})}))}}var Ve=[`datetime`,`hierarchy`,`numeric`,`spatial`,`array[datetime]`,`array[numeric]`,`array[hierarchy]`,`array[spatial]`],N=Fe(Symbol(`slot-store-context`)),He=Object.defineProperty,Ue=(e,t,n)=>t in e?He(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,We=(e,t,n)=>(Ue(e,typeof t==`symbol`?t:t+``,n),n),Ge=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},Ke=(e,t)=>{if(Object(t)!==t)throw TypeError(`Cannot use the "in" operator on this value`);return e.has(t)},P=(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)},qe=(e,t,n)=>(Ge(e,t,`access private method`),n);function Je(e,t){return Object.is(e,t)}var F=null,I=!1,L=1,R=Symbol(`SIGNAL`);function z(e){let t=F;return F=e,t}function Ye(){return F}function Xe(){return I}var Ze={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 Qe(e){if(I)throw Error(typeof ngDevMode<`u`&&ngDevMode?`Assertion error: signal read during notification phase`:``);if(F===null)return;F.consumerOnSignalRead(e);let t=F.nextProducerIndex++;if(V(F),t<F.producerNode.length&&F.producerNode[t]!==e&&ct(F)){let e=F.producerNode[t];B(e,F.producerIndexOfThis[t])}F.producerNode[t]!==e&&(F.producerNode[t]=e,F.producerIndexOfThis[t]=ct(F)?st(e,F,t):0),F.producerLastReadVersion[t]=e.version}function $e(){L++}function et(e){if(!(!e.dirty&&e.lastCleanEpoch===L)){if(!e.producerMustRecompute(e)&&!ot(e)){e.dirty=!1,e.lastCleanEpoch=L;return}e.producerRecomputeValue(e),e.dirty=!1,e.lastCleanEpoch=L}}function tt(e){if(e.liveConsumerNode===void 0)return;let t=I;I=!0;try{for(let t of e.liveConsumerNode)t.dirty||rt(t)}finally{I=t}}function nt(){return F?.consumerAllowSignalWrites!==!1}function rt(e){var t;e.dirty=!0,tt(e),(t=e.consumerMarkedDirty)==null||t.call(e.wrapper??e)}function it(e){return e&&(e.nextProducerIndex=0),z(e)}function at(e,t){if(z(t),!(!e||e.producerNode===void 0||e.producerIndexOfThis===void 0||e.producerLastReadVersion===void 0)){if(ct(e))for(let t=e.nextProducerIndex;t<e.producerNode.length;t++)B(e.producerNode[t],e.producerIndexOfThis[t]);for(;e.producerNode.length>e.nextProducerIndex;)e.producerNode.pop(),e.producerLastReadVersion.pop(),e.producerIndexOfThis.pop()}}function ot(e){V(e);for(let t=0;t<e.producerNode.length;t++){let n=e.producerNode[t],r=e.producerLastReadVersion[t];if(r!==n.version||(et(n),r!==n.version))return!0}return!1}function st(e,t,n){var r;if(lt(e),V(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]=st(e.producerNode[t],e,t)}return e.liveConsumerIndexOfThis.push(n),e.liveConsumerNode.push(t)-1}function B(e,t){var n;if(lt(e),V(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++)B(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];V(r),r.producerIndexOfThis[n]=t}}function ct(e){return e.consumerIsAlwaysLive||(e?.liveConsumerNode?.length??0)>0}function V(e){e.producerNode??=[],e.producerIndexOfThis??=[],e.producerLastReadVersion??=[]}function lt(e){e.liveConsumerNode??=[],e.liveConsumerIndexOfThis??=[]}function ut(e){if(et(e),Qe(e),e.value===mt)throw e.error;return e.value}function dt(e){let t=Object.create(ht);t.computation=e;let n=()=>ut(t);return n[R]=t,n}var ft=Symbol(`UNSET`),pt=Symbol(`COMPUTING`),mt=Symbol(`ERRORED`),ht={...Ze,value:ft,dirty:!0,error:null,equal:Je,producerMustRecompute(e){return e.value===ft||e.value===pt},producerRecomputeValue(e){if(e.value===pt)throw Error(`Detected cycle in computations.`);let t=e.value;e.value=pt;let n=it(e),r,i=!1;try{r=e.computation.call(e.wrapper),i=t!==ft&&t!==mt&&e.equal.call(e.wrapper,t,r)}catch(t){r=mt,e.error=t}finally{at(e,n)}if(i){e.value=t;return}e.value=r,e.version++}};function gt(){throw Error()}var _t=gt;function vt(){_t()}function yt(e){let t=Object.create(St);t.value=e;let n=()=>(Qe(t),t.value);return n[R]=t,n}function bt(){return Qe(this),this.value}function xt(e,t){nt()||vt(),e.equal.call(e.wrapper,e.value,t)||(e.value=t,Ct(e))}var St={...Ze,equal:Je,value:void 0};function Ct(e){e.version++,$e(),tt(e)}var H=Symbol(`node`),U;(e=>{var t,n,r,i;class a{constructor(r,i={}){P(this,n),We(this,t);let a=yt(r)[R];if(this[H]=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 bt.call(this[H])}set(t){if(!(0,e.isState)(this))throw TypeError(`Wrong receiver type for Signal.State.prototype.set`);if(Xe())throw Error(`Writes to signals not permitted during Watcher callback`);let n=this[H];xt(n,t)}}t=H,n=new WeakSet,e.isState=e=>typeof e==`object`&&Ke(n,e),e.State=a;class o{constructor(t,n){P(this,i),We(this,r);let a=dt(t)[R];if(a.consumerAllowSignalWrites=!0,this[H]=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 ut(this[H])}}r=H,i=new WeakSet,e.isComputed=e=>typeof e==`object`&&Ke(i,e),e.Computed=o,(t=>{var n,r,i,a;function o(e){let t,n=null;try{n=z(null),t=e()}finally{z(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[H].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[H].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[H].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[H].producerNode;return n?n.length>0:!1}t.hasSources=u;class d{constructor(e){P(this,r),P(this,i),We(this,n);let t=Object.create(Ze);t.wrapper=this,t.consumerMarkedDirty=e,t.consumerIsAlwaysLive=!0,t.consumerAllowSignalWrites=!1,t.producerNode=[],this[H]=t}watch(...t){if(!(0,e.isWatcher)(this))throw TypeError(`Called unwatch without Watcher receiver`);qe(this,i,a).call(this,t);let n=this[H];n.dirty=!1;let r=z(n);for(let e of t)Qe(e[H]);z(r)}unwatch(...t){if(!(0,e.isWatcher)(this))throw TypeError(`Called unwatch without Watcher receiver`);qe(this,i,a).call(this,t);let n=this[H];V(n);for(let e=n.producerNode.length-1;e>=0;e--)if(t.includes(n.producerNode[e].wrapper)){B(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];lt(r),r.liveConsumerIndexOfThis[t]=e}}}getPending(){if(!(0,e.isWatcher)(this))throw TypeError(`Called getPending without Watcher receiver`);return this[H].producerNode.filter(e=>e.dirty).map(e=>e.wrapper)}}n=H,r=new WeakSet,i=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=>Ke(r,e),t.Watcher=d;function f(){return Ye()?.wrapper}t.currentComputed=f,t.watched=Symbol(`watched`),t.unwatched=Symbol(`unwatched`)})(e.subtle||={})})(U||={});var wt=Symbol(`SignalWatcherBrand`),Tt=new FinalizationRegistry((({watcher:e,signal:t})=>{e.unwatch(t)})),Et=new WeakMap;function Dt(e){return!0===e[wt]?(console.warn(`SignalWatcher should not be applied to the same class more than once.`),e):class extends e{constructor(){super(...arguments),this._$St=new U.State(0),this._$Si=!1,this._$So=!0,this._$Sh=new Set}_$Sl(){if(this._$Su!==void 0)return;this._$Sv=new U.Computed((()=>{this._$St.get(),super.performUpdate()}));let e=this._$Su=new U.subtle.Watcher((function(){let e=Et.get(this);e!==void 0&&(!1===e._$Si&&e.requestUpdate(),this.watch())}));Et.set(e,this),Tt.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)}}}he(class extends me{_$Sl(){if(this._$Su!==void 0)return;this._$SW=new U.Computed((()=>this._$Sj?.get()));let e=this._$Su=new U.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(U.subtle.untrack((()=>this._$SW?.get())))}render(e){return U.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(),U.subtle.untrack((()=>this._$SW.get()))}disconnected(){this._$Sp()}reconnected(){this._$Sl()}}),U.State,U.Computed;var W=(e,t)=>new U.State(e,t),Ot=(e,t)=>new U.Computed(e,t),kt=class{constructor(){this.slotContents=W([]),this.slotsContents=W([]),this.periodOverPeriodUiType=W(null),this.periodOverPeriodAllowsPeriodsWithoutDatetimeColumn=W(!1),this.periodOverPeriodHidesPastValue=W(!1),this.linkedDataset=W([]),this._popEnabledChartTypes=[`area-chart`,`bar-chart`,`combination-chart`,`column-chart`,`line-chart`],this._popPeriodsWithoutDatetimeColumnItemTypes=[`kpi`],this._popWithoutPastValueItemTypes=[`kpi`],this.activeSlotContents=Ot(()=>this.slotContents.get()[this.activeIndex.get()]),this.activeIndex=W(0)}isArrayColumnType(e){return e.startsWith(`array[`)}setPeriodOverPeriodCondition(e,t){if(this.periodOverPeriodAllowsPeriodsWithoutDatetimeColumn.set(this._popPeriodsWithoutDatetimeColumnItemTypes.includes(e)),this.periodOverPeriodHidesPastValue.set(this._popWithoutPastValueItemTypes.includes(e)),!t?.periodOverPeriod?.newUi){this.periodOverPeriodUiType.set(this.oldConditionalLogic(e));return}this.periodOverPeriodUiType.set(this.getUiConditionToApply(t))}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?T.HasDatetimeColumnAndComparisonFilters:t&&!n?T.HasDatetimeColumnAndNoComparisonFilters:!t&&n?T.NoDatetimeColumnButComparisonFilters:T.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?T.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)}},At=e=>typeof e==`string`&&e.trim().length>0,jt=e=>!!(e&&At(e.formula)&&!e.formulaId&&!ue(e.formula)),Mt=e=>!!(e&&At(e.expression)&&!e.columnId&&!e.column&&!e.formulaId&&!e.formula),Nt=e=>Mt(e)?e?.expression:jt(e)?e?.formula:void 0,Pt=e=>e?.columnId??e?.formulaId??e?.column??e?.formula??e?.expression,G=(e,t)=>Mt(e)?!0:!e||!jt(e)?!1:Me({slotName:String(t.name??``),slotType:t.type,contentKind:je(e)})===`measure`,Ft=e=>{let t=jt(e);return D`<span class="calculation-label">
2
+ import{_ as e,a as t,b as n,c as r,d as i,g as a,h as o,i as s,l as c,m as l,n as u,p as d,s as f,t as p,u as m,v as h,y as g}from"./load-formula-codemirror-D1TsWHH6.js";import{n as _,t as v}from"./localized-mixin-j1gjzMSn.js";import{n as y}from"./lit-localize-CIGP-NUw.js";import{t as ee}from"./localized-decorator-Buib6Rq1.js";import{n as te,t as ne}from"./luzmoCog-C4v4vc5N.js";import{t as re}from"./luzmoTrashOutline-DXZpJx7f.js";import{i as ie,r as ae,t as oe}from"./calculate-data-field-icon-CrEVAfzJ.js";import{t as se}from"./luzmoPlus-Dyrrz0v8.js";import{t as b}from"./luzmo-icon-markup-BENMHpB_.js";import{n as x,r as S,t as ce}from"./base-CR5wZnQk.js";import{t as le}from"./task-BRrSUTFr.js";import{n as C,s as ue}from"./type-check-CC6bgirK.js";import{t as de}from"./formatter-LzhH-XSQ.js";import{t as fe}from"./default-local-formats-CES1ItiK.js";import{t as w}from"./localize-BXHWaHdZ.js";import{t as T}from"./period-over-period-condition.const-AC_onvUf.js";import{t as E}from"./data-broker-CbKNAOhf.js";import{t as pe}from"./load-data-fields-for-datasets-D74yX8C2.js";import{AsyncDirective as me,directive as he,guard as ge,html as D,ifDefined as O,nothing as k,property as A,query as _e,queryAll as ve,state as j,unsafeCSS as M}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/lit.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/action-button.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/field-label.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/icon.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/overlay.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/progress-circle.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/tooltip.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/select.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/divider.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/text-field.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/multi-language-field.js";var ye={"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-DfHq9lB8.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`),"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`)},be=e=>`${e.replaceAll(/-([a-z])/g,(e,t)=>t.toUpperCase())}SlotsConfig`,xe=async e=>{try{let t=ye[e];return t?(await t())[be(e)]??null:null}catch{return null}},Se=e=>e?xe(e):Promise.resolve(null),Ce={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`},we={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`},Te=/^(?:[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 Ee(e){return typeof e==`string`&&Te.test(e)}var De=new Set([`x-axis`,`y-axis`,`category`,`name`,`row`,`levels`]),Oe=new Set([`legend`,`color`,`column`]),ke=new Set([`measure`]),Ae={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 je(e){return e.type===`numeric`||e.type===`array[numeric]`?`numeric`:`dimension`}function Me(e){return Ae[e.slotName]||(ke.has(e.slotName)?`measure`:Oe.has(e.slotName)?`secondaryGroupBy`:De.has(e.slotName)?`mainGroupBy`:e.slotType===`numeric`?`measure`:e.slotType===`categorical`?`mainGroupBy`:e.slotType===`mixed`?e.contentKind===`numeric`?`measure`:`mainGroupBy`:`other`)}var Ne={Category:()=>y(`Category`,{desc:`Category slot label`}),Measure:()=>y(`Measure`,{desc:`Measure slot label`}),Measures:()=>y(`Measures`,{desc:`Measures slot label`}),Legend:()=>y(`Legend`,{desc:`Legend slot label`}),"Group by":()=>y(`Group by`,{desc:`Group by slot label`}),"Y-Axis":()=>y(`Y-Axis`,{desc:`Y-Axis slot label`}),"X-Axis":()=>y(`X-Axis`,{desc:`X-Axis slot label`}),Dimension:()=>y(`Dimension`,{desc:`Dimension slot label`}),Datetime:()=>y(`Datetime`,{desc:`Datetime slot label`}),"Slider metric":()=>y(`Slider metric`,{desc:`Slider metric slot label`}),Bins:()=>y(`Bins`,{desc:`Bins slot label`}),Circles:()=>y(`Circles`,{desc:`Circles slot label`}),Close:()=>y(`Close`,{desc:`Close slot label`}),Color:()=>y(`Color`,{desc:`Color slot label`}),Columns:()=>y(`Columns`,{desc:`Columns slot label`}),Coordinates:()=>y(`Coordinates`,{desc:`Coordinates slot label`}),Destination:()=>y(`Destination`,{desc:`Destination slot label`}),Evolution:()=>y(`Evolution`,{desc:`Evolution slot label`}),Geography:()=>y(`Geography`,{desc:`Geography slot label`}),High:()=>y(`High`,{desc:`High slot label`}),Identifier:()=>y(`Identifier`,{desc:`Identifier slot label`}),Levels:()=>y(`Levels`,{desc:`Levels slot label`}),Low:()=>y(`Low`,{desc:`Low slot label`}),Name:()=>y(`Name`,{id:`slot-label-name`,desc:`Name slot label`}),Open:()=>y(`Open`,{desc:`Open slot label`}),Order:()=>y(`Order`,{desc:`Order slot label`}),Route:()=>y(`Route`,{desc:`Route slot label`}),Rows:()=>y(`Rows`,{desc:`Rows slot label`}),Size:()=>y(`Size`,{desc:`Size slot label`}),Source:()=>y(`Source`,{desc:`Source slot label`}),Target:()=>y(`Target`,{desc:`Target slot label`}),Time:()=>y(`Time`,{id:`slot-label-time`,desc:`Time slot label`})},Pe=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 Fe(e){return e}var Ie=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 Pe(this.context,this.host,this.t,this.subscribe))}},Le=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=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()}},Re=class extends Event{constructor(e,t){super(`context-provider`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t}},ze=class extends Le{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=new Set;for(let[e,{consumerHost:n}]of this.subscriptions)t.has(e)||(t.add(e),n.dispatchEvent(new Pe(this.context,n,e,!0)));e.stopPropagation()},this.host=e,t.context===void 0?this.context=t:this.context=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 Re(this.context,this.host))}};function Be({context:e,subscribe:t}){return(n,r)=>{typeof r==`object`?r.addInitializer((function(){new Ie(this,{context:e,callback:e=>{n.set.call(this,e)},subscribe:t})})):n.constructor.addInitializer((n=>{new Ie(n,{context:e,callback:e=>{n[r]=e},subscribe:t})}))}}var Ve=[`datetime`,`hierarchy`,`numeric`,`spatial`,`array[datetime]`,`array[numeric]`,`array[hierarchy]`,`array[spatial]`],N=Fe(Symbol(`slot-store-context`)),He=Object.defineProperty,Ue=(e,t,n)=>t in e?He(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,We=(e,t,n)=>(Ue(e,typeof t==`symbol`?t:t+``,n),n),Ge=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},Ke=(e,t)=>{if(Object(t)!==t)throw TypeError(`Cannot use the "in" operator on this value`);return e.has(t)},P=(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)},qe=(e,t,n)=>(Ge(e,t,`access private method`),n);function Je(e,t){return Object.is(e,t)}var F=null,I=!1,L=1,R=Symbol(`SIGNAL`);function z(e){let t=F;return F=e,t}function Ye(){return F}function Xe(){return I}var Ze={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 Qe(e){if(I)throw Error(typeof ngDevMode<`u`&&ngDevMode?`Assertion error: signal read during notification phase`:``);if(F===null)return;F.consumerOnSignalRead(e);let t=F.nextProducerIndex++;if(V(F),t<F.producerNode.length&&F.producerNode[t]!==e&&ct(F)){let e=F.producerNode[t];B(e,F.producerIndexOfThis[t])}F.producerNode[t]!==e&&(F.producerNode[t]=e,F.producerIndexOfThis[t]=ct(F)?st(e,F,t):0),F.producerLastReadVersion[t]=e.version}function $e(){L++}function et(e){if(!(!e.dirty&&e.lastCleanEpoch===L)){if(!e.producerMustRecompute(e)&&!ot(e)){e.dirty=!1,e.lastCleanEpoch=L;return}e.producerRecomputeValue(e),e.dirty=!1,e.lastCleanEpoch=L}}function tt(e){if(e.liveConsumerNode===void 0)return;let t=I;I=!0;try{for(let t of e.liveConsumerNode)t.dirty||rt(t)}finally{I=t}}function nt(){return F?.consumerAllowSignalWrites!==!1}function rt(e){var t;e.dirty=!0,tt(e),(t=e.consumerMarkedDirty)==null||t.call(e.wrapper??e)}function it(e){return e&&(e.nextProducerIndex=0),z(e)}function at(e,t){if(z(t),!(!e||e.producerNode===void 0||e.producerIndexOfThis===void 0||e.producerLastReadVersion===void 0)){if(ct(e))for(let t=e.nextProducerIndex;t<e.producerNode.length;t++)B(e.producerNode[t],e.producerIndexOfThis[t]);for(;e.producerNode.length>e.nextProducerIndex;)e.producerNode.pop(),e.producerLastReadVersion.pop(),e.producerIndexOfThis.pop()}}function ot(e){V(e);for(let t=0;t<e.producerNode.length;t++){let n=e.producerNode[t],r=e.producerLastReadVersion[t];if(r!==n.version||(et(n),r!==n.version))return!0}return!1}function st(e,t,n){var r;if(lt(e),V(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]=st(e.producerNode[t],e,t)}return e.liveConsumerIndexOfThis.push(n),e.liveConsumerNode.push(t)-1}function B(e,t){var n;if(lt(e),V(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++)B(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];V(r),r.producerIndexOfThis[n]=t}}function ct(e){return e.consumerIsAlwaysLive||(e?.liveConsumerNode?.length??0)>0}function V(e){e.producerNode??=[],e.producerIndexOfThis??=[],e.producerLastReadVersion??=[]}function lt(e){e.liveConsumerNode??=[],e.liveConsumerIndexOfThis??=[]}function ut(e){if(et(e),Qe(e),e.value===mt)throw e.error;return e.value}function dt(e){let t=Object.create(ht);t.computation=e;let n=()=>ut(t);return n[R]=t,n}var ft=Symbol(`UNSET`),pt=Symbol(`COMPUTING`),mt=Symbol(`ERRORED`),ht={...Ze,value:ft,dirty:!0,error:null,equal:Je,producerMustRecompute(e){return e.value===ft||e.value===pt},producerRecomputeValue(e){if(e.value===pt)throw Error(`Detected cycle in computations.`);let t=e.value;e.value=pt;let n=it(e),r,i=!1;try{r=e.computation.call(e.wrapper),i=t!==ft&&t!==mt&&e.equal.call(e.wrapper,t,r)}catch(t){r=mt,e.error=t}finally{at(e,n)}if(i){e.value=t;return}e.value=r,e.version++}};function gt(){throw Error()}var _t=gt;function vt(){_t()}function yt(e){let t=Object.create(St);t.value=e;let n=()=>(Qe(t),t.value);return n[R]=t,n}function bt(){return Qe(this),this.value}function xt(e,t){nt()||vt(),e.equal.call(e.wrapper,e.value,t)||(e.value=t,Ct(e))}var St={...Ze,equal:Je,value:void 0};function Ct(e){e.version++,$e(),tt(e)}var H=Symbol(`node`),U;(e=>{var t,n,r,i;class a{constructor(r,i={}){P(this,n),We(this,t);let a=yt(r)[R];if(this[H]=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 bt.call(this[H])}set(t){if(!(0,e.isState)(this))throw TypeError(`Wrong receiver type for Signal.State.prototype.set`);if(Xe())throw Error(`Writes to signals not permitted during Watcher callback`);let n=this[H];xt(n,t)}}t=H,n=new WeakSet,e.isState=e=>typeof e==`object`&&Ke(n,e),e.State=a;class o{constructor(t,n){P(this,i),We(this,r);let a=dt(t)[R];if(a.consumerAllowSignalWrites=!0,this[H]=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 ut(this[H])}}r=H,i=new WeakSet,e.isComputed=e=>typeof e==`object`&&Ke(i,e),e.Computed=o,(t=>{var n,r,i,a;function o(e){let t,n=null;try{n=z(null),t=e()}finally{z(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[H].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[H].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[H].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[H].producerNode;return n?n.length>0:!1}t.hasSources=u;class d{constructor(e){P(this,r),P(this,i),We(this,n);let t=Object.create(Ze);t.wrapper=this,t.consumerMarkedDirty=e,t.consumerIsAlwaysLive=!0,t.consumerAllowSignalWrites=!1,t.producerNode=[],this[H]=t}watch(...t){if(!(0,e.isWatcher)(this))throw TypeError(`Called unwatch without Watcher receiver`);qe(this,i,a).call(this,t);let n=this[H];n.dirty=!1;let r=z(n);for(let e of t)Qe(e[H]);z(r)}unwatch(...t){if(!(0,e.isWatcher)(this))throw TypeError(`Called unwatch without Watcher receiver`);qe(this,i,a).call(this,t);let n=this[H];V(n);for(let e=n.producerNode.length-1;e>=0;e--)if(t.includes(n.producerNode[e].wrapper)){B(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];lt(r),r.liveConsumerIndexOfThis[t]=e}}}getPending(){if(!(0,e.isWatcher)(this))throw TypeError(`Called getPending without Watcher receiver`);return this[H].producerNode.filter(e=>e.dirty).map(e=>e.wrapper)}}n=H,r=new WeakSet,i=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=>Ke(r,e),t.Watcher=d;function f(){return Ye()?.wrapper}t.currentComputed=f,t.watched=Symbol(`watched`),t.unwatched=Symbol(`unwatched`)})(e.subtle||={})})(U||={});var wt=Symbol(`SignalWatcherBrand`),Tt=new FinalizationRegistry((({watcher:e,signal:t})=>{e.unwatch(t)})),Et=new WeakMap;function Dt(e){return!0===e[wt]?(console.warn(`SignalWatcher should not be applied to the same class more than once.`),e):class extends e{constructor(){super(...arguments),this._$St=new U.State(0),this._$Si=!1,this._$So=!0,this._$Sh=new Set}_$Sl(){if(this._$Su!==void 0)return;this._$Sv=new U.Computed((()=>{this._$St.get(),super.performUpdate()}));let e=this._$Su=new U.subtle.Watcher((function(){let e=Et.get(this);e!==void 0&&(!1===e._$Si&&e.requestUpdate(),this.watch())}));Et.set(e,this),Tt.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)}}}he(class extends me{_$Sl(){if(this._$Su!==void 0)return;this._$SW=new U.Computed((()=>this._$Sj?.get()));let e=this._$Su=new U.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(U.subtle.untrack((()=>this._$SW?.get())))}render(e){return U.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(),U.subtle.untrack((()=>this._$SW.get()))}disconnected(){this._$Sp()}reconnected(){this._$Sl()}}),U.State,U.Computed;var W=(e,t)=>new U.State(e,t),Ot=(e,t)=>new U.Computed(e,t),kt=class{constructor(){this.slotContents=W([]),this.slotsContents=W([]),this.periodOverPeriodUiType=W(null),this.periodOverPeriodAllowsPeriodsWithoutDatetimeColumn=W(!1),this.periodOverPeriodHidesPastValue=W(!1),this.linkedDataset=W([]),this._popEnabledChartTypes=[`area-chart`,`bar-chart`,`combination-chart`,`column-chart`,`line-chart`],this._popPeriodsWithoutDatetimeColumnItemTypes=[`kpi`],this._popWithoutPastValueItemTypes=[`kpi`],this.activeSlotContents=Ot(()=>this.slotContents.get()[this.activeIndex.get()]),this.activeIndex=W(0)}isArrayColumnType(e){return e.startsWith(`array[`)}setPeriodOverPeriodCondition(e,t){if(this.periodOverPeriodAllowsPeriodsWithoutDatetimeColumn.set(this._popPeriodsWithoutDatetimeColumnItemTypes.includes(e)),this.periodOverPeriodHidesPastValue.set(this._popWithoutPastValueItemTypes.includes(e)),!t?.periodOverPeriod?.newUi){this.periodOverPeriodUiType.set(this.oldConditionalLogic(e));return}this.periodOverPeriodUiType.set(this.getUiConditionToApply(t))}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?T.HasDatetimeColumnAndComparisonFilters:t&&!n?T.HasDatetimeColumnAndNoComparisonFilters:!t&&n?T.NoDatetimeColumnButComparisonFilters:T.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?T.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)}},At=e=>typeof e==`string`&&e.trim().length>0,jt=e=>!!(e&&At(e.formula)&&!e.formulaId&&!ue(e.formula)),Mt=e=>!!(e&&At(e.expression)&&!e.columnId&&!e.column&&!e.formulaId&&!e.formula),Nt=e=>Mt(e)?e?.expression:jt(e)?e?.formula:void 0,Pt=e=>e?.columnId??e?.formulaId??e?.column??e?.formula??e?.expression,G=(e,t)=>Mt(e)?!0:!e||!jt(e)?!1:Me({slotName:String(t.name??``),slotType:t.type,contentKind:je(e)})===`measure`,Ft=e=>{let t=jt(e);return D`<span class="calculation-label">
3
3
  <span class="calculation-label-icon" aria-hidden="true">${b(t?ae:ie)}</span>
4
4
  <span>${t?y(`Formula`,{desc:`Label for the formula type`}):y(`Expression`,{desc:`Label for the expression type`})}</span>
5
5
  </span>`},It=(e,t)=>{let n={type:e.type,datasetId:e.datasetId,set:e.datasetId};`columnId`in e&&!C(e.columnId)&&e.columnId!==``?(n.columnId=e.columnId,n.column=e.columnId):`formulaId`in e&&!C(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=fe.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,C(e.subtype)||(n.subtype=e.subtype),`lowestLevel`in e&&!C(e.lowestLevel)&&(n.lowestLevel=e.lowestLevel),C(e.format)||(n.format=e.format),C(a)||(n.level=a),C(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 Lt(){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 Rt(e){return`##AGGR-${e}##`}function zt(e,n){let{aggregationFunction:r,content:i,grouping:a,includedColumns:o,excludedColumns:s}=e??{},c=`${r}(${n[r]?.arity>0?i:``})`;switch(a){case t.GROUPFULL:return`GROUPFULL(${c})`;case t.GROUPINEX:return`GROUPINEX(${c}, [${o?.map(e=>`{${e}}`).join(`, `)||``}], [${s?.map(e=>`{${e}}`).join(`, `)||``}])`;default:return c}}function Bt(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 Vt(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);continue}if(t===`'`||t===`"`)i=t;else if(t===`(`)n++;else if(t===`)`){if(n===0){r=a;break}n--}}return r}function Ht(e){let t=e.match(m),n=t?.[0],r=t?.[1];return{includedColumns:n?.match(i)?.map(e=>e.slice(1,-1))??[],excludedColumns:r?.match(i)?.map(e=>e.slice(1,-1))??[]}}function Ut(e=`light`){return!e||e===`light`?[`#0E89E0`,`#F45000`,`#15BF49`,`#685AC2`,`#636363`]:[`#BDDCF9`,`#FFCFA1`,`#C1F3B7`,`#D7D7EF`,`#D7D7EF`]}function Wt(e){let t=Ut(`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 K=class extends v(x(S,{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=u(),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 p(),!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();return}if(this.datasetsDataFields.length>0){this._datasets=Wt(this.datasetsDataFields),this._store.datasets=this._datasets,this._store.refreshDecorations(),this._setLoading(!1),this._rebuildAutoCompletion();return}if(this.datasetIds.length>0){this._setLoading(!0);try{let e=await pe(this.datasetIds,{dataBrokerConfig:{apiUrl:this.apiUrl,authKey:this.authKey,authToken:this.authToken}});this._datasets=Wt(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){}};_([A({type:String})],K.prototype,`expression`,void 0),_([A({attribute:!1})],K.prototype,`datasetsDataFields`,void 0),_([A({type:Array,attribute:`dataset-ids`})],K.prototype,`datasetIds`,void 0),_([A({type:String,attribute:`api-url`})],K.prototype,`apiUrl`,void 0),_([A({type:String,attribute:`auth-key`})],K.prototype,`authKey`,void 0),_([A({type:String,attribute:`auth-token`})],K.prototype,`authToken`,void 0),_([A({type:Boolean,attribute:`show-aggregations`,reflect:!0})],K.prototype,`showAggregations`,void 0),_([A({type:String,attribute:`content-language`,reflect:!0})],K.prototype,`contentLanguage`,void 0),_([A({type:Boolean,attribute:`multi-stage-aggregation`})],K.prototype,`multiStageAggregation`,void 0),_([A({type:Boolean,attribute:`nested-aggregation`})],K.prototype,`nestedAggregation`,void 0),_([j()],K.prototype,`_datasets`,void 0),_([j()],K.prototype,`_codeMirrorLoaded`,void 0);function Gt(){let e=2026;return{"+":{type:`infix`,arity:2,label:()=>y(`Addition`,{desc:`Formula function label for addition`}),description:()=>y(`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:()=>y(`Difference`,{desc:`Formula function label for subtraction`}),description:()=>y(`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:()=>y(`Multiplication`,{desc:`Formula function label for multiplication`}),description:()=>y(`Multiplies two numeric values.`,{desc:`Formula function description for multiplication operator`}),example:()=>`⟨numeric⟩ Number of burritos * 2`,exampleHasIcons:!0},"/":{type:`infix`,arity:2,label:()=>y(`Division`,{desc:`Formula function label for division`}),description:()=>y(`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:()=>y(`Modulo`,{desc:`Formula function label for modulo`}),description:()=>y(`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:()=>y(`Greater than`,{desc:`Formula function label for greater than comparison`}),description:()=>y(`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:()=>y(`Less than`,{desc:`Formula function label for less than comparison`}),description:()=>y(`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:()=>y(`Greater than or equal`,{desc:`Formula function label for greater than or equal comparison`}),description:()=>y(`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:()=>y(`Less than or equal`,{desc:`Formula function label for less than or equal comparison`}),description:()=>y(`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:()=>y(`Equal`,{desc:`Formula function label for equality comparison`}),description:()=>y(`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:()=>y(`Not equal`,{desc:`Formula function label for inequality comparison`}),description:()=>y(`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:()=>y(`Absolute value`,{desc:`Formula function label for ABS`}),description:()=>y(`Returns the absolute value of a number.`,{desc:`Formula function description for ABS`}),example:()=>`ABS(-5.0)`},CEIL:{type:`prefix`,arity:1,label:()=>y(`Round up`,{desc:`Formula function label for CEIL`}),description:()=>y(`Rounds a number up to the nearest integer.`,{desc:`Formula function description for CEIL`}),example:()=>`CEIL(11.3)`},E:{type:`prefix`,arity:0,label:()=>y(`Euler's number`,{desc:`Formula function label for E`}),description:()=>y(`Returns Euler's constant e.`,{desc:`Formula function description for E`}),example:()=>`E()`},EXP:{type:`prefix`,arity:1,label:()=>y(`Exponential`,{desc:`Formula function label for EXP`}),description:()=>y(`Returns e raised to the specified power.`,{desc:`Formula function description for EXP`}),example:()=>`EXP(11.3)`},FLOOR:{type:`prefix`,arity:1,label:()=>y(`Round down`,{desc:`Formula function label for FLOOR`}),description:()=>y(`Rounds a number down to the nearest integer.`,{desc:`Formula function description for FLOOR`}),example:()=>`FLOOR(11.7)`},LN:{type:`prefix`,arity:1,label:()=>y(`Natural logarithm`,{desc:`Formula function label for LN`}),description:()=>y(`Returns the natural logarithm of a number.`,{desc:`Formula function description for LN`}),example:()=>`LN(11.7)`},LOG:{type:`prefix`,arity:2,label:()=>y(`Logarithm`,{desc:`Formula function label for LOG`}),description:()=>y(`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:()=>y(`Pi`,{desc:`Formula function label for PI`}),description:()=>y(`Returns the mathematical constant pi.`,{desc:`Formula function description for PI`}),example:()=>`PI()`},POW:{type:`prefix`,arity:2,label:()=>y(`Power`,{desc:`Formula function label for POW`}),description:()=>y(`Raises a number to a given power.`,{desc:`Formula function description for POW`}),example:()=>`POW(2.35, 2)`},RAND:{type:`prefix`,arity:0,label:()=>y(`Random number`,{desc:`Formula function label for RAND`}),description:()=>y(`Returns a random number between 0 and 1.`,{desc:`Formula function description for RAND`}),example:()=>`RAND()`},ROUND:{type:`prefix`,arity:2,label:()=>y(`Round`,{desc:`Formula function label for ROUND`}),description:()=>y(`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:()=>y(`Square root`,{desc:`Formula function label for SQRT`}),description:()=>y(`Returns the square root of a number.`,{desc:`Formula function description for SQRT`}),example:()=>`SQRT(4)`},CAST:{type:`prefix`,arity:2,label:()=>y(`Convert value`,{desc:`Formula function label for CAST`}),description:()=>y(`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:()=>y(`If`,{desc:`Formula function label for IF`}),description:()=>y(`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:()=>y(`Is empty`,{desc:`Formula function label for COALESCE`}),description:()=>y(`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:()=>y(`Logical and`,{desc:`Formula function label for AND`}),description:()=>y(`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:()=>y(`Logical or`,{desc:`Formula function label for OR`}),description:()=>y(`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:()=>y(`Logical not`,{desc:`Formula function label for NOT`}),description:()=>y(`Negates a boolean condition.`,{desc:`Formula function description for NOT`}),example:()=>`NOT (Burrito type = 'Salty')`},SIN:{type:`prefix`,arity:1,label:()=>y(`Sine`,{desc:`Formula function label for SIN`}),description:()=>y(`Returns the sine of an angle in radians.`,{desc:`Formula function description for SIN`}),example:()=>`SIN(3.14)`},COS:{type:`prefix`,arity:1,label:()=>y(`Cosine`,{desc:`Formula function label for COS`}),description:()=>y(`Returns the cosine of an angle in radians.`,{desc:`Formula function description for COS`}),example:()=>`COS(3.14)`},TAN:{type:`prefix`,arity:1,label:()=>y(`Tangent`,{desc:`Formula function label for TAN`}),description:()=>y(`Returns the tangent of an angle in radians.`,{desc:`Formula function description for TAN`}),example:()=>`TAN(3.14)`},ASIN:{type:`prefix`,arity:1,label:()=>y(`Arcsine`,{desc:`Formula function label for ASIN`}),description:()=>y(`Returns the arcsine of a number.`,{desc:`Formula function description for ASIN`}),example:()=>`ASIN(3.14)`},ACOS:{type:`prefix`,arity:1,label:()=>y(`Arccosine`,{desc:`Formula function label for ACOS`}),description:()=>y(`Returns the arccosine of a number.`,{desc:`Formula function description for ACOS`}),example:()=>`ACOS(3.14)`},ATAN:{type:`prefix`,arity:1,label:()=>y(`Arctangent`,{desc:`Formula function label for ATAN`}),description:()=>y(`Returns the arctangent of a number.`,{desc:`Formula function description for ATAN`}),example:()=>`ATAN(3.14)`},SINH:{type:`prefix`,arity:1,label:()=>y(`Hyperbolic sine`,{desc:`Formula function label for SINH`}),description:()=>y(`Returns the hyperbolic sine of a number.`,{desc:`Formula function description for SINH`}),example:()=>`SINH(3.14)`},COSH:{type:`prefix`,arity:1,label:()=>y(`Hyperbolic cosine`,{desc:`Formula function label for COSH`}),description:()=>y(`Returns the hyperbolic cosine of a number.`,{desc:`Formula function description for COSH`}),example:()=>`COSH(3.14)`},TANH:{type:`prefix`,arity:1,label:()=>y(`Hyperbolic tangent`,{desc:`Formula function label for TANH`}),description:()=>y(`Returns the hyperbolic tangent of a number.`,{desc:`Formula function description for TANH`}),example:()=>`TANH(3.14)`},MEAN:{type:`prefix`,arity:1,label:()=>y(`Mean`,{desc:`Formula function label for MEAN`}),description:()=>y(`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:()=>y(`Standard deviation`,{desc:`Aggregation label`}),description:()=>y(`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:()=>y(`Concatenate`,{desc:`Formula function label for concatenate operator`}),description:()=>y(`Concatenates two strings.`,{desc:`Formula function description for concatenate operator`}),example:()=>`'Tasty' || ' burrito'`},LENGTH:{type:`prefix`,arity:1,label:()=>y(`String length`,{desc:`Formula function label for LENGTH`}),description:()=>y(`Returns the number of characters in a string.`,{desc:`Formula function description for LENGTH`}),example:()=>`LENGTH('Burrito')`},LOWER:{type:`prefix`,arity:1,label:()=>y(`Lowercase`,{desc:`Formula function label for LOWER`}),description:()=>y(`Converts a string to lowercase.`,{desc:`Formula function description for LOWER`}),example:()=>`LOWER('BURRITO')`},UPPER:{type:`prefix`,arity:1,label:()=>y(`Uppercase`,{desc:`Formula function label for UPPER`}),description:()=>y(`Converts a string to uppercase.`,{desc:`Formula function description for UPPER`}),example:()=>`UPPER('burrito')`},LTRIM:{type:`prefix`,arity:1,label:()=>y(`Trim left`,{desc:`Formula function label for LTRIM`}),description:()=>y(`Removes leading spaces from a string.`,{desc:`Formula function description for LTRIM`}),example:()=>`LTRIM(' Burrito')`},RTRIM:{type:`prefix`,arity:1,label:()=>y(`Trim right`,{desc:`Formula function label for RTRIM`}),description:()=>y(`Removes trailing spaces from a string.`,{desc:`Formula function description for RTRIM`}),example:()=>`RTRIM('Burrito ')`},TRIM:{type:`prefix`,arity:1,label:()=>y(`Trim`,{desc:`Formula function label for TRIM`}),description:()=>y(`Removes leading and trailing spaces from a string.`,{desc:`Formula function description for TRIM`}),example:()=>`TRIM('Burrito ')`},REPLACE:{type:`prefix`,arity:3,label:()=>y(`Replace text`,{desc:`Formula function label for REPLACE`}),description:()=>y(`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:()=>y(`Find substring`,{desc:`Formula function label for STRPOS`}),description:()=>y(`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:()=>y(`Take substring`,{desc:`Formula function label for SUBSTR`}),description:()=>y(`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:()=>y(`Split part`,{desc:`Formula function label for SPLIT_PART`}),description:()=>y(`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:()=>y(`Current date and time`,{desc:`Formula function label for NOW`}),description:()=>y(`Returns the current date and time.`,{desc:`Formula function description for NOW`}),example:()=>`NOW()`},YEAR:{type:`prefix`,arity:1,label:()=>y(`Year`,{desc:`Time unit`}),description:()=>y(`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:()=>y(`Year (UTC)`,{desc:`Formula function label for YEAR_UTC`}),description:()=>y(`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:()=>y(`Quarter`,{desc:`Time unit`}),description:()=>y(`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:()=>y(`Quarter (UTC)`,{desc:`Formula function label for QUARTER_UTC`}),description:()=>y(`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:()=>y(`Month`,{desc:`Time unit`}),description:()=>y(`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:()=>y(`Month (UTC)`,{desc:`Formula function label for MONTH_UTC`}),description:()=>y(`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:()=>y(`Week`,{desc:`Time unit`}),description:()=>y(`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:()=>y(`Week (UTC)`,{desc:`Formula function label for WEEK_UTC`}),description:()=>y(`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:()=>y(`Day of month`,{desc:`Formula function label for DAY`}),description:()=>y(`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:()=>y(`Day of month (UTC)`,{desc:`Formula function label for DAY_UTC`}),description:()=>y(`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:()=>y(`Day of week`,{desc:`Formula function label for DAY_OF_WEEK`}),description:()=>y(`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:()=>y(`Day of week (UTC)`,{desc:`Formula function label for DAY_OF_WEEK_UTC`}),description:()=>y(`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:()=>y(`Day of year`,{desc:`Formula function label for DAY_OF_YEAR`}),description:()=>y(`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:()=>y(`Day of year (UTC)`,{desc:`Formula function label for DAY_OF_YEAR_UTC`}),description:()=>y(`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:()=>y(`Year of ISO week`,{desc:`Formula function label for YEAR_OF_WEEK`}),description:()=>y(`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:()=>y(`Year of ISO week (UTC)`,{desc:`Formula function label for YEAR_OF_WEEK_UTC`}),description:()=>y(`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:()=>y(`Hour`,{desc:`Time unit`}),description:()=>y(`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:()=>y(`Hour (UTC)`,{desc:`Formula function label for HOUR_UTC`}),description:()=>y(`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:()=>y(`Minute`,{desc:`Time unit`}),description:()=>y(`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:()=>y(`Minute (UTC)`,{desc:`Formula function label for MINUTE_UTC`}),description:()=>y(`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:()=>y(`Second`,{desc:`Time unit`}),description:()=>y(`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:()=>y(`Second (UTC)`,{desc:`Formula function label for SECOND_UTC`}),description:()=>y(`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:()=>y(`Add/subtract duration`,{desc:`Formula function label for DATE_ADD`}),description:()=>y(`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:()=>y(`Difference between dates`,{desc:`Formula function label for DATE_DIFF`}),description:()=>y(`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:()=>y(`Coordinates`,{id:`formula-function-label-coords`,desc:`Formula function label for COORDS`}),description:()=>y(`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 Kt=class extends EventTarget{constructor(...e){super(...e),this.functionDataMap=Gt(),this.aggregationFunctionDataMap=f(),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 n=Bt(e).match(r);if(!n)return e;let i=!!n[1],a=n.index??0,o=Vt(e,a+(i?n[1].length:n[0].length)-1+1),s=Vt(e,a+n[0].length);if(o===-1)return e;let c=e.slice(a+n[0].length,s),l=this.transformToAggregationWidgetSyntax(c),u={widgetId:Lt(),grouping:n[2]??t.GROUP,aggregationFunction:n[3],content:l};if(u.grouping===t.GROUPINEX){let{includedColumns:t,excludedColumns:n}=Ht(e.slice(s+1,o));u.includedColumns=t,u.excludedColumns=n}let d=Rt(u.widgetId),f=`${e.slice(0,a)}${d}${e.slice(o+1)}`;return this.addWidgets([u]),this.transformToAggregationWidgetSyntax(f)}transformToAggregationFunctionSyntax(e){let t=e.match(c);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(zt(a,this.aggregationFunctionDataMap)):``,s=`${e.slice(0,n)}${o}${e.slice(r+1)}`;return this.transformToAggregationFunctionSyntax(s)}},qt=`: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))}`,q=class extends K{constructor(...e){super(...e),this.display=`rich`,this._groupingDataMap=s()}static{this.styles=M(qt)}_createStore(){return new Kt}_shouldLoadInput(){return!1}_canEmitExpression(){return!1}_applyExternalExpression(){if(this.display===`text`){this._rootContent=``;return}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 D`<span class="formula-pills" part="formula">${this._renderPillNodes(this._rootContent)}</span>`}_renderPillNodes(e){let t=[],n=new RegExp(d.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 D`<span class="formula-operator">${e}</span>`}_renderColumnPill(e){let[t,n]=e.split(`:`),r=this._datasets.find(e=>e.id===t)?.columns.find(e=>e.columnId===n);if(this._store.loading&&!r){let e=y(`Loading column`,{desc:`Accessible label for a column pill whose label is still loading`});return D`<span class="column-pill-wrapper"
@@ -27,7 +27,7 @@ import{_ as e,a as t,b as n,c as r,d as i,g as a,h as o,i as s,l as c,m as l,n a
27
27
  </span>`}_renderTextFormula(){let e=this.expression??``,t=[],n=new RegExp(i.source,`g`),r=0,a;for(;(a=n.exec(e))!==null;){a.index>r&&t.push(e.slice(r,a.index));let[i,o]=a[1].split(`:`);t.push(this._renderColumnReference(i,o)),r=n.lastIndex}return r<e.length&&t.push(e.slice(r)),D`<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?w(r.name,this.contentLanguage):t,a=n?w(n.name,this.contentLanguage):``;return D`<span class="formula-text-column" part="formula-text-column" title=${a?`${a} · ${i}`:i}>
28
28
  <span class="formula-text-column-icon">${b(oe({type:r?.type??`hierarchy`},`s`))}</span>
29
29
  <span class="formula-text-column-name">${i}</span>
30
- </span>`}};_([A({type:String,reflect:!0})],q.prototype,`display`,void 0),q=_([ee()],q),customElements.get(`luzmo-formula`)||customElements.define(`luzmo-formula`,q);var Jt=`: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}.calculation-preview{align-items:flex-start}.calculation-preview luzmo-field-label{--luzmo-field-label-side-aligned-height:auto;--luzmo-field-label-min-height:auto;--luzmo-field-label-padding-block:0;--luzmo-field-label-line-height:1.5}.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{align-items:center;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-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:uppercase;--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-s);--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-5);--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-4);--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:calc(var(--luzmo-spacing-5) + 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:calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-2));--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)}`,J=class extends Dt(x(S,{validSizes:Object.values(ce)})){constructor(...e){super(...e),this._loadDisplaySettings=new le(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-Bwjoji3a.js`),this._settingsTypeLoaded.periodOverPeriod=!0),o.length>0&&!t&&(o.includes(`numeric`)&&!this._settingsTypeLoaded.numeric?(await import(`./display-settings-numeric-CSaI0l55.js`),this._settingsTypeLoaded.numeric=!0):o.includes(`datetime`)&&!this._settingsTypeLoaded.datetime&&i?(await import(`./display-settings-datetime-CdxMI-9Q.js`),this._settingsTypeLoaded.datetime=!0):o.includes(`binning`)&&!this._settingsTypeLoaded.binning?(await import(`./display-settings-binning-CTWsdo0F.js`),this._settingsTypeLoaded.binning=!0):o.includes(`grandTotals`)&&!this._settingsTypeLoaded.grandTotals&&(await import(`./display-settings-grand-totals-BCW8hefp.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[M(Jt)]}_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):{});return}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`,t=this.slotType!==`datetime`&&this._currentSlotContent.type===`datetime`&&this.areDatetimeOptionsEnabled;if(!(e||t))return k;let n=!this._currentSlotContent.datetimeDisplayMode||this._currentSlotContent.datetimeDisplayMode==="default",r=e?1234.56:n?new Date:1,i=de({...this._currentSlotContent,type:e?`numeric`:`datetime`},{locale:this.contentLanguage,level:this._currentSlotContent.level})(r);return D`<div class="settings-row example-container">
30
+ </span>`}};_([A({type:String,reflect:!0})],q.prototype,`display`,void 0),q=_([ee()],q),customElements.get(`luzmo-formula`)||customElements.define(`luzmo-formula`,q);var Jt=`: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}.calculation-preview{align-items:flex-start}.calculation-preview luzmo-field-label{--luzmo-field-label-side-aligned-height:auto;--luzmo-field-label-min-height:auto;--luzmo-field-label-padding-block:0;--luzmo-field-label-line-height:1.5}.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{align-items:center;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-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:uppercase;--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-s);--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-5);--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-4);--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:calc(var(--luzmo-spacing-5) + 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:calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-2));--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)}`,J=class extends Dt(x(S,{validSizes:Object.values(ce)})){constructor(...e){super(...e),this._loadDisplaySettings=new le(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-Cl-vLKk3.js`),this._settingsTypeLoaded.periodOverPeriod=!0),o.length>0&&!t&&(o.includes(`numeric`)&&!this._settingsTypeLoaded.numeric?(await import(`./display-settings-numeric-f9Mdphm-.js`),this._settingsTypeLoaded.numeric=!0):o.includes(`datetime`)&&!this._settingsTypeLoaded.datetime&&i?(await import(`./display-settings-datetime-D37ERF0v.js`),this._settingsTypeLoaded.datetime=!0):o.includes(`binning`)&&!this._settingsTypeLoaded.binning?(await import(`./display-settings-binning-D3wYG0p7.js`),this._settingsTypeLoaded.binning=!0):o.includes(`grandTotals`)&&!this._settingsTypeLoaded.grandTotals&&(await import(`./display-settings-grand-totals-CKm9PkBj.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[M(Jt)]}_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):{});return}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`,t=this.slotType!==`datetime`&&this._currentSlotContent.type===`datetime`&&this.areDatetimeOptionsEnabled;if(!(e||t))return k;let n=!this._currentSlotContent.datetimeDisplayMode||this._currentSlotContent.datetimeDisplayMode==="default",r=e?1234.56:n?new Date:1,i=de({...this._currentSlotContent,type:e?`numeric`:`datetime`},{locale:this.contentLanguage,level:this._currentSlotContent.level})(r);return D`<div class="settings-row example-container">
31
31
  <span class="example-label"
32
32
  >${y(`Example`,{desc:`Label for example`})}:</span
33
33
  >
@@ -0,0 +1,25 @@
1
+
2
+ import{n as e,t}from"./localized-mixin-j1gjzMSn.js";import{n}from"./lit-localize-CIGP-NUw.js";import{t as r}from"./localized-decorator-Buib6Rq1.js";import{r as i,t as a}from"./calculate-data-field-icon-CrEVAfzJ.js";import{c as o}from"./type-check-CC6bgirK.js";import{t as s}from"./localize-BXHWaHdZ.js";import{n as c}from"./periods.const-Cie50jR4.js";import{t as l}from"./data-broker-CbKNAOhf.js";import{html as u,property as d,unsafeCSS as f}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/lit.js";import{ElementSizes as p,LuzmoElement as m,SizedMixin as h}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/utils.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/select.js";var g=e=>!!(e&&Object.keys(e).length>0),_=(e,t,n={})=>{if(t.hidden===!0&&!n.includeHidden||!t.id||!t.type)return null;let r=g(t.name)?t.name:{en:`Untitled`},i={datasetId:e,columnId:t.id,type:t.type,name:r};return t.description&&g(t.description)&&(i.description=t.description),t.subtype&&(i.subtype=t.subtype),t.format&&(i.format=t.format),typeof t.lowestLevel==`number`&&(i.lowestLevel=t.lowestLevel),typeof t.highestLevel==`number`&&(i.highestLevel=t.highestLevel),typeof t.hierarchy_enabled==`boolean`&&(i.hierarchy_enabled=t.hierarchy_enabled),t.expression&&(i.expression=t.expression),Array.isArray(t.duration_levels)&&t.duration_levels.length>0&&(i.duration_levels=[...t.duration_levels]),t.duration_format&&(i.duration_format=t.duration_format),Array.isArray(t.hierarchyLevels)&&t.hierarchyLevels.length>0&&(i.hierarchyLevels=t.hierarchyLevels.map(({id:e,level:t,name:n})=>({id:e,level:t,name:n}))),t.currency?.id&&t.currency.symbol&&(i.currency={id:t.currency.id,name:t.currency.name,symbol:t.currency.symbol}),i},v=(e,t,n={})=>{if(t.hidden===!0&&!n.includeHidden||!t.id||!t.type)return null;let r=g(t.name)?t.name:{en:`Untitled`},i={datasetId:e,formulaId:t.id,type:t.type,name:r};return t.description&&g(t.description)&&(i.description=t.description),t.subtype&&(i.subtype=t.subtype),t.format&&(i.format=t.format),typeof t.lowestLevel==`number`&&(i.lowestLevel=t.lowestLevel),t.expression&&(i.expression=t.expression),Array.isArray(t.duration_levels)&&t.duration_levels.length>0&&(i.duration_levels=[...t.duration_levels]),t.duration_format&&(i.duration_format=t.duration_format),t.currency?.id&&t.currency.symbol&&(i.currency={id:t.currency.id,name:t.currency.name,symbol:t.currency.symbol}),i},y=(e,t={})=>{if(!e?.id)return[];let n=[];return Array.isArray(e.columns)&&e.columns.forEach(r=>{let i=_(e.id,r,t);i&&n.push(i)}),Array.isArray(e.formulas)&&e.formulas.forEach(r=>{let i=v(e.id,r,t);i&&n.push(i)}),n},b=(e,t={})=>e.map(e=>({id:e.id,name:e.name,description:e.description,dataFields:y(e,t)})),x=`:host{font-family:var(--luzmo-font-family)}luzmo-select{--luzmo-option-icon-width:var(--data-fields-select-option-icon-width);width:100%}:host{--data-fields-select-option-icon-width:calc(var(--luzmo-font-size) * 1.4)}:host([size=xxs]),:host([size=xs]),:host([size=s]){--data-fields-select-option-icon-width:calc(var(--luzmo-font-size-s) * 1.4)}:host([size=l]){--data-fields-select-option-icon-width:calc(var(--luzmo-font-size-l) * 1.4)}:host([size=xl]),:host([size=xxl]){--data-fields-select-option-icon-width:calc(var(--luzmo-font-size-xl) * 1.4)}`,S=`::level::`,C=(e,t)=>`${e}${S}${t}`,w=e=>{let t=e.indexOf(S);return t===-1?null:{columnId:e.slice(0,t),level:Number(e.slice(t+9))}},T=class extends t(h(m,{validSizes:Object.values(p)})){constructor(...e){super(...e),this.contentLanguage=`en`,this.icons=`menu-only`,this.levels=`on`,this.allowEmpty=!1,this.selects=`single`,this.value=[],this.retrieving=!1,this.invalid=!1,this.clearable=!1,this.pending=!1,this.disabled=!1,this.readonly=!1,this.quiet=!1,this.search=`auto`,this.placement=`bottom-start`,this.datasetsDataFields=[],this._dataFieldsSelected=[],this._lastEmittedValue=`[]`,this._pendingAutoSelectEvent=!1}static get styles(){return[f(x)]}_isAdHocFormula(e){return`formula`in e&&typeof e.formula==`string`}_sendChangeEvent(){let e=JSON.stringify(this.value);e!==this._lastEmittedValue&&(this._lastEmittedValue=e,this.dispatchEvent(new CustomEvent(`luzmo-data-fields-selected`,{bubbles:!0,composed:!0,cancelable:!0,detail:{dataFields:this._dataFieldsSelected}})))}_toDataFieldData(e,t,n=!1){return n?v(t,e,{includeHidden:!0}):_(t,e,{includeHidden:!0})}_toAdHocFormulaFieldData(e,t){return{datasetId:t,formula:e.formula,type:e.type,name:e.label??{en:`Ad-hoc formula`},subtype:e.subtype??void 0,format:e.format}}_findFormulaMatch(e,t,n){for(let r of e)if(this._isAdHocFormula(r)){if(r.formula===t)return this._toAdHocFormulaFieldData(r,n)}else if(r.id===t)return this._toDataFieldData(r,n,!0);return null}_resolveDataFieldFromValue(e,t){let n=w(e),r=n?n.columnId:e;for(let i of t){let t=i.columns??[],a=i.formulas??[],o=t.find(e=>e.id===r);if(o){let e=this._toDataFieldData(o,i.id,!1);if(e&&n&&(e.level=n.level,this._isExpandableHierarchy(o))){let t=o.hierarchyLevels?.find(e=>e.level===n.level);t&&(e.name=t.name)}return e}let s=this._findFormulaMatch(a,e,i.id);if(s)return s}return null}setDataField(e){if(this.disabled||this.readonly)return;let t=e?.detail?.value??[];this._dataFieldsSelected=[];for(let e of t){let t=this._resolveDataFieldFromValue(e,this.datasetsDataFields);t&&this._dataFieldsSelected.push(t)}this.value=t,this._sendChangeEvent()}_normalizeValueForLevels(e){if(this.levels!==`off`)return e;let t=[];for(let n of e){let e=w(n)?.columnId??n;t.includes(e)||t.push(e)}return t}_findDataFieldsInDatasetsDataFields(e){this._dataFieldsSelected=[];for(let t of e){let e=this._resolveDataFieldFromValue(t,this.datasetsDataFields);e&&this._dataFieldsSelected.push(e)}}_getAutoSelectValue(){for(let e of this.datasetsDataFields){if(e?.columns?.length>0){let t=e.columns[0];return this._isExpandableDatetime(t)?this._buildDatetimeChildren(t)[0]?.value??null:this._isExpandableHierarchy(t)?this._buildHierarchyChildren(t)[0]?.value??null:t.id}for(let t of e?.formulas??[])if(!this._isAdHocFormula(t))return t.id}return null}_autoSelectInitialDataField(){if(this.readonly||this.value.length>0||this.allowEmpty||this.retrieving)return;let e=this._getAutoSelectValue();e&&this._resolveDataFieldFromValue(e,this.datasetsDataFields)&&(this._pendingAutoSelectEvent=!0,this.value=[e])}willUpdate(e){if(super.willUpdate(e),(e.has(`value`)||e.has(`datasetsDataFields`)||e.has(`allowEmpty`)||e.has(`retrieving`)||e.has(`levels`)||e.has(`readonly`))&&this._autoSelectInitialDataField(),e.has(`value`)||e.has(`datasetsDataFields`)||e.has(`levels`)){if(e.has(`levels`)&&this.levels===`off`){let e=this._normalizeValueForLevels(this.value);JSON.stringify(e)!==JSON.stringify(this.value)&&(this._pendingAutoSelectEvent=!0,this.value=e)}this._findDataFieldsInDatasetsDataFields(this.value)}}updated(e){super.updated(e),this._pendingAutoSelectEvent&&e.has(`value`)&&this._dataFieldsSelected.length>0?(this._pendingAutoSelectEvent=!1,this._sendChangeEvent()):e.has(`value`)&&(this._lastEmittedValue=JSON.stringify(this.value))}_buildDatetimeChildren(e){let t=[],n=Math.min(Math.max(e.lowestLevel??1,1),c.length),r=Math.min(Math.max(e.highestLevel??1,1),c.length);for(let i=r;i<=n;i++)t.push({value:C(e.id,i),label:c[i-1]?.i18n()??``});return t}_buildHierarchyChildren(e){let t=[],n=e.hierarchyLevels??[];for(let r of n)r.level<1||t.push({value:C(e.id,r.level),label:s(r.name??{},this.contentLanguage)??``});return t}_isExpandableDatetime(e){let t=e.type;return this.levels!==`off`&&(t===`datetime`||t===`array[datetime]`)&&typeof e.lowestLevel==`number`}_isExpandableHierarchy(e){return this.levels!==`off`&&Array.isArray(e.hierarchyLevels)&&e.hierarchyLevels.length>2&&e.hierarchy_enabled===!0}render(){let e=[],t=this.icons!==`none`;for(let r of this.datasetsDataFields??[]){let o=r?.columns??[],c=r?.formulas??[];for(let n of o){let r={value:n.id,label:s(n?.name??{},this.contentLanguage)??``};t&&(r.icon=a(n,this.size)),this._isExpandableDatetime(n)?r.children=this._buildDatetimeChildren(n):this._isExpandableHierarchy(n)&&(r.children=this._buildHierarchyChildren(n)),e.push(r)}for(let r of c)if(this._isAdHocFormula(r)){let a=r.label?s(r.label,this.contentLanguage):n(`Ad-hoc formula`),o={value:r.formula,label:a??n(`Ad-hoc formula`)};t&&(o.icon=i),e.push(o)}else{let n={value:r.id,label:s(r?.name??{},this.contentLanguage)??``};t&&(n.icon=a(r,this.size)),e.push(n)}}let r=n(`Select...`),o=this.pending?``:this.label||this.placeholder||r,c=this.pending||this.value.length===0?[]:this.value,l=this.icons===`none`||this.icons===`menu-only`?`none`:void 0;return u`<luzmo-select
3
+ id="data-fields"
4
+ .size=${this.size}
5
+ .label=${o}
6
+ .pendingLabel=${this.label||this.placeholder||r}
7
+ .retrieving=${this.retrieving}
8
+ .icons=${l}
9
+ .selects=${this.selects}
10
+ .variant=${this.selects===`multiple`?`checkmarks`:`highlight`}
11
+ .placement=${this.placement}
12
+ .search=${this.search}
13
+ ?emphasized=${!this.quiet}
14
+ .quiet=${this.quiet}
15
+ no-wrap
16
+ ?invalid=${this.invalid}
17
+ ?clearable=${this.clearable&&this.allowEmpty}
18
+ ?pending=${this.pending}
19
+ ?disabled=${this.disabled}
20
+ .readonly=${this.readonly}
21
+ .options=${e}
22
+ .value=${c}
23
+ @change=${this.setDataField}
24
+ >
25
+ </luzmo-select>`}};e([d({type:String,attribute:`content-language`,reflect:!0})],T.prototype,`contentLanguage`,void 0),e([d({type:String,reflect:!0})],T.prototype,`label`,void 0),e([d({type:String,reflect:!0})],T.prototype,`icons`,void 0),e([d({type:String,reflect:!0})],T.prototype,`levels`,void 0),e([d({type:Boolean,attribute:`allow-empty`,reflect:!0})],T.prototype,`allowEmpty`,void 0),e([d({type:String,attribute:`placeholder`,reflect:!0})],T.prototype,`placeholder`,void 0),e([d({type:String,reflect:!0})],T.prototype,`selects`,void 0),e([d({type:Array,reflect:!0})],T.prototype,`value`,void 0),e([d({type:Boolean,attribute:`retrieving`,reflect:!0})],T.prototype,`retrieving`,void 0),e([d({type:Boolean,attribute:`invalid`,reflect:!0})],T.prototype,`invalid`,void 0),e([d({type:Boolean,attribute:`clearable`,reflect:!0})],T.prototype,`clearable`,void 0),e([d({type:Boolean,attribute:`pending`,reflect:!0})],T.prototype,`pending`,void 0),e([d({type:Boolean,attribute:`disabled`,reflect:!0})],T.prototype,`disabled`,void 0),e([d({type:Boolean,reflect:!0})],T.prototype,`readonly`,void 0),e([d({type:Boolean,reflect:!0})],T.prototype,`quiet`,void 0),e([d({type:String,attribute:`search`,reflect:!0})],T.prototype,`search`,void 0),e([d({type:String,reflect:!0})],T.prototype,`placement`,void 0),e([d({type:Array,reflect:!1})],T.prototype,`datasetsDataFields`,void 0),T=e([r()],T),customElements.get(`luzmo-data-fields-select`)||customElements.define(`luzmo-data-fields-select`,T);var E=async(e,t)=>{if(!Array.isArray(e)||e.length===0)throw Error(`At least one dataset ID is required`);let{valid:n,invalid:r}=o(e);if(r.length>0&&console.warn(`[loadDataFieldsForDatasets] Invalid dataset IDs provided (not valid UUIDs): ${r.join(`, `)}. These will be skipped.`),n.length===0)throw Error(`No valid dataset IDs provided. Dataset IDs must be valid UUIDs.`);let{dataBrokerConfig:i}=t;if(!i)throw Error(`dataBrokerConfig is required`);(!i.authKey||!i.authToken)&&console.warn(`Both authKey and authToken are missing in the DataBroker configuration. This only works for public datasets and should not be used for secured data.`),l.configure({...i,authKey:i.authKey??``,authToken:i.authToken??``});try{return b(await l.fetchDatasetsWithColumnsAndFormulas(n))}catch(e){throw e instanceof Error&&e.message.includes(`Authentication failed`)?Error(`Failed to load datasets: Authentication failed. Please verify your API credentials are correct.`,{cause:e}):e}};export{E as t};
@@ -3,4 +3,4 @@ import{n as e}from"./lit-localize-CIGP-NUw.js";import{t}from"./calculate-data-fi
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function h(e,t){return u(e)||d(e,t)||p(e,t)||m()}var g=a((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})),_=a((e=>{var t=e&&e.__assign||function(){return t=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},t.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=void 0;var n=g();function r(e){if(e!==void 0)return typeof e==`boolean`?{capture:e}:e}function i(e,n){return n==null?e:t(t({},e),{options:t(t({},r(n)),r(e.options))})}function a(e,t,r){var a=t.map(function(t){var a=i(t,r);return(0,n.bind)(e,a)});return function(){a.forEach(function(e){return e()})}}e.bindAll=a})),v=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=e.bind=void 0;var t=g();Object.defineProperty(e,"bind",{enumerable:!0,get:function(){return t.bind}});var n=_();Object.defineProperty(e,"bindAll",{enumerable:!0,get:function(){return n.bindAll}})}))();function y(e){"@babel/helpers - typeof";return y=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},y(e)}function ee(e,t){if(y(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(y(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function te(e){var t=ee(e,`string`);return y(t)==`symbol`?t:t+``}function b(e,t,n){return(t=te(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var x=2147483647,ne=`data-pdnd-honey-pot`;function re(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 ie(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?re(Object(n),!0).forEach(function(t){b(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var S=2,C=S/2;function ae(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function oe(e){return{x:e.x-C,y:e.y-C}}function se(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function ce(e){return{x:Math.min(e.x,window.innerWidth-S),y:Math.min(e.y,window.innerHeight-S)}}function w(e){var t=e.client,n=ce(se(oe(ae(t))));return DOMRect.fromRect({x:n.x,y:n.y,width:S,height:S})}function le(e){var t=e.clientRect;return{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`}}function ue(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 de(e){var t=e.initial,n=document.createElement(`div`);n.setAttribute(ne,`true`);var r=w({client:t});Object.assign(n.style,ie(ie({backgroundColor:`transparent`,position:`fixed`,padding:0,margin:0,boxSizing:`border-box`},le({clientRect:r})),{},{pointerEvents:`auto`,zIndex:x})),document.body.appendChild(n);var i=(0,v.bind)(window,{type:`pointermove`,listener:function(e){r=w({client:{x:e.clientX,y:e.clientY}}),Object.assign(n.style,le({clientRect:r}))},options:{capture:!0}});return function(e){var t=e.current;if(i(),ue({client:t,clientRect:r})){n.remove();return}function a(){o(),n.remove()}var o=(0,v.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 fe(){var e=null;function t(){return e=null,(0,v.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=de({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 pe(e){if(Array.isArray(e))return f(e)}function me(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function he(){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 T(e){return pe(e)||me(e)||p(e)||he()}function E(e){return e instanceof Element&&e.hasAttribute(`data-pdnd-honey-pot`)}function ge(e){var t=h(document.elementsFromPoint(e.x,e.y),2),n=t[0],r=t[1];return n?E(n)?r??null:n:null}function D(e){var t=null;return function(){if(!t){var n=[...arguments];t={result:e.apply(this,n)}}return t.result}}var _e=D(function(){return navigator.userAgent.includes(`Firefox`)}),O=D(function(){var e=navigator.userAgent;return e.includes(`AppleWebKit`)&&!e.includes(`Chrome`)}),k={isLeavingWindow:Symbol(`leaving`),isEnteringWindow:Symbol(`entering`)};function ve(e){var t=e.dragLeave;return O()?t.hasOwnProperty(k.isLeavingWindow):!1}(function(){if(typeof window>`u`||!O())return;function e(){return{enterCount:0,isOverWindow:!1}}var t=e();function n(){t=e()}(0,v.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[k.isEnteringWindow]=!0),t.isOverWindow=!0,t.enterCount++}},{type:`dragleave`,listener:function(e){t.enterCount--,t.isOverWindow&&t.enterCount===0&&(e[k.isLeavingWindow]=!0,t.isOverWindow=!1)}}],{capture:!0})})();function ye(e){return`nodeName`in e}function be(e){return ye(e)&&e.ownerDocument!==document}function xe(e){var t=e.dragLeave,n=t.type,r=t.relatedTarget;return n===`dragleave`?O()?ve({dragLeave:t}):r==null?!0:_e()?be(r):r instanceof HTMLIFrameElement:!1}function Se(e){var t=e.onDragEnd;return[{type:`pointermove`,listener:function(){var e=0;return function(){if(e<20){e++;return}t()}}()},{type:`pointerdown`,listener:t}]}function A(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 j=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()}),M=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 Ce(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}}),M.schedule(function(){a({eventName:`onDragStart`,payload:{source:t,location:o}})})},dragUpdate:function(e){var r=e.current;M.flush(),j.cancel(),a({eventName:`onDropTargetChange`,payload:{source:t,location:{initial:n,previous:i,current:r}}})},drag:function(e){var r=e.current;j(function(){M.flush(),a({eventName:`onDrag`,payload:{source:t,location:{initial:n,previous:i,current:r}}})})},drop:function(e){var r=e.current,o=e.updatedSourcePayload;M.flush(),j.cancel(),a({eventName:`onDrop`,payload:{source:o??t,location:{current:r,previous:i,initial:n}}})}}}var N={isActive:!1};function P(){return!N.isActive}function we(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function Te(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 Ee(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=e.dispatchEvent;if(!P())return;var a=De({event:t,dragType:n,getDropTargetsOver:r});N.isActive=!0;var o={current:a};F({event:t,current:a.dropTargets});var s=Ce({source:n.payload,dispatchEvent:i,initial:a});function c(e){var t=Te({current:o.current.dropTargets,next:e.dropTargets});o.current=e,t&&s.dragUpdate({current:o.current})}function l(e){var t=A(e),i=r({target:E(e.target)?ge({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(),F({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(){N.isActive=!1,f()}var f=(0,v.bindAll)(window,[{type:`dragover`,listener:function(e){l(e),s.drag({current:o.current})}},{type:`dragenter`,listener:l},{type:`dragleave`,listener:function(e){xe({dragLeave:e})&&(c({input:o.current.input,dropTargets:[]}),n.startedFrom===`external`&&u())}},{type:`drop`,listener:function(e){if(o.current={dropTargets:o.current.dropTargets,input:A(e)},!o.current.dropTargets.length){u();return}e.cancelable&&e.preventDefault(),F({event:e,current:o.current.dropTargets}),s.drop({current:o.current,updatedSourcePayload:n.type===`external`?n.getDropPayload(e):null}),d()}},{type:`dragend`,listener:function(e){o.current={dropTargets:o.current.dropTargets,input:A(e)},u()}}].concat(T(Se({onDragEnd:u}))),{capture:!0});s.start({nativeSetDragImage:we(t)})}function F(e){var t=e.event,n=e.current[0]?.dropEffect;n!=null&&t.dataTransfer&&(t.dataTransfer.dropEffect=n)}function De(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=A(t);return n.startedFrom===`external`?{input:i,dropTargets:[]}:{input:i,dropTargets:r({input:i,source:n.payload,target:t.target,event:t,current:[]})}}var I={canStart:P,start:Ee},L=new Map;function Oe(e){var t=e.typeKey,n=e.mount,r=L.get(t);if(r)return r.usageCount++,r;var i={typeKey:t,unmount:n(),usageCount:1};return L.set(t,i),i}function ke(e){var t=Oe(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),L.delete(e.typeKey))}}function R(){var e=[...arguments];return function(){e.forEach(function(e){return e()})}}function Ae(e,t){var n=t.attribute,r=t.value;return e.setAttribute(n,r),function(){return e.removeAttribute(n)}}function z(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?z(Object(n),!0).forEach(function(t){b(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function V(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=je(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 je(e,t){if(e){if(typeof e==`string`)return H(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)?H(e,t):void 0}}function H(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 U(e){return e.slice(0).reverse()}function Me(e){var t=e.typeKey,n=e.defaultDropEffect,r=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 R(Ae(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(T(u),[_])})}function l(e){var t=e.eventName,n=e.payload,i=V(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=new Set,a=V(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=V(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=U(o),u=U(s),d=[],f=0;f<l.length;f++){var p,m=l[f],h=u[f];if(h!=null){d.push(h);continue}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 U(d)}return{dropTargetForConsumers:s,getIsOver:f,dispatchEvent:d}}function Ne(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=Pe(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 Pe(e,t){if(e){if(typeof e==`string`)return W(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)?W(e,t):void 0}}function W(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 G(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 Fe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?G(Object(n),!0).forEach(function(t){b(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ie(){var e=new Set,t=null;function n(e){t&&(!e.canMonitor||e.canMonitor(t.canMonitorArgs))&&t.active.add(e)}function r(r){var i=Fe({},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:new Set};var o=Ne(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 Le(e){var t=e.typeKey,n=e.mount,r=e.dispatchEventToSource,i=e.onPostDispatch,a=e.defaultDropEffect,o=Ie(),s=Me({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;I.start({event:t,dragType:n,getDropTargetsOver:s.getIsOver,dispatchEvent:c})}function u(){function e(){return n({canStart:I.canStart,start:l})}return ke({typeKey:t,mount:e})}return{registerUsage:u,dropTarget:s.dropTargetForConsumers,monitor:o.monitorForConsumers}}var Re=D(function(){return navigator.userAgent.toLocaleLowerCase().includes(`android`)}),ze=`pdnd:android-fallback`,Be=`text/plain`,Ve=`application/vnd.pdnd`,K=new WeakMap;function He(e){return K.set(e.element,e),function(){K.delete(e.element)}}var q=fe(),J=Le({typeKey:`element`,defaultDropEffect:`move`,mount:function(e){return R(q.bindEvents(),(0,v.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&&K.has(e));if(!n)return null;let r=K.get(n);if(!r)return null;var i=A(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=h(c[s],2),u=l[0],d=l[1];t.dataTransfer.setData(u,d??``)}Re()&&!t.dataTransfer.types.includes(`text/plain`)&&!t.dataTransfer.types.includes(`text/uri-list`)&&t.dataTransfer.setData(Be,ze),t.dataTransfer.setData(Ve,``);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=K.get(i.source.element))==null||(n=t[r])==null||n.call(t,i)},onPostDispatch:q.getOnPostDispatch()}),Ue=J.dropTarget,Y=J.monitor;function We(e){return R(J.registerUsage(),He(e),Ae(e.element,{attribute:`draggable`,value:`true`}))}var X=o({draggable:()=>We,dropTargetForElements:()=>Ue,monitorForElements:()=>Y}),Ge=Symbol.for(`@luzmo/analytics-components-kit/drag/element-adapter`),Ke=globalThis,Z=Ke[Ge];Z===void 0&&(Z=X,Ke[Ge]=X);var{draggable:qe,dropTargetForElements:Je,monitorForElements:Ye}=Z;function Xe(e,n,i){return{icon:t({type:e?.type??`hierarchy`,subtype:e?.subtype,lowestLevel:e?.lowestLevel},`s`),label:e?r(e.name,n):i}}var Q=String.raw`[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}`,Ze=RegExp(`##EMPTYARG-(${Q})##|{(${Q}:${Q})}|##AGGR-(${Q})##`,`gm`),Qe=RegExp(`##EMPTYARG-(${Q})##|{(${Q}:${Q})}`,`gm`),$e=/((GROUPFULL|GROUPINEX)\()?(AVG|COUNT|COUNTD|COUNTR|MAX|MIN|SUM)\(/m,et=RegExp(`##AGGR-(${Q})##`,`m`),tt=/\[(.*?)\]/gm,nt=RegExp(`{(${Q}:${Q})}`,`gm`),rt=[`AVG`,`COUNT`,`COUNTD`,`COUNTR`,`MAX`,`MIN`,`SUM`];function it(){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 $=function(e){return e.GROUP=``,e.GROUPFULL=`GROUPFULL`,e.GROUPINEX=`GROUPINEX`,e}({}),at=[$.GROUP,$.GROUPFULL,$.GROUPINEX];function ot(){return{[$.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:s,color:`var(--luzmo-formula-grouping-color-grouped, #625df6)`},[$.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:c,color:`var(--luzmo-formula-grouping-color-full, #0ca789)`},[$.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:l,color:`var(--luzmo-formula-grouping-color-include-exclude, #f00f65)`}}}var st=n(()=>import(`./formula-codemirror-BAlhe79s.js`));async function ct(){await st.load()}function lt(){return st.isLoaded()}export{Y as _,$ as a,b,$e as c,nt as d,Qe as f,Je as g,qe as h,ot as i,et as l,Xe as m,lt as n,rt as o,Ze as p,at as r,it as s,ct as t,tt as u,O as v,l as x,x as y};
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 Pe(e,t){if(e){if(typeof e==`string`)return W(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)?W(e,t):void 0}}function W(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 G(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 Fe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?G(Object(n),!0).forEach(function(t){b(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ie(){var e=new Set,t=null;function n(e){t&&(!e.canMonitor||e.canMonitor(t.canMonitorArgs))&&t.active.add(e)}function r(r){var i=Fe({},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:new Set};var o=Ne(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 Le(e){var t=e.typeKey,n=e.mount,r=e.dispatchEventToSource,i=e.onPostDispatch,a=e.defaultDropEffect,o=Ie(),s=Me({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;I.start({event:t,dragType:n,getDropTargetsOver:s.getIsOver,dispatchEvent:c})}function u(){function e(){return n({canStart:I.canStart,start:l})}return ke({typeKey:t,mount:e})}return{registerUsage:u,dropTarget:s.dropTargetForConsumers,monitor:o.monitorForConsumers}}var Re=D(function(){return navigator.userAgent.toLocaleLowerCase().includes(`android`)}),ze=`pdnd:android-fallback`,Be=`text/plain`,Ve=`application/vnd.pdnd`,K=new WeakMap;function He(e){return K.set(e.element,e),function(){K.delete(e.element)}}var q=fe(),J=Le({typeKey:`element`,defaultDropEffect:`move`,mount:function(e){return R(q.bindEvents(),(0,v.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&&K.has(e));if(!n)return null;let r=K.get(n);if(!r)return null;var i=A(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=h(c[s],2),u=l[0],d=l[1];t.dataTransfer.setData(u,d??``)}Re()&&!t.dataTransfer.types.includes(`text/plain`)&&!t.dataTransfer.types.includes(`text/uri-list`)&&t.dataTransfer.setData(Be,ze),t.dataTransfer.setData(Ve,``);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=K.get(i.source.element))==null||(n=t[r])==null||n.call(t,i)},onPostDispatch:q.getOnPostDispatch()}),Ue=J.dropTarget,Y=J.monitor;function We(e){return R(J.registerUsage(),He(e),Ae(e.element,{attribute:`draggable`,value:`true`}))}var X=o({draggable:()=>We,dropTargetForElements:()=>Ue,monitorForElements:()=>Y}),Ge=Symbol.for(`@luzmo/analytics-components-kit/drag/element-adapter`),Ke=globalThis,Z=Ke[Ge];Z===void 0&&(Z=X,Ke[Ge]=X);var{draggable:qe,dropTargetForElements:Je,monitorForElements:Ye}=Z;function Xe(e,n,i){return{icon:t({type:e?.type??`hierarchy`,subtype:e?.subtype,lowestLevel:e?.lowestLevel},`s`),label:e?r(e.name,n):i}}var Q=String.raw`[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}`,Ze=RegExp(`##EMPTYARG-(${Q})##|{(${Q}:${Q})}|##AGGR-(${Q})##`,`gm`),Qe=RegExp(`##EMPTYARG-(${Q})##|{(${Q}:${Q})}`,`gm`),$e=/((GROUPFULL|GROUPINEX)\()?(AVG|COUNT|COUNTD|COUNTR|MAX|MIN|SUM)\(/m,et=RegExp(`##AGGR-(${Q})##`,`m`),tt=/\[(.*?)\]/gm,nt=RegExp(`{(${Q}:${Q})}`,`gm`),rt=[`AVG`,`COUNT`,`COUNTD`,`COUNTR`,`MAX`,`MIN`,`SUM`];function it(){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 $=function(e){return e.GROUP=``,e.GROUPFULL=`GROUPFULL`,e.GROUPINEX=`GROUPINEX`,e}({}),at=[$.GROUP,$.GROUPFULL,$.GROUPINEX];function ot(){return{[$.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:s,color:`var(--luzmo-formula-grouping-color-grouped, #625df6)`},[$.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:c,color:`var(--luzmo-formula-grouping-color-full, #0ca789)`},[$.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:l,color:`var(--luzmo-formula-grouping-color-include-exclude, #f00f65)`}}}var st=n(()=>import(`./formula-codemirror-BXh_3Te_.js`));async function ct(){await st.load()}function lt(){return st.isLoaded()}export{Y as _,$ as a,b,$e as c,nt as d,Qe as f,Je as g,qe as h,ot as i,et as l,Xe as m,lt as n,rt as o,Ze as p,at as r,it as s,ct as t,tt as u,O as v,l as x,x as y};
@@ -0,0 +1,2 @@
1
+
2
+ import{t as e}from"./lit-localize-CIGP-NUw.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/tokens.js";import{property as t}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/lit.js";var n=`:where(:root){--luzmo-font-color-hard:#000;--luzmo-background-color-alt-1:#fafafa;--luzmo-background-color-alt-2:#efefef;--luzmo-secondary-outline:#f0f3;--luzmo-color-informative:#1a77e9;--luzmo-color-informative-rgb:26, 119, 233;--luzmo-color-disabled:var(--luzmo-disabled-color)}:where(html.dark,html.dark-theme,.dark-theme){--luzmo-font-color-hard:#f8f9fa;--luzmo-background-color-alt-1:#2d2d32;--luzmo-background-color-alt-2:#313131;--luzmo-secondary-outline:#c8db0033;--luzmo-color-informative-rgb:26, 119, 233;--luzmo-color-disabled:var(--luzmo-disabled-color)}`;if(typeof document<`u`&&!document.querySelector(`style[data-luzmo-ack-vars]`)){let e=document.createElement(`style`);e.dataset.luzmoAckVars=``,e.textContent=n,document.head.append(e)}function r(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var i=(e,t,n)=>{let r=t.lastIndexOf(`?`),i=e[r===-1||r<t.lastIndexOf(`/`)?t:t.slice(0,r)];return i?typeof i==`function`?i():Promise.resolve(i):new Promise((e,r)=>{(typeof queueMicrotask==`function`?queueMicrotask:setTimeout)(r.bind(null,Error(`Unknown variable dynamic import: `+t+(t.split(`/`).length===n?``:`. Note that variables only represent file names one level deep.`))))})},a=`en`,o=[`de`,`es`,`fr`,`nl`],{getLocale:s,setLocale:c}=e({sourceLocale:a,targetLocales:o,loadLocale:e=>i(Object.assign({"../../generated/locales/de.ts":()=>import(`./de-ClGscYPh.js`),"../../generated/locales/es.ts":()=>import(`./es-C56MpCO9.js`),"../../generated/locales/fr.ts":()=>import(`./fr-BpNJieSH.js`),"../../generated/locales/nl.ts":()=>import(`./nl-BpTxEv-1.js`)}),`../../generated/locales/${e}.ts`,6)}),l=e=>{class n extends e{constructor(...e){super(...e),this.language=`en`}firstUpdated(e){super.firstUpdated(e),this._syncLocale()}willUpdate(e){super.willUpdate(e),e.has(`language`)&&this._syncLocale()}_syncLocale(){this.language!==s()&&(o.includes(this.language)||this.language===`en`)&&c(this.language)}}return r([t({type:String,reflect:!0})],n.prototype,`language`,void 0),n};export{r as n,l as t};
@@ -1,5 +1,5 @@
1
1
 
2
- import{svg as e}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.3.0-beta.0/standalone/lit.js";function t(t,{prefix:n,className:r,color:i}={}){return e`<svg
2
+ import{svg as e}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/lit.js";function t(t,{prefix:n,className:r,color:i}={}){return e`<svg
3
3
  aria-hidden="true"
4
4
  focusable="false"
5
5
  data-icon="${t.name}"
@@ -0,0 +1,2 @@
1
+
2
+ import{notEqual as e}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/lit.js";var t=Symbol(),n=class{get taskComplete(){return this.t||(this.i===1?this.t=new Promise(((e,t)=>{this.o=e,this.h=t})):this.i===3?this.t=Promise.reject(this.l):this.t=Promise.resolve(this.u)),this.t}constructor(e,t,n){this.p=0,this.i=0,(this._=e).addController(this);let i=typeof t==`object`?t:{task:t,args:n};this.v=i.task,this.j=i.args,this.m=i.argsEqual??r,this.k=i.onComplete,this.A=i.onError,this.autoRun=i.autoRun??!0,`initialValue`in i&&(this.u=i.initialValue,this.i=2,this.O=this.T?.())}hostUpdate(){!0===this.autoRun&&this.S()}hostUpdated(){this.autoRun===`afterUpdate`&&this.S()}T(){if(this.j===void 0)return;let e=this.j();if(!Array.isArray(e))throw Error(`The args function must return an array`);return e}async S(){let e=this.T(),t=this.O;this.O=e,e===t||e===void 0||t!==void 0&&this.m(t,e)||await this.run(e)}async run(e){let n,r;e??=this.T(),this.O=e,this.i===1?this.q?.abort():(this.t=void 0,this.o=void 0,this.h=void 0),this.i=1,this.autoRun===`afterUpdate`?queueMicrotask((()=>this._.requestUpdate())):this._.requestUpdate();let i=++this.p;this.q=new AbortController;let a=!1;try{n=await this.v(e,{signal:this.q.signal})}catch(e){a=!0,r=e}if(this.p===i){if(n===t)this.i=0;else{if(!1===a){try{this.k?.(n)}catch{}this.i=2,this.o?.(n)}else{try{this.A?.(r)}catch{}this.i=3,this.h?.(r)}this.u=n,this.l=r}this._.requestUpdate()}}abort(e){this.i===1&&this.q?.abort(e)}get value(){return this.u}get error(){return this.l}get status(){return this.i}render(e){switch(this.i){case 0:return e.initial?.();case 1:return e.pending?.();case 2:return e.complete?.(this.value);case 3:return e.error?.(this.error);default:throw Error(`Unexpected status: `+this.i)}}},r=(t,n)=>t===n||t.length===n.length&&t.every(((t,r)=>!e(t,n[r])));export{n as t};
@@ -19,7 +19,7 @@
19
19
  *
20
20
  */
21
21
 
22
- import{n as e,t}from"./chunks/localized-mixin-BEfBwOPN.js";import{n}from"./chunks/lit-localize-CIGP-NUw.js";import"./chunks/embed-c581fYN4.js";import{t as r}from"./chunks/luzmoAlignLeft-HA-XKPHy.js";import{n as i,r as a,t as o}from"./chunks/base-DOKoeL4P.js";import{t as s}from"./chunks/create-lazy-loader-DC0rJePE.js";import{html as c,nothing as l,property as u,state as d,unsafeCSS as f}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.3.0-beta.0/standalone/lit.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.3.0-beta.0/standalone/action-button.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.3.0-beta.0/standalone/action-group.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.3.0-beta.0/standalone/field-label.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.3.0-beta.0/standalone/icon.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.3.0-beta.0/standalone/number-field.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.3.0-beta.0/standalone/overlay.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.3.0-beta.0/standalone/picker.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.3.0-beta.0/standalone/popover.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.3.0-beta.0/standalone/progress-circle.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.3.0-beta.0/standalone/tabs.js";var p={icon:[32,32,`M16 0a16 16 0 1 0 16 16A16 16 0 0 0 16 0m0 7q1.4 0 1.5 1.5c0 2-3 2-3 0 0-1 .8-1.5 1.5-1.5m0 5q.9 0 1 1v10c0 1.3-2 1.3-2 0V13q.1-1 1-1`],name:`info-circle`},m={icon:[32,32,`M18.05 5.11a1.5 1.5 0 1 1 2.9.8l-.29 1.02a13.67 13.67 0 0 1-1.54 3.56 1 1 0 0 0 .85 1.52H28a2 2 0 0 1 1.07 3.7 1 1 0 0 0-.33 1.32 2 2 0 0 1-.82 2.76 1 1 0 0 0-.33 1.5 1.99 1.99 0 0 1-.96 3.12 1 1 0 0 0-.67 1.17A2 2 0 0 1 24 28h-5.6c-.98 0-1.94-.3-2.77-.84l-2.4-1.6a4.94 4.94 0 0 1-1.4-1.42 1 1 0 0 0-1.4-.29 1 1 0 0 0-.28 1.4c.5.76 1.17 1.43 1.96 1.97l2.4 1.6a6.98 6.98 0 0 0 3.89 1.18H24a4 4 0 0 0 4-4v-.04a4 4 0 0 0 1.7-5 4 4 0 0 0 1.13-4.13A4 4 0 0 0 28 10h-6.35c.39-.82.7-1.67.94-2.56l.29-1.02a3.51 3.51 0 0 0-6.76-1.85l-.28 1.03a8.5 8.5 0 0 1-3.64 4.93l-.2.13a6.53 6.53 0 0 0-1.84 1.76 1 1 0 0 0 .25 1.4 1 1 0 0 0 1.4-.25c.33-.49.76-.9 1.27-1.22l.2-.13c2.2-1.4 3.8-3.57 4.49-6.1ZM2 14.01h4v14H2Zm-2 0v14c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V14a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2z`],name:`thumbs-up`},h={icon:[32,32,`M18.05 26.89a1.5 1.5 0 1 0 2.9-.8l-.29-1.02a13.66 13.66 0 0 0-1.54-3.56 1 1 0 0 1 .85-1.52H28a2 2 0 0 0 1.07-3.69 1 1 0 0 1-.33-1.33 2 2 0 0 0-.82-2.76 1 1 0 0 1-.33-1.5 1.99 1.99 0 0 0-.96-3.12 1 1 0 0 1-.67-1.16A2 2 0 0 0 24 4h-5.6c-.98 0-1.94.3-2.77.84l-2.4 1.6c-.57.38-1.04.86-1.4 1.41a1 1 0 0 1-1.67-1.1 7.03 7.03 0 0 1 1.95-1.97l2.4-1.6A6.98 6.98 0 0 1 18.4 2H24a4 4 0 0 1 4 4v.04a4 4 0 0 1 1.7 5 3.99 3.99 0 0 1 1.13 4.13A3.99 3.99 0 0 1 28 22h-6.35c.39.81.7 1.66.94 2.55l.28 1.03a3.5 3.5 0 0 1-6.75 1.84l-.28-1.03a8.5 8.5 0 0 0-3.64-4.93l-.2-.13a6.52 6.52 0 0 1-1.84-1.76 1 1 0 0 1 .25-1.4 1 1 0 0 1 1.4.26c.33.48.76.9 1.27 1.22l.2.12c2.2 1.4 3.8 3.57 4.49 6.1zM2 21.99h4V8H2Zm-2 0V8c0-1.1.9-2 2-2h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2z`],name:`thumbs-down`},g=`:host{box-sizing:border-box;display:block;container-type:inline-size}.answer{width:100%;display:block}.chart-actions-bar{justify-content:space-between;align-items:center;gap:var(--luzmo-interactive-viz-item-actions-gap,var(--interactive-viz-item-actions-gap));padding-block:var(--luzmo-interactive-viz-item-actions-padding-block,var(--interactive-viz-item-actions-padding-block));flex-wrap:nowrap;margin-block-start:var(--luzmo-interactive-viz-item-actions-margin-block-start,var(--interactive-viz-item-actions-margin-block-start));display:flex}.chart-actions-primary{gap:var(--luzmo-interactive-viz-item-actions-gap,var(--interactive-viz-item-actions-gap));flex-wrap:wrap;flex:1;align-items:center;min-width:0;display:flex}.ranking-content{gap:var(--luzmo-spacing-3);padding:var(--luzmo-spacing-3);flex-direction:column;display:flex}.ranking-row{gap:var(--luzmo-spacing-3);align-items:center;display:flex}.ranking-number{width:4rem}.icon-flipped{transform:scaleY(-1)}.chart-container{border-radius:var(--luzmo-interactive-viz-item-chart-border-radius,var(--interactive-viz-item-chart-border-radius));height:var(--luzmo-interactive-viz-item-chart-height,var(--interactive-viz-item-chart-height));overflow:hidden}.chart-container luzmo-embed-viz-item{width:100%;height:100%;display:block}.feedback-row{padding-block:var(--luzmo-interactive-viz-item-feedback-padding-block,var(--interactive-viz-item-feedback-padding-block));justify-content:space-between;align-items:center;display:flex}.rating-btn-positive{--luzmo-action-button-content-color-default-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-content-color-hover-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-content-color-down-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-content-color-focus-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-background-color-default-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-hover-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-down-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-focus-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background))}.rating-btn-negative{--luzmo-action-button-content-color-default-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-content-color-hover-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-content-color-down-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-content-color-focus-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-background-color-default-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-hover-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-down-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-focus-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background))}.config-toggle{--luzmo-action-button-border-radius:32px;margin-inline-start:auto}.sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.config-panel{border:1px solid var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color));border-radius:var(--luzmo-interactive-viz-item-config-panel-border-radius,var(--interactive-viz-item-config-panel-border-radius));padding:var(--luzmo-interactive-viz-item-config-panel-padding,var(--interactive-viz-item-config-panel-padding));background:var(--luzmo-interactive-viz-item-config-panel-background,var(--interactive-viz-item-config-panel-background));margin-block-start:var(--luzmo-spacing-2)}.config-panel luzmo-tab-panel[selected]{padding-block-start:var(--luzmo-spacing-4);display:block}.config-panel luzmo-item-option-panel,.config-panel luzmo-item-slot-picker-panel,.config-panel luzmo-filters{width:100%;max-height:15rem;scrollbar-width:thin;scrollbar-color:var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color)) transparent;padding-inline-end:var(--luzmo-spacing-3);overflow-y:auto}.edit-grid{min-height:12.5rem;display:flex}.edit-column{gap:var(--luzmo-spacing-3);flex-direction:column;display:flex}.edit-column:first-child{flex-shrink:0;max-width:15rem}.edit-column-filters{border-inline-start:1px solid var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color));flex:1;min-width:18.75rem;padding-inline-start:var(--luzmo-spacing-5)}@container (width<=520px){.edit-grid{flex-direction:column}.edit-column,.edit-column:first-child{width:100%;min-width:0;max-width:100%}.edit-column-filters{border-inline-start:none;border-block-start:1px solid var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color));min-width:0;margin-block-start:var(--luzmo-spacing-3);padding-block-start:var(--luzmo-spacing-4);padding-inline-start:0}}@container (width<=768px){.chart-container{height:calc(var(--luzmo-interactive-viz-item-chart-height,var(--interactive-viz-item-chart-height)) - 2.5rem)}}:host{--interactive-viz-item-actions-gap:var(--luzmo-spacing-3);--interactive-viz-item-actions-padding-block:var(--luzmo-spacing-3);--interactive-viz-item-actions-margin-block-start:var(--luzmo-spacing-5);--interactive-viz-item-chart-height:20rem;--interactive-viz-item-chart-border-radius:var(--luzmo-border-radius);--interactive-viz-item-feedback-padding-block:var(--luzmo-spacing-4);--interactive-viz-item-config-panel-padding:var(--luzmo-spacing-5);--interactive-viz-item-config-panel-border-color:var(--luzmo-border-color);--interactive-viz-item-config-panel-border-radius:var(--luzmo-border-radius);--interactive-viz-item-config-panel-background:var(--luzmo-background-color);--interactive-viz-item-rating-positive-color:var(--luzmo-positive-color,#12855a);--interactive-viz-item-rating-negative-color:var(--luzmo-negative-color,#ca221c);--interactive-viz-item-rating-selected-background:var(--luzmo-background-color-focus,#0000000f)}:host([size=s]){--interactive-viz-item-chart-height:17.5rem}:host([size=l]){--interactive-viz-item-chart-height:22rem}:host([size=xl]){--interactive-viz-item-chart-height:24rem}`,_=function(e){return e.Top=`top`,e.Bottom=`bottom`,e}({}),v=function(e){return e.Asc=`asc`,e.Desc=`desc`,e}({}),y=function(e){return e.Measure=`measure`,e.Category=`category`,e}({}),b=5,x=Array.isArray;function S(e){return typeof e==`string`}function C(e){let t={...e};return!t.datasetId&&t.set&&(t.datasetId=t.set),!t.set&&t.datasetId&&(t.set=t.datasetId),!t.columnId&&t.column&&(t.columnId=t.column),!t.column&&t.columnId&&(t.column=t.columnId),!t.formulaId&&t.formula&&(t.formulaId=t.formula),!t.formula&&t.formulaId&&(t.formula=t.formulaId),t}function w(e){return x(e)?e:Object.entries(e).map(([e,t])=>({name:e,content:x(t)?t:[]}))}function T(e){let t=new Set;for(let n of e)for(let e of n.content){let n=e.datasetId??e.set;S(n)&&t.add(n)}return[...t]}function E(e){let t=w(e.slots??[]),n=e.options??{},r=n.interactivity;return{type:e.type,options:{...n,interactivity:{...r,scheduledExport:!1}},slots:t.map(e=>({...e,content:x(e.content)?e.content.map(e=>C(e)):[]})),filters:e.filters}}function D(e,t){return{...e,options:{...e.options,theme:{...e.options.theme,...t}}}}function O(e){let t=e.find(e=>e.name===`measure`||e.name===`measures`);if(t&&t.content.length>1)return!0;let n=e.find(e=>e.name===`legend`);return n?n.content.length>0:!1}function k(e){let t=[],n=e.options;switch(e.type){case`area-chart`:case`bar-chart`:case`column-chart`:if(t.push({type:`rankingPicker`,mutationType:`rankAndSort`,ranking:n.ranking??{active:!1,number:5,direction:_.Top},sort:n.sort??{direction:v.Desc,by:y.Measure},importance:100}),O(e.slots)){let r=e.type===`area-chart`,i=r?[{key:`stacked`,label:`Stacked`},{key:`unstacked`,label:`Unstacked`},{key:`100`,label:`100%`},{key:`stream`,label:`Stream`}]:[{key:`grouped`,label:`Grouped`},{key:`stacked`,label:`Stacked`},{key:`100`,label:`100%`}],a=r?`stacked`:`grouped`;t.push({type:`optionDropdown`,mutationType:`mode`,values:i,currentValue:n.mode??a,importance:90})}break;case`donut-chart`:{let e=n.display??{};t.push({type:`optionDropdown`,mutationType:`donutLabelDisplay`,values:[{key:`withLegend`,label:`With legend`},{key:`withLabels`,label:`With labels`}],currentValue:e.categoryLabels===!0?`withLabels`:`withLegend`,importance:90});break}case`bubble-chart`:{let e=n.display??{};t.push({type:`optionDropdown`,mutationType:`bubbleValues`,values:[{key:`none`,label:`No values`},{key:`absolute`,label:`Absolute`},{key:`percentage`,label:`Percentage`}],currentValue:e.bubbleValues??e.values??`none`,importance:100});break}}return t.sort((e,t)=>t.importance-e.importance)}function A(e,t,n){let r=e.options;switch(t){case`mode`:return{...e,options:{...r,mode:n}};case`donutLabelDisplay`:{let t={...r.display??{}};return n===`withLabels`?(t.legend=!1,t.categoryLabels=!0):(t.legend=!0,t.categoryLabels=!1),{...e,options:{...r,display:t}}}case`bubbleValues`:{let t={...r.display??{}};return t.bubbleLabels=t.bubbleLabels!==!1,t.bubbleValues=n,{...e,options:{...r,display:t}}}default:return e}}function j(e,t){switch(t.type){case`slots`:return{...e,slots:t.slotsContents};case`options`:return{...e,options:t.options};case`filters`:return{...e,filters:t.filters};case`chartAction`:return A(e,t.actionType,t.key);case`rankAndSort`:return{...e,options:{...e.options,ranking:t.ranking,sort:t.sort}};case`fullReplace`:return t.chart;default:return e}}var M=[`luzmo-filters`,`luzmo-item-option-panel`,`luzmo-item-slot-picker-panel`],N=s(()=>Promise.all([import(`./chunks/filters-XL4xRKOk.js`),import(`./chunks/item-option-panel-s1ZKzAZ9.js`),import(`./chunks/item-slot-picker-panel-DsZvl6kA.js`)])),P=N.load,F=()=>N.isLoaded()||M.every(e=>customElements.get(e)!==void 0),I=0,L=class extends t(i(a,{validSizes:Object.values(o)})){constructor(...e){super(...e),this.chart=null,this.feedback=null,this.messageId=``,this.authKey=``,this.authToken=``,this.apiUrl=`https://api.luzmo.com`,this.appServer=`https://app.luzmo.com`,this.contentLanguage=``,this.hideActions=!1,this.hideFeedback=!1,this.hideConfigPanel=!1,this._configPanelOpen=!1,this._configPanelPending=!1,this._configPanelLoadFailed=!1,this._rankingTriggerId=`interactive-viz-item-ranking-${++I}`,this._handleSlotsChanged=e=>{this.chart&&this._emitChart({...this.chart,slots:e.detail.slotsContents})},this._handleFiltersChanged=e=>{this.chart&&this._emitChart({...this.chart,filters:e.detail.filters})},this._handleOptionsChanged=e=>{if(!this.chart)return;let t=e.detail.options;if(!t)return;let n=this.chart.options.theme??{};this._emitChart({...this.chart,options:{...t,theme:{...n}}})}}static get styles(){return[f(g)]}get _effectiveContentLanguage(){return this.contentLanguage||this.language}_dispatch(e,t){let n=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});this.dispatchEvent(n)}get _chartActions(){return this.chart?k(E(this.chart)):[]}get _rating(){return this.feedback?.rating??0}get _canShowConfigPanel(){return!!this.chart&&!this.hideConfigPanel}async _toggleConfigPanel(){if(this._configPanelLoadFailed=!1,this._configPanelOpen){this._configPanelOpen=!1;return}if(!this._configPanelPending){if(!F()){this._configPanelPending=!0;try{await P()}catch(e){console.warn(`Failed to load the chart configuration panel:`,e),this._configPanelLoadFailed=!0;return}finally{this._configPanelPending=!1}}!this.isConnected||!this._canShowConfigPanel||(this._configPanelOpen=!0)}}_emitOptions(e){this._dispatch(`luzmo-chart-options-changed`,{options:e})}_emitChart(e){this._dispatch(`luzmo-chart-changed`,{chart:e})}_handleDropdownChange(e,t){if(!this.chart)return;t.stopPropagation();let n=t.detail,r=typeof n==`string`?n:n?.value??t.target?.value;if(!r)return;let i=j(E(this.chart),{type:`chartAction`,actionType:e.mutationType,key:r});this._emitOptions(i.options)}_currentRanking(e){return e.ranking??{active:!1,number:5,direction:_.Top}}_currentSort(e){return e.sort??{direction:v.Desc,by:y.Measure}}_emitRankAndSort(e,t){this.chart&&this._emitOptions({...this.chart.options,ranking:e,sort:t})}_renderOptionDropdown(e){let t=e.values??[],n=e.currentValue||t[0]?.key||``;return c`
22
+ import{n as e,t}from"./chunks/localized-mixin-j1gjzMSn.js";import{n}from"./chunks/lit-localize-CIGP-NUw.js";import"./chunks/embed-B3y_k1ri.js";import{t as r}from"./chunks/luzmoAlignLeft-HA-XKPHy.js";import{n as i,r as a,t as o}from"./chunks/base-CR5wZnQk.js";import{t as s}from"./chunks/create-lazy-loader-DC0rJePE.js";import{html as c,nothing as l,property as u,state as d,unsafeCSS as f}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/lit.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/action-button.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/action-group.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/field-label.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/icon.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/number-field.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/overlay.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/picker.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/popover.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/progress-circle.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/tabs.js";var p={icon:[32,32,`M16 0a16 16 0 1 0 16 16A16 16 0 0 0 16 0m0 7q1.4 0 1.5 1.5c0 2-3 2-3 0 0-1 .8-1.5 1.5-1.5m0 5q.9 0 1 1v10c0 1.3-2 1.3-2 0V13q.1-1 1-1`],name:`info-circle`},m={icon:[32,32,`M18.05 5.11a1.5 1.5 0 1 1 2.9.8l-.29 1.02a13.67 13.67 0 0 1-1.54 3.56 1 1 0 0 0 .85 1.52H28a2 2 0 0 1 1.07 3.7 1 1 0 0 0-.33 1.32 2 2 0 0 1-.82 2.76 1 1 0 0 0-.33 1.5 1.99 1.99 0 0 1-.96 3.12 1 1 0 0 0-.67 1.17A2 2 0 0 1 24 28h-5.6c-.98 0-1.94-.3-2.77-.84l-2.4-1.6a4.94 4.94 0 0 1-1.4-1.42 1 1 0 0 0-1.4-.29 1 1 0 0 0-.28 1.4c.5.76 1.17 1.43 1.96 1.97l2.4 1.6a6.98 6.98 0 0 0 3.89 1.18H24a4 4 0 0 0 4-4v-.04a4 4 0 0 0 1.7-5 4 4 0 0 0 1.13-4.13A4 4 0 0 0 28 10h-6.35c.39-.82.7-1.67.94-2.56l.29-1.02a3.51 3.51 0 0 0-6.76-1.85l-.28 1.03a8.5 8.5 0 0 1-3.64 4.93l-.2.13a6.53 6.53 0 0 0-1.84 1.76 1 1 0 0 0 .25 1.4 1 1 0 0 0 1.4-.25c.33-.49.76-.9 1.27-1.22l.2-.13c2.2-1.4 3.8-3.57 4.49-6.1ZM2 14.01h4v14H2Zm-2 0v14c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V14a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2z`],name:`thumbs-up`},h={icon:[32,32,`M18.05 26.89a1.5 1.5 0 1 0 2.9-.8l-.29-1.02a13.66 13.66 0 0 0-1.54-3.56 1 1 0 0 1 .85-1.52H28a2 2 0 0 0 1.07-3.69 1 1 0 0 1-.33-1.33 2 2 0 0 0-.82-2.76 1 1 0 0 1-.33-1.5 1.99 1.99 0 0 0-.96-3.12 1 1 0 0 1-.67-1.16A2 2 0 0 0 24 4h-5.6c-.98 0-1.94.3-2.77.84l-2.4 1.6c-.57.38-1.04.86-1.4 1.41a1 1 0 0 1-1.67-1.1 7.03 7.03 0 0 1 1.95-1.97l2.4-1.6A6.98 6.98 0 0 1 18.4 2H24a4 4 0 0 1 4 4v.04a4 4 0 0 1 1.7 5 3.99 3.99 0 0 1 1.13 4.13A3.99 3.99 0 0 1 28 22h-6.35c.39.81.7 1.66.94 2.55l.28 1.03a3.5 3.5 0 0 1-6.75 1.84l-.28-1.03a8.5 8.5 0 0 0-3.64-4.93l-.2-.13a6.52 6.52 0 0 1-1.84-1.76 1 1 0 0 1 .25-1.4 1 1 0 0 1 1.4.26c.33.48.76.9 1.27 1.22l.2.12c2.2 1.4 3.8 3.57 4.49 6.1zM2 21.99h4V8H2Zm-2 0V8c0-1.1.9-2 2-2h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2z`],name:`thumbs-down`},g=`:host{box-sizing:border-box;display:block;container-type:inline-size}.answer{width:100%;display:block}.chart-actions-bar{justify-content:space-between;align-items:center;gap:var(--luzmo-interactive-viz-item-actions-gap,var(--interactive-viz-item-actions-gap));padding-block:var(--luzmo-interactive-viz-item-actions-padding-block,var(--interactive-viz-item-actions-padding-block));flex-wrap:nowrap;margin-block-start:var(--luzmo-interactive-viz-item-actions-margin-block-start,var(--interactive-viz-item-actions-margin-block-start));display:flex}.chart-actions-primary{gap:var(--luzmo-interactive-viz-item-actions-gap,var(--interactive-viz-item-actions-gap));flex-wrap:wrap;flex:1;align-items:center;min-width:0;display:flex}.ranking-content{gap:var(--luzmo-spacing-3);padding:var(--luzmo-spacing-3);flex-direction:column;display:flex}.ranking-row{gap:var(--luzmo-spacing-3);align-items:center;display:flex}.ranking-number{width:4rem}.icon-flipped{transform:scaleY(-1)}.chart-container{border-radius:var(--luzmo-interactive-viz-item-chart-border-radius,var(--interactive-viz-item-chart-border-radius));height:var(--luzmo-interactive-viz-item-chart-height,var(--interactive-viz-item-chart-height));overflow:hidden}.chart-container luzmo-embed-viz-item{width:100%;height:100%;display:block}.feedback-row{padding-block:var(--luzmo-interactive-viz-item-feedback-padding-block,var(--interactive-viz-item-feedback-padding-block));justify-content:space-between;align-items:center;display:flex}.rating-btn-positive{--luzmo-action-button-content-color-default-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-content-color-hover-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-content-color-down-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-content-color-focus-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-background-color-default-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-hover-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-down-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-focus-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background))}.rating-btn-negative{--luzmo-action-button-content-color-default-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-content-color-hover-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-content-color-down-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-content-color-focus-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-background-color-default-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-hover-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-down-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-focus-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background))}.config-toggle{--luzmo-action-button-border-radius:32px;margin-inline-start:auto}.sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.config-panel{border:1px solid var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color));border-radius:var(--luzmo-interactive-viz-item-config-panel-border-radius,var(--interactive-viz-item-config-panel-border-radius));padding:var(--luzmo-interactive-viz-item-config-panel-padding,var(--interactive-viz-item-config-panel-padding));background:var(--luzmo-interactive-viz-item-config-panel-background,var(--interactive-viz-item-config-panel-background));margin-block-start:var(--luzmo-spacing-2)}.config-panel luzmo-tab-panel[selected]{padding-block-start:var(--luzmo-spacing-4);display:block}.config-panel luzmo-item-option-panel,.config-panel luzmo-item-slot-picker-panel,.config-panel luzmo-filters{width:100%;max-height:15rem;scrollbar-width:thin;scrollbar-color:var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color)) transparent;padding-inline-end:var(--luzmo-spacing-3);overflow-y:auto}.edit-grid{min-height:12.5rem;display:flex}.edit-column{gap:var(--luzmo-spacing-3);flex-direction:column;display:flex}.edit-column:first-child{flex-shrink:0;max-width:15rem}.edit-column-filters{border-inline-start:1px solid var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color));flex:1;min-width:18.75rem;padding-inline-start:var(--luzmo-spacing-5)}@container (width<=520px){.edit-grid{flex-direction:column}.edit-column,.edit-column:first-child{width:100%;min-width:0;max-width:100%}.edit-column-filters{border-inline-start:none;border-block-start:1px solid var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color));min-width:0;margin-block-start:var(--luzmo-spacing-3);padding-block-start:var(--luzmo-spacing-4);padding-inline-start:0}}@container (width<=768px){.chart-container{height:calc(var(--luzmo-interactive-viz-item-chart-height,var(--interactive-viz-item-chart-height)) - 2.5rem)}}:host{--interactive-viz-item-actions-gap:var(--luzmo-spacing-3);--interactive-viz-item-actions-padding-block:var(--luzmo-spacing-3);--interactive-viz-item-actions-margin-block-start:var(--luzmo-spacing-5);--interactive-viz-item-chart-height:20rem;--interactive-viz-item-chart-border-radius:var(--luzmo-border-radius);--interactive-viz-item-feedback-padding-block:var(--luzmo-spacing-4);--interactive-viz-item-config-panel-padding:var(--luzmo-spacing-5);--interactive-viz-item-config-panel-border-color:var(--luzmo-border-color);--interactive-viz-item-config-panel-border-radius:var(--luzmo-border-radius);--interactive-viz-item-config-panel-background:var(--luzmo-background-color);--interactive-viz-item-rating-positive-color:var(--luzmo-positive-color,#12855a);--interactive-viz-item-rating-negative-color:var(--luzmo-negative-color,#ca221c);--interactive-viz-item-rating-selected-background:var(--luzmo-background-color-focus,#0000000f)}:host([size=s]){--interactive-viz-item-chart-height:17.5rem}:host([size=l]){--interactive-viz-item-chart-height:22rem}:host([size=xl]){--interactive-viz-item-chart-height:24rem}`,_=function(e){return e.Top=`top`,e.Bottom=`bottom`,e}({}),v=function(e){return e.Asc=`asc`,e.Desc=`desc`,e}({}),y=function(e){return e.Measure=`measure`,e.Category=`category`,e}({}),b=5,x=Array.isArray;function S(e){return typeof e==`string`}function C(e){let t={...e};return!t.datasetId&&t.set&&(t.datasetId=t.set),!t.set&&t.datasetId&&(t.set=t.datasetId),!t.columnId&&t.column&&(t.columnId=t.column),!t.column&&t.columnId&&(t.column=t.columnId),!t.formulaId&&t.formula&&(t.formulaId=t.formula),!t.formula&&t.formulaId&&(t.formula=t.formulaId),t}function w(e){return x(e)?e:Object.entries(e).map(([e,t])=>({name:e,content:x(t)?t:[]}))}function T(e){let t=new Set;for(let n of e)for(let e of n.content){let n=e.datasetId??e.set;S(n)&&t.add(n)}return[...t]}function E(e){let t=w(e.slots??[]),n=e.options??{},r=n.interactivity;return{type:e.type,options:{...n,interactivity:{...r,scheduledExport:!1}},slots:t.map(e=>({...e,content:x(e.content)?e.content.map(e=>C(e)):[]})),filters:e.filters}}function D(e,t){return{...e,options:{...e.options,theme:{...e.options.theme,...t}}}}function O(e){let t=e.find(e=>e.name===`measure`||e.name===`measures`);if(t&&t.content.length>1)return!0;let n=e.find(e=>e.name===`legend`);return n?n.content.length>0:!1}function k(e){let t=[],n=e.options;switch(e.type){case`area-chart`:case`bar-chart`:case`column-chart`:if(t.push({type:`rankingPicker`,mutationType:`rankAndSort`,ranking:n.ranking??{active:!1,number:5,direction:_.Top},sort:n.sort??{direction:v.Desc,by:y.Measure},importance:100}),O(e.slots)){let r=e.type===`area-chart`,i=r?[{key:`stacked`,label:`Stacked`},{key:`unstacked`,label:`Unstacked`},{key:`100`,label:`100%`},{key:`stream`,label:`Stream`}]:[{key:`grouped`,label:`Grouped`},{key:`stacked`,label:`Stacked`},{key:`100`,label:`100%`}],a=r?`stacked`:`grouped`;t.push({type:`optionDropdown`,mutationType:`mode`,values:i,currentValue:n.mode??a,importance:90})}break;case`donut-chart`:{let e=n.display??{};t.push({type:`optionDropdown`,mutationType:`donutLabelDisplay`,values:[{key:`withLegend`,label:`With legend`},{key:`withLabels`,label:`With labels`}],currentValue:e.categoryLabels===!0?`withLabels`:`withLegend`,importance:90});break}case`bubble-chart`:{let e=n.display??{};t.push({type:`optionDropdown`,mutationType:`bubbleValues`,values:[{key:`none`,label:`No values`},{key:`absolute`,label:`Absolute`},{key:`percentage`,label:`Percentage`}],currentValue:e.bubbleValues??e.values??`none`,importance:100});break}}return t.sort((e,t)=>t.importance-e.importance)}function A(e,t,n){let r=e.options;switch(t){case`mode`:return{...e,options:{...r,mode:n}};case`donutLabelDisplay`:{let t={...r.display??{}};return n===`withLabels`?(t.legend=!1,t.categoryLabels=!0):(t.legend=!0,t.categoryLabels=!1),{...e,options:{...r,display:t}}}case`bubbleValues`:{let t={...r.display??{}};return t.bubbleLabels=t.bubbleLabels!==!1,t.bubbleValues=n,{...e,options:{...r,display:t}}}default:return e}}function j(e,t){switch(t.type){case`slots`:return{...e,slots:t.slotsContents};case`options`:return{...e,options:t.options};case`filters`:return{...e,filters:t.filters};case`chartAction`:return A(e,t.actionType,t.key);case`rankAndSort`:return{...e,options:{...e.options,ranking:t.ranking,sort:t.sort}};case`fullReplace`:return t.chart;default:return e}}var M=[`luzmo-filters`,`luzmo-item-option-panel`,`luzmo-item-slot-picker-panel`],N=s(()=>Promise.all([import(`./chunks/filters-CIOtenxx.js`),import(`./chunks/item-option-panel-PNWjgMMu.js`),import(`./chunks/item-slot-picker-panel-DRqvLkhG.js`)])),P=N.load,F=()=>N.isLoaded()||M.every(e=>customElements.get(e)!==void 0),I=0,L=class extends t(i(a,{validSizes:Object.values(o)})){constructor(...e){super(...e),this.chart=null,this.feedback=null,this.messageId=``,this.authKey=``,this.authToken=``,this.apiUrl=`https://api.luzmo.com`,this.appServer=`https://app.luzmo.com`,this.contentLanguage=``,this.hideActions=!1,this.hideFeedback=!1,this.hideConfigPanel=!1,this._configPanelOpen=!1,this._configPanelPending=!1,this._configPanelLoadFailed=!1,this._rankingTriggerId=`interactive-viz-item-ranking-${++I}`,this._handleSlotsChanged=e=>{this.chart&&this._emitChart({...this.chart,slots:e.detail.slotsContents})},this._handleFiltersChanged=e=>{this.chart&&this._emitChart({...this.chart,filters:e.detail.filters})},this._handleOptionsChanged=e=>{if(!this.chart)return;let t=e.detail.options;if(!t)return;let n=this.chart.options.theme??{};this._emitChart({...this.chart,options:{...t,theme:{...n}}})}}static get styles(){return[f(g)]}get _effectiveContentLanguage(){return this.contentLanguage||this.language}_dispatch(e,t){let n=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});this.dispatchEvent(n)}get _chartActions(){return this.chart?k(E(this.chart)):[]}get _rating(){return this.feedback?.rating??0}get _canShowConfigPanel(){return!!this.chart&&!this.hideConfigPanel}async _toggleConfigPanel(){if(this._configPanelLoadFailed=!1,this._configPanelOpen){this._configPanelOpen=!1;return}if(!this._configPanelPending){if(!F()){this._configPanelPending=!0;try{await P()}catch(e){console.warn(`Failed to load the chart configuration panel:`,e),this._configPanelLoadFailed=!0;return}finally{this._configPanelPending=!1}}!this.isConnected||!this._canShowConfigPanel||(this._configPanelOpen=!0)}}_emitOptions(e){this._dispatch(`luzmo-chart-options-changed`,{options:e})}_emitChart(e){this._dispatch(`luzmo-chart-changed`,{chart:e})}_handleDropdownChange(e,t){if(!this.chart)return;t.stopPropagation();let n=t.detail,r=typeof n==`string`?n:n?.value??t.target?.value;if(!r)return;let i=j(E(this.chart),{type:`chartAction`,actionType:e.mutationType,key:r});this._emitOptions(i.options)}_currentRanking(e){return e.ranking??{active:!1,number:5,direction:_.Top}}_currentSort(e){return e.sort??{direction:v.Desc,by:y.Measure}}_emitRankAndSort(e,t){this.chart&&this._emitOptions({...this.chart.options,ranking:e,sort:t})}_renderOptionDropdown(e){let t=e.values??[],n=e.currentValue||t[0]?.key||``;return c`
23
23
  <luzmo-picker
24
24
  size=${this.size}
25
25
  variant="highlight"