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,323 +0,0 @@
1
- let T;
2
- const E = new Uint8Array(16);
3
- function F() {
4
- if (!T && (T = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !T))
5
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
6
- return T(E);
7
- }
8
- const a = [];
9
- for (let e = 0; e < 256; ++e)
10
- a.push((e + 256).toString(16).slice(1));
11
- function A(e, t = 0) {
12
- return a[e[t + 0]] + a[e[t + 1]] + a[e[t + 2]] + a[e[t + 3]] + "-" + a[e[t + 4]] + a[e[t + 5]] + "-" + a[e[t + 6]] + a[e[t + 7]] + "-" + a[e[t + 8]] + a[e[t + 9]] + "-" + a[e[t + 10]] + a[e[t + 11]] + a[e[t + 12]] + a[e[t + 13]] + a[e[t + 14]] + a[e[t + 15]];
13
- }
14
- const M = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), N = {
15
- randomUUID: M
16
- };
17
- function R(e, t, r) {
18
- if (N.randomUUID && !e)
19
- return N.randomUUID();
20
- e = e || {};
21
- const n = e.random || (e.rng || F)();
22
- return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, A(n);
23
- }
24
- function S(e) {
25
- if (!(e != null && e.expectedType)) return "table";
26
- const t = Array.isArray(e.expectedType) ? e.expectedType[0] : e.expectedType;
27
- return w(t) ? t : "table";
28
- }
29
- const v = [
30
- "bar",
31
- "horizontalBar",
32
- "line",
33
- "area",
34
- "stackedArea",
35
- "combo",
36
- "pie",
37
- "doughnut",
38
- "radar",
39
- "polarArea",
40
- "bubble",
41
- "scatter",
42
- "stackedBar",
43
- "stackedLine",
44
- "table",
45
- "pivotTable",
46
- "aggregateTable",
47
- "detailTable",
48
- "kpi",
49
- "pyramid",
50
- "tornado",
51
- "range",
52
- "text",
53
- "map",
54
- "funnel",
55
- "bullet",
56
- "heatmap",
57
- "treemap",
58
- "custom"
59
- ];
60
- function w(e) {
61
- return v.includes(e);
62
- }
63
- function x(e) {
64
- const t = e.position;
65
- if (typeof t == "number") return t;
66
- if (typeof t == "string") {
67
- const r = t.match(/\d+/);
68
- if (r) {
69
- const n = Number(r[0]);
70
- if (!Number.isNaN(n)) return n;
71
- }
72
- }
73
- return Number.POSITIVE_INFINITY;
74
- }
75
- function g(e) {
76
- if (typeof e == "number")
77
- return { kind: "number", start: e, end: e };
78
- if (typeof e == "string") {
79
- const t = e.match(/^(\d+)$/);
80
- if (t) {
81
- const s = Number(t[1]);
82
- return { kind: "number", start: s, end: s };
83
- }
84
- const r = e.match(/^(\d+)-(\d+)$/);
85
- if (r) {
86
- const s = Number(r[1]), d = Number(r[2]);
87
- return { kind: "range", start: s, end: d };
88
- }
89
- const n = e.match(/^(\d+)\+$/);
90
- if (n)
91
- return { kind: "dynamic", start: Number(n[1]), end: Number.POSITIVE_INFINITY };
92
- }
93
- return null;
94
- }
95
- function V(e) {
96
- return !e || e.length === 0 ? void 0 : [...e].sort(
97
- (r, n) => x(r) - x(n)
98
- )[0];
99
- }
100
- function U(e, t) {
101
- if (!e || e.length === 0) return;
102
- const r = [], n = [], s = [];
103
- e.forEach((c) => {
104
- const u = g(c.position);
105
- u && (u.kind === "number" ? r.push(c) : u.kind === "range" ? n.push(c) : u.kind === "dynamic" && s.push(c));
106
- });
107
- const d = r.find((c) => {
108
- const u = g(c.position);
109
- return (u == null ? void 0 : u.kind) === "number" && u.start === t;
110
- });
111
- if (d) return d;
112
- const I = n.sort(
113
- (c, u) => x(c) - x(u)
114
- ).find((c) => {
115
- const u = g(c.position);
116
- return (u == null ? void 0 : u.kind) === "range" && t >= u.start && t <= u.end;
117
- });
118
- if (I) return I;
119
- const l = s.map((c) => ({
120
- slot: c,
121
- parsed: g(c.position)
122
- })).filter((c) => {
123
- var u;
124
- return ((u = c.parsed) == null ? void 0 : u.kind) === "dynamic";
125
- }).sort(
126
- (c, u) => {
127
- var o, f;
128
- return (((o = c.parsed) == null ? void 0 : o.start) ?? 0) - (((f = u.parsed) == null ? void 0 : f.start) ?? 0);
129
- }
130
- ).filter((c) => {
131
- var u;
132
- return t >= (((u = c.parsed) == null ? void 0 : u.start) ?? 0);
133
- }).sort(
134
- (c, u) => {
135
- var o, f;
136
- return (((o = u.parsed) == null ? void 0 : o.start) ?? 0) - (((f = c.parsed) == null ? void 0 : f.start) ?? 0);
137
- }
138
- )[0];
139
- return l == null ? void 0 : l.slot;
140
- }
141
- function O(e, t) {
142
- const r = U(e, t);
143
- if (r)
144
- return S(r);
145
- }
146
- function $(e, t) {
147
- var n;
148
- const r = (n = e == null ? void 0 : e.customCardPreferences) == null ? void 0 : n.slotIndex;
149
- return typeof r == "number" ? r : t;
150
- }
151
- function D(e, t) {
152
- var r;
153
- if (!((r = e == null ? void 0 : e.customCardPreferences) != null && r.url))
154
- return !1;
155
- if (e.type === "custom" || e.customCardPreferences.visualType === "multiple" || e.customCardPreferences.dataInputCardIds || (e.customCardPreferences.minInputs || 0) > 1 || (e.customCardPreferences.maxInputs || 0) > 1)
156
- return !0;
157
- if (t && t.length > 1) {
158
- const n = t.filter(
159
- (s) => {
160
- var d;
161
- return typeof ((d = s.customCardPreferences) == null ? void 0 : d.slotIndex) == "number";
162
- }
163
- );
164
- if (n.length > 1 && n.some((s) => s.id !== e.id))
165
- return !0;
166
- }
167
- return !1;
168
- }
169
- function j(e) {
170
- const t = [];
171
- let r = -1;
172
- e.forEach((n, s) => {
173
- const d = $(n, s);
174
- d > r && (r = d), t[d] = n ?? null;
175
- });
176
- for (let n = 0; n <= r; n += 1)
177
- n in t || (t[n] = null);
178
- return t;
179
- }
180
- function Y(e) {
181
- return e.map((t, r) => !t.customCardPreferences || t.customCardPreferences.slotIndex === r ? t : {
182
- ...t,
183
- customCardPreferences: {
184
- ...t.customCardPreferences,
185
- slotIndex: r
186
- }
187
- });
188
- }
189
- function _(e) {
190
- const t = V(e);
191
- if (t)
192
- return S(t);
193
- }
194
- function q(e, t, r) {
195
- if (!e) return;
196
- const n = O(r, t);
197
- return e.type === "custom" && n ? n : e.type;
198
- }
199
- function z(e, t, r) {
200
- var P;
201
- const n = {
202
- dataSource: r.dataSource,
203
- connectionId: r.connectionId,
204
- lastSelectedDatabase: r.lastSelectedDatabase,
205
- lastSelectedSchema: r.lastSelectedSchema,
206
- lastSelectedTable: r.lastSelectedTable,
207
- lastSelectedDatamodelId: r.lastSelectedDatamodelId,
208
- datamodelId: r.datamodelId
209
- }, s = {
210
- type: "component",
211
- visualType: "multiple",
212
- url: t.url,
213
- componentName: t.name,
214
- icon: t.icon,
215
- pluginChartType: t.chartType,
216
- minInputs: t.minInputs,
217
- maxInputs: t.maxInputs
218
- }, d = t.minInputs || 1, I = e.map((i) => ({ slot: i, parsed: g(i.position) })).filter((i) => i.parsed !== null).reduce((i, p) => {
219
- const h = p.parsed.end;
220
- return Number.isFinite(h) ? Math.max(i, h) : i;
221
- }, -1), b = Math.max(d, I + 1), l = V(e), c = l ? x(l) : 0;
222
- let u = !1;
223
- const o = [];
224
- for (let i = 0; i < b; i += 1) {
225
- const p = U(e, i), h = S(p), m = !u && i === c, k = i, C = {
226
- ...n,
227
- id: R(),
228
- title: (m ? l == null ? void 0 : l.label : p == null ? void 0 : p.label) || `Tab ${i + 1}`,
229
- tabTitle: (m ? l == null ? void 0 : l.label : p == null ? void 0 : p.label) || `Tab ${i + 1}`,
230
- description: (m ? l == null ? void 0 : l.description : p == null ? void 0 : p.description) || "",
231
- type: h,
232
- sql: "",
233
- preferences: {
234
- onClickFilter: [{ columnIndex: 0, expression: "" }]
235
- },
236
- ...m && {
237
- customCardPreferences: {
238
- ...s,
239
- slotIndex: k
240
- }
241
- },
242
- ...!m && {
243
- customCardPreferences: {
244
- slotIndex: k
245
- }
246
- }
247
- };
248
- m && (u = !0), o.push(C);
249
- }
250
- if (!u && o.length > 0) {
251
- const i = ((P = o[0].customCardPreferences) == null ? void 0 : P.slotIndex) ?? 0;
252
- o[0] = {
253
- ...o[0],
254
- type: o[0].type,
255
- customCardPreferences: {
256
- ...s,
257
- slotIndex: i
258
- }
259
- };
260
- }
261
- const f = o.findIndex(
262
- (i) => {
263
- var p;
264
- return !!((p = i.customCardPreferences) != null && p.url);
265
- }
266
- );
267
- if (f > 0) {
268
- const [i] = o.splice(f, 1);
269
- o.unshift(i);
270
- }
271
- return o;
272
- }
273
- function B({
274
- frame: e,
275
- configCard: t,
276
- isMultiInputVisual: r
277
- }) {
278
- var s;
279
- if (!r || !t)
280
- return e.cards;
281
- const n = (s = t.customCardPreferences) == null ? void 0 : s.dataInputCardIds;
282
- return n ? Object.keys(n).sort((d, y) => Number(d) - Number(y)).map((d) => {
283
- var I;
284
- const y = (I = n[d]) == null ? void 0 : I.cardId;
285
- return e.cards.find((b) => b.id === y) || null;
286
- }) : e.cards;
287
- }
288
- function H(e, t) {
289
- return t && D(t, e.cards) ? t : e.cards.find((r) => D(r, e.cards)) || null;
290
- }
291
- function L(e, t) {
292
- var s, d;
293
- if (!e) return null;
294
- const r = t == null ? void 0 : t.visualType;
295
- if (r) return r;
296
- if (t != null && t.slots && t.slots.length > 0 || ((t == null ? void 0 : t.minInputs) || 0) > 1 || ((t == null ? void 0 : t.maxInputs) || 0) > 1 || ((t == null ? void 0 : t.dataInputs) || []).length > 1)
297
- return "multiple";
298
- const n = (s = e.customCardPreferences) == null ? void 0 : s.visualType;
299
- return n || ((d = e.customCardPreferences) != null && d.dataInputCardIds ? "multiple" : null);
300
- }
301
- function G(e) {
302
- return e.visualType === "multiple" || e.slots && e.slots.length > 0 || (e.minInputs || 0) > 1 || (e.maxInputs || 0) > 1 || (e.dataInputs || []).length > 1 ? "multiple" : "single";
303
- }
304
- function J(e) {
305
- return Array.isArray(e) ? { records: e } : e;
306
- }
307
- export {
308
- $ as a,
309
- j as b,
310
- q as c,
311
- G as d,
312
- z as e,
313
- H as f,
314
- B as g,
315
- U as h,
316
- D as i,
317
- Y as j,
318
- S as k,
319
- _ as l,
320
- J as n,
321
- L as r,
322
- R as v
323
- };