react-semaphor 0.1.549 → 0.1.550

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