@coolms/ui-react 0.1.0-alpha.33 → 0.1.0-alpha.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/components/Column.d.ts +21 -0
- package/dist/components/Structure.d.ts +3 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +517 -510
- package/package.json +3 -2
- package/src/kit.css +12 -3
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i, Fragment as A } from "react/jsx-runtime";
|
|
2
2
|
import { useId as se, useState as T, useRef as H, useEffect as Q, useCallback as be, useMemo as ln, useContext as tn, createContext as sn, useLayoutEffect as ve, Fragment as an } from "react";
|
|
3
|
-
import { createPortal as
|
|
3
|
+
import { createPortal as Fe } from "react-dom";
|
|
4
4
|
function ye(n, l) {
|
|
5
5
|
const t = { ...n };
|
|
6
|
-
for (const
|
|
7
|
-
const c = l == null ? void 0 : l[
|
|
8
|
-
c !== void 0 && (t[
|
|
6
|
+
for (const a of Object.keys(l ?? {})) {
|
|
7
|
+
const c = l == null ? void 0 : l[a];
|
|
8
|
+
c !== void 0 && (t[a] = c);
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function $(...n) {
|
|
13
13
|
return n.filter(Boolean).join(" ");
|
|
14
14
|
}
|
|
15
15
|
function G({ name: n }) {
|
|
@@ -35,30 +35,30 @@ function he({
|
|
|
35
35
|
variant: n = "secondary",
|
|
36
36
|
busy: l = !1,
|
|
37
37
|
busyLabel: t,
|
|
38
|
-
locked:
|
|
38
|
+
locked: a = !1,
|
|
39
39
|
lockedReason: c,
|
|
40
40
|
icon: s,
|
|
41
|
-
disabled:
|
|
42
|
-
className:
|
|
43
|
-
children:
|
|
41
|
+
disabled: m,
|
|
42
|
+
className: r,
|
|
43
|
+
children: u,
|
|
44
44
|
type: v = "button",
|
|
45
45
|
title: o,
|
|
46
46
|
...p
|
|
47
47
|
}) {
|
|
48
|
-
const h = !!
|
|
48
|
+
const h = !!m || l;
|
|
49
49
|
return /* @__PURE__ */ i(
|
|
50
50
|
"button",
|
|
51
51
|
{
|
|
52
52
|
...p,
|
|
53
53
|
type: v,
|
|
54
|
-
className:
|
|
54
|
+
className: $("cms-button", `cms-button--${n}`, l && "is-busy", a && "is-locked", r),
|
|
55
55
|
disabled: h,
|
|
56
56
|
"aria-busy": l || void 0,
|
|
57
|
-
title:
|
|
57
|
+
title: a ? c ?? o : o,
|
|
58
58
|
children: [
|
|
59
|
-
l ? /* @__PURE__ */ e(G, { name: "spinner" }) :
|
|
60
|
-
/* @__PURE__ */ e("span", { className: "cms-button__label", children: l && t !== void 0 ? t :
|
|
61
|
-
|
|
59
|
+
l ? /* @__PURE__ */ e(G, { name: "spinner" }) : a ? /* @__PURE__ */ e(G, { name: "lock" }) : s,
|
|
60
|
+
/* @__PURE__ */ e("span", { className: "cms-button__label", children: l && t !== void 0 ? t : u }),
|
|
61
|
+
a && c ? /* @__PURE__ */ i("span", { className: "cms-visually-hidden", children: [
|
|
62
62
|
", ",
|
|
63
63
|
c
|
|
64
64
|
] }) : null
|
|
@@ -66,8 +66,8 @@ function he({
|
|
|
66
66
|
}
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
return /* @__PURE__ */ i("div", { className:
|
|
69
|
+
function Be({ id: n, label: l, help: t, error: a, pinned: c, children: s }) {
|
|
70
|
+
return /* @__PURE__ */ i("div", { className: $("cms-field", a != null && "is-invalid"), children: [
|
|
71
71
|
/* @__PURE__ */ e("label", { className: "cms-field__label", htmlFor: n, children: l }),
|
|
72
72
|
s,
|
|
73
73
|
c != null ? /* @__PURE__ */ i("p", { className: "cms-field__pinned", id: `${n}-pinned`, children: [
|
|
@@ -75,36 +75,36 @@ function Fe({ id: n, label: l, help: t, error: r, pinned: c, children: s }) {
|
|
|
75
75
|
" ",
|
|
76
76
|
c
|
|
77
77
|
] }) : null,
|
|
78
|
-
|
|
78
|
+
a != null ? /* @__PURE__ */ e("p", { className: "cms-field__error", id: `${n}-error`, role: "alert", children: a }) : null,
|
|
79
79
|
t != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${n}-help`, children: t }) : null
|
|
80
80
|
] });
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function Pe(n, l) {
|
|
83
83
|
const t = [l.error != null && `${n}-error`, l.pinned != null && `${n}-pinned`, l.help != null && `${n}-help`].filter(Boolean).join(" ");
|
|
84
84
|
return t === "" ? void 0 : t;
|
|
85
85
|
}
|
|
86
86
|
const rn = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/, cn = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
|
|
87
87
|
function on(n, l, t) {
|
|
88
|
-
const
|
|
89
|
-
const p = new Date(Date.UTC(s,
|
|
90
|
-
return p.setUTCFullYear(s), p.getUTCFullYear() === s && p.getUTCMonth() ===
|
|
88
|
+
const a = (s, m, r, u = 0, v = 0, o = 0) => {
|
|
89
|
+
const p = new Date(Date.UTC(s, m - 1, r, u, v, o));
|
|
90
|
+
return p.setUTCFullYear(s), p.getUTCFullYear() === s && p.getUTCMonth() === m - 1 && p.getUTCDate() === r && p.getUTCHours() === u && p.getUTCMinutes() === v && p.getUTCSeconds() === o ? p : null;
|
|
91
91
|
}, c = (s) => ({ hour: Number(s[1]), minute: Number(s[2]), second: Number(s[3] ?? 0) });
|
|
92
92
|
try {
|
|
93
93
|
if (n === "time") {
|
|
94
|
-
const
|
|
95
|
-
if (
|
|
96
|
-
const
|
|
97
|
-
return
|
|
94
|
+
const m = l.match(cn);
|
|
95
|
+
if (m === null) return l;
|
|
96
|
+
const r = c(m), u = a(2e3, 1, 1, r.hour, r.minute, r.second);
|
|
97
|
+
return u === null ? l : new Intl.DateTimeFormat(t, { timeStyle: m[3] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(u);
|
|
98
98
|
}
|
|
99
99
|
const s = l.match(rn);
|
|
100
100
|
if (s === null) return l;
|
|
101
101
|
if (n === "date" && s[4] === void 0) {
|
|
102
|
-
const
|
|
103
|
-
return
|
|
102
|
+
const m = a(Number(s[1]), Number(s[2]), Number(s[3]));
|
|
103
|
+
return m === null ? l : new Intl.DateTimeFormat(t, { dateStyle: "medium", timeZone: "UTC" }).format(m);
|
|
104
104
|
}
|
|
105
105
|
if (n === "datetime-local" && s[4] !== void 0) {
|
|
106
|
-
const
|
|
107
|
-
return
|
|
106
|
+
const m = a(Number(s[1]), Number(s[2]), Number(s[3]), Number(s[4]), Number(s[5]), Number(s[6] ?? 0));
|
|
107
|
+
return m === null ? l : new Intl.DateTimeFormat(t, { dateStyle: "medium", timeStyle: s[6] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(m);
|
|
108
108
|
}
|
|
109
109
|
} catch {
|
|
110
110
|
return l;
|
|
@@ -112,20 +112,20 @@ function on(n, l, t) {
|
|
|
112
112
|
return l;
|
|
113
113
|
}
|
|
114
114
|
const dn = /* @__PURE__ */ new Set(["date", "time", "datetime-local"]);
|
|
115
|
-
function il({ label: n, help: l, error: t, disabled:
|
|
115
|
+
function il({ label: n, help: l, error: t, disabled: a, readOnly: c, pinned: s, value: m, onChange: r, placeholder: u, type: v = "text", name: o, locale: p, min: h, max: f, step: d, minLength: g, maxLength: k, required: x }) {
|
|
116
116
|
const C = se(), w = c === !0 || s != null, b = w && dn.has(v), y = v === "number" && (d === "any" || typeof d == "number" && !Number.isInteger(d));
|
|
117
|
-
return /* @__PURE__ */ e(
|
|
117
|
+
return /* @__PURE__ */ e(Be, { id: C, label: n, help: l, error: t, pinned: s, children: /* @__PURE__ */ e(
|
|
118
118
|
"input",
|
|
119
119
|
{
|
|
120
120
|
id: C,
|
|
121
121
|
name: o,
|
|
122
122
|
type: b ? "text" : v,
|
|
123
123
|
className: "cms-input",
|
|
124
|
-
value: b ? on(v,
|
|
125
|
-
...b ? { "data-value":
|
|
124
|
+
value: b ? on(v, m, p) : m,
|
|
125
|
+
...b ? { "data-value": m } : {},
|
|
126
126
|
lang: p,
|
|
127
|
-
placeholder:
|
|
128
|
-
disabled:
|
|
127
|
+
placeholder: u,
|
|
128
|
+
disabled: a,
|
|
129
129
|
readOnly: w,
|
|
130
130
|
required: x,
|
|
131
131
|
"aria-required": x || void 0,
|
|
@@ -136,81 +136,81 @@ function il({ label: n, help: l, error: t, disabled: r, readOnly: c, pinned: s,
|
|
|
136
136
|
maxLength: k,
|
|
137
137
|
inputMode: v === "number" ? y ? "decimal" : "numeric" : void 0,
|
|
138
138
|
"aria-invalid": t != null || void 0,
|
|
139
|
-
"aria-describedby":
|
|
140
|
-
onChange: (D) =>
|
|
139
|
+
"aria-describedby": Pe(C, { help: l, error: t, pinned: s }),
|
|
140
|
+
onChange: (D) => r == null ? void 0 : r(D.target.value)
|
|
141
141
|
}
|
|
142
142
|
) });
|
|
143
143
|
}
|
|
144
|
-
function ol({ label: n, help: l, error: t, disabled:
|
|
144
|
+
function ol({ label: n, help: l, error: t, disabled: a, readOnly: c, pinned: s, value: m, onChange: r, placeholder: u, rows: v = 4, name: o, locale: p, minLength: h, maxLength: f, required: d }) {
|
|
145
145
|
const g = se();
|
|
146
|
-
return /* @__PURE__ */ e(
|
|
146
|
+
return /* @__PURE__ */ e(Be, { id: g, label: n, help: l, error: t, pinned: s, children: /* @__PURE__ */ e(
|
|
147
147
|
"textarea",
|
|
148
148
|
{
|
|
149
149
|
id: g,
|
|
150
150
|
name: o,
|
|
151
151
|
className: "cms-input cms-textarea",
|
|
152
152
|
rows: v,
|
|
153
|
-
value:
|
|
153
|
+
value: m,
|
|
154
154
|
lang: p,
|
|
155
|
-
placeholder:
|
|
156
|
-
disabled:
|
|
155
|
+
placeholder: u,
|
|
156
|
+
disabled: a,
|
|
157
157
|
readOnly: c === !0 || s != null,
|
|
158
158
|
required: d,
|
|
159
159
|
"aria-required": d || void 0,
|
|
160
160
|
minLength: h,
|
|
161
161
|
maxLength: f,
|
|
162
162
|
"aria-invalid": t != null || void 0,
|
|
163
|
-
"aria-describedby":
|
|
164
|
-
onChange: (k) =>
|
|
163
|
+
"aria-describedby": Pe(g, { help: l, error: t, pinned: s }),
|
|
164
|
+
onChange: (k) => r == null ? void 0 : r(k.target.value)
|
|
165
165
|
}
|
|
166
166
|
) });
|
|
167
167
|
}
|
|
168
|
-
function dl({ label: n, help: l, error: t, disabled:
|
|
169
|
-
const o = se(), p =
|
|
170
|
-
return /* @__PURE__ */ e(
|
|
168
|
+
function dl({ label: n, help: l, error: t, disabled: a, readOnly: c, value: s, options: m, onChange: r, emptyText: u = "Nothing to choose from yet.", name: v }) {
|
|
169
|
+
const o = se(), p = m.length === 0;
|
|
170
|
+
return /* @__PURE__ */ e(Be, { id: o, label: n, help: p ? u : l, error: t, children: /* @__PURE__ */ e(
|
|
171
171
|
"select",
|
|
172
172
|
{
|
|
173
173
|
id: o,
|
|
174
174
|
name: v,
|
|
175
175
|
className: "cms-input cms-select",
|
|
176
176
|
value: s,
|
|
177
|
-
disabled:
|
|
177
|
+
disabled: a || p,
|
|
178
178
|
"aria-readonly": c || void 0,
|
|
179
179
|
"aria-invalid": t != null || void 0,
|
|
180
|
-
"aria-describedby":
|
|
180
|
+
"aria-describedby": Pe(o, { help: p ? u : l, error: t }),
|
|
181
181
|
onChange: (h) => {
|
|
182
|
-
c ||
|
|
182
|
+
c || r == null || r(h.target.value);
|
|
183
183
|
},
|
|
184
|
-
children:
|
|
184
|
+
children: m.map((h) => /* @__PURE__ */ e("option", { value: h.value, disabled: c && h.value !== s, children: h.label }, h.value))
|
|
185
185
|
}
|
|
186
186
|
) });
|
|
187
187
|
}
|
|
188
|
-
function ul({ label: n, checked: l, onChange: t, disabled:
|
|
189
|
-
const
|
|
188
|
+
function ul({ label: n, checked: l, onChange: t, disabled: a, readOnly: c, help: s }) {
|
|
189
|
+
const m = se();
|
|
190
190
|
return /* @__PURE__ */ i("div", { className: "cms-toggle-row", children: [
|
|
191
191
|
/* @__PURE__ */ e(
|
|
192
192
|
"button",
|
|
193
193
|
{
|
|
194
|
-
id:
|
|
194
|
+
id: m,
|
|
195
195
|
type: "button",
|
|
196
196
|
role: "switch",
|
|
197
|
-
className:
|
|
197
|
+
className: $("cms-toggle", l && "is-on"),
|
|
198
198
|
"aria-checked": l,
|
|
199
199
|
"aria-readonly": c || void 0,
|
|
200
|
-
"aria-describedby": s != null ? `${
|
|
201
|
-
disabled:
|
|
200
|
+
"aria-describedby": s != null ? `${m}-help` : void 0,
|
|
201
|
+
disabled: a,
|
|
202
202
|
onClick: () => {
|
|
203
203
|
c || t == null || t(!l);
|
|
204
204
|
},
|
|
205
205
|
children: /* @__PURE__ */ e("span", { className: "cms-toggle__thumb" })
|
|
206
206
|
}
|
|
207
207
|
),
|
|
208
|
-
/* @__PURE__ */ e("label", { className: "cms-toggle__label", htmlFor:
|
|
209
|
-
s != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${
|
|
208
|
+
/* @__PURE__ */ e("label", { className: "cms-toggle__label", htmlFor: m, children: n }),
|
|
209
|
+
s != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${m}-help`, children: s }) : null
|
|
210
210
|
] });
|
|
211
211
|
}
|
|
212
212
|
const un = 150;
|
|
213
|
-
function je({ open: n, title: l, onClose: t, dirty:
|
|
213
|
+
function je({ open: n, title: l, onClose: t, dirty: a = !1, onDirtyClose: c, children: s, footer: m, closeLabel: r = "Close", initialFocus: u, className: v }) {
|
|
214
214
|
const [o, p] = T(n), [h, f] = T(!1), d = H(null), g = H(null), k = se();
|
|
215
215
|
if (Q(() => {
|
|
216
216
|
if (n) {
|
|
@@ -228,20 +228,20 @@ function je({ open: n, title: l, onClose: t, dirty: r = !1, onDirtyClose: c, chi
|
|
|
228
228
|
var C, w;
|
|
229
229
|
if (n && o) {
|
|
230
230
|
const b = 'input, select, textarea, button, [href], [tabindex]:not([tabindex="-1"])';
|
|
231
|
-
(w = (
|
|
231
|
+
(w = (u == null ? void 0 : u.current) ?? ((C = d.current) == null ? void 0 : C.querySelector(`.cms-modal__body :is(${b}), .cms-modal__foot :is(${b})`)) ?? d.current) == null || w.focus();
|
|
232
232
|
}
|
|
233
|
-
}, [n, o,
|
|
233
|
+
}, [n, o, u]), !o) return null;
|
|
234
234
|
const x = () => {
|
|
235
|
-
|
|
235
|
+
a ? c == null || c() : t();
|
|
236
236
|
};
|
|
237
|
-
return
|
|
238
|
-
/* @__PURE__ */ e("div", { className:
|
|
237
|
+
return Fe(
|
|
238
|
+
/* @__PURE__ */ e("div", { className: $("cms-modal-scrim", h && "is-closing"), onMouseDown: (C) => {
|
|
239
239
|
C.target === C.currentTarget && x();
|
|
240
240
|
}, children: /* @__PURE__ */ i(
|
|
241
241
|
"div",
|
|
242
242
|
{
|
|
243
243
|
ref: d,
|
|
244
|
-
className:
|
|
244
|
+
className: $("cms-modal", v, h && "is-closing", a && "is-dirty"),
|
|
245
245
|
role: "dialog",
|
|
246
246
|
"aria-modal": "true",
|
|
247
247
|
"aria-labelledby": k,
|
|
@@ -260,30 +260,30 @@ function je({ open: n, title: l, onClose: t, dirty: r = !1, onDirtyClose: c, chi
|
|
|
260
260
|
children: [
|
|
261
261
|
/* @__PURE__ */ i("header", { className: "cms-modal__head", children: [
|
|
262
262
|
/* @__PURE__ */ e("h2", { className: "cms-modal__title", id: k, children: l }),
|
|
263
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label":
|
|
263
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": r, onClick: x, children: /* @__PURE__ */ e(G, { name: "close" }) })
|
|
264
264
|
] }),
|
|
265
265
|
/* @__PURE__ */ e("div", { className: "cms-modal__body", children: s }),
|
|
266
|
-
|
|
266
|
+
m != null ? /* @__PURE__ */ e("footer", { className: "cms-modal__foot", children: m }) : null
|
|
267
267
|
]
|
|
268
268
|
}
|
|
269
269
|
) }),
|
|
270
270
|
document.body
|
|
271
271
|
);
|
|
272
272
|
}
|
|
273
|
-
function ml({ open: n, title: l, message: t, kind:
|
|
274
|
-
const v =
|
|
273
|
+
function ml({ open: n, title: l, message: t, kind: a = "default", confirmLabel: c, cancelLabel: s, closeLabel: m, onConfirm: r, onCancel: u }) {
|
|
274
|
+
const v = a === "discard-changes";
|
|
275
275
|
return /* @__PURE__ */ e(
|
|
276
276
|
je,
|
|
277
277
|
{
|
|
278
278
|
open: n,
|
|
279
279
|
title: l,
|
|
280
|
-
onClose:
|
|
281
|
-
...
|
|
280
|
+
onClose: u,
|
|
281
|
+
...m === void 0 ? {} : { closeLabel: m },
|
|
282
282
|
footer: /* @__PURE__ */ i(A, { children: [
|
|
283
|
-
/* @__PURE__ */ e(he, { onClick:
|
|
284
|
-
/* @__PURE__ */ e(he, { variant:
|
|
283
|
+
/* @__PURE__ */ e(he, { onClick: u, children: s ?? (v ? "Keep editing" : "Cancel") }),
|
|
284
|
+
/* @__PURE__ */ e(he, { variant: a === "default" ? "primary" : "danger", onClick: r, children: c ?? (v ? "Discard changes" : "Confirm") })
|
|
285
285
|
] }),
|
|
286
|
-
children:
|
|
286
|
+
children: a !== "default" ? /* @__PURE__ */ i("p", { className: "cms-confirm__warning", children: [
|
|
287
287
|
/* @__PURE__ */ e(G, { name: "warning" }),
|
|
288
288
|
" ",
|
|
289
289
|
t
|
|
@@ -291,19 +291,19 @@ function ml({ open: n, title: l, message: t, kind: r = "default", confirmLabel:
|
|
|
291
291
|
}
|
|
292
292
|
);
|
|
293
293
|
}
|
|
294
|
-
function hl({ kind: n, message: l, action: t, onDismiss:
|
|
295
|
-
return /* @__PURE__ */ i("div", { className:
|
|
294
|
+
function hl({ kind: n, message: l, action: t, onDismiss: a, dismissLabel: c = "Dismiss" }) {
|
|
295
|
+
return /* @__PURE__ */ i("div", { className: $("cms-toast", `cms-toast--${n}`), role: n === "error" ? "alert" : "status", children: [
|
|
296
296
|
/* @__PURE__ */ e(G, { name: n === "success" ? "check" : n === "error" ? "warning" : "info" }),
|
|
297
297
|
/* @__PURE__ */ e("span", { className: "cms-toast__message", children: l }),
|
|
298
298
|
t ? /* @__PURE__ */ e(he, { className: "cms-toast__action", onClick: t.onAction, children: t.label }) : null,
|
|
299
|
-
|
|
299
|
+
a ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": c, onClick: a, children: /* @__PURE__ */ e(G, { name: "close" }) }) : null
|
|
300
300
|
] });
|
|
301
301
|
}
|
|
302
302
|
function fl({ children: n }) {
|
|
303
303
|
return /* @__PURE__ */ e("div", { className: "cms-toast-region", children: n });
|
|
304
304
|
}
|
|
305
305
|
function mn({ what: n, layout: l = "inline" }) {
|
|
306
|
-
return /* @__PURE__ */ i("div", { className:
|
|
306
|
+
return /* @__PURE__ */ i("div", { className: $("cms-loading", `cms-loading--${l}`), role: "status", "aria-live": "polite", children: [
|
|
307
307
|
/* @__PURE__ */ e(G, { name: "spinner" }),
|
|
308
308
|
/* @__PURE__ */ e("span", { children: n })
|
|
309
309
|
] });
|
|
@@ -579,20 +579,20 @@ function vn() {
|
|
|
579
579
|
/* @__PURE__ */ e("circle", { className: "cms-state__arc", cx: "12", cy: "12", r: "10", fill: "none", pathLength: "100", strokeDasharray: "28 72" })
|
|
580
580
|
] });
|
|
581
581
|
}
|
|
582
|
-
function me({ kind: n, title: l, description: t, action:
|
|
583
|
-
const [
|
|
582
|
+
function me({ kind: n, title: l, description: t, action: a, placement: c = "block", icon: s }) {
|
|
583
|
+
const [m, r] = T(n !== "loading");
|
|
584
584
|
return Q(() => {
|
|
585
585
|
if (n !== "loading") {
|
|
586
|
-
|
|
586
|
+
r(!0);
|
|
587
587
|
return;
|
|
588
588
|
}
|
|
589
|
-
|
|
590
|
-
const
|
|
591
|
-
return () => window.clearTimeout(
|
|
589
|
+
r(!1);
|
|
590
|
+
const u = window.setTimeout(() => r(!0), bn());
|
|
591
|
+
return () => window.clearTimeout(u);
|
|
592
592
|
}, [n]), /* @__PURE__ */ i(
|
|
593
593
|
"div",
|
|
594
594
|
{
|
|
595
|
-
className:
|
|
595
|
+
className: $("cms-state", `cms-state--${n}`, `cms-state--${c}`, !m && "is-waiting"),
|
|
596
596
|
role: "status",
|
|
597
597
|
"aria-live": "polite",
|
|
598
598
|
"data-kind": n,
|
|
@@ -604,7 +604,7 @@ function me({ kind: n, title: l, description: t, action: r, placement: c = "bloc
|
|
|
604
604
|
/* @__PURE__ */ e("span", { className: "cms-state__title", children: l }),
|
|
605
605
|
t !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-state__description", children: t }) : null
|
|
606
606
|
] }),
|
|
607
|
-
|
|
607
|
+
a !== void 0 && n !== "denied" ? /* @__PURE__ */ e(he, { className: "cms-state__action", onClick: a.onAction, children: a.label }) : null
|
|
608
608
|
]
|
|
609
609
|
}
|
|
610
610
|
);
|
|
@@ -620,7 +620,7 @@ function kn(n) {
|
|
|
620
620
|
return n.getClientRects().length > 0;
|
|
621
621
|
}
|
|
622
622
|
function _l(n) {
|
|
623
|
-
const { name: l, badge: t, closeLabel:
|
|
623
|
+
const { name: l, badge: t, closeLabel: a, onClose: c, actions: s = [], moreLabel: m = "More", edit: r, editing: u, state: v, siblings: o, bar: p, thumbnails: h, strip: f, onZoom: d, children: g } = n, k = H(null), x = H(null), C = se(), [w, b] = T(!1), y = H(null);
|
|
624
624
|
Q(() => {
|
|
625
625
|
var z;
|
|
626
626
|
const M = document.activeElement, R = document.body.style.overflow;
|
|
@@ -630,10 +630,10 @@ function _l(n) {
|
|
|
630
630
|
};
|
|
631
631
|
}, []);
|
|
632
632
|
const D = () => {
|
|
633
|
-
|
|
633
|
+
u != null && u.dirty ? u.onDirtyClose() : c();
|
|
634
634
|
}, Z = (M) => {
|
|
635
635
|
const R = M.touches.length === 1 ? M.touches[0] : void 0;
|
|
636
|
-
y.current = R === void 0 ||
|
|
636
|
+
y.current = R === void 0 || u !== void 0 || yn(M.target) ? null : { x: R.clientX, y: R.clientY };
|
|
637
637
|
}, V = (M) => {
|
|
638
638
|
var U, j;
|
|
639
639
|
const R = y.current, z = M.changedTouches[0];
|
|
@@ -641,12 +641,12 @@ function _l(n) {
|
|
|
641
641
|
const q = z.clientX - R.x;
|
|
642
642
|
Math.abs(q) < Nn || Math.abs(q) < Math.abs(z.clientY - R.y) || (q > 0 ? (U = o == null ? void 0 : o.onPrevious) == null || U.call(o) : (j = o == null ? void 0 : o.onNext) == null || j.call(o));
|
|
643
643
|
};
|
|
644
|
-
return
|
|
644
|
+
return Fe(
|
|
645
645
|
/* @__PURE__ */ i(
|
|
646
646
|
"div",
|
|
647
647
|
{
|
|
648
648
|
ref: k,
|
|
649
|
-
className:
|
|
649
|
+
className: $("cms-viewer", u !== void 0 && "is-editing"),
|
|
650
650
|
role: "dialog",
|
|
651
651
|
"aria-modal": "true",
|
|
652
652
|
"aria-labelledby": C,
|
|
@@ -654,37 +654,37 @@ function _l(n) {
|
|
|
654
654
|
onKeyDown: (M) => {
|
|
655
655
|
var R, z, q;
|
|
656
656
|
if (M.key === "Escape") {
|
|
657
|
-
if (
|
|
657
|
+
if (u !== void 0) return;
|
|
658
658
|
M.stopPropagation(), w ? b(!1) : c();
|
|
659
659
|
} else if (M.key === "Tab") {
|
|
660
660
|
const U = Array.from(((R = k.current) == null ? void 0 : R.querySelectorAll(gn)) ?? []).filter(kn);
|
|
661
661
|
if (U.length === 0) return;
|
|
662
662
|
const j = U[0], le = U[U.length - 1];
|
|
663
663
|
M.shiftKey && document.activeElement === j ? (M.preventDefault(), le.focus()) : !M.shiftKey && document.activeElement === le && (M.preventDefault(), j.focus());
|
|
664
|
-
} else
|
|
664
|
+
} else u === void 0 && !wn(M.target) && !M.ctrlKey && !M.metaKey && !M.altKey && (M.key === "ArrowLeft" ? (z = o == null ? void 0 : o.onPrevious) == null || z.call(o) : M.key === "ArrowRight" ? (q = o == null ? void 0 : o.onNext) == null || q.call(o) : M.key === "+" || M.key === "=" ? d == null || d("in") : M.key === "-" ? d == null || d("out") : M.key === "0" && (d == null || d("reset")));
|
|
665
665
|
},
|
|
666
666
|
children: [
|
|
667
667
|
o !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-visually-hidden", role: "status", children: `${l}, ${o.position}` }) : null,
|
|
668
668
|
/* @__PURE__ */ i("header", { className: "cms-viewer__top", children: [
|
|
669
|
-
/* @__PURE__ */ e("button", { ref: x, type: "button", className: "cms-viewer__icon", "aria-label":
|
|
669
|
+
/* @__PURE__ */ e("button", { ref: x, type: "button", className: "cms-viewer__icon", "aria-label": a, onClick: D, children: /* @__PURE__ */ e(G, { name: "close" }) }),
|
|
670
670
|
/* @__PURE__ */ e("span", { className: "cms-viewer__badge", children: t }),
|
|
671
671
|
/* @__PURE__ */ e("h2", { className: "cms-viewer__name", id: C, title: l, children: l }),
|
|
672
672
|
o !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-viewer__position", children: o.position }) : null,
|
|
673
673
|
/* @__PURE__ */ e("span", { className: "cms-viewer__space" }),
|
|
674
|
-
|
|
675
|
-
/* @__PURE__ */ e("span", { className: "cms-viewer__status", role: "status", children:
|
|
676
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick:
|
|
674
|
+
u !== void 0 ? /* @__PURE__ */ i(A, { children: [
|
|
675
|
+
/* @__PURE__ */ e("span", { className: "cms-viewer__status", role: "status", children: u.status }),
|
|
676
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: u.onDone, children: u.doneLabel })
|
|
677
677
|
] }) : /* @__PURE__ */ i(A, { children: [
|
|
678
678
|
/* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: s.map((M) => /* @__PURE__ */ i("button", { type: "button", className: "cms-viewer__button", onClick: M.onSelect, children: [
|
|
679
679
|
M.icon,
|
|
680
680
|
M.label
|
|
681
681
|
] }, M.label)) }),
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
/* @__PURE__ */ e("span", { className: "cms-viewer__wide", children:
|
|
682
|
+
r !== void 0 ? /* @__PURE__ */ i("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": r.label, onClick: r.onEdit, children: [
|
|
683
|
+
r.icon,
|
|
684
|
+
/* @__PURE__ */ e("span", { className: "cms-viewer__wide", children: r.label })
|
|
685
685
|
] }) : null,
|
|
686
686
|
s.length > 0 ? /* @__PURE__ */ i("span", { className: "cms-viewer__more", children: [
|
|
687
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label":
|
|
687
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label": m, "aria-expanded": w, onClick: () => b((M) => !M), children: /* @__PURE__ */ e(L, { name: "more" }) }),
|
|
688
688
|
w ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: s.map((M) => /* @__PURE__ */ i(
|
|
689
689
|
"button",
|
|
690
690
|
{
|
|
@@ -704,20 +704,20 @@ function _l(n) {
|
|
|
704
704
|
] })
|
|
705
705
|
] }),
|
|
706
706
|
/* @__PURE__ */ i("div", { className: "cms-viewer__body", children: [
|
|
707
|
-
h != null &&
|
|
707
|
+
h != null && u === void 0 ? /* @__PURE__ */ e("nav", { className: "cms-viewer__thumbnails", children: h }) : null,
|
|
708
708
|
/* @__PURE__ */ i("div", { className: "cms-viewer__content", onTouchStart: Z, onTouchEnd: V, children: [
|
|
709
|
-
(
|
|
710
|
-
/* @__PURE__ */ e("p", { className: "cms-viewer__conflict-text", children:
|
|
711
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button", onClick:
|
|
712
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick:
|
|
709
|
+
(u == null ? void 0 : u.conflict) !== void 0 ? /* @__PURE__ */ i("div", { className: "cms-viewer__conflict", role: "alert", children: [
|
|
710
|
+
/* @__PURE__ */ e("p", { className: "cms-viewer__conflict-text", children: u.conflict.message }),
|
|
711
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button", onClick: u.conflict.onOverwrite, children: u.conflict.overwriteLabel }),
|
|
712
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: u.conflict.onKeepBoth, children: u.conflict.keepBothLabel })
|
|
713
713
|
] }) : null,
|
|
714
714
|
v === void 0 ? g : /* @__PURE__ */ e(xn, { state: v }),
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
715
|
+
u === void 0 && (o != null && o.onPrevious) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--previous", "aria-label": o.previousLabel, title: o.previousLabel, onClick: o.onPrevious, children: /* @__PURE__ */ e(G, { name: "back" }) }) : null,
|
|
716
|
+
u === void 0 && (o != null && o.onNext) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--next", "aria-label": o.nextLabel, title: o.nextLabel, onClick: o.onNext, children: /* @__PURE__ */ e(G, { name: "back" }) }) : null,
|
|
717
|
+
u === void 0 && o !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(o.total, 7) }, (M, R) => /* @__PURE__ */ e("i", { className: R === Math.min(o.index, 6) ? "is-current" : void 0 }, R)) }) : null
|
|
718
718
|
] })
|
|
719
719
|
] }),
|
|
720
|
-
|
|
720
|
+
u === void 0 && f != null ? /* @__PURE__ */ e("div", { className: "cms-viewer__strip", children: f }) : null,
|
|
721
721
|
p != null ? /* @__PURE__ */ e("footer", { className: "cms-viewer__bar", children: p }) : null
|
|
722
722
|
]
|
|
723
723
|
}
|
|
@@ -766,8 +766,8 @@ class Cn extends Error {
|
|
|
766
766
|
const Ae = (n, l) => `${n}
|
|
767
767
|
${l}`, Sn = (n, l) => n === "" ? l : `${n}/${l}`, En = 48;
|
|
768
768
|
function bl(n) {
|
|
769
|
-
var
|
|
770
|
-
const { open: l, spaces: t, list:
|
|
769
|
+
var F, X;
|
|
770
|
+
const { open: l, spaces: t, list: a, disabledReason: c, budget: s, formatSize: m, labels: r, onConfirm: u, onCancel: v } = n, [o, p] = T(((F = t[0]) == null ? void 0 : F.id) ?? ""), [h, f] = T(""), [d, g] = T({ status: "loading" }), [k, x] = T(0), [C, w] = T(/* @__PURE__ */ new Map()), [b, y] = T(0), [D, Z] = T(!1), V = H(null), M = H(!1);
|
|
771
771
|
Q(() => {
|
|
772
772
|
M.current = !1;
|
|
773
773
|
}, [l, o, h]);
|
|
@@ -778,17 +778,17 @@ function bl(n) {
|
|
|
778
778
|
}, [l]), Q(() => {
|
|
779
779
|
if (!l || o === "") return;
|
|
780
780
|
let N = !0;
|
|
781
|
-
return g({ status: "loading" }), y(0),
|
|
781
|
+
return g({ status: "loading" }), y(0), a(o, h).then(
|
|
782
782
|
(S) => N && g({ status: "ready", entries: S.entries, next: S.next ?? null, paging: !1 }),
|
|
783
783
|
(S) => N && g({ status: S instanceof Mn ? "denied" : "error" })
|
|
784
784
|
), () => {
|
|
785
785
|
N = !1;
|
|
786
786
|
};
|
|
787
|
-
}, [l, o, h,
|
|
787
|
+
}, [l, o, h, a, k]);
|
|
788
788
|
const z = be(() => {
|
|
789
789
|
if (d.status !== "ready" || d.next === null || d.paging) return;
|
|
790
790
|
const N = d.next, S = d.entries;
|
|
791
|
-
g({ ...d, paging: !0 }),
|
|
791
|
+
g({ ...d, paging: !0 }), a(o, h, N).then(
|
|
792
792
|
(O) => {
|
|
793
793
|
M.current = !1, g({ status: "ready", entries: [...S, ...O.entries], next: O.next ?? null, paging: !1 });
|
|
794
794
|
},
|
|
@@ -804,13 +804,13 @@ function bl(n) {
|
|
|
804
804
|
M.current = !0, x((Y) => Y + 1);
|
|
805
805
|
}
|
|
806
806
|
);
|
|
807
|
-
}, [d,
|
|
807
|
+
}, [d, a, o, h]), q = be((N) => {
|
|
808
808
|
var S;
|
|
809
809
|
return ((S = s == null ? void 0 : s.cost) == null ? void 0 : S.call(s, N)) ?? N.size ?? 0;
|
|
810
810
|
}, [s]), U = ln(() => [...C.values()], [C]), j = U.reduce((N, S) => N + (S.size ?? 0), 0), le = s === void 0 ? null : s.limitBytes - s.usedBytes - U.reduce((N, S) => N + q(S), 0), ae = le !== null && le < 0, re = (N) => {
|
|
811
811
|
if (N.kind !== "file") return null;
|
|
812
812
|
const S = c == null ? void 0 : c(N);
|
|
813
|
-
return S || (le !== null && !C.has(Ae(o, N.id)) && q(N) > le ?
|
|
813
|
+
return S || (le !== null && !C.has(Ae(o, N.id)) && q(N) > le ? r.overBudget : null);
|
|
814
814
|
}, ie = (N) => {
|
|
815
815
|
const S = Ae(o, N.id);
|
|
816
816
|
!C.has(S) && re(N) !== null || w((O) => {
|
|
@@ -827,72 +827,72 @@ function bl(n) {
|
|
|
827
827
|
const O = ee.length - 1, Y = N.key === "Home" ? 0 : N.key === "End" ? O : Math.min(O, Math.max(0, b + (N.key === "ArrowDown" ? 1 : -1)));
|
|
828
828
|
y(Y), Y >= O - 1 && z();
|
|
829
829
|
} else N.key === "Enter" && (S == null ? void 0 : S.kind) === "folder" ? (N.preventDefault(), oe(S)) : N.key === " " && (S == null ? void 0 : S.kind) === "file" ? (N.preventDefault(), ie(S)) : N.key === "Backspace" && h !== "" && (N.preventDefault(), J());
|
|
830
|
-
},
|
|
830
|
+
}, I = h === "" ? [] : h.split("/"), P = ((X = t.find((N) => N.id === o)) == null ? void 0 : X.name) ?? "", ne = (N) => `${R}-entry-${String(N)}`;
|
|
831
831
|
return /* @__PURE__ */ i(
|
|
832
832
|
je,
|
|
833
833
|
{
|
|
834
834
|
open: l,
|
|
835
|
-
title:
|
|
835
|
+
title: r.title,
|
|
836
836
|
onClose: v,
|
|
837
|
-
closeLabel:
|
|
837
|
+
closeLabel: r.close,
|
|
838
838
|
initialFocus: V,
|
|
839
839
|
className: "cms-file-picker",
|
|
840
840
|
footer: /* @__PURE__ */ i("div", { className: "cms-file-picker__foot", children: [
|
|
841
841
|
/* @__PURE__ */ i("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
|
|
842
|
-
U.length > 0 ? /* @__PURE__ */ e("span", { children:
|
|
843
|
-
s !== void 0 && le !== null ? /* @__PURE__ */ e("span", { className:
|
|
842
|
+
U.length > 0 ? /* @__PURE__ */ e("span", { children: r.total(U.length, m(j)) }) : null,
|
|
843
|
+
s !== void 0 && le !== null ? /* @__PURE__ */ e("span", { className: $(ae && "is-over"), children: ae ? r.overBudget : r.left(m(Math.max(0, le)), m(s.limitBytes)) }) : null
|
|
844
844
|
] }),
|
|
845
845
|
/* @__PURE__ */ i("div", { className: "cms-file-picker__actions", children: [
|
|
846
|
-
/* @__PURE__ */ e(he, { variant: "secondary", onClick: v, children:
|
|
847
|
-
/* @__PURE__ */ e(he, { variant: "primary", disabled: U.length === 0 || ae, onClick: () =>
|
|
846
|
+
/* @__PURE__ */ e(he, { variant: "secondary", onClick: v, children: r.cancel }),
|
|
847
|
+
/* @__PURE__ */ e(he, { variant: "primary", disabled: U.length === 0 || ae, onClick: () => u(U), children: r.confirm(U.length) })
|
|
848
848
|
] })
|
|
849
849
|
] }),
|
|
850
850
|
children: [
|
|
851
851
|
/* @__PURE__ */ i("div", { className: "cms-file-picker__top", children: [
|
|
852
852
|
t.length > 1 ? /* @__PURE__ */ i("label", { className: "cms-file-picker__space", children: [
|
|
853
|
-
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children:
|
|
853
|
+
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: r.space }),
|
|
854
854
|
/* @__PURE__ */ e("select", { className: "cms-input cms-select", value: o, onChange: (N) => {
|
|
855
855
|
p(N.target.value), f("");
|
|
856
856
|
}, children: t.map((N) => /* @__PURE__ */ e("option", { value: N.id, children: N.name }, N.id)) })
|
|
857
857
|
] }) : null,
|
|
858
|
-
/* @__PURE__ */ i("nav", { className: "cms-file-picker__path", "aria-label":
|
|
859
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label":
|
|
858
|
+
/* @__PURE__ */ i("nav", { className: "cms-file-picker__path", "aria-label": r.path, children: [
|
|
859
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": r.up, disabled: h === "", onClick: J, children: /* @__PURE__ */ e(L, { name: "chevron-left" }) }),
|
|
860
860
|
/* @__PURE__ */ i("ol", { children: [
|
|
861
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": h === "" ? "location" : void 0, onClick: () => f(""), children:
|
|
862
|
-
|
|
863
|
-
const O =
|
|
861
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": h === "" ? "location" : void 0, onClick: () => f(""), children: P }) }),
|
|
862
|
+
I.map((N, S) => {
|
|
863
|
+
const O = I.slice(0, S + 1).join("/");
|
|
864
864
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": O === h ? "location" : void 0, onClick: () => f(O), children: N }) }, O);
|
|
865
865
|
})
|
|
866
866
|
] })
|
|
867
867
|
] }),
|
|
868
|
-
U.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": D, onClick: () => Z((N) => !N), children:
|
|
868
|
+
U.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": D, onClick: () => Z((N) => !N), children: r.selected(U.length) }) : null
|
|
869
869
|
] }),
|
|
870
870
|
D && U.length > 0 ? /* @__PURE__ */ i("div", { className: "cms-file-picker__chosen", children: [
|
|
871
871
|
/* @__PURE__ */ e("ul", { children: [...C.entries()].map(([N, S]) => /* @__PURE__ */ i("li", { children: [
|
|
872
872
|
/* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: S.name }),
|
|
873
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label":
|
|
873
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": r.remove(S.name), onClick: () => fe(N), children: /* @__PURE__ */ e(G, { name: "close" }) })
|
|
874
874
|
] }, N)) }),
|
|
875
875
|
/* @__PURE__ */ e(he, { variant: "secondary", onClick: () => {
|
|
876
876
|
w(/* @__PURE__ */ new Map()), Z(!1);
|
|
877
|
-
}, children:
|
|
877
|
+
}, children: r.clear })
|
|
878
878
|
] }) : null,
|
|
879
879
|
/* @__PURE__ */ i("div", { className: "cms-file-picker__list", onScroll: (N) => {
|
|
880
880
|
const S = N.currentTarget;
|
|
881
881
|
S.scrollTop + S.clientHeight >= S.scrollHeight - En && z();
|
|
882
882
|
}, children: [
|
|
883
|
-
d.status === "loading" ? /* @__PURE__ */ e(me, { kind: "loading", title:
|
|
884
|
-
d.status === "error" ? /* @__PURE__ */ e(me, { kind: "error", title:
|
|
883
|
+
d.status === "loading" ? /* @__PURE__ */ e(me, { kind: "loading", title: r.loading, placement: "block" }) : null,
|
|
884
|
+
d.status === "error" ? /* @__PURE__ */ e(me, { kind: "error", title: r.error, placement: "block", action: { label: r.retry, onAction: () => {
|
|
885
885
|
M.current = !1, x((N) => N + 1);
|
|
886
886
|
} } }) : null,
|
|
887
|
-
d.status === "denied" ? /* @__PURE__ */ e(me, { kind: "denied", title:
|
|
888
|
-
d.status === "ready" && ee.length === 0 ? /* @__PURE__ */ e(me, { kind: "empty", title:
|
|
887
|
+
d.status === "denied" ? /* @__PURE__ */ e(me, { kind: "denied", title: r.denied, placement: "block" }) : null,
|
|
888
|
+
d.status === "ready" && ee.length === 0 ? /* @__PURE__ */ e(me, { kind: "empty", title: r.empty, placement: "block" }) : null,
|
|
889
889
|
/* @__PURE__ */ i(
|
|
890
890
|
"div",
|
|
891
891
|
{
|
|
892
892
|
ref: V,
|
|
893
893
|
role: "listbox",
|
|
894
894
|
"aria-multiselectable": "true",
|
|
895
|
-
"aria-label":
|
|
895
|
+
"aria-label": r.files,
|
|
896
896
|
"aria-activedescendant": ee.length > 0 ? ne(b) : void 0,
|
|
897
897
|
tabIndex: 0,
|
|
898
898
|
className: "cms-file-picker__entries",
|
|
@@ -908,7 +908,7 @@ function bl(n) {
|
|
|
908
908
|
role: "option",
|
|
909
909
|
"aria-selected": N.kind === "file" ? O : void 0,
|
|
910
910
|
"aria-disabled": Y !== null || void 0,
|
|
911
|
-
className:
|
|
911
|
+
className: $("cms-file-picker__entry", S === b && "is-active", O && "is-ticked", Y !== null && "is-disabled"),
|
|
912
912
|
onClick: () => {
|
|
913
913
|
y(S), N.kind === "folder" ? oe(N) : ie(N);
|
|
914
914
|
},
|
|
@@ -919,13 +919,13 @@ function bl(n) {
|
|
|
919
919
|
/* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: N.name }),
|
|
920
920
|
Y !== null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__reason", children: Y }) : null
|
|
921
921
|
] }),
|
|
922
|
-
N.kind === "file" && N.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children:
|
|
922
|
+
N.kind === "file" && N.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children: m(N.size) }) : null
|
|
923
923
|
]
|
|
924
924
|
},
|
|
925
925
|
N.id
|
|
926
926
|
);
|
|
927
927
|
}),
|
|
928
|
-
d.status === "ready" && d.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(me, { kind: "loading", title:
|
|
928
|
+
d.status === "ready" && d.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(me, { kind: "loading", title: r.loading, placement: "inline" }) }) : null
|
|
929
929
|
]
|
|
930
930
|
}
|
|
931
931
|
)
|
|
@@ -943,27 +943,27 @@ function An(n, l) {
|
|
|
943
943
|
return l.scrollTop <= 0;
|
|
944
944
|
}
|
|
945
945
|
function Tn(n, l) {
|
|
946
|
-
const [t,
|
|
946
|
+
const [t, a] = T(0), c = H(l);
|
|
947
947
|
return c.current = l, Q(() => {
|
|
948
948
|
const s = n.current;
|
|
949
949
|
if (s === null) return;
|
|
950
|
-
let
|
|
951
|
-
const
|
|
952
|
-
|
|
950
|
+
let m = null, r = 0;
|
|
951
|
+
const u = (p) => {
|
|
952
|
+
m = An(p.target, s) && p.touches.length === 1 ? p.touches[0].clientY : null, r = 0;
|
|
953
953
|
}, v = (p) => {
|
|
954
|
-
if (
|
|
955
|
-
const h = p.touches[0].clientY -
|
|
954
|
+
if (m === null || c.current === null) return;
|
|
955
|
+
const h = p.touches[0].clientY - m;
|
|
956
956
|
if (h <= 0) {
|
|
957
|
-
|
|
957
|
+
m = null, a(0);
|
|
958
958
|
return;
|
|
959
959
|
}
|
|
960
|
-
p.cancelable && p.preventDefault(),
|
|
960
|
+
p.cancelable && p.preventDefault(), r = Math.min(h * 0.6, De * 1.5), a(r);
|
|
961
961
|
}, o = () => {
|
|
962
962
|
var p;
|
|
963
|
-
|
|
963
|
+
m !== null && r >= De && ((p = c.current) == null || p.call(c)), m = null, r = 0, a(0);
|
|
964
964
|
};
|
|
965
|
-
return s.addEventListener("touchstart",
|
|
966
|
-
s.removeEventListener("touchstart",
|
|
965
|
+
return s.addEventListener("touchstart", u, { passive: !0 }), s.addEventListener("touchmove", v, { passive: !1 }), s.addEventListener("touchend", o), s.addEventListener("touchcancel", o), () => {
|
|
966
|
+
s.removeEventListener("touchstart", u), s.removeEventListener("touchmove", v), s.removeEventListener("touchend", o), s.removeEventListener("touchcancel", o);
|
|
967
967
|
};
|
|
968
968
|
}, [n]), t;
|
|
969
969
|
}
|
|
@@ -971,17 +971,17 @@ const Ye = sn(null);
|
|
|
971
971
|
function Dn() {
|
|
972
972
|
return tn(Ye);
|
|
973
973
|
}
|
|
974
|
-
function vl({ label: n, rows: l, error: t, onRetry:
|
|
974
|
+
function vl({ label: n, rows: l, error: t, onRetry: a, loadingText: c = "Loading", emptyTitle: s = "Nothing here yet", emptyHint: m, selected: r, onOpen: u, onRowMenu: v }) {
|
|
975
975
|
const o = H([]), p = Dn();
|
|
976
|
-
if (t != null) return /* @__PURE__ */ e(fn, { message: t, onRetry:
|
|
976
|
+
if (t != null) return /* @__PURE__ */ e(fn, { message: t, onRetry: a });
|
|
977
977
|
if (l === null) return /* @__PURE__ */ e(mn, { what: c, layout: "block" });
|
|
978
|
-
if (l.length === 0) return /* @__PURE__ */ e(hn, { title: s, hint:
|
|
978
|
+
if (l.length === 0) return /* @__PURE__ */ e(hn, { title: s, hint: m });
|
|
979
979
|
const h = (f, d, g) => {
|
|
980
980
|
var k;
|
|
981
981
|
if (f.key === "ArrowDown" || f.key === "ArrowUp")
|
|
982
982
|
f.preventDefault(), (k = o.current[Math.min(l.length - 1, Math.max(0, d + (f.key === "ArrowDown" ? 1 : -1)))]) == null || k.focus();
|
|
983
983
|
else if (f.key === "Enter")
|
|
984
|
-
|
|
984
|
+
u == null || u(g);
|
|
985
985
|
else if ((f.key === "ContextMenu" || f.shiftKey && f.key === "F10") && v) {
|
|
986
986
|
f.preventDefault();
|
|
987
987
|
const x = f.currentTarget.getBoundingClientRect();
|
|
@@ -994,7 +994,7 @@ function vl({ label: n, rows: l, error: t, onRetry: r, loadingText: c = "Loading
|
|
|
994
994
|
p.text != null ? /* @__PURE__ */ e("span", { className: "cms-list__pull-text", children: p.text }) : null
|
|
995
995
|
] }) : null,
|
|
996
996
|
/* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: l.map((f, d) => {
|
|
997
|
-
const g = f.id ===
|
|
997
|
+
const g = f.id === r;
|
|
998
998
|
return /* @__PURE__ */ i(
|
|
999
999
|
"li",
|
|
1000
1000
|
{
|
|
@@ -1003,9 +1003,9 @@ function vl({ label: n, rows: l, error: t, onRetry: r, loadingText: c = "Loading
|
|
|
1003
1003
|
},
|
|
1004
1004
|
role: "option",
|
|
1005
1005
|
"aria-selected": g,
|
|
1006
|
-
tabIndex: g ||
|
|
1007
|
-
className:
|
|
1008
|
-
onClick: () =>
|
|
1006
|
+
tabIndex: g || r == null && d === 0 ? 0 : -1,
|
|
1007
|
+
className: $("cms-list__row", g && "is-selected"),
|
|
1008
|
+
onClick: () => u == null ? void 0 : u(f.id),
|
|
1009
1009
|
onKeyDown: (k) => h(k, d, f.id),
|
|
1010
1010
|
onContextMenu: v ? (k) => {
|
|
1011
1011
|
k.preventDefault(), v(f.id, { x: k.clientX, y: k.clientY });
|
|
@@ -1013,7 +1013,7 @@ function vl({ label: n, rows: l, error: t, onRetry: r, loadingText: c = "Loading
|
|
|
1013
1013
|
children: [
|
|
1014
1014
|
f.lead != null ? /* @__PURE__ */ e("span", { className: "cms-list__lead", children: f.lead }) : null,
|
|
1015
1015
|
/* @__PURE__ */ i("span", { className: "cms-list__text", children: [
|
|
1016
|
-
/* @__PURE__ */ e("span", { className:
|
|
1016
|
+
/* @__PURE__ */ e("span", { className: $("cms-list__primary", f.unread === !0 && "is-unread"), children: f.primary }),
|
|
1017
1017
|
f.secondary != null ? /* @__PURE__ */ e("span", { className: "cms-list__secondary", children: f.secondary }) : null
|
|
1018
1018
|
] }),
|
|
1019
1019
|
f.meta != null || f.count !== void 0 ? /* @__PURE__ */ i("span", { className: "cms-list__end", children: [
|
|
@@ -1027,8 +1027,8 @@ function vl({ label: n, rows: l, error: t, onRetry: r, loadingText: c = "Loading
|
|
|
1027
1027
|
}) })
|
|
1028
1028
|
] });
|
|
1029
1029
|
}
|
|
1030
|
-
function ge({ at: n, items: l, onClose: t, label:
|
|
1031
|
-
const s = H(null),
|
|
1030
|
+
function ge({ at: n, items: l, onClose: t, label: a = "Actions", focus: c = "current" }) {
|
|
1031
|
+
const s = H(null), m = H(null), r = se(), [u, v] = T(n), o = l.filter((d) => d.offer.offered);
|
|
1032
1032
|
if (ve(() => {
|
|
1033
1033
|
if (!n) return;
|
|
1034
1034
|
const d = s.current, g = (d == null ? void 0 : d.offsetWidth) ?? 0, k = (d == null ? void 0 : d.offsetHeight) ?? 0;
|
|
@@ -1036,7 +1036,7 @@ function ge({ at: n, items: l, onClose: t, label: r = "Actions", focus: c = "cur
|
|
|
1036
1036
|
}, [n]), Q(() => {
|
|
1037
1037
|
var x, C;
|
|
1038
1038
|
if (!n) return;
|
|
1039
|
-
|
|
1039
|
+
m.current = document.activeElement;
|
|
1040
1040
|
const d = Array.from(((x = s.current) == null ? void 0 : x.querySelectorAll('[role^="menuitem"]:not([aria-disabled="true"])')) ?? []), g = c === "current" ? d.find((w) => w.getAttribute("aria-checked") === "true") : void 0;
|
|
1041
1041
|
(C = c === "last" ? d[d.length - 1] : g ?? d[0]) == null || C.focus();
|
|
1042
1042
|
const k = (w) => {
|
|
@@ -1045,7 +1045,7 @@ function ge({ at: n, items: l, onClose: t, label: r = "Actions", focus: c = "cur
|
|
|
1045
1045
|
};
|
|
1046
1046
|
return document.addEventListener("mousedown", k), () => {
|
|
1047
1047
|
var w, b;
|
|
1048
|
-
document.removeEventListener("mousedown", k), (b = (w =
|
|
1048
|
+
document.removeEventListener("mousedown", k), (b = (w = m.current) == null ? void 0 : w.focus) == null || b.call(w);
|
|
1049
1049
|
};
|
|
1050
1050
|
}, [n, t, c]), !n || o.length === 0) return null;
|
|
1051
1051
|
const p = (d) => {
|
|
@@ -1067,9 +1067,9 @@ function ge({ at: n, items: l, onClose: t, label: r = "Actions", focus: c = "cur
|
|
|
1067
1067
|
"aria-checked": d.checked,
|
|
1068
1068
|
tabIndex: -1,
|
|
1069
1069
|
"aria-disabled": g || void 0,
|
|
1070
|
-
"aria-describedby": g ? `${
|
|
1070
|
+
"aria-describedby": g ? `${r}-${d.id}` : void 0,
|
|
1071
1071
|
title: g ? d.offer.refusal : void 0,
|
|
1072
|
-
className:
|
|
1072
|
+
className: $("cms-menu__item", d.danger && "is-danger", d.offer.locked && "is-locked", g && "is-refused"),
|
|
1073
1073
|
onClick: () => {
|
|
1074
1074
|
g || (t(), d.onSelect());
|
|
1075
1075
|
},
|
|
@@ -1080,7 +1080,7 @@ function ge({ at: n, items: l, onClose: t, label: r = "Actions", focus: c = "cur
|
|
|
1080
1080
|
d.checked !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-menu__check", children: d.checked ? /* @__PURE__ */ e(G, { name: "check" }) : null }) : null,
|
|
1081
1081
|
d.offer.locked ? /* @__PURE__ */ e(G, { name: "lock" }) : null,
|
|
1082
1082
|
/* @__PURE__ */ e("span", { className: "cms-menu__label", children: d.label }),
|
|
1083
|
-
g ? /* @__PURE__ */ e("span", { id: `${
|
|
1083
|
+
g ? /* @__PURE__ */ e("span", { id: `${r}-${d.id}`, className: "cms-menu__refusal", children: d.offer.refusal }) : null
|
|
1084
1084
|
]
|
|
1085
1085
|
},
|
|
1086
1086
|
d.id
|
|
@@ -1090,15 +1090,15 @@ function ge({ at: n, items: l, onClose: t, label: r = "Actions", focus: c = "cur
|
|
|
1090
1090
|
const g = f[f.length - 1];
|
|
1091
1091
|
g !== void 0 && g.group === d.group ? g.items.push(d) : f.push({ group: d.group, items: [d] });
|
|
1092
1092
|
}
|
|
1093
|
-
return
|
|
1093
|
+
return Fe(
|
|
1094
1094
|
/* @__PURE__ */ e(
|
|
1095
1095
|
"div",
|
|
1096
1096
|
{
|
|
1097
1097
|
ref: s,
|
|
1098
1098
|
className: "cms-menu",
|
|
1099
1099
|
role: "menu",
|
|
1100
|
-
"aria-label":
|
|
1101
|
-
style: { left: (
|
|
1100
|
+
"aria-label": a,
|
|
1101
|
+
style: { left: (u ?? n).x, top: (u ?? n).y },
|
|
1102
1102
|
onKeyDown: p,
|
|
1103
1103
|
onContextMenu: (d) => d.preventDefault(),
|
|
1104
1104
|
children: f.map((d, g) => /* @__PURE__ */ i(an, { children: [
|
|
@@ -1113,13 +1113,13 @@ function ge({ at: n, items: l, onClose: t, label: r = "Actions", focus: c = "cur
|
|
|
1113
1113
|
document.body
|
|
1114
1114
|
);
|
|
1115
1115
|
}
|
|
1116
|
-
function gl({ title: n, icon: l, primary: t, more:
|
|
1116
|
+
function gl({ title: n, icon: l, primary: t, more: a = [], moreLabel: c, context: s, fullWidth: m = !1 }) {
|
|
1117
1117
|
var k, x, C;
|
|
1118
|
-
const [
|
|
1118
|
+
const [r, u] = T(null), v = se(), o = a.filter((w) => w.offer.offered), p = (k = t == null ? void 0 : t.offer) == null ? void 0 : k.refusal, h = t !== void 0 && (((x = t.offer) == null ? void 0 : x.offered) === !1 || p !== void 0), f = t !== void 0 && "menu" in t ? t.menu.filter((w) => w.offer.offered) : [], d = t !== void 0 && "menu" in t && f.length > 0 ? t : null, g = (w, b) => {
|
|
1119
1119
|
const y = b.getBoundingClientRect();
|
|
1120
|
-
|
|
1120
|
+
u((r == null ? void 0 : r.which) === w ? null : { which: w, x: y.left, y: y.bottom + 4 });
|
|
1121
1121
|
};
|
|
1122
|
-
return /* @__PURE__ */ i("header", { className: `cms-section-header${
|
|
1122
|
+
return /* @__PURE__ */ i("header", { className: `cms-section-header${m ? " cms-section-header--full" : ""}`, children: [
|
|
1123
1123
|
/* @__PURE__ */ i("div", { className: "cms-section-header__row", "data-row": "1", children: [
|
|
1124
1124
|
l !== void 0 ? /* @__PURE__ */ e(L, { name: l }) : null,
|
|
1125
1125
|
/* @__PURE__ */ e("h1", { className: "cms-section-header__title", title: n, children: n }),
|
|
@@ -1151,7 +1151,7 @@ function gl({ title: n, icon: l, primary: t, more: r = [], moreLabel: c, context
|
|
|
1151
1151
|
className: "cms-button cms-button--primary cms-section-header__split",
|
|
1152
1152
|
"data-action": "primary-menu",
|
|
1153
1153
|
"aria-haspopup": "menu",
|
|
1154
|
-
"aria-expanded": (
|
|
1154
|
+
"aria-expanded": (r == null ? void 0 : r.which) === "primary",
|
|
1155
1155
|
"aria-label": d.menuLabel,
|
|
1156
1156
|
onClick: (w) => g("primary", w.currentTarget),
|
|
1157
1157
|
children: /* @__PURE__ */ e(L, { name: "chevron-down" })
|
|
@@ -1166,7 +1166,7 @@ function gl({ title: n, icon: l, primary: t, more: r = [], moreLabel: c, context
|
|
|
1166
1166
|
className: "cms-section-header__more",
|
|
1167
1167
|
"data-action": "more",
|
|
1168
1168
|
"aria-haspopup": "menu",
|
|
1169
|
-
"aria-expanded": (
|
|
1169
|
+
"aria-expanded": (r == null ? void 0 : r.which) === "more",
|
|
1170
1170
|
"aria-label": c,
|
|
1171
1171
|
title: c,
|
|
1172
1172
|
onClick: (w) => g("more", w.currentTarget),
|
|
@@ -1176,24 +1176,30 @@ function gl({ title: n, icon: l, primary: t, more: r = [], moreLabel: c, context
|
|
|
1176
1176
|
] })
|
|
1177
1177
|
] }),
|
|
1178
1178
|
s != null ? /* @__PURE__ */ e("div", { className: "cms-section-header__context", "data-row": "2", children: s }) : null,
|
|
1179
|
-
d !== null ? /* @__PURE__ */ e(ge, { at: (
|
|
1180
|
-
/* @__PURE__ */ e(ge, { at: (
|
|
1179
|
+
d !== null ? /* @__PURE__ */ e(ge, { at: (r == null ? void 0 : r.which) === "primary" ? r : null, items: f, onClose: () => u(null), label: d.menuLabel }) : null,
|
|
1180
|
+
/* @__PURE__ */ e(ge, { at: (r == null ? void 0 : r.which) === "more" ? r : null, items: a, onClose: () => u(null), label: c })
|
|
1181
1181
|
] });
|
|
1182
1182
|
}
|
|
1183
|
-
function Nl({
|
|
1183
|
+
function Nl({ head: n, children: l, className: t, scrollRef: a, onScroll: c, bodyProps: s }) {
|
|
1184
|
+
return /* @__PURE__ */ i("div", { className: $("cms-column", t), children: [
|
|
1185
|
+
n == null ? null : /* @__PURE__ */ e("div", { className: "cms-column__head", children: n }),
|
|
1186
|
+
/* @__PURE__ */ e("div", { ...s, className: $("cms-column__body", s == null ? void 0 : s.className), ref: a, onScroll: c, children: l })
|
|
1187
|
+
] });
|
|
1188
|
+
}
|
|
1189
|
+
function wl({ title: n, scope: l, actions: t, backLink: a }) {
|
|
1184
1190
|
return /* @__PURE__ */ i("header", { className: "cms-page-header", children: [
|
|
1185
|
-
|
|
1191
|
+
a ? /* @__PURE__ */ i(
|
|
1186
1192
|
"a",
|
|
1187
1193
|
{
|
|
1188
1194
|
className: "cms-page-header__back",
|
|
1189
|
-
href:
|
|
1195
|
+
href: a.href ?? "#",
|
|
1190
1196
|
onClick: (c) => {
|
|
1191
|
-
|
|
1197
|
+
a.onBack && (c.preventDefault(), a.onBack());
|
|
1192
1198
|
},
|
|
1193
1199
|
children: [
|
|
1194
1200
|
/* @__PURE__ */ e(G, { name: "back" }),
|
|
1195
1201
|
" ",
|
|
1196
|
-
|
|
1202
|
+
a.label
|
|
1197
1203
|
]
|
|
1198
1204
|
}
|
|
1199
1205
|
) : null,
|
|
@@ -1206,36 +1212,36 @@ function Nl({ title: n, scope: l, actions: t, backLink: r }) {
|
|
|
1206
1212
|
] })
|
|
1207
1213
|
] });
|
|
1208
1214
|
}
|
|
1209
|
-
function
|
|
1210
|
-
const c = H([]), s = (
|
|
1215
|
+
function yl({ tabs: n, active: l, onSelect: t, label: a }) {
|
|
1216
|
+
const c = H([]), s = (m, r) => {
|
|
1211
1217
|
var p;
|
|
1212
|
-
const
|
|
1218
|
+
const u = n.length - 1, v = m.key === "ArrowRight" ? r === u ? 0 : r + 1 : m.key === "ArrowLeft" ? r === 0 ? u : r - 1 : m.key === "Home" ? 0 : m.key === "End" ? u : null;
|
|
1213
1219
|
if (v === null) return;
|
|
1214
|
-
|
|
1220
|
+
m.preventDefault();
|
|
1215
1221
|
const o = n[v];
|
|
1216
1222
|
o && (t(o.id), (p = c.current[v]) == null || p.focus());
|
|
1217
1223
|
};
|
|
1218
|
-
return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label":
|
|
1219
|
-
const
|
|
1224
|
+
return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": a, children: n.map((m, r) => {
|
|
1225
|
+
const u = m.id === l;
|
|
1220
1226
|
return /* @__PURE__ */ i(
|
|
1221
1227
|
"button",
|
|
1222
1228
|
{
|
|
1223
1229
|
ref: (v) => {
|
|
1224
|
-
c.current[
|
|
1230
|
+
c.current[r] = v;
|
|
1225
1231
|
},
|
|
1226
1232
|
type: "button",
|
|
1227
1233
|
role: "tab",
|
|
1228
|
-
className:
|
|
1229
|
-
"aria-selected":
|
|
1230
|
-
tabIndex:
|
|
1231
|
-
onClick: () => t(
|
|
1232
|
-
onKeyDown: (v) => s(v,
|
|
1234
|
+
className: $("cms-tab", u && "is-active"),
|
|
1235
|
+
"aria-selected": u,
|
|
1236
|
+
tabIndex: u ? 0 : -1,
|
|
1237
|
+
onClick: () => t(m.id),
|
|
1238
|
+
onKeyDown: (v) => s(v, r),
|
|
1233
1239
|
children: [
|
|
1234
|
-
|
|
1235
|
-
|
|
1240
|
+
m.label,
|
|
1241
|
+
m.count !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-tab__count", children: m.count }) : null
|
|
1236
1242
|
]
|
|
1237
1243
|
},
|
|
1238
|
-
|
|
1244
|
+
m.id
|
|
1239
1245
|
);
|
|
1240
1246
|
}) });
|
|
1241
1247
|
}
|
|
@@ -1252,19 +1258,19 @@ function $n(n) {
|
|
|
1252
1258
|
l = l * 31 + (t.codePointAt(0) ?? 0) >>> 0;
|
|
1253
1259
|
return l % 6 + 1;
|
|
1254
1260
|
}
|
|
1255
|
-
function Se({ name: n, pictureUrl: l, presence: t, connection:
|
|
1256
|
-
const u =
|
|
1261
|
+
function Se({ name: n, pictureUrl: l, presence: t, connection: a, deleted: c = !1, size: s = 32, tintSeed: m }) {
|
|
1262
|
+
const r = Ln(n) || "?", u = n.trim() === "" ? "?" : n, v = a !== void 0 ? `is-${a.state === "offline" ? "disconnected" : a.state}` : t === void 0 ? null : `is-${t === "busy" ? "away" : t}`, o = a !== void 0 ? `${u}, ${a.label}` : t ? `${u}, ${t}` : u;
|
|
1257
1263
|
return /* @__PURE__ */ i(
|
|
1258
1264
|
"span",
|
|
1259
1265
|
{
|
|
1260
|
-
className:
|
|
1266
|
+
className: $("cms-avatar", c ? "cms-avatar--deleted" : `cms-avatar--tint-${$n(m ?? n)}`),
|
|
1261
1267
|
style: { width: s, height: s, fontSize: Math.round(s * 0.4) },
|
|
1262
1268
|
role: "img",
|
|
1263
|
-
"aria-label":
|
|
1264
|
-
...
|
|
1269
|
+
"aria-label": o,
|
|
1270
|
+
...a === void 0 ? {} : { title: a.label },
|
|
1265
1271
|
children: [
|
|
1266
|
-
c ? /* @__PURE__ */ e(L, { name: "user", size: Math.round(s * 0.6) }) : l ? /* @__PURE__ */ e("img", { src: l, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ e("span", { "aria-hidden": "true", children:
|
|
1267
|
-
|
|
1272
|
+
c ? /* @__PURE__ */ e(L, { name: "user", size: Math.round(s * 0.6) }) : l ? /* @__PURE__ */ e("img", { src: l, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ e("span", { "aria-hidden": "true", children: r }),
|
|
1273
|
+
v === null ? null : /* @__PURE__ */ e("span", { className: $("cms-avatar__presence", v), "aria-hidden": "true" })
|
|
1268
1274
|
]
|
|
1269
1275
|
}
|
|
1270
1276
|
);
|
|
@@ -1280,22 +1286,22 @@ function Le(n) {
|
|
|
1280
1286
|
return null;
|
|
1281
1287
|
}
|
|
1282
1288
|
}
|
|
1283
|
-
function
|
|
1289
|
+
function Fn(n, l) {
|
|
1284
1290
|
if (n !== void 0)
|
|
1285
1291
|
try {
|
|
1286
1292
|
window.localStorage.setItem(Re + n, String(l));
|
|
1287
1293
|
} catch {
|
|
1288
1294
|
}
|
|
1289
1295
|
}
|
|
1290
|
-
function
|
|
1296
|
+
function Bn(n) {
|
|
1291
1297
|
if (n !== void 0)
|
|
1292
1298
|
try {
|
|
1293
1299
|
window.localStorage.removeItem(Re + n);
|
|
1294
1300
|
} catch {
|
|
1295
1301
|
}
|
|
1296
1302
|
}
|
|
1297
|
-
function
|
|
1298
|
-
const o = Math.max(
|
|
1303
|
+
function Pn({ storageKey: n, value: l, default: t, min: a, max: c, step: s = 16, label: m, onChange: r, className: u, style: v }) {
|
|
1304
|
+
const o = Math.max(a, c), p = (b) => Math.round(Math.min(Math.max(b, a), o)), [h, f] = T(() => {
|
|
1299
1305
|
const b = n === void 0 ? null : Le(n);
|
|
1300
1306
|
return p(b ?? t);
|
|
1301
1307
|
}), d = p(l ?? h), g = H(null), [k, x] = T(!1);
|
|
@@ -1304,13 +1310,13 @@ function Bn({ storageKey: n, value: l, default: t, min: r, max: c, step: s = 16,
|
|
|
1304
1310
|
const b = Le(n);
|
|
1305
1311
|
if (b === null) return;
|
|
1306
1312
|
const y = p(b);
|
|
1307
|
-
(l === void 0 || y !== p(l)) && (f(y),
|
|
1313
|
+
(l === void 0 || y !== p(l)) && (f(y), r(y, !0));
|
|
1308
1314
|
}, []), ve(() => {
|
|
1309
|
-
l !== void 0 && p(l) !== l &&
|
|
1310
|
-
}, [l,
|
|
1315
|
+
l !== void 0 && p(l) !== l && r(p(l), !0);
|
|
1316
|
+
}, [l, a, o]);
|
|
1311
1317
|
const C = (b, y) => {
|
|
1312
1318
|
const D = p(b);
|
|
1313
|
-
f(D), y &&
|
|
1319
|
+
f(D), y && Fn(n, D), r(D, y);
|
|
1314
1320
|
}, w = () => {
|
|
1315
1321
|
const b = g.current;
|
|
1316
1322
|
g.current = null, x(!1), b !== null && b.last !== b.from && C(b.last, !0);
|
|
@@ -1321,11 +1327,11 @@ function Bn({ storageKey: n, value: l, default: t, min: r, max: c, step: s = 16,
|
|
|
1321
1327
|
role: "separator",
|
|
1322
1328
|
tabIndex: 0,
|
|
1323
1329
|
"aria-orientation": "vertical",
|
|
1324
|
-
"aria-label":
|
|
1330
|
+
"aria-label": m,
|
|
1325
1331
|
"aria-valuenow": d,
|
|
1326
|
-
"aria-valuemin":
|
|
1332
|
+
"aria-valuemin": a,
|
|
1327
1333
|
"aria-valuemax": o,
|
|
1328
|
-
className:
|
|
1334
|
+
className: $("cms-splitter", k && "is-dragging", d <= a && "is-at-min", d >= o && "is-at-max", u),
|
|
1329
1335
|
style: v,
|
|
1330
1336
|
onPointerDown: (b) => {
|
|
1331
1337
|
var D, Z;
|
|
@@ -1341,12 +1347,12 @@ function Bn({ storageKey: n, value: l, default: t, min: r, max: c, step: s = 16,
|
|
|
1341
1347
|
onPointerUp: w,
|
|
1342
1348
|
onPointerCancel: w,
|
|
1343
1349
|
onDoubleClick: () => {
|
|
1344
|
-
|
|
1350
|
+
Bn(n);
|
|
1345
1351
|
const b = p(t);
|
|
1346
|
-
f(b),
|
|
1352
|
+
f(b), r(b, !0);
|
|
1347
1353
|
},
|
|
1348
1354
|
onKeyDown: (b) => {
|
|
1349
|
-
const y = b.shiftKey ? In : s, D = getComputedStyle(b.currentTarget).direction === "rtl" ? -1 : 1, Z = b.key === "ArrowLeft" ? d - D * y : b.key === "ArrowRight" ? d + D * y : b.key === "Home" ?
|
|
1355
|
+
const y = b.shiftKey ? In : s, D = getComputedStyle(b.currentTarget).direction === "rtl" ? -1 : 1, Z = b.key === "ArrowLeft" ? d - D * y : b.key === "ArrowRight" ? d + D * y : b.key === "Home" ? a : b.key === "End" ? o : null;
|
|
1350
1356
|
Z !== null && (b.preventDefault(), C(Z, !0));
|
|
1351
1357
|
}
|
|
1352
1358
|
}
|
|
@@ -1358,17 +1364,17 @@ function Rn({ count: n, label: l, max: t = 99 }) {
|
|
|
1358
1364
|
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: l })
|
|
1359
1365
|
] });
|
|
1360
1366
|
}
|
|
1361
|
-
function
|
|
1367
|
+
function kl({ product: n, mark: l, rail: t, active: a, onNavigate: c, server: s, search: m, account: r, children: u, railLabel: v = "Sections" }) {
|
|
1362
1368
|
return /* @__PURE__ */ i("div", { className: "cms-shell", children: [
|
|
1363
1369
|
/* @__PURE__ */ i("nav", { className: "cms-shell__rail", "aria-label": v, children: [
|
|
1364
1370
|
/* @__PURE__ */ e("span", { className: "cms-shell__mark", "aria-hidden": "true", children: l }),
|
|
1365
1371
|
/* @__PURE__ */ e("ul", { className: "cms-shell__items", children: t.map((o) => {
|
|
1366
|
-
const p = o.id ===
|
|
1372
|
+
const p = o.id === a;
|
|
1367
1373
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
1368
1374
|
"a",
|
|
1369
1375
|
{
|
|
1370
1376
|
href: o.href,
|
|
1371
|
-
className:
|
|
1377
|
+
className: $("cms-shell__item", p && "is-active"),
|
|
1372
1378
|
"aria-current": p ? "page" : void 0,
|
|
1373
1379
|
title: o.label,
|
|
1374
1380
|
onClick: (h) => {
|
|
@@ -1388,13 +1394,13 @@ function yl({ product: n, mark: l, rail: t, active: r, onNavigate: c, server: s,
|
|
|
1388
1394
|
/* @__PURE__ */ i("header", { className: "cms-shell__top", children: [
|
|
1389
1395
|
/* @__PURE__ */ e("span", { className: "cms-shell__product", children: n }),
|
|
1390
1396
|
s != null ? /* @__PURE__ */ e("div", { className: "cms-shell__server", children: s }) : null,
|
|
1391
|
-
|
|
1392
|
-
|
|
1397
|
+
m != null ? /* @__PURE__ */ e("div", { className: "cms-shell__search", children: m }) : null,
|
|
1398
|
+
r != null ? /* @__PURE__ */ e("div", { className: "cms-shell__account", children: r }) : null
|
|
1393
1399
|
] }),
|
|
1394
|
-
/* @__PURE__ */ e("main", { className: "cms-shell__main", children:
|
|
1400
|
+
/* @__PURE__ */ e("main", { className: "cms-shell__main", children: u })
|
|
1395
1401
|
] });
|
|
1396
1402
|
}
|
|
1397
|
-
function
|
|
1403
|
+
function xl({ label: n, placeholder: l, value: t, onChange: a, onSearch: c }) {
|
|
1398
1404
|
return /* @__PURE__ */ i(
|
|
1399
1405
|
"form",
|
|
1400
1406
|
{
|
|
@@ -1413,7 +1419,7 @@ function kl({ label: n, placeholder: l, value: t, onChange: r, onSearch: c }) {
|
|
|
1413
1419
|
"aria-label": n,
|
|
1414
1420
|
placeholder: l,
|
|
1415
1421
|
value: t,
|
|
1416
|
-
onChange: (s) =>
|
|
1422
|
+
onChange: (s) => a(s.target.value)
|
|
1417
1423
|
}
|
|
1418
1424
|
)
|
|
1419
1425
|
]
|
|
@@ -1421,18 +1427,18 @@ function kl({ label: n, placeholder: l, value: t, onChange: r, onSearch: c }) {
|
|
|
1421
1427
|
);
|
|
1422
1428
|
}
|
|
1423
1429
|
function Hn(n, l, t) {
|
|
1424
|
-
const
|
|
1425
|
-
let c =
|
|
1426
|
-
for (let s =
|
|
1427
|
-
const
|
|
1428
|
-
|
|
1430
|
+
const a = n.map((s) => Math.min(Math.max(s.width, s.min), s.max));
|
|
1431
|
+
let c = a.reduce((s, m) => s + m, 0) + t - l;
|
|
1432
|
+
for (let s = a.length - 1; s >= 0 && c > 0; s -= 1) {
|
|
1433
|
+
const m = Math.min(c, a[s] - n[s].min);
|
|
1434
|
+
a[s] = a[s] - m, c -= m;
|
|
1429
1435
|
}
|
|
1430
|
-
return
|
|
1436
|
+
return a;
|
|
1431
1437
|
}
|
|
1432
|
-
function
|
|
1433
|
-
const
|
|
1438
|
+
function Ml({ panes: n, active: l, back: t, sizes: a, lastMin: c = 360, onResize: s, storageKey: m }) {
|
|
1439
|
+
const r = Math.min(Math.max(l ?? n.length - 1, 0), n.length - 1), u = H(null), [v, o] = T(0), p = (a ?? []).slice(0, n.length - 1), [h, f] = T(() => m === void 0 ? [] : p.map((b, y) => Le(`${m}:${String(y)}`) ?? void 0)), [d, g] = T(!1), k = p.map((b, y) => b !== void 0 && h[y] !== void 0 ? { ...b, width: h[y] } : b), x = k.length === n.length - 1 && k.every((b) => b !== void 0);
|
|
1434
1440
|
ve(() => {
|
|
1435
|
-
const b =
|
|
1441
|
+
const b = u.current;
|
|
1436
1442
|
if (b === null || !x) return;
|
|
1437
1443
|
const y = () => o(b.clientWidth);
|
|
1438
1444
|
if (y(), typeof ResizeObserver > "u") return;
|
|
@@ -1446,13 +1452,13 @@ function xl({ panes: n, active: l, back: t, sizes: r, lastMin: c = 360, onResize
|
|
|
1446
1452
|
return /* @__PURE__ */ i(
|
|
1447
1453
|
"div",
|
|
1448
1454
|
{
|
|
1449
|
-
ref:
|
|
1450
|
-
className:
|
|
1451
|
-
"data-active":
|
|
1455
|
+
ref: u,
|
|
1456
|
+
className: $("cms-panes", n.length === 3 ? "cms-panes--three" : "cms-panes--two", x && "cms-panes--sized", d && "is-resizing"),
|
|
1457
|
+
"data-active": r,
|
|
1452
1458
|
style: w,
|
|
1453
1459
|
children: [
|
|
1454
|
-
n.map((b, y) => /* @__PURE__ */ i("section", { className: "cms-panes__pane", "aria-label": b.label, "data-offset":
|
|
1455
|
-
y ===
|
|
1460
|
+
n.map((b, y) => /* @__PURE__ */ i("section", { className: "cms-panes__pane", "aria-label": b.label, "data-offset": r - y, children: [
|
|
1461
|
+
y === r && t ? /* @__PURE__ */ i("a", { className: "cms-panes__back", href: t.href, children: [
|
|
1456
1462
|
/* @__PURE__ */ e(L, { name: "chevron-left", size: 18 }),
|
|
1457
1463
|
t.label
|
|
1458
1464
|
] }) : null,
|
|
@@ -1461,9 +1467,9 @@ function xl({ panes: n, active: l, back: t, sizes: r, lastMin: c = 360, onResize
|
|
|
1461
1467
|
x ? k.map((b, y) => {
|
|
1462
1468
|
const D = C.reduce((V, M, R) => R === y ? V : V + M, 0), Z = Math.max(b.min, Math.min(b.max, v > 0 ? v - D - c : b.max));
|
|
1463
1469
|
return /* @__PURE__ */ e(
|
|
1464
|
-
|
|
1470
|
+
Pn,
|
|
1465
1471
|
{
|
|
1466
|
-
...
|
|
1472
|
+
...m === void 0 ? {} : { storageKey: `${m}:${String(y)}` },
|
|
1467
1473
|
value: C[y],
|
|
1468
1474
|
default: b.reset,
|
|
1469
1475
|
min: b.min,
|
|
@@ -1472,7 +1478,7 @@ function xl({ panes: n, active: l, back: t, sizes: r, lastMin: c = 360, onResize
|
|
|
1472
1478
|
className: "cms-panes__splitter",
|
|
1473
1479
|
style: { "--split-at": `var(--split-pane-end-${String(y)})` },
|
|
1474
1480
|
onChange: (V, M) => {
|
|
1475
|
-
|
|
1481
|
+
m !== void 0 && f((R) => {
|
|
1476
1482
|
const z = [...R];
|
|
1477
1483
|
return z[y] = V, z;
|
|
1478
1484
|
}), g(!M), s == null || s(y, V, M);
|
|
@@ -1486,29 +1492,29 @@ function xl({ panes: n, active: l, back: t, sizes: r, lastMin: c = 360, onResize
|
|
|
1486
1492
|
);
|
|
1487
1493
|
}
|
|
1488
1494
|
const On = { attachment: "Has an attachment", unread: "Unread" };
|
|
1489
|
-
function
|
|
1495
|
+
function Cl({ from: n, subject: l, preview: t, time: a, unread: c, hasAttachment: s, selected: m, onOpen: r, check: u, selecting: v, labels: o }) {
|
|
1490
1496
|
const p = ye(On, o), h = /* @__PURE__ */ e(Se, { name: n, size: 40 });
|
|
1491
|
-
return /* @__PURE__ */ i("div", { className:
|
|
1492
|
-
|
|
1497
|
+
return /* @__PURE__ */ i("div", { className: $("cms-mail-row", c && "is-unread", m && "is-selected", v && "is-selecting", (u == null ? void 0 : u.checked) && "is-checked"), children: [
|
|
1498
|
+
u !== void 0 ? /* @__PURE__ */ i("span", { className: "cms-mail-row__lead", children: [
|
|
1493
1499
|
h,
|
|
1494
1500
|
/* @__PURE__ */ e(
|
|
1495
1501
|
"input",
|
|
1496
1502
|
{
|
|
1497
1503
|
type: "checkbox",
|
|
1498
1504
|
className: "cms-mail-row__check",
|
|
1499
|
-
checked:
|
|
1500
|
-
disabled:
|
|
1501
|
-
"aria-disabled":
|
|
1502
|
-
"aria-busy":
|
|
1503
|
-
"aria-label":
|
|
1505
|
+
checked: u.checked,
|
|
1506
|
+
disabled: u.disabled,
|
|
1507
|
+
"aria-disabled": u.pending ? "true" : void 0,
|
|
1508
|
+
"aria-busy": u.pending ? "true" : void 0,
|
|
1509
|
+
"aria-label": u.label,
|
|
1504
1510
|
onChange: () => {
|
|
1505
1511
|
},
|
|
1506
1512
|
onClick: (f) => {
|
|
1507
|
-
if (f.stopPropagation(),
|
|
1513
|
+
if (f.stopPropagation(), u.pending) {
|
|
1508
1514
|
f.preventDefault();
|
|
1509
1515
|
return;
|
|
1510
1516
|
}
|
|
1511
|
-
|
|
1517
|
+
u.onCheck({ shift: f.shiftKey, toggle: f.ctrlKey || f.metaKey });
|
|
1512
1518
|
}
|
|
1513
1519
|
}
|
|
1514
1520
|
)
|
|
@@ -1518,15 +1524,15 @@ function Ml({ from: n, subject: l, preview: t, time: r, unread: c, hasAttachment
|
|
|
1518
1524
|
{
|
|
1519
1525
|
type: "button",
|
|
1520
1526
|
className: "cms-mail-row__open",
|
|
1521
|
-
"aria-current":
|
|
1522
|
-
onClick:
|
|
1527
|
+
"aria-current": m ? "true" : void 0,
|
|
1528
|
+
onClick: r,
|
|
1523
1529
|
children: [
|
|
1524
|
-
|
|
1530
|
+
u === void 0 ? h : null,
|
|
1525
1531
|
/* @__PURE__ */ i("span", { className: "cms-mail-row__body", children: [
|
|
1526
1532
|
/* @__PURE__ */ i("span", { className: "cms-mail-row__line", children: [
|
|
1527
1533
|
/* @__PURE__ */ e("span", { className: "cms-mail-row__from", children: n }),
|
|
1528
1534
|
s ? /* @__PURE__ */ e(L, { name: "paperclip", size: 16, label: p.attachment }) : null,
|
|
1529
|
-
/* @__PURE__ */ e("span", { className: "cms-mail-row__time", children:
|
|
1535
|
+
/* @__PURE__ */ e("span", { className: "cms-mail-row__time", children: a })
|
|
1530
1536
|
] }),
|
|
1531
1537
|
/* @__PURE__ */ i("span", { className: "cms-mail-row__line", children: [
|
|
1532
1538
|
/* @__PURE__ */ e("span", { className: "cms-mail-row__subject", children: l }),
|
|
@@ -1539,43 +1545,43 @@ function Ml({ from: n, subject: l, preview: t, time: r, unread: c, hasAttachment
|
|
|
1539
1545
|
)
|
|
1540
1546
|
] });
|
|
1541
1547
|
}
|
|
1542
|
-
function
|
|
1543
|
-
return /* @__PURE__ */ i("div", { className:
|
|
1548
|
+
function Sl({ direction: n, children: l, time: t, read: a, readLabel: c = "Read" }) {
|
|
1549
|
+
return /* @__PURE__ */ i("div", { className: $("cms-bubble", `cms-bubble--${n}`), children: [
|
|
1544
1550
|
/* @__PURE__ */ e("div", { className: "cms-bubble__text", children: l }),
|
|
1545
1551
|
/* @__PURE__ */ i("div", { className: "cms-bubble__meta", children: [
|
|
1546
1552
|
t,
|
|
1547
|
-
n === "out" &&
|
|
1553
|
+
n === "out" && a ? /* @__PURE__ */ i(A, { children: [
|
|
1548
1554
|
" · ",
|
|
1549
1555
|
c
|
|
1550
1556
|
] }) : null
|
|
1551
1557
|
] })
|
|
1552
1558
|
] });
|
|
1553
1559
|
}
|
|
1554
|
-
function
|
|
1560
|
+
function El({ label: n, value: l, onChange: t, onSend: a, onAttach: c, placeholder: s, variant: m = "chat", sendLabel: r = "Send", attachLabel: u = "Attach a file", leading: v, canSend: o }) {
|
|
1555
1561
|
const p = se(), h = o ?? l.trim() !== "", f = (g) => {
|
|
1556
|
-
g.preventDefault(), h &&
|
|
1557
|
-
}, d = c ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label":
|
|
1558
|
-
return /* @__PURE__ */ i("form", { className:
|
|
1559
|
-
/* @__PURE__ */ e("label", { htmlFor: p, className:
|
|
1560
|
-
|
|
1562
|
+
g.preventDefault(), h && a();
|
|
1563
|
+
}, d = c ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": u, onClick: c, children: /* @__PURE__ */ e(L, { name: "paperclip" }) }) : null;
|
|
1564
|
+
return /* @__PURE__ */ i("form", { className: $("cms-composer", `cms-composer--${m}`), onSubmit: f, children: [
|
|
1565
|
+
/* @__PURE__ */ e("label", { htmlFor: p, className: m === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: n }),
|
|
1566
|
+
m === "chat" ? d : null,
|
|
1561
1567
|
/* @__PURE__ */ e(
|
|
1562
1568
|
"textarea",
|
|
1563
1569
|
{
|
|
1564
1570
|
id: p,
|
|
1565
1571
|
className: "cms-composer__input",
|
|
1566
|
-
rows:
|
|
1572
|
+
rows: m === "reply" ? 3 : 1,
|
|
1567
1573
|
placeholder: s,
|
|
1568
1574
|
value: l,
|
|
1569
1575
|
onChange: (g) => t(g.target.value),
|
|
1570
1576
|
onKeyDown: (g) => {
|
|
1571
|
-
g.nativeEvent.isComposing || g.keyCode === 229 ||
|
|
1577
|
+
g.nativeEvent.isComposing || g.keyCode === 229 || m === "chat" && g.key === "Enter" && !g.shiftKey && (g.preventDefault(), h && a());
|
|
1572
1578
|
}
|
|
1573
1579
|
}
|
|
1574
1580
|
),
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1581
|
+
m === "reply" && v !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-composer__leading", children: v }) : null,
|
|
1582
|
+
m === "reply" ? d : null,
|
|
1583
|
+
m === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": r, disabled: !h, children: /* @__PURE__ */ e(L, { name: "send" }) }) : /* @__PURE__ */ i("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !h, children: [
|
|
1584
|
+
r,
|
|
1579
1585
|
" ",
|
|
1580
1586
|
/* @__PURE__ */ e(L, { name: "send", size: 18 })
|
|
1581
1587
|
] })
|
|
@@ -1602,24 +1608,24 @@ const He = {
|
|
|
1602
1608
|
onCallWith: (n) => `On a call with ${n}`,
|
|
1603
1609
|
returnToCall: "Return to call"
|
|
1604
1610
|
};
|
|
1605
|
-
function
|
|
1606
|
-
const s = ye(He, c),
|
|
1607
|
-
return /* @__PURE__ */ i("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": s.incomingFrom(
|
|
1611
|
+
function Al({ name: n, media: l, onAccept: t, onDecline: a, labels: c }) {
|
|
1612
|
+
const s = ye(He, c), m = l === "video" ? s.incomingVideo : s.incomingAudio;
|
|
1613
|
+
return /* @__PURE__ */ i("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": s.incomingFrom(m, n), children: [
|
|
1608
1614
|
/* @__PURE__ */ e("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ e(Se, { name: n, size: 112 }) }),
|
|
1609
1615
|
/* @__PURE__ */ e("p", { className: "cms-call-incoming__name", children: n }),
|
|
1610
|
-
/* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children:
|
|
1616
|
+
/* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children: m }),
|
|
1611
1617
|
/* @__PURE__ */ i("div", { className: "cms-call-incoming__actions", children: [
|
|
1612
|
-
/* @__PURE__ */ e(_e, { icon: "phone-off", label: s.decline, tone: "hang-up", onClick:
|
|
1618
|
+
/* @__PURE__ */ e(_e, { icon: "phone-off", label: s.decline, tone: "hang-up", onClick: a }),
|
|
1613
1619
|
/* @__PURE__ */ e(_e, { icon: "phone", label: s.accept, tone: "accept", onClick: t })
|
|
1614
1620
|
] })
|
|
1615
1621
|
] });
|
|
1616
1622
|
}
|
|
1617
|
-
function _e({ icon: n, label: l, onClick: t, tone:
|
|
1623
|
+
function _e({ icon: n, label: l, onClick: t, tone: a = "plain", pressed: c }) {
|
|
1618
1624
|
return /* @__PURE__ */ i(
|
|
1619
1625
|
"button",
|
|
1620
1626
|
{
|
|
1621
1627
|
type: "button",
|
|
1622
|
-
className:
|
|
1628
|
+
className: $("cms-call-button", `cms-call-button--${a}`, c && "is-pressed"),
|
|
1623
1629
|
"aria-pressed": c,
|
|
1624
1630
|
onClick: t,
|
|
1625
1631
|
children: [
|
|
@@ -1629,7 +1635,7 @@ function _e({ icon: n, label: l, onClick: t, tone: r = "plain", pressed: c }) {
|
|
|
1629
1635
|
}
|
|
1630
1636
|
);
|
|
1631
1637
|
}
|
|
1632
|
-
function
|
|
1638
|
+
function Tl({ name: n, duration: l, connection: t, you: a, muted: c, speaker: s, onToggleMute: m, onToggleSpeaker: r, onAddPerson: u, onChat: v, onHangUp: o, labels: p }) {
|
|
1633
1639
|
const h = ye(He, p);
|
|
1634
1640
|
return /* @__PURE__ */ i("section", { className: "cms-call-panel", "aria-label": h.callWith(n), children: [
|
|
1635
1641
|
/* @__PURE__ */ i("div", { className: "cms-call-panel__head", children: [
|
|
@@ -1638,36 +1644,36 @@ function Al({ name: n, duration: l, connection: t, you: r, muted: c, speaker: s,
|
|
|
1638
1644
|
/* @__PURE__ */ e("p", { className: "cms-call-panel__name", children: n }),
|
|
1639
1645
|
/* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label": h.callTime(l), children: l })
|
|
1640
1646
|
] }),
|
|
1641
|
-
/* @__PURE__ */ e("span", { className:
|
|
1647
|
+
/* @__PURE__ */ e("span", { className: $("cms-pill", t === "good" ? "cms-pill--success" : "cms-pill--warning"), children: t === "good" ? h.goodConnection : h.poorConnection })
|
|
1642
1648
|
] }),
|
|
1643
1649
|
/* @__PURE__ */ i("div", { className: "cms-call-panel__you", children: [
|
|
1644
|
-
/* @__PURE__ */ e(Se, { name:
|
|
1650
|
+
/* @__PURE__ */ e(Se, { name: a.name, size: 36 }),
|
|
1645
1651
|
/* @__PURE__ */ e("span", { children: h.you }),
|
|
1646
|
-
|
|
1652
|
+
a.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label": h.speaking }) : null
|
|
1647
1653
|
] }),
|
|
1648
1654
|
/* @__PURE__ */ i("div", { className: "cms-call-panel__controls", children: [
|
|
1649
|
-
/* @__PURE__ */ e(_e, { icon: "mic", label: c ? h.unmute : h.mute, pressed: c, onClick:
|
|
1650
|
-
/* @__PURE__ */ e(_e, { icon: "speaker", label: h.speaker, pressed: s, onClick:
|
|
1651
|
-
|
|
1655
|
+
/* @__PURE__ */ e(_e, { icon: "mic", label: c ? h.unmute : h.mute, pressed: c, onClick: m }),
|
|
1656
|
+
/* @__PURE__ */ e(_e, { icon: "speaker", label: h.speaker, pressed: s, onClick: r }),
|
|
1657
|
+
u ? /* @__PURE__ */ e(_e, { icon: "user-plus", label: h.addPerson, onClick: u }) : null,
|
|
1652
1658
|
v ? /* @__PURE__ */ e(_e, { icon: "chat", label: h.chat, onClick: v }) : null,
|
|
1653
1659
|
/* @__PURE__ */ e(_e, { icon: "phone-off", label: h.hangUp, tone: "hang-up", onClick: o })
|
|
1654
1660
|
] })
|
|
1655
1661
|
] });
|
|
1656
1662
|
}
|
|
1657
|
-
function
|
|
1658
|
-
const
|
|
1659
|
-
return /* @__PURE__ */ i("section", { className: "cms-call-bar", "aria-label":
|
|
1663
|
+
function Dl({ name: n, duration: l, muted: t, onToggleMute: a, onReturn: c, onHangUp: s, labels: m }) {
|
|
1664
|
+
const r = ye(He, m);
|
|
1665
|
+
return /* @__PURE__ */ i("section", { className: "cms-call-bar", "aria-label": r.callWith(n), children: [
|
|
1660
1666
|
/* @__PURE__ */ e("span", { className: "cms-call-bar__live", "aria-hidden": "true" }),
|
|
1661
|
-
/* @__PURE__ */ e("span", { className: "cms-call-bar__name", children:
|
|
1667
|
+
/* @__PURE__ */ e("span", { className: "cms-call-bar__name", children: r.onCallWith(n) }),
|
|
1662
1668
|
/* @__PURE__ */ e("span", { className: "cms-call-bar__time", children: l }),
|
|
1663
1669
|
/* @__PURE__ */ i("span", { className: "cms-call-bar__actions", children: [
|
|
1664
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": t ?
|
|
1665
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: c, children:
|
|
1666
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label":
|
|
1670
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": t ? r.unmute : r.mute, "aria-pressed": t, onClick: a, children: /* @__PURE__ */ e(L, { name: "mic" }) }),
|
|
1671
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: c, children: r.returnToCall }),
|
|
1672
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": r.hangUp, onClick: s, children: /* @__PURE__ */ e(L, { name: "phone-off" }) })
|
|
1667
1673
|
] })
|
|
1668
1674
|
] });
|
|
1669
1675
|
}
|
|
1670
|
-
function
|
|
1676
|
+
function Ll({ mark: n, product: l, headline: t, lead: a, features: c = [], children: s }) {
|
|
1671
1677
|
return /* @__PURE__ */ i("div", { className: "cms-signin", children: [
|
|
1672
1678
|
/* @__PURE__ */ i("aside", { className: "cms-signin__brand", children: [
|
|
1673
1679
|
/* @__PURE__ */ i("p", { className: "cms-signin__logo", children: [
|
|
@@ -1676,11 +1682,11 @@ function Dl({ mark: n, product: l, headline: t, lead: r, features: c = [], child
|
|
|
1676
1682
|
] }),
|
|
1677
1683
|
/* @__PURE__ */ i("div", { className: "cms-signin__pitch", children: [
|
|
1678
1684
|
/* @__PURE__ */ e("p", { className: "cms-signin__headline", children: t }),
|
|
1679
|
-
/* @__PURE__ */ e("p", { className: "cms-signin__lead", children:
|
|
1680
|
-
c.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: c.map((
|
|
1681
|
-
/* @__PURE__ */ e(L, { name:
|
|
1682
|
-
|
|
1683
|
-
] },
|
|
1685
|
+
/* @__PURE__ */ e("p", { className: "cms-signin__lead", children: a }),
|
|
1686
|
+
c.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: c.map((m) => /* @__PURE__ */ i("li", { children: [
|
|
1687
|
+
/* @__PURE__ */ e(L, { name: m.icon, size: 18 }),
|
|
1688
|
+
m.label
|
|
1689
|
+
] }, m.label)) }) : null
|
|
1684
1690
|
] })
|
|
1685
1691
|
] }),
|
|
1686
1692
|
/* @__PURE__ */ e("main", { className: "cms-signin__form", children: s })
|
|
@@ -1698,36 +1704,36 @@ const Un = {
|
|
|
1698
1704
|
newHere: "New here?",
|
|
1699
1705
|
create: "Create an account"
|
|
1700
1706
|
};
|
|
1701
|
-
function
|
|
1702
|
-
const
|
|
1707
|
+
function $l({ server: n, onSubmit: l, forgotHref: t, createHref: a, error: c, busy: s, labels: m }) {
|
|
1708
|
+
const r = ye(Un, m), u = se(), [v, o] = T(""), [p, h] = T(""), [f, d] = T(!1);
|
|
1703
1709
|
return /* @__PURE__ */ i("form", { className: "cms-signin-form", onSubmit: (k) => {
|
|
1704
1710
|
k.preventDefault(), l(v, p);
|
|
1705
|
-
}, "aria-describedby": c ? `${
|
|
1706
|
-
/* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children:
|
|
1711
|
+
}, "aria-describedby": c ? `${u}-error` : void 0, children: [
|
|
1712
|
+
/* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children: r.title }),
|
|
1707
1713
|
/* @__PURE__ */ i("p", { className: "cms-signin-form__server", children: [
|
|
1708
1714
|
/* @__PURE__ */ e(L, { name: "server", size: 18 }),
|
|
1709
1715
|
n
|
|
1710
1716
|
] }),
|
|
1711
|
-
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${
|
|
1717
|
+
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${u}-identifier`, children: r.identifier }),
|
|
1712
1718
|
/* @__PURE__ */ e(
|
|
1713
1719
|
"input",
|
|
1714
1720
|
{
|
|
1715
|
-
id: `${
|
|
1721
|
+
id: `${u}-identifier`,
|
|
1716
1722
|
className: "cms-signin-form__input",
|
|
1717
1723
|
type: "text",
|
|
1718
1724
|
autoComplete: "username",
|
|
1719
|
-
placeholder:
|
|
1725
|
+
placeholder: r.identifierPlaceholder,
|
|
1720
1726
|
value: v,
|
|
1721
1727
|
onChange: (k) => o(k.target.value),
|
|
1722
1728
|
required: !0
|
|
1723
1729
|
}
|
|
1724
1730
|
),
|
|
1725
|
-
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${
|
|
1731
|
+
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${u}-password`, children: r.password }),
|
|
1726
1732
|
/* @__PURE__ */ i("span", { className: "cms-signin-form__password", children: [
|
|
1727
1733
|
/* @__PURE__ */ e(
|
|
1728
1734
|
"input",
|
|
1729
1735
|
{
|
|
1730
|
-
id: `${
|
|
1736
|
+
id: `${u}-password`,
|
|
1731
1737
|
className: "cms-signin-form__input",
|
|
1732
1738
|
type: f ? "text" : "password",
|
|
1733
1739
|
autoComplete: "current-password",
|
|
@@ -1736,14 +1742,14 @@ function Ll({ server: n, onSubmit: l, forgotHref: t, createHref: r, error: c, bu
|
|
|
1736
1742
|
required: !0
|
|
1737
1743
|
}
|
|
1738
1744
|
),
|
|
1739
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": f, onClick: () => d((k) => !k), children: f ?
|
|
1745
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": f, onClick: () => d((k) => !k), children: f ? r.hide : r.show })
|
|
1740
1746
|
] }),
|
|
1741
|
-
t ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: t, children:
|
|
1742
|
-
c ? /* @__PURE__ */ e("p", { id: `${
|
|
1743
|
-
/* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: s, "aria-busy": s || void 0, children:
|
|
1744
|
-
|
|
1745
|
-
/* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children:
|
|
1746
|
-
/* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href:
|
|
1747
|
+
t ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: t, children: r.forgot }) : null,
|
|
1748
|
+
c ? /* @__PURE__ */ e("p", { id: `${u}-error`, className: "cms-signin-form__error", role: "alert", children: c }) : null,
|
|
1749
|
+
/* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: s, "aria-busy": s || void 0, children: r.submit }),
|
|
1750
|
+
a ? /* @__PURE__ */ i(A, { children: [
|
|
1751
|
+
/* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children: r.newHere }) }),
|
|
1752
|
+
/* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: a, children: r.create })
|
|
1747
1753
|
] }) : null
|
|
1748
1754
|
] });
|
|
1749
1755
|
}
|
|
@@ -1753,7 +1759,7 @@ function Xe(n) {
|
|
|
1753
1759
|
return l === Ue(n.options, n.defaultValue) ? null : l ?? null;
|
|
1754
1760
|
}
|
|
1755
1761
|
function Oe({ options: n, value: l, defaultValue: t }) {
|
|
1756
|
-
return n.find((
|
|
1762
|
+
return n.find((a) => a.id === l) ?? Ue(n, t);
|
|
1757
1763
|
}
|
|
1758
1764
|
function Je(n) {
|
|
1759
1765
|
var l;
|
|
@@ -1761,14 +1767,14 @@ function Je(n) {
|
|
|
1761
1767
|
}
|
|
1762
1768
|
function Qe(n, l) {
|
|
1763
1769
|
const t = Oe(n);
|
|
1764
|
-
return n.options.map((
|
|
1765
|
-
id:
|
|
1766
|
-
label:
|
|
1770
|
+
return n.options.map((a) => ({
|
|
1771
|
+
id: a.id,
|
|
1772
|
+
label: a.label,
|
|
1767
1773
|
offer: { offered: !0, locked: !1 },
|
|
1768
|
-
checked:
|
|
1774
|
+
checked: a === t,
|
|
1769
1775
|
...l === void 0 ? {} : { group: l },
|
|
1770
1776
|
onSelect: () => {
|
|
1771
|
-
|
|
1777
|
+
a !== t && n.onChange(a.id);
|
|
1772
1778
|
}
|
|
1773
1779
|
}));
|
|
1774
1780
|
}
|
|
@@ -1777,7 +1783,7 @@ function Ue(n, l) {
|
|
|
1777
1783
|
}
|
|
1778
1784
|
function en(n) {
|
|
1779
1785
|
var s;
|
|
1780
|
-
const l = H(null), t = (n == null ? void 0 : n.value) ?? null, c = n === void 0 || n.options.some((
|
|
1786
|
+
const l = H(null), t = (n == null ? void 0 : n.value) ?? null, c = n === void 0 || n.options.some((m) => m.id === n.value) ? null : ((s = Ue(n.options, n.defaultValue)) == null ? void 0 : s.id) ?? null;
|
|
1781
1787
|
Q(() => {
|
|
1782
1788
|
c === null ? l.current = null : l.current !== t && (l.current = t, n == null || n.onChange(c));
|
|
1783
1789
|
}, [c, t]);
|
|
@@ -1786,9 +1792,9 @@ function nn({ iconOnly: n = !1, onOpenChange: l, ...t }) {
|
|
|
1786
1792
|
return t.options.length < 2 ? null : /* @__PURE__ */ e(Kn, { ...t, iconOnly: n, onOpenChange: l });
|
|
1787
1793
|
}
|
|
1788
1794
|
function Kn({ iconOnly: n, onOpenChange: l, ...t }) {
|
|
1789
|
-
const [
|
|
1790
|
-
Q(() => (l == null || l(
|
|
1791
|
-
const
|
|
1795
|
+
const [a, c] = T(null), s = be(() => c(null), []), m = H(!1), r = a !== null;
|
|
1796
|
+
Q(() => (l == null || l(r), () => l == null ? void 0 : l(!1)), [r, l]);
|
|
1797
|
+
const u = Xe(t), v = u !== null && !n, o = Je(t), p = (h, f) => {
|
|
1792
1798
|
const d = h.getBoundingClientRect();
|
|
1793
1799
|
c({ x: d.left, y: d.bottom + 4, focus: f });
|
|
1794
1800
|
};
|
|
@@ -1797,22 +1803,22 @@ function Kn({ iconOnly: n, onOpenChange: l, ...t }) {
|
|
|
1797
1803
|
"button",
|
|
1798
1804
|
{
|
|
1799
1805
|
type: "button",
|
|
1800
|
-
className:
|
|
1806
|
+
className: $("cms-filter-menu", u !== null && "cms-filter-menu--active", v && "cms-filter-menu--named"),
|
|
1801
1807
|
"aria-haspopup": "menu",
|
|
1802
|
-
"aria-expanded":
|
|
1808
|
+
"aria-expanded": r,
|
|
1803
1809
|
"aria-label": o,
|
|
1804
1810
|
title: o,
|
|
1805
1811
|
onMouseDown: () => {
|
|
1806
|
-
|
|
1812
|
+
m.current = r;
|
|
1807
1813
|
},
|
|
1808
1814
|
onClick: (h) => {
|
|
1809
|
-
|
|
1815
|
+
r || m.current ? s() : p(h.currentTarget, "current"), m.current = !1;
|
|
1810
1816
|
},
|
|
1811
1817
|
onKeyDown: (h) => {
|
|
1812
|
-
|
|
1818
|
+
m.current = !1, (h.key === "ArrowDown" || h.key === "ArrowUp") && (h.preventDefault(), p(h.currentTarget, h.key === "ArrowUp" ? "last" : "current"));
|
|
1813
1819
|
},
|
|
1814
1820
|
children: v ? /* @__PURE__ */ i(A, { children: [
|
|
1815
|
-
/* @__PURE__ */ e("span", { className: "cms-filter-menu__choice", children:
|
|
1821
|
+
/* @__PURE__ */ e("span", { className: "cms-filter-menu__choice", children: u.label }),
|
|
1816
1822
|
/* @__PURE__ */ e(L, { name: "chevron-down", size: 16 })
|
|
1817
1823
|
] }) : /* @__PURE__ */ e(L, { name: "funnel" })
|
|
1818
1824
|
}
|
|
@@ -1820,11 +1826,11 @@ function Kn({ iconOnly: n, onOpenChange: l, ...t }) {
|
|
|
1820
1826
|
/* @__PURE__ */ e(
|
|
1821
1827
|
ge,
|
|
1822
1828
|
{
|
|
1823
|
-
at:
|
|
1829
|
+
at: a,
|
|
1824
1830
|
items: Qe(t),
|
|
1825
1831
|
onClose: s,
|
|
1826
1832
|
label: t.label,
|
|
1827
|
-
focus:
|
|
1833
|
+
focus: a == null ? void 0 : a.focus
|
|
1828
1834
|
}
|
|
1829
1835
|
)
|
|
1830
1836
|
] });
|
|
@@ -1832,7 +1838,7 @@ function Kn({ iconOnly: n, onOpenChange: l, ...t }) {
|
|
|
1832
1838
|
function Vn(n) {
|
|
1833
1839
|
return en(n), /* @__PURE__ */ e(nn, { ...n });
|
|
1834
1840
|
}
|
|
1835
|
-
function
|
|
1841
|
+
function Il({ leading: n, name: l, filter: t }) {
|
|
1836
1842
|
return /* @__PURE__ */ i("div", { className: "cms-list-head", children: [
|
|
1837
1843
|
n != null ? /* @__PURE__ */ e("span", { className: "cms-list-head__leading", children: n }) : null,
|
|
1838
1844
|
/* @__PURE__ */ e("h2", { className: "cms-list-head__name", title: l, children: l }),
|
|
@@ -1848,26 +1854,26 @@ function Zn(n) {
|
|
|
1848
1854
|
function Wn(n) {
|
|
1849
1855
|
const l = /* @__PURE__ */ new Map();
|
|
1850
1856
|
for (const t of n) t.overflow !== void 0 && t.overflow !== 0 && l.set(t.overflow, [...l.get(t.overflow) ?? [], t.id]);
|
|
1851
|
-
return [...l.entries()].sort(([t], [
|
|
1857
|
+
return [...l.entries()].sort(([t], [a]) => t - a).map(([, t]) => t);
|
|
1852
1858
|
}
|
|
1853
|
-
function
|
|
1854
|
-
const
|
|
1855
|
-
const _ =
|
|
1856
|
-
if (_ === null ||
|
|
1857
|
-
const
|
|
1859
|
+
function Fl({ label: n, actions: l, onAction: t, status: a, moreLabel: c, leading: s }) {
|
|
1860
|
+
const m = l.filter((_) => _.entries === void 0 || _.entries.length > 0), r = H(null), u = H(null), v = H(null), [o, p] = T(Ze), [h, f] = T(null), [d, g] = T("first"), [k, x] = T(null), [C, w] = T(null), b = Zn(m), y = Wn(m), D = b.flat(), Z = D.filter((_) => _.overflow === 0), V = D.filter((_) => _.overflow !== 0), M = JSON.stringify([m.map((_) => [_.id, _.label, _.icon, _.group, _.overflow ?? null, _.entries !== void 0]), a ?? "", s !== void 0]), R = be(() => {
|
|
1861
|
+
const _ = r.current, I = u.current;
|
|
1862
|
+
if (_ === null || I === null) return;
|
|
1863
|
+
const P = getComputedStyle(_), ne = parseFloat(P.columnGap || "0") || 0, F = _.clientWidth - (parseFloat(P.paddingLeft) || 0) - (parseFloat(P.paddingRight) || 0), X = (E) => {
|
|
1858
1864
|
var K;
|
|
1859
|
-
return ((K =
|
|
1865
|
+
return ((K = I.querySelector(E)) == null ? void 0 : K.getBoundingClientRect().width) ?? 0;
|
|
1860
1866
|
}, N = X('[data-measure="leading"]'), S = X('[data-measure="separator"]'), O = X('[data-measure="more"]'), Y = (E, K) => X(`[data-measure="${K ? "full" : "icon"}"][data-measure-action="${CSS.escape(E)}"]`), de = (E, K) => {
|
|
1861
1867
|
const W = /* @__PURE__ */ new Set([...Z.map((ce) => ce.id), ...K]), te = b.map((ce) => ce.filter((Ne) => !W.has(Ne.id))).filter((ce) => ce.length > 0), pe = te.flat(), Ce = pe.length + (te.length - 1) + (W.size > 0 ? 1 : 0) + (N > 0 ? 1 : 0);
|
|
1862
1868
|
return N + pe.reduce((ce, Ne) => ce + Y(Ne.id, !E.has(Ne.id)), 0) + S * Math.max(0, te.length - 1) + (W.size > 0 ? O : 0) + ne * Math.max(0, Ce - 1);
|
|
1863
1869
|
}, Me = V.filter((E) => !y.some((K) => K.includes(E.id))).map((E) => E.id), Ee = [...y, ...[...Me].reverse().map((E) => [E])];
|
|
1864
1870
|
let ue = null;
|
|
1865
|
-
if (de(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <=
|
|
1871
|
+
if (de(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= F) ue = Ze;
|
|
1866
1872
|
else {
|
|
1867
1873
|
const E = /* @__PURE__ */ new Set();
|
|
1868
1874
|
for (const K of Ee) {
|
|
1869
1875
|
for (const W of K) E.add(W);
|
|
1870
|
-
if (de(E, /* @__PURE__ */ new Set()) <=
|
|
1876
|
+
if (de(E, /* @__PURE__ */ new Set()) <= F) {
|
|
1871
1877
|
ue = { bare: E, hidden: /* @__PURE__ */ new Set() };
|
|
1872
1878
|
break;
|
|
1873
1879
|
}
|
|
@@ -1877,36 +1883,36 @@ function Il({ label: n, actions: l, onAction: t, status: r, moreLabel: c, leadin
|
|
|
1877
1883
|
const E = new Set(V.map((W) => W.id)), K = /* @__PURE__ */ new Set();
|
|
1878
1884
|
for (const W of y) {
|
|
1879
1885
|
for (const te of W) V.some((pe) => pe.id === te) && K.add(te);
|
|
1880
|
-
if (K.size >= 2 && de(E, K) <=
|
|
1886
|
+
if (K.size >= 2 && de(E, K) <= F) break;
|
|
1881
1887
|
}
|
|
1882
|
-
if (de(E, K) >
|
|
1888
|
+
if (de(E, K) > F) {
|
|
1883
1889
|
for (const W of [...Me].reverse())
|
|
1884
|
-
if (K.add(W), de(E, K) <=
|
|
1890
|
+
if (K.add(W), de(E, K) <= F) break;
|
|
1885
1891
|
}
|
|
1886
1892
|
ue = { bare: E, hidden: K };
|
|
1887
1893
|
}
|
|
1888
|
-
const
|
|
1889
|
-
p((E) => We(E.bare,
|
|
1894
|
+
const B = ue;
|
|
1895
|
+
p((E) => We(E.bare, B.bare) && We(E.hidden, B.hidden) ? E : B);
|
|
1890
1896
|
}, [M]);
|
|
1891
1897
|
ve(R, [R]), Q(() => {
|
|
1892
|
-
const _ =
|
|
1898
|
+
const _ = r.current;
|
|
1893
1899
|
if (_ === null || typeof ResizeObserver > "u") return;
|
|
1894
|
-
const
|
|
1895
|
-
return
|
|
1900
|
+
const I = new ResizeObserver(() => R());
|
|
1901
|
+
return I.observe(_), () => I.disconnect();
|
|
1896
1902
|
}, [R]);
|
|
1897
|
-
const z = /* @__PURE__ */ new Set([...Z.map((_) => _.id), ...o.hidden]), U = b.map((_) => _.filter((
|
|
1903
|
+
const z = /* @__PURE__ */ new Set([...Z.map((_) => _.id), ...o.hidden]), U = b.map((_) => _.filter((I) => !z.has(I.id))).filter((_) => _.length > 0).flat(), j = [
|
|
1898
1904
|
...Z,
|
|
1899
|
-
...y.flat().map((_) => D.find((
|
|
1905
|
+
...y.flat().map((_) => D.find((I) => I.id === _)).filter((_) => _ !== void 0 && o.hidden.has(_.id)),
|
|
1900
1906
|
// The pinned that a row too narrow for them sent behind ..., in the row's order.
|
|
1901
|
-
...V.filter((_) => o.hidden.has(_.id) && !y.some((
|
|
1902
|
-
], le = new Set(V.filter((_) => !y.some((
|
|
1903
|
-
var
|
|
1904
|
-
const
|
|
1905
|
-
let
|
|
1906
|
-
if (_.key === "ArrowRight" ?
|
|
1907
|
+
...V.filter((_) => o.hidden.has(_.id) && !y.some((I) => I.includes(_.id)))
|
|
1908
|
+
], le = new Set(V.filter((_) => !y.some((I) => I.includes(_.id))).map((_) => _.id)), ae = [...U.map((_) => _.id), ...j.length > 0 ? ["more"] : []], re = k !== null && ae.includes(k) ? k : ae[0] ?? null, ie = (_) => {
|
|
1909
|
+
var F, X;
|
|
1910
|
+
const I = ae.indexOf(re ?? "");
|
|
1911
|
+
let P = null;
|
|
1912
|
+
if (_.key === "ArrowRight" ? P = Math.min(ae.length - 1, I + 1) : _.key === "ArrowLeft" ? P = Math.max(0, I - 1) : _.key === "Home" ? P = 0 : _.key === "End" ? P = ae.length - 1 : _.key === "Escape" && w(re), P === null) return;
|
|
1907
1913
|
_.preventDefault();
|
|
1908
|
-
const ne = ae[
|
|
1909
|
-
x(ne), (X = (
|
|
1914
|
+
const ne = ae[P] ?? null;
|
|
1915
|
+
x(ne), (X = (F = r.current) == null ? void 0 : F.querySelector(`[data-stop="${CSS.escape(ne ?? "")}"]`)) == null || X.focus();
|
|
1910
1916
|
}, oe = j.map((_) => ({
|
|
1911
1917
|
id: _.id,
|
|
1912
1918
|
label: /* @__PURE__ */ i(A, { children: [
|
|
@@ -1916,14 +1922,14 @@ function Il({ label: n, actions: l, onAction: t, status: r, moreLabel: c, leadin
|
|
|
1916
1922
|
offer: _.disabled ? { offered: !0, locked: !1, refusal: _.reason ?? "" } : { offered: !0, locked: !1 },
|
|
1917
1923
|
..._.danger ? { danger: !0 } : {},
|
|
1918
1924
|
onSelect: () => {
|
|
1919
|
-
var
|
|
1925
|
+
var P;
|
|
1920
1926
|
if (_.disabled || _.busy) return;
|
|
1921
1927
|
if (_.entries === void 0) {
|
|
1922
1928
|
t(_.id);
|
|
1923
1929
|
return;
|
|
1924
1930
|
}
|
|
1925
|
-
const
|
|
1926
|
-
g("first"), f({ which: _.id, x: (
|
|
1931
|
+
const I = (P = v.current) == null ? void 0 : P.getBoundingClientRect();
|
|
1932
|
+
g("first"), f({ which: _.id, x: (I == null ? void 0 : I.left) ?? 0, y: (I == null ? void 0 : I.bottom) ?? 0 });
|
|
1927
1933
|
}
|
|
1928
1934
|
})), J = h === null || h.which === "more" ? void 0 : D.find((_) => _.id === h.which), fe = ((J == null ? void 0 : J.entries) ?? []).map((_) => ({
|
|
1929
1935
|
id: _.id,
|
|
@@ -1936,17 +1942,17 @@ function Il({ label: n, actions: l, onAction: t, status: r, moreLabel: c, leadin
|
|
|
1936
1942
|
onSelect: () => {
|
|
1937
1943
|
_.disabled || t(_.id);
|
|
1938
1944
|
}
|
|
1939
|
-
})), ee = (_,
|
|
1940
|
-
const ne =
|
|
1941
|
-
g(
|
|
1945
|
+
})), ee = (_, I, P) => {
|
|
1946
|
+
const ne = I.getBoundingClientRect();
|
|
1947
|
+
g(P), f({ which: _, x: ne.left, y: ne.bottom });
|
|
1942
1948
|
};
|
|
1943
1949
|
return /* @__PURE__ */ i(
|
|
1944
1950
|
"div",
|
|
1945
1951
|
{
|
|
1946
|
-
ref:
|
|
1952
|
+
ref: r,
|
|
1947
1953
|
role: "toolbar",
|
|
1948
1954
|
"aria-label": n,
|
|
1949
|
-
className:
|
|
1955
|
+
className: $(
|
|
1950
1956
|
"cms-pane-toolbar",
|
|
1951
1957
|
V.length > 0 && o.bare.size >= V.length && "cms-pane-toolbar--labels-hidden",
|
|
1952
1958
|
o.bare.size > 0 && o.bare.size < V.length && "cms-pane-toolbar--labels-partly-hidden"
|
|
@@ -1954,30 +1960,30 @@ function Il({ label: n, actions: l, onAction: t, status: r, moreLabel: c, leadin
|
|
|
1954
1960
|
onKeyDown: ie,
|
|
1955
1961
|
children: [
|
|
1956
1962
|
s !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__leading", children: s }) : null,
|
|
1957
|
-
b.map((_,
|
|
1958
|
-
const
|
|
1963
|
+
b.map((_, I) => {
|
|
1964
|
+
const P = _.filter((F) => !z.has(F.id)), ne = b.slice(0, I).some((F) => F.some((X) => !z.has(X.id)));
|
|
1959
1965
|
return /* @__PURE__ */ i("div", { className: "cms-pane-toolbar__group-wrap", children: [
|
|
1960
|
-
|
|
1961
|
-
/* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden:
|
|
1966
|
+
P.length > 0 && ne ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__separator", role: "separator", "aria-orientation": "vertical" }) : null,
|
|
1967
|
+
/* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden: P.length === 0, children: _.map((F) => /* @__PURE__ */ e(
|
|
1962
1968
|
qn,
|
|
1963
1969
|
{
|
|
1964
|
-
action:
|
|
1965
|
-
labels: !o.bare.has(
|
|
1966
|
-
overflowed: z.has(
|
|
1967
|
-
pinned: le.has(
|
|
1968
|
-
tabbable: re ===
|
|
1969
|
-
tipOff: C ===
|
|
1970
|
-
menuOpen: (h == null ? void 0 : h.which) ===
|
|
1970
|
+
action: F,
|
|
1971
|
+
labels: !o.bare.has(F.id),
|
|
1972
|
+
overflowed: z.has(F.id),
|
|
1973
|
+
pinned: le.has(F.id),
|
|
1974
|
+
tabbable: re === F.id,
|
|
1975
|
+
tipOff: C === F.id,
|
|
1976
|
+
menuOpen: (h == null ? void 0 : h.which) === F.id,
|
|
1971
1977
|
onChoose: (X, N) => {
|
|
1972
|
-
|
|
1978
|
+
F.entries === void 0 ? t(F.id) : (h == null ? void 0 : h.which) === F.id && N === null ? f(null) : ee(F.id, X, N ?? "first");
|
|
1973
1979
|
},
|
|
1974
1980
|
onFocus: () => {
|
|
1975
|
-
x(
|
|
1981
|
+
x(F.id), w(null);
|
|
1976
1982
|
}
|
|
1977
1983
|
},
|
|
1978
|
-
|
|
1984
|
+
F.id
|
|
1979
1985
|
)) })
|
|
1980
|
-
] },
|
|
1986
|
+
] }, I);
|
|
1981
1987
|
}),
|
|
1982
1988
|
j.length > 0 ? /* @__PURE__ */ e(
|
|
1983
1989
|
"button",
|
|
@@ -2001,20 +2007,20 @@ function Il({ label: n, actions: l, onAction: t, status: r, moreLabel: c, leadin
|
|
|
2001
2007
|
children: /* @__PURE__ */ e(L, { name: "more" })
|
|
2002
2008
|
}
|
|
2003
2009
|
) : null,
|
|
2004
|
-
|
|
2010
|
+
a !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__status", title: a, children: a }) : null,
|
|
2005
2011
|
/* @__PURE__ */ e(ge, { at: (h == null ? void 0 : h.which) === "more" ? h : null, items: oe, onClose: () => f(null), label: c, focus: d }),
|
|
2006
2012
|
/* @__PURE__ */ e(ge, { at: J !== void 0 ? h : null, items: fe, onClose: () => f(null), label: (J == null ? void 0 : J.label) ?? "", focus: d }),
|
|
2007
|
-
/* @__PURE__ */ i("div", { ref:
|
|
2013
|
+
/* @__PURE__ */ i("div", { ref: u, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
|
|
2008
2014
|
s !== void 0 ? /* @__PURE__ */ e("div", { "data-measure": "leading", children: s }) : null,
|
|
2009
2015
|
/* @__PURE__ */ e("span", { "data-measure": "separator", className: "cms-pane-toolbar__separator" }),
|
|
2010
2016
|
/* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ e(L, { name: "more" }) }),
|
|
2011
2017
|
D.map((_) => /* @__PURE__ */ i("span", { children: [
|
|
2012
|
-
/* @__PURE__ */ i("span", { "data-measure": "full", "data-measure-action": _.id, className:
|
|
2018
|
+
/* @__PURE__ */ i("span", { "data-measure": "full", "data-measure-action": _.id, className: $("cms-pane-toolbar__action", _.entries !== void 0 && "cms-pane-toolbar__action--menu"), children: [
|
|
2013
2019
|
/* @__PURE__ */ e(xe, { name: _.icon }),
|
|
2014
2020
|
/* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: _.label }),
|
|
2015
2021
|
_.entries !== void 0 ? /* @__PURE__ */ e($e, {}) : null
|
|
2016
2022
|
] }),
|
|
2017
|
-
/* @__PURE__ */ i("span", { "data-measure": "icon", "data-measure-action": _.id, className:
|
|
2023
|
+
/* @__PURE__ */ i("span", { "data-measure": "icon", "data-measure-action": _.id, className: $("cms-pane-toolbar__action", we(_.icon) !== null && "cms-pane-toolbar__action--bare", _.entries !== void 0 && "cms-pane-toolbar__action--menu"), children: [
|
|
2018
2024
|
we(_.icon) !== null ? /* @__PURE__ */ e(xe, { name: _.icon }) : /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: _.label }),
|
|
2019
2025
|
_.entries !== void 0 ? /* @__PURE__ */ e($e, {}) : null
|
|
2020
2026
|
] })
|
|
@@ -2024,7 +2030,7 @@ function Il({ label: n, actions: l, onAction: t, status: r, moreLabel: c, leadin
|
|
|
2024
2030
|
}
|
|
2025
2031
|
);
|
|
2026
2032
|
}
|
|
2027
|
-
function qn({ action: n, labels: l, overflowed: t, pinned:
|
|
2033
|
+
function qn({ action: n, labels: l, overflowed: t, pinned: a, tabbable: c, tipOff: s, menuOpen: m, onChoose: r, onFocus: u }) {
|
|
2028
2034
|
const [v, o] = T(!1);
|
|
2029
2035
|
Q(() => {
|
|
2030
2036
|
if (!n.busy) {
|
|
@@ -2039,26 +2045,26 @@ function qn({ action: n, labels: l, overflowed: t, pinned: r, tabbable: c, tipOf
|
|
|
2039
2045
|
"button",
|
|
2040
2046
|
{
|
|
2041
2047
|
type: "button",
|
|
2042
|
-
className:
|
|
2048
|
+
className: $("cms-pane-toolbar__action", !h && "cms-pane-toolbar__action--bare", p && "cms-pane-toolbar__action--text", C && "cms-pane-toolbar__action--menu", n.danger && "is-danger"),
|
|
2043
2049
|
"data-action": n.id,
|
|
2044
2050
|
"data-stop": n.id,
|
|
2045
2051
|
...t ? { "data-overflowed": "" } : {},
|
|
2046
|
-
...
|
|
2052
|
+
...a ? { "data-pinned": "" } : {},
|
|
2047
2053
|
hidden: t,
|
|
2048
2054
|
"aria-label": n.label,
|
|
2049
2055
|
"aria-disabled": n.disabled || void 0,
|
|
2050
2056
|
"aria-busy": n.busy || void 0,
|
|
2051
|
-
...C ? { "aria-haspopup": "menu", "aria-expanded":
|
|
2057
|
+
...C ? { "aria-haspopup": "menu", "aria-expanded": m } : {},
|
|
2052
2058
|
...f === null ? {} : { "aria-describedby": g },
|
|
2053
2059
|
...k && f !== null ? { "data-reason-shown": "" } : {},
|
|
2054
2060
|
tabIndex: c ? 0 : -1,
|
|
2055
|
-
onFocus:
|
|
2061
|
+
onFocus: u,
|
|
2056
2062
|
onBlur: () => x(!1),
|
|
2057
2063
|
onKeyDown: (w) => {
|
|
2058
|
-
w.key === "Escape" && x(!1), C && (w.key === "ArrowDown" || w.key === "ArrowUp") && (w.preventDefault(), f !== null ? x(!0) : !n.disabled && !n.busy &&
|
|
2064
|
+
w.key === "Escape" && x(!1), C && (w.key === "ArrowDown" || w.key === "ArrowUp") && (w.preventDefault(), f !== null ? x(!0) : !n.disabled && !n.busy && r(w.currentTarget, w.key === "ArrowUp" ? "last" : "first"));
|
|
2059
2065
|
},
|
|
2060
2066
|
onClick: (w) => {
|
|
2061
|
-
f !== null ? x(!0) : !n.disabled && !n.busy &&
|
|
2067
|
+
f !== null ? x(!0) : !n.disabled && !n.busy && r(w.currentTarget, null);
|
|
2062
2068
|
},
|
|
2063
2069
|
children: [
|
|
2064
2070
|
v ? /* @__PURE__ */ e(G, { name: "spinner" }) : /* @__PURE__ */ e(xe, { name: n.icon }),
|
|
@@ -2076,14 +2082,14 @@ function xe({ name: n }) {
|
|
|
2076
2082
|
const l = we(n);
|
|
2077
2083
|
return l === null ? null : /* @__PURE__ */ e(L, { name: l, size: 18 });
|
|
2078
2084
|
}
|
|
2079
|
-
function
|
|
2085
|
+
function Bl({ title: n, body: l = null, time: t = null, unread: a, unreadLabel: c, expandLabel: s, collapseLabel: m, action: r = null, onRead: u, leading: v }) {
|
|
2080
2086
|
const [o, p] = T(!1), h = se(), f = () => {
|
|
2081
|
-
|
|
2082
|
-
}, d = (
|
|
2087
|
+
a && u();
|
|
2088
|
+
}, d = (r == null ? void 0 : r.presentation) === "row" && r.onAction !== void 0, g = (r == null ? void 0 : r.presentation) === "button" && r.onAction !== void 0 ? r : null, k = () => {
|
|
2083
2089
|
var x;
|
|
2084
|
-
f(), d && ((x =
|
|
2090
|
+
f(), d && ((x = r.onAction) == null || x.call(r));
|
|
2085
2091
|
};
|
|
2086
|
-
return /* @__PURE__ */ i("article", { className:
|
|
2092
|
+
return /* @__PURE__ */ i("article", { className: $("cms-notification", a && "is-unread", o && "is-expanded", d && "is-row-action"), "data-state": a ? "unread" : "read", children: [
|
|
2087
2093
|
/* @__PURE__ */ i(
|
|
2088
2094
|
"div",
|
|
2089
2095
|
{
|
|
@@ -2100,7 +2106,7 @@ function Pl({ title: n, body: l = null, time: t = null, unread: r, unreadLabel:
|
|
|
2100
2106
|
/* @__PURE__ */ i("span", { className: "cms-notification__text", children: [
|
|
2101
2107
|
/* @__PURE__ */ i("span", { className: "cms-notification__head", children: [
|
|
2102
2108
|
/* @__PURE__ */ i("span", { className: "cms-notification__title", children: [
|
|
2103
|
-
|
|
2109
|
+
a ? /* @__PURE__ */ i("span", { className: "cms-visually-hidden", children: [
|
|
2104
2110
|
c,
|
|
2105
2111
|
" "
|
|
2106
2112
|
] }) : null,
|
|
@@ -2110,7 +2116,7 @@ function Pl({ title: n, body: l = null, time: t = null, unread: r, unreadLabel:
|
|
|
2110
2116
|
] }),
|
|
2111
2117
|
l !== null && l !== "" ? /* @__PURE__ */ e("span", { className: "cms-notification__body", id: h, children: l }) : null
|
|
2112
2118
|
] }),
|
|
2113
|
-
|
|
2119
|
+
a ? /* @__PURE__ */ e("span", { className: "cms-notification__dot", "aria-hidden": "true" }) : null
|
|
2114
2120
|
]
|
|
2115
2121
|
}
|
|
2116
2122
|
),
|
|
@@ -2121,8 +2127,8 @@ function Pl({ title: n, body: l = null, time: t = null, unread: r, unreadLabel:
|
|
|
2121
2127
|
className: "cms-notification__chevron",
|
|
2122
2128
|
"aria-expanded": o,
|
|
2123
2129
|
"aria-controls": h,
|
|
2124
|
-
"aria-label": o ?
|
|
2125
|
-
title: o ?
|
|
2130
|
+
"aria-label": o ? m : s,
|
|
2131
|
+
title: o ? m : s,
|
|
2126
2132
|
onClick: () => {
|
|
2127
2133
|
o || f(), p((x) => !x);
|
|
2128
2134
|
},
|
|
@@ -2146,7 +2152,7 @@ function Pl({ title: n, body: l = null, time: t = null, unread: r, unreadLabel:
|
|
|
2146
2152
|
function jn(n) {
|
|
2147
2153
|
return n === "allowed" || n === "elevate" || n === "denied";
|
|
2148
2154
|
}
|
|
2149
|
-
function
|
|
2155
|
+
function Pl(n, l) {
|
|
2150
2156
|
if (!jn(n))
|
|
2151
2157
|
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 };
|
|
2152
2158
|
switch (n) {
|
|
@@ -2161,8 +2167,8 @@ function Fl(n, l) {
|
|
|
2161
2167
|
function Gn(n, l) {
|
|
2162
2168
|
if (!n) return;
|
|
2163
2169
|
if (typeof n.get == "function") return n.get(l) ?? void 0;
|
|
2164
|
-
const t = n,
|
|
2165
|
-
return
|
|
2170
|
+
const t = n, a = Object.keys(t).find((c) => c.toLowerCase() === l.toLowerCase());
|
|
2171
|
+
return a === void 0 ? void 0 : t[a];
|
|
2166
2172
|
}
|
|
2167
2173
|
function Yn(n) {
|
|
2168
2174
|
if (n && typeof n == "object") {
|
|
@@ -2171,26 +2177,26 @@ function Yn(n) {
|
|
|
2171
2177
|
if (typeof l.title == "string" && l.title !== "") return l.title;
|
|
2172
2178
|
}
|
|
2173
2179
|
}
|
|
2174
|
-
function
|
|
2180
|
+
function Rl(n, l, t, a) {
|
|
2175
2181
|
if (n !== 403) return { kind: "none" };
|
|
2176
2182
|
const c = Yn(t);
|
|
2177
|
-
return Gn(l, "X-Elevation-Required") !== void 0 ?
|
|
2183
|
+
return Gn(l, "X-Elevation-Required") !== void 0 ? a.elevates ? { kind: "elevation-required", message: c ?? "This needs an elevated session." } : { kind: "refused", message: "This can only be done in the admin, in an elevated session." } : { kind: "refused", message: c ?? "The server refused this." };
|
|
2178
2184
|
}
|
|
2179
2185
|
const Ie = "coolms-kit:reread";
|
|
2180
|
-
function
|
|
2186
|
+
function Hl() {
|
|
2181
2187
|
window.dispatchEvent(new Event(Ie));
|
|
2182
2188
|
}
|
|
2183
|
-
function
|
|
2184
|
-
const [l, t] = T(void 0), [
|
|
2185
|
-
|
|
2186
|
-
const
|
|
2187
|
-
const o = ++
|
|
2188
|
-
|
|
2189
|
+
function Ol(n) {
|
|
2190
|
+
const [l, t] = T(void 0), [a, c] = T(void 0), [s, m] = T(!0), r = H(n);
|
|
2191
|
+
r.current = n;
|
|
2192
|
+
const u = H(0), v = be(() => {
|
|
2193
|
+
const o = ++u.current;
|
|
2194
|
+
m(!0), r.current().then(
|
|
2189
2195
|
(p) => {
|
|
2190
|
-
o ===
|
|
2196
|
+
o === u.current && (t(p), c(void 0), m(!1));
|
|
2191
2197
|
},
|
|
2192
2198
|
(p) => {
|
|
2193
|
-
o ===
|
|
2199
|
+
o === u.current && (c(p), m(!1));
|
|
2194
2200
|
}
|
|
2195
2201
|
);
|
|
2196
2202
|
}, []);
|
|
@@ -2200,85 +2206,85 @@ function Hl(n) {
|
|
|
2200
2206
|
return window.addEventListener("focus", o), window.addEventListener(Ie, o), () => {
|
|
2201
2207
|
window.removeEventListener("focus", o), window.removeEventListener(Ie, o);
|
|
2202
2208
|
};
|
|
2203
|
-
}, [v]), { value: l, error:
|
|
2209
|
+
}, [v]), { value: l, error: a, loading: s, reread: v };
|
|
2204
2210
|
}
|
|
2205
|
-
function
|
|
2211
|
+
function Ul(n) {
|
|
2206
2212
|
return n === 412 ? { conflict: !0, message: "Someone changed this since you opened it. Nothing was saved; read it again to see the change." } : { conflict: !1 };
|
|
2207
2213
|
}
|
|
2208
2214
|
const Xn = "/errors/client-update-required";
|
|
2209
2215
|
function Jn(n, l) {
|
|
2210
|
-
const t = n.split(".").map((c) => Number.parseInt(c, 10) || 0),
|
|
2211
|
-
for (let c = 0; c < Math.max(t.length,
|
|
2212
|
-
const s = t[c] ?? 0,
|
|
2213
|
-
if (s !==
|
|
2216
|
+
const t = n.split(".").map((c) => Number.parseInt(c, 10) || 0), a = l.split(".").map((c) => Number.parseInt(c, 10) || 0);
|
|
2217
|
+
for (let c = 0; c < Math.max(t.length, a.length); c++) {
|
|
2218
|
+
const s = t[c] ?? 0, m = a[c] ?? 0;
|
|
2219
|
+
if (s !== m) return s < m;
|
|
2214
2220
|
}
|
|
2215
2221
|
return !1;
|
|
2216
2222
|
}
|
|
2217
|
-
function
|
|
2223
|
+
function zl(n) {
|
|
2218
2224
|
return n.problemType !== void 0 && n.problemType.endsWith(Xn) ? !0 : n.minimumVersion !== void 0 && Jn(n.version, n.minimumVersion);
|
|
2219
2225
|
}
|
|
2220
2226
|
const qe = 4, Qn = 48, el = 800, nl = /* @__PURE__ */ new Set(["ArrowDown", "ArrowUp", "PageDown", "PageUp", "Home", "End", " "]);
|
|
2221
2227
|
function ll(n, l) {
|
|
2222
|
-
const [t,
|
|
2228
|
+
const [t, a] = T(!1);
|
|
2223
2229
|
return Q(() => {
|
|
2224
2230
|
const c = n.current;
|
|
2225
2231
|
if (c === null || !l) {
|
|
2226
|
-
|
|
2232
|
+
a(!1);
|
|
2227
2233
|
return;
|
|
2228
2234
|
}
|
|
2229
2235
|
const s = /* @__PURE__ */ new WeakMap();
|
|
2230
|
-
let
|
|
2231
|
-
const
|
|
2232
|
-
|
|
2236
|
+
let m = Number.NEGATIVE_INFINITY, r = null;
|
|
2237
|
+
const u = (h) => {
|
|
2238
|
+
m = performance.now(), r = h.target;
|
|
2233
2239
|
}, v = (h) => {
|
|
2234
2240
|
const f = h.target;
|
|
2235
|
-
!(f instanceof HTMLElement && (f.isContentEditable || f.closest("input, textarea, select") !== null)) && nl.has(h.key) &&
|
|
2241
|
+
!(f instanceof HTMLElement && (f.isContentEditable || f.closest("input, textarea, select") !== null)) && nl.has(h.key) && u(h);
|
|
2236
2242
|
}, o = (h) => {
|
|
2237
2243
|
const f = h.target;
|
|
2238
2244
|
if (!(f instanceof HTMLElement)) return;
|
|
2239
2245
|
const d = f.scrollTop, g = s.get(f) ?? 0;
|
|
2240
2246
|
if (s.set(f, d), d <= 0) {
|
|
2241
|
-
|
|
2247
|
+
a(!1);
|
|
2242
2248
|
return;
|
|
2243
2249
|
}
|
|
2244
|
-
performance.now() -
|
|
2245
|
-
}, p = [["wheel",
|
|
2250
|
+
performance.now() - m > el || !(r === c || r === document.body || r instanceof Node && f.contains(r)) || (d < g - qe ? a(!1) : d > g + qe && d > Qn && a(!0));
|
|
2251
|
+
}, p = [["wheel", u], ["touchmove", u], ["pointerdown", u], ["keydown", v]];
|
|
2246
2252
|
for (const [h, f] of p) c.addEventListener(h, f, { capture: !0, passive: !0 });
|
|
2247
2253
|
return c.addEventListener("scroll", o, { capture: !0, passive: !0 }), () => {
|
|
2248
2254
|
for (const [h, f] of p) c.removeEventListener(h, f, { capture: !0 });
|
|
2249
2255
|
c.removeEventListener("scroll", o, { capture: !0 });
|
|
2250
2256
|
};
|
|
2251
|
-
}, [n, l]), [t,
|
|
2257
|
+
}, [n, l]), [t, a];
|
|
2252
2258
|
}
|
|
2253
2259
|
const tl = 64;
|
|
2254
|
-
function sl({ bar: n, leading: l, gap: t, icon:
|
|
2255
|
-
const o = [...s ? [
|
|
2256
|
-
return n - (l > 0 ? l + t : 0) - t - p + 0.01 < Math.min(tl,
|
|
2257
|
-
}
|
|
2258
|
-
function
|
|
2259
|
-
const d = v !== void 0 && "menu" in v && !v.menu.some((
|
|
2260
|
-
en(
|
|
2261
|
-
const j =
|
|
2262
|
-
...
|
|
2263
|
-
onChange: (
|
|
2264
|
-
re.current = !0,
|
|
2260
|
+
function sl({ bar: n, leading: l, gap: t, icon: a, iconGap: c, search: s, more: m, globals: r, name: u, choice: v }) {
|
|
2261
|
+
const o = [...s ? [a] : [], a, a, ...r], p = o.reduce((f, d) => f + d, 0) + c * (o.length - 1);
|
|
2262
|
+
return n - (l > 0 ? l + t : 0) - t - p + 0.01 < Math.min(tl, u) + v;
|
|
2263
|
+
}
|
|
2264
|
+
function Kl({ title: n, back: l, navigation: t, search: a, searching: c, more: s = [], moreLabel: m = "More actions", globals: r, filter: u, primary: v, onRefresh: o, pullText: p, barHidden: h, children: f }) {
|
|
2265
|
+
const d = v !== void 0 && "menu" in v && !v.menu.some((B) => B.offer.offered) ? void 0 : v, g = H(null), k = H(null), [x, C] = T(!1), [w, b] = T(null), [y, D] = T(null), Z = be(() => D(null), []), V = H(!1), M = H(null), R = H(null), z = H(null), q = s.some((B) => B.offer.offered), U = y !== null && q && c === void 0;
|
|
2266
|
+
en(u);
|
|
2267
|
+
const j = u === void 0 ? null : Xe(u), [le, ae] = T(!1), re = H(!1), ie = H(!1), oe = H(null), J = u === void 0 ? void 0 : {
|
|
2268
|
+
...u,
|
|
2269
|
+
onChange: (B) => {
|
|
2270
|
+
re.current = !0, u.onChange(B);
|
|
2265
2271
|
}
|
|
2266
|
-
}, fe = j === null ? "" : ` · ${j.label}`, ee =
|
|
2267
|
-
const
|
|
2268
|
-
if (
|
|
2269
|
-
const W = (ke) => parseFloat(ke) || 0, te = getComputedStyle(
|
|
2272
|
+
}, fe = j === null ? "" : ` · ${j.label}`, ee = u !== void 0 && u.options.length >= 2, [_, I] = T(!1), P = ee && q && _, ne = JSON.stringify([ee, q, P, a !== void 0, c !== void 0, l !== void 0, n, fe]), F = be(() => {
|
|
2273
|
+
const B = M.current, E = R.current, K = z.current;
|
|
2274
|
+
if (B === null || E === null || K === null || !ee) return null;
|
|
2275
|
+
const W = (ke) => parseFloat(ke) || 0, te = getComputedStyle(B), pe = B.getBoundingClientRect().width;
|
|
2270
2276
|
if (pe === 0) return null;
|
|
2271
2277
|
const Ce = (ke) => {
|
|
2272
2278
|
var ze;
|
|
2273
|
-
return ((ze =
|
|
2274
|
-
}, ce =
|
|
2279
|
+
return ((ze = B.querySelector(`.cms-screen__ruler > [data-ruler="${ke}"]`)) == null ? void 0 : ze.getBoundingClientRect().width) ?? 0;
|
|
2280
|
+
}, ce = B.querySelector(".cms-screen__leading"), Ne = (a !== void 0 ? 1 : 0) + (P ? 0 : 1) + 1;
|
|
2275
2281
|
return sl({
|
|
2276
2282
|
bar: pe - W(te.paddingLeft) - W(te.paddingRight),
|
|
2277
2283
|
leading: ce === null || ce.childNodes.length === 0 ? 0 : W(getComputedStyle(ce).minWidth),
|
|
2278
2284
|
gap: W(te.columnGap),
|
|
2279
2285
|
icon: K.getBoundingClientRect().width,
|
|
2280
2286
|
iconGap: W(getComputedStyle(E).columnGap),
|
|
2281
|
-
search:
|
|
2287
|
+
search: a !== void 0,
|
|
2282
2288
|
more: !0,
|
|
2283
2289
|
globals: Array.from(E.children).slice(Ne).map((ke) => ke.getBoundingClientRect().width),
|
|
2284
2290
|
name: Ce("name"),
|
|
@@ -2286,36 +2292,36 @@ function zl({ title: n, back: l, navigation: t, search: r, searching: c, more: s
|
|
|
2286
2292
|
});
|
|
2287
2293
|
}, [ne]);
|
|
2288
2294
|
ve(() => {
|
|
2289
|
-
const
|
|
2290
|
-
|
|
2291
|
-
}, [
|
|
2295
|
+
const B = F() ?? _;
|
|
2296
|
+
B !== _ && re.current && (ie.current = !0), re.current = !1, I(B);
|
|
2297
|
+
}, [F]), Q(() => {
|
|
2292
2298
|
if (M.current === null || typeof ResizeObserver > "u") return;
|
|
2293
|
-
const
|
|
2294
|
-
const E =
|
|
2295
|
-
E !== null &&
|
|
2299
|
+
const B = new ResizeObserver(() => {
|
|
2300
|
+
const E = F();
|
|
2301
|
+
E !== null && I(E);
|
|
2296
2302
|
});
|
|
2297
|
-
for (const E of [M.current, R.current, ...M.current.querySelectorAll(".cms-screen__ruler > span")]) E !== null &&
|
|
2298
|
-
return () =>
|
|
2299
|
-
}, [
|
|
2300
|
-
const X = H(
|
|
2303
|
+
for (const E of [M.current, R.current, ...M.current.querySelectorAll(".cms-screen__ruler > span")]) E !== null && B.observe(E);
|
|
2304
|
+
return () => B.disconnect();
|
|
2305
|
+
}, [F]);
|
|
2306
|
+
const X = H(P);
|
|
2301
2307
|
ve(() => {
|
|
2302
2308
|
var K, W, te;
|
|
2303
|
-
if (X.current ===
|
|
2304
|
-
X.current =
|
|
2305
|
-
const
|
|
2306
|
-
(
|
|
2307
|
-
}, [
|
|
2308
|
-
const N =
|
|
2309
|
+
if (X.current === P) return;
|
|
2310
|
+
X.current = P, D(null);
|
|
2311
|
+
const B = document.activeElement;
|
|
2312
|
+
(B === document.body && oe.current !== null && !oe.current.isConnected || ie.current && (B === document.body || ((K = M.current) == null ? void 0 : K.contains(B)) === !0)) && ((te = P ? z.current : (W = R.current) == null ? void 0 : W.querySelector(".cms-filter-menu")) == null || te.focus()), ie.current = !1;
|
|
2313
|
+
}, [P]);
|
|
2314
|
+
const N = P && j !== null && u !== void 0 ? `${m}, ${Je(u)}` : m, O = Tn(k, o === void 0 ? null : () => {
|
|
2309
2315
|
x || (C(!0), o().finally(() => C(!1)));
|
|
2310
2316
|
}), Y = o === void 0 ? null : { distance: O, refreshing: x, text: p ?? null }, de = c !== void 0 || O > 0 || x || U || le, [Me, Ee] = ll(g, h === void 0 && !de), ue = !de && (h ?? Me);
|
|
2311
2317
|
return /* @__PURE__ */ i(
|
|
2312
2318
|
"div",
|
|
2313
2319
|
{
|
|
2314
2320
|
ref: g,
|
|
2315
|
-
className:
|
|
2321
|
+
className: $("cms-screen", d !== void 0 && "cms-screen--with-primary"),
|
|
2316
2322
|
"data-bar-hidden": ue ? "" : void 0,
|
|
2317
|
-
onFocus: (
|
|
2318
|
-
oe.current =
|
|
2323
|
+
onFocus: (B) => {
|
|
2324
|
+
oe.current = B.target, ue && B.target instanceof Element && B.target.closest(".cms-screen__bar") !== null && Ee(!1);
|
|
2319
2325
|
},
|
|
2320
2326
|
children: [
|
|
2321
2327
|
c !== void 0 ? /* @__PURE__ */ i("header", { className: "cms-screen__bar cms-screen__bar--searching", children: [
|
|
@@ -2341,14 +2347,14 @@ function zl({ title: n, back: l, navigation: t, search: r, searching: c, more: s
|
|
|
2341
2347
|
j !== null ? /* @__PURE__ */ e("span", { "data-ruler": "choice", children: fe }) : null
|
|
2342
2348
|
] }) : null,
|
|
2343
2349
|
/* @__PURE__ */ i("div", { ref: R, className: "cms-screen__trailing", children: [
|
|
2344
|
-
|
|
2345
|
-
J !== void 0 && !
|
|
2350
|
+
a !== void 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": a.label, title: a.label, onClick: a.onOpen, children: /* @__PURE__ */ e(L, { name: "search" }) }) : null,
|
|
2351
|
+
J !== void 0 && !P ? /* @__PURE__ */ e(nn, { ...J, iconOnly: !0, onOpenChange: ae }) : null,
|
|
2346
2352
|
q ? /* @__PURE__ */ e(
|
|
2347
2353
|
"button",
|
|
2348
2354
|
{
|
|
2349
2355
|
ref: z,
|
|
2350
2356
|
type: "button",
|
|
2351
|
-
className:
|
|
2357
|
+
className: $("cms-icon-button cms-screen__icon", P && j !== null && "cms-screen__icon--active"),
|
|
2352
2358
|
"data-action": "more",
|
|
2353
2359
|
"aria-haspopup": "menu",
|
|
2354
2360
|
"aria-expanded": U,
|
|
@@ -2357,14 +2363,14 @@ function zl({ title: n, back: l, navigation: t, search: r, searching: c, more: s
|
|
|
2357
2363
|
onMouseDown: () => {
|
|
2358
2364
|
V.current = U;
|
|
2359
2365
|
},
|
|
2360
|
-
onClick: (
|
|
2361
|
-
const E =
|
|
2366
|
+
onClick: (B) => {
|
|
2367
|
+
const E = B.currentTarget.getBoundingClientRect();
|
|
2362
2368
|
D(V.current ? null : { x: E.left, y: E.bottom + 4 }), V.current = !1;
|
|
2363
2369
|
},
|
|
2364
2370
|
children: /* @__PURE__ */ e(L, { name: "more" })
|
|
2365
2371
|
}
|
|
2366
2372
|
) : null,
|
|
2367
|
-
|
|
2373
|
+
r
|
|
2368
2374
|
] })
|
|
2369
2375
|
] }),
|
|
2370
2376
|
/* @__PURE__ */ e("div", { ref: k, className: "cms-screen__content", "data-pulling": O > 0 ? "" : void 0, "data-refreshing": x ? "" : void 0, children: /* @__PURE__ */ e(Ye.Provider, { value: Y, children: f }) }),
|
|
@@ -2376,9 +2382,9 @@ function zl({ title: n, back: l, navigation: t, search: r, searching: c, more: s
|
|
|
2376
2382
|
"aria-label": d.label,
|
|
2377
2383
|
title: d.label,
|
|
2378
2384
|
..."menu" in d ? { "aria-haspopup": "menu", "aria-expanded": w !== null } : {},
|
|
2379
|
-
onClick: (
|
|
2385
|
+
onClick: (B) => {
|
|
2380
2386
|
if ("menu" in d) {
|
|
2381
|
-
const E =
|
|
2387
|
+
const E = B.currentTarget.getBoundingClientRect();
|
|
2382
2388
|
b(w === null ? { x: E.left, y: E.top } : null);
|
|
2383
2389
|
} else
|
|
2384
2390
|
d.onPress();
|
|
@@ -2390,9 +2396,9 @@ function zl({ title: n, back: l, navigation: t, search: r, searching: c, more: s
|
|
|
2390
2396
|
ge,
|
|
2391
2397
|
{
|
|
2392
2398
|
at: U ? y : null,
|
|
2393
|
-
items:
|
|
2399
|
+
items: P && J !== void 0 ? [...s, ...Qe(J, J.label)] : s,
|
|
2394
2400
|
onClose: Z,
|
|
2395
|
-
label:
|
|
2401
|
+
label: m,
|
|
2396
2402
|
focus: "first"
|
|
2397
2403
|
}
|
|
2398
2404
|
),
|
|
@@ -2402,17 +2408,18 @@ function zl({ title: n, back: l, navigation: t, search: r, searching: c, more: s
|
|
|
2402
2408
|
);
|
|
2403
2409
|
}
|
|
2404
2410
|
export {
|
|
2405
|
-
|
|
2411
|
+
kl as AppShell,
|
|
2406
2412
|
Se as Avatar,
|
|
2407
2413
|
Ke as BOOTSTRAP_ICONS,
|
|
2408
2414
|
Rn as Badge,
|
|
2409
2415
|
he as Button,
|
|
2410
2416
|
He as CALL_LABELS,
|
|
2411
2417
|
Xn as CLIENT_UPDATE_REQUIRED,
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2418
|
+
Dl as CallBar,
|
|
2419
|
+
Tl as CallPanel,
|
|
2420
|
+
Sl as ChatBubble,
|
|
2421
|
+
Nl as Column,
|
|
2422
|
+
El as Composer,
|
|
2416
2423
|
ml as ConfirmDialog,
|
|
2417
2424
|
ge as ContextMenu,
|
|
2418
2425
|
hn as EmptyState,
|
|
@@ -2425,31 +2432,31 @@ export {
|
|
|
2425
2432
|
Vn as FilterMenu,
|
|
2426
2433
|
pl as ICON_NAMES,
|
|
2427
2434
|
L as Icon,
|
|
2428
|
-
|
|
2435
|
+
Al as IncomingCall,
|
|
2429
2436
|
vl as List,
|
|
2430
|
-
|
|
2437
|
+
Il as ListHead,
|
|
2431
2438
|
mn as Loading,
|
|
2432
2439
|
On as MAIL_ROW_LABELS,
|
|
2433
2440
|
un as MODAL_CLOSE_MS,
|
|
2434
|
-
|
|
2441
|
+
Cl as MailRow,
|
|
2435
2442
|
je as Modal,
|
|
2436
2443
|
_n as NamedIcon,
|
|
2437
|
-
|
|
2444
|
+
Bl as Notification,
|
|
2438
2445
|
De as PULL_AT,
|
|
2439
|
-
|
|
2440
|
-
|
|
2446
|
+
wl as PageHeader,
|
|
2447
|
+
Fl as PaneToolbar,
|
|
2441
2448
|
Un as SIGN_IN_LABELS,
|
|
2442
2449
|
Te as STATE_DELAY_MS,
|
|
2443
|
-
|
|
2444
|
-
|
|
2450
|
+
Kl as ScreenShell,
|
|
2451
|
+
xl as SearchField,
|
|
2445
2452
|
gl as SectionHeader,
|
|
2446
2453
|
dl as Select,
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2454
|
+
$l as SignInForm,
|
|
2455
|
+
Ll as SignInLayout,
|
|
2456
|
+
Ml as SplitPanes,
|
|
2457
|
+
Pn as Splitter,
|
|
2451
2458
|
me as State,
|
|
2452
|
-
|
|
2459
|
+
yl as TabStrip,
|
|
2453
2460
|
ol as TextArea,
|
|
2454
2461
|
il as TextField,
|
|
2455
2462
|
hl as Toast,
|
|
@@ -2459,16 +2466,16 @@ export {
|
|
|
2459
2466
|
we as iconForName,
|
|
2460
2467
|
Ln as initialsOf,
|
|
2461
2468
|
jn as isCapability,
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2469
|
+
zl as needsClientUpdate,
|
|
2470
|
+
Pl as offerFor,
|
|
2471
|
+
Ul as readConflict,
|
|
2472
|
+
Rl as readRefusal,
|
|
2466
2473
|
Yn as refusalText,
|
|
2467
|
-
|
|
2474
|
+
Hl as rereadAll,
|
|
2468
2475
|
$n as tintOf,
|
|
2469
2476
|
Tn as usePull,
|
|
2470
2477
|
Dn as usePullState,
|
|
2471
|
-
|
|
2478
|
+
Ol as useReread,
|
|
2472
2479
|
Jn as versionBelow,
|
|
2473
2480
|
on as writtenOut
|
|
2474
2481
|
};
|