react-semaphor 0.1.416 → 0.1.418
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +49 -50
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +2 -2
- package/dist/chunks/analyze-result-contract-Akysi2ML.js +2003 -0
- package/dist/chunks/analyze-result-contract-COjyJzYm.js +1 -0
- package/dist/chunks/{calendar-preferences-dialog-B8FmFRHX.js → calendar-preferences-dialog-BbuLgela.js} +3 -3
- package/dist/chunks/{calendar-preferences-dialog-ck4AU-to.js → calendar-preferences-dialog-CInkkhl_.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-Br_1IK1z.js → dashboard-briefing-launcher-B4OWNsVD.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-Tr2SqDMK.js → dashboard-briefing-launcher-D7FNuDuc.js} +4 -4
- package/dist/chunks/{dashboard-controls-B7OObDNl.js → dashboard-controls-DTC1eCz0.js} +1 -1
- package/dist/chunks/{dashboard-controls-B2bEv8uG.js → dashboard-controls-DcX7Mid4.js} +5 -5
- package/dist/chunks/{dashboard-json-DAB8WVyb.js → dashboard-json-BHWbQS6I.js} +3 -3
- package/dist/chunks/{dashboard-json-DNixjalS.js → dashboard-json-vu38P5pV.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-DWygSAp3.js → edit-dashboard-visual-CkBhJBhp.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-Dh8Ge3-B.js → edit-dashboard-visual-DsCr90_3.js} +4 -4
- package/dist/chunks/{index-BkTLAfKy.js → index-C56DuHI8.js} +163 -164
- package/dist/chunks/{index-CQIMj-FF.js → index-C8thRvkW.js} +4 -4
- package/dist/chunks/{switch-DMlqgIx_.js → switch-BXuyni6l.js} +1 -1
- package/dist/chunks/{switch-DgiogS4X.js → switch-Dsx-IwBE.js} +1 -1
- package/dist/chunks/{update-policy-BnEbPhHW.js → update-policy-B5S_LfEu.js} +347 -314
- package/dist/chunks/update-policy-BqBKUk3Q.js +3 -0
- package/dist/chunks/{use-create-flow-overlay-state-CZA-dSns.js → use-create-flow-overlay-state-BDv_VpL6.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-uujasvbD.js → use-create-flow-overlay-state-CzftV84t.js} +3 -3
- package/dist/chunks/{validators-UqQI3Cg_.js → validators-CLzrE2N_.js} +1 -1
- package/dist/chunks/validators-CPFcUMrV.js +1 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +28 -29
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +2 -2
- package/dist/data-app-codegen/index.cjs +1 -1
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.cjs +154 -125
- package/dist/data-app-codegen-node/index.js +691 -609
- package/dist/data-app-sdk/index.cjs +2 -2
- package/dist/data-app-sdk/index.js +171 -157
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +26 -27
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +17 -18
- package/dist/index.cjs +1 -1
- package/dist/index.js +7 -7
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/analytics-protocol.d.ts +6 -1
- package/dist/types/dashboard-assistant.d.ts +1 -0
- package/dist/types/data-app-codegen-node.d.ts +5 -3
- package/dist/types/data-app-codegen.d.ts +5 -3
- package/dist/types/data-app-sdk-validation.d.ts +1 -0
- package/dist/types/data-app-sdk.d.ts +6 -0
- package/package.json +1 -1
- package/dist/chunks/analyze-result-contract-8nxUOWp8.js +0 -1
- package/dist/chunks/analyze-result-contract-DPjm6btg.js +0 -1869
- package/dist/chunks/source-identity-BM2FvJDP.js +0 -1
- package/dist/chunks/source-identity-Cv4Nm3TM.js +0 -75
- package/dist/chunks/update-policy-CWg9c08k.js +0 -3
- package/dist/chunks/validators-JzI7olk4.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("zod");function j(s){return s?s.kind==="semantic"?[s.kind,s.domainId,s.datasetId?`datasetId:${s.datasetId}`:`datasetName:${s.datasetName}`].join(":"):s.kind==="physical"?[s.kind,s.connectionId,s.databaseName||"",s.schemaName||"",s.tableName].join(":"):[s.kind,s.connectionId,s.dialect||"",s.label||""].join(":"):""}function L(s,o){return!s||!o?s===o:s.kind!==o.kind?!1:s.kind==="semantic"&&o.kind==="semantic"?s.domainId!==o.domainId?!1:s.datasetId&&o.datasetId?s.datasetId===o.datasetId:s.datasetName===o.datasetName:j(s)===j(o)}function U(s,o){return s.kind!=="semantic"||o.kind!=="semantic"?s:{...s,datasetName:s.datasetName||o.datasetName,datasetId:s.datasetId||o.datasetId,label:s.label||o.label,connectionId:s.connectionId||o.connectionId}}function xe(s){const o=[];for(const t of s){const i=o.findIndex(n=>L(n,t));if(i===-1){o.push(t);continue}o[i]=U(o[i],t)}return o}function Ee(s,o){return s.name===o.name&&L(s.source,o.source)}function ae(s){return[s.source?j(s.source):"unknown",(s.aggregate||"SUM").toUpperCase(),s.name].filter(Boolean).join(":")}function Fe(s,o){return{...s,label:s.label||o.label,role:s.role||o.role,dataType:s.dataType||o.dataType,source:s.source&&o.source?U(s.source,o.source):s.source||o.source}}const E={answerSummary:"string",responseDetail:"responseDetail",mode:"string",comparisonType:"string",executionResult:"executionResult",compiledQuery:"unknown",data:"unknown",resultSets:"record",analysisWarnings:"unknownArray",columns:"unknownArray",records:"recordArray",rowCount:"number",rowLimitExceeded:"boolean",output:"string",querySpec:"unknown",metadata:"record",validation:"validationResult",coverage:"coverage",diagnosticFeedback:"diagnosticFeedback",missingFields:"stringArray",warnings:"unknownArray",comparison:"unknown",population:"population",comparisons:"recordArray",fieldsUsed:"compactExecutionFieldArray",primary:"recordArray",contributors:"recordArray",segments:"recordArray",periodChanges:"recordArray",changes:"recordArray",largestNegativeChanges:"recordArray",largestPositiveChanges:"recordArray",drivers:"recordArray",absoluteDeltaDrivers:"recordArray",largestNegativeDrivers:"recordArray",largestPositiveDrivers:"recordArray",periodRows:"recordArray",sql:"unknown",omitted:"stringArray"},C="semaphor-data-app-codegen-summary/v1",Ne="semaphor-data-app-codegen-summary-validator/v2",Ke=new Set(["metric","records","matrix","analysis","sql_fallback"]),Me=new Set(["semaphor.metric","semaphor.records","semaphor.matrix","semaphor.analysis","semaphor.sql"]),De=new Set(["absolute_delta","largest_negative","largest_positive","positive_and_negative","all"]),le=new Set(["source","id","label","measures","primaryMeasure","dateField","timeGrain","dimensions","comparison","orderBy","filters","relationshipHint","limit","derivedFields"]),Te=new Set([...le,"analysis","timeWindow","filters","driverMode","includePopulation","calendarContext","chartTitle","chartType"]),Oe=new Set(["source","id","label","fields","dateField","timeGrain","timeWindow","filters","orderBy","relationshipHint","limit","pagination","totals","derivedFields"]),Be=new Set(["source","id","label","filters","relationshipHint","rows","columns","values","totals","sort","expansion","layout","displayLimits"]),Pe=new Set(["source","id","label","sql","defaultParameters","pythonCode","fields","limit","pagination","rationale"]),Ve=new Set(["kpi","line_chart","bar_chart","stacked_bar_chart","pie_chart","donut_chart","area_chart","table","matrix","narrative","text_block","custom"]),Le=new Set(["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"]);function Ue(s){return G(s).ok}function G(s){const o=[];if(!s||typeof s!="object")return{ok:!1,issues:["Summary must be an object."]};const t=s;return t.schemaVersion!==C&&o.push(`schemaVersion must be ${C}.`),(typeof t.title!="string"||!t.title.trim())&&o.push("title is required."),Array.isArray(t.sources)||o.push("sources must be an array."),Array.isArray(t.inputs)||o.push("inputs must be an array."),Array.isArray(t.views)||o.push("views must be an array."),Array.isArray(t.filterContracts)||o.push("filterContracts must be an array."),(!t.implementationChecklist||typeof t.implementationChecklist!="object")&&o.push("implementationChecklist must be an object."),t.implementationChecklist&&typeof t.implementationChecklist=="object"&&o.push(...He(t.implementationChecklist)),Array.isArray(t.sources)&&t.sources.forEach((i,n)=>{o.push(...w(i,`sources.${n}`))}),Array.isArray(t.inputs)&&t.inputs.forEach((i,n)=>{o.push(...Qe(i,`inputs.${n}`))}),Array.isArray(t.views)&&t.views.forEach((i,n)=>{o.push(...Ye(i,`views.${n}`))}),Array.isArray(t.filterContracts)&&t.filterContracts.forEach((i,n)=>{o.push(...nt(i,`filterContracts.${n}`))}),t.unsupportedInsights!==void 0&&(Array.isArray(t.unsupportedInsights)?t.unsupportedInsights.forEach((i,n)=>{o.push(...It(i,`unsupportedInsights.${n}`))}):o.push("unsupportedInsights must be an array.")),o.push(...Ge(t)),{ok:o.length===0,issues:o}}function Ge(s){const o=Array.isArray(s.unsupportedInsights)&&s.unsupportedInsights.some(l=>{var u;return((u=a(l))==null?void 0:u.reason)==="missing_relationship"}),t=Array.isArray(s.views)&&s.views.some(l=>{var d;const u=a((d=a(l))==null?void 0:d.computation);return(u==null?void 0:u.kind)==="unsupported"&&u.reason==="missing_relationship"});if(!o&&!t)return[];const i=[],n=a(s.validation);(n==null?void 0:n.status)!=="blocked"&&i.push("validation.status must be blocked when missing_relationship gaps are present.");const r=a(s.nextRequiredTool);return(r==null?void 0:r.name)!=="semaphor_propose_semantic_model_change"&&i.push("nextRequiredTool.name must be semaphor_propose_semantic_model_change when missing_relationship gaps are present."),i}function w(s,o){const t=a(s);return t?t.kind==="semantic"?typeof t.domainId=="string"&&t.domainId.trim()&&typeof t.datasetName=="string"&&t.datasetName.trim()?[]:[`${o} must include sourceKey or a supported source identity.`]:typeof t.sourceKey=="string"&&t.sourceKey.trim()?[]:t.kind==="physical"&&typeof t.tableName=="string"&&t.tableName.trim()&&typeof t.connectionId=="string"&&t.connectionId.trim()?[]:t.kind==="sql"&&typeof t.connectionId=="string"&&t.connectionId.trim()?[]:[`${o} must include sourceKey or a supported source identity.`]:[`${o} must be an object.`]}function He(s){const o=a(s);if(!o)return["implementationChecklist must be an object."];const t=[],i=["requiredDevtools","requiredInputOptions","filterScopeByInput","bindingsByView","validationCommands","browserSmokeChecks"];for(const r of i)r in o||t.push(`implementationChecklist.${r} is required.`);const n=a(o.requiredDevtools);return n?typeof n.mountRootDevtools!="boolean"&&t.push("implementationChecklist.requiredDevtools.mountRootDevtools must be a boolean."):t.push("implementationChecklist.requiredDevtools must be an object."),Array.isArray(o.requiredInputOptions)||t.push("implementationChecklist.requiredInputOptions must be an array."),Array.isArray(o.filterScopeByInput)||t.push("implementationChecklist.filterScopeByInput must be an array."),a(o.bindingsByView)||t.push("implementationChecklist.bindingsByView must be an object."),g(o.validationCommands)||t.push("implementationChecklist.validationCommands must be an array of strings."),g(o.browserSmokeChecks)||t.push("implementationChecklist.browserSmokeChecks must be an array of strings."),t}function Qe(s,o){const t=a(s);if(!t)return[`${o} must be an object.`];const i=[];return(typeof t.id!="string"||!t.id.trim())&&i.push(`${o}.id is required.`),t.fieldRef&&i.push(...p(t.fieldRef,`${o}.fieldRef`)),i.push(...ue(t.optionQuery,`${o}.optionQuery`)),g(t.appliesToViewIds)||i.push(`${o}.appliesToViewIds must be an array of strings.`),t.bindings!==void 0&&!Array.isArray(t.bindings)&&i.push(`${o}.bindings must be an array.`),Array.isArray(t.bindings)&&t.bindings.forEach((n,r)=>{const l=a(n);if(!l){i.push(`${o}.bindings.${r} must be an object.`);return}g(l.appliesToViewIds)||i.push(`${o}.bindings.${r}.appliesToViewIds must be an array of strings.`),i.push(...p(l.fieldRef,`${o}.bindings.${r}.fieldRef`))}),i}function Ye(s,o){const t=a(s);if(!t)return[`${o} must be an object.`];const i=[];if((typeof t.id!="string"||!t.id.trim())&&i.push(`${o}.id is required.`),t.visualSpec!==void 0&&i.push(...zt(t.visualSpec,`${o}.visualSpec`)),t.computation!==void 0&&i.push(...kt(t.computation,`${o}.computation`)),yt(t))return i.push(...T(t,`${o}`)),t.fields!==void 0&&(Array.isArray(t.fields)?t.fields.forEach((d,z)=>{i.push(...p(d,`${o}.fields.${z}`))}):i.push(`${o}.fields must be an array.`)),t.queryKind!==void 0&&i.push(`${o}.queryKind is not allowed for non-executable views.`),t.sdkBuilder!==void 0&&i.push(`${o}.sdkBuilder is not allowed for non-executable views.`),t.sdkSpec!==void 0&&i.push(`${o}.sdkSpec is not allowed for non-executable views.`),i;if(!Array.isArray(t.fields))return i.push(`${o}.fields must be an array.`),(t.sdkSpec!==void 0||t.sdkBuilder!==void 0)&&i.push(`${o}.fields must be an array for executable views.`),i.push(...T(t,`${o}`)),i;t.fields.forEach((d,z)=>{i.push(...p(d,`${o}.fields.${z}`))}),$(t.queryKind)||i.push(`${o}.queryKind must be a supported codegen query kind.`),t.sdkBuilder!==void 0&&!ce(t.sdkBuilder)&&i.push(`${o}.sdkBuilder must be a supported SDK builder.`),t.metricBindingKeys!==void 0&&(Array.isArray(t.metricBindingKeys)?t.metricBindingKeys.some(d=>typeof d!="string"||d.trim().length===0)&&i.push(`${o}.metricBindingKeys must be an array of strings.`):i.push(`${o}.metricBindingKeys must be an array of strings.`));const n=a(t.sdkSpec),r=(n==null?void 0:n.builder)==="semaphor.metric";r&&(!Array.isArray(t.metricBindingKeys)||t.metricBindingKeys.length===0)&&i.push(`${o}.metricBindingKeys is required for metric views.`);const l=We(t);r&&Array.isArray(t.metricBindingKeys)&&l&&JSON.stringify(t.metricBindingKeys)!==JSON.stringify(l)&&i.push(`${o}.metricBindingKeys must match the generated metric field binding keys in order.`);const u=a(t.computation);return(u==null?void 0:u.kind)==="server_query"&&$(t.queryKind)&&$(u.queryKind)&&u.queryKind!==t.queryKind&&i.push(`${o}.computation.queryKind must match queryKind.`),i.push(...rt({value:t.sdkSpec,path:`${o}.sdkSpec`,queryKind:typeof t.queryKind=="string"?t.queryKind:void 0,sdkBuilder:typeof t.sdkBuilder=="string"?t.sdkBuilder:void 0}),...T(t,`${o}`)),i}function We(s){const o=a(s.sdkSpec);if((o==null?void 0:o.builder)!=="semaphor.metric")return;const t=a(o.spec);if(!t)return;const n=[t.primaryMeasure,...Array.isArray(t.measures)?t.measures:[]].map(Ze).filter(r=>!!r);return Array.from(new Map(n.map(r=>[r.identity,r.bindingKey])).values())}function Ze(s){const o=a(s);if(!o||typeof o.name!="string"||!o.name.trim())return;const t=Je(o);return t?{identity:JSON.stringify({source:t,name:o.name,aggregate:typeof o.aggregate=="string"?o.aggregate.toUpperCase():"SUM"}),bindingKey:Xe(o)}:void 0}function Je(s){if(typeof s.sourceKey=="string"&&s.sourceKey.trim())return{sourceKey:s.sourceKey};const o=a(s.source);if(o)return{kind:o.kind,domainId:o.domainId,datasetId:o.datasetId,datasetName:o.datasetName,name:o.name}}function Xe(s){return typeof s.sourceKey=="string"&&s.sourceKey.trim()?[s.sourceKey,(typeof s.aggregate=="string"?s.aggregate:"SUM").toUpperCase(),s.name].filter(Boolean).join(":"):ae(s)}function T(s,o){var z;const t=a((z=a(s.visualSpec))==null?void 0:z.tableBehavior),i=a(s.sdkSpec),n=a(i==null?void 0:i.spec),r=typeof(i==null?void 0:i.builder)=="string"?i.builder:void 0,l=r==="semaphor.records"?a(n==null?void 0:n.totals):void 0,u=[];if(!t)return l&&u.push(`${o}.sdkSpec.spec.totals is only allowed when tableBehavior.totals.mode is server.`),u;const d=a(t.totals);return d?(d.mode==="server"&&(r!=="semaphor.records"&&u.push(`${o}.visualSpec.tableBehavior.totals.mode server is only supported for semaphor.records views.`),!l||l.mode!=="server"?u.push(`${o}.sdkSpec.spec.totals.mode must be server when tableBehavior.totals.mode is server.`):u.push(...et({left:d.measures,right:l.measures,leftPath:`${o}.visualSpec.tableBehavior.totals.measures`,rightPath:`${o}.sdkSpec.spec.totals.measures`}))),d.mode!=="server"&&l&&u.push(`${o}.sdkSpec.spec.totals is only allowed when tableBehavior.totals.mode is server.`),r==="semaphor.sql"&&d.mode!=="none"&&u.push(`${o}.visualSpec.tableBehavior.totals.mode must be none for semaphor.sql views.`),r==="semaphor.sql"&&a(n==null?void 0:n.totals)&&u.push(`${o}.sdkSpec.spec.totals is not supported for semaphor.sql.`),u):(l&&u.push(`${o}.sdkSpec.spec.totals is only allowed when tableBehavior.totals.mode is server.`),u)}function et({left:s,right:o,leftPath:t,rightPath:i}){if(!Array.isArray(s)||!Array.isArray(o))return[`${i} must match ${t}.`];const n=[];return s.length!==o.length?(n.push(`${i} must match ${t}.`),n):(s.forEach((r,l)=>{tt(a(r),a(o[l]))||n.push(`${i}.${l} must match ${t}.${l}.`)}),n)}function tt(s,o){return!s||!o?!1:s.name===o.name&&(s.role||"measure")===(o.role||"measure")&&te(s)===te(o)&&ot(s,o)}function te(s){return typeof s.aggregate=="string"?s.aggregate.toUpperCase():"SUM"}function ot(s,o){const t=a(s.source),i=a(o.source);if(st(t,i))return!1;const n=oe(s),r=oe(o);if(n.size>0||r.size>0){for(const l of n)if(r.has(l))return!0;return!1}return!t||!i||t.kind!==i.kind?!1:t.kind==="semantic"?t.domainId===i.domainId&&t.datasetName===i.datasetName&&(t.datasetId===void 0||i.datasetId===void 0||t.datasetId===i.datasetId):t.kind==="physical"?t.connectionId===i.connectionId&&t.tableName===i.tableName:t.kind==="sql"?t.connectionId===i.connectionId:!1}function st(s,o){if(!s||!o||s.kind!=="semantic"||o.kind!=="semantic")return!1;const t=typeof s.datasetId=="string"?s.datasetId.trim():"",i=typeof o.datasetId=="string"?o.datasetId.trim():"";return!!(t&&i&&t!==i)}function oe(s){const o=typeof s.sourceKey=="string"?s.sourceKey.trim():"";return o?new Set([o]):it(a(s.source))}function it(s){const o=new Set;if(!s)return o;const t=typeof s.sourceKey=="string"?s.sourceKey.trim():"";if(t&&o.add(t),s.kind==="semantic"){const i=typeof s.domainId=="string"?s.domainId:"",n=typeof s.datasetName=="string"?s.datasetName:"",r=typeof s.datasetId=="string"?s.datasetId:"";i&&r&&o.add(`semantic:${i}:datasetId:${r}`),i&&n&&o.add(`semantic:${i}:datasetName:${n}`)}if(s.kind==="physical"){const i=typeof s.connectionId=="string"?s.connectionId:"",n=typeof s.tableName=="string"?s.tableName:"",r=typeof s.databaseName=="string"?s.databaseName:"",l=typeof s.schemaName=="string"?s.schemaName:"";i&&n&&(o.add(["physical",i,r,l,n].join(":")),o.add(`physical:${i}:${n}`))}if(s.kind==="sql"){const i=typeof s.connectionId=="string"?s.connectionId:"",n=typeof s.dialect=="string"?s.dialect:"",r=typeof s.label=="string"?s.label:"";i&&(o.add(["sql",i,n,r].join(":")),o.add(`sql:${i}`))}return o}function nt(s,o){const t=a(s);if(!t)return[`${o} must be an object.`];const i=[];if(t.fieldRef&&i.push(...p(t.fieldRef,`${o}.fieldRef`)),(typeof t.inputId!="string"||!t.inputId.trim())&&i.push(`${o}.inputId is required.`),i.push(...ue(t.optionQuery,`${o}.optionQuery`)),g(t.appliesToViewIds)||i.push(`${o}.appliesToViewIds must be an array of strings.`),g(t.notAppliedToViewIds)||i.push(`${o}.notAppliedToViewIds must be an array of strings.`),!Array.isArray(t.bindings))i.push(`${o}.bindings must be an array.`);else{const n=g(t.appliesToViewIds)?new Set(t.appliesToViewIds):void 0,r=g(t.notAppliedToViewIds)?new Set(t.notAppliedToViewIds):void 0;t.bindings.forEach((l,u)=>{const d=a(l);if(!d){i.push(`${o}.bindings.${u} must be an object.`);return}typeof d.viewId!="string"||!d.viewId?i.push(`${o}.bindings.${u}.viewId is required.`):(n&&!n.has(d.viewId)&&i.push(`${o}.bindings.${u}.viewId must be included in appliesToViewIds.`),r!=null&&r.has(d.viewId)&&i.push(`${o}.bindings.${u}.viewId must not be listed in notAppliedToViewIds.`)),i.push(...p(d.fieldRef,`${o}.bindings.${u}.fieldRef`))})}return i}function ue(s,o){if(s===void 0)return[];const t=a(s);if(!t)return[`${o} must be an object.`];const i=[...h(t.valueFieldRef,`${o}.valueFieldRef`),...h(t.labelFieldRef,`${o}.labelFieldRef`),...h(t.filterFieldRef,`${o}.filterFieldRef`)];return t.builder!=="semaphor.inputOptions"&&i.push(`${o}.builder must be semaphor.inputOptions.`),typeof t.sourceKey!="string"&&t.source===void 0&&i.push(`${o} must include source or sourceKey.`),t.source!==void 0&&i.push(...w(t.source,`${o}.source`)),a(t.valueFieldRef)||i.push(`${o}.valueFieldRef is required.`),a(t.labelFieldRef)||i.push(`${o}.labelFieldRef is required.`),t.limit!==void 0&&(typeof t.limit!="number"||!Number.isInteger(t.limit)||t.limit<=0)&&i.push(`${o}.limit must be a positive integer.`),i}function rt(s){var n;const o=a(s.value);if(!o)return[`${s.path} is required for executable views.`];const t=[];if(!ce(o.builder))return t.push(`${s.path}.builder must be a supported SDK builder.`),t;s.sdkBuilder&&o.builder!==s.sdkBuilder&&t.push(`${s.path}.builder must match sdkBuilder.`),s.queryKind&&$(s.queryKind)&&o.builder!==ft(s.queryKind)&&t.push(`${s.path}.builder must match queryKind.`);const i=a(o.spec);if(!i)return t.push(`${s.path}.spec must be an object.`),t;switch(o.builder){case"semaphor.metric":t.push(...v(i,le,`${s.path}.spec`),...A(i,s.path),...O(i.measures,`${s.path}.spec.measures`),...h(i.primaryMeasure,`${s.path}.spec.primaryMeasure`),...h(i.dateField,`${s.path}.spec.dateField`),...B(i.dimensions,`${s.path}.spec.dimensions`),...P(i.orderBy,`${s.path}.spec.orderBy`),...R(i.filters,`${s.path}.spec.filters`));break;case"semaphor.analysis":t.push(...v(i,Te,`${s.path}.spec`),...A(i,s.path),...O(i.measures,`${s.path}.spec.measures`),...h(i.primaryMeasure,`${s.path}.spec.primaryMeasure`),...h(i.dateField,`${s.path}.spec.dateField`),...B(i.dimensions,`${s.path}.spec.dimensions`),...P(i.orderBy,`${s.path}.spec.orderBy`),...R(i.filters,`${s.path}.spec.filters`),...lt(i,`${s.path}.spec`));break;case"semaphor.records":t.push(...v(i,Oe,`${s.path}.spec`),...A(i,s.path),...O(i.fields,`${s.path}.spec.fields`),...h(i.dateField,`${s.path}.spec.dateField`),...P(i.orderBy,`${s.path}.spec.orderBy`),...R(i.filters,`${s.path}.spec.filters`),...ut(i.totals,`${s.path}.spec.totals`));break;case"semaphor.matrix":t.push(...v(i,Be,`${s.path}.spec`),...dt(i,s.path),...ct(i.rows,`${s.path}.spec.rows`),...pt(i.columns,`${s.path}.spec.columns`),...mt(i.values,`${s.path}.spec.values`),...gt(i.sort,`${s.path}.spec.sort`),...R(i.filters,`${s.path}.spec.filters`),...at(i.displayLimits,`${s.path}.spec.displayLimits`));break;case"semaphor.sql":t.push(...v(i,Pe,`${s.path}.spec`),...A(i,s.path)),((n=a(i.source))==null?void 0:n.kind)!=="sql"&&t.push(`${s.path}.spec.source.kind must be sql.`),(typeof i.sql!="string"||!i.sql.trim())&&t.push(`${s.path}.spec.sql is required.`),t.push(...B(i.fields,`${s.path}.spec.fields`));break}return t}function at(s,o){if(s===void 0)return[];const t=a(s);if(!t)return[`${o} must be an object.`];const i=[];i.push(...se(t.rows,`${o}.rows`),...se(t.columns,`${o}.columns`));for(const n of Object.keys(t))n==="rows"||n==="columns"||i.push(`${o}.${n} is not supported.`);return i}function se(s,o){if(s===void 0)return[];const t=a(s);if(!t)return[`${o} must be an object.`];const i=[];(typeof t.limit!="number"||!Number.isInteger(t.limit)||t.limit<1)&&i.push(`${o}.limit must be a positive integer.`);for(const n of Object.keys(t))n!=="limit"&&i.push(`${o}.${n} is not supported; matrix display limits are count-only in v1.`);return i}function lt(s,o){const t=[];if(s.driverMode!==void 0&&!De.has(s.driverMode)&&t.push(`${o}.driverMode must be a supported analysis driver mode.`),s.includePopulation!==void 0&&typeof s.includePopulation!="boolean"&&t.push(`${o}.includePopulation must be a boolean.`),s.calendarContext!==void 0){const i=a(s.calendarContext);if(!i)t.push(`${o}.calendarContext must be an object.`);else{i.tz!==void 0&&typeof i.tz!="string"&&t.push(`${o}.calendarContext.tz must be a string.`),i.weekStart!==void 0&&(typeof i.weekStart!="number"||!Number.isInteger(i.weekStart)||i.weekStart<0||i.weekStart>6)&&t.push(`${o}.calendarContext.weekStart must be an integer between 0 and 6.`);const n=i.anchor;if(n!==void 0&&n!=="now"){const r=a(n);(!r||typeof r.iso!="string"||!r.iso.trim())&&t.push(`${o}.calendarContext.anchor must be now or { iso }.`)}}}return t}function ut(s,o){if(s===void 0)return[];const t=a(s);if(!t)return[`${o} must be an object.`];const i=[];return t.mode!=="server"&&i.push(`${o}.mode must be server.`),!Array.isArray(t.measures)||t.measures.length===0?i.push(`${o}.measures must include at least one measure.`):t.measures.forEach((n,r)=>{var l;i.push(...pe(n,`${o}.measures.${r}`)),((l=a(n))==null?void 0:l.role)!=="measure"&&i.push(`${o}.measures.${r}.role must be measure.`)}),i}function v(s,o,t){const i=[];return Object.keys(s).forEach(n=>{o.has(n)||i.push(`${t}.${n} is not supported for this SDK builder.`)}),i}function A(s,o){return a(s.source)?w(s.source,`${o}.spec.source`):[`${o}.spec.source must be an object.`]}function dt(s,o){const t=a(s.source);if(!t)return[`${o}.spec.source must be an object.`];const i=w(s.source,`${o}.spec.source`);return t.kind!=="semantic"&&t.kind!=="physical"&&i.push(`${o}.spec.source.kind must be semantic or physical.`),i}function O(s,o){const t=H(s,o);return Array.isArray(s)&&s.forEach((i,n)=>{t.push(...p(i,`${o}.${n}`))}),t}function B(s,o){if(s===void 0)return[];if(!Array.isArray(s))return[`${o} must be an array.`];const t=[];return s.forEach((i,n)=>{t.push(...p(i,`${o}.${n}`))}),t}function P(s,o){if(s===void 0)return[];const t=a(s);return t?[...p(t.field,`${o}.field`),...de(t.direction,`${o}.direction`)]:[`${o} must be an object.`]}function ct(s,o){const t=H(s,o);return Array.isArray(s)&&s.forEach((i,n)=>{const r=a(i);if(!r){t.push(`${o}.${n} must be an object.`);return}t.push(...p(r.field,`${o}.${n}.field`))}),t}function pt(s,o){if(s===void 0)return[];const t=[];return Array.isArray(s)?(s.forEach((i,n)=>{const r=a(i);if(!r){t.push(`${o}.${n} must be an object.`);return}t.push(...p(r.field,`${o}.${n}.field`))}),t):[`${o} must be an array.`]}function mt(s,o){const t=H(s,o);return Array.isArray(s)&&s.forEach((i,n)=>{const r=a(i);if(!r){t.push(`${o}.${n} must be an object.`);return}t.push(...p(r.field,`${o}.${n}.field`))}),t}function gt(s,o){if(s===void 0)return[];if(!Array.isArray(s))return[`${o} must be an array.`];const t=[];return s.forEach((i,n)=>{const r=a(i);if(!r){t.push(`${o}.${n} must be an object.`);return}r.axis!=="row"&&r.axis!=="column"&&t.push(`${o}.${n}.axis must be row or column.`),t.push(...de(r.direction,`${o}.${n}.direction`),...ht(r.by,`${o}.${n}.by`))}),t}function ht(s,o){const t=a(s);if(!t)return[`${o} must be an object.`];switch(t.kind){case"label":return[];case"field":return p(t.field,`${o}.field`);case"value":return typeof t.valueId!="string"||!t.valueId.trim()?[`${o}.valueId is required.`]:[];default:return[`${o}.kind must be label, field, or value.`]}}function de(s,o){return s==="asc"||s==="desc"?[]:[`${o} must be asc or desc.`]}function R(s,o){if(s===void 0)return[];if(!Array.isArray(s))return[`${o} must be an array.`];const t=[];return s.forEach((i,n)=>{const r=a(i);if(!r){t.push(`${o}.${n} must be an object.`);return}t.push(...p(r.field,`${o}.${n}.field`))}),t}function H(s,o){return!Array.isArray(s)||s.length===0?[`${o} must be a non-empty array.`]:[]}function ft(s){switch(s){case"metric":return"semaphor.metric";case"records":return"semaphor.records";case"matrix":return"semaphor.matrix";case"analysis":return"semaphor.analysis";case"sql_fallback":return"semaphor.sql"}}function yt(s){const o=a(s.computation),t=a(s.visualSpec);return(o==null?void 0:o.kind)==="presentation_only"||(o==null?void 0:o.kind)==="derived"||(o==null?void 0:o.kind)==="unsupported"||s.visual==="text_block"||(t==null?void 0:t.visualType)==="text_block"}function zt(s,o){const t=a(s);if(!t)return[`${o} must be an object.`];const i=[];return Ve.has(t.visualType)||i.push(`${o}.visualType must be a supported visual type.`),t.limit!==void 0&&(typeof t.limit!="number"||!Number.isInteger(t.limit)||t.limit<=0)&&i.push(`${o}.limit must be a positive integer.`),t.tableBehavior!==void 0&&i.push(...bt(t.tableBehavior,`${o}.tableBehavior`)),i}function bt(s,o){const t=a(s);if(!t)return[`${o} must be an object.`];const i=[];return t.tableMode!=="bounded"&&t.tableMode!=="server_paginated"&&t.tableMode!=="server_windowed"&&i.push(`${o}.tableMode must be a supported table mode.`),i.push(...St(t.height,`${o}.height`),...vt(t.pagination,`${o}.pagination`),...$t(t.sorting,`${o}.sorting`),...wt(t.totals,`${o}.totals`)),typeof t.serverSideRequired!="boolean"&&i.push(`${o}.serverSideRequired must be a boolean.`),i}function St(s,o){const t=a(s);if(!t)return[`${o} must be an object.`];const i=[];return(typeof t.maxPx!="number"||!Number.isInteger(t.maxPx)||t.maxPx<=0)&&i.push(`${o}.maxPx must be a positive integer.`),t.scroll!=="vertical"&&t.scroll!=="both"&&i.push(`${o}.scroll must be vertical or both.`),typeof t.stickyHeader!="boolean"&&i.push(`${o}.stickyHeader must be a boolean.`),i}function vt(s,o){const t=a(s);if(!t)return[`${o} must be an object.`];const i=[];return t.mode!=="none"&&t.mode!=="server"&&t.mode!=="client_for_bounded_rows"&&i.push(`${o}.mode must be a supported pagination mode.`),t.pageSize!==void 0&&(typeof t.pageSize!="number"||!Number.isInteger(t.pageSize)||t.pageSize<=0)&&i.push(`${o}.pageSize must be a positive integer.`),t.readsFrom!==void 0&&t.readsFrom!=="result.pagination"&&i.push(`${o}.readsFrom must be result.pagination.`),i}function $t(s,o){const t=a(s);if(!t)return[`${o} must be an object.`];const i=[];return t.mode!=="server"&&t.mode!=="client_for_bounded_rows"&&i.push(`${o}.mode must be a supported sorting mode.`),t.defaultField!==void 0&&(typeof t.defaultField!="string"||!t.defaultField.trim())&&i.push(`${o}.defaultField must be a non-empty string.`),t.defaultDirection!==void 0&&t.defaultDirection!=="asc"&&t.defaultDirection!=="desc"&&i.push(`${o}.defaultDirection must be asc or desc.`),t.resetPageOnChange!==void 0&&typeof t.resetPageOnChange!="boolean"&&i.push(`${o}.resetPageOnChange must be a boolean.`),i}function wt(s,o){const t=a(s);if(!t)return[`${o} must be an object.`];const i=[];return t.mode!=="none"&&t.mode!=="server"&&t.mode!=="local"?(i.push(`${o}.mode must be none, server, or local.`),i):t.mode==="none"?(t.measures!==void 0&&i.push(`${o}.measures is not allowed when mode is none.`),t.label!==void 0&&i.push(`${o}.label is not allowed when mode is none.`),i):t.mode==="server"?(!Array.isArray(t.measures)||t.measures.length===0?i.push(`${o}.measures must include at least one measure when mode is server.`):t.measures.forEach((n,r)=>{var l;i.push(...pe(n,`${o}.measures.${r}`)),((l=a(n))==null?void 0:l.role)!=="measure"&&i.push(`${o}.measures.${r}.role must be measure.`)}),t.label!==void 0&&i.push(`${o}.label is not allowed when mode is server.`),i):(t.mode==="local"&&(t.label!=="Displayed rows"&&t.label!=="Current page"&&i.push(`${o}.label must be Displayed rows or Current page when mode is local.`),t.measures!==void 0&&i.push(`${o}.measures is not allowed when mode is local.`)),i)}function kt(s,o){const t=a(s);if(!t)return[`${o} must be an object.`];const i=[];switch(t.kind){case"server_query":$(t.queryKind)||i.push(`${o}.queryKind must be a supported codegen query kind.`),t.queryOwnership!==void 0&&t.queryOwnership!=="view_owned"&&t.queryOwnership!=="shared_query"&&i.push(`${o}.queryOwnership must be view_owned or shared_query.`),t.sourceKeys!==void 0&&!g(t.sourceKeys)&&i.push(`${o}.sourceKeys must be an array of strings.`),t.fieldNames!==void 0&&!g(t.fieldNames)&&i.push(`${o}.fieldNames must be an array of strings.`);break;case"derived":(typeof t.upstreamViewId!="string"||!t.upstreamViewId.trim())&&i.push(`${o}.upstreamViewId is required.`),(typeof t.derivation!="string"||!t.derivation.trim())&&i.push(`${o}.derivation is required.`);break;case"presentation_only":break;case"unsupported":(typeof t.reason!="string"||!t.reason.trim())&&i.push(`${o}.reason is required.`),(typeof t.suggestedModelingFix!="string"||!t.suggestedModelingFix.trim())&&i.push(`${o}.suggestedModelingFix is required.`);break;default:i.push(`${o}.kind must be a supported computation kind.`)}return i}function It(s,o){const t=a(s);if(!t)return[`${o} must be an object.`];const i=[];for(const r of["title","requestedQuestion","suggestedModelingFix"])(typeof t[r]!="string"||!t[r].trim())&&i.push(`${o}.${r} is required.`);return Le.has(t.reason)||i.push(`${o}.reason must be a supported unsupported insight reason.`),(t.relationshipCandidate!==void 0||t.nextRepairAction!==void 0)&&t.reason!=="missing_relationship"&&i.push(`${o} relationship repair metadata is only valid for missing_relationship unsupported insights.`),t.relationshipCandidate!==void 0&&i.push(...Rt(t.relationshipCandidate,`${o}.relationshipCandidate`)),t.nextRepairAction!==void 0&&i.push(...At(t.nextRepairAction,`${o}.nextRepairAction`)),i}function At(s,o){const t=a(s);if(!t)return[`${o} must be an object.`];const i=[],n=new Set(["tool","reason"]);return Object.keys(t).forEach(r=>{n.has(r)||i.push(`${o}.${r} is not supported; repair actions support only tool and reason.`)}),t.tool!=="semaphor_propose_semantic_model_change"&&i.push(`${o}.tool must be semaphor_propose_semantic_model_change.`),t.reason!=="missing_relationship"&&i.push(`${o}.reason must be missing_relationship.`),i}function Rt(s,o){const t=a(s);if(!t)return[`${o} must be an object.`];const i=[],n=new Set(["source","sourceFields","target","targetFields"]);Object.keys(t).forEach(r=>{n.has(r)||i.push(`${o}.${r} is not supported; relationship candidates support only source, sourceFields, target, and targetFields.`)}),i.push(...ie(t.source,`${o}.source`)),i.push(...ie(t.target,`${o}.target`));for(const r of["sourceFields","targetFields"]){const l=t[r];if(!Array.isArray(l)||l.length===0){i.push(`${o}.${r} must be a non-empty endpoint field array.`);continue}l.forEach((u,d)=>{i.push(..._t(u,`${o}.${r}.${d}`))})}return i}function _t(s,o){const t=a(s);if(!t)return[`${o} must be an object.`];const i=[],n=new Set(["name","label","role","dataType"]);return Object.keys(t).forEach(r=>{n.has(r)||i.push(`${o}.${r} is not supported; relationship candidate fields are scoped by their endpoint and support only name, label, role, and dataType.`)}),(typeof t.name!="string"||!t.name.trim())&&i.push(`${o}.name must be a non-empty string.`),t.role!==void 0&&(typeof t.role!="string"||!["dimension","measure","date","id","unknown"].includes(t.role))&&i.push(`${o}.role must be dimension, measure, date, id, or unknown.`),t.dataType!==void 0&&(typeof t.dataType!="string"||!["string","number","boolean","date","datetime","unknown"].includes(t.dataType))&&i.push(`${o}.dataType must be string, number, boolean, date, datetime, or unknown.`),i}function ie(s,o){const t=a(s);if(!t)return[`${o} must be an object.`];const i=[],n=new Set(["kind","domainId","datasetName","datasetId","label","sourceKey"]);return Object.keys(t).forEach(r=>{n.has(r)||i.push(`${o}.${r} is not supported; relationship candidate sources support only semantic identity fields.`)}),t.kind!=="semantic"&&i.push(`${o} must use semantic source identity.`),(typeof t.domainId!="string"||!t.domainId.trim()||typeof t.datasetName!="string"||!t.datasetName.trim())&&i.push(`${o} must include semantic domainId and datasetName.`),i}function $(s){return Ke.has(s)}function ce(s){return Me.has(s)}function h(s,o){return s===void 0?[]:p(s,o)}function p(s,o){const t=a(s);if(!t)return[`${o} must be an object.`];const i=[];return(typeof t.name!="string"||!t.name.trim())&&i.push(`${o}.name is required.`),!t.source&&typeof t.sourceKey!="string"&&i.push(`${o} must include source or sourceKey.`),i}function pe(s,o){const t=a(s),i=p(s,o);if(!t||typeof t.sourceKey=="string"&&t.sourceKey.trim())return i;if(t.source!==void 0){const r=w(t.source,`${o}.source`);return r.length===0||i.push(...r),i}return i.includes(`${o} must include source or sourceKey.`)||i.push(`${o} must include source or sourceKey.`),i}function a(s){return s&&typeof s=="object"&&!Array.isArray(s)?s:void 0}function g(s){return Array.isArray(s)&&s.every(o=>typeof o=="string")}const m=e.z.record(e.z.string(),e.z.unknown()),F=e.z.array(m),c=e.z.enum(["SUM","COUNT","AVG","MIN","MAX","MEDIAN","DISTINCT"]),N=e.z.enum(["postgres","mysql","mssql","snowflake","clickhouse","bigquery","redshift","duckdb","sqlite","unknown"]),me=e.z.enum(["hour","day","week","month","quarter","year"]),K=e.z.enum(["dimension","measure","date","id","unknown"]),M=e.z.enum(["string","number","boolean","date","datetime","unknown"]),ge=e.z.enum(["semantic_model","caller_override","default_sum"]),_=e.z.union([e.z.number(),e.z.string(),e.z.null()]),V=e.z.enum(["millisecond","second","minute","hour","day"]),he=e.z.union([e.z.object({type:e.z.enum(["number","currency","percent","percentage","scientific"]),locale:e.z.string().optional(),minimumFractionDigits:e.z.number().optional(),maximumFractionDigits:e.z.number().optional(),useGrouping:e.z.boolean().optional(),prefix:e.z.string().optional(),suffix:e.z.string().optional(),negativeStyle:e.z.enum(["minus","parentheses"]).optional(),compact:e.z.boolean().optional(),scale:e.z.number().optional(),currency:e.z.string().optional(),percentValueMode:e.z.enum(["fraction","whole"]).optional()}).passthrough(),e.z.object({type:e.z.enum(["date","datetime"]),locale:e.z.string().optional(),pattern:e.z.string().optional(),relative:e.z.boolean().optional(),timezone:e.z.string().optional(),sourceTimezone:e.z.string().optional(),prefix:e.z.string().optional(),suffix:e.z.string().optional()}).passthrough(),e.z.object({type:e.z.literal("duration"),inputUnit:V.optional(),outputStyle:e.z.enum(["compact","digital","long"]).optional(),largestUnit:V.optional(),smallestUnit:V.optional(),maxUnits:e.z.number().optional(),prefix:e.z.string().optional(),suffix:e.z.string().optional(),negativeStyle:e.z.enum(["minus","parentheses"]).optional()}).passthrough(),e.z.object({type:e.z.literal("string"),prefix:e.z.string().optional(),suffix:e.z.string().optional()}).passthrough()]),jt=e.z.union([e.z.object({kind:e.z.literal("defaultAggregate")}).passthrough(),e.z.object({kind:e.z.literal("blank")}).passthrough(),e.z.object({kind:e.z.literal("labelOnly"),label:e.z.string().optional()}).passthrough(),e.z.object({kind:e.z.literal("customAggregate"),aggregate:c}).passthrough(),e.z.object({kind:e.z.literal("percentOfParent")}).passthrough(),e.z.object({kind:e.z.literal("percentOfGrandTotal")}).passthrough(),e.z.object({kind:e.z.literal("customExpression"),expressionId:e.z.string()}).passthrough()]);function k(s,o){return e.z.object(s).passthrough().superRefine((t,i)=>{for(const n of o)Object.prototype.hasOwnProperty.call(t,n)||i.addIssue({code:"custom",path:[n],message:`Required field "${n}" is missing.`})})}const Q=e.z.object({kind:e.z.literal("semantic"),domainId:e.z.string(),datasetName:e.z.string(),datasetId:e.z.string().optional(),label:e.z.string().optional(),connectionId:e.z.string().optional()}).passthrough(),fe=e.z.object({kind:e.z.literal("physical"),connectionId:e.z.string(),connectionType:e.z.string().optional(),tableName:e.z.string(),databaseName:e.z.string().optional(),schemaName:e.z.string().optional(),label:e.z.string().optional(),dialect:N.optional()}).passthrough(),ye=e.z.object({kind:e.z.literal("sql"),connectionId:e.z.string(),dialect:N.optional(),label:e.z.string().optional()}).passthrough(),b=e.z.union([Q,fe,ye]),y=e.z.object({name:e.z.string(),label:e.z.string().optional(),role:K.optional(),dataType:M.optional(),source:b.optional(),aggregate:c.optional()}).passthrough(),Ct=e.z.object({kind:e.z.literal("field"),field:y,aggregate:c.optional()}).passthrough(),Y=e.z.object({kind:e.z.literal("derived_field"),name:e.z.string(),label:e.z.string(),description:e.z.string().optional(),resultRole:K,dataType:M,computeStage:e.z.enum(["row","aggregate"]),expression:e.z.string(),expressionLanguage:e.z.literal("semaphor_sql_template").optional(),inputs:e.z.record(Ct),defaultAggregate:c.optional(),aggregationBehavior:e.z.enum(["additive","non_additive","ratio_of_sums","weighted","pre_aggregated","snapshot"]).optional(),aggregationStrategy:e.z.enum(["default","symmetric_aggregate","aggregate_then_join","weighted"]).optional(),format:he.optional(),tags:e.z.array(e.z.string()).optional()}).passthrough(),D=y.and(e.z.object({semanticAggregate:c.optional(),effectiveAggregate:c.optional(),aggregateSource:ge.optional(),derivedField:Y.optional()}).passthrough()),qt=Q,xt=e.z.object({kind:e.z.literal("physical"),connectionId:e.z.string().optional(),connectionType:e.z.string().optional(),tableName:e.z.string(),databaseName:e.z.string().optional(),schemaName:e.z.string().optional(),label:e.z.string().optional(),dialect:N.optional()}).passthrough(),Et=e.z.object({kind:e.z.literal("sql"),connectionId:e.z.string().optional(),dialect:N.optional(),label:e.z.string().optional()}).passthrough(),Ft=e.z.union([qt,xt,Et]),Nt=e.z.object({key:e.z.string().optional(),name:e.z.string(),label:e.z.string().optional(),role:K.optional(),dataType:M.optional(),source:Ft.optional(),aggregate:c.optional(),semanticAggregate:c.optional(),effectiveAggregate:c.optional(),aggregateSource:ge.optional(),derivedField:e.z.never().optional()}).passthrough(),q=e.z.object({key:e.z.string(),name:e.z.string(),label:e.z.string(),role:K.optional(),dataType:M.optional(),aggregate:c.optional(),source:b.optional(),derivedField:Y.optional()}).passthrough(),ze=e.z.object({code:e.z.string(),message:e.z.string().optional(),invalidField:e.z.string().optional(),fieldRole:e.z.enum(["measure","date","dimension","input","source","sql"]).optional(),validMeasureCandidates:e.z.array(e.z.string()).optional(),validDateCandidates:e.z.array(e.z.string()).optional(),validDimensionCandidates:e.z.array(e.z.string()).optional(),recommendedNextStep:e.z.string()}).passthrough(),x=e.z.object({code:e.z.string(),message:e.z.string(),path:e.z.string().optional(),fieldRole:e.z.enum(["measure","date","dimension","input","source","sql"]).optional(),repairHint:ze.optional()}).passthrough(),W=e.z.object({ok:e.z.boolean(),errors:e.z.array(x),warnings:e.z.array(x),repairHints:e.z.array(ze)}).passthrough(),Kt=e.z.object({page:e.z.number(),pageSize:e.z.number(),pageCount:e.z.number(),totalCount:e.z.number(),hasNextPage:e.z.boolean(),hasPrevPage:e.z.boolean()}).passthrough(),I={intentId:e.z.string().optional(),queryPath:e.z.enum(["query_spec","sql","sql_python"]),warnings:e.z.array(e.z.string()).optional(),rowCount:e.z.number().optional(),rowLimitExceeded:e.z.boolean().optional(),limit:e.z.number().optional(),pagination:Kt.optional()},be=e.z.object({...I,kind:e.z.literal("metric"),value:_,measures:e.z.record(_).optional(),missingMeasures:e.z.array(e.z.string()).optional(),comparison:e.z.object({kind:e.z.enum(["previous_period","previous_year","target"]),value:_.optional(),delta:e.z.union([e.z.number(),e.z.null()]).optional(),deltaPercent:e.z.union([e.z.number(),e.z.null()]).optional()}).passthrough().optional(),records:F.optional()}).passthrough(),Se=e.z.object({...I,kind:e.z.literal("records"),columns:e.z.array(q),records:F,totals:e.z.object({mode:e.z.literal("server"),scope:e.z.literal("filtered_result"),row:e.z.record(e.z.string(),e.z.unknown()),columns:e.z.array(q).optional()}).passthrough().optional()}).passthrough(),ve=e.z.object({...I,kind:e.z.literal("inputOptions"),options:e.z.array(k({label:e.z.string(),value:e.z.unknown(),count:e.z.number().optional(),disambiguation:e.z.array(e.z.string()).optional()},["value"]))}).passthrough(),$e=e.z.object({...I,kind:e.z.literal("sql"),columns:e.z.array(q),records:F,sqlShape:e.z.object({statementType:e.z.string().optional(),explicitLimit:e.z.number().optional(),hasPythonCode:e.z.boolean().optional()}).passthrough().optional()}).passthrough(),Mt=e.z.object({enabled:e.z.boolean().optional(),position:e.z.enum(["before","after"]).optional(),label:e.z.string().optional()}).passthrough(),ne=e.z.object({id:e.z.enum(["rows","columns"]),levels:e.z.array(e.z.object({instanceId:e.z.string(),fieldKey:e.z.string(),label:e.z.string(),field:y,grain:me.optional(),subtotal:Mt.optional()}).passthrough()),nodeIds:e.z.array(e.z.string())}).passthrough(),S=k({instanceId:e.z.string(),fieldKey:e.z.string(),value:e.z.unknown(),label:e.z.string()},["value"]),Dt=e.z.union([e.z.object({kind:e.z.literal("label")}).passthrough(),e.z.object({kind:e.z.literal("field"),field:y,aggregate:c.optional()}).passthrough(),e.z.object({kind:e.z.literal("value"),valueId:e.z.string(),rowPath:e.z.array(S).optional(),columnPath:e.z.array(S).optional()}).passthrough()]),Tt=e.z.enum(["present","presentNull","missing","densified"]),Ot=e.z.enum(["value","rowSubtotal","columnSubtotal","subtotalIntersection","rowGrandTotal","columnGrandTotal","matrixGrandTotal"]),Bt=e.z.object({instanceId:e.z.string(),fieldKey:e.z.string(),field:y,role:e.z.enum(["row","column","measure","sort","filter"]),label:e.z.string().optional()}).passthrough(),Pt=e.z.union([e.z.object({kind:e.z.literal("additive"),aggregate:c.optional()}).passthrough(),e.z.object({kind:e.z.literal("semiAdditive"),aggregate:c.optional(),grain:me.optional()}).passthrough(),e.z.object({kind:e.z.literal("nonAdditive"),aggregate:c.optional()}).passthrough(),e.z.object({kind:e.z.literal("ratio"),numeratorMeasureInstanceId:e.z.string().optional(),denominatorMeasureInstanceId:e.z.string().optional()}).passthrough(),e.z.object({kind:e.z.literal("custom"),expressionId:e.z.string().optional()}).passthrough()]),Vt=e.z.object({instanceId:e.z.string(),fieldKey:e.z.string(),label:e.z.string(),field:y,aggregate:c.optional(),format:he.optional(),totalBehavior:jt.optional(),semantics:Pt}).passthrough(),Lt=e.z.object({id:e.z.string(),measureId:e.z.string(),aggregate:c.optional(),label:e.z.string().optional(),source:e.z.enum(["measureDefault","rowSubtotal","columnSubtotal","subtotalIntersection","rowGrandTotal","columnGrandTotal","matrixGrandTotal","custom"]),scope:e.z.object({rowLevelId:e.z.string().optional(),columnLevelId:e.z.string().optional(),rowNodeId:e.z.string().optional(),columnNodeId:e.z.string().optional()}).passthrough().optional()}).passthrough(),Ut=e.z.object({kind:e.z.string(),label:e.z.string().optional(),payload:e.z.record(e.z.string(),e.z.unknown()).optional()}).passthrough(),Gt=k({id:e.z.string(),axis:e.z.enum(["row","column"]),path:e.z.array(S),level:e.z.number(),label:e.z.string(),value:e.z.unknown(),parentId:e.z.string().optional(),hasChildren:e.z.boolean(),isExpanded:e.z.boolean().optional(),isSubtotal:e.z.boolean().optional(),isGrandTotal:e.z.boolean().optional(),subtotalFunction:c.optional(),childCount:e.z.number().optional(),actions:e.z.array(Ut).optional()},["value"]),Ht=e.z.object({rowHeaderLevels:e.z.array(e.z.object({id:e.z.string(),label:e.z.string(),fieldInstanceId:e.z.string()}).passthrough()),columnHeaderRows:e.z.array(e.z.object({id:e.z.string(),cells:e.z.array(e.z.object({id:e.z.string(),label:e.z.string(),role:e.z.enum(["rowHeader","columnHeader","measureHeader","subtotal","grandTotal"]),colSpan:e.z.number(),rowSpan:e.z.number(),columnPath:e.z.array(S),measureInstanceId:e.z.string().optional()}).passthrough())}).passthrough()),columns:e.z.array(e.z.object({id:e.z.string(),label:e.z.string(),columnNodeId:e.z.string().optional(),columnPath:e.z.array(S),measureInstanceId:e.z.string(),role:e.z.enum(["value","columnSubtotal","columnGrandTotal"])}).passthrough())}).passthrough(),Qt=k({rowId:e.z.string(),columnId:e.z.string().optional(),measureId:e.z.string(),value:e.z.unknown(),formattedValue:e.z.string().optional(),presence:Tt,role:Ot,calculationId:e.z.string().optional()},["value"]),Yt=e.z.object({rows:e.z.boolean().optional(),columns:e.z.boolean().optional(),grandTotal:e.z.union([e.z.boolean(),e.z.object({rows:e.z.boolean().optional(),columns:e.z.boolean().optional()}).passthrough()]).optional()}).passthrough(),Wt=k({id:e.z.string(),axis:e.z.enum(["row","column"]),targetInstanceId:e.z.string().optional(),direction:e.z.enum(["asc","desc"]),nulls:e.z.enum(["warehouseDefault","first","last"]).optional(),scope:e.z.enum(["global","withinParent"]).optional(),by:Dt},["by"]),Zt=e.z.object({rowOffset:e.z.number().optional(),rowLimit:e.z.number().optional(),columnOffset:e.z.number().optional(),columnLimit:e.z.number().optional(),hasMoreRows:e.z.boolean().optional(),hasMoreColumns:e.z.boolean().optional()}).passthrough(),Jt=e.z.object({axis:e.z.enum(["row","column"]),path:e.z.array(S),depth:e.z.number().optional()}).passthrough(),Xt=e.z.object({rowLazyLoading:e.z.boolean().optional(),columnLazyLoading:e.z.boolean().optional(),expandableRowNodeIds:e.z.array(e.z.string()).optional(),expandableColumnNodeIds:e.z.array(e.z.string()).optional(),nextRequests:e.z.array(Jt).optional()}).passthrough(),eo=e.z.object({domains:e.z.record(e.z.object({min:e.z.number().optional(),max:e.z.number().optional()}).passthrough()).optional(),rules:e.z.array(e.z.record(e.z.string(),e.z.unknown())).optional()}).passthrough(),we=e.z.object({...I,kind:e.z.literal("matrix"),schemaVersion:e.z.literal(1),shape:e.z.enum(["hierarchical","pivot"]),capabilities:e.z.array(e.z.string()),executionMetadata:e.z.record(e.z.string(),e.z.unknown()),fieldsById:e.z.record(e.z.string(),Bt),measuresById:e.z.record(e.z.string(),Vt),calculationsById:e.z.record(e.z.string(),Lt).optional(),axes:e.z.object({rows:ne,columns:ne}).passthrough(),nodesById:e.z.record(e.z.string(),Gt),layout:Ht,cells:e.z.array(Qt),totals:Yt,sort:e.z.array(Wt),formattingContext:eo,pageInfo:Zt.optional(),expansion:Xt.optional()}).passthrough(),ke=e.z.union([be,Se,ve,$e,we]),Ie=e.z.object({status:e.z.enum(["not_required","resolved","missing","ambiguous","fanout_risk","unknown"]),requiredSources:e.z.array(b).optional(),relationshipsUsed:e.z.array(e.z.string()).optional(),missingSources:e.z.array(e.z.string()).optional(),warnings:e.z.array(e.z.string()).optional(),message:e.z.string().optional(),recommendedNextStep:e.z.string().optional(),joinPlanSummary:e.z.object({baseSource:b.optional(),joinedSources:e.z.array(b).optional(),joinCount:e.z.number().optional()}).passthrough().optional(),fanoutRisk:e.z.object({status:e.z.enum(["none","warning","error","unknown"]),message:e.z.string().optional()}).passthrough().optional()}).passthrough(),re=e.z.enum(["ambiguous_fields","empty_result","missing_grounded_fields","missing_relationship","no_grounded_query","partial_result","presentation_incomplete","query_validation_failed","unsafe_join"]),Z=e.z.object({version:e.z.literal(1),status:e.z.enum(["answered","partial","blocked"]),summary:e.z.string(),answered:e.z.array(e.z.object({slotId:e.z.string().optional(),queryId:e.z.string().optional(),summary:e.z.string(),evidenceIds:e.z.array(e.z.string()).optional(),fieldsUsed:e.z.array(D).optional()}).passthrough()),blocked:e.z.array(e.z.object({slotId:e.z.string().optional(),queryId:e.z.string().optional(),reasonCode:re,message:e.z.string(),missingFields:e.z.array(e.z.string()).optional(),availableFields:e.z.array(e.z.string()).optional(),ambiguousFields:e.z.array(e.z.string()).optional(),missingRelationships:e.z.array(e.z.string()).optional(),evidenceIds:e.z.array(e.z.string()).optional(),neededFromUser:e.z.array(e.z.string()).optional(),recommendedNextStep:e.z.string().optional()}).passthrough()),semanticModelRecommendations:e.z.array(e.z.object({reasonCode:re,message:e.z.string(),recommendedNextStep:e.z.string().optional()}).passthrough()).optional()}).passthrough(),J=e.z.object({scope:e.z.literal("filtered_query"),measures:e.z.record(_)}).passthrough(),X=e.z.object({answeredObligations:e.z.array(e.z.string()),missingObligations:e.z.array(e.z.string()),warnings:e.z.array(x).optional()}).passthrough(),Ae=e.z.object({intentId:e.z.string().optional(),queryId:e.z.string().optional(),status:e.z.enum(["answered","partial","failed"]),resultShape:e.z.enum(["metric","records","inputOptions","sql","matrix","period_change","analysis"]).optional(),intent:e.z.unknown().optional(),compiledQuery:e.z.unknown().optional(),fieldsUsed:e.z.array(D).optional(),result:ke.optional(),validation:W,coverage:X.optional(),missingFields:e.z.array(e.z.string()).optional(),warnings:e.z.array(e.z.string()).optional(),relationshipDiagnostics:Ie.optional(),diagnosticFeedback:Z.optional(),population:J.optional(),metadata:e.z.record(e.z.string(),e.z.unknown()).optional()}).passthrough();function to(s){switch(s){case"boolean":return e.z.boolean().optional();case"compactExecutionFieldArray":return e.z.array(Nt).optional();case"coverage":return X.optional();case"diagnosticFeedback":return Z.optional();case"executionFieldArray":return e.z.array(D).optional();case"executionResult":return Ae.optional();case"number":return e.z.number().finite().optional();case"population":return J.optional();case"record":return m.optional();case"recordArray":return F.optional();case"responseDetail":return e.z.enum(["compact","standard","debug"]).optional();case"string":return e.z.string().optional();case"stringArray":return e.z.array(e.z.string()).optional();case"unknown":return e.z.unknown().optional();case"unknownArray":return e.z.array(e.z.unknown()).optional();case"validationResult":return W.optional()}}const Re=Object.fromEntries(Object.entries(E).map(([s,o])=>[s,to(o)])),_e=e.z.object(Re).strict(),ee=e.z.object({sourceKey:e.z.string().optional(),kind:e.z.enum(["semantic","physical","sql"]).optional(),domainId:e.z.string().optional(),datasetName:e.z.string().optional(),datasetId:e.z.string().optional(),connectionId:e.z.string().optional(),tableName:e.z.string().optional(),label:e.z.string().optional()}).passthrough(),f=e.z.object({name:e.z.string(),label:e.z.string().optional(),role:e.z.enum(["dimension","measure","date","id","unknown"]).optional(),dataType:e.z.enum(["string","number","boolean","date","datetime","unknown"]).optional(),aggregate:c.optional(),sourceKey:e.z.string().optional(),source:ee.optional()}).passthrough(),je=e.z.object({id:e.z.string().optional(),builder:e.z.literal("semaphor.inputOptions"),source:ee.optional(),sourceKey:e.z.string().optional(),valueFieldRef:f,labelFieldRef:f,filterFieldRef:f.optional(),population:e.z.unknown().optional(),dependencies:e.z.unknown().optional(),limit:e.z.number().int().positive().optional(),spec:m.optional()}).passthrough(),Ce=e.z.object({appliesToViewIds:e.z.array(e.z.string()).optional(),viewId:e.z.string().optional(),fieldRef:f,relationshipHint:e.z.unknown().optional(),relationshipsUsed:e.z.array(m).optional()}).passthrough(),oo=e.z.object({id:e.z.string(),label:e.z.string().optional(),type:e.z.string().optional(),serverSide:e.z.boolean().optional(),fieldRef:f.optional(),optionQuery:je.optional(),bindings:e.z.array(Ce).optional(),appliesToViewIds:e.z.array(e.z.string()),relationshipHint:e.z.unknown().optional(),relationshipsUsed:e.z.array(m).optional()}).passthrough(),so=e.z.object({builder:e.z.enum(["semaphor.metric","semaphor.records","semaphor.matrix","semaphor.analysis","semaphor.sql"]),spec:m,fallbackReason:m.optional()}).passthrough(),io=e.z.object({id:e.z.string(),title:e.z.string().optional(),purpose:e.z.string().optional(),sourcePresentation:e.z.object({sourceKeys:e.z.array(e.z.string()).optional(),sourceLabels:e.z.array(e.z.string()).optional()}).passthrough().optional(),visual:e.z.string().optional(),visualSpec:m.optional(),queryKind:e.z.enum(["metric","records","matrix","analysis","sql_fallback"]).optional(),sdkBuilder:e.z.enum(["semaphor.metric","semaphor.records","semaphor.matrix","semaphor.analysis","semaphor.sql"]).optional(),sdkSpec:so.optional(),fields:e.z.array(f).optional(),computation:m.optional(),uxExpectations:e.z.array(e.z.string()).optional(),validation:m.optional()}).passthrough(),no=e.z.object({inputId:e.z.string(),label:e.z.string().optional(),type:e.z.string().optional(),serverSide:e.z.boolean().optional(),fieldRef:f.optional(),optionQuery:je.optional(),bindings:e.z.array(Ce),appliesToViewIds:e.z.array(e.z.string()),notAppliedToViewIds:e.z.array(e.z.string())}).passthrough(),ro=e.z.object({schemaVersion:e.z.literal(C),title:e.z.string(),purpose:e.z.string().optional(),userGoal:e.z.string().optional(),nextStep:e.z.string().optional(),sources:e.z.array(ee),inputs:e.z.array(oo),views:e.z.array(io),filterContracts:e.z.array(no),implementationChecklist:e.z.object({schemaVersion:e.z.string().optional(),requiredDevtools:e.z.object({mountRootDevtools:e.z.boolean(),providerDebugBridge:e.z.string().optional(),panelPosition:e.z.string().optional(),forbidden:e.z.array(e.z.string()).optional()}).passthrough(),requiredInputOptions:e.z.array(m),filterScopeByInput:e.z.array(m),bindingsByView:e.z.record(e.z.string(),e.z.array(m)),validationCommands:e.z.array(e.z.string()),browserSmokeChecks:e.z.array(e.z.string())}).passthrough(),nextRequiredTool:e.z.object({name:e.z.string(),reason:e.z.string().optional()}).optional(),unsupportedInsights:e.z.array(e.z.object({title:e.z.string(),requestedQuestion:e.z.string(),reason:e.z.string(),suggestedModelingFix:e.z.string()}).passthrough()).optional(),assumptions:e.z.array(e.z.string()).optional(),validation:m.optional()}).passthrough().superRefine((s,o)=>{const t=G(s);for(const i of t.issues)o.addIssue({code:e.z.ZodIssueCode.custom,message:i})}),ao=new Set(Object.keys(E));function lo(){return Object.keys(E)}function qe(s){return ao.has(s)}function uo(s){if(!s||typeof s!="object"||Array.isArray(s))throw new Error("Semaphor analyze result must be an object.");const t=Object.keys(s).filter(i=>!qe(i));if(t.length)throw new Error(`Semaphor analyze result contains unsupported top-level field(s): ${t.join(", ")}.`);return _e.parse(s)}exports.SEMAPHOR_ANALYZE_RESULT_FIELD_CONTRACT=E;exports.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION=C;exports.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION=Ne;exports.getSemaphorAnalyzeResultFieldNames=lo;exports.isSemaphorAnalyzeResultFieldName=qe;exports.isSemaphorDataAppCodegenSummary=Ue;exports.mergeSemaphorSourcesByIdentity=xe;exports.parseSemaphorAnalyzeResult=uo;exports.preferSemaphorFieldRefMetadata=Fe;exports.preferSemaphorSourceMetadata=U;exports.semaphorAnalyticsCoverageSchema=X;exports.semaphorAnalyticsDiagnosticFeedbackSchema=Z;exports.semaphorAnalyticsExecutionResultSchema=Ae;exports.semaphorAnalyticsPopulationSchema=J;exports.semaphorAnalyticsResultSchema=ke;exports.semaphorAnalyticsValidationIssueSchema=x;exports.semaphorAnalyticsValidationResultSchema=W;exports.semaphorAnalyzeResultSchema=_e;exports.semaphorAnalyzeResultShape=Re;exports.semaphorDataAppCodegenSummarySchema=ro;exports.semaphorDerivedFieldDefinitionSchema=Y;exports.semaphorExecutionFieldRefSchema=D;exports.semaphorFieldRefSchema=y;exports.semaphorFieldRefsMatch=Ee;exports.semaphorInputOptionsResultSchema=ve;exports.semaphorMatrixResultSchema=we;exports.semaphorMetricMeasureBindingKey=ae;exports.semaphorMetricResultSchema=be;exports.semaphorPhysicalSourceRefSchema=fe;exports.semaphorRecordsResultSchema=Se;exports.semaphorRelationshipDiagnosticsSchema=Ie;exports.semaphorResultColumnSchema=q;exports.semaphorSemanticSourceRefSchema=Q;exports.semaphorSourceIdentityKey=j;exports.semaphorSourceRefSchema=b;exports.semaphorSourcesReferToSameDataset=L;exports.semaphorSqlResultSchema=$e;exports.semaphorSqlSourceRefSchema=ye;exports.validateSemaphorDataAppCodegenSummary=G;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as r, jsxs as s, Fragment as X } from "react/jsx-runtime";
|
|
2
2
|
import ee, { useState as h, useCallback as F, useEffect as ae, useMemo as H } from "react";
|
|
3
|
-
import { u as re, b as te, c as se, d as ne, e as le, f as oe, R as W, g as O, C as ie, h as ce, i as de, j as ue, k as me, l as _, m as R, n as fe, o as he, p as N } from "./index-
|
|
4
|
-
import { c as S, L as G, P as pe, a as ge, B as j, b as ve, d as V, e as be } from "./switch-
|
|
3
|
+
import { u as re, b as te, c as se, d as ne, e as le, f as oe, R as W, g as O, C as ie, h as ce, i as de, j as ue, k as me, l as _, m as R, n as fe, o as he, p as N } from "./index-C56DuHI8.js";
|
|
4
|
+
import { c as S, L as G, P as pe, a as ge, B as j, b as ve, d as V, e as be } from "./switch-Dsx-IwBE.js";
|
|
5
5
|
import "./x-CXDkqdur.js";
|
|
6
|
-
import "./analyze-result-contract-
|
|
6
|
+
import "./analyze-result-contract-Akysi2ML.js";
|
|
7
7
|
function we(n = {}) {
|
|
8
8
|
var C, A, E, L;
|
|
9
9
|
const { authToken: c, tokenProps: e } = re(), p = n.enabled ?? !0, d = (c == null ? void 0 : c.accessToken) ?? null, u = (e == null ? void 0 : e.apiServiceUrl) ?? null, [I, k] = h(!1), [y, b] = h(!1), [m, g] = h(!1), [T, o] = h(null), [v, w] = h(null), P = v || {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),l=require("react"),t=require("./index-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),l=require("react"),t=require("./index-C8thRvkW.js"),o=require("./switch-BXuyni6l.js");require("./x-B6ghREd2.js");require("./analyze-result-contract-COjyJzYm.js");function G(n={}){var y,P,z,A;const{authToken:d,tokenProps:a}=t.useSemaphorContext(),x=n.enabled??!0,m=(d==null?void 0:d.accessToken)??null,f=(a==null?void 0:a.apiServiceUrl)??null,[L,C]=l.useState(!1),[j,b]=l.useState(!1),[h,g]=l.useState(!1),[N,c]=l.useState(null),[v,S]=l.useState(null),k=v||{tz:((P=(y=a==null?void 0:a.params)==null?void 0:y.calendarContext)==null?void 0:P.tz)||null,weekStart:((A=(z=a==null?void 0:a.params)==null?void 0:z.calendarContext)==null?void 0:A.weekStart)??null},p=l.useCallback(async()=>{if(!(!x||!m||!f)){C(!0),c(null);try{const i=await fetch(`${f}/v1/user-preferences/calendar`,{method:"GET",headers:{Authorization:`Bearer ${m}`}});if(!i.ok){const u=await i.json().catch(()=>({}));throw new Error(u.error||"Failed to fetch preferences")}const r=await i.json();S({tz:r.tz,weekStart:r.weekStart,source:r.source,isInherited:r.isInherited,userHasPrefs:r.userHasPrefs,inherited:r.inherited})}catch(i){const r=i instanceof Error?i.message:"Unknown error";c(r)}finally{C(!1)}}},[m,f,x]);l.useEffect(()=>{x&&p()},[x,p]);const T=l.useCallback(async i=>{if(!m||!f)return c("Not authenticated"),!1;b(!0),c(null);try{const r=await fetch(`${f}/v1/user-preferences/calendar`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${m}`},body:JSON.stringify(i)});if(!r.ok){const u=await r.json().catch(()=>({}));throw new Error(u.error||"Failed to update preferences")}return await p(),!0}catch(r){const u=r instanceof Error?r.message:"Unknown error";return c(u),!1}finally{b(!1)}},[m,f,p]),w=l.useCallback(async()=>{if(!m||!f)return c("Not authenticated"),!1;g(!0),c(null);try{const i=await fetch(`${f}/v1/user-preferences/calendar`,{method:"DELETE",headers:{Authorization:`Bearer ${m}`}});if(!i.ok){const u=await i.json().catch(()=>({}));throw new Error(u.error||"Failed to clear preferences")}const r=await i.text();if(r)try{const u=JSON.parse(r);return S({tz:u.tz,weekStart:u.weekStart,source:u.source,isInherited:u.isInherited??!0,userHasPrefs:!1,inherited:u.inherited}),!0}catch{}return await p(),!0}catch(i){const r=i instanceof Error?i.message:"Unknown error";return c(r),!1}finally{g(!1)}},[m,f,p]);return{preferences:k,isLoading:L,isSaving:j,isClearing:h,error:N,updatePreferences:T,clearPreferences:w,refetch:p}}const E=[{value:"America/New_York",label:"Eastern Time (US & Canada)"},{value:"America/Chicago",label:"Central Time (US & Canada)"},{value:"America/Denver",label:"Mountain Time (US & Canada)"},{value:"America/Los_Angeles",label:"Pacific Time (US & Canada)"},{value:"America/Phoenix",label:"Arizona"},{value:"America/Anchorage",label:"Alaska"},{value:"Pacific/Honolulu",label:"Hawaii"},{value:"Europe/London",label:"London"},{value:"Europe/Paris",label:"Paris, Berlin, Rome"},{value:"Asia/Tokyo",label:"Tokyo"},{value:"Asia/Shanghai",label:"Beijing, Shanghai"},{value:"Asia/Kolkata",label:"Mumbai, New Delhi"},{value:"Australia/Sydney",label:"Sydney"},{value:"UTC",label:"UTC"}],M=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:6,label:"Saturday"}],H="text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";function W(){try{const n=Intl;if(n.supportedValuesOf)return n.supportedValuesOf("timeZone")}catch{}return E.map(n=>n.value)}function _(n){switch(n){case"tenant":return"tenant";case"organization":return"organization";case"system":return"system";default:return"default"}}function O(n){const d=E.find(a=>a.value===n);return d?d.label:n}function q(n){const d=M.find(a=>a.value===n);return d?d.label:String(n)}function V({open:n,onOpenChange:d}){var D,U,F;const{preferences:a,isLoading:x,isSaving:m,isClearing:f,updatePreferences:L,clearPreferences:C}=G({enabled:n}),j=a.tz||((D=a.inherited)==null?void 0:D.tz)||Intl.DateTimeFormat().resolvedOptions().timeZone,b=a.weekStart??((U=a.inherited)==null?void 0:U.weekStart)??1,[h,g]=l.useState(!a.userHasPrefs),[N,c]=l.useState(!1),[v,S]=l.useState(j),[k,p]=l.useState(b),[T,w]=l.useState(!1),y=l.useMemo(()=>W(),[]),P=l.useMemo(()=>y.filter(s=>!E.some(R=>R.value===s)),[y]),z=l.useMemo(()=>O(v),[v]),A=a.inherited?O(a.inherited.tz):"UTC",i=a.inherited?q(a.inherited.weekStart):"Monday",r=_((F=a.inherited)==null?void 0:F.source);l.useEffect(()=>{if(!n){c(!1);return}N||(a.userHasPrefs!==void 0&&g(!a.userHasPrefs),S(j),p(b))},[n,N,a.userHasPrefs,j,b]);const u=async()=>{if(x){t.ue.error("Preferences are still loading. Please try again.");return}h?await C()?(t.ue.success("Now using default settings. Please refresh the page to apply changes.",{duration:5e3}),d(!1)):t.ue.error("Failed to save preferences. Please try again."):await L({tz:v,weekStart:k})?(t.ue.success("Preferences saved. Please refresh the page to apply changes.",{duration:5e3}),d(!1)):t.ue.error("Failed to save preferences. Please try again.")},$=()=>{d(!1)},I=m||f,B=I||x;return e.jsx(t.Dialog,{open:n,onOpenChange:d,children:e.jsxs(t.DialogContent,{className:"rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control",children:[e.jsxs(t.DialogHeader,{children:[e.jsx(t.DialogTitle,{className:"text-[15px]",children:"Calendar preferences"}),e.jsx(t.DialogDescription,{className:"text-[13px] leading-5",children:"Set your timezone and week-start for date calculations and displays."})]}),e.jsxs("div",{className:"space-y-4 py-1",children:[e.jsxs(t.RadioGroup,{value:h?"defaults":"custom",onValueChange:s=>{c(!0),g(s==="defaults")},className:"space-y-0.5",children:[e.jsxs("label",{htmlFor:"mode-defaults",className:o.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",h&&"bg-muted/50"),onClick:()=>{c(!0),g(!0)},children:[e.jsx(t.RadioGroupItem,{value:"defaults",id:"mode-defaults",className:"mt-0.5"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-[13px] font-medium text-foreground",children:["Use ",r," defaults"]}),e.jsxs("p",{className:"text-[12px] text-muted-foreground",children:[A,", week starts ",i]})]})]}),e.jsxs("label",{htmlFor:"mode-custom",className:o.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",!h&&"bg-muted/50"),onClick:()=>{c(!0),g(!1)},children:[e.jsx(t.RadioGroupItem,{value:"custom",id:"mode-custom",className:"mt-0.5"}),e.jsx("p",{className:"flex-1 text-[13px] font-medium text-foreground",children:"Use custom settings"})]})]}),e.jsxs("div",{className:o.cn("space-y-4 border-t border-border/60 pt-4 transition-opacity",h&&"pointer-events-none opacity-50"),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(o.Label,{className:H,children:"Timezone"}),e.jsxs(o.Popover,{open:T,onOpenChange:w,modal:!0,children:[e.jsx(o.PopoverTrigger,{asChild:!0,children:e.jsxs(o.Button,{variant:"outline",size:"xs",role:"combobox","aria-expanded":T,className:"w-full justify-between text-[12px] font-normal",disabled:h,children:[e.jsx("span",{className:"truncate",children:z}),e.jsx(t.ChevronsUpDown,{className:"ml-2 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),e.jsx(o.PopoverContent,{className:"z-50 w-[--radix-popover-trigger-width] p-0",align:"start",children:e.jsxs(t.Command,{className:"overflow-visible",children:[e.jsx(t.CommandInput,{placeholder:"Search timezones…"}),e.jsxs(t.CommandList,{children:[e.jsx(t.CommandEmpty,{children:"No timezone found."}),e.jsx(t.CommandGroup,{heading:"Common",children:E.map(s=>e.jsxs(t.CommandItem,{value:`${s.value} ${s.label}`,onSelect:()=>{c(!0),S(s.value),w(!1)},children:[e.jsx(o.Check,{className:o.cn("h-3.5 w-3.5",v===s.value?"opacity-100":"opacity-0")}),e.jsx("span",{className:"flex-1",children:s.label}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:s.value})]},s.value))}),e.jsx(t.CommandSeparator,{}),e.jsx(t.CommandGroup,{heading:"All timezones",children:P.map(s=>e.jsxs(t.CommandItem,{value:s,onSelect:()=>{c(!0),S(s),w(!1)},children:[e.jsx(o.Check,{className:o.cn("h-3.5 w-3.5",v===s?"opacity-100":"opacity-0")}),s]},s))})]})]})})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(o.Label,{className:H,children:"Week starts on"}),e.jsx(t.RadioGroup,{value:String(k),onValueChange:s=>{c(!0),p(Number(s))},className:"flex gap-4",disabled:h,children:M.map(s=>e.jsxs("label",{htmlFor:`week-start-${s.value}`,className:o.cn("flex cursor-pointer items-center gap-2 text-[13px]",h&&"cursor-not-allowed"),children:[e.jsx(t.RadioGroupItem,{value:String(s.value),id:`week-start-${s.value}`,disabled:h}),s.label]},s.value))})]})]})]}),e.jsxs(t.DialogFooter,{children:[e.jsx(o.Button,{variant:"outline",size:"xs",onClick:$,disabled:I,children:"Cancel"}),e.jsx(o.Button,{size:"xs",onClick:u,disabled:B,children:I?e.jsxs(e.Fragment,{children:[e.jsx(o.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save"})]})]})})}exports.CalendarPreferencesDialog=V;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),h=require("react"),i=require("./index-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),h=require("react"),i=require("./index-C8thRvkW.js"),o=require("./switch-BXuyni6l.js"),ss=require("./layout-grid-C0OI-MRn.js"),K=require("./x-B6ghREd2.js"),me=require("./use-create-flow-overlay-state-BDv_VpL6.js");require("./analyze-result-contract-COjyJzYm.js");const Ae=require("./search-DNCejM7Z.js"),Gs=require("./date-formatter-B4EBSe9C.js");require("./index-DRlMUglg.js");require("react-dom");/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as t, jsxs as s, Fragment as le } from "react/jsx-runtime";
|
|
2
2
|
import bo, { useState as S, useEffect as fe, useMemo as O, useContext as xo, useRef as Me, useCallback as ye } from "react";
|
|
3
|
-
import { b as rt, c as at, e as st, aF as ka, bs as yo, bO as vo, bP as No, ar as Rt, bC as Sa, aW as gt, J as wo, A as Co, bQ as ko, ah as Jt, ak as Qt, al as Xt, am as Yt, an as Zt, ao as en, ap as tn, aq as Yn, aV as nn, p as be, bR as So, bS as Do, bT as In, bD as rn, bE as an, bU as Zn, bF as sn, bG as De, av as Eo, b8 as jt, bV as Da, br as $n, d as bt, f as xt, bW as Ao, o as Ea, aE as Io, aT as Aa, bX as To, aU as _n, y as Lo, ae as Fo, ax as Ro, u as Pt, a0 as mt, ab as er, a7 as Ia, a8 as tr, a1 as Ta, a6 as Po, ad as Bo, bJ as Mo, bY as Vo, b4 as Oo, a9 as qr, x as zt, a3 as Uo, bZ as $o, b_ as _o, b$ as jo, c0 as zo, c1 as Ko, c2 as qo, c3 as Ho, c4 as Go, c5 as La, c6 as Wo, c7 as Jo, c8 as Qo, c9 as Xo, ca as Yo, ay as yt, cb as Zo, bH as Fa, cc as ei, cd as ti, ce as ni, cf as ri, cg as ai, ch as si, ci as oi, cj as Ra, ck as ii, cl as li, cm as Pa, cn as Ba, co as Ma, cp as di, cq as ci, be as Va, bp as ui, bm as mi, cr as hi, aw as Oa, cs as pi, ct as fi, cu as gi, cv as bi, cw as jn, cx as xi, cy as yi, cz as Ua, cA as nr, cB as vi, cC as Ni, cD as $a, cE as wi, cF as Ci, cG as ki, cH as _a, as as Si, cI as Di, cJ as Ei, cK as Ai, cL as Ii, cM as Ti, cN as Li, cO as Fi } from "./index-
|
|
4
|
-
import { B as Z, L as Lt, Z as zn, e as se, N as ja, d as je, c as v, M as za, E as vt, u as Q, A as Nt, aF as Hr, a6 as Ka, F as qa, S as rr, P as $e, a as ot, b as it, aG as Ri, aH as Pi, aD as Ha, aI as Ga, _ as Ye, $ as Ze, a0 as et, a1 as tt, a2 as xe, aJ as Wa, aK as Ja, X as nt, T as Bi, G as Mi, H as Gr, aL as Vi } from "./switch-
|
|
3
|
+
import { b as rt, c as at, e as st, aF as ka, bs as yo, bO as vo, bP as No, ar as Rt, bC as Sa, aW as gt, J as wo, A as Co, bQ as ko, ah as Jt, ak as Qt, al as Xt, am as Yt, an as Zt, ao as en, ap as tn, aq as Yn, aV as nn, p as be, bR as So, bS as Do, bT as In, bD as rn, bE as an, bU as Zn, bF as sn, bG as De, av as Eo, b8 as jt, bV as Da, br as $n, d as bt, f as xt, bW as Ao, o as Ea, aE as Io, aT as Aa, bX as To, aU as _n, y as Lo, ae as Fo, ax as Ro, u as Pt, a0 as mt, ab as er, a7 as Ia, a8 as tr, a1 as Ta, a6 as Po, ad as Bo, bJ as Mo, bY as Vo, b4 as Oo, a9 as qr, x as zt, a3 as Uo, bZ as $o, b_ as _o, b$ as jo, c0 as zo, c1 as Ko, c2 as qo, c3 as Ho, c4 as Go, c5 as La, c6 as Wo, c7 as Jo, c8 as Qo, c9 as Xo, ca as Yo, ay as yt, cb as Zo, bH as Fa, cc as ei, cd as ti, ce as ni, cf as ri, cg as ai, ch as si, ci as oi, cj as Ra, ck as ii, cl as li, cm as Pa, cn as Ba, co as Ma, cp as di, cq as ci, be as Va, bp as ui, bm as mi, cr as hi, aw as Oa, cs as pi, ct as fi, cu as gi, cv as bi, cw as jn, cx as xi, cy as yi, cz as Ua, cA as nr, cB as vi, cC as Ni, cD as $a, cE as wi, cF as Ci, cG as ki, cH as _a, as as Si, cI as Di, cJ as Ei, cK as Ai, cL as Ii, cM as Ti, cN as Li, cO as Fi } from "./index-C56DuHI8.js";
|
|
4
|
+
import { B as Z, L as Lt, Z as zn, e as se, N as ja, d as je, c as v, M as za, E as vt, u as Q, A as Nt, aF as Hr, a6 as Ka, F as qa, S as rr, P as $e, a as ot, b as it, aG as Ri, aH as Pi, aD as Ha, aI as Ga, _ as Ye, $ as Ze, a0 as et, a1 as tt, a2 as xe, aJ as Wa, aK as Ja, X as nt, T as Bi, G as Mi, H as Gr, aL as Vi } from "./switch-Dsx-IwBE.js";
|
|
5
5
|
import { L as ar } from "./layout-grid-CiubineE.js";
|
|
6
6
|
import { c as Pe, X as Ae, C as Ge } from "./x-CXDkqdur.js";
|
|
7
|
-
import { u as sr, V as Oi, E as Wr, a as Jr, b as Ui, c as $i, L as _i, d as ji, e as Qa, C as Xa, f as zi, R as Ki, S as qi } from "./use-create-flow-overlay-state-
|
|
8
|
-
import "./analyze-result-contract-
|
|
7
|
+
import { u as sr, V as Oi, E as Wr, a as Jr, b as Ui, c as $i, L as _i, d as ji, e as Qa, C as Xa, f as zi, R as Ki, S as qi } from "./use-create-flow-overlay-state-CzftV84t.js";
|
|
8
|
+
import "./analyze-result-contract-Akysi2ML.js";
|
|
9
9
|
import { S as Hi, M as Gi, a as Bt, C as Kn } from "./search-BHsQIWBV.js";
|
|
10
10
|
import { l as Qr } from "./date-formatter-BlhBftA9.js";
|
|
11
11
|
import "./index-CJdxSyQq.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("./switch-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("./switch-BXuyni6l.js"),s=require("./index-C8thRvkW.js"),R=require("./x-B6ghREd2.js");require("./analyze-result-contract-COjyJzYm.js");const v=require("react");require("./index-DRlMUglg.js");const ss=require("react-dom"),P=require("./dashboard-briefing-launcher-B4OWNsVD.js"),ft=require("./search-DNCejM7Z.js"),gt=require("./index-D7KJindZ.js"),rs=require("./calendar-preferences-dialog-CInkkhl_.js"),ns=require("./use-debounced-dirty-check-XHSwAefL.js"),Ue=require("./normalize-dashboard-for-dirty-check-BXRUMVb2.js"),lt=require("./save-C__QggEE.js"),as=require("./palette-C4KTXOug.js"),os=require("./braces-D2tStQjF.js");function is(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(a,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return a.default=t,Object.freeze(a)}const L=is(v);/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as e, jsxs as o, Fragment as R } from "react/jsx-runtime";
|
|
2
|
-
import { u as D, B as O, av as dt, A as Wt, L as jr, Z as Kr, c as he, aw as Qr, ax as Wr, ay as rt, az as fe, aA as ct, aB as Jt, e as Ge, aC as Yt, aD as Jr, E as _t, Q as Yr, V as Xr, W as Zr, Y as en, i as tn, aE as rn } from "./switch-
|
|
3
|
-
import { b5 as nn, u as G, b as Xt, b6 as an, ar as j, c as Zt, d as sn, e as nt, f as at, o as on, b7 as pe, b8 as $e, b9 as dn, ba as Rt, bb as er, bc as tr, bd as cn, be as lt, bf as ln, bg as un, bh as mn, bi as pn, bj as hn, bk as fn, aC as ge, bl as be, p as E, bm as gn, bn as rr, aW as ut, bo as bn, bp as xn, bq as nr, br as ar, bs as vn, bt as yn, bu as wn, z as Nn, y as Te, K as Sn, A as Xe, bv as Dn, bw as Cn, bx as kn, $ as En, by as Ln, I as Ut, bz as An, bA as In, bB as Mn, bC as Pn, bD as Tt, bE as Ft, bF as $t, bG as T, bH as On, bI as _n, bJ as Rn, av as Gt, bK as Un, bL as Tn, bM as Fn, J as $n, bN as Gn, ah as Bn, ak as zn, al as qn, am as Hn, an as Vn, ao as jn, ap as Kn, aq as Bt, w as st } from "./index-
|
|
2
|
+
import { u as D, B as O, av as dt, A as Wt, L as jr, Z as Kr, c as he, aw as Qr, ax as Wr, ay as rt, az as fe, aA as ct, aB as Jt, e as Ge, aC as Yt, aD as Jr, E as _t, Q as Yr, V as Xr, W as Zr, Y as en, i as tn, aE as rn } from "./switch-Dsx-IwBE.js";
|
|
3
|
+
import { b5 as nn, u as G, b as Xt, b6 as an, ar as j, c as Zt, d as sn, e as nt, f as at, o as on, b7 as pe, b8 as $e, b9 as dn, ba as Rt, bb as er, bc as tr, bd as cn, be as lt, bf as ln, bg as un, bh as mn, bi as pn, bj as hn, bk as fn, aC as ge, bl as be, p as E, bm as gn, bn as rr, aW as ut, bo as bn, bp as xn, bq as nr, br as ar, bs as vn, bt as yn, bu as wn, z as Nn, y as Te, K as Sn, A as Xe, bv as Dn, bw as Cn, bx as kn, $ as En, by as Ln, I as Ut, bz as An, bA as In, bB as Mn, bC as Pn, bD as Tt, bE as Ft, bF as $t, bG as T, bH as On, bI as _n, bJ as Rn, av as Gt, bK as Un, bL as Tn, bM as Fn, J as $n, bN as Gn, ah as Bn, ak as zn, al as qn, am as Hn, an as Vn, ao as jn, ap as Kn, aq as Bt, w as st } from "./index-C56DuHI8.js";
|
|
4
4
|
import { c as Q, X as sr, C as Qn } from "./x-CXDkqdur.js";
|
|
5
|
-
import "./analyze-result-contract-
|
|
5
|
+
import "./analyze-result-contract-Akysi2ML.js";
|
|
6
6
|
import * as I from "react";
|
|
7
7
|
import or, { useState as w, useMemo as K, useEffect as Be, useRef as zt, useLayoutEffect as Wn, useCallback as Jn } from "react";
|
|
8
8
|
import "./index-CJdxSyQq.js";
|
|
9
9
|
import { createPortal as Yn } from "react-dom";
|
|
10
|
-
import { O as Xn, c as Zn, u as ea, A as ta, a as ra, M as na, f as aa, V as sa, P as oa, N as ia, U as da } from "./dashboard-briefing-launcher-
|
|
10
|
+
import { O as Xn, c as Zn, u as ea, A as ta, a as ra, M as na, f as aa, V as sa, P as oa, N as ia, U as da } from "./dashboard-briefing-launcher-D7FNuDuc.js";
|
|
11
11
|
import { S as ca, C as la } from "./search-BHsQIWBV.js";
|
|
12
12
|
import { d as ir } from "./index-CjzRe2su.js";
|
|
13
|
-
import { C as ua } from "./calendar-preferences-dialog-
|
|
13
|
+
import { C as ua } from "./calendar-preferences-dialog-BbuLgela.js";
|
|
14
14
|
import { u as ma } from "./use-debounced-dirty-check-BwAbnX_5.js";
|
|
15
15
|
import { s as Ze } from "./normalize-dashboard-for-dirty-check-5KpZN8xr.js";
|
|
16
16
|
import { S as qt } from "./save-DgMfP0j8.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as d, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as m, useState as f, useRef as b, useEffect as p } from "react";
|
|
3
3
|
import { X as S } from "./x-CXDkqdur.js";
|
|
4
|
-
import { u as o, c as N, B as D, C as J } from "./switch-
|
|
5
|
-
import "./analyze-result-contract-
|
|
6
|
-
import "./index-
|
|
4
|
+
import { u as o, c as N, B as D, C as J } from "./switch-Dsx-IwBE.js";
|
|
5
|
+
import "./analyze-result-contract-Akysi2ML.js";
|
|
6
|
+
import "./index-C56DuHI8.js";
|
|
7
7
|
import "./index-CJdxSyQq.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
function j() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),o=require("react"),b=require("./x-B6ghREd2.js"),s=require("./switch-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),o=require("react"),b=require("./x-B6ghREd2.js"),s=require("./switch-BXuyni6l.js");require("./analyze-result-contract-COjyJzYm.js");require("./index-C8thRvkW.js");require("./index-DRlMUglg.js");require("react-dom");function S(){const t=s.useDashboardStore(e=>e.dashboard),c=s.useDashboardStore(e=>e.actions.setDashboard),u=s.useDashboardStore(e=>e.showDashboardJSON),h=s.useDashboardStore(e=>e.actions.setShowDashboardJSON),r=o.useMemo(()=>t?JSON.stringify(t,null,2):"",[t]),[l,i]=o.useState(r),n=o.useRef(r);return o.useEffect(()=>{r!==n.current&&(i(r),n.current=r)},[r]),a.jsxs("div",{className:s.cn("relative p-2",{hidden:!u}),children:[a.jsxs(s.Button,{variant:"secondary",size:"sm",className:"absolute right-2 top-2 z-10 h-8",onClick:()=>h(!1),children:[a.jsx(b.X,{className:"mr-2 h-4 w-4"}),"Close"]}),a.jsx("div",{className:"h-[550px] overflow-hidden",children:a.jsx(s.CodeEditor,{value:l,onValueChange:e=>{i(e);try{const d=JSON.parse(e);n.current=JSON.stringify(d,null,2),c(d)}catch{}},language:"json"})})]})}exports.default=S;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),v=require("react"),n=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),v=require("react"),n=require("./index-C8thRvkW.js"),re=require("./x-B6ghREd2.js"),t=require("./switch-BXuyni6l.js");require("./analyze-result-contract-COjyJzYm.js");const ze=require("./search-DNCejM7Z.js"),Ne=require("./use-create-flow-overlay-state-BDv_VpL6.js"),Ua=require("react-dom");require("./index-DRlMUglg.js");const Ga=require("./palette-C4KTXOug.js"),Ha=require("./common-types-C73-Ud1-.js");function Qa(s){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const r in s)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(a,r,o.get?o:{enumerable:!0,get:()=>s[r]})}}return a.default=s,Object.freeze(a)}const Wa=Qa(v);/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as e, jsxs as a, Fragment as De } from "react/jsx-runtime";
|
|
2
2
|
import * as Sc from "react";
|
|
3
3
|
import ea, { useState as K, useEffect as Se, useRef as Me, useCallback as Ee, useMemo as de, useContext as wr, Suspense as Tc } from "react";
|
|
4
|
-
import { cP as Ei, b as Aa, c as Oa, d as Ma, e as Fa, f as Ya, o as hs, aQ as kt, aV as wt, cQ as Ai, cR as is, p as Ze, cS as Oi, cC as os, ay as In, ar as vt, bH as Sr, aw as nn, aW as qn, aR as Nt, cT as ps, cG as Tr, cU as kc, cV as Mi, cW as Dc, aC as Ns, cX as Ic, cY as Ec, cZ as mr, c_ as cs, u as xa, z as Fi, c$ as Ac, d0 as Oc, d1 as Ri, d2 as Li, d3 as Mc, d4 as Fc, d5 as Rc, aK as Va, aL as ba, aM as ya, aN as jn, aO as ta, aP as Qa, d6 as hr, bz as Sn, d7 as Pi, af as na, ag as ft, d8 as Lc, d9 as Vi, c5 as ma, cH as Bi, da as kr, db as _i, dc as Pc, dd as Vc, de as Bc, C as zi, df as _c, dg as zc, dh as $c, di as qc, dj as jc, dk as Kc, dl as zs, dm as Uc, dn as zl, dp as Gc, dq as $l, dr as Hc, ds as Wc, bD as sn, bE as rn, bF as ln, bG as ct, dt as En, az as $i, du as Qc, a_ as Qt, b0 as Jt, dv as Dr, be as Ir, ae as Er, dw as Jc, dx as Yc, dy as Ar, dz as Xc, dA as qi, dB as ji, dC as Ki, dD as Ht, dE as Zc, dF as ed, dG as td, dH as ad, dI as Ui, dJ as Gi, X as Hi, dK as Wi, dL as nd, dM as sd, dN as rd, dO as An, M as ld, dP as id, dQ as od, dR as ql, dS as cd, E as Cs, t as Or, dT as dd, dU as Mr, b6 as ud, dV as jl, I as gt, dW as md, dX as hd, dY as Qi, dZ as Ji, d_ as pd, d$ as Fr, e0 as Rr, e1 as Yi, e2 as Xi, e3 as Kl, e4 as Kn, e5 as fd, e6 as gd, e7 as xd, e8 as bd, e9 as yd, ea as fs, eb as vd, ec as Nd, ed as Zi, ee as eo, ef as Cd, eg as wd, bR as Sd, eh as Td, ei as to, ej as kd, ek as Dd, bS as ws, el as Ss, b7 as On, b8 as Wt, em as oa, en as Ra, eo as La, ep as ha, eq as Xa, er as Id, es as Ed, et as Ad, eu as Od, ev as Md, ew as Fd, ex as Rd, ey as Ld, ez as Ul, a$ as aa, eA as Pd, eB as Vd, eC as Bd, eD as _d, eE as ao, eF as zd, eG as $d, eH as qd, eI as jd, eJ as Kd, eK as pr, eL as Ud, eM as Gd, eN as fr, eO as Hd, eP as Wd, eQ as Qd, eR as Jd, eS as Gl, ax as gr, at as pa, ah as Yd, ai as Xd, ak as Zd, al as eu, am as tu, an as au, ao as nu, ap as su, aq as ru, bs as lu, eT as iu, eU as Za, eV as en, eW as tn, bI as Lr, bJ as ou, av as cu, eX as du, eY as uu, eZ as mu, e_ as Ts, e$ as st, f0 as rt, f1 as lt, cE as hu, cF as pu, f2 as no, f3 as so, cD as fu, f4 as gu, f5 as xu, f6 as bu, f7 as yu, f8 as vu, f9 as Nu, fa as Cu, fb as wu, fc as Su, fd as Tu, fe as ku, ff as Du, fg as Ta, fh as vn, fi as Ja, fj as Iu, fk as Hl, fl as Eu, fm as Au, fn as $s, fo as Wl, fp as Ou, fq as Mu, fr as Fu, fs as Ru, ft as Lu, R as Pr, g as Mn, fu as qs, fv as ro, aA as Pu, fw as gs, fx as Vu, fy as lo, fz as Bu, fA as io, co as _u, fB as zu, a4 as $u, fC as ns, fD as qu, fE as Ql, fF as ju, fG as Ku, fH as Jl, fI as Uu, fJ as Gu, fK as Hu, fL as Wu, fM as Qu, aj as oo, fN as Ju, fO as Yu, fP as Xu, fQ as Zu, fR as em, fS as tm, fT as am, fU as nm, fV as sm, fW as co, fX as rm, fY as ks, c6 as Ds, fZ as uo, f_ as lm, f$ as im, g0 as mo, g1 as om, g2 as cm, g3 as Is, g4 as js, g5 as dm, g6 as um, g7 as mm, g8 as hm, g9 as pm, ga as Yl, gb as an, gc as ho, gd as fm, bU as gm, ge as po, gf as fo, gg as ds, gh as go, gi as xo, gj as Xl, gk as xm, gl as bm, gm as us, gn as ym, go as Vr, gp as vm, gq as xs, h as Fn, i as Rn, k as Ln, j as Pn, l as Vn, m as Bn, gr as Nm, gs as _n, gt as ca, gu as xr, gv as br, gw as zn, gx as bo, gy as Cm, gz as Ks, gA as Us, gB as wm, gC as Gs, gD as Sm, gE as Zl, gF as ei, cJ as Tm, gG as km, cK as Dm, cM as Im, cN as Em, y as Am, gH as Om, gI as Mm, gJ as Fm, bK as Rm, bL as Lm, bM as Pm, br as Es, cA as As, gK as ti, gL as yo, cc as Hs, gM as Vm, gN as Bm, gO as _m, F as zm, aT as $m, gP as qm, gQ as jm, aU as Km } from "./index-
|
|
4
|
+
import { cP as Ei, b as Aa, c as Oa, d as Ma, e as Fa, f as Ya, o as hs, aQ as kt, aV as wt, cQ as Ai, cR as is, p as Ze, cS as Oi, cC as os, ay as In, ar as vt, bH as Sr, aw as nn, aW as qn, aR as Nt, cT as ps, cG as Tr, cU as kc, cV as Mi, cW as Dc, aC as Ns, cX as Ic, cY as Ec, cZ as mr, c_ as cs, u as xa, z as Fi, c$ as Ac, d0 as Oc, d1 as Ri, d2 as Li, d3 as Mc, d4 as Fc, d5 as Rc, aK as Va, aL as ba, aM as ya, aN as jn, aO as ta, aP as Qa, d6 as hr, bz as Sn, d7 as Pi, af as na, ag as ft, d8 as Lc, d9 as Vi, c5 as ma, cH as Bi, da as kr, db as _i, dc as Pc, dd as Vc, de as Bc, C as zi, df as _c, dg as zc, dh as $c, di as qc, dj as jc, dk as Kc, dl as zs, dm as Uc, dn as zl, dp as Gc, dq as $l, dr as Hc, ds as Wc, bD as sn, bE as rn, bF as ln, bG as ct, dt as En, az as $i, du as Qc, a_ as Qt, b0 as Jt, dv as Dr, be as Ir, ae as Er, dw as Jc, dx as Yc, dy as Ar, dz as Xc, dA as qi, dB as ji, dC as Ki, dD as Ht, dE as Zc, dF as ed, dG as td, dH as ad, dI as Ui, dJ as Gi, X as Hi, dK as Wi, dL as nd, dM as sd, dN as rd, dO as An, M as ld, dP as id, dQ as od, dR as ql, dS as cd, E as Cs, t as Or, dT as dd, dU as Mr, b6 as ud, dV as jl, I as gt, dW as md, dX as hd, dY as Qi, dZ as Ji, d_ as pd, d$ as Fr, e0 as Rr, e1 as Yi, e2 as Xi, e3 as Kl, e4 as Kn, e5 as fd, e6 as gd, e7 as xd, e8 as bd, e9 as yd, ea as fs, eb as vd, ec as Nd, ed as Zi, ee as eo, ef as Cd, eg as wd, bR as Sd, eh as Td, ei as to, ej as kd, ek as Dd, bS as ws, el as Ss, b7 as On, b8 as Wt, em as oa, en as Ra, eo as La, ep as ha, eq as Xa, er as Id, es as Ed, et as Ad, eu as Od, ev as Md, ew as Fd, ex as Rd, ey as Ld, ez as Ul, a$ as aa, eA as Pd, eB as Vd, eC as Bd, eD as _d, eE as ao, eF as zd, eG as $d, eH as qd, eI as jd, eJ as Kd, eK as pr, eL as Ud, eM as Gd, eN as fr, eO as Hd, eP as Wd, eQ as Qd, eR as Jd, eS as Gl, ax as gr, at as pa, ah as Yd, ai as Xd, ak as Zd, al as eu, am as tu, an as au, ao as nu, ap as su, aq as ru, bs as lu, eT as iu, eU as Za, eV as en, eW as tn, bI as Lr, bJ as ou, av as cu, eX as du, eY as uu, eZ as mu, e_ as Ts, e$ as st, f0 as rt, f1 as lt, cE as hu, cF as pu, f2 as no, f3 as so, cD as fu, f4 as gu, f5 as xu, f6 as bu, f7 as yu, f8 as vu, f9 as Nu, fa as Cu, fb as wu, fc as Su, fd as Tu, fe as ku, ff as Du, fg as Ta, fh as vn, fi as Ja, fj as Iu, fk as Hl, fl as Eu, fm as Au, fn as $s, fo as Wl, fp as Ou, fq as Mu, fr as Fu, fs as Ru, ft as Lu, R as Pr, g as Mn, fu as qs, fv as ro, aA as Pu, fw as gs, fx as Vu, fy as lo, fz as Bu, fA as io, co as _u, fB as zu, a4 as $u, fC as ns, fD as qu, fE as Ql, fF as ju, fG as Ku, fH as Jl, fI as Uu, fJ as Gu, fK as Hu, fL as Wu, fM as Qu, aj as oo, fN as Ju, fO as Yu, fP as Xu, fQ as Zu, fR as em, fS as tm, fT as am, fU as nm, fV as sm, fW as co, fX as rm, fY as ks, c6 as Ds, fZ as uo, f_ as lm, f$ as im, g0 as mo, g1 as om, g2 as cm, g3 as Is, g4 as js, g5 as dm, g6 as um, g7 as mm, g8 as hm, g9 as pm, ga as Yl, gb as an, gc as ho, gd as fm, bU as gm, ge as po, gf as fo, gg as ds, gh as go, gi as xo, gj as Xl, gk as xm, gl as bm, gm as us, gn as ym, go as Vr, gp as vm, gq as xs, h as Fn, i as Rn, k as Ln, j as Pn, l as Vn, m as Bn, gr as Nm, gs as _n, gt as ca, gu as xr, gv as br, gw as zn, gx as bo, gy as Cm, gz as Ks, gA as Us, gB as wm, gC as Gs, gD as Sm, gE as Zl, gF as ei, cJ as Tm, gG as km, cK as Dm, cM as Im, cN as Em, y as Am, gH as Om, gI as Mm, gJ as Fm, bK as Rm, bL as Lm, bM as Pm, br as Es, cA as As, gK as ti, gL as yo, cc as Hs, gM as Vm, gN as Bm, gO as _m, F as zm, aT as $m, gP as qm, gQ as jm, aU as Km } from "./index-C56DuHI8.js";
|
|
5
5
|
import { c as $e, C as At, X as et } from "./x-CXDkqdur.js";
|
|
6
|
-
import { F as Ne, B as Z, O as bs, I as Un, c as J, aM as Um, L as $, _ as ae, $ as ne, a0 as se, a1 as re, a2 as j, E as O, Y as Dt, Q as Vt, V as It, W as Et, P as Ot, a as Rt, b as Mt, C as fa, aN as Gm, aE as Tn, aO as Br, aP as vo, aB as _r, az as Hm, Z as Fe, aQ as Wm, e as ga, u as Ie, d as va, aR as zr, aS as Gn, X as Xt, A as No, T as Hn, G as Wn, H as Yt, J as Ia, N as Os, S as Pa, h as Qm, aF as Ea, aT as Jm, aU as Ym, aV as Co, ae as Xm, aH as Zm, aW as eh, aX as th, aY as ai, aZ as ah, a_ as nh, a$ as sh, b0 as rh, aL as lh, b1 as ih, b2 as ni, b3 as oh, b4 as si, R as yr, b5 as on, b6 as ch, a3 as Je, b7 as dh, b8 as $r, b9 as $n, ba as ys, bb as da, bc as ss, bd as ri, be as uh, bf as Pt, bg as mh, M as wo, bh as nt, bi as So, s as li, bj as hh, bk as ph, bl as fh, bm as gh, bn as xh, bo as bh, bp as yh, bq as vh, br as Nh, bs as Ch, bt as wh, bu as Sh, bv as ii, bw as Th, bx as kh, by as Dh, K as Ms } from "./switch-
|
|
7
|
-
import "./analyze-result-contract-
|
|
6
|
+
import { F as Ne, B as Z, O as bs, I as Un, c as J, aM as Um, L as $, _ as ae, $ as ne, a0 as se, a1 as re, a2 as j, E as O, Y as Dt, Q as Vt, V as It, W as Et, P as Ot, a as Rt, b as Mt, C as fa, aN as Gm, aE as Tn, aO as Br, aP as vo, aB as _r, az as Hm, Z as Fe, aQ as Wm, e as ga, u as Ie, d as va, aR as zr, aS as Gn, X as Xt, A as No, T as Hn, G as Wn, H as Yt, J as Ia, N as Os, S as Pa, h as Qm, aF as Ea, aT as Jm, aU as Ym, aV as Co, ae as Xm, aH as Zm, aW as eh, aX as th, aY as ai, aZ as ah, a_ as nh, a$ as sh, b0 as rh, aL as lh, b1 as ih, b2 as ni, b3 as oh, b4 as si, R as yr, b5 as on, b6 as ch, a3 as Je, b7 as dh, b8 as $r, b9 as $n, ba as ys, bb as da, bc as ss, bd as ri, be as uh, bf as Pt, bg as mh, M as wo, bh as nt, bi as So, s as li, bj as hh, bk as ph, bl as fh, bm as gh, bn as xh, bo as bh, bp as yh, bq as vh, br as Nh, bs as Ch, bt as wh, bu as Sh, bv as ii, bw as Th, bx as kh, by as Dh, K as Ms } from "./switch-Dsx-IwBE.js";
|
|
7
|
+
import "./analyze-result-contract-Akysi2ML.js";
|
|
8
8
|
import { C as $t, E as vr, S as Fs, M as Ih, a as Eh } from "./search-BHsQIWBV.js";
|
|
9
|
-
import { f as Ah, g as xt, r as To, h as Qn, S as Oh, i as ko, V as Do, e as Mh, C as Fh, R as Rs } from "./use-create-flow-overlay-state-
|
|
9
|
+
import { f as Ah, g as xt, r as To, h as Qn, S as Oh, i as ko, V as Do, e as Mh, C as Fh, R as Rs } from "./use-create-flow-overlay-state-CzftV84t.js";
|
|
10
10
|
import { createPortal as Rh } from "react-dom";
|
|
11
11
|
import "./index-CJdxSyQq.js";
|
|
12
12
|
import { P as Lh } from "./palette-Cp1hqZtm.js";
|