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
@@ -2,7 +2,7 @@ var T = Object.defineProperty;
2
2
  var q = (e, a, i) => a in e ? T(e, a, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[a] = i;
3
3
  var b = (e, a, i) => q(e, typeof a != "symbol" ? a + "" : a, i);
4
4
  import { z as t } from "zod";
5
- import { s as k } from "./analytics-base-schemas-BFAoRlkU.js";
5
+ import { s as k } from "./analytics-base-schemas-BKs3flFS.js";
6
6
  const J = 1;
7
7
  function $(e) {
8
8
  return `You've used ${e === void 0 ? "today's questions" : `today's ${e} questions`}. They reset tomorrow. To keep going, contact your administrator.`;
@@ -26,8 +26,13 @@ const y = {
26
26
  messageChars: 4e3,
27
27
  /** The whole serialized AssistantContext, in UTF-8 bytes. */
28
28
  contextBytes: 48 * 1024,
29
- /** The whole request body (context, message, added sources), in UTF-8 bytes. */
29
+ /** The whole request body (context, message, added sources) except `openDashboard`, in UTF-8 bytes. */
30
30
  requestBytes: 128 * 1024,
31
+ /**
32
+ * The dashboard on screen sent with a question (Phase 7, D7-12), alone, in
33
+ * UTF-8 bytes of its JSON. Over it the browser sends the question without it.
34
+ */
35
+ openDashboardBytes: 2 * 1024 * 1024,
31
36
  summaryCards: 30,
32
37
  // AssistantContext.cards
33
38
  otherSheets: 50,
@@ -208,7 +213,7 @@ function K(e, a, i) {
208
213
  "Dashboard inputs with a value (which of them a card applies is in that card's description when the user asks about it):"
209
214
  );
210
215
  for (const c of e.activeInputs)
211
- s.push(`- ${O(c)}`);
216
+ s.push(`- ${B(c)}`);
212
217
  (d = e.omitted) != null && d.activeInputs && s.push(`- ${e.omitted.activeInputs} more inputs are not listed.`);
213
218
  }
214
219
  if (e.cards.length > 0) {
@@ -243,11 +248,11 @@ function m(e, a) {
243
248
  function f(e) {
244
249
  return `${l(e.title)} (card id ${e.id}, ${e.visualType})${e.source ? ` from ${w(e.source)}` : ""}`;
245
250
  }
246
- function O(e) {
251
+ function B(e) {
247
252
  const { value: a } = e;
248
253
  return a.kind === "varies" ? `${l(e.label)}: differs by card; ask about a card to see its value` : a.notApplied ? `${a.text} (not applied in this view: it was opened from another dashboard without this dashboard's own filters)` : `${a.text}${e.globalDate ? ", applied to each card's own date field, on cards that have one" : ""}`;
249
254
  }
250
- const B = {
255
+ const O = {
251
256
  matrix: "it is a Matrix card",
252
257
  custom_visual: "it is a custom visual",
253
258
  python: "it is computed with Python",
@@ -267,7 +272,7 @@ function M(e, a) {
267
272
  ] : [`The user is asking about the card ${f(e)}.`], s = e.description;
268
273
  if (s.status === "not_described")
269
274
  return i.push(
270
- `How this card is built is not available to you: ${B[s.reason]}${s.message ? ` (${s.message})` : ""}. Answer with the tools, and say that you could not read the card's definition.`
275
+ `How this card is built is not available to you: ${O[s.reason]}${s.message ? ` (${s.message})` : ""}. Answer with the tools, and say that you could not read the card's definition.`
271
276
  ), i;
272
277
  const r = s.omitted ?? {};
273
278
  if (i.push(a ? "What the draft runs, as the editor compiled it:" : "What the card runs, as the dashboard compiled it:"), s.fields.length > 0) {
@@ -0,0 +1,295 @@
1
+ import { v as F } from "./global-date-filter-utils-BhAu8zIM.js";
2
+ function h(e) {
3
+ if (!(e != null && e.expectedType)) return "table";
4
+ const r = Array.isArray(e.expectedType) ? e.expectedType[0] : e.expectedType;
5
+ return M(r) ? r : "table";
6
+ }
7
+ const E = [
8
+ "bar",
9
+ "horizontalBar",
10
+ "line",
11
+ "area",
12
+ "stackedArea",
13
+ "combo",
14
+ "pie",
15
+ "doughnut",
16
+ "radar",
17
+ "polarArea",
18
+ "bubble",
19
+ "scatter",
20
+ "stackedBar",
21
+ "stackedLine",
22
+ "table",
23
+ "pivotTable",
24
+ "aggregateTable",
25
+ "detailTable",
26
+ "kpi",
27
+ "pyramid",
28
+ "tornado",
29
+ "range",
30
+ "text",
31
+ "map",
32
+ "funnel",
33
+ "bullet",
34
+ "heatmap",
35
+ "treemap",
36
+ "custom"
37
+ ];
38
+ function M(e) {
39
+ return E.includes(e);
40
+ }
41
+ function b(e) {
42
+ const r = e.position;
43
+ if (typeof r == "number") return r;
44
+ if (typeof r == "string") {
45
+ const t = r.match(/\d+/);
46
+ if (t) {
47
+ const n = Number(t[0]);
48
+ if (!Number.isNaN(n)) return n;
49
+ }
50
+ }
51
+ return Number.POSITIVE_INFINITY;
52
+ }
53
+ function m(e) {
54
+ if (typeof e == "number")
55
+ return { kind: "number", start: e, end: e };
56
+ if (typeof e == "string") {
57
+ const r = e.match(/^(\d+)$/);
58
+ if (r) {
59
+ const s = Number(r[1]);
60
+ return { kind: "number", start: s, end: s };
61
+ }
62
+ const t = e.match(/^(\d+)-(\d+)$/);
63
+ if (t) {
64
+ const s = Number(t[1]), d = Number(t[2]);
65
+ return { kind: "range", start: s, end: d };
66
+ }
67
+ const n = e.match(/^(\d+)\+$/);
68
+ if (n)
69
+ return { kind: "dynamic", start: Number(n[1]), end: Number.POSITIVE_INFINITY };
70
+ }
71
+ return null;
72
+ }
73
+ function k(e) {
74
+ return !e || e.length === 0 ? void 0 : [...e].sort(
75
+ (t, n) => b(t) - b(n)
76
+ )[0];
77
+ }
78
+ function N(e, r) {
79
+ if (!e || e.length === 0) return;
80
+ const t = [], n = [], s = [];
81
+ e.forEach((i) => {
82
+ const u = m(i.position);
83
+ u && (u.kind === "number" ? t.push(i) : u.kind === "range" ? n.push(i) : u.kind === "dynamic" && s.push(i));
84
+ });
85
+ const d = t.find((i) => {
86
+ const u = m(i.position);
87
+ return (u == null ? void 0 : u.kind) === "number" && u.start === r;
88
+ });
89
+ if (d) return d;
90
+ const p = n.sort(
91
+ (i, u) => b(i) - b(u)
92
+ ).find((i) => {
93
+ const u = m(i.position);
94
+ return (u == null ? void 0 : u.kind) === "range" && r >= u.start && r <= u.end;
95
+ });
96
+ if (p) return p;
97
+ const o = s.map((i) => ({
98
+ slot: i,
99
+ parsed: m(i.position)
100
+ })).filter((i) => {
101
+ var u;
102
+ return ((u = i.parsed) == null ? void 0 : u.kind) === "dynamic";
103
+ }).sort(
104
+ (i, u) => {
105
+ var a, f;
106
+ return (((a = i.parsed) == null ? void 0 : a.start) ?? 0) - (((f = u.parsed) == null ? void 0 : f.start) ?? 0);
107
+ }
108
+ ).filter((i) => {
109
+ var u;
110
+ return r >= (((u = i.parsed) == null ? void 0 : u.start) ?? 0);
111
+ }).sort(
112
+ (i, u) => {
113
+ var a, f;
114
+ return (((a = u.parsed) == null ? void 0 : a.start) ?? 0) - (((f = i.parsed) == null ? void 0 : f.start) ?? 0);
115
+ }
116
+ )[0];
117
+ return o == null ? void 0 : o.slot;
118
+ }
119
+ function A(e, r) {
120
+ const t = N(e, r);
121
+ if (t)
122
+ return h(t);
123
+ }
124
+ function V(e, r) {
125
+ var n;
126
+ const t = (n = e == null ? void 0 : e.customCardPreferences) == null ? void 0 : n.slotIndex;
127
+ return typeof t == "number" ? t : r;
128
+ }
129
+ function S(e, r) {
130
+ var t;
131
+ if (!((t = e == null ? void 0 : e.customCardPreferences) != null && t.url))
132
+ return !1;
133
+ if (e.type === "custom" || e.customCardPreferences.visualType === "multiple" || e.customCardPreferences.dataInputCardIds || (e.customCardPreferences.minInputs || 0) > 1 || (e.customCardPreferences.maxInputs || 0) > 1)
134
+ return !0;
135
+ if (r && r.length > 1) {
136
+ const n = r.filter(
137
+ (s) => {
138
+ var d;
139
+ return typeof ((d = s.customCardPreferences) == null ? void 0 : d.slotIndex) == "number";
140
+ }
141
+ );
142
+ if (n.length > 1 && n.some((s) => s.id !== e.id))
143
+ return !0;
144
+ }
145
+ return !1;
146
+ }
147
+ function O(e) {
148
+ const r = [];
149
+ let t = -1;
150
+ e.forEach((n, s) => {
151
+ const d = V(n, s);
152
+ d > t && (t = d), r[d] = n ?? null;
153
+ });
154
+ for (let n = 0; n <= t; n += 1)
155
+ n in r || (r[n] = null);
156
+ return r;
157
+ }
158
+ function $(e) {
159
+ return e.map((r, t) => !r.customCardPreferences || r.customCardPreferences.slotIndex === t ? r : {
160
+ ...r,
161
+ customCardPreferences: {
162
+ ...r.customCardPreferences,
163
+ slotIndex: t
164
+ }
165
+ });
166
+ }
167
+ function v(e) {
168
+ const r = k(e);
169
+ if (r)
170
+ return h(r);
171
+ }
172
+ function R(e, r, t) {
173
+ if (!e) return;
174
+ const n = A(t, r);
175
+ return e.type === "custom" && n ? n : e.type;
176
+ }
177
+ function Y(e, r, t) {
178
+ var T;
179
+ const n = {
180
+ dataSource: t.dataSource,
181
+ connectionId: t.connectionId
182
+ }, s = {
183
+ type: "component",
184
+ visualType: "multiple",
185
+ url: r.url,
186
+ componentName: r.name,
187
+ icon: r.icon,
188
+ pluginChartType: r.chartType,
189
+ minInputs: r.minInputs,
190
+ maxInputs: r.maxInputs
191
+ }, d = r.minInputs || 1, p = e.map((c) => ({ slot: c, parsed: m(c.position) })).filter((c) => c.parsed !== null).reduce((c, l) => {
192
+ const x = l.parsed.end;
193
+ return Number.isFinite(x) ? Math.max(c, x) : c;
194
+ }, -1), g = Math.max(d, p + 1), o = k(e), i = o ? b(o) : 0;
195
+ let u = !1;
196
+ const a = [];
197
+ for (let c = 0; c < g; c += 1) {
198
+ const l = N(e, c), x = h(l), I = !u && c === i, P = c, C = {
199
+ ...n,
200
+ id: F(),
201
+ title: (I ? o == null ? void 0 : o.label : l == null ? void 0 : l.label) || `Tab ${c + 1}`,
202
+ tabTitle: (I ? o == null ? void 0 : o.label : l == null ? void 0 : l.label) || `Tab ${c + 1}`,
203
+ description: (I ? o == null ? void 0 : o.description : l == null ? void 0 : l.description) || "",
204
+ type: x,
205
+ sql: "",
206
+ preferences: {
207
+ onClickFilter: [{ columnIndex: 0, expression: "" }]
208
+ },
209
+ ...I && {
210
+ customCardPreferences: {
211
+ ...s,
212
+ slotIndex: P
213
+ }
214
+ },
215
+ ...!I && {
216
+ customCardPreferences: {
217
+ slotIndex: P
218
+ }
219
+ }
220
+ };
221
+ I && (u = !0), a.push(C);
222
+ }
223
+ if (!u && a.length > 0) {
224
+ const c = ((T = a[0].customCardPreferences) == null ? void 0 : T.slotIndex) ?? 0;
225
+ a[0] = {
226
+ ...a[0],
227
+ type: a[0].type,
228
+ customCardPreferences: {
229
+ ...s,
230
+ slotIndex: c
231
+ }
232
+ };
233
+ }
234
+ const f = a.findIndex(
235
+ (c) => {
236
+ var l;
237
+ return !!((l = c.customCardPreferences) != null && l.url);
238
+ }
239
+ );
240
+ if (f > 0) {
241
+ const [c] = a.splice(f, 1);
242
+ a.unshift(c);
243
+ }
244
+ return a;
245
+ }
246
+ function _({
247
+ frame: e,
248
+ configCard: r,
249
+ isMultiInputVisual: t
250
+ }) {
251
+ var s;
252
+ if (!t || !r)
253
+ return e.cards;
254
+ const n = (s = r.customCardPreferences) == null ? void 0 : s.dataInputCardIds;
255
+ return n ? Object.keys(n).sort((d, y) => Number(d) - Number(y)).map((d) => {
256
+ var p;
257
+ const y = (p = n[d]) == null ? void 0 : p.cardId;
258
+ return e.cards.find((g) => g.id === y) || null;
259
+ }) : e.cards;
260
+ }
261
+ function j(e, r) {
262
+ return r && S(r, e.cards) ? r : e.cards.find((t) => S(t, e.cards)) || null;
263
+ }
264
+ function q(e, r) {
265
+ var s, d;
266
+ if (!e) return null;
267
+ const t = r == null ? void 0 : r.visualType;
268
+ if (t) return t;
269
+ if (r != null && r.slots && r.slots.length > 0 || ((r == null ? void 0 : r.minInputs) || 0) > 1 || ((r == null ? void 0 : r.maxInputs) || 0) > 1 || ((r == null ? void 0 : r.dataInputs) || []).length > 1)
270
+ return "multiple";
271
+ const n = (s = e.customCardPreferences) == null ? void 0 : s.visualType;
272
+ return n || ((d = e.customCardPreferences) != null && d.dataInputCardIds ? "multiple" : null);
273
+ }
274
+ function w(e) {
275
+ return e.visualType === "multiple" || e.slots && e.slots.length > 0 || (e.minInputs || 0) > 1 || (e.maxInputs || 0) > 1 || (e.dataInputs || []).length > 1 ? "multiple" : "single";
276
+ }
277
+ function z(e) {
278
+ return Array.isArray(e) ? { records: e } : e;
279
+ }
280
+ export {
281
+ V as a,
282
+ O as b,
283
+ R as c,
284
+ w as d,
285
+ Y as e,
286
+ j as f,
287
+ _ as g,
288
+ N as h,
289
+ S as i,
290
+ $ as j,
291
+ h as k,
292
+ v as l,
293
+ z as n,
294
+ q as r
295
+ };
@@ -1,5 +1,5 @@
1
1
  import { jsx as a, jsxs as n } from "react/jsx-runtime";
2
- import { E as o, F as i, S as d, B as s, a as c, U as l, D as t, A as h, C as f, b } from "./semaphor-ready-indicator-BxF96Yhv.js";
2
+ import { E as o, F as i, S as d, B as s, a as c, U as l, D as t, A as h, C as f, b } from "./semaphor-ready-indicator-CRm17oIP.js";
3
3
  function u(e) {
4
4
  if (typeof window > "u")
5
5
  return null;