react-semaphor 0.1.571 → 0.1.572

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 (27) 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-SkCraw2C.js → assistant-chat-DF1-q82n.js} +182 -182
  4. package/dist/chunks/{bookmark-impact-DCYD-6Fr.js → bookmark-impact-fdj8fY9i.js} +2 -2
  5. package/dist/chunks/{bookmark-state-CflS88gq.js → bookmark-state-BEl_G9vr.js} +54 -54
  6. package/dist/chunks/{card-filter-builder-D-aSYpyr.js → card-filter-builder-BFT21WI-.js} +3 -3
  7. package/dist/chunks/{dashboard-briefing-launcher-_g1m2tJ3.js → dashboard-briefing-launcher-DDXzTYuA.js} +873 -906
  8. package/dist/chunks/{dashboard-controls-CY0gbcCt.js → dashboard-controls-BwKQEoGp.js} +103 -103
  9. package/dist/chunks/{dashboard-B_w_ekUz.js → dashboard-jUhZ7T4f.js} +1 -1
  10. package/dist/chunks/{dashboard-json-DsM79yem.js → dashboard-json-B3fR1_Oc.js} +1 -1
  11. package/dist/chunks/{dates-RSEzJ9N7.js → dates-DKkSDWHe.js} +5 -5
  12. package/dist/chunks/{edit-dashboard-visual-cX0FM-4i.js → edit-dashboard-visual-DGZABdS-.js} +8 -8
  13. package/dist/chunks/{filter-reach-copy-thzt25Rc.js → filter-reach-copy-CWHV7GSb.js} +9 -9
  14. package/dist/chunks/{index-y3HUzRNk.js → index-CeeY4wjE.js} +2 -2
  15. package/dist/chunks/{report-preferences-dialog-B_GXs91t.js → report-preferences-dialog-R3EGbxfu.js} +725 -801
  16. package/dist/chunks/{resolve-dashboard-input-context-Lkbwycwe.js → resolve-dashboard-input-context-CBQF3obr.js} +1 -1
  17. package/dist/chunks/{saved-dashboard-context-DC_TEd6y.js → saved-dashboard-context-_-7LKeK1.js} +3 -3
  18. package/dist/chunks/{semaphor-ready-indicator-CBQamwQY.js → semaphor-ready-indicator-CEbA4CFb.js} +19843 -19731
  19. package/dist/chunks/{shelf-drop-preview-context-Bkjf0XXw.js → shelf-drop-preview-context-UqUUVSJq.js} +259 -259
  20. package/dist/chunks/{stored-dashboard-C0hekXiI.js → stored-dashboard-Bk3iCXtp.js} +131 -131
  21. package/dist/chunks/{variable-draft-DvglU8yj.js → variable-draft-ggS3X7FG.js} +2 -2
  22. package/dist/dashboard/index.js +2 -2
  23. package/dist/dashboard-authoring/index.js +11 -11
  24. package/dist/index.js +147 -147
  25. package/dist/surfboard/index.js +2 -2
  26. package/dist/types/index.js +1 -1
  27. package/package.json +1 -1
@@ -1,43 +1,43 @@
1
- import { jsx as o, Fragment as te, jsxs as h } from "react/jsx-runtime";
1
+ import { jsx as i, Fragment as te, jsxs as h } from "react/jsx-runtime";
2
2
  import * as p from "react";
3
- import jt, { useMemo as ee, useState as L, useEffect as X, createContext as $t, useRef as j, 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, aT as He, b3 as Kt, b4 as qt, u as U, b5 as gt, w as Ht, b6 as Gt, b7 as Xt, b8 as Jt, b9 as Zt, ba as ge, bb as yt, bc as tt, bd as Yt, Y as ye, X as Qt, be as ea, bf as ta, Z as at, _ as aa, bg as ra, E as na, F as sa, S as la, B as oa, a as ia, U as da, bh as ca, D as ua, A as fa, C as ma, bi as ha, bj as pa, bk as va, bl as ba, bm as ga, bn as ya, bo as rt, bp as ke, bq as wa, br as Ge, bs as G, bt as Sa, bu as xa, bv as Ca, bw as Ia, bx as Ea } from "./semaphor-ready-indicator-CBQamwQY.js";
5
- import { j as Na, c as B } from "./pickers-DkqmtnTL.js";
6
- import { az as Ta } from "./bookmark-state-CflS88gq.js";
7
- import { r as ka, a as wt } from "./availability-Bp5Gfu1I.js";
8
- import { s as Aa } from "./resolve-dashboard-input-context-Lkbwycwe.js";
9
- import { B as q, Z as Ra, _ as Da, $ as _a, a0 as Pa, a1 as Oa, a2 as La, a3 as oe, H as Q, a4 as he, s as pe, e as za, f as Fa, h as Ua, j as nt, L as St, y as ze, z as Fe, A as Ue, D as Me, E as Z, T as Ma, k as Ba, l as st, n as lt } from "./style-sheet-parts-C7qGZuH1.js";
3
+ import Mt, { useMemo as ee, useState as F, useEffect as Z, lazy as Ie, Suspense as Se, useRef as H, useLayoutEffect as Ce, useCallback as W, Activity as jt, useId as de } from "react";
4
+ import { b as Bt, b1 as qe, bd as $t, be as Vt, u as U, bf as bt, L as Wt, J as Kt, bg as qt, bh as Ht, bi as Gt, bj as Jt, bk as ge, bl as vt, bm as Qe, bn as Xt, a6 as ye, a5 as Zt, bo as Yt, bp as Qt, a7 as et, a8 as ea, bq as ta, E as aa, F as ra, S as na, B as sa, a as la, U as ia, br as oa, D as da, A as ca, C as ua, bs as ma, bt as fa, bu as ha, bv as pa, bw as ba, bx as va, by as tt, bz as ke, bA as ga, bB as He, bC as G, bD as ya, bE as wa, bF as Sa, bG as xa, bH as Ca } from "./semaphor-ready-indicator-CEbA4CFb.js";
5
+ import { j as Ea, c as j } from "./pickers-DkqmtnTL.js";
6
+ import { J as Ia } from "./bookmark-state-BEl_G9vr.js";
7
+ import { r as Na, a as gt } from "./availability-Bp5Gfu1I.js";
8
+ import { s as Ta } from "./resolve-dashboard-input-context-CBQF3obr.js";
9
+ import { B as K, Z as ka, _ as Aa, $ as Da, a0 as Ra, a1 as Pa, a2 as _a, a3 as ie, H as Q, a4 as he, s as pe, e as La, f as za, h as Fa, j as at, L as yt, y as Fe, z as Oe, A as Ue, D as Me, E as X, T as Oa, k as Ua, l as rt, n as nt } from "./style-sheet-parts-C7qGZuH1.js";
10
10
  import "./validators-B8fpdinG.js";
11
11
  import "./matrix-operation-contract-DCVinw1o.js";
12
12
  import "./analytics-base-schemas-BaIQrEzX.js";
13
- import { parseValueFormatPreferencesResponse as ja, canonicalizeSupportedLocale as xt, getSupportedCurrencyCodes as $a, canonicalizeSupportedCurrencyCode as Va } from "../value-format-preferences/index.js";
14
- import { k as Wa } from "./filter-reach-copy-thzt25Rc.js";
15
- import { a as Ka } from "./report-runtime-context-BhPzLTbS.js";
13
+ import { parseValueFormatPreferencesResponse as Ma, canonicalizeSupportedLocale as wt, getSupportedCurrencyCodes as ja, canonicalizeSupportedCurrencyCode as Ba } from "../value-format-preferences/index.js";
14
+ import { e as $a } from "./filter-reach-copy-CWHV7GSb.js";
15
+ import { a as Va } from "./report-runtime-context-BhPzLTbS.js";
16
16
  import { ah as we, ao as ce } from "./temporal-input-presentation-CqbJjIuu.js";
17
- function qa() {
18
- return /* @__PURE__ */ o(
17
+ function Wa() {
18
+ return /* @__PURE__ */ i(
19
19
  "div",
20
20
  {
21
21
  role: "dashboard-plus-main",
22
22
  className: "flex min-h-0 grow basis-0 overflow-hidden",
23
- children: /* @__PURE__ */ o("section", { className: "flex min-h-0 grow basis-0 flex-col overflow-hidden", children: /* @__PURE__ */ o(Wt, {}) })
23
+ children: /* @__PURE__ */ i("section", { className: "flex min-h-0 grow basis-0 flex-col overflow-hidden", children: /* @__PURE__ */ i(Bt, {}) })
24
24
  }
25
25
  );
26
26
  }
27
- const Ha = /* @__PURE__ */ new Set(["iat", "exp", "nbf", "jti"]);
28
- function Ga(e) {
29
- return Aa(
27
+ const Ka = /* @__PURE__ */ new Set(["iat", "exp", "nbf", "jti"]);
28
+ function qa(e) {
29
+ return Ta(
30
30
  Object.fromEntries(
31
- Object.entries(e ?? {}).filter(([a]) => !Ha.has(a))
31
+ Object.entries(e ?? {}).filter(([a]) => !Ka.has(a))
32
32
  )
33
33
  );
34
34
  }
35
- function Xa(e) {
35
+ function Ha(e) {
36
36
  var t;
37
37
  const a = e == null ? void 0 : e.config;
38
- return ka({
38
+ return Na({
39
39
  features: ((t = a == null ? void 0 : a.projectFeatures) == null ? void 0 : t.features) ?? {},
40
- config: { enabled: wt(a).enabled },
40
+ config: { enabled: gt(a).enabled },
41
41
  identity: {
42
42
  orgUserId: e == null ? void 0 : e.orgUserId,
43
43
  tenantId: e == null ? void 0 : e.tenantId,
@@ -46,128 +46,61 @@ function Xa(e) {
46
46
  modelConfigured: !0
47
47
  });
48
48
  }
49
- let ot = 0;
50
- function it(e, a) {
51
- ot += 1;
52
- const { name: t, layout: n } = wt(a == null ? void 0 : a.config);
53
- return { ...qt(n), id: ot, callerKey: e, assistantName: t };
49
+ let st = 0;
50
+ function lt(e, a) {
51
+ st += 1;
52
+ const { name: t, layout: n } = gt(a == null ? void 0 : a.config);
53
+ return { ...Vt(n), id: st, callerKey: e, assistantName: t };
54
54
  }
55
- function Ja({
55
+ function Ga({
56
56
  children: e,
57
57
  authToken: a
58
58
  }) {
59
- const t = He(), n = ee(
60
- () => a === void 0 ? t.tokenProps : Ya(a),
59
+ const t = qe(), n = ee(
60
+ () => a === void 0 ? t.tokenProps : Xa(a),
61
61
  [a, t.tokenProps]
62
- ), r = ee(() => Ga(n), [n]), l = ee(
63
- () => Xa(n).available,
62
+ ), r = ee(() => qa(n), [n]), l = ee(
63
+ () => Ha(n).available,
64
64
  [n]
65
- ), [s, i] = L(() => it(r, n));
66
- s.callerKey !== r && i(it(r, n)), Qa(s);
67
- const m = ee(() => ({ instance: s, available: l }), [s, l]);
68
- return /* @__PURE__ */ o(Kt.Provider, { value: m, children: e });
65
+ ), [s, o] = F(() => lt(r, n));
66
+ s.callerKey !== r && o(lt(r, n)), Za(s);
67
+ const f = ee(() => ({ instance: s, available: l }), [s, l]);
68
+ return /* @__PURE__ */ i($t.Provider, { value: f, children: e });
69
69
  }
70
- function Za({ children: e }) {
71
- return gt() ? /* @__PURE__ */ o(te, { children: e }) : /* @__PURE__ */ o(Ja, { children: e });
70
+ function Ja({ children: e }) {
71
+ return bt() ? /* @__PURE__ */ i(te, { children: e }) : /* @__PURE__ */ i(Ga, { children: e });
72
72
  }
73
- function Ya(e) {
73
+ function Xa(e) {
74
74
  if (!(e != null && e.accessToken)) return {};
75
75
  try {
76
- return Na(e.accessToken);
76
+ return Ea(e.accessToken);
77
77
  } catch {
78
78
  return {};
79
79
  }
80
80
  }
81
- function Qa(e) {
82
- X(() => {
81
+ function Za(e) {
82
+ Z(() => {
83
83
  const a = (n, r) => {
84
84
  const l = e.store.getState().focus;
85
- l && !er(l, n, r) && e.clearFocus();
85
+ l && !Ya(l, n, r) && e.clearFocus();
86
86
  }, t = U.getState();
87
87
  return a(t.selectedSheetId, t.dashboard), U.subscribe((n, r) => {
88
88
  (n.selectedSheetId !== r.selectedSheetId || n.dashboard !== r.dashboard) && a(n.selectedSheetId, n.dashboard), n.isVisualEditing && !r.isVisualEditing && e.leaveBeside();
89
89
  });
90
90
  }, [e]);
91
91
  }
92
- function er(e, a, t) {
92
+ function Ya(e, a, t) {
93
93
  if ((a ?? null) !== e.sheetId) return !1;
94
- const n = t ? Ta(t, e.cardId) : void 0;
94
+ const n = t ? Ia(t, e.cardId) : void 0;
95
95
  return !!n && n.sheet.id === e.sheetId;
96
96
  }
97
- const tr = 640, ar = 960;
98
- function rr(e) {
99
- return e >= ar ? "lg" : e >= tr ? "md" : "sm";
100
- }
101
- function nr(e, a) {
102
- return e === "always" ? !0 : e === "menu" ? !1 : e === "md" ? a !== "sm" : a === "lg";
103
- }
104
- const sr = {
105
- width: "lg",
106
- hasOverflowMenu: !1,
107
- overflowItems: [],
108
- register: () => () => {
109
- },
110
- openOverflowId: null,
111
- setOpenOverflowId: () => {
112
- },
113
- anchorSlot: null,
114
- setAnchorSlot: () => {
115
- }
116
- }, Xe = $t(sr);
117
- function En() {
118
- const [e, a] = L("lg"), t = j(null);
119
- return { measure: K((r) => {
120
- var s;
121
- if ((s = t.current) == null || s.disconnect(), t.current = null, !r || typeof ResizeObserver > "u") return;
122
- const l = (i) => a(rr(i));
123
- l(r.getBoundingClientRect().width), t.current = new ResizeObserver(([i]) => {
124
- i && l(i.contentRect.width);
125
- }), t.current.observe(r);
126
- }, []), width: e };
127
- }
128
- function lr() {
129
- return qe(Xe).width;
130
- }
131
- function Nn() {
132
- return qe(Xe).overflowItems;
133
- }
134
- function Tn(e, a, t) {
135
- const n = qe(Xe), r = n.hasOverflowMenu && !nr(a, n.width), { register: l, setOpenOverflowId: s } = n, i = t == null ? void 0 : t.label, m = t == null ? void 0 : t.hint, u = t == null ? void 0 : t.checked, y = (t == null ? void 0 : t.order) ?? 0, c = j(t == null ? void 0 : t.icon);
136
- c.current = t == null ? void 0 : t.icon;
137
- const v = j(t == null ? void 0 : t.onSelect);
138
- v.current = t == null ? void 0 : t.onSelect;
139
- const f = j(t == null ? void 0 : t.onOpen);
140
- return f.current = t == null ? void 0 : t.onOpen, X(() => {
141
- if (!(!r || i === void 0))
142
- return l({
143
- id: e,
144
- label: i,
145
- icon: c.current,
146
- hint: m,
147
- checked: u,
148
- order: y,
149
- onSelect: () => {
150
- if (v.current) return v.current();
151
- window.setTimeout(() => {
152
- var w;
153
- s(e), (w = f.current) == null || w.call(f);
154
- }, 0);
155
- }
156
- });
157
- }, [u, r, m, e, i, y, l, s]), {
158
- collapsed: r,
159
- popoverOpen: n.openOverflowId === e,
160
- setPopoverOpen: (w) => s(w ? e : null),
161
- anchorSlot: n.anchorSlot
162
- };
163
- }
164
- const or = Ee(() => import("./assistant-chat-SkCraw2C.js"));
165
- function kn() {
166
- const e = Ht(), a = lr();
97
+ const Qa = Ie(() => import("./assistant-chat-DF1-q82n.js"));
98
+ function vn() {
99
+ const e = Wt(), a = Kt();
167
100
  if (!e.available) return null;
168
101
  const t = a !== "lg";
169
102
  return /* @__PURE__ */ h(
170
- q,
103
+ K,
171
104
  {
172
105
  variant: e.isOpen ? "secondary" : "outline",
173
106
  size: "xs",
@@ -177,151 +110,151 @@ function kn() {
177
110
  onClick: e.toggle,
178
111
  className: t ? "w-7 px-0" : void 0,
179
112
  children: [
180
- /* @__PURE__ */ o(Gt, { className: "h-3.5 w-3.5" }),
113
+ /* @__PURE__ */ i(qt, { className: "h-3.5 w-3.5" }),
181
114
  !t && e.assistantName
182
115
  ]
183
116
  }
184
117
  );
185
118
  }
186
- const ir = {
119
+ const er = {
187
120
  // Docked widths are the viewer's (the resize handle), applied as a style.
188
121
  "docked-right": "relative shrink-0 border-l border-border",
189
122
  "docked-left": "relative order-first shrink-0 border-r border-border",
190
123
  centered: "absolute left-1/2 top-1/2 z-30 h-[min(80%,760px)] w-[min(640px,calc(100%-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-card border border-border shadow-lg",
191
124
  "full-page": "absolute inset-0 z-30"
192
- }, dr = "absolute left-0 top-0 z-30 max-h-[var(--assistant-beside-max-h)] max-w-[var(--assistant-beside-max-w)] rounded-card border border-border shadow-lg", cr = 640, me = 8;
193
- function ur({ surface: e = "dashboard" } = {}) {
194
- const a = gt(), { isOpen: t, mounted: n, storedLayout: r, width: l, beside: s, besideSize: i, focusCardId: m, askCount: u } = Xt(
195
- (a == null ? void 0 : a.instance.store) ?? Zt,
196
- Jt((S) => {
125
+ }, tr = "absolute left-0 top-0 z-30 max-h-[var(--assistant-beside-max-h)] max-w-[var(--assistant-beside-max-w)] rounded-card border border-border shadow-lg", ar = 640, fe = 8;
126
+ function rr({ surface: e = "dashboard" } = {}) {
127
+ const a = bt(), { isOpen: t, mounted: n, storedLayout: r, width: l, beside: s, besideSize: o, focusCardId: f, askCount: u } = Ht(
128
+ (a == null ? void 0 : a.instance.store) ?? Jt,
129
+ Gt((y) => {
197
130
  var C;
198
131
  return {
199
- isOpen: S.isOpen,
200
- mounted: S.mounted,
201
- storedLayout: S.layout,
202
- width: S.width,
203
- beside: S.beside,
204
- besideSize: S.besideSize,
205
- focusCardId: (C = S.focus) == null ? void 0 : C.cardId,
206
- askCount: S.askCount
132
+ isOpen: y.isOpen,
133
+ mounted: y.mounted,
134
+ storedLayout: y.layout,
135
+ width: y.width,
136
+ beside: y.beside,
137
+ besideSize: y.besideSize,
138
+ focusCardId: (C = y.focus) == null ? void 0 : C.cardId,
139
+ askCount: y.askCount
207
140
  };
208
141
  })
209
- ), y = e === "none", c = U(
210
- (S) => s && t && m && !y ? fr(S.dashboard, S.selectedSheetId, m) : void 0
211
- ), v = mr(c, u);
212
- if (!(a != null && a.available) || !n && !y) return null;
213
- const f = y ? "full-page" : v.shown ? "beside-card" : r, w = y || t, b = f === "docked-right" || f === "docked-left";
142
+ ), w = e === "none", c = U(
143
+ (y) => s && t && f && !w ? nr(y.dashboard, y.selectedSheetId, f) : void 0
144
+ ), v = sr(c, u);
145
+ if (!(a != null && a.available) || !n && !w) return null;
146
+ const m = w ? "full-page" : v.shown ? "beside-card" : r, S = w || t, b = m === "docked-right" || m === "docked-left";
214
147
  return /* @__PURE__ */ h(
215
148
  "aside",
216
149
  {
217
150
  ref: v.setFloating,
218
151
  "aria-label": a.instance.assistantName,
219
152
  "data-testid": "assistant-panel",
220
- "data-layout": f,
221
- "data-beside-frame": f === "beside-card" ? c : void 0,
222
- "data-beside-side": f === "beside-card" ? v.side : void 0,
223
- className: B(
153
+ "data-layout": m,
154
+ "data-beside-frame": m === "beside-card" ? c : void 0,
155
+ "data-beside-side": m === "beside-card" ? v.side : void 0,
156
+ className: j(
224
157
  "flex-col bg-background",
225
- f === "beside-card" ? dr : ir[f],
226
- w ? "flex" : "hidden"
158
+ m === "beside-card" ? tr : er[m],
159
+ S ? "flex" : "hidden"
227
160
  ),
228
- style: f === "beside-card" ? { ...v.style, width: i.width, height: i.height } : (
161
+ style: m === "beside-card" ? { ...v.style, width: o.width, height: o.height } : (
229
162
  // The saved width, never more than the share of the dashboard's area the
230
163
  // handle allows, however the area is sized now or later (P4-10).
231
- b ? { width: l, maxWidth: `${Ct * 100}%` } : void 0
164
+ b ? { width: l, maxWidth: `${St * 100}%` } : void 0
232
165
  ),
233
- onKeyDown: f === "beside-card" ? (S) => {
234
- if (S.key !== "Escape" || S.defaultPrevented || !(S.target instanceof Node) || !S.currentTarget.contains(S.target)) return;
235
- S.preventDefault();
166
+ onKeyDown: m === "beside-card" ? (y) => {
167
+ if (y.key !== "Escape" || y.defaultPrevented || !(y.target instanceof Node) || !y.currentTarget.contains(y.target)) return;
168
+ y.preventDefault();
236
169
  const C = v.cardActions();
237
170
  a.instance.close(), C == null || C.focus();
238
171
  } : void 0,
239
172
  children: [
240
- b ? /* @__PURE__ */ o(vr, { instance: a.instance, side: f === "docked-left" ? "right" : "left", width: l }) : null,
241
- f === "beside-card" ? /* @__PURE__ */ o(pr, { instance: a.instance, size: i, side: v.handleSide }) : null,
242
- /* @__PURE__ */ o(Se, { fallback: null, children: /* @__PURE__ */ o(or, { instance: a.instance, surface: e, placement: f }, a.instance.id) })
173
+ b ? /* @__PURE__ */ i(or, { instance: a.instance, side: m === "docked-left" ? "right" : "left", width: l }) : null,
174
+ m === "beside-card" ? /* @__PURE__ */ i(ir, { instance: a.instance, size: o, side: v.handleSide }) : null,
175
+ /* @__PURE__ */ i(Se, { fallback: null, children: /* @__PURE__ */ i(Qa, { instance: a.instance, surface: e, placement: m }, a.instance.id) })
243
176
  ]
244
177
  }
245
178
  );
246
179
  }
247
- function fr(e, a, t) {
180
+ function nr(e, a, t) {
248
181
  var r, l, s;
249
- const n = (r = e.sheets) == null ? void 0 : r.find((i) => i.id === a);
250
- return (s = (l = n == null ? void 0 : n.frames) == null ? void 0 : l.find((i) => {
251
- var m;
252
- return (m = i.cards) == null ? void 0 : m.some((u) => u.id === t);
182
+ const n = (r = e.sheets) == null ? void 0 : r.find((o) => o.id === a);
183
+ return (s = (l = n == null ? void 0 : n.frames) == null ? void 0 : l.find((o) => {
184
+ var f;
185
+ return (f = o.cards) == null ? void 0 : f.some((u) => u.id === t);
253
186
  })) == null ? void 0 : s.id;
254
187
  }
255
- function mr(e, a) {
256
- var w;
257
- const [t, n] = L(void 0), [r, l] = L(void 0), s = j(a);
188
+ function sr(e, a) {
189
+ var S;
190
+ const [t, n] = F(void 0), [r, l] = F(void 0), s = H(a);
258
191
  Ce(() => {
259
192
  s.current = a;
260
193
  });
261
- const i = r === a ? null : t, { refs: m, elements: u, floatingStyles: y, middlewareData: c, isPositioned: v } = Ra({
194
+ const o = r === a ? null : t, { refs: f, elements: u, floatingStyles: w, middlewareData: c, isPositioned: v } = ka({
262
195
  strategy: "absolute",
263
- placement: i ?? "right-start",
196
+ placement: o ?? "right-start",
264
197
  middleware: [
265
- Da(me),
266
- _a({ padding: me }),
267
- Pa({
268
- padding: me,
269
- apply: ({ availableWidth: b, availableHeight: S, elements: C }) => {
270
- C.floating.style.setProperty("--assistant-beside-max-w", `${Math.max(0, b)}px`), C.floating.style.setProperty("--assistant-beside-max-h", `${Math.max(0, S)}px`);
198
+ Aa(fe),
199
+ Da({ padding: fe }),
200
+ Ra({
201
+ padding: fe,
202
+ apply: ({ availableWidth: b, availableHeight: y, elements: C }) => {
203
+ C.floating.style.setProperty("--assistant-beside-max-w", `${Math.max(0, b)}px`), C.floating.style.setProperty("--assistant-beside-max-h", `${Math.max(0, y)}px`);
271
204
  }
272
205
  }),
273
- Oa()
206
+ Pa()
274
207
  ],
275
- whileElementsMounted: (b, S, C) => La(b, S, () => {
276
- const _ = hr(b, S);
277
- n(_), _ === null && l(s.current), C();
208
+ whileElementsMounted: (b, y, C) => _a(b, y, () => {
209
+ const P = lr(b, y);
210
+ n(P), P === null && l(s.current), C();
278
211
  })
279
- }), f = u.floating;
212
+ }), m = u.floating;
280
213
  return Ce(() => {
281
- m.setReference(e ? dt(f == null ? void 0 : f.parentElement, e) : null);
282
- }, [e, f, m]), {
283
- shown: e !== void 0 && i !== null && u.reference !== null,
284
- setFloating: m.setFloating,
214
+ f.setReference(e ? it(m == null ? void 0 : m.parentElement, e) : null);
215
+ }, [e, m, f]), {
216
+ shown: e !== void 0 && o !== null && u.reference !== null,
217
+ setFloating: f.setFloating,
285
218
  style: {
286
- ...y,
219
+ ...w,
287
220
  // Not before it is placed (its side is chosen first): never a flash at
288
221
  // the row's corner. With the card wholly out of view, it goes with the card.
289
- ...!v || (w = c.hide) != null && w.referenceHidden ? { visibility: "hidden" } : {}
222
+ ...!v || (S = c.hide) != null && S.referenceHidden ? { visibility: "hidden" } : {}
290
223
  },
291
224
  /** The side the conversation took; the size handle sits on the corner away from the card. */
292
- side: i ?? void 0,
293
- handleSide: i === "left-start" ? "left" : "right",
225
+ side: o ?? void 0,
226
+ handleSide: o === "left-start" ? "left" : "right",
294
227
  /** The card's ··· menu, where Ask lives and focus returns on Escape. */
295
228
  cardActions: () => {
296
229
  var b;
297
- return e ? (b = dt(f == null ? void 0 : f.parentElement, e)) == null ? void 0 : b.querySelector("[data-card-actions]") : null;
230
+ return e ? (b = it(m == null ? void 0 : m.parentElement, e)) == null ? void 0 : b.querySelector("[data-card-actions]") : null;
298
231
  }
299
232
  };
300
233
  }
301
- function dt(e, a) {
234
+ function it(e, a) {
302
235
  return e ? Array.from(e.querySelectorAll("[data-frame-id]")).find((t) => t.dataset.frameId === a) ?? null : null;
303
236
  }
304
- function hr(e, a) {
237
+ function lr(e, a) {
305
238
  const t = a.parentElement;
306
239
  if (!t || !e.isConnected) return null;
307
240
  const n = t.getBoundingClientRect();
308
- if (n.width < cr) return null;
309
- const r = e.getBoundingClientRect(), { min: l } = yt, s = (i, m) => i >= l.width + 2 * me && m >= l.height + 2 * me;
241
+ if (n.width < ar) return null;
242
+ const r = e.getBoundingClientRect(), { min: l } = vt, s = (o, f) => o >= l.width + 2 * fe && f >= l.height + 2 * fe;
310
243
  return s(n.right - r.right, n.height) ? "right-start" : s(r.left - n.left, n.height) ? "left-start" : s(n.width, n.bottom - r.bottom) ? "bottom-start" : null;
311
244
  }
312
- function pr({
245
+ function ir({
313
246
  instance: e,
314
247
  size: a,
315
248
  side: t
316
249
  }) {
317
- const n = j(void 0), r = t === "left" ? -1 : 1, l = (s) => {
318
- const i = n.current;
250
+ const n = H(void 0), r = t === "left" ? -1 : 1, l = (s) => {
251
+ const o = n.current;
319
252
  return {
320
- width: i.start.width + r * (s.clientX - i.x),
321
- height: i.start.height + (s.clientY - i.y)
253
+ width: o.start.width + r * (s.clientX - o.x),
254
+ height: o.start.height + (s.clientY - o.y)
322
255
  };
323
256
  };
324
- return /* @__PURE__ */ o(
257
+ return /* @__PURE__ */ i(
325
258
  "div",
326
259
  {
327
260
  role: "separator",
@@ -329,8 +262,8 @@ function pr({
329
262
  tabIndex: 0,
330
263
  title: "Drag to resize. Double-click to reset.",
331
264
  onPointerDown: (s) => {
332
- var i, m;
333
- s.preventDefault(), (m = (i = s.currentTarget).setPointerCapture) == null || m.call(i, s.pointerId), n.current = { x: s.clientX, y: s.clientY, start: a };
265
+ var o, f;
266
+ s.preventDefault(), (f = (o = s.currentTarget).setPointerCapture) == null || f.call(o, s.pointerId), n.current = { x: s.clientX, y: s.clientY, start: a };
334
267
  },
335
268
  onPointerMove: (s) => {
336
269
  n.current && e.setBesideSize(l(s));
@@ -342,50 +275,50 @@ function pr({
342
275
  n.current = void 0;
343
276
  },
344
277
  onKeyDown: (s) => {
345
- const i = {
278
+ const o = {
346
279
  ArrowLeft: { width: -r * le, height: 0 },
347
280
  ArrowRight: { width: r * le, height: 0 },
348
281
  ArrowUp: { width: 0, height: -le },
349
282
  ArrowDown: { width: 0, height: le }
350
283
  }[s.key];
351
- i && (s.preventDefault(), e.setBesideSize({ width: a.width + i.width, height: a.height + i.height }, { save: !0 }));
284
+ o && (s.preventDefault(), e.setBesideSize({ width: a.width + o.width, height: a.height + o.height }, { save: !0 }));
352
285
  },
353
- onDoubleClick: () => e.setBesideSize(yt.default, { save: !0 }),
354
- className: B(
286
+ onDoubleClick: () => e.setBesideSize(vt.default, { save: !0 }),
287
+ className: j(
355
288
  "absolute bottom-0 z-10 h-3 w-3 touch-none outline-none hover:bg-primary/30 focus-visible:bg-primary/40",
356
289
  t === "left" ? "left-0 cursor-nesw-resize rounded-bl-card" : "right-0 cursor-nwse-resize rounded-br-card"
357
290
  )
358
291
  }
359
292
  );
360
293
  }
361
- const le = 16, Ct = 0.6;
362
- function vr({ instance: e, side: a, width: t }) {
363
- const n = j(void 0), r = (c) => {
364
- var f, w;
365
- const v = (w = (f = c.closest("aside")) == null ? void 0 : f.parentElement) == null ? void 0 : w.clientWidth;
366
- return v ? v * Ct : ge.max;
294
+ const le = 16, St = 0.6;
295
+ function or({ instance: e, side: a, width: t }) {
296
+ const n = H(void 0), r = (c) => {
297
+ var m, S;
298
+ const v = (S = (m = c.closest("aside")) == null ? void 0 : m.parentElement) == null ? void 0 : S.clientWidth;
299
+ return v ? v * St : ge.max;
367
300
  }, l = (c) => {
368
301
  var v;
369
302
  return ((v = c.closest("aside")) == null ? void 0 : v.getBoundingClientRect().width) || t;
370
303
  }, s = (c) => {
371
304
  const v = n.current;
372
305
  if (!v) return t;
373
- const f = c - v.startX;
374
- return tt(v.startWidth + (a === "left" ? -f : f), v.maxForArea);
375
- }, i = (c) => {
376
- var v, f;
377
- c.preventDefault(), (f = (v = c.currentTarget).setPointerCapture) == null || f.call(v, c.pointerId), n.current = { startX: c.clientX, startWidth: l(c.currentTarget), maxForArea: r(c.currentTarget) };
378
- }, m = (c) => {
306
+ const m = c - v.startX;
307
+ return Qe(v.startWidth + (a === "left" ? -m : m), v.maxForArea);
308
+ }, o = (c) => {
309
+ var v, m;
310
+ c.preventDefault(), (m = (v = c.currentTarget).setPointerCapture) == null || m.call(v, c.pointerId), n.current = { startX: c.clientX, startWidth: l(c.currentTarget), maxForArea: r(c.currentTarget) };
311
+ }, f = (c) => {
379
312
  n.current && e.setWidth(s(c.clientX));
380
313
  }, u = (c) => {
381
314
  n.current && (e.setWidth(s(c.clientX), { save: !0 }), n.current = void 0);
382
- }, y = (c) => {
315
+ }, w = (c) => {
383
316
  if (c.key !== "ArrowLeft" && c.key !== "ArrowRight") return;
384
317
  c.preventDefault();
385
318
  const v = c.key === "ArrowLeft" == (a === "left");
386
- e.setWidth(tt(l(c.currentTarget) + (v ? le : -le), r(c.currentTarget)), { save: !0 });
319
+ e.setWidth(Qe(l(c.currentTarget) + (v ? le : -le), r(c.currentTarget)), { save: !0 });
387
320
  };
388
- return /* @__PURE__ */ o(
321
+ return /* @__PURE__ */ i(
389
322
  "div",
390
323
  {
391
324
  role: "separator",
@@ -396,22 +329,22 @@ function vr({ instance: e, side: a, width: t }) {
396
329
  "aria-valuemax": ge.max,
397
330
  tabIndex: 0,
398
331
  title: "Drag to resize. Double-click to reset.",
399
- onPointerDown: i,
400
- onPointerMove: m,
332
+ onPointerDown: o,
333
+ onPointerMove: f,
401
334
  onPointerUp: u,
402
335
  onPointerCancel: u,
403
- onKeyDown: y,
336
+ onKeyDown: w,
404
337
  onDoubleClick: () => e.setWidth(ge.default, { save: !0 }),
405
- className: B(
338
+ className: j(
406
339
  "absolute inset-y-0 z-10 w-1.5 cursor-col-resize touch-none outline-none hover:bg-primary/30 focus-visible:bg-primary/40",
407
340
  a === "left" ? "-left-[3px]" : "-right-[3px]"
408
341
  )
409
342
  }
410
343
  );
411
344
  }
412
- function br(e) {
413
- const a = Yt();
414
- return K(
345
+ function dr(e) {
346
+ const a = Xt();
347
+ return W(
415
348
  async (t, n) => {
416
349
  const r = U.getState();
417
350
  if (r.isVisualEditing)
@@ -419,32 +352,32 @@ function br(e) {
419
352
  if (!e()) return { ok: !1, reason: "not_editable", message: ye.no_save };
420
353
  if (r.dashboard !== t.basedOn)
421
354
  return { ok: !1, reason: "dashboard_changed", message: ye.dashboard_changed };
422
- const l = Wa(t.basedOn, t.operations, t.context);
355
+ const l = $a(t.basedOn, t.operations, t.context);
423
356
  if (!l.ok) return { ok: !1, reason: "refused", message: l.failedAt.message };
424
357
  const s = { domainsById: {} };
425
- for (const i of l.queryFrames) {
426
- const m = await a(i, { reuseLoaded: !0 }).catch((u) => {
358
+ for (const o of l.queryFrames) {
359
+ const f = await a(o, { reuseLoaded: !0 }).catch((u) => {
427
360
  console.warn("Applying the change without refreshed semantic metadata:", u);
428
361
  });
429
- Qt(s, m);
362
+ Zt(s, f);
430
363
  }
431
364
  return n != null && n.stillWanted && !n.stillWanted() ? { ok: !1, reason: "dropped" } : e() ? U.getState().actions.applyProposal({ ...t, semanticExecutionPayload: s }) : { ok: !1, reason: "not_editable", message: ye.no_save };
432
365
  },
433
366
  [e, a]
434
367
  );
435
368
  }
436
- function gr(e) {
437
- const { canEditDashboard: a, isInspectionMode: t } = ea(), n = ta(), r = U(at), l = e && n && a === !0 && !t, s = j(l);
369
+ function cr(e) {
370
+ const { canEditDashboard: a, isInspectionMode: t } = Yt(), n = Qt(), r = U(et), l = e && n && a === !0 && !t, s = H(l);
438
371
  Ce(() => {
439
372
  s.current = l;
440
373
  });
441
- const i = K(
442
- () => s.current && at(U.getState()),
374
+ const o = W(
375
+ () => s.current && et(U.getState()),
443
376
  []
444
377
  );
445
- return { canChange: l && r, canChangeNow: i };
378
+ return { canChange: l && r, canChangeNow: o };
446
379
  }
447
- const It = {
380
+ const xt = {
448
381
  dashboard_changed: "Not applied: the dashboard on screen changed after this change was prepared.",
449
382
  not_editable: "Not applied: the dashboard can't be changed on screen right now (the editor is open, or Save isn't shown).",
450
383
  expired: "Not applied: it arrived after the time it had to land.",
@@ -455,68 +388,68 @@ const It = {
455
388
  changedSince: "Changed since. Cancel discards every unsaved change.",
456
389
  closeEditorToUndo: "Close the editor to undo."
457
390
  };
458
- function yr({
391
+ function ur({
459
392
  port: e,
460
393
  onLifecycleEvent: a
461
394
  }) {
462
- const { canChange: t, canChangeNow: n } = gr(!0), r = U((f) => {
463
- var w;
464
- return (w = f.dashboard) == null ? void 0 : w.id;
465
- }), l = br(n), [s, i] = L(null), m = j(/* @__PURE__ */ new Map()), u = j(/* @__PURE__ */ new Map()), y = j(Promise.resolve()), c = j({ apply: l, onLifecycleEvent: a });
395
+ const { canChange: t, canChangeNow: n } = cr(!0), r = U((m) => {
396
+ var S;
397
+ return (S = m.dashboard) == null ? void 0 : S.id;
398
+ }), l = dr(n), [s, o] = F(null), f = H(/* @__PURE__ */ new Map()), u = H(/* @__PURE__ */ new Map()), w = H(Promise.resolve()), c = H({ apply: l, onLifecycleEvent: a });
466
399
  Ce(() => {
467
400
  c.current = { apply: l, onLifecycleEvent: a };
468
- }), X(() => {
401
+ }), Z(() => {
469
402
  e.setScreenState({ eligible: t, ...r ? { dashboardId: r } : {} });
470
- }, [e, t, r]), X(
471
- () => U.subscribe((f, w) => {
472
- if (f.editSessionEpoch !== w.editSessionEpoch) {
473
- m.current.clear(), i(null);
403
+ }, [e, t, r]), Z(
404
+ () => U.subscribe((m, S) => {
405
+ if (m.editSessionEpoch !== S.editSessionEpoch) {
406
+ f.current.clear(), o(null);
474
407
  return;
475
408
  }
476
- if (f.dashboard !== w.dashboard)
477
- for (const [b, S] of m.current)
478
- S !== f.dashboard && m.current.delete(b);
409
+ if (m.dashboard !== S.dashboard)
410
+ for (const [b, y] of f.current)
411
+ y !== m.dashboard && f.current.delete(b);
479
412
  }),
480
413
  []
481
- ), X(() => {
482
- const f = (b) => {
483
- const S = U.getState().dashboard;
484
- if (!S || S.id !== b.dashboardId) return;
485
- const C = xr();
486
- m.current.set(C, S), e.answerCopyRequest({
414
+ ), Z(() => {
415
+ const m = (b) => {
416
+ const y = U.getState().dashboard;
417
+ if (!y || y.id !== b.dashboardId) return;
418
+ const C = hr();
419
+ f.current.set(C, y), e.answerCopyRequest({
487
420
  kind: "uploaded",
488
421
  screenId: e.screenId,
489
422
  requestId: b.requestId,
490
423
  revisionId: C,
491
- dashboard: S
424
+ dashboard: y
492
425
  });
493
- }, w = async (b, S) => {
494
- var g, E, R;
426
+ }, S = async (b, y) => {
427
+ var g, I, D;
495
428
  const C = u.current.get(b.deliveryId);
496
429
  if (C) {
497
430
  e.reportOutcome({ screenId: e.screenId, deliveryId: b.deliveryId, outcome: C });
498
431
  return;
499
432
  }
500
- const _ = m.current.get(b.revisionId), z = () => !_ || m.current.get(b.revisionId) !== _ ? "dashboard_changed" : performance.now() < S + b.applyWithinMs ? null : "expired", F = z();
501
- let P;
502
- if (F || !_)
503
- P = xe(F ?? "dashboard_changed");
433
+ const P = f.current.get(b.revisionId), z = () => !P || f.current.get(b.revisionId) !== P ? "dashboard_changed" : performance.now() < y + b.applyWithinMs ? null : "expired", O = z();
434
+ let _;
435
+ if (O || !P)
436
+ _ = xe(O ?? "dashboard_changed");
504
437
  else {
505
- let I = "expired";
506
- const H = await c.current.apply(
507
- { proposalId: b.proposalId, operations: b.operations, context: b.context, basedOn: _ },
438
+ let E = "expired";
439
+ const q = await c.current.apply(
440
+ { proposalId: b.proposalId, operations: b.operations, context: b.context, basedOn: P },
508
441
  {
509
442
  stillWanted: () => {
510
- const V = z();
511
- return V && (I = V), V === null;
443
+ const $ = z();
444
+ return $ && (E = $), $ === null;
512
445
  }
513
446
  }
514
447
  );
515
- P = Sr(H, I);
448
+ _ = fr(q, E);
516
449
  }
517
- if (u.current.set(b.deliveryId, P), e.reportOutcome({ screenId: e.screenId, deliveryId: b.deliveryId, outcome: P }), P.status !== "applied") return;
450
+ if (u.current.set(b.deliveryId, _), e.reportOutcome({ screenId: e.screenId, deliveryId: b.deliveryId, outcome: _ }), _.status !== "applied") return;
518
451
  const N = ((g = U.getState().dashboard) == null ? void 0 : g.id) ?? "";
519
- i({ deliveryId: b.deliveryId, proposalId: b.proposalId, summary: b.summary, dashboardId: N, words: null }), (R = (E = c.current).onLifecycleEvent) == null || R.call(E, {
452
+ o({ deliveryId: b.deliveryId, proposalId: b.proposalId, summary: b.summary, dashboardId: N, words: null }), (D = (I = c.current).onLifecycleEvent) == null || D.call(I, {
520
453
  type: "dashboard:change-applied",
521
454
  dashboardId: N,
522
455
  payload: { deliveryId: b.deliveryId, summary: b.summary }
@@ -524,29 +457,29 @@ function yr({
524
457
  };
525
458
  return e.subscribe((b) => {
526
459
  if (b.type === "copy_request") {
527
- f(b);
460
+ m(b);
528
461
  return;
529
462
  }
530
- const S = performance.now();
531
- y.current = y.current.then(
532
- () => w(b, S).catch((C) => console.error("[live-screen] a delivery failed", C))
463
+ const y = performance.now();
464
+ w.current = w.current.then(
465
+ () => S(b, y).catch((C) => console.error("[live-screen] a delivery failed", C))
533
466
  );
534
467
  });
535
468
  }, [e]);
536
- const v = K(() => {
537
- var w, b;
469
+ const v = W(() => {
470
+ var S, b;
538
471
  if (!s) return;
539
- const f = U.getState().actions.undoProposal(s.proposalId);
540
- f.ok ? ((b = (w = c.current).onLifecycleEvent) == null || b.call(w, {
472
+ const m = U.getState().actions.undoProposal(s.proposalId);
473
+ m.ok ? ((b = (S = c.current).onLifecycleEvent) == null || b.call(S, {
541
474
  type: "dashboard:change-undone",
542
475
  dashboardId: s.dashboardId,
543
476
  payload: { deliveryId: s.deliveryId, summary: s.summary }
544
- }), i(null)) : f.reason === "changed_since" ? i({ ...s, words: "changed_since" }) : f.reason === "not_editable" ? i({ ...s, words: "not_editable" }) : i(null);
477
+ }), o(null)) : m.reason === "changed_since" ? o({ ...s, words: "changed_since" }) : m.reason === "not_editable" ? o({ ...s, words: "not_editable" }) : o(null);
545
478
  }, [s]);
546
- return s ? /* @__PURE__ */ o(wr, { note: s, onUndo: v }) : null;
479
+ return s ? /* @__PURE__ */ i(mr, { note: s, onUndo: v }) : null;
547
480
  }
548
- function wr({ note: e, onUndo: a }) {
549
- const t = U((s) => aa(s, e.proposalId)), n = U((s) => s.isVisualEditing);
481
+ function mr({ note: e, onUndo: a }) {
482
+ const t = U((s) => ea(s, e.proposalId)), n = U((s) => s.isVisualEditing);
550
483
  if (t === "none" && e.words === null) return null;
551
484
  const r = e.words === "changed_since" || t === "changed_since", l = r ? "changed_since" : e.words === "not_editable" ? "not_editable" : t;
552
485
  return /* @__PURE__ */ h(
@@ -562,9 +495,9 @@ function wr({ note: e, onUndo: a }) {
562
495
  r ? `. ${ue.changedSince}` : e.words === "not_editable" ? `. ${ue.closeEditorToUndo}` : ""
563
496
  ] }),
564
497
  !r && t === "undoable" ? /* @__PURE__ */ h(te, { children: [
565
- /* @__PURE__ */ o("span", { "aria-hidden": "true", children: "·" }),
498
+ /* @__PURE__ */ i("span", { "aria-hidden": "true", children: "·" }),
566
499
  /* @__PURE__ */ h(
567
- q,
500
+ K,
568
501
  {
569
502
  variant: "outline",
570
503
  size: "xs",
@@ -573,7 +506,7 @@ function wr({ note: e, onUndo: a }) {
573
506
  title: n ? ue.closeEditorToUndo : void 0,
574
507
  onClick: a,
575
508
  children: [
576
- /* @__PURE__ */ o(ra, { className: "h-3 w-3" }),
509
+ /* @__PURE__ */ i(ta, { className: "h-3 w-3" }),
577
510
  ue.undo
578
511
  ]
579
512
  }
@@ -583,14 +516,14 @@ function wr({ note: e, onUndo: a }) {
583
516
  }
584
517
  );
585
518
  }
586
- function Sr(e, a) {
519
+ function fr(e, a) {
587
520
  if (e.ok) return { status: "applied" };
588
521
  switch (e.reason) {
589
522
  case "dashboard_changed":
590
523
  case "not_editable":
591
524
  return xe(e.reason);
592
525
  case "refused":
593
- return { status: "not_applied", reason: "refused", message: (e.message || It.refused).slice(0, 500) };
526
+ return { status: "not_applied", reason: "refused", message: (e.message || xt.refused).slice(0, 500) };
594
527
  case "dropped":
595
528
  return xe(a);
596
529
  case "previous_not_applied":
@@ -598,28 +531,28 @@ function Sr(e, a) {
598
531
  }
599
532
  }
600
533
  function xe(e) {
601
- return { status: "not_applied", reason: e, message: It[e] };
534
+ return { status: "not_applied", reason: e, message: xt[e] };
602
535
  }
603
- function xr() {
536
+ function hr() {
604
537
  return globalThis.crypto.randomUUID();
605
538
  }
606
- const Cr = Ee(() => import("./dashboard-controls-CY0gbcCt.js")), Ir = Ee(
607
- () => import("./edit-dashboard-visual-cX0FM-4i.js")
608
- ), Er = Ee(() => import("./dashboard-json-DsM79yem.js"));
609
- function An({
539
+ const pr = Ie(() => import("./dashboard-controls-BwKQEoGp.js")), br = Ie(
540
+ () => import("./edit-dashboard-visual-DGZABdS-.js")
541
+ ), vr = Ie(() => import("./dashboard-json-B3fR1_Oc.js"));
542
+ function gn({
610
543
  showControls: e = !1,
611
544
  showFooter: a = !0,
612
545
  liveScreen: t,
613
546
  ...n
614
547
  }) {
615
- const r = U((m) => m.isVisualEditing), l = U(
616
- (m) => m.showDashboardJSON
617
- ), { appearance: s, preferences: i } = n;
618
- return /* @__PURE__ */ o(na, { FallbackComponent: sa, children: /* @__PURE__ */ o(la, { dashboardProps: n, children: /* @__PURE__ */ h(oa, { children: [
619
- /* @__PURE__ */ o(ia, { componentType: "surfboard", componentId: n.id }),
620
- /* @__PURE__ */ h(da, { appearance: s, children: [
621
- /* @__PURE__ */ o(
622
- ca,
548
+ const r = U((f) => f.isVisualEditing), l = U(
549
+ (f) => f.showDashboardJSON
550
+ ), { appearance: s, preferences: o } = n;
551
+ return /* @__PURE__ */ i(aa, { FallbackComponent: ra, children: /* @__PURE__ */ i(na, { dashboardProps: n, children: /* @__PURE__ */ h(sa, { children: [
552
+ /* @__PURE__ */ i(la, { componentType: "surfboard", componentId: n.id }),
553
+ /* @__PURE__ */ h(ia, { appearance: s, children: [
554
+ /* @__PURE__ */ i(
555
+ oa,
623
556
  {
624
557
  toastOptions: {
625
558
  classNames: {
@@ -633,65 +566,65 @@ function An({
633
566
  }
634
567
  }
635
568
  ),
636
- /* @__PURE__ */ h(ua, { preferences: i, children: [
637
- l && /* @__PURE__ */ o(Se, { fallback: null, children: /* @__PURE__ */ o(Er, {}) }),
638
- /* @__PURE__ */ o(fa, { children: /* @__PURE__ */ o(Za, { children: /* @__PURE__ */ h("main", { className: "relative flex h-full w-full flex-col overflow-hidden", children: [
639
- e && /* @__PURE__ */ o(Se, { fallback: null, children: /* @__PURE__ */ o(Cr, {}) }),
640
- t && /* @__PURE__ */ o(yr, { port: t, onLifecycleEvent: n.onDashboardLifecycleEvent }),
569
+ /* @__PURE__ */ h(da, { preferences: o, children: [
570
+ l && /* @__PURE__ */ i(Se, { fallback: null, children: /* @__PURE__ */ i(vr, {}) }),
571
+ /* @__PURE__ */ i(ca, { children: /* @__PURE__ */ i(Ja, { children: /* @__PURE__ */ h("main", { className: "relative flex h-full w-full flex-col overflow-hidden", children: [
572
+ e && /* @__PURE__ */ i(Se, { fallback: null, children: /* @__PURE__ */ i(pr, {}) }),
573
+ t && /* @__PURE__ */ i(ur, { port: t, onLifecycleEvent: n.onDashboardLifecycleEvent }),
641
574
  /* @__PURE__ */ h("div", { className: "relative flex grow overflow-hidden", children: [
642
- /* @__PURE__ */ o("div", { className: "flex min-w-0 flex-1", children: /* @__PURE__ */ h(ma, { ...n, type: "dashboard", children: [
643
- r && /* @__PURE__ */ o(Se, { fallback: null, children: /* @__PURE__ */ o(Ir, {}) }),
644
- /* @__PURE__ */ o(Vt, { mode: r ? "hidden" : "visible", children: /* @__PURE__ */ o(qa, {}) })
575
+ /* @__PURE__ */ i("div", { className: "flex min-w-0 flex-1", children: /* @__PURE__ */ h(ua, { ...n, type: "dashboard", children: [
576
+ r && /* @__PURE__ */ i(Se, { fallback: null, children: /* @__PURE__ */ i(br, {}) }),
577
+ /* @__PURE__ */ i(jt, { mode: r ? "hidden" : "visible", children: /* @__PURE__ */ i(Wa, {}) })
645
578
  ] }) }),
646
- /* @__PURE__ */ o(ur, {})
579
+ /* @__PURE__ */ i(rr, {})
647
580
  ] })
648
581
  ] }) }) })
649
582
  ] })
650
583
  ] })
651
584
  ] }) }) });
652
585
  }
653
- var ct = 1, Nr = 0.9, Tr = 0.8, kr = 0.17, Ae = 0.1, Re = 0.999, Ar = 0.9999, Rr = 0.99, Dr = /[\\\/_+.#"@\[\(\{&]/, _r = /[\\\/_+.#"@\[\(\{&]/g, Pr = /[\s-]/, Et = /[\s-]/g;
654
- function Be(e, a, t, n, r, l, s) {
655
- if (l === a.length) return r === e.length ? ct : Rr;
656
- var i = `${r},${l}`;
657
- if (s[i] !== void 0) return s[i];
658
- for (var m = n.charAt(l), u = t.indexOf(m, r), y = 0, c, v, f, w; u >= 0; ) c = Be(e, a, t, n, u + 1, l + 1, s), c > y && (u === r ? c *= ct : Dr.test(e.charAt(u - 1)) ? (c *= Tr, f = e.slice(r, u - 1).match(_r), f && r > 0 && (c *= Math.pow(Re, f.length))) : Pr.test(e.charAt(u - 1)) ? (c *= Nr, w = e.slice(r, u - 1).match(Et), w && r > 0 && (c *= Math.pow(Re, w.length))) : (c *= kr, r > 0 && (c *= Math.pow(Re, u - r))), e.charAt(u) !== a.charAt(l) && (c *= Ar)), (c < Ae && t.charAt(u - 1) === n.charAt(l + 1) || n.charAt(l + 1) === n.charAt(l) && t.charAt(u - 1) !== n.charAt(l)) && (v = Be(e, a, t, n, u + 1, l + 2, s), v * Ae > c && (c = v * Ae)), c > y && (y = c), u = t.indexOf(m, u + 1);
659
- return s[i] = y, y;
586
+ var ot = 1, gr = 0.9, yr = 0.8, wr = 0.17, Ae = 0.1, De = 0.999, Sr = 0.9999, xr = 0.99, Cr = /[\\\/_+.#"@\[\(\{&]/, Er = /[\\\/_+.#"@\[\(\{&]/g, Ir = /[\s-]/, Ct = /[\s-]/g;
587
+ function je(e, a, t, n, r, l, s) {
588
+ if (l === a.length) return r === e.length ? ot : xr;
589
+ var o = `${r},${l}`;
590
+ if (s[o] !== void 0) return s[o];
591
+ for (var f = n.charAt(l), u = t.indexOf(f, r), w = 0, c, v, m, S; u >= 0; ) c = je(e, a, t, n, u + 1, l + 1, s), c > w && (u === r ? c *= ot : Cr.test(e.charAt(u - 1)) ? (c *= yr, m = e.slice(r, u - 1).match(Er), m && r > 0 && (c *= Math.pow(De, m.length))) : Ir.test(e.charAt(u - 1)) ? (c *= gr, S = e.slice(r, u - 1).match(Ct), S && r > 0 && (c *= Math.pow(De, S.length))) : (c *= wr, r > 0 && (c *= Math.pow(De, u - r))), e.charAt(u) !== a.charAt(l) && (c *= Sr)), (c < Ae && t.charAt(u - 1) === n.charAt(l + 1) || n.charAt(l + 1) === n.charAt(l) && t.charAt(u - 1) !== n.charAt(l)) && (v = je(e, a, t, n, u + 1, l + 2, s), v * Ae > c && (c = v * Ae)), c > w && (w = c), u = t.indexOf(f, u + 1);
592
+ return s[o] = w, w;
660
593
  }
661
- function ut(e) {
662
- return e.toLowerCase().replace(Et, " ");
594
+ function dt(e) {
595
+ return e.toLowerCase().replace(Ct, " ");
663
596
  }
664
- function Or(e, a, t) {
665
- return e = t && t.length > 0 ? `${e + " " + t.join(" ")}` : e, Be(e, a, ut(e), ut(a), 0, 0, {});
597
+ function Nr(e, a, t) {
598
+ return e = t && t.length > 0 ? `${e + " " + t.join(" ")}` : e, je(e, a, dt(e), dt(a), 0, 0, {});
666
599
  }
667
- var fe = '[cmdk-group=""]', De = '[cmdk-group-items=""]', Lr = '[cmdk-group-heading=""]', Nt = '[cmdk-item=""]', ft = `${Nt}:not([aria-disabled="true"])`, je = "cmdk-item-select", ne = "data-value", zr = (e, a, t) => Or(e, a, t), Tt = p.createContext(void 0), ve = () => p.useContext(Tt), kt = p.createContext(void 0), Je = () => p.useContext(kt), At = p.createContext(void 0), Rt = p.forwardRef((e, a) => {
600
+ var me = '[cmdk-group=""]', Re = '[cmdk-group-items=""]', Tr = '[cmdk-group-heading=""]', Et = '[cmdk-item=""]', ct = `${Et}:not([aria-disabled="true"])`, Be = "cmdk-item-select", ne = "data-value", kr = (e, a, t) => Nr(e, a, t), It = p.createContext(void 0), be = () => p.useContext(It), Nt = p.createContext(void 0), Ge = () => p.useContext(Nt), Tt = p.createContext(void 0), kt = p.forwardRef((e, a) => {
668
601
  let t = se(() => {
669
602
  var d, T;
670
603
  return { search: "", value: (T = (d = e.value) != null ? d : e.defaultValue) != null ? T : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
671
- }), n = se(() => /* @__PURE__ */ new Set()), r = se(() => /* @__PURE__ */ new Map()), l = se(() => /* @__PURE__ */ new Map()), s = se(() => /* @__PURE__ */ new Set()), i = Dt(e), { label: m, children: u, value: y, onValueChange: c, filter: v, shouldFilter: f, loop: w, disablePointerSelection: b = !1, vimBindings: S = !0, ...C } = e, _ = oe(), z = oe(), F = oe(), P = p.useRef(null), N = Hr();
604
+ }), n = se(() => /* @__PURE__ */ new Set()), r = se(() => /* @__PURE__ */ new Map()), l = se(() => /* @__PURE__ */ new Map()), s = se(() => /* @__PURE__ */ new Set()), o = At(e), { label: f, children: u, value: w, onValueChange: c, filter: v, shouldFilter: m, loop: S, disablePointerSelection: b = !1, vimBindings: y = !0, ...C } = e, P = ie(), z = ie(), O = ie(), _ = p.useRef(null), N = Mr();
672
605
  ae(() => {
673
- if (y !== void 0) {
674
- let d = y.trim();
606
+ if (w !== void 0) {
607
+ let d = w.trim();
675
608
  t.current.value = d, g.emit();
676
609
  }
677
- }, [y]), ae(() => {
610
+ }, [w]), ae(() => {
678
611
  N(6, re);
679
612
  }, []);
680
613
  let g = p.useMemo(() => ({ subscribe: (d) => (s.current.add(d), () => s.current.delete(d)), snapshot: () => t.current, setState: (d, T, A) => {
681
- var x, D, O, W;
614
+ var x, R, L, V;
682
615
  if (!Object.is(t.current[d], T)) {
683
- if (t.current[d] = T, d === "search") V(), I(), N(1, H);
616
+ if (t.current[d] = T, d === "search") $(), E(), N(1, q);
684
617
  else if (d === "value") {
685
618
  if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
686
- let M = document.getElementById(F);
687
- M ? M.focus() : (x = document.getElementById(_)) == null || x.focus();
619
+ let M = document.getElementById(O);
620
+ M ? M.focus() : (x = document.getElementById(P)) == null || x.focus();
688
621
  }
689
622
  if (N(7, () => {
690
623
  var M;
691
624
  t.current.selectedItemId = (M = J()) == null ? void 0 : M.id, g.emit();
692
- }), A || N(5, re), ((D = i.current) == null ? void 0 : D.value) !== void 0) {
625
+ }), A || N(5, re), ((R = o.current) == null ? void 0 : R.value) !== void 0) {
693
626
  let M = T ?? "";
694
- (W = (O = i.current).onValueChange) == null || W.call(O, M);
627
+ (V = (L = o.current).onValueChange) == null || V.call(L, M);
695
628
  return;
696
629
  }
697
630
  }
@@ -699,104 +632,104 @@ var fe = '[cmdk-group=""]', De = '[cmdk-group-items=""]', Lr = '[cmdk-group-head
699
632
  }
700
633
  }, emit: () => {
701
634
  s.current.forEach((d) => d());
702
- } }), []), E = p.useMemo(() => ({ value: (d, T, A) => {
635
+ } }), []), I = p.useMemo(() => ({ value: (d, T, A) => {
703
636
  var x;
704
- T !== ((x = l.current.get(d)) == null ? void 0 : x.value) && (l.current.set(d, { value: T, keywords: A }), t.current.filtered.items.set(d, R(T, A)), N(2, () => {
705
- I(), g.emit();
637
+ T !== ((x = l.current.get(d)) == null ? void 0 : x.value) && (l.current.set(d, { value: T, keywords: A }), t.current.filtered.items.set(d, D(T, A)), N(2, () => {
638
+ E(), g.emit();
706
639
  }));
707
640
  }, item: (d, T) => (n.current.add(d), T && (r.current.has(T) ? r.current.get(T).add(d) : r.current.set(T, /* @__PURE__ */ new Set([d]))), N(3, () => {
708
- V(), I(), t.current.value || H(), g.emit();
641
+ $(), E(), t.current.value || q(), g.emit();
709
642
  }), () => {
710
643
  l.current.delete(d), n.current.delete(d), t.current.filtered.items.delete(d);
711
644
  let A = J();
712
645
  N(4, () => {
713
- V(), (A == null ? void 0 : A.getAttribute("id")) === d && H(), g.emit();
646
+ $(), (A == null ? void 0 : A.getAttribute("id")) === d && q(), g.emit();
714
647
  });
715
648
  }), group: (d) => (r.current.has(d) || r.current.set(d, /* @__PURE__ */ new Set()), () => {
716
649
  l.current.delete(d), r.current.delete(d);
717
- }), filter: () => i.current.shouldFilter, label: m || e["aria-label"], getDisablePointerSelection: () => i.current.disablePointerSelection, listId: _, inputId: F, labelId: z, listInnerRef: P }), []);
718
- function R(d, T) {
650
+ }), filter: () => o.current.shouldFilter, label: f || e["aria-label"], getDisablePointerSelection: () => o.current.disablePointerSelection, listId: P, inputId: O, labelId: z, listInnerRef: _ }), []);
651
+ function D(d, T) {
719
652
  var A, x;
720
- let D = (x = (A = i.current) == null ? void 0 : A.filter) != null ? x : zr;
721
- return d ? D(d, t.current.search, T) : 0;
653
+ let R = (x = (A = o.current) == null ? void 0 : A.filter) != null ? x : kr;
654
+ return d ? R(d, t.current.search, T) : 0;
722
655
  }
723
- function I() {
724
- if (!t.current.search || i.current.shouldFilter === !1) return;
656
+ function E() {
657
+ if (!t.current.search || o.current.shouldFilter === !1) return;
725
658
  let d = t.current.filtered.items, T = [];
726
659
  t.current.filtered.groups.forEach((x) => {
727
- let D = r.current.get(x), O = 0;
728
- D.forEach((W) => {
729
- let M = d.get(W);
730
- O = Math.max(M, O);
731
- }), T.push([x, O]);
660
+ let R = r.current.get(x), L = 0;
661
+ R.forEach((V) => {
662
+ let M = d.get(V);
663
+ L = Math.max(M, L);
664
+ }), T.push([x, L]);
732
665
  });
733
- let A = P.current;
734
- k().sort((x, D) => {
735
- var O, W;
736
- let M = x.getAttribute("id"), be = D.getAttribute("id");
737
- return ((O = d.get(be)) != null ? O : 0) - ((W = d.get(M)) != null ? W : 0);
666
+ let A = _.current;
667
+ k().sort((x, R) => {
668
+ var L, V;
669
+ let M = x.getAttribute("id"), ve = R.getAttribute("id");
670
+ return ((L = d.get(ve)) != null ? L : 0) - ((V = d.get(M)) != null ? V : 0);
738
671
  }).forEach((x) => {
739
- let D = x.closest(De);
740
- D ? D.appendChild(x.parentElement === D ? x : x.closest(`${De} > *`)) : A.appendChild(x.parentElement === A ? x : x.closest(`${De} > *`));
741
- }), T.sort((x, D) => D[1] - x[1]).forEach((x) => {
742
- var D;
743
- let O = (D = P.current) == null ? void 0 : D.querySelector(`${fe}[${ne}="${encodeURIComponent(x[0])}"]`);
744
- O == null || O.parentElement.appendChild(O);
672
+ let R = x.closest(Re);
673
+ R ? R.appendChild(x.parentElement === R ? x : x.closest(`${Re} > *`)) : A.appendChild(x.parentElement === A ? x : x.closest(`${Re} > *`));
674
+ }), T.sort((x, R) => R[1] - x[1]).forEach((x) => {
675
+ var R;
676
+ let L = (R = _.current) == null ? void 0 : R.querySelector(`${me}[${ne}="${encodeURIComponent(x[0])}"]`);
677
+ L == null || L.parentElement.appendChild(L);
745
678
  });
746
679
  }
747
- function H() {
680
+ function q() {
748
681
  let d = k().find((A) => A.getAttribute("aria-disabled") !== "true"), T = d == null ? void 0 : d.getAttribute(ne);
749
682
  g.setState("value", T || void 0);
750
683
  }
751
- function V() {
684
+ function $() {
752
685
  var d, T, A, x;
753
- if (!t.current.search || i.current.shouldFilter === !1) {
686
+ if (!t.current.search || o.current.shouldFilter === !1) {
754
687
  t.current.filtered.count = n.current.size;
755
688
  return;
756
689
  }
757
690
  t.current.filtered.groups = /* @__PURE__ */ new Set();
758
- let D = 0;
759
- for (let O of n.current) {
760
- let W = (T = (d = l.current.get(O)) == null ? void 0 : d.value) != null ? T : "", M = (x = (A = l.current.get(O)) == null ? void 0 : A.keywords) != null ? x : [], be = R(W, M);
761
- t.current.filtered.items.set(O, be), be > 0 && D++;
691
+ let R = 0;
692
+ for (let L of n.current) {
693
+ let V = (T = (d = l.current.get(L)) == null ? void 0 : d.value) != null ? T : "", M = (x = (A = l.current.get(L)) == null ? void 0 : A.keywords) != null ? x : [], ve = D(V, M);
694
+ t.current.filtered.items.set(L, ve), ve > 0 && R++;
762
695
  }
763
- for (let [O, W] of r.current) for (let M of W) if (t.current.filtered.items.get(M) > 0) {
764
- t.current.filtered.groups.add(O);
696
+ for (let [L, V] of r.current) for (let M of V) if (t.current.filtered.items.get(M) > 0) {
697
+ t.current.filtered.groups.add(L);
765
698
  break;
766
699
  }
767
- t.current.filtered.count = D;
700
+ t.current.filtered.count = R;
768
701
  }
769
702
  function re() {
770
703
  var d, T, A;
771
704
  let x = J();
772
- x && (((d = x.parentElement) == null ? void 0 : d.firstChild) === x && ((A = (T = x.closest(fe)) == null ? void 0 : T.querySelector(Lr)) == null || A.scrollIntoView({ block: "nearest" })), x.scrollIntoView({ block: "nearest" }));
705
+ x && (((d = x.parentElement) == null ? void 0 : d.firstChild) === x && ((A = (T = x.closest(me)) == null ? void 0 : T.querySelector(Tr)) == null || A.scrollIntoView({ block: "nearest" })), x.scrollIntoView({ block: "nearest" }));
773
706
  }
774
707
  function J() {
775
708
  var d;
776
- return (d = P.current) == null ? void 0 : d.querySelector(`${Nt}[aria-selected="true"]`);
709
+ return (d = _.current) == null ? void 0 : d.querySelector(`${Et}[aria-selected="true"]`);
777
710
  }
778
711
  function k() {
779
712
  var d;
780
- return Array.from(((d = P.current) == null ? void 0 : d.querySelectorAll(ft)) || []);
713
+ return Array.from(((d = _.current) == null ? void 0 : d.querySelectorAll(ct)) || []);
781
714
  }
782
- function ie(d) {
715
+ function oe(d) {
783
716
  let T = k()[d];
784
717
  T && g.setState("value", T.getAttribute(ne));
785
718
  }
786
719
  function Te(d) {
787
720
  var T;
788
- let A = J(), x = k(), D = x.findIndex((W) => W === A), O = x[D + d];
789
- (T = i.current) != null && T.loop && (O = D + d < 0 ? x[x.length - 1] : D + d === x.length ? x[0] : x[D + d]), O && g.setState("value", O.getAttribute(ne));
721
+ let A = J(), x = k(), R = x.findIndex((V) => V === A), L = x[R + d];
722
+ (T = o.current) != null && T.loop && (L = R + d < 0 ? x[x.length - 1] : R + d === x.length ? x[0] : x[R + d]), L && g.setState("value", L.getAttribute(ne));
790
723
  }
791
- function Ze(d) {
792
- let T = J(), A = T == null ? void 0 : T.closest(fe), x;
793
- for (; A && !x; ) A = d > 0 ? Kr(A, fe) : qr(A, fe), x = A == null ? void 0 : A.querySelector(ft);
724
+ function Je(d) {
725
+ let T = J(), A = T == null ? void 0 : T.closest(me), x;
726
+ for (; A && !x; ) A = d > 0 ? Or(A, me) : Ur(A, me), x = A == null ? void 0 : A.querySelector(ct);
794
727
  x ? g.setState("value", x.getAttribute(ne)) : Te(d);
795
728
  }
796
- let Ye = () => ie(k().length - 1), Qe = (d) => {
797
- d.preventDefault(), d.metaKey ? Ye() : d.altKey ? Ze(1) : Te(1);
798
- }, et = (d) => {
799
- d.preventDefault(), d.metaKey ? ie(0) : d.altKey ? Ze(-1) : Te(-1);
729
+ let Xe = () => oe(k().length - 1), Ze = (d) => {
730
+ d.preventDefault(), d.metaKey ? Xe() : d.altKey ? Je(1) : Te(1);
731
+ }, Ye = (d) => {
732
+ d.preventDefault(), d.metaKey ? oe(0) : d.altKey ? Je(-1) : Te(-1);
800
733
  };
801
734
  return p.createElement(Q.div, { ref: a, tabIndex: -1, ...C, "cmdk-root": "", onKeyDown: (d) => {
802
735
  var T;
@@ -805,113 +738,113 @@ var fe = '[cmdk-group=""]', De = '[cmdk-group-items=""]', Lr = '[cmdk-group-head
805
738
  if (!(d.defaultPrevented || A)) switch (d.key) {
806
739
  case "n":
807
740
  case "j": {
808
- S && d.ctrlKey && Qe(d);
741
+ y && d.ctrlKey && Ze(d);
809
742
  break;
810
743
  }
811
744
  case "ArrowDown": {
812
- Qe(d);
745
+ Ze(d);
813
746
  break;
814
747
  }
815
748
  case "p":
816
749
  case "k": {
817
- S && d.ctrlKey && et(d);
750
+ y && d.ctrlKey && Ye(d);
818
751
  break;
819
752
  }
820
753
  case "ArrowUp": {
821
- et(d);
754
+ Ye(d);
822
755
  break;
823
756
  }
824
757
  case "Home": {
825
- d.preventDefault(), ie(0);
758
+ d.preventDefault(), oe(0);
826
759
  break;
827
760
  }
828
761
  case "End": {
829
- d.preventDefault(), Ye();
762
+ d.preventDefault(), Xe();
830
763
  break;
831
764
  }
832
765
  case "Enter": {
833
766
  d.preventDefault();
834
767
  let x = J();
835
768
  if (x) {
836
- let D = new Event(je);
837
- x.dispatchEvent(D);
769
+ let R = new Event(Be);
770
+ x.dispatchEvent(R);
838
771
  }
839
772
  }
840
773
  }
841
- } }, p.createElement("label", { "cmdk-label": "", htmlFor: E.inputId, id: E.labelId, style: Xr }, m), Ne(e, (d) => p.createElement(kt.Provider, { value: g }, p.createElement(Tt.Provider, { value: E }, d))));
842
- }), Fr = p.forwardRef((e, a) => {
774
+ } }, p.createElement("label", { "cmdk-label": "", htmlFor: I.inputId, id: I.labelId, style: Br }, f), Ne(e, (d) => p.createElement(Nt.Provider, { value: g }, p.createElement(It.Provider, { value: I }, d))));
775
+ }), Ar = p.forwardRef((e, a) => {
843
776
  var t, n;
844
- let r = oe(), l = p.useRef(null), s = p.useContext(At), i = ve(), m = Dt(e), u = (n = (t = m.current) == null ? void 0 : t.forceMount) != null ? n : s == null ? void 0 : s.forceMount;
777
+ let r = ie(), l = p.useRef(null), s = p.useContext(Tt), o = be(), f = At(e), u = (n = (t = f.current) == null ? void 0 : t.forceMount) != null ? n : s == null ? void 0 : s.forceMount;
845
778
  ae(() => {
846
- if (!u) return i.item(r, s == null ? void 0 : s.id);
779
+ if (!u) return o.item(r, s == null ? void 0 : s.id);
847
780
  }, [u]);
848
- let y = _t(r, l, [e.value, e.children, l], e.keywords), c = Je(), v = Y((N) => N.value && N.value === y.current), f = Y((N) => u || i.filter() === !1 ? !0 : N.search ? N.filtered.items.get(r) > 0 : !0);
781
+ let w = Dt(r, l, [e.value, e.children, l], e.keywords), c = Ge(), v = Y((N) => N.value && N.value === w.current), m = Y((N) => u || o.filter() === !1 ? !0 : N.search ? N.filtered.items.get(r) > 0 : !0);
849
782
  p.useEffect(() => {
850
783
  let N = l.current;
851
- if (!(!N || e.disabled)) return N.addEventListener(je, w), () => N.removeEventListener(je, w);
852
- }, [f, e.onSelect, e.disabled]);
853
- function w() {
784
+ if (!(!N || e.disabled)) return N.addEventListener(Be, S), () => N.removeEventListener(Be, S);
785
+ }, [m, e.onSelect, e.disabled]);
786
+ function S() {
854
787
  var N, g;
855
- b(), (g = (N = m.current).onSelect) == null || g.call(N, y.current);
788
+ b(), (g = (N = f.current).onSelect) == null || g.call(N, w.current);
856
789
  }
857
790
  function b() {
858
- c.setState("value", y.current, !0);
791
+ c.setState("value", w.current, !0);
859
792
  }
860
- if (!f) return null;
861
- let { disabled: S, value: C, onSelect: _, forceMount: z, keywords: F, ...P } = e;
862
- return p.createElement(Q.div, { ref: he(l, a), ...P, id: r, "cmdk-item": "", role: "option", "aria-disabled": !!S, "aria-selected": !!v, "data-disabled": !!S, "data-selected": !!v, onPointerMove: S || i.getDisablePointerSelection() ? void 0 : b, onClick: S ? void 0 : w }, e.children);
863
- }), Ur = p.forwardRef((e, a) => {
864
- let { heading: t, children: n, forceMount: r, ...l } = e, s = oe(), i = p.useRef(null), m = p.useRef(null), u = oe(), y = ve(), c = Y((f) => r || y.filter() === !1 ? !0 : f.search ? f.filtered.groups.has(s) : !0);
865
- ae(() => y.group(s), []), _t(s, i, [e.value, e.heading, m]);
793
+ if (!m) return null;
794
+ let { disabled: y, value: C, onSelect: P, forceMount: z, keywords: O, ..._ } = e;
795
+ return p.createElement(Q.div, { ref: he(l, a), ..._, id: r, "cmdk-item": "", role: "option", "aria-disabled": !!y, "aria-selected": !!v, "data-disabled": !!y, "data-selected": !!v, onPointerMove: y || o.getDisablePointerSelection() ? void 0 : b, onClick: y ? void 0 : S }, e.children);
796
+ }), Dr = p.forwardRef((e, a) => {
797
+ let { heading: t, children: n, forceMount: r, ...l } = e, s = ie(), o = p.useRef(null), f = p.useRef(null), u = ie(), w = be(), c = Y((m) => r || w.filter() === !1 ? !0 : m.search ? m.filtered.groups.has(s) : !0);
798
+ ae(() => w.group(s), []), Dt(s, o, [e.value, e.heading, f]);
866
799
  let v = p.useMemo(() => ({ id: s, forceMount: r }), [r]);
867
- return p.createElement(Q.div, { ref: he(i, a), ...l, "cmdk-group": "", role: "presentation", hidden: c ? void 0 : !0 }, t && p.createElement("div", { ref: m, "cmdk-group-heading": "", "aria-hidden": !0, id: u }, t), Ne(e, (f) => p.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": t ? u : void 0 }, p.createElement(At.Provider, { value: v }, f))));
868
- }), Mr = p.forwardRef((e, a) => {
800
+ return p.createElement(Q.div, { ref: he(o, a), ...l, "cmdk-group": "", role: "presentation", hidden: c ? void 0 : !0 }, t && p.createElement("div", { ref: f, "cmdk-group-heading": "", "aria-hidden": !0, id: u }, t), Ne(e, (m) => p.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": t ? u : void 0 }, p.createElement(Tt.Provider, { value: v }, m))));
801
+ }), Rr = p.forwardRef((e, a) => {
869
802
  let { alwaysRender: t, ...n } = e, r = p.useRef(null), l = Y((s) => !s.search);
870
803
  return !t && !l ? null : p.createElement(Q.div, { ref: he(r, a), ...n, "cmdk-separator": "", role: "separator" });
871
- }), Br = p.forwardRef((e, a) => {
872
- let { onValueChange: t, ...n } = e, r = e.value != null, l = Je(), s = Y((u) => u.search), i = Y((u) => u.selectedItemId), m = ve();
804
+ }), Pr = p.forwardRef((e, a) => {
805
+ let { onValueChange: t, ...n } = e, r = e.value != null, l = Ge(), s = Y((u) => u.search), o = Y((u) => u.selectedItemId), f = be();
873
806
  return p.useEffect(() => {
874
807
  e.value != null && l.setState("search", e.value);
875
- }, [e.value]), p.createElement(Q.input, { ref: a, ...n, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": m.listId, "aria-labelledby": m.labelId, "aria-activedescendant": i, id: m.inputId, type: "text", value: r ? e.value : s, onChange: (u) => {
808
+ }, [e.value]), p.createElement(Q.input, { ref: a, ...n, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": f.listId, "aria-labelledby": f.labelId, "aria-activedescendant": o, id: f.inputId, type: "text", value: r ? e.value : s, onChange: (u) => {
876
809
  r || l.setState("search", u.target.value), t == null || t(u.target.value);
877
810
  } });
878
- }), jr = p.forwardRef((e, a) => {
879
- let { children: t, label: n = "Suggestions", ...r } = e, l = p.useRef(null), s = p.useRef(null), i = Y((u) => u.selectedItemId), m = ve();
811
+ }), _r = p.forwardRef((e, a) => {
812
+ let { children: t, label: n = "Suggestions", ...r } = e, l = p.useRef(null), s = p.useRef(null), o = Y((u) => u.selectedItemId), f = be();
880
813
  return p.useEffect(() => {
881
814
  if (s.current && l.current) {
882
- let u = s.current, y = l.current, c, v = new ResizeObserver(() => {
815
+ let u = s.current, w = l.current, c, v = new ResizeObserver(() => {
883
816
  c = requestAnimationFrame(() => {
884
- let f = u.offsetHeight;
885
- y.style.setProperty("--cmdk-list-height", f.toFixed(1) + "px");
817
+ let m = u.offsetHeight;
818
+ w.style.setProperty("--cmdk-list-height", m.toFixed(1) + "px");
886
819
  });
887
820
  });
888
821
  return v.observe(u), () => {
889
822
  cancelAnimationFrame(c), v.unobserve(u);
890
823
  };
891
824
  }
892
- }, []), p.createElement(Q.div, { ref: he(l, a), ...r, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": i, "aria-label": n, id: m.listId }, Ne(e, (u) => p.createElement("div", { ref: he(s, m.listInnerRef), "cmdk-list-sizer": "" }, u)));
893
- }), $r = p.forwardRef((e, a) => {
894
- let { open: t, onOpenChange: n, overlayClassName: r, contentClassName: l, container: s, ...i } = e;
895
- return p.createElement(ha, { open: t, onOpenChange: n }, p.createElement(pa, { container: s }, p.createElement(va, { "cmdk-overlay": "", className: r }), p.createElement(ba, { "aria-label": e.label, "cmdk-dialog": "", className: l }, p.createElement(Rt, { ref: a, ...i }))));
896
- }), Vr = p.forwardRef((e, a) => Y((t) => t.filtered.count === 0) ? p.createElement(Q.div, { ref: a, ...e, "cmdk-empty": "", role: "presentation" }) : null), Wr = p.forwardRef((e, a) => {
825
+ }, []), p.createElement(Q.div, { ref: he(l, a), ...r, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": o, "aria-label": n, id: f.listId }, Ne(e, (u) => p.createElement("div", { ref: he(s, f.listInnerRef), "cmdk-list-sizer": "" }, u)));
826
+ }), Lr = p.forwardRef((e, a) => {
827
+ let { open: t, onOpenChange: n, overlayClassName: r, contentClassName: l, container: s, ...o } = e;
828
+ return p.createElement(ma, { open: t, onOpenChange: n }, p.createElement(fa, { container: s }, p.createElement(ha, { "cmdk-overlay": "", className: r }), p.createElement(pa, { "aria-label": e.label, "cmdk-dialog": "", className: l }, p.createElement(kt, { ref: a, ...o }))));
829
+ }), zr = p.forwardRef((e, a) => Y((t) => t.filtered.count === 0) ? p.createElement(Q.div, { ref: a, ...e, "cmdk-empty": "", role: "presentation" }) : null), Fr = p.forwardRef((e, a) => {
897
830
  let { progress: t, children: n, label: r = "Loading...", ...l } = e;
898
831
  return p.createElement(Q.div, { ref: a, ...l, "cmdk-loading": "", role: "progressbar", "aria-valuenow": t, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": r }, Ne(e, (s) => p.createElement("div", { "aria-hidden": !0 }, s)));
899
- }), $ = Object.assign(Rt, { List: jr, Item: Fr, Input: Br, Group: Ur, Separator: Mr, Dialog: $r, Empty: Vr, Loading: Wr });
900
- function Kr(e, a) {
832
+ }), B = Object.assign(kt, { List: _r, Item: Ar, Input: Pr, Group: Dr, Separator: Rr, Dialog: Lr, Empty: zr, Loading: Fr });
833
+ function Or(e, a) {
901
834
  let t = e.nextElementSibling;
902
835
  for (; t; ) {
903
836
  if (t.matches(a)) return t;
904
837
  t = t.nextElementSibling;
905
838
  }
906
839
  }
907
- function qr(e, a) {
840
+ function Ur(e, a) {
908
841
  let t = e.previousElementSibling;
909
842
  for (; t; ) {
910
843
  if (t.matches(a)) return t;
911
844
  t = t.previousElementSibling;
912
845
  }
913
846
  }
914
- function Dt(e) {
847
+ function At(e) {
915
848
  let a = p.useRef(e);
916
849
  return ae(() => {
917
850
  a.current = e;
@@ -923,24 +856,24 @@ function se(e) {
923
856
  return a.current === void 0 && (a.current = e()), a;
924
857
  }
925
858
  function Y(e) {
926
- let a = Je(), t = () => e(a.snapshot());
859
+ let a = Ge(), t = () => e(a.snapshot());
927
860
  return p.useSyncExternalStore(a.subscribe, t, t);
928
861
  }
929
- function _t(e, a, t, n = []) {
930
- let r = p.useRef(), l = ve();
862
+ function Dt(e, a, t, n = []) {
863
+ let r = p.useRef(), l = be();
931
864
  return ae(() => {
932
865
  var s;
933
- let i = (() => {
866
+ let o = (() => {
934
867
  var u;
935
- for (let y of t) {
936
- if (typeof y == "string") return y.trim();
937
- if (typeof y == "object" && "current" in y) return y.current ? (u = y.current.textContent) == null ? void 0 : u.trim() : r.current;
868
+ for (let w of t) {
869
+ if (typeof w == "string") return w.trim();
870
+ if (typeof w == "object" && "current" in w) return w.current ? (u = w.current.textContent) == null ? void 0 : u.trim() : r.current;
938
871
  }
939
- })(), m = n.map((u) => u.trim());
940
- l.value(e, i, m), (s = a.current) == null || s.setAttribute(ne, i), r.current = i;
872
+ })(), f = n.map((u) => u.trim());
873
+ l.value(e, o, f), (s = a.current) == null || s.setAttribute(ne, o), r.current = o;
941
874
  }), r;
942
875
  }
943
- var Hr = () => {
876
+ var Mr = () => {
944
877
  let [e, a] = p.useState(), t = se(() => /* @__PURE__ */ new Map());
945
878
  return ae(() => {
946
879
  t.current.forEach((n) => n()), t.current = /* @__PURE__ */ new Map();
@@ -948,33 +881,33 @@ var Hr = () => {
948
881
  t.current.set(n, r), a({});
949
882
  };
950
883
  };
951
- function Gr(e) {
884
+ function jr(e) {
952
885
  let a = e.type;
953
886
  return typeof a == "function" ? a(e.props) : "render" in a ? a.render(e.props) : e;
954
887
  }
955
888
  function Ne({ asChild: e, children: a }, t) {
956
- return e && p.isValidElement(a) ? p.cloneElement(Gr(a), { ref: a.ref }, t(a.props.children)) : t(a);
889
+ return e && p.isValidElement(a) ? p.cloneElement(jr(a), { ref: a.ref }, t(a.props.children)) : t(a);
957
890
  }
958
- var Xr = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
959
- const Pt = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o(
960
- $,
891
+ var Br = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
892
+ const Rt = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ i(
893
+ B,
961
894
  {
962
895
  ref: t,
963
- className: B(
896
+ className: j(
964
897
  "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
965
898
  e
966
899
  ),
967
900
  ...a
968
901
  }
969
902
  ));
970
- Pt.displayName = $.displayName;
971
- const Ot = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ h("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
972
- /* @__PURE__ */ o(ga, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
973
- /* @__PURE__ */ o(
974
- $.Input,
903
+ Rt.displayName = B.displayName;
904
+ const Pt = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ h("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
905
+ /* @__PURE__ */ i(ba, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
906
+ /* @__PURE__ */ i(
907
+ B.Input,
975
908
  {
976
909
  ref: t,
977
- className: B(
910
+ className: j(
978
911
  "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-[hsl(var(--semaphor-placeholder-foreground))] disabled:cursor-not-allowed disabled:opacity-50",
979
912
  e
980
913
  ),
@@ -982,74 +915,74 @@ const Ot = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ h("div",
982
915
  }
983
916
  )
984
917
  ] }));
985
- Ot.displayName = $.Input.displayName;
986
- const Lt = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o(
987
- $.List,
918
+ Pt.displayName = B.Input.displayName;
919
+ const _t = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ i(
920
+ B.List,
988
921
  {
989
922
  ref: t,
990
- className: B("max-h-[300px] overflow-y-auto overflow-x-hidden", e),
923
+ className: j("max-h-[300px] overflow-y-auto overflow-x-hidden", e),
991
924
  ...a
992
925
  }
993
926
  ));
994
- Lt.displayName = $.List.displayName;
995
- const zt = p.forwardRef((e, a) => /* @__PURE__ */ o(
996
- $.Empty,
927
+ _t.displayName = B.List.displayName;
928
+ const Lt = p.forwardRef((e, a) => /* @__PURE__ */ i(
929
+ B.Empty,
997
930
  {
998
931
  ref: a,
999
932
  className: "py-6 text-center text-sm",
1000
933
  ...e
1001
934
  }
1002
935
  ));
1003
- zt.displayName = $.Empty.displayName;
1004
- const $e = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o(
1005
- $.Group,
936
+ Lt.displayName = B.Empty.displayName;
937
+ const $e = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ i(
938
+ B.Group,
1006
939
  {
1007
940
  ref: t,
1008
- className: B(
941
+ className: j(
1009
942
  "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
1010
943
  e
1011
944
  ),
1012
945
  ...a
1013
946
  }
1014
947
  ));
1015
- $e.displayName = $.Group.displayName;
1016
- const Ft = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o(
1017
- $.Separator,
948
+ $e.displayName = B.Group.displayName;
949
+ const zt = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ i(
950
+ B.Separator,
1018
951
  {
1019
952
  ref: t,
1020
- className: B("-mx-1 h-px bg-border", e),
953
+ className: j("-mx-1 h-px bg-border", e),
1021
954
  ...a
1022
955
  }
1023
956
  ));
1024
- Ft.displayName = $.Separator.displayName;
1025
- const Ve = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o(
1026
- $.Item,
957
+ zt.displayName = B.Separator.displayName;
958
+ const Ve = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ i(
959
+ B.Item,
1027
960
  {
1028
961
  ref: t,
1029
- className: B(
962
+ className: j(
1030
963
  "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",
1031
964
  e
1032
965
  ),
1033
966
  ...a
1034
967
  }
1035
968
  ));
1036
- Ve.displayName = $.Item.displayName;
1037
- function Jr(e = {}) {
1038
- const { authToken: a, tokenProps: t } = He(), n = U(
969
+ Ve.displayName = B.Item.displayName;
970
+ function $r(e = {}) {
971
+ const { authToken: a, tokenProps: t } = qe(), n = U(
1039
972
  (N) => N.actions.applyResolvedCalendarPreferences
1040
- ), r = e.enabled ?? !0, l = (a == null ? void 0 : a.accessToken) ?? null, s = (t == null ? void 0 : t.apiServiceUrl) ?? null, [i, m] = L(!1), [u, y] = L(!1), [c, v] = L(!1), [f, w] = L(null), [b, S] = L(null), C = j(l);
1041
- C.current = l, X(() => {
1042
- S(null), w(null), m(!1), y(!1), v(!1);
973
+ ), r = e.enabled ?? !0, l = (a == null ? void 0 : a.accessToken) ?? null, s = (t == null ? void 0 : t.apiServiceUrl) ?? null, [o, f] = F(!1), [u, w] = F(!1), [c, v] = F(!1), [m, S] = F(null), [b, y] = F(null), C = H(l);
974
+ C.current = l, Z(() => {
975
+ y(null), S(null), f(!1), w(!1), v(!1);
1043
976
  }, [l]);
1044
- const _ = K(async (N) => {
1045
- const g = Ka(await N.json());
977
+ const P = W(async (N) => {
978
+ const g = Va(await N.json());
1046
979
  if (!g.ok)
1047
980
  throw new Error("Calendar preferences response is invalid");
1048
981
  return g.value;
1049
- }, []), z = K(async () => {
982
+ }, []), z = W(async () => {
1050
983
  if (!r || !l || !s) return;
1051
984
  const N = l;
1052
- m(!0), w(null);
985
+ f(!0), S(null);
1053
986
  try {
1054
987
  const g = await fetch(
1055
988
  `${s}/v1/user-preferences/calendar`,
@@ -1059,28 +992,28 @@ function Jr(e = {}) {
1059
992
  }
1060
993
  );
1061
994
  if (!g.ok) {
1062
- const R = await g.json().catch(() => ({}));
1063
- throw new Error(R.error || "Failed to fetch preferences");
995
+ const D = await g.json().catch(() => ({}));
996
+ throw new Error(D.error || "Failed to fetch preferences");
1064
997
  }
1065
- const E = await _(g);
1066
- C.current === N && S(E);
998
+ const I = await P(g);
999
+ C.current === N && y(I);
1067
1000
  } catch (g) {
1068
- C.current === N && w(g instanceof Error ? g.message : "Unknown error");
1001
+ C.current === N && S(g instanceof Error ? g.message : "Unknown error");
1069
1002
  } finally {
1070
- C.current === N && m(!1);
1003
+ C.current === N && f(!1);
1071
1004
  }
1072
- }, [l, s, r, _]);
1073
- X(() => {
1005
+ }, [l, s, r, P]);
1006
+ Z(() => {
1074
1007
  r && z();
1075
1008
  }, [r, z]);
1076
- const F = K(
1009
+ const O = W(
1077
1010
  async (N) => {
1078
1011
  if (!l || !s)
1079
- return w("Not authenticated"), !1;
1012
+ return S("Not authenticated"), !1;
1080
1013
  const g = l;
1081
- y(!0), w(null);
1014
+ w(!0), S(null);
1082
1015
  try {
1083
- const E = await fetch(
1016
+ const I = await fetch(
1084
1017
  `${s}/v1/user-preferences/calendar`,
1085
1018
  {
1086
1019
  method: "PATCH",
@@ -1091,29 +1024,29 @@ function Jr(e = {}) {
1091
1024
  body: JSON.stringify(N)
1092
1025
  }
1093
1026
  );
1094
- if (!E.ok) {
1095
- const I = await E.json().catch(() => ({}));
1096
- throw new Error(I.error || "Failed to update preferences");
1027
+ if (!I.ok) {
1028
+ const E = await I.json().catch(() => ({}));
1029
+ throw new Error(E.error || "Failed to update preferences");
1097
1030
  }
1098
- const R = await _(E);
1099
- return C.current !== g ? !1 : (S(R), n(R.resolved, R.sources), !0);
1100
- } catch (E) {
1101
- return C.current === g && w(E instanceof Error ? E.message : "Unknown error"), !1;
1031
+ const D = await P(I);
1032
+ return C.current !== g ? !1 : (y(D), n(D.resolved, D.sources), !0);
1033
+ } catch (I) {
1034
+ return C.current === g && S(I instanceof Error ? I.message : "Unknown error"), !1;
1102
1035
  } finally {
1103
- C.current === g && y(!1);
1036
+ C.current === g && w(!1);
1104
1037
  }
1105
1038
  },
1106
1039
  [
1107
1040
  l,
1108
1041
  s,
1109
1042
  n,
1110
- _
1043
+ P
1111
1044
  ]
1112
- ), P = K(async () => {
1045
+ ), _ = W(async () => {
1113
1046
  if (!l || !s)
1114
- return w("Not authenticated"), !1;
1047
+ return S("Not authenticated"), !1;
1115
1048
  const N = l;
1116
- v(!0), w(null);
1049
+ v(!0), S(null);
1117
1050
  try {
1118
1051
  const g = await fetch(
1119
1052
  `${s}/v1/user-preferences/calendar`,
@@ -1123,13 +1056,13 @@ function Jr(e = {}) {
1123
1056
  }
1124
1057
  );
1125
1058
  if (!g.ok) {
1126
- const R = await g.json().catch(() => ({}));
1127
- throw new Error(R.error || "Failed to clear preferences");
1059
+ const D = await g.json().catch(() => ({}));
1060
+ throw new Error(D.error || "Failed to clear preferences");
1128
1061
  }
1129
- const E = await _(g);
1130
- return C.current !== N ? !1 : (S(E), n(E.resolved, E.sources), !0);
1062
+ const I = await P(g);
1063
+ return C.current !== N ? !1 : (y(I), n(I.resolved, I.sources), !0);
1131
1064
  } catch (g) {
1132
- return C.current === N && w(g instanceof Error ? g.message : "Unknown error"), !1;
1065
+ return C.current === N && S(g instanceof Error ? g.message : "Unknown error"), !1;
1133
1066
  } finally {
1134
1067
  C.current === N && v(!1);
1135
1068
  }
@@ -1137,20 +1070,20 @@ function Jr(e = {}) {
1137
1070
  l,
1138
1071
  s,
1139
1072
  n,
1140
- _
1073
+ P
1141
1074
  ]);
1142
1075
  return {
1143
1076
  preferences: b,
1144
- isLoading: i,
1077
+ isLoading: o,
1145
1078
  isSaving: u,
1146
1079
  isClearing: c,
1147
- error: f,
1148
- updatePreferences: F,
1149
- clearPreferences: P,
1080
+ error: m,
1081
+ updatePreferences: O,
1082
+ clearPreferences: _,
1150
1083
  refetch: z
1151
1084
  };
1152
1085
  }
1153
- const Ie = [
1086
+ const Ee = [
1154
1087
  { value: "America/New_York", label: "Eastern Time (US & Canada)" },
1155
1088
  { value: "America/Chicago", label: "Central Time (US & Canada)" },
1156
1089
  { value: "America/Denver", label: "Mountain Time (US & Canada)" },
@@ -1165,21 +1098,21 @@ const Ie = [
1165
1098
  { value: "Asia/Kolkata", label: "Mumbai, New Delhi" },
1166
1099
  { value: "Australia/Sydney", label: "Sydney" },
1167
1100
  { value: "UTC", label: "UTC" }
1168
- ], Ut = [
1101
+ ], Ft = [
1169
1102
  { value: 0, label: "Sunday" },
1170
1103
  { value: 1, label: "Monday" },
1171
1104
  { value: 6, label: "Saturday" }
1172
- ], mt = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
1173
- function Zr() {
1105
+ ], ut = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
1106
+ function Vr() {
1174
1107
  try {
1175
1108
  const e = Intl;
1176
1109
  if (e.supportedValuesOf)
1177
1110
  return e.supportedValuesOf("timeZone");
1178
1111
  } catch {
1179
1112
  }
1180
- return Ie.map((e) => e.value);
1113
+ return Ee.map((e) => e.value);
1181
1114
  }
1182
- function Yr(e) {
1115
+ function Wr(e) {
1183
1116
  if (!e) return "default";
1184
1117
  if (e.tz !== e.weekStart) return "inherited";
1185
1118
  switch (e.tz) {
@@ -1195,15 +1128,15 @@ function Yr(e) {
1195
1128
  return "default";
1196
1129
  }
1197
1130
  }
1198
- function ht(e) {
1199
- const a = Ie.find((t) => t.value === e);
1131
+ function mt(e) {
1132
+ const a = Ee.find((t) => t.value === e);
1200
1133
  return a ? a.label : e;
1201
1134
  }
1202
- function Qr(e) {
1203
- const a = Ut.find((t) => t.value === e);
1135
+ function Kr(e) {
1136
+ const a = Ft.find((t) => t.value === e);
1204
1137
  return a ? a.label : String(e);
1205
1138
  }
1206
- function en({
1139
+ function qr({
1207
1140
  active: e,
1208
1141
  onClose: a
1209
1142
  }) {
@@ -1213,52 +1146,52 @@ function en({
1213
1146
  isSaving: r,
1214
1147
  isClearing: l,
1215
1148
  updatePreferences: s,
1216
- clearPreferences: i
1217
- } = Jr({ enabled: e }), m = ya(), u = (t == null ? void 0 : t.resolved.tz) || (m == null ? void 0 : m.tz) || "UTC", y = (t == null ? void 0 : t.resolved.weekStart) ?? (m == null ? void 0 : m.weekStart) ?? 1, [c, v] = L((t == null ? void 0 : t.stored) === null), [f, w] = L(!1), [b, S] = L(
1149
+ clearPreferences: o
1150
+ } = $r({ enabled: e }), f = va(), u = (t == null ? void 0 : t.resolved.tz) || (f == null ? void 0 : f.tz) || "UTC", w = (t == null ? void 0 : t.resolved.weekStart) ?? (f == null ? void 0 : f.weekStart) ?? 1, [c, v] = F((t == null ? void 0 : t.stored) === null), [m, S] = F(!1), [b, y] = F(
1218
1151
  u
1219
- ), [C, _] = L(
1220
- y
1221
- ), [z, F] = L(!1), P = ee(() => Zr(), []), N = ee(
1222
- () => P.filter(
1223
- (k) => !Ie.some((ie) => ie.value === k)
1152
+ ), [C, P] = F(
1153
+ w
1154
+ ), [z, O] = F(!1), _ = ee(() => Vr(), []), N = ee(
1155
+ () => _.filter(
1156
+ (k) => !Ee.some((oe) => oe.value === k)
1224
1157
  ),
1225
- [P]
1226
- ), g = ee(() => ht(b), [b]), E = t != null && t.inherited ? ht(t.inherited.tz) : "UTC", R = t != null && t.inherited ? Qr(t.inherited.weekStart) : "Monday", I = Yr(
1158
+ [_]
1159
+ ), g = ee(() => mt(b), [b]), I = t != null && t.inherited ? mt(t.inherited.tz) : "UTC", D = t != null && t.inherited ? Kr(t.inherited.weekStart) : "Monday", E = Wr(
1227
1160
  t == null ? void 0 : t.inheritedSources
1228
1161
  );
1229
- jt.useEffect(() => {
1162
+ Mt.useEffect(() => {
1230
1163
  if (!e) {
1231
- w(!1);
1164
+ S(!1);
1232
1165
  return;
1233
1166
  }
1234
- f || (t && v(t.stored === null), S(u), _(y));
1167
+ m || (t && v(t.stored === null), y(u), P(w));
1235
1168
  }, [
1236
1169
  e,
1237
- f,
1170
+ m,
1238
1171
  t,
1239
1172
  u,
1240
- y
1173
+ w
1241
1174
  ]);
1242
- const H = async () => {
1175
+ const q = async () => {
1243
1176
  if (n) {
1244
1177
  G.error("Preferences are still loading. Please try again.");
1245
1178
  return;
1246
1179
  }
1247
- c ? await i() ? (G.success("Now using default settings."), a()) : G.error("Failed to save preferences. Please try again.") : await s({
1180
+ c ? await o() ? (G.success("Now using default settings."), a()) : G.error("Failed to save preferences. Please try again.") : await s({
1248
1181
  tz: b,
1249
1182
  weekStart: C
1250
1183
  }) ? (G.success("Preferences saved."), a()) : G.error("Failed to save preferences. Please try again.");
1251
- }, V = () => {
1184
+ }, $ = () => {
1252
1185
  a();
1253
1186
  }, re = r || l, J = re || n;
1254
1187
  return /* @__PURE__ */ h(te, { children: [
1255
1188
  /* @__PURE__ */ h("div", { className: "space-y-4 py-1", children: [
1256
1189
  /* @__PURE__ */ h(
1257
- rt,
1190
+ tt,
1258
1191
  {
1259
1192
  value: c ? "defaults" : "custom",
1260
1193
  onValueChange: (k) => {
1261
- w(!0), v(k === "defaults");
1194
+ S(!0), v(k === "defaults");
1262
1195
  },
1263
1196
  className: "space-y-0.5",
1264
1197
  children: [
@@ -1266,15 +1199,15 @@ function en({
1266
1199
  "label",
1267
1200
  {
1268
1201
  htmlFor: "mode-defaults",
1269
- className: B(
1202
+ className: j(
1270
1203
  "flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",
1271
1204
  c && "bg-muted/50"
1272
1205
  ),
1273
1206
  onClick: () => {
1274
- w(!0), v(!0);
1207
+ S(!0), v(!0);
1275
1208
  },
1276
1209
  children: [
1277
- /* @__PURE__ */ o(
1210
+ /* @__PURE__ */ i(
1278
1211
  ke,
1279
1212
  {
1280
1213
  value: "defaults",
@@ -1285,13 +1218,13 @@ function en({
1285
1218
  /* @__PURE__ */ h("div", { className: "flex-1 min-w-0", children: [
1286
1219
  /* @__PURE__ */ h("p", { className: "text-[13px] font-medium text-foreground", children: [
1287
1220
  "Use ",
1288
- I,
1221
+ E,
1289
1222
  " defaults"
1290
1223
  ] }),
1291
1224
  /* @__PURE__ */ h("p", { className: "text-[12px] text-muted-foreground", children: [
1292
- E,
1225
+ I,
1293
1226
  ", week starts ",
1294
- R
1227
+ D
1295
1228
  ] })
1296
1229
  ] })
1297
1230
  ]
@@ -1301,15 +1234,15 @@ function en({
1301
1234
  "label",
1302
1235
  {
1303
1236
  htmlFor: "mode-custom",
1304
- className: B(
1237
+ className: j(
1305
1238
  "flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",
1306
1239
  !c && "bg-muted/50"
1307
1240
  ),
1308
1241
  onClick: () => {
1309
- w(!0), v(!1);
1242
+ S(!0), v(!1);
1310
1243
  },
1311
1244
  children: [
1312
- /* @__PURE__ */ o(
1245
+ /* @__PURE__ */ i(
1313
1246
  ke,
1314
1247
  {
1315
1248
  value: "custom",
@@ -1317,7 +1250,7 @@ function en({
1317
1250
  className: "mt-0.5"
1318
1251
  }
1319
1252
  ),
1320
- /* @__PURE__ */ o("p", { className: "flex-1 text-[13px] font-medium text-foreground", children: "Use custom settings" })
1253
+ /* @__PURE__ */ i("p", { className: "flex-1 text-[13px] font-medium text-foreground", children: "Use custom settings" })
1321
1254
  ]
1322
1255
  }
1323
1256
  )
@@ -1327,22 +1260,22 @@ function en({
1327
1260
  /* @__PURE__ */ h(
1328
1261
  "div",
1329
1262
  {
1330
- className: B(
1263
+ className: j(
1331
1264
  "space-y-4 border-t border-border/60 pt-4 transition-opacity",
1332
1265
  c && "pointer-events-none opacity-50"
1333
1266
  ),
1334
1267
  children: [
1335
1268
  /* @__PURE__ */ h("div", { className: "space-y-1.5", children: [
1336
- /* @__PURE__ */ o(pe, { className: mt, children: "Timezone" }),
1269
+ /* @__PURE__ */ i(pe, { className: ut, children: "Timezone" }),
1337
1270
  /* @__PURE__ */ h(
1338
- za,
1271
+ La,
1339
1272
  {
1340
1273
  open: z,
1341
- onOpenChange: F,
1274
+ onOpenChange: O,
1342
1275
  modal: !0,
1343
1276
  children: [
1344
- /* @__PURE__ */ o(Fa, { asChild: !0, children: /* @__PURE__ */ h(
1345
- q,
1277
+ /* @__PURE__ */ i(za, { asChild: !0, children: /* @__PURE__ */ h(
1278
+ K,
1346
1279
  {
1347
1280
  variant: "outline",
1348
1281
  size: "xs",
@@ -1351,56 +1284,56 @@ function en({
1351
1284
  className: "w-full justify-between text-[12px] font-normal",
1352
1285
  disabled: c,
1353
1286
  children: [
1354
- /* @__PURE__ */ o("span", { className: "truncate", children: g }),
1355
- /* @__PURE__ */ o(wa, { className: "ml-2 h-3.5 w-3.5 shrink-0 opacity-50" })
1287
+ /* @__PURE__ */ i("span", { className: "truncate", children: g }),
1288
+ /* @__PURE__ */ i(ga, { className: "ml-2 h-3.5 w-3.5 shrink-0 opacity-50" })
1356
1289
  ]
1357
1290
  }
1358
1291
  ) }),
1359
- /* @__PURE__ */ o(
1360
- Ua,
1292
+ /* @__PURE__ */ i(
1293
+ Fa,
1361
1294
  {
1362
1295
  className: "z-50 w-[--radix-popover-trigger-width] p-0",
1363
1296
  align: "start",
1364
- children: /* @__PURE__ */ h(Pt, { className: "overflow-visible", children: [
1365
- /* @__PURE__ */ o(Ot, { placeholder: "Search timezones…" }),
1366
- /* @__PURE__ */ h(Lt, { children: [
1367
- /* @__PURE__ */ o(zt, { children: "No timezone found." }),
1368
- /* @__PURE__ */ o($e, { heading: "Common", children: Ie.map((k) => /* @__PURE__ */ h(
1297
+ children: /* @__PURE__ */ h(Rt, { className: "overflow-visible", children: [
1298
+ /* @__PURE__ */ i(Pt, { placeholder: "Search timezones…" }),
1299
+ /* @__PURE__ */ h(_t, { children: [
1300
+ /* @__PURE__ */ i(Lt, { children: "No timezone found." }),
1301
+ /* @__PURE__ */ i($e, { heading: "Common", children: Ee.map((k) => /* @__PURE__ */ h(
1369
1302
  Ve,
1370
1303
  {
1371
1304
  value: `${k.value} ${k.label}`,
1372
1305
  onSelect: () => {
1373
- w(!0), S(k.value), F(!1);
1306
+ S(!0), y(k.value), O(!1);
1374
1307
  },
1375
1308
  children: [
1376
- /* @__PURE__ */ o(
1377
- nt,
1309
+ /* @__PURE__ */ i(
1310
+ at,
1378
1311
  {
1379
- className: B(
1312
+ className: j(
1380
1313
  "h-3.5 w-3.5",
1381
1314
  b === k.value ? "opacity-100" : "opacity-0"
1382
1315
  )
1383
1316
  }
1384
1317
  ),
1385
- /* @__PURE__ */ o("span", { className: "flex-1", children: k.label }),
1386
- /* @__PURE__ */ o("span", { className: "text-[11px] text-muted-foreground", children: k.value })
1318
+ /* @__PURE__ */ i("span", { className: "flex-1", children: k.label }),
1319
+ /* @__PURE__ */ i("span", { className: "text-[11px] text-muted-foreground", children: k.value })
1387
1320
  ]
1388
1321
  },
1389
1322
  k.value
1390
1323
  )) }),
1391
- /* @__PURE__ */ o(Ft, {}),
1392
- /* @__PURE__ */ o($e, { heading: "All timezones", children: N.map((k) => /* @__PURE__ */ h(
1324
+ /* @__PURE__ */ i(zt, {}),
1325
+ /* @__PURE__ */ i($e, { heading: "All timezones", children: N.map((k) => /* @__PURE__ */ h(
1393
1326
  Ve,
1394
1327
  {
1395
1328
  value: k,
1396
1329
  onSelect: () => {
1397
- w(!0), S(k), F(!1);
1330
+ S(!0), y(k), O(!1);
1398
1331
  },
1399
1332
  children: [
1400
- /* @__PURE__ */ o(
1401
- nt,
1333
+ /* @__PURE__ */ i(
1334
+ at,
1402
1335
  {
1403
- className: B(
1336
+ className: j(
1404
1337
  "h-3.5 w-3.5",
1405
1338
  b === k ? "opacity-100" : "opacity-0"
1406
1339
  )
@@ -1420,26 +1353,26 @@ function en({
1420
1353
  )
1421
1354
  ] }),
1422
1355
  /* @__PURE__ */ h("div", { className: "space-y-1.5", children: [
1423
- /* @__PURE__ */ o(pe, { className: mt, children: "Week starts on" }),
1424
- /* @__PURE__ */ o(
1425
- rt,
1356
+ /* @__PURE__ */ i(pe, { className: ut, children: "Week starts on" }),
1357
+ /* @__PURE__ */ i(
1358
+ tt,
1426
1359
  {
1427
1360
  value: String(C),
1428
1361
  onValueChange: (k) => {
1429
- w(!0), _(Number(k));
1362
+ S(!0), P(Number(k));
1430
1363
  },
1431
1364
  className: "flex gap-4",
1432
1365
  disabled: c,
1433
- children: Ut.map((k) => /* @__PURE__ */ h(
1366
+ children: Ft.map((k) => /* @__PURE__ */ h(
1434
1367
  "label",
1435
1368
  {
1436
1369
  htmlFor: `week-start-${k.value}`,
1437
- className: B(
1370
+ className: j(
1438
1371
  "flex cursor-pointer items-center gap-2 text-[13px]",
1439
1372
  c && "cursor-not-allowed"
1440
1373
  ),
1441
1374
  children: [
1442
- /* @__PURE__ */ o(
1375
+ /* @__PURE__ */ i(
1443
1376
  ke,
1444
1377
  {
1445
1378
  value: String(k.value),
@@ -1459,111 +1392,111 @@ function en({
1459
1392
  }
1460
1393
  )
1461
1394
  ] }),
1462
- /* @__PURE__ */ h(Ge, { children: [
1463
- /* @__PURE__ */ o(
1464
- q,
1395
+ /* @__PURE__ */ h(He, { children: [
1396
+ /* @__PURE__ */ i(
1397
+ K,
1465
1398
  {
1466
1399
  variant: "outline",
1467
1400
  size: "xs",
1468
- onClick: V,
1401
+ onClick: $,
1469
1402
  disabled: re,
1470
1403
  children: "Cancel"
1471
1404
  }
1472
1405
  ),
1473
- /* @__PURE__ */ o(q, { size: "xs", onClick: H, disabled: J, children: re ? /* @__PURE__ */ h(te, { children: [
1474
- /* @__PURE__ */ o(St, { className: "h-3.5 w-3.5 animate-spin" }),
1406
+ /* @__PURE__ */ i(K, { size: "xs", onClick: q, disabled: J, children: re ? /* @__PURE__ */ h(te, { children: [
1407
+ /* @__PURE__ */ i(yt, { className: "h-3.5 w-3.5 animate-spin" }),
1475
1408
  "Saving…"
1476
1409
  ] }) : "Save" })
1477
1410
  ] })
1478
1411
  ] });
1479
1412
  }
1480
- function tn(e = {}) {
1481
- const { authToken: a, tokenProps: t } = He(), n = U(
1413
+ function Hr(e = {}) {
1414
+ const { authToken: a, tokenProps: t } = qe(), n = U(
1482
1415
  (g) => g.actions.applyResolvedValueFormatPreferences
1483
- ), r = e.enabled ?? !0, l = (a == null ? void 0 : a.accessToken) ?? null, s = (t == null ? void 0 : t.apiServiceUrl) ?? null, i = j(l);
1484
- i.current = l;
1485
- const [m, u] = L(null), [y, c] = L(!1), [v, f] = L(!1), [w, b] = L(!1), [S, C] = L(null);
1486
- X(() => {
1487
- u(null), C(null), c(!1), f(!1), b(!1);
1416
+ ), r = e.enabled ?? !0, l = (a == null ? void 0 : a.accessToken) ?? null, s = (t == null ? void 0 : t.apiServiceUrl) ?? null, o = H(l);
1417
+ o.current = l;
1418
+ const [f, u] = F(null), [w, c] = F(!1), [v, m] = F(!1), [S, b] = F(!1), [y, C] = F(null);
1419
+ Z(() => {
1420
+ u(null), C(null), c(!1), m(!1), b(!1);
1488
1421
  }, [l]);
1489
- const _ = K(async (g) => {
1490
- const E = ja(await g.json());
1491
- if (!E.ok)
1422
+ const P = W(async (g) => {
1423
+ const I = Ma(await g.json());
1424
+ if (!I.ok)
1492
1425
  throw new Error("Value format preferences response is invalid");
1493
- return E.value;
1494
- }, []), z = K(
1495
- async (g, E) => {
1426
+ return I.value;
1427
+ }, []), z = W(
1428
+ async (g, I) => {
1496
1429
  if (!l || !s)
1497
1430
  throw new Error("Not authenticated");
1498
- const R = await fetch(
1431
+ const D = await fetch(
1499
1432
  `${s}/v1/user-preferences/value-format`,
1500
1433
  {
1501
1434
  method: g,
1502
1435
  headers: {
1503
1436
  Authorization: `Bearer ${l}`,
1504
- ...E ? { "Content-Type": "application/json" } : {}
1437
+ ...I ? { "Content-Type": "application/json" } : {}
1505
1438
  },
1506
- body: E ? JSON.stringify(E) : void 0
1439
+ body: I ? JSON.stringify(I) : void 0
1507
1440
  }
1508
1441
  );
1509
- if (!R.ok) {
1510
- const I = await R.json().catch(() => ({}));
1511
- throw new Error(I.error || "Failed to update preferences");
1442
+ if (!D.ok) {
1443
+ const E = await D.json().catch(() => ({}));
1444
+ throw new Error(E.error || "Failed to update preferences");
1512
1445
  }
1513
- return _(R);
1446
+ return P(D);
1514
1447
  },
1515
- [l, s, _]
1516
- ), F = K(async () => {
1448
+ [l, s, P]
1449
+ ), O = W(async () => {
1517
1450
  if (!r || !l || !s) return;
1518
1451
  const g = l;
1519
1452
  c(!0), C(null);
1520
1453
  try {
1521
- const E = await z("GET");
1522
- i.current === g && u(E);
1523
- } catch (E) {
1524
- i.current === g && C(E instanceof Error ? E.message : "Unknown error");
1454
+ const I = await z("GET");
1455
+ o.current === g && u(I);
1456
+ } catch (I) {
1457
+ o.current === g && C(I instanceof Error ? I.message : "Unknown error");
1525
1458
  } finally {
1526
- i.current === g && c(!1);
1459
+ o.current === g && c(!1);
1527
1460
  }
1528
1461
  }, [l, s, r, z]);
1529
- X(() => {
1530
- r && F();
1531
- }, [r, F]);
1532
- const P = K(
1462
+ Z(() => {
1463
+ r && O();
1464
+ }, [r, O]);
1465
+ const _ = W(
1533
1466
  async (g) => {
1534
- const E = l;
1535
- f(!0), C(null);
1467
+ const I = l;
1468
+ m(!0), C(null);
1536
1469
  try {
1537
- const R = await z("PATCH", g);
1538
- return i.current !== E ? !1 : (u(R), n(R.resolved, R.sources), !0);
1539
- } catch (R) {
1540
- return i.current === E && C(R instanceof Error ? R.message : "Unknown error"), !1;
1470
+ const D = await z("PATCH", g);
1471
+ return o.current !== I ? !1 : (u(D), n(D.resolved, D.sources), !0);
1472
+ } catch (D) {
1473
+ return o.current === I && C(D instanceof Error ? D.message : "Unknown error"), !1;
1541
1474
  } finally {
1542
- i.current === E && f(!1);
1475
+ o.current === I && m(!1);
1543
1476
  }
1544
1477
  },
1545
1478
  [l, n, z]
1546
- ), N = K(async () => {
1479
+ ), N = W(async () => {
1547
1480
  const g = l;
1548
1481
  b(!0), C(null);
1549
1482
  try {
1550
- const E = await z("DELETE");
1551
- return i.current !== g ? !1 : (u(E), n(E.resolved, E.sources), !0);
1552
- } catch (E) {
1553
- return i.current === g && C(E instanceof Error ? E.message : "Unknown error"), !1;
1483
+ const I = await z("DELETE");
1484
+ return o.current !== g ? !1 : (u(I), n(I.resolved, I.sources), !0);
1485
+ } catch (I) {
1486
+ return o.current === g && C(I instanceof Error ? I.message : "Unknown error"), !1;
1554
1487
  } finally {
1555
- i.current === g && b(!1);
1488
+ o.current === g && b(!1);
1556
1489
  }
1557
1490
  }, [l, n, z]);
1558
1491
  return {
1559
- preferences: m,
1560
- isLoading: y,
1492
+ preferences: f,
1493
+ isLoading: w,
1561
1494
  isSaving: v,
1562
- isClearing: w,
1563
- error: S,
1564
- updatePreferences: P,
1495
+ isClearing: S,
1496
+ error: y,
1497
+ updatePreferences: _,
1565
1498
  clearPreferences: N,
1566
- refetch: F
1499
+ refetch: O
1567
1500
  };
1568
1501
  }
1569
1502
  const We = [
@@ -1579,7 +1512,7 @@ const We = [
1579
1512
  { value: "en-IN", label: "English (India)" },
1580
1513
  { value: "en-NZ", label: "English (New Zealand)" },
1581
1514
  { value: "mi-NZ", label: "Māori (New Zealand)" }
1582
- ], Mt = /* @__PURE__ */ new Set([
1515
+ ], Ot = /* @__PURE__ */ new Set([
1583
1516
  "USD",
1584
1517
  "EUR",
1585
1518
  "GBP",
@@ -1590,13 +1523,13 @@ const We = [
1590
1523
  "INR",
1591
1524
  "BRL",
1592
1525
  "KWD"
1593
- ]), an = $a(), rn = an.filter(
1594
- (e) => !Mt.has(e)
1595
- ), Bt = [
1526
+ ]), Gr = ja(), Jr = Gr.filter(
1527
+ (e) => !Ot.has(e)
1528
+ ), Ut = [
1596
1529
  { value: "short", label: "Short" },
1597
1530
  { value: "medium", label: "Medium" },
1598
1531
  { value: "long", label: "Long" }
1599
- ], pt = "2026-07-31", _e = "2026-07-31T14:30:45";
1532
+ ], ft = "2026-07-31", Pe = "2026-07-31T14:30:45";
1600
1533
  function Ke(e) {
1601
1534
  switch (e) {
1602
1535
  case "viewer_user":
@@ -1615,22 +1548,22 @@ function Ke(e) {
1615
1548
  return "another preference level";
1616
1549
  }
1617
1550
  }
1618
- function Pe(e) {
1551
+ function _e(e) {
1619
1552
  var a;
1620
- return ((a = Bt.find((t) => t.value === e)) == null ? void 0 : a.label) ?? e;
1553
+ return ((a = Ut.find((t) => t.value === e)) == null ? void 0 : a.label) ?? e;
1621
1554
  }
1622
- function nn(e) {
1555
+ function Xr(e) {
1623
1556
  const a = We.find((t) => t.value === e);
1624
1557
  return a ? `${a.label} — ${a.value}` : e;
1625
1558
  }
1626
- function Oe(e) {
1559
+ function Le(e) {
1627
1560
  return {
1628
1561
  short: e("short"),
1629
1562
  medium: e("medium"),
1630
1563
  long: e("long")
1631
1564
  };
1632
1565
  }
1633
- function Le({
1566
+ function ze({
1634
1567
  id: e,
1635
1568
  label: a,
1636
1569
  value: t,
@@ -1638,38 +1571,38 @@ function Le({
1638
1571
  inheritedSource: r,
1639
1572
  examples: l,
1640
1573
  disabled: s,
1641
- onValueChange: i
1574
+ onValueChange: o
1642
1575
  }) {
1643
- const m = t === void 0 ? `Inherited · ${Pe(n)}` : Pe(t);
1576
+ const f = t === void 0 ? `Inherited · ${_e(n)}` : _e(t);
1644
1577
  return /* @__PURE__ */ h("div", { className: "space-y-1.5", children: [
1645
- /* @__PURE__ */ o(pe, { htmlFor: e, className: "text-[11px] text-muted-foreground", children: a }),
1578
+ /* @__PURE__ */ i(pe, { htmlFor: e, className: "text-[11px] text-muted-foreground", children: a }),
1646
1579
  /* @__PURE__ */ h(
1647
- ze,
1580
+ Fe,
1648
1581
  {
1649
1582
  value: t ?? "inherit",
1650
1583
  disabled: s,
1651
- onValueChange: i,
1584
+ onValueChange: o,
1652
1585
  children: [
1653
- /* @__PURE__ */ o(Fe, { id: e, size: "xs", children: /* @__PURE__ */ o(Ue, { children: m }) }),
1586
+ /* @__PURE__ */ i(Oe, { id: e, size: "xs", children: /* @__PURE__ */ i(Ue, { children: f }) }),
1654
1587
  /* @__PURE__ */ h(Me, { children: [
1655
- /* @__PURE__ */ o(Z, { value: "inherit", className: "[&>span:last-child]:w-full", children: /* @__PURE__ */ h("span", { className: "flex w-full min-w-0 items-center justify-between gap-4", children: [
1588
+ /* @__PURE__ */ i(X, { value: "inherit", className: "[&>span:last-child]:w-full", children: /* @__PURE__ */ h("span", { className: "flex w-full min-w-0 items-center justify-between gap-4", children: [
1656
1589
  /* @__PURE__ */ h("span", { children: [
1657
1590
  "Inherited from ",
1658
1591
  Ke(r),
1659
1592
  " ·",
1660
1593
  " ",
1661
- Pe(n)
1594
+ _e(n)
1662
1595
  ] }),
1663
- /* @__PURE__ */ o("span", { className: "shrink-0 tabular-nums text-muted-foreground", children: l[n] })
1596
+ /* @__PURE__ */ i("span", { className: "shrink-0 tabular-nums text-muted-foreground", children: l[n] })
1664
1597
  ] }) }),
1665
- Bt.map((u) => /* @__PURE__ */ o(
1666
- Z,
1598
+ Ut.map((u) => /* @__PURE__ */ i(
1599
+ X,
1667
1600
  {
1668
1601
  value: u.value,
1669
1602
  className: "[&>span:last-child]:w-full",
1670
1603
  children: /* @__PURE__ */ h("span", { className: "flex w-full min-w-0 items-center justify-between gap-4", children: [
1671
- /* @__PURE__ */ o("span", { children: u.label }),
1672
- /* @__PURE__ */ o("span", { className: "shrink-0 tabular-nums text-muted-foreground", children: l[u.value] })
1604
+ /* @__PURE__ */ i("span", { children: u.label }),
1605
+ /* @__PURE__ */ i("span", { className: "shrink-0 tabular-nums text-muted-foreground", children: l[u.value] })
1673
1606
  ] })
1674
1607
  },
1675
1608
  u.value
@@ -1680,15 +1613,15 @@ function Le({
1680
1613
  )
1681
1614
  ] });
1682
1615
  }
1683
- function sn({
1616
+ function Zr({
1684
1617
  value: e,
1685
1618
  inherited: a,
1686
1619
  inheritedSources: t,
1687
1620
  onChange: n,
1688
1621
  disabled: r
1689
1622
  }) {
1690
- var N, g, E, R;
1691
- const l = de(), s = de(), i = de(), m = de(), u = de(), c = (e.locale === void 0 ? void 0 : xt(e.locale)) ?? a.locale, v = e.defaultCurrency ?? a.defaultCurrency, f = {
1623
+ var N, g, I, D;
1624
+ const l = de(), s = de(), o = de(), f = de(), u = de(), c = (e.locale === void 0 ? void 0 : wt(e.locale)) ?? a.locale, v = e.defaultCurrency ?? a.defaultCurrency, m = {
1692
1625
  locale: c,
1693
1626
  dateStyle: e.dateStyle ?? a.dateStyle,
1694
1627
  dateTime: {
@@ -1696,66 +1629,66 @@ function sn({
1696
1629
  timeStyle: ((g = e.dateTime) == null ? void 0 : g.timeStyle) ?? a.dateTime.timeStyle
1697
1630
  },
1698
1631
  defaultCurrency: v
1699
- }, w = new Intl.NumberFormat(c, {
1632
+ }, S = new Intl.NumberFormat(c, {
1700
1633
  style: "currency",
1701
1634
  currency: v
1702
1635
  }).format(1e3), b = we({
1703
- preferences: f,
1636
+ preferences: m,
1704
1637
  calendar: { tz: "UTC" }
1705
- }), S = ce({
1706
- value: pt,
1638
+ }), y = ce({
1639
+ value: ft,
1707
1640
  metadata: { kind: "raw_temporal", valueKind: "date" },
1708
1641
  format: b
1709
1642
  }).text, C = ce({
1710
- value: _e,
1643
+ value: Pe,
1711
1644
  metadata: { kind: "raw_temporal", valueKind: "wall_datetime" },
1712
1645
  format: b
1713
- }).text, _ = Oe(
1714
- (I) => ce({
1715
- value: pt,
1646
+ }).text, P = Le(
1647
+ (E) => ce({
1648
+ value: ft,
1716
1649
  metadata: { kind: "raw_temporal", valueKind: "date" },
1717
1650
  format: we({
1718
- preferences: { ...f, dateStyle: I },
1651
+ preferences: { ...m, dateStyle: E },
1719
1652
  calendar: { tz: "UTC" }
1720
1653
  })
1721
1654
  }).text
1722
- ), z = Oe(
1723
- (I) => ce({
1724
- value: _e,
1655
+ ), z = Le(
1656
+ (E) => ce({
1657
+ value: Pe,
1725
1658
  metadata: { kind: "raw_temporal", valueKind: "wall_datetime" },
1726
1659
  format: we({
1727
1660
  preferences: {
1728
- ...f,
1729
- dateTime: { ...f.dateTime, dateStyle: I }
1661
+ ...m,
1662
+ dateTime: { ...m.dateTime, dateStyle: E }
1730
1663
  },
1731
1664
  calendar: { tz: "UTC" }
1732
1665
  })
1733
1666
  }).text
1734
- ), F = Oe(
1735
- (I) => ce({
1736
- value: _e,
1667
+ ), O = Le(
1668
+ (E) => ce({
1669
+ value: Pe,
1737
1670
  metadata: { kind: "raw_temporal", valueKind: "wall_datetime" },
1738
1671
  format: we({
1739
1672
  preferences: {
1740
- ...f,
1741
- dateTime: { ...f.dateTime, timeStyle: I }
1673
+ ...m,
1674
+ dateTime: { ...m.dateTime, timeStyle: E }
1742
1675
  },
1743
1676
  calendar: { tz: "UTC" }
1744
1677
  })
1745
1678
  }).text
1746
- ), P = (I, H) => {
1747
- const V = {
1679
+ ), _ = (E, q) => {
1680
+ const $ = {
1748
1681
  ...e.dateTime,
1749
- [I]: H === "inherit" ? void 0 : H
1682
+ [E]: q === "inherit" ? void 0 : q
1750
1683
  };
1751
1684
  n({
1752
1685
  ...e,
1753
- dateTime: V.dateStyle === void 0 && V.timeStyle === void 0 ? void 0 : V
1686
+ dateTime: $.dateStyle === void 0 && $.timeStyle === void 0 ? void 0 : $
1754
1687
  });
1755
1688
  };
1756
1689
  return /* @__PURE__ */ h("div", { className: "space-y-4", children: [
1757
1690
  /* @__PURE__ */ h("div", { className: "space-y-1.5", children: [
1758
- /* @__PURE__ */ o(
1691
+ /* @__PURE__ */ i(
1759
1692
  pe,
1760
1693
  {
1761
1694
  htmlFor: l,
@@ -1764,18 +1697,18 @@ function sn({
1764
1697
  }
1765
1698
  ),
1766
1699
  /* @__PURE__ */ h(
1767
- ze,
1700
+ Fe,
1768
1701
  {
1769
1702
  value: e.locale ?? "inherit",
1770
1703
  disabled: r,
1771
- onValueChange: (I) => n({
1704
+ onValueChange: (E) => n({
1772
1705
  ...e,
1773
- locale: I === "inherit" ? void 0 : I
1706
+ locale: E === "inherit" ? void 0 : E
1774
1707
  }),
1775
1708
  children: [
1776
- /* @__PURE__ */ o(Fe, { id: l, size: "xs", children: /* @__PURE__ */ o(Ue, { children: e.locale === void 0 ? `Inherited · ${a.locale}` : nn(e.locale) }) }),
1709
+ /* @__PURE__ */ i(Oe, { id: l, size: "xs", children: /* @__PURE__ */ i(Ue, { children: e.locale === void 0 ? `Inherited · ${a.locale}` : Xr(e.locale) }) }),
1777
1710
  /* @__PURE__ */ h(Me, { children: [
1778
- /* @__PURE__ */ h(Z, { value: "inherit", children: [
1711
+ /* @__PURE__ */ h(X, { value: "inherit", children: [
1779
1712
  "Inherited from ",
1780
1713
  Ke(t.locale),
1781
1714
  " ·",
@@ -1783,68 +1716,68 @@ function sn({
1783
1716
  a.locale
1784
1717
  ] }),
1785
1718
  e.locale && !We.some(
1786
- (I) => I.value === e.locale
1787
- ) && /* @__PURE__ */ o(Z, { value: e.locale, children: e.locale }),
1788
- We.map((I) => /* @__PURE__ */ h(Z, { value: I.value, children: [
1789
- I.label,
1719
+ (E) => E.value === e.locale
1720
+ ) && /* @__PURE__ */ i(X, { value: e.locale, children: e.locale }),
1721
+ We.map((E) => /* @__PURE__ */ h(X, { value: E.value, children: [
1722
+ E.label,
1790
1723
  " — ",
1791
- I.value
1792
- ] }, I.value))
1724
+ E.value
1725
+ ] }, E.value))
1793
1726
  ] })
1794
1727
  ]
1795
1728
  }
1796
1729
  )
1797
1730
  ] }),
1798
1731
  /* @__PURE__ */ h("fieldset", { className: "space-y-2", children: [
1799
- /* @__PURE__ */ o("legend", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Date values" }),
1800
- /* @__PURE__ */ o(
1801
- Le,
1732
+ /* @__PURE__ */ i("legend", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Date values" }),
1733
+ /* @__PURE__ */ i(
1734
+ ze,
1802
1735
  {
1803
- id: i,
1736
+ id: o,
1804
1737
  label: "Format",
1805
1738
  value: e.dateStyle,
1806
1739
  inherited: a.dateStyle,
1807
1740
  inheritedSource: t.dateStyle,
1808
- examples: _,
1741
+ examples: P,
1809
1742
  disabled: r,
1810
- onValueChange: (I) => n({
1743
+ onValueChange: (E) => n({
1811
1744
  ...e,
1812
- dateStyle: I === "inherit" ? void 0 : I
1745
+ dateStyle: E === "inherit" ? void 0 : E
1813
1746
  })
1814
1747
  }
1815
1748
  )
1816
1749
  ] }),
1817
1750
  /* @__PURE__ */ h("fieldset", { className: "space-y-2", children: [
1818
- /* @__PURE__ */ o("legend", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Date & time values" }),
1819
- /* @__PURE__ */ o(
1820
- Le,
1751
+ /* @__PURE__ */ i("legend", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Date & time values" }),
1752
+ /* @__PURE__ */ i(
1753
+ ze,
1821
1754
  {
1822
- id: m,
1755
+ id: f,
1823
1756
  label: "Date",
1824
- value: (E = e.dateTime) == null ? void 0 : E.dateStyle,
1757
+ value: (I = e.dateTime) == null ? void 0 : I.dateStyle,
1825
1758
  inherited: a.dateTime.dateStyle,
1826
1759
  inheritedSource: t.dateTime.dateStyle,
1827
1760
  examples: z,
1828
1761
  disabled: r,
1829
- onValueChange: (I) => P("dateStyle", I)
1762
+ onValueChange: (E) => _("dateStyle", E)
1830
1763
  }
1831
1764
  ),
1832
- /* @__PURE__ */ o(
1833
- Le,
1765
+ /* @__PURE__ */ i(
1766
+ ze,
1834
1767
  {
1835
1768
  id: u,
1836
1769
  label: "Time",
1837
- value: (R = e.dateTime) == null ? void 0 : R.timeStyle,
1770
+ value: (D = e.dateTime) == null ? void 0 : D.timeStyle,
1838
1771
  inherited: a.dateTime.timeStyle,
1839
1772
  inheritedSource: t.dateTime.timeStyle,
1840
- examples: F,
1773
+ examples: O,
1841
1774
  disabled: r,
1842
- onValueChange: (I) => P("timeStyle", I)
1775
+ onValueChange: (E) => _("timeStyle", E)
1843
1776
  }
1844
1777
  )
1845
1778
  ] }),
1846
1779
  /* @__PURE__ */ h("div", { className: "space-y-1.5", children: [
1847
- /* @__PURE__ */ o(
1780
+ /* @__PURE__ */ i(
1848
1781
  pe,
1849
1782
  {
1850
1783
  htmlFor: s,
@@ -1853,59 +1786,59 @@ function sn({
1853
1786
  }
1854
1787
  ),
1855
1788
  /* @__PURE__ */ h(
1856
- ze,
1789
+ Fe,
1857
1790
  {
1858
1791
  value: e.defaultCurrency ?? "inherit",
1859
1792
  disabled: r,
1860
- onValueChange: (I) => n({
1793
+ onValueChange: (E) => n({
1861
1794
  ...e,
1862
- defaultCurrency: I === "inherit" ? void 0 : I
1795
+ defaultCurrency: E === "inherit" ? void 0 : E
1863
1796
  }),
1864
1797
  children: [
1865
- /* @__PURE__ */ o(Fe, { id: s, size: "xs", children: /* @__PURE__ */ o(Ue, { children: e.defaultCurrency === void 0 ? `Inherited · ${a.defaultCurrency}` : e.defaultCurrency }) }),
1798
+ /* @__PURE__ */ i(Oe, { id: s, size: "xs", children: /* @__PURE__ */ i(Ue, { children: e.defaultCurrency === void 0 ? `Inherited · ${a.defaultCurrency}` : e.defaultCurrency }) }),
1866
1799
  /* @__PURE__ */ h(Me, { children: [
1867
- /* @__PURE__ */ h(Z, { value: "inherit", children: [
1800
+ /* @__PURE__ */ h(X, { value: "inherit", children: [
1868
1801
  "Inherited from ",
1869
1802
  Ke(t.defaultCurrency),
1870
1803
  " ·",
1871
1804
  " ",
1872
1805
  a.defaultCurrency
1873
1806
  ] }),
1874
- [...Mt].map((I) => /* @__PURE__ */ o(Z, { value: I, children: I }, I)),
1875
- rn.map((I) => /* @__PURE__ */ o(Z, { value: I, children: I }, I))
1807
+ [...Ot].map((E) => /* @__PURE__ */ i(X, { value: E, children: E }, E)),
1808
+ Jr.map((E) => /* @__PURE__ */ i(X, { value: E, children: E }, E))
1876
1809
  ] })
1877
1810
  ]
1878
1811
  }
1879
1812
  )
1880
1813
  ] }),
1881
1814
  /* @__PURE__ */ h("div", { className: "rounded-control border border-border/60 bg-muted/30 px-3 py-2", children: [
1882
- /* @__PURE__ */ o("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Preview" }),
1815
+ /* @__PURE__ */ i("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Preview" }),
1883
1816
  /* @__PURE__ */ h("dl", { className: "mt-1.5 space-y-1 text-[12px]", children: [
1884
1817
  /* @__PURE__ */ h("div", { className: "flex items-baseline justify-between gap-4", children: [
1885
- /* @__PURE__ */ o("dt", { className: "text-muted-foreground", children: "Date" }),
1886
- /* @__PURE__ */ o("dd", { className: "text-right font-medium text-foreground", children: S })
1818
+ /* @__PURE__ */ i("dt", { className: "text-muted-foreground", children: "Date" }),
1819
+ /* @__PURE__ */ i("dd", { className: "text-right font-medium text-foreground", children: y })
1887
1820
  ] }),
1888
1821
  /* @__PURE__ */ h("div", { className: "flex items-baseline justify-between gap-4", children: [
1889
- /* @__PURE__ */ o("dt", { className: "text-muted-foreground", children: "Date & time" }),
1890
- /* @__PURE__ */ o("dd", { className: "text-right font-medium text-foreground", children: C })
1822
+ /* @__PURE__ */ i("dt", { className: "text-muted-foreground", children: "Date & time" }),
1823
+ /* @__PURE__ */ i("dd", { className: "text-right font-medium text-foreground", children: C })
1891
1824
  ] }),
1892
1825
  /* @__PURE__ */ h("div", { className: "flex items-baseline justify-between gap-4", children: [
1893
- /* @__PURE__ */ o("dt", { className: "text-muted-foreground", children: "Currency" }),
1894
- /* @__PURE__ */ o("dd", { className: "text-right font-medium text-foreground", children: w })
1826
+ /* @__PURE__ */ i("dt", { className: "text-muted-foreground", children: "Currency" }),
1827
+ /* @__PURE__ */ i("dd", { className: "text-right font-medium text-foreground", children: S })
1895
1828
  ] })
1896
1829
  ] })
1897
1830
  ] }),
1898
- /* @__PURE__ */ o("p", { className: "text-[11px] text-muted-foreground", children: "Currency values are not converted. Date examples use a fixed reference value and the Gregorian calendar." })
1831
+ /* @__PURE__ */ i("p", { className: "text-[11px] text-muted-foreground", children: "Currency values are not converted. Date examples use a fixed reference value and the Gregorian calendar." })
1899
1832
  ] });
1900
1833
  }
1901
- const vt = [
1834
+ const ht = [
1902
1835
  "locale",
1903
1836
  "dateStyle",
1904
1837
  "dateTime.dateStyle",
1905
1838
  "dateTime.timeStyle",
1906
1839
  "defaultCurrency"
1907
1840
  ];
1908
- function bt(e, a) {
1841
+ function pt(e, a) {
1909
1842
  var t, n;
1910
1843
  switch (a) {
1911
1844
  case "locale":
@@ -1920,7 +1853,7 @@ function bt(e, a) {
1920
1853
  return e == null ? void 0 : e.defaultCurrency;
1921
1854
  }
1922
1855
  }
1923
- function ln(e) {
1856
+ function Yr(e) {
1924
1857
  var n, r;
1925
1858
  const a = (n = e == null ? void 0 : e.dateTime) == null ? void 0 : n.dateStyle, t = (r = e == null ? void 0 : e.dateTime) == null ? void 0 : r.timeStyle;
1926
1859
  return {
@@ -1930,33 +1863,33 @@ function ln(e) {
1930
1863
  defaultCurrency: e == null ? void 0 : e.defaultCurrency
1931
1864
  };
1932
1865
  }
1933
- function on({
1866
+ function Qr({
1934
1867
  active: e,
1935
1868
  onClose: a
1936
1869
  }) {
1937
- var i, m, u, y, c, v, f;
1938
- const { preferences: t, isLoading: n, isSaving: r, updatePreferences: l } = tn({ enabled: e });
1870
+ var o, f, u, w, c, v, m;
1871
+ const { preferences: t, isLoading: n, isSaving: r, updatePreferences: l } = Hr({ enabled: e });
1939
1872
  if (!e) return null;
1940
1873
  if (!t)
1941
1874
  return /* @__PURE__ */ h(te, { children: [
1942
- /* @__PURE__ */ o("div", { className: "py-2", children: /* @__PURE__ */ o("div", { className: "flex min-h-36 items-center justify-center text-[12px] text-muted-foreground", children: n ? "Loading preferences…" : "Preferences unavailable." }) }),
1943
- /* @__PURE__ */ h(Ge, { className: "justify-between sm:justify-between", children: [
1944
- /* @__PURE__ */ o(q, { variant: "ghost", size: "xs", disabled: !0, children: "Reset display formats" }),
1875
+ /* @__PURE__ */ i("div", { className: "py-2", children: /* @__PURE__ */ i("div", { className: "flex min-h-36 items-center justify-center text-[12px] text-muted-foreground", children: n ? "Loading preferences…" : "Preferences unavailable." }) }),
1876
+ /* @__PURE__ */ h(He, { className: "justify-between sm:justify-between", children: [
1877
+ /* @__PURE__ */ i(K, { variant: "ghost", size: "xs", disabled: !0, children: "Reset display formats" }),
1945
1878
  /* @__PURE__ */ h("div", { className: "flex gap-2", children: [
1946
- /* @__PURE__ */ o(q, { variant: "outline", size: "xs", onClick: a, children: "Cancel" }),
1947
- /* @__PURE__ */ o(q, { size: "xs", disabled: !0, children: "Save" })
1879
+ /* @__PURE__ */ i(K, { variant: "outline", size: "xs", onClick: a, children: "Cancel" }),
1880
+ /* @__PURE__ */ i(K, { size: "xs", disabled: !0, children: "Save" })
1948
1881
  ] })
1949
1882
  ] })
1950
1883
  ] });
1951
1884
  const s = [
1952
- ((i = t.stored) == null ? void 0 : i.locale) ?? "",
1953
- ((m = t.stored) == null ? void 0 : m.dateStyle) ?? "",
1954
- ((y = (u = t.stored) == null ? void 0 : u.dateTime) == null ? void 0 : y.dateStyle) ?? "",
1885
+ ((o = t.stored) == null ? void 0 : o.locale) ?? "",
1886
+ ((f = t.stored) == null ? void 0 : f.dateStyle) ?? "",
1887
+ ((w = (u = t.stored) == null ? void 0 : u.dateTime) == null ? void 0 : w.dateStyle) ?? "",
1955
1888
  ((v = (c = t.stored) == null ? void 0 : c.dateTime) == null ? void 0 : v.timeStyle) ?? "",
1956
- ((f = t.stored) == null ? void 0 : f.defaultCurrency) ?? ""
1889
+ ((m = t.stored) == null ? void 0 : m.defaultCurrency) ?? ""
1957
1890
  ].join(":");
1958
- return /* @__PURE__ */ o(
1959
- dn,
1891
+ return /* @__PURE__ */ i(
1892
+ en,
1960
1893
  {
1961
1894
  preferences: t,
1962
1895
  isSaving: r,
@@ -1966,38 +1899,38 @@ function on({
1966
1899
  s
1967
1900
  );
1968
1901
  }
1969
- function dn({
1902
+ function en({
1970
1903
  preferences: e,
1971
1904
  isSaving: a,
1972
1905
  updatePreferences: t,
1973
1906
  onClose: n
1974
1907
  }) {
1975
- var u, y;
1976
- const [r, l] = L(
1977
- () => ln(e.stored)
1978
- ), s = (r.locale === void 0 || xt(r.locale) !== void 0) && (r.defaultCurrency === void 0 || Va(r.defaultCurrency) !== void 0) && (r.dateStyle === void 0 || ["short", "medium", "long"].includes(r.dateStyle)) && (((u = r.dateTime) == null ? void 0 : u.dateStyle) === void 0 || ["short", "medium", "long"].includes(r.dateTime.dateStyle)) && (((y = r.dateTime) == null ? void 0 : y.timeStyle) === void 0 || ["short", "medium", "long"].includes(r.dateTime.timeStyle)), i = async () => {
1908
+ var u, w;
1909
+ const [r, l] = F(
1910
+ () => Yr(e.stored)
1911
+ ), s = (r.locale === void 0 || wt(r.locale) !== void 0) && (r.defaultCurrency === void 0 || Ba(r.defaultCurrency) !== void 0) && (r.dateStyle === void 0 || ["short", "medium", "long"].includes(r.dateStyle)) && (((u = r.dateTime) == null ? void 0 : u.dateStyle) === void 0 || ["short", "medium", "long"].includes(r.dateTime.dateStyle)) && (((w = r.dateTime) == null ? void 0 : w.timeStyle) === void 0 || ["short", "medium", "long"].includes(r.dateTime.timeStyle)), o = async () => {
1979
1912
  const c = {
1980
1913
  ...r.locale !== void 0 ? { locale: r.locale } : {},
1981
1914
  ...r.dateStyle !== void 0 ? { dateStyle: r.dateStyle } : {},
1982
1915
  ...r.dateTime ? { dateTime: { ...r.dateTime } } : {},
1983
1916
  ...r.defaultCurrency !== void 0 ? { defaultCurrency: r.defaultCurrency } : {}
1984
- }, v = vt.filter(
1985
- (b) => bt(r, b) === void 0 && bt(e.stored, b) !== void 0
1986
- ), f = {
1917
+ }, v = ht.filter(
1918
+ (b) => pt(r, b) === void 0 && pt(e.stored, b) !== void 0
1919
+ ), m = {
1987
1920
  ...Object.keys(c).length > 0 ? { set: c } : {},
1988
1921
  ...v.length > 0 ? { clear: v } : {}
1989
1922
  };
1990
- (Object.keys(f).length === 0 ? !0 : await t(f)) ? (G.success("Display format preferences saved."), n()) : G.error("Failed to save preferences. Please try again.");
1991
- }, m = async () => {
1923
+ (Object.keys(m).length === 0 ? !0 : await t(m)) ? (G.success("Display format preferences saved."), n()) : G.error("Failed to save preferences. Please try again.");
1924
+ }, f = async () => {
1992
1925
  await t({
1993
- clear: [...vt]
1926
+ clear: [...ht]
1994
1927
  }) ? (G.success("Display format preferences reset."), n()) : G.error(
1995
1928
  "Failed to reset display format preferences. Please try again."
1996
1929
  );
1997
1930
  };
1998
1931
  return /* @__PURE__ */ h(te, { children: [
1999
- /* @__PURE__ */ o("div", { className: "py-2", children: /* @__PURE__ */ o(
2000
- sn,
1932
+ /* @__PURE__ */ i("div", { className: "py-2", children: /* @__PURE__ */ i(
1933
+ Zr,
2001
1934
  {
2002
1935
  value: r,
2003
1936
  inherited: e.inherited,
@@ -2006,20 +1939,20 @@ function dn({
2006
1939
  disabled: a
2007
1940
  }
2008
1941
  ) }),
2009
- /* @__PURE__ */ h(Ge, { className: "justify-between sm:justify-between", children: [
2010
- /* @__PURE__ */ o(
2011
- q,
1942
+ /* @__PURE__ */ h(He, { className: "justify-between sm:justify-between", children: [
1943
+ /* @__PURE__ */ i(
1944
+ K,
2012
1945
  {
2013
1946
  variant: "ghost",
2014
1947
  size: "xs",
2015
- onClick: m,
1948
+ onClick: f,
2016
1949
  disabled: a || e.stored === null,
2017
1950
  children: "Reset display formats"
2018
1951
  }
2019
1952
  ),
2020
1953
  /* @__PURE__ */ h("div", { className: "flex gap-2", children: [
2021
- /* @__PURE__ */ o(
2022
- q,
1954
+ /* @__PURE__ */ i(
1955
+ K,
2023
1956
  {
2024
1957
  variant: "outline",
2025
1958
  size: "xs",
@@ -2028,14 +1961,14 @@ function dn({
2028
1961
  children: "Cancel"
2029
1962
  }
2030
1963
  ),
2031
- /* @__PURE__ */ o(
2032
- q,
1964
+ /* @__PURE__ */ i(
1965
+ K,
2033
1966
  {
2034
1967
  size: "xs",
2035
- onClick: i,
1968
+ onClick: o,
2036
1969
  disabled: a || !s,
2037
1970
  children: a ? /* @__PURE__ */ h(te, { children: [
2038
- /* @__PURE__ */ o(St, { className: "h-3.5 w-3.5 animate-spin" }),
1971
+ /* @__PURE__ */ i(yt, { className: "h-3.5 w-3.5 animate-spin" }),
2039
1972
  "Saving…"
2040
1973
  ] }) : "Save"
2041
1974
  }
@@ -2044,30 +1977,30 @@ function dn({
2044
1977
  ] })
2045
1978
  ] });
2046
1979
  }
2047
- function Rn({
1980
+ function yn({
2048
1981
  open: e,
2049
1982
  onOpenChange: a
2050
1983
  }) {
2051
- const [t, n] = L("display"), r = () => a(!1);
2052
- return /* @__PURE__ */ o(Sa, { open: e, onOpenChange: a, children: /* @__PURE__ */ h(xa, { className: "rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control", children: [
2053
- /* @__PURE__ */ h(Ca, { children: [
2054
- /* @__PURE__ */ o(Ia, { className: "text-[15px]", children: "Report preferences" }),
2055
- /* @__PURE__ */ o(Ea, { className: "text-[13px] leading-5", children: "Set how values and Calendar periods appear for you." })
1984
+ const [t, n] = F("display"), r = () => a(!1);
1985
+ return /* @__PURE__ */ i(ya, { open: e, onOpenChange: a, children: /* @__PURE__ */ h(wa, { className: "rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control", children: [
1986
+ /* @__PURE__ */ h(Sa, { children: [
1987
+ /* @__PURE__ */ i(xa, { className: "text-[15px]", children: "Report preferences" }),
1988
+ /* @__PURE__ */ i(Ca, { className: "text-[13px] leading-5", children: "Set how values and Calendar periods appear for you." })
2056
1989
  ] }),
2057
- /* @__PURE__ */ h(Ma, { value: t, onValueChange: n, children: [
2058
- /* @__PURE__ */ h(Ba, { variant: "underline", className: "w-full justify-start", children: [
2059
- /* @__PURE__ */ o(st, { value: "display", children: "Display formats" }),
2060
- /* @__PURE__ */ o(st, { value: "calendar", children: "Calendar" })
1990
+ /* @__PURE__ */ h(Oa, { value: t, onValueChange: n, children: [
1991
+ /* @__PURE__ */ h(Ua, { variant: "underline", className: "w-full justify-start", children: [
1992
+ /* @__PURE__ */ i(rt, { value: "display", children: "Display formats" }),
1993
+ /* @__PURE__ */ i(rt, { value: "calendar", children: "Calendar" })
2061
1994
  ] }),
2062
- /* @__PURE__ */ o(lt, { value: "display", children: /* @__PURE__ */ o(
2063
- on,
1995
+ /* @__PURE__ */ i(nt, { value: "display", children: /* @__PURE__ */ i(
1996
+ Qr,
2064
1997
  {
2065
1998
  active: e && t === "display",
2066
1999
  onClose: r
2067
2000
  }
2068
2001
  ) }),
2069
- /* @__PURE__ */ o(lt, { value: "calendar", children: /* @__PURE__ */ o(
2070
- en,
2002
+ /* @__PURE__ */ i(nt, { value: "calendar", children: /* @__PURE__ */ i(
2003
+ qr,
2071
2004
  {
2072
2005
  active: e && t === "calendar",
2073
2006
  onClose: r
@@ -2077,27 +2010,18 @@ function Rn({
2077
2010
  ] }) });
2078
2011
  }
2079
2012
  export {
2080
- Ja as A,
2081
- Pt as C,
2082
- An as D,
2083
- Rn as R,
2084
- ar as T,
2085
- sn as a,
2086
- Ot as b,
2087
- Lt as c,
2088
- zt as d,
2013
+ Ga as A,
2014
+ Rt as C,
2015
+ gn as D,
2016
+ yn as R,
2017
+ Zr as a,
2018
+ Pt as b,
2019
+ _t as c,
2020
+ Lt as d,
2089
2021
  $e as e,
2090
2022
  Ve as f,
2091
- ur as g,
2092
- kn as h,
2093
- tr as i,
2094
- nr as j,
2095
- Tn as k,
2096
- Nn as l,
2097
- lr as m,
2098
- gr as n,
2099
- br as o,
2100
- Xe as p,
2101
- rr as t,
2102
- En as u
2023
+ rr as g,
2024
+ vn as h,
2025
+ dr as i,
2026
+ cr as u
2103
2027
  };