react-semaphor 0.1.415 → 0.1.417

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 (62) hide show
  1. package/DATA_APP_SDK.md +1 -4
  2. package/dist/analytics-protocol/index.cjs +1 -1
  3. package/dist/analytics-protocol/index.js +2 -2
  4. package/dist/brand-studio/index.cjs +1 -1
  5. package/dist/brand-studio/index.js +2 -2
  6. package/dist/chunks/{analyze-result-contract-DPjm6btg.js → analyze-result-contract-B0O3oIYu.js} +2 -1
  7. package/dist/chunks/analyze-result-contract-CL97m8X8.js +1 -0
  8. package/dist/chunks/{calendar-preferences-dialog-B8FmFRHX.js → calendar-preferences-dialog-BOfryj8P.js} +3 -3
  9. package/dist/chunks/{calendar-preferences-dialog-ck4AU-to.js → calendar-preferences-dialog-Rq9qiG3X.js} +1 -1
  10. package/dist/chunks/{dashboard-briefing-launcher-Br_1IK1z.js → dashboard-briefing-launcher-D_P0cNQ_.js} +1 -1
  11. package/dist/chunks/{dashboard-briefing-launcher-Tr2SqDMK.js → dashboard-briefing-launcher-DgvlOcRI.js} +4 -4
  12. package/dist/chunks/{dashboard-controls-B7OObDNl.js → dashboard-controls-DzVA-wWu.js} +1 -1
  13. package/dist/chunks/{dashboard-controls-B2bEv8uG.js → dashboard-controls-JYTKRokc.js} +5 -5
  14. package/dist/chunks/{dashboard-json-DNixjalS.js → dashboard-json-D5TEri2w.js} +1 -1
  15. package/dist/chunks/{dashboard-json-DAB8WVyb.js → dashboard-json-h6YMk_-l.js} +3 -3
  16. package/dist/chunks/{edit-dashboard-visual-Dh8Ge3-B.js → edit-dashboard-visual-DOtCYmDn.js} +4 -4
  17. package/dist/chunks/{edit-dashboard-visual-DWygSAp3.js → edit-dashboard-visual-kfbu03n9.js} +1 -1
  18. package/dist/chunks/{index-CQIMj-FF.js → index-Beol8cOo.js} +2 -2
  19. package/dist/chunks/{index-BkTLAfKy.js → index-BgESS5r7.js} +5 -5
  20. package/dist/chunks/{switch-DMlqgIx_.js → switch--FHwRAOL.js} +1 -1
  21. package/dist/chunks/{switch-DgiogS4X.js → switch-C8_t4Pio.js} +1 -1
  22. package/dist/chunks/update-policy-B50M0Jeg.js +3 -0
  23. package/dist/chunks/{update-policy-BnEbPhHW.js → update-policy-CQLHKQ_h.js} +304 -290
  24. package/dist/chunks/{use-create-flow-overlay-state-CZA-dSns.js → use-create-flow-overlay-state-BEPWzqQn.js} +1 -1
  25. package/dist/chunks/{use-create-flow-overlay-state-uujasvbD.js → use-create-flow-overlay-state-NEs9ePDy.js} +3 -3
  26. package/dist/chunks/validators-JzI7olk4.js +1 -0
  27. package/dist/chunks/{validators-C-_9Ew5G.js → validators-UqQI3Cg_.js} +2 -2
  28. package/dist/dashboard/index.cjs +1 -1
  29. package/dist/dashboard/index.js +1 -1
  30. package/dist/dashboard-authoring/index.cjs +1 -1
  31. package/dist/dashboard-authoring/index.js +2 -2
  32. package/dist/data-app-builder/index.cjs +1 -1
  33. package/dist/data-app-builder/index.js +2 -2
  34. package/dist/data-app-codegen/index.cjs +1 -1
  35. package/dist/data-app-codegen/index.js +2 -2
  36. package/dist/data-app-codegen-node/index.cjs +42 -42
  37. package/dist/data-app-codegen-node/index.js +270 -264
  38. package/dist/data-app-sdk/index.cjs +1 -1
  39. package/dist/data-app-sdk/index.js +2 -2
  40. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  41. package/dist/data-app-sdk-adapters/index.js +1 -1
  42. package/dist/data-app-sdk-validation/index.cjs +1 -1
  43. package/dist/data-app-sdk-validation/index.js +2 -2
  44. package/dist/index.cjs +1 -1
  45. package/dist/index.js +7 -7
  46. package/dist/surfboard/index.cjs +1 -1
  47. package/dist/surfboard/index.js +2 -2
  48. package/dist/types/analytics-protocol.d.ts +2 -2
  49. package/dist/types/dashboard-assistant.d.ts +1 -1
  50. package/dist/types/dashboard-authoring.d.ts +1 -1
  51. package/dist/types/data-app-builder.d.ts +1 -1
  52. package/dist/types/data-app-codegen-node.d.ts +5 -4
  53. package/dist/types/data-app-codegen.d.ts +5 -4
  54. package/dist/types/data-app-sdk-adapters.d.ts +1 -1
  55. package/dist/types/data-app-sdk-validation.d.ts +1 -1
  56. package/dist/types/data-app-sdk.d.ts +1 -1
  57. package/dist/types/main.d.ts +1 -1
  58. package/package.json +1 -1
  59. package/src/data-app-sdk/README.md +1 -4
  60. package/dist/chunks/analyze-result-contract-8nxUOWp8.js +0 -1
  61. package/dist/chunks/update-policy-CWg9c08k.js +0 -3
  62. package/dist/chunks/validators-CB9BFarT.js +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../data-app-sdk-adapters/index.cjs"),i=require("react/jsx-runtime"),c=require("react"),Be=require("../chunks/source-identity-BM2FvJDP.js");require("../chunks/analyze-result-contract-8nxUOWp8.js");const se=require("../chunks/search-DNCejM7Z.js"),Ke=require("../chunks/x-B6ghREd2.js"),$r=require("../chunks/validators-CB9BFarT.js");function de(e,r,t={}){return{...t,name:e,role:r}}function Or(e){return e}function Br(e){return e}const Kr={source:{semantic(e){return{...e,kind:"semantic"}},sql(e){return{...e,kind:"sql"}}},field:{measure(e,r){return de(e,"measure",r)},dimension(e,r){return de(e,"dimension",r)},date(e,r){return de(e,"date",r)},id(e,r){return de(e,"id",r)}},filter(e){return{...e,kind:"filter"}},bindInput(e,r){return{toAnalyticsInput(){const[t]=w.toSemaphorInputSnapshots([e]),n=w.toSemaphorInputBinding({...r,inputId:r.inputId||t.inputId});return{...t,inputId:n.inputId,...n.kind?{kind:n.kind}:{},...n.controlRole?{controlRole:n.controlRole}:{},...n.operator?{operator:n.operator}:{},...n.field?{field:n.field}:{},...n.relationshipHint?{relationshipHint:n.relationshipHint}:{}}}}},control(e){return{...e,kind:"control"}},sqlParam(e){return{...e,kind:"control",role:"sqlParam"}},derivedField(e){return{...e,kind:"derived_field",expressionLanguage:e.expressionLanguage||"semaphor_sql_template"}},metric(e){return{...e,queryKind:"metric"}},analysis(e){return{...e,queryKind:"analysis"}},records(e){return{...e,queryKind:"records"}},inputOptions(e){return{...e,queryKind:"inputOptions"}},sql(e){return{...e,queryKind:"sql"}},matrix(e){return{...e,queryKind:"matrix"}}},ie=10,Re=8;function Wr(e){const r=e==null?void 0:e.result;if(r)switch(r.kind){case"records":return te({title:"Records",rowNoun:"rows",records:r.records,columns:r.columns,rowCount:r.rowCount});case"sql":return te({title:"SQL Rows",rowNoun:"rows",records:r.records,columns:r.columns,rowCount:r.rowCount});case"inputOptions":return te({title:"Options",rowNoun:"options",records:r.options.slice(0,ie).map(t=>{var n;return{label:t.label,value:t.value,count:t.count,disambiguation:(n=t.disambiguation)==null?void 0:n.join(" / ")}}),columns:[{key:"label",label:"Label"},{key:"value",label:"Value"},{key:"count",label:"Count"},{key:"disambiguation",label:"Disambiguation"}],rowCount:r.rowCount??r.options.length});case"metric":{const t=[{metric:"value",value:r.value}];return r.comparison&&t.push({metric:`${r.comparison.kind} value`,value:r.comparison.value},{metric:"delta",value:r.comparison.delta},{metric:"deltaPercent",value:r.comparison.deltaPercent}),te({title:"Metric",rowNoun:"values",records:t,columns:[{key:"metric",label:"Metric"},{key:"value",label:"Value"}],rowCount:t.length})}case"matrix":return te({title:"Matrix Cells",rowNoun:"cells",records:r.cells.slice(0,ie).map(t=>{const n=r.nodesById[t.rowId],s=t.columnId?r.nodesById[t.columnId]:void 0,o=r.measuresById[t.measureId];return{row:(n==null?void 0:n.label)||t.rowId,column:(s==null?void 0:s.label)||t.columnId||"Total",measure:(o==null?void 0:o.label)||t.measureId,value:t.formattedValue??t.value,role:t.role}}),columns:[{key:"row",label:"Row"},{key:"column",label:"Column"},{key:"measure",label:"Measure"},{key:"value",label:"Value"},{key:"role",label:"Role"}],rowCount:r.rowCount??r.cells.length});default:return _r(r)}}function te({title:e,rowNoun:r,records:t,columns:n,rowCount:s}){const o=Mr(n,t);if(!o.length)return;const u=s??t.length,p=t.slice(0,ie);return{title:e,summary:`${Pr(u)} ${r}`,columns:o.slice(0,Re),rows:p,truncatedRows:u>p.length,truncatedColumns:o.length>Re}}function Mr(e,r){if(e!=null&&e.length)return e.filter(n=>n.key).map(n=>({key:n.key,label:n.label||n.key}));const t=new Set;return r.slice(0,ie).forEach(n=>{Object.keys(n).forEach(s=>t.add(s))}),[...t].map(n=>({key:n,label:n}))}function _r(e){throw new Error(`Unhandled Semaphor result kind: ${ur(e)}`)}function Nr(e){return e===null?"null":e===void 0?"":typeof e=="string"?Xe(e):typeof e=="number"||typeof e=="boolean"?String(e):Xe(ur(e))}function Pr(e){return typeof e=="number"?e.toLocaleString():"-"}function ur(e){return JSON.stringify(e,null,2)??"undefined"}function Xe(e){return e.length>80?`${e.slice(0,77)}...`:e}function ye(e){return e.viewTitle||e.queryLabel||e.viewId||e.queryId}function zr(e){if(e.label)return e.label;if(e.queryKind!=="inputOptions")return;const t=e.labelField.label||e.valueField.label||e.labelField.name||e.valueField.name||e.inputId;return`${Fr(t)} Options`}function Fr(e){return(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\bfilter\b/gi," ").replace(/\boptions?\b/gi," ").replace(/\bid\b/gi," ").replace(/\s+/g," ").trim()||e).split(" ").filter(Boolean).map(n=>n===n.toUpperCase()&&n.length>1?n:`${n.slice(0,1).toUpperCase()}${n.slice(1)}`).join(" ")}function We(e){return e.flatMap(r=>{var y,m,v,g;const t=r.latestAttempt,n=t==null?void 0:t.executionResult,s=xe((y=n==null?void 0:n.validation)==null?void 0:y.warnings),o=xe((m=n==null?void 0:n.validation)==null?void 0:m.errors),u=Ur((v=n==null?void 0:n.coverage)==null?void 0:v.missingObligations),p=xe((g=n==null?void 0:n.coverage)==null?void 0:g.warnings),d=[],f=ye(r);(t==null?void 0:t.status)==="error"&&d.push({trace:r,tone:"error",title:f,message:t.errorMessage||"Query attempt failed."});for(const h of r.clientWarnings)d.push({trace:r,tone:"warning",title:f,message:h});for(const h of s)d.push({trace:r,tone:"warning",title:f,...h});for(const h of o)d.push({trace:r,tone:"error",title:f,...h});for(const h of u)d.push({trace:r,tone:"warning",title:f,message:h});for(const h of p)d.push({trace:r,tone:"warning",title:f,...h});return d})}function Hr(e){return{traceId:e.trace.traceId,queryId:e.trace.queryId,viewId:e.trace.viewId,viewTitle:e.trace.viewTitle,queryLabel:e.trace.queryLabel,severity:e.tone,title:e.title,message:e.message,code:e.code,path:e.path}}function Vr(e,r){return e.filter(t=>t.trace.traceId===r.traceId).length}function Qr(e){const r=We(e),t=e.filter(u=>{var p;return((p=u.latestAttempt)==null?void 0:p.status)==="error"}).length,n=e.filter(u=>{var p;return((p=u.latestAttempt)==null?void 0:p.status)==="loading"}).length,s=r.filter(u=>u.tone==="error").length,o=r.filter(u=>u.tone==="warning").length;return{total:e.length,failed:t,loading:n,errorCount:s,warningCount:o,issueCount:r.length,severity:t||s?"error":o?"warning":n?"loading":"ok"}}function Ur(e){return Array.isArray(e)?e.filter(r=>typeof r=="string"):[]}function xe(e){return Array.isArray(e)?e.map(Gr).filter(r=>!!r):[]}function Gr(e){if(typeof e=="string")return{message:e};if(!e||typeof e!="object"||Array.isArray(e))return;const r=e,t=typeof r.message=="string"?r.message:"",n=typeof r.code=="string"?r.code:"",s=typeof r.path=="string"?r.path:"";return t&&n?{message:s?`${t} (${n}, ${s})`:`${t} (${n})`,code:n,...s?{path:s}:{}}:t?{message:t,...s?{path:s}:{}}:n?{message:n,code:n}:void 0}function Jr(e){if(!e.enabled)return e;const r=e.queries.map(cr);return{enabled:e.enabled,queries:r,issues:e.issues,getQuery:t=>r.find(n=>n.queryId===t),getQueries:t=>r.filter(n=>n.queryId===t)}}function Ze(e){return e?cr(e):void 0}function cr(e){var r;return(r=e==null?void 0:e.latestAttempt)!=null&&r.executionResult?{...e,latestAttempt:{...e.latestAttempt,executionResult:Yr(e.latestAttempt.executionResult)}}:e}function Yr(e){const{compiledQuery:r,intent:t,result:n,...s}=e,o=Xr(s.metadata);return{...s,...o?{metadata:o}:{}}}function Xr(e){if(!e||typeof e!="object"||Array.isArray(e))return e;const r=e.dataAppDebug;if(!r||typeof r!="object"||Array.isArray(r))return e;const{compiledSql:t,...n}=r;return{...e,dataAppDebug:n}}function Zr(e){return e==="relative"?{position:"relative",top:"auto",right:"auto",bottom:"auto",left:"auto"}:{top:e.startsWith("top")?20:"auto",right:e.endsWith("right")?20:"auto",bottom:e.startsWith("bottom")?20:"auto",left:e.endsWith("left")?20:"auto"}}function et(e){return e==="error"?{borderColor:"var(--sd-error-border)",background:"var(--sd-error-bg)",color:"var(--sd-error-fg)"}:e==="warning"?{borderColor:"var(--sd-warning-border)",background:"var(--sd-warning-bg)",color:"var(--sd-warning-fg)"}:e==="loading"?{borderColor:"var(--sd-loading-border)",background:"var(--sd-loading-bg)",color:"var(--sd-loading-fg)"}:{borderColor:"var(--sd-success-border)",background:"var(--sd-success-bg)",color:"var(--sd-success-fg)"}}function rt(e){return e==="right"?{top:16,right:16,bottom:16,left:"auto",width:"min(720px, calc(100vw - 32px))",height:"auto",borderRadius:6}:{top:"auto",right:16,bottom:16,left:16,width:"auto",height:"min(420px, 45vh)",borderRadius:6}}function tt(e){return e==="right"?{gridTemplateColumns:"minmax(210px, 280px) minmax(0, 1fr)"}:{gridTemplateColumns:"minmax(260px, 340px) minmax(0, 1fr)"}}function nt(e){return{borderRight:"1px solid var(--sd-border)",borderBottom:0}}function fr(e){return e==="error"?{background:"var(--sd-error-dot)"}:e==="success"?{background:"var(--sd-success-dot)"}:e==="loading"?{background:"var(--sd-loading-dot)"}:{background:"var(--sd-idle-dot)"}}function st(e){return e==="error"?{borderColor:"var(--sd-error-border)",color:"var(--sd-error-fg)"}:e==="success"?{borderColor:"var(--sd-success-border)",color:"var(--sd-success-fg)"}:e==="loading"?{borderColor:"var(--sd-loading-border)",color:"var(--sd-loading-fg)"}:{borderColor:"var(--sd-border)",color:"var(--sd-fg-muted)"}}const er="semaphor-devtools-stylesheet",T="semaphor-devtools",it=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../data-app-sdk-adapters/index.cjs"),i=require("react/jsx-runtime"),c=require("react"),Be=require("../chunks/source-identity-BM2FvJDP.js");require("../chunks/analyze-result-contract-CL97m8X8.js");const se=require("../chunks/search-DNCejM7Z.js"),Ke=require("../chunks/x-B6ghREd2.js"),$r=require("../chunks/validators-JzI7olk4.js");function de(e,r,t={}){return{...t,name:e,role:r}}function Or(e){return e}function Br(e){return e}const Kr={source:{semantic(e){return{...e,kind:"semantic"}},sql(e){return{...e,kind:"sql"}}},field:{measure(e,r){return de(e,"measure",r)},dimension(e,r){return de(e,"dimension",r)},date(e,r){return de(e,"date",r)},id(e,r){return de(e,"id",r)}},filter(e){return{...e,kind:"filter"}},bindInput(e,r){return{toAnalyticsInput(){const[t]=w.toSemaphorInputSnapshots([e]),n=w.toSemaphorInputBinding({...r,inputId:r.inputId||t.inputId});return{...t,inputId:n.inputId,...n.kind?{kind:n.kind}:{},...n.controlRole?{controlRole:n.controlRole}:{},...n.operator?{operator:n.operator}:{},...n.field?{field:n.field}:{},...n.relationshipHint?{relationshipHint:n.relationshipHint}:{}}}}},control(e){return{...e,kind:"control"}},sqlParam(e){return{...e,kind:"control",role:"sqlParam"}},derivedField(e){return{...e,kind:"derived_field",expressionLanguage:e.expressionLanguage||"semaphor_sql_template"}},metric(e){return{...e,queryKind:"metric"}},analysis(e){return{...e,queryKind:"analysis"}},records(e){return{...e,queryKind:"records"}},inputOptions(e){return{...e,queryKind:"inputOptions"}},sql(e){return{...e,queryKind:"sql"}},matrix(e){return{...e,queryKind:"matrix"}}},ie=10,Re=8;function Wr(e){const r=e==null?void 0:e.result;if(r)switch(r.kind){case"records":return te({title:"Records",rowNoun:"rows",records:r.records,columns:r.columns,rowCount:r.rowCount});case"sql":return te({title:"SQL Rows",rowNoun:"rows",records:r.records,columns:r.columns,rowCount:r.rowCount});case"inputOptions":return te({title:"Options",rowNoun:"options",records:r.options.slice(0,ie).map(t=>{var n;return{label:t.label,value:t.value,count:t.count,disambiguation:(n=t.disambiguation)==null?void 0:n.join(" / ")}}),columns:[{key:"label",label:"Label"},{key:"value",label:"Value"},{key:"count",label:"Count"},{key:"disambiguation",label:"Disambiguation"}],rowCount:r.rowCount??r.options.length});case"metric":{const t=[{metric:"value",value:r.value}];return r.comparison&&t.push({metric:`${r.comparison.kind} value`,value:r.comparison.value},{metric:"delta",value:r.comparison.delta},{metric:"deltaPercent",value:r.comparison.deltaPercent}),te({title:"Metric",rowNoun:"values",records:t,columns:[{key:"metric",label:"Metric"},{key:"value",label:"Value"}],rowCount:t.length})}case"matrix":return te({title:"Matrix Cells",rowNoun:"cells",records:r.cells.slice(0,ie).map(t=>{const n=r.nodesById[t.rowId],s=t.columnId?r.nodesById[t.columnId]:void 0,o=r.measuresById[t.measureId];return{row:(n==null?void 0:n.label)||t.rowId,column:(s==null?void 0:s.label)||t.columnId||"Total",measure:(o==null?void 0:o.label)||t.measureId,value:t.formattedValue??t.value,role:t.role}}),columns:[{key:"row",label:"Row"},{key:"column",label:"Column"},{key:"measure",label:"Measure"},{key:"value",label:"Value"},{key:"role",label:"Role"}],rowCount:r.rowCount??r.cells.length});default:return _r(r)}}function te({title:e,rowNoun:r,records:t,columns:n,rowCount:s}){const o=Mr(n,t);if(!o.length)return;const u=s??t.length,p=t.slice(0,ie);return{title:e,summary:`${Pr(u)} ${r}`,columns:o.slice(0,Re),rows:p,truncatedRows:u>p.length,truncatedColumns:o.length>Re}}function Mr(e,r){if(e!=null&&e.length)return e.filter(n=>n.key).map(n=>({key:n.key,label:n.label||n.key}));const t=new Set;return r.slice(0,ie).forEach(n=>{Object.keys(n).forEach(s=>t.add(s))}),[...t].map(n=>({key:n,label:n}))}function _r(e){throw new Error(`Unhandled Semaphor result kind: ${ur(e)}`)}function Nr(e){return e===null?"null":e===void 0?"":typeof e=="string"?Xe(e):typeof e=="number"||typeof e=="boolean"?String(e):Xe(ur(e))}function Pr(e){return typeof e=="number"?e.toLocaleString():"-"}function ur(e){return JSON.stringify(e,null,2)??"undefined"}function Xe(e){return e.length>80?`${e.slice(0,77)}...`:e}function ye(e){return e.viewTitle||e.queryLabel||e.viewId||e.queryId}function zr(e){if(e.label)return e.label;if(e.queryKind!=="inputOptions")return;const t=e.labelField.label||e.valueField.label||e.labelField.name||e.valueField.name||e.inputId;return`${Fr(t)} Options`}function Fr(e){return(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\bfilter\b/gi," ").replace(/\boptions?\b/gi," ").replace(/\bid\b/gi," ").replace(/\s+/g," ").trim()||e).split(" ").filter(Boolean).map(n=>n===n.toUpperCase()&&n.length>1?n:`${n.slice(0,1).toUpperCase()}${n.slice(1)}`).join(" ")}function We(e){return e.flatMap(r=>{var y,m,v,g;const t=r.latestAttempt,n=t==null?void 0:t.executionResult,s=xe((y=n==null?void 0:n.validation)==null?void 0:y.warnings),o=xe((m=n==null?void 0:n.validation)==null?void 0:m.errors),u=Ur((v=n==null?void 0:n.coverage)==null?void 0:v.missingObligations),p=xe((g=n==null?void 0:n.coverage)==null?void 0:g.warnings),d=[],f=ye(r);(t==null?void 0:t.status)==="error"&&d.push({trace:r,tone:"error",title:f,message:t.errorMessage||"Query attempt failed."});for(const h of r.clientWarnings)d.push({trace:r,tone:"warning",title:f,message:h});for(const h of s)d.push({trace:r,tone:"warning",title:f,...h});for(const h of o)d.push({trace:r,tone:"error",title:f,...h});for(const h of u)d.push({trace:r,tone:"warning",title:f,message:h});for(const h of p)d.push({trace:r,tone:"warning",title:f,...h});return d})}function Hr(e){return{traceId:e.trace.traceId,queryId:e.trace.queryId,viewId:e.trace.viewId,viewTitle:e.trace.viewTitle,queryLabel:e.trace.queryLabel,severity:e.tone,title:e.title,message:e.message,code:e.code,path:e.path}}function Vr(e,r){return e.filter(t=>t.trace.traceId===r.traceId).length}function Qr(e){const r=We(e),t=e.filter(u=>{var p;return((p=u.latestAttempt)==null?void 0:p.status)==="error"}).length,n=e.filter(u=>{var p;return((p=u.latestAttempt)==null?void 0:p.status)==="loading"}).length,s=r.filter(u=>u.tone==="error").length,o=r.filter(u=>u.tone==="warning").length;return{total:e.length,failed:t,loading:n,errorCount:s,warningCount:o,issueCount:r.length,severity:t||s?"error":o?"warning":n?"loading":"ok"}}function Ur(e){return Array.isArray(e)?e.filter(r=>typeof r=="string"):[]}function xe(e){return Array.isArray(e)?e.map(Gr).filter(r=>!!r):[]}function Gr(e){if(typeof e=="string")return{message:e};if(!e||typeof e!="object"||Array.isArray(e))return;const r=e,t=typeof r.message=="string"?r.message:"",n=typeof r.code=="string"?r.code:"",s=typeof r.path=="string"?r.path:"";return t&&n?{message:s?`${t} (${n}, ${s})`:`${t} (${n})`,code:n,...s?{path:s}:{}}:t?{message:t,...s?{path:s}:{}}:n?{message:n,code:n}:void 0}function Jr(e){if(!e.enabled)return e;const r=e.queries.map(cr);return{enabled:e.enabled,queries:r,issues:e.issues,getQuery:t=>r.find(n=>n.queryId===t),getQueries:t=>r.filter(n=>n.queryId===t)}}function Ze(e){return e?cr(e):void 0}function cr(e){var r;return(r=e==null?void 0:e.latestAttempt)!=null&&r.executionResult?{...e,latestAttempt:{...e.latestAttempt,executionResult:Yr(e.latestAttempt.executionResult)}}:e}function Yr(e){const{compiledQuery:r,intent:t,result:n,...s}=e,o=Xr(s.metadata);return{...s,...o?{metadata:o}:{}}}function Xr(e){if(!e||typeof e!="object"||Array.isArray(e))return e;const r=e.dataAppDebug;if(!r||typeof r!="object"||Array.isArray(r))return e;const{compiledSql:t,...n}=r;return{...e,dataAppDebug:n}}function Zr(e){return e==="relative"?{position:"relative",top:"auto",right:"auto",bottom:"auto",left:"auto"}:{top:e.startsWith("top")?20:"auto",right:e.endsWith("right")?20:"auto",bottom:e.startsWith("bottom")?20:"auto",left:e.endsWith("left")?20:"auto"}}function et(e){return e==="error"?{borderColor:"var(--sd-error-border)",background:"var(--sd-error-bg)",color:"var(--sd-error-fg)"}:e==="warning"?{borderColor:"var(--sd-warning-border)",background:"var(--sd-warning-bg)",color:"var(--sd-warning-fg)"}:e==="loading"?{borderColor:"var(--sd-loading-border)",background:"var(--sd-loading-bg)",color:"var(--sd-loading-fg)"}:{borderColor:"var(--sd-success-border)",background:"var(--sd-success-bg)",color:"var(--sd-success-fg)"}}function rt(e){return e==="right"?{top:16,right:16,bottom:16,left:"auto",width:"min(720px, calc(100vw - 32px))",height:"auto",borderRadius:6}:{top:"auto",right:16,bottom:16,left:16,width:"auto",height:"min(420px, 45vh)",borderRadius:6}}function tt(e){return e==="right"?{gridTemplateColumns:"minmax(210px, 280px) minmax(0, 1fr)"}:{gridTemplateColumns:"minmax(260px, 340px) minmax(0, 1fr)"}}function nt(e){return{borderRight:"1px solid var(--sd-border)",borderBottom:0}}function fr(e){return e==="error"?{background:"var(--sd-error-dot)"}:e==="success"?{background:"var(--sd-success-dot)"}:e==="loading"?{background:"var(--sd-loading-dot)"}:{background:"var(--sd-idle-dot)"}}function st(e){return e==="error"?{borderColor:"var(--sd-error-border)",color:"var(--sd-error-fg)"}:e==="success"?{borderColor:"var(--sd-success-border)",color:"var(--sd-success-fg)"}:e==="loading"?{borderColor:"var(--sd-loading-border)",color:"var(--sd-loading-fg)"}:{borderColor:"var(--sd-border)",color:"var(--sd-fg-muted)"}}const er="semaphor-devtools-stylesheet",T="semaphor-devtools",it=`
2
2
  .${T} {
3
3
  --sd-bg: #ffffff;
4
4
  --sd-bg-muted: #fafafa;
@@ -3,10 +3,10 @@ import { jsxs as p, Fragment as yr, jsx as a } from "react/jsx-runtime";
3
3
  import { createContext as Ie, useContext as Q, useState as F, useRef as E, useEffect as B, useMemo as I, Fragment as Gr, useId as hr, useCallback as O, useReducer as Jr } from "react";
4
4
  import { a as Yr, m as Xr } from "../chunks/source-identity-Cv4Nm3TM.js";
5
5
  import { d as ro } from "../chunks/source-identity-Cv4Nm3TM.js";
6
- import "../chunks/analyze-result-contract-DPjm6btg.js";
6
+ import "../chunks/analyze-result-contract-B0O3oIYu.js";
7
7
  import { M as Zr, a as et, S as rt, E as tt, C as nt } from "../chunks/search-BHsQIWBV.js";
8
8
  import { X as it, C as ot, j as st } from "../chunks/x-CXDkqdur.js";
9
- import { b as at } from "../chunks/validators-C-_9Ew5G.js";
9
+ import { b as at } from "../chunks/validators-UqQI3Cg_.js";
10
10
  function me(e, r, t = {}) {
11
11
  return {
12
12
  ...t,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../chunks/operators-DrTQsJXv.js"),m=require("../chunks/source-identity-BM2FvJDP.js");require("../chunks/analyze-result-contract-8nxUOWp8.js");function p(i){var n,e,a;const t=b(i);return{version:1,kind:"metric",id:i.id,label:i.label,source:u(i),measures:t,primaryMeasure:M(i,t),dateField:i.dateField?o(i.dateField,"date"):void 0,timeGrain:i.timeGrain,dimensions:(n=i.dimensions)==null?void 0:n.map(r=>o(r,"dimension")),comparison:G(i.comparison),orderBy:i.orderBy?{field:o(i.orderBy.field),direction:i.orderBy.direction}:void 0,inputs:l(i.inputs),...(e=i.filters)!=null&&e.length?{filters:i.filters}:{},...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},limit:i.limit,...(a=i.derivedFields)!=null&&a.length?{derivedFields:i.derivedFields}:{}}}function c(i){return{...p(i),...i.timeWindow?{timeWindow:i.timeWindow}:{},...i.analysis?{analysis:i.analysis}:{}}}function F(i){return{...i.chartTitle?{chartTitle:i.chartTitle}:{},...i.chartType?{chartType:i.chartType}:{},...i.driverMode?{driverMode:i.driverMode}:{},...i.includePopulation!==void 0?{includePopulation:i.includePopulation}:{},...i.calendarContext?{calendarContext:i.calendarContext}:{}}}function M(i,t){if(!i.primaryMeasure)return t[0]||{name:"",role:"measure"};const n=o(i.primaryMeasure,"measure"),e=k(n,t),a=e.length===1?e[0]:void 0;return a?I(n,a):n}function b(i){const t=[];for(const n of i.measures.map(e=>o(e,"measure"))){if(!n.name)continue;const e=t.findIndex(a=>R(a,n));if(e===-1){t.push(n);continue}t[e]=I(t[e],n)}return t}function R(i,t){return m.semaphorFieldRefsMatch(i,t)&&d(i)===d(t)}function H(i,t){return d(t)===d(i)}function w(i,t){return t.name!==i.name||i.source&&!m.semaphorFieldRefsMatch(t,i)?!1:H(i,t)}function k(i,t){const n=t.filter(e=>w(i,e));return i.aggregate!==void 0,n}function d(i){return(i.aggregate||"SUM").toUpperCase()}function I(i,t){if(i.aggregate&&t.aggregate&&i.aggregate!==t.aggregate)throw new Error(`Measure "${i.name}" was requested with conflicting aggregate semantics: ${i.aggregate} and ${t.aggregate}.`);return{...m.preferSemaphorFieldRefMetadata(i,t),aggregate:i.aggregate||t.aggregate}}function A(i){var n,e;if("sort"in i)throw new Error("semaphor.records supports orderBy for a single deterministic sort. Multiple sort clauses are not supported by the analytics protocol yet.");if(!V(i))throw new Error("semaphor.records needs at least one field.");const t=B(i.fields);return{version:1,kind:"records",id:i.id,label:i.label,source:u(i),fields:t,dateField:i.dateField?o(i.dateField,"date"):void 0,timeGrain:i.timeGrain,...i.timeWindow?{timeWindow:i.timeWindow}:{},...(n=i.filters)!=null&&n.length?{filters:i.filters}:{},orderBy:i.orderBy?{field:o(i.orderBy.field),direction:i.orderBy.direction}:void 0,inputs:l(i.inputs),...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},limit:i.limit,...i.pagination?{pagination:i.pagination}:{},...i.totals?{totals:{mode:"server",measures:i.totals.measures.map(a=>o(a,"measure"))}}:{},...(e=i.derivedFields)!=null&&e.length?{derivedFields:i.derivedFields}:{}}}function B(i){return i.map(t=>{const n=o(t);if(!n.role)throw new Error(`semaphor.records field "${n.name}" needs an explicit role.`);return n})}function x(i){var t,n,e;return{version:1,kind:"inputOptions",id:i.id,label:i.label,inputId:i.inputId,source:u(i),labelField:o(i.labelField,"dimension"),valueField:o(i.valueField,"dimension"),...i.searchField?{searchField:o(i.searchField,"dimension")}:{},...(t=i.disambiguationFields)!=null&&t.length?{disambiguationFields:i.disambiguationFields.map(a=>o(a,"dimension"))}:{},...i.population?{population:i.population}:{},...i.dependencies?{dependencies:i.dependencies}:{},search:i.search,limit:i.limit,...(n=i.inputs)!=null&&n.length?{inputs:i.inputs.map(a=>f(a))}:{},...(e=i.derivedFields)!=null&&e.length?{derivedFields:i.derivedFields}:{}}}function O(i){var t;return{version:1,kind:"sql",id:i.id,label:i.label,source:i.source,sql:i.sql,...i.defaultParameters?{defaultParameters:i.defaultParameters}:{},...i.pythonCode?{pythonCode:i.pythonCode}:{},...(t=i.fields)!=null&&t.length?{fields:i.fields.map(n=>o(n))}:{},inputs:l(i.inputs),limit:i.limit,...i.pagination?{pagination:i.pagination}:{},rationale:i.rationale}}function C(i){var t,n;return{version:1,kind:"matrix",id:i.id,label:i.label,source:u(i),rows:i.rows.map(e=>g(e,"dimension")),...i.columns?{columns:i.columns.map(e=>g(e,"dimension"))}:{},values:i.values.map(P),...(t=i.filters)!=null&&t.length?{filters:i.filters}:{},inputs:l(i.inputs),...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},...i.totals?{totals:i.totals}:{},...(n=i.sort)!=null&&n.length?{sort:i.sort}:{},...i.expansion?{expansion:i.expansion}:{},...i.layout?{layout:i.layout}:{},...i.displayLimits?{displayLimits:i.displayLimits}:{}}}function g(i,t){return z(i)?{...i,field:o(i.field,t)}:{field:o(i,t)}}function P(i){return T(i)?{...i,field:o(i.field,"measure")}:{field:o(i,"measure"),aggregate:i.aggregate}}function z(i){return"field"in i}function T(i){return"field"in i}function f(i){if("toAnalyticsInput"in i){const r=i.toAnalyticsInput();return{inputId:r.inputId,kind:r.kind,...r.controlRole?{controlRole:r.controlRole}:{},...r.operator?{operator:r.operator}:{},...r.field?{field:r.field}:{},...r.relationshipHint?{relationshipHint:r.relationshipHint}:{}}}if("id"in i){const r=h(i);return{inputId:r.inputId,kind:r.kind,...r.controlRole?{controlRole:r.controlRole}:{},...r.operator?{operator:r.operator}:{},...r.field?{field:r.field}:{},...r.relationshipHint?{relationshipHint:r.relationshipHint}:{}}}const t="kind"in i?i.kind:void 0,n="operator"in i?S(i.operator,i.inputId):void 0,e="controlRole"in i?i.controlRole:"role"in i?i.role:void 0,a=q(e)?e:void 0;return{inputId:i.inputId,...t?{kind:t}:{},...a?{controlRole:a}:{},...n?{operator:n}:{},...i.field?{field:i.field}:{},...i.relationshipHint?{relationshipHint:i.relationshipHint}:{}}}function q(i){return i==="grain"||i==="measure"||i==="dimension"||i==="aggregation"||i==="sqlParam"}function W(i){const t=l(i);return t.length>0?t:void 0}function y(i){return(i||[]).map(L)}function $(i){return y(i).filter(t=>t.isActive)}function h(i){if(i.kind==="filter"){const t=S(i.operator,i.id);return{inputId:i.id,kind:i.kind,label:i.label,field:o(i.field,"dimension"),operator:t||"in",...i.relationshipHint?{relationshipHint:i.relationshipHint}:{}}}return{inputId:i.id,kind:i.kind,label:i.label,controlRole:i.role}}function E(i=[]){return i.map(t=>typeof t=="object"?t:{label:String(t),value:t})}function s(i){return i==null?!1:Array.isArray(i)?i.length>0:typeof i=="string"?i.trim().length>0:!0}function L(i){if("toAnalyticsInput"in i)return i.toAnalyticsInput();if("kind"in i&&"isActive"in i)return i;if("id"in i){const t=h(i),n=Object.prototype.hasOwnProperty.call(i,"value")?i.value:i.defaultValue;return{inputId:t.inputId,kind:t.kind,label:t.label,...t.field?{field:t.field}:{},...t.operator?{operator:t.operator}:{},...t.controlRole?{controlRole:t.controlRole}:{},...t.relationshipHint?{relationshipHint:t.relationshipHint}:{},value:n,isActive:s(n)}}return{...i,kind:"filter",isActive:s(i.value),value:i.value}}function u(i){return i.source}function V(i){var t;return!!((t=i.fields)!=null&&t.length)}function o(i,t){return{...i,role:i.role||t}}function l(i){return(i||[]).map(f)}function G(i){if(i)return i}function S(i,t){if(i===void 0)return;const n=v.normalizeSemaphorInputOperator(i);if(!n)throw new Error(`useSemaphorInput "${t}" uses unsupported filter operator "${i}".`);return n}exports.hasSemaphorInputValue=s;exports.normalizeSemaphorInputOptions=E;exports.toSemaphorActiveInputSnapshots=$;exports.toSemaphorAnalysisIntent=c;exports.toSemaphorAnalysisQueryOptions=F;exports.toSemaphorInputBinding=f;exports.toSemaphorInputBindings=W;exports.toSemaphorInputOptionsIntent=x;exports.toSemaphorInputSnapshots=y;exports.toSemaphorInputSpec=h;exports.toSemaphorMatrixIntent=C;exports.toSemaphorMetricIntent=p;exports.toSemaphorRecordsIntent=A;exports.toSemaphorSqlIntent=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../chunks/operators-DrTQsJXv.js"),m=require("../chunks/source-identity-BM2FvJDP.js");require("../chunks/analyze-result-contract-CL97m8X8.js");function p(i){var n,e,a;const t=b(i);return{version:1,kind:"metric",id:i.id,label:i.label,source:u(i),measures:t,primaryMeasure:M(i,t),dateField:i.dateField?o(i.dateField,"date"):void 0,timeGrain:i.timeGrain,dimensions:(n=i.dimensions)==null?void 0:n.map(r=>o(r,"dimension")),comparison:G(i.comparison),orderBy:i.orderBy?{field:o(i.orderBy.field),direction:i.orderBy.direction}:void 0,inputs:l(i.inputs),...(e=i.filters)!=null&&e.length?{filters:i.filters}:{},...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},limit:i.limit,...(a=i.derivedFields)!=null&&a.length?{derivedFields:i.derivedFields}:{}}}function c(i){return{...p(i),...i.timeWindow?{timeWindow:i.timeWindow}:{},...i.analysis?{analysis:i.analysis}:{}}}function F(i){return{...i.chartTitle?{chartTitle:i.chartTitle}:{},...i.chartType?{chartType:i.chartType}:{},...i.driverMode?{driverMode:i.driverMode}:{},...i.includePopulation!==void 0?{includePopulation:i.includePopulation}:{},...i.calendarContext?{calendarContext:i.calendarContext}:{}}}function M(i,t){if(!i.primaryMeasure)return t[0]||{name:"",role:"measure"};const n=o(i.primaryMeasure,"measure"),e=k(n,t),a=e.length===1?e[0]:void 0;return a?I(n,a):n}function b(i){const t=[];for(const n of i.measures.map(e=>o(e,"measure"))){if(!n.name)continue;const e=t.findIndex(a=>R(a,n));if(e===-1){t.push(n);continue}t[e]=I(t[e],n)}return t}function R(i,t){return m.semaphorFieldRefsMatch(i,t)&&d(i)===d(t)}function H(i,t){return d(t)===d(i)}function w(i,t){return t.name!==i.name||i.source&&!m.semaphorFieldRefsMatch(t,i)?!1:H(i,t)}function k(i,t){const n=t.filter(e=>w(i,e));return i.aggregate!==void 0,n}function d(i){return(i.aggregate||"SUM").toUpperCase()}function I(i,t){if(i.aggregate&&t.aggregate&&i.aggregate!==t.aggregate)throw new Error(`Measure "${i.name}" was requested with conflicting aggregate semantics: ${i.aggregate} and ${t.aggregate}.`);return{...m.preferSemaphorFieldRefMetadata(i,t),aggregate:i.aggregate||t.aggregate}}function A(i){var n,e;if("sort"in i)throw new Error("semaphor.records supports orderBy for a single deterministic sort. Multiple sort clauses are not supported by the analytics protocol yet.");if(!V(i))throw new Error("semaphor.records needs at least one field.");const t=B(i.fields);return{version:1,kind:"records",id:i.id,label:i.label,source:u(i),fields:t,dateField:i.dateField?o(i.dateField,"date"):void 0,timeGrain:i.timeGrain,...i.timeWindow?{timeWindow:i.timeWindow}:{},...(n=i.filters)!=null&&n.length?{filters:i.filters}:{},orderBy:i.orderBy?{field:o(i.orderBy.field),direction:i.orderBy.direction}:void 0,inputs:l(i.inputs),...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},limit:i.limit,...i.pagination?{pagination:i.pagination}:{},...i.totals?{totals:{mode:"server",measures:i.totals.measures.map(a=>o(a,"measure"))}}:{},...(e=i.derivedFields)!=null&&e.length?{derivedFields:i.derivedFields}:{}}}function B(i){return i.map(t=>{const n=o(t);if(!n.role)throw new Error(`semaphor.records field "${n.name}" needs an explicit role.`);return n})}function x(i){var t,n,e;return{version:1,kind:"inputOptions",id:i.id,label:i.label,inputId:i.inputId,source:u(i),labelField:o(i.labelField,"dimension"),valueField:o(i.valueField,"dimension"),...i.searchField?{searchField:o(i.searchField,"dimension")}:{},...(t=i.disambiguationFields)!=null&&t.length?{disambiguationFields:i.disambiguationFields.map(a=>o(a,"dimension"))}:{},...i.population?{population:i.population}:{},...i.dependencies?{dependencies:i.dependencies}:{},search:i.search,limit:i.limit,...(n=i.inputs)!=null&&n.length?{inputs:i.inputs.map(a=>f(a))}:{},...(e=i.derivedFields)!=null&&e.length?{derivedFields:i.derivedFields}:{}}}function O(i){var t;return{version:1,kind:"sql",id:i.id,label:i.label,source:i.source,sql:i.sql,...i.defaultParameters?{defaultParameters:i.defaultParameters}:{},...i.pythonCode?{pythonCode:i.pythonCode}:{},...(t=i.fields)!=null&&t.length?{fields:i.fields.map(n=>o(n))}:{},inputs:l(i.inputs),limit:i.limit,...i.pagination?{pagination:i.pagination}:{},rationale:i.rationale}}function C(i){var t,n;return{version:1,kind:"matrix",id:i.id,label:i.label,source:u(i),rows:i.rows.map(e=>g(e,"dimension")),...i.columns?{columns:i.columns.map(e=>g(e,"dimension"))}:{},values:i.values.map(P),...(t=i.filters)!=null&&t.length?{filters:i.filters}:{},inputs:l(i.inputs),...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},...i.totals?{totals:i.totals}:{},...(n=i.sort)!=null&&n.length?{sort:i.sort}:{},...i.expansion?{expansion:i.expansion}:{},...i.layout?{layout:i.layout}:{},...i.displayLimits?{displayLimits:i.displayLimits}:{}}}function g(i,t){return z(i)?{...i,field:o(i.field,t)}:{field:o(i,t)}}function P(i){return T(i)?{...i,field:o(i.field,"measure")}:{field:o(i,"measure"),aggregate:i.aggregate}}function z(i){return"field"in i}function T(i){return"field"in i}function f(i){if("toAnalyticsInput"in i){const r=i.toAnalyticsInput();return{inputId:r.inputId,kind:r.kind,...r.controlRole?{controlRole:r.controlRole}:{},...r.operator?{operator:r.operator}:{},...r.field?{field:r.field}:{},...r.relationshipHint?{relationshipHint:r.relationshipHint}:{}}}if("id"in i){const r=h(i);return{inputId:r.inputId,kind:r.kind,...r.controlRole?{controlRole:r.controlRole}:{},...r.operator?{operator:r.operator}:{},...r.field?{field:r.field}:{},...r.relationshipHint?{relationshipHint:r.relationshipHint}:{}}}const t="kind"in i?i.kind:void 0,n="operator"in i?S(i.operator,i.inputId):void 0,e="controlRole"in i?i.controlRole:"role"in i?i.role:void 0,a=q(e)?e:void 0;return{inputId:i.inputId,...t?{kind:t}:{},...a?{controlRole:a}:{},...n?{operator:n}:{},...i.field?{field:i.field}:{},...i.relationshipHint?{relationshipHint:i.relationshipHint}:{}}}function q(i){return i==="grain"||i==="measure"||i==="dimension"||i==="aggregation"||i==="sqlParam"}function W(i){const t=l(i);return t.length>0?t:void 0}function y(i){return(i||[]).map(L)}function $(i){return y(i).filter(t=>t.isActive)}function h(i){if(i.kind==="filter"){const t=S(i.operator,i.id);return{inputId:i.id,kind:i.kind,label:i.label,field:o(i.field,"dimension"),operator:t||"in",...i.relationshipHint?{relationshipHint:i.relationshipHint}:{}}}return{inputId:i.id,kind:i.kind,label:i.label,controlRole:i.role}}function E(i=[]){return i.map(t=>typeof t=="object"?t:{label:String(t),value:t})}function s(i){return i==null?!1:Array.isArray(i)?i.length>0:typeof i=="string"?i.trim().length>0:!0}function L(i){if("toAnalyticsInput"in i)return i.toAnalyticsInput();if("kind"in i&&"isActive"in i)return i;if("id"in i){const t=h(i),n=Object.prototype.hasOwnProperty.call(i,"value")?i.value:i.defaultValue;return{inputId:t.inputId,kind:t.kind,label:t.label,...t.field?{field:t.field}:{},...t.operator?{operator:t.operator}:{},...t.controlRole?{controlRole:t.controlRole}:{},...t.relationshipHint?{relationshipHint:t.relationshipHint}:{},value:n,isActive:s(n)}}return{...i,kind:"filter",isActive:s(i.value),value:i.value}}function u(i){return i.source}function V(i){var t;return!!((t=i.fields)!=null&&t.length)}function o(i,t){return{...i,role:i.role||t}}function l(i){return(i||[]).map(f)}function G(i){if(i)return i}function S(i,t){if(i===void 0)return;const n=v.normalizeSemaphorInputOperator(i);if(!n)throw new Error(`useSemaphorInput "${t}" uses unsupported filter operator "${i}".`);return n}exports.hasSemaphorInputValue=s;exports.normalizeSemaphorInputOptions=E;exports.toSemaphorActiveInputSnapshots=$;exports.toSemaphorAnalysisIntent=c;exports.toSemaphorAnalysisQueryOptions=F;exports.toSemaphorInputBinding=f;exports.toSemaphorInputBindings=W;exports.toSemaphorInputOptionsIntent=x;exports.toSemaphorInputSnapshots=y;exports.toSemaphorInputSpec=h;exports.toSemaphorMatrixIntent=C;exports.toSemaphorMetricIntent=p;exports.toSemaphorRecordsIntent=A;exports.toSemaphorSqlIntent=O;
@@ -1,6 +1,6 @@
1
1
  import { n as I } from "../chunks/operators-C8TxpM4C.js";
2
2
  import { s as m, p as F } from "../chunks/source-identity-Cv4Nm3TM.js";
3
- import "../chunks/analyze-result-contract-DPjm6btg.js";
3
+ import "../chunks/analyze-result-contract-B0O3oIYu.js";
4
4
  function p(i) {
5
5
  var n, r, a;
6
6
  const t = c(i);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../chunks/validators-CB9BFarT.js");require("../chunks/analyze-result-contract-8nxUOWp8.js");const q=require("../chunks/source-identity-BM2FvJDP.js"),y=require("../data-app-sdk-adapters/index.cjs"),R=require("../chunks/catalog-field-grounding-Bnx-3tE0.js");function W({intent:e,field:r,catalogField:o,relativePath:t}){const i=U({intent:e,field:r,relativePath:t});if(!i||i.allowedRelatedRoles.length===0)return!1;const a=f(r,i.selectedField),s=w(o),n=p(a);return M(s,i.allowedRelatedRoles)?n===s:!1}function J(e){return e.kind==="records"?X(e):e.kind==="metric"?Y(e):Z(e)}function w(e){const r=R.normalizeAnalyticsCatalogName(e.role);if(r==="measure")return"measure";if(r==="id")return"id";const o=R.normalizeAnalyticsCatalogDataType(e.dataType);if(r==="date"||o==="date"||o==="datetime")return"date";if(r==="dimension")return"dimension"}function M(e,r){return!!(e&&r.includes(e))}function f(e,r){const o=p(e);if(o)return e.role===o?e:{...e,role:o};const t=r?p(r):void 0;return t?{...e,role:t}:e}function u(e,r){return e.find(o=>D(o,r))}function S(e){return[...e.rows.map(r=>r.field),...(e.columns||[]).map(r=>r.field)]}function U({intent:e,field:r,relativePath:o}){if(e.kind==="records")return L(e,r,o);if(e.kind==="metric")return V(e,r,o);if(e.kind==="matrix")return G(e,r,o)}function L(e,r,o){if(o.startsWith("spec.fields."))return{allowedRelatedRoles:["dimension","date","id"]};if(o==="spec.dateField"&&!e.timeWindow)return{allowedRelatedRoles:["date"]};if(o==="spec.orderBy.field"){const t=u(B(e),r);return{selectedField:t,allowedRelatedRoles:t?x(t):[]}}}function V(e,r,o){if(o.startsWith("spec.dimensions."))return{allowedRelatedRoles:["dimension"]};if(o==="spec.orderBy.field"){const t=u(e.dimensions||[],r);return{selectedField:t,allowedRelatedRoles:t?["dimension"]:[]}}}function G(e,r,o){if(oe(o))return{allowedRelatedRoles:["dimension","date"]};if(te(o)){const t=u(S(e),r);return{selectedField:t,allowedRelatedRoles:v(t)}}}function X(e){var t,i;const r=B(e),o=(t=e.orderBy)!=null&&t.field?u(r,e.orderBy.field):void 0;return _([...r.map(a=>l(a,x(a))),...(i=e.orderBy)!=null&&i.field?[l(f(e.orderBy.field,o),o?x(o):[],{unsupportedRelatedRoleMessage:"Joined records projections support related sort fields only when the same related field is included in spec.fields.",recommendedNextStep:"Add the related sort field to spec.fields, or keep orderBy fields on the base source."})]:[]])}function Y(e){var o,t;const r=(o=e.orderBy)!=null&&o.field?u(e.dimensions||[],e.orderBy.field):void 0;return _([...e.measures.map(i=>l(i,[])),...e.primaryMeasure?[l(e.primaryMeasure,[])]:[],...(e.dimensions||[]).map(i=>l(i,["dimension"])),...e.dateField?[l({...e.dateField,role:"date"},[])]:[],...(t=e.orderBy)!=null&&t.field?[l(f(e.orderBy.field,r),r?["dimension"]:[],{unsupportedRelatedRoleMessage:"Joined metric projections support related orderBy fields only when the same related field is declared in spec.dimensions.",recommendedNextStep:"Add the related field as a metric dimension when it should participate in the grouped result, or keep orderBy fields on the base source."})]:[]])}function Z(e){const r=[...e.rows,...e.columns||[]];return _([...r.map(o=>l(o.field,v(o.field))),...r.flatMap(o=>{var a;if(((a=o.sortBy)==null?void 0:a.by.kind)!=="field")return[];const t=o.sortBy.by.field,i=u(S(e),t);return[l(f(t,i),v(i),{unsupportedRelatedRoleMessage:"Joined matrix projections support related axis sort fields only when the same related field is used as a row/column axis.",recommendedNextStep:"Use a related field as a row or column axis, or keep axis sort fields on the base source."})]}),...e.values.map(o=>l(o.field,[],{unsupportedRelatedRoleMessage:"Joined matrix projections support related row/column dimensions or dates only. Related value fields are not supported in this phase.",recommendedNextStep:"Keep matrix values on the base source, or use governed SQL for unsupported aggregate-safe joined values."})),...(e.sort||[]).flatMap(o=>{if(o.by.kind!=="field")return[];const t=o.by.field,i=u(S(e),t);return[l(f(t,i),v(i),{unsupportedRelatedRoleMessage:"Joined matrix projections support related top-level sort fields only when the same related field is used as a row/column axis.",recommendedNextStep:"Use a related field as a row or column axis, or keep matrix sort fields on the base source."})]})])}function x(e){const r=e?p(e):void 0;return r==="dimension"?["dimension"]:r==="date"?["date"]:r==="id"?["id"]:["dimension","date","id"]}function v(e){const r=e?p(e):void 0;return r==="date"?["date"]:r==="dimension"?["dimension"]:[]}function l(e,r,o={}){return{field:f(e),allowedRelatedRoles:r,...o}}function _(e){const r=[];return e.forEach(o=>{r.some(t=>ee(t,o))||r.push(o)}),r}function B(e){const r=[...e.fields];return e.dateField&&!r.some(o=>T(o,e.dateField))&&r.push({...e.dateField,role:"date"}),r}function ee(e,r){return D(e.field,r.field)&&e.allowedRelatedRoles.join("|")===r.allowedRelatedRoles.join("|")&&(e.unsupportedRelatedRoleMessage||"")===(r.unsupportedRelatedRoleMessage||"")&&(e.recommendedNextStep||"")===(r.recommendedNextStep||"")}function T(e,r){return q.semaphorFieldRefsMatch(e,r)}function D(e,r){return T(e,r)&&re(p(e),p(r))}function re(e,r){return!!(e&&(!r||e===r))}function p(e){return w(e)}function oe(e){const r=e.split(".");return r.length===4&&r[0]==="spec"&&(r[1]==="rows"||r[1]==="columns")&&b(r[2])&&r[3]==="field"}function te(e){const r=e.split(".");return r.length===6&&r[0]==="spec"&&(r[1]==="rows"||r[1]==="columns")&&b(r[2])&&r[3]==="sortBy"&&r[4]==="by"&&r[5]==="field"||r.length===5&&r[0]==="spec"&&r[1]==="sort"&&b(r[2])&&r[3]==="by"&&r[4]==="field"}function b(e){return e===void 0||e.trim()===""?!1:Number.isInteger(Number(e))&&Number(e)>=0}function ie({intent:e,field:r,relativePath:o,baseCatalog:t,fieldCatalogs:i}){const a=g(r,e.source),s=q.semaphorSourcesReferToSameDataset(a,e.source);if(!s&&!se(e.source,a))return{ok:!1,code:"invalid_source_ref",message:`Field "${r.name}" references a related Semaphor source outside the query's semantic domain.`,pathSuffix:".source",source:a};const n=s?t:k(i,a);if(!n)return{ok:!1,code:"invalid_source_ref",message:`Field "${r.name}" references a Semaphor source that is not present in the visible field catalog.`,pathSuffix:".source",source:a};const d=I(n,r,e.source);return d?!s&&!ae({intent:e,field:r,catalogField:d,relativePath:o})?{ok:!1,code:"unsupported_joined_projection",message:`Field "${r.name}" references a related Semaphor source, but this query kind does not support joined projections for that field yet.`,pathSuffix:".source",source:a}:{ok:!0,source:a,catalogField:d,usesBaseSource:s}:{ok:!1,code:"missing_field",message:`Field "${r.name}" is not visible on the selected Semaphor source.`,source:a}}function ae({intent:e,field:r,catalogField:o,relativePath:t}){return W({intent:e,field:r,catalogField:o,relativePath:t})}function se(e,r){return e.kind==="semantic"&&r.kind==="semantic"&&e.domainId===r.domainId}function k(e,r){return e.find(o=>$(o,r))}function I(e,r,o){const t=g(r,o);if($(e,t))return e.fields.find(i=>ne(i,r)&&$(e,g(i,e.source)))}function P(e){return R.normalizeAnalyticsCatalogName(e)}function g(e,r){return e.source||r}function $(e,r){return[e.source,...e.sourceAliases||[]].some(o=>q.semaphorSourcesReferToSameDataset(o,r))}function ne(e,r){return!!(e.name&&r.name&&e.name===r.name)}function z(e,r={}){const o=r.pathPrefix||"analysisOptions";if(e===void 0)return{ok:!0};if(!e||typeof e!="object"||Array.isArray(e))return c(o,"Data App analysis options must be an object.");const t=e,i={};if(t.chartTitle!==void 0){if(typeof t.chartTitle!="string")return c(`${o}.chartTitle`,'Data App analysis option "chartTitle" must be a string.');i.chartTitle=t.chartTitle}if(t.chartType!==void 0){if(typeof t.chartType!="string")return c(`${o}.chartType`,'Data App analysis option "chartType" must be a string.');i.chartType=t.chartType}if(t.driverMode!==void 0){if(!ce(t.driverMode))return c(`${o}.driverMode`,'Data App analysis option "driverMode" must be absolute_delta, largest_negative, largest_positive, positive_and_negative, or all.');i.driverMode=t.driverMode}if(t.includePopulation!==void 0){if(typeof t.includePopulation!="boolean")return c(`${o}.includePopulation`,'Data App analysis option "includePopulation" must be a boolean.');i.includePopulation=t.includePopulation}if(t.calendarContext!==void 0){const a=fe(t.calendarContext,{pathPrefix:`${o}.calendarContext`,validateTimezone:r.validateTimezone});if(!a.ok)return a;i.calendarContext=a.calendarContext}return{ok:!0,analysisOptions:i}}function de(e){const r=e.queries.map((i,a)=>le(i,a,{fieldCatalogs:e.fieldCatalogs||[],requireFieldCatalog:!!e.requireFieldCatalog,validateTimezone:e.validateTimezone})),o=r.flatMap(i=>i.diagnostics),t=r.map(i=>i.executionResult);return{ok:o.every(i=>i.severity!=="error"),diagnostics:o,queries:r,intents:r.flatMap(i=>i.intent?[i.intent]:[]),executionResults:t}}function le(e,r,o){const t=`queries.${r}`;try{const i=pe(e),a=$e(e,i),s=E.validateSemaphorAnalyticsIntent(i),n=[...ke({querySpec:e,queryId:a,intent:i,pathPrefix:t}),...s.errors.map(h=>C(h,{queryHook:e.queryHook,queryId:a,pathPrefix:t,severity:"error",intent:i})),...s.warnings.map(h=>C(h,{queryHook:e.queryHook,queryId:a,pathPrefix:t,severity:"warning",intent:i})),...ye({querySpec:e,queryId:a,intent:i,pathPrefix:t,fieldCatalogs:o.fieldCatalogs,requireFieldCatalog:o.requireFieldCatalog}),...Ie({querySpec:e,queryId:a,intent:i,pathPrefix:t,validateTimezone:o.validateTimezone})],d=be(s,n);return{queryHook:e.queryHook,queryId:a,intent:i,diagnostics:n,executionResult:j({intent:i,validation:d,diagnostics:n})}}catch(i){const a={severity:"error",code:"invalid_query_spec",message:i instanceof Error?i.message:String(i),path:t,queryHook:e.queryHook,queryId:Q(e.spec)},s=K([a]);return{queryHook:e.queryHook,queryId:a.queryId,diagnostics:[a],executionResult:j({validation:s,diagnostics:[a]})}}}function c(e,r){return{ok:!1,issues:[{code:"invalid_analysis_option",message:r,path:e}]}}function N(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function ce(e){return e==="absolute_delta"||e==="largest_negative"||e==="largest_positive"||e==="positive_and_negative"||e==="all"}function ue(e){return e.trim().length>0&&!Number.isNaN(Date.parse(e))}function fe(e,r){var d;if(!e||typeof e!="object"||Array.isArray(e))return c(r.pathPrefix,'Data App analysis option "calendarContext" must be an object.');const o=e,t=o.tz,i=o.weekStart,a=o.anchor,s=a&&typeof a=="object"&&!Array.isArray(a)?a.iso:void 0,n=typeof t=="string"?((d=r.validateTimezone)==null?void 0:d.call(r,t))??t:null;return n?typeof i!="number"||!Number.isInteger(i)||i<0||i>6?c(`${r.pathPrefix}.weekStart`,'Data App analysis option "calendarContext.weekStart" must be an integer from 0 to 6.'):a!=="now"&&!(typeof s=="string"&&ue(s))?c(`${r.pathPrefix}.anchor`,'Data App analysis option "calendarContext.anchor" must be "now" or an object with a valid iso string.'):{ok:!0,calendarContext:{tz:n,weekStart:i,anchor:a}}:c(`${r.pathPrefix}.tz`,'Data App analysis option "calendarContext.tz" must be a valid timezone string.')}function pe(e){return me(e.spec)}function me(e){if(!N(e))throw new Error("useSemaphorQuery spec must be an object.");if(e.queryKind==="metric")return y.toSemaphorMetricIntent(e);if(e.queryKind==="analysis")return y.toSemaphorAnalysisIntent(e);if(e.queryKind==="records")return y.toSemaphorRecordsIntent(e);if(e.queryKind==="sql")return y.toSemaphorSqlIntent(e);if(e.queryKind==="matrix")return y.toSemaphorMatrixIntent(e);if(e.queryKind==="inputOptions")return y.toSemaphorInputOptionsIntent(e);throw new Error("useSemaphorQuery spec.queryKind must be metric, analysis, records, inputOptions, sql, or matrix.")}function ye(e){if(e.intent.kind==="sql")return[];if(e.fieldCatalogs.length===0&&!e.requireFieldCatalog)return[];const r=k(e.fieldCatalogs,e.intent.source);if(!r)return[{severity:"error",code:"invalid_source_ref",message:`Source ref for ${e.querySpec.queryHook} does not match a visible Semaphor source.`,path:`${e.pathPrefix}.spec.source`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source}];const o=ge({...e,catalog:r}),t={...r,fields:[...r.fields,...Re(e.intent,r,e.intent.source)]};return[...o,...he({...e,fieldCatalogs:e.fieldCatalogs}),...qe({...e,catalog:t,fieldCatalogs:e.fieldCatalogs}),...ve({...e,catalog:t,fieldCatalogs:e.fieldCatalogs})]}function he(e){var o;if(e.intent.kind!=="inputOptions"||((o=e.intent.population)==null?void 0:o.kind)!=="related_population")return[];const r=e.intent.population.baseSource;return k(e.fieldCatalogs,r)?[]:[{severity:"error",code:"invalid_source_ref",message:"Input options related population baseSource does not match a visible Semaphor source.",path:`${e.pathPrefix}.spec.population.baseSource`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:r}]}function ge(e){const r=O(e.intent);if(r.length===0)return[];const o=[],t=new Set;return r.forEach((i,a)=>{const s=`${e.pathPrefix}.spec.derivedFields.${a}`,n=P(i.name);n&&(t.has(n)&&o.push({severity:"error",code:"duplicate_derived_field",message:`Derived field "${i.name}" is declared more than once.`,path:`${s}.name`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source}),t.add(n),e.catalog.fields.some(d=>P(d.name)===n)&&o.push({severity:"error",code:"derived_field_name_collision",message:`Derived field "${i.name}" conflicts with a field already visible on the selected Semaphor source.`,path:`${s}.name`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source})),Object.entries(i.inputs||{}).forEach(([d,h])=>{const m=xe(h);if(!m)return;const F=g(m,e.intent.source);if(!q.semaphorSourcesReferToSameDataset(F,e.intent.source)){o.push({severity:"error",code:"unsupported_derived_field_source",message:`Derived field "${i.name}" input "${d}" references a different Semaphor source. App-local derived fields must use fields from the query source.`,path:`${s}.inputs.${d}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:F,field:m});return}I(e.catalog,m,e.intent.source)||o.push({severity:"error",code:"missing_field",message:`Derived field "${i.name}" input "${d}" references field "${m.name}", which is not visible on the selected Semaphor source.`,path:`${s}.inputs.${d}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:F,field:m})})}),o}function qe(e){return Fe(e.intent).flatMap(({field:r,path:o})=>{const t=ie({intent:e.intent,field:r,relativePath:o,baseCatalog:e.catalog,fieldCatalogs:e.fieldCatalogs});return t.ok?[]:[{severity:"error",code:t.code,message:t.message,path:`${e.pathPrefix}.${o}${t.pathSuffix||""}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:t.source,field:r}]})}function ve(e){return("inputs"in e.intent?e.intent.inputs||[]:[]).flatMap((o,t)=>{if(!o.field)return[];const i=g(o.field,e.intent.source);if(!q.semaphorSourcesReferToSameDataset(i,e.intent.source)){if(Se(e.intent,i)){const a=k(e.fieldCatalogs,i);return a?I(a,o.field,i)?[]:[{severity:"error",code:"missing_field",message:`Input "${o.inputId}" references field "${o.field.name}", which is not visible on the selected Semaphor source.`,path:`${e.pathPrefix}.spec.inputs.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]:[{severity:"error",code:"invalid_source_ref",message:`Input "${o.inputId}" references a Semaphor source that is not present in the visible field catalog.`,path:`${e.pathPrefix}.spec.inputs.${t}.field.source`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]}return[{severity:"error",code:"unsupported_input_filter_composition",message:`Input "${o.inputId}" filters a different Semaphor source than the query, and no relationship-aware semantic validation path is available for this query kind.`,path:`${e.pathPrefix}.spec.inputs.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]}return I(e.catalog,o.field,e.intent.source)?[]:[{severity:"error",code:"missing_field",message:`Input "${o.inputId}" references field "${o.field.name}", which is not visible on the selected Semaphor source.`,path:`${e.pathPrefix}.spec.inputs.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]})}function Se(e,r){return e.source.kind==="semantic"&&r.kind==="semantic"&&r.domainId===e.source.domainId}function Ie(e){if(e.querySpec.spec.queryKind!=="analysis")return[];const r=z(e.querySpec.spec,{pathPrefix:`${e.pathPrefix}.spec`,validateTimezone:e.validateTimezone});return r.ok?[]:r.issues.map(o=>({severity:"error",code:o.code,message:o.message,path:o.path,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source}))}function ke(e){return e.querySpec.spec.queryKind!=="sql"?[]:N(e.querySpec.spec)?Object.prototype.hasOwnProperty.call(e.querySpec.spec,"parameters")?[{severity:"error",code:"deprecated_sql_parameters",message:"semaphor.sql uses defaultParameters for static SQL param(...) fallback values. The legacy parameters field is not supported.",path:`${e.pathPrefix}.spec.parameters`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id}]:[]:[]}function Fe(e){return e.kind==="metric"?[...e.measures.map((r,o)=>({field:r,path:`spec.measures.${o}`})),...e.primaryMeasure?[{field:e.primaryMeasure,path:"spec.primaryMeasure"}]:[],...e.dateField?[{field:e.dateField,path:"spec.dateField"}]:[],...(e.dimensions||[]).map((r,o)=>({field:r,path:`spec.dimensions.${o}`})),...e.orderBy?[{field:e.orderBy.field,path:"spec.orderBy.field"}]:[],...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.field`}))]:e.kind==="records"?[...e.fields.map((r,o)=>({field:r,path:`spec.fields.${o}`})),...e.dateField?[{field:e.dateField,path:"spec.dateField"}]:[],...e.orderBy?[{field:e.orderBy.field,path:"spec.orderBy.field"}]:[],...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.field`}))]:e.kind==="inputOptions"?[{field:e.labelField,path:"spec.labelField"},{field:e.valueField,path:"spec.valueField"},...e.searchField?[{field:e.searchField,path:"spec.searchField"}]:[],...(e.disambiguationFields||[]).map((r,o)=>({field:r,path:`spec.disambiguationFields.${o}`}))]:e.kind==="matrix"?[...e.rows.map((r,o)=>({field:r.field,path:`spec.rows.${o}.field`})),...e.rows.flatMap((r,o)=>{var t;return((t=r.sortBy)==null?void 0:t.by.kind)==="field"?[{field:r.sortBy.by.field,path:`spec.rows.${o}.sortBy.by.field`}]:[]}),...(e.columns||[]).map((r,o)=>({field:r.field,path:`spec.columns.${o}.field`})),...(e.columns||[]).flatMap((r,o)=>{var t;return((t=r.sortBy)==null?void 0:t.by.kind)==="field"?[{field:r.sortBy.by.field,path:`spec.columns.${o}.sortBy.by.field`}]:[]}),...e.values.map((r,o)=>({field:r.field,path:`spec.values.${o}.field`})),...(e.sort||[]).flatMap((r,o)=>r.by.kind==="field"?[{field:r.by.field,path:`spec.sort.${o}.by.field`}]:[]),...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.field`}))]:[]}function O(e){return!("derivedFields"in e)||!Array.isArray(e.derivedFields)?[]:e.derivedFields}function Re(e,r,o){return O(e).map(t=>({name:t.name,label:t.label,role:t.resultRole,dataType:t.dataType,source:r.source||o,...t.defaultAggregate?{aggregate:t.defaultAggregate}:{}}))}function xe(e){if(!(!e||typeof e!="object"))return e.field}function C(e,r){return{severity:r.severity,code:e.code||"invalid_analytics_intent",message:e.message,path:e.path?`${r.pathPrefix}.spec.${e.path}`:r.pathPrefix,queryHook:r.queryHook,queryId:r.queryId,intentId:r.intent.id,source:r.intent.source}}function be(e,r){const o=K(r);return{ok:o.ok&&e.ok,errors:H([...e.errors,...o.errors]),warnings:H([...e.warnings,...o.warnings]),repairHints:[...e.repairHints,...o.repairHints]}}function K(e){const r=e.filter(t=>t.severity==="error").map(A),o=e.filter(t=>t.severity==="warning").map(A);return{ok:r.length===0,errors:r,warnings:o,repairHints:r.map(t=>{var i,a;return{code:t.code,message:t.message,fieldRole:t.fieldRole,invalidField:(i=t.repairHint)==null?void 0:i.invalidField,recommendedNextStep:((a=t.repairHint)==null?void 0:a.recommendedNextStep)||"Update the Data App SDK query spec to use visible Semaphor source and field refs."}})}}function A(e){var r;return{code:e.code,message:e.message,path:e.path,fieldRole:e.code==="invalid_source_ref"?"source":void 0,repairHint:{code:e.code,message:e.message,invalidField:(r=e.field)==null?void 0:r.name,fieldRole:e.code==="invalid_source_ref"?"source":void 0,recommendedNextStep:e.code==="unsupported_input_filter_composition"?"Use an input field from the same Semaphor source as the query, or split the query into separate source-scoped queries.":"Update the query spec to use a visible Semaphor source and field ref."}}}function H(e){const r=new Set;return e.filter(o=>{const t=`${o.code}:${o.path||""}:${o.message}`;return r.has(t)?!1:(r.add(t),!0)})}function j(e){var o,t;const r=e.diagnostics.filter(i=>i.severity==="error");return{intentId:(o=e.intent)==null?void 0:o.id,status:r.length?"failed":"answered",resultShape:(t=e.intent)==null?void 0:t.kind,intent:e.intent,validation:e.validation,coverage:{answeredObligations:r.length?[]:["query_spec_validation"],missingObligations:r.length?["query_spec_validation"]:[],warnings:e.validation.warnings},missingFields:r.filter(i=>i.code==="missing_field").flatMap(i=>{var a;return(a=i.field)!=null&&a.name?[i.field.name]:[]}),warnings:e.diagnostics.filter(i=>i.severity==="warning").map(i=>i.message),metadata:{validationKind:"data_app_sdk_query_spec"}}}function $e(e,r){return r.id||Q(e.spec)}function Q(e){if(!e||typeof e!="object"||!("id"in e))return;const r=e.id;return typeof r=="string"&&r.trim()?r:void 0}exports.fieldWithSelectedProjectionRole=f;exports.findMatchingRelatedProjectionField=u;exports.isAllowedRelatedProjectionRole=M;exports.matrixAxisFieldsForPolicy=S;exports.normalizeSemaphorAnalysisQueryOptions=z;exports.normalizeSemaphorFieldRole=w;exports.relatedProjectionFieldCandidatesForIntent=J;exports.validateSemaphorDataAppQuerySpecs=de;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../chunks/validators-JzI7olk4.js");require("../chunks/analyze-result-contract-CL97m8X8.js");const q=require("../chunks/source-identity-BM2FvJDP.js"),y=require("../data-app-sdk-adapters/index.cjs"),R=require("../chunks/catalog-field-grounding-Bnx-3tE0.js");function W({intent:e,field:r,catalogField:o,relativePath:t}){const i=U({intent:e,field:r,relativePath:t});if(!i||i.allowedRelatedRoles.length===0)return!1;const a=f(r,i.selectedField),s=w(o),n=p(a);return M(s,i.allowedRelatedRoles)?n===s:!1}function J(e){return e.kind==="records"?X(e):e.kind==="metric"?Y(e):Z(e)}function w(e){const r=R.normalizeAnalyticsCatalogName(e.role);if(r==="measure")return"measure";if(r==="id")return"id";const o=R.normalizeAnalyticsCatalogDataType(e.dataType);if(r==="date"||o==="date"||o==="datetime")return"date";if(r==="dimension")return"dimension"}function M(e,r){return!!(e&&r.includes(e))}function f(e,r){const o=p(e);if(o)return e.role===o?e:{...e,role:o};const t=r?p(r):void 0;return t?{...e,role:t}:e}function u(e,r){return e.find(o=>D(o,r))}function S(e){return[...e.rows.map(r=>r.field),...(e.columns||[]).map(r=>r.field)]}function U({intent:e,field:r,relativePath:o}){if(e.kind==="records")return L(e,r,o);if(e.kind==="metric")return V(e,r,o);if(e.kind==="matrix")return G(e,r,o)}function L(e,r,o){if(o.startsWith("spec.fields."))return{allowedRelatedRoles:["dimension","date","id"]};if(o==="spec.dateField"&&!e.timeWindow)return{allowedRelatedRoles:["date"]};if(o==="spec.orderBy.field"){const t=u(B(e),r);return{selectedField:t,allowedRelatedRoles:t?x(t):[]}}}function V(e,r,o){if(o.startsWith("spec.dimensions."))return{allowedRelatedRoles:["dimension"]};if(o==="spec.orderBy.field"){const t=u(e.dimensions||[],r);return{selectedField:t,allowedRelatedRoles:t?["dimension"]:[]}}}function G(e,r,o){if(oe(o))return{allowedRelatedRoles:["dimension","date"]};if(te(o)){const t=u(S(e),r);return{selectedField:t,allowedRelatedRoles:v(t)}}}function X(e){var t,i;const r=B(e),o=(t=e.orderBy)!=null&&t.field?u(r,e.orderBy.field):void 0;return _([...r.map(a=>l(a,x(a))),...(i=e.orderBy)!=null&&i.field?[l(f(e.orderBy.field,o),o?x(o):[],{unsupportedRelatedRoleMessage:"Joined records projections support related sort fields only when the same related field is included in spec.fields.",recommendedNextStep:"Add the related sort field to spec.fields, or keep orderBy fields on the base source."})]:[]])}function Y(e){var o,t;const r=(o=e.orderBy)!=null&&o.field?u(e.dimensions||[],e.orderBy.field):void 0;return _([...e.measures.map(i=>l(i,[])),...e.primaryMeasure?[l(e.primaryMeasure,[])]:[],...(e.dimensions||[]).map(i=>l(i,["dimension"])),...e.dateField?[l({...e.dateField,role:"date"},[])]:[],...(t=e.orderBy)!=null&&t.field?[l(f(e.orderBy.field,r),r?["dimension"]:[],{unsupportedRelatedRoleMessage:"Joined metric projections support related orderBy fields only when the same related field is declared in spec.dimensions.",recommendedNextStep:"Add the related field as a metric dimension when it should participate in the grouped result, or keep orderBy fields on the base source."})]:[]])}function Z(e){const r=[...e.rows,...e.columns||[]];return _([...r.map(o=>l(o.field,v(o.field))),...r.flatMap(o=>{var a;if(((a=o.sortBy)==null?void 0:a.by.kind)!=="field")return[];const t=o.sortBy.by.field,i=u(S(e),t);return[l(f(t,i),v(i),{unsupportedRelatedRoleMessage:"Joined matrix projections support related axis sort fields only when the same related field is used as a row/column axis.",recommendedNextStep:"Use a related field as a row or column axis, or keep axis sort fields on the base source."})]}),...e.values.map(o=>l(o.field,[],{unsupportedRelatedRoleMessage:"Joined matrix projections support related row/column dimensions or dates only. Related value fields are not supported in this phase.",recommendedNextStep:"Keep matrix values on the base source, or use governed SQL for unsupported aggregate-safe joined values."})),...(e.sort||[]).flatMap(o=>{if(o.by.kind!=="field")return[];const t=o.by.field,i=u(S(e),t);return[l(f(t,i),v(i),{unsupportedRelatedRoleMessage:"Joined matrix projections support related top-level sort fields only when the same related field is used as a row/column axis.",recommendedNextStep:"Use a related field as a row or column axis, or keep matrix sort fields on the base source."})]})])}function x(e){const r=e?p(e):void 0;return r==="dimension"?["dimension"]:r==="date"?["date"]:r==="id"?["id"]:["dimension","date","id"]}function v(e){const r=e?p(e):void 0;return r==="date"?["date"]:r==="dimension"?["dimension"]:[]}function l(e,r,o={}){return{field:f(e),allowedRelatedRoles:r,...o}}function _(e){const r=[];return e.forEach(o=>{r.some(t=>ee(t,o))||r.push(o)}),r}function B(e){const r=[...e.fields];return e.dateField&&!r.some(o=>T(o,e.dateField))&&r.push({...e.dateField,role:"date"}),r}function ee(e,r){return D(e.field,r.field)&&e.allowedRelatedRoles.join("|")===r.allowedRelatedRoles.join("|")&&(e.unsupportedRelatedRoleMessage||"")===(r.unsupportedRelatedRoleMessage||"")&&(e.recommendedNextStep||"")===(r.recommendedNextStep||"")}function T(e,r){return q.semaphorFieldRefsMatch(e,r)}function D(e,r){return T(e,r)&&re(p(e),p(r))}function re(e,r){return!!(e&&(!r||e===r))}function p(e){return w(e)}function oe(e){const r=e.split(".");return r.length===4&&r[0]==="spec"&&(r[1]==="rows"||r[1]==="columns")&&b(r[2])&&r[3]==="field"}function te(e){const r=e.split(".");return r.length===6&&r[0]==="spec"&&(r[1]==="rows"||r[1]==="columns")&&b(r[2])&&r[3]==="sortBy"&&r[4]==="by"&&r[5]==="field"||r.length===5&&r[0]==="spec"&&r[1]==="sort"&&b(r[2])&&r[3]==="by"&&r[4]==="field"}function b(e){return e===void 0||e.trim()===""?!1:Number.isInteger(Number(e))&&Number(e)>=0}function ie({intent:e,field:r,relativePath:o,baseCatalog:t,fieldCatalogs:i}){const a=g(r,e.source),s=q.semaphorSourcesReferToSameDataset(a,e.source);if(!s&&!se(e.source,a))return{ok:!1,code:"invalid_source_ref",message:`Field "${r.name}" references a related Semaphor source outside the query's semantic domain.`,pathSuffix:".source",source:a};const n=s?t:k(i,a);if(!n)return{ok:!1,code:"invalid_source_ref",message:`Field "${r.name}" references a Semaphor source that is not present in the visible field catalog.`,pathSuffix:".source",source:a};const d=I(n,r,e.source);return d?!s&&!ae({intent:e,field:r,catalogField:d,relativePath:o})?{ok:!1,code:"unsupported_joined_projection",message:`Field "${r.name}" references a related Semaphor source, but this query kind does not support joined projections for that field yet.`,pathSuffix:".source",source:a}:{ok:!0,source:a,catalogField:d,usesBaseSource:s}:{ok:!1,code:"missing_field",message:`Field "${r.name}" is not visible on the selected Semaphor source.`,source:a}}function ae({intent:e,field:r,catalogField:o,relativePath:t}){return W({intent:e,field:r,catalogField:o,relativePath:t})}function se(e,r){return e.kind==="semantic"&&r.kind==="semantic"&&e.domainId===r.domainId}function k(e,r){return e.find(o=>$(o,r))}function I(e,r,o){const t=g(r,o);if($(e,t))return e.fields.find(i=>ne(i,r)&&$(e,g(i,e.source)))}function P(e){return R.normalizeAnalyticsCatalogName(e)}function g(e,r){return e.source||r}function $(e,r){return[e.source,...e.sourceAliases||[]].some(o=>q.semaphorSourcesReferToSameDataset(o,r))}function ne(e,r){return!!(e.name&&r.name&&e.name===r.name)}function z(e,r={}){const o=r.pathPrefix||"analysisOptions";if(e===void 0)return{ok:!0};if(!e||typeof e!="object"||Array.isArray(e))return c(o,"Data App analysis options must be an object.");const t=e,i={};if(t.chartTitle!==void 0){if(typeof t.chartTitle!="string")return c(`${o}.chartTitle`,'Data App analysis option "chartTitle" must be a string.');i.chartTitle=t.chartTitle}if(t.chartType!==void 0){if(typeof t.chartType!="string")return c(`${o}.chartType`,'Data App analysis option "chartType" must be a string.');i.chartType=t.chartType}if(t.driverMode!==void 0){if(!ce(t.driverMode))return c(`${o}.driverMode`,'Data App analysis option "driverMode" must be absolute_delta, largest_negative, largest_positive, positive_and_negative, or all.');i.driverMode=t.driverMode}if(t.includePopulation!==void 0){if(typeof t.includePopulation!="boolean")return c(`${o}.includePopulation`,'Data App analysis option "includePopulation" must be a boolean.');i.includePopulation=t.includePopulation}if(t.calendarContext!==void 0){const a=fe(t.calendarContext,{pathPrefix:`${o}.calendarContext`,validateTimezone:r.validateTimezone});if(!a.ok)return a;i.calendarContext=a.calendarContext}return{ok:!0,analysisOptions:i}}function de(e){const r=e.queries.map((i,a)=>le(i,a,{fieldCatalogs:e.fieldCatalogs||[],requireFieldCatalog:!!e.requireFieldCatalog,validateTimezone:e.validateTimezone})),o=r.flatMap(i=>i.diagnostics),t=r.map(i=>i.executionResult);return{ok:o.every(i=>i.severity!=="error"),diagnostics:o,queries:r,intents:r.flatMap(i=>i.intent?[i.intent]:[]),executionResults:t}}function le(e,r,o){const t=`queries.${r}`;try{const i=pe(e),a=$e(e,i),s=E.validateSemaphorAnalyticsIntent(i),n=[...ke({querySpec:e,queryId:a,intent:i,pathPrefix:t}),...s.errors.map(h=>C(h,{queryHook:e.queryHook,queryId:a,pathPrefix:t,severity:"error",intent:i})),...s.warnings.map(h=>C(h,{queryHook:e.queryHook,queryId:a,pathPrefix:t,severity:"warning",intent:i})),...ye({querySpec:e,queryId:a,intent:i,pathPrefix:t,fieldCatalogs:o.fieldCatalogs,requireFieldCatalog:o.requireFieldCatalog}),...Ie({querySpec:e,queryId:a,intent:i,pathPrefix:t,validateTimezone:o.validateTimezone})],d=be(s,n);return{queryHook:e.queryHook,queryId:a,intent:i,diagnostics:n,executionResult:j({intent:i,validation:d,diagnostics:n})}}catch(i){const a={severity:"error",code:"invalid_query_spec",message:i instanceof Error?i.message:String(i),path:t,queryHook:e.queryHook,queryId:Q(e.spec)},s=K([a]);return{queryHook:e.queryHook,queryId:a.queryId,diagnostics:[a],executionResult:j({validation:s,diagnostics:[a]})}}}function c(e,r){return{ok:!1,issues:[{code:"invalid_analysis_option",message:r,path:e}]}}function N(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function ce(e){return e==="absolute_delta"||e==="largest_negative"||e==="largest_positive"||e==="positive_and_negative"||e==="all"}function ue(e){return e.trim().length>0&&!Number.isNaN(Date.parse(e))}function fe(e,r){var d;if(!e||typeof e!="object"||Array.isArray(e))return c(r.pathPrefix,'Data App analysis option "calendarContext" must be an object.');const o=e,t=o.tz,i=o.weekStart,a=o.anchor,s=a&&typeof a=="object"&&!Array.isArray(a)?a.iso:void 0,n=typeof t=="string"?((d=r.validateTimezone)==null?void 0:d.call(r,t))??t:null;return n?typeof i!="number"||!Number.isInteger(i)||i<0||i>6?c(`${r.pathPrefix}.weekStart`,'Data App analysis option "calendarContext.weekStart" must be an integer from 0 to 6.'):a!=="now"&&!(typeof s=="string"&&ue(s))?c(`${r.pathPrefix}.anchor`,'Data App analysis option "calendarContext.anchor" must be "now" or an object with a valid iso string.'):{ok:!0,calendarContext:{tz:n,weekStart:i,anchor:a}}:c(`${r.pathPrefix}.tz`,'Data App analysis option "calendarContext.tz" must be a valid timezone string.')}function pe(e){return me(e.spec)}function me(e){if(!N(e))throw new Error("useSemaphorQuery spec must be an object.");if(e.queryKind==="metric")return y.toSemaphorMetricIntent(e);if(e.queryKind==="analysis")return y.toSemaphorAnalysisIntent(e);if(e.queryKind==="records")return y.toSemaphorRecordsIntent(e);if(e.queryKind==="sql")return y.toSemaphorSqlIntent(e);if(e.queryKind==="matrix")return y.toSemaphorMatrixIntent(e);if(e.queryKind==="inputOptions")return y.toSemaphorInputOptionsIntent(e);throw new Error("useSemaphorQuery spec.queryKind must be metric, analysis, records, inputOptions, sql, or matrix.")}function ye(e){if(e.intent.kind==="sql")return[];if(e.fieldCatalogs.length===0&&!e.requireFieldCatalog)return[];const r=k(e.fieldCatalogs,e.intent.source);if(!r)return[{severity:"error",code:"invalid_source_ref",message:`Source ref for ${e.querySpec.queryHook} does not match a visible Semaphor source.`,path:`${e.pathPrefix}.spec.source`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source}];const o=ge({...e,catalog:r}),t={...r,fields:[...r.fields,...Re(e.intent,r,e.intent.source)]};return[...o,...he({...e,fieldCatalogs:e.fieldCatalogs}),...qe({...e,catalog:t,fieldCatalogs:e.fieldCatalogs}),...ve({...e,catalog:t,fieldCatalogs:e.fieldCatalogs})]}function he(e){var o;if(e.intent.kind!=="inputOptions"||((o=e.intent.population)==null?void 0:o.kind)!=="related_population")return[];const r=e.intent.population.baseSource;return k(e.fieldCatalogs,r)?[]:[{severity:"error",code:"invalid_source_ref",message:"Input options related population baseSource does not match a visible Semaphor source.",path:`${e.pathPrefix}.spec.population.baseSource`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:r}]}function ge(e){const r=O(e.intent);if(r.length===0)return[];const o=[],t=new Set;return r.forEach((i,a)=>{const s=`${e.pathPrefix}.spec.derivedFields.${a}`,n=P(i.name);n&&(t.has(n)&&o.push({severity:"error",code:"duplicate_derived_field",message:`Derived field "${i.name}" is declared more than once.`,path:`${s}.name`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source}),t.add(n),e.catalog.fields.some(d=>P(d.name)===n)&&o.push({severity:"error",code:"derived_field_name_collision",message:`Derived field "${i.name}" conflicts with a field already visible on the selected Semaphor source.`,path:`${s}.name`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source})),Object.entries(i.inputs||{}).forEach(([d,h])=>{const m=xe(h);if(!m)return;const F=g(m,e.intent.source);if(!q.semaphorSourcesReferToSameDataset(F,e.intent.source)){o.push({severity:"error",code:"unsupported_derived_field_source",message:`Derived field "${i.name}" input "${d}" references a different Semaphor source. App-local derived fields must use fields from the query source.`,path:`${s}.inputs.${d}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:F,field:m});return}I(e.catalog,m,e.intent.source)||o.push({severity:"error",code:"missing_field",message:`Derived field "${i.name}" input "${d}" references field "${m.name}", which is not visible on the selected Semaphor source.`,path:`${s}.inputs.${d}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:F,field:m})})}),o}function qe(e){return Fe(e.intent).flatMap(({field:r,path:o})=>{const t=ie({intent:e.intent,field:r,relativePath:o,baseCatalog:e.catalog,fieldCatalogs:e.fieldCatalogs});return t.ok?[]:[{severity:"error",code:t.code,message:t.message,path:`${e.pathPrefix}.${o}${t.pathSuffix||""}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:t.source,field:r}]})}function ve(e){return("inputs"in e.intent?e.intent.inputs||[]:[]).flatMap((o,t)=>{if(!o.field)return[];const i=g(o.field,e.intent.source);if(!q.semaphorSourcesReferToSameDataset(i,e.intent.source)){if(Se(e.intent,i)){const a=k(e.fieldCatalogs,i);return a?I(a,o.field,i)?[]:[{severity:"error",code:"missing_field",message:`Input "${o.inputId}" references field "${o.field.name}", which is not visible on the selected Semaphor source.`,path:`${e.pathPrefix}.spec.inputs.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]:[{severity:"error",code:"invalid_source_ref",message:`Input "${o.inputId}" references a Semaphor source that is not present in the visible field catalog.`,path:`${e.pathPrefix}.spec.inputs.${t}.field.source`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]}return[{severity:"error",code:"unsupported_input_filter_composition",message:`Input "${o.inputId}" filters a different Semaphor source than the query, and no relationship-aware semantic validation path is available for this query kind.`,path:`${e.pathPrefix}.spec.inputs.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]}return I(e.catalog,o.field,e.intent.source)?[]:[{severity:"error",code:"missing_field",message:`Input "${o.inputId}" references field "${o.field.name}", which is not visible on the selected Semaphor source.`,path:`${e.pathPrefix}.spec.inputs.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]})}function Se(e,r){return e.source.kind==="semantic"&&r.kind==="semantic"&&r.domainId===e.source.domainId}function Ie(e){if(e.querySpec.spec.queryKind!=="analysis")return[];const r=z(e.querySpec.spec,{pathPrefix:`${e.pathPrefix}.spec`,validateTimezone:e.validateTimezone});return r.ok?[]:r.issues.map(o=>({severity:"error",code:o.code,message:o.message,path:o.path,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source}))}function ke(e){return e.querySpec.spec.queryKind!=="sql"?[]:N(e.querySpec.spec)?Object.prototype.hasOwnProperty.call(e.querySpec.spec,"parameters")?[{severity:"error",code:"deprecated_sql_parameters",message:"semaphor.sql uses defaultParameters for static SQL param(...) fallback values. The legacy parameters field is not supported.",path:`${e.pathPrefix}.spec.parameters`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id}]:[]:[]}function Fe(e){return e.kind==="metric"?[...e.measures.map((r,o)=>({field:r,path:`spec.measures.${o}`})),...e.primaryMeasure?[{field:e.primaryMeasure,path:"spec.primaryMeasure"}]:[],...e.dateField?[{field:e.dateField,path:"spec.dateField"}]:[],...(e.dimensions||[]).map((r,o)=>({field:r,path:`spec.dimensions.${o}`})),...e.orderBy?[{field:e.orderBy.field,path:"spec.orderBy.field"}]:[],...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.field`}))]:e.kind==="records"?[...e.fields.map((r,o)=>({field:r,path:`spec.fields.${o}`})),...e.dateField?[{field:e.dateField,path:"spec.dateField"}]:[],...e.orderBy?[{field:e.orderBy.field,path:"spec.orderBy.field"}]:[],...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.field`}))]:e.kind==="inputOptions"?[{field:e.labelField,path:"spec.labelField"},{field:e.valueField,path:"spec.valueField"},...e.searchField?[{field:e.searchField,path:"spec.searchField"}]:[],...(e.disambiguationFields||[]).map((r,o)=>({field:r,path:`spec.disambiguationFields.${o}`}))]:e.kind==="matrix"?[...e.rows.map((r,o)=>({field:r.field,path:`spec.rows.${o}.field`})),...e.rows.flatMap((r,o)=>{var t;return((t=r.sortBy)==null?void 0:t.by.kind)==="field"?[{field:r.sortBy.by.field,path:`spec.rows.${o}.sortBy.by.field`}]:[]}),...(e.columns||[]).map((r,o)=>({field:r.field,path:`spec.columns.${o}.field`})),...(e.columns||[]).flatMap((r,o)=>{var t;return((t=r.sortBy)==null?void 0:t.by.kind)==="field"?[{field:r.sortBy.by.field,path:`spec.columns.${o}.sortBy.by.field`}]:[]}),...e.values.map((r,o)=>({field:r.field,path:`spec.values.${o}.field`})),...(e.sort||[]).flatMap((r,o)=>r.by.kind==="field"?[{field:r.by.field,path:`spec.sort.${o}.by.field`}]:[]),...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.field`}))]:[]}function O(e){return!("derivedFields"in e)||!Array.isArray(e.derivedFields)?[]:e.derivedFields}function Re(e,r,o){return O(e).map(t=>({name:t.name,label:t.label,role:t.resultRole,dataType:t.dataType,source:r.source||o,...t.defaultAggregate?{aggregate:t.defaultAggregate}:{}}))}function xe(e){if(!(!e||typeof e!="object"))return e.field}function C(e,r){return{severity:r.severity,code:e.code||"invalid_analytics_intent",message:e.message,path:e.path?`${r.pathPrefix}.spec.${e.path}`:r.pathPrefix,queryHook:r.queryHook,queryId:r.queryId,intentId:r.intent.id,source:r.intent.source}}function be(e,r){const o=K(r);return{ok:o.ok&&e.ok,errors:H([...e.errors,...o.errors]),warnings:H([...e.warnings,...o.warnings]),repairHints:[...e.repairHints,...o.repairHints]}}function K(e){const r=e.filter(t=>t.severity==="error").map(A),o=e.filter(t=>t.severity==="warning").map(A);return{ok:r.length===0,errors:r,warnings:o,repairHints:r.map(t=>{var i,a;return{code:t.code,message:t.message,fieldRole:t.fieldRole,invalidField:(i=t.repairHint)==null?void 0:i.invalidField,recommendedNextStep:((a=t.repairHint)==null?void 0:a.recommendedNextStep)||"Update the Data App SDK query spec to use visible Semaphor source and field refs."}})}}function A(e){var r;return{code:e.code,message:e.message,path:e.path,fieldRole:e.code==="invalid_source_ref"?"source":void 0,repairHint:{code:e.code,message:e.message,invalidField:(r=e.field)==null?void 0:r.name,fieldRole:e.code==="invalid_source_ref"?"source":void 0,recommendedNextStep:e.code==="unsupported_input_filter_composition"?"Use an input field from the same Semaphor source as the query, or split the query into separate source-scoped queries.":"Update the query spec to use a visible Semaphor source and field ref."}}}function H(e){const r=new Set;return e.filter(o=>{const t=`${o.code}:${o.path||""}:${o.message}`;return r.has(t)?!1:(r.add(t),!0)})}function j(e){var o,t;const r=e.diagnostics.filter(i=>i.severity==="error");return{intentId:(o=e.intent)==null?void 0:o.id,status:r.length?"failed":"answered",resultShape:(t=e.intent)==null?void 0:t.kind,intent:e.intent,validation:e.validation,coverage:{answeredObligations:r.length?[]:["query_spec_validation"],missingObligations:r.length?["query_spec_validation"]:[],warnings:e.validation.warnings},missingFields:r.filter(i=>i.code==="missing_field").flatMap(i=>{var a;return(a=i.field)!=null&&a.name?[i.field.name]:[]}),warnings:e.diagnostics.filter(i=>i.severity==="warning").map(i=>i.message),metadata:{validationKind:"data_app_sdk_query_spec"}}}function $e(e,r){return r.id||Q(e.spec)}function Q(e){if(!e||typeof e!="object"||!("id"in e))return;const r=e.id;return typeof r=="string"&&r.trim()?r:void 0}exports.fieldWithSelectedProjectionRole=f;exports.findMatchingRelatedProjectionField=u;exports.isAllowedRelatedProjectionRole=M;exports.matrixAxisFieldsForPolicy=S;exports.normalizeSemaphorAnalysisQueryOptions=z;exports.normalizeSemaphorFieldRole=w;exports.relatedProjectionFieldCandidatesForIntent=J;exports.validateSemaphorDataAppQuerySpecs=de;
@@ -1,5 +1,5 @@
1
- import { b as O } from "../chunks/validators-C-_9Ew5G.js";
2
- import "../chunks/analyze-result-contract-DPjm6btg.js";
1
+ import { b as O } from "../chunks/validators-UqQI3Cg_.js";
2
+ import "../chunks/analyze-result-contract-B0O3oIYu.js";
3
3
  import { s as K, b as q } from "../chunks/source-identity-Cv4Nm3TM.js";
4
4
  import { toSemaphorMetricIntent as Q, toSemaphorAnalysisIntent as E, toSemaphorRecordsIntent as J, toSemaphorSqlIntent as U, toSemaphorMatrixIntent as W, toSemaphorInputOptionsIntent as L } from "../data-app-sdk-adapters/index.js";
5
5
  import { n as A, b as V } from "../chunks/catalog-field-grounding-CJKAqtiC.js";
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-CQIMj-FF.js"),d=require("./chunks/common-types-C73-Ud1-.js"),N=require("./chunks/calendar-preferences-dialog-ck4AU-to.js"),t=require("react/jsx-runtime"),a=require("./chunks/switch-DMlqgIx_.js"),C=require("react"),y=require("./types/index.cjs"),r=require("./chunks/dashboard-briefing-launcher-Br_1IK1z.js"),P=require("./chunks/use-debounced-dirty-check-XHSwAefL.js");require("./chunks/analyze-result-contract-8nxUOWp8.js");require("react-dom");require("./chunks/index-DRlMUglg.js");const S=require("./chunks/normalize-dashboard-for-dirty-check-BXRUMVb2.js"),_=require("./chunks/x-B6ghREd2.js");function R(i){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const n in i)if(n!=="default"){const u=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(o,n,u.get?u:{enumerable:!0,get:()=>i[n]})}}return o.default=i,Object.freeze(o)}const h=R(C);function w(i){const{displayPreferences:o,cardId:n,...u}=i,s={...u,id:i.dashboardId};return t.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:t.jsxs(e.SemaphorContextProvider,{dashboardProps:s,children:[t.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:i.cardId}),t.jsx(e.UXProvider,{appearance:i.appearance,children:t.jsx(e.DisplayPreferencesProvider,{displayPreferences:o,children:t.jsx(e.Container,{type:"visual",cardId:n,...s,children:t.jsx(j,{cardId:n})})})})]})})}function j({cardId:i}){const o=a.useDashboardStore(s=>{var c;return(c=s.dashboard)==null?void 0:c.sheets}),{card:n,frame:u}=C.useMemo(()=>{const s=o==null?void 0:o.flatMap(l=>l.frames),c=s==null?void 0:s.flatMap(l=>l==null?void 0:l.cards),D=c==null?void 0:c.find(l=>(l==null?void 0:l.id)===i),E=s==null?void 0:s.find(l=>{var p;return(p=l==null?void 0:l.cards)==null?void 0:p.find(g=>(g==null?void 0:g.id)===i)});return{card:D,frame:E}},[o,i]);return!n||!u?t.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${i}`}):t.jsx("main",{className:"flex h-full grow flex-col",children:t.jsx(e.ErrorBoundary,{FallbackComponent:({error:s,resetErrorBoundary:c})=>t.jsx(e.FallbackVisual,{error:s,resetErrorBoundary:c,customerFacingMessage:"Error creating visual. Please try again."}),children:t.jsx(e.DashboardCard,{card:n,frame:u})})})}function L(i,o,n,u){C.useEffect(()=>{i&&!n&&o&&u(e.cloneDeep(o))},[i,n,o,u])}function M({name:i,items:o,value:n,onChange:u,isLoading:s,isError:c,refetch:D,className:E,icon:l,showNone:p=!1}){const g=h.useRef(null),[b,T]=h.useState(!1),[B,A]=h.useState("100%"),x=p?[...o||[],{id:"none",name:"None"}]:o;h.useLayoutEffect(()=>{g.current&&A(g.current.offsetWidth)},[]);function v(){var f;return s?"Loading...":c?"Error":n?(f=o==null?void 0:o.find(m=>m.id===n))==null?void 0:f.name:`Select ${i}`}function F(f,m){u(m),T(!1)}return t.jsxs(a.Popover,{open:b,onOpenChange:T,children:[t.jsx(a.PopoverTrigger,{asChild:!0,children:t.jsxs(a.Button,{ref:g,variant:"outline",role:"combobox","aria-expanded":b,className:a.cn("flex h-9 w-full justify-between",E),children:[t.jsxs("div",{className:"flex items-center gap-2",children:[l&&t.jsx("div",{className:"mr-2",children:l}),t.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:v()})]}),t.jsx(_.ChevronDown,{className:"size-4 opacity-50"})]})}),t.jsx(a.PopoverContent,{className:"w-full p-0",style:{minWidth:B},children:t.jsxs(e.Command,{children:[t.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[t.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),t.jsx(e.IconButton,{className:"h-7",onClick:D,children:t.jsx(e.RefreshCw,{className:a.cn("size-3.5 opacity-50",s&&"animate-spin")})})]}),t.jsxs(e.CommandList,{children:[t.jsxs(e.CommandEmpty,{children:["No ",i==null?void 0:i.toLowerCase()," found."]}),t.jsx(e.CommandGroup,{children:x==null?void 0:x.map(f=>t.jsx(e.CommandItem,{className:"overflow-x-auto",value:f.name,onSelect:m=>F(m,f.id),children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(a.Check,{className:a.cn("size-4",n===f.id?"opacity-100":"opacity-0")}),t.jsx("div",{title:f.name,children:f.name})]})},f.id))})]})]})})]})}function I(i,o){C.useEffect(()=>(i&&o&&(window.__SEMAPHOR_PRINT_STATE__={...o}),()=>{i&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[i,o])}exports.CardSummary=e.CardSummary;exports.Dashboard=e.Dashboard;exports.DashboardCreateDialogBase=e.DashboardCreateDialogBase;exports.DashboardExportDialog=e.DashboardExportDialog;exports.DashboardWC=e.DashboardWC;exports.ExportError=e.ExportError;exports.MatrixTableVisual=e.MatrixTableVisual;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.ShareDialog=e.ShareDialog;exports.SummaryCard=e.SummaryCard;exports.Surfboard=e.DashboardPlus;exports.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createExport=e.createExport;exports.downloadDocumentPdf=e.downloadDocumentPdf;exports.downloadPdf=e.downloadPdf;exports.formatFileSize=e.formatFileSize;exports.getDownloadUrl=e.getDownloadUrl;exports.getExportStatus=e.getExportStatus;exports.getExports=e.getExports;exports.isExportComplete=e.isExportComplete;exports.isExportInProgress=e.isExportInProgress;exports.useActiveExports=e.useActiveExports;exports.useAddNewFrame=e.useAddNewFrame;exports.useCard=e.useCard;exports.useCardSummary=e.useCardSummary;exports.useDashboardById=e.useDashboardById;exports.useDashboardQuery=e.useDashboardQuery;exports.useDashboardSummary=e.useDashboardSummary;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorAside=e.useEditorAside;exports.useExportActions=e.useExportActions;exports.useExportStore=e.useExportStore;exports.useInProgressExportsCount=e.useInProgressExportsCount;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useTextFilterHook=e.useTextFilterHook;exports.CALCULATED_FIELD_ENTITY_MARKER=d.CALCULATED_FIELD_ENTITY_MARKER;exports.CONTROL_CARD_DEFAULT_VALUE=d.CONTROL_CARD_DEFAULT_VALUE;exports.DATE_FORMAT_VALUES=d.DATE_FORMAT_VALUES;exports.EMPTY_SELECTION=d.EMPTY_SELECTION;exports.PivotMarkerEnum=d.PivotMarkerEnum;exports.getFieldRuntimeColumnName=d.getFieldRuntimeColumnName;exports.hasCalculatedFieldMarker=d.hasCalculatedFieldMarker;exports.hasCalculatedFormulaInputs=d.hasCalculatedFormulaInputs;exports.isCalculatedDimension=d.isCalculatedDimension;exports.isCalculatedField=d.isCalculatedField;exports.isCalculatedMetric=d.isCalculatedMetric;exports.CalendarPreferencesDialog=N.CalendarPreferencesDialog;exports.createEmptyKpiConfig=a.createEmptyKpiConfig;exports.createSqlGenConfig=a.createSqlGenConfig;exports.emitDashboardLoad=a.emitDashboardLoad;exports.emitDashboardUnload=a.emitDashboardUnload;exports.fmt=a.fmt;exports.getColumnDataType=a.getColumnDataType;exports.getFilterValueType=a.getFilterValueType;exports.getFormattedTableNameForQuery=a.getFormattedTableNameForQuery;exports.getQualifiedTableName=a.getQualifiedTableName;exports.getSql=a.getSql;exports.invalidateToken=a.invalidateToken;exports.isBooleanDataType=a.isBooleanDataType;exports.isColumnInSqlGen=a.isColumnInSqlGen;exports.isDateDataType=a.isDateDataType;exports.isNumberDataType=a.isNumberDataType;exports.isTextDataType=a.isTextDataType;exports.resolveDataType=a.resolveDataType;exports.resolveDatamodelName=a.resolveDatamodelName;exports.useCurrentActiveCard=a.useCurrentActiveCard;exports.useCurrentCardConfig=a.useCurrentCardConfig;exports.useCurrentSheetActiveCards=a.useCurrentSheetActiveCards;exports.useDashboardActions=a.useDashboardActions;exports.useDashboardStore=a.useDashboardStore;exports.useEditorActions=a.useEditorActions;exports.useEditorStore=a.useEditorStore;exports.DEFAULT_CALENDAR_CONTEXT=y.DEFAULT_CALENDAR_CONTEXT;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=y.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.AdvancedModeToggle=r.AdvancedModeToggle;exports.BriefingAuthor=r.BriefingAuthor;exports.BriefingsApiError=r.BriefingsApiError;exports.DashboardBriefingLauncher=r.DashboardBriefingLauncher;exports.DashboardControlsSettings=r.DashboardControlsSettings;exports.DashboardFilterControlsButton=r.DashboardFilterControlsButton;exports.DashboardFilterControlsLauncher=r.DashboardFilterControlsLauncher;exports.DocumentControlsSettings=r.DocumentControlsSettings;exports.ExportNotificationItem=r.ExportNotificationItem;exports.ExportNotificationList=r.ExportNotificationList;exports.NotificationBell=r.NotificationBell;exports.UnsavedChangesAlert=r.UnsavedChangesAlert;exports.VisualEditingControls=r.VisualEditingControls;exports.VisualsLibraryDialog=r.VisualsLibraryDialog;exports.WatchDashboardButton=r.WatchDashboardButton;exports.applyBriefingFormPatch=r.applyBriefingFormPatch;exports.briefingFormDraftToCreateRequest=r.briefingFormDraftToCreateRequest;exports.briefingFormDraftToUpdateRequest=r.briefingFormDraftToUpdateRequest;exports.briefingToFormDraft=r.briefingToFormDraft;exports.cancelBriefingPreviewRun=r.cancelBriefingPreviewRun;exports.cancelBriefingRun=r.cancelBriefingRun;exports.createBriefing=r.createBriefing;exports.createBriefingFormDraft=r.createBriefingFormDraft;exports.deleteBriefing=r.deleteBriefing;exports.deleteBriefingRun=r.deleteBriefingRun;exports.getBriefing=r.getBriefing;exports.getBriefingArtifact=r.getBriefingArtifact;exports.getBriefingEvidence=r.getBriefingEvidence;exports.getBriefingPreviewRun=r.getBriefingPreviewRun;exports.getBriefingRun=r.getBriefingRun;exports.listBriefingRuns=r.listBriefingRuns;exports.listBriefingTenantSummaries=r.listBriefingTenantSummaries;exports.listBriefings=r.listBriefings;exports.pauseBriefing=r.pauseBriefing;exports.polishBriefingText=r.polishBriefingText;exports.previewBriefingPlan=r.previewBriefingPlan;exports.resumeBriefing=r.resumeBriefing;exports.runBriefingNow=r.runBriefingNow;exports.runBriefingPreview=r.runBriefingPreview;exports.updateBriefing=r.updateBriefing;exports.useExportPolling=r.useExportPolling;exports.useExportRecovery=r.useExportRecovery;exports.validateBriefingFormDraft=r.validateBriefingFormDraft;exports.useDebouncedDirtyCheck=P.useDebouncedDirtyCheck;exports.normalizeDashboardForDirtyCheck=S.normalizeDashboardForDirtyCheck;exports.serializeDashboardForDirtyCheck=S.serializeDashboardForDirtyCheck;exports.Combobox=M;exports.Visual=w;exports.useExposePrintState=I;exports.usePristineSnapshotInitializer=L;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-Beol8cOo.js"),d=require("./chunks/common-types-C73-Ud1-.js"),N=require("./chunks/calendar-preferences-dialog-Rq9qiG3X.js"),t=require("react/jsx-runtime"),a=require("./chunks/switch--FHwRAOL.js"),C=require("react"),y=require("./types/index.cjs"),r=require("./chunks/dashboard-briefing-launcher-D_P0cNQ_.js"),P=require("./chunks/use-debounced-dirty-check-XHSwAefL.js");require("./chunks/analyze-result-contract-CL97m8X8.js");require("react-dom");require("./chunks/index-DRlMUglg.js");const S=require("./chunks/normalize-dashboard-for-dirty-check-BXRUMVb2.js"),_=require("./chunks/x-B6ghREd2.js");function R(i){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const n in i)if(n!=="default"){const u=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(o,n,u.get?u:{enumerable:!0,get:()=>i[n]})}}return o.default=i,Object.freeze(o)}const h=R(C);function w(i){const{displayPreferences:o,cardId:n,...u}=i,s={...u,id:i.dashboardId};return t.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:t.jsxs(e.SemaphorContextProvider,{dashboardProps:s,children:[t.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:i.cardId}),t.jsx(e.UXProvider,{appearance:i.appearance,children:t.jsx(e.DisplayPreferencesProvider,{displayPreferences:o,children:t.jsx(e.Container,{type:"visual",cardId:n,...s,children:t.jsx(j,{cardId:n})})})})]})})}function j({cardId:i}){const o=a.useDashboardStore(s=>{var c;return(c=s.dashboard)==null?void 0:c.sheets}),{card:n,frame:u}=C.useMemo(()=>{const s=o==null?void 0:o.flatMap(l=>l.frames),c=s==null?void 0:s.flatMap(l=>l==null?void 0:l.cards),D=c==null?void 0:c.find(l=>(l==null?void 0:l.id)===i),E=s==null?void 0:s.find(l=>{var p;return(p=l==null?void 0:l.cards)==null?void 0:p.find(g=>(g==null?void 0:g.id)===i)});return{card:D,frame:E}},[o,i]);return!n||!u?t.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${i}`}):t.jsx("main",{className:"flex h-full grow flex-col",children:t.jsx(e.ErrorBoundary,{FallbackComponent:({error:s,resetErrorBoundary:c})=>t.jsx(e.FallbackVisual,{error:s,resetErrorBoundary:c,customerFacingMessage:"Error creating visual. Please try again."}),children:t.jsx(e.DashboardCard,{card:n,frame:u})})})}function L(i,o,n,u){C.useEffect(()=>{i&&!n&&o&&u(e.cloneDeep(o))},[i,n,o,u])}function M({name:i,items:o,value:n,onChange:u,isLoading:s,isError:c,refetch:D,className:E,icon:l,showNone:p=!1}){const g=h.useRef(null),[b,T]=h.useState(!1),[B,A]=h.useState("100%"),x=p?[...o||[],{id:"none",name:"None"}]:o;h.useLayoutEffect(()=>{g.current&&A(g.current.offsetWidth)},[]);function v(){var f;return s?"Loading...":c?"Error":n?(f=o==null?void 0:o.find(m=>m.id===n))==null?void 0:f.name:`Select ${i}`}function F(f,m){u(m),T(!1)}return t.jsxs(a.Popover,{open:b,onOpenChange:T,children:[t.jsx(a.PopoverTrigger,{asChild:!0,children:t.jsxs(a.Button,{ref:g,variant:"outline",role:"combobox","aria-expanded":b,className:a.cn("flex h-9 w-full justify-between",E),children:[t.jsxs("div",{className:"flex items-center gap-2",children:[l&&t.jsx("div",{className:"mr-2",children:l}),t.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:v()})]}),t.jsx(_.ChevronDown,{className:"size-4 opacity-50"})]})}),t.jsx(a.PopoverContent,{className:"w-full p-0",style:{minWidth:B},children:t.jsxs(e.Command,{children:[t.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[t.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),t.jsx(e.IconButton,{className:"h-7",onClick:D,children:t.jsx(e.RefreshCw,{className:a.cn("size-3.5 opacity-50",s&&"animate-spin")})})]}),t.jsxs(e.CommandList,{children:[t.jsxs(e.CommandEmpty,{children:["No ",i==null?void 0:i.toLowerCase()," found."]}),t.jsx(e.CommandGroup,{children:x==null?void 0:x.map(f=>t.jsx(e.CommandItem,{className:"overflow-x-auto",value:f.name,onSelect:m=>F(m,f.id),children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(a.Check,{className:a.cn("size-4",n===f.id?"opacity-100":"opacity-0")}),t.jsx("div",{title:f.name,children:f.name})]})},f.id))})]})]})})]})}function I(i,o){C.useEffect(()=>(i&&o&&(window.__SEMAPHOR_PRINT_STATE__={...o}),()=>{i&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[i,o])}exports.CardSummary=e.CardSummary;exports.Dashboard=e.Dashboard;exports.DashboardCreateDialogBase=e.DashboardCreateDialogBase;exports.DashboardExportDialog=e.DashboardExportDialog;exports.DashboardWC=e.DashboardWC;exports.ExportError=e.ExportError;exports.MatrixTableVisual=e.MatrixTableVisual;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.ShareDialog=e.ShareDialog;exports.SummaryCard=e.SummaryCard;exports.Surfboard=e.DashboardPlus;exports.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createExport=e.createExport;exports.downloadDocumentPdf=e.downloadDocumentPdf;exports.downloadPdf=e.downloadPdf;exports.formatFileSize=e.formatFileSize;exports.getDownloadUrl=e.getDownloadUrl;exports.getExportStatus=e.getExportStatus;exports.getExports=e.getExports;exports.isExportComplete=e.isExportComplete;exports.isExportInProgress=e.isExportInProgress;exports.useActiveExports=e.useActiveExports;exports.useAddNewFrame=e.useAddNewFrame;exports.useCard=e.useCard;exports.useCardSummary=e.useCardSummary;exports.useDashboardById=e.useDashboardById;exports.useDashboardQuery=e.useDashboardQuery;exports.useDashboardSummary=e.useDashboardSummary;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorAside=e.useEditorAside;exports.useExportActions=e.useExportActions;exports.useExportStore=e.useExportStore;exports.useInProgressExportsCount=e.useInProgressExportsCount;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useTextFilterHook=e.useTextFilterHook;exports.CALCULATED_FIELD_ENTITY_MARKER=d.CALCULATED_FIELD_ENTITY_MARKER;exports.CONTROL_CARD_DEFAULT_VALUE=d.CONTROL_CARD_DEFAULT_VALUE;exports.DATE_FORMAT_VALUES=d.DATE_FORMAT_VALUES;exports.EMPTY_SELECTION=d.EMPTY_SELECTION;exports.PivotMarkerEnum=d.PivotMarkerEnum;exports.getFieldRuntimeColumnName=d.getFieldRuntimeColumnName;exports.hasCalculatedFieldMarker=d.hasCalculatedFieldMarker;exports.hasCalculatedFormulaInputs=d.hasCalculatedFormulaInputs;exports.isCalculatedDimension=d.isCalculatedDimension;exports.isCalculatedField=d.isCalculatedField;exports.isCalculatedMetric=d.isCalculatedMetric;exports.CalendarPreferencesDialog=N.CalendarPreferencesDialog;exports.createEmptyKpiConfig=a.createEmptyKpiConfig;exports.createSqlGenConfig=a.createSqlGenConfig;exports.emitDashboardLoad=a.emitDashboardLoad;exports.emitDashboardUnload=a.emitDashboardUnload;exports.fmt=a.fmt;exports.getColumnDataType=a.getColumnDataType;exports.getFilterValueType=a.getFilterValueType;exports.getFormattedTableNameForQuery=a.getFormattedTableNameForQuery;exports.getQualifiedTableName=a.getQualifiedTableName;exports.getSql=a.getSql;exports.invalidateToken=a.invalidateToken;exports.isBooleanDataType=a.isBooleanDataType;exports.isColumnInSqlGen=a.isColumnInSqlGen;exports.isDateDataType=a.isDateDataType;exports.isNumberDataType=a.isNumberDataType;exports.isTextDataType=a.isTextDataType;exports.resolveDataType=a.resolveDataType;exports.resolveDatamodelName=a.resolveDatamodelName;exports.useCurrentActiveCard=a.useCurrentActiveCard;exports.useCurrentCardConfig=a.useCurrentCardConfig;exports.useCurrentSheetActiveCards=a.useCurrentSheetActiveCards;exports.useDashboardActions=a.useDashboardActions;exports.useDashboardStore=a.useDashboardStore;exports.useEditorActions=a.useEditorActions;exports.useEditorStore=a.useEditorStore;exports.DEFAULT_CALENDAR_CONTEXT=y.DEFAULT_CALENDAR_CONTEXT;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=y.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.AdvancedModeToggle=r.AdvancedModeToggle;exports.BriefingAuthor=r.BriefingAuthor;exports.BriefingsApiError=r.BriefingsApiError;exports.DashboardBriefingLauncher=r.DashboardBriefingLauncher;exports.DashboardControlsSettings=r.DashboardControlsSettings;exports.DashboardFilterControlsButton=r.DashboardFilterControlsButton;exports.DashboardFilterControlsLauncher=r.DashboardFilterControlsLauncher;exports.DocumentControlsSettings=r.DocumentControlsSettings;exports.ExportNotificationItem=r.ExportNotificationItem;exports.ExportNotificationList=r.ExportNotificationList;exports.NotificationBell=r.NotificationBell;exports.UnsavedChangesAlert=r.UnsavedChangesAlert;exports.VisualEditingControls=r.VisualEditingControls;exports.VisualsLibraryDialog=r.VisualsLibraryDialog;exports.WatchDashboardButton=r.WatchDashboardButton;exports.applyBriefingFormPatch=r.applyBriefingFormPatch;exports.briefingFormDraftToCreateRequest=r.briefingFormDraftToCreateRequest;exports.briefingFormDraftToUpdateRequest=r.briefingFormDraftToUpdateRequest;exports.briefingToFormDraft=r.briefingToFormDraft;exports.cancelBriefingPreviewRun=r.cancelBriefingPreviewRun;exports.cancelBriefingRun=r.cancelBriefingRun;exports.createBriefing=r.createBriefing;exports.createBriefingFormDraft=r.createBriefingFormDraft;exports.deleteBriefing=r.deleteBriefing;exports.deleteBriefingRun=r.deleteBriefingRun;exports.getBriefing=r.getBriefing;exports.getBriefingArtifact=r.getBriefingArtifact;exports.getBriefingEvidence=r.getBriefingEvidence;exports.getBriefingPreviewRun=r.getBriefingPreviewRun;exports.getBriefingRun=r.getBriefingRun;exports.listBriefingRuns=r.listBriefingRuns;exports.listBriefingTenantSummaries=r.listBriefingTenantSummaries;exports.listBriefings=r.listBriefings;exports.pauseBriefing=r.pauseBriefing;exports.polishBriefingText=r.polishBriefingText;exports.previewBriefingPlan=r.previewBriefingPlan;exports.resumeBriefing=r.resumeBriefing;exports.runBriefingNow=r.runBriefingNow;exports.runBriefingPreview=r.runBriefingPreview;exports.updateBriefing=r.updateBriefing;exports.useExportPolling=r.useExportPolling;exports.useExportRecovery=r.useExportRecovery;exports.validateBriefingFormDraft=r.validateBriefingFormDraft;exports.useDebouncedDirtyCheck=P.useDebouncedDirtyCheck;exports.normalizeDashboardForDirtyCheck=S.normalizeDashboardForDirtyCheck;exports.serializeDashboardForDirtyCheck=S.serializeDashboardForDirtyCheck;exports.Combobox=M;exports.Visual=w;exports.useExposePrintState=I;exports.usePristineSnapshotInitializer=L;
package/dist/index.js CHANGED
@@ -1,16 +1,16 @@
1
- import { E as T, F as N, S, q as P, U as w, r as _, s as F, t as x, v as R, w as M, h as I, i as L, I as k, x as U, j as O, k as V, l as z, m as q } from "./chunks/index-BkTLAfKy.js";
2
- import { X as fa, D as ma, V as pa, T as ha, O as ga, aa as Ca, M as Da, A as Ea, H as xa, H as Ta, J as ba, W as ya, a as va, a9 as Ba, a5 as Aa, Q as Na, P as Sa, ad as Pa, a8 as wa, a7 as _a, a6 as Fa, ac as Ra, ab as Ma, a2 as Ia, $ as La, N as ka, Z as Ua, L as Oa, z as Va, Y as za, _ as qa, B as Ha, a4 as Wa, a1 as ja, a0 as Ga, a3 as Qa, y as Ka, K as Xa, G as Ya } from "./chunks/index-BkTLAfKy.js";
1
+ import { E as T, F as N, S, q as P, U as w, r as _, s as F, t as x, v as R, w as M, h as I, i as L, I as k, x as U, j as O, k as V, l as z, m as q } from "./chunks/index-BgESS5r7.js";
2
+ import { X as fa, D as ma, V as pa, T as ha, O as ga, aa as Ca, M as Da, A as Ea, H as xa, H as Ta, J as ba, W as ya, a as va, a9 as Ba, a5 as Aa, Q as Na, P as Sa, ad as Pa, a8 as wa, a7 as _a, a6 as Fa, ac as Ra, ab as Ma, a2 as Ia, $ as La, N as ka, Z as Ua, L as Oa, z as Va, Y as za, _ as qa, B as Ha, a4 as Wa, a1 as ja, a0 as Ga, a3 as Qa, y as Ka, K as Xa, G as Ya } from "./chunks/index-BgESS5r7.js";
3
3
  import { a as Ja, C as Za, D as ae, E as ee, P as se, g as re, d as oe, h as te, b as ie, c as ne, i as le } from "./chunks/common-types-4bjoIgvm.js";
4
- import { C as ue } from "./chunks/calendar-preferences-dialog-B8FmFRHX.js";
4
+ import { C as ue } from "./chunks/calendar-preferences-dialog-BOfryj8P.js";
5
5
  import { jsx as a, jsxs as d } from "react/jsx-runtime";
6
- import { u as H, P as W, a as j, B as G, c as C, b as Q, d as K } from "./chunks/switch-DgiogS4X.js";
7
- import { D as fe, o as me, f as pe, g as he, h as ge, q as Ce, p as De, t as Ee, v as xe, n as Te, i as be, m as ye, r as ve, l as Be, k as Ae, j as Ne, w as Se, s as Pe, x as we, z as _e, y as Fe, A as Re, F as Me, E as Ie } from "./chunks/switch-DgiogS4X.js";
6
+ import { u as H, P as W, a as j, B as G, c as C, b as Q, d as K } from "./chunks/switch-C8_t4Pio.js";
7
+ import { D as fe, o as me, f as pe, g as he, h as ge, q as Ce, p as De, t as Ee, v as xe, n as Te, i as be, m as ye, r as ve, l as Be, k as Ae, j as Ne, w as Se, s as Pe, x as we, z as _e, y as Fe, A as Re, F as Me, E as Ie } from "./chunks/switch-C8_t4Pio.js";
8
8
  import * as m from "react";
9
9
  import { useMemo as X, useEffect as b } from "react";
10
10
  import { DEFAULT_CALENDAR_CONTEXT as ke, DEFAULT_SEMANTIC_DOMAIN_ACCESS as Ue } from "./types/index.js";
11
- import { A as Ve, L as ze, B as qe, M as He, D as We, e as je, f as Ge, d as Qe, b as Ke, E as Xe, N as Ye, U as $e, a as Je, V as Ze, W as as, G as es, I as ss, J as rs, H as os, s as ts, w as is, i as ns, F as ls, k as ds, x as us, h as cs, y as fs, z as ms, q as ps, v as hs, t as gs, g as Cs, l as Ds, p as Es, C as xs, n as Ts, r as bs, m as ys, o as vs, j as Bs, u as As, c as Ns, K as Ss } from "./chunks/dashboard-briefing-launcher-Tr2SqDMK.js";
11
+ import { A as Ve, L as ze, B as qe, M as He, D as We, e as je, f as Ge, d as Qe, b as Ke, E as Xe, N as Ye, U as $e, a as Je, V as Ze, W as as, G as es, I as ss, J as rs, H as os, s as ts, w as is, i as ns, F as ls, k as ds, x as us, h as cs, y as fs, z as ms, q as ps, v as hs, t as gs, g as Cs, l as Ds, p as Es, C as xs, n as Ts, r as bs, m as ys, o as vs, j as Bs, u as As, c as Ns, K as Ss } from "./chunks/dashboard-briefing-launcher-DgvlOcRI.js";
12
12
  import { u as ws } from "./chunks/use-debounced-dirty-check-BwAbnX_5.js";
13
- import "./chunks/analyze-result-contract-DPjm6btg.js";
13
+ import "./chunks/analyze-result-contract-B0O3oIYu.js";
14
14
  import "react-dom";
15
15
  import "./chunks/index-CJdxSyQq.js";
16
16
  import { n as Fs, s as Rs } from "./chunks/normalize-dashboard-for-dirty-check-5KpZN8xr.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/index-CQIMj-FF.js"),e=require("../chunks/common-types-C73-Ud1-.js"),a=require("../chunks/calendar-preferences-dialog-ck4AU-to.js");exports.Surfboard=r.DashboardPlus;exports.CONTROL_CARD_DEFAULT_VALUE=e.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=e.EMPTY_SELECTION;exports.CalendarPreferencesDialog=a.CalendarPreferencesDialog;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/index-Beol8cOo.js"),e=require("../chunks/common-types-C73-Ud1-.js"),a=require("../chunks/calendar-preferences-dialog-Rq9qiG3X.js");exports.Surfboard=r.DashboardPlus;exports.CONTROL_CARD_DEFAULT_VALUE=e.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=e.EMPTY_SELECTION;exports.CalendarPreferencesDialog=a.CalendarPreferencesDialog;
@@ -1,6 +1,6 @@
1
- import { a as e } from "../chunks/index-BkTLAfKy.js";
1
+ import { a as e } from "../chunks/index-BgESS5r7.js";
2
2
  import { C, E } from "../chunks/common-types-4bjoIgvm.js";
3
- import { C as s } from "../chunks/calendar-preferences-dialog-B8FmFRHX.js";
3
+ import { C as s } from "../chunks/calendar-preferences-dialog-BOfryj8P.js";
4
4
  export {
5
5
  C as CONTROL_CARD_DEFAULT_VALUE,
6
6
  s as CalendarPreferencesDialog,
@@ -2609,7 +2609,7 @@ export declare type SemaphorDataAppRequiredInputOption = {
2609
2609
  export declare type SemaphorDataAppUnsupportedInsight = {
2610
2610
  title: string;
2611
2611
  requestedQuestion: string;
2612
- reason: 'missing_measure' | 'missing_dimension' | 'missing_date' | 'missing_relationship' | 'missing_semantic_role' | 'missing_current_app_state' | 'unsupported_change_intent' | 'ambiguous_field_grounding' | 'invalid_ranker_output' | 'latest_snapshot_selector_not_modeled' | 'unsupported_grain' | 'requires_sql_escape_hatch' | 'unsupported_sdk_capability';
2612
+ reason: 'missing_measure' | 'missing_dimension' | 'missing_date' | 'missing_relationship' | 'missing_semantic_role' | 'missing_current_app_state' | 'unsupported_change_intent' | 'ambiguous_field_grounding' | 'bounded_intent_unavailable' | 'invalid_bounded_intent_output' | 'latest_snapshot_selector_not_modeled' | 'unsupported_grain' | 'requires_sql_escape_hatch' | 'unsupported_sdk_capability';
2613
2613
  suggestedModelingFix: string;
2614
2614
  relationshipCandidate?: SemaphorDataAppRelationshipCandidate;
2615
2615
  nextRepairAction?: {
@@ -3231,7 +3231,7 @@ export declare type SemaphorOperationIntent = {
3231
3231
  };
3232
3232
 
3233
3233
  export declare type SemaphorOptionDependencies = {
3234
- mode?: 'auto' | 'independent' | 'explicit';
3234
+ mode?: 'independent' | 'explicit';
3235
3235
  includeInputIds?: string[];
3236
3236
  excludeInputIds?: string[];
3237
3237
  };
@@ -1346,7 +1346,7 @@ declare type SemaphorMetricResult = SemaphorAnalyticsResultBase & {
1346
1346
  };
1347
1347
 
1348
1348
  declare type SemaphorOptionDependencies = {
1349
- mode?: 'auto' | 'independent' | 'explicit';
1349
+ mode?: 'independent' | 'explicit';
1350
1350
  includeInputIds?: string[];
1351
1351
  excludeInputIds?: string[];
1352
1352
  };
@@ -2192,7 +2192,7 @@ declare type SemaphorMetricIntent = {
2192
2192
  };
2193
2193
 
2194
2194
  declare type SemaphorOptionDependencies = {
2195
- mode?: 'auto' | 'independent' | 'explicit';
2195
+ mode?: 'independent' | 'explicit';
2196
2196
  includeInputIds?: string[];
2197
2197
  excludeInputIds?: string[];
2198
2198
  };
@@ -837,7 +837,7 @@ declare type SemaphorMetricIntent = {
837
837
  };
838
838
 
839
839
  declare type SemaphorOptionDependencies = {
840
- mode?: 'auto' | 'independent' | 'explicit';
840
+ mode?: 'independent' | 'explicit';
841
841
  includeInputIds?: string[];
842
842
  excludeInputIds?: string[];
843
843
  };
@@ -59,7 +59,7 @@ export declare const CONTRACT_MANIFEST_SCHEMA_VERSION = "semaphor-generated-data
59
59
 
60
60
  export declare const DEFAULT_GENERATED_CONTRACT_OUTPUT_DIR = "src/semaphor/generated";
61
61
 
62
- export declare function evaluateSemaphorDataAppContractUpdatePolicy({ beforeSummary, afterSummary, migrationReport, operationIntent, preferences, }: SemaphorDataAppContractUpdatePolicyInput): SemaphorDataAppContractUpdatePolicyResult;
62
+ export declare function evaluateSemaphorDataAppContractUpdatePolicy({ beforeSummary, afterSummary, migrationReport, operationIntent, constraints, preferences, }: SemaphorDataAppContractUpdatePolicyInput): SemaphorDataAppContractUpdatePolicyResult;
63
63
 
64
64
  export declare const GENERATED_CONTRACT_SCHEMA_VERSION = "semaphor-generated-data-app-contract/v1";
65
65
 
@@ -560,7 +560,7 @@ export declare type SemaphorDataAppContractGeneratorOptions = {
560
560
 
561
561
  export declare type SemaphorDataAppContractUpdatePolicy = {
562
562
  kind: string;
563
- mode: 'invalid_update_preferences' | 'diagnostic_warning_fix' | 'metric_aggregate_override_edit' | 'general_iterative_update';
563
+ mode: 'invalid_update_constraints' | 'diagnostic_warning_fix' | 'metric_aggregate_override_edit' | 'general_iterative_update';
564
564
  reason: string;
565
565
  allowedViewChangeReasons?: string[];
566
566
  targetViewIds?: string[];
@@ -571,6 +571,7 @@ export declare type SemaphorDataAppContractUpdatePolicyInput = {
571
571
  afterSummary?: unknown;
572
572
  migrationReport?: unknown;
573
573
  operationIntent?: unknown;
574
+ constraints?: unknown;
574
575
  preferences?: unknown;
575
576
  };
576
577
 
@@ -663,7 +664,7 @@ declare type SemaphorDataAppRequiredInputOption = {
663
664
  declare type SemaphorDataAppUnsupportedInsight = {
664
665
  title: string;
665
666
  requestedQuestion: string;
666
- reason: 'missing_measure' | 'missing_dimension' | 'missing_date' | 'missing_relationship' | 'missing_semantic_role' | 'missing_current_app_state' | 'unsupported_change_intent' | 'ambiguous_field_grounding' | 'invalid_ranker_output' | 'latest_snapshot_selector_not_modeled' | 'unsupported_grain' | 'requires_sql_escape_hatch' | 'unsupported_sdk_capability';
667
+ reason: 'missing_measure' | 'missing_dimension' | 'missing_date' | 'missing_relationship' | 'missing_semantic_role' | 'missing_current_app_state' | 'unsupported_change_intent' | 'ambiguous_field_grounding' | 'bounded_intent_unavailable' | 'invalid_bounded_intent_output' | 'latest_snapshot_selector_not_modeled' | 'unsupported_grain' | 'requires_sql_escape_hatch' | 'unsupported_sdk_capability';
667
668
  suggestedModelingFix: string;
668
669
  relationshipCandidate?: SemaphorDataAppRelationshipCandidate;
669
670
  nextRepairAction?: {
@@ -990,7 +991,7 @@ declare type SemaphorMetricIntent = {
990
991
  };
991
992
 
992
993
  declare type SemaphorOptionDependencies = {
993
- mode?: 'auto' | 'independent' | 'explicit';
994
+ mode?: 'independent' | 'explicit';
994
995
  includeInputIds?: string[];
995
996
  excludeInputIds?: string[];
996
997
  };
@@ -57,7 +57,7 @@ export declare const CODEGEN_SUMMARY_VALIDATOR_VERSION: "semaphor-data-app-codeg
57
57
 
58
58
  export declare const CONTRACT_MANIFEST_SCHEMA_VERSION = "semaphor-generated-data-app-contract-manifest/v1";
59
59
 
60
- export declare function evaluateSemaphorDataAppContractUpdatePolicy({ beforeSummary, afterSummary, migrationReport, operationIntent, preferences, }: SemaphorDataAppContractUpdatePolicyInput): SemaphorDataAppContractUpdatePolicyResult;
60
+ export declare function evaluateSemaphorDataAppContractUpdatePolicy({ beforeSummary, afterSummary, migrationReport, operationIntent, constraints, preferences, }: SemaphorDataAppContractUpdatePolicyInput): SemaphorDataAppContractUpdatePolicyResult;
61
61
 
62
62
  export declare const GENERATED_CONTRACT_SCHEMA_VERSION = "semaphor-generated-data-app-contract/v1";
63
63
 
@@ -550,7 +550,7 @@ declare type SemaphorDataAppCodegenVisualSpec = {
550
550
 
551
551
  export declare type SemaphorDataAppContractUpdatePolicy = {
552
552
  kind: string;
553
- mode: 'invalid_update_preferences' | 'diagnostic_warning_fix' | 'metric_aggregate_override_edit' | 'general_iterative_update';
553
+ mode: 'invalid_update_constraints' | 'diagnostic_warning_fix' | 'metric_aggregate_override_edit' | 'general_iterative_update';
554
554
  reason: string;
555
555
  allowedViewChangeReasons?: string[];
556
556
  targetViewIds?: string[];
@@ -561,6 +561,7 @@ export declare type SemaphorDataAppContractUpdatePolicyInput = {
561
561
  afterSummary?: unknown;
562
562
  migrationReport?: unknown;
563
563
  operationIntent?: unknown;
564
+ constraints?: unknown;
564
565
  preferences?: unknown;
565
566
  };
566
567
 
@@ -653,7 +654,7 @@ declare type SemaphorDataAppRequiredInputOption = {
653
654
  declare type SemaphorDataAppUnsupportedInsight = {
654
655
  title: string;
655
656
  requestedQuestion: string;
656
- reason: 'missing_measure' | 'missing_dimension' | 'missing_date' | 'missing_relationship' | 'missing_semantic_role' | 'missing_current_app_state' | 'unsupported_change_intent' | 'ambiguous_field_grounding' | 'invalid_ranker_output' | 'latest_snapshot_selector_not_modeled' | 'unsupported_grain' | 'requires_sql_escape_hatch' | 'unsupported_sdk_capability';
657
+ reason: 'missing_measure' | 'missing_dimension' | 'missing_date' | 'missing_relationship' | 'missing_semantic_role' | 'missing_current_app_state' | 'unsupported_change_intent' | 'ambiguous_field_grounding' | 'bounded_intent_unavailable' | 'invalid_bounded_intent_output' | 'latest_snapshot_selector_not_modeled' | 'unsupported_grain' | 'requires_sql_escape_hatch' | 'unsupported_sdk_capability';
657
658
  suggestedModelingFix: string;
658
659
  relationshipCandidate?: SemaphorDataAppRelationshipCandidate;
659
660
  nextRepairAction?: {
@@ -962,7 +963,7 @@ declare type SemaphorMetricIntent = {
962
963
  };
963
964
 
964
965
  declare type SemaphorOptionDependencies = {
965
- mode?: 'auto' | 'independent' | 'explicit';
966
+ mode?: 'independent' | 'explicit';
966
967
  includeInputIds?: string[];
967
968
  excludeInputIds?: string[];
968
969
  };
@@ -481,7 +481,7 @@ declare type SemaphorMetricQuerySpec = SemaphorQuerySourceSpec & SemaphorAppDeri
481
481
  declare type SemaphorNonEmptyArray<T> = [T, ...T[]];
482
482
 
483
483
  declare type SemaphorOptionDependencies = {
484
- mode?: 'auto' | 'independent' | 'explicit';
484
+ mode?: 'independent' | 'explicit';
485
485
  includeInputIds?: string[];
486
486
  excludeInputIds?: string[];
487
487
  };
@@ -971,7 +971,7 @@ declare type SemaphorMetricResult = SemaphorAnalyticsResultBase & {
971
971
  declare type SemaphorNonEmptyArray<T> = [T, ...T[]];
972
972
 
973
973
  declare type SemaphorOptionDependencies = {
974
- mode?: 'auto' | 'independent' | 'explicit';
974
+ mode?: 'independent' | 'explicit';
975
975
  includeInputIds?: string[];
976
976
  excludeInputIds?: string[];
977
977
  };
@@ -1342,7 +1342,7 @@ declare type SemaphorMetricResult = SemaphorAnalyticsResultBase & {
1342
1342
  export declare type SemaphorNonEmptyArray<T> = [T, ...T[]];
1343
1343
 
1344
1344
  export declare type SemaphorOptionDependencies = {
1345
- mode?: 'auto' | 'independent' | 'explicit';
1345
+ mode?: 'independent' | 'explicit';
1346
1346
  includeInputIds?: string[];
1347
1347
  excludeInputIds?: string[];
1348
1348
  };
@@ -5139,7 +5139,7 @@ declare type SemaphorMetricIntent = {
5139
5139
  };
5140
5140
 
5141
5141
  declare type SemaphorOptionDependencies = {
5142
- mode?: 'auto' | 'independent' | 'explicit';
5142
+ mode?: 'independent' | 'explicit';
5143
5143
  includeInputIds?: string[];
5144
5144
  excludeInputIds?: string[];
5145
5145
  };
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.415",
8
+ "version": "0.1.417",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -242,15 +242,12 @@ const segmentOptions = semaphor.inputOptions({
242
242
  source,
243
243
  labelField: segment,
244
244
  valueField: segment,
245
- dependencies: { mode: "auto" },
246
245
  limit: 100,
247
246
  });
248
247
 
249
248
  function SegmentFilter() {
250
249
  const [segmentHandle] = useSemaphorInputs([segmentFilter]);
251
- const optionsResult = useSemaphorQuery(segmentOptions, {
252
- inputs: [segmentHandle],
253
- });
250
+ const optionsResult = useSemaphorQuery(segmentOptions);
254
251
 
255
252
  useClearInvalidSemaphorInputValue(segmentHandle, optionsResult);
256
253