drizzle-cube 0.4.40 → 0.4.42
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/cli/index.cjs +439 -0
- package/dist/client/charts/ChartLoader.d.ts +18 -3
- package/dist/client/charts/chartConfigRegistry.d.ts +11 -1
- package/dist/client/charts/chartPlugin.d.ts +74 -0
- package/dist/client/charts/lazyChartConfigRegistry.d.ts +10 -0
- package/dist/client/charts.js +13 -15
- package/dist/client/chunks/{DashboardEditModal-iGhIvNP6.js → DashboardEditModal-4zzjtZRR.js} +683 -685
- package/dist/client/chunks/DashboardEditModal-4zzjtZRR.js.map +1 -0
- package/dist/client/chunks/{FieldSearchModal-BxQ5JhWz.js → FieldSearchModal-trURu9Sa.js} +15 -16
- package/dist/client/chunks/{FieldSearchModal-BxQ5JhWz.js.map → FieldSearchModal-trURu9Sa.js.map} +1 -1
- package/dist/client/chunks/{RetentionCombinedChart-D4Yf1TnQ.js → RetentionCombinedChart-B1hUYaXt.js} +2 -2
- package/dist/client/chunks/{RetentionCombinedChart-D4Yf1TnQ.js.map → RetentionCombinedChart-B1hUYaXt.js.map} +1 -1
- package/dist/client/chunks/{RetentionHeatmap-BoGY6mlZ.js → RetentionHeatmap-Dn2ocjVf.js} +2 -2
- package/dist/client/chunks/{RetentionHeatmap-BoGY6mlZ.js.map → RetentionHeatmap-Dn2ocjVf.js.map} +1 -1
- package/dist/client/chunks/{analysis-builder-DEGG5NwE.js → analysis-builder-B7XSIMkr.js} +1474 -1523
- package/dist/client/chunks/analysis-builder-B7XSIMkr.js.map +1 -0
- package/dist/client/chunks/{analysis-builder-shared-BxHYfTzo.js → analysis-builder-shared-DaqtrLxd.js} +762 -778
- package/dist/client/chunks/analysis-builder-shared-DaqtrLxd.js.map +1 -0
- package/dist/client/chunks/{chart-bar-Bx4oKlqo.js → chart-bar-CPt67rLR.js} +1 -1
- package/dist/client/chunks/{chart-bar-Bx4oKlqo.js.map → chart-bar-CPt67rLR.js.map} +1 -1
- package/dist/client/chunks/{chart-box-plot-CVIi1aM5.js → chart-box-plot-Dp_nqQen.js} +1 -1
- package/dist/client/chunks/{chart-box-plot-CVIi1aM5.js.map → chart-box-plot-Dp_nqQen.js.map} +1 -1
- package/dist/client/chunks/{chart-bubble-DvyG15UB.js → chart-bubble-CYQ8loeS.js} +1 -1
- package/dist/client/chunks/{chart-bubble-DvyG15UB.js.map → chart-bubble-CYQ8loeS.js.map} +1 -1
- package/dist/client/chunks/{chart-candlestick-caHyxB9O.js → chart-candlestick-DTeSf7C5.js} +1 -1
- package/dist/client/chunks/{chart-candlestick-caHyxB9O.js.map → chart-candlestick-DTeSf7C5.js.map} +1 -1
- package/dist/client/chunks/{chart-config-activity-grid-USo7JrPh.js → chart-config-activity-grid-BSWS08cI.js} +1 -1
- package/dist/client/chunks/{chart-config-activity-grid-USo7JrPh.js.map → chart-config-activity-grid-BSWS08cI.js.map} +1 -1
- package/dist/client/chunks/{chart-config-area-D_ZufYzg.js → chart-config-area-DKwgcHp4.js} +1 -1
- package/dist/client/chunks/{chart-config-area-D_ZufYzg.js.map → chart-config-area-DKwgcHp4.js.map} +1 -1
- package/dist/client/chunks/{chart-config-bar-BCi2Wmd6.js → chart-config-bar-deTjEhap.js} +1 -1
- package/dist/client/chunks/{chart-config-bar-BCi2Wmd6.js.map → chart-config-bar-deTjEhap.js.map} +1 -1
- package/dist/client/chunks/{chart-config-box-plot-afKLzJSp.js → chart-config-box-plot-DU4iWk3V.js} +1 -1
- package/dist/client/chunks/{chart-config-box-plot-afKLzJSp.js.map → chart-config-box-plot-DU4iWk3V.js.map} +1 -1
- package/dist/client/chunks/{chart-config-bubble-CgbBjPv8.js → chart-config-bubble-B8FSHSW-.js} +1 -1
- package/dist/client/chunks/{chart-config-bubble-CgbBjPv8.js.map → chart-config-bubble-B8FSHSW-.js.map} +1 -1
- package/dist/client/chunks/{chart-config-candlestick-7boGjZ-A.js → chart-config-candlestick-BGfyWFft.js} +1 -1
- package/dist/client/chunks/{chart-config-candlestick-7boGjZ-A.js.map → chart-config-candlestick-BGfyWFft.js.map} +1 -1
- package/dist/client/chunks/{chart-config-data-table-Cl7sBasW.js → chart-config-data-table-DKRcGa8t.js} +1 -1
- package/dist/client/chunks/{chart-config-data-table-Cl7sBasW.js.map → chart-config-data-table-DKRcGa8t.js.map} +1 -1
- package/dist/client/chunks/{chart-config-funnel-CXPYQtTl.js → chart-config-funnel-Bt4iGFo_.js} +1 -1
- package/dist/client/chunks/{chart-config-funnel-CXPYQtTl.js.map → chart-config-funnel-Bt4iGFo_.js.map} +1 -1
- package/dist/client/chunks/{chart-config-gauge-DUNEUCvh.js → chart-config-gauge-Bk4Jjp3W.js} +1 -1
- package/dist/client/chunks/{chart-config-gauge-DUNEUCvh.js.map → chart-config-gauge-Bk4Jjp3W.js.map} +1 -1
- package/dist/client/chunks/{chart-config-heat-map-BFf1tO11.js → chart-config-heat-map-CkHsqkrY.js} +1 -1
- package/dist/client/chunks/{chart-config-heat-map-BFf1tO11.js.map → chart-config-heat-map-CkHsqkrY.js.map} +1 -1
- package/dist/client/chunks/{chart-config-kpi-delta-C5k2waIJ.js → chart-config-kpi-delta-CkUX98JV.js} +1 -1
- package/dist/client/chunks/{chart-config-kpi-delta-C5k2waIJ.js.map → chart-config-kpi-delta-CkUX98JV.js.map} +1 -1
- package/dist/client/chunks/{chart-config-kpi-number-DptOyhk0.js → chart-config-kpi-number-DcxyiUgs.js} +1 -1
- package/dist/client/chunks/{chart-config-kpi-number-DptOyhk0.js.map → chart-config-kpi-number-DcxyiUgs.js.map} +1 -1
- package/dist/client/chunks/{chart-config-kpi-text-D9DdVWqd.js → chart-config-kpi-text-DI4mj8CN.js} +1 -1
- package/dist/client/chunks/{chart-config-kpi-text-D9DdVWqd.js.map → chart-config-kpi-text-DI4mj8CN.js.map} +1 -1
- package/dist/client/chunks/{chart-config-line-B3NgLF7K.js → chart-config-line--j7-dLue.js} +1 -1
- package/dist/client/chunks/{chart-config-line-B3NgLF7K.js.map → chart-config-line--j7-dLue.js.map} +1 -1
- package/dist/client/chunks/{chart-config-markdown-tlfivQTt.js → chart-config-markdown-DUjvVjV4.js} +1 -1
- package/dist/client/chunks/{chart-config-markdown-tlfivQTt.js.map → chart-config-markdown-DUjvVjV4.js.map} +1 -1
- package/dist/client/chunks/{chart-config-measure-profile-D7XDwrU2.js → chart-config-measure-profile-B9FKBNGc.js} +1 -1
- package/dist/client/chunks/{chart-config-measure-profile-D7XDwrU2.js.map → chart-config-measure-profile-B9FKBNGc.js.map} +1 -1
- package/dist/client/chunks/{chart-config-pie-wY0B52PC.js → chart-config-pie-yU4jipl9.js} +1 -1
- package/dist/client/chunks/{chart-config-pie-wY0B52PC.js.map → chart-config-pie-yU4jipl9.js.map} +1 -1
- package/dist/client/chunks/{chart-config-radar-DRpJBy1M.js → chart-config-radar-R9Fkc8wL.js} +1 -1
- package/dist/client/chunks/{chart-config-radar-DRpJBy1M.js.map → chart-config-radar-R9Fkc8wL.js.map} +1 -1
- package/dist/client/chunks/{chart-config-radial-bar-DCUpXv9G.js → chart-config-radial-bar-DeoXfpIp.js} +1 -1
- package/dist/client/chunks/{chart-config-radial-bar-DCUpXv9G.js.map → chart-config-radial-bar-DeoXfpIp.js.map} +1 -1
- package/dist/client/chunks/{chart-config-sankey-CdOhlm4h.js → chart-config-sankey-CXEsxo6s.js} +1 -1
- package/dist/client/chunks/{chart-config-sankey-CdOhlm4h.js.map → chart-config-sankey-CXEsxo6s.js.map} +1 -1
- package/dist/client/chunks/{chart-config-scatter-B2su_x8f.js → chart-config-scatter-MVUFupub.js} +1 -1
- package/dist/client/chunks/{chart-config-scatter-B2su_x8f.js.map → chart-config-scatter-MVUFupub.js.map} +1 -1
- package/dist/client/chunks/{chart-config-sunburst-BPdjbk18.js → chart-config-sunburst-Z_gqIY5u.js} +1 -1
- package/dist/client/chunks/{chart-config-sunburst-BPdjbk18.js.map → chart-config-sunburst-Z_gqIY5u.js.map} +1 -1
- package/dist/client/chunks/{chart-config-tree-map-Cbsh2fe2.js → chart-config-tree-map-BD-xAeIy.js} +1 -1
- package/dist/client/chunks/{chart-config-tree-map-Cbsh2fe2.js.map → chart-config-tree-map-BD-xAeIy.js.map} +1 -1
- package/dist/client/chunks/{chart-config-waterfall-DGmuZfQF.js → chart-config-waterfall-CHwVkXZc.js} +1 -1
- package/dist/client/chunks/{chart-config-waterfall-DGmuZfQF.js.map → chart-config-waterfall-CHwVkXZc.js.map} +1 -1
- package/dist/client/chunks/{chart-data-table-CW_qZDpt.js → chart-data-table-BZ7StNWv.js} +1452 -826
- package/dist/client/chunks/chart-data-table-BZ7StNWv.js.map +1 -0
- package/dist/client/chunks/{chart-gauge-BLLJqeXo.js → chart-gauge-_Xdgk_qI.js} +1 -1
- package/dist/client/chunks/{chart-gauge-BLLJqeXo.js.map → chart-gauge-_Xdgk_qI.js.map} +1 -1
- package/dist/client/chunks/{chart-heat-map-f2fM2mDC.js → chart-heat-map-BOMQeUDL.js} +1 -1
- package/dist/client/chunks/{chart-heat-map-f2fM2mDC.js.map → chart-heat-map-BOMQeUDL.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-delta-BPexzOe7.js → chart-kpi-delta-C2tdpWki.js} +4 -4
- package/dist/client/chunks/{chart-kpi-delta-BPexzOe7.js.map → chart-kpi-delta-C2tdpWki.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-number-BBtGBtZL.js → chart-kpi-number-BUNKM7yg.js} +5 -5
- package/dist/client/chunks/{chart-kpi-number-BBtGBtZL.js.map → chart-kpi-number-BUNKM7yg.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-text-BqHhmJEB.js → chart-kpi-text-COF8iN0K.js} +2 -2
- package/dist/client/chunks/{chart-kpi-text-BqHhmJEB.js.map → chart-kpi-text-COF8iN0K.js.map} +1 -1
- package/dist/client/chunks/{chart-line-CPhQRMZ7.js → chart-line-D3SEwXDS.js} +1 -1
- package/dist/client/chunks/{chart-line-CPhQRMZ7.js.map → chart-line-D3SEwXDS.js.map} +1 -1
- package/dist/client/chunks/{chart-markdown-B2X4IwLO.js → chart-markdown-DMekYkKz.js} +647 -644
- package/dist/client/chunks/chart-markdown-DMekYkKz.js.map +1 -0
- package/dist/client/chunks/{chart-measure-profile-CVlqGslU.js → chart-measure-profile-BPhI1Z9s.js} +1 -1
- package/dist/client/chunks/{chart-measure-profile-CVlqGslU.js.map → chart-measure-profile-BPhI1Z9s.js.map} +1 -1
- package/dist/client/chunks/{chart-pie-DafSc9sE.js → chart-pie-COl3Rmdk.js} +1 -1
- package/dist/client/chunks/{chart-pie-DafSc9sE.js.map → chart-pie-COl3Rmdk.js.map} +1 -1
- package/dist/client/chunks/{chart-radar-Dz9F5k-B.js → chart-radar-BKZXylBB.js} +1 -1
- package/dist/client/chunks/{chart-radar-Dz9F5k-B.js.map → chart-radar-BKZXylBB.js.map} +1 -1
- package/dist/client/chunks/{chart-radial-bar-N3MNUL7o.js → chart-radial-bar-CMfC7SPd.js} +1 -1
- package/dist/client/chunks/{chart-radial-bar-N3MNUL7o.js.map → chart-radial-bar-CMfC7SPd.js.map} +1 -1
- package/dist/client/chunks/{chart-scatter-J2JNi88S.js → chart-scatter-xQMa3dUt.js} +1 -1
- package/dist/client/chunks/{chart-scatter-J2JNi88S.js.map → chart-scatter-xQMa3dUt.js.map} +1 -1
- package/dist/client/chunks/{chart-sunburst-D1NFQjqk.js → chart-sunburst-BGhJ4fui.js} +1 -1
- package/dist/client/chunks/{chart-sunburst-D1NFQjqk.js.map → chart-sunburst-BGhJ4fui.js.map} +1 -1
- package/dist/client/chunks/{chart-tree-map-CbYjko2s.js → chart-tree-map-Cn1pmrAw.js} +1 -1
- package/dist/client/chunks/{chart-tree-map-CbYjko2s.js.map → chart-tree-map-Cn1pmrAw.js.map} +1 -1
- package/dist/client/chunks/{chart-waterfall-Z65TGMUO.js → chart-waterfall-C2nVN4pn.js} +1 -1
- package/dist/client/chunks/{chart-waterfall-Z65TGMUO.js.map → chart-waterfall-C2nVN4pn.js.map} +1 -1
- package/dist/client/chunks/{charts-core-CJlGzwsW.js → charts-core-Cy3rHADX.js} +1 -1
- package/dist/client/chunks/{charts-core-CJlGzwsW.js.map → charts-core-Cy3rHADX.js.map} +1 -1
- package/dist/client/chunks/{core-DJrniqct.js → core-BdWfCZ3y.js} +1 -1
- package/dist/client/chunks/{core-DJrniqct.js.map → core-BdWfCZ3y.js.map} +1 -1
- package/dist/client/chunks/{dist-DDBeV_JI.js → dist-BWPE2m_X.js} +1 -1
- package/dist/client/chunks/{dist-DDBeV_JI.js.map → dist-BWPE2m_X.js.map} +1 -1
- package/dist/client/chunks/{javascript-BBwTSo6e.js → javascript-O1RIRkZr.js} +1 -1
- package/dist/client/chunks/{javascript-BBwTSo6e.js.map → javascript-O1RIRkZr.js.map} +1 -1
- package/dist/client/chunks/{json-BpTrLZSh.js → json-C5bX2tt1.js} +1 -1
- package/dist/client/chunks/{json-BpTrLZSh.js.map → json-C5bX2tt1.js.map} +1 -1
- package/dist/client/chunks/{retention-UEXlSdZ-.js → retention-YhT1Oohi.js} +1 -1
- package/dist/client/chunks/{retention-UEXlSdZ-.js.map → retention-YhT1Oohi.js.map} +1 -1
- package/dist/client/chunks/{schema-visualization-CwiEtwdu.js → schema-visualization-DVdfx6N8.js} +92 -96
- package/dist/client/chunks/schema-visualization-DVdfx6N8.js.map +1 -0
- package/dist/client/chunks/{sql-B0chxcEK.js → sql-D2qikO5q.js} +1 -1
- package/dist/client/chunks/{sql-B0chxcEK.js.map → sql-D2qikO5q.js.map} +1 -1
- package/dist/client/chunks/{syntaxHighlighting-BLl0ch4A.js → syntaxHighlighting-BYYWYmjr.js} +2 -2
- package/dist/client/chunks/{syntaxHighlighting-BLl0ch4A.js.map → syntaxHighlighting-BYYWYmjr.js.map} +1 -1
- package/dist/client/chunks/{useDebounce-C_wstEud.js → useDebounce-Bel8J05v.js} +12 -12
- package/dist/client/chunks/{useDebounce-C_wstEud.js.map → useDebounce-Bel8J05v.js.map} +1 -1
- package/dist/client/chunks/{useDirtyStateTracking-CgKZWkel.js → useDirtyStateTracking-KAjwj1Ht.js} +1 -1
- package/dist/client/chunks/{useDirtyStateTracking-CgKZWkel.js.map → useDirtyStateTracking-KAjwj1Ht.js.map} +1 -1
- package/dist/client/chunks/{useExplainAI-C9ytXRIC.js → useExplainAI-CxdzY2N0.js} +14 -14
- package/dist/client/chunks/{useExplainAI-C9ytXRIC.js.map → useExplainAI-CxdzY2N0.js.map} +1 -1
- package/dist/client/chunks/{useNotebookLayout-BFZ_33Kb.js → useNotebookLayout-DKkMenhj.js} +1 -1
- package/dist/client/chunks/{useNotebookLayout-BFZ_33Kb.js.map → useNotebookLayout-DKkMenhj.js.map} +1 -1
- package/dist/client/chunks/{utils-3FNmeZJR.js → utils-CMkS7h9x.js} +2 -2
- package/dist/client/chunks/{utils-3FNmeZJR.js.map → utils-CMkS7h9x.js.map} +1 -1
- package/dist/client/chunks/{vendor-BPRWulB7.js → vendor-BoWEubRu.js} +40 -40
- package/dist/client/chunks/{vendor-BPRWulB7.js.map → vendor-BoWEubRu.js.map} +1 -1
- package/dist/client/components.js +3 -3
- package/dist/client/hooks.js +5 -5
- package/dist/client/icons/registry.d.ts +6 -0
- package/dist/client/icons.js +2 -2
- package/dist/client/index.d.ts +3 -2
- package/dist/client/index.js +39 -41
- package/dist/client/index.js.map +1 -1
- package/dist/client/providers/CubeProvider.d.ts +4 -1
- package/dist/client/providers.js +2 -2
- package/dist/client/schema.d.ts +13 -0
- package/dist/client/schema.js +2 -0
- package/dist/client/styles.css +1 -1
- package/dist/client/types.d.ts +2 -1
- package/dist/client/utils.js +6 -6
- package/dist/client-bundle-stats.html +1 -1
- package/package.json +10 -2
- package/dist/client/chunks/DashboardEditModal-iGhIvNP6.js.map +0 -1
- package/dist/client/chunks/RetentionCombinedChart.config-DprbXd1N.js +0 -56
- package/dist/client/chunks/RetentionCombinedChart.config-DprbXd1N.js.map +0 -1
- package/dist/client/chunks/RetentionHeatmap.config-cbaNExVy.js +0 -25
- package/dist/client/chunks/RetentionHeatmap.config-cbaNExVy.js.map +0 -1
- package/dist/client/chunks/analysis-builder-DEGG5NwE.js.map +0 -1
- package/dist/client/chunks/analysis-builder-shared-BxHYfTzo.js.map +0 -1
- package/dist/client/chunks/chart-data-table-CW_qZDpt.js.map +0 -1
- package/dist/client/chunks/chart-markdown-B2X4IwLO.js.map +0 -1
- package/dist/client/chunks/charts-loader-gZjOqZwG.js +0 -259
- package/dist/client/chunks/charts-loader-gZjOqZwG.js.map +0 -1
- package/dist/client/chunks/lazyChartConfigRegistry-BjhxDaSf.js +0 -149
- package/dist/client/chunks/lazyChartConfigRegistry-BjhxDaSf.js.map +0 -1
- package/dist/client/chunks/schema-visualization-CwiEtwdu.js.map +0 -1
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
import { Suspense as e, lazy as t } from "react";
|
|
2
|
-
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
|
-
//#region src/client/components/charts/MissingDependencyFallback.tsx
|
|
4
|
-
function i({ chartType: e, packageName: t, installCommand: i, height: a = 200 }) {
|
|
5
|
-
return /* @__PURE__ */ r("div", {
|
|
6
|
-
className: "dc-missing-dependency-fallback",
|
|
7
|
-
style: {
|
|
8
|
-
height: typeof a == "number" ? `${a}px` : a,
|
|
9
|
-
display: "flex",
|
|
10
|
-
flexDirection: "column",
|
|
11
|
-
alignItems: "center",
|
|
12
|
-
justifyContent: "center",
|
|
13
|
-
width: "100%",
|
|
14
|
-
padding: "1.5rem",
|
|
15
|
-
textAlign: "center",
|
|
16
|
-
border: "1px dashed var(--dc-border, #e5e7eb)",
|
|
17
|
-
borderRadius: "0.5rem",
|
|
18
|
-
backgroundColor: "var(--dc-surface, #f9fafb)"
|
|
19
|
-
},
|
|
20
|
-
children: [
|
|
21
|
-
/* @__PURE__ */ n("div", {
|
|
22
|
-
style: {
|
|
23
|
-
fontSize: "2.5rem",
|
|
24
|
-
marginBottom: "1rem"
|
|
25
|
-
},
|
|
26
|
-
children: "📦"
|
|
27
|
-
}),
|
|
28
|
-
/* @__PURE__ */ n("h3", {
|
|
29
|
-
style: {
|
|
30
|
-
fontSize: "1.125rem",
|
|
31
|
-
fontWeight: 600,
|
|
32
|
-
marginBottom: "0.5rem",
|
|
33
|
-
color: "var(--dc-text, #111827)"
|
|
34
|
-
},
|
|
35
|
-
children: "Missing Dependency"
|
|
36
|
-
}),
|
|
37
|
-
/* @__PURE__ */ r("p", {
|
|
38
|
-
style: {
|
|
39
|
-
fontSize: "0.875rem",
|
|
40
|
-
color: "var(--dc-text-secondary, #6b7280)",
|
|
41
|
-
marginBottom: "1rem",
|
|
42
|
-
maxWidth: "28rem"
|
|
43
|
-
},
|
|
44
|
-
children: [
|
|
45
|
-
"The ",
|
|
46
|
-
/* @__PURE__ */ n("code", {
|
|
47
|
-
style: {
|
|
48
|
-
padding: "0.125rem 0.375rem",
|
|
49
|
-
backgroundColor: "var(--dc-surface-secondary, #f3f4f6)",
|
|
50
|
-
borderRadius: "0.25rem",
|
|
51
|
-
fontFamily: "monospace",
|
|
52
|
-
fontSize: "0.75rem"
|
|
53
|
-
},
|
|
54
|
-
children: e
|
|
55
|
-
}),
|
|
56
|
-
" chart requires the ",
|
|
57
|
-
/* @__PURE__ */ n("code", {
|
|
58
|
-
style: {
|
|
59
|
-
padding: "0.125rem 0.375rem",
|
|
60
|
-
backgroundColor: "var(--dc-surface-secondary, #f3f4f6)",
|
|
61
|
-
borderRadius: "0.25rem",
|
|
62
|
-
fontFamily: "monospace",
|
|
63
|
-
fontSize: "0.75rem"
|
|
64
|
-
},
|
|
65
|
-
children: t
|
|
66
|
-
}),
|
|
67
|
-
" package."
|
|
68
|
-
]
|
|
69
|
-
}),
|
|
70
|
-
/* @__PURE__ */ r("div", {
|
|
71
|
-
style: {
|
|
72
|
-
backgroundColor: "var(--dc-surface-secondary, #f3f4f6)",
|
|
73
|
-
borderRadius: "0.5rem",
|
|
74
|
-
padding: "0.75rem 1rem",
|
|
75
|
-
fontFamily: "monospace",
|
|
76
|
-
fontSize: "0.875rem",
|
|
77
|
-
color: "var(--dc-text, #111827)"
|
|
78
|
-
},
|
|
79
|
-
children: [/* @__PURE__ */ n("span", {
|
|
80
|
-
style: {
|
|
81
|
-
color: "var(--dc-text-muted, #9ca3af)",
|
|
82
|
-
userSelect: "none"
|
|
83
|
-
},
|
|
84
|
-
children: "$ "
|
|
85
|
-
}), i]
|
|
86
|
-
}),
|
|
87
|
-
/* @__PURE__ */ n("p", {
|
|
88
|
-
style: {
|
|
89
|
-
fontSize: "0.75rem",
|
|
90
|
-
color: "var(--dc-text-muted, #9ca3af)",
|
|
91
|
-
marginTop: "0.75rem"
|
|
92
|
-
},
|
|
93
|
-
children: "After installing, restart your development server."
|
|
94
|
-
})
|
|
95
|
-
]
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
//#endregion
|
|
99
|
-
//#region src/client/charts/ChartLoader.tsx
|
|
100
|
-
var a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), s = {
|
|
101
|
-
bar: {
|
|
102
|
-
packageName: "recharts",
|
|
103
|
-
installCommand: "npm install recharts"
|
|
104
|
-
},
|
|
105
|
-
line: {
|
|
106
|
-
packageName: "recharts",
|
|
107
|
-
installCommand: "npm install recharts"
|
|
108
|
-
},
|
|
109
|
-
area: {
|
|
110
|
-
packageName: "recharts",
|
|
111
|
-
installCommand: "npm install recharts"
|
|
112
|
-
},
|
|
113
|
-
pie: {
|
|
114
|
-
packageName: "recharts",
|
|
115
|
-
installCommand: "npm install recharts"
|
|
116
|
-
},
|
|
117
|
-
scatter: {
|
|
118
|
-
packageName: "recharts",
|
|
119
|
-
installCommand: "npm install recharts"
|
|
120
|
-
},
|
|
121
|
-
radar: {
|
|
122
|
-
packageName: "recharts",
|
|
123
|
-
installCommand: "npm install recharts"
|
|
124
|
-
},
|
|
125
|
-
radialBar: {
|
|
126
|
-
packageName: "recharts",
|
|
127
|
-
installCommand: "npm install recharts"
|
|
128
|
-
},
|
|
129
|
-
treemap: {
|
|
130
|
-
packageName: "recharts",
|
|
131
|
-
installCommand: "npm install recharts"
|
|
132
|
-
},
|
|
133
|
-
bubble: {
|
|
134
|
-
packageName: "recharts",
|
|
135
|
-
installCommand: "npm install recharts"
|
|
136
|
-
},
|
|
137
|
-
funnel: {
|
|
138
|
-
packageName: "recharts",
|
|
139
|
-
installCommand: "npm install recharts"
|
|
140
|
-
},
|
|
141
|
-
sankey: {
|
|
142
|
-
packageName: "recharts",
|
|
143
|
-
installCommand: "npm install recharts"
|
|
144
|
-
},
|
|
145
|
-
sunburst: {
|
|
146
|
-
packageName: "recharts",
|
|
147
|
-
installCommand: "npm install recharts"
|
|
148
|
-
},
|
|
149
|
-
heatmap: {
|
|
150
|
-
packageName: "@nivo/heatmap",
|
|
151
|
-
installCommand: "npm install @nivo/heatmap"
|
|
152
|
-
},
|
|
153
|
-
waterfall: {
|
|
154
|
-
packageName: "recharts",
|
|
155
|
-
installCommand: "npm install recharts"
|
|
156
|
-
},
|
|
157
|
-
measureProfile: {
|
|
158
|
-
packageName: "recharts",
|
|
159
|
-
installCommand: "npm install recharts"
|
|
160
|
-
},
|
|
161
|
-
gauge: {
|
|
162
|
-
packageName: "d3-shape",
|
|
163
|
-
installCommand: "npm install d3-shape"
|
|
164
|
-
}
|
|
165
|
-
}, c = {
|
|
166
|
-
bar: () => import("./chart-bar-Bx4oKlqo.js").then((e) => e.n),
|
|
167
|
-
line: () => import("./chart-line-CPhQRMZ7.js").then((e) => e.n),
|
|
168
|
-
area: () => import("./chart-area-e9ysnatQ.js").then((e) => e.n),
|
|
169
|
-
pie: () => import("./chart-pie-DafSc9sE.js").then((e) => e.n),
|
|
170
|
-
scatter: () => import("./chart-scatter-J2JNi88S.js").then((e) => e.n),
|
|
171
|
-
radar: () => import("./chart-radar-Dz9F5k-B.js").then((e) => e.n),
|
|
172
|
-
radialBar: () => import("./chart-radial-bar-N3MNUL7o.js").then((e) => e.n),
|
|
173
|
-
treemap: () => import("./chart-tree-map-CbYjko2s.js").then((e) => e.n),
|
|
174
|
-
bubble: () => import("./chart-bubble-DvyG15UB.js").then((e) => e.t),
|
|
175
|
-
table: () => import("./chart-data-table-CW_qZDpt.js").then((e) => e.n),
|
|
176
|
-
activityGrid: () => import("./chart-activity-grid-wR2Twpo7.js").then((e) => e.t),
|
|
177
|
-
kpiNumber: () => import("./chart-kpi-number-BBtGBtZL.js").then((e) => e.t),
|
|
178
|
-
kpiDelta: () => import("./chart-kpi-delta-BPexzOe7.js").then((e) => e.t),
|
|
179
|
-
kpiText: () => import("./chart-kpi-text-BqHhmJEB.js").then((e) => e.t),
|
|
180
|
-
markdown: () => import("./chart-markdown-B2X4IwLO.js").then((e) => e.n),
|
|
181
|
-
funnel: () => import("./chart-funnel-C9JRW79j.js").then((e) => e.n),
|
|
182
|
-
sankey: () => import("./chart-sankey-8nRYnupt.js").then((e) => e.t),
|
|
183
|
-
sunburst: () => import("./chart-sunburst-D1NFQjqk.js").then((e) => e.t),
|
|
184
|
-
heatmap: () => import("./chart-heat-map-f2fM2mDC.js").then((e) => e.t),
|
|
185
|
-
retentionHeatmap: () => import("./RetentionHeatmap-BoGY6mlZ.js"),
|
|
186
|
-
retentionCombined: () => import("./RetentionCombinedChart-D4Yf1TnQ.js"),
|
|
187
|
-
boxPlot: () => import("./chart-box-plot-CVIi1aM5.js").then((e) => e.t),
|
|
188
|
-
waterfall: () => import("./chart-waterfall-Z65TGMUO.js").then((e) => e.t),
|
|
189
|
-
candlestick: () => import("./chart-candlestick-caHyxB9O.js").then((e) => e.t),
|
|
190
|
-
measureProfile: () => import("./chart-measure-profile-CVlqGslU.js").then((e) => e.t),
|
|
191
|
-
gauge: () => import("./chart-gauge-BLLJqeXo.js").then((e) => e.t)
|
|
192
|
-
};
|
|
193
|
-
function l(e) {
|
|
194
|
-
let t = s[e], r = ({ height: r }) => /* @__PURE__ */ n(i, {
|
|
195
|
-
chartType: e,
|
|
196
|
-
packageName: t?.packageName || "unknown",
|
|
197
|
-
installCommand: t?.installCommand || "npm install [package-name]",
|
|
198
|
-
height: r
|
|
199
|
-
});
|
|
200
|
-
return r.displayName = `${e}Fallback`, r;
|
|
201
|
-
}
|
|
202
|
-
function u(e, t) {
|
|
203
|
-
return async () => {
|
|
204
|
-
try {
|
|
205
|
-
return await t();
|
|
206
|
-
} catch (t) {
|
|
207
|
-
return console.warn(`[drizzle-cube] Failed to load ${e} chart:`, t instanceof Error ? t.message : t), o.add(e), { default: l(e) };
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
function d(e) {
|
|
212
|
-
if (!a.has(e)) {
|
|
213
|
-
let n = c[e];
|
|
214
|
-
if (!n) throw Error(`Unknown chart type: ${e}`);
|
|
215
|
-
let r = u(e, n);
|
|
216
|
-
a.set(e, t(r));
|
|
217
|
-
}
|
|
218
|
-
return a.get(e);
|
|
219
|
-
}
|
|
220
|
-
function f(e) {
|
|
221
|
-
return e in c;
|
|
222
|
-
}
|
|
223
|
-
function p({ height: e }) {
|
|
224
|
-
return /* @__PURE__ */ n("div", {
|
|
225
|
-
className: "dc:flex dc:items-center dc:justify-center dc:w-full",
|
|
226
|
-
style: { height: typeof e == "number" ? `${e}px` : e || "200px" },
|
|
227
|
-
children: /* @__PURE__ */ n("div", { className: "dc:animate-pulse bg-dc-surface-secondary dc:rounded dc:w-full dc:h-full dc:min-h-[100px]" })
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
function m({ chartType: t, fallback: r, height: i, ...a }) {
|
|
231
|
-
let o = d(t);
|
|
232
|
-
return /* @__PURE__ */ n(e, {
|
|
233
|
-
fallback: r ?? /* @__PURE__ */ n(p, { height: i }),
|
|
234
|
-
children: /* @__PURE__ */ n(o, {
|
|
235
|
-
height: i,
|
|
236
|
-
...a
|
|
237
|
-
})
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
function h(e) {
|
|
241
|
-
let t = c[e];
|
|
242
|
-
t && t();
|
|
243
|
-
}
|
|
244
|
-
function g(e) {
|
|
245
|
-
e.forEach(h);
|
|
246
|
-
}
|
|
247
|
-
function _() {
|
|
248
|
-
return Object.keys(c);
|
|
249
|
-
}
|
|
250
|
-
function v(e) {
|
|
251
|
-
return !o.has(e);
|
|
252
|
-
}
|
|
253
|
-
function y() {
|
|
254
|
-
return Array.from(o);
|
|
255
|
-
}
|
|
256
|
-
//#endregion
|
|
257
|
-
export { f as a, v as i, _ as n, h as o, y as r, g as s, m as t };
|
|
258
|
-
|
|
259
|
-
//# sourceMappingURL=charts-loader-gZjOqZwG.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"charts-loader-gZjOqZwG.js","names":[],"sources":["../../../src/client/components/charts/MissingDependencyFallback.tsx","../../../src/client/charts/ChartLoader.tsx"],"sourcesContent":["interface MissingDependencyFallbackProps {\n chartType: string\n packageName: string\n installCommand: string\n height?: string | number\n}\n\n/**\n * Fallback component shown when a chart's optional dependency is not installed.\n * Provides clear instructions on how to install the missing package.\n */\nexport function MissingDependencyFallback({\n chartType,\n packageName,\n installCommand,\n height = 200\n}: MissingDependencyFallbackProps) {\n return (\n <div\n className=\"dc-missing-dependency-fallback\"\n style={{\n height: typeof height === 'number' ? `${height}px` : height,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n width: '100%',\n padding: '1.5rem',\n textAlign: 'center',\n border: '1px dashed var(--dc-border, #e5e7eb)',\n borderRadius: '0.5rem',\n backgroundColor: 'var(--dc-surface, #f9fafb)'\n }}\n >\n <div style={{ fontSize: '2.5rem', marginBottom: '1rem' }}>📦</div>\n <h3 style={{\n fontSize: '1.125rem',\n fontWeight: 600,\n marginBottom: '0.5rem',\n color: 'var(--dc-text, #111827)'\n }}>\n Missing Dependency\n </h3>\n <p style={{\n fontSize: '0.875rem',\n color: 'var(--dc-text-secondary, #6b7280)',\n marginBottom: '1rem',\n maxWidth: '28rem'\n }}>\n The <code style={{\n padding: '0.125rem 0.375rem',\n backgroundColor: 'var(--dc-surface-secondary, #f3f4f6)',\n borderRadius: '0.25rem',\n fontFamily: 'monospace',\n fontSize: '0.75rem'\n }}>{chartType}</code> chart requires the <code style={{\n padding: '0.125rem 0.375rem',\n backgroundColor: 'var(--dc-surface-secondary, #f3f4f6)',\n borderRadius: '0.25rem',\n fontFamily: 'monospace',\n fontSize: '0.75rem'\n }}>{packageName}</code> package.\n </p>\n <div style={{\n backgroundColor: 'var(--dc-surface-secondary, #f3f4f6)',\n borderRadius: '0.5rem',\n padding: '0.75rem 1rem',\n fontFamily: 'monospace',\n fontSize: '0.875rem',\n color: 'var(--dc-text, #111827)'\n }}>\n <span style={{\n color: 'var(--dc-text-muted, #9ca3af)',\n userSelect: 'none'\n }}>$ </span>\n {installCommand}\n </div>\n <p style={{\n fontSize: '0.75rem',\n color: 'var(--dc-text-muted, #9ca3af)',\n marginTop: '0.75rem'\n }}>\n After installing, restart your development server.\n </p>\n </div>\n )\n}\n","/**\n * Lazy Chart Loader\n *\n * Provides React.lazy-based dynamic loading for chart components.\n * This enables code splitting - each chart type loads only when needed.\n *\n * Handles missing optional dependencies gracefully by showing a fallback\n * component instead of crashing the application.\n */\n\nimport { lazy, Suspense, ComponentType, ReactNode, LazyExoticComponent } from 'react'\nimport type { ChartType, ChartProps } from '../types'\nimport { MissingDependencyFallback } from '../components/charts/MissingDependencyFallback'\n\n// Type for lazy-loaded chart components\ntype LazyChartComponent = ComponentType<ChartProps>\n\n// Chart loader cache to prevent re-creating lazy components\nconst chartLoaderCache = new Map<ChartType, LazyExoticComponent<LazyChartComponent>>()\n\n// Track which chart types have failed to load due to missing dependencies\nconst failedChartTypes = new Set<ChartType>()\n\n/**\n * Maps chart types to their optional peer dependencies.\n * Charts not listed here have no external dependencies (table, KPIs, markdown).\n */\nconst chartDependencyMap: Partial<Record<ChartType, { packageName: string; installCommand: string }>> = {\n // Recharts-based charts\n bar: {\n packageName: 'recharts',\n installCommand: 'npm install recharts'\n },\n line: {\n packageName: 'recharts',\n installCommand: 'npm install recharts'\n },\n area: {\n packageName: 'recharts',\n installCommand: 'npm install recharts'\n },\n pie: {\n packageName: 'recharts',\n installCommand: 'npm install recharts'\n },\n scatter: {\n packageName: 'recharts',\n installCommand: 'npm install recharts'\n },\n radar: {\n packageName: 'recharts',\n installCommand: 'npm install recharts'\n },\n radialBar: {\n packageName: 'recharts',\n installCommand: 'npm install recharts'\n },\n treemap: {\n packageName: 'recharts',\n installCommand: 'npm install recharts'\n },\n bubble: {\n packageName: 'recharts',\n installCommand: 'npm install recharts'\n },\n funnel: {\n packageName: 'recharts',\n installCommand: 'npm install recharts'\n },\n sankey: {\n packageName: 'recharts',\n installCommand: 'npm install recharts'\n },\n sunburst: {\n packageName: 'recharts',\n installCommand: 'npm install recharts'\n },\n // Nivo-based charts\n heatmap: {\n packageName: '@nivo/heatmap',\n installCommand: 'npm install @nivo/heatmap'\n },\n waterfall: {\n packageName: 'recharts',\n installCommand: 'npm install recharts'\n },\n measureProfile: {\n packageName: 'recharts',\n installCommand: 'npm install recharts'\n },\n gauge: {\n packageName: 'd3-shape',\n installCommand: 'npm install d3-shape'\n },\n // Charts with no external deps: table, activityGrid, kpiNumber, kpiDelta, kpiText, markdown, retentionHeatmap, boxPlot, candlestick\n}\n\n// Dynamic import functions for each chart type\nconst chartImportMap: Record<ChartType, () => Promise<{ default: LazyChartComponent }>> = {\n bar: () => import('../components/charts/BarChart'),\n line: () => import('../components/charts/LineChart'),\n area: () => import('../components/charts/AreaChart'),\n pie: () => import('../components/charts/PieChart'),\n scatter: () => import('../components/charts/ScatterChart'),\n radar: () => import('../components/charts/RadarChart'),\n radialBar: () => import('../components/charts/RadialBarChart'),\n treemap: () => import('../components/charts/TreeMapChart'),\n bubble: () => import('../components/charts/BubbleChart'),\n table: () => import('../components/charts/DataTable'),\n activityGrid: () => import('../components/charts/ActivityGridChart'),\n kpiNumber: () => import('../components/charts/KpiNumber'),\n kpiDelta: () => import('../components/charts/KpiDelta'),\n kpiText: () => import('../components/charts/KpiText'),\n markdown: () => import('../components/charts/MarkdownChart'),\n funnel: () => import('../components/charts/FunnelChart'),\n sankey: () => import('../components/charts/SankeyChart'),\n sunburst: () => import('../components/charts/SunburstChart'),\n heatmap: () => import('../components/charts/HeatMapChart'),\n retentionHeatmap: () => import('../components/charts/RetentionHeatmap'),\n retentionCombined: () => import('../components/charts/RetentionCombinedChart'),\n boxPlot: () => import('../components/charts/BoxPlotChart'),\n waterfall: () => import('../components/charts/WaterfallChart'),\n candlestick: () => import('../components/charts/CandlestickChart'),\n measureProfile: () => import('../components/charts/MeasureProfileChart'),\n gauge: () => import('../components/charts/GaugeChart'),\n}\n\n/**\n * Creates a fallback component for a chart type with missing dependencies.\n */\nfunction createFallbackComponent(chartType: ChartType): LazyChartComponent {\n const depInfo = chartDependencyMap[chartType]\n\n const FallbackComponent: LazyChartComponent = ({ height }) => (\n <MissingDependencyFallback\n chartType={chartType}\n packageName={depInfo?.packageName || 'unknown'}\n installCommand={depInfo?.installCommand || `npm install [package-name]`}\n height={height}\n />\n )\n\n FallbackComponent.displayName = `${chartType}Fallback`\n return FallbackComponent\n}\n\n/**\n * Wraps a chart import function with error handling.\n * If the import fails (e.g., missing dependency), returns a fallback component.\n */\nfunction createSafeImport(\n chartType: ChartType,\n importFn: () => Promise<{ default: LazyChartComponent }>\n): () => Promise<{ default: LazyChartComponent }> {\n return async () => {\n try {\n return await importFn()\n } catch (error) {\n // Log the error for debugging\n console.warn(\n `[drizzle-cube] Failed to load ${chartType} chart:`,\n error instanceof Error ? error.message : error\n )\n\n // Track that this chart type failed\n failedChartTypes.add(chartType)\n\n // Return the fallback component wrapped in the expected format\n return { default: createFallbackComponent(chartType) }\n }\n }\n}\n\n/**\n * Get or create a lazy component for a chart type.\n * Handles import failures gracefully by returning a fallback component.\n */\nfunction getLazyChart(chartType: ChartType): LazyExoticComponent<LazyChartComponent> {\n if (!chartLoaderCache.has(chartType)) {\n const importFn = chartImportMap[chartType]\n if (!importFn) {\n throw new Error(`Unknown chart type: ${chartType}`)\n }\n // Wrap the import with error handling for graceful degradation\n const safeImport = createSafeImport(chartType, importFn)\n chartLoaderCache.set(chartType, lazy(safeImport))\n }\n return chartLoaderCache.get(chartType)!\n}\n\n/**\n * Check if a chart type is supported\n */\nexport function isValidChartType(chartType: string): chartType is ChartType {\n return chartType in chartImportMap\n}\n\n// Props for the LazyChart wrapper\nexport interface LazyChartProps extends ChartProps {\n chartType: ChartType\n fallback?: ReactNode\n}\n\n/**\n * Default loading placeholder for charts\n */\nfunction DefaultChartFallback({ height }: { height?: string | number }) {\n return (\n <div\n className=\"dc:flex dc:items-center dc:justify-center dc:w-full\"\n style={{ height: typeof height === 'number' ? `${height}px` : height || '200px' }}\n >\n <div className=\"dc:animate-pulse bg-dc-surface-secondary dc:rounded dc:w-full dc:h-full dc:min-h-[100px]\" />\n </div>\n )\n}\n\n/**\n * Lazy Chart Component\n *\n * Renders a chart component with React.lazy dynamic loading.\n * The chart type determines which chart component is loaded.\n *\n * @example\n * ```tsx\n * <LazyChart\n * chartType=\"bar\"\n * data={chartData}\n * chartConfig={{ yAxis: ['value'] }}\n * height={300}\n * />\n * ```\n */\nexport function LazyChart({\n chartType,\n fallback,\n height,\n ...chartProps\n}: LazyChartProps) {\n const ChartComponent = getLazyChart(chartType)\n\n return (\n <Suspense fallback={fallback ?? <DefaultChartFallback height={height} />}>\n <ChartComponent height={height} {...chartProps} />\n </Suspense>\n )\n}\n\n/**\n * Preload a chart type\n *\n * Triggers the dynamic import without rendering.\n * Useful for prefetching charts that will likely be needed.\n *\n * @example\n * ```tsx\n * // Preload bar chart on hover\n * onMouseEnter={() => preloadChart('bar')}\n * ```\n */\nexport function preloadChart(chartType: ChartType): void {\n const importFn = chartImportMap[chartType]\n if (importFn) {\n importFn()\n }\n}\n\n/**\n * Preload multiple chart types\n *\n * @example\n * ```tsx\n * // Preload common charts on app init\n * useEffect(() => {\n * preloadCharts(['bar', 'line', 'pie'])\n * }, [])\n * ```\n */\nexport function preloadCharts(chartTypes: ChartType[]): void {\n chartTypes.forEach(preloadChart)\n}\n\n/**\n * Get all available chart types\n */\nexport function getAvailableChartTypes(): ChartType[] {\n return Object.keys(chartImportMap) as ChartType[]\n}\n\n/**\n * Check if a chart type has loaded successfully.\n * Returns false if the chart failed to load due to missing dependencies.\n *\n * Note: This only returns accurate results after the chart has been attempted to load.\n * Use this for conditional UI logic (e.g., hiding unavailable chart types).\n */\nexport function isChartTypeAvailable(chartType: ChartType): boolean {\n return !failedChartTypes.has(chartType)\n}\n\n/**\n * Get list of chart types that failed to load due to missing dependencies.\n */\nexport function getUnavailableChartTypes(): ChartType[] {\n return Array.from(failedChartTypes)\n}\n"],"mappings":";;;AAWA,SAAgB,EAA0B,EACxC,cACA,gBACA,mBACA,YAAS,OACwB;AACjC,QACE,kBAAC,OAAD;EACE,WAAU;EACV,OAAO;GACL,QAAQ,OAAO,KAAW,WAAW,GAAG,EAAO,MAAM;GACrD,SAAS;GACT,eAAe;GACf,YAAY;GACZ,gBAAgB;GAChB,OAAO;GACP,SAAS;GACT,WAAW;GACX,QAAQ;GACR,cAAc;GACd,iBAAiB;GAClB;YAdH;GAgBE,kBAAC,OAAD;IAAK,OAAO;KAAE,UAAU;KAAU,cAAc;KAAQ;cAAE;IAAQ,CAAA;GAClE,kBAAC,MAAD;IAAI,OAAO;KACT,UAAU;KACV,YAAY;KACZ,cAAc;KACd,OAAO;KACR;cAAE;IAEE,CAAA;GACL,kBAAC,KAAD;IAAG,OAAO;KACR,UAAU;KACV,OAAO;KACP,cAAc;KACd,UAAU;KACX;cALD;KAKG;KACG,kBAAC,QAAD;MAAM,OAAO;OACf,SAAS;OACT,iBAAiB;OACjB,cAAc;OACd,YAAY;OACZ,UAAU;OACX;gBAAG;MAAiB,CAAA;;KAAoB,kBAAC,QAAD;MAAM,OAAO;OACpD,SAAS;OACT,iBAAiB;OACjB,cAAc;OACd,YAAY;OACZ,UAAU;OACX;gBAAG;MAAmB,CAAA;;KACrB;;GACJ,kBAAC,OAAD;IAA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,CAAC,EAAiB,IAAI,EAAU;;AAMzC,SAAgB,IAAwC;AACtD,QAAO,MAAM,KAAK,EAAiB"}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { useEffect as e, useState as t } from "react";
|
|
2
|
-
//#region src/client/charts/chartConfigs.ts
|
|
3
|
-
var n = {
|
|
4
|
-
dropZones: [
|
|
5
|
-
{
|
|
6
|
-
key: "xAxis",
|
|
7
|
-
label: "X-Axis (Categories)",
|
|
8
|
-
description: "Dimensions and time dimensions for grouping",
|
|
9
|
-
mandatory: !1,
|
|
10
|
-
acceptTypes: ["dimension", "timeDimension"],
|
|
11
|
-
emptyText: "Drop dimensions & time dimensions here"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
key: "yAxis",
|
|
15
|
-
label: "Y-Axis (Values)",
|
|
16
|
-
description: "Measures for values or dimensions for series",
|
|
17
|
-
mandatory: !1,
|
|
18
|
-
acceptTypes: ["measure", "dimension"],
|
|
19
|
-
emptyText: "Drop measures or dimensions here"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
key: "series",
|
|
23
|
-
label: "Series (Split into Multiple Series)",
|
|
24
|
-
description: "Dimensions to create separate data series",
|
|
25
|
-
mandatory: !1,
|
|
26
|
-
acceptTypes: ["dimension"],
|
|
27
|
-
emptyText: "Drop dimensions here to split data into series"
|
|
28
|
-
}
|
|
29
|
-
],
|
|
30
|
-
displayOptions: [
|
|
31
|
-
"showLegend",
|
|
32
|
-
"showGrid",
|
|
33
|
-
"showTooltip"
|
|
34
|
-
]
|
|
35
|
-
}, r = {
|
|
36
|
-
bar: () => import("./chart-config-bar-BCi2Wmd6.js").then((e) => e.t),
|
|
37
|
-
line: () => import("./chart-config-line-B3NgLF7K.js").then((e) => e.t),
|
|
38
|
-
area: () => import("./chart-config-area-D_ZufYzg.js").then((e) => e.t),
|
|
39
|
-
pie: () => import("./chart-config-pie-wY0B52PC.js").then((e) => e.t),
|
|
40
|
-
scatter: () => import("./chart-config-scatter-B2su_x8f.js").then((e) => e.t),
|
|
41
|
-
radar: () => import("./chart-config-radar-DRpJBy1M.js").then((e) => e.t),
|
|
42
|
-
radialBar: () => import("./chart-config-radial-bar-DCUpXv9G.js").then((e) => e.t),
|
|
43
|
-
treemap: () => import("./chart-config-tree-map-Cbsh2fe2.js").then((e) => e.t),
|
|
44
|
-
bubble: () => import("./chart-config-bubble-CgbBjPv8.js").then((e) => e.t),
|
|
45
|
-
table: () => import("./chart-config-data-table-Cl7sBasW.js").then((e) => e.t),
|
|
46
|
-
activityGrid: () => import("./chart-config-activity-grid-USo7JrPh.js").then((e) => e.t),
|
|
47
|
-
kpiNumber: () => import("./chart-config-kpi-number-DptOyhk0.js").then((e) => e.t),
|
|
48
|
-
kpiDelta: () => import("./chart-config-kpi-delta-C5k2waIJ.js").then((e) => e.t),
|
|
49
|
-
kpiText: () => import("./chart-config-kpi-text-D9DdVWqd.js").then((e) => e.t),
|
|
50
|
-
markdown: () => import("./chart-config-markdown-tlfivQTt.js").then((e) => e.t),
|
|
51
|
-
funnel: () => import("./chart-config-funnel-CXPYQtTl.js").then((e) => e.t),
|
|
52
|
-
sankey: () => import("./chart-config-sankey-CdOhlm4h.js").then((e) => e.t),
|
|
53
|
-
sunburst: () => import("./chart-config-sunburst-BPdjbk18.js").then((e) => e.t),
|
|
54
|
-
heatmap: () => import("./chart-config-heat-map-BFf1tO11.js").then((e) => e.t),
|
|
55
|
-
retentionHeatmap: () => import("./RetentionHeatmap.config-cbaNExVy.js").then((e) => e.t),
|
|
56
|
-
retentionCombined: () => import("./RetentionCombinedChart.config-DprbXd1N.js").then((e) => e.t),
|
|
57
|
-
boxPlot: () => import("./chart-config-box-plot-afKLzJSp.js").then((e) => e.t),
|
|
58
|
-
waterfall: () => import("./chart-config-waterfall-DGmuZfQF.js").then((e) => e.t),
|
|
59
|
-
candlestick: () => import("./chart-config-candlestick-7boGjZ-A.js").then((e) => e.t),
|
|
60
|
-
measureProfile: () => import("./chart-config-measure-profile-D7XDwrU2.js").then((e) => e.t),
|
|
61
|
-
gauge: () => import("./chart-config-gauge-DUNEUCvh.js").then((e) => e.t)
|
|
62
|
-
}, i = {
|
|
63
|
-
bar: "barChartConfig",
|
|
64
|
-
line: "lineChartConfig",
|
|
65
|
-
area: "areaChartConfig",
|
|
66
|
-
pie: "pieChartConfig",
|
|
67
|
-
scatter: "scatterChartConfig",
|
|
68
|
-
radar: "radarChartConfig",
|
|
69
|
-
radialBar: "radialBarChartConfig",
|
|
70
|
-
treemap: "treemapChartConfig",
|
|
71
|
-
bubble: "bubbleChartConfig",
|
|
72
|
-
table: "dataTableConfig",
|
|
73
|
-
activityGrid: "activityGridChartConfig",
|
|
74
|
-
kpiNumber: "kpiNumberConfig",
|
|
75
|
-
kpiDelta: "kpiDeltaConfig",
|
|
76
|
-
kpiText: "kpiTextConfig",
|
|
77
|
-
markdown: "markdownConfig",
|
|
78
|
-
funnel: "funnelChartConfig",
|
|
79
|
-
sankey: "sankeyChartConfig",
|
|
80
|
-
sunburst: "sunburstChartConfig",
|
|
81
|
-
heatmap: "heatmapChartConfig",
|
|
82
|
-
retentionHeatmap: "retentionHeatmapConfig",
|
|
83
|
-
retentionCombined: "retentionCombinedConfig",
|
|
84
|
-
boxPlot: "boxPlotChartConfig",
|
|
85
|
-
waterfall: "waterfallChartConfig",
|
|
86
|
-
candlestick: "candlestickChartConfig",
|
|
87
|
-
measureProfile: "measureProfileChartConfig",
|
|
88
|
-
gauge: "gaugeChartConfig"
|
|
89
|
-
}, a = /* @__PURE__ */ new Map();
|
|
90
|
-
async function o(e) {
|
|
91
|
-
if (a.has(e)) return a.get(e);
|
|
92
|
-
let t = r[e];
|
|
93
|
-
if (!t) return null;
|
|
94
|
-
try {
|
|
95
|
-
let n = (await t())[i[e]];
|
|
96
|
-
return n ? (a.set(e, n), n) : null;
|
|
97
|
-
} catch (t) {
|
|
98
|
-
return console.error(`Failed to load config for chart type: ${e}`, t), null;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
function s(e) {
|
|
102
|
-
return a.get(e) || n;
|
|
103
|
-
}
|
|
104
|
-
function c(e) {
|
|
105
|
-
return a.has(e);
|
|
106
|
-
}
|
|
107
|
-
function l(r) {
|
|
108
|
-
let [i, c] = t(r ? s(r) : n), [l, u] = t(!1), [d, f] = t(!1);
|
|
109
|
-
return e(() => {
|
|
110
|
-
if (!r) {
|
|
111
|
-
c(n), f(!1);
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
if (a.has(r)) {
|
|
115
|
-
c(a.get(r)), f(!0);
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
u(!0), o(r).then((e) => {
|
|
119
|
-
e ? (c(e), f(!0)) : (c(n), f(!0));
|
|
120
|
-
}).finally(() => u(!1));
|
|
121
|
-
}, [r]), {
|
|
122
|
-
config: i,
|
|
123
|
-
loading: l,
|
|
124
|
-
loaded: d
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
async function u(e) {
|
|
128
|
-
a.has(e) || await o(e);
|
|
129
|
-
}
|
|
130
|
-
async function d(e) {
|
|
131
|
-
await Promise.all(e.map(u));
|
|
132
|
-
}
|
|
133
|
-
async function f() {
|
|
134
|
-
let e = Object.keys(r);
|
|
135
|
-
await Promise.all(e.map(o));
|
|
136
|
-
let t = {};
|
|
137
|
-
for (let n of e) {
|
|
138
|
-
let e = a.get(n);
|
|
139
|
-
e && (t[n] = e);
|
|
140
|
-
}
|
|
141
|
-
return t;
|
|
142
|
-
}
|
|
143
|
-
function p() {
|
|
144
|
-
a.clear();
|
|
145
|
-
}
|
|
146
|
-
//#endregion
|
|
147
|
-
export { f as a, l as c, c as i, o as n, u as o, s as r, d as s, p as t };
|
|
148
|
-
|
|
149
|
-
//# sourceMappingURL=lazyChartConfigRegistry-BjhxDaSf.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lazyChartConfigRegistry-BjhxDaSf.js","names":[],"sources":["../../../src/client/charts/chartConfigs.ts","../../../src/client/charts/lazyChartConfigRegistry.ts"],"sourcesContent":["/**\n * Configuration for a single axis drop zone in the chart configuration UI\n */\nexport interface AxisDropZoneConfig {\n /** The key to store this field in chartConfig (e.g., 'xAxis', 'yAxis', 'sizeField') */\n key: string\n\n /** Display label for the drop zone */\n label: string\n\n /** Optional description/help text shown below the label */\n description?: string\n\n /** Whether at least one field is required in this drop zone */\n mandatory?: boolean\n\n /** Maximum number of items allowed in this drop zone */\n maxItems?: number\n\n /** Which field types this drop zone accepts */\n acceptTypes?: ('dimension' | 'timeDimension' | 'measure')[]\n\n /** Placeholder text when drop zone is empty */\n emptyText?: string\n\n /** Enable L/R axis toggle for items in this drop zone (for dual Y-axis support) */\n enableDualAxis?: boolean\n}\n\n/**\n * Configuration for a single display option\n */\nexport interface DisplayOptionConfig {\n /** The key to store this field in displayConfig */\n key: string\n \n /** Display label for the option */\n label: string\n \n /** Type of input control to render */\n type: 'boolean' | 'string' | 'number' | 'select' | 'color' | 'paletteColor' | 'axisFormat' | 'stringArray' | 'buttonGroup'\n \n /** Default value for the option */\n defaultValue?: any\n \n /** Placeholder text for string/number inputs */\n placeholder?: string\n \n /** Options for select type */\n options?: Array<{ value: any; label: string }>\n \n /** Help text shown below the input */\n description?: string\n \n /** Minimum value for number inputs */\n min?: number\n \n /** Maximum value for number inputs */\n max?: number\n \n /** Step value for number inputs */\n step?: number\n}\n\n/**\n * Configuration for which elements in a chart support clicking (for drill-down)\n */\nexport interface ClickableElementsConfig {\n /** Bars in bar charts */\n bar?: boolean\n /** Points/dots in line/scatter charts */\n point?: boolean\n /** Slices in pie/donut charts */\n slice?: boolean\n /** Cells in heatmaps */\n cell?: boolean\n /** Nodes in treemaps, sankey diagrams */\n node?: boolean\n /** Areas in area charts */\n area?: boolean\n /** Rows in data tables */\n row?: boolean\n}\n\n/**\n * Complete configuration for a chart type\n */\nexport interface ChartTypeConfig {\n /** Display label for the chart type in the picker (e.g., 'Bar Chart', 'KPI Number') */\n label?: string\n\n /** Configuration for each drop zone */\n dropZones: AxisDropZoneConfig[]\n\n /** Simple display options (backward compatibility) - rendered as boolean checkboxes */\n displayOptions?: string[]\n\n /** Structured display options with metadata for different input types */\n displayOptionsConfig?: DisplayOptionConfig[]\n\n /** Optional custom validation function */\n validate?: (config: any) => { isValid: boolean; message?: string }\n\n /** Brief description of the chart */\n description?: string\n\n /** When to use this chart type */\n useCase?: string\n\n /** Whether this chart type skips query requirements (for content-based charts like markdown) */\n skipQuery?: boolean\n\n /** Configuration for which elements support clicking (for drill-down) */\n clickableElements?: ClickableElementsConfig\n}\n\n/**\n * Registry of all chart type configurations\n */\nexport interface ChartConfigRegistry {\n [chartType: string]: ChartTypeConfig\n}\n\n/**\n * Default configuration for charts without specific requirements\n */\nexport const defaultChartConfig: ChartTypeConfig = {\n dropZones: [\n {\n key: 'xAxis',\n label: 'X-Axis (Categories)',\n description: 'Dimensions and time dimensions for grouping',\n mandatory: false,\n acceptTypes: ['dimension', 'timeDimension'],\n emptyText: 'Drop dimensions & time dimensions here'\n },\n {\n key: 'yAxis',\n label: 'Y-Axis (Values)',\n description: 'Measures for values or dimensions for series',\n mandatory: false,\n acceptTypes: ['measure', 'dimension'],\n emptyText: 'Drop measures or dimensions here'\n },\n {\n key: 'series',\n label: 'Series (Split into Multiple Series)',\n description: 'Dimensions to create separate data series',\n mandatory: false,\n acceptTypes: ['dimension'],\n emptyText: 'Drop dimensions here to split data into series'\n }\n ],\n displayOptions: ['showLegend', 'showGrid', 'showTooltip']\n}\n\n/**\n * Helper function to get configuration for a chart type\n */\nexport function getChartConfig(chartType: string, registry: ChartConfigRegistry): ChartTypeConfig {\n return registry[chartType] || defaultChartConfig\n}","/**\n * Lazy Chart Config Registry\n *\n * Provides async loading for chart configurations.\n * This enables code splitting - each chart config loads only when needed.\n */\n\nimport { useState, useEffect } from 'react'\nimport type { ChartType } from '../types'\nimport type { ChartTypeConfig, ChartConfigRegistry } from './chartConfigs'\nimport { defaultChartConfig } from './chartConfigs'\n\n// Config import map - lazy imports for each chart config\nconst configImportMap: Record<ChartType, () => Promise<{ [key: string]: ChartTypeConfig }>> = {\n bar: () => import('../components/charts/BarChart.config'),\n line: () => import('../components/charts/LineChart.config'),\n area: () => import('../components/charts/AreaChart.config'),\n pie: () => import('../components/charts/PieChart.config'),\n scatter: () => import('../components/charts/ScatterChart.config'),\n radar: () => import('../components/charts/RadarChart.config'),\n radialBar: () => import('../components/charts/RadialBarChart.config'),\n treemap: () => import('../components/charts/TreeMapChart.config'),\n bubble: () => import('../components/charts/BubbleChart.config'),\n table: () => import('../components/charts/DataTable.config'),\n activityGrid: () => import('../components/charts/ActivityGridChart.config'),\n kpiNumber: () => import('../components/charts/KpiNumber.config'),\n kpiDelta: () => import('../components/charts/KpiDelta.config'),\n kpiText: () => import('../components/charts/KpiText.config'),\n markdown: () => import('../components/charts/MarkdownChart.config'),\n funnel: () => import('../components/charts/FunnelChart.config'),\n sankey: () => import('../components/charts/SankeyChart.config'),\n sunburst: () => import('../components/charts/SunburstChart.config'),\n heatmap: () => import('../components/charts/HeatMapChart.config'),\n retentionHeatmap: () => import('../components/charts/RetentionHeatmap.config'),\n retentionCombined: () => import('../components/charts/RetentionCombinedChart.config'),\n boxPlot: () => import('../components/charts/BoxPlotChart.config'),\n waterfall: () => import('../components/charts/WaterfallChart.config'),\n candlestick: () => import('../components/charts/CandlestickChart.config'),\n measureProfile: () => import('../components/charts/MeasureProfileChart.config'),\n gauge: () => import('../components/charts/GaugeChart.config'),\n}\n\n// Map from chart type to expected export name\nconst configExportNames: Record<ChartType, string> = {\n bar: 'barChartConfig',\n line: 'lineChartConfig',\n area: 'areaChartConfig',\n pie: 'pieChartConfig',\n scatter: 'scatterChartConfig',\n radar: 'radarChartConfig',\n radialBar: 'radialBarChartConfig',\n treemap: 'treemapChartConfig',\n bubble: 'bubbleChartConfig',\n table: 'dataTableConfig',\n activityGrid: 'activityGridChartConfig',\n kpiNumber: 'kpiNumberConfig',\n kpiDelta: 'kpiDeltaConfig',\n kpiText: 'kpiTextConfig',\n markdown: 'markdownConfig',\n funnel: 'funnelChartConfig',\n sankey: 'sankeyChartConfig',\n sunburst: 'sunburstChartConfig',\n heatmap: 'heatmapChartConfig',\n retentionHeatmap: 'retentionHeatmapConfig',\n retentionCombined: 'retentionCombinedConfig',\n boxPlot: 'boxPlotChartConfig',\n waterfall: 'waterfallChartConfig',\n candlestick: 'candlestickChartConfig',\n measureProfile: 'measureProfileChartConfig',\n gauge: 'gaugeChartConfig',\n}\n\n// Cache for loaded configs\nconst configCache = new Map<ChartType, ChartTypeConfig>()\n\n/**\n * Get a chart config asynchronously\n *\n * @param chartType The chart type to load config for\n * @returns The chart type config, or null if not found\n *\n * @example\n * ```typescript\n * const config = await getChartConfigAsync('bar')\n * console.log(config?.dropZones)\n * ```\n */\nexport async function getChartConfigAsync(chartType: ChartType): Promise<ChartTypeConfig | null> {\n // Check cache first\n if (configCache.has(chartType)) {\n return configCache.get(chartType)!\n }\n\n const importFn = configImportMap[chartType]\n if (!importFn) {\n return null\n }\n\n try {\n const module = await importFn()\n const exportName = configExportNames[chartType]\n const config = module[exportName]\n\n if (config) {\n configCache.set(chartType, config)\n return config\n }\n return null\n } catch (error) {\n console.error(`Failed to load config for chart type: ${chartType}`, error)\n return null\n }\n}\n\n/**\n * Get a chart config synchronously from cache\n *\n * Returns the cached config if available, otherwise returns the default config.\n * Use this when you need sync access and have already preloaded the config.\n *\n * @param chartType The chart type to get config for\n * @returns The chart type config (from cache or default)\n */\nexport function getChartConfigSync(chartType: ChartType): ChartTypeConfig {\n return configCache.get(chartType) || defaultChartConfig\n}\n\n/**\n * Check if a chart config is already loaded\n */\nexport function isChartConfigLoaded(chartType: ChartType): boolean {\n return configCache.has(chartType)\n}\n\n/**\n * React hook for using chart config\n *\n * Loads the chart config asynchronously and caches it.\n * Returns the default config while loading.\n *\n * @param chartType The chart type to load config for\n * @returns Object with config, loading state, and loaded flag\n *\n * @example\n * ```tsx\n * function ChartSetup({ chartType }) {\n * const { config, loading } = useChartConfig(chartType)\n *\n * if (loading) return <Spinner />\n * return <ConfigForm config={config} />\n * }\n * ```\n */\nexport function useChartConfig(chartType: ChartType | undefined): {\n config: ChartTypeConfig\n loading: boolean\n loaded: boolean\n} {\n const [config, setConfig] = useState<ChartTypeConfig>(\n chartType ? getChartConfigSync(chartType) : defaultChartConfig\n )\n const [loading, setLoading] = useState(false)\n const [loaded, setLoaded] = useState(false)\n\n useEffect(() => {\n if (!chartType) {\n setConfig(defaultChartConfig)\n setLoaded(false)\n return\n }\n\n // Check cache synchronously first\n if (configCache.has(chartType)) {\n setConfig(configCache.get(chartType)!)\n setLoaded(true)\n return\n }\n\n // Load async\n setLoading(true)\n getChartConfigAsync(chartType)\n .then((loadedConfig) => {\n if (loadedConfig) {\n setConfig(loadedConfig)\n setLoaded(true)\n } else {\n setConfig(defaultChartConfig)\n setLoaded(true)\n }\n })\n .finally(() => setLoading(false))\n }, [chartType])\n\n return { config, loading, loaded }\n}\n\n/**\n * Preload a chart config\n *\n * Triggers the async import without needing to use the config immediately.\n * Useful for prefetching configs that will likely be needed.\n *\n * @param chartType The chart type to preload config for\n */\nexport async function preloadChartConfig(chartType: ChartType): Promise<void> {\n if (!configCache.has(chartType)) {\n await getChartConfigAsync(chartType)\n }\n}\n\n/**\n * Preload multiple chart configs\n *\n * @param chartTypes Array of chart types to preload\n */\nexport async function preloadChartConfigs(chartTypes: ChartType[]): Promise<void> {\n await Promise.all(chartTypes.map(preloadChartConfig))\n}\n\n/**\n * Load all chart configs and return as a registry\n *\n * Useful for SSR or when you need all configs upfront.\n * After calling this, all configs are cached and available synchronously.\n *\n * @returns Complete chart config registry\n *\n * @example\n * ```typescript\n * // On server or during initialization\n * const registry = await loadAllChartConfigs()\n * // Now all configs are cached and getChartConfigSync works for all types\n * ```\n */\nexport async function loadAllChartConfigs(): Promise<ChartConfigRegistry> {\n const chartTypes = Object.keys(configImportMap) as ChartType[]\n await Promise.all(chartTypes.map(getChartConfigAsync))\n\n const registry: ChartConfigRegistry = {}\n for (const chartType of chartTypes) {\n const config = configCache.get(chartType)\n if (config) {\n registry[chartType] = config\n }\n }\n return registry\n}\n\n/**\n * Clear the config cache\n *\n * Useful for testing or when configs need to be reloaded.\n */\nexport function clearChartConfigCache(): void {\n configCache.clear()\n}\n"],"mappings":";;AA8HA,IAAa,IAAsC;CACjD,WAAW;EACT;GACE,KAAK;GACL,OAAO;GACP,aAAa;GACb,WAAW;GACX,aAAa,CAAC,aAAa,gBAAgB;GAC3C,WAAW;GACZ;EACD;GACE,KAAK;GACL,OAAO;GACP,aAAa;GACb,WAAW;GACX,aAAa,CAAC,WAAW,YAAY;GACrC,WAAW;GACZ;EACD;GACE,KAAK;GACL,OAAO;GACP,aAAa;GACb,WAAW;GACX,aAAa,CAAC,YAAY;GAC1B,WAAW;GACZ;EACF;CACD,gBAAgB;EAAC;EAAc;EAAY;EAAc;CAC1D,EC7IK,IAAwF;CAC5F,WAAW,OAAO,kCAAA,MAAA,MAAA,EAAA,EAAA;CAClB,YAAY,OAAO,mCAAA,MAAA,MAAA,EAAA,EAAA;CACnB,YAAY,OAAO,mCAAA,MAAA,MAAA,EAAA,EAAA;CACnB,WAAW,OAAO,kCAAA,MAAA,MAAA,EAAA,EAAA;CAClB,eAAe,OAAO,sCAAA,MAAA,MAAA,EAAA,EAAA;CACtB,aAAa,OAAO,oCAAA,MAAA,MAAA,EAAA,EAAA;CACpB,iBAAiB,OAAO,yCAAA,MAAA,MAAA,EAAA,EAAA;CACxB,eAAe,OAAO,uCAAA,MAAA,MAAA,EAAA,EAAA;CACtB,cAAc,OAAO,qCAAA,MAAA,MAAA,EAAA,EAAA;CACrB,aAAa,OAAO,yCAAA,MAAA,MAAA,EAAA,EAAA;CACpB,oBAAoB,OAAO,4CAAA,MAAA,MAAA,EAAA,EAAA;CAC3B,iBAAiB,OAAO,yCAAA,MAAA,MAAA,EAAA,EAAA;CACxB,gBAAgB,OAAO,wCAAA,MAAA,MAAA,EAAA,EAAA;CACvB,eAA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