react-semaphor 0.1.425 → 0.1.427

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/analytics-protocol/index.cjs +1 -1
  3. package/dist/analytics-protocol/index.js +42 -39
  4. package/dist/brand-studio/index.cjs +1 -1
  5. package/dist/brand-studio/index.js +1 -1
  6. package/dist/chunks/{calendar-preferences-dialog-DJwV0aqn.js → calendar-preferences-dialog-DE4tk3t3.js} +2 -2
  7. package/dist/chunks/{calendar-preferences-dialog-BLaSWhLl.js → calendar-preferences-dialog-DuGX1NPV.js} +1 -1
  8. package/dist/chunks/{catalog-field-grounding-DcxPLns0.js → catalog-field-grounding-AOGwWu0K.js} +2 -2
  9. package/dist/chunks/code-editor-BoowcKU0.js +138 -0
  10. package/dist/chunks/{code-editor-Bkk7s8hI.js → code-editor-CojfM3qp.js} +6564 -6293
  11. package/dist/chunks/{comparison-document-migration-CQJ0DZlL.js → comparison-document-migration-BJH1idOd.js} +1 -1
  12. package/dist/chunks/{comparison-document-migration-Db64RWYD.js → comparison-document-migration-b6c3xiWh.js} +1 -1
  13. package/dist/chunks/{dashboard-5agU0G_D.js → dashboard-DSxho2LN.js} +51313 -50489
  14. package/dist/chunks/{dashboard-briefing-launcher-qyEVfuOm.js → dashboard-briefing-launcher-BFIw5BOf.js} +4 -4
  15. package/dist/chunks/{dashboard-briefing-launcher-CII8-4qo.js → dashboard-briefing-launcher-CguxcHIl.js} +1 -1
  16. package/dist/chunks/{dashboard-controls-PJpeYZHw.js → dashboard-controls-Cl0LagTr.js} +8 -8
  17. package/dist/chunks/{dashboard-controls-aJY0FNPP.js → dashboard-controls-jD-HpCNK.js} +529 -524
  18. package/dist/chunks/dashboard-date-comparison-definition-BaYxjLi5.js +167 -0
  19. package/dist/chunks/dashboard-date-comparison-definition-DGZr3m-b.js +1 -0
  20. package/dist/chunks/{dashboard-json-DtmR5yCf.js → dashboard-json-7mpQsizF.js} +1 -1
  21. package/dist/chunks/{dashboard-json-CzHSP6Fa.js → dashboard-json-BovTt0uu.js} +3 -3
  22. package/dist/chunks/dashboard-ogxedhSY.js +1402 -0
  23. package/dist/chunks/edit-dashboard-visual-B7wLrHeF.js +182 -0
  24. package/dist/chunks/{edit-dashboard-visual-AkZzwBCV.js → edit-dashboard-visual-dlm8F_Qu.js} +4649 -4595
  25. package/dist/chunks/metric-comparison-BKgkMy9r.js +1 -0
  26. package/dist/chunks/metric-comparison-CWweq9RG.js +387 -0
  27. package/dist/chunks/{use-create-flow-overlay-state-ByOKVV2K.js → use-create-flow-overlay-state-BU0ROMSm.js} +2 -2
  28. package/dist/chunks/{use-create-flow-overlay-state-DmuReEnk.js → use-create-flow-overlay-state-kbl6avDY.js} +1 -1
  29. package/dist/dashboard/index.cjs +1 -1
  30. package/dist/dashboard/index.js +1 -1
  31. package/dist/dashboard-authoring/index.cjs +1 -1
  32. package/dist/dashboard-authoring/index.js +3 -3
  33. package/dist/data-app-builder/index.cjs +1 -1
  34. package/dist/data-app-builder/index.js +2 -2
  35. package/dist/data-app-sdk-validation/index.js +1 -1
  36. package/dist/index.cjs +1 -1
  37. package/dist/index.js +6 -6
  38. package/dist/style.css +1 -1
  39. package/dist/surfboard/index.cjs +1 -1
  40. package/dist/surfboard/index.js +2 -2
  41. package/dist/types/analytics-protocol.d.ts +40 -2
  42. package/dist/types/dashboard.d.ts +25 -0
  43. package/dist/types/main.d.ts +54 -5
  44. package/dist/types/surfboard.d.ts +25 -0
  45. package/dist/types/types.d.ts +43 -0
  46. package/package.json +1 -1
  47. package/dist/chunks/code-editor-CkXyNgYc.js +0 -138
  48. package/dist/chunks/dashboard-MKIqgGDp.js +0 -1402
  49. package/dist/chunks/edit-dashboard-visual-Cif6uDqN.js +0 -182
  50. package/dist/chunks/metric-comparison-4oA4ouU9.js +0 -354
  51. package/dist/chunks/metric-comparison-nQKquVnx.js +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
+ - Dashboard chrome can now be hidden per token with `config.showDashboardHub`,
12
+ `config.showDashboardSharing`, and `config.showGroupManagement`. These flags
13
+ only narrow existing permissions and default to the current visible behavior
14
+ when omitted.
15
+
11
16
  - **Visual refresh — default palette and radius aligned with semaphor-app.** The shipped `--semaphor-*` CSS variable *values* in `src/components/index.css` now mirror the zinc-based design tokens used by the main Semaphor app. Variable names, selector prefixing (`.semaphor-scope`), and the public API are unchanged — only the default values differ.
12
17
 
13
18
  Light mode:
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../chunks/operators-DrTQsJXv.js"),m=require("../chunks/validators-B4VMLX3_.js"),a=require("../chunks/analyze-result-contract-ege_u6Nl.js"),o=require("../chunks/catalog-field-grounding-Bnx-3tE0.js"),l=require("../chunks/metric-comparison-nQKquVnx.js"),p=require("../chunks/dashboard-input-contract-DV3cshjz.js");function A(e,t={}){const i=b(e),r={connectionId:t.connectionId,connectionType:e,path:["database","schema","table"],labels:{database:"Database",schema:"Schema",table:"Table"},prefixLevels:["database","schema","table"],dialect:"postgres",supportsFilterClause:!0};return i.includes("postgres")?{...r,prefixLevels:["schema","table"],dialect:"postgres"}:i.includes("mysql")?{...r,prefixLevels:["database","table"],dialect:"mysql",supportsFilterClause:!1}:i.includes("mssql")||i.includes("sqlserver")?{...r,dialect:"mssql",supportsFilterClause:!1}:i.includes("redshift")?{...r,prefixLevels:["schema","table"],dialect:"redshift"}:i.includes("snowflake")?{...r,dialect:"snowflake"}:i.includes("clickhouse")?{connectionId:t.connectionId,connectionType:e,path:["database","table"],labels:{database:"Database",table:"Table"},prefixLevels:["database","table"],dialect:"clickhouse",supportsFilterClause:!1}:i==="s3"||i==="api"?{connectionId:t.connectionId,connectionType:e,path:["table"],labels:{table:i==="api"?"API Table":"File Table"},prefixLevels:["table"],dialect:"duckdb",supportsFilterClause:!0}:i==="googlesheets"||i==="fileupload"?{connectionId:t.connectionId,connectionType:e,path:["table"],labels:{table:"Table"},prefixLevels:["table"],dialect:"postgres",supportsFilterClause:!0}:i==="s3tables"?{...r,labels:{database:"Database",schema:"Namespace",table:"Table"},dialect:"duckdb"}:i==="bigquery"?{...r,labels:{database:"Project",schema:"Dataset",table:"Table"},prefixLevels:["schema","table"],dialect:"bigquery",supportsFilterClause:!1}:r}function y(e){const t=b(e);switch(t){case"mysql":case"bigquery":case"redshift":case"snowflake":case"clickhouse":case"duckdb":case"sqlite":return t;case"mssql":case"sqlserver":return"mssql";case"postgres":case"postgresql":return"postgres";default:return"unknown"}}function R(e){return e.capabilities.prefixLevels.every(t=>!!g(e.source,t))}function C(e){const t=e.quoteIdentifier??v;return e.capabilities.prefixLevels.map(i=>g(e.source,i)).filter(i=>!!i).map(i=>t(i,e.capabilities.dialect)).join(".")}function g(e,t){return t==="database"?e.databaseName:t==="schema"?e.schemaName:e.tableName}function v(e,t){return t==="mysql"||t==="bigquery"||t==="clickhouse"||t==="duckdb"?`\`${e.replace(/`/g,"``")}\``:t==="mssql"?`[${e.replace(/]/g,"]]")}]`:`"${e.replace(/"/g,'""')}"`}function b(e){if(typeof e!="string")return"";const t=[];for(const i of e.trim().toLowerCase())I(i)&&t.push(i);return t.join("")}function I(e){const t=e.charCodeAt(0);return t>=48&&t<=57||t>=97&&t<=122}const u={kind:"semantic",domainId:"domain_sales",datasetName:"orders",connectionId:"conn_sales",label:"Orders"},_={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"}]}},T={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 S(e){return!!(e.name.trim()&&a.hasCompleteSemaphorSourceIdentity(e.source)&&(e.role==="date"||e.dataType==="date"||e.dataType==="datetime"))}function h(e){return e.filter((t,i)=>e.findIndex(r=>a.semaphorFieldRefsMatch(t.field,r.field))===i)}function F(e){return new Set(e.map(a.semaphorSourceIdentityKey).filter(Boolean)).size}function D(e){const t=h(e.candidates.filter(s=>s.kind==="visible_axis")),i=h(e.candidates.filter(s=>s.kind==="explicit_hidden"));if([...t,...i].some(s=>!S(s.field)))return"invalid";if(t.length>1||i.length>1)return"ambiguous";const r=t[0],d=i[0];if(r)return d&&!a.semaphorFieldRefsMatch(r.field,d.field)?"invalid":r;if(d)return d;if(F(e.querySources??[])>1)return"ambiguous";const c=h(e.candidates.filter(s=>s.kind==="semantic_primary"));return c.some(s=>!S(s.field))?"invalid":c.length>1?"ambiguous":c[0]??"missing"}function M(e){const t=new Date(e.startInclusive),i=new Date(e.endExclusive);return e.timezone.trim()?Number.isFinite(t.getTime())&&Number.isFinite(i.getTime())&&t.getTime()<i.getTime():!1}function E(e){const t=e.ranges??[];if(e.rawSql)return{status:"unavailable",reason:"unsupported_raw_sql",constraints:t};if((e.querySources??[]).some(n=>!a.hasCompleteSemaphorSourceIdentity(n))||t.some(n=>!S(n.field)))return{status:"unavailable",reason:"temporal_binding_invalid",constraints:t};const i=D(e);if(typeof i=="string")return{status:"unavailable",reason:`temporal_binding_${i}`,constraints:t};const r=t.filter(n=>a.semaphorFieldRefsMatch(n.field,i.field));if(r.some(n=>!M(n.window)))return{status:"unavailable",reason:"temporal_binding_invalid",constraints:t};const d=r.filter(n=>n.source==="global_date"),c=r.filter(n=>n.source==="card");if(d.length>1||d.length===0&&c.length>1)return{status:"unavailable",reason:"temporal_binding_ambiguous",constraints:t};const s=d[0]??c[0];return{status:"resolved",field:i.field,bindingSource:i.kind,...s?{currentWindow:s.window,governingWindowSource:s.source,governingRangeId:s.id}:{},constraints:t.filter(n=>!a.semaphorFieldRefsMatch(n.field,i.field))}}exports.normalizeSemaphorAnalyticsFilterOperator=f.normalizeSemaphorAnalyticsFilterOperator;exports.normalizeSemaphorInputOperator=f.normalizeSemaphorInputOperator;exports.parseSemaphorIsoInstant=m.parseSemaphorIsoInstant;exports.parseSemaphorIsoTimeWindowBoundary=m.parseSemaphorIsoTimeWindowBoundary;exports.validateSemaphorAnalyticsIntent=m.validateSemaphorAnalyticsIntent;exports.validateSemaphorAnalyticsRecoveryPlan=m.validateSemaphorAnalyticsRecoveryPlan;exports.validateSemaphorDashboardIntent=m.validateSemaphorDashboardIntent;exports.validateSemaphorDerivedFieldDefinition=m.validateSemaphorDerivedFieldDefinition;exports.validateSemaphorOperationIntent=m.validateSemaphorOperationIntent;exports.validateSemaphorResultCalculation=m.validateSemaphorResultCalculation;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.getSemaphorAnalyzeResultFieldNames=a.getSemaphorAnalyzeResultFieldNames;exports.hasCompleteSemaphorSourceIdentity=a.hasCompleteSemaphorSourceIdentity;exports.isSemaphorAnalyzeResultFieldName=a.isSemaphorAnalyzeResultFieldName;exports.isSemaphorDataAppCodegenSummary=a.isSemaphorDataAppCodegenSummary;exports.mergeSemaphorSourcesByIdentity=a.mergeSemaphorSourcesByIdentity;exports.parseSemaphorAnalyzeResult=a.parseSemaphorAnalyzeResult;exports.preferSemaphorFieldRefMetadata=a.preferSemaphorFieldRefMetadata;exports.preferSemaphorSourceMetadata=a.preferSemaphorSourceMetadata;exports.semaphorAnalyticsCoverageSchema=a.semaphorAnalyticsCoverageSchema;exports.semaphorAnalyticsDiagnosticFeedbackSchema=a.semaphorAnalyticsDiagnosticFeedbackSchema;exports.semaphorAnalyticsExecutionResultSchema=a.semaphorAnalyticsExecutionResultSchema;exports.semaphorAnalyticsPopulationSchema=a.semaphorAnalyticsPopulationSchema;exports.semaphorAnalyticsResultSchema=a.semaphorAnalyticsResultSchema;exports.semaphorAnalyticsValidationIssueSchema=a.semaphorAnalyticsValidationIssueSchema;exports.semaphorAnalyticsValidationResultSchema=a.semaphorAnalyticsValidationResultSchema;exports.semaphorAnalyzeResultSchema=a.semaphorAnalyzeResultSchema;exports.semaphorAnalyzeResultShape=a.semaphorAnalyzeResultShape;exports.semaphorDataAppCodegenSummarySchema=a.semaphorDataAppCodegenSummarySchema;exports.semaphorDerivedFieldDefinitionSchema=a.semaphorDerivedFieldDefinitionSchema;exports.semaphorExecutionFieldRefSchema=a.semaphorExecutionFieldRefSchema;exports.semaphorFieldRefSchema=a.semaphorFieldRefSchema;exports.semaphorFieldRefsMatch=a.semaphorFieldRefsMatch;exports.semaphorInputOptionsResultSchema=a.semaphorInputOptionsResultSchema;exports.semaphorMatrixResultSchema=a.semaphorMatrixResultSchema;exports.semaphorMetricAggregate=a.semaphorMetricAggregate;exports.semaphorMetricMeasureBindingKey=a.semaphorMetricMeasureBindingKey;exports.semaphorMetricResultSchema=a.semaphorMetricResultSchema;exports.semaphorPhysicalSourceRefSchema=a.semaphorPhysicalSourceRefSchema;exports.semaphorRecordsResultSchema=a.semaphorRecordsResultSchema;exports.semaphorRelationshipDiagnosticsSchema=a.semaphorRelationshipDiagnosticsSchema;exports.semaphorResultColumnSchema=a.semaphorResultColumnSchema;exports.semaphorSemanticSourceRefSchema=a.semaphorSemanticSourceRefSchema;exports.semaphorSourceIdentityKey=a.semaphorSourceIdentityKey;exports.semaphorSourceRefSchema=a.semaphorSourceRefSchema;exports.semaphorSourcesReferToSameDataset=a.semaphorSourcesReferToSameDataset;exports.semaphorSqlResultSchema=a.semaphorSqlResultSchema;exports.semaphorSqlSourceRefSchema=a.semaphorSqlSourceRefSchema;exports.validateSemaphorDataAppCodegenSummary=a.validateSemaphorDataAppCodegenSummary;exports.buildAnalyticsCatalogFieldSummary=o.buildAnalyticsCatalogFieldSummary;exports.getAnalyticsCatalogFieldCandidates=o.getAnalyticsCatalogFieldCandidates;exports.getAnalyticsCatalogFieldName=o.getAnalyticsCatalogFieldName;exports.isAnalyticsCatalogDateField=o.isAnalyticsCatalogDateField;exports.isAnalyticsCatalogDimensionField=o.isAnalyticsCatalogDimensionField;exports.isAnalyticsCatalogMetricField=o.isAnalyticsCatalogMetricField;exports.isAnalyticsDateLikeDataType=o.isAnalyticsDateLikeDataType;exports.isAnalyticsMetricIdentifierField=o.isAnalyticsMetricIdentifierField;exports.isAnalyticsTechnicalIdentifierField=o.isAnalyticsTechnicalIdentifierField;exports.normalizeAnalyticsCatalogDataType=o.normalizeAnalyticsCatalogDataType;exports.normalizeAnalyticsCatalogName=o.normalizeAnalyticsCatalogName;exports.COMPARISON_PRESENTATION_DEFAULTS=l.COMPARISON_PRESENTATION_DEFAULTS;exports.DEFAULT_METRIC_COMPARISON_POLARITY=l.DEFAULT_METRIC_COMPARISON_POLARITY;exports.evaluateMetricComparison=l.evaluateMetricComparison;exports.resolveMetricComparisonRequest=l.resolveMetricComparisonRequest;exports.resolveMetricResultAlias=l.resolveMetricResultAlias;exports.validateComparisonPresentationSpec=l.validateComparisonPresentationSpec;exports.validateGlobalDateComparisonContext=l.validateGlobalDateComparisonContext;exports.validateGlobalDateComparisonSelection=l.validateGlobalDateComparisonSelection;exports.validateMetricComparisonConfig=l.validateMetricComparisonConfig;exports.validateMetricComparisonPolarity=l.validateMetricComparisonPolarity;exports.validateMetricComparisonSpec=l.validateMetricComparisonSpec;exports.getCardControlCompatInputId=p.getCardControlCompatInputId;exports.getCardInlineFilterCompatInputId=p.getCardInlineFilterCompatInputId;exports.getDashboardControlCompatInputId=p.getDashboardControlCompatInputId;exports.getDashboardFilterCompatInputId=p.getDashboardFilterCompatInputId;exports.SEMAPHOR_ANALYTICS_INTENT_FIXTURES=_;exports.TEMPORAL_CONTEXT_ADAPTER_PARITY_FIXTURES=T;exports.buildSemaphorQualifiedSourcePath=C;exports.getSemaphorConnectionCapabilities=A;exports.normalizeSemaphorDialect=y;exports.resolveTemporalContext=E;exports.semaphorSourceHasRequiredCoordinates=R;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../chunks/operators-DrTQsJXv.js"),m=require("../chunks/validators-B4VMLX3_.js"),a=require("../chunks/analyze-result-contract-ege_u6Nl.js"),n=require("../chunks/catalog-field-grounding-Bnx-3tE0.js"),l=require("../chunks/metric-comparison-BKgkMy9r.js"),p=require("../chunks/dashboard-date-comparison-definition-DGZr3m-b.js"),h=require("../chunks/dashboard-input-contract-DV3cshjz.js");function A(e,t={}){const i=C(e),r={connectionId:t.connectionId,connectionType:e,path:["database","schema","table"],labels:{database:"Database",schema:"Schema",table:"Table"},prefixLevels:["database","schema","table"],dialect:"postgres",supportsFilterClause:!0};return i.includes("postgres")?{...r,prefixLevels:["schema","table"],dialect:"postgres"}:i.includes("mysql")?{...r,prefixLevels:["database","table"],dialect:"mysql",supportsFilterClause:!1}:i.includes("mssql")||i.includes("sqlserver")?{...r,dialect:"mssql",supportsFilterClause:!1}:i.includes("redshift")?{...r,prefixLevels:["schema","table"],dialect:"redshift"}:i.includes("snowflake")?{...r,dialect:"snowflake"}:i.includes("clickhouse")?{connectionId:t.connectionId,connectionType:e,path:["database","table"],labels:{database:"Database",table:"Table"},prefixLevels:["database","table"],dialect:"clickhouse",supportsFilterClause:!1}:i==="s3"||i==="api"?{connectionId:t.connectionId,connectionType:e,path:["table"],labels:{table:i==="api"?"API Table":"File Table"},prefixLevels:["table"],dialect:"duckdb",supportsFilterClause:!0}:i==="googlesheets"||i==="fileupload"?{connectionId:t.connectionId,connectionType:e,path:["table"],labels:{table:"Table"},prefixLevels:["table"],dialect:"postgres",supportsFilterClause:!0}:i==="s3tables"?{...r,labels:{database:"Database",schema:"Namespace",table:"Table"},dialect:"duckdb"}:i==="bigquery"?{...r,labels:{database:"Project",schema:"Dataset",table:"Table"},prefixLevels:["schema","table"],dialect:"bigquery",supportsFilterClause:!1}:r}function y(e){const t=C(e);switch(t){case"mysql":case"bigquery":case"redshift":case"snowflake":case"clickhouse":case"duckdb":case"sqlite":return t;case"mssql":case"sqlserver":return"mssql";case"postgres":case"postgresql":return"postgres";default:return"unknown"}}function R(e){return e.capabilities.prefixLevels.every(t=>!!g(e.source,t))}function v(e){const t=e.quoteIdentifier??I;return e.capabilities.prefixLevels.map(i=>g(e.source,i)).filter(i=>!!i).map(i=>t(i,e.capabilities.dialect)).join(".")}function g(e,t){return t==="database"?e.databaseName:t==="schema"?e.schemaName:e.tableName}function I(e,t){return t==="mysql"||t==="bigquery"||t==="clickhouse"||t==="duckdb"?`\`${e.replace(/`/g,"``")}\``:t==="mssql"?`[${e.replace(/]/g,"]]")}]`:`"${e.replace(/"/g,'""')}"`}function C(e){if(typeof e!="string")return"";const t=[];for(const i of e.trim().toLowerCase())_(i)&&t.push(i);return t.join("")}function _(e){const t=e.charCodeAt(0);return t>=48&&t<=57||t>=97&&t<=122}const u={kind:"semantic",domainId:"domain_sales",datasetName:"orders",connectionId:"conn_sales",label:"Orders"},D={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"}]}},T={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 f(e){return!!(e.name.trim()&&a.hasCompleteSemaphorSourceIdentity(e.source)&&(e.role==="date"||e.dataType==="date"||e.dataType==="datetime"))}function S(e){return e.filter((t,i)=>e.findIndex(r=>a.semaphorFieldRefsMatch(t.field,r.field))===i)}function F(e){return new Set(e.map(a.semaphorSourceIdentityKey).filter(Boolean)).size}function M(e){const t=S(e.candidates.filter(s=>s.kind==="visible_axis")),i=S(e.candidates.filter(s=>s.kind==="explicit_hidden"));if([...t,...i].some(s=>!f(s.field)))return"invalid";if(t.length>1||i.length>1)return"ambiguous";const r=t[0],d=i[0];if(r)return d&&!a.semaphorFieldRefsMatch(r.field,d.field)?"invalid":r;if(d)return d;if(F(e.querySources??[])>1)return"ambiguous";const c=S(e.candidates.filter(s=>s.kind==="semantic_primary"));return c.some(s=>!f(s.field))?"invalid":c.length>1?"ambiguous":c[0]??"missing"}function E(e){const t=new Date(e.startInclusive),i=new Date(e.endExclusive);return e.timezone.trim()?Number.isFinite(t.getTime())&&Number.isFinite(i.getTime())&&t.getTime()<i.getTime():!1}function O(e){const t=e.ranges??[];if(e.rawSql)return{status:"unavailable",reason:"unsupported_raw_sql",constraints:t};if((e.querySources??[]).some(o=>!a.hasCompleteSemaphorSourceIdentity(o))||t.some(o=>!f(o.field)))return{status:"unavailable",reason:"temporal_binding_invalid",constraints:t};const i=M(e);if(typeof i=="string")return{status:"unavailable",reason:`temporal_binding_${i}`,constraints:t};const r=t.filter(o=>a.semaphorFieldRefsMatch(o.field,i.field));if(r.some(o=>!E(o.window)))return{status:"unavailable",reason:"temporal_binding_invalid",constraints:t};const d=r.filter(o=>o.source==="global_date"),c=r.filter(o=>o.source==="card");if(d.length>1||d.length===0&&c.length>1)return{status:"unavailable",reason:"temporal_binding_ambiguous",constraints:t};const s=d[0]??c[0];return{status:"resolved",field:i.field,bindingSource:i.kind,...s?{currentWindow:s.window,governingWindowSource:s.source,governingRangeId:s.id}:{},constraints:t.filter(o=>o.id!==(s==null?void 0:s.id))}}exports.normalizeSemaphorAnalyticsFilterOperator=b.normalizeSemaphorAnalyticsFilterOperator;exports.normalizeSemaphorInputOperator=b.normalizeSemaphorInputOperator;exports.parseSemaphorIsoInstant=m.parseSemaphorIsoInstant;exports.parseSemaphorIsoTimeWindowBoundary=m.parseSemaphorIsoTimeWindowBoundary;exports.validateSemaphorAnalyticsIntent=m.validateSemaphorAnalyticsIntent;exports.validateSemaphorAnalyticsRecoveryPlan=m.validateSemaphorAnalyticsRecoveryPlan;exports.validateSemaphorDashboardIntent=m.validateSemaphorDashboardIntent;exports.validateSemaphorDerivedFieldDefinition=m.validateSemaphorDerivedFieldDefinition;exports.validateSemaphorOperationIntent=m.validateSemaphorOperationIntent;exports.validateSemaphorResultCalculation=m.validateSemaphorResultCalculation;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.getSemaphorAnalyzeResultFieldNames=a.getSemaphorAnalyzeResultFieldNames;exports.hasCompleteSemaphorSourceIdentity=a.hasCompleteSemaphorSourceIdentity;exports.isSemaphorAnalyzeResultFieldName=a.isSemaphorAnalyzeResultFieldName;exports.isSemaphorDataAppCodegenSummary=a.isSemaphorDataAppCodegenSummary;exports.mergeSemaphorSourcesByIdentity=a.mergeSemaphorSourcesByIdentity;exports.parseSemaphorAnalyzeResult=a.parseSemaphorAnalyzeResult;exports.preferSemaphorFieldRefMetadata=a.preferSemaphorFieldRefMetadata;exports.preferSemaphorSourceMetadata=a.preferSemaphorSourceMetadata;exports.semaphorAnalyticsCoverageSchema=a.semaphorAnalyticsCoverageSchema;exports.semaphorAnalyticsDiagnosticFeedbackSchema=a.semaphorAnalyticsDiagnosticFeedbackSchema;exports.semaphorAnalyticsExecutionResultSchema=a.semaphorAnalyticsExecutionResultSchema;exports.semaphorAnalyticsPopulationSchema=a.semaphorAnalyticsPopulationSchema;exports.semaphorAnalyticsResultSchema=a.semaphorAnalyticsResultSchema;exports.semaphorAnalyticsValidationIssueSchema=a.semaphorAnalyticsValidationIssueSchema;exports.semaphorAnalyticsValidationResultSchema=a.semaphorAnalyticsValidationResultSchema;exports.semaphorAnalyzeResultSchema=a.semaphorAnalyzeResultSchema;exports.semaphorAnalyzeResultShape=a.semaphorAnalyzeResultShape;exports.semaphorDataAppCodegenSummarySchema=a.semaphorDataAppCodegenSummarySchema;exports.semaphorDerivedFieldDefinitionSchema=a.semaphorDerivedFieldDefinitionSchema;exports.semaphorExecutionFieldRefSchema=a.semaphorExecutionFieldRefSchema;exports.semaphorFieldRefSchema=a.semaphorFieldRefSchema;exports.semaphorFieldRefsMatch=a.semaphorFieldRefsMatch;exports.semaphorInputOptionsResultSchema=a.semaphorInputOptionsResultSchema;exports.semaphorMatrixResultSchema=a.semaphorMatrixResultSchema;exports.semaphorMetricAggregate=a.semaphorMetricAggregate;exports.semaphorMetricMeasureBindingKey=a.semaphorMetricMeasureBindingKey;exports.semaphorMetricResultSchema=a.semaphorMetricResultSchema;exports.semaphorPhysicalSourceRefSchema=a.semaphorPhysicalSourceRefSchema;exports.semaphorRecordsResultSchema=a.semaphorRecordsResultSchema;exports.semaphorRelationshipDiagnosticsSchema=a.semaphorRelationshipDiagnosticsSchema;exports.semaphorResultColumnSchema=a.semaphorResultColumnSchema;exports.semaphorSemanticSourceRefSchema=a.semaphorSemanticSourceRefSchema;exports.semaphorSourceIdentityKey=a.semaphorSourceIdentityKey;exports.semaphorSourceRefSchema=a.semaphorSourceRefSchema;exports.semaphorSourcesReferToSameDataset=a.semaphorSourcesReferToSameDataset;exports.semaphorSqlResultSchema=a.semaphorSqlResultSchema;exports.semaphorSqlSourceRefSchema=a.semaphorSqlSourceRefSchema;exports.validateSemaphorDataAppCodegenSummary=a.validateSemaphorDataAppCodegenSummary;exports.buildAnalyticsCatalogFieldSummary=n.buildAnalyticsCatalogFieldSummary;exports.getAnalyticsCatalogFieldCandidates=n.getAnalyticsCatalogFieldCandidates;exports.getAnalyticsCatalogFieldName=n.getAnalyticsCatalogFieldName;exports.isAnalyticsCatalogDateField=n.isAnalyticsCatalogDateField;exports.isAnalyticsCatalogDimensionField=n.isAnalyticsCatalogDimensionField;exports.isAnalyticsCatalogMetricField=n.isAnalyticsCatalogMetricField;exports.isAnalyticsDateLikeDataType=n.isAnalyticsDateLikeDataType;exports.isAnalyticsMetricIdentifierField=n.isAnalyticsMetricIdentifierField;exports.isAnalyticsTechnicalIdentifierField=n.isAnalyticsTechnicalIdentifierField;exports.normalizeAnalyticsCatalogDataType=n.normalizeAnalyticsCatalogDataType;exports.normalizeAnalyticsCatalogName=n.normalizeAnalyticsCatalogName;exports.COMPARISON_PRESENTATION_DEFAULTS=l.COMPARISON_PRESENTATION_DEFAULTS;exports.DEFAULT_METRIC_COMPARISON_POLARITY=l.DEFAULT_METRIC_COMPARISON_POLARITY;exports.evaluateMetricComparison=l.evaluateMetricComparison;exports.resolveMetricComparisonRequest=l.resolveMetricComparisonRequest;exports.resolveMetricResultAlias=l.resolveMetricResultAlias;exports.validateComparisonPresentationSpec=l.validateComparisonPresentationSpec;exports.validateGlobalDateComparisonContext=l.validateGlobalDateComparisonContext;exports.validateGlobalDateComparisonSelection=l.validateGlobalDateComparisonSelection;exports.validateMetricComparisonConfig=l.validateMetricComparisonConfig;exports.validateMetricComparisonPolarity=l.validateMetricComparisonPolarity;exports.validateMetricComparisonSpec=l.validateMetricComparisonSpec;exports.isComparisonCapableDashboardDateInputDefinition=p.isComparisonCapableDashboardDateInputDefinition;exports.resolveDashboardDateComparisonFilterDefinition=p.resolveDashboardDateComparisonFilterDefinition;exports.resolveDashboardDateComparisonInputDefinition=p.resolveDashboardDateComparisonInputDefinition;exports.semanticDatasetMatchesFieldCoordinates=p.semanticDatasetMatchesFieldCoordinates;exports.getCardControlCompatInputId=h.getCardControlCompatInputId;exports.getCardInlineFilterCompatInputId=h.getCardInlineFilterCompatInputId;exports.getDashboardControlCompatInputId=h.getDashboardControlCompatInputId;exports.getDashboardFilterCompatInputId=h.getDashboardFilterCompatInputId;exports.SEMAPHOR_ANALYTICS_INTENT_FIXTURES=D;exports.TEMPORAL_CONTEXT_ADAPTER_PARITY_FIXTURES=T;exports.buildSemaphorQualifiedSourcePath=v;exports.getSemaphorConnectionCapabilities=A;exports.normalizeSemaphorDialect=y;exports.resolveTemporalContext=O;exports.semaphorSourceHasRequiredCoordinates=R;
@@ -1,11 +1,12 @@
1
- import { a as M, n as E } from "../chunks/operators-C8TxpM4C.js";
1
+ import { a as q, n as E } from "../chunks/operators-C8TxpM4C.js";
2
2
  import { p as O, a as N, v as L, b as P, c as w, d as z, e as B, f as U } from "../chunks/validators-Cz-XuORM.js";
3
- import { h as u, s as d, d as h } from "../chunks/analyze-result-contract-DnfF8kBb.js";
4
- import { e as Y, S as H, a as V, g as j, f as W, i as K, m as Q, j as $, p as X, k as J, l as Z, n as ee, o as ae, q as se, r as re, t as te, u as ie, w as ne, x as oe, y as le, z as de, A as me, B as ce, C as ue, D as pe, b as fe, E as he, F as be, G as ge, H as Se, I as ve, J as ye, K as Ce, L as Re, c as Ae, M as _e, N as Ie, v as Te } from "../chunks/analyze-result-contract-DnfF8kBb.js";
5
- import { b as De, g as ke, c as qe, i as Me, d as Ee, e as xe, f as Oe, h as Ne, j as Le, a as Pe, n as we } from "../chunks/catalog-field-grounding-DcxPLns0.js";
6
- import { C as Be, D as Ue, e as Ge, r as Ye, a as He, v as Ve, b as je, c as We, d as Ke, f as Qe, g as $e } from "../chunks/metric-comparison-4oA4ouU9.js";
7
- import { g as Je, a as Ze, b as ea, c as aa } from "../chunks/dashboard-input-contract-BFpERluO.js";
8
- function R(e, a = {}) {
3
+ import { h as u, s as c, d as h } from "../chunks/analyze-result-contract-DnfF8kBb.js";
4
+ import { e as Y, S as H, a as V, g as j, f as W, i as K, m as Q, j as $, p as X, k as J, l as Z, n as ee, o as ae, q as se, r as re, t as te, u as ie, w as ne, x as oe, y as le, z as de, A as me, B as ce, C as ue, D as pe, b as fe, E as he, F as be, G as ge, H as Se, I as ve, J as ye, K as Ce, L as Ae, c as Re, M as _e, N as Ie, v as Te } from "../chunks/analyze-result-contract-DnfF8kBb.js";
5
+ import { b as Fe, g as ke, c as Me, i as qe, d as Ee, e as xe, f as Oe, h as Ne, j as Le, n as Pe, a as we } from "../chunks/catalog-field-grounding-AOGwWu0K.js";
6
+ import { C as Be, D as Ue, e as Ge, r as Ye, a as He, v as Ve, b as je, c as We, d as Ke, f as Qe, g as $e } from "../chunks/metric-comparison-CWweq9RG.js";
7
+ import { i as Je, r as Ze, a as ea, s as aa } from "../chunks/dashboard-date-comparison-definition-BaYxjLi5.js";
8
+ import { g as ra, a as ta, b as ia, c as na } from "../chunks/dashboard-input-contract-BFpERluO.js";
9
+ function A(e, a = {}) {
9
10
  const s = f(e), r = {
10
11
  connectionId: a.connectionId,
11
12
  connectionType: e,
@@ -90,7 +91,7 @@ function R(e, a = {}) {
90
91
  supportsFilterClause: !1
91
92
  } : r;
92
93
  }
93
- function A(e) {
94
+ function R(e) {
94
95
  const a = f(e);
95
96
  switch (a) {
96
97
  case "mysql":
@@ -249,7 +250,7 @@ const l = {
249
250
  { name: "revenue", role: "measure", dataType: "number" }
250
251
  ]
251
252
  }
252
- }, F = {
253
+ }, D = {
253
254
  visibleAxis: {
254
255
  source: {
255
256
  kind: "semantic",
@@ -284,13 +285,13 @@ const l = {
284
285
  }
285
286
  }
286
287
  };
287
- function c(e) {
288
+ function m(e) {
288
289
  return !!(e.name.trim() && u(e.source) && (e.role === "date" || e.dataType === "date" || e.dataType === "datetime"));
289
290
  }
290
- function m(e) {
291
+ function d(e) {
291
292
  return e.filter(
292
293
  (a, s) => e.findIndex(
293
- (r) => d(a.field, r.field)
294
+ (r) => c(a.field, r.field)
294
295
  ) === s
295
296
  );
296
297
  }
@@ -298,33 +299,33 @@ function S(e) {
298
299
  return new Set(e.map(h).filter(Boolean)).size;
299
300
  }
300
301
  function v(e) {
301
- const a = m(
302
+ const a = d(
302
303
  e.candidates.filter((t) => t.kind === "visible_axis")
303
- ), s = m(
304
+ ), s = d(
304
305
  e.candidates.filter((t) => t.kind === "explicit_hidden")
305
306
  );
306
307
  if ([...a, ...s].some(
307
- (t) => !c(t.field)
308
+ (t) => !m(t.field)
308
309
  ))
309
310
  return "invalid";
310
311
  if (a.length > 1 || s.length > 1)
311
312
  return "ambiguous";
312
313
  const r = a[0], n = s[0];
313
314
  if (r)
314
- return n && !d(r.field, n.field) ? "invalid" : r;
315
+ return n && !c(r.field, n.field) ? "invalid" : r;
315
316
  if (n) return n;
316
317
  if (S(e.querySources ?? []) > 1)
317
318
  return "ambiguous";
318
- const o = m(
319
+ const o = d(
319
320
  e.candidates.filter((t) => t.kind === "semantic_primary")
320
321
  );
321
- return o.some((t) => !c(t.field)) ? "invalid" : o.length > 1 ? "ambiguous" : o[0] ?? "missing";
322
+ return o.some((t) => !m(t.field)) ? "invalid" : o.length > 1 ? "ambiguous" : o[0] ?? "missing";
322
323
  }
323
324
  function y(e) {
324
325
  const a = new Date(e.startInclusive), s = new Date(e.endExclusive);
325
326
  return e.timezone.trim() ? Number.isFinite(a.getTime()) && Number.isFinite(s.getTime()) && a.getTime() < s.getTime() : !1;
326
327
  }
327
- function D(e) {
328
+ function F(e) {
328
329
  const a = e.ranges ?? [];
329
330
  if (e.rawSql)
330
331
  return {
@@ -334,7 +335,7 @@ function D(e) {
334
335
  };
335
336
  if ((e.querySources ?? []).some(
336
337
  (i) => !u(i)
337
- ) || a.some((i) => !c(i.field)))
338
+ ) || a.some((i) => !m(i.field)))
338
339
  return {
339
340
  status: "unavailable",
340
341
  reason: "temporal_binding_invalid",
@@ -348,7 +349,7 @@ function D(e) {
348
349
  constraints: a
349
350
  };
350
351
  const r = a.filter(
351
- (i) => d(i.field, s.field)
352
+ (i) => c(i.field, s.field)
352
353
  );
353
354
  if (r.some((i) => !y(i.window)))
354
355
  return {
@@ -375,9 +376,7 @@ function D(e) {
375
376
  governingWindowSource: t.source,
376
377
  governingRangeId: t.id
377
378
  } : {},
378
- constraints: a.filter(
379
- (i) => !d(i.field, s.field)
380
- )
379
+ constraints: a.filter((i) => i.id !== (t == null ? void 0 : t.id))
381
380
  };
382
381
  }
383
382
  export {
@@ -387,41 +386,45 @@ export {
387
386
  Y as SEMAPHOR_ANALYZE_RESULT_FIELD_CONTRACT,
388
387
  H as SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION,
389
388
  V as SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION,
390
- F as TEMPORAL_CONTEXT_ADAPTER_PARITY_FIXTURES,
391
- De as buildAnalyticsCatalogFieldSummary,
389
+ D as TEMPORAL_CONTEXT_ADAPTER_PARITY_FIXTURES,
390
+ Fe as buildAnalyticsCatalogFieldSummary,
392
391
  I as buildSemaphorQualifiedSourcePath,
393
392
  Ge as evaluateMetricComparison,
394
393
  ke as getAnalyticsCatalogFieldCandidates,
395
- qe as getAnalyticsCatalogFieldName,
396
- Je as getCardControlCompatInputId,
397
- Ze as getCardInlineFilterCompatInputId,
398
- ea as getDashboardControlCompatInputId,
399
- aa as getDashboardFilterCompatInputId,
394
+ Me as getAnalyticsCatalogFieldName,
395
+ ra as getCardControlCompatInputId,
396
+ ta as getCardInlineFilterCompatInputId,
397
+ ia as getDashboardControlCompatInputId,
398
+ na as getDashboardFilterCompatInputId,
400
399
  j as getSemaphorAnalyzeResultFieldNames,
401
- R as getSemaphorConnectionCapabilities,
400
+ A as getSemaphorConnectionCapabilities,
402
401
  u as hasCompleteSemaphorSourceIdentity,
403
- Me as isAnalyticsCatalogDateField,
402
+ qe as isAnalyticsCatalogDateField,
404
403
  Ee as isAnalyticsCatalogDimensionField,
405
404
  xe as isAnalyticsCatalogMetricField,
406
405
  Oe as isAnalyticsDateLikeDataType,
407
406
  Ne as isAnalyticsMetricIdentifierField,
408
407
  Le as isAnalyticsTechnicalIdentifierField,
408
+ Je as isComparisonCapableDashboardDateInputDefinition,
409
409
  W as isSemaphorAnalyzeResultFieldName,
410
410
  K as isSemaphorDataAppCodegenSummary,
411
411
  Q as mergeSemaphorSourcesByIdentity,
412
412
  Pe as normalizeAnalyticsCatalogDataType,
413
413
  we as normalizeAnalyticsCatalogName,
414
- M as normalizeSemaphorAnalyticsFilterOperator,
415
- A as normalizeSemaphorDialect,
414
+ q as normalizeSemaphorAnalyticsFilterOperator,
415
+ R as normalizeSemaphorDialect,
416
416
  E as normalizeSemaphorInputOperator,
417
417
  $ as parseSemaphorAnalyzeResult,
418
418
  O as parseSemaphorIsoInstant,
419
419
  N as parseSemaphorIsoTimeWindowBoundary,
420
420
  X as preferSemaphorFieldRefMetadata,
421
421
  J as preferSemaphorSourceMetadata,
422
+ Ze as resolveDashboardDateComparisonFilterDefinition,
423
+ ea as resolveDashboardDateComparisonInputDefinition,
422
424
  Ye as resolveMetricComparisonRequest,
423
425
  He as resolveMetricResultAlias,
424
- D as resolveTemporalContext,
426
+ F as resolveTemporalContext,
427
+ aa as semanticDatasetMatchesFieldCoordinates,
425
428
  Z as semaphorAnalyticsCoverageSchema,
426
429
  ee as semaphorAnalyticsDiagnosticFeedbackSchema,
427
430
  ae as semaphorAnalyticsExecutionResultSchema,
@@ -435,7 +438,7 @@ export {
435
438
  de as semaphorDerivedFieldDefinitionSchema,
436
439
  me as semaphorExecutionFieldRefSchema,
437
440
  ce as semaphorFieldRefSchema,
438
- d as semaphorFieldRefsMatch,
441
+ c as semaphorFieldRefsMatch,
439
442
  ue as semaphorInputOptionsResultSchema,
440
443
  pe as semaphorMatrixResultSchema,
441
444
  fe as semaphorMetricAggregate,
@@ -448,8 +451,8 @@ export {
448
451
  Ce as semaphorSemanticSourceRefSchema,
449
452
  _ as semaphorSourceHasRequiredCoordinates,
450
453
  h as semaphorSourceIdentityKey,
451
- Re as semaphorSourceRefSchema,
452
- Ae as semaphorSourcesReferToSameDataset,
454
+ Ae as semaphorSourceRefSchema,
455
+ Re as semaphorSourcesReferToSameDataset,
453
456
  _e as semaphorSqlResultSchema,
454
457
  Ie as semaphorSqlSourceRefSchema,
455
458
  Ve as validateComparisonPresentationSpec,
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("react"),d=require("../chunks/code-editor-CkXyNgYc.js"),A=require("../chunks/index-Dpm_VET4.js"),J=require("../chunks/index-jSrCwPQz.js");require("../chunks/analyze-result-contract-ege_u6Nl.js");const U=require("../chunks/palette-C0yjT5Tv.js"),be=require("../chunks/braces-CbO-aIwH.js"),fe=require("../chunks/save-Xdc4pnys.js"),me=require("../chunks/layout-grid-B08pP7v6.js");/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("react"),d=require("../chunks/code-editor-BoowcKU0.js"),A=require("../chunks/index-Dpm_VET4.js"),J=require("../chunks/index-jSrCwPQz.js");require("../chunks/analyze-result-contract-ege_u6Nl.js");const U=require("../chunks/palette-C0yjT5Tv.js"),be=require("../chunks/braces-CbO-aIwH.js"),fe=require("../chunks/save-Xdc4pnys.js"),me=require("../chunks/layout-grid-B08pP7v6.js");/**
2
2
  * @license lucide-react v0.453.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,6 +1,6 @@
1
1
  import { jsxs as d, jsx as r, Fragment as ce } from "react/jsx-runtime";
2
2
  import m from "react";
3
- import { P as ge, a as be, B as C, b as fe, U as De, C as Ie, R as me, e as le, S as se, d as Je, c as q, T as je, G as Le, H as U, I as $e, J as M, K as _e, M as Ve, N as Ue, O as Me, L as E, Q as K, V as Q, W as ee, X as he, Y as re, Z as oe, _ as ke, $ as xe, a0 as ye, a1 as ve, a2 as Ce, a3 as Ge } from "../chunks/code-editor-Bkk7s8hI.js";
3
+ import { P as ge, a as be, B as C, b as fe, U as De, C as Ie, R as me, e as le, S as se, d as Je, c as q, T as je, G as Le, H as U, I as $e, J as M, K as _e, M as Ve, N as Ue, O as Me, L as E, Q as K, V as Q, W as ee, X as he, Y as re, Z as oe, _ as ke, $ as xe, a0 as ye, a1 as ve, a2 as Ce, a3 as Ge } from "../chunks/code-editor-CojfM3qp.js";
4
4
  import { r as We, v as He, A as Xe, a as Ye, p as Ze } from "../chunks/index-If0wlXGi.js";
5
5
  import { c as ae, X as qe } from "../chunks/index-xHCrHprY.js";
6
6
  import "../chunks/analyze-result-contract-DnfF8kBb.js";
@@ -1,7 +1,7 @@
1
1
  import { jsx as r, jsxs as s, Fragment as X } from "react/jsx-runtime";
2
2
  import ee, { useState as h, useCallback as F, useEffect as ae, useMemo as H } from "react";
3
- import { u as re, b as te, c as se, d as ne, e as le, f as oe, R as W, g as O, C as ie, h as ce, i as de, j as ue, k as me, l as _, m as R, n as fe, o as he, p as N } from "./dashboard-5agU0G_D.js";
4
- import { c as S, L as G, P as pe, a as ge, B as j, b as ve, d as V, e as be } from "./code-editor-Bkk7s8hI.js";
3
+ import { u as re, b as te, c as se, d as ne, e as le, f as oe, R as W, g as O, C as ie, h as ce, i as de, j as ue, k as me, l as _, m as R, n as fe, o as he, p as N } from "./dashboard-DSxho2LN.js";
4
+ import { c as S, L as G, P as pe, a as ge, B as j, b as ve, d as V, e as be } from "./code-editor-CojfM3qp.js";
5
5
  import "./index-xHCrHprY.js";
6
6
  import "./analyze-result-contract-DnfF8kBb.js";
7
7
  function we(n = {}) {
@@ -1 +1 @@
1
- "use strict";const e=require("react/jsx-runtime"),l=require("react"),t=require("./dashboard-MKIqgGDp.js"),i=require("./code-editor-CkXyNgYc.js");require("./index-jSrCwPQz.js");require("./analyze-result-contract-ege_u6Nl.js");function G(n={}){var y,P,z,A;const{authToken:d,tokenProps:a}=t.useSemaphorContext(),x=n.enabled??!0,m=(d==null?void 0:d.accessToken)??null,f=(a==null?void 0:a.apiServiceUrl)??null,[L,C]=l.useState(!1),[j,b]=l.useState(!1),[h,g]=l.useState(!1),[N,c]=l.useState(null),[v,S]=l.useState(null),k=v||{tz:((P=(y=a==null?void 0:a.params)==null?void 0:y.calendarContext)==null?void 0:P.tz)||null,weekStart:((A=(z=a==null?void 0:a.params)==null?void 0:z.calendarContext)==null?void 0:A.weekStart)??null},p=l.useCallback(async()=>{if(!(!x||!m||!f)){C(!0),c(null);try{const o=await fetch(`${f}/v1/user-preferences/calendar`,{method:"GET",headers:{Authorization:`Bearer ${m}`}});if(!o.ok){const u=await o.json().catch(()=>({}));throw new Error(u.error||"Failed to fetch preferences")}const r=await o.json();S({tz:r.tz,weekStart:r.weekStart,source:r.source,isInherited:r.isInherited,userHasPrefs:r.userHasPrefs,inherited:r.inherited})}catch(o){const r=o instanceof Error?o.message:"Unknown error";c(r)}finally{C(!1)}}},[m,f,x]);l.useEffect(()=>{x&&p()},[x,p]);const T=l.useCallback(async o=>{if(!m||!f)return c("Not authenticated"),!1;b(!0),c(null);try{const r=await fetch(`${f}/v1/user-preferences/calendar`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${m}`},body:JSON.stringify(o)});if(!r.ok){const u=await r.json().catch(()=>({}));throw new Error(u.error||"Failed to update preferences")}return await p(),!0}catch(r){const u=r instanceof Error?r.message:"Unknown error";return c(u),!1}finally{b(!1)}},[m,f,p]),w=l.useCallback(async()=>{if(!m||!f)return c("Not authenticated"),!1;g(!0),c(null);try{const o=await fetch(`${f}/v1/user-preferences/calendar`,{method:"DELETE",headers:{Authorization:`Bearer ${m}`}});if(!o.ok){const u=await o.json().catch(()=>({}));throw new Error(u.error||"Failed to clear preferences")}const r=await o.text();if(r)try{const u=JSON.parse(r);return S({tz:u.tz,weekStart:u.weekStart,source:u.source,isInherited:u.isInherited??!0,userHasPrefs:!1,inherited:u.inherited}),!0}catch{}return await p(),!0}catch(o){const r=o instanceof Error?o.message:"Unknown error";return c(r),!1}finally{g(!1)}},[m,f,p]);return{preferences:k,isLoading:L,isSaving:j,isClearing:h,error:N,updatePreferences:T,clearPreferences:w,refetch:p}}const E=[{value:"America/New_York",label:"Eastern Time (US & Canada)"},{value:"America/Chicago",label:"Central Time (US & Canada)"},{value:"America/Denver",label:"Mountain Time (US & Canada)"},{value:"America/Los_Angeles",label:"Pacific Time (US & Canada)"},{value:"America/Phoenix",label:"Arizona"},{value:"America/Anchorage",label:"Alaska"},{value:"Pacific/Honolulu",label:"Hawaii"},{value:"Europe/London",label:"London"},{value:"Europe/Paris",label:"Paris, Berlin, Rome"},{value:"Asia/Tokyo",label:"Tokyo"},{value:"Asia/Shanghai",label:"Beijing, Shanghai"},{value:"Asia/Kolkata",label:"Mumbai, New Delhi"},{value:"Australia/Sydney",label:"Sydney"},{value:"UTC",label:"UTC"}],M=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:6,label:"Saturday"}],H="text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";function W(){try{const n=Intl;if(n.supportedValuesOf)return n.supportedValuesOf("timeZone")}catch{}return E.map(n=>n.value)}function q(n){switch(n){case"tenant":return"tenant";case"organization":return"organization";case"system":return"system";default:return"default"}}function O(n){const d=E.find(a=>a.value===n);return d?d.label:n}function _(n){const d=M.find(a=>a.value===n);return d?d.label:String(n)}function V({open:n,onOpenChange:d}){var D,U,F;const{preferences:a,isLoading:x,isSaving:m,isClearing:f,updatePreferences:L,clearPreferences:C}=G({enabled:n}),j=a.tz||((D=a.inherited)==null?void 0:D.tz)||Intl.DateTimeFormat().resolvedOptions().timeZone,b=a.weekStart??((U=a.inherited)==null?void 0:U.weekStart)??1,[h,g]=l.useState(!a.userHasPrefs),[N,c]=l.useState(!1),[v,S]=l.useState(j),[k,p]=l.useState(b),[T,w]=l.useState(!1),y=l.useMemo(()=>W(),[]),P=l.useMemo(()=>y.filter(s=>!E.some(R=>R.value===s)),[y]),z=l.useMemo(()=>O(v),[v]),A=a.inherited?O(a.inherited.tz):"UTC",o=a.inherited?_(a.inherited.weekStart):"Monday",r=q((F=a.inherited)==null?void 0:F.source);l.useEffect(()=>{if(!n){c(!1);return}N||(a.userHasPrefs!==void 0&&g(!a.userHasPrefs),S(j),p(b))},[n,N,a.userHasPrefs,j,b]);const u=async()=>{if(x){t.ue.error("Preferences are still loading. Please try again.");return}h?await C()?(t.ue.success("Now using default settings. Please refresh the page to apply changes.",{duration:5e3}),d(!1)):t.ue.error("Failed to save preferences. Please try again."):await L({tz:v,weekStart:k})?(t.ue.success("Preferences saved. Please refresh the page to apply changes.",{duration:5e3}),d(!1)):t.ue.error("Failed to save preferences. Please try again.")},$=()=>{d(!1)},I=m||f,B=I||x;return e.jsx(t.Dialog,{open:n,onOpenChange:d,children:e.jsxs(t.DialogContent,{className:"rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control",children:[e.jsxs(t.DialogHeader,{children:[e.jsx(t.DialogTitle,{className:"text-[15px]",children:"Calendar preferences"}),e.jsx(t.DialogDescription,{className:"text-[13px] leading-5",children:"Set your timezone and week-start for date calculations and displays."})]}),e.jsxs("div",{className:"space-y-4 py-1",children:[e.jsxs(t.RadioGroup,{value:h?"defaults":"custom",onValueChange:s=>{c(!0),g(s==="defaults")},className:"space-y-0.5",children:[e.jsxs("label",{htmlFor:"mode-defaults",className:i.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",h&&"bg-muted/50"),onClick:()=>{c(!0),g(!0)},children:[e.jsx(t.RadioGroupItem,{value:"defaults",id:"mode-defaults",className:"mt-0.5"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-[13px] font-medium text-foreground",children:["Use ",r," defaults"]}),e.jsxs("p",{className:"text-[12px] text-muted-foreground",children:[A,", week starts ",o]})]})]}),e.jsxs("label",{htmlFor:"mode-custom",className:i.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",!h&&"bg-muted/50"),onClick:()=>{c(!0),g(!1)},children:[e.jsx(t.RadioGroupItem,{value:"custom",id:"mode-custom",className:"mt-0.5"}),e.jsx("p",{className:"flex-1 text-[13px] font-medium text-foreground",children:"Use custom settings"})]})]}),e.jsxs("div",{className:i.cn("space-y-4 border-t border-border/60 pt-4 transition-opacity",h&&"pointer-events-none opacity-50"),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(i.Label,{className:H,children:"Timezone"}),e.jsxs(i.Popover,{open:T,onOpenChange:w,modal:!0,children:[e.jsx(i.PopoverTrigger,{asChild:!0,children:e.jsxs(i.Button,{variant:"outline",size:"xs",role:"combobox","aria-expanded":T,className:"w-full justify-between text-[12px] font-normal",disabled:h,children:[e.jsx("span",{className:"truncate",children:z}),e.jsx(t.ChevronsUpDown,{className:"ml-2 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),e.jsx(i.PopoverContent,{className:"z-50 w-[--radix-popover-trigger-width] p-0",align:"start",children:e.jsxs(t.Command,{className:"overflow-visible",children:[e.jsx(t.CommandInput,{placeholder:"Search timezones…"}),e.jsxs(t.CommandList,{children:[e.jsx(t.CommandEmpty,{children:"No timezone found."}),e.jsx(t.CommandGroup,{heading:"Common",children:E.map(s=>e.jsxs(t.CommandItem,{value:`${s.value} ${s.label}`,onSelect:()=>{c(!0),S(s.value),w(!1)},children:[e.jsx(i.Check,{className:i.cn("h-3.5 w-3.5",v===s.value?"opacity-100":"opacity-0")}),e.jsx("span",{className:"flex-1",children:s.label}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:s.value})]},s.value))}),e.jsx(t.CommandSeparator,{}),e.jsx(t.CommandGroup,{heading:"All timezones",children:P.map(s=>e.jsxs(t.CommandItem,{value:s,onSelect:()=>{c(!0),S(s),w(!1)},children:[e.jsx(i.Check,{className:i.cn("h-3.5 w-3.5",v===s?"opacity-100":"opacity-0")}),s]},s))})]})]})})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(i.Label,{className:H,children:"Week starts on"}),e.jsx(t.RadioGroup,{value:String(k),onValueChange:s=>{c(!0),p(Number(s))},className:"flex gap-4",disabled:h,children:M.map(s=>e.jsxs("label",{htmlFor:`week-start-${s.value}`,className:i.cn("flex cursor-pointer items-center gap-2 text-[13px]",h&&"cursor-not-allowed"),children:[e.jsx(t.RadioGroupItem,{value:String(s.value),id:`week-start-${s.value}`,disabled:h}),s.label]},s.value))})]})]})]}),e.jsxs(t.DialogFooter,{children:[e.jsx(i.Button,{variant:"outline",size:"xs",onClick:$,disabled:I,children:"Cancel"}),e.jsx(i.Button,{size:"xs",onClick:u,disabled:B,children:I?e.jsxs(e.Fragment,{children:[e.jsx(i.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save"})]})]})})}exports.CalendarPreferencesDialog=V;
1
+ "use strict";const e=require("react/jsx-runtime"),l=require("react"),t=require("./dashboard-ogxedhSY.js"),i=require("./code-editor-BoowcKU0.js");require("./index-jSrCwPQz.js");require("./analyze-result-contract-ege_u6Nl.js");function G(n={}){var y,P,z,A;const{authToken:d,tokenProps:a}=t.useSemaphorContext(),x=n.enabled??!0,m=(d==null?void 0:d.accessToken)??null,f=(a==null?void 0:a.apiServiceUrl)??null,[L,C]=l.useState(!1),[j,b]=l.useState(!1),[h,g]=l.useState(!1),[N,c]=l.useState(null),[v,S]=l.useState(null),k=v||{tz:((P=(y=a==null?void 0:a.params)==null?void 0:y.calendarContext)==null?void 0:P.tz)||null,weekStart:((A=(z=a==null?void 0:a.params)==null?void 0:z.calendarContext)==null?void 0:A.weekStart)??null},p=l.useCallback(async()=>{if(!(!x||!m||!f)){C(!0),c(null);try{const o=await fetch(`${f}/v1/user-preferences/calendar`,{method:"GET",headers:{Authorization:`Bearer ${m}`}});if(!o.ok){const u=await o.json().catch(()=>({}));throw new Error(u.error||"Failed to fetch preferences")}const r=await o.json();S({tz:r.tz,weekStart:r.weekStart,source:r.source,isInherited:r.isInherited,userHasPrefs:r.userHasPrefs,inherited:r.inherited})}catch(o){const r=o instanceof Error?o.message:"Unknown error";c(r)}finally{C(!1)}}},[m,f,x]);l.useEffect(()=>{x&&p()},[x,p]);const T=l.useCallback(async o=>{if(!m||!f)return c("Not authenticated"),!1;b(!0),c(null);try{const r=await fetch(`${f}/v1/user-preferences/calendar`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${m}`},body:JSON.stringify(o)});if(!r.ok){const u=await r.json().catch(()=>({}));throw new Error(u.error||"Failed to update preferences")}return await p(),!0}catch(r){const u=r instanceof Error?r.message:"Unknown error";return c(u),!1}finally{b(!1)}},[m,f,p]),w=l.useCallback(async()=>{if(!m||!f)return c("Not authenticated"),!1;g(!0),c(null);try{const o=await fetch(`${f}/v1/user-preferences/calendar`,{method:"DELETE",headers:{Authorization:`Bearer ${m}`}});if(!o.ok){const u=await o.json().catch(()=>({}));throw new Error(u.error||"Failed to clear preferences")}const r=await o.text();if(r)try{const u=JSON.parse(r);return S({tz:u.tz,weekStart:u.weekStart,source:u.source,isInherited:u.isInherited??!0,userHasPrefs:!1,inherited:u.inherited}),!0}catch{}return await p(),!0}catch(o){const r=o instanceof Error?o.message:"Unknown error";return c(r),!1}finally{g(!1)}},[m,f,p]);return{preferences:k,isLoading:L,isSaving:j,isClearing:h,error:N,updatePreferences:T,clearPreferences:w,refetch:p}}const E=[{value:"America/New_York",label:"Eastern Time (US & Canada)"},{value:"America/Chicago",label:"Central Time (US & Canada)"},{value:"America/Denver",label:"Mountain Time (US & Canada)"},{value:"America/Los_Angeles",label:"Pacific Time (US & Canada)"},{value:"America/Phoenix",label:"Arizona"},{value:"America/Anchorage",label:"Alaska"},{value:"Pacific/Honolulu",label:"Hawaii"},{value:"Europe/London",label:"London"},{value:"Europe/Paris",label:"Paris, Berlin, Rome"},{value:"Asia/Tokyo",label:"Tokyo"},{value:"Asia/Shanghai",label:"Beijing, Shanghai"},{value:"Asia/Kolkata",label:"Mumbai, New Delhi"},{value:"Australia/Sydney",label:"Sydney"},{value:"UTC",label:"UTC"}],M=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:6,label:"Saturday"}],H="text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";function W(){try{const n=Intl;if(n.supportedValuesOf)return n.supportedValuesOf("timeZone")}catch{}return E.map(n=>n.value)}function q(n){switch(n){case"tenant":return"tenant";case"organization":return"organization";case"system":return"system";default:return"default"}}function O(n){const d=E.find(a=>a.value===n);return d?d.label:n}function _(n){const d=M.find(a=>a.value===n);return d?d.label:String(n)}function V({open:n,onOpenChange:d}){var D,U,F;const{preferences:a,isLoading:x,isSaving:m,isClearing:f,updatePreferences:L,clearPreferences:C}=G({enabled:n}),j=a.tz||((D=a.inherited)==null?void 0:D.tz)||Intl.DateTimeFormat().resolvedOptions().timeZone,b=a.weekStart??((U=a.inherited)==null?void 0:U.weekStart)??1,[h,g]=l.useState(!a.userHasPrefs),[N,c]=l.useState(!1),[v,S]=l.useState(j),[k,p]=l.useState(b),[T,w]=l.useState(!1),y=l.useMemo(()=>W(),[]),P=l.useMemo(()=>y.filter(s=>!E.some(R=>R.value===s)),[y]),z=l.useMemo(()=>O(v),[v]),A=a.inherited?O(a.inherited.tz):"UTC",o=a.inherited?_(a.inherited.weekStart):"Monday",r=q((F=a.inherited)==null?void 0:F.source);l.useEffect(()=>{if(!n){c(!1);return}N||(a.userHasPrefs!==void 0&&g(!a.userHasPrefs),S(j),p(b))},[n,N,a.userHasPrefs,j,b]);const u=async()=>{if(x){t.ue.error("Preferences are still loading. Please try again.");return}h?await C()?(t.ue.success("Now using default settings. Please refresh the page to apply changes.",{duration:5e3}),d(!1)):t.ue.error("Failed to save preferences. Please try again."):await L({tz:v,weekStart:k})?(t.ue.success("Preferences saved. Please refresh the page to apply changes.",{duration:5e3}),d(!1)):t.ue.error("Failed to save preferences. Please try again.")},$=()=>{d(!1)},I=m||f,B=I||x;return e.jsx(t.Dialog,{open:n,onOpenChange:d,children:e.jsxs(t.DialogContent,{className:"rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control",children:[e.jsxs(t.DialogHeader,{children:[e.jsx(t.DialogTitle,{className:"text-[15px]",children:"Calendar preferences"}),e.jsx(t.DialogDescription,{className:"text-[13px] leading-5",children:"Set your timezone and week-start for date calculations and displays."})]}),e.jsxs("div",{className:"space-y-4 py-1",children:[e.jsxs(t.RadioGroup,{value:h?"defaults":"custom",onValueChange:s=>{c(!0),g(s==="defaults")},className:"space-y-0.5",children:[e.jsxs("label",{htmlFor:"mode-defaults",className:i.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",h&&"bg-muted/50"),onClick:()=>{c(!0),g(!0)},children:[e.jsx(t.RadioGroupItem,{value:"defaults",id:"mode-defaults",className:"mt-0.5"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-[13px] font-medium text-foreground",children:["Use ",r," defaults"]}),e.jsxs("p",{className:"text-[12px] text-muted-foreground",children:[A,", week starts ",o]})]})]}),e.jsxs("label",{htmlFor:"mode-custom",className:i.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",!h&&"bg-muted/50"),onClick:()=>{c(!0),g(!1)},children:[e.jsx(t.RadioGroupItem,{value:"custom",id:"mode-custom",className:"mt-0.5"}),e.jsx("p",{className:"flex-1 text-[13px] font-medium text-foreground",children:"Use custom settings"})]})]}),e.jsxs("div",{className:i.cn("space-y-4 border-t border-border/60 pt-4 transition-opacity",h&&"pointer-events-none opacity-50"),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(i.Label,{className:H,children:"Timezone"}),e.jsxs(i.Popover,{open:T,onOpenChange:w,modal:!0,children:[e.jsx(i.PopoverTrigger,{asChild:!0,children:e.jsxs(i.Button,{variant:"outline",size:"xs",role:"combobox","aria-expanded":T,className:"w-full justify-between text-[12px] font-normal",disabled:h,children:[e.jsx("span",{className:"truncate",children:z}),e.jsx(t.ChevronsUpDown,{className:"ml-2 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),e.jsx(i.PopoverContent,{className:"z-50 w-[--radix-popover-trigger-width] p-0",align:"start",children:e.jsxs(t.Command,{className:"overflow-visible",children:[e.jsx(t.CommandInput,{placeholder:"Search timezones…"}),e.jsxs(t.CommandList,{children:[e.jsx(t.CommandEmpty,{children:"No timezone found."}),e.jsx(t.CommandGroup,{heading:"Common",children:E.map(s=>e.jsxs(t.CommandItem,{value:`${s.value} ${s.label}`,onSelect:()=>{c(!0),S(s.value),w(!1)},children:[e.jsx(i.Check,{className:i.cn("h-3.5 w-3.5",v===s.value?"opacity-100":"opacity-0")}),e.jsx("span",{className:"flex-1",children:s.label}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:s.value})]},s.value))}),e.jsx(t.CommandSeparator,{}),e.jsx(t.CommandGroup,{heading:"All timezones",children:P.map(s=>e.jsxs(t.CommandItem,{value:s,onSelect:()=>{c(!0),S(s),w(!1)},children:[e.jsx(i.Check,{className:i.cn("h-3.5 w-3.5",v===s?"opacity-100":"opacity-0")}),s]},s))})]})]})})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(i.Label,{className:H,children:"Week starts on"}),e.jsx(t.RadioGroup,{value:String(k),onValueChange:s=>{c(!0),p(Number(s))},className:"flex gap-4",disabled:h,children:M.map(s=>e.jsxs("label",{htmlFor:`week-start-${s.value}`,className:i.cn("flex cursor-pointer items-center gap-2 text-[13px]",h&&"cursor-not-allowed"),children:[e.jsx(t.RadioGroupItem,{value:String(s.value),id:`week-start-${s.value}`,disabled:h}),s.label]},s.value))})]})]})]}),e.jsxs(t.DialogFooter,{children:[e.jsx(i.Button,{variant:"outline",size:"xs",onClick:$,disabled:I,children:"Cancel"}),e.jsx(i.Button,{size:"xs",onClick:u,disabled:B,children:I?e.jsxs(e.Fragment,{children:[e.jsx(i.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save"})]})]})})}exports.CalendarPreferencesDialog=V;
@@ -86,7 +86,7 @@ function D(n) {
86
86
  };
87
87
  }
88
88
  export {
89
- o as a,
89
+ c as a,
90
90
  D as b,
91
91
  g as c,
92
92
  h as d,
@@ -96,5 +96,5 @@ export {
96
96
  l as h,
97
97
  u as i,
98
98
  m as j,
99
- c as n
99
+ o as n
100
100
  };