drizzle-cube 0.4.53 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/express/index.cjs +2 -2
- package/dist/adapters/express/index.js +109 -96
- package/dist/adapters/fastify/index.cjs +2 -2
- package/dist/adapters/fastify/index.js +148 -134
- package/dist/adapters/{handler-RItnSaEl.js → handler-3LGcjLtr.js} +617 -612
- package/dist/adapters/handler-BzzbVpcl.cjs +25 -0
- package/dist/adapters/hono/index.cjs +1 -1
- package/dist/adapters/hono/index.js +103 -99
- package/dist/adapters/{compiler-S6KHiOY6.js → locale-DTnJrxm1.js} +1700 -1563
- package/dist/adapters/locale-DueXjqMh.cjs +198 -0
- package/dist/adapters/locale.d.ts +8 -0
- package/dist/adapters/mcp-tools.cjs +1 -1
- package/dist/adapters/mcp-tools.d.ts +7 -3
- package/dist/adapters/mcp-tools.js +27 -27
- package/dist/adapters/mcp-transport-C7VLf4T5.js +579 -0
- package/dist/adapters/mcp-transport-poPHl_2j.cjs +39 -0
- package/dist/adapters/mcp-transport.d.ts +25 -2
- package/dist/adapters/nextjs/index.cjs +1 -1
- package/dist/adapters/nextjs/index.js +152 -132
- package/dist/adapters/utils-DNrj-ryp.cjs +17 -0
- package/dist/adapters/{utils-IH1ePsBd.js → utils-DOg9oGdt.js} +2341 -819
- package/dist/adapters/utils.cjs +1 -1
- package/dist/adapters/utils.d.ts +45 -2
- package/dist/adapters/utils.js +1 -1
- package/dist/client/charts.js +12 -12
- package/dist/client/chunks/{DashboardEditModal-BTdV528l.js → DashboardEditModal-cSSIAZGy.js} +1968 -1973
- package/dist/client/chunks/DashboardEditModal-cSSIAZGy.js.map +1 -0
- package/dist/client/chunks/{FieldSearchModal-D75vy4Wb.js → FieldSearchModal-CZNo4pNK.js} +550 -536
- package/dist/client/chunks/FieldSearchModal-CZNo4pNK.js.map +1 -0
- package/dist/client/chunks/KpiDelta-Dll_eCV1.js +2 -0
- package/dist/client/chunks/KpiNumber-BPlR92hI.js +2 -0
- package/dist/client/chunks/KpiText-BIxq7Jso.js +2 -0
- package/dist/client/chunks/{RetentionCombinedChart-DIhK5pD8.js → RetentionCombinedChart-BD8tGeM_.js} +96 -96
- package/dist/client/chunks/RetentionCombinedChart-BD8tGeM_.js.map +1 -0
- package/dist/client/chunks/{RetentionHeatmap-CyREolyP.js → RetentionHeatmap-B_5sewwi.js} +77 -77
- package/dist/client/chunks/RetentionHeatmap-B_5sewwi.js.map +1 -0
- package/dist/client/chunks/SchemaVisualization-CCICjhvv.js +2 -0
- package/dist/client/chunks/SchemaVisualizationLazy-DraGsMx6.js +2 -0
- package/dist/client/chunks/af-ZA-xDmO5F0s.js +1431 -0
- package/dist/client/chunks/af-ZA-xDmO5F0s.js.map +1 -0
- package/dist/client/chunks/{analysis-builder-C1CJ0c7L.js → analysis-builder-BeVZhiQ5.js} +1519 -1507
- package/dist/client/chunks/analysis-builder-BeVZhiQ5.js.map +1 -0
- package/dist/client/chunks/{analysis-builder-shared-rkjJfWLT.js → analysis-builder-shared-BWc7ZZnG.js} +925 -954
- package/dist/client/chunks/analysis-builder-shared-BWc7ZZnG.js.map +1 -0
- package/dist/client/chunks/chart-activity-grid-CWT0gLv4.js +2376 -0
- package/dist/client/chunks/chart-activity-grid-CWT0gLv4.js.map +1 -0
- package/dist/client/chunks/{chart-area-BwYaflNk.js → chart-area-D63kG8OT.js} +157 -157
- package/dist/client/chunks/chart-area-D63kG8OT.js.map +1 -0
- package/dist/client/chunks/{chart-bar-BiENfFgE.js → chart-bar-BEfsCLjl.js} +78 -78
- package/dist/client/chunks/chart-bar-BEfsCLjl.js.map +1 -0
- package/dist/client/chunks/{chart-box-plot-BJF1tBXC.js → chart-box-plot-o-h9MRX5.js} +111 -114
- package/dist/client/chunks/chart-box-plot-o-h9MRX5.js.map +1 -0
- package/dist/client/chunks/{chart-bubble-DQQhGVDJ.js → chart-bubble-CMDp4Pfm.js} +121 -121
- package/dist/client/chunks/chart-bubble-CMDp4Pfm.js.map +1 -0
- package/dist/client/chunks/chart-candlestick-WyANJ0Ky.js +303 -0
- package/dist/client/chunks/chart-candlestick-WyANJ0Ky.js.map +1 -0
- package/dist/client/chunks/chart-config-activity-grid-C-EkgYoa.js +51 -0
- package/dist/client/chunks/chart-config-activity-grid-C-EkgYoa.js.map +1 -0
- package/dist/client/chunks/chart-config-area-CMZpbIah.js +93 -0
- package/dist/client/chunks/chart-config-area-CMZpbIah.js.map +1 -0
- package/dist/client/chunks/chart-config-bar-B8_V4YLg.js +87 -0
- package/dist/client/chunks/chart-config-bar-B8_V4YLg.js.map +1 -0
- package/dist/client/chunks/chart-config-box-plot-Dwj7sEbU.js +35 -0
- package/dist/client/chunks/chart-config-box-plot-Dwj7sEbU.js.map +1 -0
- package/dist/client/chunks/chart-config-bubble-B0w0ZVp4.js +82 -0
- package/dist/client/chunks/chart-config-bubble-B0w0ZVp4.js.map +1 -0
- package/dist/client/chunks/chart-config-candlestick-Bvo3zeIn.js +72 -0
- package/dist/client/chunks/chart-config-candlestick-Bvo3zeIn.js.map +1 -0
- package/dist/client/chunks/{chart-config-data-table-Bhdx5Hem.js → chart-config-data-table-BQXSn4b_.js} +9 -9
- package/dist/client/chunks/chart-config-data-table-BQXSn4b_.js.map +1 -0
- package/dist/client/chunks/chart-config-funnel-BzEsHmjR.js +93 -0
- package/dist/client/chunks/chart-config-funnel-BzEsHmjR.js.map +1 -0
- package/dist/client/chunks/chart-config-gauge-C5ZiyZy7.js +64 -0
- package/dist/client/chunks/chart-config-gauge-C5ZiyZy7.js.map +1 -0
- package/dist/client/chunks/chart-config-heat-map-Cv8qNnVP.js +91 -0
- package/dist/client/chunks/chart-config-heat-map-Cv8qNnVP.js.map +1 -0
- package/dist/client/chunks/chart-config-kpi-delta-BraHQc2E.js +94 -0
- package/dist/client/chunks/chart-config-kpi-delta-BraHQc2E.js.map +1 -0
- package/dist/client/chunks/chart-config-kpi-number-CeCkx7mC.js +75 -0
- package/dist/client/chunks/chart-config-kpi-number-CeCkx7mC.js.map +1 -0
- package/dist/client/chunks/chart-config-kpi-text-CImM3SvH.js +47 -0
- package/dist/client/chunks/chart-config-kpi-text-CImM3SvH.js.map +1 -0
- package/dist/client/chunks/chart-config-line-BVKapAQK.js +104 -0
- package/dist/client/chunks/chart-config-line-BVKapAQK.js.map +1 -0
- package/dist/client/chunks/chart-config-markdown-C-_g_8te.js +117 -0
- package/dist/client/chunks/chart-config-markdown-C-_g_8te.js.map +1 -0
- package/dist/client/chunks/chart-config-measure-profile-KTVV1gO3.js +82 -0
- package/dist/client/chunks/chart-config-measure-profile-KTVV1gO3.js.map +1 -0
- package/dist/client/chunks/chart-config-pie-BZxVl25X.js +68 -0
- package/dist/client/chunks/chart-config-pie-BZxVl25X.js.map +1 -0
- package/dist/client/chunks/chart-config-radar-B7FByX3t.js +49 -0
- package/dist/client/chunks/chart-config-radar-B7FByX3t.js.map +1 -0
- package/dist/client/chunks/chart-config-radial-bar-UfW_3yyX.js +38 -0
- package/dist/client/chunks/chart-config-radial-bar-UfW_3yyX.js.map +1 -0
- package/dist/client/chunks/chart-config-sankey-DGAThN9i.js +66 -0
- package/dist/client/chunks/chart-config-sankey-DGAThN9i.js.map +1 -0
- package/dist/client/chunks/chart-config-scatter-BVVJuOnt.js +61 -0
- package/dist/client/chunks/chart-config-scatter-BVVJuOnt.js.map +1 -0
- package/dist/client/chunks/chart-config-sunburst-utejM2YS.js +45 -0
- package/dist/client/chunks/chart-config-sunburst-utejM2YS.js.map +1 -0
- package/dist/client/chunks/chart-config-tree-map-IHp97OyV.js +51 -0
- package/dist/client/chunks/chart-config-tree-map-IHp97OyV.js.map +1 -0
- package/dist/client/chunks/chart-config-waterfall-BdqG1V-x.js +59 -0
- package/dist/client/chunks/chart-config-waterfall-BdqG1V-x.js.map +1 -0
- package/dist/client/chunks/{chart-data-table-2iCsn0CF.js → chart-data-table-C3Xh9jwL.js} +1083 -1086
- package/dist/client/chunks/chart-data-table-C3Xh9jwL.js.map +1 -0
- package/dist/client/chunks/{chart-funnel-poyOf7-e.js → chart-funnel-C7pgktN5.js} +132 -132
- package/dist/client/chunks/chart-funnel-C7pgktN5.js.map +1 -0
- package/dist/client/chunks/{chart-gauge-D5J4gRky.js → chart-gauge-D2r2B_AR.js} +150 -150
- package/dist/client/chunks/chart-gauge-D2r2B_AR.js.map +1 -0
- package/dist/client/chunks/{chart-heat-map-BAMVhLGG.js → chart-heat-map-Dw2yjwfO.js} +75 -80
- package/dist/client/chunks/chart-heat-map-Dw2yjwfO.js.map +1 -0
- package/dist/client/chunks/{chart-kpi-delta-KQjUIeal.js → chart-kpi-delta-CYE0S1x_.js} +117 -117
- package/dist/client/chunks/chart-kpi-delta-CYE0S1x_.js.map +1 -0
- package/dist/client/chunks/chart-kpi-number-BlZ79xHW.js +321 -0
- package/dist/client/chunks/chart-kpi-number-BlZ79xHW.js.map +1 -0
- package/dist/client/chunks/chart-kpi-text-DY1BnxPe.js +148 -0
- package/dist/client/chunks/chart-kpi-text-DY1BnxPe.js.map +1 -0
- package/dist/client/chunks/{chart-line-B5_WntY5.js → chart-line-CBsTThTv.js} +123 -123
- package/dist/client/chunks/chart-line-CBsTThTv.js.map +1 -0
- package/dist/client/chunks/chart-markdown-BWaWVkuz.js +3474 -0
- package/dist/client/chunks/chart-markdown-BWaWVkuz.js.map +1 -0
- package/dist/client/chunks/chart-measure-profile-B41qCTBG.js +179 -0
- package/dist/client/chunks/chart-measure-profile-B41qCTBG.js.map +1 -0
- package/dist/client/chunks/chart-pie-Djbu8x2v.js +172 -0
- package/dist/client/chunks/chart-pie-Djbu8x2v.js.map +1 -0
- package/dist/client/chunks/chart-radar-BsTcKV0K.js +154 -0
- package/dist/client/chunks/chart-radar-BsTcKV0K.js.map +1 -0
- package/dist/client/chunks/chart-radial-bar-Du7XNnwE.js +148 -0
- package/dist/client/chunks/chart-radial-bar-Du7XNnwE.js.map +1 -0
- package/dist/client/chunks/{chart-sankey-BOyxfG1Q.js → chart-sankey-WwkZAhLy.js} +73 -73
- package/dist/client/chunks/chart-sankey-WwkZAhLy.js.map +1 -0
- package/dist/client/chunks/chart-scatter-D8krEYsA.js +255 -0
- package/dist/client/chunks/chart-scatter-D8krEYsA.js.map +1 -0
- package/dist/client/chunks/{chart-sunburst-D9lGEOCc.js → chart-sunburst-CIDB_pTl.js} +66 -66
- package/dist/client/chunks/chart-sunburst-CIDB_pTl.js.map +1 -0
- package/dist/client/chunks/chart-tree-map-C5C2iaWM.js +298 -0
- package/dist/client/chunks/chart-tree-map-C5C2iaWM.js.map +1 -0
- package/dist/client/chunks/{chart-waterfall-BCdUx4DC.js → chart-waterfall-BGdPrJ5Y.js} +80 -80
- package/dist/client/chunks/chart-waterfall-BGdPrJ5Y.js.map +1 -0
- package/dist/client/chunks/{charts-core-C5Yokk-x.js → charts-core-BXOqaYFn.js} +92 -92
- package/dist/client/chunks/charts-core-BXOqaYFn.js.map +1 -0
- package/dist/client/chunks/en-US-5xPTdCXg.js +35 -0
- package/dist/client/chunks/en-US-5xPTdCXg.js.map +1 -0
- package/dist/client/chunks/nl-NL-vCifBijs.js +1491 -0
- package/dist/client/chunks/nl-NL-vCifBijs.js.map +1 -0
- package/dist/client/chunks/{schema-visualization-t1KiOORo.js → schema-visualization-Xp60Ff2W.js} +352 -364
- package/dist/client/chunks/schema-visualization-Xp60Ff2W.js.map +1 -0
- package/dist/client/chunks/{useDebounce-CKqkM42n.js → useDebounce-CfmUMFau.js} +85 -85
- package/dist/client/chunks/useDebounce-CfmUMFau.js.map +1 -0
- package/dist/client/chunks/{useExplainAI-DBIfYwz-.js → useExplainAI-BKGmejIj.js} +4 -4
- package/dist/client/chunks/{useExplainAI-DBIfYwz-.js.map → useExplainAI-BKGmejIj.js.map} +1 -1
- package/dist/client/chunks/{utils--qCr8Yn5.js → utils-BldkcRHv.js} +2 -2
- package/dist/client/chunks/{utils--qCr8Yn5.js.map → utils-BldkcRHv.js.map} +1 -1
- package/dist/client/chunks/{vendor-BRlsCGnK.js → vendor-ClXpIiea.js} +2 -2
- package/dist/client/chunks/{vendor-BRlsCGnK.js.map → vendor-ClXpIiea.js.map} +1 -1
- package/dist/client/components/AnalysisBuilder/types.d.ts +6 -6
- package/dist/client/components.js +3 -3
- package/dist/client/hooks/useTranslation.d.ts +21 -0
- package/dist/client/hooks.js +3 -3
- package/dist/client/icons.js +1 -1
- package/dist/client/index.js +493 -488
- package/dist/client/index.js.map +1 -1
- package/dist/client/providers/CubeApiProvider.d.ts +2 -1
- package/dist/client/providers/CubeProvider.d.ts +7 -1
- package/dist/client/providers/I18nProvider.d.ts +18 -0
- package/dist/client/providers.js +1 -1
- package/dist/client/schema.js +1 -1
- package/dist/client/shared/types.d.ts +5 -20
- package/dist/client/styles.css +1 -1
- package/dist/client/utils.js +5 -5
- package/dist/client-bundle-stats.html +1 -1
- package/dist/mcp-app/mcp-app.html +40 -36
- package/dist/server/index.cjs +42 -40
- package/dist/server/index.js +3311 -1672
- package/package.json +5 -2
- package/dist/adapters/compiler-CRgLzmSn.cjs +0 -198
- package/dist/adapters/handler-DumFgnNM.cjs +0 -25
- package/dist/adapters/mcp-transport-C6bsIOSV.js +0 -545
- package/dist/adapters/mcp-transport-DMhuYmFp.cjs +0 -39
- package/dist/adapters/utils-CyBt-as9.cjs +0 -15
- package/dist/client/chunks/DashboardEditModal-BTdV528l.js.map +0 -1
- package/dist/client/chunks/FieldSearchModal-D75vy4Wb.js.map +0 -1
- package/dist/client/chunks/KpiDelta-Bk8bzKYM.js +0 -2
- package/dist/client/chunks/KpiNumber-CKF-8e_T.js +0 -2
- package/dist/client/chunks/KpiText-Iz1vIvu_.js +0 -2
- package/dist/client/chunks/RetentionCombinedChart-DIhK5pD8.js.map +0 -1
- package/dist/client/chunks/RetentionHeatmap-CyREolyP.js.map +0 -1
- package/dist/client/chunks/SchemaVisualization-B1GUT-FM.js +0 -2
- package/dist/client/chunks/SchemaVisualizationLazy-DymwT34e.js +0 -2
- package/dist/client/chunks/analysis-builder-C1CJ0c7L.js.map +0 -1
- package/dist/client/chunks/analysis-builder-shared-rkjJfWLT.js.map +0 -1
- package/dist/client/chunks/chart-activity-grid-DLktOINm.js +0 -806
- package/dist/client/chunks/chart-activity-grid-DLktOINm.js.map +0 -1
- package/dist/client/chunks/chart-area-BwYaflNk.js.map +0 -1
- package/dist/client/chunks/chart-bar-BiENfFgE.js.map +0 -1
- package/dist/client/chunks/chart-box-plot-BJF1tBXC.js.map +0 -1
- package/dist/client/chunks/chart-bubble-DQQhGVDJ.js.map +0 -1
- package/dist/client/chunks/chart-candlestick-C2UuXbLe.js +0 -306
- package/dist/client/chunks/chart-candlestick-C2UuXbLe.js.map +0 -1
- package/dist/client/chunks/chart-config-activity-grid-DJOU3TEz.js +0 -51
- package/dist/client/chunks/chart-config-activity-grid-DJOU3TEz.js.map +0 -1
- package/dist/client/chunks/chart-config-area-CWnWVT6a.js +0 -93
- package/dist/client/chunks/chart-config-area-CWnWVT6a.js.map +0 -1
- package/dist/client/chunks/chart-config-bar-C-7Dr1Ho.js +0 -87
- package/dist/client/chunks/chart-config-bar-C-7Dr1Ho.js.map +0 -1
- package/dist/client/chunks/chart-config-box-plot-mVOwmLdu.js +0 -35
- package/dist/client/chunks/chart-config-box-plot-mVOwmLdu.js.map +0 -1
- package/dist/client/chunks/chart-config-bubble-BPE2CeiD.js +0 -82
- package/dist/client/chunks/chart-config-bubble-BPE2CeiD.js.map +0 -1
- package/dist/client/chunks/chart-config-candlestick-BSB9DRy2.js +0 -72
- package/dist/client/chunks/chart-config-candlestick-BSB9DRy2.js.map +0 -1
- package/dist/client/chunks/chart-config-data-table-Bhdx5Hem.js.map +0 -1
- package/dist/client/chunks/chart-config-funnel-Cl-v-bm1.js +0 -93
- package/dist/client/chunks/chart-config-funnel-Cl-v-bm1.js.map +0 -1
- package/dist/client/chunks/chart-config-gauge-CdrUTJMJ.js +0 -64
- package/dist/client/chunks/chart-config-gauge-CdrUTJMJ.js.map +0 -1
- package/dist/client/chunks/chart-config-heat-map-DGE3NzoF.js +0 -91
- package/dist/client/chunks/chart-config-heat-map-DGE3NzoF.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-delta-DMrQerUW.js +0 -94
- package/dist/client/chunks/chart-config-kpi-delta-DMrQerUW.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-number-DCytCytn.js +0 -75
- package/dist/client/chunks/chart-config-kpi-number-DCytCytn.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-text-KdKQUvHo.js +0 -47
- package/dist/client/chunks/chart-config-kpi-text-KdKQUvHo.js.map +0 -1
- package/dist/client/chunks/chart-config-line-Bl9VDAdz.js +0 -104
- package/dist/client/chunks/chart-config-line-Bl9VDAdz.js.map +0 -1
- package/dist/client/chunks/chart-config-markdown-BX26b94i.js +0 -117
- package/dist/client/chunks/chart-config-markdown-BX26b94i.js.map +0 -1
- package/dist/client/chunks/chart-config-measure-profile-DwtRhEFh.js +0 -82
- package/dist/client/chunks/chart-config-measure-profile-DwtRhEFh.js.map +0 -1
- package/dist/client/chunks/chart-config-pie-BzBcqPMJ.js +0 -68
- package/dist/client/chunks/chart-config-pie-BzBcqPMJ.js.map +0 -1
- package/dist/client/chunks/chart-config-radar-6ZOgt__z.js +0 -49
- package/dist/client/chunks/chart-config-radar-6ZOgt__z.js.map +0 -1
- package/dist/client/chunks/chart-config-radial-bar-Df6Eta7N.js +0 -38
- package/dist/client/chunks/chart-config-radial-bar-Df6Eta7N.js.map +0 -1
- package/dist/client/chunks/chart-config-sankey-DgqKBFvN.js +0 -66
- package/dist/client/chunks/chart-config-sankey-DgqKBFvN.js.map +0 -1
- package/dist/client/chunks/chart-config-scatter-D5nVLDvi.js +0 -61
- package/dist/client/chunks/chart-config-scatter-D5nVLDvi.js.map +0 -1
- package/dist/client/chunks/chart-config-sunburst-Ca3FX9nW.js +0 -45
- package/dist/client/chunks/chart-config-sunburst-Ca3FX9nW.js.map +0 -1
- package/dist/client/chunks/chart-config-tree-map-Bjy4QNa3.js +0 -51
- package/dist/client/chunks/chart-config-tree-map-Bjy4QNa3.js.map +0 -1
- package/dist/client/chunks/chart-config-waterfall-C5K2eqR7.js +0 -59
- package/dist/client/chunks/chart-config-waterfall-C5K2eqR7.js.map +0 -1
- package/dist/client/chunks/chart-data-table-2iCsn0CF.js.map +0 -1
- package/dist/client/chunks/chart-funnel-poyOf7-e.js.map +0 -1
- package/dist/client/chunks/chart-gauge-D5J4gRky.js.map +0 -1
- package/dist/client/chunks/chart-heat-map-BAMVhLGG.js.map +0 -1
- package/dist/client/chunks/chart-kpi-delta-KQjUIeal.js.map +0 -1
- package/dist/client/chunks/chart-kpi-number-CsQgV_x3.js +0 -325
- package/dist/client/chunks/chart-kpi-number-CsQgV_x3.js.map +0 -1
- package/dist/client/chunks/chart-kpi-text-BR0IyeUU.js +0 -148
- package/dist/client/chunks/chart-kpi-text-BR0IyeUU.js.map +0 -1
- package/dist/client/chunks/chart-line-B5_WntY5.js.map +0 -1
- package/dist/client/chunks/chart-markdown-B6bENbel.js +0 -3473
- package/dist/client/chunks/chart-markdown-B6bENbel.js.map +0 -1
- package/dist/client/chunks/chart-measure-profile-yWk-obNb.js +0 -179
- package/dist/client/chunks/chart-measure-profile-yWk-obNb.js.map +0 -1
- package/dist/client/chunks/chart-pie-BodrUoHv.js +0 -172
- package/dist/client/chunks/chart-pie-BodrUoHv.js.map +0 -1
- package/dist/client/chunks/chart-radar-gG3zfLud.js +0 -154
- package/dist/client/chunks/chart-radar-gG3zfLud.js.map +0 -1
- package/dist/client/chunks/chart-radial-bar-C2IPCV8c.js +0 -148
- package/dist/client/chunks/chart-radial-bar-C2IPCV8c.js.map +0 -1
- package/dist/client/chunks/chart-sankey-BOyxfG1Q.js.map +0 -1
- package/dist/client/chunks/chart-scatter-B8OwlsAX.js +0 -255
- package/dist/client/chunks/chart-scatter-B8OwlsAX.js.map +0 -1
- package/dist/client/chunks/chart-sunburst-D9lGEOCc.js.map +0 -1
- package/dist/client/chunks/chart-tree-map-DZaKy9he.js +0 -298
- package/dist/client/chunks/chart-tree-map-DZaKy9he.js.map +0 -1
- package/dist/client/chunks/chart-waterfall-BCdUx4DC.js.map +0 -1
- package/dist/client/chunks/charts-core-C5Yokk-x.js.map +0 -1
- package/dist/client/chunks/schema-visualization-t1KiOORo.js.map +0 -1
- package/dist/client/chunks/useDebounce-CKqkM42n.js.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./vendor-
|
|
2
|
-
import { A as s, V as c, u as l } from "./chart-data-table-
|
|
3
|
-
import { C as u, D as d, E as f, O as p, T as m, a as h, b as g, l as _, n as v, r as y, s as b, t as x } from "./useDebounce-
|
|
4
|
-
import { a as S, i as
|
|
5
|
-
import { r as
|
|
6
|
-
import {
|
|
7
|
-
import { a as
|
|
8
|
-
import { L as
|
|
9
|
-
import { n as ce } from "./charts-core-
|
|
10
|
-
import
|
|
11
|
-
import { Fragment as
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./vendor-ClXpIiea.js";
|
|
2
|
+
import { A as s, V as c, u as l } from "./chart-data-table-C3Xh9jwL.js";
|
|
3
|
+
import { C as u, D as d, E as f, O as p, T as m, a as h, b as g, l as _, n as v, r as y, s as b, t as x } from "./useDebounce-CfmUMFau.js";
|
|
4
|
+
import { a as S, i as C } from "./useExplainAI-BKGmejIj.js";
|
|
5
|
+
import { r as ee, s as w } from "./chart-funnel-C7pgktN5.js";
|
|
6
|
+
import { F as te, k as T } from "./chart-activity-grid-CWT0gLv4.js";
|
|
7
|
+
import { a as E, s as ne, t as D } from "./retention-YhT1Oohi.js";
|
|
8
|
+
import { L as O, R as k, a as A, c as j, d as M, f as N, g as re, h as ie, l as ae, o as oe, s as P, t as se, x as F } from "./FieldSearchModal-CZNo4pNK.js";
|
|
9
|
+
import { n as ce } from "./charts-core-BXOqaYFn.js";
|
|
10
|
+
import I, { createContext as le, memo as L, useCallback as R, useContext as ue, useEffect as z, useMemo as B, useRef as V, useState as H } from "react";
|
|
11
|
+
import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
|
|
12
12
|
//#region src/shared/date-utils.ts
|
|
13
13
|
function de(e) {
|
|
14
14
|
let t = /* @__PURE__ */ new Date(), n = e.toLowerCase().trim(), r = t.getUTCFullYear(), i = t.getUTCMonth(), a = t.getUTCDate(), o = t.getUTCDay();
|
|
@@ -134,10 +134,10 @@ function fe(e) {
|
|
|
134
134
|
}
|
|
135
135
|
return de(e);
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function pe(e) {
|
|
138
138
|
return e.toISOString().split("T")[0];
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function me(e, t) {
|
|
141
141
|
let n = t.getTime() - e.getTime(), r = Math.ceil(n / (1e3 * 60 * 60 * 24)), i = new Date(e);
|
|
142
142
|
i.setUTCDate(i.getUTCDate() - 1), i.setUTCHours(23, 59, 59, 999);
|
|
143
143
|
let a = new Date(i);
|
|
@@ -148,27 +148,27 @@ function pe(e, t) {
|
|
|
148
148
|
}
|
|
149
149
|
//#endregion
|
|
150
150
|
//#region src/client/components/AnalysisBuilder/utils/filterUtils.ts
|
|
151
|
-
function
|
|
151
|
+
function he(e, t) {
|
|
152
152
|
for (let n of e) if ("type" in n && "filters" in n) {
|
|
153
|
-
let e =
|
|
153
|
+
let e = he(n.filters, t);
|
|
154
154
|
if (e) return e;
|
|
155
155
|
} else if ("member" in n) {
|
|
156
156
|
let e = n;
|
|
157
157
|
if (e.member === t && e.operator === "inDateRange" && e.dateRange) return { dateRange: e.dateRange };
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
function
|
|
161
|
-
let n =
|
|
160
|
+
function ge(e, t) {
|
|
161
|
+
let n = he(t, e);
|
|
162
162
|
if (!n?.dateRange) return;
|
|
163
163
|
let r = fe(n.dateRange);
|
|
164
164
|
if (!r) return;
|
|
165
|
-
let i =
|
|
166
|
-
return [[
|
|
165
|
+
let i = me(r.start, r.end);
|
|
166
|
+
return [[pe(r.start), pe(r.end)], [pe(i.start), pe(i.end)]];
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function _e(e, t) {
|
|
169
169
|
return e.reduce((e, n) => {
|
|
170
170
|
if ("type" in n && "filters" in n) {
|
|
171
|
-
let r = n, i =
|
|
171
|
+
let r = n, i = _e(r.filters, t);
|
|
172
172
|
i.length > 0 && e.push({
|
|
173
173
|
type: r.type,
|
|
174
174
|
filters: i
|
|
@@ -182,10 +182,10 @@ function ge(e, t) {
|
|
|
182
182
|
}
|
|
183
183
|
//#endregion
|
|
184
184
|
//#region src/client/components/AnalysisBuilder/utils/queryUtils.ts
|
|
185
|
-
function
|
|
185
|
+
function ve(e, t, n, r, i = !1, a) {
|
|
186
186
|
let o = t.filter((e) => e.isTimeDimension && e.enableComparison).map((e) => e.field), s = n;
|
|
187
|
-
if (!i) for (let e of o) s =
|
|
188
|
-
s = s.filter((e) =>
|
|
187
|
+
if (!i) for (let e of o) s = _e(s, e);
|
|
188
|
+
s = s.filter((e) => F(e));
|
|
189
189
|
let c = {
|
|
190
190
|
measures: e.map((e) => e.field),
|
|
191
191
|
dimensions: t.filter((e) => !e.isTimeDimension).map((e) => e.field),
|
|
@@ -195,7 +195,7 @@ function _e(e, t, n, r, i = !1, a) {
|
|
|
195
195
|
granularity: e.granularity || "day"
|
|
196
196
|
};
|
|
197
197
|
if (e.enableComparison) {
|
|
198
|
-
let r =
|
|
198
|
+
let r = ge(e.field, n);
|
|
199
199
|
r && (t.compareDateRange = r);
|
|
200
200
|
}
|
|
201
201
|
return t;
|
|
@@ -219,335 +219,335 @@ function K() {
|
|
|
219
219
|
}
|
|
220
220
|
//#endregion
|
|
221
221
|
//#region src/client/components/AnalysisBuilder/FilterConfigModal.tsx
|
|
222
|
-
var
|
|
223
|
-
function
|
|
224
|
-
let
|
|
222
|
+
var q = s("close"), J = s("chevronDown"), Y = s("dimension"), ye = s("timeDimension"), be = s("measure");
|
|
223
|
+
function xe({ filter: e, schema: t, onSave: n, onCancel: r, anchorElement: i }) {
|
|
224
|
+
let { t: a } = T(), [o, s] = H(e), [c, l] = H(!1), [h, g] = H(!1), [_, y] = H(!1), [b, S] = H("this_month"), [C, ee] = H(1), [w, te] = H(""), [E, ne] = H(null), [D, O] = H(-1), k = V(null), A = V(null), M = x(w, 300), N = j(o.member, t), re = N?.field.type || "string", ie = re === "time", oe = N?.fieldType === "measure", P = N?.fieldType === "dimension", se = ae(o.member, t), F = p[o.operator], ce = m(re), I = ie && o.operator === "inDateRange", le = R(() => [
|
|
225
225
|
"equals",
|
|
226
226
|
"notEquals",
|
|
227
227
|
"in",
|
|
228
228
|
"notIn"
|
|
229
|
-
].includes(
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
])(), { values:
|
|
234
|
-
|
|
229
|
+
].includes(o.operator) && P && !ie, [
|
|
230
|
+
o.operator,
|
|
231
|
+
P,
|
|
232
|
+
ie
|
|
233
|
+
])(), { values: L, loading: ue, error: B, searchValues: de } = v(o.member, le);
|
|
234
|
+
z(() => {
|
|
235
235
|
if (!i) {
|
|
236
|
-
|
|
236
|
+
ne(null);
|
|
237
237
|
return;
|
|
238
238
|
}
|
|
239
239
|
let e = i.getBoundingClientRect(), t = e.top, n = window.innerHeight - e.bottom, r = t > 500 || t > n, a = Math.max(16, Math.min(e.left, window.innerWidth - 400 - 16));
|
|
240
|
-
|
|
240
|
+
ne(r ? {
|
|
241
241
|
bottom: window.innerHeight - e.top + 8,
|
|
242
242
|
left: a
|
|
243
243
|
} : {
|
|
244
244
|
top: e.bottom + 8,
|
|
245
245
|
left: a
|
|
246
246
|
});
|
|
247
|
-
}, [i]),
|
|
247
|
+
}, [i]), z(() => {
|
|
248
248
|
let e = (e) => {
|
|
249
|
-
|
|
249
|
+
k.current && !k.current.contains(e.target) && (l(!1), g(!1), y(!1));
|
|
250
250
|
};
|
|
251
251
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
252
|
-
}, []),
|
|
253
|
-
|
|
252
|
+
}, []), z(() => {
|
|
253
|
+
h && le && de && de("", !0), h || O(-1);
|
|
254
254
|
}, [
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
]),
|
|
259
|
-
if (
|
|
260
|
-
let e =
|
|
255
|
+
h,
|
|
256
|
+
le,
|
|
257
|
+
de
|
|
258
|
+
]), z(() => {
|
|
259
|
+
if (D >= 0 && A.current) {
|
|
260
|
+
let e = A.current.children[D];
|
|
261
261
|
e && e.scrollIntoView({ block: "nearest" });
|
|
262
262
|
}
|
|
263
|
-
}, [
|
|
264
|
-
|
|
263
|
+
}, [D]), z(() => {
|
|
264
|
+
h && le && de && M !== void 0 && de(M);
|
|
265
265
|
}, [
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
]),
|
|
271
|
-
if (!(!
|
|
266
|
+
M,
|
|
267
|
+
h,
|
|
268
|
+
le,
|
|
269
|
+
de
|
|
270
|
+
]), z(() => {
|
|
271
|
+
if (!(!I || !o.dateRange)) if (Array.isArray(o.dateRange)) S("custom");
|
|
272
272
|
else {
|
|
273
|
-
let e =
|
|
273
|
+
let e = o.dateRange.match(/^last (\d+) (days|weeks|months|quarters|years)$/), t = !e && o.dateRange.match(/^last (day|week|month|quarter|year)$/);
|
|
274
274
|
if (e) {
|
|
275
275
|
let [, t, n] = e;
|
|
276
|
-
|
|
276
|
+
S(`last_n_${n}`), ee(parseInt(t) || 1);
|
|
277
277
|
} else if (t) {
|
|
278
278
|
let [, e] = t;
|
|
279
|
-
|
|
279
|
+
S(`last_n_${e === "day" ? "days" : e === "week" ? "weeks" : e === "month" ? "months" : e === "quarter" ? "quarters" : "years"}`), ee(1);
|
|
280
280
|
} else {
|
|
281
281
|
let e = !1;
|
|
282
|
-
for (let t of d) if (t.value !== "custom" && !f(t.value) && u(t.value) ===
|
|
283
|
-
|
|
282
|
+
for (let t of d) if (t.value !== "custom" && !f(t.value) && u(t.value) === o.dateRange) {
|
|
283
|
+
S(t.value), e = !0;
|
|
284
284
|
break;
|
|
285
285
|
}
|
|
286
|
-
e ||
|
|
286
|
+
e || S("custom");
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
|
-
}, [
|
|
290
|
-
let
|
|
291
|
-
|
|
292
|
-
member:
|
|
289
|
+
}, [o.dateRange, I]);
|
|
290
|
+
let fe = R((e) => {
|
|
291
|
+
s({
|
|
292
|
+
member: o.member,
|
|
293
293
|
operator: e,
|
|
294
294
|
values: []
|
|
295
|
-
}),
|
|
296
|
-
}, [
|
|
297
|
-
let n = t?.shiftKey ?? !1, r =
|
|
298
|
-
|
|
299
|
-
...
|
|
295
|
+
}), l(!1);
|
|
296
|
+
}, [o.member]), pe = R((e, t) => {
|
|
297
|
+
let n = t?.shiftKey ?? !1, r = o.values || [];
|
|
298
|
+
F?.supportsMultipleValues ? (r.includes(e) ? s({
|
|
299
|
+
...o,
|
|
300
300
|
values: r.filter((t) => t !== e)
|
|
301
|
-
}) :
|
|
302
|
-
...
|
|
301
|
+
}) : s({
|
|
302
|
+
...o,
|
|
303
303
|
values: [...r, e]
|
|
304
|
-
}), n ||
|
|
305
|
-
...
|
|
304
|
+
}), n || g(!1)) : (s({
|
|
305
|
+
...o,
|
|
306
306
|
values: [e]
|
|
307
|
-
}),
|
|
308
|
-
}, [
|
|
309
|
-
let t = (
|
|
310
|
-
|
|
311
|
-
...
|
|
307
|
+
}), g(!1)), te(""), O(-1);
|
|
308
|
+
}, [o, F?.supportsMultipleValues]), me = R((e) => {
|
|
309
|
+
let t = (o.values || []).filter((t) => t !== e);
|
|
310
|
+
s({
|
|
311
|
+
...o,
|
|
312
312
|
values: t
|
|
313
313
|
});
|
|
314
|
-
}, [
|
|
315
|
-
if (!(!
|
|
314
|
+
}, [o]), he = R((e) => {
|
|
315
|
+
if (!(!h || L.length === 0)) switch (e.key) {
|
|
316
316
|
case "ArrowDown":
|
|
317
|
-
e.preventDefault(),
|
|
317
|
+
e.preventDefault(), O((e) => e < L.length - 1 ? e + 1 : 0);
|
|
318
318
|
break;
|
|
319
319
|
case "ArrowUp":
|
|
320
|
-
e.preventDefault(),
|
|
320
|
+
e.preventDefault(), O((e) => e > 0 ? e - 1 : L.length - 1);
|
|
321
321
|
break;
|
|
322
322
|
case "Enter":
|
|
323
|
-
e.preventDefault(),
|
|
323
|
+
e.preventDefault(), D >= 0 && D < L.length && pe(L[D], { shiftKey: e.shiftKey });
|
|
324
324
|
break;
|
|
325
325
|
case "Escape":
|
|
326
|
-
e.preventDefault(),
|
|
326
|
+
e.preventDefault(), g(!1), O(-1);
|
|
327
327
|
break;
|
|
328
328
|
}
|
|
329
329
|
}, [
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
]),
|
|
330
|
+
h,
|
|
331
|
+
L,
|
|
332
|
+
D,
|
|
333
|
+
pe
|
|
334
|
+
]), ge = R((e) => {
|
|
335
335
|
let t = e.target.value;
|
|
336
|
-
if (
|
|
336
|
+
if (F?.valueType === "number") {
|
|
337
337
|
let e = parseFloat(t);
|
|
338
|
-
isNaN(e) ? (t === "" || t === "-") &&
|
|
339
|
-
...
|
|
338
|
+
isNaN(e) ? (t === "" || t === "-") && s({
|
|
339
|
+
...o,
|
|
340
340
|
values: []
|
|
341
|
-
}) :
|
|
342
|
-
...
|
|
341
|
+
}) : s({
|
|
342
|
+
...o,
|
|
343
343
|
values: [e]
|
|
344
344
|
});
|
|
345
|
-
} else
|
|
346
|
-
...
|
|
345
|
+
} else s({
|
|
346
|
+
...o,
|
|
347
347
|
values: t ? [t] : []
|
|
348
348
|
});
|
|
349
|
-
}, [
|
|
350
|
-
let t = parseFloat(e.target.value), n = [isNaN(t) ? "" : t, (
|
|
351
|
-
|
|
352
|
-
...
|
|
349
|
+
}, [o, F?.valueType]), _e = R((e) => {
|
|
350
|
+
let t = parseFloat(e.target.value), n = [isNaN(t) ? "" : t, (o.values?.length >= 2 ? o.values : ["", ""])[1]].filter((e) => e !== "");
|
|
351
|
+
s({
|
|
352
|
+
...o,
|
|
353
353
|
values: n
|
|
354
354
|
});
|
|
355
|
-
}, [
|
|
356
|
-
let t = parseFloat(e.target.value), n = [(
|
|
357
|
-
|
|
358
|
-
...
|
|
355
|
+
}, [o]), ve = R((e) => {
|
|
356
|
+
let t = parseFloat(e.target.value), n = [(o.values?.length >= 2 ? o.values : ["", ""])[0], isNaN(t) ? "" : t].filter((e) => e !== "");
|
|
357
|
+
s({
|
|
358
|
+
...o,
|
|
359
359
|
values: n
|
|
360
360
|
});
|
|
361
|
-
}, [
|
|
361
|
+
}, [o]), K = R((e) => {
|
|
362
362
|
let t = e.target.value;
|
|
363
|
-
|
|
364
|
-
...
|
|
363
|
+
s({
|
|
364
|
+
...o,
|
|
365
365
|
values: t ? [t] : []
|
|
366
366
|
});
|
|
367
|
-
}, [
|
|
368
|
-
|
|
367
|
+
}, [o]), xe = R((e) => {
|
|
368
|
+
S(e), y(!1);
|
|
369
369
|
let t;
|
|
370
370
|
if (e === "custom") {
|
|
371
371
|
let e = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
372
372
|
t = [e, e];
|
|
373
|
-
} else t = f(e) ? u(e,
|
|
374
|
-
|
|
375
|
-
...
|
|
373
|
+
} else t = f(e) ? u(e, C) : u(e);
|
|
374
|
+
s({
|
|
375
|
+
...o,
|
|
376
376
|
dateRange: t
|
|
377
377
|
});
|
|
378
|
-
}, [
|
|
379
|
-
if (ee(e), f(
|
|
380
|
-
let t = u(
|
|
381
|
-
|
|
382
|
-
...
|
|
378
|
+
}, [o, C]), Se = R((e) => {
|
|
379
|
+
if (ee(e), f(b)) {
|
|
380
|
+
let t = u(b, e);
|
|
381
|
+
s({
|
|
382
|
+
...o,
|
|
383
383
|
dateRange: t
|
|
384
384
|
});
|
|
385
385
|
}
|
|
386
|
-
}, [
|
|
387
|
-
let t = e.target.value, n = (Array.isArray(
|
|
388
|
-
|
|
389
|
-
...
|
|
386
|
+
}, [o, b]), Ce = R((e) => {
|
|
387
|
+
let t = e.target.value, n = (Array.isArray(o.dateRange) ? o.dateRange : [o.dateRange || "", ""])[1] || t;
|
|
388
|
+
s({
|
|
389
|
+
...o,
|
|
390
390
|
dateRange: [t, n]
|
|
391
391
|
});
|
|
392
|
-
}, [
|
|
393
|
-
let t = e.target.value, n = (Array.isArray(
|
|
394
|
-
|
|
395
|
-
...
|
|
392
|
+
}, [o]), we = R((e) => {
|
|
393
|
+
let t = e.target.value, n = (Array.isArray(o.dateRange) ? o.dateRange : ["", o.dateRange || ""])[0] || t;
|
|
394
|
+
s({
|
|
395
|
+
...o,
|
|
396
396
|
dateRange: [n, t]
|
|
397
397
|
});
|
|
398
|
-
}, [
|
|
398
|
+
}, [o]), Te = a(ce.find((e) => e.operator === o.operator)?.label || o.operator), Ee = a(d.find((e) => e.value === b)?.label || "filter.modal.selectRange"), De = ie ? ye : oe ? be : Y, Oe = () => F?.requiresValues ? I ? /* @__PURE__ */ G("div", {
|
|
399
399
|
className: "dc:space-y-2",
|
|
400
400
|
children: [
|
|
401
|
-
/* @__PURE__ */
|
|
401
|
+
/* @__PURE__ */ G("div", {
|
|
402
402
|
className: "dc:relative",
|
|
403
|
-
children: [/* @__PURE__ */
|
|
403
|
+
children: [/* @__PURE__ */ G("button", {
|
|
404
404
|
onClick: () => {
|
|
405
|
-
|
|
405
|
+
l(!1), g(!1), y(!_);
|
|
406
406
|
},
|
|
407
407
|
className: "dc:w-full dc:flex dc:items-center dc:justify-between dc:text-left dc:text-sm dc:border border-dc-border dc:rounded dc:px-3 dc:py-2 bg-dc-surface text-dc-text hover:bg-dc-surface-hover",
|
|
408
|
-
children: [/* @__PURE__ */
|
|
408
|
+
children: [/* @__PURE__ */ W("span", {
|
|
409
409
|
className: "dc:truncate",
|
|
410
|
-
children:
|
|
411
|
-
}), /* @__PURE__ */
|
|
412
|
-
}),
|
|
410
|
+
children: Ee
|
|
411
|
+
}), /* @__PURE__ */ W(J, { className: `dc:w-4 dc:h-4 text-dc-text-muted dc:shrink-0 dc:ml-2 dc:transition-transform ${_ ? "dc:rotate-180" : ""}` })]
|
|
412
|
+
}), _ && /* @__PURE__ */ W("div", {
|
|
413
413
|
className: "dc:absolute dc:z-[60] dc:left-0 dc:right-0 dc:mt-1 bg-dc-surface dc:border border-dc-border dc:rounded dc:shadow-lg dc:max-h-48 dc:overflow-y-auto",
|
|
414
|
-
children: d.map((e) => /* @__PURE__ */
|
|
415
|
-
onClick: () =>
|
|
416
|
-
className: `dc:w-full dc:text-left dc:px-3 dc:py-2 dc:text-sm hover:bg-dc-surface-hover ${e.value ===
|
|
417
|
-
children: e.label
|
|
414
|
+
children: d.map((e) => /* @__PURE__ */ W("button", {
|
|
415
|
+
onClick: () => xe(e.value),
|
|
416
|
+
className: `dc:w-full dc:text-left dc:px-3 dc:py-2 dc:text-sm hover:bg-dc-surface-hover ${e.value === b ? "bg-dc-primary/10 text-dc-primary" : "text-dc-text"}`,
|
|
417
|
+
children: a(e.label)
|
|
418
418
|
}, e.value))
|
|
419
419
|
})]
|
|
420
420
|
}),
|
|
421
|
-
f(
|
|
421
|
+
f(b) && /* @__PURE__ */ G("div", {
|
|
422
422
|
className: "dc:flex dc:items-center dc:gap-2",
|
|
423
|
-
children: [/* @__PURE__ */
|
|
423
|
+
children: [/* @__PURE__ */ W("input", {
|
|
424
424
|
type: "number",
|
|
425
425
|
min: "1",
|
|
426
426
|
max: "1000",
|
|
427
|
-
value:
|
|
428
|
-
onChange: (e) =>
|
|
427
|
+
value: C,
|
|
428
|
+
onChange: (e) => Se(Math.max(1, parseInt(e.target.value) || 1)),
|
|
429
429
|
className: "dc:flex-1 dc:text-sm dc:border border-dc-border dc:rounded dc:px-3 dc:py-2 bg-dc-surface text-dc-text dc:w-20"
|
|
430
|
-
}), /* @__PURE__ */
|
|
430
|
+
}), /* @__PURE__ */ W("span", {
|
|
431
431
|
className: "dc:text-sm text-dc-text-muted",
|
|
432
|
-
children:
|
|
432
|
+
children: b.replace("last_n_", "")
|
|
433
433
|
})]
|
|
434
434
|
}),
|
|
435
|
-
|
|
435
|
+
b === "custom" && /* @__PURE__ */ G("div", {
|
|
436
436
|
className: "dc:flex dc:items-center dc:gap-2",
|
|
437
437
|
children: [
|
|
438
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ W("input", {
|
|
439
439
|
type: "date",
|
|
440
|
-
value: Array.isArray(
|
|
441
|
-
onChange:
|
|
440
|
+
value: Array.isArray(o.dateRange) ? o.dateRange[0] : "",
|
|
441
|
+
onChange: Ce,
|
|
442
442
|
className: "dc:flex-1 dc:text-sm dc:border border-dc-border dc:rounded dc:px-2 dc:py-2 bg-dc-surface text-dc-text"
|
|
443
443
|
}),
|
|
444
|
-
/* @__PURE__ */
|
|
444
|
+
/* @__PURE__ */ W("span", {
|
|
445
445
|
className: "dc:text-sm text-dc-text-muted",
|
|
446
|
-
children: "
|
|
446
|
+
children: a("filter.modal.dateTo")
|
|
447
447
|
}),
|
|
448
|
-
/* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ W("input", {
|
|
449
449
|
type: "date",
|
|
450
|
-
value: Array.isArray(
|
|
451
|
-
onChange:
|
|
450
|
+
value: Array.isArray(o.dateRange) ? o.dateRange[1] : "",
|
|
451
|
+
onChange: we,
|
|
452
452
|
className: "dc:flex-1 dc:text-sm dc:border border-dc-border dc:rounded dc:px-2 dc:py-2 bg-dc-surface text-dc-text"
|
|
453
453
|
})
|
|
454
454
|
]
|
|
455
455
|
})
|
|
456
456
|
]
|
|
457
|
-
}) :
|
|
457
|
+
}) : o.operator === "between" || o.operator === "notBetween" ? /* @__PURE__ */ G("div", {
|
|
458
458
|
className: "dc:flex dc:items-center dc:gap-2",
|
|
459
459
|
children: [
|
|
460
|
-
/* @__PURE__ */
|
|
460
|
+
/* @__PURE__ */ W("input", {
|
|
461
461
|
type: "number",
|
|
462
|
-
value:
|
|
463
|
-
onChange:
|
|
464
|
-
placeholder: "
|
|
462
|
+
value: o.values?.[0] ?? "",
|
|
463
|
+
onChange: _e,
|
|
464
|
+
placeholder: a("filter.modal.min"),
|
|
465
465
|
className: "dc:flex-1 dc:text-sm dc:border border-dc-border dc:rounded dc:px-3 dc:py-2 bg-dc-surface text-dc-text"
|
|
466
466
|
}),
|
|
467
|
-
/* @__PURE__ */
|
|
467
|
+
/* @__PURE__ */ W("span", {
|
|
468
468
|
className: "dc:text-sm text-dc-text-muted",
|
|
469
|
-
children: "to"
|
|
469
|
+
children: a("filter.modal.to")
|
|
470
470
|
}),
|
|
471
|
-
/* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ W("input", {
|
|
472
472
|
type: "number",
|
|
473
|
-
value:
|
|
474
|
-
onChange:
|
|
475
|
-
placeholder: "
|
|
473
|
+
value: o.values?.[1] ?? "",
|
|
474
|
+
onChange: ve,
|
|
475
|
+
placeholder: a("filter.modal.max"),
|
|
476
476
|
className: "dc:flex-1 dc:text-sm dc:border border-dc-border dc:rounded dc:px-3 dc:py-2 bg-dc-surface text-dc-text"
|
|
477
477
|
})
|
|
478
478
|
]
|
|
479
|
-
}) :
|
|
479
|
+
}) : F?.valueType === "date" ? /* @__PURE__ */ W("input", {
|
|
480
480
|
type: "date",
|
|
481
|
-
value:
|
|
482
|
-
onChange:
|
|
481
|
+
value: o.values?.[0] || "",
|
|
482
|
+
onChange: K,
|
|
483
483
|
className: "dc:w-full dc:text-sm dc:border border-dc-border dc:rounded dc:px-3 dc:py-2 bg-dc-surface text-dc-text"
|
|
484
|
-
}) :
|
|
484
|
+
}) : F?.valueType === "number" ? /* @__PURE__ */ W("input", {
|
|
485
485
|
type: "number",
|
|
486
|
-
value:
|
|
487
|
-
onChange:
|
|
488
|
-
placeholder: "
|
|
486
|
+
value: o.values?.[0] ?? "",
|
|
487
|
+
onChange: ge,
|
|
488
|
+
placeholder: a("filter.modal.enterNumber"),
|
|
489
489
|
className: "dc:w-full dc:text-sm dc:border border-dc-border dc:rounded dc:px-3 dc:py-2 bg-dc-surface text-dc-text"
|
|
490
|
-
}) :
|
|
490
|
+
}) : le ? /* @__PURE__ */ G("div", {
|
|
491
491
|
className: "dc:space-y-2",
|
|
492
492
|
children: [
|
|
493
|
-
|
|
493
|
+
o.values && o.values.length > 0 && /* @__PURE__ */ W("div", {
|
|
494
494
|
className: "dc:flex dc:flex-wrap dc:gap-1.5",
|
|
495
|
-
children:
|
|
495
|
+
children: o.values.map((e, t) => /* @__PURE__ */ G("span", {
|
|
496
496
|
className: "dc:inline-flex dc:items-center dc:gap-1 bg-dc-primary/10 text-dc-primary dc:text-sm dc:px-2 dc:py-1 dc:rounded",
|
|
497
|
-
children: [/* @__PURE__ */
|
|
497
|
+
children: [/* @__PURE__ */ W("span", {
|
|
498
498
|
className: "dc:max-w-[150px] dc:truncate",
|
|
499
499
|
children: String(e)
|
|
500
|
-
}), /* @__PURE__ */
|
|
501
|
-
onClick: () =>
|
|
500
|
+
}), /* @__PURE__ */ W("button", {
|
|
501
|
+
onClick: () => me(e),
|
|
502
502
|
className: "hover:text-dc-danger",
|
|
503
|
-
children: /* @__PURE__ */
|
|
503
|
+
children: /* @__PURE__ */ W(q, { className: "dc:w-3.5 dc:h-3.5" })
|
|
504
504
|
})]
|
|
505
505
|
}, t))
|
|
506
506
|
}),
|
|
507
|
-
/* @__PURE__ */
|
|
507
|
+
/* @__PURE__ */ G("div", {
|
|
508
508
|
className: "dc:relative",
|
|
509
|
-
children: [/* @__PURE__ */
|
|
509
|
+
children: [/* @__PURE__ */ G("button", {
|
|
510
510
|
onClick: () => {
|
|
511
|
-
|
|
511
|
+
l(!1), y(!1), g(!h);
|
|
512
512
|
},
|
|
513
513
|
className: "dc:w-full dc:flex dc:items-center dc:justify-between dc:text-left dc:text-sm dc:border border-dc-border dc:rounded dc:px-3 dc:py-2 bg-dc-surface text-dc-text hover:bg-dc-surface-hover",
|
|
514
|
-
children: [/* @__PURE__ */
|
|
514
|
+
children: [/* @__PURE__ */ W("span", {
|
|
515
515
|
className: "text-dc-text-muted dc:truncate",
|
|
516
|
-
children:
|
|
517
|
-
}), /* @__PURE__ */
|
|
518
|
-
}),
|
|
516
|
+
children: a(ue ? "filter.modal.loading" : "filter.modal.selectValue")
|
|
517
|
+
}), /* @__PURE__ */ W(J, { className: `dc:w-4 dc:h-4 text-dc-text-muted dc:shrink-0 dc:ml-2 dc:transition-transform ${h ? "dc:rotate-180" : ""}` })]
|
|
518
|
+
}), h && /* @__PURE__ */ G("div", {
|
|
519
519
|
className: "dc:absolute dc:z-[60] dc:left-0 dc:right-0 dc:mt-1 bg-dc-surface dc:border border-dc-border dc:rounded dc:shadow-lg dc:max-h-56 dc:overflow-hidden",
|
|
520
|
-
children: [/* @__PURE__ */
|
|
520
|
+
children: [/* @__PURE__ */ W("div", {
|
|
521
521
|
className: "dc:p-2 dc:border-b border-dc-border",
|
|
522
|
-
children: /* @__PURE__ */
|
|
522
|
+
children: /* @__PURE__ */ W("input", {
|
|
523
523
|
type: "text",
|
|
524
|
-
value:
|
|
524
|
+
value: w,
|
|
525
525
|
onChange: (e) => {
|
|
526
|
-
|
|
526
|
+
te(e.target.value), O(-1);
|
|
527
527
|
},
|
|
528
|
-
onKeyDown:
|
|
529
|
-
placeholder: "
|
|
528
|
+
onKeyDown: he,
|
|
529
|
+
placeholder: a("filter.modal.search"),
|
|
530
530
|
className: "dc:w-full dc:text-sm dc:border border-dc-border dc:rounded dc:px-3 dc:py-2 bg-dc-surface text-dc-text",
|
|
531
531
|
autoFocus: !0
|
|
532
532
|
})
|
|
533
|
-
}), /* @__PURE__ */
|
|
534
|
-
ref:
|
|
533
|
+
}), /* @__PURE__ */ W("div", {
|
|
534
|
+
ref: A,
|
|
535
535
|
className: "dc:max-h-40 dc:overflow-y-auto",
|
|
536
|
-
children:
|
|
536
|
+
children: ue ? /* @__PURE__ */ W("div", {
|
|
537
537
|
className: "dc:px-3 dc:py-2 dc:text-sm text-dc-text-muted",
|
|
538
|
-
children: "
|
|
539
|
-
}) :
|
|
538
|
+
children: a("filter.modal.loading")
|
|
539
|
+
}) : B ? /* @__PURE__ */ G("div", {
|
|
540
540
|
className: "dc:px-3 dc:py-2 dc:text-sm text-dc-error",
|
|
541
|
-
children: ["
|
|
542
|
-
}) :
|
|
541
|
+
children: [a("filter.modal.errorPrefix"), B]
|
|
542
|
+
}) : L.length === 0 ? /* @__PURE__ */ W("div", {
|
|
543
543
|
className: "dc:px-3 dc:py-2 dc:text-sm text-dc-text-muted",
|
|
544
|
-
children: "
|
|
545
|
-
}) :
|
|
546
|
-
let n =
|
|
547
|
-
return /* @__PURE__ */
|
|
548
|
-
onClick: (t) =>
|
|
549
|
-
className: `dc:w-full dc:text-left dc:px-3 dc:py-2 dc:text-sm dc:transition-colors ${t ===
|
|
550
|
-
children: [String(e), n && /* @__PURE__ */
|
|
544
|
+
children: a("filter.modal.noValues")
|
|
545
|
+
}) : L.map((e, t) => {
|
|
546
|
+
let n = o.values?.includes(e);
|
|
547
|
+
return /* @__PURE__ */ G("button", {
|
|
548
|
+
onClick: (t) => pe(e, t),
|
|
549
|
+
className: `dc:w-full dc:text-left dc:px-3 dc:py-2 dc:text-sm dc:transition-colors ${t === D ? "bg-dc-surface-hover" : ""} ${n ? "bg-dc-primary/10 text-dc-primary" : "text-dc-text hover:bg-dc-surface-hover"}`,
|
|
550
|
+
children: [String(e), n && /* @__PURE__ */ W("span", {
|
|
551
551
|
className: "dc:float-right",
|
|
552
552
|
children: "✓"
|
|
553
553
|
})]
|
|
@@ -556,31 +556,31 @@ function be({ filter: e, schema: t, onSave: n, onCancel: r, anchorElement: i })
|
|
|
556
556
|
})]
|
|
557
557
|
})]
|
|
558
558
|
}),
|
|
559
|
-
|
|
559
|
+
F?.supportsMultipleValues && /* @__PURE__ */ W("p", {
|
|
560
560
|
className: "dc:text-xs text-dc-text-muted",
|
|
561
|
-
children: "
|
|
561
|
+
children: a("filter.modal.multiSelectHint")
|
|
562
562
|
})
|
|
563
563
|
]
|
|
564
|
-
}) : /* @__PURE__ */
|
|
564
|
+
}) : /* @__PURE__ */ W("input", {
|
|
565
565
|
type: "text",
|
|
566
|
-
value:
|
|
567
|
-
onChange:
|
|
568
|
-
placeholder: "
|
|
566
|
+
value: o.values?.[0] ?? "",
|
|
567
|
+
onChange: ge,
|
|
568
|
+
placeholder: a("filter.modal.enterValue"),
|
|
569
569
|
className: "dc:w-full dc:text-sm dc:border border-dc-border dc:rounded dc:px-3 dc:py-2 bg-dc-surface text-dc-text placeholder-dc-text-muted"
|
|
570
|
-
}) : /* @__PURE__ */
|
|
570
|
+
}) : /* @__PURE__ */ W("div", {
|
|
571
571
|
className: "dc:text-sm text-dc-text-muted dc:italic dc:py-2",
|
|
572
|
-
children: "
|
|
572
|
+
children: a("filter.modal.noValueRequired")
|
|
573
573
|
});
|
|
574
|
-
return /* @__PURE__ */ U
|
|
575
|
-
className: `dc:fixed dc:inset-0 bg-dc-overlay dc:z-50 ${
|
|
574
|
+
return /* @__PURE__ */ W(U, { children: /* @__PURE__ */ W("div", {
|
|
575
|
+
className: `dc:fixed dc:inset-0 bg-dc-overlay dc:z-50 ${E ? "" : "dc:flex dc:items-center dc:justify-center dc:p-4"}`,
|
|
576
576
|
onClick: r,
|
|
577
|
-
children: /* @__PURE__ */
|
|
578
|
-
ref:
|
|
579
|
-
className:
|
|
577
|
+
children: /* @__PURE__ */ G("div", {
|
|
578
|
+
ref: k,
|
|
579
|
+
className: E ? "bg-dc-surface rounded-lg border border-dc-border" : "bg-dc-surface rounded-lg border border-dc-border max-w-md w-full",
|
|
580
580
|
style: {
|
|
581
|
-
...
|
|
581
|
+
...E ? {
|
|
582
582
|
position: "fixed",
|
|
583
|
-
...
|
|
583
|
+
...E,
|
|
584
584
|
maxWidth: "400px",
|
|
585
585
|
width: "100%"
|
|
586
586
|
} : {},
|
|
@@ -588,69 +588,69 @@ function be({ filter: e, schema: t, onSave: n, onCancel: r, anchorElement: i })
|
|
|
588
588
|
},
|
|
589
589
|
onClick: (e) => e.stopPropagation(),
|
|
590
590
|
children: [
|
|
591
|
-
/* @__PURE__ */
|
|
591
|
+
/* @__PURE__ */ G("div", {
|
|
592
592
|
className: "dc:flex dc:items-center dc:justify-between dc:p-4 dc:border-b border-dc-border",
|
|
593
|
-
children: [/* @__PURE__ */
|
|
593
|
+
children: [/* @__PURE__ */ W("h2", {
|
|
594
594
|
className: "dc:text-lg dc:font-semibold text-dc-text",
|
|
595
|
-
children: "
|
|
596
|
-
}), /* @__PURE__ */
|
|
595
|
+
children: a("filter.modal.title")
|
|
596
|
+
}), /* @__PURE__ */ W("button", {
|
|
597
597
|
onClick: r,
|
|
598
598
|
className: "dc:p-1 text-dc-text-muted hover:text-dc-text dc:transition-colors",
|
|
599
|
-
children: /* @__PURE__ */
|
|
599
|
+
children: /* @__PURE__ */ W(q, { className: "dc:w-5 dc:h-5" })
|
|
600
600
|
})]
|
|
601
601
|
}),
|
|
602
|
-
/* @__PURE__ */
|
|
602
|
+
/* @__PURE__ */ G("div", {
|
|
603
603
|
className: "dc:p-4 dc:space-y-4",
|
|
604
604
|
children: [
|
|
605
|
-
/* @__PURE__ */
|
|
605
|
+
/* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("label", {
|
|
606
606
|
className: "dc:block dc:text-sm dc:font-medium text-dc-text-secondary dc:mb-2",
|
|
607
|
-
children: "
|
|
608
|
-
}), /* @__PURE__ */
|
|
607
|
+
children: a("filter.modal.fieldLabel")
|
|
608
|
+
}), /* @__PURE__ */ G("div", {
|
|
609
609
|
className: "dc:flex dc:items-center dc:gap-2 dc:p-3 bg-dc-surface-secondary dc:rounded",
|
|
610
|
-
children: [/* @__PURE__ */
|
|
610
|
+
children: [/* @__PURE__ */ W(De, { className: "dc:w-5 dc:h-5 text-dc-filter-text" }), /* @__PURE__ */ W("span", {
|
|
611
611
|
className: "dc:text-sm dc:font-medium text-dc-text",
|
|
612
|
-
children:
|
|
612
|
+
children: se
|
|
613
613
|
})]
|
|
614
614
|
})] }),
|
|
615
|
-
/* @__PURE__ */
|
|
615
|
+
/* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("label", {
|
|
616
616
|
className: "dc:block dc:text-sm dc:font-medium text-dc-text-secondary dc:mb-2",
|
|
617
|
-
children: "
|
|
618
|
-
}), /* @__PURE__ */
|
|
617
|
+
children: a("filter.modal.operatorLabel")
|
|
618
|
+
}), /* @__PURE__ */ G("div", {
|
|
619
619
|
className: "dc:relative",
|
|
620
|
-
children: [/* @__PURE__ */
|
|
620
|
+
children: [/* @__PURE__ */ G("button", {
|
|
621
621
|
onClick: () => {
|
|
622
|
-
|
|
622
|
+
g(!1), y(!1), l(!c);
|
|
623
623
|
},
|
|
624
624
|
className: "dc:w-full dc:flex dc:items-center dc:justify-between dc:text-left dc:text-sm dc:border border-dc-border dc:rounded dc:px-3 dc:py-2 bg-dc-surface text-dc-text hover:bg-dc-surface-hover",
|
|
625
|
-
children: [/* @__PURE__ */
|
|
625
|
+
children: [/* @__PURE__ */ W("span", {
|
|
626
626
|
className: "dc:truncate",
|
|
627
|
-
children:
|
|
628
|
-
}), /* @__PURE__ */
|
|
629
|
-
}),
|
|
627
|
+
children: Te
|
|
628
|
+
}), /* @__PURE__ */ W(J, { className: `dc:w-4 dc:h-4 text-dc-text-muted dc:shrink-0 dc:ml-2 dc:transition-transform ${c ? "dc:rotate-180" : ""}` })]
|
|
629
|
+
}), c && /* @__PURE__ */ W("div", {
|
|
630
630
|
className: "dc:absolute dc:z-[60] dc:left-0 dc:right-0 dc:mt-1 bg-dc-surface dc:border border-dc-border dc:rounded dc:shadow-lg dc:max-h-48 dc:overflow-y-auto",
|
|
631
|
-
children:
|
|
632
|
-
onClick: () =>
|
|
633
|
-
className: `dc:w-full dc:text-left dc:px-3 dc:py-2 dc:text-sm hover:bg-dc-surface-hover ${e.operator ===
|
|
634
|
-
children: e.label
|
|
631
|
+
children: ce.map((e) => /* @__PURE__ */ W("button", {
|
|
632
|
+
onClick: () => fe(e.operator),
|
|
633
|
+
className: `dc:w-full dc:text-left dc:px-3 dc:py-2 dc:text-sm hover:bg-dc-surface-hover ${e.operator === o.operator ? "bg-dc-primary/10 text-dc-primary" : "text-dc-text"}`,
|
|
634
|
+
children: a(e.label)
|
|
635
635
|
}, e.operator))
|
|
636
636
|
})]
|
|
637
637
|
})] }),
|
|
638
|
-
/* @__PURE__ */
|
|
638
|
+
/* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("label", {
|
|
639
639
|
className: "dc:block dc:text-sm dc:font-medium text-dc-text-secondary dc:mb-2",
|
|
640
|
-
children: "
|
|
641
|
-
}),
|
|
640
|
+
children: a("filter.modal.valueLabel")
|
|
641
|
+
}), Oe()] })
|
|
642
642
|
]
|
|
643
643
|
}),
|
|
644
|
-
/* @__PURE__ */
|
|
644
|
+
/* @__PURE__ */ G("div", {
|
|
645
645
|
className: "dc:flex dc:items-center dc:justify-end dc:gap-2 dc:p-4 dc:border-t border-dc-border",
|
|
646
|
-
children: [/* @__PURE__ */
|
|
646
|
+
children: [/* @__PURE__ */ W("button", {
|
|
647
647
|
onClick: r,
|
|
648
648
|
className: "dc:px-4 dc:py-2 dc:text-sm dc:font-medium text-dc-text-secondary hover:text-dc-text dc:transition-colors",
|
|
649
|
-
children: "
|
|
650
|
-
}), /* @__PURE__ */
|
|
651
|
-
onClick: () => n(
|
|
649
|
+
children: a("common.actions.cancel")
|
|
650
|
+
}), /* @__PURE__ */ W("button", {
|
|
651
|
+
onClick: () => n(o),
|
|
652
652
|
className: "dc:px-4 dc:py-2 dc:text-sm dc:font-medium text-dc-primary-content bg-dc-primary hover:bg-dc-primary-hover dc:rounded dc:transition-colors",
|
|
653
|
-
children: "
|
|
653
|
+
children: a("common.actions.save")
|
|
654
654
|
})]
|
|
655
655
|
})
|
|
656
656
|
]
|
|
@@ -659,92 +659,92 @@ function be({ filter: e, schema: t, onSave: n, onCancel: r, anchorElement: i })
|
|
|
659
659
|
}
|
|
660
660
|
//#endregion
|
|
661
661
|
//#region src/client/components/AnalysisBuilder/AnalysisFilterItem.tsx
|
|
662
|
-
var
|
|
663
|
-
function
|
|
664
|
-
let
|
|
665
|
-
return /* @__PURE__ */
|
|
662
|
+
var Se = s("close"), Ce = s("dimension"), we = s("timeDimension"), Te = s("measure");
|
|
663
|
+
function Ee({ filter: e, schema: t, onRemove: n, onUpdate: r }) {
|
|
664
|
+
let { t: i } = T(), [a, o] = H(!1), s = V(null), c = j(e.member, t), l = (c?.field.type || "string") === "time", u = c?.fieldType === "measure", d = ae(e.member, t), f = p[e.operator], m = f?.label ? i(f.label) : e.operator, h = De(e, f, i), g = l ? we : u ? Te : Ce;
|
|
665
|
+
return /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ G("div", {
|
|
666
666
|
className: "dc:flex dc:items-start dc:gap-2 dc:px-2 dc:py-1.5 bg-dc-surface-secondary dc:rounded-lg dc:group hover:bg-dc-surface-tertiary dc:transition-all dc:duration-150 dc:w-full",
|
|
667
667
|
children: [
|
|
668
|
-
/* @__PURE__ */
|
|
669
|
-
className: `dc:w-6 dc:h-6 dc:flex dc:items-center dc:justify-center dc:rounded ${
|
|
670
|
-
children:
|
|
668
|
+
/* @__PURE__ */ W("span", {
|
|
669
|
+
className: `dc:w-6 dc:h-6 dc:flex dc:items-center dc:justify-center dc:rounded ${l ? "bg-dc-time-dimension" : u ? "bg-dc-measure" : "bg-dc-dimension"} ${l ? "text-dc-time-dimension-text" : u ? "text-dc-measure-text" : "text-dc-dimension-text"} dc:flex-shrink-0 dc:mt-0.5`,
|
|
670
|
+
children: g && /* @__PURE__ */ W(g, { className: "dc:w-4 dc:h-4" })
|
|
671
671
|
}),
|
|
672
|
-
/* @__PURE__ */
|
|
673
|
-
ref:
|
|
674
|
-
onClick: () =>
|
|
672
|
+
/* @__PURE__ */ W("button", {
|
|
673
|
+
ref: s,
|
|
674
|
+
onClick: () => o(!0),
|
|
675
675
|
className: "dc:flex-1 dc:min-w-0 dc:text-left",
|
|
676
|
-
title: `${
|
|
677
|
-
children: /* @__PURE__ */
|
|
676
|
+
title: `${d} ${m} ${h}`,
|
|
677
|
+
children: /* @__PURE__ */ G("div", {
|
|
678
678
|
className: "dc:text-sm text-dc-text dc:break-words",
|
|
679
679
|
children: [
|
|
680
|
-
/* @__PURE__ */
|
|
680
|
+
/* @__PURE__ */ W("span", {
|
|
681
681
|
className: "dc:font-medium",
|
|
682
|
-
children:
|
|
682
|
+
children: d
|
|
683
683
|
}),
|
|
684
|
-
/* @__PURE__ */
|
|
684
|
+
/* @__PURE__ */ W("span", {
|
|
685
685
|
className: "text-dc-text-muted dc:mx-1",
|
|
686
|
-
children:
|
|
686
|
+
children: m
|
|
687
687
|
}),
|
|
688
|
-
/* @__PURE__ */
|
|
688
|
+
/* @__PURE__ */ W("span", {
|
|
689
689
|
className: "text-dc-primary",
|
|
690
|
-
children:
|
|
690
|
+
children: h
|
|
691
691
|
})
|
|
692
692
|
]
|
|
693
693
|
})
|
|
694
694
|
}),
|
|
695
|
-
/* @__PURE__ */
|
|
695
|
+
/* @__PURE__ */ W("button", {
|
|
696
696
|
onClick: n,
|
|
697
697
|
className: "dc:p-1 text-dc-text-muted hover:text-dc-danger dc:opacity-100 dc:sm:opacity-0 dc:sm:group-hover:opacity-100 dc:transition-opacity dc:flex-shrink-0 dc:mt-0.5",
|
|
698
|
-
title: "
|
|
699
|
-
children:
|
|
698
|
+
title: i("filter.removeButton.title"),
|
|
699
|
+
children: Se && /* @__PURE__ */ W(Se, { className: "dc:w-4 dc:h-4" })
|
|
700
700
|
})
|
|
701
701
|
]
|
|
702
|
-
}),
|
|
702
|
+
}), a && /* @__PURE__ */ W(xe, {
|
|
703
703
|
filter: e,
|
|
704
704
|
schema: t,
|
|
705
705
|
onSave: (e) => {
|
|
706
|
-
r(e),
|
|
706
|
+
r(e), o(!1);
|
|
707
707
|
},
|
|
708
|
-
onCancel: () =>
|
|
709
|
-
anchorElement:
|
|
708
|
+
onCancel: () => o(!1),
|
|
709
|
+
anchorElement: s.current
|
|
710
710
|
})] });
|
|
711
711
|
}
|
|
712
|
-
function
|
|
712
|
+
function De(e, t, n) {
|
|
713
713
|
if (!t?.requiresValues) return "";
|
|
714
714
|
if (e.dateRange) return Array.isArray(e.dateRange) ? `${e.dateRange[0]} to ${e.dateRange[1]}` : e.dateRange;
|
|
715
|
-
let
|
|
716
|
-
return
|
|
715
|
+
let r = e.values || [];
|
|
716
|
+
return r.length === 0 ? n("filter.valueDisplay.empty") : r.length === 1 ? String(r[0]) : r.length === 2 ? `${r[0]}, ${r[1]}` : `${r[0]}, ${r[1]}, +${r.length - 2} ${n("filter.valueDisplay.more")}`;
|
|
717
717
|
}
|
|
718
718
|
//#endregion
|
|
719
719
|
//#region src/client/components/AnalysisBuilder/AnalysisFilterGroup.tsx
|
|
720
|
-
var
|
|
721
|
-
function
|
|
720
|
+
var Oe = s("add"), ke = s("close");
|
|
721
|
+
function Ae(e) {
|
|
722
722
|
return "member" in e && typeof e.member == "string";
|
|
723
723
|
}
|
|
724
|
-
function
|
|
724
|
+
function je(e) {
|
|
725
725
|
return "type" in e && (e.type === "and" || e.type === "or");
|
|
726
726
|
}
|
|
727
|
-
function
|
|
728
|
-
let
|
|
729
|
-
|
|
727
|
+
function Me({ group: e, schema: t, onUpdate: n, onRemove: r, onAddFilter: i, depth: a = 0, hideRemoveButton: o = !1 }) {
|
|
728
|
+
let { t: s } = T(), [c, l] = H(!1), u = V(null);
|
|
729
|
+
z(() => {
|
|
730
730
|
let e = (e) => {
|
|
731
|
-
|
|
731
|
+
u.current && !u.current.contains(e.target) && l(!1);
|
|
732
732
|
};
|
|
733
733
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
734
734
|
}, []);
|
|
735
|
-
let
|
|
735
|
+
let d = R(() => {
|
|
736
736
|
let t = e.type === "and" ? "or" : "and";
|
|
737
737
|
n({
|
|
738
738
|
...e,
|
|
739
739
|
type: t
|
|
740
740
|
});
|
|
741
|
-
}, [e, n]),
|
|
741
|
+
}, [e, n]), f = R((t, r) => {
|
|
742
742
|
let i = [...e.filters];
|
|
743
743
|
i[t] = r, n({
|
|
744
744
|
...e,
|
|
745
745
|
filters: i
|
|
746
746
|
});
|
|
747
|
-
}, [e, n]),
|
|
747
|
+
}, [e, n]), p = R((t) => {
|
|
748
748
|
let i = e.filters.filter((e, n) => n !== t);
|
|
749
749
|
i.length === 0 ? r() : n({
|
|
750
750
|
...e,
|
|
@@ -755,7 +755,7 @@ function je({ group: e, schema: t, onUpdate: n, onRemove: r, onAddFilter: i, dep
|
|
|
755
755
|
n,
|
|
756
756
|
r,
|
|
757
757
|
a
|
|
758
|
-
]),
|
|
758
|
+
]), m = R((t) => {
|
|
759
759
|
let r = {
|
|
760
760
|
type: t,
|
|
761
761
|
filters: []
|
|
@@ -763,91 +763,91 @@ function je({ group: e, schema: t, onUpdate: n, onRemove: r, onAddFilter: i, dep
|
|
|
763
763
|
n({
|
|
764
764
|
...e,
|
|
765
765
|
filters: [...e.filters, r]
|
|
766
|
-
}),
|
|
767
|
-
}, [e, n]),
|
|
768
|
-
i([]),
|
|
769
|
-
}, [i]),
|
|
766
|
+
}), l(!1);
|
|
767
|
+
}, [e, n]), h = R(() => {
|
|
768
|
+
i([]), l(!1);
|
|
769
|
+
}, [i]), g = R((e) => (t = []) => {
|
|
770
770
|
i([e, ...t]);
|
|
771
|
-
}, [i]),
|
|
772
|
-
return /* @__PURE__ */
|
|
773
|
-
className: `dc:border ${
|
|
774
|
-
children: [/* @__PURE__ */
|
|
775
|
-
className: `dc:flex dc:items-center dc:justify-between dc:px-2 dc:py-1.5 dc:border-b border-dc-border/50 dc:rounded-t-lg ${
|
|
776
|
-
children: [/* @__PURE__ */
|
|
771
|
+
}, [i]), _ = () => a % 2 == 0 ? "border-dc-border" : "border-dc-border dark:border-dc-border", v = () => e.type === "and" ? "bg-dc-info-bg/50" : "bg-dc-warning-bg/50", y = e.filters.length, b = s(y === 1 ? "filter.group.condition" : "filter.group.conditions");
|
|
772
|
+
return /* @__PURE__ */ G("div", {
|
|
773
|
+
className: `dc:border ${_()} dc:rounded-lg bg-dc-surface dc:w-full`,
|
|
774
|
+
children: [/* @__PURE__ */ G("div", {
|
|
775
|
+
className: `dc:flex dc:items-center dc:justify-between dc:px-2 dc:py-1.5 dc:border-b border-dc-border/50 dc:rounded-t-lg ${v()}`,
|
|
776
|
+
children: [/* @__PURE__ */ G("div", {
|
|
777
777
|
className: "dc:flex dc:items-center dc:gap-2",
|
|
778
|
-
children: [/* @__PURE__ */
|
|
779
|
-
onClick:
|
|
778
|
+
children: [/* @__PURE__ */ W("button", {
|
|
779
|
+
onClick: d,
|
|
780
780
|
className: `dc:px-2 dc:py-0.5 dc:text-xs dc:font-semibold dc:rounded dc:transition-colors ${e.type === "and" ? "bg-dc-info-bg text-dc-info dc:hover:opacity-80" : "bg-dc-warning-bg text-dc-warning dc:hover:opacity-80"}`,
|
|
781
781
|
title: `Click to switch to ${e.type === "and" ? "OR" : "AND"}`,
|
|
782
782
|
children: e.type.toUpperCase()
|
|
783
|
-
}), /* @__PURE__ */
|
|
783
|
+
}), /* @__PURE__ */ G("span", {
|
|
784
784
|
className: "dc:text-xs text-dc-text-muted",
|
|
785
785
|
children: [
|
|
786
|
-
|
|
786
|
+
y,
|
|
787
787
|
" ",
|
|
788
|
-
|
|
788
|
+
b
|
|
789
789
|
]
|
|
790
790
|
})]
|
|
791
|
-
}), /* @__PURE__ */
|
|
791
|
+
}), /* @__PURE__ */ G("div", {
|
|
792
792
|
className: "dc:flex dc:items-center dc:gap-1",
|
|
793
|
-
children: [/* @__PURE__ */
|
|
793
|
+
children: [/* @__PURE__ */ G("div", {
|
|
794
794
|
className: "dc:relative",
|
|
795
|
-
ref:
|
|
796
|
-
children: [/* @__PURE__ */
|
|
797
|
-
onClick: () =>
|
|
795
|
+
ref: u,
|
|
796
|
+
children: [/* @__PURE__ */ W("button", {
|
|
797
|
+
onClick: () => l(!c),
|
|
798
798
|
className: "dc:p-1 text-dc-text-secondary hover:text-dc-primary hover:bg-dc-surface-hover dc:rounded dc:transition-colors",
|
|
799
799
|
title: "Add condition",
|
|
800
|
-
children: /* @__PURE__ */
|
|
801
|
-
}),
|
|
800
|
+
children: /* @__PURE__ */ W(Oe, { className: "dc:w-4 dc:h-4" })
|
|
801
|
+
}), c && /* @__PURE__ */ G("div", {
|
|
802
802
|
className: "dc:absolute dc:right-0 dc:mt-1 dc:z-40 bg-dc-surface dc:border border-dc-border dc:rounded dc:shadow-lg dc:py-1 dc:min-w-[120px]",
|
|
803
803
|
children: [
|
|
804
|
-
/* @__PURE__ */
|
|
805
|
-
onClick:
|
|
804
|
+
/* @__PURE__ */ W("button", {
|
|
805
|
+
onClick: h,
|
|
806
806
|
className: "dc:w-full dc:text-left dc:px-3 dc:py-1.5 dc:text-xs text-dc-text hover:bg-dc-surface-hover",
|
|
807
|
-
children: "
|
|
807
|
+
children: s("filter.group.addFilter")
|
|
808
808
|
}),
|
|
809
|
-
/* @__PURE__ */
|
|
810
|
-
onClick: () =>
|
|
809
|
+
/* @__PURE__ */ W("button", {
|
|
810
|
+
onClick: () => m("and"),
|
|
811
811
|
className: "dc:w-full dc:text-left dc:px-3 dc:py-1.5 dc:text-xs text-dc-text hover:bg-dc-surface-hover",
|
|
812
|
-
children: "
|
|
812
|
+
children: s("filter.group.addAndGroup")
|
|
813
813
|
}),
|
|
814
|
-
/* @__PURE__ */
|
|
815
|
-
onClick: () =>
|
|
814
|
+
/* @__PURE__ */ W("button", {
|
|
815
|
+
onClick: () => m("or"),
|
|
816
816
|
className: "dc:w-full dc:text-left dc:px-3 dc:py-1.5 dc:text-xs text-dc-text hover:bg-dc-surface-hover",
|
|
817
|
-
children: "
|
|
817
|
+
children: s("filter.group.addOrGroup")
|
|
818
818
|
})
|
|
819
819
|
]
|
|
820
820
|
})]
|
|
821
|
-
}), !o && /* @__PURE__ */
|
|
821
|
+
}), !o && /* @__PURE__ */ W("button", {
|
|
822
822
|
onClick: r,
|
|
823
823
|
className: "dc:p-1 text-dc-text-muted hover:text-dc-danger dc:transition-colors",
|
|
824
|
-
title: "
|
|
825
|
-
children: /* @__PURE__ */
|
|
824
|
+
title: s("filter.group.removeGroup"),
|
|
825
|
+
children: /* @__PURE__ */ W(ke, { className: "dc:w-4 dc:h-4" })
|
|
826
826
|
})]
|
|
827
827
|
})]
|
|
828
|
-
}), /* @__PURE__ */
|
|
828
|
+
}), /* @__PURE__ */ W("div", {
|
|
829
829
|
className: "dc:p-1.5 dc:flex dc:flex-wrap dc:gap-2",
|
|
830
|
-
children: e.filters.length === 0 ? /* @__PURE__ */
|
|
830
|
+
children: e.filters.length === 0 ? /* @__PURE__ */ G("div", {
|
|
831
831
|
className: "dc:text-center dc:py-3",
|
|
832
|
-
children: [/* @__PURE__ */
|
|
832
|
+
children: [/* @__PURE__ */ W("p", {
|
|
833
833
|
className: "dc:text-xs text-dc-text-muted dc:mb-1",
|
|
834
|
-
children: "
|
|
835
|
-
}), /* @__PURE__ */
|
|
834
|
+
children: s("filter.group.empty")
|
|
835
|
+
}), /* @__PURE__ */ W("button", {
|
|
836
836
|
onClick: () => i([]),
|
|
837
837
|
className: "dc:text-xs text-dc-primary dc:hover:underline",
|
|
838
|
-
children: "
|
|
838
|
+
children: s("filter.group.addFilterLink")
|
|
839
839
|
})]
|
|
840
|
-
}) : e.filters.map((e, n) =>
|
|
840
|
+
}) : e.filters.map((e, n) => Ae(e) ? /* @__PURE__ */ W(Ee, {
|
|
841
841
|
filter: e,
|
|
842
842
|
schema: t,
|
|
843
|
-
onUpdate: (e) =>
|
|
844
|
-
onRemove: () =>
|
|
845
|
-
}, `filter-${n}`) :
|
|
843
|
+
onUpdate: (e) => f(n, e),
|
|
844
|
+
onRemove: () => p(n)
|
|
845
|
+
}, `filter-${n}`) : je(e) ? /* @__PURE__ */ W(Me, {
|
|
846
846
|
group: e,
|
|
847
847
|
schema: t,
|
|
848
|
-
onUpdate: (e) =>
|
|
849
|
-
onRemove: () =>
|
|
850
|
-
onAddFilter:
|
|
848
|
+
onUpdate: (e) => f(n, e),
|
|
849
|
+
onRemove: () => p(n),
|
|
850
|
+
onAddFilter: g(n),
|
|
851
851
|
depth: a + 1
|
|
852
852
|
}, `group-${n}`) : null)
|
|
853
853
|
})]
|
|
@@ -855,28 +855,28 @@ function je({ group: e, schema: t, onUpdate: n, onRemove: r, onAddFilter: i, dep
|
|
|
855
855
|
}
|
|
856
856
|
//#endregion
|
|
857
857
|
//#region src/client/components/AnalysisBuilder/AnalysisFilterSection.tsx
|
|
858
|
-
var
|
|
859
|
-
function
|
|
858
|
+
var Ne = s("add");
|
|
859
|
+
function Pe(e) {
|
|
860
860
|
return "member" in e && typeof e.member == "string";
|
|
861
861
|
}
|
|
862
|
-
function
|
|
862
|
+
function Fe(e) {
|
|
863
863
|
return "type" in e && (e.type === "and" || e.type === "or");
|
|
864
864
|
}
|
|
865
|
-
function
|
|
865
|
+
function Ie(e) {
|
|
866
866
|
let t = 0;
|
|
867
|
-
for (let n of e)
|
|
867
|
+
for (let n of e) Pe(n) ? t++ : Fe(n) && (t += Ie(n.filters));
|
|
868
868
|
return t;
|
|
869
869
|
}
|
|
870
|
-
function
|
|
870
|
+
function Le(e) {
|
|
871
871
|
let t = [];
|
|
872
|
-
for (let n of e)
|
|
872
|
+
for (let n of e) Pe(n) ? t.push(n.member) : Fe(n) && t.push(...Le(n.filters));
|
|
873
873
|
return t;
|
|
874
874
|
}
|
|
875
|
-
function
|
|
876
|
-
if (t.length === 0) return e.length === 0 ? [n] : e.length === 1 &&
|
|
875
|
+
function Re(e, t, n) {
|
|
876
|
+
if (t.length === 0) return e.length === 0 ? [n] : e.length === 1 && Pe(e[0]) ? [{
|
|
877
877
|
type: "and",
|
|
878
878
|
filters: [e[0], n]
|
|
879
|
-
}] : e.length === 1 &&
|
|
879
|
+
}] : e.length === 1 && Fe(e[0]) ? [{
|
|
880
880
|
...e[0],
|
|
881
881
|
filters: [...e[0].filters, n]
|
|
882
882
|
}] : [{
|
|
@@ -884,38 +884,38 @@ function Le(e, t, n) {
|
|
|
884
884
|
filters: [...e, n]
|
|
885
885
|
}];
|
|
886
886
|
let [r, ...i] = t, a = [...e], o = a[r];
|
|
887
|
-
return
|
|
887
|
+
return Fe(o) && (i.length === 0 ? a[r] = {
|
|
888
888
|
...o,
|
|
889
889
|
filters: [...o.filters, n]
|
|
890
890
|
} : a[r] = {
|
|
891
891
|
...o,
|
|
892
|
-
filters:
|
|
892
|
+
filters: Re(o.filters, i, n)
|
|
893
893
|
}), a;
|
|
894
894
|
}
|
|
895
|
-
function
|
|
896
|
-
let
|
|
897
|
-
e.preventDefault(), e.stopPropagation(),
|
|
898
|
-
}, []),
|
|
899
|
-
e.preventDefault(), e.stopPropagation(),
|
|
900
|
-
}, []),
|
|
901
|
-
e.preventDefault(), e.stopPropagation(),
|
|
895
|
+
function ze({ filters: e, schema: t, onFiltersChange: n, onFieldDropped: r, dimensionsOnly: i = !1 }) {
|
|
896
|
+
let { t: a } = T(), [o, s] = H(!1), [c, l] = H(!1), d = V([]), f = Ie(e), p = R((e) => {
|
|
897
|
+
e.preventDefault(), e.stopPropagation(), l(!0);
|
|
898
|
+
}, []), m = R((e) => {
|
|
899
|
+
e.preventDefault(), e.stopPropagation(), l(!1);
|
|
900
|
+
}, []), h = R((e) => {
|
|
901
|
+
e.preventDefault(), e.stopPropagation(), l(!1);
|
|
902
902
|
try {
|
|
903
903
|
let t = JSON.parse(e.dataTransfer.getData("text/plain"));
|
|
904
904
|
t.field && r && r(t.field);
|
|
905
905
|
} catch {}
|
|
906
|
-
}, [r]),
|
|
907
|
-
let a = t.type === "time",
|
|
906
|
+
}, [r]), g = Le(e), _ = R((t, r, i) => {
|
|
907
|
+
let a = t.type === "time", o = a ? "inDateRange" : "equals", c = {
|
|
908
908
|
member: t.name,
|
|
909
|
-
operator:
|
|
909
|
+
operator: o,
|
|
910
910
|
values: []
|
|
911
911
|
};
|
|
912
|
-
a &&
|
|
913
|
-
}, [e, n]),
|
|
912
|
+
a && o === "inDateRange" && (c.dateRange = u("this_month")), n(Re(e, d.current, c)), s(!1), d.current = [];
|
|
913
|
+
}, [e, n]), v = R((t, r) => {
|
|
914
914
|
let i = [...e];
|
|
915
915
|
i[t] = r, n(i);
|
|
916
|
-
}, [e, n]),
|
|
916
|
+
}, [e, n]), y = R((t) => {
|
|
917
917
|
let r = e.filter((e, n) => n !== t);
|
|
918
|
-
if (r.length === 1 &&
|
|
918
|
+
if (r.length === 1 && Fe(r[0])) {
|
|
919
919
|
let e = r[0];
|
|
920
920
|
if (e.filters.length === 1) {
|
|
921
921
|
n([e.filters[0]]);
|
|
@@ -923,100 +923,100 @@ function Re({ filters: e, schema: t, onFiltersChange: n, onFieldDropped: r, dime
|
|
|
923
923
|
}
|
|
924
924
|
}
|
|
925
925
|
n(r);
|
|
926
|
-
}, [e, n]),
|
|
926
|
+
}, [e, n]), b = R(() => {
|
|
927
927
|
n([]);
|
|
928
|
-
}, [n]),
|
|
929
|
-
|
|
930
|
-
}, []),
|
|
931
|
-
|
|
932
|
-
}, []),
|
|
928
|
+
}, [n]), x = R(() => {
|
|
929
|
+
d.current = [], s(!0);
|
|
930
|
+
}, []), S = R((e) => (t = []) => {
|
|
931
|
+
d.current = [...e, ...t], s(!0);
|
|
932
|
+
}, []), C = (n, r, i = []) => {
|
|
933
933
|
let a = [...i, r];
|
|
934
|
-
return
|
|
934
|
+
return Pe(n) ? /* @__PURE__ */ W(Ee, {
|
|
935
935
|
filter: n,
|
|
936
936
|
schema: t,
|
|
937
|
-
onUpdate: (e) =>
|
|
938
|
-
onRemove: () =>
|
|
939
|
-
}, `filter-${a.join("-")}`) :
|
|
937
|
+
onUpdate: (e) => v(r, e),
|
|
938
|
+
onRemove: () => y(r)
|
|
939
|
+
}, `filter-${a.join("-")}`) : Fe(n) ? /* @__PURE__ */ W(Me, {
|
|
940
940
|
group: n,
|
|
941
941
|
schema: t,
|
|
942
|
-
onUpdate: (e) =>
|
|
943
|
-
onRemove: () =>
|
|
944
|
-
onAddFilter:
|
|
942
|
+
onUpdate: (e) => v(r, e),
|
|
943
|
+
onRemove: () => y(r),
|
|
944
|
+
onAddFilter: S(a),
|
|
945
945
|
hideRemoveButton: e.length === 1
|
|
946
946
|
}, `group-${a.join("-")}`) : null;
|
|
947
947
|
};
|
|
948
|
-
return /* @__PURE__ */
|
|
949
|
-
/* @__PURE__ */
|
|
950
|
-
onClick:
|
|
948
|
+
return /* @__PURE__ */ G("div", { children: [
|
|
949
|
+
/* @__PURE__ */ G("button", {
|
|
950
|
+
onClick: x,
|
|
951
951
|
className: "dc:flex dc:items-center dc:justify-between dc:mb-3 dc:w-full dc:py-1 dc:px-2 dc:-ml-2 dc:rounded-lg hover:bg-dc-primary/10 dc:transition-colors dc:group",
|
|
952
952
|
title: "Add filter",
|
|
953
|
-
children: [/* @__PURE__ */
|
|
953
|
+
children: [/* @__PURE__ */ G(ce, { children: [a("analysis.sections.filters"), f > 0 && /* @__PURE__ */ G("span", {
|
|
954
954
|
className: "dc:ml-1.5 dc:text-xs dc:font-normal text-dc-text-muted dc:normal-case dc:tracking-normal",
|
|
955
955
|
children: [
|
|
956
956
|
"(",
|
|
957
|
-
|
|
957
|
+
f,
|
|
958
958
|
")"
|
|
959
959
|
]
|
|
960
|
-
})] }), /* @__PURE__ */
|
|
960
|
+
})] }), /* @__PURE__ */ G("div", {
|
|
961
961
|
className: "dc:flex dc:items-center dc:gap-2",
|
|
962
|
-
children: [
|
|
962
|
+
children: [f > 0 && /* @__PURE__ */ W("span", {
|
|
963
963
|
role: "button",
|
|
964
964
|
tabIndex: 0,
|
|
965
965
|
onClick: (e) => {
|
|
966
|
-
e.stopPropagation(),
|
|
966
|
+
e.stopPropagation(), b();
|
|
967
967
|
},
|
|
968
968
|
onKeyDown: (e) => {
|
|
969
|
-
(e.key === "Enter" || e.key === " ") && (e.stopPropagation(),
|
|
969
|
+
(e.key === "Enter" || e.key === " ") && (e.stopPropagation(), b());
|
|
970
970
|
},
|
|
971
971
|
className: "dc:text-xs text-dc-text-muted hover:text-dc-error dc:underline dc:cursor-pointer",
|
|
972
|
-
children: "
|
|
973
|
-
}), /* @__PURE__ */
|
|
972
|
+
children: a("filter.section.clearAll")
|
|
973
|
+
}), /* @__PURE__ */ W(Ne, { className: "dc:w-5 dc:h-5 text-dc-text-secondary group-hover:text-dc-primary dc:transition-colors" })]
|
|
974
974
|
})]
|
|
975
975
|
}),
|
|
976
|
-
/* @__PURE__ */
|
|
977
|
-
onDragOver: r ?
|
|
978
|
-
onDragLeave: r ?
|
|
979
|
-
onDrop: r ?
|
|
980
|
-
className: `dc:p-2 dc:-mx-2 dc:rounded-lg dc:border-2 dc:border-dashed dc:transition-all ${
|
|
981
|
-
children: e.length === 0 ? /* @__PURE__ */
|
|
982
|
-
className: `dc:text-sm ${
|
|
983
|
-
children:
|
|
984
|
-
}) : /* @__PURE__ */
|
|
976
|
+
/* @__PURE__ */ W("div", {
|
|
977
|
+
onDragOver: r ? p : void 0,
|
|
978
|
+
onDragLeave: r ? m : void 0,
|
|
979
|
+
onDrop: r ? h : void 0,
|
|
980
|
+
className: `dc:p-2 dc:-mx-2 dc:rounded-lg dc:border-2 dc:border-dashed dc:transition-all ${c ? "border-dc-primary bg-dc-primary/5" : "border-transparent"}`,
|
|
981
|
+
children: e.length === 0 ? /* @__PURE__ */ W("p", {
|
|
982
|
+
className: `dc:text-sm ${c ? "text-dc-primary dc:font-medium" : "text-dc-text-muted"}`,
|
|
983
|
+
children: a(c ? "filter.section.dropHint" : "filter.section.empty")
|
|
984
|
+
}) : /* @__PURE__ */ W("div", {
|
|
985
985
|
className: "dc:flex dc:flex-wrap dc:gap-2",
|
|
986
|
-
children: e.map((e, t) =>
|
|
986
|
+
children: e.map((e, t) => C(e, t))
|
|
987
987
|
})
|
|
988
988
|
}),
|
|
989
|
-
/* @__PURE__ */
|
|
990
|
-
isOpen:
|
|
989
|
+
/* @__PURE__ */ W(se, {
|
|
990
|
+
isOpen: o,
|
|
991
991
|
onClose: () => {
|
|
992
|
-
|
|
992
|
+
s(!1), d.current = [];
|
|
993
993
|
},
|
|
994
|
-
onSelect:
|
|
994
|
+
onSelect: _,
|
|
995
995
|
mode: i ? "dimensionFilter" : "filter",
|
|
996
996
|
schema: t,
|
|
997
|
-
selectedFields:
|
|
997
|
+
selectedFields: g
|
|
998
998
|
})
|
|
999
999
|
] });
|
|
1000
1000
|
}
|
|
1001
1001
|
//#endregion
|
|
1002
1002
|
//#region src/client/shared/chartDefaults.ts
|
|
1003
|
-
function ze(e) {
|
|
1004
|
-
return e.isTimeDimension;
|
|
1005
|
-
}
|
|
1006
1003
|
function Be(e) {
|
|
1007
|
-
return e.
|
|
1004
|
+
return e.isTimeDimension;
|
|
1008
1005
|
}
|
|
1009
1006
|
function Ve(e) {
|
|
1010
|
-
return e.find(
|
|
1007
|
+
return e.find(Be);
|
|
1011
1008
|
}
|
|
1012
1009
|
function He(e) {
|
|
1013
|
-
return e.
|
|
1010
|
+
return e.find((e) => !e.isTimeDimension);
|
|
1014
1011
|
}
|
|
1015
1012
|
function Ue(e) {
|
|
1016
|
-
return e.filter(
|
|
1013
|
+
return e.filter((e) => !e.isTimeDimension);
|
|
1014
|
+
}
|
|
1015
|
+
function We(e) {
|
|
1016
|
+
return e.filter(Be);
|
|
1017
1017
|
}
|
|
1018
|
-
function
|
|
1019
|
-
let r = t.length, i =
|
|
1018
|
+
function Ge(e, t, n) {
|
|
1019
|
+
let r = t.length, i = Ue(n).length, a = We(n).length, o = n.length;
|
|
1020
1020
|
switch (e) {
|
|
1021
1021
|
case "table":
|
|
1022
1022
|
case "markdown": return { available: !0 };
|
|
@@ -1099,25 +1099,25 @@ function We(e, t, n) {
|
|
|
1099
1099
|
default: return { available: !0 };
|
|
1100
1100
|
}
|
|
1101
1101
|
}
|
|
1102
|
-
function
|
|
1102
|
+
function Ke(e, t) {
|
|
1103
1103
|
let n = Object.keys(l), r = {};
|
|
1104
|
-
for (let i of n) r[i] =
|
|
1104
|
+
for (let i of n) r[i] = Ge(i, e, t);
|
|
1105
1105
|
return r;
|
|
1106
1106
|
}
|
|
1107
|
-
function
|
|
1108
|
-
if (
|
|
1109
|
-
let r =
|
|
1107
|
+
function qe(e, t, n) {
|
|
1108
|
+
if (Ge(n, e, t).available || e.length === 0 && t.length === 0) return n;
|
|
1109
|
+
let r = We(t).length > 0, i = Ue(t).length > 0, a = e.length > 0;
|
|
1110
1110
|
return r && a ? "line" : i && a ? "bar" : a && !i && !r ? "kpiNumber" : "table";
|
|
1111
1111
|
}
|
|
1112
|
-
function
|
|
1113
|
-
let r =
|
|
1112
|
+
function Je(e, t, n) {
|
|
1113
|
+
let r = qe(e, t, n);
|
|
1114
1114
|
return {
|
|
1115
1115
|
chartType: r,
|
|
1116
|
-
chartConfig:
|
|
1116
|
+
chartConfig: Ye(r, e, t)
|
|
1117
1117
|
};
|
|
1118
1118
|
}
|
|
1119
|
-
function
|
|
1120
|
-
let r =
|
|
1119
|
+
function Ye(e, t, n) {
|
|
1120
|
+
let r = Ve(n), i = He(n), a = Ue(n), o = n;
|
|
1121
1121
|
switch (e) {
|
|
1122
1122
|
case "line":
|
|
1123
1123
|
case "area": return {
|
|
@@ -1170,190 +1170,185 @@ function Je(e, t, n) {
|
|
|
1170
1170
|
};
|
|
1171
1171
|
}
|
|
1172
1172
|
}
|
|
1173
|
-
function
|
|
1174
|
-
if (r &&
|
|
1175
|
-
let i =
|
|
1173
|
+
function Xe(e, t, n, r) {
|
|
1174
|
+
if (r && Ge(n, e, t).available) return null;
|
|
1175
|
+
let i = qe(e, t, n);
|
|
1176
1176
|
return i === n ? null : i;
|
|
1177
1177
|
}
|
|
1178
1178
|
//#endregion
|
|
1179
1179
|
//#region src/client/components/AnalysisBuilder/ExplainAIPanel.tsx
|
|
1180
|
-
function
|
|
1180
|
+
function Ze(e) {
|
|
1181
1181
|
return typeof e == "string" ? e : typeof e == "object" && e ? JSON.stringify(e) : String(e ?? "");
|
|
1182
1182
|
}
|
|
1183
|
-
var
|
|
1183
|
+
var Qe = {
|
|
1184
1184
|
good: "bg-dc-success-bg text-dc-success border-dc-success",
|
|
1185
1185
|
warning: "bg-dc-warning-bg text-dc-warning border-dc-warning",
|
|
1186
1186
|
critical: "bg-dc-danger-bg text-dc-error border-dc-error"
|
|
1187
|
-
},
|
|
1187
|
+
}, $e = {
|
|
1188
1188
|
critical: "bg-dc-danger-bg text-dc-error",
|
|
1189
1189
|
warning: "bg-dc-warning-bg text-dc-warning",
|
|
1190
1190
|
suggestion: "bg-dc-accent-bg text-dc-accent"
|
|
1191
|
-
},
|
|
1191
|
+
}, et = {
|
|
1192
1192
|
high: "text-dc-error",
|
|
1193
1193
|
medium: "text-dc-warning",
|
|
1194
1194
|
low: "text-dc-text-muted"
|
|
1195
1195
|
};
|
|
1196
|
-
function
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1196
|
+
function tt({ assessment: e, reason: t }) {
|
|
1197
|
+
let { t: n } = T(), r = {
|
|
1198
|
+
good: n("explainAI.assessment.good"),
|
|
1199
|
+
warning: n("explainAI.assessment.warning"),
|
|
1200
|
+
critical: n("explainAI.assessment.critical")
|
|
1201
|
+
};
|
|
1202
|
+
return /* @__PURE__ */ G("div", {
|
|
1203
|
+
className: `dc:p-4 dc:rounded-lg dc:border ${Qe[e]}`,
|
|
1204
|
+
children: [/* @__PURE__ */ W("div", {
|
|
1200
1205
|
className: "dc:flex dc:items-center dc:gap-2 dc:mb-1",
|
|
1201
|
-
children: /* @__PURE__ */
|
|
1206
|
+
children: /* @__PURE__ */ G("span", {
|
|
1202
1207
|
className: "dc:font-semibold dc:uppercase dc:text-base",
|
|
1203
1208
|
children: [
|
|
1204
1209
|
e === "good" && "✓ ",
|
|
1205
1210
|
e === "warning" && "⚠ ",
|
|
1206
1211
|
e === "critical" && "✕ ",
|
|
1207
|
-
|
|
1208
|
-
good: "Good",
|
|
1209
|
-
warning: "Warning",
|
|
1210
|
-
critical: "Critical"
|
|
1211
|
-
}[e]
|
|
1212
|
+
r[e]
|
|
1212
1213
|
]
|
|
1213
1214
|
})
|
|
1214
|
-
}), /* @__PURE__ */
|
|
1215
|
+
}), /* @__PURE__ */ W("p", {
|
|
1215
1216
|
className: "dc:text-sm",
|
|
1216
|
-
children:
|
|
1217
|
+
children: Ze(t)
|
|
1217
1218
|
})]
|
|
1218
1219
|
});
|
|
1219
1220
|
}
|
|
1220
|
-
function
|
|
1221
|
-
return /* @__PURE__ */
|
|
1221
|
+
function nt({ issue: e }) {
|
|
1222
|
+
return /* @__PURE__ */ G("div", {
|
|
1222
1223
|
className: "dc:flex dc:items-start dc:gap-2 dc:py-2",
|
|
1223
|
-
children: [/* @__PURE__ */
|
|
1224
|
-
className: `dc:text-sm ${
|
|
1224
|
+
children: [/* @__PURE__ */ G("span", {
|
|
1225
|
+
className: `dc:text-sm ${et[e.severity]}`,
|
|
1225
1226
|
children: [
|
|
1226
1227
|
e.severity === "high" && "●",
|
|
1227
1228
|
e.severity === "medium" && "○",
|
|
1228
1229
|
e.severity === "low" && "○"
|
|
1229
1230
|
]
|
|
1230
|
-
}), /* @__PURE__ */
|
|
1231
|
+
}), /* @__PURE__ */ W("span", {
|
|
1231
1232
|
className: "dc:text-sm text-dc-text-secondary",
|
|
1232
|
-
children:
|
|
1233
|
+
children: Ze(e.description)
|
|
1233
1234
|
})]
|
|
1234
1235
|
});
|
|
1235
1236
|
}
|
|
1236
|
-
function
|
|
1237
|
-
let
|
|
1238
|
-
return
|
|
1239
|
-
|
|
1240
|
-
}, []), /* @__PURE__ */
|
|
1237
|
+
function rt({ text: e }) {
|
|
1238
|
+
let { t } = T(), [n, r] = I.useState(!1), i = I.useRef(null);
|
|
1239
|
+
return I.useEffect(() => () => {
|
|
1240
|
+
i.current && clearTimeout(i.current);
|
|
1241
|
+
}, []), /* @__PURE__ */ W("button", {
|
|
1241
1242
|
onClick: async () => {
|
|
1242
1243
|
try {
|
|
1243
|
-
await navigator.clipboard.writeText(e),
|
|
1244
|
+
await navigator.clipboard.writeText(e), r(!0), i.current && clearTimeout(i.current), i.current = setTimeout(() => r(!1), 2e3);
|
|
1244
1245
|
} catch (e) {
|
|
1245
1246
|
console.error("Failed to copy:", e);
|
|
1246
1247
|
}
|
|
1247
1248
|
},
|
|
1248
1249
|
className: "dc:px-2 dc:py-1 dc:text-xs dc:rounded bg-dc-surface hover:bg-dc-surface-hover text-dc-text-muted",
|
|
1249
1250
|
title: "Copy to clipboard",
|
|
1250
|
-
children: t ? "
|
|
1251
|
+
children: t(n ? "explainAI.copied" : "explainAI.copy")
|
|
1251
1252
|
});
|
|
1252
1253
|
}
|
|
1253
|
-
function
|
|
1254
|
-
|
|
1254
|
+
function it({ rec: e }) {
|
|
1255
|
+
let { t } = T(), n = {
|
|
1256
|
+
index: t("explainAI.type.index"),
|
|
1257
|
+
table: t("explainAI.type.table"),
|
|
1258
|
+
cube: t("explainAI.type.cube"),
|
|
1259
|
+
general: t("explainAI.type.general")
|
|
1260
|
+
};
|
|
1261
|
+
return /* @__PURE__ */ G("div", {
|
|
1255
1262
|
className: "dc:p-4 dc:border border-dc-border dc:rounded-lg bg-dc-surface",
|
|
1256
1263
|
children: [
|
|
1257
|
-
/* @__PURE__ */
|
|
1264
|
+
/* @__PURE__ */ G("div", {
|
|
1258
1265
|
className: "dc:flex dc:items-center dc:gap-2 dc:mb-2",
|
|
1259
|
-
children: [/* @__PURE__ */
|
|
1260
|
-
className: `dc:px-2 dc:py-0.5 dc:text-xs dc:font-medium dc:rounded ${
|
|
1261
|
-
children:
|
|
1262
|
-
|
|
1263
|
-
table: "TABLE",
|
|
1264
|
-
cube: "CUBE",
|
|
1265
|
-
general: "TIP"
|
|
1266
|
-
}[e.type]
|
|
1267
|
-
}), /* @__PURE__ */ U("h5", {
|
|
1266
|
+
children: [/* @__PURE__ */ W("span", {
|
|
1267
|
+
className: `dc:px-2 dc:py-0.5 dc:text-xs dc:font-medium dc:rounded ${$e[e.severity]}`,
|
|
1268
|
+
children: n[e.type]
|
|
1269
|
+
}), /* @__PURE__ */ W("h5", {
|
|
1268
1270
|
className: "dc:font-medium text-dc-text",
|
|
1269
|
-
children:
|
|
1271
|
+
children: Ze(e.title)
|
|
1270
1272
|
})]
|
|
1271
1273
|
}),
|
|
1272
|
-
/* @__PURE__ */
|
|
1274
|
+
/* @__PURE__ */ W("p", {
|
|
1273
1275
|
className: "dc:text-sm text-dc-text-secondary dc:mb-3",
|
|
1274
|
-
children:
|
|
1276
|
+
children: Ze(e.description)
|
|
1275
1277
|
}),
|
|
1276
|
-
e.sql && /* @__PURE__ */
|
|
1278
|
+
e.sql && /* @__PURE__ */ W("div", {
|
|
1277
1279
|
className: "dc:mt-2",
|
|
1278
|
-
children: /* @__PURE__ */
|
|
1280
|
+
children: /* @__PURE__ */ W(re, {
|
|
1279
1281
|
code: e.sql,
|
|
1280
1282
|
language: "sql",
|
|
1281
|
-
headerRight: /* @__PURE__ */
|
|
1283
|
+
headerRight: /* @__PURE__ */ W(rt, { text: e.sql })
|
|
1282
1284
|
})
|
|
1283
1285
|
}),
|
|
1284
|
-
e.cubeCode && /* @__PURE__ */
|
|
1286
|
+
e.cubeCode && /* @__PURE__ */ G("div", {
|
|
1285
1287
|
className: "dc:mt-2",
|
|
1286
1288
|
children: [e.cubeName && /* @__PURE__ */ W("p", {
|
|
1287
1289
|
className: "dc:text-xs text-dc-text-muted dc:mb-1",
|
|
1288
|
-
children:
|
|
1289
|
-
|
|
1290
|
-
/* @__PURE__ */ U("code", {
|
|
1291
|
-
className: "bg-dc-surface-secondary dc:px-1 dc:rounded",
|
|
1292
|
-
children: e.cubeName
|
|
1293
|
-
}),
|
|
1294
|
-
" cube:"
|
|
1295
|
-
]
|
|
1296
|
-
}), /* @__PURE__ */ W("div", {
|
|
1290
|
+
children: t("explainAI.addToCube", { cubeName: e.cubeName })
|
|
1291
|
+
}), /* @__PURE__ */ G("div", {
|
|
1297
1292
|
className: "dc:relative",
|
|
1298
|
-
children: [/* @__PURE__ */
|
|
1293
|
+
children: [/* @__PURE__ */ W("pre", {
|
|
1299
1294
|
className: "dc:p-3 dc:text-xs bg-dc-surface-secondary dc:rounded dc:overflow-x-auto dc:font-mono text-dc-text",
|
|
1300
1295
|
children: e.cubeCode
|
|
1301
|
-
}), /* @__PURE__ */
|
|
1296
|
+
}), /* @__PURE__ */ W("div", {
|
|
1302
1297
|
className: "dc:absolute dc:top-1 dc:right-1",
|
|
1303
|
-
children: /* @__PURE__ */
|
|
1298
|
+
children: /* @__PURE__ */ W(rt, { text: e.cubeCode })
|
|
1304
1299
|
})]
|
|
1305
1300
|
})]
|
|
1306
1301
|
}),
|
|
1307
|
-
e.estimatedImpact && /* @__PURE__ */
|
|
1302
|
+
e.estimatedImpact && /* @__PURE__ */ G("p", {
|
|
1308
1303
|
className: "dc:text-xs text-dc-text-muted dc:mt-2",
|
|
1309
1304
|
children: [
|
|
1310
|
-
/* @__PURE__ */
|
|
1305
|
+
/* @__PURE__ */ W("strong", { children: t("explainAI.expectedImpact") }),
|
|
1311
1306
|
" ",
|
|
1312
|
-
|
|
1307
|
+
Ze(e.estimatedImpact)
|
|
1313
1308
|
]
|
|
1314
1309
|
})
|
|
1315
1310
|
]
|
|
1316
1311
|
});
|
|
1317
1312
|
}
|
|
1318
|
-
function
|
|
1319
|
-
let r = t || n;
|
|
1320
|
-
return
|
|
1313
|
+
function at({ analysis: e, onClose: t, onClear: n }) {
|
|
1314
|
+
let { t: r } = T(), i = t || n;
|
|
1315
|
+
return I.useEffect(() => {
|
|
1321
1316
|
let e = (e) => {
|
|
1322
|
-
e.key === "Escape" &&
|
|
1317
|
+
e.key === "Escape" && i && i();
|
|
1323
1318
|
};
|
|
1324
1319
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1325
|
-
}, [
|
|
1320
|
+
}, [i]), I.useEffect(() => (document.body.style.overflow = "hidden", () => {
|
|
1326
1321
|
document.body.style.overflow = "";
|
|
1327
|
-
}), []), /* @__PURE__ */
|
|
1322
|
+
}), []), /* @__PURE__ */ G("div", {
|
|
1328
1323
|
className: "dc:fixed dc:inset-0 dc:z-50 dc:flex dc:items-center dc:justify-center dc:p-4 bg-black/50",
|
|
1329
|
-
children: [/* @__PURE__ */
|
|
1324
|
+
children: [/* @__PURE__ */ W("div", {
|
|
1330
1325
|
className: "dc:absolute dc:inset-0",
|
|
1331
|
-
onClick:
|
|
1326
|
+
onClick: i,
|
|
1332
1327
|
"aria-hidden": "true"
|
|
1333
|
-
}), /* @__PURE__ */
|
|
1328
|
+
}), /* @__PURE__ */ G("div", {
|
|
1334
1329
|
className: "dc:relative dc:w-full dc:max-w-4xl dc:max-h-[90vh] bg-dc-surface dc:rounded-lg dc:shadow-xl dc:flex dc:flex-col",
|
|
1335
1330
|
children: [
|
|
1336
|
-
/* @__PURE__ */
|
|
1331
|
+
/* @__PURE__ */ G("div", {
|
|
1337
1332
|
className: "dc:flex dc:items-center dc:justify-between dc:px-6 dc:py-4 dc:border-b border-dc-border dc:flex-shrink-0",
|
|
1338
|
-
children: [/* @__PURE__ */
|
|
1333
|
+
children: [/* @__PURE__ */ G("div", {
|
|
1339
1334
|
className: "dc:flex dc:items-center dc:gap-3",
|
|
1340
|
-
children: [/* @__PURE__ */
|
|
1335
|
+
children: [/* @__PURE__ */ W("span", {
|
|
1341
1336
|
className: "dc:text-lg",
|
|
1342
1337
|
children: "✨"
|
|
1343
|
-
}), /* @__PURE__ */
|
|
1338
|
+
}), /* @__PURE__ */ W("h3", {
|
|
1344
1339
|
className: "dc:text-lg dc:font-semibold text-dc-text",
|
|
1345
|
-
children: "
|
|
1340
|
+
children: r("explainAI.title")
|
|
1346
1341
|
})]
|
|
1347
|
-
}), /* @__PURE__ */
|
|
1348
|
-
onClick:
|
|
1342
|
+
}), /* @__PURE__ */ W("button", {
|
|
1343
|
+
onClick: i,
|
|
1349
1344
|
className: "dc:p-2 dc:rounded-lg hover:bg-dc-surface-hover text-dc-text-secondary hover:text-dc-text dc:transition-colors",
|
|
1350
1345
|
"aria-label": "Close",
|
|
1351
|
-
children: /* @__PURE__ */
|
|
1346
|
+
children: /* @__PURE__ */ W("svg", {
|
|
1352
1347
|
className: "dc:w-5 dc:h-5",
|
|
1353
1348
|
fill: "none",
|
|
1354
1349
|
stroke: "currentColor",
|
|
1355
1350
|
viewBox: "0 0 24 24",
|
|
1356
|
-
children: /* @__PURE__ */
|
|
1351
|
+
children: /* @__PURE__ */ W("path", {
|
|
1357
1352
|
strokeLinecap: "round",
|
|
1358
1353
|
strokeLinejoin: "round",
|
|
1359
1354
|
strokeWidth: 2,
|
|
@@ -1362,68 +1357,61 @@ function it({ analysis: e, onClose: t, onClear: n }) {
|
|
|
1362
1357
|
})
|
|
1363
1358
|
})]
|
|
1364
1359
|
}),
|
|
1365
|
-
/* @__PURE__ */
|
|
1360
|
+
/* @__PURE__ */ G("div", {
|
|
1366
1361
|
className: "dc:flex-1 dc:overflow-y-auto dc:px-6 dc:py-4 dc:space-y-6",
|
|
1367
1362
|
children: [
|
|
1368
|
-
/* @__PURE__ */
|
|
1363
|
+
/* @__PURE__ */ W(tt, {
|
|
1369
1364
|
assessment: e.assessment,
|
|
1370
1365
|
reason: e.assessmentReason
|
|
1371
1366
|
}),
|
|
1372
|
-
/* @__PURE__ */
|
|
1367
|
+
/* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("h4", {
|
|
1373
1368
|
className: "dc:text-sm dc:font-semibold text-dc-text-muted dc:uppercase dc:mb-2",
|
|
1374
|
-
children: "
|
|
1375
|
-
}), /* @__PURE__ */
|
|
1369
|
+
children: r("explainAI.summary")
|
|
1370
|
+
}), /* @__PURE__ */ W("p", {
|
|
1376
1371
|
className: "text-dc-text",
|
|
1377
|
-
children:
|
|
1372
|
+
children: Ze(e.summary)
|
|
1378
1373
|
})] }),
|
|
1379
|
-
e.queryUnderstanding && /* @__PURE__ */
|
|
1374
|
+
e.queryUnderstanding && /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("h4", {
|
|
1380
1375
|
className: "dc:text-sm dc:font-semibold text-dc-text-muted dc:uppercase dc:mb-2",
|
|
1381
|
-
children: "
|
|
1382
|
-
}), /* @__PURE__ */
|
|
1376
|
+
children: r("explainAI.queryAnalysis")
|
|
1377
|
+
}), /* @__PURE__ */ W("p", {
|
|
1383
1378
|
className: "text-dc-text-secondary",
|
|
1384
|
-
children:
|
|
1379
|
+
children: Ze(e.queryUnderstanding)
|
|
1385
1380
|
})] }),
|
|
1386
|
-
e.issues && e.issues.length > 0 && /* @__PURE__ */
|
|
1381
|
+
e.issues && e.issues.length > 0 && /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("h4", {
|
|
1387
1382
|
className: "dc:text-sm dc:font-semibold text-dc-text-muted dc:uppercase dc:mb-2",
|
|
1388
|
-
children:
|
|
1389
|
-
|
|
1390
|
-
e.issues.length,
|
|
1391
|
-
")"
|
|
1392
|
-
]
|
|
1393
|
-
}), /* @__PURE__ */ U("div", {
|
|
1383
|
+
children: r("explainAI.issuesFound", { count: e.issues.length })
|
|
1384
|
+
}), /* @__PURE__ */ W("div", {
|
|
1394
1385
|
className: "dc:space-y-1 bg-dc-surface-secondary dc:rounded-lg dc:p-3",
|
|
1395
|
-
children: e.issues.map((e, t) => /* @__PURE__ */
|
|
1386
|
+
children: e.issues.map((e, t) => /* @__PURE__ */ W(nt, { issue: e }, t))
|
|
1396
1387
|
})] }),
|
|
1397
|
-
e.recommendations && e.recommendations.length > 0 && /* @__PURE__ */
|
|
1388
|
+
e.recommendations && e.recommendations.length > 0 && /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("h4", {
|
|
1398
1389
|
className: "dc:text-sm dc:font-semibold text-dc-text-muted dc:uppercase dc:mb-3",
|
|
1399
|
-
children:
|
|
1400
|
-
|
|
1401
|
-
e.recommendations.length,
|
|
1402
|
-
")"
|
|
1403
|
-
]
|
|
1404
|
-
}), /* @__PURE__ */ U("div", {
|
|
1390
|
+
children: r("explainAI.recommendations", { count: e.recommendations.length })
|
|
1391
|
+
}), /* @__PURE__ */ W("div", {
|
|
1405
1392
|
className: "dc:space-y-4",
|
|
1406
|
-
children: e.recommendations.map((e, t) => /* @__PURE__ */
|
|
1393
|
+
children: e.recommendations.map((e, t) => /* @__PURE__ */ W(it, { rec: e }, t))
|
|
1407
1394
|
})] }),
|
|
1408
|
-
(!e.recommendations || e.recommendations.length === 0) && /* @__PURE__ */
|
|
1395
|
+
(!e.recommendations || e.recommendations.length === 0) && /* @__PURE__ */ W("div", {
|
|
1409
1396
|
className: "text-dc-text-muted dc:italic dc:p-4 bg-dc-surface-secondary dc:rounded-lg",
|
|
1410
|
-
children: "
|
|
1397
|
+
children: r("explainAI.noRecommendations")
|
|
1411
1398
|
})
|
|
1412
1399
|
]
|
|
1413
1400
|
}),
|
|
1414
|
-
/* @__PURE__ */
|
|
1401
|
+
/* @__PURE__ */ G("div", {
|
|
1415
1402
|
className: "dc:flex dc:items-center dc:justify-between dc:px-6 dc:py-3 dc:border-t border-dc-border dc:flex-shrink-0 bg-dc-surface-secondary",
|
|
1416
|
-
children: [e._meta && /* @__PURE__ */
|
|
1403
|
+
children: [e._meta && /* @__PURE__ */ G("div", {
|
|
1417
1404
|
className: "dc:text-xs text-dc-text-muted",
|
|
1418
1405
|
children: [
|
|
1419
|
-
"
|
|
1406
|
+
r("explainAI.modelLabel"),
|
|
1407
|
+
" ",
|
|
1420
1408
|
e._meta.model,
|
|
1421
|
-
e._meta.usingUserKey &&
|
|
1409
|
+
e._meta.usingUserKey && ` ${r("explainAI.usingUserKey")}`
|
|
1422
1410
|
]
|
|
1423
|
-
}), /* @__PURE__ */
|
|
1424
|
-
onClick:
|
|
1411
|
+
}), /* @__PURE__ */ W("button", {
|
|
1412
|
+
onClick: i,
|
|
1425
1413
|
className: "dc:px-4 dc:py-2 dc:text-sm dc:font-medium dc:rounded-lg bg-dc-primary text-white hover:bg-dc-primary-hover dc:transition-colors",
|
|
1426
|
-
children: "
|
|
1414
|
+
children: r("common.actions.close")
|
|
1427
1415
|
})]
|
|
1428
1416
|
})
|
|
1429
1417
|
]
|
|
@@ -1432,158 +1420,141 @@ function it({ analysis: e, onClose: t, onClear: n }) {
|
|
|
1432
1420
|
}
|
|
1433
1421
|
//#endregion
|
|
1434
1422
|
//#region src/client/components/AnalysisBuilder/ExecutionPlanPanel.tsx
|
|
1435
|
-
var
|
|
1436
|
-
let
|
|
1437
|
-
f && i && h && (f(i, h),
|
|
1438
|
-
},
|
|
1439
|
-
|
|
1440
|
-
},
|
|
1423
|
+
var ot = L(function({ sql: e, sqlLoading: t = !1, sqlError: n, sqlPlaceholder: r = "Add metrics to generate SQL", explainResult: i, explainLoading: a = !1, explainHasRun: o = !1, explainError: s, runExplain: c, aiAnalysis: l, aiAnalysisLoading: u = !1, aiAnalysisError: d, runAIAnalysis: f, clearAIAnalysis: p, enableAI: m = !1, query: h, title: g = "Generated SQL", height: _ = "16rem" }) {
|
|
1424
|
+
let { t: v } = T(), [y, b] = H(!1), [x, S] = H(!1), C = e ? e.sql + (e.params && e.params.length > 0 ? "\n\n-- Parameters:\n" + JSON.stringify(e.params, null, 2) : "") : "", ee = () => {
|
|
1425
|
+
f && i && h && (f(i, h), S(!0));
|
|
1426
|
+
}, w = () => {
|
|
1427
|
+
S(!1);
|
|
1428
|
+
}, te = m && i ? /* @__PURE__ */ W("button", {
|
|
1441
1429
|
onClick: ee,
|
|
1442
1430
|
disabled: u,
|
|
1443
1431
|
className: "dc:px-2 dc:py-1 dc:text-xs dc:font-medium dc:rounded bg-dc-accent text-white hover:bg-dc-accent-hover dc:disabled:opacity-50 dc:disabled:cursor-not-allowed dc:flex dc:items-center dc:gap-1",
|
|
1444
|
-
children: u ? /* @__PURE__ */
|
|
1432
|
+
children: u ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("span", {
|
|
1445
1433
|
className: "dc:animate-spin",
|
|
1446
1434
|
children: "⟳"
|
|
1447
|
-
}), "
|
|
1435
|
+
}), v("debug.aiAnalyzing")] }) : /* @__PURE__ */ W(U, { children: `✨ ${v("debug.aiAnalysis")}` })
|
|
1448
1436
|
}) : null;
|
|
1449
|
-
return /* @__PURE__ */
|
|
1437
|
+
return /* @__PURE__ */ G("div", {
|
|
1450
1438
|
className: "dc:space-y-3",
|
|
1451
1439
|
children: [
|
|
1452
|
-
t ? /* @__PURE__ */
|
|
1440
|
+
t ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("h4", {
|
|
1453
1441
|
className: "dc:text-sm dc:font-semibold text-dc-text dc:mb-2",
|
|
1454
1442
|
children: g
|
|
1455
|
-
}), /* @__PURE__ */
|
|
1443
|
+
}), /* @__PURE__ */ W("div", {
|
|
1456
1444
|
className: "bg-dc-surface-secondary dc:border border-dc-border dc:rounded dc:p-3 text-dc-text-muted dc:text-sm dc:animate-pulse",
|
|
1457
1445
|
style: { height: _ },
|
|
1458
|
-
children: "
|
|
1459
|
-
})] }) : n ? /* @__PURE__ */
|
|
1446
|
+
children: v("results.debug.loadingSql")
|
|
1447
|
+
})] }) : n ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("h4", {
|
|
1460
1448
|
className: "dc:text-sm dc:font-semibold text-dc-text dc:mb-2",
|
|
1461
1449
|
children: g
|
|
1462
|
-
}), /* @__PURE__ */
|
|
1450
|
+
}), /* @__PURE__ */ W("div", {
|
|
1463
1451
|
className: "text-dc-error dc:text-sm bg-dc-danger-bg dc:p-3 dc:rounded dc:border border-dc-error",
|
|
1464
1452
|
style: { height: _ },
|
|
1465
1453
|
children: n.message
|
|
1466
|
-
})] }) : e ? /* @__PURE__ */
|
|
1467
|
-
code:
|
|
1454
|
+
})] }) : e ? /* @__PURE__ */ W(re, {
|
|
1455
|
+
code: C,
|
|
1468
1456
|
language: "sql",
|
|
1469
1457
|
title: g,
|
|
1470
1458
|
height: _,
|
|
1471
|
-
headerRight: /* @__PURE__ */
|
|
1459
|
+
headerRight: /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ G("label", {
|
|
1472
1460
|
className: "dc:flex dc:items-center dc:gap-1 dc:text-xs text-dc-text-secondary dc:cursor-pointer",
|
|
1473
|
-
children: [/* @__PURE__ */
|
|
1461
|
+
children: [/* @__PURE__ */ W("input", {
|
|
1474
1462
|
type: "checkbox",
|
|
1475
|
-
checked:
|
|
1476
|
-
onChange: (e) =>
|
|
1463
|
+
checked: y,
|
|
1464
|
+
onChange: (e) => b(e.target.checked),
|
|
1477
1465
|
className: "dc:w-3 dc:h-3 dc:rounded border-dc-border text-dc-accent focus:ring-dc-accent"
|
|
1478
|
-
}), "
|
|
1479
|
-
}), /* @__PURE__ */
|
|
1480
|
-
onClick: () => c({ analyze:
|
|
1466
|
+
}), v("debug.explainIncludeTiming")]
|
|
1467
|
+
}), /* @__PURE__ */ W("button", {
|
|
1468
|
+
onClick: () => c({ analyze: y }),
|
|
1481
1469
|
disabled: a,
|
|
1482
1470
|
className: "dc:px-2 dc:py-1 dc:text-xs dc:font-medium dc:rounded dc:border border-dc-border bg-dc-surface hover:bg-dc-surface-hover text-dc-text-secondary hover:text-dc-text dc:transition-colors dc:disabled:opacity-50 dc:disabled:cursor-not-allowed",
|
|
1483
|
-
children: a ? "
|
|
1471
|
+
children: v(a ? "debug.explainRunning" : "debug.explainPlan")
|
|
1484
1472
|
})] })
|
|
1485
|
-
}) : /* @__PURE__ */
|
|
1473
|
+
}) : /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("h4", {
|
|
1486
1474
|
className: "dc:text-sm dc:font-semibold text-dc-text dc:mb-2",
|
|
1487
1475
|
children: g
|
|
1488
|
-
}), /* @__PURE__ */
|
|
1476
|
+
}), /* @__PURE__ */ W("div", {
|
|
1489
1477
|
className: "bg-dc-surface-secondary dc:border border-dc-border dc:rounded dc:p-3 text-dc-text-muted dc:text-sm",
|
|
1490
1478
|
style: { height: _ },
|
|
1491
1479
|
children: r
|
|
1492
1480
|
})] }),
|
|
1493
|
-
o && /* @__PURE__ */
|
|
1481
|
+
o && /* @__PURE__ */ W("div", { children: a ? /* @__PURE__ */ W("div", {
|
|
1494
1482
|
className: "bg-dc-surface-secondary dc:border border-dc-border dc:rounded dc:p-3 text-dc-text-muted dc:text-sm dc:animate-pulse",
|
|
1495
|
-
children:
|
|
1496
|
-
|
|
1497
|
-
v ? " ANALYZE" : "",
|
|
1498
|
-
"..."
|
|
1499
|
-
]
|
|
1500
|
-
}) : s ? /* @__PURE__ */ W("div", {
|
|
1483
|
+
children: v(y ? "debug.explainRunningAnalyze" : "debug.explainRunningBasic")
|
|
1484
|
+
}) : s ? /* @__PURE__ */ G("div", {
|
|
1501
1485
|
className: "text-dc-error dc:text-sm bg-dc-danger-bg dc:p-3 dc:rounded dc:border border-dc-error",
|
|
1502
1486
|
children: [
|
|
1503
|
-
/* @__PURE__ */
|
|
1487
|
+
/* @__PURE__ */ W("strong", { children: v("debug.explainError") }),
|
|
1504
1488
|
" ",
|
|
1505
1489
|
s.message
|
|
1506
1490
|
]
|
|
1507
|
-
}) : i ? /* @__PURE__ */
|
|
1491
|
+
}) : i ? /* @__PURE__ */ G("div", {
|
|
1508
1492
|
className: "dc:space-y-3",
|
|
1509
1493
|
children: [
|
|
1510
|
-
/* @__PURE__ */
|
|
1494
|
+
/* @__PURE__ */ G("div", {
|
|
1511
1495
|
className: "dc:flex dc:flex-wrap dc:items-center dc:gap-2",
|
|
1512
1496
|
children: [
|
|
1513
|
-
/* @__PURE__ */
|
|
1497
|
+
/* @__PURE__ */ W("span", {
|
|
1514
1498
|
className: "dc:px-2 dc:py-1 dc:text-xs dc:font-medium bg-dc-accent text-white dc:rounded",
|
|
1515
1499
|
children: i.summary.database.toUpperCase()
|
|
1516
1500
|
}),
|
|
1517
|
-
i.summary.hasSequentialScans && /* @__PURE__ */
|
|
1501
|
+
i.summary.hasSequentialScans && /* @__PURE__ */ W("span", {
|
|
1518
1502
|
className: "dc:px-2 dc:py-1 dc:text-xs dc:font-medium bg-dc-warning-bg text-dc-warning dc:border border-dc-warning dc:rounded",
|
|
1519
|
-
children: "
|
|
1503
|
+
children: v("debug.sequentialScans")
|
|
1520
1504
|
}),
|
|
1521
1505
|
i.summary.usedIndexes.length > 0 && /* @__PURE__ */ W("span", {
|
|
1522
1506
|
className: "dc:px-2 dc:py-1 dc:text-xs dc:font-medium bg-dc-success-bg text-dc-success dc:border border-dc-success dc:rounded",
|
|
1523
|
-
children:
|
|
1524
|
-
i.summary.usedIndexes.length,
|
|
1525
|
-
" Index",
|
|
1526
|
-
i.summary.usedIndexes.length === 1 ? "" : "es",
|
|
1527
|
-
" Used"
|
|
1528
|
-
]
|
|
1507
|
+
children: v(i.summary.usedIndexes.length === 1 ? "debug.indexesUsed" : "debug.indexesUsedPlural", { count: i.summary.usedIndexes.length })
|
|
1529
1508
|
}),
|
|
1530
1509
|
i.summary.executionTime !== void 0 && /* @__PURE__ */ W("span", {
|
|
1531
1510
|
className: "dc:px-2 dc:py-1 dc:text-xs dc:font-medium bg-dc-surface-secondary text-dc-text-secondary dc:border border-dc-border dc:rounded",
|
|
1532
|
-
children:
|
|
1533
|
-
"Execution: ",
|
|
1534
|
-
i.summary.executionTime.toFixed(2),
|
|
1535
|
-
"ms"
|
|
1536
|
-
]
|
|
1511
|
+
children: v("debug.executionTime", { time: i.summary.executionTime.toFixed(2) })
|
|
1537
1512
|
}),
|
|
1538
1513
|
i.summary.planningTime !== void 0 && /* @__PURE__ */ W("span", {
|
|
1539
1514
|
className: "dc:px-2 dc:py-1 dc:text-xs dc:font-medium bg-dc-surface-secondary text-dc-text-secondary dc:border border-dc-border dc:rounded",
|
|
1540
|
-
children:
|
|
1541
|
-
"Planning: ",
|
|
1542
|
-
i.summary.planningTime.toFixed(2),
|
|
1543
|
-
"ms"
|
|
1544
|
-
]
|
|
1515
|
+
children: v("debug.planningTime", { time: i.summary.planningTime.toFixed(2) })
|
|
1545
1516
|
}),
|
|
1546
1517
|
i.summary.totalCost !== void 0 && /* @__PURE__ */ W("span", {
|
|
1547
1518
|
className: "dc:px-2 dc:py-1 dc:text-xs dc:font-medium bg-dc-surface-secondary text-dc-text-secondary dc:border border-dc-border dc:rounded",
|
|
1548
|
-
children:
|
|
1519
|
+
children: v("debug.cost", { cost: i.summary.totalCost.toFixed(2) })
|
|
1549
1520
|
})
|
|
1550
1521
|
]
|
|
1551
1522
|
}),
|
|
1552
|
-
i.summary.usedIndexes.length > 0 && /* @__PURE__ */
|
|
1523
|
+
i.summary.usedIndexes.length > 0 && /* @__PURE__ */ G("div", {
|
|
1553
1524
|
className: "dc:text-xs text-dc-text-muted",
|
|
1554
1525
|
children: [
|
|
1555
|
-
/* @__PURE__ */
|
|
1526
|
+
/* @__PURE__ */ W("strong", { children: v("debug.indexes") }),
|
|
1556
1527
|
" ",
|
|
1557
1528
|
i.summary.usedIndexes.join(", ")
|
|
1558
1529
|
]
|
|
1559
1530
|
}),
|
|
1560
|
-
/* @__PURE__ */
|
|
1531
|
+
/* @__PURE__ */ W(re, {
|
|
1561
1532
|
code: i.raw,
|
|
1562
1533
|
language: "sql",
|
|
1563
|
-
title:
|
|
1534
|
+
title: v("debug.executionPlanTitle", { database: i.summary.database }),
|
|
1564
1535
|
height: "16rem",
|
|
1565
|
-
headerRight:
|
|
1536
|
+
headerRight: te
|
|
1566
1537
|
})
|
|
1567
1538
|
]
|
|
1568
1539
|
}) : null }),
|
|
1569
|
-
d && /* @__PURE__ */
|
|
1540
|
+
d && /* @__PURE__ */ G("div", {
|
|
1570
1541
|
className: "text-dc-error dc:text-sm bg-dc-danger-bg dc:p-3 dc:rounded dc:border border-dc-error",
|
|
1571
1542
|
children: [
|
|
1572
|
-
/* @__PURE__ */
|
|
1543
|
+
/* @__PURE__ */ W("strong", { children: v("debug.aiAnalysisError") }),
|
|
1573
1544
|
" ",
|
|
1574
1545
|
d.message
|
|
1575
1546
|
]
|
|
1576
1547
|
}),
|
|
1577
|
-
|
|
1548
|
+
x && l && /* @__PURE__ */ W(at, {
|
|
1578
1549
|
analysis: l,
|
|
1579
|
-
onClose:
|
|
1550
|
+
onClose: w
|
|
1580
1551
|
})
|
|
1581
1552
|
]
|
|
1582
1553
|
});
|
|
1583
1554
|
});
|
|
1584
1555
|
//#endregion
|
|
1585
1556
|
//#region src/client/adapters/queryModeAdapter.ts
|
|
1586
|
-
function
|
|
1557
|
+
function st() {
|
|
1587
1558
|
return {
|
|
1588
1559
|
metrics: [],
|
|
1589
1560
|
breakdowns: [],
|
|
@@ -1594,10 +1565,10 @@ function ot() {
|
|
|
1594
1565
|
validationError: null
|
|
1595
1566
|
};
|
|
1596
1567
|
}
|
|
1597
|
-
function
|
|
1568
|
+
function ct(e) {
|
|
1598
1569
|
return e.map((e) => e.field);
|
|
1599
1570
|
}
|
|
1600
|
-
function
|
|
1571
|
+
function lt(e, t) {
|
|
1601
1572
|
let n = [], r = [];
|
|
1602
1573
|
for (let i of e) if (i.isTimeDimension) {
|
|
1603
1574
|
let e = {
|
|
@@ -1605,7 +1576,7 @@ function ct(e, t) {
|
|
|
1605
1576
|
granularity: i.granularity || "day"
|
|
1606
1577
|
};
|
|
1607
1578
|
if (i.enableComparison) {
|
|
1608
|
-
let n =
|
|
1579
|
+
let n = ge(i.field, t);
|
|
1609
1580
|
n && (e.compareDateRange = n);
|
|
1610
1581
|
}
|
|
1611
1582
|
r.push(e);
|
|
@@ -1615,31 +1586,31 @@ function ct(e, t) {
|
|
|
1615
1586
|
timeDimensions: r
|
|
1616
1587
|
};
|
|
1617
1588
|
}
|
|
1618
|
-
function
|
|
1619
|
-
let { dimensions: t, timeDimensions: n } =
|
|
1620
|
-
measures:
|
|
1589
|
+
function ut(e) {
|
|
1590
|
+
let { dimensions: t, timeDimensions: n } = lt(e.breakdowns, e.filters), r = {
|
|
1591
|
+
measures: ct(e.metrics),
|
|
1621
1592
|
dimensions: t
|
|
1622
1593
|
};
|
|
1623
1594
|
return n.length > 0 && (r.timeDimensions = n), e.filters.length > 0 && (r.filters = e.filters), e.order && Object.keys(e.order).length > 0 && (r.order = e.order), e.limit != null && (r.limit = e.limit), r;
|
|
1624
1595
|
}
|
|
1625
|
-
function
|
|
1596
|
+
function dt(e) {
|
|
1626
1597
|
return e.map((e, t) => ({
|
|
1627
|
-
id:
|
|
1598
|
+
id: M(),
|
|
1628
1599
|
field: e,
|
|
1629
|
-
label:
|
|
1600
|
+
label: N(t)
|
|
1630
1601
|
}));
|
|
1631
1602
|
}
|
|
1632
|
-
function
|
|
1603
|
+
function ft(e) {
|
|
1633
1604
|
let t = [];
|
|
1634
1605
|
if (e.dimensions) for (let n of e.dimensions) t.push({
|
|
1635
|
-
id:
|
|
1606
|
+
id: M(),
|
|
1636
1607
|
field: n,
|
|
1637
1608
|
isTimeDimension: !1
|
|
1638
1609
|
});
|
|
1639
1610
|
if (e.timeDimensions) for (let n of e.timeDimensions) {
|
|
1640
1611
|
let e = !!(n.compareDateRange && n.compareDateRange.length > 0);
|
|
1641
1612
|
t.push({
|
|
1642
|
-
id:
|
|
1613
|
+
id: M(),
|
|
1643
1614
|
field: n.dimension,
|
|
1644
1615
|
granularity: n.granularity,
|
|
1645
1616
|
isTimeDimension: !0,
|
|
@@ -1648,10 +1619,10 @@ function dt(e) {
|
|
|
1648
1619
|
}
|
|
1649
1620
|
return t;
|
|
1650
1621
|
}
|
|
1651
|
-
function
|
|
1622
|
+
function pt(e) {
|
|
1652
1623
|
return {
|
|
1653
|
-
metrics:
|
|
1654
|
-
breakdowns:
|
|
1624
|
+
metrics: dt(e.measures || []),
|
|
1625
|
+
breakdowns: ft(e),
|
|
1655
1626
|
filters: e.filters || [],
|
|
1656
1627
|
order: e.order,
|
|
1657
1628
|
limit: e.limit,
|
|
@@ -1659,14 +1630,14 @@ function ft(e) {
|
|
|
1659
1630
|
validationError: null
|
|
1660
1631
|
};
|
|
1661
1632
|
}
|
|
1662
|
-
function
|
|
1633
|
+
function mt(e) {
|
|
1663
1634
|
return typeof e == "object" && !!e && "queries" in e && Array.isArray(e.queries);
|
|
1664
1635
|
}
|
|
1665
1636
|
var X = {
|
|
1666
1637
|
type: "query",
|
|
1667
1638
|
createInitial() {
|
|
1668
1639
|
return {
|
|
1669
|
-
queryStates: [
|
|
1640
|
+
queryStates: [st()],
|
|
1670
1641
|
activeQueryIndex: 0,
|
|
1671
1642
|
mergeStrategy: "concat"
|
|
1672
1643
|
};
|
|
@@ -1686,22 +1657,22 @@ var X = {
|
|
|
1686
1657
|
load(e) {
|
|
1687
1658
|
if (e.analysisType !== "query") throw Error(`Cannot load ${e.analysisType} config with query adapter`);
|
|
1688
1659
|
let t = e;
|
|
1689
|
-
if (
|
|
1690
|
-
let e = t.query, n = e.queries.map(
|
|
1691
|
-
return n.length === 0 && n.push(
|
|
1660
|
+
if (mt(t.query)) {
|
|
1661
|
+
let e = t.query, n = e.queries.map(pt);
|
|
1662
|
+
return n.length === 0 && n.push(st()), {
|
|
1692
1663
|
queryStates: n,
|
|
1693
1664
|
activeQueryIndex: 0,
|
|
1694
1665
|
mergeStrategy: e.mergeStrategy || "concat"
|
|
1695
1666
|
};
|
|
1696
1667
|
}
|
|
1697
1668
|
return {
|
|
1698
|
-
queryStates: [
|
|
1669
|
+
queryStates: [pt(t.query)],
|
|
1699
1670
|
activeQueryIndex: 0,
|
|
1700
1671
|
mergeStrategy: "concat"
|
|
1701
1672
|
};
|
|
1702
1673
|
},
|
|
1703
1674
|
save(e, t, n) {
|
|
1704
|
-
let r = e.queryStates.map(
|
|
1675
|
+
let r = e.queryStates.map(ut), i = r.length === 1 && e.mergeStrategy === "concat" ? r[0] : {
|
|
1705
1676
|
queries: r,
|
|
1706
1677
|
mergeStrategy: e.mergeStrategy
|
|
1707
1678
|
};
|
|
@@ -1745,36 +1716,36 @@ var X = {
|
|
|
1745
1716
|
}
|
|
1746
1717
|
};
|
|
1747
1718
|
}
|
|
1748
|
-
}, Z = /* @__PURE__ */ new Map(),
|
|
1749
|
-
function
|
|
1750
|
-
|
|
1719
|
+
}, Z = /* @__PURE__ */ new Map(), ht = !1;
|
|
1720
|
+
function gt() {
|
|
1721
|
+
ht ||= (Z.has("query") || Z.set("query", X), Z.has("funnel") || Z.set("funnel", P), Z.has("flow") || Z.set("flow", oe), Z.has("retention") || Z.set("retention", A), !0);
|
|
1751
1722
|
}
|
|
1752
1723
|
var Q = {
|
|
1753
1724
|
register(e) {
|
|
1754
1725
|
Z.has(e.type) && console.warn(`[adapterRegistry] Overwriting existing adapter for type: ${e.type}`), Z.set(e.type, e);
|
|
1755
1726
|
},
|
|
1756
1727
|
get(e) {
|
|
1757
|
-
|
|
1728
|
+
gt();
|
|
1758
1729
|
let t = Z.get(e);
|
|
1759
1730
|
if (!t) throw Error(`[adapterRegistry] No adapter registered for type: ${e}. Available types: ${Array.from(Z.keys()).join(", ") || "none"}`);
|
|
1760
1731
|
return t;
|
|
1761
1732
|
},
|
|
1762
1733
|
has(e) {
|
|
1763
|
-
return
|
|
1734
|
+
return gt(), Z.has(e);
|
|
1764
1735
|
},
|
|
1765
1736
|
getRegisteredTypes() {
|
|
1766
|
-
return
|
|
1737
|
+
return gt(), Array.from(Z.keys());
|
|
1767
1738
|
},
|
|
1768
1739
|
clear() {
|
|
1769
|
-
Z.clear(),
|
|
1740
|
+
Z.clear(), ht = !1;
|
|
1770
1741
|
}
|
|
1771
|
-
},
|
|
1742
|
+
}, _t = () => ({
|
|
1772
1743
|
analysisType: "query",
|
|
1773
1744
|
charts: {
|
|
1774
1745
|
query: X.getDefaultChartConfig(),
|
|
1775
|
-
funnel:
|
|
1776
|
-
flow:
|
|
1777
|
-
retention:
|
|
1746
|
+
funnel: P.getDefaultChartConfig(),
|
|
1747
|
+
flow: oe.getDefaultChartConfig(),
|
|
1748
|
+
retention: A.getDefaultChartConfig()
|
|
1778
1749
|
},
|
|
1779
1750
|
activeViews: {
|
|
1780
1751
|
query: "chart",
|
|
@@ -1784,8 +1755,8 @@ var Q = {
|
|
|
1784
1755
|
},
|
|
1785
1756
|
userManuallySelectedChart: !1,
|
|
1786
1757
|
localPaletteName: "default"
|
|
1787
|
-
}),
|
|
1788
|
-
...
|
|
1758
|
+
}), vt = (e, t, n) => ({
|
|
1759
|
+
..._t(),
|
|
1789
1760
|
setAnalysisType: (t) => {
|
|
1790
1761
|
e((e) => {
|
|
1791
1762
|
let n = { ...e.charts };
|
|
@@ -1998,12 +1969,12 @@ var Q = {
|
|
|
1998
1969
|
...u
|
|
1999
1970
|
});
|
|
2000
1971
|
}
|
|
2001
|
-
}),
|
|
1972
|
+
}), yt = () => ({
|
|
2002
1973
|
queryStates: [K()],
|
|
2003
1974
|
activeQueryIndex: 0,
|
|
2004
1975
|
mergeStrategy: "concat"
|
|
2005
|
-
}),
|
|
2006
|
-
...
|
|
1976
|
+
}), bt = (e, t, n) => ({
|
|
1977
|
+
...yt(),
|
|
2007
1978
|
setQueryStates: (t) => e({ queryStates: t }),
|
|
2008
1979
|
updateQueryState: (t, n) => e((e) => {
|
|
2009
1980
|
let r = [...e.queryStates];
|
|
@@ -2033,9 +2004,9 @@ var Q = {
|
|
|
2033
2004
|
}),
|
|
2034
2005
|
addMetric: (t, n) => e((e) => {
|
|
2035
2006
|
let r = e.activeQueryIndex, i = [...e.queryStates], a = i[r] || K(), o = {
|
|
2036
|
-
id:
|
|
2007
|
+
id: M(),
|
|
2037
2008
|
field: t,
|
|
2038
|
-
label: n ||
|
|
2009
|
+
label: n || N(a.metrics.length)
|
|
2039
2010
|
};
|
|
2040
2011
|
return i[r] = {
|
|
2041
2012
|
...a,
|
|
@@ -2058,9 +2029,9 @@ var Q = {
|
|
|
2058
2029
|
};
|
|
2059
2030
|
else {
|
|
2060
2031
|
let e = {
|
|
2061
|
-
id:
|
|
2032
|
+
id: M(),
|
|
2062
2033
|
field: t,
|
|
2063
|
-
label:
|
|
2034
|
+
label: N(i.metrics.length)
|
|
2064
2035
|
};
|
|
2065
2036
|
r[n] = {
|
|
2066
2037
|
...i,
|
|
@@ -2080,7 +2051,7 @@ var Q = {
|
|
|
2080
2051
|
let i = e.activeQueryIndex, a = [...e.queryStates], o = a[i] || K();
|
|
2081
2052
|
if (n && o.breakdowns.some((e) => e.isTimeDimension)) return e;
|
|
2082
2053
|
let s = {
|
|
2083
|
-
id:
|
|
2054
|
+
id: M(),
|
|
2084
2055
|
field: t,
|
|
2085
2056
|
isTimeDimension: n,
|
|
2086
2057
|
granularity: n ? r || "month" : void 0
|
|
@@ -2107,7 +2078,7 @@ var Q = {
|
|
|
2107
2078
|
else {
|
|
2108
2079
|
if (n && o.breakdowns.some((e) => e.isTimeDimension)) return e;
|
|
2109
2080
|
let s = {
|
|
2110
|
-
id:
|
|
2081
|
+
id: M(),
|
|
2111
2082
|
field: t,
|
|
2112
2083
|
isTimeDimension: n,
|
|
2113
2084
|
granularity: n ? r || "month" : void 0
|
|
@@ -2244,11 +2215,11 @@ var Q = {
|
|
|
2244
2215
|
},
|
|
2245
2216
|
buildCurrentQuery: () => {
|
|
2246
2217
|
let e = t(), n = e.queryStates[e.activeQueryIndex] || K();
|
|
2247
|
-
return
|
|
2218
|
+
return ve(n.metrics, n.breakdowns, n.filters, n.order, !1, n.limit);
|
|
2248
2219
|
},
|
|
2249
2220
|
buildAllQueries: () => {
|
|
2250
2221
|
let e = t(), n = e.queryStates[0]?.breakdowns || [];
|
|
2251
|
-
return e.queryStates.map((t, r) =>
|
|
2222
|
+
return e.queryStates.map((t, r) => ve(t.metrics, e.mergeStrategy === "merge" && r > 0 ? n : t.breakdowns, t.filters, t.order, !1, t.limit));
|
|
2252
2223
|
},
|
|
2253
2224
|
buildMultiQueryConfig: () => {
|
|
2254
2225
|
let e = t();
|
|
@@ -2261,18 +2232,18 @@ var Q = {
|
|
|
2261
2232
|
queryLabels: n.map((e, t) => `Q${t + 1}`)
|
|
2262
2233
|
};
|
|
2263
2234
|
}
|
|
2264
|
-
}),
|
|
2235
|
+
}), xt = () => ({
|
|
2265
2236
|
funnelCube: null,
|
|
2266
2237
|
funnelSteps: [],
|
|
2267
2238
|
activeFunnelStepIndex: 0,
|
|
2268
2239
|
funnelTimeDimension: null,
|
|
2269
2240
|
funnelBindingKey: null,
|
|
2270
2241
|
stepTimeToConvert: []
|
|
2271
|
-
}),
|
|
2272
|
-
...
|
|
2242
|
+
}), St = (e, t, n) => ({
|
|
2243
|
+
...xt(),
|
|
2273
2244
|
addFunnelStep: () => e((e) => {
|
|
2274
2245
|
let t = e.funnelSteps[e.funnelSteps.length - 1], n = {
|
|
2275
|
-
id:
|
|
2246
|
+
id: M(),
|
|
2276
2247
|
name: `Step ${e.funnelSteps.length + 1}`,
|
|
2277
2248
|
cube: e.funnelCube || "",
|
|
2278
2249
|
filters: t?.filters ? JSON.parse(JSON.stringify(t.filters)) : [],
|
|
@@ -2337,7 +2308,7 @@ var Q = {
|
|
|
2337
2308
|
let e = t();
|
|
2338
2309
|
return e.analysisType !== "funnel" || !e.funnelBindingKey || !e.funnelTimeDimension || e.funnelSteps.length < 2 ? !1 : e.funnelSteps.filter((e) => e.cube && e.name).length >= 2;
|
|
2339
2310
|
}
|
|
2340
|
-
}),
|
|
2311
|
+
}), Ct = () => ({
|
|
2341
2312
|
flowCube: null,
|
|
2342
2313
|
flowBindingKey: null,
|
|
2343
2314
|
flowTimeDimension: null,
|
|
@@ -2349,8 +2320,8 @@ var Q = {
|
|
|
2349
2320
|
stepsAfter: 3,
|
|
2350
2321
|
eventDimension: null,
|
|
2351
2322
|
joinStrategy: "auto"
|
|
2352
|
-
}),
|
|
2353
|
-
...
|
|
2323
|
+
}), wt = (e, t, n) => ({
|
|
2324
|
+
...Ct(),
|
|
2354
2325
|
setFlowCube: (t) => e(() => ({
|
|
2355
2326
|
flowCube: t,
|
|
2356
2327
|
flowBindingKey: null,
|
|
@@ -2420,8 +2391,8 @@ var Q = {
|
|
|
2420
2391
|
joinStrategy: e.joinStrategy
|
|
2421
2392
|
} };
|
|
2422
2393
|
}
|
|
2423
|
-
}),
|
|
2424
|
-
...
|
|
2394
|
+
}), Tt = () => ({ ...E }), Et = (e, t, n) => ({
|
|
2395
|
+
...Tt(),
|
|
2425
2396
|
setRetentionCube: (t) => e(() => ({
|
|
2426
2397
|
retentionCube: t,
|
|
2427
2398
|
retentionTimeDimension: null,
|
|
@@ -2496,22 +2467,22 @@ var Q = {
|
|
|
2496
2467
|
warnings: r
|
|
2497
2468
|
};
|
|
2498
2469
|
}
|
|
2499
|
-
}),
|
|
2470
|
+
}), Dt = {
|
|
2500
2471
|
isOpen: !1,
|
|
2501
2472
|
userPrompt: "",
|
|
2502
2473
|
isGenerating: !1,
|
|
2503
2474
|
error: null,
|
|
2504
2475
|
hasGeneratedQuery: !1,
|
|
2505
2476
|
previousState: null
|
|
2506
|
-
},
|
|
2477
|
+
}, Ot = () => ({
|
|
2507
2478
|
activeTab: "query",
|
|
2508
2479
|
activeView: "chart",
|
|
2509
2480
|
displayLimit: 100,
|
|
2510
2481
|
showFieldModal: !1,
|
|
2511
2482
|
fieldModalMode: "metrics",
|
|
2512
|
-
aiState:
|
|
2513
|
-
}),
|
|
2514
|
-
...
|
|
2483
|
+
aiState: Dt
|
|
2484
|
+
}), kt = (e, t, n) => ({
|
|
2485
|
+
...Ot(),
|
|
2515
2486
|
setActiveTab: (t) => e({ activeTab: t }),
|
|
2516
2487
|
setActiveView: (t) => e((e) => ({
|
|
2517
2488
|
activeView: t,
|
|
@@ -2595,19 +2566,19 @@ var Q = {
|
|
|
2595
2566
|
displayConfig: t.displayConfig
|
|
2596
2567
|
}
|
|
2597
2568
|
},
|
|
2598
|
-
aiState: { ...
|
|
2569
|
+
aiState: { ...Dt }
|
|
2599
2570
|
};
|
|
2600
2571
|
})
|
|
2601
2572
|
});
|
|
2602
2573
|
//#endregion
|
|
2603
2574
|
//#region src/client/stores/analysisBuilderStore.tsx
|
|
2604
|
-
function
|
|
2575
|
+
function At(e) {
|
|
2605
2576
|
let t = e.filters ? [...e.filters] : [], n = e.timeDimensions || [], r = [...(e.dimensions || []).map((e) => ({
|
|
2606
|
-
id:
|
|
2577
|
+
id: M(),
|
|
2607
2578
|
field: e,
|
|
2608
2579
|
isTimeDimension: !1
|
|
2609
2580
|
})), ...n.map((e) => ({
|
|
2610
|
-
id:
|
|
2581
|
+
id: M(),
|
|
2611
2582
|
field: e.dimension,
|
|
2612
2583
|
granularity: e.granularity,
|
|
2613
2584
|
isTimeDimension: !0,
|
|
@@ -2635,22 +2606,22 @@ function kt(e) {
|
|
|
2635
2606
|
return {
|
|
2636
2607
|
...K(),
|
|
2637
2608
|
metrics: (e.measures || []).map((e, t) => ({
|
|
2638
|
-
id:
|
|
2609
|
+
id: M(),
|
|
2639
2610
|
field: e,
|
|
2640
|
-
label:
|
|
2611
|
+
label: N(t)
|
|
2641
2612
|
})),
|
|
2642
2613
|
breakdowns: r,
|
|
2643
2614
|
filters: i,
|
|
2644
2615
|
order: e.order
|
|
2645
2616
|
};
|
|
2646
2617
|
}
|
|
2647
|
-
function
|
|
2618
|
+
function jt(e) {
|
|
2648
2619
|
return "queries" in e && Array.isArray(e.queries);
|
|
2649
2620
|
}
|
|
2650
|
-
function
|
|
2621
|
+
function Mt(e) {
|
|
2651
2622
|
if (e.initialAnalysisType === "funnel" && e.initialFunnelState) {
|
|
2652
|
-
let t =
|
|
2653
|
-
return
|
|
2623
|
+
let t = P.getDefaultChartConfig();
|
|
2624
|
+
return P.save({
|
|
2654
2625
|
funnelCube: e.initialFunnelState.funnelCube ?? null,
|
|
2655
2626
|
funnelSteps: e.initialFunnelState.funnelSteps || [],
|
|
2656
2627
|
activeFunnelStepIndex: 0,
|
|
@@ -2663,8 +2634,8 @@ function jt(e) {
|
|
|
2663
2634
|
} }, e.initialActiveView || "chart");
|
|
2664
2635
|
}
|
|
2665
2636
|
if (e.initialAnalysisType === "flow" && e.initialFlowState) {
|
|
2666
|
-
let t =
|
|
2667
|
-
return
|
|
2637
|
+
let t = oe.getDefaultChartConfig();
|
|
2638
|
+
return oe.save({
|
|
2668
2639
|
flowCube: e.initialFlowState.flowCube ?? null,
|
|
2669
2640
|
flowBindingKey: e.initialFlowState.flowBindingKey ?? null,
|
|
2670
2641
|
flowTimeDimension: e.initialFlowState.flowTimeDimension ?? null,
|
|
@@ -2683,12 +2654,12 @@ function jt(e) {
|
|
|
2683
2654
|
} }, e.initialActiveView || "chart");
|
|
2684
2655
|
}
|
|
2685
2656
|
if (e.initialAnalysisType === "retention" && e.initialRetentionState) {
|
|
2686
|
-
let t =
|
|
2657
|
+
let t = A.getDefaultChartConfig(), n = {
|
|
2687
2658
|
chartType: e.initialChartConfig?.chartType || t.chartType,
|
|
2688
2659
|
chartConfig: e.initialChartConfig?.chartConfig || t.chartConfig,
|
|
2689
2660
|
displayConfig: e.initialChartConfig?.displayConfig || t.displayConfig
|
|
2690
|
-
}, r =
|
|
2691
|
-
return
|
|
2661
|
+
}, r = ne(D);
|
|
2662
|
+
return A.save({
|
|
2692
2663
|
retentionCube: e.initialRetentionState.retentionCube ?? null,
|
|
2693
2664
|
retentionBindingKey: e.initialRetentionState.retentionBindingKey ?? null,
|
|
2694
2665
|
retentionTimeDimension: e.initialRetentionState.retentionTimeDimension ?? null,
|
|
@@ -2703,7 +2674,7 @@ function jt(e) {
|
|
|
2703
2674
|
}
|
|
2704
2675
|
if (e.initialQuery) {
|
|
2705
2676
|
let t = e.initialQuery, n, r = "concat";
|
|
2706
|
-
|
|
2677
|
+
jt(t) ? (n = t.queries.map(At), t.mergeStrategy && (r = t.mergeStrategy)) : n = [At(t)];
|
|
2707
2678
|
let i = X.getDefaultChartConfig();
|
|
2708
2679
|
return X.save({
|
|
2709
2680
|
queryStates: n,
|
|
@@ -2733,20 +2704,20 @@ function jt(e) {
|
|
|
2733
2704
|
mergeStrategy: "concat"
|
|
2734
2705
|
}, { query: X.getDefaultChartConfig() }, e.initialActiveView) : null;
|
|
2735
2706
|
}
|
|
2736
|
-
function
|
|
2707
|
+
function Nt(e, t) {
|
|
2737
2708
|
return {
|
|
2738
2709
|
reset: () => {
|
|
2739
2710
|
e({
|
|
2740
|
-
...
|
|
2741
|
-
...
|
|
2742
|
-
...
|
|
2743
|
-
...
|
|
2744
|
-
...
|
|
2711
|
+
..._t(),
|
|
2712
|
+
...yt(),
|
|
2713
|
+
...xt(),
|
|
2714
|
+
...Ct(),
|
|
2715
|
+
...Tt(),
|
|
2745
2716
|
charts: {
|
|
2746
2717
|
query: X.getDefaultChartConfig(),
|
|
2747
|
-
funnel:
|
|
2748
|
-
flow:
|
|
2749
|
-
retention:
|
|
2718
|
+
funnel: P.getDefaultChartConfig(),
|
|
2719
|
+
flow: oe.getDefaultChartConfig(),
|
|
2720
|
+
retention: A.getDefaultChartConfig()
|
|
2750
2721
|
},
|
|
2751
2722
|
activeViews: {
|
|
2752
2723
|
query: "chart",
|
|
@@ -2759,28 +2730,28 @@ function Mt(e, t) {
|
|
|
2759
2730
|
clearCurrentMode: () => e((e) => {
|
|
2760
2731
|
switch (e.analysisType) {
|
|
2761
2732
|
case "funnel": return {
|
|
2762
|
-
...
|
|
2733
|
+
...xt(),
|
|
2763
2734
|
charts: {
|
|
2764
2735
|
...e.charts,
|
|
2765
|
-
funnel:
|
|
2736
|
+
funnel: P.getDefaultChartConfig()
|
|
2766
2737
|
}
|
|
2767
2738
|
};
|
|
2768
2739
|
case "flow": return {
|
|
2769
|
-
...
|
|
2740
|
+
...Ct(),
|
|
2770
2741
|
charts: {
|
|
2771
2742
|
...e.charts,
|
|
2772
|
-
flow:
|
|
2743
|
+
flow: oe.getDefaultChartConfig()
|
|
2773
2744
|
}
|
|
2774
2745
|
};
|
|
2775
2746
|
case "retention": return {
|
|
2776
|
-
...
|
|
2747
|
+
...Tt(),
|
|
2777
2748
|
charts: {
|
|
2778
2749
|
...e.charts,
|
|
2779
|
-
retention:
|
|
2750
|
+
retention: A.getDefaultChartConfig()
|
|
2780
2751
|
}
|
|
2781
2752
|
};
|
|
2782
2753
|
default: return {
|
|
2783
|
-
...
|
|
2754
|
+
...yt(),
|
|
2784
2755
|
userManuallySelectedChart: !1,
|
|
2785
2756
|
charts: {
|
|
2786
2757
|
...e.charts,
|
|
@@ -2806,15 +2777,15 @@ function Mt(e, t) {
|
|
|
2806
2777
|
}
|
|
2807
2778
|
};
|
|
2808
2779
|
}
|
|
2809
|
-
function
|
|
2810
|
-
let r =
|
|
2811
|
-
...
|
|
2812
|
-
...
|
|
2813
|
-
...
|
|
2814
|
-
...
|
|
2815
|
-
...
|
|
2816
|
-
...
|
|
2817
|
-
...
|
|
2780
|
+
function Pt(n = {}) {
|
|
2781
|
+
let r = Mt(n), o = (e, t, n) => ({
|
|
2782
|
+
...vt(e, t, n),
|
|
2783
|
+
...bt(e, t, n),
|
|
2784
|
+
...St(e, t, n),
|
|
2785
|
+
...wt(e, t, n),
|
|
2786
|
+
...Et(e, t, n),
|
|
2787
|
+
...kt(e, t, n),
|
|
2788
|
+
...Nt(e, t)
|
|
2818
2789
|
});
|
|
2819
2790
|
if (n.disableLocalStorage) {
|
|
2820
2791
|
let t = a()(i(e(o), { name: "AnalysisBuilderStore (no-persist)" }));
|
|
@@ -2823,10 +2794,10 @@ function Nt(n = {}) {
|
|
|
2823
2794
|
return a()(i(e(t(o, {
|
|
2824
2795
|
name: n.storageKey || "drizzle-cube-analysis-builder-v3",
|
|
2825
2796
|
partialize: (e) => e.saveWorkspace(),
|
|
2826
|
-
merge: (e, t) => e &&
|
|
2797
|
+
merge: (e, t) => e && k(e) ? {
|
|
2827
2798
|
...t,
|
|
2828
2799
|
_persistedWorkspace: e
|
|
2829
|
-
} : e &&
|
|
2800
|
+
} : e && O(e) ? {
|
|
2830
2801
|
...t,
|
|
2831
2802
|
_persistedConfig: e
|
|
2832
2803
|
} : r ? {
|
|
@@ -2849,10 +2820,10 @@ function Nt(n = {}) {
|
|
|
2849
2820
|
}
|
|
2850
2821
|
})), { name: "AnalysisBuilderStore" }));
|
|
2851
2822
|
}
|
|
2852
|
-
var
|
|
2853
|
-
function
|
|
2854
|
-
let u =
|
|
2855
|
-
return u.current ||=
|
|
2823
|
+
var Ft = le(null);
|
|
2824
|
+
function It({ children: e, initialQuery: t, initialChartConfig: n, disableLocalStorage: r, storageKey: i, initialAnalysisType: a, initialFunnelState: o, initialFlowState: s, initialRetentionState: c, initialActiveView: l }) {
|
|
2825
|
+
let u = V(null);
|
|
2826
|
+
return u.current ||= Pt({
|
|
2856
2827
|
initialQuery: t,
|
|
2857
2828
|
initialChartConfig: n,
|
|
2858
2829
|
disableLocalStorage: r,
|
|
@@ -2862,22 +2833,22 @@ function Ft({ children: e, initialQuery: t, initialChartConfig: n, disableLocalS
|
|
|
2862
2833
|
initialFlowState: s,
|
|
2863
2834
|
initialRetentionState: c,
|
|
2864
2835
|
initialActiveView: l
|
|
2865
|
-
}), /* @__PURE__ */
|
|
2836
|
+
}), /* @__PURE__ */ W(Ft.Provider, {
|
|
2866
2837
|
value: u.current,
|
|
2867
2838
|
children: e
|
|
2868
2839
|
});
|
|
2869
2840
|
}
|
|
2870
2841
|
function $(e) {
|
|
2871
|
-
let t = ue(
|
|
2842
|
+
let t = ue(Ft);
|
|
2872
2843
|
if (!t) throw Error("useAnalysisBuilderStore must be used within AnalysisBuilderStoreProvider");
|
|
2873
2844
|
return r(t, e);
|
|
2874
2845
|
}
|
|
2875
|
-
function
|
|
2876
|
-
let e = ue(
|
|
2846
|
+
function Lt() {
|
|
2847
|
+
let e = ue(Ft);
|
|
2877
2848
|
if (!e) throw Error("useAnalysisBuilderStoreApi must be used within AnalysisBuilderStoreProvider");
|
|
2878
2849
|
return e;
|
|
2879
2850
|
}
|
|
2880
|
-
var
|
|
2851
|
+
var Rt = (e) => e.queryStates[e.activeQueryIndex] || K(), zt = (e) => Rt(e).metrics, Bt = (e) => Rt(e).breakdowns, Vt = (e) => Rt(e).filters, Ht = (e) => {
|
|
2881
2852
|
let t = e.charts[e.analysisType];
|
|
2882
2853
|
return t ? {
|
|
2883
2854
|
chartType: t.chartType,
|
|
@@ -2892,18 +2863,18 @@ var Lt = (e) => e.queryStates[e.activeQueryIndex] || K(), Rt = (e) => Lt(e).metr
|
|
|
2892
2863
|
showTooltip: !0
|
|
2893
2864
|
}
|
|
2894
2865
|
};
|
|
2895
|
-
},
|
|
2866
|
+
}, Ut = (e) => ({
|
|
2896
2867
|
activeTab: e.activeTab,
|
|
2897
2868
|
activeView: e.activeView,
|
|
2898
2869
|
displayLimit: e.displayLimit,
|
|
2899
2870
|
showFieldModal: e.showFieldModal,
|
|
2900
2871
|
fieldModalMode: e.fieldModalMode
|
|
2901
|
-
}),
|
|
2872
|
+
}), Wt = (e) => ({
|
|
2902
2873
|
queryStates: e.queryStates,
|
|
2903
2874
|
activeQueryIndex: e.activeQueryIndex,
|
|
2904
2875
|
mergeStrategy: e.mergeStrategy,
|
|
2905
2876
|
isMultiQueryMode: e.analysisType === "query" && e.queryStates.length > 1
|
|
2906
|
-
}),
|
|
2877
|
+
}), Gt = (e) => ({
|
|
2907
2878
|
funnelCube: e.funnelCube,
|
|
2908
2879
|
funnelSteps: e.funnelSteps,
|
|
2909
2880
|
activeFunnelStepIndex: e.activeFunnelStepIndex,
|
|
@@ -2914,16 +2885,16 @@ var Lt = (e) => e.queryStates[e.activeQueryIndex] || K(), Rt = (e) => Lt(e).metr
|
|
|
2914
2885
|
});
|
|
2915
2886
|
//#endregion
|
|
2916
2887
|
//#region src/client/utils/multiQueryValidation.ts
|
|
2917
|
-
function
|
|
2888
|
+
function Kt(e) {
|
|
2918
2889
|
return e.timeDimensions || [];
|
|
2919
2890
|
}
|
|
2920
|
-
function
|
|
2891
|
+
function qt(e) {
|
|
2921
2892
|
let t = [];
|
|
2922
2893
|
if (e.length < 2) return t;
|
|
2923
|
-
let n =
|
|
2894
|
+
let n = Kt(e[0]);
|
|
2924
2895
|
if (n.length === 0) return t;
|
|
2925
2896
|
for (let r = 1; r < e.length; r++) {
|
|
2926
|
-
let i =
|
|
2897
|
+
let i = Kt(e[r]);
|
|
2927
2898
|
if (i.length === 0 && n.length > 0) {
|
|
2928
2899
|
t.push({
|
|
2929
2900
|
type: "missing_time_dimension",
|
|
@@ -2949,7 +2920,7 @@ function Kt(e) {
|
|
|
2949
2920
|
}
|
|
2950
2921
|
return t;
|
|
2951
2922
|
}
|
|
2952
|
-
function
|
|
2923
|
+
function Jt(e, t) {
|
|
2953
2924
|
let n = [];
|
|
2954
2925
|
if (e.length < 2 || t.length === 0) return n;
|
|
2955
2926
|
for (let r = 0; r < e.length; r++) {
|
|
@@ -2963,7 +2934,7 @@ function qt(e, t) {
|
|
|
2963
2934
|
}
|
|
2964
2935
|
return n;
|
|
2965
2936
|
}
|
|
2966
|
-
function
|
|
2937
|
+
function Yt(e) {
|
|
2967
2938
|
let t = [];
|
|
2968
2939
|
if (e.length < 2) return t;
|
|
2969
2940
|
let n = /* @__PURE__ */ new Map();
|
|
@@ -2982,7 +2953,7 @@ function Jt(e) {
|
|
|
2982
2953
|
affectedMeasures: r
|
|
2983
2954
|
}), t;
|
|
2984
2955
|
}
|
|
2985
|
-
function
|
|
2956
|
+
function Xt(e) {
|
|
2986
2957
|
let t = [];
|
|
2987
2958
|
if (e.length < 2) return t;
|
|
2988
2959
|
let n = e.map((e) => e.timeDimensions?.[0]?.dateRange);
|
|
@@ -2992,39 +2963,39 @@ function Yt(e) {
|
|
|
2992
2963
|
message: "Queries have different date ranges - some data points may be missing in merged results"
|
|
2993
2964
|
}), t;
|
|
2994
2965
|
}
|
|
2995
|
-
function
|
|
2966
|
+
function Zt(e, t, n = []) {
|
|
2996
2967
|
let r = [], i = [];
|
|
2997
2968
|
return e.length < 2 ? {
|
|
2998
2969
|
isValid: !0,
|
|
2999
2970
|
errors: r,
|
|
3000
2971
|
warnings: i
|
|
3001
|
-
} : (i.push(...
|
|
2972
|
+
} : (i.push(...Yt(e)), i.push(...Xt(e)), t === "merge" && (r.push(...qt(e)), n.length > 0 && r.push(...Jt(e, n))), {
|
|
3002
2973
|
isValid: r.length === 0,
|
|
3003
2974
|
errors: r,
|
|
3004
2975
|
warnings: i
|
|
3005
2976
|
});
|
|
3006
2977
|
}
|
|
3007
|
-
function
|
|
2978
|
+
function Qt(e) {
|
|
3008
2979
|
return e.filter((e) => (e.measures?.length || 0) + (e.dimensions?.length || 0) + (e.timeDimensions?.length || 0) > 0).length >= 2;
|
|
3009
2980
|
}
|
|
3010
|
-
function
|
|
2981
|
+
function $t(e) {
|
|
3011
2982
|
if (e.isValid && e.warnings.length === 0) return "Configuration is valid";
|
|
3012
2983
|
let t = [];
|
|
3013
2984
|
return e.errors.length > 0 && t.push(`${e.errors.length} error${e.errors.length > 1 ? "s" : ""}`), e.warnings.length > 0 && t.push(`${e.warnings.length} warning${e.warnings.length > 1 ? "s" : ""}`), t.join(", ");
|
|
3014
2985
|
}
|
|
3015
2986
|
//#endregion
|
|
3016
2987
|
//#region src/client/hooks/useAnalysisQueryBuilder.ts
|
|
3017
|
-
function
|
|
3018
|
-
let e = $((e) => e.queryStates), t = $((e) => e.activeQueryIndex), n = $((e) => e.mergeStrategy), r = $((e) => e.setActiveQueryIndex), i = $((e) => e.setMergeStrategy), a = $((e) => e.addQuery), o = $((e) => e.removeQuery), s = $((e) => e.getCurrentState), c = $((e) => e.getMergeKeys), l = $((e) => e.isMultiQueryMode), u = s(), d = l(), f = c(), p =
|
|
2988
|
+
function en() {
|
|
2989
|
+
let e = $((e) => e.queryStates), t = $((e) => e.activeQueryIndex), n = $((e) => e.mergeStrategy), r = $((e) => e.setActiveQueryIndex), i = $((e) => e.setMergeStrategy), a = $((e) => e.addQuery), o = $((e) => e.removeQuery), s = $((e) => e.getCurrentState), c = $((e) => e.getMergeKeys), l = $((e) => e.isMultiQueryMode), u = s(), d = l(), f = c(), p = B(() => {
|
|
3019
2990
|
let n = e[t] || u;
|
|
3020
|
-
return
|
|
2991
|
+
return ve(n.metrics, n.breakdowns, n.filters, n.order, !1, n.limit);
|
|
3021
2992
|
}, [
|
|
3022
2993
|
e,
|
|
3023
2994
|
t,
|
|
3024
2995
|
u
|
|
3025
|
-
]), m =
|
|
2996
|
+
]), m = B(() => {
|
|
3026
2997
|
let t = e[0]?.breakdowns || [];
|
|
3027
|
-
return e.map((e, r) =>
|
|
2998
|
+
return e.map((e, r) => ve(e.metrics, n === "merge" && r > 0 ? t : e.breakdowns, e.filters, e.order, !1, e.limit));
|
|
3028
2999
|
}, [e, n]);
|
|
3029
3000
|
return {
|
|
3030
3001
|
queryState: u,
|
|
@@ -3035,7 +3006,7 @@ function $t() {
|
|
|
3035
3006
|
mergeKeys: f,
|
|
3036
3007
|
currentQuery: p,
|
|
3037
3008
|
allQueries: m,
|
|
3038
|
-
multiQueryConfig:
|
|
3009
|
+
multiQueryConfig: B(() => {
|
|
3039
3010
|
if (e.length <= 1) return null;
|
|
3040
3011
|
let t = m.filter((e) => e.measures && e.measures.length > 0 || e.dimensions && e.dimensions.length > 0 || e.timeDimensions && e.timeDimensions.length > 0);
|
|
3041
3012
|
return t.length < 2 ? null : {
|
|
@@ -3050,13 +3021,13 @@ function $t() {
|
|
|
3050
3021
|
n,
|
|
3051
3022
|
f
|
|
3052
3023
|
]),
|
|
3053
|
-
multiQueryValidation:
|
|
3024
|
+
multiQueryValidation: B(() => d ? Zt(m, n, f || []) : null, [
|
|
3054
3025
|
d,
|
|
3055
3026
|
m,
|
|
3056
3027
|
n,
|
|
3057
3028
|
f
|
|
3058
3029
|
]),
|
|
3059
|
-
isValidQuery:
|
|
3030
|
+
isValidQuery: B(() => p.measures && p.measures.length > 0 || p.dimensions && p.dimensions.length > 0 || p.timeDimensions && p.timeDimensions.length > 0, [p]),
|
|
3060
3031
|
setActiveQueryIndex: r,
|
|
3061
3032
|
setMergeStrategy: i,
|
|
3062
3033
|
addQuery: a,
|
|
@@ -3065,10 +3036,10 @@ function $t() {
|
|
|
3065
3036
|
}
|
|
3066
3037
|
//#endregion
|
|
3067
3038
|
//#region src/client/hooks/useAnalysisCombinedFields.ts
|
|
3068
|
-
function
|
|
3039
|
+
function tn(e) {
|
|
3069
3040
|
let { queryState: t, queryStates: n, isMultiQueryMode: r, mergeStrategy: i, activeQueryIndex: a } = e;
|
|
3070
3041
|
return {
|
|
3071
|
-
combinedMetrics:
|
|
3042
|
+
combinedMetrics: B(() => {
|
|
3072
3043
|
if (!r) return t.metrics;
|
|
3073
3044
|
let e = /* @__PURE__ */ new Set(), i = [];
|
|
3074
3045
|
for (let t = 0; t < n.length; t++) {
|
|
@@ -3087,7 +3058,7 @@ function en(e) {
|
|
|
3087
3058
|
n,
|
|
3088
3059
|
t.metrics
|
|
3089
3060
|
]),
|
|
3090
|
-
combinedBreakdowns:
|
|
3061
|
+
combinedBreakdowns: B(() => {
|
|
3091
3062
|
if (!r) return t.breakdowns;
|
|
3092
3063
|
let e = /* @__PURE__ */ new Set(), i = [];
|
|
3093
3064
|
for (let t of n) for (let n of t.breakdowns) e.has(n.field) || (e.add(n.field), i.push(n));
|
|
@@ -3097,7 +3068,7 @@ function en(e) {
|
|
|
3097
3068
|
n,
|
|
3098
3069
|
t.breakdowns
|
|
3099
3070
|
]),
|
|
3100
|
-
effectiveBreakdowns:
|
|
3071
|
+
effectiveBreakdowns: B(() => i === "merge" && a > 0 ? n[0]?.breakdowns || [] : t.breakdowns, [
|
|
3101
3072
|
i,
|
|
3102
3073
|
a,
|
|
3103
3074
|
n,
|
|
@@ -3107,115 +3078,115 @@ function en(e) {
|
|
|
3107
3078
|
}
|
|
3108
3079
|
//#endregion
|
|
3109
3080
|
//#region src/client/hooks/useAnalysisQueryExecution.ts
|
|
3110
|
-
function
|
|
3111
|
-
let { currentQuery: t, allQueries: n, multiQueryConfig: r, isMultiQueryMode: i, isValidQuery: a, initialData: o, mergeStrategy: s, funnelBindingKey: c, isFunnelModeEnabled: l, analysisType: u, serverFunnelQuery: d, serverFlowQuery: f, serverRetentionQuery: p, retentionValidation: m } = e, { getFieldLabel: v } =
|
|
3112
|
-
|
|
3081
|
+
function nn(e) {
|
|
3082
|
+
let { currentQuery: t, allQueries: n, multiQueryConfig: r, isMultiQueryMode: i, isValidQuery: a, initialData: o, mergeStrategy: s, funnelBindingKey: c, isFunnelModeEnabled: l, analysisType: u, serverFunnelQuery: d, serverFlowQuery: f, serverRetentionQuery: p, retentionValidation: m } = e, { getFieldLabel: v } = te(), x = u === "funnel" || l, w = u === "flow", T = u === "retention", E = u === "query" && i, ne = u === "query" && !i, D = u === "funnel" && !!d, O = B(() => D || !x || !c || n.length < 2 ? null : ee(n, c), [
|
|
3083
|
+
D,
|
|
3113
3084
|
x,
|
|
3114
3085
|
c,
|
|
3115
3086
|
n
|
|
3116
|
-
]),
|
|
3117
|
-
skip: !a || !
|
|
3087
|
+
]), k = g(t, {
|
|
3088
|
+
skip: !a || !ne,
|
|
3118
3089
|
debounceMs: 300
|
|
3119
|
-
}),
|
|
3120
|
-
skip: !r || !
|
|
3090
|
+
}), A = _(r, {
|
|
3091
|
+
skip: !r || !E,
|
|
3121
3092
|
debounceMs: 300
|
|
3122
|
-
}),
|
|
3123
|
-
skip: !x || !
|
|
3093
|
+
}), j = b(O, {
|
|
3094
|
+
skip: !x || !O && !d,
|
|
3124
3095
|
debounceMs: 300,
|
|
3125
|
-
prebuiltServerQuery:
|
|
3126
|
-
}),
|
|
3127
|
-
skip: !
|
|
3096
|
+
prebuiltServerQuery: D ? d : void 0
|
|
3097
|
+
}), M = h(f ?? null, {
|
|
3098
|
+
skip: !w || !f,
|
|
3128
3099
|
debounceMs: 300
|
|
3129
|
-
}),
|
|
3130
|
-
skip: !
|
|
3100
|
+
}), N = y(p ?? null, {
|
|
3101
|
+
skip: !T || !p,
|
|
3131
3102
|
debounceMs: 300,
|
|
3132
3103
|
getFieldLabel: v
|
|
3133
|
-
}),
|
|
3104
|
+
}), re = C({
|
|
3134
3105
|
queries: i ? n : [t],
|
|
3135
3106
|
isMultiQueryMode: i,
|
|
3136
|
-
skip: !a || x ||
|
|
3137
|
-
}),
|
|
3138
|
-
|
|
3107
|
+
skip: !a || x || w || T
|
|
3108
|
+
}), ie = S(j.serverQuery, { skip: !x || !j.serverQuery }), ae = S(M.serverQuery, { skip: !w || !M.serverQuery }), oe = S(p, { skip: !T || !p }), P = T ? N.isLoading || N.isDebouncing : w ? M.isLoading || M.isDebouncing : x ? j.isExecuting || j.isDebouncing : E ? A.isLoading : k.isLoading, se = T ? N.isFetching : w ? M.isFetching : x ? j.isExecuting : E ? A.isFetching : k.isFetching, F = T ? N.error : w ? M.error : x ? j.error : E ? A.error : k.error, ce = !!(k.debouncedQuery || A.debouncedConfig || !j.isDebouncing || !M.isDebouncing || !N.isDebouncing), I = R((e) => {
|
|
3109
|
+
T ? N.execute(e) : w ? M.refetch(e) : x ? j.execute(e) : E ? A.refetch(e) : k.refetch(e);
|
|
3139
3110
|
}, [
|
|
3111
|
+
T,
|
|
3140
3112
|
w,
|
|
3141
|
-
C,
|
|
3142
3113
|
x,
|
|
3143
|
-
|
|
3114
|
+
E,
|
|
3115
|
+
N,
|
|
3116
|
+
M,
|
|
3144
3117
|
j,
|
|
3145
3118
|
A,
|
|
3146
|
-
k
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
let e = w ? j.chartData : C ? A.data : x ? k.chartData : T ? O.data : D.rawData;
|
|
3151
|
-
return o && o.length > 0 && !e ? "success" : a ? P && !e ? "loading" : se && e ? "refreshing" : ce ? "error" : e ? "success" : "idle" : "idle";
|
|
3119
|
+
k
|
|
3120
|
+
]), le = B(() => {
|
|
3121
|
+
let e = T ? N.chartData : w ? M.data : x ? j.chartData : E ? A.data : k.rawData;
|
|
3122
|
+
return o && o.length > 0 && !e ? "success" : a ? P && !e ? "loading" : se && e ? "refreshing" : F ? "error" : e ? "success" : "idle" : "idle";
|
|
3152
3123
|
}, [
|
|
3153
3124
|
a,
|
|
3154
3125
|
P,
|
|
3155
3126
|
se,
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
O.data,
|
|
3159
|
-
k.chartData,
|
|
3127
|
+
F,
|
|
3128
|
+
k.rawData,
|
|
3160
3129
|
A.data,
|
|
3161
3130
|
j.chartData,
|
|
3131
|
+
M.data,
|
|
3132
|
+
N.chartData,
|
|
3162
3133
|
o,
|
|
3163
|
-
|
|
3134
|
+
E,
|
|
3164
3135
|
x,
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
]),
|
|
3136
|
+
w,
|
|
3137
|
+
T
|
|
3138
|
+
]), L = B(() => T && N.chartData ? N.chartData.rows.map((e) => ({
|
|
3168
3139
|
"Retention.period": `P${e.period}`,
|
|
3169
3140
|
"Retention.rate": e.retentionRate,
|
|
3170
3141
|
"Retention.retained": e.retainedUsers,
|
|
3171
3142
|
"Retention.cohortSize": e.cohortSize,
|
|
3172
3143
|
"Retention.segment": e.breakdownValue || "All Users"
|
|
3173
|
-
})) :
|
|
3174
|
-
|
|
3175
|
-
O.data,
|
|
3176
|
-
k.chartData,
|
|
3144
|
+
})) : w && M.data ? [M.data] : x && j.chartData ? j.chartData : E && A.data ? A.data : k.rawData ? k.rawData : o && o.length > 0 ? o : null, [
|
|
3145
|
+
k.rawData,
|
|
3177
3146
|
A.data,
|
|
3178
3147
|
j.chartData,
|
|
3148
|
+
M.data,
|
|
3149
|
+
N.chartData,
|
|
3179
3150
|
o,
|
|
3180
|
-
|
|
3181
|
-
x,
|
|
3182
|
-
C,
|
|
3183
|
-
w
|
|
3184
|
-
]), R = z(() => x && k.stepResults ? k.stepResults.map((e) => e.data) : !T || !O.perQueryData ? null : O.perQueryData, [
|
|
3185
|
-
T,
|
|
3151
|
+
E,
|
|
3186
3152
|
x,
|
|
3187
|
-
O.perQueryData,
|
|
3188
|
-
k.stepResults
|
|
3189
|
-
]), B = x && k.executedQueries?.length > 0 ? k.executedQueries : null, V = x ? k.serverQuery : null, H = x ? oe.debugData : null, U = C ? A.serverQuery : null, W = C ? A.data : null, de = C ? M.debugData : null, fe = w ? p ?? null : null, G = w ? j.chartData : null, pe = w ? N.debugData : null, me = z(() => w ? j.needsRefresh : C ? A.needsRefresh : x ? k.needsRefresh : T ? !1 : D.needsRefresh, [
|
|
3190
3153
|
w,
|
|
3191
|
-
|
|
3154
|
+
T
|
|
3155
|
+
]), ue = B(() => x && j.stepResults ? j.stepResults.map((e) => e.data) : !E || !A.perQueryData ? null : A.perQueryData, [
|
|
3156
|
+
E,
|
|
3192
3157
|
x,
|
|
3158
|
+
A.perQueryData,
|
|
3159
|
+
j.stepResults
|
|
3160
|
+
]), z = x && j.executedQueries?.length > 0 ? j.executedQueries : null, V = x ? j.serverQuery : null, H = x ? ie.debugData : null, U = w ? M.serverQuery : null, W = w ? M.data : null, G = w ? ae.debugData : null, de = T ? p ?? null : null, fe = T ? N.chartData : null, pe = T ? oe.debugData : null, me = B(() => T ? N.needsRefresh : w ? M.needsRefresh : x ? j.needsRefresh : E ? !1 : k.needsRefresh, [
|
|
3193
3161
|
T,
|
|
3162
|
+
w,
|
|
3163
|
+
x,
|
|
3164
|
+
E,
|
|
3165
|
+
N.needsRefresh,
|
|
3166
|
+
M.needsRefresh,
|
|
3194
3167
|
j.needsRefresh,
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
if (E && D.warnings) return D.warnings;
|
|
3200
|
-
}, [E, D.warnings]);
|
|
3168
|
+
k.needsRefresh
|
|
3169
|
+
]), he = B(() => {
|
|
3170
|
+
if (ne && k.warnings) return k.warnings;
|
|
3171
|
+
}, [ne, k.warnings]);
|
|
3201
3172
|
return {
|
|
3202
3173
|
executionStatus: le,
|
|
3203
|
-
executionResults:
|
|
3204
|
-
perQueryResults:
|
|
3174
|
+
executionResults: L,
|
|
3175
|
+
perQueryResults: ue,
|
|
3205
3176
|
isLoading: P,
|
|
3206
3177
|
isFetching: se,
|
|
3207
|
-
error:
|
|
3208
|
-
debugDataPerQuery:
|
|
3209
|
-
hasDebounced:
|
|
3178
|
+
error: F,
|
|
3179
|
+
debugDataPerQuery: re.debugDataPerQuery,
|
|
3180
|
+
hasDebounced: ce,
|
|
3210
3181
|
refetch: I,
|
|
3211
|
-
funnelExecutedQueries:
|
|
3182
|
+
funnelExecutedQueries: z,
|
|
3212
3183
|
funnelServerQuery: V,
|
|
3213
3184
|
funnelDebugData: H,
|
|
3214
3185
|
flowServerQuery: U,
|
|
3215
3186
|
flowChartData: W,
|
|
3216
|
-
flowDebugData:
|
|
3217
|
-
retentionServerQuery:
|
|
3218
|
-
retentionChartData:
|
|
3187
|
+
flowDebugData: G,
|
|
3188
|
+
retentionServerQuery: de,
|
|
3189
|
+
retentionChartData: fe,
|
|
3219
3190
|
retentionDebugData: pe,
|
|
3220
3191
|
retentionValidation: m ?? null,
|
|
3221
3192
|
needsRefresh: me,
|
|
@@ -3224,12 +3195,12 @@ function tn(e) {
|
|
|
3224
3195
|
}
|
|
3225
3196
|
//#endregion
|
|
3226
3197
|
//#region src/client/hooks/useAnalysisChartDefaults.ts
|
|
3227
|
-
function
|
|
3228
|
-
let { externalColorPalette: t, combinedMetrics: r, combinedBreakdowns: i, hasDebounced: a } = e, o = $((e) => e.analysisType), { chartType: s, chartConfig: c, displayConfig: l } = $(n(
|
|
3198
|
+
function rn(e) {
|
|
3199
|
+
let { externalColorPalette: t, combinedMetrics: r, combinedBreakdowns: i, hasDebounced: a } = e, o = $((e) => e.analysisType), { chartType: s, chartConfig: c, displayConfig: l } = $(n(Ht)), u = $((e) => e.userManuallySelectedChart), d = $((e) => e.localPaletteName), f = $((e) => e.setChartTypeManual), p = $((e) => e.setChartConfig), m = $((e) => e.setDisplayConfig), h = $((e) => e.setFunnelChartType), g = $((e) => e.setFunnelChartConfig), _ = $((e) => e.setFunnelDisplayConfig), v = $((e) => e.setLocalPaletteName), y = $((e) => e.setUserManuallySelectedChart), b = R((e) => {
|
|
3229
3200
|
if (o === "funnel") h(e);
|
|
3230
3201
|
else {
|
|
3231
3202
|
f(e);
|
|
3232
|
-
let { chartConfig: t } =
|
|
3203
|
+
let { chartConfig: t } = Je(r, i, e);
|
|
3233
3204
|
p(t);
|
|
3234
3205
|
}
|
|
3235
3206
|
}, [
|
|
@@ -3239,25 +3210,25 @@ function nn(e) {
|
|
|
3239
3210
|
h,
|
|
3240
3211
|
f,
|
|
3241
3212
|
p
|
|
3242
|
-
]), x =
|
|
3213
|
+
]), x = R((e) => {
|
|
3243
3214
|
o === "funnel" ? g(e) : p(e);
|
|
3244
3215
|
}, [
|
|
3245
3216
|
o,
|
|
3246
3217
|
g,
|
|
3247
3218
|
p
|
|
3248
|
-
]), S =
|
|
3219
|
+
]), S = R((e) => {
|
|
3249
3220
|
o === "funnel" ? _(e) : m(e);
|
|
3250
3221
|
}, [
|
|
3251
3222
|
o,
|
|
3252
3223
|
_,
|
|
3253
3224
|
m
|
|
3254
|
-
]),
|
|
3225
|
+
]), C = B(() => Ke(r, i), [r, i]), ee = B(() => t ? Array.isArray(t) && typeof t[0] == "string" ? {
|
|
3255
3226
|
name: "custom",
|
|
3256
3227
|
label: "Custom",
|
|
3257
3228
|
colors: t,
|
|
3258
3229
|
gradient: t
|
|
3259
|
-
} : t :
|
|
3260
|
-
return
|
|
3230
|
+
} : t : ie(d), [t, d]), w = V("");
|
|
3231
|
+
return z(() => {
|
|
3261
3232
|
if (!a || r.length === 0 && i.length === 0) return;
|
|
3262
3233
|
let e = JSON.stringify({
|
|
3263
3234
|
metrics: r.map((e) => e.field),
|
|
@@ -3266,14 +3237,14 @@ function nn(e) {
|
|
|
3266
3237
|
isTime: e.isTimeDimension
|
|
3267
3238
|
}))
|
|
3268
3239
|
});
|
|
3269
|
-
if (e ===
|
|
3270
|
-
|
|
3271
|
-
let t =
|
|
3240
|
+
if (e === w.current) return;
|
|
3241
|
+
w.current = e;
|
|
3242
|
+
let t = Xe(r, i, s, u);
|
|
3272
3243
|
if (t) {
|
|
3273
|
-
let { chartConfig: e } =
|
|
3244
|
+
let { chartConfig: e } = Je(r, i, t);
|
|
3274
3245
|
b(t), x(e), y(!1);
|
|
3275
3246
|
} else if ((r.length > 0 || i.length > 0) && !c.xAxis?.length && !c.yAxis?.length && !c.series?.length) {
|
|
3276
|
-
let { chartConfig: e } =
|
|
3247
|
+
let { chartConfig: e } = Je(r, i, s);
|
|
3277
3248
|
x(e);
|
|
3278
3249
|
}
|
|
3279
3250
|
}, [
|
|
@@ -3290,9 +3261,9 @@ function nn(e) {
|
|
|
3290
3261
|
chartType: s,
|
|
3291
3262
|
chartConfig: c,
|
|
3292
3263
|
displayConfig: l,
|
|
3293
|
-
colorPalette:
|
|
3264
|
+
colorPalette: ee,
|
|
3294
3265
|
localPaletteName: d,
|
|
3295
|
-
chartAvailability:
|
|
3266
|
+
chartAvailability: C,
|
|
3296
3267
|
userManuallySelectedChart: u,
|
|
3297
3268
|
setChartType: b,
|
|
3298
3269
|
setChartConfig: x,
|
|
@@ -3302,8 +3273,8 @@ function nn(e) {
|
|
|
3302
3273
|
}
|
|
3303
3274
|
//#endregion
|
|
3304
3275
|
//#region src/client/hooks/useAnalysisUIState.ts
|
|
3305
|
-
function
|
|
3306
|
-
let e = $((e) => e.activeTab), t = $((e) => e.activeView), n = $((e) => e.displayLimit), r = $((e) => e.showFieldModal), i = $((e) => e.fieldModalMode), a = $((e) => e.userManuallySelectedChart), o = $((e) => e.setActiveTab), s = $((e) => e.setActiveView), c = $((e) => e.setDisplayLimit), l = $((e) => e.closeFieldModal), [u, d] =
|
|
3276
|
+
function an() {
|
|
3277
|
+
let e = $((e) => e.activeTab), t = $((e) => e.activeView), n = $((e) => e.displayLimit), r = $((e) => e.showFieldModal), i = $((e) => e.fieldModalMode), a = $((e) => e.userManuallySelectedChart), o = $((e) => e.setActiveTab), s = $((e) => e.setActiveView), c = $((e) => e.setDisplayLimit), l = $((e) => e.closeFieldModal), [u, d] = H(0);
|
|
3307
3278
|
return {
|
|
3308
3279
|
activeTab: e,
|
|
3309
3280
|
activeView: t,
|
|
@@ -3321,42 +3292,42 @@ function rn() {
|
|
|
3321
3292
|
}
|
|
3322
3293
|
//#endregion
|
|
3323
3294
|
//#region src/client/utils/shareUtils.ts
|
|
3324
|
-
var
|
|
3325
|
-
function cn(e) {
|
|
3326
|
-
return (0, an.compressToEncodedURIComponent)(JSON.stringify(e));
|
|
3327
|
-
}
|
|
3295
|
+
var on = o(), sn = 1800, cn = "share=";
|
|
3328
3296
|
function ln(e) {
|
|
3297
|
+
return (0, on.compressToEncodedURIComponent)(JSON.stringify(e));
|
|
3298
|
+
}
|
|
3299
|
+
function un(e) {
|
|
3329
3300
|
try {
|
|
3330
|
-
let t = (0,
|
|
3301
|
+
let t = (0, on.decompressFromEncodedURIComponent)(e);
|
|
3331
3302
|
if (!t) return null;
|
|
3332
3303
|
let n = JSON.parse(t);
|
|
3333
|
-
return
|
|
3304
|
+
return O(n) ? n : (console.warn("[shareUtils] Invalid AnalysisConfig in share URL"), null);
|
|
3334
3305
|
} catch {
|
|
3335
3306
|
return null;
|
|
3336
3307
|
}
|
|
3337
3308
|
}
|
|
3338
|
-
function
|
|
3339
|
-
let t =
|
|
3309
|
+
function dn(e) {
|
|
3310
|
+
let t = ln(e);
|
|
3340
3311
|
return {
|
|
3341
|
-
ok: t.length <=
|
|
3312
|
+
ok: t.length <= sn,
|
|
3342
3313
|
size: t.length,
|
|
3343
|
-
maxSize:
|
|
3314
|
+
maxSize: sn
|
|
3344
3315
|
};
|
|
3345
3316
|
}
|
|
3346
|
-
function
|
|
3347
|
-
let t =
|
|
3348
|
-
if (t.length <=
|
|
3317
|
+
function fn(e) {
|
|
3318
|
+
let t = ln(e);
|
|
3319
|
+
if (t.length <= sn) return {
|
|
3349
3320
|
encoded: t,
|
|
3350
3321
|
queryOnly: !1
|
|
3351
3322
|
};
|
|
3352
|
-
let n =
|
|
3323
|
+
let n = ln({
|
|
3353
3324
|
version: e.version,
|
|
3354
3325
|
analysisType: e.analysisType,
|
|
3355
3326
|
activeView: e.activeView,
|
|
3356
3327
|
charts: {},
|
|
3357
3328
|
query: e.query
|
|
3358
3329
|
});
|
|
3359
|
-
return n.length <=
|
|
3330
|
+
return n.length <= sn ? {
|
|
3360
3331
|
encoded: n,
|
|
3361
3332
|
queryOnly: !0
|
|
3362
3333
|
} : {
|
|
@@ -3364,40 +3335,40 @@ function dn(e) {
|
|
|
3364
3335
|
queryOnly: !0
|
|
3365
3336
|
};
|
|
3366
3337
|
}
|
|
3367
|
-
function
|
|
3368
|
-
let { encoded: t } =
|
|
3369
|
-
return t ? `${window.location.origin}${window.location.pathname}#${
|
|
3338
|
+
function pn(e) {
|
|
3339
|
+
let { encoded: t } = fn(e);
|
|
3340
|
+
return t ? `${window.location.origin}${window.location.pathname}#${cn}${t}` : null;
|
|
3370
3341
|
}
|
|
3371
|
-
function
|
|
3342
|
+
function mn() {
|
|
3372
3343
|
if (typeof window > "u") return null;
|
|
3373
3344
|
let e = window.location.hash;
|
|
3374
|
-
return !e || !e.startsWith(`#${
|
|
3345
|
+
return !e || !e.startsWith(`#${cn}`) ? null : e.slice(7);
|
|
3375
3346
|
}
|
|
3376
|
-
function
|
|
3347
|
+
function hn() {
|
|
3377
3348
|
if (typeof window > "u") return;
|
|
3378
3349
|
let e = new URL(window.location.href);
|
|
3379
3350
|
e.hash = "", window.history.replaceState(null, "", e.toString());
|
|
3380
3351
|
}
|
|
3381
|
-
function
|
|
3382
|
-
let e =
|
|
3383
|
-
return e ?
|
|
3352
|
+
function gn() {
|
|
3353
|
+
let e = mn();
|
|
3354
|
+
return e ? un(e) : null;
|
|
3384
3355
|
}
|
|
3385
3356
|
//#endregion
|
|
3386
3357
|
//#region src/client/hooks/useAnalysisInitialization.ts
|
|
3387
|
-
function
|
|
3388
|
-
let { currentQuery: t, isValidQuery: n, chartType: r, chartConfig: i, displayConfig: a, onQueryChange: o, onChartConfigChange: s } = e, c = $((e) => e.load), l =
|
|
3389
|
-
|
|
3358
|
+
function _n(e) {
|
|
3359
|
+
let { currentQuery: t, isValidQuery: n, chartType: r, chartConfig: i, displayConfig: a, onQueryChange: o, onChartConfigChange: s } = e, c = $((e) => e.load), l = V(!1);
|
|
3360
|
+
z(() => {
|
|
3390
3361
|
if (l.current) return;
|
|
3391
3362
|
l.current = !0;
|
|
3392
|
-
let e =
|
|
3393
|
-
e && (c(e),
|
|
3394
|
-
}, [c]),
|
|
3363
|
+
let e = gn();
|
|
3364
|
+
e && (c(e), hn());
|
|
3365
|
+
}, [c]), z(() => {
|
|
3395
3366
|
o && n && o(t);
|
|
3396
3367
|
}, [
|
|
3397
3368
|
t,
|
|
3398
3369
|
n,
|
|
3399
3370
|
o
|
|
3400
|
-
]),
|
|
3371
|
+
]), z(() => {
|
|
3401
3372
|
s && s({
|
|
3402
3373
|
chartType: r,
|
|
3403
3374
|
chartConfig: i,
|
|
@@ -3412,86 +3383,86 @@ function gn(e) {
|
|
|
3412
3383
|
}
|
|
3413
3384
|
//#endregion
|
|
3414
3385
|
//#region src/client/hooks/useAnalysisBuilderHook.ts
|
|
3415
|
-
function
|
|
3416
|
-
let { initialData: t, externalColorPalette: n, onQueryChange: r, onChartConfigChange: i } = e, { features: a } = c(), o =
|
|
3386
|
+
function vn(e = {}) {
|
|
3387
|
+
let { initialData: t, externalColorPalette: n, onQueryChange: r, onChartConfigChange: i } = e, { features: a } = c(), o = Lt(), s = en(), l = tn({
|
|
3417
3388
|
queryState: s.queryState,
|
|
3418
3389
|
queryStates: s.queryStates,
|
|
3419
3390
|
isMultiQueryMode: s.isMultiQueryMode,
|
|
3420
3391
|
mergeStrategy: s.mergeStrategy,
|
|
3421
3392
|
activeQueryIndex: s.activeQueryIndex
|
|
3422
|
-
}), u = $((e) => e.funnelBindingKey), d = $((e) => e.analysisType), f = $((e) => e.funnelCube), p = $((e) => e.funnelSteps), m = $((e) => e.activeFunnelStepIndex), h = $((e) => e.funnelTimeDimension), g =
|
|
3393
|
+
}), u = $((e) => e.funnelBindingKey), d = $((e) => e.analysisType), f = $((e) => e.funnelCube), p = $((e) => e.funnelSteps), m = $((e) => e.activeFunnelStepIndex), h = $((e) => e.funnelTimeDimension), g = B(() => d !== "funnel" || !u?.dimension || !h || !p || p.length < 2 ? !1 : p.every((e) => e.filters.length > 0), [
|
|
3423
3394
|
d,
|
|
3424
3395
|
u,
|
|
3425
3396
|
h,
|
|
3426
3397
|
p
|
|
3427
|
-
]), _ = $((e) => e.charts.funnel?.chartType) || "funnel", v = $((e) => e.charts.funnel?.chartConfig), y =
|
|
3398
|
+
]), _ = $((e) => e.charts.funnel?.chartType) || "funnel", v = $((e) => e.charts.funnel?.chartConfig), y = B(() => v || {}, [v]), b = $((e) => e.flowCube), x = $((e) => e.flowBindingKey), S = $((e) => e.flowTimeDimension), C = $((e) => e.eventDimension), ee = $((e) => e.startingStep), w = $((e) => e.stepsBefore), te = $((e) => e.stepsAfter), T = $((e) => e.joinStrategy), E = $((e) => e.charts.flow?.displayConfig), ne = B(() => E || {
|
|
3428
3399
|
showLegend: !0,
|
|
3429
3400
|
showGrid: !0,
|
|
3430
3401
|
showTooltip: !0
|
|
3431
|
-
}, [
|
|
3402
|
+
}, [E]), D = $((e) => e.charts.flow?.chartType) || "sankey", O = $((e) => e.buildFunnelQueryFromSteps), k = B(() => d === "funnel" ? O() : null, [
|
|
3432
3403
|
d,
|
|
3433
|
-
|
|
3404
|
+
O,
|
|
3434
3405
|
p
|
|
3435
|
-
]),
|
|
3406
|
+
]), A = $((e) => e.buildFlowQuery), j = B(() => d === "flow" ? A() : null, [
|
|
3436
3407
|
d,
|
|
3437
|
-
|
|
3408
|
+
A,
|
|
3438
3409
|
b,
|
|
3439
3410
|
x,
|
|
3440
3411
|
S,
|
|
3412
|
+
C,
|
|
3441
3413
|
ee,
|
|
3414
|
+
w,
|
|
3442
3415
|
te,
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
w
|
|
3447
|
-
]), A = $((e) => e.retentionCube), j = $((e) => e.retentionBindingKey), ae = $((e) => e.retentionTimeDimension), oe = $((e) => e.retentionDateRange), M = $((e) => e.retentionCohortFilters), N = $((e) => e.retentionActivityFilters), P = $((e) => e.retentionBreakdowns), se = $((e) => e.retentionViewGranularity), ce = $((e) => e.retentionPeriods), F = $((e) => e.retentionType), I = $((e) => e.buildRetentionQuery), le = $((e) => e.getRetentionValidation), ue = $((e) => e.charts.retention?.displayConfig), R = $((e) => e.setRetentionCube), V = $((e) => e.setRetentionBindingKey), H = $((e) => e.setRetentionTimeDimension), U = $((e) => e.setRetentionDateRange), W = $((e) => e.setRetentionCohortFilters), de = $((e) => e.setRetentionActivityFilters), fe = $((e) => e.setRetentionBreakdowns), G = $((e) => e.addRetentionBreakdown), pe = $((e) => e.removeRetentionBreakdown), me = $((e) => e.setRetentionViewGranularity), he = $((e) => e.setRetentionPeriods), ge = $((e) => e.setRetentionType), _e = z(() => d === "retention" ? I() : null, [
|
|
3416
|
+
D,
|
|
3417
|
+
T
|
|
3418
|
+
]), M = $((e) => e.retentionCube), N = $((e) => e.retentionBindingKey), re = $((e) => e.retentionTimeDimension), ie = $((e) => e.retentionDateRange), ae = $((e) => e.retentionCohortFilters), oe = $((e) => e.retentionActivityFilters), P = $((e) => e.retentionBreakdowns), se = $((e) => e.retentionViewGranularity), F = $((e) => e.retentionPeriods), ce = $((e) => e.retentionType), I = $((e) => e.buildRetentionQuery), le = $((e) => e.getRetentionValidation), L = $((e) => e.charts.retention?.displayConfig), ue = $((e) => e.setRetentionCube), z = $((e) => e.setRetentionBindingKey), H = $((e) => e.setRetentionTimeDimension), U = $((e) => e.setRetentionDateRange), W = $((e) => e.setRetentionCohortFilters), G = $((e) => e.setRetentionActivityFilters), de = $((e) => e.setRetentionBreakdowns), fe = $((e) => e.addRetentionBreakdown), pe = $((e) => e.removeRetentionBreakdown), me = $((e) => e.setRetentionViewGranularity), he = $((e) => e.setRetentionPeriods), ge = $((e) => e.setRetentionType), _e = B(() => d === "retention" ? I() : null, [
|
|
3448
3419
|
d,
|
|
3449
3420
|
I,
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3421
|
+
M,
|
|
3422
|
+
N,
|
|
3423
|
+
re,
|
|
3424
|
+
ie,
|
|
3454
3425
|
P,
|
|
3455
3426
|
se,
|
|
3456
|
-
ce,
|
|
3457
3427
|
F,
|
|
3458
|
-
|
|
3459
|
-
N
|
|
3460
|
-
]), K = z(() => d === "retention" ? le() : null, [
|
|
3461
|
-
d,
|
|
3462
|
-
le,
|
|
3463
|
-
A,
|
|
3464
|
-
j,
|
|
3428
|
+
ce,
|
|
3465
3429
|
ae,
|
|
3466
3430
|
oe
|
|
3467
|
-
]), ve =
|
|
3431
|
+
]), ve = B(() => d === "retention" ? le() : null, [
|
|
3432
|
+
d,
|
|
3433
|
+
le,
|
|
3434
|
+
M,
|
|
3435
|
+
N,
|
|
3436
|
+
re,
|
|
3437
|
+
ie
|
|
3438
|
+
]), K = B(() => d === "retention" ? _e !== null : d === "flow" ? j !== null : d === "funnel" ? k !== null : s.isValidQuery ?? !1, [
|
|
3468
3439
|
d,
|
|
3469
3440
|
_e,
|
|
3441
|
+
j,
|
|
3470
3442
|
k,
|
|
3471
|
-
D,
|
|
3472
3443
|
s.isValidQuery
|
|
3473
|
-
]), q =
|
|
3444
|
+
]), q = nn({
|
|
3474
3445
|
currentQuery: s.currentQuery,
|
|
3475
3446
|
allQueries: s.allQueries,
|
|
3476
3447
|
multiQueryConfig: s.multiQueryConfig,
|
|
3477
3448
|
isMultiQueryMode: s.isMultiQueryMode,
|
|
3478
|
-
isValidQuery:
|
|
3449
|
+
isValidQuery: K,
|
|
3479
3450
|
initialData: t,
|
|
3480
3451
|
mergeStrategy: s.mergeStrategy,
|
|
3481
3452
|
funnelBindingKey: u,
|
|
3482
3453
|
isFunnelModeEnabled: g,
|
|
3483
3454
|
analysisType: d,
|
|
3484
|
-
serverFunnelQuery:
|
|
3485
|
-
serverFlowQuery:
|
|
3455
|
+
serverFunnelQuery: k,
|
|
3456
|
+
serverFlowQuery: j,
|
|
3486
3457
|
serverRetentionQuery: _e,
|
|
3487
|
-
retentionValidation:
|
|
3488
|
-
}), J =
|
|
3458
|
+
retentionValidation: ve
|
|
3459
|
+
}), J = rn({
|
|
3489
3460
|
externalColorPalette: n,
|
|
3490
3461
|
combinedMetrics: l.combinedMetrics,
|
|
3491
3462
|
combinedBreakdowns: l.combinedBreakdowns,
|
|
3492
3463
|
hasDebounced: q.hasDebounced
|
|
3493
|
-
}), Y =
|
|
3494
|
-
|
|
3464
|
+
}), Y = an();
|
|
3465
|
+
_n({
|
|
3495
3466
|
currentQuery: s.currentQuery,
|
|
3496
3467
|
isValidQuery: s.isValidQuery ?? !1,
|
|
3497
3468
|
chartType: J.chartType,
|
|
@@ -3500,11 +3471,11 @@ function _n(e = {}) {
|
|
|
3500
3471
|
onQueryChange: r,
|
|
3501
3472
|
onChartConfigChange: i
|
|
3502
3473
|
});
|
|
3503
|
-
let ye = $((e) => e.openMetricsModal), be = $((e) => e.addMetric), xe = $((e) => e.removeMetric), Se = $((e) => e.toggleMetric), Ce = $((e) => e.reorderMetrics), we = $((e) => e.openBreakdownsModal), Te = $((e) => e.addBreakdown), Ee = $((e) => e.removeBreakdown), De = $((e) => e.toggleBreakdown), Oe = $((e) => e.setBreakdownGranularity), ke = $((e) => e.toggleBreakdownComparison), Ae = $((e) => e.reorderBreakdowns), je = $((e) => e.setFilters), Me = $((e) => e.dropFieldToFilter), Ne = $((e) => e.setOrder), Pe = $((e) => e.setLimit), Fe = $((e) => e.clearQuery), Ie = $((e) => e.clearCurrentMode), Le = $((e) => e.setFunnelBindingKey), Re = $((e) => e.setAnalysisType), ze = $((e) => e.setFunnelCube), Be = $((e) => e.addFunnelStep), Ve = $((e) => e.removeFunnelStep), He = $((e) => e.updateFunnelStep), Ue = $((e) => e.setActiveFunnelStepIndex), We = $((e) => e.reorderFunnelSteps), Ge = $((e) => e.setFunnelTimeDimension), Ke = $((e) => e.charts.funnel?.displayConfig), qe =
|
|
3474
|
+
let ye = $((e) => e.openMetricsModal), be = $((e) => e.addMetric), xe = $((e) => e.removeMetric), Se = $((e) => e.toggleMetric), Ce = $((e) => e.reorderMetrics), we = $((e) => e.openBreakdownsModal), Te = $((e) => e.addBreakdown), Ee = $((e) => e.removeBreakdown), De = $((e) => e.toggleBreakdown), Oe = $((e) => e.setBreakdownGranularity), ke = $((e) => e.toggleBreakdownComparison), Ae = $((e) => e.reorderBreakdowns), je = $((e) => e.setFilters), Me = $((e) => e.dropFieldToFilter), Ne = $((e) => e.setOrder), Pe = $((e) => e.setLimit), Fe = $((e) => e.clearQuery), Ie = $((e) => e.clearCurrentMode), Le = $((e) => e.setFunnelBindingKey), Re = $((e) => e.setAnalysisType), ze = $((e) => e.setFunnelCube), Be = $((e) => e.addFunnelStep), Ve = $((e) => e.removeFunnelStep), He = $((e) => e.updateFunnelStep), Ue = $((e) => e.setActiveFunnelStepIndex), We = $((e) => e.reorderFunnelSteps), Ge = $((e) => e.setFunnelTimeDimension), Ke = $((e) => e.charts.funnel?.displayConfig), qe = B(() => Ke || {
|
|
3504
3475
|
showLegend: !0,
|
|
3505
3476
|
showGrid: !0,
|
|
3506
3477
|
showTooltip: !0
|
|
3507
|
-
}, [Ke]), Je = $((e) => e.setFunnelDisplayConfig), Ye = $((e) => e.setFlowCube), Xe = $((e) => e.setFlowBindingKey), Ze = $((e) => e.setFlowTimeDimension), Qe = $((e) => e.setEventDimension), $e = $((e) => e.setStartingStepName), et = $((e) => e.setStartingStepFilters), tt = $((e) => e.setStepsBefore), nt = $((e) => e.setStepsAfter), rt = $((e) => e.setJoinStrategy), it =
|
|
3478
|
+
}, [Ke]), Je = $((e) => e.setFunnelDisplayConfig), Ye = $((e) => e.setFlowCube), Xe = $((e) => e.setFlowBindingKey), Ze = $((e) => e.setFlowTimeDimension), Qe = $((e) => e.setEventDimension), $e = $((e) => e.setStartingStepName), et = $((e) => e.setStartingStepFilters), tt = $((e) => e.setStepsBefore), nt = $((e) => e.setStepsAfter), rt = $((e) => e.setJoinStrategy), it = R((e) => {
|
|
3508
3479
|
o.setState((t) => ({ charts: {
|
|
3509
3480
|
...t.charts,
|
|
3510
3481
|
flow: {
|
|
@@ -3516,7 +3487,7 @@ function _n(e = {}) {
|
|
|
3516
3487
|
displayConfig: e
|
|
3517
3488
|
}
|
|
3518
3489
|
} }));
|
|
3519
|
-
}, [o]), at =
|
|
3490
|
+
}, [o]), at = R((e) => {
|
|
3520
3491
|
o.setState((t) => ({ charts: {
|
|
3521
3492
|
...t.charts,
|
|
3522
3493
|
retention: {
|
|
@@ -3528,7 +3499,7 @@ function _n(e = {}) {
|
|
|
3528
3499
|
displayConfig: e
|
|
3529
3500
|
}
|
|
3530
3501
|
} }));
|
|
3531
|
-
}, [o]), ot = $((e) => e.aiState), st = $((e) => e.openAI), ct = $((e) => e.closeAI), lt = $((e) => e.setAIPrompt), ut = $((e) => e.setAIGenerating), dt = $((e) => e.setAIError), ft = $((e) => e.setAIHasGeneratedQuery), pt = $((e) => e.saveAIPreviousState),
|
|
3502
|
+
}, [o]), ot = $((e) => e.aiState), st = $((e) => e.openAI), ct = $((e) => e.closeAI), lt = $((e) => e.setAIPrompt), ut = $((e) => e.setAIGenerating), dt = $((e) => e.setAIError), ft = $((e) => e.setAIHasGeneratedQuery), pt = $((e) => e.saveAIPreviousState), mt = $((e) => e.restoreAIPreviousState), X = V("idle"), Z = K, ht = $((e) => e.getValidation), gt = B(() => ht(), [
|
|
3532
3503
|
ht,
|
|
3533
3504
|
s.queryStates,
|
|
3534
3505
|
d,
|
|
@@ -3538,20 +3509,20 @@ function _n(e = {}) {
|
|
|
3538
3509
|
b,
|
|
3539
3510
|
x,
|
|
3540
3511
|
S,
|
|
3512
|
+
C,
|
|
3541
3513
|
ee,
|
|
3514
|
+
w,
|
|
3542
3515
|
te,
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
]), gt = L((e, t, n, r) => {
|
|
3547
|
-
Y.fieldModalMode === "metrics" && t === "measure" ? Se(e.name) : Y.fieldModalMode === "breakdown" && (d === "retention" && t === "dimension" ? G({ field: e.name }) : De(e.name, t === "timeDimension")), r || Y.closeFieldModal();
|
|
3516
|
+
T
|
|
3517
|
+
]), Q = R((e, t, n, r) => {
|
|
3518
|
+
Y.fieldModalMode === "metrics" && t === "measure" ? Se(e.name) : Y.fieldModalMode === "breakdown" && (d === "retention" && t === "dimension" ? fe({ field: e.name }) : De(e.name, t === "timeDimension")), r || Y.closeFieldModal();
|
|
3548
3519
|
}, [
|
|
3549
3520
|
Y,
|
|
3550
3521
|
Se,
|
|
3551
3522
|
De,
|
|
3552
|
-
|
|
3523
|
+
fe,
|
|
3553
3524
|
d
|
|
3554
|
-
]), _t =
|
|
3525
|
+
]), _t = R(async () => {
|
|
3555
3526
|
if (a?.aiEndpoint) {
|
|
3556
3527
|
pt(), ut(!0), dt(null);
|
|
3557
3528
|
try {
|
|
@@ -3568,15 +3539,15 @@ function _n(e = {}) {
|
|
|
3568
3539
|
ut,
|
|
3569
3540
|
dt,
|
|
3570
3541
|
ft
|
|
3571
|
-
]), vt =
|
|
3542
|
+
]), vt = R(() => {
|
|
3572
3543
|
ct(), ft(!1);
|
|
3573
|
-
}, [ct, ft]), yt =
|
|
3574
|
-
|
|
3575
|
-
}, [
|
|
3576
|
-
|
|
3577
|
-
|
|
3544
|
+
}, [ct, ft]), yt = R(() => {
|
|
3545
|
+
mt(), ct();
|
|
3546
|
+
}, [mt, ct]), bt = R(async () => {
|
|
3547
|
+
X.current = "copied", setTimeout(() => {
|
|
3548
|
+
X.current = "idle";
|
|
3578
3549
|
}, 2e3);
|
|
3579
|
-
}, []), xt =
|
|
3550
|
+
}, []), xt = R(() => {
|
|
3580
3551
|
let e = o.getState();
|
|
3581
3552
|
return e.analysisType === "funnel" ? e.buildFunnelQueryFromSteps() || e.buildCurrentQuery() : e.queryStates.length > 1 ? {
|
|
3582
3553
|
queries: e.buildAllQueries(),
|
|
@@ -3586,7 +3557,7 @@ function _n(e = {}) {
|
|
|
3586
3557
|
funnelBindingKey: e.funnelBindingKey,
|
|
3587
3558
|
stepTimeToConvert: e.stepTimeToConvert
|
|
3588
3559
|
} : e.buildCurrentQuery();
|
|
3589
|
-
}, [o]), St =
|
|
3560
|
+
}, [o]), St = R(() => {
|
|
3590
3561
|
let e = o.getState(), t = e.charts[e.analysisType];
|
|
3591
3562
|
return t ? {
|
|
3592
3563
|
chartType: t.chartType,
|
|
@@ -3602,7 +3573,7 @@ function _n(e = {}) {
|
|
|
3602
3573
|
J.chartType,
|
|
3603
3574
|
J.chartConfig,
|
|
3604
3575
|
J.displayConfig
|
|
3605
|
-
]), Ct =
|
|
3576
|
+
]), Ct = R(() => o.getState().analysisType, [o]);
|
|
3606
3577
|
return {
|
|
3607
3578
|
queryState: s.queryState,
|
|
3608
3579
|
queryStates: s.queryStates,
|
|
@@ -3627,30 +3598,30 @@ function _n(e = {}) {
|
|
|
3627
3598
|
flowCube: b,
|
|
3628
3599
|
flowBindingKey: x,
|
|
3629
3600
|
flowTimeDimension: S,
|
|
3630
|
-
eventDimension:
|
|
3631
|
-
startingStep:
|
|
3632
|
-
stepsBefore:
|
|
3633
|
-
stepsAfter:
|
|
3634
|
-
joinStrategy:
|
|
3635
|
-
flowDisplayConfig:
|
|
3636
|
-
retentionCube:
|
|
3637
|
-
retentionBindingKey:
|
|
3638
|
-
retentionTimeDimension:
|
|
3639
|
-
retentionDateRange:
|
|
3640
|
-
retentionCohortFilters:
|
|
3641
|
-
retentionActivityFilters:
|
|
3601
|
+
eventDimension: C,
|
|
3602
|
+
startingStep: ee,
|
|
3603
|
+
stepsBefore: w,
|
|
3604
|
+
stepsAfter: te,
|
|
3605
|
+
joinStrategy: T,
|
|
3606
|
+
flowDisplayConfig: ne,
|
|
3607
|
+
retentionCube: M,
|
|
3608
|
+
retentionBindingKey: N,
|
|
3609
|
+
retentionTimeDimension: re,
|
|
3610
|
+
retentionDateRange: ie,
|
|
3611
|
+
retentionCohortFilters: ae,
|
|
3612
|
+
retentionActivityFilters: oe,
|
|
3642
3613
|
retentionBreakdowns: P,
|
|
3643
3614
|
retentionViewGranularity: se,
|
|
3644
|
-
retentionPeriods:
|
|
3645
|
-
retentionType:
|
|
3646
|
-
retentionDisplayConfig:
|
|
3615
|
+
retentionPeriods: F,
|
|
3616
|
+
retentionType: ce,
|
|
3617
|
+
retentionDisplayConfig: L,
|
|
3647
3618
|
executionStatus: q.executionStatus,
|
|
3648
3619
|
executionResults: q.executionResults,
|
|
3649
3620
|
perQueryResults: q.perQueryResults,
|
|
3650
3621
|
isLoading: q.isLoading,
|
|
3651
3622
|
isFetching: q.isFetching,
|
|
3652
3623
|
error: q.error,
|
|
3653
|
-
isValidQuery:
|
|
3624
|
+
isValidQuery: K,
|
|
3654
3625
|
debugDataPerQuery: q.debugDataPerQuery,
|
|
3655
3626
|
needsRefresh: q.needsRefresh,
|
|
3656
3627
|
warnings: q.warnings,
|
|
@@ -3686,9 +3657,9 @@ function _n(e = {}) {
|
|
|
3686
3657
|
error: ot.error,
|
|
3687
3658
|
hasGeneratedQuery: ot.hasGeneratedQuery
|
|
3688
3659
|
},
|
|
3689
|
-
shareButtonState:
|
|
3690
|
-
canShare:
|
|
3691
|
-
adapterValidation:
|
|
3660
|
+
shareButtonState: X.current,
|
|
3661
|
+
canShare: Z,
|
|
3662
|
+
adapterValidation: gt,
|
|
3692
3663
|
actions: {
|
|
3693
3664
|
setActiveQueryIndex: s.setActiveQueryIndex,
|
|
3694
3665
|
setMergeStrategy: s.setMergeStrategy,
|
|
@@ -3730,14 +3701,14 @@ function _n(e = {}) {
|
|
|
3730
3701
|
setStepsAfter: nt,
|
|
3731
3702
|
setJoinStrategy: rt,
|
|
3732
3703
|
setFlowDisplayConfig: it,
|
|
3733
|
-
setRetentionCube:
|
|
3734
|
-
setRetentionBindingKey:
|
|
3704
|
+
setRetentionCube: ue,
|
|
3705
|
+
setRetentionBindingKey: z,
|
|
3735
3706
|
setRetentionTimeDimension: H,
|
|
3736
3707
|
setRetentionDateRange: U,
|
|
3737
3708
|
setRetentionCohortFilters: W,
|
|
3738
|
-
setRetentionActivityFilters:
|
|
3739
|
-
setRetentionBreakdowns:
|
|
3740
|
-
addRetentionBreakdown:
|
|
3709
|
+
setRetentionActivityFilters: G,
|
|
3710
|
+
setRetentionBreakdowns: de,
|
|
3711
|
+
addRetentionBreakdown: fe,
|
|
3741
3712
|
removeRetentionBreakdown: pe,
|
|
3742
3713
|
setRetentionViewGranularity: me,
|
|
3743
3714
|
setRetentionPeriods: he,
|
|
@@ -3762,7 +3733,7 @@ function _n(e = {}) {
|
|
|
3762
3733
|
clearQuery: Fe,
|
|
3763
3734
|
clearCurrentMode: Ie,
|
|
3764
3735
|
refetch: q.refetch,
|
|
3765
|
-
handleFieldSelected:
|
|
3736
|
+
handleFieldSelected: Q
|
|
3766
3737
|
},
|
|
3767
3738
|
getQueryConfig: xt,
|
|
3768
3739
|
getChartConfig: St,
|
|
@@ -3771,7 +3742,7 @@ function _n(e = {}) {
|
|
|
3771
3742
|
}
|
|
3772
3743
|
//#endregion
|
|
3773
3744
|
//#region src/client/utils/funnelValidation.ts
|
|
3774
|
-
function
|
|
3745
|
+
function yn(e, t) {
|
|
3775
3746
|
let n = [];
|
|
3776
3747
|
if (!t?.cubes) return n;
|
|
3777
3748
|
if (typeof e.dimension == "string") {
|
|
@@ -3795,7 +3766,7 @@ function vn(e, t) {
|
|
|
3795
3766
|
}
|
|
3796
3767
|
return n;
|
|
3797
3768
|
}
|
|
3798
|
-
function
|
|
3769
|
+
function bn(e) {
|
|
3799
3770
|
let t = [];
|
|
3800
3771
|
for (let n = 0; n < e.length; n++) {
|
|
3801
3772
|
let r = e[n], i = r.query;
|
|
@@ -3807,17 +3778,17 @@ function yn(e) {
|
|
|
3807
3778
|
}
|
|
3808
3779
|
return t;
|
|
3809
3780
|
}
|
|
3810
|
-
function
|
|
3781
|
+
function xn(e, t) {
|
|
3811
3782
|
if (typeof e.dimension == "string") return !0;
|
|
3812
|
-
let n =
|
|
3783
|
+
let n = w(t);
|
|
3813
3784
|
return n ? e.dimension.some((e) => e.cube === n) : !1;
|
|
3814
3785
|
}
|
|
3815
|
-
function
|
|
3786
|
+
function Sn(e, t) {
|
|
3816
3787
|
let n = [];
|
|
3817
3788
|
for (let r = 0; r < t.length; r++) {
|
|
3818
3789
|
let i = t[r];
|
|
3819
|
-
if (!
|
|
3820
|
-
let e =
|
|
3790
|
+
if (!xn(e, i.query)) {
|
|
3791
|
+
let e = w(i.query) || "unknown";
|
|
3821
3792
|
n.push({
|
|
3822
3793
|
type: "cross_cube",
|
|
3823
3794
|
message: `Step ${r + 1} uses cube "${e}" but no binding key mapping exists for it`,
|
|
@@ -3827,26 +3798,26 @@ function xn(e, t) {
|
|
|
3827
3798
|
}
|
|
3828
3799
|
return n;
|
|
3829
3800
|
}
|
|
3830
|
-
function
|
|
3801
|
+
function Cn(e) {
|
|
3831
3802
|
return e ? /^P(?:\d+Y)?(?:\d+M)?(?:\d+W)?(?:\d+D)?(?:T(?:\d+H)?(?:\d+M)?(?:\d+S)?)?$/.test(e) ? null : {
|
|
3832
3803
|
type: "time_window",
|
|
3833
3804
|
message: `Invalid time window format "${e}". Expected ISO 8601 duration (e.g., P7D, PT1H)`
|
|
3834
3805
|
} : null;
|
|
3835
3806
|
}
|
|
3836
|
-
function
|
|
3807
|
+
function wn(e, t) {
|
|
3837
3808
|
let n = [], r = [];
|
|
3838
3809
|
e.steps.length < 2 && n.push({
|
|
3839
3810
|
type: "general",
|
|
3840
3811
|
message: "Funnel requires at least 2 steps"
|
|
3841
|
-
}), e.bindingKey?.dimension ? (n.push(...
|
|
3812
|
+
}), e.bindingKey?.dimension ? (n.push(...yn(e.bindingKey, t)), n.push(...Sn(e.bindingKey, e.steps))) : n.push({
|
|
3842
3813
|
type: "binding_key",
|
|
3843
3814
|
message: "Binding key dimension is required"
|
|
3844
|
-
}), n.push(...
|
|
3815
|
+
}), n.push(...bn(e.steps));
|
|
3845
3816
|
for (let t = 0; t < e.steps.length; t++) {
|
|
3846
|
-
let r = e.steps[t], i =
|
|
3817
|
+
let r = e.steps[t], i = Cn(r.timeToConvert);
|
|
3847
3818
|
i && (i.stepIndex = t, n.push(i));
|
|
3848
3819
|
}
|
|
3849
|
-
let i =
|
|
3820
|
+
let i = Cn(e.globalTimeWindow);
|
|
3850
3821
|
return i && n.push(i), e.steps.length > 5 && r.push({
|
|
3851
3822
|
type: "general",
|
|
3852
3823
|
message: "Funnels with more than 5 steps may have reduced performance"
|
|
@@ -3856,7 +3827,7 @@ function Cn(e, t) {
|
|
|
3856
3827
|
warnings: r
|
|
3857
3828
|
};
|
|
3858
3829
|
}
|
|
3859
|
-
function
|
|
3830
|
+
function Tn(e, t) {
|
|
3860
3831
|
return t < 2 ? {
|
|
3861
3832
|
isValid: !1,
|
|
3862
3833
|
message: "Add at least 2 steps for funnel"
|
|
@@ -3865,7 +3836,7 @@ function wn(e, t) {
|
|
|
3865
3836
|
message: "Select a binding key dimension"
|
|
3866
3837
|
} : { isValid: !0 };
|
|
3867
3838
|
}
|
|
3868
|
-
function
|
|
3839
|
+
function En(e) {
|
|
3869
3840
|
if (!e?.cubes) return [];
|
|
3870
3841
|
let t = [];
|
|
3871
3842
|
for (let n of e.cubes) if (n.dimensions) for (let e of n.dimensions) (e.type === "string" || e.type === "number") && t.push({
|
|
@@ -3875,7 +3846,7 @@ function Tn(e) {
|
|
|
3875
3846
|
});
|
|
3876
3847
|
return t;
|
|
3877
3848
|
}
|
|
3878
|
-
function
|
|
3849
|
+
function Dn(e) {
|
|
3879
3850
|
if (!e?.dimension) return "Select binding key...";
|
|
3880
3851
|
if (typeof e.dimension == "string") return e.dimension.split(".")[1] || e.dimension;
|
|
3881
3852
|
if (e.dimension.length > 0) {
|
|
@@ -3885,6 +3856,6 @@ function En(e) {
|
|
|
3885
3856
|
return "Select binding key...";
|
|
3886
3857
|
}
|
|
3887
3858
|
//#endregion
|
|
3888
|
-
export {
|
|
3859
|
+
export { Wt as A, It as C, Vt as D, Rt as E, at as F, ze as I, $ as M, Lt as N, Gt as O, ot as P, qt as S, Ht as T, Yt as _, Sn as a, Jt as b, vn as c, un as d, pn as f, Xt as g, gn as h, yn as i, Ut as j, zt as k, ln as l, mn as m, Dn as n, wn as o, dn as p, Tn as r, bn as s, En as t, fn as u, $t as v, Bt as w, Zt as x, Qt as y };
|
|
3889
3860
|
|
|
3890
|
-
//# sourceMappingURL=analysis-builder-shared-
|
|
3861
|
+
//# sourceMappingURL=analysis-builder-shared-BWc7ZZnG.js.map
|