react-semaphor 0.1.561 → 0.1.563

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 (138) hide show
  1. package/dist/analytics-protocol/index.js +452 -429
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +5 -5
  4. package/dist/brand-studio/index.js +9 -9
  5. package/dist/briefings/index.js +5 -5
  6. package/dist/chunks/{analytics-base-schemas-CB3oFAXk.js → analytics-base-schemas-BaIQrEzX.js} +139 -134
  7. package/dist/chunks/{assistant-chat-DiVHY3Hw.js → assistant-chat-iIp02_77.js} +104 -104
  8. package/dist/chunks/{bookmark-impact-CR09dpkn.js → bookmark-impact-D4Kl4amw.js} +2 -2
  9. package/dist/chunks/{bookmark-state-BusLpkb7.js → bookmark-state-CWeoGbrx.js} +25 -25
  10. package/dist/chunks/{braces-u8VorWJc.js → braces-DzgoQC64.js} +1 -1
  11. package/dist/chunks/{comparison-window-caption-DDsIWJYT.js → comparison-window-caption-D1EUXzaR.js} +562 -437
  12. package/dist/chunks/{context-TUjw9eqr.js → context-R31TSL5V.js} +1 -1
  13. package/dist/chunks/{dashboard-BRdZBPqr.js → dashboard-CmqeP3QZ.js} +1 -1
  14. package/dist/chunks/{dashboard-briefing-launcher-CgvTLndW.js → dashboard-briefing-launcher-TYlSW77S.js} +155 -154
  15. package/dist/chunks/{dashboard-controls-B4vfSzTF.js → dashboard-controls-B253nJS-.js} +970 -968
  16. package/dist/chunks/{dashboard-json-Y3MF59g7.js → dashboard-json-osQuinUZ.js} +5 -5
  17. package/dist/chunks/dates-DFY7Gfss.js +91 -0
  18. package/dist/chunks/{edit-dashboard-visual-DwjZcxj-.js → edit-dashboard-visual-CMar-NhA.js} +4636 -4681
  19. package/dist/chunks/{filter-reach-copy-bijwf_-b.js → filter-reach-copy-CvV7W5dd.js} +1470 -1101
  20. package/dist/chunks/{filter-value-text-DFnhwuEW.js → filter-value-text-CPwFkrMz.js} +11 -10
  21. package/dist/chunks/{global-date-filter-utils-BXgCpvQM.js → global-date-filter-utils-N1kcsOFE.js} +8997 -7417
  22. package/dist/chunks/{index-ClwbY3BL.js → index-CNGkfUp4.js} +91 -85
  23. package/dist/chunks/{layout-grid-CtvCBfOm.js → layout-grid-BM65viQh.js} +1 -1
  24. package/dist/chunks/{list-filter-BklYgciR.js → list-filter-BoeLBfL3.js} +1 -1
  25. package/dist/chunks/{matrix-analytical-definition-pU51-JmY.js → matrix-analytical-definition-hEucouWM.js} +4 -4
  26. package/dist/chunks/{matrix-card-CUorIB7Q.js → matrix-card-CCh9JjP1.js} +3 -3
  27. package/dist/chunks/{matrix-member-presentation-Df5UgCGN.js → matrix-member-presentation-DsAUbuoL.js} +1 -1
  28. package/dist/chunks/{matrix-operation-contract-BSiGEXVC.js → matrix-operation-contract-DsLdFdSa.js} +339 -330
  29. package/dist/chunks/{metric-comparison-95aC0uEO.js → metric-comparison-Bnso1cm1.js} +2 -2
  30. package/dist/chunks/{model-change-B5wQhg5G.js → model-change-T1cRkh3m.js} +1 -1
  31. package/dist/chunks/{palette-DTnMhipt.js → palette-p1XSJFgB.js} +1 -1
  32. package/dist/chunks/{pivot-result-contract-expectations-Bo-86vwS.js → pivot-result-contract-expectations-B53jqszr.js} +5 -5
  33. package/dist/chunks/{pivot-result-identity-olvXJoB9.js → pivot-result-identity-Dq5jm-EC.js} +1 -1
  34. package/dist/chunks/{zoned-wall-clock-CGLVI40Q.js → raw-temporal-value-Bqz8wc7L.js} +97 -46
  35. package/dist/chunks/{report-preferences-dialog-C2YUIwKG.js → report-preferences-dialog-l54wJyYE.js} +68 -63
  36. package/dist/chunks/{report-runtime-context-DoIUr3MP.js → report-runtime-context-BITkNSDa.js} +2 -2
  37. package/dist/chunks/{resolve-dashboard-input-context-q_iiNXE1.js → resolve-dashboard-input-context-DaDrZGuA.js} +3455 -1744
  38. package/dist/chunks/{save-DH4RyrnG.js → save-CHV1B1fL.js} +1 -1
  39. package/dist/chunks/{saved-dashboard-context-8jqfI7hI.js → saved-dashboard-context-DFYBrE6O.js} +94 -95
  40. package/dist/chunks/{selection-filter-compiler-BKXmyLrS.js → selection-filter-compiler-CUDRnUxc.js} +19 -18
  41. package/dist/chunks/{selection-reducer-CV7K4FI6.js → selection-reducer-Bz5aywT4.js} +1 -1
  42. package/dist/chunks/{semaphor-ready-indicator-E2XWyibu.js → semaphor-ready-indicator-C3EQEiD9.js} +36434 -37732
  43. package/dist/chunks/{shelf-drop-preview-context-C29EUzDp.js → shelf-drop-preview-context-BODiBlqT.js} +81 -82
  44. package/dist/chunks/{source-entity-resolution-BXI3nQ5Z.js → source-entity-resolution-DdDVXFB8.js} +6 -6
  45. package/dist/chunks/{switch-balDSHc7.js → switch-BW4yXSYs.js} +3 -3
  46. package/dist/chunks/{table-export-sheet-CK8tvh4d.js → table-export-sheet-bSXxGn-v.js} +1 -1
  47. package/dist/chunks/{temporal-input-presentation-B77JsAzU.js → temporal-input-presentation-sk9gqLi6.js} +699 -741
  48. package/dist/chunks/{token-types-DhYH5YKb.js → token-types-BUK06hU2.js} +1 -1
  49. package/dist/chunks/{upload-Ufj8vjyn.js → upload-BnmuyPqW.js} +1 -1
  50. package/dist/chunks/{use-create-flow-overlay-state-9WsnzEO5.js → use-create-flow-overlay-state-BXY8-Cyz.js} +6 -6
  51. package/dist/chunks/{validators-BtaCFIEB.js → validators-BIM0FE31.js} +764 -885
  52. package/dist/dashboard/index.js +2 -2
  53. package/dist/dashboard-authoring/index.js +2278 -3030
  54. package/dist/data-app-sdk/index.js +43 -43
  55. package/dist/data-app-sdk-adapters/index.js +3 -3
  56. package/dist/data-app-sdk-validation/index.js +22 -22
  57. package/dist/format-utils/index.js +215 -209
  58. package/dist/index.js +225 -224
  59. package/dist/report-runtime-context/index.js +2 -2
  60. package/dist/style.css +1 -1
  61. package/dist/surfboard/index.js +2 -2
  62. package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
  63. package/dist/types/components/dashboard/dashboard-create-dialog.d.ts +23 -0
  64. package/dist/types/components/index.d.ts +1 -2
  65. package/dist/types/components/surfboard/filter/types.d.ts +3 -1
  66. package/dist/types/index.js +5 -5
  67. package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +59 -2
  68. package/dist/types/lib/interactions/get-click-context-from-matrix.d.ts +5 -0
  69. package/dist/types/lib/interactions/get-click-context-from-table.d.ts +45 -0
  70. package/dist/types/lib/print/print-inputs.d.ts +2 -1
  71. package/dist/types/lib/query-context/assemble-card-query.d.ts +2 -0
  72. package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +5 -0
  73. package/dist/types/lib/selection/selection-from-click-context.d.ts +41 -0
  74. package/dist/types/lib/types/common-types.d.ts +6 -0
  75. package/dist/types/lib/types/explorer-types.d.ts +7 -1
  76. package/dist/types/lib/types/interaction-types.d.ts +3 -1
  77. package/dist/types/lib/types/token-types.d.ts +0 -1
  78. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +3 -1
  79. package/dist/types/shared/analytics-protocol/contracts.d.ts +9 -40
  80. package/dist/types/shared/analytics-protocol/selection-contract.d.ts +12 -2
  81. package/dist/types/shared/analytics-protocol/validators.d.ts +1 -2
  82. package/dist/types/shared/assistant-protocol/context.d.ts +8 -8
  83. package/dist/types/shared/dashboard-authoring/card-formats/sql-date-pattern.d.ts +7 -1
  84. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +24 -0
  85. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
  86. package/dist/types/shared/dashboard-authoring/card-settings/column-polarity-write.d.ts +5 -0
  87. package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +4 -2
  88. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +15 -0
  89. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +12 -1
  90. package/dist/types/shared/dashboard-authoring/card-settings/views.d.ts +5 -3
  91. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +3230 -4658
  92. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +24 -2
  93. package/dist/types/shared/dashboard-authoring/changes/field-ref.d.ts +91 -0
  94. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +7 -0
  95. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +27 -1
  96. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-create.d.ts +26 -0
  97. package/dist/types/shared/dashboard-authoring/click-to-filter-settings.d.ts +2 -1
  98. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
  99. package/dist/types/shared/dashboard-authoring/detail-date-presentation.d.ts +9 -0
  100. package/dist/types/shared/dashboard-authoring/index.d.ts +8 -6
  101. package/dist/types/shared/dashboard-authoring/measure-calculations/apply.d.ts +8 -0
  102. package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +16 -0
  103. package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +41 -0
  104. package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +17 -0
  105. package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +63 -0
  106. package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +16 -0
  107. package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +79 -0
  108. package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +934 -0
  109. package/dist/types/shared/dashboard-authoring/measure-calculations/sentences.d.ts +4 -0
  110. package/dist/types/shared/dashboard-authoring/measure-calculations/set.d.ts +11 -0
  111. package/dist/types/shared/dashboard-authoring/measure-calculations/transform.d.ts +63 -0
  112. package/dist/types/shared/dashboard-authoring/measure-calculations/window-transforms.d.ts +60 -0
  113. package/dist/types/shared/dashboard-authoring/new-card.d.ts +12 -1
  114. package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +2 -1
  115. package/dist/types/shared/dashboard-authoring/operations/operation-sentences.d.ts +46 -0
  116. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +52 -2
  117. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +13 -1
  118. package/dist/types/shared/dashboard-authoring/text-card-words/blocks.d.ts +58 -0
  119. package/dist/types/shared/dashboard-authoring/text-card-words/index.d.ts +55 -0
  120. package/dist/types/shared/dashboard-authoring/text-card-words/rich-content.d.ts +18 -0
  121. package/dist/types/shared/format-utils/document-print.d.ts +82 -0
  122. package/dist/types/shared/format-utils/index.d.ts +1 -0
  123. package/dist/types/shared/format-utils/raw-temporal.d.ts +2 -7
  124. package/dist/types/shared/temporal/index.d.ts +1 -0
  125. package/dist/types/shared/temporal/raw-temporal-equality.d.ts +19 -0
  126. package/dist/types/shared/temporal/raw-temporal-value.d.ts +29 -0
  127. package/dist/types/shared/temporal/zoned-wall-clock.d.ts +6 -0
  128. package/package.json +1 -1
  129. package/dist/chunks/custom-visual-inputs-DfolidZ9.js +0 -292
  130. package/dist/chunks/document-dashboard-inputs-CvBbFTUA.js +0 -1718
  131. package/dist/types/components/dashboard/ai-dashboard-create-dialog.d.ts +0 -38
  132. package/dist/types/components/dashboard/dashboard-create-template.d.ts +0 -10
  133. package/dist/types/lib/hooks/use-dashboard-authoring.d.ts +0 -49
  134. package/dist/types/shared/dashboard-authoring/artifact-compiler.d.ts +0 -6
  135. package/dist/types/shared/dashboard-authoring/contracts.d.ts +0 -106
  136. package/dist/types/shared/dashboard-authoring/protocol-adapter.d.ts +0 -7
  137. package/dist/types/shared/dashboard-authoring/source-matching.d.ts +0 -34
  138. package/dist/types/shared/dashboard-authoring/validators.d.ts +0 -2
@@ -0,0 +1,29 @@
1
+ import { RawTemporalValueKind } from '../analytics-protocol/contracts.js';
2
+ /** A raw date's calendar and clock fields as written; `fraction` is the digits after the second. */
3
+ export type RawTemporalFields = {
4
+ year: number;
5
+ month: number;
6
+ day: number;
7
+ hour: number;
8
+ minute: number;
9
+ second: number;
10
+ fraction: string;
11
+ };
12
+ export type ParsedRawTemporalValue = {
13
+ status: 'valid';
14
+ fields: RawTemporalFields;
15
+ instant?: Date;
16
+ } | {
17
+ status: 'invalid_shape';
18
+ } | {
19
+ status: 'out_of_range';
20
+ };
21
+ /**
22
+ * What a temporal literal is by its text alone: a calendar date, a wall-clock
23
+ * date-time with no zone, or an instant with a zone or offset. Undefined for
24
+ * any other text. Readers keep a date and a wall date-time as written; only an
25
+ * instant names a moment.
26
+ */
27
+ export declare function classifyTemporalLiteral(value: string): RawTemporalValueKind | undefined;
28
+ /** A raw date's text read strictly as its kind: the fields as written and, for an instant, the moment it names. */
29
+ export declare function parseRawTemporalValue(value: string, kind: RawTemporalValueKind): ParsedRawTemporalValue;
@@ -21,3 +21,9 @@ export declare function wallClockMilliseconds(wall: ZonedWallClockTime): number;
21
21
  * day, so the answer never depends on the machine.
22
22
  */
23
23
  export declare function zonedWallClockToInstant(wall: ZonedWallClockTime, tz: string): Date;
24
+ /**
25
+ * Every instant a wall-clock time names in a timezone, earliest first: one,
26
+ * two in the hour a daylight-saving change repeats, none in the hour it
27
+ * skips.
28
+ */
29
+ export declare function zonedWallClockOccurrences(wall: ZonedWallClockTime, tz: string): Date[];
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.561",
8
+ "version": "0.1.563",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -1,292 +0,0 @@
1
- import { v as F } from "./global-date-filter-utils-BXgCpvQM.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
- "detailTable",
24
- "kpi",
25
- "pyramid",
26
- "tornado",
27
- "range",
28
- "text",
29
- "funnel",
30
- "bullet",
31
- "heatmap",
32
- "treemap",
33
- "custom"
34
- ];
35
- function M(e) {
36
- return E.includes(e);
37
- }
38
- function x(e) {
39
- const r = e.position;
40
- if (typeof r == "number") return r;
41
- if (typeof r == "string") {
42
- const t = r.match(/\d+/);
43
- if (t) {
44
- const n = Number(t[0]);
45
- if (!Number.isNaN(n)) return n;
46
- }
47
- }
48
- return Number.POSITIVE_INFINITY;
49
- }
50
- function m(e) {
51
- if (typeof e == "number")
52
- return { kind: "number", start: e, end: e };
53
- if (typeof e == "string") {
54
- const r = e.match(/^(\d+)$/);
55
- if (r) {
56
- const s = Number(r[1]);
57
- return { kind: "number", start: s, end: s };
58
- }
59
- const t = e.match(/^(\d+)-(\d+)$/);
60
- if (t) {
61
- const s = Number(t[1]), d = Number(t[2]);
62
- return { kind: "range", start: s, end: d };
63
- }
64
- const n = e.match(/^(\d+)\+$/);
65
- if (n)
66
- return { kind: "dynamic", start: Number(n[1]), end: Number.POSITIVE_INFINITY };
67
- }
68
- return null;
69
- }
70
- function k(e) {
71
- return !e || e.length === 0 ? void 0 : [...e].sort(
72
- (t, n) => x(t) - x(n)
73
- )[0];
74
- }
75
- function N(e, r) {
76
- if (!e || e.length === 0) return;
77
- const t = [], n = [], s = [];
78
- e.forEach((i) => {
79
- const u = m(i.position);
80
- u && (u.kind === "number" ? t.push(i) : u.kind === "range" ? n.push(i) : u.kind === "dynamic" && s.push(i));
81
- });
82
- const d = t.find((i) => {
83
- const u = m(i.position);
84
- return (u == null ? void 0 : u.kind) === "number" && u.start === r;
85
- });
86
- if (d) return d;
87
- const p = n.sort(
88
- (i, u) => x(i) - x(u)
89
- ).find((i) => {
90
- const u = m(i.position);
91
- return (u == null ? void 0 : u.kind) === "range" && r >= u.start && r <= u.end;
92
- });
93
- if (p) return p;
94
- const a = s.map((i) => ({
95
- slot: i,
96
- parsed: m(i.position)
97
- })).filter((i) => {
98
- var u;
99
- return ((u = i.parsed) == null ? void 0 : u.kind) === "dynamic";
100
- }).sort(
101
- (i, u) => {
102
- var o, f;
103
- return (((o = i.parsed) == null ? void 0 : o.start) ?? 0) - (((f = u.parsed) == null ? void 0 : f.start) ?? 0);
104
- }
105
- ).filter((i) => {
106
- var u;
107
- return r >= (((u = i.parsed) == null ? void 0 : u.start) ?? 0);
108
- }).sort(
109
- (i, u) => {
110
- var o, f;
111
- return (((o = u.parsed) == null ? void 0 : o.start) ?? 0) - (((f = i.parsed) == null ? void 0 : f.start) ?? 0);
112
- }
113
- )[0];
114
- return a == null ? void 0 : a.slot;
115
- }
116
- function A(e, r) {
117
- const t = N(e, r);
118
- if (t)
119
- return h(t);
120
- }
121
- function V(e, r) {
122
- var n;
123
- const t = (n = e == null ? void 0 : e.customCardPreferences) == null ? void 0 : n.slotIndex;
124
- return typeof t == "number" ? t : r;
125
- }
126
- function S(e, r) {
127
- var t;
128
- if (!((t = e == null ? void 0 : e.customCardPreferences) != null && t.url))
129
- return !1;
130
- if (e.type === "custom" || e.customCardPreferences.visualType === "multiple" || e.customCardPreferences.dataInputCardIds || (e.customCardPreferences.minInputs || 0) > 1 || (e.customCardPreferences.maxInputs || 0) > 1)
131
- return !0;
132
- if (r && r.length > 1) {
133
- const n = r.filter(
134
- (s) => {
135
- var d;
136
- return typeof ((d = s.customCardPreferences) == null ? void 0 : d.slotIndex) == "number";
137
- }
138
- );
139
- if (n.length > 1 && n.some((s) => s.id !== e.id))
140
- return !0;
141
- }
142
- return !1;
143
- }
144
- function O(e) {
145
- const r = [];
146
- let t = -1;
147
- e.forEach((n, s) => {
148
- const d = V(n, s);
149
- d > t && (t = d), r[d] = n ?? null;
150
- });
151
- for (let n = 0; n <= t; n += 1)
152
- n in r || (r[n] = null);
153
- return r;
154
- }
155
- function $(e) {
156
- return e.map((r, t) => !r.customCardPreferences || r.customCardPreferences.slotIndex === t ? r : {
157
- ...r,
158
- customCardPreferences: {
159
- ...r.customCardPreferences,
160
- slotIndex: t
161
- }
162
- });
163
- }
164
- function v(e) {
165
- const r = k(e);
166
- if (r)
167
- return h(r);
168
- }
169
- function R(e, r, t) {
170
- if (!e) return;
171
- const n = A(t, r);
172
- return e.type === "custom" && n ? n : e.type;
173
- }
174
- function Y(e, r, t) {
175
- var T;
176
- const n = {
177
- dataSource: t.dataSource,
178
- connectionId: t.connectionId
179
- }, s = {
180
- type: "component",
181
- visualType: "multiple",
182
- url: r.url,
183
- componentName: r.name,
184
- icon: r.icon,
185
- pluginChartType: r.chartType,
186
- minInputs: r.minInputs,
187
- maxInputs: r.maxInputs
188
- }, d = r.minInputs || 1, p = e.map((c) => ({ slot: c, parsed: m(c.position) })).filter((c) => c.parsed !== null).reduce((c, l) => {
189
- const g = l.parsed.end;
190
- return Number.isFinite(g) ? Math.max(c, g) : c;
191
- }, -1), b = Math.max(d, p + 1), a = k(e), i = a ? x(a) : 0;
192
- let u = !1;
193
- const o = [];
194
- for (let c = 0; c < b; c += 1) {
195
- const l = N(e, c), g = h(l), I = !u && c === i, P = c, C = {
196
- ...n,
197
- id: F(),
198
- title: (I ? a == null ? void 0 : a.label : l == null ? void 0 : l.label) || `Tab ${c + 1}`,
199
- tabTitle: (I ? a == null ? void 0 : a.label : l == null ? void 0 : l.label) || `Tab ${c + 1}`,
200
- description: (I ? a == null ? void 0 : a.description : l == null ? void 0 : l.description) || "",
201
- type: g,
202
- sql: "",
203
- preferences: {
204
- onClickFilter: [{ columnIndex: 0, expression: "" }]
205
- },
206
- ...I && {
207
- customCardPreferences: {
208
- ...s,
209
- slotIndex: P
210
- }
211
- },
212
- ...!I && {
213
- customCardPreferences: {
214
- slotIndex: P
215
- }
216
- }
217
- };
218
- I && (u = !0), o.push(C);
219
- }
220
- if (!u && o.length > 0) {
221
- const c = ((T = o[0].customCardPreferences) == null ? void 0 : T.slotIndex) ?? 0;
222
- o[0] = {
223
- ...o[0],
224
- type: o[0].type,
225
- customCardPreferences: {
226
- ...s,
227
- slotIndex: c
228
- }
229
- };
230
- }
231
- const f = o.findIndex(
232
- (c) => {
233
- var l;
234
- return !!((l = c.customCardPreferences) != null && l.url);
235
- }
236
- );
237
- if (f > 0) {
238
- const [c] = o.splice(f, 1);
239
- o.unshift(c);
240
- }
241
- return o;
242
- }
243
- function _({
244
- frame: e,
245
- configCard: r,
246
- isMultiInputVisual: t
247
- }) {
248
- var s;
249
- if (!t || !r)
250
- return e.cards;
251
- const n = (s = r.customCardPreferences) == null ? void 0 : s.dataInputCardIds;
252
- return n ? Object.keys(n).sort((d, y) => Number(d) - Number(y)).map((d) => {
253
- var p;
254
- const y = (p = n[d]) == null ? void 0 : p.cardId;
255
- return e.cards.find((b) => b.id === y) || null;
256
- }) : e.cards;
257
- }
258
- function j(e, r) {
259
- return r && S(r, e.cards) ? r : e.cards.find((t) => S(t, e.cards)) || null;
260
- }
261
- function q(e, r) {
262
- var s, d;
263
- if (!e) return null;
264
- const t = r == null ? void 0 : r.visualType;
265
- if (t) return t;
266
- 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)
267
- return "multiple";
268
- const n = (s = e.customCardPreferences) == null ? void 0 : s.visualType;
269
- return n || ((d = e.customCardPreferences) != null && d.dataInputCardIds ? "multiple" : null);
270
- }
271
- function w(e) {
272
- return e.visualType === "multiple" || e.slots && e.slots.length > 0 || (e.minInputs || 0) > 1 || (e.maxInputs || 0) > 1 || (e.dataInputs || []).length > 1 ? "multiple" : "single";
273
- }
274
- function z(e) {
275
- return Array.isArray(e) ? { records: e } : e;
276
- }
277
- export {
278
- V as a,
279
- O as b,
280
- R as c,
281
- w as d,
282
- Y as e,
283
- j as f,
284
- _ as g,
285
- N as h,
286
- S as i,
287
- $ as j,
288
- h as k,
289
- v as l,
290
- z as n,
291
- q as r
292
- };