@coolms/ui-react 0.1.0-alpha.5 → 0.1.0-alpha.7
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 +29 -0
- package/design-tokens.lock.json +5 -5
- package/dist/components/FileViewer.d.ts +63 -0
- package/dist/components/Icon.d.ts +1 -1
- package/dist/components/State.d.ts +31 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +715 -545
- package/kit.contract.json +1 -0
- package/package.json +3 -3
- package/src/kit.css +66 -0
- package/src/tokens/coolms-tokens.css +8 -0
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
function
|
|
1
|
+
import { jsx as e, jsxs as c, Fragment as v } from "react/jsx-runtime";
|
|
2
|
+
import { useId as I, useState as E, useRef as A, useEffect as K, useLayoutEffect as Q, useCallback as J } from "react";
|
|
3
|
+
import { createPortal as R } from "react-dom";
|
|
4
|
+
function Z(l, n) {
|
|
5
5
|
const a = { ...l };
|
|
6
|
-
for (const
|
|
7
|
-
const s = n == null ? void 0 : n[
|
|
8
|
-
s !== void 0 && (a[
|
|
6
|
+
for (const t of Object.keys(n ?? {})) {
|
|
7
|
+
const s = n == null ? void 0 : n[t];
|
|
8
|
+
s !== void 0 && (a[t] = s);
|
|
9
9
|
}
|
|
10
10
|
return a;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function g(...l) {
|
|
13
13
|
return l.filter(Boolean).join(" ");
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function M({ name: l }) {
|
|
16
16
|
const n = { width: 16, height: 16, viewBox: "0 0 16 16", "aria-hidden": !0, focusable: !1 };
|
|
17
17
|
switch (l) {
|
|
18
18
|
case "lock":
|
|
@@ -31,34 +31,34 @@ function k({ name: l }) {
|
|
|
31
31
|
return /* @__PURE__ */ e("svg", { ...n, className: "cms-glyph", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1Zm0 5.5a1 1 0 0 0-1 1V11a1 1 0 1 0 2 0V7.5a1 1 0 0 0-1-1ZM8 4a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z" }) });
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function F({
|
|
35
35
|
variant: l = "secondary",
|
|
36
36
|
busy: n = !1,
|
|
37
37
|
busyLabel: a,
|
|
38
|
-
locked:
|
|
38
|
+
locked: t = !1,
|
|
39
39
|
lockedReason: s,
|
|
40
|
-
icon:
|
|
41
|
-
disabled:
|
|
42
|
-
className:
|
|
43
|
-
children:
|
|
44
|
-
type:
|
|
45
|
-
title:
|
|
40
|
+
icon: h,
|
|
41
|
+
disabled: i,
|
|
42
|
+
className: m,
|
|
43
|
+
children: d,
|
|
44
|
+
type: r = "button",
|
|
45
|
+
title: o,
|
|
46
46
|
...f
|
|
47
47
|
}) {
|
|
48
|
-
const
|
|
49
|
-
return /* @__PURE__ */
|
|
48
|
+
const u = !!i || n;
|
|
49
|
+
return /* @__PURE__ */ c(
|
|
50
50
|
"button",
|
|
51
51
|
{
|
|
52
52
|
...f,
|
|
53
|
-
type:
|
|
54
|
-
className:
|
|
55
|
-
disabled:
|
|
53
|
+
type: r,
|
|
54
|
+
className: g("cms-button", `cms-button--${l}`, n && "is-busy", t && "is-locked", m),
|
|
55
|
+
disabled: u,
|
|
56
56
|
"aria-busy": n || void 0,
|
|
57
|
-
title:
|
|
57
|
+
title: t ? s ?? o : o,
|
|
58
58
|
children: [
|
|
59
|
-
n ? /* @__PURE__ */ e(
|
|
60
|
-
/* @__PURE__ */ e("span", { className: "cms-button__label", children: n && a !== void 0 ? a :
|
|
61
|
-
|
|
59
|
+
n ? /* @__PURE__ */ e(M, { name: "spinner" }) : t ? /* @__PURE__ */ e(M, { name: "lock" }) : h,
|
|
60
|
+
/* @__PURE__ */ e("span", { className: "cms-button__label", children: n && a !== void 0 ? a : d }),
|
|
61
|
+
t && s ? /* @__PURE__ */ c("span", { className: "cms-visually-hidden", children: [
|
|
62
62
|
", ",
|
|
63
63
|
s
|
|
64
64
|
] }) : null
|
|
@@ -66,352 +66,323 @@ function $({
|
|
|
66
66
|
}
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
return /* @__PURE__ */
|
|
69
|
+
function q({ id: l, label: n, help: a, error: t, pinned: s, children: h }) {
|
|
70
|
+
return /* @__PURE__ */ c("div", { className: g("cms-field", t != null && "is-invalid"), children: [
|
|
71
71
|
/* @__PURE__ */ e("label", { className: "cms-field__label", htmlFor: l, children: n }),
|
|
72
|
-
|
|
73
|
-
s != null ? /* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */ e(
|
|
72
|
+
h,
|
|
73
|
+
s != null ? /* @__PURE__ */ c("p", { className: "cms-field__pinned", id: `${l}-pinned`, children: [
|
|
74
|
+
/* @__PURE__ */ e(M, { name: "lock" }),
|
|
75
75
|
" ",
|
|
76
76
|
s
|
|
77
77
|
] }) : null,
|
|
78
|
-
|
|
78
|
+
t != null ? /* @__PURE__ */ e("p", { className: "cms-field__error", id: `${l}-error`, role: "alert", children: t }) : null,
|
|
79
79
|
a != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${l}-help`, children: a }) : null
|
|
80
80
|
] });
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function z(l, n) {
|
|
83
83
|
const a = [n.error != null && `${l}-error`, n.pinned != null && `${l}-pinned`, n.help != null && `${l}-help`].filter(Boolean).join(" ");
|
|
84
84
|
return a === "" ? void 0 : a;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
const f =
|
|
88
|
-
return /* @__PURE__ */ e(
|
|
86
|
+
function xe({ label: l, help: n, error: a, disabled: t, readOnly: s, pinned: h, value: i, onChange: m, placeholder: d, type: r = "text", name: o }) {
|
|
87
|
+
const f = I();
|
|
88
|
+
return /* @__PURE__ */ e(q, { id: f, label: l, help: n, error: a, pinned: h, children: /* @__PURE__ */ e(
|
|
89
89
|
"input",
|
|
90
90
|
{
|
|
91
91
|
id: f,
|
|
92
|
-
name:
|
|
93
|
-
type:
|
|
92
|
+
name: o,
|
|
93
|
+
type: r,
|
|
94
94
|
className: "cms-input",
|
|
95
|
-
value:
|
|
96
|
-
placeholder:
|
|
97
|
-
disabled:
|
|
98
|
-
readOnly: s ||
|
|
95
|
+
value: i,
|
|
96
|
+
placeholder: d,
|
|
97
|
+
disabled: t,
|
|
98
|
+
readOnly: s || h != null,
|
|
99
99
|
"aria-invalid": a != null || void 0,
|
|
100
|
-
"aria-describedby":
|
|
101
|
-
onChange: (
|
|
100
|
+
"aria-describedby": z(f, { help: n, error: a, pinned: h }),
|
|
101
|
+
onChange: (u) => m == null ? void 0 : m(u.target.value)
|
|
102
102
|
}
|
|
103
103
|
) });
|
|
104
104
|
}
|
|
105
|
-
function
|
|
106
|
-
const
|
|
107
|
-
return /* @__PURE__ */ e(
|
|
105
|
+
function Ce({ label: l, help: n, error: a, disabled: t, readOnly: s, value: h, options: i, onChange: m, emptyText: d = "Nothing to choose from yet.", name: r }) {
|
|
106
|
+
const o = I(), f = i.length === 0;
|
|
107
|
+
return /* @__PURE__ */ e(q, { id: o, label: l, help: f ? d : n, error: a, children: /* @__PURE__ */ e(
|
|
108
108
|
"select",
|
|
109
109
|
{
|
|
110
|
-
id:
|
|
111
|
-
name:
|
|
110
|
+
id: o,
|
|
111
|
+
name: r,
|
|
112
112
|
className: "cms-input cms-select",
|
|
113
|
-
value:
|
|
114
|
-
disabled:
|
|
113
|
+
value: h,
|
|
114
|
+
disabled: t || f,
|
|
115
115
|
"aria-readonly": s || void 0,
|
|
116
116
|
"aria-invalid": a != null || void 0,
|
|
117
|
-
"aria-describedby":
|
|
118
|
-
onChange: (
|
|
119
|
-
s ||
|
|
117
|
+
"aria-describedby": z(o, { help: f ? d : n, error: a }),
|
|
118
|
+
onChange: (u) => {
|
|
119
|
+
s || m == null || m(u.target.value);
|
|
120
120
|
},
|
|
121
|
-
children:
|
|
121
|
+
children: i.map((u) => /* @__PURE__ */ e("option", { value: u.value, disabled: s && u.value !== h, children: u.label }, u.value))
|
|
122
122
|
}
|
|
123
123
|
) });
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
const
|
|
127
|
-
return /* @__PURE__ */
|
|
125
|
+
function Ae({ label: l, checked: n, onChange: a, disabled: t, readOnly: s, help: h }) {
|
|
126
|
+
const i = I();
|
|
127
|
+
return /* @__PURE__ */ c("div", { className: "cms-toggle-row", children: [
|
|
128
128
|
/* @__PURE__ */ e(
|
|
129
129
|
"button",
|
|
130
130
|
{
|
|
131
|
-
id:
|
|
131
|
+
id: i,
|
|
132
132
|
type: "button",
|
|
133
133
|
role: "switch",
|
|
134
|
-
className:
|
|
134
|
+
className: g("cms-toggle", n && "is-on"),
|
|
135
135
|
"aria-checked": n,
|
|
136
136
|
"aria-readonly": s || void 0,
|
|
137
|
-
"aria-describedby":
|
|
138
|
-
disabled:
|
|
137
|
+
"aria-describedby": h != null ? `${i}-help` : void 0,
|
|
138
|
+
disabled: t,
|
|
139
139
|
onClick: () => {
|
|
140
140
|
s || a == null || a(!n);
|
|
141
141
|
},
|
|
142
142
|
children: /* @__PURE__ */ e("span", { className: "cms-toggle__thumb" })
|
|
143
143
|
}
|
|
144
144
|
),
|
|
145
|
-
/* @__PURE__ */ e("label", { className: "cms-toggle__label", htmlFor:
|
|
146
|
-
|
|
145
|
+
/* @__PURE__ */ e("label", { className: "cms-toggle__label", htmlFor: i, children: l }),
|
|
146
|
+
h != null ? /* @__PURE__ */ e("p", { className: "cms-field__help", id: `${i}-help`, children: h }) : null
|
|
147
147
|
] });
|
|
148
148
|
}
|
|
149
|
-
const
|
|
150
|
-
function
|
|
151
|
-
const [
|
|
152
|
-
if (
|
|
149
|
+
const ee = 150;
|
|
150
|
+
function le({ open: l, title: n, onClose: a, dirty: t = !1, onDirtyClose: s, children: h, footer: i, closeLabel: m = "Close" }) {
|
|
151
|
+
const [d, r] = E(l), [o, f] = E(!1), u = A(null), p = A(null), N = I();
|
|
152
|
+
if (K(() => {
|
|
153
153
|
if (l) {
|
|
154
|
-
p.current = document.activeElement,
|
|
154
|
+
p.current = document.activeElement, r(!0), f(!1);
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
|
-
if (!
|
|
157
|
+
if (!d) return;
|
|
158
158
|
f(!0);
|
|
159
|
-
const
|
|
160
|
-
var
|
|
161
|
-
|
|
162
|
-
},
|
|
163
|
-
return () => window.clearTimeout(
|
|
164
|
-
}, [l,
|
|
165
|
-
var
|
|
166
|
-
if (l &&
|
|
159
|
+
const b = window.setTimeout(() => {
|
|
160
|
+
var C, w;
|
|
161
|
+
r(!1), f(!1), (w = (C = p.current) == null ? void 0 : C.focus) == null || w.call(C);
|
|
162
|
+
}, ee);
|
|
163
|
+
return () => window.clearTimeout(b);
|
|
164
|
+
}, [l, d]), K(() => {
|
|
165
|
+
var b, C;
|
|
166
|
+
if (l && d) {
|
|
167
167
|
const w = 'input, select, textarea, button, [href], [tabindex]:not([tabindex="-1"])';
|
|
168
|
-
(
|
|
168
|
+
(C = ((b = u.current) == null ? void 0 : b.querySelector(`.cms-modal__body :is(${w}), .cms-modal__foot :is(${w})`)) ?? u.current) == null || C.focus();
|
|
169
169
|
}
|
|
170
|
-
}, [l,
|
|
171
|
-
const
|
|
172
|
-
|
|
170
|
+
}, [l, d]), !d) return null;
|
|
171
|
+
const y = () => {
|
|
172
|
+
t ? s == null || s() : a();
|
|
173
173
|
};
|
|
174
|
-
return
|
|
175
|
-
/* @__PURE__ */ e("div", { className:
|
|
176
|
-
|
|
177
|
-
}, children: /* @__PURE__ */
|
|
174
|
+
return R(
|
|
175
|
+
/* @__PURE__ */ e("div", { className: g("cms-modal-scrim", o && "is-closing"), onMouseDown: (b) => {
|
|
176
|
+
b.target === b.currentTarget && y();
|
|
177
|
+
}, children: /* @__PURE__ */ c(
|
|
178
178
|
"div",
|
|
179
179
|
{
|
|
180
|
-
ref:
|
|
181
|
-
className:
|
|
180
|
+
ref: u,
|
|
181
|
+
className: g("cms-modal", o && "is-closing", t && "is-dirty"),
|
|
182
182
|
role: "dialog",
|
|
183
183
|
"aria-modal": "true",
|
|
184
|
-
"aria-labelledby":
|
|
184
|
+
"aria-labelledby": N,
|
|
185
185
|
tabIndex: -1,
|
|
186
|
-
onKeyDown: (
|
|
187
|
-
var
|
|
188
|
-
if (
|
|
189
|
-
|
|
190
|
-
else if (
|
|
191
|
-
const w = (
|
|
186
|
+
onKeyDown: (b) => {
|
|
187
|
+
var C;
|
|
188
|
+
if (b.key === "Escape")
|
|
189
|
+
b.stopPropagation(), y();
|
|
190
|
+
else if (b.key === "Tab") {
|
|
191
|
+
const w = (C = u.current) == null ? void 0 : C.querySelectorAll('input, select, textarea, button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])');
|
|
192
192
|
if (!w || w.length === 0) return;
|
|
193
|
-
const
|
|
194
|
-
|
|
193
|
+
const D = w[0], B = w[w.length - 1];
|
|
194
|
+
b.shiftKey && document.activeElement === D ? (b.preventDefault(), B.focus()) : !b.shiftKey && document.activeElement === B && (b.preventDefault(), D.focus());
|
|
195
195
|
}
|
|
196
196
|
},
|
|
197
197
|
children: [
|
|
198
|
-
/* @__PURE__ */
|
|
199
|
-
/* @__PURE__ */ e("h2", { className: "cms-modal__title", id:
|
|
200
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label":
|
|
198
|
+
/* @__PURE__ */ c("header", { className: "cms-modal__head", children: [
|
|
199
|
+
/* @__PURE__ */ e("h2", { className: "cms-modal__title", id: N, children: n }),
|
|
200
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": m, onClick: y, children: /* @__PURE__ */ e(M, { name: "close" }) })
|
|
201
201
|
] }),
|
|
202
|
-
/* @__PURE__ */ e("div", { className: "cms-modal__body", children:
|
|
203
|
-
|
|
202
|
+
/* @__PURE__ */ e("div", { className: "cms-modal__body", children: h }),
|
|
203
|
+
i != null ? /* @__PURE__ */ e("footer", { className: "cms-modal__foot", children: i }) : null
|
|
204
204
|
]
|
|
205
205
|
}
|
|
206
206
|
) }),
|
|
207
207
|
document.body
|
|
208
208
|
);
|
|
209
209
|
}
|
|
210
|
-
function
|
|
211
|
-
const
|
|
210
|
+
function Ee({ open: l, title: n, message: a, kind: t = "default", confirmLabel: s, cancelLabel: h, closeLabel: i, onConfirm: m, onCancel: d }) {
|
|
211
|
+
const r = t === "discard-changes";
|
|
212
212
|
return /* @__PURE__ */ e(
|
|
213
|
-
|
|
213
|
+
le,
|
|
214
214
|
{
|
|
215
215
|
open: l,
|
|
216
216
|
title: n,
|
|
217
|
-
onClose:
|
|
218
|
-
...
|
|
219
|
-
footer: /* @__PURE__ */
|
|
220
|
-
/* @__PURE__ */ e(
|
|
221
|
-
/* @__PURE__ */ e(
|
|
217
|
+
onClose: d,
|
|
218
|
+
...i === void 0 ? {} : { closeLabel: i },
|
|
219
|
+
footer: /* @__PURE__ */ c(v, { children: [
|
|
220
|
+
/* @__PURE__ */ e(F, { onClick: d, children: h ?? (r ? "Keep editing" : "Cancel") }),
|
|
221
|
+
/* @__PURE__ */ e(F, { variant: t === "default" ? "primary" : "danger", onClick: m, children: s ?? (r ? "Discard changes" : "Confirm") })
|
|
222
222
|
] }),
|
|
223
|
-
children:
|
|
224
|
-
/* @__PURE__ */ e(
|
|
223
|
+
children: t !== "default" ? /* @__PURE__ */ c("p", { className: "cms-confirm__warning", children: [
|
|
224
|
+
/* @__PURE__ */ e(M, { name: "warning" }),
|
|
225
225
|
" ",
|
|
226
226
|
a
|
|
227
227
|
] }) : /* @__PURE__ */ e("p", { children: a })
|
|
228
228
|
}
|
|
229
229
|
);
|
|
230
230
|
}
|
|
231
|
-
function
|
|
232
|
-
return /* @__PURE__ */
|
|
233
|
-
/* @__PURE__ */ e(
|
|
231
|
+
function Le({ kind: l, message: n, action: a, onDismiss: t, dismissLabel: s = "Dismiss" }) {
|
|
232
|
+
return /* @__PURE__ */ c("div", { className: g("cms-toast", `cms-toast--${l}`), role: l === "error" ? "alert" : "status", children: [
|
|
233
|
+
/* @__PURE__ */ e(M, { name: l === "success" ? "check" : l === "error" ? "warning" : "info" }),
|
|
234
234
|
/* @__PURE__ */ e("span", { className: "cms-toast__message", children: n }),
|
|
235
|
-
a ? /* @__PURE__ */ e(
|
|
236
|
-
|
|
235
|
+
a ? /* @__PURE__ */ e(F, { className: "cms-toast__action", onClick: a.onAction, children: a.label }) : null,
|
|
236
|
+
t ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button", "aria-label": s, onClick: t, children: /* @__PURE__ */ e(M, { name: "close" }) }) : null
|
|
237
237
|
] });
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function Se({ children: l }) {
|
|
240
240
|
return /* @__PURE__ */ e("div", { className: "cms-toast-region", children: l });
|
|
241
241
|
}
|
|
242
|
-
function
|
|
243
|
-
return /* @__PURE__ */
|
|
244
|
-
/* @__PURE__ */ e(
|
|
242
|
+
function ne({ what: l, layout: n = "inline" }) {
|
|
243
|
+
return /* @__PURE__ */ c("div", { className: g("cms-loading", `cms-loading--${n}`), role: "status", "aria-live": "polite", children: [
|
|
244
|
+
/* @__PURE__ */ e(M, { name: "spinner" }),
|
|
245
245
|
/* @__PURE__ */ e("span", { children: l })
|
|
246
246
|
] });
|
|
247
247
|
}
|
|
248
|
-
function
|
|
249
|
-
return /* @__PURE__ */
|
|
248
|
+
function ae({ title: l, hint: n, action: a }) {
|
|
249
|
+
return /* @__PURE__ */ c("div", { className: "cms-empty", children: [
|
|
250
250
|
/* @__PURE__ */ e("p", { className: "cms-empty__title", children: l }),
|
|
251
251
|
n != null ? /* @__PURE__ */ e("p", { className: "cms-empty__hint", children: n }) : null,
|
|
252
252
|
a != null ? /* @__PURE__ */ e("div", { className: "cms-empty__action", children: a }) : null
|
|
253
253
|
] });
|
|
254
254
|
}
|
|
255
|
-
function
|
|
256
|
-
return /* @__PURE__ */
|
|
257
|
-
/* @__PURE__ */ e(
|
|
255
|
+
function se({ message: l, onRetry: n, retryLabel: a = "Try again" }) {
|
|
256
|
+
return /* @__PURE__ */ c("div", { className: "cms-error-banner", role: "alert", children: [
|
|
257
|
+
/* @__PURE__ */ e(M, { name: "warning" }),
|
|
258
258
|
/* @__PURE__ */ e("span", { className: "cms-error-banner__message", children: l }),
|
|
259
|
-
n ? /* @__PURE__ */ e(
|
|
260
|
-
] });
|
|
261
|
-
}
|
|
262
|
-
function he({ title: l, scope: n, actions: a, backLink: c }) {
|
|
263
|
-
return /* @__PURE__ */ i("header", { className: "cms-page-header", children: [
|
|
264
|
-
c ? /* @__PURE__ */ i(
|
|
265
|
-
"a",
|
|
266
|
-
{
|
|
267
|
-
className: "cms-page-header__back",
|
|
268
|
-
href: c.href ?? "#",
|
|
269
|
-
onClick: (s) => {
|
|
270
|
-
c.onBack && (s.preventDefault(), c.onBack());
|
|
271
|
-
},
|
|
272
|
-
children: [
|
|
273
|
-
/* @__PURE__ */ e(k, { name: "back" }),
|
|
274
|
-
" ",
|
|
275
|
-
c.label
|
|
276
|
-
]
|
|
277
|
-
}
|
|
278
|
-
) : null,
|
|
279
|
-
/* @__PURE__ */ i("div", { className: "cms-page-header__row", children: [
|
|
280
|
-
/* @__PURE__ */ i("div", { className: "cms-page-header__titles", children: [
|
|
281
|
-
/* @__PURE__ */ e("h1", { className: "cms-page-header__title", children: l }),
|
|
282
|
-
n != null ? /* @__PURE__ */ e("p", { className: "cms-page-header__scope", children: n }) : null
|
|
283
|
-
] }),
|
|
284
|
-
a != null ? /* @__PURE__ */ e("div", { className: "cms-page-header__actions", children: a }) : null
|
|
285
|
-
] })
|
|
259
|
+
n ? /* @__PURE__ */ e(F, { onClick: n, children: a }) : null
|
|
286
260
|
] });
|
|
287
261
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
r.preventDefault();
|
|
294
|
-
const t = l[h];
|
|
295
|
-
t && (a(t.id), (f = s.current[h]) == null || f.focus());
|
|
296
|
-
};
|
|
297
|
-
return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": c, children: l.map((r, d) => {
|
|
298
|
-
const u = r.id === n;
|
|
299
|
-
return /* @__PURE__ */ i(
|
|
300
|
-
"button",
|
|
301
|
-
{
|
|
302
|
-
ref: (h) => {
|
|
303
|
-
s.current[d] = h;
|
|
304
|
-
},
|
|
305
|
-
type: "button",
|
|
306
|
-
role: "tab",
|
|
307
|
-
className: v("cms-tab", u && "is-active"),
|
|
308
|
-
"aria-selected": u,
|
|
309
|
-
tabIndex: u ? 0 : -1,
|
|
310
|
-
onClick: () => a(r.id),
|
|
311
|
-
onKeyDown: (h) => m(h, d),
|
|
312
|
-
children: [
|
|
313
|
-
r.label,
|
|
314
|
-
r.count !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-tab__count", children: r.count }) : null
|
|
315
|
-
]
|
|
316
|
-
},
|
|
317
|
-
r.id
|
|
318
|
-
);
|
|
319
|
-
}) });
|
|
320
|
-
}
|
|
321
|
-
function G(l) {
|
|
322
|
-
var c;
|
|
323
|
-
const n = l.trim().split(/\s+/).filter(Boolean);
|
|
324
|
-
return (n.length > 1 ? [n[0][0], n[n.length - 1][0]] : [(c = n[0]) == null ? void 0 : c[0]]).filter(Boolean).join("").toUpperCase();
|
|
262
|
+
const j = 300;
|
|
263
|
+
function te() {
|
|
264
|
+
if (typeof window > "u" || typeof getComputedStyle != "function") return j;
|
|
265
|
+
const l = getComputedStyle(document.documentElement).getPropertyValue("--cms-state-delay").trim(), n = l.endsWith("ms") ? Number.parseFloat(l) : l.endsWith("s") ? Number.parseFloat(l) * 1e3 : Number.NaN;
|
|
266
|
+
return Number.isFinite(n) && n >= 0 ? n : j;
|
|
325
267
|
}
|
|
326
|
-
function
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
268
|
+
function ce() {
|
|
269
|
+
return /* @__PURE__ */ c("svg", { className: "cms-state__spinner", viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
|
|
270
|
+
/* @__PURE__ */ e("circle", { className: "cms-state__track", cx: "12", cy: "12", r: "10", fill: "none" }),
|
|
271
|
+
/* @__PURE__ */ e("circle", { className: "cms-state__arc", cx: "12", cy: "12", r: "10", fill: "none", pathLength: "100", strokeDasharray: "28 72" })
|
|
272
|
+
] });
|
|
331
273
|
}
|
|
332
|
-
function
|
|
333
|
-
|
|
334
|
-
|
|
274
|
+
function De({ kind: l, title: n, description: a, action: t, placement: s = "block" }) {
|
|
275
|
+
const [h, i] = E(l !== "loading");
|
|
276
|
+
return K(() => {
|
|
277
|
+
if (l !== "loading") {
|
|
278
|
+
i(!0);
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
i(!1);
|
|
282
|
+
const m = window.setTimeout(() => i(!0), te());
|
|
283
|
+
return () => window.clearTimeout(m);
|
|
284
|
+
}, [l]), /* @__PURE__ */ c(
|
|
285
|
+
"div",
|
|
335
286
|
{
|
|
336
|
-
className:
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
"
|
|
287
|
+
className: g("cms-state", `cms-state--${l}`, `cms-state--${s}`, !h && "is-waiting"),
|
|
288
|
+
role: "status",
|
|
289
|
+
"aria-live": "polite",
|
|
290
|
+
"data-kind": l,
|
|
340
291
|
children: [
|
|
341
|
-
|
|
342
|
-
|
|
292
|
+
l === "loading" ? /* @__PURE__ */ e(ce, {}) : null,
|
|
293
|
+
l === "error" || l === "denied" ? /* @__PURE__ */ e(M, { name: l === "error" ? "warning" : "lock" }) : null,
|
|
294
|
+
/* @__PURE__ */ c("span", { className: "cms-state__text", children: [
|
|
295
|
+
/* @__PURE__ */ e("span", { className: "cms-state__title", children: n }),
|
|
296
|
+
a !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-state__description", children: a }) : null
|
|
297
|
+
] }),
|
|
298
|
+
t !== void 0 && l !== "denied" ? /* @__PURE__ */ e(F, { className: "cms-state__action", onClick: t.onAction, children: t.label }) : null
|
|
343
299
|
]
|
|
344
300
|
}
|
|
345
301
|
);
|
|
346
302
|
}
|
|
347
|
-
const
|
|
348
|
-
mail: /* @__PURE__ */
|
|
303
|
+
const X = {
|
|
304
|
+
mail: /* @__PURE__ */ c(v, { children: [
|
|
349
305
|
/* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
350
306
|
/* @__PURE__ */ e("path", { d: "m3 7 9 6 9-6" })
|
|
351
307
|
] }),
|
|
352
308
|
chat: /* @__PURE__ */ e("path", { d: "M4 12a8 8 0 1 1 4 6.9L4 20l1.1-4A8 8 0 0 1 4 12Z" }),
|
|
353
309
|
phone: /* @__PURE__ */ e("path", { d: "M5 3h3l2 5-2.5 1.5a11 11 0 0 0 7 7L16 14l5 2v3a2 2 0 0 1-2 2A16 16 0 0 1 3 5a2 2 0 0 1 2-2Z" }),
|
|
354
|
-
calendar: /* @__PURE__ */
|
|
310
|
+
calendar: /* @__PURE__ */ c(v, { children: [
|
|
355
311
|
/* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "16", rx: "2" }),
|
|
356
312
|
/* @__PURE__ */ e("path", { d: "M3 10h18M8 3v4M16 3v4" })
|
|
357
313
|
] }),
|
|
358
|
-
file: /* @__PURE__ */
|
|
314
|
+
file: /* @__PURE__ */ c(v, { children: [
|
|
359
315
|
/* @__PURE__ */ e("path", { d: "M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z" }),
|
|
360
316
|
/* @__PURE__ */ e("path", { d: "M14 3v6h6M8 13h8M8 17h6" })
|
|
361
317
|
] }),
|
|
362
|
-
image: /* @__PURE__ */
|
|
318
|
+
image: /* @__PURE__ */ c(v, { children: [
|
|
363
319
|
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
|
|
364
320
|
/* @__PURE__ */ e("circle", { cx: "9", cy: "10", r: "2" }),
|
|
365
321
|
/* @__PURE__ */ e("path", { d: "m21 17-5-5-9 8" })
|
|
366
322
|
] }),
|
|
367
|
-
search: /* @__PURE__ */
|
|
323
|
+
search: /* @__PURE__ */ c(v, { children: [
|
|
368
324
|
/* @__PURE__ */ e("circle", { cx: "11", cy: "11", r: "7" }),
|
|
369
325
|
/* @__PURE__ */ e("path", { d: "m20 20-4-4" })
|
|
370
326
|
] }),
|
|
371
|
-
bell: /* @__PURE__ */
|
|
327
|
+
bell: /* @__PURE__ */ c(v, { children: [
|
|
372
328
|
/* @__PURE__ */ e("path", { d: "M6 9a6 6 0 1 1 12 0c0 6 2 8 2 8H4s2-2 2-8Z" }),
|
|
373
329
|
/* @__PURE__ */ e("path", { d: "M10 20a2 2 0 0 0 4 0" })
|
|
374
330
|
] }),
|
|
375
|
-
pencil: /* @__PURE__ */
|
|
331
|
+
pencil: /* @__PURE__ */ c(v, { children: [
|
|
376
332
|
/* @__PURE__ */ e("path", { d: "M4 20h4L19 9l-4-4L4 16Z" }),
|
|
377
333
|
/* @__PURE__ */ e("path", { d: "m13 7 4 4" })
|
|
378
334
|
] }),
|
|
335
|
+
download: /* @__PURE__ */ c(v, { children: [
|
|
336
|
+
/* @__PURE__ */ e("path", { d: "M12 4v11" }),
|
|
337
|
+
/* @__PURE__ */ e("path", { d: "m7 11 5 5 5-5" }),
|
|
338
|
+
/* @__PURE__ */ e("path", { d: "M4 20h16" })
|
|
339
|
+
] }),
|
|
340
|
+
print: /* @__PURE__ */ c(v, { children: [
|
|
341
|
+
/* @__PURE__ */ e("path", { d: "M7 8V4h10v4" }),
|
|
342
|
+
/* @__PURE__ */ e("rect", { x: "3", y: "8", width: "18", height: "8", rx: "2" }),
|
|
343
|
+
/* @__PURE__ */ e("path", { d: "M7 14h10v6H7Z" })
|
|
344
|
+
] }),
|
|
345
|
+
"open-separately": /* @__PURE__ */ c(v, { children: [
|
|
346
|
+
/* @__PURE__ */ e("path", { d: "M14 4h6v6" }),
|
|
347
|
+
/* @__PURE__ */ e("path", { d: "m20 4-9 9" }),
|
|
348
|
+
/* @__PURE__ */ e("path", { d: "M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5" })
|
|
349
|
+
] }),
|
|
379
350
|
star: /* @__PURE__ */ e("path", { d: "m12 3 2.8 5.8 6.2.9-4.5 4.4 1 6.2L12 17.4l-5.5 2.9 1-6.2L3 9.7l6.2-.9Z" }),
|
|
380
|
-
send: /* @__PURE__ */
|
|
351
|
+
send: /* @__PURE__ */ c(v, { children: [
|
|
381
352
|
/* @__PURE__ */ e("path", { d: "M21 3 10 14" }),
|
|
382
353
|
/* @__PURE__ */ e("path", { d: "M21 3 14 21l-4-7-7-4Z" })
|
|
383
354
|
] }),
|
|
384
|
-
inbox: /* @__PURE__ */
|
|
355
|
+
inbox: /* @__PURE__ */ c(v, { children: [
|
|
385
356
|
/* @__PURE__ */ e("path", { d: "M3 13h5l1 3h6l1-3h5" }),
|
|
386
357
|
/* @__PURE__ */ e("path", { d: "M5 5h14l2 8v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6Z" })
|
|
387
358
|
] }),
|
|
388
|
-
archive: /* @__PURE__ */
|
|
359
|
+
archive: /* @__PURE__ */ c(v, { children: [
|
|
389
360
|
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "5", rx: "1" }),
|
|
390
361
|
/* @__PURE__ */ e("path", { d: "M5 9v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9M10 13h4" })
|
|
391
362
|
] }),
|
|
392
|
-
trash: /* @__PURE__ */
|
|
363
|
+
trash: /* @__PURE__ */ c(v, { children: [
|
|
393
364
|
/* @__PURE__ */ e("path", { d: "M4 7h16M10 11v6M14 11v6" }),
|
|
394
365
|
/* @__PURE__ */ e("path", { d: "M6 7l1 13a2 2 0 0 0 2 1h6a2 2 0 0 0 2-1l1-13M9 7V4h6v3" })
|
|
395
366
|
] }),
|
|
396
367
|
paperclip: /* @__PURE__ */ e("path", { d: "m20 11-8.5 8.5a5 5 0 0 1-7-7L13 4a3.5 3.5 0 0 1 5 5l-8.5 8.5a2 2 0 0 1-3-3L14 7" }),
|
|
397
|
-
mic: /* @__PURE__ */
|
|
368
|
+
mic: /* @__PURE__ */ c(v, { children: [
|
|
398
369
|
/* @__PURE__ */ e("rect", { x: "9", y: "3", width: "6", height: "11", rx: "3" }),
|
|
399
370
|
/* @__PURE__ */ e("path", { d: "M5 11a7 7 0 0 0 14 0M12 18v3" })
|
|
400
371
|
] }),
|
|
401
|
-
speaker: /* @__PURE__ */
|
|
372
|
+
speaker: /* @__PURE__ */ c(v, { children: [
|
|
402
373
|
/* @__PURE__ */ e("path", { d: "M4 9h4l5-4v14l-5-4H4Z" }),
|
|
403
374
|
/* @__PURE__ */ e("path", { d: "M16 9a4 4 0 0 1 0 6M19 6a8 8 0 0 1 0 12" })
|
|
404
375
|
] }),
|
|
405
|
-
"user-plus": /* @__PURE__ */
|
|
376
|
+
"user-plus": /* @__PURE__ */ c(v, { children: [
|
|
406
377
|
/* @__PURE__ */ e("circle", { cx: "10", cy: "8", r: "4" }),
|
|
407
378
|
/* @__PURE__ */ e("path", { d: "M3 21a7 7 0 0 1 14 0M19 8v6M16 11h6" })
|
|
408
379
|
] }),
|
|
409
380
|
"phone-off": /* @__PURE__ */ e("path", { d: "M3 14c5-5 13-5 18 0l-2 3-4-1v-3a10 10 0 0 0-6 0v3l-4 1Z" }),
|
|
410
|
-
video: /* @__PURE__ */
|
|
381
|
+
video: /* @__PURE__ */ c(v, { children: [
|
|
411
382
|
/* @__PURE__ */ e("rect", { x: "3", y: "6", width: "13", height: "12", rx: "2" }),
|
|
412
383
|
/* @__PURE__ */ e("path", { d: "m16 10 5-3v10l-5-3" })
|
|
413
384
|
] }),
|
|
414
|
-
info: /* @__PURE__ */
|
|
385
|
+
info: /* @__PURE__ */ c(v, { children: [
|
|
415
386
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "9" }),
|
|
416
387
|
/* @__PURE__ */ e("path", { d: "M12 11v6M12 7.5v.5" })
|
|
417
388
|
] }),
|
|
@@ -420,15 +391,16 @@ const H = {
|
|
|
420
391
|
plus: /* @__PURE__ */ e("path", { d: "M12 5v14M5 12h14" }),
|
|
421
392
|
folder: /* @__PURE__ */ e("path", { d: "M3 6a2 2 0 0 1 2-2h4l2 3h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z" }),
|
|
422
393
|
check: /* @__PURE__ */ e("path", { d: "m5 12 5 5 9-10" }),
|
|
423
|
-
server: /* @__PURE__ */
|
|
394
|
+
server: /* @__PURE__ */ c(v, { children: [
|
|
424
395
|
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "7", rx: "2" }),
|
|
425
396
|
/* @__PURE__ */ e("rect", { x: "3", y: "13", width: "18", height: "7", rx: "2" }),
|
|
426
397
|
/* @__PURE__ */ e("path", { d: "M7 7.5h.5M7 16.5h.5" })
|
|
427
398
|
] }),
|
|
428
399
|
reply: /* @__PURE__ */ e("path", { d: "M10 8 4 13l6 5M4 13h11a5 5 0 0 1 5 5" }),
|
|
429
|
-
more: /* @__PURE__ */ e("path", { d: "M5 12h.5M12 12h.5M19 12h.5" })
|
|
400
|
+
more: /* @__PURE__ */ e("path", { d: "M5 12h.5M12 12h.5M19 12h.5" }),
|
|
401
|
+
important: /* @__PURE__ */ e("path", { d: "M4 6h11l5 6-5 6H4l4-6-4-6Z" })
|
|
430
402
|
};
|
|
431
|
-
function
|
|
403
|
+
function x({ name: l, size: n = 20, label: a }) {
|
|
432
404
|
return /* @__PURE__ */ e(
|
|
433
405
|
"svg",
|
|
434
406
|
{
|
|
@@ -443,64 +415,259 @@ function y({ name: l, size: n = 20, label: a }) {
|
|
|
443
415
|
strokeLinejoin: "round",
|
|
444
416
|
focusable: !1,
|
|
445
417
|
...a ? { role: "img", "aria-label": a } : { "aria-hidden": !0 },
|
|
446
|
-
children:
|
|
418
|
+
children: X[l]
|
|
447
419
|
}
|
|
448
420
|
);
|
|
449
421
|
}
|
|
450
|
-
const
|
|
451
|
-
function
|
|
452
|
-
return l
|
|
422
|
+
const $e = Object.keys(X), re = 'input, select, textarea, button:not([disabled]), iframe, [href], [tabindex]:not([tabindex="-1"])', ie = 60;
|
|
423
|
+
function oe(l) {
|
|
424
|
+
return l instanceof Element && l.closest('input, select, textarea, [contenteditable="true"], [data-viewer-keys]') !== null;
|
|
425
|
+
}
|
|
426
|
+
function de(l) {
|
|
427
|
+
return l instanceof Element && l.closest("[data-viewer-gestures]") !== null;
|
|
428
|
+
}
|
|
429
|
+
function me(l) {
|
|
430
|
+
return l.getClientRects().length > 0;
|
|
431
|
+
}
|
|
432
|
+
function Te(l) {
|
|
433
|
+
const { name: n, badge: a, closeLabel: t, onClose: s, actions: h = [], moreLabel: i = "More", edit: m, editing: d, siblings: r, bar: o, thumbnails: f, strip: u, onZoom: p, children: N } = l, y = A(null), b = A(null), C = I(), [w, D] = E(!1), B = A(null);
|
|
434
|
+
K(() => {
|
|
435
|
+
var L;
|
|
436
|
+
const _ = document.activeElement, k = document.body.style.overflow;
|
|
437
|
+
return document.body.style.overflow = "hidden", (L = b.current) == null || L.focus(), () => {
|
|
438
|
+
var S;
|
|
439
|
+
document.body.style.overflow = k, (S = _ == null ? void 0 : _.focus) == null || S.call(_);
|
|
440
|
+
};
|
|
441
|
+
}, []);
|
|
442
|
+
const Y = () => {
|
|
443
|
+
d != null && d.dirty ? d.onDirtyClose() : s();
|
|
444
|
+
}, G = (_) => {
|
|
445
|
+
const k = _.touches.length === 1 ? _.touches[0] : void 0;
|
|
446
|
+
B.current = k === void 0 || d !== void 0 || de(_.target) ? null : { x: k.clientX, y: k.clientY };
|
|
447
|
+
}, O = (_) => {
|
|
448
|
+
var $, P;
|
|
449
|
+
const k = B.current, L = _.changedTouches[0];
|
|
450
|
+
if (B.current = null, k === null || L === void 0) return;
|
|
451
|
+
const S = L.clientX - k.x;
|
|
452
|
+
Math.abs(S) < ie || Math.abs(S) < Math.abs(L.clientY - k.y) || (S > 0 ? ($ = r == null ? void 0 : r.onPrevious) == null || $.call(r) : (P = r == null ? void 0 : r.onNext) == null || P.call(r));
|
|
453
|
+
};
|
|
454
|
+
return R(
|
|
455
|
+
/* @__PURE__ */ c(
|
|
456
|
+
"div",
|
|
457
|
+
{
|
|
458
|
+
ref: y,
|
|
459
|
+
className: g("cms-viewer", d !== void 0 && "is-editing"),
|
|
460
|
+
role: "dialog",
|
|
461
|
+
"aria-modal": "true",
|
|
462
|
+
"aria-labelledby": C,
|
|
463
|
+
tabIndex: -1,
|
|
464
|
+
onKeyDown: (_) => {
|
|
465
|
+
var k, L, S;
|
|
466
|
+
if (_.key === "Escape") {
|
|
467
|
+
if (d !== void 0) return;
|
|
468
|
+
_.stopPropagation(), w ? D(!1) : s();
|
|
469
|
+
} else if (_.key === "Tab") {
|
|
470
|
+
const $ = Array.from(((k = y.current) == null ? void 0 : k.querySelectorAll(re)) ?? []).filter(me);
|
|
471
|
+
if ($.length === 0) return;
|
|
472
|
+
const P = $[0], U = $[$.length - 1];
|
|
473
|
+
_.shiftKey && document.activeElement === P ? (_.preventDefault(), U.focus()) : !_.shiftKey && document.activeElement === U && (_.preventDefault(), P.focus());
|
|
474
|
+
} else d === void 0 && !oe(_.target) && !_.ctrlKey && !_.metaKey && !_.altKey && (_.key === "ArrowLeft" ? (L = r == null ? void 0 : r.onPrevious) == null || L.call(r) : _.key === "ArrowRight" ? (S = r == null ? void 0 : r.onNext) == null || S.call(r) : _.key === "+" || _.key === "=" ? p == null || p("in") : _.key === "-" ? p == null || p("out") : _.key === "0" && (p == null || p("reset")));
|
|
475
|
+
},
|
|
476
|
+
children: [
|
|
477
|
+
r !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-visually-hidden", role: "status", children: `${n}, ${r.position}` }) : null,
|
|
478
|
+
/* @__PURE__ */ c("header", { className: "cms-viewer__top", children: [
|
|
479
|
+
/* @__PURE__ */ e("button", { ref: b, type: "button", className: "cms-viewer__icon", "aria-label": t, onClick: Y, children: /* @__PURE__ */ e(M, { name: "close" }) }),
|
|
480
|
+
/* @__PURE__ */ e("span", { className: "cms-viewer__badge", children: a }),
|
|
481
|
+
/* @__PURE__ */ e("h2", { className: "cms-viewer__name", id: C, title: n, children: n }),
|
|
482
|
+
r !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-viewer__position", children: r.position }) : null,
|
|
483
|
+
/* @__PURE__ */ e("span", { className: "cms-viewer__space" }),
|
|
484
|
+
d !== void 0 ? /* @__PURE__ */ c(v, { children: [
|
|
485
|
+
/* @__PURE__ */ e("span", { className: "cms-viewer__status", role: "status", children: d.status }),
|
|
486
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", onClick: d.onDone, children: d.doneLabel })
|
|
487
|
+
] }) : /* @__PURE__ */ c(v, { children: [
|
|
488
|
+
/* @__PURE__ */ e("span", { className: "cms-viewer__actions", children: h.map((_) => /* @__PURE__ */ c("button", { type: "button", className: "cms-viewer__button", onClick: _.onSelect, children: [
|
|
489
|
+
_.icon,
|
|
490
|
+
_.label
|
|
491
|
+
] }, _.label)) }),
|
|
492
|
+
m !== void 0 ? /* @__PURE__ */ c("button", { type: "button", className: "cms-viewer__button cms-viewer__button--edit", "aria-label": m.label, onClick: m.onEdit, children: [
|
|
493
|
+
m.icon,
|
|
494
|
+
/* @__PURE__ */ e("span", { className: "cms-viewer__wide", children: m.label })
|
|
495
|
+
] }) : null,
|
|
496
|
+
h.length > 0 ? /* @__PURE__ */ c("span", { className: "cms-viewer__more", children: [
|
|
497
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__icon", "aria-label": i, "aria-expanded": w, onClick: () => D((_) => !_), children: /* @__PURE__ */ e(x, { name: "more" }) }),
|
|
498
|
+
w ? /* @__PURE__ */ e("span", { className: "cms-viewer__menu", children: h.map((_) => /* @__PURE__ */ c(
|
|
499
|
+
"button",
|
|
500
|
+
{
|
|
501
|
+
type: "button",
|
|
502
|
+
className: "cms-viewer__button",
|
|
503
|
+
onClick: () => {
|
|
504
|
+
D(!1), _.onSelect();
|
|
505
|
+
},
|
|
506
|
+
children: [
|
|
507
|
+
_.icon,
|
|
508
|
+
_.label
|
|
509
|
+
]
|
|
510
|
+
},
|
|
511
|
+
_.label
|
|
512
|
+
)) }) : null
|
|
513
|
+
] }) : null
|
|
514
|
+
] })
|
|
515
|
+
] }),
|
|
516
|
+
/* @__PURE__ */ c("div", { className: "cms-viewer__body", children: [
|
|
517
|
+
f != null && d === void 0 ? /* @__PURE__ */ e("nav", { className: "cms-viewer__thumbnails", children: f }) : null,
|
|
518
|
+
/* @__PURE__ */ c("div", { className: "cms-viewer__content", onTouchStart: G, onTouchEnd: O, children: [
|
|
519
|
+
N,
|
|
520
|
+
d === void 0 && (r != null && r.onPrevious) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--previous", "aria-label": r.previousLabel, onClick: r.onPrevious, children: /* @__PURE__ */ e(M, { name: "back" }) }) : null,
|
|
521
|
+
d === void 0 && (r != null && r.onNext) ? /* @__PURE__ */ e("button", { type: "button", className: "cms-viewer__side cms-viewer__side--next", "aria-label": r.nextLabel, onClick: r.onNext, children: /* @__PURE__ */ e(M, { name: "back" }) }) : null,
|
|
522
|
+
d === void 0 && r !== void 0 ? /* @__PURE__ */ e("div", { className: "cms-viewer__dots", "aria-hidden": "true", children: Array.from({ length: Math.min(r.total, 7) }, (_, k) => /* @__PURE__ */ e("i", { className: k === Math.min(r.index, 6) ? "is-current" : void 0 }, k)) }) : null
|
|
523
|
+
] })
|
|
524
|
+
] }),
|
|
525
|
+
d === void 0 && u != null ? /* @__PURE__ */ e("div", { className: "cms-viewer__strip", children: u }) : null,
|
|
526
|
+
o != null ? /* @__PURE__ */ e("footer", { className: "cms-viewer__bar", children: o }) : null
|
|
527
|
+
]
|
|
528
|
+
}
|
|
529
|
+
),
|
|
530
|
+
document.body
|
|
531
|
+
);
|
|
532
|
+
}
|
|
533
|
+
function Ie({ title: l, scope: n, actions: a, backLink: t }) {
|
|
534
|
+
return /* @__PURE__ */ c("header", { className: "cms-page-header", children: [
|
|
535
|
+
t ? /* @__PURE__ */ c(
|
|
536
|
+
"a",
|
|
537
|
+
{
|
|
538
|
+
className: "cms-page-header__back",
|
|
539
|
+
href: t.href ?? "#",
|
|
540
|
+
onClick: (s) => {
|
|
541
|
+
t.onBack && (s.preventDefault(), t.onBack());
|
|
542
|
+
},
|
|
543
|
+
children: [
|
|
544
|
+
/* @__PURE__ */ e(M, { name: "back" }),
|
|
545
|
+
" ",
|
|
546
|
+
t.label
|
|
547
|
+
]
|
|
548
|
+
}
|
|
549
|
+
) : null,
|
|
550
|
+
/* @__PURE__ */ c("div", { className: "cms-page-header__row", children: [
|
|
551
|
+
/* @__PURE__ */ c("div", { className: "cms-page-header__titles", children: [
|
|
552
|
+
/* @__PURE__ */ e("h1", { className: "cms-page-header__title", children: l }),
|
|
553
|
+
n != null ? /* @__PURE__ */ e("p", { className: "cms-page-header__scope", children: n }) : null
|
|
554
|
+
] }),
|
|
555
|
+
a != null ? /* @__PURE__ */ e("div", { className: "cms-page-header__actions", children: a }) : null
|
|
556
|
+
] })
|
|
557
|
+
] });
|
|
558
|
+
}
|
|
559
|
+
function Be({ tabs: l, active: n, onSelect: a, label: t }) {
|
|
560
|
+
const s = A([]), h = (i, m) => {
|
|
561
|
+
var f;
|
|
562
|
+
const d = l.length - 1, r = i.key === "ArrowRight" ? m === d ? 0 : m + 1 : i.key === "ArrowLeft" ? m === 0 ? d : m - 1 : i.key === "Home" ? 0 : i.key === "End" ? d : null;
|
|
563
|
+
if (r === null) return;
|
|
564
|
+
i.preventDefault();
|
|
565
|
+
const o = l[r];
|
|
566
|
+
o && (a(o.id), (f = s.current[r]) == null || f.focus());
|
|
567
|
+
};
|
|
568
|
+
return /* @__PURE__ */ e("div", { className: "cms-tabs", role: "tablist", "aria-label": t, children: l.map((i, m) => {
|
|
569
|
+
const d = i.id === n;
|
|
570
|
+
return /* @__PURE__ */ c(
|
|
571
|
+
"button",
|
|
572
|
+
{
|
|
573
|
+
ref: (r) => {
|
|
574
|
+
s.current[m] = r;
|
|
575
|
+
},
|
|
576
|
+
type: "button",
|
|
577
|
+
role: "tab",
|
|
578
|
+
className: g("cms-tab", d && "is-active"),
|
|
579
|
+
"aria-selected": d,
|
|
580
|
+
tabIndex: d ? 0 : -1,
|
|
581
|
+
onClick: () => a(i.id),
|
|
582
|
+
onKeyDown: (r) => h(r, m),
|
|
583
|
+
children: [
|
|
584
|
+
i.label,
|
|
585
|
+
i.count !== void 0 ? /* @__PURE__ */ e("span", { className: "cms-tab__count", children: i.count }) : null
|
|
586
|
+
]
|
|
587
|
+
},
|
|
588
|
+
i.id
|
|
589
|
+
);
|
|
590
|
+
}) });
|
|
591
|
+
}
|
|
592
|
+
function ue(l) {
|
|
593
|
+
var t;
|
|
594
|
+
const n = l.trim().split(/\s+/).filter(Boolean);
|
|
595
|
+
return (n.length > 1 ? [n[0][0], n[n.length - 1][0]] : [(t = n[0]) == null ? void 0 : t[0]]).filter(Boolean).join("").toUpperCase();
|
|
596
|
+
}
|
|
597
|
+
function he(l) {
|
|
598
|
+
let n = 0;
|
|
599
|
+
for (const a of l.trim().toLowerCase())
|
|
600
|
+
n = n * 31 + (a.codePointAt(0) ?? 0) >>> 0;
|
|
601
|
+
return n % 6 + 1;
|
|
602
|
+
}
|
|
603
|
+
function H({ name: l, pictureUrl: n, presence: a, size: t = 32 }) {
|
|
604
|
+
return /* @__PURE__ */ c(
|
|
605
|
+
"span",
|
|
606
|
+
{
|
|
607
|
+
className: `cms-avatar cms-avatar--tint-${he(l)}`,
|
|
608
|
+
style: { width: t, height: t, fontSize: Math.round(t * 0.4) },
|
|
609
|
+
role: "img",
|
|
610
|
+
"aria-label": a ? `${l}, ${a}` : l,
|
|
611
|
+
children: [
|
|
612
|
+
n ? /* @__PURE__ */ e("img", { src: n, alt: "", className: "cms-avatar__picture" }) : /* @__PURE__ */ e("span", { "aria-hidden": "true", children: ue(l) }),
|
|
613
|
+
a ? /* @__PURE__ */ e("span", { className: g("cms-avatar__presence", `is-${a}`), "aria-hidden": "true" }) : null
|
|
614
|
+
]
|
|
615
|
+
}
|
|
616
|
+
);
|
|
617
|
+
}
|
|
618
|
+
function fe({ count: l, label: n, max: a = 99 }) {
|
|
619
|
+
return l <= 0 ? null : /* @__PURE__ */ c("span", { className: "cms-badge", children: [
|
|
453
620
|
/* @__PURE__ */ e("span", { "aria-hidden": "true", children: l > a ? `${a}+` : l }),
|
|
454
621
|
/* @__PURE__ */ e("span", { className: "cms-visually-hidden", children: n })
|
|
455
622
|
] });
|
|
456
623
|
}
|
|
457
|
-
function
|
|
458
|
-
return /* @__PURE__ */
|
|
459
|
-
/* @__PURE__ */
|
|
624
|
+
function Ke({ product: l, mark: n, rail: a, active: t, onNavigate: s, server: h, search: i, account: m, children: d, railLabel: r = "Sections" }) {
|
|
625
|
+
return /* @__PURE__ */ c("div", { className: "cms-shell", children: [
|
|
626
|
+
/* @__PURE__ */ c("nav", { className: "cms-shell__rail", "aria-label": r, children: [
|
|
460
627
|
/* @__PURE__ */ e("span", { className: "cms-shell__mark", "aria-hidden": "true", children: n }),
|
|
461
|
-
/* @__PURE__ */ e("ul", { className: "cms-shell__items", children: a.map((
|
|
462
|
-
const f =
|
|
463
|
-
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */
|
|
628
|
+
/* @__PURE__ */ e("ul", { className: "cms-shell__items", children: a.map((o) => {
|
|
629
|
+
const f = o.id === t;
|
|
630
|
+
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ c(
|
|
464
631
|
"a",
|
|
465
632
|
{
|
|
466
|
-
href:
|
|
467
|
-
className:
|
|
633
|
+
href: o.href,
|
|
634
|
+
className: g("cms-shell__item", f && "is-active"),
|
|
468
635
|
"aria-current": f ? "page" : void 0,
|
|
469
|
-
title:
|
|
470
|
-
onClick: (
|
|
471
|
-
s && (
|
|
636
|
+
title: o.label,
|
|
637
|
+
onClick: (u) => {
|
|
638
|
+
s && (u.preventDefault(), s(o.id));
|
|
472
639
|
},
|
|
473
640
|
children: [
|
|
474
|
-
/* @__PURE__ */
|
|
475
|
-
/* @__PURE__ */ e(
|
|
476
|
-
|
|
641
|
+
/* @__PURE__ */ c("span", { className: "cms-shell__icon", children: [
|
|
642
|
+
/* @__PURE__ */ e(x, { name: o.icon, size: 22 }),
|
|
643
|
+
o.badge ? /* @__PURE__ */ e(fe, { count: o.badge.count, label: o.badge.label }) : null
|
|
477
644
|
] }),
|
|
478
|
-
/* @__PURE__ */ e("span", { className: "cms-shell__label", children:
|
|
645
|
+
/* @__PURE__ */ e("span", { className: "cms-shell__label", children: o.label })
|
|
479
646
|
]
|
|
480
647
|
}
|
|
481
|
-
) },
|
|
648
|
+
) }, o.id);
|
|
482
649
|
}) })
|
|
483
650
|
] }),
|
|
484
|
-
/* @__PURE__ */
|
|
651
|
+
/* @__PURE__ */ c("header", { className: "cms-shell__top", children: [
|
|
485
652
|
/* @__PURE__ */ e("span", { className: "cms-shell__product", children: l }),
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
653
|
+
h != null ? /* @__PURE__ */ e("div", { className: "cms-shell__server", children: h }) : null,
|
|
654
|
+
i != null ? /* @__PURE__ */ e("div", { className: "cms-shell__search", children: i }) : null,
|
|
655
|
+
m != null ? /* @__PURE__ */ e("div", { className: "cms-shell__account", children: m }) : null
|
|
489
656
|
] }),
|
|
490
|
-
/* @__PURE__ */ e("main", { className: "cms-shell__main", children:
|
|
657
|
+
/* @__PURE__ */ e("main", { className: "cms-shell__main", children: d })
|
|
491
658
|
] });
|
|
492
659
|
}
|
|
493
|
-
function
|
|
494
|
-
return /* @__PURE__ */
|
|
660
|
+
function Pe({ label: l, placeholder: n, value: a, onChange: t, onSearch: s }) {
|
|
661
|
+
return /* @__PURE__ */ c(
|
|
495
662
|
"form",
|
|
496
663
|
{
|
|
497
664
|
role: "search",
|
|
498
665
|
className: "cms-search",
|
|
499
|
-
onSubmit: (
|
|
500
|
-
|
|
666
|
+
onSubmit: (h) => {
|
|
667
|
+
h.preventDefault(), s == null || s(a);
|
|
501
668
|
},
|
|
502
669
|
children: [
|
|
503
|
-
/* @__PURE__ */ e(
|
|
670
|
+
/* @__PURE__ */ e(x, { name: "search", size: 18 }),
|
|
504
671
|
/* @__PURE__ */ e(
|
|
505
672
|
"input",
|
|
506
673
|
{
|
|
@@ -509,77 +676,77 @@ function be({ label: l, placeholder: n, value: a, onChange: c, onSearch: s }) {
|
|
|
509
676
|
"aria-label": l,
|
|
510
677
|
placeholder: n,
|
|
511
678
|
value: a,
|
|
512
|
-
onChange: (
|
|
679
|
+
onChange: (h) => t(h.target.value)
|
|
513
680
|
}
|
|
514
681
|
)
|
|
515
682
|
]
|
|
516
683
|
}
|
|
517
684
|
);
|
|
518
685
|
}
|
|
519
|
-
function
|
|
520
|
-
const s =
|
|
686
|
+
function Fe({ options: l, value: n, onChange: a, label: t }) {
|
|
687
|
+
const s = A([]), h = (i, m) => {
|
|
521
688
|
var f;
|
|
522
|
-
const
|
|
523
|
-
if (
|
|
524
|
-
|
|
525
|
-
const
|
|
526
|
-
|
|
689
|
+
const d = l.length - 1, r = i.key === "ArrowRight" || i.key === "ArrowDown" ? m === d ? 0 : m + 1 : i.key === "ArrowLeft" || i.key === "ArrowUp" ? m === 0 ? d : m - 1 : null;
|
|
690
|
+
if (r === null) return;
|
|
691
|
+
i.preventDefault();
|
|
692
|
+
const o = l[r];
|
|
693
|
+
o && (a(o.id), (f = s.current[r]) == null || f.focus());
|
|
527
694
|
};
|
|
528
|
-
return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label":
|
|
529
|
-
const
|
|
530
|
-
return /* @__PURE__ */
|
|
695
|
+
return /* @__PURE__ */ e("div", { className: "cms-chips", role: "radiogroup", "aria-label": t, children: l.map((i, m) => {
|
|
696
|
+
const d = i.id === n;
|
|
697
|
+
return /* @__PURE__ */ c(
|
|
531
698
|
"button",
|
|
532
699
|
{
|
|
533
|
-
ref: (
|
|
534
|
-
s.current[
|
|
700
|
+
ref: (r) => {
|
|
701
|
+
s.current[m] = r;
|
|
535
702
|
},
|
|
536
703
|
type: "button",
|
|
537
704
|
role: "radio",
|
|
538
|
-
"aria-checked":
|
|
539
|
-
tabIndex:
|
|
540
|
-
className:
|
|
541
|
-
onClick: () => a(
|
|
542
|
-
onKeyDown: (
|
|
705
|
+
"aria-checked": d,
|
|
706
|
+
tabIndex: d ? 0 : -1,
|
|
707
|
+
className: g("cms-chip", d && "is-on"),
|
|
708
|
+
onClick: () => a(i.id),
|
|
709
|
+
onKeyDown: (r) => h(r, m),
|
|
543
710
|
children: [
|
|
544
|
-
|
|
545
|
-
|
|
711
|
+
d ? /* @__PURE__ */ e(x, { name: "check", size: 16 }) : null,
|
|
712
|
+
i.label
|
|
546
713
|
]
|
|
547
714
|
},
|
|
548
|
-
|
|
715
|
+
i.id
|
|
549
716
|
);
|
|
550
717
|
}) });
|
|
551
718
|
}
|
|
552
|
-
function
|
|
553
|
-
const
|
|
554
|
-
return /* @__PURE__ */ e("div", { className:
|
|
555
|
-
|
|
556
|
-
/* @__PURE__ */ e(
|
|
719
|
+
function Ze({ panes: l, active: n, back: a }) {
|
|
720
|
+
const t = Math.min(Math.max(n ?? l.length - 1, 0), l.length - 1);
|
|
721
|
+
return /* @__PURE__ */ e("div", { className: g("cms-panes", l.length === 3 ? "cms-panes--three" : "cms-panes--two"), "data-active": t, children: l.map((s, h) => /* @__PURE__ */ c("section", { className: "cms-panes__pane", "aria-label": s.label, "data-offset": t - h, children: [
|
|
722
|
+
h === t && a ? /* @__PURE__ */ c("a", { className: "cms-panes__back", href: a.href, children: [
|
|
723
|
+
/* @__PURE__ */ e(x, { name: "chevron-left", size: 18 }),
|
|
557
724
|
a.label
|
|
558
725
|
] }) : null,
|
|
559
726
|
s.content
|
|
560
727
|
] }, s.label)) });
|
|
561
728
|
}
|
|
562
|
-
const
|
|
563
|
-
function
|
|
564
|
-
const
|
|
565
|
-
return /* @__PURE__ */
|
|
729
|
+
const pe = { attachment: "Has an attachment", unread: "Unread" };
|
|
730
|
+
function He({ from: l, subject: n, preview: a, time: t, unread: s, hasAttachment: h, selected: i, onOpen: m, labels: d }) {
|
|
731
|
+
const r = Z(pe, d);
|
|
732
|
+
return /* @__PURE__ */ c(
|
|
566
733
|
"button",
|
|
567
734
|
{
|
|
568
735
|
type: "button",
|
|
569
|
-
className:
|
|
570
|
-
"aria-current":
|
|
571
|
-
onClick:
|
|
736
|
+
className: g("cms-mail-row", s && "is-unread", i && "is-selected"),
|
|
737
|
+
"aria-current": i ? "true" : void 0,
|
|
738
|
+
onClick: m,
|
|
572
739
|
children: [
|
|
573
|
-
/* @__PURE__ */ e(
|
|
574
|
-
/* @__PURE__ */
|
|
575
|
-
/* @__PURE__ */
|
|
740
|
+
/* @__PURE__ */ e(H, { name: l, size: 40 }),
|
|
741
|
+
/* @__PURE__ */ c("span", { className: "cms-mail-row__body", children: [
|
|
742
|
+
/* @__PURE__ */ c("span", { className: "cms-mail-row__line", children: [
|
|
576
743
|
/* @__PURE__ */ e("span", { className: "cms-mail-row__from", children: l }),
|
|
577
|
-
|
|
578
|
-
/* @__PURE__ */ e("span", { className: "cms-mail-row__time", children:
|
|
744
|
+
h ? /* @__PURE__ */ e(x, { name: "paperclip", size: 16, label: r.attachment }) : null,
|
|
745
|
+
/* @__PURE__ */ e("span", { className: "cms-mail-row__time", children: t })
|
|
579
746
|
] }),
|
|
580
|
-
/* @__PURE__ */
|
|
747
|
+
/* @__PURE__ */ c("span", { className: "cms-mail-row__line", children: [
|
|
581
748
|
/* @__PURE__ */ e("span", { className: "cms-mail-row__subject", children: n }),
|
|
582
|
-
s ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label":
|
|
749
|
+
s ? /* @__PURE__ */ e("span", { className: "cms-mail-row__dot", role: "img", "aria-label": r.unread }) : null
|
|
583
750
|
] }),
|
|
584
751
|
/* @__PURE__ */ e("span", { className: "cms-mail-row__preview", children: a })
|
|
585
752
|
] })
|
|
@@ -587,48 +754,48 @@ function Ne({ from: l, subject: n, preview: a, time: c, unread: s, hasAttachment
|
|
|
587
754
|
}
|
|
588
755
|
);
|
|
589
756
|
}
|
|
590
|
-
function
|
|
591
|
-
return /* @__PURE__ */
|
|
757
|
+
function Ve({ direction: l, children: n, time: a, read: t, readLabel: s = "Read" }) {
|
|
758
|
+
return /* @__PURE__ */ c("div", { className: g("cms-bubble", `cms-bubble--${l}`), children: [
|
|
592
759
|
/* @__PURE__ */ e("div", { className: "cms-bubble__text", children: n }),
|
|
593
|
-
/* @__PURE__ */
|
|
760
|
+
/* @__PURE__ */ c("div", { className: "cms-bubble__meta", children: [
|
|
594
761
|
a,
|
|
595
|
-
l === "out" &&
|
|
762
|
+
l === "out" && t ? /* @__PURE__ */ c(v, { children: [
|
|
596
763
|
" · ",
|
|
597
764
|
s
|
|
598
765
|
] }) : null
|
|
599
766
|
] })
|
|
600
767
|
] });
|
|
601
768
|
}
|
|
602
|
-
function
|
|
603
|
-
const
|
|
604
|
-
p.preventDefault(),
|
|
605
|
-
},
|
|
606
|
-
return /* @__PURE__ */
|
|
607
|
-
/* @__PURE__ */ e("label", { htmlFor:
|
|
608
|
-
|
|
769
|
+
function Re({ label: l, value: n, onChange: a, onSend: t, onAttach: s, placeholder: h, variant: i = "chat", sendLabel: m = "Send", attachLabel: d = "Attach a file" }) {
|
|
770
|
+
const r = I(), o = n.trim() === "", f = (p) => {
|
|
771
|
+
p.preventDefault(), o || t();
|
|
772
|
+
}, u = s ? /* @__PURE__ */ e("button", { type: "button", className: "cms-icon-button cms-composer__attach", "aria-label": d, onClick: s, children: /* @__PURE__ */ e(x, { name: "paperclip" }) }) : null;
|
|
773
|
+
return /* @__PURE__ */ c("form", { className: g("cms-composer", `cms-composer--${i}`), onSubmit: f, children: [
|
|
774
|
+
/* @__PURE__ */ e("label", { htmlFor: r, className: i === "reply" ? "cms-composer__title" : "cms-visually-hidden", children: l }),
|
|
775
|
+
i === "chat" ? u : null,
|
|
609
776
|
/* @__PURE__ */ e(
|
|
610
777
|
"textarea",
|
|
611
778
|
{
|
|
612
|
-
id:
|
|
779
|
+
id: r,
|
|
613
780
|
className: "cms-composer__input",
|
|
614
|
-
rows:
|
|
615
|
-
placeholder:
|
|
781
|
+
rows: i === "reply" ? 3 : 1,
|
|
782
|
+
placeholder: h,
|
|
616
783
|
value: n,
|
|
617
784
|
onChange: (p) => a(p.target.value),
|
|
618
785
|
onKeyDown: (p) => {
|
|
619
|
-
p.nativeEvent.isComposing || p.keyCode === 229 ||
|
|
786
|
+
p.nativeEvent.isComposing || p.keyCode === 229 || i === "chat" && p.key === "Enter" && !p.shiftKey && (p.preventDefault(), o || t());
|
|
620
787
|
}
|
|
621
788
|
}
|
|
622
789
|
),
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
790
|
+
i === "reply" ? u : null,
|
|
791
|
+
i === "chat" ? /* @__PURE__ */ e("button", { type: "submit", className: "cms-composer__send-round", "aria-label": m, disabled: o, children: /* @__PURE__ */ e(x, { name: "send" }) }) : /* @__PURE__ */ c("button", { type: "submit", className: "cms-button cms-button--chrome cms-composer__send", disabled: o, children: [
|
|
792
|
+
m,
|
|
626
793
|
" ",
|
|
627
|
-
/* @__PURE__ */ e(
|
|
794
|
+
/* @__PURE__ */ e(x, { name: "send", size: 18 })
|
|
628
795
|
] })
|
|
629
796
|
] });
|
|
630
797
|
}
|
|
631
|
-
const
|
|
798
|
+
const W = {
|
|
632
799
|
incomingAudio: "Incoming audio call",
|
|
633
800
|
incomingVideo: "Incoming video call",
|
|
634
801
|
incomingFrom: (l, n) => `${l} from ${n}`,
|
|
@@ -649,91 +816,91 @@ const Z = {
|
|
|
649
816
|
onCallWith: (l) => `On a call with ${l}`,
|
|
650
817
|
returnToCall: "Return to call"
|
|
651
818
|
};
|
|
652
|
-
function
|
|
653
|
-
const
|
|
654
|
-
return /* @__PURE__ */
|
|
655
|
-
/* @__PURE__ */ e("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ e(
|
|
819
|
+
function We({ name: l, media: n, onAccept: a, onDecline: t, labels: s }) {
|
|
820
|
+
const h = Z(W, s), i = n === "video" ? h.incomingVideo : h.incomingAudio;
|
|
821
|
+
return /* @__PURE__ */ c("div", { className: "cms-call-incoming", role: "alertdialog", "aria-label": h.incomingFrom(i, l), children: [
|
|
822
|
+
/* @__PURE__ */ e("span", { className: "cms-call-incoming__ring", "aria-hidden": "true", children: /* @__PURE__ */ e(H, { name: l, size: 112 }) }),
|
|
656
823
|
/* @__PURE__ */ e("p", { className: "cms-call-incoming__name", children: l }),
|
|
657
|
-
/* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children:
|
|
658
|
-
/* @__PURE__ */
|
|
659
|
-
/* @__PURE__ */ e(
|
|
660
|
-
/* @__PURE__ */ e(
|
|
824
|
+
/* @__PURE__ */ e("p", { className: "cms-call-incoming__what", children: i }),
|
|
825
|
+
/* @__PURE__ */ c("div", { className: "cms-call-incoming__actions", children: [
|
|
826
|
+
/* @__PURE__ */ e(T, { icon: "phone-off", label: h.decline, tone: "hang-up", onClick: t }),
|
|
827
|
+
/* @__PURE__ */ e(T, { icon: "phone", label: h.accept, tone: "accept", onClick: a })
|
|
661
828
|
] })
|
|
662
829
|
] });
|
|
663
830
|
}
|
|
664
|
-
function
|
|
665
|
-
return /* @__PURE__ */
|
|
831
|
+
function T({ icon: l, label: n, onClick: a, tone: t = "plain", pressed: s }) {
|
|
832
|
+
return /* @__PURE__ */ c(
|
|
666
833
|
"button",
|
|
667
834
|
{
|
|
668
835
|
type: "button",
|
|
669
|
-
className:
|
|
836
|
+
className: g("cms-call-button", `cms-call-button--${t}`, s && "is-pressed"),
|
|
670
837
|
"aria-pressed": s,
|
|
671
838
|
onClick: a,
|
|
672
839
|
children: [
|
|
673
|
-
/* @__PURE__ */ e("span", { className: "cms-call-button__disc", children: /* @__PURE__ */ e(
|
|
840
|
+
/* @__PURE__ */ e("span", { className: "cms-call-button__disc", children: /* @__PURE__ */ e(x, { name: l, size: 24 }) }),
|
|
674
841
|
/* @__PURE__ */ e("span", { className: "cms-call-button__label", children: n })
|
|
675
842
|
]
|
|
676
843
|
}
|
|
677
844
|
);
|
|
678
845
|
}
|
|
679
|
-
function
|
|
680
|
-
const
|
|
681
|
-
return /* @__PURE__ */
|
|
682
|
-
/* @__PURE__ */
|
|
683
|
-
/* @__PURE__ */ e(
|
|
684
|
-
/* @__PURE__ */
|
|
846
|
+
function Ue({ name: l, duration: n, connection: a, you: t, muted: s, speaker: h, onToggleMute: i, onToggleSpeaker: m, onAddPerson: d, onChat: r, onHangUp: o, labels: f }) {
|
|
847
|
+
const u = Z(W, f);
|
|
848
|
+
return /* @__PURE__ */ c("section", { className: "cms-call-panel", "aria-label": u.callWith(l), children: [
|
|
849
|
+
/* @__PURE__ */ c("div", { className: "cms-call-panel__head", children: [
|
|
850
|
+
/* @__PURE__ */ e(H, { name: l, size: 64 }),
|
|
851
|
+
/* @__PURE__ */ c("div", { className: "cms-call-panel__who", children: [
|
|
685
852
|
/* @__PURE__ */ e("p", { className: "cms-call-panel__name", children: l }),
|
|
686
|
-
/* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label":
|
|
853
|
+
/* @__PURE__ */ e("p", { className: "cms-call-panel__time", "aria-label": u.callTime(n), children: n })
|
|
687
854
|
] }),
|
|
688
|
-
/* @__PURE__ */ e("span", { className:
|
|
855
|
+
/* @__PURE__ */ e("span", { className: g("cms-pill", a === "good" ? "cms-pill--success" : "cms-pill--warning"), children: a === "good" ? u.goodConnection : u.poorConnection })
|
|
689
856
|
] }),
|
|
690
|
-
/* @__PURE__ */
|
|
691
|
-
/* @__PURE__ */ e(
|
|
692
|
-
/* @__PURE__ */ e("span", { children:
|
|
693
|
-
|
|
857
|
+
/* @__PURE__ */ c("div", { className: "cms-call-panel__you", children: [
|
|
858
|
+
/* @__PURE__ */ e(H, { name: t.name, size: 36 }),
|
|
859
|
+
/* @__PURE__ */ e("span", { children: u.you }),
|
|
860
|
+
t.speaking ? /* @__PURE__ */ e("span", { className: "cms-call-panel__level", role: "img", "aria-label": u.speaking }) : null
|
|
694
861
|
] }),
|
|
695
|
-
/* @__PURE__ */
|
|
696
|
-
/* @__PURE__ */ e(
|
|
697
|
-
/* @__PURE__ */ e(
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
/* @__PURE__ */ e(
|
|
862
|
+
/* @__PURE__ */ c("div", { className: "cms-call-panel__controls", children: [
|
|
863
|
+
/* @__PURE__ */ e(T, { icon: "mic", label: s ? u.unmute : u.mute, pressed: s, onClick: i }),
|
|
864
|
+
/* @__PURE__ */ e(T, { icon: "speaker", label: u.speaker, pressed: h, onClick: m }),
|
|
865
|
+
d ? /* @__PURE__ */ e(T, { icon: "user-plus", label: u.addPerson, onClick: d }) : null,
|
|
866
|
+
r ? /* @__PURE__ */ e(T, { icon: "chat", label: u.chat, onClick: r }) : null,
|
|
867
|
+
/* @__PURE__ */ e(T, { icon: "phone-off", label: u.hangUp, tone: "hang-up", onClick: o })
|
|
701
868
|
] })
|
|
702
869
|
] });
|
|
703
870
|
}
|
|
704
|
-
function
|
|
705
|
-
const
|
|
706
|
-
return /* @__PURE__ */
|
|
871
|
+
function je({ name: l, duration: n, muted: a, onToggleMute: t, onReturn: s, onHangUp: h, labels: i }) {
|
|
872
|
+
const m = Z(W, i);
|
|
873
|
+
return /* @__PURE__ */ c("section", { className: "cms-call-bar", "aria-label": m.callWith(l), children: [
|
|
707
874
|
/* @__PURE__ */ e("span", { className: "cms-call-bar__live", "aria-hidden": "true" }),
|
|
708
|
-
/* @__PURE__ */ e("span", { className: "cms-call-bar__name", children:
|
|
875
|
+
/* @__PURE__ */ e("span", { className: "cms-call-bar__name", children: m.onCallWith(l) }),
|
|
709
876
|
/* @__PURE__ */ e("span", { className: "cms-call-bar__time", children: n }),
|
|
710
|
-
/* @__PURE__ */
|
|
711
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": a ?
|
|
712
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: s, children:
|
|
713
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label":
|
|
877
|
+
/* @__PURE__ */ c("span", { className: "cms-call-bar__actions", children: [
|
|
878
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon", "aria-label": a ? m.unmute : m.mute, "aria-pressed": a, onClick: t, children: /* @__PURE__ */ e(x, { name: "mic" }) }),
|
|
879
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-button cms-button--primary", onClick: s, children: m.returnToCall }),
|
|
880
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-call-bar__icon cms-call-bar__icon--hang-up", "aria-label": m.hangUp, onClick: h, children: /* @__PURE__ */ e(x, { name: "phone-off" }) })
|
|
714
881
|
] })
|
|
715
882
|
] });
|
|
716
883
|
}
|
|
717
|
-
function
|
|
718
|
-
return /* @__PURE__ */
|
|
719
|
-
/* @__PURE__ */
|
|
720
|
-
/* @__PURE__ */
|
|
884
|
+
function qe({ mark: l, product: n, headline: a, lead: t, features: s = [], children: h }) {
|
|
885
|
+
return /* @__PURE__ */ c("div", { className: "cms-signin", children: [
|
|
886
|
+
/* @__PURE__ */ c("aside", { className: "cms-signin__brand", children: [
|
|
887
|
+
/* @__PURE__ */ c("p", { className: "cms-signin__logo", children: [
|
|
721
888
|
/* @__PURE__ */ e("span", { className: "cms-signin__mark", "aria-hidden": "true", children: l }),
|
|
722
889
|
n
|
|
723
890
|
] }),
|
|
724
|
-
/* @__PURE__ */
|
|
891
|
+
/* @__PURE__ */ c("div", { className: "cms-signin__pitch", children: [
|
|
725
892
|
/* @__PURE__ */ e("p", { className: "cms-signin__headline", children: a }),
|
|
726
|
-
/* @__PURE__ */ e("p", { className: "cms-signin__lead", children:
|
|
727
|
-
s.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: s.map((
|
|
728
|
-
/* @__PURE__ */ e(
|
|
729
|
-
|
|
730
|
-
] },
|
|
893
|
+
/* @__PURE__ */ e("p", { className: "cms-signin__lead", children: t }),
|
|
894
|
+
s.length ? /* @__PURE__ */ e("ul", { className: "cms-signin__features", children: s.map((i) => /* @__PURE__ */ c("li", { children: [
|
|
895
|
+
/* @__PURE__ */ e(x, { name: i.icon, size: 18 }),
|
|
896
|
+
i.label
|
|
897
|
+
] }, i.label)) }) : null
|
|
731
898
|
] })
|
|
732
899
|
] }),
|
|
733
|
-
/* @__PURE__ */ e("main", { className: "cms-signin__form", children:
|
|
900
|
+
/* @__PURE__ */ e("main", { className: "cms-signin__form", children: h })
|
|
734
901
|
] });
|
|
735
902
|
}
|
|
736
|
-
const
|
|
903
|
+
const _e = {
|
|
737
904
|
title: "Sign in",
|
|
738
905
|
identifier: "Email or username",
|
|
739
906
|
identifierPlaceholder: "name@example.com",
|
|
@@ -745,166 +912,166 @@ const J = {
|
|
|
745
912
|
newHere: "New here?",
|
|
746
913
|
create: "Create an account"
|
|
747
914
|
};
|
|
748
|
-
function
|
|
749
|
-
const
|
|
750
|
-
return /* @__PURE__ */
|
|
751
|
-
|
|
752
|
-
}, "aria-describedby": s ? `${
|
|
753
|
-
/* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children:
|
|
754
|
-
/* @__PURE__ */
|
|
755
|
-
/* @__PURE__ */ e(
|
|
915
|
+
function ze({ server: l, onSubmit: n, forgotHref: a, createHref: t, error: s, busy: h, labels: i }) {
|
|
916
|
+
const m = Z(_e, i), d = I(), [r, o] = E(""), [f, u] = E(""), [p, N] = E(!1);
|
|
917
|
+
return /* @__PURE__ */ c("form", { className: "cms-signin-form", onSubmit: (b) => {
|
|
918
|
+
b.preventDefault(), n(r, f);
|
|
919
|
+
}, "aria-describedby": s ? `${d}-error` : void 0, children: [
|
|
920
|
+
/* @__PURE__ */ e("h1", { className: "cms-signin-form__title", children: m.title }),
|
|
921
|
+
/* @__PURE__ */ c("p", { className: "cms-signin-form__server", children: [
|
|
922
|
+
/* @__PURE__ */ e(x, { name: "server", size: 18 }),
|
|
756
923
|
l
|
|
757
924
|
] }),
|
|
758
|
-
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${
|
|
925
|
+
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${d}-identifier`, children: m.identifier }),
|
|
759
926
|
/* @__PURE__ */ e(
|
|
760
927
|
"input",
|
|
761
928
|
{
|
|
762
|
-
id: `${
|
|
929
|
+
id: `${d}-identifier`,
|
|
763
930
|
className: "cms-signin-form__input",
|
|
764
931
|
type: "text",
|
|
765
932
|
autoComplete: "username",
|
|
766
|
-
placeholder:
|
|
767
|
-
value:
|
|
768
|
-
onChange: (
|
|
933
|
+
placeholder: m.identifierPlaceholder,
|
|
934
|
+
value: r,
|
|
935
|
+
onChange: (b) => o(b.target.value),
|
|
769
936
|
required: !0
|
|
770
937
|
}
|
|
771
938
|
),
|
|
772
|
-
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${
|
|
773
|
-
/* @__PURE__ */
|
|
939
|
+
/* @__PURE__ */ e("label", { className: "cms-signin-form__label", htmlFor: `${d}-password`, children: m.password }),
|
|
940
|
+
/* @__PURE__ */ c("span", { className: "cms-signin-form__password", children: [
|
|
774
941
|
/* @__PURE__ */ e(
|
|
775
942
|
"input",
|
|
776
943
|
{
|
|
777
|
-
id: `${
|
|
944
|
+
id: `${d}-password`,
|
|
778
945
|
className: "cms-signin-form__input",
|
|
779
946
|
type: p ? "text" : "password",
|
|
780
947
|
autoComplete: "current-password",
|
|
781
948
|
value: f,
|
|
782
|
-
onChange: (
|
|
949
|
+
onChange: (b) => u(b.target.value),
|
|
783
950
|
required: !0
|
|
784
951
|
}
|
|
785
952
|
),
|
|
786
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": p, onClick: () =>
|
|
953
|
+
/* @__PURE__ */ e("button", { type: "button", className: "cms-signin-form__show", "aria-pressed": p, onClick: () => N((b) => !b), children: p ? m.hide : m.show })
|
|
787
954
|
] }),
|
|
788
|
-
a ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: a, children:
|
|
789
|
-
s ? /* @__PURE__ */ e("p", { id: `${
|
|
790
|
-
/* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled:
|
|
791
|
-
|
|
792
|
-
/* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children:
|
|
793
|
-
/* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href:
|
|
955
|
+
a ? /* @__PURE__ */ e("a", { className: "cms-signin-form__forgot", href: a, children: m.forgot }) : null,
|
|
956
|
+
s ? /* @__PURE__ */ e("p", { id: `${d}-error`, className: "cms-signin-form__error", role: "alert", children: s }) : null,
|
|
957
|
+
/* @__PURE__ */ e("button", { type: "submit", className: "cms-button cms-button--chrome cms-signin-form__submit", disabled: h, "aria-busy": h || void 0, children: m.submit }),
|
|
958
|
+
t ? /* @__PURE__ */ c(v, { children: [
|
|
959
|
+
/* @__PURE__ */ e("p", { className: "cms-signin-form__or", children: /* @__PURE__ */ e("span", { children: m.newHere }) }),
|
|
960
|
+
/* @__PURE__ */ e("a", { className: "cms-button cms-signin-form__create", href: t, children: m.create })
|
|
794
961
|
] }) : null
|
|
795
962
|
] });
|
|
796
963
|
}
|
|
797
|
-
function
|
|
798
|
-
const
|
|
799
|
-
if (a != null) return /* @__PURE__ */ e(
|
|
800
|
-
if (n === null) return /* @__PURE__ */ e(
|
|
801
|
-
if (n.length === 0) return /* @__PURE__ */ e(
|
|
802
|
-
const f = (
|
|
803
|
-
var
|
|
804
|
-
if (
|
|
805
|
-
|
|
806
|
-
else if (
|
|
807
|
-
|
|
808
|
-
else if ((
|
|
809
|
-
|
|
810
|
-
const
|
|
811
|
-
|
|
964
|
+
function Xe({ label: l, rows: n, error: a, onRetry: t, loadingText: s = "Loading", emptyTitle: h = "Nothing here yet", emptyHint: i, selected: m, onOpen: d, onRowMenu: r }) {
|
|
965
|
+
const o = A([]);
|
|
966
|
+
if (a != null) return /* @__PURE__ */ e(se, { message: a, onRetry: t });
|
|
967
|
+
if (n === null) return /* @__PURE__ */ e(ne, { what: s, layout: "block" });
|
|
968
|
+
if (n.length === 0) return /* @__PURE__ */ e(ae, { title: h, hint: i });
|
|
969
|
+
const f = (u, p, N) => {
|
|
970
|
+
var y;
|
|
971
|
+
if (u.key === "ArrowDown" || u.key === "ArrowUp")
|
|
972
|
+
u.preventDefault(), (y = o.current[Math.min(n.length - 1, Math.max(0, p + (u.key === "ArrowDown" ? 1 : -1)))]) == null || y.focus();
|
|
973
|
+
else if (u.key === "Enter")
|
|
974
|
+
d == null || d(N);
|
|
975
|
+
else if ((u.key === "ContextMenu" || u.shiftKey && u.key === "F10") && r) {
|
|
976
|
+
u.preventDefault();
|
|
977
|
+
const b = u.currentTarget.getBoundingClientRect();
|
|
978
|
+
r(N, { x: b.left + 16, y: b.bottom });
|
|
812
979
|
}
|
|
813
980
|
};
|
|
814
|
-
return /* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": l, children: n.map((
|
|
815
|
-
const
|
|
816
|
-
return /* @__PURE__ */
|
|
981
|
+
return /* @__PURE__ */ e("ul", { className: "cms-list", role: "listbox", "aria-label": l, children: n.map((u, p) => {
|
|
982
|
+
const N = u.id === m;
|
|
983
|
+
return /* @__PURE__ */ c(
|
|
817
984
|
"li",
|
|
818
985
|
{
|
|
819
|
-
ref: (
|
|
820
|
-
|
|
986
|
+
ref: (y) => {
|
|
987
|
+
o.current[p] = y;
|
|
821
988
|
},
|
|
822
989
|
role: "option",
|
|
823
|
-
"aria-selected":
|
|
824
|
-
tabIndex:
|
|
825
|
-
className:
|
|
826
|
-
onClick: () =>
|
|
827
|
-
onKeyDown: (
|
|
828
|
-
onContextMenu:
|
|
829
|
-
|
|
990
|
+
"aria-selected": N,
|
|
991
|
+
tabIndex: N || m == null && p === 0 ? 0 : -1,
|
|
992
|
+
className: g("cms-list__row", N && "is-selected"),
|
|
993
|
+
onClick: () => d == null ? void 0 : d(u.id),
|
|
994
|
+
onKeyDown: (y) => f(y, p, u.id),
|
|
995
|
+
onContextMenu: r ? (y) => {
|
|
996
|
+
y.preventDefault(), r(u.id, { x: y.clientX, y: y.clientY });
|
|
830
997
|
} : void 0,
|
|
831
998
|
children: [
|
|
832
|
-
|
|
833
|
-
/* @__PURE__ */
|
|
834
|
-
/* @__PURE__ */ e("span", { className: "cms-list__primary", children:
|
|
835
|
-
|
|
999
|
+
u.lead != null ? /* @__PURE__ */ e("span", { className: "cms-list__lead", children: u.lead }) : null,
|
|
1000
|
+
/* @__PURE__ */ c("span", { className: "cms-list__text", children: [
|
|
1001
|
+
/* @__PURE__ */ e("span", { className: "cms-list__primary", children: u.primary }),
|
|
1002
|
+
u.secondary != null ? /* @__PURE__ */ e("span", { className: "cms-list__secondary", children: u.secondary }) : null
|
|
836
1003
|
] }),
|
|
837
|
-
|
|
1004
|
+
u.meta != null ? /* @__PURE__ */ e("span", { className: "cms-list__meta", children: u.meta }) : null
|
|
838
1005
|
]
|
|
839
1006
|
},
|
|
840
|
-
|
|
1007
|
+
u.id
|
|
841
1008
|
);
|
|
842
1009
|
}) });
|
|
843
1010
|
}
|
|
844
|
-
function
|
|
845
|
-
const s =
|
|
846
|
-
if (
|
|
1011
|
+
function Ye({ at: l, items: n, onClose: a, label: t = "Actions" }) {
|
|
1012
|
+
const s = A(null), h = A(null), [i, m] = E(l), d = n.filter((o) => o.offer.offered);
|
|
1013
|
+
if (Q(() => {
|
|
847
1014
|
if (!l) return;
|
|
848
|
-
const
|
|
849
|
-
|
|
850
|
-
}, [l]),
|
|
851
|
-
var f,
|
|
1015
|
+
const o = s.current, f = (o == null ? void 0 : o.offsetWidth) ?? 0, u = (o == null ? void 0 : o.offsetHeight) ?? 0;
|
|
1016
|
+
m({ x: Math.max(0, Math.min(l.x, window.innerWidth - f)), y: Math.max(0, Math.min(l.y, window.innerHeight - u)) });
|
|
1017
|
+
}, [l]), K(() => {
|
|
1018
|
+
var f, u;
|
|
852
1019
|
if (!l) return;
|
|
853
|
-
|
|
854
|
-
const
|
|
855
|
-
var
|
|
856
|
-
(
|
|
1020
|
+
h.current = document.activeElement, (u = (f = s.current) == null ? void 0 : f.querySelector('[role="menuitem"]:not([aria-disabled="true"])')) == null || u.focus();
|
|
1021
|
+
const o = (p) => {
|
|
1022
|
+
var N;
|
|
1023
|
+
(N = s.current) != null && N.contains(p.target) || a();
|
|
857
1024
|
};
|
|
858
|
-
return document.addEventListener("mousedown",
|
|
859
|
-
var p,
|
|
860
|
-
document.removeEventListener("mousedown",
|
|
1025
|
+
return document.addEventListener("mousedown", o), () => {
|
|
1026
|
+
var p, N;
|
|
1027
|
+
document.removeEventListener("mousedown", o), (N = (p = h.current) == null ? void 0 : p.focus) == null || N.call(p);
|
|
861
1028
|
};
|
|
862
|
-
}, [l, a]), !l ||
|
|
863
|
-
const
|
|
864
|
-
var p,
|
|
865
|
-
const f = Array.from(((p = s.current) == null ? void 0 : p.querySelectorAll('[role="menuitem"]')) ?? []),
|
|
866
|
-
if (
|
|
867
|
-
|
|
868
|
-
else if (
|
|
869
|
-
|
|
870
|
-
const
|
|
871
|
-
(
|
|
1029
|
+
}, [l, a]), !l || d.length === 0) return null;
|
|
1030
|
+
const r = (o) => {
|
|
1031
|
+
var p, N;
|
|
1032
|
+
const f = Array.from(((p = s.current) == null ? void 0 : p.querySelectorAll('[role="menuitem"]')) ?? []), u = f.indexOf(document.activeElement);
|
|
1033
|
+
if (o.key === "Escape" || o.key === "Tab")
|
|
1034
|
+
o.preventDefault(), a();
|
|
1035
|
+
else if (o.key === "ArrowDown" || o.key === "ArrowUp") {
|
|
1036
|
+
o.preventDefault();
|
|
1037
|
+
const y = o.key === "ArrowDown" ? 1 : -1;
|
|
1038
|
+
(N = f[(u + y + f.length) % f.length]) == null || N.focus();
|
|
872
1039
|
}
|
|
873
1040
|
};
|
|
874
|
-
return
|
|
1041
|
+
return R(
|
|
875
1042
|
/* @__PURE__ */ e(
|
|
876
1043
|
"div",
|
|
877
1044
|
{
|
|
878
1045
|
ref: s,
|
|
879
1046
|
className: "cms-menu",
|
|
880
1047
|
role: "menu",
|
|
881
|
-
"aria-label":
|
|
882
|
-
style: { left: (
|
|
883
|
-
onKeyDown:
|
|
884
|
-
onContextMenu: (
|
|
885
|
-
children:
|
|
886
|
-
const f =
|
|
887
|
-
return /* @__PURE__ */
|
|
1048
|
+
"aria-label": t,
|
|
1049
|
+
style: { left: (i ?? l).x, top: (i ?? l).y },
|
|
1050
|
+
onKeyDown: r,
|
|
1051
|
+
onContextMenu: (o) => o.preventDefault(),
|
|
1052
|
+
children: d.map((o) => {
|
|
1053
|
+
const f = o.offer.refusal !== void 0;
|
|
1054
|
+
return /* @__PURE__ */ c(
|
|
888
1055
|
"div",
|
|
889
1056
|
{
|
|
890
1057
|
role: "menuitem",
|
|
891
1058
|
tabIndex: -1,
|
|
892
1059
|
"aria-disabled": f || void 0,
|
|
893
|
-
title: f ?
|
|
894
|
-
className:
|
|
1060
|
+
title: f ? o.offer.refusal : void 0,
|
|
1061
|
+
className: g("cms-menu__item", o.danger && "is-danger", o.offer.locked && "is-locked", f && "is-refused"),
|
|
895
1062
|
onClick: () => {
|
|
896
|
-
f || (a(),
|
|
1063
|
+
f || (a(), o.onSelect());
|
|
897
1064
|
},
|
|
898
|
-
onKeyDown: (
|
|
899
|
-
(
|
|
1065
|
+
onKeyDown: (u) => {
|
|
1066
|
+
(u.key === "Enter" || u.key === " ") && !f && (u.preventDefault(), a(), o.onSelect());
|
|
900
1067
|
},
|
|
901
1068
|
children: [
|
|
902
|
-
|
|
903
|
-
/* @__PURE__ */ e("span", { className: "cms-menu__label", children:
|
|
904
|
-
f ? /* @__PURE__ */ e("span", { className: "cms-menu__refusal", children:
|
|
1069
|
+
o.offer.locked ? /* @__PURE__ */ e(M, { name: "lock" }) : null,
|
|
1070
|
+
/* @__PURE__ */ e("span", { className: "cms-menu__label", children: o.label }),
|
|
1071
|
+
f ? /* @__PURE__ */ e("span", { className: "cms-menu__refusal", children: o.offer.refusal }) : null
|
|
905
1072
|
]
|
|
906
1073
|
},
|
|
907
|
-
|
|
1074
|
+
o.id
|
|
908
1075
|
);
|
|
909
1076
|
})
|
|
910
1077
|
}
|
|
@@ -912,11 +1079,11 @@ function Le({ at: l, items: n, onClose: a, label: c = "Actions" }) {
|
|
|
912
1079
|
document.body
|
|
913
1080
|
);
|
|
914
1081
|
}
|
|
915
|
-
function
|
|
1082
|
+
function be(l) {
|
|
916
1083
|
return l === "allowed" || l === "elevate" || l === "denied";
|
|
917
1084
|
}
|
|
918
|
-
function
|
|
919
|
-
if (!
|
|
1085
|
+
function Ge(l, n) {
|
|
1086
|
+
if (!be(l))
|
|
920
1087
|
return n.showRefused ? { offered: !0, locked: !1, refusal: "not available: the server gave an answer this app does not know", unknown: !0 } : { offered: !1, locked: !1, unknown: !0 };
|
|
921
1088
|
switch (l) {
|
|
922
1089
|
case "allowed":
|
|
@@ -927,111 +1094,114 @@ function De(l, n) {
|
|
|
927
1094
|
return n.showRefused ? { offered: !0, locked: !1, refusal: n.refusal ?? "not allowed" } : { offered: !1, locked: !1 };
|
|
928
1095
|
}
|
|
929
1096
|
}
|
|
930
|
-
function
|
|
1097
|
+
function ve(l, n) {
|
|
931
1098
|
if (!l) return;
|
|
932
1099
|
if (typeof l.get == "function") return l.get(n) ?? void 0;
|
|
933
|
-
const a = l,
|
|
934
|
-
return
|
|
1100
|
+
const a = l, t = Object.keys(a).find((s) => s.toLowerCase() === n.toLowerCase());
|
|
1101
|
+
return t === void 0 ? void 0 : a[t];
|
|
935
1102
|
}
|
|
936
|
-
function
|
|
1103
|
+
function Ne(l) {
|
|
937
1104
|
if (l && typeof l == "object") {
|
|
938
1105
|
const n = l;
|
|
939
1106
|
if (typeof n.detail == "string" && n.detail !== "") return n.detail;
|
|
940
1107
|
if (typeof n.title == "string" && n.title !== "") return n.title;
|
|
941
1108
|
}
|
|
942
1109
|
}
|
|
943
|
-
function
|
|
1110
|
+
function Oe(l, n, a, t) {
|
|
944
1111
|
if (l !== 403) return { kind: "none" };
|
|
945
|
-
const s =
|
|
946
|
-
return
|
|
1112
|
+
const s = Ne(a);
|
|
1113
|
+
return ve(n, "X-Elevation-Required") !== void 0 ? t.elevates ? { kind: "elevation-required", message: s ?? "This needs an elevated session." } : { kind: "refused", message: "This can only be done in the admin, in an elevated session." } : { kind: "refused", message: s ?? "The server refused this." };
|
|
947
1114
|
}
|
|
948
|
-
const
|
|
949
|
-
function
|
|
950
|
-
window.dispatchEvent(new Event(
|
|
1115
|
+
const V = "coolms-kit:reread";
|
|
1116
|
+
function Qe() {
|
|
1117
|
+
window.dispatchEvent(new Event(V));
|
|
951
1118
|
}
|
|
952
|
-
function
|
|
953
|
-
const [n, a] =
|
|
954
|
-
|
|
955
|
-
const
|
|
956
|
-
const
|
|
957
|
-
|
|
1119
|
+
function Je(l) {
|
|
1120
|
+
const [n, a] = E(void 0), [t, s] = E(void 0), [h, i] = E(!0), m = A(l);
|
|
1121
|
+
m.current = l;
|
|
1122
|
+
const d = A(0), r = J(() => {
|
|
1123
|
+
const o = ++d.current;
|
|
1124
|
+
i(!0), m.current().then(
|
|
958
1125
|
(f) => {
|
|
959
|
-
|
|
1126
|
+
o === d.current && (a(f), s(void 0), i(!1));
|
|
960
1127
|
},
|
|
961
1128
|
(f) => {
|
|
962
|
-
|
|
1129
|
+
o === d.current && (s(f), i(!1));
|
|
963
1130
|
}
|
|
964
1131
|
);
|
|
965
1132
|
}, []);
|
|
966
|
-
return
|
|
967
|
-
|
|
968
|
-
const
|
|
969
|
-
return window.addEventListener("focus",
|
|
970
|
-
window.removeEventListener("focus",
|
|
1133
|
+
return K(() => {
|
|
1134
|
+
r();
|
|
1135
|
+
const o = () => r();
|
|
1136
|
+
return window.addEventListener("focus", o), window.addEventListener(V, o), () => {
|
|
1137
|
+
window.removeEventListener("focus", o), window.removeEventListener(V, o);
|
|
971
1138
|
};
|
|
972
|
-
}, [
|
|
1139
|
+
}, [r]), { value: n, error: t, loading: h, reread: r };
|
|
973
1140
|
}
|
|
974
|
-
function
|
|
1141
|
+
function el(l) {
|
|
975
1142
|
return l === 412 ? { conflict: !0, message: "Someone changed this since you opened it. Nothing was saved; read it again to see the change." } : { conflict: !1 };
|
|
976
1143
|
}
|
|
977
|
-
const
|
|
978
|
-
function
|
|
979
|
-
const a = l.split(".").map((s) => Number.parseInt(s, 10) || 0),
|
|
980
|
-
for (let s = 0; s < Math.max(a.length,
|
|
981
|
-
const
|
|
982
|
-
if (
|
|
1144
|
+
const ge = "/errors/client-update-required";
|
|
1145
|
+
function ye(l, n) {
|
|
1146
|
+
const a = l.split(".").map((s) => Number.parseInt(s, 10) || 0), t = n.split(".").map((s) => Number.parseInt(s, 10) || 0);
|
|
1147
|
+
for (let s = 0; s < Math.max(a.length, t.length); s++) {
|
|
1148
|
+
const h = a[s] ?? 0, i = t[s] ?? 0;
|
|
1149
|
+
if (h !== i) return h < i;
|
|
983
1150
|
}
|
|
984
1151
|
return !1;
|
|
985
1152
|
}
|
|
986
|
-
function
|
|
987
|
-
return l.problemType !== void 0 && l.problemType.endsWith(
|
|
1153
|
+
function ll(l) {
|
|
1154
|
+
return l.problemType !== void 0 && l.problemType.endsWith(ge) ? !0 : l.minimumVersion !== void 0 && ye(l.version, l.minimumVersion);
|
|
988
1155
|
}
|
|
989
1156
|
export {
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1157
|
+
Ke as AppShell,
|
|
1158
|
+
H as Avatar,
|
|
1159
|
+
fe as Badge,
|
|
1160
|
+
F as Button,
|
|
1161
|
+
W as CALL_LABELS,
|
|
1162
|
+
ge as CLIENT_UPDATE_REQUIRED,
|
|
1163
|
+
je as CallBar,
|
|
1164
|
+
Ue as CallPanel,
|
|
1165
|
+
Ve as ChatBubble,
|
|
1166
|
+
Re as Composer,
|
|
1167
|
+
Ee as ConfirmDialog,
|
|
1168
|
+
Ye as ContextMenu,
|
|
1169
|
+
ae as EmptyState,
|
|
1170
|
+
se as ErrorBanner,
|
|
1171
|
+
Te as FileViewer,
|
|
1172
|
+
Fe as FilterChips,
|
|
1173
|
+
$e as ICON_NAMES,
|
|
1174
|
+
x as Icon,
|
|
1175
|
+
We as IncomingCall,
|
|
1176
|
+
Xe as List,
|
|
1177
|
+
ne as Loading,
|
|
1178
|
+
pe as MAIL_ROW_LABELS,
|
|
1179
|
+
ee as MODAL_CLOSE_MS,
|
|
1180
|
+
He as MailRow,
|
|
1181
|
+
le as Modal,
|
|
1182
|
+
Ie as PageHeader,
|
|
1183
|
+
_e as SIGN_IN_LABELS,
|
|
1184
|
+
j as STATE_DELAY_MS,
|
|
1185
|
+
Pe as SearchField,
|
|
1186
|
+
Ce as Select,
|
|
1187
|
+
ze as SignInForm,
|
|
1188
|
+
qe as SignInLayout,
|
|
1189
|
+
Ze as SplitPanes,
|
|
1190
|
+
De as State,
|
|
1191
|
+
Be as TabStrip,
|
|
1192
|
+
xe as TextField,
|
|
1193
|
+
Le as Toast,
|
|
1194
|
+
Se as ToastRegion,
|
|
1195
|
+
Ae as Toggle,
|
|
1196
|
+
ue as initialsOf,
|
|
1197
|
+
be as isCapability,
|
|
1198
|
+
ll as needsClientUpdate,
|
|
1199
|
+
Ge as offerFor,
|
|
1200
|
+
el as readConflict,
|
|
1201
|
+
Oe as readRefusal,
|
|
1202
|
+
Ne as refusalText,
|
|
1203
|
+
Qe as rereadAll,
|
|
1204
|
+
he as tintOf,
|
|
1205
|
+
Je as useReread,
|
|
1206
|
+
ye as versionBelow
|
|
1037
1207
|
};
|