react-semaphor 0.1.545 → 0.1.547

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 (159) hide show
  1. package/dist/analytics-protocol/index.js +408 -442
  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 +4 -4
  5. package/dist/briefings/index.js +6 -6
  6. package/dist/chunks/{add-to-dashboard-BuAqfA2Y.js → add-to-dashboard-BQRAAnc3.js} +55 -33
  7. package/dist/chunks/{analytics-base-schemas-BFAoRlkU.js → analytics-base-schemas-BKs3flFS.js} +2 -2
  8. package/dist/chunks/applied-constraints-DU-wndZ7.js +47 -0
  9. package/dist/chunks/{assistant-chat-D7sWTypJ.js → assistant-chat-CK84cPAB.js} +2826 -2595
  10. package/dist/chunks/{bookmark-state-CXw7lZ50.js → bookmark-state-Cu-a5ie_.js} +8 -15
  11. package/dist/chunks/comparison-window-caption-C2xF-eWw.js +1433 -0
  12. package/dist/chunks/{context-ClREvqCZ.js → context-BerEBuFR.js} +11 -6
  13. package/dist/chunks/custom-visual-inputs-ChL54gGm.js +295 -0
  14. package/dist/chunks/{dashboard-B1tMju0u.js → dashboard-DCk26-6i.js} +1 -1
  15. package/dist/chunks/{dashboard-briefing-launcher-CePgIu0Z.js → dashboard-briefing-launcher-CQ1eYsGy.js} +1291 -1277
  16. package/dist/chunks/dashboard-controls-BMeZjF7r.js +2307 -0
  17. package/dist/chunks/{dashboard-json-CoYRPqxx.js → dashboard-json-BZqCoanC.js} +5 -5
  18. package/dist/chunks/{document-dashboard-inputs-BesAHZvB.js → document-dashboard-inputs-tYd7ao0o.js} +877 -979
  19. package/dist/chunks/{edit-dashboard-visual-JPtNfJRb.js → edit-dashboard-visual-Bv3MHM_G.js} +2157 -2243
  20. package/dist/chunks/filter-reach-copy-CGWsL_ez.js +3480 -0
  21. package/dist/chunks/{filter-value-text-ff7osJr7.js → filter-value-text-Ddf55Ku1.js} +9 -9
  22. package/dist/chunks/global-date-filter-utils-BhAu8zIM.js +12137 -0
  23. package/dist/chunks/index-CtoK1Lgu.js +586 -0
  24. package/dist/chunks/{index-DRWiuqyd.js → index-DmrLP5Ro.js} +105 -104
  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-DnCyRXJE.js → matrix-formatter-DWEeC0_c.js} +44 -44
  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-C3mUgnEx.js → raw-temporal-presentation-DypB7sMX.js} +8 -8
  38. package/dist/chunks/{report-preferences-dialog-DUtuUL_5.js → report-preferences-dialog-DoVyriYC.js} +154 -155
  39. package/dist/chunks/{report-runtime-context-Dq8XyODK.js → report-runtime-context-hWiTCzFV.js} +2 -2
  40. package/dist/chunks/resolve-dashboard-input-context-D0JDUa4h.js +5576 -0
  41. package/dist/chunks/{saved-dashboard-context-LrF_kW0l.js → saved-dashboard-context-BfAH5j4L.js} +34 -34
  42. package/dist/chunks/{selection-reducer-Dj_8xD69.js → selection-reducer-CJzkTZio.js} +15 -15
  43. package/dist/chunks/{semaphor-ready-indicator-BxF96Yhv.js → semaphor-ready-indicator-CRm17oIP.js} +51771 -52574
  44. package/dist/chunks/{shelf-drop-preview-context-CNaM_Gmh.js → shelf-drop-preview-context-vy6P9THz.js} +7 -7
  45. package/dist/chunks/{source-entity-resolution-BYn9giz3.js → source-entity-resolution-BIGRvtbG.js} +13 -13
  46. package/dist/chunks/{switch-uDtPgQlQ.js → switch-CEBOR4n7.js} +3 -3
  47. package/dist/chunks/{table-export-sheet-YzMioA7Y.js → table-export-sheet-4X9mAG3V.js} +1 -1
  48. package/dist/chunks/table-settings-WysCBj62.js +614 -0
  49. package/dist/chunks/{temporal-bucket-D7NBrrtL.js → temporal-bucket-CQOSbv9-.js} +26 -26
  50. package/dist/chunks/{token-types-DBbZVQsm.js → token-types-BMqRmT-C.js} +1 -1
  51. package/dist/chunks/{use-create-flow-overlay-state-CjB7ig1o.js → use-create-flow-overlay-state-Csx_Xjsh.js} +101 -101
  52. package/dist/chunks/{validators-DMHTpf7a.js → validators-C-aOQlTB.js} +713 -658
  53. package/dist/chunks/{relative-date-label-Bk2j94pA.js → zoned-wall-clock-MulfA26h.js} +64 -21
  54. package/dist/dashboard/index.js +2 -2
  55. package/dist/dashboard-authoring/index.js +1895 -1163
  56. package/dist/data-app-sdk/index.js +6 -6
  57. package/dist/data-app-sdk-adapters/index.js +3 -3
  58. package/dist/data-app-sdk-validation/index.js +14 -14
  59. package/dist/format-utils/index.js +133 -133
  60. package/dist/index.js +192 -186
  61. package/dist/layouts/index.js +5 -242
  62. package/dist/report-runtime-context/index.js +2 -2
  63. package/dist/shared/index.js +4 -5
  64. package/dist/style.css +1 -1
  65. package/dist/surfboard/index.js +2 -2
  66. package/dist/types/components/index.d.ts +2 -0
  67. package/dist/types/components/surfboard/arrange-layout-button.d.ts +8 -0
  68. package/dist/types/components/surfboard/filter/types.d.ts +7 -0
  69. package/dist/types/components/surfboard/screen-size-preview-button.d.ts +10 -0
  70. package/dist/types/components/visual/matrix-table/matrix-card-view.d.ts +3 -0
  71. package/dist/types/index.js +6 -6
  72. package/dist/types/lib/charts/table-chart-types.d.ts +4 -0
  73. package/dist/types/lib/charts/types.d.ts +2 -2
  74. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +346 -21
  75. package/dist/types/lib/dashboard-inputs/dashboard-filter-value-identity.d.ts +65 -0
  76. package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +6 -0
  77. package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +2 -0
  78. package/dist/types/lib/dashboard-inputs/prepare-loaded-dashboard.d.ts +15 -0
  79. package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +3 -3
  80. package/dist/types/lib/hooks/use-dashboard-card.d.ts +2 -0
  81. package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
  82. package/dist/types/lib/matrix-table/matrix-editor.d.ts +52 -0
  83. package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +9 -1
  84. package/dist/types/lib/matrix-table/matrix-runtime.d.ts +5 -1
  85. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +149 -10
  86. package/dist/types/lib/stores/dashboard-store.d.ts +137 -6
  87. package/dist/types/lib/types/common-types.d.ts +8 -0
  88. package/dist/types/lib/types/explorer-types.d.ts +10 -0
  89. package/dist/types/lib/types/semantic-types.d.ts +84 -0
  90. package/dist/types/lib/utils/build-saved-editor-card.d.ts +20 -0
  91. package/dist/types/lib/utils/card-type-change.d.ts +16 -0
  92. package/dist/types/lib/utils/field-availability-context.d.ts +25 -0
  93. package/dist/types/lib/utils/field-placement.d.ts +96 -0
  94. package/dist/types/lib/utils/field-state-calculator.d.ts +161 -0
  95. package/dist/types/lib/utils/qualified-entity-name.d.ts +2 -0
  96. package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +57 -1
  97. package/dist/types/shared/analytics-protocol/field-provenance.d.ts +89 -0
  98. package/dist/types/shared/analytics-protocol/index.d.ts +2 -0
  99. package/dist/types/shared/analytics-protocol/query-policies.d.ts +52 -0
  100. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +1 -1
  101. package/dist/types/shared/analytics-protocol/time-window.d.ts +40 -1
  102. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +4 -1
  103. package/dist/types/shared/assistant-protocol/answer-text.d.ts +20 -0
  104. package/dist/types/shared/assistant-protocol/context.d.ts +29 -29
  105. package/dist/types/shared/assistant-protocol/index.d.ts +1 -0
  106. package/dist/types/shared/assistant-protocol/limits.d.ts +6 -1
  107. package/dist/types/shared/assistant-protocol/parts.d.ts +43 -3
  108. package/dist/types/shared/assistant-protocol/request.d.ts +14 -2
  109. package/dist/types/shared/dashboard-authoring/calculated-field-identity.d.ts +3 -0
  110. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +487 -0
  111. package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +34 -0
  112. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +7886 -0
  113. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +45 -0
  114. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +54 -0
  115. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +96 -0
  116. package/dist/types/shared/dashboard-authoring/click-to-filter-settings.d.ts +3 -3
  117. package/dist/types/shared/dashboard-authoring/column-catalog.d.ts +32 -0
  118. package/dist/types/shared/dashboard-authoring/contracts.d.ts +0 -55
  119. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +24 -14
  120. package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +9 -1
  121. package/dist/types/shared/dashboard-authoring/dashboard-filter-automatic-target.d.ts +4 -4
  122. package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +3 -1
  123. package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-types.d.ts +27 -1
  124. package/dist/types/shared/dashboard-authoring/dashboard-filter-value-compatibility.d.ts +12 -3
  125. package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +26 -0
  126. package/dist/types/shared/dashboard-authoring/filter-applicability.d.ts +75 -0
  127. package/dist/types/shared/dashboard-authoring/filter-reach-copy.d.ts +18 -0
  128. package/dist/types/shared/dashboard-authoring/filter-reach-preview.d.ts +97 -0
  129. package/dist/types/shared/dashboard-authoring/index.d.ts +22 -2
  130. package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +10 -37
  131. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +189 -0
  132. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +101 -0
  133. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +100 -0
  134. package/dist/types/shared/dashboard-authoring/semantic-auto-join-card.d.ts +22 -0
  135. package/dist/types/shared/dashboard-authoring/validators.d.ts +1 -2
  136. package/dist/types/shared/layouts/engine/grid.d.ts +25 -0
  137. package/dist/types/shared/layouts/engine/index.d.ts +4 -0
  138. package/dist/types/shared/layouts/engine/sheet-layout.d.ts +7 -0
  139. package/dist/types/shared/layouts/engine/types.d.ts +125 -0
  140. package/dist/types/shared/layouts/index.d.ts +1 -2
  141. package/package.json +2 -2
  142. package/dist/chunks/apply-dashboard-operations-CZEMsx8E.js +0 -2080
  143. package/dist/chunks/calendar-day-equality-dvoQp1xW.js +0 -410
  144. package/dist/chunks/comparison-window-caption-D4E6IHPD.js +0 -1624
  145. package/dist/chunks/custom-visual-inputs-DLCD9Y5V.js +0 -329
  146. package/dist/chunks/dashboard-controls-Cq05n3e0.js +0 -2315
  147. package/dist/chunks/dashboard-filter-value-compatibility-CwQ_iSNb.js +0 -108
  148. package/dist/chunks/matrix-analytical-definition-C7Gb0e12.js +0 -117
  149. package/dist/chunks/normalize-dashboard-for-dirty-check-Bk3VYv_q.js +0 -67
  150. package/dist/chunks/numeric-presentation-7X_IrD58.js +0 -5226
  151. package/dist/chunks/resolve-dashboard-input-context-DJ2tICwz.js +0 -9415
  152. package/dist/chunks/stable-serialize-CfqXeiBP.js +0 -6
  153. package/dist/chunks/table-settings-CLZocegs.js +0 -501
  154. package/dist/chunks/use-debounced-dirty-check-BwAbnX_5.js +0 -59
  155. package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +0 -46
  156. package/dist/types/shared/dashboard-authoring/change-compiler.d.ts +0 -7
  157. package/dist/types/shared/dashboard-authoring/layout-compiler.d.ts +0 -2
  158. package/dist/types/shared/layouts/create-frame-layouts.d.ts +0 -27
  159. package/dist/types/shared/layouts/frame-layouts.d.ts +0 -23
@@ -1,15 +1,15 @@
1
1
  import { jsxs as Ne, jsx as L, Fragment as ft } from "react/jsx-runtime";
2
2
  import * as T from "react";
3
3
  import zn, { forwardRef as Fe, createElement as xe, useContext as rt, createContext as xt, useRef as q, useLayoutEffect as Pn, useImperativeHandle as zt, useEffect as re, useState as ce, useCallback as O, useMemo as G, memo as wn, Suspense as Cn, useSyncExternalStore as En } from "react";
4
- import { aV as In, $ as ie, aW as Pt, a0 as wt, aX as ot, aY as Ct, aZ as Rn, a_ as Dn, a$ as An, b0 as Nn, u as Re, b1 as Mn, b2 as Ln, b3 as _n, b4 as kn, b5 as Tn, b6 as Hn, b7 as Vn, b8 as $n, b9 as Fn } from "./semaphor-ready-indicator-BxF96Yhv.js";
5
- import { C as Et, y as It, z as ze, A as pe, D as Rt, E as Kn, F as Bn, G as Pe, H as qn, J as Dt, K as On, M as Gn } from "./switch-uDtPgQlQ.js";
4
+ import { aZ as In, a3 as ie, a_ as Pt, a4 as wt, a$ as ot, b0 as Ct, b1 as Rn, b2 as Dn, b3 as An, b4 as Nn, u as Re, b5 as Mn, b6 as Ln, b7 as _n, b8 as kn, b9 as Tn, ba as Hn, bb as Vn, bc as $n, bd as Fn } from "./semaphor-ready-indicator-CRm17oIP.js";
5
+ import { C as Et, y as It, z as ze, A as pe, D as Rt, E as Kn, F as Bn, G as Pe, H as qn, J as Dt, K as On, M as Gn } from "./switch-CEBOR4n7.js";
6
6
  import { f as Un, r as At } from "./editor-draft-sync-BN5qYHPF.js";
7
- import { aU as Wn, aV as Xn } from "./resolve-dashboard-input-context-DJ2tICwz.js";
8
- import { f as Yn, r as Nt, g as Mt, a as Je, c as Te, n as jn, b as Qn } from "./custom-visual-inputs-DLCD9Y5V.js";
7
+ import { cS as Wn, cT as Xn } from "./global-date-filter-utils-BhAu8zIM.js";
8
+ import { f as Yn, r as Nt, g as Mt, a as Je, c as Te, n as jn, b as Qn } from "./custom-visual-inputs-ChL54gGm.js";
9
9
  import "./index-CuHybtft.js";
10
- import "./validators-DMHTpf7a.js";
11
- import "./matrix-operation-contract-8OIO4gob.js";
12
- import "./analytics-base-schemas-BFAoRlkU.js";
10
+ import "./validators-C-aOQlTB.js";
11
+ import "./matrix-operation-contract-D6vYkZK4.js";
12
+ import "./analytics-base-schemas-BKs3flFS.js";
13
13
  import "zod";
14
14
  import "../value-format-preferences/index.js";
15
15
  import { c as we } from "./_commonjsHelpers-DimLPMtv.js";
@@ -1,4 +1,4 @@
1
- import { F as K } from "./validators-DMHTpf7a.js";
1
+ import { al as K } from "./validators-C-aOQlTB.js";
2
2
  function p(e) {
3
3
  const i = V(e);
4
4
  return i.length > 0 ? i.join(".") : void 0;
@@ -767,21 +767,21 @@ function Ie(e) {
767
767
  }
768
768
  export {
769
769
  pe as a,
770
- v as b,
770
+ M as b,
771
771
  p as c,
772
- M as d,
773
- ve as e,
774
- ke as f,
772
+ ve as d,
773
+ ke as e,
774
+ ge as f,
775
775
  X as g,
776
- ge as h,
777
- O as i,
778
- Ne as j,
779
- W as k,
780
- ne as l,
781
- J as m,
776
+ O as h,
777
+ Ne as i,
778
+ W as j,
779
+ ne as k,
780
+ J as l,
781
+ be as m,
782
782
  z as n,
783
- be as o,
783
+ Ie as o,
784
784
  Q as p,
785
- Ie as r,
785
+ v as r,
786
786
  P as s
787
787
  };
@@ -2,9 +2,9 @@ import { jsx as y, jsxs as de, Fragment as St } from "react/jsx-runtime";
2
2
  import * as l from "react";
3
3
  import De, { useLayoutEffect as Wi, useState as qr, forwardRef as Ui, useRef as gn, useMemo as Hi, useId as Vi, useImperativeHandle as zi } from "react";
4
4
  import "./index-CuHybtft.js";
5
- import "./validators-DMHTpf7a.js";
6
- import "./matrix-operation-contract-8OIO4gob.js";
7
- import "./analytics-base-schemas-BFAoRlkU.js";
5
+ import "./validators-C-aOQlTB.js";
6
+ import "./matrix-operation-contract-D6vYkZK4.js";
7
+ import "./analytics-base-schemas-BKs3flFS.js";
8
8
  import "zod";
9
9
  import "../value-format-preferences/index.js";
10
10
  import { a as ji, c as te, b as me, g as Ki } from "./_commonjsHelpers-DimLPMtv.js";
@@ -2,7 +2,7 @@ var ft = Object.defineProperty;
2
2
  var ht = (e, t, r) => t in e ? ft(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var ne = (e, t, r) => ht(e, typeof t != "symbol" ? t + "" : t, r);
4
4
  import { z as S } from "zod";
5
- import { e as ct } from "./comparison-window-caption-D4E6IHPD.js";
5
+ import { e as ct } from "./comparison-window-caption-C2xF-eWw.js";
6
6
  var E = Uint8Array, I = Uint16Array, pe = Int32Array, xe = new E([
7
7
  0,
8
8
  0,
@@ -0,0 +1,614 @@
1
+ import { k as x, u as B, ab as P } from "./validators-C-aOQlTB.js";
2
+ import "./matrix-operation-contract-D6vYkZK4.js";
3
+ import "./analytics-base-schemas-BKs3flFS.js";
4
+ import { z as d } from "zod";
5
+ const F = 8, T = 6, g = Object.freeze([]);
6
+ function j(e) {
7
+ switch (e.type) {
8
+ case "table":
9
+ case "chart":
10
+ return e.card ? [e.card] : g;
11
+ case "kpi":
12
+ return Array.isArray(e.cards) ? e.cards : g;
13
+ default:
14
+ return g;
15
+ }
16
+ }
17
+ function fe(e, t) {
18
+ switch (e.type) {
19
+ case "table":
20
+ case "chart": {
21
+ if (!e.card) return e;
22
+ const n = t(e.card);
23
+ return n === e.card ? e : { ...e, card: n };
24
+ }
25
+ case "kpi": {
26
+ if (!Array.isArray(e.cards)) return e;
27
+ const n = e.cards.map(t);
28
+ return n.every((r, a) => r === e.cards[a]) ? e : { ...e, cards: n };
29
+ }
30
+ default:
31
+ return e;
32
+ }
33
+ }
34
+ function O(e) {
35
+ var n;
36
+ const t = [];
37
+ for (const r of e.sheets || []) {
38
+ const a = r.id;
39
+ for (const i of r.cards || [])
40
+ t.push({ kind: "sheetCard", sheetId: a, cardId: i.id, card: i });
41
+ for (const i of r.frames || [])
42
+ for (const s of i.cards || [])
43
+ t.push({
44
+ kind: "frameCard",
45
+ sheetId: a,
46
+ frameId: i.id,
47
+ cardId: s.id,
48
+ card: s
49
+ });
50
+ for (const i of ((n = r.document) == null ? void 0 : n.sections) || [])
51
+ for (const s of j(i))
52
+ t.push({
53
+ kind: "documentSectionCard",
54
+ sheetId: a,
55
+ sectionId: i.id,
56
+ cardId: s.id,
57
+ card: s
58
+ });
59
+ }
60
+ return t;
61
+ }
62
+ function S(e) {
63
+ return !!e && typeof e == "object" && !Array.isArray(e);
64
+ }
65
+ function me(e) {
66
+ if (!S(e))
67
+ return [{ path: "", message: "must be an object." }];
68
+ const t = [];
69
+ e.title !== void 0 && typeof e.title != "string" && t.push({ path: "title", message: "must be a string." });
70
+ const n = e.cards;
71
+ if (!Array.isArray(n))
72
+ t.push({ path: "cards", message: "must be an array of KPI cards." });
73
+ else {
74
+ (n.length < 1 || n.length > F) && t.push({
75
+ path: "cards",
76
+ message: `must hold 1 to ${F} KPI cards.`
77
+ });
78
+ const a = /* @__PURE__ */ new Set();
79
+ n.forEach((i, s) => {
80
+ if (!S(i)) {
81
+ t.push({ path: `cards[${s}]`, message: "must be a card." });
82
+ return;
83
+ }
84
+ typeof i.id != "string" || !i.id ? t.push({
85
+ path: `cards[${s}].id`,
86
+ message: "must be a non-empty string."
87
+ }) : a.has(i.id) ? t.push({
88
+ path: `cards[${s}].id`,
89
+ message: `duplicates card id '${i.id}'.`
90
+ }) : a.add(i.id), i.type !== "kpi" && t.push({ path: `cards[${s}].type`, message: "must be 'kpi'." });
91
+ });
92
+ }
93
+ const r = e.kpi;
94
+ return S(r) ? (r.layout !== "tiles" && r.layout !== "lines" ? t.push({
95
+ path: "kpi.layout",
96
+ message: "must be 'tiles' or 'lines'."
97
+ }) : r.layout === "tiles" && Array.isArray(n) && n.length > T && t.push({
98
+ path: "kpi.layout",
99
+ message: `must be 'lines' for more than ${T} KPI cards.`
100
+ }), r.columns !== void 0 && r.columns !== 1 && r.columns !== 2 && t.push({ path: "kpi.columns", message: "must be 1 or 2." })) : t.push({ path: "kpi", message: "must be an object." }), t;
101
+ }
102
+ const z = ["new", "edit", "delete", "create", "update", "remove"];
103
+ function $(e, t) {
104
+ return (e.sheets || []).flatMap(
105
+ (n) => O({ sheets: [n] }).filter(t).map((r) => ({
106
+ card: r.card,
107
+ sheet: n,
108
+ ...r.kind === "frameCard" && { frameId: r.frameId },
109
+ ...r.kind === "documentSectionCard" && {
110
+ sectionId: r.sectionId
111
+ }
112
+ }))
113
+ );
114
+ }
115
+ function m(e) {
116
+ return $(e, (t) => t.kind !== "documentSectionCard");
117
+ }
118
+ function pe(e) {
119
+ return [
120
+ ...m(e),
121
+ ...$(e, (t) => t.kind === "documentSectionCard")
122
+ ];
123
+ }
124
+ function he(e) {
125
+ return m(e).map((t) => t.card);
126
+ }
127
+ function ye(e, t, n) {
128
+ return n && t === n ? !0 : !O(e).some(
129
+ (r) => r.cardId === t
130
+ );
131
+ }
132
+ function be(e) {
133
+ return !e || e.trim().length === 0 ? { isValid: !1, error: "Card ID cannot be empty" } : e.length < 3 ? { isValid: !1, error: "Card ID must be at least 3 characters" } : e.length > 50 ? { isValid: !1, error: "Card ID must be less than 50 characters" } : /^[a-zA-Z0-9-_]+$/.test(e) ? /^[a-zA-Z0-9]/.test(e) ? z.includes(e.toLowerCase()) ? {
134
+ isValid: !1,
135
+ error: `"${e}" is a reserved keyword and cannot be used`
136
+ } : { isValid: !0 } : {
137
+ isValid: !1,
138
+ error: "Card ID must start with a letter or number"
139
+ } : {
140
+ isValid: !1,
141
+ error: "Card ID can only contain letters, numbers, hyphens, and underscores"
142
+ };
143
+ }
144
+ function ge(e, t) {
145
+ var n;
146
+ return (n = K(e, t)) == null ? void 0 : n.card;
147
+ }
148
+ function K(e, t) {
149
+ for (const n of m(e))
150
+ if (n.card.id === t)
151
+ return n;
152
+ }
153
+ function Se(e, t) {
154
+ for (const n of e.sheets || [])
155
+ for (const r of n.frames || [])
156
+ for (const a of r.cards || [])
157
+ if (a.id === t)
158
+ return { card: a, sheet: n };
159
+ }
160
+ const y = {
161
+ includeMetricFilterDatasets: !0,
162
+ preferQualifiedIdentity: !1
163
+ };
164
+ function M(e) {
165
+ if (!e) return;
166
+ if (e.kind === "semantic")
167
+ return { entityName: e.datasetName, entityId: e.datasetId, label: e.label };
168
+ const t = [e.databaseName, e.schemaName, e.tableName].filter((n) => !!(n && n.trim())).join(".");
169
+ return {
170
+ entityName: e.tableName,
171
+ qualifiedEntityName: t.includes(".") ? t : void 0,
172
+ label: e.label
173
+ };
174
+ }
175
+ function U(e) {
176
+ var n;
177
+ const t = M(e.source);
178
+ return t ? `${(n = e.source) == null ? void 0 : n.kind}:${t.qualifiedEntityName || t.entityName}` : "";
179
+ }
180
+ function Q(e) {
181
+ return [
182
+ e.id,
183
+ e.qualifiedEntityName,
184
+ e.entityId,
185
+ e.entityName,
186
+ e.qualifiedFieldName,
187
+ e.name,
188
+ // Source-only fields from different datasets can otherwise share a key
189
+ // and the second dataset would be silently dropped.
190
+ U(e)
191
+ ].join("|");
192
+ }
193
+ function G(e) {
194
+ return [e.entityName, e.qualifiedEntityName || "", e.entityId || ""].join("|");
195
+ }
196
+ function Ie(e) {
197
+ return e.entityName || e.qualifiedEntityName || "";
198
+ }
199
+ function Y(e) {
200
+ var t, n;
201
+ return !!(e.expression || e.derivedField || (n = (t = e.calculatedFormula) == null ? void 0 : t.inputFields) != null && n.length);
202
+ }
203
+ function W(e) {
204
+ return x(e) ? !0 : e.entityName || e.qualifiedEntityName ? !1 : !e.source || Y(e);
205
+ }
206
+ function I(e, t) {
207
+ const n = G(t);
208
+ e.found.has(n) || e.found.set(n, t);
209
+ }
210
+ function p(e, t) {
211
+ var c, w, D;
212
+ if (!e) return;
213
+ const n = Q(e);
214
+ if (t.visitedFields.has(n)) return;
215
+ t.visitedFields.add(n);
216
+ const r = W(e);
217
+ if (!r) {
218
+ const f = !e.entityName && !e.qualifiedEntityName ? M(e.source) : void 0;
219
+ I(
220
+ t,
221
+ f || {
222
+ // May be empty for qualified-only metadata; identity then comes from
223
+ // `qualifiedEntityName` (see `identityFor` and the calculator).
224
+ entityName: e.entityName || "",
225
+ entityId: e.entityId,
226
+ qualifiedEntityName: e.qualifiedEntityName,
227
+ label: e.source && e.source.kind === "semantic" ? e.source.label : void 0
228
+ }
229
+ );
230
+ }
231
+ t.includeMetricFilterDatasets && "parameters" in e && ((c = e.parameters) != null && c.filters) && E(e.parameters.filters, t);
232
+ const a = (w = e.calculatedFormula) == null ? void 0 : w.inputFields, i = !!(a && a.length > 0);
233
+ i && a.forEach((f) => p(f, t));
234
+ let s = !1, o = !1;
235
+ const u = i || (D = e.derivedField) == null ? void 0 : D.inputs;
236
+ if (u && Object.keys(u).length > 0)
237
+ for (const f of Object.values(u)) {
238
+ const l = f.field.source;
239
+ if (!l) {
240
+ i || (o = !0);
241
+ continue;
242
+ }
243
+ if (l.kind === "sql") {
244
+ o = !0;
245
+ continue;
246
+ }
247
+ if (l.kind === "semantic")
248
+ I(t, {
249
+ entityName: l.datasetName,
250
+ entityId: l.datasetId,
251
+ label: l.label
252
+ });
253
+ else {
254
+ const k = [l.databaseName, l.schemaName, l.tableName].filter((v) => !!(v && v.trim())).join(".");
255
+ I(t, {
256
+ entityName: l.tableName,
257
+ qualifiedEntityName: k.includes(".") ? k : void 0,
258
+ label: l.label
259
+ });
260
+ }
261
+ s = !0;
262
+ }
263
+ o && (t.complete = !1), r && !i && !s && (t.complete = !1);
264
+ }
265
+ function E(e, t) {
266
+ if (e && !t.visitedGroups.has(e.id)) {
267
+ t.visitedGroups.add(e.id);
268
+ for (const n of e.conditions || [])
269
+ p(n.field, t);
270
+ for (const n of e.groups || [])
271
+ E(n, t);
272
+ }
273
+ }
274
+ function b(e, t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set()) {
275
+ return {
276
+ found: /* @__PURE__ */ new Map(),
277
+ complete: !0,
278
+ visitedFields: t,
279
+ visitedGroups: n,
280
+ includeMetricFilterDatasets: e
281
+ };
282
+ }
283
+ function N(e, t) {
284
+ var r;
285
+ const n = (r = e.qualifiedEntityName) != null && r.includes(".") ? e.qualifiedEntityName : void 0;
286
+ return t === "qualifiedOnly" ? n : t === "preferQualified" ? n || e.entityName || void 0 : e.entityName || void 0;
287
+ }
288
+ function Ce(e) {
289
+ const t = b(!1);
290
+ return p(e, t), { datasets: Array.from(t.found.values()), complete: t.complete };
291
+ }
292
+ function V(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), a = y) {
293
+ const i = { ...y, ...a }, s = b(i.includeMetricFilterDatasets, n, r);
294
+ p(e, s), s.found.forEach((o) => {
295
+ const u = N(o, i.preferQualifiedIdentity ? "preferQualified" : "name");
296
+ u && t.add(u);
297
+ });
298
+ }
299
+ function Ee(e, t) {
300
+ V(e, t, /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), {
301
+ preferQualifiedIdentity: !0
302
+ });
303
+ }
304
+ function Ne(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
305
+ const a = b(!0, n, r);
306
+ p(e, a), a.found.forEach((i) => {
307
+ const s = N(i, "qualifiedOnly");
308
+ s && t.add(s);
309
+ });
310
+ }
311
+ function we(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
312
+ V(e, t, n, r, {
313
+ includeMetricFilterDatasets: !1
314
+ });
315
+ }
316
+ function De(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), a = y) {
317
+ const i = { ...y, ...a }, s = b(i.includeMetricFilterDatasets, n, r);
318
+ E(e, s), s.found.forEach((o) => {
319
+ const u = N(o, i.preferQualifiedIdentity ? "preferQualified" : "name");
320
+ u && t.add(u);
321
+ });
322
+ }
323
+ function ke(e, t) {
324
+ return t != null && t[e] ? t[e] : (e.includes(".") ? e.slice(e.lastIndexOf(".") + 1) : e).replace(/[_-]+/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\s+/g, " ").trim().replace(/\b\w/g, (r) => r.toUpperCase());
325
+ }
326
+ const J = {
327
+ date: /* @__PURE__ */ new Set([
328
+ "between",
329
+ "not between",
330
+ "=",
331
+ "!=",
332
+ ">",
333
+ ">=",
334
+ "<",
335
+ "<=",
336
+ "is null",
337
+ "is not null"
338
+ ]),
339
+ number: /* @__PURE__ */ new Set([
340
+ "between",
341
+ "not between",
342
+ "=",
343
+ "!=",
344
+ ">",
345
+ ">=",
346
+ "<",
347
+ "<=",
348
+ "in",
349
+ "not in",
350
+ "is null",
351
+ "is not null"
352
+ ]),
353
+ string: /* @__PURE__ */ new Set([
354
+ "=",
355
+ "!=",
356
+ "in",
357
+ "not in",
358
+ "like",
359
+ "not like",
360
+ "is null",
361
+ "is not null"
362
+ ]),
363
+ boolean: /* @__PURE__ */ new Set(["=", "!=", "in", "not in", "is null", "is not null"])
364
+ };
365
+ function Z(e) {
366
+ const t = P(e);
367
+ return t === "number" || t === "boolean" ? t : t === "date" || t === "datetime" ? "date" : "string";
368
+ }
369
+ function ve(e, t) {
370
+ return typeof t != "string" ? !1 : J[Z(e)].has(t);
371
+ }
372
+ const Fe = /* @__PURE__ */ new Set([
373
+ "=",
374
+ ">",
375
+ "<",
376
+ ">=",
377
+ "<=",
378
+ "!=",
379
+ "in",
380
+ "not in",
381
+ "like",
382
+ "not like",
383
+ "between",
384
+ "not between",
385
+ "is null",
386
+ "is not null"
387
+ ]);
388
+ function H(e, t) {
389
+ return t === "number" ? typeof e == "number" && Number.isFinite(e) : t === "boolean" ? typeof e == "boolean" : t === "date" ? e instanceof Date || typeof e == "string" && e.trim().length > 0 : typeof e == "string" || typeof e == "number" || typeof e == "boolean";
390
+ }
391
+ function Te(e, t, n, r) {
392
+ if (B(e.relativeMeta)) {
393
+ r.push(
394
+ `${n}.relativeMeta counts back from the latest data; a dashboard filter's dates run to now. Use a period counted back from today.`
395
+ );
396
+ return;
397
+ }
398
+ X(e.operation, e.values, t, `${n}.values`, r);
399
+ }
400
+ function X(e, t, n, r, a) {
401
+ if (e === "is null" || e === "is not null") {
402
+ t.length !== 0 && a.push(`${r} must be empty for null filter operations.`);
403
+ return;
404
+ }
405
+ if (e === "between" || e === "not between") {
406
+ if (t.length !== 2) {
407
+ a.push(
408
+ `${r} must contain exactly two values for between operations.`
409
+ );
410
+ return;
411
+ }
412
+ } else if (e === "in" || e === "not in") {
413
+ if (t.length === 0) {
414
+ a.push(
415
+ `${r} must contain at least one value for set operations.`
416
+ );
417
+ return;
418
+ }
419
+ } else if (t.length !== 1) {
420
+ a.push(
421
+ `${r} must contain exactly one value for '${String(e)}' operations.`
422
+ );
423
+ return;
424
+ }
425
+ for (const i of t)
426
+ if (!H(i, n)) {
427
+ a.push(
428
+ `${r} contains a value that is incompatible with valueType '${n}'.`
429
+ );
430
+ return;
431
+ }
432
+ }
433
+ const Ae = {
434
+ database: null,
435
+ schema: null,
436
+ table: null
437
+ }, _e = "__card_default__", L = {
438
+ bookmarksPerViewerPerDashboard: 20,
439
+ bookmarkNameMaxChars: 100,
440
+ columnLabelMaxChars: 120,
441
+ tableSettingsMaxBytes: 65536,
442
+ rememberedTableSettingsMaxBytes: 262144,
443
+ bookmarkStateMaxBytes: 65536
444
+ }, ee = 1;
445
+ function Oe(e) {
446
+ return new TextEncoder().encode(JSON.stringify(e ?? null)).length;
447
+ }
448
+ function te(e) {
449
+ const t = encodeURIComponent;
450
+ switch (e.kind) {
451
+ case "dimension":
452
+ return `dim:${e.role}:${t(e.fieldId)}`;
453
+ case "metric":
454
+ return `metric:${t(e.metricId)}:${t(
455
+ e.metricAlias
456
+ )}`;
457
+ case "result":
458
+ return `result:${t(e.key)}`;
459
+ }
460
+ }
461
+ function h(e) {
462
+ if (e)
463
+ try {
464
+ return decodeURIComponent(e);
465
+ } catch {
466
+ return;
467
+ }
468
+ }
469
+ function ne(e) {
470
+ if (typeof e != "string") return;
471
+ const t = e.split(":");
472
+ let n;
473
+ if (t[0] === "dim" && t.length === 3) {
474
+ const r = t[1], a = h(t[2]);
475
+ (r === "detail" || r === "groupby") && a && (n = { kind: "dimension", role: r, fieldId: a });
476
+ } else if (t[0] === "metric" && t.length === 3) {
477
+ const r = h(t[1]), a = h(t[2]);
478
+ r && a && (n = { kind: "metric", metricId: r, metricAlias: a });
479
+ } else if (t[0] === "result" && t.length === 2) {
480
+ const r = h(t[1]);
481
+ r && (n = { kind: "result", key: r });
482
+ }
483
+ return n && te(n) === e ? n : void 0;
484
+ }
485
+ function C(e) {
486
+ return typeof e == "string" && ne(e) !== void 0;
487
+ }
488
+ const A = d.array(d.string()).max(2e3), re = d.object({
489
+ order: A.optional(),
490
+ hidden: A.optional(),
491
+ labels: d.record(d.string(), d.string().max(L.columnLabelMaxChars)).optional(),
492
+ sort: d.array(
493
+ d.object({
494
+ columnId: d.string(),
495
+ direction: d.enum(["asc", "desc"])
496
+ }).strict()
497
+ ).max(2e3).optional()
498
+ }).strict();
499
+ function _(e) {
500
+ const t = /* @__PURE__ */ new Set(), n = [];
501
+ for (const r of e)
502
+ !C(r) || t.has(r) || (t.add(r), n.push(r));
503
+ return n;
504
+ }
505
+ function q(e) {
506
+ if (!e) return;
507
+ const t = e.order ? _(e.order) : void 0, n = e.hidden ? _(e.hidden) : void 0, r = Object.entries(e.labels ?? {}).flatMap(
508
+ ([o, u]) => {
509
+ const c = typeof u == "string" ? u.trim() : "";
510
+ return C(o) && c ? [
511
+ [
512
+ o,
513
+ c.slice(0, L.columnLabelMaxChars)
514
+ ]
515
+ ] : [];
516
+ }
517
+ ), a = /* @__PURE__ */ new Set(), i = e.sort ? e.sort.filter((o) => !C(o.columnId) || a.has(o.columnId) ? !1 : (a.add(o.columnId), !0)) : void 0, s = {};
518
+ return t != null && t.length && (s.order = t), n != null && n.length && (s.hidden = n), r.length && (s.labels = Object.fromEntries(r)), i && (s.sort = i.map(({ columnId: o, direction: u }) => ({
519
+ columnId: o,
520
+ direction: u
521
+ }))), Object.keys(s).length ? s : void 0;
522
+ }
523
+ function ae(e) {
524
+ return q(e) === void 0;
525
+ }
526
+ function ie(e, t) {
527
+ if (t !== ee)
528
+ return {
529
+ ok: !1,
530
+ error: `Unsupported table settings version ${t}.`
531
+ };
532
+ const n = re.safeParse(e);
533
+ return n.success ? {
534
+ ok: !0,
535
+ value: q(n.data) ?? {}
536
+ } : { ok: !1, error: "Table settings are invalid." };
537
+ }
538
+ function $e(e, t, n) {
539
+ if (!e || typeof e != "object" || Array.isArray(e)) return {};
540
+ const r = {};
541
+ for (const [a, i] of Object.entries(
542
+ e
543
+ )) {
544
+ if (!n.has(a)) continue;
545
+ const s = ie(i, t);
546
+ s.ok && !ae(s.value) && (r[a] = s.value);
547
+ }
548
+ return r;
549
+ }
550
+ const se = /* @__PURE__ */ new Set([
551
+ "table",
552
+ "detailTable"
553
+ ]);
554
+ function R(e) {
555
+ return se.has(e.type);
556
+ }
557
+ function oe(e) {
558
+ var t, n;
559
+ return R(e) && ((n = (t = e.preferences) == null ? void 0 : t.tablePrefs) == null ? void 0 : n.allowViewerColumnCustomization) !== !1;
560
+ }
561
+ function Me(e) {
562
+ return new Set(
563
+ m(e).filter(({ card: t }) => R(t)).map(({ card: t }) => t.id)
564
+ );
565
+ }
566
+ function Ve(e) {
567
+ return new Set(
568
+ m(e).filter(({ card: t }) => oe(t)).map(({ card: t }) => t.id)
569
+ );
570
+ }
571
+ export {
572
+ fe as A,
573
+ me as B,
574
+ _e as C,
575
+ Fe as D,
576
+ Ae as E,
577
+ Z as F,
578
+ ve as G,
579
+ K as H,
580
+ he as I,
581
+ m as J,
582
+ ge as K,
583
+ pe as L,
584
+ ye as M,
585
+ be as N,
586
+ Se as O,
587
+ L as V,
588
+ Ie as a,
589
+ Ee as b,
590
+ V as c,
591
+ M as d,
592
+ Ne as e,
593
+ we as f,
594
+ De as g,
595
+ ke as h,
596
+ ee as i,
597
+ ae as j,
598
+ ie as k,
599
+ $e as l,
600
+ Oe as m,
601
+ q as n,
602
+ R as o,
603
+ ne as p,
604
+ oe as q,
605
+ Ce as r,
606
+ Me as s,
607
+ te as t,
608
+ Ve as u,
609
+ Te as v,
610
+ O as w,
611
+ F as x,
612
+ T as y,
613
+ j as z
614
+ };