react-semaphor 0.1.544 → 0.1.546

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/dist/analytics-protocol/index.js +405 -441
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +100 -76
  4. package/dist/brand-studio/index.js +5 -5
  5. package/dist/briefings/index.js +55 -52
  6. package/dist/chunks/{class-utils-Df1OVOT1.js → _commonjsHelpers-DimLPMtv.js} +124 -98
  7. package/dist/chunks/{add-to-dashboard-BuAqfA2Y.js → add-to-dashboard-BQRAAnc3.js} +55 -33
  8. package/dist/chunks/{analytics-base-schemas-BFAoRlkU.js → analytics-base-schemas-BKs3flFS.js} +2 -2
  9. package/dist/chunks/{assistant-chat-BNLkCDml.js → assistant-chat-BPXhulAx.js} +2792 -2562
  10. package/dist/chunks/{bookmark-state-CXw7lZ50.js → bookmark-state-C4vetoa0.js} +7 -8
  11. package/dist/chunks/column-catalog-BYnochWQ.js +3363 -0
  12. package/dist/chunks/comparison-window-caption-C2xF-eWw.js +1433 -0
  13. package/dist/chunks/{context-ClREvqCZ.js → context-BerEBuFR.js} +11 -6
  14. package/dist/chunks/custom-visual-inputs-CkJW9pBS.js +295 -0
  15. package/dist/chunks/{dashboard-g5a4DKWq.js → dashboard-C3CoKbGY.js} +1 -1
  16. package/dist/chunks/dashboard-briefing-launcher-Be4h-7My.js +3734 -0
  17. package/dist/chunks/dashboard-controls-bxPrlSyp.js +2307 -0
  18. package/dist/chunks/{dashboard-json-7qT9jmfL.js → dashboard-json-BrjxIiRt.js} +6 -6
  19. package/dist/chunks/document-dashboard-inputs-CRVHpIHp.js +3010 -0
  20. package/dist/chunks/{edit-dashboard-visual-BfJwnRIZ.js → edit-dashboard-visual-DYYYDjY6.js} +5986 -6063
  21. package/dist/chunks/{filter-value-text-CYsVYPuD.js → filter-value-text-Ddf55Ku1.js} +8 -8
  22. package/dist/chunks/global-date-filter-utils-9d6m9-FE.js +11859 -0
  23. package/dist/chunks/index-CtoK1Lgu.js +586 -0
  24. package/dist/chunks/{index-DkAyQvC6.js → index-DkQkMKa1.js} +385 -339
  25. package/dist/chunks/list-filter-DsaTbM3J.js +15 -0
  26. package/dist/chunks/matrix-analytical-definition-B9vW-osb.js +717 -0
  27. package/dist/chunks/{matrix-card-DjwWcCo8.js → matrix-card-LiMEipvq.js} +3 -3
  28. package/dist/chunks/{matrix-formatter-CxJLkztA.js → matrix-formatter-DWEeC0_c.js} +55 -55
  29. package/dist/chunks/{matrix-member-presentation-CQGdVks6.js → matrix-member-presentation-DqzG-UhQ.js} +1 -1
  30. package/dist/chunks/{matrix-operation-contract-8OIO4gob.js → matrix-operation-contract-D6vYkZK4.js} +72 -72
  31. package/dist/chunks/{metric-comparison-DEwi9uc2.js → metric-comparison-zpGw4lD6.js} +2 -2
  32. package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +119 -0
  33. package/dist/chunks/{pivot-header-presentation-DHcx1XGQ.js → pivot-header-presentation-CQnIDtUv.js} +1 -1
  34. package/dist/chunks/{pivot-result-identity-DJhXXcns.js → pivot-result-identity-C-Q1j1Wb.js} +1 -1
  35. package/dist/chunks/{pivot-result-lifecycle-DM4CyGKs.js → pivot-result-lifecycle-pwq3b7LC.js} +571 -380
  36. package/dist/chunks/{raw-temporal-contract-C51YG48G.js → raw-temporal-contract-WuXA8jBP.js} +1 -1
  37. package/dist/chunks/{raw-temporal-presentation-CLiVi90c.js → raw-temporal-presentation-CBzrDOjM.js} +8 -8
  38. package/dist/chunks/rendered-file-D8xEuVVx.js +108 -0
  39. package/dist/chunks/{report-preferences-dialog-Df7VpRVW.js → report-preferences-dialog-4QEZWe5U.js} +637 -610
  40. package/dist/chunks/{report-runtime-context-Dq8XyODK.js → report-runtime-context-hWiTCzFV.js} +2 -2
  41. package/dist/chunks/resolve-dashboard-input-context-UpK_LBpL.js +5677 -0
  42. package/dist/chunks/{saved-dashboard-context-B-mQ--nV.js → saved-dashboard-context-D_I3Lxk0.js} +184 -212
  43. package/dist/chunks/selection-filter-compiler-BKXmyLrS.js +79 -0
  44. package/dist/chunks/{selection-reducer-Dj_8xD69.js → selection-reducer-CJzkTZio.js} +15 -15
  45. package/dist/chunks/{semaphor-ready-indicator-DDAxk8us.js → semaphor-ready-indicator-4zpRHE-X.js} +56832 -59068
  46. package/dist/chunks/{shelf-drop-preview-context-BSRPwaED.js → shelf-drop-preview-context-Cfw7TRAx.js} +890 -871
  47. package/dist/chunks/{source-entity-resolution-BYn9giz3.js → source-entity-resolution-BIGRvtbG.js} +13 -13
  48. package/dist/chunks/{switch-C3jLxlG0.js → switch-CEBOR4n7.js} +47 -48
  49. package/dist/chunks/{table-export-sheet-CPfGAQ9X.js → table-export-sheet-4X9mAG3V.js} +1 -1
  50. package/dist/chunks/table-settings-CunhoDUi.js +605 -0
  51. package/dist/chunks/{temporal-bucket-D7NBrrtL.js → temporal-bucket-CQOSbv9-.js} +26 -26
  52. package/dist/chunks/{token-types-DBbZVQsm.js → token-types-BMqRmT-C.js} +1 -1
  53. package/dist/chunks/{use-create-flow-overlay-state-BxzFviM-.js → use-create-flow-overlay-state-DZBZiiD-.js} +83 -83
  54. package/dist/chunks/{validators-DMHTpf7a.js → validators-C-aOQlTB.js} +713 -658
  55. package/dist/dashboard/index.js +2 -2
  56. package/dist/dashboard-authoring/index.js +1800 -1135
  57. package/dist/data-app-sdk/index.js +6 -6
  58. package/dist/data-app-sdk-adapters/index.js +3 -3
  59. package/dist/data-app-sdk-validation/index.js +14 -14
  60. package/dist/format-utils/index.js +198 -187
  61. package/dist/index.js +359 -325
  62. package/dist/layouts/index.js +5 -242
  63. package/dist/report-runtime-context/index.js +2 -2
  64. package/dist/shared/index.js +4 -5
  65. package/dist/style.css +1 -1
  66. package/dist/surfboard/index.js +2 -2
  67. package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
  68. package/dist/types/briefings/attachments.d.ts +33 -6
  69. package/dist/types/briefings/index.d.ts +6 -5
  70. package/dist/types/components/index.d.ts +2 -0
  71. package/dist/types/components/surfboard/arrange-layout-button.d.ts +8 -0
  72. package/dist/types/components/surfboard/filter/types.d.ts +0 -14
  73. package/dist/types/components/surfboard/screen-size-preview-button.d.ts +7 -0
  74. package/dist/types/index.js +6 -6
  75. package/dist/types/lib/charts/table-chart-types.d.ts +4 -0
  76. package/dist/types/lib/charts/types.d.ts +2 -2
  77. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +68 -82
  78. package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +0 -8
  79. package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +41 -1
  80. package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +201 -0
  81. package/dist/types/lib/dashboard-inputs/prepare-loaded-dashboard.d.ts +15 -0
  82. package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +7 -2
  83. package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +1 -1
  84. package/dist/types/lib/dashboard-viewer/captured-runtime-values.d.ts +40 -0
  85. package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +16 -16
  86. package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +11 -9
  87. package/dist/types/lib/download-pdf.d.ts +75 -1
  88. package/dist/types/lib/hooks/use-date-filter.d.ts +5 -0
  89. package/dist/types/lib/hooks/use-text-filter.d.ts +5 -0
  90. package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +5 -4
  91. package/dist/types/lib/matrix-table/matrix-editor.d.ts +52 -0
  92. package/dist/types/lib/query-context/assemble-card-query.d.ts +158 -0
  93. package/dist/types/lib/query-context/build-card-query-context.d.ts +3 -3
  94. package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +15 -6
  95. package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +11 -13
  96. package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +22 -12
  97. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +69 -0
  98. package/dist/types/lib/stores/dashboard-store.d.ts +159 -56
  99. package/dist/types/lib/stores/editor-store.d.ts +0 -3
  100. package/dist/types/lib/types/common-types.d.ts +29 -6
  101. package/dist/types/lib/types/explorer-types.d.ts +10 -0
  102. package/dist/types/lib/types/semantic-types.d.ts +84 -0
  103. package/dist/types/lib/utils/build-saved-editor-card.d.ts +20 -0
  104. package/dist/types/lib/utils/card-type-change.d.ts +16 -0
  105. package/dist/types/lib/utils/field-availability-context.d.ts +25 -0
  106. package/dist/types/lib/utils/field-placement.d.ts +96 -0
  107. package/dist/types/lib/utils/field-state-calculator.d.ts +161 -0
  108. package/dist/types/lib/utils/qualified-entity-name.d.ts +2 -0
  109. package/dist/types/shared/analytics-protocol/field-provenance.d.ts +89 -0
  110. package/dist/types/shared/analytics-protocol/index.d.ts +2 -0
  111. package/dist/types/shared/analytics-protocol/query-policies.d.ts +52 -0
  112. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +1 -1
  113. package/dist/types/shared/analytics-protocol/time-window.d.ts +40 -1
  114. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +8 -12
  115. package/dist/types/shared/assistant-protocol/answer-text.d.ts +20 -0
  116. package/dist/types/shared/assistant-protocol/context.d.ts +21 -21
  117. package/dist/types/shared/assistant-protocol/index.d.ts +1 -0
  118. package/dist/types/shared/assistant-protocol/limits.d.ts +6 -1
  119. package/dist/types/shared/assistant-protocol/parts.d.ts +43 -3
  120. package/dist/types/shared/assistant-protocol/request.d.ts +14 -2
  121. package/dist/types/shared/dashboard-authoring/calculated-field-identity.d.ts +3 -0
  122. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +487 -0
  123. package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +34 -0
  124. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +7886 -0
  125. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +43 -0
  126. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +54 -0
  127. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +89 -0
  128. package/dist/types/shared/dashboard-authoring/column-catalog.d.ts +32 -0
  129. package/dist/types/shared/dashboard-authoring/contracts.d.ts +0 -55
  130. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +16 -6
  131. package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +9 -1
  132. package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +7 -0
  133. package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +118 -0
  134. package/dist/types/shared/dashboard-authoring/filter-applicability.d.ts +75 -0
  135. package/dist/types/shared/dashboard-authoring/filter-model/ad-hoc-filter-values.d.ts +10 -0
  136. package/dist/types/shared/dashboard-authoring/filter-model/filter-definitions.d.ts +29 -0
  137. package/dist/types/shared/dashboard-authoring/filter-model/filter-values.d.ts +58 -0
  138. package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +7 -0
  139. package/dist/types/shared/dashboard-authoring/filter-model/prototype-document-inputs.d.ts +15 -0
  140. package/dist/types/shared/dashboard-authoring/filter-model/read-dashboard-filter-model.d.ts +78 -0
  141. package/dist/types/shared/dashboard-authoring/filter-model/stored-dashboard.d.ts +18 -0
  142. package/dist/types/shared/dashboard-authoring/filter-model/toolbar-filter-reach.d.ts +23 -0
  143. package/dist/types/shared/dashboard-authoring/index.d.ts +20 -2
  144. package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +10 -37
  145. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +189 -0
  146. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +94 -0
  147. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +78 -0
  148. package/dist/types/shared/dashboard-authoring/validators.d.ts +1 -2
  149. package/dist/types/shared/format-utils/exporters/index.d.ts +2 -0
  150. package/dist/types/shared/format-utils/exporters/rendered-file.d.ts +106 -0
  151. package/dist/types/shared/layouts/engine/grid.d.ts +25 -0
  152. package/dist/types/shared/layouts/engine/index.d.ts +4 -0
  153. package/dist/types/shared/layouts/engine/sheet-layout.d.ts +7 -0
  154. package/dist/types/shared/layouts/engine/types.d.ts +125 -0
  155. package/dist/types/shared/layouts/index.d.ts +1 -2
  156. package/package.json +2 -2
  157. package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +0 -28
  158. package/dist/chunks/apply-dashboard-operations-Bz4n1Lq6.js +0 -2260
  159. package/dist/chunks/calendar-day-equality-BmJAWduY.js +0 -460
  160. package/dist/chunks/comparison-window-caption-BTkrN3W4.js +0 -1623
  161. package/dist/chunks/custom-visual-inputs-DUtpYZOk.js +0 -323
  162. package/dist/chunks/dashboard-briefing-launcher-DQ_8O_e2.js +0 -3725
  163. package/dist/chunks/dashboard-controls-8RyBTQUO.js +0 -2315
  164. package/dist/chunks/dashboard-filter-value-compatibility-CwQ_iSNb.js +0 -108
  165. package/dist/chunks/document-dashboard-inputs-BC6p-ESg.js +0 -8087
  166. package/dist/chunks/document-sheet-utils-Duo9uLoH.js +0 -3619
  167. package/dist/chunks/matrix-analytical-definition-C7Gb0e12.js +0 -117
  168. package/dist/chunks/normalize-dashboard-for-dirty-check-Bk3VYv_q.js +0 -67
  169. package/dist/chunks/numeric-presentation-DESvLiu9.js +0 -5227
  170. package/dist/chunks/sort-target-MT1WK1vX.js +0 -29
  171. package/dist/chunks/stable-serialize-CfqXeiBP.js +0 -6
  172. package/dist/chunks/table-settings-CLZocegs.js +0 -501
  173. package/dist/chunks/use-debounced-dirty-check-BwAbnX_5.js +0 -59
  174. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +0 -88
  175. package/dist/types/lib/dashboard-inputs/dashboard-input-scope.d.ts +0 -10
  176. package/dist/types/shared/dashboard-authoring/change-compiler.d.ts +0 -7
  177. package/dist/types/shared/dashboard-authoring/layout-compiler.d.ts +0 -2
  178. package/dist/types/shared/layouts/create-frame-layouts.d.ts +0 -27
  179. package/dist/types/shared/layouts/frame-layouts.d.ts +0 -23
@@ -1,60 +1,56 @@
1
- var G = Object.defineProperty;
2
- var Q = (e, t, r) => t in e ? G(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var k = (e, t, r) => Q(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { r as U, a as K, l as W, d as X, f as Y, i as H, b as T, c as ee, e as E, g as O, p as te, h as re, j as ae, k as ne, m as se } from "./document-dashboard-inputs-BC6p-ESg.js";
5
- import { y as oe, al as ie } from "./validators-DMHTpf7a.js";
6
- import "./matrix-operation-contract-8OIO4gob.js";
7
- import "./analytics-base-schemas-BFAoRlkU.js";
8
- import "zod";
9
- import { c as de, e as L, b as le, a as ce } from "./document-sheet-utils-Duo9uLoH.js";
10
- import { v as S } from "./table-settings-CLZocegs.js";
11
- import { f as g, A as P, c as ue, d as fe, e as w } from "./context-ClREvqCZ.js";
12
- import { a as me, T as pe, P as he, o as I, d as R, b as _ } from "./filter-value-text-CYsVYPuD.js";
13
- import { b as ge } from "./metric-comparison-DEwi9uc2.js";
14
- import { n as be, g as Ce, b as Ie } from "./numeric-presentation-DESvLiu9.js";
15
- import { i as ye } from "./custom-visual-inputs-DUtpYZOk.js";
16
- import { s as xe } from "./stable-serialize-CfqXeiBP.js";
17
- function Ve(e) {
1
+ var Z = Object.defineProperty;
2
+ var G = (e, t, r) => t in e ? Z(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var k = (e, t, r) => G(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { c as Q, e as M, r as U, l as H, b as K, p as E, a as W } from "./resolve-dashboard-input-context-UpK_LBpL.js";
5
+ import { r as X, a as Y, b as L, c as ee, d as te, g as re } from "./document-dashboard-inputs-CRVHpIHp.js";
6
+ import { w as v } from "./table-settings-CunhoDUi.js";
7
+ import { s as ae, n as ne, g as se, d as oe, a as ie, i as de, b as le } from "./global-date-filter-utils-9d6m9-FE.js";
8
+ import { f as g, A as P, c as ce, d as ue, e as D } from "./context-BerEBuFR.js";
9
+ import { a as me, T as fe, P as pe, o as I, d as O, b as _ } from "./filter-value-text-Ddf55Ku1.js";
10
+ import { v as he, ad as ge } from "./validators-C-aOQlTB.js";
11
+ import { b as be } from "./metric-comparison-zpGw4lD6.js";
12
+ import { i as Ce } from "./custom-visual-inputs-CkJW9pBS.js";
13
+ function Ie(e) {
18
14
  const t = e.qualifiedFieldName || e.name;
19
15
  return e.label && e.label !== t ? `${e.label} (field ${t})` : t;
20
16
  }
21
- function Se(e, t = {}) {
17
+ function ye(e, t = {}) {
22
18
  if (!e) return [];
23
- const r = j(e, t);
24
- return r.length === 0 ? [] : e.logicalOperator === "AND" && !e.negate ? r : [B(e, r)];
19
+ const r = R(e, t);
20
+ return r.length === 0 ? [] : e.logicalOperator === "AND" && !e.negate ? r : [j(e, r)];
25
21
  }
26
- function j(e, t) {
22
+ function R(e, t) {
27
23
  const r = e.groups.flatMap((a) => {
28
- const n = j(a, t);
24
+ const n = R(a, t);
29
25
  if (n.length === 0) return [];
30
- const s = B(a, n);
26
+ const s = j(a, n);
31
27
  return [n.length > 1 && !a.negate ? { ...s, text: `(${s.text})` } : s];
32
28
  });
33
- return [...e.conditions.map((a) => ve(a, t)), ...r];
29
+ return [...e.conditions.map((a) => xe(a, t)), ...r];
34
30
  }
35
- function B(e, t) {
31
+ function j(e, t) {
36
32
  const r = t.map((a) => a.text).join(e.logicalOperator === "OR" ? " or " : " and ");
37
33
  return {
38
34
  text: e.negate ? `not (${r})` : r,
39
35
  omittedValues: t.reduce((a, n) => a + n.omittedValues, 0)
40
36
  };
41
37
  }
42
- function ve(e, t) {
38
+ function xe(e, t) {
43
39
  const r = Array.isArray(e.value) ? e.value : [e.value];
44
40
  return me({
45
- subject: Ve(e.field),
41
+ subject: Ie(e.field),
46
42
  operator: e.operator,
47
43
  values: r,
48
- reading: $e(e),
49
- relative: oe(e.relativeMeta),
44
+ reading: Se(e),
45
+ relative: he(e.relativeMeta),
50
46
  latestValue: e.latestValue,
51
47
  shownAs: e.label
52
48
  }, t);
53
49
  }
54
- function $e(e) {
55
- return e.temporalBucket ? { kind: "bucket", bucket: e.temporalBucket } : ie(e.field.dataType) ? pe : he;
50
+ function Se(e) {
51
+ return e.temporalBucket ? { kind: "bucket", bucket: e.temporalBucket } : ge(e.field.dataType) ? fe : pe;
56
52
  }
57
- function N(e) {
53
+ function B(e) {
58
54
  if (e.kind === "target") return `a target of ${e.targetValue}`;
59
55
  const t = e.kind === "previous_period" ? e.offsetPeriods : e.offsetYears, r = e.kind === "previous_period" ? t && t > 1 ? `the period ${t} periods earlier` : "the previous period" : t && t > 1 ? `the same period ${t} years earlier` : "the same period a year earlier", a = [
60
56
  e.alignment === "weekday" ? "aligned by weekday" : void 0,
@@ -62,18 +58,18 @@ function N(e) {
62
58
  ].filter(Boolean);
63
59
  return a.length ? `${r}, ${a.join(", ")}` : r;
64
60
  }
65
- function _e(e) {
61
+ function ve(e) {
66
62
  return (e == null ? void 0 : e.kind) === "field_date" ? `the ${JSON.stringify(e.label)} filter` : "the dashboard date";
67
63
  }
68
- function qe(e, t) {
69
- const r = t.source === "explicit" ? "set on the measure" : `from the dashboard date comparison on ${_e(t.owner)}`;
70
- return `${e} is compared with ${N(t.spec)} (${r})`;
64
+ function Ve(e, t) {
65
+ const r = t.source === "explicit" ? "set on the measure" : `from the dashboard date comparison on ${ve(t.owner)}`;
66
+ return `${e} is compared with ${B(t.spec)} (${r})`;
71
67
  }
72
68
  function $(e) {
73
- const t = xe(e) ?? "undefined";
74
- return `${D(t, 2654435769).toString(16)}${D(t, 2246822507).toString(16)}`;
69
+ const t = ae(e) ?? "undefined";
70
+ return `${w(t, 2654435769).toString(16)}${w(t, 2246822507).toString(16)}`;
75
71
  }
76
- function D(e, t) {
72
+ function w(e, t) {
77
73
  let r = 3735928559 ^ t, a = 1103547991 ^ t;
78
74
  for (let n = 0; n < e.length; n++) {
79
75
  const s = e.charCodeAt(n);
@@ -82,27 +78,27 @@ function D(e, t) {
82
78
  return r = Math.imul(r ^ r >>> 16, 2246822507) ^ Math.imul(a ^ a >>> 13, 3266489909), a = Math.imul(a ^ a >>> 16, 2246822507) ^ Math.imul(r ^ r >>> 13, 3266489909), 4294967296 * (2097151 & a) + (r >>> 0);
83
79
  }
84
80
  const c = P;
85
- function ke(e, t, r) {
81
+ function $e(e, t, r) {
86
82
  var q;
87
- const a = t !== "pending" && (t == null ? void 0 : t.status) === "ready" ? t : void 0, n = we(e, t);
83
+ const a = t !== "pending" && (t == null ? void 0 : t.status) === "ready" ? t : void 0, n = _e(e, t);
88
84
  if (n) {
89
- const y = t !== "pending" && (t == null ? void 0 : t.status) === "blocked" ? De(t) : void 0, v = y ? g(y, c.textChars) : void 0;
85
+ const y = t !== "pending" && (t == null ? void 0 : t.status) === "blocked" ? qe(t) : void 0, V = y ? g(y, c.textChars) : void 0;
90
86
  return {
91
87
  // A card that runs but is not described still changes when it runs differently.
92
- fingerprint: $(a ? F(a, r.calendar) : { reason: n, message: v }),
93
- description: { status: "not_described", reason: n, ...v ? { message: v } : {} }
88
+ fingerprint: $(a ? F(a, r.calendar) : { reason: n, message: V }),
89
+ description: { status: "not_described", reason: n, ...V ? { message: V } : {} }
94
90
  };
95
91
  }
96
- const s = a, i = s.queryContext, u = Ae(s), o = Ee(s, r), m = Le(s), d = Me(s), l = i.drillSteps.map((y) => g(
92
+ const s = a, d = s.queryContext, u = De(s), o = Ae(s, r), f = Me(s), i = we(s), l = d.drillSteps.map((y) => g(
97
93
  `${JSON.stringify(y.label)} (then by ${y.toField.label || y.toField.name})`,
98
94
  c.textChars
99
- )), f = (q = s.card.sql) == null ? void 0 : q.trim(), h = f ? Pe(s) : [], b = {
95
+ )), m = (q = s.card.sql) == null ? void 0 : q.trim(), h = m ? Ee(s) : [], b = {
100
96
  fields: I(u.length, c.cardFields),
101
97
  filters: I(o.length, c.cardFilters),
102
- controls: I(m.length, c.cardControls),
98
+ controls: I(f.length, c.cardControls),
103
99
  drillSteps: I(l.length, c.drillSteps),
104
100
  sqlParameters: I(h.length, c.sqlParameters),
105
- comparisons: I(d.length, c.cardFields)
101
+ comparisons: I(i.length, c.cardFields)
106
102
  }, p = Object.fromEntries(Object.entries(b).filter(([, y]) => y > 0));
107
103
  return {
108
104
  fingerprint: $(F(s, r.calendar)),
@@ -110,88 +106,88 @@ function ke(e, t, r) {
110
106
  status: "described",
111
107
  fields: u.slice(0, c.cardFields),
112
108
  filters: o.slice(0, c.cardFilters),
113
- controls: m.slice(0, c.cardControls),
109
+ controls: f.slice(0, c.cardControls),
114
110
  drillPath: l.slice(0, c.drillSteps),
115
- ...f ? {
111
+ ...m ? {
116
112
  sql: {
117
- text: g(f, c.sqlChars),
113
+ text: g(m, c.sqlChars),
118
114
  parameters: h.slice(0, c.sqlParameters)
119
115
  }
120
116
  } : {},
121
- ...d.length ? { comparisons: d.slice(0, c.cardFields) } : {},
117
+ ...i.length ? { comparisons: i.slice(0, c.cardFields) } : {},
122
118
  ...Object.keys(p).length ? { omitted: p } : {}
123
119
  }
124
120
  };
125
121
  }
126
- function we(e, t) {
122
+ function _e(e, t) {
127
123
  if (e.type === "matrixTable") return "matrix";
128
- if (e.type === "custom" || ye(e)) return "custom_visual";
129
- if (be(e.python ?? "").trim()) return "python";
124
+ if (e.type === "custom" || Ce(e)) return "custom_visual";
125
+ if (ne(e.python ?? "").trim()) return "python";
130
126
  if (t === "pending") return "snapshot_pending";
131
127
  if ((t == null ? void 0 : t.status) !== "ready") return "snapshot_blocked";
132
128
  }
133
- function De(e) {
129
+ function qe(e) {
134
130
  if (e.message) return e.message;
135
131
  const t = e.mappingDispositions.flatMap((r) => r.status === "block" ? [`${r.inputId} (${r.reason})`] : []);
136
132
  return t.length ? `dashboard inputs that cannot apply to this card: ${t.join(", ")}` : void 0;
137
133
  }
138
134
  function F(e, t) {
139
- return de(e.card, e.queryContext, t).queryInputIdentity;
135
+ return Q(e.card, e.queryContext, t).queryInputIdentity;
140
136
  }
141
- const Fe = [
137
+ const ke = [
142
138
  ["row", "rows"],
143
139
  ["column", "columns"],
144
140
  ["measure", "metrics"],
145
141
  ["detail", "details"]
146
142
  ];
147
- function Ae(e) {
148
- const { fields: t } = Ce({
143
+ function De(e) {
144
+ const { fields: t } = se({
149
145
  type: e.card.type,
150
146
  config: e.queryContext.finalConfig
151
147
  });
152
- return Fe.flatMap(([r, a]) => t[a].map((n) => {
153
- const s = n.aggregate, i = n.granularity;
148
+ return ke.flatMap(([r, a]) => t[a].map((n) => {
149
+ const s = n.aggregate, d = n.granularity;
154
150
  return {
155
151
  role: r,
156
152
  label: g(n.label || n.name, c.labelChars),
157
153
  name: g(n.name, c.labelChars),
158
154
  ...s ? { aggregate: s } : {},
159
- ...i ? { granularity: i } : {}
155
+ ...d ? { granularity: d } : {}
160
156
  };
161
157
  }));
162
158
  }
163
- function Me(e) {
159
+ function we(e) {
164
160
  const t = e.queryContext;
165
161
  return (t.finalConfig.metricColumns ?? []).flatMap((r) => {
166
- const a = ge({
162
+ const a = be({
167
163
  metricComparison: r.comparison,
168
164
  globalDateComparison: t.globalDateComparison
169
165
  });
170
- return a ? [g(qe(Te(r.label || r.name), a), c.textChars)] : [];
166
+ return a ? [g(Ve(Fe(r.label || r.name), a), c.textChars)] : [];
171
167
  });
172
168
  }
173
- function Te(e) {
169
+ function Fe(e) {
174
170
  return JSON.stringify(e);
175
171
  }
176
- function Ee(e, { calendar: t }) {
177
- const r = e.queryContext, a = { maxListedValues: c.inputValues, timeZone: t.tz }, n = e.card.inlineFilters ?? [], s = new Set(n.map((d) => d.id)), i = new Map(
178
- [...r.queryFilterDefinitions, ...n].map((d) => [d.id, d.title])
179
- ), u = r.cardFilterValues.map((d) => {
180
- const l = i.get(d.filterId) || d.name, f = d.dateOwner === "global_date" ? `${l} (the dashboard date, on this card's field ${d.name})` : `${l} (field ${d.name})`, h = R(d, f, a);
172
+ function Ae(e, { calendar: t }) {
173
+ const r = e.queryContext, a = { maxListedValues: c.inputValues, timeZone: t.tz }, n = e.card.inlineFilters ?? [], s = new Set(n.map((i) => i.id)), d = new Map(
174
+ [...r.queryFilterDefinitions, ...n].map((i) => [i.id, i.title])
175
+ ), u = r.cardFilterValues.map((i) => {
176
+ const l = d.get(i.filterId) || i.name, m = i.dateOwner === "global_date" ? `${l} (the dashboard date, on this card's field ${i.name})` : `${l} (field ${i.name})`, h = O(i, m, a);
181
177
  return {
182
- origin: s.has(d.filterId) ? "card_input" : "dashboard_input",
178
+ origin: s.has(i.filterId) ? "card_input" : "dashboard_input",
183
179
  text: g(h.text, c.textChars),
184
180
  ...h.omittedValues ? { omittedValues: h.omittedValues } : {}
185
181
  };
186
- }), o = r.resolvedFilterParts, m = [["card", o.authored], ["drill", o.drill], ["selection", o.selections]].flatMap(([d, l]) => Se(l, a).map((f) => ({
187
- origin: d,
188
- text: g(f.text, c.textChars),
189
- ...f.omittedValues ? { omittedValues: f.omittedValues } : {}
182
+ }), o = r.resolvedFilterParts, f = [["card", o.authored], ["drill", o.drill], ["selection", o.selections]].flatMap(([i, l]) => ye(l, a).map((m) => ({
183
+ origin: i,
184
+ text: g(m.text, c.textChars),
185
+ ...m.omittedValues ? { omittedValues: m.omittedValues } : {}
190
186
  })));
191
- return [...u, ...m];
187
+ return [...u, ...f];
192
188
  }
193
- function Oe(e) {
194
- const t = e.queryContext, r = L({
189
+ function Te(e) {
190
+ const t = e.queryContext, r = M({
195
191
  sql: e.card.sql,
196
192
  controlBindings: t.controlBindings
197
193
  });
@@ -204,28 +200,28 @@ function Oe(e) {
204
200
  sqlParameterIds: r.filter((s) => s.controlId === n).map((s) => s.paramId)
205
201
  }));
206
202
  }
207
- function Le(e) {
203
+ function Me(e) {
208
204
  const t = e.queryContext, r = new Map(
209
205
  [...t.controlDefinitions, ...t.cardControlDefinitions].map((a) => [a.id, a])
210
206
  );
211
- return Oe(e).map(({ id: a, bindings: n, sqlParameterIds: s }) => {
207
+ return Te(e).map(({ id: a, bindings: n, sqlParameterIds: s }) => {
212
208
  var o;
213
- const i = t.controlValues[a], u = /* @__PURE__ */ new Set([
214
- ...n.filter((m) => m.target !== "sql_param").map((m) => Re(m, i)),
215
- ...s.map((m) => `SQL parameter ${m}`)
209
+ const d = t.controlValues[a], u = /* @__PURE__ */ new Set([
210
+ ...n.filter((f) => f.target !== "sql_param").map((f) => Le(f, d)),
211
+ ...s.map((f) => `SQL parameter ${f}`)
216
212
  ]);
217
213
  return {
218
214
  label: g(((o = r.get(a)) == null ? void 0 : o.label) || a, c.labelChars),
219
215
  valueText: g(
220
- `${_(i, { maxListedValues: c.inputValues }).text}${u.size ? `; ${[...u].join("; ")}` : ""}`,
216
+ `${_(d, { maxListedValues: c.inputValues }).text}${u.size ? `; ${[...u].join("; ")}` : ""}`,
221
217
  c.textChars
222
218
  )
223
219
  };
224
220
  });
225
221
  }
226
- function Pe(e) {
222
+ function Ee(e) {
227
223
  const t = e.queryContext;
228
- return L({ sql: e.card.sql, controlBindings: t.controlBindings }).map((r) => ({
224
+ return M({ sql: e.card.sql, controlBindings: t.controlBindings }).map((r) => ({
229
225
  name: g(r.paramId, c.labelChars),
230
226
  valueText: g(
231
227
  _(t.controlValues[r.controlId], { maxListedValues: c.inputValues }).text,
@@ -233,7 +229,7 @@ function Pe(e) {
233
229
  )
234
230
  }));
235
231
  }
236
- function Re(e, t) {
232
+ function Le(e, t) {
237
233
  const r = typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? String(t) : void 0;
238
234
  switch (e.target) {
239
235
  case "sql_param":
@@ -253,19 +249,19 @@ function Re(e, t) {
253
249
  }
254
250
  }
255
251
  }
256
- class V extends Error {
252
+ class S extends Error {
257
253
  constructor(r, a) {
258
254
  super(a);
259
255
  k(this, "code");
260
256
  this.name = "AssistantContextSourceError", this.code = r;
261
257
  }
262
258
  }
263
- const C = P, je = "Untitled";
264
- function Be(e) {
259
+ const C = P, Pe = "Untitled";
260
+ function Oe(e) {
265
261
  var b;
266
262
  if (e.surface === "none")
267
263
  return A({
268
- version: w,
264
+ version: D,
269
265
  surface: "none",
270
266
  otherSheets: [],
271
267
  activeInputs: [],
@@ -274,20 +270,20 @@ function Be(e) {
274
270
  });
275
271
  const { dashboard: t, sheetId: r, calendar: a } = e, n = t.sheets ?? [], s = n.find((p) => p.id === r);
276
272
  if (r !== null && !s)
277
- throw new V("sheet_not_found", `sheet ${r} is not on dashboard ${t.id}`);
278
- const i = n.filter((p) => p.id !== r), u = s ? S(t).filter((p) => p.sheetId === r) : [], o = u.slice(0, C.summaryCards), m = e.selectedCard ? u.find((p) => p.cardId === e.selectedCard.cardId) : void 0, d = ((b = e.selectedCard) == null ? void 0 : b.card) ?? (m == null ? void 0 : m.card);
279
- if (e.selectedCard && !d)
280
- throw new V(
273
+ throw new S("sheet_not_found", `sheet ${r} is not on dashboard ${t.id}`);
274
+ const d = n.filter((p) => p.id !== r), u = s ? v(t).filter((p) => p.sheetId === r) : [], o = u.slice(0, C.summaryCards), f = e.selectedCard ? u.find((p) => p.cardId === e.selectedCard.cardId) : void 0, i = ((b = e.selectedCard) == null ? void 0 : b.card) ?? (f == null ? void 0 : f.card);
275
+ if (e.selectedCard && !i)
276
+ throw new S(
281
277
  "card_not_on_sheet",
282
278
  `card ${e.selectedCard.cardId} is not on sheet ${r}`
283
279
  );
284
- const l = s ? Je(e, s, u) : [], f = {
285
- otherSheets: I(i.length, C.otherSheets),
280
+ const l = s ? Be(e, s, u) : [], m = {
281
+ otherSheets: I(d.length, C.otherSheets),
286
282
  activeInputs: I(l.length, C.activeInputs),
287
283
  cards: I(u.length, C.summaryCards)
288
- }, h = Object.fromEntries(Object.entries(f).filter(([, p]) => p > 0));
284
+ }, h = Object.fromEntries(Object.entries(m).filter(([, p]) => p > 0));
289
285
  return A({
290
- version: w,
286
+ version: D,
291
287
  surface: e.editing ? "editor" : "dashboard",
292
288
  dashboard: {
293
289
  id: t.id,
@@ -295,28 +291,28 @@ function Be(e) {
295
291
  unsavedEdits: e.unsavedEdits
296
292
  },
297
293
  ...s ? { sheet: { id: s.id, title: x(s.title) } } : {},
298
- otherSheets: i.slice(0, C.otherSheets).map((p) => ({ id: p.id, title: x(p.title) })),
294
+ otherSheets: d.slice(0, C.otherSheets).map((p) => ({ id: p.id, title: x(p.title) })),
299
295
  activeInputs: l.slice(0, C.activeInputs),
300
- cards: o.map((p) => z(p.card)),
301
- ...d && e.selectedCard ? { selectedCard: Ne(d, e.selectedCard.snapshot, a) } : {},
296
+ cards: o.map((p) => N(p.card)),
297
+ ...i && e.selectedCard ? { selectedCard: Re(i, e.selectedCard.snapshot, a) } : {},
302
298
  ...e.editing ? { editing: e.editing } : {},
303
299
  ...Object.keys(h).length ? { omitted: h } : {},
304
300
  timeZone: a.tz
305
301
  });
306
302
  }
307
- function Ne(e, t, r) {
308
- return { ...z(e), ...ke(e, t, { calendar: r }) };
303
+ function Re(e, t, r) {
304
+ return { ...N(e), ...$e(e, t, { calendar: r }) };
309
305
  }
310
306
  function A(e) {
311
- const t = ue(e);
312
- if (t > C.contextBytes) throw new fe(t);
307
+ const t = ce(e);
308
+ if (t > C.contextBytes) throw new ue(t);
313
309
  return e;
314
310
  }
315
311
  function x(e) {
316
- return g((e == null ? void 0 : e.trim()) || je, C.labelChars);
312
+ return g((e == null ? void 0 : e.trim()) || Pe, C.labelChars);
317
313
  }
318
- function z(e) {
319
- const t = ze(e);
314
+ function N(e) {
315
+ const t = je(e);
320
316
  return {
321
317
  id: e.id,
322
318
  title: x(e.title),
@@ -324,9 +320,9 @@ function z(e) {
324
320
  ...t ? { source: t } : {}
325
321
  };
326
322
  }
327
- function ze(e) {
323
+ function je(e) {
328
324
  var r;
329
- const t = Ie(e);
325
+ const t = le(e);
330
326
  if (t.kind === "config")
331
327
  return t.executableSources.length === 1 ? t.executableSources[0] : void 0;
332
328
  if (t.kind === "sql") {
@@ -334,37 +330,37 @@ function ze(e) {
334
330
  return a ? { kind: "sql", connectionId: a } : void 0;
335
331
  }
336
332
  }
337
- function Je(e, t, r) {
338
- const { dashboard: a } = e, n = t.kind === "document" ? "document" : "dashboard", s = n === "document" ? void 0 : e.transientContexts, { shouldApplyDashboardFilters: i } = U(s), u = (l, f) => K({
333
+ function Be(e, t, r) {
334
+ const { dashboard: a } = e, n = t.kind === "document" ? "document" : "dashboard", s = n === "document" ? void 0 : e.transientContexts, { shouldApplyDashboardFilters: d } = X(s), u = (l, m) => U({
339
335
  dashboard: a,
340
336
  sheetId: t.id,
341
337
  card: l,
342
- sectionId: f,
338
+ sectionId: m,
343
339
  runtimeValues: e.runtimeValues,
344
340
  transientContexts: s,
345
341
  calendar: e.calendar
346
- }), o = /* @__PURE__ */ new Map(), m = (l) => {
347
- l.inputs.forEach((f, h) => {
348
- if (M(f)) return;
349
- const b = l.resolvedInputs[h], p = o.get(f.id) ?? { input: f };
350
- !p.resolved && b && Ze(b) && (p.resolved = b), o.set(f.id, p);
342
+ }), o = /* @__PURE__ */ new Map(), f = (l) => {
343
+ l.inputs.forEach((m, h) => {
344
+ if (T(m)) return;
345
+ const b = l.resolvedInputs[h], p = o.get(m.id) ?? { input: m };
346
+ !p.resolved && b && Ne(b) && (p.resolved = b), o.set(m.id, p);
351
347
  });
352
348
  };
353
- m(u(null));
354
- let d = W(a).filter((l) => {
355
- var f;
356
- return !M(l) && !((f = o.get(l.id)) != null && f.resolved);
349
+ f(u(null));
350
+ let i = H(a).filter((l) => {
351
+ var m;
352
+ return !T(l) && !((m = o.get(l.id)) != null && m.resolved);
357
353
  });
358
354
  for (const l of r) {
359
- if (d.length === 0) break;
360
- const f = l.kind === "documentSectionCard" ? l.sectionId : void 0, h = { sheetId: t.id, sheetKind: n, cardId: l.cardId, sectionId: f };
361
- if (d.some((b) => X(b, h))) {
355
+ if (i.length === 0) break;
356
+ const m = l.kind === "documentSectionCard" ? l.sectionId : void 0, h = { sheetId: t.id, sheetKind: n, cardId: l.cardId, sectionId: m };
357
+ if (i.some((b) => oe(b, h))) {
362
358
  try {
363
- m(u(l.card, f));
359
+ f(u(l.card, m));
364
360
  } catch {
365
361
  continue;
366
362
  }
367
- d = d.filter((b) => {
363
+ i = i.filter((b) => {
368
364
  var p;
369
365
  return !((p = o.get(b.id)) != null && p.resolved);
370
366
  });
@@ -372,40 +368,40 @@ function Je(e, t, r) {
372
368
  }
373
369
  return [...o.values()].flatMap((l) => {
374
370
  if (!l.resolved) return [];
375
- const f = l.input.kind === "filter" && !i && !Y(l.input), h = Ge(l, e.calendar.tz, f);
371
+ const m = l.input.kind === "filter" && !d && !ie(l.input), h = ze(l, e.calendar.tz, m);
376
372
  return h ? [h] : [];
377
373
  });
378
374
  }
379
- function M(e) {
375
+ function T(e) {
380
376
  var r;
381
377
  const t = (r = e.compatibility) == null ? void 0 : r.source;
382
378
  return t === "cardInlineFilter" || t === "cardControl";
383
379
  }
384
- function Ze(e) {
380
+ function Ne(e) {
385
381
  if (e.kind === "filter") return !!e.filterValue;
386
382
  const t = e.controlValue;
387
383
  return t == null ? !1 : typeof t == "string" ? t.trim().length > 0 : Array.isArray(t) ? t.length > 0 : !0;
388
384
  }
389
- function Ge(e, t, r) {
390
- const { input: a, resolved: n } = e, s = x(a.label), i = {
385
+ function ze(e, t, r) {
386
+ const { input: a, resolved: n } = e, s = x(a.label), d = {
391
387
  inputId: a.id,
392
388
  label: s,
393
- ...a.kind === "filter" && H(a.filter) ? { globalDate: !0 } : {}
389
+ ...a.kind === "filter" && de(a.filter) ? { globalDate: !0 } : {}
394
390
  };
395
391
  if (a.runtimeScope === "perCard" || a.runtimeScope === "perDocumentSection")
396
- return { ...i, value: { kind: "varies" } };
392
+ return { ...d, value: { kind: "varies" } };
397
393
  const u = { maxListedValues: C.inputValues, timeZone: t };
398
394
  let o;
399
395
  if ((n == null ? void 0 : n.kind) === "filter" && n.filterValue)
400
- o = R(n.filterValue, s, u);
396
+ o = O(n.filterValue, s, u);
401
397
  else if ((n == null ? void 0 : n.kind) === "control") {
402
- const d = _(n.controlValue, u);
403
- o = { text: `${s} is set to ${d.text}`, omittedValues: d.omittedValues };
398
+ const i = _(n.controlValue, u);
399
+ o = { text: `${s} is set to ${i.text}`, omittedValues: i.omittedValues };
404
400
  }
405
401
  if (!o) return;
406
- const m = (n == null ? void 0 : n.kind) === "filter" ? n.comparisonSelection : void 0;
407
- return (m == null ? void 0 : m.mode) === "period" && (o = { ...o, text: `${o.text}; compared with ${N(m.spec)}` }), {
408
- ...i,
402
+ const f = (n == null ? void 0 : n.kind) === "filter" ? n.comparisonSelection : void 0;
403
+ return (f == null ? void 0 : f.mode) === "period" && (o = { ...o, text: `${o.text}; compared with ${B(f.spec)}` }), {
404
+ ...d,
409
405
  value: {
410
406
  kind: "set",
411
407
  text: g(o.text, C.textChars),
@@ -419,42 +415,39 @@ function Ge(e, t, r) {
419
415
  }
420
416
  };
421
417
  }
422
- function ft(e) {
423
- return Qe(e).context;
418
+ function nt(e) {
419
+ return Je(e).context;
424
420
  }
425
- function Qe(e) {
426
- const { place: t, calendar: r } = e, a = T(e.dashboard), n = E({ dashboard: a, host: {}, calendar: r, materializeInputs: !1 }), s = {
427
- ...O(
428
- a,
429
- { filterValues: n.filterValues, controlOverrides: n.controlOverrides, dashboardInputValues: {} },
430
- r
431
- ),
421
+ function Je(e) {
422
+ const { place: t, calendar: r } = e, a = E(e.dashboard), n = ee({ dashboard: a, host: {}, calendar: r, materializeInputs: !1 }), s = {
423
+ ...L({ dashboard: a, capture: {}, calendar: r }).runtimeValues,
432
424
  cardViewState: t.cardViewState ?? {}
433
- }, i = t.cardId ? Ke(a, t.cardId) : void 0, u = i ? J({
425
+ }, d = t.cardId ? Ge(a, t.cardId) : void 0, u = d ? z({
434
426
  dashboard: a,
435
- location: i,
427
+ location: d,
436
428
  runtimeValues: s,
437
429
  semanticExecutionPayload: e.semanticExecutionPayload,
438
430
  calendar: r,
439
431
  withRequest: !0
440
- }) : void 0, o = Be({
432
+ }) : void 0, o = Oe({
441
433
  surface: "dashboard",
442
434
  dashboard: a,
443
435
  // A sheet that does not hold the card is refused by the projection.
444
- sheetId: t.sheetId ?? (i == null ? void 0 : i.sheetId) ?? n.selectedSheetId,
436
+ sheetId: t.sheetId ?? (d == null ? void 0 : d.sheetId) ?? n.selectedSheetId,
445
437
  unsavedEdits: !1,
446
438
  runtimeValues: s,
447
439
  transientContexts: void 0,
448
- ...i && u !== void 0 ? { selectedCard: { cardId: i.cardId, snapshot: u } } : {},
440
+ ...d && u !== void 0 ? { selectedCard: { cardId: d.cardId, snapshot: u } } : {},
449
441
  calendar: r
450
442
  });
451
443
  return {
452
444
  context: o,
453
- ...o.selectedCard && u !== void 0 ? { cardReplay: Ue({ dashboard: a, cardId: o.selectedCard.id, snapshot: u }) } : {}
445
+ openDashboard: a,
446
+ ...o.selectedCard && u !== void 0 ? { cardReplay: Ze({ dashboard: a, cardId: o.selectedCard.id, snapshot: u }) } : {}
454
447
  };
455
448
  }
456
- function Ue(e) {
457
- const t = e.dashboard ? S(e.dashboard).find((a) => a.cardId === e.cardId) : void 0, r = Z({
449
+ function Ze(e) {
450
+ const t = e.dashboard ? v(e.dashboard).find((a) => a.cardId === e.cardId) : void 0, r = J({
458
451
  card: e.card ?? (t == null ? void 0 : t.card),
459
452
  snapshot: e.snapshot,
460
453
  documentSection: (t == null ? void 0 : t.kind) === "documentSectionCard"
@@ -467,15 +460,15 @@ function Ue(e) {
467
460
  }
468
461
  };
469
462
  }
470
- function Ke(e, t) {
471
- const r = S(e).find((a) => a.cardId === t);
463
+ function Ge(e, t) {
464
+ const r = v(e).find((a) => a.cardId === t);
472
465
  if (!r)
473
- throw new V("card_not_found", `card ${t} is not on dashboard ${e.id}`);
466
+ throw new S("card_not_found", `card ${t} is not on dashboard ${e.id}`);
474
467
  return r;
475
468
  }
476
- function J(e) {
477
- const { dashboard: t, location: r, runtimeValues: a } = e, n = r.kind === "documentSectionCard" ? Xe(t, r) : void 0;
478
- return ne({
469
+ function z(e) {
470
+ const { dashboard: t, location: r, runtimeValues: a } = e, n = r.kind === "documentSectionCard" ? Qe(t, r) : void 0;
471
+ return te({
479
472
  dashboard: t,
480
473
  cardId: r.cardId,
481
474
  cardOverride: r.card,
@@ -483,7 +476,7 @@ function J(e) {
483
476
  transientContexts: e.transientContexts,
484
477
  cardViewStates: a.cardViewState,
485
478
  viewerTableSettings: void 0,
486
- filterValues: a.filterValues,
479
+ adHocFilterValues: a.adHocFilterValues,
487
480
  inlineFilterValuesMap: a.inlineFilterValuesMap,
488
481
  dashboardControlValues: a.controlValues,
489
482
  cardControlValuesMap: a.cardControlValuesMap,
@@ -494,7 +487,7 @@ function J(e) {
494
487
  ...e.withRequest ? { withRequest: !0 } : {}
495
488
  });
496
489
  }
497
- function Z(e) {
490
+ function J(e) {
498
491
  var r;
499
492
  const { snapshot: t } = e;
500
493
  if (e.documentSection) return { status: "unavailable", reason: "document_section" };
@@ -509,68 +502,47 @@ function Z(e) {
509
502
  if (t.matrix) return { status: "unavailable", reason: "matrix" };
510
503
  if (!t.request) return { status: "unavailable", reason: "no_query" };
511
504
  try {
512
- const { connectionId: a, requestPayloadBase: n } = le(t.card, t.request);
505
+ const { connectionId: a, requestPayloadBase: n } = K(t.card, t.request);
513
506
  return { status: "ready", request: { cardId: t.card.id, connectionId: a, payload: n } };
514
507
  } catch {
515
508
  return { status: "unavailable", reason: "no_query" };
516
509
  }
517
510
  }
518
- function We(e, t, r) {
519
- const a = E({
520
- dashboard: e,
521
- host: { filterValues: t.filterValues, controlValues: t.controlValues },
522
- calendar: r,
523
- materializeInputs: !1
524
- }), n = t.dashboardInputExecutionSnapshot, s = {
525
- ...O(
526
- e,
527
- {
528
- filterValues: a.filterValues,
529
- controlOverrides: a.controlOverrides,
530
- dashboardInputValues: n ? re({
531
- dashboard: e,
532
- dashboardInputValues: n.dashboardInputValues,
533
- sheetId: n.sheetId,
534
- cardId: n.cardId
535
- }) : {}
536
- },
537
- r
538
- ),
539
- cardViewState: n ? te(n.cardViewState) : {}
540
- }, i = n ? ae(n.transientContexts) : void 0;
541
- return { runtimeValues: s, ...i != null && i.length ? { transientContexts: i } : {} };
542
- }
543
- function mt(e) {
544
- const { calendar: t } = e, r = e.host ?? {}, a = T(
545
- r.controlContract ? ee(ce(e.dashboard), {
511
+ function st(e) {
512
+ const { calendar: t } = e, r = e.host ?? {}, a = E(
513
+ r.controlContract ? Y(W(e.dashboard), {
546
514
  controlContractOverrides: r.controlContract,
547
515
  cardId: e.cardId
548
516
  }) : e.dashboard
549
- ), n = S(a).find((m) => m.cardId === e.cardId);
517
+ ), n = v(a).find((f) => f.cardId === e.cardId);
550
518
  if (!n) return { status: "refused", reason: "card_not_found" };
551
519
  if (n.kind === "documentSectionCard") return { status: "refused", reason: "document_section" };
552
- const { runtimeValues: s, transientContexts: i } = We(a, r, t), u = J({
520
+ const { runtimeValues: s, transientContexts: d } = L({
521
+ dashboard: a,
522
+ capture: r,
523
+ calendar: t
524
+ }), u = z({
553
525
  dashboard: a,
554
526
  location: n,
555
527
  runtimeValues: s,
556
528
  semanticExecutionPayload: e.semanticExecutionPayload,
557
529
  calendar: t,
558
- transientContexts: i,
530
+ transientContexts: d,
559
531
  withRequest: !0
560
532
  });
561
533
  if (!u) return { status: "refused", reason: "card_not_found" };
562
- const o = Z({ card: n.card, snapshot: u, documentSection: !1 });
534
+ const o = J({ card: n.card, snapshot: u, documentSection: !1 });
563
535
  return o.status === "ready" ? o : o.reason === "pending" ? { status: "refused", reason: "blocked" } : {
564
536
  status: "refused",
565
537
  reason: o.reason,
566
538
  ...o.message ? { message: o.message } : {}
567
539
  };
568
540
  }
569
- function Xe(e, t) {
541
+ function Qe(e, t) {
570
542
  var a, n, s;
571
- const r = (a = e.sheets) == null ? void 0 : a.find((i) => i.id === t.sheetId);
572
- if ((s = (n = r == null ? void 0 : r.document) == null ? void 0 : n.inputs) != null && s.length && se(e, t.sheetId).length === 0)
573
- throw new V(
543
+ const r = (a = e.sheets) == null ? void 0 : a.find((d) => d.id === t.sheetId);
544
+ if ((s = (n = r == null ? void 0 : r.document) == null ? void 0 : n.inputs) != null && s.length && re(e, t.sheetId).length === 0)
545
+ throw new S(
574
546
  "document_inputs_not_built",
575
547
  `card ${t.cardId} runs with the document's own inputs on sheet ${t.sheetId}, which only the page builds`
576
548
  );
@@ -583,11 +555,11 @@ function Xe(e, t) {
583
555
  };
584
556
  }
585
557
  export {
586
- V as A,
587
- Ue as a,
588
- mt as b,
589
- Z as c,
590
- ft as d,
591
- Qe as e,
592
- Be as p
558
+ S as A,
559
+ Ze as a,
560
+ st as b,
561
+ J as c,
562
+ nt as d,
563
+ Je as e,
564
+ Oe as p
593
565
  };