@webority/ui-elements 0.27.1 → 0.27.3
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/dist/ui-elements.global.js +2 -2
- package/dist/ui-elements.js +882 -872
- package/dist/ui-rich-text.global.js +1 -1
- package/dist/ui-rich-text.js +1 -1
- package/package.json +1 -1
package/dist/ui-elements.js
CHANGED
|
@@ -99,7 +99,7 @@ function ne(e) {
|
|
|
99
99
|
}
|
|
100
100
|
return Date.parse(e);
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function T(e) {
|
|
103
103
|
let t = new Date(e + u);
|
|
104
104
|
return {
|
|
105
105
|
year: t.getUTCFullYear(),
|
|
@@ -109,10 +109,10 @@ function re(e) {
|
|
|
109
109
|
minute: t.getUTCMinutes()
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function E(e, { pattern: t = "day" } = {}) {
|
|
113
113
|
let n = ne(e);
|
|
114
114
|
if (!Number.isFinite(n)) return "-";
|
|
115
|
-
let r =
|
|
115
|
+
let r = T(n), i = (e) => String(e).padStart(2, "0"), a = `${i(r.day)}-${d[r.month]}-${r.year}`, o = `${i(r.hour)}:${i(r.minute)}`;
|
|
116
116
|
switch (t) {
|
|
117
117
|
case "month": return `${d[r.month]}-${r.year}`;
|
|
118
118
|
case "year": return String(r.year);
|
|
@@ -121,10 +121,10 @@ function T(e, { pattern: t = "day" } = {}) {
|
|
|
121
121
|
default: return a;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function re(e, t) {
|
|
125
125
|
if (e == null || e === "") return "-";
|
|
126
126
|
let n = t?.style;
|
|
127
|
-
if (n === "date") return
|
|
127
|
+
if (n === "date") return E(e, t);
|
|
128
128
|
if (typeof e != "number") return String(e);
|
|
129
129
|
switch (n) {
|
|
130
130
|
case "currency": return S(e, t);
|
|
@@ -136,14 +136,14 @@ function ie(e, t) {
|
|
|
136
136
|
}
|
|
137
137
|
//#endregion
|
|
138
138
|
//#region src/wuiHttp.js
|
|
139
|
-
var
|
|
139
|
+
var ie = "wui-csrf", D = "RequestVerificationToken", O = Object.freeze({
|
|
140
140
|
fragment: "X-Wui-Fragment",
|
|
141
141
|
message: "X-Wui-Message",
|
|
142
142
|
redirect: "X-Wui-Redirect",
|
|
143
143
|
result: "X-Wui-Result",
|
|
144
144
|
keepOpen: "X-Wui-Keep-Open",
|
|
145
145
|
toastVariant: "X-Wui-Toast-Variant"
|
|
146
|
-
}),
|
|
146
|
+
}), ae = Object.freeze([
|
|
147
147
|
"ok",
|
|
148
148
|
"validation",
|
|
149
149
|
"forbidden",
|
|
@@ -153,33 +153,33 @@ var ae = "wui-csrf", oe = "RequestVerificationToken", E = Object.freeze({
|
|
|
153
153
|
"aborted",
|
|
154
154
|
"stale",
|
|
155
155
|
"session"
|
|
156
|
-
]),
|
|
157
|
-
function
|
|
158
|
-
let t = e.querySelector(`meta[name="${
|
|
156
|
+
]), oe = /* @__PURE__ */ new Set(["GET", "HEAD"]);
|
|
157
|
+
function se(e = document) {
|
|
158
|
+
let t = e.querySelector(`meta[name="${ie}"]`), n = t?.getAttribute("content");
|
|
159
159
|
return n ? {
|
|
160
160
|
header: t.getAttribute("data-header") || "RequestVerificationToken",
|
|
161
161
|
token: n
|
|
162
162
|
} : null;
|
|
163
163
|
}
|
|
164
|
-
var
|
|
164
|
+
var ce = (e) => {
|
|
165
165
|
try {
|
|
166
166
|
return new URL(e, window.location.href).origin === window.location.origin;
|
|
167
167
|
} catch {
|
|
168
168
|
return !1;
|
|
169
169
|
}
|
|
170
170
|
};
|
|
171
|
-
function
|
|
171
|
+
function le(e) {
|
|
172
172
|
return e >= 200 && e < 300 ? "ok" : e === 401 ? "session" : e === 403 ? "forbidden" : e === 422 ? "validation" : e >= 400 && e < 500 ? "client" : "server";
|
|
173
173
|
}
|
|
174
|
-
var
|
|
175
|
-
async function
|
|
174
|
+
var k = (e) => e?.name === "AbortError";
|
|
175
|
+
async function A(e, t = {}) {
|
|
176
176
|
let n = (t.method || "GET").toUpperCase(), r = t.navigate || ((e) => window.location.assign(e)), i = {
|
|
177
177
|
Accept: "text/html",
|
|
178
178
|
"X-Requested-With": "XMLHttpRequest",
|
|
179
179
|
...t.headers
|
|
180
180
|
};
|
|
181
|
-
if (!
|
|
182
|
-
let e =
|
|
181
|
+
if (!oe.has(n) && ce(e)) {
|
|
182
|
+
let e = se();
|
|
183
183
|
e && (i[e.header] = e.token);
|
|
184
184
|
}
|
|
185
185
|
let a = (e) => {
|
|
@@ -197,12 +197,12 @@ async function O(e, t = {}) {
|
|
|
197
197
|
status: t?.status ?? 0,
|
|
198
198
|
html: n,
|
|
199
199
|
response: t,
|
|
200
|
-
message: a(r(
|
|
201
|
-
redirect: r(
|
|
202
|
-
result: r(
|
|
203
|
-
keepOpen: r(
|
|
204
|
-
toastVariant: r(
|
|
205
|
-
fragment: r(
|
|
200
|
+
message: a(r(O.message)),
|
|
201
|
+
redirect: r(O.redirect),
|
|
202
|
+
result: r(O.result),
|
|
203
|
+
keepOpen: r(O.keepOpen) === "1",
|
|
204
|
+
toastVariant: r(O.toastVariant),
|
|
205
|
+
fragment: r(O.fragment) === "1"
|
|
206
206
|
};
|
|
207
207
|
}, s;
|
|
208
208
|
try {
|
|
@@ -214,19 +214,19 @@ async function O(e, t = {}) {
|
|
|
214
214
|
credentials: "same-origin"
|
|
215
215
|
});
|
|
216
216
|
} catch (e) {
|
|
217
|
-
return o(
|
|
217
|
+
return o(k(e) || t.signal?.aborted ? "aborted" : "network");
|
|
218
218
|
}
|
|
219
|
-
let c =
|
|
220
|
-
if (c === "ok" && s.redirected && s.headers.get(
|
|
219
|
+
let c = le(s.status);
|
|
220
|
+
if (c === "ok" && s.redirected && s.headers.get(O.fragment) !== "1" && (c = "session"), c === "session") return r(s.status === 401 ? s.headers.get("Location") || window.location.href : s.url), o(c, s);
|
|
221
221
|
let l = "";
|
|
222
222
|
if (c === "ok" || c === "validation") try {
|
|
223
223
|
l = await s.text();
|
|
224
224
|
} catch (e) {
|
|
225
|
-
return o(
|
|
225
|
+
return o(k(e) || t.signal?.aborted ? "aborted" : "network", s);
|
|
226
226
|
}
|
|
227
227
|
return o(c, s, l);
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function ue() {
|
|
230
230
|
let e = null, t = 0;
|
|
231
231
|
return {
|
|
232
232
|
async run(n, r = {}) {
|
|
@@ -235,7 +235,7 @@ function fe() {
|
|
|
235
235
|
e = i;
|
|
236
236
|
let a = ++t, o = r.signal;
|
|
237
237
|
o && (o.aborted ? i.abort() : o.addEventListener("abort", () => i.abort(), { once: !0 }));
|
|
238
|
-
let s = await
|
|
238
|
+
let s = await A(n, {
|
|
239
239
|
...r,
|
|
240
240
|
signal: i.signal
|
|
241
241
|
});
|
|
@@ -252,12 +252,12 @@ function fe() {
|
|
|
252
252
|
}
|
|
253
253
|
//#endregion
|
|
254
254
|
//#region src/remoteModal.js
|
|
255
|
-
var
|
|
255
|
+
var de = "wui-remote-modal", fe = "wui-modal-fullscreen", pe = Object.freeze({
|
|
256
256
|
sm: 380,
|
|
257
257
|
md: 440,
|
|
258
258
|
lg: 640,
|
|
259
259
|
xl: 880
|
|
260
|
-
}),
|
|
260
|
+
}), j = Object.freeze({
|
|
261
261
|
loading: "Loading",
|
|
262
262
|
close: "Close",
|
|
263
263
|
retry: "Try again",
|
|
@@ -268,38 +268,38 @@ var pe = "wui-remote-modal", me = "wui-modal-fullscreen", he = Object.freeze({
|
|
|
268
268
|
network: "Could not reach the server. Check your connection and try again.",
|
|
269
269
|
submitFailed: "Your changes were not saved.",
|
|
270
270
|
invalid: "Some fields need attention."
|
|
271
|
-
}),
|
|
271
|
+
}), me = "a[href],button:not([disabled]),input:not([disabled]):not([type=\"hidden\"]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])", he = "[aria-invalid=\"true\"], .is-invalid, .input-validation-error", ge = ".wui-error-summary, [data-wui-form-errors], .validation-summary-errors, [data-valmsg-summary]", _e = "[data-wui-modal-content]", ve = "<button type=\"button\" class=\"wui-modal-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"><svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M18 6 6 18M6 6l12 12\"></path></svg></button>", ye = /* @__PURE__ */ new WeakMap(), be = /* @__PURE__ */ new WeakSet(), xe = () => Object.assign(/* @__PURE__ */ Error("The remote modal load was aborted."), { name: "AbortError" }), Se = (e) => {
|
|
272
272
|
let t = window.bootstrap?.Modal;
|
|
273
273
|
if (!t) throw Error(`WUI.modal.load(${String(e)}): Bootstrap's bundle (window.bootstrap) is not loaded on this page.`);
|
|
274
274
|
return t;
|
|
275
|
-
},
|
|
275
|
+
}, Ce = (e) => {
|
|
276
276
|
let t = document.createElement("span");
|
|
277
277
|
return t.textContent = e ?? "", t.innerHTML;
|
|
278
278
|
};
|
|
279
|
-
function
|
|
279
|
+
function we(e) {
|
|
280
280
|
if (e == null || e === "") return null;
|
|
281
281
|
if (e === "fullscreen") return { fullscreen: !0 };
|
|
282
|
-
if (Object.hasOwn(
|
|
282
|
+
if (Object.hasOwn(pe, e)) return { px: pe[e] };
|
|
283
283
|
let t = typeof e == "number" ? e : /^\d+$/.test(String(e)) ? Number(e) : NaN;
|
|
284
284
|
if (Number.isInteger(t) && t > 0) return { px: t };
|
|
285
285
|
throw TypeError(`Unsupported modal size "${String(e)}". Use sm, md, lg, xl, fullscreen or a px number.`);
|
|
286
286
|
}
|
|
287
|
-
var
|
|
287
|
+
var Te = (e) => {
|
|
288
288
|
if (e.classList.contains("wui-modal-fullscreen")) return { fullscreen: !0 };
|
|
289
289
|
let t = Number.parseInt(e.style.getPropertyValue("--wui-modal-max-width"), 10);
|
|
290
|
-
return { px: t > 0 ? t :
|
|
291
|
-
},
|
|
292
|
-
e.classList.toggle(
|
|
293
|
-
},
|
|
294
|
-
function
|
|
295
|
-
let e = document.getElementById(
|
|
296
|
-
return e || (e = document.createElement("div"), e.id =
|
|
297
|
-
}
|
|
298
|
-
var
|
|
290
|
+
return { px: t > 0 ? t : pe.md };
|
|
291
|
+
}, Ee = (e, t) => {
|
|
292
|
+
e.classList.toggle(fe, !!t.fullscreen), t.fullscreen ? e.style.removeProperty("--wui-modal-max-width") : e.style.setProperty("--wui-modal-max-width", `${t.px}px`);
|
|
293
|
+
}, De = ["center", "top"];
|
|
294
|
+
function Oe() {
|
|
295
|
+
let e = document.getElementById(de);
|
|
296
|
+
return e || (e = document.createElement("div"), e.id = de, e.className = "modal fade wui-modal-shell", e.tabIndex = -1, e.setAttribute("aria-hidden", "true"), e.setAttribute("role", "dialog"), e.setAttribute("aria-modal", "true"), e.style.setProperty("--wui-modal-max-width", `${pe.md}px`), e.innerHTML = "<div class=\"modal-dialog modal-dialog-centered wui-rb-dialog\"><div class=\"modal-content wui-modal\"></div></div>", document.body.appendChild(e), e);
|
|
297
|
+
}
|
|
298
|
+
var ke = (e) => `<div class="wui-modal-header"><div class="wui-modal-heading"><div class="wui-modal-headtext"><div class="wui-modal-title">${Ce(e)}</div></div></div>${ve}</div>`, Ae = (e) => `<div class="modal-content wui-modal" aria-busy="true">${ke(e)}<div class="wui-modal-body"><div class="wui-modal-loading" role="status"><span class="visually-hidden">${Ce(j.loading)}</span><div class="skeleton wui-modal-skeleton"></div><div class="skeleton wui-modal-skeleton"></div><div class="skeleton wui-modal-skeleton wui-modal-skeleton--short"></div></div></div></div>`, je = (e, t) => `<div class="modal-content wui-modal" data-wui-modal-error="${Ce(t)}">${ke(e)}<div class="wui-modal-body"><div class="wui-modal-state" role="alert"><p class="wui-modal-state-title">${Ce(j.errorTitle)}</p><p class="wui-modal-state-text">${Ce(j[t] || j.server)}</p><div class="wui-modal-state-actions"><button type="button" class="btn btn-secondary" data-bs-dismiss="modal">${Ce(j.close)}</button><button type="button" class="btn btn-primary" data-wui-modal-retry>${Ce(j.retry)}</button></div></div></div></div>`, Me = (e) => {
|
|
299
299
|
let t = document.createElement("template");
|
|
300
300
|
return t.innerHTML = e, t.content.querySelector(".modal-content");
|
|
301
|
-
},
|
|
302
|
-
function
|
|
301
|
+
}, Ne = (e) => e.shell.querySelector(".modal-content");
|
|
302
|
+
function Pe(e) {
|
|
303
303
|
if (!e) return;
|
|
304
304
|
e.dispatchEvent(new CustomEvent("wui:teardown", { bubbles: !0 }));
|
|
305
305
|
let t = window.bootstrap, n = [
|
|
@@ -309,51 +309,51 @@ function Ie(e) {
|
|
|
309
309
|
].filter((e) => e?.getInstance);
|
|
310
310
|
for (let t of [e, ...e.querySelectorAll("*")]) for (let e of n) e.getInstance(t)?.dispose();
|
|
311
311
|
}
|
|
312
|
-
function
|
|
313
|
-
let n =
|
|
314
|
-
|
|
312
|
+
function Fe(e, t) {
|
|
313
|
+
let n = Ne(e);
|
|
314
|
+
Pe(n), n ? n.replaceWith(t) : e.shell.querySelector(".modal-dialog").appendChild(t), window.WUI?.refresh?.();
|
|
315
315
|
}
|
|
316
|
-
var
|
|
317
|
-
function
|
|
318
|
-
let n = t && e.querySelector(
|
|
316
|
+
var Ie = (e) => e.shell.classList.contains("show");
|
|
317
|
+
function Le(e, t) {
|
|
318
|
+
let n = t && e.querySelector(he), r = n ? n.matches(me) ? n : n.querySelector(me) || n : null;
|
|
319
319
|
if (!r) {
|
|
320
|
-
let t = [...e.querySelectorAll(
|
|
320
|
+
let t = [...e.querySelectorAll(me)];
|
|
321
321
|
r = e.querySelector("[data-autofocus]") || t.find((e) => !e.classList.contains("wui-modal-close")) || t[0] || e;
|
|
322
322
|
}
|
|
323
323
|
r.focus?.();
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function Re(e, t) {
|
|
326
326
|
let n = e.shell.querySelector("[data-wui-modal-live]");
|
|
327
327
|
n || (n = document.createElement("div"), n.className = "visually-hidden", n.setAttribute("aria-live", "assertive"), n.setAttribute("data-wui-modal-live", ""), e.shell.querySelector(".modal-dialog").appendChild(n)), n.textContent = "", n.textContent = t;
|
|
328
328
|
}
|
|
329
|
-
var
|
|
329
|
+
var ze = (e, t, n) => e.dispatchEvent(new CustomEvent(t, {
|
|
330
330
|
bubbles: !0,
|
|
331
331
|
detail: n
|
|
332
332
|
}));
|
|
333
|
-
function
|
|
334
|
-
let t =
|
|
333
|
+
function Be(e) {
|
|
334
|
+
let t = ye.get(e);
|
|
335
335
|
return t || (t = {
|
|
336
336
|
shell: e,
|
|
337
|
-
queue:
|
|
338
|
-
defaultSize:
|
|
337
|
+
queue: ue(),
|
|
338
|
+
defaultSize: Te(e),
|
|
339
339
|
defaultLabel: e.getAttribute("aria-label"),
|
|
340
|
-
placeholder:
|
|
340
|
+
placeholder: Ne({ shell: e })?.outerHTML || "<div class=\"modal-content wui-modal\"></div>",
|
|
341
341
|
remoteUrl: e.getAttribute("data-wui-remote-url"),
|
|
342
342
|
cache: e.getAttribute("data-wui-remote-cache") === "true",
|
|
343
343
|
loadedUrl: null,
|
|
344
344
|
session: null
|
|
345
|
-
},
|
|
346
|
-
!e.target.closest?.("[data-wui-modal-retry]") || !t.session || (e.preventDefault(),
|
|
345
|
+
}, ye.set(e, t), e.addEventListener("submit", (e) => $e(t, e)), e.addEventListener("click", (e) => {
|
|
346
|
+
!e.target.closest?.("[data-wui-modal-retry]") || !t.session || (e.preventDefault(), Ke(t, t.session));
|
|
347
347
|
}), e.addEventListener("hidden.bs.modal", (n) => {
|
|
348
|
-
n.target === e &&
|
|
348
|
+
n.target === e && Ue(t);
|
|
349
349
|
}), e.addEventListener("shown.bs.modal", (n) => {
|
|
350
|
-
let r =
|
|
351
|
-
n.target === e && t.session && r?.matches(
|
|
350
|
+
let r = Ne(t);
|
|
351
|
+
n.target === e && t.session && r?.matches(_e) && !r.contains(document.activeElement) && Le(r, !1);
|
|
352
352
|
}), t.remoteUrl && e.addEventListener("show.bs.modal", (n) => {
|
|
353
|
-
n.target === e &&
|
|
353
|
+
n.target === e && We(t, n);
|
|
354
354
|
}), t);
|
|
355
355
|
}
|
|
356
|
-
function
|
|
356
|
+
function Ve(e, t, n) {
|
|
357
357
|
e.session && (e.queue.abort(), e.session.resolveClosed({
|
|
358
358
|
status: "dismissed",
|
|
359
359
|
detail: { replaced: !0 }
|
|
@@ -374,17 +374,17 @@ function Ue(e, t, n) {
|
|
|
374
374
|
return a.handle = {
|
|
375
375
|
el: e.shell,
|
|
376
376
|
closed: i,
|
|
377
|
-
close: () =>
|
|
378
|
-
reload: () =>
|
|
377
|
+
close: () => He(e, a, "dismissed", null),
|
|
378
|
+
reload: () => Ke(e, a)
|
|
379
379
|
}, e.session = a, a;
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function He(e, t, n, r) {
|
|
382
382
|
e.session === t && (t.closing = {
|
|
383
383
|
status: n,
|
|
384
384
|
detail: r
|
|
385
385
|
}, window.bootstrap?.Modal?.getOrCreateInstance(e.shell).hide());
|
|
386
386
|
}
|
|
387
|
-
function
|
|
387
|
+
function Ue(e) {
|
|
388
388
|
let t = e.session;
|
|
389
389
|
if (e.queue.abort(), e.session = null, t) {
|
|
390
390
|
let { status: n, detail: r } = t.closing || {
|
|
@@ -394,28 +394,28 @@ function Ge(e) {
|
|
|
394
394
|
t.resolveClosed({
|
|
395
395
|
status: n,
|
|
396
396
|
detail: r
|
|
397
|
-
}),
|
|
397
|
+
}), ze(e.shell, "wui:modal:closed", {
|
|
398
398
|
status: n,
|
|
399
399
|
url: t.url
|
|
400
400
|
});
|
|
401
401
|
let i = document.activeElement;
|
|
402
402
|
t.trigger?.isConnected && (!i || i === document.body || e.shell.contains(i)) && t.trigger.focus?.();
|
|
403
403
|
}
|
|
404
|
-
e.cache || (
|
|
404
|
+
e.cache || (Fe(e, Me(e.placeholder)), e.loadedUrl = null, Ee(e.shell, e.defaultSize), e.defaultLabel ? e.shell.setAttribute("aria-label", e.defaultLabel) : e.shell.removeAttribute("aria-label"));
|
|
405
405
|
}
|
|
406
|
-
function
|
|
407
|
-
let n = t.relatedTarget instanceof Element ? t.relatedTarget : null, r = n?.getAttribute("data-wui-url") || e.remoteUrl, i =
|
|
408
|
-
i.explicitSize =
|
|
406
|
+
function We(e, t) {
|
|
407
|
+
let n = t.relatedTarget instanceof Element ? t.relatedTarget : null, r = n?.getAttribute("data-wui-url") || e.remoteUrl, i = Ve(e, r, { trigger: n });
|
|
408
|
+
i.explicitSize = Ge(n?.getAttribute("data-wui-size")), i.explicitSize && Ee(e.shell, i.explicitSize), !(e.cache && e.loadedUrl === r) && (e.loadedUrl && Fe(e, Me(e.placeholder)), Ke(e, i, { keepPlaceholder: !0 }));
|
|
409
409
|
}
|
|
410
|
-
function
|
|
410
|
+
function Ge(e) {
|
|
411
411
|
try {
|
|
412
|
-
return
|
|
412
|
+
return we(e);
|
|
413
413
|
} catch (e) {
|
|
414
414
|
return console.error(e), null;
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
async function
|
|
418
|
-
n ||
|
|
417
|
+
async function Ke(e, t, { keepPlaceholder: n = !1 } = {}) {
|
|
418
|
+
n || Fe(e, Me(Ae(t.options.title || qe(e))));
|
|
419
419
|
let r = await e.queue.run(t.url, {
|
|
420
420
|
method: t.method,
|
|
421
421
|
body: t.body,
|
|
@@ -423,19 +423,19 @@ async function Je(e, t, { keepPlaceholder: n = !1 } = {}) {
|
|
|
423
423
|
});
|
|
424
424
|
if (e.session !== t || r.kind === "aborted" || r.kind === "stale") return "aborted";
|
|
425
425
|
if (r.kind === "session") return "session";
|
|
426
|
-
if ((r.kind === "ok" || r.kind === "validation") &&
|
|
426
|
+
if ((r.kind === "ok" || r.kind === "validation") && Je(e, t, r.html, !1)) return e.loadedUrl = t.url, ze(e.shell, "wui:modal:loaded", {
|
|
427
427
|
url: t.url,
|
|
428
428
|
handle: t.handle
|
|
429
429
|
}), "loaded";
|
|
430
430
|
let i = r.kind === "ok" || r.kind === "validation" ? "server" : r.kind;
|
|
431
|
-
return
|
|
431
|
+
return Fe(e, Me(je(t.options.title || qe(e), i))), Ie(e) && Le(Ne(e), !1), ze(e.shell, "wui:modal:error", {
|
|
432
432
|
url: t.url,
|
|
433
433
|
kind: i,
|
|
434
434
|
status: r.status
|
|
435
435
|
}), "error";
|
|
436
436
|
}
|
|
437
|
-
var
|
|
438
|
-
function
|
|
437
|
+
var qe = (e) => Ne(e)?.querySelector(".wui-modal-title")?.textContent || e.shell.getAttribute("aria-label") || "";
|
|
438
|
+
function Je(e, t, n, r) {
|
|
439
439
|
let i = document.createElement("template");
|
|
440
440
|
i.innerHTML = n;
|
|
441
441
|
let a = i.content.querySelectorAll("script");
|
|
@@ -443,15 +443,15 @@ function Xe(e, t, n, r) {
|
|
|
443
443
|
console.warn(`WUI.modal: ${t.url} returned a fragment with script; it was removed. Keep page behaviour in the page.`);
|
|
444
444
|
for (let e of a) e.remove();
|
|
445
445
|
}
|
|
446
|
-
let o = i.content.querySelector(
|
|
446
|
+
let o = i.content.querySelector(_e);
|
|
447
447
|
if (!o) return console.error(`WUI.modal: ${t.url} did not answer with an <app-modal-content> fragment.`), !1;
|
|
448
|
-
|
|
448
|
+
Fe(e, o), Ee(e.shell, t.explicitSize || Ge(o.getAttribute("data-wui-size")) || e.defaultSize);
|
|
449
449
|
let s = o.getAttribute("data-wui-title");
|
|
450
|
-
return s && e.shell.setAttribute("aria-label", s),
|
|
450
|
+
return s && e.shell.setAttribute("aria-label", s), Ie(e) && Le(o, r), !0;
|
|
451
451
|
}
|
|
452
|
-
var
|
|
453
|
-
function
|
|
454
|
-
let r = [...e.elements].filter((e) => e.matches(
|
|
452
|
+
var Ye = "button[type=\"submit\"], button:not([type]), input[type=\"submit\"], input[type=\"image\"]";
|
|
453
|
+
function Xe(e, t, n) {
|
|
454
|
+
let r = [...e.elements].filter((e) => e.matches(Ye));
|
|
455
455
|
if (n) {
|
|
456
456
|
e.setAttribute("data-wui-submitting", "");
|
|
457
457
|
let n = t && r.includes(t) ? t : r[0];
|
|
@@ -462,45 +462,45 @@ function Qe(e, t, n) {
|
|
|
462
462
|
e.removeAttribute("data-wui-submitting");
|
|
463
463
|
for (let e of r) e.disabled = e.hasAttribute("data-wui-was-disabled"), e.removeAttribute("data-wui-was-disabled"), e.classList.remove("is-loading"), e.removeAttribute("aria-busy"), e.querySelector("[data-wui-submit-spinner]")?.remove();
|
|
464
464
|
}
|
|
465
|
-
function
|
|
465
|
+
function Ze(e, t, n) {
|
|
466
466
|
let r = t.closest(".wui-modal-body") || t;
|
|
467
467
|
r.querySelector("[data-wui-modal-submit-error]")?.remove();
|
|
468
468
|
let i = document.createElement("div");
|
|
469
|
-
i.className = "alert alert-danger wui-modal-submit-error", i.setAttribute("role", "alert"), i.setAttribute("data-wui-modal-submit-error", ""), i.textContent = `${
|
|
469
|
+
i.className = "alert alert-danger wui-modal-submit-error", i.setAttribute("role", "alert"), i.setAttribute("data-wui-modal-submit-error", ""), i.textContent = `${j.submitFailed} ${j[n] || j.server}`, r.prepend(i), Re(e, i.textContent);
|
|
470
470
|
}
|
|
471
|
-
var
|
|
471
|
+
var Qe = (e, t) => {
|
|
472
472
|
let n = new URL(e, window.location.href);
|
|
473
473
|
for (let [e, r] of t) typeof r == "string" && n.searchParams.append(e, r);
|
|
474
474
|
return n.origin === window.location.origin ? n.pathname + n.search : n.href;
|
|
475
475
|
};
|
|
476
|
-
async function
|
|
476
|
+
async function $e(e, t) {
|
|
477
477
|
let n = t.target, r = e.session;
|
|
478
|
-
if (!(n instanceof HTMLFormElement) || !r || n.hasAttribute("data-wui-native") || !n.closest(
|
|
478
|
+
if (!(n instanceof HTMLFormElement) || !r || n.hasAttribute("data-wui-native") || !n.closest(_e) || (t.preventDefault(), n.hasAttribute("data-wui-submitting"))) return;
|
|
479
479
|
let i = t.submitter || null, a = i?.getAttribute("formaction") || n.getAttribute("action") || r.url, o = (i?.getAttribute("formmethod") || n.getAttribute("method") || "GET").toUpperCase(), s = new FormData(n);
|
|
480
480
|
i?.name && !s.has(i.name) && s.append(i.name, i.value);
|
|
481
481
|
let c = o === "GET";
|
|
482
|
-
|
|
483
|
-
let l = await e.queue.run(c ?
|
|
482
|
+
Xe(n, i, !0);
|
|
483
|
+
let l = await e.queue.run(c ? Qe(a, s) : a, {
|
|
484
484
|
method: o,
|
|
485
485
|
body: c ? void 0 : s,
|
|
486
486
|
navigate: r.options.navigate
|
|
487
487
|
});
|
|
488
488
|
if (e.session === r) {
|
|
489
|
-
if (n.isConnected &&
|
|
490
|
-
|
|
489
|
+
if (n.isConnected && Xe(n, i, !1), l.kind === "ok" && l.result === "success") {
|
|
490
|
+
et(e, r, l);
|
|
491
491
|
return;
|
|
492
492
|
}
|
|
493
493
|
if (!(l.kind === "aborted" || l.kind === "stale" || l.kind === "session")) {
|
|
494
|
-
if (l.kind === "validation" &&
|
|
495
|
-
let t =
|
|
496
|
-
|
|
494
|
+
if (l.kind === "validation" && Je(e, r, l.html, !0)) {
|
|
495
|
+
let t = Ne(e).querySelector(ge)?.textContent.replace(/\s+/g, " ").trim();
|
|
496
|
+
Re(e, t || j.invalid);
|
|
497
497
|
return;
|
|
498
498
|
}
|
|
499
|
-
l.kind === "ok" && l.html &&
|
|
499
|
+
l.kind === "ok" && l.html && Je(e, r, l.html, !1) || Ze(e, n, l.kind === "ok" || l.kind === "validation" ? "server" : l.kind);
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
|
-
function
|
|
503
|
+
function et(e, t, n) {
|
|
504
504
|
let r = n.message, i = n.redirect || null, a = {
|
|
505
505
|
url: t.url,
|
|
506
506
|
trigger: t.trigger,
|
|
@@ -508,15 +508,15 @@ function nt(e, t, n) {
|
|
|
508
508
|
message: r,
|
|
509
509
|
redirect: i
|
|
510
510
|
};
|
|
511
|
-
if (r && window.WUI?.toast?.(r, { variant: "success" }),
|
|
512
|
-
n.html &&
|
|
511
|
+
if (r && window.WUI?.toast?.(r, { variant: "success" }), ze(t.trigger?.isConnected ? t.trigger : document, "wui:modal:success", a), t.options.onSuccess?.(a, t.handle), i && (t.options.navigate || ((e) => window.location.assign(e)))(i), n.keepOpen) {
|
|
512
|
+
n.html && Je(e, t, n.html, !1);
|
|
513
513
|
return;
|
|
514
514
|
}
|
|
515
|
-
|
|
515
|
+
He(e, t, "success", a);
|
|
516
516
|
}
|
|
517
|
-
function
|
|
517
|
+
function tt(e) {
|
|
518
518
|
let t = e.target.closest?.("[data-wui-modal]");
|
|
519
|
-
t && (t.matches("a[href]") && (e.ctrlKey || e.metaKey || e.shiftKey || e.button !== 0) || (e.preventDefault(),
|
|
519
|
+
t && (t.matches("a[href]") && (e.ctrlKey || e.metaKey || e.shiftKey || e.button !== 0) || (e.preventDefault(), rt(t.getAttribute("data-wui-modal"), {
|
|
520
520
|
size: t.getAttribute("data-wui-size") || void 0,
|
|
521
521
|
title: t.getAttribute("data-wui-title") || void 0,
|
|
522
522
|
trigger: t
|
|
@@ -524,34 +524,34 @@ function rt(e) {
|
|
|
524
524
|
e?.name !== "AbortError" && console.error(e);
|
|
525
525
|
})));
|
|
526
526
|
}
|
|
527
|
-
function
|
|
527
|
+
function nt(e = document) {
|
|
528
528
|
let t = e.ownerDocument || e;
|
|
529
|
-
|
|
529
|
+
be.has(t) || (be.add(t), t.addEventListener("click", tt));
|
|
530
530
|
let n = [...e.querySelectorAll?.(".modal[data-wui-remote-url]") || []];
|
|
531
531
|
e.matches?.(".modal[data-wui-remote-url]") && n.unshift(e);
|
|
532
|
-
for (let e of n)
|
|
532
|
+
for (let e of n) Be(e);
|
|
533
533
|
}
|
|
534
|
-
function
|
|
534
|
+
function rt(e, t = {}) {
|
|
535
535
|
try {
|
|
536
536
|
if (!e) throw TypeError("WUI.modal.load: a fragment url is required.");
|
|
537
|
-
let n =
|
|
538
|
-
if (!
|
|
539
|
-
if (t.signal?.aborted) return Promise.reject(
|
|
540
|
-
let a =
|
|
541
|
-
|
|
542
|
-
let o =
|
|
543
|
-
c.explicitSize = r,
|
|
537
|
+
let n = Se(e), r = we(t.size), i = t.placement || "center";
|
|
538
|
+
if (!De.includes(i)) throw TypeError(`WUI.modal.load: unsupported placement "${i}". Use center or top.`);
|
|
539
|
+
if (t.signal?.aborted) return Promise.reject(xe());
|
|
540
|
+
let a = Oe();
|
|
541
|
+
nt(document);
|
|
542
|
+
let o = Be(a), s = Ie(o), c = Ve(o, e, t);
|
|
543
|
+
c.explicitSize = r, Ee(a, r || o.defaultSize), a.querySelector(".modal-dialog").classList.toggle("modal-dialog-centered", i === "center"), t.title && a.setAttribute("aria-label", t.title), s || (n.getInstance(a)?.dispose(), n.getOrCreateInstance(a, {
|
|
544
544
|
backdrop: !t.staticBackdrop || "static",
|
|
545
545
|
keyboard: !t.staticBackdrop
|
|
546
546
|
}));
|
|
547
|
-
let l = s ? Promise.resolve() : new Promise((e) => a.addEventListener("shown.bs.modal", () => e(), { once: !0 })), u =
|
|
547
|
+
let l = s ? Promise.resolve() : new Promise((e) => a.addEventListener("shown.bs.modal", () => e(), { once: !0 })), u = Ke(o, c);
|
|
548
548
|
s || n.getOrCreateInstance(a).show();
|
|
549
549
|
let d = new Promise((e, n) => {
|
|
550
550
|
t.signal?.addEventListener("abort", () => {
|
|
551
|
-
o.session === c && (o.queue.abort(),
|
|
551
|
+
o.session === c && (o.queue.abort(), He(o, c, "dismissed", { aborted: !0 })), n(xe());
|
|
552
552
|
}, { once: !0 });
|
|
553
553
|
}), f = Promise.all([l, u]).then(([, t]) => {
|
|
554
|
-
if (t === "aborted") throw
|
|
554
|
+
if (t === "aborted") throw xe();
|
|
555
555
|
if (t === "session") throw Error(`WUI.modal.load(${e}): the session expired; the browser is signing in again.`);
|
|
556
556
|
return c.handle;
|
|
557
557
|
});
|
|
@@ -562,18 +562,18 @@ function at(e, t = {}) {
|
|
|
562
562
|
}
|
|
563
563
|
//#endregion
|
|
564
564
|
//#region src/kanban.js
|
|
565
|
-
var
|
|
565
|
+
var it = Object.freeze([
|
|
566
566
|
"neutral",
|
|
567
567
|
"primary",
|
|
568
568
|
"info",
|
|
569
569
|
"success",
|
|
570
570
|
"warning",
|
|
571
571
|
"danger"
|
|
572
|
-
]),
|
|
572
|
+
]), at = Object.freeze([
|
|
573
573
|
"number",
|
|
574
574
|
"currency",
|
|
575
575
|
"compact"
|
|
576
|
-
]),
|
|
576
|
+
]), ot = "wui-kanban:", st = "(max-width: 767.98px)", ct = 400, lt = 6, M = Object.freeze({
|
|
577
577
|
help: "Press Space to pick up the card. Use the Left and Right arrow keys to choose a column, then Space to drop it, or Escape to cancel.",
|
|
578
578
|
empty: "Nothing here",
|
|
579
579
|
collapse: (e) => `Collapse ${e}`,
|
|
@@ -597,16 +597,16 @@ var ot = Object.freeze([
|
|
|
597
597
|
server: "Something went wrong on our side, so the card went back. Try again in a moment.",
|
|
598
598
|
network: "Could not reach the server, so the card went back. Check your connection and try again."
|
|
599
599
|
})
|
|
600
|
-
}),
|
|
601
|
-
function
|
|
600
|
+
}), ut = "[data-wui-column]", dt = "[data-wui-body]", ft = "[data-wui-card]", pt = "[data-wui-count]", mt = "[data-wui-summary]", ht = "[data-wui-empty]", gt = "[data-wui-drop-note]", _t = "[data-wui-live]", vt = "[data-wui-help]", yt = "[data-wui-switch]", bt = "[data-wui-scroller]", xt = "[data-wui-collapse]", St = "input, select, textarea, [contenteditable=\"\"], [contenteditable=\"true\"], [data-wui-no-drag]", Ct = 48, wt = 16, N = (e) => e.getAttribute("data-wui-column"), Tt = (e) => e.getAttribute("data-wui-card"), Et = (e) => e.hidden || e.hasAttribute("hidden");
|
|
601
|
+
function P(e) {
|
|
602
602
|
let t = (e.getAttribute("aria-label") || e.textContent || "").replace(/\s+/g, " ").trim();
|
|
603
|
-
return t.length > 80 ? `${t.slice(0, 79)}…` : t ||
|
|
603
|
+
return t.length > 80 ? `${t.slice(0, 79)}…` : t || Tt(e) || "Card";
|
|
604
604
|
}
|
|
605
|
-
function
|
|
606
|
-
return e ? `${
|
|
605
|
+
function Dt(e) {
|
|
606
|
+
return e ? `${ot}${e}` : null;
|
|
607
607
|
}
|
|
608
|
-
function
|
|
609
|
-
let n =
|
|
608
|
+
function Ot(e, t = globalThis.localStorage) {
|
|
609
|
+
let n = Dt(e);
|
|
610
610
|
if (!n || !t) return {};
|
|
611
611
|
try {
|
|
612
612
|
let e = JSON.parse(t.getItem(n) || "null");
|
|
@@ -615,19 +615,19 @@ function At(e, t = globalThis.localStorage) {
|
|
|
615
615
|
return {};
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
|
-
function
|
|
619
|
-
let i =
|
|
618
|
+
function kt(e, t, n, r = globalThis.localStorage) {
|
|
619
|
+
let i = Dt(e);
|
|
620
620
|
if (!i || !r) return;
|
|
621
621
|
let a = {
|
|
622
|
-
...
|
|
622
|
+
...Ot(e, r),
|
|
623
623
|
[t]: !!n
|
|
624
624
|
};
|
|
625
625
|
try {
|
|
626
626
|
r.setItem(i, JSON.stringify({ collapsed: a }));
|
|
627
627
|
} catch {}
|
|
628
628
|
}
|
|
629
|
-
function
|
|
630
|
-
if (!
|
|
629
|
+
function At(e, t) {
|
|
630
|
+
if (!at.includes(e)) throw TypeError(`Unsupported kanban summary format "${String(e)}". Use ${at.join(", ")}.`);
|
|
631
631
|
if (t != null && t !== "" && !r.includes(t)) throw TypeError(`Unsupported kanban summary unit "${String(t)}". Use ${r.join(", ")}.`);
|
|
632
632
|
return e === "currency" ? {
|
|
633
633
|
style: "currency",
|
|
@@ -641,7 +641,7 @@ function Mt(e, t) {
|
|
|
641
641
|
decimals: 0
|
|
642
642
|
};
|
|
643
643
|
}
|
|
644
|
-
function
|
|
644
|
+
function jt(e) {
|
|
645
645
|
let t = 0;
|
|
646
646
|
for (let n of e) {
|
|
647
647
|
if (n == null || n === "") continue;
|
|
@@ -650,9 +650,9 @@ function Nt(e) {
|
|
|
650
650
|
}
|
|
651
651
|
return t;
|
|
652
652
|
}
|
|
653
|
-
var
|
|
653
|
+
var Mt = (e, t) => {
|
|
654
654
|
e && window.WUI?.toast?.(e, { variant: t });
|
|
655
|
-
},
|
|
655
|
+
}, Nt = class extends e {
|
|
656
656
|
constructor() {
|
|
657
657
|
super(), this._wired = !1, this._filter = null, this._press = null, this._drag = null, this._kbd = null, this._suppressClick = !1, this._observer = null, this._refreshQueued = !1, this._scrollTimer = 0, this._onPointerMove = (e) => this._pointerMove(e), this._onPointerUp = (e) => this._pointerUp(e), this._onPointerCancel = () => this._endPointer(!1), this._onDocKeyDown = (e) => {
|
|
658
658
|
e.key === "Escape" && this._drag && (e.preventDefault(), this._endPointer(!1));
|
|
@@ -666,17 +666,17 @@ var Pt = (e, t) => {
|
|
|
666
666
|
connectedCallback() {
|
|
667
667
|
if (!this._wired) {
|
|
668
668
|
this._wired = !0, this.addEventListener("pointerdown", (e) => this._pointerDown(e)), this.addEventListener("keydown", (e) => this._keyDown(e)), this.addEventListener("click", (e) => this._click(e), !0), this.addEventListener("dragstart", (e) => {
|
|
669
|
-
e.target.closest?.(
|
|
669
|
+
e.target.closest?.(ft) && e.preventDefault();
|
|
670
670
|
}), this.addEventListener("touchmove", (e) => {
|
|
671
671
|
this._drag && e.preventDefault();
|
|
672
672
|
}, { passive: !1 }), this._scroller()?.addEventListener("scroll", this._onScroll, { passive: !0 }), this._restoreCollapsed();
|
|
673
673
|
for (let e of this._allCards()) this._prepareCard(e);
|
|
674
674
|
if (typeof MutationObserver == "function") {
|
|
675
675
|
this._observer = new MutationObserver((e) => {
|
|
676
|
-
for (let t of e) for (let e of t.addedNodes) e.nodeType === 1 && e.matches(
|
|
676
|
+
for (let t of e) for (let e of t.addedNodes) e.nodeType === 1 && e.matches(ft) && this._prepareCard(e);
|
|
677
677
|
this._queueRefresh();
|
|
678
678
|
});
|
|
679
|
-
for (let e of this.querySelectorAll(
|
|
679
|
+
for (let e of this.querySelectorAll(dt)) this._observer.observe(e, { childList: !0 });
|
|
680
680
|
}
|
|
681
681
|
this.refresh();
|
|
682
682
|
}
|
|
@@ -695,13 +695,13 @@ var Pt = (e, t) => {
|
|
|
695
695
|
let e = this._summaryFormat();
|
|
696
696
|
for (let t of this._columns()) {
|
|
697
697
|
let n = 0, r = [];
|
|
698
|
-
for (let e of this._cardsIn(t)) this._filter && (e.hidden = this._filter(e) === !1), !
|
|
698
|
+
for (let e of this._cardsIn(t)) this._filter && (e.hidden = this._filter(e) === !1), !Et(e) && (n++, r.push(e.getAttribute("data-wui-value")));
|
|
699
699
|
let i = String(n);
|
|
700
700
|
for (let e of this._countsOf(t)) e.textContent !== i && (e.textContent = i);
|
|
701
|
-
let a = t.querySelector(
|
|
701
|
+
let a = t.querySelector(ht);
|
|
702
702
|
if (a && (a.hidden = n > 0), e) {
|
|
703
|
-
let n = t.querySelector(
|
|
704
|
-
n && (n.textContent =
|
|
703
|
+
let n = t.querySelector(mt);
|
|
704
|
+
n && (n.textContent = re(jt(r), e));
|
|
705
705
|
}
|
|
706
706
|
}
|
|
707
707
|
}
|
|
@@ -712,43 +712,43 @@ var Pt = (e, t) => {
|
|
|
712
712
|
return this._commit(r, t, n);
|
|
713
713
|
}
|
|
714
714
|
_columns() {
|
|
715
|
-
return [...this.querySelectorAll(
|
|
715
|
+
return [...this.querySelectorAll(ut)];
|
|
716
716
|
}
|
|
717
717
|
_columnByKey(e) {
|
|
718
|
-
return this._columns().find((t) =>
|
|
718
|
+
return this._columns().find((t) => N(t) === e) || null;
|
|
719
719
|
}
|
|
720
720
|
_columnOf(e) {
|
|
721
|
-
return e.closest(
|
|
721
|
+
return e.closest(ut);
|
|
722
722
|
}
|
|
723
723
|
_titleOf(e) {
|
|
724
|
-
return (e.querySelector(".wui-kanban-title")?.textContent ||
|
|
724
|
+
return (e.querySelector(".wui-kanban-title")?.textContent || N(e) || "").replace(/\s+/g, " ").trim();
|
|
725
725
|
}
|
|
726
726
|
_bodyOf(e) {
|
|
727
|
-
return e.querySelector(
|
|
727
|
+
return e.querySelector(dt);
|
|
728
728
|
}
|
|
729
729
|
_cardsIn(e) {
|
|
730
730
|
let t = this._bodyOf(e);
|
|
731
|
-
return t ? [...t.children].filter((e) => e.matches(
|
|
731
|
+
return t ? [...t.children].filter((e) => e.matches(ft)) : [];
|
|
732
732
|
}
|
|
733
733
|
_visibleCardsIn(e) {
|
|
734
|
-
return this._cardsIn(e).filter((e) => !
|
|
734
|
+
return this._cardsIn(e).filter((e) => !Et(e));
|
|
735
735
|
}
|
|
736
736
|
_allCards() {
|
|
737
|
-
return [...this.querySelectorAll(`${
|
|
737
|
+
return [...this.querySelectorAll(`${dt} > ${ft}`)];
|
|
738
738
|
}
|
|
739
739
|
_cardByKey(e) {
|
|
740
|
-
return this._allCards().find((t) =>
|
|
740
|
+
return this._allCards().find((t) => Tt(t) === e) || null;
|
|
741
741
|
}
|
|
742
742
|
_countsOf(e) {
|
|
743
|
-
let t =
|
|
744
|
-
return [...e.querySelectorAll(
|
|
743
|
+
let t = N(e), n = [...this.querySelectorAll(yt)].filter((e) => e.getAttribute("data-wui-switch") === t);
|
|
744
|
+
return [...e.querySelectorAll(pt), ...n.flatMap((e) => [...e.querySelectorAll(pt)])];
|
|
745
745
|
}
|
|
746
746
|
_scroller() {
|
|
747
|
-
return this.querySelector(
|
|
747
|
+
return this.querySelector(bt);
|
|
748
748
|
}
|
|
749
749
|
_summaryFormat() {
|
|
750
750
|
let e = this.getAttribute("summary-format");
|
|
751
|
-
return e ?
|
|
751
|
+
return e ? At(e, this.getAttribute("summary-unit")) : null;
|
|
752
752
|
}
|
|
753
753
|
_queueRefresh() {
|
|
754
754
|
this._refreshQueued || (this._refreshQueued = !0, queueMicrotask(() => {
|
|
@@ -756,11 +756,11 @@ var Pt = (e, t) => {
|
|
|
756
756
|
}));
|
|
757
757
|
}
|
|
758
758
|
_prepareCard(e) {
|
|
759
|
-
let t = this.querySelector(
|
|
759
|
+
let t = this.querySelector(vt);
|
|
760
760
|
t?.id && !e.hasAttribute("aria-describedby") && e.setAttribute("aria-describedby", t.id), e.hasAttribute("tabindex") || (e.tabIndex = 0);
|
|
761
761
|
}
|
|
762
762
|
_announce(e) {
|
|
763
|
-
let t = this.querySelector(
|
|
763
|
+
let t = this.querySelector(_t);
|
|
764
764
|
!t || !e || (t.textContent = "", t.textContent = e);
|
|
765
765
|
}
|
|
766
766
|
_fire(e, t, n = !1) {
|
|
@@ -771,8 +771,8 @@ var Pt = (e, t) => {
|
|
|
771
771
|
}));
|
|
772
772
|
}
|
|
773
773
|
_canLift(e) {
|
|
774
|
-
let t =
|
|
775
|
-
return this.hasAttribute("readonly") || e.hasAttribute("data-wui-locked") ? (this._announce(
|
|
774
|
+
let t = P(e);
|
|
775
|
+
return this.hasAttribute("readonly") || e.hasAttribute("data-wui-locked") ? (this._announce(M.locked(t)), !1) : e.getAttribute("aria-busy") === "true" ? (this._announce(M.busy), Mt(M.busy, "info"), !1) : !0;
|
|
776
776
|
}
|
|
777
777
|
_check(e, t, n) {
|
|
778
778
|
if (t === n) return {
|
|
@@ -780,7 +780,7 @@ var Pt = (e, t) => {
|
|
|
780
780
|
source: !0,
|
|
781
781
|
reason: null
|
|
782
782
|
};
|
|
783
|
-
let r = this._columnByKey(t), i = this._columnByKey(n), a =
|
|
783
|
+
let r = this._columnByKey(t), i = this._columnByKey(n), a = M.refused(r ? this._titleOf(r) : t, i ? this._titleOf(i) : n), o = i?.getAttribute("data-accept-from");
|
|
784
784
|
if (o != null && !o.split(/\s+/).filter(Boolean).includes(t)) return {
|
|
785
785
|
ok: !1,
|
|
786
786
|
reason: a
|
|
@@ -802,35 +802,35 @@ var Pt = (e, t) => {
|
|
|
802
802
|
};
|
|
803
803
|
}
|
|
804
804
|
_markTargets(e, t) {
|
|
805
|
-
let n =
|
|
805
|
+
let n = P(e), r = /* @__PURE__ */ new Map();
|
|
806
806
|
for (let i of this._columns()) {
|
|
807
|
-
let a =
|
|
807
|
+
let a = N(i), o = this._check(e, t, a);
|
|
808
808
|
r.set(a, o), i.setAttribute("data-wui-drop", o.source ? "source" : o.ok ? "ok" : "refused");
|
|
809
|
-
let s = i.querySelector(
|
|
810
|
-
s && !o.source && (s.textContent = o.ok ?
|
|
809
|
+
let s = i.querySelector(gt);
|
|
810
|
+
s && !o.source && (s.textContent = o.ok ? M.dropHere(n, this._titleOf(i)) : o.reason, s.hidden = !1);
|
|
811
811
|
}
|
|
812
812
|
return r;
|
|
813
813
|
}
|
|
814
814
|
_clearTargets() {
|
|
815
815
|
for (let e of this._columns()) {
|
|
816
816
|
e.removeAttribute("data-wui-drop"), e.removeAttribute("data-wui-over"), e.removeAttribute("data-wui-target");
|
|
817
|
-
let t = e.querySelector(
|
|
817
|
+
let t = e.querySelector(gt);
|
|
818
818
|
t && (t.hidden = !0, t.textContent = "");
|
|
819
819
|
}
|
|
820
820
|
}
|
|
821
821
|
async _commit(e, t, n) {
|
|
822
|
-
let r = this._columnOf(e), i =
|
|
822
|
+
let r = this._columnOf(e), i = N(r), a = this._columnByKey(t), o = P(e);
|
|
823
823
|
if (i === t || !this._canLift(e)) return !1;
|
|
824
824
|
let s = this._check(e, i, t);
|
|
825
|
-
if (!s.ok) return this._announce(s.reason),
|
|
825
|
+
if (!s.ok) return this._announce(s.reason), Mt(s.reason, "info"), !1;
|
|
826
826
|
let c = this._cardsIn(a), l = Number.isInteger(n) ? Math.max(0, Math.min(n, c.length)) : c.length, u = {
|
|
827
|
-
key:
|
|
827
|
+
key: Tt(e),
|
|
828
828
|
card: e,
|
|
829
829
|
from: i,
|
|
830
830
|
to: t,
|
|
831
831
|
index: l
|
|
832
832
|
}, d = e.contains(document.activeElement);
|
|
833
|
-
if (this._controlled()) return this._fire("wui:kanban:move", u), this._announce(
|
|
833
|
+
if (this._controlled()) return this._fire("wui:kanban:move", u), this._announce(M.moved(o, this._titleOf(a))), d && this._refocusSoon(u.key), !0;
|
|
834
834
|
if (!this._fire("wui:kanban:move", u, !0)) return !1;
|
|
835
835
|
let f = {
|
|
836
836
|
parent: e.parentNode,
|
|
@@ -841,12 +841,12 @@ var Pt = (e, t) => {
|
|
|
841
841
|
let p = a.getAttribute("data-wui-step");
|
|
842
842
|
if (p) return this._runStep(e, u, f, p, a.getAttribute("data-wui-step-size"));
|
|
843
843
|
let m = this.getAttribute("move-url");
|
|
844
|
-
if (!m) return this._announce(
|
|
844
|
+
if (!m) return this._announce(M.moved(o, this._titleOf(a))), this._fire("wui:kanban:moved", {
|
|
845
845
|
...u,
|
|
846
846
|
result: null
|
|
847
847
|
}), !0;
|
|
848
|
-
this._lock(e, !0), this._announce(
|
|
849
|
-
let h = await
|
|
848
|
+
this._lock(e, !0), this._announce(M.saving(o, this._titleOf(a)));
|
|
849
|
+
let h = await A(m, {
|
|
850
850
|
method: "POST",
|
|
851
851
|
body: new URLSearchParams({
|
|
852
852
|
card: u.key,
|
|
@@ -858,13 +858,13 @@ var Pt = (e, t) => {
|
|
|
858
858
|
if (this._lock(e, !1), h.kind === "session") return !1;
|
|
859
859
|
if (h.ok) {
|
|
860
860
|
let t = this._applyFragment(h.html) || e;
|
|
861
|
-
return
|
|
861
|
+
return Mt(h.message, "success"), this._announce(M.moved(P(t), this._titleOf(a))), this._fire("wui:kanban:moved", {
|
|
862
862
|
...u,
|
|
863
863
|
card: t,
|
|
864
864
|
result: h
|
|
865
865
|
}), !0;
|
|
866
866
|
}
|
|
867
|
-
return this._rollback(e, f), h.kind !== "aborted" &&
|
|
867
|
+
return this._rollback(e, f), h.kind !== "aborted" && Mt(h.message || M.failed[h.kind] || M.failed.server, "danger"), this._fire("wui:kanban:failed", {
|
|
868
868
|
...u,
|
|
869
869
|
kind: h.kind,
|
|
870
870
|
status: h.status,
|
|
@@ -872,7 +872,7 @@ var Pt = (e, t) => {
|
|
|
872
872
|
}), !1;
|
|
873
873
|
}
|
|
874
874
|
async _runStep(e, t, n, r, i) {
|
|
875
|
-
let a =
|
|
875
|
+
let a = P(e), o = this._columnByKey(t.to), s = new URLSearchParams({
|
|
876
876
|
card: t.key,
|
|
877
877
|
from: t.from,
|
|
878
878
|
to: t.to
|
|
@@ -880,19 +880,19 @@ var Pt = (e, t) => {
|
|
|
880
880
|
this._lock(e, !0);
|
|
881
881
|
let l;
|
|
882
882
|
try {
|
|
883
|
-
l = await (await
|
|
883
|
+
l = await (await rt(c, {
|
|
884
884
|
trigger: e,
|
|
885
885
|
size: i || void 0
|
|
886
886
|
})).closed;
|
|
887
887
|
} catch (r) {
|
|
888
|
-
return this._lock(e, !1), this._rollback(e, n), r?.name !== "AbortError" &&
|
|
888
|
+
return this._lock(e, !1), this._rollback(e, n), r?.name !== "AbortError" && Mt(M.failed.server, "danger"), this._fire("wui:kanban:failed", {
|
|
889
889
|
...t,
|
|
890
890
|
kind: "step",
|
|
891
891
|
status: 0,
|
|
892
892
|
message: r?.message ?? null
|
|
893
893
|
}), !1;
|
|
894
894
|
}
|
|
895
|
-
if (l?.status !== "success") return this._lock(e, !1), this._rollback(e, n), this._announce(
|
|
895
|
+
if (l?.status !== "success") return this._lock(e, !1), this._rollback(e, n), this._announce(M.cancelled(a)), this._fire("wui:kanban:failed", {
|
|
896
896
|
...t,
|
|
897
897
|
kind: "dismissed",
|
|
898
898
|
status: 0,
|
|
@@ -900,10 +900,10 @@ var Pt = (e, t) => {
|
|
|
900
900
|
}), !1;
|
|
901
901
|
let u = e, d = this.getAttribute("card-url");
|
|
902
902
|
if (d) {
|
|
903
|
-
let n = await
|
|
903
|
+
let n = await A(`${d}${d.includes("?") ? "&" : "?"}${new URLSearchParams({ card: t.key })}`);
|
|
904
904
|
n.ok && (u = this._applyFragment(n.html) || e);
|
|
905
905
|
}
|
|
906
|
-
return this._lock(u, !1), this._announce(
|
|
906
|
+
return this._lock(u, !1), this._announce(M.moved(P(u), this._titleOf(o))), this._fire("wui:kanban:moved", {
|
|
907
907
|
...t,
|
|
908
908
|
card: u,
|
|
909
909
|
result: l
|
|
@@ -914,7 +914,7 @@ var Pt = (e, t) => {
|
|
|
914
914
|
}
|
|
915
915
|
_rollback(e, t) {
|
|
916
916
|
let n = e.contains(document.activeElement), r = t.next && t.next.parentNode === t.parent ? t.next : null;
|
|
917
|
-
t.parent.insertBefore(e, r), n && e.focus(), this.refresh(), this._announce(
|
|
917
|
+
t.parent.insertBefore(e, r), n && e.focus(), this.refresh(), this._announce(M.rolledBack(P(e), this._titleOf(t.column)));
|
|
918
918
|
}
|
|
919
919
|
_applyFragment(e) {
|
|
920
920
|
if (!e) return null;
|
|
@@ -922,14 +922,14 @@ var Pt = (e, t) => {
|
|
|
922
922
|
t.innerHTML = e;
|
|
923
923
|
for (let e of t.content.querySelectorAll("script")) console.warn("[@webority/ui-elements] A kanban fragment carried a script tag; it was removed, not run."), e.remove();
|
|
924
924
|
let n = null;
|
|
925
|
-
for (let e of [...t.content.querySelectorAll(
|
|
925
|
+
for (let e of [...t.content.querySelectorAll(ft)]) {
|
|
926
926
|
if (e.closest("template")) continue;
|
|
927
|
-
let t = this._cardByKey(
|
|
927
|
+
let t = this._cardByKey(Tt(e));
|
|
928
928
|
if (!t) continue;
|
|
929
929
|
let r = t.contains(document.activeElement);
|
|
930
930
|
t.dispatchEvent(new CustomEvent("wui:teardown", { bubbles: !0 })), t.hidden && (e.hidden = !0), t.replaceWith(e), this._prepareCard(e), r && e.focus(), n ??= e;
|
|
931
931
|
}
|
|
932
|
-
for (let e of t.content.querySelectorAll("template[data-wui-kanban-summary]")) this._columnByKey(e.getAttribute("data-wui-kanban-summary"))?.querySelector(
|
|
932
|
+
for (let e of t.content.querySelectorAll("template[data-wui-kanban-summary]")) this._columnByKey(e.getAttribute("data-wui-kanban-summary"))?.querySelector(mt)?.replaceChildren(e.content.cloneNode(!0));
|
|
933
933
|
return this.refresh(), window.WUI?.refresh?.(), n;
|
|
934
934
|
}
|
|
935
935
|
_refocusSoon(e) {
|
|
@@ -938,8 +938,8 @@ var Pt = (e, t) => {
|
|
|
938
938
|
}
|
|
939
939
|
_pointerDown(e) {
|
|
940
940
|
if (e.button !== 0 || e.isPrimary === !1 || this._drag || this._kbd) return;
|
|
941
|
-
let t = e.target.closest?.(
|
|
942
|
-
if (!t || !this.contains(t) || e.target.closest(
|
|
941
|
+
let t = e.target.closest?.(ft);
|
|
942
|
+
if (!t || !this.contains(t) || e.target.closest(St)) return;
|
|
943
943
|
let n = {
|
|
944
944
|
card: t,
|
|
945
945
|
id: e.pointerId,
|
|
@@ -975,7 +975,7 @@ var Pt = (e, t) => {
|
|
|
975
975
|
this._endPointer(!1);
|
|
976
976
|
return;
|
|
977
977
|
}
|
|
978
|
-
let i =
|
|
978
|
+
let i = N(this._columnOf(r)), a = r.getBoundingClientRect(), o = r.cloneNode(!0);
|
|
979
979
|
for (let e of [o, ...o.querySelectorAll("[id]")]) e.removeAttribute("id");
|
|
980
980
|
o.removeAttribute("data-wui-card"), o.removeAttribute("tabindex"), o.setAttribute("aria-hidden", "true"), o.classList.add("wui-kanban-ghost"), o.style.width = `${a.width}px`, this.appendChild(o), r.setAttribute("data-wui-dragging", ""), this.setAttribute("data-wui-dragging", ""), this._drag = {
|
|
981
981
|
card: r,
|
|
@@ -985,7 +985,7 @@ var Pt = (e, t) => {
|
|
|
985
985
|
dy: n - a.top,
|
|
986
986
|
over: null,
|
|
987
987
|
verdicts: this._markTargets(r, i)
|
|
988
|
-
}, this._announce(
|
|
988
|
+
}, this._announce(M.lifted(P(r), this._titleOf(this._columnOf(r)))), document.addEventListener("keydown", this._onDocKeyDown), this._dragTo(t, n);
|
|
989
989
|
}
|
|
990
990
|
_dragTo(e, t) {
|
|
991
991
|
let n = this._drag;
|
|
@@ -1011,10 +1011,10 @@ var Pt = (e, t) => {
|
|
|
1011
1011
|
let n = this._scroller();
|
|
1012
1012
|
if (n) {
|
|
1013
1013
|
let t = n.getBoundingClientRect();
|
|
1014
|
-
t.width > 0 && (e < t.left +
|
|
1014
|
+
t.width > 0 && (e < t.left + Ct ? n.scrollBy?.({ left: -16 }) : e > t.right - Ct && n.scrollBy?.({ left: wt }));
|
|
1015
1015
|
}
|
|
1016
1016
|
let r = window.innerHeight || 0;
|
|
1017
|
-
r > 0 && (t <
|
|
1017
|
+
r > 0 && (t < Ct ? window.scrollBy?.({ top: -16 }) : t > r - Ct && window.scrollBy?.({ top: wt }));
|
|
1018
1018
|
}
|
|
1019
1019
|
_endPointer(e) {
|
|
1020
1020
|
let t = this._press, n = this._drag;
|
|
@@ -1024,32 +1024,32 @@ var Pt = (e, t) => {
|
|
|
1024
1024
|
}, 0);
|
|
1025
1025
|
let r = n.over;
|
|
1026
1026
|
if (this._clearTargets(), !e || !r) {
|
|
1027
|
-
this._announce(
|
|
1027
|
+
this._announce(M.cancelled(P(n.card)));
|
|
1028
1028
|
return;
|
|
1029
1029
|
}
|
|
1030
|
-
let i =
|
|
1030
|
+
let i = N(r), a = n.verdicts.get(i);
|
|
1031
1031
|
if (a?.source) {
|
|
1032
|
-
this._announce(
|
|
1032
|
+
this._announce(M.cancelled(P(n.card)));
|
|
1033
1033
|
return;
|
|
1034
1034
|
}
|
|
1035
1035
|
if (!a?.ok) {
|
|
1036
|
-
this._announce(a?.reason),
|
|
1036
|
+
this._announce(a?.reason), Mt(a?.reason, "info");
|
|
1037
1037
|
return;
|
|
1038
1038
|
}
|
|
1039
1039
|
this._commit(n.card, i, this._indexAt(r, n.y));
|
|
1040
1040
|
}
|
|
1041
1041
|
_click(e) {
|
|
1042
|
-
if (this._suppressClick && e.target.closest?.(
|
|
1042
|
+
if (this._suppressClick && e.target.closest?.(ft)) {
|
|
1043
1043
|
e.preventDefault(), e.stopPropagation(), this._suppressClick = !1;
|
|
1044
1044
|
return;
|
|
1045
1045
|
}
|
|
1046
|
-
let t = e.target.closest?.(
|
|
1046
|
+
let t = e.target.closest?.(xt);
|
|
1047
1047
|
if (t && this.contains(t)) {
|
|
1048
|
-
let e = t.closest(
|
|
1048
|
+
let e = t.closest(ut);
|
|
1049
1049
|
e && this._setCollapsed(e, !e.hasAttribute("data-collapsed"), !0);
|
|
1050
1050
|
return;
|
|
1051
1051
|
}
|
|
1052
|
-
let n = e.target.closest?.(
|
|
1052
|
+
let n = e.target.closest?.(yt);
|
|
1053
1053
|
n && this.contains(n) && this._showColumn(n.getAttribute("data-wui-switch"));
|
|
1054
1054
|
}
|
|
1055
1055
|
_keyDown(e) {
|
|
@@ -1058,19 +1058,19 @@ var Pt = (e, t) => {
|
|
|
1058
1058
|
return;
|
|
1059
1059
|
}
|
|
1060
1060
|
let t = e.target;
|
|
1061
|
-
if (!t.matches?.(
|
|
1061
|
+
if (!t.matches?.(ft) || !this.contains(t)) return;
|
|
1062
1062
|
let n = this._columnOf(t);
|
|
1063
1063
|
switch (e.key) {
|
|
1064
1064
|
case " ":
|
|
1065
1065
|
case "Spacebar": {
|
|
1066
1066
|
if (e.preventDefault(), !this._canLift(t)) return;
|
|
1067
|
-
let r =
|
|
1067
|
+
let r = N(n), i = this._columns();
|
|
1068
1068
|
this._kbd = {
|
|
1069
1069
|
card: t,
|
|
1070
1070
|
from: r,
|
|
1071
1071
|
target: i.indexOf(n),
|
|
1072
1072
|
verdicts: this._markTargets(t, r)
|
|
1073
|
-
}, t.setAttribute("data-wui-lifted", ""), this.setAttribute("data-wui-dragging", ""), n.setAttribute("data-wui-target", ""), this._announce(
|
|
1073
|
+
}, t.setAttribute("data-wui-lifted", ""), this.setAttribute("data-wui-dragging", ""), n.setAttribute("data-wui-target", ""), this._announce(M.lifted(P(t), this._titleOf(n)));
|
|
1074
1074
|
return;
|
|
1075
1075
|
}
|
|
1076
1076
|
case "ArrowDown":
|
|
@@ -1104,26 +1104,26 @@ var Pt = (e, t) => {
|
|
|
1104
1104
|
if (r < 0 || r >= n.length) return;
|
|
1105
1105
|
n[t.target]?.removeAttribute("data-wui-target"), t.target = r;
|
|
1106
1106
|
let i = n[r];
|
|
1107
|
-
i.setAttribute("data-wui-target", ""), this._showColumn(
|
|
1108
|
-
let a = t.verdicts.get(
|
|
1109
|
-
this._announce(a.source ?
|
|
1107
|
+
i.setAttribute("data-wui-target", ""), this._showColumn(N(i), !1);
|
|
1108
|
+
let a = t.verdicts.get(N(i)), o = this._titleOf(i);
|
|
1109
|
+
this._announce(a.source ? M.overSource(o) : a.ok ? M.over(o, this._visibleCardsIn(i).length) : M.overRefused(o, a.reason));
|
|
1110
1110
|
return;
|
|
1111
1111
|
}
|
|
1112
1112
|
case " ":
|
|
1113
1113
|
case "Spacebar":
|
|
1114
1114
|
case "Enter": {
|
|
1115
1115
|
e.preventDefault();
|
|
1116
|
-
let r = n[t.target], i =
|
|
1116
|
+
let r = n[t.target], i = N(r), a = t.verdicts.get(i);
|
|
1117
1117
|
if (!a.source && !a.ok) {
|
|
1118
1118
|
this._announce(a.reason);
|
|
1119
1119
|
return;
|
|
1120
1120
|
}
|
|
1121
|
-
this._endKeyboard(), a.source ? this._announce(
|
|
1121
|
+
this._endKeyboard(), a.source ? this._announce(M.cancelled(P(t.card))) : this._commit(t.card, i);
|
|
1122
1122
|
return;
|
|
1123
1123
|
}
|
|
1124
1124
|
case "Escape":
|
|
1125
1125
|
case "Tab":
|
|
1126
|
-
e.key === "Escape" && e.preventDefault(), this._endKeyboard(), this._showColumn(t.from, !1), this._announce(
|
|
1126
|
+
e.key === "Escape" && e.preventDefault(), this._endKeyboard(), this._showColumn(t.from, !1), this._announce(M.cancelled(P(t.card)));
|
|
1127
1127
|
return;
|
|
1128
1128
|
default:
|
|
1129
1129
|
}
|
|
@@ -1133,18 +1133,18 @@ var Pt = (e, t) => {
|
|
|
1133
1133
|
this._kbd = null, e && (e.card.removeAttribute("data-wui-lifted"), this.removeAttribute("data-wui-dragging"), this._clearTargets());
|
|
1134
1134
|
}
|
|
1135
1135
|
_restoreCollapsed() {
|
|
1136
|
-
let e =
|
|
1136
|
+
let e = Ot(this.getAttribute("board-id"));
|
|
1137
1137
|
for (let t of this._columns()) {
|
|
1138
|
-
let n =
|
|
1138
|
+
let n = N(t);
|
|
1139
1139
|
t.hasAttribute("data-collapsible") && Object.hasOwn(e, n) && this._setCollapsed(t, e[n], !1);
|
|
1140
1140
|
}
|
|
1141
1141
|
}
|
|
1142
1142
|
_setCollapsed(e, t, n) {
|
|
1143
|
-
let r =
|
|
1143
|
+
let r = N(e);
|
|
1144
1144
|
e.toggleAttribute("data-collapsed", t);
|
|
1145
1145
|
let i = this._titleOf(e);
|
|
1146
|
-
for (let n of e.querySelectorAll(
|
|
1147
|
-
n && (
|
|
1146
|
+
for (let n of e.querySelectorAll(xt)) n.setAttribute("aria-expanded", t ? "false" : "true"), n.setAttribute("aria-label", t ? M.expand(i) : M.collapse(i));
|
|
1147
|
+
n && (kt(this.getAttribute("board-id"), r, t), this._fire("wui:kanban:collapse", {
|
|
1148
1148
|
column: r,
|
|
1149
1149
|
collapsed: t
|
|
1150
1150
|
}));
|
|
@@ -1153,7 +1153,7 @@ var Pt = (e, t) => {
|
|
|
1153
1153
|
return typeof matchMedia == "function" && matchMedia("(max-width: 767.98px)").matches;
|
|
1154
1154
|
}
|
|
1155
1155
|
_showColumn(e, t = !0) {
|
|
1156
|
-
for (let t of this.querySelectorAll(
|
|
1156
|
+
for (let t of this.querySelectorAll(yt)) t.getAttribute("data-wui-switch") === e ? t.setAttribute("aria-current", "true") : t.removeAttribute("aria-current");
|
|
1157
1157
|
let n = this._columnByKey(e), r = this._scroller();
|
|
1158
1158
|
if (!n || !r || !t && !this._isPhone()) return;
|
|
1159
1159
|
let i = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
@@ -1166,22 +1166,22 @@ var Pt = (e, t) => {
|
|
|
1166
1166
|
let e = this._scroller();
|
|
1167
1167
|
if (!e || !this._isPhone()) return;
|
|
1168
1168
|
let t = e.clientWidth || 1, n = this._columns()[Math.round(e.scrollLeft / t)];
|
|
1169
|
-
if (n) for (let e of this.querySelectorAll(
|
|
1169
|
+
if (n) for (let e of this.querySelectorAll(yt)) e.getAttribute("data-wui-switch") === N(n) ? e.setAttribute("aria-current", "true") : e.removeAttribute("aria-current");
|
|
1170
1170
|
}
|
|
1171
|
-
},
|
|
1171
|
+
}, Pt = {
|
|
1172
1172
|
delete: "data:image/webp;base64,UklGRh4RAABXRUJQVlA4WAoAAAAQAAAAFwEAFwEAQUxQSGwFAAABkFXbbh1JgiAIhmAIZjBhEDOIGcQMqhgkDKoZCE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Wxfw9VkBpfGf7i6Bbgs66Wye/7JqBPmILrCtvFFn79zTyvqti4sb+duZfvCbl1PmObAuucG5ncB2Y4elUVnt4FLft9DQFBeNiMJclD4NSC/tNDD7KSDmd7cch1U8YOIQmwRlrYERg+pTKmzf6RTr4mehEpJbHVMlOcVDc1dg0HIaBsh68tx3K3vYs992CzuhJOZ/cf7Zv1ejOz20h3syMqdF1jUbMRbPqp4/f96K+LV1etvLZBqsUhxLoE+A7xM84pGf81t5kJXj4toZTPSHYYYckG+KjLxi43PidMT+AsoGmiMXSj3MWLHijSkGQEOWaYr57efks///foUajtDcX2x8t3YwQonEo1mSXKKIjDVcxm0QdMn/n94fILJ8jpdG267h4zj4z1vgCEX2tiu01a3JueayBKehW9HfPGTqCF57Rujz/bsMolTAVaD6GonBUIyFxvInkIi2IM9G1N3XB1U3QEEGvP+CoxGSIAzwyGF57YiDt90pO7R94NP1ZankVp1dtEccWyzU9DrUI8iLKYeKwy6Gvokz/NZHnpQd6ehlmIduqYS27V0kM0LbdpYI0qLGlVFA22uCW61dbyfUDaur9N+Tw6rwH/kW97h8HUyAQCnXLSDNgFqRN/1Xgdp0r0dzKU7ImzaKzjS1tYxLXAf/kXCghSyLnGF+uTjhAAAAAA="
|
|
1177
|
-
},
|
|
1177
|
+
}, Ft = { error: "<rect width=\"174\" height=\"174\" rx=\"87\" fill=\"var(--wui-danger-5)\"/>\n<rect x=\"24\" y=\"24\" width=\"126\" height=\"126\" rx=\"63\" stroke=\"var(--wui-danger-20)\" stroke-width=\"16\"/>\n<g clip-path=\"url(#wui_error_clip0)\">\n<rect x=\"32\" y=\"32\" width=\"110\" height=\"110\" rx=\"55\" fill=\"var(--wui-danger)\"/>\n<rect x=\"110.758\" y=\"62\" width=\"75.5044\" height=\"69.9535\" transform=\"rotate(45 110.758 62)\" fill=\"var(--wui-danger-active)\"/>\n<g clip-path=\"url(#wui_error_clip1)\">\n<path d=\"M95.9285 87.0037L112.943 69.9887C114.823 68.1087 114.823 65.0608 112.943 63.1838L110.675 60.9155C108.795 59.0349 105.747 59.0349 103.87 60.9155L86.8552 77.9298L69.8403 60.9119C67.9603 59.032 64.9124 59.032 63.0353 60.9119L60.7635 63.1802C58.8835 65.0608 58.8835 68.1087 60.7635 69.9858L77.7814 87.0037L60.767 104.018C58.8865 105.899 58.8865 108.947 60.767 110.824L63.0353 113.092C64.9153 114.972 67.9632 114.972 69.8403 113.092L86.8552 96.0769L103.87 113.092C105.75 114.972 108.798 114.972 110.675 113.092L112.943 110.824C114.823 108.943 114.823 105.895 112.943 104.018L95.9285 87.0037Z\" fill=\"white\"/>\n</g>\n</g>\n<defs><clipPath id=\"wui_error_clip0\"><rect x=\"32\" y=\"32\" width=\"110\" height=\"110\" rx=\"55\" fill=\"white\"/></clipPath><clipPath id=\"wui_error_clip1\"><rect width=\"55\" height=\"55\" fill=\"white\" transform=\"translate(59.3535 59.502)\"/></clipPath></defs>" }, It = [
|
|
1178
1178
|
"success",
|
|
1179
1179
|
"error",
|
|
1180
1180
|
"warning",
|
|
1181
1181
|
"info",
|
|
1182
1182
|
"delete",
|
|
1183
1183
|
"primary"
|
|
1184
|
-
],
|
|
1184
|
+
], Lt = class extends e {
|
|
1185
1185
|
static get observedAttributes() {
|
|
1186
1186
|
return ["tone", "size"];
|
|
1187
1187
|
}
|
|
@@ -1192,67 +1192,67 @@ var Pt = (e, t) => {
|
|
|
1192
1192
|
this.isConnected && this.render();
|
|
1193
1193
|
}
|
|
1194
1194
|
render() {
|
|
1195
|
-
let e = this.getAttribute("tone"), t = Number.parseInt(this.getAttribute("size"), 10) || 72, n =
|
|
1195
|
+
let e = this.getAttribute("tone"), t = Number.parseInt(this.getAttribute("size"), 10) || 72, n = Ft[e];
|
|
1196
1196
|
if (n) {
|
|
1197
1197
|
this.innerHTML = `<svg width="${t}" height="${t}" viewBox="0 0 174 174" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">${n}</svg>`;
|
|
1198
1198
|
return;
|
|
1199
1199
|
}
|
|
1200
|
-
let r =
|
|
1200
|
+
let r = Pt[e] || Pt.info;
|
|
1201
1201
|
this.innerHTML = `<img src="${r}" width="${t}" height="${t}" alt="" aria-hidden="true" draggable="false" />`;
|
|
1202
1202
|
}
|
|
1203
|
-
},
|
|
1204
|
-
function
|
|
1203
|
+
}, F = 4, Rt = 300, zt = 400;
|
|
1204
|
+
function I(e, t, n = {}) {
|
|
1205
1205
|
if (!e || !t) return;
|
|
1206
1206
|
let r = e.getBoundingClientRect(), i = n.clampHeight ? t.scrollTop : 0;
|
|
1207
1207
|
n.clampHeight && (t.style.maxHeight = "");
|
|
1208
|
-
let a = t.offsetHeight, o = window.innerHeight - r.bottom, s = o < a +
|
|
1209
|
-
if (t.classList.toggle("drop-up", s), t.style.position = "fixed", t.style.top = s ? `${Math.max(
|
|
1210
|
-
let e = s ? r.top -
|
|
1208
|
+
let a = t.offsetHeight, o = window.innerHeight - r.bottom, s = o < a + F && r.top > o;
|
|
1209
|
+
if (t.classList.toggle("drop-up", s), t.style.position = "fixed", t.style.top = s ? `${Math.max(F, r.top - a - F)}px` : `${r.bottom + F}px`, n.clampHeight) {
|
|
1210
|
+
let e = s ? r.top - F * 2 : window.innerHeight - r.bottom - F * 2;
|
|
1211
1211
|
e < a && (t.style.maxHeight = `${Math.max(e, 0)}px`), t.scrollTop = i;
|
|
1212
1212
|
}
|
|
1213
|
-
n.matchWidth && (r.width >=
|
|
1214
|
-
let c = t.offsetWidth, l = Math.min(r.left, window.innerWidth - c -
|
|
1215
|
-
t.style.left = `${Math.max(
|
|
1213
|
+
n.matchWidth && (r.width >= Rt ? (t.style.minWidth = `${r.width}px`, t.style.width = `${r.width}px`, t.style.maxWidth = `${r.width}px`) : (t.style.minWidth = `${r.width}px`, t.style.width = "max-content", t.style.maxWidth = `${Math.min(zt, window.innerWidth - F * 2)}px`));
|
|
1214
|
+
let c = t.offsetWidth, l = Math.min(r.left, window.innerWidth - c - F);
|
|
1215
|
+
t.style.left = `${Math.max(F, l)}px`;
|
|
1216
1216
|
}
|
|
1217
|
-
function
|
|
1218
|
-
|
|
1217
|
+
function Bt(e, t) {
|
|
1218
|
+
L(e), e._reanchor = t, e._reanchorScroll = (n) => {
|
|
1219
1219
|
n.target instanceof Node && typeof e.contains == "function" && e.contains(n.target) || t();
|
|
1220
1220
|
}, window.addEventListener("resize", e._reanchor), window.addEventListener("scroll", e._reanchorScroll, !0);
|
|
1221
1221
|
}
|
|
1222
|
-
function
|
|
1222
|
+
function L(e) {
|
|
1223
1223
|
e?._reanchor && (window.removeEventListener("resize", e._reanchor), window.removeEventListener("scroll", e._reanchorScroll, !0), e._reanchor = null, e._reanchorScroll = null);
|
|
1224
1224
|
}
|
|
1225
1225
|
//#endregion
|
|
1226
1226
|
//#region src/formMirror.js
|
|
1227
|
-
var
|
|
1228
|
-
function
|
|
1227
|
+
var Vt = "data-wui-mirror";
|
|
1228
|
+
function Ht(e, t, n, r) {
|
|
1229
1229
|
t.name = n, t.value = r == null ? "" : String(r);
|
|
1230
1230
|
for (let n of [...t.attributes]) n.name.startsWith("data-val") && !e.hasAttribute(n.name) && t.removeAttribute(n.name);
|
|
1231
1231
|
for (let n of e.attributes) n.name.startsWith("data-val") && t.setAttribute(n.name, n.value);
|
|
1232
1232
|
t.disabled = e.hasAttribute("disabled");
|
|
1233
1233
|
}
|
|
1234
|
-
function
|
|
1234
|
+
function Ut(e) {
|
|
1235
1235
|
let t = document.createElement("input");
|
|
1236
|
-
return t.type = "hidden", t.setAttribute(
|
|
1236
|
+
return t.type = "hidden", t.setAttribute(Vt, ""), e.appendChild(t), t;
|
|
1237
1237
|
}
|
|
1238
|
-
function
|
|
1239
|
-
let n = e.getAttribute("name"), r = e.querySelector(`:scope > input[${
|
|
1238
|
+
function R(e, t) {
|
|
1239
|
+
let n = e.getAttribute("name"), r = e.querySelector(`:scope > input[${Vt}]`);
|
|
1240
1240
|
if (!n) {
|
|
1241
1241
|
r?.remove();
|
|
1242
1242
|
return;
|
|
1243
1243
|
}
|
|
1244
|
-
r ||=
|
|
1244
|
+
r ||= Ut(e), Ht(e, r, n, t);
|
|
1245
1245
|
}
|
|
1246
|
-
function
|
|
1247
|
-
let n = e.getAttribute("name"), r = [...e.querySelectorAll(`:scope > input[${
|
|
1248
|
-
for (let e of r.splice(
|
|
1249
|
-
|
|
1250
|
-
|
|
1246
|
+
function z(e, t) {
|
|
1247
|
+
let n = e.getAttribute("name"), r = [...e.querySelectorAll(`:scope > input[${Vt}]`)], i = [...e.attributes].some((e) => e.name.startsWith("data-val")), a = n ? t.length > 0 ? t : i ? [""] : [] : [];
|
|
1248
|
+
for (let e of r.splice(a.length)) e.remove();
|
|
1249
|
+
a.forEach((t, i) => {
|
|
1250
|
+
Ht(e, r[i] ?? Ut(e), n, t);
|
|
1251
1251
|
});
|
|
1252
1252
|
}
|
|
1253
1253
|
//#endregion
|
|
1254
1254
|
//#region src/iconGlyphs.g.js
|
|
1255
|
-
var
|
|
1255
|
+
var Wt = {
|
|
1256
1256
|
activity: "<path d=\"M9 22h6c5 0 7-2 7-7V9c0-5-2-7-7-7H9C4 2 2 4 2 9v6c0 5 2 7 7 7Z\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path><path d=\"m7.33 14.49 2.38-3.09c.34-.44.97-.52 1.41-.18l1.83 1.44c.44.34 1.07.26 1.41-.17l2.31-2.98\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>",
|
|
1257
1257
|
add: "<path d=\"M6 12h12M12 18V6\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>",
|
|
1258
1258
|
"add-circle": "<path d=\"M12 22c5.5 0 10-4.5 10-10S17.5 2 12 2 2 6.5 2 12s4.5 10 10 10ZM8 12h8M12 16V8\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>",
|
|
@@ -1459,14 +1459,14 @@ var qt = {
|
|
|
1459
1459
|
"zoom-in": "<path d=\"M11 20a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM8.5 11h5M11 13.5v-5M18.93 20.69c.53 1.6 1.74 1.76 2.67.36.85-1.28.29-2.33-1.25-2.33-1.14-.01-1.78.88-1.42 1.97Z\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>",
|
|
1460
1460
|
"zoom-out": "<path d=\"M9 11.7h5M11.5 21a9.5 9.5 0 1 0 0-19 9.5 9.5 0 0 0 0 19ZM22 22l-2-2\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>"
|
|
1461
1461
|
};
|
|
1462
|
-
Object.keys(
|
|
1463
|
-
function
|
|
1464
|
-
let i =
|
|
1462
|
+
Object.keys(Wt);
|
|
1463
|
+
function B(e, { size: t = 16, className: n = "", style: r = "" } = {}) {
|
|
1464
|
+
let i = Wt[e];
|
|
1465
1465
|
return i ? `<svg class="${n ? `wui-icon ${n}` : "wui-icon"}" data-icon="${e}" width="${t}" height="${t}" viewBox="0 0 24 24" fill="none" aria-hidden="true" style="vertical-align:-.125em${r ? `;${r}` : ""}">${i}</svg>` : "";
|
|
1466
1466
|
}
|
|
1467
1467
|
//#endregion
|
|
1468
1468
|
//#region src/listboxKeyNav.js
|
|
1469
|
-
function
|
|
1469
|
+
function Gt(e) {
|
|
1470
1470
|
let { getVisibleOptions: t, getActive: n, setActive: r, onEnter: i, onEscape: a, onTypeahead: o, typeaheadMs: s = 500 } = e, c = "", l = null, u = () => {
|
|
1471
1471
|
clearTimeout(l), l = null, c = "";
|
|
1472
1472
|
};
|
|
@@ -1497,18 +1497,18 @@ function Jt(e) {
|
|
|
1497
1497
|
}
|
|
1498
1498
|
//#endregion
|
|
1499
1499
|
//#region src/optionLabel.js
|
|
1500
|
-
var
|
|
1500
|
+
var Kt = Symbol("wui.trustedHtml"), V = (e) => String(e ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), qt = (e) => {
|
|
1501
1501
|
if (!e) return "";
|
|
1502
1502
|
let t = String(e).toLowerCase().replace(/[^a-z0-9-]/g, "");
|
|
1503
|
-
return t ?
|
|
1504
|
-
},
|
|
1503
|
+
return t ? B(t) : "";
|
|
1504
|
+
}, Jt = (e) => `wui-flag wui-flag-${e}`, Yt = (e) => {
|
|
1505
1505
|
let t = String(e ?? "").toLowerCase();
|
|
1506
|
-
return /^[a-z]{2}$/.test(t) ? `<span class="${
|
|
1507
|
-
},
|
|
1506
|
+
return /^[a-z]{2}$/.test(t) ? `<span class="${Jt(t)}" aria-hidden="true"></span>` : "";
|
|
1507
|
+
}, Xt = (e) => {
|
|
1508
1508
|
if (e == null) return "";
|
|
1509
|
-
let t = e[
|
|
1509
|
+
let t = e[Kt] ? String(e.label ?? "") : V(e.label), n = Yt(e.flag) + qt(e.icon);
|
|
1510
1510
|
return n ? `<span class="wui-opt-label">${n}${t}</span>` : t;
|
|
1511
|
-
},
|
|
1511
|
+
}, Zt = class extends e {
|
|
1512
1512
|
static formAssociated = !0;
|
|
1513
1513
|
_accessibleName() {
|
|
1514
1514
|
return this.getAttribute("aria-label") || this.getAttribute("placeholder") || "Select";
|
|
@@ -1567,14 +1567,14 @@ var Yt = Symbol("wui.trustedHtml"), R = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1567
1567
|
return this._value;
|
|
1568
1568
|
}
|
|
1569
1569
|
set value(e) {
|
|
1570
|
-
this._value = e == null ? "" : String(e),
|
|
1570
|
+
this._value = e == null ? "" : String(e), R(this, this._value);
|
|
1571
1571
|
let t = this._readOptions().find((e) => String(e.value) === this._value);
|
|
1572
|
-
this._label = t ?
|
|
1572
|
+
this._label = t ? Qt(t.label) : "", this._syncInput(), this._renderOptions("");
|
|
1573
1573
|
}
|
|
1574
1574
|
set options(e) {
|
|
1575
1575
|
this._optionsProp = Array.isArray(e) ? e : [];
|
|
1576
1576
|
let t = this._readOptions().find((e) => String(e.value) === this._value);
|
|
1577
|
-
t && (this._label =
|
|
1577
|
+
t && (this._label = Qt(t.label)), this._renderOptions(), this._syncInput();
|
|
1578
1578
|
}
|
|
1579
1579
|
get options() {
|
|
1580
1580
|
return this._readOptions();
|
|
@@ -1593,7 +1593,7 @@ var Yt = Symbol("wui.trustedHtml"), R = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1593
1593
|
}
|
|
1594
1594
|
_matchesKnownOption(e) {
|
|
1595
1595
|
let t = e.toLowerCase();
|
|
1596
|
-
return this._readOptions().some((e) =>
|
|
1596
|
+
return this._readOptions().some((e) => Qt(e.label).toLowerCase() === t || String(e.value ?? "").toLowerCase() === t);
|
|
1597
1597
|
}
|
|
1598
1598
|
get _minChars() {
|
|
1599
1599
|
return Math.max(0, Number(this.getAttribute("min-chars")) || +!!this._remote);
|
|
@@ -1611,7 +1611,7 @@ var Yt = Symbol("wui.trustedHtml"), R = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1611
1611
|
value: e.getAttribute("value") ?? e.textContent.trim(),
|
|
1612
1612
|
label: e.innerHTML,
|
|
1613
1613
|
icon: e.getAttribute("icon") || void 0,
|
|
1614
|
-
[
|
|
1614
|
+
[Kt]: !0,
|
|
1615
1615
|
selected: e.hasAttribute("selected")
|
|
1616
1616
|
})));
|
|
1617
1617
|
}
|
|
@@ -1625,17 +1625,17 @@ var Yt = Symbol("wui.trustedHtml"), R = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1625
1625
|
let r = `${this.id}-listbox`;
|
|
1626
1626
|
this._listboxId = r, this.innerHTML = `
|
|
1627
1627
|
<div class="search-select${n}">
|
|
1628
|
-
<div class="input search-select-control search-select-ac" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-controls="${
|
|
1629
|
-
<input class="search-select-input search-select-ac-input" placeholder="${
|
|
1628
|
+
<div class="input search-select-control search-select-ac" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-controls="${H(r)}" aria-label="${H(this._accessibleName())}"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}>
|
|
1629
|
+
<input class="search-select-input search-select-ac-input" placeholder="${H(e)}" aria-autocomplete="list" autocomplete="off"${this.hasAttribute("disabled") ? " disabled" : ""} />
|
|
1630
1630
|
<span class="search-select-spinner spinner-border spinner-border-sm" role="status" aria-hidden="true" hidden></span>
|
|
1631
|
-
<button type="button" class="search-select-clear" aria-label="Clear" hidden>${
|
|
1631
|
+
<button type="button" class="search-select-clear" aria-label="Clear" hidden>${B("x")}</button>
|
|
1632
1632
|
</div>
|
|
1633
|
-
<div class="search-select-menu search-select-menu-fixed" role="listbox" id="${
|
|
1633
|
+
<div class="search-select-menu search-select-menu-fixed" role="listbox" id="${H(r)}" tabindex="-1" hidden>
|
|
1634
1634
|
<div class="search-select-options"></div>
|
|
1635
1635
|
<div class="search-select-empty" hidden>No matches</div>
|
|
1636
1636
|
<div class="search-select-hint" hidden>Type to search…</div>
|
|
1637
1637
|
</div>
|
|
1638
|
-
</div>`, this._rendered = !0,
|
|
1638
|
+
</div>`, this._rendered = !0, R(this, this._value), this._wire(), this._syncInput(), this._renderOptions();
|
|
1639
1639
|
}
|
|
1640
1640
|
_refs() {
|
|
1641
1641
|
return {
|
|
@@ -1664,7 +1664,7 @@ var Yt = Symbol("wui.trustedHtml"), R = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1664
1664
|
let t = this._refs();
|
|
1665
1665
|
if (!t.optionsWrap) return;
|
|
1666
1666
|
let n = e ?? (t.input ? t.input.value : ""), r = n.trim().toLowerCase(), i = this._readOptions();
|
|
1667
|
-
!this._remote && r && (i = i.filter((e) =>
|
|
1667
|
+
!this._remote && r && (i = i.filter((e) => Qt(e.label).toLowerCase().includes(r)));
|
|
1668
1668
|
let a = n.trim(), o = this._allowCustom && a && !this._matchesKnownOption(a) ? [...i, {
|
|
1669
1669
|
value: a,
|
|
1670
1670
|
custom: !0
|
|
@@ -1672,11 +1672,11 @@ var Yt = Symbol("wui.trustedHtml"), R = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1672
1672
|
t.optionsWrap.innerHTML = o.map((e, t) => {
|
|
1673
1673
|
let n = `${s}-opt-${t}`;
|
|
1674
1674
|
if (e.custom) {
|
|
1675
|
-
let t = `Add “${
|
|
1676
|
-
return `<button type="button" role="option" id="${
|
|
1675
|
+
let t = `Add “${V(e.value)}”`;
|
|
1676
|
+
return `<button type="button" role="option" id="${H(n)}" class="search-select-option search-select-option-custom" data-value="${H(e.value)}" data-custom="true" aria-selected="false">${t}</button>`;
|
|
1677
1677
|
}
|
|
1678
1678
|
let r = String(e.value) === String(this._value);
|
|
1679
|
-
return `<button type="button" role="option" id="${
|
|
1679
|
+
return `<button type="button" role="option" id="${H(n)}" class="search-select-option${r ? " selected" : ""}" data-value="${H(e.value)}" aria-selected="${r}">${Xt(e)}</button>`;
|
|
1680
1680
|
}).join(""), this._active = -1, t.control?.removeAttribute("aria-activedescendant");
|
|
1681
1681
|
let c = r.length < this._minChars;
|
|
1682
1682
|
t.hint && (t.hint.hidden = !(this._remote && c && !i.length)), t.empty && (t.empty.hidden = this._loading || o.length > 0 || this._remote && c), this._reanchor?.();
|
|
@@ -1685,7 +1685,7 @@ var Yt = Symbol("wui.trustedHtml"), R = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1685
1685
|
this._teardown();
|
|
1686
1686
|
let e = this._refs();
|
|
1687
1687
|
if (!e.control || !e.input) return;
|
|
1688
|
-
let t = () =>
|
|
1688
|
+
let t = () => I(e.control, e.menu, { matchWidth: !0 }), n = () => this._optionEls().filter((e) => !e.hidden), r = (t) => {
|
|
1689
1689
|
let r = n();
|
|
1690
1690
|
this._active = t;
|
|
1691
1691
|
for (let e of this._optionEls()) e.classList.remove("is-active");
|
|
@@ -1696,12 +1696,12 @@ var Yt = Symbol("wui.trustedHtml"), R = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1696
1696
|
e.menu.hidden = !0, e.control.setAttribute("aria-expanded", "false"), e.control.classList.remove("open"), r(-1), clearTimeout(this._typeaheadTimer), this._typeaheadTimer = null, this._typeahead = "", this._syncInput();
|
|
1697
1697
|
}, s = (t) => {
|
|
1698
1698
|
let n = t.dataset.custom === "true";
|
|
1699
|
-
this._value = t.dataset.value, this._label = n ? t.dataset.value :
|
|
1699
|
+
this._value = t.dataset.value, this._label = n ? t.dataset.value : Qt(t.innerHTML), R(this, this._value), e.input.value = this._label, this.dispatchEvent(new CustomEvent("change", {
|
|
1700
1700
|
bubbles: !0,
|
|
1701
1701
|
detail: { isCustom: n }
|
|
1702
1702
|
})), o(), e.input.focus();
|
|
1703
1703
|
}, c = (t) => {
|
|
1704
|
-
this._value = t, this._label = t,
|
|
1704
|
+
this._value = t, this._label = t, R(this, t), e.input.value = t, this.dispatchEvent(new CustomEvent("change", {
|
|
1705
1705
|
bubbles: !0,
|
|
1706
1706
|
detail: { isCustom: !0 }
|
|
1707
1707
|
})), o();
|
|
@@ -1719,7 +1719,7 @@ var Yt = Symbol("wui.trustedHtml"), R = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1719
1719
|
}, this._timer = setTimeout(() => this._fireSearch(t, e), this._debounceMs);
|
|
1720
1720
|
} else this._renderOptions(t);
|
|
1721
1721
|
};
|
|
1722
|
-
this._navHandler =
|
|
1722
|
+
this._navHandler = Gt({
|
|
1723
1723
|
getVisibleOptions: n,
|
|
1724
1724
|
getActive: () => this._active,
|
|
1725
1725
|
setActive: (e) => r(e),
|
|
@@ -1759,11 +1759,11 @@ var Yt = Symbol("wui.trustedHtml"), R = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1759
1759
|
let t = e.target.closest(".search-select-option");
|
|
1760
1760
|
t && r(this._optionEls().indexOf(t));
|
|
1761
1761
|
}), e.optionsWrap.addEventListener("mouseleave", () => r(-1)), e.clear?.addEventListener("click", () => {
|
|
1762
|
-
this._value = "", this._label = "",
|
|
1762
|
+
this._value = "", this._label = "", R(this, ""), e.input.value = "", e.clear.hidden = !0, this._renderOptions(""), this.dispatchEvent(new Event("change", { bubbles: !0 })), e.input.focus();
|
|
1763
1763
|
}), this._bindGlobal = () => {
|
|
1764
1764
|
this._teardown(), this._onDocClick = (e) => {
|
|
1765
1765
|
i() && !this.contains(e.target) && o();
|
|
1766
|
-
}, document.addEventListener("click", this._onDocClick),
|
|
1766
|
+
}, document.addEventListener("click", this._onDocClick), Bt(this, () => {
|
|
1767
1767
|
i() && t();
|
|
1768
1768
|
});
|
|
1769
1769
|
}, this._bindGlobal();
|
|
@@ -1778,15 +1778,15 @@ var Yt = Symbol("wui.trustedHtml"), R = (e) => String(e ?? "").replace(/&/g, "&a
|
|
|
1778
1778
|
}));
|
|
1779
1779
|
}
|
|
1780
1780
|
_teardown() {
|
|
1781
|
-
this._onDocClick &&= (document.removeEventListener("click", this._onDocClick), null),
|
|
1781
|
+
this._onDocClick &&= (document.removeEventListener("click", this._onDocClick), null), L(this), clearTimeout(this._timer), this._navHandler?.teardown();
|
|
1782
1782
|
}
|
|
1783
1783
|
disconnectedCallback() {
|
|
1784
1784
|
this._teardown();
|
|
1785
1785
|
}
|
|
1786
|
-
},
|
|
1786
|
+
}, H = (e) => String(e ?? "").replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<"), Qt = (e) => String(e ?? "").replace(/<[^>]*>/g, "");
|
|
1787
1787
|
//#endregion
|
|
1788
1788
|
//#region src/textMatch.js
|
|
1789
|
-
function
|
|
1789
|
+
function $t(e, t) {
|
|
1790
1790
|
let n = String(e ?? ""), r = String(t ?? "").trim();
|
|
1791
1791
|
if (!r || !n) return [{
|
|
1792
1792
|
text: n,
|
|
@@ -1812,7 +1812,7 @@ function nn(e, t) {
|
|
|
1812
1812
|
}
|
|
1813
1813
|
//#endregion
|
|
1814
1814
|
//#region src/WuiCommandPalette.js
|
|
1815
|
-
var
|
|
1815
|
+
var en = "[role=\"option\"]", tn = "No results", nn = class extends e {
|
|
1816
1816
|
static get observedAttributes() {
|
|
1817
1817
|
return [
|
|
1818
1818
|
"filter",
|
|
@@ -1855,7 +1855,7 @@ var rn = "[role=\"option\"]", an = "No results", on = class extends e {
|
|
|
1855
1855
|
this.setAttribute("highlight", e ? "true" : "false");
|
|
1856
1856
|
}
|
|
1857
1857
|
get emptyText() {
|
|
1858
|
-
return this.getAttribute("empty-text") ??
|
|
1858
|
+
return this.getAttribute("empty-text") ?? tn;
|
|
1859
1859
|
}
|
|
1860
1860
|
set emptyText(e) {
|
|
1861
1861
|
this.setAttribute("empty-text", String(e ?? ""));
|
|
@@ -1872,7 +1872,7 @@ var rn = "[role=\"option\"]", an = "No results", on = class extends e {
|
|
|
1872
1872
|
return this.querySelector("[role=\"combobox\"]");
|
|
1873
1873
|
}
|
|
1874
1874
|
_optionFrom(e, t = !1) {
|
|
1875
|
-
let n = e?.closest?.(
|
|
1875
|
+
let n = e?.closest?.(en);
|
|
1876
1876
|
return n && this.contains(n) && !this._isHidden(n) && (t || !this._isDisabled(n)) ? n : null;
|
|
1877
1877
|
}
|
|
1878
1878
|
_isDisabled(e) {
|
|
@@ -1882,11 +1882,11 @@ var rn = "[role=\"option\"]", an = "No results", on = class extends e {
|
|
|
1882
1882
|
return e.hidden || !!e.closest("[role=\"group\"]")?.hidden;
|
|
1883
1883
|
}
|
|
1884
1884
|
_selectableOptions() {
|
|
1885
|
-
return [...this.querySelectorAll(
|
|
1885
|
+
return [...this.querySelectorAll(en)].filter((e) => !this._isHidden(e) && !this._isDisabled(e));
|
|
1886
1886
|
}
|
|
1887
1887
|
_setActive(e, t) {
|
|
1888
1888
|
this._activeId = e ? e.id : null;
|
|
1889
|
-
for (let t of this.querySelectorAll(
|
|
1889
|
+
for (let t of this.querySelectorAll(en)) t.setAttribute("aria-selected", t === e ? "true" : "false");
|
|
1890
1890
|
let n = this._input();
|
|
1891
1891
|
n && (e ? n.setAttribute("aria-activedescendant", e.id) : n.removeAttribute("aria-activedescendant")), e && t && e.scrollIntoView({ block: "nearest" });
|
|
1892
1892
|
}
|
|
@@ -1922,11 +1922,11 @@ var rn = "[role=\"option\"]", an = "No results", on = class extends e {
|
|
|
1922
1922
|
}
|
|
1923
1923
|
_applyFilter() {
|
|
1924
1924
|
let e = this._input(), t = (e ? e.value : "").trim(), n = t.toLowerCase(), r = this.highlight, i = 0;
|
|
1925
|
-
for (let e of this.querySelectorAll(
|
|
1925
|
+
for (let e of this.querySelectorAll(en)) {
|
|
1926
1926
|
let a = e.querySelector(".wui-cmd-item-label"), o = e.dataset.label ?? a?.textContent ?? "", s = !n || o.toLowerCase().includes(n);
|
|
1927
|
-
e.hidden = !s, s && i++, a && (a.innerHTML =
|
|
1927
|
+
e.hidden = !s, s && i++, a && (a.innerHTML = $t(o, r ? t : "").map((e) => e.match ? `<mark class="wui-cmd-mark">${V(e.text)}</mark>` : V(e.text)).join(""));
|
|
1928
1928
|
}
|
|
1929
|
-
for (let e of this.querySelectorAll("[role=\"group\"]")) e.hidden = ![...e.querySelectorAll(
|
|
1929
|
+
for (let e of this.querySelectorAll("[role=\"group\"]")) e.hidden = ![...e.querySelectorAll(en)].some((e) => !e.hidden);
|
|
1930
1930
|
let a = this.querySelector("[role=\"listbox\"]");
|
|
1931
1931
|
a && (a.hidden = i === 0);
|
|
1932
1932
|
let o = this.querySelector(".wui-cmd-empty");
|
|
@@ -1935,7 +1935,7 @@ var rn = "[role=\"option\"]", an = "No results", on = class extends e {
|
|
|
1935
1935
|
_teardown() {
|
|
1936
1936
|
this.removeEventListener("keydown", this._onKeyDown), this.removeEventListener("click", this._onClick), this.removeEventListener("mousedown", this._onMouseDown), this.removeEventListener("mousemove", this._onMouseMove), this.removeEventListener("input", this._onInput);
|
|
1937
1937
|
}
|
|
1938
|
-
},
|
|
1938
|
+
}, rn = {
|
|
1939
1939
|
"--color-primary": "#4F46E5",
|
|
1940
1940
|
"--color-primary-hover": "#4338CA",
|
|
1941
1941
|
"--color-text": "#071437",
|
|
@@ -1945,21 +1945,21 @@ var rn = "[role=\"option\"]", an = "No results", on = class extends e {
|
|
|
1945
1945
|
"--wui-radius-lg": "14px",
|
|
1946
1946
|
"--wui-shadow-overlay-lg": "0 24px 60px -16px rgba(7, 20, 55, 0.28)",
|
|
1947
1947
|
"--wui-z-fixed": "1030"
|
|
1948
|
-
},
|
|
1948
|
+
}, U = (e) => `var(${e}, ${rn[e]})`, an = `
|
|
1949
1949
|
:host {
|
|
1950
1950
|
all: initial;
|
|
1951
1951
|
position: fixed;
|
|
1952
1952
|
bottom: 20px;
|
|
1953
1953
|
left: 20px;
|
|
1954
1954
|
right: auto;
|
|
1955
|
-
z-index: ${
|
|
1955
|
+
z-index: ${U("--wui-z-fixed")};
|
|
1956
1956
|
display: block;
|
|
1957
1957
|
width: 420px;
|
|
1958
1958
|
max-width: calc(100vw - 40px);
|
|
1959
1959
|
font-family: inherit;
|
|
1960
1960
|
font-size: 16px;
|
|
1961
1961
|
line-height: 1.5;
|
|
1962
|
-
color: ${
|
|
1962
|
+
color: ${U("--color-text")};
|
|
1963
1963
|
}
|
|
1964
1964
|
:host([position="bottom-right"]) {
|
|
1965
1965
|
right: 20px;
|
|
@@ -1977,10 +1977,10 @@ var rn = "[role=\"option\"]", an = "No results", on = class extends e {
|
|
|
1977
1977
|
|
|
1978
1978
|
.wui-consent-banner-panel {
|
|
1979
1979
|
padding: 20px;
|
|
1980
|
-
background: ${
|
|
1981
|
-
border: 1px solid ${
|
|
1982
|
-
border-radius: ${
|
|
1983
|
-
box-shadow: ${
|
|
1980
|
+
background: ${U("--color-surface")};
|
|
1981
|
+
border: 1px solid ${U("--color-border")};
|
|
1982
|
+
border-radius: ${U("--wui-radius-lg")};
|
|
1983
|
+
box-shadow: ${U("--wui-shadow-overlay-lg")};
|
|
1984
1984
|
text-align: start;
|
|
1985
1985
|
pointer-events: auto;
|
|
1986
1986
|
}
|
|
@@ -1989,16 +1989,16 @@ var rn = "[role=\"option\"]", an = "No results", on = class extends e {
|
|
|
1989
1989
|
font-size: 18px;
|
|
1990
1990
|
font-weight: 600;
|
|
1991
1991
|
line-height: 1.3;
|
|
1992
|
-
color: ${
|
|
1992
|
+
color: ${U("--color-text")};
|
|
1993
1993
|
}
|
|
1994
1994
|
.wui-consent-banner-description {
|
|
1995
1995
|
margin: 0 0 16px;
|
|
1996
1996
|
font-size: 14px;
|
|
1997
1997
|
line-height: 1.5;
|
|
1998
|
-
color: ${
|
|
1998
|
+
color: ${U("--color-text-muted")};
|
|
1999
1999
|
}
|
|
2000
2000
|
.wui-consent-banner-policy {
|
|
2001
|
-
color: ${
|
|
2001
|
+
color: ${U("--color-primary")};
|
|
2002
2002
|
font-weight: 500;
|
|
2003
2003
|
}
|
|
2004
2004
|
|
|
@@ -2009,15 +2009,15 @@ var rn = "[role=\"option\"]", an = "No results", on = class extends e {
|
|
|
2009
2009
|
margin: 0 0 16px;
|
|
2010
2010
|
padding: 12px 0;
|
|
2011
2011
|
overflow-y: auto;
|
|
2012
|
-
border-top: 1px solid ${
|
|
2013
|
-
border-bottom: 1px solid ${
|
|
2012
|
+
border-top: 1px solid ${U("--color-border")};
|
|
2013
|
+
border-bottom: 1px solid ${U("--color-border")};
|
|
2014
2014
|
}
|
|
2015
2015
|
.wui-consent-banner-category-description {
|
|
2016
2016
|
margin: 2px 0 0;
|
|
2017
2017
|
padding-inline-start: 2.5em;
|
|
2018
2018
|
font-size: 12px;
|
|
2019
2019
|
line-height: 1.4;
|
|
2020
|
-
color: ${
|
|
2020
|
+
color: ${U("--color-text-muted")};
|
|
2021
2021
|
}
|
|
2022
2022
|
|
|
2023
2023
|
.form-check {
|
|
@@ -2035,20 +2035,20 @@ var rn = "[role=\"option\"]", an = "No results", on = class extends e {
|
|
|
2035
2035
|
margin: 0;
|
|
2036
2036
|
border: 1px solid rgba(0, 0, 0, 0.25);
|
|
2037
2037
|
border-radius: 2em;
|
|
2038
|
-
background: ${
|
|
2038
|
+
background: ${U("--color-surface")} radial-gradient(circle, rgba(0, 0, 0, 0.25) 0.35em, transparent 0.4em) left / 1em 1em no-repeat;
|
|
2039
2039
|
cursor: pointer;
|
|
2040
2040
|
transition: background-position 0.15s ease-in-out;
|
|
2041
2041
|
}
|
|
2042
2042
|
.form-check-input:checked {
|
|
2043
|
-
border-color: ${
|
|
2044
|
-
background: ${
|
|
2043
|
+
border-color: ${U("--color-primary")};
|
|
2044
|
+
background: ${U("--color-primary")} radial-gradient(circle, #fff 0.35em, transparent 0.4em) right / 1em 1em no-repeat;
|
|
2045
2045
|
}
|
|
2046
2046
|
.form-check-input:disabled {
|
|
2047
2047
|
opacity: 0.5;
|
|
2048
2048
|
cursor: default;
|
|
2049
2049
|
}
|
|
2050
2050
|
.form-check-input:focus-visible {
|
|
2051
|
-
outline: 2px solid ${
|
|
2051
|
+
outline: 2px solid ${U("--color-primary")};
|
|
2052
2052
|
outline-offset: 2px;
|
|
2053
2053
|
}
|
|
2054
2054
|
.form-check-label {
|
|
@@ -2077,33 +2077,33 @@ var rn = "[role=\"option\"]", an = "No results", on = class extends e {
|
|
|
2077
2077
|
cursor: pointer;
|
|
2078
2078
|
}
|
|
2079
2079
|
.btn:focus-visible {
|
|
2080
|
-
outline: 2px solid ${
|
|
2080
|
+
outline: 2px solid ${U("--color-primary")};
|
|
2081
2081
|
outline-offset: 2px;
|
|
2082
2082
|
}
|
|
2083
2083
|
.btn-primary {
|
|
2084
|
-
background: ${
|
|
2085
|
-
border-color: ${
|
|
2084
|
+
background: ${U("--color-primary")};
|
|
2085
|
+
border-color: ${U("--color-primary")};
|
|
2086
2086
|
color: #fff;
|
|
2087
2087
|
}
|
|
2088
2088
|
.btn-primary:hover {
|
|
2089
|
-
background: ${
|
|
2090
|
-
border-color: ${
|
|
2089
|
+
background: ${U("--color-primary-hover")};
|
|
2090
|
+
border-color: ${U("--color-primary-hover")};
|
|
2091
2091
|
}
|
|
2092
2092
|
.btn-outline-secondary {
|
|
2093
|
-
border-color: ${
|
|
2094
|
-
color: ${
|
|
2093
|
+
border-color: ${U("--color-text-muted")};
|
|
2094
|
+
color: ${U("--color-text-muted")};
|
|
2095
2095
|
}
|
|
2096
2096
|
.btn-outline-secondary:hover {
|
|
2097
|
-
background: ${
|
|
2097
|
+
background: ${U("--color-text-muted")};
|
|
2098
2098
|
color: #fff;
|
|
2099
2099
|
}
|
|
2100
2100
|
.btn-link {
|
|
2101
2101
|
font-weight: 400;
|
|
2102
|
-
color: ${
|
|
2102
|
+
color: ${U("--color-primary")};
|
|
2103
2103
|
text-decoration: underline;
|
|
2104
2104
|
}
|
|
2105
2105
|
.btn-link:hover {
|
|
2106
|
-
color: ${
|
|
2106
|
+
color: ${U("--color-primary-hover")};
|
|
2107
2107
|
}
|
|
2108
2108
|
.wui-consent-banner-settings-toggle {
|
|
2109
2109
|
margin-inline-end: auto;
|
|
@@ -2123,7 +2123,7 @@ var rn = "[role=\"option\"]", an = "No results", on = class extends e {
|
|
|
2123
2123
|
max-width: none;
|
|
2124
2124
|
}
|
|
2125
2125
|
}
|
|
2126
|
-
`,
|
|
2126
|
+
`, on = "wui-consent-save", sn = "[data-consent-settings]", W = {
|
|
2127
2127
|
heading: "Cookies on this site",
|
|
2128
2128
|
description: "We use cookies to understand how the site is used and to measure our campaigns. You can change your choice at any time.",
|
|
2129
2129
|
policyLabel: "Cookie policy",
|
|
@@ -2139,11 +2139,11 @@ var rn = "[role=\"option\"]", an = "No results", on = class extends e {
|
|
|
2139
2139
|
rejectLabel: "Reject all",
|
|
2140
2140
|
acceptLabel: "Accept all",
|
|
2141
2141
|
saveLabel: "Save preferences"
|
|
2142
|
-
},
|
|
2142
|
+
}, cn = [
|
|
2143
2143
|
"analytics",
|
|
2144
2144
|
"functional",
|
|
2145
2145
|
"marketing"
|
|
2146
|
-
],
|
|
2146
|
+
], ln = 0, un = class extends e {
|
|
2147
2147
|
static get observedAttributes() {
|
|
2148
2148
|
return [
|
|
2149
2149
|
"heading",
|
|
@@ -2156,12 +2156,12 @@ var rn = "[role=\"option\"]", an = "No results", on = class extends e {
|
|
|
2156
2156
|
];
|
|
2157
2157
|
}
|
|
2158
2158
|
constructor() {
|
|
2159
|
-
super(),
|
|
2159
|
+
super(), ln += 1, this._uid = `wui-consent-${ln}`, this._preferences = {
|
|
2160
2160
|
analytics: !1,
|
|
2161
2161
|
functional: !1,
|
|
2162
2162
|
marketing: !1
|
|
2163
2163
|
}, this._settings = !1, this._onDocumentClick = (e) => {
|
|
2164
|
-
e.target instanceof Element && e.target.closest(
|
|
2164
|
+
e.target instanceof Element && e.target.closest(sn) && (e.preventDefault(), this.open({
|
|
2165
2165
|
settings: !0,
|
|
2166
2166
|
focus: !0
|
|
2167
2167
|
}));
|
|
@@ -2180,13 +2180,13 @@ var rn = "[role=\"option\"]", an = "No results", on = class extends e {
|
|
|
2180
2180
|
this.toggleAttribute("standalone", e === !0 || e === "" || e === "true");
|
|
2181
2181
|
}
|
|
2182
2182
|
get heading() {
|
|
2183
|
-
return this.getAttribute("heading") ||
|
|
2183
|
+
return this.getAttribute("heading") || W.heading;
|
|
2184
2184
|
}
|
|
2185
2185
|
set heading(e) {
|
|
2186
2186
|
this.setAttribute("heading", String(e ?? ""));
|
|
2187
2187
|
}
|
|
2188
2188
|
get description() {
|
|
2189
|
-
return this.getAttribute("description") ||
|
|
2189
|
+
return this.getAttribute("description") || W.description;
|
|
2190
2190
|
}
|
|
2191
2191
|
set description(e) {
|
|
2192
2192
|
this.setAttribute("description", String(e ?? ""));
|
|
@@ -2198,25 +2198,25 @@ var rn = "[role=\"option\"]", an = "No results", on = class extends e {
|
|
|
2198
2198
|
this.setAttribute("policy-href", String(e ?? ""));
|
|
2199
2199
|
}
|
|
2200
2200
|
get policyLabel() {
|
|
2201
|
-
return this.getAttribute("policy-label") ||
|
|
2201
|
+
return this.getAttribute("policy-label") || W.policyLabel;
|
|
2202
2202
|
}
|
|
2203
2203
|
set policyLabel(e) {
|
|
2204
2204
|
this.setAttribute("policy-label", String(e ?? ""));
|
|
2205
2205
|
}
|
|
2206
2206
|
get analyticsDescription() {
|
|
2207
|
-
return this.getAttribute("analytics-description") ||
|
|
2207
|
+
return this.getAttribute("analytics-description") || W.analyticsDescription;
|
|
2208
2208
|
}
|
|
2209
2209
|
set analyticsDescription(e) {
|
|
2210
2210
|
this.setAttribute("analytics-description", String(e ?? ""));
|
|
2211
2211
|
}
|
|
2212
2212
|
get functionalDescription() {
|
|
2213
|
-
return this.getAttribute("functional-description") ||
|
|
2213
|
+
return this.getAttribute("functional-description") || W.functionalDescription;
|
|
2214
2214
|
}
|
|
2215
2215
|
set functionalDescription(e) {
|
|
2216
2216
|
this.setAttribute("functional-description", String(e ?? ""));
|
|
2217
2217
|
}
|
|
2218
2218
|
get marketingDescription() {
|
|
2219
|
-
return this.getAttribute("marketing-description") ||
|
|
2219
|
+
return this.getAttribute("marketing-description") || W.marketingDescription;
|
|
2220
2220
|
}
|
|
2221
2221
|
set marketingDescription(e) {
|
|
2222
2222
|
this.setAttribute("marketing-description", String(e ?? ""));
|
|
@@ -2244,22 +2244,22 @@ var rn = "[role=\"option\"]", an = "No results", on = class extends e {
|
|
|
2244
2244
|
this._rendered && this.render();
|
|
2245
2245
|
}
|
|
2246
2246
|
render() {
|
|
2247
|
-
let e = this.isOpen, t = this._uid, n = this.policyHref ? ` <a class="wui-consent-banner-policy" href="${
|
|
2248
|
-
r.innerHTML = `${r === this ? "" : `<style>${
|
|
2247
|
+
let e = this.isOpen, t = this._uid, n = this.policyHref ? ` <a class="wui-consent-banner-policy" href="${pn(this.policyHref)}">${fn(this.policyLabel)}</a>` : "", r = this._root();
|
|
2248
|
+
r.innerHTML = `${r === this ? "" : `<style>${an}</style>`}
|
|
2249
2249
|
<div class="wui-consent-banner-panel" role="dialog" aria-labelledby="${t}-heading" aria-describedby="${t}-description" hidden>
|
|
2250
|
-
<h2 class="wui-consent-banner-heading" id="${t}-heading">${
|
|
2251
|
-
<p class="wui-consent-banner-description" id="${t}-description">${
|
|
2250
|
+
<h2 class="wui-consent-banner-heading" id="${t}-heading">${fn(this.heading)}</h2>
|
|
2251
|
+
<p class="wui-consent-banner-description" id="${t}-description">${fn(this.description)}${n}</p>
|
|
2252
2252
|
<div class="wui-consent-banner-settings" hidden>
|
|
2253
|
-
${
|
|
2254
|
-
${
|
|
2255
|
-
${
|
|
2256
|
-
${
|
|
2253
|
+
${dn(t, "essential", W.essentialLabel, W.essentialDescription, !0)}
|
|
2254
|
+
${dn(t, "analytics", W.analyticsLabel, this.analyticsDescription, !1)}
|
|
2255
|
+
${dn(t, "functional", W.functionalLabel, this.functionalDescription, !1)}
|
|
2256
|
+
${dn(t, "marketing", W.marketingLabel, this.marketingDescription, !1)}
|
|
2257
2257
|
</div>
|
|
2258
2258
|
<div class="wui-consent-banner-actions">
|
|
2259
|
-
<button type="button" class="btn btn-sm btn-link wui-consent-banner-settings-toggle" aria-expanded="false">${
|
|
2260
|
-
<button type="button" class="btn btn-sm btn-outline-secondary wui-consent-banner-reject">${
|
|
2261
|
-
<button type="button" class="btn btn-sm btn-primary wui-consent-banner-accept">${
|
|
2262
|
-
<button type="button" class="btn btn-sm btn-primary wui-consent-banner-save" hidden>${
|
|
2259
|
+
<button type="button" class="btn btn-sm btn-link wui-consent-banner-settings-toggle" aria-expanded="false">${W.settingsLabel}</button>
|
|
2260
|
+
<button type="button" class="btn btn-sm btn-outline-secondary wui-consent-banner-reject">${W.rejectLabel}</button>
|
|
2261
|
+
<button type="button" class="btn btn-sm btn-primary wui-consent-banner-accept">${W.acceptLabel}</button>
|
|
2262
|
+
<button type="button" class="btn btn-sm btn-primary wui-consent-banner-save" hidden>${W.saveLabel}</button>
|
|
2263
2263
|
</div>
|
|
2264
2264
|
</div>`, this._rendered = !0, this._wire(), this._applyPreferences(), this._showSettings(this._settings), e && (this._panel().hidden = !1);
|
|
2265
2265
|
}
|
|
@@ -2289,7 +2289,7 @@ var rn = "[role=\"option\"]", an = "No results", on = class extends e {
|
|
|
2289
2289
|
})), e.querySelector(".wui-consent-banner-save")?.addEventListener("click", () => this._save(this._switchValues())), e.querySelector(".wui-consent-banner-settings-toggle")?.addEventListener("click", () => this._showSettings(!this._settings));
|
|
2290
2290
|
}
|
|
2291
2291
|
_save(e) {
|
|
2292
|
-
this._preferences = { ...e }, this.dispatchEvent(new CustomEvent(
|
|
2292
|
+
this._preferences = { ...e }, this.dispatchEvent(new CustomEvent(on, {
|
|
2293
2293
|
bubbles: !0,
|
|
2294
2294
|
composed: !0,
|
|
2295
2295
|
detail: { ...e }
|
|
@@ -2297,11 +2297,11 @@ var rn = "[role=\"option\"]", an = "No results", on = class extends e {
|
|
|
2297
2297
|
}
|
|
2298
2298
|
_switchValues() {
|
|
2299
2299
|
let e = {};
|
|
2300
|
-
for (let t of
|
|
2300
|
+
for (let t of cn) e[t] = this._root().querySelector(`input[data-category="${t}"]`)?.checked === !0;
|
|
2301
2301
|
return e;
|
|
2302
2302
|
}
|
|
2303
2303
|
_applyPreferences() {
|
|
2304
|
-
for (let e of
|
|
2304
|
+
for (let e of cn) {
|
|
2305
2305
|
let t = this._root().querySelector(`input[data-category="${e}"]`);
|
|
2306
2306
|
t && (t.checked = this._preferences[e]);
|
|
2307
2307
|
}
|
|
@@ -2319,47 +2319,47 @@ var rn = "[role=\"option\"]", an = "No results", on = class extends e {
|
|
|
2319
2319
|
}
|
|
2320
2320
|
}
|
|
2321
2321
|
};
|
|
2322
|
-
function
|
|
2322
|
+
function dn(e, t, n, r, i) {
|
|
2323
2323
|
let a = `${e}-${t}`;
|
|
2324
2324
|
return `<div class="wui-consent-banner-category">
|
|
2325
2325
|
<div class="form-check form-switch">
|
|
2326
2326
|
<input class="form-check-input" type="checkbox" role="switch" id="${a}" data-category="${t}"${i ? " checked disabled" : ""} />
|
|
2327
|
-
<label class="form-check-label" for="${a}">${
|
|
2327
|
+
<label class="form-check-label" for="${a}">${fn(n)}</label>
|
|
2328
2328
|
</div>
|
|
2329
|
-
<p class="wui-consent-banner-category-description">${
|
|
2329
|
+
<p class="wui-consent-banner-category-description">${fn(r)}</p>
|
|
2330
2330
|
</div>`;
|
|
2331
2331
|
}
|
|
2332
|
-
var
|
|
2333
|
-
function
|
|
2334
|
-
let r =
|
|
2332
|
+
var fn = (e) => String(e ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), pn = (e) => String(e ?? "").replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<"), mn = "[role=\"menuitem\"]", hn = "input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"]", gn = "data-open", _n = 500, vn = 10, yn = 400, bn = null, xn = null, Sn = /* @__PURE__ */ new WeakMap();
|
|
2333
|
+
function Cn(e, t, n) {
|
|
2334
|
+
let r = Sn.get(e);
|
|
2335
2335
|
if (r) {
|
|
2336
2336
|
if (r.region === t || t.contains(r.region)) return !1;
|
|
2337
2337
|
r.cancel();
|
|
2338
2338
|
}
|
|
2339
|
-
return
|
|
2339
|
+
return Sn.set(e, {
|
|
2340
2340
|
region: t,
|
|
2341
2341
|
cancel: n
|
|
2342
2342
|
}), !0;
|
|
2343
2343
|
}
|
|
2344
|
-
var
|
|
2344
|
+
var wn = (e) => e instanceof Element ? e : e?.parentElement ?? null, Tn = class extends e {
|
|
2345
2345
|
static get observedAttributes() {
|
|
2346
2346
|
return ["disabled"];
|
|
2347
2347
|
}
|
|
2348
2348
|
constructor() {
|
|
2349
|
-
super(), this._region = null, this._origin = null, this._returnFocus = null, this._press = null, this._swallowClick = !1, this._nav =
|
|
2349
|
+
super(), this._region = null, this._origin = null, this._returnFocus = null, this._press = null, this._swallowClick = !1, this._nav = Gt({
|
|
2350
2350
|
getVisibleOptions: () => this._items(),
|
|
2351
2351
|
getActive: () => this._items().indexOf(document.activeElement),
|
|
2352
2352
|
setActive: (e) => this._items()[e]?.focus({ preventScroll: !0 })
|
|
2353
2353
|
}), this._onContextMenu = (e) => this._handleContextMenu(e), this._onContextMenuCapture = (e) => {
|
|
2354
2354
|
this.isOpen && !this._inPanel(e.target) && !this._isKeyEcho() && this.close();
|
|
2355
2355
|
}, this._onDocKeyDown = (e) => this._handleDocKeyDown(e), this._onPointerDown = (e) => this._handlePointerDown(e), this._onPressMove = (e) => {
|
|
2356
|
-
this._press && Math.hypot(e.clientX - this._press.x, e.clientY - this._press.y) >
|
|
2356
|
+
this._press && Math.hypot(e.clientX - this._press.x, e.clientY - this._press.y) > vn && this._cancelPress();
|
|
2357
2357
|
}, this._onPressEnd = () => this._cancelPress(), this._onClickCapture = (e) => {
|
|
2358
2358
|
!this._swallowClick || !this._region?.contains(e.target) || (this._swallowClick = !1, e.preventDefault(), e.stopImmediatePropagation());
|
|
2359
2359
|
}, this._onKeyDown = (e) => {
|
|
2360
2360
|
this._inPanel(e.target) && this._handleMenuKey(e);
|
|
2361
2361
|
}, this._onClick = (e) => this._handleClick(e), this._onMouseMove = (e) => {
|
|
2362
|
-
let t =
|
|
2362
|
+
let t = wn(e.target)?.closest(mn);
|
|
2363
2363
|
t && this._inPanel(t) && !this._isDisabled(t) && t !== document.activeElement && t.focus({ preventScroll: !0 });
|
|
2364
2364
|
}, this._onDismiss = (e) => {
|
|
2365
2365
|
e.type === "scroll" && this._inPanel(e.target) || this.close();
|
|
@@ -2389,16 +2389,16 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
2389
2389
|
this.toggleAttribute("disabled", !!e);
|
|
2390
2390
|
}
|
|
2391
2391
|
get isOpen() {
|
|
2392
|
-
return this._panel()?.hasAttribute(
|
|
2392
|
+
return this._panel()?.hasAttribute(gn) ?? !1;
|
|
2393
2393
|
}
|
|
2394
2394
|
open(e, t, { region: n = this, origin: r = n, keyboard: i = !1 } = {}) {
|
|
2395
2395
|
let a = this._panel();
|
|
2396
2396
|
if (a) {
|
|
2397
|
-
if (
|
|
2397
|
+
if (bn && bn !== this && bn.close(!0), !this.isOpen) {
|
|
2398
2398
|
let e = document.activeElement;
|
|
2399
2399
|
this._returnFocus = e && e !== document.body && !this._inPanel(e) ? e : null;
|
|
2400
2400
|
}
|
|
2401
|
-
this._region = n, this._origin = r,
|
|
2401
|
+
this._region = n, this._origin = r, xn = null, a.setAttribute(gn, ""), bn = this, I({ getBoundingClientRect: () => ({
|
|
2402
2402
|
left: e,
|
|
2403
2403
|
right: e,
|
|
2404
2404
|
top: t,
|
|
@@ -2418,8 +2418,8 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
2418
2418
|
}
|
|
2419
2419
|
close(e = !1) {
|
|
2420
2420
|
let t = this._panel();
|
|
2421
|
-
if (!t?.hasAttribute(
|
|
2422
|
-
t.removeAttribute(
|
|
2421
|
+
if (!t?.hasAttribute(gn)) return;
|
|
2422
|
+
t.removeAttribute(gn), bn === this && (bn = null), window.removeEventListener("scroll", this._onDismiss, !0), window.removeEventListener("resize", this._onDismiss), window.removeEventListener("blur", this._onDismiss), this._nav.teardown();
|
|
2423
2423
|
let n = this._returnFocus;
|
|
2424
2424
|
this._returnFocus = null, e && n?.isConnected && n.focus({ preventScroll: !0 });
|
|
2425
2425
|
}
|
|
@@ -2430,49 +2430,49 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
2430
2430
|
return !!e && !!this._panel()?.contains(e);
|
|
2431
2431
|
}
|
|
2432
2432
|
_items() {
|
|
2433
|
-
return [...this._panel()?.querySelectorAll(
|
|
2433
|
+
return [...this._panel()?.querySelectorAll(mn) ?? []].filter((e) => !this._isDisabled(e));
|
|
2434
2434
|
}
|
|
2435
2435
|
_isDisabled(e) {
|
|
2436
2436
|
return e.getAttribute("aria-disabled") === "true";
|
|
2437
2437
|
}
|
|
2438
2438
|
_regionFor(e) {
|
|
2439
|
-
let t =
|
|
2440
|
-
if (!t || this.disabled || !this._panel() || this._inPanel(t) || t.closest(
|
|
2439
|
+
let t = wn(e);
|
|
2440
|
+
if (!t || this.disabled || !this._panel() || this._inPanel(t) || t.closest(hn)) return null;
|
|
2441
2441
|
let n = this.target;
|
|
2442
2442
|
return n ? t.closest(n) : this.contains(t) ? this : null;
|
|
2443
2443
|
}
|
|
2444
2444
|
_isKeyEcho() {
|
|
2445
|
-
return
|
|
2445
|
+
return xn?.menu === this && this.isOpen && performance.now() - xn.at < yn;
|
|
2446
2446
|
}
|
|
2447
2447
|
_handleContextMenu(e) {
|
|
2448
2448
|
if (this._inPanel(e.target)) {
|
|
2449
2449
|
e.preventDefault();
|
|
2450
2450
|
return;
|
|
2451
2451
|
}
|
|
2452
|
-
if (e.defaultPrevented && !
|
|
2452
|
+
if (e.defaultPrevented && !Sn.has(e)) return;
|
|
2453
2453
|
let t = this._regionFor(e.target);
|
|
2454
2454
|
if (t) {
|
|
2455
2455
|
if (this._isKeyEcho()) {
|
|
2456
2456
|
e.preventDefault();
|
|
2457
2457
|
return;
|
|
2458
2458
|
}
|
|
2459
|
-
e.shiftKey ||
|
|
2459
|
+
e.shiftKey || Cn(e, t, () => this.close(!0)) && (e.preventDefault(), this.open(e.clientX, e.clientY, {
|
|
2460
2460
|
region: t,
|
|
2461
|
-
origin:
|
|
2461
|
+
origin: wn(e.target)
|
|
2462
2462
|
}));
|
|
2463
2463
|
}
|
|
2464
2464
|
}
|
|
2465
2465
|
_handleDocKeyDown(e) {
|
|
2466
|
-
if (e.defaultPrevented && !
|
|
2466
|
+
if (e.defaultPrevented && !Sn.has(e) || !(e.key === "ContextMenu" || e.key === "F10" && e.shiftKey) || this._inPanel(e.target)) return;
|
|
2467
2467
|
let t = this._regionFor(e.target);
|
|
2468
|
-
if (!t || !
|
|
2468
|
+
if (!t || !Cn(e, t, () => this.close(!0))) return;
|
|
2469
2469
|
e.preventDefault();
|
|
2470
|
-
let n =
|
|
2470
|
+
let n = wn(e.target), r = n.getBoundingClientRect();
|
|
2471
2471
|
this.open(r.left + Math.min(16, r.width / 2), r.bottom, {
|
|
2472
2472
|
region: t,
|
|
2473
2473
|
origin: n,
|
|
2474
2474
|
keyboard: !0
|
|
2475
|
-
}),
|
|
2475
|
+
}), xn = {
|
|
2476
2476
|
menu: this,
|
|
2477
2477
|
at: performance.now()
|
|
2478
2478
|
};
|
|
@@ -2480,9 +2480,9 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
2480
2480
|
_handlePointerDown(e) {
|
|
2481
2481
|
if (e.pointerType !== "touch") return;
|
|
2482
2482
|
let t = this._regionFor(e.target);
|
|
2483
|
-
if (!t || !
|
|
2483
|
+
if (!t || !Cn(e, t, () => this._cancelPress())) return;
|
|
2484
2484
|
this._cancelPress();
|
|
2485
|
-
let { clientX: n, clientY: r } = e, i =
|
|
2485
|
+
let { clientX: n, clientY: r } = e, i = wn(e.target);
|
|
2486
2486
|
this._press = {
|
|
2487
2487
|
x: n,
|
|
2488
2488
|
y: r,
|
|
@@ -2491,7 +2491,7 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
2491
2491
|
region: t,
|
|
2492
2492
|
origin: i
|
|
2493
2493
|
});
|
|
2494
|
-
},
|
|
2494
|
+
}, _n)
|
|
2495
2495
|
}, document.addEventListener("pointermove", this._onPressMove, { passive: !0 }), document.addEventListener("pointerup", this._onPressEnd), document.addEventListener("pointercancel", this._onPressEnd), window.addEventListener("scroll", this._onPressEnd, !0);
|
|
2496
2496
|
}
|
|
2497
2497
|
_cancelPress() {
|
|
@@ -2502,7 +2502,7 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
2502
2502
|
else if (e.key === "Tab") this.close(!0);
|
|
2503
2503
|
else if (e.key === "ArrowDown" || e.key === "ArrowUp") e.preventDefault(), this._step(e.key === "ArrowDown" ? 1 : -1);
|
|
2504
2504
|
else if (e.key === " ") {
|
|
2505
|
-
let t =
|
|
2505
|
+
let t = wn(e.target)?.closest(mn);
|
|
2506
2506
|
e.preventDefault(), t && t.click();
|
|
2507
2507
|
} else this._nav.handler(e);
|
|
2508
2508
|
}
|
|
@@ -2513,7 +2513,7 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
2513
2513
|
t[n < 0 ? e > 0 ? 0 : t.length - 1 : (n + e + t.length) % t.length].focus({ preventScroll: !0 });
|
|
2514
2514
|
}
|
|
2515
2515
|
_handleClick(e) {
|
|
2516
|
-
let t =
|
|
2516
|
+
let t = wn(e.target)?.closest(mn);
|
|
2517
2517
|
if (!(!t || !this._inPanel(t))) {
|
|
2518
2518
|
if (this._isDisabled(t)) {
|
|
2519
2519
|
e.preventDefault(), e.stopPropagation();
|
|
@@ -2533,7 +2533,7 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
2533
2533
|
_teardown() {
|
|
2534
2534
|
this.close(), this._cancelPress(), document.removeEventListener("contextmenu", this._onContextMenuCapture, !0), document.removeEventListener("contextmenu", this._onContextMenu), document.removeEventListener("keydown", this._onDocKeyDown), document.removeEventListener("pointerdown", this._onPointerDownCapture, !0), document.removeEventListener("pointerdown", this._onPointerDown), document.removeEventListener("click", this._onClickCapture, !0), this.removeEventListener("keydown", this._onKeyDown), this.removeEventListener("click", this._onClick), this.removeEventListener("mousemove", this._onMouseMove);
|
|
2535
2535
|
}
|
|
2536
|
-
},
|
|
2536
|
+
}, En = [
|
|
2537
2537
|
[
|
|
2538
2538
|
"AF",
|
|
2539
2539
|
"Afghanistan",
|
|
@@ -3759,11 +3759,11 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
3759
3759
|
"Zimbabwe",
|
|
3760
3760
|
"263"
|
|
3761
3761
|
]
|
|
3762
|
-
],
|
|
3762
|
+
], Dn = (e) => (En.find((t) => t[0] === e) || [
|
|
3763
3763
|
"",
|
|
3764
3764
|
"",
|
|
3765
3765
|
""
|
|
3766
|
-
])[2],
|
|
3766
|
+
])[2], On = class extends e {
|
|
3767
3767
|
static formAssociated = !0;
|
|
3768
3768
|
static get observedAttributes() {
|
|
3769
3769
|
return [
|
|
@@ -3822,7 +3822,7 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
3822
3822
|
return this._value;
|
|
3823
3823
|
}
|
|
3824
3824
|
set value(e) {
|
|
3825
|
-
this._value = e == null ? "" : String(e),
|
|
3825
|
+
this._value = e == null ? "" : String(e), R(this, this._value), this._syncSelected(), this._syncReset();
|
|
3826
3826
|
}
|
|
3827
3827
|
set options(e) {
|
|
3828
3828
|
this._optionsProp = Array.isArray(e) ? e : null, this.isConnected && this.render();
|
|
@@ -3837,7 +3837,7 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
3837
3837
|
value: e.getAttribute("value") ?? e.textContent.trim(),
|
|
3838
3838
|
label: e.innerHTML,
|
|
3839
3839
|
icon: e.getAttribute("icon") || void 0,
|
|
3840
|
-
[
|
|
3840
|
+
[Kt]: !0,
|
|
3841
3841
|
selected: e.hasAttribute("selected")
|
|
3842
3842
|
})));
|
|
3843
3843
|
}
|
|
@@ -3847,27 +3847,27 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
3847
3847
|
render() {
|
|
3848
3848
|
this._defaultValue === void 0 && (this._defaultValue = this.getAttribute("value") || ""), this._snapshotDeclared();
|
|
3849
3849
|
let e = this._readOptions(), t = this.hasAttribute("searchable"), n = this.hasAttribute("clearable"), r = this.getAttribute("size"), i = r === "sm" ? " search-select-sm" : r === "lg" ? " search-select-lg" : "", a = this.getAttribute("icon"), o = this.getAttribute("prefix"), s = this.getAttribute("placeholder") || "Select...", c = this.getAttribute("search-placeholder") || "Search...", l = e.find((e) => String(e.value) === String(this._value)) || e.find((e) => e.selected);
|
|
3850
|
-
l && (this._value = String(l.value)),
|
|
3850
|
+
l && (this._value = String(l.value)), R(this, this._value), this.id ||= `wui-select-${Math.random().toString(36).slice(2, 9)}`;
|
|
3851
3851
|
let u = `${this.id}-listbox`;
|
|
3852
3852
|
this._listboxId = u;
|
|
3853
3853
|
let d = e.map((e, t) => {
|
|
3854
3854
|
let n = String(e.value) === String(this._value);
|
|
3855
|
-
return `<button type="button" role="option" id="${
|
|
3855
|
+
return `<button type="button" role="option" id="${kn(`${u}-opt-${t}`)}" class="search-select-option${n ? " selected" : ""}" data-value="${kn(e.value)}" aria-selected="${n}">${Xt(e)}</button>`;
|
|
3856
3856
|
}).join("");
|
|
3857
3857
|
this.innerHTML = `
|
|
3858
3858
|
<div class="search-select${this.hasAttribute("compact") ? " search-select-compact" : ""}${i}">
|
|
3859
|
-
<button type="button" role="combobox" class="input search-select-control" aria-haspopup="listbox" aria-expanded="false" aria-controls="${
|
|
3860
|
-
${a ?
|
|
3861
|
-
${o ? `<span class="search-select-prefix">${
|
|
3862
|
-
<span class="${l ? "" : "search-select-placeholder"}" data-label>${l ?
|
|
3863
|
-
${n ? `<span class="search-select-reset" role="button" aria-label="Clear selection" hidden>${
|
|
3864
|
-
${
|
|
3859
|
+
<button type="button" role="combobox" class="input search-select-control" aria-haspopup="listbox" aria-expanded="false" aria-controls="${kn(u)}" aria-label="${kn(this._accessibleName())}"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""}>
|
|
3860
|
+
${a ? B(a, { className: "search-select-icon" }) : ""}
|
|
3861
|
+
${o ? `<span class="search-select-prefix">${V(o)}</span>` : ""}
|
|
3862
|
+
<span class="${l ? "" : "search-select-placeholder"}" data-label>${l ? Xt(l) : V(s)}</span>
|
|
3863
|
+
${n ? `<span class="search-select-reset" role="button" aria-label="Clear selection" hidden>${B("x")}</span>` : ""}
|
|
3864
|
+
${B("chevron-down", { className: "search-select-caret" })}
|
|
3865
3865
|
</button>
|
|
3866
|
-
<div class="search-select-menu search-select-menu-fixed" role="listbox" id="${
|
|
3867
|
-
${t ? `<div class="search-select-search">${
|
|
3866
|
+
<div class="search-select-menu search-select-menu-fixed" role="listbox" id="${kn(u)}" tabindex="-1" hidden>
|
|
3867
|
+
${t ? `<div class="search-select-search">${B("search")}<input class="search-select-input" placeholder="${kn(c)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden>${B("x")}</button></div>` : ""}
|
|
3868
3868
|
<div class="search-select-options">${d}<div class="search-select-empty" hidden>No matches</div></div>
|
|
3869
3869
|
</div>
|
|
3870
|
-
</div>`, this._rendered = !0,
|
|
3870
|
+
</div>`, this._rendered = !0, R(this, this._value), this._wire(), this._syncReset();
|
|
3871
3871
|
}
|
|
3872
3872
|
_refs() {
|
|
3873
3873
|
return {
|
|
@@ -3893,7 +3893,7 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
3893
3893
|
let t = e.dataset.value === String(this._value);
|
|
3894
3894
|
e.classList.toggle("selected", t), e.setAttribute("aria-selected", String(t));
|
|
3895
3895
|
}
|
|
3896
|
-
e && (e.innerHTML = t ?
|
|
3896
|
+
e && (e.innerHTML = t ? Xt(t) : V(this.getAttribute("placeholder") || "Select..."), e.classList.toggle("search-select-placeholder", !t));
|
|
3897
3897
|
}
|
|
3898
3898
|
_syncReset() {
|
|
3899
3899
|
let { reset: e } = this._refs();
|
|
@@ -3906,8 +3906,8 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
3906
3906
|
let t = () => {
|
|
3907
3907
|
if (this.hasAttribute("compact")) {
|
|
3908
3908
|
let t = e.control.getBoundingClientRect();
|
|
3909
|
-
e.menu.style.width = "max-content", e.menu.style.minWidth = `${t.width}px`, e.menu.style.maxWidth = "280px",
|
|
3910
|
-
} else
|
|
3909
|
+
e.menu.style.width = "max-content", e.menu.style.minWidth = `${t.width}px`, e.menu.style.maxWidth = "280px", I(e.control, e.menu);
|
|
3910
|
+
} else I(e.control, e.menu, { matchWidth: !0 });
|
|
3911
3911
|
}, n = (t) => {
|
|
3912
3912
|
let n = this._visible();
|
|
3913
3913
|
this._active = t;
|
|
@@ -3927,7 +3927,7 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
3927
3927
|
}, s = (t) => {
|
|
3928
3928
|
this.value = t.dataset.value, this.dispatchEvent(new Event("change", { bubbles: !0 })), o(), e.control.focus();
|
|
3929
3929
|
};
|
|
3930
|
-
this._navHandler =
|
|
3930
|
+
this._navHandler = Gt({
|
|
3931
3931
|
getVisibleOptions: () => this._visible(),
|
|
3932
3932
|
getActive: () => this._active,
|
|
3933
3933
|
setActive: (e) => n(e),
|
|
@@ -3958,40 +3958,40 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
3958
3958
|
}), e.menu.addEventListener("keydown", this._navHandler.handler), this._bindGlobal = () => {
|
|
3959
3959
|
this._teardown(), this._onDocClick = (e) => {
|
|
3960
3960
|
i() && !this.contains(e.target) && o();
|
|
3961
|
-
}, document.addEventListener("click", this._onDocClick),
|
|
3961
|
+
}, document.addEventListener("click", this._onDocClick), Bt(this, () => {
|
|
3962
3962
|
i() && t();
|
|
3963
3963
|
});
|
|
3964
3964
|
}, this._bindGlobal();
|
|
3965
3965
|
}
|
|
3966
3966
|
_teardown() {
|
|
3967
|
-
this._onDocClick &&= (document.removeEventListener("click", this._onDocClick), null),
|
|
3967
|
+
this._onDocClick &&= (document.removeEventListener("click", this._onDocClick), null), L(this), this._navHandler?.teardown();
|
|
3968
3968
|
}
|
|
3969
3969
|
disconnectedCallback() {
|
|
3970
3970
|
this._teardown();
|
|
3971
3971
|
}
|
|
3972
|
-
},
|
|
3972
|
+
}, kn = (e) => String(e ?? "").replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<"), An = (e) => {
|
|
3973
3973
|
if (e == null) return null;
|
|
3974
3974
|
let t = String(e).split(",").map((e) => e.trim().toUpperCase()).filter(Boolean);
|
|
3975
3975
|
return t.length ? new Set(t) : null;
|
|
3976
|
-
},
|
|
3977
|
-
let t =
|
|
3978
|
-
return
|
|
3976
|
+
}, jn = (e) => {
|
|
3977
|
+
let t = An(e);
|
|
3978
|
+
return En.filter(([e]) => !t || t.has(e)).map(([e, t]) => ({
|
|
3979
3979
|
value: e,
|
|
3980
3980
|
label: t,
|
|
3981
3981
|
flag: e
|
|
3982
3982
|
}));
|
|
3983
|
-
},
|
|
3983
|
+
}, Mn = class extends On {
|
|
3984
3984
|
static get observedAttributes() {
|
|
3985
|
-
return [...
|
|
3985
|
+
return [...On.observedAttributes, "countries"];
|
|
3986
3986
|
}
|
|
3987
3987
|
_readOptions() {
|
|
3988
3988
|
let e = this.getAttribute("countries");
|
|
3989
3989
|
return this._countryCache?.attr !== e && (this._countryCache = {
|
|
3990
3990
|
attr: e,
|
|
3991
|
-
options:
|
|
3991
|
+
options: jn(e)
|
|
3992
3992
|
}), this._countryCache.options;
|
|
3993
3993
|
}
|
|
3994
|
-
},
|
|
3994
|
+
}, Nn = [
|
|
3995
3995
|
"January",
|
|
3996
3996
|
"February",
|
|
3997
3997
|
"March",
|
|
@@ -4004,7 +4004,7 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
4004
4004
|
"October",
|
|
4005
4005
|
"November",
|
|
4006
4006
|
"December"
|
|
4007
|
-
],
|
|
4007
|
+
], Pn = [
|
|
4008
4008
|
"Su",
|
|
4009
4009
|
"Mo",
|
|
4010
4010
|
"Tu",
|
|
@@ -4012,24 +4012,24 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
4012
4012
|
"Th",
|
|
4013
4013
|
"Fr",
|
|
4014
4014
|
"Sa"
|
|
4015
|
-
],
|
|
4015
|
+
], Fn = (e) => String(e).padStart(2, "0"), In = (e, t, n) => `${e}-${Fn(t + 1)}-${Fn(n)}`, G = (e) => {
|
|
4016
4016
|
let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e || "");
|
|
4017
4017
|
return t ? {
|
|
4018
4018
|
y: +t[1],
|
|
4019
4019
|
m: t[2] - 1,
|
|
4020
4020
|
d: +t[3]
|
|
4021
4021
|
} : null;
|
|
4022
|
-
},
|
|
4023
|
-
let t =
|
|
4024
|
-
return t ? `${
|
|
4025
|
-
},
|
|
4022
|
+
}, Ln = (e) => {
|
|
4023
|
+
let t = G(e);
|
|
4024
|
+
return t ? `${Fn(t.d)} ${Nn[t.m].slice(0, 3)} ${t.y}` : "";
|
|
4025
|
+
}, Rn = (e, t) => new Date(e, t + 1, 0).getDate(), K = (e, t) => {
|
|
4026
4026
|
for (; t < 0;) t += 12, --e;
|
|
4027
4027
|
for (; t > 11;) t -= 12, e += 1;
|
|
4028
4028
|
return {
|
|
4029
4029
|
y: e,
|
|
4030
4030
|
m: t
|
|
4031
4031
|
};
|
|
4032
|
-
},
|
|
4032
|
+
}, zn = class extends e {
|
|
4033
4033
|
static formAssociated = !0;
|
|
4034
4034
|
static get observedAttributes() {
|
|
4035
4035
|
return [
|
|
@@ -4081,7 +4081,7 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
4081
4081
|
return this._value;
|
|
4082
4082
|
}
|
|
4083
4083
|
set value(e) {
|
|
4084
|
-
this._value = e || "",
|
|
4084
|
+
this._value = e || "", R(this, this._value), this._syncTrigger();
|
|
4085
4085
|
}
|
|
4086
4086
|
_firstDay() {
|
|
4087
4087
|
let e = Number.parseInt(this.getAttribute("first-day") ?? "", 10);
|
|
@@ -4089,29 +4089,29 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
4089
4089
|
}
|
|
4090
4090
|
render() {
|
|
4091
4091
|
this._defaultValue === void 0 && (this._defaultValue = this.getAttribute("value") || "", this._value = this._defaultValue || this._value);
|
|
4092
|
-
let e = this.getAttribute("placeholder") || "Enter Date", t =
|
|
4092
|
+
let e = this.getAttribute("placeholder") || "Enter Date", t = G(this._value);
|
|
4093
4093
|
t && (this._viewY = t.y, this._viewM = t.m);
|
|
4094
4094
|
let n = this.getAttribute("size"), r = n === "sm" ? " input-sm" : n === "lg" ? " input-lg" : "", i = this.getAttribute("aria-label"), a = this.getAttribute("aria-describedby");
|
|
4095
4095
|
this.innerHTML = `
|
|
4096
4096
|
<div class="datepicker">
|
|
4097
|
-
<button type="button" class="input datepicker-trigger${r}${t ? " has-value" : ""}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""}${i ? ` aria-label="${
|
|
4098
|
-
<span data-trigger-label class="${t ? "" : "search-select-placeholder"}">${t ?
|
|
4099
|
-
${
|
|
4097
|
+
<button type="button" class="input datepicker-trigger${r}${t ? " has-value" : ""}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""}${i ? ` aria-label="${V(i)}"` : ""}${a ? ` aria-describedby="${V(a)}"` : ""}>
|
|
4098
|
+
<span data-trigger-label class="${t ? "" : "search-select-placeholder"}">${t ? Ln(this._value) : V(e)}</span>
|
|
4099
|
+
${B("calendar-dots")}
|
|
4100
4100
|
</button>
|
|
4101
4101
|
<div class="datepicker-pop" role="dialog" aria-modal="false" hidden></div>
|
|
4102
|
-
</div>`, this._rendered = !0,
|
|
4102
|
+
</div>`, this._rendered = !0, R(this, this._value), this._wire();
|
|
4103
4103
|
}
|
|
4104
4104
|
_syncFormValue() {
|
|
4105
|
-
|
|
4105
|
+
R(this, this._value);
|
|
4106
4106
|
}
|
|
4107
4107
|
_syncTrigger() {
|
|
4108
4108
|
let e = this.querySelector(".datepicker-trigger"), t = this.querySelector("[data-trigger-label]");
|
|
4109
4109
|
if (!t) return;
|
|
4110
|
-
let n =
|
|
4111
|
-
t.textContent = n ?
|
|
4110
|
+
let n = G(this._value);
|
|
4111
|
+
t.textContent = n ? Ln(this._value) : this.getAttribute("placeholder") || "Enter Date", t.classList.toggle("search-select-placeholder", !n), e?.classList.toggle("has-value", !!n);
|
|
4112
4112
|
}
|
|
4113
4113
|
_limits() {
|
|
4114
|
-
let e =
|
|
4114
|
+
let e = G(this.getAttribute("min")), t = G(this.getAttribute("max")), n = e ? new Date(e.y, e.m, e.d).getTime() : -Infinity, r = t ? new Date(t.y, t.m, t.d).getTime() : Infinity;
|
|
4115
4115
|
return {
|
|
4116
4116
|
dayDisabled: (e, t, i) => {
|
|
4117
4117
|
let a = new Date(e, t, i).getTime();
|
|
@@ -4119,7 +4119,7 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
4119
4119
|
},
|
|
4120
4120
|
monthDisabled: (e, t) => {
|
|
4121
4121
|
let i = new Date(e, t, 1).getTime();
|
|
4122
|
-
return new Date(e, t,
|
|
4122
|
+
return new Date(e, t, Rn(e, t)).getTime() < n || i > r;
|
|
4123
4123
|
},
|
|
4124
4124
|
yearDisabled: (e) => {
|
|
4125
4125
|
let t = new Date(e, 0, 1).getTime();
|
|
@@ -4132,29 +4132,29 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
4132
4132
|
e && (this._mode === "months" ? e.innerHTML = this._monthsHtml() : this._mode === "years" ? e.innerHTML = this._yearsHtml() : e.innerHTML = this._daysHtml(), this._focusActive());
|
|
4133
4133
|
}
|
|
4134
4134
|
_daysHtml() {
|
|
4135
|
-
let e = this._firstDay(), t = (new Date(this._viewY, this._viewM, 1).getDay() - e + 7) % 7, n =
|
|
4135
|
+
let e = this._firstDay(), t = (new Date(this._viewY, this._viewM, 1).getDay() - e + 7) % 7, n = Rn(this._viewY, this._viewM), r = G(this._value), i = /* @__PURE__ */ new Date(), { dayDisabled: a } = this._limits(), o = this._focus || r || {
|
|
4136
4136
|
y: this._viewY,
|
|
4137
4137
|
m: this._viewM,
|
|
4138
4138
|
d: 1
|
|
4139
4139
|
}, s = (e, t, n, s) => {
|
|
4140
|
-
let c =
|
|
4140
|
+
let c = In(e, t, n), l = r && r.y === e && r.m === t && r.d === n, u = i.getFullYear() === e && i.getMonth() === t && i.getDate() === n, d = o.y === e && o.m === t && o.d === n, f = a(e, t, n);
|
|
4141
4141
|
return `<button type="button" class="${[
|
|
4142
4142
|
"datepicker-day",
|
|
4143
4143
|
s ? "is-outside" : "",
|
|
4144
4144
|
u ? "is-today" : "",
|
|
4145
4145
|
l ? "is-selected" : ""
|
|
4146
4146
|
].filter(Boolean).join(" ")}" data-iso="${c}" role="gridcell" tabindex="${d && !f ? "0" : "-1"}"${l ? " aria-selected=\"true\"" : ""}${f ? " disabled aria-disabled=\"true\"" : ""}>${n}</button>`;
|
|
4147
|
-
}, c = "", l =
|
|
4147
|
+
}, c = "", l = K(this._viewY, this._viewM - 1), u = Rn(l.y, l.m);
|
|
4148
4148
|
for (let e = t - 1; e >= 0; e--) c += s(l.y, l.m, u - e, !0);
|
|
4149
4149
|
for (let e = 1; e <= n; e++) c += s(this._viewY, this._viewM, e, !1);
|
|
4150
|
-
let d =
|
|
4150
|
+
let d = K(this._viewY, this._viewM + 1), f = (7 - (t + n) % 7) % 7;
|
|
4151
4151
|
for (let e = 1; e <= f; e++) c += s(d.y, d.m, e, !0);
|
|
4152
|
-
let p = a(i.getFullYear(), i.getMonth(), i.getDate()), m =
|
|
4152
|
+
let p = a(i.getFullYear(), i.getMonth(), i.getDate()), m = Pn.map((t, n) => Pn[(n + e) % 7]).map((e) => `<span>${e}</span>`).join("");
|
|
4153
4153
|
return `
|
|
4154
4154
|
<div class="datepicker-head">
|
|
4155
|
-
<button type="button" class="datepicker-nav-btn" data-nav="-1" aria-label="Previous month">${
|
|
4156
|
-
<button type="button" class="datepicker-month" data-view="months" aria-label="Choose month and year">${
|
|
4157
|
-
<button type="button" class="datepicker-nav-btn" data-nav="1" aria-label="Next month">${
|
|
4155
|
+
<button type="button" class="datepicker-nav-btn" data-nav="-1" aria-label="Previous month">${B("chevron-left")}</button>
|
|
4156
|
+
<button type="button" class="datepicker-month" data-view="months" aria-label="Choose month and year">${Nn[this._viewM]} ${this._viewY}</button>
|
|
4157
|
+
<button type="button" class="datepicker-nav-btn" data-nav="1" aria-label="Next month">${B("chevron-right")}</button>
|
|
4158
4158
|
</div>
|
|
4159
4159
|
<div class="datepicker-weekdays">${m}</div>
|
|
4160
4160
|
<div class="datepicker-grid${this._slide ? ` ${this._slide}` : ""}" role="grid">${c}</div>
|
|
@@ -4164,25 +4164,25 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
4164
4164
|
</div>`;
|
|
4165
4165
|
}
|
|
4166
4166
|
_monthsHtml() {
|
|
4167
|
-
let e =
|
|
4167
|
+
let e = G(this._value), t = /* @__PURE__ */ new Date(), { monthDisabled: n } = this._limits(), r = "";
|
|
4168
4168
|
for (let i = 0; i < 12; i++) {
|
|
4169
4169
|
let a = e && e.y === this._viewY && e.m === i, o = t.getFullYear() === this._viewY && t.getMonth() === i, s = n(this._viewY, i), c = [
|
|
4170
4170
|
"datepicker-cell",
|
|
4171
4171
|
o ? "is-today" : "",
|
|
4172
4172
|
a ? "is-selected" : ""
|
|
4173
4173
|
].filter(Boolean).join(" ");
|
|
4174
|
-
r += `<button type="button" class="${c}" data-month="${i}"${s ? " disabled" : ""}>${
|
|
4174
|
+
r += `<button type="button" class="${c}" data-month="${i}"${s ? " disabled" : ""}>${Nn[i].slice(0, 3)}</button>`;
|
|
4175
4175
|
}
|
|
4176
4176
|
return `
|
|
4177
4177
|
<div class="datepicker-head">
|
|
4178
|
-
<button type="button" class="datepicker-nav-btn" data-nav-year="-1" aria-label="Previous year">${
|
|
4178
|
+
<button type="button" class="datepicker-nav-btn" data-nav-year="-1" aria-label="Previous year">${B("chevron-left")}</button>
|
|
4179
4179
|
<button type="button" class="datepicker-month" data-view="years" aria-label="Choose year">${this._viewY}</button>
|
|
4180
|
-
<button type="button" class="datepicker-nav-btn" data-nav-year="1" aria-label="Next year">${
|
|
4180
|
+
<button type="button" class="datepicker-nav-btn" data-nav-year="1" aria-label="Next year">${B("chevron-right")}</button>
|
|
4181
4181
|
</div>
|
|
4182
4182
|
<div class="datepicker-cells">${r}</div>`;
|
|
4183
4183
|
}
|
|
4184
4184
|
_yearsHtml() {
|
|
4185
|
-
let e =
|
|
4185
|
+
let e = G(this._value), t = (/* @__PURE__ */ new Date()).getFullYear(), { yearDisabled: n } = this._limits(), r = this._viewY - (this._viewY % 10 + 10) % 10 - 1, i = "";
|
|
4186
4186
|
for (let a = 0; a < 12; a++) {
|
|
4187
4187
|
let o = r + a, s = e && e.y === o, c = t === o, l = n(o), u = [
|
|
4188
4188
|
"datepicker-cell",
|
|
@@ -4193,9 +4193,9 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
4193
4193
|
}
|
|
4194
4194
|
return `
|
|
4195
4195
|
<div class="datepicker-head">
|
|
4196
|
-
<button type="button" class="datepicker-nav-btn" data-nav-decade="-1" aria-label="Previous decade">${
|
|
4196
|
+
<button type="button" class="datepicker-nav-btn" data-nav-decade="-1" aria-label="Previous decade">${B("chevron-left")}</button>
|
|
4197
4197
|
<span class="datepicker-month">${r + 1} to ${r + 10}</span>
|
|
4198
|
-
<button type="button" class="datepicker-nav-btn" data-nav-decade="1" aria-label="Next decade">${
|
|
4198
|
+
<button type="button" class="datepicker-nav-btn" data-nav-decade="1" aria-label="Next decade">${B("chevron-right")}</button>
|
|
4199
4199
|
</div>
|
|
4200
4200
|
<div class="datepicker-cells">${i}</div>`;
|
|
4201
4201
|
}
|
|
@@ -4204,24 +4204,24 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
4204
4204
|
t && e.contains(document.activeElement) && t.focus();
|
|
4205
4205
|
}
|
|
4206
4206
|
_position(e, t) {
|
|
4207
|
-
|
|
4207
|
+
I(e, t, { clampHeight: !0 });
|
|
4208
4208
|
}
|
|
4209
4209
|
_setFocus(e, t, n, r) {
|
|
4210
|
-
let { y: i, m: a } =
|
|
4210
|
+
let { y: i, m: a } = K(e, t);
|
|
4211
4211
|
this._focus = {
|
|
4212
4212
|
y: i,
|
|
4213
4213
|
m: a,
|
|
4214
4214
|
d: n
|
|
4215
4215
|
};
|
|
4216
4216
|
let o = i !== this._viewY || a !== this._viewM;
|
|
4217
|
-
this._viewY = i, this._viewM = a, this._slide = o && r || "", this._renderView(), this._slide = "", this.querySelector(`.datepicker-day[data-iso="${
|
|
4217
|
+
this._viewY = i, this._viewM = a, this._slide = o && r || "", this._renderView(), this._slide = "", this.querySelector(`.datepicker-day[data-iso="${In(i, a, n)}"]`)?.focus();
|
|
4218
4218
|
}
|
|
4219
4219
|
_onKey(e) {
|
|
4220
4220
|
if (this._mode !== "days") {
|
|
4221
4221
|
e.key === "Escape" && this._close();
|
|
4222
4222
|
return;
|
|
4223
4223
|
}
|
|
4224
|
-
let t = this._focus ||
|
|
4224
|
+
let t = this._focus || G(this._value) || {
|
|
4225
4225
|
y: this._viewY,
|
|
4226
4226
|
m: this._viewM,
|
|
4227
4227
|
d: 1
|
|
@@ -4239,17 +4239,17 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
4239
4239
|
case "End": return n(6 - (new Date(t.y, t.m, t.d).getDay() - this._firstDay() + 7) % 7, "slide-next");
|
|
4240
4240
|
case "PageUp": {
|
|
4241
4241
|
e.preventDefault();
|
|
4242
|
-
let n =
|
|
4243
|
-
return this._setFocus(n.y, n.m, Math.min(t.d,
|
|
4242
|
+
let n = K(t.y, t.m - (e.shiftKey ? 12 : 1));
|
|
4243
|
+
return this._setFocus(n.y, n.m, Math.min(t.d, Rn(n.y, n.m)), "slide-prev");
|
|
4244
4244
|
}
|
|
4245
4245
|
case "PageDown": {
|
|
4246
4246
|
e.preventDefault();
|
|
4247
|
-
let n =
|
|
4248
|
-
return this._setFocus(n.y, n.m, Math.min(t.d,
|
|
4247
|
+
let n = K(t.y, t.m + (e.shiftKey ? 12 : 1));
|
|
4248
|
+
return this._setFocus(n.y, n.m, Math.min(t.d, Rn(n.y, n.m)), "slide-next");
|
|
4249
4249
|
}
|
|
4250
4250
|
case "Enter":
|
|
4251
4251
|
case " ":
|
|
4252
|
-
e.preventDefault(), this._limits().dayDisabled(t.y, t.m, t.d) || (this.value =
|
|
4252
|
+
e.preventDefault(), this._limits().dayDisabled(t.y, t.m, t.d) || (this.value = In(t.y, t.m, t.d), this.dispatchEvent(new Event("change", { bubbles: !0 })), this._close());
|
|
4253
4253
|
return;
|
|
4254
4254
|
case "Escape": return this._close();
|
|
4255
4255
|
default:
|
|
@@ -4261,7 +4261,7 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
4261
4261
|
if (!e || !t) return;
|
|
4262
4262
|
let r = () => !t.hidden;
|
|
4263
4263
|
this._open = () => {
|
|
4264
|
-
let r = /* @__PURE__ */ new Date(), i =
|
|
4264
|
+
let r = /* @__PURE__ */ new Date(), i = G(this._value);
|
|
4265
4265
|
(i || !this._viewNavigated) && (this._viewY = r.getFullYear(), this._viewM = r.getMonth()), this._mode = "days";
|
|
4266
4266
|
let a = r.getFullYear() === this._viewY && r.getMonth() === this._viewM, o = i && i.y === this._viewY && i.m === this._viewM;
|
|
4267
4267
|
this._focus = o ? i : {
|
|
@@ -4276,7 +4276,7 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
4276
4276
|
let t = e.target.closest("[data-nav]");
|
|
4277
4277
|
if (t) {
|
|
4278
4278
|
this._viewNavigated = !0, this._slide = Number(t.dataset.nav) < 0 ? "slide-prev" : "slide-next";
|
|
4279
|
-
let e =
|
|
4279
|
+
let e = K(this._viewY, this._viewM + Number(t.dataset.nav));
|
|
4280
4280
|
this._viewY = e.y, this._viewM = e.m, this._focus = {
|
|
4281
4281
|
y: e.y,
|
|
4282
4282
|
m: e.m,
|
|
@@ -4316,7 +4316,7 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
4316
4316
|
if (e.target.closest("[data-today]")) {
|
|
4317
4317
|
let e = /* @__PURE__ */ new Date();
|
|
4318
4318
|
if (this._limits().dayDisabled(e.getFullYear(), e.getMonth(), e.getDate())) return;
|
|
4319
|
-
this.value =
|
|
4319
|
+
this.value = In(e.getFullYear(), e.getMonth(), e.getDate()), this.dispatchEvent(new Event("change", { bubbles: !0 })), this._close();
|
|
4320
4320
|
return;
|
|
4321
4321
|
}
|
|
4322
4322
|
if (e.target.closest("[data-clear]")) {
|
|
@@ -4333,18 +4333,18 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
4333
4333
|
this._popClick = !1, r() && !t && !this.contains(e.target) && this._close();
|
|
4334
4334
|
}, document.addEventListener("click", this._onDocClick), this._onDocKey = (e) => {
|
|
4335
4335
|
r() && e.key === "Escape" && this._close();
|
|
4336
|
-
}, document.addEventListener("keydown", this._onDocKey),
|
|
4336
|
+
}, document.addEventListener("keydown", this._onDocKey), Bt(this, () => {
|
|
4337
4337
|
r() && this._position(e, t);
|
|
4338
4338
|
});
|
|
4339
4339
|
}, this._bindGlobal(), this._syncFormValue();
|
|
4340
4340
|
}
|
|
4341
4341
|
_teardown() {
|
|
4342
|
-
this._onDocClick &&= (document.removeEventListener("click", this._onDocClick), null), this._onDocKey &&= (document.removeEventListener("keydown", this._onDocKey), null),
|
|
4342
|
+
this._onDocClick &&= (document.removeEventListener("click", this._onDocClick), null), this._onDocKey &&= (document.removeEventListener("keydown", this._onDocKey), null), L(this);
|
|
4343
4343
|
}
|
|
4344
4344
|
disconnectedCallback() {
|
|
4345
4345
|
this._teardown();
|
|
4346
4346
|
}
|
|
4347
|
-
},
|
|
4347
|
+
}, Bn = class extends e {
|
|
4348
4348
|
static formAssociated = !0;
|
|
4349
4349
|
static get observedAttributes() {
|
|
4350
4350
|
return [
|
|
@@ -4412,20 +4412,20 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
4412
4412
|
text: e,
|
|
4413
4413
|
empty: !0
|
|
4414
4414
|
} : {
|
|
4415
|
-
text: `${
|
|
4415
|
+
text: `${Ln(this._start) || "Start"} to ${Ln(this._end) || "End"}`,
|
|
4416
4416
|
empty: !1
|
|
4417
4417
|
};
|
|
4418
4418
|
}
|
|
4419
4419
|
render() {
|
|
4420
4420
|
this._defaultStart === void 0 && (this._defaultStart = this.getAttribute("start") || "", this._defaultEnd = this.getAttribute("end") || "", this._start = this._defaultStart || this._start, this._end = this._defaultEnd || this._end);
|
|
4421
|
-
let e =
|
|
4421
|
+
let e = G(this._start);
|
|
4422
4422
|
e && (this._viewY = e.y, this._viewM = e.m);
|
|
4423
4423
|
let t = this.getAttribute("size"), n = t === "sm" ? " input-sm" : t === "lg" ? " input-lg" : "", { text: r, empty: i } = this._label(), a = this.getAttribute("aria-label"), o = this.getAttribute("aria-describedby");
|
|
4424
4424
|
this.innerHTML = `
|
|
4425
4425
|
<div class="daterange">
|
|
4426
|
-
<button type="button" class="input daterange-trigger${n}${i ? "" : " has-value"}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""}${a ? ` aria-label="${
|
|
4427
|
-
<span data-range-label class="${i ? "search-select-placeholder" : ""}">${
|
|
4428
|
-
${
|
|
4426
|
+
<button type="button" class="input daterange-trigger${n}${i ? "" : " has-value"}" aria-haspopup="dialog" aria-expanded="false"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""}${a ? ` aria-label="${V(a)}"` : ""}${o ? ` aria-describedby="${V(o)}"` : ""}>
|
|
4427
|
+
<span data-range-label class="${i ? "search-select-placeholder" : ""}">${V(r)}</span>
|
|
4428
|
+
${B("calendar")}
|
|
4429
4429
|
</button>
|
|
4430
4430
|
<div class="daterange-pop" role="dialog" aria-modal="false" hidden></div>
|
|
4431
4431
|
</div>`, this._rendered = !0, this._syncMirrors(), this._wire();
|
|
@@ -4452,24 +4452,24 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
4452
4452
|
r || (r = document.createElement("input"), r.type = "hidden", r.setAttribute("data-range-mirror", e), this.appendChild(r)), r.name = t, r.value = n || "", r.disabled = this.hasAttribute("disabled");
|
|
4453
4453
|
}
|
|
4454
4454
|
_limits() {
|
|
4455
|
-
let e =
|
|
4455
|
+
let e = G(this.getAttribute("min")), t = G(this.getAttribute("max")), n = e ? new Date(e.y, e.m, e.d).getTime() : -Infinity, r = t ? new Date(t.y, t.m, t.d).getTime() : Infinity;
|
|
4456
4456
|
return (e, t, i) => {
|
|
4457
4457
|
let a = new Date(e, t, i).getTime();
|
|
4458
4458
|
return a < n || a > r;
|
|
4459
4459
|
};
|
|
4460
4460
|
}
|
|
4461
4461
|
_monthHtml(e, t) {
|
|
4462
|
-
let n = this._firstDay(), r = (new Date(e, t, 1).getDay() - n + 7) % 7, i =
|
|
4463
|
-
let i =
|
|
4462
|
+
let n = this._firstDay(), r = (new Date(e, t, 1).getDay() - n + 7) % 7, i = Rn(e, t), a = this._limits(), o = Pn.map((e, t) => Pn[(t + n) % 7]).map((e) => `<span>${e}</span>`).join(""), s = (e, t, n, r) => {
|
|
4463
|
+
let i = In(e, t, n), o = a(e, t, n);
|
|
4464
4464
|
return `<button type="button" class="${["datepicker-day", r ? "is-outside" : ""].filter(Boolean).join(" ")}" data-iso="${i}"${o ? " disabled" : ""}>${n}</button>`;
|
|
4465
|
-
}, c = "", l =
|
|
4465
|
+
}, c = "", l = K(e, t - 1), u = Rn(l.y, l.m);
|
|
4466
4466
|
for (let e = r - 1; e >= 0; e--) c += s(l.y, l.m, u - e, !0);
|
|
4467
4467
|
for (let n = 1; n <= i; n++) c += s(e, t, n, !1);
|
|
4468
|
-
let d =
|
|
4468
|
+
let d = K(e, t + 1), f = (7 - (r + i) % 7) % 7;
|
|
4469
4469
|
for (let e = 1; e <= f; e++) c += s(d.y, d.m, e, !0);
|
|
4470
4470
|
return `
|
|
4471
4471
|
<div class="daterange-cal">
|
|
4472
|
-
<div class="datepicker-month-label">${
|
|
4472
|
+
<div class="datepicker-month-label">${Nn[t]} ${e}</div>
|
|
4473
4473
|
<div class="datepicker-weekdays">${o}</div>
|
|
4474
4474
|
<div class="datepicker-grid" role="grid">${c}</div>
|
|
4475
4475
|
</div>`;
|
|
@@ -4477,11 +4477,11 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
4477
4477
|
_renderView() {
|
|
4478
4478
|
let e = this.querySelector(".daterange-pop");
|
|
4479
4479
|
if (!e) return;
|
|
4480
|
-
let t =
|
|
4480
|
+
let t = K(this._viewY, this._viewM + 1);
|
|
4481
4481
|
e.innerHTML = `
|
|
4482
4482
|
<div class="daterange-head">
|
|
4483
|
-
<button type="button" class="datepicker-nav-btn" data-nav="-1" aria-label="Previous month">${
|
|
4484
|
-
<button type="button" class="datepicker-nav-btn" data-nav="1" aria-label="Next month">${
|
|
4483
|
+
<button type="button" class="datepicker-nav-btn" data-nav="-1" aria-label="Previous month">${B("chevron-left")}</button>
|
|
4484
|
+
<button type="button" class="datepicker-nav-btn" data-nav="1" aria-label="Next month">${B("chevron-right")}</button>
|
|
4485
4485
|
</div>
|
|
4486
4486
|
<div class="daterange-cals">
|
|
4487
4487
|
${this._monthHtml(this._viewY, this._viewM)}
|
|
@@ -4503,10 +4503,10 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
4503
4503
|
n.classList.toggle("is-range-start", i), n.classList.toggle("is-range-end", a), n.classList.toggle("in-range", o);
|
|
4504
4504
|
}
|
|
4505
4505
|
let i = e.querySelector("[data-range-hint]");
|
|
4506
|
-
i && (i.textContent = this._start ? this._end ? `${
|
|
4506
|
+
i && (i.textContent = this._start ? this._end ? `${Ln(this._start)} to ${Ln(this._end)}` : "Pick an end date" : "Pick a start date");
|
|
4507
4507
|
}
|
|
4508
4508
|
_position(e, t) {
|
|
4509
|
-
|
|
4509
|
+
I(e, t, { clampHeight: !0 });
|
|
4510
4510
|
}
|
|
4511
4511
|
_pick(e) {
|
|
4512
4512
|
if (!this._start || this._start && this._end) {
|
|
@@ -4525,7 +4525,7 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
4525
4525
|
if (!e || !t) return;
|
|
4526
4526
|
let r = () => !t.hidden;
|
|
4527
4527
|
this._open = () => {
|
|
4528
|
-
let r =
|
|
4528
|
+
let r = G(this._start);
|
|
4529
4529
|
if (r) this._viewY = r.y, this._viewM = r.m;
|
|
4530
4530
|
else {
|
|
4531
4531
|
let e = /* @__PURE__ */ new Date();
|
|
@@ -4538,7 +4538,7 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
4538
4538
|
this._popClick = !0;
|
|
4539
4539
|
let t = e.target.closest("[data-nav]");
|
|
4540
4540
|
if (t) {
|
|
4541
|
-
let e =
|
|
4541
|
+
let e = K(this._viewY, this._viewM + Number(t.dataset.nav));
|
|
4542
4542
|
this._viewY = e.y, this._viewM = e.m, this._renderView();
|
|
4543
4543
|
return;
|
|
4544
4544
|
}
|
|
@@ -4557,18 +4557,18 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
4557
4557
|
this._popClick = !1, r() && !t && !this.contains(e.target) && this._close();
|
|
4558
4558
|
}, document.addEventListener("click", this._onDocClick), this._onDocKey = (e) => {
|
|
4559
4559
|
r() && e.key === "Escape" && this._close();
|
|
4560
|
-
}, document.addEventListener("keydown", this._onDocKey),
|
|
4560
|
+
}, document.addEventListener("keydown", this._onDocKey), Bt(this, () => {
|
|
4561
4561
|
r() && this._position(e, t);
|
|
4562
4562
|
});
|
|
4563
4563
|
}, this._bindGlobal(), this._syncMirrors();
|
|
4564
4564
|
}
|
|
4565
4565
|
_teardown() {
|
|
4566
|
-
this._onDocClick &&= (document.removeEventListener("click", this._onDocClick), null), this._onDocKey &&= (document.removeEventListener("keydown", this._onDocKey), null),
|
|
4566
|
+
this._onDocClick &&= (document.removeEventListener("click", this._onDocClick), null), this._onDocKey &&= (document.removeEventListener("keydown", this._onDocKey), null), L(this);
|
|
4567
4567
|
}
|
|
4568
4568
|
disconnectedCallback() {
|
|
4569
4569
|
this._teardown();
|
|
4570
4570
|
}
|
|
4571
|
-
},
|
|
4571
|
+
}, Vn = class extends e {
|
|
4572
4572
|
static get observedAttributes() {
|
|
4573
4573
|
return [
|
|
4574
4574
|
"static",
|
|
@@ -4589,10 +4589,10 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
4589
4589
|
e === "static" && this.isConnected && this._wire();
|
|
4590
4590
|
}
|
|
4591
4591
|
_maxScale() {
|
|
4592
|
-
return
|
|
4592
|
+
return Hn(this.getAttribute("max-scale"), 1.6);
|
|
4593
4593
|
}
|
|
4594
4594
|
_radius() {
|
|
4595
|
-
return
|
|
4595
|
+
return Hn(this.getAttribute("radius"), 100);
|
|
4596
4596
|
}
|
|
4597
4597
|
_magnifyEnabled() {
|
|
4598
4598
|
return !(this.hasAttribute("static") || typeof matchMedia == "function" && (matchMedia("(pointer: coarse)").matches || matchMedia("(prefers-reduced-motion: reduce)").matches));
|
|
@@ -4617,21 +4617,21 @@ var Dn = (e) => e instanceof Element ? e : e?.parentElement ?? null, On = class
|
|
|
4617
4617
|
_teardown() {
|
|
4618
4618
|
this._pointerMoveListener &&= (this.removeEventListener("pointermove", this._pointerMoveListener), null), this._pointerLeaveListener &&= (this.removeEventListener("pointerleave", this._pointerLeaveListener), null), this._resetMagnification();
|
|
4619
4619
|
}
|
|
4620
|
-
},
|
|
4620
|
+
}, Hn = (e, t) => {
|
|
4621
4621
|
let n = Number.parseFloat(e);
|
|
4622
4622
|
return Number.isFinite(n) ? n : t;
|
|
4623
|
-
},
|
|
4623
|
+
}, Un = 4096, Wn = [
|
|
4624
4624
|
.92,
|
|
4625
4625
|
.8,
|
|
4626
4626
|
.65,
|
|
4627
4627
|
.5
|
|
4628
|
-
],
|
|
4629
|
-
function
|
|
4628
|
+
], Gn = .8, Kn = 8;
|
|
4629
|
+
function qn(e) {
|
|
4630
4630
|
if (e == null || e === "" || e === "free") return null;
|
|
4631
4631
|
let t = typeof e == "number" ? e : Number(e);
|
|
4632
4632
|
return Number.isFinite(t) && t > 0 ? t : null;
|
|
4633
4633
|
}
|
|
4634
|
-
function
|
|
4634
|
+
function Jn(e, t, n) {
|
|
4635
4635
|
if (!n) return {
|
|
4636
4636
|
x: 0,
|
|
4637
4637
|
y: 0,
|
|
@@ -4646,46 +4646,46 @@ function Zn(e, t, n) {
|
|
|
4646
4646
|
h: i
|
|
4647
4647
|
};
|
|
4648
4648
|
}
|
|
4649
|
-
function
|
|
4649
|
+
function Yn(e, t, n) {
|
|
4650
4650
|
return {
|
|
4651
4651
|
...e,
|
|
4652
4652
|
x: Math.min(Math.max(e.x, 0), Math.max(t - e.w, 0)),
|
|
4653
4653
|
y: Math.min(Math.max(e.y, 0), Math.max(n - e.h, 0))
|
|
4654
4654
|
};
|
|
4655
4655
|
}
|
|
4656
|
-
function
|
|
4657
|
-
return
|
|
4656
|
+
function Xn(e, t, n, r, i) {
|
|
4657
|
+
return Yn({
|
|
4658
4658
|
...e,
|
|
4659
4659
|
x: e.x + t,
|
|
4660
4660
|
y: e.y + n
|
|
4661
4661
|
}, r, i);
|
|
4662
4662
|
}
|
|
4663
|
-
function
|
|
4663
|
+
function Zn(e, t) {
|
|
4664
4664
|
return Math.min(32, e, t);
|
|
4665
4665
|
}
|
|
4666
|
-
function
|
|
4666
|
+
function Qn(e, t) {
|
|
4667
4667
|
return t.w / e.w;
|
|
4668
4668
|
}
|
|
4669
|
-
function
|
|
4670
|
-
return Math.max(4,
|
|
4669
|
+
function $n(e, t) {
|
|
4670
|
+
return Math.max(4, Qn(e, t));
|
|
4671
4671
|
}
|
|
4672
|
-
function
|
|
4673
|
-
let a = Math.min(Math.max(n, 1),
|
|
4674
|
-
return
|
|
4672
|
+
function er(e, t, n, r, i) {
|
|
4673
|
+
let a = Math.min(Math.max(n, 1), $n(e, t)), o = e.h / e.w, s = Math.min(r, i / o), c = Math.min(Math.max(Zn(r, i), Zn(r, i) / o), s), l = Math.min(Math.max(t.w / a, c), s), u = l * o, d = e.x + e.w / 2, f = e.y + e.h / 2;
|
|
4674
|
+
return Yn({
|
|
4675
4675
|
x: d - l / 2,
|
|
4676
4676
|
y: f - u / 2,
|
|
4677
4677
|
w: l,
|
|
4678
4678
|
h: u
|
|
4679
4679
|
}, r, i);
|
|
4680
4680
|
}
|
|
4681
|
-
var
|
|
4681
|
+
var tr = [
|
|
4682
4682
|
"nw",
|
|
4683
4683
|
"ne",
|
|
4684
4684
|
"sw",
|
|
4685
4685
|
"se"
|
|
4686
4686
|
];
|
|
4687
|
-
function
|
|
4688
|
-
let o =
|
|
4687
|
+
function nr(e, t, n, r, i, a) {
|
|
4688
|
+
let o = Zn(i, a), s = t.endsWith("w"), c = t.startsWith("n"), l = s ? e.x + e.w : e.x, u = c ? e.y + e.h : e.y, d = Math.min(Math.max(n, 0), i), f = Math.min(Math.max(r, 0), a);
|
|
4689
4689
|
return d = s ? Math.min(d, l - o) : Math.max(d, l + o), f = c ? Math.min(f, u - o) : Math.max(f, u + o), {
|
|
4690
4690
|
x: Math.min(d, l),
|
|
4691
4691
|
y: Math.min(f, u),
|
|
@@ -4693,53 +4693,53 @@ function ar(e, t, n, r, i, a) {
|
|
|
4693
4693
|
h: Math.abs(f - u)
|
|
4694
4694
|
};
|
|
4695
4695
|
}
|
|
4696
|
-
function
|
|
4696
|
+
function rr(e, t = Un) {
|
|
4697
4697
|
let n = Math.min(1, t / Math.max(e.w, e.h));
|
|
4698
4698
|
return {
|
|
4699
4699
|
width: Math.max(1, Math.round(e.w * n)),
|
|
4700
4700
|
height: Math.max(1, Math.round(e.h * n))
|
|
4701
4701
|
};
|
|
4702
4702
|
}
|
|
4703
|
-
var
|
|
4703
|
+
var ir = [
|
|
4704
4704
|
"image/png",
|
|
4705
4705
|
"image/jpeg",
|
|
4706
4706
|
"image/webp"
|
|
4707
|
-
],
|
|
4707
|
+
], ar = {
|
|
4708
4708
|
"image/png": ".png",
|
|
4709
4709
|
"image/jpeg": ".jpg",
|
|
4710
4710
|
"image/webp": ".webp"
|
|
4711
4711
|
};
|
|
4712
|
-
function
|
|
4712
|
+
function or(e) {
|
|
4713
4713
|
let t = String(e || "").toLowerCase();
|
|
4714
|
-
return
|
|
4714
|
+
return ir.includes(t) ? t : "image/png";
|
|
4715
4715
|
}
|
|
4716
|
-
function
|
|
4717
|
-
let n = String(e || "image"), r =
|
|
4716
|
+
function sr(e, t) {
|
|
4717
|
+
let n = String(e || "image"), r = ar[t];
|
|
4718
4718
|
return (t === "image/jpeg" ? /\.jpe?g$/i.test(n) : n.toLowerCase().endsWith(r)) ? n : `${n.replace(/\.[^./\\]+$/, "") || "image"}${r}`;
|
|
4719
4719
|
}
|
|
4720
|
-
async function
|
|
4720
|
+
async function cr(e, { width: t, height: n, type: r, maxBytes: i }) {
|
|
4721
4721
|
let a = r, o = t, s = n, c = null;
|
|
4722
|
-
for (let t = 0; t <=
|
|
4723
|
-
let n = a === "image/png" ? [void 0] : t === 0 ?
|
|
4722
|
+
for (let t = 0; t <= Kn; t++) {
|
|
4723
|
+
let n = a === "image/png" ? [void 0] : t === 0 ? Wn : [Wn[1]];
|
|
4724
4724
|
for (let t of n) {
|
|
4725
4725
|
if (c = await e(o, s, a, t), !c || (c.type && c.type !== a && (a = c.type), !(i > 0) || c.size <= i)) return c;
|
|
4726
4726
|
if (a === "image/png") break;
|
|
4727
4727
|
}
|
|
4728
|
-
o = Math.max(1, Math.round(o *
|
|
4728
|
+
o = Math.max(1, Math.round(o * Gn)), s = Math.max(1, Math.round(s * Gn));
|
|
4729
4729
|
}
|
|
4730
4730
|
return c;
|
|
4731
4731
|
}
|
|
4732
4732
|
//#endregion
|
|
4733
4733
|
//#region src/WuiImageCrop.js
|
|
4734
|
-
var
|
|
4734
|
+
var lr = .05, ur = .2, dr = {
|
|
4735
4735
|
w: 320,
|
|
4736
4736
|
h: 240
|
|
4737
|
-
},
|
|
4737
|
+
}, fr = {
|
|
4738
4738
|
nw: "top left",
|
|
4739
4739
|
ne: "top right",
|
|
4740
4740
|
sw: "bottom left",
|
|
4741
4741
|
se: "bottom right"
|
|
4742
|
-
},
|
|
4742
|
+
}, pr = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" aria-hidden=\"true\"><path d=\"M5 12h14\"/></svg>", mr = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" aria-hidden=\"true\"><path d=\"M5 12h14M12 5v14\"/></svg>", hr = class extends e {
|
|
4743
4743
|
static get observedAttributes() {
|
|
4744
4744
|
return [
|
|
4745
4745
|
"src",
|
|
@@ -4757,7 +4757,7 @@ var fr = .05, pr = .2, mr = {
|
|
|
4757
4757
|
e == null || e === "" ? this.removeAttribute("src") : this.setAttribute("src", String(e));
|
|
4758
4758
|
}
|
|
4759
4759
|
get aspect() {
|
|
4760
|
-
return
|
|
4760
|
+
return qn(this.getAttribute("aspect"));
|
|
4761
4761
|
}
|
|
4762
4762
|
set aspect(e) {
|
|
4763
4763
|
e == null || e === "" ? this.removeAttribute("aspect") : this.setAttribute("aspect", String(e));
|
|
@@ -4772,10 +4772,10 @@ var fr = .05, pr = .2, mr = {
|
|
|
4772
4772
|
return this._rect ? { ...this._rect } : null;
|
|
4773
4773
|
}
|
|
4774
4774
|
get zoom() {
|
|
4775
|
-
return this._rect ?
|
|
4775
|
+
return this._rect ? Qn(this._rect, this._base) : 1;
|
|
4776
4776
|
}
|
|
4777
4777
|
set zoom(e) {
|
|
4778
|
-
this._rect && (this._rect =
|
|
4778
|
+
this._rect && (this._rect = er(this._rect, this._base, Number(e) || 1, this._natural.w, this._natural.h), this._paint(), this._announce());
|
|
4779
4779
|
}
|
|
4780
4780
|
connectedCallback() {
|
|
4781
4781
|
if (!this._rendered) {
|
|
@@ -4797,18 +4797,18 @@ var fr = .05, pr = .2, mr = {
|
|
|
4797
4797
|
<div class="wui-crop-frame"></div>
|
|
4798
4798
|
</div>
|
|
4799
4799
|
<div class="wui-crop-controls">
|
|
4800
|
-
<button type="button" class="wui-crop-zoombtn" data-zoom="out" aria-label="Zoom out">${
|
|
4800
|
+
<button type="button" class="wui-crop-zoombtn" data-zoom="out" aria-label="Zoom out">${pr}</button>
|
|
4801
4801
|
<input type="range" class="form-range wui-crop-zoom" min="1" max="4" step="0.01" value="1" aria-label="Zoom">
|
|
4802
|
-
<button type="button" class="wui-crop-zoombtn" data-zoom="in" aria-label="Zoom in">${
|
|
4802
|
+
<button type="button" class="wui-crop-zoombtn" data-zoom="in" aria-label="Zoom in">${mr}</button>
|
|
4803
4803
|
</div>
|
|
4804
4804
|
<div class="visually-hidden" data-wui-crop-live aria-live="polite"></div>
|
|
4805
4805
|
</div>`, this._stage = this.querySelector(".wui-crop-stage"), this._img = this.querySelector(".wui-crop-img"), this._frame = this.querySelector(".wui-crop-frame"), this._slider = this.querySelector(".wui-crop-zoom"), this._live = this.querySelector("[data-wui-crop-live]"), this._rendered = !0, this._frame.classList.toggle("wui-crop-frame--round", this.round), this._rebuildHandles(), this._wire(), this._observe(), this._loadImage();
|
|
4806
4806
|
}
|
|
4807
4807
|
_rebuildHandles() {
|
|
4808
4808
|
for (let e of this._frame.querySelectorAll(".wui-crop-handle")) e.remove();
|
|
4809
|
-
if (!this.aspect) for (let e of
|
|
4809
|
+
if (!this.aspect) for (let e of tr) {
|
|
4810
4810
|
let t = document.createElement("button");
|
|
4811
|
-
t.type = "button", t.className = `wui-crop-handle wui-crop-handle--${e}`, t.dataset.handle = e, t.setAttribute("aria-label", `Resize ${
|
|
4811
|
+
t.type = "button", t.className = `wui-crop-handle wui-crop-handle--${e}`, t.dataset.handle = e, t.setAttribute("aria-label", `Resize ${fr[e]} corner`), this._frame.appendChild(t);
|
|
4812
4812
|
}
|
|
4813
4813
|
}
|
|
4814
4814
|
_loadImage() {
|
|
@@ -4824,13 +4824,13 @@ var fr = .05, pr = .2, mr = {
|
|
|
4824
4824
|
}, this._img.src = e);
|
|
4825
4825
|
}
|
|
4826
4826
|
_resetRect() {
|
|
4827
|
-
this._natural && (this._base =
|
|
4827
|
+
this._natural && (this._base = Jn(this._natural.w, this._natural.h, this.aspect), this._rect = { ...this._base }, this._frame.hidden = !1, this._paint());
|
|
4828
4828
|
}
|
|
4829
4829
|
_observe() {
|
|
4830
4830
|
typeof ResizeObserver > "u" || this._resizeObserver || (this._resizeObserver = new ResizeObserver(() => this._paint()), this._resizeObserver.observe(this._stage));
|
|
4831
4831
|
}
|
|
4832
4832
|
_view() {
|
|
4833
|
-
let e = this._stage.clientWidth ||
|
|
4833
|
+
let e = this._stage.clientWidth || dr.w, t = this._stage.clientHeight || dr.h, n = Math.min(e / this._natural.w, t / this._natural.h), r = this._natural.w * n, i = this._natural.h * n;
|
|
4834
4834
|
return {
|
|
4835
4835
|
scale: n,
|
|
4836
4836
|
left: (e - r) / 2,
|
|
@@ -4855,7 +4855,7 @@ var fr = .05, pr = .2, mr = {
|
|
|
4855
4855
|
width: `${t.w * e.scale}px`,
|
|
4856
4856
|
height: `${t.h * e.scale}px`
|
|
4857
4857
|
});
|
|
4858
|
-
let n =
|
|
4858
|
+
let n = Qn(t, this._base), r = $n(t, this._base);
|
|
4859
4859
|
this._slider.max = String(r), this._slider.value = String(Math.min(Math.max(n, 1), r)), this._slider.setAttribute("aria-valuetext", `${Math.round(n * 100)}%`);
|
|
4860
4860
|
}
|
|
4861
4861
|
_announce() {
|
|
@@ -4865,7 +4865,7 @@ var fr = .05, pr = .2, mr = {
|
|
|
4865
4865
|
}));
|
|
4866
4866
|
}
|
|
4867
4867
|
_say() {
|
|
4868
|
-
let e = this._rect, t = `Frame ${Math.round(e.w)} by ${Math.round(e.h)} pixels, ${Math.round(e.x)} from the left, ${Math.round(e.y)} from the top, zoom ${Math.round(
|
|
4868
|
+
let e = this._rect, t = `Frame ${Math.round(e.w)} by ${Math.round(e.h)} pixels, ${Math.round(e.x)} from the left, ${Math.round(e.y)} from the top, zoom ${Math.round(Qn(e, this._base) * 100)}%.`;
|
|
4869
4869
|
this._live.textContent = t === this._live.textContent ? `${t}\u00a0` : t;
|
|
4870
4870
|
}
|
|
4871
4871
|
_wire() {
|
|
@@ -4886,8 +4886,8 @@ var fr = .05, pr = .2, mr = {
|
|
|
4886
4886
|
let r = this._view(), { w: i, h: a } = this._natural;
|
|
4887
4887
|
if (n.corner) {
|
|
4888
4888
|
let o = e.getBoundingClientRect(), s = (t.clientX - o.left - e.clientLeft - r.left) / r.scale, c = (t.clientY - o.top - e.clientTop - r.top) / r.scale;
|
|
4889
|
-
this._rect =
|
|
4890
|
-
} else this._rect =
|
|
4889
|
+
this._rect = nr(this._rect, n.corner, s, c, i, a);
|
|
4890
|
+
} else this._rect = Xn(n.start, (t.clientX - n.x) / r.scale, (t.clientY - n.y) / r.scale, i, a);
|
|
4891
4891
|
this._paint();
|
|
4892
4892
|
});
|
|
4893
4893
|
let t = (t) => {
|
|
@@ -4911,19 +4911,19 @@ var fr = .05, pr = .2, mr = {
|
|
|
4911
4911
|
if (e.key === "+" || e.key === "=") this.zoom *= 1.25, this._say();
|
|
4912
4912
|
else if (e.key === "-" || e.key === "_") this.zoom *= .8, this._say();
|
|
4913
4913
|
else if (e.key.startsWith("Arrow")) {
|
|
4914
|
-
let r = e.shiftKey ?
|
|
4914
|
+
let r = e.shiftKey ? ur : lr, i = e.key === "ArrowRight" ? 1 : e.key === "ArrowLeft" ? -1 : 0, a = e.key === "ArrowDown" ? 1 : e.key === "ArrowUp" ? -1 : 0, o = e.target.closest?.(".wui-crop-handle")?.dataset.handle;
|
|
4915
4915
|
if (o) {
|
|
4916
4916
|
let e = this._rect, s = (o.endsWith("w") ? e.x : e.x + e.w) + i * r * e.w, c = (o.startsWith("n") ? e.y : e.y + e.h) + a * r * e.h;
|
|
4917
|
-
this._rect =
|
|
4918
|
-
} else this._rect =
|
|
4917
|
+
this._rect = nr(e, o, s, c, t, n);
|
|
4918
|
+
} else this._rect = Xn(this._rect, i * r * this._rect.w, a * r * this._rect.h, t, n);
|
|
4919
4919
|
this._paint(), this._announce(), this._say();
|
|
4920
4920
|
} else return;
|
|
4921
4921
|
e.preventDefault();
|
|
4922
4922
|
}
|
|
4923
4923
|
async toBlob({ type: e, maxBytes: t = 0 } = {}) {
|
|
4924
4924
|
if (!this._rect) return null;
|
|
4925
|
-
let n =
|
|
4926
|
-
return
|
|
4925
|
+
let n = or(e), r = Yn(this._rect, this._natural.w, this._natural.h), { width: i, height: a } = rr(r);
|
|
4926
|
+
return cr((e, t, n, i) => new Promise((a) => {
|
|
4927
4927
|
let o = document.createElement("canvas");
|
|
4928
4928
|
o.width = e, o.height = t;
|
|
4929
4929
|
let s = o.getContext("2d");
|
|
@@ -4944,25 +4944,25 @@ var fr = .05, pr = .2, mr = {
|
|
|
4944
4944
|
type: t,
|
|
4945
4945
|
maxBytes: n
|
|
4946
4946
|
});
|
|
4947
|
-
return r ? new File([r],
|
|
4947
|
+
return r ? new File([r], sr(e, r.type), { type: r.type }) : null;
|
|
4948
4948
|
}
|
|
4949
|
-
},
|
|
4949
|
+
}, gr = {
|
|
4950
4950
|
enter: "Enter",
|
|
4951
4951
|
comma: ",",
|
|
4952
4952
|
space: " ",
|
|
4953
4953
|
tab: "Tab"
|
|
4954
|
-
},
|
|
4954
|
+
}, _r = {
|
|
4955
4955
|
enter: "\n",
|
|
4956
4956
|
comma: ",",
|
|
4957
4957
|
space: " ",
|
|
4958
4958
|
tab: " "
|
|
4959
|
-
},
|
|
4960
|
-
function
|
|
4959
|
+
}, vr = (e) => gr[e], yr = (e) => _r[e];
|
|
4960
|
+
function br(e, t) {
|
|
4961
4961
|
let n = [String(e ?? "")];
|
|
4962
4962
|
for (let e of t) n = n.flatMap((t) => t.split(e));
|
|
4963
4963
|
return n.map((e) => e.trim()).filter(Boolean);
|
|
4964
4964
|
}
|
|
4965
|
-
var
|
|
4965
|
+
var xr = (e, t) => t.some((t) => String(e ?? "").includes(t)), Sr = class extends e {
|
|
4966
4966
|
static formAssociated = !0;
|
|
4967
4967
|
_accessibleName() {
|
|
4968
4968
|
return this.getAttribute("aria-label") || this.getAttribute("placeholder") || "Select";
|
|
@@ -5026,7 +5026,7 @@ var wr = (e, t) => t.some((t) => String(e ?? "").includes(t)), Tr = class extend
|
|
|
5026
5026
|
return this._values.slice();
|
|
5027
5027
|
}
|
|
5028
5028
|
set values(e) {
|
|
5029
|
-
this._values = Array.isArray(e) ? e.map(String) : [],
|
|
5029
|
+
this._values = Array.isArray(e) ? e.map(String) : [], z(this, this._values), this._rendered && (this._renderControl(), this._renderOptions(this._query()));
|
|
5030
5030
|
}
|
|
5031
5031
|
set options(e) {
|
|
5032
5032
|
if (this._optionsProp = Array.isArray(e) ? e : null, this._rendered && this._allowCustom) {
|
|
@@ -5059,10 +5059,10 @@ var wr = (e, t) => t.some((t) => String(e ?? "").includes(t)), Tr = class extend
|
|
|
5059
5059
|
value: e.getAttribute("value") ?? e.textContent.trim(),
|
|
5060
5060
|
label: e.innerHTML,
|
|
5061
5061
|
icon: e.getAttribute("icon") || void 0,
|
|
5062
|
-
[
|
|
5062
|
+
[Kt]: !0,
|
|
5063
5063
|
selected: e.hasAttribute("selected")
|
|
5064
5064
|
};
|
|
5065
|
-
for (let [n, r] of
|
|
5065
|
+
for (let [n, r] of wr) {
|
|
5066
5066
|
let i = e.getAttribute(n);
|
|
5067
5067
|
i && (t[r] = i);
|
|
5068
5068
|
}
|
|
@@ -5078,12 +5078,12 @@ var wr = (e, t) => t.some((t) => String(e ?? "").includes(t)), Tr = class extend
|
|
|
5078
5078
|
}
|
|
5079
5079
|
_labelHtmlFor(e) {
|
|
5080
5080
|
let t = this._readOptions().find((t) => String(t.value) === String(e));
|
|
5081
|
-
return t ?
|
|
5081
|
+
return t ? Xt(t) : V(e);
|
|
5082
5082
|
}
|
|
5083
5083
|
render() {
|
|
5084
5084
|
this._snapshotDeclared();
|
|
5085
5085
|
let e = this._allowCustom, t = this.hasAttribute("searchable") && !e, n = this.getAttribute("search-placeholder") || "Search…", r = this.getAttribute("icon"), i = this.getAttribute("size"), a = i === "sm" ? " search-select-sm" : i === "lg" ? " search-select-lg" : "";
|
|
5086
|
-
|
|
5086
|
+
z(this, this._values), this.id ||= `wui-multiselect-${Math.random().toString(36).slice(2, 9)}`;
|
|
5087
5087
|
let o = `${this.id}-listbox`;
|
|
5088
5088
|
this._listboxId = o;
|
|
5089
5089
|
let s = this.hasAttribute("disabled");
|
|
@@ -5092,41 +5092,41 @@ var wr = (e, t) => t.some((t) => String(e ?? "").includes(t)), Tr = class extend
|
|
|
5092
5092
|
this.innerHTML = `
|
|
5093
5093
|
<div class="search-select${a}">
|
|
5094
5094
|
<div class="input search-select-control search-select-multi"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${s ? " aria-disabled=\"true\"" : ""}>
|
|
5095
|
-
${r ?
|
|
5096
|
-
<div class="ms-chips" data-chips><input type="text" class="ms-input" data-input role="combobox" aria-autocomplete="list" aria-haspopup="listbox" aria-expanded="false" aria-controls="${
|
|
5097
|
-
${
|
|
5095
|
+
${r ? B(r, { className: "search-select-icon" }) : ""}
|
|
5096
|
+
<div class="ms-chips" data-chips><input type="text" class="ms-input" data-input role="combobox" aria-autocomplete="list" aria-haspopup="listbox" aria-expanded="false" aria-controls="${q(o)}" aria-label="${q(this._accessibleName())}" aria-describedby="${q(e)}" autocomplete="off"${s ? " disabled" : ""} /></div>
|
|
5097
|
+
${B("chevron-down", { className: "search-select-caret" })}
|
|
5098
5098
|
</div>
|
|
5099
|
-
<div class="search-select-menu search-select-menu-fixed" role="listbox" id="${
|
|
5099
|
+
<div class="search-select-menu search-select-menu-fixed" role="listbox" id="${q(o)}" aria-multiselectable="true" tabindex="-1" hidden>
|
|
5100
5100
|
<div class="search-select-options"></div>
|
|
5101
5101
|
</div>
|
|
5102
5102
|
</div>
|
|
5103
|
-
<div class="field-error wui-ms-custom-error" id="${
|
|
5103
|
+
<div class="field-error wui-ms-custom-error" id="${q(e)}" aria-live="polite" hidden></div>`;
|
|
5104
5104
|
} else this.innerHTML = `
|
|
5105
5105
|
<div class="search-select${a}">
|
|
5106
|
-
<div class="input search-select-control search-select-multi" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-controls="${
|
|
5107
|
-
${r ?
|
|
5106
|
+
<div class="input search-select-control search-select-multi" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-controls="${q(o)}" aria-label="${q(this._accessibleName())}"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${s ? " aria-disabled=\"true\"" : " tabindex=\"0\""}>
|
|
5107
|
+
${r ? B(r, { className: "search-select-icon" }) : ""}
|
|
5108
5108
|
<div class="ms-chips" data-chips></div>
|
|
5109
|
-
${
|
|
5109
|
+
${B("chevron-down", { className: "search-select-caret" })}
|
|
5110
5110
|
</div>
|
|
5111
|
-
<div class="search-select-menu search-select-menu-fixed" role="listbox" id="${
|
|
5112
|
-
${t ? `<div class="search-select-search">${
|
|
5111
|
+
<div class="search-select-menu search-select-menu-fixed" role="listbox" id="${q(o)}" aria-multiselectable="true" tabindex="-1" hidden>
|
|
5112
|
+
${t ? `<div class="search-select-search">${B("search")}<input class="search-select-input" placeholder="${q(n)}" aria-autocomplete="list" /><button type="button" class="search-select-clear" aria-label="Clear search" hidden>${B("x")}</button></div>` : ""}
|
|
5113
5113
|
<div class="search-select-options"></div>
|
|
5114
5114
|
<div class="search-select-empty" hidden>No matches</div>
|
|
5115
5115
|
</div>
|
|
5116
5116
|
</div>`;
|
|
5117
|
-
this._rendered = !0, this._customError = "",
|
|
5117
|
+
this._rendered = !0, this._customError = "", z(this, this._values), this._renderControl(), this._renderOptions(), this._wire();
|
|
5118
5118
|
}
|
|
5119
5119
|
_renderControl() {
|
|
5120
5120
|
let e = this.querySelector("[data-chips]");
|
|
5121
5121
|
if (!e) return;
|
|
5122
|
-
let t = this.getAttribute("placeholder") || "Select…", n = this._allowCustom ? e.querySelector("[data-input]") : null, r = this._values.map((e) => `<span class="chip chip-sm"><span class="chip-label">${this._labelHtmlFor(e)}</span><button type="button" class="chip-remove" data-remove="${
|
|
5122
|
+
let t = this.getAttribute("placeholder") || "Select…", n = this._allowCustom ? e.querySelector("[data-input]") : null, r = this._values.map((e) => `<span class="chip chip-sm"><span class="chip-label">${this._labelHtmlFor(e)}</span><button type="button" class="chip-remove" data-remove="${q(e)}" aria-label="Remove ${q(jr(this._labelFor(e)))}">${B("x")}</button></span>`).join("");
|
|
5123
5123
|
if (n) {
|
|
5124
5124
|
for (let t of [...e.querySelectorAll(":scope > .chip")]) t.remove();
|
|
5125
5125
|
n.insertAdjacentHTML("beforebegin", r), n.placeholder = this._values.length ? "" : t, this._collapseChips();
|
|
5126
5126
|
return;
|
|
5127
5127
|
}
|
|
5128
5128
|
if (!this._values.length) {
|
|
5129
|
-
e.innerHTML = `<span class="search-select-placeholder">${
|
|
5129
|
+
e.innerHTML = `<span class="search-select-placeholder">${V(t)}</span>`;
|
|
5130
5130
|
return;
|
|
5131
5131
|
}
|
|
5132
5132
|
e.innerHTML = r, this._collapseChips();
|
|
@@ -5150,11 +5150,11 @@ var wr = (e, t) => t.some((t) => String(e ?? "").includes(t)), Tr = class extend
|
|
|
5150
5150
|
i.textContent = `+${t.length - o}`;
|
|
5151
5151
|
}
|
|
5152
5152
|
_matches(e, t) {
|
|
5153
|
-
return
|
|
5153
|
+
return jr(e.label).toLowerCase().includes(t) || String(e.description ?? "").toLowerCase().includes(t);
|
|
5154
5154
|
}
|
|
5155
5155
|
_optionNamed(e) {
|
|
5156
5156
|
let t = e.trim().toLowerCase();
|
|
5157
|
-
return this._readOptions().find((e) => String(e.value ?? "").toLowerCase() === t ||
|
|
5157
|
+
return this._readOptions().find((e) => String(e.value ?? "").toLowerCase() === t || jr(e.label).trim().toLowerCase() === t);
|
|
5158
5158
|
}
|
|
5159
5159
|
_renderOptions(e) {
|
|
5160
5160
|
let t = this.querySelector(".search-select-options"), n = this.querySelector(".search-select-empty");
|
|
@@ -5163,9 +5163,9 @@ var wr = (e, t) => t.some((t) => String(e ?? "").includes(t)), Tr = class extend
|
|
|
5163
5163
|
i && (a = a.filter((e) => this._matches(e, i)));
|
|
5164
5164
|
let o = this._listboxId || `${this.id || "wui-multiselect"}-listbox`, s = this._allowCustom && r && !this._optionNamed(r), c = a.map((e, t) => {
|
|
5165
5165
|
let n = this._values.includes(String(e.value)), r = `${o}-opt-${t}`;
|
|
5166
|
-
return
|
|
5166
|
+
return Tr(e) ? Or(e, r, n) : `<button type="button" role="option" id="${q(r)}" class="search-select-option${n ? " selected" : ""}" data-value="${q(e.value)}" aria-selected="${n}"><span class="ms-opt-label">${Xt(e)}</span><span class="ms-check">${B("check")}</span></button>`;
|
|
5167
5167
|
});
|
|
5168
|
-
s && c.push(`<button type="button" role="option" id="${
|
|
5168
|
+
s && c.push(`<button type="button" role="option" id="${q(`${o}-opt-${a.length}`)}" class="search-select-option search-select-option-custom" data-value="${q(r)}" data-custom="true" aria-selected="false">Add “${V(r)}”</button>`), t.innerHTML = c.join(""), n && (n.hidden = a.length > 0), this._active = -1, this._combobox()?.removeAttribute("aria-activedescendant"), this._allowCustom && this._syncCustomMenu?.(), this._reanchor?.();
|
|
5169
5169
|
}
|
|
5170
5170
|
_combobox() {
|
|
5171
5171
|
return this._allowCustom ? this.querySelector("[data-input]") : this.querySelector(".search-select-control");
|
|
@@ -5178,7 +5178,7 @@ var wr = (e, t) => t.some((t) => String(e ?? "").includes(t)), Tr = class extend
|
|
|
5178
5178
|
_customRefusal(e) {
|
|
5179
5179
|
let t = this.getAttribute("custom-invalid-message") || "Enter a valid value.", n = this.getAttribute("custom-pattern");
|
|
5180
5180
|
if (n) {
|
|
5181
|
-
let r =
|
|
5181
|
+
let r = Ar(n);
|
|
5182
5182
|
if (r && !r.test(e)) return t;
|
|
5183
5183
|
}
|
|
5184
5184
|
let r = this._validateCustom;
|
|
@@ -5207,7 +5207,7 @@ var wr = (e, t) => t.some((t) => String(e ?? "").includes(t)), Tr = class extend
|
|
|
5207
5207
|
this._teardown();
|
|
5208
5208
|
let e = this.querySelector(".search-select-control"), t = this.querySelector(".search-select-menu"), n = this.querySelector(".search-select-input"), r = this.querySelector(".search-select-clear"), i = this.querySelector(".search-select-options"), a = this._allowCustom, o = a ? this.querySelector("[data-input]") : null, s = o || e;
|
|
5209
5209
|
if (!e || !t) return;
|
|
5210
|
-
let c = () => this.hasAttribute("disabled"), l = () =>
|
|
5210
|
+
let c = () => this.hasAttribute("disabled"), l = () => I(e, t, { matchWidth: !0 }), u = () => [...this.querySelectorAll(".search-select-option")], d = () => u().filter((e) => !e.hidden), f = (e) => {
|
|
5211
5211
|
let t = d();
|
|
5212
5212
|
this._active = e;
|
|
5213
5213
|
for (let e of u()) e.classList.remove("is-active");
|
|
@@ -5228,7 +5228,7 @@ var wr = (e, t) => t.some((t) => String(e ?? "").includes(t)), Tr = class extend
|
|
|
5228
5228
|
}, _ = () => {
|
|
5229
5229
|
a ? (p = !1, h()) : (t.hidden = !0, e.setAttribute("aria-expanded", "false"), e.classList.remove("open")), f(-1), clearTimeout(this._typeaheadTimer), this._typeaheadTimer = null, this._typeahead = "";
|
|
5230
5230
|
}, v = () => {
|
|
5231
|
-
|
|
5231
|
+
z(this, this._values), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
5232
5232
|
}, y = (e) => {
|
|
5233
5233
|
let t = String(e);
|
|
5234
5234
|
if (this._values.includes(t)) this._values = this._values.filter((e) => e !== t);
|
|
@@ -5238,7 +5238,7 @@ var wr = (e, t) => t.some((t) => String(e ?? "").includes(t)), Tr = class extend
|
|
|
5238
5238
|
}, b = (e) => {
|
|
5239
5239
|
this._values = this._values.filter((t) => t !== String(e)), this._renderControl(), this._renderOptions(this._query()), v();
|
|
5240
5240
|
}, x = (e, { quiet: t = !1 } = {}) => {
|
|
5241
|
-
let n = this._values.length, r =
|
|
5241
|
+
let n = this._values.length, r = xr(e, Cr) ? br(e, Cr) : [e], i = [], a = "";
|
|
5242
5242
|
for (let e of r) {
|
|
5243
5243
|
let t = this._commitTyped(e);
|
|
5244
5244
|
t && (i.push(e.trim()), a ||= t);
|
|
@@ -5276,7 +5276,7 @@ var wr = (e, t) => t.some((t) => String(e ?? "").includes(t)), Tr = class extend
|
|
|
5276
5276
|
e.target?.classList?.contains("avatar-img") && e.target.remove();
|
|
5277
5277
|
}, !0), n?.addEventListener("input", () => {
|
|
5278
5278
|
this._renderOptions(n.value), r && (r.hidden = !n.value), f(-1);
|
|
5279
|
-
}), this._navHandler =
|
|
5279
|
+
}), this._navHandler = Gt({
|
|
5280
5280
|
getVisibleOptions: d,
|
|
5281
5281
|
getActive: () => this._active,
|
|
5282
5282
|
setActive: (e) => f(e),
|
|
@@ -5316,7 +5316,7 @@ var wr = (e, t) => t.some((t) => String(e ?? "").includes(t)), Tr = class extend
|
|
|
5316
5316
|
(e.key === "ArrowDown" || e.key === "ArrowUp") && !m() && g(), C(e);
|
|
5317
5317
|
}), o.addEventListener("paste", (e) => {
|
|
5318
5318
|
let t = e.clipboardData?.getData("text/plain") ?? "";
|
|
5319
|
-
|
|
5319
|
+
xr(t, Cr) && (e.preventDefault(), x(`${o.value}${t}`));
|
|
5320
5320
|
}), o.addEventListener("blur", (e) => {
|
|
5321
5321
|
e.relatedTarget && this.contains(e.relatedTarget) || (o.value.trim() && x(o.value, { quiet: !0 }), _());
|
|
5322
5322
|
});
|
|
@@ -5330,46 +5330,46 @@ var wr = (e, t) => t.some((t) => String(e ?? "").includes(t)), Tr = class extend
|
|
|
5330
5330
|
this._bindGlobal = () => {
|
|
5331
5331
|
this._teardown(), !this._ro && typeof ResizeObserver < "u" && (this._ro = new ResizeObserver(() => this._collapseChips()), this._ro.observe(this)), this._onDocClick = (e) => {
|
|
5332
5332
|
m() && !this.contains(e.target) && _();
|
|
5333
|
-
}, document.addEventListener("click", this._onDocClick),
|
|
5333
|
+
}, document.addEventListener("click", this._onDocClick), Bt(this, () => {
|
|
5334
5334
|
m() && l();
|
|
5335
5335
|
});
|
|
5336
5336
|
}, this._bindGlobal();
|
|
5337
5337
|
}
|
|
5338
5338
|
_teardown() {
|
|
5339
|
-
this._onDocClick &&= (document.removeEventListener("click", this._onDocClick), null),
|
|
5339
|
+
this._onDocClick &&= (document.removeEventListener("click", this._onDocClick), null), L(this), this._navHandler?.teardown();
|
|
5340
5340
|
}
|
|
5341
5341
|
disconnectedCallback() {
|
|
5342
5342
|
this._teardown(), this._ro?.disconnect(), this._ro = null;
|
|
5343
5343
|
}
|
|
5344
|
-
},
|
|
5344
|
+
}, Cr = [
|
|
5345
5345
|
",",
|
|
5346
5346
|
";",
|
|
5347
5347
|
"\n",
|
|
5348
5348
|
" "
|
|
5349
|
-
],
|
|
5349
|
+
], wr = [
|
|
5350
5350
|
["description", "description"],
|
|
5351
5351
|
["avatar", "avatar"],
|
|
5352
5352
|
["initials", "initials"],
|
|
5353
5353
|
["disabled-hint", "disabledHint"]
|
|
5354
|
-
],
|
|
5354
|
+
], Tr = (e) => !!(e.description || e.avatar || e.initials || e.disabled || e.disabledHint), Er = (e) => {
|
|
5355
5355
|
let t = String(e ?? "").trim();
|
|
5356
5356
|
return /^(https?:)?\/\//i.test(t) || /^\/(?!\/)/.test(t) || /^data:image\/(png|jpe?g|gif|webp|avif);/i.test(t) ? t : "";
|
|
5357
|
-
},
|
|
5358
|
-
let t =
|
|
5359
|
-
return !t && !e.initials ? "" : `<span class="avatar wui-opt-avatar" aria-hidden="true"><span class="avatar-face">${
|
|
5360
|
-
},
|
|
5361
|
-
let r = !!e.disabled, i = e.description ? `<span class="wui-opt-desc">${
|
|
5362
|
-
return `<button type="button" role="option" id="${
|
|
5363
|
-
},
|
|
5364
|
-
if (
|
|
5357
|
+
}, Dr = (e) => {
|
|
5358
|
+
let t = Er(e.avatar);
|
|
5359
|
+
return !t && !e.initials ? "" : `<span class="avatar wui-opt-avatar" aria-hidden="true"><span class="avatar-face">${V(e.initials ?? "")}</span>${t ? `<img class="avatar-img" src="${q(t)}" alt="" />` : ""}</span>`;
|
|
5360
|
+
}, Or = (e, t, n) => {
|
|
5361
|
+
let r = !!e.disabled, i = e.description ? `<span class="wui-opt-desc">${V(e.description)}</span>` : "", a = e.disabledHint && r ? `<span class="wui-opt-hint">${V(e.disabledHint)}</span>` : "";
|
|
5362
|
+
return `<button type="button" role="option" id="${q(t)}" class="search-select-option wui-opt-rich${n ? " selected" : ""}" data-value="${q(e.value)}" aria-selected="${n}"${r ? " aria-disabled=\"true\"" : ""}><span class="ms-opt-label"><span class="wui-opt-name">${Xt(e)}</span>${i}</span>${a}${Dr(e)}<span class="ms-check">${B("check")}</span></button>`;
|
|
5363
|
+
}, kr = /* @__PURE__ */ new Map(), Ar = (e) => {
|
|
5364
|
+
if (kr.has(e)) return kr.get(e);
|
|
5365
5365
|
let t = null;
|
|
5366
5366
|
try {
|
|
5367
5367
|
t = RegExp(`^(?:${e})$`, "u");
|
|
5368
5368
|
} catch {
|
|
5369
5369
|
console.warn(`<wui-multiselect> custom-pattern is not a valid regular expression and is ignored: ${e}`);
|
|
5370
5370
|
}
|
|
5371
|
-
return
|
|
5372
|
-
},
|
|
5371
|
+
return kr.set(e, t), t;
|
|
5372
|
+
}, q = (e) => String(e ?? "").replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<"), jr = (e) => String(e ?? "").replace(/<[^>]*>/g, ""), Mr = /[^0-9]/g, Nr = /[^0-9a-zA-Z]/g, Pr = class extends e {
|
|
5373
5373
|
static formAssociated = !0;
|
|
5374
5374
|
static get observedAttributes() {
|
|
5375
5375
|
return [
|
|
@@ -5397,10 +5397,10 @@ var wr = (e, t) => t.some((t) => String(e ?? "").includes(t)), Tr = class extend
|
|
|
5397
5397
|
return this._value ?? "";
|
|
5398
5398
|
}
|
|
5399
5399
|
set value(e) {
|
|
5400
|
-
this._value = this._clean(e),
|
|
5400
|
+
this._value = this._clean(e), R(this, this._value), this._paint();
|
|
5401
5401
|
}
|
|
5402
5402
|
_clean(e) {
|
|
5403
|
-
return (e == null ? "" : String(e)).replace(this.mode === "alphanumeric" ?
|
|
5403
|
+
return (e == null ? "" : String(e)).replace(this.mode === "alphanumeric" ? Nr : Mr, "").slice(0, this.length);
|
|
5404
5404
|
}
|
|
5405
5405
|
constructor() {
|
|
5406
5406
|
super();
|
|
@@ -5414,10 +5414,10 @@ var wr = (e, t) => t.some((t) => String(e ?? "").includes(t)), Tr = class extend
|
|
|
5414
5414
|
this._rendered ? this._onSelectionChange && document.addEventListener("selectionchange", this._onSelectionChange) : (this._defaultCaptured ||= (this._defaultValue = this._value, !0), this.render());
|
|
5415
5415
|
}
|
|
5416
5416
|
formResetCallback() {
|
|
5417
|
-
this._value = this._defaultValue || "",
|
|
5417
|
+
this._value = this._defaultValue || "", R(this, this._value), this._paint();
|
|
5418
5418
|
}
|
|
5419
5419
|
attributeChangedCallback(e, t, n) {
|
|
5420
|
-
this._rendered && (e === "value" ? (this._value = this._clean(n),
|
|
5420
|
+
this._rendered && (e === "value" ? (this._value = this._clean(n), R(this, this._value), this._paint()) : this.render());
|
|
5421
5421
|
}
|
|
5422
5422
|
render() {
|
|
5423
5423
|
this._value = this._clean(this.getAttribute("value") ?? this._value);
|
|
@@ -5435,7 +5435,7 @@ var wr = (e, t) => t.some((t) => String(e ?? "").includes(t)), Tr = class extend
|
|
|
5435
5435
|
spellcheck="false"
|
|
5436
5436
|
${n ? "disabled" : ""} />
|
|
5437
5437
|
<div class="otp-slots" aria-hidden="true">${r}</div>
|
|
5438
|
-
</div>`, this._rendered = !0,
|
|
5438
|
+
</div>`, this._rendered = !0, R(this, this._value), this._wire(), this._paint();
|
|
5439
5439
|
}
|
|
5440
5440
|
_refs() {
|
|
5441
5441
|
return {
|
|
@@ -5457,7 +5457,7 @@ var wr = (e, t) => t.some((t) => String(e ?? "").includes(t)), Tr = class extend
|
|
|
5457
5457
|
if (!e) return;
|
|
5458
5458
|
let t = (e) => {
|
|
5459
5459
|
let t = this._clean(e), n = t !== this._value;
|
|
5460
|
-
this._value = t,
|
|
5460
|
+
this._value = t, R(this, this._value), this._paint(), n && this.dispatchEvent(new Event("change", { bubbles: !0 })), n && t.length === this.length && this.dispatchEvent(new CustomEvent("complete", {
|
|
5461
5461
|
bubbles: !0,
|
|
5462
5462
|
detail: t
|
|
5463
5463
|
}));
|
|
@@ -5491,7 +5491,7 @@ var wr = (e, t) => t.some((t) => String(e ?? "").includes(t)), Tr = class extend
|
|
|
5491
5491
|
disconnectedCallback() {
|
|
5492
5492
|
this._onSelectionChange && document.removeEventListener("selectionchange", this._onSelectionChange);
|
|
5493
5493
|
}
|
|
5494
|
-
},
|
|
5494
|
+
}, Fr = {
|
|
5495
5495
|
AD: ["Europe/Andorra"],
|
|
5496
5496
|
AE: ["Asia/Dubai"],
|
|
5497
5497
|
AF: ["Asia/Kabul"],
|
|
@@ -5893,13 +5893,13 @@ var wr = (e, t) => t.some((t) => String(e ?? "").includes(t)), Tr = class extend
|
|
|
5893
5893
|
ZA: ["Africa/Johannesburg"],
|
|
5894
5894
|
ZM: ["Africa/Lusaka"],
|
|
5895
5895
|
ZW: ["Africa/Harare"]
|
|
5896
|
-
},
|
|
5897
|
-
for (let [e, t] of Object.entries(
|
|
5898
|
-
function
|
|
5899
|
-
let t =
|
|
5900
|
-
return t &&
|
|
5896
|
+
}, Ir = new Set(En.map(([e]) => e)), Lr = /* @__PURE__ */ new Map();
|
|
5897
|
+
for (let [e, t] of Object.entries(Fr)) for (let n of t) Lr.set(n, e);
|
|
5898
|
+
function Rr(e) {
|
|
5899
|
+
let t = Lr.get(e);
|
|
5900
|
+
return t && Ir.has(t) ? t : null;
|
|
5901
5901
|
}
|
|
5902
|
-
function
|
|
5902
|
+
function zr(e) {
|
|
5903
5903
|
if (!e) return null;
|
|
5904
5904
|
let t;
|
|
5905
5905
|
try {
|
|
@@ -5907,9 +5907,9 @@ function Hr(e) {
|
|
|
5907
5907
|
} catch {
|
|
5908
5908
|
return null;
|
|
5909
5909
|
}
|
|
5910
|
-
return t &&
|
|
5910
|
+
return t && Ir.has(t) ? t : null;
|
|
5911
5911
|
}
|
|
5912
|
-
function
|
|
5912
|
+
function Br() {
|
|
5913
5913
|
let e;
|
|
5914
5914
|
try {
|
|
5915
5915
|
e = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
@@ -5917,77 +5917,77 @@ function Ur() {
|
|
|
5917
5917
|
e = void 0;
|
|
5918
5918
|
}
|
|
5919
5919
|
let t = typeof navigator > "u" ? void 0 : navigator.language;
|
|
5920
|
-
return
|
|
5920
|
+
return Rr(e) || zr(t) || "IN";
|
|
5921
5921
|
}
|
|
5922
5922
|
//#endregion
|
|
5923
5923
|
//#region src/WuiPhone.js
|
|
5924
|
-
var
|
|
5925
|
-
function
|
|
5926
|
-
return
|
|
5924
|
+
var Vr = (e) => `wui-flag wui-flag-${String(e).toLowerCase()}`, J = null, Hr = null;
|
|
5925
|
+
function Ur() {
|
|
5926
|
+
return J ? Promise.resolve(J) : (Hr ||= Promise.all([import("./max-BDKx469G.js"), import("./examples.mobile.json-BMXTGiGC.js")]).then(([e, t]) => (J = {
|
|
5927
5927
|
AsYouType: e.AsYouType,
|
|
5928
5928
|
getExampleNumber: e.getExampleNumber,
|
|
5929
5929
|
isValidPhoneNumber: e.isValidPhoneNumber,
|
|
5930
5930
|
parsePhoneNumber: e.parsePhoneNumber,
|
|
5931
5931
|
examples: t.default || t
|
|
5932
|
-
},
|
|
5932
|
+
}, J)).catch(() => null), Hr);
|
|
5933
5933
|
}
|
|
5934
|
-
function
|
|
5935
|
-
let n = `+${
|
|
5934
|
+
function Wr(e, t) {
|
|
5935
|
+
let n = `+${Dn(e)}`;
|
|
5936
5936
|
return t?.startsWith(n) ? t.slice(n.length).trimStart() : null;
|
|
5937
5937
|
}
|
|
5938
|
-
function
|
|
5939
|
-
if (!
|
|
5938
|
+
function Gr(e, t) {
|
|
5939
|
+
if (!J || !t) return t;
|
|
5940
5940
|
try {
|
|
5941
|
-
return
|
|
5941
|
+
return Wr(e, new J.AsYouType(e).input(`+${Dn(e)}${t}`)) || t;
|
|
5942
5942
|
} catch {
|
|
5943
5943
|
return t;
|
|
5944
5944
|
}
|
|
5945
5945
|
}
|
|
5946
|
-
function
|
|
5946
|
+
function Kr(e, t) {
|
|
5947
5947
|
if (t <= 0) return 0;
|
|
5948
5948
|
let n = 0;
|
|
5949
5949
|
for (let r = 0; r < e.length; r++) if (/[0-9]/.test(e[r]) && (n += 1, n === t)) return r + 1;
|
|
5950
5950
|
return e.length;
|
|
5951
5951
|
}
|
|
5952
|
-
function
|
|
5953
|
-
if (!
|
|
5952
|
+
function qr(e) {
|
|
5953
|
+
if (!J) return null;
|
|
5954
5954
|
try {
|
|
5955
|
-
return
|
|
5955
|
+
return Wr(e, J.getExampleNumber(e, J.examples)?.formatInternational()) || null;
|
|
5956
5956
|
} catch {
|
|
5957
5957
|
return null;
|
|
5958
5958
|
}
|
|
5959
5959
|
}
|
|
5960
|
-
function
|
|
5961
|
-
if (!
|
|
5960
|
+
function Jr(e) {
|
|
5961
|
+
if (!J || !e) return null;
|
|
5962
5962
|
try {
|
|
5963
|
-
if (!
|
|
5964
|
-
let t =
|
|
5963
|
+
if (!J.isValidPhoneNumber(e)) return !1;
|
|
5964
|
+
let t = J.parsePhoneNumber(e)?.getType?.();
|
|
5965
5965
|
return t === void 0 || t === "MOBILE" || t === "FIXED_LINE_OR_MOBILE";
|
|
5966
5966
|
} catch {
|
|
5967
5967
|
return null;
|
|
5968
5968
|
}
|
|
5969
5969
|
}
|
|
5970
|
-
function
|
|
5971
|
-
if (!
|
|
5970
|
+
function Yr(e) {
|
|
5971
|
+
if (!J) return null;
|
|
5972
5972
|
try {
|
|
5973
|
-
let t =
|
|
5973
|
+
let t = J.getExampleNumber(e, J.examples);
|
|
5974
5974
|
return t?.nationalNumber ? t.nationalNumber.length : null;
|
|
5975
5975
|
} catch {
|
|
5976
5976
|
return null;
|
|
5977
5977
|
}
|
|
5978
5978
|
}
|
|
5979
|
-
function
|
|
5979
|
+
function Xr(e, t, n) {
|
|
5980
5980
|
try {
|
|
5981
|
-
let r =
|
|
5981
|
+
let r = J.parsePhoneNumber(t, e), i = r?.nationalNumber;
|
|
5982
5982
|
return !i || r.country !== e || i.length > n || !t.endsWith(i) ? null : i;
|
|
5983
5983
|
} catch {
|
|
5984
5984
|
return null;
|
|
5985
5985
|
}
|
|
5986
5986
|
}
|
|
5987
|
-
function
|
|
5988
|
-
if (!
|
|
5987
|
+
function Zr(e) {
|
|
5988
|
+
if (!J || !e?.trim().startsWith("+")) return null;
|
|
5989
5989
|
try {
|
|
5990
|
-
let t = new
|
|
5990
|
+
let t = new J.AsYouType();
|
|
5991
5991
|
t.input(e.trim());
|
|
5992
5992
|
let n = t.getCountry();
|
|
5993
5993
|
return n ? {
|
|
@@ -5998,7 +5998,7 @@ function ei(e) {
|
|
|
5998
5998
|
return null;
|
|
5999
5999
|
}
|
|
6000
6000
|
}
|
|
6001
|
-
var
|
|
6001
|
+
var Qr = class extends e {
|
|
6002
6002
|
static formAssociated = !0;
|
|
6003
6003
|
static get observedAttributes() {
|
|
6004
6004
|
return [
|
|
@@ -6018,7 +6018,7 @@ var ti = class extends e {
|
|
|
6018
6018
|
} catch {
|
|
6019
6019
|
this._internals = null;
|
|
6020
6020
|
}
|
|
6021
|
-
this._defaultCountry =
|
|
6021
|
+
this._defaultCountry = Br(), this._country = this._defaultCountry, this._national = "", this._active = -1, this._committedValue = "";
|
|
6022
6022
|
}
|
|
6023
6023
|
connectedCallback() {
|
|
6024
6024
|
if (!this._rendered) {
|
|
@@ -6045,19 +6045,19 @@ var ti = class extends e {
|
|
|
6045
6045
|
this.value = this._defaultValue || "";
|
|
6046
6046
|
}
|
|
6047
6047
|
get value() {
|
|
6048
|
-
return this._national ? `+${
|
|
6048
|
+
return this._national ? `+${Dn(this._country)}${this._national}` : "";
|
|
6049
6049
|
}
|
|
6050
6050
|
set value(e) {
|
|
6051
|
-
let t = String(e ?? "").trim(), n =
|
|
6051
|
+
let t = String(e ?? "").trim(), n = Zr(t);
|
|
6052
6052
|
if (n) this._country = n.country, this._national = n.national.replace(/[^0-9]/g, "");
|
|
6053
6053
|
else if (t.startsWith("+")) {
|
|
6054
|
-
let e = t.replace(/[^0-9]/g, ""), n = String(
|
|
6054
|
+
let e = t.replace(/[^0-9]/g, ""), n = String(Dn(this._country));
|
|
6055
6055
|
n && e.startsWith(n) && (e = e.slice(n.length)), this._national = e;
|
|
6056
6056
|
} else this._national = t.replace(/[^0-9]/g, "");
|
|
6057
6057
|
n && this.getAttribute("country") !== this._country ? this.setAttribute("country", this._country) : this._rendered && this.render(), this._committedValue = this.value, this._syncMirror();
|
|
6058
6058
|
}
|
|
6059
6059
|
_syncMirror() {
|
|
6060
|
-
|
|
6060
|
+
R(this, this.value);
|
|
6061
6061
|
}
|
|
6062
6062
|
_emitInput() {
|
|
6063
6063
|
this.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
@@ -6067,30 +6067,30 @@ var ti = class extends e {
|
|
|
6067
6067
|
}
|
|
6068
6068
|
render() {
|
|
6069
6069
|
this._defaultValue === void 0 && (this._defaultValue = this.getAttribute("value") || ""), this._country = this.getAttribute("country") || this._country;
|
|
6070
|
-
let e = this.getAttribute("placeholder") ||
|
|
6070
|
+
let e = this.getAttribute("placeholder") || qr(this._country) || "Enter phone number";
|
|
6071
6071
|
this.id ||= `wui-phone-${Math.random().toString(36).slice(2, 9)}`;
|
|
6072
6072
|
let t = `${this.id}-listbox`;
|
|
6073
6073
|
this._listboxId = t, this.innerHTML = `
|
|
6074
6074
|
<div class="phone-input-wrap">
|
|
6075
6075
|
<div class="phone-country-adornment">
|
|
6076
|
-
<button type="button" class="country-toggle" aria-label="Choose country" aria-haspopup="listbox" aria-expanded="false" aria-controls="${
|
|
6077
|
-
<span class="${
|
|
6078
|
-
${
|
|
6079
|
-
<span class="phone-dial" data-dial>+${
|
|
6076
|
+
<button type="button" class="country-toggle" aria-label="Choose country" aria-haspopup="listbox" aria-expanded="false" aria-controls="${$r(t)}"${this.hasAttribute("disabled") ? " disabled" : ""}>
|
|
6077
|
+
<span class="${Vr(this._country)}" data-flag aria-hidden="true"></span>
|
|
6078
|
+
${B("chevron-down", { className: "phone-chevron" })}
|
|
6079
|
+
<span class="phone-dial" data-dial>+${Dn(this._country)}</span>
|
|
6080
6080
|
</button>
|
|
6081
|
-
<div class="country-dropdown-menu" role="listbox" id="${
|
|
6082
|
-
<div class="dropdown-search-wrapper"><span class="dropdown-search-icon">${
|
|
6081
|
+
<div class="country-dropdown-menu" role="listbox" id="${$r(t)}" tabindex="-1" hidden>
|
|
6082
|
+
<div class="dropdown-search-wrapper"><span class="dropdown-search-icon">${B("search")}</span><input type="text" class="dropdown-search-input" placeholder="Search country or code" aria-label="Search countries" aria-controls="${$r(t)}" aria-autocomplete="list" /></div>
|
|
6083
6083
|
<div class="country-list-scroll"><div class="country-empty" hidden>No countries found</div></div>
|
|
6084
6084
|
</div>
|
|
6085
6085
|
</div>
|
|
6086
|
-
<input type="tel" class="input" placeholder="${
|
|
6086
|
+
<input type="tel" class="input" placeholder="${$r(e)}" value="${$r(Gr(this._country, this._national))}"${this.getAttribute("aria-label") ? ` aria-label="${$r(this.getAttribute("aria-label"))}"` : ""}${this.getAttribute("aria-describedby") ? ` aria-describedby="${$r(this.getAttribute("aria-describedby"))}"` : ""}${this.hasAttribute("required") ? " required aria-required=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""} />
|
|
6087
6087
|
</div>
|
|
6088
|
-
<div class="field-error" data-phone-error hidden></div>`, this._rendered = !0,
|
|
6088
|
+
<div class="field-error" data-phone-error hidden></div>`, this._rendered = !0, R(this, this.value), this._wire();
|
|
6089
6089
|
}
|
|
6090
6090
|
_ensureItems() {
|
|
6091
6091
|
let e = this.querySelector(".country-list-scroll");
|
|
6092
6092
|
if (!e || e.querySelector(".country-dropdown-item")) return;
|
|
6093
|
-
let t = this._listboxId, n =
|
|
6093
|
+
let t = this._listboxId, n = En.map(([e, n, r], i) => `<button type="button" role="option" id="${$r(`${t}-opt-${i}`)}" class="country-dropdown-item${e === this._country ? " selected" : ""}" data-iso="${e}" aria-selected="${e === this._country}"><span class="${Vr(e)}" aria-hidden="true"></span><span class="country-name-text">${n}<span class="country-code-text">+${r}</span></span></button>`).join("");
|
|
6094
6094
|
e.insertAdjacentHTML("afterbegin", n);
|
|
6095
6095
|
}
|
|
6096
6096
|
_itemEls() {
|
|
@@ -6103,7 +6103,7 @@ var ti = class extends e {
|
|
|
6103
6103
|
this._teardown();
|
|
6104
6104
|
let e = this.querySelector(".country-toggle"), t = this.querySelector(".phone-input-wrap"), n = this.querySelector(".country-dropdown-menu"), r = this.querySelector(".dropdown-search-input"), i = this.querySelector(".country-list-scroll"), a = this.querySelector(".country-empty"), o = this.querySelector("input[type=tel]"), s = this.querySelector("[data-flag]"), c = this.querySelector("[data-dial]");
|
|
6105
6105
|
if (!e || !n) return;
|
|
6106
|
-
let l = () => !n.hidden, u = () =>
|
|
6106
|
+
let l = () => !n.hidden, u = () => I(t || e, n), d = (e) => {
|
|
6107
6107
|
let t = this._visibleItems();
|
|
6108
6108
|
this._active = e;
|
|
6109
6109
|
for (let e of this._itemEls()) e.classList.remove("is-active");
|
|
@@ -6120,12 +6120,12 @@ var ti = class extends e {
|
|
|
6120
6120
|
}
|
|
6121
6121
|
a && (a.hidden = n > 0);
|
|
6122
6122
|
}, h = (e) => {
|
|
6123
|
-
this._country = e, this.getAttribute("country") !== e && (this._suppressCountryRender = !0, this.setAttribute("country", e), this._suppressCountryRender = !1), s && (s.className =
|
|
6123
|
+
this._country = e, this.getAttribute("country") !== e && (this._suppressCountryRender = !0, this.setAttribute("country", e), this._suppressCountryRender = !1), s && (s.className = Vr(e)), c && (c.textContent = `+${Dn(e)}`);
|
|
6124
6124
|
for (let t of this._itemEls()) {
|
|
6125
6125
|
let n = t.dataset.iso === e;
|
|
6126
6126
|
t.classList.toggle("selected", n), t.setAttribute("aria-selected", String(n));
|
|
6127
6127
|
}
|
|
6128
|
-
!this.getAttribute("placeholder") && o && (o.placeholder =
|
|
6128
|
+
!this.getAttribute("placeholder") && o && (o.placeholder = qr(e) || "Enter phone number"), o && this._national && (o.value = Gr(e, this._national)), p(), this._syncMirror(), this._emitChange(), o?.focus();
|
|
6129
6129
|
}, g = (t) => {
|
|
6130
6130
|
let n = this._visibleItems();
|
|
6131
6131
|
if (t.key === "ArrowDown") {
|
|
@@ -6159,7 +6159,7 @@ var ti = class extends e {
|
|
|
6159
6159
|
let _ = this.querySelector("[data-phone-error]"), v = (e) => {
|
|
6160
6160
|
if (o.classList.toggle("is-invalid", e), e ? o.setAttribute("aria-invalid", "true") : o.removeAttribute("aria-invalid"), _) {
|
|
6161
6161
|
if (e) {
|
|
6162
|
-
let e =
|
|
6162
|
+
let e = qr(this._country);
|
|
6163
6163
|
_.textContent = e ? `Enter a valid phone number, e.g. ${e}` : "Enter a valid phone number";
|
|
6164
6164
|
}
|
|
6165
6165
|
_.hidden = !e;
|
|
@@ -6167,35 +6167,35 @@ var ti = class extends e {
|
|
|
6167
6167
|
};
|
|
6168
6168
|
o.addEventListener("input", (e) => {
|
|
6169
6169
|
e.stopPropagation();
|
|
6170
|
-
let t = o.selectionStart ?? o.value.length, n = o.value.slice(0, t).replace(/[^0-9]/g, "").length, r = o.value.replace(/[^0-9]/g, ""), i =
|
|
6170
|
+
let t = o.selectionStart ?? o.value.length, n = o.value.slice(0, t).replace(/[^0-9]/g, "").length, r = o.value.replace(/[^0-9]/g, ""), i = Yr(this._country);
|
|
6171
6171
|
if (i && r.length > i) {
|
|
6172
|
-
let e =
|
|
6172
|
+
let e = Xr(this._country, r, i);
|
|
6173
6173
|
e ? (n = Math.max(0, n - (r.length - e.length)), r = e) : r = r.slice(0, i);
|
|
6174
6174
|
}
|
|
6175
6175
|
this._national = r;
|
|
6176
|
-
let a =
|
|
6176
|
+
let a = Gr(this._country, this._national);
|
|
6177
6177
|
if (o.value !== a) {
|
|
6178
6178
|
o.value = a;
|
|
6179
|
-
let e =
|
|
6179
|
+
let e = Kr(a, Math.min(n, r.length));
|
|
6180
6180
|
o.setSelectionRange(e, e);
|
|
6181
6181
|
}
|
|
6182
|
-
this._syncMirror(), this._emitInput(), o.classList.contains("is-invalid") && (!this._national ||
|
|
6182
|
+
this._syncMirror(), this._emitInput(), o.classList.contains("is-invalid") && (!this._national || Jr(this.value) === !0) && v(!1);
|
|
6183
6183
|
}), o.addEventListener("change", (e) => e.stopPropagation()), o.addEventListener("blur", () => {
|
|
6184
|
-
v(this._national.length > 0 &&
|
|
6184
|
+
v(this._national.length > 0 && Jr(this.value) === !1), this.value !== this._committedValue && this._emitChange();
|
|
6185
6185
|
}), o.addEventListener("paste", (e) => {
|
|
6186
|
-
let t =
|
|
6187
|
-
t && (e.preventDefault(), this._national = t.national.replace(/[^0-9]/g, ""), t.country === this._country ? o.value =
|
|
6186
|
+
let t = Zr(e.clipboardData?.getData("text"));
|
|
6187
|
+
t && (e.preventDefault(), this._national = t.national.replace(/[^0-9]/g, ""), t.country === this._country ? o.value = Gr(this._country, this._national) : this.setAttribute("country", t.country), this._syncMirror(), this._emitInput(), this._emitChange(), this.querySelector("input[type=tel]")?.focus());
|
|
6188
6188
|
}), this._bindGlobal = () => {
|
|
6189
6189
|
this._teardownGlobals?.(), this._onDocClick = (e) => {
|
|
6190
6190
|
l() && !this.contains(e.target) && p();
|
|
6191
|
-
}, document.addEventListener("click", this._onDocClick),
|
|
6191
|
+
}, document.addEventListener("click", this._onDocClick), Bt(this, () => {
|
|
6192
6192
|
l() && u();
|
|
6193
6193
|
});
|
|
6194
6194
|
}, this._teardownGlobals = () => {
|
|
6195
|
-
this._onDocClick &&= (document.removeEventListener("click", this._onDocClick), null),
|
|
6196
|
-
}, this._bindGlobal(),
|
|
6197
|
-
if (!(!e || !o.isConnected) && (this._national && (o.value =
|
|
6198
|
-
let e =
|
|
6195
|
+
this._onDocClick &&= (document.removeEventListener("click", this._onDocClick), null), L(this);
|
|
6196
|
+
}, this._bindGlobal(), Ur().then((e) => {
|
|
6197
|
+
if (!(!e || !o.isConnected) && (this._national && (o.value = Gr(this._country, this._national)), !this.getAttribute("placeholder"))) {
|
|
6198
|
+
let e = qr(this._country);
|
|
6199
6199
|
e && (o.placeholder = e);
|
|
6200
6200
|
}
|
|
6201
6201
|
}), this._syncMirror();
|
|
@@ -6206,7 +6206,7 @@ var ti = class extends e {
|
|
|
6206
6206
|
disconnectedCallback() {
|
|
6207
6207
|
this._teardown();
|
|
6208
6208
|
}
|
|
6209
|
-
},
|
|
6209
|
+
}, $r = (e) => String(e ?? "").replace(/"/g, """).replace(/</g, "<"), ei = class extends e {
|
|
6210
6210
|
static formAssociated = !0;
|
|
6211
6211
|
static get observedAttributes() {
|
|
6212
6212
|
return [
|
|
@@ -6246,19 +6246,19 @@ var ti = class extends e {
|
|
|
6246
6246
|
return this._value;
|
|
6247
6247
|
}
|
|
6248
6248
|
set value(e) {
|
|
6249
|
-
this._value = this._snapToStep(this._clamp(
|
|
6249
|
+
this._value = this._snapToStep(this._clamp(Y(e, this._value))), this._syncValue(), this._syncMirrors();
|
|
6250
6250
|
}
|
|
6251
6251
|
get start() {
|
|
6252
6252
|
return this._start;
|
|
6253
6253
|
}
|
|
6254
6254
|
set start(e) {
|
|
6255
|
-
this._start = Math.min(this._snapToStep(this._clamp(
|
|
6255
|
+
this._start = Math.min(this._snapToStep(this._clamp(Y(e, this._start))), this._end), this._syncValue(), this._syncMirrors();
|
|
6256
6256
|
}
|
|
6257
6257
|
get end() {
|
|
6258
6258
|
return this._end;
|
|
6259
6259
|
}
|
|
6260
6260
|
set end(e) {
|
|
6261
|
-
this._end = Math.max(this._snapToStep(this._clamp(
|
|
6261
|
+
this._end = Math.max(this._snapToStep(this._clamp(Y(e, this._end))), this._start), this._syncValue(), this._syncMirrors();
|
|
6262
6262
|
}
|
|
6263
6263
|
attributeChangedCallback(e, t, n) {
|
|
6264
6264
|
if (e === "value" || e === "start" || e === "end" || e === "min" || e === "max" || e === "step") {
|
|
@@ -6271,19 +6271,19 @@ var ti = class extends e {
|
|
|
6271
6271
|
this._isRange() ? this._resetRange() : this._resetSingle();
|
|
6272
6272
|
}
|
|
6273
6273
|
_updateFromAttribute(e) {
|
|
6274
|
-
e === "value" ? this._value = this._snapToStep(this._clamp(
|
|
6274
|
+
e === "value" ? this._value = this._snapToStep(this._clamp(Y(this.getAttribute("value"), this._value))) : e === "start" ? this._start = this._snapToStep(this._clamp(Y(this.getAttribute("start"), this._start))) : e === "end" && (this._end = this._snapToStep(this._clamp(Y(this.getAttribute("end"), this._end))));
|
|
6275
6275
|
}
|
|
6276
6276
|
_isRange() {
|
|
6277
6277
|
return this.hasAttribute("range");
|
|
6278
6278
|
}
|
|
6279
6279
|
_min() {
|
|
6280
|
-
return
|
|
6280
|
+
return Y(this.getAttribute("min"), 0);
|
|
6281
6281
|
}
|
|
6282
6282
|
_max() {
|
|
6283
|
-
return
|
|
6283
|
+
return Y(this.getAttribute("max"), 100);
|
|
6284
6284
|
}
|
|
6285
6285
|
_step() {
|
|
6286
|
-
return
|
|
6286
|
+
return Y(this.getAttribute("step"), 1);
|
|
6287
6287
|
}
|
|
6288
6288
|
_clamp(e) {
|
|
6289
6289
|
return Math.max(this._min(), Math.min(e, this._max()));
|
|
@@ -6351,7 +6351,7 @@ var ti = class extends e {
|
|
|
6351
6351
|
aria-valuenow="${this._value}"
|
|
6352
6352
|
aria-valuetext="${this._formatValue(this._value)}"
|
|
6353
6353
|
${a ? "disabled" : ""}
|
|
6354
|
-
aria-label="${
|
|
6354
|
+
aria-label="${ti(this.getAttribute("aria-label") || "Value")}"
|
|
6355
6355
|
></button>
|
|
6356
6356
|
`}
|
|
6357
6357
|
${this.hasAttribute("show-value") ? n ? `<span class="slider-value">${this._formatValue(this._start)} to ${this._formatValue(this._end)}</span>` : `<span class="slider-value">${this._formatValue(this._value)}</span>` : ""}
|
|
@@ -6386,7 +6386,7 @@ var ti = class extends e {
|
|
|
6386
6386
|
this._isRange() ? this._syncRangeMirrors() : this._syncSingleMirror();
|
|
6387
6387
|
}
|
|
6388
6388
|
_syncSingleMirror() {
|
|
6389
|
-
this.getAttribute("name") &&
|
|
6389
|
+
this.getAttribute("name") && R(this, String(this._value));
|
|
6390
6390
|
}
|
|
6391
6391
|
_syncRangeMirrors() {
|
|
6392
6392
|
let e = this.getAttribute("start-name") || this.getAttribute("name"), t = this.getAttribute("end-name");
|
|
@@ -6453,10 +6453,10 @@ var ti = class extends e {
|
|
|
6453
6453
|
disconnectedCallback() {
|
|
6454
6454
|
this._teardown();
|
|
6455
6455
|
}
|
|
6456
|
-
},
|
|
6456
|
+
}, Y = (e, t) => {
|
|
6457
6457
|
let n = Number.parseFloat(e);
|
|
6458
6458
|
return Number.isFinite(n) ? n : t;
|
|
6459
|
-
},
|
|
6459
|
+
}, ti = (e) => String(e ?? "").replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<"), ni = /* @__PURE__ */ new Set(), ri = ".wui-sortable-handle", ii = "a[href],button,input,select,textarea,label,summary,[contenteditable='true'],[role='button'],[role='link']", ai = 4, oi = 8, si = 250, ci = 48, li = 18, ui = class extends e {
|
|
6460
6460
|
static get observedAttributes() {
|
|
6461
6461
|
return ["name", "disabled"];
|
|
6462
6462
|
}
|
|
@@ -6466,10 +6466,10 @@ var ti = class extends e {
|
|
|
6466
6466
|
}, this._onSelectStart = (e) => e.preventDefault(), this._scrollTick = this._scrollTick.bind(this);
|
|
6467
6467
|
}
|
|
6468
6468
|
connectedCallback() {
|
|
6469
|
-
|
|
6469
|
+
ni.add(this), this.addEventListener("pointerdown", this._onPointerDown), this.addEventListener("keydown", this._onKeyDown), this.addEventListener("focusout", this._onFocusOut), this.addEventListener("dragstart", this._onDragStart), this._observer = new MutationObserver(() => this._syncMirrors()), this._observer.observe(this, { childList: !0 }), this._syncMirrors();
|
|
6470
6470
|
}
|
|
6471
6471
|
disconnectedCallback() {
|
|
6472
|
-
|
|
6472
|
+
ni.delete(this), this.removeEventListener("pointerdown", this._onPointerDown), this.removeEventListener("keydown", this._onKeyDown), this.removeEventListener("focusout", this._onFocusOut), this.removeEventListener("dragstart", this._onDragStart), this._observer?.disconnect(), this._observer = null, this._abort();
|
|
6473
6473
|
}
|
|
6474
6474
|
attributeChangedCallback(e) {
|
|
6475
6475
|
e === "disabled" && this._abort(), this.isConnected && this._syncMirrors();
|
|
@@ -6504,7 +6504,7 @@ var ti = class extends e {
|
|
|
6504
6504
|
return this.getAttribute("orientation") === "horizontal";
|
|
6505
6505
|
}
|
|
6506
6506
|
_syncMirrors() {
|
|
6507
|
-
|
|
6507
|
+
z(this, this.order);
|
|
6508
6508
|
}
|
|
6509
6509
|
_insertAt(e, t) {
|
|
6510
6510
|
let n = this._items();
|
|
@@ -6522,7 +6522,7 @@ var ti = class extends e {
|
|
|
6522
6522
|
}
|
|
6523
6523
|
_peers() {
|
|
6524
6524
|
let e = this.getAttribute("group");
|
|
6525
|
-
return [...
|
|
6525
|
+
return [...ni].filter((t) => t === this || e && t.getAttribute("group") === e && !t.hasAttribute("disabled"));
|
|
6526
6526
|
}
|
|
6527
6527
|
_labelOf(e) {
|
|
6528
6528
|
return e.getAttribute("data-label") || e.textContent.replace(/\s+/g, " ").trim() || e.getAttribute("data-id");
|
|
@@ -6539,10 +6539,10 @@ var ti = class extends e {
|
|
|
6539
6539
|
if (this._drag || this._kb || this.hasAttribute("disabled") || e.pointerType === "mouse" && e.button !== 0) return;
|
|
6540
6540
|
let t = this._itemFrom(e.target);
|
|
6541
6541
|
if (!t || this._itemDisabled(t)) return;
|
|
6542
|
-
let n = t.querySelector(`:scope > ${
|
|
6542
|
+
let n = t.querySelector(`:scope > ${ri}`), r = !!n && n.contains(e.target);
|
|
6543
6543
|
if (this.hasAttribute("handle") && !r) return;
|
|
6544
6544
|
if (!r) {
|
|
6545
|
-
let n = e.target.closest?.(
|
|
6545
|
+
let n = e.target.closest?.(ii);
|
|
6546
6546
|
if (n && n !== t && t.contains(n)) return;
|
|
6547
6547
|
}
|
|
6548
6548
|
let i = e.pointerType === "touch" && !r, a = {
|
|
@@ -6552,7 +6552,7 @@ var ti = class extends e {
|
|
|
6552
6552
|
startY: e.clientY,
|
|
6553
6553
|
x: e.clientX,
|
|
6554
6554
|
y: e.clientY,
|
|
6555
|
-
slop: e.pointerType === "touch" ?
|
|
6555
|
+
slop: e.pointerType === "touch" ? oi : ai,
|
|
6556
6556
|
ready: !i,
|
|
6557
6557
|
started: !1,
|
|
6558
6558
|
timer: null,
|
|
@@ -6562,7 +6562,7 @@ var ti = class extends e {
|
|
|
6562
6562
|
};
|
|
6563
6563
|
this._drag = a, i && (a.timer = setTimeout(() => {
|
|
6564
6564
|
a.timer = null, a.ready = !0, this._begin();
|
|
6565
|
-
},
|
|
6565
|
+
}, si)), document.addEventListener("pointermove", this._onDocMove), document.addEventListener("pointerup", this._onDocUp), document.addEventListener("pointercancel", this._onDocCancel), document.addEventListener("keydown", this._onDocKey, !0), document.addEventListener("touchmove", this._onDocTouchMove, { passive: !1 });
|
|
6566
6566
|
}
|
|
6567
6567
|
_onDocMove(e) {
|
|
6568
6568
|
let t = this._drag;
|
|
@@ -6618,7 +6618,7 @@ var ti = class extends e {
|
|
|
6618
6618
|
_scrollTick() {
|
|
6619
6619
|
let e = this._drag;
|
|
6620
6620
|
if (!e?.started) return;
|
|
6621
|
-
let t =
|
|
6621
|
+
let t = fi(e.list), n = t ? t.getBoundingClientRect() : null, r = Math.max(n?.top ?? 0, 0), i = Math.min(n?.bottom ?? window.innerHeight, window.innerHeight), a = Math.max(n?.left ?? 0, 0), o = Math.min(n?.right ?? window.innerWidth, window.innerWidth), s = di(e.y, r, i), c = di(e.x, a, o);
|
|
6622
6622
|
(c || s) && (t ? (t.scrollTop += s, t.scrollLeft += c) : window.scrollBy(c, s), this._update()), e.raf = requestAnimationFrame(this._scrollTick);
|
|
6623
6623
|
}
|
|
6624
6624
|
_finish(e) {
|
|
@@ -6662,7 +6662,7 @@ var ti = class extends e {
|
|
|
6662
6662
|
}
|
|
6663
6663
|
_onKeyDown(e) {
|
|
6664
6664
|
if (this.hasAttribute("disabled")) return;
|
|
6665
|
-
let t = e.target.closest?.(
|
|
6665
|
+
let t = e.target.closest?.(ri), n = t && t.parentElement?.parentElement === this ? t.parentElement : null;
|
|
6666
6666
|
if (!n || this._itemDisabled(n) || this._drag) return;
|
|
6667
6667
|
let r = e.key;
|
|
6668
6668
|
if (!this._kb) {
|
|
@@ -6721,10 +6721,10 @@ var ti = class extends e {
|
|
|
6721
6721
|
e(), n && document.activeElement !== t && t.focus(), this._moving = !1;
|
|
6722
6722
|
}
|
|
6723
6723
|
};
|
|
6724
|
-
function
|
|
6725
|
-
return e < t +
|
|
6724
|
+
function di(e, t, n) {
|
|
6725
|
+
return e < t + ci ? -Math.ceil(li * Math.min(1, (t + ci - e) / ci)) : e > n - ci ? Math.ceil(li * Math.min(1, (e - (n - ci)) / ci)) : 0;
|
|
6726
6726
|
}
|
|
6727
|
-
function
|
|
6727
|
+
function fi(e) {
|
|
6728
6728
|
for (let t = e.parentElement; t && t !== document.body && t !== document.documentElement; t = t.parentElement) {
|
|
6729
6729
|
let e = getComputedStyle(t), n = /(auto|scroll)/.test(e.overflowY) && t.scrollHeight > t.clientHeight, r = /(auto|scroll)/.test(e.overflowX) && t.scrollWidth > t.clientWidth;
|
|
6730
6730
|
if (n || r) return t;
|
|
@@ -6733,7 +6733,7 @@ function mi(e) {
|
|
|
6733
6733
|
}
|
|
6734
6734
|
//#endregion
|
|
6735
6735
|
//#region src/WuiTagInput.js
|
|
6736
|
-
var
|
|
6736
|
+
var pi = class extends e {
|
|
6737
6737
|
static formAssociated = !0;
|
|
6738
6738
|
_accessibleName() {
|
|
6739
6739
|
return this.getAttribute("aria-label") || this.getAttribute("placeholder") || "Add tags";
|
|
@@ -6799,30 +6799,30 @@ var hi = class extends e {
|
|
|
6799
6799
|
return this._values.slice();
|
|
6800
6800
|
}
|
|
6801
6801
|
set values(e) {
|
|
6802
|
-
this._values = Array.isArray(e) ? e.map(String) : [],
|
|
6802
|
+
this._values = Array.isArray(e) ? e.map(String) : [], z(this, this._values), this._rendered && this._renderControl();
|
|
6803
6803
|
}
|
|
6804
6804
|
render() {
|
|
6805
6805
|
let e = this.getAttribute("size"), t = e === "sm" ? " search-select-sm" : e === "lg" ? " search-select-lg" : "";
|
|
6806
|
-
|
|
6806
|
+
z(this, this._values), this.innerHTML = `
|
|
6807
6807
|
<div class="search-select${t}">
|
|
6808
6808
|
<div class="input search-select-control search-select-multi"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${this.hasAttribute("disabled") ? " aria-disabled=\"true\"" : ""}>
|
|
6809
|
-
<div class="ms-chips" data-chips><input type="text" class="ms-input" data-input aria-label="${
|
|
6809
|
+
<div class="ms-chips" data-chips><input type="text" class="ms-input" data-input aria-label="${hi(this._accessibleName())}" placeholder="${hi(this.getAttribute("placeholder") || "Add…")}" autocomplete="off"${this.hasAttribute("disabled") ? " disabled" : ""}/></div>
|
|
6810
6810
|
</div>
|
|
6811
|
-
</div>`, this._rendered = !0,
|
|
6811
|
+
</div>`, this._rendered = !0, z(this, this._values), this._renderControl(), this._wire();
|
|
6812
6812
|
}
|
|
6813
6813
|
_renderControl() {
|
|
6814
6814
|
let e = this.querySelector("[data-chips]");
|
|
6815
6815
|
if (e) {
|
|
6816
6816
|
for (let t of e.querySelectorAll(":scope > .chip")) t.remove();
|
|
6817
|
-
this._values.length && e.querySelector("[data-input]").insertAdjacentHTML("beforebegin", this._values.map((e) => `<span class="chip chip-sm"><span class="chip-label">${
|
|
6817
|
+
this._values.length && e.querySelector("[data-input]").insertAdjacentHTML("beforebegin", this._values.map((e) => `<span class="chip chip-sm"><span class="chip-label">${mi(e)}</span><button type="button" class="chip-remove" data-remove="${hi(e)}" aria-label="Remove ${hi(e)}">${B("x")}</button></span>`).join(""));
|
|
6818
6818
|
}
|
|
6819
6819
|
}
|
|
6820
6820
|
_wire() {
|
|
6821
6821
|
this._teardown();
|
|
6822
6822
|
let e = this.querySelector(".search-select-control"), t = this.querySelector("[data-input]");
|
|
6823
6823
|
if (!e || !t) return;
|
|
6824
|
-
let n = () => this.hasAttribute("disabled"), r = (this.getAttribute("separators") || "enter,comma").split(",").map((e) => e.trim()), i = this.getAttribute("max-tags"), a = this.hasAttribute("allow-duplicates"), o = new Set(r.map(
|
|
6825
|
-
|
|
6824
|
+
let n = () => this.hasAttribute("disabled"), r = (this.getAttribute("separators") || "enter,comma").split(",").map((e) => e.trim()), i = this.getAttribute("max-tags"), a = this.hasAttribute("allow-duplicates"), o = new Set(r.map(vr).filter(Boolean)), s = () => {
|
|
6825
|
+
z(this, this._values), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
6826
6826
|
}, c = (e) => {
|
|
6827
6827
|
let t = e.trim();
|
|
6828
6828
|
if (!t || i && this._values.length >= parseInt(i, 10)) return;
|
|
@@ -6853,9 +6853,9 @@ var hi = class extends e {
|
|
|
6853
6853
|
e.preventDefault();
|
|
6854
6854
|
let n = e.clipboardData.getData("text/plain"), a = [];
|
|
6855
6855
|
for (let e of r) {
|
|
6856
|
-
let t =
|
|
6857
|
-
if (
|
|
6858
|
-
a.push(...
|
|
6856
|
+
let t = yr(e) ?? e;
|
|
6857
|
+
if (xr(n, [t])) {
|
|
6858
|
+
a.push(...br(n, [t]));
|
|
6859
6859
|
break;
|
|
6860
6860
|
}
|
|
6861
6861
|
}
|
|
@@ -6883,18 +6883,18 @@ var hi = class extends e {
|
|
|
6883
6883
|
disconnectedCallback() {
|
|
6884
6884
|
this._teardown();
|
|
6885
6885
|
}
|
|
6886
|
-
},
|
|
6886
|
+
}, mi = (e) => String(e ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), hi = (e) => String(e ?? "").replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<"), gi = (e) => String(e).padStart(2, "0"), _i = (e, t) => `${gi(e)}:${gi(t)}`, vi = (e) => {
|
|
6887
6887
|
let t = /^(\d{2}):(\d{2})$/.exec(e || "");
|
|
6888
6888
|
return t ? {
|
|
6889
6889
|
h: +t[1],
|
|
6890
6890
|
m: +t[2]
|
|
6891
6891
|
} : null;
|
|
6892
|
-
},
|
|
6892
|
+
}, yi = (e, t = "24") => {
|
|
6893
6893
|
if (!e) return "";
|
|
6894
|
-
if (t === "24") return
|
|
6894
|
+
if (t === "24") return _i(e.h, e.m);
|
|
6895
6895
|
let n = e.h % 12 || 12, r = e.h >= 12 ? "PM" : "AM";
|
|
6896
|
-
return `${n}:${
|
|
6897
|
-
},
|
|
6896
|
+
return `${n}:${gi(e.m)} ${r}`;
|
|
6897
|
+
}, bi = class extends e {
|
|
6898
6898
|
static formAssociated = !0;
|
|
6899
6899
|
static get observedAttributes() {
|
|
6900
6900
|
return [
|
|
@@ -6946,34 +6946,34 @@ var hi = class extends e {
|
|
|
6946
6946
|
return this._value;
|
|
6947
6947
|
}
|
|
6948
6948
|
set value(e) {
|
|
6949
|
-
this._value = e || "",
|
|
6949
|
+
this._value = e || "", R(this, this._value), this._syncTrigger();
|
|
6950
6950
|
}
|
|
6951
6951
|
render() {
|
|
6952
6952
|
this._defaultValue === void 0 && (this._defaultValue = this.getAttribute("value") || "", this._value = this._defaultValue || this._value);
|
|
6953
|
-
let e = this.getAttribute("placeholder") || "Select time", t =
|
|
6953
|
+
let e = this.getAttribute("placeholder") || "Select time", t = vi(this._value), n = this.getAttribute("format") || "24", r = this.getAttribute("size"), i = r === "sm" ? " input-sm" : r === "lg" ? " input-lg" : "", a = this.getAttribute("aria-label"), o = this.getAttribute("aria-describedby");
|
|
6954
6954
|
this.innerHTML = `
|
|
6955
6955
|
<div class="timepicker">
|
|
6956
|
-
<button type="button" class="input timepicker-trigger${i}${t ? " has-value" : ""}" aria-haspopup="listbox" aria-expanded="false"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""}${a ? ` aria-label="${
|
|
6957
|
-
<span data-trigger-label class="${t ? "" : "timepicker-placeholder"}">${t ?
|
|
6958
|
-
${
|
|
6956
|
+
<button type="button" class="input timepicker-trigger${i}${t ? " has-value" : ""}" aria-haspopup="listbox" aria-expanded="false"${this.hasAttribute("aria-invalid") ? " aria-invalid=\"true\"" : ""}${this.hasAttribute("disabled") ? " disabled" : ""}${a ? ` aria-label="${V(a)}"` : ""}${o ? ` aria-describedby="${V(o)}"` : ""}>
|
|
6957
|
+
<span data-trigger-label class="${t ? "" : "timepicker-placeholder"}">${t ? yi(t, n) : V(e)}</span>
|
|
6958
|
+
${B("clock")}
|
|
6959
6959
|
</button>
|
|
6960
6960
|
<div class="timepicker-pop" role="listbox" tabindex="-1" hidden></div>
|
|
6961
|
-
</div>`, this._rendered = !0,
|
|
6961
|
+
</div>`, this._rendered = !0, R(this, this._value), this._wire();
|
|
6962
6962
|
}
|
|
6963
6963
|
_syncFormValue() {
|
|
6964
|
-
|
|
6964
|
+
R(this, this._value);
|
|
6965
6965
|
}
|
|
6966
6966
|
_syncTrigger() {
|
|
6967
6967
|
let e = this.querySelector(".timepicker-trigger"), t = this.querySelector("[data-trigger-label]");
|
|
6968
6968
|
if (!t) return;
|
|
6969
|
-
let n =
|
|
6970
|
-
t.textContent = n ?
|
|
6969
|
+
let n = vi(this._value), r = this.getAttribute("format") || "24";
|
|
6970
|
+
t.textContent = n ? yi(n, r) : this.getAttribute("placeholder") || "Select time", t.classList.toggle("timepicker-placeholder", !n), e?.classList.toggle("has-value", !!n);
|
|
6971
6971
|
}
|
|
6972
6972
|
_buildTimes() {
|
|
6973
|
-
let e = Math.max(1, parseInt(this.getAttribute("step") || "30", 10)), t = this.getAttribute("min") || "00:00", n = this.getAttribute("max") || "23:59", r =
|
|
6973
|
+
let e = Math.max(1, parseInt(this.getAttribute("step") || "30", 10)), t = this.getAttribute("min") || "00:00", n = this.getAttribute("max") || "23:59", r = vi(t) || {
|
|
6974
6974
|
h: 0,
|
|
6975
6975
|
m: 0
|
|
6976
|
-
}, i =
|
|
6976
|
+
}, i = vi(n) || {
|
|
6977
6977
|
h: 23,
|
|
6978
6978
|
m: 59
|
|
6979
6979
|
}, a = [], o = r.h, s = r.m;
|
|
@@ -6986,10 +6986,10 @@ var hi = class extends e {
|
|
|
6986
6986
|
_renderOptions() {
|
|
6987
6987
|
let e = this.querySelector(".timepicker-pop");
|
|
6988
6988
|
if (!e) return;
|
|
6989
|
-
let t = this.getAttribute("format") || "24", n = this._buildTimes(), r =
|
|
6989
|
+
let t = this.getAttribute("format") || "24", n = this._buildTimes(), r = vi(this._value), i = this._focus, a = "";
|
|
6990
6990
|
for (let e = 0; e < n.length; e++) {
|
|
6991
|
-
let o = n[e], s =
|
|
6992
|
-
a += `<button type="button" class="timepicker-option${c ? " is-selected" : ""}" data-hm="${s}" role="option" tabindex="${i === e ? "0" : "-1"}"${c ? " aria-selected=\"true\"" : ""}>${
|
|
6991
|
+
let o = n[e], s = _i(o.h, o.m), c = r && r.h === o.h && r.m === o.m;
|
|
6992
|
+
a += `<button type="button" class="timepicker-option${c ? " is-selected" : ""}" data-hm="${s}" role="option" tabindex="${i === e ? "0" : "-1"}"${c ? " aria-selected=\"true\"" : ""}>${yi(o, t)}</button>`;
|
|
6993
6993
|
}
|
|
6994
6994
|
e.innerHTML = a, this._focusActive();
|
|
6995
6995
|
}
|
|
@@ -6998,7 +6998,7 @@ var hi = class extends e {
|
|
|
6998
6998
|
t && !e.hidden && t.focus();
|
|
6999
6999
|
}
|
|
7000
7000
|
_position(e, t) {
|
|
7001
|
-
|
|
7001
|
+
I(e, t);
|
|
7002
7002
|
}
|
|
7003
7003
|
_onKey(e) {
|
|
7004
7004
|
let t = [...this.querySelector(".timepicker-pop").querySelectorAll(".timepicker-option")];
|
|
@@ -7076,22 +7076,22 @@ var hi = class extends e {
|
|
|
7076
7076
|
this._popClick = !1, r() && !t && !this.contains(e.target) && this._close();
|
|
7077
7077
|
}, document.addEventListener("click", this._onDocClick), this._onDocKey = (e) => {
|
|
7078
7078
|
r() && e.key === "Escape" && this._close();
|
|
7079
|
-
}, document.addEventListener("keydown", this._onDocKey),
|
|
7079
|
+
}, document.addEventListener("keydown", this._onDocKey), Bt(this, () => {
|
|
7080
7080
|
r() && this._position(e, t);
|
|
7081
7081
|
});
|
|
7082
7082
|
}, this._bindGlobal(), this._syncFormValue();
|
|
7083
7083
|
}
|
|
7084
7084
|
_teardown() {
|
|
7085
|
-
this._onDocClick &&= (document.removeEventListener("click", this._onDocClick), null), this._onDocKey &&= (document.removeEventListener("keydown", this._onDocKey), null),
|
|
7085
|
+
this._onDocClick &&= (document.removeEventListener("click", this._onDocClick), null), this._onDocKey &&= (document.removeEventListener("keydown", this._onDocKey), null), L(this), clearTimeout(this._typeaheadTimer), this._typeaheadTimer = null, this._typeahead = "";
|
|
7086
7086
|
}
|
|
7087
7087
|
disconnectedCallback() {
|
|
7088
7088
|
this._teardown();
|
|
7089
7089
|
}
|
|
7090
|
-
},
|
|
7090
|
+
}, xi = [
|
|
7091
7091
|
"none",
|
|
7092
7092
|
"single",
|
|
7093
7093
|
"multiple"
|
|
7094
|
-
],
|
|
7094
|
+
], Si = "parentId", Ci = "Loading", wi = "Could not load. Try again.", Ti = ":scope > input[data-wui-mirror]", Ei = [
|
|
7095
7095
|
"nodes",
|
|
7096
7096
|
"selection",
|
|
7097
7097
|
"selected",
|
|
@@ -7099,14 +7099,14 @@ var hi = class extends e {
|
|
|
7099
7099
|
"loadChildren",
|
|
7100
7100
|
"loadUrl",
|
|
7101
7101
|
"name"
|
|
7102
|
-
],
|
|
7103
|
-
function
|
|
7102
|
+
], Di = 0;
|
|
7103
|
+
function X(e, t, n) {
|
|
7104
7104
|
let r = document.createElement(e);
|
|
7105
7105
|
t && (r.className = t);
|
|
7106
7106
|
for (let [e, t] of Object.entries(n ?? {})) t != null && r.setAttribute(e, String(t));
|
|
7107
7107
|
return r;
|
|
7108
7108
|
}
|
|
7109
|
-
var
|
|
7109
|
+
var Oi = class extends e {
|
|
7110
7110
|
static get observedAttributes() {
|
|
7111
7111
|
return [
|
|
7112
7112
|
"selection",
|
|
@@ -7118,7 +7118,7 @@ var Ai = class extends e {
|
|
|
7118
7118
|
];
|
|
7119
7119
|
}
|
|
7120
7120
|
constructor() {
|
|
7121
|
-
super(), this._uid = `wui-tree-${++
|
|
7121
|
+
super(), this._uid = `wui-tree-${++Di}`, this._seq = 0, this._roots = [], this._byId = /* @__PURE__ */ new Map(), this._prev = null, this._staged = null, this._els = /* @__PURE__ */ new Map(), this._checked = /* @__PURE__ */ new Set(), this._selected = null, this._focusId = null, this._loader = null, this._list = null, this._live = null, this._ready = !1, this._nav = Gt({
|
|
7122
7122
|
getVisibleOptions: () => this._visible().map((e) => this._els.get(e.id)?.row),
|
|
7123
7123
|
getActive: () => this._visible().findIndex((e) => e.id === this._focusId),
|
|
7124
7124
|
setActive: (e) => this._focusNode(this._visible()[e]),
|
|
@@ -7133,11 +7133,11 @@ var Ai = class extends e {
|
|
|
7133
7133
|
}
|
|
7134
7134
|
connectedCallback() {
|
|
7135
7135
|
let e = {};
|
|
7136
|
-
for (let t of
|
|
7136
|
+
for (let t of Ei) Object.hasOwn(this, t) && (e[t] = this[t], delete this[t]);
|
|
7137
7137
|
if (!this._ready) {
|
|
7138
7138
|
this._ready = !0;
|
|
7139
7139
|
let e = this._readScript();
|
|
7140
|
-
this.replaceChildren(), this._list =
|
|
7140
|
+
this.replaceChildren(), this._list = X("ul", "wui-tree"), this._list.setAttribute("role", "tree"), this._live = X("div", "visually-hidden", {
|
|
7141
7141
|
role: "status",
|
|
7142
7142
|
"aria-live": "polite"
|
|
7143
7143
|
}), this.append(this._list, this._live), e && this._adoptAll(e);
|
|
@@ -7159,7 +7159,7 @@ var Ai = class extends e {
|
|
|
7159
7159
|
}
|
|
7160
7160
|
get selection() {
|
|
7161
7161
|
let e = this.getAttribute("selection");
|
|
7162
|
-
return
|
|
7162
|
+
return xi.includes(e) ? e : "none";
|
|
7163
7163
|
}
|
|
7164
7164
|
set selection(e) {
|
|
7165
7165
|
this.setAttribute("selection", String(e));
|
|
@@ -7203,13 +7203,13 @@ var Ai = class extends e {
|
|
|
7203
7203
|
e == null ? this.removeAttribute("name") : this.setAttribute("name", String(e));
|
|
7204
7204
|
}
|
|
7205
7205
|
get loadingText() {
|
|
7206
|
-
return this.getAttribute("loading-text") ??
|
|
7206
|
+
return this.getAttribute("loading-text") ?? Ci;
|
|
7207
7207
|
}
|
|
7208
7208
|
set loadingText(e) {
|
|
7209
7209
|
this.setAttribute("loading-text", String(e ?? ""));
|
|
7210
7210
|
}
|
|
7211
7211
|
get errorText() {
|
|
7212
|
-
return this.getAttribute("error-text") ??
|
|
7212
|
+
return this.getAttribute("error-text") ?? wi;
|
|
7213
7213
|
}
|
|
7214
7214
|
set errorText(e) {
|
|
7215
7215
|
this.setAttribute("error-text", String(e ?? ""));
|
|
@@ -7398,8 +7398,8 @@ var Ai = class extends e {
|
|
|
7398
7398
|
let t = this.getAttribute("load-url");
|
|
7399
7399
|
if (!t) throw Error("<wui-tree> has a node with children to load but no loadChildren or load-url.");
|
|
7400
7400
|
let n = new URL(t, window.location.href);
|
|
7401
|
-
n.searchParams.set(
|
|
7402
|
-
let r = await
|
|
7401
|
+
n.searchParams.set(Si, e.id);
|
|
7402
|
+
let r = await A(n.href, { headers: { Accept: "application/json" } });
|
|
7403
7403
|
if (!r.ok) throw Error(`Loading children answered ${r.kind}.`);
|
|
7404
7404
|
return JSON.parse(r.html);
|
|
7405
7405
|
}
|
|
@@ -7417,9 +7417,9 @@ var Ai = class extends e {
|
|
|
7417
7417
|
}
|
|
7418
7418
|
_syncForm() {
|
|
7419
7419
|
let e = this.selection;
|
|
7420
|
-
if (e === "multiple")
|
|
7421
|
-
else if (e === "single")
|
|
7422
|
-
else for (let e of this.querySelectorAll(
|
|
7420
|
+
if (e === "multiple") z(this, this.values);
|
|
7421
|
+
else if (e === "single") R(this, this._selected ?? "");
|
|
7422
|
+
else for (let e of this.querySelectorAll(Ti)) e.remove();
|
|
7423
7423
|
}
|
|
7424
7424
|
_render() {
|
|
7425
7425
|
if (!this._list) return;
|
|
@@ -7432,7 +7432,7 @@ var Ai = class extends e {
|
|
|
7432
7432
|
return e.map((t, n) => this._buildItem(t, n + 1, e.length));
|
|
7433
7433
|
}
|
|
7434
7434
|
_buildItem(e, t, n) {
|
|
7435
|
-
let r = this.selection, i = this._isBranch(e), a = this._state(e), o =
|
|
7435
|
+
let r = this.selection, i = this._isBranch(e), a = this._state(e), o = X("li", "wui-tree-item", {
|
|
7436
7436
|
role: "treeitem",
|
|
7437
7437
|
tabindex: e.id === this._focusId ? 0 : -1,
|
|
7438
7438
|
"aria-level": e.level,
|
|
@@ -7442,11 +7442,11 @@ var Ai = class extends e {
|
|
|
7442
7442
|
"aria-describedby": e.badge ? `${this._uid}-${e.seq}-badge` : null
|
|
7443
7443
|
});
|
|
7444
7444
|
i && o.setAttribute("aria-expanded", String(e.expanded)), e.disabled && o.setAttribute("aria-disabled", "true"), e.loading && o.setAttribute("aria-busy", "true"), r === "single" && o.setAttribute("aria-selected", String(e.id === this._selected)), r === "multiple" && o.setAttribute("aria-checked", a === "mixed" ? "mixed" : String(a === "checked"));
|
|
7445
|
-
let s =
|
|
7445
|
+
let s = X("div", "wui-tree-row", { role: "presentation" });
|
|
7446
7446
|
s.style.setProperty("--wui-tree-level", String(e.level - 1)), r === "single" && e.id === this._selected && s.classList.add("wui-tree-row-selected"), e.failed && s.classList.add("wui-tree-row-error");
|
|
7447
|
-
let c =
|
|
7448
|
-
if (i && (c.innerHTML =
|
|
7449
|
-
let t =
|
|
7447
|
+
let c = X("span", i ? "wui-tree-toggle" : "wui-tree-toggle wui-tree-toggle-leaf", { "aria-hidden": "true" });
|
|
7448
|
+
if (i && (c.innerHTML = B("chevron-right", { size: 16 })), s.append(c), r === "multiple") {
|
|
7449
|
+
let t = X("input", "form-check-input wui-tree-check", {
|
|
7450
7450
|
type: "checkbox",
|
|
7451
7451
|
tabindex: -1,
|
|
7452
7452
|
"aria-hidden": "true"
|
|
@@ -7454,16 +7454,16 @@ var Ai = class extends e {
|
|
|
7454
7454
|
t.checked = a === "checked", t.indeterminate = a === "mixed", t.disabled = e.disabled, t.addEventListener("mousedown", (e) => e.preventDefault()), s.append(t);
|
|
7455
7455
|
}
|
|
7456
7456
|
if (e.icon) {
|
|
7457
|
-
let t =
|
|
7458
|
-
t.innerHTML =
|
|
7457
|
+
let t = X("span", "wui-tree-icon", { "aria-hidden": "true" });
|
|
7458
|
+
t.innerHTML = B(e.icon, { size: 16 }), s.append(t);
|
|
7459
7459
|
}
|
|
7460
|
-
let l =
|
|
7460
|
+
let l = X("span", "wui-tree-label", { id: `${this._uid}-${e.seq}` });
|
|
7461
7461
|
if (l.textContent = e.label, s.append(l), e.badge) {
|
|
7462
|
-
let t =
|
|
7462
|
+
let t = X("span", `badge wui-tree-badge${e.badgeTone && e.badgeTone !== "neutral" ? ` badge-${e.badgeTone}` : ""}`, { id: `${this._uid}-${e.seq}-badge` });
|
|
7463
7463
|
t.textContent = e.badge, s.append(t);
|
|
7464
7464
|
}
|
|
7465
|
-
if (e.loading && s.append(
|
|
7466
|
-
let t =
|
|
7465
|
+
if (e.loading && s.append(X("span", "wui-tree-spinner", { "aria-hidden": "true" })), o.append(s), e.expanded && e.children?.length) {
|
|
7466
|
+
let t = X("ul", "wui-tree-group", { role: "group" });
|
|
7467
7467
|
t.append(...this._buildLevel(e.children)), o.append(t);
|
|
7468
7468
|
}
|
|
7469
7469
|
return this._els.set(e.id, {
|
|
@@ -7471,7 +7471,7 @@ var Ai = class extends e {
|
|
|
7471
7471
|
row: s
|
|
7472
7472
|
}), o;
|
|
7473
7473
|
}
|
|
7474
|
-
},
|
|
7474
|
+
}, ki = "wui-wizard-step", Ai = class extends e {
|
|
7475
7475
|
static get observedAttributes() {
|
|
7476
7476
|
return [
|
|
7477
7477
|
"active",
|
|
@@ -7505,7 +7505,7 @@ var Ai = class extends e {
|
|
|
7505
7505
|
this._beforeNext = typeof e == "function" ? e : null;
|
|
7506
7506
|
}
|
|
7507
7507
|
get _steps() {
|
|
7508
|
-
return [...this.querySelectorAll(`:scope > ${
|
|
7508
|
+
return [...this.querySelectorAll(`:scope > ${ki}`)];
|
|
7509
7509
|
}
|
|
7510
7510
|
refresh() {
|
|
7511
7511
|
this._rendered && this._renderChrome();
|
|
@@ -7544,7 +7544,7 @@ var Ai = class extends e {
|
|
|
7544
7544
|
}
|
|
7545
7545
|
_reconcileSteps() {
|
|
7546
7546
|
let e = this._steps, t = this._known;
|
|
7547
|
-
if (this._known = e,
|
|
7547
|
+
if (this._known = e, ji(e, t)) return e;
|
|
7548
7548
|
let n = (n) => new Set([...n].map((n) => e.indexOf(t[n])).filter((e) => e >= 0));
|
|
7549
7549
|
this._skipped = n(this._skipped), this._invalid = n(this._invalid);
|
|
7550
7550
|
let r = t[this._active];
|
|
@@ -7564,7 +7564,7 @@ var Ai = class extends e {
|
|
|
7564
7564
|
_onStepsMutated() {
|
|
7565
7565
|
if (!this._rendered) return;
|
|
7566
7566
|
let e = this._steps;
|
|
7567
|
-
(!e.length || this._header.nextElementSibling === e[0] && this._footer.previousElementSibling === e[e.length - 1]) &&
|
|
7567
|
+
(!e.length || this._header.nextElementSibling === e[0] && this._footer.previousElementSibling === e[e.length - 1]) && ji(e, this._known) || (this._renderChrome(), this._observer?.takeRecords());
|
|
7568
7568
|
}
|
|
7569
7569
|
_syncPanels(e) {
|
|
7570
7570
|
e.forEach((e, t) => {
|
|
@@ -7587,14 +7587,14 @@ var Ai = class extends e {
|
|
|
7587
7587
|
let i = this.hasAttribute("non-linear");
|
|
7588
7588
|
return e.map((e, r) => {
|
|
7589
7589
|
let a = this._stepStatus(e, r), o = e.getAttribute("label") || "", s = e.getAttribute("description") || "", c = e.getAttribute("icon") || "", l = r + 1, u;
|
|
7590
|
-
u = a === "done" ?
|
|
7591
|
-
let d = a === "pending" ? "step" : `step ${a}`, f = a === "active" ? " aria-current=\"step\"" : "", p = i || r < this._active, m = s ? `<span class="step-desc">${
|
|
7592
|
-
return h = t ? `<span class="step-circle">${u}</span><span class="step-text"><span class="step-index">Step ${l}</span><span class="step-label">${
|
|
7590
|
+
u = a === "done" ? B("check") : a === "error" ? B("alert-triangle") : a === "skipped" ? B("minus") : c ? B(c) : String(l);
|
|
7591
|
+
let d = a === "pending" ? "step" : `step ${a}`, f = a === "active" ? " aria-current=\"step\"" : "", p = i || r < this._active, m = s ? `<span class="step-desc">${Mi(s)}</span>` : "", h;
|
|
7592
|
+
return h = t ? `<span class="step-circle">${u}</span><span class="step-text"><span class="step-index">Step ${l}</span><span class="step-label">${Mi(o)}</span>${m}</span>` : n ? `<span class="step-circle">${u}</span><span class="step-index">Step ${l}</span><span class="step-label">${Mi(o)}</span>${m}` : `<span class="step-circle">${u}</span><span class="step-label">${Mi(o)}</span>${m}`, p ? `<button type="button" class="${d}" data-step="${r}"${f}>${h}</button>` : `<div class="${d}"${f}>${h}</div>`;
|
|
7593
7593
|
}).join("");
|
|
7594
7594
|
}
|
|
7595
7595
|
_footerHtml(e) {
|
|
7596
7596
|
let t = this._active, n = e.length - 1, r = this.hasAttribute("disabled") ? " disabled" : "", i = e[t]?.hasAttribute("optional") || this.hasAttribute("skippable"), a = this.getAttribute("back-label") || "Back", o = this.getAttribute("next-label") || "Next", s = this.getAttribute("skip-label") || "Skip", c = this.getAttribute("finish-label") || "Finish";
|
|
7597
|
-
return `${t > 0 ? `<button type="button" class="btn btn-secondary" data-nav="back"${r}>${
|
|
7597
|
+
return `${t > 0 ? `<button type="button" class="btn btn-secondary" data-nav="back"${r}>${B("arrow-left", { className: "me-2" })}${Mi(a)}</button>` : "<span></span>"}<span class="wizard-footer-actions">${i && t < n ? `<button type="button" class="btn btn-subtle" data-nav="skip"${r}>${Mi(s)}</button>` : ""}${t < n ? `<button type="button" class="btn btn-primary" data-nav="next"${r}>${Mi(o)}${B("arrow-right", { className: "ms-2" })}</button>` : `<button type="button" class="btn btn-primary" data-nav="finish"${r}>${Mi(c)}</button>`}</span>`;
|
|
7598
7598
|
}
|
|
7599
7599
|
_wire() {
|
|
7600
7600
|
this._teardown(), this._onHeaderClick = (e) => {
|
|
@@ -7668,7 +7668,7 @@ var Ai = class extends e {
|
|
|
7668
7668
|
_reflectActive(e) {
|
|
7669
7669
|
this._reflecting = !0, this.setAttribute("active", String(e)), this._reflecting = !1;
|
|
7670
7670
|
}
|
|
7671
|
-
},
|
|
7671
|
+
}, ji = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), Mi = (e) => String(e ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), Ni = class extends e {
|
|
7672
7672
|
static get observedAttributes() {
|
|
7673
7673
|
return [
|
|
7674
7674
|
"label",
|
|
@@ -7682,8 +7682,8 @@ var Ai = class extends e {
|
|
|
7682
7682
|
let e = this.closest("wui-wizard");
|
|
7683
7683
|
e && typeof e.refresh == "function" && e.refresh();
|
|
7684
7684
|
}
|
|
7685
|
-
},
|
|
7686
|
-
async function
|
|
7685
|
+
}, Pi = 2e3;
|
|
7686
|
+
async function Fi(e) {
|
|
7687
7687
|
try {
|
|
7688
7688
|
if (navigator.clipboard?.writeText) return await navigator.clipboard.writeText(e), !0;
|
|
7689
7689
|
} catch {}
|
|
@@ -7698,14 +7698,14 @@ async function Ii(e) {
|
|
|
7698
7698
|
}
|
|
7699
7699
|
//#endregion
|
|
7700
7700
|
//#region src/fileValidation.js
|
|
7701
|
-
var
|
|
7701
|
+
var Ii = "image/png,image/jpeg,image/webp", Li = 5, Ri = {
|
|
7702
7702
|
"image/png": [".png"],
|
|
7703
7703
|
"image/jpeg": [".jpg", ".jpeg"],
|
|
7704
7704
|
"image/webp": [".webp"],
|
|
7705
7705
|
"image/gif": [".gif"],
|
|
7706
7706
|
"image/svg+xml": [".svg"],
|
|
7707
7707
|
"application/pdf": [".pdf"]
|
|
7708
|
-
},
|
|
7708
|
+
}, zi = {
|
|
7709
7709
|
"image/png": "PNG",
|
|
7710
7710
|
"image/jpeg": "JPG",
|
|
7711
7711
|
"image/webp": "WEBP",
|
|
@@ -7719,7 +7719,7 @@ var Li = "image/png,image/jpeg,image/webp", Ri = 5, zi = {
|
|
|
7719
7719
|
".gif": "GIF",
|
|
7720
7720
|
".svg": "SVG",
|
|
7721
7721
|
".pdf": "PDF"
|
|
7722
|
-
},
|
|
7722
|
+
}, Bi = (e) => String(e || "").split(",").map((e) => e.trim().toLowerCase()).filter(Boolean), Vi = [
|
|
7723
7723
|
".png",
|
|
7724
7724
|
".jpg",
|
|
7725
7725
|
".jpeg",
|
|
@@ -7730,64 +7730,64 @@ var Li = "image/png,image/jpeg,image/webp", Ri = 5, zi = {
|
|
|
7730
7730
|
".avif",
|
|
7731
7731
|
".heic"
|
|
7732
7732
|
];
|
|
7733
|
-
function
|
|
7733
|
+
function Hi(e) {
|
|
7734
7734
|
if (!e) return !1;
|
|
7735
7735
|
let t = typeof e == "object" && e.type ? String(e.type).toLowerCase() : "";
|
|
7736
7736
|
if (t) return t.startsWith("image/");
|
|
7737
7737
|
let n = typeof e == "string" ? e : e.name || e.url || "", r = String(n).toLowerCase();
|
|
7738
|
-
return
|
|
7738
|
+
return Vi.some((e) => r.endsWith(e));
|
|
7739
7739
|
}
|
|
7740
|
-
function
|
|
7741
|
-
let t =
|
|
7742
|
-
return t.length ? t.every((e) => e.startsWith(".") ?
|
|
7740
|
+
function Ui(e) {
|
|
7741
|
+
let t = Bi(e);
|
|
7742
|
+
return t.length ? t.every((e) => e.startsWith(".") ? Vi.includes(e) : e === "image/*" || e.startsWith("image/")) : !1;
|
|
7743
7743
|
}
|
|
7744
|
-
function
|
|
7744
|
+
function Wi(e) {
|
|
7745
7745
|
let t = [];
|
|
7746
|
-
for (let n of
|
|
7747
|
-
let e =
|
|
7746
|
+
for (let n of Bi(e)) {
|
|
7747
|
+
let e = zi[n] || (n.startsWith(".") ? n.slice(1).toUpperCase() : n.toUpperCase());
|
|
7748
7748
|
t.includes(e) || t.push(e);
|
|
7749
7749
|
}
|
|
7750
7750
|
return t.length <= 1 ? t[0] || "supported" : `${t.slice(0, -1).join(", ")} or ${t[t.length - 1]}`;
|
|
7751
7751
|
}
|
|
7752
|
-
function
|
|
7753
|
-
let n =
|
|
7752
|
+
function Gi(e, t) {
|
|
7753
|
+
let n = Bi(t);
|
|
7754
7754
|
if (!n.length) return !0;
|
|
7755
7755
|
let r = (e.type || "").toLowerCase(), i = (e.name || "").toLowerCase();
|
|
7756
|
-
return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r && r === e ? !0 : !r && (
|
|
7756
|
+
return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r && r === e ? !0 : !r && (Ri[e] || []).some((e) => i.endsWith(e)));
|
|
7757
7757
|
}
|
|
7758
|
-
function
|
|
7758
|
+
function Ki(e, t = {}) {
|
|
7759
7759
|
if (!e) return null;
|
|
7760
|
-
let n = t.accept === void 0 ?
|
|
7761
|
-
return
|
|
7760
|
+
let n = t.accept === void 0 ? Ii : t.accept, r = t.maxSizeMb === void 0 ? 5 : t.maxSizeMb;
|
|
7761
|
+
return Gi(e, n) ? r > 0 && e.size > r * 1024 * 1024 ? `Keep the file under ${r} MB.` : null : `Choose a ${Wi(n)} file.`;
|
|
7762
7762
|
}
|
|
7763
7763
|
//#endregion
|
|
7764
7764
|
//#region src/inputMask.js
|
|
7765
|
-
var
|
|
7766
|
-
9:
|
|
7765
|
+
var qi = /[0-9]/, Ji = {
|
|
7766
|
+
9: qi,
|
|
7767
7767
|
A: /[A-Za-z]/,
|
|
7768
7768
|
"*": /[0-9A-Za-z]/
|
|
7769
|
-
},
|
|
7769
|
+
}, Yi = /[9A*]/, Xi = /* @__PURE__ */ new Set([
|
|
7770
7770
|
"text",
|
|
7771
7771
|
"tel",
|
|
7772
7772
|
"search",
|
|
7773
7773
|
"url",
|
|
7774
7774
|
"password"
|
|
7775
|
-
]),
|
|
7775
|
+
]), Zi = (e) => {
|
|
7776
7776
|
let t = e.replace(/\D/g, "");
|
|
7777
7777
|
return t.length === 12 && t.startsWith("91") ? t.slice(2) : t.length === 11 && t.startsWith("0") ? t.slice(1) : e;
|
|
7778
|
-
},
|
|
7778
|
+
}, Qi = (e) => {
|
|
7779
7779
|
let t = Number(e.slice(0, 2)), n = Number(e.slice(2, 4)), r = Number(e.slice(4, 8));
|
|
7780
7780
|
if (r < 1) return !1;
|
|
7781
7781
|
let i = new Date(Date.UTC(r, n - 1, t));
|
|
7782
7782
|
return i.getUTCFullYear() === r && i.getUTCMonth() === n - 1 && i.getUTCDate() === t;
|
|
7783
|
-
},
|
|
7783
|
+
}, $i = (e) => e.length <= 3 ? e : `${e.slice(0, -3).replace(/\B(?=(\d{2})+(?!\d))/g, ",")},${e.slice(-3)}`, ea = (e) => {
|
|
7784
7784
|
let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());
|
|
7785
7785
|
return t ? `${t[3]}-${t[2]}-${t[1]}` : e;
|
|
7786
7786
|
};
|
|
7787
|
-
function
|
|
7788
|
-
let o = [...e].map((e) =>
|
|
7787
|
+
function ta(e, { upper: t = !1, normalize: n, valid: r, post: i = (e) => e, message: a = "Enter the full value" } = {}) {
|
|
7788
|
+
let o = [...e].map((e) => Ji[e] ? { re: Ji[e] } : { lit: e }), s = o.filter((e) => e.re).length;
|
|
7789
7789
|
return {
|
|
7790
|
-
inputMode: o.every((e) => !e.re || e.re ===
|
|
7790
|
+
inputMode: o.every((e) => !e.re || e.re === qi) ? "numeric" : "text",
|
|
7791
7791
|
normalize: n,
|
|
7792
7792
|
post: i,
|
|
7793
7793
|
message: a,
|
|
@@ -7819,11 +7819,11 @@ function na() {
|
|
|
7819
7819
|
message: "Enter a valid amount",
|
|
7820
7820
|
extract(e) {
|
|
7821
7821
|
let t = "", n = !1, r = 0;
|
|
7822
|
-
for (let i of e)
|
|
7822
|
+
for (let i of e) qi.test(i) ? n ? r < 2 && (t += i, r++) : t += i : i === "." && !n && (n = !0, t += i);
|
|
7823
7823
|
return t.startsWith(".") && (t = `0${t}`), t.replace(/^0+(?=\d)/, "");
|
|
7824
7824
|
},
|
|
7825
7825
|
layout(e) {
|
|
7826
|
-
let [t, n] = e.split("."), r =
|
|
7826
|
+
let [t, n] = e.split("."), r = $i(t) + (e.includes(".") ? `.${n}` : "");
|
|
7827
7827
|
return {
|
|
7828
7828
|
text: r,
|
|
7829
7829
|
isRaw: [...r].map((e) => e !== ",")
|
|
@@ -7833,49 +7833,49 @@ function na() {
|
|
|
7833
7833
|
};
|
|
7834
7834
|
}
|
|
7835
7835
|
var ra = {
|
|
7836
|
-
"phone-in": () =>
|
|
7837
|
-
normalize:
|
|
7836
|
+
"phone-in": () => ta("99999 99999", {
|
|
7837
|
+
normalize: Zi,
|
|
7838
7838
|
valid: (e) => /^[6-9]/.test(e),
|
|
7839
7839
|
message: "Enter a 10-digit mobile number"
|
|
7840
7840
|
}),
|
|
7841
|
-
pan: () =>
|
|
7841
|
+
pan: () => ta("AAAAA9999A", {
|
|
7842
7842
|
upper: !0,
|
|
7843
7843
|
valid: (e) => /^[A-Z]{5}\d{4}[A-Z]$/.test(e),
|
|
7844
7844
|
message: "Enter a valid PAN"
|
|
7845
7845
|
}),
|
|
7846
|
-
gstin: () =>
|
|
7846
|
+
gstin: () => ta("99AAAAA9999A***", {
|
|
7847
7847
|
upper: !0,
|
|
7848
7848
|
valid: (e) => /^\d{2}[A-Z]{5}\d{4}[A-Z][1-9A-Z]Z[0-9A-Z]$/.test(e),
|
|
7849
7849
|
message: "Enter a valid GSTIN"
|
|
7850
7850
|
}),
|
|
7851
|
-
aadhaar: () =>
|
|
7851
|
+
aadhaar: () => ta("9999 9999 9999", {
|
|
7852
7852
|
valid: (e) => /^[2-9]/.test(e),
|
|
7853
7853
|
message: "Enter a valid 12-digit Aadhaar number"
|
|
7854
7854
|
}),
|
|
7855
|
-
ifsc: () =>
|
|
7855
|
+
ifsc: () => ta("AAAA*******", {
|
|
7856
7856
|
upper: !0,
|
|
7857
7857
|
valid: (e) => /^[A-Z]{4}0[A-Z0-9]{6}$/.test(e),
|
|
7858
7858
|
message: "Enter a valid IFSC"
|
|
7859
7859
|
}),
|
|
7860
|
-
"pin-code": () =>
|
|
7860
|
+
"pin-code": () => ta("999999", {
|
|
7861
7861
|
valid: (e) => /^[1-9]/.test(e),
|
|
7862
7862
|
message: "Enter a valid 6-digit PIN code"
|
|
7863
7863
|
}),
|
|
7864
|
-
date: () =>
|
|
7865
|
-
normalize:
|
|
7866
|
-
valid:
|
|
7867
|
-
post: (e, t) => e.length === 8 &&
|
|
7864
|
+
date: () => ta("99-99-9999", {
|
|
7865
|
+
normalize: ea,
|
|
7866
|
+
valid: Qi,
|
|
7867
|
+
post: (e, t) => e.length === 8 && Qi(e) ? `${e.slice(4)}-${e.slice(2, 4)}-${e.slice(0, 2)}` : t,
|
|
7868
7868
|
message: "Enter a valid date as DD-MM-YYYY"
|
|
7869
7869
|
}),
|
|
7870
7870
|
amount: na
|
|
7871
7871
|
}, ia = Object.keys(ra), aa = (e) => {
|
|
7872
7872
|
let t = String(e).toLowerCase();
|
|
7873
7873
|
return Object.hasOwn(ra, t) ? t : void 0;
|
|
7874
|
-
}, oa = (e) =>
|
|
7874
|
+
}, oa = (e) => Yi.test(String(e)) && aa(e) === void 0, sa = /* @__PURE__ */ new Map();
|
|
7875
7875
|
function ca(e) {
|
|
7876
7876
|
if (e == null || e === "") return null;
|
|
7877
7877
|
let t = String(e);
|
|
7878
|
-
return sa.has(t) || (oa(t) ? sa.set(t,
|
|
7878
|
+
return sa.has(t) || (oa(t) ? sa.set(t, ta(t)) : sa.set(t, Object.hasOwn(ra, t) ? ra[t]() : null)), sa.get(t);
|
|
7879
7879
|
}
|
|
7880
7880
|
var Z = (e, t) => e.normalize ? e.normalize(t) : t;
|
|
7881
7881
|
function la(e, t) {
|
|
@@ -7926,7 +7926,7 @@ function _a(e) {
|
|
|
7926
7926
|
}
|
|
7927
7927
|
function va(e, { mask: t, postFormatted: n = !1, onChange: r, onInvalidChange: i } = {}) {
|
|
7928
7928
|
let a = ca(t);
|
|
7929
|
-
if (!a || !
|
|
7929
|
+
if (!a || !Xi.has(e.type)) return () => {};
|
|
7930
7930
|
let o = Object.getPrototypeOf(e), s = Object.getOwnPropertyDescriptor(o, "value").set, c = !e.hasAttribute("inputmode");
|
|
7931
7931
|
c && e.setAttribute("inputmode", a.inputMode);
|
|
7932
7932
|
let l = i ?? _a(e), u = null, d = !1, f = !1, p = !1, m = "", h = "", g, _ = () => {
|
|
@@ -7934,7 +7934,7 @@ function va(e, { mask: t, postFormatted: n = !1, onChange: r, onInvalidChange: i
|
|
|
7934
7934
|
e !== h && (h = e, l(h));
|
|
7935
7935
|
}, v = (t, n, i) => {
|
|
7936
7936
|
let o = a.extract(t.slice(0, n)).length, c = a.extract(t), { text: l, isRaw: d } = a.layout(c);
|
|
7937
|
-
if (e.value !== l && (s.call(e, l), document.activeElement === e &&
|
|
7937
|
+
if (e.value !== l && (s.call(e, l), document.activeElement === e && Xi.has(e.type))) {
|
|
7938
7938
|
let t = fa(d, o);
|
|
7939
7939
|
e.setSelectionRange(t, t);
|
|
7940
7940
|
}
|
|
@@ -7980,21 +7980,21 @@ function va(e, { mask: t, postFormatted: n = !1, onChange: r, onInvalidChange: i
|
|
|
7980
7980
|
}, ne = () => {
|
|
7981
7981
|
let t = a.extract(e.value);
|
|
7982
7982
|
return a.post(t, a.layout(t).text);
|
|
7983
|
-
},
|
|
7983
|
+
}, T = () => {
|
|
7984
7984
|
p = !0, _();
|
|
7985
7985
|
};
|
|
7986
|
-
e.addEventListener("input", S), e.addEventListener("beforeinput", ee), e.addEventListener("paste", te), e.addEventListener("compositionstart", C), e.addEventListener("compositionend", w), e.addEventListener("blur",
|
|
7987
|
-
let
|
|
7986
|
+
e.addEventListener("input", S), e.addEventListener("beforeinput", ee), e.addEventListener("paste", te), e.addEventListener("compositionstart", C), e.addEventListener("compositionend", w), e.addEventListener("blur", T), e.addEventListener("invalid", T);
|
|
7987
|
+
let E = e.form, re = (t) => {
|
|
7988
7988
|
e.name && !e.disabled && ga(t.formData, e.name, e.value, ne());
|
|
7989
|
-
},
|
|
7989
|
+
}, ie = () => {
|
|
7990
7990
|
clearTimeout(g), g = setTimeout(() => {
|
|
7991
7991
|
p = !1, v(Z(a, e.value), e.value.length, !0);
|
|
7992
7992
|
}, 0);
|
|
7993
7993
|
};
|
|
7994
|
-
n || (
|
|
7995
|
-
let
|
|
7996
|
-
return v(
|
|
7997
|
-
clearTimeout(g), e.removeEventListener("input", S), e.removeEventListener("beforeinput", ee), e.removeEventListener("paste", te), e.removeEventListener("compositionstart", C), e.removeEventListener("compositionend", w), e.removeEventListener("blur",
|
|
7994
|
+
n || (E?.addEventListener("formdata", re), pa.set(e, ne)), E?.addEventListener("reset", ie), E?.addEventListener("submit", T);
|
|
7995
|
+
let D = Z(a, e.value);
|
|
7996
|
+
return v(D, D.length, !1), () => {
|
|
7997
|
+
clearTimeout(g), e.removeEventListener("input", S), e.removeEventListener("beforeinput", ee), e.removeEventListener("paste", te), e.removeEventListener("compositionstart", C), e.removeEventListener("compositionend", w), e.removeEventListener("blur", T), e.removeEventListener("invalid", T), E?.removeEventListener("formdata", re), E?.removeEventListener("reset", ie), E?.removeEventListener("submit", T), pa.delete(e), y ? Object.defineProperty(e, "value", y) : delete e.value, p = !1, m = "", _(), e.setCustomValidity(""), delete e.dataset.maskRaw, c && e.removeAttribute("inputmode");
|
|
7998
7998
|
};
|
|
7999
7999
|
}
|
|
8000
8000
|
function ya() {
|
|
@@ -8173,7 +8173,7 @@ function Za(e) {
|
|
|
8173
8173
|
searchInput: e.dataset.searchInput || null,
|
|
8174
8174
|
loadingText: e.dataset.loadingText || Wa.loading,
|
|
8175
8175
|
errorText: e.dataset.errorText || Wa.error
|
|
8176
|
-
}, c = new URL(r, window.location.href), l = new Set(c.searchParams.keys()), u = n.hasAttribute("data-app-datatable-selectable"), d = /* @__PURE__ */ new Set(), f =
|
|
8176
|
+
}, c = new URL(r, window.location.href), l = new Set(c.searchParams.keys()), u = n.hasAttribute("data-app-datatable-selectable"), d = /* @__PURE__ */ new Set(), f = ue(), p = new AbortController(), m = { signal: p.signal }, h = n.querySelector(":scope > tbody[data-wui-rows]");
|
|
8177
8177
|
if (!h) throw Error("A server-paged table needs its rows in <app-table-rows> (tbody[data-wui-rows]).");
|
|
8178
8178
|
let g = qa(h), _ = null, v = null, y = (e) => {
|
|
8179
8179
|
let t = new URLSearchParams();
|
|
@@ -8200,9 +8200,9 @@ function Za(e) {
|
|
|
8200
8200
|
if (e.total === 0) return Wa.empty;
|
|
8201
8201
|
let t = e.pageSize > 0 ? Math.max(1, Math.ceil(e.total / e.pageSize)) : 1;
|
|
8202
8202
|
return `Page ${e.page} of ${t}, ${e.total} ${e.total === 1 ? "row" : "rows"}`;
|
|
8203
|
-
},
|
|
8203
|
+
}, T = () => [...n.querySelectorAll(":scope > thead > tr:first-child > th")], E = (e) => {
|
|
8204
8204
|
if (u && [...e.querySelectorAll(":scope > tr")].some((e) => !e.dataset.rowKey)) throw Error("A selectable server-paged table needs data-row-key on every row, so a selection can span pages.");
|
|
8205
|
-
},
|
|
8205
|
+
}, re = (e) => {
|
|
8206
8206
|
let t = [...e.querySelectorAll(":scope > tr")];
|
|
8207
8207
|
if (u) {
|
|
8208
8208
|
za(t);
|
|
@@ -8212,7 +8212,7 @@ function Za(e) {
|
|
|
8212
8212
|
}
|
|
8213
8213
|
Va(n);
|
|
8214
8214
|
}
|
|
8215
|
-
let r =
|
|
8215
|
+
let r = T();
|
|
8216
8216
|
if (n.classList.contains("wui-table-stack")) for (let e of t) [...e.cells].forEach((e, t) => {
|
|
8217
8217
|
let n = r[t]?.textContent.trim();
|
|
8218
8218
|
n && !e.hasAttribute("data-label") && e.setAttribute("data-label", n);
|
|
@@ -8220,92 +8220,92 @@ function Za(e) {
|
|
|
8220
8220
|
r.forEach((e, n) => {
|
|
8221
8221
|
if (e.classList.contains("wui-col-hidden")) for (let e of t) e.cells[n]?.classList.add("wui-col-hidden");
|
|
8222
8222
|
});
|
|
8223
|
-
},
|
|
8223
|
+
}, ie = (e) => {
|
|
8224
8224
|
for (let t of e.querySelectorAll(":scope > template[data-wui-pager], :scope > template[data-wui-empty], :scope > template[data-wui-filters]")) t.remove();
|
|
8225
|
-
},
|
|
8225
|
+
}, D = (e) => e?.dispatchEvent(new CustomEvent("wui:teardown", { bubbles: !0 })), O = (e, t) => {
|
|
8226
8226
|
if (!i) return;
|
|
8227
8227
|
let n = e.querySelector(":scope > template[data-wui-empty]");
|
|
8228
|
-
|
|
8229
|
-
},
|
|
8228
|
+
D(i), t.total === 0 && n ? (i.replaceChildren(n.content.cloneNode(!0)), i.hidden = !1) : (i.replaceChildren(), i.hidden = !0);
|
|
8229
|
+
}, ae = (e) => {
|
|
8230
8230
|
let r = qa(e);
|
|
8231
8231
|
if (a) {
|
|
8232
8232
|
let t = e.querySelector(":scope > template[data-wui-pager]");
|
|
8233
|
-
|
|
8233
|
+
D(a), a.replaceChildren(...t ? [t.content.cloneNode(!0)] : []), a.hidden = !1;
|
|
8234
8234
|
}
|
|
8235
|
-
|
|
8235
|
+
O(e, r);
|
|
8236
8236
|
let i = e.querySelector(":scope > template[data-wui-filters]"), o = s.filtersRegion && i ? document.querySelector(s.filtersRegion) : null;
|
|
8237
|
-
o && (
|
|
8238
|
-
},
|
|
8237
|
+
o && (D(o), o.replaceChildren(i.content.cloneNode(!0))), ie(e), D(h), n.replaceChild(e, h), h = e, g = r, t.removeAttribute("data-wui-table-error"), re(e), pe();
|
|
8238
|
+
}, oe = (e) => {
|
|
8239
8239
|
let t = document.createElement("template");
|
|
8240
8240
|
t.innerHTML = `<table>${e}</table>`;
|
|
8241
8241
|
let n = t.content.querySelector("tbody[data-wui-rows]");
|
|
8242
|
-
return n &&
|
|
8243
|
-
},
|
|
8242
|
+
return n && E(n), n ? document.importNode(n, !0) : null;
|
|
8243
|
+
}, se = (e) => {
|
|
8244
8244
|
e ? t.setAttribute("aria-busy", "true") : t.removeAttribute("aria-busy");
|
|
8245
|
-
},
|
|
8246
|
-
let n =
|
|
8245
|
+
}, ce = (e) => e === "forbidden" ? Wa.forbidden : e === "network" ? Wa.network : s.errorText, le = (e) => {
|
|
8246
|
+
let n = ce(e);
|
|
8247
8247
|
if (t.setAttribute("data-wui-table-error", e), a && (a.hidden = !0), i) {
|
|
8248
8248
|
let t = document.createElement("div");
|
|
8249
8249
|
t.className = "tbl-empty wui-table-error", t.setAttribute("role", "alert");
|
|
8250
8250
|
let r = document.createElement("span");
|
|
8251
|
-
r.className = "tbl-empty-icon", r.innerHTML =
|
|
8251
|
+
r.className = "tbl-empty-icon", r.innerHTML = B(e === "forbidden" ? "lock" : "alert-circle", { size: 24 });
|
|
8252
8252
|
let a = document.createElement("div");
|
|
8253
8253
|
a.className = "tbl-empty-title", a.textContent = n;
|
|
8254
8254
|
let o = document.createElement("div");
|
|
8255
8255
|
o.className = "tbl-empty-action";
|
|
8256
8256
|
let s = document.createElement("button");
|
|
8257
|
-
s.type = "button", s.className = "btn btn-outline-primary btn-sm", s.setAttribute("data-wui-table-retry", ""), s.textContent = Wa.retry, o.append(s), t.append(r, a, o),
|
|
8257
|
+
s.type = "button", s.className = "btn btn-outline-primary btn-sm", s.setAttribute("data-wui-table-retry", ""), s.textContent = Wa.retry, o.append(s), t.append(r, a, o), D(i), i.replaceChildren(t), i.hidden = !1;
|
|
8258
8258
|
}
|
|
8259
8259
|
te(n);
|
|
8260
|
-
},
|
|
8260
|
+
}, k = async (e, t = "none") => {
|
|
8261
8261
|
let n = new URLSearchParams(e);
|
|
8262
8262
|
_ = {
|
|
8263
8263
|
query: n,
|
|
8264
8264
|
mode: t
|
|
8265
|
-
},
|
|
8265
|
+
}, se(!0), te(s.loadingText), ee("wui:table:loading", { query: n.toString() });
|
|
8266
8266
|
let r = await f.run(S(n));
|
|
8267
8267
|
if (r.kind === "aborted" || r.kind === "stale" || r.kind === "session") return r;
|
|
8268
|
-
|
|
8268
|
+
se(!1);
|
|
8269
8269
|
let i = null, a = r.ok ? null : r.kind;
|
|
8270
8270
|
if (r.ok) {
|
|
8271
8271
|
try {
|
|
8272
|
-
i =
|
|
8272
|
+
i = oe(r.html);
|
|
8273
8273
|
} catch (e) {
|
|
8274
8274
|
console.error(e);
|
|
8275
8275
|
}
|
|
8276
8276
|
i || (a = "server");
|
|
8277
8277
|
}
|
|
8278
|
-
return a ? (
|
|
8278
|
+
return a ? (le(a), ee("wui:table:error", {
|
|
8279
8279
|
status: r.status,
|
|
8280
8280
|
kind: a,
|
|
8281
|
-
message:
|
|
8282
|
-
}), r) : (
|
|
8281
|
+
message: ce(a)
|
|
8282
|
+
}), r) : (ae(i), w = C(n, g), s.urlState && t === "push" ? window.history.pushState(window.history.state, "", x(w)) : s.urlState && t === "replace" && window.history.replaceState(window.history.state, "", x(w)), te(ne(g)), window.WUI?.refresh?.(), ee("wui:table:loaded", {
|
|
8283
8283
|
...g,
|
|
8284
8284
|
query: w.toString()
|
|
8285
8285
|
}), r);
|
|
8286
|
-
},
|
|
8287
|
-
for (let e of
|
|
8286
|
+
}, de = (e) => (e.delete("page"), e), fe = () => [...n.querySelectorAll(":scope > thead th[data-sort-key]")], pe = () => {
|
|
8287
|
+
for (let e of fe()) {
|
|
8288
8288
|
let t = e.dataset.sortKey === g.sortBy;
|
|
8289
8289
|
e.setAttribute("aria-sort", t ? g.sortOrder === "desc" ? "descending" : "ascending" : "none");
|
|
8290
8290
|
}
|
|
8291
8291
|
};
|
|
8292
|
-
for (let e of
|
|
8292
|
+
for (let e of fe()) if (e.classList.add("sortable"), e.tabIndex = 0, !e.querySelector(".sort-icon")) {
|
|
8293
8293
|
let t = e.classList.contains("num") || e.classList.contains("text-end"), n = document.createElement("span");
|
|
8294
|
-
n.className = t ? "sort-icon wui-sort-lead" : "sort-icon", n.innerHTML =
|
|
8294
|
+
n.className = t ? "sort-icon wui-sort-lead" : "sort-icon", n.innerHTML = B("chevrons-up-down", { size: 14 }), t ? e.prepend(n) : e.append(n);
|
|
8295
8295
|
}
|
|
8296
|
-
let
|
|
8297
|
-
let t =
|
|
8298
|
-
return t.set("sortBy", e), t.set("sortOrder", n),
|
|
8296
|
+
let j = (e) => {
|
|
8297
|
+
let t = de(new URLSearchParams(w)), n = g.sortBy === e && g.sortOrder === "asc" ? "desc" : "asc";
|
|
8298
|
+
return t.set("sortBy", e), t.set("sortOrder", n), k(t, "push");
|
|
8299
8299
|
};
|
|
8300
8300
|
n.addEventListener("click", (e) => {
|
|
8301
8301
|
let t = e.target.closest("th[data-sort-key]");
|
|
8302
|
-
t && n.tHead?.contains(t) &&
|
|
8302
|
+
t && n.tHead?.contains(t) && j(t.dataset.sortKey);
|
|
8303
8303
|
}), n.addEventListener("keydown", (e) => {
|
|
8304
8304
|
if (e.key !== "Enter" && e.key !== " ") return;
|
|
8305
8305
|
let t = e.target.closest?.("th[data-sort-key]");
|
|
8306
|
-
!t || !n.tHead?.contains(t) || (e.preventDefault(),
|
|
8306
|
+
!t || !n.tHead?.contains(t) || (e.preventDefault(), j(t.dataset.sortKey));
|
|
8307
8307
|
});
|
|
8308
|
-
let
|
|
8308
|
+
let me = () => {
|
|
8309
8309
|
Va(n), n.dispatchEvent(new CustomEvent("selectionchange", {
|
|
8310
8310
|
bubbles: !0,
|
|
8311
8311
|
detail: {
|
|
@@ -8326,67 +8326,77 @@ function Za(e) {
|
|
|
8326
8326
|
if (!e) return;
|
|
8327
8327
|
t.checked ? d.add(e) : d.delete(e);
|
|
8328
8328
|
}
|
|
8329
|
-
|
|
8329
|
+
me();
|
|
8330
8330
|
}
|
|
8331
8331
|
}), a && (a.addEventListener("click", (e) => {
|
|
8332
8332
|
let t = e.target.closest("a[href]");
|
|
8333
|
-
!t || e.defaultPrevented || e.button !== 0 || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey || (e.preventDefault(),
|
|
8333
|
+
!t || e.defaultPrevented || e.button !== 0 || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey || (e.preventDefault(), k(b(t.getAttribute("href")), "push"));
|
|
8334
8334
|
}), a.addEventListener("change", (e) => {
|
|
8335
|
-
!e.target.classList?.contains("tpg-select") || !e.target.value || (e.stopPropagation(),
|
|
8335
|
+
!e.target.classList?.contains("tpg-select") || !e.target.value || (e.stopPropagation(), k(b(e.target.value), "push"));
|
|
8336
8336
|
}));
|
|
8337
|
-
let
|
|
8337
|
+
let he = () => {
|
|
8338
8338
|
if (!s.searchInput) return null;
|
|
8339
8339
|
let e = document.querySelector(s.searchInput);
|
|
8340
8340
|
return e && (e.matches("input, textarea") ? e : e.querySelector("input"));
|
|
8341
|
-
},
|
|
8341
|
+
}, ge = () => e.isConnected ? !0 : (p.abort(), clearTimeout(v), !1), _e = (e, t) => {
|
|
8342
8342
|
let n = t?.name ? new FormData(e, t) : new FormData(e), r = new Set([...e.querySelectorAll("[name]")].map((e) => e.getAttribute("name"))), i = new URLSearchParams();
|
|
8343
8343
|
for (let [e, t] of w) e !== "page" && (Ha.includes(e) || !r.has(e)) && i.append(e, t);
|
|
8344
8344
|
for (let [e, t] of n) typeof t != "string" || t === "" || Ha.includes(e) || l.has(e) || i.append(e, t);
|
|
8345
|
-
let a =
|
|
8345
|
+
let a = he();
|
|
8346
8346
|
if (a) {
|
|
8347
8347
|
i.delete(Ua);
|
|
8348
8348
|
let e = a.value.trim();
|
|
8349
8349
|
e && i.set(Ua, e);
|
|
8350
8350
|
}
|
|
8351
|
-
return
|
|
8352
|
-
},
|
|
8351
|
+
return k(i, "push");
|
|
8352
|
+
}, ve = (e) => s.filtersForm && e.closest?.(s.filtersForm) || s.filtersRegion && e.closest?.(s.filtersRegion) || null;
|
|
8353
8353
|
document.addEventListener("submit", (e) => {
|
|
8354
|
-
!
|
|
8354
|
+
!ge() || !s.filtersForm || !(e.target instanceof HTMLFormElement) || !e.target.matches(s.filtersForm) || (e.preventDefault(), _e(e.target, e.submitter));
|
|
8355
8355
|
}, m), document.addEventListener("change", (e) => {
|
|
8356
|
-
if (!
|
|
8356
|
+
if (!ge() || !s.filtersForm) return;
|
|
8357
8357
|
let t = e.target.closest?.(s.filtersForm);
|
|
8358
|
-
!t || e.target ===
|
|
8359
|
-
}, m)
|
|
8360
|
-
|
|
8358
|
+
!t || e.target === he() || _e(t);
|
|
8359
|
+
}, m);
|
|
8360
|
+
let ye = (e, t) => {
|
|
8361
|
+
for (let n of e?.querySelectorAll("input[name]:not([type=hidden], [type=checkbox], [type=radio])") ?? []) {
|
|
8362
|
+
let e = t.get(n.name) ?? "";
|
|
8363
|
+
n.value !== e && (n.value = e, n.dispatchEvent(new Event("input", { bubbles: !0 })));
|
|
8364
|
+
}
|
|
8365
|
+
};
|
|
8366
|
+
document.addEventListener("click", (e) => {
|
|
8367
|
+
if (!ge()) return;
|
|
8361
8368
|
let t = e.target.closest?.("a[href]");
|
|
8362
|
-
if (!t || !
|
|
8369
|
+
if (!t || !ve(t) || e.defaultPrevented || e.button !== 0 || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) return;
|
|
8363
8370
|
let n = new URL(t.getAttribute("href"), window.location.href);
|
|
8364
|
-
n.origin !== window.location.origin || n.pathname !== window.location.pathname
|
|
8371
|
+
if (n.origin !== window.location.origin || n.pathname !== window.location.pathname) return;
|
|
8372
|
+
e.preventDefault();
|
|
8373
|
+
let r = de(b(n.href));
|
|
8374
|
+
ye(t.closest("form"), r), k(r, "push");
|
|
8365
8375
|
}, m), document.addEventListener("input", (e) => {
|
|
8366
|
-
if (!
|
|
8367
|
-
let t =
|
|
8376
|
+
if (!ge()) return;
|
|
8377
|
+
let t = he();
|
|
8368
8378
|
!t || e.target !== t || (clearTimeout(v), v = setTimeout(() => {
|
|
8369
|
-
let e =
|
|
8370
|
-
n ? e.set(Ua, n) : e.delete(Ua), e.toString() !== w.toString() &&
|
|
8379
|
+
let e = de(new URLSearchParams(w)), n = t.value.trim();
|
|
8380
|
+
n ? e.set(Ua, n) : e.delete(Ua), e.toString() !== w.toString() && k(e, "replace");
|
|
8371
8381
|
}, 300));
|
|
8372
8382
|
}, m), s.urlState && window.addEventListener("popstate", () => {
|
|
8373
|
-
if (!
|
|
8374
|
-
let e = y(window.location.search), t =
|
|
8375
|
-
t && (t.value = e.get("search") ?? ""),
|
|
8383
|
+
if (!ge()) return;
|
|
8384
|
+
let e = y(window.location.search), t = he();
|
|
8385
|
+
t && (t.value = e.get("search") ?? ""), k(e, "none");
|
|
8376
8386
|
}, m), document.addEventListener("wui:modal:success", () => {
|
|
8377
|
-
|
|
8387
|
+
ge() && s.refreshOnSuccess && k(w, "none");
|
|
8378
8388
|
}, m), i?.addEventListener("click", (e) => {
|
|
8379
|
-
e.target.closest("[data-wui-table-retry]") && _ &&
|
|
8389
|
+
e.target.closest("[data-wui-table-retry]") && _ && k(_.query, _.mode);
|
|
8380
8390
|
});
|
|
8381
|
-
let
|
|
8391
|
+
let be = async (e) => {
|
|
8382
8392
|
let t = e.dataset.url;
|
|
8383
8393
|
if (!t) throw Error("A data-wui-row-action button needs data-url: the handler the action posts to.");
|
|
8384
8394
|
let n = e.closest("tr")?.dataset.rowKey ?? null, r = e.dataset.wuiRowAction || "";
|
|
8385
8395
|
e.disabled = !0, e.setAttribute("aria-busy", "true");
|
|
8386
|
-
let i = await
|
|
8396
|
+
let i = await A(t, { method: (e.dataset.method || "post").toUpperCase() });
|
|
8387
8397
|
if (e.disabled = !1, e.removeAttribute("aria-busy"), i.kind === "session" || i.kind === "aborted") return;
|
|
8388
8398
|
let a = i.message;
|
|
8389
|
-
i.ok ? (Ja(a, i.toastVariant || "success"), await
|
|
8399
|
+
i.ok ? (Ja(a, i.toastVariant || "success"), await k(w, "none")) : Ja(a || (i.kind === "forbidden" ? Wa.actionForbidden : Wa.actionFailed), "danger"), ee("wui:table:action", {
|
|
8390
8400
|
action: r,
|
|
8391
8401
|
key: n,
|
|
8392
8402
|
ok: i.ok,
|
|
@@ -8395,10 +8405,10 @@ function Za(e) {
|
|
|
8395
8405
|
};
|
|
8396
8406
|
return n.addEventListener("click", (e) => {
|
|
8397
8407
|
let t = e.target.closest("[data-wui-row-action]");
|
|
8398
|
-
!t || !h.contains(t) || t.disabled || (e.preventDefault(), !(t.dataset.confirm && !window.confirm(t.dataset.confirm)) &&
|
|
8399
|
-
}),
|
|
8408
|
+
!t || !h.contains(t) || t.disabled || (e.preventDefault(), !(t.dataset.confirm && !window.confirm(t.dataset.confirm)) && be(t));
|
|
8409
|
+
}), E(h), ie(h), u && Ba(n), re(h), pe(), {
|
|
8400
8410
|
el: e,
|
|
8401
|
-
reload: () =>
|
|
8411
|
+
reload: () => k(w, "none"),
|
|
8402
8412
|
query: () => new URLSearchParams(w),
|
|
8403
8413
|
setQuery: (e) => {
|
|
8404
8414
|
let t = new URLSearchParams(w);
|
|
@@ -8406,7 +8416,7 @@ function Za(e) {
|
|
|
8406
8416
|
t.delete(n);
|
|
8407
8417
|
for (let e of Array.isArray(r) ? r : [r]) e != null && e !== "" && t.append(n, String(e));
|
|
8408
8418
|
}
|
|
8409
|
-
return (!e || !("page" in e)) && t.delete("page"),
|
|
8419
|
+
return (!e || !("page" in e)) && t.delete("page"), k(t, "push");
|
|
8410
8420
|
},
|
|
8411
8421
|
selection: {
|
|
8412
8422
|
keys: () => [...d],
|
|
@@ -8414,7 +8424,7 @@ function Za(e) {
|
|
|
8414
8424
|
clear: () => {
|
|
8415
8425
|
d.clear();
|
|
8416
8426
|
for (let e of h.querySelectorAll(`:scope > tr > .${Q} .wui-check`)) e.checked = !1;
|
|
8417
|
-
|
|
8427
|
+
me();
|
|
8418
8428
|
}
|
|
8419
8429
|
}
|
|
8420
8430
|
};
|
|
@@ -8445,7 +8455,7 @@ var Qa = "wuiConfirm", $a = Object.freeze(["danger"]), eo = Object.freeze([
|
|
|
8445
8455
|
};
|
|
8446
8456
|
function uo() {
|
|
8447
8457
|
let e = document.getElementById(Qa);
|
|
8448
|
-
return e || (e = document.createElement("div"), e.id = Qa, e.className = "modal fade wui-modal-shell", e.tabIndex = -1, e.setAttribute("aria-hidden", "true"), e.setAttribute("role", "dialog"), e.setAttribute("aria-modal", "true"), e.style.setProperty("--wui-modal-max-width", `${
|
|
8458
|
+
return e || (e = document.createElement("div"), e.id = Qa, e.className = "modal fade wui-modal-shell", e.tabIndex = -1, e.setAttribute("aria-hidden", "true"), e.setAttribute("role", "dialog"), e.setAttribute("aria-modal", "true"), e.style.setProperty("--wui-modal-max-width", `${pe.md}px`), e.innerHTML = `<div class="modal-dialog modal-dialog-centered wui-rb-dialog"><div class="modal-content wui-modal wui-confirm"><div class="wui-modal-body"><div class="wui-confirm-content"><span class="wui-confirm-icon"><wui-status-icon tone="info" size="120"></wui-status-icon></span><h3 class="wui-confirm-title" tabindex="-1"></h3><p class="wui-confirm-msg"></p></div></div><div class="wui-modal-footer"><div class="wui-confirm-actions"><button type="button" class="btn btn-secondary" data-bs-dismiss="modal">${so(no.cancelLabel)}</button><button type="button" class="btn btn-primary" data-app-confirm></button></div></div></div></div>`, document.body.appendChild(e), e);
|
|
8449
8459
|
}
|
|
8450
8460
|
function fo(e, t) {
|
|
8451
8461
|
let n = e.getAttribute("data-wui-confirm-tone");
|
|
@@ -8500,7 +8510,7 @@ async function So(e) {
|
|
|
8500
8510
|
let n = e.getAttribute("data-wui-post-reload");
|
|
8501
8511
|
if (n !== null && n !== "page") throw TypeError(`data-wui-post-reload="${n}" is not supported. Use page, or leave it off to reload the server tables.`);
|
|
8502
8512
|
e.disabled = !0, e.setAttribute("aria-busy", "true");
|
|
8503
|
-
let r = await
|
|
8513
|
+
let r = await A(t, { method: "POST" });
|
|
8504
8514
|
if (r.kind === "session" || r.kind === "aborted") return;
|
|
8505
8515
|
let i = r.toastVariant || "success";
|
|
8506
8516
|
if (r.ok && (r.redirect || n === "page")) {
|
|
@@ -8550,7 +8560,7 @@ var jo = (e) => {
|
|
|
8550
8560
|
return n.className = e, n.textContent = t, n;
|
|
8551
8561
|
};
|
|
8552
8562
|
function No(e, t) {
|
|
8553
|
-
let n = e.querySelector(".wui-bell-trigger"), r = e.querySelector(".wui-bell-count"), i = e.querySelector("[data-wui-bell-live]"), a = e.querySelector("[data-wui-bell-list]"), o = e.querySelector(".wui-bell-menu"), { src: s, readAction: c } = e.dataset, l = e.dataset.label || "Notifications", u = e.dataset.emptyText || "You are all caught up.", d = Number(e.dataset.pollSeconds ?? 60), f =
|
|
8563
|
+
let n = e.querySelector(".wui-bell-trigger"), r = e.querySelector(".wui-bell-count"), i = e.querySelector("[data-wui-bell-live]"), a = e.querySelector("[data-wui-bell-list]"), o = e.querySelector(".wui-bell-menu"), { src: s, readAction: c } = e.dataset, l = e.dataset.label || "Notifications", u = e.dataset.emptyText || "You are all caught up.", d = Number(e.dataset.pollSeconds ?? 60), f = ue(), p = Number(e.dataset.unread) || 0, m = (t, a = !0) => {
|
|
8554
8564
|
let o = Math.max(0, Number(t) || 0), s = o !== p;
|
|
8555
8565
|
p = o, e.dataset.unread = String(o), r && (r.textContent = ko(o), r.hidden = o === 0), n?.setAttribute("aria-label", o === 0 ? l : `${l}, ${ko(o)} unread`), a && s && i && (i.textContent = o === 0 ? "No unread notifications" : `${ko(o)} unread notifications`);
|
|
8556
8566
|
}, h = () => o?.classList.contains("show") ?? !1, g = () => {
|
|
@@ -8578,7 +8588,7 @@ function No(e, t) {
|
|
|
8578
8588
|
let t = e.target.closest("[data-wui-bell-read]");
|
|
8579
8589
|
if (!t || !c) return;
|
|
8580
8590
|
t.disabled = !0;
|
|
8581
|
-
let n = await
|
|
8591
|
+
let n = await A(c, { method: "POST" });
|
|
8582
8592
|
t.disabled = !1, n.ok && (m(0), _(!0));
|
|
8583
8593
|
});
|
|
8584
8594
|
let v = null, y = () => {
|
|
@@ -8597,7 +8607,7 @@ function No(e, t) {
|
|
|
8597
8607
|
}
|
|
8598
8608
|
var Po = (e) => !!e && (e.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)), Fo = (e, t, n) => `${e}${e.includes("?") ? "&" : "?"}${encodeURIComponent(t)}=${encodeURIComponent(n)}`;
|
|
8599
8609
|
function Io(e, t) {
|
|
8600
|
-
let n = e.querySelector("input.search-input"), r = e.querySelector(".wui-topsearch-results"), i = e.querySelector(".wui-topsearch-open"), a = e.querySelector("[data-wui-topsearch-live]"), { src: o, param: s = "q", resultsHref: c } = e.dataset, l = Number(e.dataset.minChars ?? 2), u = Number(e.dataset.debounceMs ?? 250), d =
|
|
8610
|
+
let n = e.querySelector("input.search-input"), r = e.querySelector(".wui-topsearch-results"), i = e.querySelector(".wui-topsearch-open"), a = e.querySelector("[data-wui-topsearch-live]"), { src: o, param: s = "q", resultsHref: c } = e.dataset, l = Number(e.dataset.minChars ?? 2), u = Number(e.dataset.debounceMs ?? 250), d = ue(), f = null, p = -1, m = () => [...r.querySelectorAll(".wui-topsearch-hit")], h = (e) => {
|
|
8601
8611
|
let t = m();
|
|
8602
8612
|
p = t.length === 0 ? -1 : (e + t.length) % t.length, t.forEach((e, t) => {
|
|
8603
8613
|
let n = t === p;
|
|
@@ -8833,8 +8843,8 @@ var $ = (e, t) => {
|
|
|
8833
8843
|
typeof customElements < "u" && !customElements.get(e) && customElements.define(e, t);
|
|
8834
8844
|
};
|
|
8835
8845
|
function ps() {
|
|
8836
|
-
$("wui-select",
|
|
8846
|
+
$("wui-select", On), $("wui-country-select", Mn), $("wui-phone", Qr), $("wui-datepicker", zn), $("wui-date-range", Bn), $("wui-dock", Vn), $("wui-image-crop", hr), $("wui-kanban", Nt), $("wui-consent-banner", un), $("wui-slider", ei), $("wui-sortable", ui), $("wui-timepicker", bi), $("wui-tree", Oi), $("wui-autocomplete", Zt), $("wui-command-palette", nn), $("wui-context-menu", Tn), $("wui-multiselect", Sr), $("wui-taginput", pi), $("wui-otp", Pr), $("wui-status-icon", Lt), $("wui-wizard-step", Ni), $("wui-wizard", Ai);
|
|
8837
8847
|
}
|
|
8838
8848
|
ps();
|
|
8839
8849
|
//#endregion
|
|
8840
|
-
export { Qa as CONFIRM_DIALOG_ID, $a as CONFIRM_TONES,
|
|
8850
|
+
export { Qa as CONFIRM_DIALOG_ID, $a as CONFIRM_TONES, Pi as COPY_FEEDBACK_MS, ie as CSRF_META_NAME, n as CURRENCIES, a as DATE_PATTERNS, D as DEFAULT_CSRF_HEADER, Ii as DEFAULT_IMAGE_ACCEPT, Li as DEFAULT_MAX_SIZE_MB, Ea as DEFAULT_PASSWORD_RULES, Da as DEFAULT_REQUIREMENTS_TITLE, Ho as DEFAULT_THEME_EFFECT, Uo as DEFAULT_THEME_STORAGE_KEY, i as DURATION_UNITS, s as EMPTY_VALUE, to as FLASH_STORAGE_KEY, eo as FLASH_VARIANTS, t as FORMAT_STYLES, ae as HTTP_KINDS, o as IST_TIME_ZONE, lt as KANBAN_DRAG_THRESHOLD_PX, ct as KANBAN_LONG_PRESS_MS, st as KANBAN_PHONE_QUERY, ot as KANBAN_STORAGE_PREFIX, at as KANBAN_SUMMARY_FORMATS, M as KANBAN_TEXT, it as KANBAN_TONES, Xi as MASK_INPUT_TYPES, ia as MASK_NAMES, r as MONEY_UNITS, Ma as SELECT_ALL_LABEL, Q as SELECT_CELL_CLASS, Na as SELECT_ROW_LABEL, no as SERVER_ACTION_TEXT, It as STATUS_TONES, Ko as THEME_CHANGE_EVENT, Vo as THEME_EFFECTS, Wo as THEME_EFFECT_DURATION, qo as THEME_LIVE_NAME, Bo as THEME_MODES, Go as THEME_SWITCHING_CLASS, O as WUI_HEADERS, Zt as WuiAutocomplete, nn as WuiCommandPalette, un as WuiConsentBanner, Tn as WuiContextMenu, Mn as WuiCountrySelect, zn as WuiDatePicker, Bn as WuiDateRange, Vn as WuiDock, Nt as WuiKanban, Sr as WuiMultiSelect, Pr as WuiOtp, Qr as WuiPhone, On as WuiSelect, ei as WuiSlider, ui as WuiSortable, Lt as WuiStatusIcon, pi as WuiTagInput, bi as WuiTimePicker, Oi as WuiTree, Ai as WuiWizard, Ni as WuiWizardStep, Wi as acceptLabel, za as addRowSelectCells, Ba as addSelectColumn, es as applyTheme, va as attachInputMask, ka as buildPasswordRules, le as classifyStatus, Fi as copyTextToClipboard, ue as createRequestQueue, Fa as createSelectHeaderCell, Ia as createSelectRowCell, La as createSelectSpacerCell, ps as defineWeborityElements, Aa as evaluatePassword, w as formatCompact, S as formatCurrency, E as formatDate, te as formatDuration, da as formatMasked, x as formatNumber, ee as formatPercent, re as formatValue, Xa as getServerTable, zo as getShell, B as glyphSvg, Ta as initInputMasks, nt as initRemoteModals, Eo as initServerActions, Ya as initServerTables, Ro as initShellParts, Hi as isImageFile, Ui as isImageOnlyAccept, oa as isMaskPattern, P as kanbanCardLabel, Dt as kanbanStorageKey, At as kanbanSummaryFormat, rt as loadRemoteModal, ma as maskedPostValue, $t as matchSegments, Gi as matchesAccept, ts as nextTheme, ja as passwordSatisfies, ua as postedMasked, la as rawMasked, se as readCsrf, Ot as readKanbanCollapsed, Qo as readStoredTheme, ca as resolveMask, Zo as resolveTheme, $o as storeTheme, jt as sumKanbanValues, Va as syncSelectAll, ds as themeKeyframes, ne as toInstant, fs as transitionTheme, Ki as validateFile, ns as watchSystemTheme, kt as writeKanbanCollapsed, A as wuiFetch };
|