@coolms/ui-react 0.1.0-alpha.34 → 0.1.0-alpha.36

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