react-semaphor 0.1.519 → 0.1.521
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/CHANGELOG.md +5 -0
- package/package.json +25 -48
- package/dist/analytics-protocol/index.cjs +0 -1
- package/dist/appearance/index.cjs +0 -1
- package/dist/appearance-runtime/index.cjs +0 -1
- package/dist/brand-studio/index.cjs +0 -16
- package/dist/briefings/index.cjs +0 -1
- package/dist/chunks/appearance-context-DzqCdhB4.cjs +0 -1
- package/dist/chunks/appearance-runtime-provider-D5pkvgE4.cjs +0 -1
- package/dist/chunks/braces-v55uLCAK.cjs +0 -6
- package/dist/chunks/calculated-field-identity-5bg9oHTw.cjs +0 -1
- package/dist/chunks/canonical-result-keys-Cb96edol.cjs +0 -1
- package/dist/chunks/card-config-utils-z86y6tSq.cjs +0 -1
- package/dist/chunks/color-CyB5o13F.cjs +0 -4
- package/dist/chunks/column-bands-CU0byntA.cjs +0 -1
- package/dist/chunks/common-types-nBuCd3u2.cjs +0 -1
- package/dist/chunks/constants-B00YUv89.cjs +0 -1
- package/dist/chunks/dashboard-briefing-launcher-edgVkxY9.cjs +0 -21
- package/dist/chunks/dashboard-controls-BU4GRhTj.cjs +0 -52
- package/dist/chunks/dashboard-date-comparison-definition-Y6JZwpcr.cjs +0 -1
- package/dist/chunks/dashboard-json--bOkkyj1.cjs +0 -1
- package/dist/chunks/edit-dashboard-visual-4H05QT83.cjs +0 -172
- package/dist/chunks/editor-action-buttons-DZcRlo61.cjs +0 -16
- package/dist/chunks/field-aggregations-pH_3kymD.cjs +0 -1
- package/dist/chunks/field-dependencies-EB485TdB.cjs +0 -1
- package/dist/chunks/index-CapO5Uw9.cjs +0 -4
- package/dist/chunks/index-Cx3qmRUB.cjs +0 -1
- package/dist/chunks/index-D4ah3SrH.cjs +0 -1434
- package/dist/chunks/layout-grid-xm8pqtx0.cjs +0 -6
- package/dist/chunks/matrix-analytical-definition-BWd159lN.cjs +0 -1
- package/dist/chunks/matrix-card-C2RjEYZ8.cjs +0 -1
- package/dist/chunks/matrix-continuation-6nhDy-lF.cjs +0 -1
- package/dist/chunks/matrix-control-sources-BvEJF7d3.cjs +0 -1
- package/dist/chunks/matrix-definition-DanUT11P.cjs +0 -1
- package/dist/chunks/matrix-formatter-Qk8xsR05.cjs +0 -1
- package/dist/chunks/matrix-member-presentation-DvXDEo0U.cjs +0 -1
- package/dist/chunks/matrix-operation-contract-0RxoU_M3.cjs +0 -1
- package/dist/chunks/metric-comparison-CUmltzpz.cjs +0 -1
- package/dist/chunks/mouse-pointer-2-DX4A_XZw.cjs +0 -6
- package/dist/chunks/normalize-dashboard-for-dirty-check-BYtBA708.cjs +0 -1
- package/dist/chunks/numeric-presentation-mY6wJMdB.cjs +0 -1
- package/dist/chunks/operators-DEfKaU_V.cjs +0 -1
- package/dist/chunks/palette-BN-jYtaK.cjs +0 -6
- package/dist/chunks/pivot-header-presentation-DV2aBB6p.cjs +0 -5
- package/dist/chunks/pivot-result-identity-gquWljbd.cjs +0 -1
- package/dist/chunks/pivot-result-lifecycle-OXAgoIYm.cjs +0 -1
- package/dist/chunks/raw-temporal-CYdOOyR5.cjs +0 -1
- package/dist/chunks/raw-temporal-contract-CklMVG_1.cjs +0 -1
- package/dist/chunks/report-preferences-dialog-CZISeLGV.cjs +0 -1
- package/dist/chunks/report-runtime-context-CzSrCBsu.cjs +0 -1
- package/dist/chunks/save-3dYRmehL.cjs +0 -6
- package/dist/chunks/selection-reducer-Kl22OzIk.cjs +0 -26
- package/dist/chunks/semantic-format-Bd7HmLG_.cjs +0 -1
- package/dist/chunks/source-entity-resolution-R46X34SE.cjs +0 -1
- package/dist/chunks/stable-serialize-jqCpyZvd.cjs +0 -1
- package/dist/chunks/switch-C0520nRt.cjs +0 -134
- package/dist/chunks/temporal-bucket-4YEPEKlJ.cjs +0 -1
- package/dist/chunks/temporal-bucket-contract-nTv6gvX5.cjs +0 -1
- package/dist/chunks/temporal-input-presentation-BIOSVWCL.cjs +0 -1
- package/dist/chunks/token-types-aWrzwonf.cjs +0 -1
- package/dist/chunks/update-policy-DRDLWe7Y.cjs +0 -3
- package/dist/chunks/use-debounced-dirty-check-XHSwAefL.cjs +0 -1
- package/dist/chunks/validators-DFeDcdpA.cjs +0 -1
- package/dist/chunks/x-B6ghREd2.cjs +0 -31
- package/dist/dashboard/index.cjs +0 -1
- package/dist/dashboard-assistant/index.cjs +0 -1
- package/dist/dashboard-authoring/index.cjs +0 -3
- package/dist/data-app-builder/index.cjs +0 -51
- package/dist/data-app-builder-browser-runtime/index.cjs +0 -1
- package/dist/data-app-codegen/index.cjs +0 -1
- package/dist/data-app-codegen-node/index.cjs +0 -660
- package/dist/data-app-sdk/index.cjs +0 -117
- package/dist/data-app-sdk-adapters/index.cjs +0 -1
- package/dist/data-app-sdk-validation/index.cjs +0 -1
- package/dist/format-utils/index.cjs +0 -3
- package/dist/index.cjs +0 -1
- package/dist/layouts/index.cjs +0 -1
- package/dist/pdf-export-policy/index.cjs +0 -1
- package/dist/pdf-table-layout/index.cjs +0 -1
- package/dist/report-runtime-context/index.cjs +0 -1
- package/dist/shared/index.cjs +0 -1
- package/dist/surfboard/index.cjs +0 -1
- package/dist/types/index.cjs +0 -1
- package/dist/value-format-preferences/index.cjs +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,11 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
|
|
9
9
|
### Changed
|
|
10
10
|
|
|
11
|
+
- **Breaking package format change:** published JavaScript is now ESM-only.
|
|
12
|
+
TypeScript declarations and public subpath names are unchanged. Consumers
|
|
13
|
+
must use `import`; CommonJS applications can bundle the ESM entries during
|
|
14
|
+
their build instead of calling `require('react-semaphor')` at runtime.
|
|
15
|
+
|
|
11
16
|
- **Breaking internal delivery contract:** `react-semaphor/format-utils` now
|
|
12
17
|
exports `PresentationExecutionSnapshot` with `resolvedFormats`. The
|
|
13
18
|
numeric-only `NumericPresentationExecutionSnapshot`,
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"email": "support@semaphor.cloud"
|
|
6
6
|
},
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"version": "0.1.
|
|
8
|
+
"version": "0.1.521",
|
|
9
9
|
"description": "Fully interactive and customizable dashboards for your apps.",
|
|
10
10
|
"keywords": [
|
|
11
11
|
"react",
|
|
@@ -20,69 +20,57 @@
|
|
|
20
20
|
"DATA_APP_SDK.md",
|
|
21
21
|
"src/data-app-sdk/README.md"
|
|
22
22
|
],
|
|
23
|
-
"main": "dist/index.
|
|
23
|
+
"main": "dist/index.js",
|
|
24
24
|
"module": "dist/index.js",
|
|
25
25
|
"types": "dist/types/main.d.ts",
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
28
28
|
"types": "./dist/types/main.d.ts",
|
|
29
|
-
"import": "./dist/index.js"
|
|
30
|
-
"require": "./dist/index.cjs"
|
|
29
|
+
"import": "./dist/index.js"
|
|
31
30
|
},
|
|
32
31
|
"./dashboard": {
|
|
33
32
|
"types": "./dist/types/dashboard.d.ts",
|
|
34
|
-
"import": "./dist/dashboard/index.js"
|
|
35
|
-
"require": "./dist/dashboard/index.cjs"
|
|
33
|
+
"import": "./dist/dashboard/index.js"
|
|
36
34
|
},
|
|
37
35
|
"./surfboard": {
|
|
38
36
|
"types": "./dist/types/surfboard.d.ts",
|
|
39
|
-
"import": "./dist/surfboard/index.js"
|
|
40
|
-
"require": "./dist/surfboard/index.cjs"
|
|
37
|
+
"import": "./dist/surfboard/index.js"
|
|
41
38
|
},
|
|
42
39
|
"./shared": {
|
|
43
40
|
"types": "./dist/types/shared.d.ts",
|
|
44
|
-
"import": "./dist/shared/index.js"
|
|
45
|
-
"require": "./dist/shared/index.cjs"
|
|
41
|
+
"import": "./dist/shared/index.js"
|
|
46
42
|
},
|
|
47
43
|
"./types": {
|
|
48
44
|
"types": "./dist/types/types.d.ts",
|
|
49
|
-
"import": "./dist/types/index.js"
|
|
50
|
-
"require": "./dist/types/index.cjs"
|
|
45
|
+
"import": "./dist/types/index.js"
|
|
51
46
|
},
|
|
52
47
|
"./layouts": {
|
|
53
48
|
"types": "./dist/types/layouts.d.ts",
|
|
54
|
-
"import": "./dist/layouts/index.js"
|
|
55
|
-
"require": "./dist/layouts/index.cjs"
|
|
49
|
+
"import": "./dist/layouts/index.js"
|
|
56
50
|
},
|
|
57
51
|
"./dashboard-authoring": {
|
|
58
52
|
"types": "./dist/types/dashboard-authoring.d.ts",
|
|
59
|
-
"import": "./dist/dashboard-authoring/index.js"
|
|
60
|
-
"require": "./dist/dashboard-authoring/index.cjs"
|
|
53
|
+
"import": "./dist/dashboard-authoring/index.js"
|
|
61
54
|
},
|
|
62
55
|
"./analytics-protocol": {
|
|
63
56
|
"types": "./dist/types/analytics-protocol.d.ts",
|
|
64
|
-
"import": "./dist/analytics-protocol/index.js"
|
|
65
|
-
"require": "./dist/analytics-protocol/index.cjs"
|
|
57
|
+
"import": "./dist/analytics-protocol/index.js"
|
|
66
58
|
},
|
|
67
59
|
"./dashboard-assistant": {
|
|
68
60
|
"types": "./dist/types/dashboard-assistant.d.ts",
|
|
69
|
-
"import": "./dist/dashboard-assistant/index.js"
|
|
70
|
-
"require": "./dist/dashboard-assistant/index.cjs"
|
|
61
|
+
"import": "./dist/dashboard-assistant/index.js"
|
|
71
62
|
},
|
|
72
63
|
"./data-app-sdk": {
|
|
73
64
|
"types": "./dist/types/data-app-sdk.d.ts",
|
|
74
|
-
"import": "./dist/data-app-sdk/index.js"
|
|
75
|
-
"require": "./dist/data-app-sdk/index.cjs"
|
|
65
|
+
"import": "./dist/data-app-sdk/index.js"
|
|
76
66
|
},
|
|
77
67
|
"./data-app-sdk/adapters": {
|
|
78
68
|
"types": "./dist/types/data-app-sdk-adapters.d.ts",
|
|
79
|
-
"import": "./dist/data-app-sdk-adapters/index.js"
|
|
80
|
-
"require": "./dist/data-app-sdk-adapters/index.cjs"
|
|
69
|
+
"import": "./dist/data-app-sdk-adapters/index.js"
|
|
81
70
|
},
|
|
82
71
|
"./data-app-sdk/validation": {
|
|
83
72
|
"types": "./dist/types/data-app-sdk-validation.d.ts",
|
|
84
|
-
"import": "./dist/data-app-sdk-validation/index.js"
|
|
85
|
-
"require": "./dist/data-app-sdk-validation/index.cjs"
|
|
73
|
+
"import": "./dist/data-app-sdk-validation/index.js"
|
|
86
74
|
},
|
|
87
75
|
"./data-app-codegen": {
|
|
88
76
|
"types": "./dist/types/data-app-codegen.d.ts",
|
|
@@ -94,58 +82,47 @@
|
|
|
94
82
|
},
|
|
95
83
|
"./data-app-builder": {
|
|
96
84
|
"types": "./dist/types/data-app-builder.d.ts",
|
|
97
|
-
"import": "./dist/data-app-builder/index.js"
|
|
98
|
-
"require": "./dist/data-app-builder/index.cjs"
|
|
85
|
+
"import": "./dist/data-app-builder/index.js"
|
|
99
86
|
},
|
|
100
87
|
"./data-app-builder/browser-runtime": {
|
|
101
88
|
"types": "./dist/types/data-app-builder-browser-runtime.d.ts",
|
|
102
|
-
"import": "./dist/data-app-builder-browser-runtime/index.js"
|
|
103
|
-
"require": "./dist/data-app-builder-browser-runtime/index.cjs"
|
|
89
|
+
"import": "./dist/data-app-builder-browser-runtime/index.js"
|
|
104
90
|
},
|
|
105
91
|
"./appearance": {
|
|
106
92
|
"types": "./dist/types/appearance.d.ts",
|
|
107
|
-
"import": "./dist/appearance/index.js"
|
|
108
|
-
"require": "./dist/appearance/index.cjs"
|
|
93
|
+
"import": "./dist/appearance/index.js"
|
|
109
94
|
},
|
|
110
95
|
"./appearance-runtime": {
|
|
111
96
|
"types": "./dist/types/appearance-runtime.d.ts",
|
|
112
|
-
"import": "./dist/appearance-runtime/index.js"
|
|
113
|
-
"require": "./dist/appearance-runtime/index.cjs"
|
|
97
|
+
"import": "./dist/appearance-runtime/index.js"
|
|
114
98
|
},
|
|
115
99
|
"./brand-studio": {
|
|
116
100
|
"types": "./dist/types/brand-studio.d.ts",
|
|
117
|
-
"import": "./dist/brand-studio/index.js"
|
|
118
|
-
"require": "./dist/brand-studio/index.cjs"
|
|
101
|
+
"import": "./dist/brand-studio/index.js"
|
|
119
102
|
},
|
|
120
103
|
"./briefings": {
|
|
121
104
|
"types": "./dist/types/briefings.d.ts",
|
|
122
|
-
"import": "./dist/briefings/index.js"
|
|
123
|
-
"require": "./dist/briefings/index.cjs"
|
|
105
|
+
"import": "./dist/briefings/index.js"
|
|
124
106
|
},
|
|
125
107
|
"./format-utils": {
|
|
126
108
|
"types": "./dist/types/format-utils.d.ts",
|
|
127
|
-
"import": "./dist/format-utils/index.js"
|
|
128
|
-
"require": "./dist/format-utils/index.cjs"
|
|
109
|
+
"import": "./dist/format-utils/index.js"
|
|
129
110
|
},
|
|
130
111
|
"./format-utils/pdf-export-policy": {
|
|
131
112
|
"types": "./dist/types/pdf-export-policy.d.ts",
|
|
132
|
-
"import": "./dist/pdf-export-policy/index.js"
|
|
133
|
-
"require": "./dist/pdf-export-policy/index.cjs"
|
|
113
|
+
"import": "./dist/pdf-export-policy/index.js"
|
|
134
114
|
},
|
|
135
115
|
"./format-utils/pdf-table-layout": {
|
|
136
116
|
"types": "./dist/types/pdf-table-layout.d.ts",
|
|
137
|
-
"import": "./dist/pdf-table-layout/index.js"
|
|
138
|
-
"require": "./dist/pdf-table-layout/index.cjs"
|
|
117
|
+
"import": "./dist/pdf-table-layout/index.js"
|
|
139
118
|
},
|
|
140
119
|
"./value-format-preferences": {
|
|
141
120
|
"types": "./dist/types/value-format-preferences.d.ts",
|
|
142
|
-
"import": "./dist/value-format-preferences/index.js"
|
|
143
|
-
"require": "./dist/value-format-preferences/index.cjs"
|
|
121
|
+
"import": "./dist/value-format-preferences/index.js"
|
|
144
122
|
},
|
|
145
123
|
"./report-runtime-context": {
|
|
146
124
|
"types": "./dist/types/report-runtime-context.d.ts",
|
|
147
|
-
"import": "./dist/report-runtime-context/index.js"
|
|
148
|
-
"require": "./dist/report-runtime-context/index.cjs"
|
|
125
|
+
"import": "./dist/report-runtime-context/index.js"
|
|
149
126
|
},
|
|
150
127
|
"./style.css": "./dist/style.css"
|
|
151
128
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/validators-DFeDcdpA.cjs"),C=require("../chunks/operators-DEfKaU_V.cjs"),c=require("../chunks/matrix-member-presentation-DvXDEo0U.cjs"),a=require("../chunks/matrix-operation-contract-0RxoU_M3.cjs"),i=require("../chunks/source-entity-resolution-R46X34SE.cjs"),s=require("../chunks/metric-comparison-CUmltzpz.cjs"),p=require("../chunks/dashboard-date-comparison-definition-Y6JZwpcr.cjs"),y=require("../chunks/temporal-bucket-contract-nTv6gvX5.cjs"),A=require("../chunks/raw-temporal-contract-CklMVG_1.cjs"),T=require("../chunks/matrix-analytical-definition-BWd159lN.cjs"),u={kind:"semantic",domainId:"domain_sales",datasetName:"orders",connectionId:"conn_sales",label:"Orders"},I={revenueKpi:{version:1,kind:"metric",id:"revenue-kpi",label:"Revenue",source:u,measures:[{name:"revenue",role:"measure"}],primaryMeasure:{name:"revenue",role:"measure"},comparison:{kind:"previous_period"},limit:1},revenueTrend:{version:1,kind:"records",id:"revenue-trend",label:"Revenue trend",source:u,fields:[{name:"order_date",role:"date",dataType:"date",label:"Order Date"},{name:"revenue",role:"measure",dataType:"number"}],dateField:{name:"order_date",role:"date",dataType:"date"},timeGrain:"month",limit:100},topCustomersRecords:{version:1,kind:"records",id:"top-customers",label:"Top customers",source:u,fields:[{name:"customer_name",role:"dimension",dataType:"string"},{name:"segment",role:"dimension",dataType:"string"},{name:"revenue",role:"measure",dataType:"number"}],orderBy:{field:{name:"revenue",role:"measure"},direction:"desc"},limit:20},regionInputOptions:{version:1,kind:"inputOptions",id:"region-options",label:"Region options",inputId:"region",source:u,labelField:{name:"region",role:"dimension",dataType:"string"},valueField:{name:"region",role:"dimension",dataType:"string"},limit:100},previousPeriodRevenueComparison:{version:1,kind:"metric",id:"revenue-previous-period",label:"Revenue previous period comparison",source:u,measures:[{name:"revenue",role:"measure"}],primaryMeasure:{name:"revenue",role:"measure"},dateField:{name:"order_date",role:"date",dataType:"date"},timeGrain:"week",comparison:{kind:"previous_period"},limit:100},inboundSupplierConcentration:{version:1,kind:"metric",id:"inbound-supplier-concentration",label:"Inbound supplier concentration",source:u,measures:[{name:"net_tons",role:"measure"},{name:"ticket_value",role:"measure"}],primaryMeasure:{name:"net_tons",role:"measure"},dateField:{name:"ticket_date",role:"date",dataType:"date"},timeWindow:{unit:"month",value:6,anchor:"latest_available"},dimensions:[{name:"supplier_id",role:"dimension",dataType:"number"}],filters:[{field:{name:"direction",role:"dimension",dataType:"string"},operator:"=",values:["Inbound"]}],limit:15},boundedSqlRanking:{version:1,kind:"sql",id:"top-customer-ranking-sql",label:"Top customer ranking SQL",source:{kind:"sql",connectionId:"conn_sales",dialect:"postgres"},sql:"SELECT customer_name, SUM(revenue) AS revenue FROM public.orders GROUP BY customer_name ORDER BY revenue DESC LIMIT 20",limit:20,rationale:"Ranking is SQL-natural because it requires ordering grouped aggregate rows.",fields:[{name:"customer_name",role:"dimension",dataType:"string"},{name:"revenue",role:"measure",dataType:"number"}]}},E={visibleAxis:{source:{kind:"semantic",domainId:"commerce",datasetName:"orders"},field:{name:"order_date",label:"Order date",dataType:"timestamp with time zone"},expected:{status:"resolved",bindingSource:"visible_axis",name:"order_date",dataType:"datetime"}},invalidSource:{source:{kind:"semantic",datasetName:"orders"},field:{name:"order_date",label:"Order date",dataType:"date"},expected:{status:"unavailable",reason:"temporal_binding_invalid"}}};function R(t){return!!(t.name.trim()&&e.hasCompleteSemaphorSourceIdentity(t.source)&&(t.role==="date"||t.dataType==="date"||t.dataType==="datetime"))}function h(t){return t.filter((r,n)=>t.findIndex(l=>e.semaphorFieldRefsMatch(r.field,l.field))===n)}function g(t){return new Set(t.map(e.semaphorSourceIdentityKey).filter(Boolean)).size}function _(t){const r=h(t.candidates.filter(o=>o.kind==="visible_axis")),n=h(t.candidates.filter(o=>o.kind==="explicit_hidden"));if([...r,...n].some(o=>!R(o.field)))return"invalid";if(r.length>1||n.length>1)return"ambiguous";const l=r[0],d=n[0];if(l)return d&&!e.semaphorFieldRefsMatch(l.field,d.field)?"invalid":l;if(d)return d;if(g(t.querySources??[])>1)return"ambiguous";const S=h(t.candidates.filter(o=>o.kind==="semantic_primary"));return S.some(o=>!R(o.field))?"invalid":S.length>1?"ambiguous":S[0]??"missing"}function x(t){const r=new Date(t.startInclusive),n=new Date(t.endExclusive);return t.timezone.trim()?Number.isFinite(r.getTime())&&Number.isFinite(n.getTime())&&r.getTime()<n.getTime():!1}function v(t){const r=t.ranges??[];if(t.rawSql)return{status:"unavailable",reason:"unsupported_raw_sql",constraints:r};if((t.querySources??[]).some(m=>!e.hasCompleteSemaphorSourceIdentity(m))||r.some(m=>!R(m.field)))return{status:"unavailable",reason:"temporal_binding_invalid",constraints:r};const n=_(t);if(typeof n=="string")return{status:"unavailable",reason:`temporal_binding_${n}`,constraints:r};const l=r.filter(m=>e.semaphorFieldRefsMatch(m.field,n.field));if(l.some(m=>!x(m.window)))return{status:"unavailable",reason:"temporal_binding_invalid",constraints:r};const d=l.filter(m=>m.source==="global_date"),S=l.filter(m=>m.source==="card");if(d.length>1||d.length===0&&S.length>1)return{status:"unavailable",reason:"temporal_binding_ambiguous",constraints:r};const o=d[0]??S[0];return{status:"resolved",field:n.field,bindingSource:n.kind,...o?{currentWindow:o.window,governingWindowSource:o.source,governingRangeId:o.id}:{},constraints:r.filter(m=>m.id!==(o==null?void 0:o.id))}}exports.MATRIX_TOTAL_MEMBER_PLACEHOLDER=e.MATRIX_TOTAL_MEMBER_PLACEHOLDER;exports.MAX_OPTION_MATCH_VALUES=e.MAX_OPTION_MATCH_VALUES;exports.OVERRIDABLE_OPTION_DEPENDENCY_REASONS=e.OVERRIDABLE_OPTION_DEPENDENCY_REASONS;exports.RAW_TEMPORAL_CONTRACT_ERROR_CODES=e.RAW_TEMPORAL_CONTRACT_ERROR_CODES;exports.SEMAPHOR_GENERATED_COUNT_METRIC_ID=e.SEMAPHOR_GENERATED_COUNT_METRIC_ID;exports.SEMAPHOR_TIME_GRAINS=e.SEMAPHOR_TIME_GRAINS;exports.TEMPORAL_BUCKET_CONTRACT_ERROR_CODES=e.TEMPORAL_BUCKET_CONTRACT_ERROR_CODES;exports.TEMPORAL_BUCKET_PRESETS=e.TEMPORAL_BUCKET_PRESETS;exports.buildAnalyticsCatalogFieldSummary=e.buildAnalyticsCatalogFieldSummary;exports.canonicalDashboardRecordsPayloadSchema=e.canonicalDashboardRecordsPayloadSchema;exports.canonicalizeExactNumericText=e.canonicalizeExactNumericText;exports.canonicalizeSemaphorSourceIdentity=e.canonicalizeSemaphorSourceIdentity;exports.configSourceRefSchema=e.configSourceRefSchema;exports.createExactNumericValue=e.createExactNumericValue;exports.dashboardRecordsPayloadSchema=e.dashboardRecordsPayloadSchema;exports.decodeNumericResultValue=e.decodeNumericResultValue;exports.exactNumericValueSchema=e.exactNumericValueSchema;exports.getAnalyticsCatalogFieldCandidates=e.getAnalyticsCatalogFieldCandidates;exports.getAnalyticsCatalogFieldName=e.getAnalyticsCatalogFieldName;exports.getAnalyticsIntentId=e.getAnalyticsIntentId;exports.getAnalyticsNumericStorageKind=e.getAnalyticsNumericStorageKind;exports.getSemaphorDatasetEntityId=e.getSemaphorDatasetEntityId;exports.getSemaphorNonRedundantDatasetId=e.getSemaphorNonRedundantDatasetId;exports.hasCompleteSemaphorSourceIdentity=e.hasCompleteSemaphorSourceIdentity;exports.isAnalyticsCatalogDateField=e.isAnalyticsCatalogDateField;exports.isAnalyticsCatalogDimensionField=e.isAnalyticsCatalogDimensionField;exports.isAnalyticsCatalogMetricField=e.isAnalyticsCatalogMetricField;exports.isAnalyticsDateLikeDataType=e.isAnalyticsDateLikeDataType;exports.isAnalyticsMetricIdentifierField=e.isAnalyticsMetricIdentifierField;exports.isAnalyticsTechnicalIdentifierField=e.isAnalyticsTechnicalIdentifierField;exports.isExactNumericValue=e.isExactNumericValue;exports.isOverridableOptionDependencyReason=e.isOverridableOptionDependencyReason;exports.isSemaphorOptionMatchValue=e.isSemaphorOptionMatchValue;exports.isSemaphorTimeGrain=e.isSemaphorTimeGrain;exports.matrixAggregateSchema=e.matrixAggregateSchema;exports.matrixAnalyticalIntentSchema=e.matrixAnalyticalIntentSchema;exports.matrixAxisSchema=e.matrixAxisSchema;exports.matrixConfigSchema=e.matrixConfigSchema;exports.matrixCoordinateSchema=e.matrixCoordinateSchema;exports.matrixDefaultViewSchema=e.matrixDefaultViewSchema;exports.matrixDefinitionInputSchema=e.matrixDefinitionInputSchema;exports.matrixExpansionSchema=e.matrixExpansionSchema;exports.matrixExportRequestSchema=e.matrixExportRequestSchema;exports.matrixFieldSchema=e.matrixFieldSchema;exports.matrixFormattingRoleSchema=e.matrixFormattingRoleSchema;exports.matrixLevelSchema=e.matrixLevelSchema;exports.matrixMeasureSchema=e.matrixMeasureSchema;exports.matrixMemberSchema=e.matrixMemberSchema;exports.matrixPathKey=e.matrixPathKey;exports.matrixPathSchema=e.matrixPathSchema;exports.matrixPresentationSchema=e.matrixPresentationSchema;exports.matrixRankingSchema=e.matrixRankingSchema;exports.matrixSortKey=e.matrixSortKey;exports.matrixSortSchema=e.matrixSortSchema;exports.matrixSortTargetSchema=e.matrixSortTargetSchema;exports.matrixSpecSchema=e.matrixSpecSchema;exports.matrixTotalPresentationSchema=e.matrixTotalPresentationSchema;exports.matrixViewStateSchema=e.matrixViewStateSchema;exports.mergeSemaphorSourcesByIdentity=e.mergeSemaphorSourcesByIdentity;exports.normalizeAnalyticsCatalogDataType=e.normalizeAnalyticsCatalogDataType;exports.normalizeAnalyticsCatalogName=e.normalizeAnalyticsCatalogName;exports.normalizeNumericLiteral=e.normalizeNumericLiteral;exports.nullableScalarSchema=e.nullableScalarSchema;exports.parseOptionMatchValues=e.parseOptionMatchValues;exports.parseSemaphorIsoInstant=e.parseSemaphorIsoInstant;exports.parseSemaphorIsoTimeWindowBoundary=e.parseSemaphorIsoTimeWindowBoundary;exports.preferSemaphorFieldRefMetadata=e.preferSemaphorFieldRefMetadata;exports.preferSemaphorSourceMetadata=e.preferSemaphorSourceMetadata;exports.rawTemporalValueMetadataSchema=e.rawTemporalValueMetadataSchema;exports.recordArraySchema=e.recordArraySchema;exports.recordSchema=e.recordSchema;exports.semaphorAggregateFunctionSchema=e.semaphorAggregateFunctionSchema;exports.semaphorAnalyticsValidationIssueSchema=e.semaphorAnalyticsValidationIssueSchema;exports.semaphorAnalyticsValidationResultSchema=e.semaphorAnalyticsValidationResultSchema;exports.semaphorCompactFieldRefSchema=e.semaphorCompactFieldRefSchema;exports.semaphorDerivedFieldDefinitionObjectSchema=e.semaphorDerivedFieldDefinitionObjectSchema;exports.semaphorDerivedFieldDefinitionSchema=e.semaphorDerivedFieldDefinitionSchema;exports.semaphorExecutionFieldRefSchema=e.semaphorExecutionFieldRefSchema;exports.semaphorFieldRefObjectSchema=e.semaphorFieldRefObjectSchema;exports.semaphorFieldRefSchema=e.semaphorFieldRefSchema;exports.semaphorFieldRefsMatch=e.semaphorFieldRefsMatch;exports.semaphorInputOptionsResultSchema=e.semaphorInputOptionsResultSchema;exports.semaphorMetricAggregate=e.semaphorMetricAggregate;exports.semaphorMetricMeasureBindingKey=e.semaphorMetricMeasureBindingKey;exports.semaphorMetricResultSchema=e.semaphorMetricResultSchema;exports.semaphorOptionDependencyOutcomeSchema=e.semaphorOptionDependencyOutcomeSchema;exports.semaphorOptionMatchResultSchema=e.semaphorOptionMatchResultSchema;exports.semaphorPhysicalSourceRefSchema=e.semaphorPhysicalSourceRefSchema;exports.semaphorRecordsResultSchema=e.semaphorRecordsResultSchema;exports.semaphorResultColumnSchema=e.semaphorResultColumnSchema;exports.semaphorScalarValueFormatSchema=e.semaphorScalarValueFormatSchema;exports.semaphorScalarValueSchema=e.semaphorScalarValueSchema;exports.semaphorSemanticSourceRefSchema=e.semaphorSemanticSourceRefSchema;exports.semaphorSourceIdentityKey=e.semaphorSourceIdentityKey;exports.semaphorSourceRefSchema=e.semaphorSourceRefSchema;exports.semaphorSourcesReferToSameDataset=e.semaphorSourcesReferToSameDataset;exports.semaphorSqlResultSchema=e.semaphorSqlResultSchema;exports.semaphorSqlSourceRefSchema=e.semaphorSqlSourceRefSchema;exports.semaphorTimeGrainSchema=e.semaphorTimeGrainSchema;exports.temporalBucketDataTypeForGrain=e.temporalBucketDataTypeForGrain;exports.temporalBucketFormatSchema=e.temporalBucketFormatSchema;exports.temporalBucketMetadataSchema=e.temporalBucketMetadataSchema;exports.validateSemaphorAnalyticsIntent=e.validateSemaphorAnalyticsIntent;exports.validateSemaphorAnalyticsRecoveryPlan=e.validateSemaphorAnalyticsRecoveryPlan;exports.validateSemaphorDashboardIntent=e.validateSemaphorDashboardIntent;exports.validateSemaphorDerivedFieldDefinition=e.validateSemaphorDerivedFieldDefinition;exports.validateSemaphorOperationIntent=e.validateSemaphorOperationIntent;exports.validateSemaphorOptionDependencies=e.validateSemaphorOptionDependencies;exports.validateSemaphorResultCalculation=e.validateSemaphorResultCalculation;exports.normalizeSemaphorAnalyticsFilterOperator=C.normalizeSemaphorAnalyticsFilterOperator;exports.normalizeSemaphorInputOperator=C.normalizeSemaphorInputOperator;exports.toSemaphorInputOperatorFromFilterOperation=C.toSemaphorInputOperatorFromFilterOperation;exports.NATIVE_PREDICATE_OPERATIONS=c.NATIVE_PREDICATE_OPERATIONS;exports.compileSelectionFilterGroup=c.compileSelectionFilterGroup;exports.isMatrixPathExpanded=c.isMatrixPathExpanded;exports.isNullCheckPredicate=c.isNullCheckPredicate;exports.parseNativePredicateSemantics=c.parseNativePredicateSemantics;exports.projectNativePredicateSemantics=c.projectNativePredicateSemantics;exports.resolveMatrixMemberPresentation=c.resolveMatrixMemberPresentation;exports.selectionFilterGroupKey=c.selectionFilterGroupKey;exports.toNativePredicateSemantics=c.toNativePredicateSemantics;exports.MATRIX_WINDOW_LIMITS=a.MATRIX_WINDOW_LIMITS;exports.SELECTION_LIMIT=a.SELECTION_LIMIT;exports.SEMAPHOR_ANALYZE_RESULT_FIELD_CONTRACT=a.SEMAPHOR_ANALYZE_RESULT_FIELD_CONTRACT;exports.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION=a.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION;exports.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION=a.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION;exports.analyticsExecutionEnvelopeSchema=a.analyticsExecutionEnvelopeSchema;exports.analyticsSelectionConditionKey=a.analyticsSelectionConditionKey;exports.analyticsSelectionConditionSchema=a.analyticsSelectionConditionSchema;exports.analyticsSelectionSchema=a.analyticsSelectionSchema;exports.analyticsSelectionTupleKey=a.analyticsSelectionTupleKey;exports.analyticsSelectionTupleSchema=a.analyticsSelectionTupleSchema;exports.canonicalizeAnalyticsSelections=a.canonicalizeAnalyticsSelections;exports.getSemaphorAnalyzeResultFieldNames=a.getSemaphorAnalyzeResultFieldNames;exports.isSelectionInputId=a.isSelectionInputId;exports.isSemaphorAnalyzeResultFieldName=a.isSemaphorAnalyzeResultFieldName;exports.isSemaphorDataAppCodegenSummary=a.isSemaphorDataAppCodegenSummary;exports.matrixAxisPageSchema=a.matrixAxisPageSchema;exports.matrixBlockRequestSchema=a.matrixBlockRequestSchema;exports.matrixCapabilitiesSchema=a.matrixCapabilitiesSchema;exports.matrixCellBlockSchema=a.matrixCellBlockSchema;exports.matrixDescriptorSchema=a.matrixDescriptorSchema;exports.matrixExecutionResultSchema=a.matrixExecutionResultSchema;exports.matrixExportBatchSchema=a.matrixExportBatchSchema;exports.matrixExportColumnSchema=a.matrixExportColumnSchema;exports.matrixExportLayoutSchema=a.matrixExportLayoutSchema;exports.matrixExportRowSchema=a.matrixExportRowSchema;exports.matrixExportValueSchema=a.matrixExportValueSchema;exports.matrixFailureSchema=a.matrixFailureSchema;exports.matrixOperationRequestSchema=a.matrixOperationRequestSchema;exports.matrixPageRequestSchema=a.matrixPageRequestSchema;exports.matrixPathSelectionSchema=a.matrixPathSelectionSchema;exports.matrixResultSchema=a.matrixResultSchema;exports.matrixRuntimeInputsSchema=a.matrixRuntimeInputsSchema;exports.matrixWindowInputSchema=a.matrixWindowInputSchema;exports.matrixWindowOutcomeSchema=a.matrixWindowOutcomeSchema;exports.matrixWindowRequestSchema=a.matrixWindowRequestSchema;exports.matrixWindowSchema=a.matrixWindowSchema;exports.parseMatrixRuntimeInputs=a.parseMatrixRuntimeInputs;exports.parseSemaphorAnalyzeResult=a.parseSemaphorAnalyzeResult;exports.sameSelectionTuple=a.sameSelectionTuple;exports.selectionConditionKey=a.selectionConditionKey;exports.selectionConditionSchema=a.selectionConditionSchema;exports.selectionFieldKey=a.selectionFieldKey;exports.selectionFieldSchema=a.selectionFieldSchema;exports.selectionInputId=a.selectionInputId;exports.selectionInputValueSchema=a.selectionInputValueSchema;exports.selectionTupleKey=a.selectionTupleKey;exports.selectionTupleLabel=a.selectionTupleLabel;exports.selectionTupleSchema=a.selectionTupleSchema;exports.semaphorAnalyticsCoverageSchema=a.semaphorAnalyticsCoverageSchema;exports.semaphorAnalyticsDiagnosticFeedbackSchema=a.semaphorAnalyticsDiagnosticFeedbackSchema;exports.semaphorAnalyticsExecutionResultSchema=a.semaphorAnalyticsExecutionResultSchema;exports.semaphorAnalyticsPopulationSchema=a.semaphorAnalyticsPopulationSchema;exports.semaphorAnalyticsResultSchema=a.semaphorAnalyticsResultSchema;exports.semaphorAnalyzeResultSchema=a.semaphorAnalyzeResultSchema;exports.semaphorAnalyzeResultShape=a.semaphorAnalyzeResultShape;exports.semaphorDataAppCodegenSummarySchema=a.semaphorDataAppCodegenSummarySchema;exports.semaphorMatrixResultSchema=a.matrixResultSchema;exports.semaphorRelationshipDiagnosticsSchema=a.semaphorRelationshipDiagnosticsSchema;exports.sourceCardIdFromSelectionInputId=a.sourceCardIdFromSelectionInputId;exports.temporalBucketIdentityKey=a.temporalBucketIdentityKey;exports.validateSemaphorDataAppCodegenSummary=a.validateSemaphorDataAppCodegenSummary;exports.buildSemaphorQualifiedSourcePath=i.buildSemaphorQualifiedSourcePath;exports.canonicalizeSemaphorQualifiedSourcePath=i.canonicalizeSemaphorQualifiedSourcePath;exports.getSemaphorCatalogCoordinateLevels=i.getSemaphorCatalogCoordinateLevels;exports.getSemaphorConnectionCapabilities=i.getSemaphorConnectionCapabilities;exports.isSemaphorPhysicalSourceEntity=i.isSemaphorPhysicalSourceEntity;exports.isSemaphorSemanticSourceEntity=i.isSemaphorSemanticSourceEntity;exports.normalizeSemaphorDialect=i.normalizeSemaphorDialect;exports.parseSemaphorQualifiedSourcePath=i.parseSemaphorQualifiedSourcePath;exports.persistedIdentifierLeafName=i.persistedIdentifierLeafName;exports.resolveSemaphorConnectionCapabilities=i.resolveSemaphorConnectionCapabilities;exports.resolveSemaphorConnectionCapabilityIdentity=i.resolveSemaphorConnectionCapabilityIdentity;exports.resolveSemaphorPhysicalCatalogAddress=i.resolveSemaphorPhysicalCatalogAddress;exports.resolveSemaphorPhysicalSourceEntity=i.resolveSemaphorPhysicalSourceEntity;exports.resolveSemaphorSemanticDatasetEntity=i.resolveSemaphorSemanticDatasetEntity;exports.resolveSemaphorSourceEntity=i.resolveSemaphorSourceEntity;exports.semaphorPhysicalSourceCoordinatesAreCompatible=i.semaphorPhysicalSourceCoordinatesAreCompatible;exports.semaphorPhysicalSourceCoordinatesCover=i.semaphorPhysicalSourceCoordinatesCover;exports.semaphorSourceHasRequiredCoordinates=i.semaphorSourceHasRequiredCoordinates;exports.COMPARISON_PRESENTATION_DEFAULTS=s.COMPARISON_PRESENTATION_DEFAULTS;exports.DEFAULT_METRIC_COMPARISON_POLARITY=s.DEFAULT_METRIC_COMPARISON_POLARITY;exports.evaluateMetricComparison=s.evaluateMetricComparison;exports.resolveMetricComparisonRequest=s.resolveMetricComparisonRequest;exports.resolveMetricResultAlias=s.resolveMetricResultAlias;exports.validateComparisonPresentationSpec=s.validateComparisonPresentationSpec;exports.validateGlobalDateComparisonContext=s.validateGlobalDateComparisonContext;exports.validateGlobalDateComparisonSelection=s.validateGlobalDateComparisonSelection;exports.validateMetricComparisonConfig=s.validateMetricComparisonConfig;exports.validateMetricComparisonPolarity=s.validateMetricComparisonPolarity;exports.validateMetricComparisonSpec=s.validateMetricComparisonSpec;exports.getCardControlCompatInputId=p.getCardControlCompatInputId;exports.getCardInlineFilterCompatInputId=p.getCardInlineFilterCompatInputId;exports.getDashboardControlCompatInputId=p.getDashboardControlCompatInputId;exports.getDashboardFilterCompatInputId=p.getDashboardFilterCompatInputId;exports.isComparisonCapableDashboardDateInputDefinition=p.isComparisonCapableDashboardDateInputDefinition;exports.resolveDashboardDateComparisonFilterDefinition=p.resolveDashboardDateComparisonFilterDefinition;exports.resolveDashboardDateComparisonInputDefinition=p.resolveDashboardDateComparisonInputDefinition;exports.semanticDatasetMatchesFieldCoordinates=p.semanticDatasetMatchesFieldCoordinates;exports.validateActivatedTemporalBucketResultColumns=y.validateActivatedTemporalBucketResultColumns;exports.validateTemporalBucketMetadata=y.validateTemporalBucketMetadata;exports.validateTemporalBucketResultColumn=y.validateTemporalBucketResultColumn;exports.RawTemporalMetadataContractError=A.RawTemporalMetadataContractError;exports.parseRawTemporalValueMetadata=A.parseRawTemporalValueMetadata;exports.validateRawTemporalResultColumn=A.validateRawTemporalResultColumn;exports.getMatrixAnalyticalDefinition=T.getMatrixAnalyticalDefinition;exports.SEMAPHOR_ANALYTICS_INTENT_FIXTURES=I;exports.TEMPORAL_CONTEXT_ADAPTER_PARITY_FIXTURES=E;exports.resolveTemporalContext=v;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-Cx3qmRUB.cjs");exports.APPEARANCE_SPEC_VERSION=e.APPEARANCE_SPEC_VERSION;exports.assertValidAppearanceSpec=e.assertValidAppearanceSpec;exports.mergeAppearanceSpecs=e.mergeAppearanceSpecs;exports.normalizeAppearanceSpec=e.normalizeAppearanceSpec;exports.resolveAppearance=e.resolveAppearance;exports.validateAppearanceSpec=e.validateAppearanceSpec;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/appearance-runtime-provider-D5pkvgE4.cjs");exports.AppearanceRuntimeProvider=e.AppearanceRuntimeProvider;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("react"),d=require("../chunks/switch-C0520nRt.cjs"),oe=require("../chunks/color-CyB5o13F.cjs"),L=require("../chunks/x-B6ghREd2.cjs");require("../chunks/card-config-utils-z86y6tSq.cjs");require("../chunks/validators-DFeDcdpA.cjs");require("../chunks/matrix-operation-contract-0RxoU_M3.cjs");require("../value-format-preferences/index.cjs");const X=require("../chunks/index-Cx3qmRUB.cjs"),_=require("../chunks/palette-BN-jYtaK.cjs"),fe=require("../chunks/braces-v55uLCAK.cjs"),me=require("../chunks/save-3dYRmehL.cjs"),xe=require("../chunks/layout-grid-xm8pqtx0.cjs");/**
|
|
2
|
-
* @license lucide-react v0.453.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const he=L.createLucideIcon("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
|
|
7
|
-
* @license lucide-react v0.453.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const je=L.createLucideIcon("Clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]);/**
|
|
12
|
-
* @license lucide-react v0.453.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const ke=L.createLucideIcon("Pipette",[["path",{d:"m2 22 1-1h3l9-9",key:"1sre89"}],["path",{d:"M3 21v-3l9-9",key:"hpe2y6"}],["path",{d:"m15 6 3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3l.4.4Z",key:"196du1"}]]),Y=[{id:"semaphor",name:"Semaphor",description:"Dense neutral system defaults for embedded analytics.",primary:"#18181b",accent:"#f4f4f5",light:{background:"#ffffff",foreground:"#18181b",muted:"#fafafa",mutedForeground:"#71717a",border:"#e4e4e7",primary:"#18181b",primaryForeground:"#ffffff",accent:"#f4f4f5",accentForeground:"#18181b",selection:"#2563eb",card:"#ffffff",cardForeground:"#18181b",chartPalette:["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#06b6d4"]},dark:{background:"#09090b",foreground:"#fafafa",muted:"#18181b",mutedForeground:"#a1a1aa",border:"#27272a",primary:"#fafafa",primaryForeground:"#09090b",accent:"#27272a",accentForeground:"#fafafa",selection:"#5090f7",card:"#09090b",cardForeground:"#fafafa",chartPalette:["#60a5fa","#34d399","#fbbf24","#f87171","#a78bfa","#22d3ee"]}},{id:"atlas-blue",name:"Atlas Blue",description:"Crisp enterprise blue with restrained neutral surfaces.",primary:"#2563eb",accent:"#dbeafe",light:{background:"#f8fafc",foreground:"#0f172a",muted:"#f1f5f9",mutedForeground:"#64748b",border:"#cbd5e1",primary:"#2563eb",primaryForeground:"#ffffff",accent:"#dbeafe",accentForeground:"#1e3a8a",selection:"#2563eb",card:"#ffffff",cardForeground:"#0f172a",chartPalette:["#2563eb","#0f766e","#ca8a04","#dc2626","#7c3aed","#0891b2"]},dark:{background:"#020617",foreground:"#e2e8f0",muted:"#0f172a",mutedForeground:"#94a3b8",border:"#1e293b",primary:"#60a5fa",primaryForeground:"#020617",accent:"#1e3a8a",accentForeground:"#dbeafe",selection:"#60a5fa",card:"#0f172a",cardForeground:"#e2e8f0",chartPalette:["#60a5fa","#2dd4bf","#facc15","#f87171","#a78bfa","#22d3ee"]}},{id:"field-green",name:"Field Green",description:"Operational green accents with quiet, readable canvases.",primary:"#047857",accent:"#d1fae5",light:{background:"#fbfdfb",foreground:"#10231d",muted:"#f1f5f3",mutedForeground:"#64746d",border:"#d7ded9",primary:"#047857",primaryForeground:"#ffffff",accent:"#d1fae5",accentForeground:"#064e3b",selection:"#047857",card:"#ffffff",cardForeground:"#10231d",chartPalette:["#047857","#2563eb","#d97706","#dc2626","#7c3aed","#0891b2"]},dark:{background:"#071511",foreground:"#e7f4ef",muted:"#10231d",mutedForeground:"#92aaa1",border:"#244139",primary:"#34d399",primaryForeground:"#071511",accent:"#064e3b",accentForeground:"#d1fae5",selection:"#34d399",card:"#0b1d17",cardForeground:"#e7f4ef",chartPalette:["#34d399","#60a5fa","#fbbf24","#f87171","#a78bfa","#22d3ee"]}}];function O(r){const n=X.resolveAppearance({organizationAppearance:r??void 0});return ye(ve(P(n)))}function ye(r){for(const n of Object.values(r.schemes))for(const t of[n.components.table,n.components.aggregateTable,n.components.pivotTable]){const i=t==null?void 0:t.row;i!=null&&i.selectedBackground&&i.selectedBackground===i.hoverBackground&&delete i.selectedBackground}return r}function E(r){const n=P({version:X.APPEARANCE_SPEC_VERSION,mode:r.mode,schemes:r.schemes}),t=X.validateAppearanceSpec(n);if(!t.success){const i=t.issues[0];throw new Error(`Invalid Brand Studio appearance at ${i.path}: ${i.message}`)}return t.value}function ae(r,n){const t=Y.find(c=>c.id===n);if(!t)return r;const i=P(r);return re(i.schemes.light,t.light),re(i.schemes.dark,t.dark),i}function re(r,n){r.tokens.color.background=n.background,r.tokens.color.foreground=n.foreground,r.tokens.color.muted=n.muted,r.tokens.color.mutedForeground=n.mutedForeground,r.tokens.color.border=n.border,r.tokens.color.input=n.border,r.tokens.color.primary=n.primary,r.tokens.color.primaryForeground=n.primaryForeground,r.tokens.color.accent=n.accent,r.tokens.color.accentForeground=n.accentForeground,r.tokens.color.selection=n.selection,r.tokens.color.card=n.card,r.tokens.color.cardForeground=n.cardForeground,r.components.dashboard.background=n.background,r.components.dashboard.foreground=n.foreground,r.components.dashboard.borderColor=n.border,r.components.card.background=n.card,r.components.card.foreground=n.cardForeground,r.components.card.borderColor=n.border,r.components.interactive.toolbarBackground=n.background,r.components.interactive.background=n.card,r.components.interactive.foreground=n.foreground,r.components.interactive.borderColor=n.border,r.components.chart.palette=[...n.chartPalette],r.components.chart.background=n.card,r.components.chart.foreground=n.foreground,r.components.chart.gridColor=n.border,r.components.chart.axisColor=n.mutedForeground,r.components.table.container.background=n.card,r.components.table.container.borderColor=n.border,r.components.table.header.background=n.muted,r.components.table.header.foreground=n.mutedForeground,r.components.table.header.dividerColor=n.border,r.components.table.row.dividerColor=n.border,r.components.table.row.zebraBackground=n.muted,r.components.table.pagination.background=n.card,r.components.table.pagination.foreground=n.foreground,r.components.table.pagination.borderColor=n.border,l(r,"aggregateTable"),l(r,"pivotTable")}function l(r,n){r.components[n]=P(r.components.table)}function V(r,n,t){switch(r.tokens.color[n]=t,n){case"background":r.components.dashboard.background=t,r.components.interactive.toolbarBackground=t;break;case"foreground":r.components.dashboard.foreground=t,r.components.interactive.foreground=t,r.components.pagination.foreground=t,r.components.chart.foreground=t,r.components.table.pagination.foreground=t,r.components.table.subtotal.foreground=t,r.components.table.grandTotal.foreground=t,l(r,"aggregateTable"),l(r,"pivotTable");break;case"card":r.components.card.background=t,r.components.interactive.background=t,r.components.pagination.background=t,r.components.chart.background=t,r.components.table.container.background=t,r.components.table.pagination.background=t,l(r,"aggregateTable"),l(r,"pivotTable");break;case"cardForeground":r.components.card.foreground=t;break;case"muted":r.components.table.header.background=t,r.components.table.row.zebraBackground=t,r.components.table.subtotal.background=t,r.components.table.grandTotal.background=t,l(r,"aggregateTable"),l(r,"pivotTable");break;case"mutedForeground":r.components.table.header.foreground=t,r.components.chart.axisColor=t,l(r,"aggregateTable"),l(r,"pivotTable");break;case"border":r.tokens.color.input=t,r.components.dashboard.borderColor=t,r.components.card.borderColor=t,r.components.interactive.borderColor=t,r.components.pagination.borderColor=t,r.components.chart.gridColor=t,r.components.table.container.borderColor=t,r.components.table.header.dividerColor=t,r.components.table.row.dividerColor=t,r.components.table.grandTotal.borderColor=t,r.components.table.pagination.borderColor=t,l(r,"aggregateTable"),l(r,"pivotTable");break;case"accent":r.components.table.row.hoverBackground=t,l(r,"aggregateTable"),l(r,"pivotTable");break}}function U(r,n,t){switch(r.tokens.radius[n]=t,n){case"control":r.components.interactive.borderRadius=t,r.components.pagination.borderRadius=t;break;case"card":r.components.card.borderRadius=t;break;case"table":r.components.table.container.borderRadius=t,l(r,"aggregateTable"),l(r,"pivotTable");break}}function ve(r){var n,t;for(const i of["light","dark"]){const c=r.schemes[i],u=c.tokens,s=u.color,y=(n=c.components)==null?void 0:n.aggregateTable,j=(t=c.components)==null?void 0:t.pivotTable,N={fontFamily:"",headingFontFamily:"",monoFontFamily:"",baseFontSize:14,density:"comfortable"};u.typography={...N,...u.typography};const f={control:5,card:5,table:5,badge:999};u.radius={...f,...u.radius};const b={dashboardPadding:16,gridGap:12,cardPadding:16,controlGap:8,tableCellX:12,tableCellY:8};u.spacing={...b,...u.spacing};const T={card:"none",popover:"0 12px 32px rgba(15, 23, 42, 0.14)",focusRing:"0 0 0 2px rgba(37, 99, 235, 0.35)"};u.shadow={...T,...u.shadow};const S={dashboard:{background:s.background,foreground:s.foreground,borderColor:s.border,padding:u.spacing.dashboardPadding},card:{background:s.card,foreground:s.cardForeground,borderColor:s.border,borderRadius:u.radius.card,padding:u.spacing.cardPadding,shadow:u.shadow.card},interactive:{toolbarBackground:s.background,background:s.card,foreground:s.foreground,borderColor:s.border,borderRadius:u.radius.control},chart:{palette:[],background:s.card,foreground:s.foreground,gridColor:s.border,axisColor:s.mutedForeground},table:F(s,u),aggregateTable:F(s,u),pivotTable:F(s,u),pagination:{background:s.card,foreground:s.foreground,borderColor:s.border,borderRadius:u.radius.control}};c.components={...S,...c.components};const J={palette:[],background:s.card,foreground:s.foreground,gridColor:s.border,axisColor:s.mutedForeground};c.components.chart={...J,...c.components.chart},c.components.table={...F(s,u),...c.components.table},c.components.aggregateTable=y?{...F(s,u),...y}:P(c.components.table),c.components.pivotTable=j?{...F(s,u),...j}:P(c.components.table)}return r}function F(r,n){return{density:n.typography.density,container:{background:r.card,borderColor:r.border,borderRadius:n.radius.table,shadow:n.shadow.card},header:{background:r.muted,foreground:r.mutedForeground,dividerColor:r.border,fontWeight:600,uppercase:!0,sticky:!0},row:{height:32,dividerColor:r.border,zebra:!1,zebraBackground:r.muted,hoverBackground:r.accent},cell:{paddingX:n.spacing.tableCellX,paddingY:n.spacing.tableCellY,verticalAlign:"middle",wrap:"nowrap"},subtotal:{background:r.muted,foreground:r.foreground,fontWeight:600},grandTotal:{background:r.muted,foreground:r.foreground,fontWeight:700,borderColor:r.border},pagination:{background:r.card,foreground:r.foreground,borderColor:r.border}}}function P(r){return JSON.parse(JSON.stringify(r))}const Ce=[["background","Canvas"],["foreground","Text"],["card","Card"],["cardForeground","Card text"],["primary","Primary"],["primaryForeground","Primary text"],["accent","Accent"],["accentForeground","Accent text"],["muted","Muted"],["mutedForeground","Muted text"],["border","Border"],["positive","Positive"],["negative","Negative"],["warning","Warning"],["info","Info"]],Ne=[0,1,2,3,4,5],M=oe.APPEARANCE_FONT_PRESETS,Te=["#ffffff","#f8fafc","#f4f4f5","#e4e4e7","#18181b","#09090b","#2563eb","#0f766e","#047857","#d97706","#dc2626","#7c3aed"];function Se({appearance:r,previewTitle:n,isLoading:t=!1,isSaving:i=!1,error:c=null,className:u,onDraftChange:s,onSave:y,onClearConfig:j,onCancel:N}){const[f,b]=m.useState(null),[T,S]=m.useState("light"),[J,A]=m.useState(!1),[ne,B]=m.useState("idle"),[Z,te]=m.useState(!1),[z,$]=m.useState(""),[D,x]=m.useState(null),K=m.useRef(null),I=m.useRef(s),R=m.useRef(!1);m.useEffect(()=>{I.current=s},[s]),m.useEffect(()=>{if(r===void 0){R.current=!0,b(null);return}const o=O(r);R.current=!0,b(o),S("light"),x(null)},[r]),m.useEffect(()=>{var o;if(f){if(R.current){R.current=!1;return}try{const a=E(f);(o=I.current)==null||o.call(I,a),x(null)}catch(a){x(a instanceof Error?a.message:"Appearance is invalid")}}},[f]);const p=f==null?void 0:f.schemes[T],q=i||J,de=m.useMemo(()=>p?Pe(p.tokens.radius.control):void 0,[p]),se=o=>{b(a=>{if(!a)return a;const h=Be(a);return o(h),h})},g=o=>{se(a=>{o(a.schemes[T])})},ie=async()=>{if(!f||!y)return;let o;try{o=E(f)}catch(a){x(a instanceof Error?a.message:"Appearance is invalid");return}A(!0);try{await y(o)}finally{A(!1)}},ce=()=>{const o=O(null);B("idle"),b(o)},le=async()=>{if(j){A(!0),x(null),B("idle");try{await j(),R.current=!0,b(O(null)),S("light")}catch(o){x(o instanceof Error?o.message:"Unable to clear organization appearance")}finally{A(!1)}}},Q=m.useCallback(()=>f?JSON.stringify(E(f),null,2):"",[f]),ue=o=>{if(te(o),o)try{$(Q()),x(null)}catch(a){x(a instanceof Error?a.message:"Appearance is invalid")}},pe=async()=>{if(f)try{const o=Z&&z?z:Q();await navigator.clipboard.writeText(o),x(null),B("copied")}catch(o){x(o instanceof Error?o.message:"Unable to copy brand spec")}},ee=o=>{const a=JSON.parse(o),h=O(a),w=E(h);B("idle"),S("light"),b(h),$(JSON.stringify(w,null,2))},ge=()=>{try{ee(z)}catch(o){x(o instanceof Error?o.message:"Brand spec must be valid JSON")}},be=async o=>{var h;const a=(h=o.target.files)==null?void 0:h[0];if(o.target.value="",!!a)try{ee(await Re(a))}catch(w){x(w instanceof Error?w.message:"Uploaded file must be a valid brand spec")}};return e.jsxs("div",{className:d.cn("flex min-h-0 flex-1 flex-col bg-background text-foreground",u),style:de,children:[e.jsxs("header",{className:"flex h-11 shrink-0 items-start gap-3 border-b border-border/60 px-4 pt-2",children:[e.jsx("div",{className:"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-control border border-border/70",children:e.jsx(_.Palette,{className:"h-3.5 w-3.5"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:"truncate text-[13px] font-semibold leading-tight",children:"Brand Studio"}),e.jsxs("p",{className:"truncate text-[11px] leading-tight text-muted-foreground",children:["Previewing ",n||"current dashboard"]})]}),e.jsxs(d.Popover,{open:Z,onOpenChange:ue,children:[e.jsx(d.PopoverTrigger,{asChild:!0,children:e.jsxs(d.Button,{type:"button",size:"xs",variant:"ghost",disabled:!f,children:[e.jsx(fe.Braces,{className:"h-3.5 w-3.5"}),"Brand Spec"]})}),e.jsxs(d.PopoverContent,{align:"end",sideOffset:6,className:"z-[60] w-[min(520px,calc(100vw-24px))] rounded-control p-2",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[12px] font-medium",children:"Brand spec"}),e.jsx("div",{className:"text-[11px] text-muted-foreground",children:"Edit, apply, copy, or upload your brand spec."})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[e.jsxs(d.Button,{type:"button",size:"xs",variant:"ghost",onClick:pe,children:[e.jsx(je,{className:"h-3.5 w-3.5"}),ne==="copied"?"Copied":"Copy"]}),e.jsxs(d.Button,{type:"button",size:"xs",variant:"ghost",onClick:()=>{var o;return(o=K.current)==null?void 0:o.click()},children:[e.jsx(d.Upload,{className:"h-3.5 w-3.5"}),"Upload"]}),e.jsx(d.Button,{type:"button",size:"xs",onClick:ge,children:"Apply"})]})]}),e.jsx("div",{className:"h-[320px] overflow-hidden rounded-control border border-input",children:e.jsx(d.CodeEditor,{ariaLabel:"Brand spec",value:z,onValueChange:o=>{$(o),B("idle")},language:"json",embedded:!0,hideLineNumbers:!0,dense:!0})})]})]}),e.jsx("input",{ref:K,"aria-label":"Upload brand spec",type:"file",accept:"application/json,.json",className:"sr-only",onChange:be}),e.jsxs(d.Button,{type:"button",size:"xs",variant:"ghost",onClick:ce,disabled:!f,children:[e.jsx(d.RotateCcw,{className:"h-3.5 w-3.5"}),"Reset"]}),j&&e.jsxs(d.Button,{type:"button",size:"xs",variant:"ghost",onClick:le,disabled:q,children:[e.jsx(he,{className:"h-3.5 w-3.5"}),"No config"]}),e.jsxs(d.Button,{type:"button",size:"xs",onClick:ie,disabled:!f||q||!!D||!y,children:[q?e.jsx(d.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(me.Save,{className:"h-3.5 w-3.5"}),"Save"]}),N&&e.jsx("button",{type:"button","aria-label":"Close Brand Studio",className:"flex h-7 w-7 items-center justify-center rounded-control text-muted-foreground hover:bg-muted hover:text-foreground",onClick:N,children:e.jsx(L.X,{className:"h-3.5 w-3.5"})})]}),e.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border/60 px-4 py-2",children:[e.jsx("div",{className:"flex items-center gap-2 text-[12px] text-muted-foreground",children:D?e.jsxs(e.Fragment,{children:[e.jsx(d.SlidersHorizontal,{className:"h-3.5 w-3.5 text-destructive"}),"Preview keeps the last valid draft"]}):e.jsxs(e.Fragment,{children:[e.jsx(d.Check,{className:"h-3.5 w-3.5 text-emerald-500"}),"Draft is applied to the live dashboard preview"]})}),e.jsx("div",{className:"inline-flex h-7 items-center overflow-hidden rounded-control border border-border/70",children:["light","dark"].map(o=>e.jsx("button",{type:"button",className:d.cn("h-full px-2.5 text-[12px] capitalize transition-colors",T===o?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>S(o),children:o},o))})]}),D&&e.jsx("div",{className:"border-b border-destructive/20 bg-destructive/5 px-4 py-2 text-[12px] text-destructive",children:D}),t?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsx(d.LoaderCircle,{className:"h-4 w-4 animate-spin text-muted-foreground"})}):c?e.jsx("div",{className:"p-4 text-[13px] text-muted-foreground",children:c}):f&&p?e.jsxs(d.Tabs,{defaultValue:"style",className:"flex min-h-0 flex-1 flex-col",children:[e.jsx("div",{className:"shrink-0 px-4 pt-3",children:e.jsxs(d.TabsList,{variant:"underline",className:"w-full gap-5",children:[e.jsx(d.TabsTrigger,{value:"style",children:"Style"}),e.jsx(d.TabsTrigger,{value:"surfaces",children:"Surfaces"}),e.jsx(d.TabsTrigger,{value:"data",children:"Data"})]})}),e.jsxs(d.ScrollArea,{className:"min-h-0 flex-1",children:[e.jsxs(d.TabsContent,{value:"style",className:"m-0 p-4",children:[e.jsx(v,{icon:_.Palette,title:"Presets",description:"Start from a full light and dark appearance.",children:e.jsx("div",{className:"grid grid-cols-1 gap-2",children:Y.map(o=>e.jsxs("button",{type:"button",className:"flex items-center gap-3 rounded-control border border-border/70 px-3 py-2 text-left hover:bg-muted/60",onClick:()=>{const a=ae(f,o.id);b(a)},children:[e.jsxs("div",{className:"flex h-7 w-10 overflow-hidden rounded-control border border-border/70",children:[e.jsx("span",{className:"h-full flex-1",style:{backgroundColor:o.primary}}),e.jsx("span",{className:"h-full flex-1",style:{backgroundColor:o.accent}})]}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block text-[13px] font-medium",children:o.name}),e.jsx("span",{className:"block truncate text-[12px] text-muted-foreground",children:o.description})]})]},o.id))})}),e.jsx(v,{icon:_.Palette,title:"Color",description:`Editing the ${T} scheme.`,children:e.jsx("div",{className:"grid grid-cols-2 gap-2",children:Ce.map(([o,a])=>e.jsx(k,{label:a,value:p.tokens.color[o],onChange:h=>g(w=>{V(w,o,h)})},o))})}),e.jsxs(v,{icon:d.Type,title:"Typography",description:"Fonts and density used by dashboard and workflow chrome.",children:[e.jsx(we,{value:p.tokens.typography.fontFamily,onChange:o=>g(a=>{a.tokens.typography.fontFamily=o,a.tokens.typography.headingFontFamily=o})}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(C,{label:"Base size",value:p.tokens.typography.baseFontSize,min:11,max:18,onChange:o=>g(a=>{a.tokens.typography.baseFontSize=o})}),e.jsx(H,{label:"Density",value:p.tokens.typography.density,options:[["compact","Compact"],["comfortable","Comfortable"],["spacious","Spacious"]],onChange:o=>g(a=>{a.tokens.typography.density=o,a.components.table.density=a.tokens.typography.density,l(a,"aggregateTable"),l(a,"pivotTable")})})]})]})]}),e.jsxs(d.TabsContent,{value:"surfaces",className:"m-0 p-4",children:[e.jsxs(v,{icon:xe.LayoutGrid,title:"Layout",description:"Canvas, grid, and card rhythm for embedded dashboards.",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsx(C,{label:"Canvas pad",tooltip:"Outer padding around the dashboard canvas before cards begin.",value:p.tokens.spacing.dashboardPadding,min:0,max:48,onChange:o=>g(a=>{a.tokens.spacing.dashboardPadding=o,a.components.dashboard.padding=o})}),e.jsx(C,{label:"Grid gap",tooltip:"Spacing between dashboard cards in the grid.",value:p.tokens.spacing.gridGap,min:0,max:32,onChange:o=>g(a=>{a.tokens.spacing.gridGap=o})}),e.jsx(C,{label:"Card pad",tooltip:"Inner padding inside card/widget frames around titles, controls, and visual content.",value:p.tokens.spacing.cardPadding,min:0,max:32,onChange:o=>g(a=>{a.tokens.spacing.cardPadding=o,a.components.card.padding=o})})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsx(C,{label:"Control radius",tooltip:"Corner radius for buttons, inputs, selects, checkboxes, segmented controls, and similar interactive controls.",value:p.tokens.radius.control,min:0,max:12,onChange:o=>g(a=>{U(a,"control",o)})}),e.jsx(C,{label:"Card/widget radius",tooltip:"Corner radius for dashboard card frames and widget containers.",value:p.tokens.radius.card,min:0,max:12,onChange:o=>g(a=>{U(a,"card",o)})}),e.jsx(C,{label:"Table radius",tooltip:"Corner radius for table containers, table chrome, and table pagination surfaces.",value:p.tokens.radius.table,min:0,max:12,onChange:o=>g(a=>{U(a,"table",o)})})]})]}),e.jsx(v,{icon:d.SlidersHorizontal,title:"Filters and Controls",description:"Dashboard filter/control toolbar, chip states, menus, and settings panels.",children:e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(k,{label:"Toolbar background",tooltip:"Background color for the dashboard filter/control toolbar strip. This is separate from chip state colors.",value:p.components.interactive.toolbarBackground||p.tokens.color.background,onChange:o=>g(a=>{a.components.interactive.toolbarBackground=o})}),e.jsx(k,{label:"Default state",tooltip:"Unselected filter/control chips plus the base surface for their menus, dialogs, and pagination fallback.",value:p.components.interactive.background||p.tokens.color.card,onChange:o=>g(a=>{a.components.interactive.background=o,a.components.pagination.background=o})}),e.jsx(k,{label:"Border",tooltip:"Border color for filter/control chips, runtime inputs, settings panels, and related popover chrome.",value:p.components.interactive.borderColor||p.tokens.color.border,onChange:o=>g(a=>{a.components.interactive.borderColor=o,a.components.pagination.borderColor=o})}),e.jsx(k,{label:"Selected state",tooltip:"Selected filter/control chips and hover feedback. This keeps a lighter default state and a stronger selected state.",value:p.tokens.color.accent,onChange:o=>g(a=>{V(a,"accent",o)})})]})})]}),e.jsxs(d.TabsContent,{value:"data",className:"m-0 p-4",children:[e.jsxs(v,{icon:d.ChartColumn,title:"Charts",description:"Palette and semantic chart text/grid colors.",children:[e.jsx("div",{className:"grid grid-cols-3 gap-2",children:Ne.map(o=>e.jsx(k,{label:`Series ${o+1}`,value:p.components.chart.palette[o]||"#000000",onChange:a=>g(h=>{h.components.chart.palette[o]=a})},o))}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(k,{label:"Grid",value:p.components.chart.gridColor,onChange:o=>g(a=>{a.components.chart.gridColor=o})}),e.jsx(k,{label:"Axis",value:p.components.chart.axisColor,onChange:o=>g(a=>{a.components.chart.axisColor=o})})]})]}),e.jsxs(v,{icon:d.Table2,title:"Tables",description:"Flat, aggregate, and pivot tables share this V1 table appearance.",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(H,{label:"Density",value:p.components.table.density,options:[["compact","Compact"],["comfortable","Comfortable"],["spacious","Spacious"]],onChange:o=>g(a=>{a.components.table.density=o,l(a,"aggregateTable"),l(a,"pivotTable")})}),e.jsx(H,{label:"Cell wrap",value:p.components.table.cell.wrap,options:[["nowrap","No wrap"],["wrap","Wrap"]],onChange:o=>g(a=>{a.components.table.cell.wrap=o,l(a,"aggregateTable"),l(a,"pivotTable")})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(k,{label:"Header",value:p.components.table.header.background,onChange:o=>g(a=>{a.components.table.header.background=o,l(a,"aggregateTable"),l(a,"pivotTable")})}),e.jsx(k,{label:"Divider",value:p.components.table.row.dividerColor,onChange:o=>g(a=>{a.components.table.row.dividerColor=o,a.components.table.header.dividerColor=o,l(a,"aggregateTable"),l(a,"pivotTable")})}),e.jsx(k,{label:"Selection",value:p.tokens.color.selection,onChange:o=>g(a=>{V(a,"selection",o)})})]}),e.jsx(W,{label:"Zebra rows",checked:p.components.table.row.zebra,onCheckedChange:o=>g(a=>{a.components.table.row.zebra=o,l(a,"aggregateTable"),l(a,"pivotTable")})}),e.jsx(W,{label:"Sticky headers",checked:p.components.table.header.sticky,onCheckedChange:o=>g(a=>{a.components.table.header.sticky=o,l(a,"aggregateTable"),l(a,"pivotTable")})}),e.jsx(W,{label:"Uppercase headers",checked:p.components.table.header.uppercase,onCheckedChange:o=>g(a=>{a.components.table.header.uppercase=o,l(a,"aggregateTable"),l(a,"pivotTable")})})]})]})]})]}):null]})}function v({icon:r,title:n,description:t,children:i}){return e.jsxs("section",{className:"mb-6 last:mb-0",children:[e.jsxs("div",{className:"mb-3 flex items-start gap-2",children:[e.jsx("div",{className:"mt-0.5 flex h-5 w-5 items-center justify-center rounded-control border border-border/70",children:e.jsx(r,{className:"h-3 w-3 text-muted-foreground"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"text-[13px] font-semibold",children:n}),e.jsx("p",{className:"mt-0.5 text-[12px] leading-4 text-muted-foreground",children:t})]})]}),e.jsx("div",{className:"space-y-2",children:i}),e.jsx(d.Separator,{className:"mt-5 bg-border/60"})]})}function we({value:r,onChange:n}){var i;const t=(i=M.find(c=>c.value===r))==null?void 0:i.id;return e.jsxs("div",{children:[e.jsx(d.Label,{className:"mb-1 block text-[11px] font-normal text-muted-foreground",children:"Font family"}),e.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_150px] gap-2",children:[e.jsxs(d.Select,{value:t,onValueChange:c=>{const u=M.find(s=>s.id===c);u&&n(u.value)},children:[e.jsx(d.SelectTrigger,{size:"xs","aria-label":"Font family preset",children:e.jsx(d.SelectValue,{placeholder:"Select font"})}),e.jsx(d.SelectContent,{children:M.map(c=>e.jsx(d.SelectItem,{value:c.id,children:c.label},c.id))})]}),e.jsx("div",{className:"flex h-7 items-center rounded-control border border-border/60 bg-muted/30 px-2 text-[12px]",style:{fontFamily:r},children:"Aa 123"})]})]})}function k({label:r,tooltip:n,value:t,onChange:i}){const[c,u]=m.useState(!1),[s,y]=m.useState(t),j=Fe(t),N=t!==s,f=b=>{u(b),b&&y(t)};return e.jsxs("div",{className:"block",children:[e.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[e.jsx(d.Label,{className:"text-[11px] font-normal text-muted-foreground",children:r}),n?e.jsx(d.TooltipProvider,{children:e.jsxs(d.Tooltip,{children:[e.jsx(d.TooltipTrigger,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`${r} details`,className:"inline-flex h-3.5 w-3.5 items-center justify-center rounded-control text-muted-foreground/70 transition-colors hover:bg-muted hover:text-foreground",children:e.jsx(d.Info,{className:"h-3 w-3"})})}),e.jsx(d.TooltipContent,{side:"top",className:"max-w-64",children:n})]})}):null]}),e.jsxs("div",{className:"flex h-7 items-center overflow-hidden rounded-control border border-input bg-background",children:[e.jsxs(d.Popover,{open:c,onOpenChange:f,children:[e.jsx(d.PopoverTrigger,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`Open ${r} color picker`,className:"ml-1 flex h-5 w-5 shrink-0 items-center justify-center rounded-control border border-border/70",style:{backgroundColor:t},children:e.jsx("span",{className:"sr-only",children:r})})}),e.jsxs(d.PopoverContent,{align:"start",sideOffset:6,className:"z-[60] w-64 rounded-control p-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("label",{className:"relative flex h-16 w-16 shrink-0 cursor-pointer items-center justify-center overflow-hidden rounded-control border border-border/70",style:{backgroundColor:t},children:[e.jsx("input",{"aria-label":`${r} native color picker`,type:"color",value:j,onChange:b=>i(b.target.value),className:"absolute inset-0 h-full w-full cursor-pointer opacity-0"}),e.jsx("span",{className:"rounded-control bg-black/45 p-1 text-white shadow-sm",children:e.jsx(ke,{className:"h-3.5 w-3.5"})})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[e.jsx(d.Label,{className:"block text-[11px] font-normal text-muted-foreground",children:"Color value"}),e.jsx(d.TooltipProvider,{children:e.jsxs(d.Tooltip,{children:[e.jsx(d.TooltipTrigger,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`Reset ${r} color to previous value`,disabled:!N,className:"inline-flex h-5 w-5 items-center justify-center rounded-control text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-35",onClick:()=>i(s),children:e.jsx(d.RotateCcw,{className:"h-3 w-3"})})}),e.jsx(d.TooltipContent,{side:"top",children:"Reset to previous value"})]})})]}),e.jsx(d.Input,{size:"xs","aria-label":`${r} popover color value`,value:t,onChange:b=>i(b.target.value),className:"font-mono"})]})]}),e.jsx("div",{className:"mt-2 grid grid-cols-6 gap-1",children:Te.map(b=>e.jsx("button",{type:"button","aria-label":`Set ${r} to ${b}`,className:d.cn("h-6 rounded-control border border-border/70 shadow-sm",t.toLowerCase()===b&&"ring-2 ring-ring"),style:{backgroundColor:b},onClick:()=>i(b)},b))})]})]}),e.jsx(d.Input,{size:"xs","aria-label":`${r} color value`,value:t,onChange:b=>i(b.target.value),className:"h-full border-0 px-2 font-mono shadow-none focus-visible:border-0"})]})]})}function Fe(r){const n=oe.parseAppearanceColor(r);return n?`#${G(n.r)}${G(n.g)}${G(n.b)}`:"#000000"}function G(r){return Math.round(r).toString(16).padStart(2,"0")}function C({label:r,tooltip:n,value:t,min:i,max:c,onChange:u}){const s=m.useId();return e.jsxs("div",{className:"block",children:[e.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[e.jsx(d.Label,{htmlFor:s,className:"text-[11px] font-normal text-muted-foreground",children:r}),n?e.jsx(d.TooltipProvider,{children:e.jsxs(d.Tooltip,{children:[e.jsx(d.TooltipTrigger,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`${r} details`,className:"inline-flex h-3.5 w-3.5 items-center justify-center rounded-control text-muted-foreground/70 transition-colors hover:bg-muted hover:text-foreground",children:e.jsx(d.Info,{className:"h-3 w-3"})})}),e.jsx(d.TooltipContent,{side:"top",className:"max-w-56",children:n})]})}):null]}),e.jsx(d.Input,{id:s,size:"xs",type:"number",min:i,max:c,value:t,onChange:y=>{const j=Number(y.target.value);Number.isNaN(j)||u(j)}})]})}function H({label:r,value:n,options:t,onChange:i}){return e.jsxs("div",{children:[e.jsx(d.Label,{className:"mb-1 block text-[11px] font-normal text-muted-foreground",children:r}),e.jsxs(d.Select,{value:n,onValueChange:i,children:[e.jsx(d.SelectTrigger,{size:"xs",children:e.jsx(d.SelectValue,{})}),e.jsx(d.SelectContent,{children:t.map(([c,u])=>e.jsx(d.SelectItem,{value:c,children:u},c))})]})]})}function W({label:r,checked:n,onCheckedChange:t}){return e.jsxs("div",{className:"flex h-8 items-center justify-between rounded-control border border-border/60 px-2",children:[e.jsx("span",{className:"text-[12px]",children:r}),e.jsx(d.Switch,{size:"xs",checked:n,onCheckedChange:t})]})}function Pe(r){const n=`${Number((r/16).toFixed(4))}rem`;return{"--semaphor-radius":n,"--semaphor-control-radius":n}}function Be(r){return JSON.parse(JSON.stringify(r))}function Re(r){return typeof r.text=="function"?r.text():new Promise((n,t)=>{const i=new FileReader;i.onload=()=>n(String(i.result??"")),i.onerror=()=>t(i.error??new Error("Unable to read file")),i.readAsText(r)})}exports.BRAND_STUDIO_PRESETS=Y;exports.BrandStudioEditor=Se;exports.applyBrandStudioPreset=ae;exports.buildAppearanceSpecFromDraft=E;exports.createBrandStudioDraft=O;exports.mirrorTableAppearance=l;
|
package/dist/briefings/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../chunks/numeric-presentation-mY6wJMdB.cjs");require("../chunks/validators-DFeDcdpA.cjs");require("../chunks/matrix-continuation-6nhDy-lF.cjs");require("../chunks/matrix-operation-contract-0RxoU_M3.cjs");require("../value-format-preferences/index.cjs");require("../chunks/pivot-result-lifecycle-OXAgoIYm.cjs");const e=require("../chunks/index-CapO5Uw9.cjs");exports.BRIEFING_ARTIFACT_FORMATS=e.BRIEFING_ARTIFACT_FORMATS;exports.BRIEFING_CONTENT_LIMITS=e.BRIEFING_CONTENT_LIMITS;exports.BRIEFING_KIND=e.BRIEFING_KIND;exports.BRIEFING_TEXT_LIMITS=e.BRIEFING_TEXT_LIMITS;exports.BriefingContractError=e.BriefingContractError;exports.DEFAULT_BRIEFING_ARTIFACT_FORMATS=e.DEFAULT_BRIEFING_ARTIFACT_FORMATS;exports.DEFAULT_BRIEFING_SCHEDULE=e.DEFAULT_BRIEFING_SCHEDULE;exports.MAX_BRIEFING_ATTACHMENTS=e.MAX_BRIEFING_ATTACHMENTS;exports.buildBriefingJobConfig=e.buildBriefingJobConfig;exports.buildBriefingScheduleExpr=e.buildBriefingScheduleExpr;exports.buildCreateBriefingRequest=e.buildCreateBriefingRequest;exports.buildDashboardTemporalSnapshotEntries=e.buildDashboardTemporalSnapshotEntries;exports.buildMatrixDeliveryEnvelope=e.buildMatrixDeliveryEnvelope;exports.buildUpdateBriefingRequest=e.buildUpdateBriefingRequest;exports.canCreateBriefingForUser=e.canCreateBriefingForUser;exports.captureMatrixExport=e.captureMatrixExport;exports.describeBriefingSchedule=e.describeBriefingSchedule;exports.formatBriefingComparisonValues=e.formatBriefingComparisonValues;exports.formatBriefingDisplayValue=e.formatBriefingDisplayValue;exports.getBriefingCardAttachmentCapability=e.getBriefingCardAttachmentCapability;exports.getBriefingCardAttachmentFormats=e.getBriefingCardAttachmentFormats;exports.getBriefingCreationIntents=e.getBriefingCreationIntents;exports.getBriefingDisplayTypeLabel=e.getBriefingDisplayTypeLabel;exports.getBriefingPresentation=e.getBriefingPresentation;exports.getDefaultBriefingCardAttachmentFormat=e.getDefaultBriefingCardAttachmentFormat;exports.isBriefingArtifactFormat=e.isBriefingArtifactFormat;exports.isBriefingDeliveryChannel=e.isBriefingDeliveryChannel;exports.isBriefingNumericValue=e.isBriefingNumericValue;exports.isEmailOnlyBriefingDelivery=e.isEmailOnlyBriefingDelivery;exports.isValidBriefingTimezone=e.isValidBriefingTimezone;exports.matrixDeliveryPayloadSchema=e.matrixDeliveryPayloadSchema;exports.matrixDeliveryQuerySchema=e.matrixDeliveryQuerySchema;exports.normalizeBriefingContentDocument=e.normalizeBriefingContentDocument;exports.normalizeBriefingDraft=e.normalizeBriefingDraft;exports.normalizeBriefingJobConfig=e.normalizeBriefingJobConfig;exports.parseBriefingScheduleExpr=e.parseBriefingScheduleExpr;exports.validateBriefingContentDocument=e.validateBriefingContentDocument;exports.validateBriefingDraft=e.validateBriefingDraft;exports.validateBriefingJobConfig=e.validateBriefingJobConfig;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const C=require("react"),g=require("./color-CyB5o13F.cjs"),d=require("./index-Cx3qmRUB.cjs"),E={background:"--semaphor-background",foreground:"--semaphor-foreground",muted:"--semaphor-muted",mutedForeground:"--semaphor-muted-foreground",border:"--semaphor-border",input:"--semaphor-input",primary:"--semaphor-primary",primaryForeground:"--semaphor-primary-foreground",accent:"--semaphor-accent",accentForeground:"--semaphor-accent-foreground",selection:"--semaphor-selection",card:"--semaphor-card",cardForeground:"--semaphor-card-foreground",positive:"--semaphor-positive",negative:"--semaphor-negative",warning:"--semaphor-warning",info:"--semaphor-info",destructive:"--semaphor-destructive",destructiveForeground:"--semaphor-destructive-foreground"},k={light:{"--semaphor-code-string":"158 64% 22%","--semaphor-code-number":"158 64% 22%","--semaphor-code-boolean":"158 64% 22%","--semaphor-code-fn":"217 91% 40%","--semaphor-code-keyword":"263 70% 42%"},dark:{"--semaphor-code-string":"158 64% 52%","--semaphor-code-number":"158 64% 52%","--semaphor-code-boolean":"158 64% 52%","--semaphor-code-fn":"213 94% 68%","--semaphor-code-keyword":"264 89% 74%"}};function _(e){var a,c,s,u,f,p,h,i;const o=e.defaults??d.SEMAPHOR_DEFAULT_APPEARANCE_SPEC,n=e.mode??x(e.spec.mode,e.systemMode),r=e.spec.schemes[n]??o.schemes[n],m=((a=r.tokens)==null?void 0:a.color)??{},t={...k[n]};for(const[l,R]of Object.entries(E)){const A=m[l];if(!A)continue;const F=g.compileColorToHslTriplet(A);if(!F)throw new Error(`Invalid compiled appearance color for ${l}`);t[R]=F}return T(t,(c=r.tokens)==null?void 0:c.radius),O(t,(s=r.tokens)==null?void 0:s.typography),{mode:n,scheme:r,cssVariables:t,colorValues:m,chartPalette:((f=(u=r.components)==null?void 0:u.chart)==null?void 0:f.palette)??((h=(p=o.schemes[n].components)==null?void 0:p.chart)==null?void 0:h.palette)??d.SEMAPHOR_DEFAULT_CHART_PALETTE,table:(i=r.components)==null?void 0:i.table}}function O(e,o){o!=null&&o.fontFamily&&(e["--semaphor-font-family"]=o.fontFamily),o!=null&&o.headingFontFamily&&(e["--semaphor-heading-font-family"]=o.headingFontFamily),o!=null&&o.monoFontFamily&&(e["--semaphor-mono-font-family"]=o.monoFontFamily),(o==null?void 0:o.baseFontSize)!==void 0&&(e["--semaphor-font-size"]=`${o.baseFontSize}px`)}function T(e,o){e["--semaphor-brand"]=e["--semaphor-primary"]??e["--semaphor-foreground"],e["--semaphor-secondary"]=e["--semaphor-accent"]??e["--semaphor-muted"],e["--semaphor-secondary-foreground"]=e["--semaphor-accent-foreground"]??e["--semaphor-foreground"],e["--semaphor-popover"]=e["--semaphor-card"]??e["--semaphor-background"],e["--semaphor-popover-foreground"]=e["--semaphor-card-foreground"]??e["--semaphor-foreground"],e["--semaphor-ring"]=e["--semaphor-primary"]??e["--semaphor-foreground"];const n=S((o==null?void 0:o.control)??5),r=S((o==null?void 0:o.card)??(o==null?void 0:o.control)??5);e["--semaphor-radius"]=n,e["--semaphor-control-radius"]=n,e["--semaphor-card-radius"]=r}function S(e){return`${Number((e/16).toFixed(4))}rem`}function x(e,o="light"){return e==="system"?o:e}const z=_({spec:d.resolveAppearance(),mode:"light"}),v=C.createContext(P("semaphor-default-appearance",z));function L(){return C.useContext(v)}function P(e,o){return{instanceId:e,compiledAppearance:o,scopeProps:M(e,o),portalSnapshot:{instanceId:e,compiledAppearance:o}}}function M(e,o){return{className:o.mode,style:w(o),"data-semaphor-theme":o.mode,"data-semaphor-appearance-instance":e}}function w(e){var t,a;const o={colorScheme:e.mode};e.cssVariables["--semaphor-font-family"]&&(o.fontFamily="var(--semaphor-font-family)");const r=(t=e.scheme.tokens)==null?void 0:t.typography,m=(a=d.SEMAPHOR_DEFAULT_APPEARANCE_SPEC.schemes[e.mode].tokens)==null?void 0:a.typography;(r==null?void 0:r.baseFontSize)!==void 0&&r.baseFontSize!==(m==null?void 0:m.baseFontSize)&&(o.fontSize=r.baseFontSize);for(const[c,s]of Object.entries(e.cssVariables))o[c]=s;return o}exports.APPEARANCE_COLOR_CSS_VARS=E;exports.AppearanceContext=v;exports.compileAppearance=_;exports.createAppearanceContextValue=P;exports.useAppearance=L;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const f=require("react/jsx-runtime"),r=require("react"),d=require("./appearance-context-DzqCdhB4.cjs"),y=require("./index-Cx3qmRUB.cjs"),T={theme:"system",setTheme:()=>null},l=r.createContext(T);function M(e,n="system"){return A(e)?e:n}function A(e){return e==="light"||e==="dark"||e==="system"}function C(e){return f.jsx(v,{...e})}function v({appearance:e,organizationAppearance:n,tokenAppearance:a,reactAppearance:i,resolvedAppearance:t,systemMode:o,children:m}){const s=r.useId(),c=r.useMemo(()=>I(s),[s]),{theme:x}=r.useContext(l),u=P(x),p=r.useMemo(()=>t??y.resolveAppearance({organizationAppearance:n,tokenAppearance:a,reactAppearance:i??e}),[e,n,i,t,a]),h=r.useMemo(()=>d.compileAppearance({spec:p,systemMode:o??u}),[p,u,o]),w=r.useMemo(()=>d.createAppearanceContextValue(c,h),[h,c]);return f.jsx(d.AppearanceContext.Provider,{value:w,children:m})}function I(e){return`semaphor-appearance-${e.replace(/[^a-zA-Z0-9_-]/g,"")}`}function P(e){const n=M(e),[a,i]=r.useState(()=>R());return r.useEffect(()=>{var m,s;if(n!=="system"||typeof window>"u")return;const t=(m=window.matchMedia)==null?void 0:m.call(window,"(prefers-color-scheme: dark)");if(!t)return;const o=()=>{i(t.matches?"dark":"light")};return o(),typeof t.addEventListener=="function"?(t.addEventListener("change",o),()=>t.removeEventListener("change",o)):((s=t.addListener)==null||s.call(t,o),()=>{var c;return(c=t.removeListener)==null?void 0:c.call(t,o)})},[n]),n==="system"?a:n}function R(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}exports.AppearanceRuntimeProvider=C;exports.InternalAppearanceRuntimeProvider=v;exports.ThemeProviderContext=l;exports.normalizeTheme=M;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./x-B6ghREd2.cjs");/**
|
|
2
|
-
* @license lucide-react v0.453.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const a=e.createLucideIcon("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);exports.Braces=a;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var be=Object.defineProperty;var ve=(e,t,n)=>t in e?be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var H=(e,t,n)=>ve(e,typeof t!="symbol"?t+"":t,n);const p=require("./validators-DFeDcdpA.cjs");require("./matrix-operation-contract-0RxoU_M3.cjs");const $=require("./field-aggregations-pH_3kymD.cjs"),U=require("./matrix-analytical-definition-BWd159lN.cjs"),A=require("./stable-serialize-jqCpyZvd.cjs"),Z=(e,t)=>{const n={};if(e===null||t===null)return t;const r=new Set([...Object.keys(e),...Object.keys(t)]);for(const i of r){if(!(i in e)&&i in t){n[i]=t[i];continue}if(i in e&&!(i in t)){n[i]=void 0;continue}const a=e[i],s=t[i];if(!M(a,s))if(Array.isArray(a)&&Array.isArray(s))n[i]=s;else if(V(a)&&V(s)){const o=Z(a,s);Object.keys(o).length>0&&(n[i]=o)}else n[i]=s}return n},M=(e,t)=>{if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((i,a)=>M(i,t[a]));const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>M(e[i],t[i]))}return!1},V=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),N=e=>{if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(Array.isArray(e))return e.map(n=>N(n));const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=N(e[n]));return t},L={kind:"allSheets"},S=(e,t)=>(t==null?void 0:t[e])??e;function ee(e,t){switch(e.kind){case"cards":return{kind:"cards",cardIds:e.cardIds.map(n=>S(n,t.cardIds))};case"sheets":return{kind:"sheets",sheetIds:e.sheetIds.map(n=>S(n,t.sheetIds))};case"documentSections":return{...e,sheetId:S(e.sheetId,t.sheetIds),sectionIds:e.sectionIds.map(n=>S(n,t.sectionIds))};default:return e}}function te(e,t){return{...e,targets:ee(e.targets,t),cardMappings:e.cardMappings.map(n=>({...n,cardId:S(n.cardId,t.cardIds)}))}}function Fe(e,t){return{...e.targets!==void 0?{targets:e.targets&&ee(e.targets,t)}:{},...e.cardMappings!==void 0?{cardMappings:e.cardMappings&&e.cardMappings.map(n=>({...n,cardId:S(n.cardId,t.cardIds)}))}:{}}}function De(e,t){return t?{...e,targets:t.targets===void 0?e.targets:t.targets??L,cardMappings:t.cardMappings===void 0?e.cardMappings:t.cardMappings??[]}:e}const O=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function ke(e,t){const n={};return O(e.targets,t.targets)||(n.targets=O(e.targets,L)?null:e.targets),O(e.cardMappings,t.cardMappings)||(n.cardMappings=e.cardMappings.length?e.cardMappings:null),Object.keys(n).length?n:void 0}function Te(e,t){return{...e,targets:(t==null?void 0:t.targets)??L,cardMappings:(t==null?void 0:t.cardMappings)??[]}}function _e(e){const t=Object.values(e.linkedInteractionTargetOverrides??{});if(!t.length)return;const n={};if(t.some(a=>a.applyToCardIds!==void 0)){const a=t.flatMap(s=>Array.isArray(s.applyToCardIds)?[s.applyToCardIds]:[]);n.targets=a.length===t.length?{kind:"cards",cardIds:[...new Set(a.flat())]}:null}const i=t.filter(a=>!Array.isArray(a.applyToCardIds));if(i.some(a=>a.excludeCardIds!==void 0)){const a=[...new Set(i.flatMap(s=>s.excludeCardIds??[]))].filter(s=>i.every(o=>{var l;return(l=o.excludeCardIds)==null?void 0:l.includes(s)}));n.cardMappings=a.length?a.map(s=>({kind:"excluded",cardId:s})):null}return Object.keys(n).length?n:void 0}const W=/\[\[\s*param\.([A-Za-z0-9_.-]+)\s*\]\]/g,Y=/\bparam\s*\(\s*(['"])([^'"]+)\1/g;function Se(e){const t=[];let n=0;for(;n<e.length;){const r=e.indexOf("{{",n),i=e.indexOf("{%",n);let a=-1,s="";if(r===-1?(a=i,s="%}"):i===-1||r<i?(a=r,s="}}"):(a=i,s="%}"),a===-1)break;const o=e.indexOf(s,a+2);if(o===-1){n=a+2;continue}t.push(e.slice(a+2,o)),n=o+2}return t}function z(e){var r,i;if(!e)return[];const t=new Set;let n;for(W.lastIndex=0;(n=W.exec(e))!==null;){const a=(r=n[1])==null?void 0:r.trim();a&&t.add(a)}for(const a of Se(e))for(Y.lastIndex=0;(n=Y.exec(a))!==null;){const s=(i=n[2])==null?void 0:i.trim();s&&t.add(s)}return Array.from(t)}function Ae(e){const t=new Set,n=new Map;for(const r of e.controlBindings||[])t.add(r.controlId),r.target==="sql_param"&&n.set(r.paramId,r.controlId);for(const r of z(e.sql))t.add(n.get(r)??r);return Array.from(t)}function ne(e){const t=new Map,n=new Map;for(const r of e.controlBindings||[])r.target==="sql_param"&&n.set(r.paramId,r.controlId);for(const r of z(e.sql))t.set(r,{paramId:r,controlId:n.get(r)??r});return Array.from(t.values())}function xe(e,t){var i;const n=(i=e.controlBindings)==null?void 0:i.map(a=>({...a,controlId:t.get(a.controlId)??a.controlId})),r=ne(e).flatMap(({paramId:a,controlId:s})=>{var l;const o=t.get(s);return!o||o===s||(l=e.controlBindings)!=null&&l.some(d=>d.target==="sql_param"&&d.paramId===a)?[]:[{target:"sql_param",paramId:a,controlId:o}]});return r.length?[...n??[],...r]:n}function re(e,t){var i,a;const n=e.source==="dashboardInputAlias"?((i=t.inputAliases)==null?void 0:i[e.variableName])??e:e,r=e.source==="dashboardInputAlias"&&n!==e?{...n,export:e.export??"label"}:n;return r.source==="dashboardInput"?{...r,inputId:((a=t.inputIds)==null?void 0:a[r.inputId])??r.inputId}:r}function Ne(e,t){var i;const n={};for(const a of["cardIds","sheetIds","inputIds","controlIds","filterIds"]){const s={...t[a]};for(const[o,l]of Object.entries((e==null?void 0:e[a])??{}))s[o]=((i=t[a])==null?void 0:i[l])??l;Object.keys(s).length&&(n[a]=s)}const r={...t.inputAliases};for(const[a,s]of Object.entries((e==null?void 0:e.inputAliases)??{}))r[a]=re(s,t);return Object.keys(r).length&&(n.inputAliases=r),n}function we(e,t){var i,a,s,o;const n=N(e);n.controlBindings=xe(e,new Map(Object.entries(t.controlIds??{})));for(const l of n.controls??[])l.id=((i=t.controlIds)==null?void 0:i[l.id])??l.id;for(const l of n.inlineFilters??[])l.id=((a=t.filterIds)==null?void 0:a[l.id])??l.id;const r=l=>{var m,f,u;if(!l||typeof l!="object")return;if(Array.isArray(l)){l.forEach(r);return}const d=l;if(d.type==="variable"&&d.ref&&typeof d.ref=="object"){const h=d.ref;d.ref=h.source==="input"?{...h,inputId:((m=t.inputIds)==null?void 0:m[h.inputId])??h.inputId}:re(h,t)}if(typeof d.entityId=="string"){const h=d.entityId;d.fieldScope==="card"&&(d.entityId=((f=t.cardIds)==null?void 0:f[h])??h),d.fieldScope==="sheet"&&(d.entityId=((u=t.sheetIds)==null?void 0:u[h])??h)}for(const[h,D]of Object.entries(d))h!=="linkedReferenceOverrides"&&r(D)};r(n),n.clickToFilter&&(n.clickToFilter=te(n.clickToFilter,t));for(const l of Object.values(((s=n.customCardPreferences)==null?void 0:s.dataInputCardIds)??{}))l.cardId=((o=t.cardIds)==null?void 0:o[l.cardId])??l.cardId;return n}function R(e){return(e==null?void 0:e.trim())||void 0}function K(e){return e.split(".").at(-1)||e}function G(e,t){var l,d;const n=R(t);if(!n)return;const r=K(n),i=R((l=e.fieldMeta)==null?void 0:l.name);if(i&&i!==n&&i!==r)return;const a=R((d=e.fieldMeta)==null?void 0:d.qualifiedFieldName);if(a&&K(a)!==r)return;const s=n.includes(".")?n:void 0,o=a!=null&&a.includes(".")?a:void 0;if(!(s&&o&&s!==o))return{leafName:r,...s||o?{qualifiedFieldName:s||o}:{}}}function J(e,t){return G(e,t)||G({},t)}function X({source:e,sourceFieldName:t,target:n,targetFieldName:r}){const i=J(e,t),a=J(n,r);return!i||!a||i.leafName!==a.leafName?!1:a.qualifiedFieldName?i.qualifiedFieldName===a.qualifiedFieldName:!0}function w(e,t){var i,a;const n=Ce(e);if(n)return n;const r=(a=(i=e==null?void 0:e.fieldMeta)==null?void 0:i.nativeDataType)==null?void 0:a.trim();if(j(e==null?void 0:e.fieldMeta,t)&&r&&r!=="date"&&r!=="datetime")return r}function Ce(e){var n;const t=(n=e==null?void 0:e.nativeDataType)==null?void 0:n.trim();return t&&t!=="date"&&t!=="datetime"?t:void 0}function j(e,t){var s,o;const n=t.trim();if(!n)return!1;const r=n.split(".").at(-1),i=(s=e==null?void 0:e.qualifiedFieldName)==null?void 0:s.trim();if(i&&!(i===n||!i.includes(".")&&i===r))return!1;const a=(o=e==null?void 0:e.name)==null?void 0:o.trim();return a&&a!==n&&a!==r?!1:!!(i||a)}function Oe({fieldName:e,definition:t,value:n}){if((t==null?void 0:t.column)===e){const r=w(t,e);if(r)return r}return(n==null?void 0:n.name)===e?w(n,e):void 0}function ie({definition:e,value:t,sourceValue:n=t}){const r=e&&X({source:e,sourceFieldName:e.column,target:t,targetFieldName:t.name})?e:void 0,i=n&&X({source:n,sourceFieldName:n.name,target:t,targetFieldName:t.name})?n:void 0,a=(r?w(r,r.column):void 0)||(i?w(i,i.name):void 0);return ae({carrier:t,nativeDataType:a,projectNestedNativeDataType:j(t.fieldMeta,t.name)})}function Re({filterDefinitions:e,filterValues:t}){if(!(e!=null&&e.length)||!t.length)return t;const n=new Map(e.map(a=>[a.id,a]));let r=!1;const i=t.map(a=>{if(typeof a.name!="string"||!a.name.trim())return a;const s=n.get(a.filterId);if(!s)return a;const o=ie({definition:s,value:a});return r||(r=o!==a),o});return r?i:t}function $e(e){const t=Oe({fieldName:e.column,definition:e});return ae({carrier:e,nativeDataType:t,projectNestedNativeDataType:j(e.fieldMeta,e.column)})}function ae({carrier:e,nativeDataType:t,projectNestedNativeDataType:n}){var d;const r=(d=e.fieldMeta)==null?void 0:d.nativeDataType;if(t){if(e.nativeDataType===t&&(!e.fieldMeta||(n?r===t:!r)))return e;const{nativeDataType:m,...f}=e.fieldMeta||{};return{...e,nativeDataType:t,...e.fieldMeta?{fieldMeta:n?{...e.fieldMeta,nativeDataType:t}:f}:{}}}if(e.nativeDataType===void 0&&r===void 0)return e;const{nativeDataType:i,fieldMeta:a,...s}=e,{nativeDataType:o,...l}=a||{};return{...s,...a?{fieldMeta:l}:{}}}function Q(e){const t=new Set;for(const n of[e.name,e.sourceField]){if(!n)continue;const r=p.normalizeAnalyticsCatalogName(n);if(!r)continue;t.add(r);const i=r.split("."),a=i[i.length-1];a&&t.add(a)}return t}function oe(e,t){const n=p.normalizeAnalyticsCatalogDataType(e),r=p.normalizeAnalyticsCatalogDataType(t);return n==="unknown"||r==="unknown"?!1:(n==="date"||n==="datetime")&&(r==="date"||r==="datetime")?!0:n===r}function Me(e,t){return p.semaphorSourcesReferToSameDataset(e.field.source,t.field.source)&&p.normalizeAnalyticsCatalogName(e.field.name)===p.normalizeAnalyticsCatalogName(t.field.name)&&p.normalizeAnalyticsCatalogName(e.field.sourceField||e.field.name)===p.normalizeAnalyticsCatalogName(t.field.sourceField||t.field.name)}function se(e,t){if(e.kind!=="field")return!1;const n=Q(t),r=Q(e.field);return oe(t.dataType,e.field.dataType)&&[...r].some(i=>n.has(i))}function Ee(e){const t=e.candidates.filter(n=>se(n,e.logicalValueField));return t.length===1?{status:"matched",target:t[0]}:t.length>1?{status:"ambiguous"}:{status:"notApplicable"}}function Pe(e){const t=[];for(const n of e.acceptedTargets)!oe(e.logicalValueField.dataType,n.field.dataType)||t.some(r=>Me(r,n))||t.push(n);return t.length===1?{status:"matched",target:t[0]}:t.length>1?{status:"ambiguous"}:{status:"notApplicable"}}const Le=/\{\{-?\s*filters\s*\|\s*where\s*-?\}\}/i,ze=/\{\{-?\s*filters\s*\|\s*and\s*-?\}\}/i,je=/\bwhere\b/i;function de(e){return e!=null&&e.trim()?Le.test(e)||ze.test(e):!1}function Be(e){return!(e!=null&&e.trim())||de(e)?null:je.test(e)?{helper:"{{ filters | and }}",description:"For queries with an existing WHERE clause."}:{helper:"{{ filters | where }}",description:"For queries without a WHERE clause."}}function qe(e){return(e.field.sourceField||e.field.name).trim()||void 0}function He(e){if(e.inventory.kind!=="sql"||e.target.kind!=="field")return{status:"ineligible"};const t=$.findDashboardSqlPinnedCatalogSource(e.inventory,e.target.field.source),n=qe(e.target);if(!t||!n)return{status:"ineligible"};if(t.executionTable){const s=[t.executionTable.databaseName,t.executionTable.schemaName,t.executionTable.tableName,n].filter(Boolean).join(".");return{status:"eligible",source:t.source,executionIdentifier:s}}if(e.inventory.pinnedCatalogSources.length!==1)return{status:"ineligible"};const r=p.normalizeAnalyticsCatalogName(n),i=(e.candidateTargets||[]).filter(s=>p.normalizeAnalyticsCatalogName(s.field.sourceField||s.field.name)===r),a=[];for(const s of i)a.some(o=>p.semaphorSourcesReferToSameDataset(o,s.field.source))||a.push(s.field.source);return a.length>1?{status:"ineligible"}:{status:"eligible",source:t.source,executionIdentifier:n}}const le=Object.freeze({mode:"all_applicable"});function ce(e){if(e===void 0)return{ok:!0,dependencies:{...le}};const t=p.validateSemaphorOptionDependencies(e,"dashboard");if(!t.ok)return{ok:!1,error:"Invalid dashboard option dependency policy.",issues:t.errors.map(r=>r.message)};const n=e;switch(n.mode){case"independent":return{ok:!0,dependencies:{mode:"independent"}};case"explicit":return{ok:!0,dependencies:{mode:"explicit",includeInputIds:[...n.includeInputIds||[]]}};case"all_applicable":return{ok:!0,dependencies:{mode:"all_applicable",...n.excludeInputIds?{excludeInputIds:[...n.excludeInputIds]}:{}}};default:return{ok:!1,error:"Invalid dashboard option dependency policy.",issues:["Dashboard option dependencies must declare a mode."]}}}function ue(e){if(e===void 0)return{ok:!0,population:void 0};const t={ok:!1,error:"Invalid option population."};if(!e||typeof e!="object"||Array.isArray(e))return t;const n=e;if(n.kind==="option_source")return{ok:!0,population:{kind:"option_source"}};if(n.kind!=="related_population")return t;const r=n.baseSource;if(!r||r.kind!=="semantic"||!p.hasCompleteSemaphorSourceIdentity(r))return t;const i=n.relationshipHint;return i!==void 0&&(!i||typeof i!="object"||i.relationshipIds!==void 0&&(!Array.isArray(i.relationshipIds)||i.relationshipIds.some(a=>typeof a!="string"||!a.trim())))?t:{ok:!0,population:{kind:"related_population",baseSource:r,...i?{relationshipHint:i}:{}}}}function Ue(e){const{dependencies:t}=e,n=new Set([e.targetInputId,...t.excludeInputIds||[]]);return t.mode==="independent"?[]:t.mode==="explicit"?(t.includeInputIds||[]).filter(r=>!n.has(r)):e.peerInputIds.filter(r=>!n.has(r))}function Ve(e,t,n){if(t===n)return e;let r=!1;const i=s=>s!=null&&s.includes(t)?(r=!0,Array.from(new Set(s.map(o=>o===t?n:o)))):s,a=e.map(s=>{const o=s.optionDependencies;if(!o)return s;const l=i(o.includeInputIds),d=i(o.excludeInputIds);return l===o.includeInputIds&&d===o.excludeInputIds?s:{...s,optionDependencies:{...o,...l?{includeInputIds:l}:{},...d?{excludeInputIds:d}:{}}}});return r?a:e}function We(e,t){const n=fe(e.dependencies,t);return n===e.dependencies?e:{...e,dependencies:n}}function fe(e,t){if(!(t!=null&&t.length)||e.mode!=="explicit")return e;const n=new Set(e.includeInputIds||[]),r=Array.from(new Set(t)).filter(i=>n.has(i));return r.length?{...e,omitInputIds:r}:e}class pe extends Error{constructor(n){super(n.map(r=>r.message).join(" "));H(this,"issues");this.name="DashboardFilterMappingContractError",this.issues=n}}const Ye={string:!0,number:!0,boolean:!0,date:!0,datetime:!0};function F(e){return typeof e=="string"&&e.trim().length>0}function g(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function x(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function Ke(e){if(!g(e))return!1;switch(e.kind){case"allSheets":return e.sheetKinds===void 0||x(e.sheetKinds)&&e.sheetKinds.every(t=>t==="dashboard"||t==="document");case"sheets":return x(e.sheetIds);case"cards":return x(e.cardIds);case"documentSections":return F(e.sheetId)&&x(e.sectionIds);default:return!1}}function Ge(e){return e==="shared"||e==="perSheet"||e==="perCard"||e==="perDocumentSection"}function Je(e){return g(e)?F(e.id)&&F(e.column)&&F(e.dataType):!1}function Xe(e,t,n,r){var o;if(!g(t)){r.push({code:"invalid_option_source",path:n,message:`${n} must be a semantic or physical option source.`,inputId:e});return}const i=t.source,a=[["labelField",t.labelField],["valueField",t.valueField],["searchField",t.searchField]];if(!g(i)||i.kind!=="semantic"&&i.kind!=="physical"||!p.hasCompleteSemaphorSourceIdentity(i)||!g(t.labelField)||!g(t.valueField)||t.searchField!==void 0&&!g(t.searchField)||t.disambiguationFields!==void 0&&(!Array.isArray(t.disambiguationFields)||!t.disambiguationFields.every(g))){r.push({code:"invalid_option_source",path:n,message:`${n} must contain a valid semantic or physical source and field references.`,inputId:e});return}for(const[l,d]of a)d!==void 0&&g(d)&&(!F(d.name)||d.source!==void 0&&!p.semaphorSourcesReferToSameDataset(d.source,i))&&r.push({code:"invalid_option_source",path:`${n}.${l}`,message:`${n}.${l} must be a named field belonging to the declared option source.`,inputId:e});for(const[l,d]of((o=t.disambiguationFields)==null?void 0:o.entries())||[])(!g(d)||!F(d.name)||d.source!==void 0&&!p.semaphorSourcesReferToSameDataset(d.source,i))&&r.push({code:"invalid_option_source",path:`${n}.disambiguationFields[${l}]`,message:`${n}.disambiguationFields[${l}] must be a named field belonging to the declared option source.`,inputId:e});const s=t.valueField;["string","number","boolean","date","datetime"].includes(String(s.dataType))||r.push({code:"invalid_option_source",path:`${n}.valueField.dataType`,message:`${n}.valueField.dataType must be a known option-value datatype.`,inputId:e})}function Qe(e,t,n){var r;if(e.optionDependencies!==void 0){const i=ce(e.optionDependencies);i.ok?g(e.optionDependencies)&&e.optionDependencies.omitInputIds!==void 0&&n.push({code:"invalid_option_dependencies",path:`${t}.optionDependencies.omitInputIds`,message:`${t}.optionDependencies cannot persist a browse override (omitInputIds).`,inputId:e.id}):n.push({code:"invalid_option_dependencies",path:`${t}.optionDependencies`,message:`${t}.optionDependencies ${i.issues.join("; ")||i.error}`,inputId:e.id})}if(e.optionPopulation!==void 0){const i=ue(e.optionPopulation);i.ok?((r=i.population)==null?void 0:r.kind)==="related_population"&&!Ze(e.optionSource)&&n.push({code:"invalid_option_population",path:`${t}.optionPopulation`,message:`${t}.optionPopulation related_population requires an authored semantic optionSource.`,inputId:e.id}):n.push({code:"invalid_option_population",path:`${t}.optionPopulation`,message:`${t}.optionPopulation must be option_source or a related_population with a complete semantic baseSource.`,inputId:e.id})}}function Ze(e){return g(e)&&g(e.source)&&e.source.kind==="semantic"}function et(e,t,n,r,i,a){var d;if(F(t.bindingId)||i.push({code:"invalid_binding_id",path:`${n}.bindingId`,message:`${n}.bindingId must be an opaque non-empty id.`,inputId:e,cardId:t.cardId}),((d=t.target)==null?void 0:d.kind)!=="field"){i.push({code:"unsupported_target",path:`${n}.target`,message:`${n}.target must be one direct field target.`,inputId:e,cardId:t.cardId,bindingId:t.bindingId});return}const s=t.target.field;if(!F(s==null?void 0:s.name)||!s.source||s.source.kind!=="semantic"&&s.source.kind!=="physical"||!p.hasCompleteSemaphorSourceIdentity(s.source)){i.push({code:"invalid_target_field",path:`${n}.target.field`,message:`${n}.target.field must have a name and a source-qualified semantic or physical identity.`,inputId:e,cardId:t.cardId,bindingId:t.bindingId});return}if(Object.prototype.hasOwnProperty.call(Ye,s.dataType)||i.push({code:"unknown_target_data_type",path:`${n}.target.field.dataType`,message:`${n}.target.field.dataType must be known.`,inputId:e,cardId:t.cardId,bindingId:t.bindingId}),s.sourceField!==void 0&&!F(s.sourceField)&&i.push({code:"invalid_target_field",path:`${n}.target.field.sourceField`,message:`${n}.target.field.sourceField must be a non-empty catalog-grounded column when provided.`,inputId:e,cardId:t.cardId,bindingId:t.bindingId}),!a)return;const o=r.get(t.cardId);if(!o){i.push({code:"unknown_card",path:`${n}.cardId`,message:`${n}.cardId '${t.cardId}' does not exist.`,inputId:e,cardId:t.cardId,bindingId:t.bindingId});return}const l=$.buildDashboardCardSourceIndex(o);(l.kind==="unconfigured"||!$.dashboardCardFilterSourceInventoryContains(l,s.source))&&i.push({code:"unavailable_card_source",path:`${n}.target.field.source`,message:`${n}.target field source is not declared by card '${o.id}'.`,inputId:e,cardId:o.id,bindingId:t.bindingId})}function tt(e,t,n,r,i,a){if(t===void 0)return;if(!g(t)||t.kind!=="cardMappings"||!Array.isArray(t.cards)){i.push({code:"invalid_application",path:n,message:`${n} must be a cardMappings application with a cards array.`,inputId:e});return}const s=new Set;t.cards.forEach((o,l)=>{const d=`${n}.cards[${l}]`;if(!F(o==null?void 0:o.cardId)){i.push({code:"unknown_card",path:`${d}.cardId`,message:`${d}.cardId is required.`,inputId:e});return}if(s.has(o.cardId)){i.push({code:"duplicate_card_application",path:`${d}.cardId`,message:`${n} contains more than one entry for card '${o.cardId}'.`,inputId:e,cardId:o.cardId});return}if(s.add(o.cardId),a&&!r.has(o.cardId)){i.push({code:"unknown_card",path:`${d}.cardId`,message:`${d}.cardId '${o.cardId}' does not exist.`,inputId:e,cardId:o.cardId});return}o.kind==="bound"?et(e,o,d,r,i,a):o.kind!=="excluded"&&i.push({code:"invalid_application",path:d,message:`${d}.kind must be 'bound' or 'excluded'.`,inputId:e,cardId:o.cardId})})}function me({inputs:e,dashboardFilters:t,cards:n=[],validateCardTargets:r=!1}){const i=[],a=new Map((t||[]).map(d=>[d.id,d])),s=new Map(r?n.map(d=>[d.id,d]):[]),o=[],l=new Map;return e!=null&&!Array.isArray(e)?(i.push({code:"invalid_input",path:"dashboard.inputs",message:"dashboard.inputs must be an array when present."}),{ok:!1,inputs:o,issues:i}):((Array.isArray(e)?e:[]).forEach((d,m)=>{const f=`dashboard.inputs[${m}]`;if(!g(d)||d.kind!=="filter"&&d.kind!=="control"||!F(d.id)||!F(d.label)||!F(d.variableName)||!Ke(d.scope)||!Ge(d.runtimeScope)){i.push({code:"invalid_input",path:f,message:`${f} must be a complete filter or control Dashboard Input envelope.`,inputId:g(d)&&typeof d.id=="string"?d.id:void 0});return}if(d.kind==="control"&&!g(d.control)){i.push({code:"invalid_input",path:`${f}.control`,message:`${f}.control must be a control definition.`,inputId:d.id});return}const u=d;if(u.kind==="control"){o.push(u);return}const h=u.filter,D=u.filterReference,T=h!==void 0,_=!!D;if(T&&_){i.push({code:"both_filter_definitions",path:f,message:`${f} must contain either filter or filterReference, not both.`,inputId:u.id});return}if(!T&&!_){i.push({code:"missing_filter_definition",path:f,message:`${f} must contain filter or filterReference.`,inputId:u.id});return}if(T&&!Je(h)){i.push({code:"invalid_input",path:`${f}.filter`,message:`${f}.filter must be a complete dashboard filter definition.`,inputId:u.id});return}let b,c;if(T)b=h,c="embedded";else{if((D==null?void 0:D.kind)!=="dashboardFilter"){i.push({code:"invalid_filter_reference",path:`${f}.filterReference.kind`,message:`${f}.filterReference.kind must be 'dashboardFilter'.`,inputId:u.id});return}const C=typeof(D==null?void 0:D.filterId)=="string"?D.filterId:void 0;if(b=C?a.get(C):void 0,c="dashboardFilter",!b){i.push({code:"orphaned_filter_reference",path:`${f}.filterReference.filterId`,message:`${f}.filterReference cannot resolve dashboard filter '${C||""}'.`,inputId:u.id});return}if(b.kind==="global-date"){i.push({code:"global_date_reference",path:`${f}.filterReference`,message:`${f}.filterReference cannot reference the Global Date filter.`,inputId:u.id});return}const q=l.get(b.id);if(q){i.push({code:"duplicate_filter_reference",path:`${f}.filterReference.filterId`,message:`${f}.filterReference duplicates dashboard filter '${b.id}' already owned by Dashboard Input '${q}'.`,inputId:u.id});return}l.set(b.id,u.id)}if(!b)return;if(u.forceSelection!==void 0&&typeof u.forceSelection!="boolean"&&i.push({code:"invalid_input",path:`${f}.forceSelection`,message:`${f}.forceSelection must be a boolean.`,inputId:u.id}),u.optionSource!==void 0&&Xe(u.id,u.optionSource,`${f}.optionSource`,i),Qe(u,f,i),u.application&&b.kind==="global-date"){i.push({code:"global_date_reference",path:`${f}.application`,message:`${f}.application cannot map the Global Date filter.`,inputId:u.id});return}u.application&&u.scope.kind!=="allSheets"&&u.scope.kind!=="sheets"&&i.push({code:"unsupported_mapped_scope",path:`${f}.scope`,message:`${f}.scope must be allSheets or sheets when cardMappings are present.`,inputId:u.id}),tt(u.id,u.application,`${f}.application`,s,i,r);const{filter:k,filterReference:y,compatibility:v,...I}=u;o.push({...I,filter:b,...T&&v?{compatibility:v}:{},...u.optionSource?{optionSource:u.optionSource}:{},...u.optionDependencies?{optionDependencies:u.optionDependencies}:{},...u.optionPopulation?{optionPopulation:u.optionPopulation}:{},definitionOrigin:c})}),i.length?{ok:!1,inputs:o,issues:i}:{ok:!0,inputs:o})}function nt(e){const t=me(e);if(!t.ok)throw new pe(t.issues);return t.inputs}function rt(e=()=>globalThis.crypto.randomUUID()){return e()}const it={date:new Set(["between","not between","=","!=",">",">=","<","<=","is null","is not null"]),number:new Set(["between","not between","=","!=",">",">=","<","<=","in","not in","is null","is not null"]),string:new Set(["=","!=","in","not in","like","not like","is null","is not null"]),boolean:new Set(["=","!=","in","not in","is null","is not null"])};function he(e){const t=p.normalizeAnalyticsCatalogDataType(e);return t==="number"||t==="boolean"?t:t==="date"||t==="datetime"?"date":"string"}function at(e,t){return typeof t!="string"?!1:it[he(e)].has(t)}function E(e,t,n=r=>{var i;return((i=r.derivedField)==null?void 0:i.dataType)??r.dataType}){return t==="sql_param"||t==="presentation_currency"?[]:t==="config_metric_selector"||t==="config_aggregation"?e.measures.flatMap(r=>r.kind==="aggregate"?[{id:r.id,kind:"measure",measure:r}]:[]):["rows","columns"].flatMap(r=>e[r].filter(i=>t!=="config_grain"||p.isAnalyticsDateLikeDataType(n(i.field))).map(i=>({id:i.id,kind:"level",axis:r,level:i})))}function ot(e,t,n,r){const i=[...e.rows,...e.columns].find(d=>d.id===t);if(!i)throw new Error("Matrix level is no longer present.");if(r===t)return{kind:"structure",rows:e.rows,columns:e.columns};const a=e.rows.filter(d=>d.id!==t),s=e.columns.filter(d=>d.id!==t),o=n==="rows"?a:s,l=r?o.findIndex(d=>d.id===r):-1;return o.splice(l<0?o.length:l,0,i),{kind:"structure",rows:a,columns:s}}function B(e,t){const n=U.getMatrixAnalyticalDefinition(e),r=U.getMatrixAnalyticalDefinition(t),i=(o,l)=>A.stableSerialize(n[o][l])===A.stableSerialize(r[o][l]),a=o=>{const l=n.rankings.find(m=>m.id===o),d=r.rankings.find(m=>m.id===o);return!!l&&!!d&&A.stableSerialize(l)===A.stableSerialize(d)};return(o,l,d=!1)=>l.length<=t[o].length&&l.every((m,f)=>{var u;return(m.member.kind==="value"||d&&a(m.member.rankingId))&&m.levelId===((u=t[o][f])==null?void 0:u.id)&&i(o,f)})}function P(e,t,n,r){if(!n)return n;const i=B(e,t),a=new Set(t.measures.map(s=>s.id));return{...n,rules:n.rules.filter(s=>{const o=s.target.matrix,l=!o||(o.levelId===void 0||t[o.axis].some(m=>m.id===o.levelId))&&(o.oppositePath===void 0||i(o.axis==="rows"?"columns":"rows",o.oppositePath,!0)),{validationRefs:d}=p.conditionalRuleMeasureRefs(s);return l&&d.every(m=>a.has(m))?!0:(r.push({kind:"conditional_format",id:s.id,message:"Removed a conditional rule whose measure, level or member path changed."}),!1)})}}function ge(e,t,n=!1){const r={...t},i=[],a=B(e,r),s=new Set(r.measures.map(l=>l.id)),o=(l,d,m)=>i.push({kind:l,id:d,message:m});return r.sorts=r.sorts.filter(l=>{const d=r[l.axis].findIndex(f=>f.id===l.levelId),m=d>=0&&(l.scope.kind==="level"||l.scope.parent.length===d&&a(l.axis,l.scope.parent))&&(l.target.kind==="member"||s.has(l.target.measureId)&&a(l.axis==="rows"?"columns":"rows",l.target.oppositePath));return m||o("sort",l.levelId,"Removed a sort whose level, measure or member path changed."),m}),r.rankings=r.rankings.filter(l=>{const d=r[l.axis].some(m=>m.id===l.levelId)&&s.has(l.measureId)&&a(l.axis==="rows"?"columns":"rows",l.oppositePath);return d||o("ranking",l.id,"Removed a ranking whose level, measure or member path changed."),d}),{spec:(n?p.matrixAuthoringSpecSchema:p.matrixSpecSchema).parse(r),notices:i}}function st(e,t,n=[],r,i=!1){const a=[];if(t.kind!=="structure"){const c=t.kind==="presentation"?{...e,presentation:t.presentation}:t.kind==="defaults"?{...e,defaultView:t.defaultView}:t.kind==="sorts"?{...e,spec:{...e.spec,sorts:t.sorts}}:{...e,spec:{...e.spec,rankings:t.rankings}};return t.kind==="rankings"&&c.presentation.conditionalFormatting&&(c.presentation={...c.presentation,conditionalFormatting:P(e.spec,c.spec,c.presentation.conditionalFormatting,a)}),{config:(i?p.matrixAuthoringConfigSchema:p.matrixConfigSchema).parse(c),notices:a,removedBindings:[],bindings:n}}const s=ge(e.spec,{...e.spec,rows:t.rows??e.spec.rows,columns:t.columns??e.spec.columns,measures:t.measures??e.spec.measures},i),o=s.spec;a.push(...s.notices);const l=B(e.spec,o),d=new Set(o.measures.map(c=>c.id)),m=[...o.rows,...o.columns],f=new Set(m.map(c=>c.id)),u=(c,k,y)=>a.push({kind:c,id:k,message:y}),h=[],D=n.flatMap(c=>{if(c.target==="sql_param"||c.target==="presentation_currency")return[c];const k=E(e.spec,c.target,r),y=c.matrixTargetId??(k.length===1?k[0].id:void 0);return E(o,c.target,r).some(I=>I.id===y)?c.matrixTargetId?[c]:(u("binding",c.controlId,"Pinned the control binding to its original Matrix target after a structural change."),[{...c,matrixTargetId:y}]):(u("binding",c.controlId,"Removed a control binding whose original Matrix target is missing, ambiguous or no longer eligible."),h.push(c),[])}),T=(c,k,y)=>Object.fromEntries(Object.entries(c).filter(([v])=>k.has(v)?!0:(u(y,v,`Removed a ${y} override for a removed field.`),!1))),_={...e.presentation,levelLabels:T(e.presentation.levelLabels,f,"label"),measureLabels:T(e.presentation.measureLabels,d,"label"),levelFormats:T(e.presentation.levelFormats,f,"format"),measureFormats:T(e.presentation.measureFormats,d,"format"),totals:{...e.presentation.totals}};_.levelFormats=Object.fromEntries(Object.entries(_.levelFormats).filter(([c,k])=>{const y=m.find(I=>I.id===c),v=[...e.spec.rows,...e.spec.columns].find(I=>I.id===c);return k.type!=="temporal_bucket"||y.grain&&y.grain===(v==null?void 0:v.grain)?!0:(u("format",c,"Removed a temporal format because its grain changed."),!1)})),_.conditionalFormatting&&(_.conditionalFormatting=P(e.spec,o,_.conditionalFormatting,a));const b={...e.defaultView};for(const c of["rows","columns"]){const k={...e.presentation.totals.rows.levels,...e.presentation.totals.columns.levels};for(const I of Object.keys(e.presentation.totals[c].levels))f.has(I)||u("total",I,"Removed subtotal settings for a removed level.");_.totals[c]={...e.presentation.totals[c],levels:Object.fromEntries(o[c].map(I=>[I.id,k[I.id]??{visible:!0,position:"before"}]))};const y=e.defaultView[c],v=Math.min(y.depth,Math.max(0,o[c].length-1));v!==y.depth&&u("depth",c,`Reduced ${c} expansion depth to fit the hierarchy.`),b[c]={depth:v,overrides:y.overrides.filter(I=>I.path.length<o[c].length&&l(c,I.path)?!0:(u("expansion",c,`Removed a ${c} expansion override whose path changed or became a leaf.`),!1))}}return{config:(i?p.matrixAuthoringConfigSchema:p.matrixConfigSchema).parse({...e,spec:o,presentation:_,defaultView:b}),notices:a,removedBindings:h,bindings:D}}function Ie(e){return!e.entityName||e.entityName===p.CALCULATED_FIELD_ENTITY_MARKER||e.entityName==="calculated_fields"||e.qualifiedEntityName===p.CALCULATED_FIELD_ENTITY_MARKER||e.qualifiedEntityName==="calculated_fields"?"root":e.qualifiedEntityName||e.entityName}function ye(e){return["domain",e.role||"field",Ie(e),e.name].join("::")}function dt(e){var i,a;if(e.fieldScope!=="domain")return;const t=e.calculatedFieldOrigin;if((i=t==null?void 0:t.id)!=null&&i.startsWith("domain::"))return t.id;const n=(a=e.derivedField)==null?void 0:a.resultRole,r=n==="measure"?"metric":n==="dimension"||n==="date"?"groupby":e.derivedField||t==null?void 0:t.role;if(!(r!=="metric"&&r!=="groupby"))return ye({...e,role:r})}exports.DASHBOARD_DEFAULT_OPTION_DEPENDENCIES=le;exports.DashboardFilterMappingContractError=pe;exports.applyCardReferenceRemapping=we;exports.applyLinkedClickToFilterOverrides=De;exports.applyOptionDependencyOverride=fe;exports.buildLinkedClickToFilterOverrides=ke;exports.cloneDeep=N;exports.composeCardReferenceRemapping=Ne;exports.createDashboardFilterBindingId=rt;exports.dashboardFilterTargetMatchesLogicalValue=se;exports.dashboardFilterValueTypeForDataType=he;exports.extractParamControlIdsFromSql=z;exports.extractReferencedControlIds=Ae;exports.extractSqlParamReferences=ne;exports.getCalculatedFieldNamespace=Ie;exports.getDashboardFilterSubscriptionHint=Be;exports.getMatrixBindingTargets=E;exports.getObjectDiff=Z;exports.getStableDomainCalculatedFieldId=ye;exports.hasDashboardFilterSubscription=de;exports.isDashboardFilterOperationCompatible=at;exports.materializeFilterDefinitionNativeDataType=$e;exports.materializeFilterValueNativeDataType=ie;exports.materializeFilterValuesNativeDataType=Re;exports.moveMatrixLevel=ot;exports.normalizeDashboardInputs=me;exports.normalizeLegacyLinkedTargetOverrides=_e;exports.readExactDomainCalculatedFieldReference=dt;exports.rebindDashboardOptionDependencyInputId=Ve;exports.reconcileMatrixSpecStructure=ge;exports.remapClickToFilterReferences=te;exports.remapLinkedClickToFilterOverrides=Fe;exports.requireNormalizedDashboardInputs=nt;exports.resolveDashboardFilterAutomaticTarget=Ee;exports.resolveDashboardFilterInheritedTarget=Pe;exports.resolveDashboardOptionDependencies=ce;exports.resolveDashboardOptionPopulation=ue;exports.resolveDashboardSqlFilterTarget=He;exports.retainMatrixConditionalFormatting=P;exports.selectDashboardOptionDependencyInputIds=Ue;exports.stripInstanceTargetsForLibrarySave=Te;exports.updateMatrixConfig=st;exports.withDashboardOptionDependencyOverride=We;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const c="SEMAPHOR_CALCULATED_FIELD";function o(e,a,r){if(r&&(a==="groupby"||a==="pivotby"))return r;if(a==="metric"&&e.name==="*"&&!e.expression)return e.alias||"count";if(e.alias)return e.alias;const t=e.entityName&&e.entityName!==c?e.entityName:void 0;if(e.role==="metric"){let n=e.aggregate||"metric";if(e.expression){const s=e.expression.match(/^(COUNT|SUM|AVG|MIN|MAX|MEDIAN|DISTINCT)\s*\(/i);n=s?s[1].toLowerCase():"expr"}else n=n.toLowerCase();return t&&t!==e.name?`${t}_${e.name}_${n}`:`${e.name}_${n}`}return t&&t!==e.name?`${t}_${e.name}`:e.name}function u(e){return o(e,"detail")}function m(e){const a=e.label;return a&&e.labelCount===1&&(a===e.rawKey||!e.rawKeys.has(a))?a:e.rawKey}exports.resolveCanonicalDetailResultRawKey=u;exports.resolveCanonicalResultOutputKey=m;exports.resolveCanonicalResultRawKey=o;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const y=require("./validators-DFeDcdpA.cjs"),V=require("./matrix-operation-contract-0RxoU_M3.cjs");require("./matrix-continuation-6nhDy-lF.cjs");require("../value-format-preferences/index.cjs");const F=require("./temporal-bucket-4YEPEKlJ.cjs"),m=require("./field-aggregations-pH_3kymD.cjs"),M=require("./color-CyB5o13F.cjs"),S=require("./matrix-definition-DanUT11P.cjs"),Q=require("./matrix-card-C2RjEYZ8.cjs");let A;const J=new Uint8Array(16);function z(){if(!A&&(A=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!A))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return A(J)}const g=[];for(let e=0;e<256;++e)g.push((e+256).toString(16).slice(1));function H(e,t=0){return g[e[t+0]]+g[e[t+1]]+g[e[t+2]]+g[e[t+3]]+"-"+g[e[t+4]]+g[e[t+5]]+"-"+g[e[t+6]]+g[e[t+7]]+"-"+g[e[t+8]]+g[e[t+9]]+"-"+g[e[t+10]]+g[e[t+11]]+g[e[t+12]]+g[e[t+13]]+g[e[t+14]]+g[e[t+15]]}const $=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),O={randomUUID:$};function Z(e,t,a){if(O.randomUUID&&!e)return O.randomUUID();e=e||{};const r=e.random||(e.rng||z)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,H(r)}function X(e){return e.format!=null||e.dateFormat!=null}const P={"Week of MMM DD, YYYY":{type:"temporal_bucket",presentation:{mode:"preset",preset:"week_of_short"}},"Week of MMMM DD, YYYY":{type:"temporal_bucket",presentation:{mode:"preset",preset:"week_of_long"}},"Q1 YYYY":{type:"temporal_bucket",presentation:{mode:"preset",preset:"quarter_short"}},"1st Quarter YYYY":{type:"temporal_bucket",presentation:{mode:"preset",preset:"quarter_long"}},"YYYY Q1":void 0,"YYYY-Q1":void 0,"Quarter 1, YYYY":void 0,"YYYY-WW":void 0};function ee(e,t,a,r){return{code:t,severity:"warning",fieldId:e.fieldId,...r?{ignoredPattern:r}:{},effectiveFormat:a}}function te(e,t){if(e.dateFormat===void 0||e.dateFormat===null)return{format:m.AUTOMATIC_TEMPORAL_BUCKET_FORMAT};if(typeof e.dateFormat!="string")return{format:m.AUTOMATIC_TEMPORAL_BUCKET_FORMAT,repairCode:"unsupported_pattern"};const a=e.dateFormat==="custom"?typeof e.customFormat=="string"?e.customFormat.trim():"":e.dateFormat.trim();if(!a)return{format:m.AUTOMATIC_TEMPORAL_BUCKET_FORMAT,repairCode:"missing_custom_pattern"};if(Object.prototype.hasOwnProperty.call(P,a)){const i=P[a];return i?F.validateTemporalBucketFormatApplicability(i,t).ok?{format:i}:{format:m.AUTOMATIC_TEMPORAL_BUCKET_FORMAT,repairCode:"grain_incompatible_pattern",ignoredPattern:a}:{format:m.AUTOMATIC_TEMPORAL_BUCKET_FORMAT,repairCode:"unsupported_pattern",ignoredPattern:a}}const r={type:"temporal_bucket",presentation:{mode:"pattern",pattern:a}},n=F.validateTemporalBucketFormatApplicability(r,t);return n.ok?{format:r}:{format:m.AUTOMATIC_TEMPORAL_BUCKET_FORMAT,repairCode:n.code==="incompatible_temporal_bucket_pattern"||n.code==="incompatible_temporal_bucket_preset"?"grain_incompatible_pattern":"unsupported_pattern",ignoredPattern:a}}function re(e){if(y.isSemaphorTimeGrain(e.granularity))return{granularity:e.granularity,assumedDay:!1};if(!(e.granularity!==void 0&&e.granularity!==null))return y.normalizeAnalyticsCatalogDataType(e.dataType)==="date"?{granularity:"day",assumedDay:!0}:void 0}function ae(e){const t=re(e);if(!t)return{ok:!1,error:{code:"ambiguous_temporal_grain",fieldId:e.fieldId}};let a,r,n;if(e.format!==void 0&&e.format!==null){const d=y.temporalBucketFormatSchema.safeParse(e.format);if(!d.success)a=m.AUTOMATIC_TEMPORAL_BUCKET_FORMAT,r="unsupported_pattern";else{const l=F.validateTemporalBucketFormatApplicability(d.data,t.granularity);a=l.ok?d.data:m.AUTOMATIC_TEMPORAL_BUCKET_FORMAT,l.ok||(r=l.code==="invalid_temporal_bucket_pattern"?"unsupported_pattern":"grain_incompatible_pattern",n=d.data.presentation.mode==="pattern"?d.data.presentation.pattern:d.data.presentation.mode==="preset"?d.data.presentation.preset:void 0)}}else({format:a,repairCode:r,ignoredPattern:n}=te(e,t.granularity));const i=t.assumedDay?"missing_grain_assumed_day":r;return{ok:!0,format:a,...i?{diagnostic:ee(e,i,a,n)}:{}}}var oe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function x(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ne(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var a=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};a.prototype=t.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(a,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}),a}var Y={},U={},R={exports:{}},s=String,I=function(){return{isColorSupported:!1,reset:s,bold:s,dim:s,italic:s,underline:s,inverse:s,hidden:s,strikethrough:s,black:s,red:s,green:s,yellow:s,blue:s,magenta:s,cyan:s,white:s,gray:s,bgBlack:s,bgRed:s,bgGreen:s,bgYellow:s,bgBlue:s,bgMagenta:s,bgCyan:s,bgWhite:s,blackBright:s,redBright:s,greenBright:s,yellowBright:s,blueBright:s,magentaBright:s,cyanBright:s,whiteBright:s,bgBlackBright:s,bgRedBright:s,bgGreenBright:s,bgYellowBright:s,bgBlueBright:s,bgMagentaBright:s,bgCyanBright:s,bgWhiteBright:s}};R.exports=I();R.exports.createColors=I;var ie=R.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(o,u){for(var p in u)Object.defineProperty(o,p,{enumerable:!0,get:u[p]})}t(e,{dim:function(){return d},default:function(){return l}});const a=r(ie);function r(o){return o&&o.__esModule?o:{default:o}}let n=new Set;function i(o,u,p){typeof process<"u"&&process.env.JEST_WORKER_ID||p&&n.has(p)||(p&&n.add(p),console.warn(""),u.forEach(c=>console.warn(o,"-",c)))}function d(o){return a.default.dim(o)}const l={info(o,u){i(a.default.bold(a.default.cyan("info")),...Array.isArray(o)?[o]:[u,o])},warn(o,u){i(a.default.bold(a.default.yellow("warn")),...Array.isArray(o)?[o]:[u,o])},risk(o,u){i(a.default.bold(a.default.magenta("risk")),...Array.isArray(o)?[o]:[u,o])}}})(U);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}});const t=a(U);function a(i){return i&&i.__esModule?i:{default:i}}function r({version:i,from:d,to:l}){t.default.warn(`${d}-color-renamed`,[`As of Tailwind CSS ${i}, \`${d}\` has been renamed to \`${l}\`.`,"Update your configuration file to silence this warning."])}const n={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(Y);let E=Y;var se=(E.__esModule?E:{default:E}).default;const f=x(se),de=".semaphor-scope";function fe(e){return e?e.closest(de):null}function le(e){if(!e)return"light";const t=e.dataset.semaphorTheme;return t==="dark"||t==="light"?t:e.classList.contains("dark")?"dark":"light"}const ce=!1,ue=["table","view","materialized view"],pe=["_forecast"],ge="dm",me="semaphor_calculated_fields",be="calculated_fields",ye=["lg","md","sm","xs","xxs"],he={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:M.SEMAPHOR_DEFAULT_FONT_FAMILY},dataset:{backgroundColor:[f.teal[500],f.teal[300],f.gray[700],f.gray[500],f.gray[300]],borderColor:[f.teal[500],f.teal[300],f.gray[700],f.gray[500],f.gray[300]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:w},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:4,usePointStyle:!0,pointStyle:"rectRounded",boxPadding:4},legend:{position:"top",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},scales:{y:{grid:{display:!0},title:{display:!0,text:""},beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0},title:{display:!0}}},layout:{padding:{top:-40}},borderRadius:2,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{datalables:{color:w},backgroundColor:[f.teal[500],f.teal[300],f.gray[700],f.gray[500],f.gray[300]],borderColor:[f.teal[500],f.teal[300],f.gray[700],f.gray[500],f.gray[300]]},options:{plugins:{tooltip:{backgroundColor:"#000",bodyColor:"#fff",borderWidth:.25,titleColor:"#fff",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4}},datalabels:{display:!1},scales:{x:{grid:{display:!0,color:f.slate[800]}},y:{grid:{display:!0,color:f.slate[800]}}}}}}};function w(e){var r,n,i,d,l,o,u,p,c;const t=(l=(d=(i=(n=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:n._config)==null?void 0:i.options)==null?void 0:d.plugins)==null?void 0:l.datalabels;let a=(o=e==null?void 0:e.dataset)==null?void 0:o.backgroundColor;return(t==null?void 0:t.align)==="end"&&(t==null?void 0:t.anchor)==="end"&&(a=T((u=e==null?void 0:e.chart)==null?void 0:u.canvas)),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(a=T((p=e==null?void 0:e.chart)==null?void 0:p.canvas)),L(a,{baseColor:T((c=e==null?void 0:e.chart)==null?void 0:c.canvas)})}function T(e){if(typeof document<"u"){const t=fe(e);if(t){const r=window.getComputedStyle(t).getPropertyValue("--semaphor-background").trim();return r?`hsl(${r})`:le(t)==="dark"?"#000000":"#FFFFFF"}const a=document.documentElement;if(a.classList.contains("dark"))return"#000000";if(a.classList.contains("light"))return"#FFFFFF"}return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"#000000":"#FFFFFF"}function L(e,t={}){let a=0,r=0,n=0,i=0;const d=t.baseColor?M.parseRuntimeColor(t.baseColor):null,l=b=>{if(!b)return f.gray[500];const C=M.parseRuntimeColor(b);if(!C)return f.gray[500];const _=q(C,d);a+=_.r,r+=_.g,n+=_.b,i++};if(Array.isArray(e)?e.forEach(b=>{l(b)}):l(e),i===0)return f.gray[500];const o=a/i,u=r/i,p=n/i;return(o*299+u*587+p*114)/1e3>=180?"black":"white"}function q(e,t){if(e.alpha>=1)return e;const a=t?q(t,null):Ce;return{r:e.r*e.alpha+a.r*(1-e.alpha),g:e.g*e.alpha+a.g*(1-e.alpha),b:e.b*e.alpha+a.b*(1-e.alpha)}}const Ce={r:255,g:255,b:255};function B(e,t){var n,i;if((n=e.config)!=null&&n.matrix)return e.config.matrix;const a=((i=e.dataSource)==null?void 0:i.selectedEntities)??[],r=t??(a.length===1?m.resolveDashboardEntitySource(a[0],e.dataSource):void 0);if(!r)throw new Error("Select a base dataset before configuring Matrix fields or filters.");return S.createMatrixAuthoringDraft({source:r,rows:[],columns:[],measures:[],sorts:[],rankings:[]})}function _e(e){const{spec:t,window:a,queryContext:r,reportContext:n}=e;if(!e.cardId)throw new Error("Matrix query requires its card identity.");return{cardId:e.cardId,cardType:"matrixTable",cardConfig:{matrix:{spec:t}},matrixWindowRequest:a,...V.parseMatrixRuntimeInputs({runtimeFilters:r.resolvedFilters,runtimeSorts:e.runtimeSorts}),active_filters:r.cardFilterValues,calendarContext:n.calendar,controlDefinitions:r.controlDefinitions,cardControlDefinitions:r.cardControlDefinitions,controlBindings:r.controlBindings,controlValues:r.controlValues}}function G(e){return(t,a)=>{const r=e.filter(n=>n.field.name===t.name&&!!n.field.source&&y.semaphorSourcesReferToSameDataset(n.field.source,t.source??a));return r.length===1?r[0]:void 0}}function D(e){const t=G(e);return(a,r)=>{var n;return(n=t(a,r))==null?void 0:n.resolvedField}}function Ae(e){const t=D(e);return(a,r)=>a.derivedField?void 0:t(a,r)}function N(e,t,a){if(e.derivedField)return e.derivedField.dataType;const r=a.filter(i=>!i.derivedField&&i.name===e.name&&y.semaphorSourcesReferToSameDataset(i.source??t,e.source??t));return r.length?new Set(r.map(i=>i.dataType)).size===1?r[0].dataType??e.dataType:void 0:e.dataType}function v(e,t,a){var l;const r=(l=e.config)==null?void 0:l.matrix;if(!r)return[];const n=D(a),i=(o,u,p)=>{const c=n(o,r.spec.source);return{...c,source:o.source??r.spec.source,id:u,name:o.name,label:p,dataType:N(o,r.spec.source,a.map(b=>b.field))??"unknown",qualifiedFieldName:(c==null?void 0:c.qualifiedFieldName)??o.name,entityId:(c==null?void 0:c.entityId)??"",entityName:(c==null?void 0:c.entityName)??"",entityType:(c==null?void 0:c.entityType)??"table",...o.derivedField?{derivedField:o.derivedField}:{}}},d=t==="groupBy"?"rows":t==="pivotBy"?"columns":void 0;return d?r.spec[d].map(o=>({...i(o.field,o.id,S.getMatrixLevelLabel(o,r.presentation)),granularity:o.grain,role:d==="rows"?"groupby":"pivotby"})):t!=="metrics"?[]:r.spec.measures.map(o=>({...i(o.kind==="aggregate"?o.field:{name:o.definition.name,derivedField:o.definition},o.id,S.getMatrixMeasureLabel(o,r.presentation)),role:"metric",...o.kind==="aggregate"?{aggregate:o.aggregate}:{}}))}function j(e){return Q.inspectMatrixCardConfig(e,{authoringDraft:!0})}function K(e){return e.type!=="matrixTable"}function k(e){var t,a,r,n;return{rows:((t=e.config)==null?void 0:t.groupByColumns)??[],columns:((a=e.config)==null?void 0:a.pivotByColumns)??[],metrics:((r=e.config)==null?void 0:r.metricColumns)??[],details:((n=e.config)==null?void 0:n.detailColumns)??[]}}function h(e,t=[]){var i,d,l,o,u,p,c,b;if(K(e)){const C=k(e);return{kind:"shelf",status:e.config?"ready":"absent",fields:C,filters:(i=e.config)==null?void 0:i.filters,joinPlan:(d=e.config)==null?void 0:d.joinPlan,configured:Object.values(C).some(_=>_.length>0),supportsSql:!0}}const a=j(e),r=a.status==="ready"?a.config:void 0,n={config:{matrix:r}};return{kind:"matrix",status:a.status,matrix:r,error:a.status==="invalid"?a.error:void 0,get fields(){return r?{rows:v(n,"groupBy",t),columns:v(n,"pivotBy",t),metrics:v(n,"metrics",t),details:[]}:{rows:[],columns:[],metrics:[],details:[]}},filters:(u=(o=(l=e.config)==null?void 0:l.matrix)==null?void 0:o.spec)==null?void 0:u.filters,joinPlan:(b=(c=(p=e.config)==null?void 0:p.matrix)==null?void 0:c.spec)==null?void 0:b.joinPlan,get configured(){return y.matrixConfigSchema.safeParse(r).success},supportsSql:!1}}function Te(e){return e?Object.values(k({config:e})).some(t=>t.length>0):!1}function ve(e){return h({type:e}).supportsSql}function Ee(e,t){return e.type!==t&&(e.type==="matrixTable"||t==="matrixTable")?{config:{},controlBindings:[],sql:"",python:""}:{}}function Fe(e,t){var n,i;const a=e.type==="matrixTable"?(i=(n=e.config)==null?void 0:n.matrix)==null?void 0:i.spec.source:void 0;return!a||(t.selectedEntities??[]).some(d=>{const l=m.resolveDashboardEntitySource(d,t);return l&&y.semaphorSourcesReferToSameDataset(a,l)})?{dataSource:t}:{dataSource:t,config:{},controlBindings:[]}}function Me(e){return h(e).joinPlan}function Se(e,t){var i;if(e.type!=="matrixTable")return{...e.config,joinPlan:t};const a=(i=e.config)==null?void 0:i.matrix,r=t?m.resolveDashboardEntitySource(t.baseEntity,e.dataSource):a==null?void 0:a.spec.source;if(!r){if(!t)return e.config??{};throw new Error("Matrix joins require a configured base source.")}const n=B(e,r);return{matrix:{...n,spec:{...n.spec,source:r,joinPlan:t}}}}function we(e){return e?h(e).filters:void 0}function Re(e,t){var r;if(e.type!=="matrixTable")return{...e.config,filters:t};if(!t&&!((r=e.config)!=null&&r.matrix))return e.config??{};const a=B(e);return{matrix:{...a,spec:{...a.spec,filters:t}}}}function W(e,t){return e?t?h({type:t,config:e}).configured:Te(e):!1}function Be(e,t){var d,l,o;if(t!=null&&t.skipSetupCheck||e.type==="text")return!1;const a=h(e);if(!a.supportsSql)return!a.configured;if((d=e.customCardPreferences)!=null&&d.url)return!1;const r=!!(e.connectionId||(l=e.dataSource)!=null&&l.connectionId),n=!!((o=e.sql)!=null&&o.trim()),i=W(e.config);return!r||!i&&!n}exports.BREAKPOINTS=ye;exports.CALCULATED_FIELDS_GROUP_ID=me;exports.CALCULATED_FIELDS_GROUP_NAME=be;exports.DATABASE_ENTITY_TYPES=ue;exports.DATAMODEL_NAMESPCACE=ge;exports.DEFAULT_STYLE=he;exports.METADATA_KEYS=pe;exports.buildMatrixCardQueryPayload=_e;exports.colors=f;exports.commonjsGlobal=oe;exports.createMatrixCatalogResolver=G;exports.createMatrixFieldResolver=D;exports.createMatrixInteractionFieldResolver=Ae;exports.getAugmentedNamespace=ne;exports.getAuthoredCardFilters=we;exports.getAuthoredCardJoinPlan=Me;exports.getCanvasBackgroundColor=T;exports.getCardDefinition=h;exports.getContrastColor=L;exports.getDatalabelColor=w;exports.getDefaultExportFromCjs=x;exports.hasSavedTemporalBucketPresentation=X;exports.hasValidCardConfig=W;exports.initializeMatrixCardDraft=B;exports.isCardUnconfigured=Be;exports.isDevEnv=ce;exports.isShelfCard=K;exports.matrixAuthoringDataType=N;exports.matrixEditorFields=v;exports.readMatrixEditorConfig=j;exports.readSavedTemporalBucketFormat=ae;exports.readShelfCardFields=k;exports.resetMatrixRepresentation=Ee;exports.supportsSqlEditor=ve;exports.v4=Z;exports.withAuthoredCardDataSource=Fe;exports.withAuthoredCardFilters=Re;exports.withAuthoredCardJoinPlan=Se;
|