@prefecthq/prefab-ui 0.15.1 → 0.16.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.
@@ -1,571 +0,0 @@
1
- import { j as Yt, c as jt } from "./embed-CoEkwCbq.mjs";
2
- import { a as Xt } from "./icons-CImNZgDa.mjs";
3
- /*! @license DOMPurify 3.3.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.2/LICENSE */
4
- const {
5
- entries: _t,
6
- setPrototypeOf: ct,
7
- isFrozen: Vt,
8
- getPrototypeOf: $t,
9
- getOwnPropertyDescriptor: qt
10
- } = Object;
11
- let {
12
- freeze: R,
13
- seal: L,
14
- create: me
15
- } = Object, {
16
- apply: ke,
17
- construct: Ue
18
- } = typeof Reflect < "u" && Reflect;
19
- R || (R = function(n) {
20
- return n;
21
- });
22
- L || (L = function(n) {
23
- return n;
24
- });
25
- ke || (ke = function(n, l) {
26
- for (var a = arguments.length, c = new Array(a > 2 ? a - 2 : 0), _ = 2; _ < a; _++)
27
- c[_ - 2] = arguments[_];
28
- return n.apply(l, c);
29
- });
30
- Ue || (Ue = function(n) {
31
- for (var l = arguments.length, a = new Array(l > 1 ? l - 1 : 0), c = 1; c < l; c++)
32
- a[c - 1] = arguments[c];
33
- return new n(...a);
34
- });
35
- const fe = O(Array.prototype.forEach), Kt = O(Array.prototype.lastIndexOf), ft = O(Array.prototype.pop), q = O(Array.prototype.push), Zt = O(Array.prototype.splice), pe = O(String.prototype.toLowerCase), Ce = O(String.prototype.toString), Me = O(String.prototype.match), K = O(String.prototype.replace), Jt = O(String.prototype.indexOf), Qt = O(String.prototype.trim), y = O(Object.prototype.hasOwnProperty), S = O(RegExp.prototype.test), Z = en(TypeError);
36
- function O(r) {
37
- return function(n) {
38
- n instanceof RegExp && (n.lastIndex = 0);
39
- for (var l = arguments.length, a = new Array(l > 1 ? l - 1 : 0), c = 1; c < l; c++)
40
- a[c - 1] = arguments[c];
41
- return ke(r, n, a);
42
- };
43
- }
44
- function en(r) {
45
- return function() {
46
- for (var n = arguments.length, l = new Array(n), a = 0; a < n; a++)
47
- l[a] = arguments[a];
48
- return Ue(r, l);
49
- };
50
- }
51
- function s(r, n) {
52
- let l = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : pe;
53
- ct && ct(r, null);
54
- let a = n.length;
55
- for (; a--; ) {
56
- let c = n[a];
57
- if (typeof c == "string") {
58
- const _ = l(c);
59
- _ !== c && (Vt(n) || (n[a] = _), c = _);
60
- }
61
- r[c] = !0;
62
- }
63
- return r;
64
- }
65
- function tn(r) {
66
- for (let n = 0; n < r.length; n++)
67
- y(r, n) || (r[n] = null);
68
- return r;
69
- }
70
- function C(r) {
71
- const n = me(null);
72
- for (const [l, a] of _t(r))
73
- y(r, l) && (Array.isArray(a) ? n[l] = tn(a) : a && typeof a == "object" && a.constructor === Object ? n[l] = C(a) : n[l] = a);
74
- return n;
75
- }
76
- function J(r, n) {
77
- for (; r !== null; ) {
78
- const a = qt(r, n);
79
- if (a) {
80
- if (a.get)
81
- return O(a.get);
82
- if (typeof a.value == "function")
83
- return O(a.value);
84
- }
85
- r = $t(r);
86
- }
87
- function l() {
88
- return null;
89
- }
90
- return l;
91
- }
92
- const ut = R(["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"]), we = R(["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"]), xe = R(["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"]), nn = R(["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"]), Pe = R(["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"]), on = R(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), mt = R(["#text"]), pt = R(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), ve = R(["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"]), Tt = R(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), ue = R(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), an = L(/\{\{[\w\W]*|[\w\W]*\}\}/gm), rn = L(/<%[\w\W]*|[\w\W]*%>/gm), sn = L(/\$\{[\w\W]*/gm), ln = L(/^data-[\-\w.\u00B7-\uFFFF]+$/), cn = L(/^aria-[\-\w]+$/), gt = L(
93
- /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
94
- // eslint-disable-line no-useless-escape
95
- ), fn = L(/^(?:\w+script|data):/i), un = L(
96
- /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
97
- // eslint-disable-line no-control-regex
98
- ), At = L(/^html$/i), mn = L(/^[a-z][.\w]*(-[.\w]+)+$/i);
99
- var dt = /* @__PURE__ */ Object.freeze({
100
- __proto__: null,
101
- ARIA_ATTR: cn,
102
- ATTR_WHITESPACE: un,
103
- CUSTOM_ELEMENT: mn,
104
- DATA_ATTR: ln,
105
- DOCTYPE_NAME: At,
106
- ERB_EXPR: rn,
107
- IS_ALLOWED_URI: gt,
108
- IS_SCRIPT_OR_DATA: fn,
109
- MUSTACHE_EXPR: an,
110
- TMPLIT_EXPR: sn
111
- });
112
- const Q = {
113
- element: 1,
114
- text: 3,
115
- // Deprecated
116
- progressingInstruction: 7,
117
- comment: 8,
118
- document: 9
119
- }, pn = function() {
120
- return typeof window > "u" ? null : window;
121
- }, Tn = function(n, l) {
122
- if (typeof n != "object" || typeof n.createPolicy != "function")
123
- return null;
124
- let a = null;
125
- const c = "data-tt-policy-suffix";
126
- l && l.hasAttribute(c) && (a = l.getAttribute(c));
127
- const _ = "dompurify" + (a ? "#" + a : "");
128
- try {
129
- return n.createPolicy(_, {
130
- createHTML(b) {
131
- return b;
132
- },
133
- createScriptURL(b) {
134
- return b;
135
- }
136
- });
137
- } catch {
138
- return console.warn("TrustedTypes policy " + _ + " could not be created."), null;
139
- }
140
- }, Et = function() {
141
- return {
142
- afterSanitizeAttributes: [],
143
- afterSanitizeElements: [],
144
- afterSanitizeShadowDOM: [],
145
- beforeSanitizeAttributes: [],
146
- beforeSanitizeElements: [],
147
- beforeSanitizeShadowDOM: [],
148
- uponSanitizeAttribute: [],
149
- uponSanitizeElement: [],
150
- uponSanitizeShadowNode: []
151
- };
152
- };
153
- function ht() {
154
- let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : pn();
155
- const n = (i) => ht(i);
156
- if (n.version = "3.3.2", n.removed = [], !r || !r.document || r.document.nodeType !== Q.document || !r.Element)
157
- return n.isSupported = !1, n;
158
- let {
159
- document: l
160
- } = r;
161
- const a = l, c = a.currentScript, {
162
- DocumentFragment: _,
163
- HTMLTemplateElement: b,
164
- Node: Te,
165
- Element: Fe,
166
- NodeFilter: B,
167
- NamedNodeMap: St = r.NamedNodeMap || r.MozNamedAttrMap,
168
- HTMLFormElement: Rt,
169
- DOMParser: Ot,
170
- trustedTypes: ee
171
- } = r, Y = Fe.prototype, Dt = J(Y, "cloneNode"), yt = J(Y, "remove"), Lt = J(Y, "nextSibling"), bt = J(Y, "childNodes"), te = J(Y, "parentNode");
172
- if (typeof b == "function") {
173
- const i = l.createElement("template");
174
- i.content && i.content.ownerDocument && (l = i.content.ownerDocument);
175
- }
176
- let A, j = "";
177
- const {
178
- implementation: de,
179
- createNodeIterator: Nt,
180
- createDocumentFragment: It,
181
- getElementsByTagName: Ct
182
- } = l, {
183
- importNode: Mt
184
- } = a;
185
- let h = Et();
186
- n.isSupported = typeof _t == "function" && typeof te == "function" && de && de.createHTMLDocument !== void 0;
187
- const {
188
- MUSTACHE_EXPR: Ee,
189
- ERB_EXPR: _e,
190
- TMPLIT_EXPR: ge,
191
- DATA_ATTR: wt,
192
- ARIA_ATTR: xt,
193
- IS_SCRIPT_OR_DATA: Pt,
194
- ATTR_WHITESPACE: He,
195
- CUSTOM_ELEMENT: vt
196
- } = dt;
197
- let {
198
- IS_ALLOWED_URI: ze
199
- } = dt, T = null;
200
- const Ge = s({}, [...ut, ...we, ...xe, ...Pe, ...mt]);
201
- let d = null;
202
- const We = s({}, [...pt, ...ve, ...Tt, ...ue]);
203
- let u = Object.seal(me(null, {
204
- tagNameCheck: {
205
- writable: !0,
206
- configurable: !1,
207
- enumerable: !0,
208
- value: null
209
- },
210
- attributeNameCheck: {
211
- writable: !0,
212
- configurable: !1,
213
- enumerable: !0,
214
- value: null
215
- },
216
- allowCustomizedBuiltInElements: {
217
- writable: !0,
218
- configurable: !1,
219
- enumerable: !0,
220
- value: !1
221
- }
222
- })), X = null, ne = null;
223
- const P = Object.seal(me(null, {
224
- tagCheck: {
225
- writable: !0,
226
- configurable: !1,
227
- enumerable: !0,
228
- value: null
229
- },
230
- attributeCheck: {
231
- writable: !0,
232
- configurable: !1,
233
- enumerable: !0,
234
- value: null
235
- }
236
- }));
237
- let Be = !0, Ae = !0, Ye = !1, je = !0, U = !1, oe = !0, v = !1, he = !1, Se = !1, F = !1, ie = !1, ae = !1, Xe = !0, Ve = !1;
238
- const kt = "user-content-";
239
- let Re = !0, V = !1, H = {}, N = null;
240
- const Oe = s({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
241
- let $e = null;
242
- const qe = s({}, ["audio", "video", "img", "source", "image", "track"]);
243
- let De = null;
244
- const Ke = s({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), re = "http://www.w3.org/1998/Math/MathML", se = "http://www.w3.org/2000/svg", M = "http://www.w3.org/1999/xhtml";
245
- let z = M, ye = !1, Le = null;
246
- const Ut = s({}, [re, se, M], Ce);
247
- let le = s({}, ["mi", "mo", "mn", "ms", "mtext"]), ce = s({}, ["annotation-xml"]);
248
- const Ft = s({}, ["title", "style", "font", "a", "script"]);
249
- let $ = null;
250
- const Ht = ["application/xhtml+xml", "text/html"], zt = "text/html";
251
- let p = null, G = null;
252
- const Gt = l.createElement("form"), Ze = function(e) {
253
- return e instanceof RegExp || e instanceof Function;
254
- }, be = function() {
255
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
256
- if (!(G && G === e)) {
257
- if ((!e || typeof e != "object") && (e = {}), e = C(e), $ = // eslint-disable-next-line unicorn/prefer-includes
258
- Ht.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? zt : e.PARSER_MEDIA_TYPE, p = $ === "application/xhtml+xml" ? Ce : pe, T = y(e, "ALLOWED_TAGS") ? s({}, e.ALLOWED_TAGS, p) : Ge, d = y(e, "ALLOWED_ATTR") ? s({}, e.ALLOWED_ATTR, p) : We, Le = y(e, "ALLOWED_NAMESPACES") ? s({}, e.ALLOWED_NAMESPACES, Ce) : Ut, De = y(e, "ADD_URI_SAFE_ATTR") ? s(C(Ke), e.ADD_URI_SAFE_ATTR, p) : Ke, $e = y(e, "ADD_DATA_URI_TAGS") ? s(C(qe), e.ADD_DATA_URI_TAGS, p) : qe, N = y(e, "FORBID_CONTENTS") ? s({}, e.FORBID_CONTENTS, p) : Oe, X = y(e, "FORBID_TAGS") ? s({}, e.FORBID_TAGS, p) : C({}), ne = y(e, "FORBID_ATTR") ? s({}, e.FORBID_ATTR, p) : C({}), H = y(e, "USE_PROFILES") ? e.USE_PROFILES : !1, Be = e.ALLOW_ARIA_ATTR !== !1, Ae = e.ALLOW_DATA_ATTR !== !1, Ye = e.ALLOW_UNKNOWN_PROTOCOLS || !1, je = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, U = e.SAFE_FOR_TEMPLATES || !1, oe = e.SAFE_FOR_XML !== !1, v = e.WHOLE_DOCUMENT || !1, F = e.RETURN_DOM || !1, ie = e.RETURN_DOM_FRAGMENT || !1, ae = e.RETURN_TRUSTED_TYPE || !1, Se = e.FORCE_BODY || !1, Xe = e.SANITIZE_DOM !== !1, Ve = e.SANITIZE_NAMED_PROPS || !1, Re = e.KEEP_CONTENT !== !1, V = e.IN_PLACE || !1, ze = e.ALLOWED_URI_REGEXP || gt, z = e.NAMESPACE || M, le = e.MATHML_TEXT_INTEGRATION_POINTS || le, ce = e.HTML_INTEGRATION_POINTS || ce, u = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && Ze(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (u.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && Ze(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (u.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (u.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), U && (Ae = !1), ie && (F = !0), H && (T = s({}, mt), d = me(null), H.html === !0 && (s(T, ut), s(d, pt)), H.svg === !0 && (s(T, we), s(d, ve), s(d, ue)), H.svgFilters === !0 && (s(T, xe), s(d, ve), s(d, ue)), H.mathMl === !0 && (s(T, Pe), s(d, Tt), s(d, ue))), y(e, "ADD_TAGS") || (P.tagCheck = null), y(e, "ADD_ATTR") || (P.attributeCheck = null), e.ADD_TAGS && (typeof e.ADD_TAGS == "function" ? P.tagCheck = e.ADD_TAGS : (T === Ge && (T = C(T)), s(T, e.ADD_TAGS, p))), e.ADD_ATTR && (typeof e.ADD_ATTR == "function" ? P.attributeCheck = e.ADD_ATTR : (d === We && (d = C(d)), s(d, e.ADD_ATTR, p))), e.ADD_URI_SAFE_ATTR && s(De, e.ADD_URI_SAFE_ATTR, p), e.FORBID_CONTENTS && (N === Oe && (N = C(N)), s(N, e.FORBID_CONTENTS, p)), e.ADD_FORBID_CONTENTS && (N === Oe && (N = C(N)), s(N, e.ADD_FORBID_CONTENTS, p)), Re && (T["#text"] = !0), v && s(T, ["html", "head", "body"]), T.table && (s(T, ["tbody"]), delete X.tbody), e.TRUSTED_TYPES_POLICY) {
259
- if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
260
- throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
261
- if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
262
- throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
263
- A = e.TRUSTED_TYPES_POLICY, j = A.createHTML("");
264
- } else
265
- A === void 0 && (A = Tn(ee, c)), A !== null && typeof j == "string" && (j = A.createHTML(""));
266
- R && R(e), G = e;
267
- }
268
- }, Je = s({}, [...we, ...xe, ...nn]), Qe = s({}, [...Pe, ...on]), Wt = function(e) {
269
- let t = te(e);
270
- (!t || !t.tagName) && (t = {
271
- namespaceURI: z,
272
- tagName: "template"
273
- });
274
- const o = pe(e.tagName), f = pe(t.tagName);
275
- return Le[e.namespaceURI] ? e.namespaceURI === se ? t.namespaceURI === M ? o === "svg" : t.namespaceURI === re ? o === "svg" && (f === "annotation-xml" || le[f]) : !!Je[o] : e.namespaceURI === re ? t.namespaceURI === M ? o === "math" : t.namespaceURI === se ? o === "math" && ce[f] : !!Qe[o] : e.namespaceURI === M ? t.namespaceURI === se && !ce[f] || t.namespaceURI === re && !le[f] ? !1 : !Qe[o] && (Ft[o] || !Je[o]) : !!($ === "application/xhtml+xml" && Le[e.namespaceURI]) : !1;
276
- }, I = function(e) {
277
- q(n.removed, {
278
- element: e
279
- });
280
- try {
281
- te(e).removeChild(e);
282
- } catch {
283
- yt(e);
284
- }
285
- }, k = function(e, t) {
286
- try {
287
- q(n.removed, {
288
- attribute: t.getAttributeNode(e),
289
- from: t
290
- });
291
- } catch {
292
- q(n.removed, {
293
- attribute: null,
294
- from: t
295
- });
296
- }
297
- if (t.removeAttribute(e), e === "is")
298
- if (F || ie)
299
- try {
300
- I(t);
301
- } catch {
302
- }
303
- else
304
- try {
305
- t.setAttribute(e, "");
306
- } catch {
307
- }
308
- }, et = function(e) {
309
- let t = null, o = null;
310
- if (Se)
311
- e = "<remove></remove>" + e;
312
- else {
313
- const m = Me(e, /^[\r\n\t ]+/);
314
- o = m && m[0];
315
- }
316
- $ === "application/xhtml+xml" && z === M && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
317
- const f = A ? A.createHTML(e) : e;
318
- if (z === M)
319
- try {
320
- t = new Ot().parseFromString(f, $);
321
- } catch {
322
- }
323
- if (!t || !t.documentElement) {
324
- t = de.createDocument(z, "template", null);
325
- try {
326
- t.documentElement.innerHTML = ye ? j : f;
327
- } catch {
328
- }
329
- }
330
- const g = t.body || t.documentElement;
331
- return e && o && g.insertBefore(l.createTextNode(o), g.childNodes[0] || null), z === M ? Ct.call(t, v ? "html" : "body")[0] : v ? t.documentElement : g;
332
- }, tt = function(e) {
333
- return Nt.call(
334
- e.ownerDocument || e,
335
- e,
336
- // eslint-disable-next-line no-bitwise
337
- B.SHOW_ELEMENT | B.SHOW_COMMENT | B.SHOW_TEXT | B.SHOW_PROCESSING_INSTRUCTION | B.SHOW_CDATA_SECTION,
338
- null
339
- );
340
- }, Ne = function(e) {
341
- return e instanceof Rt && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof St) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
342
- }, nt = function(e) {
343
- return typeof Te == "function" && e instanceof Te;
344
- };
345
- function w(i, e, t) {
346
- fe(i, (o) => {
347
- o.call(n, e, t, G);
348
- });
349
- }
350
- const ot = function(e) {
351
- let t = null;
352
- if (w(h.beforeSanitizeElements, e, null), Ne(e))
353
- return I(e), !0;
354
- const o = p(e.nodeName);
355
- if (w(h.uponSanitizeElement, e, {
356
- tagName: o,
357
- allowedTags: T
358
- }), oe && e.hasChildNodes() && !nt(e.firstElementChild) && S(/<[/\w!]/g, e.innerHTML) && S(/<[/\w!]/g, e.textContent) || e.nodeType === Q.progressingInstruction || oe && e.nodeType === Q.comment && S(/<[/\w]/g, e.data))
359
- return I(e), !0;
360
- if (!(P.tagCheck instanceof Function && P.tagCheck(o)) && (!T[o] || X[o])) {
361
- if (!X[o] && at(o) && (u.tagNameCheck instanceof RegExp && S(u.tagNameCheck, o) || u.tagNameCheck instanceof Function && u.tagNameCheck(o)))
362
- return !1;
363
- if (Re && !N[o]) {
364
- const f = te(e) || e.parentNode, g = bt(e) || e.childNodes;
365
- if (g && f) {
366
- const m = g.length;
367
- for (let D = m - 1; D >= 0; --D) {
368
- const x = Dt(g[D], !0);
369
- x.__removalCount = (e.__removalCount || 0) + 1, f.insertBefore(x, Lt(e));
370
- }
371
- }
372
- }
373
- return I(e), !0;
374
- }
375
- return e instanceof Fe && !Wt(e) || (o === "noscript" || o === "noembed" || o === "noframes") && S(/<\/no(script|embed|frames)/i, e.innerHTML) ? (I(e), !0) : (U && e.nodeType === Q.text && (t = e.textContent, fe([Ee, _e, ge], (f) => {
376
- t = K(t, f, " ");
377
- }), e.textContent !== t && (q(n.removed, {
378
- element: e.cloneNode()
379
- }), e.textContent = t)), w(h.afterSanitizeElements, e, null), !1);
380
- }, it = function(e, t, o) {
381
- if (ne[t] || Xe && (t === "id" || t === "name") && (o in l || o in Gt))
382
- return !1;
383
- if (!(Ae && !ne[t] && S(wt, t))) {
384
- if (!(Be && S(xt, t))) {
385
- if (!(P.attributeCheck instanceof Function && P.attributeCheck(t, e))) {
386
- if (!d[t] || ne[t]) {
387
- if (
388
- // First condition does a very basic check if a) it's basically a valid custom element tagname AND
389
- // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
390
- // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
391
- !(at(e) && (u.tagNameCheck instanceof RegExp && S(u.tagNameCheck, e) || u.tagNameCheck instanceof Function && u.tagNameCheck(e)) && (u.attributeNameCheck instanceof RegExp && S(u.attributeNameCheck, t) || u.attributeNameCheck instanceof Function && u.attributeNameCheck(t, e)) || // Alternative, second condition checks if it's an `is`-attribute, AND
392
- // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
393
- t === "is" && u.allowCustomizedBuiltInElements && (u.tagNameCheck instanceof RegExp && S(u.tagNameCheck, o) || u.tagNameCheck instanceof Function && u.tagNameCheck(o)))
394
- ) return !1;
395
- } else if (!De[t]) {
396
- if (!S(ze, K(o, He, ""))) {
397
- if (!((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Jt(o, "data:") === 0 && $e[e])) {
398
- if (!(Ye && !S(Pt, K(o, He, "")))) {
399
- if (o)
400
- return !1;
401
- }
402
- }
403
- }
404
- }
405
- }
406
- }
407
- }
408
- return !0;
409
- }, at = function(e) {
410
- return e !== "annotation-xml" && Me(e, vt);
411
- }, rt = function(e) {
412
- w(h.beforeSanitizeAttributes, e, null);
413
- const {
414
- attributes: t
415
- } = e;
416
- if (!t || Ne(e))
417
- return;
418
- const o = {
419
- attrName: "",
420
- attrValue: "",
421
- keepAttr: !0,
422
- allowedAttributes: d,
423
- forceKeepAttr: void 0
424
- };
425
- let f = t.length;
426
- for (; f--; ) {
427
- const g = t[f], {
428
- name: m,
429
- namespaceURI: D,
430
- value: x
431
- } = g, W = p(m), Ie = x;
432
- let E = m === "value" ? Ie : Qt(Ie);
433
- if (o.attrName = W, o.attrValue = E, o.keepAttr = !0, o.forceKeepAttr = void 0, w(h.uponSanitizeAttribute, e, o), E = o.attrValue, Ve && (W === "id" || W === "name") && (k(m, e), E = kt + E), oe && S(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, E)) {
434
- k(m, e);
435
- continue;
436
- }
437
- if (W === "attributename" && Me(E, "href")) {
438
- k(m, e);
439
- continue;
440
- }
441
- if (o.forceKeepAttr)
442
- continue;
443
- if (!o.keepAttr) {
444
- k(m, e);
445
- continue;
446
- }
447
- if (!je && S(/\/>/i, E)) {
448
- k(m, e);
449
- continue;
450
- }
451
- U && fe([Ee, _e, ge], (lt) => {
452
- E = K(E, lt, " ");
453
- });
454
- const st = p(e.nodeName);
455
- if (!it(st, W, E)) {
456
- k(m, e);
457
- continue;
458
- }
459
- if (A && typeof ee == "object" && typeof ee.getAttributeType == "function" && !D)
460
- switch (ee.getAttributeType(st, W)) {
461
- case "TrustedHTML": {
462
- E = A.createHTML(E);
463
- break;
464
- }
465
- case "TrustedScriptURL": {
466
- E = A.createScriptURL(E);
467
- break;
468
- }
469
- }
470
- if (E !== Ie)
471
- try {
472
- D ? e.setAttributeNS(D, m, E) : e.setAttribute(m, E), Ne(e) ? I(e) : ft(n.removed);
473
- } catch {
474
- k(m, e);
475
- }
476
- }
477
- w(h.afterSanitizeAttributes, e, null);
478
- }, Bt = function i(e) {
479
- let t = null;
480
- const o = tt(e);
481
- for (w(h.beforeSanitizeShadowDOM, e, null); t = o.nextNode(); )
482
- w(h.uponSanitizeShadowNode, t, null), ot(t), rt(t), t.content instanceof _ && i(t.content);
483
- w(h.afterSanitizeShadowDOM, e, null);
484
- };
485
- return n.sanitize = function(i) {
486
- let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = null, o = null, f = null, g = null;
487
- if (ye = !i, ye && (i = "<!-->"), typeof i != "string" && !nt(i))
488
- if (typeof i.toString == "function") {
489
- if (i = i.toString(), typeof i != "string")
490
- throw Z("dirty is not a string, aborting");
491
- } else
492
- throw Z("toString is not a function");
493
- if (!n.isSupported)
494
- return i;
495
- if (he || be(e), n.removed = [], typeof i == "string" && (V = !1), V) {
496
- if (i.nodeName) {
497
- const x = p(i.nodeName);
498
- if (!T[x] || X[x])
499
- throw Z("root node is forbidden and cannot be sanitized in-place");
500
- }
501
- } else if (i instanceof Te)
502
- t = et("<!---->"), o = t.ownerDocument.importNode(i, !0), o.nodeType === Q.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? t = o : t.appendChild(o);
503
- else {
504
- if (!F && !U && !v && // eslint-disable-next-line unicorn/prefer-includes
505
- i.indexOf("<") === -1)
506
- return A && ae ? A.createHTML(i) : i;
507
- if (t = et(i), !t)
508
- return F ? null : ae ? j : "";
509
- }
510
- t && Se && I(t.firstChild);
511
- const m = tt(V ? i : t);
512
- for (; f = m.nextNode(); )
513
- ot(f), rt(f), f.content instanceof _ && Bt(f.content);
514
- if (V)
515
- return i;
516
- if (F) {
517
- if (ie)
518
- for (g = It.call(t.ownerDocument); t.firstChild; )
519
- g.appendChild(t.firstChild);
520
- else
521
- g = t;
522
- return (d.shadowroot || d.shadowrootmode) && (g = Mt.call(a, g, !0)), g;
523
- }
524
- let D = v ? t.outerHTML : t.innerHTML;
525
- return v && T["!doctype"] && t.ownerDocument && t.ownerDocument.doctype && t.ownerDocument.doctype.name && S(At, t.ownerDocument.doctype.name) && (D = "<!DOCTYPE " + t.ownerDocument.doctype.name + `>
526
- ` + D), U && fe([Ee, _e, ge], (x) => {
527
- D = K(D, x, " ");
528
- }), A && ae ? A.createHTML(D) : D;
529
- }, n.setConfig = function() {
530
- let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
531
- be(i), he = !0;
532
- }, n.clearConfig = function() {
533
- G = null, he = !1;
534
- }, n.isValidAttribute = function(i, e, t) {
535
- G || be({});
536
- const o = p(i), f = p(e);
537
- return it(o, f, t);
538
- }, n.addHook = function(i, e) {
539
- typeof e == "function" && q(h[i], e);
540
- }, n.removeHook = function(i, e) {
541
- if (e !== void 0) {
542
- const t = Kt(h[i], e);
543
- return t === -1 ? void 0 : Zt(h[i], t, 1)[0];
544
- }
545
- return ft(h[i]);
546
- }, n.removeHooks = function(i) {
547
- h[i] = [];
548
- }, n.removeAllHooks = function() {
549
- h = Et();
550
- }, n;
551
- }
552
- var dn = ht();
553
- function gn({ content: r, width: n, height: l, className: a, cssClass: c }) {
554
- const _ = Xt.useMemo(
555
- () => dn.sanitize(r, {
556
- USE_PROFILES: { svg: !0, svgFilters: !0 }
557
- }),
558
- [r]
559
- ), b = {};
560
- return n && (b.width = n), l && (b.height = l), /* @__PURE__ */ Yt.jsx(
561
- "div",
562
- {
563
- style: Object.keys(b).length > 0 ? b : void 0,
564
- className: jt(a, c),
565
- dangerouslySetInnerHTML: { __html: _ }
566
- }
567
- );
568
- }
569
- export {
570
- gn as Svg
571
- };