@coolms/ui-react 0.1.0-alpha.27 → 0.1.0-alpha.29
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/design-tokens.lock.json +3 -3
- package/dist/components/Collections.d.ts +1 -1
- package/dist/components/ScreenShell.d.ts +3 -3
- package/dist/components/SignIn.d.ts +1 -1
- package/dist/components/Workspace.d.ts +5 -2
- package/dist/index.d.ts +22 -22
- package/dist/index.js +711 -691
- package/kit.contract.json +1 -0
- package/package.json +7 -3
- package/src/kit.css +16 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as e, jsxs as u, Fragment as M } from "react/jsx-runtime";
|
|
2
|
-
import { useId as G, useState as E, useRef as
|
|
2
|
+
import { useId as G, useState as E, useRef as F, useEffect as Y, useCallback as be, useMemo as Oe, useLayoutEffect as ge, useContext as Ke, createContext as Ue } from "react";
|
|
3
3
|
import { createPortal as Me } from "react-dom";
|
|
4
4
|
function ce(n, l) {
|
|
5
5
|
const t = { ...n };
|
|
6
|
-
for (const
|
|
7
|
-
const
|
|
8
|
-
|
|
6
|
+
for (const i of Object.keys(l ?? {})) {
|
|
7
|
+
const c = l == null ? void 0 : l[i];
|
|
8
|
+
c !== void 0 && (t[i] = c);
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
}
|
|
@@ -35,47 +35,47 @@ function le({
|
|
|
35
35
|
variant: n = "secondary",
|
|
36
36
|
busy: l = !1,
|
|
37
37
|
busyLabel: t,
|
|
38
|
-
locked:
|
|
39
|
-
lockedReason:
|
|
38
|
+
locked: i = !1,
|
|
39
|
+
lockedReason: c,
|
|
40
40
|
icon: s,
|
|
41
|
-
disabled:
|
|
42
|
-
className:
|
|
43
|
-
children:
|
|
41
|
+
disabled: d,
|
|
42
|
+
className: r,
|
|
43
|
+
children: f,
|
|
44
44
|
type: _ = "button",
|
|
45
|
-
title:
|
|
46
|
-
...
|
|
45
|
+
title: o,
|
|
46
|
+
...m
|
|
47
47
|
}) {
|
|
48
|
-
const
|
|
48
|
+
const a = !!d || l;
|
|
49
49
|
return /* @__PURE__ */ u(
|
|
50
50
|
"button",
|
|
51
51
|
{
|
|
52
|
-
...
|
|
52
|
+
...m,
|
|
53
53
|
type: _,
|
|
54
|
-
className: A("cms-button", `cms-button--${n}`, l && "is-busy",
|
|
55
|
-
disabled:
|
|
54
|
+
className: A("cms-button", `cms-button--${n}`, l && "is-busy", i && "is-locked", r),
|
|
55
|
+
disabled: a,
|
|
56
56
|
"aria-busy": l || void 0,
|
|
57
|
-
title:
|
|
57
|
+
title: i ? c ?? o : o,
|
|
58
58
|
children: [
|
|
59
|
-
l ? /* @__PURE__ */ e(z, { name: "spinner" }) :
|
|
60
|
-
/* @__PURE__ */ e("span", { className: "cms-button__label", children: l && t !== void 0 ? t :
|
|
61
|
-
|
|
59
|
+
l ? /* @__PURE__ */ e(z, { name: "spinner" }) : i ? /* @__PURE__ */ e(z, { name: "lock" }) : s,
|
|
60
|
+
/* @__PURE__ */ e("span", { className: "cms-button__label", children: l && t !== void 0 ? t : f }),
|
|
61
|
+
i && c ? /* @__PURE__ */ u("span", { className: "cms-visually-hidden", children: [
|
|
62
62
|
", ",
|
|
63
|
-
|
|
63
|
+
c
|
|
64
64
|
] }) : null
|
|
65
65
|
]
|
|
66
66
|
}
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
|
-
function Ce({ id: n, label: l, help: t, error:
|
|
70
|
-
return /* @__PURE__ */ u("div", { className: A("cms-field",
|
|
69
|
+
function Ce({ id: n, label: l, help: t, error: i, pinned: c, children: s }) {
|
|
70
|
+
return /* @__PURE__ */ u("div", { className: A("cms-field", i != 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__ */ u("p", { className: "cms-field__pinned", id: `${n}-pinned`, children: [
|
|
74
74
|
/* @__PURE__ */ e(z, { name: "lock" }),
|
|
75
75
|
" ",
|
|
76
|
-
|
|
76
|
+
c
|
|
77
77
|
] }) : null,
|
|
78
|
-
|
|
78
|
+
i != null ? /* @__PURE__ */ e("p", { className: "cms-field__error", id: `${n}-error`, role: "alert", children: i }) : null,
|
|
79
79
|
t != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${n}-help`, children: t }) : null
|
|
80
80
|
] });
|
|
81
81
|
}
|
|
@@ -83,28 +83,28 @@ function Se(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
|
-
const ze = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/,
|
|
87
|
-
function
|
|
88
|
-
const
|
|
89
|
-
const
|
|
90
|
-
return
|
|
91
|
-
},
|
|
86
|
+
const ze = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/, Ve = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
|
|
87
|
+
function Ze(n, l, t) {
|
|
88
|
+
const i = (s, d, r, f = 0, _ = 0, o = 0) => {
|
|
89
|
+
const m = new Date(Date.UTC(s, d - 1, r, f, _, o));
|
|
90
|
+
return m.setUTCFullYear(s), m.getUTCFullYear() === s && m.getUTCMonth() === d - 1 && m.getUTCDate() === r && m.getUTCHours() === f && m.getUTCMinutes() === _ && m.getUTCSeconds() === o ? m : null;
|
|
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 d = l.match(Ve);
|
|
95
|
+
if (d === null) return l;
|
|
96
|
+
const r = c(d), f = i(2e3, 1, 1, r.hour, r.minute, r.second);
|
|
97
|
+
return f === null ? l : new Intl.DateTimeFormat(t, { timeStyle: d[3] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(f);
|
|
98
98
|
}
|
|
99
99
|
const s = l.match(ze);
|
|
100
100
|
if (s === null) return l;
|
|
101
101
|
if (n === "date" && s[4] === void 0) {
|
|
102
|
-
const
|
|
103
|
-
return
|
|
102
|
+
const d = i(Number(s[1]), Number(s[2]), Number(s[3]));
|
|
103
|
+
return d === null ? l : new Intl.DateTimeFormat(t, { dateStyle: "medium", timeZone: "UTC" }).format(d);
|
|
104
104
|
}
|
|
105
105
|
if (n === "datetime-local" && s[4] !== void 0) {
|
|
106
|
-
const
|
|
107
|
-
return
|
|
106
|
+
const d = i(Number(s[1]), Number(s[2]), Number(s[3]), Number(s[4]), Number(s[5]), Number(s[6] ?? 0));
|
|
107
|
+
return d === null ? l : new Intl.DateTimeFormat(t, { dateStyle: "medium", timeStyle: s[6] === void 0 ? "short" : "medium", timeZone: "UTC" }).format(d);
|
|
108
108
|
}
|
|
109
109
|
} catch {
|
|
110
110
|
return l;
|
|
@@ -112,136 +112,136 @@ function Ve(n, l, t) {
|
|
|
112
112
|
return l;
|
|
113
113
|
}
|
|
114
114
|
const We = /* @__PURE__ */ new Set(["date", "time", "datetime-local"]);
|
|
115
|
-
function Fn({ label: n, help: l, error: t, disabled:
|
|
116
|
-
const x = G(), S =
|
|
115
|
+
function Fn({ label: n, help: l, error: t, disabled: i, readOnly: c, pinned: s, value: d, onChange: r, placeholder: f, type: _ = "text", name: o, locale: m, min: a, max: h, step: p, minLength: v, maxLength: N, required: w }) {
|
|
116
|
+
const x = G(), S = c === !0 || s != null, C = S && We.has(_), R = _ === "number" && (p === "any" || typeof p == "number" && !Number.isInteger(p));
|
|
117
117
|
return /* @__PURE__ */ e(Ce, { id: x, label: n, help: l, error: t, pinned: s, children: /* @__PURE__ */ e(
|
|
118
118
|
"input",
|
|
119
119
|
{
|
|
120
120
|
id: x,
|
|
121
|
-
name:
|
|
121
|
+
name: o,
|
|
122
122
|
type: C ? "text" : _,
|
|
123
123
|
className: "cms-input",
|
|
124
|
-
value: C ?
|
|
125
|
-
...C ? { "data-value":
|
|
126
|
-
lang:
|
|
127
|
-
placeholder:
|
|
128
|
-
disabled:
|
|
124
|
+
value: C ? Ze(_, d, m) : d,
|
|
125
|
+
...C ? { "data-value": d } : {},
|
|
126
|
+
lang: m,
|
|
127
|
+
placeholder: f,
|
|
128
|
+
disabled: i,
|
|
129
129
|
readOnly: S,
|
|
130
130
|
required: w,
|
|
131
131
|
"aria-required": w || void 0,
|
|
132
|
-
min: C ? void 0 :
|
|
133
|
-
max: C ? void 0 :
|
|
132
|
+
min: C ? void 0 : a,
|
|
133
|
+
max: C ? void 0 : h,
|
|
134
134
|
step: C ? void 0 : p,
|
|
135
|
-
minLength:
|
|
135
|
+
minLength: v,
|
|
136
136
|
maxLength: N,
|
|
137
|
-
inputMode: _ === "number" ?
|
|
137
|
+
inputMode: _ === "number" ? R ? "decimal" : "numeric" : void 0,
|
|
138
138
|
"aria-invalid": t != null || void 0,
|
|
139
139
|
"aria-describedby": Se(x, { help: l, error: t, pinned: s }),
|
|
140
|
-
onChange: (H) =>
|
|
140
|
+
onChange: (H) => r == null ? void 0 : r(H.target.value)
|
|
141
141
|
}
|
|
142
142
|
) });
|
|
143
143
|
}
|
|
144
|
-
function
|
|
145
|
-
const
|
|
146
|
-
return /* @__PURE__ */ e(Ce, { id:
|
|
144
|
+
function Rn({ label: n, help: l, error: t, disabled: i, readOnly: c, pinned: s, value: d, onChange: r, placeholder: f, rows: _ = 4, name: o, locale: m, minLength: a, maxLength: h, required: p }) {
|
|
145
|
+
const v = G();
|
|
146
|
+
return /* @__PURE__ */ e(Ce, { id: v, label: n, help: l, error: t, pinned: s, children: /* @__PURE__ */ e(
|
|
147
147
|
"textarea",
|
|
148
148
|
{
|
|
149
|
-
id:
|
|
150
|
-
name:
|
|
149
|
+
id: v,
|
|
150
|
+
name: o,
|
|
151
151
|
className: "cms-input cms-textarea",
|
|
152
152
|
rows: _,
|
|
153
|
-
value:
|
|
154
|
-
lang:
|
|
155
|
-
placeholder:
|
|
156
|
-
disabled:
|
|
157
|
-
readOnly:
|
|
153
|
+
value: d,
|
|
154
|
+
lang: m,
|
|
155
|
+
placeholder: f,
|
|
156
|
+
disabled: i,
|
|
157
|
+
readOnly: c === !0 || s != null,
|
|
158
158
|
required: p,
|
|
159
159
|
"aria-required": p || void 0,
|
|
160
|
-
minLength:
|
|
161
|
-
maxLength:
|
|
160
|
+
minLength: a,
|
|
161
|
+
maxLength: h,
|
|
162
162
|
"aria-invalid": t != null || void 0,
|
|
163
|
-
"aria-describedby": Se(
|
|
164
|
-
onChange: (N) =>
|
|
163
|
+
"aria-describedby": Se(v, { help: l, error: t, pinned: s }),
|
|
164
|
+
onChange: (N) => r == null ? void 0 : r(N.target.value)
|
|
165
165
|
}
|
|
166
166
|
) });
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
const
|
|
170
|
-
return /* @__PURE__ */ e(Ce, { id:
|
|
168
|
+
function Hn({ label: n, help: l, error: t, disabled: i, readOnly: c, value: s, options: d, onChange: r, emptyText: f = "Nothing to choose from yet.", name: _ }) {
|
|
169
|
+
const o = G(), m = d.length === 0;
|
|
170
|
+
return /* @__PURE__ */ e(Ce, { id: o, label: n, help: m ? f : l, error: t, children: /* @__PURE__ */ e(
|
|
171
171
|
"select",
|
|
172
172
|
{
|
|
173
|
-
id:
|
|
173
|
+
id: o,
|
|
174
174
|
name: _,
|
|
175
175
|
className: "cms-input cms-select",
|
|
176
176
|
value: s,
|
|
177
|
-
disabled:
|
|
178
|
-
"aria-readonly":
|
|
177
|
+
disabled: i || m,
|
|
178
|
+
"aria-readonly": c || void 0,
|
|
179
179
|
"aria-invalid": t != null || void 0,
|
|
180
|
-
"aria-describedby": Se(
|
|
181
|
-
onChange: (
|
|
182
|
-
|
|
180
|
+
"aria-describedby": Se(o, { help: m ? f : l, error: t }),
|
|
181
|
+
onChange: (a) => {
|
|
182
|
+
c || r == null || r(a.target.value);
|
|
183
183
|
},
|
|
184
|
-
children:
|
|
184
|
+
children: d.map((a) => /* @__PURE__ */ e("option", { value: a.value, disabled: c && a.value !== s, children: a.label }, a.value))
|
|
185
185
|
}
|
|
186
186
|
) });
|
|
187
187
|
}
|
|
188
|
-
function On({ label: n, checked: l, onChange: t, disabled:
|
|
189
|
-
const
|
|
188
|
+
function On({ label: n, checked: l, onChange: t, disabled: i, readOnly: c, help: s }) {
|
|
189
|
+
const d = G();
|
|
190
190
|
return /* @__PURE__ */ u("div", { className: "cms-toggle-row", children: [
|
|
191
191
|
/* @__PURE__ */ e(
|
|
192
192
|
"button",
|
|
193
193
|
{
|
|
194
|
-
id:
|
|
194
|
+
id: d,
|
|
195
195
|
type: "button",
|
|
196
196
|
role: "switch",
|
|
197
197
|
className: A("cms-toggle", l && "is-on"),
|
|
198
198
|
"aria-checked": l,
|
|
199
|
-
"aria-readonly":
|
|
200
|
-
"aria-describedby": s != null ? `${
|
|
201
|
-
disabled:
|
|
199
|
+
"aria-readonly": c || void 0,
|
|
200
|
+
"aria-describedby": s != null ? `${d}-help` : void 0,
|
|
201
|
+
disabled: i,
|
|
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: d, children: n }),
|
|
209
|
+
s != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${d}-help`, children: s }) : null
|
|
210
210
|
] });
|
|
211
211
|
}
|
|
212
212
|
const je = 150;
|
|
213
|
-
function Pe({ open: n, title: l, onClose: t, dirty:
|
|
214
|
-
const [
|
|
213
|
+
function Pe({ open: n, title: l, onClose: t, dirty: i = !1, onDirtyClose: c, children: s, footer: d, closeLabel: r = "Close", initialFocus: f, className: _ }) {
|
|
214
|
+
const [o, m] = E(n), [a, h] = E(!1), p = F(null), v = F(null), N = G();
|
|
215
215
|
if (Y(() => {
|
|
216
216
|
if (n) {
|
|
217
|
-
|
|
217
|
+
v.current = document.activeElement, m(!0), h(!1);
|
|
218
218
|
return;
|
|
219
219
|
}
|
|
220
|
-
if (!
|
|
221
|
-
|
|
220
|
+
if (!o) return;
|
|
221
|
+
h(!0);
|
|
222
222
|
const x = window.setTimeout(() => {
|
|
223
223
|
var S, C;
|
|
224
|
-
|
|
224
|
+
m(!1), h(!1), (C = (S = v.current) == null ? void 0 : S.focus) == null || C.call(S);
|
|
225
225
|
}, je);
|
|
226
226
|
return () => window.clearTimeout(x);
|
|
227
|
-
}, [n,
|
|
227
|
+
}, [n, o]), Y(() => {
|
|
228
228
|
var x, S;
|
|
229
|
-
if (n &&
|
|
229
|
+
if (n && o) {
|
|
230
230
|
const C = 'input, select, textarea, button, [href], [tabindex]:not([tabindex="-1"])';
|
|
231
|
-
(S = (
|
|
231
|
+
(S = (f == null ? void 0 : f.current) ?? ((x = p.current) == null ? void 0 : x.querySelector(`.cms-modal__body :is(${C}), .cms-modal__foot :is(${C})`)) ?? p.current) == null || S.focus();
|
|
232
232
|
}
|
|
233
|
-
}, [n,
|
|
233
|
+
}, [n, o, f]), !o) return null;
|
|
234
234
|
const w = () => {
|
|
235
|
-
|
|
235
|
+
i ? c == null || c() : t();
|
|
236
236
|
};
|
|
237
237
|
return Me(
|
|
238
|
-
/* @__PURE__ */ e("div", { className: A("cms-modal-scrim",
|
|
238
|
+
/* @__PURE__ */ e("div", { className: A("cms-modal-scrim", a && "is-closing"), onMouseDown: (x) => {
|
|
239
239
|
x.target === x.currentTarget && w();
|
|
240
240
|
}, children: /* @__PURE__ */ u(
|
|
241
241
|
"div",
|
|
242
242
|
{
|
|
243
243
|
ref: p,
|
|
244
|
-
className: A("cms-modal", _,
|
|
244
|
+
className: A("cms-modal", _, a && "is-closing", i && "is-dirty"),
|
|
245
245
|
role: "dialog",
|
|
246
246
|
"aria-modal": "true",
|
|
247
247
|
"aria-labelledby": N,
|
|
@@ -253,37 +253,37 @@ function Pe({ open: n, title: l, onClose: t, dirty: o = !1, onDirtyClose: i, chi
|
|
|
253
253
|
else if (x.key === "Tab") {
|
|
254
254
|
const C = (S = p.current) == null ? void 0 : S.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
|
|
255
255
|
if (!C || C.length === 0) return;
|
|
256
|
-
const
|
|
257
|
-
x.shiftKey && document.activeElement ===
|
|
256
|
+
const R = C[0], H = C[C.length - 1];
|
|
257
|
+
x.shiftKey && document.activeElement === R ? (x.preventDefault(), H.focus()) : !x.shiftKey && document.activeElement === H && (x.preventDefault(), R.focus());
|
|
258
258
|
}
|
|
259
259
|
},
|
|
260
260
|
children: [
|
|
261
261
|
/* @__PURE__ */ u("header", { className: "cms-modal__head", children: [
|
|
262
262
|
/* @__PURE__ */ e("h2", { className: "cms-modal__title", id: N, 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: w, children: /* @__PURE__ */ e(z, { name: "close" }) })
|
|
264
264
|
] }),
|
|
265
265
|
/* @__PURE__ */ e("div", { className: "cms-modal__body", children: s }),
|
|
266
|
-
|
|
266
|
+
d != null ? /* @__PURE__ */ e("footer", { className: "cms-modal__foot", children: d }) : null
|
|
267
267
|
]
|
|
268
268
|
}
|
|
269
269
|
) }),
|
|
270
270
|
document.body
|
|
271
271
|
);
|
|
272
272
|
}
|
|
273
|
-
function Kn({ open: n, title: l, message: t, kind:
|
|
274
|
-
const _ =
|
|
273
|
+
function Kn({ open: n, title: l, message: t, kind: i = "default", confirmLabel: c, cancelLabel: s, closeLabel: d, onConfirm: r, onCancel: f }) {
|
|
274
|
+
const _ = i === "discard-changes";
|
|
275
275
|
return /* @__PURE__ */ e(
|
|
276
276
|
Pe,
|
|
277
277
|
{
|
|
278
278
|
open: n,
|
|
279
279
|
title: l,
|
|
280
|
-
onClose:
|
|
281
|
-
...
|
|
280
|
+
onClose: f,
|
|
281
|
+
...d === void 0 ? {} : { closeLabel: d },
|
|
282
282
|
footer: /* @__PURE__ */ u(M, { children: [
|
|
283
|
-
/* @__PURE__ */ e(le, { onClick:
|
|
284
|
-
/* @__PURE__ */ e(le, { variant:
|
|
283
|
+
/* @__PURE__ */ e(le, { onClick: f, children: s ?? (_ ? "Keep editing" : "Cancel") }),
|
|
284
|
+
/* @__PURE__ */ e(le, { variant: i === "default" ? "primary" : "danger", onClick: r, children: c ?? (_ ? "Discard changes" : "Confirm") })
|
|
285
285
|
] }),
|
|
286
|
-
children:
|
|
286
|
+
children: i !== "default" ? /* @__PURE__ */ u("p", { className: "cms-confirm__warning", children: [
|
|
287
287
|
/* @__PURE__ */ e(z, { name: "warning" }),
|
|
288
288
|
" ",
|
|
289
289
|
t
|
|
@@ -291,12 +291,12 @@ function Kn({ open: n, title: l, message: t, kind: o = "default", confirmLabel:
|
|
|
291
291
|
}
|
|
292
292
|
);
|
|
293
293
|
}
|
|
294
|
-
function Un({ kind: n, message: l, action: t, onDismiss:
|
|
294
|
+
function Un({ kind: n, message: l, action: t, onDismiss: i, dismissLabel: c = "Dismiss" }) {
|
|
295
295
|
return /* @__PURE__ */ u("div", { className: A("cms-toast", `cms-toast--${n}`), role: n === "error" ? "alert" : "status", children: [
|
|
296
296
|
/* @__PURE__ */ e(z, { name: n === "success" ? "check" : n === "error" ? "warning" : "info" }),
|
|
297
297
|
/* @__PURE__ */ e("span", { className: "cms-toast__message", children: l }),
|
|
298
298
|
t ? /* @__PURE__ */ e(le, { className: "cms-toast__action", onClick: t.onAction, children: t.label }) : null,
|
|
299
|
-
|
|
299
|
+
i ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": c, onClick: i, children: /* @__PURE__ */ e(z, { name: "close" }) }) : null
|
|
300
300
|
] });
|
|
301
301
|
}
|
|
302
302
|
function zn({ children: n }) {
|
|
@@ -479,7 +479,7 @@ const Be = {
|
|
|
479
479
|
more: /* @__PURE__ */ e("path", { d: "M5 12h.5M12 12h.5M19 12h.5" }),
|
|
480
480
|
important: /* @__PURE__ */ e("path", { d: "M4 6h11l5 6-5 6H4l4-6-4-6Z" })
|
|
481
481
|
};
|
|
482
|
-
function
|
|
482
|
+
function T({ name: n, size: l = 20, label: t }) {
|
|
483
483
|
return /* @__PURE__ */ e(
|
|
484
484
|
"svg",
|
|
485
485
|
{
|
|
@@ -498,7 +498,7 @@ function L({ name: n, size: l = 20, label: t }) {
|
|
|
498
498
|
}
|
|
499
499
|
);
|
|
500
500
|
}
|
|
501
|
-
const
|
|
501
|
+
const Vn = Object.keys(Be), Ae = {
|
|
502
502
|
reply: "reply",
|
|
503
503
|
"reply-all": "reply",
|
|
504
504
|
forward: "forward",
|
|
@@ -546,17 +546,17 @@ function Xe() {
|
|
|
546
546
|
return !1;
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
|
-
const
|
|
549
|
+
const Le = /* @__PURE__ */ new Set();
|
|
550
550
|
function Je({ name: n, size: l = 18 }) {
|
|
551
551
|
if (n === "") return null;
|
|
552
552
|
const t = re(n);
|
|
553
|
-
return t !== null ? /* @__PURE__ */ e(
|
|
553
|
+
return t !== null ? /* @__PURE__ */ e(T, { name: t, size: l }) : (!Le.has(n) && Xe() && (Le.add(n), console.warn(`@coolms/ui-react: no icon for the server's icon name "${n}"; its space is kept empty`)), /* @__PURE__ */ e("span", { className: "cms-icon cms-icon--blank", style: { width: l, height: l }, "aria-hidden": "true", "data-icon-name": n }));
|
|
554
554
|
}
|
|
555
|
-
const
|
|
555
|
+
const we = 300;
|
|
556
556
|
function Qe() {
|
|
557
|
-
if (typeof window > "u" || typeof getComputedStyle != "function") return
|
|
557
|
+
if (typeof window > "u" || typeof getComputedStyle != "function") return we;
|
|
558
558
|
const n = getComputedStyle(document.documentElement).getPropertyValue("--cms-state-delay").trim(), l = n.endsWith("ms") ? Number.parseFloat(n) : n.endsWith("s") ? Number.parseFloat(n) * 1e3 : Number.NaN;
|
|
559
|
-
return Number.isFinite(l) && l >= 0 ? l :
|
|
559
|
+
return Number.isFinite(l) && l >= 0 ? l : we;
|
|
560
560
|
}
|
|
561
561
|
function en() {
|
|
562
562
|
return /* @__PURE__ */ u("svg", { className: "cms-state__spinner", viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
|
|
@@ -564,32 +564,32 @@ function en() {
|
|
|
564
564
|
/* @__PURE__ */ e("circle", { className: "cms-state__arc", cx: "12", cy: "12", r: "10", fill: "none", pathLength: "100", strokeDasharray: "28 72" })
|
|
565
565
|
] });
|
|
566
566
|
}
|
|
567
|
-
function ne({ kind: n, title: l, description: t, action:
|
|
568
|
-
const [
|
|
567
|
+
function ne({ kind: n, title: l, description: t, action: i, placement: c = "block", icon: s }) {
|
|
568
|
+
const [d, r] = E(n !== "loading");
|
|
569
569
|
return Y(() => {
|
|
570
570
|
if (n !== "loading") {
|
|
571
|
-
|
|
571
|
+
r(!0);
|
|
572
572
|
return;
|
|
573
573
|
}
|
|
574
|
-
|
|
575
|
-
const
|
|
576
|
-
return () => window.clearTimeout(
|
|
574
|
+
r(!1);
|
|
575
|
+
const f = window.setTimeout(() => r(!0), Qe());
|
|
576
|
+
return () => window.clearTimeout(f);
|
|
577
577
|
}, [n]), /* @__PURE__ */ u(
|
|
578
578
|
"div",
|
|
579
579
|
{
|
|
580
|
-
className: A("cms-state", `cms-state--${n}`, `cms-state--${
|
|
580
|
+
className: A("cms-state", `cms-state--${n}`, `cms-state--${c}`, !d && "is-waiting"),
|
|
581
581
|
role: "status",
|
|
582
582
|
"aria-live": "polite",
|
|
583
583
|
"data-kind": n,
|
|
584
584
|
children: [
|
|
585
585
|
n === "loading" ? /* @__PURE__ */ e(en, {}) : null,
|
|
586
586
|
n === "error" || n === "denied" ? /* @__PURE__ */ e(z, { name: n === "error" ? "warning" : "lock" }) : null,
|
|
587
|
-
n === "empty" && s !== void 0 && re(s) !== null ? /* @__PURE__ */ e("span", { className: "cms-state__icon", "aria-hidden": "true", children: /* @__PURE__ */ e(Je, { name: s, size:
|
|
587
|
+
n === "empty" && s !== void 0 && re(s) !== null ? /* @__PURE__ */ e("span", { className: "cms-state__icon", "aria-hidden": "true", children: /* @__PURE__ */ e(Je, { name: s, size: c === "page" ? 32 : 24 }) }) : null,
|
|
588
588
|
/* @__PURE__ */ u("span", { className: "cms-state__text", children: [
|
|
589
589
|
/* @__PURE__ */ e("span", { className: "cms-state__title", children: l }),
|
|
590
590
|
t !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-state__description", children: t }) : null
|
|
591
591
|
] }),
|
|
592
|
-
|
|
592
|
+
i !== void 0 && n !== "denied" ? /* @__PURE__ */ e(le, { className: "cms-state__action", onClick: i.onAction, children: i.label }) : null
|
|
593
593
|
]
|
|
594
594
|
}
|
|
595
595
|
);
|
|
@@ -604,72 +604,72 @@ function an(n) {
|
|
|
604
604
|
function sn(n) {
|
|
605
605
|
return n.getClientRects().length > 0;
|
|
606
606
|
}
|
|
607
|
-
function
|
|
608
|
-
const { name: l, badge: t, closeLabel:
|
|
607
|
+
function Zn(n) {
|
|
608
|
+
const { name: l, badge: t, closeLabel: i, onClose: c, actions: s = [], moreLabel: d = "More", edit: r, editing: f, state: _, siblings: o, bar: m, thumbnails: a, strip: h, onZoom: p, children: v } = n, N = F(null), w = F(null), x = G(), [S, C] = E(!1), R = F(null);
|
|
609
609
|
Y(() => {
|
|
610
|
-
var
|
|
610
|
+
var Z;
|
|
611
611
|
const y = document.activeElement, P = document.body.style.overflow;
|
|
612
|
-
return document.body.style.overflow = "hidden", (
|
|
612
|
+
return document.body.style.overflow = "hidden", (Z = w.current) == null || Z.focus(), () => {
|
|
613
613
|
var D;
|
|
614
614
|
document.body.style.overflow = P, (D = y == null ? void 0 : y.focus) == null || D.call(y);
|
|
615
615
|
};
|
|
616
616
|
}, []);
|
|
617
617
|
const H = () => {
|
|
618
|
-
|
|
618
|
+
f != null && f.dirty ? f.onDirtyClose() : c();
|
|
619
619
|
}, ee = (y) => {
|
|
620
620
|
const P = y.touches.length === 1 ? y.touches[0] : void 0;
|
|
621
|
-
|
|
621
|
+
R.current = P === void 0 || f !== void 0 || an(y.target) ? null : { x: P.clientX, y: P.clientY };
|
|
622
622
|
}, j = (y) => {
|
|
623
623
|
var X, O;
|
|
624
|
-
const P =
|
|
625
|
-
if (
|
|
626
|
-
const D =
|
|
627
|
-
Math.abs(D) < ln || Math.abs(D) < Math.abs(
|
|
624
|
+
const P = R.current, Z = y.changedTouches[0];
|
|
625
|
+
if (R.current = null, P === null || Z === void 0) return;
|
|
626
|
+
const D = Z.clientX - P.x;
|
|
627
|
+
Math.abs(D) < ln || Math.abs(D) < Math.abs(Z.clientY - P.y) || (D > 0 ? (X = o == null ? void 0 : o.onPrevious) == null || X.call(o) : (O = o == null ? void 0 : o.onNext) == null || O.call(o));
|
|
628
628
|
};
|
|
629
629
|
return Me(
|
|
630
630
|
/* @__PURE__ */ u(
|
|
631
631
|
"div",
|
|
632
632
|
{
|
|
633
633
|
ref: N,
|
|
634
|
-
className: A("cms-viewer",
|
|
634
|
+
className: A("cms-viewer", f !== void 0 && "is-editing"),
|
|
635
635
|
role: "dialog",
|
|
636
636
|
"aria-modal": "true",
|
|
637
637
|
"aria-labelledby": x,
|
|
638
638
|
tabIndex: -1,
|
|
639
639
|
onKeyDown: (y) => {
|
|
640
|
-
var P,
|
|
640
|
+
var P, Z, D;
|
|
641
641
|
if (y.key === "Escape") {
|
|
642
|
-
if (
|
|
643
|
-
y.stopPropagation(), S ? C(!1) :
|
|
642
|
+
if (f !== void 0) return;
|
|
643
|
+
y.stopPropagation(), S ? C(!1) : c();
|
|
644
644
|
} else if (y.key === "Tab") {
|
|
645
645
|
const X = Array.from(((P = N.current) == null ? void 0 : P.querySelectorAll(nn)) ?? []).filter(sn);
|
|
646
646
|
if (X.length === 0) return;
|
|
647
647
|
const O = X[0], J = X[X.length - 1];
|
|
648
648
|
y.shiftKey && document.activeElement === O ? (y.preventDefault(), J.focus()) : !y.shiftKey && document.activeElement === J && (y.preventDefault(), O.focus());
|
|
649
|
-
} else
|
|
649
|
+
} else f === void 0 && !tn(y.target) && !y.ctrlKey && !y.metaKey && !y.altKey && (y.key === "ArrowLeft" ? (Z = o == null ? void 0 : o.onPrevious) == null || Z.call(o) : y.key === "ArrowRight" ? (D = o == null ? void 0 : o.onNext) == null || D.call(o) : y.key === "+" || y.key === "=" ? p == null || p("in") : y.key === "-" ? p == null || p("out") : y.key === "0" && (p == null || p("reset")));
|
|
650
650
|
},
|
|
651
651
|
children: [
|
|
652
|
-
|
|
652
|
+
o !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-visually-hidden", role: "status", children: `${l}, ${o.position}` }) : null,
|
|
653
653
|
/* @__PURE__ */ u("header", { className: "cms-viewer__top", children: [
|
|
654
|
-
/* @__PURE__ */ e("button", { ref: w, type: "button", className: "cms-viewer__icon", "aria-label":
|
|
654
|
+
/* @__PURE__ */ e("button", { ref: w, type: "button", className: "cms-viewer__icon", "aria-label": i, onClick: H, children: /* @__PURE__ */ e(z, { name: "close" }) }),
|
|
655
655
|
/* @__PURE__ */ e("span", { className: "cms-viewer__badge", children: t }),
|
|
656
656
|
/* @__PURE__ */ e("h2", { className: "cms-viewer__name", id: x, title: l, children: l }),
|
|
657
|
-
|
|
657
|
+
o !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-viewer__position", children: o.position }) : null,
|
|
658
658
|
/* @__PURE__ */ e("span", { className: "cms-viewer__space" }),
|
|
659
|
-
|
|
660
|
-
/* @__PURE__ */ e("span", { className: "cms-viewer__status", role: "status", children:
|
|
661
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick:
|
|
659
|
+
f !== void 0 ? /* @__PURE__ */ u(M, { children: [
|
|
660
|
+
/* @__PURE__ */ e("span", { className: "cms-viewer__status", role: "status", children: f.status }),
|
|
661
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: f.onDone, children: f.doneLabel })
|
|
662
662
|
] }) : /* @__PURE__ */ u(M, { children: [
|
|
663
663
|
/* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: s.map((y) => /* @__PURE__ */ u("button", { type: "button", className: "cms-viewer__button", onClick: y.onSelect, children: [
|
|
664
664
|
y.icon,
|
|
665
665
|
y.label
|
|
666
666
|
] }, y.label)) }),
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
/* @__PURE__ */ e("span", { className: "cms-viewer__wide", children:
|
|
667
|
+
r !== void 0 ? /* @__PURE__ */ u("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": r.label, onClick: r.onEdit, children: [
|
|
668
|
+
r.icon,
|
|
669
|
+
/* @__PURE__ */ e("span", { className: "cms-viewer__wide", children: r.label })
|
|
670
670
|
] }) : null,
|
|
671
671
|
s.length > 0 ? /* @__PURE__ */ u("span", { className: "cms-viewer__more", children: [
|
|
672
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label":
|
|
672
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label": d, "aria-expanded": S, onClick: () => C((y) => !y), children: /* @__PURE__ */ e(T, { name: "more" }) }),
|
|
673
673
|
S ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: s.map((y) => /* @__PURE__ */ u(
|
|
674
674
|
"button",
|
|
675
675
|
{
|
|
@@ -689,21 +689,21 @@ function Vn(n) {
|
|
|
689
689
|
] })
|
|
690
690
|
] }),
|
|
691
691
|
/* @__PURE__ */ u("div", { className: "cms-viewer__body", children: [
|
|
692
|
-
|
|
692
|
+
a != null && f === void 0 ? /* @__PURE__ */ e("nav", { className: "cms-viewer__thumbnails", children: a }) : null,
|
|
693
693
|
/* @__PURE__ */ u("div", { className: "cms-viewer__content", onTouchStart: ee, onTouchEnd: j, children: [
|
|
694
|
-
(
|
|
695
|
-
/* @__PURE__ */ e("p", { className: "cms-viewer__conflict-text", children:
|
|
696
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button", onClick:
|
|
697
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick:
|
|
694
|
+
(f == null ? void 0 : f.conflict) !== void 0 ? /* @__PURE__ */ u("div", { className: "cms-viewer__conflict", role: "alert", children: [
|
|
695
|
+
/* @__PURE__ */ e("p", { className: "cms-viewer__conflict-text", children: f.conflict.message }),
|
|
696
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button", onClick: f.conflict.onOverwrite, children: f.conflict.overwriteLabel }),
|
|
697
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: f.conflict.onKeepBoth, children: f.conflict.keepBothLabel })
|
|
698
698
|
] }) : null,
|
|
699
|
-
_ === void 0 ?
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
699
|
+
_ === void 0 ? v : /* @__PURE__ */ e(rn, { state: _ }),
|
|
700
|
+
f === 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(z, { name: "back" }) }) : null,
|
|
701
|
+
f === 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(z, { name: "back" }) }) : null,
|
|
702
|
+
f === void 0 && o !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(o.total, 7) }, (y, P) => /* @__PURE__ */ e("i", { className: P === Math.min(o.index, 6) ? "is-current" : void 0 }, P)) }) : null
|
|
703
703
|
] })
|
|
704
704
|
] }),
|
|
705
|
-
|
|
706
|
-
|
|
705
|
+
f === void 0 && h != null ? /* @__PURE__ */ e("div", { className: "cms-viewer__strip", children: h }) : null,
|
|
706
|
+
m != null ? /* @__PURE__ */ e("footer", { className: "cms-viewer__bar", children: m }) : null
|
|
707
707
|
]
|
|
708
708
|
}
|
|
709
709
|
),
|
|
@@ -743,45 +743,45 @@ class cn extends Error {
|
|
|
743
743
|
super(l), this.name = "FilePickerDenied";
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
|
-
const
|
|
746
|
+
const ye = (n, l) => `${n}
|
|
747
747
|
${l}`, on = (n, l) => n === "" ? l : `${n}/${l}`, dn = 48;
|
|
748
748
|
function Wn(n) {
|
|
749
749
|
var me, he;
|
|
750
|
-
const { open: l, spaces: t, list:
|
|
750
|
+
const { open: l, spaces: t, list: i, disabledReason: c, budget: s, formatSize: d, labels: r, onConfirm: f, onCancel: _ } = n, [o, m] = E(((me = t[0]) == null ? void 0 : me.id) ?? ""), [a, h] = E(""), [p, v] = E({ status: "loading" }), [N, w] = E(0), [x, S] = E(/* @__PURE__ */ new Map()), [C, R] = E(0), [H, ee] = E(!1), j = F(null), y = G();
|
|
751
751
|
Y(() => {
|
|
752
752
|
var b;
|
|
753
|
-
l && (
|
|
753
|
+
l && (m(((b = t[0]) == null ? void 0 : b.id) ?? ""), h(""), S(/* @__PURE__ */ new Map()), ee(!1));
|
|
754
754
|
}, [l]), Y(() => {
|
|
755
|
-
if (!l ||
|
|
755
|
+
if (!l || o === "") return;
|
|
756
756
|
let b = !0;
|
|
757
|
-
return
|
|
758
|
-
(k) => b &&
|
|
759
|
-
(k) => b &&
|
|
757
|
+
return v({ status: "loading" }), R(0), i(o, a).then(
|
|
758
|
+
(k) => b && v({ status: "ready", entries: k.entries, next: k.next ?? null, paging: !1 }),
|
|
759
|
+
(k) => b && v({ status: k instanceof cn ? "denied" : "error" })
|
|
760
760
|
), () => {
|
|
761
761
|
b = !1;
|
|
762
762
|
};
|
|
763
|
-
}, [l,
|
|
763
|
+
}, [l, o, a, i, N]);
|
|
764
764
|
const P = be(() => {
|
|
765
765
|
if (p.status !== "ready" || p.next === null || p.paging) return;
|
|
766
766
|
const b = p.next, k = p.entries;
|
|
767
|
-
|
|
768
|
-
(B) =>
|
|
769
|
-
() =>
|
|
767
|
+
v({ ...p, paging: !0 }), i(o, a, b).then(
|
|
768
|
+
(B) => v({ status: "ready", entries: [...k, ...B.entries], next: B.next ?? null, paging: !1 }),
|
|
769
|
+
() => v({ status: "ready", entries: k, next: b, paging: !1 })
|
|
770
770
|
);
|
|
771
|
-
}, [p,
|
|
771
|
+
}, [p, i, o, a]), Z = be((b) => {
|
|
772
772
|
var k;
|
|
773
773
|
return ((k = s == null ? void 0 : s.cost) == null ? void 0 : k.call(s, b)) ?? b.size ?? 0;
|
|
774
|
-
}, [s]), D = Oe(() => [...x.values()], [x]), X = D.reduce((b, k) => b + (k.size ?? 0), 0), O = s === void 0 ? null : s.limitBytes - s.usedBytes - D.reduce((b, k) => b +
|
|
774
|
+
}, [s]), D = Oe(() => [...x.values()], [x]), X = D.reduce((b, k) => b + (k.size ?? 0), 0), O = s === void 0 ? null : s.limitBytes - s.usedBytes - D.reduce((b, k) => b + Z(k), 0), J = O !== null && O < 0, ie = (b) => {
|
|
775
775
|
if (b.kind !== "file") return null;
|
|
776
|
-
const k =
|
|
777
|
-
return k || (O !== null && !x.has(
|
|
776
|
+
const k = c == null ? void 0 : c(b);
|
|
777
|
+
return k || (O !== null && !x.has(ye(o, b.id)) && Z(b) > O ? r.overBudget : null);
|
|
778
778
|
}, oe = (b) => {
|
|
779
|
-
const k =
|
|
779
|
+
const k = ye(o, b.id);
|
|
780
780
|
!x.has(k) && ie(b) !== null || S((B) => {
|
|
781
781
|
const K = new Map(B);
|
|
782
|
-
return K.has(k) ? K.delete(k) : K.set(k, { ...b, space:
|
|
782
|
+
return K.has(k) ? K.delete(k) : K.set(k, { ...b, space: o, path: a }), K;
|
|
783
783
|
});
|
|
784
|
-
},
|
|
784
|
+
}, g = (b) => h(on(a, b.name)), L = () => h(a.includes("/") ? a.slice(0, a.lastIndexOf("/")) : ""), V = (b) => S((k) => {
|
|
785
785
|
const B = new Map(k);
|
|
786
786
|
return B.delete(b), B;
|
|
787
787
|
}), W = p.status === "ready" ? p.entries : [], $ = (b) => {
|
|
@@ -789,72 +789,72 @@ function Wn(n) {
|
|
|
789
789
|
if (b.key === "ArrowDown" || b.key === "ArrowUp" || b.key === "Home" || b.key === "End") {
|
|
790
790
|
b.preventDefault();
|
|
791
791
|
const B = W.length - 1, K = b.key === "Home" ? 0 : b.key === "End" ? B : Math.min(B, Math.max(0, C + (b.key === "ArrowDown" ? 1 : -1)));
|
|
792
|
-
|
|
793
|
-
} else b.key === "Enter" && (k == null ? void 0 : k.kind) === "folder" ? (b.preventDefault(),
|
|
794
|
-
}, q =
|
|
792
|
+
R(K), K >= B - 1 && P();
|
|
793
|
+
} else b.key === "Enter" && (k == null ? void 0 : k.kind) === "folder" ? (b.preventDefault(), g(k)) : b.key === " " && (k == null ? void 0 : k.kind) === "file" ? (b.preventDefault(), oe(k)) : b.key === "Backspace" && a !== "" && (b.preventDefault(), L());
|
|
794
|
+
}, q = a === "" ? [] : a.split("/"), de = ((he = t.find((b) => b.id === o)) == null ? void 0 : he.name) ?? "", ue = (b) => `${y}-entry-${String(b)}`;
|
|
795
795
|
return /* @__PURE__ */ u(
|
|
796
796
|
Pe,
|
|
797
797
|
{
|
|
798
798
|
open: l,
|
|
799
|
-
title:
|
|
799
|
+
title: r.title,
|
|
800
800
|
onClose: _,
|
|
801
|
-
closeLabel:
|
|
801
|
+
closeLabel: r.close,
|
|
802
802
|
initialFocus: j,
|
|
803
803
|
className: "cms-file-picker",
|
|
804
804
|
footer: /* @__PURE__ */ u("div", { className: "cms-file-picker__foot", children: [
|
|
805
805
|
/* @__PURE__ */ u("div", { className: "cms-file-picker__summary", "aria-live": "polite", children: [
|
|
806
|
-
D.length > 0 ? /* @__PURE__ */ e("span", { children:
|
|
807
|
-
s !== void 0 && O !== null ? /* @__PURE__ */ e("span", { className: A(J && "is-over"), children: J ?
|
|
806
|
+
D.length > 0 ? /* @__PURE__ */ e("span", { children: r.total(D.length, d(X)) }) : null,
|
|
807
|
+
s !== void 0 && O !== null ? /* @__PURE__ */ e("span", { className: A(J && "is-over"), children: J ? r.overBudget : r.left(d(Math.max(0, O)), d(s.limitBytes)) }) : null
|
|
808
808
|
] }),
|
|
809
809
|
/* @__PURE__ */ u("div", { className: "cms-file-picker__actions", children: [
|
|
810
|
-
/* @__PURE__ */ e(le, { variant: "secondary", onClick: _, children:
|
|
811
|
-
/* @__PURE__ */ e(le, { variant: "primary", disabled: D.length === 0 || J, onClick: () =>
|
|
810
|
+
/* @__PURE__ */ e(le, { variant: "secondary", onClick: _, children: r.cancel }),
|
|
811
|
+
/* @__PURE__ */ e(le, { variant: "primary", disabled: D.length === 0 || J, onClick: () => f(D), children: r.confirm(D.length) })
|
|
812
812
|
] })
|
|
813
813
|
] }),
|
|
814
814
|
children: [
|
|
815
815
|
/* @__PURE__ */ u("div", { className: "cms-file-picker__top", children: [
|
|
816
816
|
t.length > 1 ? /* @__PURE__ */ u("label", { className: "cms-file-picker__space", children: [
|
|
817
|
-
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children:
|
|
818
|
-
/* @__PURE__ */ e("select", { className: "cms-input cms-select", value:
|
|
819
|
-
|
|
817
|
+
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: r.space }),
|
|
818
|
+
/* @__PURE__ */ e("select", { className: "cms-input cms-select", value: o, onChange: (b) => {
|
|
819
|
+
m(b.target.value), h("");
|
|
820
820
|
}, children: t.map((b) => /* @__PURE__ */ e("option", { value: b.id, children: b.name }, b.id)) })
|
|
821
821
|
] }) : null,
|
|
822
|
-
/* @__PURE__ */ u("nav", { className: "cms-file-picker__path", "aria-label":
|
|
823
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label":
|
|
822
|
+
/* @__PURE__ */ u("nav", { className: "cms-file-picker__path", "aria-label": r.path, children: [
|
|
823
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": r.up, disabled: a === "", onClick: L, children: /* @__PURE__ */ e(T, { name: "chevron-left" }) }),
|
|
824
824
|
/* @__PURE__ */ u("ol", { children: [
|
|
825
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current":
|
|
825
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": a === "" ? "location" : void 0, onClick: () => h(""), children: de }) }),
|
|
826
826
|
q.map((b, k) => {
|
|
827
827
|
const B = q.slice(0, k + 1).join("/");
|
|
828
|
-
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": B ===
|
|
828
|
+
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__crumb", "aria-current": B === a ? "location" : void 0, onClick: () => h(B), children: b }) }, B);
|
|
829
829
|
})
|
|
830
830
|
] })
|
|
831
831
|
] }),
|
|
832
|
-
D.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": H, onClick: () => ee((b) => !b), children:
|
|
832
|
+
D.length > 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-file-picker__chip", "aria-expanded": H, onClick: () => ee((b) => !b), children: r.selected(D.length) }) : null
|
|
833
833
|
] }),
|
|
834
834
|
H && D.length > 0 ? /* @__PURE__ */ u("div", { className: "cms-file-picker__chosen", children: [
|
|
835
835
|
/* @__PURE__ */ e("ul", { children: [...x.entries()].map(([b, k]) => /* @__PURE__ */ u("li", { children: [
|
|
836
836
|
/* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: k.name }),
|
|
837
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label":
|
|
837
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": r.remove(k.name), onClick: () => V(b), children: /* @__PURE__ */ e(z, { name: "close" }) })
|
|
838
838
|
] }, b)) }),
|
|
839
839
|
/* @__PURE__ */ e(le, { variant: "secondary", onClick: () => {
|
|
840
840
|
S(/* @__PURE__ */ new Map()), ee(!1);
|
|
841
|
-
}, children:
|
|
841
|
+
}, children: r.clear })
|
|
842
842
|
] }) : null,
|
|
843
843
|
/* @__PURE__ */ u("div", { className: "cms-file-picker__list", onScroll: (b) => {
|
|
844
844
|
const k = b.currentTarget;
|
|
845
845
|
k.scrollTop + k.clientHeight >= k.scrollHeight - dn && P();
|
|
846
846
|
}, children: [
|
|
847
|
-
p.status === "loading" ? /* @__PURE__ */ e(ne, { kind: "loading", title:
|
|
848
|
-
p.status === "error" ? /* @__PURE__ */ e(ne, { kind: "error", title:
|
|
849
|
-
p.status === "denied" ? /* @__PURE__ */ e(ne, { kind: "denied", title:
|
|
850
|
-
p.status === "ready" && W.length === 0 ? /* @__PURE__ */ e(ne, { kind: "empty", title:
|
|
847
|
+
p.status === "loading" ? /* @__PURE__ */ e(ne, { kind: "loading", title: r.loading, placement: "block" }) : null,
|
|
848
|
+
p.status === "error" ? /* @__PURE__ */ e(ne, { kind: "error", title: r.error, placement: "block", action: { label: r.retry, onAction: () => w((b) => b + 1) } }) : null,
|
|
849
|
+
p.status === "denied" ? /* @__PURE__ */ e(ne, { kind: "denied", title: r.denied, placement: "block" }) : null,
|
|
850
|
+
p.status === "ready" && W.length === 0 ? /* @__PURE__ */ e(ne, { kind: "empty", title: r.empty, placement: "block" }) : null,
|
|
851
851
|
/* @__PURE__ */ u(
|
|
852
852
|
"div",
|
|
853
853
|
{
|
|
854
854
|
ref: j,
|
|
855
855
|
role: "listbox",
|
|
856
856
|
"aria-multiselectable": "true",
|
|
857
|
-
"aria-label":
|
|
857
|
+
"aria-label": r.files,
|
|
858
858
|
"aria-activedescendant": W.length > 0 ? ue(C) : void 0,
|
|
859
859
|
tabIndex: 0,
|
|
860
860
|
className: "cms-file-picker__entries",
|
|
@@ -862,7 +862,7 @@ function Wn(n) {
|
|
|
862
862
|
onKeyDown: $,
|
|
863
863
|
children: [
|
|
864
864
|
W.map((b, k) => {
|
|
865
|
-
const B = b.kind === "file" && x.has(
|
|
865
|
+
const B = b.kind === "file" && x.has(ye(o, b.id)), K = ie(b);
|
|
866
866
|
return /* @__PURE__ */ u(
|
|
867
867
|
"div",
|
|
868
868
|
{
|
|
@@ -872,22 +872,22 @@ function Wn(n) {
|
|
|
872
872
|
"aria-disabled": K !== null || void 0,
|
|
873
873
|
className: A("cms-file-picker__entry", k === C && "is-active", B && "is-ticked", K !== null && "is-disabled"),
|
|
874
874
|
onClick: () => {
|
|
875
|
-
|
|
875
|
+
R(k), b.kind === "folder" ? g(b) : oe(b);
|
|
876
876
|
},
|
|
877
877
|
children: [
|
|
878
|
-
/* @__PURE__ */ e("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: B ? /* @__PURE__ */ e(
|
|
879
|
-
/* @__PURE__ */ e(
|
|
878
|
+
/* @__PURE__ */ e("span", { className: "cms-file-picker__tick", "aria-hidden": "true", children: B ? /* @__PURE__ */ e(T, { name: "check" }) : null }),
|
|
879
|
+
/* @__PURE__ */ e(T, { name: b.kind === "folder" ? "folder" : "file" }),
|
|
880
880
|
/* @__PURE__ */ u("span", { className: "cms-file-picker__text", children: [
|
|
881
881
|
/* @__PURE__ */ e("span", { className: "cms-file-picker__name", children: b.name }),
|
|
882
882
|
K !== null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__reason", children: K }) : null
|
|
883
883
|
] }),
|
|
884
|
-
b.kind === "file" && b.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children:
|
|
884
|
+
b.kind === "file" && b.size != null ? /* @__PURE__ */ e("span", { className: "cms-file-picker__size", children: d(b.size) }) : null
|
|
885
885
|
]
|
|
886
886
|
},
|
|
887
887
|
b.id
|
|
888
888
|
);
|
|
889
889
|
}),
|
|
890
|
-
p.status === "ready" && p.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(ne, { kind: "loading", title:
|
|
890
|
+
p.status === "ready" && p.paging ? /* @__PURE__ */ e("div", { className: "cms-file-picker__paging", children: /* @__PURE__ */ e(ne, { kind: "loading", title: r.loading, placement: "inline" }) }) : null
|
|
891
891
|
]
|
|
892
892
|
}
|
|
893
893
|
)
|
|
@@ -896,20 +896,20 @@ function Wn(n) {
|
|
|
896
896
|
}
|
|
897
897
|
);
|
|
898
898
|
}
|
|
899
|
-
function jn({ title: n, scope: l, actions: t, backLink:
|
|
899
|
+
function jn({ title: n, scope: l, actions: t, backLink: i }) {
|
|
900
900
|
return /* @__PURE__ */ u("header", { className: "cms-page-header", children: [
|
|
901
|
-
|
|
901
|
+
i ? /* @__PURE__ */ u(
|
|
902
902
|
"a",
|
|
903
903
|
{
|
|
904
904
|
className: "cms-page-header__back",
|
|
905
|
-
href:
|
|
906
|
-
onClick: (
|
|
907
|
-
|
|
905
|
+
href: i.href ?? "#",
|
|
906
|
+
onClick: (c) => {
|
|
907
|
+
i.onBack && (c.preventDefault(), i.onBack());
|
|
908
908
|
},
|
|
909
909
|
children: [
|
|
910
910
|
/* @__PURE__ */ e(z, { name: "back" }),
|
|
911
911
|
" ",
|
|
912
|
-
|
|
912
|
+
i.label
|
|
913
913
|
]
|
|
914
914
|
}
|
|
915
915
|
) : null,
|
|
@@ -922,43 +922,43 @@ function jn({ title: n, scope: l, actions: t, backLink: o }) {
|
|
|
922
922
|
] })
|
|
923
923
|
] });
|
|
924
924
|
}
|
|
925
|
-
function qn({ tabs: n, active: l, onSelect: t, label:
|
|
926
|
-
const
|
|
927
|
-
var
|
|
928
|
-
const
|
|
925
|
+
function qn({ tabs: n, active: l, onSelect: t, label: i }) {
|
|
926
|
+
const c = F([]), s = (d, r) => {
|
|
927
|
+
var m;
|
|
928
|
+
const f = n.length - 1, _ = d.key === "ArrowRight" ? r === f ? 0 : r + 1 : d.key === "ArrowLeft" ? r === 0 ? f : r - 1 : d.key === "Home" ? 0 : d.key === "End" ? f : null;
|
|
929
929
|
if (_ === null) return;
|
|
930
|
-
|
|
931
|
-
const
|
|
932
|
-
|
|
930
|
+
d.preventDefault();
|
|
931
|
+
const o = n[_];
|
|
932
|
+
o && (t(o.id), (m = c.current[_]) == null || m.focus());
|
|
933
933
|
};
|
|
934
|
-
return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label":
|
|
935
|
-
const
|
|
934
|
+
return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": i, children: n.map((d, r) => {
|
|
935
|
+
const f = d.id === l;
|
|
936
936
|
return /* @__PURE__ */ u(
|
|
937
937
|
"button",
|
|
938
938
|
{
|
|
939
939
|
ref: (_) => {
|
|
940
|
-
|
|
940
|
+
c.current[r] = _;
|
|
941
941
|
},
|
|
942
942
|
type: "button",
|
|
943
943
|
role: "tab",
|
|
944
|
-
className: A("cms-tab",
|
|
945
|
-
"aria-selected":
|
|
946
|
-
tabIndex:
|
|
947
|
-
onClick: () => t(
|
|
948
|
-
onKeyDown: (_) => s(_,
|
|
944
|
+
className: A("cms-tab", f && "is-active"),
|
|
945
|
+
"aria-selected": f,
|
|
946
|
+
tabIndex: f ? 0 : -1,
|
|
947
|
+
onClick: () => t(d.id),
|
|
948
|
+
onKeyDown: (_) => s(_, r),
|
|
949
949
|
children: [
|
|
950
|
-
|
|
951
|
-
|
|
950
|
+
d.label,
|
|
951
|
+
d.count !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-tab__count", children: d.count }) : null
|
|
952
952
|
]
|
|
953
953
|
},
|
|
954
|
-
|
|
954
|
+
d.id
|
|
955
955
|
);
|
|
956
956
|
}) });
|
|
957
957
|
}
|
|
958
958
|
function un(n) {
|
|
959
|
-
const l = n.trim().replace(/\s+via\s+\S.*$/, "").split(/\s+/).filter(Boolean), t = (
|
|
959
|
+
const l = n.trim().replace(/\s+via\s+\S.*$/, "").split(/\s+/).filter(Boolean), t = (c) => {
|
|
960
960
|
var s;
|
|
961
|
-
return (s =
|
|
961
|
+
return (s = c == null ? void 0 : c.match(/[\p{L}\p{N}]/u)) == null ? void 0 : s[0];
|
|
962
962
|
};
|
|
963
963
|
return (l.length > 1 ? [t(l[0]), t(l[l.length - 1])] : [t(l[0])]).filter(Boolean).join("").toUpperCase();
|
|
964
964
|
}
|
|
@@ -968,19 +968,19 @@ function mn(n) {
|
|
|
968
968
|
l = l * 31 + (t.codePointAt(0) ?? 0) >>> 0;
|
|
969
969
|
return l % 6 + 1;
|
|
970
970
|
}
|
|
971
|
-
function ve({ name: n, pictureUrl: l, presence: t, connection:
|
|
972
|
-
const
|
|
971
|
+
function ve({ name: n, pictureUrl: l, presence: t, connection: i, deleted: c = !1, size: s = 32 }) {
|
|
972
|
+
const d = i !== void 0 ? `is-${i.state === "offline" ? "disconnected" : i.state}` : t === void 0 ? null : `is-${t === "busy" ? "away" : t}`, r = i !== void 0 ? `${n}, ${i.label}` : t ? `${n}, ${t}` : n;
|
|
973
973
|
return /* @__PURE__ */ u(
|
|
974
974
|
"span",
|
|
975
975
|
{
|
|
976
|
-
className: A("cms-avatar",
|
|
976
|
+
className: A("cms-avatar", c ? "cms-avatar--deleted" : `cms-avatar--tint-${mn(n)}`),
|
|
977
977
|
style: { width: s, height: s, fontSize: Math.round(s * 0.4) },
|
|
978
978
|
role: "img",
|
|
979
|
-
"aria-label":
|
|
980
|
-
...
|
|
979
|
+
"aria-label": r,
|
|
980
|
+
...i === void 0 ? {} : { title: i.label },
|
|
981
981
|
children: [
|
|
982
|
-
|
|
983
|
-
|
|
982
|
+
c ? /* @__PURE__ */ e(T, { 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: un(n) }),
|
|
983
|
+
d === null ? null : /* @__PURE__ */ e("span", { className: A("cms-avatar__presence", d), "aria-hidden": "true" })
|
|
984
984
|
]
|
|
985
985
|
}
|
|
986
986
|
);
|
|
@@ -991,53 +991,53 @@ function hn({ count: n, label: l, max: t = 99 }) {
|
|
|
991
991
|
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: l })
|
|
992
992
|
] });
|
|
993
993
|
}
|
|
994
|
-
function Yn({ product: n, mark: l, rail: t, active:
|
|
994
|
+
function Yn({ product: n, mark: l, rail: t, active: i, onNavigate: c, server: s, search: d, account: r, children: f, railLabel: _ = "Sections" }) {
|
|
995
995
|
return /* @__PURE__ */ u("div", { className: "cms-shell", children: [
|
|
996
996
|
/* @__PURE__ */ u("nav", { className: "cms-shell__rail", "aria-label": _, children: [
|
|
997
997
|
/* @__PURE__ */ e("span", { className: "cms-shell__mark", "aria-hidden": "true", children: l }),
|
|
998
|
-
/* @__PURE__ */ e("ul", { className: "cms-shell__items", children: t.map((
|
|
999
|
-
const
|
|
998
|
+
/* @__PURE__ */ e("ul", { className: "cms-shell__items", children: t.map((o) => {
|
|
999
|
+
const m = o.id === i;
|
|
1000
1000
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ u(
|
|
1001
1001
|
"a",
|
|
1002
1002
|
{
|
|
1003
|
-
href:
|
|
1004
|
-
className: A("cms-shell__item",
|
|
1005
|
-
"aria-current":
|
|
1006
|
-
title:
|
|
1007
|
-
onClick: (
|
|
1008
|
-
|
|
1003
|
+
href: o.href,
|
|
1004
|
+
className: A("cms-shell__item", m && "is-active"),
|
|
1005
|
+
"aria-current": m ? "page" : void 0,
|
|
1006
|
+
title: o.label,
|
|
1007
|
+
onClick: (a) => {
|
|
1008
|
+
c && (a.preventDefault(), c(o.id));
|
|
1009
1009
|
},
|
|
1010
1010
|
children: [
|
|
1011
1011
|
/* @__PURE__ */ u("span", { className: "cms-shell__icon", children: [
|
|
1012
|
-
/* @__PURE__ */ e(
|
|
1013
|
-
|
|
1012
|
+
/* @__PURE__ */ e(T, { name: o.icon, size: 22 }),
|
|
1013
|
+
o.badge ? /* @__PURE__ */ e(hn, { count: o.badge.count, label: o.badge.label }) : null
|
|
1014
1014
|
] }),
|
|
1015
|
-
/* @__PURE__ */ e("span", { className: "cms-shell__label", children:
|
|
1015
|
+
/* @__PURE__ */ e("span", { className: "cms-shell__label", children: o.label })
|
|
1016
1016
|
]
|
|
1017
1017
|
}
|
|
1018
|
-
) },
|
|
1018
|
+
) }, o.id);
|
|
1019
1019
|
}) })
|
|
1020
1020
|
] }),
|
|
1021
1021
|
/* @__PURE__ */ u("header", { className: "cms-shell__top", children: [
|
|
1022
1022
|
/* @__PURE__ */ e("span", { className: "cms-shell__product", children: n }),
|
|
1023
1023
|
s != null ? /* @__PURE__ */ e("div", { className: "cms-shell__server", children: s }) : null,
|
|
1024
|
-
|
|
1025
|
-
|
|
1024
|
+
d != null ? /* @__PURE__ */ e("div", { className: "cms-shell__search", children: d }) : null,
|
|
1025
|
+
r != null ? /* @__PURE__ */ e("div", { className: "cms-shell__account", children: r }) : null
|
|
1026
1026
|
] }),
|
|
1027
|
-
/* @__PURE__ */ e("main", { className: "cms-shell__main", children:
|
|
1027
|
+
/* @__PURE__ */ e("main", { className: "cms-shell__main", children: f })
|
|
1028
1028
|
] });
|
|
1029
1029
|
}
|
|
1030
|
-
function Gn({ label: n, placeholder: l, value: t, onChange:
|
|
1030
|
+
function Gn({ label: n, placeholder: l, value: t, onChange: i, onSearch: c }) {
|
|
1031
1031
|
return /* @__PURE__ */ u(
|
|
1032
1032
|
"form",
|
|
1033
1033
|
{
|
|
1034
1034
|
role: "search",
|
|
1035
1035
|
className: "cms-search",
|
|
1036
1036
|
onSubmit: (s) => {
|
|
1037
|
-
s.preventDefault(),
|
|
1037
|
+
s.preventDefault(), c == null || c(t);
|
|
1038
1038
|
},
|
|
1039
1039
|
children: [
|
|
1040
|
-
/* @__PURE__ */ e(
|
|
1040
|
+
/* @__PURE__ */ e(T, { name: "search", size: 18 }),
|
|
1041
1041
|
/* @__PURE__ */ e(
|
|
1042
1042
|
"input",
|
|
1043
1043
|
{
|
|
@@ -1046,58 +1046,78 @@ function Gn({ label: n, placeholder: l, value: t, onChange: o, onSearch: i }) {
|
|
|
1046
1046
|
"aria-label": n,
|
|
1047
1047
|
placeholder: l,
|
|
1048
1048
|
value: t,
|
|
1049
|
-
onChange: (s) =>
|
|
1049
|
+
onChange: (s) => i(s.target.value)
|
|
1050
1050
|
}
|
|
1051
1051
|
)
|
|
1052
1052
|
]
|
|
1053
1053
|
}
|
|
1054
1054
|
);
|
|
1055
1055
|
}
|
|
1056
|
-
function fn({ options: n, value: l, onChange: t, label:
|
|
1057
|
-
const
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1056
|
+
function fn({ options: n, value: l, onChange: t, label: i }) {
|
|
1057
|
+
const c = F([]), s = F(null), [d, r] = E({ start: !1, end: !1 }), f = () => {
|
|
1058
|
+
const m = s.current;
|
|
1059
|
+
if (m === null) return;
|
|
1060
|
+
const a = Math.abs(m.scrollLeft), h = a > 1, p = a + m.clientWidth < m.scrollWidth - 1;
|
|
1061
|
+
r((v) => v.start === h && v.end === p ? v : { start: h, end: p });
|
|
1062
|
+
};
|
|
1063
|
+
ge(() => {
|
|
1064
|
+
f();
|
|
1065
|
+
const m = s.current;
|
|
1066
|
+
if (m === null || typeof ResizeObserver > "u") return;
|
|
1067
|
+
const a = new ResizeObserver(f);
|
|
1068
|
+
a.observe(m);
|
|
1069
|
+
for (const h of c.current) h !== null && a.observe(h);
|
|
1070
|
+
return () => a.disconnect();
|
|
1071
|
+
}, [n]);
|
|
1072
|
+
const _ = (m) => {
|
|
1073
|
+
var a, h;
|
|
1074
|
+
return (h = (a = c.current[m]) == null ? void 0 : a.scrollIntoView) == null ? void 0 : h.call(a, { block: "nearest", inline: "nearest" });
|
|
1075
|
+
}, o = (m, a) => {
|
|
1076
|
+
var N;
|
|
1077
|
+
const h = n.length - 1, p = m.key === "ArrowRight" || m.key === "ArrowDown" ? a === h ? 0 : a + 1 : m.key === "ArrowLeft" || m.key === "ArrowUp" ? a === 0 ? h : a - 1 : null;
|
|
1078
|
+
if (p === null) return;
|
|
1079
|
+
m.preventDefault();
|
|
1080
|
+
const v = n[p];
|
|
1081
|
+
v && (t(v.id), (N = c.current[p]) == null || N.focus(), _(p));
|
|
1064
1082
|
};
|
|
1065
|
-
return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label":
|
|
1066
|
-
const
|
|
1083
|
+
return /* @__PURE__ */ e("div", { ref: s, className: A("cms-chips", d.start && "is-past-start", d.end && "is-past-end"), role: "radiogroup", "aria-label": i, onScroll: f, "data-scrolls-sideways": "", children: n.map((m, a) => {
|
|
1084
|
+
const h = m.id === l;
|
|
1067
1085
|
return /* @__PURE__ */ u(
|
|
1068
1086
|
"button",
|
|
1069
1087
|
{
|
|
1070
|
-
ref: (
|
|
1071
|
-
|
|
1088
|
+
ref: (p) => {
|
|
1089
|
+
c.current[a] = p;
|
|
1072
1090
|
},
|
|
1073
1091
|
type: "button",
|
|
1074
1092
|
role: "radio",
|
|
1075
|
-
"aria-checked":
|
|
1076
|
-
tabIndex:
|
|
1077
|
-
className: A("cms-chip",
|
|
1078
|
-
onClick: () =>
|
|
1079
|
-
|
|
1093
|
+
"aria-checked": h,
|
|
1094
|
+
tabIndex: h ? 0 : -1,
|
|
1095
|
+
className: A("cms-chip", h && "is-on"),
|
|
1096
|
+
onClick: () => {
|
|
1097
|
+
t(m.id), _(a);
|
|
1098
|
+
},
|
|
1099
|
+
onKeyDown: (p) => o(p, a),
|
|
1080
1100
|
children: [
|
|
1081
|
-
|
|
1082
|
-
|
|
1101
|
+
h ? /* @__PURE__ */ e(T, { name: "check", size: 16 }) : null,
|
|
1102
|
+
m.label
|
|
1083
1103
|
]
|
|
1084
1104
|
},
|
|
1085
|
-
|
|
1105
|
+
m.id
|
|
1086
1106
|
);
|
|
1087
1107
|
}) });
|
|
1088
1108
|
}
|
|
1089
|
-
const
|
|
1109
|
+
const Te = 16;
|
|
1090
1110
|
function pn(n, l, t) {
|
|
1091
|
-
const
|
|
1092
|
-
let
|
|
1093
|
-
for (let s =
|
|
1094
|
-
const
|
|
1095
|
-
|
|
1111
|
+
const i = n.map((s) => Math.min(Math.max(s.width, s.min), s.max));
|
|
1112
|
+
let c = i.reduce((s, d) => s + d, 0) + t - l;
|
|
1113
|
+
for (let s = i.length - 1; s >= 0 && c > 0; s -= 1) {
|
|
1114
|
+
const d = Math.min(c, i[s] - n[s].min);
|
|
1115
|
+
i[s] = i[s] - d, c -= d;
|
|
1096
1116
|
}
|
|
1097
|
-
return
|
|
1117
|
+
return i;
|
|
1098
1118
|
}
|
|
1099
|
-
function _n({ index: n, size: l, shown: t, others:
|
|
1100
|
-
const
|
|
1119
|
+
function _n({ index: n, size: l, shown: t, others: i, room: c, lastMin: s, onResize: d }) {
|
|
1120
|
+
const r = Math.max(l.min, Math.min(l.max, c > 0 ? c - i - s : l.max)), f = (m) => Math.round(Math.min(Math.max(m, l.min), r)), _ = F(null), o = (m, a) => d == null ? void 0 : d(n, f(m), a);
|
|
1101
1121
|
return /* @__PURE__ */ e(
|
|
1102
1122
|
"div",
|
|
1103
1123
|
{
|
|
@@ -1107,73 +1127,73 @@ function _n({ index: n, size: l, shown: t, others: o, room: i, lastMin: s, onRes
|
|
|
1107
1127
|
"aria-label": l.label,
|
|
1108
1128
|
"aria-valuenow": t,
|
|
1109
1129
|
"aria-valuemin": l.min,
|
|
1110
|
-
"aria-valuemax":
|
|
1130
|
+
"aria-valuemax": r,
|
|
1111
1131
|
className: "cms-panes__splitter",
|
|
1112
1132
|
style: { "--split-at": `var(--split-pane-end-${String(n)})` },
|
|
1113
|
-
onPointerDown: (
|
|
1114
|
-
var
|
|
1115
|
-
|
|
1133
|
+
onPointerDown: (m) => {
|
|
1134
|
+
var a, h, p;
|
|
1135
|
+
m.button > 0 || (m.preventDefault(), (h = (a = m.currentTarget).setPointerCapture) == null || h.call(a, m.pointerId), _.current = { x: m.clientX, from: t, last: t }, (p = m.currentTarget.closest(".cms-panes")) == null || p.classList.add("is-resizing"));
|
|
1116
1136
|
},
|
|
1117
|
-
onPointerMove: (
|
|
1118
|
-
const
|
|
1119
|
-
|
|
1137
|
+
onPointerMove: (m) => {
|
|
1138
|
+
const a = _.current;
|
|
1139
|
+
a === null || !Number.isFinite(m.clientX) || (a.last = f(a.from + m.clientX - a.x), o(a.last, !1));
|
|
1120
1140
|
},
|
|
1121
|
-
onPointerUp: (
|
|
1122
|
-
var
|
|
1123
|
-
const
|
|
1124
|
-
|
|
1141
|
+
onPointerUp: (m) => {
|
|
1142
|
+
var h;
|
|
1143
|
+
const a = _.current;
|
|
1144
|
+
a !== null && (_.current = null, (h = m.currentTarget.closest(".cms-panes")) == null || h.classList.remove("is-resizing"), o(a.last, !0));
|
|
1125
1145
|
},
|
|
1126
|
-
onPointerCancel: (
|
|
1127
|
-
var
|
|
1128
|
-
const
|
|
1129
|
-
_.current = null, (
|
|
1146
|
+
onPointerCancel: (m) => {
|
|
1147
|
+
var h;
|
|
1148
|
+
const a = _.current;
|
|
1149
|
+
_.current = null, (h = m.currentTarget.closest(".cms-panes")) == null || h.classList.remove("is-resizing"), a !== null && o(a.last, !0);
|
|
1130
1150
|
},
|
|
1131
|
-
onDoubleClick: () =>
|
|
1132
|
-
onKeyDown: (
|
|
1133
|
-
const
|
|
1134
|
-
|
|
1151
|
+
onDoubleClick: () => o(l.reset, !0),
|
|
1152
|
+
onKeyDown: (m) => {
|
|
1153
|
+
const a = m.key === "ArrowLeft" ? t - Te : m.key === "ArrowRight" ? t + Te : m.key === "Home" ? l.min : m.key === "End" ? r : m.key === "Enter" ? l.reset : null;
|
|
1154
|
+
a !== null && (m.preventDefault(), o(a, !0));
|
|
1135
1155
|
}
|
|
1136
1156
|
}
|
|
1137
1157
|
);
|
|
1138
1158
|
}
|
|
1139
|
-
function Xn({ panes: n, active: l, back: t, sizes:
|
|
1140
|
-
const
|
|
1141
|
-
|
|
1142
|
-
const p =
|
|
1143
|
-
if (p === null || !
|
|
1144
|
-
const
|
|
1145
|
-
if (
|
|
1146
|
-
const N = new ResizeObserver(
|
|
1159
|
+
function Xn({ panes: n, active: l, back: t, sizes: i, lastMin: c = 360, onResize: s }) {
|
|
1160
|
+
const d = Math.min(Math.max(l ?? n.length - 1, 0), n.length - 1), r = F(null), [f, _] = E(0), o = (i ?? []).slice(0, n.length - 1), m = o.length === n.length - 1 && o.every((p) => p !== void 0);
|
|
1161
|
+
ge(() => {
|
|
1162
|
+
const p = r.current;
|
|
1163
|
+
if (p === null || !m) return;
|
|
1164
|
+
const v = () => _(p.clientWidth);
|
|
1165
|
+
if (v(), typeof ResizeObserver > "u") return;
|
|
1166
|
+
const N = new ResizeObserver(v);
|
|
1147
1167
|
return N.observe(p), () => N.disconnect();
|
|
1148
|
-
}, [
|
|
1149
|
-
const
|
|
1150
|
-
[`--split-pane-${String(
|
|
1151
|
-
[`--split-pane-end-${String(
|
|
1168
|
+
}, [m]);
|
|
1169
|
+
const a = m ? pn(o, f > 0 ? f : Number.POSITIVE_INFINITY, c) : [], h = m ? Object.fromEntries(a.flatMap((p, v) => [
|
|
1170
|
+
[`--split-pane-${String(v)}`, `${String(p)}px`],
|
|
1171
|
+
[`--split-pane-end-${String(v)}`, `${String(a.slice(0, v + 1).reduce((N, w) => N + w, 0))}px`]
|
|
1152
1172
|
])) : void 0;
|
|
1153
1173
|
return /* @__PURE__ */ u(
|
|
1154
1174
|
"div",
|
|
1155
1175
|
{
|
|
1156
|
-
ref:
|
|
1157
|
-
className: A("cms-panes", n.length === 3 ? "cms-panes--three" : "cms-panes--two",
|
|
1158
|
-
"data-active":
|
|
1159
|
-
style:
|
|
1176
|
+
ref: r,
|
|
1177
|
+
className: A("cms-panes", n.length === 3 ? "cms-panes--three" : "cms-panes--two", m && "cms-panes--sized"),
|
|
1178
|
+
"data-active": d,
|
|
1179
|
+
style: h,
|
|
1160
1180
|
children: [
|
|
1161
|
-
n.map((p,
|
|
1162
|
-
|
|
1163
|
-
/* @__PURE__ */ e(
|
|
1181
|
+
n.map((p, v) => /* @__PURE__ */ u("section", { className: "cms-panes__pane", "aria-label": p.label, "data-offset": d - v, children: [
|
|
1182
|
+
v === d && t ? /* @__PURE__ */ u("a", { className: "cms-panes__back", href: t.href, children: [
|
|
1183
|
+
/* @__PURE__ */ e(T, { name: "chevron-left", size: 18 }),
|
|
1164
1184
|
t.label
|
|
1165
1185
|
] }) : null,
|
|
1166
1186
|
p.content
|
|
1167
1187
|
] }, p.label)),
|
|
1168
|
-
|
|
1188
|
+
m ? o.map((p, v) => /* @__PURE__ */ e(
|
|
1169
1189
|
_n,
|
|
1170
1190
|
{
|
|
1171
|
-
index:
|
|
1191
|
+
index: v,
|
|
1172
1192
|
size: p,
|
|
1173
|
-
shown:
|
|
1174
|
-
others:
|
|
1175
|
-
room:
|
|
1176
|
-
lastMin:
|
|
1193
|
+
shown: a[v],
|
|
1194
|
+
others: a.reduce((N, w, x) => x === v ? N : N + w, 0),
|
|
1195
|
+
room: f,
|
|
1196
|
+
lastMin: c,
|
|
1177
1197
|
onResize: s
|
|
1178
1198
|
},
|
|
1179
1199
|
p.label
|
|
@@ -1183,26 +1203,26 @@ function Xn({ panes: n, active: l, back: t, sizes: o, lastMin: i = 360, onResize
|
|
|
1183
1203
|
);
|
|
1184
1204
|
}
|
|
1185
1205
|
const bn = { attachment: "Has an attachment", unread: "Unread" };
|
|
1186
|
-
function Jn({ from: n, subject: l, preview: t, time:
|
|
1187
|
-
const _ = ce(bn,
|
|
1206
|
+
function Jn({ from: n, subject: l, preview: t, time: i, unread: c, hasAttachment: s, selected: d, onOpen: r, labels: f }) {
|
|
1207
|
+
const _ = ce(bn, f);
|
|
1188
1208
|
return /* @__PURE__ */ u(
|
|
1189
1209
|
"button",
|
|
1190
1210
|
{
|
|
1191
1211
|
type: "button",
|
|
1192
|
-
className: A("cms-mail-row",
|
|
1193
|
-
"aria-current":
|
|
1194
|
-
onClick:
|
|
1212
|
+
className: A("cms-mail-row", c && "is-unread", d && "is-selected"),
|
|
1213
|
+
"aria-current": d ? "true" : void 0,
|
|
1214
|
+
onClick: r,
|
|
1195
1215
|
children: [
|
|
1196
1216
|
/* @__PURE__ */ e(ve, { name: n, size: 40 }),
|
|
1197
1217
|
/* @__PURE__ */ u("span", { className: "cms-mail-row__body", children: [
|
|
1198
1218
|
/* @__PURE__ */ u("span", { className: "cms-mail-row__line", children: [
|
|
1199
1219
|
/* @__PURE__ */ e("span", { className: "cms-mail-row__from", children: n }),
|
|
1200
|
-
s ? /* @__PURE__ */ e(
|
|
1201
|
-
/* @__PURE__ */ e("span", { className: "cms-mail-row__time", children:
|
|
1220
|
+
s ? /* @__PURE__ */ e(T, { name: "paperclip", size: 16, label: _.attachment }) : null,
|
|
1221
|
+
/* @__PURE__ */ e("span", { className: "cms-mail-row__time", children: i })
|
|
1202
1222
|
] }),
|
|
1203
1223
|
/* @__PURE__ */ u("span", { className: "cms-mail-row__line", children: [
|
|
1204
1224
|
/* @__PURE__ */ e("span", { className: "cms-mail-row__subject", children: l }),
|
|
1205
|
-
|
|
1225
|
+
c ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label": _.unread }) : null
|
|
1206
1226
|
] }),
|
|
1207
1227
|
/* @__PURE__ */ e("span", { className: "cms-mail-row__preview", children: t })
|
|
1208
1228
|
] })
|
|
@@ -1210,45 +1230,45 @@ function Jn({ from: n, subject: l, preview: t, time: o, unread: i, hasAttachment
|
|
|
1210
1230
|
}
|
|
1211
1231
|
);
|
|
1212
1232
|
}
|
|
1213
|
-
function Qn({ direction: n, children: l, time: t, read:
|
|
1233
|
+
function Qn({ direction: n, children: l, time: t, read: i, readLabel: c = "Read" }) {
|
|
1214
1234
|
return /* @__PURE__ */ u("div", { className: A("cms-bubble", `cms-bubble--${n}`), children: [
|
|
1215
1235
|
/* @__PURE__ */ e("div", { className: "cms-bubble__text", children: l }),
|
|
1216
1236
|
/* @__PURE__ */ u("div", { className: "cms-bubble__meta", children: [
|
|
1217
1237
|
t,
|
|
1218
|
-
n === "out" &&
|
|
1238
|
+
n === "out" && i ? /* @__PURE__ */ u(M, { children: [
|
|
1219
1239
|
" · ",
|
|
1220
|
-
|
|
1240
|
+
c
|
|
1221
1241
|
] }) : null
|
|
1222
1242
|
] })
|
|
1223
1243
|
] });
|
|
1224
1244
|
}
|
|
1225
|
-
function el({ label: n, value: l, onChange: t, onSend:
|
|
1226
|
-
const
|
|
1227
|
-
|
|
1228
|
-
}, p =
|
|
1229
|
-
return /* @__PURE__ */ u("form", { className: A("cms-composer", `cms-composer--${
|
|
1230
|
-
/* @__PURE__ */ e("label", { htmlFor:
|
|
1231
|
-
|
|
1245
|
+
function el({ label: n, value: l, onChange: t, onSend: i, onAttach: c, placeholder: s, variant: d = "chat", sendLabel: r = "Send", attachLabel: f = "Attach a file", leading: _, canSend: o }) {
|
|
1246
|
+
const m = G(), a = o ?? l.trim() !== "", h = (v) => {
|
|
1247
|
+
v.preventDefault(), a && i();
|
|
1248
|
+
}, p = c ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": f, onClick: c, children: /* @__PURE__ */ e(T, { name: "paperclip" }) }) : null;
|
|
1249
|
+
return /* @__PURE__ */ u("form", { className: A("cms-composer", `cms-composer--${d}`), onSubmit: h, children: [
|
|
1250
|
+
/* @__PURE__ */ e("label", { htmlFor: m, className: d === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: n }),
|
|
1251
|
+
d === "chat" ? p : null,
|
|
1232
1252
|
/* @__PURE__ */ e(
|
|
1233
1253
|
"textarea",
|
|
1234
1254
|
{
|
|
1235
|
-
id:
|
|
1255
|
+
id: m,
|
|
1236
1256
|
className: "cms-composer__input",
|
|
1237
|
-
rows:
|
|
1257
|
+
rows: d === "reply" ? 3 : 1,
|
|
1238
1258
|
placeholder: s,
|
|
1239
1259
|
value: l,
|
|
1240
|
-
onChange: (
|
|
1241
|
-
onKeyDown: (
|
|
1242
|
-
|
|
1260
|
+
onChange: (v) => t(v.target.value),
|
|
1261
|
+
onKeyDown: (v) => {
|
|
1262
|
+
v.nativeEvent.isComposing || v.keyCode === 229 || d === "chat" && v.key === "Enter" && !v.shiftKey && (v.preventDefault(), a && i());
|
|
1243
1263
|
}
|
|
1244
1264
|
}
|
|
1245
1265
|
),
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1266
|
+
d === "reply" && _ !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-composer__leading", children: _ }) : null,
|
|
1267
|
+
d === "reply" ? p : null,
|
|
1268
|
+
d === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": r, disabled: !a, children: /* @__PURE__ */ e(T, { name: "send" }) }) : /* @__PURE__ */ u("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: !a, children: [
|
|
1269
|
+
r,
|
|
1250
1270
|
" ",
|
|
1251
|
-
/* @__PURE__ */ e(
|
|
1271
|
+
/* @__PURE__ */ e(T, { name: "send", size: 18 })
|
|
1252
1272
|
] })
|
|
1253
1273
|
] });
|
|
1254
1274
|
}
|
|
@@ -1273,72 +1293,72 @@ const Ee = {
|
|
|
1273
1293
|
onCallWith: (n) => `On a call with ${n}`,
|
|
1274
1294
|
returnToCall: "Return to call"
|
|
1275
1295
|
};
|
|
1276
|
-
function nl({ name: n, media: l, onAccept: t, onDecline:
|
|
1277
|
-
const s = ce(Ee,
|
|
1278
|
-
return /* @__PURE__ */ u("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": s.incomingFrom(
|
|
1296
|
+
function nl({ name: n, media: l, onAccept: t, onDecline: i, labels: c }) {
|
|
1297
|
+
const s = ce(Ee, c), d = l === "video" ? s.incomingVideo : s.incomingAudio;
|
|
1298
|
+
return /* @__PURE__ */ u("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": s.incomingFrom(d, n), children: [
|
|
1279
1299
|
/* @__PURE__ */ e("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ e(ve, { name: n, size: 112 }) }),
|
|
1280
1300
|
/* @__PURE__ */ e("p", { className: "cms-call-incoming__name", children: n }),
|
|
1281
|
-
/* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children:
|
|
1301
|
+
/* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children: d }),
|
|
1282
1302
|
/* @__PURE__ */ u("div", { className: "cms-call-incoming__actions", children: [
|
|
1283
|
-
/* @__PURE__ */ e(ae, { icon: "phone-off", label: s.decline, tone: "hang-up", onClick:
|
|
1303
|
+
/* @__PURE__ */ e(ae, { icon: "phone-off", label: s.decline, tone: "hang-up", onClick: i }),
|
|
1284
1304
|
/* @__PURE__ */ e(ae, { icon: "phone", label: s.accept, tone: "accept", onClick: t })
|
|
1285
1305
|
] })
|
|
1286
1306
|
] });
|
|
1287
1307
|
}
|
|
1288
|
-
function ae({ icon: n, label: l, onClick: t, tone:
|
|
1308
|
+
function ae({ icon: n, label: l, onClick: t, tone: i = "plain", pressed: c }) {
|
|
1289
1309
|
return /* @__PURE__ */ u(
|
|
1290
1310
|
"button",
|
|
1291
1311
|
{
|
|
1292
1312
|
type: "button",
|
|
1293
|
-
className: A("cms-call-button", `cms-call-button--${
|
|
1294
|
-
"aria-pressed":
|
|
1313
|
+
className: A("cms-call-button", `cms-call-button--${i}`, c && "is-pressed"),
|
|
1314
|
+
"aria-pressed": c,
|
|
1295
1315
|
onClick: t,
|
|
1296
1316
|
children: [
|
|
1297
|
-
/* @__PURE__ */ e("span", { className: "cms-call-button__disc", children: /* @__PURE__ */ e(
|
|
1317
|
+
/* @__PURE__ */ e("span", { className: "cms-call-button__disc", children: /* @__PURE__ */ e(T, { name: n, size: 24 }) }),
|
|
1298
1318
|
/* @__PURE__ */ e("span", { className: "cms-call-button__label", children: l })
|
|
1299
1319
|
]
|
|
1300
1320
|
}
|
|
1301
1321
|
);
|
|
1302
1322
|
}
|
|
1303
|
-
function ll({ name: n, duration: l, connection: t, you:
|
|
1304
|
-
const
|
|
1305
|
-
return /* @__PURE__ */ u("section", { className: "cms-call-panel", "aria-label":
|
|
1323
|
+
function ll({ name: n, duration: l, connection: t, you: i, muted: c, speaker: s, onToggleMute: d, onToggleSpeaker: r, onAddPerson: f, onChat: _, onHangUp: o, labels: m }) {
|
|
1324
|
+
const a = ce(Ee, m);
|
|
1325
|
+
return /* @__PURE__ */ u("section", { className: "cms-call-panel", "aria-label": a.callWith(n), children: [
|
|
1306
1326
|
/* @__PURE__ */ u("div", { className: "cms-call-panel__head", children: [
|
|
1307
1327
|
/* @__PURE__ */ e(ve, { name: n, size: 64 }),
|
|
1308
1328
|
/* @__PURE__ */ u("div", { className: "cms-call-panel__who", children: [
|
|
1309
1329
|
/* @__PURE__ */ e("p", { className: "cms-call-panel__name", children: n }),
|
|
1310
|
-
/* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label":
|
|
1330
|
+
/* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label": a.callTime(l), children: l })
|
|
1311
1331
|
] }),
|
|
1312
|
-
/* @__PURE__ */ e("span", { className: A("cms-pill", t === "good" ? "cms-pill--success" : "cms-pill--warning"), children: t === "good" ?
|
|
1332
|
+
/* @__PURE__ */ e("span", { className: A("cms-pill", t === "good" ? "cms-pill--success" : "cms-pill--warning"), children: t === "good" ? a.goodConnection : a.poorConnection })
|
|
1313
1333
|
] }),
|
|
1314
1334
|
/* @__PURE__ */ u("div", { className: "cms-call-panel__you", children: [
|
|
1315
|
-
/* @__PURE__ */ e(ve, { name:
|
|
1316
|
-
/* @__PURE__ */ e("span", { children:
|
|
1317
|
-
|
|
1335
|
+
/* @__PURE__ */ e(ve, { name: i.name, size: 36 }),
|
|
1336
|
+
/* @__PURE__ */ e("span", { children: a.you }),
|
|
1337
|
+
i.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label": a.speaking }) : null
|
|
1318
1338
|
] }),
|
|
1319
1339
|
/* @__PURE__ */ u("div", { className: "cms-call-panel__controls", children: [
|
|
1320
|
-
/* @__PURE__ */ e(ae, { icon: "mic", label:
|
|
1321
|
-
/* @__PURE__ */ e(ae, { icon: "speaker", label:
|
|
1322
|
-
|
|
1323
|
-
_ ? /* @__PURE__ */ e(ae, { icon: "chat", label:
|
|
1324
|
-
/* @__PURE__ */ e(ae, { icon: "phone-off", label:
|
|
1340
|
+
/* @__PURE__ */ e(ae, { icon: "mic", label: c ? a.unmute : a.mute, pressed: c, onClick: d }),
|
|
1341
|
+
/* @__PURE__ */ e(ae, { icon: "speaker", label: a.speaker, pressed: s, onClick: r }),
|
|
1342
|
+
f ? /* @__PURE__ */ e(ae, { icon: "user-plus", label: a.addPerson, onClick: f }) : null,
|
|
1343
|
+
_ ? /* @__PURE__ */ e(ae, { icon: "chat", label: a.chat, onClick: _ }) : null,
|
|
1344
|
+
/* @__PURE__ */ e(ae, { icon: "phone-off", label: a.hangUp, tone: "hang-up", onClick: o })
|
|
1325
1345
|
] })
|
|
1326
1346
|
] });
|
|
1327
1347
|
}
|
|
1328
|
-
function tl({ name: n, duration: l, muted: t, onToggleMute:
|
|
1329
|
-
const
|
|
1330
|
-
return /* @__PURE__ */ u("section", { className: "cms-call-bar", "aria-label":
|
|
1348
|
+
function tl({ name: n, duration: l, muted: t, onToggleMute: i, onReturn: c, onHangUp: s, labels: d }) {
|
|
1349
|
+
const r = ce(Ee, d);
|
|
1350
|
+
return /* @__PURE__ */ u("section", { className: "cms-call-bar", "aria-label": r.callWith(n), children: [
|
|
1331
1351
|
/* @__PURE__ */ e("span", { className: "cms-call-bar__live", "aria-hidden": "true" }),
|
|
1332
|
-
/* @__PURE__ */ e("span", { className: "cms-call-bar__name", children:
|
|
1352
|
+
/* @__PURE__ */ e("span", { className: "cms-call-bar__name", children: r.onCallWith(n) }),
|
|
1333
1353
|
/* @__PURE__ */ e("span", { className: "cms-call-bar__time", children: l }),
|
|
1334
1354
|
/* @__PURE__ */ u("span", { className: "cms-call-bar__actions", children: [
|
|
1335
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": t ?
|
|
1336
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick:
|
|
1337
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label":
|
|
1355
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": t ? r.unmute : r.mute, "aria-pressed": t, onClick: i, children: /* @__PURE__ */ e(T, { name: "mic" }) }),
|
|
1356
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: c, children: r.returnToCall }),
|
|
1357
|
+
/* @__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(T, { name: "phone-off" }) })
|
|
1338
1358
|
] })
|
|
1339
1359
|
] });
|
|
1340
1360
|
}
|
|
1341
|
-
function al({ mark: n, product: l, headline: t, lead:
|
|
1361
|
+
function al({ mark: n, product: l, headline: t, lead: i, features: c = [], children: s }) {
|
|
1342
1362
|
return /* @__PURE__ */ u("div", { className: "cms-signin", children: [
|
|
1343
1363
|
/* @__PURE__ */ u("aside", { className: "cms-signin__brand", children: [
|
|
1344
1364
|
/* @__PURE__ */ u("p", { className: "cms-signin__logo", children: [
|
|
@@ -1347,11 +1367,11 @@ function al({ mark: n, product: l, headline: t, lead: o, features: i = [], child
|
|
|
1347
1367
|
] }),
|
|
1348
1368
|
/* @__PURE__ */ u("div", { className: "cms-signin__pitch", children: [
|
|
1349
1369
|
/* @__PURE__ */ e("p", { className: "cms-signin__headline", children: t }),
|
|
1350
|
-
/* @__PURE__ */ e("p", { className: "cms-signin__lead", children:
|
|
1351
|
-
|
|
1352
|
-
/* @__PURE__ */ e(
|
|
1353
|
-
|
|
1354
|
-
] },
|
|
1370
|
+
/* @__PURE__ */ e("p", { className: "cms-signin__lead", children: i }),
|
|
1371
|
+
c.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: c.map((d) => /* @__PURE__ */ u("li", { children: [
|
|
1372
|
+
/* @__PURE__ */ e(T, { name: d.icon, size: 18 }),
|
|
1373
|
+
d.label
|
|
1374
|
+
] }, d.label)) }) : null
|
|
1355
1375
|
] })
|
|
1356
1376
|
] }),
|
|
1357
1377
|
/* @__PURE__ */ e("main", { className: "cms-signin__form", children: s })
|
|
@@ -1369,56 +1389,56 @@ const vn = {
|
|
|
1369
1389
|
newHere: "New here?",
|
|
1370
1390
|
create: "Create an account"
|
|
1371
1391
|
};
|
|
1372
|
-
function sl({ server: n, onSubmit: l, forgotHref: t, createHref:
|
|
1373
|
-
const
|
|
1392
|
+
function sl({ server: n, onSubmit: l, forgotHref: t, createHref: i, error: c, busy: s, labels: d }) {
|
|
1393
|
+
const r = ce(vn, d), f = G(), [_, o] = E(""), [m, a] = E(""), [h, p] = E(!1);
|
|
1374
1394
|
return /* @__PURE__ */ u("form", { className: "cms-signin-form", onSubmit: (N) => {
|
|
1375
|
-
N.preventDefault(), l(_,
|
|
1376
|
-
}, "aria-describedby":
|
|
1377
|
-
/* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children:
|
|
1395
|
+
N.preventDefault(), l(_, m);
|
|
1396
|
+
}, "aria-describedby": c ? `${f}-error` : void 0, children: [
|
|
1397
|
+
/* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children: r.title }),
|
|
1378
1398
|
/* @__PURE__ */ u("p", { className: "cms-signin-form__server", children: [
|
|
1379
|
-
/* @__PURE__ */ e(
|
|
1399
|
+
/* @__PURE__ */ e(T, { name: "server", size: 18 }),
|
|
1380
1400
|
n
|
|
1381
1401
|
] }),
|
|
1382
|
-
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${
|
|
1402
|
+
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${f}-identifier`, children: r.identifier }),
|
|
1383
1403
|
/* @__PURE__ */ e(
|
|
1384
1404
|
"input",
|
|
1385
1405
|
{
|
|
1386
|
-
id: `${
|
|
1406
|
+
id: `${f}-identifier`,
|
|
1387
1407
|
className: "cms-signin-form__input",
|
|
1388
1408
|
type: "text",
|
|
1389
1409
|
autoComplete: "username",
|
|
1390
|
-
placeholder:
|
|
1410
|
+
placeholder: r.identifierPlaceholder,
|
|
1391
1411
|
value: _,
|
|
1392
|
-
onChange: (N) =>
|
|
1412
|
+
onChange: (N) => o(N.target.value),
|
|
1393
1413
|
required: !0
|
|
1394
1414
|
}
|
|
1395
1415
|
),
|
|
1396
|
-
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${
|
|
1416
|
+
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${f}-password`, children: r.password }),
|
|
1397
1417
|
/* @__PURE__ */ u("span", { className: "cms-signin-form__password", children: [
|
|
1398
1418
|
/* @__PURE__ */ e(
|
|
1399
1419
|
"input",
|
|
1400
1420
|
{
|
|
1401
|
-
id: `${
|
|
1421
|
+
id: `${f}-password`,
|
|
1402
1422
|
className: "cms-signin-form__input",
|
|
1403
|
-
type:
|
|
1423
|
+
type: h ? "text" : "password",
|
|
1404
1424
|
autoComplete: "current-password",
|
|
1405
|
-
value:
|
|
1406
|
-
onChange: (N) =>
|
|
1425
|
+
value: m,
|
|
1426
|
+
onChange: (N) => a(N.target.value),
|
|
1407
1427
|
required: !0
|
|
1408
1428
|
}
|
|
1409
1429
|
),
|
|
1410
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed":
|
|
1430
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": h, onClick: () => p((N) => !N), children: h ? r.hide : r.show })
|
|
1411
1431
|
] }),
|
|
1412
|
-
t ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: t, children:
|
|
1413
|
-
|
|
1414
|
-
/* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: s, "aria-busy": s || void 0, children:
|
|
1415
|
-
|
|
1416
|
-
/* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children:
|
|
1417
|
-
/* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href:
|
|
1432
|
+
t ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: t, children: r.forgot }) : null,
|
|
1433
|
+
c ? /* @__PURE__ */ e("p", { id: `${f}-error`, className: "cms-signin-form__error", role: "alert", children: c }) : null,
|
|
1434
|
+
/* @__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 }),
|
|
1435
|
+
i ? /* @__PURE__ */ u(M, { children: [
|
|
1436
|
+
/* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children: r.newHere }) }),
|
|
1437
|
+
/* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: i, children: r.create })
|
|
1418
1438
|
] }) : null
|
|
1419
1439
|
] });
|
|
1420
1440
|
}
|
|
1421
|
-
const
|
|
1441
|
+
const ke = 64;
|
|
1422
1442
|
function gn(n, l) {
|
|
1423
1443
|
for (let t = n instanceof Element ? n : null; t !== null; t = t.parentElement) {
|
|
1424
1444
|
if (t instanceof HTMLElement && t.scrollTop > 0) return !1;
|
|
@@ -1427,27 +1447,27 @@ function gn(n, l) {
|
|
|
1427
1447
|
return l.scrollTop <= 0;
|
|
1428
1448
|
}
|
|
1429
1449
|
function Nn(n, l) {
|
|
1430
|
-
const [t,
|
|
1431
|
-
return
|
|
1450
|
+
const [t, i] = E(0), c = F(l);
|
|
1451
|
+
return c.current = l, Y(() => {
|
|
1432
1452
|
const s = n.current;
|
|
1433
1453
|
if (s === null) return;
|
|
1434
|
-
let
|
|
1435
|
-
const
|
|
1436
|
-
|
|
1437
|
-
}, _ = (
|
|
1438
|
-
if (
|
|
1439
|
-
const
|
|
1440
|
-
if (
|
|
1441
|
-
|
|
1454
|
+
let d = null, r = 0;
|
|
1455
|
+
const f = (m) => {
|
|
1456
|
+
d = gn(m.target, s) && m.touches.length === 1 ? m.touches[0].clientY : null, r = 0;
|
|
1457
|
+
}, _ = (m) => {
|
|
1458
|
+
if (d === null || c.current === null) return;
|
|
1459
|
+
const a = m.touches[0].clientY - d;
|
|
1460
|
+
if (a <= 0) {
|
|
1461
|
+
d = null, i(0);
|
|
1442
1462
|
return;
|
|
1443
1463
|
}
|
|
1444
|
-
|
|
1445
|
-
},
|
|
1446
|
-
var
|
|
1447
|
-
|
|
1464
|
+
m.cancelable && m.preventDefault(), r = Math.min(a * 0.6, ke * 1.5), i(r);
|
|
1465
|
+
}, o = () => {
|
|
1466
|
+
var m;
|
|
1467
|
+
d !== null && r >= ke && ((m = c.current) == null || m.call(c)), d = null, r = 0, i(0);
|
|
1448
1468
|
};
|
|
1449
|
-
return s.addEventListener("touchstart",
|
|
1450
|
-
s.removeEventListener("touchstart",
|
|
1469
|
+
return s.addEventListener("touchstart", f, { passive: !0 }), s.addEventListener("touchmove", _, { passive: !1 }), s.addEventListener("touchend", o), s.addEventListener("touchcancel", o), () => {
|
|
1470
|
+
s.removeEventListener("touchstart", f), s.removeEventListener("touchmove", _), s.removeEventListener("touchend", o), s.removeEventListener("touchcancel", o);
|
|
1451
1471
|
};
|
|
1452
1472
|
}, [n]), t;
|
|
1453
1473
|
}
|
|
@@ -1455,92 +1475,92 @@ const Fe = Ue(null);
|
|
|
1455
1475
|
function yn() {
|
|
1456
1476
|
return Ke(Fe);
|
|
1457
1477
|
}
|
|
1458
|
-
function rl({ label: n, rows: l, error: t, onRetry:
|
|
1459
|
-
const
|
|
1460
|
-
if (t != null) return /* @__PURE__ */ e(Ge, { message: t, onRetry:
|
|
1461
|
-
if (l === null) return /* @__PURE__ */ e(qe, { what:
|
|
1462
|
-
if (l.length === 0) return /* @__PURE__ */ e(Ye, { title: s, hint:
|
|
1463
|
-
const
|
|
1478
|
+
function rl({ label: n, rows: l, error: t, onRetry: i, loadingText: c = "Loading", emptyTitle: s = "Nothing here yet", emptyHint: d, selected: r, onOpen: f, onRowMenu: _ }) {
|
|
1479
|
+
const o = F([]), m = yn();
|
|
1480
|
+
if (t != null) return /* @__PURE__ */ e(Ge, { message: t, onRetry: i });
|
|
1481
|
+
if (l === null) return /* @__PURE__ */ e(qe, { what: c, layout: "block" });
|
|
1482
|
+
if (l.length === 0) return /* @__PURE__ */ e(Ye, { title: s, hint: d });
|
|
1483
|
+
const a = (h, p, v) => {
|
|
1464
1484
|
var N;
|
|
1465
|
-
if (
|
|
1466
|
-
|
|
1467
|
-
else if (
|
|
1468
|
-
|
|
1469
|
-
else if ((
|
|
1470
|
-
|
|
1471
|
-
const w =
|
|
1472
|
-
_(
|
|
1485
|
+
if (h.key === "ArrowDown" || h.key === "ArrowUp")
|
|
1486
|
+
h.preventDefault(), (N = o.current[Math.min(l.length - 1, Math.max(0, p + (h.key === "ArrowDown" ? 1 : -1)))]) == null || N.focus();
|
|
1487
|
+
else if (h.key === "Enter")
|
|
1488
|
+
f == null || f(v);
|
|
1489
|
+
else if ((h.key === "ContextMenu" || h.shiftKey && h.key === "F10") && _) {
|
|
1490
|
+
h.preventDefault();
|
|
1491
|
+
const w = h.currentTarget.getBoundingClientRect();
|
|
1492
|
+
_(v, { x: w.left + 16, y: w.bottom });
|
|
1473
1493
|
}
|
|
1474
1494
|
};
|
|
1475
1495
|
return /* @__PURE__ */ u(M, { children: [
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1496
|
+
m !== null && (m.distance > 0 || m.refreshing) ? /* @__PURE__ */ u("div", { className: "cms-list__pull", role: "status", style: { height: m.refreshing ? void 0 : m.distance }, "data-ready": m.distance >= ke ? "" : void 0, children: [
|
|
1497
|
+
m.refreshing ? /* @__PURE__ */ e(z, { name: "spinner" }) : null,
|
|
1498
|
+
m.text != null ? /* @__PURE__ */ e("span", { className: "cms-list__pull-text", children: m.text }) : null
|
|
1479
1499
|
] }) : null,
|
|
1480
|
-
/* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: l.map((
|
|
1481
|
-
const
|
|
1500
|
+
/* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": n, children: l.map((h, p) => {
|
|
1501
|
+
const v = h.id === r;
|
|
1482
1502
|
return /* @__PURE__ */ u(
|
|
1483
1503
|
"li",
|
|
1484
1504
|
{
|
|
1485
1505
|
ref: (N) => {
|
|
1486
|
-
|
|
1506
|
+
o.current[p] = N;
|
|
1487
1507
|
},
|
|
1488
1508
|
role: "option",
|
|
1489
|
-
"aria-selected":
|
|
1490
|
-
tabIndex:
|
|
1491
|
-
className: A("cms-list__row",
|
|
1492
|
-
onClick: () =>
|
|
1493
|
-
onKeyDown: (N) =>
|
|
1509
|
+
"aria-selected": v,
|
|
1510
|
+
tabIndex: v || r == null && p === 0 ? 0 : -1,
|
|
1511
|
+
className: A("cms-list__row", v && "is-selected"),
|
|
1512
|
+
onClick: () => f == null ? void 0 : f(h.id),
|
|
1513
|
+
onKeyDown: (N) => a(N, p, h.id),
|
|
1494
1514
|
onContextMenu: _ ? (N) => {
|
|
1495
|
-
N.preventDefault(), _(
|
|
1515
|
+
N.preventDefault(), _(h.id, { x: N.clientX, y: N.clientY });
|
|
1496
1516
|
} : void 0,
|
|
1497
1517
|
children: [
|
|
1498
|
-
|
|
1518
|
+
h.lead != null ? /* @__PURE__ */ e("span", { className: "cms-list__lead", children: h.lead }) : null,
|
|
1499
1519
|
/* @__PURE__ */ u("span", { className: "cms-list__text", children: [
|
|
1500
|
-
/* @__PURE__ */ e("span", { className: A("cms-list__primary",
|
|
1501
|
-
|
|
1520
|
+
/* @__PURE__ */ e("span", { className: A("cms-list__primary", h.unread === !0 && "is-unread"), children: h.primary }),
|
|
1521
|
+
h.secondary != null ? /* @__PURE__ */ e("span", { className: "cms-list__secondary", children: h.secondary }) : null
|
|
1502
1522
|
] }),
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1523
|
+
h.meta != null || h.count !== void 0 ? /* @__PURE__ */ u("span", { className: "cms-list__end", children: [
|
|
1524
|
+
h.meta != null ? /* @__PURE__ */ e("span", { className: "cms-list__meta", children: h.meta }) : null,
|
|
1525
|
+
h.count !== void 0 && h.count > 0 ? /* @__PURE__ */ e("span", { className: "cms-badge cms-list__count", children: h.count }) : null
|
|
1506
1526
|
] }) : null
|
|
1507
1527
|
]
|
|
1508
1528
|
},
|
|
1509
|
-
|
|
1529
|
+
h.id
|
|
1510
1530
|
);
|
|
1511
1531
|
}) })
|
|
1512
1532
|
] });
|
|
1513
1533
|
}
|
|
1514
|
-
function
|
|
1515
|
-
const s =
|
|
1516
|
-
if (
|
|
1534
|
+
function Re({ at: n, items: l, onClose: t, label: i = "Actions", focus: c = "first" }) {
|
|
1535
|
+
const s = F(null), d = F(null), r = G(), [f, _] = E(n), o = l.filter((a) => a.offer.offered);
|
|
1536
|
+
if (ge(() => {
|
|
1517
1537
|
if (!n) return;
|
|
1518
|
-
const
|
|
1519
|
-
_({ x: Math.max(0, Math.min(n.x, window.innerWidth -
|
|
1538
|
+
const a = s.current, h = (a == null ? void 0 : a.offsetWidth) ?? 0, p = (a == null ? void 0 : a.offsetHeight) ?? 0;
|
|
1539
|
+
_({ x: Math.max(0, Math.min(n.x, window.innerWidth - h)), y: Math.max(0, Math.min(n.y, window.innerHeight - p)) });
|
|
1520
1540
|
}, [n]), Y(() => {
|
|
1521
|
-
var p,
|
|
1541
|
+
var p, v;
|
|
1522
1542
|
if (!n) return;
|
|
1523
|
-
|
|
1524
|
-
const
|
|
1525
|
-
(
|
|
1526
|
-
const
|
|
1543
|
+
d.current = document.activeElement;
|
|
1544
|
+
const a = Array.from(((p = s.current) == null ? void 0 : p.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')) ?? []);
|
|
1545
|
+
(v = c === "last" ? a[a.length - 1] : a[0]) == null || v.focus();
|
|
1546
|
+
const h = (N) => {
|
|
1527
1547
|
var w;
|
|
1528
1548
|
(w = s.current) != null && w.contains(N.target) || t();
|
|
1529
1549
|
};
|
|
1530
|
-
return document.addEventListener("mousedown",
|
|
1550
|
+
return document.addEventListener("mousedown", h), () => {
|
|
1531
1551
|
var N, w;
|
|
1532
|
-
document.removeEventListener("mousedown",
|
|
1552
|
+
document.removeEventListener("mousedown", h), (w = (N = d.current) == null ? void 0 : N.focus) == null || w.call(N);
|
|
1533
1553
|
};
|
|
1534
|
-
}, [n, t,
|
|
1535
|
-
const
|
|
1536
|
-
var
|
|
1537
|
-
const
|
|
1538
|
-
if (
|
|
1539
|
-
|
|
1540
|
-
else if (
|
|
1541
|
-
|
|
1542
|
-
const w =
|
|
1543
|
-
(N =
|
|
1554
|
+
}, [n, t, c]), !n || o.length === 0) return null;
|
|
1555
|
+
const m = (a) => {
|
|
1556
|
+
var v, N;
|
|
1557
|
+
const h = Array.from(((v = s.current) == null ? void 0 : v.querySelectorAll('[role="menuitem"]')) ?? []), p = h.indexOf(document.activeElement);
|
|
1558
|
+
if (a.key === "Escape" || a.key === "Tab")
|
|
1559
|
+
a.preventDefault(), t();
|
|
1560
|
+
else if (a.key === "ArrowDown" || a.key === "ArrowUp") {
|
|
1561
|
+
a.preventDefault();
|
|
1562
|
+
const w = a.key === "ArrowDown" ? 1 : -1;
|
|
1563
|
+
(N = h[(p + w + h.length) % h.length]) == null || N.focus();
|
|
1544
1564
|
}
|
|
1545
1565
|
};
|
|
1546
1566
|
return Me(
|
|
@@ -1550,34 +1570,34 @@ function He({ at: n, items: l, onClose: t, label: o = "Actions", focus: i = "fir
|
|
|
1550
1570
|
ref: s,
|
|
1551
1571
|
className: "cms-menu",
|
|
1552
1572
|
role: "menu",
|
|
1553
|
-
"aria-label":
|
|
1554
|
-
style: { left: (
|
|
1555
|
-
onKeyDown:
|
|
1556
|
-
onContextMenu: (
|
|
1557
|
-
children:
|
|
1558
|
-
const
|
|
1573
|
+
"aria-label": i,
|
|
1574
|
+
style: { left: (f ?? n).x, top: (f ?? n).y },
|
|
1575
|
+
onKeyDown: m,
|
|
1576
|
+
onContextMenu: (a) => a.preventDefault(),
|
|
1577
|
+
children: o.map((a) => {
|
|
1578
|
+
const h = a.offer.refusal !== void 0;
|
|
1559
1579
|
return /* @__PURE__ */ u(
|
|
1560
1580
|
"div",
|
|
1561
1581
|
{
|
|
1562
1582
|
role: "menuitem",
|
|
1563
1583
|
tabIndex: -1,
|
|
1564
|
-
"aria-disabled":
|
|
1565
|
-
"aria-describedby":
|
|
1566
|
-
title:
|
|
1567
|
-
className: A("cms-menu__item",
|
|
1584
|
+
"aria-disabled": h || void 0,
|
|
1585
|
+
"aria-describedby": h ? `${r}-${a.id}` : void 0,
|
|
1586
|
+
title: h ? a.offer.refusal : void 0,
|
|
1587
|
+
className: A("cms-menu__item", a.danger && "is-danger", a.offer.locked && "is-locked", h && "is-refused"),
|
|
1568
1588
|
onClick: () => {
|
|
1569
|
-
|
|
1589
|
+
h || (t(), a.onSelect());
|
|
1570
1590
|
},
|
|
1571
1591
|
onKeyDown: (p) => {
|
|
1572
|
-
(p.key === "Enter" || p.key === " ") && !
|
|
1592
|
+
(p.key === "Enter" || p.key === " ") && !h && (p.preventDefault(), t(), a.onSelect());
|
|
1573
1593
|
},
|
|
1574
1594
|
children: [
|
|
1575
|
-
|
|
1576
|
-
/* @__PURE__ */ e("span", { className: "cms-menu__label", children:
|
|
1577
|
-
|
|
1595
|
+
a.offer.locked ? /* @__PURE__ */ e(z, { name: "lock" }) : null,
|
|
1596
|
+
/* @__PURE__ */ e("span", { className: "cms-menu__label", children: a.label }),
|
|
1597
|
+
h ? /* @__PURE__ */ e("span", { id: `${r}-${a.id}`, className: "cms-menu__refusal", children: a.offer.refusal }) : null
|
|
1578
1598
|
]
|
|
1579
1599
|
},
|
|
1580
|
-
|
|
1600
|
+
a.id
|
|
1581
1601
|
);
|
|
1582
1602
|
})
|
|
1583
1603
|
}
|
|
@@ -1594,18 +1614,18 @@ function wn(n) {
|
|
|
1594
1614
|
function kn(n) {
|
|
1595
1615
|
const l = /* @__PURE__ */ new Map();
|
|
1596
1616
|
for (const t of n) t.overflow !== void 0 && t.overflow !== 0 && l.set(t.overflow, [...l.get(t.overflow) ?? [], t.id]);
|
|
1597
|
-
return [...l.entries()].sort(([t], [
|
|
1617
|
+
return [...l.entries()].sort(([t], [i]) => t - i).map(([, t]) => t);
|
|
1598
1618
|
}
|
|
1599
|
-
function cl({ label: n, actions: l, onAction: t, status:
|
|
1600
|
-
const
|
|
1601
|
-
const
|
|
1602
|
-
if (
|
|
1603
|
-
const
|
|
1619
|
+
function cl({ label: n, actions: l, onAction: t, status: i, moreLabel: c, leading: s }) {
|
|
1620
|
+
const d = F(null), r = F(null), [f, _] = E(De), [o, m] = E(null), [a, h] = E("first"), [p, v] = E(null), [N, w] = E(null), x = wn(l), S = kn(l), C = x.flat(), R = C.filter((g) => g.overflow === 0), H = C.filter((g) => g.overflow !== 0), ee = JSON.stringify([l.map((g) => [g.id, g.label, g.icon, g.group, g.overflow ?? null]), i ?? "", s !== void 0]), j = be(() => {
|
|
1621
|
+
const g = d.current, L = r.current;
|
|
1622
|
+
if (g === null || L === null) return;
|
|
1623
|
+
const V = getComputedStyle(g), W = parseFloat(V.columnGap || "0") || 0, $ = g.clientWidth - (parseFloat(V.paddingLeft) || 0) - (parseFloat(V.paddingRight) || 0), q = (I) => {
|
|
1604
1624
|
var U;
|
|
1605
|
-
return ((U =
|
|
1625
|
+
return ((U = L.querySelector(I)) == null ? void 0 : U.getBoundingClientRect().width) ?? 0;
|
|
1606
1626
|
}, de = q('[data-measure="leading"]'), ue = q('[data-measure="separator"]'), me = q('[data-measure="more"]'), he = (I, U) => q(`[data-measure="${U ? "full" : "icon"}"][data-measure-action="${CSS.escape(I)}"]`), b = (I, U) => {
|
|
1607
|
-
const Q = /* @__PURE__ */ new Set([...
|
|
1608
|
-
return de + fe.reduce((te, pe) => te + he(pe.id, !I.has(pe.id)), 0) + ue * Math.max(0, se.length - 1) + (Q.size > 0 ? me : 0) + W * Math.max(0,
|
|
1627
|
+
const Q = /* @__PURE__ */ new Set([...R.map((te) => te.id), ...U]), se = x.map((te) => te.filter((pe) => !Q.has(pe.id))).filter((te) => te.length > 0), fe = se.flat(), He = fe.length + (se.length - 1) + (Q.size > 0 ? 1 : 0) + (de > 0 ? 1 : 0);
|
|
1628
|
+
return de + fe.reduce((te, pe) => te + he(pe.id, !I.has(pe.id)), 0) + ue * Math.max(0, se.length - 1) + (Q.size > 0 ? me : 0) + W * Math.max(0, He - 1);
|
|
1609
1629
|
}, k = H.filter((I) => !S.some((U) => U.includes(I.id))).map((I) => I.id), B = [...S, ...[...k].reverse().map((I) => [I])];
|
|
1610
1630
|
let K = null;
|
|
1611
1631
|
if (b(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()) <= $) K = De;
|
|
@@ -1631,75 +1651,75 @@ function cl({ label: n, actions: l, onAction: t, status: o, moreLabel: i, leadin
|
|
|
1631
1651
|
}
|
|
1632
1652
|
K = { bare: I, hidden: U };
|
|
1633
1653
|
}
|
|
1634
|
-
const
|
|
1635
|
-
_((I) => $e(I.bare,
|
|
1654
|
+
const Ne = K;
|
|
1655
|
+
_((I) => $e(I.bare, Ne.bare) && $e(I.hidden, Ne.hidden) ? I : Ne);
|
|
1636
1656
|
}, [ee]);
|
|
1637
|
-
|
|
1638
|
-
const
|
|
1639
|
-
if (
|
|
1640
|
-
const
|
|
1641
|
-
return
|
|
1657
|
+
ge(j, [j]), Y(() => {
|
|
1658
|
+
const g = d.current;
|
|
1659
|
+
if (g === null || typeof ResizeObserver > "u") return;
|
|
1660
|
+
const L = new ResizeObserver(() => j());
|
|
1661
|
+
return L.observe(g), () => L.disconnect();
|
|
1642
1662
|
}, [j]);
|
|
1643
|
-
const y = /* @__PURE__ */ new Set([...
|
|
1644
|
-
...
|
|
1645
|
-
...S.flat().map((
|
|
1663
|
+
const y = /* @__PURE__ */ new Set([...R.map((g) => g.id), ...f.hidden]), Z = x.map((g) => g.filter((L) => !y.has(L.id))).filter((g) => g.length > 0).flat(), D = [
|
|
1664
|
+
...R,
|
|
1665
|
+
...S.flat().map((g) => C.find((L) => L.id === g)).filter((g) => g !== void 0 && f.hidden.has(g.id)),
|
|
1646
1666
|
// The pinned that a row too narrow for them sent behind ..., in the row's order.
|
|
1647
|
-
...H.filter((
|
|
1648
|
-
], X = new Set(H.filter((
|
|
1667
|
+
...H.filter((g) => f.hidden.has(g.id) && !S.some((L) => L.includes(g.id)))
|
|
1668
|
+
], X = new Set(H.filter((g) => !S.some((L) => L.includes(g.id))).map((g) => g.id)), O = [...Z.map((g) => g.id), ...D.length > 0 ? ["more"] : []], J = p !== null && O.includes(p) ? p : O[0] ?? null, ie = (g) => {
|
|
1649
1669
|
var $, q;
|
|
1650
|
-
const
|
|
1651
|
-
let
|
|
1652
|
-
if (
|
|
1653
|
-
|
|
1654
|
-
const W = O[
|
|
1655
|
-
|
|
1656
|
-
}, oe = D.map((
|
|
1657
|
-
id:
|
|
1670
|
+
const L = O.indexOf(J ?? "");
|
|
1671
|
+
let V = null;
|
|
1672
|
+
if (g.key === "ArrowRight" ? V = Math.min(O.length - 1, L + 1) : g.key === "ArrowLeft" ? V = Math.max(0, L - 1) : g.key === "Home" ? V = 0 : g.key === "End" ? V = O.length - 1 : g.key === "Escape" && w(J), V === null) return;
|
|
1673
|
+
g.preventDefault();
|
|
1674
|
+
const W = O[V] ?? null;
|
|
1675
|
+
v(W), (q = ($ = d.current) == null ? void 0 : $.querySelector(`[data-stop="${CSS.escape(W ?? "")}"]`)) == null || q.focus();
|
|
1676
|
+
}, oe = D.map((g) => ({
|
|
1677
|
+
id: g.id,
|
|
1658
1678
|
label: /* @__PURE__ */ u(M, { children: [
|
|
1659
|
-
/* @__PURE__ */ e(_e, { name:
|
|
1660
|
-
|
|
1679
|
+
/* @__PURE__ */ e(_e, { name: g.icon }),
|
|
1680
|
+
g.label
|
|
1661
1681
|
] }),
|
|
1662
|
-
offer:
|
|
1663
|
-
...
|
|
1682
|
+
offer: g.disabled ? { offered: !0, locked: !1, refusal: g.reason ?? "" } : { offered: !0, locked: !1 },
|
|
1683
|
+
...g.danger ? { danger: !0 } : {},
|
|
1664
1684
|
onSelect: () => {
|
|
1665
|
-
!
|
|
1685
|
+
!g.disabled && !g.busy && t(g.id);
|
|
1666
1686
|
}
|
|
1667
1687
|
}));
|
|
1668
1688
|
return /* @__PURE__ */ u(
|
|
1669
1689
|
"div",
|
|
1670
1690
|
{
|
|
1671
|
-
ref:
|
|
1691
|
+
ref: d,
|
|
1672
1692
|
role: "toolbar",
|
|
1673
1693
|
"aria-label": n,
|
|
1674
1694
|
className: A(
|
|
1675
1695
|
"cms-pane-toolbar",
|
|
1676
|
-
H.length > 0 &&
|
|
1677
|
-
|
|
1696
|
+
H.length > 0 && f.bare.size >= H.length && "cms-pane-toolbar--labels-hidden",
|
|
1697
|
+
f.bare.size > 0 && f.bare.size < H.length && "cms-pane-toolbar--labels-partly-hidden"
|
|
1678
1698
|
),
|
|
1679
1699
|
onKeyDown: ie,
|
|
1680
1700
|
children: [
|
|
1681
1701
|
s !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-pane-toolbar__leading", children: s }) : null,
|
|
1682
|
-
x.map((
|
|
1683
|
-
const
|
|
1702
|
+
x.map((g, L) => {
|
|
1703
|
+
const V = g.filter(($) => !y.has($.id)), W = x.slice(0, L).some(($) => $.some((q) => !y.has(q.id)));
|
|
1684
1704
|
return /* @__PURE__ */ u("div", { className: "cms-pane-toolbar__group-wrap", children: [
|
|
1685
|
-
|
|
1686
|
-
/* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden:
|
|
1705
|
+
V.length > 0 && W ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__separator", role: "separator", "aria-orientation": "vertical" }) : null,
|
|
1706
|
+
/* @__PURE__ */ e("div", { className: "cms-pane-toolbar__group", hidden: V.length === 0, children: g.map(($) => /* @__PURE__ */ e(
|
|
1687
1707
|
xn,
|
|
1688
1708
|
{
|
|
1689
1709
|
action: $,
|
|
1690
|
-
labels: !
|
|
1710
|
+
labels: !f.bare.has($.id),
|
|
1691
1711
|
overflowed: y.has($.id),
|
|
1692
1712
|
pinned: X.has($.id),
|
|
1693
1713
|
tabbable: J === $.id,
|
|
1694
1714
|
tipOff: N === $.id,
|
|
1695
1715
|
onChoose: () => t($.id),
|
|
1696
1716
|
onFocus: () => {
|
|
1697
|
-
|
|
1717
|
+
v($.id), w(null);
|
|
1698
1718
|
}
|
|
1699
1719
|
},
|
|
1700
1720
|
$.id
|
|
1701
1721
|
)) })
|
|
1702
|
-
] },
|
|
1722
|
+
] }, L);
|
|
1703
1723
|
}),
|
|
1704
1724
|
D.length > 0 ? /* @__PURE__ */ e(
|
|
1705
1725
|
"button",
|
|
@@ -1707,106 +1727,106 @@ function cl({ label: n, actions: l, onAction: t, status: o, moreLabel: i, leadin
|
|
|
1707
1727
|
type: "button",
|
|
1708
1728
|
className: "cms-icon-button cms-pane-toolbar__more",
|
|
1709
1729
|
"data-stop": "more",
|
|
1710
|
-
"aria-label":
|
|
1711
|
-
title:
|
|
1730
|
+
"aria-label": c,
|
|
1731
|
+
title: c,
|
|
1712
1732
|
"aria-haspopup": "menu",
|
|
1713
|
-
"aria-expanded":
|
|
1733
|
+
"aria-expanded": o !== null,
|
|
1714
1734
|
tabIndex: J === "more" ? 0 : -1,
|
|
1715
|
-
onFocus: () =>
|
|
1716
|
-
onClick: (
|
|
1717
|
-
const
|
|
1718
|
-
|
|
1735
|
+
onFocus: () => v("more"),
|
|
1736
|
+
onClick: (g) => {
|
|
1737
|
+
const L = g.currentTarget.getBoundingClientRect();
|
|
1738
|
+
h("first"), m(o === null ? { x: L.left, y: L.bottom } : null);
|
|
1719
1739
|
},
|
|
1720
|
-
onKeyDown: (
|
|
1721
|
-
if (
|
|
1722
|
-
|
|
1723
|
-
const
|
|
1724
|
-
|
|
1740
|
+
onKeyDown: (g) => {
|
|
1741
|
+
if (g.key === "ArrowDown" || g.key === "ArrowUp") {
|
|
1742
|
+
g.preventDefault(), g.stopPropagation();
|
|
1743
|
+
const L = g.currentTarget.getBoundingClientRect();
|
|
1744
|
+
h(g.key === "ArrowUp" ? "last" : "first"), m({ x: L.left, y: L.bottom });
|
|
1725
1745
|
}
|
|
1726
1746
|
},
|
|
1727
|
-
children: /* @__PURE__ */ e(
|
|
1747
|
+
children: /* @__PURE__ */ e(T, { name: "more" })
|
|
1728
1748
|
}
|
|
1729
1749
|
) : null,
|
|
1730
|
-
|
|
1731
|
-
/* @__PURE__ */ e(
|
|
1732
|
-
/* @__PURE__ */ u("div", { ref:
|
|
1750
|
+
i !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__status", title: i, children: i }) : null,
|
|
1751
|
+
/* @__PURE__ */ e(Re, { at: o, items: oe, onClose: () => m(null), label: c, focus: a }),
|
|
1752
|
+
/* @__PURE__ */ u("div", { ref: r, className: "cms-pane-toolbar__measure", "aria-hidden": "true", children: [
|
|
1733
1753
|
s !== void 0 ? /* @__PURE__ */ e("div", { "data-measure": "leading", children: s }) : null,
|
|
1734
1754
|
/* @__PURE__ */ e("span", { "data-measure": "separator", className: "cms-pane-toolbar__separator" }),
|
|
1735
|
-
/* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ e(
|
|
1736
|
-
C.map((
|
|
1737
|
-
/* @__PURE__ */ u("span", { "data-measure": "full", "data-measure-action":
|
|
1738
|
-
/* @__PURE__ */ e(_e, { name:
|
|
1739
|
-
/* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children:
|
|
1755
|
+
/* @__PURE__ */ e("span", { "data-measure": "more", className: "cms-icon-button cms-pane-toolbar__more", children: /* @__PURE__ */ e(T, { name: "more" }) }),
|
|
1756
|
+
C.map((g) => /* @__PURE__ */ u("span", { children: [
|
|
1757
|
+
/* @__PURE__ */ u("span", { "data-measure": "full", "data-measure-action": g.id, className: "cms-pane-toolbar__action", children: [
|
|
1758
|
+
/* @__PURE__ */ e(_e, { name: g.icon }),
|
|
1759
|
+
/* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: g.label })
|
|
1740
1760
|
] }),
|
|
1741
|
-
/* @__PURE__ */ e("span", { "data-measure": "icon", "data-measure-action":
|
|
1742
|
-
] },
|
|
1761
|
+
/* @__PURE__ */ e("span", { "data-measure": "icon", "data-measure-action": g.id, className: A("cms-pane-toolbar__action", re(g.icon) !== null && "cms-pane-toolbar__action--bare"), children: re(g.icon) !== null ? /* @__PURE__ */ e(_e, { name: g.icon }) : /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", children: g.label }) })
|
|
1762
|
+
] }, g.id))
|
|
1743
1763
|
] })
|
|
1744
1764
|
]
|
|
1745
1765
|
}
|
|
1746
1766
|
);
|
|
1747
1767
|
}
|
|
1748
|
-
function xn({ action: n, labels: l, overflowed: t, pinned:
|
|
1749
|
-
const [
|
|
1768
|
+
function xn({ action: n, labels: l, overflowed: t, pinned: i, tabbable: c, tipOff: s, onChoose: d, onFocus: r }) {
|
|
1769
|
+
const [f, _] = E(!1);
|
|
1750
1770
|
Y(() => {
|
|
1751
1771
|
if (!n.busy) {
|
|
1752
1772
|
_(!1);
|
|
1753
1773
|
return;
|
|
1754
1774
|
}
|
|
1755
|
-
const w = setTimeout(() => _(!0),
|
|
1775
|
+
const w = setTimeout(() => _(!0), we);
|
|
1756
1776
|
return () => clearTimeout(w);
|
|
1757
1777
|
}, [n.busy]);
|
|
1758
|
-
const
|
|
1778
|
+
const o = re(n.icon) === null, m = l || o, a = n.disabled && n.reason ? n.reason : null, h = a ?? (m ? null : n.label), p = G(), [v, N] = E(!1);
|
|
1759
1779
|
return /* @__PURE__ */ u(
|
|
1760
1780
|
"button",
|
|
1761
1781
|
{
|
|
1762
1782
|
type: "button",
|
|
1763
|
-
className: A("cms-pane-toolbar__action", !
|
|
1783
|
+
className: A("cms-pane-toolbar__action", !m && "cms-pane-toolbar__action--bare", o && "cms-pane-toolbar__action--text", n.danger && "is-danger"),
|
|
1764
1784
|
"data-action": n.id,
|
|
1765
1785
|
"data-stop": n.id,
|
|
1766
1786
|
...t ? { "data-overflowed": "" } : {},
|
|
1767
|
-
...
|
|
1787
|
+
...i ? { "data-pinned": "" } : {},
|
|
1768
1788
|
hidden: t,
|
|
1769
1789
|
"aria-label": n.label,
|
|
1770
1790
|
"aria-disabled": n.disabled || void 0,
|
|
1771
1791
|
"aria-busy": n.busy || void 0,
|
|
1772
|
-
...
|
|
1773
|
-
...
|
|
1774
|
-
tabIndex:
|
|
1775
|
-
onFocus:
|
|
1792
|
+
...a === null ? {} : { "aria-describedby": p },
|
|
1793
|
+
...v && a !== null ? { "data-reason-shown": "" } : {},
|
|
1794
|
+
tabIndex: c ? 0 : -1,
|
|
1795
|
+
onFocus: r,
|
|
1776
1796
|
onBlur: () => N(!1),
|
|
1777
1797
|
onKeyDown: (w) => {
|
|
1778
1798
|
w.key === "Escape" && N(!1);
|
|
1779
1799
|
},
|
|
1780
1800
|
onClick: () => {
|
|
1781
|
-
|
|
1801
|
+
a !== null ? N(!0) : !n.disabled && !n.busy && d();
|
|
1782
1802
|
},
|
|
1783
1803
|
children: [
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1804
|
+
f ? /* @__PURE__ */ e(z, { name: "spinner" }) : /* @__PURE__ */ e(_e, { name: n.icon }),
|
|
1805
|
+
m ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__label", "aria-hidden": "true", children: n.label }) : null,
|
|
1806
|
+
a !== null || h !== null && !s ? /* @__PURE__ */ e("span", { className: "cms-pane-toolbar__tip", role: "tooltip", id: p, children: h }) : null
|
|
1787
1807
|
]
|
|
1788
1808
|
}
|
|
1789
1809
|
);
|
|
1790
1810
|
}
|
|
1791
1811
|
function _e({ name: n }) {
|
|
1792
1812
|
const l = re(n);
|
|
1793
|
-
return l === null ? null : /* @__PURE__ */ e(
|
|
1813
|
+
return l === null ? null : /* @__PURE__ */ e(T, { name: l, size: 18 });
|
|
1794
1814
|
}
|
|
1795
|
-
function il({ title: n, body: l = null, time: t = null, unread:
|
|
1796
|
-
const [
|
|
1797
|
-
|
|
1798
|
-
}, p = (
|
|
1815
|
+
function il({ title: n, body: l = null, time: t = null, unread: i, unreadLabel: c, expandLabel: s, collapseLabel: d, action: r = null, onRead: f, leading: _ }) {
|
|
1816
|
+
const [o, m] = E(!1), a = G(), h = () => {
|
|
1817
|
+
i && f();
|
|
1818
|
+
}, p = (r == null ? void 0 : r.presentation) === "row" && r.onAction !== void 0, v = (r == null ? void 0 : r.presentation) === "button" && r.onAction !== void 0 ? r : null, N = () => {
|
|
1799
1819
|
var w;
|
|
1800
|
-
|
|
1820
|
+
h(), p && ((w = r.onAction) == null || w.call(r));
|
|
1801
1821
|
};
|
|
1802
|
-
return /* @__PURE__ */ u("article", { className: A("cms-notification",
|
|
1822
|
+
return /* @__PURE__ */ u("article", { className: A("cms-notification", i && "is-unread", o && "is-expanded", p && "is-row-action"), "data-state": i ? "unread" : "read", children: [
|
|
1803
1823
|
/* @__PURE__ */ u(
|
|
1804
1824
|
"div",
|
|
1805
1825
|
{
|
|
1806
1826
|
className: "cms-notification__row",
|
|
1807
1827
|
role: "button",
|
|
1808
1828
|
tabIndex: 0,
|
|
1809
|
-
"aria-describedby": l === null ? void 0 :
|
|
1829
|
+
"aria-describedby": l === null ? void 0 : a,
|
|
1810
1830
|
onClick: N,
|
|
1811
1831
|
onKeyDown: (w) => {
|
|
1812
1832
|
w.target !== w.currentTarget || w.key !== "Enter" && w.key !== " " || (w.preventDefault(), N());
|
|
@@ -1816,17 +1836,17 @@ function il({ title: n, body: l = null, time: t = null, unread: o, unreadLabel:
|
|
|
1816
1836
|
/* @__PURE__ */ u("span", { className: "cms-notification__text", children: [
|
|
1817
1837
|
/* @__PURE__ */ u("span", { className: "cms-notification__head", children: [
|
|
1818
1838
|
/* @__PURE__ */ u("span", { className: "cms-notification__title", children: [
|
|
1819
|
-
|
|
1820
|
-
|
|
1839
|
+
i ? /* @__PURE__ */ u("span", { className: "cms-visually-hidden", children: [
|
|
1840
|
+
c,
|
|
1821
1841
|
" "
|
|
1822
1842
|
] }) : null,
|
|
1823
1843
|
n
|
|
1824
1844
|
] }),
|
|
1825
1845
|
t !== null ? /* @__PURE__ */ e("span", { className: "cms-notification__time", children: t }) : null
|
|
1826
1846
|
] }),
|
|
1827
|
-
l !== null && l !== "" ? /* @__PURE__ */ e("span", { className: "cms-notification__body", id:
|
|
1847
|
+
l !== null && l !== "" ? /* @__PURE__ */ e("span", { className: "cms-notification__body", id: a, children: l }) : null
|
|
1828
1848
|
] }),
|
|
1829
|
-
|
|
1849
|
+
i ? /* @__PURE__ */ e("span", { className: "cms-notification__dot", "aria-hidden": "true" }) : null
|
|
1830
1850
|
]
|
|
1831
1851
|
}
|
|
1832
1852
|
),
|
|
@@ -1835,26 +1855,26 @@ function il({ title: n, body: l = null, time: t = null, unread: o, unreadLabel:
|
|
|
1835
1855
|
{
|
|
1836
1856
|
type: "button",
|
|
1837
1857
|
className: "cms-notification__chevron",
|
|
1838
|
-
"aria-expanded":
|
|
1839
|
-
"aria-controls":
|
|
1840
|
-
"aria-label":
|
|
1841
|
-
title:
|
|
1858
|
+
"aria-expanded": o,
|
|
1859
|
+
"aria-controls": a,
|
|
1860
|
+
"aria-label": o ? d : s,
|
|
1861
|
+
title: o ? d : s,
|
|
1842
1862
|
onClick: () => {
|
|
1843
|
-
|
|
1863
|
+
o || h(), m((w) => !w);
|
|
1844
1864
|
},
|
|
1845
|
-
children: /* @__PURE__ */ e(
|
|
1865
|
+
children: /* @__PURE__ */ e(T, { name: "chevron-down", size: 18 })
|
|
1846
1866
|
}
|
|
1847
1867
|
) : null,
|
|
1848
|
-
|
|
1868
|
+
v !== null ? /* @__PURE__ */ e(
|
|
1849
1869
|
"button",
|
|
1850
1870
|
{
|
|
1851
1871
|
type: "button",
|
|
1852
1872
|
className: "cms-button cms-notification__action",
|
|
1853
1873
|
onClick: () => {
|
|
1854
1874
|
var w;
|
|
1855
|
-
|
|
1875
|
+
h(), (w = v.onAction) == null || w.call(v);
|
|
1856
1876
|
},
|
|
1857
|
-
children:
|
|
1877
|
+
children: v.label
|
|
1858
1878
|
}
|
|
1859
1879
|
) : null
|
|
1860
1880
|
] });
|
|
@@ -1877,8 +1897,8 @@ function ol(n, l) {
|
|
|
1877
1897
|
function Cn(n, l) {
|
|
1878
1898
|
if (!n) return;
|
|
1879
1899
|
if (typeof n.get == "function") return n.get(l) ?? void 0;
|
|
1880
|
-
const t = n,
|
|
1881
|
-
return
|
|
1900
|
+
const t = n, i = Object.keys(t).find((c) => c.toLowerCase() === l.toLowerCase());
|
|
1901
|
+
return i === void 0 ? void 0 : t[i];
|
|
1882
1902
|
}
|
|
1883
1903
|
function Sn(n) {
|
|
1884
1904
|
if (n && typeof n == "object") {
|
|
@@ -1887,137 +1907,137 @@ function Sn(n) {
|
|
|
1887
1907
|
if (typeof l.title == "string" && l.title !== "") return l.title;
|
|
1888
1908
|
}
|
|
1889
1909
|
}
|
|
1890
|
-
function dl(n, l, t,
|
|
1910
|
+
function dl(n, l, t, i) {
|
|
1891
1911
|
if (n !== 403) return { kind: "none" };
|
|
1892
|
-
const
|
|
1893
|
-
return Cn(l, "X-Elevation-Required") !== void 0 ?
|
|
1912
|
+
const c = Sn(t);
|
|
1913
|
+
return Cn(l, "X-Elevation-Required") !== void 0 ? i.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." };
|
|
1894
1914
|
}
|
|
1895
|
-
const
|
|
1915
|
+
const xe = "coolms-kit:reread";
|
|
1896
1916
|
function ul() {
|
|
1897
|
-
window.dispatchEvent(new Event(
|
|
1917
|
+
window.dispatchEvent(new Event(xe));
|
|
1898
1918
|
}
|
|
1899
1919
|
function ml(n) {
|
|
1900
|
-
const [l, t] = E(void 0), [
|
|
1901
|
-
|
|
1902
|
-
const
|
|
1903
|
-
const
|
|
1904
|
-
|
|
1905
|
-
(
|
|
1906
|
-
|
|
1920
|
+
const [l, t] = E(void 0), [i, c] = E(void 0), [s, d] = E(!0), r = F(n);
|
|
1921
|
+
r.current = n;
|
|
1922
|
+
const f = F(0), _ = be(() => {
|
|
1923
|
+
const o = ++f.current;
|
|
1924
|
+
d(!0), r.current().then(
|
|
1925
|
+
(m) => {
|
|
1926
|
+
o === f.current && (t(m), c(void 0), d(!1));
|
|
1907
1927
|
},
|
|
1908
|
-
(
|
|
1909
|
-
|
|
1928
|
+
(m) => {
|
|
1929
|
+
o === f.current && (c(m), d(!1));
|
|
1910
1930
|
}
|
|
1911
1931
|
);
|
|
1912
1932
|
}, []);
|
|
1913
1933
|
return Y(() => {
|
|
1914
1934
|
_();
|
|
1915
|
-
const
|
|
1916
|
-
return window.addEventListener("focus",
|
|
1917
|
-
window.removeEventListener("focus",
|
|
1935
|
+
const o = () => _();
|
|
1936
|
+
return window.addEventListener("focus", o), window.addEventListener(xe, o), () => {
|
|
1937
|
+
window.removeEventListener("focus", o), window.removeEventListener(xe, o);
|
|
1918
1938
|
};
|
|
1919
|
-
}, [_]), { value: l, error:
|
|
1939
|
+
}, [_]), { value: l, error: i, loading: s, reread: _ };
|
|
1920
1940
|
}
|
|
1921
1941
|
function hl(n) {
|
|
1922
1942
|
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 };
|
|
1923
1943
|
}
|
|
1924
1944
|
const En = "/errors/client-update-required";
|
|
1925
1945
|
function An(n, l) {
|
|
1926
|
-
const t = n.split(".").map((
|
|
1927
|
-
for (let
|
|
1928
|
-
const s = t[
|
|
1929
|
-
if (s !==
|
|
1946
|
+
const t = n.split(".").map((c) => Number.parseInt(c, 10) || 0), i = l.split(".").map((c) => Number.parseInt(c, 10) || 0);
|
|
1947
|
+
for (let c = 0; c < Math.max(t.length, i.length); c++) {
|
|
1948
|
+
const s = t[c] ?? 0, d = i[c] ?? 0;
|
|
1949
|
+
if (s !== d) return s < d;
|
|
1930
1950
|
}
|
|
1931
1951
|
return !1;
|
|
1932
1952
|
}
|
|
1933
1953
|
function fl(n) {
|
|
1934
1954
|
return n.problemType !== void 0 && n.problemType.endsWith(En) ? !0 : n.minimumVersion !== void 0 && An(n.version, n.minimumVersion);
|
|
1935
1955
|
}
|
|
1936
|
-
const Ie = 4,
|
|
1956
|
+
const Ie = 4, Ln = 48, Tn = 800, Dn = /* @__PURE__ */ new Set(["ArrowDown", "ArrowUp", "PageDown", "PageUp", "Home", "End", " "]);
|
|
1937
1957
|
function $n(n, l) {
|
|
1938
|
-
const [t,
|
|
1958
|
+
const [t, i] = E(!1);
|
|
1939
1959
|
return Y(() => {
|
|
1940
|
-
const
|
|
1941
|
-
if (
|
|
1942
|
-
|
|
1960
|
+
const c = n.current;
|
|
1961
|
+
if (c === null || !l) {
|
|
1962
|
+
i(!1);
|
|
1943
1963
|
return;
|
|
1944
1964
|
}
|
|
1945
1965
|
const s = /* @__PURE__ */ new WeakMap();
|
|
1946
|
-
let
|
|
1947
|
-
const
|
|
1948
|
-
|
|
1949
|
-
}, _ = (
|
|
1950
|
-
const
|
|
1951
|
-
!(
|
|
1952
|
-
},
|
|
1953
|
-
const
|
|
1954
|
-
if (!(
|
|
1955
|
-
const p =
|
|
1956
|
-
if (s.set(
|
|
1957
|
-
|
|
1966
|
+
let d = Number.NEGATIVE_INFINITY, r = null;
|
|
1967
|
+
const f = (a) => {
|
|
1968
|
+
d = performance.now(), r = a.target;
|
|
1969
|
+
}, _ = (a) => {
|
|
1970
|
+
const h = a.target;
|
|
1971
|
+
!(h instanceof HTMLElement && (h.isContentEditable || h.closest("input, textarea, select") !== null)) && Dn.has(a.key) && f(a);
|
|
1972
|
+
}, o = (a) => {
|
|
1973
|
+
const h = a.target;
|
|
1974
|
+
if (!(h instanceof HTMLElement)) return;
|
|
1975
|
+
const p = h.scrollTop, v = s.get(h) ?? 0;
|
|
1976
|
+
if (s.set(h, p), p <= 0) {
|
|
1977
|
+
i(!1);
|
|
1958
1978
|
return;
|
|
1959
1979
|
}
|
|
1960
|
-
performance.now() -
|
|
1961
|
-
},
|
|
1962
|
-
for (const [
|
|
1963
|
-
return
|
|
1964
|
-
for (const [
|
|
1965
|
-
|
|
1980
|
+
performance.now() - d > Tn || !(r === c || r === document.body || r instanceof Node && h.contains(r)) || (p < v - Ie ? i(!1) : p > v + Ie && p > Ln && i(!0));
|
|
1981
|
+
}, m = [["wheel", f], ["touchmove", f], ["pointerdown", f], ["keydown", _]];
|
|
1982
|
+
for (const [a, h] of m) c.addEventListener(a, h, { capture: !0, passive: !0 });
|
|
1983
|
+
return c.addEventListener("scroll", o, { capture: !0, passive: !0 }), () => {
|
|
1984
|
+
for (const [a, h] of m) c.removeEventListener(a, h, { capture: !0 });
|
|
1985
|
+
c.removeEventListener("scroll", o, { capture: !0 });
|
|
1966
1986
|
};
|
|
1967
|
-
}, [n, l]), [t,
|
|
1987
|
+
}, [n, l]), [t, i];
|
|
1968
1988
|
}
|
|
1969
|
-
function pl({ title: n, back: l, navigation: t, search:
|
|
1970
|
-
const
|
|
1971
|
-
p || (
|
|
1972
|
-
}), C =
|
|
1989
|
+
function pl({ title: n, back: l, navigation: t, search: i, searching: c, globals: s, filters: d, primary: r, onRefresh: f, pullText: _, barHidden: o, children: m }) {
|
|
1990
|
+
const a = F(null), h = F(null), [p, v] = E(!1), [N, w] = E(null), S = Nn(h, f === void 0 ? null : () => {
|
|
1991
|
+
p || (v(!0), f().finally(() => v(!1)));
|
|
1992
|
+
}), C = f === void 0 ? null : { distance: S, refreshing: p, text: _ ?? null }, R = c !== void 0 || S > 0 || p, [H, ee] = $n(a, o === void 0 && !R), j = !R && (o ?? H);
|
|
1973
1993
|
return /* @__PURE__ */ u(
|
|
1974
1994
|
"div",
|
|
1975
1995
|
{
|
|
1976
|
-
ref:
|
|
1977
|
-
className: A("cms-screen",
|
|
1996
|
+
ref: a,
|
|
1997
|
+
className: A("cms-screen", r !== void 0 && "cms-screen--with-primary"),
|
|
1978
1998
|
"data-bar-hidden": j ? "" : void 0,
|
|
1979
1999
|
onFocus: (y) => {
|
|
1980
2000
|
j && y.target instanceof Element && y.target.closest(".cms-screen__bar, .cms-screen__filters") !== null && ee(!1);
|
|
1981
2001
|
},
|
|
1982
2002
|
children: [
|
|
1983
|
-
|
|
1984
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label":
|
|
1985
|
-
/* @__PURE__ */ e("div", { className: "cms-screen__search", children:
|
|
2003
|
+
c !== void 0 ? /* @__PURE__ */ u("header", { className: "cms-screen__bar cms-screen__bar--searching", children: [
|
|
2004
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": c.closeLabel, title: c.closeLabel, onClick: c.onClose, children: /* @__PURE__ */ e(T, { name: "chevron-left" }) }),
|
|
2005
|
+
/* @__PURE__ */ e("div", { className: "cms-screen__search", children: c.field })
|
|
1986
2006
|
] }) : /* @__PURE__ */ u("header", { className: "cms-screen__bar", children: [
|
|
1987
2007
|
/* @__PURE__ */ e("div", { className: "cms-screen__leading", children: l !== void 0 ? l.href !== void 0 ? /* @__PURE__ */ u("a", { className: "cms-screen__back", href: l.href, onClick: l.onBack, children: [
|
|
1988
|
-
/* @__PURE__ */ e(
|
|
2008
|
+
/* @__PURE__ */ e(T, { name: "chevron-left" }),
|
|
1989
2009
|
/* @__PURE__ */ e("span", { className: "cms-screen__back-name", children: l.label })
|
|
1990
2010
|
] }) : /* @__PURE__ */ u("button", { type: "button", className: "cms-screen__back", onClick: l.onBack, children: [
|
|
1991
|
-
/* @__PURE__ */ e(
|
|
2011
|
+
/* @__PURE__ */ e(T, { name: "chevron-left" }),
|
|
1992
2012
|
/* @__PURE__ */ e("span", { className: "cms-screen__back-name", children: l.label })
|
|
1993
2013
|
] }) : t }),
|
|
1994
2014
|
/* @__PURE__ */ e("h1", { className: "cms-screen__title", title: n, children: n }),
|
|
1995
2015
|
/* @__PURE__ */ u("div", { className: "cms-screen__trailing", children: [
|
|
1996
|
-
|
|
2016
|
+
i !== void 0 ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-screen__icon", "aria-label": i.label, title: i.label, onClick: i.onOpen, children: /* @__PURE__ */ e(T, { name: "search" }) }) : null,
|
|
1997
2017
|
s
|
|
1998
2018
|
] })
|
|
1999
2019
|
] }),
|
|
2000
|
-
|
|
2001
|
-
/* @__PURE__ */ e("div", { ref:
|
|
2002
|
-
|
|
2020
|
+
d !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-screen__filters", children: /* @__PURE__ */ e(fn, { label: d.label, options: d.options, value: d.selected, onChange: d.onSelect }) }) : null,
|
|
2021
|
+
/* @__PURE__ */ e("div", { ref: h, className: "cms-screen__content", "data-pulling": S > 0 ? "" : void 0, "data-refreshing": p ? "" : void 0, children: /* @__PURE__ */ e(Fe.Provider, { value: C, children: m }) }),
|
|
2022
|
+
r !== void 0 ? /* @__PURE__ */ e(
|
|
2003
2023
|
"button",
|
|
2004
2024
|
{
|
|
2005
2025
|
type: "button",
|
|
2006
2026
|
className: "cms-button cms-button--primary cms-screen__primary",
|
|
2007
|
-
"aria-label":
|
|
2008
|
-
title:
|
|
2009
|
-
..."menu" in
|
|
2027
|
+
"aria-label": r.label,
|
|
2028
|
+
title: r.label,
|
|
2029
|
+
..."menu" in r ? { "aria-haspopup": "menu", "aria-expanded": N !== null } : {},
|
|
2010
2030
|
onClick: (y) => {
|
|
2011
|
-
if ("menu" in
|
|
2031
|
+
if ("menu" in r) {
|
|
2012
2032
|
const P = y.currentTarget.getBoundingClientRect();
|
|
2013
2033
|
w(N === null ? { x: P.left, y: P.top } : null);
|
|
2014
2034
|
} else
|
|
2015
|
-
|
|
2035
|
+
r.onPress();
|
|
2016
2036
|
},
|
|
2017
|
-
children: /* @__PURE__ */ e(
|
|
2037
|
+
children: /* @__PURE__ */ e(T, { name: r.icon, size: 24 })
|
|
2018
2038
|
}
|
|
2019
2039
|
) : null,
|
|
2020
|
-
|
|
2040
|
+
r !== void 0 && "menu" in r ? /* @__PURE__ */ e(Re, { at: N, items: r.menu, onClose: () => w(null), label: r.label }) : null
|
|
2021
2041
|
]
|
|
2022
2042
|
}
|
|
2023
2043
|
);
|
|
@@ -2035,15 +2055,15 @@ export {
|
|
|
2035
2055
|
Qn as ChatBubble,
|
|
2036
2056
|
el as Composer,
|
|
2037
2057
|
Kn as ConfirmDialog,
|
|
2038
|
-
|
|
2058
|
+
Re as ContextMenu,
|
|
2039
2059
|
Ye as EmptyState,
|
|
2040
2060
|
Ge as ErrorBanner,
|
|
2041
2061
|
Wn as FilePicker,
|
|
2042
2062
|
cn as FilePickerDenied,
|
|
2043
|
-
|
|
2063
|
+
Zn as FileViewer,
|
|
2044
2064
|
fn as FilterChips,
|
|
2045
|
-
|
|
2046
|
-
|
|
2065
|
+
Vn as ICON_NAMES,
|
|
2066
|
+
T as Icon,
|
|
2047
2067
|
nl as IncomingCall,
|
|
2048
2068
|
rl as List,
|
|
2049
2069
|
qe as Loading,
|
|
@@ -2053,20 +2073,20 @@ export {
|
|
|
2053
2073
|
Pe as Modal,
|
|
2054
2074
|
Je as NamedIcon,
|
|
2055
2075
|
il as Notification,
|
|
2056
|
-
|
|
2076
|
+
ke as PULL_AT,
|
|
2057
2077
|
jn as PageHeader,
|
|
2058
2078
|
cl as PaneToolbar,
|
|
2059
2079
|
vn as SIGN_IN_LABELS,
|
|
2060
|
-
|
|
2080
|
+
we as STATE_DELAY_MS,
|
|
2061
2081
|
pl as ScreenShell,
|
|
2062
2082
|
Gn as SearchField,
|
|
2063
|
-
|
|
2083
|
+
Hn as Select,
|
|
2064
2084
|
sl as SignInForm,
|
|
2065
2085
|
al as SignInLayout,
|
|
2066
2086
|
Xn as SplitPanes,
|
|
2067
2087
|
ne as State,
|
|
2068
2088
|
qn as TabStrip,
|
|
2069
|
-
|
|
2089
|
+
Rn as TextArea,
|
|
2070
2090
|
Fn as TextField,
|
|
2071
2091
|
Un as Toast,
|
|
2072
2092
|
zn as ToastRegion,
|
|
@@ -2086,5 +2106,5 @@ export {
|
|
|
2086
2106
|
yn as usePullState,
|
|
2087
2107
|
ml as useReread,
|
|
2088
2108
|
An as versionBelow,
|
|
2089
|
-
|
|
2109
|
+
Ze as writtenOut
|
|
2090
2110
|
};
|