@luzmo/analytics-components-kit 1.3.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -5
- package/angular/components/add-to-dashboard.ts +20 -6
- package/angular/components/ai-chat-empty-state.ts +1 -1
- package/angular/components/ai-chat.ts +10 -3
- package/angular/components/data-fields-select.ts +5 -0
- package/angular/components/display-settings-period-over-period.ts +25 -4
- package/angular/components/display-settings.ts +24 -3
- package/angular/components/interactive-viz-item.ts +87 -22
- package/angular/components/item-grid-item-actions-menu.ts +5 -0
- package/angular/components/item-grid.ts +7 -0
- package/angular/components/item-option-color-picker.ts +28 -28
- package/angular/components/item-option-guidelines.ts +22 -1
- package/angular/components/item-option-multi-language-field.ts +7 -7
- package/angular/components/item-option-number-field.ts +14 -14
- package/angular/components/item-option-positions-number-field.ts +14 -14
- package/angular/components/item-option-radio-button-group.ts +7 -7
- package/angular/components/item-option-text-field.ts +7 -7
- package/angular/components/item-slot-drop-panel.ts +7 -0
- package/angular/components/item-slot-drop.ts +7 -0
- package/angular/components/item-slot-picker-panel.ts +8 -1
- package/angular/components/item-slot-picker.ts +22 -8
- package/angular/components/slot-menu.ts +15 -1
- package/angular/esm/components/add-to-dashboard.d.ts +8 -4
- package/angular/esm/components/add-to-dashboard.js +23 -7
- package/angular/esm/components/ai-chat-empty-state.d.ts +1 -1
- package/angular/esm/components/ai-chat.d.ts +6 -4
- package/angular/esm/components/ai-chat.js +10 -2
- package/angular/esm/components/data-fields-select.d.ts +2 -0
- package/angular/esm/components/data-fields-select.js +4 -0
- package/angular/esm/components/display-settings-period-over-period.d.ts +12 -5
- package/angular/esm/components/display-settings-period-over-period.js +29 -5
- package/angular/esm/components/display-settings.d.ts +11 -4
- package/angular/esm/components/display-settings.js +28 -4
- package/angular/esm/components/interactive-viz-item.d.ts +30 -9
- package/angular/esm/components/interactive-viz-item.js +98 -27
- package/angular/esm/components/item-grid-item-actions-menu.d.ts +2 -0
- package/angular/esm/components/item-grid-item-actions-menu.js +4 -0
- package/angular/esm/components/item-grid.d.ts +3 -1
- package/angular/esm/components/item-grid.js +9 -1
- package/angular/esm/components/item-option-color-picker.d.ts +10 -10
- package/angular/esm/components/item-option-color-picker.js +34 -34
- package/angular/esm/components/item-option-guidelines.d.ts +8 -2
- package/angular/esm/components/item-option-guidelines.js +26 -2
- package/angular/esm/components/item-option-multi-language-field.d.ts +3 -3
- package/angular/esm/components/item-option-multi-language-field.js +10 -10
- package/angular/esm/components/item-option-number-field.d.ts +5 -5
- package/angular/esm/components/item-option-number-field.js +18 -18
- package/angular/esm/components/item-option-positions-number-field.d.ts +5 -5
- package/angular/esm/components/item-option-positions-number-field.js +18 -18
- package/angular/esm/components/item-option-radio-button-group.d.ts +3 -3
- package/angular/esm/components/item-option-radio-button-group.js +10 -10
- package/angular/esm/components/item-option-text-field.d.ts +3 -3
- package/angular/esm/components/item-option-text-field.js +10 -10
- package/angular/esm/components/item-slot-drop-panel.d.ts +4 -1
- package/angular/esm/components/item-slot-drop-panel.js +10 -2
- package/angular/esm/components/item-slot-drop.d.ts +4 -1
- package/angular/esm/components/item-slot-drop.js +10 -2
- package/angular/esm/components/item-slot-picker-panel.d.ts +5 -2
- package/angular/esm/components/item-slot-picker-panel.js +11 -3
- package/angular/esm/components/item-slot-picker.d.ts +9 -4
- package/angular/esm/components/item-slot-picker.js +26 -10
- package/angular/esm/components/slot-menu.d.ts +7 -2
- package/angular/esm/components/slot-menu.js +18 -2
- package/angular/package.json +2 -2
- package/angular/utils/filters/expressions.d.ts +2 -0
- package/angular/utils/slot-state/slot-store.d.ts +3 -8
- package/angular/utils/time/period-over-period-condition.const.d.ts +0 -1
- package/angular/utils/time/period-over-period-context.d.ts +75 -0
- package/angular/utils/time/tests/period-over-period-context.test.d.ts +1 -0
- package/components/add-to-dashboard/dashboard-actions.d.ts +2 -1
- package/components/add-to-dashboard/index.cjs +1 -1
- package/components/add-to-dashboard/index.js +1 -1
- package/components/{add-to-dashboard-DGC0_hRB.js → add-to-dashboard-B5egTFre.js} +127 -122
- package/components/{add-to-dashboard-CzIuDtAq.cjs → add-to-dashboard-BC5SObl9.cjs} +1 -1
- package/components/advanced-options.i18n-CyfRP6Jc.js +43 -0
- package/components/advanced-options.i18n-DPTCLyPj.cjs +20 -0
- package/components/ai-chat/ai-chat-events.d.ts +6 -2
- package/components/ai-chat/ai-chat-request.d.ts +1 -1
- package/components/ai-chat/ai-chat.d.ts +9 -2
- package/components/ai-chat/ai-prompt-types.d.ts +19 -1
- package/components/ai-chat/helpers/interaction-assets.d.ts +9 -0
- package/components/ai-chat/helpers/question-template.d.ts +13 -0
- package/components/ai-chat/index.cjs +1 -1
- package/components/ai-chat/index.d.ts +2 -1
- package/components/ai-chat/index.js +3 -3
- package/components/ai-chat/session/ai-chat-session-types.d.ts +6 -1
- package/components/ai-chat/session/ai-chat-session.d.ts +14 -3
- package/components/{ai-chat-CL894viH.js → ai-chat-CZz60W04.js} +1152 -837
- package/components/ai-chat-CkN95EAz.cjs +414 -0
- package/components/ai-interaction-textarea/index.cjs +1 -1
- package/components/ai-interaction-textarea/index.js +1 -1
- package/components/{ai-interaction-textarea-BmvVVCmL.cjs → ai-interaction-textarea-NGtzhkEU.cjs} +1 -1
- package/components/{ai-interaction-textarea-CnQ2FBc7.js → ai-interaction-textarea-zpSYvzWC.js} +4 -4
- package/components/{area-chart-options.config-D99tvt_H.cjs → area-chart-options.config-DkaWRgGR.cjs} +1 -1
- package/components/{area-chart-options.config-Dnw8v2CA.js → area-chart-options.config-E5T5GaAt.js} +3 -3
- package/components/{area-chart-positioning.config-ygE3-JQW.js → area-chart-positioning.config-CF5TQdQM.js} +1 -1
- package/components/{area-chart-positioning.config-BwEs73dl.cjs → area-chart-positioning.config-D3v03RF2.cjs} +1 -1
- package/components/{bar-chart-options.config-DHO8grQN.js → bar-chart-options.config-BmuNCcVu.js} +3 -3
- package/components/{bar-chart-options.config-BQ-PbucR.cjs → bar-chart-options.config-DujzIJ03.cjs} +1 -1
- package/components/{bar-chart-positioning.config-CPdIIPp0.cjs → bar-chart-positioning.config-B2cBwfjg.cjs} +1 -1
- package/components/{bar-chart-positioning.config-GjqSe7CO.js → bar-chart-positioning.config-DD3FsbpL.js} +1 -1
- package/components/{base-rAte-QzM.js → base-BqwRKT4V.js} +1 -1
- package/components/{base-CGDNY_7v.cjs → base-D-bJhYbS.cjs} +1 -1
- package/components/{box-plot-options.config-BgiiwSrU.js → box-plot-options.config-BldiKc1W.js} +1 -1
- package/components/{box-plot-options.config-BcGisybi.cjs → box-plot-options.config-CTHQiE0y.cjs} +1 -1
- package/components/{box-plot-positioning.config-DDUgau2U.js → box-plot-positioning.config-D7dak0lQ.js} +1 -1
- package/components/{box-plot-positioning.config-mSIgw923.cjs → box-plot-positioning.config-DyDjp1GB.cjs} +1 -1
- package/components/{bubble-chart-options.config-DMk8Yjfk.cjs → bubble-chart-options.config-CIQV2-nD.cjs} +1 -1
- package/components/{bubble-chart-options.config-UM9w5tBs.js → bubble-chart-options.config-DfUueHwL.js} +1 -1
- package/components/{bubble-chart-positioning.config-CuOxvXYf.cjs → bubble-chart-positioning.config-CBVdzO-2.cjs} +1 -1
- package/components/{bubble-chart-positioning.config-C3UubNLh.js → bubble-chart-positioning.config-DjYnqcoE.js} +1 -1
- package/components/{bullet-chart-positioning.config-DB1Fmx1d.cjs → bullet-chart-positioning.config-B1tyFrKD.cjs} +1 -1
- package/components/{bullet-chart-positioning.config-BuFhsRMP.js → bullet-chart-positioning.config-C1Fy_8N4.js} +1 -1
- package/components/chart-helpers-BHxQbLBw.cjs +20 -0
- package/components/{chart-helpers-Cbl3sRra.js → chart-helpers-BKeMLhov.js} +51 -38
- package/components/{choropleth-map-options.config-Blu0Z2tR.js → choropleth-map-options.config-BPwJyWoW.js} +1 -1
- package/components/{choropleth-map-options.config-DwFJ00CS.cjs → choropleth-map-options.config-mBZ3__hO.cjs} +1 -1
- package/components/{choropleth-map-positioning.config-6PsCyhsn.js → choropleth-map-positioning.config-BJ4TNZiP.js} +1 -1
- package/components/{choropleth-map-positioning.config-fc5IcNoB.cjs → choropleth-map-positioning.config-DaN1GsN7.cjs} +1 -1
- package/components/{circle-pack-chart-options.config-DQs-uitJ.js → circle-pack-chart-options.config-BbTBvJRt.js} +1 -1
- package/components/{circle-pack-chart-options.config-DMNMYWZX.cjs → circle-pack-chart-options.config-Cz9c2Oxt.cjs} +1 -1
- package/components/{circle-pack-chart-positioning.config-DvQfzJ_Z.cjs → circle-pack-chart-positioning.config-C0iRGjcn.cjs} +1 -1
- package/components/{circle-pack-chart-positioning.config-DRHNE10H.js → circle-pack-chart-positioning.config-sm_d4gNL.js} +1 -1
- package/components/{circular-gauge-positioning.config-CGOX-Vyn.js → circular-gauge-positioning.config-CP_Ihfyd.js} +1 -1
- package/components/{circular-gauge-positioning.config-OX1-mPls.cjs → circular-gauge-positioning.config-GgkU8ivx.cjs} +1 -1
- package/components/{column-chart-options.config-BYDJTVx6.js → column-chart-options.config-BoIqFqBu.js} +3 -3
- package/components/{column-chart-options.config-CyD8V7j4.cjs → column-chart-options.config-fsV6tk3-.cjs} +1 -1
- package/components/{column-chart-positioning.config-BVYa1A42.js → column-chart-positioning.config-B4OsEyKU.js} +1 -1
- package/components/{column-chart-positioning.config-NbQbSa8P.cjs → column-chart-positioning.config-oub804lP.cjs} +1 -1
- package/components/{combination-chart-options.config-Cg3ZEKMe.cjs → combination-chart-options.config-C_fwwZvd.cjs} +1 -1
- package/components/{combination-chart-options.config-B3zsSUFx.js → combination-chart-options.config-Oks0enDz.js} +3 -3
- package/components/{combination-chart-positioning.config-B7DtfzCV.cjs → combination-chart-positioning.config-BeEC_NMJ.cjs} +1 -1
- package/components/{combination-chart-positioning.config-yHAgveni.js → combination-chart-positioning.config-BxNKTTby.js} +1 -1
- package/components/{conditional-number-positioning.config-BZS99jTT.cjs → conditional-number-positioning.config-B7F96ylg.cjs} +1 -1
- package/components/{conditional-number-positioning.config-DhixJEpv.js → conditional-number-positioning.config-xMGIw6c7.js} +1 -1
- package/components/data-field/index.cjs +1 -1
- package/components/data-field/index.js +1 -1
- package/components/{data-field-BORlpZZk.cjs → data-field-BxIuPFX_.cjs} +1 -1
- package/components/{data-field-B9466d0w.js → data-field-D03w2T6D.js} +3 -3
- package/components/data-field-level/index.cjs +1 -1
- package/components/data-field-level/index.js +1 -1
- package/components/{data-field-level-DOEYwcvM.cjs → data-field-level-BdWZsIny.cjs} +1 -1
- package/components/{data-field-level-GrX6yhPV.js → data-field-level-C-C9RCNf.js} +1 -1
- package/components/data-field-panel/index.cjs +1 -1
- package/components/data-field-panel/index.js +1 -1
- package/components/{data-field-panel-BedJ9V2r.js → data-field-panel-DLe4FvTg.js} +3 -3
- package/components/{data-field-panel-DmMkAYAz.cjs → data-field-panel-kGncuIuq.cjs} +1 -1
- package/components/data-fields-select/index.cjs +1 -1
- package/components/data-fields-select/index.js +1 -1
- package/components/{data-fields-select-BOqmoE7n.cjs → data-fields-select-CSP6pX9J.cjs} +1 -1
- package/components/{data-fields-select-af1HZLWS.js → data-fields-select-DP80Miah.js} +1 -1
- package/components/dataset-selector-list/index.cjs +1 -1
- package/components/dataset-selector-list/index.js +1 -1
- package/components/{dataset-selector-list-BzI8n_dB.js → dataset-selector-list-D2UcUaOx.js} +1 -1
- package/components/{dataset-selector-list-CmZaj20L.cjs → dataset-selector-list-DGWiCqpf.cjs} +1 -1
- package/components/dataset-selector-row/index.cjs +1 -1
- package/components/dataset-selector-row/index.js +1 -1
- package/components/{dataset-selector-row-D_7iBmdm.js → dataset-selector-row-7WNwyR9L.js} +3 -3
- package/components/{dataset-selector-row-mOGioXLM.cjs → dataset-selector-row-Vfh7jDjW.cjs} +1 -1
- package/components/{de-AOtjGNGZ.js → de-BbXtB6N5.js} +19 -4
- package/components/de-BfHCg6-Y.cjs +20 -0
- package/components/display-settings/display-settings.d.ts +11 -3
- package/components/display-settings/index.cjs +1 -1
- package/components/display-settings/index.js +1 -1
- package/components/{display-settings-Qwp9oJo6.js → display-settings-Bqq9iJ3L.js} +86 -62
- package/components/display-settings-CG-qtz9m.cjs +146 -0
- package/components/display-settings-binning/index.cjs +1 -1
- package/components/display-settings-binning/index.js +1 -1
- package/components/{display-settings-binning-IPVCvx8a.js → display-settings-binning-C2Jlf18P.js} +2 -2
- package/components/{display-settings-binning-D5zhoC7D.cjs → display-settings-binning-Dx9zEbDo.cjs} +1 -1
- package/components/display-settings-datetime/index.cjs +1 -1
- package/components/display-settings-datetime/index.js +1 -1
- package/components/{display-settings-datetime-t70VEfHe.cjs → display-settings-datetime-B6LMQZOW.cjs} +1 -1
- package/components/{display-settings-datetime-DgBBSYfC.js → display-settings-datetime-B6okY4hC.js} +2 -2
- package/components/display-settings-grand-totals/index.cjs +1 -1
- package/components/display-settings-grand-totals/index.js +1 -1
- package/components/{display-settings-grand-totals-C_Fzk7oV.cjs → display-settings-grand-totals-D1Fi1qIx.cjs} +1 -1
- package/components/{display-settings-grand-totals-AFtKeeeG.js → display-settings-grand-totals-_v0iGpHZ.js} +2 -2
- package/components/display-settings-numeric/index.cjs +1 -1
- package/components/display-settings-numeric/index.js +1 -1
- package/components/{display-settings-numeric-BF8BA5MH.cjs → display-settings-numeric-DbcsMeEN.cjs} +1 -1
- package/components/{display-settings-numeric-DeuXT1UR.js → display-settings-numeric-G2avidxv.js} +2 -2
- package/components/display-settings-period-over-period/display-settings-period-over-period.d.ts +18 -10
- package/components/display-settings-period-over-period/helpers/constants.d.ts +0 -23
- package/components/display-settings-period-over-period/index.cjs +1 -1
- package/components/display-settings-period-over-period/index.js +1 -1
- package/components/display-settings-period-over-period-86oxRHhk.cjs +151 -0
- package/components/{display-settings-period-over-period-CzxnyVF7.js → display-settings-period-over-period-DqeKcvdD.js} +101 -164
- package/components/donut-chart-options.config-B47Y1jhM.cjs +20 -0
- package/components/{donut-chart-options.config-B2vxfMyh.js → donut-chart-options.config-C__JfD3B.js} +32 -45
- package/components/{donut-chart-options.de-AXRfsiXW.cjs → donut-chart-options.de-Bsze2Gb5.cjs} +1 -1
- package/components/{donut-chart-options.de-DgNmBJiQ.js → donut-chart-options.de-Cft1Ppg0.js} +1 -2
- package/components/{donut-chart-options.en-aZqu2oEV.cjs → donut-chart-options.en-D3F9v0nN.cjs} +1 -1
- package/components/{donut-chart-options.en-BXwxTVpB.js → donut-chart-options.en-DZbap5Oi.js} +1 -2
- package/components/{donut-chart-options.es-7WgxuaDe.cjs → donut-chart-options.es-Cm0HGP62.cjs} +1 -1
- package/components/{donut-chart-options.es-DW_q5HeE.js → donut-chart-options.es-gM85ij3W.js} +1 -2
- package/components/{donut-chart-options.fr-QU3pGELZ.js → donut-chart-options.fr-Tgs8r0XZ.js} +1 -2
- package/components/{donut-chart-options.fr-C0Z8xEyF.cjs → donut-chart-options.fr-VSZoCY5q.cjs} +1 -1
- package/components/{donut-chart-options.nl-aKVLbRJY.cjs → donut-chart-options.nl-BkwPxEkq.cjs} +1 -1
- package/components/{donut-chart-options.nl-D_cgYVAQ.js → donut-chart-options.nl-SfAF0ycW.js} +1 -2
- package/components/{donut-chart-positioning.config-Bu1jZwtJ.cjs → donut-chart-positioning.config-BxJLjvJI.cjs} +1 -1
- package/components/{donut-chart-positioning.config-C0jkFWni.js → donut-chart-positioning.config-Doti4TgR.js} +1 -1
- package/components/{es-CYhv03uu.js → es-DRdklNAj.js} +19 -4
- package/components/es-Djk6AXOA.cjs +20 -0
- package/components/{evolution-number-positioning.config-DD8HBFtv.js → evolution-number-positioning.config-DHgkhRjt.js} +1 -1
- package/components/{evolution-number-positioning.config-DbH1-ODd.cjs → evolution-number-positioning.config-DeJkgT2e.cjs} +1 -1
- package/components/expressions-B4TetNaL.js +314 -0
- package/components/expressions-_KjBCqb6.cjs +20 -0
- package/components/filter-expression-picker/index.cjs +1 -1
- package/components/filter-expression-picker/index.js +1 -1
- package/components/filter-expression-picker-BuXFbOXQ.js +146 -0
- package/components/filter-expression-picker-Cta3MMId.cjs +40 -0
- package/components/filter-item/index.cjs +1 -1
- package/components/filter-item/index.js +1 -1
- package/components/filter-item-DENHWF-1.cjs +111 -0
- package/components/{filter-item-QJ3sDlmG.js → filter-item-DXkoGth1.js} +170 -169
- package/components/filter-parameter-picker/index.cjs +1 -1
- package/components/filter-parameter-picker/index.js +1 -1
- package/components/{filter-parameter-picker-DjQVFIfg.cjs → filter-parameter-picker-CYb_At4A.cjs} +1 -1
- package/components/{filter-parameter-picker-C8qwIo_H.js → filter-parameter-picker-Dhdrwokt.js} +1 -1
- package/components/filter-value-picker/index.cjs +1 -1
- package/components/filter-value-picker/index.js +1 -1
- package/components/{filter-value-picker-DIYyMymr.js → filter-value-picker-Df2otXtB.js} +4 -4
- package/components/{filter-value-picker-CMNxLzj7.cjs → filter-value-picker-IBplK-ue.cjs} +1 -1
- package/components/filter-value-picker-datetime/index.cjs +1 -1
- package/components/filter-value-picker-datetime/index.js +1 -1
- package/components/{filter-value-picker-datetime-DKblyQrs.js → filter-value-picker-datetime-Cxj-X50F.js} +34 -28
- package/components/filter-value-picker-datetime-DmJ6vrr8.cjs +53 -0
- package/components/filter-value-picker-hierarchy/index.cjs +1 -1
- package/components/filter-value-picker-hierarchy/index.js +1 -1
- package/components/{filter-value-picker-hierarchy-CXPC_4MU.cjs → filter-value-picker-hierarchy-BAK4urti.cjs} +1 -1
- package/components/{filter-value-picker-hierarchy-IswtY6Qa.js → filter-value-picker-hierarchy-JUxA6aOK.js} +2 -2
- package/components/filter-value-picker-numeric/index.cjs +1 -1
- package/components/filter-value-picker-numeric/index.js +1 -1
- package/components/{filter-value-picker-numeric-C7_-Fpol.cjs → filter-value-picker-numeric-Bf7iFwmp.cjs} +1 -1
- package/components/{filter-value-picker-numeric-DlFnGZ2O.js → filter-value-picker-numeric-MEFZbKsF.js} +1 -1
- package/components/filters/index.cjs +1 -1
- package/components/filters/index.js +1 -1
- package/components/filters-BLd6si6W.cjs +187 -0
- package/components/{filters-CxIzuI5q.js → filters-CYSKF57z.js} +115 -104
- package/components/formula/index.cjs +1 -1
- package/components/formula/index.js +1 -1
- package/components/{formula-WqOlEQ5o.js → formula-DPYHw2sr.js} +2 -2
- package/components/{formula-codemirror-BTYlGSxE.cjs → formula-codemirror-CZpISqCT.cjs} +1 -1
- package/components/{formula-codemirror-bpEb3M2G.js → formula-codemirror-DrcDvAal.js} +4 -4
- package/components/{formula-display-store-QU-B6xp9.js → formula-display-store-fFSd4okF.js} +3 -3
- package/components/{formula-display-store-D7fzKNfW.cjs → formula-display-store-zZIC2bm-.cjs} +1 -1
- package/components/formula-editor/index.cjs +1 -1
- package/components/formula-editor/index.js +3 -3
- package/components/{formula-editor-BbyDf0vM.js → formula-editor-C9ECzSM6.js} +5 -5
- package/components/{formula-editor-D_NRhjUI.cjs → formula-editor-CDx-sZrG.cjs} +1 -1
- package/components/formula-field/index.cjs +1 -1
- package/components/formula-field/index.js +1 -1
- package/components/{formula-field-DSSpI8LB.cjs → formula-field-CV3FLzM2.cjs} +1 -1
- package/components/{formula-field-BT9K_W6Q.js → formula-field-DZLfK3cs.js} +1 -1
- package/components/{formula-input-base-CQc1OU9G.js → formula-input-base-CTuUw8IY.js} +1 -1
- package/components/{formula-input-base-BoWiH97v.cjs → formula-input-base-DN9aVHrY.cjs} +1 -1
- package/components/{formula-CXrr9wJZ.cjs → formula-x9mA6jDv.cjs} +1 -1
- package/components/{fr-DKAoGI_6.js → fr-C6af3ed2.js} +19 -4
- package/components/fr-cuXTTJ19.cjs +20 -0
- package/components/{funnel-chart-options.config-W83a8ukL.js → funnel-chart-options.config-AupTvjpk.js} +27 -84
- package/components/funnel-chart-options.config-DLRKgBpU.cjs +20 -0
- package/components/{funnel-chart-options.de-B2f_xxvV.cjs → funnel-chart-options.de-BXnQCtlb.cjs} +1 -1
- package/components/{funnel-chart-options.de-CLMiAr0m.js → funnel-chart-options.de-CRjaoeDf.js} +0 -1
- package/components/{funnel-chart-options.en-Pu8yU7Yz.js → funnel-chart-options.en-B0moabZE.js} +0 -1
- package/components/{funnel-chart-options.en-Cdvkged9.cjs → funnel-chart-options.en-BxEAM67L.cjs} +1 -1
- package/components/{funnel-chart-options.es-CrAp7hOK.cjs → funnel-chart-options.es-B88ZJAvI.cjs} +1 -1
- package/components/{funnel-chart-options.es-BPjGIJ7s.js → funnel-chart-options.es-DVVoRoYc.js} +0 -1
- package/components/{funnel-chart-options.fr-0RxiqeZg.cjs → funnel-chart-options.fr-B79JhoL2.cjs} +1 -1
- package/components/{funnel-chart-options.fr-CtWjGa4q.js → funnel-chart-options.fr-DvQC8k_c.js} +0 -1
- package/components/{funnel-chart-options.nl-r_wRg5qR.cjs → funnel-chart-options.nl-CnHVcvGk.cjs} +1 -1
- package/components/{funnel-chart-options.nl-2TPEy_CB.js → funnel-chart-options.nl-DJhjX1Pw.js} +0 -1
- package/components/{funnel-chart-positioning.config-Dx9E5eiW.cjs → funnel-chart-positioning.config-BZJ5g_XG.cjs} +1 -1
- package/components/{funnel-chart-positioning.config-Dbex7egf.js → funnel-chart-positioning.config-y6yFY7jd.js} +1 -1
- package/components/{get-dataset-name-C3Sc0hZ0.cjs → get-dataset-name-DddRDGDV.cjs} +1 -1
- package/components/{get-dataset-name-BArAzBu2.js → get-dataset-name-OPlPwcJU.js} +1 -1
- package/components/{groupings-DMWmtE5F.cjs → groupings-BnI5_4A1.cjs} +1 -1
- package/components/{groupings-DXJS4XIU.js → groupings-D_Ri_Z-t.js} +1 -1
- package/components/{guidelines-options.config-D-ZuReR_.cjs → guidelines-options.config-BgARZ-fs.cjs} +1 -1
- package/components/{guidelines-options.config-DVZrOa3v.js → guidelines-options.config-BqAYiMSF.js} +1 -1
- package/components/{heat-map-positioning.config-Bzg0DG60.cjs → heat-map-positioning.config-Cgg-qkcr.cjs} +1 -1
- package/components/{heat-map-positioning.config-D4T7PQzN.js → heat-map-positioning.config-DN75-r9r.js} +1 -1
- package/components/{heat-table-options.config-CMWWTeyo.js → heat-table-options.config-BL8x1qwt.js} +20 -7
- package/components/heat-table-options.config-iEHucwDf.cjs +20 -0
- package/components/{heat-table-positioning.config-Cj6LlLe3.cjs → heat-table-positioning.config-C2QPQURh.cjs} +1 -1
- package/components/{heat-table-positioning.config-DVQiJfC4.js → heat-table-positioning.config-CHxtZe-0.js} +1 -1
- package/components/{hexbin-map-positioning.config-csNrvMwp.js → hexbin-map-positioning.config-B1H1Z6Os.js} +1 -1
- package/components/{hexbin-map-positioning.config-ChoCCure.cjs → hexbin-map-positioning.config-BI-RVV35.cjs} +1 -1
- package/components/index.cjs +1 -1
- package/components/index.js +69 -69
- package/components/interactive-viz-item/helpers/chart-helpers.d.ts +2 -1
- package/components/interactive-viz-item/index.cjs +1 -1
- package/components/interactive-viz-item/index.js +3 -3
- package/components/interactive-viz-item/interactive-viz-item.d.ts +44 -0
- package/components/{interactive-viz-item-BKLOmawA.js → interactive-viz-item-CngeQ579.js} +153 -112
- package/components/interactive-viz-item-qrC0vC2O.cjs +269 -0
- package/components/interactivity-options.config-AKgaj2vC.js +131 -0
- package/components/interactivity-options.config-CkRDoCWd.cjs +20 -0
- package/components/interactivity-options.i18n-Cv5w1nSS.cjs +20 -0
- package/components/{interactivity-options.i18n-DY947PNz.js → interactivity-options.i18n-DmrqdhYW.js} +35 -5
- package/components/item-grid/index.cjs +1 -1
- package/components/item-grid/index.js +2 -2
- package/components/item-grid/item-grid.d.ts +1 -0
- package/components/{item-grid-DveTRc7D.cjs → item-grid-C-v9kDvq.cjs} +1 -1
- package/components/{item-grid-DscQOFMu.js → item-grid-DzR5sfDM.js} +1 -1
- package/components/item-grid-item-actions-menu/index.cjs +1 -1
- package/components/item-grid-item-actions-menu/index.js +1 -1
- package/components/{item-grid-item-actions-menu-B1bKfagj.js → item-grid-item-actions-menu-DJJESWL6.js} +1 -1
- package/components/{item-grid-item-actions-menu-xRrT9dkY.cjs → item-grid-item-actions-menu-HIlcOhJA.cjs} +1 -1
- package/components/item-option/index.cjs +1 -1
- package/components/item-option/index.js +1 -1
- package/components/{item-option-DKLRnicU.js → item-option-B6h4E5qR.js} +49 -43
- package/components/item-option-action-button-group/index.cjs +1 -1
- package/components/item-option-action-button-group/index.js +1 -1
- package/components/{item-option-action-button-group-Cpd_CNn-.js → item-option-action-button-group-Bc3bJQUS.js} +1 -1
- package/components/{item-option-action-button-group-BMgUwveA.cjs → item-option-action-button-group-CQHpvC5O.cjs} +1 -1
- package/components/{item-option-base-BMy6dWbc.cjs → item-option-base-6msESUhx.cjs} +1 -1
- package/components/{item-option-base-BfHciede.js → item-option-base-XB_1V6QM.js} +1 -1
- package/components/item-option-color-palette-picker/index.cjs +1 -1
- package/components/item-option-color-palette-picker/index.js +1 -1
- package/components/{item-option-color-palette-picker-8KFuRU1D.js → item-option-color-palette-picker-BYjb4ygk.js} +1 -1
- package/components/{item-option-color-palette-picker-CnM1Gi6o.cjs → item-option-color-palette-picker-MhFJgurt.cjs} +1 -1
- package/components/item-option-color-picker/index.cjs +1 -1
- package/components/item-option-color-picker/index.js +1 -1
- package/components/{item-option-color-picker-CNW7GsCO.cjs → item-option-color-picker-CLLWV2M-.cjs} +1 -1
- package/components/{item-option-color-picker-DDvsY7hV.js → item-option-color-picker-Dq_NwAn1.js} +1 -1
- package/components/item-option-color-range/index.cjs +1 -1
- package/components/item-option-color-range/index.js +1 -1
- package/components/{item-option-color-range-BqSbuSZh.cjs → item-option-color-range-DlCi_o72.cjs} +1 -1
- package/components/{item-option-color-range-FQduqtz3.js → item-option-color-range-abi_vblh.js} +1 -1
- package/components/item-option-guidelines/index.cjs +1 -1
- package/components/item-option-guidelines/index.js +1 -1
- package/components/{item-option-guidelines-k5DwMONo.js → item-option-guidelines-8LmcJ04U.js} +3 -3
- package/components/{item-option-guidelines-z9BsGR-l.cjs → item-option-guidelines-Q2M8xSYS.cjs} +1 -1
- package/components/item-option-multi-language-field/index.cjs +1 -1
- package/components/item-option-multi-language-field/index.js +1 -1
- package/components/{item-option-multi-language-field-CqtBl3gM.js → item-option-multi-language-field-6FBm3Xr3.js} +1 -1
- package/components/{item-option-multi-language-field-DM2PENxV.cjs → item-option-multi-language-field-Dq3j7XYw.cjs} +1 -1
- package/components/item-option-number-field/index.cjs +1 -1
- package/components/item-option-number-field/index.js +1 -1
- package/components/{item-option-number-field-BgQRhFj3.js → item-option-number-field-CPgwUGTR.js} +1 -1
- package/components/{item-option-number-field-Cw2ofJL7.cjs → item-option-number-field-CZSVb9wv.cjs} +1 -1
- package/components/item-option-panel/index.cjs +1 -1
- package/components/item-option-panel/index.js +1 -1
- package/components/{item-option-panel-CU51qvgV.cjs → item-option-panel-B5ZKbaLl.cjs} +1 -1
- package/components/{item-option-panel-BLXWIbjX.js → item-option-panel-BZRyyc-9.js} +2 -2
- package/components/item-option-picker/index.cjs +1 -1
- package/components/item-option-picker/index.js +1 -1
- package/components/{item-option-picker-EJlc0bmj.cjs → item-option-picker-DMLk4Uq_.cjs} +1 -1
- package/components/{item-option-picker-DkAENDES.js → item-option-picker-mU6X3bbk.js} +1 -1
- package/components/item-option-position-picker/index.cjs +1 -1
- package/components/item-option-position-picker/index.js +1 -1
- package/components/{item-option-position-picker-DX7lLZKO.js → item-option-position-picker-B4AuC_73.js} +1 -1
- package/components/{item-option-position-picker-Ba7cBvlL.cjs → item-option-position-picker-BTH6KixE.cjs} +1 -1
- package/components/item-option-positions-number-field/index.cjs +1 -1
- package/components/item-option-positions-number-field/index.js +1 -1
- package/components/{item-option-positions-number-field-Bqfg0MJm.js → item-option-positions-number-field-BTFGhhrb.js} +1 -1
- package/components/{item-option-positions-number-field-BQ8gFOAn.cjs → item-option-positions-number-field-Dz0mpPSk.cjs} +1 -1
- package/components/item-option-radio-button-group/index.cjs +1 -1
- package/components/item-option-radio-button-group/index.js +1 -1
- package/components/{item-option-radio-button-group-Bk7VQlpx.js → item-option-radio-button-group-CmYFScry.js} +1 -1
- package/components/{item-option-radio-button-group-2hX-E2WV.cjs → item-option-radio-button-group-EBLjtMVd.cjs} +1 -1
- package/components/item-option-slider/index.cjs +1 -1
- package/components/item-option-slider/index.js +1 -1
- package/components/{item-option-slider-BKtJfL3D.js → item-option-slider-C7RfBary.js} +1 -1
- package/components/{item-option-slider-Kz2eFBql.cjs → item-option-slider-DRXTGW9W.cjs} +1 -1
- package/components/item-option-switch/index.cjs +1 -1
- package/components/item-option-switch/index.js +1 -1
- package/components/{item-option-switch-BUteU1mc.cjs → item-option-switch-D-FbXXRl.cjs} +1 -1
- package/components/{item-option-switch-cGWccE79.js → item-option-switch-D-MY6Uqv.js} +1 -1
- package/components/{item-option-DpLdospV.cjs → item-option-t_LsqjoR.cjs} +1 -1
- package/components/item-option-text-field/index.cjs +1 -1
- package/components/item-option-text-field/index.js +1 -1
- package/components/{item-option-text-field-Dy8pqVKJ.js → item-option-text-field-BR2V4ro2.js} +1 -1
- package/components/{item-option-text-field-BC9fR-yW.cjs → item-option-text-field-Cn-9lblu.cjs} +1 -1
- package/components/item-options-configs.cjs +1 -1
- package/components/item-options-configs.js +21 -21
- package/components/item-slot-drop/index.cjs +1 -1
- package/components/item-slot-drop/index.js +1 -1
- package/components/item-slot-drop/item-slot-drop.d.ts +2 -0
- package/components/item-slot-drop-7v-n-e1y.cjs +93 -0
- package/components/{item-slot-drop-CwZT8bTP.js → item-slot-drop-Db-tVAud.js} +69 -60
- package/components/item-slot-drop-panel/index.cjs +1 -1
- package/components/item-slot-drop-panel/index.js +1 -1
- package/components/item-slot-drop-panel/item-slot-drop-panel.d.ts +2 -0
- package/components/{item-slot-drop-panel-o5UdVrY_.js → item-slot-drop-panel-D-g4H1Rp.js} +117 -107
- package/components/item-slot-drop-panel-D2_1yWHs.cjs +58 -0
- package/components/item-slot-picker/index.cjs +1 -1
- package/components/item-slot-picker/index.js +1 -1
- package/components/item-slot-picker/item-slot-picker.d.ts +5 -0
- package/components/item-slot-picker-9afJORSK.cjs +160 -0
- package/components/{item-slot-picker-ilmmb0-8.js → item-slot-picker-BHtj0dRB.js} +109 -101
- package/components/item-slot-picker-panel/index.cjs +1 -1
- package/components/item-slot-picker-panel/index.js +1 -1
- package/components/item-slot-picker-panel/item-slot-picker-panel.d.ts +21 -1
- package/components/{item-slot-picker-panel-fJqEmxeD.js → item-slot-picker-panel-CIxGfaz3.js} +111 -69
- package/components/item-slot-picker-panel-CeOtdtMc.cjs +86 -0
- package/components/{kpi-positioning.config-mQuxf1ke.js → kpi-positioning.config-DDTfIZ_h.js} +1 -1
- package/components/{kpi-positioning.config-DIYWUwID.cjs → kpi-positioning.config-t9SxIqga.cjs} +1 -1
- package/components/legend-options.i18n-0hyeyskh.js +78 -0
- package/components/legend-options.i18n-CUZeW5rR.cjs +20 -0
- package/components/{line-chart-options.config-Opoz2jPk.js → line-chart-options.config-BdhyECMS.js} +2 -2
- package/components/{line-chart-options.config-DOGbeJhy.cjs → line-chart-options.config-CVtYVap1.cjs} +1 -1
- package/components/{line-chart-positioning.config-DqjrWmxJ.js → line-chart-positioning.config-BZoKaJVO.js} +1 -1
- package/components/{line-chart-positioning.config-DK9PycZ_.cjs → line-chart-positioning.config-DfTMlBBL.cjs} +1 -1
- package/components/{localized-mixin-EoNvtTBG.cjs → localized-mixin-BQowFGQK.cjs} +1 -1
- package/components/{localized-mixin-FPDNaZhb.js → localized-mixin-BdXrQldH.js} +1 -1
- package/components/{marker-map-positioning.config-BB51kE8O.cjs → marker-map-positioning.config-BsPUa8Ui.cjs} +1 -1
- package/components/{marker-map-positioning.config-CA08hZcp.js → marker-map-positioning.config-BtuIUPHT.js} +1 -1
- package/components/nl-B4gqLp1F.cjs +20 -0
- package/components/{nl-DNWGcGqO.js → nl-Chzh7kM2.js} +19 -4
- package/components/{ohlc-chart-options.config-CvlHm6hy.cjs → ohlc-chart-options.config-BQJWhXv7.cjs} +1 -1
- package/components/{ohlc-chart-options.config-C-TCUtOt.js → ohlc-chart-options.config-MYqetK62.js} +3 -3
- package/components/{ohlc-chart-positioning.config-CDL2vGsl.cjs → ohlc-chart-positioning.config-D1X1U96F.cjs} +1 -1
- package/components/{ohlc-chart-positioning.config-BqFHD1oj.js → ohlc-chart-positioning.config-Ny3U8zgV.js} +1 -1
- package/components/{parallel-coordinates-plot-options.config-UHrCS9q5.cjs → parallel-coordinates-plot-options.config-B4v6BtAz.cjs} +1 -1
- package/components/{parallel-coordinates-plot-options.config-C3HTFBTl.js → parallel-coordinates-plot-options.config-CN4p7QDD.js} +1 -1
- package/components/{parallel-coordinates-plot-positioning.config-Cc-ooVxV.cjs → parallel-coordinates-plot-positioning.config-BI6JMiBT.cjs} +1 -1
- package/components/{parallel-coordinates-plot-positioning.config-D6IuAk_K.js → parallel-coordinates-plot-positioning.config-Curf1XoL.js} +1 -1
- package/components/{period-over-period-condition.const-C1NZ9Bkp.cjs → period-over-period-condition.const-BOI8gxO1.cjs} +1 -1
- package/components/{period-over-period-condition.const-AE_2h-9O.js → period-over-period-condition.const-C9cn5m-o.js} +1 -2
- package/components/period-over-period-context-CeZHXSs0.js +84 -0
- package/components/period-over-period-context-Cx4pRKBn.cjs +20 -0
- package/components/{pivot-table-options.config-5pYvqc35.cjs → pivot-table-options.config-1DApg-wg.cjs} +1 -1
- package/components/{pivot-table-options.config-BlrguysB.js → pivot-table-options.config-DhzyxHTP.js} +1 -1
- package/components/{pivot-table-positioning.config-DDwXH70O.js → pivot-table-positioning.config-BoN7P8bs.js} +1 -1
- package/components/{pivot-table-positioning.config-DvwKNjoD.cjs → pivot-table-positioning.config-BsyGrzvX.cjs} +1 -1
- package/components/{pyramid-chart-options.config-CAC6cMmt.cjs → pyramid-chart-options.config-CNOOucJE.cjs} +1 -1
- package/components/{pyramid-chart-options.config-0Qf1naIx.js → pyramid-chart-options.config-DVBuswjg.js} +1 -1
- package/components/{pyramid-chart-positioning.config-DWou2jnm.js → pyramid-chart-positioning.config-D9Z40IzT.js} +1 -1
- package/components/{pyramid-chart-positioning.config-10BYkgv8.cjs → pyramid-chart-positioning.config-DdjlJjFb.cjs} +1 -1
- package/components/{radar-chart-positioning.config-B0O8vn-B.js → radar-chart-positioning.config-C16aywvy.js} +1 -1
- package/components/{radar-chart-positioning.config-Dg41uYWY.cjs → radar-chart-positioning.config-DARMkDIv.cjs} +1 -1
- package/components/{route-map-positioning.config-C1iUodTh.js → route-map-positioning.config-BmuPL5DK.js} +1 -1
- package/components/{route-map-positioning.config-DlM6xJTP.cjs → route-map-positioning.config-CTtpis1h.cjs} +1 -1
- package/components/{sankey-diagram-options.config-Y6jRK3wk.js → sankey-diagram-options.config-B86iq8pI.js} +1 -1
- package/components/{sankey-diagram-options.config-B8aHKfFt.cjs → sankey-diagram-options.config-mIgABANw.cjs} +1 -1
- package/components/{sankey-diagram-positioning.config-5EXNleL5.js → sankey-diagram-positioning.config-BhvJe1IX.js} +1 -1
- package/components/{sankey-diagram-positioning.config-BSu02GJ1.cjs → sankey-diagram-positioning.config-aLwXoVGA.cjs} +1 -1
- package/components/{scatter-plot-options.config-DhOGahRc.cjs → scatter-plot-options.config-BZVF4r3f.cjs} +1 -1
- package/components/{scatter-plot-options.config-DvGofFzR.js → scatter-plot-options.config-ChqZzslY.js} +2 -2
- package/components/{scatter-plot-positioning.config-CuyJUmiV.cjs → scatter-plot-positioning.config-CYy1jfz5.cjs} +1 -1
- package/components/{scatter-plot-positioning.config-nDbkUUqa.js → scatter-plot-positioning.config-twVc5wWl.js} +1 -1
- package/components/{set-locale-m257lVi3.js → set-locale-BeAF7qn4.js} +4 -4
- package/components/{set-locale-BkMmLcm6.cjs → set-locale-DvJ1yA4S.cjs} +1 -1
- package/components/{slicer-filter-positioning.config-BT5aNPHe.js → slicer-filter-positioning.config-WofHaYJx.js} +1 -1
- package/components/{slicer-filter-positioning.config-D7ZLoaGu.cjs → slicer-filter-positioning.config-_frD2LDr.cjs} +1 -1
- package/components/slot-menu/index.cjs +1 -1
- package/components/slot-menu/index.js +1 -1
- package/components/slot-menu/slot-menu.d.ts +6 -0
- package/components/slot-menu-B-7MzAd6.cjs +71 -0
- package/components/{slot-menu-BB_nJWZx.js → slot-menu-DhGC4yoA.js} +88 -97
- package/components/slot-menu-list/index.cjs +1 -1
- package/components/slot-menu-list/index.js +1 -1
- package/components/{slot-menu-list-C2nLODML.cjs → slot-menu-list-CiJK2fNu.cjs} +1 -1
- package/components/{slot-menu-list-3QkrOWgG.js → slot-menu-list-SoDeiZE1.js} +1 -1
- package/components/sort-options.config-CiPFyoxx.cjs +20 -0
- package/components/sort-options.config-CiZo1AEh.js +104 -0
- package/components/{speedometer-chart-positioning.config-CO1MtdU3.js → speedometer-chart-positioning.config-BLXUOOc_.js} +1 -1
- package/components/{speedometer-chart-positioning.config-BtDD3TiP.cjs → speedometer-chart-positioning.config-CkTqU3qn.cjs} +1 -1
- package/components/{spike-map-positioning.config-BhKVutm1.cjs → spike-map-positioning.config-DmLlz8ZD.cjs} +1 -1
- package/components/{spike-map-positioning.config-CQkcCdHD.js → spike-map-positioning.config-pgedE0nh.js} +1 -1
- package/components/{strip-plot-positioning.config-DEyOR-yS.js → strip-plot-positioning.config-B4sVlI82.js} +1 -1
- package/components/{strip-plot-positioning.config-CEYgtT13.cjs → strip-plot-positioning.config-CtctjJwh.cjs} +1 -1
- package/components/sunburst-chart-options.config-DNkL0pN4.cjs +20 -0
- package/components/{sunburst-chart-options.config-DVETeZFc.js → sunburst-chart-options.config-Zg42LwmT.js} +26 -83
- package/components/{sunburst-chart-options.de-DO65RQI_.cjs → sunburst-chart-options.de-BIJ2Njvn.cjs} +1 -1
- package/components/{sunburst-chart-options.de-B0mIITIx.js → sunburst-chart-options.de-BaLziTTh.js} +2 -2
- package/components/{sunburst-chart-options.en-C3IkkUBW.cjs → sunburst-chart-options.en-C2P4VIQq.cjs} +1 -1
- package/components/{sunburst-chart-options.en-LoUPN34r.js → sunburst-chart-options.en-CxWuNug0.js} +2 -2
- package/components/{sunburst-chart-options.es-BV_4fN10.cjs → sunburst-chart-options.es-eGoOC0h2.cjs} +1 -1
- package/components/{sunburst-chart-options.es-DBje7CMN.js → sunburst-chart-options.es-nqpK13rB.js} +2 -2
- package/components/{sunburst-chart-options.fr-Cnbpsj6t.js → sunburst-chart-options.fr-Dtfoz1Z-.js} +2 -2
- package/components/{sunburst-chart-options.fr-DO7-oeNe.cjs → sunburst-chart-options.fr-wdaTbc-I.cjs} +1 -1
- package/components/{sunburst-chart-options.nl-DsecjcfE.cjs → sunburst-chart-options.nl-2U3YQ6aP.cjs} +1 -1
- package/components/{sunburst-chart-options.nl-CluctKYY.js → sunburst-chart-options.nl-BljrFLha.js} +2 -2
- package/components/{sunburst-chart-positioning.config-DP-ifsmn.js → sunburst-chart-positioning.config-BJpphNBF.js} +1 -1
- package/components/{sunburst-chart-positioning.config-DNtHXpHg.cjs → sunburst-chart-positioning.config-BaQsxbr9.cjs} +1 -1
- package/components/{symbol-map-positioning.config-CoLDPgYM.cjs → symbol-map-positioning.config-657GZ7GZ.cjs} +1 -1
- package/components/{symbol-map-positioning.config-Nj7pDOAu.js → symbol-map-positioning.config-DEMmnp7J.js} +1 -1
- package/components/theme-options.config-CnSIfTf6.js +47 -0
- package/components/theme-options.config-DZJos9OK.cjs +20 -0
- package/components/theme-options.i18n-7V690gi-.cjs +20 -0
- package/components/theme-options.i18n-DtQoYxRz.js +43 -0
- package/components/{treemap-chart-options.config-DLEY6YuI.cjs → treemap-chart-options.config-B-bY4pOq.cjs} +1 -1
- package/components/{treemap-chart-options.config-DsqsX9So.js → treemap-chart-options.config-BYbW8htL.js} +1 -1
- package/components/{treemap-chart-positioning.config-B_R_cmFs.js → treemap-chart-positioning.config-CLKsuS0b.js} +1 -1
- package/components/{treemap-chart-positioning.config-BVOqj2V1.cjs → treemap-chart-positioning.config-DnY0Gnz7.cjs} +1 -1
- package/components/utils/base.cjs +1 -1
- package/components/utils/base.js +2 -2
- package/components/{utils-DIKmx9O1.cjs → utils-BGtDiw5k.cjs} +1 -1
- package/components/{utils-DS6Pthr4.js → utils-ZVgZ4EFf.js} +1 -1
- package/components/utils.cjs +1 -1
- package/components/utils.js +8 -8
- package/components/{venn-diagram-positioning.config-DOsSkJYl.js → venn-diagram-positioning.config-BjiidwmG.js} +1 -1
- package/components/{venn-diagram-positioning.config-8JCVpYOt.cjs → venn-diagram-positioning.config-OBLHpLAK.cjs} +1 -1
- package/components/{wordcloud-chart-options.config-DiyF596X.cjs → wordcloud-chart-options.config-COTlsOrG.cjs} +1 -1
- package/components/{wordcloud-chart-options.config-UAl2hfU7.js → wordcloud-chart-options.config-vKHxHgLh.js} +1 -1
- package/components/{wordcloud-chart-positioning.config-DSVw_z7Y.js → wordcloud-chart-positioning.config-68AyKLI2.js} +1 -1
- package/components/{wordcloud-chart-positioning.config-D13iPEEg.cjs → wordcloud-chart-positioning.config-B_pohQK5.cjs} +1 -1
- package/custom-elements.json +3411 -2436
- package/grid-core/item-grid-base.d.ts +5 -4
- package/package.json +3 -3
- package/react/components/ai-chat.component.ts +1 -1
- package/react/esm/components/ai-chat.component.d.ts +1 -1
- package/react/esm/components/ai-chat.component.js +1 -1
- package/react/package.json +2 -2
- package/standalone/add-to-dashboard.js +1 -1
- package/standalone/chunks/advanced-options.i18n-BDqAAkCh.js +2 -0
- package/standalone/chunks/{area-chart-options.config-BMvUma_d.js → area-chart-options.config-MSCX7GCC.js} +1 -1
- package/standalone/chunks/{bar-chart-options.config-BpHqXBFq.js → bar-chart-options.config-C-kawBg1.js} +1 -1
- package/standalone/chunks/{box-plot-options.config-DDWb_KmV.js → box-plot-options.config-EeKqXIKW.js} +1 -1
- package/standalone/chunks/{bubble-chart-options.config-BKPTymfC.js → bubble-chart-options.config-BEP0haal.js} +1 -1
- package/standalone/chunks/{chart-helpers-CR-EUEPf.js → chart-helpers-CKlLA7d7.js} +2 -2
- package/standalone/chunks/{choropleth-map-options.config-CDMjKnJD.js → choropleth-map-options.config-C9iAp9Kx.js} +1 -1
- package/standalone/chunks/{circle-pack-chart-options.config-CjDkh4DG.js → circle-pack-chart-options.config-Ch67WcjC.js} +1 -1
- package/standalone/chunks/{color-range-utils-BVyHBRiq.js → color-range-utils-D2amn7jf.js} +1 -1
- package/standalone/chunks/{column-chart-options.config-YIe6cMV5.js → column-chart-options.config-kXBPyFRG.js} +1 -1
- package/standalone/chunks/{combination-chart-options.config-Bf7cNmpc.js → combination-chart-options.config-CvVDQmwB.js} +1 -1
- package/standalone/chunks/data-broker-CUCszU0S.js +2 -0
- package/standalone/chunks/de-CBvR-tEX.js +2 -0
- package/standalone/chunks/{display-settings-binning-BeLLxd3i.js → display-settings-binning-5gaYqJVT.js} +1 -1
- package/standalone/chunks/display-settings-datetime-DhmVs5jK.js +199 -0
- package/standalone/chunks/{display-settings-grand-totals-BuhpQKJ6.js → display-settings-grand-totals-B83suS2N.js} +1 -1
- package/standalone/chunks/{display-settings-numeric-m30IYI7I.js → display-settings-numeric-CnKNRgjc.js} +1 -1
- package/standalone/chunks/display-settings-period-over-period-Di_2_DDX.js +133 -0
- package/standalone/chunks/donut-chart-options.config-re9dbce1.js +2 -0
- package/standalone/chunks/donut-chart-options.de-C1yjMc7p.js +2 -0
- package/standalone/chunks/donut-chart-options.en-CJSA_qMs.js +2 -0
- package/standalone/chunks/donut-chart-options.es-9wl-kU6W.js +2 -0
- package/standalone/chunks/donut-chart-options.fr-FewVJ9oP.js +2 -0
- package/standalone/chunks/donut-chart-options.nl-BA31OsN3.js +2 -0
- package/standalone/chunks/{embed-Bv1ps-EM.js → embed-BL4OOcIV.js} +1 -1
- package/standalone/chunks/en-Cu0ra3lJ.js +2 -0
- package/standalone/chunks/en-GB-B575630r.js +2 -0
- package/standalone/chunks/en-US-Cu0ra3lJ.js +2 -0
- package/standalone/chunks/es-CJnRT1YI.js +2 -0
- package/standalone/chunks/{filters-CxgBXUF1.js → filters-Dk7oDe_z.js} +75 -73
- package/standalone/chunks/{formula-codemirror-Cq94j3-f.js → formula-codemirror-Dn_LEpVx.js} +8 -8
- package/standalone/chunks/fr-DqE0NP1j.js +2 -0
- package/standalone/chunks/funnel-chart-options.config-CW0RAyLR.js +2 -0
- package/standalone/chunks/{funnel-chart-options.de-u5OrFyng.js → funnel-chart-options.de-D2UImO-s.js} +1 -1
- package/standalone/chunks/{funnel-chart-options.en-BEGSBn35.js → funnel-chart-options.en-BJr4frpT.js} +1 -1
- package/standalone/chunks/{funnel-chart-options.es-CxWkEgMs.js → funnel-chart-options.es-DkAYtLaS.js} +1 -1
- package/standalone/chunks/{funnel-chart-options.fr-DZmmgK2t.js → funnel-chart-options.fr-BD3VKHzw.js} +1 -1
- package/standalone/chunks/{funnel-chart-options.nl-C6BitaEJ.js → funnel-chart-options.nl-CubJLSq7.js} +1 -1
- package/standalone/chunks/{guidelines-options.config-CS29_J9M.js → guidelines-options.config-CrJ_haaO.js} +1 -1
- package/standalone/chunks/{heat-map-options.config-DDQMD38W.js → heat-map-options.config-_1TkgBVb.js} +1 -1
- package/standalone/chunks/heat-table-options.config-tgVKW_7X.js +2 -0
- package/standalone/chunks/interactivity-options.config-CG_ZbLS5.js +2 -0
- package/standalone/chunks/interactivity-options.i18n-V1RAn6Ue.js +2 -0
- package/standalone/chunks/{is-same-option-value-7kXNF4st.js → is-same-option-value-CfxEd5pG.js} +1 -1
- package/standalone/chunks/{item-option-action-button-group-BoyqF9vt.js → item-option-action-button-group-C1ke6Jb3.js} +1 -1
- package/standalone/chunks/{item-option-base-CBcDT8MX.js → item-option-base-DSAq8pgm.js} +1 -1
- package/standalone/chunks/{item-option-color-palette-picker-C9PGAv4V.js → item-option-color-palette-picker-waW4sAIj.js} +1 -1
- package/standalone/chunks/{item-option-color-picker-D4fVJlqF.js → item-option-color-picker-9e_3aSen.js} +1 -1
- package/standalone/chunks/{item-option-color-range-BlAdTguE.js → item-option-color-range-CWmg4Tdk.js} +1 -1
- package/standalone/chunks/{item-option-guidelines-DMsYsHDu.js → item-option-guidelines-BnLLvaFI.js} +1 -1
- package/standalone/chunks/{item-option-multi-language-field-NUbm1drg.js → item-option-multi-language-field-BN9u0rGs.js} +1 -1
- package/standalone/chunks/{item-option-number-field-DRp7kbHL.js → item-option-number-field-D2gvKQN_.js} +1 -1
- package/standalone/chunks/{item-option-panel-cXrRclzM.js → item-option-panel-BWQpttWc.js} +2 -2
- package/standalone/chunks/{item-option-picker-Ba09L4Cs.js → item-option-picker-BElgjysX.js} +1 -1
- package/standalone/chunks/{item-option-position-picker-GEGTnhjw.js → item-option-position-picker-B7FGJPTv.js} +1 -1
- package/standalone/chunks/{item-option-positions-number-field-n44s1k5v.js → item-option-positions-number-field-CyCWqMby.js} +1 -1
- package/standalone/chunks/{item-option-radio-button-group-3s_b1NvR.js → item-option-radio-button-group-DjMjG9W3.js} +1 -1
- package/standalone/chunks/{item-option-slider-DtY65Gxk.js → item-option-slider-CJrobai6.js} +1 -1
- package/standalone/chunks/{item-option-switch-4sJaI0mx.js → item-option-switch-DTK0eRzd.js} +1 -1
- package/standalone/chunks/{item-option-text-field-Bt6Lj6kh.js → item-option-text-field-B4-wMWpQ.js} +1 -1
- package/standalone/chunks/item-slot-picker-panel-BZsTEDns.js +438 -0
- package/standalone/chunks/legend-options.i18n-Dr6XmdZs.js +2 -0
- package/standalone/chunks/line-chart-options.config-VgcDr1j6.js +2 -0
- package/standalone/chunks/load-data-fields-for-datasets-Df6IGwne.js +25 -0
- package/standalone/chunks/localize-DIWFho02.js +2 -0
- package/standalone/chunks/{localized-decorator-DosMCCQo.js → localized-decorator-C2ufmkVS.js} +1 -1
- package/standalone/chunks/{localized-mixin-BWJj88bd.js → localized-mixin-CLvEZO1g.js} +1 -1
- package/standalone/chunks/{luzmo-icon-markup-ByaNI6dg.js → luzmo-icon-markup-C1Wzxt4b.js} +1 -1
- package/standalone/chunks/nl-DBD8_AIO.js +2 -0
- package/standalone/chunks/{ohlc-chart-options.config-kyYOgBtR.js → ohlc-chart-options.config-DoFcORQY.js} +1 -1
- package/standalone/chunks/{option-interaction-controller-BuwRr21c.js → option-interaction-controller-BfHSkomY.js} +1 -1
- package/standalone/chunks/{parallel-coordinates-plot-options.config-BcIYCRdF.js → parallel-coordinates-plot-options.config-JmTkwzbf.js} +1 -1
- package/standalone/chunks/{pivot-table-options.config-BZpId1ju.js → pivot-table-options.config-mk1a9meE.js} +1 -1
- package/standalone/chunks/{pyramid-chart-options.config-xYIVE_ib.js → pyramid-chart-options.config-DuCSp-ss.js} +1 -1
- package/standalone/chunks/{route-map-options.config-CGBkHnhM.js → route-map-options.config-B73cNABj.js} +1 -1
- package/standalone/chunks/{sankey-diagram-options.config-Curc2-If.js → sankey-diagram-options.config-BsFxRYGh.js} +1 -1
- package/standalone/chunks/scatter-plot-options.config-DiO2UduI.js +2 -0
- package/standalone/chunks/sort-options.config-fFAfPcSI.js +2 -0
- package/standalone/chunks/{spike-map-options.config-CSenlJ_F.js → spike-map-options.config-BpRwiS7U.js} +1 -1
- package/standalone/chunks/sunburst-chart-options.config-TCXdodS8.js +2 -0
- package/standalone/chunks/sunburst-chart-options.de-DabJH9rY.js +2 -0
- package/standalone/chunks/sunburst-chart-options.en-BNJlsmSV.js +2 -0
- package/standalone/chunks/sunburst-chart-options.es-xn2E_v17.js +2 -0
- package/standalone/chunks/sunburst-chart-options.fr-DQR4oaiY.js +2 -0
- package/standalone/chunks/sunburst-chart-options.nl-BZGlfl67.js +2 -0
- package/standalone/chunks/{task-BlhDPTQS.js → task-B6C9QMNJ.js} +1 -1
- package/standalone/chunks/theme-options.config-W0JNb9nG.js +2 -0
- package/standalone/chunks/theme-options.i18n-DtI0eOJ4.js +2 -0
- package/standalone/chunks/{treemap-chart-options.config-DxkumoYq.js → treemap-chart-options.config-CLpDBIB5.js} +1 -1
- package/standalone/chunks/{wordcloud-chart-options.config-b-ibtRWp.js → wordcloud-chart-options.config-Bjw10jRd.js} +1 -1
- package/standalone/interactive-viz-item.js +54 -53
- package/standalone/item-grid.js +1 -1
- package/standalone/manifest.json +92 -87
- package/types/ai-chat.types.d.ts +60 -0
- package/types.d.ts +1 -1
- package/utils/filters/expressions.d.ts +2 -0
- package/utils/slot-state/slot-store.d.ts +3 -8
- package/utils/time/period-over-period-condition.const.d.ts +0 -1
- package/utils/time/period-over-period-context.d.ts +75 -0
- package/utils/time/tests/period-over-period-context.test.d.ts +1 -0
- package/components/ai-chat-BNcSadGI.cjs +0 -393
- package/components/chart-helpers-fMnqHRzC.cjs +0 -20
- package/components/de-KvAhLsm8.cjs +0 -20
- package/components/display-settings-DaZ3CiKB.cjs +0 -143
- package/components/display-settings-period-over-period-B8Ne3lq-.cjs +0 -227
- package/components/donut-chart-options.config-DX-spmaZ.cjs +0 -20
- package/components/es-DVISHTAz.cjs +0 -20
- package/components/filter-expression-picker-Cc3xfiGT.js +0 -432
- package/components/filter-expression-picker-DDSI9bYq.cjs +0 -40
- package/components/filter-item-DQNbp7Qn.cjs +0 -111
- package/components/filter-value-picker-datetime-BVDQ-og5.cjs +0 -51
- package/components/filters-BPbPFOu5.cjs +0 -187
- package/components/fr-BCxcMVQV.cjs +0 -20
- package/components/funnel-chart-options.config-CKp94nx7.cjs +0 -20
- package/components/heat-table-options.config-D21xtaIk.cjs +0 -20
- package/components/interactive-viz-item-ojdH1uk0.cjs +0 -268
- package/components/interactivity-options.config-Bzk2L-qh.cjs +0 -20
- package/components/interactivity-options.config-MuEP5vSt.js +0 -72
- package/components/interactivity-options.i18n-BsYv4Rh9.cjs +0 -20
- package/components/item-slot-drop-DLzi4Dik.cjs +0 -91
- package/components/item-slot-drop-panel-Oh8zdKJH.cjs +0 -57
- package/components/item-slot-picker-O9HKr3mv.cjs +0 -158
- package/components/item-slot-picker-panel-BhhN54IM.cjs +0 -82
- package/components/nl-XotE1MQq.cjs +0 -20
- package/components/slot-menu-C8p0nkVS.cjs +0 -71
- package/components/sunburst-chart-options.config-CZdd6qx0.cjs +0 -20
- package/standalone/chunks/data-broker-DXDyIrj_.js +0 -2
- package/standalone/chunks/de-BkB0q1Eg.js +0 -2
- package/standalone/chunks/display-settings-datetime-BkeiKIVV.js +0 -199
- package/standalone/chunks/display-settings-period-over-period-CqDlOSRn.js +0 -209
- package/standalone/chunks/donut-chart-options.config-DWpePR5V.js +0 -2
- package/standalone/chunks/donut-chart-options.de-IKGJRoDL.js +0 -2
- package/standalone/chunks/donut-chart-options.en-O2IK3YiS.js +0 -2
- package/standalone/chunks/donut-chart-options.es-gKAHuFAU.js +0 -2
- package/standalone/chunks/donut-chart-options.fr-Q-uMrtQG.js +0 -2
- package/standalone/chunks/donut-chart-options.nl-B6v6jK4l.js +0 -2
- package/standalone/chunks/en-63f7j4v7.js +0 -2
- package/standalone/chunks/en-GB-QAmXQf8W.js +0 -2
- package/standalone/chunks/en-US-63f7j4v7.js +0 -2
- package/standalone/chunks/es-Bo0jStZn.js +0 -2
- package/standalone/chunks/fr-Co_qVhhV.js +0 -2
- package/standalone/chunks/funnel-chart-options.config-S1yxc6IG.js +0 -2
- package/standalone/chunks/heat-table-options.config-B4K0Ygug.js +0 -2
- package/standalone/chunks/interactivity-options.config-09eXx6k6.js +0 -2
- package/standalone/chunks/interactivity-options.i18n-BLDCmZkC.js +0 -2
- package/standalone/chunks/item-slot-picker-panel-BOSVFBIy.js +0 -429
- package/standalone/chunks/line-chart-options.config--_LXaPbB.js +0 -2
- package/standalone/chunks/load-data-fields-for-datasets-CDlut-6S.js +0 -25
- package/standalone/chunks/localize-DXRmGRe-.js +0 -2
- package/standalone/chunks/nl-CQz2jrVx.js +0 -2
- package/standalone/chunks/scatter-plot-options.config-DG9Ki-mt.js +0 -2
- package/standalone/chunks/sunburst-chart-options.config-DOBSe3i5.js +0 -2
- package/standalone/chunks/sunburst-chart-options.de-D3iq4Q-m.js +0 -2
- package/standalone/chunks/sunburst-chart-options.en-BUJ_Pr9C.js +0 -2
- package/standalone/chunks/sunburst-chart-options.es-stKrKGz2.js +0 -2
- package/standalone/chunks/sunburst-chart-options.fr-RkBtlMNp.js +0 -2
- package/standalone/chunks/sunburst-chart-options.nl-BUeDNot_.js +0 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t as i}from"./localized-decorator-DosMCCQo.js";import{t as a}from"./luzmoTrashOutline-DXZpJx7f.js";import{a as o,c as s,n as c,r as l}from"./load-data-fields-for-datasets-CDlut-6S.js";import{t as u}from"./luzmoPlus-Dyrrz0v8.js";import{t as d}from"./luzmo-icon-markup-ByaNI6dg.js";import{n as f,u as ee}from"./data-broker-DXDyIrj_.js";import{t as p}from"./localize-DXRmGRe-.js";import{t as te}from"./v4-BxSu4gkw.js";import{html as m,ifDefined as ne,nothing as h,property as g,query as re,repeat as ie,state as _,unsafeCSS as v}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/lit.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/action-button.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/button.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/divider.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/icon.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/menu.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/overlay.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/popover.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/progress-circle.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/tooltip.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/field-label.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/number-field.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/picker.js";import{ElementSizes as y,LuzmoElement as b,SizedMixin as x}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/utils.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/badge.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/select.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/options.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/tags.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/text-field.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/date-time-picker.js";var S=[``,``,``],ae=``;function C(e,t){let n=RegExp(`(${S.join(`|`)})`,`u`),r=[];for(let i of e.replaceAll(ae,``).split(n)){let e=S.indexOf(i);e===-1?i&&r.push(i):r.push(t[e])}return r}var w=()=>[{id:`? = ?`,key:`? = ?`,expression:`? = ?`,name:n(`equals`,{desc:`Filter expression for equals comparison`}),description:n(`equals`,{desc:`Filter expression for equals comparison`}),tiny:n(`eq`,{desc:`Short form of equals comparison`}),type:[`numeric`,`hierarchy`],subtype:[`ip_address`]},{id:`? != ?`,key:`? != ?`,expression:`? != ?`,name:n(`not equals`,{desc:`Filter expression for not equals comparison`}),description:n(`not equals`,{desc:`Filter expression for not equals comparison`}),tiny:n(`not eq`,{desc:`Short form of not equals comparison`}),type:[`numeric`,`hierarchy`],subtype:[`ip_address`]},{id:`? in ?`,key:`? in ?`,expression:`? in ?`,name:n(`is in`,{desc:`Filter expression for in comparison`}),description:n(`is in`,{desc:`Filter expression for in comparison`}),tiny:n(`is in`,{desc:`Filter expression for in comparison`}),type:[`numeric`,`hierarchy`],subtype:[`ip_address`]},{id:`? not in ?`,key:`? not in ?`,expression:`? not in ?`,name:n(`is not in`,{desc:`Filter expression for not in comparison`}),description:n(`is not in`,{desc:`Filter expression for not in comparison`}),tiny:n(`is not in`,{desc:`Filter expression for not in comparison`}),type:[`numeric`,`hierarchy`],subtype:[`ip_address`]},{id:`? like ?`,key:`? like ?`,expression:`? like ?`,name:n(`contains`,{desc:`Filter expression for contains comparison`}),description:n(`contains`,{desc:`Filter expression for contains comparison`}),tiny:n(`cont`,{desc:`Short form of contains comparison in filter expression`}),type:[`hierarchy`],subtype:[`ip_address`]},{id:`? not like ?`,key:`? not like ?`,expression:`? not like ?`,name:n(`does not contain`,{desc:`Filter expression for does not contain comparison`}),description:n(`does not contain`,{desc:`Filter expression for does not contain comparison`}),tiny:n(`not cont`,{desc:`Short form of does not contain comparison in filter expression`}),type:[`hierarchy`],subtype:[`ip_address`]},{id:`? starts with ?`,key:`? starts with ?`,expression:`? starts with ?`,name:n(`starts with`,{desc:`Filter expression for starts with comparison`}),description:n(`starts with`,{desc:`Filter expression for starts with comparison`}),tiny:n(`starts with`,{desc:`Filter expression for starts with comparison`}),type:[`hierarchy`],subtype:[`ip_address`]},{id:`? not starts with ?`,key:`? not starts with ?`,expression:`? not starts with ?`,name:n(`does not start with`,{desc:`Filter expression for does not start with comparison`}),description:n(`does not start with`,{desc:`Filter expression for does not start with comparison`}),tiny:n(`not starts with`,{desc:`Short form of does not start with comparison in filter expression`}),type:[`hierarchy`],subtype:[`ip_address`]},{id:`? ends with ?`,key:`? ends with ?`,expression:`? ends with ?`,name:n(`ends with`,{desc:`Filter expression for ends with comparison`}),description:n(`ends with`,{desc:`Filter expression for ends with comparison`}),tiny:n(`ends with`,{desc:`Filter expression for ends with comparison`}),type:[`hierarchy`],subtype:[`ip_address`]},{id:`? not ends with ?`,key:`? not ends with ?`,expression:`? not ends with ?`,name:n(`does not end with`,{desc:`Filter expression for does not end with comparison`}),description:n(`does not end with`,{desc:`Filter expression for does not end with comparison`}),tiny:n(`not ends with`,{desc:`Short form of does not end with comparison in filter expression`}),type:[`hierarchy`],subtype:[`ip_address`]},{id:`? < ?`,key:`? < ?`,expression:`? < ?`,name:n(`less than`,{desc:`Filter expression for less than comparison`}),description:n(`less than`,{desc:`Filter expression for less than comparison`}),tiny:`<`,type:[`numeric`,`datetime`],subtype:[`ip_address`]},{id:`? <= ?`,key:`? <= ?`,expression:`? <= ?`,name:n(`less than or equal`,{desc:`Filter expression for less than or equal comparison`}),description:n(`less than or equal`,{desc:`Filter expression for less than or equal comparison`}),tiny:`<=`,type:[`numeric`,`datetime`],subtype:[`ip_address`]},{id:`? > ?`,key:`? > ?`,expression:`? > ?`,name:n(`greater than`,{desc:`Filter expression for greater than comparison`}),description:n(`greater than`,{desc:`Filter expression for greater than comparison`}),tiny:`>`,type:[`numeric`,`datetime`],subtype:[`ip_address`]},{id:`? >= ?`,key:`? >= ?`,expression:`? >= ?`,name:n(`greater than or equal`,{desc:`Filter expression for greater than or equal comparison`}),description:n(`greater than or equal`,{desc:`Filter expression for greater than or equal comparison`}),tiny:`>=`,type:[`numeric`,`datetime`],subtype:[`ip_address`]},{id:`? between ?`,key:`? between ?`,expression:`? between ?`,name:n(`is between`,{desc:`Filter expression for between comparison`}),description:n(`is between`,{desc:`Filter expression for between comparison`}),tiny:n(`between`,{desc:`Short form of between comparison in filter expression`}),type:[],subtype:[`ip_address`]},{id:`last_now`,key:`last_now`,expression:`last_now`,name:n(`last (x) periods`,{desc:`Filter expression for last (x) periods`}),description:n(`last (x) periods`,{desc:`Filter expression for last (x) periods`}),tiny:n(`last`,{desc:`Short form of last (x) periods in filter expression`}),type:[`datetime`]},{id:`last_available`,key:`last_available`,expression:`last_available`,name:n(`last (x) available periods`,{desc:`Filter expression for last (x) available periods`}),description:n(`last (x) available periods`,{desc:`Filter expression for last (x) available periods`}),tiny:n(`last available`,{desc:`Short form of last (x) available periods in filter expression`}),type:[`datetime`]},{id:`last_completed`,key:`last_completed`,expression:`last_completed`,name:n(`last completed period`,{desc:`Filter expression for last completed period`}),description:n(`last completed (period)`,{desc:`Filter expression for last completed period`}),tiny:n(`last completed`,{desc:`Short form of last completed period in filter expression`}),type:[`datetime`]},{id:`next_now`,key:`next_now`,expression:`next_now`,name:n(`next (x) periods`,{desc:`Filter expression for next (x) periods`}),description:n(`next (x) periods`,{desc:`Filter expression for next (x) periods`}),tiny:n(`next`,{desc:`Short form of next (x) periods in filter expression`}),type:[`datetime`]},{id:`more_than_ago`,key:`more_than_ago`,expression:`more_than_ago`,name:n(`more than (x) periods ago`,{desc:`Filter expression for more than (x) periods ago`}),description:n(`more than (x) periods ago`,{desc:`Filter expression for more than (x) periods ago`}),tiny:n(`more than ago`,{desc:`Short form of more than (x) periods ago in filter expression`}),type:[`datetime`]},{id:`or_more_ago`,key:`or_more_ago`,expression:`or_more_ago`,name:n(`(x) periods or more ago`,{desc:`Filter expression for (x) periods or more ago`}),description:n(`(x) periods or more ago`,{desc:`Filter expression for (x) periods or more ago`}),tiny:n(`or more ago`,{desc:`Short form of (x) periods or more ago in filter expression`}),type:[`datetime`]},{id:`next_full`,key:`next_full`,expression:`next_full`,name:n(`next full (period)`,{desc:`Filter expression for next full period`}),description:n(`next full (period)`,{desc:`Filter expression for next full period`}),tiny:n(`next full`,{desc:`Short form of next full period in filter expression`}),type:[`datetime`]},{id:`WTD`,key:`to_date`,expression:`to_date`,unit:4,name:n(`week to date`,{desc:`Filter expression for week to date`}),description:n(`week to date`,{desc:`Filter expression for week to date`}),tiny:n(`WTD`,{desc:`Short form of week to date in filter expression`}),type:[`datetime`]},{id:`MTD`,key:`to_date`,expression:`to_date`,unit:3,name:n(`month to date`,{desc:`Filter expression for month to date`}),description:n(`month to date`,{desc:`Filter expression for month to date`}),tiny:n(`MTD`,{desc:`Short form of month to date in filter expression`}),type:[`datetime`]},{id:`QTD`,key:`to_date`,expression:`to_date`,unit:2,name:n(`quarter to date`,{desc:`Filter expression for quarter to date`}),description:n(`quarter to date`,{desc:`Filter expression for quarter to date`}),tiny:n(`QTD`,{desc:`Short form of quarter to date in filter expression`}),type:[`datetime`]},{id:`YTD`,key:`to_date`,expression:`to_date`,unit:1,name:n(`year to date`,{desc:`Filter expression for year to date`}),description:n(`year to date`,{desc:`Filter expression for year to date`}),tiny:n(`YTD`,{desc:`Short form of year to date in filter expression`}),type:[`datetime`]},{id:`? is null`,key:`? is null`,expression:`? is null`,name:n(`is missing`,{desc:`Filter expression for is missing`}),description:n(`is missing`,{desc:`Filter expression for is missing`}),tiny:n(`missing`,{desc:`Short form of is missing in filter expression`}),type:[`numeric`,`datetime`,`hierarchy`,`spatial`],subtype:[`ip_address`]},{id:`? is not null`,key:`? is not null`,expression:`? is not null`,name:n(`is not missing`,{desc:`Filter expression for is not missing`}),description:n(`is not missing`,{desc:`Filter expression for is not missing`}),tiny:n(`not missing`,{desc:`Short form of is not missing in filter expression`}),type:[`numeric`,`datetime`,`hierarchy`,`spatial`],subtype:[`ip_address`]}],oe=(e,t,n)=>{let r=/* @__PURE__ */ new Set([`? in ?`,`? not in ?`]);return!e&&!t?w():w().filter(i=>(e&&i.type.includes(e)||t&&i.subtype?.includes(t))&&!(n&&r.has(i.key)))},se=/* @__PURE__ */ new Set([`last_now`,`last_available`,`next_now`,`more_than_ago`,`or_more_ago`]),ce=/* @__PURE__ */ new Set([`last_completed`,`next_full`]),le=/* @__PURE__ */ new Set([`? is null`,`? is not null`,`to_date`]),ue=/* @__PURE__ */ new Set([`? = ?`,`? != ?`,`? < ?`,`? <= ?`,`? > ?`,`? >= ?`]),de=3,fe=32;function T(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function E(e){return T(e)?typeof e.columnId==`string`||typeof e.column_id==`string`||typeof e.formulaId==`string`||typeof e.formula_id==`string`||typeof e.formula==`string`||(typeof e.datasetId==`string`||typeof e.dataset_id==`string`)&&(e.columnExpression!==void 0||e.expression!==void 0):!1}function pe(e){return e.length<=fe?{display:e,truncated:!1}:{display:`${e.slice(0,31)}…`,truncated:!0}}function D(e,t,n){try{return new Intl.ListFormat(e||void 0,{style:`long`,type:n}).format(t)}catch{return t.join(`, `)}}function O(e,t,n){let r=De(e,t,n),{display:i,truncated:a}=pe(r);return{label:i,full:r,truncated:a}}function me(t){return t===1?n(`1 item`,{desc:`One selected hierarchy value whose name is still loading`}):n(e`${t} items`,{desc:`Selected hierarchy values whose names are still loading`})}function he(){return n(`Some item names could not be retrieved`,{desc:`Tooltip when a hierarchy filter value is still an id after name lookup`})}function ge(e,t){return!!(t?.type===`hierarchy`&&t.datasetId&&t.fieldId&&!(T(e)&&e.name!==void 0)&&A(e))}function _e(e,t,n){let r=n?.datasetId,i=n?.fieldId;return!r||!i?[]:e.flatMap(e=>{if(!ge(e,n))return[];let a=A(e);return a?t.hierarchyLabels?.get(Ee(r,i,a))?[]:[a]:[]})}function ve(e,t,n){return n.hierarchyLabelsLoading&&t.length>0?{valueText:me(t.length),valuePending:!0}:n.hierarchyLabels&&!n.hierarchyLabelsLoading&&t.length>0&&!e.valueTooltip?{...e,valueTooltip:he()}:e}function ye(t,r,i){let a=t.map(e=>O(e,r,i)),o=a.map(e=>e.full),s=D(r.contentLanguage,o,`conjunction`);if(t.length===1){let[e]=a;return{valueText:e.label,valueTooltip:e.truncated?e.full:void 0}}let c=Math.min(de,a.length),l=a.length-c,u=a.slice(0,c).map(e=>e.label),d=a.some(e=>e.truncated),f;if(l>0){let t=D(r.contentLanguage,u,`unit`);f=n(e`${t}, and ${l} more`,{desc:`Filter values after the first few shown in a read-only sentence, e.g. "Dresses, Shoes, Shorts, and 1 more"`})}else f=D(r.contentLanguage,a.map(e=>e.label),`conjunction`);return{valueText:f,valueTooltip:l>0||d?s:void 0}}function k(e,t,n){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`){let t=String(e);return t.length>0?t:n}if(e&&typeof e==`object`){let n=p(e,t);if(n)return n}return n}function be(e,t){for(let n of t){let t=e[n];if(typeof t==`string`&&t.length>0)return t}}function xe(e,t){let n=be(e,[`datasetId`,`dataset_id`]),r=be(e,[`columnId`,`column_id`]),i=be(e,[`formulaId`,`formula_id`]),a=typeof e.formula==`string`?e.formula:void 0,o=t.datasets.find(e=>e.id===n),s=o?k(o.name,t.contentLanguage,``):``;if(i){let e=o?.formulas?.find(e=>e.id===i),r=k(e?.name,t.contentLanguage,i);return{label:r,tooltip:s?`${s} · ${r}`:r,type:e?.type,subtype:e?.subtype,formula:!0,datasetId:n,fieldId:i}}if(a)return{label:a,tooltip:s?`${s} · ${a}`:a,formula:!0,datasetId:n};let c=!r&&typeof e.expression==`string`?e.expression:void 0;if(c)return{label:c,tooltip:s?`${s} · ${c}`:c,formula:!0,datasetId:n};let l=r?o?.columns?.find(e=>e.id===r):void 0,u=r??(typeof e.columnExpression==`string`?e.columnExpression:``),d=k(l?.name,t.contentLanguage,u);return{label:d,tooltip:s?`${s} · ${d}`:d,type:l?.type,subtype:l?.subtype,formula:!1,datasetId:n,fieldId:r}}function Se(e){let t=o.find(t=>t.level===e);return t?t.i18n():``}function Ce(t,r){switch(r){case 1:return t===1?n(e`${t} Year`,{desc:`Singular relative filter quantity in years`}):n(e`${t} Years`,{desc:`Plural relative filter quantity in years`});case 2:return t===1?n(e`${t} Quarter`,{desc:`Singular relative filter quantity in quarters`}):n(e`${t} Quarters`,{desc:`Plural relative filter quantity in quarters`});case 3:return t===1?n(e`${t} Month`,{desc:`Singular relative filter quantity in months`}):n(e`${t} Months`,{desc:`Plural relative filter quantity in months`});case 4:return t===1?n(e`${t} Week`,{desc:`Singular relative filter quantity in weeks`}):n(e`${t} Weeks`,{desc:`Plural relative filter quantity in weeks`});case 5:return t===1?n(e`${t} Day`,{desc:`Singular relative filter quantity in days`}):n(e`${t} Days`,{desc:`Plural relative filter quantity in days`});case 6:return t===1?n(e`${t} Hour`,{desc:`Singular relative filter quantity in hours`}):n(e`${t} Hours`,{desc:`Plural relative filter quantity in hours`});case 7:return t===1?n(e`${t} Minute`,{desc:`Singular relative filter quantity in minutes`}):n(e`${t} Minutes`,{desc:`Plural relative filter quantity in minutes`});case 8:return t===1?n(e`${t} Second`,{desc:`Singular relative filter quantity in seconds`}):n(e`${t} Seconds`,{desc:`Plural relative filter quantity in seconds`});case 9:return t===1?n(e`${t} Millisecond`,{desc:`Singular relative filter quantity in milliseconds`}):n(e`${t} Milliseconds`,{desc:`Plural relative filter quantity in milliseconds`});default:return n(e`${t}`,{desc:`Relative filter quantity`})}}function we(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))return e;try{return new Intl.DateTimeFormat(t.contentLanguage||void 0,{dateStyle:`medium`,timeStyle:`short`,...t.timeZone?{timeZone:t.timeZone}:{}}).format(n)}catch{return e}}function Te(e){return/^\d{4}-\d{2}-\d{2}(?:T|$)/.test(e)}function Ee(e,t,n){return`${e}:${t}:${n}`}function A(e){if(typeof e==`string`||typeof e==`number`)return String(e);if(T(e)&&(typeof e.id==`string`||typeof e.id==`number`))return String(e.id)}function De(e,t,n){if(n?.type===`hierarchy`&&n.datasetId&&n.fieldId&&!(T(e)&&e.name!==void 0)){let r=A(e),i=r===void 0?void 0:t.hierarchyLabels?.get(Ee(n.datasetId,n.fieldId,r));if(i)return i}if(typeof e==`number`&&Number.isFinite(e))return new Intl.NumberFormat(t.contentLanguage||void 0).format(e);if(typeof e==`string`)return Te(e)?we(e,t):e;if(typeof e==`boolean`)return String(e);if(T(e)){if(typeof e.parameter==`string`)return e.parameter;if(e.name!==void 0){let n=k(e.name,t.contentLanguage,``);if(n)return n}if(typeof e.id==`string`||typeof e.id==`number`)return String(e.id)}return``}function Oe(e,t){let n=w().filter(t=>t.expression===e),r=T(t)&&typeof t.unit==`number`?t.unit:void 0;return(e===`to_date`&&r!==void 0?n.find(e=>e.unit===r)??n[0]:n[0])?.tiny??e}function ke(t,r,i,a){if(le.has(t)||r==null)return{valueText:``};if(T(r)&&typeof r.parameter==`string`){let e=r.parameter;if(!E(r))return{valueText:e}}if(ue.has(t)&&E(r))return{valueText:``,valueField:xe(r,i)};if(t===`? between ?`&&Array.isArray(r)&&r.length===2){let t=O(r[0],i,a),o=O(r[1],i,a);return ve({valueText:n(e`${t.label} and ${o.label}`,{desc:`Inclusive range shown between two filter values`}),valueTooltip:t.truncated||o.truncated?n(e`${t.full} and ${o.full}`,{id:`filter-range-tooltip`,desc:`Full inclusive range shown in a tooltip`}):void 0},_e(r,i,a),i)}if(se.has(t)&&T(r))return{valueText:Ce(typeof r.quantity==`number`?r.quantity:1,r.unit)};if(ce.has(t)&&T(r))return{valueText:Se(r.unit)};if(Array.isArray(r))return r.length===0?{valueText:``}:ve(ye(r,i,a),_e(r,i,a),i);let o=O(r,i,a);return ve({valueText:o.label,valueTooltip:o.truncated?o.full:void 0},_e([r],i,a),i)}function Ae(e,t){let n=e.parameters?.[0];if(!T(n)||!E(n))return null;let r=xe(n,t),i=typeof e.expression==`string`?e.expression:``,a=e.parameters?.[1];return{field:r,expression:i?Oe(i,a):``,...ke(i,a,t,r)}}function je(e){return`condition`in e&&`filters`in e}function Me(e){if(e==null)return[];if(Array.isArray(e))return e.flatMap(Me);if(T(e)){if(typeof e.parameter==`string`||e.name!==void 0||E(e))return[];let t=A(e);return t?[t]:[]}let t=A(e);return t?[t]:[]}function Ne(e,t){let n=/* @__PURE__ */ new Map,r=e=>{if(je(e)){e.filters.forEach(r);return}let i=e.parameters?.[0];if(!T(i)||!E(i))return;let a=xe(i,t);if(a.type!==`hierarchy`||!a.datasetId||!a.fieldId)return;let o=[...new Set(Me(e.parameters?.[1]))];if(o.length===0)return;let s=`${a.datasetId}:${a.fieldId}`,c=n.get(s);c?c.ids=[.../* @__PURE__ */ new Set([...c.ids,...o])]:n.set(s,{datasetId:a.datasetId,...a.formula?{formulaId:a.fieldId}:{columnId:a.fieldId},ids:o})};return r(e),[...n.values()]}async function Pe(e,t){let n=/* @__PURE__ */ new Map;return await Promise.all(e.map(async e=>{let r={dataset_id:e.datasetId,column_id:e.columnId,formula_id:e.formulaId},i=await f.fetchData({dimensions:[r],where:[{expression:`? in ?`,parameters:[r,e.ids]}],limit:{by:e.ids.length,offset:0}}),a=e.columnId??e.formulaId??``;for(let r of i.data??[]){let i=r[0],o=i&&typeof i==`object`&&`id`in i?String(i.id):String(i),s=i&&typeof i==`object`&&`name`in i?p(i.name,t):``;s&&n.set(Ee(e.datasetId,a,o),s)}})),n}var Fe=20,j=class extends Error{constructor(e){super(e),this.name=`FilterUnrepresentableError`}},Ie=/* @__PURE__ */ new Set([`and`,`or`]),Le=[`datasetId`,`dataset_id`,`columnId`,`column_id`,`formulaId`,`formula_id`,`formula`,`columnExpression`,`value`,`ignoredItemIds`];function M(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function N(e){return!M(e)||e.condition!==void 0&&(typeof e.condition!=`string`||!Ie.has(e.condition.toLowerCase()))?!1:`filters`in e||`subGroups`in e}function P(e){return M(e)&&`expression`in e&&!(`condition`in e)}function F(e){return Le.some(t=>t in e)}function Re(e,t=!1){let n=[e.columnId!==void 0||e.column_id!==void 0,e.formulaId!==void 0||e.formula_id!==void 0,e.formula!==void 0].filter(Boolean).length;return n===1?!0:n>1?!1:e.columnExpression!==void 0||t&&e.expression!==void 0}function ze(e){return!P(e)||typeof e.expression!=`string`||e.expression.length===0||`parameters`in e||typeof e.datasetId!=`string`&&typeof e.dataset_id!=`string`?!1:Re(e)}function Be(e){return!P(e)||!Array.isArray(e.parameters)?!1:!F(e)}function Ve(e){if(!(`parameters`in e))return;let t=Le.find(t=>t in e);if(t!==void 0)throw new j(`Filter leaf mixes "parameters" with the clean inline key "${t}".`)}function He(e){throw typeof e.expression!=`string`||e.expression.length===0?new j(`Clean filter leaf is missing a non-empty "expression".`):typeof e.datasetId!=`string`&&typeof e.dataset_id!=`string`?new j(`Clean filter leaf "${e.expression}" is missing a "datasetId".`):new j(`Clean filter leaf "${e.expression}" must name exactly one of "columnId", "formulaId", "formula", or "columnExpression".`)}function Ue(e){return e===`where`||e===`having`}function I(e){if(e>20)throw new j(`Filter nesting exceeds the maximum depth of 20.`)}function We(e){if(e==null)return`empty`;if(!Array.isArray(e))return`unknown`;if(e.length===0)return`empty`;let t=!1,n=!1,r=!1,i=(e,a)=>{if(a>20)r=!0;else if(N(e)){Ue(e.clause)&&(n=!0);let t=[...Array.isArray(e.filters)?e.filters:[],...Array.isArray(e.subGroups)?e.subGroups:[]];for(let e of t)i(e,a+1)}else P(e)?`parameters`in e&&F(e)?r=!0:ze(e)?n=!0:Be(e)?t=!0:r=!0:r=!0};for(let t of e)i(t,1);return r?`unknown`:n&&t?`mixed`:n?`clean`:t?`canonical`:`empty`}var Ge=/* @__PURE__ */ new Set([`? is null`,`? is not null`]),Ke=/* @__PURE__ */ new Set([`? = ?`,`? != ?`,`? < ?`,`? <= ?`,`? > ?`,`? >= ?`]),qe=/* @__PURE__ */ new Set([`? in ?`,`? not in ?`,`? between ?`]),Je={"array[numeric]":`numeric[]`,"array[hierarchy]":`hierarchy[]`,"array[datetime]":`datetime[]`},Ye=/* @__PURE__ */ new Set([`level`,`lowestLevel`,`unnest`,`discretization`,`aggregation`,`index`,`include_nonoccurring`,`simplification`]);function L(e,t){return e!==`lowestLevel`&&!(t===null&&Ye.has(e))}function R(e){return structuredClone(e)}function Xe(e){let t=e.datasetId??e.dataset_id;if(typeof t!=`string`||t.length===0)throw new j(`Filter reference is missing a "datasetId".`);return t}function Ze(e){return M(e)?typeof e.columnId==`string`||typeof e.column_id==`string`||typeof e.formulaId==`string`||typeof e.formula_id==`string`||typeof e.formula==`string`||(typeof e.datasetId==`string`||typeof e.dataset_id==`string`)&&(e.columnExpression!==void 0||e.expression!==void 0):!1}function Qe(e){let t={type:e.type};return e.bins!==void 0&&(t.bins=e.bins),Array.isArray(e.over)&&(t.over=e.over.map(e=>it(e))),t}function $e(e){let t={type:e.type},n=e.datasetId??e.dataset_id,r=e.columnId??e.column_id;return n!==void 0&&(t.datasetId=n),r!==void 0&&(t.columnId=r),e.level!==void 0&&L(`level`,e.level)&&(t.level=e.level),M(e.discretization)&&(t.discretization=Qe(e.discretization)),e.unnest!==void 0&&L(`unnest`,e.unnest)&&(t.unnest=e.unnest),t}function et(e){let t={type:e.type};return e.bins!==void 0&&(t.bins=e.bins),Array.isArray(e.over)&&(t.over=e.over.map(e=>M(e)?z(e):e)),t}function tt(e){let t={type:e.type},n=e.datasetId??e.dataset_id,r=e.columnId??e.column_id;return n!==void 0&&(t.datasetId=n),r!==void 0&&(t.columnId=r),e.level!==void 0&&(t.level=e.level),M(e.discretization)&&(t.discretization=et(e.discretization)),e.unnest!==void 0&&(t.unnest=e.unnest),t}function nt(e,t){e.level!==void 0&&(t.level=R(e.level)),M(e.discretization)&&(t.discretization=et(e.discretization)),M(e.aggregation)&&(t.aggregation=tt(e.aggregation)),e.unnest!==void 0&&(t.unnest=R(e.unnest))}function rt(e,t){let n=e.columnId??e.column_id;if(n!==void 0)return{kind:`columnId`,value:n};let r=e.formulaId??e.formula_id;if(r!==void 0)return{kind:`formulaId`,value:r};if(e.formula!==void 0)return{kind:`formula`,value:e.formula};let i=e.columnExpression??(t?e.expression:void 0);if(i!==void 0)return{kind:`expression`,value:i}}function z(e,t=!0){let n={datasetId:Xe(e)},r=rt(e,t);return r!==void 0&&(r.kind===`expression`?n.expression=r.value:n[r.kind]=r.value),nt(e,n),n}function it(e){if(!M(e))throw new j(`Cannot emit a clean filter reference.`);let t={datasetId:Xe(e)};e.level!==void 0&&L(`level`,e.level)&&(t.level=e.level),M(e.discretization)&&(t.discretization=Qe(e.discretization)),M(e.aggregation)&&(t.aggregation=$e(e.aggregation)),e.unnest!==void 0&&L(`unnest`,e.unnest)&&(t.unnest=e.unnest);let n=rt(e,!0);if(n===void 0)throw new j(`Cannot emit a clean filter reference: no column, formula, or expression.`);return n.kind===`expression`?t.columnExpression=n.value:t[n.kind]=n.value,t}function at(e){if(!M(e)||typeof e.parameter!=`string`||typeof e.type!=`string`)return e;let t=Je[e.type];return t===void 0?e:{...e,type:t}}function ot(e,t){return M(t)&&typeof t.parameter==`string`?!0:Array.isArray(t)?e!==`? between ?`||t.length===2:!1}function st(e,t){let n=e.expression,r=[z(e,!1)];if(!Ge.has(n)&&e.value!==void 0){let t=Ke.has(n)&&Ze(e.value);r.push(t?z(e.value):R(e.value))}let i={};typeof e.id==`string`&&(i.id=e.id),`ignoredItemIds`in e&&(i.ignore=R(e.ignoredItemIds)),t!==void 0&&(i.type=t);let a={expression:n,parameters:r};return Object.keys(i).length>0&&(a.properties=i),a}function ct(e){let{expression:t}=e;if(typeof t!=`string`||t.length===0)return null;let n=Array.isArray(e.parameters)?e.parameters:[];if(!M(n[0]))throw new j(`Cannot emit a clean filter reference for "${t}".`);let r={...it(n[0]),expression:t};if(!Ge.has(t)){let e=n[1];if(e===void 0)throw new j(`Filter "${t}" is missing its value operand.`);if(r.value=Ze(e)&&Ke.has(t)?it(e):at(R(e)),qe.has(t)&&!ot(t,r.value))throw new j(`Cannot emit an invalid clean filter value for "${t}".`)}let{properties:i}=e;return i?.id!==void 0&&(r.id=i.id),i!==void 0&&`ignore`in i&&(r.ignoredItemIds=R(i.ignore)),r}function lt(e){return N(e)}function ut(e){return Array.isArray(e.filters)?e.filters:[]}function dt(e,t){return e.properties?.type===`having`||e.properties?.type===`where`?e.properties.type:t??`where`}function B(e,t,n=1,r=/* @__PURE__ */ new Set){I(n);let i=e.clause??t;for(let t of ut(e))lt(t)?B(t,i,n+1,r):typeof t.expression==`string`&&t.expression.length>0&&r.add(dt(t,i));return r}function ft(e,t,n=1){I(n);let r=e.clause??t;if(e.condition===`or`&&B(e,r,n).size>1)throw new j(`An "or" group mixes "where" and "having" filters, which clean output cannot represent.`);for(let t of ut(e))lt(t)&&ft(t,r,n+1)}function pt(e,t,n,r=1){I(r);let i=e.clause??n,a=[];for(let n of ut(e)){if(lt(n)){let e=pt(n,t,i,r+1);e.filters.length>0&&a.push(e);continue}if(dt(n,i)!==t)continue;let e=ct(n);e&&a.push(e)}let o={condition:e.condition===`or`?`or`:`and`,filters:a};return e.id!==void 0&&B(e,i,r).size<=1&&(o.id=e.id),o}function mt(e){let t=e.clause;ft(e,t);let n=B(e,t);return n.size===0&&n.add(t??`where`),[`where`,`having`].filter(e=>n.has(e)).map(n=>({...pt(e,n,t),clause:n})).filter(e=>e.filters.length>0)}var ht=[`origin`,`datasetId`,`vizId`,`itemId`,`isDrilldown`,`type`];function gt(e){return typeof e==`string`&&e.toLowerCase()===`or`?`or`:`and`}function _t(e){return N(e)}function vt(e){if(!Array.isArray(e)||e.length===0)return[];let t=M(e[0])?e[0]:void 0,n=e.length>1?e[1]:void 0;return e.length>1?[t,n]:[t]}function yt(e){if(typeof e.expression!=`string`||e.expression.length===0)return null;let t={expression:e.expression,parameters:vt(e.parameters)};return e.properties!==void 0&&Object.keys(e.properties).length>0&&(t.properties=structuredClone(e.properties)),t}function bt(e,t){let n=e,r=t;for(let e of ht)n[e]!==void 0&&(r[e]=n[e])}function xt(e){if(!e||!e.filters)return{condition:`and`,filters:[],subGroups:[]};let t=[],n=[];for(let r of e.filters)if(_t(r))n.push(xt(r));else{let e=yt(r);e&&t.push(e)}let r={condition:gt(e.condition),filters:t,subGroups:n};return e.id!==void 0&&(r.id=e.id),bt(e,r),r}function St(e,t){return e?t?.format===`clean`?mt(e):[xt(e)]:[]}function Ct(e,t){let n={expression:typeof e.expression==`string`?e.expression:void 0,parameters:Array.isArray(e.parameters)?[...e.parameters]:[]},r=M(e.properties)?structuredClone(e.properties):{};return t!==void 0&&r.type===void 0&&(r.type=t),Object.keys(r).length>0&&(n.properties=r),n}function wt(e,t,n){if(N(e))return Tt(e,t,n);if(!M(e))return;let r=e.expression;if(Ve(e),ze(e))return st(e,t);if(F(e)&&He(e),Be(e))return Ct(e,t);throw new j(`Filter leaf "${String(r)}" matches neither a complete clean nor a complete canonical encoding.`)}function Tt(e,t,n){I(n);let r=Ue(e.clause)?e.clause:void 0,i=r??t,a=[];for(let t of Array.isArray(e.filters)?e.filters:[]){let e=wt(t,i,n+1);e!==void 0&&a.push(e)}for(let t of Array.isArray(e.subGroups)?e.subGroups:[])N(t)&&a.push(Tt(t,i,n+1));let o={condition:gt(e.condition),filters:a};return typeof e.id==`string`&&(o.id=e.id),r!==void 0&&(o.clause=r),bt(e,o),o}function Et(e){return!e||e.length===0?[]:e.filter(e=>N(e)).map(e=>Tt(e,void 0,1))}var Dt=`:host{font-family:var(--luzmo-font-family)}luzmo-select{width:100%}:host{--var:blue}`,V=class extends r(x(b,{validSizes:Object.values(y)})){constructor(...e){super(...e),this.hasLabel=!1,this.allowEmpty=!1,this.placeholder=``,this.disabled=!1,this.readonly=!1,this.quiet=!1,this.invalid=!1,this.isFormula=!1,this._expressionConfigurations=w()}static get styles(){return[v(Dt)]}_sendChangeEvent(){if(this.disabled||this.readonly)return;let e={expression:this.filter?.expression};this.filter?.parameters?.[1]?.unit&&(e.unit=this.filter?.parameters?.[1]?.unit),this.dispatchEvent(new CustomEvent(`luzmo-expression-selected`,{bubbles:!0,composed:!0,cancelable:!0,detail:e}))}setExpression(e){this._richExpression=e?.detail?.value?.[0];let t=this._expressionConfigurations.find(e=>e.id===this._richExpression),n=structuredClone(this.filter);n.expression=t?.expression,t?.unit&&(this._unit=t.unit,n?.parameters[0]&&(n.parameters[1]={unit:this._unit})),this.filter=n,this._sendChangeEvent()}willUpdate(e){super.willUpdate(e);let t=e.has(`filter`),n=e.has(`type`),r=e.has(`subtype`),i=e.has(`isFormula`),a=oe(this.type,this.subtype,this.isFormula),o=[`YTD`,`QTD`,`MTD`,`WTD`];if(this.filter?.expression===`to_date`){let e=this.filter?.parameters[1]?.unit??1;this._unit=e,this._richExpression=o[e-1]??`YTD`}else this._richExpression=this.filter?.expression;(n||r||i||t)&&this.filter&&!this.disabled&&!this.readonly&&!a?.find(e=>e.expression===this.filter?.expression)?(this.invalid=!0,console.warn(`Warning: ${this.filter?.expression} is not valid given the type: ${this.type} and subtype: ${this.subtype}`)):this.invalid=!1,!this.filter?.expression&&!this.allowEmpty&&(this._richExpression=a?.[0]?.id,this.filter={...this.filter,expression:this._richExpression},this._sendChangeEvent())}render(){let e=oe(this.type,this.subtype,this.isFormula)?.map(e=>({value:e.id,label:e.description,shortLabel:e.tiny})),t=this.disabled||!this.filter?.expression&&!this.allowEmpty,r=m`<luzmo-field-label
|
|
2
|
+
import{i as e,n as t,r as n,t as r}from"./localized-mixin-CLvEZO1g.js";import{t as i}from"./localized-decorator-C2ufmkVS.js";import{t as a}from"./luzmoTrashOutline-DXZpJx7f.js";import{a as o,c as s,n as c,r as l}from"./load-data-fields-for-datasets-Df6IGwne.js";import{t as u}from"./luzmoPlus-Dyrrz0v8.js";import{t as d}from"./luzmo-icon-markup-C1Wzxt4b.js";import{y as f}from"./chart-helpers-CKlLA7d7.js";import{n as p}from"./data-broker-CUCszU0S.js";import{t as m}from"./localize-DIWFho02.js";import{t as ee}from"./v4-BxSu4gkw.js";import{html as h,ifDefined as te,nothing as g,property as _,query as ne,repeat as re,state as v,unsafeCSS as y}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/lit.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/action-button.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/button.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/divider.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/icon.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/menu.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/overlay.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/popover.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/progress-circle.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/tooltip.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/field-label.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/number-field.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/picker.js";import{ElementSizes as b,LuzmoElement as x,SizedMixin as S}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/utils.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/badge.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/select.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/options.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/tags.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/text-field.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/date-time-picker.js";var C=[``,``,``],ie=``;function w(e,t){let n=RegExp(`(${C.join(`|`)})`,`u`),r=[];for(let i of e.replaceAll(ie,``).split(n)){let e=C.indexOf(i);e===-1?i&&r.push(i):r.push(t[e])}return r}var T=()=>[{id:`? = ?`,key:`? = ?`,expression:`? = ?`,name:n(`equals`,{desc:`Filter expression for equals comparison`}),description:n(`equals`,{desc:`Filter expression for equals comparison`}),tiny:n(`eq`,{desc:`Short form of equals comparison`}),type:[`numeric`,`hierarchy`],subtype:[`ip_address`]},{id:`? != ?`,key:`? != ?`,expression:`? != ?`,name:n(`not equals`,{desc:`Filter expression for not equals comparison`}),description:n(`not equals`,{desc:`Filter expression for not equals comparison`}),tiny:n(`not eq`,{desc:`Short form of not equals comparison`}),type:[`numeric`,`hierarchy`],subtype:[`ip_address`]},{id:`? in ?`,key:`? in ?`,expression:`? in ?`,name:n(`is in`,{desc:`Filter expression for in comparison`}),description:n(`is in`,{desc:`Filter expression for in comparison`}),tiny:n(`is in`,{desc:`Filter expression for in comparison`}),type:[`numeric`,`hierarchy`],subtype:[`ip_address`]},{id:`? not in ?`,key:`? not in ?`,expression:`? not in ?`,name:n(`is not in`,{desc:`Filter expression for not in comparison`}),description:n(`is not in`,{desc:`Filter expression for not in comparison`}),tiny:n(`is not in`,{desc:`Filter expression for not in comparison`}),type:[`numeric`,`hierarchy`],subtype:[`ip_address`]},{id:`? like ?`,key:`? like ?`,expression:`? like ?`,name:n(`contains`,{desc:`Filter expression for contains comparison`}),description:n(`contains`,{desc:`Filter expression for contains comparison`}),tiny:n(`cont`,{desc:`Short form of contains comparison in filter expression`}),type:[`hierarchy`],subtype:[`ip_address`]},{id:`? not like ?`,key:`? not like ?`,expression:`? not like ?`,name:n(`does not contain`,{desc:`Filter expression for does not contain comparison`}),description:n(`does not contain`,{desc:`Filter expression for does not contain comparison`}),tiny:n(`not cont`,{desc:`Short form of does not contain comparison in filter expression`}),type:[`hierarchy`],subtype:[`ip_address`]},{id:`? starts with ?`,key:`? starts with ?`,expression:`? starts with ?`,name:n(`starts with`,{desc:`Filter expression for starts with comparison`}),description:n(`starts with`,{desc:`Filter expression for starts with comparison`}),tiny:n(`starts with`,{desc:`Filter expression for starts with comparison`}),type:[`hierarchy`],subtype:[`ip_address`]},{id:`? not starts with ?`,key:`? not starts with ?`,expression:`? not starts with ?`,name:n(`does not start with`,{desc:`Filter expression for does not start with comparison`}),description:n(`does not start with`,{desc:`Filter expression for does not start with comparison`}),tiny:n(`not starts with`,{desc:`Short form of does not start with comparison in filter expression`}),type:[`hierarchy`],subtype:[`ip_address`]},{id:`? ends with ?`,key:`? ends with ?`,expression:`? ends with ?`,name:n(`ends with`,{desc:`Filter expression for ends with comparison`}),description:n(`ends with`,{desc:`Filter expression for ends with comparison`}),tiny:n(`ends with`,{desc:`Filter expression for ends with comparison`}),type:[`hierarchy`],subtype:[`ip_address`]},{id:`? not ends with ?`,key:`? not ends with ?`,expression:`? not ends with ?`,name:n(`does not end with`,{desc:`Filter expression for does not end with comparison`}),description:n(`does not end with`,{desc:`Filter expression for does not end with comparison`}),tiny:n(`not ends with`,{desc:`Short form of does not end with comparison in filter expression`}),type:[`hierarchy`],subtype:[`ip_address`]},{id:`? < ?`,key:`? < ?`,expression:`? < ?`,name:n(`less than`,{desc:`Filter expression for less than comparison`}),description:n(`less than`,{desc:`Filter expression for less than comparison`}),tiny:`<`,type:[`numeric`,`datetime`],subtype:[`ip_address`]},{id:`? <= ?`,key:`? <= ?`,expression:`? <= ?`,name:n(`less than or equal`,{desc:`Filter expression for less than or equal comparison`}),description:n(`less than or equal`,{desc:`Filter expression for less than or equal comparison`}),tiny:`<=`,type:[`numeric`,`datetime`],subtype:[`ip_address`]},{id:`? > ?`,key:`? > ?`,expression:`? > ?`,name:n(`greater than`,{desc:`Filter expression for greater than comparison`}),description:n(`greater than`,{desc:`Filter expression for greater than comparison`}),tiny:`>`,type:[`numeric`,`datetime`],subtype:[`ip_address`]},{id:`? >= ?`,key:`? >= ?`,expression:`? >= ?`,name:n(`greater than or equal`,{desc:`Filter expression for greater than or equal comparison`}),description:n(`greater than or equal`,{desc:`Filter expression for greater than or equal comparison`}),tiny:`>=`,type:[`numeric`,`datetime`],subtype:[`ip_address`]},{id:`? between ?`,key:`? between ?`,expression:`? between ?`,name:n(`is between`,{desc:`Filter expression for between comparison`}),description:n(`is between`,{desc:`Filter expression for between comparison`}),tiny:n(`between`,{desc:`Short form of between comparison in filter expression`}),type:[],subtype:[`ip_address`]},{id:`last_now`,key:`last_now`,expression:`last_now`,name:n(`last (x) periods`,{desc:`Filter expression for last (x) periods`}),description:n(`last (x) periods`,{desc:`Filter expression for last (x) periods`}),tiny:n(`last`,{desc:`Short form of last (x) periods in filter expression`}),type:[`datetime`]},{id:`last_available`,key:`last_available`,expression:`last_available`,name:n(`last (x) available periods`,{desc:`Filter expression for last (x) available periods`}),description:n(`last (x) available periods`,{desc:`Filter expression for last (x) available periods`}),tiny:n(`last available`,{desc:`Short form of last (x) available periods in filter expression`}),type:[`datetime`]},{id:`last_completed`,key:`last_completed`,expression:`last_completed`,name:n(`last completed period`,{desc:`Filter expression for last completed period`}),description:n(`last completed (period)`,{desc:`Filter expression for last completed period`}),tiny:n(`last completed`,{desc:`Short form of last completed period in filter expression`}),type:[`datetime`]},{id:`next_now`,key:`next_now`,expression:`next_now`,name:n(`next (x) periods`,{desc:`Filter expression for next (x) periods`}),description:n(`next (x) periods`,{desc:`Filter expression for next (x) periods`}),tiny:n(`next`,{desc:`Short form of next (x) periods in filter expression`}),type:[`datetime`]},{id:`more_than_ago`,key:`more_than_ago`,expression:`more_than_ago`,name:n(`more than (x) periods ago`,{desc:`Filter expression for more than (x) periods ago`}),description:n(`more than (x) periods ago`,{desc:`Filter expression for more than (x) periods ago`}),tiny:n(`more than ago`,{desc:`Short form of more than (x) periods ago in filter expression`}),type:[`datetime`]},{id:`or_more_ago`,key:`or_more_ago`,expression:`or_more_ago`,name:n(`(x) periods or more ago`,{desc:`Filter expression for (x) periods or more ago`}),description:n(`(x) periods or more ago`,{desc:`Filter expression for (x) periods or more ago`}),tiny:n(`or more ago`,{desc:`Short form of (x) periods or more ago in filter expression`}),type:[`datetime`]},{id:`next_full`,key:`next_full`,expression:`next_full`,name:n(`next full (period)`,{desc:`Filter expression for next full period`}),description:n(`next full (period)`,{desc:`Filter expression for next full period`}),tiny:n(`next full`,{desc:`Short form of next full period in filter expression`}),type:[`datetime`]},{id:`WTD`,key:`to_date`,expression:`to_date`,unit:4,name:n(`week to date`,{desc:`Filter expression for week to date`}),description:n(`week to date`,{desc:`Filter expression for week to date`}),tiny:n(`WTD`,{desc:`Short form of week to date in filter expression`}),type:[`datetime`]},{id:`MTD`,key:`to_date`,expression:`to_date`,unit:3,name:n(`month to date`,{desc:`Filter expression for month to date`}),description:n(`month to date`,{desc:`Filter expression for month to date`}),tiny:n(`MTD`,{desc:`Short form of month to date in filter expression`}),type:[`datetime`]},{id:`QTD`,key:`to_date`,expression:`to_date`,unit:2,name:n(`quarter to date`,{desc:`Filter expression for quarter to date`}),description:n(`quarter to date`,{desc:`Filter expression for quarter to date`}),tiny:n(`QTD`,{desc:`Short form of quarter to date in filter expression`}),type:[`datetime`]},{id:`YTD`,key:`to_date`,expression:`to_date`,unit:1,name:n(`year to date`,{desc:`Filter expression for year to date`}),description:n(`year to date`,{desc:`Filter expression for year to date`}),tiny:n(`YTD`,{desc:`Short form of year to date in filter expression`}),type:[`datetime`]},{id:`? is null`,key:`? is null`,expression:`? is null`,name:n(`is missing`,{desc:`Filter expression for is missing`}),description:n(`is missing`,{desc:`Filter expression for is missing`}),tiny:n(`missing`,{desc:`Short form of is missing in filter expression`}),type:[`numeric`,`datetime`,`hierarchy`,`spatial`],subtype:[`ip_address`]},{id:`? is not null`,key:`? is not null`,expression:`? is not null`,name:n(`is not missing`,{desc:`Filter expression for is not missing`}),description:n(`is not missing`,{desc:`Filter expression for is not missing`}),tiny:n(`not missing`,{desc:`Short form of is not missing in filter expression`}),type:[`numeric`,`datetime`,`hierarchy`,`spatial`],subtype:[`ip_address`]}],ae=(e,t,n)=>{let r=/* @__PURE__ */ new Set([`? in ?`,`? not in ?`]);return!e&&!t?T():T().filter(i=>(e&&i.type.includes(e)||t&&i.subtype?.includes(t))&&!(n&&r.has(i.key)))},oe=/* @__PURE__ */ new Set([`last_now`,`next_now`,`last_available`]),se=(e,t)=>oe.has(e??``)?t+1:t,E=(e,t)=>oe.has(e??``)?t-1:t,ce=/* @__PURE__ */ new Set([`last_now`,`last_available`,`next_now`,`more_than_ago`,`or_more_ago`]),le=/* @__PURE__ */ new Set([`last_completed`,`next_full`]),ue=/* @__PURE__ */ new Set([`? is null`,`? is not null`,`to_date`]),de=/* @__PURE__ */ new Set([`? = ?`,`? != ?`,`? < ?`,`? <= ?`,`? > ?`,`? >= ?`]),fe=3,pe=32;function D(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function O(e){return D(e)?typeof e.columnId==`string`||typeof e.column_id==`string`||typeof e.formulaId==`string`||typeof e.formula_id==`string`||typeof e.formula==`string`||(typeof e.datasetId==`string`||typeof e.dataset_id==`string`)&&(e.columnExpression!==void 0||e.expression!==void 0):!1}function me(e){return e.length<=pe?{display:e,truncated:!1}:{display:`${e.slice(0,31)}…`,truncated:!0}}function he(e,t,n){try{return new Intl.ListFormat(e||void 0,{style:`long`,type:n}).format(t)}catch{return t.join(`, `)}}function k(e,t,n){let r=Oe(e,t,n),{display:i,truncated:a}=me(r);return{label:i,full:r,truncated:a}}function ge(t){return t===1?n(`1 item`,{desc:`One selected hierarchy value whose name is still loading`}):n(e`${t} items`,{desc:`Selected hierarchy values whose names are still loading`})}function _e(){return n(`Some item names could not be retrieved`,{desc:`Tooltip when a hierarchy filter value is still an id after name lookup`})}function ve(e,t){return!!(t?.type===`hierarchy`&&t.datasetId&&t.fieldId&&!(D(e)&&e.name!==void 0)&&M(e))}function ye(e,t,n){let r=n?.datasetId,i=n?.fieldId;return!r||!i?[]:e.flatMap(e=>{if(!ve(e,n))return[];let a=M(e);return a?t.hierarchyLabels?.get(j(r,i,a))?[]:[a]:[]})}function be(e,t,n){return n.hierarchyLabelsLoading&&t.length>0?{valueText:ge(t.length),valuePending:!0}:n.hierarchyLabels&&!n.hierarchyLabelsLoading&&t.length>0&&!e.valueTooltip?{...e,valueTooltip:_e()}:e}function xe(t,r,i){let a=t.map(e=>k(e,r,i)),o=a.map(e=>e.full),s=he(r.contentLanguage,o,`conjunction`);if(t.length===1){let[e]=a;return{valueText:e.label,valueTooltip:e.truncated?e.full:void 0}}let c=Math.min(fe,a.length),l=a.length-c,u=a.slice(0,c).map(e=>e.label),d=a.some(e=>e.truncated),f;if(l>0){let t=he(r.contentLanguage,u,`unit`);f=n(e`${t}, and ${l} more`,{desc:`Filter values after the first few shown in a read-only sentence, e.g. "Dresses, Shoes, Shorts, and 1 more"`})}else f=he(r.contentLanguage,a.map(e=>e.label),`conjunction`);return{valueText:f,valueTooltip:l>0||d?s:void 0}}function A(e,t,n){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`){let t=String(e);return t.length>0?t:n}if(e&&typeof e==`object`){let n=m(e,t);if(n)return n}return n}function Se(e,t){for(let n of t){let t=e[n];if(typeof t==`string`&&t.length>0)return t}}function Ce(e,t){let n=Se(e,[`datasetId`,`dataset_id`]),r=Se(e,[`columnId`,`column_id`]),i=Se(e,[`formulaId`,`formula_id`]),a=typeof e.formula==`string`?e.formula:void 0,o=t.datasets.find(e=>e.id===n),s=o?A(o.name,t.contentLanguage,``):``;if(i){let e=o?.formulas?.find(e=>e.id===i),r=A(e?.name,t.contentLanguage,i);return{label:r,tooltip:s?`${s} · ${r}`:r,type:e?.type,subtype:e?.subtype,formula:!0,datasetId:n,fieldId:i}}if(a)return{label:a,tooltip:s?`${s} · ${a}`:a,formula:!0,datasetId:n};let c=!r&&typeof e.expression==`string`?e.expression:void 0;if(c)return{label:c,tooltip:s?`${s} · ${c}`:c,formula:!0,datasetId:n};let l=r?o?.columns?.find(e=>e.id===r):void 0,u=r??(typeof e.columnExpression==`string`?e.columnExpression:``),d=A(l?.name,t.contentLanguage,u);return{label:d,tooltip:s?`${s} · ${d}`:d,type:l?.type,subtype:l?.subtype,formula:!1,datasetId:n,fieldId:r}}function we(e){let t=o.find(t=>t.level===e);return t?t.i18n():``}function Te(t,r){switch(r){case 1:return t===1?n(e`${t} Year`,{desc:`Singular relative filter quantity in years`}):n(e`${t} Years`,{desc:`Plural relative filter quantity in years`});case 2:return t===1?n(e`${t} Quarter`,{desc:`Singular relative filter quantity in quarters`}):n(e`${t} Quarters`,{desc:`Plural relative filter quantity in quarters`});case 3:return t===1?n(e`${t} Month`,{desc:`Singular relative filter quantity in months`}):n(e`${t} Months`,{desc:`Plural relative filter quantity in months`});case 4:return t===1?n(e`${t} Week`,{desc:`Singular relative filter quantity in weeks`}):n(e`${t} Weeks`,{desc:`Plural relative filter quantity in weeks`});case 5:return t===1?n(e`${t} Day`,{desc:`Singular relative filter quantity in days`}):n(e`${t} Days`,{desc:`Plural relative filter quantity in days`});case 6:return t===1?n(e`${t} Hour`,{desc:`Singular relative filter quantity in hours`}):n(e`${t} Hours`,{desc:`Plural relative filter quantity in hours`});case 7:return t===1?n(e`${t} Minute`,{desc:`Singular relative filter quantity in minutes`}):n(e`${t} Minutes`,{desc:`Plural relative filter quantity in minutes`});case 8:return t===1?n(e`${t} Second`,{desc:`Singular relative filter quantity in seconds`}):n(e`${t} Seconds`,{desc:`Plural relative filter quantity in seconds`});case 9:return t===1?n(e`${t} Millisecond`,{desc:`Singular relative filter quantity in milliseconds`}):n(e`${t} Milliseconds`,{desc:`Plural relative filter quantity in milliseconds`});default:return n(e`${t}`,{desc:`Relative filter quantity`})}}function Ee(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))return e;try{return new Intl.DateTimeFormat(t.contentLanguage||void 0,{dateStyle:`medium`,timeStyle:`short`,...t.timeZone?{timeZone:t.timeZone}:{}}).format(n)}catch{return e}}function De(e){return/^\d{4}-\d{2}-\d{2}(?:T|$)/.test(e)}function j(e,t,n){return`${e}:${t}:${n}`}function M(e){if(typeof e==`string`||typeof e==`number`)return String(e);if(D(e)&&(typeof e.id==`string`||typeof e.id==`number`))return String(e.id)}function Oe(e,t,n){if(n?.type===`hierarchy`&&n.datasetId&&n.fieldId&&!(D(e)&&e.name!==void 0)){let r=M(e),i=r===void 0?void 0:t.hierarchyLabels?.get(j(n.datasetId,n.fieldId,r));if(i)return i}if(typeof e==`number`&&Number.isFinite(e))return new Intl.NumberFormat(t.contentLanguage||void 0).format(e);if(typeof e==`string`)return De(e)?Ee(e,t):e;if(typeof e==`boolean`)return String(e);if(D(e)){if(typeof e.parameter==`string`)return e.parameter;if(e.name!==void 0){let n=A(e.name,t.contentLanguage,``);if(n)return n}if(typeof e.id==`string`||typeof e.id==`number`)return String(e.id)}return``}function ke(e,t){let n=T().filter(t=>t.expression===e),r=D(t)&&typeof t.unit==`number`?t.unit:void 0;return(e===`to_date`&&r!==void 0?n.find(e=>e.unit===r)??n[0]:n[0])?.tiny??e}function Ae(t,r,i,a){if(ue.has(t)||r==null)return{valueText:``};if(D(r)&&typeof r.parameter==`string`){let e=r.parameter;if(!O(r))return{valueText:e}}if(de.has(t)&&O(r))return{valueText:``,valueField:Ce(r,i)};if(t===`? between ?`&&Array.isArray(r)&&r.length===2){let t=k(r[0],i,a),o=k(r[1],i,a);return be({valueText:n(e`${t.label} and ${o.label}`,{desc:`Inclusive range shown between two filter values`}),valueTooltip:t.truncated||o.truncated?n(e`${t.full} and ${o.full}`,{id:`filter-range-tooltip`,desc:`Full inclusive range shown in a tooltip`}):void 0},ye(r,i,a),i)}if(ce.has(t)&&D(r))return{valueText:Te(typeof r.quantity==`number`?se(t,r.quantity):1,r.unit)};if(le.has(t)&&D(r))return{valueText:we(r.unit)};if(Array.isArray(r))return r.length===0?{valueText:``}:be(xe(r,i,a),ye(r,i,a),i);let o=k(r,i,a);return be({valueText:o.label,valueTooltip:o.truncated?o.full:void 0},ye([r],i,a),i)}function je(e,t){let n=e.parameters?.[0];if(!D(n)||!O(n))return null;let r=Ce(n,t),i=typeof e.expression==`string`?e.expression:``,a=e.parameters?.[1];return{field:r,expression:i?ke(i,a):``,...Ae(i,a,t,r)}}function Me(e){return`condition`in e&&`filters`in e}function Ne(e){if(e==null)return[];if(Array.isArray(e))return e.flatMap(Ne);if(D(e)){if(typeof e.parameter==`string`||e.name!==void 0||O(e))return[];let t=M(e);return t?[t]:[]}let t=M(e);return t?[t]:[]}function Pe(e,t){let n=/* @__PURE__ */ new Map,r=e=>{if(Me(e)){e.filters.forEach(r);return}let i=e.parameters?.[0];if(!D(i)||!O(i))return;let a=Ce(i,t);if(a.type!==`hierarchy`||!a.datasetId||!a.fieldId)return;let o=[...new Set(Ne(e.parameters?.[1]))];if(o.length===0)return;let s=`${a.datasetId}:${a.fieldId}`,c=n.get(s);c?c.ids=[.../* @__PURE__ */ new Set([...c.ids,...o])]:n.set(s,{datasetId:a.datasetId,...a.formula?{formulaId:a.fieldId}:{columnId:a.fieldId},ids:o})};return r(e),[...n.values()]}async function Fe(e,t){let n=/* @__PURE__ */ new Map;return await Promise.all(e.map(async e=>{let r={dataset_id:e.datasetId,column_id:e.columnId,formula_id:e.formulaId},i=await p.fetchData({dimensions:[r],where:[{expression:`? in ?`,parameters:[r,e.ids]}],limit:{by:e.ids.length,offset:0}}),a=e.columnId??e.formulaId??``;for(let r of i.data??[]){let i=r[0],o=i&&typeof i==`object`&&`id`in i?String(i.id):String(i),s=i&&typeof i==`object`&&`name`in i?m(i.name,t):``;s&&n.set(j(e.datasetId,a,o),s)}})),n}var Ie=20,N=class extends Error{constructor(e){super(e),this.name=`FilterUnrepresentableError`}},Le=/* @__PURE__ */ new Set([`and`,`or`]),Re=[`datasetId`,`dataset_id`,`columnId`,`column_id`,`formulaId`,`formula_id`,`formula`,`columnExpression`,`value`,`ignoredItemIds`];function P(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function F(e){return!P(e)||e.condition!==void 0&&(typeof e.condition!=`string`||!Le.has(e.condition.toLowerCase()))?!1:`filters`in e||`subGroups`in e}function ze(e){return P(e)&&`expression`in e&&!(`condition`in e)}function I(e){return Re.some(t=>t in e)}function Be(e,t=!1){let n=[e.columnId!==void 0||e.column_id!==void 0,e.formulaId!==void 0||e.formula_id!==void 0,e.formula!==void 0].filter(Boolean).length;return n===1?!0:n>1?!1:e.columnExpression!==void 0||t&&e.expression!==void 0}function Ve(e){return!ze(e)||typeof e.expression!=`string`||e.expression.length===0||`parameters`in e||typeof e.datasetId!=`string`&&typeof e.dataset_id!=`string`?!1:Be(e)}function He(e){return!ze(e)||!Array.isArray(e.parameters)?!1:!I(e)}function Ue(e){if(!(`parameters`in e))return;let t=Re.find(t=>t in e);if(t!==void 0)throw new N(`Filter leaf mixes "parameters" with the clean inline key "${t}".`)}function We(e){throw typeof e.expression!=`string`||e.expression.length===0?new N(`Clean filter leaf is missing a non-empty "expression".`):typeof e.datasetId!=`string`&&typeof e.dataset_id!=`string`?new N(`Clean filter leaf "${e.expression}" is missing a "datasetId".`):new N(`Clean filter leaf "${e.expression}" must name exactly one of "columnId", "formulaId", "formula", or "columnExpression".`)}function Ge(e){return e===`where`||e===`having`}function L(e){if(e>20)throw new N(`Filter nesting exceeds the maximum depth of 20.`)}function Ke(e){if(e==null)return`empty`;if(!Array.isArray(e))return`unknown`;if(e.length===0)return`empty`;let t=!1,n=!1,r=!1,i=(e,a)=>{if(a>20)r=!0;else if(F(e)){Ge(e.clause)&&(n=!0);let t=[...Array.isArray(e.filters)?e.filters:[],...Array.isArray(e.subGroups)?e.subGroups:[]];for(let e of t)i(e,a+1)}else ze(e)?`parameters`in e&&I(e)?r=!0:Ve(e)?n=!0:He(e)?t=!0:r=!0:r=!0};for(let t of e)i(t,1);return r?`unknown`:n&&t?`mixed`:n?`clean`:t?`canonical`:`empty`}var qe=/* @__PURE__ */ new Set([`? is null`,`? is not null`]),Je=/* @__PURE__ */ new Set([`? = ?`,`? != ?`,`? < ?`,`? <= ?`,`? > ?`,`? >= ?`]),Ye=/* @__PURE__ */ new Set([`? in ?`,`? not in ?`,`? between ?`]),Xe={"array[numeric]":`numeric[]`,"array[hierarchy]":`hierarchy[]`,"array[datetime]":`datetime[]`},Ze=/* @__PURE__ */ new Set([`level`,`lowestLevel`,`unnest`,`discretization`,`aggregation`,`index`,`include_nonoccurring`,`simplification`]);function R(e,t){return e!==`lowestLevel`&&!(t===null&&Ze.has(e))}function z(e){return structuredClone(e)}function Qe(e){let t=e.datasetId??e.dataset_id;if(typeof t!=`string`||t.length===0)throw new N(`Filter reference is missing a "datasetId".`);return t}function $e(e){return P(e)?typeof e.columnId==`string`||typeof e.column_id==`string`||typeof e.formulaId==`string`||typeof e.formula_id==`string`||typeof e.formula==`string`||(typeof e.datasetId==`string`||typeof e.dataset_id==`string`)&&(e.columnExpression!==void 0||e.expression!==void 0):!1}function et(e){let t={type:e.type};return e.bins!==void 0&&(t.bins=e.bins),Array.isArray(e.over)&&(t.over=e.over.map(e=>st(e))),t}function tt(e){let t={type:e.type},n=e.datasetId??e.dataset_id,r=e.columnId??e.column_id;return n!==void 0&&(t.datasetId=n),r!==void 0&&(t.columnId=r),e.level!==void 0&&R(`level`,e.level)&&(t.level=e.level),P(e.discretization)&&(t.discretization=et(e.discretization)),e.unnest!==void 0&&R(`unnest`,e.unnest)&&(t.unnest=e.unnest),t}function nt(e){let t={type:e.type};return e.bins!==void 0&&(t.bins=e.bins),Array.isArray(e.over)&&(t.over=e.over.map(e=>P(e)?ot(e):e)),t}function rt(e){let t={type:e.type},n=e.datasetId??e.dataset_id,r=e.columnId??e.column_id;return n!==void 0&&(t.datasetId=n),r!==void 0&&(t.columnId=r),e.level!==void 0&&(t.level=e.level),P(e.discretization)&&(t.discretization=nt(e.discretization)),e.unnest!==void 0&&(t.unnest=e.unnest),t}function it(e,t){e.level!==void 0&&(t.level=z(e.level)),P(e.discretization)&&(t.discretization=nt(e.discretization)),P(e.aggregation)&&(t.aggregation=rt(e.aggregation)),e.unnest!==void 0&&(t.unnest=z(e.unnest))}function at(e,t){let n=e.columnId??e.column_id;if(n!==void 0)return{kind:`columnId`,value:n};let r=e.formulaId??e.formula_id;if(r!==void 0)return{kind:`formulaId`,value:r};if(e.formula!==void 0)return{kind:`formula`,value:e.formula};let i=e.columnExpression??(t?e.expression:void 0);if(i!==void 0)return{kind:`expression`,value:i}}function ot(e,t=!0){let n={datasetId:Qe(e)},r=at(e,t);return r!==void 0&&(r.kind===`expression`?n.expression=r.value:n[r.kind]=r.value),it(e,n),n}function st(e){if(!P(e))throw new N(`Cannot emit a clean filter reference.`);let t={datasetId:Qe(e)};e.level!==void 0&&R(`level`,e.level)&&(t.level=e.level),P(e.discretization)&&(t.discretization=et(e.discretization)),P(e.aggregation)&&(t.aggregation=tt(e.aggregation)),e.unnest!==void 0&&R(`unnest`,e.unnest)&&(t.unnest=e.unnest);let n=at(e,!0);if(n===void 0)throw new N(`Cannot emit a clean filter reference: no column, formula, or expression.`);return n.kind===`expression`?t.columnExpression=n.value:t[n.kind]=n.value,t}function ct(e){if(!P(e)||typeof e.parameter!=`string`||typeof e.type!=`string`)return e;let t=Xe[e.type];return t===void 0?e:{...e,type:t}}function lt(e,t){return P(t)&&typeof t.parameter==`string`?!0:Array.isArray(t)?e!==`? between ?`||t.length===2:!1}function ut(e,t){let n=e.expression,r=[ot(e,!1)];if(!qe.has(n)&&e.value!==void 0){let t=Je.has(n)&&$e(e.value);r.push(t?ot(e.value):z(e.value))}let i={};typeof e.id==`string`&&(i.id=e.id),`ignoredItemIds`in e&&(i.ignore=z(e.ignoredItemIds)),t!==void 0&&(i.type=t);let a={expression:n,parameters:r};return Object.keys(i).length>0&&(a.properties=i),a}function dt(e){let{expression:t}=e;if(typeof t!=`string`||t.length===0)return null;let n=Array.isArray(e.parameters)?e.parameters:[];if(!P(n[0]))throw new N(`Cannot emit a clean filter reference for "${t}".`);let r={...st(n[0]),expression:t};if(!qe.has(t)){let e=n[1];if(e===void 0)throw new N(`Filter "${t}" is missing its value operand.`);if(r.value=$e(e)&&Je.has(t)?st(e):ct(z(e)),Ye.has(t)&&!lt(t,r.value))throw new N(`Cannot emit an invalid clean filter value for "${t}".`)}let{properties:i}=e;return i?.id!==void 0&&(r.id=i.id),i!==void 0&&`ignore`in i&&(r.ignoredItemIds=z(i.ignore)),r}function ft(e){return F(e)}function pt(e){return Array.isArray(e.filters)?e.filters:[]}function mt(e,t){return e.properties?.type===`having`||e.properties?.type===`where`?e.properties.type:t??`where`}function B(e,t,n=1,r=/* @__PURE__ */ new Set){L(n);let i=e.clause??t;for(let t of pt(e))ft(t)?B(t,i,n+1,r):typeof t.expression==`string`&&t.expression.length>0&&r.add(mt(t,i));return r}function ht(e,t,n=1){L(n);let r=e.clause??t;if(e.condition===`or`&&B(e,r,n).size>1)throw new N(`An "or" group mixes "where" and "having" filters, which clean output cannot represent.`);for(let t of pt(e))ft(t)&&ht(t,r,n+1)}function gt(e,t,n,r=1){L(r);let i=e.clause??n,a=[];for(let n of pt(e)){if(ft(n)){let e=gt(n,t,i,r+1);e.filters.length>0&&a.push(e);continue}if(mt(n,i)!==t)continue;let e=dt(n);e&&a.push(e)}let o={condition:e.condition===`or`?`or`:`and`,filters:a};return e.id!==void 0&&B(e,i,r).size<=1&&(o.id=e.id),o}function _t(e){let t=e.clause;ht(e,t);let n=B(e,t);return n.size===0&&n.add(t??`where`),[`where`,`having`].filter(e=>n.has(e)).map(n=>({...gt(e,n,t),clause:n})).filter(e=>e.filters.length>0)}var vt=[`origin`,`datasetId`,`vizId`,`itemId`,`isDrilldown`,`type`];function yt(e){return typeof e==`string`&&e.toLowerCase()===`or`?`or`:`and`}function bt(e){return F(e)}function xt(e){if(!Array.isArray(e)||e.length===0)return[];let t=P(e[0])?e[0]:void 0,n=e.length>1?e[1]:void 0;return e.length>1?[t,n]:[t]}function St(e){if(typeof e.expression!=`string`||e.expression.length===0)return null;let t={expression:e.expression,parameters:xt(e.parameters)};return e.properties!==void 0&&Object.keys(e.properties).length>0&&(t.properties=structuredClone(e.properties)),t}function Ct(e,t){let n=e,r=t;for(let e of vt)n[e]!==void 0&&(r[e]=n[e])}function wt(e){if(!e||!e.filters)return{condition:`and`,filters:[],subGroups:[]};let t=[],n=[];for(let r of e.filters)if(bt(r))n.push(wt(r));else{let e=St(r);e&&t.push(e)}let r={condition:yt(e.condition),filters:t,subGroups:n};return e.id!==void 0&&(r.id=e.id),Ct(e,r),r}function Tt(e,t){return e?t?.format===`clean`?_t(e):[wt(e)]:[]}var Et=[[`dataset_id`,`datasetId`],[`column_id`,`columnId`],[`formula_id`,`formulaId`]];function Dt(e){if(!$e(e)||!Et.some(([t])=>t in e))return e;let t={...e};for(let[e,n]of Et)e in t&&(t[n]??=t[e],delete t[e]);return t}function Ot(e,t){let n={expression:typeof e.expression==`string`?e.expression:void 0,parameters:Array.isArray(e.parameters)?e.parameters.map(Dt):[]},r=P(e.properties)?structuredClone(e.properties):{};return t!==void 0&&r.type===void 0&&(r.type=t),Object.keys(r).length>0&&(n.properties=r),n}function kt(e,t,n){if(F(e))return At(e,t,n);if(!P(e))return;let r=e.expression;if(Ue(e),Ve(e))return ut(e,t);if(I(e)&&We(e),He(e))return Ot(e,t);throw new N(`Filter leaf "${String(r)}" matches neither a complete clean nor a complete canonical encoding.`)}function At(e,t,n){L(n);let r=Ge(e.clause)?e.clause:void 0,i=r??t,a=[];for(let t of Array.isArray(e.filters)?e.filters:[]){let e=kt(t,i,n+1);e!==void 0&&a.push(e)}for(let t of Array.isArray(e.subGroups)?e.subGroups:[])F(t)&&a.push(At(t,i,n+1));let o={condition:yt(e.condition),filters:a};return typeof e.id==`string`&&(o.id=e.id),r!==void 0&&(o.clause=r),Ct(e,o),o}function jt(e){return!e||e.length===0?[]:e.filter(e=>F(e)).map(e=>At(e,void 0,1))}var Mt=`:host{font-family:var(--luzmo-font-family)}luzmo-select{width:100%}:host{--var:blue}`,V=class extends r(S(x,{validSizes:Object.values(b)})){constructor(...e){super(...e),this.hasLabel=!1,this.allowEmpty=!1,this.placeholder=``,this.disabled=!1,this.readonly=!1,this.quiet=!1,this.invalid=!1,this.isFormula=!1,this._expressionConfigurations=T()}static get styles(){return[y(Mt)]}_sendChangeEvent(){if(this.disabled||this.readonly)return;let e={expression:this.filter?.expression};this.filter?.parameters?.[1]?.unit&&(e.unit=this.filter?.parameters?.[1]?.unit),this.dispatchEvent(new CustomEvent(`luzmo-expression-selected`,{bubbles:!0,composed:!0,cancelable:!0,detail:e}))}setExpression(e){this._richExpression=e?.detail?.value?.[0];let t=this._expressionConfigurations.find(e=>e.id===this._richExpression),n=structuredClone(this.filter);n.expression=t?.expression,t?.unit&&(this._unit=t.unit,n?.parameters[0]&&(n.parameters[1]={unit:this._unit})),this.filter=n,this._sendChangeEvent()}willUpdate(e){super.willUpdate(e);let t=e.has(`filter`),n=e.has(`type`),r=e.has(`subtype`),i=e.has(`isFormula`),a=ae(this.type,this.subtype,this.isFormula),o=[`YTD`,`QTD`,`MTD`,`WTD`];if(this.filter?.expression===`to_date`){let e=this.filter?.parameters[1]?.unit??1;this._unit=e,this._richExpression=o[e-1]??`YTD`}else this._richExpression=this.filter?.expression;(n||r||i||t)&&this.filter&&!this.disabled&&!this.readonly&&!a?.find(e=>e.expression===this.filter?.expression)?(this.invalid=!0,console.warn(`Warning: ${this.filter?.expression} is not valid given the type: ${this.type} and subtype: ${this.subtype}`)):this.invalid=!1,!this.filter?.expression&&!this.allowEmpty&&(this._richExpression=a?.[0]?.id,this.filter={...this.filter,expression:this._richExpression},this._sendChangeEvent())}render(){let e=ae(this.type,this.subtype,this.isFormula)?.map(e=>({value:e.id,label:e.description,shortLabel:e.tiny})),t=this.disabled||!this.filter?.expression&&!this.allowEmpty,r=h`<luzmo-field-label
|
|
3
3
|
for="expression"
|
|
4
4
|
size=${this.size}
|
|
5
5
|
>${this.label??n(`Select an expression`,{desc:`Label for expression picker`})}</luzmo-field-label
|
|
6
|
-
>`,i=this.hasLabel?this.placeholder??n(`Select...`):this.placeholder||this.label||n(`Filter expression`,{desc:`Accessible label for expression picker`});return
|
|
6
|
+
>`,i=this.hasLabel?this.placeholder??n(`Select...`):this.placeholder||this.label||n(`Filter expression`,{desc:`Accessible label for expression picker`});return h`${this.hasLabel?r:``}
|
|
7
7
|
<luzmo-select
|
|
8
8
|
label=${i}
|
|
9
9
|
id="expression"
|
|
@@ -19,7 +19,7 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
19
19
|
.value=${[this._richExpression]}
|
|
20
20
|
@change=${this.setExpression}
|
|
21
21
|
>
|
|
22
|
-
</luzmo-select>`}};t([g({type:String,reflect:!0})],V.prototype,`filter`,void 0),t([g({type:Boolean,attribute:`has-label`,reflect:!0})],V.prototype,`hasLabel`,void 0),t([g({type:String,reflect:!0})],V.prototype,`label`,void 0),t([g({type:Boolean,attribute:`allow-empty`,reflect:!0})],V.prototype,`allowEmpty`,void 0),t([g({type:String,attribute:`placeholder`,reflect:!0})],V.prototype,`placeholder`,void 0),t([g({type:Boolean,attribute:`disabled`,reflect:!0})],V.prototype,`disabled`,void 0),t([g({type:Boolean,reflect:!0})],V.prototype,`readonly`,void 0),t([g({type:Boolean,reflect:!0})],V.prototype,`quiet`,void 0),t([g({type:String,attribute:`type`,reflect:!0})],V.prototype,`type`,void 0),t([g({type:String,attribute:`subtype`,reflect:!0})],V.prototype,`subtype`,void 0),t([g({type:Boolean,attribute:`invalid`,reflect:!0})],V.prototype,`invalid`,void 0),t([g({type:Boolean,attribute:`is-formula`,reflect:!0})],V.prototype,`isFormula`,void 0),t([_()],V.prototype,`_richExpression`,void 0),t([_()],V.prototype,`_unit`,void 0),V=t([i()],V),customElements.get(`luzmo-filter-expression-picker`)||customElements.define(`luzmo-filter-expression-picker`,V);var Ot=/* @__PURE__ */ new Set([`? is null`,`? is not null`,`? between ?`,`YTD`,`QTD`,`MTD`,`WTD`,`to_date`,`last_available`,`last_completed`,`last_now`,`more_than_ago`,`or_more_ago`,`next_now`,`next_full`]),kt=/* @__PURE__ */ new Set([`? length = ?`,`? length >= ?`,`? length <= ?`]),At=/* @__PURE__ */ new Set([`? in ?`,`? not in ?`,`? includes all ?`,`? includes any ?`,`? includes only ?`]);function H(e,t){return!e||e===`spatial`||!t||Ot.has(t)?[]:kt.has(t)?[`numeric`]:e===`numeric`||e===`array[numeric]`?At.has(t)?[`array[numeric]`]:[`numeric`]:e===`datetime`||e===`array[datetime]`?At.has(t)?[`array[datetime]`,`datetime`]:[`datetime`,`array[datetime]`]:e===`hierarchy`||e===`array[hierarchy]`?At.has(t)?[`array[hierarchy]`]:[`hierarchy`]:[]}var jt={numeric:()=>n(`Numeric`,{id:`filter-parameter-type-numeric`,desc:`Numeric filter parameter type`}),datetime:()=>n(`Datetime`,{id:`filter-parameter-type-datetime`,desc:`Datetime filter parameter type`}),hierarchy:()=>n(`Hierarchy`,{id:`filter-parameter-type-hierarchy`,desc:`Hierarchy filter parameter type`}),"array[numeric]":()=>n(`Numeric[]`,{id:`filter-parameter-type-numeric-list`,desc:`List of numeric values filter parameter type`}),"array[datetime]":()=>n(`Datetime[]`,{id:`filter-parameter-type-datetime-list`,desc:`List of datetime values filter parameter type`}),"array[hierarchy]":()=>n(`Hierarchy[]`,{id:`filter-parameter-type-hierarchy-list`,desc:`List of hierarchy values filter parameter type`})};function Mt(e){return jt[e]?.()??e}function U(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return typeof t.parameter==`string`&&typeof t.type==`string`&&`value`in t}function W(e){return`metadata.${e.trim().replace(/^metadata\./i,``)}`}function Nt(e,t,n){let r;if(t.startsWith(`array[`))r=Array.isArray(n)?structuredClone(n):[];else if(t===`numeric`)r=typeof n==`number`&&Number.isFinite(n)?n:0;else if(t===`datetime`){let e=n instanceof Date?n:new Date(typeof n==`string`?n:Date.now());r=Number.isNaN(e.getTime())?(/* @__PURE__ */ new Date()).toISOString():e.toISOString()}else r=typeof n==`string`?n:``;return{parameter:W(e),type:t,value:r}}function G(e,t){if(!t||t===`? is null`||t===`? is not null`)return;let[n]=H(e,t);if(n?.startsWith(`array[`))return[];if(n===`numeric`)return 0;if(n===`datetime`)return(/* @__PURE__ */ new Date()).toISOString();if(n===`hierarchy`)return``}var Pt=`:host{min-width:0;max-width:100%;color:var(--luzmo-font-color);font-family:var(--luzmo-font-family);font-size:var(--luzmo-font-size);align-items:center;display:inline-flex;position:relative}.parameter-control{align-items:center;gap:var(--filter-parameter-picker-gap);min-width:0;max-width:100%;display:flex}.create-row{align-items:center;gap:var(--filter-parameter-picker-panel-gap);display:flex}.parameter-trigger,.create-parameter{flex:none}.parameter-trigger{font-weight:var(--luzmo-font-weight-bold)}.selected-parameter-tags{--luzmo-tag-group-item-margin-block:0;min-width:0;max-width:100%}.selected-parameter{--luzmo-tag-max-inline-size:min(180px, 100%);min-width:0;max-width:100%}.parameter-panel{min-inline-size:var(--filter-parameter-picker-panel-min-width);padding:var(--filter-parameter-picker-panel-padding);display:block}.parameter-name-input{--luzmo-text-field-width:100%;flex:1;min-inline-size:0}.panel-content{gap:var(--filter-parameter-picker-panel-gap);flex-direction:column;display:flex}.validation-message{color:var(--filter-parameter-picker-error-color);font-size:var(--luzmo-font-size-s)}.parameter-options{max-block-size:var(--filter-parameter-picker-options-max-height);overflow-y:auto}.parameter-type-footer{gap:var(--filter-parameter-picker-panel-gap);flex-direction:column;display:flex}.parameter-type{justify-content:flex-end;align-items:center;gap:var(--luzmo-spacing-1);font-size:var(--filter-parameter-picker-type-font-size);font-weight:var(--luzmo-font-weight);display:flex}.parameter-type-icon{justify-content:center;align-items:center;min-block-size:24px;min-inline-size:24px;display:inline-flex}:host{--filter-parameter-picker-gap:var(--luzmo-spacing-2);--filter-parameter-picker-control-size:var(--luzmo-component-height);--filter-parameter-picker-panel-min-width:220px;--filter-parameter-picker-options-max-height:240px;--filter-parameter-picker-panel-padding:var(--luzmo-spacing-3);--filter-parameter-picker-panel-gap:var(--luzmo-spacing-3);--filter-parameter-picker-type-font-size:var(--luzmo-font-size-s);--filter-parameter-picker-panel-background:var(--luzmo-background-color);--filter-parameter-picker-panel-border:var(--luzmo-border-color);--filter-parameter-picker-error-color:var(--luzmo-negative-color)}:host([size=xxs]),:host([size=xs]){--filter-parameter-picker-panel-padding:var(--luzmo-spacing-2);--filter-parameter-picker-panel-gap:var(--luzmo-spacing-2);--filter-parameter-picker-type-font-size:var(--luzmo-font-size-xs)}:host([size=s]){--filter-parameter-picker-panel-padding:var(--luzmo-spacing-3);--filter-parameter-picker-panel-gap:var(--luzmo-spacing-3);--filter-parameter-picker-type-font-size:var(--luzmo-font-size-xs)}:host([size=l]){--filter-parameter-picker-panel-padding:var(--luzmo-spacing-4);--filter-parameter-picker-panel-gap:var(--luzmo-spacing-4);--filter-parameter-picker-type-font-size:var(--luzmo-font-size-m)}:host([size=xl]){--filter-parameter-picker-panel-padding:var(--luzmo-spacing-4);--filter-parameter-picker-panel-gap:var(--luzmo-spacing-4);--filter-parameter-picker-type-font-size:var(--luzmo-font-size-l)}:host([size=xxl]){--filter-parameter-picker-panel-padding:var(--luzmo-spacing-5);--filter-parameter-picker-panel-gap:var(--luzmo-spacing-5);--filter-parameter-picker-type-font-size:var(--luzmo-font-size-xl)}`,K=class extends r(x(b,{validSizes:Object.values(y)})){constructor(...e){super(...e),this.parameters=[],this.allowedTypes=[],this.disabled=!1,this.readonly=!1,this.quiet=!1,this._open=!1,this._newParameterName=``,this._handleDocumentClick=e=>{this._open&&!e.composedPath().includes(this)&&this._close()}}static get styles(){return[...super.styles??[],v(Pt)]}connectedCallback(){super.connectedCallback(),document.addEventListener(`click`,this._handleDocumentClick)}disconnectedCallback(){document.removeEventListener(`click`,this._handleDocumentClick),super.disconnectedCallback()}get _selectableParameters(){return this.parameters.filter(e=>this.allowedTypes.includes(e.type))}get _parameterOptions(){return this._selectableParameters.map(e=>({label:e.parameter.replace(/^metadata\./i,``),value:e.parameter}))}get _parameterType(){return this.selectedParameter?.type??this.allowedTypes[0]}get _duplicateName(){if(!this._hasParameterName)return!1;let e=W(this._newParameterName).toLowerCase();return this.parameters.some(t=>W(t.parameter).toLowerCase()===e)}get _triggerIconSize(){return{xxs:`xs`,xs:`xs`,s:`xs`,m:`xs`,l:`s`,xl:`m`,xxl:`l`}[this.size]??`xs`}get _hasParameterName(){return W(this._newParameterName).replace(/^metadata\./i,``).trim().length>0}_dispatchSelected(e){this.dispatchEvent(new CustomEvent(`luzmo-parameter-selected`,{bubbles:!0,composed:!0,detail:{parameter:e}}))}_dispatchCreated(e){this.dispatchEvent(new CustomEvent(`luzmo-parameter-created`,{bubbles:!0,composed:!0,detail:{parameter:e}}))}_dispatchRemoved(e){this.dispatchEvent(new CustomEvent(`luzmo-parameter-removed`,{bubbles:!0,composed:!0,detail:{parameter:e}}))}async _handleTriggerClick(){this.disabled||this.readonly||this.allowedTypes.length===0||!this._overlay||(this._open=!0,this._newParameterName=``,this._overlay.open=!0,await this.updateComplete,this.shadowRoot?.querySelector(`.parameter-name-input`)?.focusElement.focus())}_handleTriggerKeydown(e){(e.key===`Enter`||e.key===` `||e.key===`Space`)&&(e.preventDefault(),this._handleTriggerClick())}_handleOpened(){this.shadowRoot?.querySelector(`.parameter-name-input`)?.focusElement.focus()}_handleClosed(){this._open=!1,this._newParameterName=``}_close(){this._overlay&&(this._overlay.open=!1),this._handleClosed(),this._triggerElement?.focusElement.focus()}_handlePanelKeydown(e){e.key===`Escape`&&(e.preventDefault(),this._close())}_handleNameInput(e){this._newParameterName=e.currentTarget.value}_selectParameter(e){this.disabled||this.readonly||(this.selectedParameter=e,this._dispatchSelected(e),this._close())}_handleOptionsChange(e){e.stopPropagation();let[t]=e.detail.value,n=this._selectableParameters.find(e=>e.parameter===t);n&&this._selectParameter(n)}async _handleCreateParameter(){if(this.disabled||this.readonly)return;let e=this.allowedTypes[0];if(!e||!this._hasParameterName||this._duplicateName)return;let t=Nt(this._newParameterName,e,this.currentValue);this.parameters=[...this.parameters,t],this._newParameterName=``,this._dispatchCreated(t),await this.updateComplete,this.shadowRoot?.querySelector(`.parameter-name-input`)?.focusElement.focus()}_handleNameKeydown(e){e.key===`Enter`?(e.preventDefault(),this._handleCreateParameter()):e.key===`ArrowDown`&&this._optionsElement&&(e.preventDefault(),this._optionsElement.focus())}_handleRemoveParameter(){this.disabled||this.readonly||!this.selectedParameter||this._dispatchRemoved(this.selectedParameter)}_renderParameterType(){let e=this._parameterType;if(!e)return h;let t=Mt(e);return m`
|
|
22
|
+
</luzmo-select>`}};t([_({type:String,reflect:!0})],V.prototype,`filter`,void 0),t([_({type:Boolean,attribute:`has-label`,reflect:!0})],V.prototype,`hasLabel`,void 0),t([_({type:String,reflect:!0})],V.prototype,`label`,void 0),t([_({type:Boolean,attribute:`allow-empty`,reflect:!0})],V.prototype,`allowEmpty`,void 0),t([_({type:String,attribute:`placeholder`,reflect:!0})],V.prototype,`placeholder`,void 0),t([_({type:Boolean,attribute:`disabled`,reflect:!0})],V.prototype,`disabled`,void 0),t([_({type:Boolean,reflect:!0})],V.prototype,`readonly`,void 0),t([_({type:Boolean,reflect:!0})],V.prototype,`quiet`,void 0),t([_({type:String,attribute:`type`,reflect:!0})],V.prototype,`type`,void 0),t([_({type:String,attribute:`subtype`,reflect:!0})],V.prototype,`subtype`,void 0),t([_({type:Boolean,attribute:`invalid`,reflect:!0})],V.prototype,`invalid`,void 0),t([_({type:Boolean,attribute:`is-formula`,reflect:!0})],V.prototype,`isFormula`,void 0),t([v()],V.prototype,`_richExpression`,void 0),t([v()],V.prototype,`_unit`,void 0),V=t([i()],V),customElements.get(`luzmo-filter-expression-picker`)||customElements.define(`luzmo-filter-expression-picker`,V);var Nt=/* @__PURE__ */ new Set([`? is null`,`? is not null`,`? between ?`,`YTD`,`QTD`,`MTD`,`WTD`,`to_date`,`last_available`,`last_completed`,`last_now`,`more_than_ago`,`or_more_ago`,`next_now`,`next_full`]),Pt=/* @__PURE__ */ new Set([`? length = ?`,`? length >= ?`,`? length <= ?`]),Ft=/* @__PURE__ */ new Set([`? in ?`,`? not in ?`,`? includes all ?`,`? includes any ?`,`? includes only ?`]);function H(e,t){return!e||e===`spatial`||!t||Nt.has(t)?[]:Pt.has(t)?[`numeric`]:e===`numeric`||e===`array[numeric]`?Ft.has(t)?[`array[numeric]`]:[`numeric`]:e===`datetime`||e===`array[datetime]`?Ft.has(t)?[`array[datetime]`,`datetime`]:[`datetime`,`array[datetime]`]:e===`hierarchy`||e===`array[hierarchy]`?Ft.has(t)?[`array[hierarchy]`]:[`hierarchy`]:[]}var It={numeric:()=>n(`Numeric`,{id:`filter-parameter-type-numeric`,desc:`Numeric filter parameter type`}),datetime:()=>n(`Datetime`,{id:`filter-parameter-type-datetime`,desc:`Datetime filter parameter type`}),hierarchy:()=>n(`Hierarchy`,{id:`filter-parameter-type-hierarchy`,desc:`Hierarchy filter parameter type`}),"array[numeric]":()=>n(`Numeric[]`,{id:`filter-parameter-type-numeric-list`,desc:`List of numeric values filter parameter type`}),"array[datetime]":()=>n(`Datetime[]`,{id:`filter-parameter-type-datetime-list`,desc:`List of datetime values filter parameter type`}),"array[hierarchy]":()=>n(`Hierarchy[]`,{id:`filter-parameter-type-hierarchy-list`,desc:`List of hierarchy values filter parameter type`})};function Lt(e){return It[e]?.()??e}function U(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return typeof t.parameter==`string`&&typeof t.type==`string`&&`value`in t}function W(e){return`metadata.${e.trim().replace(/^metadata\./i,``)}`}function Rt(e,t,n){let r;if(t.startsWith(`array[`))r=Array.isArray(n)?structuredClone(n):[];else if(t===`numeric`)r=typeof n==`number`&&Number.isFinite(n)?n:0;else if(t===`datetime`){let e=n instanceof Date?n:new Date(typeof n==`string`?n:Date.now());r=Number.isNaN(e.getTime())?(/* @__PURE__ */ new Date()).toISOString():e.toISOString()}else r=typeof n==`string`?n:``;return{parameter:W(e),type:t,value:r}}function G(e,t){if(!t||t===`? is null`||t===`? is not null`)return;let[n]=H(e,t);if(n?.startsWith(`array[`))return[];if(n===`numeric`)return 0;if(n===`datetime`)return(/* @__PURE__ */ new Date()).toISOString();if(n===`hierarchy`)return``}var zt=`:host{min-width:0;max-width:100%;color:var(--luzmo-font-color);font-family:var(--luzmo-font-family);font-size:var(--luzmo-font-size);align-items:center;display:inline-flex;position:relative}.parameter-control{align-items:center;gap:var(--filter-parameter-picker-gap);min-width:0;max-width:100%;display:flex}.create-row{align-items:center;gap:var(--filter-parameter-picker-panel-gap);display:flex}.parameter-trigger,.create-parameter{flex:none}.parameter-trigger{font-weight:var(--luzmo-font-weight-bold)}.selected-parameter-tags{--luzmo-tag-group-item-margin-block:0;min-width:0;max-width:100%}.selected-parameter{--luzmo-tag-max-inline-size:min(180px, 100%);min-width:0;max-width:100%}.parameter-panel{min-inline-size:var(--filter-parameter-picker-panel-min-width);padding:var(--filter-parameter-picker-panel-padding);display:block}.parameter-name-input{--luzmo-text-field-width:100%;flex:1;min-inline-size:0}.panel-content{gap:var(--filter-parameter-picker-panel-gap);flex-direction:column;display:flex}.validation-message{color:var(--filter-parameter-picker-error-color);font-size:var(--luzmo-font-size-s)}.parameter-options{max-block-size:var(--filter-parameter-picker-options-max-height);overflow-y:auto}.parameter-type-footer{gap:var(--filter-parameter-picker-panel-gap);flex-direction:column;display:flex}.parameter-type{justify-content:flex-end;align-items:center;gap:var(--luzmo-spacing-1);font-size:var(--filter-parameter-picker-type-font-size);font-weight:var(--luzmo-font-weight);display:flex}.parameter-type-icon{justify-content:center;align-items:center;min-block-size:24px;min-inline-size:24px;display:inline-flex}:host{--filter-parameter-picker-gap:var(--luzmo-spacing-2);--filter-parameter-picker-control-size:var(--luzmo-component-height);--filter-parameter-picker-panel-min-width:220px;--filter-parameter-picker-options-max-height:240px;--filter-parameter-picker-panel-padding:var(--luzmo-spacing-3);--filter-parameter-picker-panel-gap:var(--luzmo-spacing-3);--filter-parameter-picker-type-font-size:var(--luzmo-font-size-s);--filter-parameter-picker-panel-background:var(--luzmo-background-color);--filter-parameter-picker-panel-border:var(--luzmo-border-color);--filter-parameter-picker-error-color:var(--luzmo-negative-color)}:host([size=xxs]),:host([size=xs]){--filter-parameter-picker-panel-padding:var(--luzmo-spacing-2);--filter-parameter-picker-panel-gap:var(--luzmo-spacing-2);--filter-parameter-picker-type-font-size:var(--luzmo-font-size-xs)}:host([size=s]){--filter-parameter-picker-panel-padding:var(--luzmo-spacing-3);--filter-parameter-picker-panel-gap:var(--luzmo-spacing-3);--filter-parameter-picker-type-font-size:var(--luzmo-font-size-xs)}:host([size=l]){--filter-parameter-picker-panel-padding:var(--luzmo-spacing-4);--filter-parameter-picker-panel-gap:var(--luzmo-spacing-4);--filter-parameter-picker-type-font-size:var(--luzmo-font-size-m)}:host([size=xl]){--filter-parameter-picker-panel-padding:var(--luzmo-spacing-4);--filter-parameter-picker-panel-gap:var(--luzmo-spacing-4);--filter-parameter-picker-type-font-size:var(--luzmo-font-size-l)}:host([size=xxl]){--filter-parameter-picker-panel-padding:var(--luzmo-spacing-5);--filter-parameter-picker-panel-gap:var(--luzmo-spacing-5);--filter-parameter-picker-type-font-size:var(--luzmo-font-size-xl)}`,K=class extends r(S(x,{validSizes:Object.values(b)})){constructor(...e){super(...e),this.parameters=[],this.allowedTypes=[],this.disabled=!1,this.readonly=!1,this.quiet=!1,this._open=!1,this._newParameterName=``,this._handleDocumentClick=e=>{this._open&&!e.composedPath().includes(this)&&this._close()}}static get styles(){return[...super.styles??[],y(zt)]}connectedCallback(){super.connectedCallback(),document.addEventListener(`click`,this._handleDocumentClick)}disconnectedCallback(){document.removeEventListener(`click`,this._handleDocumentClick),super.disconnectedCallback()}get _selectableParameters(){return this.parameters.filter(e=>this.allowedTypes.includes(e.type))}get _parameterOptions(){return this._selectableParameters.map(e=>({label:e.parameter.replace(/^metadata\./i,``),value:e.parameter}))}get _parameterType(){return this.selectedParameter?.type??this.allowedTypes[0]}get _duplicateName(){if(!this._hasParameterName)return!1;let e=W(this._newParameterName).toLowerCase();return this.parameters.some(t=>W(t.parameter).toLowerCase()===e)}get _triggerIconSize(){return{xxs:`xs`,xs:`xs`,s:`xs`,m:`xs`,l:`s`,xl:`m`,xxl:`l`}[this.size]??`xs`}get _hasParameterName(){return W(this._newParameterName).replace(/^metadata\./i,``).trim().length>0}_dispatchSelected(e){this.dispatchEvent(new CustomEvent(`luzmo-parameter-selected`,{bubbles:!0,composed:!0,detail:{parameter:e}}))}_dispatchCreated(e){this.dispatchEvent(new CustomEvent(`luzmo-parameter-created`,{bubbles:!0,composed:!0,detail:{parameter:e}}))}_dispatchRemoved(e){this.dispatchEvent(new CustomEvent(`luzmo-parameter-removed`,{bubbles:!0,composed:!0,detail:{parameter:e}}))}async _handleTriggerClick(){this.disabled||this.readonly||this.allowedTypes.length===0||!this._overlay||(this._open=!0,this._newParameterName=``,this._overlay.open=!0,await this.updateComplete,this.shadowRoot?.querySelector(`.parameter-name-input`)?.focusElement.focus())}_handleTriggerKeydown(e){(e.key===`Enter`||e.key===` `||e.key===`Space`)&&(e.preventDefault(),this._handleTriggerClick())}_handleOpened(){this.shadowRoot?.querySelector(`.parameter-name-input`)?.focusElement.focus()}_handleClosed(){this._open=!1,this._newParameterName=``}_close(){this._overlay&&(this._overlay.open=!1),this._handleClosed(),this._triggerElement?.focusElement.focus()}_handlePanelKeydown(e){e.key===`Escape`&&(e.preventDefault(),this._close())}_handleNameInput(e){this._newParameterName=e.currentTarget.value}_selectParameter(e){this.disabled||this.readonly||(this.selectedParameter=e,this._dispatchSelected(e),this._close())}_handleOptionsChange(e){e.stopPropagation();let[t]=e.detail.value,n=this._selectableParameters.find(e=>e.parameter===t);n&&this._selectParameter(n)}async _handleCreateParameter(){if(this.disabled||this.readonly)return;let e=this.allowedTypes[0];if(!e||!this._hasParameterName||this._duplicateName)return;let t=Rt(this._newParameterName,e,this.currentValue);this.parameters=[...this.parameters,t],this._newParameterName=``,this._dispatchCreated(t),await this.updateComplete,this.shadowRoot?.querySelector(`.parameter-name-input`)?.focusElement.focus()}_handleNameKeydown(e){e.key===`Enter`?(e.preventDefault(),this._handleCreateParameter()):e.key===`ArrowDown`&&this._optionsElement&&(e.preventDefault(),this._optionsElement.focus())}_handleRemoveParameter(){this.disabled||this.readonly||!this.selectedParameter||this._dispatchRemoved(this.selectedParameter)}_renderParameterType(){let e=this._parameterType;if(!e)return g;let t=Lt(e);return h`
|
|
23
23
|
<div class="parameter-type-footer">
|
|
24
24
|
<luzmo-divider class="parameter-type-divider" size="s"></luzmo-divider>
|
|
25
25
|
<div class="parameter-type">
|
|
@@ -34,9 +34,9 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
34
34
|
</span>
|
|
35
35
|
</div>
|
|
36
36
|
</div>
|
|
37
|
-
`}render(){let e=this.selectedParameter?.parameter.replace(/^metadata\./i,``),t=!this._hasParameterName||this._duplicateName;return
|
|
37
|
+
`}render(){let e=this.selectedParameter?.parameter.replace(/^metadata\./i,``),t=!this._hasParameterName||this._duplicateName;return h`
|
|
38
38
|
<div class="parameter-control">
|
|
39
|
-
${this.selectedParameter?
|
|
39
|
+
${this.selectedParameter?h`
|
|
40
40
|
<luzmo-tags class="selected-parameter-tags">
|
|
41
41
|
<luzmo-tag
|
|
42
42
|
class="selected-parameter"
|
|
@@ -51,7 +51,7 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
51
51
|
${e}
|
|
52
52
|
</luzmo-tag>
|
|
53
53
|
</luzmo-tags>
|
|
54
|
-
`:
|
|
54
|
+
`:g}
|
|
55
55
|
<luzmo-action-button
|
|
56
56
|
id="parameter-trigger"
|
|
57
57
|
class="parameter-trigger"
|
|
@@ -107,23 +107,23 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
107
107
|
${n(`Add`,{desc:`Create a new filter parameter`})}
|
|
108
108
|
</luzmo-button>
|
|
109
109
|
</div>
|
|
110
|
-
${this._duplicateName?
|
|
110
|
+
${this._duplicateName?h`<div class="validation-message" role="alert">
|
|
111
111
|
${n(`A parameter with this name already exists.`,{desc:`Duplicate filter parameter name error`})}
|
|
112
|
-
</div>`:
|
|
113
|
-
${this._parameterOptions.length>0?
|
|
112
|
+
</div>`:g}
|
|
113
|
+
${this._parameterOptions.length>0?h`<luzmo-options
|
|
114
114
|
class="parameter-options"
|
|
115
115
|
size=${this.size}
|
|
116
116
|
.label=${n(`Available parameters`,{desc:`Accessible label of the filter parameter list`})}
|
|
117
117
|
.options=${this._parameterOptions}
|
|
118
118
|
.value=${this.selectedParameter?[this.selectedParameter.parameter]:[]}
|
|
119
119
|
@change=${this._handleOptionsChange}
|
|
120
|
-
></luzmo-options>`:
|
|
120
|
+
></luzmo-options>`:g}
|
|
121
121
|
${this._renderParameterType()}
|
|
122
122
|
</div>
|
|
123
123
|
</luzmo-popover>
|
|
124
124
|
</luzmo-overlay>
|
|
125
125
|
</div>
|
|
126
|
-
`}};t([
|
|
126
|
+
`}};t([_({attribute:!1})],K.prototype,`parameters`,void 0),t([_({attribute:!1})],K.prototype,`allowedTypes`,void 0),t([_({attribute:!1})],K.prototype,`selectedParameter`,void 0),t([_({attribute:!1})],K.prototype,`currentValue`,void 0),t([_({type:Boolean,reflect:!0})],K.prototype,`disabled`,void 0),t([_({type:Boolean,reflect:!0})],K.prototype,`readonly`,void 0),t([_({type:Boolean,reflect:!0})],K.prototype,`quiet`,void 0),t([v()],K.prototype,`_open`,void 0),t([v()],K.prototype,`_newParameterName`,void 0),t([ne(`luzmo-overlay`)],K.prototype,`_overlay`,void 0),t([ne(`.parameter-trigger`)],K.prototype,`_triggerElement`,void 0),t([ne(`.parameter-options`)],K.prototype,`_optionsElement`,void 0),K=t([i()],K),typeof customElements<`u`&&!customElements.get(`luzmo-filter-parameter-picker`)&&customElements.define(`luzmo-filter-parameter-picker`,K);var Bt=`:host{flex-direction:row;min-width:0;max-width:100%;display:flex}luzmo-text-field{min-width:var(--luzmo-filter-value-picker-control-min-width,var(--filter-value-picker-control-min-width));max-width:100%}luzmo-filter-value-picker-datetime,luzmo-filter-value-picker-hierarchy,luzmo-filter-value-picker-numeric{flex:1;min-width:0;max-width:100%}:host{--filter-value-picker-control-min-width:0}`,Vt=`:host{gap:var(--luzmo-filter-value-picker-datetime-gap,var(--filter-value-picker-datetime-gap));flex-flow:row;width:100%;min-width:0;max-width:100%;display:flex}luzmo-date-time-picker{--luzmo-date-time-picker-min-width:var(--luzmo-filter-value-picker-datetime-control-min-width,var(--filter-value-picker-datetime-control-min-width));flex:auto;min-width:0;max-width:100%}luzmo-number-field{flex:0 1 var(--luzmo-filter-value-picker-datetime-quantity-width,var(--filter-value-picker-datetime-quantity-width));min-width:0;max-width:100%}luzmo-picker{flex:1 1 var(--luzmo-filter-value-picker-datetime-control-min-width,var(--filter-value-picker-datetime-control-min-width));min-width:0;max-width:100%}:host{--filter-value-picker-datetime-gap:var(--luzmo-spacing-3);--filter-value-picker-datetime-control-min-width:5rem;--filter-value-picker-datetime-quantity-width:4.5rem}:host([size=s]){--filter-value-picker-datetime-gap:var(--luzmo-spacing-2)}:host([size=m]){--filter-value-picker-datetime-gap:var(--luzmo-spacing-3)}:host([size=l]){--filter-value-picker-datetime-gap:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1))}:host([size=xl]){--filter-value-picker-datetime-gap:var(--luzmo-spacing-4)}`,q=class extends r(S(x,{validSizes:Object.values(b)})){constructor(...e){super(...e),this.contentLanguage=`en`,this.quiet=!1,this.readonly=!1,this.disabled=!1}static get styles(){return[y(Vt)]}willUpdate(e){super.willUpdate(e),e.get(`filter`)&&([`last_now`,`last_available`,`next_now`,`more_than_ago`,`or_more_ago`].includes(this.filter?.expression)?this.filter.parameters[1]={quantity:this.filter?.parameters?.[1]?.quantity??E(this.filter?.expression,1),unit:this.filter?.parameters?.[1]?.unit??1}:[`last_completed`,`next_full`,`to_date`].includes(this.filter?.expression)?this.filter.parameters[1]={unit:this.filter?.parameters?.[1]?.unit??1}:this.filter.parameters[1]=typeof this.filter.parameters[1]==`string`?this.filter.parameters[1]:(/* @__PURE__ */ new Date()).toISOString())}_sendChangeEvent(){this.filter.parameters=[{...this.filter?.parameters?.[0]},this._value],this.dispatchEvent(new CustomEvent(`luzmo-filter-value-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{value:this._value}}))}setDate(e){this.readonly||this.disabled||(this._value=e.detail.value,this._value!==this.filter?.parameters?.[1]&&this._sendChangeEvent())}setUnit(e){if(this.readonly||this.disabled)return;let t=o.find(t=>t.key===e?.target?.value)?.level;this.filter?.parameters?.[1]?.unit!==t&&(this._value={unit:t??1,quantity:this.filter?.parameters?.[1]?.quantity??E(this.filter?.expression,1)},this._sendChangeEvent())}setQuantity(e){if(this.readonly||this.disabled)return;let t=e?.target?.value;if(!Number.isFinite(t)||t<1)return;let n=E(this.filter?.expression,t);this.filter?.parameters?.[1]?.quantity!==n&&(this._value={quantity:n,unit:this.filter?.parameters?.[1]?.unit??1},this._sendChangeEvent())}renderDatePicker(){let e=`second`;return this.filter?.parameters?.[0]?.lowestLevel>4&&(e=this.filter?.parameters?.[0]?.lowestLevel===5?`day`:this.filter?.parameters?.[0]?.lowestLevel===6?`hour`:this.filter?.parameters?.[0]?.lowestLevel===7?`minute`:`second`),h`<luzmo-date-time-picker
|
|
127
127
|
aria-label=${n(`Filter date`,{desc:`Aria label for filter date picker`})}
|
|
128
128
|
.size=${this.size}
|
|
129
129
|
.quiet=${this.quiet}
|
|
@@ -133,18 +133,20 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
133
133
|
.timeZone=${this.timeZone}
|
|
134
134
|
@change=${this.setDate}
|
|
135
135
|
.value=${this.filter?.parameters?.[1]}
|
|
136
|
-
></luzmo-date-time-picker>`}renderQuantityField(){return
|
|
136
|
+
></luzmo-date-time-picker>`}renderQuantityField(){let e=this.filter?.parameters?.[1]?.quantity;return h`<luzmo-number-field
|
|
137
137
|
label=${n(`Quantity`,{desc:`Label for quantity number field`})}
|
|
138
|
+
min="1"
|
|
139
|
+
step="1"
|
|
138
140
|
.size=${this.size}
|
|
139
141
|
.quiet=${this.quiet}
|
|
140
142
|
.readonly=${this.readonly}
|
|
141
143
|
.disabled=${this.disabled}
|
|
142
|
-
.value=${this.filter?.
|
|
144
|
+
.value=${typeof e==`number`?se(this.filter?.expression,e):e}
|
|
143
145
|
@input=${this.setQuantity}
|
|
144
146
|
@change=${this.setQuantity}
|
|
145
|
-
></luzmo-number-field>`}renderUnitPicker(){let e=o.map(e=>
|
|
147
|
+
></luzmo-number-field>`}renderUnitPicker(){let e=o.map(e=>h`<luzmo-menu-item .value=${e.key}>
|
|
146
148
|
${e.i18n()}
|
|
147
|
-
</luzmo-menu-item>`),t=o.find(e=>e.level===this.filter?.parameters?.[1]?.unit)?.key??o?.[0]?.key;return
|
|
149
|
+
</luzmo-menu-item>`),t=o.find(e=>e.level===this.filter?.parameters?.[1]?.unit)?.key??o?.[0]?.key;return h`<luzmo-picker
|
|
148
150
|
.label=${n(`Time unit`,{desc:`Aria label for time unit picker`})}
|
|
149
151
|
.size=${this.size}
|
|
150
152
|
.quiet=${this.quiet}
|
|
@@ -154,7 +156,7 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
154
156
|
@change=${this.setUnit}
|
|
155
157
|
variant="highlight"
|
|
156
158
|
>${e}</luzmo-picker
|
|
157
|
-
>`}render(){let e=this.filter?.expression;return[`last_now`,`last_available`,`next_now`,`more_than_ago`,`or_more_ago`].includes(e)?
|
|
159
|
+
>`}render(){let e=this.filter?.expression;return[`last_now`,`last_available`,`next_now`,`more_than_ago`,`or_more_ago`].includes(e)?h`${this.renderQuantityField()}${this.renderUnitPicker()}`:[`last_completed`,`next_full`].includes(e)?this.renderUnitPicker():this.renderDatePicker()}};t([_({type:String,attribute:`content-language`,reflect:!0})],q.prototype,`contentLanguage`,void 0),t([_({type:String,attribute:`time-zone`,reflect:!0})],q.prototype,`timeZone`,void 0),t([_({type:Object,reflect:!1})],q.prototype,`filter`,void 0),t([_({type:Boolean,reflect:!0})],q.prototype,`quiet`,void 0),t([_({type:Boolean,reflect:!0})],q.prototype,`readonly`,void 0),t([_({type:Boolean,reflect:!0})],q.prototype,`disabled`,void 0),q=t([i()],q),customElements.get(`luzmo-filter-value-picker-datetime`)||customElements.define(`luzmo-filter-value-picker-datetime`,q);var Ht=`:host{flex-direction:row;flex-shrink:1;min-width:0;display:flex}luzmo-select,luzmo-text-field{min-width:var(--luzmo-filter-value-picker-hierarchy-control-min-width,var(--filter-value-picker-hierarchy-control-min-width));flex:auto;max-width:100%}.missing-value{color:var(--luzmo-filter-value-picker-hierarchy-missing-value-color,#767676)}:host{--filter-value-picker-hierarchy-control-min-width:0}`,Ut=5e3,J=class extends r(S(x,{validSizes:Object.values(b)})){constructor(...e){super(...e),this.contentLanguage=`en`,this.quiet=!1,this.readonly=!1,this.disabled=!1,this._hierarchyValues=[],this._retrieving=!1,this._search=``,this._error=null,this._pending=!1,this._allValuesRetrieved=!1,this._hierarchyRequestGeneration=0,this._runningQueries=[]}static get styles(){return[y(Ht)]}connectedCallback(){super.connectedCallback();let e={};this.apiUrl&&(e.apiUrl=this.apiUrl),this.cacheTime&&(e.staleTime=this.cacheTime,e.gcTime=this.cacheTime*2),this.authKey&&this.authToken&&(e.authKey=this.authKey,e.authToken=this.authToken),p.configure(e)}willUpdate(e){if(super.willUpdate(e),e.has(`filter`)&&this.filter){let t=e.get(`filter`),n=t?.expression,r=t?.parameters?.[0],i=this.filter?.parameters?.[0],a=(r?.columnId||r?.formulaId)!==(this.filter?.parameters?.[0]?.columnId||this.filter?.parameters?.[0]?.formulaId)||r?.datasetId!==i?.datasetId;this.filter?.parameters?.[1]!==this._lastResolvedOutput&&(this._lastResolutionKey=void 0),a&&(this._hierarchyRequestGeneration++,this._pending=!1,this._retrieving=!1),a&&([`? in ?`,`? not in ?`,`? = ?`,`? != ?`].includes(this.filter?.expression)||![`? in ?`,`? not in ?`,`? = ?`,`? != ?`].includes(n))&&(this._hierarchyValues=[],this._allValuesRetrieved=!1),[`? in ?`,`? not in ?`,`? = ?`,`? != ?`].includes(this.filter.expression)&&this._hierarchyValues.length===0&&this._restoreCachedFirstPage()}}updated(e){if(super.updated(e),!e.has(`filter`)||!this.filter)return;let t=e.get(`filter`)?.expression,n=[`? = ?`,`? != ?`].includes(this.filter.expression)&&t!==void 0&&![`? in ?`,`? not in ?`,`? = ?`,`? != ?`].includes(t);n&&this._hierarchyValues.length>0?this._resolveSingleSelectValue():n&&!this._retrieving&&queueMicrotask(()=>{[`? = ?`,`? != ?`].includes(this.filter?.expression)&&this._hierarchyValues.length===0&&!this._retrieving&&this._fetchHierarchyValues(0,!0)})}_buildHierarchyQuery(e=0,t=this._search){let n=this.filter?.parameters?.[0];if(!n?.datasetId||!n.columnId&&!n.formulaId)return null;let r={column_id:n.columnId,formula_id:n.formulaId,dataset_id:n.datasetId},i={dimensions:[r],where:[],order:[{...r,order:`asc`}],limit:{by:Ut,offset:e}};return t&&i.where.push({expression:`? like ?`,parameters:[r,t]}),i}_getValues(e){return e&&Array.isArray(e.data)?e.data.map(e=>e[0]):[]}_applyHierarchyResult(e,t,n){let r=this._getValues(e);n||(this._allValuesRetrieved=r.length<Ut),this._hierarchyValues=t>0?[...this._hierarchyValues,...r]:r}_restoreCachedFirstPage(){let e=this._buildHierarchyQuery(0,``);if(!e)return!1;let t=p.getCachedData(e);return t?(this._applyHierarchyResult(t,0,``),this._retrieving=!1,this._error=null,!0):!1}_getMemberLabel(e){let t=m(e?.name,this.contentLanguage,{allowEmpty:!0});return typeof t==`string`?t:``}_findExactMember(e){return this._hierarchyValues.find(t=>String(t?.id)===e||this._getMemberLabel(t)===e)}_resolveSingleSelectValue(){if(![`? = ?`,`? != ?`].includes(this.filter?.expression)||this._hierarchyValues.length===0)return;let e=this.filter?.parameters?.[1];if(typeof e!=`string`&&typeof e!=`number`)return;let t=String(e),n=this._findExactMember(t),r=t.toLocaleLowerCase(this.contentLanguage),i=n??this._hierarchyValues.find(e=>String(e?.id).toLocaleLowerCase(this.contentLanguage).includes(r)||this._getMemberLabel(e).toLocaleLowerCase(this.contentLanguage).includes(r)),a=(n??i??this._hierarchyValues[0])?.id;if(typeof a!=`string`&&typeof a!=`number`)return;let o=this.filter.parameters[0],s=[o.datasetId,o.columnId??o.formulaId,this.filter.expression,String(e),String(a)].join(`|`);s!==this._lastResolutionKey&&(this._lastResolutionKey=s,this._lastResolvedOutput=a,this._value=a,this.filter={...this.filter,parameters:[{...this.filter.parameters[0]},a]},this._sendChangeEvent())}async _fetchHierarchyValues(e=0,t=!1){let n=this._search;if(!n&&this._allValuesRetrieved||e===0&&!n&&(this._restoreCachedFirstPage()||this._hierarchyValues.length>0)){this._retrieving=!1;return}if(!this.filter?.parameters?.[0]){this._retrieving=!1,this._error=`Missing column parameters`;return}let r=this.filter.parameters[0],i=r.columnId,a=r.formulaId,o=r.datasetId;if(!i&&!a){this._retrieving=!1,this._error=`Missing column id or formula id`;return}if(!o){this._retrieving=!1,this._error=`Missing dataset id`;return}let s=this._buildHierarchyQuery(e,n);if(!s)return;let c=this._hierarchyRequestGeneration;this._pending=t,this._retrieving=!0,this._error=null;let l=new AbortController,u=new Promise((e,t)=>{p.fetchData(s).then(e).catch(t),l.signal.addEventListener(`abort`,()=>{console.warn(`Request aborted`),t({status:`aborted`})})}),d={promise:u,abortController:l};this._runningQueries.push(d);try{let r=await u;if(c!==this._hierarchyRequestGeneration)return;this._applyHierarchyResult(r,e,n),t&&!n&&this._resolveSingleSelectValue()}catch(e){if(c!==this._hierarchyRequestGeneration||e?.status===`aborted`)return;this._error=e instanceof Error?e.message:`Unknown error`,this._hierarchyValues=[]}finally{this._runningQueries=this._runningQueries.filter(e=>e.promise!==u),c===this._hierarchyRequestGeneration&&(this._pending=!1,this._retrieving=!1)}}_sendChangeEvent(){this.dispatchEvent(new CustomEvent(`luzmo-filter-value-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{value:this._value}}))}setHierarchy(e){if(this.readonly||this.disabled)return;let t;t=[`? in ?`,`? not in ?`].includes(this.filter?.expression)?e?.detail?.value:[`? = ?`,`? != ?`].includes(this.filter?.expression)?e?.detail?.value?.[0]:e?.target?.value,this._value!==t&&(this._value=t,this.filter={...this.filter,parameters:[{...this.filter?.parameters?.[0]},this._value]},this._sendChangeEvent())}onScrolled(e){!this._retrieving&&!this._allValuesRetrieved&&e?.detail?.last===this._hierarchyValues.length-1&&this._fetchHierarchyValues(this._hierarchyValues.length)}renderTextField(){return h`<luzmo-text-field
|
|
158
160
|
label=${n(`Filter value`,{desc:`Label for filter value text field`})}
|
|
159
161
|
.size=${this.size}
|
|
160
162
|
.quiet=${this.quiet}
|
|
@@ -163,7 +165,7 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
163
165
|
@change=${this.setHierarchy}
|
|
164
166
|
@input=${this.setHierarchy}
|
|
165
167
|
.value=${this.filter?.parameters?.[1]??``}
|
|
166
|
-
></luzmo-text-field>`}setSearchString(e){this._search=e?.detail?.string??``,this._allValuesRetrieved||(this._searchQueryTimeout&&(this._runningQueries.forEach(e=>{e?.abortController&&e.abortController.abort()}),this._runningQueries=[],clearTimeout(this._searchQueryTimeout)),this._searchQueryTimeout=setTimeout(()=>{this._fetchHierarchyValues()},500))}resetSearchString(){this._search=``,this._hierarchyRequestGeneration++,this._pending=!1,this._retrieving=!1,this._restoreCachedFirstPage()}onOpened(){this._fetchHierarchyValues()}_getSelectedOptionValue(){let e=this.filter?.parameters?.[1];return typeof e!=`string`&&typeof e!=`number`?e:this._findExactMember(String(e))?.id??e}renderHierarchyPicker(){if(this._error)return
|
|
168
|
+
></luzmo-text-field>`}setSearchString(e){this._search=e?.detail?.string??``,this._allValuesRetrieved||(this._searchQueryTimeout&&(this._runningQueries.forEach(e=>{e?.abortController&&e.abortController.abort()}),this._runningQueries=[],clearTimeout(this._searchQueryTimeout)),this._searchQueryTimeout=setTimeout(()=>{this._fetchHierarchyValues()},500))}resetSearchString(){this._search=``,this._hierarchyRequestGeneration++,this._pending=!1,this._retrieving=!1,this._restoreCachedFirstPage()}onOpened(){this._fetchHierarchyValues()}_getSelectedOptionValue(){let e=this.filter?.parameters?.[1];return typeof e!=`string`&&typeof e!=`number`?e:this._findExactMember(String(e))?.id??e}renderHierarchyPicker(){if(this._error)return h`<div class="error" role="alert">Error: ${this._error}</div>`;let e=(this._search?this._hierarchyValues.filter(e=>m(e.name,this.contentLanguage,{allowEmpty:!0})?.toLowerCase().includes(this._search.toLowerCase())||e.toString().toLowerCase().includes(this._search.toLowerCase())):this._hierarchyValues).map(e=>{let t=m(e?.name,this.contentLanguage)??`N/A`;return typeof t!=`string`&&(t=`N/A`),{value:e?.id,label:t}}),t=this.filter?.expression,r=[`? = ?`,`? != ?`].includes(t),i=n(`Selected {count} items`),a=n(`Search`),o=n(`No data`),s=n(`No results`),c=n(`Select...`);return h`<luzmo-select
|
|
167
169
|
.size=${this.size}
|
|
168
170
|
.label=${c}
|
|
169
171
|
.retrieving=${this._retrieving}
|
|
@@ -188,7 +190,7 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
188
190
|
.options=${e}
|
|
189
191
|
.value=${r?[this._getSelectedOptionValue()]:this.filter?.parameters?.[1]}
|
|
190
192
|
>
|
|
191
|
-
</luzmo-select>`}render(){let e=this.filter?.expression;return[`? in ?`,`? not in ?`,`? = ?`,`? != ?`].includes(e)?this.renderHierarchyPicker():this.renderTextField()}};t([
|
|
193
|
+
</luzmo-select>`}render(){let e=this.filter?.expression;return[`? in ?`,`? not in ?`,`? = ?`,`? != ?`].includes(e)?this.renderHierarchyPicker():this.renderTextField()}};t([_({type:String,attribute:`api-url`,reflect:!0})],J.prototype,`apiUrl`,void 0),t([_({type:String,attribute:`auth-key`,reflect:!0})],J.prototype,`authKey`,void 0),t([_({type:String,attribute:`auth-token`,reflect:!0})],J.prototype,`authToken`,void 0),t([_({type:Number,attribute:`cache-time`,reflect:!0})],J.prototype,`cacheTime`,void 0),t([_({type:String,attribute:`content-language`,reflect:!0})],J.prototype,`contentLanguage`,void 0),t([_({type:Object,reflect:!1})],J.prototype,`filter`,void 0),t([_({type:Boolean,reflect:!0})],J.prototype,`quiet`,void 0),t([_({type:Boolean,reflect:!0})],J.prototype,`readonly`,void 0),t([_({type:Boolean,reflect:!0})],J.prototype,`disabled`,void 0),t([v()],J.prototype,`_hierarchyValues`,void 0),t([v()],J.prototype,`_retrieving`,void 0),t([v()],J.prototype,`_search`,void 0),t([v()],J.prototype,`_error`,void 0),t([v()],J.prototype,`_pending`,void 0),J=t([i()],J),customElements.get(`luzmo-filter-value-picker-hierarchy`)||customElements.define(`luzmo-filter-value-picker-hierarchy`,J);var Wt=`:host{flex-direction:row;flex-shrink:1;min-width:0;display:flex}luzmo-number-field,luzmo-select{min-width:var(--luzmo-filter-value-picker-numeric-control-min-width,var(--filter-value-picker-numeric-control-min-width));flex:auto;max-width:100%}.missing-value{opacity:.4}:host{--filter-value-picker-numeric-control-min-width:0}`,Gt=5e3,Y=class extends r(S(x,{validSizes:Object.values(b)})){constructor(...e){super(...e),this.contentLanguage=`en`,this.quiet=!1,this.readonly=!1,this.disabled=!1,this._numericValues=[],this._retrieving=!0,this._search=``,this._error=null,this._allValuesRetrieved=!1,this._runningQueries=[]}static get styles(){return[y(Wt)]}connectedCallback(){super.connectedCallback();let e={};this.apiUrl&&(e.apiUrl=this.apiUrl),this.cacheTime&&(e.staleTime=this.cacheTime,e.gcTime=this.cacheTime*2),this.authKey&&this.authToken&&(e.authKey=this.authKey,e.authToken=this.authToken),p.configure(e)}willUpdate(e){if(super.willUpdate(e),e.has(`filter`)&&this.filter){let t=e.get(`filter`)?.expression,n=this.filter?.expression;((e.get(`filter`)?.parameters?.[0]?.columnId||e.get(`filter`)?.parameters?.[0]?.formulaId)!==(this.filter?.parameters?.[0]?.columnId||this.filter?.parameters?.[0]?.formulaId)||![`? in ?`,`? not in ?`].includes(t))&&[`? in ?`,`? not in ?`].includes(n)&&(this._numericValues=[],this._allValuesRetrieved=!1,this._retrieving=!0)}}async _fetchNumericValues(e=0){if(this._allValuesRetrieved){this._retrieving=!1;return}if(!this.filter?.parameters?.[0]){this._retrieving=!1,this._error=`Missing column parameters`;return}let t=this.filter.parameters[0],n=t.columnId,r=t.formulaId,i=t.datasetId;if(!n&&!r){this._retrieving=!1,this._error=`Missing column id or formula id`;return}if(!i){this._retrieving=!1,this._error=`Missing dataset id`;return}this._retrieving=!0,this._error=null;let a={expression:`? like ?`,parameters:[{dataset_id:i,expression:`CAST({${i}:${n??r}},hierarchy)`},this._search]},o={dimensions:[{column_id:n,formula_id:r,dataset_id:i}],where:[],order:[{column_id:n,formula_id:r,dataset_id:i,order:`asc`}],limit:{by:Gt,offset:e}};this._search&&!this._allValuesRetrieved&&o.where.push(a);let s=new AbortController,c=new Promise((e,t)=>{p.fetchData(o).then(e).catch(t),s.signal.addEventListener(`abort`,()=>{console.warn(`Request aborted`),t({status:`aborted`})})}),l={promise:c,abortController:s};this._runningQueries.push(l);try{let t=await c,n=t&&Array.isArray(t.data)?t.data.map(e=>e[0]):[];this._search||(this._allValuesRetrieved=n.length<Gt),this._numericValues=e>0?[...this._numericValues,...n]:n}catch(e){if(e?.status===`aborted`)return;this._error=e instanceof Error?e.message:`Unknown error`,this._numericValues=[]}finally{this._runningQueries=this._runningQueries.filter(e=>e.promise!==c),this._retrieving=!1}}_sendChangeEvent(){this.dispatchEvent(new CustomEvent(`luzmo-filter-value-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{value:this._value}}))}setValue(e){if(this.readonly||this.disabled)return;let t=[`? in ?`,`? not in ?`].includes(this.filter?.expression)?e?.detail?.value:e?.target?.value;this._value!==t&&(this._value=t,this.filter={...this.filter,parameters:[{...this.filter?.parameters?.[0]},t]},this._sendChangeEvent())}selectValue(e){if(this.readonly||this.disabled)return;let t=(e.detail?.value??``).map(e=>Number.parseFloat(e));this.filter={...this.filter,parameters:[{...this.filter?.parameters?.[0]},t]},this._value=t,this._sendChangeEvent()}onScrolled(e){!this._retrieving&&!this._allValuesRetrieved&&e?.detail?.last===this._numericValues.length-1&&this._fetchNumericValues(this._numericValues.length)}renderNumberField(){return h`<luzmo-number-field
|
|
192
194
|
label="Numeric filter value"
|
|
193
195
|
grows
|
|
194
196
|
.size=${this.size}
|
|
@@ -198,7 +200,7 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
198
200
|
@change=${this.setValue}
|
|
199
201
|
@input=${this.setValue}
|
|
200
202
|
.value=${this.filter?.parameters?.[1]}
|
|
201
|
-
></luzmo-number-field>`}setSearchString(e){this._search=e?.detail?.string??``,this._allValuesRetrieved||(this._searchQueryTimeout&&(this._runningQueries.forEach(e=>{e?.abortController&&e.abortController.abort()}),this._runningQueries=[],clearTimeout(this._searchQueryTimeout)),this._searchQueryTimeout=setTimeout(()=>{this._fetchNumericValues()},500))}resetSearchString(){this._search=``}onOpened(){this._fetchNumericValues()}renderValuePicker(){if(this._error)return
|
|
203
|
+
></luzmo-number-field>`}setSearchString(e){this._search=e?.detail?.string??``,this._allValuesRetrieved||(this._searchQueryTimeout&&(this._runningQueries.forEach(e=>{e?.abortController&&e.abortController.abort()}),this._runningQueries=[],clearTimeout(this._searchQueryTimeout)),this._searchQueryTimeout=setTimeout(()=>{this._fetchNumericValues()},500))}resetSearchString(){this._search=``}onOpened(){this._fetchNumericValues()}renderValuePicker(){if(this._error)return h`<div class="error" role="alert">${this._error}</div>`;let e=this._numericValues.filter(e=>e.toString().toLowerCase().includes(this._search.toLowerCase())).map(e=>({value:e,label:e})),t=n(`Selected {count} items`),r=n(`Search`),i=n(`No data`),a=n(`No results`),o=n(`Select...`);return h`<luzmo-select
|
|
202
204
|
.size=${this.size}
|
|
203
205
|
.label=${o}
|
|
204
206
|
.retrieving=${this._retrieving}
|
|
@@ -222,7 +224,7 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
222
224
|
.options=${e}
|
|
223
225
|
.value=${this.filter?.parameters?.[1]}
|
|
224
226
|
>
|
|
225
|
-
</luzmo-select>`}render(){let e=this.filter?.expression;return[`? in ?`,`? not in ?`].includes(e)?this.renderValuePicker():this.renderNumberField()}};t([
|
|
227
|
+
</luzmo-select>`}render(){let e=this.filter?.expression;return[`? in ?`,`? not in ?`].includes(e)?this.renderValuePicker():this.renderNumberField()}};t([_({type:String,attribute:`api-url`,reflect:!0})],Y.prototype,`apiUrl`,void 0),t([_({type:String,attribute:`auth-key`,reflect:!0})],Y.prototype,`authKey`,void 0),t([_({type:String,attribute:`auth-token`,reflect:!0})],Y.prototype,`authToken`,void 0),t([_({type:Number,attribute:`cache-time`,reflect:!0})],Y.prototype,`cacheTime`,void 0),t([_({type:String,attribute:`content-language`,reflect:!0})],Y.prototype,`contentLanguage`,void 0),t([_({type:Object,reflect:!1})],Y.prototype,`filter`,void 0),t([_({type:Boolean,reflect:!0})],Y.prototype,`quiet`,void 0),t([_({type:Boolean,reflect:!0})],Y.prototype,`readonly`,void 0),t([_({type:Boolean,reflect:!0})],Y.prototype,`disabled`,void 0),t([v()],Y.prototype,`_numericValues`,void 0),t([v()],Y.prototype,`_retrieving`,void 0),t([v()],Y.prototype,`_search`,void 0),t([v()],Y.prototype,`_error`,void 0),Y=t([i()],Y),customElements.get(`luzmo-filter-value-picker-numeric`)||customElements.define(`luzmo-filter-value-picker-numeric`,Y);var X=class extends r(S(x,{validSizes:Object.values(b)})){constructor(...e){super(...e),this.contentLanguage=`en`,this.quiet=!1,this.readonly=!1,this.disabled=!1,this._expressionsWithoutValuePicker=/* @__PURE__ */ new Set([`? is null`,`? is not null`,`to_date`])}static get styles(){return[y(Bt)]}_sendChangeEvent(e){this.dispatchEvent(new CustomEvent(`luzmo-filter-value-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{value:e}}))}setFilterValue(e){e.stopPropagation(),!(this.readonly||this.disabled)&&this._sendChangeEvent(e?.detail?.value)}renderNumericValuePicker(){return h`<luzmo-filter-value-picker-numeric
|
|
226
228
|
.apiUrl=${this.apiUrl}
|
|
227
229
|
.authKey=${this.authKey}
|
|
228
230
|
.authToken=${this.authToken}
|
|
@@ -235,7 +237,7 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
235
237
|
.readonly=${this.readonly}
|
|
236
238
|
.disabled=${this.disabled}
|
|
237
239
|
@luzmo-filter-value-changed=${this.setFilterValue}
|
|
238
|
-
></luzmo-filter-value-picker-numeric>`}renderHierarchyValuePicker(){return
|
|
240
|
+
></luzmo-filter-value-picker-numeric>`}renderHierarchyValuePicker(){return h`<luzmo-filter-value-picker-hierarchy
|
|
239
241
|
.apiUrl=${this.apiUrl}
|
|
240
242
|
.authKey=${this.authKey}
|
|
241
243
|
.authToken=${this.authToken}
|
|
@@ -248,7 +250,7 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
248
250
|
.readonly=${this.readonly}
|
|
249
251
|
.disabled=${this.disabled}
|
|
250
252
|
@luzmo-filter-value-changed=${this.setFilterValue}
|
|
251
|
-
></luzmo-filter-value-picker-hierarchy>`}renderDateTimeValuePicker(){return
|
|
253
|
+
></luzmo-filter-value-picker-hierarchy>`}renderDateTimeValuePicker(){return h`<luzmo-filter-value-picker-datetime
|
|
252
254
|
.apiUrl=${this.apiUrl}
|
|
253
255
|
.authKey=${this.authKey}
|
|
254
256
|
.authToken=${this.authToken}
|
|
@@ -262,16 +264,16 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
262
264
|
.readonly=${this.readonly}
|
|
263
265
|
.disabled=${this.disabled}
|
|
264
266
|
@luzmo-filter-value-changed=${this.setFilterValue}
|
|
265
|
-
></luzmo-filter-value-picker-datetime>`}renderDisabledTextField(){let e=this.filter?.parameters?.[1]??``;return
|
|
267
|
+
></luzmo-filter-value-picker-datetime>`}renderDisabledTextField(){let e=this.filter?.parameters?.[1]??``;return h`<luzmo-text-field
|
|
266
268
|
label=${n(`Filter value`,{desc:`Label for filter value text field`})}
|
|
267
269
|
.size=${this.size}
|
|
268
270
|
.value=${e}
|
|
269
271
|
.disabled=${!0}
|
|
270
|
-
></luzmo-text-field>`}render(){let e=this.valueType??``,t=this.filter?.expression;return!t||this._expressionsWithoutValuePicker.has(t)?
|
|
272
|
+
></luzmo-text-field>`}render(){let e=this.valueType??``,t=this.filter?.expression;return!t||this._expressionsWithoutValuePicker.has(t)?h`
|
|
271
273
|
|
|
272
|
-
`:[`numeric`,`hierarchy`,`datetime`].includes(e)?e===`numeric`?this.renderNumericValuePicker():e===`datetime`?this.renderDateTimeValuePicker():this.renderHierarchyValuePicker():typeof this.filter?.parameters?.[1]==`string`?this.renderDisabledTextField():
|
|
274
|
+
`:[`numeric`,`hierarchy`,`datetime`].includes(e)?e===`numeric`?this.renderNumericValuePicker():e===`datetime`?this.renderDateTimeValuePicker():this.renderHierarchyValuePicker():typeof this.filter?.parameters?.[1]==`string`?this.renderDisabledTextField():h`
|
|
273
275
|
|
|
274
|
-
`}};t([g({type:String,attribute:`api-url`,reflect:!0})],X.prototype,`apiUrl`,void 0),t([g({type:String,attribute:`auth-key`,reflect:!0})],X.prototype,`authKey`,void 0),t([g({type:String,attribute:`auth-token`,reflect:!0})],X.prototype,`authToken`,void 0),t([g({type:Number,attribute:`cache-time`,reflect:!0})],X.prototype,`cacheTime`,void 0),t([g({type:String,attribute:`content-language`,reflect:!0})],X.prototype,`contentLanguage`,void 0),t([g({type:String,attribute:`time-zone`,reflect:!0})],X.prototype,`timeZone`,void 0),t([g({type:String,attribute:`value-type`,reflect:!0})],X.prototype,`valueType`,void 0),t([g({type:Object,reflect:!1})],X.prototype,`filter`,void 0),t([g({type:Boolean,reflect:!0})],X.prototype,`quiet`,void 0),t([g({type:Boolean,reflect:!0})],X.prototype,`readonly`,void 0),t([g({type:Boolean,reflect:!0})],X.prototype,`disabled`,void 0),customElements.get(`luzmo-filter-value-picker`)||customElements.define(`luzmo-filter-value-picker`,X);var Vt=`:host{box-sizing:border-box;min-width:0;max-width:100%;font-family:var(--luzmo-font-family);color:var(--luzmo-font-color);flex-direction:row;display:flex}:host([display=text]){vertical-align:middle;align-items:center;max-width:100%;display:inline-flex}.filter-item-text{min-width:0;max-width:100%;font-size:var(--luzmo-filter-item-text-font-size,var(--filter-item-text-font-size));white-space:normal;flex-wrap:wrap;align-items:center;column-gap:.25em;line-height:1.5;display:inline-flex}.filter-item-text-field{white-space:nowrap}.filter-item-column-badge{white-space:nowrap;align-items:center;display:inline-flex}.filter-item-text-field-icon{margin-inline-end:var(--luzmo-filter-item-text-icon-gap,var(--filter-item-text-icon-gap))}.filter-item-column-badge luzmo-icon{--luzmo-icon-vertical-align:0}.filter-item-text-expression{color:var(--luzmo-filter-item-text-expression-color,var(--filter-item-text-expression-color));font-weight:var(--luzmo-filter-item-text-expression-font-weight,var(--filter-item-text-expression-font-weight))}:host([column-display=outline]) .filter-item-column-badge luzmo-badge{--luzmo-badge-border-color:var(--luzmo-filter-item-column-badge-color,var(--luzmo-border-color-full));--luzmo-badge-content-color:var(--luzmo-filter-item-column-badge-font-color,var(--luzmo-filter-item-column-badge-color,var(--luzmo-font-color)))}:host([column-display=subtle]) .filter-item-column-badge luzmo-badge{--luzmo-badge-background-color:color-mix(in srgb, var(--luzmo-filter-item-column-badge-color,var(--luzmo-selected-color-hard)) 10%, var(--luzmo-background-color));--luzmo-badge-content-color:var(--luzmo-filter-item-column-badge-font-color)}:host([column-display=fill]) .filter-item-column-badge luzmo-badge{--luzmo-badge-background-color:var(--luzmo-filter-item-column-badge-color,var(--luzmo-selected-color-hard));--luzmo-badge-border-color:transparent;--luzmo-badge-content-color:var(--luzmo-filter-item-column-badge-font-color,var(--luzmo-background-color))}.filter-item-text-value{align-items:center;gap:var(--luzmo-spacing-1);display:inline-flex}.filter-item-text-value luzmo-progress-circle{--luzmo-progress-circle-size:var(--filter-item-progress-circle-size)}.filter-item-text-value--has-tooltip{text-underline-offset:.15em;cursor:help;text-decoration-line:underline;text-decoration-style:dotted;text-decoration-color:currentColor}[role=group]{box-sizing:border-box;align-items:center;gap:var(--luzmo-filter-item-gap,var(--filter-item-gap));flex-flow:wrap;width:100%;min-width:0;max-width:100%;display:flex}luzmo-data-fields-select{flex:0 1 var(--luzmo-filter-item-field-width,var(--filter-item-field-width));min-width:min(100%, var(--luzmo-filter-item-field-min-width,var(--filter-item-field-min-width)));max-width:100%}luzmo-filter-expression-picker{flex:0 0 var(--luzmo-filter-item-expression-width,var(--filter-item-expression-width));max-width:100%}.value-controls{align-items:center;gap:var(--luzmo-filter-item-gap,var(--filter-item-gap));flex-wrap:nowrap;flex:var(--luzmo-filter-item-value-grow,var(--filter-item-value-grow)) 1 var(--luzmo-filter-item-value-width,var(--filter-item-value-width));min-width:min(100%, var(--luzmo-filter-item-value-min-width,var(--filter-item-value-min-width)));max-width:100%;display:flex}luzmo-filter-value-picker{flex:auto;min-width:0;max-width:100%}luzmo-filter-parameter-picker{flex:0 auto;min-width:0;max-width:100%}:host{--filter-item-gap:var(--luzmo-spacing-3);--filter-item-field-width:auto;--filter-item-expression-width:auto;--filter-item-value-width:auto;--filter-item-value-grow:0;--filter-item-field-min-width:4.5rem;--filter-item-value-min-width:4.5rem;--filter-item-text-font-size:var(--luzmo-font-size-m);--filter-item-text-icon-gap:var(--luzmo-spacing-1);--filter-item-text-expression-color:var(--luzmo-font-color);--filter-item-text-expression-font-weight:var(--luzmo-font-weight);--filter-item-progress-circle-size:var(--luzmo-component-height)}:host([size=s]){--filter-item-gap:var(--luzmo-spacing-2);--filter-item-text-font-size:var(--luzmo-font-size-s);--filter-item-progress-circle-size:var(--luzmo-component-height-s)}:host([size=m]){--filter-item-gap:var(--luzmo-spacing-3)}:host([size=l]){--filter-item-gap:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--filter-item-text-font-size:var(--luzmo-font-size-l);--filter-item-text-icon-gap:var(--luzmo-spacing-2);--filter-item-progress-circle-size:var(--luzmo-component-height-l)}:host([size=xl]){--filter-item-gap:var(--luzmo-spacing-4);--filter-item-text-font-size:var(--luzmo-font-size-xl);--filter-item-text-icon-gap:var(--luzmo-spacing-2);--filter-item-progress-circle-size:var(--luzmo-component-height-xl)}`,Z=class extends r(x(b,{validSizes:Object.values(y)})){constructor(...e){super(...e),this.apiUrl=`https://api.luzmo.com`,this.contentLanguage=`en`,this.filter={},this.display=`rich`,this.columnDisplay=`text`,this.quiet=!1,this.readonly=!1,this.disabled=!1,this.allowParameters=!1,this.parameters=[],this._loading=!1,this._datasetsDataFields=[],this._hierarchyLabels=/* @__PURE__ */ new Map,this._hierarchyLabelsLoading=!1,this._hierarchyRequest=0}static get styles(){return[v(Vt)]}connectedCallback(){if(super.connectedCallback(),this.textContext)return;let e={};this.apiUrl&&(e.apiUrl=this.apiUrl),this.cacheTime&&(e.staleTime=this.cacheTime,e.gcTime=this.cacheTime*2),e.authKey=this.authKey||``,e.authToken=this.authToken||``,f.configure(e),this.hasUpdated&&this.display===`text`&&this._loadHierarchyLabelsForText()}disconnectedCallback(){super.disconnectedCallback(),this._hierarchyRequest+=1}_clearTypeState(){this._type=void 0,this._subType=void 0,this._isFormula=void 0}async _fetchDatasetDataFields(){if(!this.datasetIds||this.datasetIds.length===0){this._error=`Missing dataset ids to fetch columns & formulas`,this._datasetsDataFields=[],this._loading=!1;return}let{valid:e,invalid:t}=ee(this.datasetIds);if(t.length>0&&console.warn(`[LuzmoFilterItem] Invalid dataset IDs provided (not valid UUIDs): ${t.join(`, `)}. These will be skipped.`),e.length===0)this._error=`Invalid dataset IDs provided. Dataset IDs must be valid UUIDs.`,this._datasetsDataFields=[],this._loading=!1;else{this._loading=!0,this._error=null;try{let t=await f.fetchDatasetsWithColumnsAndFormulas(e);for(let e of t)for(let t of[...e.columns,...e.formulas])t.datasetId=e.id;this._datasetsDataFields=t}catch(e){console.error(`Error fetching dataset columns & formulas:`,e),this._error=e instanceof Error?e.message:`Unknown error`,this._datasetsDataFields=[]}finally{this._loading=!1}}}willUpdate(e){super.willUpdate(e);let t=e.has(`filter`),n=e.has(`datasetIds`),r=e.has(`authKey`),i=e.has(`authToken`),a=e.has(`_datasetsDataFields`),o=e.has(`parameters`);if(!this.textContext&&this.display===`text`&&(t||a||e.has(`display`)||e.has(`contentLanguage`))&&this._loadHierarchyLabelsForText(),t||n||a&&(this.filter?.parameters?.[0]?.columnId||this.filter?.parameters?.[0]?.formulaId)&&this.filter?.parameters?.[0]?.datasetId){if(!this.datasetIds||this.datasetIds.length===0||this._datasetsDataFields.length===0)this._clearTypeState();else{let e=this._datasetsDataFields.find(e=>e.id===this.filter.parameters?.[0]?.datasetId);if(e){let t=!1;for(let n of[...e.columns||[],...e?.formulas||[]])if(n.id===this.filter.parameters?.[0]?.columnId||n.id===this.filter.parameters?.[0]?.formulaId){this._type=n.type,this._subType=n.subtype,this._isFormula=n.id===this.filter.parameters?.[0]?.formulaId,t=!0;break}t||this._clearTypeState()}else this._clearTypeState()}}if(!this.textContext&&(r||i)){let e={authKey:this.authKey||``,authToken:this.authToken||``};f.configure(e)}!this.textContext&&(n||r||i)&&this._fetchDatasetDataFields();let s=this.filter?.parameters?.[1],c=e.get(`filter`),l=!!c&&c.expression!==this.filter?.expression;if(this.allowParameters&&this._type&&(o||e.has(`_type`)||l)&&U(s)){let t=this.parameters.find(e=>e.parameter===s.parameter),n=H(this._type,this.filter?.expression),r=o||e.has(`_type`);if(l&&!n.includes(s.type)||r&&(!t||!n.includes(t.type))){let e=structuredClone(this.filter),t=G(this._type,e.expression);e.parameters=t===void 0?[e.parameters[0]]:[e.parameters[0],t],this.filter=e,this._sendChangeEvent()}else if(r&&t&&JSON.stringify(t)!==JSON.stringify(s)){let e=structuredClone(this.filter);e.parameters[1]=structuredClone(t),this.filter=e,this._sendChangeEvent()}}}async _loadHierarchyLabelsForText(){let e=++this._hierarchyRequest,t=this._filterTextContext(),n=Ne({condition:`and`,filters:[this.filter]},t);if(n.length===0)this._hierarchyLabels=/* @__PURE__ */ new Map,this._hierarchyLabelsLoading=!1;else{this._hierarchyLabelsLoading=!0;try{let t=await Pe(n,this.contentLanguage);e===this._hierarchyRequest&&(this._hierarchyLabels=t)}catch(t){e===this._hierarchyRequest&&console.error(`[${this.localName}] Error fetching hierarchy member names:`,t)}finally{e===this._hierarchyRequest&&(this._hierarchyLabelsLoading=!1)}}}_sendChangeEvent(){this.readonly||this.disabled||this.dispatchEvent(new CustomEvent(`luzmo-filter-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{filter:this.filter}}))}setFilterDataField(e){if(this.readonly||this.disabled||this._cannotReferenceColumn())return;let t=e.detail?.dataFields?.[0],n=this._type,r=this.filter?.parameters?.[0]?.columnId||this.filter?.parameters?.[0]?.formulaId,i=!!this.filter?.parameters?.[0]?.formulaId,a=t?.columnId||t?.formulaId,o=U(this.filter?.parameters?.[1]);this._type=t?.type,this._subType=t?.subtype,this._isFormula=!!t?.formulaId;let s=oe(this._type,this._subType,this._isFormula);this.filter=structuredClone(this.filter??{}),s?.includes(this.filter?.expression)||(this.filter.expression=s?.[0]?.expression),this.filter.parameters=this.filter?.parameters??[],this.filter.parameters[0]={datasetId:t?.datasetId},this._isFormula?this.filter.parameters[0].formulaId=t?.formulaId:this.filter.parameters[0].columnId=t?.columnId;let c=this.filter.properties??{};if(this._isFormula?i&&c.type!==void 0||(this.filter.properties={...c,type:`having`}):(c.type===void 0||i&&c.type===`having`)&&(this.filter.properties={...c,type:`where`}),t?.lowestLevel,n!==this._type)this._type===`hierarchy`?(this.filter.expression=`? like ?`,this.filter.parameters[1]=``):this._type===`numeric`?(this.filter.expression=`? > ?`,this.filter.parameters[1]=0):this._type===`datetime`?(this.filter.expression=`? < ?`,this.filter.parameters[1]=(/* @__PURE__ */ new Date()).toISOString()):(this.filter.expression=`? is not null`,this.filter.parameters=[this.filter.parameters[0]]);else if(o&&r!==a){let e=G(this._type,this.filter.expression);this.filter.parameters=e===void 0?[this.filter.parameters[0]]:[this.filter.parameters[0],e]}else r!==a&&this._type===`hierarchy`&&(this.filter.parameters[1]=[`? in ?`,`? not in ?`].includes(this.filter.expression)?[]:``);this._sendChangeEvent()}setFilterExpression(e){if(this.readonly||this.disabled||this._cannotReferenceColumn())return;let t=structuredClone(this.filter??{}),n=t.expression;if(t.expression=e.detail?.expression,n!==t.expression){if(U(t.parameters?.[1])){let e=t.parameters[1];if(!H(this._type,t.expression).some(t=>t===e.type)){let e=G(this._type,t.expression);t.parameters=e===void 0?[t.parameters[0]]:[t.parameters[0],e]}}else if([`? is null`,`? is not null`].includes(t.expression))t.parameters=[t.parameters[0]];else if(this._type===`datetime`){if([`YTD`,`QTD`,`MTD`,`WTD`].includes(t.expression)){let n=e?.detail?.unit;n&&(t.parameters[1]={unit:typeof n==`number`?n:1})}else if([`last_completed`,`next_full`,`to_date`].includes(t.expression)){let e=t?.parameters?.[1]?.unit;t.parameters[1]={unit:typeof e==`number`?e:1}}else if([`last_now`,`last_available`,`next_now`,`more_than_ago`,`or_more_ago`].includes(t.expression)){let e=t?.parameters?.[1]?.unit,n=t?.parameters?.[1]?.quantity;t.parameters[1]={unit:typeof e==`number`?e:1,quantity:typeof n==`number`?n:1}}else t.parameters[1]=(/* @__PURE__ */ new Date()).toISOString()}else if(this._type===`hierarchy`){if([`? in ?`,`? not in ?`].includes(t.expression))[`? = ?`,`? != ?`].includes(n)?t.parameters[1]=t.parameters[1]?[t.parameters[1]]:[]:t.parameters[1]=[];else if([`? = ?`,`? != ?`].includes(t.expression)){if([`? in ?`,`? not in ?`].includes(n))t.parameters[1]=Array.isArray(t.parameters[1])&&t.parameters[1][0]!=null?t.parameters[1][0]:``;else{let e=t.parameters[1];t.parameters[1]=typeof e==`string`||typeof e==`number`?e:``}}else t.parameters[1]=[`? in ?`,`? not in ?`].includes(n)?``:t.parameters[1]??``}else this._type===`numeric`&&([`? in ?`,`? not in ?`].includes(t.expression)&&[`? in ?`,`? not in ?`].includes(n)?t.parameters[1]=t.parameters[1]??[]:[`? in ?`,`? not in ?`].includes(t.expression)?t.parameters[1]=[]:t.parameters[1]=[`? in ?`,`? not in ?`].includes(n)?0:t.parameters[1]??0);this.filter=t,this._sendChangeEvent()}}setFilterValue(e){this.readonly||this.disabled||this._cannotReferenceColumn()||(this.filter.parameters[1]=e?.detail?.value,this._sendChangeEvent())}handleFilterParameterSelected(e){if(this.readonly||this.disabled)return;let t=e.detail?.parameter;if(!t)return;let n=structuredClone(this.filter??{});n.parameters=n.parameters??[],n.parameters[1]=structuredClone(t),this.filter=n,this._sendChangeEvent()}handleFilterParameterRemoved(){if(this.readonly||this.disabled||!U(this.filter?.parameters?.[1]))return;let e=structuredClone(this.filter),t=G(this._type,e.expression);e.parameters=t===void 0?[e.parameters[0]]:[e.parameters[0],t],this.filter=e,this._sendChangeEvent()}_cannotReferenceColumn(){if(!(this.filter?.parameters?.[0]?.columnId||this.filter?.parameters?.[0]?.formulaId))return!1;if(!this.datasetIds||this.datasetIds.length===0||this._datasetsDataFields.length===0)return!0;let e=this.filter?.parameters?.[0]?.datasetId,t=this._datasetsDataFields.find(t=>t.id===e);return!t||![...t.columns||[],...t.formulas||[]].find(e=>e.id===this.filter?.parameters?.[0]?.columnId||e.id===this.filter?.parameters?.[0]?.formulaId)}renderDataFieldPicker(){let e=this._cannotReferenceColumn(),t=e?n(`Unknown`):void 0,r=e||this._loading?``:this.filter?.parameters?.[0]?.columnId||this.filter?.parameters?.[0]?.formulaId;return m`<luzmo-data-fields-select
|
|
276
|
+
`}};t([_({type:String,attribute:`api-url`,reflect:!0})],X.prototype,`apiUrl`,void 0),t([_({type:String,attribute:`auth-key`,reflect:!0})],X.prototype,`authKey`,void 0),t([_({type:String,attribute:`auth-token`,reflect:!0})],X.prototype,`authToken`,void 0),t([_({type:Number,attribute:`cache-time`,reflect:!0})],X.prototype,`cacheTime`,void 0),t([_({type:String,attribute:`content-language`,reflect:!0})],X.prototype,`contentLanguage`,void 0),t([_({type:String,attribute:`time-zone`,reflect:!0})],X.prototype,`timeZone`,void 0),t([_({type:String,attribute:`value-type`,reflect:!0})],X.prototype,`valueType`,void 0),t([_({type:Object,reflect:!1})],X.prototype,`filter`,void 0),t([_({type:Boolean,reflect:!0})],X.prototype,`quiet`,void 0),t([_({type:Boolean,reflect:!0})],X.prototype,`readonly`,void 0),t([_({type:Boolean,reflect:!0})],X.prototype,`disabled`,void 0),customElements.get(`luzmo-filter-value-picker`)||customElements.define(`luzmo-filter-value-picker`,X);var Kt=`:host{box-sizing:border-box;min-width:0;max-width:100%;font-family:var(--luzmo-font-family);color:var(--luzmo-font-color);flex-direction:row;display:flex}:host([display=text]){vertical-align:middle;align-items:center;max-width:100%;display:inline-flex}.filter-item-text{min-width:0;max-width:100%;font-size:var(--luzmo-filter-item-text-font-size,var(--filter-item-text-font-size));white-space:normal;flex-wrap:wrap;align-items:center;column-gap:.25em;line-height:1.5;display:inline-flex}.filter-item-text-field{white-space:nowrap}.filter-item-column-badge{white-space:nowrap;align-items:center;display:inline-flex}.filter-item-text-field-icon{margin-inline-end:var(--luzmo-filter-item-text-icon-gap,var(--filter-item-text-icon-gap))}.filter-item-column-badge luzmo-icon{--luzmo-icon-vertical-align:0}.filter-item-text-expression{color:var(--luzmo-filter-item-text-expression-color,var(--filter-item-text-expression-color));font-weight:var(--luzmo-filter-item-text-expression-font-weight,var(--filter-item-text-expression-font-weight))}:host([column-display=outline]) .filter-item-column-badge luzmo-badge{--luzmo-badge-border-color:var(--luzmo-filter-item-column-badge-color,var(--luzmo-border-color-full));--luzmo-badge-content-color:var(--luzmo-filter-item-column-badge-font-color,var(--luzmo-filter-item-column-badge-color,var(--luzmo-font-color)))}:host([column-display=subtle]) .filter-item-column-badge luzmo-badge{--luzmo-badge-background-color:color-mix(in srgb, var(--luzmo-filter-item-column-badge-color,var(--luzmo-selected-color-hard)) 10%, var(--luzmo-background-color));--luzmo-badge-content-color:var(--luzmo-filter-item-column-badge-font-color)}:host([column-display=fill]) .filter-item-column-badge luzmo-badge{--luzmo-badge-background-color:var(--luzmo-filter-item-column-badge-color,var(--luzmo-selected-color-hard));--luzmo-badge-border-color:transparent;--luzmo-badge-content-color:var(--luzmo-filter-item-column-badge-font-color,var(--luzmo-background-color))}.filter-item-text-value{align-items:center;gap:var(--luzmo-spacing-1);display:inline-flex}.filter-item-text-value luzmo-progress-circle{--luzmo-progress-circle-size:var(--filter-item-progress-circle-size)}.filter-item-text-value--has-tooltip{text-underline-offset:.15em;cursor:help;text-decoration-line:underline;text-decoration-style:dotted;text-decoration-color:currentColor}[role=group]{box-sizing:border-box;align-items:center;gap:var(--luzmo-filter-item-gap,var(--filter-item-gap));flex-flow:wrap;width:100%;min-width:0;max-width:100%;display:flex}luzmo-data-fields-select{flex:0 1 var(--luzmo-filter-item-field-width,var(--filter-item-field-width));min-width:min(100%, var(--luzmo-filter-item-field-min-width,var(--filter-item-field-min-width)));max-width:100%}luzmo-filter-expression-picker{flex:0 0 var(--luzmo-filter-item-expression-width,var(--filter-item-expression-width));max-width:100%}.value-controls{align-items:center;gap:var(--luzmo-filter-item-gap,var(--filter-item-gap));flex-wrap:nowrap;flex:var(--luzmo-filter-item-value-grow,var(--filter-item-value-grow)) 1 var(--luzmo-filter-item-value-width,var(--filter-item-value-width));min-width:min(100%, var(--luzmo-filter-item-value-min-width,var(--filter-item-value-min-width)));max-width:100%;display:flex}luzmo-filter-value-picker{flex:auto;min-width:0;max-width:100%}luzmo-filter-parameter-picker{flex:0 auto;min-width:0;max-width:100%}:host{--filter-item-gap:var(--luzmo-spacing-3);--filter-item-field-width:auto;--filter-item-expression-width:auto;--filter-item-value-width:auto;--filter-item-value-grow:0;--filter-item-field-min-width:4.5rem;--filter-item-value-min-width:4.5rem;--filter-item-text-font-size:var(--luzmo-font-size-m);--filter-item-text-icon-gap:var(--luzmo-spacing-1);--filter-item-text-expression-color:var(--luzmo-font-color);--filter-item-text-expression-font-weight:var(--luzmo-font-weight);--filter-item-progress-circle-size:var(--luzmo-component-height)}:host([size=s]){--filter-item-gap:var(--luzmo-spacing-2);--filter-item-text-font-size:var(--luzmo-font-size-s);--filter-item-progress-circle-size:var(--luzmo-component-height-s)}:host([size=m]){--filter-item-gap:var(--luzmo-spacing-3)}:host([size=l]){--filter-item-gap:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--filter-item-text-font-size:var(--luzmo-font-size-l);--filter-item-text-icon-gap:var(--luzmo-spacing-2);--filter-item-progress-circle-size:var(--luzmo-component-height-l)}:host([size=xl]){--filter-item-gap:var(--luzmo-spacing-4);--filter-item-text-font-size:var(--luzmo-font-size-xl);--filter-item-text-icon-gap:var(--luzmo-spacing-2);--filter-item-progress-circle-size:var(--luzmo-component-height-xl)}`,Z=class extends r(S(x,{validSizes:Object.values(b)})){constructor(...e){super(...e),this.apiUrl=`https://api.luzmo.com`,this.contentLanguage=`en`,this.filter={},this.display=`rich`,this.columnDisplay=`text`,this.quiet=!1,this.readonly=!1,this.disabled=!1,this.allowParameters=!1,this.parameters=[],this._loading=!1,this._datasetsDataFields=[],this._hierarchyLabels=/* @__PURE__ */ new Map,this._hierarchyLabelsLoading=!1,this._hierarchyRequest=0}static get styles(){return[y(Kt)]}connectedCallback(){if(super.connectedCallback(),this.textContext)return;let e={};this.apiUrl&&(e.apiUrl=this.apiUrl),this.cacheTime&&(e.staleTime=this.cacheTime,e.gcTime=this.cacheTime*2),e.authKey=this.authKey||``,e.authToken=this.authToken||``,p.configure(e),this.hasUpdated&&this.display===`text`&&this._loadHierarchyLabelsForText()}disconnectedCallback(){super.disconnectedCallback(),this._hierarchyRequest+=1}_clearTypeState(){this._type=void 0,this._subType=void 0,this._isFormula=void 0}async _fetchDatasetDataFields(){if(!this.datasetIds||this.datasetIds.length===0){this._error=`Missing dataset ids to fetch columns & formulas`,this._datasetsDataFields=[],this._loading=!1;return}let{valid:e,invalid:t}=f(this.datasetIds);if(t.length>0&&console.warn(`[LuzmoFilterItem] Invalid dataset IDs provided (not valid UUIDs): ${t.join(`, `)}. These will be skipped.`),e.length===0)this._error=`Invalid dataset IDs provided. Dataset IDs must be valid UUIDs.`,this._datasetsDataFields=[],this._loading=!1;else{this._loading=!0,this._error=null;try{let t=await p.fetchDatasetsWithColumnsAndFormulas(e);for(let e of t)for(let t of[...e.columns,...e.formulas])t.datasetId=e.id;this._datasetsDataFields=t}catch(e){console.error(`Error fetching dataset columns & formulas:`,e),this._error=e instanceof Error?e.message:`Unknown error`,this._datasetsDataFields=[]}finally{this._loading=!1}}}willUpdate(e){super.willUpdate(e);let t=e.has(`filter`),n=e.has(`datasetIds`),r=e.has(`authKey`),i=e.has(`authToken`),a=e.has(`_datasetsDataFields`),o=e.has(`parameters`);if(!this.textContext&&this.display===`text`&&(t||a||e.has(`display`)||e.has(`contentLanguage`))&&this._loadHierarchyLabelsForText(),t||n||a&&(this.filter?.parameters?.[0]?.columnId||this.filter?.parameters?.[0]?.formulaId)&&this.filter?.parameters?.[0]?.datasetId){if(!this.datasetIds||this.datasetIds.length===0||this._datasetsDataFields.length===0)this._clearTypeState();else{let e=this._datasetsDataFields.find(e=>e.id===this.filter.parameters?.[0]?.datasetId);if(e){let t=!1;for(let n of[...e.columns||[],...e?.formulas||[]])if(n.id===this.filter.parameters?.[0]?.columnId||n.id===this.filter.parameters?.[0]?.formulaId){this._type=n.type,this._subType=n.subtype,this._isFormula=n.id===this.filter.parameters?.[0]?.formulaId,t=!0;break}t||this._clearTypeState()}else this._clearTypeState()}}if(!this.textContext&&(r||i)){let e={authKey:this.authKey||``,authToken:this.authToken||``};p.configure(e)}!this.textContext&&(n||r||i)&&this._fetchDatasetDataFields();let s=this.filter?.parameters?.[1],c=e.get(`filter`),l=!!c&&c.expression!==this.filter?.expression;if(this.allowParameters&&this._type&&(o||e.has(`_type`)||l)&&U(s)){let t=this.parameters.find(e=>e.parameter===s.parameter),n=H(this._type,this.filter?.expression),r=o||e.has(`_type`);if(l&&!n.includes(s.type)||r&&(!t||!n.includes(t.type))){let e=structuredClone(this.filter),t=G(this._type,e.expression);e.parameters=t===void 0?[e.parameters[0]]:[e.parameters[0],t],this.filter=e,this._sendChangeEvent()}else if(r&&t&&JSON.stringify(t)!==JSON.stringify(s)){let e=structuredClone(this.filter);e.parameters[1]=structuredClone(t),this.filter=e,this._sendChangeEvent()}}}async _loadHierarchyLabelsForText(){let e=++this._hierarchyRequest,t=this._filterTextContext(),n=Pe({condition:`and`,filters:[this.filter]},t);if(n.length===0)this._hierarchyLabels=/* @__PURE__ */ new Map,this._hierarchyLabelsLoading=!1;else{this._hierarchyLabelsLoading=!0;try{let t=await Fe(n,this.contentLanguage);e===this._hierarchyRequest&&(this._hierarchyLabels=t)}catch(t){e===this._hierarchyRequest&&console.error(`[${this.localName}] Error fetching hierarchy member names:`,t)}finally{e===this._hierarchyRequest&&(this._hierarchyLabelsLoading=!1)}}}_sendChangeEvent(){this.readonly||this.disabled||this.dispatchEvent(new CustomEvent(`luzmo-filter-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{filter:this.filter}}))}setFilterDataField(e){if(this.readonly||this.disabled||this._cannotReferenceColumn())return;let t=e.detail?.dataFields?.[0],n=this._type,r=this.filter?.parameters?.[0]?.columnId||this.filter?.parameters?.[0]?.formulaId,i=!!this.filter?.parameters?.[0]?.formulaId,a=t?.columnId||t?.formulaId,o=U(this.filter?.parameters?.[1]);this._type=t?.type,this._subType=t?.subtype,this._isFormula=!!t?.formulaId;let s=ae(this._type,this._subType,this._isFormula);this.filter=structuredClone(this.filter??{}),s?.includes(this.filter?.expression)||(this.filter.expression=s?.[0]?.expression),this.filter.parameters=this.filter?.parameters??[],this.filter.parameters[0]={datasetId:t?.datasetId},this._isFormula?this.filter.parameters[0].formulaId=t?.formulaId:this.filter.parameters[0].columnId=t?.columnId;let c=this.filter.properties??{};if(this._isFormula?i&&c.type!==void 0||(this.filter.properties={...c,type:`having`}):(c.type===void 0||i&&c.type===`having`)&&(this.filter.properties={...c,type:`where`}),t?.lowestLevel,n!==this._type)this._type===`hierarchy`?(this.filter.expression=`? like ?`,this.filter.parameters[1]=``):this._type===`numeric`?(this.filter.expression=`? > ?`,this.filter.parameters[1]=0):this._type===`datetime`?(this.filter.expression=`? < ?`,this.filter.parameters[1]=(/* @__PURE__ */ new Date()).toISOString()):(this.filter.expression=`? is not null`,this.filter.parameters=[this.filter.parameters[0]]);else if(o&&r!==a){let e=G(this._type,this.filter.expression);this.filter.parameters=e===void 0?[this.filter.parameters[0]]:[this.filter.parameters[0],e]}else r!==a&&this._type===`hierarchy`&&(this.filter.parameters[1]=[`? in ?`,`? not in ?`].includes(this.filter.expression)?[]:``);this._sendChangeEvent()}setFilterExpression(e){if(this.readonly||this.disabled||this._cannotReferenceColumn())return;let t=structuredClone(this.filter??{}),n=t.expression;if(t.expression=e.detail?.expression,n!==t.expression){if(U(t.parameters?.[1])){let e=t.parameters[1];if(!H(this._type,t.expression).some(t=>t===e.type)){let e=G(this._type,t.expression);t.parameters=e===void 0?[t.parameters[0]]:[t.parameters[0],e]}}else if([`? is null`,`? is not null`].includes(t.expression))t.parameters=[t.parameters[0]];else if(this._type===`datetime`){if([`YTD`,`QTD`,`MTD`,`WTD`].includes(t.expression)){let n=e?.detail?.unit;n&&(t.parameters[1]={unit:typeof n==`number`?n:1})}else if([`last_completed`,`next_full`,`to_date`].includes(t.expression)){let e=t?.parameters?.[1]?.unit;t.parameters[1]={unit:typeof e==`number`?e:1}}else if([`last_now`,`last_available`,`next_now`,`more_than_ago`,`or_more_ago`].includes(t.expression)){let e=t?.parameters?.[1]?.unit,r=t?.parameters?.[1]?.quantity;t.parameters[1]={unit:typeof e==`number`?e:1,quantity:typeof r==`number`?E(t.expression,se(n,r)):E(t.expression,1)}}else t.parameters[1]=(/* @__PURE__ */ new Date()).toISOString()}else if(this._type===`hierarchy`){if([`? in ?`,`? not in ?`].includes(t.expression))[`? = ?`,`? != ?`].includes(n)?t.parameters[1]=t.parameters[1]?[t.parameters[1]]:[]:t.parameters[1]=[];else if([`? = ?`,`? != ?`].includes(t.expression)){if([`? in ?`,`? not in ?`].includes(n))t.parameters[1]=Array.isArray(t.parameters[1])&&t.parameters[1][0]!=null?t.parameters[1][0]:``;else{let e=t.parameters[1];t.parameters[1]=typeof e==`string`||typeof e==`number`?e:``}}else t.parameters[1]=[`? in ?`,`? not in ?`].includes(n)?``:t.parameters[1]??``}else this._type===`numeric`&&([`? in ?`,`? not in ?`].includes(t.expression)&&[`? in ?`,`? not in ?`].includes(n)?t.parameters[1]=t.parameters[1]??[]:[`? in ?`,`? not in ?`].includes(t.expression)?t.parameters[1]=[]:t.parameters[1]=[`? in ?`,`? not in ?`].includes(n)?0:t.parameters[1]??0);this.filter=t,this._sendChangeEvent()}}setFilterValue(e){this.readonly||this.disabled||this._cannotReferenceColumn()||(this.filter.parameters[1]=e?.detail?.value,this._sendChangeEvent())}handleFilterParameterSelected(e){if(this.readonly||this.disabled)return;let t=e.detail?.parameter;if(!t)return;let n=structuredClone(this.filter??{});n.parameters=n.parameters??[],n.parameters[1]=structuredClone(t),this.filter=n,this._sendChangeEvent()}handleFilterParameterRemoved(){if(this.readonly||this.disabled||!U(this.filter?.parameters?.[1]))return;let e=structuredClone(this.filter),t=G(this._type,e.expression);e.parameters=t===void 0?[e.parameters[0]]:[e.parameters[0],t],this.filter=e,this._sendChangeEvent()}_cannotReferenceColumn(){if(!(this.filter?.parameters?.[0]?.columnId||this.filter?.parameters?.[0]?.formulaId))return!1;if(!this.datasetIds||this.datasetIds.length===0||this._datasetsDataFields.length===0)return!0;let e=this.filter?.parameters?.[0]?.datasetId,t=this._datasetsDataFields.find(t=>t.id===e);return!t||![...t.columns||[],...t.formulas||[]].find(e=>e.id===this.filter?.parameters?.[0]?.columnId||e.id===this.filter?.parameters?.[0]?.formulaId)}renderDataFieldPicker(){let e=this._cannotReferenceColumn(),t=e?n(`Unknown`):void 0,r=e||this._loading?``:this.filter?.parameters?.[0]?.columnId||this.filter?.parameters?.[0]?.formulaId;return h`<luzmo-data-fields-select
|
|
275
277
|
.language=${this.language}
|
|
276
278
|
.contentLanguage=${this.contentLanguage}
|
|
277
279
|
.size=${this.size}
|
|
@@ -279,7 +281,7 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
279
281
|
selects="single"
|
|
280
282
|
levels="off"
|
|
281
283
|
.datasetsDataFields=${this._datasetsDataFields}
|
|
282
|
-
placeholder=${
|
|
284
|
+
placeholder=${te(t)}
|
|
283
285
|
.invalid=${!!this._error||e}
|
|
284
286
|
?disabled=${e||this.disabled}
|
|
285
287
|
.readonly=${this.readonly}
|
|
@@ -287,7 +289,7 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
287
289
|
.pending=${this._loading}
|
|
288
290
|
.quiet=${this.quiet}
|
|
289
291
|
@luzmo-data-fields-selected=${this.setFilterDataField}
|
|
290
|
-
></luzmo-data-fields-select>`}renderExpressionPicker(){let e=this._cannotReferenceColumn(),t=this.filter?.parameters?.[0],n=!t?.datasetId||!t?.columnId&&!t?.formulaId||e;return
|
|
292
|
+
></luzmo-data-fields-select>`}renderExpressionPicker(){let e=this._cannotReferenceColumn(),t=this.filter?.parameters?.[0],n=!t?.datasetId||!t?.columnId&&!t?.formulaId||e;return h`<luzmo-filter-expression-picker
|
|
291
293
|
.language=${this.language}
|
|
292
294
|
.size=${this.size}
|
|
293
295
|
.type=${this._type}
|
|
@@ -298,7 +300,7 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
298
300
|
.readonly=${this.readonly}
|
|
299
301
|
.quiet=${this.quiet}
|
|
300
302
|
@luzmo-expression-selected=${this.setFilterExpression}
|
|
301
|
-
></luzmo-filter-expression-picker>`}renderValuePicker(){let e=this._cannotReferenceColumn(),t=this.filter?.parameters?.[0],n=!t?.datasetId||!t?.columnId&&!t?.formulaId||e;return
|
|
303
|
+
></luzmo-filter-expression-picker>`}renderValuePicker(){let e=this._cannotReferenceColumn(),t=this.filter?.parameters?.[0],n=!t?.datasetId||!t?.columnId&&!t?.formulaId||e;return h`<luzmo-filter-value-picker
|
|
302
304
|
.apiUrl=${this.apiUrl}
|
|
303
305
|
.authKey=${this.authKey}
|
|
304
306
|
.authToken=${this.authToken}
|
|
@@ -313,7 +315,7 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
313
315
|
.readonly=${this.readonly}
|
|
314
316
|
.quiet=${this.quiet}
|
|
315
317
|
@luzmo-filter-value-changed=${this.setFilterValue}
|
|
316
|
-
></luzmo-filter-value-picker>`}renderParameterPicker(){if(!this.allowParameters)return null;let e=H(this._type,this.filter?.expression);if(e.length===0)return null;let t=U(this.filter?.parameters?.[1])?this.filter.parameters[1]:void 0;return
|
|
318
|
+
></luzmo-filter-value-picker>`}renderParameterPicker(){if(!this.allowParameters)return null;let e=H(this._type,this.filter?.expression);if(e.length===0)return null;let t=U(this.filter?.parameters?.[1])?this.filter.parameters[1]:void 0;return h`<luzmo-filter-parameter-picker
|
|
317
319
|
.language=${this.language}
|
|
318
320
|
.size=${this.size}
|
|
319
321
|
.parameters=${this.parameters}
|
|
@@ -325,44 +327,44 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
325
327
|
.quiet=${this.quiet}
|
|
326
328
|
@luzmo-parameter-selected=${this.handleFilterParameterSelected}
|
|
327
329
|
@luzmo-parameter-removed=${this.handleFilterParameterRemoved}
|
|
328
|
-
></luzmo-filter-parameter-picker>`}_filterTextContext(){return this.textContext??{datasets:this._datasetsDataFields,contentLanguage:this.contentLanguage,timeZone:this.timeZone,hierarchyLabels:this._hierarchyLabels,hierarchyLabelsLoading:this._hierarchyLabelsLoading}}get _columnBadgeSize(){return{xxs:`xs`,xs:`xs`,s:`xs`,m:`s`,l:`m`,xl:`l`,xxl:`xl`}[this.size]??`s`}_textFieldIcon(e,t){return e.formula?l({formulaId:`formula`},t):c({type:e.type??`hierarchy`,subtype:e.subtype},t)}_renderTextField(e){if(this.columnDisplay!==`text`){let t=this._columnBadgeSize,n=this._textFieldIcon(e,t);return
|
|
330
|
+
></luzmo-filter-parameter-picker>`}_filterTextContext(){return this.textContext??{datasets:this._datasetsDataFields,contentLanguage:this.contentLanguage,timeZone:this.timeZone,hierarchyLabels:this._hierarchyLabels,hierarchyLabelsLoading:this._hierarchyLabelsLoading}}get _columnBadgeSize(){return{xxs:`xs`,xs:`xs`,s:`xs`,m:`s`,l:`m`,xl:`l`,xxl:`xl`}[this.size]??`s`}_textFieldIcon(e,t){return e.formula?l({formulaId:`formula`},t):c({type:e.type??`hierarchy`,subtype:e.subtype},t)}_renderTextField(e){if(this.columnDisplay!==`text`){let t=this._columnBadgeSize,n=this._textFieldIcon(e,t);return h`<span
|
|
329
331
|
class="filter-item-column-badge filters-text-field"
|
|
330
332
|
part="filter-item-text-field"
|
|
331
333
|
title=${e.tooltip}
|
|
332
334
|
>
|
|
333
335
|
<luzmo-badge role="none" .size=${t} .treatment=${this.columnDisplay}>
|
|
334
|
-
${n?
|
|
336
|
+
${n?h`<luzmo-icon slot="icon" .icon=${n} .size=${t}></luzmo-icon>`:g}${e.label}
|
|
335
337
|
</luzmo-badge>
|
|
336
|
-
</span>`}let t=this._textFieldIcon(e,`s`);return
|
|
338
|
+
</span>`}let t=this._textFieldIcon(e,`s`);return h`<span
|
|
337
339
|
class="filter-item-text-field filters-text-field"
|
|
338
340
|
part="filter-item-text-field"
|
|
339
341
|
title=${e.tooltip}
|
|
340
|
-
><span class="filter-item-text-field-icon filters-text-field-icon" aria-hidden="true">${t?d(t):
|
|
342
|
+
><span class="filter-item-text-field-icon filters-text-field-icon" aria-hidden="true">${t?d(t):g}</span
|
|
341
343
|
><span class="filter-item-text-field-label filters-text-field-label">${e.label}</span></span
|
|
342
|
-
>`}_renderTextValue(e){if(e.valueField)return this._renderTextField(e.valueField);if(!e.valueText)return
|
|
344
|
+
>`}_renderTextValue(e){if(e.valueField)return this._renderTextField(e.valueField);if(!e.valueText)return g;let t=e.valuePending?h`<luzmo-progress-circle
|
|
343
345
|
indeterminate
|
|
344
346
|
.label=${n(`Loading item names`,{desc:`Accessible label while hierarchy item names load beside the item count`})}
|
|
345
347
|
.size=${this.size}
|
|
346
|
-
></luzmo-progress-circle>`:
|
|
348
|
+
></luzmo-progress-circle>`:g;return e.valueTooltip?h`<span
|
|
347
349
|
class="filter-item-text-value filter-item-text-value--has-tooltip filters-text-value filters-text-value--has-tooltip outline-value outline-value--has-tooltip"
|
|
348
350
|
tabindex="0"
|
|
349
351
|
aria-live="polite"
|
|
350
352
|
>${e.valueText}<luzmo-tooltip self-managed placement="top" .size=${this.size}
|
|
351
353
|
>${e.valueTooltip}</luzmo-tooltip
|
|
352
354
|
></span
|
|
353
|
-
>`:
|
|
355
|
+
>`:h`<span class="filter-item-text-value filters-text-value outline-value" aria-live="polite">${e.valueText}${t}</span>`}_renderTextDisplay(){let t=je(this.filter,this._filterTextContext());if(!t)return h`
|
|
354
356
|
<span
|
|
355
357
|
class="filter-item-text"
|
|
356
358
|
part="filter-item-text"
|
|
357
359
|
></span>
|
|
358
|
-
`;let r=this._renderTextField(t.field),i=
|
|
360
|
+
`;let r=this._renderTextField(t.field),i=h`<span class="filter-item-text-expression filters-text-expression outline-expression"
|
|
359
361
|
>${t.expression}</span
|
|
360
|
-
>`,a=t.valueField||t.valueText?this._renderTextValue(t):
|
|
362
|
+
>`,a=t.valueField||t.valueText?this._renderTextValue(t):g,o=t.expression&&a!==g?w(n(e`${C[0]}\u2063 ${C[1]}\u2063 ${C[2]}`,{id:`filter-item-field-expression-value`,desc:`Field, expression, and value in a read-only filter sentence`}),[r,i,a]):t.expression?w(n(e`${C[0]}\u2063 ${C[1]}`,{id:`filter-item-field-expression`,desc:`Field and expression in a read-only filter sentence without a value`}),[r,i]):a===g?r:w(n(e`${C[0]}\u2063 ${C[1]}`,{id:`filter-item-field-value`,desc:`Field and value in a read-only filter sentence without an expression`}),[r,a]);return h`<span class="filter-item-text" part="filter-item-text">${o}</span>`}render(){if(this.display===`text`)return this._renderTextDisplay();let e=U(this.filter?.parameters?.[1]);return h`<div role="group" aria-label=${n(`Filter condition`,{desc:`Accessible label for filter item group`})}>
|
|
361
363
|
${this.renderDataFieldPicker()} ${this.renderExpressionPicker()}
|
|
362
364
|
<div class="value-controls">
|
|
363
365
|
${e?null:this.renderValuePicker()} ${this.renderParameterPicker()}
|
|
364
366
|
</div>
|
|
365
|
-
</div>`}};t([g({type:String,attribute:`api-url`,reflect:!0})],Z.prototype,`apiUrl`,void 0),t([g({type:String,attribute:`auth-key`,reflect:!0})],Z.prototype,`authKey`,void 0),t([g({type:String,attribute:`auth-token`,reflect:!0})],Z.prototype,`authToken`,void 0),t([g({type:Number,attribute:`cache-time`,reflect:!0})],Z.prototype,`cacheTime`,void 0),t([g({type:String,reflect:!0})],Z.prototype,`contentLanguage`,void 0),t([g({type:String,attribute:`time-zone`,reflect:!0})],Z.prototype,`timeZone`,void 0),t([g({type:Array,attribute:`dataset-ids`,reflect:!0})],Z.prototype,`datasetIds`,void 0),t([g({type:Object,reflect:!1})],Z.prototype,`filter`,void 0),t([g({type:String,reflect:!0})],Z.prototype,`display`,void 0),t([g({type:String,attribute:`column-display`,reflect:!0})],Z.prototype,`columnDisplay`,void 0),t([g({type:Boolean,reflect:!0})],Z.prototype,`quiet`,void 0),t([g({type:Boolean,reflect:!0})],Z.prototype,`readonly`,void 0),t([g({type:Boolean,reflect:!0})],Z.prototype,`disabled`,void 0),t([g({attribute:!1})],Z.prototype,`textContext`,void 0),t([g({type:Boolean,attribute:`allow-parameters`,reflect:!0})],Z.prototype,`allowParameters`,void 0),t([g({attribute:!1})],Z.prototype,`parameters`,void 0),t([_()],Z.prototype,`_type`,void 0),t([_()],Z.prototype,`_subType`,void 0),t([_()],Z.prototype,`_isFormula`,void 0),t([_()],Z.prototype,`_error`,void 0),t([_()],Z.prototype,`_loading`,void 0),t([_()],Z.prototype,`_datasetsDataFields`,void 0),t([_()],Z.prototype,`_hierarchyLabels`,void 0),t([_()],Z.prototype,`_hierarchyLabelsLoading`,void 0),Z=t([i()],Z),customElements.get(`luzmo-filter-item`)||customElements.define(`luzmo-filter-item`,Z);var Ht=`:host{font-family:var(--luzmo-filters-font-family,var(--luzmo-font-family));color:var(--luzmo-filters-font-color,var(--luzmo-font-color));max-width:100%;display:block;container-type:inline-size}.filter-group-container{max-width:100%;padding:calc(var(--luzmo-indicator-gap) + 2 * var(--luzmo-indicator-width));overflow-x:hidden}.filter-group{flex-direction:row;min-width:0;max-width:100%;display:flex}.filter-group.nested{margin-top:var(--luzmo-filters-nested-group-margin-top,var(--filters-nested-group-margin-top));margin-bottom:var(--luzmo-filters-nested-group-margin-bottom,var(--filters-nested-group-margin-bottom))}.group-content{flex-direction:column;flex:1;min-width:0;display:flex}.filters-list{gap:var(--luzmo-filters-filters-list-gap,var(--filters-filters-list-gap));flex-direction:column;min-width:0;max-width:100%;display:flex}.filter-item-wrapper{align-items:flex-start;min-width:0;max-width:100%;display:flex;position:relative}.filter-item-content{align-items:flex-start;gap:var(--luzmo-filters-filter-line-gap,var(--filters-filter-line-gap));flex-wrap:nowrap;flex:1;min-width:0;display:flex}.filter-item-content luzmo-filter-item{flex:1;min-width:0}.filter-item-content .delete-filter-button{flex-shrink:0;align-self:flex-end;margin-inline-start:auto}.condition-wrapper{flex:0 0 var(--luzmo-filters-condition-warpper-width,var(--filters-condition-warpper-width));justify-content:center;align-items:center;display:flex;position:relative}.condition-wrapper:before{content:"";left:50%;top:var(--luzmo-filters-vertical-line-top,var(--filters-vertical-line-top));bottom:var(--luzmo-filters-vertical-line-bottom,var(--filters-vertical-line-bottom));width:var(--luzmo-filters-vertical-line-width,var(--filters-vertical-line-width));background:var(--luzmo-filters-vertical-line-color,var(--luzmo-border-color));position:absolute}.condition-badge{min-width:auto;padding-inline:var(--luzmo-filters-condition-padding-horizontal,var(--filters-condition-padding-horizontal));font-weight:var(--luzmo-filters-condition-font-weight,var(--filters-condition-font-weight-emphasized));text-transform:uppercase;background:var(--luzmo-filters-condition-badge-background,var(--luzmo-primary));color:var(--luzmo-filters-condition-badge-color,var(--luzmo-primary-inverse-color));border-radius:var(--luzmo-filters-condition-badge-border-radius,var(--luzmo-border-radius));box-shadow:0 0 0 var(--luzmo-filters-condition-badge-halo,var(--filters-condition-badge-halo)) var(--luzmo-filters-condition-badge-background,var(--luzmo-background-color))}.condition-badge:hover{background:var(--luzmo-filters-condition-badge-background-hover,var(--luzmo-primary-hover))}.group-actions{margin-top:var(--luzmo-filters-group-actions-margin-top,var(--filters-group-actions-margin-top));gap:var(--luzmo-filters-group-actions-gap,var(--filters-group-actions-gap));flex-wrap:wrap;display:flex}.delete-group-button{margin-left:auto}.add-root-group-container{margin-top:var(--luzmo-filters-add-root-group-container-margin-top,var(--filters-add-root-group-container-margin-top));padding-left:0}.add-subgroup-button,.add-filter-button{--luzmo-action-button-text-to-visual:var(--luzmo-filters-group-actions-text-to-visual,var(--filters-group-actions-text-to-visual));--luzmo-action-button-content-color-default:var(--luzmo-filters-group-actions-color,var(--luzmo-primary-hover));--luzmo-action-button-content-color-hover:var(--luzmo-filters-group-actions-color-hover,var(--luzmo-primary-hover));--luzmo-action-button-content-color-down:var(--luzmo-filters-group-actions-color-down,var(--luzmo-primary-down));--luzmo-action-button-content-color-focus:var(--luzmo-filters-group-actions-color-focus,var(--luzmo-primary-focus))}.add-group-button{--luzmo-button-padding-label-to-icon:var(--luzmo-filters-add-group-button-text-to-visual,var(--filters-add-group-button-text-to-visual))}.dataset-ids-empty-message{color:var(--luzmo-filters-error-message-color,var(--luzmo-disabled-color));font-size:var(--luzmo-filters-error-message-font-size,var(--filters-font-size))}@container (width<=480px){.condition-badge{--luzmo-action-button-font-size:.6875rem;--luzmo-action-button-height:1.2rem;--luzmo-button-line-height:1.2rem;font-size:.6875rem;line-height:1.2rem;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)rotate(-90deg)}:host([dir=rtl]) .condition-badge{transform:translate(-50%,-50%)rotate(90deg)}}.filters-loading{min-height:var(--filters-progress-circle-size);align-items:center;display:inline-flex}.filters-loading luzmo-progress-circle{--luzmo-progress-circle-size:var(--filters-progress-circle-size)}.filters-text,.filters-outline{font-size:var(--luzmo-filters-text-font-size,var(--filters-text-font-size));line-height:1.5}.filters-outline{--filters-outline-sentence-padding-block:calc((var(--filters-outline-row-min-height) - 1lh) / 2)}luzmo-filter-item[display=text]{--luzmo-filter-item-column-badge-color:var(--luzmo-filters-column-badge-color);--luzmo-filter-item-column-badge-font-color:var(--luzmo-filters-column-badge-font-color);--luzmo-filter-item-text-font-size:var(--luzmo-filters-text-font-size,var(--filters-text-font-size));--luzmo-filter-item-text-expression-color:var(--luzmo-filters-expression-color,var(--filters-expression-color));--luzmo-filter-item-text-expression-font-weight:var(--luzmo-filters-expression-font-weight,var(--filters-expression-font-weight))}.filters-text luzmo-filter-item[display=text],.filters-text-group luzmo-filter-item[display=text]{--luzmo-filter-item-text-icon-gap:var(--luzmo-filters-text-icon-gap,var(--filters-text-icon-gap))}.outline-sentence>luzmo-filter-item[display=text]{--luzmo-filter-item-text-icon-gap:var(--luzmo-filters-text-part-gap,var(--filters-text-part-gap))}.filters-text{white-space:pre-wrap;word-break:break-word}.filters-text .filters-text-condition{margin-inline:0}.filters-text-condition,.filters-text-paren{vertical-align:middle}.filters-text-condition{color:var(--luzmo-filters-condition-color,var(--filters-condition-color));font-weight:var(--luzmo-filters-condition-font-weight,var(--filters-condition-font-weight))}.outline-group{gap:var(--luzmo-spacing-1);flex-direction:column;min-width:0;display:flex}.outline-children>.outline-group:not(:first-child){margin-top:calc(var(--luzmo-spacing-1) + var(--filters-outline-sentence-padding-block) + var(--filters-outline-join-spacing) - var(--luzmo-spacing-2))}.outline-condition{color:var(--luzmo-filters-condition-color,var(--filters-condition-color));font-size:var(--luzmo-filters-outline-condition-font-size,var(--filters-outline-condition-font-size));font-weight:var(--luzmo-filters-condition-font-weight,var(--filters-condition-font-weight-emphasized));letter-spacing:.04em}.outline-children{gap:var(--luzmo-spacing-2);min-width:0;flex-direction:column;margin-inline-start:var(--luzmo-filters-outline-children-margin-inline-start,var(--filters-outline-children-margin-inline-start));padding-inline-start:var(--luzmo-filters-outline-children-padding-inline-start,var(--filters-outline-children-padding-inline-start));display:flex;position:relative}.outline-children:not(.outline-children--single):before{content:"";inset-inline-start:0;inset-block:var(--luzmo-filters-outline-bracket-inset,var(--filters-outline-bracket-inset));width:var(--luzmo-spacing-2);border-inline-start:1px solid var(--luzmo-border-color);border-block-start:1px solid var(--luzmo-border-color);border-block-end:1px solid var(--luzmo-border-color);border-start-start-radius:var(--luzmo-border-radius);border-end-start-radius:var(--luzmo-border-radius);position:absolute}.outline-children--single{margin-inline-start:0;padding-inline-start:0}.outline-row{align-items:flex-start;column-gap:var(--luzmo-spacing-2);min-width:0;min-height:var(--filters-outline-row-min-height);flex-wrap:nowrap;display:flex}.outline-sentence{align-items:center;gap:var(--luzmo-filters-text-part-gap,var(--filters-text-part-gap));min-width:0;padding-block:var(--filters-outline-sentence-padding-block);flex-wrap:wrap;flex:auto;display:flex}.outline-delete{flex:none;align-self:flex-end;margin-inline-start:auto}:host{--filters-condition-warpper-width:56px;--filters-condition-padding-horizontal:var(--luzmo-spacing-2);--filters-condition-badge-halo:var(--luzmo-spacing-3);--filters-filters-list-gap:var(--luzmo-spacing-3);--filters-nested-group-margin-top:var(--luzmo-spacing-3);--filters-nested-group-margin-bottom:var(--luzmo-spacing-3);--filters-vertical-line-top:var(--luzmo-spacing-2);--filters-vertical-line-bottom:var(--luzmo-spacing-2);--filters-vertical-line-width:1px;--filters-group-actions-text-to-visual:var(--luzmo-spacing-2);--filters-add-group-button-text-to-visual:var(--luzmo-spacing-3);--filters-group-actions-gap:var(--luzmo-spacing-3);--filters-add-root-group-container-margin-top:var(--luzmo-spacing-4);--filters-filter-line-gap:var(--luzmo-spacing-3);--filters-group-actions-margin-top:var(--luzmo-spacing-3);--filters-error-message-font-size:var(--luzmo-font-size);--filters-text-font-size:var(--luzmo-font-size-m);--filters-outline-row-min-height:var(--luzmo-component-height);--filters-progress-circle-size:var(--luzmo-component-height);--filters-text-part-gap:var(--luzmo-spacing-2);--filters-text-icon-gap:var(--luzmo-spacing-1);--filters-outline-children-margin-inline-start:var(--luzmo-spacing-2);--filters-outline-children-padding-inline-start:var(--luzmo-spacing-3);--filters-outline-bracket-inset:var(--luzmo-spacing-2);--filters-outline-join-spacing:var(--luzmo-spacing-2);--filters-expression-color:var(--luzmo-filters-font-color,var(--luzmo-font-color));--filters-expression-font-weight:var(--luzmo-font-weight);--filters-condition-color:var(--luzmo-filters-font-color,var(--luzmo-font-color));--filters-condition-font-weight:var(--luzmo-font-weight);--filters-condition-font-weight-emphasized:var(--luzmo-font-weight-bold);--filters-outline-condition-font-size:var(--luzmo-font-size-s)}:host([size=s]){--filters-condition-warpper-width:48px;--filters-condition-padding-horizontal:var(--luzmo-spacing-2);--filters-condition-badge-halo:var(--luzmo-spacing-2);--filters-filters-list-gap:calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--filters-nested-group-margin-top:calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--filters-nested-group-margin-bottom:calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--filters-vertical-line-top:var(--luzmo-spacing-2);--filters-vertical-line-bottom:var(--luzmo-spacing-2);--filters-group-actions-text-to-visual:var(--luzmo-spacing-1);--filters-add-group-button-text-to-visual:var(--luzmo-spacing-2);--filters-group-actions-gap:var(--luzmo-spacing-2);--filters-add-root-group-container-margin-top:var(--luzmo-spacing-3);--filters-filter-line-gap:var(--luzmo-spacing-2);--filters-group-actions-margin-top:var(--luzmo-spacing-2);--filters-error-message-font-size:var(--luzmo-font-size-s);--filters-text-font-size:var(--luzmo-font-size-s);--filters-outline-row-min-height:var(--luzmo-component-height-s);--filters-progress-circle-size:var(--luzmo-component-height-s);--filters-text-part-gap:var(--luzmo-spacing-1);--filters-text-icon-gap:var(--luzmo-spacing-1);--filters-outline-children-margin-inline-start:var(--luzmo-spacing-1);--filters-outline-children-padding-inline-start:var(--luzmo-spacing-3);--filters-outline-bracket-inset:var(--luzmo-spacing-1);--filters-outline-join-spacing:var(--luzmo-spacing-1);--filters-outline-condition-font-size:var(--luzmo-font-size-xs)}:host([size=l]){--filters-condition-warpper-width:64px;--filters-condition-padding-horizontal:var(--luzmo-spacing-3);--filters-condition-badge-halo:var(--luzmo-spacing-4);--filters-filters-list-gap:var(--luzmo-spacing-4);--filters-nested-group-margin-top:var(--luzmo-spacing-4);--filters-nested-group-margin-bottom:var(--luzmo-spacing-4);--filters-vertical-line-top:var(--luzmo-spacing-3);--filters-vertical-line-bottom:var(--luzmo-spacing-3);--filters-group-actions-text-to-visual:var(--luzmo-spacing-2);--filters-add-group-button-text-to-visual:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--filters-group-actions-gap:var(--luzmo-spacing-3);--filters-add-root-group-container-margin-top:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--filters-filter-line-gap:var(--luzmo-spacing-3);--filters-group-actions-margin-top:var(--luzmo-spacing-3);--filters-error-message-font-size:var(--luzmo-font-size-l);--filters-text-font-size:var(--luzmo-font-size-l);--filters-outline-row-min-height:var(--luzmo-component-height-l);--filters-progress-circle-size:var(--luzmo-component-height-l);--filters-text-part-gap:var(--luzmo-spacing-3);--filters-text-icon-gap:var(--luzmo-spacing-2);--filters-outline-children-margin-inline-start:var(--luzmo-spacing-3);--filters-outline-children-padding-inline-start:var(--luzmo-spacing-4);--filters-outline-bracket-inset:var(--luzmo-spacing-2);--filters-outline-join-spacing:var(--luzmo-spacing-3);--filters-outline-condition-font-size:var(--luzmo-font-size-m)}:host([size=xl]){--filters-condition-warpper-width:72px;--filters-condition-padding-horizontal:var(--luzmo-spacing-3);--filters-condition-badge-halo:var(--luzmo-spacing-4);--filters-filters-list-gap:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--filters-nested-group-margin-top:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--filters-nested-group-margin-bottom:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--filters-vertical-line-top:var(--luzmo-spacing-3);--filters-vertical-line-bottom:var(--luzmo-spacing-3);--filters-group-actions-text-to-visual:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--filters-add-group-button-text-to-visual:var(--luzmo-spacing-4);--filters-group-actions-gap:var(--luzmo-spacing-4);--filters-add-root-group-container-margin-top:var(--luzmo-spacing-5);--filters-filter-line-gap:var(--luzmo-spacing-4);--filters-group-actions-margin-top:var(--luzmo-spacing-4);--filters-error-message-font-size:var(--luzmo-font-size-xl);--filters-text-font-size:var(--luzmo-font-size-xl);--filters-outline-row-min-height:var(--luzmo-component-height-xl);--filters-progress-circle-size:var(--luzmo-component-height-xl);--filters-text-part-gap:var(--luzmo-spacing-4);--filters-text-icon-gap:var(--luzmo-spacing-2);--filters-outline-children-margin-inline-start:var(--luzmo-spacing-4);--filters-outline-children-padding-inline-start:var(--luzmo-spacing-5);--filters-outline-bracket-inset:var(--luzmo-spacing-3);--filters-outline-join-spacing:var(--luzmo-spacing-3);--filters-outline-condition-font-size:var(--luzmo-font-size-l)}@container (width<=480px){.filter-group-container{--filters-condition-warpper-width:32px;--filters-condition-padding-horizontal:var(--luzmo-spacing-2);--filters-condition-badge-halo:var(--luzmo-spacing-2);--filters-filters-list-gap:var(--luzmo-spacing-5)}}`;function Ut(e){if(e instanceof j)return e;throw e}var Wt={and:()=>n(`AND`,{desc:`Logical AND condition for combining filters`}),or:()=>n(`OR`,{desc:`Logical OR condition for combining filters`})};function Q(e){return e===`and`?`or`:`and`}var $=class extends r(x(b,{validSizes:Object.values(y)})){constructor(...e){super(...e),this.apiUrl=`https://api.luzmo.com`,this.contentLanguage=`en`,this.filters=[],this.format=`canonical`,this.simple=!1,this.display=`rich`,this.columnDisplay=`text`,this.quiet=!1,this.readonly=!1,this.allowParameters=!1,this.parameters=[],this.debounce=300,this._internalFilterGroup=null,this._datasets=[],this._datasetsLoading=!1,this._hierarchyLabels=/* @__PURE__ */ new Map,this._hierarchyLabelsLoading=!1,this._hasSyntheticRoot=!1,this._datasetRequest=0,this._hierarchyRequest=0,this._debounceTimeout=null,this._filterKeys=/* @__PURE__ */ new WeakMap}static get styles(){return[v(Ht)]}_filterKey(e){let t=this._filterKeys.get(e);return t||(t={},this._filterKeys.set(e,t)),t}_preserveFilterKeys(e,t){this._isGroup(e)===this._isGroup(t)&&(this._filterKeys.set(t,this._filterKey(e)),this._isGroup(e)&&this._isGroup(t)&&t.filters.forEach((t,n)=>{let r=e.filters[n];r&&this._preserveFilterKeys(r,t)}))}_isCurrentGroup(e){return this._internalFilterGroup!==null&&(e===this._internalFilterGroup||this._findParentGroup(this._internalFilterGroup,e)!==null)}get _oneSizeSmaller(){return{xxs:`xxs`,xs:`xs`,s:`xs`,m:`s`,l:`m`,xl:`l`,xxl:`xl`}[this.size]||`s`}get _isDatasetIdsEmpty(){return!this.datasetIds||this.datasetIds.length===0}get _hasUnsupportedConditions(){let e=t=>t.condition===`or`||t.filters.some(t=>this._isGroup(t)&&e(t));return this.simple&&this._internalFilterGroup!==null&&e(this._internalFilterGroup)}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.display!==`rich`&&this._loadDatasetsForDisplay()}disconnectedCallback(){super.disconnectedCallback(),this._datasetRequest+=1,this._hierarchyRequest+=1,this._debounceTimeout&&=(clearTimeout(this._debounceTimeout),null)}willUpdate(e){if(super.willUpdate(e),e.has(`filters`))try{let e=Et(this.filters),t=this._internalFilterGroup;this._debounceTimeout&&=(clearTimeout(this._debounceTimeout),null),e.length===0?(this._internalFilterGroup=null,this._hasSyntheticRoot=!1):e.length===1?(this._internalFilterGroup=structuredClone(e[0]),this._hasSyntheticRoot=!1):(this._internalFilterGroup={condition:`and`,filters:structuredClone(e)},this._hasSyntheticRoot=!0),t&&this._internalFilterGroup&&this._preserveFilterKeys(t,this._internalFilterGroup)}catch(t){console.warn(`[${this.localName}] Keeping the current filters, the new value cannot be normalized:`,Ut(t)),this.filters=e.get(`filters`)??[]}this.display!==`rich`&&(e.has(`display`)||e.has(`datasetIds`)||e.has(`authKey`)||e.has(`authToken`)||e.has(`apiUrl`)||e.has(`cacheTime`))&&this._loadDatasetsForDisplay(),this.display!==`rich`&&(e.has(`filters`)||e.has(`display`)||e.has(`contentLanguage`))&&this._loadHierarchyLabelsForDisplay()}async _loadDatasetsForDisplay(){let e=++this._datasetRequest;if(!this.datasetIds||this.datasetIds.length===0){this._datasets=[],this._datasetsLoading=!1,this._loadHierarchyLabelsForDisplay();return}let{valid:t,invalid:n}=ee(this.datasetIds);if(n.length>0&&console.warn(`[${this.localName}] Invalid dataset IDs provided (not valid UUIDs): ${n.join(`, `)}. These will be skipped.`),t.length===0)this._datasets=[],this._datasetsLoading=!1,this._loadHierarchyLabelsForDisplay();else{this._datasetsLoading=!0,this._configureDataBroker();try{let n=await f.fetchDatasetsWithColumnsAndFormulas(t);if(!this.isConnected||e!==this._datasetRequest)return;this._datasets=n}catch(t){if(!this.isConnected||e!==this._datasetRequest)return;console.error(`[${this.localName}] Error fetching dataset columns & formulas:`,t),this._datasets=[]}finally{this.isConnected&&e===this._datasetRequest&&(this._datasetsLoading=!1,this._loadHierarchyLabelsForDisplay())}}}_configureDataBroker(){let e={authKey:this.authKey||``,authToken:this.authToken||``};this.apiUrl&&(e.apiUrl=this.apiUrl),this.cacheTime&&(e.staleTime=this.cacheTime,e.gcTime=this.cacheTime*2),f.configure(e)}async _loadHierarchyLabelsForDisplay(){let e=++this._hierarchyRequest;if(this.display===`rich`||!this._internalFilterGroup){if(!this.isConnected||e!==this._hierarchyRequest)return;this._hierarchyLabels=/* @__PURE__ */ new Map,this._hierarchyLabelsLoading=!1;return}let t=Ne(this._internalFilterGroup,this._filterTextContext());if(t.length===0){if(!this.isConnected||e!==this._hierarchyRequest)return;this._hierarchyLabels=/* @__PURE__ */ new Map,this._hierarchyLabelsLoading=!1}else{this._hierarchyLabelsLoading=!0,this._configureDataBroker();try{let n=await Pe(t,this.contentLanguage);if(!this.isConnected||e!==this._hierarchyRequest)return;this._hierarchyLabels=n}catch(t){if(!this.isConnected||e!==this._hierarchyRequest)return;console.error(`[${this.localName}] Error fetching hierarchy member names:`,t)}finally{this.isConnected&&e===this._hierarchyRequest&&(this._hierarchyLabelsLoading=!1)}}}_filterTextContext(){return{datasets:this._datasets,contentLanguage:this.contentLanguage,timeZone:this.timeZone,hierarchyLabels:this._hierarchyLabels,hierarchyLabelsLoading:this._hierarchyLabelsLoading}}_generateEmptyGroup(){return{id:te(),condition:`and`,filters:[]}}_generateEmptyFilter(){return{expression:void 0,parameters:[],properties:{id:te()}}}_rootGroupsForExport(){if(!this._internalFilterGroup)return[];let e=this._internalFilterGroup.filters.length>0&&this._internalFilterGroup.filters.every(e=>this._isGroup(e));return this._hasSyntheticRoot&&e?structuredClone(this._internalFilterGroup.filters):[structuredClone(this._internalFilterGroup)]}_getFiltersForExport(){let e=this._rootGroupsForExport(),t=this.format===`clean`?`clean`:`canonical`;if(e.length===0)return{filters:[],format:t};if(t===`clean`)try{return{filters:e.flatMap(e=>St(e,{format:`clean`})),format:`clean`}}catch(e){console.warn(`[${this.localName}] Cannot emit clean filters, falling back to canonical output:`,Ut(e))}return{filters:e.flatMap(e=>St(e)),format:`canonical`}}_sendChangeEvent(){this._debounceTimeout&&clearTimeout(this._debounceTimeout);let e=()=>{this._debounceTimeout=null,!this._hasUnsupportedConditions&&this.dispatchEvent(new CustomEvent(`luzmo-filters-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:this._getFiltersForExport()}))};this.debounce>0?this._debounceTimeout=setTimeout(e,this.debounce):e()}_isGroup(e){return`condition`in e&&`filters`in e}_handleParameterCreated(e){let t=e.detail?.parameter;this.readonly||!t||this.parameters.some(({parameter:e})=>e===t.parameter)||(this.parameters=[...this.parameters,t])}_toggleCondition(e){this.readonly||this.simple||(e.condition=Q(e.condition),e===this._internalFilterGroup&&(this._hasSyntheticRoot=!1),this.requestUpdate(),this._sendChangeEvent())}_addFilter(e){if(this.readonly||this._isDatasetIdsEmpty||this._hasUnsupportedConditions)return;let t=e;t||=(this._internalFilterGroup||=this._generateEmptyGroup(),this._internalFilterGroup),t.filters.push(this._generateEmptyFilter()),this.requestUpdate(),this._sendChangeEvent()}_addSubGroup(e){if(this.readonly||this._isDatasetIdsEmpty||this.simple)return;let t=this._generateEmptyGroup();t.condition=Q(e.condition),t.filters.push(this._generateEmptyFilter()),e.filters.push(t),this.requestUpdate(),this._sendChangeEvent()}_removeFilter(e,t){if(this.readonly||!this._internalFilterGroup||!this._isCurrentGroup(e)||this._hasUnsupportedConditions)return;let n=e.filters.findIndex(e=>this._filterKey(e)===t);if(n!==-1){if(e.filters.splice(n,1),e!==this._internalFilterGroup&&e.filters.length===0){let t=this._findParentGroup(this._internalFilterGroup,e);if(t){let n=t.filters.indexOf(e);n!==-1&&t.filters.splice(n,1)}}this._collapseGroupsAfterDelete(),this.requestUpdate(),this._sendChangeEvent()}}_updateFilter(e,t,n){n.stopPropagation();let r=n.currentTarget;if(this.readonly||!r?.isConnected||this._hasUnsupportedConditions||!this._isCurrentGroup(e))return;let i=e.filters.findIndex(e=>this._filterKey(e)===t);i!==-1&&(this._isGroup(e.filters[i])||(this._filterKeys.set(n.detail.filter,t),e.filters[i]=n.detail.filter,this._sendChangeEvent()))}_addGroup(){if(this.readonly||this._isDatasetIdsEmpty||this.simple)return;this._internalFilterGroup||=this._generateEmptyGroup();let e=this._generateEmptyGroup();e.condition=Q(this._internalFilterGroup.condition),e.filters.push(this._internalFilterGroup);let t=this._generateEmptyGroup();t.condition=Q(e.condition),t.filters.push(this._generateEmptyFilter()),e.filters.push(t),this._internalFilterGroup=e,this._hasSyntheticRoot=!1,this.requestUpdate(),this._sendChangeEvent()}_renderFilterItem(e,t){return m`
|
|
367
|
+
</div>`}};t([_({type:String,attribute:`api-url`,reflect:!0})],Z.prototype,`apiUrl`,void 0),t([_({type:String,attribute:`auth-key`,reflect:!0})],Z.prototype,`authKey`,void 0),t([_({type:String,attribute:`auth-token`,reflect:!0})],Z.prototype,`authToken`,void 0),t([_({type:Number,attribute:`cache-time`,reflect:!0})],Z.prototype,`cacheTime`,void 0),t([_({type:String,reflect:!0})],Z.prototype,`contentLanguage`,void 0),t([_({type:String,attribute:`time-zone`,reflect:!0})],Z.prototype,`timeZone`,void 0),t([_({type:Array,attribute:`dataset-ids`,reflect:!0})],Z.prototype,`datasetIds`,void 0),t([_({type:Object,reflect:!1})],Z.prototype,`filter`,void 0),t([_({type:String,reflect:!0})],Z.prototype,`display`,void 0),t([_({type:String,attribute:`column-display`,reflect:!0})],Z.prototype,`columnDisplay`,void 0),t([_({type:Boolean,reflect:!0})],Z.prototype,`quiet`,void 0),t([_({type:Boolean,reflect:!0})],Z.prototype,`readonly`,void 0),t([_({type:Boolean,reflect:!0})],Z.prototype,`disabled`,void 0),t([_({attribute:!1})],Z.prototype,`textContext`,void 0),t([_({type:Boolean,attribute:`allow-parameters`,reflect:!0})],Z.prototype,`allowParameters`,void 0),t([_({attribute:!1})],Z.prototype,`parameters`,void 0),t([v()],Z.prototype,`_type`,void 0),t([v()],Z.prototype,`_subType`,void 0),t([v()],Z.prototype,`_isFormula`,void 0),t([v()],Z.prototype,`_error`,void 0),t([v()],Z.prototype,`_loading`,void 0),t([v()],Z.prototype,`_datasetsDataFields`,void 0),t([v()],Z.prototype,`_hierarchyLabels`,void 0),t([v()],Z.prototype,`_hierarchyLabelsLoading`,void 0),Z=t([i()],Z),customElements.get(`luzmo-filter-item`)||customElements.define(`luzmo-filter-item`,Z);var qt=`:host{font-family:var(--luzmo-filters-font-family,var(--luzmo-font-family));color:var(--luzmo-filters-font-color,var(--luzmo-font-color));max-width:100%;display:block;container-type:inline-size}.filter-group-container{max-width:100%;padding:calc(var(--luzmo-indicator-gap) + 2 * var(--luzmo-indicator-width));overflow-x:hidden}.filter-group{flex-direction:row;min-width:0;max-width:100%;display:flex}.filter-group.nested{margin-top:var(--luzmo-filters-nested-group-margin-top,var(--filters-nested-group-margin-top));margin-bottom:var(--luzmo-filters-nested-group-margin-bottom,var(--filters-nested-group-margin-bottom))}.group-content{flex-direction:column;flex:1;min-width:0;display:flex}.filters-list{gap:var(--luzmo-filters-filters-list-gap,var(--filters-filters-list-gap));flex-direction:column;min-width:0;max-width:100%;display:flex}.filter-item-wrapper{align-items:flex-start;min-width:0;max-width:100%;display:flex;position:relative}.filter-item-content{align-items:flex-start;gap:var(--luzmo-filters-filter-line-gap,var(--filters-filter-line-gap));flex-wrap:nowrap;flex:1;min-width:0;display:flex}.filter-item-content luzmo-filter-item{flex:1;min-width:0}.filter-item-content .delete-filter-button{flex-shrink:0;align-self:flex-end;margin-inline-start:auto}.condition-wrapper{flex:0 0 var(--luzmo-filters-condition-warpper-width,var(--filters-condition-warpper-width));justify-content:center;align-items:center;display:flex;position:relative}.condition-wrapper:before{content:"";left:50%;top:var(--luzmo-filters-vertical-line-top,var(--filters-vertical-line-top));bottom:var(--luzmo-filters-vertical-line-bottom,var(--filters-vertical-line-bottom));width:var(--luzmo-filters-vertical-line-width,var(--filters-vertical-line-width));background:var(--luzmo-filters-vertical-line-color,var(--luzmo-border-color));position:absolute}.condition-badge{min-width:auto;padding-inline:var(--luzmo-filters-condition-padding-horizontal,var(--filters-condition-padding-horizontal));font-weight:var(--luzmo-filters-condition-font-weight,var(--filters-condition-font-weight-emphasized));text-transform:uppercase;background:var(--luzmo-filters-condition-badge-background,var(--luzmo-primary));color:var(--luzmo-filters-condition-badge-color,var(--luzmo-primary-inverse-color));border-radius:var(--luzmo-filters-condition-badge-border-radius,var(--luzmo-border-radius));box-shadow:0 0 0 var(--luzmo-filters-condition-badge-halo,var(--filters-condition-badge-halo)) var(--luzmo-filters-condition-badge-background,var(--luzmo-background-color))}.condition-badge:hover{background:var(--luzmo-filters-condition-badge-background-hover,var(--luzmo-primary-hover))}.group-actions{margin-top:var(--luzmo-filters-group-actions-margin-top,var(--filters-group-actions-margin-top));gap:var(--luzmo-filters-group-actions-gap,var(--filters-group-actions-gap));flex-wrap:wrap;display:flex}.delete-group-button{margin-left:auto}.add-root-group-container{margin-top:var(--luzmo-filters-add-root-group-container-margin-top,var(--filters-add-root-group-container-margin-top));padding-left:0}.add-subgroup-button,.add-filter-button{--luzmo-action-button-text-to-visual:var(--luzmo-filters-group-actions-text-to-visual,var(--filters-group-actions-text-to-visual));--luzmo-action-button-content-color-default:var(--luzmo-filters-group-actions-color,var(--luzmo-primary-hover));--luzmo-action-button-content-color-hover:var(--luzmo-filters-group-actions-color-hover,var(--luzmo-primary-hover));--luzmo-action-button-content-color-down:var(--luzmo-filters-group-actions-color-down,var(--luzmo-primary-down));--luzmo-action-button-content-color-focus:var(--luzmo-filters-group-actions-color-focus,var(--luzmo-primary-focus))}.add-group-button{--luzmo-button-padding-label-to-icon:var(--luzmo-filters-add-group-button-text-to-visual,var(--filters-add-group-button-text-to-visual))}.dataset-ids-empty-message{color:var(--luzmo-filters-error-message-color,var(--luzmo-disabled-color));font-size:var(--luzmo-filters-error-message-font-size,var(--filters-font-size))}@container (width<=480px){.condition-badge{--luzmo-action-button-font-size:.6875rem;--luzmo-action-button-height:1.2rem;--luzmo-button-line-height:1.2rem;font-size:.6875rem;line-height:1.2rem;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)rotate(-90deg)}:host([dir=rtl]) .condition-badge{transform:translate(-50%,-50%)rotate(90deg)}}.filters-loading{min-height:var(--filters-progress-circle-size);align-items:center;display:inline-flex}.filters-loading luzmo-progress-circle{--luzmo-progress-circle-size:var(--filters-progress-circle-size)}.filters-text,.filters-outline{font-size:var(--luzmo-filters-text-font-size,var(--filters-text-font-size));line-height:1.5}.filters-outline{--filters-outline-sentence-padding-block:calc((var(--filters-outline-row-min-height) - 1lh) / 2)}luzmo-filter-item[display=text]{--luzmo-filter-item-column-badge-color:var(--luzmo-filters-column-badge-color);--luzmo-filter-item-column-badge-font-color:var(--luzmo-filters-column-badge-font-color);--luzmo-filter-item-text-font-size:var(--luzmo-filters-text-font-size,var(--filters-text-font-size));--luzmo-filter-item-text-expression-color:var(--luzmo-filters-expression-color,var(--filters-expression-color));--luzmo-filter-item-text-expression-font-weight:var(--luzmo-filters-expression-font-weight,var(--filters-expression-font-weight))}.filters-text luzmo-filter-item[display=text],.filters-text-group luzmo-filter-item[display=text]{--luzmo-filter-item-text-icon-gap:var(--luzmo-filters-text-icon-gap,var(--filters-text-icon-gap))}.outline-sentence>luzmo-filter-item[display=text]{--luzmo-filter-item-text-icon-gap:var(--luzmo-filters-text-part-gap,var(--filters-text-part-gap))}.filters-text{white-space:pre-wrap;word-break:break-word}.filters-text .filters-text-condition{margin-inline:0}.filters-text-condition,.filters-text-paren{vertical-align:middle}.filters-text-condition{color:var(--luzmo-filters-condition-color,var(--filters-condition-color));font-weight:var(--luzmo-filters-condition-font-weight,var(--filters-condition-font-weight))}.outline-group{gap:var(--luzmo-spacing-1);flex-direction:column;min-width:0;display:flex}.outline-children>.outline-group:not(:first-child){margin-top:calc(var(--luzmo-spacing-1) + var(--filters-outline-sentence-padding-block) + var(--filters-outline-join-spacing) - var(--luzmo-spacing-2))}.outline-condition{color:var(--luzmo-filters-condition-color,var(--filters-condition-color));font-size:var(--luzmo-filters-outline-condition-font-size,var(--filters-outline-condition-font-size));font-weight:var(--luzmo-filters-condition-font-weight,var(--filters-condition-font-weight-emphasized));letter-spacing:.04em}.outline-children{gap:var(--luzmo-spacing-2);min-width:0;flex-direction:column;margin-inline-start:var(--luzmo-filters-outline-children-margin-inline-start,var(--filters-outline-children-margin-inline-start));padding-inline-start:var(--luzmo-filters-outline-children-padding-inline-start,var(--filters-outline-children-padding-inline-start));display:flex;position:relative}.outline-children:not(.outline-children--single):before{content:"";inset-inline-start:0;inset-block:var(--luzmo-filters-outline-bracket-inset,var(--filters-outline-bracket-inset));width:var(--luzmo-spacing-2);border-inline-start:1px solid var(--luzmo-border-color);border-block-start:1px solid var(--luzmo-border-color);border-block-end:1px solid var(--luzmo-border-color);border-start-start-radius:var(--luzmo-border-radius);border-end-start-radius:var(--luzmo-border-radius);position:absolute}.outline-children--single{margin-inline-start:0;padding-inline-start:0}.outline-row{align-items:flex-start;column-gap:var(--luzmo-spacing-2);min-width:0;min-height:var(--filters-outline-row-min-height);flex-wrap:nowrap;display:flex}.outline-sentence{align-items:center;gap:var(--luzmo-filters-text-part-gap,var(--filters-text-part-gap));min-width:0;padding-block:var(--filters-outline-sentence-padding-block);flex-wrap:wrap;flex:auto;display:flex}.outline-delete{flex:none;align-self:flex-end;margin-inline-start:auto}:host{--filters-condition-warpper-width:56px;--filters-condition-padding-horizontal:var(--luzmo-spacing-2);--filters-condition-badge-halo:var(--luzmo-spacing-3);--filters-filters-list-gap:var(--luzmo-spacing-3);--filters-nested-group-margin-top:var(--luzmo-spacing-3);--filters-nested-group-margin-bottom:var(--luzmo-spacing-3);--filters-vertical-line-top:var(--luzmo-spacing-2);--filters-vertical-line-bottom:var(--luzmo-spacing-2);--filters-vertical-line-width:1px;--filters-group-actions-text-to-visual:var(--luzmo-spacing-2);--filters-add-group-button-text-to-visual:var(--luzmo-spacing-3);--filters-group-actions-gap:var(--luzmo-spacing-3);--filters-add-root-group-container-margin-top:var(--luzmo-spacing-4);--filters-filter-line-gap:var(--luzmo-spacing-3);--filters-group-actions-margin-top:var(--luzmo-spacing-3);--filters-error-message-font-size:var(--luzmo-font-size);--filters-text-font-size:var(--luzmo-font-size-m);--filters-outline-row-min-height:var(--luzmo-component-height);--filters-progress-circle-size:var(--luzmo-component-height);--filters-text-part-gap:var(--luzmo-spacing-2);--filters-text-icon-gap:var(--luzmo-spacing-1);--filters-outline-children-margin-inline-start:var(--luzmo-spacing-2);--filters-outline-children-padding-inline-start:var(--luzmo-spacing-3);--filters-outline-bracket-inset:var(--luzmo-spacing-2);--filters-outline-join-spacing:var(--luzmo-spacing-2);--filters-expression-color:var(--luzmo-filters-font-color,var(--luzmo-font-color));--filters-expression-font-weight:var(--luzmo-font-weight);--filters-condition-color:var(--luzmo-filters-font-color,var(--luzmo-font-color));--filters-condition-font-weight:var(--luzmo-font-weight);--filters-condition-font-weight-emphasized:var(--luzmo-font-weight-bold);--filters-outline-condition-font-size:var(--luzmo-font-size-s)}:host([size=s]){--filters-condition-warpper-width:48px;--filters-condition-padding-horizontal:var(--luzmo-spacing-2);--filters-condition-badge-halo:var(--luzmo-spacing-2);--filters-filters-list-gap:calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--filters-nested-group-margin-top:calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--filters-nested-group-margin-bottom:calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1));--filters-vertical-line-top:var(--luzmo-spacing-2);--filters-vertical-line-bottom:var(--luzmo-spacing-2);--filters-group-actions-text-to-visual:var(--luzmo-spacing-1);--filters-add-group-button-text-to-visual:var(--luzmo-spacing-2);--filters-group-actions-gap:var(--luzmo-spacing-2);--filters-add-root-group-container-margin-top:var(--luzmo-spacing-3);--filters-filter-line-gap:var(--luzmo-spacing-2);--filters-group-actions-margin-top:var(--luzmo-spacing-2);--filters-error-message-font-size:var(--luzmo-font-size-s);--filters-text-font-size:var(--luzmo-font-size-s);--filters-outline-row-min-height:var(--luzmo-component-height-s);--filters-progress-circle-size:var(--luzmo-component-height-s);--filters-text-part-gap:var(--luzmo-spacing-1);--filters-text-icon-gap:var(--luzmo-spacing-1);--filters-outline-children-margin-inline-start:var(--luzmo-spacing-1);--filters-outline-children-padding-inline-start:var(--luzmo-spacing-3);--filters-outline-bracket-inset:var(--luzmo-spacing-1);--filters-outline-join-spacing:var(--luzmo-spacing-1);--filters-outline-condition-font-size:var(--luzmo-font-size-xs)}:host([size=l]){--filters-condition-warpper-width:64px;--filters-condition-padding-horizontal:var(--luzmo-spacing-3);--filters-condition-badge-halo:var(--luzmo-spacing-4);--filters-filters-list-gap:var(--luzmo-spacing-4);--filters-nested-group-margin-top:var(--luzmo-spacing-4);--filters-nested-group-margin-bottom:var(--luzmo-spacing-4);--filters-vertical-line-top:var(--luzmo-spacing-3);--filters-vertical-line-bottom:var(--luzmo-spacing-3);--filters-group-actions-text-to-visual:var(--luzmo-spacing-2);--filters-add-group-button-text-to-visual:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--filters-group-actions-gap:var(--luzmo-spacing-3);--filters-add-root-group-container-margin-top:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--filters-filter-line-gap:var(--luzmo-spacing-3);--filters-group-actions-margin-top:var(--luzmo-spacing-3);--filters-error-message-font-size:var(--luzmo-font-size-l);--filters-text-font-size:var(--luzmo-font-size-l);--filters-outline-row-min-height:var(--luzmo-component-height-l);--filters-progress-circle-size:var(--luzmo-component-height-l);--filters-text-part-gap:var(--luzmo-spacing-3);--filters-text-icon-gap:var(--luzmo-spacing-2);--filters-outline-children-margin-inline-start:var(--luzmo-spacing-3);--filters-outline-children-padding-inline-start:var(--luzmo-spacing-4);--filters-outline-bracket-inset:var(--luzmo-spacing-2);--filters-outline-join-spacing:var(--luzmo-spacing-3);--filters-outline-condition-font-size:var(--luzmo-font-size-m)}:host([size=xl]){--filters-condition-warpper-width:72px;--filters-condition-padding-horizontal:var(--luzmo-spacing-3);--filters-condition-badge-halo:var(--luzmo-spacing-4);--filters-filters-list-gap:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--filters-nested-group-margin-top:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--filters-nested-group-margin-bottom:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--filters-vertical-line-top:var(--luzmo-spacing-3);--filters-vertical-line-bottom:var(--luzmo-spacing-3);--filters-group-actions-text-to-visual:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--filters-add-group-button-text-to-visual:var(--luzmo-spacing-4);--filters-group-actions-gap:var(--luzmo-spacing-4);--filters-add-root-group-container-margin-top:var(--luzmo-spacing-5);--filters-filter-line-gap:var(--luzmo-spacing-4);--filters-group-actions-margin-top:var(--luzmo-spacing-4);--filters-error-message-font-size:var(--luzmo-font-size-xl);--filters-text-font-size:var(--luzmo-font-size-xl);--filters-outline-row-min-height:var(--luzmo-component-height-xl);--filters-progress-circle-size:var(--luzmo-component-height-xl);--filters-text-part-gap:var(--luzmo-spacing-4);--filters-text-icon-gap:var(--luzmo-spacing-2);--filters-outline-children-margin-inline-start:var(--luzmo-spacing-4);--filters-outline-children-padding-inline-start:var(--luzmo-spacing-5);--filters-outline-bracket-inset:var(--luzmo-spacing-3);--filters-outline-join-spacing:var(--luzmo-spacing-3);--filters-outline-condition-font-size:var(--luzmo-font-size-l)}@container (width<=480px){.filter-group-container{--filters-condition-warpper-width:32px;--filters-condition-padding-horizontal:var(--luzmo-spacing-2);--filters-condition-badge-halo:var(--luzmo-spacing-2);--filters-filters-list-gap:var(--luzmo-spacing-5)}}`;function Jt(e){if(e instanceof N)return e;throw e}var Yt={and:()=>n(`AND`,{desc:`Logical AND condition for combining filters`}),or:()=>n(`OR`,{desc:`Logical OR condition for combining filters`})};function Q(e){return e===`and`?`or`:`and`}var $=class extends r(S(x,{validSizes:Object.values(b)})){constructor(...e){super(...e),this.apiUrl=`https://api.luzmo.com`,this.contentLanguage=`en`,this.filters=[],this.format=`canonical`,this.simple=!1,this.display=`rich`,this.columnDisplay=`text`,this.quiet=!1,this.readonly=!1,this.allowParameters=!1,this.parameters=[],this.debounce=300,this._internalFilterGroup=null,this._datasets=[],this._datasetsLoading=!1,this._hierarchyLabels=/* @__PURE__ */ new Map,this._hierarchyLabelsLoading=!1,this._hasSyntheticRoot=!1,this._datasetRequest=0,this._hierarchyRequest=0,this._debounceTimeout=null,this._filterKeys=/* @__PURE__ */ new WeakMap}static get styles(){return[y(qt)]}_filterKey(e){let t=this._filterKeys.get(e);return t||(t={},this._filterKeys.set(e,t)),t}_preserveFilterKeys(e,t){this._isGroup(e)===this._isGroup(t)&&(this._filterKeys.set(t,this._filterKey(e)),this._isGroup(e)&&this._isGroup(t)&&t.filters.forEach((t,n)=>{let r=e.filters[n];r&&this._preserveFilterKeys(r,t)}))}_isCurrentGroup(e){return this._internalFilterGroup!==null&&(e===this._internalFilterGroup||this._findParentGroup(this._internalFilterGroup,e)!==null)}get _oneSizeSmaller(){return{xxs:`xxs`,xs:`xs`,s:`xs`,m:`s`,l:`m`,xl:`l`,xxl:`xl`}[this.size]||`s`}get _isDatasetIdsEmpty(){return!this.datasetIds||this.datasetIds.length===0}get _hasUnsupportedConditions(){let e=t=>t.condition===`or`||t.filters.some(t=>this._isGroup(t)&&e(t));return this.simple&&this._internalFilterGroup!==null&&e(this._internalFilterGroup)}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.display!==`rich`&&this._loadDatasetsForDisplay()}disconnectedCallback(){super.disconnectedCallback(),this._datasetRequest+=1,this._hierarchyRequest+=1,this._debounceTimeout&&=(clearTimeout(this._debounceTimeout),null)}willUpdate(e){if(super.willUpdate(e),e.has(`filters`))try{let e=jt(this.filters),t=this._internalFilterGroup;this._debounceTimeout&&=(clearTimeout(this._debounceTimeout),null),e.length===0?(this._internalFilterGroup=null,this._hasSyntheticRoot=!1):e.length===1?(this._internalFilterGroup=structuredClone(e[0]),this._hasSyntheticRoot=!1):(this._internalFilterGroup={condition:`and`,filters:structuredClone(e)},this._hasSyntheticRoot=!0),t&&this._internalFilterGroup&&this._preserveFilterKeys(t,this._internalFilterGroup)}catch(t){console.warn(`[${this.localName}] Keeping the current filters, the new value cannot be normalized:`,Jt(t)),this.filters=e.get(`filters`)??[]}this.display!==`rich`&&(e.has(`display`)||e.has(`datasetIds`)||e.has(`authKey`)||e.has(`authToken`)||e.has(`apiUrl`)||e.has(`cacheTime`))&&this._loadDatasetsForDisplay(),this.display!==`rich`&&(e.has(`filters`)||e.has(`display`)||e.has(`contentLanguage`))&&this._loadHierarchyLabelsForDisplay()}async _loadDatasetsForDisplay(){let e=++this._datasetRequest;if(!this.datasetIds||this.datasetIds.length===0){this._datasets=[],this._datasetsLoading=!1,this._loadHierarchyLabelsForDisplay();return}let{valid:t,invalid:n}=f(this.datasetIds);if(n.length>0&&console.warn(`[${this.localName}] Invalid dataset IDs provided (not valid UUIDs): ${n.join(`, `)}. These will be skipped.`),t.length===0)this._datasets=[],this._datasetsLoading=!1,this._loadHierarchyLabelsForDisplay();else{this._datasetsLoading=!0,this._configureDataBroker();try{let n=await p.fetchDatasetsWithColumnsAndFormulas(t);if(!this.isConnected||e!==this._datasetRequest)return;this._datasets=n}catch(t){if(!this.isConnected||e!==this._datasetRequest)return;console.error(`[${this.localName}] Error fetching dataset columns & formulas:`,t),this._datasets=[]}finally{this.isConnected&&e===this._datasetRequest&&(this._datasetsLoading=!1,this._loadHierarchyLabelsForDisplay())}}}_configureDataBroker(){let e={authKey:this.authKey||``,authToken:this.authToken||``};this.apiUrl&&(e.apiUrl=this.apiUrl),this.cacheTime&&(e.staleTime=this.cacheTime,e.gcTime=this.cacheTime*2),p.configure(e)}async _loadHierarchyLabelsForDisplay(){let e=++this._hierarchyRequest;if(this.display===`rich`||!this._internalFilterGroup){if(!this.isConnected||e!==this._hierarchyRequest)return;this._hierarchyLabels=/* @__PURE__ */ new Map,this._hierarchyLabelsLoading=!1;return}let t=Pe(this._internalFilterGroup,this._filterTextContext());if(t.length===0){if(!this.isConnected||e!==this._hierarchyRequest)return;this._hierarchyLabels=/* @__PURE__ */ new Map,this._hierarchyLabelsLoading=!1}else{this._hierarchyLabelsLoading=!0,this._configureDataBroker();try{let n=await Fe(t,this.contentLanguage);if(!this.isConnected||e!==this._hierarchyRequest)return;this._hierarchyLabels=n}catch(t){if(!this.isConnected||e!==this._hierarchyRequest)return;console.error(`[${this.localName}] Error fetching hierarchy member names:`,t)}finally{this.isConnected&&e===this._hierarchyRequest&&(this._hierarchyLabelsLoading=!1)}}}_filterTextContext(){return{datasets:this._datasets,contentLanguage:this.contentLanguage,timeZone:this.timeZone,hierarchyLabels:this._hierarchyLabels,hierarchyLabelsLoading:this._hierarchyLabelsLoading}}_generateEmptyGroup(){return{id:ee(),condition:`and`,filters:[]}}_generateEmptyFilter(){return{expression:void 0,parameters:[],properties:{id:ee()}}}_rootGroupsForExport(){if(!this._internalFilterGroup)return[];let e=this._internalFilterGroup.filters.length>0&&this._internalFilterGroup.filters.every(e=>this._isGroup(e));return this._hasSyntheticRoot&&e?structuredClone(this._internalFilterGroup.filters):[structuredClone(this._internalFilterGroup)]}_getFiltersForExport(){let e=this._rootGroupsForExport(),t=this.format===`clean`?`clean`:`canonical`;if(e.length===0)return{filters:[],format:t};if(t===`clean`)try{return{filters:e.flatMap(e=>Tt(e,{format:`clean`})),format:`clean`}}catch(e){console.warn(`[${this.localName}] Cannot emit clean filters, falling back to canonical output:`,Jt(e))}return{filters:e.flatMap(e=>Tt(e)),format:`canonical`}}_sendChangeEvent(){this._debounceTimeout&&clearTimeout(this._debounceTimeout);let e=()=>{this._debounceTimeout=null,!this._hasUnsupportedConditions&&this.dispatchEvent(new CustomEvent(`luzmo-filters-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:this._getFiltersForExport()}))};this.debounce>0?this._debounceTimeout=setTimeout(e,this.debounce):e()}_isGroup(e){return`condition`in e&&`filters`in e}_handleParameterCreated(e){let t=e.detail?.parameter;this.readonly||!t||this.parameters.some(({parameter:e})=>e===t.parameter)||(this.parameters=[...this.parameters,t])}_toggleCondition(e){this.readonly||this.simple||(e.condition=Q(e.condition),e===this._internalFilterGroup&&(this._hasSyntheticRoot=!1),this.requestUpdate(),this._sendChangeEvent())}_addFilter(e){if(this.readonly||this._isDatasetIdsEmpty||this._hasUnsupportedConditions)return;let t=e;t||=(this._internalFilterGroup||=this._generateEmptyGroup(),this._internalFilterGroup),t.filters.push(this._generateEmptyFilter()),this.requestUpdate(),this._sendChangeEvent()}_addSubGroup(e){if(this.readonly||this._isDatasetIdsEmpty||this.simple)return;let t=this._generateEmptyGroup();t.condition=Q(e.condition),t.filters.push(this._generateEmptyFilter()),e.filters.push(t),this.requestUpdate(),this._sendChangeEvent()}_removeFilter(e,t){if(this.readonly||!this._internalFilterGroup||!this._isCurrentGroup(e)||this._hasUnsupportedConditions)return;let n=e.filters.findIndex(e=>this._filterKey(e)===t);if(n!==-1){if(e.filters.splice(n,1),e!==this._internalFilterGroup&&e.filters.length===0){let t=this._findParentGroup(this._internalFilterGroup,e);if(t){let n=t.filters.indexOf(e);n!==-1&&t.filters.splice(n,1)}}this._collapseGroupsAfterDelete(),this.requestUpdate(),this._sendChangeEvent()}}_updateFilter(e,t,n){n.stopPropagation();let r=n.currentTarget;if(this.readonly||!r?.isConnected||this._hasUnsupportedConditions||!this._isCurrentGroup(e))return;let i=e.filters.findIndex(e=>this._filterKey(e)===t);i!==-1&&(this._isGroup(e.filters[i])||(this._filterKeys.set(n.detail.filter,t),e.filters[i]=n.detail.filter,this._sendChangeEvent()))}_addGroup(){if(this.readonly||this._isDatasetIdsEmpty||this.simple)return;this._internalFilterGroup||=this._generateEmptyGroup();let e=this._generateEmptyGroup();e.condition=Q(this._internalFilterGroup.condition),e.filters.push(this._internalFilterGroup);let t=this._generateEmptyGroup();t.condition=Q(e.condition),t.filters.push(this._generateEmptyFilter()),e.filters.push(t),this._internalFilterGroup=e,this._hasSyntheticRoot=!1,this.requestUpdate(),this._sendChangeEvent()}_renderFilterItem(e,t){return h`
|
|
366
368
|
<div class="filter-item-wrapper">
|
|
367
369
|
<div class="filter-item-content">
|
|
368
370
|
<luzmo-filter-item
|
|
@@ -387,7 +389,7 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
387
389
|
class="delete-filter-button"
|
|
388
390
|
.size=${this.size}
|
|
389
391
|
quiet
|
|
390
|
-
aria-disabled=${this.readonly?`true`:
|
|
392
|
+
aria-disabled=${this.readonly?`true`:g}
|
|
391
393
|
.label=${n(`Remove filter`,{desc:`Aria label for remove filter button`})}
|
|
392
394
|
@click=${this._removeFilter.bind(this,t,this._filterKey(e))}
|
|
393
395
|
>
|
|
@@ -395,29 +397,29 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
395
397
|
</luzmo-action-button>
|
|
396
398
|
</div>
|
|
397
399
|
</div>
|
|
398
|
-
`}_renderGroup(e,t=!1){let r=e.filters.length>0,i=e.filters.length>1,a=
|
|
400
|
+
`}_renderGroup(e,t=!1){let r=e.filters.length>0,i=e.filters.length>1,a=Yt[e.condition]?.()??e.condition;return h`
|
|
399
401
|
<div class="filter-group ${t&&!this.simple?`nested`:``}" role="group">
|
|
400
|
-
${!this.simple&&(t||i)?
|
|
402
|
+
${!this.simple&&(t||i)?h`
|
|
401
403
|
<div class="condition-wrapper">
|
|
402
|
-
${i?
|
|
404
|
+
${i?h`
|
|
403
405
|
<luzmo-action-button
|
|
404
406
|
class="condition-badge"
|
|
405
407
|
.size=${this._oneSizeSmaller}
|
|
406
408
|
quiet
|
|
407
|
-
aria-disabled=${this.readonly?`true`:
|
|
409
|
+
aria-disabled=${this.readonly?`true`:g}
|
|
408
410
|
aria-pressed=${e.condition===`and`?`true`:`false`}
|
|
409
411
|
.label=${n(`Toggle filter condition, currently `,{desc:`Aria label prefix for filter condition toggle`})+a}
|
|
410
412
|
@click=${this._toggleCondition.bind(this,e)}
|
|
411
413
|
>
|
|
412
414
|
${a}
|
|
413
415
|
</luzmo-action-button>
|
|
414
|
-
`:
|
|
416
|
+
`:g}
|
|
415
417
|
</div>
|
|
416
|
-
`:
|
|
418
|
+
`:g}
|
|
417
419
|
<div class="group-content">
|
|
418
|
-
${r?
|
|
420
|
+
${r?h`
|
|
419
421
|
<div class="filters-list">
|
|
420
|
-
${
|
|
422
|
+
${re(e.filters,e=>this._filterKey(e),t=>h`
|
|
421
423
|
${this._isGroup(t)?this._renderGroup(t,!0):this._renderFilterItem(t,e)}
|
|
422
424
|
`)}
|
|
423
425
|
</div>
|
|
@@ -428,7 +430,7 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
428
430
|
class="add-filter-button"
|
|
429
431
|
.size=${this.size}
|
|
430
432
|
quiet
|
|
431
|
-
aria-disabled=${this.readonly?`true`:
|
|
433
|
+
aria-disabled=${this.readonly?`true`:g}
|
|
432
434
|
?disabled=${this._isDatasetIdsEmpty}
|
|
433
435
|
@click=${this._addFilter.bind(this,e)}
|
|
434
436
|
>
|
|
@@ -436,11 +438,11 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
436
438
|
${n(`Filter`,{desc:`Add filter button label`})}
|
|
437
439
|
</luzmo-action-button>
|
|
438
440
|
|
|
439
|
-
${this.simple?h
|
|
441
|
+
${this.simple?g:h`<luzmo-action-button
|
|
440
442
|
class="add-subgroup-button"
|
|
441
443
|
.size=${this.size}
|
|
442
444
|
quiet
|
|
443
|
-
aria-disabled=${this.readonly?`true`:
|
|
445
|
+
aria-disabled=${this.readonly?`true`:g}
|
|
444
446
|
?disabled=${this._isDatasetIdsEmpty}
|
|
445
447
|
@click=${this._addSubGroup.bind(this,e)}
|
|
446
448
|
>
|
|
@@ -450,7 +452,7 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
450
452
|
</div>
|
|
451
453
|
</div>
|
|
452
454
|
</div>
|
|
453
|
-
`}_findParentGroup(e,t){for(let n of e.filters){if(n===t)return e;if(this._isGroup(n)){let e=this._findParentGroup(n,t);if(e)return e}}return null}_collapseIfNeeded(e){if(e.filters.length===1&&this._isGroup(e.filters[0])){let t=e.filters[0];e.condition=t.condition,e.filters=t.filters,e.id=t.id,e.clause=t.clause,e.origin=t.origin,e.datasetId=t.datasetId,e.vizId=t.vizId,e.itemId=t.itemId,e.isDrilldown=t.isDrilldown,e.type=t.type,e===this._internalFilterGroup&&(this._hasSyntheticRoot=!1)}}_collapseGroupsAfterDelete(){if(!this._internalFilterGroup)return;let e=t=>{for(let n of t.filters)this._isGroup(n)&&e(n);this._collapseIfNeeded(t)};e(this._internalFilterGroup)}_renderTextLeaf(e){return
|
|
455
|
+
`}_findParentGroup(e,t){for(let n of e.filters){if(n===t)return e;if(this._isGroup(n)){let e=this._findParentGroup(n,t);if(e)return e}}return null}_collapseIfNeeded(e){if(e.filters.length===1&&this._isGroup(e.filters[0])){let t=e.filters[0];e.condition=t.condition,e.filters=t.filters,e.id=t.id,e.clause=t.clause,e.origin=t.origin,e.datasetId=t.datasetId,e.vizId=t.vizId,e.itemId=t.itemId,e.isDrilldown=t.isDrilldown,e.type=t.type,e===this._internalFilterGroup&&(this._hasSyntheticRoot=!1)}}_collapseGroupsAfterDelete(){if(!this._internalFilterGroup)return;let e=t=>{for(let n of t.filters)this._isGroup(n)&&e(n);this._collapseIfNeeded(t)};e(this._internalFilterGroup)}_renderTextLeaf(e){return je(e,this._filterTextContext())?h`<luzmo-filter-item
|
|
454
456
|
class="filters-text-leaf"
|
|
455
457
|
display="text"
|
|
456
458
|
.columnDisplay=${this.columnDisplay}
|
|
@@ -461,15 +463,15 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
461
463
|
.timeZone=${this.timeZone}
|
|
462
464
|
.size=${this.size}
|
|
463
465
|
readonly
|
|
464
|
-
></luzmo-filter-item>`:
|
|
465
|
-
>${
|
|
466
|
-
>`}_renderDatasetLoading(){let e=n(`Loading filters`,{desc:`Accessible label while filter column names are loading`});return
|
|
466
|
+
></luzmo-filter-item>`:g}_renderTextGroup(t,r){let i=[];for(let e of t.filters){let t=this._isGroup(e)?this._renderTextGroup(e,!1):this._renderTextLeaf(e);t!==g&&i.push(t)}if(i.length===0)return g;if(i.length===1)return i[0];let a=h`<span class="filters-text-condition">${Yt[t.condition]()}</span>`,o=t.condition===`or`?n(e`${C[0]}\u2063 ${C[1]}\u2063 ${C[2]}`,{id:`filters-sentence-or`,desc:`Left filter sentence, logical OR condition, and right filter sentence`}):n(e`${C[0]}\u2063 ${C[1]}\u2063 ${C[2]}`,{id:`filters-sentence-and`,desc:`Left filter sentence, logical AND condition, and right filter sentence`}),s=i.slice(1).reduce((e,t)=>w(o,[h`${e}`,a,t]),[i[0]]);return r?h`${s}`:h`<span class="filters-text-group"
|
|
467
|
+
>${w(n(e`(${C[0]})`,{id:`filters-sentence-parentheses`,desc:`Nested filter sentence wrapped in parentheses`}),[h`${s}`]).map(e=>typeof e==`string`?h`<span class="filters-text-paren">${e}</span>`:e)}</span
|
|
468
|
+
>`}_renderDatasetLoading(){let e=n(`Loading filters`,{desc:`Accessible label while filter column names are loading`});return h`<div class="filters-loading" role="status">
|
|
467
469
|
<luzmo-progress-circle indeterminate .label=${e} .size=${this.size}></luzmo-progress-circle>
|
|
468
|
-
</div>`}_renderTextDisplay(){return
|
|
469
|
-
>${this._internalFilterGroup?this._renderTextGroup(this._internalFilterGroup,!0):
|
|
470
|
-
>`}_deleteOutlineFilter(e,t){this.readonly||this.display!==`outline`||this._removeFilter(e,t)}_renderOutlineRow(e,t){let r=this._renderTextLeaf(e);if(r===
|
|
470
|
+
</div>`}_renderTextDisplay(){return h`<span class="filters-text" part="filters-text"
|
|
471
|
+
>${this._internalFilterGroup?this._renderTextGroup(this._internalFilterGroup,!0):g}</span
|
|
472
|
+
>`}_deleteOutlineFilter(e,t){this.readonly||this.display!==`outline`||this._removeFilter(e,t)}_renderOutlineRow(e,t){let r=this._renderTextLeaf(e);if(r===g)return g;let i=n(`Remove filter`,{desc:`Aria label for remove filter button`});return h`<div class="outline-row" part="filters-outline-row">
|
|
471
473
|
<span class="outline-sentence">${r}</span>
|
|
472
|
-
${this.readonly?h
|
|
474
|
+
${this.readonly?g:h`<luzmo-action-button
|
|
473
475
|
class="delete-filter-button outline-delete"
|
|
474
476
|
.size=${this.size}
|
|
475
477
|
quiet
|
|
@@ -478,29 +480,29 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
478
480
|
>
|
|
479
481
|
<luzmo-icon slot="icon" .icon=${a} .size=${this.size}></luzmo-icon>
|
|
480
482
|
</luzmo-action-button>`}
|
|
481
|
-
</div>`}_renderOutlineGroup(e,t=!0){let n=e.filters.some(e=>this._isGroup(e)),r=e.filters.length>1&&!(t&&!n&&e.condition===`and`),i=
|
|
482
|
-
${r?
|
|
483
|
+
</div>`}_renderOutlineGroup(e,t=!0){let n=e.filters.some(e=>this._isGroup(e)),r=e.filters.length>1&&!(t&&!n&&e.condition===`and`),i=Yt[e.condition]?.()??e.condition;return h`<div class="outline-group" role=${r?`group`:g} aria-label=${r?i:g}>
|
|
484
|
+
${r?h`<div class="outline-condition">${i}</div>`:g}
|
|
483
485
|
<div class=${r?`outline-children`:`outline-children outline-children--single`}>
|
|
484
|
-
${
|
|
486
|
+
${re(e.filters,e=>this._filterKey(e),t=>this._isGroup(t)?this._renderOutlineGroup(t,!1):this._renderOutlineRow(t,e))}
|
|
485
487
|
</div>
|
|
486
|
-
</div>`}_renderOutlineDisplay(){return
|
|
487
|
-
${this._internalFilterGroup?this._renderOutlineGroup(this._internalFilterGroup):
|
|
488
|
-
</div>`}render(){if(this._hasUnsupportedConditions&&this.display!==`text`)return
|
|
488
|
+
</div>`}_renderOutlineDisplay(){return h`<div class="filters-outline" part="filters-outline">
|
|
489
|
+
${this._internalFilterGroup?this._renderOutlineGroup(this._internalFilterGroup):g}
|
|
490
|
+
</div>`}render(){if(this._hasUnsupportedConditions&&this.display!==`text`)return h`<div class="filter-group-container" role="status">
|
|
489
491
|
${n(`Filters containing OR cannot be edited in AND-only mode.`,{desc:`Explains why existing OR filters are not editable in the simplified filter editor`})}
|
|
490
|
-
</div>`;if(this.display===`text`||this.display===`outline`)return this._datasetsLoading&&this._datasets.length===0?this._renderDatasetLoading():this.display===`text`?this._renderTextDisplay():this._renderOutlineDisplay();if(this._isDatasetIdsEmpty)return
|
|
492
|
+
</div>`;if(this.display===`text`||this.display===`outline`)return this._datasetsLoading&&this._datasets.length===0?this._renderDatasetLoading():this.display===`text`?this._renderTextDisplay():this._renderOutlineDisplay();if(this._isDatasetIdsEmpty)return h`
|
|
491
493
|
<div class="filter-group-container">
|
|
492
494
|
<div class="dataset-ids-empty-message" role="status">
|
|
493
495
|
${n(`Cannot retrieve dataset data fields`,{desc:`Error message when datasetIds is empty`})}
|
|
494
496
|
</div>
|
|
495
497
|
</div>
|
|
496
|
-
`;if(!this._internalFilterGroup||this._internalFilterGroup.filters.length===0)return
|
|
498
|
+
`;if(!this._internalFilterGroup||this._internalFilterGroup.filters.length===0)return h`
|
|
497
499
|
<div class="filter-group-container">
|
|
498
500
|
<luzmo-button
|
|
499
501
|
class="add-filter-button"
|
|
500
502
|
.size=${this.size}
|
|
501
503
|
treatment="outline"
|
|
502
504
|
?quiet=${this.quiet}
|
|
503
|
-
aria-disabled=${this.readonly?`true`:
|
|
505
|
+
aria-disabled=${this.readonly?`true`:g}
|
|
504
506
|
?disabled=${this._isDatasetIdsEmpty}
|
|
505
507
|
@click=${()=>this._addFilter()}
|
|
506
508
|
>
|
|
@@ -508,18 +510,18 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
508
510
|
${n(`Add filter`,{desc:`Add filter button label`})}
|
|
509
511
|
</luzmo-button>
|
|
510
512
|
</div>
|
|
511
|
-
`;let e=this._internalFilterGroup.filters.length>1;return
|
|
513
|
+
`;let e=this._internalFilterGroup.filters.length>1;return h`
|
|
512
514
|
<div class="filter-group-container">
|
|
513
515
|
${this._renderGroup(this._internalFilterGroup)}
|
|
514
516
|
|
|
515
|
-
${e&&!this.simple?
|
|
517
|
+
${e&&!this.simple?h`
|
|
516
518
|
<div class="add-root-group-container">
|
|
517
519
|
<luzmo-button
|
|
518
520
|
class="add-group-button"
|
|
519
521
|
.size=${this.size}
|
|
520
522
|
treatment="outline"
|
|
521
523
|
?quiet=${this.quiet}
|
|
522
|
-
aria-disabled=${this.readonly?`true`:
|
|
524
|
+
aria-disabled=${this.readonly?`true`:g}
|
|
523
525
|
?disabled=${this._isDatasetIdsEmpty}
|
|
524
526
|
@click=${this._addGroup}
|
|
525
527
|
>
|
|
@@ -529,4 +531,4 @@ import{i as e,n as t,r as n,t as r}from"./localized-mixin-BWJj88bd.js";import{t
|
|
|
529
531
|
</div>
|
|
530
532
|
`:``}
|
|
531
533
|
</div>
|
|
532
|
-
`}};t([
|
|
534
|
+
`}};t([_({type:String,attribute:`api-url`,reflect:!0})],$.prototype,`apiUrl`,void 0),t([_({type:String,attribute:`auth-key`,reflect:!0})],$.prototype,`authKey`,void 0),t([_({type:String,attribute:`auth-token`,reflect:!0})],$.prototype,`authToken`,void 0),t([_({type:Number,attribute:`cache-time`,reflect:!0})],$.prototype,`cacheTime`,void 0),t([_({type:String,attribute:`content-language`,reflect:!0})],$.prototype,`contentLanguage`,void 0),t([_({type:String,attribute:`time-zone`,reflect:!0})],$.prototype,`timeZone`,void 0),t([_({type:Array,attribute:`dataset-ids`,reflect:!0})],$.prototype,`datasetIds`,void 0),t([_({type:Array,reflect:!1})],$.prototype,`filters`,void 0),t([_({type:String,reflect:!0})],$.prototype,`format`,void 0),t([_({type:Boolean,reflect:!0})],$.prototype,`simple`,void 0),t([_({type:String,reflect:!0})],$.prototype,`display`,void 0),t([_({type:String,attribute:`column-display`,reflect:!0})],$.prototype,`columnDisplay`,void 0),t([_({type:Boolean,reflect:!0})],$.prototype,`quiet`,void 0),t([_({type:Boolean,reflect:!0})],$.prototype,`readonly`,void 0),t([_({type:Boolean,attribute:`allow-parameters`,reflect:!0})],$.prototype,`allowParameters`,void 0),t([_({attribute:!1})],$.prototype,`parameters`,void 0),t([_({type:Number,reflect:!0})],$.prototype,`debounce`,void 0),t([v()],$.prototype,`_internalFilterGroup`,void 0),t([v()],$.prototype,`_datasets`,void 0),t([v()],$.prototype,`_datasetsLoading`,void 0),t([v()],$.prototype,`_hierarchyLabels`,void 0),t([v()],$.prototype,`_hierarchyLabelsLoading`,void 0),$=t([i()],$),customElements.get(`luzmo-filters`)||customElements.define(`luzmo-filters`,$);export{N as FilterUnrepresentableError,$ as LuzmoFilters,Ie as MAX_FILTER_NESTING_DEPTH,Ke as detectFiltersFormat,jt as reverseTransformFilters,yt as toLogicalCondition,Tt as transformFilters};
|