@coolms/ui-react 0.1.0-alpha.43 → 0.1.0-alpha.45

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
@@ -37,27 +37,27 @@ 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;
48
+ const u = !!m || t;
49
49
  return /* @__PURE__ */ f(
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: F("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 }),
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
61
  s && a ? /* @__PURE__ */ f("span", { className: "cms-visually-hidden", children: [
62
62
  ", ",
63
63
  a
@@ -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,10 +107,10 @@ 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 }) {
110
+ function on({ id: e, label: t, help: l, error: s, pinned: a, children: r }) {
111
111
  return /* @__PURE__ */ f("div", { className: F("cms-field", s != null && "is-invalid"), children: [
112
112
  /* @__PURE__ */ n("label", { className: "cms-field__label", htmlFor: e, children: t }),
113
- i,
113
+ r,
114
114
  a != null ? /* @__PURE__ */ f("p", { className: "cms-field__pinned", id: `${e}-pinned`, children: [
115
115
  /* @__PURE__ */ n(se, { name: "lock" }),
116
116
  " ",
@@ -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,44 +153,44 @@ 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: N, step: h, minLength: _, maxLength: k, required: x, autoComplete: C, reveal: A }) {
157
+ const v = he(), [y, I] = D(!1), U = a === !0 || r != null, P = U && Vn.has(b), M = b === "number" && (h === "any" || typeof h == "number" && !Number.isInteger(h)), B = b === "password" && A !== void 0 && !U, z = /* @__PURE__ */ n(
158
158
  "input",
159
159
  {
160
- id: _,
161
- name: c,
160
+ id: v,
161
+ name: i,
162
162
  type: P || B && y ? "text" : b,
163
- autoComplete: S,
163
+ autoComplete: C,
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: P ? Zn(b, m, g) : m,
166
+ ...P ? { "data-value": m } : {},
167
+ lang: g,
168
+ placeholder: d,
169
169
  disabled: s,
170
170
  readOnly: U,
171
- required: C,
172
- "aria-required": C || void 0,
173
- min: P ? void 0 : m,
171
+ required: x,
172
+ "aria-required": x || void 0,
173
+ min: P ? void 0 : u,
174
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,
175
+ step: P ? void 0 : h,
176
+ minLength: _,
177
+ maxLength: k,
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: [
184
+ return /* @__PURE__ */ n(on, { id: v, label: e, help: t, error: l, pinned: r, children: B ? /* @__PURE__ */ f("span", { className: "cms-input-reveal", children: [
185
185
  z,
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": y ? A.hide : A.show,
193
+ title: y ? A.hide : A.show,
194
194
  disabled: s,
195
195
  onClick: () => I((j) => !j),
196
196
  children: /* @__PURE__ */ n($, { name: y ? "eye-off" : "eye", size: 18 })
@@ -198,63 +198,63 @@ function Gt({ label: e, help: t, error: l, disabled: s, readOnly: a, pinned: i,
198
198
  )
199
199
  ] }) : z });
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: N, required: h }) {
202
+ const _ = he();
203
+ return /* @__PURE__ */ n(on, { id: _, label: e, help: t, error: l, pinned: r, children: /* @__PURE__ */ n(
204
204
  "textarea",
205
205
  {
206
- id: g,
207
- name: c,
206
+ id: _,
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,
214
+ readOnly: a === !0 || r != null,
215
+ required: h,
216
+ "aria-required": h || void 0,
217
+ minLength: u,
218
218
  maxLength: N,
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(_, { help: t, error: l, pinned: r }),
221
+ onChange: (k) => c == null ? void 0 : c(k.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();
245
+ function Xt({ label: e, checked: t, onChange: l, disabled: s, readOnly: a, help: r }) {
246
+ const m = he();
247
247
  return /* @__PURE__ */ f("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
254
  className: F("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,83 +262,83 @@ 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] = D(e), [u, N] = D(!1), h = O(null), _ = O(null), k = he();
272
272
  if (Q(() => {
273
273
  if (e) {
274
- g.current = document.activeElement, v(!0), N(!1);
274
+ _.current = document.activeElement, g(!0), N(!1);
275
275
  return;
276
276
  }
277
- if (!c) return;
277
+ if (!i) return;
278
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);
279
+ const C = window.setTimeout(() => {
280
+ var A, v;
281
+ g(!1), N(!1), (v = (A = _.current) == null ? void 0 : A.focus) == null || v.call(A);
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(C);
284
+ }, [e, i]), Q(() => {
285
+ var C, A;
286
+ if (e && i) {
287
+ const v = 'input, select, textarea, button, [href], [tabindex]:not([tabindex="-1"])';
288
+ (A = (d == null ? void 0 : d.current) ?? ((C = h.current) == null ? void 0 : C.querySelector(`.cms-modal__body :is(${v}), .cms-modal__foot :is(${v})`)) ?? h.current) == null || A.focus();
289
289
  }
290
- }, [e, c, u]), !c) return null;
291
- const C = () => {
290
+ }, [e, i, d]), !i) return null;
291
+ const x = () => {
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();
295
+ /* @__PURE__ */ n("div", { className: F("cms-modal-scrim", u && "is-closing"), onMouseDown: (C) => {
296
+ C.target === C.currentTarget && x();
297
297
  }, children: /* @__PURE__ */ f(
298
298
  "div",
299
299
  {
300
- ref: r,
301
- className: F("cms-modal", b, m && "is-closing", s && "is-dirty"),
300
+ ref: h,
301
+ className: F("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": k,
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: (C) => {
307
+ var A;
308
+ if (C.key === "Escape")
309
+ C.stopPropagation(), x();
310
+ else if (C.key === "Tab") {
311
+ const v = (A = h.current) == null ? void 0 : A.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
312
+ if (!v || v.length === 0) return;
313
+ const y = v[0], I = v[v.length - 1];
314
+ C.shiftKey && document.activeElement === y ? (C.preventDefault(), I.focus()) : !C.shiftKey && document.activeElement === I && (C.preventDefault(), y.focus());
315
315
  }
316
316
  },
317
317
  children: [
318
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" }) })
319
+ /* @__PURE__ */ n("h2", { className: "cms-modal__title", id: k, children: t }),
320
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button", "aria-label": c, onClick: x, 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 },
337
+ onClose: d,
338
+ ...m === void 0 ? {} : { closeLabel: m },
339
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") })
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
343
  children: s !== "default" ? /* @__PURE__ */ f("p", { className: "cms-confirm__warning", children: [
344
344
  /* @__PURE__ */ n(se, { name: "warning" }),
@@ -394,34 +394,34 @@ function Jn() {
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] = D(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";
408
+ const d = a === "block";
409
409
  return /* @__PURE__ */ f(
410
410
  "div",
411
411
  {
412
- className: F("cms-state", `cms-state--${e}`, `cms-state--${a}`, !h && "is-waiting"),
412
+ className: F("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,
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
420
  /* @__PURE__ */ f("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: N, onZoom: h, children: _ } = e, k = O(null), x = O(null), C = he(), [A, v] = D(!1), y = O(null);
441
441
  Q(() => {
442
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(), () => {
443
+ const M = document.activeElement, B = document.body.style.overflow;
444
+ return document.body.style.overflow = "hidden", (z = x.current) == null || z.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 = B, (j = M == null ? void 0 : M.focus) == null || j.call(M);
447
447
  };
448
448
  }, []);
449
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) => {
450
+ d != null && d.dirty ? d.onDirtyClose() : a();
451
+ }, U = (M) => {
452
+ const B = M.touches.length === 1 ? M.touches[0] : void 0;
453
+ y.current = B === void 0 || d !== void 0 || tt(M.target) ? null : { x: B.clientX, y: B.clientY };
454
+ }, P = (M) => {
455
455
  var K, G;
456
- const B = y.current, z = k.changedTouches[0];
456
+ const B = y.current, z = M.changedTouches[0];
457
457
  if (y.current = null, B === null || z === void 0) return;
458
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));
459
+ Math.abs(j) < et || Math.abs(j) < Math.abs(z.clientY - B.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
462
  /* @__PURE__ */ f(
463
463
  "div",
464
464
  {
465
- ref: T,
466
- className: F("cms-viewer", u !== void 0 && "is-editing"),
465
+ ref: k,
466
+ className: F("cms-viewer", d !== void 0 && "is-editing"),
467
467
  role: "dialog",
468
468
  "aria-modal": "true",
469
- "aria-labelledby": S,
469
+ "aria-labelledby": C,
470
470
  tabIndex: -1,
471
- onKeyDown: (k) => {
471
+ onKeyDown: (M) => {
472
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);
473
+ if (M.key === "Escape") {
474
+ if (d !== void 0) return;
475
+ M.stopPropagation(), A ? v(!1) : a();
476
+ } else if (M.key === "Tab") {
477
+ const K = Array.from(((B = k.current) == null ? void 0 : B.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" ? (z = i == null ? void 0 : i.onPrevious) == null || z.call(i) : M.key === "ArrowRight" ? (j = i == null ? void 0 : i.onNext) == null || j.call(i) : M.key === "+" || M.key === "=" ? h == null || h("in") : M.key === "-" ? h == null || h("out") : M.key === "0" && (h == null || h("reset")));
482
482
  },
483
483
  children: [
484
- c !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-visually-hidden", role: "status", children: `${t}, ${c.position}` }) : null,
484
+ i !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-visually-hidden", role: "status", children: `${t}, ${i.position}` }) : null,
485
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" }) }),
486
+ /* @__PURE__ */ n("button", { ref: x, type: "button", className: "cms-viewer__icon", "aria-label": s, onClick: I, 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: C, 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 })
491
+ d !== void 0 ? /* @__PURE__ */ f(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
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 })
495
+ /* @__PURE__ */ n("span", { className: "cms-viewer__actions", children: r.map((M) => /* @__PURE__ */ f("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__ */ f("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__ */ f("span", { className: "cms-viewer__more", children: [
504
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-viewer__icon", "aria-label": m, "aria-expanded": A, onClick: () => v((M) => !M), children: /* @__PURE__ */ n($, { name: "more" }) }),
505
+ A ? /* @__PURE__ */ n("span", { className: "cms-viewer__menu", children: r.map((M) => /* @__PURE__ */ f(
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
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,
524
+ u != null && d === void 0 ? /* @__PURE__ */ n("nav", { className: "cms-viewer__thumbnails", children: u }) : null,
525
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 })
526
+ (d == null ? void 0 : d.conflict) !== void 0 ? /* @__PURE__ */ f("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 ? _ : /* @__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, B) => /* @__PURE__ */ n("i", { className: B === Math.min(i.index, 6) ? "is-current" : void 0 }, B)) }) : 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 && N != null ? /* @__PURE__ */ n("div", { className: "cms-viewer__strip", children: N }) : null,
538
+ g != null ? /* @__PURE__ */ n("footer", { className: "cms-viewer__bar", children: g }) : null
539
539
  ]
540
540
  }
541
541
  ),
@@ -581,143 +581,143 @@ 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] = D(((ne = l[0]) == null ? void 0 : ne.id) ?? ""), [u, N] = D(""), [h, _] = D({ status: "loading" }), [k, x] = D(0), [C, A] = D(/* @__PURE__ */ new Map()), [v, y] = D(0), [I, U] = D(!1), P = O(null), M = O(!1);
588
588
  Q(() => {
589
- k.current = !1;
590
- }, [t, c, m]);
589
+ M.current = !1;
590
+ }, [t, i, u]);
591
591
  const B = he();
592
592
  Q(() => {
593
593
  var w;
594
- t && (v(((w = l[0]) == null ? void 0 : w.id) ?? ""), N(""), x(/* @__PURE__ */ new Map()), U(!1));
594
+ t && (g(((w = l[0]) == null ? void 0 : w.id) ?? ""), N(""), A(/* @__PURE__ */ new Map()), U(!1));
595
595
  }, [t]), Q(() => {
596
- if (!t || c === "") return;
596
+ if (!t || i === "") return;
597
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" })
598
+ return _({ status: "loading" }), y(0), s(i, u).then(
599
+ (E) => w && _({ status: "ready", entries: E.entries, next: E.next ?? null, paging: !1 }),
600
+ (E) => w && _({ status: E instanceof at ? "denied" : "error" })
601
601
  ), () => {
602
602
  w = !1;
603
603
  };
604
- }, [t, c, m, s, T]);
604
+ }, [t, i, u, s, k]);
605
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(
606
+ if (h.status !== "ready" || h.next === null || h.paging) return;
607
+ const w = h.next, E = h.entries;
608
+ _({ ...h, paging: !0 }), s(i, u, w).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, _({ 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
+ _({ status: "ready", entries: E, next: w, paging: !1 });
615
615
  return;
616
616
  }
617
- if (k.current) {
618
- g({ status: "error" });
617
+ if (M.current) {
618
+ _({ status: "error" });
619
619
  return;
620
620
  }
621
- k.current = !0, C((q) => q + 1);
621
+ M.current = !0, x((q) => q + 1);
622
622
  }
623
623
  );
624
- }, [r, s, c, m]), j = Ie((w) => {
624
+ }, [h, s, i, u]), j = Ie((w) => {
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) => {
626
+ return ((E = r == null ? void 0 : r.cost) == null ? void 0 : E.call(r, w)) ?? w.size ?? 0;
627
+ }, [r]), K = Bn(() => [...C.values()], [C]), G = K.reduce((w, E) => w + (E.size ?? 0), 0), Y = r === void 0 ? null : r.limitBytes - r.usedBytes - K.reduce((w, E) => w + j(E), 0), ee = Y !== null && Y < 0, ie = (w) => {
628
628
  if (w.kind !== "file") return null;
629
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);
630
+ return E || (Y !== null && !C.has(Je(i, w.id)) && j(w) > Y ? c.overBudget : null);
631
631
  }, be = (w) => {
632
- const E = Je(c, w.id);
633
- !S.has(E) && ie(w) !== null || x((W) => {
632
+ const E = Je(i, w.id);
633
+ !C.has(E) && ie(w) !== null || A((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, { ...w, 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 = (w) => N(it(u, w.name)), de = () => N(u.includes("/") ? u.slice(0, u.lastIndexOf("/")) : ""), Ce = (w) => A((E) => {
638
638
  const W = new Map(E);
639
639
  return W.delete(w), W;
640
- }), fe = r.status === "ready" ? r.entries : [], te = (w) => {
641
- const E = fe[_];
640
+ }), fe = h.status === "ready" ? h.entries : [], te = (w) => {
641
+ const E = fe[v];
642
642
  if (w.key === "ArrowDown" || w.key === "ArrowUp" || w.key === "Home" || w.key === "End") {
643
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)));
644
+ const W = fe.length - 1, q = w.key === "Home" ? 0 : w.key === "End" ? W : Math.min(W, Math.max(0, v + (w.key === "ArrowDown" ? 1 : -1)));
645
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)}`;
646
+ } else w.key === "Enter" && (E == null ? void 0 : E.kind) === "folder" ? (w.preventDefault(), oe(E)) : w.key === " " && (E == null ? void 0 : E.kind) === "file" ? (w.preventDefault(), be(E)) : w.key === "Backspace" && u !== "" && (w.preventDefault(), de());
647
+ }, pe = u === "" ? [] : u.split("/"), _e = ((ye = l.find((w) => w.id === i)) == null ? void 0 : ye.name) ?? "", we = (w) => `${B}-entry-${String(w)}`;
648
648
  return /* @__PURE__ */ f(
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,
654
+ closeLabel: c.close,
655
655
  initialFocus: P,
656
656
  className: "cms-file-picker",
657
657
  footer: /* @__PURE__ */ f("div", { className: "cms-file-picker__foot", children: [
658
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
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: F(ee && "is-over"), children: ee ? c.overBudget : c.left(m(Math.max(0, Y)), m(r.limitBytes)) }) : null
661
661
  ] }),
662
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) })
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
668
  /* @__PURE__ */ f("div", { className: "cms-file-picker__top", children: [
669
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("");
670
+ /* @__PURE__ */ n("span", { className: "cms-visually-hidden", children: c.space }),
671
+ /* @__PURE__ */ n("select", { className: "cms-input cms-select", value: i, onChange: (w) => {
672
+ g(w.target.value), N("");
673
673
  }, children: l.map((w) => /* @__PURE__ */ n("option", { value: w.id, children: w.name }, w.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" }) }),
675
+ /* @__PURE__ */ f("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
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 }) }),
678
+ /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": u === "" ? "location" : void 0, onClick: () => N(""), children: _e }) }),
679
679
  pe.map((w, 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: () => N(W), children: w }) }, 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": I, onClick: () => U((w) => !w), children: c.selected(K.length) }) : null
686
686
  ] }),
687
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: [
688
+ /* @__PURE__ */ n("ul", { children: [...C.entries()].map(([w, E]) => /* @__PURE__ */ f("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" }) })
690
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button", "aria-label": c.remove(E.name), onClick: () => Ce(w), children: /* @__PURE__ */ n(se, { name: "close" }) })
691
691
  ] }, w)) }),
692
692
  /* @__PURE__ */ n(De, { variant: "secondary", onClick: () => {
693
- x(/* @__PURE__ */ new Map()), U(!1);
694
- }, children: d.clear })
693
+ A(/* @__PURE__ */ new Map()), U(!1);
694
+ }, children: c.clear })
695
695
  ] }) : null,
696
696
  /* @__PURE__ */ f("div", { className: "cms-file-picker__list", onScroll: (w) => {
697
697
  const E = w.currentTarget;
698
- E.scrollTop + E.clientHeight >= E.scrollHeight - ct && z();
698
+ E.scrollTop + E.clientHeight >= E.scrollHeight - ot && z();
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
+ h.status === "loading" ? /* @__PURE__ */ n(Le, { kind: "loading", title: c.loading, placement: "page" }) : null,
701
+ h.status === "error" ? /* @__PURE__ */ n(Le, { kind: "error", title: c.error, placement: "page", action: { label: c.retry, onAction: () => {
702
+ M.current = !1, x((w) => w + 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,
704
+ h.status === "denied" ? /* @__PURE__ */ n(Le, { kind: "denied", title: c.denied, placement: "page" }) : null,
705
+ h.status === "ready" && fe.length === 0 ? /* @__PURE__ */ n(Le, { kind: "empty", title: c.empty, placement: "page" }) : null,
706
706
  /* @__PURE__ */ f(
707
707
  "div",
708
708
  {
709
709
  ref: P,
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: h.status !== "ready" || fe.length === 0,
717
717
  onKeyDown: te,
718
718
  children: [
719
719
  fe.map((w, E) => {
720
- const W = w.kind === "file" && S.has(Je(c, w.id)), q = ie(w);
720
+ const W = w.kind === "file" && C.has(Je(i, w.id)), q = ie(w);
721
721
  return /* @__PURE__ */ f(
722
722
  "div",
723
723
  {
@@ -725,9 +725,9 @@ function tl(e) {
725
725
  role: "option",
726
726
  "aria-selected": w.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: F("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
+ y(E), w.kind === "folder" ? oe(w) : be(w);
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 }),
@@ -736,13 +736,13 @@ function tl(e) {
736
736
  /* @__PURE__ */ n("span", { className: "cms-file-picker__name", children: w.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
+ w.kind === "file" && w.size != null ? /* @__PURE__ */ n("span", { className: "cms-file-picker__size", children: m(w.size) }) : null
740
740
  ]
741
741
  },
742
742
  w.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
+ h.status === "ready" && h.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;
@@ -762,25 +762,25 @@ function ot(e, t) {
762
762
  function dt(e, t) {
763
763
  const [l, s] = D(0), a = O(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,175 @@ 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 = O([]), 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 N = (h, _, k) => {
797
+ var x;
798
+ if (h.key === "ArrowDown" || h.key === "ArrowUp")
799
+ h.preventDefault(), (x = g.current[Math.min(t.length - 1, Math.max(0, _ + (h.key === "ArrowDown" ? 1 : -1)))]) == null || x.focus();
800
+ else if (h.key === "Enter")
801
+ b == null || b(k);
802
+ else if ((h.key === "ContextMenu" || h.shiftKey && h.key === "F10") && i) {
803
+ h.preventDefault();
804
+ const C = h.currentTarget.getBoundingClientRect();
805
+ i(k, { x: C.left + 16, y: C.bottom });
806
806
  }
807
807
  };
808
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
809
+ u !== null && (u.distance > 0 || u.refreshing) ? /* @__PURE__ */ f("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;
813
+ /* @__PURE__ */ n("ul", { className: "cms-list", role: "listbox", "aria-label": e, children: t.map((h, _) => {
814
+ const k = h.id === d;
815
815
  return /* @__PURE__ */ f(
816
816
  "li",
817
817
  {
818
- ref: (C) => {
819
- v.current[g] = C;
818
+ ref: (x) => {
819
+ g.current[_] = x;
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": k,
823
+ tabIndex: k || d == null && _ === 0 ? 0 : -1,
824
+ className: F("cms-list__row", k && "is-selected"),
825
+ onClick: () => b == null ? void 0 : b(h.id),
826
+ onKeyDown: (x) => N(x, _, h.id),
827
+ onContextMenu: i ? (x) => {
828
+ x.preventDefault(), i(h.id, { x: x.clientX, y: x.clientY });
829
829
  } : void 0,
830
830
  children: [
831
- r.lead != null ? /* @__PURE__ */ n("span", { className: "cms-list__lead", children: r.lead }) : null,
831
+ h.lead != null ? /* @__PURE__ */ n("span", { className: "cms-list__lead", children: h.lead }) : null,
832
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
833
+ /* @__PURE__ */ n("span", { className: F("cms-list__primary", h.unread === !0 && "is-unread"), children: h.primary }),
834
+ h.secondary != null ? /* @__PURE__ */ n("span", { className: "cms-list__secondary", children: h.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
+ h.meta != null || h.count !== void 0 ? /* @__PURE__ */ f("span", { className: "cms-list__end", children: [
837
+ h.meta != null ? /* @__PURE__ */ n("span", { className: "cms-list__meta", children: h.meta }) : null,
838
+ h.count !== void 0 && h.count > 0 ? /* @__PURE__ */ n("span", { className: "cms-badge cms-list__count", children: h.count }) : null
839
839
  ] }) : null
840
840
  ]
841
841
  },
842
- r.id
842
+ h.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 = O(null), c = O(null), d = he(), [b, i] = D(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, k = (_ == null ? void 0 : _.offsetWidth) ?? 0, x = (_ == null ? void 0 : _.offsetHeight) ?? 0, C = r === "bottom-right" ? e.x - k : e.x, A = r === "bottom-right" ? e.y - x : e.y;
852
+ i({ x: Math.max(0, Math.min(C, window.innerWidth - k)), y: Math.max(0, Math.min(A, window.innerHeight - x)) });
853
+ }, [e, r]), Q(() => {
854
+ var C, A;
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(((C = m.current) == null ? void 0 : C.querySelectorAll('[role^="menuitem"]:not([aria-disabled="true"])')) ?? []), k = a === "current" ? _.find((v) => v.getAttribute("aria-checked") === "true") : void 0;
858
+ (A = a === "last" ? _[_.length - 1] : k ?? _[0]) == null || A.focus();
859
+ const x = (v) => {
860
+ var y;
861
+ (y = m.current) != null && y.contains(v.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", x), () => {
864
+ var v, y;
865
+ document.removeEventListener("mousedown", x), (y = (v = c.current) == null ? void 0 : v.focus) == null || y.call(v);
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 C, A;
870
+ const k = Array.from(((C = m.current) == null ? void 0 : C.querySelectorAll('[role^="menuitem"]')) ?? []), x = k.indexOf(document.activeElement);
871
+ if (_.key === "Escape" || _.key === "Tab")
872
+ _.preventDefault(), l();
873
+ else if (_.key === "ArrowDown" || _.key === "ArrowUp") {
874
+ _.preventDefault();
875
+ const v = _.key === "ArrowDown" ? 1 : -1;
876
+ (A = k[(x + v + k.length) % k.length]) == null || A.focus();
877
877
  }
878
- }, m = (r) => {
879
- const g = r.offer.refusal !== void 0;
878
+ }, N = (_) => {
879
+ const k = _.offer.refusal !== void 0;
880
880
  return /* @__PURE__ */ f(
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": k || void 0,
887
+ "aria-describedby": k ? `${d}-${_.id}` : void 0,
888
+ title: k ? _.offer.refusal : void 0,
889
+ className: F("cms-menu__item", _.danger && "is-danger", _.offer.locked && "is-locked", k && "is-refused"),
890
890
  onClick: () => {
891
- g || (l(), r.onSelect());
891
+ k || (l(), _.onSelect());
892
892
  },
893
- onKeyDown: (T) => {
894
- (T.key === "Enter" || T.key === " ") && !g && (T.preventDefault(), l(), r.onSelect());
893
+ onKeyDown: (x) => {
894
+ (x.key === "Enter" || x.key === " ") && !k && (x.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__ */ n("span", { className: "cms-menu__label", children: _.label }),
900
+ k ? /* @__PURE__ */ n("span", { id: `${d}-${_.id}`, className: "cms-menu__refusal", children: _.offer.refusal }) : null
901
901
  ]
902
902
  },
903
- r.id
903
+ _.id
904
904
  );
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] });
905
+ }, h = [];
906
+ for (const _ of g) {
907
+ const k = h[h.length - 1];
908
+ k !== void 0 && k.group === _.group ? k.items.push(_) : h.push({ group: _.group, items: [_] });
909
909
  }
910
910
  return an(
911
911
  /* @__PURE__ */ n(
912
912
  "div",
913
913
  {
914
- ref: i,
914
+ ref: m,
915
915
  className: "cms-menu",
916
916
  role: "menu",
917
917
  "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)
918
+ style: { left: (b ?? e).x, top: (b ?? e).y },
919
+ onKeyDown: u,
920
+ onContextMenu: (_) => _.preventDefault(),
921
+ children: h.map((_, k) => /* @__PURE__ */ f(Hn, { children: [
922
+ k > 0 ? /* @__PURE__ */ n("div", { className: "cms-menu__separator", role: "separator" }) : null,
923
+ _.group === void 0 ? _.items.map(N) : /* @__PURE__ */ f("div", { role: "group", "aria-label": _.group, children: [
924
+ /* @__PURE__ */ n("div", { className: "cms-menu__group", "aria-hidden": "true", children: _.group }),
925
+ _.items.map(N)
926
926
  ] })
927
- ] }, g))
927
+ ] }, k))
928
928
  }
929
929
  ),
930
930
  document.body
931
931
  );
932
932
  }
933
933
  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;
934
+ const [e, t] = D(/* @__PURE__ */ new Set()), [l, s] = D(null), a = O(null), r = O(null), m = (d) => t((b) => b.has(d) ? b : /* @__PURE__ */ new Set([...b, d])), c = (d) => t((b) => {
935
+ if (!b.has(d)) return b;
936
+ const i = new Set(b);
937
+ return i.delete(d), i;
938
938
  });
939
939
  return Q(() => {
940
940
  if (l === null) return;
941
- const u = (b) => {
942
- b.key === "Escape" && h(l);
941
+ const d = (b) => {
942
+ b.key === "Escape" && m(l);
943
943
  };
944
- return window.addEventListener("keydown", u), () => window.removeEventListener("keydown", u);
944
+ return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
945
945
  }, [l]), {
946
- dismissed: (u) => e.has(u),
947
- dismiss: h,
948
- show: d,
949
- pointerIn: (u) => {
950
- i.current = u, s(u);
946
+ dismissed: (d) => e.has(d),
947
+ dismiss: m,
948
+ show: c,
949
+ pointerIn: (d) => {
950
+ r.current = d, s(d);
951
951
  },
952
- pointerOut: (u) => {
953
- i.current === u && (i.current = null), s((b) => b === u ? null : b), a.current !== u && d(u);
952
+ pointerOut: (d) => {
953
+ r.current === d && (r.current = null), s((b) => b === d ? null : b), a.current !== d && c(d);
954
954
  },
955
- focusIn: (u) => {
956
- a.current = u;
955
+ focusIn: (d) => {
956
+ a.current = d;
957
957
  },
958
- focusOut: (u) => {
959
- a.current === u && (a.current = null), i.current !== u && d(u);
958
+ focusOut: (d) => {
959
+ a.current === d && (a.current = null), r.current !== d && c(d);
960
960
  }
961
961
  };
962
962
  }
@@ -964,10 +964,10 @@ function mt(e, t, l) {
964
964
  return Math.min(Math.max(e - l / 2, 0), Math.max(0, t - l));
965
965
  }
966
966
  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) => ({
967
+ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secondary: r, more: m = [], moreLabel: c, context: d, fullWidth: b = !1 }) {
968
+ var X, Ne, ce;
969
+ const [i, g] = D(null), [u, N] = D(yn), [h, _] = D(null), [k, x] = D(null), C = dn(), A = O(null), v = O(null), y = O(null), I = he(), U = he(), P = [
970
+ ...(r ?? []).map((o) => ({
971
971
  id: o.id,
972
972
  label: o.label,
973
973
  name: o.label,
@@ -977,7 +977,7 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
977
977
  offer: o.offer ?? { offered: !0, locked: !1 },
978
978
  run: o.onPress
979
979
  })),
980
- ...h.map((o) => ({
980
+ ...m.map((o) => ({
981
981
  id: o.id,
982
982
  label: o.label,
983
983
  name: typeof o.label == "string" ? o.label : o.id,
@@ -987,7 +987,7 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
987
987
  offer: o.offer,
988
988
  run: o.onSelect
989
989
  }))
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([
990
+ ].filter((o) => o.offer.offered), M = P.filter((o) => o.overflow === 0), B = P.filter((o) => o.overflow !== 0), z = M.length === 1 ? M[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 && (((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
991
  e,
992
992
  t ?? null,
993
993
  l ?? null,
@@ -995,11 +995,11 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
995
995
  ee ? [a.label, a.icon, de !== null] : null,
996
996
  P.map((o) => [o.id, o.name, o.icon, o.overflow ?? null])
997
997
  ]), te = Ie(() => {
998
- const o = x.current, A = _.current;
999
- 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) => {
998
+ const o = A.current, T = v.current;
999
+ if (o === null || T === null) return;
1000
+ const S = getComputedStyle(o), H = parseFloat(S.columnGap || "0") || 0, le = o.clientWidth - (parseFloat(S.paddingLeft) || 0) - (parseFloat(S.paddingRight) || 0), J = (re) => {
1001
1001
  var Me;
1002
- return ((Me = A.querySelector(re)) == null ? void 0 : Me.getBoundingClientRect().width) ?? 0;
1002
+ return ((Me = T.querySelector(re)) == null ? void 0 : Me.getBoundingClientRect().width) ?? 0;
1003
1003
  }, ke = J('[data-measure="title"]'), Re = Math.min(ke, ft), He = (re) => {
1004
1004
  const Me = pe(re), xe = [];
1005
1005
  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"]'));
@@ -1022,7 +1022,7 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
1022
1022
  }
1023
1023
  if (ee && Oe({ ...V, primaryBare: !0 })) return V;
1024
1024
  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;
1025
+ 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
1026
  for (const Ve of xe) {
1027
1027
  for (const Ge of Ve) Me.add(Ge);
1028
1028
  if (ve() && Oe(Ze(Me))) return V;
@@ -1034,132 +1034,132 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
1034
1034
  N((re) => ht(re, pn) ? re : pn);
1035
1035
  }, [fe]);
1036
1036
  $e(te, [te]), Q(() => {
1037
- const o = x.current;
1037
+ const o = A.current;
1038
1038
  if (o === null || typeof ResizeObserver > "u") return;
1039
- const A = new ResizeObserver(() => te());
1040
- return A.observe(o), () => A.disconnect();
1039
+ const T = new ResizeObserver(() => te());
1040
+ return T.observe(o), () => T.disconnect();
1041
1041
  }, [te]), Q(() => {
1042
1042
  const o = typeof document > "u" ? void 0 : document.fonts;
1043
1043
  if (o === void 0) return;
1044
- let A = !0;
1045
- const M = () => {
1046
- A && te();
1044
+ let T = !0;
1045
+ const S = () => {
1046
+ T && te();
1047
1047
  };
1048
- return o.ready.then(M), o.addEventListener("loadingdone", M), () => {
1049
- A = !1, o.removeEventListener("loadingdone", M);
1048
+ return o.ready.then(S), o.addEventListener("loadingdone", S), () => {
1049
+ T = !1, o.removeEventListener("loadingdone", S);
1050
1050
  };
1051
1051
  }, [te]);
1052
1052
  function pe(o) {
1053
- 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] : []]);
1053
+ const T = o.hidden.size + (o.primaryHidden ? 1 : 0);
1054
+ return /* @__PURE__ */ new Set([...M.filter((S) => S !== z || T > 0).map((S) => S.id), ...o.hidden, ...o.primaryHidden ? [Ae] : []]);
1055
1055
  }
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: () => {
1056
+ const _e = pe(u), we = P.filter((o) => !_e.has(o.id) && o !== z), ne = z !== null && !_e.has(z.id) ? z : null, ye = ee && !u.primaryHidden, w = (o) => P.find((T) => T.id === o), E = G.flat().filter((o) => u.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 && u.primaryHidden ? [{ id: Ae, label: a.label, offer: a.offer ?? { offered: !0, locked: !1 }, onSelect: () => {
1058
1058
  be || a.onPress();
1059
- } }, ...ce] : [],
1059
+ } }, ...oe] : [],
1060
1060
  ...E.map(W),
1061
- ..._e.size > 0 ? k.map(W) : []
1061
+ ..._e.size > 0 ? M.map(W) : []
1062
1062
  ], p = q.length > 0, L = [
1063
1063
  ...we.map((o) => o.id),
1064
1064
  ...ne !== null ? [ne.id] : [],
1065
1065
  ...ye ? [Ae, ...de !== null ? ["primary-menu"] : []] : [],
1066
1066
  ...p ? ["more"] : []
1067
- ], Z = r !== null && L.includes(r) ? r : L[0] ?? null;
1067
+ ], Z = h !== null && L.includes(h) ? h : L[0] ?? null;
1068
1068
  Q(() => {
1069
- 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]);
1069
+ var o, T;
1070
+ h === null || L.includes(h) || !p || ((o = A.current) != null && o.contains(document.activeElement) || document.activeElement === document.body) && (_("more"), (T = y.current) == null || T.focus());
1071
+ }, [u]);
1072
1072
  const ue = (o) => `${U}-${o}`, ae = (o) => {
1073
1073
  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;
1074
+ const T = L.indexOf(Z ?? "");
1075
+ let S = null;
1076
+ if (o.key === "ArrowRight" ? S = Math.min(L.length - 1, T + 1) : o.key === "ArrowLeft" ? S = Math.max(0, T - 1) : o.key === "Home" ? S = 0 : o.key === "End" && (S = L.length - 1), S === null) return;
1077
1077
  o.preventDefault();
1078
- const H = L[M] ?? null;
1079
- g(H), H !== null && ((le = document.getElementById(ue(H))) == null || le.focus());
1080
- }, 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": "" } : {},
1078
+ const H = L[S] ?? null;
1079
+ _(H), H !== null && ((le = document.getElementById(ue(H))) == null || le.focus());
1080
+ }, me = (o, T) => {
1081
+ const S = T.getBoundingClientRect();
1082
+ g((i == null ? void 0 : i.which) === o ? null : { which: o, x: S.left, y: S.bottom + 4 });
1083
+ }, Se = (o) => ({ id: ue(o), tabIndex: Z === o ? 0 : -1, onFocus: () => _(o) }), We = (o, T, S) => T ? {
1084
+ ...k === o ? { "data-reason-shown": "" } : {},
1085
+ ...C.dismissed(o) ? { "data-tip-dismissed": "" } : {},
1086
1086
  onFocus: (H) => {
1087
- g(o), S.focusIn(o), Te(H.currentTarget, M);
1087
+ _(o), C.focusIn(o), Te(H.currentTarget, S);
1088
1088
  },
1089
1089
  onBlur: () => {
1090
- C((H) => H === o ? null : H), S.focusOut(o);
1090
+ x((H) => H === o ? null : H), C.focusOut(o);
1091
1091
  },
1092
1092
  onMouseEnter: (H) => {
1093
- S.pointerIn(o), Te(H.currentTarget, M);
1093
+ C.pointerIn(o), Te(H.currentTarget, S);
1094
1094
  },
1095
- onMouseLeave: () => S.pointerOut(o),
1095
+ onMouseLeave: () => C.pointerOut(o),
1096
1096
  onKeyDown: (H) => {
1097
- H.key === "Escape" && (C((le) => le === o ? null : le), S.dismiss(o));
1097
+ H.key === "Escape" && (x((le) => le === o ? null : le), C.dismiss(o));
1098
1098
  }
1099
- } : {}, Fe = (o, A, M) => {
1100
- C(o), S.show(o), Te(A, M);
1101
- }, 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;
1099
+ } : {}, Fe = (o, T, S) => {
1100
+ x(o), C.show(o), Te(T, S);
1101
+ }, Te = (o, T) => {
1102
+ const S = document.getElementById(T), H = A.current;
1103
+ if (S === null || H === null) return;
1104
+ const le = S.style.display;
1105
+ S.style.display = "block";
1106
+ const J = S.offsetWidth;
1107
+ S.style.display = le;
1108
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,
1109
+ S.style.left = `${String(mt(Re.left + Re.width / 2 - ke.left, ke.width, J))}px`, S.style.right = "auto";
1110
+ }, Ee = (o, T, S) => /* @__PURE__ */ f("span", { id: o, className: "cms-section-header__tip", role: "tooltip", children: [
1111
+ S !== null ? /* @__PURE__ */ f("span", { "aria-hidden": "true", children: [
1112
+ S,
1113
1113
  ": "
1114
1114
  ] }) : null,
1115
- A
1115
+ T
1116
1116
  ] }), R = (o) => {
1117
- const A = m.bare.has(o.id) && o.icon !== null, M = o.offer.refusal, H = `${U}-reason-${o.id}`;
1117
+ const T = u.bare.has(o.id) && o.icon !== null, S = o.offer.refusal, H = `${U}-reason-${o.id}`;
1118
1118
  return /* @__PURE__ */ f(
1119
1119
  "button",
1120
1120
  {
1121
1121
  type: "button",
1122
- className: F("cms-button", "cms-button--quiet", "cms-section-header__secondary", A && "cms-section-header__secondary--bare", o.danger && "is-danger"),
1122
+ className: F("cms-button", "cms-button--quiet", "cms-section-header__secondary", T && "cms-section-header__secondary--bare", o.danger && "is-danger"),
1123
1123
  "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,
1124
+ "aria-label": T || S !== void 0 ? o.name : void 0,
1125
+ "aria-disabled": S !== void 0 ? "true" : void 0,
1126
+ "aria-describedby": S !== void 0 ? H : void 0,
1127
+ title: S === void 0 && T ? o.name : void 0,
1128
1128
  ...Se(o.id),
1129
- ...We(o.id, M !== void 0, H),
1129
+ ...We(o.id, S !== void 0, H),
1130
1130
  onClick: (le) => {
1131
- M === void 0 ? o.run() : Fe(o.id, le.currentTarget, H);
1131
+ S === void 0 ? o.run() : Fe(o.id, le.currentTarget, H);
1132
1132
  },
1133
1133
  children: [
1134
1134
  o.icon !== null ? /* @__PURE__ */ n($, { name: o.icon, size: 18 }) : null,
1135
- 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
1135
+ T ? null : /* @__PURE__ */ n("span", { className: "cms-section-header__label", children: o.label }),
1136
+ S !== void 0 ? Ee(H, S, T ? o.name : null) : null
1137
1137
  ]
1138
1138
  },
1139
1139
  o.id
1140
1140
  );
1141
1141
  };
1142
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: [
1143
+ /* @__PURE__ */ f("div", { ref: A, className: F("cms-section-header__row", u.chipsCut && "cms-section-header__row--chips-cut"), "data-row": "1", children: [
1144
1144
  t !== void 0 ? /* @__PURE__ */ n($, { name: t }) : null,
1145
1145
  /* @__PURE__ */ n(
1146
1146
  "h1",
1147
1147
  {
1148
1148
  className: "cms-section-header__title",
1149
1149
  title: e,
1150
- style: { minWidth: m.titleCut ? `${m.titleFloor}px` : "max-content" },
1150
+ style: { minWidth: u.titleCut ? `${u.titleFloor}px` : "max-content" },
1151
1151
  children: e
1152
1152
  }
1153
1153
  ),
1154
- l !== void 0 ? /* @__PURE__ */ n("span", { className: F("cms-section-header__description", m.descriptionHidden && "cms-visually-hidden"), children: l }) : null,
1155
- s.map((o, A) => /* @__PURE__ */ n(
1154
+ l !== void 0 ? /* @__PURE__ */ n("span", { className: F("cms-section-header__description", u.descriptionHidden && "cms-visually-hidden"), children: l }) : null,
1155
+ s.map((o, T) => /* @__PURE__ */ n(
1156
1156
  "span",
1157
1157
  {
1158
1158
  className: "cms-section-header__meta",
1159
1159
  "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 } : {},
1160
+ hidden: o.elsewhere === !0 && u.elsewhereHidden,
1161
+ style: u.chipsCut && o.elsewhere !== !0 ? { flexShrink: T + 1 } : void 0,
1162
+ ...u.chipsCut && o.elsewhere !== !0 ? { title: o.text, "aria-label": o.text } : {},
1163
1163
  children: o.content
1164
1164
  },
1165
1165
  o.id
@@ -1172,12 +1172,12 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
1172
1172
  "button",
1173
1173
  {
1174
1174
  type: "button",
1175
- className: F("cms-button", "cms-button--primary", m.primaryBare && "cms-section-header__primary--bare"),
1175
+ className: F("cms-button", "cms-button--primary", u.primaryBare && "cms-section-header__primary--bare"),
1176
1176
  "data-action": "primary",
1177
- "aria-label": m.primaryBare ? a.label : void 0,
1177
+ "aria-label": u.primaryBare ? a.label : void 0,
1178
1178
  "aria-disabled": be ? "true" : void 0,
1179
1179
  "aria-describedby": ie !== void 0 ? I : void 0,
1180
- title: m.primaryBare && ie === void 0 ? a.label : void 0,
1180
+ title: u.primaryBare && ie === void 0 ? a.label : void 0,
1181
1181
  ...Se(Ae),
1182
1182
  ...We(Ae, ie !== void 0, I),
1183
1183
  onClick: (o) => {
@@ -1185,7 +1185,7 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
1185
1185
  },
1186
1186
  children: [
1187
1187
  /* @__PURE__ */ n($, { name: a.icon }),
1188
- m.primaryBare ? null : /* @__PURE__ */ f(ge, { children: [
1188
+ u.primaryBare ? null : /* @__PURE__ */ f(ge, { children: [
1189
1189
  " ",
1190
1190
  /* @__PURE__ */ n("span", { children: a.label })
1191
1191
  ] })
@@ -1199,14 +1199,14 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
1199
1199
  className: "cms-button cms-button--primary cms-section-header__split",
1200
1200
  "data-action": "primary-menu",
1201
1201
  "aria-haspopup": "menu",
1202
- "aria-expanded": (c == null ? void 0 : c.which) === "primary",
1202
+ "aria-expanded": (i == null ? void 0 : i.which) === "primary",
1203
1203
  "aria-label": de.menuLabel,
1204
1204
  ...Se("primary-menu"),
1205
1205
  onClick: (o) => me("primary", o.currentTarget),
1206
1206
  children: /* @__PURE__ */ n($, { name: "chevron-down" })
1207
1207
  }
1208
1208
  ) : null,
1209
- ie !== void 0 ? Ee(I, ie, m.primaryBare ? a.label : null) : null
1209
+ ie !== void 0 ? Ee(I, ie, u.primaryBare ? a.label : null) : null
1210
1210
  ] }) : null,
1211
1211
  p ? /* @__PURE__ */ n(
1212
1212
  "button",
@@ -1216,16 +1216,16 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
1216
1216
  className: "cms-section-header__more",
1217
1217
  "data-action": "more",
1218
1218
  "aria-haspopup": "menu",
1219
- "aria-expanded": (c == null ? void 0 : c.which) === "more",
1220
- "aria-label": d,
1221
- title: d,
1219
+ "aria-expanded": (i == null ? void 0 : i.which) === "more",
1220
+ "aria-label": c,
1221
+ title: c,
1222
1222
  ...Se("more"),
1223
1223
  onClick: (o) => me("more", o.currentTarget),
1224
1224
  children: /* @__PURE__ */ n($, { name: "more" })
1225
1225
  }
1226
1226
  ) : null
1227
1227
  ] }),
1228
- /* @__PURE__ */ f("div", { ref: _, className: "cms-section-header__measure", "aria-hidden": "true", children: [
1228
+ /* @__PURE__ */ f("div", { ref: v, className: "cms-section-header__measure", "aria-hidden": "true", children: [
1229
1229
  t !== void 0 ? /* @__PURE__ */ n("span", { "data-measure": "lead", children: /* @__PURE__ */ n($, { name: t }) }) : null,
1230
1230
  /* @__PURE__ */ n("span", { "data-measure": "title", className: "cms-section-header__title", children: e }),
1231
1231
  l !== void 0 ? /* @__PURE__ */ n("span", { "data-measure": "description", className: "cms-section-header__description", children: l }) : null,
@@ -1254,9 +1254,9 @@ function sl({ title: e, icon: t, description: l, meta: s = [], primary: a, secon
1254
1254
  /* @__PURE__ */ n("span", { "data-measure": "more", className: "cms-section-header__more", children: /* @__PURE__ */ n($, { name: "more" }) })
1255
1255
  ] })
1256
1256
  ] }),
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 })
1257
+ d != null ? /* @__PURE__ */ n("div", { className: "cms-section-header__context", "data-row": "2", children: d }) : null,
1258
+ de !== null ? /* @__PURE__ */ n(Ke, { at: (i == null ? void 0 : i.which) === "primary" ? i : null, items: oe, onClose: () => g(null), label: de.menuLabel }) : null,
1259
+ /* @__PURE__ */ n(Ke, { at: (i == null ? void 0 : i.which) === "more" ? i : null, items: q, onClose: () => g(null), label: c })
1260
1260
  ] });
1261
1261
  }
1262
1262
  function pt(e) {
@@ -1264,10 +1264,10 @@ function pt(e) {
1264
1264
  for (const l of e) l.overflow !== void 0 && l.overflow !== 0 && t.set(l.overflow, [...t.get(l.overflow) ?? [], l.id]);
1265
1265
  return [...t.entries()].sort(([l], [s]) => l - s).map(([, l]) => l);
1266
1266
  }
1267
- function al({ head: e, children: t, className: l, scrollRef: s, onScroll: a, bodyProps: i }) {
1267
+ function al({ head: e, children: t, className: l, scrollRef: s, onScroll: a, bodyProps: r }) {
1268
1268
  return /* @__PURE__ */ f("div", { className: F("cms-column", l), children: [
1269
1269
  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 })
1270
+ /* @__PURE__ */ n("div", { ...r, className: F("cms-column__body", r == null ? void 0 : r.className), ref: s, onScroll: a, children: t })
1271
1271
  ] });
1272
1272
  }
1273
1273
  function rl({ title: e, scope: t, actions: l, backLink: s }) {
@@ -1297,42 +1297,42 @@ function rl({ title: e, scope: t, actions: l, backLink: s }) {
1297
1297
  ] });
1298
1298
  }
1299
1299
  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;
1300
+ const a = O([]), r = (m, c) => {
1301
+ var g;
1302
+ 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
1303
  if (b === null) return;
1304
- h.preventDefault();
1305
- const c = e[b];
1306
- c && (l(c.id), (v = a.current[b]) == null || v.focus());
1304
+ m.preventDefault();
1305
+ const i = e[b];
1306
+ i && (l(i.id), (g = a.current[b]) == null || g.focus());
1307
1307
  };
1308
- return /* @__PURE__ */ n("div", { className: "cms-tabs", role: "tablist", "aria-label": s, children: e.map((h, d) => {
1309
- const u = h.id === t;
1308
+ return /* @__PURE__ */ n("div", { className: "cms-tabs", role: "tablist", "aria-label": s, children: e.map((m, c) => {
1309
+ const d = m.id === t;
1310
1310
  return /* @__PURE__ */ f(
1311
1311
  "button",
1312
1312
  {
1313
1313
  ref: (b) => {
1314
- a.current[d] = b;
1314
+ a.current[c] = b;
1315
1315
  },
1316
1316
  type: "button",
1317
1317
  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),
1318
+ className: F("cms-tab", d && "is-active"),
1319
+ "aria-selected": d,
1320
+ tabIndex: d ? 0 : -1,
1321
+ onClick: () => l(m.id),
1322
+ onKeyDown: (b) => r(b, c),
1323
1323
  children: [
1324
- h.label,
1325
- h.count !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-tab__count", children: h.count }) : null
1324
+ m.label,
1325
+ m.count !== void 0 ? /* @__PURE__ */ n("span", { className: "cms-tab__count", children: m.count }) : null
1326
1326
  ]
1327
1327
  },
1328
- h.id
1328
+ m.id
1329
1329
  );
1330
1330
  }) });
1331
1331
  }
1332
1332
  function bt(e) {
1333
1333
  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];
1334
+ var r;
1335
+ return (r = a == null ? void 0 : a.match(/[\p{L}\p{N}]/u)) == null ? void 0 : r[0];
1336
1336
  };
1337
1337
  return (t.length > 1 ? [l(t[0]), l(t[t.length - 1])] : [l(t[0])]).filter(Boolean).join("").toUpperCase();
1338
1338
  }
@@ -1342,19 +1342,19 @@ function _t(e) {
1342
1342
  t = t * 31 + (l.codePointAt(0) ?? 0) >>> 0;
1343
1343
  return t % 6 + 1;
1344
1344
  }
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;
1345
+ function Ye({ name: e, pictureUrl: t, presence: l, connection: s, deleted: a = !1, placeholder: r = !1, size: m = 32, tintSeed: c, unnamedLabel: d }) {
1346
+ 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}`, N = s !== void 0 ? `${g}, ${s.label}` : l ? `${g}, ${l}` : g;
1347
1347
  return /* @__PURE__ */ f(
1348
1348
  "span",
1349
1349
  {
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) },
1350
+ className: F("cms-avatar", b ? "cms-avatar--deleted" : `cms-avatar--tint-${_t(c ?? e)}`),
1351
+ style: { width: m, height: m, fontSize: Math.round(m * 0.4) },
1352
1352
  role: "img",
1353
1353
  "aria-label": N,
1354
1354
  ...s === void 0 ? {} : { title: s.label },
1355
1355
  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" })
1356
+ 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 }),
1357
+ u === null ? null : /* @__PURE__ */ n("span", { className: F("cms-avatar__presence", u), "aria-hidden": "true" })
1358
1358
  ]
1359
1359
  }
1360
1360
  );
@@ -1384,26 +1384,26 @@ function wt(e) {
1384
1384
  } catch {
1385
1385
  }
1386
1386
  }
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);
1387
+ function yt({ storageKey: e, value: t, default: l, min: s, max: a, step: r = 16, label: m, onChange: c, className: d, style: b }) {
1388
+ const i = Math.max(s, a), g = (v) => Math.round(Math.min(Math.max(v, s), i)), [u, N] = D(() => {
1389
+ const v = e === void 0 ? null : tn(e);
1390
+ return g(v ?? l);
1391
+ }), h = g(t ?? u), _ = O(null), [k, x] = D(!1);
1392
1392
  $e(() => {
1393
1393
  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));
1394
+ const v = tn(e);
1395
+ if (v === null) return;
1396
+ const y = g(v);
1397
+ (t === void 0 || y !== g(t)) && (N(y), c(y, !0));
1398
1398
  }, []), $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);
1399
+ t !== void 0 && g(t) !== t && c(g(t), !0);
1400
+ }, [t, s, i]);
1401
+ const C = (v, y) => {
1402
+ const I = g(v);
1403
+ N(I), y && gt(e, I), c(I, y);
1404
+ }, A = () => {
1405
+ const v = _.current;
1406
+ _.current = null, x(!1), v !== null && v.last !== v.from && C(v.last, !0);
1407
1407
  };
1408
1408
  return /* @__PURE__ */ n(
1409
1409
  "div",
@@ -1411,33 +1411,33 @@ function yt({ storageKey: e, value: t, default: l, min: s, max: a, step: i = 16,
1411
1411
  role: "separator",
1412
1412
  tabIndex: 0,
1413
1413
  "aria-orientation": "vertical",
1414
- "aria-label": h,
1415
- "aria-valuenow": r,
1414
+ "aria-label": m,
1415
+ "aria-valuenow": h,
1416
1416
  "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),
1417
+ "aria-valuemax": i,
1418
+ className: F("cms-splitter", k && "is-dragging", h <= s && "is-at-min", h >= i && "is-at-max", d),
1419
1419
  style: b,
1420
- onPointerDown: (_) => {
1420
+ onPointerDown: (v) => {
1421
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);
1422
+ if (v.button > 0) return;
1423
+ v.preventDefault(), (U = (I = v.currentTarget).setPointerCapture) == null || U.call(I, v.pointerId);
1424
+ const y = getComputedStyle(v.currentTarget).direction === "rtl" ? -1 : 1;
1425
+ _.current = { x: v.clientX, from: h, last: h, sign: y }, x(!0);
1426
1426
  },
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));
1427
+ onPointerMove: (v) => {
1428
+ const y = _.current;
1429
+ y === null || !Number.isFinite(v.clientX) || (y.last = g(y.from + y.sign * (v.clientX - y.x)), C(y.last, !1));
1430
1430
  },
1431
- onPointerUp: x,
1432
- onPointerCancel: x,
1431
+ onPointerUp: A,
1432
+ onPointerCancel: A,
1433
1433
  onDoubleClick: () => {
1434
1434
  wt(e);
1435
- const _ = v(l);
1436
- N(_), d(_, !0);
1435
+ const v = g(l);
1436
+ N(v), c(v, !0);
1437
1437
  },
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));
1438
+ onKeyDown: (v) => {
1439
+ const y = v.shiftKey ? vt : r, I = getComputedStyle(v.currentTarget).direction === "rtl" ? -1 : 1, U = v.key === "ArrowLeft" ? h - I * y : v.key === "ArrowRight" ? h + I * y : v.key === "Home" ? s : v.key === "End" ? i : null;
1440
+ U !== null && (v.preventDefault(), C(U, !0));
1441
1441
  }
1442
1442
  }
1443
1443
  );
@@ -1448,50 +1448,50 @@ function Nt({ count: e, label: t, max: l = 99 }) {
1448
1448
  /* @__PURE__ */ n("span", { className: "cms-visually-hidden", children: t })
1449
1449
  ] });
1450
1450
  }
1451
- function cl({ product: e, mark: t, rail: l, active: s, onNavigate: a, server: i, search: h, account: d, children: u, railLabel: b = "Sections" }) {
1451
+ function ol({ product: e, mark: t, rail: l, active: s, onNavigate: a, server: r, search: m, account: c, children: d, railLabel: b = "Sections" }) {
1452
1452
  return /* @__PURE__ */ f("div", { className: "cms-shell", children: [
1453
1453
  /* @__PURE__ */ f("nav", { className: "cms-shell__rail", "aria-label": b, children: [
1454
1454
  /* @__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;
1455
+ /* @__PURE__ */ n("ul", { className: "cms-shell__items", children: l.map((i) => {
1456
+ const g = i.id === s;
1457
1457
  return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ f(
1458
1458
  "a",
1459
1459
  {
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));
1460
+ href: i.href,
1461
+ className: F("cms-shell__item", g && "is-active"),
1462
+ "aria-current": g ? "page" : void 0,
1463
+ title: i.label,
1464
+ onClick: (u) => {
1465
+ a && (u.preventDefault(), a(i.id));
1466
1466
  },
1467
1467
  children: [
1468
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
1469
+ /* @__PURE__ */ n($, { name: i.icon, size: 22 }),
1470
+ i.badge ? /* @__PURE__ */ n(Nt, { count: i.badge.count, label: i.badge.label }) : null
1471
1471
  ] }),
1472
- /* @__PURE__ */ n("span", { className: "cms-shell__label", children: c.label })
1472
+ /* @__PURE__ */ n("span", { className: "cms-shell__label", children: i.label })
1473
1473
  ]
1474
1474
  }
1475
- ) }, c.id);
1475
+ ) }, i.id);
1476
1476
  }) })
1477
1477
  ] }),
1478
1478
  /* @__PURE__ */ f("header", { className: "cms-shell__top", children: [
1479
1479
  /* @__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
1480
+ r != null ? /* @__PURE__ */ n("div", { className: "cms-shell__server", children: r }) : null,
1481
+ m != null ? /* @__PURE__ */ n("div", { className: "cms-shell__search", children: m }) : null,
1482
+ c != null ? /* @__PURE__ */ n("div", { className: "cms-shell__account", children: c }) : null
1483
1483
  ] }),
1484
- /* @__PURE__ */ n("main", { className: "cms-shell__main", children: u })
1484
+ /* @__PURE__ */ n("main", { className: "cms-shell__main", children: d })
1485
1485
  ] });
1486
1486
  }
1487
- function ol({ label: e, placeholder: t, value: l, onChange: s, onSearch: a }) {
1487
+ function cl({ label: e, placeholder: t, value: l, onChange: s, onSearch: a }) {
1488
1488
  return /* @__PURE__ */ f(
1489
1489
  "form",
1490
1490
  {
1491
1491
  role: "search",
1492
1492
  className: "cms-search",
1493
- onSubmit: (i) => {
1494
- i.preventDefault(), a == null || a(l);
1493
+ onSubmit: (r) => {
1494
+ r.preventDefault(), a == null || a(l);
1495
1495
  },
1496
1496
  children: [
1497
1497
  /* @__PURE__ */ n($, { name: "search", size: 18 }),
@@ -1503,7 +1503,7 @@ function ol({ label: e, placeholder: t, value: l, onChange: s, onSearch: a }) {
1503
1503
  "aria-label": e,
1504
1504
  placeholder: t,
1505
1505
  value: l,
1506
- onChange: (i) => s(i.target.value)
1506
+ onChange: (r) => s(r.target.value)
1507
1507
  }
1508
1508
  )
1509
1509
  ]
@@ -1511,64 +1511,64 @@ function ol({ label: e, placeholder: t, value: l, onChange: s, onSearch: a }) {
1511
1511
  );
1512
1512
  }
1513
1513
  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;
1514
+ const s = e.map((r) => Math.min(Math.max(r.width, r.min), r.max));
1515
+ let a = s.reduce((r, m) => r + m, 0) + l - t;
1516
+ for (let r = s.length - 1; r >= 0 && a > 0; r -= 1) {
1517
+ const m = Math.min(a, s[r] - e[r].min);
1518
+ s[r] = s[r] - m, a -= m;
1519
1519
  }
1520
1520
  return s;
1521
1521
  }
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);
1522
+ function dl({ panes: e, active: t, back: l, sizes: s, lastMin: a = 360, onResize: r, storageKey: m }) {
1523
+ const c = Math.min(Math.max(t ?? e.length - 1, 0), e.length - 1), d = O(null), [b, i] = D(0), g = (s ?? []).slice(0, e.length - 1), [u, N] = D(() => m === void 0 ? [] : g.map((v, y) => tn(`${m}:${String(y)}`) ?? void 0)), [h, _] = D(!1), k = g.map((v, y) => v !== void 0 && u[y] !== void 0 ? { ...v, width: u[y] } : v), x = k.length === e.length - 1 && k.every((v) => v !== void 0);
1524
1524
  $e(() => {
1525
- const _ = u.current;
1526
- if (_ === null || !C) return;
1527
- const y = () => c(_.clientWidth);
1525
+ const v = d.current;
1526
+ if (v === null || !x) return;
1527
+ const y = () => i(v.clientWidth);
1528
1528
  if (y(), typeof ResizeObserver > "u") return;
1529
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
+ return I.observe(v), () => I.disconnect();
1531
+ }, [x]);
1532
+ const C = x ? kt(k, b > 0 ? b : Number.POSITIVE_INFINITY, a) : [], A = x ? Object.fromEntries(C.flatMap((v, y) => [
1533
+ [`--split-pane-${String(y)}`, `${String(v)}px`],
1534
+ [`--split-pane-end-${String(y)}`, `${String(C.slice(0, y + 1).reduce((I, U) => I + U, 0))}px`]
1535
1535
  ])) : void 0;
1536
1536
  return /* @__PURE__ */ f(
1537
1537
  "div",
1538
1538
  {
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,
1539
+ ref: d,
1540
+ className: F("cms-panes", e.length === 3 ? "cms-panes--three" : "cms-panes--two", x && "cms-panes--sized", h && "is-resizing"),
1541
+ "data-active": c,
1542
+ style: A,
1543
1543
  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: [
1544
+ e.map((v, y) => /* @__PURE__ */ f("section", { className: "cms-panes__pane", "aria-label": v.label, "data-offset": c - y, children: [
1545
+ y === c && l ? /* @__PURE__ */ f("a", { className: "cms-panes__back", href: l.href, children: [
1546
1546
  /* @__PURE__ */ n($, { name: "chevron-left", size: 18 }),
1547
1547
  l.label
1548
1548
  ] }) : 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));
1549
+ v.content
1550
+ ] }, v.label)),
1551
+ x ? k.map((v, y) => {
1552
+ const I = C.reduce((P, M, B) => B === y ? P : P + M, 0), U = Math.max(v.min, Math.min(v.max, b > 0 ? b - I - a : v.max));
1553
1553
  return /* @__PURE__ */ n(
1554
1554
  yt,
1555
1555
  {
1556
- ...h === void 0 ? {} : { storageKey: `${h}:${String(y)}` },
1557
- value: S[y],
1558
- default: _.reset,
1559
- min: _.min,
1556
+ ...m === void 0 ? {} : { storageKey: `${m}:${String(y)}` },
1557
+ value: C[y],
1558
+ default: v.reset,
1559
+ min: v.min,
1560
1560
  max: U,
1561
- label: _.label,
1561
+ label: v.label,
1562
1562
  className: "cms-panes__splitter",
1563
1563
  style: { "--split-at": `var(--split-pane-end-${String(y)})` },
1564
- onChange: (P, k) => {
1565
- h !== void 0 && N((B) => {
1564
+ onChange: (P, M) => {
1565
+ m !== void 0 && N((B) => {
1566
1566
  const z = [...B];
1567
1567
  return z[y] = P, z;
1568
- }), g(!k), i == null || i(y, P, k);
1568
+ }), _(!M), r == null || r(y, P, M);
1569
1569
  }
1570
1570
  },
1571
- _.label
1571
+ v.label
1572
1572
  );
1573
1573
  }) : null
1574
1574
  ]
@@ -1576,9 +1576,9 @@ function dl({ panes: e, active: t, back: l, sizes: s, lastMin: a = 360, onResize
1576
1576
  );
1577
1577
  }
1578
1578
  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: [
1579
+ 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 }) {
1580
+ const u = qe(xt, g), N = /* @__PURE__ */ n(Ye, { name: e, size: 40, placeholder: t });
1581
+ return /* @__PURE__ */ f("div", { className: F("cms-mail-row", r && "is-unread", c && "is-selected", i && "is-selecting", (b == null ? void 0 : b.checked) && "is-checked"), children: [
1582
1582
  b !== void 0 ? /* @__PURE__ */ f("span", { className: "cms-mail-row__lead", children: [
1583
1583
  N,
1584
1584
  /* @__PURE__ */ n(
@@ -1593,12 +1593,12 @@ function ul({ from: e, fromPlaceholder: t = !1, subject: l, preview: s, time: a,
1593
1593
  "aria-label": b.label,
1594
1594
  onChange: () => {
1595
1595
  },
1596
- onClick: (r) => {
1597
- if (r.stopPropagation(), b.pending) {
1598
- r.preventDefault();
1596
+ onClick: (h) => {
1597
+ if (h.stopPropagation(), b.pending) {
1598
+ h.preventDefault();
1599
1599
  return;
1600
1600
  }
1601
- b.onCheck({ shift: r.shiftKey, toggle: r.ctrlKey || r.metaKey });
1601
+ b.onCheck({ shift: h.shiftKey, toggle: h.ctrlKey || h.metaKey });
1602
1602
  }
1603
1603
  }
1604
1604
  )
@@ -1608,19 +1608,19 @@ function ul({ from: e, fromPlaceholder: t = !1, subject: l, preview: s, time: a,
1608
1608
  {
1609
1609
  type: "button",
1610
1610
  className: "cms-mail-row__open",
1611
- "aria-current": d ? "true" : void 0,
1612
- onClick: u,
1611
+ "aria-current": c ? "true" : void 0,
1612
+ onClick: d,
1613
1613
  children: [
1614
1614
  b === void 0 ? N : null,
1615
1615
  /* @__PURE__ */ f("span", { className: "cms-mail-row__body", children: [
1616
1616
  /* @__PURE__ */ f("span", { className: "cms-mail-row__line", children: [
1617
1617
  /* @__PURE__ */ n("span", { className: "cms-mail-row__from", children: e }),
1618
- h ? /* @__PURE__ */ n($, { name: "paperclip", size: 16, label: m.attachment }) : null,
1618
+ m ? /* @__PURE__ */ n($, { name: "paperclip", size: 16, label: u.attachment }) : null,
1619
1619
  /* @__PURE__ */ n("span", { className: "cms-mail-row__time", children: a })
1620
1620
  ] }),
1621
1621
  /* @__PURE__ */ f("span", { className: "cms-mail-row__line", children: [
1622
1622
  /* @__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
1623
+ r ? /* @__PURE__ */ n("span", { className: "cms-mail-row__dot", role: "img", "aria-label": u.unread }) : null
1624
1624
  ] }),
1625
1625
  /* @__PURE__ */ n("span", { className: "cms-mail-row__preview", children: s })
1626
1626
  ] })
@@ -1641,31 +1641,31 @@ function ml({ direction: e, children: t, time: l, read: s, readLabel: a = "Read"
1641
1641
  ] })
1642
1642
  ] });
1643
1643
  }
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,
1644
+ 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 }) {
1645
+ const g = he(), u = i ?? t.trim() !== "", N = (_) => {
1646
+ _.preventDefault(), u && s();
1647
+ }, h = a ? /* @__PURE__ */ n("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": d, onClick: a, children: /* @__PURE__ */ n($, { name: "paperclip" }) }) : null;
1648
+ return /* @__PURE__ */ f("form", { className: F("cms-composer", `cms-composer--${m}`), onSubmit: N, children: [
1649
+ /* @__PURE__ */ n("label", { htmlFor: g, className: m === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: e }),
1650
+ m === "chat" ? h : null,
1651
1651
  /* @__PURE__ */ n(
1652
1652
  "textarea",
1653
1653
  {
1654
- id: v,
1654
+ id: g,
1655
1655
  className: "cms-composer__input",
1656
- rows: h === "reply" ? 3 : 1,
1657
- placeholder: i,
1656
+ rows: m === "reply" ? 3 : 1,
1657
+ placeholder: r,
1658
1658
  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());
1659
+ onChange: (_) => l(_.target.value),
1660
+ onKeyDown: (_) => {
1661
+ _.nativeEvent.isComposing || _.keyCode === 229 || m === "chat" && _.key === "Enter" && !_.shiftKey && (_.preventDefault(), u && s());
1662
1662
  }
1663
1663
  }
1664
1664
  ),
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,
1665
+ m === "reply" && b !== void 0 ? /* @__PURE__ */ n("div", { className: "cms-composer__leading", children: b }) : null,
1666
+ m === "reply" ? h : null,
1667
+ m === "chat" ? /* @__PURE__ */ n("button", { type: "submit", className: "cms-composer__send-round", "aria-label": c, disabled: !u, children: /* @__PURE__ */ n($, { name: "send" }) }) : /* @__PURE__ */ f("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !u, children: [
1668
+ c,
1669
1669
  " ",
1670
1670
  /* @__PURE__ */ n($, { name: "send", size: 18 })
1671
1671
  ] })
@@ -1692,15 +1692,15 @@ const mn = {
1692
1692
  onCallWith: (e) => `On a call with ${e}`,
1693
1693
  returnToCall: "Return to call"
1694
1694
  };
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: [
1695
+ function fl({ name: e, namePlaceholder: t = !1, media: l, onAccept: s, onDecline: a, labels: r }) {
1696
+ const m = qe(mn, r), c = l === "video" ? m.incomingVideo : m.incomingAudio;
1697
+ return /* @__PURE__ */ f("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": m.incomingFrom(c, e), children: [
1698
1698
  /* @__PURE__ */ n("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ n(Ye, { name: e, size: 112, placeholder: t }) }),
1699
1699
  /* @__PURE__ */ n("p", { className: "cms-call-incoming__name", children: e }),
1700
- /* @__PURE__ */ n("p", { className: "cms-call-incoming__what", children: d }),
1700
+ /* @__PURE__ */ n("p", { className: "cms-call-incoming__what", children: c }),
1701
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 })
1702
+ /* @__PURE__ */ n(Ue, { icon: "phone-off", label: m.decline, tone: "hang-up", onClick: a }),
1703
+ /* @__PURE__ */ n(Ue, { icon: "phone", label: m.accept, tone: "accept", onClick: s })
1704
1704
  ] })
1705
1705
  ] });
1706
1706
  }
@@ -1719,45 +1719,45 @@ function Ue({ icon: e, label: t, onClick: l, tone: s = "plain", pressed: a }) {
1719
1719
  }
1720
1720
  );
1721
1721
  }
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: [
1722
+ 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 }) {
1723
+ const u = qe(mn, g);
1724
+ return /* @__PURE__ */ f("section", { className: "cms-call-panel", "aria-label": u.callWith(e), children: [
1725
1725
  /* @__PURE__ */ f("div", { className: "cms-call-panel__head", children: [
1726
1726
  /* @__PURE__ */ n(Ye, { name: e, size: 64 }),
1727
1727
  /* @__PURE__ */ f("div", { className: "cms-call-panel__who", children: [
1728
1728
  /* @__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 })
1729
+ /* @__PURE__ */ n("p", { className: "cms-call-panel__time", "aria-label": u.callTime(t), children: t })
1730
1730
  ] }),
1731
- /* @__PURE__ */ n("span", { className: F("cms-pill", l === "good" ? "cms-pill--success" : "cms-pill--warning"), children: l === "good" ? m.goodConnection : m.poorConnection })
1731
+ /* @__PURE__ */ n("span", { className: F("cms-pill", l === "good" ? "cms-pill--success" : "cms-pill--warning"), children: l === "good" ? u.goodConnection : u.poorConnection })
1732
1732
  ] }),
1733
1733
  /* @__PURE__ */ f("div", { className: "cms-call-panel__you", children: [
1734
1734
  /* @__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
1735
+ /* @__PURE__ */ n("span", { children: u.you }),
1736
+ s.speaking ? /* @__PURE__ */ n("span", { className: "cms-call-panel__level", role: "img", "aria-label": u.speaking }) : null
1737
1737
  ] }),
1738
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 })
1739
+ /* @__PURE__ */ n(Ue, { icon: "mic", label: a ? u.unmute : u.mute, pressed: a, onClick: m }),
1740
+ /* @__PURE__ */ n(Ue, { icon: "speaker", label: u.speaker, pressed: r, onClick: c }),
1741
+ d ? /* @__PURE__ */ n(Ue, { icon: "user-plus", label: u.addPerson, onClick: d }) : null,
1742
+ b ? /* @__PURE__ */ n(Ue, { icon: "chat", label: u.chat, onClick: b }) : null,
1743
+ /* @__PURE__ */ n(Ue, { icon: "phone-off", label: u.hangUp, tone: "hang-up", onClick: i })
1744
1744
  ] })
1745
1745
  ] });
1746
1746
  }
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: [
1747
+ function bl({ name: e, duration: t, muted: l, onToggleMute: s, onReturn: a, onHangUp: r, labels: m }) {
1748
+ const c = qe(mn, m);
1749
+ return /* @__PURE__ */ f("section", { className: "cms-call-bar", "aria-label": c.callWith(e), children: [
1750
1750
  /* @__PURE__ */ n("span", { className: "cms-call-bar__live", "aria-hidden": "true" }),
1751
- /* @__PURE__ */ n("span", { className: "cms-call-bar__name", children: d.onCallWith(e) }),
1751
+ /* @__PURE__ */ n("span", { className: "cms-call-bar__name", children: c.onCallWith(e) }),
1752
1752
  /* @__PURE__ */ n("span", { className: "cms-call-bar__time", children: t }),
1753
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" }) })
1754
+ /* @__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" }) }),
1755
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-button cms-button--primary", onClick: a, children: c.returnToCall }),
1756
+ /* @__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
1757
  ] })
1758
1758
  ] });
1759
1759
  }
1760
- function _l({ mark: e, product: t, headline: l, lead: s, features: a = [], children: i }) {
1760
+ function _l({ mark: e, product: t, headline: l, lead: s, features: a = [], children: r }) {
1761
1761
  return /* @__PURE__ */ f("div", { className: "cms-signin", children: [
1762
1762
  /* @__PURE__ */ f("aside", { className: "cms-signin__brand", children: [
1763
1763
  /* @__PURE__ */ f("p", { className: "cms-signin__logo", children: [
@@ -1767,13 +1767,13 @@ function _l({ mark: e, product: t, headline: l, lead: s, features: a = [], child
1767
1767
  /* @__PURE__ */ f("div", { className: "cms-signin__pitch", children: [
1768
1768
  /* @__PURE__ */ n("p", { className: "cms-signin__headline", children: l }),
1769
1769
  /* @__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
1770
+ a.length ? /* @__PURE__ */ n("ul", { className: "cms-signin__features", children: a.map((m) => /* @__PURE__ */ f("li", { children: [
1771
+ /* @__PURE__ */ n($, { name: m.icon, size: 18 }),
1772
+ m.label
1773
+ ] }, m.label)) }) : null
1774
1774
  ] })
1775
1775
  ] }),
1776
- /* @__PURE__ */ n("main", { className: "cms-signin__form", children: i })
1776
+ /* @__PURE__ */ n("main", { className: "cms-signin__form", children: r })
1777
1777
  ] });
1778
1778
  }
1779
1779
  const Mt = {
@@ -1788,52 +1788,52 @@ const Mt = {
1788
1788
  newHere: "New here?",
1789
1789
  create: "Create an account"
1790
1790
  };
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 }),
1791
+ function vl({ server: e, onSubmit: t, forgotHref: l, createHref: s, error: a, busy: r, labels: m }) {
1792
+ const c = qe(Mt, m), d = he(), [b, i] = D(""), [g, u] = D(""), [N, h] = D(!1);
1793
+ return /* @__PURE__ */ f("form", { className: "cms-signin-form", onSubmit: (k) => {
1794
+ k.preventDefault(), t(b, g);
1795
+ }, "aria-describedby": a ? `${d}-error` : void 0, children: [
1796
+ /* @__PURE__ */ n("h1", { className: "cms-signin-form__title", children: c.title }),
1797
1797
  /* @__PURE__ */ f("p", { className: "cms-signin-form__server", children: [
1798
1798
  /* @__PURE__ */ n($, { name: "server", size: 18 }),
1799
1799
  e
1800
1800
  ] }),
1801
- /* @__PURE__ */ n("label", { className: "cms-signin-form__label", htmlFor: `${u}-identifier`, children: d.identifier }),
1801
+ /* @__PURE__ */ n("label", { className: "cms-signin-form__label", htmlFor: `${d}-identifier`, children: c.identifier }),
1802
1802
  /* @__PURE__ */ n(
1803
1803
  "input",
1804
1804
  {
1805
- id: `${u}-identifier`,
1805
+ id: `${d}-identifier`,
1806
1806
  className: "cms-signin-form__input",
1807
1807
  type: "text",
1808
1808
  autoComplete: "username",
1809
- placeholder: d.identifierPlaceholder,
1809
+ placeholder: c.identifierPlaceholder,
1810
1810
  value: b,
1811
- onChange: (T) => c(T.target.value),
1811
+ onChange: (k) => i(k.target.value),
1812
1812
  required: !0
1813
1813
  }
1814
1814
  ),
1815
- /* @__PURE__ */ n("label", { className: "cms-signin-form__label", htmlFor: `${u}-password`, children: d.password }),
1815
+ /* @__PURE__ */ n("label", { className: "cms-signin-form__label", htmlFor: `${d}-password`, children: c.password }),
1816
1816
  /* @__PURE__ */ f("span", { className: "cms-signin-form__password", children: [
1817
1817
  /* @__PURE__ */ n(
1818
1818
  "input",
1819
1819
  {
1820
- id: `${u}-password`,
1820
+ id: `${d}-password`,
1821
1821
  className: "cms-signin-form__input",
1822
1822
  type: N ? "text" : "password",
1823
1823
  autoComplete: "current-password",
1824
- value: v,
1825
- onChange: (T) => m(T.target.value),
1824
+ value: g,
1825
+ onChange: (k) => u(k.target.value),
1826
1826
  required: !0
1827
1827
  }
1828
1828
  ),
1829
- /* @__PURE__ */ n("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": N, onClick: () => r((T) => !T), children: N ? d.hide : d.show })
1829
+ /* @__PURE__ */ n("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": N, onClick: () => h((k) => !k), children: N ? c.hide : c.show })
1830
1830
  ] }),
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 }),
1831
+ l ? /* @__PURE__ */ n("a", { className: "cms-signin-form__forgot", href: l, children: c.forgot }) : null,
1832
+ a ? /* @__PURE__ */ n("p", { id: `${d}-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: r, "aria-busy": r || void 0, children: c.submit }),
1834
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 })
1835
+ /* @__PURE__ */ n("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ n("span", { children: c.newHere }) }),
1836
+ /* @__PURE__ */ n("a", { className: "cms-button cms-signin-form__create", href: s, children: c.create })
1837
1837
  ] }) : null
1838
1838
  ] });
1839
1839
  }
@@ -1866,8 +1866,8 @@ function fn(e, t) {
1866
1866
  return e.find((l) => l.id === t) ?? e[0];
1867
1867
  }
1868
1868
  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;
1869
+ var r;
1870
+ const t = O(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
1871
  Q(() => {
1872
1872
  a === null ? t.current = null : t.current !== l && (t.current = l, e == null || e.onChange(a));
1873
1873
  }, [a, l]);
@@ -1876,33 +1876,33 @@ function In({ iconOnly: e = !1, onOpenChange: t, ...l }) {
1876
1876
  return l.options.length < 2 ? null : /* @__PURE__ */ n(St, { ...l, iconOnly: e, onOpenChange: t });
1877
1877
  }
1878
1878
  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 });
1879
+ const [s, a] = D(null), r = Ie(() => a(null), []), m = O(!1), c = s !== null;
1880
+ Q(() => (t == null || t(c), () => t == null ? void 0 : t(!1)), [c, t]);
1881
+ const d = An(l), b = d !== null && !e, i = Tn(l), g = (u, N) => {
1882
+ const h = u.getBoundingClientRect();
1883
+ a({ x: h.left, y: h.bottom + 4, focus: N });
1884
1884
  };
1885
1885
  return /* @__PURE__ */ f(ge, { children: [
1886
1886
  /* @__PURE__ */ n(
1887
1887
  "button",
1888
1888
  {
1889
1889
  type: "button",
1890
- className: F("cms-filter-menu", u !== null && "cms-filter-menu--active", b && "cms-filter-menu--named"),
1890
+ className: F("cms-filter-menu", d !== null && "cms-filter-menu--active", b && "cms-filter-menu--named"),
1891
1891
  "aria-haspopup": "menu",
1892
- "aria-expanded": d,
1893
- "aria-label": c,
1894
- title: c,
1892
+ "aria-expanded": c,
1893
+ "aria-label": i,
1894
+ title: i,
1895
1895
  onMouseDown: () => {
1896
- h.current = d;
1896
+ m.current = c;
1897
1897
  },
1898
- onClick: (m) => {
1899
- d || h.current ? i() : v(m.currentTarget, "current"), h.current = !1;
1898
+ onClick: (u) => {
1899
+ c || m.current ? r() : g(u.currentTarget, "current"), m.current = !1;
1900
1900
  },
1901
- onKeyDown: (m) => {
1902
- h.current = !1, (m.key === "ArrowDown" || m.key === "ArrowUp") && (m.preventDefault(), v(m.currentTarget, m.key === "ArrowUp" ? "last" : "current"));
1901
+ onKeyDown: (u) => {
1902
+ m.current = !1, (u.key === "ArrowDown" || u.key === "ArrowUp") && (u.preventDefault(), g(u.currentTarget, u.key === "ArrowUp" ? "last" : "current"));
1903
1903
  },
1904
1904
  children: b ? /* @__PURE__ */ f(ge, { children: [
1905
- /* @__PURE__ */ n("span", { className: "cms-filter-menu__choice", children: u.label }),
1905
+ /* @__PURE__ */ n("span", { className: "cms-filter-menu__choice", children: d.label }),
1906
1906
  /* @__PURE__ */ n($, { name: "chevron-down", size: 16 })
1907
1907
  ] }) : /* @__PURE__ */ n($, { name: "funnel" })
1908
1908
  }
@@ -1912,7 +1912,7 @@ function St({ iconOnly: e, onOpenChange: t, ...l }) {
1912
1912
  {
1913
1913
  at: s,
1914
1914
  items: Ln(l),
1915
- onClose: i,
1915
+ onClose: r,
1916
1916
  label: l.label,
1917
1917
  focus: s == null ? void 0 : s.focus
1918
1918
  }
@@ -1940,43 +1940,43 @@ function Tt(e) {
1940
1940
  for (const l of e) l.overflow !== void 0 && l.overflow !== 0 && t.set(l.overflow, [...t.get(l.overflow) ?? [], l.id]);
1941
1941
  return [...t.entries()].sort(([l], [s]) => l - s).map(([, l]) => l);
1942
1942
  }
1943
- function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leading: i }) {
1943
+ function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leading: r }) {
1944
1944
  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;
1945
+ const m = t.filter((p) => p.entries === void 0 || p.entries.length > 0), c = O(null), d = O(null), b = O(null), [i, g] = D(kn), [u, N] = D(null), [h, _] = D("first"), [k, x] = D(null), [C, A] = D(null), v = At(m), y = v.flat(), I = ((q = y.find((p) => p.primary === !0 && p.overflow !== 0)) == null ? void 0 : q.id) ?? null, U = Tt(m.filter((p) => p.id !== I)), P = y.filter((p) => p.overflow === 0), M = y.filter((p) => p.overflow !== 0), B = P.length === 1 ? P[0] ?? null : null, z = 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([...P.filter((L) => L !== B || p.size > 0).map((L) => L.id), ...p]), K = Ie(() => {
1946
+ const p = c.current, L = d.current;
1947
1947
  if (p === null || L === null) return;
1948
- 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;
1948
+ const Z = getComputedStyle(p), ue = parseFloat(Z.columnGap || "0") || 0, ae = p.clientWidth - (parseFloat(Z.paddingLeft) || 0) - (parseFloat(Z.paddingRight) || 0), me = (T) => {
1949
+ var S;
1950
+ return ((S = L.querySelector(T)) == null ? void 0 : S.getBoundingClientRect().width) ?? 0;
1951
+ }, Se = me('[data-measure="leading"]'), We = me('[data-measure="separator"]'), Fe = me('[data-measure="more"]'), Te = (T, S) => me(`[data-measure="${S ? "full" : "icon"}"][data-measure-action="${CSS.escape(T)}"]`), Ee = (T, S) => {
1952
+ const H = j(S), le = B !== null && !H.has(B.id) ? B : null, J = v.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, !T.has(V.id)), 0) + We * Math.max(0, J.length - 1) + (H.size > 0 ? Fe : 0) + ue * Math.max(0, Re - 1);
1954
+ }, R = M.filter((T) => T.id !== I && !U.some((S) => S.includes(T.id))).map((T) => T.id), X = [...U, ...[...R].reverse().map((T) => [T]), ...I !== null ? [[I]] : []], Ne = [...B !== null ? [[B.id]] : [], ...X];
1955
+ let ce = null;
1956
+ if (Ee(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= ae) ce = kn;
1957
1957
  else {
1958
- const A = /* @__PURE__ */ new Set();
1959
- for (const M of Ne) {
1960
- for (const H of M) A.add(H);
1961
- if (Ee(A, /* @__PURE__ */ new Set()) <= ae) {
1962
- oe = { bare: A, hidden: /* @__PURE__ */ new Set() };
1958
+ const T = /* @__PURE__ */ new Set();
1959
+ for (const S of Ne) {
1960
+ for (const H of S) T.add(H);
1961
+ if (Ee(T, /* @__PURE__ */ new Set()) <= ae) {
1962
+ ce = { bare: T, hidden: /* @__PURE__ */ new Set() };
1963
1963
  break;
1964
1964
  }
1965
1965
  }
1966
1966
  }
1967
- if (oe === null) {
1968
- const A = new Set(Ne.flat()), M = /* @__PURE__ */ new Set(), H = () => M.size + P.length >= 2;
1967
+ if (ce === null) {
1968
+ const T = new Set(Ne.flat()), S = /* @__PURE__ */ new Set(), H = () => S.size + P.length >= 2;
1969
1969
  for (const le of X) {
1970
- for (const J of le) M.add(J);
1971
- if (H() && Ee(A, M) <= ae) break;
1970
+ for (const J of le) S.add(J);
1971
+ if (H() && Ee(T, S) <= ae) break;
1972
1972
  }
1973
- H() || M.clear(), oe = { bare: A, hidden: M };
1973
+ H() || S.clear(), ce = { bare: T, hidden: S };
1974
1974
  }
1975
- const o = oe;
1976
- v((A) => xn(A.bare, o.bare) && xn(A.hidden, o.hidden) ? A : o);
1975
+ const o = ce;
1976
+ g((T) => xn(T.bare, o.bare) && xn(T.hidden, o.hidden) ? T : o);
1977
1977
  }, [z]);
1978
1978
  $e(K, [K]), Q(() => {
1979
- const p = d.current;
1979
+ const p = c.current;
1980
1980
  if (p === null || typeof ResizeObserver > "u") return;
1981
1981
  const L = new ResizeObserver(() => K());
1982
1982
  return L.observe(p), () => L.disconnect();
@@ -1991,18 +1991,18 @@ function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leadin
1991
1991
  L = !1, p.removeEventListener("loadingdone", Z);
1992
1992
  };
1993
1993
  }, [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),
1994
+ const G = j(i.hidden), Y = B !== null && !G.has(B.id) ? B : null, ee = (p) => G.has(p.id) || p === Y, be = [...v.map((p) => p.filter((L) => !ee(L))).filter((p) => p.length > 0).flat(), ...Y !== null ? [Y] : []], oe = (p) => y.find((L) => L.id === p), de = [...U.flat(), ...M.filter((p) => p.id !== I && !U.some((L) => L.includes(p.id))).map((p) => p.id).reverse()], Ce = [
1995
+ ...I !== null && i.hidden.has(I) ? [oe(I)] : [],
1996
+ ...de.filter((p) => i.hidden.has(p)).map(oe),
1997
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) => {
1998
+ ].filter((p) => p !== void 0 && G.has(p.id)), fe = new Set(M.filter((p) => !U.some((L) => L.includes(p.id))).map((p) => p.id)), te = [...be.map((p) => p.id), ...Ce.length > 0 ? ["more"] : []], pe = k !== null && te.includes(k) ? k : te[0] ?? null, _e = (p) => {
1999
1999
  var ae, me;
2000
2000
  const L = te.indexOf(pe ?? "");
2001
2001
  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;
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" && A(pe), Z === null) return;
2003
2003
  p.preventDefault();
2004
2004
  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();
2005
+ x(ue), (me = (ae = c.current) == null ? void 0 : ae.querySelector(`[data-stop="${CSS.escape(ue ?? "")}"]`)) == null || me.focus();
2006
2006
  }, we = Ce.map((p) => ({
2007
2007
  id: p.id,
2008
2008
  label: /* @__PURE__ */ f(ge, { children: [
@@ -2019,9 +2019,9 @@ function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leadin
2019
2019
  return;
2020
2020
  }
2021
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 });
2022
+ _("first"), N({ which: p.id, x: (L == null ? void 0 : L.left) ?? 0, y: (L == null ? void 0 : L.bottom) ?? 0 });
2023
2023
  }
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) => ({
2024
+ })), ne = u === null || u.which === "more" ? void 0 : y.find((p) => p.id === u.which), ye = ((ne == null ? void 0 : ne.entries) ?? []).map((p) => ({
2025
2025
  id: p.id,
2026
2026
  label: /* @__PURE__ */ f(ge, { children: [
2027
2027
  p.icon !== void 0 ? /* @__PURE__ */ n(je, { name: p.icon }) : null,
@@ -2034,23 +2034,23 @@ function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leadin
2034
2034
  }
2035
2035
  })), w = (p, L, Z) => {
2036
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(
2037
+ _(Z), N({ which: p, x: ue.left, y: ue.bottom });
2038
+ }, E = M.length + (B !== null ? 1 : 0), W = (p) => /* @__PURE__ */ n(
2039
2039
  Lt,
2040
2040
  {
2041
2041
  action: p,
2042
2042
  primary: p.id === I,
2043
- labels: !c.bare.has(p.id),
2043
+ labels: !i.bare.has(p.id),
2044
2044
  overflowed: G.has(p.id),
2045
2045
  pinned: fe.has(p.id),
2046
2046
  tabbable: pe === p.id,
2047
- tipOff: S === p.id,
2048
- menuOpen: (m == null ? void 0 : m.which) === p.id,
2047
+ tipOff: C === p.id,
2048
+ menuOpen: (u == null ? void 0 : u.which) === p.id,
2049
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");
2050
+ p.entries === void 0 ? l(p.id) : (u == null ? void 0 : u.which) === p.id && Z === null ? N(null) : w(p.id, L, Z ?? "first");
2051
2051
  },
2052
2052
  onFocus: () => {
2053
- C(p.id), x(null);
2053
+ x(p.id), A(null);
2054
2054
  }
2055
2055
  },
2056
2056
  p.id
@@ -2058,19 +2058,19 @@ function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leadin
2058
2058
  return /* @__PURE__ */ f(
2059
2059
  "div",
2060
2060
  {
2061
- ref: d,
2061
+ ref: c,
2062
2062
  role: "toolbar",
2063
2063
  "aria-label": e,
2064
2064
  className: F(
2065
2065
  "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"
2066
+ E > 0 && i.bare.size >= E && "cms-pane-toolbar--labels-hidden",
2067
+ i.bare.size > 0 && i.bare.size < E && "cms-pane-toolbar--labels-partly-hidden"
2068
2068
  ),
2069
2069
  onKeyDown: _e,
2070
2070
  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)));
2071
+ r !== void 0 ? /* @__PURE__ */ n("div", { className: "cms-pane-toolbar__leading", children: r }) : null,
2072
+ v.map((p, L) => {
2073
+ const Z = p.filter((ae) => !ee(ae)), ue = v.slice(0, L).some((ae) => ae.some((me) => !ee(me)));
2074
2074
  return /* @__PURE__ */ f("div", { className: "cms-pane-toolbar__group-wrap", children: [
2075
2075
  Z.length > 0 && ue ? /* @__PURE__ */ n("span", { className: "cms-pane-toolbar__separator", role: "separator", "aria-orientation": "vertical" }) : null,
2076
2076
  /* @__PURE__ */ n("div", { className: "cms-pane-toolbar__group", hidden: Z.length === 0, children: p.filter((ae) => ae !== Y).map((ae) => W(ae)) })
@@ -2087,11 +2087,11 @@ function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leadin
2087
2087
  "aria-label": a,
2088
2088
  title: a,
2089
2089
  "aria-haspopup": "menu",
2090
- "aria-expanded": (m == null ? void 0 : m.which) === "more",
2090
+ "aria-expanded": (u == null ? void 0 : u.which) === "more",
2091
2091
  tabIndex: pe === "more" ? 0 : -1,
2092
- onFocus: () => C("more"),
2092
+ onFocus: () => x("more"),
2093
2093
  onClick: (p) => {
2094
- (m == null ? void 0 : m.which) === "more" ? N(null) : w("more", p.currentTarget, "first");
2094
+ (u == null ? void 0 : u.which) === "more" ? N(null) : w("more", p.currentTarget, "first");
2095
2095
  },
2096
2096
  onKeyDown: (p) => {
2097
2097
  (p.key === "ArrowDown" || p.key === "ArrowUp") && (p.preventDefault(), p.stopPropagation(), w("more", p.currentTarget, p.key === "ArrowUp" ? "last" : "first"));
@@ -2100,10 +2100,10 @@ function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leadin
2100
2100
  }
2101
2101
  ) : null,
2102
2102
  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,
2103
+ /* @__PURE__ */ n(Ke, { at: (u == null ? void 0 : u.which) === "more" ? u : null, items: we, onClose: () => N(null), label: a, focus: h }),
2104
+ /* @__PURE__ */ n(Ke, { at: ne !== void 0 ? u : null, items: ye, onClose: () => N(null), label: (ne == null ? void 0 : ne.label) ?? "", focus: h }),
2105
+ /* @__PURE__ */ f("div", { ref: d, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
2106
+ r !== void 0 ? /* @__PURE__ */ n("div", { "data-measure": "leading", children: r }) : null,
2107
2107
  /* @__PURE__ */ n("span", { "data-measure": "separator", className: "cms-pane-toolbar__separator" }),
2108
2108
  /* @__PURE__ */ n("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ n($, { name: "more" }) }),
2109
2109
  y.map((p) => /* @__PURE__ */ f("span", { children: [
@@ -2123,22 +2123,22 @@ function wl({ label: e, actions: t, onAction: l, status: s, moreLabel: a, leadin
2123
2123
  );
2124
2124
  }
2125
2125
  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);
2126
+ function Lt({ action: e, primary: t, labels: l, overflowed: s, pinned: a, tabbable: r, tipOff: m, menuOpen: c, onChoose: d, onFocus: b }) {
2127
+ const [i, g] = D(!1);
2128
2128
  Q(() => {
2129
2129
  if (!e.busy) {
2130
- v(!1);
2130
+ g(!1);
2131
2131
  return;
2132
2132
  }
2133
- const y = setTimeout(() => v(!0), en);
2133
+ const y = setTimeout(() => g(!0), en);
2134
2134
  return () => clearTimeout(y);
2135
2135
  }, [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;
2136
+ const u = Be(e.icon) === null, N = l || u, h = e.disabled && e.reason ? e.reason : null, _ = h ?? (N ? null : e.label), k = he(), [x, C] = D(!1), A = dn(), v = e.entries !== void 0;
2137
2137
  return /* @__PURE__ */ f(
2138
2138
  "button",
2139
2139
  {
2140
2140
  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"),
2141
+ className: F("cms-pane-toolbar__action", t && "cms-pane-toolbar__action--primary", !N && "cms-pane-toolbar__action--bare", u && "cms-pane-toolbar__action--text", v && "cms-pane-toolbar__action--menu", e.danger && "is-danger"),
2142
2142
  "data-action": e.id,
2143
2143
  "data-stop": e.id,
2144
2144
  ...s ? { "data-overflowed": "" } : {},
@@ -2147,30 +2147,30 @@ function Lt({ action: e, primary: t, labels: l, overflowed: s, pinned: a, tabbab
2147
2147
  "aria-label": e.label,
2148
2148
  "aria-disabled": e.disabled || void 0,
2149
2149
  "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,
2150
+ ...v ? { "aria-haspopup": "menu", "aria-expanded": c } : {},
2151
+ ...h === null ? {} : { "aria-describedby": k },
2152
+ ...x && h !== null ? { "data-reason-shown": "" } : {},
2153
+ ...A.dismissed(Pe) ? { "data-tip-dismissed": "" } : {},
2154
+ tabIndex: r ? 0 : -1,
2155
2155
  onFocus: () => {
2156
- b(), x.focusIn(Pe);
2156
+ b(), A.focusIn(Pe);
2157
2157
  },
2158
2158
  onBlur: () => {
2159
- S(!1), x.focusOut(Pe);
2159
+ C(!1), A.focusOut(Pe);
2160
2160
  },
2161
- onMouseEnter: () => x.pointerIn(Pe),
2162
- onMouseLeave: () => x.pointerOut(Pe),
2161
+ onMouseEnter: () => A.pointerIn(Pe),
2162
+ onMouseLeave: () => A.pointerOut(Pe),
2163
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"));
2164
+ y.key === "Escape" && (C(!1), A.dismiss(Pe)), v && (y.key === "ArrowDown" || y.key === "ArrowUp") && (y.preventDefault(), h !== null ? C(!0) : !e.disabled && !e.busy && d(y.currentTarget, y.key === "ArrowUp" ? "last" : "first"));
2165
2165
  },
2166
2166
  onClick: (y) => {
2167
- r !== null ? (S(!0), x.show(Pe)) : !e.disabled && !e.busy && u(y.currentTarget, null);
2167
+ h !== null ? (C(!0), A.show(Pe)) : !e.disabled && !e.busy && d(y.currentTarget, null);
2168
2168
  },
2169
2169
  children: [
2170
- c ? /* @__PURE__ */ n(se, { name: "spinner" }) : /* @__PURE__ */ n(je, { name: e.icon }),
2170
+ i ? /* @__PURE__ */ n(se, { name: "spinner" }) : /* @__PURE__ */ n(je, { name: e.icon }),
2171
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
2172
+ v ? /* @__PURE__ */ n(ln, {}) : null,
2173
+ h !== null || _ !== null && !m ? /* @__PURE__ */ n("span", { className: "cms-pane-toolbar__tip", role: "tooltip", id: k, children: _ }) : null
2174
2174
  ]
2175
2175
  }
2176
2176
  );
@@ -2182,24 +2182,24 @@ function je({ name: e }) {
2182
2182
  const t = Be(e);
2183
2183
  return t === null ? null : /* @__PURE__ */ n($, { name: t, size: 18 });
2184
2184
  }
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));
2185
+ 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 }) {
2186
+ const [i, g] = D(!1), u = he(), N = () => {
2187
+ s && d();
2188
+ }, h = (c == null ? void 0 : c.presentation) === "row" && c.onAction !== void 0, _ = (c == null ? void 0 : c.presentation) === "button" && c.onAction !== void 0 ? c : null, k = () => {
2189
+ var x;
2190
+ N(), h && ((x = c.onAction) == null || x.call(c));
2191
2191
  };
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: [
2192
+ return /* @__PURE__ */ f("article", { className: F("cms-notification", s && "is-unread", i && "is-expanded", h && "is-row-action"), "data-state": s ? "unread" : "read", children: [
2193
2193
  /* @__PURE__ */ f(
2194
2194
  "div",
2195
2195
  {
2196
2196
  className: "cms-notification__row",
2197
2197
  role: "button",
2198
2198
  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());
2199
+ "aria-describedby": t === null ? void 0 : u,
2200
+ onClick: k,
2201
+ onKeyDown: (x) => {
2202
+ x.target !== x.currentTarget || x.key !== "Enter" && x.key !== " " || (x.preventDefault(), k());
2203
2203
  },
2204
2204
  children: [
2205
2205
  b != null ? /* @__PURE__ */ n("span", { className: "cms-notification__leading", children: b }) : null,
@@ -2214,7 +2214,7 @@ function yl({ title: e, body: t = null, time: l = null, unread: s, unreadLabel:
2214
2214
  ] }),
2215
2215
  l !== null ? /* @__PURE__ */ n("span", { className: "cms-notification__time", children: l }) : null
2216
2216
  ] }),
2217
- t !== null && t !== "" ? /* @__PURE__ */ n("span", { className: "cms-notification__body", id: m, children: t }) : null
2217
+ t !== null && t !== "" ? /* @__PURE__ */ n("span", { className: "cms-notification__body", id: u, children: t }) : null
2218
2218
  ] }),
2219
2219
  s ? /* @__PURE__ */ n("span", { className: "cms-notification__dot", "aria-hidden": "true" }) : null
2220
2220
  ]
@@ -2225,26 +2225,26 @@ function yl({ title: e, body: t = null, time: l = null, unread: s, unreadLabel:
2225
2225
  {
2226
2226
  type: "button",
2227
2227
  className: "cms-notification__chevron",
2228
- "aria-expanded": c,
2229
- "aria-controls": m,
2230
- "aria-label": c ? h : i,
2231
- title: c ? h : i,
2228
+ "aria-expanded": i,
2229
+ "aria-controls": u,
2230
+ "aria-label": i ? m : r,
2231
+ title: i ? m : r,
2232
2232
  onClick: () => {
2233
- c || N(), v((C) => !C);
2233
+ i || N(), g((x) => !x);
2234
2234
  },
2235
2235
  children: /* @__PURE__ */ n($, { name: "chevron-down", size: 18 })
2236
2236
  }
2237
2237
  ) : null,
2238
- g !== null ? /* @__PURE__ */ n(
2238
+ _ !== null ? /* @__PURE__ */ n(
2239
2239
  "button",
2240
2240
  {
2241
2241
  type: "button",
2242
2242
  className: "cms-button cms-notification__action",
2243
2243
  onClick: () => {
2244
- var C;
2245
- N(), (C = g.onAction) == null || C.call(g);
2244
+ var x;
2245
+ N(), (x = _.onAction) == null || x.call(_);
2246
2246
  },
2247
- children: g.label
2247
+ children: _.label
2248
2248
  }
2249
2249
  ) : null
2250
2250
  ] });
@@ -2287,26 +2287,26 @@ function xl() {
2287
2287
  window.dispatchEvent(new Event(sn));
2288
2288
  }
2289
2289
  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));
2290
+ const [t, l] = D(void 0), [s, a] = D(void 0), [r, m] = D(!0), c = O(e);
2291
+ c.current = e;
2292
+ const d = O(0), b = Ie(() => {
2293
+ const i = ++d.current;
2294
+ m(!0), c.current().then(
2295
+ (g) => {
2296
+ i === d.current && (l(g), a(void 0), m(!1));
2297
2297
  },
2298
- (v) => {
2299
- c === u.current && (a(v), h(!1));
2298
+ (g) => {
2299
+ i === d.current && (a(g), m(!1));
2300
2300
  }
2301
2301
  );
2302
2302
  }, []);
2303
2303
  return Q(() => {
2304
2304
  b();
2305
- const c = () => b();
2306
- return window.addEventListener("focus", c), window.addEventListener(sn, c), () => {
2307
- window.removeEventListener("focus", c), window.removeEventListener(sn, c);
2305
+ const i = () => b();
2306
+ return window.addEventListener("focus", i), window.addEventListener(sn, i), () => {
2307
+ window.removeEventListener("focus", i), window.removeEventListener(sn, i);
2308
2308
  };
2309
- }, [b]), { value: t, error: s, loading: i, reread: b };
2309
+ }, [b]), { value: t, error: s, loading: r, reread: b };
2310
2310
  }
2311
2311
  function Cl(e) {
2312
2312
  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 +2315,8 @@ const Bt = "/errors/client-update-required";
2315
2315
  function Ft(e, t) {
2316
2316
  const l = e.split(".").map((a) => Number.parseInt(a, 10) || 0), s = t.split(".").map((a) => Number.parseInt(a, 10) || 0);
2317
2317
  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;
2318
+ const r = l[a] ?? 0, m = s[a] ?? 0;
2319
+ if (r !== m) return r < m;
2320
2320
  }
2321
2321
  return !1;
2322
2322
  }
@@ -2337,64 +2337,64 @@ function zt(e, t) {
2337
2337
  s(!1);
2338
2338
  return;
2339
2339
  }
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;
2340
+ const r = /* @__PURE__ */ new WeakMap();
2341
+ let m = Number.NEGATIVE_INFINITY, c = null;
2342
+ const d = (u) => {
2343
+ m = performance.now(), c = u.target;
2344
+ }, b = (u) => {
2345
+ const N = u.target;
2346
+ !(N instanceof HTMLElement && (N.isContentEditable || N.closest("input, textarea, select") !== null)) && Pt.has(u.key) && d(u);
2347
+ }, i = (u) => {
2348
+ const N = u.target;
2349
2349
  if (!(N instanceof HTMLElement)) return;
2350
- const r = N.scrollTop, g = i.get(N) ?? 0;
2351
- if (i.set(N, r), r <= 0) {
2350
+ const h = N.scrollTop, _ = r.get(N) ?? 0;
2351
+ if (r.set(N, h), h <= 0) {
2352
2352
  s(!1);
2353
2353
  return;
2354
2354
  }
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 });
2355
+ performance.now() - m > Ot || !(c === a || c === document.body || c instanceof Node && N.contains(c)) || (h < _ - Mn ? s(!1) : h > _ + Mn && h > Rt && Ht(a, N, h) && s(!0));
2356
+ }, g = [["wheel", d], ["touchmove", d], ["pointerdown", d], ["keydown", b]];
2357
+ for (const [u, N] of g) a.addEventListener(u, N, { capture: !0, passive: !0 });
2358
+ return a.addEventListener("scroll", i, { capture: !0, passive: !0 }), () => {
2359
+ for (const [u, N] of g) a.removeEventListener(u, N, { capture: !0 });
2360
+ a.removeEventListener("scroll", i, { capture: !0 });
2361
2361
  };
2362
2362
  }, [e, t]), [l, s];
2363
2363
  }
2364
2364
  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;
2365
+ function Kt({ bar: e, leading: t, gap: l, icon: s, iconGap: a, search: r, more: m, globals: c, name: d, choice: b }) {
2366
+ const i = [...r ? [s] : [], s, s, ...c], g = i.reduce((N, h) => N + h, 0) + a * (i.length - 1);
2367
+ return e - (t > 0 ? t + l : 0) - l - g + 0.01 < Math.min(Ut, d) + b;
2368
2368
  }
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 }) {
2369
+ 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: N }) {
2370
2370
  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,
2371
+ const h = 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, _ = h !== void 0 && !("menu" in h) ? ((Ee = h.offer) == null ? void 0 : Ee.refusal) ?? null : null, k = he(), [x, C] = D(!1), A = dn(), v = O(null), y = O(null), [I, U] = D(!1), [P, M] = D(null), [B, z] = D(null), j = Ie(() => z(null), []), K = O(!1), G = O(null), Y = O(null), ee = O(null), ie = r.some((R) => R.offer.offered), be = B !== null && ie && a === void 0;
2372
+ Dn(d);
2373
+ const oe = d === void 0 ? null : An(d), [de, Ce] = D(!1), fe = O(!1), te = O(!1), pe = O(null), _e = d === void 0 ? void 0 : {
2374
+ ...d,
2375
2375
  onChange: (R) => {
2376
- fe.current = !0, u.onChange(R);
2376
+ fe.current = !0, d.onChange(R);
2377
2377
  }
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(() => {
2378
+ }, we = oe === null ? "" : ` · ${oe.label}`, ne = d !== void 0 && d.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
2379
  const R = G.current, X = Y.current, Ne = ee.current;
2380
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;
2382
- if (A === 0) return null;
2383
- const M = (J) => {
2381
+ const ce = (J) => parseFloat(J) || 0, o = getComputedStyle(R), T = R.getBoundingClientRect().width;
2382
+ if (T === 0) return null;
2383
+ const S = (J) => {
2384
2384
  var ke;
2385
2385
  return ((ke = R.querySelector(`.cms-screen__ruler > [data-ruler="${J}"]`)) == null ? void 0 : ke.getBoundingClientRect().width) ?? 0;
2386
2386
  }, H = R.querySelector(".cms-screen__leading"), le = (s !== void 0 ? 1 : 0) + (E ? 0 : 1) + 1;
2387
2387
  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),
2388
+ bar: T - ce(o.paddingLeft) - ce(o.paddingRight),
2389
+ leading: H === null || H.childNodes.length === 0 ? 0 : ce(getComputedStyle(H).minWidth),
2390
+ gap: ce(o.columnGap),
2391
2391
  icon: Ne.getBoundingClientRect().width,
2392
- iconGap: oe(getComputedStyle(X).columnGap),
2392
+ iconGap: ce(getComputedStyle(X).columnGap),
2393
2393
  search: s !== void 0,
2394
2394
  more: !0,
2395
2395
  globals: Array.from(X.children).slice(le).map((J) => J.getBoundingClientRect().width),
2396
- name: M("name"),
2397
- choice: M("choice")
2396
+ name: S("name"),
2397
+ choice: S("choice")
2398
2398
  });
2399
2399
  }, [W]);
2400
2400
  $e(() => {
@@ -2411,20 +2411,20 @@ function El({ title: e, back: t, navigation: l, search: s, searching: a, more: i
2411
2411
  }, [q]);
2412
2412
  const p = O(E);
2413
2413
  $e(() => {
2414
- var Ne, oe, o;
2414
+ var Ne, ce, o;
2415
2415
  if (p.current === E) return;
2416
2416
  p.current = E, z(null);
2417
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;
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 : (ce = Y.current) == null ? void 0 : ce.querySelector(".cms-filter-menu")) == null || o.focus()), te.current = !1;
2419
2419
  }, [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);
2420
+ const L = E && oe !== null && d !== void 0 ? `${m}, ${Tn(d)}` : m, ue = dt(y, i === void 0 ? null : () => {
2421
+ I || (U(!0), i().finally(() => U(!1)));
2422
+ }), ae = i === void 0 ? null : { distance: ue, refreshing: I, text: g ?? null }, me = a !== void 0 || ue > 0 || I || be || de, [Se, We] = zt(v, u === void 0 && !me), Fe = !me && (u ?? Se);
2423
2423
  return /* @__PURE__ */ f(
2424
2424
  "div",
2425
2425
  {
2426
- ref: _,
2427
- className: F("cms-screen", r !== void 0 && "cms-screen--with-primary"),
2426
+ ref: v,
2427
+ className: F("cms-screen", h !== void 0 && "cms-screen--with-primary"),
2428
2428
  "data-bar-hidden": Fe ? "" : void 0,
2429
2429
  onFocus: (R) => {
2430
2430
  pe.current = R.target, Fe && R.target instanceof Element && R.target.closest(".cms-screen__bar") !== null && We(!1);
@@ -2441,16 +2441,16 @@ function El({ title: e, back: t, navigation: l, search: s, searching: a, more: i
2441
2441
  /* @__PURE__ */ n($, { name: "chevron-left" }),
2442
2442
  /* @__PURE__ */ n("span", { className: "cms-screen__back-name", children: t.label })
2443
2443
  ] }) : 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: [
2444
+ oe === 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
2445
  /* @__PURE__ */ f("span", { className: "cms-screen__title-place", children: [
2446
2446
  /* @__PURE__ */ n("span", { className: "cms-screen__title-name", children: e }),
2447
2447
  /* @__PURE__ */ n("span", { className: "cms-screen__title-dot", children: " · " })
2448
2448
  ] }),
2449
- /* @__PURE__ */ n("span", { className: "cms-screen__title-choice", children: ce.label })
2449
+ /* @__PURE__ */ n("span", { className: "cms-screen__title-choice", children: oe.label })
2450
2450
  ] }),
2451
2451
  ne && ie ? /* @__PURE__ */ f("span", { className: "cms-screen__ruler", "aria-hidden": "true", children: [
2452
2452
  /* @__PURE__ */ n("span", { "data-ruler": "name", children: e }),
2453
- ce !== null ? /* @__PURE__ */ n("span", { "data-ruler": "choice", children: we }) : null
2453
+ oe !== null ? /* @__PURE__ */ n("span", { "data-ruler": "choice", children: we }) : null
2454
2454
  ] }) : null,
2455
2455
  /* @__PURE__ */ f("div", { ref: Y, className: "cms-screen__trailing", children: [
2456
2456
  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,
@@ -2460,7 +2460,7 @@ function El({ title: e, back: t, navigation: l, search: s, searching: a, more: i
2460
2460
  {
2461
2461
  ref: ee,
2462
2462
  type: "button",
2463
- className: F("cms-icon-button cms-screen__icon", E && ce !== null && "cms-screen__icon--active"),
2463
+ className: F("cms-icon-button cms-screen__icon", E && oe !== null && "cms-screen__icon--active"),
2464
2464
  "data-action": "more",
2465
2465
  "aria-haspopup": "menu",
2466
2466
  "aria-expanded": be,
@@ -2476,44 +2476,44 @@ function El({ title: e, back: t, navigation: l, search: s, searching: a, more: i
2476
2476
  children: /* @__PURE__ */ n($, { name: "more" })
2477
2477
  }
2478
2478
  ) : null,
2479
- d
2479
+ c
2480
2480
  ] })
2481
2481
  ] }),
2482
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(
2483
+ h !== void 0 ? /* @__PURE__ */ f(
2484
2484
  "button",
2485
2485
  {
2486
2486
  type: "button",
2487
2487
  className: "cms-button cms-button--primary cms-screen__primary",
2488
- "aria-label": r.label,
2489
- ...g === null ? { title: r.label } : {
2488
+ "aria-label": h.label,
2489
+ ..._ === null ? { title: h.label } : {
2490
2490
  "aria-disabled": !0,
2491
- "aria-describedby": T,
2492
- ...C ? { "data-reason-shown": "" } : {},
2493
- ...x.dismissed(ze) ? { "data-tip-dismissed": "" } : {}
2491
+ "aria-describedby": k,
2492
+ ...x ? { "data-reason-shown": "" } : {},
2493
+ ...A.dismissed(ze) ? { "data-tip-dismissed": "" } : {}
2494
2494
  },
2495
- ..."menu" in r ? { "aria-haspopup": "menu", "aria-expanded": P !== null } : {},
2496
- onFocus: () => x.focusIn(ze),
2495
+ ..."menu" in h ? { "aria-haspopup": "menu", "aria-expanded": P !== null } : {},
2496
+ onFocus: () => A.focusIn(ze),
2497
2497
  onBlur: () => {
2498
- S(!1), x.focusOut(ze);
2498
+ C(!1), A.focusOut(ze);
2499
2499
  },
2500
- onMouseEnter: () => x.pointerIn(ze),
2501
- onMouseLeave: () => x.pointerOut(ze),
2500
+ onMouseEnter: () => A.pointerIn(ze),
2501
+ onMouseLeave: () => A.pointerOut(ze),
2502
2502
  onKeyDown: (R) => {
2503
- R.key === "Escape" && g !== null && (S(!1), x.dismiss(ze));
2503
+ R.key === "Escape" && _ !== null && (C(!1), A.dismiss(ze));
2504
2504
  },
2505
2505
  onClick: (R) => {
2506
- if (g !== null)
2507
- S(!0), x.show(ze);
2508
- else if ("menu" in r) {
2506
+ if (_ !== null)
2507
+ C(!0), A.show(ze);
2508
+ else if ("menu" in h) {
2509
2509
  const X = R.currentTarget.getBoundingClientRect();
2510
- k(P === null ? { x: X.left, y: X.top } : null);
2510
+ M(P === null ? { x: X.left, y: X.top } : null);
2511
2511
  } else
2512
- r.onPress();
2512
+ h.onPress();
2513
2513
  },
2514
2514
  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
2515
+ /* @__PURE__ */ n($, { name: h.icon, size: 24 }),
2516
+ _ !== null ? /* @__PURE__ */ n("span", { className: "cms-screen__tip", role: "tooltip", id: k, children: _ }) : null
2517
2517
  ]
2518
2518
  }
2519
2519
  ) : null,
@@ -2521,19 +2521,19 @@ function El({ title: e, back: t, navigation: l, search: s, searching: a, more: i
2521
2521
  Ke,
2522
2522
  {
2523
2523
  at: be ? B : null,
2524
- items: E && _e !== void 0 ? [...i, ...Ln(_e, _e.label)] : i,
2524
+ items: E && _e !== void 0 ? [...r, ...Ln(_e, _e.label)] : r,
2525
2525
  onClose: j,
2526
- label: h,
2526
+ label: m,
2527
2527
  focus: "first"
2528
2528
  }
2529
2529
  ),
2530
- r !== void 0 && "menu" in r ? /* @__PURE__ */ n(Ke, { at: P, items: r.menu, onClose: () => k(null), label: r.label }) : null
2530
+ h !== void 0 && "menu" in h ? /* @__PURE__ */ n(Ke, { at: P, items: h.menu, onClose: () => M(null), label: h.label }) : null
2531
2531
  ]
2532
2532
  }
2533
2533
  );
2534
2534
  }
2535
2535
  export {
2536
- cl as AppShell,
2536
+ ol as AppShell,
2537
2537
  Ye as Avatar,
2538
2538
  vn as BOOTSTRAP_ICONS,
2539
2539
  Nt as Badge,
@@ -2573,7 +2573,7 @@ export {
2573
2573
  Mt as SIGN_IN_LABELS,
2574
2574
  en as STATE_DELAY_MS,
2575
2575
  El as ScreenShell,
2576
- ol as SearchField,
2576
+ cl as SearchField,
2577
2577
  sl as SectionHeader,
2578
2578
  Yt as Select,
2579
2579
  vl as SignInForm,