@uva-glass/component-library
Version:
React components UvA
1,735 lines (1,733 loc) • 67.5 kB
JavaScript
import { g as de, c as be } from "./_commonjsHelpers-DaMA6jEr.js";
import { l as pe } from "./index-D6WVIfcJ.js";
var Q, ve;
function Ot() {
return ve || (ve = 1, Q = (e) => {
const t = e.match(/^[ \t]*(?=\S)/gm);
return t ? t.reduce((n, r) => Math.min(n, r.length), 1 / 0) : 0;
}), Q;
}
var J, ye;
function It() {
if (ye) return J;
ye = 1;
const e = Ot();
return J = (t) => {
const n = e(t);
if (n === 0)
return t;
const r = new RegExp(`^[ \\t]{${n}}`, "gm");
return t.replace(r, "");
}, J;
}
var Z, Ee;
function Ht() {
return Ee || (Ee = 1, Z = (e, t = 1, n) => {
if (n = {
indent: " ",
includeEmptyLines: !1,
...n
}, typeof e != "string")
throw new TypeError(
`Expected \`input\` to be a \`string\`, got \`${typeof e}\``
);
if (typeof t != "number")
throw new TypeError(
`Expected \`count\` to be a \`number\`, got \`${typeof t}\``
);
if (typeof n.indent != "string")
throw new TypeError(
`Expected \`options.indent\` to be a \`string\`, got \`${typeof n.indent}\``
);
if (t === 0)
return e;
const r = n.includeEmptyLines ? /^/gm : /^(?!\s*$)/gm;
return e.replace(r, n.indent.repeat(t));
}), Z;
}
var ee, we;
function Tt() {
if (we) return ee;
we = 1;
const e = It(), t = Ht();
return ee = (n, r = 0, i) => t(e(n), r, i), ee;
}
var Dt = Tt();
const xe = /* @__PURE__ */ de(Dt);
class Bt extends Error {
reason;
filename;
line;
column;
source;
constructor(t, n, r, i, s) {
super(`${t}:${r}:${i}: ${n}`), this.reason = n, this.filename = t, this.line = r, this.column = i, this.source = s;
}
}
class Pt {
start;
end;
source;
constructor(t, n, r) {
this.start = t, this.end = n, this.source = r;
}
}
var N;
(function(e) {
e.stylesheet = "stylesheet", e.rule = "rule", e.declaration = "declaration", e.comment = "comment", e.container = "container", e.charset = "charset", e.document = "document", e.customMedia = "custom-media", e.fontFace = "font-face", e.host = "host", e.import = "import", e.keyframes = "keyframes", e.keyframe = "keyframe", e.layer = "layer", e.media = "media", e.namespace = "namespace", e.page = "page", e.startingStyle = "starting-style", e.supports = "supports";
})(N || (N = {}));
const Ne = (e, t, n) => {
let r = n, i = 1e4;
do {
const s = t.map((c) => e.indexOf(c, r));
s.push(e.indexOf("\\", r));
const o = s.filter((c) => c !== -1);
if (o.length === 0) return -1;
const f = Math.min(...o);
if (e[f] !== "\\") return f;
r = f + 2, i--;
} while (i > 0);
throw new Error("Too many escaping");
}, ne = (e, t, n) => {
let r = n, i = 1e4;
do {
const s = t.map((c) => e.indexOf(c, r));
s.push(e.indexOf("(", r)), s.push(e.indexOf('"', r)), s.push(e.indexOf("'", r)), s.push(e.indexOf("\\", r));
const o = s.filter((c) => c !== -1);
if (o.length === 0) return -1;
const f = Math.min(...o);
switch (e[f]) {
case "\\":
r = f + 2;
break;
case "(":
{
const c = ne(e, [")"], f + 1);
if (c === -1) return -1;
r = c + 1;
}
break;
case '"':
{
const c = Ne(e, ['"'], f + 1);
if (c === -1) return -1;
r = c + 1;
}
break;
case "'":
{
const c = Ne(e, ["'"], f + 1);
if (c === -1) return -1;
r = c + 1;
}
break;
default:
return f;
}
i--;
} while (i > 0);
throw new Error("Too many escaping");
}, te = /\/\*[^]*?(?:\*\/|$)/g;
function R(e) {
return e ? e.trim() : "";
}
function re(e, t) {
const n = e && typeof e.type == "string", r = n ? e : t;
for (const i in e) {
const s = e[i];
Array.isArray(s) ? s.forEach((o) => {
re(o, r);
}) : s && typeof s == "object" && re(s, r);
}
return n && Object.defineProperty(e, "parent", { configurable: !0, writable: !0, enumerable: !1, value: t || null }), e;
}
const kt = (e, t) => {
t = t || {};
let n = 1, r = 1;
function i() {
const l = { line: n, column: r };
return (u) => (u.position = new Pt(l, { line: n, column: r }, t?.source || ""), L(), u);
}
const s = [];
function o(l) {
const u = new Bt(t?.source || "", l, n, r, e);
if (!t?.silent) throw u;
s.push(u);
}
function f() {
const l = /^{\s*/.exec(e);
return !!l && (h(l), !0);
}
function c() {
const l = /^}/.exec(e);
return !!l && (h(l), !0);
}
function b() {
let l;
const u = [];
for (L(), y(u); e.length && e.charAt(0) !== "}" && (l = I() || D(), l); ) u.push(l), y(u);
return u;
}
function h(l) {
const u = l[0];
return (function(d) {
const p = d.match(/\n/g);
p && (n += p.length);
const g = d.lastIndexOf(`
`);
r = ~g ? d.length - g : r + d.length;
})(u), e = e.slice(u.length), l;
}
function L() {
const l = /^\s*/.exec(e);
l && h(l);
}
function y(l) {
l = l || [];
let u = H();
for (; u; ) l.push(u), u = H();
return l;
}
function H() {
const l = i();
if (e.charAt(0) !== "/" || e.charAt(1) !== "*") return;
const u = /^\/\*[^]*?\*\//.exec(e);
return u ? (h(u), l({ type: N.comment, comment: u[0].slice(2, -2) })) : o("End of comment missing");
}
function F() {
const l = /^([^{]+)/.exec(e);
if (l)
return h(l), ((u, d) => {
const p = [];
let g = 0;
for (; g < u.length; ) {
const x = ne(u, d, g);
if (x === -1) return p.push(u.substring(g)), p;
p.push(u.substring(g, x)), g = x + 1;
}
return p;
})(R(l[0]).replace(te, ""), [","]).map((u) => R(u));
}
function k() {
const l = i(), u = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/.exec(e);
if (!u) return;
h(u);
const d = R(u[0]), p = /^:\s*/.exec(e);
if (!p) return o("property missing ':'");
h(p);
let g = "";
const x = ne(e, [";", "}"]);
x !== -1 && (g = e.substring(0, x), h([g]), g = R(g).replace(te, ""));
const B = l({ type: N.declaration, property: d.replace(te, ""), value: g }), V = /^[;\s]*/.exec(e);
return V && h(V), B;
}
function O() {
const l = [];
if (!f()) return o("missing '{'");
y(l);
let u = k();
for (; u; ) l.push(u), y(l), u = k();
return c() ? l : o("missing '}'");
}
function a() {
const l = [], u = i();
let d = /^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);
for (; d; ) {
const p = h(d);
l.push(p[1]);
const g = /^,\s*/.exec(e);
g && h(g), d = /^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);
}
if (l.length) return u({ type: N.keyframe, values: l, declarations: O() || [] });
}
const w = $("import"), E = $("charset"), T = $("namespace");
function $(l) {
const u = new RegExp("^@" + l + `\\s*((?::?[^;'"]|"(?:\\\\"|[^"])*?"|'(?:\\\\'|[^'])*?')+)(?:;|$)`);
return () => {
const d = i(), p = u.exec(e);
if (!p) return;
const g = h(p), x = { type: l };
return x[l] = g[1].trim(), d(x);
};
}
function I() {
if (e[0] === "@") return (function() {
const l = i(), u = /^@([-\w]+)?keyframes\s*/.exec(e);
if (!u) return;
const d = h(u)[1], p = /^([-\w]+)\s*/.exec(e);
if (!p) return o("@keyframes missing name");
const g = h(p)[1];
if (!f()) return o("@keyframes missing '{'");
let x = y(), B = a();
for (; B; ) x.push(B), x = x.concat(y()), B = a();
return c() ? l({ type: N.keyframes, name: g, vendor: d, keyframes: x }) : o("@keyframes missing '}'");
})() || (function() {
const l = i(), u = /^@media *([^{]+)/.exec(e);
if (!u) return;
const d = R(h(u)[1]);
if (!f()) return o("@media missing '{'");
const p = y().concat(b());
return c() ? l({ type: N.media, media: d, rules: p }) : o("@media missing '}'");
})() || (function() {
const l = i(), u = /^@custom-media\s+(--\S+)\s+([^{;\s][^{;]*);/.exec(e);
if (!u) return;
const d = h(u);
return l({ type: N.customMedia, name: R(d[1]), media: R(d[2]) });
})() || (function() {
const l = i(), u = /^@supports *([^{]+)/.exec(e);
if (!u) return;
const d = R(h(u)[1]);
if (!f()) return o("@supports missing '{'");
const p = y().concat(b());
return c() ? l({ type: N.supports, supports: d, rules: p }) : o("@supports missing '}'");
})() || w() || E() || T() || (function() {
const l = i(), u = /^@([-\w]+)?document *([^{]+)/.exec(e);
if (!u) return;
const d = h(u), p = R(d[1]), g = R(d[2]);
if (!f()) return o("@document missing '{'");
const x = y().concat(b());
return c() ? l({ type: N.document, document: g, vendor: p, rules: x }) : o("@document missing '}'");
})() || (function() {
const l = i(), u = /^@page */.exec(e);
if (!u) return;
h(u);
const d = F() || [];
if (!f()) return o("@page missing '{'");
let p = y(), g = k();
for (; g; ) p.push(g), p = p.concat(y()), g = k();
return c() ? l({ type: N.page, selectors: d, declarations: p }) : o("@page missing '}'");
})() || (function() {
const l = i(), u = /^@host\s*/.exec(e);
if (!u) return;
if (h(u), !f()) return o("@host missing '{'");
const d = y().concat(b());
return c() ? l({ type: N.host, rules: d }) : o("@host missing '}'");
})() || (function() {
const l = i(), u = /^@font-face\s*/.exec(e);
if (!u) return;
if (h(u), !f()) return o("@font-face missing '{'");
let d = y(), p = k();
for (; p; ) d.push(p), d = d.concat(y()), p = k();
return c() ? l({ type: N.fontFace, declarations: d }) : o("@font-face missing '}'");
})() || (function() {
const l = i(), u = /^@container *([^{]+)/.exec(e);
if (!u) return;
const d = R(h(u)[1]);
if (!f()) return o("@container missing '{'");
const p = y().concat(b());
return c() ? l({ type: N.container, container: d, rules: p }) : o("@container missing '}'");
})() || (function() {
const l = i(), u = /^@starting-style\s*/.exec(e);
if (!u) return;
if (h(u), !f()) return o("@starting-style missing '{'");
const d = y().concat(b());
return c() ? l({ type: N.startingStyle, rules: d }) : o("@starting-style missing '}'");
})() || (function() {
const l = i(), u = /^@layer *([^{;@]+)/.exec(e);
if (!u) return;
const d = R(h(u)[1]);
if (!f()) {
const g = /^[;\s]*/.exec(e);
return g && h(g), l({ type: N.layer, layer: d });
}
const p = y().concat(b());
return c() ? l({ type: N.layer, layer: d, rules: p }) : o("@layer missing '}'");
})();
}
function D() {
const l = i(), u = F();
return u ? (y(), l({ type: N.rule, selectors: u, declarations: O() || [] })) : o("selector missing");
}
return re((function() {
const l = b();
return { type: N.stylesheet, stylesheet: { source: t?.source, rules: l, parsingErrors: s } };
})());
};
var Mt = Object.prototype.toString;
function Lt(e) {
return typeof e == "function" || Mt.call(e) === "[object Function]";
}
function Vt(e) {
var t = Number(e);
return isNaN(t) ? 0 : t === 0 || !isFinite(t) ? t : (t > 0 ? 1 : -1) * Math.floor(Math.abs(t));
}
var jt = Math.pow(2, 53) - 1;
function _t(e) {
var t = Vt(e);
return Math.min(Math.max(t, 0), jt);
}
function C(e, t) {
var n = Array, r = Object(e);
if (e == null)
throw new TypeError("Array.from requires an array-like object - not null or undefined");
for (var i = _t(r.length), s = Lt(n) ? Object(new n(i)) : new Array(i), o = 0, f; o < i; )
f = r[o], s[o] = f, o += 1;
return s.length = i, s;
}
function _(e) {
"@babel/helpers - typeof";
return _ = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
return typeof t;
} : function(t) {
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
}, _(e);
}
function qt(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function");
}
function Ft(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, Le(r.key), r);
}
}
function Ut(e, t, n) {
return t && Ft(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function Gt(e, t, n) {
return t = Le(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function Le(e) {
var t = zt(e, "string");
return _(t) === "symbol" ? t : String(t);
}
function zt(e, t) {
if (_(e) !== "object" || e === null) return e;
var n = e[Symbol.toPrimitive];
if (n !== void 0) {
var r = n.call(e, t);
if (_(r) !== "object") return r;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (t === "string" ? String : Number)(e);
}
var Wt = /* @__PURE__ */ (function() {
function e() {
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
qt(this, e), Gt(this, "items", void 0), this.items = t;
}
return Ut(e, [{
key: "add",
value: function(n) {
return this.has(n) === !1 && this.items.push(n), this;
}
}, {
key: "clear",
value: function() {
this.items = [];
}
}, {
key: "delete",
value: function(n) {
var r = this.items.length;
return this.items = this.items.filter(function(i) {
return i !== n;
}), r !== this.items.length;
}
}, {
key: "forEach",
value: function(n) {
var r = this;
this.items.forEach(function(i) {
n(i, i, r);
});
}
}, {
key: "has",
value: function(n) {
return this.items.indexOf(n) !== -1;
}
}, {
key: "size",
get: function() {
return this.items.length;
}
}]), e;
})();
const Yt = typeof Set > "u" ? Set : Wt;
function A(e) {
var t;
return (
// eslint-disable-next-line no-restricted-properties -- actual guard for environments without localName
(t = e.localName) !== null && t !== void 0 ? t : (
// eslint-disable-next-line no-restricted-properties -- required for the fallback
e.tagName.toLowerCase()
)
);
}
var Kt = {
article: "article",
aside: "complementary",
button: "button",
datalist: "listbox",
dd: "definition",
details: "group",
dialog: "dialog",
dt: "term",
fieldset: "group",
figure: "figure",
// WARNING: Only with an accessible name
form: "form",
footer: "contentinfo",
h1: "heading",
h2: "heading",
h3: "heading",
h4: "heading",
h5: "heading",
h6: "heading",
header: "banner",
hr: "separator",
html: "document",
legend: "legend",
li: "listitem",
math: "math",
main: "main",
menu: "list",
nav: "navigation",
ol: "list",
optgroup: "group",
// WARNING: Only in certain context
option: "option",
output: "status",
progress: "progressbar",
// WARNING: Only with an accessible name
section: "region",
summary: "button",
table: "table",
tbody: "rowgroup",
textarea: "textbox",
tfoot: "rowgroup",
// WARNING: Only in certain context
td: "cell",
th: "columnheader",
thead: "rowgroup",
tr: "row",
ul: "list"
}, Xt = {
caption: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
code: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
deletion: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
emphasis: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
generic: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby", "aria-roledescription"]),
insertion: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
none: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
paragraph: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
presentation: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
strong: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
subscript: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
superscript: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"])
};
function Qt(e, t) {
return [
"aria-atomic",
"aria-busy",
"aria-controls",
"aria-current",
"aria-description",
"aria-describedby",
"aria-details",
// "disabled",
"aria-dropeffect",
// "errormessage",
"aria-flowto",
"aria-grabbed",
// "haspopup",
"aria-hidden",
// "invalid",
"aria-keyshortcuts",
"aria-label",
"aria-labelledby",
"aria-live",
"aria-owns",
"aria-relevant",
"aria-roledescription"
].some(function(n) {
var r;
return e.hasAttribute(n) && !((r = Xt[t]) !== null && r !== void 0 && r.has(n));
});
}
function Ve(e, t) {
return Qt(e, t);
}
function Jt(e) {
var t = en(e);
if (t === null || ie.indexOf(t) !== -1) {
var n = Zt(e);
if (ie.indexOf(t || "") === -1 || Ve(e, n || ""))
return n;
}
return t;
}
function Zt(e) {
var t = Kt[A(e)];
if (t !== void 0)
return t;
switch (A(e)) {
case "a":
case "area":
case "link":
if (e.hasAttribute("href"))
return "link";
break;
case "img":
return e.getAttribute("alt") === "" && !Ve(e, "img") ? "presentation" : "img";
case "input": {
var n = e, r = n.type;
switch (r) {
case "button":
case "image":
case "reset":
case "submit":
return "button";
case "checkbox":
case "radio":
return r;
case "range":
return "slider";
case "email":
case "tel":
case "text":
case "url":
return e.hasAttribute("list") ? "combobox" : "textbox";
case "search":
return e.hasAttribute("list") ? "combobox" : "searchbox";
case "number":
return "spinbutton";
default:
return null;
}
}
case "select":
return e.hasAttribute("multiple") || e.size > 1 ? "listbox" : "combobox";
}
return null;
}
function en(e) {
var t = e.getAttribute("role");
if (t !== null) {
var n = t.trim().split(" ")[0];
if (n.length > 0)
return n;
}
return null;
}
var ie = ["presentation", "none"];
function v(e) {
return e !== null && e.nodeType === e.ELEMENT_NODE;
}
function je(e) {
return v(e) && A(e) === "caption";
}
function G(e) {
return v(e) && A(e) === "input";
}
function tn(e) {
return v(e) && A(e) === "optgroup";
}
function nn(e) {
return v(e) && A(e) === "select";
}
function rn(e) {
return v(e) && A(e) === "table";
}
function sn(e) {
return v(e) && A(e) === "textarea";
}
function on(e) {
var t = e.ownerDocument === null ? e : e.ownerDocument, n = t.defaultView;
if (n === null)
throw new TypeError("no window available");
return n;
}
function an(e) {
return v(e) && A(e) === "fieldset";
}
function un(e) {
return v(e) && A(e) === "legend";
}
function cn(e) {
return v(e) && A(e) === "slot";
}
function ln(e) {
return v(e) && e.ownerSVGElement !== void 0;
}
function fn(e) {
return v(e) && A(e) === "svg";
}
function dn(e) {
return ln(e) && A(e) === "title";
}
function W(e, t) {
if (v(e) && e.hasAttribute(t)) {
var n = e.getAttribute(t).split(" "), r = e.getRootNode ? e.getRootNode() : e.ownerDocument;
return n.map(function(i) {
return r.getElementById(i);
}).filter(
function(i) {
return i !== null;
}
// TODO: why does this not narrow?
);
}
return [];
}
function P(e, t) {
return v(e) ? t.indexOf(Jt(e)) !== -1 : !1;
}
function pn(e) {
return e.trim().replace(/\s\s+/g, " ");
}
function hn(e, t) {
if (!v(e))
return !1;
if (e.hasAttribute("hidden") || e.getAttribute("aria-hidden") === "true")
return !0;
var n = t(e);
return n.getPropertyValue("display") === "none" || n.getPropertyValue("visibility") === "hidden";
}
function gn(e) {
return P(e, ["button", "combobox", "listbox", "textbox"]) || _e(e, "range");
}
function _e(e, t) {
if (!v(e))
return !1;
switch (t) {
case "range":
return P(e, ["meter", "progressbar", "scrollbar", "slider", "spinbutton"]);
default:
throw new TypeError("No knowledge about abstract role '".concat(t, "'. This is likely a bug :("));
}
}
function Se(e, t) {
var n = C(e.querySelectorAll(t));
return W(e, "aria-owns").forEach(function(r) {
n.push.apply(n, C(r.querySelectorAll(t)));
}), n;
}
function mn(e) {
return nn(e) ? e.selectedOptions || Se(e, "[selected]") : Se(e, '[aria-selected="true"]');
}
function bn(e) {
return P(e, ie);
}
function vn(e) {
return je(e);
}
function yn(e) {
return P(e, ["button", "cell", "checkbox", "columnheader", "gridcell", "heading", "label", "legend", "link", "menuitem", "menuitemcheckbox", "menuitemradio", "option", "radio", "row", "rowheader", "switch", "tab", "tooltip", "treeitem"]);
}
function En(e) {
return !1;
}
function wn(e) {
return G(e) || sn(e) ? e.value : e.textContent || "";
}
function Ae(e) {
var t = e.getPropertyValue("content");
return /^["'].*["']$/.test(t) ? t.slice(1, -1) : "";
}
function qe(e) {
var t = A(e);
return t === "button" || t === "input" && e.getAttribute("type") !== "hidden" || t === "meter" || t === "output" || t === "progress" || t === "select" || t === "textarea";
}
function Fe(e) {
if (qe(e))
return e;
var t = null;
return e.childNodes.forEach(function(n) {
if (t === null && v(n)) {
var r = Fe(n);
r !== null && (t = r);
}
}), t;
}
function xn(e) {
if (e.control !== void 0)
return e.control;
var t = e.getAttribute("for");
return t !== null ? e.ownerDocument.getElementById(t) : Fe(e);
}
function Nn(e) {
var t = e.labels;
if (t === null)
return t;
if (t !== void 0)
return C(t);
if (!qe(e))
return null;
var n = e.ownerDocument;
return C(n.querySelectorAll("label")).filter(function(r) {
return xn(r) === e;
});
}
function Sn(e) {
var t = e.assignedNodes();
return t.length === 0 ? C(e.childNodes) : t;
}
function Ue(e) {
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = new Yt(), r = on(e), i = t.compute, s = i === void 0 ? "name" : i, o = t.computedStyleSupportsPseudoElements, f = o === void 0 ? t.getComputedStyle !== void 0 : o, c = t.getComputedStyle, b = c === void 0 ? r.getComputedStyle.bind(r) : c, h = t.hidden, L = h === void 0 ? !1 : h;
function y(a, w) {
var E = "";
if (v(a) && f) {
var T = b(a, "::before"), $ = Ae(T);
E = "".concat($, " ").concat(E);
}
var I = cn(a) ? Sn(a) : C(a.childNodes).concat(W(a, "aria-owns"));
if (I.forEach(function(u) {
var d = O(u, {
isEmbeddedInLabel: w.isEmbeddedInLabel,
isReferenced: !1,
recursion: !0
}), p = v(u) ? b(u).getPropertyValue("display") : "inline", g = p !== "inline" ? " " : "";
E += "".concat(g).concat(d).concat(g);
}), v(a) && f) {
var D = b(a, "::after"), l = Ae(D);
E = "".concat(E, " ").concat(l);
}
return E.trim();
}
function H(a, w) {
var E = a.getAttributeNode(w);
return E !== null && !n.has(E) && E.value.trim() !== "" ? (n.add(E), E.value) : null;
}
function F(a) {
return v(a) ? H(a, "title") : null;
}
function k(a) {
if (!v(a))
return null;
if (an(a)) {
n.add(a);
for (var w = C(a.childNodes), E = 0; E < w.length; E += 1) {
var T = w[E];
if (un(T))
return O(T, {
isEmbeddedInLabel: !1,
isReferenced: !1,
recursion: !1
});
}
} else if (rn(a)) {
n.add(a);
for (var $ = C(a.childNodes), I = 0; I < $.length; I += 1) {
var D = $[I];
if (je(D))
return O(D, {
isEmbeddedInLabel: !1,
isReferenced: !1,
recursion: !1
});
}
} else if (fn(a)) {
n.add(a);
for (var l = C(a.childNodes), u = 0; u < l.length; u += 1) {
var d = l[u];
if (dn(d))
return d.textContent;
}
return null;
} else if (A(a) === "img" || A(a) === "area") {
var p = H(a, "alt");
if (p !== null)
return p;
} else if (tn(a)) {
var g = H(a, "label");
if (g !== null)
return g;
}
if (G(a) && (a.type === "button" || a.type === "submit" || a.type === "reset")) {
var x = H(a, "value");
if (x !== null)
return x;
if (a.type === "submit")
return "Submit";
if (a.type === "reset")
return "Reset";
}
var B = Nn(a);
if (B !== null && B.length !== 0)
return n.add(a), C(B).map(function(X) {
return O(X, {
isEmbeddedInLabel: !0,
isReferenced: !1,
recursion: !0
});
}).filter(function(X) {
return X.length > 0;
}).join(" ");
if (G(a) && a.type === "image") {
var V = H(a, "alt");
if (V !== null)
return V;
var ge = H(a, "title");
return ge !== null ? ge : "Submit Query";
}
if (P(a, ["button"])) {
var me = y(a, {
isEmbeddedInLabel: !1
});
if (me !== "")
return me;
}
return null;
}
function O(a, w) {
if (n.has(a))
return "";
if (!L && hn(a, b) && !w.isReferenced)
return n.add(a), "";
var E = v(a) ? a.getAttributeNode("aria-labelledby") : null, T = E !== null && !n.has(E) ? W(a, "aria-labelledby") : [];
if (s === "name" && !w.isReferenced && T.length > 0)
return n.add(E), T.map(function(p) {
return O(p, {
isEmbeddedInLabel: w.isEmbeddedInLabel,
isReferenced: !0,
// this isn't recursion as specified, otherwise we would skip
// `aria-label` in
// <input id="myself" aria-label="foo" aria-labelledby="myself"
recursion: !1
});
}).join(" ");
var $ = w.recursion && gn(a) && s === "name";
if (!$) {
var I = (v(a) && a.getAttribute("aria-label") || "").trim();
if (I !== "" && s === "name")
return n.add(a), I;
if (!bn(a)) {
var D = k(a);
if (D !== null)
return n.add(a), D;
}
}
if (P(a, ["menu"]))
return n.add(a), "";
if ($ || w.isEmbeddedInLabel || w.isReferenced) {
if (P(a, ["combobox", "listbox"])) {
n.add(a);
var l = mn(a);
return l.length === 0 ? G(a) ? a.value : "" : C(l).map(function(p) {
return O(p, {
isEmbeddedInLabel: w.isEmbeddedInLabel,
isReferenced: !1,
recursion: !0
});
}).join(" ");
}
if (_e(a, "range"))
return n.add(a), a.hasAttribute("aria-valuetext") ? a.getAttribute("aria-valuetext") : a.hasAttribute("aria-valuenow") ? a.getAttribute("aria-valuenow") : a.getAttribute("value") || "";
if (P(a, ["textbox"]))
return n.add(a), wn(a);
}
if (yn(a) || v(a) && w.isReferenced || vn(a) || En()) {
var u = y(a, {
isEmbeddedInLabel: w.isEmbeddedInLabel
});
if (u !== "")
return n.add(a), u;
}
if (a.nodeType === a.TEXT_NODE)
return n.add(a), a.textContent || "";
if (w.recursion)
return n.add(a), y(a, {
isEmbeddedInLabel: w.isEmbeddedInLabel
});
var d = F(a);
return d !== null ? (n.add(a), d) : (n.add(a), "");
}
return pn(O(e, {
isEmbeddedInLabel: !1,
// by spec computeAccessibleDescription starts with the referenced elements as roots
isReferenced: s === "description",
recursion: !1
}));
}
function q(e) {
"@babel/helpers - typeof";
return q = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
return typeof t;
} : function(t) {
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
}, q(e);
}
function Re(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e);
t && (r = r.filter(function(i) {
return Object.getOwnPropertyDescriptor(e, i).enumerable;
})), n.push.apply(n, r);
}
return n;
}
function $e(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t] != null ? arguments[t] : {};
t % 2 ? Re(Object(n), !0).forEach(function(r) {
An(e, r, n[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Re(Object(n)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
});
}
return e;
}
function An(e, t, n) {
return t = Rn(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function Rn(e) {
var t = $n(e, "string");
return q(t) === "symbol" ? t : String(t);
}
function $n(e, t) {
if (q(e) !== "object" || e === null) return e;
var n = e[Symbol.toPrimitive];
if (n !== void 0) {
var r = n.call(e, t);
if (q(r) !== "object") return r;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (t === "string" ? String : Number)(e);
}
function Cn(e) {
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = W(e, "aria-describedby").map(function(s) {
return Ue(s, $e($e({}, t), {}, {
compute: "description"
}));
}).join(" ");
if (n === "") {
var r = e.getAttribute("aria-description");
n = r === null ? "" : r;
}
if (n === "") {
var i = e.getAttribute("title");
n = i === null ? "" : i;
}
return n;
}
function On(e) {
return P(e, ["caption", "code", "deletion", "emphasis", "generic", "insertion", "none", "paragraph", "presentation", "strong", "subscript", "superscript"]);
}
function In(e) {
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
return On(e) ? "" : Ue(e, t);
}
var U = { exports: {} }, Ce;
function Hn() {
if (Ce) return U.exports;
Ce = 1;
var e = String, t = function() {
return { isColorSupported: !1, reset: e, bold: e, dim: e, italic: e, underline: e, inverse: e, hidden: e, strikethrough: e, black: e, red: e, green: e, yellow: e, blue: e, magenta: e, cyan: e, white: e, gray: e, bgBlack: e, bgRed: e, bgGreen: e, bgYellow: e, bgBlue: e, bgMagenta: e, bgCyan: e, bgWhite: e, blackBright: e, redBright: e, greenBright: e, yellowBright: e, blueBright: e, magentaBright: e, cyanBright: e, whiteBright: e, bgBlackBright: e, bgRedBright: e, bgGreenBright: e, bgYellowBright: e, bgBlueBright: e, bgMagentaBright: e, bgCyanBright: e, bgWhiteBright: e };
};
return U.exports = t(), U.exports.createColors = t, U.exports;
}
var Tn = /* @__PURE__ */ Hn();
const Dn = /* @__PURE__ */ de(Tn);
var z = { exports: {} };
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
var Bn = z.exports, Oe;
function Pn() {
return Oe || (Oe = 1, (function(e, t) {
(function(n, r) {
e.exports = r(n);
})(typeof be < "u" ? be : Bn, function(n) {
if (n.CSS && n.CSS.escape)
return n.CSS.escape;
var r = function(i) {
if (arguments.length == 0)
throw new TypeError("`CSS.escape` requires an argument.");
for (var s = String(i), o = s.length, f = -1, c, b = "", h = s.charCodeAt(0); ++f < o; ) {
if (c = s.charCodeAt(f), c == 0) {
b += "�";
continue;
}
if (
// If the character is in the range [\1-\1F] (U+0001 to U+001F) or is
// U+007F, […]
c >= 1 && c <= 31 || c == 127 || // If the character is the first character and is in the range [0-9]
// (U+0030 to U+0039), […]
f == 0 && c >= 48 && c <= 57 || // If the character is the second character and is in the range [0-9]
// (U+0030 to U+0039) and the first character is a `-` (U+002D), […]
f == 1 && c >= 48 && c <= 57 && h == 45
) {
b += "\\" + c.toString(16) + " ";
continue;
}
if (
// If the character is the first character and is a `-` (U+002D), and
// there is no second character, […]
f == 0 && o == 1 && c == 45
) {
b += "\\" + s.charAt(f);
continue;
}
if (c >= 128 || c == 45 || c == 95 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122) {
b += s.charAt(f);
continue;
}
b += "\\" + s.charAt(f);
}
return b;
};
return n.CSS || (n.CSS = {}), n.CSS.escape = r, r;
});
})(z)), z.exports;
}
var kn = Pn();
const Mn = /* @__PURE__ */ de(kn);
class Ge extends Error {
constructor(t, n, r, i) {
super(), Error.captureStackTrace && Error.captureStackTrace(this, r);
let s = "";
try {
s = i.utils.printWithType(
"Received",
n,
i.utils.printReceived
);
} catch {
}
this.message = [
i.utils.matcherHint(
`${i.isNot ? ".not" : ""}.${r.name}`,
"received",
""
),
"",
// eslint-disable-next-line new-cap
`${i.utils.RECEIVED_COLOR(
"received"
)} value must ${t}.`,
s
].join(`
`);
}
}
class Ie extends Ge {
constructor(...t) {
super("be an HTMLElement or an SVGElement", ...t);
}
}
class He extends Ge {
constructor(...t) {
super("be a Node", ...t);
}
}
function ze(e, t, ...n) {
if (!e || !e.ownerDocument || !e.ownerDocument.defaultView)
throw new t(e, ...n);
}
function Ln(e, ...t) {
ze(e, He, ...t);
const n = e.ownerDocument.defaultView;
if (!(e instanceof n.Node))
throw new He(e, ...t);
}
function m(e, ...t) {
ze(e, Ie, ...t);
const n = e.ownerDocument.defaultView;
if (!(e instanceof n.HTMLElement) && !(e instanceof n.SVGElement))
throw new Ie(e, ...t);
}
class Vn extends Error {
constructor(t, n, r) {
super(), Error.captureStackTrace && Error.captureStackTrace(this, n), this.message = [
t.message,
"",
// eslint-disable-next-line new-cap
r.utils.RECEIVED_COLOR("Failing css:"),
// eslint-disable-next-line new-cap
r.utils.RECEIVED_COLOR(`${t.css}`)
].join(`
`);
}
}
function jn(e, ...t) {
const n = kt(`selector { ${e} }`, { silent: !0 }).stylesheet;
if (n.parsingErrors && n.parsingErrors.length > 0) {
const { reason: i, line: s } = n.parsingErrors[0];
throw new Vn(
{
css: e,
message: `Syntax error parsing expected css: ${i} on line: ${s}`
},
...t
);
}
return n.rules[0].declarations.filter((i) => i.type === "declaration").reduce(
(i, { property: s, value: o }) => Object.assign(i, { [s]: o }),
{}
);
}
function Te(e, t) {
return typeof t == "string" ? t : e.utils.stringify(t);
}
function S(e, t, n, r, i, s) {
return [
`${t}
`,
// eslint-disable-next-line new-cap
`${n}:
${e.utils.EXPECTED_COLOR(
xe(Te(e, r), 2)
)}`,
// eslint-disable-next-line new-cap
`${i}:
${e.utils.RECEIVED_COLOR(
xe(Te(e, s), 2)
)}`
].join(`
`);
}
function _n(e, t) {
return t instanceof RegExp ? t.test(e) : e.includes(String(t));
}
function Y(e, t) {
console.warn(
`Warning: ${e} has been deprecated and will be removed in future updates.`,
t
);
}
function K(e) {
return e.replace(/\s+/g, " ").trim();
}
function M(e) {
return e.tagName && e.tagName.toLowerCase();
}
function qn({ multiple: e, options: t }) {
const n = [...t].filter((r) => r.selected);
if (e)
return [...n].map((r) => r.value);
if (n.length !== 0)
return n[0].value;
}
function Fn(e) {
switch (e.type) {
case "number":
return e.value === "" ? null : Number(e.value);
case "checkbox":
return e.checked;
default:
return e.value;
}
}
const Un = ["meter", "progressbar", "slider", "spinbutton"];
function Gn(e) {
if (Un.includes(e.getAttribute("role")))
return Number(e.getAttribute("aria-valuenow"));
}
function We(e) {
if (e)
switch (e.tagName.toLowerCase()) {
case "input":
return Fn(e);
case "select":
return qn(e);
default:
return e.value ?? Gn(e);
}
}
function zn(e, { wordConnector: t = ", ", lastWordConnector: n = " and " } = {}) {
return [e.slice(0, -1).join(t), e[e.length - 1]].join(
e.length > 1 ? n : ""
);
}
function he(e, t) {
return Array.isArray(e) && Array.isArray(t) ? [...new Set(e)].every((n) => new Set(t).has(n)) : e === t;
}
function se(e, t) {
return Y(
"toBeInTheDOM",
"Please use toBeInTheDocument for searching the entire document and toContainElement for searching a specific container."
), e && m(e, se, this), t && m(t, se, this), {
pass: t ? t.contains(e) : !!e,
message: () => [
this.utils.matcherHint(
`${this.isNot ? ".not" : ""}.toBeInTheDOM`,
"element",
""
),
"",
"Received:",
` ${this.utils.printReceived(
e && e.cloneNode(!1)
)}`
].join(`
`)
};
}
function Ye(e) {
(e !== null || !this.isNot) && m(e, Ye, this);
const t = e === null ? !1 : e.ownerDocument === e.getRootNode({ composed: !0 }), n = () => `expected document not to contain element, found ${this.utils.stringify(
e.cloneNode(!0)
)} instead`, r = () => "element could not be found in the document";
return {
pass: t,
message: () => [
this.utils.matcherHint(
`${this.isNot ? ".not" : ""}.toBeInTheDocument`,
"element",
""
),
"",
// eslint-disable-next-line new-cap
this.utils.RECEIVED_COLOR(this.isNot ? n() : r())
].join(`
`)
};
}
function Ke(e) {
return Y(
"toBeEmpty",
"Please use instead toBeEmptyDOMElement for finding empty nodes in the DOM."
), m(e, Ke, this), {
pass: e.innerHTML === "",
message: () => [
this.utils.matcherHint(
`${this.isNot ? ".not" : ""}.toBeEmpty`,
"element",
""
),
"",
"Received:",
` ${this.utils.printReceived(e.innerHTML)}`
].join(`
`)
};
}
function Xe(e) {
return m(e, Xe, this), {
pass: Wn(e),
message: () => [
this.utils.matcherHint(
`${this.isNot ? ".not" : ""}.toBeEmptyDOMElement`,
"element",
""
),
"",
"Received:",
` ${this.utils.printReceived(e.innerHTML)}`
].join(`
`)
};
}
function Wn(e) {
return [...e.childNodes].filter((n) => n.nodeType !== 8).length === 0;
}
function oe(e, t) {
return m(e, oe, this), t !== null && m(t, oe, this), {
pass: e.contains(t),
message: () => [
this.utils.matcherHint(
`${this.isNot ? ".not" : ""}.toContainElement`,
"element",
"element"
),
"",
// eslint-disable-next-line new-cap
this.utils.RECEIVED_COLOR(`${this.utils.stringify(
e.cloneNode(!1)
)} ${this.isNot ? "contains:" : "does not contain:"} ${this.utils.stringify(t && t.cloneNode(!1))}
`)
].join(`
`)
};
}
function Yn(e, t) {
const n = e.ownerDocument.createElement("div");
return n.innerHTML = t, n.innerHTML;
}
function Qe(e, t) {
if (m(e, Qe, this), typeof t != "string")
throw new Error(`.toContainHTML() expects a string value, got ${t}`);
return {
pass: e.outerHTML.includes(Yn(e, t)),
message: () => [
this.utils.matcherHint(
`${this.isNot ? ".not" : ""}.toContainHTML`,
"element",
""
),
"Expected:",
// eslint-disable-next-line new-cap
` ${this.utils.EXPECTED_COLOR(t)}`,
"Received:",
` ${this.utils.printReceived(e.cloneNode(!0))}`
].join(`
`)
};
}
function Je(e, t, n = { normalizeWhitespace: !0 }) {
Ln(e, Je, this);
const r = n.normalizeWhitespace ? K(e.textContent) : e.textContent.replace(/\u00a0/g, " "), i = r !== "" && t === "";
return {
pass: !i && _n(r, t),
message: () => {
const s = this.isNot ? "not to" : "to";
return S(
this,
this.utils.matcherHint(
`${this.isNot ? ".not" : ""}.toHaveTextContent`,
"element",
""
),
i ? "Checking with empty string will always match, use .toBeEmptyDOMElement() instead" : `Expected element ${s} have text content`,
t,
"Received",
r
);
}
};
}
function ae(e, t) {
m(e, ae, this);
const n = Cn(e), r = arguments.length === 1;
let i = !1;
return r ? i = n !== "" : i = t instanceof RegExp ? t.test(n) : this.equals(
n,
t
), {
pass: i,
message: () => {
const s = this.isNot ? "not to" : "to";
return S(
this,
this.utils.matcherHint(
`${this.isNot ? ".not" : ""}.${ae.name}`,
"element",
""
),
`Expected element ${s} have accessible description`,
t,
"Received",
n
);
}
};
}
const j = "aria-invalid", Kn = ["false"];
function Ze(e, t) {
m(e, Ze, this);
const n = this.isNot ? "not to" : "to", r = this.isNot ? ".not.toHaveAccessibleErrorMessage" : ".toHaveAccessibleErrorMessage", i = e.getAttribute("aria-errormessage");
if (!!i && /\s+/.test(i))
return {
pass: !1,
message: () => S(
this,
this.utils.matcherHint(r, "element"),
"Expected element's `aria-errormessage` attribute to be empty or a single, valid ID",
"",
"Received",
`aria-errormessage="${i}"`
)
};
const o = e.getAttribute(j);
if (!e.hasAttribute(j) || Kn.includes(o))
return {
pass: !1,
message: () => S(
this,
this.utils.matcherHint(r, "element"),
"Expected element to be marked as invalid with attribute",
`${j}="${String(!0)}"`,
"Received",
e.hasAttribute("aria-invalid") ? `${j}="${e.getAttribute(j)}` : null
)
};
const c = K(
e.ownerDocument.getElementById(i)?.textContent ?? ""
);
return {
pass: t === void 0 ? !!c : t instanceof RegExp ? t.test(c) : this.equals(c, t),
message: () => S(
this,
this.utils.matcherHint(r, "element"),
`Expected element ${n} have accessible error message`,
t ?? "",
"Received",
c
)
};
}
const Xn = Zn(pe.elementRoles);
function ue(e, t) {
m(e, ue, this);
const n = Qn(e);
return {
pass: n.some((i) => i === t),
message: () => {
const i = this.isNot ? "not to" : "to";
return S(
this,
this.utils.matcherHint(
`${this.isNot ? ".not" : ""}.${ue.name}`,
"element",
""
),
`Expected element ${i} have role`,
t,
"Received",
n.join(", ")
);
}
};
}
function Qn(e) {
return e.hasAttribute("role") ? e.getAttribute("role").split(" ").filter(Boolean) : Jn(e);
}
function Jn(e) {
for (const { match: t, roles: n } of Xn)
if (t(e))
return [...n];
return [];
}
function Zn(e) {
function t({ name: o, attributes: f }) {
return `${o}${f.map(({ name: c, value: b, constraints: h = [] }) => h.indexOf("undefined") !== -1 ? `:not([${c}])` : b ? `[${c}="${b}"]` : `[${c}]`).join("")}`;
}
function n({ attributes: o = [] }) {
return o.length;
}
function r({ specificity: o }, { specificity: f }) {
return f - o;
}
function i(o) {
let { attributes: f = [] } = o;
const c = f.findIndex(
(h) => h.value && h.name === "type" && h.value === "text"
);
c >= 0 && (f = [
...f.slice(0, c),
...f.slice(c + 1)
]);
const b = t({ ...o, attributes: f });
return (h) => c >= 0 && h.type !== "text" ? !1 : h.matches(b);
}
let s = [];
for (const [o, f] of e.entries())
s = [
...s,
{
match: i(o),
roles: Array.from(f),
specificity: n(o)
}
];
return s.sort(r);
}
function ce(e, t) {
m(e, ce, this);
const n = In(e), r = arguments.length === 1;
let i = !1;
return r ? i = n !== "" : i = t instanceof RegExp ? t.test(n) : this.equals(n, t), {
pass: i,
message: () => {
const s = this.isNot ? "not to" : "to";
return S(
this,
this.utils.matcherHint(
`${this.isNot ? ".not" : ""}.${ce.name}`,
"element",
""
),
`Expected element ${s} have accessible name`,
t,
"Received",
n
);
}
};
}
function De(e, t, n) {
return n === void 0 ? t : `${t}=${e(n)}`;
}
function er(e, t, n) {
return n === void 0 ? `element.hasAttribute(${e(t)})` : `element.getAttribute(${e(t)}) === ${e(n)}`;
}
function et(e, t, n) {
m(e, et, this);
const r = n !== void 0, i = e.hasAttribute(t), s = e.getAttribute(t);
return {
pass: r ? i && this.equals(s, n) : i,
message: () => {
const o = this.isNot ? "not to" : "to", f = i ? De(this.utils.stringify, t, s) : null, c = this.utils.matcherHint(
`${this.isNot ? ".not" : ""}.toHaveAttribute`,
"element",
this.utils.printExpected(t),
{
secondArgument: r ? this.utils.printExpected(n) : void 0,
comment: er(
this.utils.stringify,
t,
n
)
}
);
return S(
this,
c,
`Expected the element ${o} have attribute`,
De(this.utils.stringify, t, n),
"Received",
f
);
}
};
}
function tr(e) {
const t = e.pop();
let n, r;
return typeof t == "object" && !(t instanceof RegExp) ? (n = e, r = t) : (n = e.concat(t), r = { exact: !1 }), { expectedClassNames: n, options: r };
}
function Be(e) {
return e ? e.split(/\s+/).filter((t) => t.length > 0) : [];
}
function Pe(e, t) {
return e.every(
(n) => typeof n == "string" ? t.includes(n) : t.some((r) => n.test(r))
);
}
function tt(e, ...t) {
m(e, tt, this);
const { expectedClassNames: n, options: r } = tr(t), i = Be(e.getAttribute("class")), s = n.reduce(
(f, c) => f.concat(
typeof c == "string" || !c ? Be(c) : c
),
[]
), o = s.some((f) => f instanceof RegExp);
if (r.exact && o)
throw new Error("Exact option does not support RegExp expected class names");
return r.exact ? {
pass: Pe(s, i) && s.length === i.length,
message: () => {
const f = this.isNot ? "not to" : "to";
return S(
this,
this.utils.matcherHint(
`${this.isNot ? ".not" : ""}.toHaveClass`,
"element",
this.utils.printExpected(s.join(" "))
),
`Expected the element ${f} have EXACTLY defined classes`,
s.join(" "),
"Received",
i.join(" ")
);
}
} : s.length > 0 ? {
pass: Pe(s, i),
message: () => {
const f = this.isNot ? "not to" : "to";
return S(
this,
this.utils.matcherHint(
`${this.isNot ? ".not" : ""}.toHaveClass`,
"element",
this.utils.printExpected(s.join(" "))
),
`Expected the element ${f} have class`,
s.join(" "),
"Received",
i.join(" ")
);
}
} : {
pass: this.isNot ? i.length > 0 : !1,
message: () => this.isNot ? S(
this,
this.utils.matcherHint(".not.toHaveClass", "element", ""),
"Expected the element to have classes",
"(none)",
"Received",
i.join(" ")
) : [
this.utils.matcherHint(".toHaveClass", "element"),
"At least one expected class must be provided."
].join(`
`)
};
}
function nr(e, t) {
const n = {}, r = e.createElement("div");
return Object.keys(t).forEach((i) => {
r.style[i] = t[i], n[i] = r.style[i];
}), n;
}
function rr(e, t) {
return !!Object.keys(e).length && Object.entries(e).every(([n, r]) => {
const i = n.startsWith("--"), s = [n];
return i || s.push(n.toLowerCase()), s.some(
(o) => t[o] === r || t.getPropertyValue(o) === r
);
});
}
function ke(e) {
return Object.keys(e).sort().map((t) => `${t}: ${e[t]};`).join(`
`);
}
function ir(e, t, n) {
const r = Array.from(n).filter((s) => t[s] !== void 0).reduce(
(s, o) => Object.assign(s, { [o]: n.getPropertyValue(o) }),
{}
);
return e(ke(t), ke(r)).replace(`${Dn.red("+ Received")}
`, "");
}
function le(e, t) {
m(e, le, this);
const n = typeof t == "object" ? t : jn(t, le, this), { getComputedStyle: r } = e.ownerDocument.defaultView, i = nr(e.ownerDocument, n), s = r(e);
return {
pass: rr(i, s),
message: () => {
const o = `${this.isNot ? ".not" : ""}.toHaveStyle`;
return [
this.utils.matcherHint(o, "element", ""),
ir(this.utils.diff, i, s)
].join(`
`);
}
};
}
function nt(e) {
return m(e, nt, this), {
pass: e.ownerDocument.activeElement === e,
message: () => [
this.utils.matcherHint(
`${this.isNot ? ".not" : ""}.toHaveFocus`,
"element",
""
),
"",
...this.isNot ? [
"Received element is focused:",
` ${this.utils.printReceived(e)}`
] : [
"Expected element with focus:",
` ${this.utils.printExpected(e)}`,
"Received element with focus:",
` ${this.utils.printReceived(
e.ownerDocument.activeElement
)}`
]
].join(`
`)
};
}
function sr(e) {
const t = [...new Set(e.map((n) => n.type))];
if (t.length !== 1)
throw new Error(
"Multiple form elements with the same name must be of the same type"
);
switch (t[0]) {
case "radio": {
const n = e.find((r) => r.checked);
return n ? n.value : void 0;
}
case "checkbox":
return e.filter((n) => n.checked).map((n) => n.value);
default:
return e.map((n) => n.value);
}
}
function or(e, t) {
const n = [...e.querySelectorAll(`[name="${Mn(t)}"]`)];