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