wrec 0.19.1 → 0.19.2

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/wrec.es.js CHANGED
@@ -1,126 +1,131 @@
1
+ var Ue = (i) => {
2
+ throw TypeError(i);
3
+ };
4
+ var Zt = (i, t, e) => t.has(i) || Ue("Cannot " + e);
5
+ var R = (i, t, e) => (Zt(i, t, "read from private field"), e ? e.call(i) : t.get(i)), j = (i, t, e) => t.has(i) ? Ue("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), ot = (i, t, e, n) => (Zt(i, t, "write to private field"), n ? n.call(i, e) : t.set(i, e), e), He = (i, t, e) => (Zt(i, t, "access private method"), e);
1
6
  const {
2
- entries: Pe,
3
- setPrototypeOf: Re,
4
- isFrozen: un,
5
- getPrototypeOf: pn,
6
- getOwnPropertyDescriptor: mn
7
+ entries: Ke,
8
+ setPrototypeOf: ze,
9
+ isFrozen: Dn,
10
+ getPrototypeOf: In,
11
+ getOwnPropertyDescriptor: vn
7
12
  } = Object;
8
13
  let {
9
14
  freeze: L,
10
- seal: I,
11
- create: qt
15
+ seal: v,
16
+ create: ce
12
17
  } = Object, {
13
- apply: Kt,
14
- construct: Zt
18
+ apply: le,
19
+ construct: fe
15
20
  } = typeof Reflect < "u" && Reflect;
16
21
  L || (L = function(t) {
17
22
  return t;
18
23
  });
19
- I || (I = function(t) {
24
+ v || (v = function(t) {
20
25
  return t;
21
26
  });
22
- Kt || (Kt = function(t, e) {
23
- for (var n = arguments.length, i = new Array(n > 2 ? n - 2 : 0), r = 2; r < n; r++)
24
- i[r - 2] = arguments[r];
25
- return t.apply(e, i);
27
+ le || (le = function(t, e) {
28
+ for (var n = arguments.length, s = new Array(n > 2 ? n - 2 : 0), r = 2; r < n; r++)
29
+ s[r - 2] = arguments[r];
30
+ return t.apply(e, s);
26
31
  });
27
- Zt || (Zt = function(t) {
28
- for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
29
- n[i - 1] = arguments[i];
32
+ fe || (fe = function(t) {
33
+ for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), s = 1; s < e; s++)
34
+ n[s - 1] = arguments[s];
30
35
  return new t(...n);
31
36
  });
32
- const Et = M(Array.prototype.forEach), hn = M(Array.prototype.lastIndexOf), Ce = M(Array.prototype.pop), nt = M(Array.prototype.push), dn = M(Array.prototype.splice), _t = M(String.prototype.toLowerCase), Ht = M(String.prototype.toString), zt = M(String.prototype.match), ot = M(String.prototype.replace), Tn = M(String.prototype.indexOf), En = M(String.prototype.trim), P = M(Object.prototype.hasOwnProperty), O = M(RegExp.prototype.test), it = gn(TypeError);
33
- function M(s) {
37
+ const Ct = M(Array.prototype.forEach), xn = M(Array.prototype.lastIndexOf), $e = M(Array.prototype.pop), lt = M(Array.prototype.push), Pn = M(Array.prototype.splice), Lt = M(String.prototype.toLowerCase), Jt = M(String.prototype.toString), Qt = M(String.prototype.match), ft = M(String.prototype.replace), kn = M(String.prototype.indexOf), Fn = M(String.prototype.trim), x = M(Object.prototype.hasOwnProperty), N = M(RegExp.prototype.test), ut = Un(TypeError);
38
+ function M(i) {
34
39
  return function(t) {
35
40
  t instanceof RegExp && (t.lastIndex = 0);
36
- for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
37
- n[i - 1] = arguments[i];
38
- return Kt(s, t, n);
41
+ for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), s = 1; s < e; s++)
42
+ n[s - 1] = arguments[s];
43
+ return le(i, t, n);
39
44
  };
40
45
  }
41
- function gn(s) {
46
+ function Un(i) {
42
47
  return function() {
43
48
  for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
44
49
  e[n] = arguments[n];
45
- return Zt(s, e);
50
+ return fe(i, e);
46
51
  };
47
52
  }
48
- function m(s, t) {
49
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _t;
50
- Re && Re(s, null);
53
+ function d(i, t) {
54
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Lt;
55
+ ze && ze(i, null);
51
56
  let n = t.length;
52
57
  for (; n--; ) {
53
- let i = t[n];
54
- if (typeof i == "string") {
55
- const r = e(i);
56
- r !== i && (un(t) || (t[n] = r), i = r);
58
+ let s = t[n];
59
+ if (typeof s == "string") {
60
+ const r = e(s);
61
+ r !== s && (Dn(t) || (t[n] = r), s = r);
57
62
  }
58
- s[i] = !0;
63
+ i[s] = !0;
59
64
  }
60
- return s;
65
+ return i;
61
66
  }
62
- function An(s) {
63
- for (let t = 0; t < s.length; t++)
64
- P(s, t) || (s[t] = null);
65
- return s;
67
+ function Hn(i) {
68
+ for (let t = 0; t < i.length; t++)
69
+ x(i, t) || (i[t] = null);
70
+ return i;
66
71
  }
67
- function k(s) {
68
- const t = qt(null);
69
- for (const [e, n] of Pe(s))
70
- P(s, e) && (Array.isArray(n) ? t[e] = An(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = k(n) : t[e] = n);
72
+ function F(i) {
73
+ const t = ce(null);
74
+ for (const [e, n] of Ke(i))
75
+ x(i, e) && (Array.isArray(n) ? t[e] = Hn(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = F(n) : t[e] = n);
71
76
  return t;
72
77
  }
73
- function st(s, t) {
74
- for (; s !== null; ) {
75
- const n = mn(s, t);
78
+ function pt(i, t) {
79
+ for (; i !== null; ) {
80
+ const n = vn(i, t);
76
81
  if (n) {
77
82
  if (n.get)
78
83
  return M(n.get);
79
84
  if (typeof n.value == "function")
80
85
  return M(n.value);
81
86
  }
82
- s = pn(s);
87
+ i = In(i);
83
88
  }
84
89
  function e() {
85
90
  return null;
86
91
  }
87
92
  return e;
88
93
  }
89
- const Ne = L(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Gt = L(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), $t = L(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), _n = L(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Bt = L(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), bn = L(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Oe = L(["#text"]), Le = L(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), Wt = L(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), Me = L(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), gt = L(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Sn = I(/\{\{[\w\W]*|[\w\W]*\}\}/gm), yn = I(/<%[\w\W]*|[\w\W]*%>/gm), Rn = I(/\$\{[\w\W]*/gm), Cn = I(/^data-[\-\w.\u00B7-\uFFFF]+$/), Nn = I(/^aria-[\-\w]+$/), ve = I(
94
+ const Ge = L(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), te = L(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), ee = L(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), zn = L(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), ne = L(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), $n = L(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), We = L(["#text"]), Be = L(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), oe = L(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), je = L(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), wt = L(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Gn = v(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Wn = v(/<%[\w\W]*|[\w\W]*%>/gm), Bn = v(/\$\{[\w\W]*/gm), jn = v(/^data-[\-\w.\u00B7-\uFFFF]+$/), Yn = v(/^aria-[\-\w]+$/), Ze = v(
90
95
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
91
96
  // eslint-disable-line no-useless-escape
92
- ), On = I(/^(?:\w+script|data):/i), Ln = I(
97
+ ), Vn = v(/^(?:\w+script|data):/i), Xn = v(
93
98
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
94
99
  // eslint-disable-line no-control-regex
95
- ), xe = I(/^html$/i), Mn = I(/^[a-z][.\w]*(-[.\w]+)+$/i);
96
- var we = /* @__PURE__ */ Object.freeze({
100
+ ), Je = v(/^html$/i), qn = v(/^[a-z][.\w]*(-[.\w]+)+$/i);
101
+ var Ye = /* @__PURE__ */ Object.freeze({
97
102
  __proto__: null,
98
- ARIA_ATTR: Nn,
99
- ATTR_WHITESPACE: Ln,
100
- CUSTOM_ELEMENT: Mn,
101
- DATA_ATTR: Cn,
102
- DOCTYPE_NAME: xe,
103
- ERB_EXPR: yn,
104
- IS_ALLOWED_URI: ve,
105
- IS_SCRIPT_OR_DATA: On,
106
- MUSTACHE_EXPR: Sn,
107
- TMPLIT_EXPR: Rn
103
+ ARIA_ATTR: Yn,
104
+ ATTR_WHITESPACE: Xn,
105
+ CUSTOM_ELEMENT: qn,
106
+ DATA_ATTR: jn,
107
+ DOCTYPE_NAME: Je,
108
+ ERB_EXPR: Wn,
109
+ IS_ALLOWED_URI: Ze,
110
+ IS_SCRIPT_OR_DATA: Vn,
111
+ MUSTACHE_EXPR: Gn,
112
+ TMPLIT_EXPR: Bn
108
113
  });
109
- const rt = {
114
+ const mt = {
110
115
  element: 1,
111
116
  text: 3,
112
117
  // Deprecated
113
118
  progressingInstruction: 7,
114
119
  comment: 8,
115
120
  document: 9
116
- }, wn = function() {
121
+ }, Kn = function() {
117
122
  return typeof window > "u" ? null : window;
118
- }, Dn = function(t, e) {
123
+ }, Zn = function(t, e) {
119
124
  if (typeof t != "object" || typeof t.createPolicy != "function")
120
125
  return null;
121
126
  let n = null;
122
- const i = "data-tt-policy-suffix";
123
- e && e.hasAttribute(i) && (n = e.getAttribute(i));
127
+ const s = "data-tt-policy-suffix";
128
+ e && e.hasAttribute(s) && (n = e.getAttribute(s));
124
129
  const r = "dompurify" + (n ? "#" + n : "");
125
130
  try {
126
131
  return t.createPolicy(r, {
@@ -134,7 +139,7 @@ const rt = {
134
139
  } catch {
135
140
  return console.warn("TrustedTypes policy " + r + " could not be created."), null;
136
141
  }
137
- }, De = function() {
142
+ }, Ve = function() {
138
143
  return {
139
144
  afterSanitizeAttributes: [],
140
145
  afterSanitizeElements: [],
@@ -147,57 +152,57 @@ const rt = {
147
152
  uponSanitizeShadowNode: []
148
153
  };
149
154
  };
150
- function ke() {
151
- let s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : wn();
152
- const t = (f) => ke(f);
153
- if (t.version = "3.3.1", t.removed = [], !s || !s.document || s.document.nodeType !== rt.document || !s.Element)
155
+ function Qe() {
156
+ let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Kn();
157
+ const t = (f) => Qe(f);
158
+ if (t.version = "3.3.1", t.removed = [], !i || !i.document || i.document.nodeType !== mt.document || !i.Element)
154
159
  return t.isSupported = !1, t;
155
160
  let {
156
161
  document: e
157
- } = s;
158
- const n = e, i = n.currentScript, {
162
+ } = i;
163
+ const n = e, s = n.currentScript, {
159
164
  DocumentFragment: r,
160
165
  HTMLTemplateElement: c,
161
- Node: h,
162
- Element: u,
163
- NodeFilter: p,
164
- NamedNodeMap: d = s.NamedNodeMap || s.MozNamedAttrMap,
166
+ Node: u,
167
+ Element: p,
168
+ NodeFilter: m,
169
+ NamedNodeMap: h = i.NamedNodeMap || i.MozNamedAttrMap,
165
170
  HTMLFormElement: b,
166
- DOMParser: G,
167
- trustedTypes: F
168
- } = s, $ = u.prototype, We = st($, "cloneNode"), je = st($, "remove"), Ye = st($, "nextSibling"), Ve = st($, "childNodes"), lt = st($, "parentNode");
171
+ DOMParser: W,
172
+ trustedTypes: H
173
+ } = i, B = p.prototype, un = pt(B, "cloneNode"), pn = pt(B, "remove"), mn = pt(B, "nextSibling"), hn = pt(B, "childNodes"), Et = pt(B, "parentNode");
169
174
  if (typeof c == "function") {
170
175
  const f = e.createElement("template");
171
176
  f.content && f.content.ownerDocument && (e = f.content.ownerDocument);
172
177
  }
173
- let C, J = "";
178
+ let C, it = "";
174
179
  const {
175
- implementation: yt,
176
- createNodeIterator: Xe,
177
- createDocumentFragment: qe,
178
- getElementsByTagName: Ke
180
+ implementation: Pt,
181
+ createNodeIterator: dn,
182
+ createDocumentFragment: Tn,
183
+ getElementsByTagName: gn
179
184
  } = e, {
180
- importNode: Ze
185
+ importNode: En
181
186
  } = n;
182
- let N = De();
183
- t.isSupported = typeof Pe == "function" && typeof lt == "function" && yt && yt.createHTMLDocument !== void 0;
187
+ let w = Ve();
188
+ t.isSupported = typeof Ke == "function" && typeof Et == "function" && Pt && Pt.createHTMLDocument !== void 0;
184
189
  const {
185
- MUSTACHE_EXPR: Rt,
186
- ERB_EXPR: Ct,
187
- TMPLIT_EXPR: Nt,
188
- DATA_ATTR: Je,
189
- ARIA_ATTR: Qe,
190
- IS_SCRIPT_OR_DATA: tn,
191
- ATTR_WHITESPACE: te,
192
- CUSTOM_ELEMENT: en
193
- } = we;
190
+ MUSTACHE_EXPR: kt,
191
+ ERB_EXPR: Ft,
192
+ TMPLIT_EXPR: Ut,
193
+ DATA_ATTR: An,
194
+ ARIA_ATTR: _n,
195
+ IS_SCRIPT_OR_DATA: bn,
196
+ ATTR_WHITESPACE: he,
197
+ CUSTOM_ELEMENT: Sn
198
+ } = Ye;
194
199
  let {
195
- IS_ALLOWED_URI: ee
196
- } = we, _ = null;
197
- const ne = m({}, [...Ne, ...Gt, ...$t, ...Bt, ...Oe]);
200
+ IS_ALLOWED_URI: de
201
+ } = Ye, _ = null;
202
+ const Te = d({}, [...Ge, ...te, ...ee, ...ne, ...We]);
198
203
  let S = null;
199
- const oe = m({}, [...Le, ...Wt, ...Me, ...gt]);
200
- let E = Object.seal(qt(null, {
204
+ const ge = d({}, [...Be, ...oe, ...je, ...wt]);
205
+ let g = Object.seal(ce(null, {
201
206
  tagNameCheck: {
202
207
  writable: !0,
203
208
  configurable: !1,
@@ -216,8 +221,8 @@ function ke() {
216
221
  enumerable: !0,
217
222
  value: !1
218
223
  }
219
- })), Q = null, Ot = null;
220
- const j = Object.seal(qt(null, {
224
+ })), rt = null, Ht = null;
225
+ const K = Object.seal(ce(null, {
221
226
  tagCheck: {
222
227
  writable: !0,
223
228
  configurable: !1,
@@ -231,70 +236,70 @@ function ke() {
231
236
  value: null
232
237
  }
233
238
  }));
234
- let ie = !0, Lt = !0, se = !1, re = !0, Y = !1, ft = !0, B = !1, Mt = !1, wt = !1, V = !1, ut = !1, pt = !1, ae = !0, ce = !1;
235
- const nn = "user-content-";
236
- let Dt = !0, tt = !1, X = {}, v = null;
237
- const It = m({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
238
- let le = null;
239
- const fe = m({}, ["audio", "video", "img", "source", "image", "track"]);
240
- let Pt = null;
241
- const ue = m({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), mt = "http://www.w3.org/1998/Math/MathML", ht = "http://www.w3.org/2000/svg", U = "http://www.w3.org/1999/xhtml";
242
- let q = U, vt = !1, xt = null;
243
- const on = m({}, [mt, ht, U], Ht);
244
- let dt = m({}, ["mi", "mo", "mn", "ms", "mtext"]), Tt = m({}, ["annotation-xml"]);
245
- const sn = m({}, ["title", "style", "font", "a", "script"]);
246
- let et = null;
247
- const rn = ["application/xhtml+xml", "text/html"], an = "text/html";
248
- let A = null, K = null;
249
- const cn = e.createElement("form"), pe = function(o) {
239
+ let Ee = !0, zt = !0, Ae = !1, _e = !0, Z = !1, At = !0, V = !1, $t = !1, Gt = !1, J = !1, _t = !1, bt = !1, be = !0, Se = !1;
240
+ const yn = "user-content-";
241
+ let Wt = !0, at = !1, Q = {}, P = null;
242
+ const Bt = d({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
243
+ let ye = null;
244
+ const Re = d({}, ["audio", "video", "img", "source", "image", "track"]);
245
+ let jt = null;
246
+ const Oe = d({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), St = "http://www.w3.org/1998/Math/MathML", yt = "http://www.w3.org/2000/svg", z = "http://www.w3.org/1999/xhtml";
247
+ let tt = z, Yt = !1, Vt = null;
248
+ const Rn = d({}, [St, yt, z], Jt);
249
+ let Rt = d({}, ["mi", "mo", "mn", "ms", "mtext"]), Ot = d({}, ["annotation-xml"]);
250
+ const On = d({}, ["title", "style", "font", "a", "script"]);
251
+ let ct = null;
252
+ const Cn = ["application/xhtml+xml", "text/html"], wn = "text/html";
253
+ let A = null, et = null;
254
+ const Nn = e.createElement("form"), Ce = function(o) {
250
255
  return o instanceof RegExp || o instanceof Function;
251
- }, kt = function() {
256
+ }, Xt = function() {
252
257
  let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
253
- if (!(K && K === o)) {
254
- if ((!o || typeof o != "object") && (o = {}), o = k(o), et = // eslint-disable-next-line unicorn/prefer-includes
255
- rn.indexOf(o.PARSER_MEDIA_TYPE) === -1 ? an : o.PARSER_MEDIA_TYPE, A = et === "application/xhtml+xml" ? Ht : _t, _ = P(o, "ALLOWED_TAGS") ? m({}, o.ALLOWED_TAGS, A) : ne, S = P(o, "ALLOWED_ATTR") ? m({}, o.ALLOWED_ATTR, A) : oe, xt = P(o, "ALLOWED_NAMESPACES") ? m({}, o.ALLOWED_NAMESPACES, Ht) : on, Pt = P(o, "ADD_URI_SAFE_ATTR") ? m(k(ue), o.ADD_URI_SAFE_ATTR, A) : ue, le = P(o, "ADD_DATA_URI_TAGS") ? m(k(fe), o.ADD_DATA_URI_TAGS, A) : fe, v = P(o, "FORBID_CONTENTS") ? m({}, o.FORBID_CONTENTS, A) : It, Q = P(o, "FORBID_TAGS") ? m({}, o.FORBID_TAGS, A) : k({}), Ot = P(o, "FORBID_ATTR") ? m({}, o.FORBID_ATTR, A) : k({}), X = P(o, "USE_PROFILES") ? o.USE_PROFILES : !1, ie = o.ALLOW_ARIA_ATTR !== !1, Lt = o.ALLOW_DATA_ATTR !== !1, se = o.ALLOW_UNKNOWN_PROTOCOLS || !1, re = o.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Y = o.SAFE_FOR_TEMPLATES || !1, ft = o.SAFE_FOR_XML !== !1, B = o.WHOLE_DOCUMENT || !1, V = o.RETURN_DOM || !1, ut = o.RETURN_DOM_FRAGMENT || !1, pt = o.RETURN_TRUSTED_TYPE || !1, wt = o.FORCE_BODY || !1, ae = o.SANITIZE_DOM !== !1, ce = o.SANITIZE_NAMED_PROPS || !1, Dt = o.KEEP_CONTENT !== !1, tt = o.IN_PLACE || !1, ee = o.ALLOWED_URI_REGEXP || ve, q = o.NAMESPACE || U, dt = o.MATHML_TEXT_INTEGRATION_POINTS || dt, Tt = o.HTML_INTEGRATION_POINTS || Tt, E = o.CUSTOM_ELEMENT_HANDLING || {}, o.CUSTOM_ELEMENT_HANDLING && pe(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (E.tagNameCheck = o.CUSTOM_ELEMENT_HANDLING.tagNameCheck), o.CUSTOM_ELEMENT_HANDLING && pe(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (E.attributeNameCheck = o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), o.CUSTOM_ELEMENT_HANDLING && typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (E.allowCustomizedBuiltInElements = o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Y && (Lt = !1), ut && (V = !0), X && (_ = m({}, Oe), S = [], X.html === !0 && (m(_, Ne), m(S, Le)), X.svg === !0 && (m(_, Gt), m(S, Wt), m(S, gt)), X.svgFilters === !0 && (m(_, $t), m(S, Wt), m(S, gt)), X.mathMl === !0 && (m(_, Bt), m(S, Me), m(S, gt))), o.ADD_TAGS && (typeof o.ADD_TAGS == "function" ? j.tagCheck = o.ADD_TAGS : (_ === ne && (_ = k(_)), m(_, o.ADD_TAGS, A))), o.ADD_ATTR && (typeof o.ADD_ATTR == "function" ? j.attributeCheck = o.ADD_ATTR : (S === oe && (S = k(S)), m(S, o.ADD_ATTR, A))), o.ADD_URI_SAFE_ATTR && m(Pt, o.ADD_URI_SAFE_ATTR, A), o.FORBID_CONTENTS && (v === It && (v = k(v)), m(v, o.FORBID_CONTENTS, A)), o.ADD_FORBID_CONTENTS && (v === It && (v = k(v)), m(v, o.ADD_FORBID_CONTENTS, A)), Dt && (_["#text"] = !0), B && m(_, ["html", "head", "body"]), _.table && (m(_, ["tbody"]), delete Q.tbody), o.TRUSTED_TYPES_POLICY) {
258
+ if (!(et && et === o)) {
259
+ if ((!o || typeof o != "object") && (o = {}), o = F(o), ct = // eslint-disable-next-line unicorn/prefer-includes
260
+ Cn.indexOf(o.PARSER_MEDIA_TYPE) === -1 ? wn : o.PARSER_MEDIA_TYPE, A = ct === "application/xhtml+xml" ? Jt : Lt, _ = x(o, "ALLOWED_TAGS") ? d({}, o.ALLOWED_TAGS, A) : Te, S = x(o, "ALLOWED_ATTR") ? d({}, o.ALLOWED_ATTR, A) : ge, Vt = x(o, "ALLOWED_NAMESPACES") ? d({}, o.ALLOWED_NAMESPACES, Jt) : Rn, jt = x(o, "ADD_URI_SAFE_ATTR") ? d(F(Oe), o.ADD_URI_SAFE_ATTR, A) : Oe, ye = x(o, "ADD_DATA_URI_TAGS") ? d(F(Re), o.ADD_DATA_URI_TAGS, A) : Re, P = x(o, "FORBID_CONTENTS") ? d({}, o.FORBID_CONTENTS, A) : Bt, rt = x(o, "FORBID_TAGS") ? d({}, o.FORBID_TAGS, A) : F({}), Ht = x(o, "FORBID_ATTR") ? d({}, o.FORBID_ATTR, A) : F({}), Q = x(o, "USE_PROFILES") ? o.USE_PROFILES : !1, Ee = o.ALLOW_ARIA_ATTR !== !1, zt = o.ALLOW_DATA_ATTR !== !1, Ae = o.ALLOW_UNKNOWN_PROTOCOLS || !1, _e = o.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Z = o.SAFE_FOR_TEMPLATES || !1, At = o.SAFE_FOR_XML !== !1, V = o.WHOLE_DOCUMENT || !1, J = o.RETURN_DOM || !1, _t = o.RETURN_DOM_FRAGMENT || !1, bt = o.RETURN_TRUSTED_TYPE || !1, Gt = o.FORCE_BODY || !1, be = o.SANITIZE_DOM !== !1, Se = o.SANITIZE_NAMED_PROPS || !1, Wt = o.KEEP_CONTENT !== !1, at = o.IN_PLACE || !1, de = o.ALLOWED_URI_REGEXP || Ze, tt = o.NAMESPACE || z, Rt = o.MATHML_TEXT_INTEGRATION_POINTS || Rt, Ot = o.HTML_INTEGRATION_POINTS || Ot, g = o.CUSTOM_ELEMENT_HANDLING || {}, o.CUSTOM_ELEMENT_HANDLING && Ce(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (g.tagNameCheck = o.CUSTOM_ELEMENT_HANDLING.tagNameCheck), o.CUSTOM_ELEMENT_HANDLING && Ce(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (g.attributeNameCheck = o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), o.CUSTOM_ELEMENT_HANDLING && typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (g.allowCustomizedBuiltInElements = o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Z && (zt = !1), _t && (J = !0), Q && (_ = d({}, We), S = [], Q.html === !0 && (d(_, Ge), d(S, Be)), Q.svg === !0 && (d(_, te), d(S, oe), d(S, wt)), Q.svgFilters === !0 && (d(_, ee), d(S, oe), d(S, wt)), Q.mathMl === !0 && (d(_, ne), d(S, je), d(S, wt))), o.ADD_TAGS && (typeof o.ADD_TAGS == "function" ? K.tagCheck = o.ADD_TAGS : (_ === Te && (_ = F(_)), d(_, o.ADD_TAGS, A))), o.ADD_ATTR && (typeof o.ADD_ATTR == "function" ? K.attributeCheck = o.ADD_ATTR : (S === ge && (S = F(S)), d(S, o.ADD_ATTR, A))), o.ADD_URI_SAFE_ATTR && d(jt, o.ADD_URI_SAFE_ATTR, A), o.FORBID_CONTENTS && (P === Bt && (P = F(P)), d(P, o.FORBID_CONTENTS, A)), o.ADD_FORBID_CONTENTS && (P === Bt && (P = F(P)), d(P, o.ADD_FORBID_CONTENTS, A)), Wt && (_["#text"] = !0), V && d(_, ["html", "head", "body"]), _.table && (d(_, ["tbody"]), delete rt.tbody), o.TRUSTED_TYPES_POLICY) {
256
261
  if (typeof o.TRUSTED_TYPES_POLICY.createHTML != "function")
257
- throw it('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
262
+ throw ut('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
258
263
  if (typeof o.TRUSTED_TYPES_POLICY.createScriptURL != "function")
259
- throw it('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
260
- C = o.TRUSTED_TYPES_POLICY, J = C.createHTML("");
264
+ throw ut('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
265
+ C = o.TRUSTED_TYPES_POLICY, it = C.createHTML("");
261
266
  } else
262
- C === void 0 && (C = Dn(F, i)), C !== null && typeof J == "string" && (J = C.createHTML(""));
263
- L && L(o), K = o;
267
+ C === void 0 && (C = Zn(H, s)), C !== null && typeof it == "string" && (it = C.createHTML(""));
268
+ L && L(o), et = o;
264
269
  }
265
- }, me = m({}, [...Gt, ...$t, ..._n]), he = m({}, [...Bt, ...bn]), ln = function(o) {
266
- let a = lt(o);
270
+ }, we = d({}, [...te, ...ee, ...zn]), Ne = d({}, [...ne, ...$n]), Ln = function(o) {
271
+ let a = Et(o);
267
272
  (!a || !a.tagName) && (a = {
268
- namespaceURI: q,
273
+ namespaceURI: tt,
269
274
  tagName: "template"
270
275
  });
271
- const l = _t(o.tagName), T = _t(a.tagName);
272
- return xt[o.namespaceURI] ? o.namespaceURI === ht ? a.namespaceURI === U ? l === "svg" : a.namespaceURI === mt ? l === "svg" && (T === "annotation-xml" || dt[T]) : !!me[l] : o.namespaceURI === mt ? a.namespaceURI === U ? l === "math" : a.namespaceURI === ht ? l === "math" && Tt[T] : !!he[l] : o.namespaceURI === U ? a.namespaceURI === ht && !Tt[T] || a.namespaceURI === mt && !dt[T] ? !1 : !he[l] && (sn[l] || !me[l]) : !!(et === "application/xhtml+xml" && xt[o.namespaceURI]) : !1;
273
- }, x = function(o) {
274
- nt(t.removed, {
276
+ const l = Lt(o.tagName), T = Lt(a.tagName);
277
+ return Vt[o.namespaceURI] ? o.namespaceURI === yt ? a.namespaceURI === z ? l === "svg" : a.namespaceURI === St ? l === "svg" && (T === "annotation-xml" || Rt[T]) : !!we[l] : o.namespaceURI === St ? a.namespaceURI === z ? l === "math" : a.namespaceURI === yt ? l === "math" && Ot[T] : !!Ne[l] : o.namespaceURI === z ? a.namespaceURI === yt && !Ot[T] || a.namespaceURI === St && !Rt[T] ? !1 : !Ne[l] && (On[l] || !we[l]) : !!(ct === "application/xhtml+xml" && Vt[o.namespaceURI]) : !1;
278
+ }, k = function(o) {
279
+ lt(t.removed, {
275
280
  element: o
276
281
  });
277
282
  try {
278
- lt(o).removeChild(o);
283
+ Et(o).removeChild(o);
279
284
  } catch {
280
- je(o);
285
+ pn(o);
281
286
  }
282
- }, W = function(o, a) {
287
+ }, X = function(o, a) {
283
288
  try {
284
- nt(t.removed, {
289
+ lt(t.removed, {
285
290
  attribute: a.getAttributeNode(o),
286
291
  from: a
287
292
  });
288
293
  } catch {
289
- nt(t.removed, {
294
+ lt(t.removed, {
290
295
  attribute: null,
291
296
  from: a
292
297
  });
293
298
  }
294
299
  if (a.removeAttribute(o), o === "is")
295
- if (V || ut)
300
+ if (J || _t)
296
301
  try {
297
- x(a);
302
+ k(a);
298
303
  } catch {
299
304
  }
300
305
  else
@@ -302,97 +307,97 @@ function ke() {
302
307
  a.setAttribute(o, "");
303
308
  } catch {
304
309
  }
305
- }, de = function(o) {
310
+ }, Le = function(o) {
306
311
  let a = null, l = null;
307
- if (wt)
312
+ if (Gt)
308
313
  o = "<remove></remove>" + o;
309
314
  else {
310
- const g = zt(o, /^[\r\n\t ]+/);
311
- l = g && g[0];
315
+ const E = Qt(o, /^[\r\n\t ]+/);
316
+ l = E && E[0];
312
317
  }
313
- et === "application/xhtml+xml" && q === U && (o = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + o + "</body></html>");
318
+ ct === "application/xhtml+xml" && tt === z && (o = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + o + "</body></html>");
314
319
  const T = C ? C.createHTML(o) : o;
315
- if (q === U)
320
+ if (tt === z)
316
321
  try {
317
- a = new G().parseFromString(T, et);
322
+ a = new W().parseFromString(T, ct);
318
323
  } catch {
319
324
  }
320
325
  if (!a || !a.documentElement) {
321
- a = yt.createDocument(q, "template", null);
326
+ a = Pt.createDocument(tt, "template", null);
322
327
  try {
323
- a.documentElement.innerHTML = vt ? J : T;
328
+ a.documentElement.innerHTML = Yt ? it : T;
324
329
  } catch {
325
330
  }
326
331
  }
327
- const R = a.body || a.documentElement;
328
- return o && l && R.insertBefore(e.createTextNode(l), R.childNodes[0] || null), q === U ? Ke.call(a, B ? "html" : "body")[0] : B ? a.documentElement : R;
329
- }, Te = function(o) {
330
- return Xe.call(
332
+ const O = a.body || a.documentElement;
333
+ return o && l && O.insertBefore(e.createTextNode(l), O.childNodes[0] || null), tt === z ? gn.call(a, V ? "html" : "body")[0] : V ? a.documentElement : O;
334
+ }, Me = function(o) {
335
+ return dn.call(
331
336
  o.ownerDocument || o,
332
337
  o,
333
338
  // eslint-disable-next-line no-bitwise
334
- p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION,
339
+ m.SHOW_ELEMENT | m.SHOW_COMMENT | m.SHOW_TEXT | m.SHOW_PROCESSING_INSTRUCTION | m.SHOW_CDATA_SECTION,
335
340
  null
336
341
  );
337
- }, Ft = function(o) {
338
- return o instanceof b && (typeof o.nodeName != "string" || typeof o.textContent != "string" || typeof o.removeChild != "function" || !(o.attributes instanceof d) || typeof o.removeAttribute != "function" || typeof o.setAttribute != "function" || typeof o.namespaceURI != "string" || typeof o.insertBefore != "function" || typeof o.hasChildNodes != "function");
339
- }, Ee = function(o) {
340
- return typeof h == "function" && o instanceof h;
342
+ }, qt = function(o) {
343
+ return o instanceof b && (typeof o.nodeName != "string" || typeof o.textContent != "string" || typeof o.removeChild != "function" || !(o.attributes instanceof h) || typeof o.removeAttribute != "function" || typeof o.setAttribute != "function" || typeof o.namespaceURI != "string" || typeof o.insertBefore != "function" || typeof o.hasChildNodes != "function");
344
+ }, De = function(o) {
345
+ return typeof u == "function" && o instanceof u;
341
346
  };
342
- function H(f, o, a) {
343
- Et(f, (l) => {
344
- l.call(t, o, a, K);
347
+ function $(f, o, a) {
348
+ Ct(f, (l) => {
349
+ l.call(t, o, a, et);
345
350
  });
346
351
  }
347
- const ge = function(o) {
352
+ const Ie = function(o) {
348
353
  let a = null;
349
- if (H(N.beforeSanitizeElements, o, null), Ft(o))
350
- return x(o), !0;
354
+ if ($(w.beforeSanitizeElements, o, null), qt(o))
355
+ return k(o), !0;
351
356
  const l = A(o.nodeName);
352
- if (H(N.uponSanitizeElement, o, {
357
+ if ($(w.uponSanitizeElement, o, {
353
358
  tagName: l,
354
359
  allowedTags: _
355
- }), ft && o.hasChildNodes() && !Ee(o.firstElementChild) && O(/<[/\w!]/g, o.innerHTML) && O(/<[/\w!]/g, o.textContent) || o.nodeType === rt.progressingInstruction || ft && o.nodeType === rt.comment && O(/<[/\w]/g, o.data))
356
- return x(o), !0;
357
- if (!(j.tagCheck instanceof Function && j.tagCheck(l)) && (!_[l] || Q[l])) {
358
- if (!Q[l] && _e(l) && (E.tagNameCheck instanceof RegExp && O(E.tagNameCheck, l) || E.tagNameCheck instanceof Function && E.tagNameCheck(l)))
360
+ }), At && o.hasChildNodes() && !De(o.firstElementChild) && N(/<[/\w!]/g, o.innerHTML) && N(/<[/\w!]/g, o.textContent) || o.nodeType === mt.progressingInstruction || At && o.nodeType === mt.comment && N(/<[/\w]/g, o.data))
361
+ return k(o), !0;
362
+ if (!(K.tagCheck instanceof Function && K.tagCheck(l)) && (!_[l] || rt[l])) {
363
+ if (!rt[l] && xe(l) && (g.tagNameCheck instanceof RegExp && N(g.tagNameCheck, l) || g.tagNameCheck instanceof Function && g.tagNameCheck(l)))
359
364
  return !1;
360
- if (Dt && !v[l]) {
361
- const T = lt(o) || o.parentNode, R = Ve(o) || o.childNodes;
362
- if (R && T) {
363
- const g = R.length;
364
- for (let w = g - 1; w >= 0; --w) {
365
- const z = We(R[w], !0);
366
- z.__removalCount = (o.__removalCount || 0) + 1, T.insertBefore(z, Ye(o));
365
+ if (Wt && !P[l]) {
366
+ const T = Et(o) || o.parentNode, O = hn(o) || o.childNodes;
367
+ if (O && T) {
368
+ const E = O.length;
369
+ for (let D = E - 1; D >= 0; --D) {
370
+ const G = un(O[D], !0);
371
+ G.__removalCount = (o.__removalCount || 0) + 1, T.insertBefore(G, mn(o));
367
372
  }
368
373
  }
369
374
  }
370
- return x(o), !0;
375
+ return k(o), !0;
371
376
  }
372
- return o instanceof u && !ln(o) || (l === "noscript" || l === "noembed" || l === "noframes") && O(/<\/no(script|embed|frames)/i, o.innerHTML) ? (x(o), !0) : (Y && o.nodeType === rt.text && (a = o.textContent, Et([Rt, Ct, Nt], (T) => {
373
- a = ot(a, T, " ");
374
- }), o.textContent !== a && (nt(t.removed, {
377
+ return o instanceof p && !Ln(o) || (l === "noscript" || l === "noembed" || l === "noframes") && N(/<\/no(script|embed|frames)/i, o.innerHTML) ? (k(o), !0) : (Z && o.nodeType === mt.text && (a = o.textContent, Ct([kt, Ft, Ut], (T) => {
378
+ a = ft(a, T, " ");
379
+ }), o.textContent !== a && (lt(t.removed, {
375
380
  element: o.cloneNode()
376
- }), o.textContent = a)), H(N.afterSanitizeElements, o, null), !1);
377
- }, Ae = function(o, a, l) {
378
- if (ae && (a === "id" || a === "name") && (l in e || l in cn))
381
+ }), o.textContent = a)), $(w.afterSanitizeElements, o, null), !1);
382
+ }, ve = function(o, a, l) {
383
+ if (be && (a === "id" || a === "name") && (l in e || l in Nn))
379
384
  return !1;
380
- if (!(Lt && !Ot[a] && O(Je, a))) {
381
- if (!(ie && O(Qe, a))) {
382
- if (!(j.attributeCheck instanceof Function && j.attributeCheck(a, o))) {
383
- if (!S[a] || Ot[a]) {
385
+ if (!(zt && !Ht[a] && N(An, a))) {
386
+ if (!(Ee && N(_n, a))) {
387
+ if (!(K.attributeCheck instanceof Function && K.attributeCheck(a, o))) {
388
+ if (!S[a] || Ht[a]) {
384
389
  if (
385
390
  // First condition does a very basic check if a) it's basically a valid custom element tagname AND
386
391
  // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
387
392
  // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
388
- !(_e(o) && (E.tagNameCheck instanceof RegExp && O(E.tagNameCheck, o) || E.tagNameCheck instanceof Function && E.tagNameCheck(o)) && (E.attributeNameCheck instanceof RegExp && O(E.attributeNameCheck, a) || E.attributeNameCheck instanceof Function && E.attributeNameCheck(a, o)) || // Alternative, second condition checks if it's an `is`-attribute, AND
393
+ !(xe(o) && (g.tagNameCheck instanceof RegExp && N(g.tagNameCheck, o) || g.tagNameCheck instanceof Function && g.tagNameCheck(o)) && (g.attributeNameCheck instanceof RegExp && N(g.attributeNameCheck, a) || g.attributeNameCheck instanceof Function && g.attributeNameCheck(a, o)) || // Alternative, second condition checks if it's an `is`-attribute, AND
389
394
  // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
390
- a === "is" && E.allowCustomizedBuiltInElements && (E.tagNameCheck instanceof RegExp && O(E.tagNameCheck, l) || E.tagNameCheck instanceof Function && E.tagNameCheck(l)))
395
+ a === "is" && g.allowCustomizedBuiltInElements && (g.tagNameCheck instanceof RegExp && N(g.tagNameCheck, l) || g.tagNameCheck instanceof Function && g.tagNameCheck(l)))
391
396
  ) return !1;
392
- } else if (!Pt[a]) {
393
- if (!O(ee, ot(l, te, ""))) {
394
- if (!((a === "src" || a === "xlink:href" || a === "href") && o !== "script" && Tn(l, "data:") === 0 && le[o])) {
395
- if (!(se && !O(tn, ot(l, te, "")))) {
397
+ } else if (!jt[a]) {
398
+ if (!N(de, ft(l, he, ""))) {
399
+ if (!((a === "src" || a === "xlink:href" || a === "href") && o !== "script" && kn(l, "data:") === 0 && ye[o])) {
400
+ if (!(Ae && !N(bn, ft(l, he, "")))) {
396
401
  if (l)
397
402
  return !1;
398
403
  }
@@ -403,14 +408,14 @@ function ke() {
403
408
  }
404
409
  }
405
410
  return !0;
406
- }, _e = function(o) {
407
- return o !== "annotation-xml" && zt(o, en);
408
- }, be = function(o) {
409
- H(N.beforeSanitizeAttributes, o, null);
411
+ }, xe = function(o) {
412
+ return o !== "annotation-xml" && Qt(o, Sn);
413
+ }, Pe = function(o) {
414
+ $(w.beforeSanitizeAttributes, o, null);
410
415
  const {
411
416
  attributes: a
412
417
  } = o;
413
- if (!a || Ft(o))
418
+ if (!a || qt(o))
414
419
  return;
415
420
  const l = {
416
421
  attrName: "",
@@ -421,40 +426,40 @@ function ke() {
421
426
  };
422
427
  let T = a.length;
423
428
  for (; T--; ) {
424
- const R = a[T], {
425
- name: g,
426
- namespaceURI: w,
427
- value: z
428
- } = R, Z = A(g), Ut = z;
429
- let y = g === "value" ? Ut : En(Ut);
430
- if (l.attrName = Z, l.attrValue = y, l.keepAttr = !0, l.forceKeepAttr = void 0, H(N.uponSanitizeAttribute, o, l), y = l.attrValue, ce && (Z === "id" || Z === "name") && (W(g, o), y = nn + y), ft && O(/((--!?|])>)|<\/(style|title|textarea)/i, y)) {
431
- W(g, o);
429
+ const O = a[T], {
430
+ name: E,
431
+ namespaceURI: D,
432
+ value: G
433
+ } = O, nt = A(E), Kt = G;
434
+ let y = E === "value" ? Kt : Fn(Kt);
435
+ if (l.attrName = nt, l.attrValue = y, l.keepAttr = !0, l.forceKeepAttr = void 0, $(w.uponSanitizeAttribute, o, l), y = l.attrValue, Se && (nt === "id" || nt === "name") && (X(E, o), y = yn + y), At && N(/((--!?|])>)|<\/(style|title|textarea)/i, y)) {
436
+ X(E, o);
432
437
  continue;
433
438
  }
434
- if (Z === "attributename" && zt(y, "href")) {
435
- W(g, o);
439
+ if (nt === "attributename" && Qt(y, "href")) {
440
+ X(E, o);
436
441
  continue;
437
442
  }
438
443
  if (l.forceKeepAttr)
439
444
  continue;
440
445
  if (!l.keepAttr) {
441
- W(g, o);
446
+ X(E, o);
442
447
  continue;
443
448
  }
444
- if (!re && O(/\/>/i, y)) {
445
- W(g, o);
449
+ if (!_e && N(/\/>/i, y)) {
450
+ X(E, o);
446
451
  continue;
447
452
  }
448
- Y && Et([Rt, Ct, Nt], (ye) => {
449
- y = ot(y, ye, " ");
453
+ Z && Ct([kt, Ft, Ut], (Fe) => {
454
+ y = ft(y, Fe, " ");
450
455
  });
451
- const Se = A(o.nodeName);
452
- if (!Ae(Se, Z, y)) {
453
- W(g, o);
456
+ const ke = A(o.nodeName);
457
+ if (!ve(ke, nt, y)) {
458
+ X(E, o);
454
459
  continue;
455
460
  }
456
- if (C && typeof F == "object" && typeof F.getAttributeType == "function" && !w)
457
- switch (F.getAttributeType(Se, Z)) {
461
+ if (C && typeof H == "object" && typeof H.getAttributeType == "function" && !D)
462
+ switch (H.getAttributeType(ke, nt)) {
458
463
  case "TrustedHTML": {
459
464
  y = C.createHTML(y);
460
465
  break;
@@ -464,103 +469,249 @@ function ke() {
464
469
  break;
465
470
  }
466
471
  }
467
- if (y !== Ut)
472
+ if (y !== Kt)
468
473
  try {
469
- w ? o.setAttributeNS(w, g, y) : o.setAttribute(g, y), Ft(o) ? x(o) : Ce(t.removed);
474
+ D ? o.setAttributeNS(D, E, y) : o.setAttribute(E, y), qt(o) ? k(o) : $e(t.removed);
470
475
  } catch {
471
- W(g, o);
476
+ X(E, o);
472
477
  }
473
478
  }
474
- H(N.afterSanitizeAttributes, o, null);
475
- }, fn = function f(o) {
479
+ $(w.afterSanitizeAttributes, o, null);
480
+ }, Mn = function f(o) {
476
481
  let a = null;
477
- const l = Te(o);
478
- for (H(N.beforeSanitizeShadowDOM, o, null); a = l.nextNode(); )
479
- H(N.uponSanitizeShadowNode, a, null), ge(a), be(a), a.content instanceof r && f(a.content);
480
- H(N.afterSanitizeShadowDOM, o, null);
482
+ const l = Me(o);
483
+ for ($(w.beforeSanitizeShadowDOM, o, null); a = l.nextNode(); )
484
+ $(w.uponSanitizeShadowNode, a, null), Ie(a), Pe(a), a.content instanceof r && f(a.content);
485
+ $(w.afterSanitizeShadowDOM, o, null);
481
486
  };
482
487
  return t.sanitize = function(f) {
483
- let o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = null, l = null, T = null, R = null;
484
- if (vt = !f, vt && (f = "<!-->"), typeof f != "string" && !Ee(f))
488
+ let o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = null, l = null, T = null, O = null;
489
+ if (Yt = !f, Yt && (f = "<!-->"), typeof f != "string" && !De(f))
485
490
  if (typeof f.toString == "function") {
486
491
  if (f = f.toString(), typeof f != "string")
487
- throw it("dirty is not a string, aborting");
492
+ throw ut("dirty is not a string, aborting");
488
493
  } else
489
- throw it("toString is not a function");
494
+ throw ut("toString is not a function");
490
495
  if (!t.isSupported)
491
496
  return f;
492
- if (Mt || kt(o), t.removed = [], typeof f == "string" && (tt = !1), tt) {
497
+ if ($t || Xt(o), t.removed = [], typeof f == "string" && (at = !1), at) {
493
498
  if (f.nodeName) {
494
- const z = A(f.nodeName);
495
- if (!_[z] || Q[z])
496
- throw it("root node is forbidden and cannot be sanitized in-place");
499
+ const G = A(f.nodeName);
500
+ if (!_[G] || rt[G])
501
+ throw ut("root node is forbidden and cannot be sanitized in-place");
497
502
  }
498
- } else if (f instanceof h)
499
- a = de("<!---->"), l = a.ownerDocument.importNode(f, !0), l.nodeType === rt.element && l.nodeName === "BODY" || l.nodeName === "HTML" ? a = l : a.appendChild(l);
503
+ } else if (f instanceof u)
504
+ a = Le("<!---->"), l = a.ownerDocument.importNode(f, !0), l.nodeType === mt.element && l.nodeName === "BODY" || l.nodeName === "HTML" ? a = l : a.appendChild(l);
500
505
  else {
501
- if (!V && !Y && !B && // eslint-disable-next-line unicorn/prefer-includes
506
+ if (!J && !Z && !V && // eslint-disable-next-line unicorn/prefer-includes
502
507
  f.indexOf("<") === -1)
503
- return C && pt ? C.createHTML(f) : f;
504
- if (a = de(f), !a)
505
- return V ? null : pt ? J : "";
508
+ return C && bt ? C.createHTML(f) : f;
509
+ if (a = Le(f), !a)
510
+ return J ? null : bt ? it : "";
506
511
  }
507
- a && wt && x(a.firstChild);
508
- const g = Te(tt ? f : a);
509
- for (; T = g.nextNode(); )
510
- ge(T), be(T), T.content instanceof r && fn(T.content);
511
- if (tt)
512
+ a && Gt && k(a.firstChild);
513
+ const E = Me(at ? f : a);
514
+ for (; T = E.nextNode(); )
515
+ Ie(T), Pe(T), T.content instanceof r && Mn(T.content);
516
+ if (at)
512
517
  return f;
513
- if (V) {
514
- if (ut)
515
- for (R = qe.call(a.ownerDocument); a.firstChild; )
516
- R.appendChild(a.firstChild);
518
+ if (J) {
519
+ if (_t)
520
+ for (O = Tn.call(a.ownerDocument); a.firstChild; )
521
+ O.appendChild(a.firstChild);
517
522
  else
518
- R = a;
519
- return (S.shadowroot || S.shadowrootmode) && (R = Ze.call(n, R, !0)), R;
523
+ O = a;
524
+ return (S.shadowroot || S.shadowrootmode) && (O = En.call(n, O, !0)), O;
520
525
  }
521
- let w = B ? a.outerHTML : a.innerHTML;
522
- return B && _["!doctype"] && a.ownerDocument && a.ownerDocument.doctype && a.ownerDocument.doctype.name && O(xe, a.ownerDocument.doctype.name) && (w = "<!DOCTYPE " + a.ownerDocument.doctype.name + `>
523
- ` + w), Y && Et([Rt, Ct, Nt], (z) => {
524
- w = ot(w, z, " ");
525
- }), C && pt ? C.createHTML(w) : w;
526
+ let D = V ? a.outerHTML : a.innerHTML;
527
+ return V && _["!doctype"] && a.ownerDocument && a.ownerDocument.doctype && a.ownerDocument.doctype.name && N(Je, a.ownerDocument.doctype.name) && (D = "<!DOCTYPE " + a.ownerDocument.doctype.name + `>
528
+ ` + D), Z && Ct([kt, Ft, Ut], (G) => {
529
+ D = ft(D, G, " ");
530
+ }), C && bt ? C.createHTML(D) : D;
526
531
  }, t.setConfig = function() {
527
532
  let f = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
528
- kt(f), Mt = !0;
533
+ Xt(f), $t = !0;
529
534
  }, t.clearConfig = function() {
530
- K = null, Mt = !1;
535
+ et = null, $t = !1;
531
536
  }, t.isValidAttribute = function(f, o, a) {
532
- K || kt({});
537
+ et || Xt({});
533
538
  const l = A(f), T = A(o);
534
- return Ae(l, T, a);
539
+ return ve(l, T, a);
535
540
  }, t.addHook = function(f, o) {
536
- typeof o == "function" && nt(N[f], o);
541
+ typeof o == "function" && lt(w[f], o);
537
542
  }, t.removeHook = function(f, o) {
538
543
  if (o !== void 0) {
539
- const a = hn(N[f], o);
540
- return a === -1 ? void 0 : dn(N[f], a, 1)[0];
544
+ const a = xn(w[f], o);
545
+ return a === -1 ? void 0 : Pn(w[f], a, 1)[0];
541
546
  }
542
- return Ce(N[f]);
547
+ return $e(w[f]);
543
548
  }, t.removeHooks = function(f) {
544
- N[f] = [];
549
+ w[f] = [];
545
550
  }, t.removeAllHooks = function() {
546
- N = De();
551
+ w = Ve();
547
552
  }, t;
548
553
  }
549
- var Fe = ke();
550
- function Ie(s, t) {
551
- let e = s;
554
+ var tn = Qe();
555
+ function Xe(i, t) {
556
+ let e = i;
552
557
  for (const n of t.split("."))
553
558
  e = e[n];
554
559
  return e;
555
560
  }
556
- function In(s, t, e) {
557
- const n = t.split("."), i = n.length - 1;
558
- let r = s;
559
- n.forEach((c, h) => {
560
- h === i ? r[c] = e : r = r[c];
561
+ function Jn(i, t, e) {
562
+ const n = t.split("."), s = n.length - 1;
563
+ let r = i;
564
+ n.forEach((c, u) => {
565
+ u === s ? r[c] = e : r = r[c];
561
566
  });
562
567
  }
563
- const Pn = /* @__PURE__ */ new Set([
568
+ function en(i, t, e = "") {
569
+ const n = /* @__PURE__ */ new WeakMap(), s = {
570
+ // Intercept property reads.
571
+ // This creates nested proxies lazily.
572
+ get(r, c) {
573
+ const u = Reflect.get(r, c);
574
+ if (u === null || typeof u != "object") return u;
575
+ const p = n.get(u);
576
+ if (p) return p;
577
+ const m = e ? `${e}.${c}` : c, h = en(u, t, m);
578
+ return n.set(u, h), h;
579
+ },
580
+ // Intercept property writes.
581
+ set(r, c, u) {
582
+ const p = Reflect.get(r, c);
583
+ if (p !== u) {
584
+ Reflect.set(r, c, u);
585
+ const m = e ? `${e}.${c}` : c;
586
+ t(m, p, u);
587
+ }
588
+ return !0;
589
+ }
590
+ };
591
+ return new Proxy(i, s);
592
+ }
593
+ function nn(i) {
594
+ const t = {};
595
+ for (const [e, n] of Object.entries(i)) {
596
+ const s = typeof n == "object" && n !== null;
597
+ t[e] = s ? nn(n) : n;
598
+ }
599
+ return t;
600
+ }
601
+ const Mt = typeof window < "u" && typeof window.document < "u";
602
+ let qe = class extends Error {
603
+ };
604
+ var q, vt, U, Tt, gt, Y, xt, on;
605
+ const st = class st {
606
+ constructor(t, e, n) {
607
+ j(this, xt);
608
+ j(this, vt, /* @__PURE__ */ Symbol("objectId"));
609
+ // This cannot be replaced by a WeakMap<ChangeListener, Set<string>>
610
+ // because there is no way to iterate over the keys of a WeakMap.
611
+ j(this, U, []);
612
+ j(this, Tt);
613
+ j(this, gt);
614
+ j(this, Y);
615
+ if (!t) throw new qe("name cannot be empty");
616
+ if (R(st, q).has(t))
617
+ throw new qe(`WrecState with name "${t}" already exists`);
618
+ if (ot(this, Tt, t), ot(this, gt, e), ot(this, Y, en({}, He(this, xt, on).bind(this))), e && Mt) {
619
+ const s = sessionStorage.getItem("wrec-state-" + t), r = s ? JSON.parse(s) : void 0;
620
+ r && (n = r);
621
+ }
622
+ if (n)
623
+ for (const [s, r] of Object.entries(n))
624
+ this.addProperty(s, r);
625
+ R(st, q).set(t, this);
626
+ }
627
+ // This static method is useful for accessing a specific WrecState object
628
+ // from the DevTools console. For example:
629
+ // state = WrecState.get('vault');
630
+ //
631
+ // WrecState object properties are accessed via nested Proxy objects
632
+ // so all changes can be monitored.
633
+ //
634
+ // Properties can be directly modified as follows:
635
+ // state.color = 'blue';
636
+ // state.team.leader.name = 'Mark';
637
+ static get(t) {
638
+ return R(this, q).get(t);
639
+ }
640
+ /**
641
+ * @param listener - object that has a "changed" method
642
+ * @param map - map from state property paths to component properties
643
+ */
644
+ addListener(t, e = {}) {
645
+ const n = R(this, U).find(
646
+ (s) => s.listenerRef.deref() === t
647
+ );
648
+ if (n) {
649
+ const { propertyMap: s } = n;
650
+ for (const [r, c] of Object.entries(e))
651
+ s[r] = c;
652
+ } else
653
+ R(this, U).push({
654
+ listenerRef: new WeakRef(t),
655
+ propertyMap: e
656
+ });
657
+ }
658
+ addProperty(t, e) {
659
+ Object.defineProperty(this, t, {
660
+ enumerable: !0,
661
+ get() {
662
+ return R(this, Y)[t];
663
+ },
664
+ set(n) {
665
+ R(this, Y)[t] = n;
666
+ }
667
+ }), R(this, Y)[t] = e;
668
+ }
669
+ get id() {
670
+ return R(this, vt);
671
+ }
672
+ // This is useful for debugging from the DevTools console.
673
+ // For example: state.log()
674
+ log() {
675
+ console.log("WrecState:", R(this, Tt));
676
+ for (const [t, e] of Object.entries(R(this, Y)))
677
+ console.log(` ${t} = ${JSON.stringify(e)}`);
678
+ }
679
+ removeListener(t) {
680
+ ot(this, U, R(this, U).filter((e) => e.listenerRef.deref() !== t));
681
+ }
682
+ };
683
+ q = new WeakMap(), vt = new WeakMap(), U = new WeakMap(), Tt = new WeakMap(), gt = new WeakMap(), Y = new WeakMap(), xt = new WeakSet(), on = function(t, e, n) {
684
+ const s = /* @__PURE__ */ new Set();
685
+ for (const r of R(this, U)) {
686
+ const c = r.listenerRef.deref();
687
+ if (!c)
688
+ s.add(r);
689
+ else if (Mt && c instanceof HTMLElement && !c.isConnected)
690
+ s.add(r);
691
+ else {
692
+ const { propertyMap: u } = r, p = Object.keys(u);
693
+ (p.length === 0 || p.includes(t)) && c.changed(
694
+ t,
695
+ u[t],
696
+ n,
697
+ e,
698
+ this
699
+ );
700
+ }
701
+ }
702
+ ot(this, U, R(this, U).filter(
703
+ (r) => !s.has(r)
704
+ ));
705
+ }, j(st, q, /* @__PURE__ */ new Map()), Mt && window.addEventListener("beforeunload", () => {
706
+ for (const [t, e] of R(st, q).entries())
707
+ if (R(e, gt)) {
708
+ const n = nn(e);
709
+ sessionStorage.setItem("wrec-state-" + t, JSON.stringify(n));
710
+ }
711
+ });
712
+ let ue = st;
713
+ Mt && process.env.NODE_ENV === "development" && (window.WrecState = ue);
714
+ const Qn = /* @__PURE__ */ new Set([
564
715
  "onblur",
565
716
  "onchange",
566
717
  "onclick",
@@ -570,102 +721,102 @@ const Pn = /* @__PURE__ */ new Set([
570
721
  "onreset",
571
722
  "onsubmit"
572
723
  ]);
573
- Fe.addHook("uponSanitizeAttribute", (s, t) => {
724
+ tn.addHook("uponSanitizeAttribute", (i, t) => {
574
725
  const { attrName: e } = t, n = e.toLowerCase();
575
- Pn.has(n) && (t.forceKeepAttr = !0);
726
+ Qn.has(n) && (t.forceKeepAttr = !0);
576
727
  });
577
- class bt extends Error {
728
+ class Dt extends Error {
578
729
  }
579
- const vn = /([a-zA-Z-]+)\s*:\s*([^;}]+)/g, Ue = "a-zA-Z_$", xn = Ue + "0-9", ct = `[${Ue}][${xn}]*`, kn = /<!--\s*(.*?)\s*-->/, Fn = /<(\w+)(?:\s[^>]*)?>((?:[^<]|<(?!\w))*?)<\/\1>/g, jt = new RegExp(`^this\\.${ct}$`), Yt = new RegExp(`this\\.${ct}(\\.${ct})*`, "g"), He = new RegExp(`this\\.${ct}(\\.${ct})*`), Un = /* @__PURE__ */ new Set(["class", "style"]), ze = 5;
580
- function Hn(s) {
581
- return s instanceof HTMLButtonElement || s instanceof HTMLFieldSetElement || s instanceof HTMLInputElement || s instanceof HTMLSelectElement || s instanceof HTMLTextAreaElement || s instanceof D;
730
+ const to = /([a-zA-Z-]+)\s*:\s*([^;}]+)/g, sn = "a-zA-Z_$", eo = sn + "0-9", dt = `[${sn}][${eo}]*`, no = /<!--\s*(.*?)\s*-->/, oo = /<(\w+)(?:\s[^>]*)?>((?:[^<]|<(?!\w))*?)<\/\1>/g, se = new RegExp(`^this\\.${dt}$`), ie = new RegExp(`this\\.${dt}(\\.${dt})*`, "g"), rn = new RegExp(`this\\.${dt}(\\.${dt})*`), so = /* @__PURE__ */ new Set(["class", "style"]), an = 5;
731
+ function io(i) {
732
+ return i instanceof HTMLButtonElement || i instanceof HTMLFieldSetElement || i instanceof HTMLInputElement || i instanceof HTMLSelectElement || i instanceof HTMLTextAreaElement || i instanceof I;
582
733
  }
583
- function Wn(s, t, e) {
584
- const n = document.createElement(s);
734
+ function po(i, t, e) {
735
+ const n = document.createElement(i);
585
736
  if (t)
586
- for (const [i, r] of Object.entries(t))
587
- n.setAttribute(i, r);
737
+ for (const [s, r] of Object.entries(t))
738
+ n.setAttribute(s, r);
588
739
  return e && (n.innerHTML = e), n;
589
740
  }
590
- const zn = (s) => s === String ? "" : s === Number ? 0 : s === Boolean ? !1 : s === Array ? [] : s === Object ? {} : void 0;
591
- function St(s) {
741
+ const ro = (i) => i === String ? "" : i === Number ? 0 : i === Boolean ? !1 : i === Array ? [] : i === Object ? {} : void 0;
742
+ function It(i) {
592
743
  const t = [];
593
- let e = s.firstElementChild;
744
+ let e = i.firstElementChild;
594
745
  for (; e; )
595
- t.push(e), e.shadowRoot && t.push(...St(e.shadowRoot)), e.firstElementChild && t.push(...St(e)), e = e.nextElementSibling;
746
+ t.push(e), e.shadowRoot && t.push(...It(e.shadowRoot)), e.firstElementChild && t.push(...It(e)), e = e.nextElementSibling;
596
747
  return t;
597
748
  }
598
- const At = (s) => s.substring(ze).split(".")[0];
599
- function Ge(s, t) {
600
- let e = s[0];
601
- return t.forEach((n, i) => {
602
- e += n + s[i + 1];
749
+ const Nt = (i) => i.substring(an).split(".")[0];
750
+ function cn(i, t) {
751
+ let e = i[0];
752
+ return t.forEach((n, s) => {
753
+ e += n + i[s + 1];
603
754
  }), e;
604
755
  }
605
- function Jt(s) {
606
- const t = typeof s;
756
+ function pe(i) {
757
+ const t = typeof i;
607
758
  return t === "string" || t === "number" || t === "boolean";
608
759
  }
609
- function at(s) {
610
- return s.localName === "textarea";
760
+ function ht(i) {
761
+ return i.localName === "textarea";
611
762
  }
612
- function Qt(s) {
613
- const { localName: t } = s;
763
+ function me(i) {
764
+ const { localName: t } = i;
614
765
  return t === "input" || t === "select";
615
766
  }
616
- const Gn = (s) => s.replace(/<!--[\s\S]*?-->/g, "");
617
- function $e(s, t, e, n) {
618
- return s.slice(0, t) + n + s.slice(t + e);
767
+ const ao = (i) => i.replace(/<!--[\s\S]*?-->/g, "");
768
+ function ln(i, t, e, n) {
769
+ return i.slice(0, t) + n + i.slice(t + e);
619
770
  }
620
- function $n(s) {
621
- let t = s.trim(), e = null;
771
+ function co(i) {
772
+ let t = i.trim(), e = null;
622
773
  /^\s*<tr[\s>]/i.test(t) ? (t = `<table><tbody>${t}</tbody></table>`, e = "tbody") : /^\s*<(td|th)[\s>]/i.test(t) ? (t = `<table><tbody><tr>${t}</tr></tbody></table>`, e = "tr") : /^\s*<option[\s>]/i.test(t) ? (t = `<select>${t}</select>`, e = "select") : /^\s*<col[\s>]/i.test(t) && (t = `<table><colgroup>${t}</colgroup></table>`, e = "colgroup");
623
- const n = Fe.sanitize(t, {
774
+ const n = tn.sanitize(t, {
624
775
  ADD_TAGS: ["#comment"],
625
776
  ALLOW_UNKNOWN_PROTOCOLS: !0,
626
777
  RETURN_DOM_FRAGMENT: !0
627
778
  });
628
779
  if (e) {
629
- const i = n.querySelector(e);
630
- if (i) return i.childNodes;
780
+ const s = n.querySelector(e);
781
+ if (s) return s.childNodes;
631
782
  }
632
783
  return n.childNodes;
633
784
  }
634
- function Vt(s) {
635
- const t = Number(s);
636
- if (isNaN(t)) throw new bt(`can't convert "${s}" to a number`);
785
+ function re(i) {
786
+ const t = Number(i);
787
+ if (isNaN(t)) throw new Dt(`can't convert "${i}" to a number`);
637
788
  return t;
638
789
  }
639
- function Be(s, t, e) {
640
- const [n, i] = t.split(":");
641
- if (Jt(e))
790
+ function fn(i, t, e) {
791
+ const [n, s] = t.split(":");
792
+ if (pe(e))
642
793
  if (typeof e == "boolean") {
643
- e ? s.setAttribute(n, n) : s.removeAttribute(n);
644
- const r = D.getPropName(n);
645
- s[r] = e;
794
+ e ? i.setAttribute(n, n) : i.removeAttribute(n);
795
+ const r = I.getPropName(n);
796
+ i[r] = e;
646
797
  } else {
647
- const r = s.getAttribute(t), c = String(e);
648
- r !== c && (s.setAttribute(n, c), n === "value" && Qt(s) && (s.value = c));
798
+ const r = i.getAttribute(t), c = String(e);
799
+ r !== c && (i.setAttribute(n, c), n === "value" && me(i) && (i.value = c));
649
800
  }
650
801
  else {
651
- const r = D.getPropName(t);
652
- s[r] = e;
802
+ const r = I.getPropName(t);
803
+ i[r] = e;
653
804
  }
654
805
  }
655
- function Xt(s, t, e) {
656
- const [n, i] = t.split(":");
657
- s instanceof CSSStyleRule ? s.style.setProperty(n, e) : (Be(s, n, e), n === "value" && Qt(s) && (s.value = e));
806
+ function ae(i, t, e) {
807
+ const [n, s] = t.split(":");
808
+ i instanceof CSSStyleRule ? i.style.setProperty(n, e) : (fn(i, n, e), n === "value" && me(i) && (i.value = e));
658
809
  }
659
- function Bn(s) {
810
+ function lo(i) {
660
811
  const t = /* @__PURE__ */ new Set();
661
- for (const n of St(s)) {
662
- const { localName: i } = n;
663
- i.includes("-") && t.add(i);
812
+ for (const n of It(i)) {
813
+ const { localName: s } = n;
814
+ s.includes("-") && t.add(s);
664
815
  }
665
816
  const e = [...t].map((n) => customElements.whenDefined(n));
666
817
  return Promise.all(e);
667
818
  }
668
- class D extends HTMLElement {
819
+ class I extends HTMLElement {
669
820
  // This is used to lookup the camelCase property name
670
821
  // that corresponds to a kebab-case attribute name.
671
822
  static #m = /* @__PURE__ */ new Map();
@@ -706,7 +857,7 @@ class D extends HTMLElement {
706
857
  // Each component instance needs its own map.
707
858
  #n = /* @__PURE__ */ new Map();
708
859
  #c = {};
709
- #i;
860
+ #s;
710
861
  // For components that set `formAssociated` to true,
711
862
  // this stores in the initial value of each property
712
863
  // in the formAssociatedCallback method
@@ -728,12 +879,12 @@ class D extends HTMLElement {
728
879
  }
729
880
  attributeChangedCallback(t, e, n) {
730
881
  t === "disabled" && this.#d();
731
- const i = D.getPropName(t);
732
- if (this.#s(i)) {
733
- const r = this.#b(i, String(n));
734
- this[i] = r;
735
- const c = this.#c[i];
736
- c && this.setFormValue(c, String(r)), this.propertyChangedCallback(i, e, n);
882
+ const s = I.getPropName(t);
883
+ if (this.#i(s)) {
884
+ const r = this.#b(s, String(n));
885
+ this[s] = r;
886
+ const c = this.#c[s];
887
+ c && this.setFormValue(c, String(r)), this.propertyChangedCallback(s, e, n);
737
888
  }
738
889
  }
739
890
  async #R() {
@@ -745,63 +896,63 @@ class D extends HTMLElement {
745
896
  :host([hidden]) { display: none; }`;
746
897
  t.css && (n += t.css), n += `</style>
747
898
  `;
748
- let i = t.html.trim();
749
- i.startsWith("<") || (i = `<span><!--${i}--></span>`), e.innerHTML = n + i;
899
+ let s = t.html.trim();
900
+ s.startsWith("<") || (s = `<span><!--${s}--></span>`), e.innerHTML = n + s;
750
901
  }
751
- await Bn(e), this.shadowRoot.replaceChildren(e.content.cloneNode(!0));
902
+ await lo(e), this.shadowRoot.replaceChildren(e.content.cloneNode(!0));
752
903
  }
753
904
  changed(t, e, n) {
754
905
  this[e] = n;
755
906
  }
756
907
  connectedCallback() {
757
- this.#x(), this.#N(), this.#R().then(() => {
908
+ this.#P(), this.#C(), this.#R().then(() => {
758
909
  this.hasAttribute("disabled") && this.#d(), requestAnimationFrame(() => {
759
- this.#y(this.shadowRoot), this.#T(this.shadowRoot), this.#C();
910
+ this.#y(this.shadowRoot), this.#T(this.shadowRoot), this.#O();
760
911
  });
761
912
  });
762
913
  }
763
- #C() {
914
+ #O() {
764
915
  const t = this.#t, { properties: e } = t;
765
- for (const [n, { computed: i }] of Object.entries(e))
766
- i && (this[n] = this.#o(i));
916
+ for (const [n, { computed: s }] of Object.entries(e))
917
+ s && (this[n] = this.#o(s));
767
918
  }
768
- #N() {
919
+ #C() {
769
920
  const t = this.#t, { observedAttributes: e, properties: n } = t;
770
- for (const [i, r] of Object.entries(n))
771
- this.#O(i, r, e);
921
+ for (const [s, r] of Object.entries(n))
922
+ this.#w(s, r, e);
772
923
  }
773
- #O(t, e, n) {
774
- const i = D.getAttrName(t), r = this.hasAttribute(i);
924
+ #w(t, e, n) {
925
+ const s = I.getAttrName(t), r = this.hasAttribute(s);
775
926
  e.required && !r && this.#e(this, t, "is a required attribute");
776
927
  let c = e.value;
777
928
  this.hasOwnProperty(t) && (c = this[t], delete this[t]);
778
- const { type: h } = e, u = h === Boolean ? c || r : n.includes(i) && r ? this.#_(t, i) : c || zn(h), p = "#" + t;
779
- this[p] = u, e.computed && this.#D(t, e), Object.defineProperty(this, t, {
929
+ const { type: u } = e, p = u === Boolean ? c || r : n.includes(s) && r ? this.#_(t, s) : c || ro(u), m = "#" + t;
930
+ this[m] = p, e.computed && this.#D(t, e), Object.defineProperty(this, t, {
780
931
  enumerable: !0,
781
932
  get() {
782
- return this[p];
933
+ return this[m];
783
934
  },
784
- set(d) {
785
- h === Number && typeof d == "string" && (d = Vt(d));
786
- const b = this[p];
787
- if (d === b) return;
788
- this.#F(t, h, d), this[p] = d;
789
- const { state: G, stateProp: F } = this.#t.properties[t];
790
- F && In(G, F, d), this.#P(t), this.#I(t, h, d, i), this.#A(t), this.#v(t, d);
791
- const $ = this.#c[t];
792
- $ && this.setFormValue($, String(d)), this.propertyChangedCallback(t, b, d), e.dispatch && this.dispatch("change", {
935
+ set(h) {
936
+ u === Number && typeof h == "string" && (h = re(h));
937
+ const b = this[m];
938
+ if (h === b) return;
939
+ this.#F(t, u, h), this[m] = h;
940
+ const { state: W, stateProp: H } = this.#t.properties[t];
941
+ H && Jn(W, H, h), this.#v(t), this.#I(t, u, h, s), this.#A(t), this.#x(t, h);
942
+ const B = this.#c[t];
943
+ B && this.setFormValue(B, String(h)), this.propertyChangedCallback(t, b, h), e.dispatch && this.dispatch("change", {
793
944
  tagName: this.localName,
794
945
  property: t,
795
946
  oldValue: b,
796
- value: d
947
+ value: h
797
948
  });
798
949
  }
799
950
  });
800
951
  }
801
952
  #d() {
802
- const t = this.hasAttribute("disabled"), e = St(this.shadowRoot);
953
+ const t = this.hasAttribute("disabled"), e = It(this.shadowRoot);
803
954
  for (const n of e)
804
- Hn(n) && (n.disabled = t);
955
+ io(n) && (n.disabled = t);
805
956
  }
806
957
  disconnectedCallback() {
807
958
  this.#n.clear(), this.#l.clear(), this.#u.clear();
@@ -825,54 +976,54 @@ class D extends HTMLElement {
825
976
  static elementName() {
826
977
  return this.name.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
827
978
  }
828
- #L(t) {
829
- const e = t instanceof D;
979
+ #N(t) {
980
+ const e = t instanceof I;
830
981
  for (const n of t.getAttributeNames()) {
831
- const i = t.getAttribute(n), r = this.#g(t, i);
982
+ const s = t.getAttribute(n), r = this.#E(t, s);
832
983
  if (r) {
833
984
  const c = this[r];
834
985
  c === void 0 && this.#a(t, n, r), t[r] = c;
835
- let [h, u] = n.split(":");
836
- h === "value" && (u ? (t["on" + u] === void 0 && this.#e(t, n, "refers to an unsupported event name"), t.setAttribute(h, this[r])) : u = "change"), e && t.#u.set(
837
- D.getPropName(h),
986
+ let [u, p] = n.split(":");
987
+ u === "value" && (p ? (t["on" + p] === void 0 && this.#e(t, n, "refers to an unsupported event name"), t.setAttribute(u, this[r])) : p = "change"), e && t.#u.set(
988
+ I.getPropName(u),
838
989
  r
839
990
  );
840
991
  }
841
- this.#r(i, t, n);
992
+ this.#r(s, t, n);
842
993
  }
843
994
  }
844
995
  #o(t) {
845
996
  const e = new Function("return " + t).call(this);
846
997
  return Array.isArray(e) ? e.join("") : e;
847
998
  }
848
- #M(t) {
999
+ #L(t) {
849
1000
  const { localName: e } = t;
850
1001
  if (e === "style") {
851
- const { sheet: n } = t, i = n?.cssRules ?? [], r = Array.from(i);
1002
+ const { sheet: n } = t, s = n?.cssRules ?? [], r = Array.from(s);
852
1003
  for (const c of r)
853
1004
  if (c.constructor === CSSStyleRule) {
854
- const h = Array.from(c.style);
855
- for (const u of h)
856
- if (u.startsWith("--")) {
857
- const p = c.style.getPropertyValue(u);
858
- this.#r(p, c, u);
1005
+ const u = Array.from(c.style);
1006
+ for (const p of u)
1007
+ if (p.startsWith("--")) {
1008
+ const m = c.style.getPropertyValue(p);
1009
+ this.#r(m, c, p);
859
1010
  }
860
1011
  }
861
1012
  } else {
862
1013
  let n = "";
863
- if (at(t)) {
1014
+ if (ht(t)) {
864
1015
  this.#r(t.textContent, t);
865
- const i = t.textContent?.match(kn);
866
- i && (n = i[1]);
1016
+ const s = t.textContent?.match(no);
1017
+ s && (n = s[1]);
867
1018
  } else {
868
- const i = Array.from(t.childNodes).find(
1019
+ const s = Array.from(t.childNodes).find(
869
1020
  (r) => r.nodeType === Node.COMMENT_NODE
870
1021
  );
871
- i && (n = i.textContent?.trim() ?? "");
1022
+ s && (n = s.textContent?.trim() ?? "");
872
1023
  }
873
1024
  if (n) {
874
- const i = this.#g(t, n);
875
- i && at(t) ? t.textContent = this[i] : this.#r(n, t);
1025
+ const s = this.#E(t, n);
1026
+ s && ht(t) ? t.textContent = this[s] : this.#r(n, t);
876
1027
  }
877
1028
  }
878
1029
  }
@@ -885,7 +1036,7 @@ class D extends HTMLElement {
885
1036
  if (!t) {
886
1037
  const c = this.getAttribute("name");
887
1038
  if (c)
888
- if (this.#s("value"))
1039
+ if (this.#i("value"))
889
1040
  t = `value:${c}`;
890
1041
  else
891
1042
  return;
@@ -894,84 +1045,84 @@ class D extends HTMLElement {
894
1045
  }
895
1046
  const e = {}, n = t.split(",");
896
1047
  for (const c of n) {
897
- const [h, u] = c.split(":");
898
- e[h.trim()] = u.trim();
1048
+ const [u, p] = c.split(":");
1049
+ e[u.trim()] = p.trim();
899
1050
  }
900
- this.#c = e, this.#i = new FormData(), this.#f = this.attachInternals(), this.#f.setFormValue(this.#i);
901
- const i = Object.keys(this.#t.properties), r = this.#l;
902
- for (const c of i)
1051
+ this.#c = e, this.#s = new FormData(), this.#f = this.attachInternals(), this.#f.setFormValue(this.#s);
1052
+ const s = Object.keys(this.#t.properties), r = this.#l;
1053
+ for (const c of s)
903
1054
  r[c] = this[c];
904
1055
  }
905
1056
  formResetCallback() {
906
1057
  const t = this.#l;
907
1058
  for (const e of Object.keys(t)) {
908
1059
  let n = t[e];
909
- jt.test(n) && (n = this.#o(n)), this[e] = n;
1060
+ se.test(n) && (n = this.#o(n)), this[e] = n;
910
1061
  }
911
1062
  }
912
1063
  static getAttrName(t) {
913
- let e = D.#h.get(t);
914
- return e || (e = t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), D.#h.set(t, e)), e;
1064
+ let e = I.#h.get(t);
1065
+ return e || (e = t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), I.#h.set(t, e)), e;
915
1066
  }
916
1067
  static getPropName(t) {
917
- let e = D.#m.get(t);
918
- return e || (e = t.replace(/-([a-z])/g, (n, i) => i.toUpperCase()), D.#m.set(t, e)), e;
1068
+ let e = I.#m.get(t);
1069
+ return e || (e = t.replace(/-([a-z])/g, (n, s) => s.toUpperCase()), I.#m.set(t, e)), e;
919
1070
  }
920
- #w(t, e, n) {
1071
+ #M(t, e, n) {
921
1072
  if (n.length !== 1) return;
922
- const [i] = n;
923
- if (!jt.test(i)) return;
924
- const r = Qt(t) || at(t);
925
- let [c, h] = (e ?? "").split(":");
926
- if (!(r && c === "value" || at(t))) return;
927
- h ? t["on" + h] === void 0 && this.#e(t, e, "refers to an unsupported event name") : h = "change";
928
- const p = At(i);
929
- t.addEventListener(h, (d) => {
930
- const { target: b } = d;
1073
+ const [s] = n;
1074
+ if (!se.test(s)) return;
1075
+ const r = me(t) || ht(t);
1076
+ let [c, u] = (e ?? "").split(":");
1077
+ if (!(r && c === "value" || ht(t))) return;
1078
+ u ? t["on" + u] === void 0 && this.#e(t, e, "refers to an unsupported event name") : u = "change";
1079
+ const m = Nt(s);
1080
+ t.addEventListener(u, (h) => {
1081
+ const { target: b } = h;
931
1082
  if (!b) return;
932
- const G = b.value, { type: F } = this.#t.properties[p];
933
- this[p] = F === Number ? Vt(G) : G, this.#A(p);
1083
+ const W = b.value, { type: H } = this.#t.properties[m];
1084
+ this[m] = H === Number ? re(W) : W, this.#A(m);
934
1085
  });
935
1086
  }
936
- #s(t) {
1087
+ #i(t) {
937
1088
  return !!this.#t.properties[t];
938
1089
  }
939
1090
  #T(t) {
940
1091
  const e = Array.from(t.querySelectorAll("*"));
941
1092
  for (const n of e)
942
- this.#L(n), n.firstElementChild || this.#M(n);
1093
+ this.#N(n), n.firstElementChild || this.#L(n);
943
1094
  }
944
1095
  // formAssociated is only needed when the component is inside a form.
945
- #E() {
1096
+ #g() {
946
1097
  if (this.#t.formAssociated || this.closest("form") === null) return;
947
1098
  const t = this.#t.name;
948
- throw new bt(
1099
+ throw new Dt(
949
1100
  `inside form, class ${t} requires "static formAssociated = true;"`
950
1101
  );
951
1102
  }
952
1103
  static get observedAttributes() {
953
- const t = Object.keys(this.properties || {}).map(D.getAttrName);
1104
+ const t = Object.keys(this.properties || {}).map(I.getAttrName);
954
1105
  return t.includes("disabled") || t.push("disabled"), t;
955
1106
  }
956
1107
  // Subclasses can override this to add functionality.
957
1108
  propertyChangedCallback(t, e, n) {
958
1109
  }
959
- #g(t, e) {
960
- if (!e || !jt.test(e)) return;
961
- const n = At(e);
1110
+ #E(t, e) {
1111
+ if (!e || !se.test(e)) return;
1112
+ const n = Nt(e);
962
1113
  return this[n] === void 0 && this.#a(t, "", n), n;
963
1114
  }
964
1115
  #A(t) {
965
- const i = this.#t.propToExprsMap.get(t) || [];
966
- for (const r of i) {
1116
+ const s = this.#t.propToExprsMap.get(t) || [];
1117
+ for (const r of s) {
967
1118
  let c = this.#o(r);
968
- const h = this.#n.get(r) ?? [];
969
- for (const u of h)
970
- if (u instanceof HTMLElement)
971
- this.#S(u, c);
972
- else if (!(u instanceof CSSStyleRule)) {
973
- const { element: p, attrName: d } = u;
974
- p instanceof CSSStyleRule ? p.style.setProperty(d, c) : Xt(p, d, c);
1119
+ const u = this.#n.get(r) ?? [];
1120
+ for (const p of u)
1121
+ if (p instanceof HTMLElement)
1122
+ this.#S(p, c);
1123
+ else if (!(p instanceof CSSStyleRule)) {
1124
+ const { element: m, attrName: h } = p;
1125
+ m instanceof CSSStyleRule ? m.style.setProperty(h, c) : ae(m, h, c);
975
1126
  }
976
1127
  }
977
1128
  }
@@ -980,50 +1131,50 @@ class D extends HTMLElement {
980
1131
  customElements.get(t) || customElements.define(t, this);
981
1132
  }
982
1133
  #D(t, e) {
983
- const { computed: n, uses: i } = e, r = this.#t.propToComputedMap;
984
- function c(u, p) {
985
- let d = r.get(u);
986
- d || (d = [], r.set(u, d)), d.push([t, p]);
1134
+ const { computed: n, uses: s } = e, r = this.#t.propToComputedMap;
1135
+ function c(p, m) {
1136
+ let h = r.get(p);
1137
+ h || (h = [], r.set(p, h)), h.push([t, m]);
987
1138
  }
988
- const h = n.match(Yt) || [];
989
- for (const u of h) {
990
- const p = u.substring(ze);
991
- this[p] === void 0 && this.#a(null, t, p), typeof this[p] != "function" && c(p, n);
1139
+ const u = n.match(ie) || [];
1140
+ for (const p of u) {
1141
+ const m = p.substring(an);
1142
+ this[m] === void 0 && this.#a(null, t, m), typeof this[m] != "function" && c(m, n);
992
1143
  }
993
- if (i)
994
- for (const u of i.split(","))
995
- c(u, n);
1144
+ if (s)
1145
+ for (const p of s.split(","))
1146
+ c(p, n);
996
1147
  }
997
1148
  // WARNING: Do not place untrusted JavaScript expressions
998
1149
  // in attribute values or the text content of elements!
999
1150
  #r(t, e, n = void 0) {
1000
1151
  if (!t) return;
1001
- const i = this.#p(e, n, t);
1002
- if (!i) {
1003
- const u = t.replaceAll("this..", "this.");
1004
- n ? Xt(e, n, u) : "textContent" in e && (e.textContent = u);
1152
+ const s = this.#p(e, n, t);
1153
+ if (!s) {
1154
+ const p = t.replaceAll("this..", "this.");
1155
+ n ? ae(e, n, p) : "textContent" in e && (e.textContent = p);
1005
1156
  return;
1006
1157
  }
1007
1158
  const r = this.#t;
1008
- i.forEach((u) => {
1009
- const p = At(u);
1010
- if (typeof this[p] == "function") return;
1011
- const d = r.propToExprsMap;
1012
- let b = d.get(p);
1013
- b || (b = [], d.set(p, b)), b.includes(t) || b.push(t);
1159
+ s.forEach((p) => {
1160
+ const m = Nt(p);
1161
+ if (typeof this[m] == "function") return;
1162
+ const h = r.propToExprsMap;
1163
+ let b = h.get(m);
1164
+ b || (b = [], h.set(m, b)), b.includes(t) || b.push(t);
1014
1165
  });
1015
- for (const [u, p] of this.#n.entries())
1016
- for (const d of p) {
1017
- const b = d instanceof HTMLElement || d instanceof CSSStyleRule ? d : d.element;
1166
+ for (const [p, m] of this.#n.entries())
1167
+ for (const h of m) {
1168
+ const b = h instanceof HTMLElement || h instanceof CSSStyleRule ? h : h.element;
1018
1169
  b instanceof CSSStyleRule || b.isConnected || this.#n.set(
1019
- u,
1020
- p.filter((G) => G !== d)
1170
+ p,
1171
+ m.filter((W) => W !== h)
1021
1172
  );
1022
1173
  }
1023
1174
  let c = this.#n.get(t);
1024
- c || (c = [], this.#n.set(t, c)), c.push(n ? { element: e, attrName: n } : e), e instanceof HTMLElement && this.#w(e, n, i);
1025
- const h = this.#o(t);
1026
- n ? Xt(e, n, h) : this.#S(e, h);
1175
+ c || (c = [], this.#n.set(t, c)), c.push(n ? { element: e, attrName: n } : e), e instanceof HTMLElement && this.#M(e, n, s);
1176
+ const u = this.#o(t);
1177
+ n ? ae(e, n, u) : this.#S(e, u);
1027
1178
  }
1028
1179
  // This follows the best practice
1029
1180
  // "Do not override author-set, global attributes."
@@ -1031,12 +1182,12 @@ class D extends HTMLElement {
1031
1182
  this.hasAttribute(t) || this.setAttribute(t, e);
1032
1183
  }
1033
1184
  setFormValue(t, e) {
1034
- !this.#i || !Jt(e) || (this.#i.set(t, e), this.#f?.setFormValue(this.#i));
1185
+ !this.#s || !pe(e) || (this.#s.set(t, e), this.#f?.setFormValue(this.#s));
1035
1186
  }
1036
1187
  #e(t, e, n) {
1037
- const i = this.#t, r = t instanceof HTMLElement ? t.localName : "CSS rule";
1038
- throw new bt(
1039
- `component ${i.elementName()}` + (t ? `, element "${r}"` : "") + (e ? `, attribute "${e}"` : "") + ` ${n}`
1188
+ const s = this.#t, r = t instanceof HTMLElement ? t.localName : "CSS rule";
1189
+ throw new Dt(
1190
+ `component ${s.elementName()}` + (t ? `, element "${r}"` : "") + (e ? `, attribute "${e}"` : "") + ` ${n}`
1040
1191
  );
1041
1192
  }
1042
1193
  #a(t, e, n) {
@@ -1046,11 +1197,11 @@ class D extends HTMLElement {
1046
1197
  return this.#b(t, this.getAttribute(e));
1047
1198
  }
1048
1199
  #b(t, e) {
1049
- if (e?.match(Yt)) return e;
1050
- const n = this.#t, { type: i } = n.properties[t];
1051
- if (i || this.#e(null, t, "does not specify its type"), i === String) return e;
1052
- if (i === Number) return Vt(e);
1053
- if (i === Boolean)
1200
+ if (e?.match(ie)) return e;
1201
+ const n = this.#t, { type: s } = n.properties[t];
1202
+ if (s || this.#e(null, t, "does not specify its type"), s === String) return e;
1203
+ if (s === Number) return re(e);
1204
+ if (s === Boolean)
1054
1205
  return e === "true" ? !0 : e === "false" || e === "null" ? !1 : (e && e !== t && this.#e(
1055
1206
  null,
1056
1207
  t,
@@ -1059,41 +1210,41 @@ class D extends HTMLElement {
1059
1210
  }
1060
1211
  // Updates the matching attribute for a property if there is one.
1061
1212
  // VS Code thinks this is never called, but it is called by #defineProp.
1062
- #I(t, e, n, i) {
1063
- if (Jt(n) && this.hasAttribute(i)) {
1064
- const r = e === Boolean ? this.hasAttribute(i) : this.#_(t, i);
1065
- n !== r && Be(this, t, n);
1213
+ #I(t, e, n, s) {
1214
+ if (pe(n) && this.hasAttribute(s)) {
1215
+ const r = e === Boolean ? this.hasAttribute(s) : this.#_(t, s);
1216
+ n !== r && fn(this, t, n);
1066
1217
  }
1067
1218
  }
1068
1219
  // Updates all computed properties that reference this property.
1069
1220
  // VS Code thinks this is never called, but it is called by #defineProp.
1070
- #P(t) {
1221
+ #v(t) {
1071
1222
  const n = this.#t.propToComputedMap.get(t) || [];
1072
- for (const [i, r] of n)
1073
- this[i] = this.#o(r);
1223
+ for (const [s, r] of n)
1224
+ this[s] = this.#o(r);
1074
1225
  }
1075
1226
  #S(t, e) {
1076
1227
  if (e === void 0) return;
1077
- const n = t instanceof HTMLElement, i = typeof e;
1078
- if (i !== "string" && i !== "number" && this.#e(
1228
+ const n = t instanceof HTMLElement, s = typeof e;
1229
+ if (s !== "string" && s !== "number" && this.#e(
1079
1230
  t,
1080
1231
  void 0,
1081
1232
  " computed content is not a string or number"
1082
- ), t instanceof HTMLElement && at(t))
1233
+ ), t instanceof HTMLElement && ht(t))
1083
1234
  t.value = e;
1084
- else if (n && i === "string" && e.trim().startsWith("<")) {
1085
- const r = $n(e);
1235
+ else if (n && s === "string" && e.trim().startsWith("<")) {
1236
+ const r = co(e);
1086
1237
  t.replaceChildren(...r), this.#y(t), this.#T(t);
1087
1238
  } else n && (t.textContent = e);
1088
1239
  }
1089
1240
  // Update corresponding parent web component property if bound to one.
1090
1241
  // VS Code thinks this is never called, but it is called by #defineProp.
1091
- #v(t, e) {
1242
+ #x(t, e) {
1092
1243
  const n = this.#u.get(t);
1093
1244
  if (!n) return;
1094
- const i = this.getRootNode();
1095
- if (!(i instanceof ShadowRoot)) return;
1096
- const { host: r } = i;
1245
+ const s = this.getRootNode();
1246
+ if (!(s instanceof ShadowRoot)) return;
1247
+ const { host: r } = s;
1097
1248
  if (!r) return;
1098
1249
  const c = r;
1099
1250
  c[n] = e;
@@ -1110,19 +1261,19 @@ class D extends HTMLElement {
1110
1261
  e[n] = n;
1111
1262
  }
1112
1263
  this.#k(t, e);
1113
- for (const [n, i] of Object.entries(e))
1114
- if (this.#s(i)) {
1115
- const r = Ie(t, n);
1116
- r !== void 0 && (this[i] = r);
1117
- const c = this.#t.properties[i];
1264
+ for (const [n, s] of Object.entries(e))
1265
+ if (this.#i(s)) {
1266
+ const r = Xe(t, n);
1267
+ r !== void 0 && (this[s] = r);
1268
+ const c = this.#t.properties[s];
1118
1269
  c.state = t, c.stateProp = n;
1119
1270
  }
1120
1271
  t.addListener(this, e);
1121
1272
  }
1122
- #x() {
1273
+ #P() {
1123
1274
  const t = this.#t, e = new Set(Object.keys(t.properties));
1124
1275
  for (const n of e)
1125
- Un.has(n) && this.#e(
1276
+ so.has(n) && this.#e(
1126
1277
  null,
1127
1278
  "",
1128
1279
  `property "${n}" is not allowed because it is a reserved attribute`
@@ -1130,12 +1281,12 @@ class D extends HTMLElement {
1130
1281
  for (const n of this.getAttributeNames())
1131
1282
  if (n !== "class" && n !== "id" && n !== "disabled" && !n.startsWith("on")) {
1132
1283
  if (n === "form-assoc") {
1133
- this.#E();
1284
+ this.#g();
1134
1285
  continue;
1135
1286
  }
1136
- if (!e.has(D.getPropName(n))) {
1287
+ if (!e.has(I.getPropName(n))) {
1137
1288
  if (n === "name") {
1138
- this.#E();
1289
+ this.#g();
1139
1290
  continue;
1140
1291
  }
1141
1292
  this.#e(null, n, "is not a supported attribute");
@@ -1143,21 +1294,21 @@ class D extends HTMLElement {
1143
1294
  }
1144
1295
  }
1145
1296
  #p(t, e, n) {
1146
- const i = n.match(Yt);
1147
- if (i)
1148
- return i.forEach((r) => {
1149
- const c = At(r);
1297
+ const s = n.match(ie);
1298
+ if (s)
1299
+ return s.forEach((r) => {
1300
+ const c = Nt(r);
1150
1301
  this[c] === void 0 && this.#a(t, e, c);
1151
- }), i;
1302
+ }), s;
1152
1303
  }
1153
1304
  #k(t, e) {
1154
- for (const [n, i] of Object.entries(e)) {
1155
- let r = Ie(t, n);
1305
+ for (const [n, s] of Object.entries(e)) {
1306
+ let r = Xe(t, n);
1156
1307
  if (r === void 0)
1157
- throw new bt(`invalid state path "${n}"`);
1158
- r = this[i], this.#s(i) || this.#e(
1308
+ throw new Dt(`invalid state path "${n}"`);
1309
+ r = this[s], this.#i(s) || this.#e(
1159
1310
  null,
1160
- i,
1311
+ s,
1161
1312
  "refers to missing property in useState map"
1162
1313
  );
1163
1314
  }
@@ -1166,74 +1317,75 @@ class D extends HTMLElement {
1166
1317
  // This is called by #defineProp.
1167
1318
  #F(t, e, n) {
1168
1319
  if (n instanceof e) return;
1169
- let i = typeof n;
1170
- if (i === "object") {
1320
+ let s = typeof n;
1321
+ if (s === "object") {
1171
1322
  const { constructor: r } = n;
1172
- i = r.name, r !== e && this.#e(
1323
+ s = r.name, r !== e && this.#e(
1173
1324
  null,
1174
1325
  t,
1175
- `was set to a ${i}, but must be a ${e.name}`
1326
+ `was set to a ${s}, but must be a ${e.name}`
1176
1327
  );
1177
1328
  }
1178
- i !== e.name.toLowerCase() && this.#e(
1329
+ s !== e.name.toLowerCase() && this.#e(
1179
1330
  null,
1180
1331
  t,
1181
- `was set to a ${i}, but must be a ${e.name}`
1332
+ `was set to a ${s}, but must be a ${e.name}`
1182
1333
  );
1183
1334
  }
1184
1335
  #y(t) {
1185
1336
  const e = Array.from(t.querySelectorAll("*"));
1186
1337
  for (const n of e) {
1187
- const i = [];
1338
+ const s = [];
1188
1339
  for (const r of Array.from(n.attributes)) {
1189
1340
  const c = r.name;
1190
1341
  if (c.startsWith("on")) {
1191
- let h = c.slice(2);
1192
- h = h[0].toLowerCase() + h.slice(1).toLowerCase();
1193
- const u = r.value;
1194
- this.#p(n, c, u);
1195
- let p;
1196
- typeof this[u] == "function" ? p = (d) => this[u](d) : (this.#p(n, c, u), p = () => this.#o(u)), n.addEventListener(h, p), i.push(c);
1342
+ let u = c.slice(2);
1343
+ u = u[0].toLowerCase() + u.slice(1).toLowerCase();
1344
+ const p = r.value;
1345
+ this.#p(n, c, p);
1346
+ let m;
1347
+ typeof this[p] == "function" ? m = (h) => this[p](h) : (this.#p(n, c, p), m = () => this.#o(p)), n.addEventListener(u, m), s.push(c);
1197
1348
  }
1198
1349
  }
1199
- for (const r of i)
1350
+ for (const r of s)
1200
1351
  n.removeAttribute(r);
1201
1352
  }
1202
1353
  }
1203
1354
  }
1204
- function jn(s, ...t) {
1205
- let e = Ge(s, t);
1355
+ function mo(i, ...t) {
1356
+ let e = cn(i, t);
1206
1357
  for (; ; ) {
1207
- const n = vn.exec(e);
1358
+ const n = to.exec(e);
1208
1359
  if (!n) break;
1209
- const i = n[2];
1210
- if (He.test(i)) {
1360
+ const s = n[2];
1361
+ if (rn.test(s)) {
1211
1362
  const r = n[1];
1212
1363
  if (!r.startsWith("--")) {
1213
- const c = `--${r}: ${i};
1364
+ const c = `--${r}: ${s};
1214
1365
  ${r}: var(--${r})`;
1215
- e = $e(e, n.index, n[0].length, c);
1366
+ e = ln(e, n.index, n[0].length, c);
1216
1367
  }
1217
1368
  }
1218
1369
  }
1219
1370
  return e;
1220
1371
  }
1221
- function Yn(s, ...t) {
1222
- let e = Ge(s, t);
1372
+ function ho(i, ...t) {
1373
+ let e = cn(i, t);
1223
1374
  for (; ; ) {
1224
- const n = Fn.exec(e);
1375
+ const n = oo.exec(e);
1225
1376
  if (!n || n[1] === "style") break;
1226
- const i = Gn(n[2]);
1227
- if (He.test(i)) {
1228
- const r = `<!-- ${i.trim()} -->`, c = n.index + n[0].indexOf(">") + 1;
1229
- e = $e(e, c, i.length, r);
1377
+ const s = ao(n[2]);
1378
+ if (rn.test(s)) {
1379
+ const r = `<!-- ${s.trim()} -->`, c = n.index + n[0].indexOf(">") + 1;
1380
+ e = ln(e, c, s.length, r);
1230
1381
  }
1231
1382
  }
1232
1383
  return e;
1233
1384
  }
1234
1385
  export {
1235
- D as Wrec,
1236
- Wn as createElement,
1237
- jn as css,
1238
- Yn as html
1386
+ I as Wrec,
1387
+ ue as WrecState,
1388
+ po as createElement,
1389
+ mo as css,
1390
+ ho as html
1239
1391
  };