@coolms/ui-react 0.1.0-alpha.13 → 0.1.0-alpha.14
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 +8 -0
- package/dist/components/Fields.d.ts +48 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +851 -786
- package/package.json +1 -1
- package/src/kit.css +2 -0
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useId as
|
|
1
|
+
import { jsx as e, jsxs as r, Fragment as M } from "react/jsx-runtime";
|
|
2
|
+
import { useId as Y, useState as D, useRef as Z, useEffect as G, useCallback as be, useMemo as Ie, useLayoutEffect as Ee } from "react";
|
|
3
3
|
import { createPortal as ke } from "react-dom";
|
|
4
4
|
function re(n, l) {
|
|
5
5
|
const a = { ...n };
|
|
6
|
-
for (const
|
|
7
|
-
const
|
|
8
|
-
|
|
6
|
+
for (const i of Object.keys(l ?? {})) {
|
|
7
|
+
const o = l == null ? void 0 : l[i];
|
|
8
|
+
o !== void 0 && (a[i] = o);
|
|
9
9
|
}
|
|
10
10
|
return a;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function A(...n) {
|
|
13
13
|
return n.filter(Boolean).join(" ");
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function K({ name: n }) {
|
|
16
16
|
const l = { width: 16, height: 16, viewBox: "0 0 16 16", "aria-hidden": !0, focusable: !1 };
|
|
17
17
|
switch (n) {
|
|
18
18
|
case "lock":
|
|
@@ -35,360 +35,423 @@ function ee({
|
|
|
35
35
|
variant: n = "secondary",
|
|
36
36
|
busy: l = !1,
|
|
37
37
|
busyLabel: a,
|
|
38
|
-
locked:
|
|
39
|
-
lockedReason:
|
|
40
|
-
icon:
|
|
41
|
-
disabled:
|
|
42
|
-
className:
|
|
38
|
+
locked: i = !1,
|
|
39
|
+
lockedReason: o,
|
|
40
|
+
icon: t,
|
|
41
|
+
disabled: s,
|
|
42
|
+
className: c,
|
|
43
43
|
children: u,
|
|
44
|
-
type:
|
|
45
|
-
title:
|
|
44
|
+
type: d = "button",
|
|
45
|
+
title: p,
|
|
46
46
|
...h
|
|
47
47
|
}) {
|
|
48
|
-
const
|
|
49
|
-
return /* @__PURE__ */
|
|
48
|
+
const m = !!s || l;
|
|
49
|
+
return /* @__PURE__ */ r(
|
|
50
50
|
"button",
|
|
51
51
|
{
|
|
52
52
|
...h,
|
|
53
|
-
type:
|
|
54
|
-
className:
|
|
55
|
-
disabled:
|
|
53
|
+
type: d,
|
|
54
|
+
className: A("cms-button", `cms-button--${n}`, l && "is-busy", i && "is-locked", c),
|
|
55
|
+
disabled: m,
|
|
56
56
|
"aria-busy": l || void 0,
|
|
57
|
-
title:
|
|
57
|
+
title: i ? o ?? p : p,
|
|
58
58
|
children: [
|
|
59
|
-
l ? /* @__PURE__ */ e(
|
|
59
|
+
l ? /* @__PURE__ */ e(K, { name: "spinner" }) : i ? /* @__PURE__ */ e(K, { name: "lock" }) : t,
|
|
60
60
|
/* @__PURE__ */ e("span", { className: "cms-button__label", children: l && a !== void 0 ? a : u }),
|
|
61
|
-
|
|
61
|
+
i && o ? /* @__PURE__ */ r("span", { className: "cms-visually-hidden", children: [
|
|
62
62
|
", ",
|
|
63
|
-
|
|
63
|
+
o
|
|
64
64
|
] }) : null
|
|
65
65
|
]
|
|
66
66
|
}
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
return /* @__PURE__ */
|
|
69
|
+
function xe({ id: n, label: l, help: a, error: i, pinned: o, children: t }) {
|
|
70
|
+
return /* @__PURE__ */ r("div", { className: A("cms-field", i != null && "is-invalid"), children: [
|
|
71
71
|
/* @__PURE__ */ e("label", { className: "cms-field__label", htmlFor: n, children: l }),
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
/* @__PURE__ */ e(
|
|
72
|
+
t,
|
|
73
|
+
o != null ? /* @__PURE__ */ r("p", { className: "cms-field__pinned", id: `${n}-pinned`, children: [
|
|
74
|
+
/* @__PURE__ */ e(K, { name: "lock" }),
|
|
75
75
|
" ",
|
|
76
|
-
|
|
76
|
+
o
|
|
77
77
|
] }) : null,
|
|
78
|
-
|
|
78
|
+
i != null ? /* @__PURE__ */ e("p", { className: "cms-field__error", id: `${n}-error`, role: "alert", children: i }) : null,
|
|
79
79
|
a != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${n}-help`, children: a }) : null
|
|
80
80
|
] });
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function Ce(n, l) {
|
|
83
83
|
const a = [l.error != null && `${n}-error`, l.pinned != null && `${n}-pinned`, l.help != null && `${n}-help`].filter(Boolean).join(" ");
|
|
84
84
|
return a === "" ? void 0 : a;
|
|
85
85
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
const Fe = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/, Pe = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
|
|
87
|
+
function Be(n, l, a) {
|
|
88
|
+
const i = (t, s, c, u = 0, d = 0, p = 0) => {
|
|
89
|
+
const h = new Date(Date.UTC(t, s - 1, c, u, d, p));
|
|
90
|
+
return h.setUTCFullYear(t), h.getUTCFullYear() === t && h.getUTCMonth() === s - 1 && h.getUTCDate() === c && h.getUTCHours() === u && h.getUTCMinutes() === d && h.getUTCSeconds() === p ? h : null;
|
|
91
|
+
}, o = (t) => ({ hour: Number(t[1]), minute: Number(t[2]), second: Number(t[3] ?? 0) });
|
|
92
|
+
try {
|
|
93
|
+
if (n === "time") {
|
|
94
|
+
const s = l.match(Pe);
|
|
95
|
+
if (s === null) return l;
|
|
96
|
+
const c = o(s), u = i(2e3, 1, 1, c.hour, c.minute, c.second);
|
|
97
|
+
return u === null ? l : new Intl.DateTimeFormat(a, { timeStyle: s[3] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(u);
|
|
98
|
+
}
|
|
99
|
+
const t = l.match(Fe);
|
|
100
|
+
if (t === null) return l;
|
|
101
|
+
if (n === "date" && t[4] === void 0) {
|
|
102
|
+
const s = i(Number(t[1]), Number(t[2]), Number(t[3]));
|
|
103
|
+
return s === null ? l : new Intl.DateTimeFormat(a, { dateStyle: "medium", timeZone: "UTC" }).format(s);
|
|
104
|
+
}
|
|
105
|
+
if (n === "datetime-local" && t[4] !== void 0) {
|
|
106
|
+
const s = i(Number(t[1]), Number(t[2]), Number(t[3]), Number(t[4]), Number(t[5]), Number(t[6] ?? 0));
|
|
107
|
+
return s === null ? l : new Intl.DateTimeFormat(a, { dateStyle: "medium", timeStyle: t[6] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(s);
|
|
108
|
+
}
|
|
109
|
+
} catch {
|
|
110
|
+
return l;
|
|
111
|
+
}
|
|
112
|
+
return l;
|
|
113
|
+
}
|
|
114
|
+
const ze = /* @__PURE__ */ new Set(["date", "time", "datetime-local"]);
|
|
115
|
+
function _n({ label: n, help: l, error: a, disabled: i, readOnly: o, pinned: t, value: s, onChange: c, placeholder: u, type: d = "text", name: p, locale: h, min: m, max: g, step: _, minLength: v, maxLength: w, required: P }) {
|
|
116
|
+
const k = Y(), C = o === !0 || t != null, x = C && ze.has(d), R = d === "number" && (_ === "any" || typeof _ == "number" && !Number.isInteger(_));
|
|
117
|
+
return /* @__PURE__ */ e(xe, { id: k, label: n, help: l, error: a, pinned: t, children: /* @__PURE__ */ e(
|
|
89
118
|
"input",
|
|
90
119
|
{
|
|
91
|
-
id:
|
|
92
|
-
name:
|
|
93
|
-
type:
|
|
120
|
+
id: k,
|
|
121
|
+
name: p,
|
|
122
|
+
type: x ? "text" : d,
|
|
94
123
|
className: "cms-input",
|
|
95
|
-
value: d,
|
|
124
|
+
value: x ? Be(d, s, h) : s,
|
|
125
|
+
...x ? { "data-value": s } : {},
|
|
126
|
+
lang: h,
|
|
127
|
+
placeholder: u,
|
|
128
|
+
disabled: i,
|
|
129
|
+
readOnly: C,
|
|
130
|
+
required: P,
|
|
131
|
+
"aria-required": P || void 0,
|
|
132
|
+
min: x ? void 0 : m,
|
|
133
|
+
max: x ? void 0 : g,
|
|
134
|
+
step: x ? void 0 : _,
|
|
135
|
+
minLength: v,
|
|
136
|
+
maxLength: w,
|
|
137
|
+
inputMode: d === "number" ? R ? "decimal" : "numeric" : void 0,
|
|
138
|
+
"aria-invalid": a != null || void 0,
|
|
139
|
+
"aria-describedby": Ce(k, { help: l, error: a, pinned: t }),
|
|
140
|
+
onChange: (z) => c == null ? void 0 : c(z.target.value)
|
|
141
|
+
}
|
|
142
|
+
) });
|
|
143
|
+
}
|
|
144
|
+
function vn({ label: n, help: l, error: a, disabled: i, readOnly: o, pinned: t, value: s, onChange: c, placeholder: u, rows: d = 4, name: p, locale: h, minLength: m, maxLength: g, required: _ }) {
|
|
145
|
+
const v = Y();
|
|
146
|
+
return /* @__PURE__ */ e(xe, { id: v, label: n, help: l, error: a, pinned: t, children: /* @__PURE__ */ e(
|
|
147
|
+
"textarea",
|
|
148
|
+
{
|
|
149
|
+
id: v,
|
|
150
|
+
name: p,
|
|
151
|
+
className: "cms-input cms-textarea",
|
|
152
|
+
rows: d,
|
|
153
|
+
value: s,
|
|
154
|
+
lang: h,
|
|
96
155
|
placeholder: u,
|
|
97
|
-
disabled:
|
|
98
|
-
readOnly:
|
|
156
|
+
disabled: i,
|
|
157
|
+
readOnly: o === !0 || t != null,
|
|
158
|
+
required: _,
|
|
159
|
+
"aria-required": _ || void 0,
|
|
160
|
+
minLength: m,
|
|
161
|
+
maxLength: g,
|
|
99
162
|
"aria-invalid": a != null || void 0,
|
|
100
|
-
"aria-describedby":
|
|
101
|
-
onChange: (
|
|
163
|
+
"aria-describedby": Ce(v, { help: l, error: a, pinned: t }),
|
|
164
|
+
onChange: (w) => c == null ? void 0 : c(w.target.value)
|
|
102
165
|
}
|
|
103
166
|
) });
|
|
104
167
|
}
|
|
105
|
-
function
|
|
106
|
-
const
|
|
107
|
-
return /* @__PURE__ */ e(
|
|
168
|
+
function gn({ label: n, help: l, error: a, disabled: i, readOnly: o, value: t, options: s, onChange: c, emptyText: u = "Nothing to choose from yet.", name: d }) {
|
|
169
|
+
const p = Y(), h = s.length === 0;
|
|
170
|
+
return /* @__PURE__ */ e(xe, { id: p, label: n, help: h ? u : l, error: a, children: /* @__PURE__ */ e(
|
|
108
171
|
"select",
|
|
109
172
|
{
|
|
110
|
-
id:
|
|
111
|
-
name:
|
|
173
|
+
id: p,
|
|
174
|
+
name: d,
|
|
112
175
|
className: "cms-input cms-select",
|
|
113
|
-
value:
|
|
114
|
-
disabled:
|
|
115
|
-
"aria-readonly":
|
|
176
|
+
value: t,
|
|
177
|
+
disabled: i || h,
|
|
178
|
+
"aria-readonly": o || void 0,
|
|
116
179
|
"aria-invalid": a != null || void 0,
|
|
117
|
-
"aria-describedby":
|
|
118
|
-
onChange: (
|
|
119
|
-
|
|
180
|
+
"aria-describedby": Ce(p, { help: h ? u : l, error: a }),
|
|
181
|
+
onChange: (m) => {
|
|
182
|
+
o || c == null || c(m.target.value);
|
|
120
183
|
},
|
|
121
|
-
children:
|
|
184
|
+
children: s.map((m) => /* @__PURE__ */ e("option", { value: m.value, disabled: o && m.value !== t, children: m.label }, m.value))
|
|
122
185
|
}
|
|
123
186
|
) });
|
|
124
187
|
}
|
|
125
|
-
function
|
|
126
|
-
const
|
|
127
|
-
return /* @__PURE__ */
|
|
188
|
+
function Nn({ label: n, checked: l, onChange: a, disabled: i, readOnly: o, help: t }) {
|
|
189
|
+
const s = Y();
|
|
190
|
+
return /* @__PURE__ */ r("div", { className: "cms-toggle-row", children: [
|
|
128
191
|
/* @__PURE__ */ e(
|
|
129
192
|
"button",
|
|
130
193
|
{
|
|
131
|
-
id:
|
|
194
|
+
id: s,
|
|
132
195
|
type: "button",
|
|
133
196
|
role: "switch",
|
|
134
|
-
className:
|
|
197
|
+
className: A("cms-toggle", l && "is-on"),
|
|
135
198
|
"aria-checked": l,
|
|
136
|
-
"aria-readonly":
|
|
137
|
-
"aria-describedby":
|
|
138
|
-
disabled:
|
|
199
|
+
"aria-readonly": o || void 0,
|
|
200
|
+
"aria-describedby": t != null ? `${s}-help` : void 0,
|
|
201
|
+
disabled: i,
|
|
139
202
|
onClick: () => {
|
|
140
|
-
|
|
203
|
+
o || a == null || a(!l);
|
|
141
204
|
},
|
|
142
205
|
children: /* @__PURE__ */ e("span", { className: "cms-toggle__thumb" })
|
|
143
206
|
}
|
|
144
207
|
),
|
|
145
|
-
/* @__PURE__ */ e("label", { className: "cms-toggle__label", htmlFor:
|
|
146
|
-
|
|
208
|
+
/* @__PURE__ */ e("label", { className: "cms-toggle__label", htmlFor: s, children: n }),
|
|
209
|
+
t != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${s}-help`, children: t }) : null
|
|
147
210
|
] });
|
|
148
211
|
}
|
|
149
|
-
const
|
|
150
|
-
function
|
|
151
|
-
const [
|
|
212
|
+
const Ke = 150;
|
|
213
|
+
function Te({ open: n, title: l, onClose: a, dirty: i = !1, onDirtyClose: o, children: t, footer: s, closeLabel: c = "Close", initialFocus: u, className: d }) {
|
|
214
|
+
const [p, h] = D(n), [m, g] = D(!1), _ = Z(null), v = Z(null), w = Y();
|
|
152
215
|
if (G(() => {
|
|
153
216
|
if (n) {
|
|
154
|
-
|
|
217
|
+
v.current = document.activeElement, h(!0), g(!1);
|
|
155
218
|
return;
|
|
156
219
|
}
|
|
157
|
-
if (!
|
|
220
|
+
if (!p) return;
|
|
158
221
|
g(!0);
|
|
159
222
|
const k = window.setTimeout(() => {
|
|
160
|
-
var
|
|
161
|
-
h(!1), g(!1), (
|
|
162
|
-
},
|
|
223
|
+
var C, x;
|
|
224
|
+
h(!1), g(!1), (x = (C = v.current) == null ? void 0 : C.focus) == null || x.call(C);
|
|
225
|
+
}, Ke);
|
|
163
226
|
return () => window.clearTimeout(k);
|
|
164
|
-
}, [n,
|
|
165
|
-
var k,
|
|
166
|
-
if (n &&
|
|
167
|
-
const
|
|
168
|
-
(
|
|
227
|
+
}, [n, p]), G(() => {
|
|
228
|
+
var k, C;
|
|
229
|
+
if (n && p) {
|
|
230
|
+
const x = 'input, select, textarea, button, [href], [tabindex]:not([tabindex="-1"])';
|
|
231
|
+
(C = (u == null ? void 0 : u.current) ?? ((k = _.current) == null ? void 0 : k.querySelector(`.cms-modal__body :is(${x}), .cms-modal__foot :is(${x})`)) ?? _.current) == null || C.focus();
|
|
169
232
|
}
|
|
170
|
-
}, [n,
|
|
171
|
-
const
|
|
172
|
-
|
|
233
|
+
}, [n, p, u]), !p) return null;
|
|
234
|
+
const P = () => {
|
|
235
|
+
i ? o == null || o() : a();
|
|
173
236
|
};
|
|
174
237
|
return ke(
|
|
175
|
-
/* @__PURE__ */ e("div", { className:
|
|
176
|
-
k.target === k.currentTarget &&
|
|
177
|
-
}, children: /* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ e("div", { className: A("cms-modal-scrim", m && "is-closing"), onMouseDown: (k) => {
|
|
239
|
+
k.target === k.currentTarget && P();
|
|
240
|
+
}, children: /* @__PURE__ */ r(
|
|
178
241
|
"div",
|
|
179
242
|
{
|
|
180
|
-
ref:
|
|
181
|
-
className:
|
|
243
|
+
ref: _,
|
|
244
|
+
className: A("cms-modal", d, m && "is-closing", i && "is-dirty"),
|
|
182
245
|
role: "dialog",
|
|
183
246
|
"aria-modal": "true",
|
|
184
247
|
"aria-labelledby": w,
|
|
185
248
|
tabIndex: -1,
|
|
186
249
|
onKeyDown: (k) => {
|
|
187
|
-
var
|
|
250
|
+
var C;
|
|
188
251
|
if (k.key === "Escape")
|
|
189
|
-
k.stopPropagation(),
|
|
252
|
+
k.stopPropagation(), P();
|
|
190
253
|
else if (k.key === "Tab") {
|
|
191
|
-
const
|
|
192
|
-
if (!
|
|
193
|
-
const
|
|
194
|
-
k.shiftKey && document.activeElement ===
|
|
254
|
+
const x = (C = _.current) == null ? void 0 : C.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
|
|
255
|
+
if (!x || x.length === 0) return;
|
|
256
|
+
const R = x[0], z = x[x.length - 1];
|
|
257
|
+
k.shiftKey && document.activeElement === R ? (k.preventDefault(), z.focus()) : !k.shiftKey && document.activeElement === z && (k.preventDefault(), R.focus());
|
|
195
258
|
}
|
|
196
259
|
},
|
|
197
260
|
children: [
|
|
198
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ r("header", { className: "cms-modal__head", children: [
|
|
199
262
|
/* @__PURE__ */ e("h2", { className: "cms-modal__title", id: w, children: l }),
|
|
200
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label":
|
|
263
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": c, onClick: P, children: /* @__PURE__ */ e(K, { name: "close" }) })
|
|
201
264
|
] }),
|
|
202
|
-
/* @__PURE__ */ e("div", { className: "cms-modal__body", children:
|
|
203
|
-
|
|
265
|
+
/* @__PURE__ */ e("div", { className: "cms-modal__body", children: t }),
|
|
266
|
+
s != null ? /* @__PURE__ */ e("footer", { className: "cms-modal__foot", children: s }) : null
|
|
204
267
|
]
|
|
205
268
|
}
|
|
206
269
|
) }),
|
|
207
270
|
document.body
|
|
208
271
|
);
|
|
209
272
|
}
|
|
210
|
-
function
|
|
211
|
-
const
|
|
273
|
+
function yn({ open: n, title: l, message: a, kind: i = "default", confirmLabel: o, cancelLabel: t, closeLabel: s, onConfirm: c, onCancel: u }) {
|
|
274
|
+
const d = i === "discard-changes";
|
|
212
275
|
return /* @__PURE__ */ e(
|
|
213
|
-
|
|
276
|
+
Te,
|
|
214
277
|
{
|
|
215
278
|
open: n,
|
|
216
279
|
title: l,
|
|
217
280
|
onClose: u,
|
|
218
|
-
...
|
|
219
|
-
footer: /* @__PURE__ */
|
|
220
|
-
/* @__PURE__ */ e(ee, { onClick: u, children:
|
|
221
|
-
/* @__PURE__ */ e(ee, { variant:
|
|
281
|
+
...s === void 0 ? {} : { closeLabel: s },
|
|
282
|
+
footer: /* @__PURE__ */ r(M, { children: [
|
|
283
|
+
/* @__PURE__ */ e(ee, { onClick: u, children: t ?? (d ? "Keep editing" : "Cancel") }),
|
|
284
|
+
/* @__PURE__ */ e(ee, { variant: i === "default" ? "primary" : "danger", onClick: c, children: o ?? (d ? "Discard changes" : "Confirm") })
|
|
222
285
|
] }),
|
|
223
|
-
children:
|
|
224
|
-
/* @__PURE__ */ e(
|
|
286
|
+
children: i !== "default" ? /* @__PURE__ */ r("p", { className: "cms-confirm__warning", children: [
|
|
287
|
+
/* @__PURE__ */ e(K, { name: "warning" }),
|
|
225
288
|
" ",
|
|
226
289
|
a
|
|
227
290
|
] }) : /* @__PURE__ */ e("p", { children: a })
|
|
228
291
|
}
|
|
229
292
|
);
|
|
230
293
|
}
|
|
231
|
-
function
|
|
232
|
-
return /* @__PURE__ */
|
|
233
|
-
/* @__PURE__ */ e(
|
|
294
|
+
function wn({ kind: n, message: l, action: a, onDismiss: i, dismissLabel: o = "Dismiss" }) {
|
|
295
|
+
return /* @__PURE__ */ r("div", { className: A("cms-toast", `cms-toast--${n}`), role: n === "error" ? "alert" : "status", children: [
|
|
296
|
+
/* @__PURE__ */ e(K, { name: n === "success" ? "check" : n === "error" ? "warning" : "info" }),
|
|
234
297
|
/* @__PURE__ */ e("span", { className: "cms-toast__message", children: l }),
|
|
235
298
|
a ? /* @__PURE__ */ e(ee, { className: "cms-toast__action", onClick: a.onAction, children: a.label }) : null,
|
|
236
|
-
|
|
299
|
+
i ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": o, onClick: i, children: /* @__PURE__ */ e(K, { name: "close" }) }) : null
|
|
237
300
|
] });
|
|
238
301
|
}
|
|
239
|
-
function
|
|
302
|
+
function kn({ children: n }) {
|
|
240
303
|
return /* @__PURE__ */ e("div", { className: "cms-toast-region", children: n });
|
|
241
304
|
}
|
|
242
|
-
function
|
|
243
|
-
return /* @__PURE__ */
|
|
244
|
-
/* @__PURE__ */ e(
|
|
305
|
+
function He({ what: n, layout: l = "inline" }) {
|
|
306
|
+
return /* @__PURE__ */ r("div", { className: A("cms-loading", `cms-loading--${l}`), role: "status", "aria-live": "polite", children: [
|
|
307
|
+
/* @__PURE__ */ e(K, { name: "spinner" }),
|
|
245
308
|
/* @__PURE__ */ e("span", { children: n })
|
|
246
309
|
] });
|
|
247
310
|
}
|
|
248
|
-
function
|
|
249
|
-
return /* @__PURE__ */
|
|
311
|
+
function Ue({ title: n, hint: l, action: a }) {
|
|
312
|
+
return /* @__PURE__ */ r("div", { className: "cms-empty", children: [
|
|
250
313
|
/* @__PURE__ */ e("p", { className: "cms-empty__title", children: n }),
|
|
251
314
|
l != null ? /* @__PURE__ */ e("p", { className: "cms-empty__hint", children: l }) : null,
|
|
252
315
|
a != null ? /* @__PURE__ */ e("div", { className: "cms-empty__action", children: a }) : null
|
|
253
316
|
] });
|
|
254
317
|
}
|
|
255
|
-
function
|
|
256
|
-
return /* @__PURE__ */
|
|
257
|
-
/* @__PURE__ */ e(
|
|
318
|
+
function Re({ message: n, onRetry: l, retryLabel: a = "Try again" }) {
|
|
319
|
+
return /* @__PURE__ */ r("div", { className: "cms-error-banner", role: "alert", children: [
|
|
320
|
+
/* @__PURE__ */ e(K, { name: "warning" }),
|
|
258
321
|
/* @__PURE__ */ e("span", { className: "cms-error-banner__message", children: n }),
|
|
259
322
|
l ? /* @__PURE__ */ e(ee, { onClick: l, children: a }) : null
|
|
260
323
|
] });
|
|
261
324
|
}
|
|
262
325
|
const ye = 300;
|
|
263
|
-
function
|
|
326
|
+
function Oe() {
|
|
264
327
|
if (typeof window > "u" || typeof getComputedStyle != "function") return ye;
|
|
265
328
|
const n = getComputedStyle(document.documentElement).getPropertyValue("--cms-state-delay").trim(), l = n.endsWith("ms") ? Number.parseFloat(n) : n.endsWith("s") ? Number.parseFloat(n) * 1e3 : Number.NaN;
|
|
266
329
|
return Number.isFinite(l) && l >= 0 ? l : ye;
|
|
267
330
|
}
|
|
268
|
-
function
|
|
269
|
-
return /* @__PURE__ */
|
|
331
|
+
function Ze() {
|
|
332
|
+
return /* @__PURE__ */ r("svg", { className: "cms-state__spinner", viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
|
|
270
333
|
/* @__PURE__ */ e("circle", { className: "cms-state__track", cx: "12", cy: "12", r: "10", fill: "none" }),
|
|
271
334
|
/* @__PURE__ */ e("circle", { className: "cms-state__arc", cx: "12", cy: "12", r: "10", fill: "none", pathLength: "100", strokeDasharray: "28 72" })
|
|
272
335
|
] });
|
|
273
336
|
}
|
|
274
|
-
function
|
|
275
|
-
const [
|
|
337
|
+
function se({ kind: n, title: l, description: a, action: i, placement: o = "block" }) {
|
|
338
|
+
const [t, s] = D(n !== "loading");
|
|
276
339
|
return G(() => {
|
|
277
340
|
if (n !== "loading") {
|
|
278
|
-
|
|
341
|
+
s(!0);
|
|
279
342
|
return;
|
|
280
343
|
}
|
|
281
|
-
|
|
282
|
-
const
|
|
283
|
-
return () => window.clearTimeout(
|
|
284
|
-
}, [n]), /* @__PURE__ */
|
|
344
|
+
s(!1);
|
|
345
|
+
const c = window.setTimeout(() => s(!0), Oe());
|
|
346
|
+
return () => window.clearTimeout(c);
|
|
347
|
+
}, [n]), /* @__PURE__ */ r(
|
|
285
348
|
"div",
|
|
286
349
|
{
|
|
287
|
-
className:
|
|
350
|
+
className: A("cms-state", `cms-state--${n}`, `cms-state--${o}`, !t && "is-waiting"),
|
|
288
351
|
role: "status",
|
|
289
352
|
"aria-live": "polite",
|
|
290
353
|
"data-kind": n,
|
|
291
354
|
children: [
|
|
292
|
-
n === "loading" ? /* @__PURE__ */ e(
|
|
293
|
-
n === "error" || n === "denied" ? /* @__PURE__ */ e(
|
|
294
|
-
/* @__PURE__ */
|
|
355
|
+
n === "loading" ? /* @__PURE__ */ e(Ze, {}) : null,
|
|
356
|
+
n === "error" || n === "denied" ? /* @__PURE__ */ e(K, { name: n === "error" ? "warning" : "lock" }) : null,
|
|
357
|
+
/* @__PURE__ */ r("span", { className: "cms-state__text", children: [
|
|
295
358
|
/* @__PURE__ */ e("span", { className: "cms-state__title", children: l }),
|
|
296
359
|
a !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-state__description", children: a }) : null
|
|
297
360
|
] }),
|
|
298
|
-
|
|
361
|
+
i !== void 0 && n !== "denied" ? /* @__PURE__ */ e(ee, { className: "cms-state__action", onClick: i.onAction, children: i.label }) : null
|
|
299
362
|
]
|
|
300
363
|
}
|
|
301
364
|
);
|
|
302
365
|
}
|
|
303
|
-
const
|
|
304
|
-
mail: /* @__PURE__ */
|
|
366
|
+
const Le = {
|
|
367
|
+
mail: /* @__PURE__ */ r(M, { children: [
|
|
305
368
|
/* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
306
369
|
/* @__PURE__ */ e("path", { d: "m3 7 9 6 9-6" })
|
|
307
370
|
] }),
|
|
308
371
|
chat: /* @__PURE__ */ e("path", { d: "M4 12a8 8 0 1 1 4 6.9L4 20l1.1-4A8 8 0 0 1 4 12Z" }),
|
|
309
372
|
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" }),
|
|
310
|
-
calendar: /* @__PURE__ */
|
|
373
|
+
calendar: /* @__PURE__ */ r(M, { children: [
|
|
311
374
|
/* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "16", rx: "2" }),
|
|
312
375
|
/* @__PURE__ */ e("path", { d: "M3 10h18M8 3v4M16 3v4" })
|
|
313
376
|
] }),
|
|
314
|
-
file: /* @__PURE__ */
|
|
377
|
+
file: /* @__PURE__ */ r(M, { children: [
|
|
315
378
|
/* @__PURE__ */ e("path", { d: "M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z" }),
|
|
316
379
|
/* @__PURE__ */ e("path", { d: "M14 3v6h6M8 13h8M8 17h6" })
|
|
317
380
|
] }),
|
|
318
381
|
// The file, with code's angle brackets in place of its lines: a message's source.
|
|
319
|
-
"file-code": /* @__PURE__ */
|
|
382
|
+
"file-code": /* @__PURE__ */ r(M, { children: [
|
|
320
383
|
/* @__PURE__ */ e("path", { d: "M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z" }),
|
|
321
384
|
/* @__PURE__ */ e("path", { d: "M14 3v6h6" }),
|
|
322
385
|
/* @__PURE__ */ e("path", { d: "m10 12-2 2.5 2 2.5M14 12l2 2.5-2 2.5" })
|
|
323
386
|
] }),
|
|
324
|
-
image: /* @__PURE__ */
|
|
387
|
+
image: /* @__PURE__ */ r(M, { children: [
|
|
325
388
|
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
|
|
326
389
|
/* @__PURE__ */ e("circle", { cx: "9", cy: "10", r: "2" }),
|
|
327
390
|
/* @__PURE__ */ e("path", { d: "m21 17-5-5-9 8" })
|
|
328
391
|
] }),
|
|
329
|
-
search: /* @__PURE__ */
|
|
392
|
+
search: /* @__PURE__ */ r(M, { children: [
|
|
330
393
|
/* @__PURE__ */ e("circle", { cx: "11", cy: "11", r: "7" }),
|
|
331
394
|
/* @__PURE__ */ e("path", { d: "m20 20-4-4" })
|
|
332
395
|
] }),
|
|
333
|
-
bell: /* @__PURE__ */
|
|
396
|
+
bell: /* @__PURE__ */ r(M, { children: [
|
|
334
397
|
/* @__PURE__ */ e("path", { d: "M6 9a6 6 0 1 1 12 0c0 6 2 8 2 8H4s2-2 2-8Z" }),
|
|
335
398
|
/* @__PURE__ */ e("path", { d: "M10 20a2 2 0 0 0 4 0" })
|
|
336
399
|
] }),
|
|
337
|
-
pencil: /* @__PURE__ */
|
|
400
|
+
pencil: /* @__PURE__ */ r(M, { children: [
|
|
338
401
|
/* @__PURE__ */ e("path", { d: "M4 20h4L19 9l-4-4L4 16Z" }),
|
|
339
402
|
/* @__PURE__ */ e("path", { d: "m13 7 4 4" })
|
|
340
403
|
] }),
|
|
341
|
-
download: /* @__PURE__ */
|
|
404
|
+
download: /* @__PURE__ */ r(M, { children: [
|
|
342
405
|
/* @__PURE__ */ e("path", { d: "M12 4v11" }),
|
|
343
406
|
/* @__PURE__ */ e("path", { d: "m7 11 5 5 5-5" }),
|
|
344
407
|
/* @__PURE__ */ e("path", { d: "M4 20h16" })
|
|
345
408
|
] }),
|
|
346
|
-
print: /* @__PURE__ */
|
|
409
|
+
print: /* @__PURE__ */ r(M, { children: [
|
|
347
410
|
/* @__PURE__ */ e("path", { d: "M7 8V4h10v4" }),
|
|
348
411
|
/* @__PURE__ */ e("rect", { x: "3", y: "8", width: "18", height: "8", rx: "2" }),
|
|
349
412
|
/* @__PURE__ */ e("path", { d: "M7 14h10v6H7Z" })
|
|
350
413
|
] }),
|
|
351
|
-
"open-separately": /* @__PURE__ */
|
|
414
|
+
"open-separately": /* @__PURE__ */ r(M, { children: [
|
|
352
415
|
/* @__PURE__ */ e("path", { d: "M14 4h6v6" }),
|
|
353
416
|
/* @__PURE__ */ e("path", { d: "m20 4-9 9" }),
|
|
354
417
|
/* @__PURE__ */ e("path", { d: "M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5" })
|
|
355
418
|
] }),
|
|
356
419
|
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" }),
|
|
357
|
-
send: /* @__PURE__ */
|
|
420
|
+
send: /* @__PURE__ */ r(M, { children: [
|
|
358
421
|
/* @__PURE__ */ e("path", { d: "M21 3 10 14" }),
|
|
359
422
|
/* @__PURE__ */ e("path", { d: "M21 3 14 21l-4-7-7-4Z" })
|
|
360
423
|
] }),
|
|
361
|
-
inbox: /* @__PURE__ */
|
|
424
|
+
inbox: /* @__PURE__ */ r(M, { children: [
|
|
362
425
|
/* @__PURE__ */ e("path", { d: "M3 13h5l1 3h6l1-3h5" }),
|
|
363
426
|
/* @__PURE__ */ e("path", { d: "M5 5h14l2 8v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6Z" })
|
|
364
427
|
] }),
|
|
365
|
-
archive: /* @__PURE__ */
|
|
428
|
+
archive: /* @__PURE__ */ r(M, { children: [
|
|
366
429
|
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "5", rx: "1" }),
|
|
367
430
|
/* @__PURE__ */ e("path", { d: "M5 9v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9M10 13h4" })
|
|
368
431
|
] }),
|
|
369
|
-
trash: /* @__PURE__ */
|
|
432
|
+
trash: /* @__PURE__ */ r(M, { children: [
|
|
370
433
|
/* @__PURE__ */ e("path", { d: "M4 7h16M10 11v6M14 11v6" }),
|
|
371
434
|
/* @__PURE__ */ e("path", { d: "M6 7l1 13a2 2 0 0 0 2 1h6a2 2 0 0 0 2-1l1-13M9 7V4h6v3" })
|
|
372
435
|
] }),
|
|
373
436
|
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" }),
|
|
374
|
-
mic: /* @__PURE__ */
|
|
437
|
+
mic: /* @__PURE__ */ r(M, { children: [
|
|
375
438
|
/* @__PURE__ */ e("rect", { x: "9", y: "3", width: "6", height: "11", rx: "3" }),
|
|
376
439
|
/* @__PURE__ */ e("path", { d: "M5 11a7 7 0 0 0 14 0M12 18v3" })
|
|
377
440
|
] }),
|
|
378
|
-
speaker: /* @__PURE__ */
|
|
441
|
+
speaker: /* @__PURE__ */ r(M, { children: [
|
|
379
442
|
/* @__PURE__ */ e("path", { d: "M4 9h4l5-4v14l-5-4H4Z" }),
|
|
380
443
|
/* @__PURE__ */ e("path", { d: "M16 9a4 4 0 0 1 0 6M19 6a8 8 0 0 1 0 12" })
|
|
381
444
|
] }),
|
|
382
|
-
"user-plus": /* @__PURE__ */
|
|
445
|
+
"user-plus": /* @__PURE__ */ r(M, { children: [
|
|
383
446
|
/* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
|
|
384
447
|
/* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M19 8v6M16 11h6" })
|
|
385
448
|
] }),
|
|
386
449
|
"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" }),
|
|
387
|
-
video: /* @__PURE__ */
|
|
450
|
+
video: /* @__PURE__ */ r(M, { children: [
|
|
388
451
|
/* @__PURE__ */ e("rect", { x: "3", y: "6", width: "13", height: "12", rx: "2" }),
|
|
389
452
|
/* @__PURE__ */ e("path", { d: "m16 10 5-3v10l-5-3" })
|
|
390
453
|
] }),
|
|
391
|
-
info: /* @__PURE__ */
|
|
454
|
+
info: /* @__PURE__ */ r(M, { children: [
|
|
392
455
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "9" }),
|
|
393
456
|
/* @__PURE__ */ e("path", { d: "M12 11v6M12 7.5v.5" })
|
|
394
457
|
] }),
|
|
@@ -397,7 +460,7 @@ const $e = {
|
|
|
397
460
|
plus: /* @__PURE__ */ e("path", { d: "M12 5v14M5 12h14" }),
|
|
398
461
|
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" }),
|
|
399
462
|
check: /* @__PURE__ */ e("path", { d: "m5 12 5 5 9-10" }),
|
|
400
|
-
server: /* @__PURE__ */
|
|
463
|
+
server: /* @__PURE__ */ r(M, { children: [
|
|
401
464
|
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "7", rx: "2" }),
|
|
402
465
|
/* @__PURE__ */ e("rect", { x: "3", y: "13", width: "18", height: "7", rx: "2" }),
|
|
403
466
|
/* @__PURE__ */ e("path", { d: "M7 7.5h.5M7 16.5h.5" })
|
|
@@ -409,7 +472,7 @@ const $e = {
|
|
|
409
472
|
more: /* @__PURE__ */ e("path", { d: "M5 12h.5M12 12h.5M19 12h.5" }),
|
|
410
473
|
important: /* @__PURE__ */ e("path", { d: "M4 6h11l5 6-5 6H4l4-6-4-6Z" })
|
|
411
474
|
};
|
|
412
|
-
function
|
|
475
|
+
function F({ name: n, size: l = 20, label: a }) {
|
|
413
476
|
return /* @__PURE__ */ e(
|
|
414
477
|
"svg",
|
|
415
478
|
{
|
|
@@ -424,11 +487,11 @@ function P({ name: n, size: l = 20, label: a }) {
|
|
|
424
487
|
strokeLinejoin: "round",
|
|
425
488
|
focusable: !1,
|
|
426
489
|
...a ? { role: "img", "aria-label": a } : { "aria-hidden": !0 },
|
|
427
|
-
children:
|
|
490
|
+
children: Le[n]
|
|
428
491
|
}
|
|
429
492
|
);
|
|
430
493
|
}
|
|
431
|
-
const
|
|
494
|
+
const xn = Object.keys(Le), Se = {
|
|
432
495
|
reply: "reply",
|
|
433
496
|
"reply-all": "reply",
|
|
434
497
|
forward: "forward",
|
|
@@ -446,270 +509,270 @@ const gn = Object.keys($e), Me = {
|
|
|
446
509
|
"file-earmark-code": "file-code",
|
|
447
510
|
"three-dots": "more"
|
|
448
511
|
};
|
|
449
|
-
function
|
|
450
|
-
return Object.prototype.hasOwnProperty.call(
|
|
512
|
+
function _e(n) {
|
|
513
|
+
return Object.prototype.hasOwnProperty.call(Se, n) ? Se[n] : null;
|
|
451
514
|
}
|
|
452
|
-
const
|
|
453
|
-
function
|
|
515
|
+
const Ve = 'input, select, textarea, button:not([disabled]), iframe, [href], [tabindex]:not([tabindex="-1"])', We = 60;
|
|
516
|
+
function je(n) {
|
|
454
517
|
return n instanceof Element && n.closest('input, select, textarea, [contenteditable="true"], [data-viewer-keys]') !== null;
|
|
455
518
|
}
|
|
456
|
-
function
|
|
519
|
+
function qe(n) {
|
|
457
520
|
return n instanceof Element && n.closest("[data-viewer-gestures]") !== null;
|
|
458
521
|
}
|
|
459
|
-
function
|
|
522
|
+
function Ge(n) {
|
|
460
523
|
return n.getClientRects().length > 0;
|
|
461
524
|
}
|
|
462
|
-
function
|
|
463
|
-
const { name: l, badge: a, closeLabel:
|
|
525
|
+
function Cn(n) {
|
|
526
|
+
const { name: l, badge: a, closeLabel: i, onClose: o, actions: t = [], moreLabel: s = "More", edit: c, editing: u, siblings: d, bar: p, thumbnails: h, strip: m, onZoom: g, children: _ } = n, v = Z(null), w = Z(null), P = Y(), [k, C] = D(!1), x = Z(null);
|
|
464
527
|
G(() => {
|
|
465
528
|
var W;
|
|
466
|
-
const
|
|
529
|
+
const N = document.activeElement, E = document.body.style.overflow;
|
|
467
530
|
return document.body.style.overflow = "hidden", (W = w.current) == null || W.focus(), () => {
|
|
468
531
|
var V;
|
|
469
|
-
document.body.style.overflow = E, (V =
|
|
532
|
+
document.body.style.overflow = E, (V = N == null ? void 0 : N.focus) == null || V.call(N);
|
|
470
533
|
};
|
|
471
534
|
}, []);
|
|
472
|
-
const
|
|
473
|
-
u != null && u.dirty ? u.onDirtyClose() :
|
|
474
|
-
},
|
|
475
|
-
const E =
|
|
476
|
-
|
|
477
|
-
}, ne = (
|
|
478
|
-
var
|
|
479
|
-
const E =
|
|
480
|
-
if (
|
|
535
|
+
const R = () => {
|
|
536
|
+
u != null && u.dirty ? u.onDirtyClose() : o();
|
|
537
|
+
}, z = (N) => {
|
|
538
|
+
const E = N.touches.length === 1 ? N.touches[0] : void 0;
|
|
539
|
+
x.current = E === void 0 || u !== void 0 || qe(N.target) ? null : { x: E.clientX, y: E.clientY };
|
|
540
|
+
}, ne = (N) => {
|
|
541
|
+
var T, X;
|
|
542
|
+
const E = x.current, W = N.changedTouches[0];
|
|
543
|
+
if (x.current = null, E === null || W === void 0) return;
|
|
481
544
|
const V = W.clientX - E.x;
|
|
482
|
-
Math.abs(V) <
|
|
545
|
+
Math.abs(V) < We || Math.abs(V) < Math.abs(W.clientY - E.y) || (V > 0 ? (T = d == null ? void 0 : d.onPrevious) == null || T.call(d) : (X = d == null ? void 0 : d.onNext) == null || X.call(d));
|
|
483
546
|
};
|
|
484
547
|
return ke(
|
|
485
|
-
/* @__PURE__ */
|
|
548
|
+
/* @__PURE__ */ r(
|
|
486
549
|
"div",
|
|
487
550
|
{
|
|
488
|
-
ref:
|
|
489
|
-
className:
|
|
551
|
+
ref: v,
|
|
552
|
+
className: A("cms-viewer", u !== void 0 && "is-editing"),
|
|
490
553
|
role: "dialog",
|
|
491
554
|
"aria-modal": "true",
|
|
492
|
-
"aria-labelledby":
|
|
555
|
+
"aria-labelledby": P,
|
|
493
556
|
tabIndex: -1,
|
|
494
|
-
onKeyDown: (
|
|
557
|
+
onKeyDown: (N) => {
|
|
495
558
|
var E, W, V;
|
|
496
|
-
if (
|
|
559
|
+
if (N.key === "Escape") {
|
|
497
560
|
if (u !== void 0) return;
|
|
498
|
-
|
|
499
|
-
} else if (
|
|
500
|
-
const
|
|
501
|
-
if (
|
|
502
|
-
const X =
|
|
503
|
-
|
|
504
|
-
} else u === void 0 && !
|
|
561
|
+
N.stopPropagation(), k ? C(!1) : o();
|
|
562
|
+
} else if (N.key === "Tab") {
|
|
563
|
+
const T = Array.from(((E = v.current) == null ? void 0 : E.querySelectorAll(Ve)) ?? []).filter(Ge);
|
|
564
|
+
if (T.length === 0) return;
|
|
565
|
+
const X = T[0], H = T[T.length - 1];
|
|
566
|
+
N.shiftKey && document.activeElement === X ? (N.preventDefault(), H.focus()) : !N.shiftKey && document.activeElement === H && (N.preventDefault(), X.focus());
|
|
567
|
+
} else u === void 0 && !je(N.target) && !N.ctrlKey && !N.metaKey && !N.altKey && (N.key === "ArrowLeft" ? (W = d == null ? void 0 : d.onPrevious) == null || W.call(d) : N.key === "ArrowRight" ? (V = d == null ? void 0 : d.onNext) == null || V.call(d) : N.key === "+" || N.key === "=" ? g == null || g("in") : N.key === "-" ? g == null || g("out") : N.key === "0" && (g == null || g("reset")));
|
|
505
568
|
},
|
|
506
569
|
children: [
|
|
507
|
-
|
|
508
|
-
/* @__PURE__ */
|
|
509
|
-
/* @__PURE__ */ e("button", { ref: w, type: "button", className: "cms-viewer__icon", "aria-label":
|
|
570
|
+
d !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-visually-hidden", role: "status", children: `${l}, ${d.position}` }) : null,
|
|
571
|
+
/* @__PURE__ */ r("header", { className: "cms-viewer__top", children: [
|
|
572
|
+
/* @__PURE__ */ e("button", { ref: w, type: "button", className: "cms-viewer__icon", "aria-label": i, onClick: R, children: /* @__PURE__ */ e(K, { name: "close" }) }),
|
|
510
573
|
/* @__PURE__ */ e("span", { className: "cms-viewer__badge", children: a }),
|
|
511
|
-
/* @__PURE__ */ e("h2", { className: "cms-viewer__name", id:
|
|
512
|
-
|
|
574
|
+
/* @__PURE__ */ e("h2", { className: "cms-viewer__name", id: P, title: l, children: l }),
|
|
575
|
+
d !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-viewer__position", children: d.position }) : null,
|
|
513
576
|
/* @__PURE__ */ e("span", { className: "cms-viewer__space" }),
|
|
514
|
-
u !== void 0 ? /* @__PURE__ */
|
|
577
|
+
u !== void 0 ? /* @__PURE__ */ r(M, { children: [
|
|
515
578
|
/* @__PURE__ */ e("span", { className: "cms-viewer__status", role: "status", children: u.status }),
|
|
516
579
|
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: u.onDone, children: u.doneLabel })
|
|
517
|
-
] }) : /* @__PURE__ */
|
|
518
|
-
/* @__PURE__ */ e("span", { className: "cms-viewer__actions", children:
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
] },
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
/* @__PURE__ */ e("span", { className: "cms-viewer__wide", children:
|
|
580
|
+
] }) : /* @__PURE__ */ r(M, { children: [
|
|
581
|
+
/* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: t.map((N) => /* @__PURE__ */ r("button", { type: "button", className: "cms-viewer__button", onClick: N.onSelect, children: [
|
|
582
|
+
N.icon,
|
|
583
|
+
N.label
|
|
584
|
+
] }, N.label)) }),
|
|
585
|
+
c !== void 0 ? /* @__PURE__ */ r("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": c.label, onClick: c.onEdit, children: [
|
|
586
|
+
c.icon,
|
|
587
|
+
/* @__PURE__ */ e("span", { className: "cms-viewer__wide", children: c.label })
|
|
525
588
|
] }) : null,
|
|
526
|
-
|
|
527
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label":
|
|
528
|
-
k ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children:
|
|
589
|
+
t.length > 0 ? /* @__PURE__ */ r("span", { className: "cms-viewer__more", children: [
|
|
590
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label": s, "aria-expanded": k, onClick: () => C((N) => !N), children: /* @__PURE__ */ e(F, { name: "more" }) }),
|
|
591
|
+
k ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: t.map((N) => /* @__PURE__ */ r(
|
|
529
592
|
"button",
|
|
530
593
|
{
|
|
531
594
|
type: "button",
|
|
532
595
|
className: "cms-viewer__button",
|
|
533
596
|
onClick: () => {
|
|
534
|
-
|
|
597
|
+
C(!1), N.onSelect();
|
|
535
598
|
},
|
|
536
599
|
children: [
|
|
537
|
-
|
|
538
|
-
|
|
600
|
+
N.icon,
|
|
601
|
+
N.label
|
|
539
602
|
]
|
|
540
603
|
},
|
|
541
|
-
|
|
604
|
+
N.label
|
|
542
605
|
)) }) : null
|
|
543
606
|
] }) : null
|
|
544
607
|
] })
|
|
545
608
|
] }),
|
|
546
|
-
/* @__PURE__ */
|
|
609
|
+
/* @__PURE__ */ r("div", { className: "cms-viewer__body", children: [
|
|
547
610
|
h != null && u === void 0 ? /* @__PURE__ */ e("nav", { className: "cms-viewer__thumbnails", children: h }) : null,
|
|
548
|
-
/* @__PURE__ */
|
|
549
|
-
|
|
550
|
-
u === void 0 && (
|
|
551
|
-
u === void 0 && (
|
|
552
|
-
u === void 0 &&
|
|
611
|
+
/* @__PURE__ */ r("div", { className: "cms-viewer__content", onTouchStart: z, onTouchEnd: ne, children: [
|
|
612
|
+
_,
|
|
613
|
+
u === void 0 && (d != null && d.onPrevious) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--previous", "aria-label": d.previousLabel, title: d.previousLabel, onClick: d.onPrevious, children: /* @__PURE__ */ e(K, { name: "back" }) }) : null,
|
|
614
|
+
u === void 0 && (d != null && d.onNext) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--next", "aria-label": d.nextLabel, title: d.nextLabel, onClick: d.onNext, children: /* @__PURE__ */ e(K, { name: "back" }) }) : null,
|
|
615
|
+
u === void 0 && d !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(d.total, 7) }, (N, E) => /* @__PURE__ */ e("i", { className: E === Math.min(d.index, 6) ? "is-current" : void 0 }, E)) }) : null
|
|
553
616
|
] })
|
|
554
617
|
] }),
|
|
555
|
-
u === void 0 &&
|
|
556
|
-
|
|
618
|
+
u === void 0 && m != null ? /* @__PURE__ */ e("div", { className: "cms-viewer__strip", children: m }) : null,
|
|
619
|
+
p != null ? /* @__PURE__ */ e("footer", { className: "cms-viewer__bar", children: p }) : null
|
|
557
620
|
]
|
|
558
621
|
}
|
|
559
622
|
),
|
|
560
623
|
document.body
|
|
561
624
|
);
|
|
562
625
|
}
|
|
563
|
-
class
|
|
626
|
+
class Ye extends Error {
|
|
564
627
|
constructor(l = "denied") {
|
|
565
628
|
super(l), this.name = "FilePickerDenied";
|
|
566
629
|
}
|
|
567
630
|
}
|
|
568
631
|
const Ne = (n, l) => `${n}
|
|
569
|
-
${l}`,
|
|
570
|
-
function
|
|
632
|
+
${l}`, Xe = (n, l) => n === "" ? l : `${n}/${l}`, Je = 48;
|
|
633
|
+
function Mn(n) {
|
|
571
634
|
var me, ue;
|
|
572
|
-
const { open: l, spaces: a, list:
|
|
635
|
+
const { open: l, spaces: a, list: i, disabledReason: o, budget: t, formatSize: s, labels: c, onConfirm: u, onCancel: d } = n, [p, h] = D(((me = a[0]) == null ? void 0 : me.id) ?? ""), [m, g] = D(""), [_, v] = D({ status: "loading" }), [w, P] = D(0), [k, C] = D(/* @__PURE__ */ new Map()), [x, R] = D(0), [z, ne] = D(!1), N = Z(null), E = Y();
|
|
573
636
|
G(() => {
|
|
574
|
-
var
|
|
575
|
-
l && (h(((
|
|
637
|
+
var f;
|
|
638
|
+
l && (h(((f = a[0]) == null ? void 0 : f.id) ?? ""), g(""), C(/* @__PURE__ */ new Map()), ne(!1));
|
|
576
639
|
}, [l]), G(() => {
|
|
577
|
-
if (!l ||
|
|
578
|
-
let
|
|
579
|
-
return
|
|
580
|
-
(y) =>
|
|
581
|
-
(y) =>
|
|
640
|
+
if (!l || p === "") return;
|
|
641
|
+
let f = !0;
|
|
642
|
+
return v({ status: "loading" }), R(0), i(p, m).then(
|
|
643
|
+
(y) => f && v({ status: "ready", entries: y.entries, next: y.next ?? null, paging: !1 }),
|
|
644
|
+
(y) => f && v({ status: y instanceof Ye ? "denied" : "error" })
|
|
582
645
|
), () => {
|
|
583
|
-
|
|
646
|
+
f = !1;
|
|
584
647
|
};
|
|
585
|
-
}, [l,
|
|
586
|
-
const W =
|
|
587
|
-
if (
|
|
588
|
-
const
|
|
589
|
-
|
|
590
|
-
(I) =>
|
|
591
|
-
() =>
|
|
648
|
+
}, [l, p, m, i, w]);
|
|
649
|
+
const W = be(() => {
|
|
650
|
+
if (_.status !== "ready" || _.next === null || _.paging) return;
|
|
651
|
+
const f = _.next, y = _.entries;
|
|
652
|
+
v({ ..._, paging: !0 }), i(p, m, f).then(
|
|
653
|
+
(I) => v({ status: "ready", entries: [...y, ...I.entries], next: I.next ?? null, paging: !1 }),
|
|
654
|
+
() => v({ status: "ready", entries: y, next: f, paging: !1 })
|
|
592
655
|
);
|
|
593
|
-
}, [
|
|
656
|
+
}, [_, i, p, m]), V = be((f) => {
|
|
594
657
|
var y;
|
|
595
|
-
return ((y =
|
|
596
|
-
}, [
|
|
597
|
-
if (
|
|
598
|
-
const y =
|
|
599
|
-
return y || (
|
|
600
|
-
},
|
|
601
|
-
const y = Ne(
|
|
602
|
-
!k.has(y) &&
|
|
658
|
+
return ((y = t == null ? void 0 : t.cost) == null ? void 0 : y.call(t, f)) ?? f.size ?? 0;
|
|
659
|
+
}, [t]), T = Ie(() => [...k.values()], [k]), X = T.reduce((f, y) => f + (y.size ?? 0), 0), H = t === void 0 ? null : t.limitBytes - t.usedBytes - T.reduce((f, y) => f + V(y), 0), Q = H !== null && H < 0, ie = (f) => {
|
|
660
|
+
if (f.kind !== "file") return null;
|
|
661
|
+
const y = o == null ? void 0 : o(f);
|
|
662
|
+
return y || (H !== null && !k.has(Ne(p, f.id)) && V(f) > H ? c.overBudget : null);
|
|
663
|
+
}, ce = (f) => {
|
|
664
|
+
const y = Ne(p, f.id);
|
|
665
|
+
!k.has(y) && ie(f) !== null || C((I) => {
|
|
603
666
|
const B = new Map(I);
|
|
604
|
-
return B.has(y) ? B.delete(y) : B.set(y, { ...
|
|
667
|
+
return B.has(y) ? B.delete(y) : B.set(y, { ...f, space: p, path: m }), B;
|
|
605
668
|
});
|
|
606
|
-
},
|
|
669
|
+
}, b = (f) => g(Xe(m, f.name)), S = () => g(m.includes("/") ? m.slice(0, m.lastIndexOf("/")) : ""), O = (f) => C((y) => {
|
|
607
670
|
const I = new Map(y);
|
|
608
|
-
return I.delete(
|
|
609
|
-
}), j =
|
|
610
|
-
const y = j[
|
|
611
|
-
if (
|
|
612
|
-
|
|
613
|
-
const I = j.length - 1, B =
|
|
614
|
-
|
|
615
|
-
} else
|
|
616
|
-
}, q =
|
|
617
|
-
return /* @__PURE__ */
|
|
618
|
-
|
|
671
|
+
return I.delete(f), I;
|
|
672
|
+
}), j = _.status === "ready" ? _.entries : [], L = (f) => {
|
|
673
|
+
const y = j[x];
|
|
674
|
+
if (f.key === "ArrowDown" || f.key === "ArrowUp" || f.key === "Home" || f.key === "End") {
|
|
675
|
+
f.preventDefault();
|
|
676
|
+
const I = j.length - 1, B = f.key === "Home" ? 0 : f.key === "End" ? I : Math.min(I, Math.max(0, x + (f.key === "ArrowDown" ? 1 : -1)));
|
|
677
|
+
R(B), B >= I - 1 && W();
|
|
678
|
+
} else f.key === "Enter" && (y == null ? void 0 : y.kind) === "folder" ? (f.preventDefault(), b(y)) : f.key === " " && (y == null ? void 0 : y.kind) === "file" ? (f.preventDefault(), ce(y)) : f.key === "Backspace" && m !== "" && (f.preventDefault(), S());
|
|
679
|
+
}, q = m === "" ? [] : m.split("/"), oe = ((ue = a.find((f) => f.id === p)) == null ? void 0 : ue.name) ?? "", de = (f) => `${E}-entry-${String(f)}`;
|
|
680
|
+
return /* @__PURE__ */ r(
|
|
681
|
+
Te,
|
|
619
682
|
{
|
|
620
683
|
open: l,
|
|
621
|
-
title:
|
|
622
|
-
onClose:
|
|
623
|
-
closeLabel:
|
|
624
|
-
initialFocus:
|
|
684
|
+
title: c.title,
|
|
685
|
+
onClose: d,
|
|
686
|
+
closeLabel: c.close,
|
|
687
|
+
initialFocus: N,
|
|
625
688
|
className: "cms-file-picker",
|
|
626
|
-
footer: /* @__PURE__ */
|
|
627
|
-
/* @__PURE__ */
|
|
628
|
-
|
|
629
|
-
|
|
689
|
+
footer: /* @__PURE__ */ r("div", { className: "cms-file-picker__foot", children: [
|
|
690
|
+
/* @__PURE__ */ r("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
|
|
691
|
+
T.length > 0 ? /* @__PURE__ */ e("span", { children: c.total(T.length, s(X)) }) : null,
|
|
692
|
+
t !== void 0 && H !== null ? /* @__PURE__ */ e("span", { className: A(Q && "is-over"), children: Q ? c.overBudget : c.left(s(Math.max(0, H)), s(t.limitBytes)) }) : null
|
|
630
693
|
] }),
|
|
631
|
-
/* @__PURE__ */
|
|
632
|
-
/* @__PURE__ */ e(ee, { variant: "secondary", onClick:
|
|
633
|
-
/* @__PURE__ */ e(ee, { variant: "primary", disabled:
|
|
694
|
+
/* @__PURE__ */ r("div", { className: "cms-file-picker__actions", children: [
|
|
695
|
+
/* @__PURE__ */ e(ee, { variant: "secondary", onClick: d, children: c.cancel }),
|
|
696
|
+
/* @__PURE__ */ e(ee, { variant: "primary", disabled: T.length === 0 || Q, onClick: () => u(T), children: c.confirm(T.length) })
|
|
634
697
|
] })
|
|
635
698
|
] }),
|
|
636
699
|
children: [
|
|
637
|
-
/* @__PURE__ */
|
|
638
|
-
a.length > 1 ? /* @__PURE__ */
|
|
639
|
-
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children:
|
|
640
|
-
/* @__PURE__ */ e("select", { className: "cms-input cms-select", value:
|
|
641
|
-
h(
|
|
642
|
-
}, children: a.map((
|
|
700
|
+
/* @__PURE__ */ r("div", { className: "cms-file-picker__top", children: [
|
|
701
|
+
a.length > 1 ? /* @__PURE__ */ r("label", { className: "cms-file-picker__space", children: [
|
|
702
|
+
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: c.space }),
|
|
703
|
+
/* @__PURE__ */ e("select", { className: "cms-input cms-select", value: p, onChange: (f) => {
|
|
704
|
+
h(f.target.value), g("");
|
|
705
|
+
}, children: a.map((f) => /* @__PURE__ */ e("option", { value: f.id, children: f.name }, f.id)) })
|
|
643
706
|
] }) : null,
|
|
644
|
-
/* @__PURE__ */
|
|
645
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label":
|
|
646
|
-
/* @__PURE__ */
|
|
647
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current":
|
|
648
|
-
q.map((
|
|
707
|
+
/* @__PURE__ */ r("nav", { className: "cms-file-picker__path", "aria-label": c.path, children: [
|
|
708
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": c.up, disabled: m === "", onClick: S, children: /* @__PURE__ */ e(F, { name: "chevron-left" }) }),
|
|
709
|
+
/* @__PURE__ */ r("ol", { children: [
|
|
710
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": m === "" ? "location" : void 0, onClick: () => g(""), children: oe }) }),
|
|
711
|
+
q.map((f, y) => {
|
|
649
712
|
const I = q.slice(0, y + 1).join("/");
|
|
650
|
-
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": I ===
|
|
713
|
+
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": I === m ? "location" : void 0, onClick: () => g(I), children: f }) }, I);
|
|
651
714
|
})
|
|
652
715
|
] })
|
|
653
716
|
] }),
|
|
654
|
-
|
|
717
|
+
T.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": z, onClick: () => ne((f) => !f), children: c.selected(T.length) }) : null
|
|
655
718
|
] }),
|
|
656
|
-
|
|
657
|
-
/* @__PURE__ */ e("ul", { children: [...k.entries()].map(([
|
|
719
|
+
z && T.length > 0 ? /* @__PURE__ */ r("div", { className: "cms-file-picker__chosen", children: [
|
|
720
|
+
/* @__PURE__ */ e("ul", { children: [...k.entries()].map(([f, y]) => /* @__PURE__ */ r("li", { children: [
|
|
658
721
|
/* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: y.name }),
|
|
659
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label":
|
|
660
|
-
] },
|
|
722
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": c.remove(y.name), onClick: () => O(f), children: /* @__PURE__ */ e(K, { name: "close" }) })
|
|
723
|
+
] }, f)) }),
|
|
661
724
|
/* @__PURE__ */ e(ee, { variant: "secondary", onClick: () => {
|
|
662
|
-
|
|
663
|
-
}, children:
|
|
725
|
+
C(/* @__PURE__ */ new Map()), ne(!1);
|
|
726
|
+
}, children: c.clear })
|
|
664
727
|
] }) : null,
|
|
665
|
-
/* @__PURE__ */
|
|
666
|
-
const y =
|
|
667
|
-
y.scrollTop + y.clientHeight >= y.scrollHeight -
|
|
728
|
+
/* @__PURE__ */ r("div", { className: "cms-file-picker__list", onScroll: (f) => {
|
|
729
|
+
const y = f.currentTarget;
|
|
730
|
+
y.scrollTop + y.clientHeight >= y.scrollHeight - Je && W();
|
|
668
731
|
}, children: [
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
/* @__PURE__ */
|
|
732
|
+
_.status === "loading" ? /* @__PURE__ */ e(se, { kind: "loading", title: c.loading, placement: "block" }) : null,
|
|
733
|
+
_.status === "error" ? /* @__PURE__ */ e(se, { kind: "error", title: c.error, placement: "block", action: { label: c.retry, onAction: () => P((f) => f + 1) } }) : null,
|
|
734
|
+
_.status === "denied" ? /* @__PURE__ */ e(se, { kind: "denied", title: c.denied, placement: "block" }) : null,
|
|
735
|
+
_.status === "ready" && j.length === 0 ? /* @__PURE__ */ e(se, { kind: "empty", title: c.empty, placement: "block" }) : null,
|
|
736
|
+
/* @__PURE__ */ r(
|
|
674
737
|
"div",
|
|
675
738
|
{
|
|
676
|
-
ref:
|
|
739
|
+
ref: N,
|
|
677
740
|
role: "listbox",
|
|
678
741
|
"aria-multiselectable": "true",
|
|
679
|
-
"aria-label":
|
|
680
|
-
"aria-activedescendant": j.length > 0 ? de(
|
|
742
|
+
"aria-label": c.files,
|
|
743
|
+
"aria-activedescendant": j.length > 0 ? de(x) : void 0,
|
|
681
744
|
tabIndex: 0,
|
|
682
745
|
className: "cms-file-picker__entries",
|
|
683
|
-
hidden:
|
|
684
|
-
onKeyDown:
|
|
746
|
+
hidden: _.status !== "ready" || j.length === 0,
|
|
747
|
+
onKeyDown: L,
|
|
685
748
|
children: [
|
|
686
|
-
j.map((
|
|
687
|
-
const I =
|
|
688
|
-
return /* @__PURE__ */
|
|
749
|
+
j.map((f, y) => {
|
|
750
|
+
const I = f.kind === "file" && k.has(Ne(p, f.id)), B = ie(f);
|
|
751
|
+
return /* @__PURE__ */ r(
|
|
689
752
|
"div",
|
|
690
753
|
{
|
|
691
754
|
id: de(y),
|
|
692
755
|
role: "option",
|
|
693
|
-
"aria-selected":
|
|
756
|
+
"aria-selected": f.kind === "file" ? I : void 0,
|
|
694
757
|
"aria-disabled": B !== null || void 0,
|
|
695
|
-
className:
|
|
758
|
+
className: A("cms-file-picker__entry", y === x && "is-active", I && "is-ticked", B !== null && "is-disabled"),
|
|
696
759
|
onClick: () => {
|
|
697
|
-
|
|
760
|
+
R(y), f.kind === "folder" ? b(f) : ce(f);
|
|
698
761
|
},
|
|
699
762
|
children: [
|
|
700
|
-
/* @__PURE__ */ e("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: I ? /* @__PURE__ */ e(
|
|
701
|
-
/* @__PURE__ */ e(
|
|
702
|
-
/* @__PURE__ */
|
|
703
|
-
/* @__PURE__ */ e("span", { className: "cms-file-picker__name", children:
|
|
763
|
+
/* @__PURE__ */ e("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: I ? /* @__PURE__ */ e(F, { name: "check" }) : null }),
|
|
764
|
+
/* @__PURE__ */ e(F, { name: f.kind === "folder" ? "folder" : "file" }),
|
|
765
|
+
/* @__PURE__ */ r("span", { className: "cms-file-picker__text", children: [
|
|
766
|
+
/* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: f.name }),
|
|
704
767
|
B !== null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__reason", children: B }) : null
|
|
705
768
|
] }),
|
|
706
|
-
|
|
769
|
+
f.kind === "file" && f.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children: s(f.size) }) : null
|
|
707
770
|
]
|
|
708
771
|
},
|
|
709
|
-
|
|
772
|
+
f.id
|
|
710
773
|
);
|
|
711
774
|
}),
|
|
712
|
-
|
|
775
|
+
_.status === "ready" && _.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(se, { kind: "loading", title: c.loading, placement: "inline" }) }) : null
|
|
713
776
|
]
|
|
714
777
|
}
|
|
715
778
|
)
|
|
@@ -718,25 +781,25 @@ function yn(n) {
|
|
|
718
781
|
}
|
|
719
782
|
);
|
|
720
783
|
}
|
|
721
|
-
function
|
|
722
|
-
return /* @__PURE__ */
|
|
723
|
-
|
|
784
|
+
function Sn({ title: n, scope: l, actions: a, backLink: i }) {
|
|
785
|
+
return /* @__PURE__ */ r("header", { className: "cms-page-header", children: [
|
|
786
|
+
i ? /* @__PURE__ */ r(
|
|
724
787
|
"a",
|
|
725
788
|
{
|
|
726
789
|
className: "cms-page-header__back",
|
|
727
|
-
href:
|
|
728
|
-
onClick: (
|
|
729
|
-
|
|
790
|
+
href: i.href ?? "#",
|
|
791
|
+
onClick: (o) => {
|
|
792
|
+
i.onBack && (o.preventDefault(), i.onBack());
|
|
730
793
|
},
|
|
731
794
|
children: [
|
|
732
|
-
/* @__PURE__ */ e(
|
|
795
|
+
/* @__PURE__ */ e(K, { name: "back" }),
|
|
733
796
|
" ",
|
|
734
|
-
|
|
797
|
+
i.label
|
|
735
798
|
]
|
|
736
799
|
}
|
|
737
800
|
) : null,
|
|
738
|
-
/* @__PURE__ */
|
|
739
|
-
/* @__PURE__ */
|
|
801
|
+
/* @__PURE__ */ r("div", { className: "cms-page-header__row", children: [
|
|
802
|
+
/* @__PURE__ */ r("div", { className: "cms-page-header__titles", children: [
|
|
740
803
|
/* @__PURE__ */ e("h1", { className: "cms-page-header__title", children: n }),
|
|
741
804
|
l != null ? /* @__PURE__ */ e("p", { className: "cms-page-header__scope", children: l }) : null
|
|
742
805
|
] }),
|
|
@@ -744,118 +807,118 @@ function wn({ title: n, scope: l, actions: a, backLink: t }) {
|
|
|
744
807
|
] })
|
|
745
808
|
] });
|
|
746
809
|
}
|
|
747
|
-
function
|
|
748
|
-
const
|
|
810
|
+
function An({ tabs: n, active: l, onSelect: a, label: i }) {
|
|
811
|
+
const o = Z([]), t = (s, c) => {
|
|
749
812
|
var h;
|
|
750
|
-
const u = n.length - 1,
|
|
751
|
-
if (
|
|
752
|
-
|
|
753
|
-
const
|
|
754
|
-
|
|
813
|
+
const u = n.length - 1, d = s.key === "ArrowRight" ? c === u ? 0 : c + 1 : s.key === "ArrowLeft" ? c === 0 ? u : c - 1 : s.key === "Home" ? 0 : s.key === "End" ? u : null;
|
|
814
|
+
if (d === null) return;
|
|
815
|
+
s.preventDefault();
|
|
816
|
+
const p = n[d];
|
|
817
|
+
p && (a(p.id), (h = o.current[d]) == null || h.focus());
|
|
755
818
|
};
|
|
756
|
-
return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label":
|
|
757
|
-
const u =
|
|
758
|
-
return /* @__PURE__ */
|
|
819
|
+
return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": i, children: n.map((s, c) => {
|
|
820
|
+
const u = s.id === l;
|
|
821
|
+
return /* @__PURE__ */ r(
|
|
759
822
|
"button",
|
|
760
823
|
{
|
|
761
|
-
ref: (
|
|
762
|
-
|
|
824
|
+
ref: (d) => {
|
|
825
|
+
o.current[c] = d;
|
|
763
826
|
},
|
|
764
827
|
type: "button",
|
|
765
828
|
role: "tab",
|
|
766
|
-
className:
|
|
829
|
+
className: A("cms-tab", u && "is-active"),
|
|
767
830
|
"aria-selected": u,
|
|
768
831
|
tabIndex: u ? 0 : -1,
|
|
769
|
-
onClick: () => a(
|
|
770
|
-
onKeyDown: (
|
|
832
|
+
onClick: () => a(s.id),
|
|
833
|
+
onKeyDown: (d) => t(d, c),
|
|
771
834
|
children: [
|
|
772
|
-
|
|
773
|
-
|
|
835
|
+
s.label,
|
|
836
|
+
s.count !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-tab__count", children: s.count }) : null
|
|
774
837
|
]
|
|
775
838
|
},
|
|
776
|
-
|
|
839
|
+
s.id
|
|
777
840
|
);
|
|
778
841
|
}) });
|
|
779
842
|
}
|
|
780
|
-
function
|
|
781
|
-
var
|
|
843
|
+
function Qe(n) {
|
|
844
|
+
var i;
|
|
782
845
|
const l = n.trim().split(/\s+/).filter(Boolean);
|
|
783
|
-
return (l.length > 1 ? [l[0][0], l[l.length - 1][0]] : [(
|
|
846
|
+
return (l.length > 1 ? [l[0][0], l[l.length - 1][0]] : [(i = l[0]) == null ? void 0 : i[0]]).filter(Boolean).join("").toUpperCase();
|
|
784
847
|
}
|
|
785
|
-
function
|
|
848
|
+
function en(n) {
|
|
786
849
|
let l = 0;
|
|
787
850
|
for (const a of n.trim().toLowerCase())
|
|
788
851
|
l = l * 31 + (a.codePointAt(0) ?? 0) >>> 0;
|
|
789
852
|
return l % 6 + 1;
|
|
790
853
|
}
|
|
791
|
-
function ve({ name: n, pictureUrl: l, presence: a, size:
|
|
792
|
-
return /* @__PURE__ */
|
|
854
|
+
function ve({ name: n, pictureUrl: l, presence: a, size: i = 32 }) {
|
|
855
|
+
return /* @__PURE__ */ r(
|
|
793
856
|
"span",
|
|
794
857
|
{
|
|
795
|
-
className: `cms-avatar cms-avatar--tint-${
|
|
796
|
-
style: { width:
|
|
858
|
+
className: `cms-avatar cms-avatar--tint-${en(n)}`,
|
|
859
|
+
style: { width: i, height: i, fontSize: Math.round(i * 0.4) },
|
|
797
860
|
role: "img",
|
|
798
861
|
"aria-label": a ? `${n}, ${a}` : n,
|
|
799
862
|
children: [
|
|
800
|
-
l ? /* @__PURE__ */ e("img", { src: l, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ e("span", { "aria-hidden": "true", children:
|
|
801
|
-
a ? /* @__PURE__ */ e("span", { className:
|
|
863
|
+
l ? /* @__PURE__ */ e("img", { src: l, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ e("span", { "aria-hidden": "true", children: Qe(n) }),
|
|
864
|
+
a ? /* @__PURE__ */ e("span", { className: A("cms-avatar__presence", `is-${a}`), "aria-hidden": "true" }) : null
|
|
802
865
|
]
|
|
803
866
|
}
|
|
804
867
|
);
|
|
805
868
|
}
|
|
806
|
-
function
|
|
807
|
-
return n <= 0 ? null : /* @__PURE__ */
|
|
869
|
+
function nn({ count: n, label: l, max: a = 99 }) {
|
|
870
|
+
return n <= 0 ? null : /* @__PURE__ */ r("span", { className: "cms-badge", children: [
|
|
808
871
|
/* @__PURE__ */ e("span", { "aria-hidden": "true", children: n > a ? `${a}+` : n }),
|
|
809
872
|
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: l })
|
|
810
873
|
] });
|
|
811
874
|
}
|
|
812
|
-
function
|
|
813
|
-
return /* @__PURE__ */
|
|
814
|
-
/* @__PURE__ */
|
|
875
|
+
function Dn({ product: n, mark: l, rail: a, active: i, onNavigate: o, server: t, search: s, account: c, children: u, railLabel: d = "Sections" }) {
|
|
876
|
+
return /* @__PURE__ */ r("div", { className: "cms-shell", children: [
|
|
877
|
+
/* @__PURE__ */ r("nav", { className: "cms-shell__rail", "aria-label": d, children: [
|
|
815
878
|
/* @__PURE__ */ e("span", { className: "cms-shell__mark", "aria-hidden": "true", children: l }),
|
|
816
|
-
/* @__PURE__ */ e("ul", { className: "cms-shell__items", children: a.map((
|
|
817
|
-
const h =
|
|
818
|
-
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */
|
|
879
|
+
/* @__PURE__ */ e("ul", { className: "cms-shell__items", children: a.map((p) => {
|
|
880
|
+
const h = p.id === i;
|
|
881
|
+
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ r(
|
|
819
882
|
"a",
|
|
820
883
|
{
|
|
821
|
-
href:
|
|
822
|
-
className:
|
|
884
|
+
href: p.href,
|
|
885
|
+
className: A("cms-shell__item", h && "is-active"),
|
|
823
886
|
"aria-current": h ? "page" : void 0,
|
|
824
|
-
title:
|
|
825
|
-
onClick: (
|
|
826
|
-
|
|
887
|
+
title: p.label,
|
|
888
|
+
onClick: (m) => {
|
|
889
|
+
o && (m.preventDefault(), o(p.id));
|
|
827
890
|
},
|
|
828
891
|
children: [
|
|
829
|
-
/* @__PURE__ */
|
|
830
|
-
/* @__PURE__ */ e(
|
|
831
|
-
|
|
892
|
+
/* @__PURE__ */ r("span", { className: "cms-shell__icon", children: [
|
|
893
|
+
/* @__PURE__ */ e(F, { name: p.icon, size: 22 }),
|
|
894
|
+
p.badge ? /* @__PURE__ */ e(nn, { count: p.badge.count, label: p.badge.label }) : null
|
|
832
895
|
] }),
|
|
833
|
-
/* @__PURE__ */ e("span", { className: "cms-shell__label", children:
|
|
896
|
+
/* @__PURE__ */ e("span", { className: "cms-shell__label", children: p.label })
|
|
834
897
|
]
|
|
835
898
|
}
|
|
836
|
-
) },
|
|
899
|
+
) }, p.id);
|
|
837
900
|
}) })
|
|
838
901
|
] }),
|
|
839
|
-
/* @__PURE__ */
|
|
902
|
+
/* @__PURE__ */ r("header", { className: "cms-shell__top", children: [
|
|
840
903
|
/* @__PURE__ */ e("span", { className: "cms-shell__product", children: n }),
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
904
|
+
t != null ? /* @__PURE__ */ e("div", { className: "cms-shell__server", children: t }) : null,
|
|
905
|
+
s != null ? /* @__PURE__ */ e("div", { className: "cms-shell__search", children: s }) : null,
|
|
906
|
+
c != null ? /* @__PURE__ */ e("div", { className: "cms-shell__account", children: c }) : null
|
|
844
907
|
] }),
|
|
845
908
|
/* @__PURE__ */ e("main", { className: "cms-shell__main", children: u })
|
|
846
909
|
] });
|
|
847
910
|
}
|
|
848
|
-
function
|
|
849
|
-
return /* @__PURE__ */
|
|
911
|
+
function En({ label: n, placeholder: l, value: a, onChange: i, onSearch: o }) {
|
|
912
|
+
return /* @__PURE__ */ r(
|
|
850
913
|
"form",
|
|
851
914
|
{
|
|
852
915
|
role: "search",
|
|
853
916
|
className: "cms-search",
|
|
854
|
-
onSubmit: (
|
|
855
|
-
|
|
917
|
+
onSubmit: (t) => {
|
|
918
|
+
t.preventDefault(), o == null || o(a);
|
|
856
919
|
},
|
|
857
920
|
children: [
|
|
858
|
-
/* @__PURE__ */ e(
|
|
921
|
+
/* @__PURE__ */ e(F, { name: "search", size: 18 }),
|
|
859
922
|
/* @__PURE__ */ e(
|
|
860
923
|
"input",
|
|
861
924
|
{
|
|
@@ -864,77 +927,77 @@ function Mn({ label: n, placeholder: l, value: a, onChange: t, onSearch: r }) {
|
|
|
864
927
|
"aria-label": n,
|
|
865
928
|
placeholder: l,
|
|
866
929
|
value: a,
|
|
867
|
-
onChange: (
|
|
930
|
+
onChange: (t) => i(t.target.value)
|
|
868
931
|
}
|
|
869
932
|
)
|
|
870
933
|
]
|
|
871
934
|
}
|
|
872
935
|
);
|
|
873
936
|
}
|
|
874
|
-
function
|
|
875
|
-
const
|
|
937
|
+
function Tn({ options: n, value: l, onChange: a, label: i }) {
|
|
938
|
+
const o = Z([]), t = (s, c) => {
|
|
876
939
|
var h;
|
|
877
|
-
const u = n.length - 1,
|
|
878
|
-
if (
|
|
879
|
-
|
|
880
|
-
const
|
|
881
|
-
|
|
940
|
+
const u = n.length - 1, d = s.key === "ArrowRight" || s.key === "ArrowDown" ? c === u ? 0 : c + 1 : s.key === "ArrowLeft" || s.key === "ArrowUp" ? c === 0 ? u : c - 1 : null;
|
|
941
|
+
if (d === null) return;
|
|
942
|
+
s.preventDefault();
|
|
943
|
+
const p = n[d];
|
|
944
|
+
p && (a(p.id), (h = o.current[d]) == null || h.focus());
|
|
882
945
|
};
|
|
883
|
-
return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label":
|
|
884
|
-
const u =
|
|
885
|
-
return /* @__PURE__ */
|
|
946
|
+
return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label": i, children: n.map((s, c) => {
|
|
947
|
+
const u = s.id === l;
|
|
948
|
+
return /* @__PURE__ */ r(
|
|
886
949
|
"button",
|
|
887
950
|
{
|
|
888
|
-
ref: (
|
|
889
|
-
|
|
951
|
+
ref: (d) => {
|
|
952
|
+
o.current[c] = d;
|
|
890
953
|
},
|
|
891
954
|
type: "button",
|
|
892
955
|
role: "radio",
|
|
893
956
|
"aria-checked": u,
|
|
894
957
|
tabIndex: u ? 0 : -1,
|
|
895
|
-
className:
|
|
896
|
-
onClick: () => a(
|
|
897
|
-
onKeyDown: (
|
|
958
|
+
className: A("cms-chip", u && "is-on"),
|
|
959
|
+
onClick: () => a(s.id),
|
|
960
|
+
onKeyDown: (d) => t(d, c),
|
|
898
961
|
children: [
|
|
899
|
-
u ? /* @__PURE__ */ e(
|
|
900
|
-
|
|
962
|
+
u ? /* @__PURE__ */ e(F, { name: "check", size: 16 }) : null,
|
|
963
|
+
s.label
|
|
901
964
|
]
|
|
902
965
|
},
|
|
903
|
-
|
|
966
|
+
s.id
|
|
904
967
|
);
|
|
905
968
|
}) });
|
|
906
969
|
}
|
|
907
|
-
function
|
|
908
|
-
const
|
|
909
|
-
return /* @__PURE__ */ e("div", { className:
|
|
910
|
-
|
|
911
|
-
/* @__PURE__ */ e(
|
|
970
|
+
function Ln({ panes: n, active: l, back: a }) {
|
|
971
|
+
const i = Math.min(Math.max(l ?? n.length - 1, 0), n.length - 1);
|
|
972
|
+
return /* @__PURE__ */ e("div", { className: A("cms-panes", n.length === 3 ? "cms-panes--three" : "cms-panes--two"), "data-active": i, children: n.map((o, t) => /* @__PURE__ */ r("section", { className: "cms-panes__pane", "aria-label": o.label, "data-offset": i - t, children: [
|
|
973
|
+
t === i && a ? /* @__PURE__ */ r("a", { className: "cms-panes__back", href: a.href, children: [
|
|
974
|
+
/* @__PURE__ */ e(F, { name: "chevron-left", size: 18 }),
|
|
912
975
|
a.label
|
|
913
976
|
] }) : null,
|
|
914
|
-
|
|
915
|
-
] },
|
|
977
|
+
o.content
|
|
978
|
+
] }, o.label)) });
|
|
916
979
|
}
|
|
917
|
-
const
|
|
918
|
-
function
|
|
919
|
-
const
|
|
920
|
-
return /* @__PURE__ */
|
|
980
|
+
const ln = { attachment: "Has an attachment", unread: "Unread" };
|
|
981
|
+
function $n({ from: n, subject: l, preview: a, time: i, unread: o, hasAttachment: t, selected: s, onOpen: c, labels: u }) {
|
|
982
|
+
const d = re(ln, u);
|
|
983
|
+
return /* @__PURE__ */ r(
|
|
921
984
|
"button",
|
|
922
985
|
{
|
|
923
986
|
type: "button",
|
|
924
|
-
className:
|
|
925
|
-
"aria-current":
|
|
926
|
-
onClick:
|
|
987
|
+
className: A("cms-mail-row", o && "is-unread", s && "is-selected"),
|
|
988
|
+
"aria-current": s ? "true" : void 0,
|
|
989
|
+
onClick: c,
|
|
927
990
|
children: [
|
|
928
991
|
/* @__PURE__ */ e(ve, { name: n, size: 40 }),
|
|
929
|
-
/* @__PURE__ */
|
|
930
|
-
/* @__PURE__ */
|
|
992
|
+
/* @__PURE__ */ r("span", { className: "cms-mail-row__body", children: [
|
|
993
|
+
/* @__PURE__ */ r("span", { className: "cms-mail-row__line", children: [
|
|
931
994
|
/* @__PURE__ */ e("span", { className: "cms-mail-row__from", children: n }),
|
|
932
|
-
|
|
933
|
-
/* @__PURE__ */ e("span", { className: "cms-mail-row__time", children:
|
|
995
|
+
t ? /* @__PURE__ */ e(F, { name: "paperclip", size: 16, label: d.attachment }) : null,
|
|
996
|
+
/* @__PURE__ */ e("span", { className: "cms-mail-row__time", children: i })
|
|
934
997
|
] }),
|
|
935
|
-
/* @__PURE__ */
|
|
998
|
+
/* @__PURE__ */ r("span", { className: "cms-mail-row__line", children: [
|
|
936
999
|
/* @__PURE__ */ e("span", { className: "cms-mail-row__subject", children: l }),
|
|
937
|
-
|
|
1000
|
+
o ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label": d.unread }) : null
|
|
938
1001
|
] }),
|
|
939
1002
|
/* @__PURE__ */ e("span", { className: "cms-mail-row__preview", children: a })
|
|
940
1003
|
] })
|
|
@@ -942,49 +1005,49 @@ function An({ from: n, subject: l, preview: a, time: t, unread: r, hasAttachment
|
|
|
942
1005
|
}
|
|
943
1006
|
);
|
|
944
1007
|
}
|
|
945
|
-
function
|
|
946
|
-
return /* @__PURE__ */
|
|
1008
|
+
function In({ direction: n, children: l, time: a, read: i, readLabel: o = "Read" }) {
|
|
1009
|
+
return /* @__PURE__ */ r("div", { className: A("cms-bubble", `cms-bubble--${n}`), children: [
|
|
947
1010
|
/* @__PURE__ */ e("div", { className: "cms-bubble__text", children: l }),
|
|
948
|
-
/* @__PURE__ */
|
|
1011
|
+
/* @__PURE__ */ r("div", { className: "cms-bubble__meta", children: [
|
|
949
1012
|
a,
|
|
950
|
-
n === "out" &&
|
|
1013
|
+
n === "out" && i ? /* @__PURE__ */ r(M, { children: [
|
|
951
1014
|
" · ",
|
|
952
|
-
|
|
1015
|
+
o
|
|
953
1016
|
] }) : null
|
|
954
1017
|
] })
|
|
955
1018
|
] });
|
|
956
1019
|
}
|
|
957
|
-
function
|
|
958
|
-
const h =
|
|
959
|
-
|
|
960
|
-
},
|
|
961
|
-
return /* @__PURE__ */
|
|
962
|
-
/* @__PURE__ */ e("label", { htmlFor: h, className:
|
|
963
|
-
|
|
1020
|
+
function Fn({ label: n, value: l, onChange: a, onSend: i, onAttach: o, placeholder: t, variant: s = "chat", sendLabel: c = "Send", attachLabel: u = "Attach a file", leading: d, canSend: p }) {
|
|
1021
|
+
const h = Y(), m = p ?? l.trim() !== "", g = (v) => {
|
|
1022
|
+
v.preventDefault(), m && i();
|
|
1023
|
+
}, _ = o ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": u, onClick: o, children: /* @__PURE__ */ e(F, { name: "paperclip" }) }) : null;
|
|
1024
|
+
return /* @__PURE__ */ r("form", { className: A("cms-composer", `cms-composer--${s}`), onSubmit: g, children: [
|
|
1025
|
+
/* @__PURE__ */ e("label", { htmlFor: h, className: s === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: n }),
|
|
1026
|
+
s === "chat" ? _ : null,
|
|
964
1027
|
/* @__PURE__ */ e(
|
|
965
1028
|
"textarea",
|
|
966
1029
|
{
|
|
967
1030
|
id: h,
|
|
968
1031
|
className: "cms-composer__input",
|
|
969
|
-
rows:
|
|
970
|
-
placeholder:
|
|
1032
|
+
rows: s === "reply" ? 3 : 1,
|
|
1033
|
+
placeholder: t,
|
|
971
1034
|
value: l,
|
|
972
|
-
onChange: (
|
|
973
|
-
onKeyDown: (
|
|
974
|
-
|
|
1035
|
+
onChange: (v) => a(v.target.value),
|
|
1036
|
+
onKeyDown: (v) => {
|
|
1037
|
+
v.nativeEvent.isComposing || v.keyCode === 229 || s === "chat" && v.key === "Enter" && !v.shiftKey && (v.preventDefault(), m && i());
|
|
975
1038
|
}
|
|
976
1039
|
}
|
|
977
1040
|
),
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
1041
|
+
s === "reply" && d !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-composer__leading", children: d }) : null,
|
|
1042
|
+
s === "reply" ? _ : null,
|
|
1043
|
+
s === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": c, disabled: !m, children: /* @__PURE__ */ e(F, { name: "send" }) }) : /* @__PURE__ */ r("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !m, children: [
|
|
1044
|
+
c,
|
|
982
1045
|
" ",
|
|
983
|
-
/* @__PURE__ */ e(
|
|
1046
|
+
/* @__PURE__ */ e(F, { name: "send", size: 18 })
|
|
984
1047
|
] })
|
|
985
1048
|
] });
|
|
986
1049
|
}
|
|
987
|
-
const
|
|
1050
|
+
const Me = {
|
|
988
1051
|
incomingAudio: "Incoming audio call",
|
|
989
1052
|
incomingVideo: "Incoming video call",
|
|
990
1053
|
incomingFrom: (n, l) => `${n} from ${l}`,
|
|
@@ -1005,91 +1068,91 @@ const xe = {
|
|
|
1005
1068
|
onCallWith: (n) => `On a call with ${n}`,
|
|
1006
1069
|
returnToCall: "Return to call"
|
|
1007
1070
|
};
|
|
1008
|
-
function
|
|
1009
|
-
const
|
|
1010
|
-
return /* @__PURE__ */
|
|
1071
|
+
function Pn({ name: n, media: l, onAccept: a, onDecline: i, labels: o }) {
|
|
1072
|
+
const t = re(Me, o), s = l === "video" ? t.incomingVideo : t.incomingAudio;
|
|
1073
|
+
return /* @__PURE__ */ r("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": t.incomingFrom(s, n), children: [
|
|
1011
1074
|
/* @__PURE__ */ e("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ e(ve, { name: n, size: 112 }) }),
|
|
1012
1075
|
/* @__PURE__ */ e("p", { className: "cms-call-incoming__name", children: n }),
|
|
1013
|
-
/* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children:
|
|
1014
|
-
/* @__PURE__ */
|
|
1015
|
-
/* @__PURE__ */ e(ae, { icon: "phone-off", label:
|
|
1016
|
-
/* @__PURE__ */ e(ae, { icon: "phone", label:
|
|
1076
|
+
/* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children: s }),
|
|
1077
|
+
/* @__PURE__ */ r("div", { className: "cms-call-incoming__actions", children: [
|
|
1078
|
+
/* @__PURE__ */ e(ae, { icon: "phone-off", label: t.decline, tone: "hang-up", onClick: i }),
|
|
1079
|
+
/* @__PURE__ */ e(ae, { icon: "phone", label: t.accept, tone: "accept", onClick: a })
|
|
1017
1080
|
] })
|
|
1018
1081
|
] });
|
|
1019
1082
|
}
|
|
1020
|
-
function ae({ icon: n, label: l, onClick: a, tone:
|
|
1021
|
-
return /* @__PURE__ */
|
|
1083
|
+
function ae({ icon: n, label: l, onClick: a, tone: i = "plain", pressed: o }) {
|
|
1084
|
+
return /* @__PURE__ */ r(
|
|
1022
1085
|
"button",
|
|
1023
1086
|
{
|
|
1024
1087
|
type: "button",
|
|
1025
|
-
className:
|
|
1026
|
-
"aria-pressed":
|
|
1088
|
+
className: A("cms-call-button", `cms-call-button--${i}`, o && "is-pressed"),
|
|
1089
|
+
"aria-pressed": o,
|
|
1027
1090
|
onClick: a,
|
|
1028
1091
|
children: [
|
|
1029
|
-
/* @__PURE__ */ e("span", { className: "cms-call-button__disc", children: /* @__PURE__ */ e(
|
|
1092
|
+
/* @__PURE__ */ e("span", { className: "cms-call-button__disc", children: /* @__PURE__ */ e(F, { name: n, size: 24 }) }),
|
|
1030
1093
|
/* @__PURE__ */ e("span", { className: "cms-call-button__label", children: l })
|
|
1031
1094
|
]
|
|
1032
1095
|
}
|
|
1033
1096
|
);
|
|
1034
1097
|
}
|
|
1035
|
-
function
|
|
1036
|
-
const
|
|
1037
|
-
return /* @__PURE__ */
|
|
1038
|
-
/* @__PURE__ */
|
|
1098
|
+
function Bn({ name: n, duration: l, connection: a, you: i, muted: o, speaker: t, onToggleMute: s, onToggleSpeaker: c, onAddPerson: u, onChat: d, onHangUp: p, labels: h }) {
|
|
1099
|
+
const m = re(Me, h);
|
|
1100
|
+
return /* @__PURE__ */ r("section", { className: "cms-call-panel", "aria-label": m.callWith(n), children: [
|
|
1101
|
+
/* @__PURE__ */ r("div", { className: "cms-call-panel__head", children: [
|
|
1039
1102
|
/* @__PURE__ */ e(ve, { name: n, size: 64 }),
|
|
1040
|
-
/* @__PURE__ */
|
|
1103
|
+
/* @__PURE__ */ r("div", { className: "cms-call-panel__who", children: [
|
|
1041
1104
|
/* @__PURE__ */ e("p", { className: "cms-call-panel__name", children: n }),
|
|
1042
|
-
/* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label":
|
|
1105
|
+
/* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label": m.callTime(l), children: l })
|
|
1043
1106
|
] }),
|
|
1044
|
-
/* @__PURE__ */ e("span", { className:
|
|
1107
|
+
/* @__PURE__ */ e("span", { className: A("cms-pill", a === "good" ? "cms-pill--success" : "cms-pill--warning"), children: a === "good" ? m.goodConnection : m.poorConnection })
|
|
1045
1108
|
] }),
|
|
1046
|
-
/* @__PURE__ */
|
|
1047
|
-
/* @__PURE__ */ e(ve, { name:
|
|
1048
|
-
/* @__PURE__ */ e("span", { children:
|
|
1049
|
-
|
|
1109
|
+
/* @__PURE__ */ r("div", { className: "cms-call-panel__you", children: [
|
|
1110
|
+
/* @__PURE__ */ e(ve, { name: i.name, size: 36 }),
|
|
1111
|
+
/* @__PURE__ */ e("span", { children: m.you }),
|
|
1112
|
+
i.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label": m.speaking }) : null
|
|
1050
1113
|
] }),
|
|
1051
|
-
/* @__PURE__ */
|
|
1052
|
-
/* @__PURE__ */ e(ae, { icon: "mic", label:
|
|
1053
|
-
/* @__PURE__ */ e(ae, { icon: "speaker", label:
|
|
1054
|
-
u ? /* @__PURE__ */ e(ae, { icon: "user-plus", label:
|
|
1055
|
-
|
|
1056
|
-
/* @__PURE__ */ e(ae, { icon: "phone-off", label:
|
|
1114
|
+
/* @__PURE__ */ r("div", { className: "cms-call-panel__controls", children: [
|
|
1115
|
+
/* @__PURE__ */ e(ae, { icon: "mic", label: o ? m.unmute : m.mute, pressed: o, onClick: s }),
|
|
1116
|
+
/* @__PURE__ */ e(ae, { icon: "speaker", label: m.speaker, pressed: t, onClick: c }),
|
|
1117
|
+
u ? /* @__PURE__ */ e(ae, { icon: "user-plus", label: m.addPerson, onClick: u }) : null,
|
|
1118
|
+
d ? /* @__PURE__ */ e(ae, { icon: "chat", label: m.chat, onClick: d }) : null,
|
|
1119
|
+
/* @__PURE__ */ e(ae, { icon: "phone-off", label: m.hangUp, tone: "hang-up", onClick: p })
|
|
1057
1120
|
] })
|
|
1058
1121
|
] });
|
|
1059
1122
|
}
|
|
1060
|
-
function
|
|
1061
|
-
const
|
|
1062
|
-
return /* @__PURE__ */
|
|
1123
|
+
function zn({ name: n, duration: l, muted: a, onToggleMute: i, onReturn: o, onHangUp: t, labels: s }) {
|
|
1124
|
+
const c = re(Me, s);
|
|
1125
|
+
return /* @__PURE__ */ r("section", { className: "cms-call-bar", "aria-label": c.callWith(n), children: [
|
|
1063
1126
|
/* @__PURE__ */ e("span", { className: "cms-call-bar__live", "aria-hidden": "true" }),
|
|
1064
|
-
/* @__PURE__ */ e("span", { className: "cms-call-bar__name", children:
|
|
1127
|
+
/* @__PURE__ */ e("span", { className: "cms-call-bar__name", children: c.onCallWith(n) }),
|
|
1065
1128
|
/* @__PURE__ */ e("span", { className: "cms-call-bar__time", children: l }),
|
|
1066
|
-
/* @__PURE__ */
|
|
1067
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": a ?
|
|
1068
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick:
|
|
1069
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label":
|
|
1129
|
+
/* @__PURE__ */ r("span", { className: "cms-call-bar__actions", children: [
|
|
1130
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": a ? c.unmute : c.mute, "aria-pressed": a, onClick: i, children: /* @__PURE__ */ e(F, { name: "mic" }) }),
|
|
1131
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: o, children: c.returnToCall }),
|
|
1132
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": c.hangUp, onClick: t, children: /* @__PURE__ */ e(F, { name: "phone-off" }) })
|
|
1070
1133
|
] })
|
|
1071
1134
|
] });
|
|
1072
1135
|
}
|
|
1073
|
-
function
|
|
1074
|
-
return /* @__PURE__ */
|
|
1075
|
-
/* @__PURE__ */
|
|
1076
|
-
/* @__PURE__ */
|
|
1136
|
+
function Kn({ mark: n, product: l, headline: a, lead: i, features: o = [], children: t }) {
|
|
1137
|
+
return /* @__PURE__ */ r("div", { className: "cms-signin", children: [
|
|
1138
|
+
/* @__PURE__ */ r("aside", { className: "cms-signin__brand", children: [
|
|
1139
|
+
/* @__PURE__ */ r("p", { className: "cms-signin__logo", children: [
|
|
1077
1140
|
/* @__PURE__ */ e("span", { className: "cms-signin__mark", "aria-hidden": "true", children: n }),
|
|
1078
1141
|
l
|
|
1079
1142
|
] }),
|
|
1080
|
-
/* @__PURE__ */
|
|
1143
|
+
/* @__PURE__ */ r("div", { className: "cms-signin__pitch", children: [
|
|
1081
1144
|
/* @__PURE__ */ e("p", { className: "cms-signin__headline", children: a }),
|
|
1082
|
-
/* @__PURE__ */ e("p", { className: "cms-signin__lead", children:
|
|
1083
|
-
|
|
1084
|
-
/* @__PURE__ */ e(
|
|
1085
|
-
|
|
1086
|
-
] },
|
|
1145
|
+
/* @__PURE__ */ e("p", { className: "cms-signin__lead", children: i }),
|
|
1146
|
+
o.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: o.map((s) => /* @__PURE__ */ r("li", { children: [
|
|
1147
|
+
/* @__PURE__ */ e(F, { name: s.icon, size: 18 }),
|
|
1148
|
+
s.label
|
|
1149
|
+
] }, s.label)) }) : null
|
|
1087
1150
|
] })
|
|
1088
1151
|
] }),
|
|
1089
|
-
/* @__PURE__ */ e("main", { className: "cms-signin__form", children:
|
|
1152
|
+
/* @__PURE__ */ e("main", { className: "cms-signin__form", children: t })
|
|
1090
1153
|
] });
|
|
1091
1154
|
}
|
|
1092
|
-
const
|
|
1155
|
+
const an = {
|
|
1093
1156
|
title: "Sign in",
|
|
1094
1157
|
identifier: "Email or username",
|
|
1095
1158
|
identifierPlaceholder: "name@example.com",
|
|
@@ -1101,17 +1164,17 @@ const Qe = {
|
|
|
1101
1164
|
newHere: "New here?",
|
|
1102
1165
|
create: "Create an account"
|
|
1103
1166
|
};
|
|
1104
|
-
function
|
|
1105
|
-
const
|
|
1106
|
-
return /* @__PURE__ */
|
|
1107
|
-
w.preventDefault(), l(
|
|
1108
|
-
}, "aria-describedby":
|
|
1109
|
-
/* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children:
|
|
1110
|
-
/* @__PURE__ */
|
|
1111
|
-
/* @__PURE__ */ e(
|
|
1167
|
+
function Hn({ server: n, onSubmit: l, forgotHref: a, createHref: i, error: o, busy: t, labels: s }) {
|
|
1168
|
+
const c = re(an, s), u = Y(), [d, p] = D(""), [h, m] = D(""), [g, _] = D(!1);
|
|
1169
|
+
return /* @__PURE__ */ r("form", { className: "cms-signin-form", onSubmit: (w) => {
|
|
1170
|
+
w.preventDefault(), l(d, h);
|
|
1171
|
+
}, "aria-describedby": o ? `${u}-error` : void 0, children: [
|
|
1172
|
+
/* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children: c.title }),
|
|
1173
|
+
/* @__PURE__ */ r("p", { className: "cms-signin-form__server", children: [
|
|
1174
|
+
/* @__PURE__ */ e(F, { name: "server", size: 18 }),
|
|
1112
1175
|
n
|
|
1113
1176
|
] }),
|
|
1114
|
-
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${u}-identifier`, children:
|
|
1177
|
+
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${u}-identifier`, children: c.identifier }),
|
|
1115
1178
|
/* @__PURE__ */ e(
|
|
1116
1179
|
"input",
|
|
1117
1180
|
{
|
|
@@ -1119,14 +1182,14 @@ function Pn({ server: n, onSubmit: l, forgotHref: a, createHref: t, error: r, bu
|
|
|
1119
1182
|
className: "cms-signin-form__input",
|
|
1120
1183
|
type: "text",
|
|
1121
1184
|
autoComplete: "username",
|
|
1122
|
-
placeholder:
|
|
1123
|
-
value:
|
|
1124
|
-
onChange: (w) =>
|
|
1185
|
+
placeholder: c.identifierPlaceholder,
|
|
1186
|
+
value: d,
|
|
1187
|
+
onChange: (w) => p(w.target.value),
|
|
1125
1188
|
required: !0
|
|
1126
1189
|
}
|
|
1127
1190
|
),
|
|
1128
|
-
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${u}-password`, children:
|
|
1129
|
-
/* @__PURE__ */
|
|
1191
|
+
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${u}-password`, children: c.password }),
|
|
1192
|
+
/* @__PURE__ */ r("span", { className: "cms-signin-form__password", children: [
|
|
1130
1193
|
/* @__PURE__ */ e(
|
|
1131
1194
|
"input",
|
|
1132
1195
|
{
|
|
@@ -1135,131 +1198,131 @@ function Pn({ server: n, onSubmit: l, forgotHref: a, createHref: t, error: r, bu
|
|
|
1135
1198
|
type: g ? "text" : "password",
|
|
1136
1199
|
autoComplete: "current-password",
|
|
1137
1200
|
value: h,
|
|
1138
|
-
onChange: (w) =>
|
|
1201
|
+
onChange: (w) => m(w.target.value),
|
|
1139
1202
|
required: !0
|
|
1140
1203
|
}
|
|
1141
1204
|
),
|
|
1142
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": g, onClick: () =>
|
|
1205
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": g, onClick: () => _((w) => !w), children: g ? c.hide : c.show })
|
|
1143
1206
|
] }),
|
|
1144
|
-
a ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: a, children:
|
|
1145
|
-
|
|
1146
|
-
/* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled:
|
|
1147
|
-
|
|
1148
|
-
/* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children:
|
|
1149
|
-
/* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href:
|
|
1207
|
+
a ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: a, children: c.forgot }) : null,
|
|
1208
|
+
o ? /* @__PURE__ */ e("p", { id: `${u}-error`, className: "cms-signin-form__error", role: "alert", children: o }) : null,
|
|
1209
|
+
/* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: t, "aria-busy": t || void 0, children: c.submit }),
|
|
1210
|
+
i ? /* @__PURE__ */ r(M, { children: [
|
|
1211
|
+
/* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children: c.newHere }) }),
|
|
1212
|
+
/* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: i, children: c.create })
|
|
1150
1213
|
] }) : null
|
|
1151
1214
|
] });
|
|
1152
1215
|
}
|
|
1153
|
-
function
|
|
1154
|
-
const
|
|
1155
|
-
if (a != null) return /* @__PURE__ */ e(
|
|
1156
|
-
if (l === null) return /* @__PURE__ */ e(
|
|
1157
|
-
if (l.length === 0) return /* @__PURE__ */ e(
|
|
1158
|
-
const h = (
|
|
1159
|
-
var
|
|
1160
|
-
if (
|
|
1161
|
-
|
|
1162
|
-
else if (
|
|
1163
|
-
u == null || u(
|
|
1164
|
-
else if ((
|
|
1165
|
-
|
|
1166
|
-
const w =
|
|
1167
|
-
|
|
1216
|
+
function Un({ label: n, rows: l, error: a, onRetry: i, loadingText: o = "Loading", emptyTitle: t = "Nothing here yet", emptyHint: s, selected: c, onOpen: u, onRowMenu: d }) {
|
|
1217
|
+
const p = Z([]);
|
|
1218
|
+
if (a != null) return /* @__PURE__ */ e(Re, { message: a, onRetry: i });
|
|
1219
|
+
if (l === null) return /* @__PURE__ */ e(He, { what: o, layout: "block" });
|
|
1220
|
+
if (l.length === 0) return /* @__PURE__ */ e(Ue, { title: t, hint: s });
|
|
1221
|
+
const h = (m, g, _) => {
|
|
1222
|
+
var v;
|
|
1223
|
+
if (m.key === "ArrowDown" || m.key === "ArrowUp")
|
|
1224
|
+
m.preventDefault(), (v = p.current[Math.min(l.length - 1, Math.max(0, g + (m.key === "ArrowDown" ? 1 : -1)))]) == null || v.focus();
|
|
1225
|
+
else if (m.key === "Enter")
|
|
1226
|
+
u == null || u(_);
|
|
1227
|
+
else if ((m.key === "ContextMenu" || m.shiftKey && m.key === "F10") && d) {
|
|
1228
|
+
m.preventDefault();
|
|
1229
|
+
const w = m.currentTarget.getBoundingClientRect();
|
|
1230
|
+
d(_, { x: w.left + 16, y: w.bottom });
|
|
1168
1231
|
}
|
|
1169
1232
|
};
|
|
1170
|
-
return /* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: l.map((
|
|
1171
|
-
const
|
|
1172
|
-
return /* @__PURE__ */
|
|
1233
|
+
return /* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: l.map((m, g) => {
|
|
1234
|
+
const _ = m.id === c;
|
|
1235
|
+
return /* @__PURE__ */ r(
|
|
1173
1236
|
"li",
|
|
1174
1237
|
{
|
|
1175
|
-
ref: (
|
|
1176
|
-
|
|
1238
|
+
ref: (v) => {
|
|
1239
|
+
p.current[g] = v;
|
|
1177
1240
|
},
|
|
1178
1241
|
role: "option",
|
|
1179
|
-
"aria-selected":
|
|
1180
|
-
tabIndex:
|
|
1181
|
-
className:
|
|
1182
|
-
onClick: () => u == null ? void 0 : u(
|
|
1183
|
-
onKeyDown: (
|
|
1184
|
-
onContextMenu:
|
|
1185
|
-
|
|
1242
|
+
"aria-selected": _,
|
|
1243
|
+
tabIndex: _ || c == null && g === 0 ? 0 : -1,
|
|
1244
|
+
className: A("cms-list__row", _ && "is-selected"),
|
|
1245
|
+
onClick: () => u == null ? void 0 : u(m.id),
|
|
1246
|
+
onKeyDown: (v) => h(v, g, m.id),
|
|
1247
|
+
onContextMenu: d ? (v) => {
|
|
1248
|
+
v.preventDefault(), d(m.id, { x: v.clientX, y: v.clientY });
|
|
1186
1249
|
} : void 0,
|
|
1187
1250
|
children: [
|
|
1188
|
-
|
|
1189
|
-
/* @__PURE__ */
|
|
1190
|
-
/* @__PURE__ */ e("span", { className: "cms-list__primary", children:
|
|
1191
|
-
|
|
1251
|
+
m.lead != null ? /* @__PURE__ */ e("span", { className: "cms-list__lead", children: m.lead }) : null,
|
|
1252
|
+
/* @__PURE__ */ r("span", { className: "cms-list__text", children: [
|
|
1253
|
+
/* @__PURE__ */ e("span", { className: "cms-list__primary", children: m.primary }),
|
|
1254
|
+
m.secondary != null ? /* @__PURE__ */ e("span", { className: "cms-list__secondary", children: m.secondary }) : null
|
|
1192
1255
|
] }),
|
|
1193
|
-
|
|
1256
|
+
m.meta != null ? /* @__PURE__ */ e("span", { className: "cms-list__meta", children: m.meta }) : null
|
|
1194
1257
|
]
|
|
1195
1258
|
},
|
|
1196
|
-
|
|
1259
|
+
m.id
|
|
1197
1260
|
);
|
|
1198
1261
|
}) });
|
|
1199
1262
|
}
|
|
1200
|
-
function
|
|
1201
|
-
const
|
|
1202
|
-
if (
|
|
1263
|
+
function tn({ at: n, items: l, onClose: a, label: i = "Actions", focus: o = "first" }) {
|
|
1264
|
+
const t = Z(null), s = Z(null), [c, u] = D(n), d = l.filter((h) => h.offer.offered);
|
|
1265
|
+
if (Ee(() => {
|
|
1203
1266
|
if (!n) return;
|
|
1204
|
-
const h =
|
|
1205
|
-
u({ x: Math.max(0, Math.min(n.x, window.innerWidth -
|
|
1267
|
+
const h = t.current, m = (h == null ? void 0 : h.offsetWidth) ?? 0, g = (h == null ? void 0 : h.offsetHeight) ?? 0;
|
|
1268
|
+
u({ x: Math.max(0, Math.min(n.x, window.innerWidth - m)), y: Math.max(0, Math.min(n.y, window.innerHeight - g)) });
|
|
1206
1269
|
}, [n]), G(() => {
|
|
1207
|
-
var g,
|
|
1270
|
+
var g, _;
|
|
1208
1271
|
if (!n) return;
|
|
1209
|
-
|
|
1210
|
-
const h = Array.from(((g =
|
|
1211
|
-
(
|
|
1212
|
-
const
|
|
1272
|
+
s.current = document.activeElement;
|
|
1273
|
+
const h = Array.from(((g = t.current) == null ? void 0 : g.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) ?? []);
|
|
1274
|
+
(_ = o === "last" ? h[h.length - 1] : h[0]) == null || _.focus();
|
|
1275
|
+
const m = (v) => {
|
|
1213
1276
|
var w;
|
|
1214
|
-
(w =
|
|
1277
|
+
(w = t.current) != null && w.contains(v.target) || a();
|
|
1215
1278
|
};
|
|
1216
|
-
return document.addEventListener("mousedown",
|
|
1217
|
-
var
|
|
1218
|
-
document.removeEventListener("mousedown",
|
|
1279
|
+
return document.addEventListener("mousedown", m), () => {
|
|
1280
|
+
var v, w;
|
|
1281
|
+
document.removeEventListener("mousedown", m), (w = (v = s.current) == null ? void 0 : v.focus) == null || w.call(v);
|
|
1219
1282
|
};
|
|
1220
|
-
}, [n, a,
|
|
1221
|
-
const
|
|
1222
|
-
var
|
|
1223
|
-
const
|
|
1283
|
+
}, [n, a, o]), !n || d.length === 0) return null;
|
|
1284
|
+
const p = (h) => {
|
|
1285
|
+
var _, v;
|
|
1286
|
+
const m = Array.from(((_ = t.current) == null ? void 0 : _.querySelectorAll('[role="menuitem"]')) ?? []), g = m.indexOf(document.activeElement);
|
|
1224
1287
|
if (h.key === "Escape" || h.key === "Tab")
|
|
1225
1288
|
h.preventDefault(), a();
|
|
1226
1289
|
else if (h.key === "ArrowDown" || h.key === "ArrowUp") {
|
|
1227
1290
|
h.preventDefault();
|
|
1228
1291
|
const w = h.key === "ArrowDown" ? 1 : -1;
|
|
1229
|
-
(
|
|
1292
|
+
(v = m[(g + w + m.length) % m.length]) == null || v.focus();
|
|
1230
1293
|
}
|
|
1231
1294
|
};
|
|
1232
1295
|
return ke(
|
|
1233
1296
|
/* @__PURE__ */ e(
|
|
1234
1297
|
"div",
|
|
1235
1298
|
{
|
|
1236
|
-
ref:
|
|
1299
|
+
ref: t,
|
|
1237
1300
|
className: "cms-menu",
|
|
1238
1301
|
role: "menu",
|
|
1239
|
-
"aria-label":
|
|
1240
|
-
style: { left: (
|
|
1241
|
-
onKeyDown:
|
|
1302
|
+
"aria-label": i,
|
|
1303
|
+
style: { left: (c ?? n).x, top: (c ?? n).y },
|
|
1304
|
+
onKeyDown: p,
|
|
1242
1305
|
onContextMenu: (h) => h.preventDefault(),
|
|
1243
|
-
children:
|
|
1244
|
-
const
|
|
1245
|
-
return /* @__PURE__ */
|
|
1306
|
+
children: d.map((h) => {
|
|
1307
|
+
const m = h.offer.refusal !== void 0;
|
|
1308
|
+
return /* @__PURE__ */ r(
|
|
1246
1309
|
"div",
|
|
1247
1310
|
{
|
|
1248
1311
|
role: "menuitem",
|
|
1249
1312
|
tabIndex: -1,
|
|
1250
|
-
"aria-disabled":
|
|
1251
|
-
title:
|
|
1252
|
-
className:
|
|
1313
|
+
"aria-disabled": m || void 0,
|
|
1314
|
+
title: m ? h.offer.refusal : void 0,
|
|
1315
|
+
className: A("cms-menu__item", h.danger && "is-danger", h.offer.locked && "is-locked", m && "is-refused"),
|
|
1253
1316
|
onClick: () => {
|
|
1254
|
-
|
|
1317
|
+
m || (a(), h.onSelect());
|
|
1255
1318
|
},
|
|
1256
1319
|
onKeyDown: (g) => {
|
|
1257
|
-
(g.key === "Enter" || g.key === " ") && !
|
|
1320
|
+
(g.key === "Enter" || g.key === " ") && !m && (g.preventDefault(), a(), h.onSelect());
|
|
1258
1321
|
},
|
|
1259
1322
|
children: [
|
|
1260
|
-
h.offer.locked ? /* @__PURE__ */ e(
|
|
1323
|
+
h.offer.locked ? /* @__PURE__ */ e(K, { name: "lock" }) : null,
|
|
1261
1324
|
/* @__PURE__ */ e("span", { className: "cms-menu__label", children: h.label }),
|
|
1262
|
-
|
|
1325
|
+
m ? /* @__PURE__ */ e("span", { className: "cms-menu__refusal", children: h.offer.refusal }) : null
|
|
1263
1326
|
]
|
|
1264
1327
|
},
|
|
1265
1328
|
h.id
|
|
@@ -1270,212 +1333,212 @@ function en({ at: n, items: l, onClose: a, label: t = "Actions", focus: r = "fir
|
|
|
1270
1333
|
document.body
|
|
1271
1334
|
);
|
|
1272
1335
|
}
|
|
1273
|
-
const
|
|
1274
|
-
function
|
|
1336
|
+
const Ae = { bare: /* @__PURE__ */ new Set(), hidden: /* @__PURE__ */ new Set() }, De = (n, l) => n.size === l.size && [...n].every((a) => l.has(a));
|
|
1337
|
+
function sn(n) {
|
|
1275
1338
|
const l = /* @__PURE__ */ new Map();
|
|
1276
1339
|
for (const a of n) l.set(a.group, [...l.get(a.group) ?? [], a]);
|
|
1277
1340
|
return [...l.values()];
|
|
1278
1341
|
}
|
|
1279
|
-
function
|
|
1342
|
+
function rn(n) {
|
|
1280
1343
|
const l = /* @__PURE__ */ new Map();
|
|
1281
1344
|
for (const a of n) a.overflow !== void 0 && a.overflow !== 0 && l.set(a.overflow, [...l.get(a.overflow) ?? [], a.id]);
|
|
1282
|
-
return [...l.entries()].sort(([a], [
|
|
1283
|
-
}
|
|
1284
|
-
function
|
|
1285
|
-
const
|
|
1286
|
-
const
|
|
1287
|
-
if (
|
|
1288
|
-
const O = getComputedStyle(
|
|
1289
|
-
var
|
|
1290
|
-
return ((
|
|
1291
|
-
}, oe = q('[data-measure="leading"]'), de = q('[data-measure="separator"]'), me = q('[data-measure="more"]'), ue = (
|
|
1292
|
-
const
|
|
1293
|
-
return oe + he.reduce((le,
|
|
1294
|
-
}, y =
|
|
1345
|
+
return [...l.entries()].sort(([a], [i]) => a - i).map(([, a]) => a);
|
|
1346
|
+
}
|
|
1347
|
+
function Rn({ label: n, actions: l, onAction: a, status: i, moreLabel: o, leading: t }) {
|
|
1348
|
+
const s = Z(null), c = Z(null), [u, d] = D(Ae), [p, h] = D(null), [m, g] = D("first"), [_, v] = D(null), [w, P] = D(null), k = sn(l), C = rn(l), x = k.flat(), R = x.filter((b) => b.overflow === 0), z = x.filter((b) => b.overflow !== 0), ne = JSON.stringify([l.map((b) => [b.id, b.label, b.icon, b.group, b.overflow ?? null]), i ?? "", t !== void 0]), N = be(() => {
|
|
1349
|
+
const b = s.current, S = c.current;
|
|
1350
|
+
if (b === null || S === null) return;
|
|
1351
|
+
const O = getComputedStyle(b), j = parseFloat(O.columnGap || "0") || 0, L = b.clientWidth - (parseFloat(O.paddingLeft) || 0) - (parseFloat(O.paddingRight) || 0), q = ($) => {
|
|
1352
|
+
var U;
|
|
1353
|
+
return ((U = S.querySelector($)) == null ? void 0 : U.getBoundingClientRect().width) ?? 0;
|
|
1354
|
+
}, oe = q('[data-measure="leading"]'), de = q('[data-measure="separator"]'), me = q('[data-measure="more"]'), ue = ($, U) => q(`[data-measure="${U ? "full" : "icon"}"][data-measure-action="${CSS.escape($)}"]`), f = ($, U) => {
|
|
1355
|
+
const J = /* @__PURE__ */ new Set([...R.map((le) => le.id), ...U]), te = k.map((le) => le.filter((fe) => !J.has(fe.id))).filter((le) => le.length > 0), he = te.flat(), $e = he.length + (te.length - 1) + (J.size > 0 ? 1 : 0) + (oe > 0 ? 1 : 0);
|
|
1356
|
+
return oe + he.reduce((le, fe) => le + ue(fe.id, !$.has(fe.id)), 0) + de * Math.max(0, te.length - 1) + (J.size > 0 ? me : 0) + j * Math.max(0, $e - 1);
|
|
1357
|
+
}, y = z.filter(($) => !C.some((U) => U.includes($.id))).map(($) => $.id), I = [...C, ...[...y].reverse().map(($) => [$])];
|
|
1295
1358
|
let B = null;
|
|
1296
|
-
if (
|
|
1359
|
+
if (f(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= L) B = Ae;
|
|
1297
1360
|
else {
|
|
1298
|
-
const
|
|
1299
|
-
for (const
|
|
1300
|
-
for (const
|
|
1301
|
-
if (
|
|
1302
|
-
B = { bare:
|
|
1361
|
+
const $ = /* @__PURE__ */ new Set();
|
|
1362
|
+
for (const U of I) {
|
|
1363
|
+
for (const J of U) $.add(J);
|
|
1364
|
+
if (f($, /* @__PURE__ */ new Set()) <= L) {
|
|
1365
|
+
B = { bare: $, hidden: /* @__PURE__ */ new Set() };
|
|
1303
1366
|
break;
|
|
1304
1367
|
}
|
|
1305
1368
|
}
|
|
1306
1369
|
}
|
|
1307
1370
|
if (B === null) {
|
|
1308
|
-
const
|
|
1309
|
-
for (const
|
|
1310
|
-
for (const
|
|
1311
|
-
if (
|
|
1371
|
+
const $ = new Set(z.map((J) => J.id)), U = /* @__PURE__ */ new Set();
|
|
1372
|
+
for (const J of C) {
|
|
1373
|
+
for (const te of J) z.some((he) => he.id === te) && U.add(te);
|
|
1374
|
+
if (U.size >= 2 && f($, U) <= L) break;
|
|
1312
1375
|
}
|
|
1313
|
-
B = { bare:
|
|
1376
|
+
B = { bare: $, hidden: U.size >= 2 ? U : /* @__PURE__ */ new Set() };
|
|
1314
1377
|
}
|
|
1315
1378
|
const ge = B;
|
|
1316
|
-
|
|
1379
|
+
d(($) => De($.bare, ge.bare) && De($.hidden, ge.hidden) ? $ : ge);
|
|
1317
1380
|
}, [ne]);
|
|
1318
|
-
|
|
1319
|
-
const
|
|
1320
|
-
if (
|
|
1321
|
-
const
|
|
1322
|
-
return
|
|
1323
|
-
}, [
|
|
1324
|
-
const E = /* @__PURE__ */ new Set([...
|
|
1325
|
-
...
|
|
1326
|
-
...
|
|
1327
|
-
], X = new Set(
|
|
1328
|
-
var
|
|
1329
|
-
const
|
|
1381
|
+
Ee(N, [N]), G(() => {
|
|
1382
|
+
const b = s.current;
|
|
1383
|
+
if (b === null || typeof ResizeObserver > "u") return;
|
|
1384
|
+
const S = new ResizeObserver(() => N());
|
|
1385
|
+
return S.observe(b), () => S.disconnect();
|
|
1386
|
+
}, [N]);
|
|
1387
|
+
const E = /* @__PURE__ */ new Set([...R.map((b) => b.id), ...u.hidden]), V = k.map((b) => b.filter((S) => !E.has(S.id))).filter((b) => b.length > 0).flat(), T = [
|
|
1388
|
+
...R,
|
|
1389
|
+
...C.flat().map((b) => x.find((S) => S.id === b)).filter((b) => b !== void 0 && u.hidden.has(b.id))
|
|
1390
|
+
], X = new Set(z.filter((b) => !C.some((S) => S.includes(b.id))).map((b) => b.id)), H = [...V.map((b) => b.id), ...T.length > 0 ? ["more"] : []], Q = _ !== null && H.includes(_) ? _ : H[0] ?? null, ie = (b) => {
|
|
1391
|
+
var L, q;
|
|
1392
|
+
const S = H.indexOf(Q ?? "");
|
|
1330
1393
|
let O = null;
|
|
1331
|
-
if (
|
|
1332
|
-
|
|
1333
|
-
const j =
|
|
1334
|
-
|
|
1335
|
-
},
|
|
1336
|
-
id:
|
|
1337
|
-
label: /* @__PURE__ */
|
|
1338
|
-
/* @__PURE__ */ e(
|
|
1339
|
-
|
|
1394
|
+
if (b.key === "ArrowRight" ? O = Math.min(H.length - 1, S + 1) : b.key === "ArrowLeft" ? O = Math.max(0, S - 1) : b.key === "Home" ? O = 0 : b.key === "End" ? O = H.length - 1 : b.key === "Escape" && P(Q), O === null) return;
|
|
1395
|
+
b.preventDefault();
|
|
1396
|
+
const j = H[O] ?? null;
|
|
1397
|
+
v(j), (q = (L = s.current) == null ? void 0 : L.querySelector(`[data-stop="${CSS.escape(j ?? "")}"]`)) == null || q.focus();
|
|
1398
|
+
}, ce = T.map((b) => ({
|
|
1399
|
+
id: b.id,
|
|
1400
|
+
label: /* @__PURE__ */ r(M, { children: [
|
|
1401
|
+
/* @__PURE__ */ e(pe, { name: b.icon }),
|
|
1402
|
+
b.label
|
|
1340
1403
|
] }),
|
|
1341
|
-
offer:
|
|
1342
|
-
...
|
|
1404
|
+
offer: b.disabled ? { offered: !0, locked: !1, refusal: b.reason ?? "" } : { offered: !0, locked: !1 },
|
|
1405
|
+
...b.danger ? { danger: !0 } : {},
|
|
1343
1406
|
onSelect: () => {
|
|
1344
|
-
!
|
|
1407
|
+
!b.disabled && !b.busy && a(b.id);
|
|
1345
1408
|
}
|
|
1346
1409
|
}));
|
|
1347
|
-
return /* @__PURE__ */
|
|
1410
|
+
return /* @__PURE__ */ r(
|
|
1348
1411
|
"div",
|
|
1349
1412
|
{
|
|
1350
|
-
ref:
|
|
1413
|
+
ref: s,
|
|
1351
1414
|
role: "toolbar",
|
|
1352
1415
|
"aria-label": n,
|
|
1353
|
-
className:
|
|
1416
|
+
className: A(
|
|
1354
1417
|
"cms-pane-toolbar",
|
|
1355
|
-
|
|
1356
|
-
u.bare.size > 0 && u.bare.size <
|
|
1418
|
+
z.length > 0 && u.bare.size >= z.length && "cms-pane-toolbar--labels-hidden",
|
|
1419
|
+
u.bare.size > 0 && u.bare.size < z.length && "cms-pane-toolbar--labels-partly-hidden"
|
|
1357
1420
|
),
|
|
1358
|
-
onKeyDown:
|
|
1421
|
+
onKeyDown: ie,
|
|
1359
1422
|
children: [
|
|
1360
|
-
|
|
1361
|
-
k.map((
|
|
1362
|
-
const O =
|
|
1363
|
-
return /* @__PURE__ */
|
|
1423
|
+
t !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__leading", children: t }) : null,
|
|
1424
|
+
k.map((b, S) => {
|
|
1425
|
+
const O = b.filter((L) => !E.has(L.id)), j = k.slice(0, S).some((L) => L.some((q) => !E.has(q.id)));
|
|
1426
|
+
return /* @__PURE__ */ r("div", { className: "cms-pane-toolbar__group-wrap", children: [
|
|
1364
1427
|
O.length > 0 && j ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__separator", role: "separator", "aria-orientation": "vertical" }) : null,
|
|
1365
|
-
/* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden: O.length === 0, children:
|
|
1366
|
-
|
|
1428
|
+
/* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden: O.length === 0, children: b.map((L) => /* @__PURE__ */ e(
|
|
1429
|
+
cn,
|
|
1367
1430
|
{
|
|
1368
|
-
action:
|
|
1369
|
-
labels: !u.bare.has(
|
|
1370
|
-
overflowed: E.has(
|
|
1371
|
-
pinned: X.has(
|
|
1372
|
-
tabbable: Q ===
|
|
1373
|
-
tipOff: w ===
|
|
1374
|
-
onChoose: () => a(
|
|
1431
|
+
action: L,
|
|
1432
|
+
labels: !u.bare.has(L.id),
|
|
1433
|
+
overflowed: E.has(L.id),
|
|
1434
|
+
pinned: X.has(L.id),
|
|
1435
|
+
tabbable: Q === L.id,
|
|
1436
|
+
tipOff: w === L.id,
|
|
1437
|
+
onChoose: () => a(L.id),
|
|
1375
1438
|
onFocus: () => {
|
|
1376
|
-
|
|
1439
|
+
v(L.id), P(null);
|
|
1377
1440
|
}
|
|
1378
1441
|
},
|
|
1379
|
-
|
|
1442
|
+
L.id
|
|
1380
1443
|
)) })
|
|
1381
|
-
] },
|
|
1444
|
+
] }, S);
|
|
1382
1445
|
}),
|
|
1383
|
-
|
|
1446
|
+
T.length > 0 ? /* @__PURE__ */ e(
|
|
1384
1447
|
"button",
|
|
1385
1448
|
{
|
|
1386
1449
|
type: "button",
|
|
1387
1450
|
className: "cms-icon-button cms-pane-toolbar__more",
|
|
1388
1451
|
"data-stop": "more",
|
|
1389
|
-
"aria-label":
|
|
1390
|
-
title:
|
|
1452
|
+
"aria-label": o,
|
|
1453
|
+
title: o,
|
|
1391
1454
|
"aria-haspopup": "menu",
|
|
1392
|
-
"aria-expanded":
|
|
1455
|
+
"aria-expanded": p !== null,
|
|
1393
1456
|
tabIndex: Q === "more" ? 0 : -1,
|
|
1394
|
-
onFocus: () =>
|
|
1395
|
-
onClick: (
|
|
1396
|
-
const
|
|
1397
|
-
g("first"), h(
|
|
1457
|
+
onFocus: () => v("more"),
|
|
1458
|
+
onClick: (b) => {
|
|
1459
|
+
const S = b.currentTarget.getBoundingClientRect();
|
|
1460
|
+
g("first"), h(p === null ? { x: S.left, y: S.bottom } : null);
|
|
1398
1461
|
},
|
|
1399
|
-
onKeyDown: (
|
|
1400
|
-
if (
|
|
1401
|
-
|
|
1402
|
-
const
|
|
1403
|
-
g(
|
|
1462
|
+
onKeyDown: (b) => {
|
|
1463
|
+
if (b.key === "ArrowDown" || b.key === "ArrowUp") {
|
|
1464
|
+
b.preventDefault(), b.stopPropagation();
|
|
1465
|
+
const S = b.currentTarget.getBoundingClientRect();
|
|
1466
|
+
g(b.key === "ArrowUp" ? "last" : "first"), h({ x: S.left, y: S.bottom });
|
|
1404
1467
|
}
|
|
1405
1468
|
},
|
|
1406
|
-
children: /* @__PURE__ */ e(
|
|
1469
|
+
children: /* @__PURE__ */ e(F, { name: "more" })
|
|
1407
1470
|
}
|
|
1408
1471
|
) : null,
|
|
1409
|
-
|
|
1410
|
-
/* @__PURE__ */ e(
|
|
1411
|
-
/* @__PURE__ */
|
|
1412
|
-
|
|
1472
|
+
i !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__status", title: i, children: i }) : null,
|
|
1473
|
+
/* @__PURE__ */ e(tn, { at: p, items: ce, onClose: () => h(null), label: o, focus: m }),
|
|
1474
|
+
/* @__PURE__ */ r("div", { ref: c, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
|
|
1475
|
+
t !== void 0 ? /* @__PURE__ */ e("div", { "data-measure": "leading", children: t }) : null,
|
|
1413
1476
|
/* @__PURE__ */ e("span", { "data-measure": "separator", className: "cms-pane-toolbar__separator" }),
|
|
1414
|
-
/* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ e(
|
|
1415
|
-
|
|
1416
|
-
/* @__PURE__ */
|
|
1417
|
-
/* @__PURE__ */ e(
|
|
1418
|
-
/* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children:
|
|
1477
|
+
/* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ e(F, { name: "more" }) }),
|
|
1478
|
+
x.map((b) => /* @__PURE__ */ r("span", { children: [
|
|
1479
|
+
/* @__PURE__ */ r("span", { "data-measure": "full", "data-measure-action": b.id, className: "cms-pane-toolbar__action", children: [
|
|
1480
|
+
/* @__PURE__ */ e(pe, { name: b.icon }),
|
|
1481
|
+
/* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: b.label })
|
|
1419
1482
|
] }),
|
|
1420
|
-
/* @__PURE__ */ e("span", { "data-measure": "icon", "data-measure-action":
|
|
1421
|
-
] },
|
|
1483
|
+
/* @__PURE__ */ e("span", { "data-measure": "icon", "data-measure-action": b.id, className: A("cms-pane-toolbar__action", _e(b.icon) !== null && "cms-pane-toolbar__action--bare"), children: _e(b.icon) !== null ? /* @__PURE__ */ e(pe, { name: b.icon }) : /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: b.label }) })
|
|
1484
|
+
] }, b.id))
|
|
1422
1485
|
] })
|
|
1423
1486
|
]
|
|
1424
1487
|
}
|
|
1425
1488
|
);
|
|
1426
1489
|
}
|
|
1427
|
-
function
|
|
1428
|
-
const [u,
|
|
1490
|
+
function cn({ action: n, labels: l, overflowed: a, pinned: i, tabbable: o, tipOff: t, onChoose: s, onFocus: c }) {
|
|
1491
|
+
const [u, d] = D(!1);
|
|
1429
1492
|
G(() => {
|
|
1430
1493
|
if (!n.busy) {
|
|
1431
|
-
|
|
1494
|
+
d(!1);
|
|
1432
1495
|
return;
|
|
1433
1496
|
}
|
|
1434
|
-
const
|
|
1435
|
-
return () => clearTimeout(
|
|
1497
|
+
const P = setTimeout(() => d(!0), ye);
|
|
1498
|
+
return () => clearTimeout(P);
|
|
1436
1499
|
}, [n.busy]);
|
|
1437
|
-
const
|
|
1438
|
-
return /* @__PURE__ */
|
|
1500
|
+
const p = _e(n.icon) === null, h = l || p, m = n.disabled && n.reason ? n.reason : null, g = m ?? (h ? null : n.label), _ = Y(), [v, w] = D(!1);
|
|
1501
|
+
return /* @__PURE__ */ r(
|
|
1439
1502
|
"button",
|
|
1440
1503
|
{
|
|
1441
1504
|
type: "button",
|
|
1442
|
-
className:
|
|
1505
|
+
className: A("cms-pane-toolbar__action", !h && "cms-pane-toolbar__action--bare", p && "cms-pane-toolbar__action--text", n.danger && "is-danger"),
|
|
1443
1506
|
"data-action": n.id,
|
|
1444
1507
|
"data-stop": n.id,
|
|
1445
1508
|
...a ? { "data-overflowed": "" } : {},
|
|
1446
|
-
...
|
|
1509
|
+
...i ? { "data-pinned": "" } : {},
|
|
1447
1510
|
hidden: a,
|
|
1448
1511
|
"aria-label": n.label,
|
|
1449
1512
|
"aria-disabled": n.disabled || void 0,
|
|
1450
1513
|
"aria-busy": n.busy || void 0,
|
|
1451
|
-
...
|
|
1452
|
-
...
|
|
1453
|
-
tabIndex:
|
|
1454
|
-
onFocus:
|
|
1514
|
+
...m === null ? {} : { "aria-describedby": _ },
|
|
1515
|
+
...v && m !== null ? { "data-reason-shown": "" } : {},
|
|
1516
|
+
tabIndex: o ? 0 : -1,
|
|
1517
|
+
onFocus: c,
|
|
1455
1518
|
onBlur: () => w(!1),
|
|
1456
|
-
onKeyDown: (
|
|
1457
|
-
|
|
1519
|
+
onKeyDown: (P) => {
|
|
1520
|
+
P.key === "Escape" && w(!1);
|
|
1458
1521
|
},
|
|
1459
1522
|
onClick: () => {
|
|
1460
|
-
|
|
1523
|
+
m !== null ? w(!0) : !n.disabled && !n.busy && s();
|
|
1461
1524
|
},
|
|
1462
1525
|
children: [
|
|
1463
|
-
u ? /* @__PURE__ */ e(
|
|
1526
|
+
u ? /* @__PURE__ */ e(K, { name: "spinner" }) : /* @__PURE__ */ e(pe, { name: n.icon }),
|
|
1464
1527
|
h ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", "aria-hidden": "true", children: n.label }) : null,
|
|
1465
|
-
|
|
1528
|
+
m !== null || g !== null && !t ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__tip", role: "tooltip", id: _, children: g }) : null
|
|
1466
1529
|
]
|
|
1467
1530
|
}
|
|
1468
1531
|
);
|
|
1469
1532
|
}
|
|
1470
|
-
function
|
|
1471
|
-
const l =
|
|
1472
|
-
return l === null ? null : /* @__PURE__ */ e(
|
|
1533
|
+
function pe({ name: n }) {
|
|
1534
|
+
const l = _e(n);
|
|
1535
|
+
return l === null ? null : /* @__PURE__ */ e(F, { name: l, size: 18 });
|
|
1473
1536
|
}
|
|
1474
|
-
function
|
|
1537
|
+
function on(n) {
|
|
1475
1538
|
return n === "allowed" || n === "elevate" || n === "denied";
|
|
1476
1539
|
}
|
|
1477
|
-
function
|
|
1478
|
-
if (!
|
|
1540
|
+
function On(n, l) {
|
|
1541
|
+
if (!on(n))
|
|
1479
1542
|
return l.showRefused ? { offered: !0, locked: !1, refusal: "not available: the server gave an answer this app does not know", unknown: !0 } : { offered: !1, locked: !1, unknown: !0 };
|
|
1480
1543
|
switch (n) {
|
|
1481
1544
|
case "allowed":
|
|
@@ -1486,119 +1549,121 @@ function zn(n, l) {
|
|
|
1486
1549
|
return l.showRefused ? { offered: !0, locked: !1, refusal: l.refusal ?? "not allowed" } : { offered: !1, locked: !1 };
|
|
1487
1550
|
}
|
|
1488
1551
|
}
|
|
1489
|
-
function
|
|
1552
|
+
function dn(n, l) {
|
|
1490
1553
|
if (!n) return;
|
|
1491
1554
|
if (typeof n.get == "function") return n.get(l) ?? void 0;
|
|
1492
|
-
const a = n,
|
|
1493
|
-
return
|
|
1555
|
+
const a = n, i = Object.keys(a).find((o) => o.toLowerCase() === l.toLowerCase());
|
|
1556
|
+
return i === void 0 ? void 0 : a[i];
|
|
1494
1557
|
}
|
|
1495
|
-
function
|
|
1558
|
+
function mn(n) {
|
|
1496
1559
|
if (n && typeof n == "object") {
|
|
1497
1560
|
const l = n;
|
|
1498
1561
|
if (typeof l.detail == "string" && l.detail !== "") return l.detail;
|
|
1499
1562
|
if (typeof l.title == "string" && l.title !== "") return l.title;
|
|
1500
1563
|
}
|
|
1501
1564
|
}
|
|
1502
|
-
function
|
|
1565
|
+
function Zn(n, l, a, i) {
|
|
1503
1566
|
if (n !== 403) return { kind: "none" };
|
|
1504
|
-
const
|
|
1505
|
-
return
|
|
1567
|
+
const o = mn(a);
|
|
1568
|
+
return dn(l, "X-Elevation-Required") !== void 0 ? i.elevates ? { kind: "elevation-required", message: o ?? "This needs an elevated session." } : { kind: "refused", message: "This can only be done in the admin, in an elevated session." } : { kind: "refused", message: o ?? "The server refused this." };
|
|
1506
1569
|
}
|
|
1507
1570
|
const we = "coolms-kit:reread";
|
|
1508
|
-
function
|
|
1571
|
+
function Vn() {
|
|
1509
1572
|
window.dispatchEvent(new Event(we));
|
|
1510
1573
|
}
|
|
1511
|
-
function
|
|
1512
|
-
const [l, a] = D(void 0), [
|
|
1513
|
-
|
|
1514
|
-
const u = Z(0),
|
|
1515
|
-
const
|
|
1516
|
-
|
|
1574
|
+
function Wn(n) {
|
|
1575
|
+
const [l, a] = D(void 0), [i, o] = D(void 0), [t, s] = D(!0), c = Z(n);
|
|
1576
|
+
c.current = n;
|
|
1577
|
+
const u = Z(0), d = be(() => {
|
|
1578
|
+
const p = ++u.current;
|
|
1579
|
+
s(!0), c.current().then(
|
|
1517
1580
|
(h) => {
|
|
1518
|
-
|
|
1581
|
+
p === u.current && (a(h), o(void 0), s(!1));
|
|
1519
1582
|
},
|
|
1520
1583
|
(h) => {
|
|
1521
|
-
|
|
1584
|
+
p === u.current && (o(h), s(!1));
|
|
1522
1585
|
}
|
|
1523
1586
|
);
|
|
1524
1587
|
}, []);
|
|
1525
1588
|
return G(() => {
|
|
1526
|
-
|
|
1527
|
-
const
|
|
1528
|
-
return window.addEventListener("focus",
|
|
1529
|
-
window.removeEventListener("focus",
|
|
1589
|
+
d();
|
|
1590
|
+
const p = () => d();
|
|
1591
|
+
return window.addEventListener("focus", p), window.addEventListener(we, p), () => {
|
|
1592
|
+
window.removeEventListener("focus", p), window.removeEventListener(we, p);
|
|
1530
1593
|
};
|
|
1531
|
-
}, [
|
|
1594
|
+
}, [d]), { value: l, error: i, loading: t, reread: d };
|
|
1532
1595
|
}
|
|
1533
|
-
function
|
|
1596
|
+
function jn(n) {
|
|
1534
1597
|
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 };
|
|
1535
1598
|
}
|
|
1536
|
-
const
|
|
1537
|
-
function
|
|
1538
|
-
const a = n.split(".").map((
|
|
1539
|
-
for (let
|
|
1540
|
-
const
|
|
1541
|
-
if (
|
|
1599
|
+
const un = "/errors/client-update-required";
|
|
1600
|
+
function hn(n, l) {
|
|
1601
|
+
const a = n.split(".").map((o) => Number.parseInt(o, 10) || 0), i = l.split(".").map((o) => Number.parseInt(o, 10) || 0);
|
|
1602
|
+
for (let o = 0; o < Math.max(a.length, i.length); o++) {
|
|
1603
|
+
const t = a[o] ?? 0, s = i[o] ?? 0;
|
|
1604
|
+
if (t !== s) return t < s;
|
|
1542
1605
|
}
|
|
1543
1606
|
return !1;
|
|
1544
1607
|
}
|
|
1545
|
-
function
|
|
1546
|
-
return n.problemType !== void 0 && n.problemType.endsWith(
|
|
1608
|
+
function qn(n) {
|
|
1609
|
+
return n.problemType !== void 0 && n.problemType.endsWith(un) ? !0 : n.minimumVersion !== void 0 && hn(n.version, n.minimumVersion);
|
|
1547
1610
|
}
|
|
1548
1611
|
export {
|
|
1549
|
-
|
|
1612
|
+
Dn as AppShell,
|
|
1550
1613
|
ve as Avatar,
|
|
1551
|
-
|
|
1552
|
-
|
|
1614
|
+
Se as BOOTSTRAP_ICONS,
|
|
1615
|
+
nn as Badge,
|
|
1553
1616
|
ee as Button,
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1617
|
+
Me as CALL_LABELS,
|
|
1618
|
+
un as CLIENT_UPDATE_REQUIRED,
|
|
1619
|
+
zn as CallBar,
|
|
1620
|
+
Bn as CallPanel,
|
|
1621
|
+
In as ChatBubble,
|
|
1622
|
+
Fn as Composer,
|
|
1623
|
+
yn as ConfirmDialog,
|
|
1624
|
+
tn as ContextMenu,
|
|
1625
|
+
Ue as EmptyState,
|
|
1626
|
+
Re as ErrorBanner,
|
|
1627
|
+
Mn as FilePicker,
|
|
1628
|
+
Ye as FilePickerDenied,
|
|
1629
|
+
Cn as FileViewer,
|
|
1630
|
+
Tn as FilterChips,
|
|
1631
|
+
xn as ICON_NAMES,
|
|
1632
|
+
F as Icon,
|
|
1633
|
+
Pn as IncomingCall,
|
|
1634
|
+
Un as List,
|
|
1635
|
+
He as Loading,
|
|
1636
|
+
ln as MAIL_ROW_LABELS,
|
|
1637
|
+
Ke as MODAL_CLOSE_MS,
|
|
1638
|
+
$n as MailRow,
|
|
1639
|
+
Te as Modal,
|
|
1640
|
+
Sn as PageHeader,
|
|
1641
|
+
Rn as PaneToolbar,
|
|
1642
|
+
an as SIGN_IN_LABELS,
|
|
1580
1643
|
ye as STATE_DELAY_MS,
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
On as
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1644
|
+
En as SearchField,
|
|
1645
|
+
gn as Select,
|
|
1646
|
+
Hn as SignInForm,
|
|
1647
|
+
Kn as SignInLayout,
|
|
1648
|
+
Ln as SplitPanes,
|
|
1649
|
+
se as State,
|
|
1650
|
+
An as TabStrip,
|
|
1651
|
+
vn as TextArea,
|
|
1652
|
+
_n as TextField,
|
|
1653
|
+
wn as Toast,
|
|
1654
|
+
kn as ToastRegion,
|
|
1655
|
+
Nn as Toggle,
|
|
1656
|
+
_e as iconForName,
|
|
1657
|
+
Qe as initialsOf,
|
|
1658
|
+
on as isCapability,
|
|
1659
|
+
qn as needsClientUpdate,
|
|
1660
|
+
On as offerFor,
|
|
1661
|
+
jn as readConflict,
|
|
1662
|
+
Zn as readRefusal,
|
|
1663
|
+
mn as refusalText,
|
|
1664
|
+
Vn as rereadAll,
|
|
1665
|
+
en as tintOf,
|
|
1666
|
+
Wn as useReread,
|
|
1667
|
+
hn as versionBelow,
|
|
1668
|
+
Be as writtenOut
|
|
1604
1669
|
};
|