@cobwds/cob-button 1.19.4 → 1.23.1
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/cob-button.d.ts +338 -0
- package/dist/cob-button.figma.d.ts +1 -0
- package/dist/cob-button.js +249 -1133
- package/dist/cob-button.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/package.json +5 -4
- package/dist/cob-icon.library-BR0WCz7Q-CwcFQs-u.js +0 -710
- package/dist/cob-icon.library-BR0WCz7Q-CwcFQs-u.js.map +0 -1
package/dist/cob-button.js
CHANGED
|
@@ -1,1055 +1,176 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { property as
|
|
3
|
-
import { ifDefined as
|
|
1
|
+
import { LitElement as p, unsafeCSS as g, html as n } from "lit";
|
|
2
|
+
import { property as c, state as v } from "lit/decorators.js";
|
|
3
|
+
import { ifDefined as i } from "lit/directives/if-defined.js";
|
|
4
|
+
import "@cobwds/cob-icon";
|
|
4
5
|
/*!
|
|
5
6
|
* █▄ █ █ █ █▀▀▀█ █▀▀▄ █▀▀▀█
|
|
6
7
|
* █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
|
|
7
8
|
* █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
|
|
8
9
|
*
|
|
9
|
-
* Button Component v1.
|
|
10
|
+
* Button Component v1.23.1
|
|
10
11
|
* Part of the City of Boston Web Design System
|
|
11
12
|
* Repository: https://github.com/CityOfBoston/nywds-poc
|
|
12
13
|
* License: MIT
|
|
13
14
|
*/
|
|
14
15
|
/*!
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* Icon Component v1.19.4
|
|
20
|
-
* Part of the City of Boston Web Design System
|
|
21
|
-
* Repository: https://github.com/CityOfBoston/nywds-poc
|
|
22
|
-
* License: MIT
|
|
16
|
+
* City of Boston Web Design System v1.23.1
|
|
17
|
+
* Description: A web design system for the City of Boston's digital products.
|
|
18
|
+
* Repository: https://github.com/CityOfBoston/nywds-poc
|
|
19
|
+
* License: MIT
|
|
23
20
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return Yo || (qo ??= import("./cob-icon.library-BR0WCz7Q-CwcFQs-u.js").then(
|
|
28
|
-
(o) => Yo = o.default
|
|
29
|
-
), qo);
|
|
21
|
+
let x = 0;
|
|
22
|
+
function k(a) {
|
|
23
|
+
return `${a}-${Date.now()}-${x++}`;
|
|
30
24
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
globalThis.__nysIconDefaultRegistered = !0, uo.set("default", {
|
|
37
|
-
resolver: async (o) => {
|
|
38
|
-
if (!o) return;
|
|
39
|
-
const e = (await qe())[o];
|
|
40
|
-
return e ? { type: "svg", content: e } : void 0;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
25
|
+
function y(a, o, e) {
|
|
26
|
+
a.dispatchEvent(
|
|
27
|
+
new CustomEvent(o, { detail: e, bubbles: !0, composed: !0 })
|
|
28
|
+
);
|
|
43
29
|
}
|
|
44
|
-
function
|
|
45
|
-
|
|
30
|
+
function _(a, o) {
|
|
31
|
+
a.dispatchEvent(
|
|
32
|
+
new Event(`cob-${o}`, { bubbles: !0, composed: !0 })
|
|
33
|
+
);
|
|
46
34
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
Lt.get(o)?.delete(e);
|
|
52
|
-
}
|
|
53
|
-
/*! @license DOMPurify 3.4.11 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.11/LICENSE */
|
|
54
|
-
function Vo(o, e) {
|
|
55
|
-
(e == null || e > o.length) && (e = o.length);
|
|
56
|
-
for (var c = 0, i = Array(e); c < e; c++) i[c] = o[c];
|
|
57
|
-
return i;
|
|
58
|
-
}
|
|
59
|
-
function Ve(o) {
|
|
60
|
-
if (Array.isArray(o)) return o;
|
|
61
|
-
}
|
|
62
|
-
function Ze(o, e) {
|
|
63
|
-
var c = o == null ? null : typeof Symbol < "u" && o[Symbol.iterator] || o["@@iterator"];
|
|
64
|
-
if (c != null) {
|
|
65
|
-
var i, l, u, A, ut = [], D = !0, Pt = !1;
|
|
66
|
-
try {
|
|
67
|
-
if (u = (c = c.call(o)).next, e !== 0) for (; !(D = (i = u.call(c)).done) && (ut.push(i.value), ut.length !== e); D = !0) ;
|
|
68
|
-
} catch ($t) {
|
|
69
|
-
Pt = !0, l = $t;
|
|
70
|
-
} finally {
|
|
71
|
-
try {
|
|
72
|
-
if (!D && c.return != null && (A = c.return(), Object(A) !== A)) return;
|
|
73
|
-
} finally {
|
|
74
|
-
if (Pt) throw l;
|
|
75
|
-
}
|
|
35
|
+
const m = (a) => {
|
|
36
|
+
class o extends a {
|
|
37
|
+
get idPrefix() {
|
|
38
|
+
return this.localName || "cob-element";
|
|
76
39
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
function Je() {
|
|
81
|
-
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
82
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
83
|
-
}
|
|
84
|
-
function Qe(o, e) {
|
|
85
|
-
return Ve(o) || Ze(o, e) || tr(o, e) || Je();
|
|
86
|
-
}
|
|
87
|
-
function tr(o, e) {
|
|
88
|
-
if (o) {
|
|
89
|
-
if (typeof o == "string") return Vo(o, e);
|
|
90
|
-
var c = {}.toString.call(o).slice(8, -1);
|
|
91
|
-
return c === "Object" && o.constructor && (c = o.constructor.name), c === "Map" || c === "Set" ? Array.from(o) : c === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c) ? Vo(o, e) : void 0;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
const de = Object.entries, Zo = Object.setPrototypeOf, or = Object.isFrozen, er = Object.getPrototypeOf, rr = Object.getOwnPropertyDescriptor;
|
|
95
|
-
let T = Object.freeze, E = Object.seal, bt = Object.create, he = typeof Reflect < "u" && Reflect, fo = he.apply, ho = he.construct;
|
|
96
|
-
T || (T = function(o) {
|
|
97
|
-
return o;
|
|
98
|
-
});
|
|
99
|
-
E || (E = function(o) {
|
|
100
|
-
return o;
|
|
101
|
-
});
|
|
102
|
-
fo || (fo = function(o, e) {
|
|
103
|
-
for (var c = arguments.length, i = new Array(c > 2 ? c - 2 : 0), l = 2; l < c; l++)
|
|
104
|
-
i[l - 2] = arguments[l];
|
|
105
|
-
return o.apply(e, i);
|
|
106
|
-
});
|
|
107
|
-
ho || (ho = function(o) {
|
|
108
|
-
for (var e = arguments.length, c = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
|
|
109
|
-
c[i - 1] = arguments[i];
|
|
110
|
-
return new o(...c);
|
|
111
|
-
});
|
|
112
|
-
const _t = S(Array.prototype.forEach), nr = S(Array.prototype.lastIndexOf), Jo = S(Array.prototype.pop), st = S(Array.prototype.push), cr = S(Array.prototype.splice), K = Array.isArray, kt = S(String.prototype.toLowerCase), no = S(String.prototype.toString), Qo = S(String.prototype.match), yt = S(String.prototype.replace), te = S(String.prototype.indexOf), ar = S(String.prototype.trim), ir = S(Number.prototype.toString), lr = S(Boolean.prototype.toString), oe = typeof BigInt > "u" ? null : S(BigInt.prototype.toString), ee = typeof Symbol > "u" ? null : S(Symbol.prototype.toString), k = S(Object.prototype.hasOwnProperty), xt = S(Object.prototype.toString), w = S(RegExp.prototype.test), et = sr(TypeError);
|
|
113
|
-
function S(o) {
|
|
114
|
-
return function(e) {
|
|
115
|
-
e instanceof RegExp && (e.lastIndex = 0);
|
|
116
|
-
for (var c = arguments.length, i = new Array(c > 1 ? c - 1 : 0), l = 1; l < c; l++)
|
|
117
|
-
i[l - 1] = arguments[l];
|
|
118
|
-
return fo(o, e, i);
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
function sr(o) {
|
|
122
|
-
return function() {
|
|
123
|
-
for (var e = arguments.length, c = new Array(e), i = 0; i < e; i++)
|
|
124
|
-
c[i] = arguments[i];
|
|
125
|
-
return ho(o, c);
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
function b(o, e) {
|
|
129
|
-
let c = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : kt;
|
|
130
|
-
if (Zo && Zo(o, null), !K(e))
|
|
131
|
-
return o;
|
|
132
|
-
let i = e.length;
|
|
133
|
-
for (; i--; ) {
|
|
134
|
-
let l = e[i];
|
|
135
|
-
if (typeof l == "string") {
|
|
136
|
-
const u = c(l);
|
|
137
|
-
u !== l && (or(e) || (e[i] = u), l = u);
|
|
40
|
+
ensureId() {
|
|
41
|
+
this.id || (this.id = k(this.idPrefix));
|
|
138
42
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
return o;
|
|
142
|
-
}
|
|
143
|
-
function br(o) {
|
|
144
|
-
for (let e = 0; e < o.length; e++)
|
|
145
|
-
k(o, e) || (o[e] = null);
|
|
146
|
-
return o;
|
|
147
|
-
}
|
|
148
|
-
function C(o) {
|
|
149
|
-
const e = bt(null);
|
|
150
|
-
for (const i of de(o)) {
|
|
151
|
-
var c = Qe(i, 2);
|
|
152
|
-
const l = c[0], u = c[1];
|
|
153
|
-
k(o, l) && (K(u) ? e[l] = br(u) : u && typeof u == "object" && u.constructor === Object ? e[l] = C(u) : e[l] = u);
|
|
154
|
-
}
|
|
155
|
-
return e;
|
|
156
|
-
}
|
|
157
|
-
function ur(o) {
|
|
158
|
-
switch (typeof o) {
|
|
159
|
-
case "string":
|
|
160
|
-
return o;
|
|
161
|
-
case "number":
|
|
162
|
-
return ir(o);
|
|
163
|
-
case "boolean":
|
|
164
|
-
return lr(o);
|
|
165
|
-
case "bigint":
|
|
166
|
-
return oe ? oe(o) : "0";
|
|
167
|
-
case "symbol":
|
|
168
|
-
return ee ? ee(o) : "Symbol()";
|
|
169
|
-
case "undefined":
|
|
170
|
-
return xt(o);
|
|
171
|
-
case "function":
|
|
172
|
-
case "object": {
|
|
173
|
-
if (o === null)
|
|
174
|
-
return xt(o);
|
|
175
|
-
const e = o, c = F(e, "toString");
|
|
176
|
-
if (typeof c == "function") {
|
|
177
|
-
const i = c(e);
|
|
178
|
-
return typeof i == "string" ? i : xt(i);
|
|
179
|
-
}
|
|
180
|
-
return xt(o);
|
|
43
|
+
connectedCallback() {
|
|
44
|
+
super.connectedCallback(), this.ensureId();
|
|
181
45
|
}
|
|
182
|
-
default:
|
|
183
|
-
return xt(o);
|
|
184
46
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
if (i.get)
|
|
191
|
-
return S(i.get);
|
|
192
|
-
if (typeof i.value == "function")
|
|
193
|
-
return S(i.value);
|
|
194
|
-
}
|
|
195
|
-
o = er(o);
|
|
196
|
-
}
|
|
197
|
-
function c() {
|
|
198
|
-
return null;
|
|
199
|
-
}
|
|
200
|
-
return c;
|
|
201
|
-
}
|
|
202
|
-
function fr(o) {
|
|
203
|
-
try {
|
|
204
|
-
return w(o, ""), !0;
|
|
205
|
-
} catch {
|
|
206
|
-
return !1;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
const re = T(["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"]), co = T(["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"]), ao = T(["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"]), dr = T(["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"]), io = T(["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"]), hr = T(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), ne = T(["#text"]), ce = T(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "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"]), lo = T(["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"]), ae = T(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "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"]), zt = T(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), pr = E(/{{[\w\W]*|^[\w\W]*}}/g), mr = E(/<%[\w\W]*|^[\w\W]*%>/g), vr = E(/\${[\w\W]*/g), gr = E(/^data-[\-\w.\u00B7-\uFFFF]+$/), _r = E(/^aria-[\-\w]+$/), ie = E(
|
|
210
|
-
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
211
|
-
// eslint-disable-line no-useless-escape
|
|
212
|
-
), yr = E(/^(?:\w+script|data):/i), xr = E(
|
|
213
|
-
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
214
|
-
// eslint-disable-line no-control-regex
|
|
215
|
-
), Sr = E(/^html$/i), kr = E(/^[a-z][.\w]*(-[.\w]+)+$/i), le = E(/<[/\w!]/g), wr = E(/<[/\w]/g), Tr = E(/<\/no(script|embed|frames)/i), Er = E(/\/>/i), $ = {
|
|
216
|
-
element: 1,
|
|
217
|
-
attribute: 2,
|
|
218
|
-
text: 3,
|
|
219
|
-
cdataSection: 4,
|
|
220
|
-
entityReference: 5,
|
|
221
|
-
// Deprecated
|
|
222
|
-
entityNode: 6,
|
|
223
|
-
// Deprecated
|
|
224
|
-
processingInstruction: 7,
|
|
225
|
-
comment: 8,
|
|
226
|
-
document: 9,
|
|
227
|
-
documentType: 10,
|
|
228
|
-
documentFragment: 11,
|
|
229
|
-
notation: 12
|
|
230
|
-
// Deprecated
|
|
231
|
-
}, Ar = function() {
|
|
232
|
-
return typeof window > "u" ? null : window;
|
|
233
|
-
}, Nr = function(o, e) {
|
|
234
|
-
if (typeof o != "object" || typeof o.createPolicy != "function")
|
|
235
|
-
return null;
|
|
236
|
-
let c = null;
|
|
237
|
-
const i = "data-tt-policy-suffix";
|
|
238
|
-
e && e.hasAttribute(i) && (c = e.getAttribute(i));
|
|
239
|
-
const l = "dompurify" + (c ? "#" + c : "");
|
|
240
|
-
try {
|
|
241
|
-
return o.createPolicy(l, {
|
|
242
|
-
createHTML(u) {
|
|
243
|
-
return u;
|
|
244
|
-
},
|
|
245
|
-
createScriptURL(u) {
|
|
246
|
-
return u;
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
} catch {
|
|
250
|
-
return console.warn("TrustedTypes policy " + l + " could not be created."), null;
|
|
251
|
-
}
|
|
252
|
-
}, se = function() {
|
|
253
|
-
return {
|
|
254
|
-
afterSanitizeAttributes: [],
|
|
255
|
-
afterSanitizeElements: [],
|
|
256
|
-
afterSanitizeShadowDOM: [],
|
|
257
|
-
beforeSanitizeAttributes: [],
|
|
258
|
-
beforeSanitizeElements: [],
|
|
259
|
-
beforeSanitizeShadowDOM: [],
|
|
260
|
-
uponSanitizeAttribute: [],
|
|
261
|
-
uponSanitizeElement: [],
|
|
262
|
-
uponSanitizeShadowNode: []
|
|
263
|
-
};
|
|
264
|
-
}, q = function(o, e, c, i) {
|
|
265
|
-
return k(o, e) && K(o[e]) ? b(i.base ? C(i.base) : {}, o[e], i.transform) : c;
|
|
266
|
-
};
|
|
267
|
-
function pe() {
|
|
268
|
-
let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Ar();
|
|
269
|
-
const e = (t) => pe(t);
|
|
270
|
-
if (e.version = "3.4.11", e.removed = [], !o || !o.document || o.document.nodeType !== $.document || !o.Element)
|
|
271
|
-
return e.isSupported = !1, e;
|
|
272
|
-
let c = o.document;
|
|
273
|
-
const i = c, l = i.currentScript;
|
|
274
|
-
o.DocumentFragment;
|
|
275
|
-
const u = o.HTMLTemplateElement, A = o.Node, ut = o.Element, D = o.NodeFilter;
|
|
276
|
-
o.NamedNodeMap === void 0 && (o.NamedNodeMap || o.MozNamedAttrMap), o.HTMLFormElement;
|
|
277
|
-
const $t = o.DOMParser, Tt = o.trustedTypes, V = ut.prototype, ve = F(V, "cloneNode"), po = F(V, "remove"), ge = F(V, "nextSibling"), ft = F(V, "childNodes"), dt = F(V, "parentNode"), mo = F(V, "shadowRoot"), Ft = F(V, "attributes"), z = A && A.prototype ? F(A.prototype, "nodeType") : null, j = A && A.prototype ? F(A.prototype, "nodeName") : null;
|
|
278
|
-
if (typeof u == "function") {
|
|
279
|
-
const t = c.createElement("template");
|
|
280
|
-
t.content && t.content.ownerDocument && (c = t.content.ownerDocument);
|
|
281
|
-
}
|
|
282
|
-
let I, Z = "", Ut, vo = !1, ht = 0;
|
|
283
|
-
const go = function() {
|
|
284
|
-
if (ht > 0)
|
|
285
|
-
throw et('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
|
|
286
|
-
}, rt = function(t) {
|
|
287
|
-
go(), ht++;
|
|
288
|
-
try {
|
|
289
|
-
return I.createHTML(t);
|
|
290
|
-
} finally {
|
|
291
|
-
ht--;
|
|
292
|
-
}
|
|
293
|
-
}, _e = function(t) {
|
|
294
|
-
go(), ht++;
|
|
295
|
-
try {
|
|
296
|
-
return I.createScriptURL(t);
|
|
297
|
-
} finally {
|
|
298
|
-
ht--;
|
|
299
|
-
}
|
|
300
|
-
}, ye = function() {
|
|
301
|
-
return vo || (Ut = Nr(Tt, l), vo = !0), Ut;
|
|
302
|
-
}, Et = c, Ht = Et.implementation, _o = Et.createNodeIterator, xe = Et.createDocumentFragment, Se = Et.getElementsByTagName, ke = i.importNode;
|
|
303
|
-
let x = se();
|
|
304
|
-
e.isSupported = typeof de == "function" && typeof dt == "function" && Ht && Ht.createHTMLDocument !== void 0;
|
|
305
|
-
const we = pr, Te = mr, Ee = vr, Ae = gr, Ne = _r, Ce = yr, yo = xr, Ie = kr;
|
|
306
|
-
let xo = ie, v = null;
|
|
307
|
-
const So = b({}, [...re, ...co, ...ao, ...io, ...ne]);
|
|
308
|
-
let g = null;
|
|
309
|
-
const ko = b({}, [...ce, ...lo, ...ae, ...zt]);
|
|
310
|
-
let _ = Object.seal(bt(null, {
|
|
311
|
-
tagNameCheck: {
|
|
312
|
-
writable: !0,
|
|
313
|
-
configurable: !1,
|
|
314
|
-
enumerable: !0,
|
|
315
|
-
value: null
|
|
316
|
-
},
|
|
317
|
-
attributeNameCheck: {
|
|
318
|
-
writable: !0,
|
|
319
|
-
configurable: !1,
|
|
320
|
-
enumerable: !0,
|
|
321
|
-
value: null
|
|
322
|
-
},
|
|
323
|
-
allowCustomizedBuiltInElements: {
|
|
324
|
-
writable: !0,
|
|
325
|
-
configurable: !1,
|
|
326
|
-
enumerable: !0,
|
|
327
|
-
value: !1
|
|
328
|
-
}
|
|
329
|
-
})), pt = null, wo = null;
|
|
330
|
-
const B = Object.seal(bt(null, {
|
|
331
|
-
tagCheck: {
|
|
332
|
-
writable: !0,
|
|
333
|
-
configurable: !1,
|
|
334
|
-
enumerable: !0,
|
|
335
|
-
value: null
|
|
336
|
-
},
|
|
337
|
-
attributeCheck: {
|
|
338
|
-
writable: !0,
|
|
339
|
-
configurable: !1,
|
|
340
|
-
enumerable: !0,
|
|
341
|
-
value: null
|
|
342
|
-
}
|
|
343
|
-
}));
|
|
344
|
-
let To = !0, jt = !0, Eo = !1, Ao = !0, G = !1, mt = !0, J = !1, Bt = !1, Gt = null, Wt = null, Yt = !1, nt = !1, At = !1, Nt = !1, No = !0, Co = !1;
|
|
345
|
-
const Io = "user-content-";
|
|
346
|
-
let qt = !0, Kt = !1, ct = {}, L = null;
|
|
347
|
-
const Xt = b({}, [
|
|
348
|
-
"annotation-xml",
|
|
349
|
-
"audio",
|
|
350
|
-
"colgroup",
|
|
351
|
-
"desc",
|
|
352
|
-
"foreignobject",
|
|
353
|
-
"head",
|
|
354
|
-
"iframe",
|
|
355
|
-
"math",
|
|
356
|
-
"mi",
|
|
357
|
-
"mn",
|
|
358
|
-
"mo",
|
|
359
|
-
"ms",
|
|
360
|
-
"mtext",
|
|
361
|
-
"noembed",
|
|
362
|
-
"noframes",
|
|
363
|
-
"noscript",
|
|
364
|
-
"plaintext",
|
|
365
|
-
"script",
|
|
366
|
-
// <selectedcontent> mirrors the selected <option>'s subtree, cloned by
|
|
367
|
-
// the UA (customizable <select>) — including any on* handlers — and the
|
|
368
|
-
// engine re-mirrors synchronously whenever a removal changes which
|
|
369
|
-
// option/selectedcontent is current, even inside DOMPurify's inert
|
|
370
|
-
// DOMParser document. Hoisting its children on removal re-inserts a fresh
|
|
371
|
-
// mirror target ahead of the walk, which the engine refills, looping
|
|
372
|
-
// forever (DoS) and amplifying output. Dropping its content on removal
|
|
373
|
-
// (rather than hoisting) breaks that cascade; the content is a duplicate
|
|
374
|
-
// of the option, which is sanitized on its own. See campaign-3 F1/F6.
|
|
375
|
-
"selectedcontent",
|
|
376
|
-
"style",
|
|
377
|
-
"svg",
|
|
378
|
-
"template",
|
|
379
|
-
"thead",
|
|
380
|
-
"title",
|
|
381
|
-
"video",
|
|
382
|
-
"xmp"
|
|
383
|
-
]);
|
|
384
|
-
let Oo = null;
|
|
385
|
-
const Ro = b({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
386
|
-
let Vt = null;
|
|
387
|
-
const Do = b({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Ct = "http://www.w3.org/1998/Math/MathML", It = "http://www.w3.org/2000/svg", M = "http://www.w3.org/1999/xhtml";
|
|
388
|
-
let at = M, Zt = !1, Jt = null;
|
|
389
|
-
const Oe = b({}, [Ct, It, M], no), zo = T(["mi", "mo", "mn", "ms", "mtext"]);
|
|
390
|
-
let Qt = b({}, zo);
|
|
391
|
-
const Lo = T(["annotation-xml"]);
|
|
392
|
-
let to = b({}, Lo);
|
|
393
|
-
const Re = b({}, ["title", "style", "font", "a", "script"]);
|
|
394
|
-
let vt = null;
|
|
395
|
-
const De = ["application/xhtml+xml", "text/html"], ze = "text/html";
|
|
396
|
-
let y = null, it = null;
|
|
397
|
-
const Le = c.createElement("form"), Mo = function(t) {
|
|
398
|
-
return t instanceof RegExp || t instanceof Function;
|
|
399
|
-
}, oo = function() {
|
|
400
|
-
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
401
|
-
if (it && it === t)
|
|
402
|
-
return;
|
|
403
|
-
(!t || typeof t != "object") && (t = {}), t = C(t), vt = // eslint-disable-next-line unicorn/prefer-includes
|
|
404
|
-
De.indexOf(t.PARSER_MEDIA_TYPE) === -1 ? ze : t.PARSER_MEDIA_TYPE, y = vt === "application/xhtml+xml" ? no : kt, v = q(t, "ALLOWED_TAGS", So, {
|
|
405
|
-
transform: y
|
|
406
|
-
}), g = q(t, "ALLOWED_ATTR", ko, {
|
|
407
|
-
transform: y
|
|
408
|
-
}), Jt = q(t, "ALLOWED_NAMESPACES", Oe, {
|
|
409
|
-
transform: no
|
|
410
|
-
}), Vt = q(t, "ADD_URI_SAFE_ATTR", Do, {
|
|
411
|
-
transform: y,
|
|
412
|
-
base: Do
|
|
413
|
-
}), Oo = q(t, "ADD_DATA_URI_TAGS", Ro, {
|
|
414
|
-
transform: y,
|
|
415
|
-
base: Ro
|
|
416
|
-
}), L = q(t, "FORBID_CONTENTS", Xt, {
|
|
417
|
-
transform: y
|
|
418
|
-
}), pt = q(t, "FORBID_TAGS", C({}), {
|
|
419
|
-
transform: y
|
|
420
|
-
}), wo = q(t, "FORBID_ATTR", C({}), {
|
|
421
|
-
transform: y
|
|
422
|
-
}), ct = k(t, "USE_PROFILES") ? t.USE_PROFILES && typeof t.USE_PROFILES == "object" ? C(t.USE_PROFILES) : t.USE_PROFILES : !1, To = t.ALLOW_ARIA_ATTR !== !1, jt = t.ALLOW_DATA_ATTR !== !1, Eo = t.ALLOW_UNKNOWN_PROTOCOLS || !1, Ao = t.ALLOW_SELF_CLOSE_IN_ATTR !== !1, G = t.SAFE_FOR_TEMPLATES || !1, mt = t.SAFE_FOR_XML !== !1, J = t.WHOLE_DOCUMENT || !1, nt = t.RETURN_DOM || !1, At = t.RETURN_DOM_FRAGMENT || !1, Nt = t.RETURN_TRUSTED_TYPE || !1, Yt = t.FORCE_BODY || !1, No = t.SANITIZE_DOM !== !1, Co = t.SANITIZE_NAMED_PROPS || !1, qt = t.KEEP_CONTENT !== !1, Kt = t.IN_PLACE || !1, xo = fr(t.ALLOWED_URI_REGEXP) ? t.ALLOWED_URI_REGEXP : ie, at = typeof t.NAMESPACE == "string" ? t.NAMESPACE : M, Qt = k(t, "MATHML_TEXT_INTEGRATION_POINTS") && t.MATHML_TEXT_INTEGRATION_POINTS && typeof t.MATHML_TEXT_INTEGRATION_POINTS == "object" ? C(t.MATHML_TEXT_INTEGRATION_POINTS) : b({}, zo), to = k(t, "HTML_INTEGRATION_POINTS") && t.HTML_INTEGRATION_POINTS && typeof t.HTML_INTEGRATION_POINTS == "object" ? C(t.HTML_INTEGRATION_POINTS) : b({}, Lo);
|
|
423
|
-
const r = k(t, "CUSTOM_ELEMENT_HANDLING") && t.CUSTOM_ELEMENT_HANDLING && typeof t.CUSTOM_ELEMENT_HANDLING == "object" ? C(t.CUSTOM_ELEMENT_HANDLING) : bt(null);
|
|
424
|
-
if (_ = bt(null), k(r, "tagNameCheck") && Mo(r.tagNameCheck) && (_.tagNameCheck = r.tagNameCheck), k(r, "attributeNameCheck") && Mo(r.attributeNameCheck) && (_.attributeNameCheck = r.attributeNameCheck), k(r, "allowCustomizedBuiltInElements") && typeof r.allowCustomizedBuiltInElements == "boolean" && (_.allowCustomizedBuiltInElements = r.allowCustomizedBuiltInElements), E(_), G && (jt = !1), At && (nt = !0), ct && (v = b({}, ne), g = bt(null), ct.html === !0 && (b(v, re), b(g, ce)), ct.svg === !0 && (b(v, co), b(g, lo), b(g, zt)), ct.svgFilters === !0 && (b(v, ao), b(g, lo), b(g, zt)), ct.mathMl === !0 && (b(v, io), b(g, ae), b(g, zt))), B.tagCheck = null, B.attributeCheck = null, k(t, "ADD_TAGS") && (typeof t.ADD_TAGS == "function" ? B.tagCheck = t.ADD_TAGS : K(t.ADD_TAGS) && (v === So && (v = C(v)), b(v, t.ADD_TAGS, y))), k(t, "ADD_ATTR") && (typeof t.ADD_ATTR == "function" ? B.attributeCheck = t.ADD_ATTR : K(t.ADD_ATTR) && (g === ko && (g = C(g)), b(g, t.ADD_ATTR, y))), k(t, "ADD_URI_SAFE_ATTR") && K(t.ADD_URI_SAFE_ATTR) && b(Vt, t.ADD_URI_SAFE_ATTR, y), k(t, "FORBID_CONTENTS") && K(t.FORBID_CONTENTS) && (L === Xt && (L = C(L)), b(L, t.FORBID_CONTENTS, y)), k(t, "ADD_FORBID_CONTENTS") && K(t.ADD_FORBID_CONTENTS) && (L === Xt && (L = C(L)), b(L, t.ADD_FORBID_CONTENTS, y)), qt && (v["#text"] = !0), J && b(v, ["html", "head", "body"]), v.table && (b(v, ["tbody"]), delete pt.tbody), t.TRUSTED_TYPES_POLICY) {
|
|
425
|
-
if (typeof t.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
426
|
-
throw et('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
427
|
-
if (typeof t.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
428
|
-
throw et('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
429
|
-
const n = I;
|
|
430
|
-
I = t.TRUSTED_TYPES_POLICY;
|
|
431
|
-
try {
|
|
432
|
-
Z = rt("");
|
|
433
|
-
} catch (a) {
|
|
434
|
-
throw I = n, a;
|
|
435
|
-
}
|
|
436
|
-
} else t.TRUSTED_TYPES_POLICY === null ? (I = void 0, Z = "") : (I === void 0 && (I = ye()), I && typeof Z == "string" && (Z = rt("")));
|
|
437
|
-
T && T(t), it = t;
|
|
438
|
-
}, Po = b({}, [...co, ...ao, ...dr]), $o = b({}, [...io, ...hr]), Me = function(t, r, n) {
|
|
439
|
-
return r.namespaceURI === M ? t === "svg" : r.namespaceURI === Ct ? t === "svg" && (n === "annotation-xml" || Qt[n]) : !!Po[t];
|
|
440
|
-
}, Pe = function(t, r, n) {
|
|
441
|
-
return r.namespaceURI === M ? t === "math" : r.namespaceURI === It ? t === "math" && to[n] : !!$o[t];
|
|
442
|
-
}, $e = function(t, r, n) {
|
|
443
|
-
return r.namespaceURI === It && !to[n] || r.namespaceURI === Ct && !Qt[n] ? !1 : !$o[t] && (Re[t] || !Po[t]);
|
|
444
|
-
}, Fe = function(t) {
|
|
445
|
-
let r = dt(t);
|
|
446
|
-
(!r || !r.tagName) && (r = {
|
|
447
|
-
namespaceURI: at,
|
|
448
|
-
tagName: "template"
|
|
449
|
-
});
|
|
450
|
-
const n = kt(t.tagName), a = kt(r.tagName);
|
|
451
|
-
return Jt[t.namespaceURI] ? t.namespaceURI === It ? Me(n, r, a) : t.namespaceURI === Ct ? Pe(n, r, a) : t.namespaceURI === M ? $e(n, r, a) : !!(vt === "application/xhtml+xml" && Jt[t.namespaceURI]) : !1;
|
|
452
|
-
}, Q = function(t) {
|
|
453
|
-
st(e.removed, {
|
|
454
|
-
element: t
|
|
455
|
-
});
|
|
456
|
-
try {
|
|
457
|
-
dt(t).removeChild(t);
|
|
458
|
-
} catch {
|
|
459
|
-
if (po(t), !dt(t))
|
|
460
|
-
throw et("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
461
|
-
}
|
|
462
|
-
}, Fo = function(t) {
|
|
463
|
-
const r = ft(t);
|
|
464
|
-
if (r) {
|
|
465
|
-
const a = [];
|
|
466
|
-
_t(r, (s) => {
|
|
467
|
-
st(a, s);
|
|
468
|
-
}), _t(a, (s) => {
|
|
469
|
-
try {
|
|
470
|
-
po(s);
|
|
471
|
-
} catch {
|
|
472
|
-
}
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
const n = Ft(t);
|
|
476
|
-
if (n)
|
|
477
|
-
for (let a = n.length - 1; a >= 0; --a) {
|
|
478
|
-
const s = n[a], f = s && s.name;
|
|
479
|
-
if (typeof f == "string")
|
|
480
|
-
try {
|
|
481
|
-
t.removeAttribute(f);
|
|
482
|
-
} catch {
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
}, tt = function(t, r) {
|
|
486
|
-
try {
|
|
487
|
-
st(e.removed, {
|
|
488
|
-
attribute: r.getAttributeNode(t),
|
|
489
|
-
from: r
|
|
490
|
-
});
|
|
491
|
-
} catch {
|
|
492
|
-
st(e.removed, {
|
|
493
|
-
attribute: null,
|
|
494
|
-
from: r
|
|
495
|
-
});
|
|
47
|
+
return o;
|
|
48
|
+
}, $ = (a) => {
|
|
49
|
+
class o extends m(a) {
|
|
50
|
+
constructor() {
|
|
51
|
+
super(...arguments), this.__internals = null;
|
|
496
52
|
}
|
|
497
|
-
|
|
498
|
-
if (
|
|
499
|
-
|
|
500
|
-
Q(r);
|
|
501
|
-
} catch {
|
|
502
|
-
}
|
|
503
|
-
else
|
|
53
|
+
get internals() {
|
|
54
|
+
if (this.__internals) return this.__internals;
|
|
55
|
+
if (typeof this.attachInternals == "function")
|
|
504
56
|
try {
|
|
505
|
-
|
|
57
|
+
this.__internals = this.attachInternals();
|
|
506
58
|
} catch {
|
|
59
|
+
this.__internals = null;
|
|
507
60
|
}
|
|
508
|
-
|
|
509
|
-
const r = Ft(t);
|
|
510
|
-
if (r)
|
|
511
|
-
for (let n = r.length - 1; n >= 0; --n) {
|
|
512
|
-
const a = r[n], s = a && a.name;
|
|
513
|
-
if (!(typeof s != "string" || g[y(s)]))
|
|
514
|
-
try {
|
|
515
|
-
t.removeAttribute(s);
|
|
516
|
-
} catch {
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
}, He = function(t) {
|
|
520
|
-
const r = [t];
|
|
521
|
-
for (; r.length > 0; ) {
|
|
522
|
-
const n = r.pop();
|
|
523
|
-
(z ? z(n) : n.nodeType) === $.element && Ue(n);
|
|
524
|
-
const a = ft(n);
|
|
525
|
-
if (a)
|
|
526
|
-
for (let s = a.length - 1; s >= 0; --s)
|
|
527
|
-
r.push(a[s]);
|
|
61
|
+
return this.__internals;
|
|
528
62
|
}
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
if (Yt)
|
|
532
|
-
t = "<remove></remove>" + t;
|
|
533
|
-
else {
|
|
534
|
-
const f = Qo(t, /^[\r\n\t ]+/);
|
|
535
|
-
n = f && f[0];
|
|
63
|
+
get defaultRole() {
|
|
64
|
+
return null;
|
|
536
65
|
}
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
} catch {
|
|
543
|
-
}
|
|
544
|
-
if (!r || !r.documentElement) {
|
|
545
|
-
r = Ht.createDocument(at, "template", null);
|
|
546
|
-
try {
|
|
547
|
-
r.documentElement.innerHTML = Zt ? Z : a;
|
|
548
|
-
} catch {
|
|
66
|
+
setHostAria(l, b) {
|
|
67
|
+
const s = this.internals;
|
|
68
|
+
if (s && l in s) {
|
|
69
|
+
s[l] = b;
|
|
70
|
+
return;
|
|
549
71
|
}
|
|
72
|
+
const u = S(l);
|
|
73
|
+
b === null ? this.removeAttribute(u) : this.setAttribute(u, b);
|
|
550
74
|
}
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
return _o.call(
|
|
555
|
-
t.ownerDocument || t,
|
|
556
|
-
t,
|
|
557
|
-
// eslint-disable-next-line no-bitwise
|
|
558
|
-
D.SHOW_ELEMENT | D.SHOW_COMMENT | D.SHOW_TEXT | D.SHOW_PROCESSING_INSTRUCTION | D.SHOW_CDATA_SECTION,
|
|
559
|
-
null
|
|
560
|
-
);
|
|
561
|
-
}, Ot = function(t) {
|
|
562
|
-
return t = yt(t, we, " "), t = yt(t, Te, " "), t = yt(t, Ee, " "), t;
|
|
563
|
-
}, eo = function(t) {
|
|
564
|
-
var r;
|
|
565
|
-
t.normalize();
|
|
566
|
-
const n = _o.call(
|
|
567
|
-
t.ownerDocument || t,
|
|
568
|
-
t,
|
|
569
|
-
// eslint-disable-next-line no-bitwise
|
|
570
|
-
D.SHOW_TEXT | D.SHOW_COMMENT | D.SHOW_CDATA_SECTION | D.SHOW_PROCESSING_INSTRUCTION,
|
|
571
|
-
null
|
|
572
|
-
);
|
|
573
|
-
let a = n.nextNode();
|
|
574
|
-
for (; a; )
|
|
575
|
-
a.data = Ot(a.data), a = n.nextNode();
|
|
576
|
-
const s = (r = t.querySelectorAll) === null || r === void 0 ? void 0 : r.call(t, "template");
|
|
577
|
-
s && _t(s, (f) => {
|
|
578
|
-
lt(f.content) && eo(f.content);
|
|
579
|
-
});
|
|
580
|
-
}, Rt = function(t) {
|
|
581
|
-
const r = j ? j(t) : null;
|
|
582
|
-
return typeof r != "string" || y(r) !== "form" ? !1 : typeof t.nodeName != "string" || typeof t.textContent != "string" || typeof t.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
|
|
583
|
-
// prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
|
|
584
|
-
// makes the direct read diverge from the cached read; a clean form
|
|
585
|
-
// (same-realm OR foreign-realm) has both reads pointing at the same
|
|
586
|
-
// canonical NamedNodeMap.
|
|
587
|
-
t.attributes !== Ft(t) || typeof t.removeAttribute != "function" || typeof t.setAttribute != "function" || typeof t.namespaceURI != "string" || typeof t.insertBefore != "function" || typeof t.hasChildNodes != "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
|
|
588
|
-
// returns the integer 1 for any Element regardless of realm; direct
|
|
589
|
-
// read on a clobbered form (e.g. <input name="nodeType">) returns
|
|
590
|
-
// the named child element. Cheap addition — nodeType is read from
|
|
591
|
-
// an internal slot, no serialization cost — and removes a residual
|
|
592
|
-
// clobbering surface used by several mXSS / PI / comment branches
|
|
593
|
-
// in _sanitizeElements that compare currentNode.nodeType directly.
|
|
594
|
-
t.nodeType !== z(t) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
|
|
595
|
-
// "childNodes" shadows the prototype getter. Direct reads of
|
|
596
|
-
// form.childNodes from a clobbered form return the named child
|
|
597
|
-
// instead of the real NodeList, so any walk that reads it directly
|
|
598
|
-
// skips the form's real children. Compare the direct read to the
|
|
599
|
-
// cached Node.prototype getter — when the form's named-property
|
|
600
|
-
// getter intercepts the read, the two values differ and we flag
|
|
601
|
-
// the form. This catches every clobbering child type (input,
|
|
602
|
-
// select, etc.) regardless of whether the named child happens to
|
|
603
|
-
// carry a numeric .length, which a typeof-based probe would miss
|
|
604
|
-
// (e.g. HTMLSelectElement.length is a defined unsigned-long).
|
|
605
|
-
t.childNodes !== ft(t);
|
|
606
|
-
}, lt = function(t) {
|
|
607
|
-
if (!z || typeof t != "object" || t === null)
|
|
608
|
-
return !1;
|
|
609
|
-
try {
|
|
610
|
-
return z(t) === $.documentFragment;
|
|
611
|
-
} catch {
|
|
612
|
-
return !1;
|
|
75
|
+
reflectDefaultSemantics() {
|
|
76
|
+
const l = this.defaultRole;
|
|
77
|
+
l && this.setHostAria("role", l);
|
|
613
78
|
}
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
return !1;
|
|
617
|
-
try {
|
|
618
|
-
return typeof z(t) == "number";
|
|
619
|
-
} catch {
|
|
620
|
-
return !1;
|
|
79
|
+
connectedCallback() {
|
|
80
|
+
super.connectedCallback(), this.reflectDefaultSemantics();
|
|
621
81
|
}
|
|
622
|
-
};
|
|
623
|
-
function U(t, r, n) {
|
|
624
|
-
t.length !== 0 && _t(t, (a) => {
|
|
625
|
-
a.call(e, r, n, it);
|
|
626
|
-
});
|
|
627
82
|
}
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
n.insertBefore(h, ge(t));
|
|
640
|
-
}
|
|
641
|
-
}
|
|
83
|
+
return o;
|
|
84
|
+
};
|
|
85
|
+
function S(a) {
|
|
86
|
+
if (a === "role") return "role";
|
|
87
|
+
const o = a.replace(/^aria/, "");
|
|
88
|
+
return "aria-" + o.charAt(0).toLowerCase() + o.slice(1);
|
|
89
|
+
}
|
|
90
|
+
const w = (a) => {
|
|
91
|
+
const o = class extends $(a) {
|
|
92
|
+
constructor() {
|
|
93
|
+
super(...arguments), this.__internalValidationMessage = "";
|
|
642
94
|
}
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
if (U(x.beforeSanitizeElements, t, null), Rt(t))
|
|
646
|
-
return Q(t), !0;
|
|
647
|
-
const r = y(j ? j(t) : t.nodeName);
|
|
648
|
-
if (U(x.uponSanitizeElement, t, {
|
|
649
|
-
tagName: r,
|
|
650
|
-
allowedTags: v
|
|
651
|
-
}), je(t, r))
|
|
652
|
-
return Q(t), !0;
|
|
653
|
-
if (pt[r] || !(B.tagCheck instanceof Function && B.tagCheck(r)) && !v[r])
|
|
654
|
-
return Be(t, r);
|
|
655
|
-
if ((z ? z(t) : t.nodeType) === $.element && !Fe(t) || (r === "noscript" || r === "noembed" || r === "noframes") && w(Tr, t.innerHTML))
|
|
656
|
-
return Q(t), !0;
|
|
657
|
-
if (G && t.nodeType === $.text) {
|
|
658
|
-
const n = Ot(t.textContent);
|
|
659
|
-
t.textContent !== n && (st(e.removed, {
|
|
660
|
-
element: t.cloneNode()
|
|
661
|
-
}), t.textContent = n);
|
|
95
|
+
get internalValidationMessage() {
|
|
96
|
+
return this.__internalValidationMessage;
|
|
662
97
|
}
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
if (wo[r] || No && (r === "id" || r === "name") && (n in c || n in Le))
|
|
666
|
-
return !1;
|
|
667
|
-
const a = g[r] || B.attributeCheck instanceof Function && B.attributeCheck(r, t);
|
|
668
|
-
if (!(jt && w(Ae, r)) && !(To && w(Ne, r))) {
|
|
669
|
-
if (a) {
|
|
670
|
-
if (!Vt[r] && !w(xo, yt(n, yo, "")) && !((r === "src" || r === "xlink:href" || r === "href") && t !== "script" && te(n, "data:") === 0 && Oo[t]) && !(Eo && !w(Ce, yt(n, yo, ""))) && n)
|
|
671
|
-
return !1;
|
|
672
|
-
} else if (
|
|
673
|
-
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
674
|
-
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
675
|
-
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
676
|
-
!(Go(t) && (_.tagNameCheck instanceof RegExp && w(_.tagNameCheck, t) || _.tagNameCheck instanceof Function && _.tagNameCheck(t)) && (_.attributeNameCheck instanceof RegExp && w(_.attributeNameCheck, r) || _.attributeNameCheck instanceof Function && _.attributeNameCheck(r, t)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
677
|
-
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
678
|
-
r === "is" && _.allowCustomizedBuiltInElements && (_.tagNameCheck instanceof RegExp && w(_.tagNameCheck, n) || _.tagNameCheck instanceof Function && _.tagNameCheck(n)))
|
|
679
|
-
) return !1;
|
|
98
|
+
set internalValidationMessage(b) {
|
|
99
|
+
b !== this.__internalValidationMessage && (this.__internalValidationMessage = b, this.requestUpdate("internalValidationMessage"));
|
|
680
100
|
}
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
return !Ge[kt(t)] && w(Ie, t);
|
|
684
|
-
}, We = function(t, r, n, a) {
|
|
685
|
-
if (I && typeof Tt == "object" && typeof Tt.getAttributeType == "function" && !n)
|
|
686
|
-
switch (Tt.getAttributeType(t, r)) {
|
|
687
|
-
case "TrustedHTML":
|
|
688
|
-
return rt(a);
|
|
689
|
-
case "TrustedScriptURL":
|
|
690
|
-
return _e(a);
|
|
691
|
-
}
|
|
692
|
-
return a;
|
|
693
|
-
}, Ye = function(t, r, n, a) {
|
|
694
|
-
try {
|
|
695
|
-
n ? t.setAttributeNS(n, r, a) : t.setAttribute(r, a), Rt(t) ? Q(t) : Jo(e.removed);
|
|
696
|
-
} catch {
|
|
697
|
-
tt(r, t);
|
|
101
|
+
resolvedErrorMessage() {
|
|
102
|
+
return this.errorMessage || this.internalValidationMessage;
|
|
698
103
|
}
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
const r = t.attributes;
|
|
702
|
-
if (!r || Rt(t))
|
|
703
|
-
return;
|
|
704
|
-
const n = {
|
|
705
|
-
attrName: "",
|
|
706
|
-
attrValue: "",
|
|
707
|
-
keepAttr: !0,
|
|
708
|
-
allowedAttributes: g,
|
|
709
|
-
forceKeepAttr: void 0
|
|
710
|
-
};
|
|
711
|
-
let a = r.length;
|
|
712
|
-
const s = y(t.nodeName);
|
|
713
|
-
for (; a--; ) {
|
|
714
|
-
const f = r[a], h = f.name, ot = f.namespaceURI, W = f.value, O = y(h), Y = W;
|
|
715
|
-
let N = h === "value" ? Y : ar(Y);
|
|
716
|
-
if (n.attrName = O, n.attrValue = N, n.keepAttr = !0, n.forceKeepAttr = void 0, U(x.uponSanitizeAttribute, t, n), N = n.attrValue, Co && (O === "id" || O === "name") && te(N, Io) !== 0 && (tt(h, t), N = Io + N), mt && w(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, N)) {
|
|
717
|
-
tt(h, t);
|
|
718
|
-
continue;
|
|
719
|
-
}
|
|
720
|
-
if (O === "attributename" && Qo(N, "href")) {
|
|
721
|
-
tt(h, t);
|
|
722
|
-
continue;
|
|
723
|
-
}
|
|
724
|
-
if (!n.forceKeepAttr) {
|
|
725
|
-
if (!n.keepAttr) {
|
|
726
|
-
tt(h, t);
|
|
727
|
-
continue;
|
|
728
|
-
}
|
|
729
|
-
if (!Ao && w(Er, N)) {
|
|
730
|
-
tt(h, t);
|
|
731
|
-
continue;
|
|
732
|
-
}
|
|
733
|
-
if (G && (N = Ot(N)), !Bo(s, O, N)) {
|
|
734
|
-
tt(h, t);
|
|
735
|
-
continue;
|
|
736
|
-
}
|
|
737
|
-
N = We(s, O, ot, N), N !== Y && Ye(t, h, ot, N);
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
U(x.afterSanitizeAttributes, t, null);
|
|
741
|
-
}, Dt = function(t) {
|
|
742
|
-
let r = null;
|
|
743
|
-
const n = Ho(t);
|
|
744
|
-
for (U(x.beforeSanitizeShadowDOM, t, null); r = n.nextNode(); )
|
|
745
|
-
if (U(x.uponSanitizeShadowNode, r, null), jo(r), Wo(r), lt(r.content) && Dt(r.content), (z ? z(r) : r.nodeType) === $.element) {
|
|
746
|
-
const a = mo(r);
|
|
747
|
-
lt(a) && (ro(a), Dt(a));
|
|
748
|
-
}
|
|
749
|
-
U(x.afterSanitizeShadowDOM, t, null);
|
|
750
|
-
}, ro = function(t) {
|
|
751
|
-
const r = [{
|
|
752
|
-
node: t,
|
|
753
|
-
shadow: null
|
|
754
|
-
}];
|
|
755
|
-
for (; r.length > 0; ) {
|
|
756
|
-
const n = r.pop();
|
|
757
|
-
if (n.shadow) {
|
|
758
|
-
Dt(n.shadow);
|
|
759
|
-
continue;
|
|
760
|
-
}
|
|
761
|
-
const a = n.node, s = (z ? z(a) : a.nodeType) === $.element, f = ft(a);
|
|
762
|
-
if (f)
|
|
763
|
-
for (let h = f.length - 1; h >= 0; --h)
|
|
764
|
-
r.push({
|
|
765
|
-
node: f[h],
|
|
766
|
-
shadow: null
|
|
767
|
-
});
|
|
768
|
-
if (s) {
|
|
769
|
-
const h = j ? j(a) : null;
|
|
770
|
-
if (typeof h == "string" && y(h) === "template") {
|
|
771
|
-
const ot = a.content;
|
|
772
|
-
lt(ot) && r.push({
|
|
773
|
-
node: ot,
|
|
774
|
-
shadow: null
|
|
775
|
-
});
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
if (s) {
|
|
779
|
-
const h = mo(a);
|
|
780
|
-
lt(h) && r.push({
|
|
781
|
-
node: null,
|
|
782
|
-
shadow: h
|
|
783
|
-
}, {
|
|
784
|
-
node: h,
|
|
785
|
-
shadow: null
|
|
786
|
-
});
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
};
|
|
790
|
-
return e.sanitize = function(t) {
|
|
791
|
-
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = null, a = null, s = null, f = null;
|
|
792
|
-
if (Zt = !t, Zt && (t = "<!-->"), typeof t != "string" && !gt(t) && (t = ur(t), typeof t != "string"))
|
|
793
|
-
throw et("dirty is not a string, aborting");
|
|
794
|
-
if (!e.isSupported)
|
|
795
|
-
return t;
|
|
796
|
-
Bt ? (v = Gt, g = Wt) : oo(r), (x.uponSanitizeElement.length > 0 || x.uponSanitizeAttribute.length > 0) && (v = C(v)), x.uponSanitizeAttribute.length > 0 && (g = C(g)), e.removed = [];
|
|
797
|
-
const h = Kt && typeof t != "string" && gt(t);
|
|
798
|
-
if (h) {
|
|
799
|
-
const O = j ? j(t) : t.nodeName;
|
|
800
|
-
if (typeof O == "string") {
|
|
801
|
-
const Y = y(O);
|
|
802
|
-
if (!v[Y] || pt[Y])
|
|
803
|
-
throw et("root node is forbidden and cannot be sanitized in-place");
|
|
804
|
-
}
|
|
805
|
-
if (Rt(t))
|
|
806
|
-
throw et("root node is clobbered and cannot be sanitized in-place");
|
|
807
|
-
try {
|
|
808
|
-
ro(t);
|
|
809
|
-
} catch (Y) {
|
|
810
|
-
throw Fo(t), Y;
|
|
811
|
-
}
|
|
812
|
-
} else if (gt(t))
|
|
813
|
-
n = Uo("<!---->"), a = n.ownerDocument.importNode(t, !0), a.nodeType === $.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? n = a : n.appendChild(a), ro(a);
|
|
814
|
-
else {
|
|
815
|
-
if (!nt && !G && !J && // eslint-disable-next-line unicorn/prefer-includes
|
|
816
|
-
t.indexOf("<") === -1)
|
|
817
|
-
return I && Nt ? rt(t) : t;
|
|
818
|
-
if (n = Uo(t), !n)
|
|
819
|
-
return nt ? null : Nt ? Z : "";
|
|
104
|
+
setFormValue(b) {
|
|
105
|
+
this.internals?.setFormValue(b ?? null);
|
|
820
106
|
}
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
} catch (O) {
|
|
827
|
-
throw h && Fo(t), O;
|
|
107
|
+
setValidityFromState(b, s, u) {
|
|
108
|
+
const f = this.internals;
|
|
109
|
+
if (!f) return;
|
|
110
|
+
const h = Object.values(b).some(Boolean);
|
|
111
|
+
h ? f.setValidity(b, s ?? "Invalid value", u) : f.setValidity({}), this.setHostAria("ariaInvalid", h ? "true" : "false");
|
|
828
112
|
}
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
O.element && He(O.element);
|
|
832
|
-
}), G && eo(t), t;
|
|
833
|
-
if (nt) {
|
|
834
|
-
if (G && eo(n), At)
|
|
835
|
-
for (f = xe.call(n.ownerDocument); n.firstChild; )
|
|
836
|
-
f.appendChild(n.firstChild);
|
|
837
|
-
else
|
|
838
|
-
f = n;
|
|
839
|
-
return (g.shadowroot || g.shadowrootmode) && (f = ke.call(i, f, !0)), f;
|
|
113
|
+
clearValidity() {
|
|
114
|
+
this.internals?.setValidity({}), this.setHostAria("ariaInvalid", "false");
|
|
840
115
|
}
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
` + W), G && (W = Ot(W)), I && Nt ? rt(W) : W;
|
|
844
|
-
}, e.setConfig = function() {
|
|
845
|
-
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
846
|
-
oo(t), Bt = !0, Gt = v, Wt = g;
|
|
847
|
-
}, e.clearConfig = function() {
|
|
848
|
-
it = null, Bt = !1, Gt = null, Wt = null, I = Ut, Z = "";
|
|
849
|
-
}, e.isValidAttribute = function(t, r, n) {
|
|
850
|
-
it || oo({});
|
|
851
|
-
const a = y(t), s = y(r);
|
|
852
|
-
return Bo(a, s, n);
|
|
853
|
-
}, e.addHook = function(t, r) {
|
|
854
|
-
typeof r == "function" && k(x, t) && st(x[t], r);
|
|
855
|
-
}, e.removeHook = function(t, r) {
|
|
856
|
-
if (k(x, t)) {
|
|
857
|
-
if (r !== void 0) {
|
|
858
|
-
const n = nr(x[t], r);
|
|
859
|
-
return n === -1 ? void 0 : cr(x[t], n, 1)[0];
|
|
860
|
-
}
|
|
861
|
-
return Jo(x[t]);
|
|
116
|
+
checkValidity() {
|
|
117
|
+
return this.internals?.checkValidity() ?? !0;
|
|
862
118
|
}
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
}, e.removeAllHooks = function() {
|
|
866
|
-
x = se();
|
|
867
|
-
}, e;
|
|
868
|
-
}
|
|
869
|
-
var Cr = pe();
|
|
870
|
-
const so = /* @__PURE__ */ new Map(), be = /* @__PURE__ */ new Map();
|
|
871
|
-
function Ir(o) {
|
|
872
|
-
o.querySelectorAll("g[mask]").forEach((e) => {
|
|
873
|
-
e.removeAttribute("mask");
|
|
874
|
-
}), o.querySelectorAll("mask").forEach((e) => {
|
|
875
|
-
e.remove();
|
|
876
|
-
});
|
|
877
|
-
}
|
|
878
|
-
function me(o, e) {
|
|
879
|
-
const c = Cr.sanitize(o, {
|
|
880
|
-
USE_PROFILES: { svg: !0, svgFilters: !0 },
|
|
881
|
-
FORBID_TAGS: ["script", "use"],
|
|
882
|
-
// <use> can SSRF to external hrefs
|
|
883
|
-
FORBID_ATTR: ["onload", "onerror", "onbegin", "href", "xlink:href"]
|
|
884
|
-
}), i = new DOMParser().parseFromString(c, "image/svg+xml").documentElement;
|
|
885
|
-
if (!(i instanceof SVGElement))
|
|
886
|
-
throw new Error(`Invalid SVG from ${e}`);
|
|
887
|
-
return Ir(i), i;
|
|
888
|
-
}
|
|
889
|
-
async function Or(o) {
|
|
890
|
-
const e = await fetch(o);
|
|
891
|
-
if (!e.ok)
|
|
892
|
-
throw new Error(`Failed to load icon: ${e.status}`);
|
|
893
|
-
return me(await e.text(), o);
|
|
894
|
-
}
|
|
895
|
-
async function ue(o) {
|
|
896
|
-
return so.has(o) || so.set(o, Or(o)), (await so.get(o)).cloneNode(!0);
|
|
897
|
-
}
|
|
898
|
-
function Rr(o) {
|
|
899
|
-
let e = be.get(o);
|
|
900
|
-
return e || (e = me(o, "inline SVG source"), be.set(o, e)), e.cloneNode(!0);
|
|
901
|
-
}
|
|
902
|
-
const Dr = ":host{display:inline-block;width:fit-content;height:fit-content;--_cob-icon-size: var( --cob-icon-size, .7em );box-sizing:content-box!important;vertical-align:middle}@supports (font-size: 1cap){:host{--_cob-icon-size: var(--cob-icon-size, 1cap)}}.cob-icon--svg{width:var(--_cob-icon-size, 1em);height:var(--_cob-icon-size, 1em);display:block;white-space:nowrap}.cob-icon--xs{width:calc(var(--_cob-icon-size) * .75);height:calc(var(--_cob-icon-size) * .75)}.cob-icon--sm{width:calc(var(--_cob-icon-size) * .875);height:calc(var(--_cob-icon-size) * .875)}.cob-icon--md{width:var(--_cob-icon-size);height:var(--_cob-icon-size)}.cob-icon--lg{width:calc(var(--_cob-icon-size) * 1.125);height:calc(var(--_cob-icon-size) * 1.125)}.cob-icon--xl{width:calc(var(--_cob-icon-size) * 1.25);height:calc(var(--_cob-icon-size) * 1.25)}.cob-icon--2xl{width:calc(var(--_cob-icon-size) * 1.5);height:calc(var(--_cob-icon-size) * 1.5)}.cob-icon--3xl{width:calc(var(--_cob-icon-size) * 1.875);height:calc(var(--_cob-icon-size) * 1.875)}.cob-icon--4xl{width:calc(var(--_cob-icon-size) * 2.25);height:calc(var(--_cob-icon-size) * 2.25)}.cob-icon--5xl{width:calc(var(--_cob-icon-size) * 3);height:calc(var(--_cob-icon-size) * 3)}.cob-icon--12{width:.75rem;height:.75rem}.cob-icon--14{width:.875rem;height:.875rem}.cob-icon--16{width:1rem;height:1rem}.cob-icon--18{width:1.125rem;height:1.125rem}.cob-icon--20{width:1.25rem;height:1.25rem}.cob-icon--24{width:1.5rem;height:1.5rem}.cob-icon--32{width:2rem;height:2rem}.cob-icon--40{width:2.5rem;height:2.5rem}.cob-icon--50{width:3.125rem;height:3.125rem}.cob-icon--flip-horizontal{transform:scaleX(-1)}.cob-icon--flip-vertical{transform:scaleY(-1)}.cob-icon--flip-both{transform:scale(-1)}";
|
|
903
|
-
var zr = Object.defineProperty, X = (o, e, c, i) => {
|
|
904
|
-
for (var l = void 0, u = o.length - 1, A; u >= 0; u--)
|
|
905
|
-
(A = o[u]) && (l = A(e, c, l) || l);
|
|
906
|
-
return l && zr(e, c, l), l;
|
|
907
|
-
}, St;
|
|
908
|
-
const H = (St = class extends bo {
|
|
909
|
-
constructor() {
|
|
910
|
-
super(...arguments), this.name = "", this.library = "default", this.ariaLabel = "", this.rotate = "0", this.flip = "", this.color = "", this.size = "md", this._svg = null, this._loadSeq = 0, this._loadPromise = null;
|
|
911
|
-
}
|
|
912
|
-
/** Resolves when the current icon load (if any) is complete. */
|
|
913
|
-
get updateComplete() {
|
|
914
|
-
return (async () => {
|
|
915
|
-
const o = await super.updateComplete;
|
|
916
|
-
return await this._loadPromise, o;
|
|
917
|
-
})();
|
|
918
|
-
}
|
|
919
|
-
connectedCallback() {
|
|
920
|
-
super.connectedCallback(), Ko(this.library, this);
|
|
921
|
-
}
|
|
922
|
-
disconnectedCallback() {
|
|
923
|
-
super.disconnectedCallback(), Xo(this.library, this);
|
|
924
|
-
}
|
|
925
|
-
/** Called by the icon library registry when the current library changes. */
|
|
926
|
-
redraw() {
|
|
927
|
-
this._loadIcon();
|
|
928
|
-
}
|
|
929
|
-
/**
|
|
930
|
-
* Lit calls firstUpdated after the first render, once all reactive
|
|
931
|
-
* properties (including those set from the template) are resolved.
|
|
932
|
-
* This guarantees the initial _loadIcon runs with the correct name
|
|
933
|
-
* and library values, avoiding the race where updated() might not
|
|
934
|
-
* fire for properties that equal their defaults.
|
|
935
|
-
*/
|
|
936
|
-
firstUpdated() {
|
|
937
|
-
this._loadIcon();
|
|
938
|
-
}
|
|
939
|
-
updated(o) {
|
|
940
|
-
if (o.has("name") && !St._validName.test(this.name)) {
|
|
941
|
-
console.warn(`cob-icon: invalid name "${this.name}" — ignored`), this._svg = null;
|
|
942
|
-
return;
|
|
119
|
+
reportValidity() {
|
|
120
|
+
return this.internals?.reportValidity() ?? !0;
|
|
943
121
|
}
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
const e = o.get("library");
|
|
947
|
-
e && Xo(e, this), Ko(this.library, this);
|
|
948
|
-
}
|
|
949
|
-
this._loadIcon();
|
|
122
|
+
formResetCallback() {
|
|
123
|
+
this.internalValidationMessage = "", this.clearValidity();
|
|
950
124
|
}
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
_loadIcon() {
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
this._svg = null;
|
|
959
|
-
return;
|
|
960
|
-
}
|
|
961
|
-
try {
|
|
962
|
-
const c = await e.resolver(this.name);
|
|
963
|
-
if (o !== this._loadSeq) return;
|
|
964
|
-
if (!c) {
|
|
965
|
-
this._svg = null;
|
|
966
|
-
return;
|
|
967
|
-
}
|
|
968
|
-
const i = typeof c == "string" ? await ue(c) : c.type === "url" ? await ue(c.href) : Rr(c.content);
|
|
969
|
-
if (o !== this._loadSeq) return;
|
|
970
|
-
e.mutator?.(i), this._applyAttributes(i), this._svg = i;
|
|
971
|
-
} catch {
|
|
972
|
-
o === this._loadSeq && (this._svg = null);
|
|
973
|
-
}
|
|
974
|
-
})();
|
|
975
|
-
}
|
|
976
|
-
_applyAttributes(o) {
|
|
977
|
-
o.setAttribute("role", "img"), this.ariaLabel ? (o.setAttribute("aria-label", this.ariaLabel), o.removeAttribute("aria-hidden")) : (o.setAttribute("aria-hidden", "true"), o.removeAttribute("aria-label")), this.rotate && this.rotate !== "0" ? o.style.rotate = `${this.rotate}deg` : o.style.removeProperty("rotate"), o.style.color = this.color || "currentcolor", o.classList.add(`cob-icon--${this.size}`), o.classList.add("cob-icon--svg"), this.flip && o.classList.add(`cob-icon--flip-${this.flip}`);
|
|
978
|
-
}
|
|
979
|
-
render() {
|
|
980
|
-
return this._svg ? R`${this._svg}` : null;
|
|
981
|
-
}
|
|
982
|
-
}, St.styles = fe(Dr), St._validName = /^[a-zA-Z0-9_-]+$/, St);
|
|
983
|
-
X([
|
|
984
|
-
d({ type: String, reflect: !0 })
|
|
985
|
-
], H.prototype, "name");
|
|
986
|
-
X([
|
|
987
|
-
d({ type: String, reflect: !0 })
|
|
988
|
-
], H.prototype, "library");
|
|
989
|
-
X([
|
|
990
|
-
d({ type: String })
|
|
991
|
-
], H.prototype, "ariaLabel");
|
|
992
|
-
X([
|
|
993
|
-
d({ type: String })
|
|
994
|
-
], H.prototype, "rotate");
|
|
995
|
-
X([
|
|
996
|
-
d({ type: String })
|
|
997
|
-
], H.prototype, "flip");
|
|
998
|
-
X([
|
|
999
|
-
d({ type: String })
|
|
1000
|
-
], H.prototype, "color");
|
|
1001
|
-
X([
|
|
1002
|
-
d({ type: String })
|
|
1003
|
-
], H.prototype, "size");
|
|
1004
|
-
X([
|
|
1005
|
-
Mt()
|
|
1006
|
-
], H.prototype, "_svg");
|
|
1007
|
-
let Lr = H;
|
|
1008
|
-
customElements.get("cob-icon") || customElements.define("cob-icon", Lr);
|
|
1009
|
-
const Mr = ':host{--_cob-button-width: fit-content;--_cob-button-height: var(--cob-size-600, 48px);--_cob-button-border-radius: var(--cob-radius-xl, 12px);--_cob-button-padding--y: calc( var(--cob-space-150, 12px) - var(--cob-border-width-md, 2px) );--_cob-button-cursor: pointer;--_cob-button-padding--x: calc( var(--cob-space-250, 20px) - var(--cob-border-width-md, 2px) );--_cob-button-gap: var(--cob-space-100, 8px);--_cob-button-justify-content: center;--_cob-button-border-style: solid;--_cob-button-border-width: var(--cob-border-width-md, 2px);--_cob-button-outline-width: var(--cob-border-width-md, 2px);--_cob-button-outline-offset: var(--cob-space-2px, 2px);--_cob-button-outline-color: var(--cob-color-focus, #004dd1);--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-theme, #1871bd) );--_cob-button-color: var( --cob-button-color, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-theme-strong, #125084) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-theme-stronger, #091f2f) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-neutral-10, #f6f6f6 );--_cob-button-color--disabled: var(--cob-color-text-disabled, #bec0c1);--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00);--_cob-button-font-size: var(--cob-font-size-ui-md, 16px);--_cob-button-font-weight: var(--cob-font-weight-semibold, 600);--_cob-button-line-height: var(--cob-font-lineheight-ui-md, 24px);--_cob-button-font-family: var( --cob-font-family-ui, var(--cob-font-family-serif, "Lora", "Georgia", "Times New Roman", serif) );--_cob-button-text-decoration: none;display:inline-flex;width:var(--_cob-button-width);vertical-align:middle}:host([size=sm]){--_cob-button-height: var(--cob-size-500, 40px);--_cob-button-padding--y: calc( var(--cob-space-100, 8px) - var(--cob-border-width-md, 2px) );--_cob-button-padding--x: calc( var(--cob-space-200, 16px) - var(--cob-border-width-md, 2px) )}:host([size=lg]){--_cob-button-height: var(--cob-size-700, 56px);--_cob-button-padding--y: calc( var(--cob-space-200, 16px) - var(--cob-border-width-md, 2px) );--_cob-button-padding--x: calc( var(--cob-space-300, 24px) - var(--cob-border-width-md, 2px) )}:host([fullWidth]){width:100%}:host([fullWidth]) .cob-button__linkwrapper{width:100%}:host([fullWidth]) .cob-button{width:100%}:host([variant=filled]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-theme, #1871bd) );--_cob-button-color: var( --cob-button-color, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-theme-strong, #125084) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--hover: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-theme-stronger, #091f2f) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--active: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-neutral-10, #f6f6f6 );--_cob-button-color--disabled: var(--cob-color-text-disabled, #bec0c1)}:host([variant=outline]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-surface, #ffffff) );--_cob-button-color: var(--cob-button-color, var(--cob-color-theme, #1871bd));--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-theme, #1871bd) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-theme-weaker, #d0e9fc) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-theme-strong, #125084) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-theme-strong, #125084) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-theme-weak, #cddde9) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-theme-strong, #125084) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-theme-strong, #125084) );--_cob-button-background-color--disabled: var(--cob-color-surface, #ffffff);--_cob-button-color--disabled: var(--cob-color-text-disabled, #bec0c1);--_cob-button-border-color--disabled: var(--cob-color-neutral-100, #d0d0ce)}:host([variant=text]){--_cob-button-height: fit-content;--_cob-button-border-radius: var(--cob-radius-md, 4px);--_cob-button-padding--y: var(--cob-space-2px, 2px);--_cob-button-padding--x: 0;--_cob-button-border-width: 0px;--_cob-button-text-decoration: underline;--_cob-button-text-decoration-thickness: var( --cob-font-decoration-thickness-regular, 7% );--_cob-button-text-decoration-thickness--hover: var( --cob-font-decoration-thickness-strong, 14% );--_cob-button-text-decoration-thickness--active: var( --cob-font-decoration-thickness-strong, 14% );--_cob-button-gap: var(--cob-space-50, 4px);--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-color: var(--cob-button-color, var(--cob-color-link, #004dd1));--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-link-strong, #003ba1) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-link-strongest, #002971) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-transparent, #ffffff00 );--_cob-button-color--disabled: var(--cob-color-text-disabled, #bec0c1);--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00)}:host([variant=ghost]){--_cob-button-gap: var(--cob-space-50, 4px);--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-color: var(--cob-button-color, var(--cob-color-text, #1b1b1b));--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-black-transparent-100, #0000001a) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text, #1b1b1b) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-black-transparent-200, #00000033) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text, #1b1b1b) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-transparent, #ffffff00 );--_cob-button-color--disabled: var(--cob-color-text-disabled, #bec0c1);--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00)}:host([variant=filled][inverted]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-surface, #ffffff) );--_cob-button-color: var(--cob-button-color, var(--cob-color-text, #1b1b1b));--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00);--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-neutral-100, #d0d0ce) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text, #1b1b1b) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-neutral-300, #a7a9ab) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text, #1b1b1b) );--_cob-button-background-color--disabled: var(--cob-color-text, #1b1b1b);--_cob-button-color--disabled: var(--cob-color-text-disabled, #62666a)}:host([variant=outline][inverted]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-surface-reverse, #1b1b1b) );--_cob-button-color: var( --cob-button-color, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-ink-reverse, #ffffff) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-surface-reverse, #1b1b1b) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text-reverse-weak, #d0d0ce) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-neutral-100, #d0d0ce) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-surface-reverse, #1b1b1b) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text-reverse-weaker, #bec0c1) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-neutral-300, #a7a9ab) );--_cob-button-background-color--disabled: var( --cob-color-surface-reverse, #1b1b1b );--_cob-button-color--disabled: var( --cob-color-text-reverse-disabled, #62666a );--_cob-button-border-color--disabled: var(--cob-color-neutral-600, #62666a)}:host([variant=text][inverted]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-color: var( --cob-button-color, var(--cob-color-link-reverse, #a7a9ab) );--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-link-reverse-strong, #ededed) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-reverse-strongest, #ffffff) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-transparent, #ffffff00 );--_cob-button-color--disabled: var( --cob-color-text-reverse-disabled, #62666a );--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00)}:host([variant=ghost][inverted]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-color: var( --cob-button-color, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-white-transparent-200, #ffffff33) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-white-transparent-300, #ffffff4d) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-transparent, #ffffff00 );--_cob-button-color--disabled: var(--cob-color-text-disabled, #62666a);--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00)}:host([inverted]){--_cob-button-outline-color: var(--cob-color-focus-reverse, #7aa5e7)}:host([circle]){--_cob-button-width: var(--_cob-button-height);--_cob-button-border-radius: var(--cob-radius-round, 1776px);--_cob-button-padding--y: 0;--_cob-button-padding--x: 0}:host([circle]) .cob-button{max-width:var(--_cob-button-height);max-height:var(--_cob-button-height)}.cob-button{width:var(--_cob-button-width);min-height:var(--_cob-button-height);border-radius:var(--_cob-button-border-radius);padding:var(--_cob-button-padding--y) var(--_cob-button-padding--x);display:flex;align-items:center;justify-content:var(--_cob-button-justify-content);gap:var(--_cob-button-gap);font-family:var(--_cob-button-font-family);font-size:var(--_cob-button-font-size);font-weight:var(--_cob-button-font-weight);line-height:var(--_cob-button-line-height);text-decoration:var(--_cob-button-text-decoration);box-sizing:border-box;background-color:var(--_cob-button-background-color);color:var(--_cob-button-color);border-color:var(--_cob-button-border-color);border-style:var(--_cob-button-border-style);border-width:var(--_cob-button-border-width);cursor:var(--_cob-button-cursor)}.cob-button:hover{background-color:var(--_cob-button-background-color--hover);color:var(--_cob-button-color--hover);border-color:var(--_cob-button-border-color--hover);text-decoration-thickness:var(--_cob-button-text-decoration-thickness--hover, auto)}.cob-button:active,.cob-button.active{background-color:var(--_cob-button-background-color--active);color:var(--_cob-button-color--active);border-color:var(--_cob-button-border-color--active);text-decoration-thickness:var(--_cob-button-text-decoration-thickness--active, auto)}.cob-button:disabled,a[disabled]{background-color:var(--_cob-button-background-color--disabled);color:var(--_cob-button-color--disabled);border-color:var(--_cob-button-border-color--disabled);--_cob-button-cursor: not-allowed}a[disabled]{pointer-events:none}.cob-button:focus-visible{outline-offset:var(--_cob-button-outline-offset);outline:solid var(--_cob-button-outline-width) var(--_cob-button-outline-color)}.cob-button__text{display:flex;align-items:center;-webkit-user-select:none;user-select:none}';
|
|
1010
|
-
var Pr = Object.defineProperty, m = (o, e, c, i) => {
|
|
1011
|
-
for (var l = void 0, u = o.length - 1, A; u >= 0; u--)
|
|
1012
|
-
(A = o[u]) && (l = A(e, c, l) || l);
|
|
1013
|
-
return l && Pr(e, c, l), l;
|
|
125
|
+
};
|
|
126
|
+
return o.formAssociated = !0, o;
|
|
127
|
+
}, C = /* @__PURE__ */ w(p), V = ':host{--_cob-button-width: fit-content;--_cob-button-height: var(--cob-size-600, 48px);--_cob-button-border-radius: var(--cob-radius-xl, 12px);--_cob-button-padding--y: calc( var(--cob-space-150, 12px) - var(--cob-border-width-md, 2px) );--_cob-button-cursor: pointer;--_cob-button-padding--x: calc( var(--cob-space-250, 20px) - var(--cob-border-width-md, 2px) );--_cob-button-gap: var(--cob-space-100, 8px);--_cob-button-justify-content: center;--_cob-button-border-style: solid;--_cob-button-border-width: var(--cob-border-width-md, 2px);--_cob-button-outline-width: var(--cob-border-width-md, 2px);--_cob-button-outline-offset: var(--cob-space-2px, 2px);--_cob-button-outline-color: var(--cob-color-focus, #004dd1);--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-theme, #1871bd) );--_cob-button-color: var( --cob-button-color, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-theme-strong, #125084) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-theme-stronger, #091f2f) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-neutral-10, #f6f6f6 );--_cob-button-color--disabled: var(--cob-color-text-disabled, #bec0c1);--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00);--_cob-button-font-size: var(--cob-font-size-ui-md, 16px);--_cob-button-font-weight: var(--cob-font-weight-semibold, 600);--_cob-button-line-height: var(--cob-font-lineheight-ui-md, 24px);--_cob-button-font-family: var( --cob-font-family-ui, var(--cob-font-family-serif, "Lora", "Georgia", "Times New Roman", serif) );--_cob-button-text-decoration: none;display:inline-flex;width:var(--_cob-button-width);vertical-align:middle}:host([size=sm]){--_cob-button-height: var(--cob-size-500, 40px);--_cob-button-padding--y: calc( var(--cob-space-100, 8px) - var(--cob-border-width-md, 2px) );--_cob-button-padding--x: calc( var(--cob-space-200, 16px) - var(--cob-border-width-md, 2px) )}:host([size=lg]){--_cob-button-height: var(--cob-size-700, 56px);--_cob-button-padding--y: calc( var(--cob-space-200, 16px) - var(--cob-border-width-md, 2px) );--_cob-button-padding--x: calc( var(--cob-space-300, 24px) - var(--cob-border-width-md, 2px) )}:host([fullWidth]){width:100%}:host([fullWidth]) .cob-button__linkwrapper{width:100%}:host([fullWidth]) .cob-button{width:100%}:host([variant=filled]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-theme, #1871bd) );--_cob-button-color: var( --cob-button-color, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-theme-strong, #125084) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--hover: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-theme-stronger, #091f2f) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--active: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-neutral-10, #f6f6f6 );--_cob-button-color--disabled: var(--cob-color-text-disabled, #bec0c1)}:host([variant=outline]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-surface, #ffffff) );--_cob-button-color: var(--cob-button-color, var(--cob-color-theme, #1871bd));--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-theme, #1871bd) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-theme-weaker, #d0e9fc) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-theme-strong, #125084) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-theme-strong, #125084) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-theme-weak, #cddde9) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-theme-strong, #125084) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-theme-strong, #125084) );--_cob-button-background-color--disabled: var(--cob-color-surface, #ffffff);--_cob-button-color--disabled: var(--cob-color-text-disabled, #bec0c1);--_cob-button-border-color--disabled: var(--cob-color-neutral-100, #d0d0ce)}:host([variant=text]){--_cob-button-height: fit-content;--_cob-button-border-radius: var(--cob-radius-md, 4px);--_cob-button-padding--y: var(--cob-space-2px, 2px);--_cob-button-padding--x: 0;--_cob-button-border-width: 0px;--_cob-button-text-decoration: var(--cob-button-text-decoration, underline);--_cob-button-text-decoration-thickness: var( --cob-font-decoration-thickness-regular, 7% );--_cob-button-text-decoration-thickness--hover: var( --cob-font-decoration-thickness-strong, 14% );--_cob-button-text-decoration-thickness--active: var( --cob-font-decoration-thickness-strong, 14% );--_cob-button-gap: var(--cob-space-50, 4px);--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-color: var(--cob-button-color, var(--cob-color-link, #004dd1));--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-link-strong, #003ba1) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-link-strongest, #002971) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-transparent, #ffffff00 );--_cob-button-color--disabled: var(--cob-color-text-disabled, #bec0c1);--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00)}:host([variant=ghost]){--_cob-button-gap: var(--cob-space-50, 4px);--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-color: var(--cob-button-color, var(--cob-color-text, #1b1b1b));--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-black-transparent-100, #0000001a) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text, #1b1b1b) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-black-transparent-200, #00000033) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text, #1b1b1b) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-transparent, #ffffff00 );--_cob-button-color--disabled: var(--cob-color-text-disabled, #bec0c1);--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00)}:host([variant=filled][inverted]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-surface, #ffffff) );--_cob-button-color: var(--cob-button-color, var(--cob-color-text, #1b1b1b));--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00);--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-neutral-100, #d0d0ce) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text, #1b1b1b) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-neutral-300, #a7a9ab) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text, #1b1b1b) );--_cob-button-background-color--disabled: var(--cob-color-text, #1b1b1b);--_cob-button-color--disabled: var(--cob-color-text-disabled, #62666a)}:host([variant=outline][inverted]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-surface-reverse, #1b1b1b) );--_cob-button-color: var( --cob-button-color, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-ink-reverse, #ffffff) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-surface-reverse, #1b1b1b) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text-reverse-weak, #d0d0ce) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-neutral-100, #d0d0ce) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-surface-reverse, #1b1b1b) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text-reverse-weaker, #bec0c1) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-neutral-300, #a7a9ab) );--_cob-button-background-color--disabled: var( --cob-color-surface-reverse, #1b1b1b );--_cob-button-color--disabled: var( --cob-color-text-reverse-disabled, #62666a );--_cob-button-border-color--disabled: var(--cob-color-neutral-600, #62666a)}:host([variant=text][inverted]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-color: var( --cob-button-color, var(--cob-color-link-reverse, #a7a9ab) );--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-link-reverse-strong, #ededed) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-reverse-strongest, #ffffff) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-transparent, #ffffff00 );--_cob-button-color--disabled: var( --cob-color-text-reverse-disabled, #62666a );--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00)}:host([variant=ghost][inverted]){--_cob-button-background-color: var( --cob-button-background-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-color: var( --cob-button-color, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color: var( --cob-button-border-color, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--hover: var( --cob-button-background-color--hover, var(--cob-color-white-transparent-200, #ffffff33) );--_cob-button-color--hover: var( --cob-button-color--hover, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--hover: var( --cob-button-border-color--hover, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--active: var( --cob-button-background-color--active, var(--cob-color-white-transparent-300, #ffffff4d) );--_cob-button-color--active: var( --cob-button-color--active, var(--cob-color-text-reverse, #ffffff) );--_cob-button-border-color--active: var( --cob-button-border-color--active, var(--cob-color-transparent, #ffffff00) );--_cob-button-background-color--disabled: var( --cob-color-transparent, #ffffff00 );--_cob-button-color--disabled: var(--cob-color-text-disabled, #62666a);--_cob-button-border-color--disabled: var(--cob-color-transparent, #ffffff00)}:host([inverted]){--_cob-button-outline-color: var(--cob-color-focus-reverse, #7aa5e7)}:host([circle]){--_cob-button-width: var(--_cob-button-height);--_cob-button-border-radius: var(--cob-radius-round, 1776px);--_cob-button-padding--y: 0;--_cob-button-padding--x: 0}:host([circle]) .cob-button{max-width:var(--_cob-button-height);max-height:var(--_cob-button-height)}.cob-button{width:var(--_cob-button-width);min-height:var(--_cob-button-height);border-radius:var(--_cob-button-border-radius);padding:var(--_cob-button-padding--y) var(--_cob-button-padding--x);display:flex;align-items:center;justify-content:var(--_cob-button-justify-content);gap:var(--_cob-button-gap);font-family:var(--_cob-button-font-family);font-size:var(--_cob-button-font-size);font-weight:var(--_cob-button-font-weight);line-height:var(--_cob-button-line-height);text-decoration:var(--_cob-button-text-decoration);text-decoration-thickness:var(--_cob-button-text-decoration-thickness, auto);box-sizing:border-box;background-color:var(--_cob-button-background-color);color:var(--_cob-button-color);border-color:var(--_cob-button-border-color);border-style:var(--_cob-button-border-style);border-width:var(--_cob-button-border-width);cursor:var(--_cob-button-cursor)}.cob-button:hover{background-color:var(--_cob-button-background-color--hover);color:var(--_cob-button-color--hover);border-color:var(--_cob-button-border-color--hover);text-decoration-line:var(--cob-button-text-decoration--hover, var(--_cob-button-text-decoration));text-decoration-thickness:var(--_cob-button-text-decoration-thickness--hover, auto)}.cob-button:active,.cob-button.active{background-color:var(--_cob-button-background-color--active);color:var(--_cob-button-color--active);border-color:var(--_cob-button-border-color--active);text-decoration-line:var(--cob-button-text-decoration--active, var(--cob-button-text-decoration--hover, var(--_cob-button-text-decoration)));text-decoration-thickness:var(--_cob-button-text-decoration-thickness--active, auto)}.cob-button:disabled,a[disabled]{background-color:var(--_cob-button-background-color--disabled);color:var(--_cob-button-color--disabled);border-color:var(--_cob-button-border-color--disabled);--_cob-button-cursor: not-allowed}a[disabled]{pointer-events:none}.cob-button:focus-visible,.active-focus{outline-offset:var(--_cob-button-outline-offset);outline:solid var(--_cob-button-outline-width) var(--_cob-button-outline-color)}.cob-button__text{display:flex;align-items:center;-webkit-user-select:none;user-select:none}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;border:0}';
|
|
128
|
+
var I = Object.defineProperty, r = (a, o, e, l) => {
|
|
129
|
+
for (var b = void 0, s = a.length - 1, u; s >= 0; s--)
|
|
130
|
+
(u = a[s]) && (b = u(o, e, b) || b);
|
|
131
|
+
return b && I(o, e, b), b;
|
|
1014
132
|
};
|
|
1015
|
-
|
|
1016
|
-
const wt = class wt extends bo {
|
|
1017
|
-
// allows use of elementInternals' API
|
|
133
|
+
const d = class d extends C {
|
|
1018
134
|
constructor() {
|
|
1019
|
-
super(), this.id = "", this.name = "", this.size = "md", this.fullWidth = !1, this.variant = "filled", this.inverted = !1, this.label = "", this.
|
|
1020
|
-
}
|
|
1021
|
-
connectedCallback() {
|
|
1022
|
-
super.connectedCallback(), this.id || (this.id = this._generateUniqueId());
|
|
135
|
+
super(...arguments), this.id = "", this.name = "", this.size = "md", this.fullWidth = !1, this.variant = "filled", this.inverted = !1, this.label = "", this.ariaControls = "", this.ariaExpanded = "", this.ariaCurrent = "", this.prefixIcon = "", this.suffixIcon = "", this.circle = !1, this.icon = "", this.disabled = !1, this.form = null, this.value = "", this.ariaDescribedBy = "", this.type = "button", this.onClick = null, this.href = "", this.target = "_self", this._hasPrefixSlot = !1, this._hasSuffixSlot = !1, this._hasCircleSlot = !1;
|
|
1023
136
|
}
|
|
1024
137
|
/**
|
|
1025
138
|
* Functions
|
|
1026
139
|
* --------------------------------------------------------------------------
|
|
140
|
+
*
|
|
141
|
+
* Form association, ElementInternals, and id generation are provided by
|
|
142
|
+
* CobFormControlElement (@cobwds/internals). super.connectedCallback() assigns
|
|
143
|
+
* an id when one is not provided (prefix = the element's localName).
|
|
1027
144
|
*/
|
|
1028
|
-
|
|
1029
|
-
|
|
145
|
+
_onPrefixSlotChange(o) {
|
|
146
|
+
const e = o.target;
|
|
147
|
+
this._hasPrefixSlot = e.assignedElements({ flatten: !0 }).length > 0;
|
|
1030
148
|
}
|
|
1031
|
-
|
|
1032
|
-
const
|
|
1033
|
-
this.
|
|
149
|
+
_onSuffixSlotChange(o) {
|
|
150
|
+
const e = o.target;
|
|
151
|
+
this._hasSuffixSlot = e.assignedElements({ flatten: !0 }).length > 0;
|
|
1034
152
|
}
|
|
1035
|
-
|
|
1036
|
-
const
|
|
1037
|
-
this.
|
|
1038
|
-
}
|
|
1039
|
-
_onCircleSlotChange(e) {
|
|
1040
|
-
const c = e.target;
|
|
1041
|
-
this._hasCircleSlot = c.assignedElements({ flatten: !0 }).length > 0;
|
|
153
|
+
_onCircleSlotChange(o) {
|
|
154
|
+
const e = o.target;
|
|
155
|
+
this._hasCircleSlot = e.assignedElements({ flatten: !0 }).length > 0;
|
|
1042
156
|
}
|
|
1043
157
|
_manageFormAction() {
|
|
1044
158
|
typeof this.onClick == "function" && this.onClick !== null && this.onClick(new Event("click"));
|
|
1045
|
-
const
|
|
1046
|
-
if (
|
|
159
|
+
const o = this.internals?.form;
|
|
160
|
+
if (o)
|
|
1047
161
|
switch (this.type) {
|
|
1048
|
-
case "submit":
|
|
1049
|
-
e.
|
|
162
|
+
case "submit": {
|
|
163
|
+
const e = this.name !== "" && this.value !== "";
|
|
164
|
+
e && this.setFormValue(this.value);
|
|
165
|
+
try {
|
|
166
|
+
o.requestSubmit();
|
|
167
|
+
} finally {
|
|
168
|
+
e && this.setFormValue(null);
|
|
169
|
+
}
|
|
1050
170
|
break;
|
|
171
|
+
}
|
|
1051
172
|
case "reset":
|
|
1052
|
-
|
|
173
|
+
o.reset();
|
|
1053
174
|
break;
|
|
1054
175
|
}
|
|
1055
176
|
}
|
|
@@ -1058,40 +179,34 @@ const wt = class wt extends bo {
|
|
|
1058
179
|
* --------------------------------------------------------------------------
|
|
1059
180
|
*/
|
|
1060
181
|
_handleFocus() {
|
|
1061
|
-
this
|
|
1062
|
-
new Event("cob-focus", { bubbles: !0, composed: !0 })
|
|
1063
|
-
);
|
|
182
|
+
_(this, "focus");
|
|
1064
183
|
}
|
|
1065
184
|
_handleBlur() {
|
|
1066
|
-
this.shadowRoot?.querySelector(".cob-button")?.classList.remove("active-focus"), this
|
|
1067
|
-
new Event("cob-blur", { bubbles: !0, composed: !0 })
|
|
1068
|
-
);
|
|
185
|
+
this.shadowRoot?.querySelector(".cob-button")?.classList.remove("active-focus"), _(this, "blur");
|
|
1069
186
|
}
|
|
1070
|
-
_handleClick(
|
|
187
|
+
_handleClick(o) {
|
|
1071
188
|
if (this.disabled) {
|
|
1072
|
-
|
|
189
|
+
o.preventDefault();
|
|
1073
190
|
return;
|
|
1074
191
|
}
|
|
1075
|
-
this._manageFormAction(), this
|
|
1076
|
-
new Event("cob-click", { bubbles: !0, composed: !0 })
|
|
1077
|
-
);
|
|
192
|
+
this._manageFormAction(), y(this, "cob-click", void 0);
|
|
1078
193
|
}
|
|
1079
|
-
_handleKeydown(
|
|
1080
|
-
if (
|
|
194
|
+
_handleKeydown(o) {
|
|
195
|
+
if (o.code === "Space" || o.code === "Enter" || o.key === " " || o.key === "Enter") {
|
|
1081
196
|
if (this.disabled) return;
|
|
1082
|
-
|
|
1083
|
-
const
|
|
1084
|
-
if (
|
|
1085
|
-
const
|
|
197
|
+
o.preventDefault();
|
|
198
|
+
const e = this.renderRoot.querySelector(".cob-button");
|
|
199
|
+
if (e?.classList.add("active"), setTimeout(() => e?.classList.remove("active"), 150), this.href) {
|
|
200
|
+
const l = this.renderRoot.querySelector(
|
|
1086
201
|
"a.cob-button"
|
|
1087
202
|
);
|
|
1088
|
-
|
|
203
|
+
l && l.click();
|
|
1089
204
|
} else
|
|
1090
|
-
this._handleAnyAttributeFunction(), this._handleClick(
|
|
205
|
+
this._handleAnyAttributeFunction(), this._handleClick(o);
|
|
1091
206
|
}
|
|
1092
207
|
}
|
|
1093
|
-
_handleKeyup(
|
|
1094
|
-
(
|
|
208
|
+
_handleKeyup(o) {
|
|
209
|
+
(o.code === "Space" || o.code === "Enter" || o.key === " " || o.key === "Enter") && this.renderRoot.querySelector(".cob-button")?.classList.remove("active");
|
|
1095
210
|
}
|
|
1096
211
|
/**
|
|
1097
212
|
* Handles inline onclick attributes for keyboard activation.
|
|
@@ -1105,22 +220,22 @@ const wt = class wt extends bo {
|
|
|
1105
220
|
_handleAnyAttributeFunction() {
|
|
1106
221
|
this.click();
|
|
1107
222
|
}
|
|
1108
|
-
focus(
|
|
1109
|
-
const
|
|
223
|
+
focus(o) {
|
|
224
|
+
const e = this.renderRoot.querySelector(
|
|
1110
225
|
this.href ? "a.cob-button" : "button.cob-button"
|
|
1111
226
|
);
|
|
1112
|
-
|
|
227
|
+
e ? e.focus(o) : super.focus(o);
|
|
1113
228
|
}
|
|
1114
229
|
render() {
|
|
1115
|
-
return
|
|
1116
|
-
${this.href ?
|
|
230
|
+
return n`
|
|
231
|
+
${this.href ? n`
|
|
1117
232
|
<div class="cob-button__linkwrapper">
|
|
1118
233
|
<a
|
|
1119
234
|
class="cob-button"
|
|
1120
|
-
name=${
|
|
235
|
+
name=${i(this.name ? this.name : void 0)}
|
|
1121
236
|
?disabled=${this.disabled}
|
|
1122
237
|
aria-disabled="${this.disabled ? "true" : "false"}"
|
|
1123
|
-
value=${
|
|
238
|
+
value=${i(this.value ? this.value : void 0)}
|
|
1124
239
|
href=${this.href}
|
|
1125
240
|
target=${this.target}
|
|
1126
241
|
@click=${this._handleClick}
|
|
@@ -1128,29 +243,29 @@ const wt = class wt extends bo {
|
|
|
1128
243
|
@blur="${this._handleBlur}"
|
|
1129
244
|
@keydown="${this._handleKeydown}"
|
|
1130
245
|
@keyup="${this._handleKeyup}"
|
|
1131
|
-
|
|
1132
|
-
aria-
|
|
1133
|
-
|
|
1134
|
-
)}
|
|
1135
|
-
aria-description=${P(this.ariaDescription || void 0)}
|
|
246
|
+
aria-describedby=${i(this.ariaDescribedBy || void 0)}
|
|
247
|
+
aria-expanded=${i(this.ariaExpanded || void 0)}
|
|
248
|
+
aria-current=${i(this.ariaCurrent || void 0)}
|
|
1136
249
|
>
|
|
1137
250
|
<slot
|
|
1138
251
|
name="prefix-icon"
|
|
1139
252
|
@slotchange=${this._onPrefixSlotChange}
|
|
1140
253
|
?hidden=${!this.prefixIcon && !this._hasPrefixSlot}
|
|
1141
254
|
>
|
|
1142
|
-
${this.prefixIcon ?
|
|
255
|
+
${this.prefixIcon ? n`<cob-icon
|
|
1143
256
|
size="16"
|
|
1144
257
|
name=${this.prefixIcon}
|
|
1145
258
|
></cob-icon>` : ""}
|
|
1146
259
|
</slot>
|
|
1147
|
-
${this.circle ?
|
|
260
|
+
${this.circle ? n`<div class="cob-button__text sr-only">
|
|
261
|
+
${this.label}
|
|
262
|
+
</div>` : this.label ? n`<div class="cob-button__text">${this.label}</div>` : n` <slot class="cob-button__default-slot"></slot> `}
|
|
1148
263
|
<slot
|
|
1149
264
|
name="suffix-icon"
|
|
1150
265
|
@slotchange=${this._onSuffixSlotChange}
|
|
1151
266
|
?hidden=${!this.suffixIcon && !this._hasSuffixSlot}
|
|
1152
267
|
>
|
|
1153
|
-
${this.suffixIcon ?
|
|
268
|
+
${this.suffixIcon ? n`<cob-icon
|
|
1154
269
|
size="16"
|
|
1155
270
|
name=${this.suffixIcon}
|
|
1156
271
|
></cob-icon>` : ""}
|
|
@@ -1160,52 +275,50 @@ const wt = class wt extends bo {
|
|
|
1160
275
|
@slotchange=${this._onCircleSlotChange}
|
|
1161
276
|
?hidden=${!this.circle || !this.icon && !this._hasCircleSlot}
|
|
1162
277
|
>
|
|
1163
|
-
${this.icon ?
|
|
278
|
+
${this.icon ? n`<cob-icon
|
|
1164
279
|
size=${this.size === "sm" ? "24" : this.size === "lg" ? "40" : "32"}
|
|
1165
280
|
name=${this.icon}
|
|
1166
281
|
></cob-icon>` : ""}
|
|
1167
282
|
</slot>
|
|
1168
283
|
</a>
|
|
1169
284
|
</div>
|
|
1170
|
-
` :
|
|
285
|
+
` : n`
|
|
1171
286
|
<button
|
|
1172
287
|
class="cob-button"
|
|
1173
|
-
name=${
|
|
288
|
+
name=${i(this.name ? this.name : void 0)}
|
|
1174
289
|
?disabled=${this.disabled}
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
value=${P(this.value ? this.value : void 0)}
|
|
290
|
+
form=${i(this.form || void 0)}
|
|
291
|
+
value=${i(this.value ? this.value : void 0)}
|
|
1178
292
|
type=${this.type}
|
|
1179
|
-
aria-controls=${
|
|
293
|
+
aria-controls=${i(this.ariaControls || void 0)}
|
|
1180
294
|
@click=${this._handleClick}
|
|
1181
|
-
@focus
|
|
1182
|
-
@blur
|
|
1183
|
-
@keydown
|
|
1184
|
-
@keyup
|
|
1185
|
-
|
|
1186
|
-
aria-
|
|
1187
|
-
|
|
1188
|
-
)}
|
|
1189
|
-
aria-description=${P(this.ariaDescription || void 0)}
|
|
1190
|
-
role="button"
|
|
295
|
+
@focus=${this._handleFocus}
|
|
296
|
+
@blur=${this._handleBlur}
|
|
297
|
+
@keydown=${this._handleKeydown}
|
|
298
|
+
@keyup=${this._handleKeyup}
|
|
299
|
+
aria-describedby=${i(this.ariaDescribedBy || void 0)}
|
|
300
|
+
aria-expanded=${i(this.ariaExpanded || void 0)}
|
|
301
|
+
aria-current=${i(this.ariaCurrent || void 0)}
|
|
1191
302
|
>
|
|
1192
303
|
<slot
|
|
1193
304
|
name="prefix-icon"
|
|
1194
305
|
@slotchange=${this._onPrefixSlotChange}
|
|
1195
306
|
?hidden=${!this.prefixIcon && !this._hasPrefixSlot}
|
|
1196
307
|
>
|
|
1197
|
-
${this.prefixIcon ?
|
|
308
|
+
${this.prefixIcon ? n`<cob-icon
|
|
1198
309
|
size="16"
|
|
1199
310
|
name=${this.prefixIcon}
|
|
1200
311
|
></cob-icon>` : ""}
|
|
1201
312
|
</slot>
|
|
1202
|
-
${this.circle ?
|
|
313
|
+
${this.circle ? n`<div class="cob-button__text sr-only">
|
|
314
|
+
${this.label}
|
|
315
|
+
</div>` : this.label ? n`<div class="cob-button__text">${this.label}</div>` : n` <slot class="cob-button__default-slot"></slot> `}
|
|
1203
316
|
<slot
|
|
1204
317
|
name="suffix-icon"
|
|
1205
318
|
@slotchange=${this._onSuffixSlotChange}
|
|
1206
319
|
?hidden=${!this.suffixIcon && !this._hasSuffixSlot}
|
|
1207
320
|
>
|
|
1208
|
-
${this.suffixIcon ?
|
|
321
|
+
${this.suffixIcon ? n`<cob-icon
|
|
1209
322
|
size="16"
|
|
1210
323
|
name=${this.suffixIcon}
|
|
1211
324
|
></cob-icon>` : ""}
|
|
@@ -1215,7 +328,7 @@ const wt = class wt extends bo {
|
|
|
1215
328
|
@slotchange=${this._onCircleSlotChange}
|
|
1216
329
|
?hidden=${!this.circle || !this.icon && !this._hasCircleSlot}
|
|
1217
330
|
>
|
|
1218
|
-
${this.icon ?
|
|
331
|
+
${this.icon ? n`<cob-icon
|
|
1219
332
|
size=${this.size === "sm" ? "24" : this.size === "lg" ? "40" : "32"}
|
|
1220
333
|
name=${this.icon}
|
|
1221
334
|
></cob-icon>` : ""}
|
|
@@ -1225,85 +338,88 @@ const wt = class wt extends bo {
|
|
|
1225
338
|
`;
|
|
1226
339
|
}
|
|
1227
340
|
};
|
|
1228
|
-
|
|
1229
|
-
...
|
|
341
|
+
d.styles = g(V), d.shadowRootOptions = {
|
|
342
|
+
...p.shadowRootOptions,
|
|
1230
343
|
delegatesFocus: !0
|
|
1231
|
-
}
|
|
1232
|
-
let
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
],
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
],
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
],
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
],
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
],
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
],
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
],
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
],
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
],
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
],
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
],
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
],
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
],
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
],
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
],
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
],
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
],
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
],
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
],
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
],
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
],
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
],
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
],
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
],
|
|
1305
|
-
|
|
344
|
+
};
|
|
345
|
+
let t = d;
|
|
346
|
+
r([
|
|
347
|
+
c({ type: String, reflect: !0 })
|
|
348
|
+
], t.prototype, "id");
|
|
349
|
+
r([
|
|
350
|
+
c({ type: String, reflect: !0 })
|
|
351
|
+
], t.prototype, "name");
|
|
352
|
+
r([
|
|
353
|
+
c({ type: String, reflect: !0 })
|
|
354
|
+
], t.prototype, "size");
|
|
355
|
+
r([
|
|
356
|
+
c({ type: Boolean, reflect: !0 })
|
|
357
|
+
], t.prototype, "fullWidth");
|
|
358
|
+
r([
|
|
359
|
+
c({ type: String, reflect: !0 })
|
|
360
|
+
], t.prototype, "variant");
|
|
361
|
+
r([
|
|
362
|
+
c({ type: Boolean, reflect: !0 })
|
|
363
|
+
], t.prototype, "inverted");
|
|
364
|
+
r([
|
|
365
|
+
c({ type: String })
|
|
366
|
+
], t.prototype, "label");
|
|
367
|
+
r([
|
|
368
|
+
c({ type: String })
|
|
369
|
+
], t.prototype, "ariaControls");
|
|
370
|
+
r([
|
|
371
|
+
c({ type: String })
|
|
372
|
+
], t.prototype, "ariaExpanded");
|
|
373
|
+
r([
|
|
374
|
+
c({ type: String })
|
|
375
|
+
], t.prototype, "ariaCurrent");
|
|
376
|
+
r([
|
|
377
|
+
c({ type: String })
|
|
378
|
+
], t.prototype, "prefixIcon");
|
|
379
|
+
r([
|
|
380
|
+
c({ type: String })
|
|
381
|
+
], t.prototype, "suffixIcon");
|
|
382
|
+
r([
|
|
383
|
+
c({ type: Boolean, reflect: !0 })
|
|
384
|
+
], t.prototype, "circle");
|
|
385
|
+
r([
|
|
386
|
+
c({ type: String })
|
|
387
|
+
], t.prototype, "icon");
|
|
388
|
+
r([
|
|
389
|
+
c({ type: Boolean, reflect: !0 })
|
|
390
|
+
], t.prototype, "disabled");
|
|
391
|
+
r([
|
|
392
|
+
c({ type: String, reflect: !0 })
|
|
393
|
+
], t.prototype, "form");
|
|
394
|
+
r([
|
|
395
|
+
c({ type: String })
|
|
396
|
+
], t.prototype, "value");
|
|
397
|
+
r([
|
|
398
|
+
c({ type: String })
|
|
399
|
+
], t.prototype, "ariaDescribedBy");
|
|
400
|
+
r([
|
|
401
|
+
c({ type: String, reflect: !0 })
|
|
402
|
+
], t.prototype, "type");
|
|
403
|
+
r([
|
|
404
|
+
c({ attribute: !1 })
|
|
405
|
+
], t.prototype, "onClick");
|
|
406
|
+
r([
|
|
407
|
+
c({ type: String })
|
|
408
|
+
], t.prototype, "href");
|
|
409
|
+
r([
|
|
410
|
+
c({ type: String, reflect: !0 })
|
|
411
|
+
], t.prototype, "target");
|
|
412
|
+
r([
|
|
413
|
+
v()
|
|
414
|
+
], t.prototype, "_hasPrefixSlot");
|
|
415
|
+
r([
|
|
416
|
+
v()
|
|
417
|
+
], t.prototype, "_hasSuffixSlot");
|
|
418
|
+
r([
|
|
419
|
+
v()
|
|
420
|
+
], t.prototype, "_hasCircleSlot");
|
|
421
|
+
customElements.get("cob-button") || customElements.define("cob-button", t);
|
|
1306
422
|
export {
|
|
1307
|
-
|
|
423
|
+
t as CobButton
|
|
1308
424
|
};
|
|
1309
425
|
//# sourceMappingURL=cob-button.js.map
|