react-semaphor 0.1.563 → 0.1.564

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 (33) hide show
  1. package/dist/assistant-context/index.js +1 -1
  2. package/dist/briefings/index.js +1 -1
  3. package/dist/chunks/{assistant-chat-iIp02_77.js → assistant-chat-D1BEEHUF.js} +103 -103
  4. package/dist/chunks/{bookmark-impact-D4Kl4amw.js → bookmark-impact-XOsVUAqW.js} +1 -1
  5. package/dist/chunks/{dashboard-CmqeP3QZ.js → dashboard-DfYsASNd.js} +1 -1
  6. package/dist/chunks/{dashboard-briefing-launcher-TYlSW77S.js → dashboard-briefing-launcher-lvYfJoUQ.js} +1429 -1379
  7. package/dist/chunks/{dashboard-controls-B253nJS-.js → dashboard-controls-CJ8Dz50D.js} +58 -58
  8. package/dist/chunks/{dashboard-json-osQuinUZ.js → dashboard-json-D3uZxGO-.js} +1 -1
  9. package/dist/chunks/{dates-DFY7Gfss.js → dates-EvDtT25n.js} +5 -5
  10. package/dist/chunks/{edit-dashboard-visual-CMar-NhA.js → edit-dashboard-visual-CgHJXBQv.js} +8 -8
  11. package/dist/chunks/{filter-reach-copy-CvV7W5dd.js → filter-reach-copy-Cmb05jlE.js} +106 -106
  12. package/dist/chunks/{global-date-filter-utils-N1kcsOFE.js → global-date-filter-utils-ruJYwjgZ.js} +3034 -3023
  13. package/dist/chunks/{index-CNGkfUp4.js → index-CAgf2x4E.js} +2 -2
  14. package/dist/chunks/index-RNaTnE3m.js +585 -0
  15. package/dist/chunks/{report-preferences-dialog-l54wJyYE.js → report-preferences-dialog-DMqxSU4X.js} +7 -7
  16. package/dist/chunks/{resolve-dashboard-input-context-DaDrZGuA.js → resolve-dashboard-input-context-i_jCSYae.js} +370 -370
  17. package/dist/chunks/{saved-dashboard-context-DFYBrE6O.js → saved-dashboard-context-Dg3oDmH_.js} +2 -2
  18. package/dist/chunks/{semaphor-ready-indicator-C3EQEiD9.js → semaphor-ready-indicator-CFeCIuaw.js} +8045 -8041
  19. package/dist/chunks/{shelf-drop-preview-context-BODiBlqT.js → shelf-drop-preview-context-cEyVkKTF.js} +2 -2
  20. package/dist/chunks/{use-create-flow-overlay-state-BXY8-Cyz.js → use-create-flow-overlay-state-Dl6DCxh8.js} +2 -2
  21. package/dist/dashboard/index.js +1 -1
  22. package/dist/dashboard-authoring/index.js +615 -594
  23. package/dist/index.js +13 -13
  24. package/dist/layouts/index.js +1 -1
  25. package/dist/surfboard/index.js +1 -1
  26. package/dist/types/components/activity/activity-bell.d.ts +5 -1
  27. package/dist/types/components/activity/activity-types.d.ts +12 -4
  28. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +6 -1
  29. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +1 -1
  30. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +8 -1
  31. package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +1 -1
  32. package/package.json +1 -1
  33. package/dist/chunks/index-CJW5BdWT.js +0 -583
@@ -9,12 +9,12 @@ import { ah as Pe, aj as Ve, X as ze } from "./matrix-operation-contract-DsLdFdS
9
9
  import "./analytics-base-schemas-BaIQrEzX.js";
10
10
  import "../value-format-preferences/index.js";
11
11
  import { r as je } from "./rendered-file-D8xEuVVx.js";
12
- import { Q as qe, R as Ke, S as He, T as Ge, n as We, U as Xe, V as Ze, W as Ye, X as Je, Y as Qe, Z as et, _ as tt, $ as nt } from "./global-date-filter-utils-N1kcsOFE.js";
12
+ import { Q as qe, R as Ke, S as He, T as Ge, n as We, U as Xe, V as Ze, W as Ye, X as Je, Y as Qe, Z as et, _ as tt, $ as nt } from "./global-date-filter-utils-ruJYwjgZ.js";
13
13
  import { r as rt } from "./matrix-card-CCh9JjP1.js";
14
14
  import { A as ot } from "./bookmark-state-CWeoGbrx.js";
15
15
  import "./index-CuHybtft.js";
16
16
  import "./_commonjsHelpers-DimLPMtv.js";
17
- import "./index-CJW5BdWT.js";
17
+ import "./index-RNaTnE3m.js";
18
18
  import "./context-R31TSL5V.js";
19
19
  const at = /* @__PURE__ */ new Set(["table", "detailTable"]), it = /* @__PURE__ */ new Set([
20
20
  "bar",
@@ -0,0 +1,585 @@
1
+ const v = {
2
+ /** Widest first. */
3
+ breakpoints: ["lg", "md", "sm", "xs", "xxs"],
4
+ columns: { lg: 48, md: 36, sm: 24, xs: 12, xxs: 6 },
5
+ /** react-grid-layout's default breakpoint widths, now stated. */
6
+ minContainerWidthPx: { lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0 },
7
+ editable: ["lg", "sm", "xs"],
8
+ customizable: ["sm", "xs"],
9
+ /** The preview canvas widths: Laptop, Tablet, Phone, Small phone (Desktop is at least `minContainerWidthPx.lg`; RL-D19). */
10
+ previewWidthPx: { md: 1024, sm: 820, xs: 390, xxs: 360 }
11
+ }, b = v.columns.lg;
12
+ function J(n) {
13
+ return n === "sm" || n === "xs";
14
+ }
15
+ function Mt(n) {
16
+ return n === "lg" || J(n);
17
+ }
18
+ function kt(n) {
19
+ return n === "md" || Mt(n);
20
+ }
21
+ const vt = [
22
+ "table",
23
+ "matrixTable",
24
+ "detailTable"
25
+ ], Wt = new Set(vt);
26
+ function _t(n) {
27
+ return typeof n == "string" && Wt.has(n);
28
+ }
29
+ function Ht(n) {
30
+ var t, i;
31
+ return ((t = n == null ? void 0 : n.cards) == null ? void 0 : t.find((o) => o.id === n.activeCardId)) ?? ((i = n == null ? void 0 : n.cards) == null ? void 0 : i[0]);
32
+ }
33
+ function U(n) {
34
+ var i;
35
+ const t = (i = Ht(n)) == null ? void 0 : i.type;
36
+ return t === "kpi" ? "kpi" : t === "text" ? "text" : _t(t) ? "table" : "chart";
37
+ }
38
+ function nt(n) {
39
+ return n === "kpi" || n === "text" ? "short" : "tall";
40
+ }
41
+ const R = {
42
+ kpi: { h: 15, minH: 12, minW: 6 },
43
+ chart: { h: 30, minH: 16, minW: 12 },
44
+ table: { h: 38, minH: 18, minW: 12 },
45
+ text: { h: 10, minH: 8, minW: 12 }
46
+ }, T = {
47
+ kpi: 48,
48
+ chart: 24,
49
+ table: 48,
50
+ text: 48
51
+ };
52
+ function q(n) {
53
+ if (n <= 0) return [];
54
+ const t = Math.ceil(n / 4), i = Math.floor(n / t), o = n % t;
55
+ return Array.from({ length: t }, (e, r) => r < o ? i + 1 : i).flatMap(
56
+ (e) => Array.from({ length: e }, () => 48 / e)
57
+ );
58
+ }
59
+ const st = {
60
+ full: 48,
61
+ half: 24,
62
+ third: 16,
63
+ quarter: 12
64
+ }, zt = ["full", "half", "third", "quarter"];
65
+ function It(n) {
66
+ let t = "full", i = 1 / 0;
67
+ for (const o of zt) {
68
+ const e = Math.abs(st[o] - n);
69
+ e < i && (t = o, i = e);
70
+ }
71
+ return t;
72
+ }
73
+ function P(n, t) {
74
+ return !(n.i === t.i || n.x + n.w <= t.x || n.x >= t.x + t.w || n.y + n.h <= t.y || n.y >= t.y + t.h);
75
+ }
76
+ function O(n) {
77
+ let t = 0;
78
+ for (const i of n) t = Math.max(t, i.y + i.h);
79
+ return t;
80
+ }
81
+ function it(n, t) {
82
+ for (const i of n) if (P(i, t)) return i;
83
+ }
84
+ function Ot(n) {
85
+ return n.slice().sort((t, i) => t.y > i.y || t.y === i.y && t.x > i.x ? 1 : t.y === i.y && t.x === i.x ? 0 : -1);
86
+ }
87
+ function at(n, t, i) {
88
+ t.y += 1;
89
+ const o = n.findIndex((e) => e.i === t.i);
90
+ for (let e = o + 1; e < n.length; e += 1) {
91
+ const r = n[e];
92
+ if (!r.static) {
93
+ if (r.y > t.y + t.h) break;
94
+ P(t, r) && at(n, r, i + t.h);
95
+ }
96
+ }
97
+ t.y = i;
98
+ }
99
+ function At(n, t, i) {
100
+ for (t.y = Math.min(O(n), t.y); t.y > 0 && !it(n, t); ) t.y -= 1;
101
+ let o;
102
+ for (; o = it(n, t); )
103
+ at(i, t, o.y + o.h);
104
+ return t.y = Math.max(t.y, 0), t.x = Math.max(t.x, 0), t;
105
+ }
106
+ function g(n) {
107
+ const t = n.map((r) => ({ ...r })), i = t.filter((r) => r.static), o = Ot(t), e = /* @__PURE__ */ new Map();
108
+ for (const r of o) {
109
+ let s = { ...r };
110
+ s.static || (s = At(i, s, o), i.push(s)), e.set(r, s);
111
+ }
112
+ return t.map((r) => e.get(r));
113
+ }
114
+ function Et(n) {
115
+ return g(n).every((i, o) => i.y === n[o].y && i.x === n[o].x);
116
+ }
117
+ function St(n) {
118
+ for (let t = 0; t < n.length; t += 1)
119
+ for (let i = t + 1; i < n.length; i += 1)
120
+ if (P(n[t], n[i])) return !0;
121
+ return !1;
122
+ }
123
+ function A(n, t) {
124
+ const i = (o) => t.get(o.i) ?? Number.MAX_SAFE_INTEGER;
125
+ return n.slice().sort((o, e) => o.y - e.y || o.x - e.x || i(o) - i(e));
126
+ }
127
+ function F(n) {
128
+ const t = [];
129
+ let i = [], o = 0;
130
+ for (const e of n) {
131
+ const r = i[i.length - 1];
132
+ if (r && e.x >= r.x + r.w && o + e.w <= b) {
133
+ i.push(e), o += e.w;
134
+ continue;
135
+ }
136
+ i.length && t.push(i), i = [e], o = e.w;
137
+ }
138
+ return i.length && t.push(i), t;
139
+ }
140
+ function Bt(n) {
141
+ return new Map(n.map((t, i) => [t, i]));
142
+ }
143
+ function Lt(n, t, i, o) {
144
+ const e = (c) => t.get(c) ?? "chart", r = A(n, i).map((c) => c.i), s = r.find((c) => e(c) === "text"), a = o ? r : [
145
+ ...s ? [s] : [],
146
+ ...r.filter((c) => e(c) === "kpi"),
147
+ ...r.filter((c) => e(c) === "chart"),
148
+ ...r.filter((c) => e(c) === "table"),
149
+ ...r.filter((c) => e(c) === "text" && c !== s)
150
+ ], f = (c) => {
151
+ const m = a[c];
152
+ if (!o) return a.filter((M) => e(M) === e(m));
153
+ let h = c;
154
+ for (; h > 0 && e(a[h - 1]) === e(m); ) h -= 1;
155
+ let l = c;
156
+ for (; l < a.length - 1 && e(a[l + 1]) === e(m); ) l += 1;
157
+ return a.slice(h, l + 1);
158
+ }, y = (c) => {
159
+ const m = a[c], h = e(m);
160
+ if (h === "table") return b;
161
+ if (h === "text") return m === s ? b : b / 2;
162
+ const l = f(c);
163
+ if (h === "kpi") return q(l.length)[l.indexOf(m)];
164
+ const M = l.indexOf(m);
165
+ return l.length === 1 || l.length % 2 === 1 && M === 0 ? b : b / 2;
166
+ };
167
+ let x = 0, d = 0, u = 0;
168
+ const p = a.map((c, m) => {
169
+ const h = R[e(c)], l = Math.min(y(m), b);
170
+ x > 0 && x + l > b && (x = 0, d += u, u = 0);
171
+ const M = { i: c, x, y: d, w: l, h: h.h, minW: Math.min(h.minW, b), minH: h.minH };
172
+ return x += l, u = Math.max(u, h.h), M;
173
+ });
174
+ return { items: g(p), order: a };
175
+ }
176
+ function C(n) {
177
+ return Math.floor(n + 0.5);
178
+ }
179
+ function ft(n, t, i, o, e, r) {
180
+ const s = v.columns[t], a = { i: n.i, x: i, y: o, w: e, h: n.h }, f = r ?? n.minW;
181
+ return f !== void 0 && (a.minW = Math.max(1, Math.min(f, e, s))), n.minH !== void 0 && (a.minH = n.minH), n.maxW !== void 0 && (a.maxW = Math.max(e, Math.min(n.maxW, s))), n.maxH !== void 0 && (a.maxH = n.maxH), n.static !== void 0 && (a.static = n.static), n.isResizable !== void 0 && (a.isResizable = n.isResizable), n.isDraggable !== void 0 && (a.isDraggable = n.isDraggable), a;
182
+ }
183
+ function ct(n) {
184
+ return g(
185
+ n.map((t) => {
186
+ let i = C(t.x * 0.75), e = C((t.x + t.w) * 0.75) - i;
187
+ e === 0 && (e = 1, i === 36 && (i = 35));
188
+ const r = t.minW === void 0 ? void 0 : Math.min(Math.max(1, C(t.minW * 0.75)), e);
189
+ return ft(t, "md", i, t.y, e, r);
190
+ })
191
+ );
192
+ }
193
+ function Tt(n, t) {
194
+ const i = new Map(ct(n).map((r) => [r.i, r])), o = new Map(t.map((r) => [r.i, r])), e = v.columns.lg;
195
+ return n.map((r) => {
196
+ const s = o.get(r.i), a = i.get(r.i);
197
+ if (!s || !a) return r;
198
+ const f = { ...r };
199
+ if (s.x !== a.x || s.w !== a.w) {
200
+ const y = Math.min(e - 1, C(s.x * 1.3333333333333333)), x = Math.min(e, Math.max(y + 1, C((s.x + s.w) * (4 / 3))));
201
+ f.x = y, f.w = x - y;
202
+ }
203
+ return (s.y !== a.y || s.h !== a.h) && (f.y = s.y, f.h = s.h), f;
204
+ });
205
+ }
206
+ function K(n, t, i) {
207
+ const o = /* @__PURE__ */ new Map();
208
+ let e = 0;
209
+ for (const r of n) {
210
+ let s = 0;
211
+ for (const a of r)
212
+ o.set(a.source.i, ft(a.source, t, a.x, e, a.w)), s = Math.max(s, a.source.h);
213
+ e += s;
214
+ }
215
+ return g(i.map((r) => o.get(r.i)));
216
+ }
217
+ function ot(n, t, i) {
218
+ const o = [];
219
+ for (const e of n) {
220
+ let r;
221
+ const s = () => {
222
+ r && o.push([{ source: r, x: 0, w: t }]), r = void 0;
223
+ };
224
+ for (const a of e)
225
+ i(a) ? (s(), o.push([{ source: a, x: 0, w: t }])) : r ? (o.push([
226
+ { source: r, x: 0, w: t / 2 },
227
+ { source: a, x: t / 2, w: t / 2 }
228
+ ]), r = void 0) : r = a;
229
+ s();
230
+ }
231
+ return o;
232
+ }
233
+ function dt(n, t, i, o) {
234
+ if (n === "md") return ct(t);
235
+ const e = v.columns[n], r = F(A(t, o)), s = (a) => i.get(a.i) ?? "chart";
236
+ return n === "sm" ? K(ot(r, e, (a) => s(a) === "table" || s(a) === "text"), "sm", t) : n === "xs" ? K(ot(r, e, (a) => s(a) !== "kpi"), "xs", t) : K(
237
+ r.flatMap((a) => a.map((f) => [{ source: f, x: 0, w: e }])),
238
+ "xxs",
239
+ t
240
+ );
241
+ }
242
+ function H(n, t, i) {
243
+ const o = R[t];
244
+ return { i: n, x: 0, y: 0, w: i, h: o.h, minW: Math.min(o.minW, i), minH: o.minH };
245
+ }
246
+ function Y(n, t) {
247
+ return n.slice().sort((i, o) => (t.get(i.i) ?? 0) - (t.get(o.i) ?? 0));
248
+ }
249
+ function X(n, t, i) {
250
+ return n.map((o) => o.y >= t ? { ...o, y: o.y + i } : o);
251
+ }
252
+ function Ct(n, t, i) {
253
+ const o = (f, y) => !t.some((x) => P({ ...n, i: "\0", x: f, y }, x)), e = n.x + n.w;
254
+ if (e + n.w <= i && o(e, n.y)) return { x: e, y: n.y };
255
+ const r = Math.max(i - n.w, 0), s = n.y + n.h, a = [s, ...t.map((f) => f.y + f.h).filter((f) => f > s).sort((f, y) => f - y)];
256
+ for (const f of a)
257
+ for (let y = 0; y <= r; y += 1) if (o(y, f)) return { x: y, y: f };
258
+ return { x: 0, y: s };
259
+ }
260
+ function ut(n, t) {
261
+ const i = Math.max(1, Math.min(n.w, t));
262
+ return {
263
+ ...n,
264
+ w: i,
265
+ x: Math.max(0, Math.min(n.x, t - i)),
266
+ ...n.minW !== void 0 ? { minW: Math.max(1, Math.min(n.minW, i)) } : {},
267
+ ...n.maxW !== void 0 ? { maxW: Math.max(i, Math.min(n.maxW, t)) } : {}
268
+ };
269
+ }
270
+ function mt(n, t, i, o) {
271
+ const e = n.find((f) => f.i === t), r = ut(e, o), { x: s, y: a } = Ct(r, n.filter((f) => f.i !== t), o);
272
+ return [...n, { ...r, i, x: s, y: a }];
273
+ }
274
+ function $t(n, t, i, o, e) {
275
+ var p, c;
276
+ const r = o == null ? void 0 : o.position;
277
+ if (r && typeof r == "object" && "beside" in r)
278
+ return g(Y(mt(n, r.beside, t, b), e.frameOrder));
279
+ const s = o != null && o.width ? st[o.width] : void 0;
280
+ let a = n.slice();
281
+ const f = (m) => g(Y([...a, m], e.frameOrder));
282
+ if (r === "top") {
283
+ const m = H(t, i, s ?? T[i]);
284
+ return a = X(a, 0, m.h), f(m);
285
+ }
286
+ if (r === "end")
287
+ return f({ ...H(t, i, s ?? T[i]), y: O(a) });
288
+ const y = r === void 0 && s !== void 0, x = r && typeof r == "object" && "after" in r ? r.after : y ? (p = A(a, e.frameOrder).at(-1)) == null ? void 0 : p.i : void 0;
289
+ if (y && x === void 0) return f(H(t, i, s));
290
+ if (x !== void 0) {
291
+ const m = H(t, i, s ?? T[i]), l = F(A(a, e.frameOrder)).find((W) => W.some((k) => k.i === x)), M = l.find((W) => W.i === x), z = l[l.length - 1];
292
+ if (b - (z.x + z.w) >= m.w) {
293
+ const W = new Set(l.filter((k) => k.x > M.x).map((k) => k.i));
294
+ return a = a.map((k) => W.has(k.i) ? { ...k, x: k.x + m.w } : k), f({ ...m, x: M.x + M.w, y: M.y });
295
+ }
296
+ const S = Math.max(...l.map((W) => W.y + W.h));
297
+ return a = X(a, S, m.h), f({ ...m, x: 0, y: S });
298
+ }
299
+ const d = (m) => e.kinds.get(m.i) ?? "chart", u = F(A(a, e.frameOrder));
300
+ if (i === "kpi") {
301
+ const m = ((c = u[0]) == null ? void 0 : c.length) === 1 && d(u[0][0]) === "text" ? 1 : 0;
302
+ let h = m;
303
+ for (; h < u.length && u[h].every((w) => d(w) === "kpi"); ) h += 1;
304
+ if (h === m) {
305
+ const w = m === 1 ? u[0][0].y + u[0][0].h : 0, D = H(t, i, q(1)[0]);
306
+ return a = X(a, w, D.h), f({ ...D, y: w });
307
+ }
308
+ const l = u.slice(m, h).flat(), M = new Set(l.map((w) => w.i)), z = Math.min(...l.map((w) => w.y)), E = Math.max(...l.map((w) => w.y + w.h)), S = [...l, H(t, i, 12)], W = q(S.length);
309
+ let k = 0, G = z, B = 0;
310
+ const wt = S.map((w, D) => {
311
+ const N = W[D];
312
+ k > 0 && k + N > b && (k = 0, G += B, B = 0);
313
+ const gt = { ...w, x: k, y: G, w: N, ...w.minW !== void 0 ? { minW: Math.min(w.minW, N) } : {} };
314
+ return k += N, B = Math.max(B, w.h), gt;
315
+ }), tt = G + B, bt = a.filter((w) => !M.has(w.i)).map((w) => w.y >= z && tt > E ? { ...w, y: w.y + (tt - E) } : w);
316
+ return g(Y([...bt, ...wt], e.frameOrder));
317
+ }
318
+ if (i === "chart") {
319
+ const m = u[u.length - 1], h = (m == null ? void 0 : m.length) === 1 ? m[0] : void 0;
320
+ return h && d(h) === "chart" && (h.x + h.w <= 24 || h.x >= 24) ? f({ ...H(t, i, 24), x: h.x + h.w <= 24 ? 24 : 0, y: h.y }) : f({ ...H(t, i, 24), y: O(a) });
321
+ }
322
+ return f({ ...H(t, i, b), y: O(a) });
323
+ }
324
+ function lt(n, t, i) {
325
+ const o = Math.max(1, Math.min(i, Math.round(t.w * i / b)));
326
+ return [...n, ut({ ...t, x: 0, y: O(n), w: o }, i)];
327
+ }
328
+ const Q = ["md", "sm", "xs", "xxs"], ht = [];
329
+ function L(n) {
330
+ const t = n.map((i) => i.id);
331
+ return {
332
+ frames: n,
333
+ ids: t,
334
+ kinds: new Map(n.map((i) => [i.id, U(i)])),
335
+ frameOrder: Bt(t)
336
+ };
337
+ }
338
+ function _(n) {
339
+ return typeof n == "number" && Number.isFinite(n) ? Math.round(n) : void 0;
340
+ }
341
+ function $(n, t, i) {
342
+ const o = new Set(i.ids), e = /* @__PURE__ */ new Map();
343
+ if (!Array.isArray(n)) return e;
344
+ for (const r of n) {
345
+ if (!r || typeof r != "object") continue;
346
+ const s = r, a = s.i;
347
+ if (typeof a != "string" || !o.has(a) || e.has(a)) continue;
348
+ const f = i.kinds.get(a) ?? "chart", y = _(s.minH), x = Math.max(1, Math.min(_(s.w) ?? Math.min(T[f], t), t)), d = Math.max(_(s.h) ?? R[f].h, y ?? 1, 1), u = {
349
+ i: a,
350
+ x: Math.max(0, Math.min(_(s.x) ?? 0, t - x)),
351
+ y: Math.max(0, _(s.y) ?? Number.MAX_SAFE_INTEGER),
352
+ w: x,
353
+ h: d
354
+ }, p = _(s.minW);
355
+ p !== void 0 && (u.minW = Math.max(1, Math.min(p, x))), y !== void 0 && (u.minH = Math.max(1, Math.min(y, d)));
356
+ const c = _(s.maxW);
357
+ c !== void 0 && (u.maxW = Math.max(c, x));
358
+ const m = _(s.maxH);
359
+ m !== void 0 && (u.maxH = Math.max(m, d)), typeof s.static == "boolean" && (u.static = s.static), typeof s.isResizable == "boolean" && (u.isResizable = s.isResizable), typeof s.isDraggable == "boolean" && (u.isDraggable = s.isDraggable), e.set(a, u);
360
+ }
361
+ return e;
362
+ }
363
+ function Rt(n, t) {
364
+ return t.ids.every((i) => n.has(i));
365
+ }
366
+ function j(n, t) {
367
+ return t.ids.flatMap((i) => n.has(i) ? [n.get(i)] : []);
368
+ }
369
+ function V(n, t) {
370
+ const i = g(j(n, t)), o = new Map(i.map((r) => [r.i, r]));
371
+ let e = O(i);
372
+ for (const r of t.ids) {
373
+ if (o.has(r)) continue;
374
+ const s = t.kinds.get(r) ?? "chart", a = R[s], f = T[s];
375
+ o.set(r, { i: r, x: 0, y: e, w: f, h: a.h, minW: Math.min(a.minW, f), minH: a.minH }), e += a.h;
376
+ }
377
+ return g(t.ids.map((r) => o.get(r)));
378
+ }
379
+ function Dt(n, t) {
380
+ const i = b / t;
381
+ return n.map((o) => {
382
+ if (!o || typeof o != "object") return o;
383
+ const e = o, r = _(e.x), s = _(e.w);
384
+ if (r === void 0 || s === void 0) return e;
385
+ const a = Math.round(r * i), f = Math.round((r + s) * i);
386
+ return { ...e, x: a, w: Math.max(1, f - a) };
387
+ });
388
+ }
389
+ function Nt(n) {
390
+ const t = n.layouts ?? {};
391
+ if (Array.isArray(t.lg)) return t.lg;
392
+ if (Array.isArray(n.layout)) return n.layout;
393
+ for (const i of Q) {
394
+ const o = t[i];
395
+ if (Array.isArray(o)) return Dt(o, v.columns[i]);
396
+ }
397
+ return [];
398
+ }
399
+ function et(n, t) {
400
+ var i;
401
+ return (i = n.layouts) == null ? void 0 : i[t];
402
+ }
403
+ function pt(n, t, i, o) {
404
+ let e = g(j(n, o));
405
+ for (const r of t)
406
+ n.has(r.i) || (e = lt(e, r, v.columns[i]));
407
+ return g(Z(e, o));
408
+ }
409
+ function Z(n, t) {
410
+ return n.slice().sort((i, o) => (t.frameOrder.get(i.i) ?? 0) - (t.frameOrder.get(o.i) ?? 0));
411
+ }
412
+ const Ft = ["i", "x", "y", "w", "h", "minW", "minH", "maxW", "maxH", "static", "isResizable", "isDraggable"];
413
+ function xt(n, t) {
414
+ return !Array.isArray(n) || n.length !== t.length ? !1 : t.every((i, o) => {
415
+ const e = n[o];
416
+ return !!e && Ft.every((r) => e[r] === i[r]);
417
+ });
418
+ }
419
+ function jt(n, t) {
420
+ const i = new Map(t.map((o) => [o.i, o]));
421
+ return n.length === t.length && n.every((o) => {
422
+ const e = i.get(o.i);
423
+ return !!e && e.x === o.x && e.y === o.y && e.w === o.w && e.h === o.h;
424
+ });
425
+ }
426
+ function Pt(n, t) {
427
+ return v.breakpoints.every((i) => xt(n[i], t[i]));
428
+ }
429
+ function Gt(n) {
430
+ return v.customizable.filter((t) => n.includes(t));
431
+ }
432
+ function yt(n, t, i) {
433
+ const o = { lg: n };
434
+ for (const e of Q)
435
+ o[e] = i[e] ?? dt(e, n, t.kinds, t.frameOrder);
436
+ return o;
437
+ }
438
+ function Kt(n, t) {
439
+ return F(A(n, t.frameOrder)).map((i) => ({
440
+ tiles: i.map((o) => ({ frameId: o.i, kind: t.kinds.get(o.i) ?? "chart", width: It(o.w) }))
441
+ }));
442
+ }
443
+ function Yt(n) {
444
+ const t = L(n.frames ?? ht), i = V($(Nt(n), b, t), t), o = Array.isArray(n.customizedBreakpoints), e = {}, r = [];
445
+ for (const f of Q) {
446
+ const y = v.columns[f], x = $(et(n, f), y, t), d = Rt(x, t) && t.ids.length > 0;
447
+ if (J(f)) {
448
+ if (o && n.customizedBreakpoints.includes(f)) {
449
+ e[f] = pt(x, i, f, t), r.push(f);
450
+ continue;
451
+ }
452
+ if (!o && d) {
453
+ const p = g(j(x, t));
454
+ jt(p, dt(f, i, t.kinds, t.frameOrder)) || (e[f] = p, r.push(f));
455
+ }
456
+ continue;
457
+ }
458
+ !o && d && (e[f] = g(j(x, t)));
459
+ }
460
+ const s = yt(i, t, e), a = v.breakpoints.some((f) => !xt(et(n, f), s[f]));
461
+ return { layouts: s, customizedBreakpoints: r, rows: Kt(i, t), repaired: a };
462
+ }
463
+ function I(n) {
464
+ return { ok: !1, failure: n };
465
+ }
466
+ function rt(n, t, i) {
467
+ const o = R[i];
468
+ return n.map((e) => e.i === t ? { ...e, h: o.h, minH: o.minH, minW: Math.min(o.minW, e.w) } : e);
469
+ }
470
+ function Xt(n, t) {
471
+ const i = Yt(n), o = n.frames ?? ht;
472
+ let e = o, r = i.layouts.lg, s = i.customizedBreakpoints.slice();
473
+ const a = {};
474
+ for (const d of s) a[d] = i.layouts[d];
475
+ switch (t.kind) {
476
+ case "frame_added": {
477
+ const { frame: d, placement: u } = t;
478
+ if (o.some((l) => l.id === d.id))
479
+ return I({ code: "frame_already_on_sheet", frameId: d.id, message: `A frame with id ${d.id} is already on this sheet.` });
480
+ const p = u == null ? void 0 : u.position, c = typeof p == "object" ? "after" in p ? p.after : p.beside : void 0;
481
+ if (c !== void 0 && !o.some((l) => l.id === c))
482
+ return I({ code: "position_target_not_found", frameId: c, message: `No frame ${c} on this sheet to place the new frame next to.` });
483
+ if (p === "top") e = [d, ...o];
484
+ else if (c !== void 0) {
485
+ const l = o.findIndex((M) => M.id === c);
486
+ e = [...o.slice(0, l + 1), d, ...o.slice(l + 1)];
487
+ } else e = [...o, d];
488
+ const m = L(e);
489
+ r = $t(r, d.id, m.kinds.get(d.id), u, m);
490
+ const h = r.find((l) => l.i === d.id);
491
+ for (const l of s) {
492
+ const M = v.columns[l], z = a[l], E = typeof p == "object" && "beside" in p ? mt(z, p.beside, d.id, M) : lt(z, h, M);
493
+ a[l] = g(Z(E, m));
494
+ }
495
+ break;
496
+ }
497
+ case "frame_removed": {
498
+ if (!o.some((d) => d.id === t.frameId))
499
+ return I({ code: "frame_not_on_sheet", frameId: t.frameId, message: `No frame ${t.frameId} on this sheet.` });
500
+ e = o.filter((d) => d.id !== t.frameId), r = g(r.filter((d) => d.i !== t.frameId));
501
+ for (const d of s)
502
+ a[d] = g(a[d].filter((u) => u.i !== t.frameId));
503
+ break;
504
+ }
505
+ case "frame_updated": {
506
+ const d = o.findIndex((c) => c.id === t.frame.id);
507
+ if (d < 0)
508
+ return I({ code: "frame_not_on_sheet", frameId: t.frame.id, message: `No frame ${t.frame.id} on this sheet.` });
509
+ e = o.map((c, m) => m === d ? t.frame : c);
510
+ const u = U(o[d]), p = U(t.frame);
511
+ if (u === p)
512
+ return {
513
+ ok: !0,
514
+ frames: e,
515
+ layouts: i.layouts,
516
+ customizedBreakpoints: i.customizedBreakpoints,
517
+ changed: !0,
518
+ layoutsChanged: !1
519
+ };
520
+ if (t.resizeForNewKind && nt(u) !== nt(p)) {
521
+ r = g(rt(r, t.frame.id, p));
522
+ for (const c of s)
523
+ a[c] = g(rt(a[c], t.frame.id, p));
524
+ }
525
+ break;
526
+ }
527
+ case "grid_edited": {
528
+ if (!kt(t.breakpoint))
529
+ return I({ code: "breakpoint_not_editable", breakpoint: String(t.breakpoint), message: `The ${String(t.breakpoint)} layout is derived; edit Desktop, Tablet or Phone.` });
530
+ const d = L(o);
531
+ if (t.breakpoint === "md") {
532
+ const u = [...$(t.items, v.columns.md, d).values()];
533
+ r = V(new Map(Tt(r, u).map((p) => [p.i, p])), d);
534
+ } else if (t.breakpoint === "lg")
535
+ r = V($(t.items, b, d), d);
536
+ else {
537
+ const u = t.breakpoint;
538
+ a[u] = pt($(t.items, v.columns[u], d), r, u, d), s.includes(u) || (s = Gt([...s, u]));
539
+ }
540
+ break;
541
+ }
542
+ case "reset_to_automatic": {
543
+ if (!J(t.breakpoint))
544
+ return I({ code: "breakpoint_not_editable", breakpoint: String(t.breakpoint), message: "Only Tablet and Phone can go back to automatic." });
545
+ s = s.filter((d) => d !== t.breakpoint), delete a[t.breakpoint];
546
+ break;
547
+ }
548
+ case "arrange": {
549
+ const d = L(o), u = Lt(r, d.kinds, d.frameOrder, t.keepOrder === !0), p = new Map(o.map((c) => [c.id, c]));
550
+ e = u.order.map((c) => p.get(c)), e.every((c, m) => c === o[m]) && (e = o), r = u.items, s = [];
551
+ for (const c of v.customizable) delete a[c];
552
+ break;
553
+ }
554
+ }
555
+ const f = L(e);
556
+ r = Z(r, f);
557
+ const y = yt(r, f, a), x = !Pt(y, i.layouts) || s.join() !== i.customizedBreakpoints.join();
558
+ return { ok: !0, frames: e, layouts: y, customizedBreakpoints: s, changed: e !== o || x, layoutsChanged: x };
559
+ }
560
+ function Ut(n, t) {
561
+ const i = [...t].sort().join("\0");
562
+ for (const o of v.breakpoints) {
563
+ const e = n[o], r = v.columns[o];
564
+ if (!Array.isArray(e)) throw new Error(`Layout ${o} is missing.`);
565
+ if (e.map((s) => s.i).sort().join("\0") !== i) throw new Error(`Layout ${o} doesn't hold exactly the sheet's frames.`);
566
+ for (const s of e) {
567
+ if (![s.x, s.y, s.w, s.h].every(Number.isInteger)) throw new Error(`Layout ${o}: ${s.i} has a non-integer position or size.`);
568
+ if (s.x < 0 || s.y < 0 || s.w < 1 || s.w > r || s.x + s.w > r || s.h < 1)
569
+ throw new Error(`Layout ${o}: ${s.i} is out of bounds.`);
570
+ if (s.minW !== void 0 && (s.minW < 1 || s.minW > s.w)) throw new Error(`Layout ${o}: ${s.i} minW out of range.`);
571
+ if (s.minH !== void 0 && (s.minH < 1 || s.minH > s.h)) throw new Error(`Layout ${o}: ${s.i} minH out of range.`);
572
+ if (s.maxW !== void 0 && s.maxW < s.w) throw new Error(`Layout ${o}: ${s.i} maxW below w.`);
573
+ if (s.maxH !== void 0 && s.maxH < s.h) throw new Error(`Layout ${o}: ${s.i} maxH below h.`);
574
+ }
575
+ if (St(e)) throw new Error(`Layout ${o} has overlapping items.`);
576
+ if (!Et(e)) throw new Error(`Layout ${o} isn't packed.`);
577
+ }
578
+ }
579
+ export {
580
+ v as D,
581
+ Xt as a,
582
+ Ut as b,
583
+ _t as i,
584
+ Yt as r
585
+ };
@@ -1,11 +1,11 @@
1
1
  import { jsx as o, Fragment as te, jsxs as h } from "react/jsx-runtime";
2
2
  import * as p from "react";
3
3
  import $t, { useMemo as ee, useState as L, useEffect as J, createContext as jt, useRef as $, useCallback as K, useContext as qe, lazy as Ee, Suspense as Se, useLayoutEffect as Ce, Activity as Vt, useId as de } from "react";
4
- import { b as Wt, b8 as He, bk as Kt, bl as qt, u as U, bm as gt, x as Ht, bn as Gt, bo as Jt, bp as Xt, bq as Yt, br as ge, bs as yt, bt as tt, bu as Zt, Z as ye, Y as Qt, bv as ea, bw as ta, _ as at, $ as aa, bx as ra, E as na, F as sa, S as la, B as oa, a as ia, U as da, by as ca, D as ua, A as fa, C as ma, bz as ha, bA as pa, bB as va, bC as ba, bD as ga, bE as ya, bF as rt, bG as ke, bH as wa, bI as Ge, bJ as G, bK as Sa, bL as xa, bM as Ca, bN as Ia, bO as Ea } from "./semaphor-ready-indicator-C3EQEiD9.js";
4
+ import { b as Wt, b8 as He, bk as Kt, bl as qt, u as U, bm as gt, x as Ht, bn as Gt, bo as Jt, bp as Xt, bq as Yt, br as ge, bs as yt, bt as tt, bu as Zt, Z as ye, Y as Qt, bv as ea, bw as ta, _ as at, $ as aa, bx as ra, E as na, F as sa, S as la, B as oa, a as ia, U as da, by as ca, D as ua, A as fa, C as ma, bz as ha, bA as pa, bB as va, bC as ba, bD as ga, bE as ya, bF as rt, bG as ke, bH as wa, bI as Ge, bJ as G, bK as Sa, bL as xa, bM as Ca, bN as Ia, bO as Ea } from "./semaphor-ready-indicator-CFeCIuaw.js";
5
5
  import { j as Na } from "./index-CuHybtft.js";
6
6
  import { N as Ta } from "./bookmark-state-CWeoGbrx.js";
7
7
  import { r as ka, a as wt } from "./availability-Bp5Gfu1I.js";
8
- import { s as Aa } from "./global-date-filter-utils-N1kcsOFE.js";
8
+ import { s as Aa } from "./global-date-filter-utils-ruJYwjgZ.js";
9
9
  import { B as q, Q as Ra, U as Da, V as _a, W as Pa, Y as Oa, Z as La, _ as oe, D as Q, $ as he, m as pe, P as za, a as Fa, b as Ua, d as nt, L as St, s as ze, t as Fe, u as Ue, v as Me, w as Y, T as Ma, e as Ba, f as st, h as lt } from "./switch-BW4yXSYs.js";
10
10
  import "./validators-BIM0FE31.js";
11
11
  import "./matrix-operation-contract-DsLdFdSa.js";
@@ -13,7 +13,7 @@ import "./analytics-base-schemas-BaIQrEzX.js";
13
13
  import "zod";
14
14
  import { parseValueFormatPreferencesResponse as $a, canonicalizeSupportedLocale as xt, getSupportedCurrencyCodes as ja, canonicalizeSupportedCurrencyCode as Va } from "../value-format-preferences/index.js";
15
15
  import { c as B } from "./_commonjsHelpers-DimLPMtv.js";
16
- import { d as Wa } from "./filter-reach-copy-CvV7W5dd.js";
16
+ import { d as Wa } from "./filter-reach-copy-Cmb05jlE.js";
17
17
  import { a as Ka } from "./report-runtime-context-BITkNSDa.js";
18
18
  import { ag as we, an as ce } from "./temporal-input-presentation-sk9gqLi6.js";
19
19
  function qa() {
@@ -163,7 +163,7 @@ function Rn(e, a, t) {
163
163
  anchorSlot: n.anchorSlot
164
164
  };
165
165
  }
166
- const or = Ee(() => import("./assistant-chat-iIp02_77.js"));
166
+ const or = Ee(() => import("./assistant-chat-D1BEEHUF.js"));
167
167
  function Dn() {
168
168
  const e = Ht(), a = lr();
169
169
  if (!e.available) return null;
@@ -614,9 +614,9 @@ function xe(e) {
614
614
  function Cr() {
615
615
  return globalThis.crypto.randomUUID();
616
616
  }
617
- const Ir = Ee(() => import("./dashboard-controls-B253nJS-.js")), Er = Ee(
618
- () => import("./edit-dashboard-visual-CMar-NhA.js")
619
- ), Nr = Ee(() => import("./dashboard-json-osQuinUZ.js"));
617
+ const Ir = Ee(() => import("./dashboard-controls-CJ8Dz50D.js")), Er = Ee(
618
+ () => import("./edit-dashboard-visual-CgHJXBQv.js")
619
+ ), Nr = Ee(() => import("./dashboard-json-D3uZxGO-.js"));
620
620
  function _n({
621
621
  showControls: e = !1,
622
622
  showFooter: a = !0,