react-semaphor 0.1.507 → 0.1.508
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/DATA_APP_SDK.md +56 -0
- package/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +194 -172
- package/dist/appearance/index.cjs +1 -1
- package/dist/appearance/index.js +1 -1
- package/dist/appearance-runtime/index.cjs +1 -1
- package/dist/appearance-runtime/index.js +1 -1
- package/dist/brand-studio/index.cjs +2 -2
- package/dist/brand-studio/index.js +139 -119
- package/dist/briefings/index.cjs +1 -1
- package/dist/briefings/index.js +3 -3
- package/dist/chunks/appearance-context-DzqCdhB4.cjs +1 -0
- package/dist/chunks/{appearance-context-XviHOhWJ.js → appearance-context-VJdrKi7r.js} +2 -1
- package/dist/chunks/{appearance-runtime-provider-D0xVQWnH.js → appearance-runtime-provider-CC4HT2Gi.js} +2 -2
- package/dist/chunks/{appearance-runtime-provider-Ca8rxO86.cjs → appearance-runtime-provider-D5pkvgE4.cjs} +1 -1
- package/dist/chunks/calculated-field-identity-BiTGmnST.cjs +1 -0
- package/dist/chunks/calculated-field-identity-CJL54uFx.js +1373 -0
- package/dist/chunks/{constants-NUleP4DY.js → card-config-utils-Bq1enstT.js} +260 -260
- package/dist/chunks/card-config-utils-CMO4_zVs.cjs +1 -0
- package/dist/chunks/{dashboard-briefing-launcher-DXTpU85p.js → dashboard-briefing-launcher-B9l0ZAbv.js} +12 -12
- package/dist/chunks/{dashboard-briefing-launcher-C8nDSDnV.cjs → dashboard-briefing-launcher-C4zsM3Hd.cjs} +1 -1
- package/dist/chunks/{dashboard-controls-CyL0yimg.js → dashboard-controls-BCQv4xWM.js} +16 -14
- package/dist/chunks/dashboard-controls-CWwllVOe.cjs +52 -0
- package/dist/chunks/{dashboard-json-5Jr3RudV.js → dashboard-json-BtU_q_0A.js} +9 -9
- package/dist/chunks/dashboard-json-DVj2xLsH.cjs +1 -0
- package/dist/chunks/edit-dashboard-visual-CO2IVBOq.cjs +172 -0
- package/dist/chunks/{edit-dashboard-visual-C7X-um9g.js → edit-dashboard-visual-RgFUx-py.js} +1986 -1990
- package/dist/chunks/{editor-action-buttons-CcDm8nA5.cjs → editor-action-buttons-BE8Fby6n.cjs} +2 -2
- package/dist/chunks/{editor-action-buttons-C5Wja_J4.js → editor-action-buttons-D-MaqTIs.js} +6 -6
- package/dist/chunks/field-aggregations-DUb0NU6c.js +1229 -0
- package/dist/chunks/field-aggregations-jSi77h9Z.cjs +1 -0
- package/dist/chunks/{field-dependencies-DVl2p1Nm.js → field-dependencies-Cl97kkHy.js} +30 -34
- package/dist/chunks/{field-dependencies-r_U0CGQ-.cjs → field-dependencies-DIab72rQ.cjs} +1 -1
- package/dist/chunks/{index-BVr4fcCB.js → index-0pdaQ9e1.js} +5 -5
- package/dist/chunks/index-BaIrLSBb.cjs +1422 -0
- package/dist/chunks/{index-De2QNsqV.js → index-ByiS9sB4.js} +45343 -43665
- package/dist/chunks/{index-C9KXfCkC.js → index-CLIro-EG.js} +3 -0
- package/dist/chunks/index-Cx3qmRUB.cjs +1 -0
- package/dist/chunks/{index-BlYf8gNa.cjs → index-DhlVxvyI.cjs} +1 -1
- package/dist/chunks/{matrix-card-DACDwdTq.js → matrix-card-CnKQpnsj.js} +1 -1
- package/dist/chunks/{matrix-card-CRXcmAjp.cjs → matrix-card-U4c72doZ.cjs} +1 -1
- package/dist/chunks/{matrix-control-sources-ClQzIk7E.js → matrix-control-sources-CRRdP03Q.js} +165 -134
- package/dist/chunks/matrix-control-sources-FjxGIbqk.cjs +1 -0
- package/dist/chunks/{matrix-formatter-7GLTcBuy.cjs → matrix-formatter-CveLJo6S.cjs} +1 -1
- package/dist/chunks/{matrix-formatter-xsq7n_e6.js → matrix-formatter-ZVS5QOuq.js} +2 -2
- package/dist/chunks/matrix-member-presentation-CFHjdrxT.cjs +1 -0
- package/dist/chunks/matrix-member-presentation-CzGZJd3a.js +182 -0
- package/dist/chunks/matrix-operation-contract-DoiWTUbT.cjs +1 -0
- package/dist/chunks/matrix-operation-contract-xL8IhFzp.js +1802 -0
- package/dist/chunks/{pivot-header-presentation-3wqWChFd.cjs → pivot-header-presentation-Cxz8-06f.cjs} +1 -1
- package/dist/chunks/{pivot-header-presentation-D44ODZGn.js → pivot-header-presentation-DVylCBHB.js} +2 -2
- package/dist/chunks/{pivot-result-lifecycle-DZ0ZSMoM.cjs → pivot-result-lifecycle-BiERyXnS.cjs} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-BSmqVkVG.js → pivot-result-lifecycle-CmjpW7qG.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-xADifRXs.js → report-preferences-dialog-BbkXcnnn.js} +4 -4
- package/dist/chunks/report-preferences-dialog-C9rpWgQZ.cjs +1 -0
- package/dist/chunks/{search-BHsQIWBV.js → selection-reducer-B94WgZ9V.js} +55 -11
- package/dist/chunks/selection-reducer-CGKKsaPa.cjs +26 -0
- package/dist/chunks/{semantic-format-BhIL1PXP.cjs → semantic-format-BzH69TRq.cjs} +1 -1
- package/dist/chunks/{semantic-format-C3amkGmY.js → semantic-format-CBlRO8Aw.js} +1 -1
- package/dist/chunks/{switch-DHGiC0aU.js → switch-CD4uGTZI.js} +7450 -7694
- package/dist/chunks/switch-iC1x2dcE.cjs +134 -0
- package/dist/chunks/token-types-Ahh5u4iT.cjs +1 -0
- package/dist/chunks/token-types-CPde8_LG.js +8 -0
- package/dist/chunks/{update-policy-Cc9h57pA.cjs → update-policy-COjFudhl.cjs} +1 -1
- package/dist/chunks/{update-policy-eTcz52jO.js → update-policy-D9q1Tz8k.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +734 -622
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +3 -3
- package/dist/data-app-codegen/index.cjs +1 -1
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.cjs +94 -92
- package/dist/data-app-codegen-node/index.js +337 -333
- package/dist/data-app-sdk/index.cjs +9 -9
- package/dist/data-app-sdk/index.js +1091 -969
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +104 -96
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +2 -2
- package/dist/format-utils/index.cjs +1 -1
- package/dist/format-utils/index.js +8 -8
- package/dist/index.cjs +1 -1
- package/dist/index.js +15 -15
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/brand-studio/brand-studio-draft.d.ts +3 -1
- package/dist/types/components/dashboard/card-selection-pill.d.ts +5 -0
- package/dist/types/components/dashboard/dashboard-container.d.ts +1 -1
- package/dist/types/components/dashboard/drill-breadcrumb.d.ts +1 -0
- package/dist/types/components/dashboard/drill-navigation-controls.d.ts +3 -3
- package/dist/types/components/interactions/applied-filters-display.d.ts +6 -1
- package/dist/types/components/interactions/click-to-filter-review-dialog.d.ts +21 -0
- package/dist/types/components/interactions/dashboard-drill-host.d.ts +13 -0
- package/dist/types/components/interactions/filter-badge-tooltip.d.ts +4 -4
- package/dist/types/components/interactions/insight-modal.d.ts +4 -14
- package/dist/types/components/interactions/insight-viewer.d.ts +7 -19
- package/dist/types/components/interactions/interactions-sheet.d.ts +6 -0
- package/dist/types/components/interactions/panels/click-to-filter-panel.d.ts +20 -0
- package/dist/types/components/interactions/reusable/interaction-selection-popover.d.ts +2 -2
- package/dist/types/components/interactions/sheet/action-editor.d.ts +17 -0
- package/dist/types/components/interactions/sheet/action-meta.d.ts +45 -0
- package/dist/types/components/interactions/sheet/action-picker.d.ts +7 -0
- package/dist/types/components/interactions/sheet/click-outcome-preview.d.ts +10 -0
- package/dist/types/components/interactions/sheet/interactions-home.d.ts +28 -0
- package/dist/types/components/interactions/sheet/sheet-parts.d.ts +37 -0
- package/dist/types/components/surfboard/filter/dashboard-filter-mapping-panel.d.ts +28 -1
- package/dist/types/components/surfboard/filter/selection-chip.d.ts +11 -0
- package/dist/types/components/surfboard/filter/selection-filter-section.d.ts +4 -0
- package/dist/types/components/surfboard/filter/use-dashboard-filter-mapping-popover.d.ts +3 -0
- package/dist/types/components/ui/resizable.d.ts +1 -1
- package/dist/types/components/visual/matrix-table/matrix-interaction-actions.d.ts +13 -1
- package/dist/types/components/visual/matrix-table/matrix-selection-click.d.ts +6 -0
- package/dist/types/data-app-sdk/adapters.d.ts +3 -2
- package/dist/types/data-app-sdk/builders.d.ts +2 -1
- package/dist/types/data-app-sdk/contracts.d.ts +44 -2
- package/dist/types/data-app-sdk/index.d.ts +1 -0
- package/dist/types/data-app-sdk/query-request.d.ts +7 -2
- package/dist/types/data-app-sdk/selection.d.ts +2 -0
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +24 -23
- package/dist/types/lib/appearance/types.d.ts +3 -1
- package/dist/types/lib/briefings/briefing-attachment-model.d.ts +0 -2
- package/dist/types/lib/contexts/interactions-popover-context.d.ts +1 -8
- package/dist/types/lib/dashboard/click-to-filter-card-references.d.ts +23 -0
- package/dist/types/lib/dashboard-inputs/build-normalized-dashboard-inputs.d.ts +16 -2
- package/dist/types/lib/dashboard-inputs/build-selection-dashboard-inputs.d.ts +31 -0
- package/dist/types/lib/dashboard-inputs/click-to-filter-emitted-fields.d.ts +17 -0
- package/dist/types/lib/dashboard-inputs/click-to-filter-mapping-draft.d.ts +99 -0
- package/dist/types/lib/dashboard-inputs/click-to-filter-sheet-reach.d.ts +12 -0
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +18 -1
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-candidate-metadata.d.ts +4 -1
- package/dist/types/lib/dashboard-inputs/dashboard-input-scope.d.ts +10 -0
- package/dist/types/lib/dashboard-inputs/dashboard-input-snapshot.d.ts +8 -1
- package/dist/types/lib/dashboard-inputs/index.d.ts +1 -0
- package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +18 -7
- package/dist/types/lib/dashboard-inputs/resolve-field-date-comparison-coverage.d.ts +5 -2
- package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +77 -0
- package/dist/types/lib/dashboard-inputs/selection-targets.d.ts +26 -0
- package/dist/types/lib/dashboard-inputs/transient-input-context.d.ts +102 -0
- package/dist/types/lib/dashboard-navigation/build-carried-click-context.d.ts +50 -0
- package/dist/types/lib/dashboard-navigation/describe-carried-context.d.ts +11 -0
- package/dist/types/lib/dashboard-navigation/index.d.ts +1 -0
- package/dist/types/lib/dashboard-navigation/navigation-state.d.ts +120 -0
- package/dist/types/lib/dashboard-navigation/run-one-off-drill.d.ts +11 -0
- package/dist/types/lib/dashboard-navigation/use-transient-contexts.d.ts +17 -0
- package/dist/types/lib/dashboard-view-state/card-view-state.d.ts +48 -0
- package/dist/types/lib/dashboard-view-state/drill-path.d.ts +20 -0
- package/dist/types/lib/dashboard-view-state/index.d.ts +2 -0
- package/dist/types/lib/download-pdf.d.ts +0 -3
- package/dist/types/lib/formatters/metric-formatting.d.ts +1 -1
- package/dist/types/lib/hooks/ai/dashboard-context.d.ts +15 -8
- package/dist/types/lib/hooks/chartjs/use-chart-blur.d.ts +10 -2
- package/dist/types/lib/hooks/interactions/{use-event-engine.d.ts → use-drill-actions.d.ts} +28 -7
- package/dist/types/lib/hooks/selection/use-active-selections.d.ts +15 -0
- package/dist/types/lib/hooks/selection/use-click-to-filter-mapping-draft.d.ts +20 -0
- package/dist/types/lib/hooks/selection/use-selection-click.d.ts +34 -0
- package/dist/types/lib/hooks/selection/use-selection-gestures.d.ts +38 -0
- package/dist/types/lib/hooks/selection/use-table-row-selection.d.ts +46 -0
- package/dist/types/lib/hooks/use-dashboard-card.d.ts +0 -2
- package/dist/types/lib/hooks/use-dashboard-filter-mapping-candidates.d.ts +18 -0
- package/dist/types/lib/hooks/use-dashboard-frame-query.d.ts +0 -1
- package/dist/types/lib/hooks/use-dashboard.d.ts +1 -3
- package/dist/types/lib/hooks/use-interactions-popover.d.ts +1 -8
- package/dist/types/lib/hooks/use-resolved-card-config.d.ts +6 -0
- package/dist/types/lib/interactions/click-outcome.d.ts +25 -0
- package/dist/types/lib/interactions/get-click-context-from-chartjs.d.ts +3 -1
- package/dist/types/lib/interactions/get-click-context-from-matrix.d.ts +1 -1
- package/dist/types/lib/interactions/get-click-context-from-table.d.ts +7 -0
- package/dist/types/lib/interactions/interaction-utils.d.ts +17 -1
- package/dist/types/lib/matrix-table/build-matrix-drill-to-detail.d.ts +15 -0
- package/dist/types/lib/matrix-table/matrix-card-interactions.d.ts +14 -3
- package/dist/types/lib/query-context/build-card-query-context.d.ts +19 -8
- package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +5 -3
- package/dist/types/lib/query-context/build-dashboard-frame-base-query-contexts.d.ts +12 -4
- package/dist/types/lib/query-context/compile-selection-filters.d.ts +5 -0
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +46 -0
- package/dist/types/lib/query-context/filter-group-utils.d.ts +3 -0
- package/dist/types/lib/query-context/resolve-runtime-card-filters.d.ts +29 -0
- package/dist/types/lib/selection/click-to-filter-authoring-support.d.ts +9 -0
- package/dist/types/lib/selection/selection-from-click-context.d.ts +41 -0
- package/dist/types/lib/selection/selection-labels.d.ts +3 -0
- package/dist/types/lib/selection/selection-notices.d.ts +9 -0
- package/dist/types/lib/selection/selection-reducer.d.ts +46 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +62 -17
- package/dist/types/lib/stores/editor-store.d.ts +1 -2
- package/dist/types/lib/stores/index.d.ts +0 -2
- package/dist/types/lib/types/common-types.d.ts +60 -6
- package/dist/types/lib/types/explorer-types.d.ts +1 -22
- package/dist/types/lib/types/interaction-types.d.ts +6 -198
- package/dist/types/lib/utils/calculate-context-aware-filters.d.ts +21 -12
- package/dist/types/lib/utils/card-utils.d.ts +11 -0
- package/dist/types/lib/utils/date-hierarchy-utils.d.ts +3 -1
- package/dist/types/lib/utils/drag-and-drop-utils.d.ts +1 -1
- package/dist/types/lib/utils/interaction-icons.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +32 -32
- package/dist/types/shared/analytics-protocol/index.d.ts +2 -0
- package/dist/types/shared/analytics-protocol/selection-contract.d.ts +100 -0
- package/dist/types/shared/analytics-protocol/selection-filter-compiler.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/apply-group-by-override.d.ts +19 -0
- package/dist/types/shared/dashboard-authoring/click-to-filter-settings.d.ts +88 -0
- package/dist/types/shared/dashboard-authoring/contracts.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/linked-click-to-filter-overrides.d.ts +32 -0
- package/dist/types/shared/format-utils/matrix-continuation.d.ts +3 -3
- package/package.json +1 -1
- package/src/data-app-sdk/README.md +58 -1
- package/dist/chunks/appearance-context-tNjvTJj3.cjs +0 -1
- package/dist/chunks/calculated-field-identity-BTpUqfEu.js +0 -1276
- package/dist/chunks/calculated-field-identity-rMuXuzEY.cjs +0 -1
- package/dist/chunks/constants-vtu7_IUo.cjs +0 -1
- package/dist/chunks/dashboard-controls-DlxeddZN.cjs +0 -52
- package/dist/chunks/dashboard-json-DhS4yJfc.cjs +0 -1
- package/dist/chunks/edit-dashboard-visual-X3OCnivL.cjs +0 -172
- package/dist/chunks/field-aggregations-BU_3gHKR.js +0 -957
- package/dist/chunks/field-aggregations-CDCamEsQ.cjs +0 -1
- package/dist/chunks/index-C8XCKzB6.cjs +0 -1
- package/dist/chunks/index-DSa6RSdg.cjs +0 -1417
- package/dist/chunks/matrix-control-sources-CeC5EMyq.cjs +0 -1
- package/dist/chunks/matrix-member-presentation-E2B4k3ws.cjs +0 -1
- package/dist/chunks/matrix-member-presentation-qiHxv67e.js +0 -105
- package/dist/chunks/matrix-operation-contract-Cqy4EW2H.js +0 -1638
- package/dist/chunks/matrix-operation-contract-D9dLX-Wr.cjs +0 -1
- package/dist/chunks/report-preferences-dialog-7Vsc_fsG.cjs +0 -1
- package/dist/chunks/search-BqqhaMx9.cjs +0 -26
- package/dist/chunks/switch-BytP6QY8.cjs +0 -139
- package/dist/types/components/interactions/configuration-popover.d.ts +0 -1
- package/dist/types/components/interactions/interaction-card.d.ts +0 -59
- package/dist/types/components/interactions/interaction-event-handler.d.ts +0 -11
- package/dist/types/components/interactions/interactions-list.d.ts +0 -50
- package/dist/types/components/interactions/panels/cross-filter-panel.d.ts +0 -24
- package/dist/types/components/interactions/panels/inline-drill-panel.d.ts +0 -24
- package/dist/types/components/interactions/selectors/action-selector.d.ts +0 -31
- package/dist/types/components/interactions/selectors/trigger-selector.d.ts +0 -38
- package/dist/types/components/surfboard/filter/click-filter-section.d.ts +0 -5
- package/dist/types/lib/interactions/build-interaction-event.d.ts +0 -25
- package/dist/types/lib/interactions/convert-click-filters-to-filter-group.d.ts +0 -10
- package/dist/types/lib/interactions/execute-interaction-event.d.ts +0 -80
- package/dist/types/lib/interactions/field-utils.d.ts +0 -11
- package/dist/types/lib/interactions/handle-chart-click.d.ts +0 -75
- package/dist/types/lib/interactions/linked-interaction-utils.d.ts +0 -14
- package/dist/types/lib/interactions/source-card-filter-utils.d.ts +0 -9
- package/dist/types/lib/stores/drill-actions.d.ts +0 -139
- package/dist/types/lib/stores/interaction-store.d.ts +0 -113
- package/dist/types/lib/stores/pointer-interaction-store.d.ts +0 -18
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const C=require("./validators-DVYAnnX0.cjs"),Z=require("./matrix-operation-contract-DoiWTUbT.cjs"),ee=require("./metric-comparison-DBQ3EJTz.cjs"),u=require("zod"),Ce=require("./source-entity-resolution-CjbgnwyX.cjs"),ve=require("./field-dependencies-DIab72rQ.cjs"),H=require("./matrix-card-U4c72doZ.cjs"),I=require("./temporal-bucket-4YEPEKlJ.cjs"),te=require("../value-format-preferences/index.cjs"),w=new Set(["previous_period","same_period_last_year","start_vs_end","target"]),_e=new Set([...w,"none",""]);function h(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function ne(e){const t=h(e.preferences)?e.preferences:void 0,n=t&&h(t.kpiVisualOptions)?t.kpiVisualOptions:void 0,o=t&&h(t.tableVisualOptions)?t.tableVisualOptions:void 0;return{preferences:t,kpiOptions:n,kpiComparison:n&&h(n.metricComparison)?n.metricComparison:void 0,kpiComparisonPresent:!!n&&"metricComparison"in n,tableOptions:o,tableComparison:o&&h(o.metricComparison)?o.metricComparison:void 0,tableComparisonPresent:!!o&&"metricComparison"in o}}function j(e){const t=[],n=(o,i)=>{if(Array.isArray(o)){o.forEach((r,s)=>n(r,`${i}[${s}]`));return}if(!h(o))return;const a=o.config;if(h(a)){const r=ne(o),s=!!(r.kpiComparisonPresent||r.tableComparisonPresent),m=a.metricColumns,p=Array.isArray(m)?m.flatMap((l,c)=>h(l)?[{index:c,metric:l}]:[]):[];if((p.some(({metric:l})=>"comparisonType"in l)||s)&&t.push({path:i,card:o,metrics:p,malformedMetricIndexes:Array.isArray(m)?m.flatMap((l,c)=>h(l)?[]:[c]):[],malformedMetricColumns:"metricColumns"in a&&!Array.isArray(m),hasLegacyPresentation:s}),"metricColumns"in a||s)return}Object.entries(o).forEach(([r,s])=>n(s,i?`${i}.${r}`:r))};return n(e,"$"),t}const oe={difference:"difference",change:"percent_change",change_difference:"both",ratio:"ratio"};function U(e,t){if(!e)return;const n=Object.fromEntries(t.flatMap(o=>typeof e[o]=="string"?[[o,e[o]]]:[]));return Object.keys(n).length?n:void 0}function Ye(e,t,n){if(e!==void 0){if(!h(e)){n.push({severity:"error",code:"invalid_legacy_comparison_presentation",path:t,message:"Legacy comparison formatOptions must be an object."});return}Object.entries(e).forEach(([o,i])=>{if(o==="decimalPlaces"){(typeof i!="number"||!Number.isInteger(i)||i<0||i>6)&&n.push({severity:"error",code:"invalid_legacy_comparison_presentation",path:`${t}.decimalPlaces`,message:"Legacy comparison decimalPlaces must be an integer from 0 through 6."});return}o==="type"&&(i===void 0||i==="auto")||i!==void 0&&n.push({severity:"error",code:"unsupported_comparison_format",path:`${t}.${o}`,message:`Legacy comparison format option "${o}" has no canonical presentation mapping.`})})}}function S(e,t){const n=t==="kpi"?e.calculationType:e.calculatedAs,o=t==="table"&&n===void 0?"both":oe[String(n)],i=h(e.formatOptions)?e.formatOptions:void 0,a=h(e.conditionalLabels)?e.conditionalLabels:void 0,r=h(t==="kpi"?e.colorConfig:e.colors)?t==="kpi"?e.colorConfig:e.colors:void 0,s={};if(o&&(s.displayMode=o),typeof(i==null?void 0:i.decimalPlaces)=="number"&&(s.precision=i.decimalPlaces),t==="kpi"){const l=e.showArrow!==!1,c=e.showColor!==!1;s.indicatorStyle=l?c?"arrow_badge":"arrow":c?"badge":"none",s.showColor=c,(e.position==="left"||e.position==="right"||e.position==="top")&&(s.position=e.position),typeof e.conditionalLabel=="boolean"&&(s.conditionalLabel=e.conditionalLabel),typeof e.labelName=="string"&&(s.labelName=e.labelName)}else(e.indicatorStyle==="arrow_badge"||e.indicatorStyle==="arrow"||e.indicatorStyle==="badge"||e.indicatorStyle==="none")&&(s.indicatorStyle=e.indicatorStyle);const m=a?{...U(a,["increase","decrease"]),...typeof a.noChange=="string"?{neutral:a.noChange}:typeof a.neutral=="string"?{neutral:a.neutral}:{}}:void 0;m&&Object.keys(m).length&&(s.conditionalLabels=m);const p=r?{...U(r,["increase","decrease"]),...typeof r.noChange=="string"?{neutral:r.noChange}:typeof r.neutral=="string"?{neutral:r.neutral}:{}}:void 0;return p&&Object.keys(p).length&&(s.colors=p),s}function J(e){return{...ee.COMPARISON_PRESENTATION_DEFAULTS,...e}}function G(e){return e.some(({metric:t})=>t.comparisonType==="previous_period"||t.comparisonType==="same_period_last_year"||t.comparisonType==="target"?!0:h(t.comparison)&&t.comparison.mode==="explicit")}function F(e){const t=e.card.config;return e.metrics.length===2&&(t.groupByColumns===void 0||Array.isArray(t.groupByColumns)&&t.groupByColumns.length===0)}function K(e,t,n,o){const i=t==="kpi"?["enabled","calculationType","formatOptions","showArrow","showColor","conditionalLabel","labelName","position","conditionalLabels","colorConfig","lowerIsBetter"]:["calculatedAs","indicatorStyle","formatOptions","colors","lowerIsBetter"];Object.keys(e).forEach(l=>{i.includes(l)||o.push({severity:"error",code:"invalid_legacy_comparison_presentation",path:`${n}.${l}`,message:`Unknown legacy comparison presentation field "${l}" cannot be dropped automatically.`})});const a=t==="kpi"?"calculationType":"calculatedAs";e[a]!==void 0&&!oe[String(e[a])]&&o.push({severity:"error",code:"invalid_legacy_comparison_presentation",path:`${n}.${a}`,message:`Legacy comparison ${a} is unsupported.`}),t==="kpi"&&e.position!==void 0&&!["left","right","top"].includes(String(e.position))&&o.push({severity:"error",code:"invalid_legacy_comparison_presentation",path:`${n}.position`,message:"Legacy comparison position is unsupported."}),t==="kpi"&&e.labelName!==void 0&&typeof e.labelName!="string"&&o.push({severity:"error",code:"invalid_legacy_comparison_presentation",path:`${n}.labelName`,message:"Legacy comparison labelName must be a string."}),(t==="kpi"?[["conditionalLabels",["increase","decrease","noChange"]],["colorConfig",["increase","decrease","noChange"]]]:[["colors",["increase","decrease","neutral"]]]).forEach(([l,c])=>{if(e[l]!==void 0){if(!h(e[l])){o.push({severity:"error",code:"invalid_legacy_comparison_presentation",path:`${n}.${l}`,message:`Legacy comparison ${l} must be an object.`});return}Object.entries(e[l]).forEach(([b,d])=>{c.includes(b)?typeof d!="string"&&o.push({severity:"error",code:"invalid_legacy_comparison_presentation",path:`${n}.${l}.${b}`,message:`Legacy comparison ${l}.${b} must be a string.`}):o.push({severity:"error",code:"invalid_legacy_comparison_presentation",path:`${n}.${l}.${b}`,message:`Unknown legacy comparison ${l} field "${b}" cannot be dropped automatically.`})})}}),(t==="kpi"?["enabled","showArrow","showColor","conditionalLabel","lowerIsBetter"]:["lowerIsBetter"]).forEach(l=>{e[l]!==void 0&&typeof e[l]!="boolean"&&o.push({severity:"error",code:"invalid_legacy_comparison_presentation",path:`${n}.${l}`,message:`Legacy comparison ${l} must be a boolean.`})}),t==="table"&&e.indicatorStyle!==void 0&&!["arrow_badge","arrow","badge","none"].includes(String(e.indicatorStyle))&&o.push({severity:"error",code:"invalid_legacy_comparison_presentation",path:`${n}.indicatorStyle`,message:"Legacy comparison indicatorStyle is unsupported."}),Ye(e.formatOptions,`${n}.formatOptions`,o);const m=S(e,t);ee.validateComparisonPresentationSpec(m,n).errors.forEach(l=>{o.push({severity:"error",code:"invalid_legacy_comparison_presentation",path:l.path||n,message:l.message})})}function Q(e){const t=ne(e.card),n=t.kpiComparison?S(t.kpiComparison,"kpi"):void 0,o=t.tableComparison?S(t.tableComparison,"table"):void 0;return{namespaces:t,kpi:n,table:o,presentation:n||o}}function Me(e){const t=h(e.preferences)?e.preferences:{},n=h(t.kpiVisualOptions)?t.kpiVisualOptions:{},o=h(n.metricComparison)?n.metricComparison:{},i=h(t.tableVisualOptions)?t.tableVisualOptions:{},a=h(i.metricComparison)?i.metricComparison:{};return n.lowerIsBetter===!0||o.lowerIsBetter===!0||a.lowerIsBetter===!0?"lower_is_better":"higher_is_better"}function Te(e){switch(e.comparisonType){case"previous_period":return{mode:"explicit",spec:{kind:"previous_period"}};case"same_period_last_year":return{mode:"explicit",spec:{kind:"previous_year"}};case"target":return{mode:"explicit",spec:{kind:"target",targetValue:e.targetValue}};default:return}}function ke(e){const t=h(e.preferences)?e.preferences:void 0;if(!t)return;const n=h(t.kpiVisualOptions)?t.kpiVisualOptions:void 0;n&&delete n.lowerIsBetter;const o=h(t.tableVisualOptions)?t.tableVisualOptions:void 0,i=o&&h(o.metricComparison)?o.metricComparison:void 0;i&&delete i.lowerIsBetter}function Ee(e){const t=j(e);if(!t.length)return{document:e,changed:!1,changes:[],diagnostics:[]};const n=[];if(t.forEach(r=>{var s,m,p,l;if(r.malformedMetricColumns&&n.push({severity:"error",code:"malformed_metric_columns",path:`${r.path}.config.metricColumns`,message:"Metric columns must be an array before comparison migration."}),r.malformedMetricIndexes.forEach(c=>{n.push({severity:"error",code:"malformed_metric_columns",path:`${r.path}.config.metricColumns[${c}]`,message:"Metric columns must contain objects before comparison migration."})}),r.metrics.forEach(({metric:c,index:b})=>{if(!("comparisonType"in c))return;const d=`${r.path}.config.metricColumns[${b}]`,y=String(c.comparisonType||"");"comparison"in c&&n.push({severity:"error",code:"conflicting_comparison_contracts",path:d,message:"Metric contains both legacy and canonical comparison configuration; resolve the conflict before migration."});const v=h(c.parameters)?c.parameters:void 0,M=v&&h(v.windowTransform)?v.windowTransform:void 0;w.has(y)&&(M==null?void 0:M.function)==="previous_period_delta"&&n.push({severity:"error",code:"conflicting_comparison_window_transform",path:d,message:"A metric cannot combine baseline comparison with previous_period_delta; resolve the authoring intent before migration."}),_e.has(y)||n.push({severity:"error",code:"unsupported_comparison_type",path:`${d}.comparisonType`,message:`Unsupported legacy metric comparison type "${y}".`}),c.comparisonType==="target"&&(typeof c.targetValue!="number"||!Number.isFinite(c.targetValue))&&n.push({severity:"error",code:"invalid_target_value",path:`${d}.targetValue`,message:"Legacy target comparison requires a finite metric targetValue."}),c.comparisonType==="start_vs_end"&&n.push({severity:"error",code:"unsupported_start_vs_end",path:`${d}.comparisonType`,message:"start_vs_end is retired and cannot be migrated automatically."}),c.targetValue!==void 0&&c.comparisonType!=="target"&&n.push({severity:"warning",code:"stray_target_value",path:`${d}.targetValue`,message:"Dead non-target targetValue will be removed without changing the baseline."})}),r.hasLegacyPresentation){const{namespaces:c,kpi:b,table:d}=Q(r),y=[(s=c.kpiOptions)==null?void 0:s.lowerIsBetter,(m=c.kpiComparison)==null?void 0:m.lowerIsBetter,(p=c.tableComparison)==null?void 0:p.lowerIsBetter].filter(v=>typeof v=="boolean");new Set(y).size>1&&n.push({severity:"error",code:"conflicting_legacy_polarity",path:`${r.path}.preferences`,message:"Legacy comparison polarity values disagree; resolve the conflict before migration."}),((l=c.kpiOptions)==null?void 0:l.lowerIsBetter)!==void 0&&typeof c.kpiOptions.lowerIsBetter!="boolean"&&n.push({severity:"error",code:"invalid_legacy_comparison_presentation",path:`${r.path}.preferences.kpiVisualOptions.lowerIsBetter`,message:"Legacy comparison lowerIsBetter must be a boolean."}),c.kpiComparisonPresent&&!c.kpiComparison&&n.push({severity:"error",code:"invalid_legacy_comparison_presentation",path:`${r.path}.preferences.kpiVisualOptions.metricComparison`,message:"Legacy KPI comparison presentation must be an object."}),c.tableComparisonPresent&&!c.tableComparison&&n.push({severity:"error",code:"invalid_legacy_comparison_presentation",path:`${r.path}.preferences.tableVisualOptions.metricComparison`,message:"Legacy table comparison presentation must be an object."}),"comparisonPresentation"in(c.preferences||{})&&n.push({severity:"error",code:"conflicting_comparison_presentation_contracts",path:`${r.path}.preferences.comparisonPresentation`,message:"Card contains both legacy and canonical comparison presentation; resolve the conflict before migration."}),c.kpiComparison&&typeof c.kpiComparison.enabled=="boolean"&&"metricPairComparisonEnabled"in(c.preferences||{})&&F(r)&&n.push({severity:"error",code:"conflicting_comparison_presentation_contracts",path:`${r.path}.preferences.metricPairComparisonEnabled`,message:"Card contains both legacy and canonical metric-pair enablement; resolve the conflict before migration."}),c.kpiComparison&&K(c.kpiComparison,"kpi",`${r.path}.preferences.kpiVisualOptions.metricComparison`,n),c.tableComparison&&K(c.tableComparison,"table",`${r.path}.preferences.tableVisualOptions.metricComparison`,n),b&&d&&JSON.stringify(J(b))!==JSON.stringify(J(d))&&n.push({severity:"error",code:"conflicting_legacy_presentation_namespaces",path:`${r.path}.preferences`,message:"KPI and table comparison presentation values disagree; resolve the conflict before migration."})}}),n.some(r=>r.severity==="error"))return{document:e,changed:!1,changes:[],diagnostics:n};const o=JSON.parse(JSON.stringify(e)),i=j(o),a=[];return i.forEach(r=>{var m;const s=Me(r.card);if(r.metrics.forEach(({metric:p,index:l})=>{if(!("comparisonType"in p))return;const c=String(p.comparisonType||""),b=`${r.path}.config.metricColumns[${l}]`,d=Te(p),y=["comparisonType"];delete p.comparisonType,"targetValue"in p&&(delete p.targetValue,y.push("targetValue")),"comparisonDisplay"in p&&(delete p.comparisonDisplay,y.push("comparisonDisplay")),d?p.comparison=d:delete p.comparison,w.has(c)&&(p.comparisonPolarity=s),a.push({kind:"metric",path:b,metricId:typeof p.id=="string"?p.id:void 0,legacyType:c,comparison:d,comparisonPolarity:w.has(c)?s:void 0,removedFields:y})}),ke(r.card),r.hasLegacyPresentation){const{namespaces:p,presentation:l}=Q(r),c=(m=p.kpiComparison)==null?void 0:m.enabled,b={...l};typeof c=="boolean"&&G(r.metrics)&&(b.showComparison=c);const d=typeof c=="boolean"&&F(r)?c:void 0,y=typeof c=="boolean"&&!G(r.metrics)&&!F(r)?["kpiVisualOptions.metricComparison.enabled"]:void 0,v=p.preferences,M=[];r.metrics.forEach(({metric:N})=>{"comparisonPolarity"in N||(N.comparisonPolarity=s,typeof N.id=="string"&&M.push(N.id))}),Object.keys(b).length&&(v.comparisonPresentation=b),d!==void 0&&(v.metricPairComparisonEnabled=d),p.kpiOptions&&delete p.kpiOptions.metricComparison,p.tableOptions&&delete p.tableOptions.metricComparison,a.push({kind:"presentation",path:`${r.path}.preferences`,comparisonPresentation:Object.keys(b).length?b:void 0,metricPairComparisonEnabled:d,comparisonPolarityMetricIds:M,intentionallyDiscardedFields:y,removedFields:[...p.kpiComparison?["kpiVisualOptions.metricComparison"]:[],...p.tableComparison?["tableVisualOptions.metricComparison"]:[]]})}}),{document:o,changed:!0,changes:a,diagnostics:n}}function f(e){return typeof e=="string"&&e.trim().length>0?e.trim():null}function ie(e){return Array.from(new Set(e.filter(t=>!!t)))}function Ie(e){const t=f(e.table),n=f(e.schema),o=f(e.catalog)||f(e.database);return t?ie([t,n?`${n}.${t}`:null,o?`${o}.${t}`:null,o&&n?`${o}.${n}.${t}`:null]):[]}function W(e){const t=f(e.table)||f(e.tableName);return ie([f(e.name),f(e.alias),...Ie({table:t,schema:f(e.schema)||f(e.schemaName),catalog:f(e.catalog),database:f(e.database)||f(e.databaseName)})])}function Ae(e,t){const n=f(e.domainId),o=f(t.domainId);if(n&&o&&n!==o)return!0;if(e.type==="dataset")return!1;const i=f(e.id),a=f(t.id);if(i&&a&&i!==a)return!0;const r=f(e.connectionId),s=f(t.connectionId);return!!(r&&s&&r!==s)}function B(e,t=!1){return f(e.table)||f(e.tableName)||(e.type!=="dataset"||t?f(e.name):null)}function z(e){return f(e.catalog)||f(e.database)||f(e.databaseName)}function L(e){return f(e.schema)||f(e.schemaName)}function P(e){return e.length===1?e[0]:void 0}function De(e,t){const n=B(t,!0),o=z(t),i=L(t);if(!(!n||!o&&!i))return P(e.filter(a=>{const r=a;return!(B(r)!==n||o&&z(r)!==o||i&&L(r)!==i)}))}function A(e,t){if(!t||!(e!=null&&e.length))return;const n=e.filter(s=>!Ae(s,t));if(t.type==="dataset"){const s=f(t.id);if(s)return P(n.filter(p=>p.type==="dataset"&&f(p.id)===s));if(f(t.domainId)){const p=f(t.name);return P(n.filter(l=>l.type==="dataset"&&f(l.name)===p))}}let o=[];if(t.type==="dataset"){const s=f(t.name);if(o=n.filter(m=>m.type==="dataset"&&f(m.name)===s),o.length===1)return o[0]}if(!!(B(t,!0)&&(z(t)||L(t))))return De(n,t);if(o.length>1)return;const a=W(t);if(a.length===0)return;const r=n.filter(s=>W(s).some(p=>a.includes(p)));return P(r)}function $(e,t){const n=A(e,t);return n?{...t,...n}:t}function Oe(e,t){const n=t||[];return n.length===0?e:{...e,baseEntity:$(n,e.baseEntity),joins:e.joins.map(o=>({...o,source:$(n,o.source),target:$(n,o.target)}))}}function Ne(e,t){if(!(e!=null&&e.joins.length))return[];const n=[e.baseEntity,...e.joins.flatMap(i=>[i.source,i.target])],o=[];return n.forEach(i=>{!A(t,i)&&!A(o,i)&&o.push(i)}),o}function k(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function E(e){return k(e)&&typeof e.name=="string"}function x(e){return!k(e)||e.kind!=="semantic"&&e.kind!=="physical"||(e.kind==="semantic"?[e.datasetId,e.datasetName,e.connectionId]:[e.databaseName,e.schemaName]).some(n=>n!==void 0&&typeof n!="string")?!1:C.hasCompleteSemaphorSourceIdentity(e)}function we(e){return[...e.groupByColumns??[],...e.metricColumns??[],...e.pivotByColumns??[],...e.detailColumns??[],...e.sortByColumns??[]]}function V(e){return e?[...(e.conditions??[]).flatMap(t=>t.field?[t.field]:[]),...(e.groups??[]).flatMap(V)]:[]}function re(e){var o,i;const t="parameters"in e?V((o=e.parameters)==null?void 0:o.filters):[],n=((i=e.calculatedFormula)==null?void 0:i.inputFields)??[];return[...t,...n.flatMap(a=>re(a))]}function se(e){const t=Array.isArray(e==null?void 0:e.selectedEntities)?e.selectedEntities.filter(E):[];return C.mergeSemaphorSourcesByIdentity(t.flatMap(n=>{const o=Y(n,e);return o?[o]:[]}))}function R(e,t){const n=t.filter(o=>C.semaphorSourcesReferToSameDataset(o,e));return n.length===1?n[0]:void 0}function Pe(e,t){if(t.kind==="semantic")return!!(e.entityId&&e.entityId===t.datasetId||e.entityName&&e.entityName===t.datasetName);const n=[t.databaseName,t.schemaName,t.tableName].filter(o=>!!o).join(".");return!!(e.entityName===t.tableName||e.qualifiedEntityName&&e.qualifiedEntityName===n)}function Fe(e,t){const n=Array.isArray(t==null?void 0:t.selectedEntities)?t.selectedEntities.filter(E):[],o=e.entityName||e.qualifiedEntityName;if(!o)return;const i=e.entityId?A(n,{type:"dataset",id:e.entityId,name:o}):void 0;if(i)return Y(i,t);const a=A(n,{type:(t==null?void 0:t.mode)==="semanticDomain"?"dataset":"table",name:(t==null?void 0:t.mode)==="semanticDomain"?o:e.qualifiedEntityName||o});if(a&&!((t==null?void 0:t.mode)==="semanticDomain"&&e.entityId&&![e.entityName,e.qualifiedEntityName,a.name,a.type==="dataset"&&"table"in a?a.table:void 0].filter(s=>!!s).includes(e.entityId)))return Y(a,t)}function $e(e,t,n){var a,r,s;const o=!!(C.hasSyntheticCalculatedFieldOwner(e)||(r=(a=e.calculatedFormula)==null?void 0:a.inputFields)!=null&&r.length||(s=e.derivedField)!=null&&s.inputs&&Object.keys(e.derivedField.inputs).length>0);if(e.source&&!o){const m=R(e.source,n);return m?[m]:[]}const i=ve.resolveFieldDatasetDependencies(e).datasets;return C.mergeSemaphorSourcesByIdentity(i.flatMap(m=>{const l=e.source&&Pe(m,e.source)&&R(e.source,n)||Fe(m,t);return l?[l]:[]}))}function Se(e,t){const n=se(t),o=we(e),i=V(e.filters),a=[...i,...[...o,...i].flatMap(re)];return C.mergeSemaphorSourcesByIdentity([...o,...a].flatMap(r=>$e(r,t,n)))}function Be(e,t,n){var i;return x(e)?!!!((i=t==null?void 0:t.selectedEntities)!=null&&i.length)||!n?e:R(e,se(t)):void 0}function Y(e,t){var p,l;const n=Array.isArray(t==null?void 0:t.selectedEntities)?t.selectedEntities.filter(E):void 0,o=A(n,e),i=o?{...e,...o}:e,a="domainId"in i&&typeof i.domainId=="string"&&!!i.domainId.trim();if((t==null?void 0:t.mode)==="semanticDomain"&&!a)return;if((t==null?void 0:t.mode)!=="database"&&i.type==="dataset"){const c=Ce.resolveSemaphorSemanticDatasetEntity({entities:[i],semanticDomainId:t==null?void 0:t.semanticDomainId,connectionId:t==null?void 0:t.connectionId,fieldEntityType:"dataset"},{includePhysicalDatasets:!0});if(c.kind==="resolved"){const b="label"in i&&typeof i.label=="string"?i.label:void 0;return{...c.source,...b?{label:b}:{}}}}if((t==null?void 0:t.mode)==="semanticDomain")return;const r=i.connectionId||(t==null?void 0:t.connectionId),s=i.type==="dataset"&&"table"in i&&i.table?i.table:i.name;if(!r||!s)return;const m={kind:"physical",connectionId:r,connectionType:i.connectionType||(t==null?void 0:t.connectionType),tableName:s,databaseName:i.database||((p=t==null?void 0:t.dbSelection)==null?void 0:p.database),schemaName:i.schema||((l=t==null?void 0:t.dbSelection)==null?void 0:l.schema),dialect:i.dialect};return x(m)?m:void 0}function ze(e,t){var s,m;const n=Y(e,t);if(!n)return;const o=e.type==="dataset"&&"table"in e&&typeof e.table=="string"?e.table.trim():void 0,i=n.kind==="physical"?n.tableName:o,a=e.connectionId||(t==null?void 0:t.connectionId),r=i&&a?{connectionId:a,databaseName:e.database||((s=t==null?void 0:t.dbSelection)==null?void 0:s.database),schemaName:e.schema||((m=t==null?void 0:t.dbSelection)==null?void 0:m.schema),tableName:i}:void 0;return{source:n,...r?{executionTable:r}:{}}}function ae(e){const t=k(e.dataSource)?e.dataSource:void 0;if(typeof e.sql=="string"&&e.sql.trim()){const s=[],m=Array.isArray(t==null?void 0:t.selectedEntities)?t.selectedEntities:[];for(const p of m){if(!E(p))continue;const l=ze(p,t);l&&!s.some(c=>C.semaphorSourcesReferToSameDataset(c.source,l.source))&&s.push(l)}return{cardId:e.id,kind:"sql",pinnedCatalogSources:s}}if(!k(e.config))return{cardId:e.id,kind:"unconfigured"};const n=e.config,o=[],i=H.inspectMatrixCardConfig(e);if(i.status==="invalid")return{cardId:e.id,kind:"unconfigured"};const a=i.status==="ready"?i.config:void 0;if(e.type==="matrixTable"&&!a)return{cardId:e.id,kind:"unconfigured"};a&&o.push(...H.matrixDefinitionSources(a.spec).filter(x));const r=(a==null?void 0:a.spec.joinPlan)??(k(n.joinPlan)?n.joinPlan:void 0);if(r){const s=Array.isArray(r.joins)?r.joins:[],m=[r.baseEntity];for(const l of s)k(l)&&m.push(l.source,l.target);let p=!1;for(const l of m){if(!E(l)){p=!0;continue}const c=Y(l,t);c?o.push(c):p=!0}p&&(o.length=0)}else if(e.type!=="matrixTable"){const s=Array.isArray(t==null?void 0:t.selectedEntities)?t.selectedEntities:[];if(s.length===1&&E(s[0])){const p=Y(s[0],t);p&&o.push(p)}o.push(...Se(n,t));const m=Be(n.queryBaseSource,t,o.length>0);m&&o.push(m)}return{cardId:e.id,kind:"config",executableSources:C.mergeSemaphorSourcesByIdentity(o)}}function Le(e,t){return(e.kind==="config"?e.executableSources:e.kind==="sql"?e.pinnedCatalogSources.map(o=>o.source):[]).some(o=>C.semaphorSourcesReferToSameDataset(o,t))}function ce(e,t){if(e.kind==="config")return e.executableSources.find(n=>C.semaphorSourcesReferToSameDataset(n,t))}function Re(e,t){var n;return(n=le(e,t))==null?void 0:n.source}function le(e,t){if(e.kind==="sql")return e.pinnedCatalogSources.find(n=>C.semaphorSourcesReferToSameDataset(n.source,t))}const pe={rowMembers:!0,columnMembers:!0,cells:!0};function me(e,t){return{enabled:t==="on",fields:e.type==="detailTable"?{kind:"clickedCell"}:{kind:"wholeRow"},multipleSelection:!0,selectionCheckboxes:"auto",...e.type==="matrixTable"?{matrixSources:{...pe}}:{},targets:{kind:"allSheets"},cardMappings:[]}}const xe=["string","number","boolean","date","datetime"];function Ve(e){return(e.kind==="semantic"?[e.datasetId,e.datasetName]:[e.tableName,[e.databaseName,e.schemaName,e.tableName].filter(Boolean).join(".")]).filter(t=>!!t).map(t=>C.normalizeAnalyticsCatalogName(t))}function ue(e,t){if(t.kind!=="config"||e.expression||e.calculatedFormula)return;const n=C.normalizeAnalyticsCatalogDataType(e.dataType);if(!xe.includes(n))return;let o;if(e.source)o=ce(t,e.source);else{const i=[e.entityId,e.entityName,e.qualifiedEntityName].filter(r=>!!r).map(r=>C.normalizeAnalyticsCatalogName(r)),a=t.executableSources.filter(r=>Ve(r).some(s=>i.includes(s)));a.length===1?o=a[0]:!a.length&&t.executableSources.length===1&&(o=t.executableSources[0])}if(!(!o||!e.name))return{name:e.name,source:o,dataType:n,...e.sourceField&&e.sourceField!==e.name?{sourceField:e.sourceField}:{}}}function qe(e,t){const{matrixSources:n,...o}=t,i=t.fields.kind==="chosenColumns"?{kind:"chosenColumns",clickedFieldKeys:[...new Set(t.fields.clickedFieldKeys)]}:t.fields;return{...o,fields:i,...e.type==="matrixTable"?{matrixSources:n??{...pe}}:{}}}function He(e,t){var c,b;if(e.clickToFilter)return qe(e,e.clickToFilter);const n=me(e,t),o=(((c=e.interactionConfig)==null?void 0:c.interactions)??[]).filter(d=>d.mode==="clickFilter");if(!o.length)return n;const i=ae(e);let a=!1;const r=[];for(const d of o){if(((b=d.trigger)==null?void 0:b.type)!=="attribute"){a=!0;continue}const y=ue(d.trigger.field,i);if(!y){a=!0;continue}const v=Z.selectionFieldKey(y);r.includes(v)||r.push(v)}const s=o.every(d=>d.applyToCardIds!==void 0),m=[...new Set(o.flatMap(d=>d.applyToCardIds??[]))],p=o.filter(d=>d.applyToCardIds===void 0),l=s?[]:[...new Set(p.flatMap(d=>d.excludeCardIds??[]))].filter(d=>p.every(y=>{var v;return(v=y.excludeCardIds)==null?void 0:v.includes(d)}));return{...n,enabled:!0,fields:a||!r.length?{kind:"wholeRow"}:{kind:"chosenColumns",clickedFieldKeys:r},targets:s?{kind:"cards",cardIds:m}:{kind:"allSheets"},cardMappings:l.map(d=>({kind:"excluded",cardId:d}))}}const de=u.z.union([u.z.object({kind:u.z.literal("allSheets"),sheetKinds:u.z.array(u.z.enum(["dashboard","document"])).optional()}).strict(),u.z.object({kind:u.z.literal("sheets"),sheetIds:u.z.array(u.z.string())}).strict(),u.z.object({kind:u.z.literal("cards"),cardIds:u.z.array(u.z.string())}).strict(),u.z.object({kind:u.z.literal("documentSections"),sheetId:u.z.string(),sectionIds:u.z.array(u.z.string())}).strict()]),fe=u.z.union([u.z.object({kind:u.z.literal("bound"),cardId:u.z.string().min(1),clickedFieldKey:u.z.string().min(1),target:u.z.object({kind:u.z.literal("field"),field:Z.selectionFieldSchema}).strict()}).strict(),u.z.object({kind:u.z.literal("excluded"),cardId:u.z.string().min(1)}).strict()]),je=u.z.object({enabled:u.z.boolean(),fields:u.z.union([u.z.object({kind:u.z.literal("wholeRow")}).strict(),u.z.object({kind:u.z.literal("clickedCell")}).strict(),u.z.object({kind:u.z.literal("chosenColumns"),clickedFieldKeys:u.z.array(u.z.string().min(1))}).strict()]),multipleSelection:u.z.boolean(),selectionCheckboxes:u.z.enum(["auto","always","never"]),matrixSources:u.z.object({rowMembers:u.z.boolean(),columnMembers:u.z.boolean(),cells:u.z.boolean()}).strict().optional(),targets:de,cardMappings:u.z.array(fe)}).strict(),Ue=u.z.boolean(),Je=u.z.object({targets:de.nullable().optional(),cardMappings:u.z.array(fe).nullable().optional()}).strict(),he=["bar","horizontalBar","line","area","stackedArea","combo","stackedBar","stackedLine"],Ge=new Set(he);function be(e){return typeof e=="string"&&Ge.has(e)}function Ke(e){return e==="detailTable"||e==="table"||e==="aggregateTable"||e==="pivotTable"||e==="custom"||be(e)}function X(e){return!!(e!=null&&e.trim())}function Qe(e){return X(e.sql)||X(e.normalizedPython)?"freeform":e.hasExecutableConfig?"config":"none"}const O={type:"temporal_bucket",presentation:{mode:"auto"}},_={value:"auto",label:"Automatic",format:O};function g(e,t){return{value:`pattern:${e}`,label:t,format:{type:"temporal_bucket",presentation:{mode:"pattern",pattern:e}}}}function D(e,t){return{value:`preset:${e}`,label:t,format:{type:"temporal_bucket",presentation:{mode:"preset",preset:e}}}}function T(e){return{...g(e,"Custom format…"),value:"custom",custom:!0}}const q={second:[_,g("HH:mm:ss","14:30:45 (HH:mm:ss)"),g("YYYY-MM-DD HH:mm:ss","2024-01-15 14:30:45 (YYYY-MM-DD HH:mm:ss)"),T("DD/MM/YYYY HH:mm:ss")],minute:[_,g("HH:mm","14:30 (HH:mm)"),g("YYYY-MM-DD HH:mm","2024-01-15 14:30 (YYYY-MM-DD HH:mm)"),T("DD/MM/YYYY HH:mm")],hour:[_,g("HH","14 (HH)"),g("YYYY-MM-DD HH","2024-01-15 14 (YYYY-MM-DD HH)"),T("DD/MM/YYYY HH")],day:[_,g("YYYY-MM-DD","2024-01-15 (YYYY-MM-DD)"),g("MM/DD/YYYY","01/15/2024 (MM/DD/YYYY)"),g("DD/MM/YYYY","15/01/2024 (DD/MM/YYYY)"),g("MMM DD, YYYY","Jan 15, 2024 (MMM DD, YYYY)"),g("MMMM DD, YYYY","January 15, 2024 (MMMM DD, YYYY)"),T("YYYY/MM/DD")],week:[_,D("week_of_short","Week of Jan 15, 2024"),D("week_of_long","Week of January 15, 2024"),g("YYYY-MM-DD","2024-01-15 (YYYY-MM-DD)"),T("YYYY/MM/DD")],month:[_,g("MMM YYYY","Jan 2024 (MMM YYYY)"),g("MMMM YYYY","January 2024 (MMMM YYYY)"),g("YYYY-MM","2024-01 (YYYY-MM)"),g("MM/YYYY","01/2024 (MM/YYYY)"),g("YYYY MMM","2024 Jan (YYYY MMM)"),T("YYYY/MM")],quarter:[_,D("quarter_short","Q1 2024"),D("quarter_long","1st Quarter 2024")],year:[_,g("YYYY","2024 (YYYY)"),g("YY","24 (YY)")]},We={second:"2026-07-31T14:05:09",minute:"2026-07-31T14:05:00",hour:"2026-07-31T14:00:00",day:"2026-07-31",week:"2026-07-27",month:"2026-07-01",quarter:"2026-07-01",year:"2026-01-01"};function ge(e,t,n=te.DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES){return I.formatTemporalBucket({value:We[t],metadata:{kind:"temporal_bucket",granularity:t,calendar:{tz:"UTC",weekStart:1,...e.presentation.mode==="preset"&&(e.presentation.preset==="fiscal_quarter_short"||e.presentation.preset==="fiscal_year")?{fiscalCalendar:{kind:"month_aligned",yearStartMonth:7}}:{}}},format:e.presentation.mode==="auto"?{type:"temporal_bucket",locale:n.locale,presentation:{mode:"auto",styles:{dateStyle:n.dateStyle,dateTime:{...n.dateTime}}}}:{type:"temporal_bucket",locale:n.locale,presentation:e.presentation}})}function Xe(e,t,n=te.DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES){const o=q[e],i=(t==null?void 0:t.presentation.mode)==="preset"?t.presentation.preset:void 0,a=i&&t&&I.validateTemporalBucketFormatApplicability(t,e).ok&&!o.some(s=>{var m;return((m=s.format)==null?void 0:m.presentation.mode)==="preset"&&s.format.presentation.preset===i})?D(i,i):void 0;return(a?[...o,a]:o).map(s=>{if(!s.format||s.custom)return s;const m=ge(s.format,e,n);return s.format.presentation.mode==="pattern"?{...s,label:`${m} (${s.format.presentation.pattern})`}:s.format.presentation.mode==="auto"?{...s,label:`Automatic (${m})`}:{...s,label:m}})}function Ze(e,t){const n=q[t];if(e.presentation.mode==="pattern"){const o=e.presentation.pattern,i=n.find(a=>{var r;return((r=a.format)==null?void 0:r.presentation.mode)==="pattern"&&a.format.presentation.pattern===o});return{value:(i==null?void 0:i.value)??"custom",customPattern:i!=null&&i.custom||!i?o:"",format:e}}if(e.presentation.mode==="preset"){const o=e.presentation.preset,i=n.find(r=>{var s;return((s=r.format)==null?void 0:s.presentation.mode)==="preset"&&r.format.presentation.preset===o}),a=I.validateTemporalBucketFormatApplicability(e,t).ok;return i?{value:i.value,customPattern:"",format:e}:a?{value:`preset:${o}`,customPattern:"",format:e}:{value:"auto",customPattern:"",format:O}}return{value:"auto",customPattern:"",format:e}}function et(e,t,n=""){var r;const o=q[e].find(s=>s.value===t),i=t.startsWith("preset:")?t.slice(7):void 0,a=t==="custom"?{type:"temporal_bucket",presentation:{mode:"pattern",pattern:n.trim()||(((r=o==null?void 0:o.format)==null?void 0:r.presentation.mode)==="pattern"?o.format.presentation.pattern:"")}}:(o==null?void 0:o.format)??(i&&I.isTemporalBucketPreset(i)?{type:"temporal_bucket",presentation:{mode:"preset",preset:i}}:void 0);return!a||!I.validateTemporalBucketFormatApplicability(a,e).ok?O:a}function tt(e,t){return I.validateTemporalBucketFormatApplicability(e,t).ok?e:O}const ye=[{value:"COUNT",label:"Count"},{value:"DISTINCT",label:"Count Distinct"}],nt=[...ye,{value:"SUM",label:"Sum"},{value:"AVG",label:"Average"},{value:"MIN",label:"Min"},{value:"MAX",label:"Max"},{value:"MEDIAN",label:"Median"}];function ot(e){return C.normalizeAnalyticsCatalogDataType(e)==="number"?nt:ye}exports.AUTOMATIC_TEMPORAL_BUCKET_FORMAT=O;exports.SEMAPHOR_CARTESIAN_CHART_TYPES=he;exports.buildDashboardCardSourceIndex=ae;exports.clickToFilterSettingsSchema=je;exports.dashboardCardFilterSourceInventoryContains=Le;exports.defaultClickToFilterSettings=me;exports.findDashboardCardExecutableSource=ce;exports.findDashboardCardPinnedCatalogSource=Re;exports.findDashboardSqlPinnedCatalogSource=le;exports.findOrphanedJoinPlanEntities=Ne;exports.getFieldAggregationOptions=ot;exports.getTemporalBucketAuthoringOptions=Xe;exports.getTemporalBucketAuthoringSelection=Ze;exports.isSemaphorCartesianChartType=be;exports.linkedClickToFilterOverridesSchema=Je;exports.normalizeClickToFilterSettings=He;exports.normalizeJoinPlanEntityReferences=Oe;exports.previewTemporalBucketAuthoringFormat=ge;exports.reconcileTemporalBucketAuthoringFormat=tt;exports.resolveDashboardEntitySource=Y;exports.resolveTemporalBucketAuthoringFormat=et;exports.resolveTemporalResultOwner=Qe;exports.respondsToSelectionsSchema=Ue;exports.selectionFieldFromExplorerField=ue;exports.supportsCanonicalDashboardTemporalResult=Ke;exports.transformComparisonDocument=Ee;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import "../value-format-preferences/index.js";
|
|
2
1
|
import { f as q } from "./validators-BDYzZFgs.js";
|
|
3
|
-
const
|
|
4
|
-
mode: "all"
|
|
5
|
-
}, f = {
|
|
2
|
+
const f = {
|
|
6
3
|
includeMetricFilterDatasets: !0,
|
|
7
4
|
preferQualifiedIdentity: !1
|
|
8
5
|
};
|
|
@@ -35,24 +32,24 @@ function b(e) {
|
|
|
35
32
|
w(e)
|
|
36
33
|
].join("|");
|
|
37
34
|
}
|
|
38
|
-
function
|
|
35
|
+
function g(e) {
|
|
39
36
|
return [e.entityName, e.qualifiedEntityName || "", e.entityId || ""].join("|");
|
|
40
37
|
}
|
|
41
38
|
function Q(e) {
|
|
42
39
|
return e.entityName || e.qualifiedEntityName || "";
|
|
43
40
|
}
|
|
44
|
-
function
|
|
41
|
+
function O(e) {
|
|
45
42
|
var t, i;
|
|
46
43
|
return !!(e.expression || e.derivedField || (i = (t = e.calculatedFormula) == null ? void 0 : t.inputFields) != null && i.length);
|
|
47
44
|
}
|
|
48
45
|
function k(e) {
|
|
49
|
-
return q(e) ? !0 : e.entityName || e.qualifiedEntityName ? !1 : !e.source ||
|
|
46
|
+
return q(e) ? !0 : e.entityName || e.qualifiedEntityName ? !1 : !e.source || O(e);
|
|
50
47
|
}
|
|
51
48
|
function y(e, t) {
|
|
52
|
-
const i =
|
|
49
|
+
const i = g(t);
|
|
53
50
|
e.found.has(i) || e.found.set(i, t);
|
|
54
51
|
}
|
|
55
|
-
function
|
|
52
|
+
function l(e, t) {
|
|
56
53
|
var F, v, E;
|
|
57
54
|
if (!e) return;
|
|
58
55
|
const i = b(e);
|
|
@@ -60,10 +57,10 @@ function d(e, t) {
|
|
|
60
57
|
t.visitedFields.add(i);
|
|
61
58
|
const n = k(e);
|
|
62
59
|
if (!n) {
|
|
63
|
-
const
|
|
60
|
+
const d = !e.entityName && !e.qualifiedEntityName ? I(e.source) : void 0;
|
|
64
61
|
y(
|
|
65
62
|
t,
|
|
66
|
-
|
|
63
|
+
d || {
|
|
67
64
|
// May be empty for qualified-only metadata; identity then comes from
|
|
68
65
|
// `qualifiedEntityName` (see `identityFor` and the calculator).
|
|
69
66
|
entityName: e.entityName || "",
|
|
@@ -75,12 +72,12 @@ function d(e, t) {
|
|
|
75
72
|
}
|
|
76
73
|
t.includeMetricFilterDatasets && "parameters" in e && ((F = e.parameters) != null && F.filters) && N(e.parameters.filters, t);
|
|
77
74
|
const u = (v = e.calculatedFormula) == null ? void 0 : v.inputFields, a = !!(u && u.length > 0);
|
|
78
|
-
a && u.forEach((
|
|
75
|
+
a && u.forEach((d) => l(d, t));
|
|
79
76
|
let r = !1, c = !1;
|
|
80
77
|
const s = a || (E = e.derivedField) == null ? void 0 : E.inputs;
|
|
81
78
|
if (s && Object.keys(s).length > 0)
|
|
82
|
-
for (const
|
|
83
|
-
const o =
|
|
79
|
+
for (const d of Object.values(s)) {
|
|
80
|
+
const o = d.field.source;
|
|
84
81
|
if (!o) {
|
|
85
82
|
a || (c = !0);
|
|
86
83
|
continue;
|
|
@@ -96,7 +93,7 @@ function d(e, t) {
|
|
|
96
93
|
label: o.label
|
|
97
94
|
});
|
|
98
95
|
else {
|
|
99
|
-
const D = [o.databaseName, o.schemaName, o.tableName].filter((
|
|
96
|
+
const D = [o.databaseName, o.schemaName, o.tableName].filter((h) => !!(h && h.trim())).join(".");
|
|
100
97
|
y(t, {
|
|
101
98
|
entityName: o.tableName,
|
|
102
99
|
qualifiedEntityName: D.includes(".") ? D : void 0,
|
|
@@ -111,7 +108,7 @@ function N(e, t) {
|
|
|
111
108
|
if (e && !t.visitedGroups.has(e.id)) {
|
|
112
109
|
t.visitedGroups.add(e.id);
|
|
113
110
|
for (const i of e.conditions || [])
|
|
114
|
-
|
|
111
|
+
l(i.field, t);
|
|
115
112
|
for (const i of e.groups || [])
|
|
116
113
|
N(i, t);
|
|
117
114
|
}
|
|
@@ -130,31 +127,31 @@ function p(e, t) {
|
|
|
130
127
|
const i = (n = e.qualifiedEntityName) != null && n.includes(".") ? e.qualifiedEntityName : void 0;
|
|
131
128
|
return t === "qualifiedOnly" ? i : t === "preferQualified" ? i || e.entityName || void 0 : e.entityName || void 0;
|
|
132
129
|
}
|
|
133
|
-
function
|
|
130
|
+
function j(e) {
|
|
134
131
|
const t = m(!1);
|
|
135
|
-
return
|
|
132
|
+
return l(e, t), { datasets: Array.from(t.found.values()), complete: t.complete };
|
|
136
133
|
}
|
|
137
|
-
function
|
|
134
|
+
function S(e, t, i = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), u = f) {
|
|
138
135
|
const a = { ...f, ...u }, r = m(a.includeMetricFilterDatasets, i, n);
|
|
139
|
-
|
|
136
|
+
l(e, r), r.found.forEach((c) => {
|
|
140
137
|
const s = p(c, a.preferQualifiedIdentity ? "preferQualified" : "name");
|
|
141
138
|
s && t.add(s);
|
|
142
139
|
});
|
|
143
140
|
}
|
|
144
|
-
function
|
|
145
|
-
|
|
141
|
+
function M(e, t) {
|
|
142
|
+
S(e, t, /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), {
|
|
146
143
|
preferQualifiedIdentity: !0
|
|
147
144
|
});
|
|
148
145
|
}
|
|
149
|
-
function
|
|
146
|
+
function A(e, t, i = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set()) {
|
|
150
147
|
const u = m(!0, i, n);
|
|
151
|
-
|
|
148
|
+
l(e, u), u.found.forEach((a) => {
|
|
152
149
|
const r = p(a, "qualifiedOnly");
|
|
153
150
|
r && t.add(r);
|
|
154
151
|
});
|
|
155
152
|
}
|
|
156
|
-
function
|
|
157
|
-
|
|
153
|
+
function T(e, t, i = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set()) {
|
|
154
|
+
S(e, t, i, n, {
|
|
158
155
|
includeMetricFilterDatasets: !1
|
|
159
156
|
});
|
|
160
157
|
}
|
|
@@ -165,18 +162,17 @@ function B(e, t, i = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), u
|
|
|
165
162
|
s && t.add(s);
|
|
166
163
|
});
|
|
167
164
|
}
|
|
168
|
-
function
|
|
165
|
+
function C(e, t) {
|
|
169
166
|
return t != null && t[e] ? t[e] : (e.includes(".") ? e.slice(e.lastIndexOf(".") + 1) : e).replace(/[_-]+/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\s+/g, " ").trim().replace(/\b\w/g, (n) => n.toUpperCase());
|
|
170
167
|
}
|
|
171
168
|
export {
|
|
172
|
-
M as D,
|
|
173
169
|
Q as a,
|
|
174
|
-
|
|
175
|
-
|
|
170
|
+
M as b,
|
|
171
|
+
S as c,
|
|
176
172
|
I as d,
|
|
177
|
-
|
|
178
|
-
|
|
173
|
+
A as e,
|
|
174
|
+
T as f,
|
|
179
175
|
B as g,
|
|
180
|
-
|
|
181
|
-
|
|
176
|
+
C as h,
|
|
177
|
+
j as r
|
|
182
178
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const q=require("./validators-DVYAnnX0.cjs"),f={includeMetricFilterDatasets:!0,preferQualifiedIdentity:!1};function N(e){if(!e)return;if(e.kind==="semantic")return{entityName:e.datasetName,entityId:e.datasetId,label:e.label};const t=[e.databaseName,e.schemaName,e.tableName].filter(i=>!!(i&&i.trim())).join(".");return{entityName:e.tableName,qualifiedEntityName:t.includes(".")?t:void 0,label:e.label}}function w(e){var i;const t=N(e.source);return t?`${(i=e.source)==null?void 0:i.kind}:${t.qualifiedEntityName||t.entityName}`:""}function b(e){return[e.id,e.qualifiedEntityName,e.entityId,e.entityName,e.qualifiedFieldName,e.name,w(e)].join("|")}function x(e){return[e.entityName,e.qualifiedEntityName||"",e.entityId||""].join("|")}function O(e){return e.entityName||e.qualifiedEntityName||""}function g(e){var t,i;return!!(e.expression||e.derivedField||(i=(t=e.calculatedFormula)==null?void 0:t.inputFields)!=null&&i.length)}function k(e){return q.hasSyntheticCalculatedFieldOwner(e)?!0:e.entityName||e.qualifiedEntityName?!1:!e.source||g(e)}function y(e,t){const i=x(t);e.found.has(i)||e.found.set(i,t)}function d(e,t){var D,E,I;if(!e)return;const i=b(e);if(t.visitedFields.has(i))return;t.visitedFields.add(i);const n=k(e);if(!n){const u=!e.entityName&&!e.qualifiedEntityName?N(e.source):void 0;y(t,u||{entityName:e.entityName||"",entityId:e.entityId,qualifiedEntityName:e.qualifiedEntityName,label:e.source&&e.source.kind==="semantic"?e.source.label:void 0})}t.includeMetricFilterDatasets&&"parameters"in e&&((D=e.parameters)!=null&&D.filters)&&F(e.parameters.filters,t);const l=(E=e.calculatedFormula)==null?void 0:E.inputFields,a=!!(l&&l.length>0);a&&l.forEach(u=>d(u,t));let r=!1,s=!1;const c=a||(I=e.derivedField)==null?void 0:I.inputs;if(c&&Object.keys(c).length>0)for(const u of Object.values(c)){const o=u.field.source;if(!o){a||(s=!0);continue}if(o.kind==="sql"){s=!0;continue}if(o.kind==="semantic")y(t,{entityName:o.datasetName,entityId:o.datasetId,label:o.label});else{const S=[o.databaseName,o.schemaName,o.tableName].filter(h=>!!(h&&h.trim())).join(".");y(t,{entityName:o.tableName,qualifiedEntityName:S.includes(".")?S:void 0,label:o.label})}r=!0}s&&(t.complete=!1),n&&!a&&!r&&(t.complete=!1)}function F(e,t){if(e&&!t.visitedGroups.has(e.id)){t.visitedGroups.add(e.id);for(const i of e.conditions||[])d(i.field,t);for(const i of e.groups||[])F(i,t)}}function m(e,t=new Set,i=new Set){return{found:new Map,complete:!0,visitedFields:t,visitedGroups:i,includeMetricFilterDatasets:e}}function p(e,t){var n;const i=(n=e.qualifiedEntityName)!=null&&n.includes(".")?e.qualifiedEntityName:void 0;return t==="qualifiedOnly"?i:t==="preferQualified"?i||e.entityName||void 0:e.entityName||void 0}function Q(e){const t=m(!1);return d(e,t),{datasets:Array.from(t.found.values()),complete:t.complete}}function v(e,t,i=new Set,n=new Set,l=f){const a={...f,...l},r=m(a.includeMetricFilterDatasets,i,n);d(e,r),r.found.forEach(s=>{const c=p(s,a.preferQualifiedIdentity?"preferQualified":"name");c&&t.add(c)})}function j(e,t){v(e,t,new Set,new Set,{preferQualifiedIdentity:!0})}function M(e,t,i=new Set,n=new Set){const l=m(!0,i,n);d(e,l),l.found.forEach(a=>{const r=p(a,"qualifiedOnly");r&&t.add(r)})}function A(e,t,i=new Set,n=new Set){v(e,t,i,n,{includeMetricFilterDatasets:!1})}function G(e,t,i=new Set,n=new Set,l=f){const a={...f,...l},r=m(a.includeMetricFilterDatasets,i,n);F(e,r),r.found.forEach(s=>{const c=p(s,a.preferQualifiedIdentity?"preferQualified":"name");c&&t.add(c)})}function T(e,t){return t!=null&&t[e]?t[e]:(e.includes(".")?e.slice(e.lastIndexOf(".")+1):e).replace(/[_-]+/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/\b\w/g,n=>n.toUpperCase())}exports.collectDatasetNamesFromExplorerField=v;exports.collectDatasetNamesFromFilterGroup=G;exports.collectExecutionDatasetNamesFromExplorerField=A;exports.collectPreferredDatasetNamesFromExplorerField=j;exports.collectQualifiedDatasetNamesFromExplorerField=M;exports.datasetRefFromSource=N;exports.dependencyDisplayIdentity=O;exports.humanizeDatasetName=T;exports.resolveFieldDatasetDependencies=Q;
|
|
@@ -4,17 +4,17 @@ var F = (e, r, t) => rt(e, typeof r != "symbol" ? r + "" : r, t);
|
|
|
4
4
|
import { s as J, k as G, l as nt, R as ot, q as at, p as xe, b as it } from "./raw-temporal-CUJ86xHI.js";
|
|
5
5
|
import { ak as $e, a4 as ct, a6 as ie, _ as ke, t as lt } from "./validators-BDYzZFgs.js";
|
|
6
6
|
import "./matrix-continuation-C4sRcjZU.js";
|
|
7
|
-
import "./matrix-operation-contract-
|
|
7
|
+
import "./matrix-operation-contract-xL8IhFzp.js";
|
|
8
8
|
import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as se } from "../value-format-preferences/index.js";
|
|
9
|
-
import { j as dt, h as st, e as mt, i as ut, d as ft, M as pt, c as yt, b as ht, P as j } from "./pivot-result-lifecycle-
|
|
9
|
+
import { j as dt, h as st, e as mt, i as ut, d as ft, M as pt, c as yt, b as ht, P as j } from "./pivot-result-lifecycle-CmjpW7qG.js";
|
|
10
10
|
import { z as E } from "zod";
|
|
11
11
|
import { r as gt } from "./matrix-definition-RyU0cpLX.js";
|
|
12
|
-
import { h as Ee, i as me, r as Se, a as _e, v as vt, b as bt } from "./
|
|
13
|
-
import { r as It } from "./matrix-card-
|
|
12
|
+
import { h as Ee, i as me, r as Se, a as _e, v as vt, b as bt } from "./card-config-utils-Bq1enstT.js";
|
|
13
|
+
import { r as It } from "./matrix-card-CnKQpnsj.js";
|
|
14
14
|
import { r as V, c as wt, b as Ct, P as Tt } from "./pivot-result-identity-BSudrDLN.js";
|
|
15
15
|
import { v as xt, a as $t } from "./temporal-bucket-contract-D5QlJbmm.js";
|
|
16
16
|
import { f as kt, b as Et, d as Fe, D as St } from "./temporal-bucket-B9hMwemw.js";
|
|
17
|
-
import {
|
|
17
|
+
import { a as Re, s as _t, i as Ft } from "./field-aggregations-DUb0NU6c.js";
|
|
18
18
|
import { v as Ae } from "./raw-temporal-contract-Eyr5U8DK.js";
|
|
19
19
|
import { r as Rt, a as At, b as Pt } from "./canonical-result-keys-CEQefvdO.js";
|
|
20
20
|
const Mt = `import pandas as pd
|