@coolms/ui-react 0.1.0-alpha.44 → 0.1.0-alpha.46

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.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { jsx as n, jsxs as f, Fragment as ge } from "react/jsx-runtime";
2
- import { createElement as $n, useId as he, useState as D, useRef as O, useEffect as Q, useCallback as Ie, useMemo as Bn, useContext as Fn, createContext as Rn, useLayoutEffect as $e, Fragment as Hn } from "react";
1
+ import { jsx as n, jsxs as h, Fragment as ge } from "react/jsx-runtime";
2
+ import { createElement as $n, useId as he, useState as I, useRef as z, useEffect as Q, useCallback as Ie, useMemo as Bn, useContext as Fn, createContext as Rn, useLayoutEffect as $e, Fragment as Hn } from "react";
3
3
  import { createPortal as an } from "react-dom";
4
4
  function qe(e, t) {
5
5
  const l = { ...e };
@@ -9,7 +9,7 @@ function qe(e, t) {
9
9
  }
10
10
  return l;
11
11
  }
12
- function F(...e) {
12
+ function H(...e) {
13
13
  return e.filter(Boolean).join(" ");
14
14
  }
15
15
  function se({ name: e }) {
@@ -37,28 +37,28 @@ function De({
37
37
  busyLabel: l,
38
38
  locked: s = !1,
39
39
  lockedReason: a,
40
- icon: i,
41
- disabled: h,
42
- className: d,
43
- children: u,
40
+ icon: r,
41
+ disabled: m,
42
+ className: c,
43
+ children: d,
44
44
  type: b = "button",
45
- title: c,
46
- ...v
45
+ title: i,
46
+ ...g
47
47
  }) {
48
- const m = !!h || t;
49
- return /* @__PURE__ */ f(
48
+ const u = !!m || t;
49
+ return /* @__PURE__ */ h(
50
50
  "button",
51
51
  {
52
- ...v,
52
+ ...g,
53
53
  type: b,
54
- className: F("cms-button", `cms-button--${e}`, t && "is-busy", s && "is-locked", d),
55
- disabled: m,
54
+ className: H("cms-button", `cms-button--${e}`, t && "is-busy", s && "is-locked", c),
55
+ disabled: u,
56
56
  "aria-busy": t || void 0,
57
- title: s ? a ?? c : c,
57
+ title: s ? a ?? i : i,
58
58
  children: [
59
- t ? /* @__PURE__ */ n(se, { name: "spinner" }) : s ? /* @__PURE__ */ n(se, { name: "lock" }) : i,
60
- /* @__PURE__ */ n("span", { className: "cms-button__label", children: t && l !== void 0 ? l : u }),
61
- s && a ? /* @__PURE__ */ f("span", { className: "cms-visually-hidden", children: [
59
+ t ? /* @__PURE__ */ n(se, { name: "spinner" }) : s ? /* @__PURE__ */ n(se, { name: "lock" }) : r,
60
+ /* @__PURE__ */ n("span", { className: "cms-button__label", children: t && l !== void 0 ? l : d }),
61
+ s && a ? /* @__PURE__ */ h("span", { className: "cms-visually-hidden", children: [
62
62
  ", ",
63
63
  a
64
64
  ] }) : null
@@ -86,7 +86,7 @@ function $({ name: e, size: t = 20, label: l }) {
86
86
  strokeLinejoin: Xe.linejoin,
87
87
  focusable: !1,
88
88
  ...l ? { role: "img", "aria-label": l } : { "aria-hidden": !0 },
89
- children: Qe[e].parts.map(({ tag: s, ...a }, i) => $n(s, { key: i, ...a }))
89
+ children: Qe[e].parts.map(({ tag: s, ...a }, r) => $n(s, { key: r, ...a }))
90
90
  }
91
91
  );
92
92
  }
@@ -107,11 +107,11 @@ function Cn({ name: e, size: t = 18 }) {
107
107
  const l = Be(e);
108
108
  return l !== null ? /* @__PURE__ */ n($, { name: l, size: t }) : (!gn.has(e) && Un() && (gn.add(e), console.warn(`@coolms/ui-react: no icon for the server's icon name "${e}"; its space is kept empty`)), /* @__PURE__ */ n("span", { className: "cms-icon cms-icon--blank", style: { width: t, height: t }, "aria-hidden": "true", "data-icon-name": e }));
109
109
  }
110
- function cn({ id: e, label: t, help: l, error: s, pinned: a, children: i }) {
111
- return /* @__PURE__ */ f("div", { className: F("cms-field", s != null && "is-invalid"), children: [
110
+ function on({ id: e, label: t, help: l, error: s, pinned: a, children: r }) {
111
+ return /* @__PURE__ */ h("div", { className: H("cms-field", s != null && "is-invalid"), children: [
112
112
  /* @__PURE__ */ n("label", { className: "cms-field__label", htmlFor: e, children: t }),
113
- i,
114
- a != null ? /* @__PURE__ */ f("p", { className: "cms-field__pinned", id: `${e}-pinned`, children: [
113
+ r,
114
+ a != null ? /* @__PURE__ */ h("p", { className: "cms-field__pinned", id: `${e}-pinned`, children: [
115
115
  /* @__PURE__ */ n(se, { name: "lock" }),
116
116
  " ",
117
117
  a
@@ -120,32 +120,32 @@ function cn({ id: e, label: t, help: l, error: s, pinned: a, children: i }) {
120
120
  l != null ? /* @__PURE__ */ n("p", { className: "cms-field__help", id: `${e}-help`, children: l }) : null
121
121
  ] });
122
122
  }
123
- function on(e, t) {
123
+ function cn(e, t) {
124
124
  const l = [t.error != null && `${e}-error`, t.pinned != null && `${e}-pinned`, t.help != null && `${e}-help`].filter(Boolean).join(" ");
125
125
  return l === "" ? void 0 : l;
126
126
  }
127
127
  const Kn = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/, Wn = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
128
128
  function Zn(e, t, l) {
129
- const s = (i, h, d, u = 0, b = 0, c = 0) => {
130
- const v = new Date(Date.UTC(i, h - 1, d, u, b, c));
131
- return v.setUTCFullYear(i), v.getUTCFullYear() === i && v.getUTCMonth() === h - 1 && v.getUTCDate() === d && v.getUTCHours() === u && v.getUTCMinutes() === b && v.getUTCSeconds() === c ? v : null;
132
- }, a = (i) => ({ hour: Number(i[1]), minute: Number(i[2]), second: Number(i[3] ?? 0) });
129
+ const s = (r, m, c, d = 0, b = 0, i = 0) => {
130
+ const g = new Date(Date.UTC(r, m - 1, c, d, b, i));
131
+ return g.setUTCFullYear(r), g.getUTCFullYear() === r && g.getUTCMonth() === m - 1 && g.getUTCDate() === c && g.getUTCHours() === d && g.getUTCMinutes() === b && g.getUTCSeconds() === i ? g : null;
132
+ }, a = (r) => ({ hour: Number(r[1]), minute: Number(r[2]), second: Number(r[3] ?? 0) });
133
133
  try {
134
134
  if (e === "time") {
135
- const h = t.match(Wn);
136
- if (h === null) return t;
137
- const d = a(h), u = s(2e3, 1, 1, d.hour, d.minute, d.second);
138
- return u === null ? t : new Intl.DateTimeFormat(l, { timeStyle: h[3] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(u);
135
+ const m = t.match(Wn);
136
+ if (m === null) return t;
137
+ const c = a(m), d = s(2e3, 1, 1, c.hour, c.minute, c.second);
138
+ return d === null ? t : new Intl.DateTimeFormat(l, { timeStyle: m[3] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(d);
139
139
  }
140
- const i = t.match(Kn);
141
- if (i === null) return t;
142
- if (e === "date" && i[4] === void 0) {
143
- const h = s(Number(i[1]), Number(i[2]), Number(i[3]));
144
- return h === null ? t : new Intl.DateTimeFormat(l, { dateStyle: "medium", timeZone: "UTC" }).format(h);
140
+ const r = t.match(Kn);
141
+ if (r === null) return t;
142
+ if (e === "date" && r[4] === void 0) {
143
+ const m = s(Number(r[1]), Number(r[2]), Number(r[3]));
144
+ return m === null ? t : new Intl.DateTimeFormat(l, { dateStyle: "medium", timeZone: "UTC" }).format(m);
145
145
  }
146
- if (e === "datetime-local" && i[4] !== void 0) {
147
- const h = s(Number(i[1]), Number(i[2]), Number(i[3]), Number(i[4]), Number(i[5]), Number(i[6] ?? 0));
148
- return h === null ? t : new Intl.DateTimeFormat(l, { dateStyle: "medium", timeStyle: i[6] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(h);
146
+ if (e === "datetime-local" && r[4] !== void 0) {
147
+ const m = s(Number(r[1]), Number(r[2]), Number(r[3]), Number(r[4]), Number(r[5]), Number(r[6] ?? 0));
148
+ return m === null ? t : new Intl.DateTimeFormat(l, { dateStyle: "medium", timeStyle: r[6] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(m);
149
149
  }
150
150
  } catch {
151
151
  return t;
@@ -153,108 +153,108 @@ function Zn(e, t, l) {
153
153
  return t;
154
154
  }
155
155
  const Vn = /* @__PURE__ */ new Set(["date", "time", "datetime-local"]);
156
- function Gt({ label: e, help: t, error: l, disabled: s, readOnly: a, pinned: i, value: h, onChange: d, placeholder: u, type: b = "text", name: c, locale: v, min: m, max: N, step: r, minLength: g, maxLength: T, required: C, autoComplete: S, reveal: x }) {
157
- const _ = he(), [y, I] = D(!1), U = a === !0 || i != null, P = U && Vn.has(b), k = b === "number" && (r === "any" || typeof r == "number" && !Number.isInteger(r)), B = b === "password" && x !== void 0 && !U, z = /* @__PURE__ */ n(
156
+ function Gt({ label: e, help: t, error: l, disabled: s, readOnly: a, pinned: r, value: m, onChange: c, placeholder: d, type: b = "text", name: i, locale: g, min: u, max: k, step: f, minLength: x, maxLength: L, required: S, autoComplete: _, reveal: N }) {
157
+ const v = he(), [w, T] = I(!1), B = a === !0 || r != null, F = B && Vn.has(b), M = b === "number" && (f === "any" || typeof f == "number" && !Number.isInteger(f)), R = b === "password" && N !== void 0 && !B, U = /* @__PURE__ */ n(
158
158
  "input",
159
159
  {
160
- id: _,
161
- name: c,
162
- type: P || B && y ? "text" : b,
163
- autoComplete: S,
160
+ id: v,
161
+ name: i,
162
+ type: F || R && w ? "text" : b,
163
+ autoComplete: _,
164
164
  className: "cms-input",
165
- value: P ? Zn(b, h, v) : h,
166
- ...P ? { "data-value": h } : {},
167
- lang: v,
168
- placeholder: u,
165
+ value: F ? Zn(b, m, g) : m,
166
+ ...F ? { "data-value": m } : {},
167
+ lang: g,
168
+ placeholder: d,
169
169
  disabled: s,
170
- readOnly: U,
171
- required: C,
172
- "aria-required": C || void 0,
173
- min: P ? void 0 : m,
174
- max: P ? void 0 : N,
175
- step: P ? void 0 : r,
176
- minLength: g,
177
- maxLength: T,
178
- inputMode: b === "number" ? k ? "decimal" : "numeric" : void 0,
170
+ readOnly: B,
171
+ required: S,
172
+ "aria-required": S || void 0,
173
+ min: F ? void 0 : u,
174
+ max: F ? void 0 : k,
175
+ step: F ? void 0 : f,
176
+ minLength: x,
177
+ maxLength: L,
178
+ inputMode: b === "number" ? M ? "decimal" : "numeric" : void 0,
179
179
  "aria-invalid": l != null || void 0,
180
- "aria-describedby": on(_, { help: t, error: l, pinned: i }),
181
- onChange: (j) => d == null ? void 0 : d(j.target.value)
180
+ "aria-describedby": cn(v, { help: t, error: l, pinned: r }),
181
+ onChange: (j) => c == null ? void 0 : c(j.target.value)
182
182
  }
183
183
  );
184
- return /* @__PURE__ */ n(cn, { id: _, label: e, help: t, error: l, pinned: i, children: B ? /* @__PURE__ */ f("span", { className: "cms-input-reveal", children: [
185
- z,
184
+ return /* @__PURE__ */ n(on, { id: v, label: e, help: t, error: l, pinned: r, children: R ? /* @__PURE__ */ h("span", { className: "cms-input-reveal", children: [
185
+ U,
186
186
  /* @__PURE__ */ n(
187
187
  "button",
188
188
  {
189
189
  type: "button",
190
190
  className: "cms-input-reveal__button",
191
- "aria-controls": _,
192
- "aria-label": y ? x.hide : x.show,
193
- title: y ? x.hide : x.show,
191
+ "aria-controls": v,
192
+ "aria-label": w ? N.hide : N.show,
193
+ title: w ? N.hide : N.show,
194
194
  disabled: s,
195
- onClick: () => I((j) => !j),
196
- children: /* @__PURE__ */ n($, { name: y ? "eye-off" : "eye", size: 18 })
195
+ onClick: () => T((j) => !j),
196
+ children: /* @__PURE__ */ n($, { name: w ? "eye-off" : "eye", size: 18 })
197
197
  }
198
198
  )
199
- ] }) : z });
199
+ ] }) : U });
200
200
  }
201
- function jt({ label: e, help: t, error: l, disabled: s, readOnly: a, pinned: i, value: h, onChange: d, placeholder: u, rows: b = 4, name: c, locale: v, minLength: m, maxLength: N, required: r }) {
202
- const g = he();
203
- return /* @__PURE__ */ n(cn, { id: g, label: e, help: t, error: l, pinned: i, children: /* @__PURE__ */ n(
201
+ function jt({ label: e, help: t, error: l, disabled: s, readOnly: a, pinned: r, value: m, onChange: c, placeholder: d, rows: b = 4, name: i, locale: g, minLength: u, maxLength: k, required: f }) {
202
+ const x = he();
203
+ return /* @__PURE__ */ n(on, { id: x, label: e, help: t, error: l, pinned: r, children: /* @__PURE__ */ n(
204
204
  "textarea",
205
205
  {
206
- id: g,
207
- name: c,
206
+ id: x,
207
+ name: i,
208
208
  className: "cms-input cms-textarea",
209
209
  rows: b,
210
- value: h,
211
- lang: v,
212
- placeholder: u,
210
+ value: m,
211
+ lang: g,
212
+ placeholder: d,
213
213
  disabled: s,
214
- readOnly: a === !0 || i != null,
215
- required: r,
216
- "aria-required": r || void 0,
217
- minLength: m,
218
- maxLength: N,
214
+ readOnly: a === !0 || r != null,
215
+ required: f,
216
+ "aria-required": f || void 0,
217
+ minLength: u,
218
+ maxLength: k,
219
219
  "aria-invalid": l != null || void 0,
220
- "aria-describedby": on(g, { help: t, error: l, pinned: i }),
221
- onChange: (T) => d == null ? void 0 : d(T.target.value)
220
+ "aria-describedby": cn(x, { help: t, error: l, pinned: r }),
221
+ onChange: (L) => c == null ? void 0 : c(L.target.value)
222
222
  }
223
223
  ) });
224
224
  }
225
- function Yt({ label: e, help: t, error: l, disabled: s, readOnly: a, value: i, options: h, onChange: d, emptyText: u = "Nothing to choose from yet.", name: b }) {
226
- const c = he(), v = h.length === 0;
227
- return /* @__PURE__ */ n(cn, { id: c, label: e, help: v ? u : t, error: l, children: /* @__PURE__ */ n(
225
+ function Yt({ label: e, help: t, error: l, disabled: s, readOnly: a, value: r, options: m, onChange: c, emptyText: d = "Nothing to choose from yet.", name: b }) {
226
+ const i = he(), g = m.length === 0;
227
+ return /* @__PURE__ */ n(on, { id: i, label: e, help: g ? d : t, error: l, children: /* @__PURE__ */ n(
228
228
  "select",
229
229
  {
230
- id: c,
230
+ id: i,
231
231
  name: b,
232
232
  className: "cms-input cms-select",
233
- value: i,
234
- disabled: s || v,
233
+ value: r,
234
+ disabled: s || g,
235
235
  "aria-readonly": a || void 0,
236
236
  "aria-invalid": l != null || void 0,
237
- "aria-describedby": on(c, { help: v ? u : t, error: l }),
238
- onChange: (m) => {
239
- a || d == null || d(m.target.value);
237
+ "aria-describedby": cn(i, { help: g ? d : t, error: l }),
238
+ onChange: (u) => {
239
+ a || c == null || c(u.target.value);
240
240
  },
241
- children: h.map((m) => /* @__PURE__ */ n("option", { value: m.value, disabled: a && m.value !== i, children: m.label }, m.value))
241
+ children: m.map((u) => /* @__PURE__ */ n("option", { value: u.value, disabled: a && u.value !== r, children: u.label }, u.value))
242
242
  }
243
243
  ) });
244
244
  }
245
- function Xt({ label: e, checked: t, onChange: l, disabled: s, readOnly: a, help: i }) {
246
- const h = he();
247
- return /* @__PURE__ */ f("div", { className: "cms-toggle-row", children: [
245
+ function Xt({ label: e, checked: t, onChange: l, disabled: s, readOnly: a, help: r }) {
246
+ const m = he();
247
+ return /* @__PURE__ */ h("div", { className: "cms-toggle-row", children: [
248
248
  /* @__PURE__ */ n(
249
249
  "button",
250
250
  {
251
- id: h,
251
+ id: m,
252
252
  type: "button",
253
253
  role: "switch",
254
- className: F("cms-toggle", t && "is-on"),
254
+ className: H("cms-toggle", t && "is-on"),
255
255
  "aria-checked": t,
256
256
  "aria-readonly": a || void 0,
257
- "aria-describedby": i != null ? `${h}-help` : void 0,
257
+ "aria-describedby": r != null ? `${m}-help` : void 0,
258
258
  disabled: s,
259
259
  onClick: () => {
260
260
  a || l == null || l(!t);
@@ -262,85 +262,85 @@ function Xt({ label: e, checked: t, onChange: l, disabled: s, readOnly: a, help:
262
262
  children: /* @__PURE__ */ n("span", { className: "cms-toggle__thumb" })
263
263
  }
264
264
  ),
265
- /* @__PURE__ */ n("label", { className: "cms-toggle__label", htmlFor: h, children: e }),
266
- i != null ? /* @__PURE__ */ n("p", { className: "cms-field__help", id: `${h}-help`, children: i }) : null
265
+ /* @__PURE__ */ n("label", { className: "cms-toggle__label", htmlFor: m, children: e }),
266
+ r != null ? /* @__PURE__ */ n("p", { className: "cms-field__help", id: `${m}-help`, children: r }) : null
267
267
  ] });
268
268
  }
269
269
  const qn = 150;
270
- function Sn({ open: e, title: t, onClose: l, dirty: s = !1, onDirtyClose: a, children: i, footer: h, closeLabel: d = "Close", initialFocus: u, className: b }) {
271
- const [c, v] = D(e), [m, N] = D(!1), r = O(null), g = O(null), T = he();
270
+ function Sn({ open: e, title: t, onClose: l, dirty: s = !1, onDirtyClose: a, children: r, footer: m, closeLabel: c = "Close", initialFocus: d, className: b }) {
271
+ const [i, g] = I(e), [u, k] = I(!1), f = z(null), x = z(null), L = he();
272
272
  if (Q(() => {
273
273
  if (e) {
274
- g.current = document.activeElement, v(!0), N(!1);
274
+ x.current = document.activeElement, g(!0), k(!1);
275
275
  return;
276
276
  }
277
- if (!c) return;
278
- N(!0);
279
- const S = window.setTimeout(() => {
280
- var x, _;
281
- v(!1), N(!1), (_ = (x = g.current) == null ? void 0 : x.focus) == null || _.call(x);
277
+ if (!i) return;
278
+ k(!0);
279
+ const _ = window.setTimeout(() => {
280
+ var N, v;
281
+ g(!1), k(!1), (v = (N = x.current) == null ? void 0 : N.focus) == null || v.call(N);
282
282
  }, qn);
283
- return () => window.clearTimeout(S);
284
- }, [e, c]), Q(() => {
285
- var S, x;
286
- if (e && c) {
287
- const _ = 'input, select, textarea, button, [href], [tabindex]:not([tabindex="-1"])';
288
- (x = (u == null ? void 0 : u.current) ?? ((S = r.current) == null ? void 0 : S.querySelector(`.cms-modal__body :is(${_}), .cms-modal__foot :is(${_})`)) ?? r.current) == null || x.focus();
283
+ return () => window.clearTimeout(_);
284
+ }, [e, i]), Q(() => {
285
+ var _, N;
286
+ if (e && i) {
287
+ const v = 'input, select, textarea, button, [href], [tabindex]:not([tabindex="-1"])';
288
+ (N = (d == null ? void 0 : d.current) ?? ((_ = f.current) == null ? void 0 : _.querySelector(`.cms-modal__body :is(${v}), .cms-modal__foot :is(${v})`)) ?? f.current) == null || N.focus();
289
289
  }
290
- }, [e, c, u]), !c) return null;
291
- const C = () => {
290
+ }, [e, i, d]), !i) return null;
291
+ const S = () => {
292
292
  s ? a == null || a() : l();
293
293
  };
294
294
  return an(
295
- /* @__PURE__ */ n("div", { className: F("cms-modal-scrim", m && "is-closing"), onMouseDown: (S) => {
296
- S.target === S.currentTarget && C();
297
- }, children: /* @__PURE__ */ f(
295
+ /* @__PURE__ */ n("div", { className: H("cms-modal-scrim", u && "is-closing"), onMouseDown: (_) => {
296
+ _.target === _.currentTarget && S();
297
+ }, children: /* @__PURE__ */ h(
298
298
  "div",
299
299
  {
300
- ref: r,
301
- className: F("cms-modal", b, m && "is-closing", s && "is-dirty"),
300
+ ref: f,
301
+ className: H("cms-modal", b, u && "is-closing", s && "is-dirty"),
302
302
  role: "dialog",
303
303
  "aria-modal": "true",
304
- "aria-labelledby": T,
304
+ "aria-labelledby": L,
305
305
  tabIndex: -1,
306
- onKeyDown: (S) => {
307
- var x;
308
- if (S.key === "Escape")
309
- S.stopPropagation(), C();
310
- else if (S.key === "Tab") {
311
- const _ = (x = r.current) == null ? void 0 : x.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
312
- if (!_ || _.length === 0) return;
313
- const y = _[0], I = _[_.length - 1];
314
- S.shiftKey && document.activeElement === y ? (S.preventDefault(), I.focus()) : !S.shiftKey && document.activeElement === I && (S.preventDefault(), y.focus());
306
+ onKeyDown: (_) => {
307
+ var N;
308
+ if (_.key === "Escape")
309
+ _.stopPropagation(), S();
310
+ else if (_.key === "Tab") {
311
+ const v = (N = f.current) == null ? void 0 : N.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
312
+ if (!v || v.length === 0) return;
313
+ const w = v[0], T = v[v.length - 1];
314
+ _.shiftKey && document.activeElement === w ? (_.preventDefault(), T.focus()) : !_.shiftKey && document.activeElement === T && (_.preventDefault(), w.focus());
315
315
  }
316
316
  },
317
317
  children: [
318
- /* @__PURE__ */ f("header", { className: "cms-modal__head", children: [
319
- /* @__PURE__ */ n("h2", { className: "cms-modal__title", id: T, children: t }),
320
- /* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button", "aria-label": d, onClick: C, children: /* @__PURE__ */ n(se, { name: "close" }) })
318
+ /* @__PURE__ */ h("header", { className: "cms-modal__head", children: [
319
+ /* @__PURE__ */ n("h2", { className: "cms-modal__title", id: L, children: t }),
320
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button", "aria-label": c, onClick: S, children: /* @__PURE__ */ n(se, { name: "close" }) })
321
321
  ] }),
322
- /* @__PURE__ */ n("div", { className: "cms-modal__body", children: i }),
323
- h != null ? /* @__PURE__ */ n("footer", { className: "cms-modal__foot", children: h }) : null
322
+ /* @__PURE__ */ n("div", { className: "cms-modal__body", children: r }),
323
+ m != null ? /* @__PURE__ */ n("footer", { className: "cms-modal__foot", children: m }) : null
324
324
  ]
325
325
  }
326
326
  ) }),
327
327
  document.body
328
328
  );
329
329
  }
330
- function Jt({ open: e, title: t, message: l, kind: s = "default", confirmLabel: a, cancelLabel: i, closeLabel: h, onConfirm: d, onCancel: u }) {
330
+ function Jt({ open: e, title: t, message: l, kind: s = "default", confirmLabel: a, cancelLabel: r, closeLabel: m, onConfirm: c, onCancel: d }) {
331
331
  const b = s === "discard-changes";
332
332
  return /* @__PURE__ */ n(
333
333
  Sn,
334
334
  {
335
335
  open: e,
336
336
  title: t,
337
- onClose: u,
338
- ...h === void 0 ? {} : { closeLabel: h },
339
- footer: /* @__PURE__ */ f(ge, { children: [
340
- /* @__PURE__ */ n(De, { onClick: u, children: i ?? (b ? "Keep editing" : "Cancel") }),
341
- /* @__PURE__ */ n(De, { variant: s === "default" ? "primary" : "danger", onClick: d, children: a ?? (b ? "Discard changes" : "Confirm") })
337
+ onClose: d,
338
+ ...m === void 0 ? {} : { closeLabel: m },
339
+ footer: /* @__PURE__ */ h(ge, { children: [
340
+ /* @__PURE__ */ n(De, { onClick: d, children: r ?? (b ? "Keep editing" : "Cancel") }),
341
+ /* @__PURE__ */ n(De, { variant: s === "default" ? "primary" : "danger", onClick: c, children: a ?? (b ? "Discard changes" : "Confirm") })
342
342
  ] }),
343
- children: s !== "default" ? /* @__PURE__ */ f("p", { className: "cms-confirm__warning", children: [
343
+ children: s !== "default" ? /* @__PURE__ */ h("p", { className: "cms-confirm__warning", children: [
344
344
  /* @__PURE__ */ n(se, { name: "warning" }),
345
345
  " ",
346
346
  l
@@ -349,7 +349,7 @@ function Jt({ open: e, title: t, message: l, kind: s = "default", confirmLabel:
349
349
  );
350
350
  }
351
351
  function Qt({ kind: e, message: t, action: l, onDismiss: s, dismissLabel: a = "Dismiss" }) {
352
- return /* @__PURE__ */ f("div", { className: F("cms-toast", `cms-toast--${e}`), role: e === "error" ? "alert" : "status", children: [
352
+ return /* @__PURE__ */ h("div", { className: H("cms-toast", `cms-toast--${e}`), role: e === "error" ? "alert" : "status", children: [
353
353
  /* @__PURE__ */ n(se, { name: e === "success" ? "check" : e === "error" ? "warning" : "info" }),
354
354
  /* @__PURE__ */ n("span", { className: "cms-toast__message", children: t }),
355
355
  l ? /* @__PURE__ */ n(De, { className: "cms-toast__action", onClick: l.onAction, children: l.label }) : null,
@@ -360,15 +360,15 @@ function el({ children: e }) {
360
360
  return /* @__PURE__ */ n("div", { className: "cms-toast-region", children: e });
361
361
  }
362
362
  function Gn({ what: e, layout: t = "inline" }) {
363
- return /* @__PURE__ */ f("div", { className: F("cms-loading", `cms-loading--${t}`), role: "status", "aria-live": "polite", children: [
363
+ return /* @__PURE__ */ h("div", { className: H("cms-loading", `cms-loading--${t}`), role: "status", "aria-live": "polite", children: [
364
364
  /* @__PURE__ */ n(se, { name: "spinner" }),
365
365
  /* @__PURE__ */ n("span", { children: e })
366
366
  ] });
367
367
  }
368
368
  function jn({ title: e, hint: t, action: l, icon: s }) {
369
- return /* @__PURE__ */ f("div", { className: "cms-state cms-state--empty cms-state--page", role: "status", "aria-live": "polite", "data-kind": "empty", children: [
369
+ return /* @__PURE__ */ h("div", { className: "cms-state cms-state--empty cms-state--page", role: "status", "aria-live": "polite", "data-kind": "empty", children: [
370
370
  s !== void 0 && Be(s) !== null ? /* @__PURE__ */ n("span", { className: "cms-state__icon", "aria-hidden": "true", children: /* @__PURE__ */ n(Cn, { name: s, size: 32 }) }) : null,
371
- /* @__PURE__ */ f("span", { className: "cms-state__text", children: [
371
+ /* @__PURE__ */ h("span", { className: "cms-state__text", children: [
372
372
  /* @__PURE__ */ n("span", { className: "cms-state__title", children: e }),
373
373
  t != null ? /* @__PURE__ */ n("span", { className: "cms-state__description", children: t }) : null
374
374
  ] }),
@@ -376,7 +376,7 @@ function jn({ title: e, hint: t, action: l, icon: s }) {
376
376
  ] });
377
377
  }
378
378
  function Yn({ message: e, onRetry: t, retryLabel: l = "Try again" }) {
379
- return /* @__PURE__ */ f("div", { className: "cms-error-banner", role: "alert", children: [
379
+ return /* @__PURE__ */ h("div", { className: "cms-error-banner", role: "alert", children: [
380
380
  /* @__PURE__ */ n(se, { name: "warning" }),
381
381
  /* @__PURE__ */ n("span", { className: "cms-error-banner__message", children: e }),
382
382
  t ? /* @__PURE__ */ n(De, { onClick: t, children: l }) : null
@@ -389,39 +389,39 @@ function Xn() {
389
389
  return Number.isFinite(t) && t >= 0 ? t : en;
390
390
  }
391
391
  function Jn() {
392
- return /* @__PURE__ */ f("svg", { className: "cms-state__spinner", viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
392
+ return /* @__PURE__ */ h("svg", { className: "cms-state__spinner", viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
393
393
  /* @__PURE__ */ n("circle", { className: "cms-state__track", cx: "12", cy: "12", r: "10", fill: "none" }),
394
394
  /* @__PURE__ */ n("circle", { className: "cms-state__arc", cx: "12", cy: "12", r: "10", fill: "none", pathLength: "100", strokeDasharray: "28 72" })
395
395
  ] });
396
396
  }
397
- function Le({ kind: e, title: t, description: l, action: s, placement: a = "page", icon: i }) {
398
- const [h, d] = D(e !== "loading");
397
+ function Le({ kind: e, title: t, description: l, action: s, placement: a = "page", icon: r }) {
398
+ const [m, c] = I(e !== "loading");
399
399
  Q(() => {
400
400
  if (e !== "loading") {
401
- d(!0);
401
+ c(!0);
402
402
  return;
403
403
  }
404
- d(!1);
405
- const b = window.setTimeout(() => d(!0), Xn());
404
+ c(!1);
405
+ const b = window.setTimeout(() => c(!0), Xn());
406
406
  return () => window.clearTimeout(b);
407
407
  }, [e]);
408
- const u = a === "block";
409
- return /* @__PURE__ */ f(
408
+ const d = a === "block";
409
+ return /* @__PURE__ */ h(
410
410
  "div",
411
411
  {
412
- className: F("cms-state", `cms-state--${e}`, `cms-state--${a}`, !h && "is-waiting"),
412
+ className: H("cms-state", `cms-state--${e}`, `cms-state--${a}`, !m && "is-waiting"),
413
413
  role: "status",
414
414
  "aria-live": "polite",
415
415
  "data-kind": e,
416
416
  children: [
417
417
  e === "loading" ? /* @__PURE__ */ n(Jn, {}) : null,
418
- (e === "error" || e === "denied") && !u ? /* @__PURE__ */ n(se, { name: e === "error" ? "warning" : "lock" }) : null,
419
- e === "empty" && !u && i !== void 0 && Be(i) !== null ? /* @__PURE__ */ n("span", { className: "cms-state__icon", "aria-hidden": "true", children: /* @__PURE__ */ n(Cn, { name: i, size: a === "page" ? 32 : 24 }) }) : null,
420
- /* @__PURE__ */ f("span", { className: "cms-state__text", children: [
418
+ (e === "error" || e === "denied") && !d ? /* @__PURE__ */ n(se, { name: e === "error" ? "warning" : "lock" }) : null,
419
+ e === "empty" && !d && r !== void 0 && Be(r) !== null ? /* @__PURE__ */ n("span", { className: "cms-state__icon", "aria-hidden": "true", children: /* @__PURE__ */ n(Cn, { name: r, size: a === "page" ? 32 : 24 }) }) : null,
420
+ /* @__PURE__ */ h("span", { className: "cms-state__text", children: [
421
421
  /* @__PURE__ */ n("span", { className: "cms-state__title", children: t }),
422
- l !== void 0 && !u ? /* @__PURE__ */ n("span", { className: "cms-state__description", children: l }) : null
422
+ l !== void 0 && !d ? /* @__PURE__ */ n("span", { className: "cms-state__description", children: l }) : null
423
423
  ] }),
424
- s !== void 0 && e !== "denied" ? /* @__PURE__ */ n(De, { className: "cms-state__action", variant: u ? "quiet" : "secondary", onClick: s.onAction, children: s.label }) : null
424
+ s !== void 0 && e !== "denied" ? /* @__PURE__ */ n(De, { className: "cms-state__action", variant: d ? "quiet" : "secondary", onClick: s.onAction, children: s.label }) : null
425
425
  ]
426
426
  }
427
427
  );
@@ -437,105 +437,105 @@ function lt(e) {
437
437
  return e.getClientRects().length > 0;
438
438
  }
439
439
  function nl(e) {
440
- const { name: t, badge: l, closeLabel: s, onClose: a, actions: i = [], moreLabel: h = "More", edit: d, editing: u, state: b, siblings: c, bar: v, thumbnails: m, strip: N, onZoom: r, children: g } = e, T = O(null), C = O(null), S = he(), [x, _] = D(!1), y = O(null);
440
+ const { name: t, badge: l, closeLabel: s, onClose: a, actions: r = [], moreLabel: m = "More", edit: c, editing: d, state: b, siblings: i, bar: g, thumbnails: u, strip: k, onZoom: f, children: x } = e, L = z(null), S = z(null), _ = he(), [N, v] = I(!1), w = z(null);
441
441
  Q(() => {
442
- var z;
443
- const k = document.activeElement, B = document.body.style.overflow;
444
- return document.body.style.overflow = "hidden", (z = C.current) == null || z.focus(), () => {
442
+ var U;
443
+ const M = document.activeElement, R = document.body.style.overflow;
444
+ return document.body.style.overflow = "hidden", (U = S.current) == null || U.focus(), () => {
445
445
  var j;
446
- document.body.style.overflow = B, (j = k == null ? void 0 : k.focus) == null || j.call(k);
446
+ document.body.style.overflow = R, (j = M == null ? void 0 : M.focus) == null || j.call(M);
447
447
  };
448
448
  }, []);
449
- const I = () => {
450
- u != null && u.dirty ? u.onDirtyClose() : a();
451
- }, U = (k) => {
452
- const B = k.touches.length === 1 ? k.touches[0] : void 0;
453
- y.current = B === void 0 || u !== void 0 || tt(k.target) ? null : { x: B.clientX, y: B.clientY };
454
- }, P = (k) => {
449
+ const T = () => {
450
+ d != null && d.dirty ? d.onDirtyClose() : a();
451
+ }, B = (M) => {
452
+ const R = M.touches.length === 1 ? M.touches[0] : void 0;
453
+ w.current = R === void 0 || d !== void 0 || tt(M.target) ? null : { x: R.clientX, y: R.clientY };
454
+ }, F = (M) => {
455
455
  var K, G;
456
- const B = y.current, z = k.changedTouches[0];
457
- if (y.current = null, B === null || z === void 0) return;
458
- const j = z.clientX - B.x;
459
- Math.abs(j) < et || Math.abs(j) < Math.abs(z.clientY - B.y) || (j > 0 ? (K = c == null ? void 0 : c.onPrevious) == null || K.call(c) : (G = c == null ? void 0 : c.onNext) == null || G.call(c));
456
+ const R = w.current, U = M.changedTouches[0];
457
+ if (w.current = null, R === null || U === void 0) return;
458
+ const j = U.clientX - R.x;
459
+ Math.abs(j) < et || Math.abs(j) < Math.abs(U.clientY - R.y) || (j > 0 ? (K = i == null ? void 0 : i.onPrevious) == null || K.call(i) : (G = i == null ? void 0 : i.onNext) == null || G.call(i));
460
460
  };
461
461
  return an(
462
- /* @__PURE__ */ f(
462
+ /* @__PURE__ */ h(
463
463
  "div",
464
464
  {
465
- ref: T,
466
- className: F("cms-viewer", u !== void 0 && "is-editing"),
465
+ ref: L,
466
+ className: H("cms-viewer", d !== void 0 && "is-editing"),
467
467
  role: "dialog",
468
468
  "aria-modal": "true",
469
- "aria-labelledby": S,
469
+ "aria-labelledby": _,
470
470
  tabIndex: -1,
471
- onKeyDown: (k) => {
472
- var B, z, j;
473
- if (k.key === "Escape") {
474
- if (u !== void 0) return;
475
- k.stopPropagation(), x ? _(!1) : a();
476
- } else if (k.key === "Tab") {
477
- const K = Array.from(((B = T.current) == null ? void 0 : B.querySelectorAll(Qn)) ?? []).filter(lt);
471
+ onKeyDown: (M) => {
472
+ var R, U, j;
473
+ if (M.key === "Escape") {
474
+ if (d !== void 0) return;
475
+ M.stopPropagation(), N ? v(!1) : a();
476
+ } else if (M.key === "Tab") {
477
+ const K = Array.from(((R = L.current) == null ? void 0 : R.querySelectorAll(Qn)) ?? []).filter(lt);
478
478
  if (K.length === 0) return;
479
479
  const G = K[0], Y = K[K.length - 1];
480
- k.shiftKey && document.activeElement === G ? (k.preventDefault(), Y.focus()) : !k.shiftKey && document.activeElement === Y && (k.preventDefault(), G.focus());
481
- } else u === void 0 && !nt(k.target) && !k.ctrlKey && !k.metaKey && !k.altKey && (k.key === "ArrowLeft" ? (z = c == null ? void 0 : c.onPrevious) == null || z.call(c) : k.key === "ArrowRight" ? (j = c == null ? void 0 : c.onNext) == null || j.call(c) : k.key === "+" || k.key === "=" ? r == null || r("in") : k.key === "-" ? r == null || r("out") : k.key === "0" && (r == null || r("reset")));
480
+ M.shiftKey && document.activeElement === G ? (M.preventDefault(), Y.focus()) : !M.shiftKey && document.activeElement === Y && (M.preventDefault(), G.focus());
481
+ } else d === void 0 && !nt(M.target) && !M.ctrlKey && !M.metaKey && !M.altKey && (M.key === "ArrowLeft" ? (U = i == null ? void 0 : i.onPrevious) == null || U.call(i) : M.key === "ArrowRight" ? (j = i == null ? void 0 : i.onNext) == null || j.call(i) : M.key === "+" || M.key === "=" ? f == null || f("in") : M.key === "-" ? f == null || f("out") : M.key === "0" && (f == null || f("reset")));
482
482
  },
483
483
  children: [
484
- c !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-visually-hidden", role: "status", children: `${t}, ${c.position}` }) : null,
485
- /* @__PURE__ */ f("header", { className: "cms-viewer__top", children: [
486
- /* @__PURE__ */ n("button", { ref: C, type: "button", className: "cms-viewer__icon", "aria-label": s, onClick: I, children: /* @__PURE__ */ n(se, { name: "close" }) }),
484
+ i !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-visually-hidden", role: "status", children: `${t}, ${i.position}` }) : null,
485
+ /* @__PURE__ */ h("header", { className: "cms-viewer__top", children: [
486
+ /* @__PURE__ */ n("button", { ref: S, type: "button", className: "cms-viewer__icon", "aria-label": s, onClick: T, children: /* @__PURE__ */ n(se, { name: "close" }) }),
487
487
  /* @__PURE__ */ n("span", { className: "cms-viewer__badge", children: l }),
488
- /* @__PURE__ */ n("h2", { className: "cms-viewer__name", id: S, title: t, children: t }),
489
- c !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-viewer__position", children: c.position }) : null,
488
+ /* @__PURE__ */ n("h2", { className: "cms-viewer__name", id: _, title: t, children: t }),
489
+ i !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-viewer__position", children: i.position }) : null,
490
490
  /* @__PURE__ */ n("span", { className: "cms-viewer__space" }),
491
- u !== void 0 ? /* @__PURE__ */ f(ge, { children: [
492
- /* @__PURE__ */ n("span", { className: "cms-viewer__status", role: "status", children: u.status }),
493
- /* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: u.onDone, children: u.doneLabel })
494
- ] }) : /* @__PURE__ */ f(ge, { children: [
495
- /* @__PURE__ */ n("span", { className: "cms-viewer__actions", children: i.map((k) => /* @__PURE__ */ f("button", { type: "button", className: "cms-viewer__button", onClick: k.onSelect, children: [
496
- k.icon,
497
- k.label
498
- ] }, k.label)) }),
499
- d !== void 0 ? /* @__PURE__ */ f("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": d.label, onClick: d.onEdit, children: [
500
- d.icon,
501
- /* @__PURE__ */ n("span", { className: "cms-viewer__wide", children: d.label })
491
+ d !== void 0 ? /* @__PURE__ */ h(ge, { children: [
492
+ /* @__PURE__ */ n("span", { className: "cms-viewer__status", role: "status", children: d.status }),
493
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: d.onDone, children: d.doneLabel })
494
+ ] }) : /* @__PURE__ */ h(ge, { children: [
495
+ /* @__PURE__ */ n("span", { className: "cms-viewer__actions", children: r.map((M) => /* @__PURE__ */ h("button", { type: "button", className: "cms-viewer__button", onClick: M.onSelect, children: [
496
+ M.icon,
497
+ M.label
498
+ ] }, M.label)) }),
499
+ c !== void 0 ? /* @__PURE__ */ h("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": c.label, onClick: c.onEdit, children: [
500
+ c.icon,
501
+ /* @__PURE__ */ n("span", { className: "cms-viewer__wide", children: c.label })
502
502
  ] }) : null,
503
- i.length > 0 ? /* @__PURE__ */ f("span", { className: "cms-viewer__more", children: [
504
- /* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__icon", "aria-label": h, "aria-expanded": x, onClick: () => _((k) => !k), children: /* @__PURE__ */ n($, { name: "more" }) }),
505
- x ? /* @__PURE__ */ n("span", { className: "cms-viewer__menu", children: i.map((k) => /* @__PURE__ */ f(
503
+ r.length > 0 ? /* @__PURE__ */ h("span", { className: "cms-viewer__more", children: [
504
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__icon", "aria-label": m, "aria-expanded": N, onClick: () => v((M) => !M), children: /* @__PURE__ */ n($, { name: "more" }) }),
505
+ N ? /* @__PURE__ */ n("span", { className: "cms-viewer__menu", children: r.map((M) => /* @__PURE__ */ h(
506
506
  "button",
507
507
  {
508
508
  type: "button",
509
509
  className: "cms-viewer__button",
510
510
  onClick: () => {
511
- _(!1), k.onSelect();
511
+ v(!1), M.onSelect();
512
512
  },
513
513
  children: [
514
- k.icon,
515
- k.label
514
+ M.icon,
515
+ M.label
516
516
  ]
517
517
  },
518
- k.label
518
+ M.label
519
519
  )) }) : null
520
520
  ] }) : null
521
521
  ] })
522
522
  ] }),
523
- /* @__PURE__ */ f("div", { className: "cms-viewer__body", children: [
524
- m != null && u === void 0 ? /* @__PURE__ */ n("nav", { className: "cms-viewer__thumbnails", children: m }) : null,
525
- /* @__PURE__ */ f("div", { className: "cms-viewer__content", onTouchStart: U, onTouchEnd: P, children: [
526
- (u == null ? void 0 : u.conflict) !== void 0 ? /* @__PURE__ */ f("div", { className: "cms-viewer__conflict", role: "alert", children: [
527
- /* @__PURE__ */ n("p", { className: "cms-viewer__conflict-text", children: u.conflict.message }),
528
- /* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__button", onClick: u.conflict.onOverwrite, children: u.conflict.overwriteLabel }),
529
- /* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: u.conflict.onKeepBoth, children: u.conflict.keepBothLabel })
523
+ /* @__PURE__ */ h("div", { className: "cms-viewer__body", children: [
524
+ u != null && d === void 0 ? /* @__PURE__ */ n("nav", { className: "cms-viewer__thumbnails", children: u }) : null,
525
+ /* @__PURE__ */ h("div", { className: "cms-viewer__content", onTouchStart: B, onTouchEnd: F, children: [
526
+ (d == null ? void 0 : d.conflict) !== void 0 ? /* @__PURE__ */ h("div", { className: "cms-viewer__conflict", role: "alert", children: [
527
+ /* @__PURE__ */ n("p", { className: "cms-viewer__conflict-text", children: d.conflict.message }),
528
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__button", onClick: d.conflict.onOverwrite, children: d.conflict.overwriteLabel }),
529
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: d.conflict.onKeepBoth, children: d.conflict.keepBothLabel })
530
530
  ] }) : null,
531
- b === void 0 ? g : /* @__PURE__ */ n(st, { state: b }),
532
- u === void 0 && (c != null && c.onPrevious) ? /* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__side cms-viewer__side--previous", "aria-label": c.previousLabel, title: c.previousLabel, onClick: c.onPrevious, children: /* @__PURE__ */ n(se, { name: "back" }) }) : null,
533
- u === void 0 && (c != null && c.onNext) ? /* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__side cms-viewer__side--next", "aria-label": c.nextLabel, title: c.nextLabel, onClick: c.onNext, children: /* @__PURE__ */ n(se, { name: "back" }) }) : null,
534
- u === void 0 && c !== void 0 ? /* @__PURE__ */ n("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(c.total, 7) }, (k, B) => /* @__PURE__ */ n("i", { className: B === Math.min(c.index, 6) ? "is-current" : void 0 }, B)) }) : null
531
+ b === void 0 ? x : /* @__PURE__ */ n(st, { state: b }),
532
+ d === void 0 && (i != null && i.onPrevious) ? /* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__side cms-viewer__side--previous", "aria-label": i.previousLabel, title: i.previousLabel, onClick: i.onPrevious, children: /* @__PURE__ */ n(se, { name: "back" }) }) : null,
533
+ d === void 0 && (i != null && i.onNext) ? /* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__side cms-viewer__side--next", "aria-label": i.nextLabel, title: i.nextLabel, onClick: i.onNext, children: /* @__PURE__ */ n(se, { name: "back" }) }) : null,
534
+ d === void 0 && i !== void 0 ? /* @__PURE__ */ n("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(i.total, 7) }, (M, R) => /* @__PURE__ */ n("i", { className: R === Math.min(i.index, 6) ? "is-current" : void 0 }, R)) }) : null
535
535
  ] })
536
536
  ] }),
537
- u === void 0 && N != null ? /* @__PURE__ */ n("div", { className: "cms-viewer__strip", children: N }) : null,
538
- v != null ? /* @__PURE__ */ n("footer", { className: "cms-viewer__bar", children: v }) : null
537
+ d === void 0 && k != null ? /* @__PURE__ */ n("div", { className: "cms-viewer__strip", children: k }) : null,
538
+ g != null ? /* @__PURE__ */ n("footer", { className: "cms-viewer__bar", children: g }) : null
539
539
  ]
540
540
  }
541
541
  ),
@@ -581,168 +581,168 @@ class rt extends Error {
581
581
  }
582
582
  }
583
583
  const Je = (e, t) => `${e}
584
- ${t}`, it = (e, t) => e === "" ? t : `${e}/${t}`, ct = 48;
584
+ ${t}`, it = (e, t) => e === "" ? t : `${e}/${t}`, ot = 48;
585
585
  function tl(e) {
586
586
  var ne, ye;
587
- const { open: t, spaces: l, list: s, disabledReason: a, budget: i, formatSize: h, labels: d, onConfirm: u, onCancel: b } = e, [c, v] = D(((ne = l[0]) == null ? void 0 : ne.id) ?? ""), [m, N] = D(""), [r, g] = D({ status: "loading" }), [T, C] = D(0), [S, x] = D(/* @__PURE__ */ new Map()), [_, y] = D(0), [I, U] = D(!1), P = O(null), k = O(!1);
587
+ const { open: t, spaces: l, list: s, disabledReason: a, budget: r, formatSize: m, labels: c, onConfirm: d, onCancel: b } = e, [i, g] = I(((ne = l[0]) == null ? void 0 : ne.id) ?? ""), [u, k] = I(""), [f, x] = I({ status: "loading" }), [L, S] = I(0), [_, N] = I(/* @__PURE__ */ new Map()), [v, w] = I(0), [T, B] = I(!1), F = z(null), M = z(!1);
588
588
  Q(() => {
589
- k.current = !1;
590
- }, [t, c, m]);
591
- const B = he();
589
+ M.current = !1;
590
+ }, [t, i, u]);
591
+ const R = he();
592
592
  Q(() => {
593
- var w;
594
- t && (v(((w = l[0]) == null ? void 0 : w.id) ?? ""), N(""), x(/* @__PURE__ */ new Map()), U(!1));
593
+ var y;
594
+ t && (g(((y = l[0]) == null ? void 0 : y.id) ?? ""), k(""), N(/* @__PURE__ */ new Map()), B(!1));
595
595
  }, [t]), Q(() => {
596
- if (!t || c === "") return;
597
- let w = !0;
598
- return g({ status: "loading" }), y(0), s(c, m).then(
599
- (E) => w && g({ status: "ready", entries: E.entries, next: E.next ?? null, paging: !1 }),
600
- (E) => w && g({ status: E instanceof at ? "denied" : "error" })
596
+ if (!t || i === "") return;
597
+ let y = !0;
598
+ return x({ status: "loading" }), w(0), s(i, u).then(
599
+ (E) => y && x({ status: "ready", entries: E.entries, next: E.next ?? null, paging: !1 }),
600
+ (E) => y && x({ status: E instanceof at ? "denied" : "error" })
601
601
  ), () => {
602
- w = !1;
602
+ y = !1;
603
603
  };
604
- }, [t, c, m, s, T]);
605
- const z = Ie(() => {
606
- if (r.status !== "ready" || r.next === null || r.paging) return;
607
- const w = r.next, E = r.entries;
608
- g({ ...r, paging: !0 }), s(c, m, w).then(
604
+ }, [t, i, u, s, L]);
605
+ const U = Ie(() => {
606
+ if (f.status !== "ready" || f.next === null || f.paging) return;
607
+ const y = f.next, E = f.entries;
608
+ x({ ...f, paging: !0 }), s(i, u, y).then(
609
609
  (W) => {
610
- k.current = !1, g({ status: "ready", entries: [...E, ...W.entries], next: W.next ?? null, paging: !1 });
610
+ M.current = !1, x({ status: "ready", entries: [...E, ...W.entries], next: W.next ?? null, paging: !1 });
611
611
  },
612
612
  (W) => {
613
613
  if (!(W instanceof rt)) {
614
- g({ status: "ready", entries: E, next: w, paging: !1 });
614
+ x({ status: "ready", entries: E, next: y, paging: !1 });
615
615
  return;
616
616
  }
617
- if (k.current) {
618
- g({ status: "error" });
617
+ if (M.current) {
618
+ x({ status: "error" });
619
619
  return;
620
620
  }
621
- k.current = !0, C((q) => q + 1);
621
+ M.current = !0, S((q) => q + 1);
622
622
  }
623
623
  );
624
- }, [r, s, c, m]), j = Ie((w) => {
624
+ }, [f, s, i, u]), j = Ie((y) => {
625
625
  var E;
626
- return ((E = i == null ? void 0 : i.cost) == null ? void 0 : E.call(i, w)) ?? w.size ?? 0;
627
- }, [i]), K = Bn(() => [...S.values()], [S]), G = K.reduce((w, E) => w + (E.size ?? 0), 0), Y = i === void 0 ? null : i.limitBytes - i.usedBytes - K.reduce((w, E) => w + j(E), 0), ee = Y !== null && Y < 0, ie = (w) => {
628
- if (w.kind !== "file") return null;
629
- const E = a == null ? void 0 : a(w);
630
- return E || (Y !== null && !S.has(Je(c, w.id)) && j(w) > Y ? d.overBudget : null);
631
- }, be = (w) => {
632
- const E = Je(c, w.id);
633
- !S.has(E) && ie(w) !== null || x((W) => {
626
+ return ((E = r == null ? void 0 : r.cost) == null ? void 0 : E.call(r, y)) ?? y.size ?? 0;
627
+ }, [r]), K = Bn(() => [..._.values()], [_]), G = K.reduce((y, E) => y + (E.size ?? 0), 0), Y = r === void 0 ? null : r.limitBytes - r.usedBytes - K.reduce((y, E) => y + j(E), 0), ee = Y !== null && Y < 0, ie = (y) => {
628
+ if (y.kind !== "file") return null;
629
+ const E = a == null ? void 0 : a(y);
630
+ return E || (Y !== null && !_.has(Je(i, y.id)) && j(y) > Y ? c.overBudget : null);
631
+ }, be = (y) => {
632
+ const E = Je(i, y.id);
633
+ !_.has(E) && ie(y) !== null || N((W) => {
634
634
  const q = new Map(W);
635
- return q.has(E) ? q.delete(E) : q.set(E, { ...w, space: c, path: m }), q;
635
+ return q.has(E) ? q.delete(E) : q.set(E, { ...y, space: i, path: u }), q;
636
636
  });
637
- }, ce = (w) => N(it(m, w.name)), de = () => N(m.includes("/") ? m.slice(0, m.lastIndexOf("/")) : ""), Ce = (w) => x((E) => {
637
+ }, oe = (y) => k(it(u, y.name)), de = () => k(u.includes("/") ? u.slice(0, u.lastIndexOf("/")) : ""), Ce = (y) => N((E) => {
638
638
  const W = new Map(E);
639
- return W.delete(w), W;
640
- }), fe = r.status === "ready" ? r.entries : [], te = (w) => {
641
- const E = fe[_];
642
- if (w.key === "ArrowDown" || w.key === "ArrowUp" || w.key === "Home" || w.key === "End") {
643
- w.preventDefault();
644
- const W = fe.length - 1, q = w.key === "Home" ? 0 : w.key === "End" ? W : Math.min(W, Math.max(0, _ + (w.key === "ArrowDown" ? 1 : -1)));
645
- y(q), q >= W - 1 && z();
646
- } else w.key === "Enter" && (E == null ? void 0 : E.kind) === "folder" ? (w.preventDefault(), ce(E)) : w.key === " " && (E == null ? void 0 : E.kind) === "file" ? (w.preventDefault(), be(E)) : w.key === "Backspace" && m !== "" && (w.preventDefault(), de());
647
- }, pe = m === "" ? [] : m.split("/"), _e = ((ye = l.find((w) => w.id === c)) == null ? void 0 : ye.name) ?? "", we = (w) => `${B}-entry-${String(w)}`;
648
- return /* @__PURE__ */ f(
639
+ return W.delete(y), W;
640
+ }), fe = f.status === "ready" ? f.entries : [], te = (y) => {
641
+ const E = fe[v];
642
+ if (y.key === "ArrowDown" || y.key === "ArrowUp" || y.key === "Home" || y.key === "End") {
643
+ y.preventDefault();
644
+ const W = fe.length - 1, q = y.key === "Home" ? 0 : y.key === "End" ? W : Math.min(W, Math.max(0, v + (y.key === "ArrowDown" ? 1 : -1)));
645
+ w(q), q >= W - 1 && U();
646
+ } else y.key === "Enter" && (E == null ? void 0 : E.kind) === "folder" ? (y.preventDefault(), oe(E)) : y.key === " " && (E == null ? void 0 : E.kind) === "file" ? (y.preventDefault(), be(E)) : y.key === "Backspace" && u !== "" && (y.preventDefault(), de());
647
+ }, pe = u === "" ? [] : u.split("/"), _e = ((ye = l.find((y) => y.id === i)) == null ? void 0 : ye.name) ?? "", we = (y) => `${R}-entry-${String(y)}`;
648
+ return /* @__PURE__ */ h(
649
649
  Sn,
650
650
  {
651
651
  open: t,
652
- title: d.title,
652
+ title: c.title,
653
653
  onClose: b,
654
- closeLabel: d.close,
655
- initialFocus: P,
654
+ closeLabel: c.close,
655
+ initialFocus: F,
656
656
  className: "cms-file-picker",
657
- footer: /* @__PURE__ */ f("div", { className: "cms-file-picker__foot", children: [
658
- /* @__PURE__ */ f("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
659
- K.length > 0 ? /* @__PURE__ */ n("span", { children: d.total(K.length, h(G)) }) : null,
660
- i !== void 0 && Y !== null ? /* @__PURE__ */ n("span", { className: F(ee && "is-over"), children: ee ? d.overBudget : d.left(h(Math.max(0, Y)), h(i.limitBytes)) }) : null
657
+ footer: /* @__PURE__ */ h("div", { className: "cms-file-picker__foot", children: [
658
+ /* @__PURE__ */ h("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
659
+ K.length > 0 ? /* @__PURE__ */ n("span", { children: c.total(K.length, m(G)) }) : null,
660
+ r !== void 0 && Y !== null ? /* @__PURE__ */ n("span", { className: H(ee && "is-over"), children: ee ? c.overBudget : c.left(m(Math.max(0, Y)), m(r.limitBytes)) }) : null
661
661
  ] }),
662
- /* @__PURE__ */ f("div", { className: "cms-file-picker__actions", children: [
663
- /* @__PURE__ */ n(De, { variant: "secondary", onClick: b, children: d.cancel }),
664
- /* @__PURE__ */ n(De, { variant: "primary", disabled: K.length === 0 || ee, onClick: () => u(K), children: d.confirm(K.length) })
662
+ /* @__PURE__ */ h("div", { className: "cms-file-picker__actions", children: [
663
+ /* @__PURE__ */ n(De, { variant: "secondary", onClick: b, children: c.cancel }),
664
+ /* @__PURE__ */ n(De, { variant: "primary", disabled: K.length === 0 || ee, onClick: () => d(K), children: c.confirm(K.length) })
665
665
  ] })
666
666
  ] }),
667
667
  children: [
668
- /* @__PURE__ */ f("div", { className: "cms-file-picker__top", children: [
669
- l.length > 1 ? /* @__PURE__ */ f("label", { className: "cms-file-picker__space", children: [
670
- /* @__PURE__ */ n("span", { className: "cms-visually-hidden", children: d.space }),
671
- /* @__PURE__ */ n("select", { className: "cms-input cms-select", value: c, onChange: (w) => {
672
- v(w.target.value), N("");
673
- }, children: l.map((w) => /* @__PURE__ */ n("option", { value: w.id, children: w.name }, w.id)) })
668
+ /* @__PURE__ */ h("div", { className: "cms-file-picker__top", children: [
669
+ l.length > 1 ? /* @__PURE__ */ h("label", { className: "cms-file-picker__space", children: [
670
+ /* @__PURE__ */ n("span", { className: "cms-visually-hidden", children: c.space }),
671
+ /* @__PURE__ */ n("select", { className: "cms-input cms-select", value: i, onChange: (y) => {
672
+ g(y.target.value), k("");
673
+ }, children: l.map((y) => /* @__PURE__ */ n("option", { value: y.id, children: y.name }, y.id)) })
674
674
  ] }) : null,
675
- /* @__PURE__ */ f("nav", { className: "cms-file-picker__path", "aria-label": d.path, children: [
676
- /* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button", "aria-label": d.up, disabled: m === "", onClick: de, children: /* @__PURE__ */ n($, { name: "chevron-left" }) }),
677
- /* @__PURE__ */ f("ol", { children: [
678
- /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": m === "" ? "location" : void 0, onClick: () => N(""), children: _e }) }),
679
- pe.map((w, E) => {
675
+ /* @__PURE__ */ h("nav", { className: "cms-file-picker__path", "aria-label": c.path, children: [
676
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button", "aria-label": c.up, disabled: u === "", onClick: de, children: /* @__PURE__ */ n($, { name: "chevron-left" }) }),
677
+ /* @__PURE__ */ h("ol", { children: [
678
+ /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": u === "" ? "location" : void 0, onClick: () => k(""), children: _e }) }),
679
+ pe.map((y, E) => {
680
680
  const W = pe.slice(0, E + 1).join("/");
681
- return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": W === m ? "location" : void 0, onClick: () => N(W), children: w }) }, W);
681
+ return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": W === u ? "location" : void 0, onClick: () => k(W), children: y }) }, W);
682
682
  })
683
683
  ] })
684
684
  ] }),
685
- K.length > 0 ? /* @__PURE__ */ n("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": I, onClick: () => U((w) => !w), children: d.selected(K.length) }) : null
685
+ K.length > 0 ? /* @__PURE__ */ n("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": T, onClick: () => B((y) => !y), children: c.selected(K.length) }) : null
686
686
  ] }),
687
- I && K.length > 0 ? /* @__PURE__ */ f("div", { className: "cms-file-picker__chosen", children: [
688
- /* @__PURE__ */ n("ul", { children: [...S.entries()].map(([w, E]) => /* @__PURE__ */ f("li", { children: [
687
+ T && K.length > 0 ? /* @__PURE__ */ h("div", { className: "cms-file-picker__chosen", children: [
688
+ /* @__PURE__ */ n("ul", { children: [..._.entries()].map(([y, E]) => /* @__PURE__ */ h("li", { children: [
689
689
  /* @__PURE__ */ n("span", { className: "cms-file-picker__name", children: E.name }),
690
- /* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button", "aria-label": d.remove(E.name), onClick: () => Ce(w), children: /* @__PURE__ */ n(se, { name: "close" }) })
691
- ] }, w)) }),
690
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button", "aria-label": c.remove(E.name), onClick: () => Ce(y), children: /* @__PURE__ */ n(se, { name: "close" }) })
691
+ ] }, y)) }),
692
692
  /* @__PURE__ */ n(De, { variant: "secondary", onClick: () => {
693
- x(/* @__PURE__ */ new Map()), U(!1);
694
- }, children: d.clear })
693
+ N(/* @__PURE__ */ new Map()), B(!1);
694
+ }, children: c.clear })
695
695
  ] }) : null,
696
- /* @__PURE__ */ f("div", { className: "cms-file-picker__list", onScroll: (w) => {
697
- const E = w.currentTarget;
698
- E.scrollTop + E.clientHeight >= E.scrollHeight - ct && z();
696
+ /* @__PURE__ */ h("div", { className: "cms-file-picker__list", onScroll: (y) => {
697
+ const E = y.currentTarget;
698
+ E.scrollTop + E.clientHeight >= E.scrollHeight - ot && U();
699
699
  }, children: [
700
- r.status === "loading" ? /* @__PURE__ */ n(Le, { kind: "loading", title: d.loading, placement: "page" }) : null,
701
- r.status === "error" ? /* @__PURE__ */ n(Le, { kind: "error", title: d.error, placement: "page", action: { label: d.retry, onAction: () => {
702
- k.current = !1, C((w) => w + 1);
700
+ f.status === "loading" ? /* @__PURE__ */ n(Le, { kind: "loading", title: c.loading, placement: "page" }) : null,
701
+ f.status === "error" ? /* @__PURE__ */ n(Le, { kind: "error", title: c.error, placement: "page", action: { label: c.retry, onAction: () => {
702
+ M.current = !1, S((y) => y + 1);
703
703
  } } }) : null,
704
- r.status === "denied" ? /* @__PURE__ */ n(Le, { kind: "denied", title: d.denied, placement: "page" }) : null,
705
- r.status === "ready" && fe.length === 0 ? /* @__PURE__ */ n(Le, { kind: "empty", title: d.empty, placement: "page" }) : null,
706
- /* @__PURE__ */ f(
704
+ f.status === "denied" ? /* @__PURE__ */ n(Le, { kind: "denied", title: c.denied, placement: "page" }) : null,
705
+ f.status === "ready" && fe.length === 0 ? /* @__PURE__ */ n(Le, { kind: "empty", title: c.empty, placement: "page" }) : null,
706
+ /* @__PURE__ */ h(
707
707
  "div",
708
708
  {
709
- ref: P,
709
+ ref: F,
710
710
  role: "listbox",
711
711
  "aria-multiselectable": "true",
712
- "aria-label": d.files,
713
- "aria-activedescendant": fe.length > 0 ? we(_) : void 0,
712
+ "aria-label": c.files,
713
+ "aria-activedescendant": fe.length > 0 ? we(v) : void 0,
714
714
  tabIndex: 0,
715
715
  className: "cms-file-picker__entries",
716
- hidden: r.status !== "ready" || fe.length === 0,
716
+ hidden: f.status !== "ready" || fe.length === 0,
717
717
  onKeyDown: te,
718
718
  children: [
719
- fe.map((w, E) => {
720
- const W = w.kind === "file" && S.has(Je(c, w.id)), q = ie(w);
721
- return /* @__PURE__ */ f(
719
+ fe.map((y, E) => {
720
+ const W = y.kind === "file" && _.has(Je(i, y.id)), q = ie(y);
721
+ return /* @__PURE__ */ h(
722
722
  "div",
723
723
  {
724
724
  id: we(E),
725
725
  role: "option",
726
- "aria-selected": w.kind === "file" ? W : void 0,
726
+ "aria-selected": y.kind === "file" ? W : void 0,
727
727
  "aria-disabled": q !== null || void 0,
728
- className: F("cms-file-picker__entry", E === _ && "is-active", W && "is-ticked", q !== null && "is-disabled"),
728
+ className: H("cms-file-picker__entry", E === v && "is-active", W && "is-ticked", q !== null && "is-disabled"),
729
729
  onClick: () => {
730
- y(E), w.kind === "folder" ? ce(w) : be(w);
730
+ w(E), y.kind === "folder" ? oe(y) : be(y);
731
731
  },
732
732
  children: [
733
733
  /* @__PURE__ */ n("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: W ? /* @__PURE__ */ n($, { name: "check" }) : null }),
734
- /* @__PURE__ */ n($, { name: w.kind === "folder" ? "folder" : "file" }),
735
- /* @__PURE__ */ f("span", { className: "cms-file-picker__text", children: [
736
- /* @__PURE__ */ n("span", { className: "cms-file-picker__name", children: w.name }),
734
+ /* @__PURE__ */ n($, { name: y.kind === "folder" ? "folder" : "file" }),
735
+ /* @__PURE__ */ h("span", { className: "cms-file-picker__text", children: [
736
+ /* @__PURE__ */ n("span", { className: "cms-file-picker__name", children: y.name }),
737
737
  q !== null ? /* @__PURE__ */ n("span", { className: "cms-file-picker__reason", children: q }) : null
738
738
  ] }),
739
- w.kind === "file" && w.size != null ? /* @__PURE__ */ n("span", { className: "cms-file-picker__size", children: h(w.size) }) : null
739
+ y.kind === "file" && y.size != null ? /* @__PURE__ */ n("span", { className: "cms-file-picker__size", children: m(y.size) }) : null
740
740
  ]
741
741
  },
742
- w.id
742
+ y.id
743
743
  );
744
744
  }),
745
- r.status === "ready" && r.paging ? /* @__PURE__ */ n("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ n(Le, { kind: "loading", title: d.loading, placement: "inline" }) }) : null
745
+ f.status === "ready" && f.paging ? /* @__PURE__ */ n("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ n(Le, { kind: "loading", title: c.loading, placement: "inline" }) }) : null
746
746
  ]
747
747
  }
748
748
  )
@@ -752,7 +752,7 @@ function tl(e) {
752
752
  );
753
753
  }
754
754
  const nn = 64;
755
- function ot(e, t) {
755
+ function ct(e, t) {
756
756
  for (let l = e instanceof Element ? e : null; l !== null; l = l.parentElement) {
757
757
  if (l instanceof HTMLElement && l.scrollTop > 0) return !1;
758
758
  if (l === t) return !0;
@@ -760,27 +760,27 @@ function ot(e, t) {
760
760
  return t.scrollTop <= 0;
761
761
  }
762
762
  function dt(e, t) {
763
- const [l, s] = D(0), a = O(t);
763
+ const [l, s] = I(0), a = z(t);
764
764
  return a.current = t, Q(() => {
765
- const i = e.current;
766
- if (i === null) return;
767
- let h = null, d = 0;
768
- const u = (v) => {
769
- h = ot(v.target, i) && v.touches.length === 1 ? v.touches[0].clientY : null, d = 0;
770
- }, b = (v) => {
771
- if (h === null || a.current === null) return;
772
- const m = v.touches[0].clientY - h;
773
- if (m <= 0) {
774
- h = null, s(0);
765
+ const r = e.current;
766
+ if (r === null) return;
767
+ let m = null, c = 0;
768
+ const d = (g) => {
769
+ m = ct(g.target, r) && g.touches.length === 1 ? g.touches[0].clientY : null, c = 0;
770
+ }, b = (g) => {
771
+ if (m === null || a.current === null) return;
772
+ const u = g.touches[0].clientY - m;
773
+ if (u <= 0) {
774
+ m = null, s(0);
775
775
  return;
776
776
  }
777
- v.cancelable && v.preventDefault(), d = Math.min(m * 0.6, nn * 1.5), s(d);
778
- }, c = () => {
779
- var v;
780
- h !== null && d >= nn && ((v = a.current) == null || v.call(a)), h = null, d = 0, s(0);
777
+ g.cancelable && g.preventDefault(), c = Math.min(u * 0.6, nn * 1.5), s(c);
778
+ }, i = () => {
779
+ var g;
780
+ m !== null && c >= nn && ((g = a.current) == null || g.call(a)), m = null, c = 0, s(0);
781
781
  };
782
- return i.addEventListener("touchstart", u, { passive: !0 }), i.addEventListener("touchmove", b, { passive: !1 }), i.addEventListener("touchend", c), i.addEventListener("touchcancel", c), () => {
783
- i.removeEventListener("touchstart", u), i.removeEventListener("touchmove", b), i.removeEventListener("touchend", c), i.removeEventListener("touchcancel", c);
782
+ return r.addEventListener("touchstart", d, { passive: !0 }), r.addEventListener("touchmove", b, { passive: !1 }), r.addEventListener("touchend", i), r.addEventListener("touchcancel", i), () => {
783
+ r.removeEventListener("touchstart", d), r.removeEventListener("touchmove", b), r.removeEventListener("touchend", i), r.removeEventListener("touchcancel", i);
784
784
  };
785
785
  }, [e]), l;
786
786
  }
@@ -788,175 +788,180 @@ const En = Rn(null);
788
788
  function ut() {
789
789
  return Fn(En);
790
790
  }
791
- function ll({ label: e, rows: t, error: l, onRetry: s, loadingText: a = "Loading", emptyTitle: i = "Nothing here yet", emptyHint: h, emptyIcon: d, selected: u, onOpen: b, onRowMenu: c }) {
792
- const v = O([]), m = ut();
791
+ function ll({ label: e, rows: t, error: l, onRetry: s, loadingText: a = "Loading", emptyTitle: r = "Nothing here yet", emptyHint: m, emptyIcon: c, selected: d, onOpen: b, onRowMenu: i }) {
792
+ const g = z([]), u = ut();
793
793
  if (l != null) return /* @__PURE__ */ n(Yn, { message: l, onRetry: s });
794
794
  if (t === null) return /* @__PURE__ */ n(Gn, { what: a, layout: "block" });
795
- if (t.length === 0) return /* @__PURE__ */ n(jn, { title: i, hint: h, ...d === void 0 ? {} : { icon: d } });
796
- const N = (r, g, T) => {
797
- var C;
798
- if (r.key === "ArrowDown" || r.key === "ArrowUp")
799
- r.preventDefault(), (C = v.current[Math.min(t.length - 1, Math.max(0, g + (r.key === "ArrowDown" ? 1 : -1)))]) == null || C.focus();
800
- else if (r.key === "Enter")
801
- b == null || b(T);
802
- else if ((r.key === "ContextMenu" || r.shiftKey && r.key === "F10") && c) {
803
- r.preventDefault();
804
- const S = r.currentTarget.getBoundingClientRect();
805
- c(T, { x: S.left + 16, y: S.bottom });
795
+ if (t.length === 0) return /* @__PURE__ */ n(jn, { title: r, hint: m, ...c === void 0 ? {} : { icon: c } });
796
+ const k = (f, x, L) => {
797
+ var S;
798
+ if (f.key === "ArrowDown" || f.key === "ArrowUp")
799
+ f.preventDefault(), (S = g.current[Math.min(t.length - 1, Math.max(0, x + (f.key === "ArrowDown" ? 1 : -1)))]) == null || S.focus();
800
+ else if (f.key === "Enter")
801
+ b == null || b(L);
802
+ else if ((f.key === "ContextMenu" || f.shiftKey && f.key === "F10") && i) {
803
+ f.preventDefault();
804
+ const _ = f.currentTarget.getBoundingClientRect();
805
+ i(L, { x: _.left + 16, y: _.bottom });
806
806
  }
807
807
  };
808
- return /* @__PURE__ */ f(ge, { children: [
809
- m !== null && (m.distance > 0 || m.refreshing) ? /* @__PURE__ */ f("div", { className: "cms-list__pull", role: "status", style: { height: m.refreshing ? void 0 : m.distance }, "data-ready": m.distance >= nn ? "" : void 0, children: [
810
- m.refreshing ? /* @__PURE__ */ n(se, { name: "spinner" }) : null,
811
- m.text != null ? /* @__PURE__ */ n("span", { className: "cms-list__pull-text", children: m.text }) : null
808
+ return /* @__PURE__ */ h(ge, { children: [
809
+ u !== null && (u.distance > 0 || u.refreshing) ? /* @__PURE__ */ h("div", { className: "cms-list__pull", role: "status", style: { height: u.refreshing ? void 0 : u.distance }, "data-ready": u.distance >= nn ? "" : void 0, children: [
810
+ u.refreshing ? /* @__PURE__ */ n(se, { name: "spinner" }) : null,
811
+ u.text != null ? /* @__PURE__ */ n("span", { className: "cms-list__pull-text", children: u.text }) : null
812
812
  ] }) : null,
813
- /* @__PURE__ */ n("ul", { className: "cms-list", role: "listbox", "aria-label": e, children: t.map((r, g) => {
814
- const T = r.id === u;
815
- return /* @__PURE__ */ f(
813
+ /* @__PURE__ */ n("ul", { className: "cms-list", role: "listbox", "aria-label": e, children: t.map((f, x) => {
814
+ const L = f.id === d;
815
+ return /* @__PURE__ */ h(
816
816
  "li",
817
817
  {
818
- ref: (C) => {
819
- v.current[g] = C;
818
+ ref: (S) => {
819
+ g.current[x] = S;
820
820
  },
821
821
  role: "option",
822
- "aria-selected": T,
823
- tabIndex: T || u == null && g === 0 ? 0 : -1,
824
- className: F("cms-list__row", T && "is-selected"),
825
- onClick: () => b == null ? void 0 : b(r.id),
826
- onKeyDown: (C) => N(C, g, r.id),
827
- onContextMenu: c ? (C) => {
828
- C.preventDefault(), c(r.id, { x: C.clientX, y: C.clientY });
822
+ "aria-selected": L,
823
+ tabIndex: L || d == null && x === 0 ? 0 : -1,
824
+ className: H("cms-list__row", L && "is-selected"),
825
+ onClick: () => b == null ? void 0 : b(f.id),
826
+ onKeyDown: (S) => k(S, x, f.id),
827
+ onContextMenu: i ? (S) => {
828
+ S.preventDefault(), i(f.id, { x: S.clientX, y: S.clientY });
829
829
  } : void 0,
830
830
  children: [
831
- r.lead != null ? /* @__PURE__ */ n("span", { className: "cms-list__lead", children: r.lead }) : null,
832
- /* @__PURE__ */ f("span", { className: "cms-list__text", children: [
833
- /* @__PURE__ */ n("span", { className: F("cms-list__primary", r.unread === !0 && "is-unread"), children: r.primary }),
834
- r.secondary != null ? /* @__PURE__ */ n("span", { className: "cms-list__secondary", children: r.secondary }) : null
831
+ f.lead != null ? /* @__PURE__ */ n("span", { className: "cms-list__lead", children: f.lead }) : null,
832
+ /* @__PURE__ */ h("span", { className: "cms-list__text", children: [
833
+ /* @__PURE__ */ n("span", { className: H("cms-list__primary", f.unread === !0 && "is-unread"), children: f.primary }),
834
+ f.secondary != null ? /* @__PURE__ */ n("span", { className: "cms-list__secondary", children: f.secondary }) : null
835
835
  ] }),
836
- r.meta != null || r.count !== void 0 ? /* @__PURE__ */ f("span", { className: "cms-list__end", children: [
837
- r.meta != null ? /* @__PURE__ */ n("span", { className: "cms-list__meta", children: r.meta }) : null,
838
- r.count !== void 0 && r.count > 0 ? /* @__PURE__ */ n("span", { className: "cms-badge cms-list__count", children: r.count }) : null
836
+ f.meta != null || f.count !== void 0 ? /* @__PURE__ */ h("span", { className: "cms-list__end", children: [
837
+ f.meta != null ? /* @__PURE__ */ n("span", { className: "cms-list__meta", children: f.meta }) : null,
838
+ f.count !== void 0 && f.count > 0 ? /* @__PURE__ */ n("span", { className: "cms-badge cms-list__count", children: f.count }) : null
839
839
  ] }) : null
840
840
  ]
841
841
  },
842
- r.id
842
+ f.id
843
843
  );
844
844
  }) })
845
845
  ] });
846
846
  }
847
- function Ke({ at: e, items: t, onClose: l, label: s = "Actions", focus: a = "current" }) {
848
- const i = O(null), h = O(null), d = he(), [u, b] = D(e), c = t.filter((r) => r.offer.offered);
847
+ function Ke({ at: e, items: t, onClose: l, label: s = "Actions", focus: a = "current", corner: r = "top-left" }) {
848
+ const m = z(null), c = z(null), d = he(), [b, i] = I(e), g = t.filter((_) => _.offer.offered);
849
849
  if ($e(() => {
850
850
  if (!e) return;
851
- const r = i.current, g = (r == null ? void 0 : r.offsetWidth) ?? 0, T = (r == null ? void 0 : r.offsetHeight) ?? 0;
852
- b({ x: Math.max(0, Math.min(e.x, window.innerWidth - g)), y: Math.max(0, Math.min(e.y, window.innerHeight - T)) });
853
- }, [e]), Q(() => {
854
- var C, S;
851
+ const _ = m.current, N = (_ == null ? void 0 : _.offsetWidth) ?? 0, v = (_ == null ? void 0 : _.offsetHeight) ?? 0, w = r === "bottom-right" ? e.x - N : e.x, T = r === "bottom-right" ? e.y - v : e.y;
852
+ i({ x: Math.max(0, Math.min(w, window.innerWidth - N)), y: Math.max(0, Math.min(T, window.innerHeight - v)) });
853
+ }, [e, r]), Q(() => {
854
+ var w, T;
855
855
  if (!e) return;
856
- h.current = document.activeElement;
857
- const r = Array.from(((C = i.current) == null ? void 0 : C.querySelectorAll('[role^="menuitem"]:not([aria-disabled="true"])')) ?? []), g = a === "current" ? r.find((x) => x.getAttribute("aria-checked") === "true") : void 0;
858
- (S = a === "last" ? r[r.length - 1] : g ?? r[0]) == null || S.focus();
859
- const T = (x) => {
860
- var _;
861
- (_ = i.current) != null && _.contains(x.target) || l();
856
+ c.current = document.activeElement;
857
+ const _ = Array.from(((w = m.current) == null ? void 0 : w.querySelectorAll('[role^="menuitem"]:not([aria-disabled="true"])')) ?? []), N = a === "current" ? _.find((B) => B.getAttribute("aria-checked") === "true") : void 0;
858
+ (T = a === "last" ? _[_.length - 1] : N ?? _[0]) == null || T.focus();
859
+ const v = (B) => {
860
+ var F;
861
+ (F = m.current) != null && F.contains(B.target) || l();
862
862
  };
863
- return document.addEventListener("mousedown", T), () => {
864
- var x, _;
865
- document.removeEventListener("mousedown", T), (_ = (x = h.current) == null ? void 0 : x.focus) == null || _.call(x);
863
+ return document.addEventListener("mousedown", v), () => {
864
+ var B, F;
865
+ document.removeEventListener("mousedown", v), (F = (B = c.current) == null ? void 0 : B.focus) == null || F.call(B);
866
866
  };
867
- }, [e, l, a]), !e || c.length === 0) return null;
868
- const v = (r) => {
869
- var C, S;
870
- const g = Array.from(((C = i.current) == null ? void 0 : C.querySelectorAll('[role^="menuitem"]')) ?? []), T = g.indexOf(document.activeElement);
871
- if (r.key === "Escape" || r.key === "Tab")
872
- r.preventDefault(), l();
873
- else if (r.key === "ArrowDown" || r.key === "ArrowUp") {
874
- r.preventDefault();
875
- const x = r.key === "ArrowDown" ? 1 : -1;
876
- (S = g[(T + x + g.length) % g.length]) == null || S.focus();
867
+ }, [e, l, a]), !e || g.length === 0) return null;
868
+ const u = (_) => {
869
+ var w, T;
870
+ const N = Array.from(((w = m.current) == null ? void 0 : w.querySelectorAll('[role^="menuitem"]')) ?? []), v = N.indexOf(document.activeElement);
871
+ if (_.key === "Escape" || _.key === "Tab")
872
+ _.preventDefault(), l();
873
+ else if (_.key === "ArrowDown" || _.key === "ArrowUp") {
874
+ _.preventDefault();
875
+ const B = _.key === "ArrowDown" ? 1 : -1;
876
+ (T = N[(v + B + N.length) % N.length]) == null || T.focus();
877
877
  }
878
- }, m = (r) => {
879
- const g = r.offer.refusal !== void 0;
880
- return /* @__PURE__ */ f(
878
+ }, k = g.flatMap((_) => _.offer.refusal === void 0 ? [] : [_.offer.refusal]), f = k.length > 1 && k.every((_) => _ === k[0]) ? k[0] : void 0, x = `${d}-shared`, L = (_) => {
879
+ const N = _.offer.refusal !== void 0, v = N ? f !== void 0 ? x : `${d}-${_.id}` : void 0;
880
+ return /* @__PURE__ */ h(
881
881
  "div",
882
882
  {
883
- role: r.checked === void 0 ? "menuitem" : "menuitemradio",
884
- "aria-checked": r.checked,
883
+ role: _.checked === void 0 ? "menuitem" : "menuitemradio",
884
+ "aria-checked": _.checked,
885
885
  tabIndex: -1,
886
- "aria-disabled": g || void 0,
887
- "aria-describedby": g ? `${d}-${r.id}` : void 0,
888
- title: g ? r.offer.refusal : void 0,
889
- className: F("cms-menu__item", r.danger && "is-danger", r.offer.locked && "is-locked", g && "is-refused"),
886
+ "aria-disabled": N || void 0,
887
+ "aria-describedby": v,
888
+ title: N ? _.offer.refusal : void 0,
889
+ className: H("cms-menu__item", _.danger && "is-danger", _.offer.locked && "is-locked", N && "is-refused"),
890
890
  onClick: () => {
891
- g || (l(), r.onSelect());
891
+ N || (l(), _.onSelect());
892
892
  },
893
- onKeyDown: (T) => {
894
- (T.key === "Enter" || T.key === " ") && !g && (T.preventDefault(), l(), r.onSelect());
893
+ onKeyDown: (w) => {
894
+ (w.key === "Enter" || w.key === " ") && !N && (w.preventDefault(), l(), _.onSelect());
895
895
  },
896
896
  children: [
897
- r.checked !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-menu__check", children: r.checked ? /* @__PURE__ */ n(se, { name: "check" }) : null }) : null,
898
- r.offer.locked ? /* @__PURE__ */ n(se, { name: "lock" }) : null,
899
- /* @__PURE__ */ n("span", { className: "cms-menu__label", children: r.label }),
900
- g ? /* @__PURE__ */ n("span", { id: `${d}-${r.id}`, className: "cms-menu__refusal", children: r.offer.refusal }) : null
897
+ _.checked !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-menu__check", children: _.checked ? /* @__PURE__ */ n(se, { name: "check" }) : null }) : null,
898
+ _.offer.locked ? /* @__PURE__ */ n(se, { name: "lock" }) : null,
899
+ /* @__PURE__ */ h("span", { className: "cms-menu__text", children: [
900
+ /* @__PURE__ */ n("span", { className: "cms-menu__label", children: _.label }),
901
+ N && f === void 0 ? /* @__PURE__ */ n("span", { id: `${d}-${_.id}`, className: "cms-menu__refusal", children: _.offer.refusal }) : null
902
+ ] })
901
903
  ]
902
904
  },
903
- r.id
905
+ _.id
904
906
  );
905
- }, N = [];
906
- for (const r of c) {
907
- const g = N[N.length - 1];
908
- g !== void 0 && g.group === r.group ? g.items.push(r) : N.push({ group: r.group, items: [r] });
907
+ }, S = [];
908
+ for (const _ of g) {
909
+ const N = S[S.length - 1];
910
+ N !== void 0 && N.group === _.group ? N.items.push(_) : S.push({ group: _.group, items: [_] });
909
911
  }
910
912
  return an(
911
- /* @__PURE__ */ n(
913
+ /* @__PURE__ */ h(
912
914
  "div",
913
915
  {
914
- ref: i,
916
+ ref: m,
915
917
  className: "cms-menu",
916
918
  role: "menu",
917
919
  "aria-label": s,
918
- style: { left: (u ?? e).x, top: (u ?? e).y },
919
- onKeyDown: v,
920
- onContextMenu: (r) => r.preventDefault(),
921
- children: N.map((r, g) => /* @__PURE__ */ f(Hn, { children: [
922
- g > 0 ? /* @__PURE__ */ n("div", { className: "cms-menu__separator", role: "separator" }) : null,
923
- r.group === void 0 ? r.items.map(m) : /* @__PURE__ */ f("div", { role: "group", "aria-label": r.group, children: [
924
- /* @__PURE__ */ n("div", { className: "cms-menu__group", "aria-hidden": "true", children: r.group }),
925
- r.items.map(m)
926
- ] })
927
- ] }, g))
920
+ style: { left: (b ?? e).x, top: (b ?? e).y },
921
+ onKeyDown: u,
922
+ onContextMenu: (_) => _.preventDefault(),
923
+ children: [
924
+ f === void 0 ? null : /* @__PURE__ */ n("div", { id: x, className: "cms-menu__reason", children: f }),
925
+ S.map((_, N) => /* @__PURE__ */ h(Hn, { children: [
926
+ N > 0 ? /* @__PURE__ */ n("div", { className: "cms-menu__separator", role: "separator" }) : null,
927
+ _.group === void 0 ? _.items.map(L) : /* @__PURE__ */ h("div", { role: "group", "aria-label": _.group, children: [
928
+ /* @__PURE__ */ n("div", { className: "cms-menu__group", "aria-hidden": "true", children: _.group }),
929
+ _.items.map(L)
930
+ ] })
931
+ ] }, N))
932
+ ]
928
933
  }
929
934
  ),
930
935
  document.body
931
936
  );
932
937
  }
933
938
  function dn() {
934
- const [e, t] = D(/* @__PURE__ */ new Set()), [l, s] = D(null), a = O(null), i = O(null), h = (u) => t((b) => b.has(u) ? b : /* @__PURE__ */ new Set([...b, u])), d = (u) => t((b) => {
935
- if (!b.has(u)) return b;
936
- const c = new Set(b);
937
- return c.delete(u), c;
939
+ const [e, t] = I(/* @__PURE__ */ new Set()), [l, s] = I(null), a = z(null), r = z(null), m = (d) => t((b) => b.has(d) ? b : /* @__PURE__ */ new Set([...b, d])), c = (d) => t((b) => {
940
+ if (!b.has(d)) return b;
941
+ const i = new Set(b);
942
+ return i.delete(d), i;
938
943
  });
939
944
  return Q(() => {
940
945
  if (l === null) return;
941
- const u = (b) => {
942
- b.key === "Escape" && h(l);
946
+ const d = (b) => {
947
+ b.key === "Escape" && m(l);
943
948
  };
944
- return window.addEventListener("keydown", u), () => window.removeEventListener("keydown", u);
949
+ return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
945
950
  }, [l]), {
946
- dismissed: (u) => e.has(u),
947
- dismiss: h,
948
- show: d,
949
- pointerIn: (u) => {
950
- i.current = u, s(u);
951
+ dismissed: (d) => e.has(d),
952
+ dismiss: m,
953
+ show: c,
954
+ pointerIn: (d) => {
955
+ r.current = d, s(d);
951
956
  },
952
- pointerOut: (u) => {
953
- i.current === u && (i.current = null), s((b) => b === u ? null : b), a.current !== u && d(u);
957
+ pointerOut: (d) => {
958
+ r.current === d && (r.current = null), s((b) => b === d ? null : b), a.current !== d && c(d);
954
959
  },
955
- focusIn: (u) => {
956
- a.current = u;
960
+ focusIn: (d) => {
961
+ a.current = d;
957
962
  },
958
- focusOut: (u) => {
959
- a.current === u && (a.current = null), i.current !== u && d(u);
963
+ focusOut: (d) => {
964
+ a.current === d && (a.current = null), r.current !== d && c(d);
960
965
  }
961
966
  };
962
967
  }
@@ -964,10 +969,10 @@ function mt(e, t, l) {
964
969
  return Math.min(Math.max(e - l / 2, 0), Math.max(0, t - l));
965
970
  }
966
971
  const wn = /* @__PURE__ */ new Set(), yn = { descriptionHidden: !1, elsewhereHidden: !1, titleCut: !1, titleFloor: 0, bare: wn, primaryBare: !1, hidden: wn, primaryHidden: !1, chipsCut: !1 }, Nn = (e, t) => e.size === t.size && [...e].every((l) => t.has(l)), ht = (e, t) => e.descriptionHidden === t.descriptionHidden && e.elsewhereHidden === t.elsewhereHidden && e.titleCut === t.titleCut && e.titleFloor === t.titleFloor && Nn(e.bare, t.bare) && e.primaryBare === t.primaryBare && Nn(e.hidden, t.hidden) && e.primaryHidden === t.primaryHidden && e.chipsCut === t.chipsCut, ft = 64, Ae = "primary";
967
- function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secondary: i, more: h = [], moreLabel: d, context: u, fullWidth: b = !1 }) {
968
- var X, Ne, oe;
969
- const [c, v] = D(null), [m, N] = D(yn), [r, g] = D(null), [T, C] = D(null), S = dn(), x = O(null), _ = O(null), y = O(null), I = he(), U = he(), P = [
970
- ...(i ?? []).map((o) => ({
972
+ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secondary: r, more: m = [], moreLabel: c, context: d, fullWidth: b = !1 }) {
973
+ var X, Ne, ce;
974
+ const [i, g] = I(null), [u, k] = I(yn), [f, x] = I(null), [L, S] = I(null), _ = dn(), N = z(null), v = z(null), w = z(null), T = he(), B = he(), F = [
975
+ ...(r ?? []).map((o) => ({
971
976
  id: o.id,
972
977
  label: o.label,
973
978
  name: o.label,
@@ -977,7 +982,7 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
977
982
  offer: o.offer ?? { offered: !0, locked: !1 },
978
983
  run: o.onPress
979
984
  })),
980
- ...h.map((o) => ({
985
+ ...m.map((o) => ({
981
986
  id: o.id,
982
987
  label: o.label,
983
988
  name: typeof o.label == "string" ? o.label : o.id,
@@ -987,29 +992,29 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
987
992
  offer: o.offer,
988
993
  run: o.onSelect
989
994
  }))
990
- ].filter((o) => o.offer.offered), k = P.filter((o) => o.overflow === 0), B = P.filter((o) => o.overflow !== 0), z = k.length === 1 ? k[0] ?? null : null, j = pt(B), K = B.filter((o) => o.overflow === void 0).map((o) => o.id).reverse(), G = [...j, ...K.map((o) => [o])], Y = [...z !== null ? [[z.id]] : [], ...G], ee = a !== void 0 && ((X = a.offer) == null ? void 0 : X.offered) !== !1, ie = (Ne = a == null ? void 0 : a.offer) == null ? void 0 : Ne.refusal, be = a !== void 0 && (((oe = a.offer) == null ? void 0 : oe.offered) === !1 || ie !== void 0), ce = a !== void 0 && "menu" in a ? a.menu.filter((o) => o.offer.offered) : [], de = a !== void 0 && "menu" in a && ce.length > 0 ? a : null, Ce = s.filter((o) => o.elsewhere === !0), fe = JSON.stringify([
995
+ ].filter((o) => o.offer.offered), M = F.filter((o) => o.overflow === 0), R = F.filter((o) => o.overflow !== 0), U = M.length === 1 ? M[0] ?? null : null, j = pt(R), K = R.filter((o) => o.overflow === void 0).map((o) => o.id).reverse(), G = [...j, ...K.map((o) => [o])], Y = [...U !== null ? [[U.id]] : [], ...G], ee = a !== void 0 && ((X = a.offer) == null ? void 0 : X.offered) !== !1, ie = (Ne = a == null ? void 0 : a.offer) == null ? void 0 : Ne.refusal, be = a !== void 0 && (((ce = a.offer) == null ? void 0 : ce.offered) === !1 || ie !== void 0), oe = a !== void 0 && "menu" in a ? a.menu.filter((o) => o.offer.offered) : [], de = a !== void 0 && "menu" in a && oe.length > 0 ? a : null, Ce = s.filter((o) => o.elsewhere === !0), fe = JSON.stringify([
991
996
  e,
992
997
  t ?? null,
993
998
  l ?? null,
994
999
  s.map((o) => [o.id, o.text, o.elsewhere === !0]),
995
1000
  ee ? [a.label, a.icon, de !== null] : null,
996
- P.map((o) => [o.id, o.name, o.icon, o.overflow ?? null])
1001
+ F.map((o) => [o.id, o.name, o.icon, o.overflow ?? null])
997
1002
  ]), te = Ie(() => {
998
- const o = x.current, A = _.current;
1003
+ const o = N.current, A = v.current;
999
1004
  if (o === null || A === null) return;
1000
- const M = getComputedStyle(o), H = parseFloat(M.columnGap || "0") || 0, le = o.clientWidth - (parseFloat(M.paddingLeft) || 0) - (parseFloat(M.paddingRight) || 0), J = (re) => {
1005
+ const C = getComputedStyle(o), P = parseFloat(C.columnGap || "0") || 0, le = o.clientWidth - (parseFloat(C.paddingLeft) || 0) - (parseFloat(C.paddingRight) || 0), J = (re) => {
1001
1006
  var Me;
1002
1007
  return ((Me = A.querySelector(re)) == null ? void 0 : Me.getBoundingClientRect().width) ?? 0;
1003
1008
  }, ke = J('[data-measure="title"]'), Re = Math.min(ke, ft), He = (re) => {
1004
1009
  const Me = pe(re), xe = [];
1005
1010
  t !== void 0 && xe.push(J('[data-measure="lead"]')), xe.push(re.titleCut ? Re : ke), l !== void 0 && !re.descriptionHidden && xe.push(J('[data-measure="description"]'));
1006
1011
  for (const ve of s) ve.elsewhere === !0 && re.elsewhereHidden || xe.push(J(`[data-measure="meta"][data-measure-id="${CSS.escape(ve.id)}"]`));
1007
- for (const ve of P) {
1012
+ for (const ve of F) {
1008
1013
  if (Me.has(ve.id)) continue;
1009
1014
  const Ze = re.bare.has(ve.id) && ve.icon !== null;
1010
1015
  xe.push(J(`[data-measure="${Ze ? "icon" : "full"}"][data-measure-id="${CSS.escape(ve.id)}"]`));
1011
1016
  }
1012
- return ee && !re.primaryHidden && xe.push(J(`[data-measure="${re.primaryBare ? "primary-icon" : "primary"}"]`)), Me.size > 0 && xe.push(J('[data-measure="more"]')), xe.reduce((ve, Ze) => ve + Ze, 0) + H * Math.max(0, xe.length - 1);
1017
+ return ee && !re.primaryHidden && xe.push(J(`[data-measure="${re.primaryBare ? "primary-icon" : "primary"}"]`)), Me.size > 0 && xe.push(J('[data-measure="more"]')), xe.reduce((ve, Ze) => ve + Ze, 0) + P * Math.max(0, xe.length - 1);
1013
1018
  };
1014
1019
  let V = { ...yn, titleFloor: Re };
1015
1020
  const Oe = (re) => (V = re, He(re) <= le), pn = (() => {
@@ -1022,7 +1027,7 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
1022
1027
  }
1023
1028
  if (ee && Oe({ ...V, primaryBare: !0 })) return V;
1024
1029
  V = { ...V, primaryBare: ee };
1025
- const Me = /* @__PURE__ */ new Set(), xe = [...G, ...ee ? [[Ae]] : []], ve = () => Me.size + k.length >= 2, Ze = (Ve) => ({ ...V, hidden: new Set([...Ve].filter((Ge) => Ge !== Ae)), primaryHidden: Ve.has(Ae) }), bn = V;
1030
+ const Me = /* @__PURE__ */ new Set(), xe = [...G, ...ee ? [[Ae]] : []], ve = () => Me.size + M.length >= 2, Ze = (Ve) => ({ ...V, hidden: new Set([...Ve].filter((Ge) => Ge !== Ae)), primaryHidden: Ve.has(Ae) }), bn = V;
1026
1031
  for (const Ve of xe) {
1027
1032
  for (const Ge of Ve) Me.add(Ge);
1028
1033
  if (ve() && Oe(Ze(Me))) return V;
@@ -1031,10 +1036,10 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
1031
1036
  const _n = ve() ? Ze(Me) : bn;
1032
1037
  return Oe({ ..._n, titleCut: !0 }) ? V : { ..._n, titleCut: !0, chipsCut: !0 };
1033
1038
  })();
1034
- N((re) => ht(re, pn) ? re : pn);
1039
+ k((re) => ht(re, pn) ? re : pn);
1035
1040
  }, [fe]);
1036
1041
  $e(te, [te]), Q(() => {
1037
- const o = x.current;
1042
+ const o = N.current;
1038
1043
  if (o === null || typeof ResizeObserver > "u") return;
1039
1044
  const A = new ResizeObserver(() => te());
1040
1045
  return A.observe(o), () => A.disconnect();
@@ -1042,150 +1047,150 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
1042
1047
  const o = typeof document > "u" ? void 0 : document.fonts;
1043
1048
  if (o === void 0) return;
1044
1049
  let A = !0;
1045
- const M = () => {
1050
+ const C = () => {
1046
1051
  A && te();
1047
1052
  };
1048
- return o.ready.then(M), o.addEventListener("loadingdone", M), () => {
1049
- A = !1, o.removeEventListener("loadingdone", M);
1053
+ return o.ready.then(C), o.addEventListener("loadingdone", C), () => {
1054
+ A = !1, o.removeEventListener("loadingdone", C);
1050
1055
  };
1051
1056
  }, [te]);
1052
1057
  function pe(o) {
1053
1058
  const A = o.hidden.size + (o.primaryHidden ? 1 : 0);
1054
- return /* @__PURE__ */ new Set([...k.filter((M) => M !== z || A > 0).map((M) => M.id), ...o.hidden, ...o.primaryHidden ? [Ae] : []]);
1059
+ return /* @__PURE__ */ new Set([...M.filter((C) => C !== U || A > 0).map((C) => C.id), ...o.hidden, ...o.primaryHidden ? [Ae] : []]);
1055
1060
  }
1056
- const _e = pe(m), we = P.filter((o) => !_e.has(o.id) && o !== z), ne = z !== null && !_e.has(z.id) ? z : null, ye = ee && !m.primaryHidden, w = (o) => P.find((A) => A.id === o), E = G.flat().filter((o) => m.hidden.has(o)).map(w).filter((o) => o !== void 0), W = (o) => ({ id: o.id, label: o.label, offer: o.offer, ...o.danger ? { danger: !0 } : {}, onSelect: o.run }), q = [
1057
- ...ee && m.primaryHidden ? [{ id: Ae, label: a.label, offer: a.offer ?? { offered: !0, locked: !1 }, onSelect: () => {
1061
+ const _e = pe(u), we = F.filter((o) => !_e.has(o.id) && o !== U), ne = U !== null && !_e.has(U.id) ? U : null, ye = ee && !u.primaryHidden, y = (o) => F.find((A) => A.id === o), E = G.flat().filter((o) => u.hidden.has(o)).map(y).filter((o) => o !== void 0), W = (o) => ({ id: o.id, label: o.label, offer: o.offer, ...o.danger ? { danger: !0 } : {}, onSelect: o.run }), q = [
1062
+ ...ee && u.primaryHidden ? [{ id: Ae, label: a.label, offer: a.offer ?? { offered: !0, locked: !1 }, onSelect: () => {
1058
1063
  be || a.onPress();
1059
- } }, ...ce] : [],
1064
+ } }, ...oe] : [],
1060
1065
  ...E.map(W),
1061
- ..._e.size > 0 ? k.map(W) : []
1062
- ], p = q.length > 0, L = [
1066
+ ..._e.size > 0 ? M.map(W) : []
1067
+ ], p = q.length > 0, D = [
1063
1068
  ...we.map((o) => o.id),
1064
1069
  ...ne !== null ? [ne.id] : [],
1065
1070
  ...ye ? [Ae, ...de !== null ? ["primary-menu"] : []] : [],
1066
1071
  ...p ? ["more"] : []
1067
- ], Z = r !== null && L.includes(r) ? r : L[0] ?? null;
1072
+ ], Z = f !== null && D.includes(f) ? f : D[0] ?? null;
1068
1073
  Q(() => {
1069
1074
  var o, A;
1070
- r === null || L.includes(r) || !p || ((o = x.current) != null && o.contains(document.activeElement) || document.activeElement === document.body) && (g("more"), (A = y.current) == null || A.focus());
1071
- }, [m]);
1072
- const ue = (o) => `${U}-${o}`, ae = (o) => {
1075
+ f === null || D.includes(f) || !p || ((o = N.current) != null && o.contains(document.activeElement) || document.activeElement === document.body) && (x("more"), (A = w.current) == null || A.focus());
1076
+ }, [u]);
1077
+ const ue = (o) => `${B}-${o}`, ae = (o) => {
1073
1078
  var le;
1074
- const A = L.indexOf(Z ?? "");
1075
- let M = null;
1076
- if (o.key === "ArrowRight" ? M = Math.min(L.length - 1, A + 1) : o.key === "ArrowLeft" ? M = Math.max(0, A - 1) : o.key === "Home" ? M = 0 : o.key === "End" && (M = L.length - 1), M === null) return;
1079
+ const A = D.indexOf(Z ?? "");
1080
+ let C = null;
1081
+ if (o.key === "ArrowRight" ? C = Math.min(D.length - 1, A + 1) : o.key === "ArrowLeft" ? C = Math.max(0, A - 1) : o.key === "Home" ? C = 0 : o.key === "End" && (C = D.length - 1), C === null) return;
1077
1082
  o.preventDefault();
1078
- const H = L[M] ?? null;
1079
- g(H), H !== null && ((le = document.getElementById(ue(H))) == null || le.focus());
1083
+ const P = D[C] ?? null;
1084
+ x(P), P !== null && ((le = document.getElementById(ue(P))) == null || le.focus());
1080
1085
  }, me = (o, A) => {
1081
- const M = A.getBoundingClientRect();
1082
- v((c == null ? void 0 : c.which) === o ? null : { which: o, x: M.left, y: M.bottom + 4 });
1083
- }, Se = (o) => ({ id: ue(o), tabIndex: Z === o ? 0 : -1, onFocus: () => g(o) }), We = (o, A, M) => A ? {
1084
- ...T === o ? { "data-reason-shown": "" } : {},
1085
- ...S.dismissed(o) ? { "data-tip-dismissed": "" } : {},
1086
- onFocus: (H) => {
1087
- g(o), S.focusIn(o), Te(H.currentTarget, M);
1086
+ const C = A.getBoundingClientRect();
1087
+ g((i == null ? void 0 : i.which) === o ? null : { which: o, x: C.left, y: C.bottom + 4 });
1088
+ }, Se = (o) => ({ id: ue(o), tabIndex: Z === o ? 0 : -1, onFocus: () => x(o) }), We = (o, A, C) => A ? {
1089
+ ...L === o ? { "data-reason-shown": "" } : {},
1090
+ ..._.dismissed(o) ? { "data-tip-dismissed": "" } : {},
1091
+ onFocus: (P) => {
1092
+ x(o), _.focusIn(o), Te(P.currentTarget, C);
1088
1093
  },
1089
1094
  onBlur: () => {
1090
- C((H) => H === o ? null : H), S.focusOut(o);
1095
+ S((P) => P === o ? null : P), _.focusOut(o);
1091
1096
  },
1092
- onMouseEnter: (H) => {
1093
- S.pointerIn(o), Te(H.currentTarget, M);
1097
+ onMouseEnter: (P) => {
1098
+ _.pointerIn(o), Te(P.currentTarget, C);
1094
1099
  },
1095
- onMouseLeave: () => S.pointerOut(o),
1096
- onKeyDown: (H) => {
1097
- H.key === "Escape" && (C((le) => le === o ? null : le), S.dismiss(o));
1100
+ onMouseLeave: () => _.pointerOut(o),
1101
+ onKeyDown: (P) => {
1102
+ P.key === "Escape" && (S((le) => le === o ? null : le), _.dismiss(o));
1098
1103
  }
1099
- } : {}, Fe = (o, A, M) => {
1100
- C(o), S.show(o), Te(A, M);
1104
+ } : {}, Fe = (o, A, C) => {
1105
+ S(o), _.show(o), Te(A, C);
1101
1106
  }, Te = (o, A) => {
1102
- const M = document.getElementById(A), H = x.current;
1103
- if (M === null || H === null) return;
1104
- const le = M.style.display;
1105
- M.style.display = "block";
1106
- const J = M.offsetWidth;
1107
- M.style.display = le;
1108
- const ke = H.getBoundingClientRect(), Re = o.getBoundingClientRect();
1109
- M.style.left = `${String(mt(Re.left + Re.width / 2 - ke.left, ke.width, J))}px`, M.style.right = "auto";
1110
- }, Ee = (o, A, M) => /* @__PURE__ */ f("span", { id: o, className: "cms-section-header__tip", role: "tooltip", children: [
1111
- M !== null ? /* @__PURE__ */ f("span", { "aria-hidden": "true", children: [
1112
- M,
1107
+ const C = document.getElementById(A), P = N.current;
1108
+ if (C === null || P === null) return;
1109
+ const le = C.style.display;
1110
+ C.style.display = "block";
1111
+ const J = C.offsetWidth;
1112
+ C.style.display = le;
1113
+ const ke = P.getBoundingClientRect(), Re = o.getBoundingClientRect();
1114
+ C.style.left = `${String(mt(Re.left + Re.width / 2 - ke.left, ke.width, J))}px`, C.style.right = "auto";
1115
+ }, Ee = (o, A, C) => /* @__PURE__ */ h("span", { id: o, className: "cms-section-header__tip", role: "tooltip", children: [
1116
+ C !== null ? /* @__PURE__ */ h("span", { "aria-hidden": "true", children: [
1117
+ C,
1113
1118
  ": "
1114
1119
  ] }) : null,
1115
1120
  A
1116
- ] }), R = (o) => {
1117
- const A = m.bare.has(o.id) && o.icon !== null, M = o.offer.refusal, H = `${U}-reason-${o.id}`;
1118
- return /* @__PURE__ */ f(
1121
+ ] }), O = (o) => {
1122
+ const A = u.bare.has(o.id) && o.icon !== null, C = o.offer.refusal, P = `${B}-reason-${o.id}`;
1123
+ return /* @__PURE__ */ h(
1119
1124
  "button",
1120
1125
  {
1121
1126
  type: "button",
1122
- className: F("cms-button", "cms-button--quiet", "cms-section-header__secondary", A && "cms-section-header__secondary--bare", o.danger && "is-danger"),
1127
+ className: H("cms-button", "cms-button--quiet", "cms-section-header__secondary", A && "cms-section-header__secondary--bare", o.danger && "is-danger"),
1123
1128
  "data-action": o.id,
1124
- "aria-label": A || M !== void 0 ? o.name : void 0,
1125
- "aria-disabled": M !== void 0 ? "true" : void 0,
1126
- "aria-describedby": M !== void 0 ? H : void 0,
1127
- title: M === void 0 && A ? o.name : void 0,
1129
+ "aria-label": A || C !== void 0 ? o.name : void 0,
1130
+ "aria-disabled": C !== void 0 ? "true" : void 0,
1131
+ "aria-describedby": C !== void 0 ? P : void 0,
1132
+ title: C === void 0 && A ? o.name : void 0,
1128
1133
  ...Se(o.id),
1129
- ...We(o.id, M !== void 0, H),
1134
+ ...We(o.id, C !== void 0, P),
1130
1135
  onClick: (le) => {
1131
- M === void 0 ? o.run() : Fe(o.id, le.currentTarget, H);
1136
+ C === void 0 ? o.run() : Fe(o.id, le.currentTarget, P);
1132
1137
  },
1133
1138
  children: [
1134
1139
  o.icon !== null ? /* @__PURE__ */ n($, { name: o.icon, size: 18 }) : null,
1135
1140
  A ? null : /* @__PURE__ */ n("span", { className: "cms-section-header__label", children: o.label }),
1136
- M !== void 0 ? Ee(H, M, A ? o.name : null) : null
1141
+ C !== void 0 ? Ee(P, C, A ? o.name : null) : null
1137
1142
  ]
1138
1143
  },
1139
1144
  o.id
1140
1145
  );
1141
1146
  };
1142
- return /* @__PURE__ */ f("header", { className: F("cms-section-header", b && "cms-section-header--full"), children: [
1143
- /* @__PURE__ */ f("div", { ref: x, className: F("cms-section-header__row", m.chipsCut && "cms-section-header__row--chips-cut"), "data-row": "1", children: [
1147
+ return /* @__PURE__ */ h("header", { className: H("cms-section-header", b && "cms-section-header--full"), children: [
1148
+ /* @__PURE__ */ h("div", { ref: N, className: H("cms-section-header__row", u.chipsCut && "cms-section-header__row--chips-cut"), "data-row": "1", children: [
1144
1149
  t !== void 0 ? /* @__PURE__ */ n($, { name: t }) : null,
1145
1150
  /* @__PURE__ */ n(
1146
1151
  "h1",
1147
1152
  {
1148
1153
  className: "cms-section-header__title",
1149
1154
  title: e,
1150
- style: { minWidth: m.titleCut ? `${m.titleFloor}px` : "max-content" },
1155
+ style: { minWidth: u.titleCut ? `${u.titleFloor}px` : "max-content" },
1151
1156
  children: e
1152
1157
  }
1153
1158
  ),
1154
- l !== void 0 ? /* @__PURE__ */ n("span", { className: F("cms-section-header__description", m.descriptionHidden && "cms-visually-hidden"), children: l }) : null,
1159
+ l !== void 0 ? /* @__PURE__ */ n("span", { className: H("cms-section-header__description", u.descriptionHidden && "cms-visually-hidden"), children: l }) : null,
1155
1160
  s.map((o, A) => /* @__PURE__ */ n(
1156
1161
  "span",
1157
1162
  {
1158
1163
  className: "cms-section-header__meta",
1159
1164
  "data-meta": o.id,
1160
- hidden: o.elsewhere === !0 && m.elsewhereHidden,
1161
- style: m.chipsCut && o.elsewhere !== !0 ? { flexShrink: A + 1 } : void 0,
1162
- ...m.chipsCut && o.elsewhere !== !0 ? { title: o.text, "aria-label": o.text } : {},
1165
+ hidden: o.elsewhere === !0 && u.elsewhereHidden,
1166
+ style: u.chipsCut && o.elsewhere !== !0 ? { flexShrink: A + 1 } : void 0,
1167
+ ...u.chipsCut && o.elsewhere !== !0 ? { title: o.text, "aria-label": o.text } : {},
1163
1168
  children: o.content
1164
1169
  },
1165
1170
  o.id
1166
1171
  )),
1167
- /* @__PURE__ */ f("div", { className: "cms-section-header__actions", role: "toolbar", "aria-label": e, onKeyDown: ae, children: [
1168
- we.map(R),
1169
- ne !== null ? R(ne) : null,
1170
- ye ? /* @__PURE__ */ f("span", { className: F("cms-section-header__primary", de !== null && "cms-section-header__primary--split"), children: [
1171
- /* @__PURE__ */ f(
1172
+ /* @__PURE__ */ h("div", { className: "cms-section-header__actions", role: "toolbar", "aria-label": e, onKeyDown: ae, children: [
1173
+ we.map(O),
1174
+ ne !== null ? O(ne) : null,
1175
+ ye ? /* @__PURE__ */ h("span", { className: H("cms-section-header__primary", de !== null && "cms-section-header__primary--split"), children: [
1176
+ /* @__PURE__ */ h(
1172
1177
  "button",
1173
1178
  {
1174
1179
  type: "button",
1175
- className: F("cms-button", "cms-button--primary", m.primaryBare && "cms-section-header__primary--bare"),
1180
+ className: H("cms-button", "cms-button--primary", u.primaryBare && "cms-section-header__primary--bare"),
1176
1181
  "data-action": "primary",
1177
- "aria-label": m.primaryBare ? a.label : void 0,
1182
+ "aria-label": u.primaryBare ? a.label : void 0,
1178
1183
  "aria-disabled": be ? "true" : void 0,
1179
- "aria-describedby": ie !== void 0 ? I : void 0,
1180
- title: m.primaryBare && ie === void 0 ? a.label : void 0,
1184
+ "aria-describedby": ie !== void 0 ? T : void 0,
1185
+ title: u.primaryBare && ie === void 0 ? a.label : void 0,
1181
1186
  ...Se(Ae),
1182
- ...We(Ae, ie !== void 0, I),
1187
+ ...We(Ae, ie !== void 0, T),
1183
1188
  onClick: (o) => {
1184
- be ? ie !== void 0 && Fe(Ae, o.currentTarget, I) : a.onPress();
1189
+ be ? ie !== void 0 && Fe(Ae, o.currentTarget, T) : a.onPress();
1185
1190
  },
1186
1191
  children: [
1187
1192
  /* @__PURE__ */ n($, { name: a.icon }),
1188
- m.primaryBare ? null : /* @__PURE__ */ f(ge, { children: [
1193
+ u.primaryBare ? null : /* @__PURE__ */ h(ge, { children: [
1189
1194
  " ",
1190
1195
  /* @__PURE__ */ n("span", { children: a.label })
1191
1196
  ] })
@@ -1199,54 +1204,54 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
1199
1204
  className: "cms-button cms-button--primary cms-section-header__split",
1200
1205
  "data-action": "primary-menu",
1201
1206
  "aria-haspopup": "menu",
1202
- "aria-expanded": (c == null ? void 0 : c.which) === "primary",
1207
+ "aria-expanded": (i == null ? void 0 : i.which) === "primary",
1203
1208
  "aria-label": de.menuLabel,
1204
1209
  ...Se("primary-menu"),
1205
1210
  onClick: (o) => me("primary", o.currentTarget),
1206
1211
  children: /* @__PURE__ */ n($, { name: "chevron-down" })
1207
1212
  }
1208
1213
  ) : null,
1209
- ie !== void 0 ? Ee(I, ie, m.primaryBare ? a.label : null) : null
1214
+ ie !== void 0 ? Ee(T, ie, u.primaryBare ? a.label : null) : null
1210
1215
  ] }) : null,
1211
1216
  p ? /* @__PURE__ */ n(
1212
1217
  "button",
1213
1218
  {
1214
- ref: y,
1219
+ ref: w,
1215
1220
  type: "button",
1216
1221
  className: "cms-section-header__more",
1217
1222
  "data-action": "more",
1218
1223
  "aria-haspopup": "menu",
1219
- "aria-expanded": (c == null ? void 0 : c.which) === "more",
1220
- "aria-label": d,
1221
- title: d,
1224
+ "aria-expanded": (i == null ? void 0 : i.which) === "more",
1225
+ "aria-label": c,
1226
+ title: c,
1222
1227
  ...Se("more"),
1223
1228
  onClick: (o) => me("more", o.currentTarget),
1224
1229
  children: /* @__PURE__ */ n($, { name: "more" })
1225
1230
  }
1226
1231
  ) : null
1227
1232
  ] }),
1228
- /* @__PURE__ */ f("div", { ref: _, className: "cms-section-header__measure", "aria-hidden": "true", children: [
1233
+ /* @__PURE__ */ h("div", { ref: v, className: "cms-section-header__measure", "aria-hidden": "true", children: [
1229
1234
  t !== void 0 ? /* @__PURE__ */ n("span", { "data-measure": "lead", children: /* @__PURE__ */ n($, { name: t }) }) : null,
1230
1235
  /* @__PURE__ */ n("span", { "data-measure": "title", className: "cms-section-header__title", children: e }),
1231
1236
  l !== void 0 ? /* @__PURE__ */ n("span", { "data-measure": "description", className: "cms-section-header__description", children: l }) : null,
1232
1237
  s.map((o) => /* @__PURE__ */ n("span", { "data-measure": "meta", "data-measure-id": o.id, className: "cms-section-header__meta", children: o.content }, o.id)),
1233
- P.map((o) => /* @__PURE__ */ f("span", { children: [
1234
- /* @__PURE__ */ f("span", { "data-measure": "full", "data-measure-id": o.id, className: "cms-button cms-button--quiet cms-section-header__secondary", children: [
1238
+ F.map((o) => /* @__PURE__ */ h("span", { children: [
1239
+ /* @__PURE__ */ h("span", { "data-measure": "full", "data-measure-id": o.id, className: "cms-button cms-button--quiet cms-section-header__secondary", children: [
1235
1240
  o.icon !== null ? /* @__PURE__ */ n($, { name: o.icon, size: 18 }) : null,
1236
1241
  /* @__PURE__ */ n("span", { className: "cms-section-header__label", children: o.label })
1237
1242
  ] }),
1238
1243
  /* @__PURE__ */ n("span", { "data-measure": "icon", "data-measure-id": o.id, className: "cms-button cms-button--quiet cms-section-header__secondary cms-section-header__secondary--bare", children: o.icon !== null ? /* @__PURE__ */ n($, { name: o.icon, size: 18 }) : null })
1239
1244
  ] }, o.id)),
1240
- ee ? /* @__PURE__ */ f(ge, { children: [
1241
- /* @__PURE__ */ f("span", { "data-measure": "primary", className: "cms-section-header__primary", children: [
1242
- /* @__PURE__ */ f("span", { className: "cms-button cms-button--primary", children: [
1245
+ ee ? /* @__PURE__ */ h(ge, { children: [
1246
+ /* @__PURE__ */ h("span", { "data-measure": "primary", className: "cms-section-header__primary", children: [
1247
+ /* @__PURE__ */ h("span", { className: "cms-button cms-button--primary", children: [
1243
1248
  /* @__PURE__ */ n($, { name: a.icon }),
1244
1249
  " ",
1245
1250
  /* @__PURE__ */ n("span", { children: a.label })
1246
1251
  ] }),
1247
1252
  de !== null ? /* @__PURE__ */ n("span", { className: "cms-button cms-button--primary cms-section-header__split", children: /* @__PURE__ */ n($, { name: "chevron-down" }) }) : null
1248
1253
  ] }),
1249
- /* @__PURE__ */ f("span", { "data-measure": "primary-icon", className: "cms-section-header__primary", children: [
1254
+ /* @__PURE__ */ h("span", { "data-measure": "primary-icon", className: "cms-section-header__primary", children: [
1250
1255
  /* @__PURE__ */ n("span", { className: "cms-button cms-button--primary cms-section-header__primary--bare", children: /* @__PURE__ */ n($, { name: a.icon }) }),
1251
1256
  de !== null ? /* @__PURE__ */ n("span", { className: "cms-button cms-button--primary cms-section-header__split", children: /* @__PURE__ */ n($, { name: "chevron-down" }) }) : null
1252
1257
  ] })
@@ -1254,9 +1259,9 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
1254
1259
  /* @__PURE__ */ n("span", { "data-measure": "more", className: "cms-section-header__more", children: /* @__PURE__ */ n($, { name: "more" }) })
1255
1260
  ] })
1256
1261
  ] }),
1257
- u != null ? /* @__PURE__ */ n("div", { className: "cms-section-header__context", "data-row": "2", children: u }) : null,
1258
- de !== null ? /* @__PURE__ */ n(Ke, { at: (c == null ? void 0 : c.which) === "primary" ? c : null, items: ce, onClose: () => v(null), label: de.menuLabel }) : null,
1259
- /* @__PURE__ */ n(Ke, { at: (c == null ? void 0 : c.which) === "more" ? c : null, items: q, onClose: () => v(null), label: d })
1262
+ d != null ? /* @__PURE__ */ n("div", { className: "cms-section-header__context", "data-row": "2", children: d }) : null,
1263
+ de !== null ? /* @__PURE__ */ n(Ke, { at: (i == null ? void 0 : i.which) === "primary" ? i : null, items: oe, onClose: () => g(null), label: de.menuLabel }) : null,
1264
+ /* @__PURE__ */ n(Ke, { at: (i == null ? void 0 : i.which) === "more" ? i : null, items: q, onClose: () => g(null), label: c })
1260
1265
  ] });
1261
1266
  }
1262
1267
  function pt(e) {
@@ -1264,15 +1269,15 @@ function pt(e) {
1264
1269
  for (const l of e) l.overflow !== void 0 && l.overflow !== 0 && t.set(l.overflow, [...t.get(l.overflow) ?? [], l.id]);
1265
1270
  return [...t.entries()].sort(([l], [s]) => l - s).map(([, l]) => l);
1266
1271
  }
1267
- function al({ head: e, children: t, className: l, scrollRef: s, onScroll: a, bodyProps: i }) {
1268
- return /* @__PURE__ */ f("div", { className: F("cms-column", l), children: [
1272
+ function al({ head: e, children: t, className: l, scrollRef: s, onScroll: a, bodyProps: r }) {
1273
+ return /* @__PURE__ */ h("div", { className: H("cms-column", l), children: [
1269
1274
  e == null ? null : /* @__PURE__ */ n("div", { className: "cms-column__head", children: e }),
1270
- /* @__PURE__ */ n("div", { ...i, className: F("cms-column__body", i == null ? void 0 : i.className), ref: s, onScroll: a, children: t })
1275
+ /* @__PURE__ */ n("div", { ...r, className: H("cms-column__body", r == null ? void 0 : r.className), ref: s, onScroll: a, children: t })
1271
1276
  ] });
1272
1277
  }
1273
1278
  function rl({ title: e, scope: t, actions: l, backLink: s }) {
1274
- return /* @__PURE__ */ f("header", { className: "cms-page-header", children: [
1275
- s ? /* @__PURE__ */ f(
1279
+ return /* @__PURE__ */ h("header", { className: "cms-page-header", children: [
1280
+ s ? /* @__PURE__ */ h(
1276
1281
  "a",
1277
1282
  {
1278
1283
  className: "cms-page-header__back",
@@ -1287,8 +1292,8 @@ function rl({ title: e, scope: t, actions: l, backLink: s }) {
1287
1292
  ]
1288
1293
  }
1289
1294
  ) : null,
1290
- /* @__PURE__ */ f("div", { className: "cms-page-header__row", children: [
1291
- /* @__PURE__ */ f("div", { className: "cms-page-header__titles", children: [
1295
+ /* @__PURE__ */ h("div", { className: "cms-page-header__row", children: [
1296
+ /* @__PURE__ */ h("div", { className: "cms-page-header__titles", children: [
1292
1297
  /* @__PURE__ */ n("h1", { className: "cms-page-header__title", children: e }),
1293
1298
  t != null ? /* @__PURE__ */ n("p", { className: "cms-page-header__scope", children: t }) : null
1294
1299
  ] }),
@@ -1297,42 +1302,42 @@ function rl({ title: e, scope: t, actions: l, backLink: s }) {
1297
1302
  ] });
1298
1303
  }
1299
1304
  function il({ tabs: e, active: t, onSelect: l, label: s }) {
1300
- const a = O([]), i = (h, d) => {
1301
- var v;
1302
- const u = e.length - 1, b = h.key === "ArrowRight" ? d === u ? 0 : d + 1 : h.key === "ArrowLeft" ? d === 0 ? u : d - 1 : h.key === "Home" ? 0 : h.key === "End" ? u : null;
1305
+ const a = z([]), r = (m, c) => {
1306
+ var g;
1307
+ const d = e.length - 1, b = m.key === "ArrowRight" ? c === d ? 0 : c + 1 : m.key === "ArrowLeft" ? c === 0 ? d : c - 1 : m.key === "Home" ? 0 : m.key === "End" ? d : null;
1303
1308
  if (b === null) return;
1304
- h.preventDefault();
1305
- const c = e[b];
1306
- c && (l(c.id), (v = a.current[b]) == null || v.focus());
1309
+ m.preventDefault();
1310
+ const i = e[b];
1311
+ i && (l(i.id), (g = a.current[b]) == null || g.focus());
1307
1312
  };
1308
- return /* @__PURE__ */ n("div", { className: "cms-tabs", role: "tablist", "aria-label": s, children: e.map((h, d) => {
1309
- const u = h.id === t;
1310
- return /* @__PURE__ */ f(
1313
+ return /* @__PURE__ */ n("div", { className: "cms-tabs", role: "tablist", "aria-label": s, children: e.map((m, c) => {
1314
+ const d = m.id === t;
1315
+ return /* @__PURE__ */ h(
1311
1316
  "button",
1312
1317
  {
1313
1318
  ref: (b) => {
1314
- a.current[d] = b;
1319
+ a.current[c] = b;
1315
1320
  },
1316
1321
  type: "button",
1317
1322
  role: "tab",
1318
- className: F("cms-tab", u && "is-active"),
1319
- "aria-selected": u,
1320
- tabIndex: u ? 0 : -1,
1321
- onClick: () => l(h.id),
1322
- onKeyDown: (b) => i(b, d),
1323
+ className: H("cms-tab", d && "is-active"),
1324
+ "aria-selected": d,
1325
+ tabIndex: d ? 0 : -1,
1326
+ onClick: () => l(m.id),
1327
+ onKeyDown: (b) => r(b, c),
1323
1328
  children: [
1324
- h.label,
1325
- h.count !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-tab__count", children: h.count }) : null
1329
+ m.label,
1330
+ m.count !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-tab__count", children: m.count }) : null
1326
1331
  ]
1327
1332
  },
1328
- h.id
1333
+ m.id
1329
1334
  );
1330
1335
  }) });
1331
1336
  }
1332
1337
  function bt(e) {
1333
1338
  const t = e.trim().replace(/\s+via\s+\S.*$/, "").split(/\s+/).filter(Boolean), l = (a) => {
1334
- var i;
1335
- return (i = a == null ? void 0 : a.match(/[\p{L}\p{N}]/u)) == null ? void 0 : i[0];
1339
+ var r;
1340
+ return (r = a == null ? void 0 : a.match(/[\p{L}\p{N}]/u)) == null ? void 0 : r[0];
1336
1341
  };
1337
1342
  return (t.length > 1 ? [l(t[0]), l(t[t.length - 1])] : [l(t[0])]).filter(Boolean).join("").toUpperCase();
1338
1343
  }
@@ -1342,19 +1347,19 @@ function _t(e) {
1342
1347
  t = t * 31 + (l.codePointAt(0) ?? 0) >>> 0;
1343
1348
  return t % 6 + 1;
1344
1349
  }
1345
- function Ye({ name: e, pictureUrl: t, presence: l, connection: s, deleted: a = !1, placeholder: i = !1, size: h = 32, tintSeed: d, unnamedLabel: u }) {
1346
- const b = a || i, c = bt(e) || "?", v = e.trim() === "" ? (u == null ? void 0 : u.trim()) || "?" : e, m = s !== void 0 ? `is-${s.state === "offline" ? "disconnected" : s.state}` : l === void 0 ? null : `is-${l === "busy" ? "away" : l}`, N = s !== void 0 ? `${v}, ${s.label}` : l ? `${v}, ${l}` : v;
1347
- return /* @__PURE__ */ f(
1350
+ function Ye({ name: e, pictureUrl: t, presence: l, connection: s, deleted: a = !1, placeholder: r = !1, size: m = 32, tintSeed: c, unnamedLabel: d }) {
1351
+ const b = a || r, i = bt(e) || "?", g = e.trim() === "" ? (d == null ? void 0 : d.trim()) || "?" : e, u = s !== void 0 ? `is-${s.state === "offline" ? "disconnected" : s.state}` : l === void 0 ? null : `is-${l === "busy" ? "away" : l}`, k = s !== void 0 ? `${g}, ${s.label}` : l ? `${g}, ${l}` : g;
1352
+ return /* @__PURE__ */ h(
1348
1353
  "span",
1349
1354
  {
1350
- className: F("cms-avatar", b ? "cms-avatar--deleted" : `cms-avatar--tint-${_t(d ?? e)}`),
1351
- style: { width: h, height: h, fontSize: Math.round(h * 0.4) },
1355
+ className: H("cms-avatar", b ? "cms-avatar--deleted" : `cms-avatar--tint-${_t(c ?? e)}`),
1356
+ style: { width: m, height: m, fontSize: Math.round(m * 0.4) },
1352
1357
  role: "img",
1353
- "aria-label": N,
1358
+ "aria-label": k,
1354
1359
  ...s === void 0 ? {} : { title: s.label },
1355
1360
  children: [
1356
- b ? /* @__PURE__ */ n($, { name: "user", size: Math.round(h * 0.6) }) : t ? /* @__PURE__ */ n("img", { src: t, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ n("span", { "aria-hidden": "true", children: c }),
1357
- m === null ? null : /* @__PURE__ */ n("span", { className: F("cms-avatar__presence", m), "aria-hidden": "true" })
1361
+ b ? /* @__PURE__ */ n($, { name: "user", size: Math.round(m * 0.6) }) : t ? /* @__PURE__ */ n("img", { src: t, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ n("span", { "aria-hidden": "true", children: i }),
1362
+ u === null ? null : /* @__PURE__ */ n("span", { className: H("cms-avatar__presence", u), "aria-hidden": "true" })
1358
1363
  ]
1359
1364
  }
1360
1365
  );
@@ -1384,26 +1389,26 @@ function wt(e) {
1384
1389
  } catch {
1385
1390
  }
1386
1391
  }
1387
- function yt({ storageKey: e, value: t, default: l, min: s, max: a, step: i = 16, label: h, onChange: d, className: u, style: b }) {
1388
- const c = Math.max(s, a), v = (_) => Math.round(Math.min(Math.max(_, s), c)), [m, N] = D(() => {
1389
- const _ = e === void 0 ? null : tn(e);
1390
- return v(_ ?? l);
1391
- }), r = v(t ?? m), g = O(null), [T, C] = D(!1);
1392
+ function yt({ storageKey: e, value: t, default: l, min: s, max: a, step: r = 16, label: m, onChange: c, className: d, style: b }) {
1393
+ const i = Math.max(s, a), g = (v) => Math.round(Math.min(Math.max(v, s), i)), [u, k] = I(() => {
1394
+ const v = e === void 0 ? null : tn(e);
1395
+ return g(v ?? l);
1396
+ }), f = g(t ?? u), x = z(null), [L, S] = I(!1);
1392
1397
  $e(() => {
1393
1398
  if (e === void 0) return;
1394
- const _ = tn(e);
1395
- if (_ === null) return;
1396
- const y = v(_);
1397
- (t === void 0 || y !== v(t)) && (N(y), d(y, !0));
1399
+ const v = tn(e);
1400
+ if (v === null) return;
1401
+ const w = g(v);
1402
+ (t === void 0 || w !== g(t)) && (k(w), c(w, !0));
1398
1403
  }, []), $e(() => {
1399
- t !== void 0 && v(t) !== t && d(v(t), !0);
1400
- }, [t, s, c]);
1401
- const S = (_, y) => {
1402
- const I = v(_);
1403
- N(I), y && gt(e, I), d(I, y);
1404
- }, x = () => {
1405
- const _ = g.current;
1406
- g.current = null, C(!1), _ !== null && _.last !== _.from && S(_.last, !0);
1404
+ t !== void 0 && g(t) !== t && c(g(t), !0);
1405
+ }, [t, s, i]);
1406
+ const _ = (v, w) => {
1407
+ const T = g(v);
1408
+ k(T), w && gt(e, T), c(T, w);
1409
+ }, N = () => {
1410
+ const v = x.current;
1411
+ x.current = null, S(!1), v !== null && v.last !== v.from && _(v.last, !0);
1407
1412
  };
1408
1413
  return /* @__PURE__ */ n(
1409
1414
  "div",
@@ -1411,87 +1416,87 @@ function yt({ storageKey: e, value: t, default: l, min: s, max: a, step: i = 16,
1411
1416
  role: "separator",
1412
1417
  tabIndex: 0,
1413
1418
  "aria-orientation": "vertical",
1414
- "aria-label": h,
1415
- "aria-valuenow": r,
1419
+ "aria-label": m,
1420
+ "aria-valuenow": f,
1416
1421
  "aria-valuemin": s,
1417
- "aria-valuemax": c,
1418
- className: F("cms-splitter", T && "is-dragging", r <= s && "is-at-min", r >= c && "is-at-max", u),
1422
+ "aria-valuemax": i,
1423
+ className: H("cms-splitter", L && "is-dragging", f <= s && "is-at-min", f >= i && "is-at-max", d),
1419
1424
  style: b,
1420
- onPointerDown: (_) => {
1421
- var I, U;
1422
- if (_.button > 0) return;
1423
- _.preventDefault(), (U = (I = _.currentTarget).setPointerCapture) == null || U.call(I, _.pointerId);
1424
- const y = getComputedStyle(_.currentTarget).direction === "rtl" ? -1 : 1;
1425
- g.current = { x: _.clientX, from: r, last: r, sign: y }, C(!0);
1425
+ onPointerDown: (v) => {
1426
+ var T, B;
1427
+ if (v.button > 0) return;
1428
+ v.preventDefault(), (B = (T = v.currentTarget).setPointerCapture) == null || B.call(T, v.pointerId);
1429
+ const w = getComputedStyle(v.currentTarget).direction === "rtl" ? -1 : 1;
1430
+ x.current = { x: v.clientX, from: f, last: f, sign: w }, S(!0);
1426
1431
  },
1427
- onPointerMove: (_) => {
1428
- const y = g.current;
1429
- y === null || !Number.isFinite(_.clientX) || (y.last = v(y.from + y.sign * (_.clientX - y.x)), S(y.last, !1));
1432
+ onPointerMove: (v) => {
1433
+ const w = x.current;
1434
+ w === null || !Number.isFinite(v.clientX) || (w.last = g(w.from + w.sign * (v.clientX - w.x)), _(w.last, !1));
1430
1435
  },
1431
- onPointerUp: x,
1432
- onPointerCancel: x,
1436
+ onPointerUp: N,
1437
+ onPointerCancel: N,
1433
1438
  onDoubleClick: () => {
1434
1439
  wt(e);
1435
- const _ = v(l);
1436
- N(_), d(_, !0);
1440
+ const v = g(l);
1441
+ k(v), c(v, !0);
1437
1442
  },
1438
- onKeyDown: (_) => {
1439
- const y = _.shiftKey ? vt : i, I = getComputedStyle(_.currentTarget).direction === "rtl" ? -1 : 1, U = _.key === "ArrowLeft" ? r - I * y : _.key === "ArrowRight" ? r + I * y : _.key === "Home" ? s : _.key === "End" ? c : null;
1440
- U !== null && (_.preventDefault(), S(U, !0));
1443
+ onKeyDown: (v) => {
1444
+ const w = v.shiftKey ? vt : r, T = getComputedStyle(v.currentTarget).direction === "rtl" ? -1 : 1, B = v.key === "ArrowLeft" ? f - T * w : v.key === "ArrowRight" ? f + T * w : v.key === "Home" ? s : v.key === "End" ? i : null;
1445
+ B !== null && (v.preventDefault(), _(B, !0));
1441
1446
  }
1442
1447
  }
1443
1448
  );
1444
1449
  }
1445
1450
  function Nt({ count: e, label: t, max: l = 99 }) {
1446
- return e <= 0 ? null : /* @__PURE__ */ f("span", { className: "cms-badge", children: [
1451
+ return e <= 0 ? null : /* @__PURE__ */ h("span", { className: "cms-badge", children: [
1447
1452
  /* @__PURE__ */ n("span", { "aria-hidden": "true", children: e > l ? `${l}+` : e }),
1448
1453
  /* @__PURE__ */ n("span", { className: "cms-visually-hidden", children: t })
1449
1454
  ] });
1450
1455
  }
1451
- function cl({ product: e, mark: t, rail: l, active: s, onNavigate: a, server: i, search: h, account: d, children: u, railLabel: b = "Sections" }) {
1452
- return /* @__PURE__ */ f("div", { className: "cms-shell", children: [
1453
- /* @__PURE__ */ f("nav", { className: "cms-shell__rail", "aria-label": b, children: [
1456
+ function ol({ product: e, mark: t, rail: l, active: s, onNavigate: a, server: r, search: m, account: c, children: d, railLabel: b = "Sections" }) {
1457
+ return /* @__PURE__ */ h("div", { className: "cms-shell", children: [
1458
+ /* @__PURE__ */ h("nav", { className: "cms-shell__rail", "aria-label": b, children: [
1454
1459
  /* @__PURE__ */ n("span", { className: "cms-shell__mark", "aria-hidden": "true", children: t }),
1455
- /* @__PURE__ */ n("ul", { className: "cms-shell__items", children: l.map((c) => {
1456
- const v = c.id === s;
1457
- return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ f(
1460
+ /* @__PURE__ */ n("ul", { className: "cms-shell__items", children: l.map((i) => {
1461
+ const g = i.id === s;
1462
+ return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
1458
1463
  "a",
1459
1464
  {
1460
- href: c.href,
1461
- className: F("cms-shell__item", v && "is-active"),
1462
- "aria-current": v ? "page" : void 0,
1463
- title: c.label,
1464
- onClick: (m) => {
1465
- a && (m.preventDefault(), a(c.id));
1465
+ href: i.href,
1466
+ className: H("cms-shell__item", g && "is-active"),
1467
+ "aria-current": g ? "page" : void 0,
1468
+ title: i.label,
1469
+ onClick: (u) => {
1470
+ a && (u.preventDefault(), a(i.id));
1466
1471
  },
1467
1472
  children: [
1468
- /* @__PURE__ */ f("span", { className: "cms-shell__icon", children: [
1469
- /* @__PURE__ */ n($, { name: c.icon, size: 22 }),
1470
- c.badge ? /* @__PURE__ */ n(Nt, { count: c.badge.count, label: c.badge.label }) : null
1473
+ /* @__PURE__ */ h("span", { className: "cms-shell__icon", children: [
1474
+ /* @__PURE__ */ n($, { name: i.icon, size: 22 }),
1475
+ i.badge ? /* @__PURE__ */ n(Nt, { count: i.badge.count, label: i.badge.label }) : null
1471
1476
  ] }),
1472
- /* @__PURE__ */ n("span", { className: "cms-shell__label", children: c.label })
1477
+ /* @__PURE__ */ n("span", { className: "cms-shell__label", children: i.label })
1473
1478
  ]
1474
1479
  }
1475
- ) }, c.id);
1480
+ ) }, i.id);
1476
1481
  }) })
1477
1482
  ] }),
1478
- /* @__PURE__ */ f("header", { className: "cms-shell__top", children: [
1483
+ /* @__PURE__ */ h("header", { className: "cms-shell__top", children: [
1479
1484
  /* @__PURE__ */ n("span", { className: "cms-shell__product", children: e }),
1480
- i != null ? /* @__PURE__ */ n("div", { className: "cms-shell__server", children: i }) : null,
1481
- h != null ? /* @__PURE__ */ n("div", { className: "cms-shell__search", children: h }) : null,
1482
- d != null ? /* @__PURE__ */ n("div", { className: "cms-shell__account", children: d }) : null
1485
+ r != null ? /* @__PURE__ */ n("div", { className: "cms-shell__server", children: r }) : null,
1486
+ m != null ? /* @__PURE__ */ n("div", { className: "cms-shell__search", children: m }) : null,
1487
+ c != null ? /* @__PURE__ */ n("div", { className: "cms-shell__account", children: c }) : null
1483
1488
  ] }),
1484
- /* @__PURE__ */ n("main", { className: "cms-shell__main", children: u })
1489
+ /* @__PURE__ */ n("main", { className: "cms-shell__main", children: d })
1485
1490
  ] });
1486
1491
  }
1487
- function ol({ label: e, placeholder: t, value: l, onChange: s, onSearch: a }) {
1488
- return /* @__PURE__ */ f(
1492
+ function cl({ label: e, placeholder: t, value: l, onChange: s, onSearch: a }) {
1493
+ return /* @__PURE__ */ h(
1489
1494
  "form",
1490
1495
  {
1491
1496
  role: "search",
1492
1497
  className: "cms-search",
1493
- onSubmit: (i) => {
1494
- i.preventDefault(), a == null || a(l);
1498
+ onSubmit: (r) => {
1499
+ r.preventDefault(), a == null || a(l);
1495
1500
  },
1496
1501
  children: [
1497
1502
  /* @__PURE__ */ n($, { name: "search", size: 18 }),
@@ -1503,7 +1508,7 @@ function ol({ label: e, placeholder: t, value: l, onChange: s, onSearch: a }) {
1503
1508
  "aria-label": e,
1504
1509
  placeholder: t,
1505
1510
  value: l,
1506
- onChange: (i) => s(i.target.value)
1511
+ onChange: (r) => s(r.target.value)
1507
1512
  }
1508
1513
  )
1509
1514
  ]
@@ -1511,64 +1516,64 @@ function ol({ label: e, placeholder: t, value: l, onChange: s, onSearch: a }) {
1511
1516
  );
1512
1517
  }
1513
1518
  function kt(e, t, l) {
1514
- const s = e.map((i) => Math.min(Math.max(i.width, i.min), i.max));
1515
- let a = s.reduce((i, h) => i + h, 0) + l - t;
1516
- for (let i = s.length - 1; i >= 0 && a > 0; i -= 1) {
1517
- const h = Math.min(a, s[i] - e[i].min);
1518
- s[i] = s[i] - h, a -= h;
1519
+ const s = e.map((r) => Math.min(Math.max(r.width, r.min), r.max));
1520
+ let a = s.reduce((r, m) => r + m, 0) + l - t;
1521
+ for (let r = s.length - 1; r >= 0 && a > 0; r -= 1) {
1522
+ const m = Math.min(a, s[r] - e[r].min);
1523
+ s[r] = s[r] - m, a -= m;
1519
1524
  }
1520
1525
  return s;
1521
1526
  }
1522
- function dl({ panes: e, active: t, back: l, sizes: s, lastMin: a = 360, onResize: i, storageKey: h }) {
1523
- const d = Math.min(Math.max(t ?? e.length - 1, 0), e.length - 1), u = O(null), [b, c] = D(0), v = (s ?? []).slice(0, e.length - 1), [m, N] = D(() => h === void 0 ? [] : v.map((_, y) => tn(`${h}:${String(y)}`) ?? void 0)), [r, g] = D(!1), T = v.map((_, y) => _ !== void 0 && m[y] !== void 0 ? { ..._, width: m[y] } : _), C = T.length === e.length - 1 && T.every((_) => _ !== void 0);
1527
+ function dl({ panes: e, active: t, back: l, sizes: s, lastMin: a = 360, onResize: r, storageKey: m }) {
1528
+ const c = Math.min(Math.max(t ?? e.length - 1, 0), e.length - 1), d = z(null), [b, i] = I(0), g = (s ?? []).slice(0, e.length - 1), [u, k] = I(() => m === void 0 ? [] : g.map((v, w) => tn(`${m}:${String(w)}`) ?? void 0)), [f, x] = I(!1), L = g.map((v, w) => v !== void 0 && u[w] !== void 0 ? { ...v, width: u[w] } : v), S = L.length === e.length - 1 && L.every((v) => v !== void 0);
1524
1529
  $e(() => {
1525
- const _ = u.current;
1526
- if (_ === null || !C) return;
1527
- const y = () => c(_.clientWidth);
1528
- if (y(), typeof ResizeObserver > "u") return;
1529
- const I = new ResizeObserver(y);
1530
- return I.observe(_), () => I.disconnect();
1531
- }, [C]);
1532
- const S = C ? kt(T, b > 0 ? b : Number.POSITIVE_INFINITY, a) : [], x = C ? Object.fromEntries(S.flatMap((_, y) => [
1533
- [`--split-pane-${String(y)}`, `${String(_)}px`],
1534
- [`--split-pane-end-${String(y)}`, `${String(S.slice(0, y + 1).reduce((I, U) => I + U, 0))}px`]
1530
+ const v = d.current;
1531
+ if (v === null || !S) return;
1532
+ const w = () => i(v.clientWidth);
1533
+ if (w(), typeof ResizeObserver > "u") return;
1534
+ const T = new ResizeObserver(w);
1535
+ return T.observe(v), () => T.disconnect();
1536
+ }, [S]);
1537
+ const _ = S ? kt(L, b > 0 ? b : Number.POSITIVE_INFINITY, a) : [], N = S ? Object.fromEntries(_.flatMap((v, w) => [
1538
+ [`--split-pane-${String(w)}`, `${String(v)}px`],
1539
+ [`--split-pane-end-${String(w)}`, `${String(_.slice(0, w + 1).reduce((T, B) => T + B, 0))}px`]
1535
1540
  ])) : void 0;
1536
- return /* @__PURE__ */ f(
1541
+ return /* @__PURE__ */ h(
1537
1542
  "div",
1538
1543
  {
1539
- ref: u,
1540
- className: F("cms-panes", e.length === 3 ? "cms-panes--three" : "cms-panes--two", C && "cms-panes--sized", r && "is-resizing"),
1541
- "data-active": d,
1542
- style: x,
1544
+ ref: d,
1545
+ className: H("cms-panes", e.length === 3 ? "cms-panes--three" : "cms-panes--two", S && "cms-panes--sized", f && "is-resizing"),
1546
+ "data-active": c,
1547
+ style: N,
1543
1548
  children: [
1544
- e.map((_, y) => /* @__PURE__ */ f("section", { className: "cms-panes__pane", "aria-label": _.label, "data-offset": d - y, children: [
1545
- y === d && l ? /* @__PURE__ */ f("a", { className: "cms-panes__back", href: l.href, children: [
1549
+ e.map((v, w) => /* @__PURE__ */ h("section", { className: "cms-panes__pane", "aria-label": v.label, "data-offset": c - w, children: [
1550
+ w === c && l ? /* @__PURE__ */ h("a", { className: "cms-panes__back", href: l.href, children: [
1546
1551
  /* @__PURE__ */ n($, { name: "chevron-left", size: 18 }),
1547
1552
  l.label
1548
1553
  ] }) : null,
1549
- _.content
1550
- ] }, _.label)),
1551
- C ? T.map((_, y) => {
1552
- const I = S.reduce((P, k, B) => B === y ? P : P + k, 0), U = Math.max(_.min, Math.min(_.max, b > 0 ? b - I - a : _.max));
1554
+ v.content
1555
+ ] }, v.label)),
1556
+ S ? L.map((v, w) => {
1557
+ const T = _.reduce((F, M, R) => R === w ? F : F + M, 0), B = Math.max(v.min, Math.min(v.max, b > 0 ? b - T - a : v.max));
1553
1558
  return /* @__PURE__ */ n(
1554
1559
  yt,
1555
1560
  {
1556
- ...h === void 0 ? {} : { storageKey: `${h}:${String(y)}` },
1557
- value: S[y],
1558
- default: _.reset,
1559
- min: _.min,
1560
- max: U,
1561
- label: _.label,
1561
+ ...m === void 0 ? {} : { storageKey: `${m}:${String(w)}` },
1562
+ value: _[w],
1563
+ default: v.reset,
1564
+ min: v.min,
1565
+ max: B,
1566
+ label: v.label,
1562
1567
  className: "cms-panes__splitter",
1563
- style: { "--split-at": `var(--split-pane-end-${String(y)})` },
1564
- onChange: (P, k) => {
1565
- h !== void 0 && N((B) => {
1566
- const z = [...B];
1567
- return z[y] = P, z;
1568
- }), g(!k), i == null || i(y, P, k);
1568
+ style: { "--split-at": `var(--split-pane-end-${String(w)})` },
1569
+ onChange: (F, M) => {
1570
+ m !== void 0 && k((R) => {
1571
+ const U = [...R];
1572
+ return U[w] = F, U;
1573
+ }), x(!M), r == null || r(w, F, M);
1569
1574
  }
1570
1575
  },
1571
- _.label
1576
+ v.label
1572
1577
  );
1573
1578
  }) : null
1574
1579
  ]
@@ -1576,11 +1581,11 @@ function dl({ panes: e, active: t, back: l, sizes: s, lastMin: a = 360, onResize
1576
1581
  );
1577
1582
  }
1578
1583
  const xt = { attachment: "Has an attachment", unread: "Unread" };
1579
- function ul({ from: e, fromPlaceholder: t = !1, subject: l, preview: s, time: a, unread: i, hasAttachment: h, selected: d, onOpen: u, check: b, selecting: c, labels: v }) {
1580
- const m = qe(xt, v), N = /* @__PURE__ */ n(Ye, { name: e, size: 40, placeholder: t });
1581
- return /* @__PURE__ */ f("div", { className: F("cms-mail-row", i && "is-unread", d && "is-selected", c && "is-selecting", (b == null ? void 0 : b.checked) && "is-checked"), children: [
1582
- b !== void 0 ? /* @__PURE__ */ f("span", { className: "cms-mail-row__lead", children: [
1583
- N,
1584
+ function ul({ from: e, fromPlaceholder: t = !1, subject: l, preview: s, time: a, unread: r, hasAttachment: m, selected: c, onOpen: d, check: b, selecting: i, labels: g }) {
1585
+ const u = qe(xt, g), k = /* @__PURE__ */ n(Ye, { name: e, size: 40, placeholder: t });
1586
+ return /* @__PURE__ */ h("div", { className: H("cms-mail-row", r && "is-unread", c && "is-selected", i && "is-selecting", (b == null ? void 0 : b.checked) && "is-checked"), children: [
1587
+ b !== void 0 ? /* @__PURE__ */ h("span", { className: "cms-mail-row__lead", children: [
1588
+ k,
1584
1589
  /* @__PURE__ */ n(
1585
1590
  "input",
1586
1591
  {
@@ -1593,34 +1598,34 @@ function ul({ from: e, fromPlaceholder: t = !1, subject: l, preview: s, time: a,
1593
1598
  "aria-label": b.label,
1594
1599
  onChange: () => {
1595
1600
  },
1596
- onClick: (r) => {
1597
- if (r.stopPropagation(), b.pending) {
1598
- r.preventDefault();
1601
+ onClick: (f) => {
1602
+ if (f.stopPropagation(), b.pending) {
1603
+ f.preventDefault();
1599
1604
  return;
1600
1605
  }
1601
- b.onCheck({ shift: r.shiftKey, toggle: r.ctrlKey || r.metaKey });
1606
+ b.onCheck({ shift: f.shiftKey, toggle: f.ctrlKey || f.metaKey });
1602
1607
  }
1603
1608
  }
1604
1609
  )
1605
1610
  ] }) : null,
1606
- /* @__PURE__ */ f(
1611
+ /* @__PURE__ */ h(
1607
1612
  "button",
1608
1613
  {
1609
1614
  type: "button",
1610
1615
  className: "cms-mail-row__open",
1611
- "aria-current": d ? "true" : void 0,
1612
- onClick: u,
1616
+ "aria-current": c ? "true" : void 0,
1617
+ onClick: d,
1613
1618
  children: [
1614
- b === void 0 ? N : null,
1615
- /* @__PURE__ */ f("span", { className: "cms-mail-row__body", children: [
1616
- /* @__PURE__ */ f("span", { className: "cms-mail-row__line", children: [
1619
+ b === void 0 ? k : null,
1620
+ /* @__PURE__ */ h("span", { className: "cms-mail-row__body", children: [
1621
+ /* @__PURE__ */ h("span", { className: "cms-mail-row__line", children: [
1617
1622
  /* @__PURE__ */ n("span", { className: "cms-mail-row__from", children: e }),
1618
- h ? /* @__PURE__ */ n($, { name: "paperclip", size: 16, label: m.attachment }) : null,
1623
+ m ? /* @__PURE__ */ n($, { name: "paperclip", size: 16, label: u.attachment }) : null,
1619
1624
  /* @__PURE__ */ n("span", { className: "cms-mail-row__time", children: a })
1620
1625
  ] }),
1621
- /* @__PURE__ */ f("span", { className: "cms-mail-row__line", children: [
1626
+ /* @__PURE__ */ h("span", { className: "cms-mail-row__line", children: [
1622
1627
  /* @__PURE__ */ n("span", { className: "cms-mail-row__subject", children: l }),
1623
- i ? /* @__PURE__ */ n("span", { className: "cms-mail-row__dot", role: "img", "aria-label": m.unread }) : null
1628
+ r ? /* @__PURE__ */ n("span", { className: "cms-mail-row__dot", role: "img", "aria-label": u.unread }) : null
1624
1629
  ] }),
1625
1630
  /* @__PURE__ */ n("span", { className: "cms-mail-row__preview", children: s })
1626
1631
  ] })
@@ -1630,42 +1635,42 @@ function ul({ from: e, fromPlaceholder: t = !1, subject: l, preview: s, time: a,
1630
1635
  ] });
1631
1636
  }
1632
1637
  function ml({ direction: e, children: t, time: l, read: s, readLabel: a = "Read" }) {
1633
- return /* @__PURE__ */ f("div", { className: F("cms-bubble", `cms-bubble--${e}`), children: [
1638
+ return /* @__PURE__ */ h("div", { className: H("cms-bubble", `cms-bubble--${e}`), children: [
1634
1639
  /* @__PURE__ */ n("div", { className: "cms-bubble__text", children: t }),
1635
- /* @__PURE__ */ f("div", { className: "cms-bubble__meta", children: [
1640
+ /* @__PURE__ */ h("div", { className: "cms-bubble__meta", children: [
1636
1641
  l,
1637
- e === "out" && s ? /* @__PURE__ */ f(ge, { children: [
1642
+ e === "out" && s ? /* @__PURE__ */ h(ge, { children: [
1638
1643
  " · ",
1639
1644
  a
1640
1645
  ] }) : null
1641
1646
  ] })
1642
1647
  ] });
1643
1648
  }
1644
- function hl({ label: e, value: t, onChange: l, onSend: s, onAttach: a, placeholder: i, variant: h = "chat", sendLabel: d = "Send", attachLabel: u = "Attach a file", leading: b, canSend: c }) {
1645
- const v = he(), m = c ?? t.trim() !== "", N = (g) => {
1646
- g.preventDefault(), m && s();
1647
- }, r = a ? /* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": u, onClick: a, children: /* @__PURE__ */ n($, { name: "paperclip" }) }) : null;
1648
- return /* @__PURE__ */ f("form", { className: F("cms-composer", `cms-composer--${h}`), onSubmit: N, children: [
1649
- /* @__PURE__ */ n("label", { htmlFor: v, className: h === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: e }),
1650
- h === "chat" ? r : null,
1649
+ function hl({ label: e, value: t, onChange: l, onSend: s, onAttach: a, placeholder: r, variant: m = "chat", sendLabel: c = "Send", attachLabel: d = "Attach a file", leading: b, canSend: i }) {
1650
+ const g = he(), u = i ?? t.trim() !== "", k = (x) => {
1651
+ x.preventDefault(), u && s();
1652
+ }, f = a ? /* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": d, onClick: a, children: /* @__PURE__ */ n($, { name: "paperclip" }) }) : null;
1653
+ return /* @__PURE__ */ h("form", { className: H("cms-composer", `cms-composer--${m}`), onSubmit: k, children: [
1654
+ /* @__PURE__ */ n("label", { htmlFor: g, className: m === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: e }),
1655
+ m === "chat" ? f : null,
1651
1656
  /* @__PURE__ */ n(
1652
1657
  "textarea",
1653
1658
  {
1654
- id: v,
1659
+ id: g,
1655
1660
  className: "cms-composer__input",
1656
- rows: h === "reply" ? 3 : 1,
1657
- placeholder: i,
1661
+ rows: m === "reply" ? 3 : 1,
1662
+ placeholder: r,
1658
1663
  value: t,
1659
- onChange: (g) => l(g.target.value),
1660
- onKeyDown: (g) => {
1661
- g.nativeEvent.isComposing || g.keyCode === 229 || h === "chat" && g.key === "Enter" && !g.shiftKey && (g.preventDefault(), m && s());
1664
+ onChange: (x) => l(x.target.value),
1665
+ onKeyDown: (x) => {
1666
+ x.nativeEvent.isComposing || x.keyCode === 229 || m === "chat" && x.key === "Enter" && !x.shiftKey && (x.preventDefault(), u && s());
1662
1667
  }
1663
1668
  }
1664
1669
  ),
1665
- h === "reply" && b !== void 0 ? /* @__PURE__ */ n("div", { className: "cms-composer__leading", children: b }) : null,
1666
- h === "reply" ? r : null,
1667
- h === "chat" ? /* @__PURE__ */ n("button", { type: "submit", className: "cms-composer__send-round", "aria-label": d, disabled: !m, children: /* @__PURE__ */ n($, { name: "send" }) }) : /* @__PURE__ */ f("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !m, children: [
1668
- d,
1670
+ m === "reply" && b !== void 0 ? /* @__PURE__ */ n("div", { className: "cms-composer__leading", children: b }) : null,
1671
+ m === "reply" ? f : null,
1672
+ m === "chat" ? /* @__PURE__ */ n("button", { type: "submit", className: "cms-composer__send-round", "aria-label": c, disabled: !u, children: /* @__PURE__ */ n($, { name: "send" }) }) : /* @__PURE__ */ h("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !u, children: [
1673
+ c,
1669
1674
  " ",
1670
1675
  /* @__PURE__ */ n($, { name: "send", size: 18 })
1671
1676
  ] })
@@ -1692,24 +1697,24 @@ const mn = {
1692
1697
  onCallWith: (e) => `On a call with ${e}`,
1693
1698
  returnToCall: "Return to call"
1694
1699
  };
1695
- function fl({ name: e, namePlaceholder: t = !1, media: l, onAccept: s, onDecline: a, labels: i }) {
1696
- const h = qe(mn, i), d = l === "video" ? h.incomingVideo : h.incomingAudio;
1697
- return /* @__PURE__ */ f("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": h.incomingFrom(d, e), children: [
1700
+ function fl({ name: e, namePlaceholder: t = !1, media: l, onAccept: s, onDecline: a, labels: r }) {
1701
+ const m = qe(mn, r), c = l === "video" ? m.incomingVideo : m.incomingAudio;
1702
+ return /* @__PURE__ */ h("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": m.incomingFrom(c, e), children: [
1698
1703
  /* @__PURE__ */ n("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ n(Ye, { name: e, size: 112, placeholder: t }) }),
1699
1704
  /* @__PURE__ */ n("p", { className: "cms-call-incoming__name", children: e }),
1700
- /* @__PURE__ */ n("p", { className: "cms-call-incoming__what", children: d }),
1701
- /* @__PURE__ */ f("div", { className: "cms-call-incoming__actions", children: [
1702
- /* @__PURE__ */ n(Ue, { icon: "phone-off", label: h.decline, tone: "hang-up", onClick: a }),
1703
- /* @__PURE__ */ n(Ue, { icon: "phone", label: h.accept, tone: "accept", onClick: s })
1705
+ /* @__PURE__ */ n("p", { className: "cms-call-incoming__what", children: c }),
1706
+ /* @__PURE__ */ h("div", { className: "cms-call-incoming__actions", children: [
1707
+ /* @__PURE__ */ n(Ue, { icon: "phone-off", label: m.decline, tone: "hang-up", onClick: a }),
1708
+ /* @__PURE__ */ n(Ue, { icon: "phone", label: m.accept, tone: "accept", onClick: s })
1704
1709
  ] })
1705
1710
  ] });
1706
1711
  }
1707
1712
  function Ue({ icon: e, label: t, onClick: l, tone: s = "plain", pressed: a }) {
1708
- return /* @__PURE__ */ f(
1713
+ return /* @__PURE__ */ h(
1709
1714
  "button",
1710
1715
  {
1711
1716
  type: "button",
1712
- className: F("cms-call-button", `cms-call-button--${s}`, a && "is-pressed"),
1717
+ className: H("cms-call-button", `cms-call-button--${s}`, a && "is-pressed"),
1713
1718
  "aria-pressed": a,
1714
1719
  onClick: l,
1715
1720
  children: [
@@ -1719,61 +1724,61 @@ function Ue({ icon: e, label: t, onClick: l, tone: s = "plain", pressed: a }) {
1719
1724
  }
1720
1725
  );
1721
1726
  }
1722
- function pl({ name: e, duration: t, connection: l, you: s, muted: a, speaker: i, onToggleMute: h, onToggleSpeaker: d, onAddPerson: u, onChat: b, onHangUp: c, labels: v }) {
1723
- const m = qe(mn, v);
1724
- return /* @__PURE__ */ f("section", { className: "cms-call-panel", "aria-label": m.callWith(e), children: [
1725
- /* @__PURE__ */ f("div", { className: "cms-call-panel__head", children: [
1727
+ function pl({ name: e, duration: t, connection: l, you: s, muted: a, speaker: r, onToggleMute: m, onToggleSpeaker: c, onAddPerson: d, onChat: b, onHangUp: i, labels: g }) {
1728
+ const u = qe(mn, g);
1729
+ return /* @__PURE__ */ h("section", { className: "cms-call-panel", "aria-label": u.callWith(e), children: [
1730
+ /* @__PURE__ */ h("div", { className: "cms-call-panel__head", children: [
1726
1731
  /* @__PURE__ */ n(Ye, { name: e, size: 64 }),
1727
- /* @__PURE__ */ f("div", { className: "cms-call-panel__who", children: [
1732
+ /* @__PURE__ */ h("div", { className: "cms-call-panel__who", children: [
1728
1733
  /* @__PURE__ */ n("p", { className: "cms-call-panel__name", children: e }),
1729
- /* @__PURE__ */ n("p", { className: "cms-call-panel__time", "aria-label": m.callTime(t), children: t })
1734
+ /* @__PURE__ */ n("p", { className: "cms-call-panel__time", "aria-label": u.callTime(t), children: t })
1730
1735
  ] }),
1731
- /* @__PURE__ */ n("span", { className: F("cms-pill", l === "good" ? "cms-pill--success" : "cms-pill--warning"), children: l === "good" ? m.goodConnection : m.poorConnection })
1736
+ /* @__PURE__ */ n("span", { className: H("cms-pill", l === "good" ? "cms-pill--success" : "cms-pill--warning"), children: l === "good" ? u.goodConnection : u.poorConnection })
1732
1737
  ] }),
1733
- /* @__PURE__ */ f("div", { className: "cms-call-panel__you", children: [
1738
+ /* @__PURE__ */ h("div", { className: "cms-call-panel__you", children: [
1734
1739
  /* @__PURE__ */ n(Ye, { name: s.name, size: 36 }),
1735
- /* @__PURE__ */ n("span", { children: m.you }),
1736
- s.speaking ? /* @__PURE__ */ n("span", { className: "cms-call-panel__level", role: "img", "aria-label": m.speaking }) : null
1740
+ /* @__PURE__ */ n("span", { children: u.you }),
1741
+ s.speaking ? /* @__PURE__ */ n("span", { className: "cms-call-panel__level", role: "img", "aria-label": u.speaking }) : null
1737
1742
  ] }),
1738
- /* @__PURE__ */ f("div", { className: "cms-call-panel__controls", children: [
1739
- /* @__PURE__ */ n(Ue, { icon: "mic", label: a ? m.unmute : m.mute, pressed: a, onClick: h }),
1740
- /* @__PURE__ */ n(Ue, { icon: "speaker", label: m.speaker, pressed: i, onClick: d }),
1741
- u ? /* @__PURE__ */ n(Ue, { icon: "user-plus", label: m.addPerson, onClick: u }) : null,
1742
- b ? /* @__PURE__ */ n(Ue, { icon: "chat", label: m.chat, onClick: b }) : null,
1743
- /* @__PURE__ */ n(Ue, { icon: "phone-off", label: m.hangUp, tone: "hang-up", onClick: c })
1743
+ /* @__PURE__ */ h("div", { className: "cms-call-panel__controls", children: [
1744
+ /* @__PURE__ */ n(Ue, { icon: "mic", label: a ? u.unmute : u.mute, pressed: a, onClick: m }),
1745
+ /* @__PURE__ */ n(Ue, { icon: "speaker", label: u.speaker, pressed: r, onClick: c }),
1746
+ d ? /* @__PURE__ */ n(Ue, { icon: "user-plus", label: u.addPerson, onClick: d }) : null,
1747
+ b ? /* @__PURE__ */ n(Ue, { icon: "chat", label: u.chat, onClick: b }) : null,
1748
+ /* @__PURE__ */ n(Ue, { icon: "phone-off", label: u.hangUp, tone: "hang-up", onClick: i })
1744
1749
  ] })
1745
1750
  ] });
1746
1751
  }
1747
- function bl({ name: e, duration: t, muted: l, onToggleMute: s, onReturn: a, onHangUp: i, labels: h }) {
1748
- const d = qe(mn, h);
1749
- return /* @__PURE__ */ f("section", { className: "cms-call-bar", "aria-label": d.callWith(e), children: [
1752
+ function bl({ name: e, duration: t, muted: l, onToggleMute: s, onReturn: a, onHangUp: r, labels: m }) {
1753
+ const c = qe(mn, m);
1754
+ return /* @__PURE__ */ h("section", { className: "cms-call-bar", "aria-label": c.callWith(e), children: [
1750
1755
  /* @__PURE__ */ n("span", { className: "cms-call-bar__live", "aria-hidden": "true" }),
1751
- /* @__PURE__ */ n("span", { className: "cms-call-bar__name", children: d.onCallWith(e) }),
1756
+ /* @__PURE__ */ n("span", { className: "cms-call-bar__name", children: c.onCallWith(e) }),
1752
1757
  /* @__PURE__ */ n("span", { className: "cms-call-bar__time", children: t }),
1753
- /* @__PURE__ */ f("span", { className: "cms-call-bar__actions", children: [
1754
- /* @__PURE__ */ n("button", { type: "button", className: "cms-call-bar__icon", "aria-label": l ? d.unmute : d.mute, "aria-pressed": l, onClick: s, children: /* @__PURE__ */ n($, { name: "mic" }) }),
1755
- /* @__PURE__ */ n("button", { type: "button", className: "cms-button cms-button--primary", onClick: a, children: d.returnToCall }),
1756
- /* @__PURE__ */ n("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": d.hangUp, onClick: i, children: /* @__PURE__ */ n($, { name: "phone-off" }) })
1758
+ /* @__PURE__ */ h("span", { className: "cms-call-bar__actions", children: [
1759
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-call-bar__icon", "aria-label": l ? c.unmute : c.mute, "aria-pressed": l, onClick: s, children: /* @__PURE__ */ n($, { name: "mic" }) }),
1760
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-button cms-button--primary", onClick: a, children: c.returnToCall }),
1761
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": c.hangUp, onClick: r, children: /* @__PURE__ */ n($, { name: "phone-off" }) })
1757
1762
  ] })
1758
1763
  ] });
1759
1764
  }
1760
- function _l({ mark: e, product: t, headline: l, lead: s, features: a = [], children: i }) {
1761
- return /* @__PURE__ */ f("div", { className: "cms-signin", children: [
1762
- /* @__PURE__ */ f("aside", { className: "cms-signin__brand", children: [
1763
- /* @__PURE__ */ f("p", { className: "cms-signin__logo", children: [
1765
+ function _l({ mark: e, product: t, headline: l, lead: s, features: a = [], children: r }) {
1766
+ return /* @__PURE__ */ h("div", { className: "cms-signin", children: [
1767
+ /* @__PURE__ */ h("aside", { className: "cms-signin__brand", children: [
1768
+ /* @__PURE__ */ h("p", { className: "cms-signin__logo", children: [
1764
1769
  /* @__PURE__ */ n("span", { className: "cms-signin__mark", "aria-hidden": "true", children: e }),
1765
1770
  t
1766
1771
  ] }),
1767
- /* @__PURE__ */ f("div", { className: "cms-signin__pitch", children: [
1772
+ /* @__PURE__ */ h("div", { className: "cms-signin__pitch", children: [
1768
1773
  /* @__PURE__ */ n("p", { className: "cms-signin__headline", children: l }),
1769
1774
  /* @__PURE__ */ n("p", { className: "cms-signin__lead", children: s }),
1770
- a.length ? /* @__PURE__ */ n("ul", { className: "cms-signin__features", children: a.map((h) => /* @__PURE__ */ f("li", { children: [
1771
- /* @__PURE__ */ n($, { name: h.icon, size: 18 }),
1772
- h.label
1773
- ] }, h.label)) }) : null
1775
+ a.length ? /* @__PURE__ */ n("ul", { className: "cms-signin__features", children: a.map((m) => /* @__PURE__ */ h("li", { children: [
1776
+ /* @__PURE__ */ n($, { name: m.icon, size: 18 }),
1777
+ m.label
1778
+ ] }, m.label)) }) : null
1774
1779
  ] })
1775
1780
  ] }),
1776
- /* @__PURE__ */ n("main", { className: "cms-signin__form", children: i })
1781
+ /* @__PURE__ */ n("main", { className: "cms-signin__form", children: r })
1777
1782
  ] });
1778
1783
  }
1779
1784
  const Mt = {
@@ -1788,52 +1793,52 @@ const Mt = {
1788
1793
  newHere: "New here?",
1789
1794
  create: "Create an account"
1790
1795
  };
1791
- function vl({ server: e, onSubmit: t, forgotHref: l, createHref: s, error: a, busy: i, labels: h }) {
1792
- const d = qe(Mt, h), u = he(), [b, c] = D(""), [v, m] = D(""), [N, r] = D(!1);
1793
- return /* @__PURE__ */ f("form", { className: "cms-signin-form", onSubmit: (T) => {
1794
- T.preventDefault(), t(b, v);
1795
- }, "aria-describedby": a ? `${u}-error` : void 0, children: [
1796
- /* @__PURE__ */ n("h1", { className: "cms-signin-form__title", children: d.title }),
1797
- /* @__PURE__ */ f("p", { className: "cms-signin-form__server", children: [
1796
+ function vl({ server: e, onSubmit: t, forgotHref: l, createHref: s, error: a, busy: r, labels: m }) {
1797
+ const c = qe(Mt, m), d = he(), [b, i] = I(""), [g, u] = I(""), [k, f] = I(!1);
1798
+ return /* @__PURE__ */ h("form", { className: "cms-signin-form", onSubmit: (L) => {
1799
+ L.preventDefault(), t(b, g);
1800
+ }, "aria-describedby": a ? `${d}-error` : void 0, children: [
1801
+ /* @__PURE__ */ n("h1", { className: "cms-signin-form__title", children: c.title }),
1802
+ /* @__PURE__ */ h("p", { className: "cms-signin-form__server", children: [
1798
1803
  /* @__PURE__ */ n($, { name: "server", size: 18 }),
1799
1804
  e
1800
1805
  ] }),
1801
- /* @__PURE__ */ n("label", { className: "cms-signin-form__label", htmlFor: `${u}-identifier`, children: d.identifier }),
1806
+ /* @__PURE__ */ n("label", { className: "cms-signin-form__label", htmlFor: `${d}-identifier`, children: c.identifier }),
1802
1807
  /* @__PURE__ */ n(
1803
1808
  "input",
1804
1809
  {
1805
- id: `${u}-identifier`,
1810
+ id: `${d}-identifier`,
1806
1811
  className: "cms-signin-form__input",
1807
1812
  type: "text",
1808
1813
  autoComplete: "username",
1809
- placeholder: d.identifierPlaceholder,
1814
+ placeholder: c.identifierPlaceholder,
1810
1815
  value: b,
1811
- onChange: (T) => c(T.target.value),
1816
+ onChange: (L) => i(L.target.value),
1812
1817
  required: !0
1813
1818
  }
1814
1819
  ),
1815
- /* @__PURE__ */ n("label", { className: "cms-signin-form__label", htmlFor: `${u}-password`, children: d.password }),
1816
- /* @__PURE__ */ f("span", { className: "cms-signin-form__password", children: [
1820
+ /* @__PURE__ */ n("label", { className: "cms-signin-form__label", htmlFor: `${d}-password`, children: c.password }),
1821
+ /* @__PURE__ */ h("span", { className: "cms-signin-form__password", children: [
1817
1822
  /* @__PURE__ */ n(
1818
1823
  "input",
1819
1824
  {
1820
- id: `${u}-password`,
1825
+ id: `${d}-password`,
1821
1826
  className: "cms-signin-form__input",
1822
- type: N ? "text" : "password",
1827
+ type: k ? "text" : "password",
1823
1828
  autoComplete: "current-password",
1824
- value: v,
1825
- onChange: (T) => m(T.target.value),
1829
+ value: g,
1830
+ onChange: (L) => u(L.target.value),
1826
1831
  required: !0
1827
1832
  }
1828
1833
  ),
1829
- /* @__PURE__ */ n("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": N, onClick: () => r((T) => !T), children: N ? d.hide : d.show })
1834
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": k, onClick: () => f((L) => !L), children: k ? c.hide : c.show })
1830
1835
  ] }),
1831
- l ? /* @__PURE__ */ n("a", { className: "cms-signin-form__forgot", href: l, children: d.forgot }) : null,
1832
- a ? /* @__PURE__ */ n("p", { id: `${u}-error`, className: "cms-signin-form__error", role: "alert", children: a }) : null,
1833
- /* @__PURE__ */ n("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: i, "aria-busy": i || void 0, children: d.submit }),
1834
- s ? /* @__PURE__ */ f(ge, { children: [
1835
- /* @__PURE__ */ n("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ n("span", { children: d.newHere }) }),
1836
- /* @__PURE__ */ n("a", { className: "cms-button cms-signin-form__create", href: s, children: d.create })
1836
+ l ? /* @__PURE__ */ n("a", { className: "cms-signin-form__forgot", href: l, children: c.forgot }) : null,
1837
+ a ? /* @__PURE__ */ n("p", { id: `${d}-error`, className: "cms-signin-form__error", role: "alert", children: a }) : null,
1838
+ /* @__PURE__ */ n("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: r, "aria-busy": r || void 0, children: c.submit }),
1839
+ s ? /* @__PURE__ */ h(ge, { children: [
1840
+ /* @__PURE__ */ n("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ n("span", { children: c.newHere }) }),
1841
+ /* @__PURE__ */ n("a", { className: "cms-button cms-signin-form__create", href: s, children: c.create })
1837
1842
  ] }) : null
1838
1843
  ] });
1839
1844
  }
@@ -1866,8 +1871,8 @@ function fn(e, t) {
1866
1871
  return e.find((l) => l.id === t) ?? e[0];
1867
1872
  }
1868
1873
  function Dn(e) {
1869
- var i;
1870
- const t = O(null), l = (e == null ? void 0 : e.value) ?? null, a = e === void 0 || e.options.some((h) => h.id === e.value) ? null : ((i = fn(e.options, e.defaultValue)) == null ? void 0 : i.id) ?? null;
1874
+ var r;
1875
+ const t = z(null), l = (e == null ? void 0 : e.value) ?? null, a = e === void 0 || e.options.some((m) => m.id === e.value) ? null : ((r = fn(e.options, e.defaultValue)) == null ? void 0 : r.id) ?? null;
1871
1876
  Q(() => {
1872
1877
  a === null ? t.current = null : t.current !== l && (t.current = l, e == null || e.onChange(a));
1873
1878
  }, [a, l]);
@@ -1876,33 +1881,33 @@ function In({ iconOnly: e = !1, onOpenChange: t, ...l }) {
1876
1881
  return l.options.length < 2 ? null : /* @__PURE__ */ n(St, { ...l, iconOnly: e, onOpenChange: t });
1877
1882
  }
1878
1883
  function St({ iconOnly: e, onOpenChange: t, ...l }) {
1879
- const [s, a] = D(null), i = Ie(() => a(null), []), h = O(!1), d = s !== null;
1880
- Q(() => (t == null || t(d), () => t == null ? void 0 : t(!1)), [d, t]);
1881
- const u = An(l), b = u !== null && !e, c = Tn(l), v = (m, N) => {
1882
- const r = m.getBoundingClientRect();
1883
- a({ x: r.left, y: r.bottom + 4, focus: N });
1884
+ const [s, a] = I(null), r = Ie(() => a(null), []), m = z(!1), c = s !== null;
1885
+ Q(() => (t == null || t(c), () => t == null ? void 0 : t(!1)), [c, t]);
1886
+ const d = An(l), b = d !== null && !e, i = Tn(l), g = (u, k) => {
1887
+ const f = u.getBoundingClientRect();
1888
+ a({ x: f.left, y: f.bottom + 4, focus: k });
1884
1889
  };
1885
- return /* @__PURE__ */ f(ge, { children: [
1890
+ return /* @__PURE__ */ h(ge, { children: [
1886
1891
  /* @__PURE__ */ n(
1887
1892
  "button",
1888
1893
  {
1889
1894
  type: "button",
1890
- className: F("cms-filter-menu", u !== null && "cms-filter-menu--active", b && "cms-filter-menu--named"),
1895
+ className: H("cms-filter-menu", d !== null && "cms-filter-menu--active", b && "cms-filter-menu--named"),
1891
1896
  "aria-haspopup": "menu",
1892
- "aria-expanded": d,
1893
- "aria-label": c,
1894
- title: c,
1897
+ "aria-expanded": c,
1898
+ "aria-label": i,
1899
+ title: i,
1895
1900
  onMouseDown: () => {
1896
- h.current = d;
1901
+ m.current = c;
1897
1902
  },
1898
- onClick: (m) => {
1899
- d || h.current ? i() : v(m.currentTarget, "current"), h.current = !1;
1903
+ onClick: (u) => {
1904
+ c || m.current ? r() : g(u.currentTarget, "current"), m.current = !1;
1900
1905
  },
1901
- onKeyDown: (m) => {
1902
- h.current = !1, (m.key === "ArrowDown" || m.key === "ArrowUp") && (m.preventDefault(), v(m.currentTarget, m.key === "ArrowUp" ? "last" : "current"));
1906
+ onKeyDown: (u) => {
1907
+ m.current = !1, (u.key === "ArrowDown" || u.key === "ArrowUp") && (u.preventDefault(), g(u.currentTarget, u.key === "ArrowUp" ? "last" : "current"));
1903
1908
  },
1904
- children: b ? /* @__PURE__ */ f(ge, { children: [
1905
- /* @__PURE__ */ n("span", { className: "cms-filter-menu__choice", children: u.label }),
1909
+ children: b ? /* @__PURE__ */ h(ge, { children: [
1910
+ /* @__PURE__ */ n("span", { className: "cms-filter-menu__choice", children: d.label }),
1906
1911
  /* @__PURE__ */ n($, { name: "chevron-down", size: 16 })
1907
1912
  ] }) : /* @__PURE__ */ n($, { name: "funnel" })
1908
1913
  }
@@ -1912,7 +1917,7 @@ function St({ iconOnly: e, onOpenChange: t, ...l }) {
1912
1917
  {
1913
1918
  at: s,
1914
1919
  items: Ln(l),
1915
- onClose: i,
1920
+ onClose: r,
1916
1921
  label: l.label,
1917
1922
  focus: s == null ? void 0 : s.focus
1918
1923
  }
@@ -1923,7 +1928,7 @@ function Et(e) {
1923
1928
  return Dn(e), /* @__PURE__ */ n(In, { ...e });
1924
1929
  }
1925
1930
  function gl({ leading: e, name: t, filter: l }) {
1926
- return /* @__PURE__ */ f("div", { className: "cms-list-head", children: [
1931
+ return /* @__PURE__ */ h("div", { className: "cms-list-head", children: [
1927
1932
  e != null ? /* @__PURE__ */ n("span", { className: "cms-list-head__leading", children: e }) : null,
1928
1933
  /* @__PURE__ */ n("h2", { className: "cms-list-head__name", title: t, children: t }),
1929
1934
  l !== void 0 ? /* @__PURE__ */ n(Et, { ...l }) : null
@@ -1940,72 +1945,72 @@ function Tt(e) {
1940
1945
  for (const l of e) l.overflow !== void 0 && l.overflow !== 0 && t.set(l.overflow, [...t.get(l.overflow) ?? [], l.id]);
1941
1946
  return [...t.entries()].sort(([l], [s]) => l - s).map(([, l]) => l);
1942
1947
  }
1943
- function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leading: i }) {
1948
+ function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leading: r }) {
1944
1949
  var q;
1945
- const h = t.filter((p) => p.entries === void 0 || p.entries.length > 0), d = O(null), u = O(null), b = O(null), [c, v] = D(kn), [m, N] = D(null), [r, g] = D("first"), [T, C] = D(null), [S, x] = D(null), _ = At(h), y = _.flat(), I = ((q = y.find((p) => p.primary === !0 && p.overflow !== 0)) == null ? void 0 : q.id) ?? null, U = Tt(h.filter((p) => p.id !== I)), P = y.filter((p) => p.overflow === 0), k = y.filter((p) => p.overflow !== 0), B = P.length === 1 ? P[0] ?? null : null, z = JSON.stringify([h.map((p) => [p.id, p.label, p.icon, p.group, p.overflow ?? null, p.primary === !0, p.entries !== void 0]), s ?? "", i !== void 0]), j = (p) => /* @__PURE__ */ new Set([...P.filter((L) => L !== B || p.size > 0).map((L) => L.id), ...p]), K = Ie(() => {
1946
- const p = d.current, L = u.current;
1947
- if (p === null || L === null) return;
1950
+ const m = t.filter((p) => p.entries === void 0 || p.entries.length > 0), c = z(null), d = z(null), b = z(null), [i, g] = I(kn), [u, k] = I(null), [f, x] = I("first"), [L, S] = I(null), [_, N] = I(null), v = At(m), w = v.flat(), T = ((q = w.find((p) => p.primary === !0 && p.overflow !== 0)) == null ? void 0 : q.id) ?? null, B = Tt(m.filter((p) => p.id !== T)), F = w.filter((p) => p.overflow === 0), M = w.filter((p) => p.overflow !== 0), R = F.length === 1 ? F[0] ?? null : null, U = JSON.stringify([m.map((p) => [p.id, p.label, p.icon, p.group, p.overflow ?? null, p.primary === !0, p.entries !== void 0]), s ?? "", r !== void 0]), j = (p) => /* @__PURE__ */ new Set([...F.filter((D) => D !== R || p.size > 0).map((D) => D.id), ...p]), K = Ie(() => {
1951
+ const p = c.current, D = d.current;
1952
+ if (p === null || D === null) return;
1948
1953
  const Z = getComputedStyle(p), ue = parseFloat(Z.columnGap || "0") || 0, ae = p.clientWidth - (parseFloat(Z.paddingLeft) || 0) - (parseFloat(Z.paddingRight) || 0), me = (A) => {
1949
- var M;
1950
- return ((M = L.querySelector(A)) == null ? void 0 : M.getBoundingClientRect().width) ?? 0;
1951
- }, Se = me('[data-measure="leading"]'), We = me('[data-measure="separator"]'), Fe = me('[data-measure="more"]'), Te = (A, M) => me(`[data-measure="${M ? "full" : "icon"}"][data-measure-action="${CSS.escape(A)}"]`), Ee = (A, M) => {
1952
- const H = j(M), le = B !== null && !H.has(B.id) ? B : null, J = _.map((He) => He.filter((V) => !H.has(V.id) && V !== le)).filter((He) => He.length > 0), ke = [...J.flat(), ...le !== null ? [le] : []], Re = ke.length + (J.length - 1) + (H.size > 0 ? 1 : 0) + (Se > 0 ? 1 : 0);
1953
- return Se + ke.reduce((He, V) => He + Te(V.id, !A.has(V.id)), 0) + We * Math.max(0, J.length - 1) + (H.size > 0 ? Fe : 0) + ue * Math.max(0, Re - 1);
1954
- }, R = k.filter((A) => A.id !== I && !U.some((M) => M.includes(A.id))).map((A) => A.id), X = [...U, ...[...R].reverse().map((A) => [A]), ...I !== null ? [[I]] : []], Ne = [...B !== null ? [[B.id]] : [], ...X];
1955
- let oe = null;
1956
- if (Ee(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= ae) oe = kn;
1954
+ var C;
1955
+ return ((C = D.querySelector(A)) == null ? void 0 : C.getBoundingClientRect().width) ?? 0;
1956
+ }, Se = me('[data-measure="leading"]'), We = me('[data-measure="separator"]'), Fe = me('[data-measure="more"]'), Te = (A, C) => me(`[data-measure="${C ? "full" : "icon"}"][data-measure-action="${CSS.escape(A)}"]`), Ee = (A, C) => {
1957
+ const P = j(C), le = R !== null && !P.has(R.id) ? R : null, J = v.map((He) => He.filter((V) => !P.has(V.id) && V !== le)).filter((He) => He.length > 0), ke = [...J.flat(), ...le !== null ? [le] : []], Re = ke.length + (J.length - 1) + (P.size > 0 ? 1 : 0) + (Se > 0 ? 1 : 0);
1958
+ return Se + ke.reduce((He, V) => He + Te(V.id, !A.has(V.id)), 0) + We * Math.max(0, J.length - 1) + (P.size > 0 ? Fe : 0) + ue * Math.max(0, Re - 1);
1959
+ }, O = M.filter((A) => A.id !== T && !B.some((C) => C.includes(A.id))).map((A) => A.id), X = [...B, ...[...O].reverse().map((A) => [A]), ...T !== null ? [[T]] : []], Ne = [...R !== null ? [[R.id]] : [], ...X];
1960
+ let ce = null;
1961
+ if (Ee(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= ae) ce = kn;
1957
1962
  else {
1958
1963
  const A = /* @__PURE__ */ new Set();
1959
- for (const M of Ne) {
1960
- for (const H of M) A.add(H);
1964
+ for (const C of Ne) {
1965
+ for (const P of C) A.add(P);
1961
1966
  if (Ee(A, /* @__PURE__ */ new Set()) <= ae) {
1962
- oe = { bare: A, hidden: /* @__PURE__ */ new Set() };
1967
+ ce = { bare: A, hidden: /* @__PURE__ */ new Set() };
1963
1968
  break;
1964
1969
  }
1965
1970
  }
1966
1971
  }
1967
- if (oe === null) {
1968
- const A = new Set(Ne.flat()), M = /* @__PURE__ */ new Set(), H = () => M.size + P.length >= 2;
1972
+ if (ce === null) {
1973
+ const A = new Set(Ne.flat()), C = /* @__PURE__ */ new Set(), P = () => C.size + F.length >= 2;
1969
1974
  for (const le of X) {
1970
- for (const J of le) M.add(J);
1971
- if (H() && Ee(A, M) <= ae) break;
1975
+ for (const J of le) C.add(J);
1976
+ if (P() && Ee(A, C) <= ae) break;
1972
1977
  }
1973
- H() || M.clear(), oe = { bare: A, hidden: M };
1978
+ P() || C.clear(), ce = { bare: A, hidden: C };
1974
1979
  }
1975
- const o = oe;
1976
- v((A) => xn(A.bare, o.bare) && xn(A.hidden, o.hidden) ? A : o);
1977
- }, [z]);
1980
+ const o = ce;
1981
+ g((A) => xn(A.bare, o.bare) && xn(A.hidden, o.hidden) ? A : o);
1982
+ }, [U]);
1978
1983
  $e(K, [K]), Q(() => {
1979
- const p = d.current;
1984
+ const p = c.current;
1980
1985
  if (p === null || typeof ResizeObserver > "u") return;
1981
- const L = new ResizeObserver(() => K());
1982
- return L.observe(p), () => L.disconnect();
1986
+ const D = new ResizeObserver(() => K());
1987
+ return D.observe(p), () => D.disconnect();
1983
1988
  }, [K]), Q(() => {
1984
1989
  const p = typeof document > "u" ? void 0 : document.fonts;
1985
1990
  if (p === void 0) return;
1986
- let L = !0;
1991
+ let D = !0;
1987
1992
  const Z = () => {
1988
- L && K();
1993
+ D && K();
1989
1994
  };
1990
1995
  return p.ready.then(Z), p.addEventListener("loadingdone", Z), () => {
1991
- L = !1, p.removeEventListener("loadingdone", Z);
1996
+ D = !1, p.removeEventListener("loadingdone", Z);
1992
1997
  };
1993
1998
  }, [K]);
1994
- const G = j(c.hidden), Y = B !== null && !G.has(B.id) ? B : null, ee = (p) => G.has(p.id) || p === Y, be = [..._.map((p) => p.filter((L) => !ee(L))).filter((p) => p.length > 0).flat(), ...Y !== null ? [Y] : []], ce = (p) => y.find((L) => L.id === p), de = [...U.flat(), ...k.filter((p) => p.id !== I && !U.some((L) => L.includes(p.id))).map((p) => p.id).reverse()], Ce = [
1995
- ...I !== null && c.hidden.has(I) ? [ce(I)] : [],
1996
- ...de.filter((p) => c.hidden.has(p)).map(ce),
1997
- ...G.size > 0 ? P : []
1998
- ].filter((p) => p !== void 0 && G.has(p.id)), fe = new Set(k.filter((p) => !U.some((L) => L.includes(p.id))).map((p) => p.id)), te = [...be.map((p) => p.id), ...Ce.length > 0 ? ["more"] : []], pe = T !== null && te.includes(T) ? T : te[0] ?? null, _e = (p) => {
1999
+ const G = j(i.hidden), Y = R !== null && !G.has(R.id) ? R : null, ee = (p) => G.has(p.id) || p === Y, be = [...v.map((p) => p.filter((D) => !ee(D))).filter((p) => p.length > 0).flat(), ...Y !== null ? [Y] : []], oe = (p) => w.find((D) => D.id === p), de = [...B.flat(), ...M.filter((p) => p.id !== T && !B.some((D) => D.includes(p.id))).map((p) => p.id).reverse()], Ce = [
2000
+ ...T !== null && i.hidden.has(T) ? [oe(T)] : [],
2001
+ ...de.filter((p) => i.hidden.has(p)).map(oe),
2002
+ ...G.size > 0 ? F : []
2003
+ ].filter((p) => p !== void 0 && G.has(p.id)), fe = new Set(M.filter((p) => !B.some((D) => D.includes(p.id))).map((p) => p.id)), te = [...be.map((p) => p.id), ...Ce.length > 0 ? ["more"] : []], pe = L !== null && te.includes(L) ? L : te[0] ?? null, _e = (p) => {
1999
2004
  var ae, me;
2000
- const L = te.indexOf(pe ?? "");
2005
+ const D = te.indexOf(pe ?? "");
2001
2006
  let Z = null;
2002
- if (p.key === "ArrowRight" ? Z = Math.min(te.length - 1, L + 1) : p.key === "ArrowLeft" ? Z = Math.max(0, L - 1) : p.key === "Home" ? Z = 0 : p.key === "End" ? Z = te.length - 1 : p.key === "Escape" && x(pe), Z === null) return;
2007
+ if (p.key === "ArrowRight" ? Z = Math.min(te.length - 1, D + 1) : p.key === "ArrowLeft" ? Z = Math.max(0, D - 1) : p.key === "Home" ? Z = 0 : p.key === "End" ? Z = te.length - 1 : p.key === "Escape" && N(pe), Z === null) return;
2003
2008
  p.preventDefault();
2004
2009
  const ue = te[Z] ?? null;
2005
- C(ue), (me = (ae = d.current) == null ? void 0 : ae.querySelector(`[data-stop="${CSS.escape(ue ?? "")}"]`)) == null || me.focus();
2010
+ S(ue), (me = (ae = c.current) == null ? void 0 : ae.querySelector(`[data-stop="${CSS.escape(ue ?? "")}"]`)) == null || me.focus();
2006
2011
  }, we = Ce.map((p) => ({
2007
2012
  id: p.id,
2008
- label: /* @__PURE__ */ f(ge, { children: [
2013
+ label: /* @__PURE__ */ h(ge, { children: [
2009
2014
  /* @__PURE__ */ n(je, { name: p.icon }),
2010
2015
  p.label
2011
2016
  ] }),
@@ -2018,12 +2023,12 @@ function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leadin
2018
2023
  l(p.id);
2019
2024
  return;
2020
2025
  }
2021
- const L = (Z = b.current) == null ? void 0 : Z.getBoundingClientRect();
2022
- g("first"), N({ which: p.id, x: (L == null ? void 0 : L.left) ?? 0, y: (L == null ? void 0 : L.bottom) ?? 0 });
2026
+ const D = (Z = b.current) == null ? void 0 : Z.getBoundingClientRect();
2027
+ x("first"), k({ which: p.id, x: (D == null ? void 0 : D.left) ?? 0, y: (D == null ? void 0 : D.bottom) ?? 0 });
2023
2028
  }
2024
- })), ne = m === null || m.which === "more" ? void 0 : y.find((p) => p.id === m.which), ye = ((ne == null ? void 0 : ne.entries) ?? []).map((p) => ({
2029
+ })), ne = u === null || u.which === "more" ? void 0 : w.find((p) => p.id === u.which), ye = ((ne == null ? void 0 : ne.entries) ?? []).map((p) => ({
2025
2030
  id: p.id,
2026
- label: /* @__PURE__ */ f(ge, { children: [
2031
+ label: /* @__PURE__ */ h(ge, { children: [
2027
2032
  p.icon !== void 0 ? /* @__PURE__ */ n(je, { name: p.icon }) : null,
2028
2033
  p.label
2029
2034
  ] }),
@@ -2032,49 +2037,49 @@ function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leadin
2032
2037
  onSelect: () => {
2033
2038
  p.disabled || l(p.id);
2034
2039
  }
2035
- })), w = (p, L, Z) => {
2036
- const ue = L.getBoundingClientRect();
2037
- g(Z), N({ which: p, x: ue.left, y: ue.bottom });
2038
- }, E = k.length + (B !== null ? 1 : 0), W = (p) => /* @__PURE__ */ n(
2040
+ })), y = (p, D, Z) => {
2041
+ const ue = D.getBoundingClientRect();
2042
+ x(Z), k({ which: p, x: ue.left, y: ue.bottom });
2043
+ }, E = M.length + (R !== null ? 1 : 0), W = (p) => /* @__PURE__ */ n(
2039
2044
  Lt,
2040
2045
  {
2041
2046
  action: p,
2042
- primary: p.id === I,
2043
- labels: !c.bare.has(p.id),
2047
+ primary: p.id === T,
2048
+ labels: !i.bare.has(p.id),
2044
2049
  overflowed: G.has(p.id),
2045
2050
  pinned: fe.has(p.id),
2046
2051
  tabbable: pe === p.id,
2047
- tipOff: S === p.id,
2048
- menuOpen: (m == null ? void 0 : m.which) === p.id,
2049
- onChoose: (L, Z) => {
2050
- p.entries === void 0 ? l(p.id) : (m == null ? void 0 : m.which) === p.id && Z === null ? N(null) : w(p.id, L, Z ?? "first");
2052
+ tipOff: _ === p.id,
2053
+ menuOpen: (u == null ? void 0 : u.which) === p.id,
2054
+ onChoose: (D, Z) => {
2055
+ p.entries === void 0 ? l(p.id) : (u == null ? void 0 : u.which) === p.id && Z === null ? k(null) : y(p.id, D, Z ?? "first");
2051
2056
  },
2052
2057
  onFocus: () => {
2053
- C(p.id), x(null);
2058
+ S(p.id), N(null);
2054
2059
  }
2055
2060
  },
2056
2061
  p.id
2057
2062
  );
2058
- return /* @__PURE__ */ f(
2063
+ return /* @__PURE__ */ h(
2059
2064
  "div",
2060
2065
  {
2061
- ref: d,
2066
+ ref: c,
2062
2067
  role: "toolbar",
2063
2068
  "aria-label": e,
2064
- className: F(
2069
+ className: H(
2065
2070
  "cms-pane-toolbar",
2066
- E > 0 && c.bare.size >= E && "cms-pane-toolbar--labels-hidden",
2067
- c.bare.size > 0 && c.bare.size < E && "cms-pane-toolbar--labels-partly-hidden"
2071
+ E > 0 && i.bare.size >= E && "cms-pane-toolbar--labels-hidden",
2072
+ i.bare.size > 0 && i.bare.size < E && "cms-pane-toolbar--labels-partly-hidden"
2068
2073
  ),
2069
2074
  onKeyDown: _e,
2070
2075
  children: [
2071
- i !== void 0 ? /* @__PURE__ */ n("div", { className: "cms-pane-toolbar__leading", children: i }) : null,
2072
- _.map((p, L) => {
2073
- const Z = p.filter((ae) => !ee(ae)), ue = _.slice(0, L).some((ae) => ae.some((me) => !ee(me)));
2074
- return /* @__PURE__ */ f("div", { className: "cms-pane-toolbar__group-wrap", children: [
2076
+ r !== void 0 ? /* @__PURE__ */ n("div", { className: "cms-pane-toolbar__leading", children: r }) : null,
2077
+ v.map((p, D) => {
2078
+ const Z = p.filter((ae) => !ee(ae)), ue = v.slice(0, D).some((ae) => ae.some((me) => !ee(me)));
2079
+ return /* @__PURE__ */ h("div", { className: "cms-pane-toolbar__group-wrap", children: [
2075
2080
  Z.length > 0 && ue ? /* @__PURE__ */ n("span", { className: "cms-pane-toolbar__separator", role: "separator", "aria-orientation": "vertical" }) : null,
2076
2081
  /* @__PURE__ */ n("div", { className: "cms-pane-toolbar__group", hidden: Z.length === 0, children: p.filter((ae) => ae !== Y).map((ae) => W(ae)) })
2077
- ] }, L);
2082
+ ] }, D);
2078
2083
  }),
2079
2084
  Y !== null ? /* @__PURE__ */ n("div", { className: "cms-pane-toolbar__group cms-pane-toolbar__lone", children: W(Y) }) : null,
2080
2085
  Ce.length > 0 ? /* @__PURE__ */ n(
@@ -2087,32 +2092,32 @@ function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leadin
2087
2092
  "aria-label": a,
2088
2093
  title: a,
2089
2094
  "aria-haspopup": "menu",
2090
- "aria-expanded": (m == null ? void 0 : m.which) === "more",
2095
+ "aria-expanded": (u == null ? void 0 : u.which) === "more",
2091
2096
  tabIndex: pe === "more" ? 0 : -1,
2092
- onFocus: () => C("more"),
2097
+ onFocus: () => S("more"),
2093
2098
  onClick: (p) => {
2094
- (m == null ? void 0 : m.which) === "more" ? N(null) : w("more", p.currentTarget, "first");
2099
+ (u == null ? void 0 : u.which) === "more" ? k(null) : y("more", p.currentTarget, "first");
2095
2100
  },
2096
2101
  onKeyDown: (p) => {
2097
- (p.key === "ArrowDown" || p.key === "ArrowUp") && (p.preventDefault(), p.stopPropagation(), w("more", p.currentTarget, p.key === "ArrowUp" ? "last" : "first"));
2102
+ (p.key === "ArrowDown" || p.key === "ArrowUp") && (p.preventDefault(), p.stopPropagation(), y("more", p.currentTarget, p.key === "ArrowUp" ? "last" : "first"));
2098
2103
  },
2099
2104
  children: /* @__PURE__ */ n($, { name: "more" })
2100
2105
  }
2101
2106
  ) : null,
2102
2107
  s !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-pane-toolbar__status", title: s, children: s }) : null,
2103
- /* @__PURE__ */ n(Ke, { at: (m == null ? void 0 : m.which) === "more" ? m : null, items: we, onClose: () => N(null), label: a, focus: r }),
2104
- /* @__PURE__ */ n(Ke, { at: ne !== void 0 ? m : null, items: ye, onClose: () => N(null), label: (ne == null ? void 0 : ne.label) ?? "", focus: r }),
2105
- /* @__PURE__ */ f("div", { ref: u, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
2106
- i !== void 0 ? /* @__PURE__ */ n("div", { "data-measure": "leading", children: i }) : null,
2108
+ /* @__PURE__ */ n(Ke, { at: (u == null ? void 0 : u.which) === "more" ? u : null, items: we, onClose: () => k(null), label: a, focus: f }),
2109
+ /* @__PURE__ */ n(Ke, { at: ne !== void 0 ? u : null, items: ye, onClose: () => k(null), label: (ne == null ? void 0 : ne.label) ?? "", focus: f }),
2110
+ /* @__PURE__ */ h("div", { ref: d, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
2111
+ r !== void 0 ? /* @__PURE__ */ n("div", { "data-measure": "leading", children: r }) : null,
2107
2112
  /* @__PURE__ */ n("span", { "data-measure": "separator", className: "cms-pane-toolbar__separator" }),
2108
2113
  /* @__PURE__ */ n("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ n($, { name: "more" }) }),
2109
- y.map((p) => /* @__PURE__ */ f("span", { children: [
2110
- /* @__PURE__ */ f("span", { "data-measure": "full", "data-measure-action": p.id, className: F("cms-pane-toolbar__action", p.entries !== void 0 && "cms-pane-toolbar__action--menu"), children: [
2114
+ w.map((p) => /* @__PURE__ */ h("span", { children: [
2115
+ /* @__PURE__ */ h("span", { "data-measure": "full", "data-measure-action": p.id, className: H("cms-pane-toolbar__action", p.entries !== void 0 && "cms-pane-toolbar__action--menu"), children: [
2111
2116
  /* @__PURE__ */ n(je, { name: p.icon }),
2112
2117
  /* @__PURE__ */ n("span", { className: "cms-pane-toolbar__label", children: p.label }),
2113
2118
  p.entries !== void 0 ? /* @__PURE__ */ n(ln, {}) : null
2114
2119
  ] }),
2115
- /* @__PURE__ */ f("span", { "data-measure": "icon", "data-measure-action": p.id, className: F("cms-pane-toolbar__action", Be(p.icon) !== null && "cms-pane-toolbar__action--bare", p.entries !== void 0 && "cms-pane-toolbar__action--menu"), children: [
2120
+ /* @__PURE__ */ h("span", { "data-measure": "icon", "data-measure-action": p.id, className: H("cms-pane-toolbar__action", Be(p.icon) !== null && "cms-pane-toolbar__action--bare", p.entries !== void 0 && "cms-pane-toolbar__action--menu"), children: [
2116
2121
  Be(p.icon) !== null ? /* @__PURE__ */ n(je, { name: p.icon }) : /* @__PURE__ */ n("span", { className: "cms-pane-toolbar__label", children: p.label }),
2117
2122
  p.entries !== void 0 ? /* @__PURE__ */ n(ln, {}) : null
2118
2123
  ] })
@@ -2123,22 +2128,22 @@ function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leadin
2123
2128
  );
2124
2129
  }
2125
2130
  const Pe = "tip";
2126
- function Lt({ action: e, primary: t, labels: l, overflowed: s, pinned: a, tabbable: i, tipOff: h, menuOpen: d, onChoose: u, onFocus: b }) {
2127
- const [c, v] = D(!1);
2131
+ function Lt({ action: e, primary: t, labels: l, overflowed: s, pinned: a, tabbable: r, tipOff: m, menuOpen: c, onChoose: d, onFocus: b }) {
2132
+ const [i, g] = I(!1);
2128
2133
  Q(() => {
2129
2134
  if (!e.busy) {
2130
- v(!1);
2135
+ g(!1);
2131
2136
  return;
2132
2137
  }
2133
- const y = setTimeout(() => v(!0), en);
2134
- return () => clearTimeout(y);
2138
+ const w = setTimeout(() => g(!0), en);
2139
+ return () => clearTimeout(w);
2135
2140
  }, [e.busy]);
2136
- const m = Be(e.icon) === null, N = l || m, r = e.disabled && e.reason ? e.reason : null, g = r ?? (N ? null : e.label), T = he(), [C, S] = D(!1), x = dn(), _ = e.entries !== void 0;
2137
- return /* @__PURE__ */ f(
2141
+ const u = Be(e.icon) === null, k = l || u, f = e.disabled && e.reason ? e.reason : null, x = f ?? (k ? null : e.label), L = he(), [S, _] = I(!1), N = dn(), v = e.entries !== void 0;
2142
+ return /* @__PURE__ */ h(
2138
2143
  "button",
2139
2144
  {
2140
2145
  type: "button",
2141
- className: F("cms-pane-toolbar__action", t && "cms-pane-toolbar__action--primary", !N && "cms-pane-toolbar__action--bare", m && "cms-pane-toolbar__action--text", _ && "cms-pane-toolbar__action--menu", e.danger && "is-danger"),
2146
+ className: H("cms-pane-toolbar__action", t && "cms-pane-toolbar__action--primary", !k && "cms-pane-toolbar__action--bare", u && "cms-pane-toolbar__action--text", v && "cms-pane-toolbar__action--menu", e.danger && "is-danger"),
2142
2147
  "data-action": e.id,
2143
2148
  "data-stop": e.id,
2144
2149
  ...s ? { "data-overflowed": "" } : {},
@@ -2147,30 +2152,30 @@ function Lt({ action: e, primary: t, labels: l, overflowed: s, pinned: a, tabbab
2147
2152
  "aria-label": e.label,
2148
2153
  "aria-disabled": e.disabled || void 0,
2149
2154
  "aria-busy": e.busy || void 0,
2150
- ..._ ? { "aria-haspopup": "menu", "aria-expanded": d } : {},
2151
- ...r === null ? {} : { "aria-describedby": T },
2152
- ...C && r !== null ? { "data-reason-shown": "" } : {},
2153
- ...x.dismissed(Pe) ? { "data-tip-dismissed": "" } : {},
2154
- tabIndex: i ? 0 : -1,
2155
+ ...v ? { "aria-haspopup": "menu", "aria-expanded": c } : {},
2156
+ ...f === null ? {} : { "aria-describedby": L },
2157
+ ...S && f !== null ? { "data-reason-shown": "" } : {},
2158
+ ...N.dismissed(Pe) ? { "data-tip-dismissed": "" } : {},
2159
+ tabIndex: r ? 0 : -1,
2155
2160
  onFocus: () => {
2156
- b(), x.focusIn(Pe);
2161
+ b(), N.focusIn(Pe);
2157
2162
  },
2158
2163
  onBlur: () => {
2159
- S(!1), x.focusOut(Pe);
2164
+ _(!1), N.focusOut(Pe);
2160
2165
  },
2161
- onMouseEnter: () => x.pointerIn(Pe),
2162
- onMouseLeave: () => x.pointerOut(Pe),
2163
- onKeyDown: (y) => {
2164
- y.key === "Escape" && (S(!1), x.dismiss(Pe)), _ && (y.key === "ArrowDown" || y.key === "ArrowUp") && (y.preventDefault(), r !== null ? S(!0) : !e.disabled && !e.busy && u(y.currentTarget, y.key === "ArrowUp" ? "last" : "first"));
2166
+ onMouseEnter: () => N.pointerIn(Pe),
2167
+ onMouseLeave: () => N.pointerOut(Pe),
2168
+ onKeyDown: (w) => {
2169
+ w.key === "Escape" && (_(!1), N.dismiss(Pe)), v && (w.key === "ArrowDown" || w.key === "ArrowUp") && (w.preventDefault(), f !== null ? _(!0) : !e.disabled && !e.busy && d(w.currentTarget, w.key === "ArrowUp" ? "last" : "first"));
2165
2170
  },
2166
- onClick: (y) => {
2167
- r !== null ? (S(!0), x.show(Pe)) : !e.disabled && !e.busy && u(y.currentTarget, null);
2171
+ onClick: (w) => {
2172
+ f !== null ? (_(!0), N.show(Pe)) : !e.disabled && !e.busy && d(w.currentTarget, null);
2168
2173
  },
2169
2174
  children: [
2170
- c ? /* @__PURE__ */ n(se, { name: "spinner" }) : /* @__PURE__ */ n(je, { name: e.icon }),
2171
- N ? /* @__PURE__ */ n("span", { className: "cms-pane-toolbar__label", "aria-hidden": "true", children: e.label }) : null,
2172
- _ ? /* @__PURE__ */ n(ln, {}) : null,
2173
- r !== null || g !== null && !h ? /* @__PURE__ */ n("span", { className: "cms-pane-toolbar__tip", role: "tooltip", id: T, children: g }) : null
2175
+ i ? /* @__PURE__ */ n(se, { name: "spinner" }) : /* @__PURE__ */ n(je, { name: e.icon }),
2176
+ k ? /* @__PURE__ */ n("span", { className: "cms-pane-toolbar__label", "aria-hidden": "true", children: e.label }) : null,
2177
+ v ? /* @__PURE__ */ n(ln, {}) : null,
2178
+ f !== null || x !== null && !m ? /* @__PURE__ */ n("span", { className: "cms-pane-toolbar__tip", role: "tooltip", id: L, children: x }) : null
2174
2179
  ]
2175
2180
  }
2176
2181
  );
@@ -2182,31 +2187,31 @@ function je({ name: e }) {
2182
2187
  const t = Be(e);
2183
2188
  return t === null ? null : /* @__PURE__ */ n($, { name: t, size: 18 });
2184
2189
  }
2185
- function yl({ title: e, body: t = null, time: l = null, unread: s, unreadLabel: a, expandLabel: i, collapseLabel: h, action: d = null, onRead: u, leading: b }) {
2186
- const [c, v] = D(!1), m = he(), N = () => {
2187
- s && u();
2188
- }, r = (d == null ? void 0 : d.presentation) === "row" && d.onAction !== void 0, g = (d == null ? void 0 : d.presentation) === "button" && d.onAction !== void 0 ? d : null, T = () => {
2189
- var C;
2190
- N(), r && ((C = d.onAction) == null || C.call(d));
2190
+ function yl({ title: e, body: t = null, time: l = null, unread: s, unreadLabel: a, expandLabel: r, collapseLabel: m, action: c = null, onRead: d, leading: b }) {
2191
+ const [i, g] = I(!1), u = he(), k = () => {
2192
+ s && d();
2193
+ }, f = (c == null ? void 0 : c.presentation) === "row" && c.onAction !== void 0, x = (c == null ? void 0 : c.presentation) === "button" && c.onAction !== void 0 ? c : null, L = () => {
2194
+ var S;
2195
+ k(), f && ((S = c.onAction) == null || S.call(c));
2191
2196
  };
2192
- return /* @__PURE__ */ f("article", { className: F("cms-notification", s && "is-unread", c && "is-expanded", r && "is-row-action"), "data-state": s ? "unread" : "read", children: [
2193
- /* @__PURE__ */ f(
2197
+ return /* @__PURE__ */ h("article", { className: H("cms-notification", s && "is-unread", i && "is-expanded", f && "is-row-action"), "data-state": s ? "unread" : "read", children: [
2198
+ /* @__PURE__ */ h(
2194
2199
  "div",
2195
2200
  {
2196
2201
  className: "cms-notification__row",
2197
2202
  role: "button",
2198
2203
  tabIndex: 0,
2199
- "aria-describedby": t === null ? void 0 : m,
2200
- onClick: T,
2201
- onKeyDown: (C) => {
2202
- C.target !== C.currentTarget || C.key !== "Enter" && C.key !== " " || (C.preventDefault(), T());
2204
+ "aria-describedby": t === null ? void 0 : u,
2205
+ onClick: L,
2206
+ onKeyDown: (S) => {
2207
+ S.target !== S.currentTarget || S.key !== "Enter" && S.key !== " " || (S.preventDefault(), L());
2203
2208
  },
2204
2209
  children: [
2205
2210
  b != null ? /* @__PURE__ */ n("span", { className: "cms-notification__leading", children: b }) : null,
2206
- /* @__PURE__ */ f("span", { className: "cms-notification__text", children: [
2207
- /* @__PURE__ */ f("span", { className: "cms-notification__head", children: [
2208
- /* @__PURE__ */ f("span", { className: "cms-notification__title", children: [
2209
- s ? /* @__PURE__ */ f("span", { className: "cms-visually-hidden", children: [
2211
+ /* @__PURE__ */ h("span", { className: "cms-notification__text", children: [
2212
+ /* @__PURE__ */ h("span", { className: "cms-notification__head", children: [
2213
+ /* @__PURE__ */ h("span", { className: "cms-notification__title", children: [
2214
+ s ? /* @__PURE__ */ h("span", { className: "cms-visually-hidden", children: [
2210
2215
  a,
2211
2216
  " "
2212
2217
  ] }) : null,
@@ -2214,7 +2219,7 @@ function yl({ title: e, body: t = null, time: l = null, unread: s, unreadLabel:
2214
2219
  ] }),
2215
2220
  l !== null ? /* @__PURE__ */ n("span", { className: "cms-notification__time", children: l }) : null
2216
2221
  ] }),
2217
- t !== null && t !== "" ? /* @__PURE__ */ n("span", { className: "cms-notification__body", id: m, children: t }) : null
2222
+ t !== null && t !== "" ? /* @__PURE__ */ n("span", { className: "cms-notification__body", id: u, children: t }) : null
2218
2223
  ] }),
2219
2224
  s ? /* @__PURE__ */ n("span", { className: "cms-notification__dot", "aria-hidden": "true" }) : null
2220
2225
  ]
@@ -2225,26 +2230,26 @@ function yl({ title: e, body: t = null, time: l = null, unread: s, unreadLabel:
2225
2230
  {
2226
2231
  type: "button",
2227
2232
  className: "cms-notification__chevron",
2228
- "aria-expanded": c,
2229
- "aria-controls": m,
2230
- "aria-label": c ? h : i,
2231
- title: c ? h : i,
2233
+ "aria-expanded": i,
2234
+ "aria-controls": u,
2235
+ "aria-label": i ? m : r,
2236
+ title: i ? m : r,
2232
2237
  onClick: () => {
2233
- c || N(), v((C) => !C);
2238
+ i || k(), g((S) => !S);
2234
2239
  },
2235
2240
  children: /* @__PURE__ */ n($, { name: "chevron-down", size: 18 })
2236
2241
  }
2237
2242
  ) : null,
2238
- g !== null ? /* @__PURE__ */ n(
2243
+ x !== null ? /* @__PURE__ */ n(
2239
2244
  "button",
2240
2245
  {
2241
2246
  type: "button",
2242
2247
  className: "cms-button cms-notification__action",
2243
2248
  onClick: () => {
2244
- var C;
2245
- N(), (C = g.onAction) == null || C.call(g);
2249
+ var S;
2250
+ k(), (S = x.onAction) == null || S.call(x);
2246
2251
  },
2247
- children: g.label
2252
+ children: x.label
2248
2253
  }
2249
2254
  ) : null
2250
2255
  ] });
@@ -2287,26 +2292,26 @@ function xl() {
2287
2292
  window.dispatchEvent(new Event(sn));
2288
2293
  }
2289
2294
  function Ml(e) {
2290
- const [t, l] = D(void 0), [s, a] = D(void 0), [i, h] = D(!0), d = O(e);
2291
- d.current = e;
2292
- const u = O(0), b = Ie(() => {
2293
- const c = ++u.current;
2294
- h(!0), d.current().then(
2295
- (v) => {
2296
- c === u.current && (l(v), a(void 0), h(!1));
2295
+ const [t, l] = I(void 0), [s, a] = I(void 0), [r, m] = I(!0), c = z(e);
2296
+ c.current = e;
2297
+ const d = z(0), b = Ie(() => {
2298
+ const i = ++d.current;
2299
+ m(!0), c.current().then(
2300
+ (g) => {
2301
+ i === d.current && (l(g), a(void 0), m(!1));
2297
2302
  },
2298
- (v) => {
2299
- c === u.current && (a(v), h(!1));
2303
+ (g) => {
2304
+ i === d.current && (a(g), m(!1));
2300
2305
  }
2301
2306
  );
2302
2307
  }, []);
2303
2308
  return Q(() => {
2304
2309
  b();
2305
- const c = () => b();
2306
- return window.addEventListener("focus", c), window.addEventListener(sn, c), () => {
2307
- window.removeEventListener("focus", c), window.removeEventListener(sn, c);
2310
+ const i = () => b();
2311
+ return window.addEventListener("focus", i), window.addEventListener(sn, i), () => {
2312
+ window.removeEventListener("focus", i), window.removeEventListener(sn, i);
2308
2313
  };
2309
- }, [b]), { value: t, error: s, loading: i, reread: b };
2314
+ }, [b]), { value: t, error: s, loading: r, reread: b };
2310
2315
  }
2311
2316
  function Cl(e) {
2312
2317
  return e === 412 ? { conflict: !0, message: "Someone changed this since you opened it. Nothing was saved; read it again to see the change." } : { conflict: !1 };
@@ -2315,8 +2320,8 @@ const Bt = "/errors/client-update-required";
2315
2320
  function Ft(e, t) {
2316
2321
  const l = e.split(".").map((a) => Number.parseInt(a, 10) || 0), s = t.split(".").map((a) => Number.parseInt(a, 10) || 0);
2317
2322
  for (let a = 0; a < Math.max(l.length, s.length); a++) {
2318
- const i = l[a] ?? 0, h = s[a] ?? 0;
2319
- if (i !== h) return i < h;
2323
+ const r = l[a] ?? 0, m = s[a] ?? 0;
2324
+ if (r !== m) return r < m;
2320
2325
  }
2321
2326
  return !1;
2322
2327
  }
@@ -2330,129 +2335,129 @@ function Ht(e, t, l) {
2330
2335
  }
2331
2336
  const Ot = 800, Pt = /* @__PURE__ */ new Set(["ArrowDown", "ArrowUp", "PageDown", "PageUp", "Home", "End", " "]);
2332
2337
  function zt(e, t) {
2333
- const [l, s] = D(!1);
2338
+ const [l, s] = I(!1);
2334
2339
  return Q(() => {
2335
2340
  const a = e.current;
2336
2341
  if (a === null || !t) {
2337
2342
  s(!1);
2338
2343
  return;
2339
2344
  }
2340
- const i = /* @__PURE__ */ new WeakMap();
2341
- let h = Number.NEGATIVE_INFINITY, d = null;
2342
- const u = (m) => {
2343
- h = performance.now(), d = m.target;
2344
- }, b = (m) => {
2345
- const N = m.target;
2346
- !(N instanceof HTMLElement && (N.isContentEditable || N.closest("input, textarea, select") !== null)) && Pt.has(m.key) && u(m);
2347
- }, c = (m) => {
2348
- const N = m.target;
2349
- if (!(N instanceof HTMLElement)) return;
2350
- const r = N.scrollTop, g = i.get(N) ?? 0;
2351
- if (i.set(N, r), r <= 0) {
2345
+ const r = /* @__PURE__ */ new WeakMap();
2346
+ let m = Number.NEGATIVE_INFINITY, c = null;
2347
+ const d = (u) => {
2348
+ m = performance.now(), c = u.target;
2349
+ }, b = (u) => {
2350
+ const k = u.target;
2351
+ !(k instanceof HTMLElement && (k.isContentEditable || k.closest("input, textarea, select") !== null)) && Pt.has(u.key) && d(u);
2352
+ }, i = (u) => {
2353
+ const k = u.target;
2354
+ if (!(k instanceof HTMLElement)) return;
2355
+ const f = k.scrollTop, x = r.get(k) ?? 0;
2356
+ if (r.set(k, f), f <= 0) {
2352
2357
  s(!1);
2353
2358
  return;
2354
2359
  }
2355
- performance.now() - h > Ot || !(d === a || d === document.body || d instanceof Node && N.contains(d)) || (r < g - Mn ? s(!1) : r > g + Mn && r > Rt && Ht(a, N, r) && s(!0));
2356
- }, v = [["wheel", u], ["touchmove", u], ["pointerdown", u], ["keydown", b]];
2357
- for (const [m, N] of v) a.addEventListener(m, N, { capture: !0, passive: !0 });
2358
- return a.addEventListener("scroll", c, { capture: !0, passive: !0 }), () => {
2359
- for (const [m, N] of v) a.removeEventListener(m, N, { capture: !0 });
2360
- a.removeEventListener("scroll", c, { capture: !0 });
2360
+ performance.now() - m > Ot || !(c === a || c === document.body || c instanceof Node && k.contains(c)) || (f < x - Mn ? s(!1) : f > x + Mn && f > Rt && Ht(a, k, f) && s(!0));
2361
+ }, g = [["wheel", d], ["touchmove", d], ["pointerdown", d], ["keydown", b]];
2362
+ for (const [u, k] of g) a.addEventListener(u, k, { capture: !0, passive: !0 });
2363
+ return a.addEventListener("scroll", i, { capture: !0, passive: !0 }), () => {
2364
+ for (const [u, k] of g) a.removeEventListener(u, k, { capture: !0 });
2365
+ a.removeEventListener("scroll", i, { capture: !0 });
2361
2366
  };
2362
2367
  }, [e, t]), [l, s];
2363
2368
  }
2364
2369
  const Ut = 64;
2365
- function Kt({ bar: e, leading: t, gap: l, icon: s, iconGap: a, search: i, more: h, globals: d, name: u, choice: b }) {
2366
- const c = [...i ? [s] : [], s, s, ...d], v = c.reduce((N, r) => N + r, 0) + a * (c.length - 1);
2367
- return e - (t > 0 ? t + l : 0) - l - v + 0.01 < Math.min(Ut, u) + b;
2370
+ function Kt({ bar: e, leading: t, gap: l, icon: s, iconGap: a, search: r, more: m, globals: c, name: d, choice: b }) {
2371
+ const i = [...r ? [s] : [], s, s, ...c], g = i.reduce((k, f) => k + f, 0) + a * (i.length - 1);
2372
+ return e - (t > 0 ? t + l : 0) - l - g + 0.01 < Math.min(Ut, d) + b;
2368
2373
  }
2369
- function El({ title: e, back: t, navigation: l, search: s, searching: a, more: i = [], moreLabel: h = "More actions", globals: d, filter: u, primary: b, onRefresh: c, pullText: v, barHidden: m, children: N }) {
2374
+ function El({ title: e, back: t, navigation: l, search: s, searching: a, more: r = [], moreLabel: m = "More actions", globals: c, filter: d, primary: b, onRefresh: i, pullText: g, barHidden: u, children: k }) {
2370
2375
  var Te, Ee;
2371
- const r = b === void 0 || ("menu" in b ? !b.menu.some((R) => R.offer.offered) : ((Te = b.offer) == null ? void 0 : Te.offered) === !1) ? void 0 : b, g = r !== void 0 && !("menu" in r) ? ((Ee = r.offer) == null ? void 0 : Ee.refusal) ?? null : null, T = he(), [C, S] = D(!1), x = dn(), _ = O(null), y = O(null), [I, U] = D(!1), [P, k] = D(null), [B, z] = D(null), j = Ie(() => z(null), []), K = O(!1), G = O(null), Y = O(null), ee = O(null), ie = i.some((R) => R.offer.offered), be = B !== null && ie && a === void 0;
2372
- Dn(u);
2373
- const ce = u === void 0 ? null : An(u), [de, Ce] = D(!1), fe = O(!1), te = O(!1), pe = O(null), _e = u === void 0 ? void 0 : {
2374
- ...u,
2375
- onChange: (R) => {
2376
- fe.current = !0, u.onChange(R);
2376
+ const f = b === void 0 || ("menu" in b ? !b.menu.some((O) => O.offer.offered) : ((Te = b.offer) == null ? void 0 : Te.offered) === !1) ? void 0 : b, x = f !== void 0 && !("menu" in f) ? ((Ee = f.offer) == null ? void 0 : Ee.refusal) ?? null : null, L = he(), [S, _] = I(!1), N = dn(), v = z(null), w = z(null), [T, B] = I(!1), [F, M] = I(null), [R, U] = I(null), j = Ie(() => U(null), []), K = z(!1), G = z(null), Y = z(null), ee = z(null), ie = r.some((O) => O.offer.offered), be = R !== null && ie && a === void 0;
2377
+ Dn(d);
2378
+ const oe = d === void 0 ? null : An(d), [de, Ce] = I(!1), fe = z(!1), te = z(!1), pe = z(null), _e = d === void 0 ? void 0 : {
2379
+ ...d,
2380
+ onChange: (O) => {
2381
+ fe.current = !0, d.onChange(O);
2377
2382
  }
2378
- }, we = ce === null ? "" : ` · ${ce.label}`, ne = u !== void 0 && u.options.length >= 2, [ye, w] = D(!1), E = ne && ie && ye, W = JSON.stringify([ne, ie, E, s !== void 0, a !== void 0, t !== void 0, e, we]), q = Ie(() => {
2379
- const R = G.current, X = Y.current, Ne = ee.current;
2380
- if (R === null || X === null || Ne === null || !ne) return null;
2381
- const oe = (J) => parseFloat(J) || 0, o = getComputedStyle(R), A = R.getBoundingClientRect().width;
2383
+ }, we = oe === null ? "" : ` · ${oe.label}`, ne = d !== void 0 && d.options.length >= 2, [ye, y] = I(!1), E = ne && ie && ye, W = JSON.stringify([ne, ie, E, s !== void 0, a !== void 0, t !== void 0, e, we]), q = Ie(() => {
2384
+ const O = G.current, X = Y.current, Ne = ee.current;
2385
+ if (O === null || X === null || Ne === null || !ne) return null;
2386
+ const ce = (J) => parseFloat(J) || 0, o = getComputedStyle(O), A = O.getBoundingClientRect().width;
2382
2387
  if (A === 0) return null;
2383
- const M = (J) => {
2388
+ const C = (J) => {
2384
2389
  var ke;
2385
- return ((ke = R.querySelector(`.cms-screen__ruler > [data-ruler="${J}"]`)) == null ? void 0 : ke.getBoundingClientRect().width) ?? 0;
2386
- }, H = R.querySelector(".cms-screen__leading"), le = (s !== void 0 ? 1 : 0) + (E ? 0 : 1) + 1;
2390
+ return ((ke = O.querySelector(`.cms-screen__ruler > [data-ruler="${J}"]`)) == null ? void 0 : ke.getBoundingClientRect().width) ?? 0;
2391
+ }, P = O.querySelector(".cms-screen__leading"), le = (s !== void 0 ? 1 : 0) + (E ? 0 : 1) + 1;
2387
2392
  return Kt({
2388
- bar: A - oe(o.paddingLeft) - oe(o.paddingRight),
2389
- leading: H === null || H.childNodes.length === 0 ? 0 : oe(getComputedStyle(H).minWidth),
2390
- gap: oe(o.columnGap),
2393
+ bar: A - ce(o.paddingLeft) - ce(o.paddingRight),
2394
+ leading: P === null || P.childNodes.length === 0 ? 0 : ce(getComputedStyle(P).minWidth),
2395
+ gap: ce(o.columnGap),
2391
2396
  icon: Ne.getBoundingClientRect().width,
2392
- iconGap: oe(getComputedStyle(X).columnGap),
2397
+ iconGap: ce(getComputedStyle(X).columnGap),
2393
2398
  search: s !== void 0,
2394
2399
  more: !0,
2395
2400
  globals: Array.from(X.children).slice(le).map((J) => J.getBoundingClientRect().width),
2396
- name: M("name"),
2397
- choice: M("choice")
2401
+ name: C("name"),
2402
+ choice: C("choice")
2398
2403
  });
2399
2404
  }, [W]);
2400
2405
  $e(() => {
2401
- const R = q() ?? ye;
2402
- R !== ye && fe.current && (te.current = !0), fe.current = !1, w(R);
2406
+ const O = q() ?? ye;
2407
+ O !== ye && fe.current && (te.current = !0), fe.current = !1, y(O);
2403
2408
  }, [q]), Q(() => {
2404
2409
  if (G.current === null || typeof ResizeObserver > "u") return;
2405
- const R = new ResizeObserver(() => {
2410
+ const O = new ResizeObserver(() => {
2406
2411
  const X = q();
2407
- X !== null && w(X);
2412
+ X !== null && y(X);
2408
2413
  });
2409
- for (const X of [G.current, Y.current, ...G.current.querySelectorAll(".cms-screen__ruler > span")]) X !== null && R.observe(X);
2410
- return () => R.disconnect();
2414
+ for (const X of [G.current, Y.current, ...G.current.querySelectorAll(".cms-screen__ruler > span")]) X !== null && O.observe(X);
2415
+ return () => O.disconnect();
2411
2416
  }, [q]);
2412
- const p = O(E);
2417
+ const p = z(E);
2413
2418
  $e(() => {
2414
- var Ne, oe, o;
2419
+ var Ne, ce, o;
2415
2420
  if (p.current === E) return;
2416
- p.current = E, z(null);
2417
- const R = document.activeElement;
2418
- (R === document.body && pe.current !== null && !pe.current.isConnected || te.current && (R === document.body || ((Ne = G.current) == null ? void 0 : Ne.contains(R)) === !0)) && ((o = E ? ee.current : (oe = Y.current) == null ? void 0 : oe.querySelector(".cms-filter-menu")) == null || o.focus()), te.current = !1;
2421
+ p.current = E, U(null);
2422
+ const O = document.activeElement;
2423
+ (O === document.body && pe.current !== null && !pe.current.isConnected || te.current && (O === document.body || ((Ne = G.current) == null ? void 0 : Ne.contains(O)) === !0)) && ((o = E ? ee.current : (ce = Y.current) == null ? void 0 : ce.querySelector(".cms-filter-menu")) == null || o.focus()), te.current = !1;
2419
2424
  }, [E]);
2420
- const L = E && ce !== null && u !== void 0 ? `${h}, ${Tn(u)}` : h, ue = dt(y, c === void 0 ? null : () => {
2421
- I || (U(!0), c().finally(() => U(!1)));
2422
- }), ae = c === void 0 ? null : { distance: ue, refreshing: I, text: v ?? null }, me = a !== void 0 || ue > 0 || I || be || de, [Se, We] = zt(_, m === void 0 && !me), Fe = !me && (m ?? Se);
2423
- return /* @__PURE__ */ f(
2425
+ const D = E && oe !== null && d !== void 0 ? `${m}, ${Tn(d)}` : m, ue = dt(w, i === void 0 ? null : () => {
2426
+ T || (B(!0), i().finally(() => B(!1)));
2427
+ }), ae = i === void 0 ? null : { distance: ue, refreshing: T, text: g ?? null }, me = a !== void 0 || ue > 0 || T || be || de, [Se, We] = zt(v, u === void 0 && !me), Fe = !me && (u ?? Se);
2428
+ return /* @__PURE__ */ h(
2424
2429
  "div",
2425
2430
  {
2426
- ref: _,
2427
- className: F("cms-screen", r !== void 0 && "cms-screen--with-primary"),
2431
+ ref: v,
2432
+ className: H("cms-screen", f !== void 0 && "cms-screen--with-primary"),
2428
2433
  "data-bar-hidden": Fe ? "" : void 0,
2429
- onFocus: (R) => {
2430
- pe.current = R.target, Fe && R.target instanceof Element && R.target.closest(".cms-screen__bar") !== null && We(!1);
2434
+ onFocus: (O) => {
2435
+ pe.current = O.target, Fe && O.target instanceof Element && O.target.closest(".cms-screen__bar") !== null && We(!1);
2431
2436
  },
2432
2437
  children: [
2433
- a !== void 0 ? /* @__PURE__ */ f("header", { className: "cms-screen__bar cms-screen__bar--searching", children: [
2438
+ a !== void 0 ? /* @__PURE__ */ h("header", { className: "cms-screen__bar cms-screen__bar--searching", children: [
2434
2439
  /* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": a.closeLabel, title: a.closeLabel, onClick: a.onClose, children: /* @__PURE__ */ n($, { name: "chevron-left" }) }),
2435
2440
  /* @__PURE__ */ n("div", { className: "cms-screen__search", children: a.field })
2436
- ] }) : /* @__PURE__ */ f("header", { ref: G, className: "cms-screen__bar", children: [
2437
- /* @__PURE__ */ n("div", { className: "cms-screen__leading", children: t !== void 0 ? t.href !== void 0 ? /* @__PURE__ */ f("a", { className: "cms-screen__back", href: t.href, onClick: t.onBack, children: [
2441
+ ] }) : /* @__PURE__ */ h("header", { ref: G, className: "cms-screen__bar", children: [
2442
+ /* @__PURE__ */ n("div", { className: "cms-screen__leading", children: t !== void 0 ? t.href !== void 0 ? /* @__PURE__ */ h("a", { className: "cms-screen__back", href: t.href, onClick: t.onBack, children: [
2438
2443
  /* @__PURE__ */ n($, { name: "chevron-left" }),
2439
2444
  /* @__PURE__ */ n("span", { className: "cms-screen__back-name", children: t.label })
2440
- ] }) : /* @__PURE__ */ f("button", { type: "button", className: "cms-screen__back", onClick: t.onBack, children: [
2445
+ ] }) : /* @__PURE__ */ h("button", { type: "button", className: "cms-screen__back", onClick: t.onBack, children: [
2441
2446
  /* @__PURE__ */ n($, { name: "chevron-left" }),
2442
2447
  /* @__PURE__ */ n("span", { className: "cms-screen__back-name", children: t.label })
2443
2448
  ] }) : l }),
2444
- ce === null ? /* @__PURE__ */ n("h1", { className: "cms-screen__title", title: e, children: e }) : /* @__PURE__ */ f("h1", { className: "cms-screen__title cms-screen__title--filtered", title: e + we, children: [
2445
- /* @__PURE__ */ f("span", { className: "cms-screen__title-place", children: [
2449
+ oe === null ? /* @__PURE__ */ n("h1", { className: "cms-screen__title", title: e, children: e }) : /* @__PURE__ */ h("h1", { className: "cms-screen__title cms-screen__title--filtered", title: e + we, children: [
2450
+ /* @__PURE__ */ h("span", { className: "cms-screen__title-place", children: [
2446
2451
  /* @__PURE__ */ n("span", { className: "cms-screen__title-name", children: e }),
2447
2452
  /* @__PURE__ */ n("span", { className: "cms-screen__title-dot", children: " · " })
2448
2453
  ] }),
2449
- /* @__PURE__ */ n("span", { className: "cms-screen__title-choice", children: ce.label })
2454
+ /* @__PURE__ */ n("span", { className: "cms-screen__title-choice", children: oe.label })
2450
2455
  ] }),
2451
- ne && ie ? /* @__PURE__ */ f("span", { className: "cms-screen__ruler", "aria-hidden": "true", children: [
2456
+ ne && ie ? /* @__PURE__ */ h("span", { className: "cms-screen__ruler", "aria-hidden": "true", children: [
2452
2457
  /* @__PURE__ */ n("span", { "data-ruler": "name", children: e }),
2453
- ce !== null ? /* @__PURE__ */ n("span", { "data-ruler": "choice", children: we }) : null
2458
+ oe !== null ? /* @__PURE__ */ n("span", { "data-ruler": "choice", children: we }) : null
2454
2459
  ] }) : null,
2455
- /* @__PURE__ */ f("div", { ref: Y, className: "cms-screen__trailing", children: [
2460
+ /* @__PURE__ */ h("div", { ref: Y, className: "cms-screen__trailing", children: [
2456
2461
  s !== void 0 ? /* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": s.label, title: s.label, onClick: s.onOpen, children: /* @__PURE__ */ n($, { name: "search" }) }) : null,
2457
2462
  _e !== void 0 && !E ? /* @__PURE__ */ n(In, { ..._e, iconOnly: !0, onOpenChange: Ce }) : null,
2458
2463
  ie ? /* @__PURE__ */ n(
@@ -2460,80 +2465,80 @@ function El({ title: e, back: t, navigation: l, search: s, searching: a, more: i
2460
2465
  {
2461
2466
  ref: ee,
2462
2467
  type: "button",
2463
- className: F("cms-icon-button cms-screen__icon", E && ce !== null && "cms-screen__icon--active"),
2468
+ className: H("cms-icon-button cms-screen__icon", E && oe !== null && "cms-screen__icon--active"),
2464
2469
  "data-action": "more",
2465
2470
  "aria-haspopup": "menu",
2466
2471
  "aria-expanded": be,
2467
- "aria-label": L,
2468
- title: L,
2472
+ "aria-label": D,
2473
+ title: D,
2469
2474
  onMouseDown: () => {
2470
2475
  K.current = be;
2471
2476
  },
2472
- onClick: (R) => {
2473
- const X = R.currentTarget.getBoundingClientRect();
2474
- z(K.current ? null : { x: X.left, y: X.bottom + 4 }), K.current = !1;
2477
+ onClick: (O) => {
2478
+ const X = O.currentTarget.getBoundingClientRect();
2479
+ U(K.current ? null : { x: X.left, y: X.bottom + 4 }), K.current = !1;
2475
2480
  },
2476
2481
  children: /* @__PURE__ */ n($, { name: "more" })
2477
2482
  }
2478
2483
  ) : null,
2479
- d
2484
+ c
2480
2485
  ] })
2481
2486
  ] }),
2482
- /* @__PURE__ */ n("div", { ref: y, className: "cms-screen__content", "data-pulling": ue > 0 ? "" : void 0, "data-refreshing": I ? "" : void 0, children: /* @__PURE__ */ n(En.Provider, { value: ae, children: N }) }),
2483
- r !== void 0 ? /* @__PURE__ */ f(
2487
+ /* @__PURE__ */ n("div", { ref: w, className: "cms-screen__content", "data-pulling": ue > 0 ? "" : void 0, "data-refreshing": T ? "" : void 0, children: /* @__PURE__ */ n(En.Provider, { value: ae, children: k }) }),
2488
+ f !== void 0 ? /* @__PURE__ */ h(
2484
2489
  "button",
2485
2490
  {
2486
2491
  type: "button",
2487
2492
  className: "cms-button cms-button--primary cms-screen__primary",
2488
- "aria-label": r.label,
2489
- ...g === null ? { title: r.label } : {
2493
+ "aria-label": f.label,
2494
+ ...x === null ? { title: f.label } : {
2490
2495
  "aria-disabled": !0,
2491
- "aria-describedby": T,
2492
- ...C ? { "data-reason-shown": "" } : {},
2493
- ...x.dismissed(ze) ? { "data-tip-dismissed": "" } : {}
2496
+ "aria-describedby": L,
2497
+ ...S ? { "data-reason-shown": "" } : {},
2498
+ ...N.dismissed(ze) ? { "data-tip-dismissed": "" } : {}
2494
2499
  },
2495
- ..."menu" in r ? { "aria-haspopup": "menu", "aria-expanded": P !== null } : {},
2496
- onFocus: () => x.focusIn(ze),
2500
+ ..."menu" in f ? { "aria-haspopup": "menu", "aria-expanded": F !== null } : {},
2501
+ onFocus: () => N.focusIn(ze),
2497
2502
  onBlur: () => {
2498
- S(!1), x.focusOut(ze);
2503
+ _(!1), N.focusOut(ze);
2499
2504
  },
2500
- onMouseEnter: () => x.pointerIn(ze),
2501
- onMouseLeave: () => x.pointerOut(ze),
2502
- onKeyDown: (R) => {
2503
- R.key === "Escape" && g !== null && (S(!1), x.dismiss(ze));
2505
+ onMouseEnter: () => N.pointerIn(ze),
2506
+ onMouseLeave: () => N.pointerOut(ze),
2507
+ onKeyDown: (O) => {
2508
+ O.key === "Escape" && x !== null && (_(!1), N.dismiss(ze));
2504
2509
  },
2505
- onClick: (R) => {
2506
- if (g !== null)
2507
- S(!0), x.show(ze);
2508
- else if ("menu" in r) {
2509
- const X = R.currentTarget.getBoundingClientRect();
2510
- k(P === null ? { x: X.left, y: X.top } : null);
2510
+ onClick: (O) => {
2511
+ if (x !== null)
2512
+ _(!0), N.show(ze);
2513
+ else if ("menu" in f) {
2514
+ const X = O.currentTarget.getBoundingClientRect();
2515
+ M(F === null ? { x: X.left, y: X.top } : null);
2511
2516
  } else
2512
- r.onPress();
2517
+ f.onPress();
2513
2518
  },
2514
2519
  children: [
2515
- /* @__PURE__ */ n($, { name: r.icon, size: 24 }),
2516
- g !== null ? /* @__PURE__ */ n("span", { className: "cms-screen__tip", role: "tooltip", id: T, children: g }) : null
2520
+ /* @__PURE__ */ n($, { name: f.icon, size: 24 }),
2521
+ x !== null ? /* @__PURE__ */ n("span", { className: "cms-screen__tip", role: "tooltip", id: L, children: x }) : null
2517
2522
  ]
2518
2523
  }
2519
2524
  ) : null,
2520
2525
  /* @__PURE__ */ n(
2521
2526
  Ke,
2522
2527
  {
2523
- at: be ? B : null,
2524
- items: E && _e !== void 0 ? [...i, ...Ln(_e, _e.label)] : i,
2528
+ at: be ? R : null,
2529
+ items: E && _e !== void 0 ? [...r, ...Ln(_e, _e.label)] : r,
2525
2530
  onClose: j,
2526
- label: h,
2531
+ label: m,
2527
2532
  focus: "first"
2528
2533
  }
2529
2534
  ),
2530
- r !== void 0 && "menu" in r ? /* @__PURE__ */ n(Ke, { at: P, items: r.menu, onClose: () => k(null), label: r.label }) : null
2535
+ f !== void 0 && "menu" in f ? /* @__PURE__ */ n(Ke, { at: F, items: f.menu, onClose: () => M(null), label: f.label }) : null
2531
2536
  ]
2532
2537
  }
2533
2538
  );
2534
2539
  }
2535
2540
  export {
2536
- cl as AppShell,
2541
+ ol as AppShell,
2537
2542
  Ye as Avatar,
2538
2543
  vn as BOOTSTRAP_ICONS,
2539
2544
  Nt as Badge,
@@ -2573,7 +2578,7 @@ export {
2573
2578
  Mt as SIGN_IN_LABELS,
2574
2579
  en as STATE_DELAY_MS,
2575
2580
  El as ScreenShell,
2576
- ol as SearchField,
2581
+ cl as SearchField,
2577
2582
  sl as SectionHeader,
2578
2583
  Yt as Select,
2579
2584
  vl as SignInForm,