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