@vitejs/devtools 0.0.0-alpha.9 → 0.1.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.
Files changed (42) hide show
  1. package/dist/DockIcon-BtMEW4VE.js +97 -0
  2. package/dist/DockStandalone-CZAqITKs.js +81 -0
  3. package/dist/LogItem-BTrEubKY.js +205 -0
  4. package/dist/ToastOverlay-DO3Kl_rY.js +1055 -0
  5. package/dist/ViewBuiltinLogs-BL373XPJ.js +428 -0
  6. package/dist/ViewBuiltinTerminals-DdpE1Ftb.js +10409 -0
  7. package/dist/ViewJsonRender-coidkW9b.js +6835 -0
  8. package/dist/cli-commands-BRswBnHn.js +180 -0
  9. package/dist/cli-commands.js +3 -5
  10. package/dist/cli.js +3 -6
  11. package/dist/client/inject.js +171 -18
  12. package/dist/client/standalone/assets/DockStandalone-DDaYjGO1.js +1 -0
  13. package/dist/client/standalone/assets/LogItem-CKbVrExA.js +1 -0
  14. package/dist/client/standalone/assets/ViewBuiltinLogs-9oWDdl1G.js +1 -0
  15. package/dist/client/standalone/assets/ViewBuiltinTerminals-CpexS-ib.js +36 -0
  16. package/dist/client/standalone/assets/ViewJsonRender-CKPzRgqQ.js +43 -0
  17. package/dist/client/standalone/assets/dist-JpCJ4ieR.js +1 -0
  18. package/dist/client/standalone/assets/iconify-C-CPDXMf.js +2 -0
  19. package/dist/client/standalone/assets/index-3wlMt-60.js +3 -0
  20. package/dist/client/standalone/assets/index-6F2y1lxr.css +1 -0
  21. package/dist/client/standalone/assets/runtime-core.esm-bundler-oO31W4LZ.js +1 -0
  22. package/dist/client/standalone/index.html +7 -3
  23. package/dist/client/webcomponents.d.ts +21657 -31
  24. package/dist/client/webcomponents.js +307 -455
  25. package/dist/config.d.ts +25 -0
  26. package/dist/config.js +14 -0
  27. package/dist/dirs.js +7 -3
  28. package/dist/dist-Cgqg5_oP.js +1113 -0
  29. package/dist/iconify-YyqAMHKf.js +1625 -0
  30. package/dist/index.d.ts +256 -13
  31. package/dist/index.js +2 -4
  32. package/dist/plugins-Cvy_lJ0L.js +2135 -0
  33. package/dist/popup-ffZHGm5D.js +358 -0
  34. package/dist/utils-Csuu5uNf.js +10 -0
  35. package/dist/{dist-2aLfy0Lc.js → vue.runtime.esm-bundler-D2MZbyFr.js} +1948 -1734
  36. package/package.json +53 -21
  37. package/dist/cli-commands-CWESTkWI.js +0 -97
  38. package/dist/client/standalone/assets/index-CXKamp9k.js +0 -7
  39. package/dist/client/standalone/assets/index-DULlvzQC.css +0 -1
  40. package/dist/dirs-DcSK9l9L.js +0 -9
  41. package/dist/index-C-9eMTqf.d.ts +0 -142
  42. package/dist/plugins-5VE4Mfdt.js +0 -1365
@@ -0,0 +1,1625 @@
1
+ //#region ../../node_modules/.pnpm/dompurify@3.3.3/node_modules/dompurify/dist/purify.es.mjs
2
+ /*! @license DOMPurify 3.3.3 | (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.3/LICENSE */
3
+ const { entries, setPrototypeOf, isFrozen, getPrototypeOf, getOwnPropertyDescriptor } = Object;
4
+ let { freeze, seal, create } = Object;
5
+ let { apply, construct } = typeof Reflect !== "undefined" && Reflect;
6
+ if (!freeze) freeze = function freeze(x) {
7
+ return x;
8
+ };
9
+ if (!seal) seal = function seal(x) {
10
+ return x;
11
+ };
12
+ if (!apply) apply = function apply(func, thisArg) {
13
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];
14
+ return func.apply(thisArg, args);
15
+ };
16
+ if (!construct) construct = function construct(Func) {
17
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2];
18
+ return new Func(...args);
19
+ };
20
+ const arrayForEach = unapply(Array.prototype.forEach);
21
+ const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
22
+ const arrayPop = unapply(Array.prototype.pop);
23
+ const arrayPush = unapply(Array.prototype.push);
24
+ const arraySplice = unapply(Array.prototype.splice);
25
+ const stringToLowerCase = unapply(String.prototype.toLowerCase);
26
+ const stringToString = unapply(String.prototype.toString);
27
+ const stringMatch = unapply(String.prototype.match);
28
+ const stringReplace = unapply(String.prototype.replace);
29
+ const stringIndexOf = unapply(String.prototype.indexOf);
30
+ const stringTrim = unapply(String.prototype.trim);
31
+ const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
32
+ const regExpTest = unapply(RegExp.prototype.test);
33
+ const typeErrorCreate = unconstruct(TypeError);
34
+ /**
35
+ * Creates a new function that calls the given function with a specified thisArg and arguments.
36
+ *
37
+ * @param func - The function to be wrapped and called.
38
+ * @returns A new function that calls the given function with a specified thisArg and arguments.
39
+ */
40
+ function unapply(func) {
41
+ return function(thisArg) {
42
+ if (thisArg instanceof RegExp) thisArg.lastIndex = 0;
43
+ for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) args[_key3 - 1] = arguments[_key3];
44
+ return apply(func, thisArg, args);
45
+ };
46
+ }
47
+ /**
48
+ * Creates a new function that constructs an instance of the given constructor function with the provided arguments.
49
+ *
50
+ * @param func - The constructor function to be wrapped and called.
51
+ * @returns A new function that constructs an instance of the given constructor function with the provided arguments.
52
+ */
53
+ function unconstruct(Func) {
54
+ return function() {
55
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) args[_key4] = arguments[_key4];
56
+ return construct(Func, args);
57
+ };
58
+ }
59
+ /**
60
+ * Add properties to a lookup table
61
+ *
62
+ * @param set - The set to which elements will be added.
63
+ * @param array - The array containing elements to be added to the set.
64
+ * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
65
+ * @returns The modified set with added elements.
66
+ */
67
+ function addToSet(set, array) {
68
+ let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;
69
+ if (setPrototypeOf) setPrototypeOf(set, null);
70
+ let l = array.length;
71
+ while (l--) {
72
+ let element = array[l];
73
+ if (typeof element === "string") {
74
+ const lcElement = transformCaseFunc(element);
75
+ if (lcElement !== element) {
76
+ if (!isFrozen(array)) array[l] = lcElement;
77
+ element = lcElement;
78
+ }
79
+ }
80
+ set[element] = true;
81
+ }
82
+ return set;
83
+ }
84
+ /**
85
+ * Clean up an array to harden against CSPP
86
+ *
87
+ * @param array - The array to be cleaned.
88
+ * @returns The cleaned version of the array
89
+ */
90
+ function cleanArray(array) {
91
+ for (let index = 0; index < array.length; index++) if (!objectHasOwnProperty(array, index)) array[index] = null;
92
+ return array;
93
+ }
94
+ /**
95
+ * Shallow clone an object
96
+ *
97
+ * @param object - The object to be cloned.
98
+ * @returns A new object that copies the original.
99
+ */
100
+ function clone(object) {
101
+ const newObject = create(null);
102
+ for (const [property, value] of entries(object)) if (objectHasOwnProperty(object, property)) if (Array.isArray(value)) newObject[property] = cleanArray(value);
103
+ else if (value && typeof value === "object" && value.constructor === Object) newObject[property] = clone(value);
104
+ else newObject[property] = value;
105
+ return newObject;
106
+ }
107
+ /**
108
+ * This method automatically checks if the prop is function or getter and behaves accordingly.
109
+ *
110
+ * @param object - The object to look up the getter function in its prototype chain.
111
+ * @param prop - The property name for which to find the getter function.
112
+ * @returns The getter function found in the prototype chain or a fallback function.
113
+ */
114
+ function lookupGetter(object, prop) {
115
+ while (object !== null) {
116
+ const desc = getOwnPropertyDescriptor(object, prop);
117
+ if (desc) {
118
+ if (desc.get) return unapply(desc.get);
119
+ if (typeof desc.value === "function") return unapply(desc.value);
120
+ }
121
+ object = getPrototypeOf(object);
122
+ }
123
+ function fallbackValue() {
124
+ return null;
125
+ }
126
+ return fallbackValue;
127
+ }
128
+ const html$1 = freeze([
129
+ "a",
130
+ "abbr",
131
+ "acronym",
132
+ "address",
133
+ "area",
134
+ "article",
135
+ "aside",
136
+ "audio",
137
+ "b",
138
+ "bdi",
139
+ "bdo",
140
+ "big",
141
+ "blink",
142
+ "blockquote",
143
+ "body",
144
+ "br",
145
+ "button",
146
+ "canvas",
147
+ "caption",
148
+ "center",
149
+ "cite",
150
+ "code",
151
+ "col",
152
+ "colgroup",
153
+ "content",
154
+ "data",
155
+ "datalist",
156
+ "dd",
157
+ "decorator",
158
+ "del",
159
+ "details",
160
+ "dfn",
161
+ "dialog",
162
+ "dir",
163
+ "div",
164
+ "dl",
165
+ "dt",
166
+ "element",
167
+ "em",
168
+ "fieldset",
169
+ "figcaption",
170
+ "figure",
171
+ "font",
172
+ "footer",
173
+ "form",
174
+ "h1",
175
+ "h2",
176
+ "h3",
177
+ "h4",
178
+ "h5",
179
+ "h6",
180
+ "head",
181
+ "header",
182
+ "hgroup",
183
+ "hr",
184
+ "html",
185
+ "i",
186
+ "img",
187
+ "input",
188
+ "ins",
189
+ "kbd",
190
+ "label",
191
+ "legend",
192
+ "li",
193
+ "main",
194
+ "map",
195
+ "mark",
196
+ "marquee",
197
+ "menu",
198
+ "menuitem",
199
+ "meter",
200
+ "nav",
201
+ "nobr",
202
+ "ol",
203
+ "optgroup",
204
+ "option",
205
+ "output",
206
+ "p",
207
+ "picture",
208
+ "pre",
209
+ "progress",
210
+ "q",
211
+ "rp",
212
+ "rt",
213
+ "ruby",
214
+ "s",
215
+ "samp",
216
+ "search",
217
+ "section",
218
+ "select",
219
+ "shadow",
220
+ "slot",
221
+ "small",
222
+ "source",
223
+ "spacer",
224
+ "span",
225
+ "strike",
226
+ "strong",
227
+ "style",
228
+ "sub",
229
+ "summary",
230
+ "sup",
231
+ "table",
232
+ "tbody",
233
+ "td",
234
+ "template",
235
+ "textarea",
236
+ "tfoot",
237
+ "th",
238
+ "thead",
239
+ "time",
240
+ "tr",
241
+ "track",
242
+ "tt",
243
+ "u",
244
+ "ul",
245
+ "var",
246
+ "video",
247
+ "wbr"
248
+ ]);
249
+ const svg$1 = freeze([
250
+ "svg",
251
+ "a",
252
+ "altglyph",
253
+ "altglyphdef",
254
+ "altglyphitem",
255
+ "animatecolor",
256
+ "animatemotion",
257
+ "animatetransform",
258
+ "circle",
259
+ "clippath",
260
+ "defs",
261
+ "desc",
262
+ "ellipse",
263
+ "enterkeyhint",
264
+ "exportparts",
265
+ "filter",
266
+ "font",
267
+ "g",
268
+ "glyph",
269
+ "glyphref",
270
+ "hkern",
271
+ "image",
272
+ "inputmode",
273
+ "line",
274
+ "lineargradient",
275
+ "marker",
276
+ "mask",
277
+ "metadata",
278
+ "mpath",
279
+ "part",
280
+ "path",
281
+ "pattern",
282
+ "polygon",
283
+ "polyline",
284
+ "radialgradient",
285
+ "rect",
286
+ "stop",
287
+ "style",
288
+ "switch",
289
+ "symbol",
290
+ "text",
291
+ "textpath",
292
+ "title",
293
+ "tref",
294
+ "tspan",
295
+ "view",
296
+ "vkern"
297
+ ]);
298
+ const svgFilters = freeze([
299
+ "feBlend",
300
+ "feColorMatrix",
301
+ "feComponentTransfer",
302
+ "feComposite",
303
+ "feConvolveMatrix",
304
+ "feDiffuseLighting",
305
+ "feDisplacementMap",
306
+ "feDistantLight",
307
+ "feDropShadow",
308
+ "feFlood",
309
+ "feFuncA",
310
+ "feFuncB",
311
+ "feFuncG",
312
+ "feFuncR",
313
+ "feGaussianBlur",
314
+ "feImage",
315
+ "feMerge",
316
+ "feMergeNode",
317
+ "feMorphology",
318
+ "feOffset",
319
+ "fePointLight",
320
+ "feSpecularLighting",
321
+ "feSpotLight",
322
+ "feTile",
323
+ "feTurbulence"
324
+ ]);
325
+ const svgDisallowed = freeze([
326
+ "animate",
327
+ "color-profile",
328
+ "cursor",
329
+ "discard",
330
+ "font-face",
331
+ "font-face-format",
332
+ "font-face-name",
333
+ "font-face-src",
334
+ "font-face-uri",
335
+ "foreignobject",
336
+ "hatch",
337
+ "hatchpath",
338
+ "mesh",
339
+ "meshgradient",
340
+ "meshpatch",
341
+ "meshrow",
342
+ "missing-glyph",
343
+ "script",
344
+ "set",
345
+ "solidcolor",
346
+ "unknown",
347
+ "use"
348
+ ]);
349
+ const mathMl$1 = freeze([
350
+ "math",
351
+ "menclose",
352
+ "merror",
353
+ "mfenced",
354
+ "mfrac",
355
+ "mglyph",
356
+ "mi",
357
+ "mlabeledtr",
358
+ "mmultiscripts",
359
+ "mn",
360
+ "mo",
361
+ "mover",
362
+ "mpadded",
363
+ "mphantom",
364
+ "mroot",
365
+ "mrow",
366
+ "ms",
367
+ "mspace",
368
+ "msqrt",
369
+ "mstyle",
370
+ "msub",
371
+ "msup",
372
+ "msubsup",
373
+ "mtable",
374
+ "mtd",
375
+ "mtext",
376
+ "mtr",
377
+ "munder",
378
+ "munderover",
379
+ "mprescripts"
380
+ ]);
381
+ const mathMlDisallowed = freeze([
382
+ "maction",
383
+ "maligngroup",
384
+ "malignmark",
385
+ "mlongdiv",
386
+ "mscarries",
387
+ "mscarry",
388
+ "msgroup",
389
+ "mstack",
390
+ "msline",
391
+ "msrow",
392
+ "semantics",
393
+ "annotation",
394
+ "annotation-xml",
395
+ "mprescripts",
396
+ "none"
397
+ ]);
398
+ const text = freeze(["#text"]);
399
+ const html = freeze([
400
+ "accept",
401
+ "action",
402
+ "align",
403
+ "alt",
404
+ "autocapitalize",
405
+ "autocomplete",
406
+ "autopictureinpicture",
407
+ "autoplay",
408
+ "background",
409
+ "bgcolor",
410
+ "border",
411
+ "capture",
412
+ "cellpadding",
413
+ "cellspacing",
414
+ "checked",
415
+ "cite",
416
+ "class",
417
+ "clear",
418
+ "color",
419
+ "cols",
420
+ "colspan",
421
+ "controls",
422
+ "controlslist",
423
+ "coords",
424
+ "crossorigin",
425
+ "datetime",
426
+ "decoding",
427
+ "default",
428
+ "dir",
429
+ "disabled",
430
+ "disablepictureinpicture",
431
+ "disableremoteplayback",
432
+ "download",
433
+ "draggable",
434
+ "enctype",
435
+ "enterkeyhint",
436
+ "exportparts",
437
+ "face",
438
+ "for",
439
+ "headers",
440
+ "height",
441
+ "hidden",
442
+ "high",
443
+ "href",
444
+ "hreflang",
445
+ "id",
446
+ "inert",
447
+ "inputmode",
448
+ "integrity",
449
+ "ismap",
450
+ "kind",
451
+ "label",
452
+ "lang",
453
+ "list",
454
+ "loading",
455
+ "loop",
456
+ "low",
457
+ "max",
458
+ "maxlength",
459
+ "media",
460
+ "method",
461
+ "min",
462
+ "minlength",
463
+ "multiple",
464
+ "muted",
465
+ "name",
466
+ "nonce",
467
+ "noshade",
468
+ "novalidate",
469
+ "nowrap",
470
+ "open",
471
+ "optimum",
472
+ "part",
473
+ "pattern",
474
+ "placeholder",
475
+ "playsinline",
476
+ "popover",
477
+ "popovertarget",
478
+ "popovertargetaction",
479
+ "poster",
480
+ "preload",
481
+ "pubdate",
482
+ "radiogroup",
483
+ "readonly",
484
+ "rel",
485
+ "required",
486
+ "rev",
487
+ "reversed",
488
+ "role",
489
+ "rows",
490
+ "rowspan",
491
+ "spellcheck",
492
+ "scope",
493
+ "selected",
494
+ "shape",
495
+ "size",
496
+ "sizes",
497
+ "slot",
498
+ "span",
499
+ "srclang",
500
+ "start",
501
+ "src",
502
+ "srcset",
503
+ "step",
504
+ "style",
505
+ "summary",
506
+ "tabindex",
507
+ "title",
508
+ "translate",
509
+ "type",
510
+ "usemap",
511
+ "valign",
512
+ "value",
513
+ "width",
514
+ "wrap",
515
+ "xmlns",
516
+ "slot"
517
+ ]);
518
+ const svg = freeze([
519
+ "accent-height",
520
+ "accumulate",
521
+ "additive",
522
+ "alignment-baseline",
523
+ "amplitude",
524
+ "ascent",
525
+ "attributename",
526
+ "attributetype",
527
+ "azimuth",
528
+ "basefrequency",
529
+ "baseline-shift",
530
+ "begin",
531
+ "bias",
532
+ "by",
533
+ "class",
534
+ "clip",
535
+ "clippathunits",
536
+ "clip-path",
537
+ "clip-rule",
538
+ "color",
539
+ "color-interpolation",
540
+ "color-interpolation-filters",
541
+ "color-profile",
542
+ "color-rendering",
543
+ "cx",
544
+ "cy",
545
+ "d",
546
+ "dx",
547
+ "dy",
548
+ "diffuseconstant",
549
+ "direction",
550
+ "display",
551
+ "divisor",
552
+ "dur",
553
+ "edgemode",
554
+ "elevation",
555
+ "end",
556
+ "exponent",
557
+ "fill",
558
+ "fill-opacity",
559
+ "fill-rule",
560
+ "filter",
561
+ "filterunits",
562
+ "flood-color",
563
+ "flood-opacity",
564
+ "font-family",
565
+ "font-size",
566
+ "font-size-adjust",
567
+ "font-stretch",
568
+ "font-style",
569
+ "font-variant",
570
+ "font-weight",
571
+ "fx",
572
+ "fy",
573
+ "g1",
574
+ "g2",
575
+ "glyph-name",
576
+ "glyphref",
577
+ "gradientunits",
578
+ "gradienttransform",
579
+ "height",
580
+ "href",
581
+ "id",
582
+ "image-rendering",
583
+ "in",
584
+ "in2",
585
+ "intercept",
586
+ "k",
587
+ "k1",
588
+ "k2",
589
+ "k3",
590
+ "k4",
591
+ "kerning",
592
+ "keypoints",
593
+ "keysplines",
594
+ "keytimes",
595
+ "lang",
596
+ "lengthadjust",
597
+ "letter-spacing",
598
+ "kernelmatrix",
599
+ "kernelunitlength",
600
+ "lighting-color",
601
+ "local",
602
+ "marker-end",
603
+ "marker-mid",
604
+ "marker-start",
605
+ "markerheight",
606
+ "markerunits",
607
+ "markerwidth",
608
+ "maskcontentunits",
609
+ "maskunits",
610
+ "max",
611
+ "mask",
612
+ "mask-type",
613
+ "media",
614
+ "method",
615
+ "mode",
616
+ "min",
617
+ "name",
618
+ "numoctaves",
619
+ "offset",
620
+ "operator",
621
+ "opacity",
622
+ "order",
623
+ "orient",
624
+ "orientation",
625
+ "origin",
626
+ "overflow",
627
+ "paint-order",
628
+ "path",
629
+ "pathlength",
630
+ "patterncontentunits",
631
+ "patterntransform",
632
+ "patternunits",
633
+ "points",
634
+ "preservealpha",
635
+ "preserveaspectratio",
636
+ "primitiveunits",
637
+ "r",
638
+ "rx",
639
+ "ry",
640
+ "radius",
641
+ "refx",
642
+ "refy",
643
+ "repeatcount",
644
+ "repeatdur",
645
+ "restart",
646
+ "result",
647
+ "rotate",
648
+ "scale",
649
+ "seed",
650
+ "shape-rendering",
651
+ "slope",
652
+ "specularconstant",
653
+ "specularexponent",
654
+ "spreadmethod",
655
+ "startoffset",
656
+ "stddeviation",
657
+ "stitchtiles",
658
+ "stop-color",
659
+ "stop-opacity",
660
+ "stroke-dasharray",
661
+ "stroke-dashoffset",
662
+ "stroke-linecap",
663
+ "stroke-linejoin",
664
+ "stroke-miterlimit",
665
+ "stroke-opacity",
666
+ "stroke",
667
+ "stroke-width",
668
+ "style",
669
+ "surfacescale",
670
+ "systemlanguage",
671
+ "tabindex",
672
+ "tablevalues",
673
+ "targetx",
674
+ "targety",
675
+ "transform",
676
+ "transform-origin",
677
+ "text-anchor",
678
+ "text-decoration",
679
+ "text-rendering",
680
+ "textlength",
681
+ "type",
682
+ "u1",
683
+ "u2",
684
+ "unicode",
685
+ "values",
686
+ "viewbox",
687
+ "visibility",
688
+ "version",
689
+ "vert-adv-y",
690
+ "vert-origin-x",
691
+ "vert-origin-y",
692
+ "width",
693
+ "word-spacing",
694
+ "wrap",
695
+ "writing-mode",
696
+ "xchannelselector",
697
+ "ychannelselector",
698
+ "x",
699
+ "x1",
700
+ "x2",
701
+ "xmlns",
702
+ "y",
703
+ "y1",
704
+ "y2",
705
+ "z",
706
+ "zoomandpan"
707
+ ]);
708
+ const mathMl = freeze([
709
+ "accent",
710
+ "accentunder",
711
+ "align",
712
+ "bevelled",
713
+ "close",
714
+ "columnsalign",
715
+ "columnlines",
716
+ "columnspan",
717
+ "denomalign",
718
+ "depth",
719
+ "dir",
720
+ "display",
721
+ "displaystyle",
722
+ "encoding",
723
+ "fence",
724
+ "frame",
725
+ "height",
726
+ "href",
727
+ "id",
728
+ "largeop",
729
+ "length",
730
+ "linethickness",
731
+ "lspace",
732
+ "lquote",
733
+ "mathbackground",
734
+ "mathcolor",
735
+ "mathsize",
736
+ "mathvariant",
737
+ "maxsize",
738
+ "minsize",
739
+ "movablelimits",
740
+ "notation",
741
+ "numalign",
742
+ "open",
743
+ "rowalign",
744
+ "rowlines",
745
+ "rowspacing",
746
+ "rowspan",
747
+ "rspace",
748
+ "rquote",
749
+ "scriptlevel",
750
+ "scriptminsize",
751
+ "scriptsizemultiplier",
752
+ "selection",
753
+ "separator",
754
+ "separators",
755
+ "stretchy",
756
+ "subscriptshift",
757
+ "supscriptshift",
758
+ "symmetric",
759
+ "voffset",
760
+ "width",
761
+ "xmlns"
762
+ ]);
763
+ const xml = freeze([
764
+ "xlink:href",
765
+ "xml:id",
766
+ "xlink:title",
767
+ "xml:space",
768
+ "xmlns:xlink"
769
+ ]);
770
+ const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm);
771
+ const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
772
+ const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm);
773
+ const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/);
774
+ const ARIA_ATTR = seal(/^aria-[\-\w]+$/);
775
+ const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i);
776
+ const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
777
+ const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g);
778
+ const DOCTYPE_NAME = seal(/^html$/i);
779
+ const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
780
+ var EXPRESSIONS = /* @__PURE__ */ Object.freeze({
781
+ __proto__: null,
782
+ ARIA_ATTR,
783
+ ATTR_WHITESPACE,
784
+ CUSTOM_ELEMENT,
785
+ DATA_ATTR,
786
+ DOCTYPE_NAME,
787
+ ERB_EXPR,
788
+ IS_ALLOWED_URI,
789
+ IS_SCRIPT_OR_DATA,
790
+ MUSTACHE_EXPR,
791
+ TMPLIT_EXPR
792
+ });
793
+ const NODE_TYPE = {
794
+ element: 1,
795
+ attribute: 2,
796
+ text: 3,
797
+ cdataSection: 4,
798
+ entityReference: 5,
799
+ entityNode: 6,
800
+ progressingInstruction: 7,
801
+ comment: 8,
802
+ document: 9,
803
+ documentType: 10,
804
+ documentFragment: 11,
805
+ notation: 12
806
+ };
807
+ const getGlobal = function getGlobal() {
808
+ return typeof window === "undefined" ? null : window;
809
+ };
810
+ /**
811
+ * Creates a no-op policy for internal use only.
812
+ * Don't export this function outside this module!
813
+ * @param trustedTypes The policy factory.
814
+ * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
815
+ * @return The policy created (or null, if Trusted Types
816
+ * are not supported or creating the policy failed).
817
+ */
818
+ const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
819
+ if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") return null;
820
+ let suffix = null;
821
+ const ATTR_NAME = "data-tt-policy-suffix";
822
+ if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) suffix = purifyHostElement.getAttribute(ATTR_NAME);
823
+ const policyName = "dompurify" + (suffix ? "#" + suffix : "");
824
+ try {
825
+ return trustedTypes.createPolicy(policyName, {
826
+ createHTML(html) {
827
+ return html;
828
+ },
829
+ createScriptURL(scriptUrl) {
830
+ return scriptUrl;
831
+ }
832
+ });
833
+ } catch (_) {
834
+ console.warn("TrustedTypes policy " + policyName + " could not be created.");
835
+ return null;
836
+ }
837
+ };
838
+ const _createHooksMap = function _createHooksMap() {
839
+ return {
840
+ afterSanitizeAttributes: [],
841
+ afterSanitizeElements: [],
842
+ afterSanitizeShadowDOM: [],
843
+ beforeSanitizeAttributes: [],
844
+ beforeSanitizeElements: [],
845
+ beforeSanitizeShadowDOM: [],
846
+ uponSanitizeAttribute: [],
847
+ uponSanitizeElement: [],
848
+ uponSanitizeShadowNode: []
849
+ };
850
+ };
851
+ function createDOMPurify() {
852
+ let window = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
853
+ const DOMPurify = (root) => createDOMPurify(root);
854
+ DOMPurify.version = "3.3.3";
855
+ DOMPurify.removed = [];
856
+ if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
857
+ DOMPurify.isSupported = false;
858
+ return DOMPurify;
859
+ }
860
+ let { document } = window;
861
+ const originalDocument = document;
862
+ const currentScript = originalDocument.currentScript;
863
+ const { DocumentFragment, HTMLTemplateElement, Node, Element, NodeFilter, NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap, HTMLFormElement, DOMParser, trustedTypes } = window;
864
+ const ElementPrototype = Element.prototype;
865
+ const cloneNode = lookupGetter(ElementPrototype, "cloneNode");
866
+ const remove = lookupGetter(ElementPrototype, "remove");
867
+ const getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
868
+ const getChildNodes = lookupGetter(ElementPrototype, "childNodes");
869
+ const getParentNode = lookupGetter(ElementPrototype, "parentNode");
870
+ if (typeof HTMLTemplateElement === "function") {
871
+ const template = document.createElement("template");
872
+ if (template.content && template.content.ownerDocument) document = template.content.ownerDocument;
873
+ }
874
+ let trustedTypesPolicy;
875
+ let emptyHTML = "";
876
+ const { implementation, createNodeIterator, createDocumentFragment, getElementsByTagName } = document;
877
+ const { importNode } = originalDocument;
878
+ let hooks = _createHooksMap();
879
+ /**
880
+ * Expose whether this browser supports running the full DOMPurify.
881
+ */
882
+ DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && implementation.createHTMLDocument !== void 0;
883
+ const { MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR, DATA_ATTR, ARIA_ATTR, IS_SCRIPT_OR_DATA, ATTR_WHITESPACE, CUSTOM_ELEMENT } = EXPRESSIONS;
884
+ let { IS_ALLOWED_URI: IS_ALLOWED_URI$1 } = EXPRESSIONS;
885
+ /**
886
+ * We consider the elements and attributes below to be safe. Ideally
887
+ * don't add any new ones but feel free to remove unwanted ones.
888
+ */
889
+ let ALLOWED_TAGS = null;
890
+ const DEFAULT_ALLOWED_TAGS = addToSet({}, [
891
+ ...html$1,
892
+ ...svg$1,
893
+ ...svgFilters,
894
+ ...mathMl$1,
895
+ ...text
896
+ ]);
897
+ let ALLOWED_ATTR = null;
898
+ const DEFAULT_ALLOWED_ATTR = addToSet({}, [
899
+ ...html,
900
+ ...svg,
901
+ ...mathMl,
902
+ ...xml
903
+ ]);
904
+ let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
905
+ tagNameCheck: {
906
+ writable: true,
907
+ configurable: false,
908
+ enumerable: true,
909
+ value: null
910
+ },
911
+ attributeNameCheck: {
912
+ writable: true,
913
+ configurable: false,
914
+ enumerable: true,
915
+ value: null
916
+ },
917
+ allowCustomizedBuiltInElements: {
918
+ writable: true,
919
+ configurable: false,
920
+ enumerable: true,
921
+ value: false
922
+ }
923
+ }));
924
+ let FORBID_TAGS = null;
925
+ let FORBID_ATTR = null;
926
+ const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {
927
+ tagCheck: {
928
+ writable: true,
929
+ configurable: false,
930
+ enumerable: true,
931
+ value: null
932
+ },
933
+ attributeCheck: {
934
+ writable: true,
935
+ configurable: false,
936
+ enumerable: true,
937
+ value: null
938
+ }
939
+ }));
940
+ let ALLOW_ARIA_ATTR = true;
941
+ let ALLOW_DATA_ATTR = true;
942
+ let ALLOW_UNKNOWN_PROTOCOLS = false;
943
+ let ALLOW_SELF_CLOSE_IN_ATTR = true;
944
+ let SAFE_FOR_TEMPLATES = false;
945
+ let SAFE_FOR_XML = true;
946
+ let WHOLE_DOCUMENT = false;
947
+ let SET_CONFIG = false;
948
+ let FORCE_BODY = false;
949
+ let RETURN_DOM = false;
950
+ let RETURN_DOM_FRAGMENT = false;
951
+ let RETURN_TRUSTED_TYPE = false;
952
+ let SANITIZE_DOM = true;
953
+ let SANITIZE_NAMED_PROPS = false;
954
+ const SANITIZE_NAMED_PROPS_PREFIX = "user-content-";
955
+ let KEEP_CONTENT = true;
956
+ let IN_PLACE = false;
957
+ let USE_PROFILES = {};
958
+ let FORBID_CONTENTS = null;
959
+ const DEFAULT_FORBID_CONTENTS = addToSet({}, [
960
+ "annotation-xml",
961
+ "audio",
962
+ "colgroup",
963
+ "desc",
964
+ "foreignobject",
965
+ "head",
966
+ "iframe",
967
+ "math",
968
+ "mi",
969
+ "mn",
970
+ "mo",
971
+ "ms",
972
+ "mtext",
973
+ "noembed",
974
+ "noframes",
975
+ "noscript",
976
+ "plaintext",
977
+ "script",
978
+ "style",
979
+ "svg",
980
+ "template",
981
+ "thead",
982
+ "title",
983
+ "video",
984
+ "xmp"
985
+ ]);
986
+ let DATA_URI_TAGS = null;
987
+ const DEFAULT_DATA_URI_TAGS = addToSet({}, [
988
+ "audio",
989
+ "video",
990
+ "img",
991
+ "source",
992
+ "image",
993
+ "track"
994
+ ]);
995
+ let URI_SAFE_ATTRIBUTES = null;
996
+ const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [
997
+ "alt",
998
+ "class",
999
+ "for",
1000
+ "id",
1001
+ "label",
1002
+ "name",
1003
+ "pattern",
1004
+ "placeholder",
1005
+ "role",
1006
+ "summary",
1007
+ "title",
1008
+ "value",
1009
+ "style",
1010
+ "xmlns"
1011
+ ]);
1012
+ const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
1013
+ const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
1014
+ const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
1015
+ let NAMESPACE = HTML_NAMESPACE;
1016
+ let IS_EMPTY_INPUT = false;
1017
+ let ALLOWED_NAMESPACES = null;
1018
+ const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [
1019
+ MATHML_NAMESPACE,
1020
+ SVG_NAMESPACE,
1021
+ HTML_NAMESPACE
1022
+ ], stringToString);
1023
+ let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, [
1024
+ "mi",
1025
+ "mo",
1026
+ "mn",
1027
+ "ms",
1028
+ "mtext"
1029
+ ]);
1030
+ let HTML_INTEGRATION_POINTS = addToSet({}, ["annotation-xml"]);
1031
+ const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [
1032
+ "title",
1033
+ "style",
1034
+ "font",
1035
+ "a",
1036
+ "script"
1037
+ ]);
1038
+ let PARSER_MEDIA_TYPE = null;
1039
+ const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
1040
+ const DEFAULT_PARSER_MEDIA_TYPE = "text/html";
1041
+ let transformCaseFunc = null;
1042
+ let CONFIG = null;
1043
+ const formElement = document.createElement("form");
1044
+ const isRegexOrFunction = function isRegexOrFunction(testValue) {
1045
+ return testValue instanceof RegExp || testValue instanceof Function;
1046
+ };
1047
+ /**
1048
+ * _parseConfig
1049
+ *
1050
+ * @param cfg optional config literal
1051
+ */
1052
+ const _parseConfig = function _parseConfig() {
1053
+ let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1054
+ if (CONFIG && CONFIG === cfg) return;
1055
+ if (!cfg || typeof cfg !== "object") cfg = {};
1056
+ cfg = clone(cfg);
1057
+ PARSER_MEDIA_TYPE = SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
1058
+ transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase;
1059
+ ALLOWED_TAGS = objectHasOwnProperty(cfg, "ALLOWED_TAGS") ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
1060
+ ALLOWED_ATTR = objectHasOwnProperty(cfg, "ALLOWED_ATTR") ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
1061
+ ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, "ALLOWED_NAMESPACES") ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
1062
+ URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
1063
+ DATA_URI_TAGS = objectHasOwnProperty(cfg, "ADD_DATA_URI_TAGS") ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
1064
+ FORBID_CONTENTS = objectHasOwnProperty(cfg, "FORBID_CONTENTS") ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
1065
+ FORBID_TAGS = objectHasOwnProperty(cfg, "FORBID_TAGS") ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});
1066
+ FORBID_ATTR = objectHasOwnProperty(cfg, "FORBID_ATTR") ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});
1067
+ USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES : false;
1068
+ ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
1069
+ ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
1070
+ ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
1071
+ ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;
1072
+ SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
1073
+ SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false;
1074
+ WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
1075
+ RETURN_DOM = cfg.RETURN_DOM || false;
1076
+ RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
1077
+ RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;
1078
+ FORCE_BODY = cfg.FORCE_BODY || false;
1079
+ SANITIZE_DOM = cfg.SANITIZE_DOM !== false;
1080
+ SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;
1081
+ KEEP_CONTENT = cfg.KEEP_CONTENT !== false;
1082
+ IN_PLACE = cfg.IN_PLACE || false;
1083
+ IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
1084
+ NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
1085
+ MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;
1086
+ HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;
1087
+ CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
1088
+ if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
1089
+ if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
1090
+ if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === "boolean") CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
1091
+ if (SAFE_FOR_TEMPLATES) ALLOW_DATA_ATTR = false;
1092
+ if (RETURN_DOM_FRAGMENT) RETURN_DOM = true;
1093
+ if (USE_PROFILES) {
1094
+ ALLOWED_TAGS = addToSet({}, text);
1095
+ ALLOWED_ATTR = create(null);
1096
+ if (USE_PROFILES.html === true) {
1097
+ addToSet(ALLOWED_TAGS, html$1);
1098
+ addToSet(ALLOWED_ATTR, html);
1099
+ }
1100
+ if (USE_PROFILES.svg === true) {
1101
+ addToSet(ALLOWED_TAGS, svg$1);
1102
+ addToSet(ALLOWED_ATTR, svg);
1103
+ addToSet(ALLOWED_ATTR, xml);
1104
+ }
1105
+ if (USE_PROFILES.svgFilters === true) {
1106
+ addToSet(ALLOWED_TAGS, svgFilters);
1107
+ addToSet(ALLOWED_ATTR, svg);
1108
+ addToSet(ALLOWED_ATTR, xml);
1109
+ }
1110
+ if (USE_PROFILES.mathMl === true) {
1111
+ addToSet(ALLOWED_TAGS, mathMl$1);
1112
+ addToSet(ALLOWED_ATTR, mathMl);
1113
+ addToSet(ALLOWED_ATTR, xml);
1114
+ }
1115
+ }
1116
+ if (!objectHasOwnProperty(cfg, "ADD_TAGS")) EXTRA_ELEMENT_HANDLING.tagCheck = null;
1117
+ if (!objectHasOwnProperty(cfg, "ADD_ATTR")) EXTRA_ELEMENT_HANDLING.attributeCheck = null;
1118
+ if (cfg.ADD_TAGS) if (typeof cfg.ADD_TAGS === "function") EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
1119
+ else {
1120
+ if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) ALLOWED_TAGS = clone(ALLOWED_TAGS);
1121
+ addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
1122
+ }
1123
+ if (cfg.ADD_ATTR) if (typeof cfg.ADD_ATTR === "function") EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
1124
+ else {
1125
+ if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) ALLOWED_ATTR = clone(ALLOWED_ATTR);
1126
+ addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
1127
+ }
1128
+ if (cfg.ADD_URI_SAFE_ATTR) addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
1129
+ if (cfg.FORBID_CONTENTS) {
1130
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) FORBID_CONTENTS = clone(FORBID_CONTENTS);
1131
+ addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
1132
+ }
1133
+ if (cfg.ADD_FORBID_CONTENTS) {
1134
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) FORBID_CONTENTS = clone(FORBID_CONTENTS);
1135
+ addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);
1136
+ }
1137
+ if (KEEP_CONTENT) ALLOWED_TAGS["#text"] = true;
1138
+ if (WHOLE_DOCUMENT) addToSet(ALLOWED_TAGS, [
1139
+ "html",
1140
+ "head",
1141
+ "body"
1142
+ ]);
1143
+ if (ALLOWED_TAGS.table) {
1144
+ addToSet(ALLOWED_TAGS, ["tbody"]);
1145
+ delete FORBID_TAGS.tbody;
1146
+ }
1147
+ if (cfg.TRUSTED_TYPES_POLICY) {
1148
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
1149
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
1150
+ trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
1151
+ emptyHTML = trustedTypesPolicy.createHTML("");
1152
+ } else {
1153
+ if (trustedTypesPolicy === void 0) trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
1154
+ if (trustedTypesPolicy !== null && typeof emptyHTML === "string") emptyHTML = trustedTypesPolicy.createHTML("");
1155
+ }
1156
+ if (freeze) freeze(cfg);
1157
+ CONFIG = cfg;
1158
+ };
1159
+ const ALL_SVG_TAGS = addToSet({}, [
1160
+ ...svg$1,
1161
+ ...svgFilters,
1162
+ ...svgDisallowed
1163
+ ]);
1164
+ const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
1165
+ /**
1166
+ * @param element a DOM element whose namespace is being checked
1167
+ * @returns Return false if the element has a
1168
+ * namespace that a spec-compliant parser would never
1169
+ * return. Return true otherwise.
1170
+ */
1171
+ const _checkValidNamespace = function _checkValidNamespace(element) {
1172
+ let parent = getParentNode(element);
1173
+ if (!parent || !parent.tagName) parent = {
1174
+ namespaceURI: NAMESPACE,
1175
+ tagName: "template"
1176
+ };
1177
+ const tagName = stringToLowerCase(element.tagName);
1178
+ const parentTagName = stringToLowerCase(parent.tagName);
1179
+ if (!ALLOWED_NAMESPACES[element.namespaceURI]) return false;
1180
+ if (element.namespaceURI === SVG_NAMESPACE) {
1181
+ if (parent.namespaceURI === HTML_NAMESPACE) return tagName === "svg";
1182
+ if (parent.namespaceURI === MATHML_NAMESPACE) return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
1183
+ return Boolean(ALL_SVG_TAGS[tagName]);
1184
+ }
1185
+ if (element.namespaceURI === MATHML_NAMESPACE) {
1186
+ if (parent.namespaceURI === HTML_NAMESPACE) return tagName === "math";
1187
+ if (parent.namespaceURI === SVG_NAMESPACE) return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName];
1188
+ return Boolean(ALL_MATHML_TAGS[tagName]);
1189
+ }
1190
+ if (element.namespaceURI === HTML_NAMESPACE) {
1191
+ if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) return false;
1192
+ if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) return false;
1193
+ return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
1194
+ }
1195
+ if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element.namespaceURI]) return true;
1196
+ return false;
1197
+ };
1198
+ /**
1199
+ * _forceRemove
1200
+ *
1201
+ * @param node a DOM node
1202
+ */
1203
+ const _forceRemove = function _forceRemove(node) {
1204
+ arrayPush(DOMPurify.removed, { element: node });
1205
+ try {
1206
+ getParentNode(node).removeChild(node);
1207
+ } catch (_) {
1208
+ remove(node);
1209
+ }
1210
+ };
1211
+ /**
1212
+ * _removeAttribute
1213
+ *
1214
+ * @param name an Attribute name
1215
+ * @param element a DOM node
1216
+ */
1217
+ const _removeAttribute = function _removeAttribute(name, element) {
1218
+ try {
1219
+ arrayPush(DOMPurify.removed, {
1220
+ attribute: element.getAttributeNode(name),
1221
+ from: element
1222
+ });
1223
+ } catch (_) {
1224
+ arrayPush(DOMPurify.removed, {
1225
+ attribute: null,
1226
+ from: element
1227
+ });
1228
+ }
1229
+ element.removeAttribute(name);
1230
+ if (name === "is") if (RETURN_DOM || RETURN_DOM_FRAGMENT) try {
1231
+ _forceRemove(element);
1232
+ } catch (_) {}
1233
+ else try {
1234
+ element.setAttribute(name, "");
1235
+ } catch (_) {}
1236
+ };
1237
+ /**
1238
+ * _initDocument
1239
+ *
1240
+ * @param dirty - a string of dirty markup
1241
+ * @return a DOM, filled with the dirty markup
1242
+ */
1243
+ const _initDocument = function _initDocument(dirty) {
1244
+ let doc = null;
1245
+ let leadingWhitespace = null;
1246
+ if (FORCE_BODY) dirty = "<remove></remove>" + dirty;
1247
+ else {
1248
+ const matches = stringMatch(dirty, /^[\r\n\t ]+/);
1249
+ leadingWhitespace = matches && matches[0];
1250
+ }
1251
+ if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) dirty = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + dirty + "</body></html>";
1252
+ const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
1253
+ if (NAMESPACE === HTML_NAMESPACE) try {
1254
+ doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
1255
+ } catch (_) {}
1256
+ if (!doc || !doc.documentElement) {
1257
+ doc = implementation.createDocument(NAMESPACE, "template", null);
1258
+ try {
1259
+ doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
1260
+ } catch (_) {}
1261
+ }
1262
+ const body = doc.body || doc.documentElement;
1263
+ if (dirty && leadingWhitespace) body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
1264
+ if (NAMESPACE === HTML_NAMESPACE) return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0];
1265
+ return WHOLE_DOCUMENT ? doc.documentElement : body;
1266
+ };
1267
+ /**
1268
+ * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
1269
+ *
1270
+ * @param root The root element or node to start traversing on.
1271
+ * @return The created NodeIterator
1272
+ */
1273
+ const _createNodeIterator = function _createNodeIterator(root) {
1274
+ return createNodeIterator.call(root.ownerDocument || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
1275
+ };
1276
+ /**
1277
+ * _isClobbered
1278
+ *
1279
+ * @param element element to check for clobbering attacks
1280
+ * @return true if clobbered, false if safe
1281
+ */
1282
+ const _isClobbered = function _isClobbered(element) {
1283
+ return element instanceof HTMLFormElement && (typeof element.nodeName !== "string" || typeof element.textContent !== "string" || typeof element.removeChild !== "function" || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== "function" || typeof element.setAttribute !== "function" || typeof element.namespaceURI !== "string" || typeof element.insertBefore !== "function" || typeof element.hasChildNodes !== "function");
1284
+ };
1285
+ /**
1286
+ * Checks whether the given object is a DOM node.
1287
+ *
1288
+ * @param value object to check whether it's a DOM node
1289
+ * @return true is object is a DOM node
1290
+ */
1291
+ const _isNode = function _isNode(value) {
1292
+ return typeof Node === "function" && value instanceof Node;
1293
+ };
1294
+ function _executeHooks(hooks, currentNode, data) {
1295
+ arrayForEach(hooks, (hook) => {
1296
+ hook.call(DOMPurify, currentNode, data, CONFIG);
1297
+ });
1298
+ }
1299
+ /**
1300
+ * _sanitizeElements
1301
+ *
1302
+ * @protect nodeName
1303
+ * @protect textContent
1304
+ * @protect removeChild
1305
+ * @param currentNode to check for permission to exist
1306
+ * @return true if node was killed, false if left alive
1307
+ */
1308
+ const _sanitizeElements = function _sanitizeElements(currentNode) {
1309
+ let content = null;
1310
+ _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
1311
+ if (_isClobbered(currentNode)) {
1312
+ _forceRemove(currentNode);
1313
+ return true;
1314
+ }
1315
+ const tagName = transformCaseFunc(currentNode.nodeName);
1316
+ _executeHooks(hooks.uponSanitizeElement, currentNode, {
1317
+ tagName,
1318
+ allowedTags: ALLOWED_TAGS
1319
+ });
1320
+ if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
1321
+ _forceRemove(currentNode);
1322
+ return true;
1323
+ }
1324
+ if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
1325
+ _forceRemove(currentNode);
1326
+ return true;
1327
+ }
1328
+ if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
1329
+ _forceRemove(currentNode);
1330
+ return true;
1331
+ }
1332
+ if (!(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName])) {
1333
+ if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
1334
+ if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) return false;
1335
+ if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) return false;
1336
+ }
1337
+ if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
1338
+ const parentNode = getParentNode(currentNode) || currentNode.parentNode;
1339
+ const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
1340
+ if (childNodes && parentNode) {
1341
+ const childCount = childNodes.length;
1342
+ for (let i = childCount - 1; i >= 0; --i) {
1343
+ const childClone = cloneNode(childNodes[i], true);
1344
+ childClone.__removalCount = (currentNode.__removalCount || 0) + 1;
1345
+ parentNode.insertBefore(childClone, getNextSibling(currentNode));
1346
+ }
1347
+ }
1348
+ }
1349
+ _forceRemove(currentNode);
1350
+ return true;
1351
+ }
1352
+ if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
1353
+ _forceRemove(currentNode);
1354
+ return true;
1355
+ }
1356
+ if ((tagName === "noscript" || tagName === "noembed" || tagName === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
1357
+ _forceRemove(currentNode);
1358
+ return true;
1359
+ }
1360
+ if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
1361
+ content = currentNode.textContent;
1362
+ arrayForEach([
1363
+ MUSTACHE_EXPR,
1364
+ ERB_EXPR,
1365
+ TMPLIT_EXPR
1366
+ ], (expr) => {
1367
+ content = stringReplace(content, expr, " ");
1368
+ });
1369
+ if (currentNode.textContent !== content) {
1370
+ arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });
1371
+ currentNode.textContent = content;
1372
+ }
1373
+ }
1374
+ _executeHooks(hooks.afterSanitizeElements, currentNode, null);
1375
+ return false;
1376
+ };
1377
+ /**
1378
+ * _isValidAttribute
1379
+ *
1380
+ * @param lcTag Lowercase tag name of containing element.
1381
+ * @param lcName Lowercase attribute name.
1382
+ * @param value Attribute value.
1383
+ * @return Returns true if `value` is valid, otherwise false.
1384
+ */
1385
+ const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
1386
+ if (FORBID_ATTR[lcName]) return false;
1387
+ if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value in document || value in formElement)) return false;
1388
+ if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName));
1389
+ else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName));
1390
+ else if (EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag));
1391
+ else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) if (_isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)) || lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value)));
1392
+ else return false;
1393
+ else if (URI_SAFE_ATTRIBUTES[lcName]);
1394
+ else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, "")));
1395
+ else if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value, "data:") === 0 && DATA_URI_TAGS[lcTag]);
1396
+ else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, "")));
1397
+ else if (value) return false;
1398
+ return true;
1399
+ };
1400
+ /**
1401
+ * _isBasicCustomElement
1402
+ * checks if at least one dash is included in tagName, and it's not the first char
1403
+ * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
1404
+ *
1405
+ * @param tagName name of the tag of the node to sanitize
1406
+ * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
1407
+ */
1408
+ const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
1409
+ return tagName !== "annotation-xml" && stringMatch(tagName, CUSTOM_ELEMENT);
1410
+ };
1411
+ /**
1412
+ * _sanitizeAttributes
1413
+ *
1414
+ * @protect attributes
1415
+ * @protect nodeName
1416
+ * @protect removeAttribute
1417
+ * @protect setAttribute
1418
+ *
1419
+ * @param currentNode to sanitize
1420
+ */
1421
+ const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
1422
+ _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
1423
+ const { attributes } = currentNode;
1424
+ if (!attributes || _isClobbered(currentNode)) return;
1425
+ const hookEvent = {
1426
+ attrName: "",
1427
+ attrValue: "",
1428
+ keepAttr: true,
1429
+ allowedAttributes: ALLOWED_ATTR,
1430
+ forceKeepAttr: void 0
1431
+ };
1432
+ let l = attributes.length;
1433
+ while (l--) {
1434
+ const { name, namespaceURI, value: attrValue } = attributes[l];
1435
+ const lcName = transformCaseFunc(name);
1436
+ const initValue = attrValue;
1437
+ let value = name === "value" ? initValue : stringTrim(initValue);
1438
+ hookEvent.attrName = lcName;
1439
+ hookEvent.attrValue = value;
1440
+ hookEvent.keepAttr = true;
1441
+ hookEvent.forceKeepAttr = void 0;
1442
+ _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
1443
+ value = hookEvent.attrValue;
1444
+ if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name")) {
1445
+ _removeAttribute(name, currentNode);
1446
+ value = SANITIZE_NAMED_PROPS_PREFIX + value;
1447
+ }
1448
+ if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) {
1449
+ _removeAttribute(name, currentNode);
1450
+ continue;
1451
+ }
1452
+ if (lcName === "attributename" && stringMatch(value, "href")) {
1453
+ _removeAttribute(name, currentNode);
1454
+ continue;
1455
+ }
1456
+ if (hookEvent.forceKeepAttr) continue;
1457
+ if (!hookEvent.keepAttr) {
1458
+ _removeAttribute(name, currentNode);
1459
+ continue;
1460
+ }
1461
+ if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
1462
+ _removeAttribute(name, currentNode);
1463
+ continue;
1464
+ }
1465
+ if (SAFE_FOR_TEMPLATES) arrayForEach([
1466
+ MUSTACHE_EXPR,
1467
+ ERB_EXPR,
1468
+ TMPLIT_EXPR
1469
+ ], (expr) => {
1470
+ value = stringReplace(value, expr, " ");
1471
+ });
1472
+ const lcTag = transformCaseFunc(currentNode.nodeName);
1473
+ if (!_isValidAttribute(lcTag, lcName, value)) {
1474
+ _removeAttribute(name, currentNode);
1475
+ continue;
1476
+ }
1477
+ if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function") if (namespaceURI);
1478
+ else switch (trustedTypes.getAttributeType(lcTag, lcName)) {
1479
+ case "TrustedHTML":
1480
+ value = trustedTypesPolicy.createHTML(value);
1481
+ break;
1482
+ case "TrustedScriptURL":
1483
+ value = trustedTypesPolicy.createScriptURL(value);
1484
+ break;
1485
+ }
1486
+ if (value !== initValue) try {
1487
+ if (namespaceURI) currentNode.setAttributeNS(namespaceURI, name, value);
1488
+ else currentNode.setAttribute(name, value);
1489
+ if (_isClobbered(currentNode)) _forceRemove(currentNode);
1490
+ else arrayPop(DOMPurify.removed);
1491
+ } catch (_) {
1492
+ _removeAttribute(name, currentNode);
1493
+ }
1494
+ }
1495
+ _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
1496
+ };
1497
+ /**
1498
+ * _sanitizeShadowDOM
1499
+ *
1500
+ * @param fragment to iterate over recursively
1501
+ */
1502
+ const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
1503
+ let shadowNode = null;
1504
+ const shadowIterator = _createNodeIterator(fragment);
1505
+ _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
1506
+ while (shadowNode = shadowIterator.nextNode()) {
1507
+ _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
1508
+ _sanitizeElements(shadowNode);
1509
+ _sanitizeAttributes(shadowNode);
1510
+ if (shadowNode.content instanceof DocumentFragment) _sanitizeShadowDOM(shadowNode.content);
1511
+ }
1512
+ _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
1513
+ };
1514
+ DOMPurify.sanitize = function(dirty) {
1515
+ let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1516
+ let body = null;
1517
+ let importedNode = null;
1518
+ let currentNode = null;
1519
+ let returnNode = null;
1520
+ IS_EMPTY_INPUT = !dirty;
1521
+ if (IS_EMPTY_INPUT) dirty = "<!-->";
1522
+ if (typeof dirty !== "string" && !_isNode(dirty)) if (typeof dirty.toString === "function") {
1523
+ dirty = dirty.toString();
1524
+ if (typeof dirty !== "string") throw typeErrorCreate("dirty is not a string, aborting");
1525
+ } else throw typeErrorCreate("toString is not a function");
1526
+ if (!DOMPurify.isSupported) return dirty;
1527
+ if (!SET_CONFIG) _parseConfig(cfg);
1528
+ DOMPurify.removed = [];
1529
+ if (typeof dirty === "string") IN_PLACE = false;
1530
+ if (IN_PLACE) {
1531
+ if (dirty.nodeName) {
1532
+ const tagName = transformCaseFunc(dirty.nodeName);
1533
+ if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
1534
+ }
1535
+ } else if (dirty instanceof Node) {
1536
+ body = _initDocument("<!---->");
1537
+ importedNode = body.ownerDocument.importNode(dirty, true);
1538
+ if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") body = importedNode;
1539
+ else if (importedNode.nodeName === "HTML") body = importedNode;
1540
+ else body.appendChild(importedNode);
1541
+ } else {
1542
+ if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && dirty.indexOf("<") === -1) return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
1543
+ body = _initDocument(dirty);
1544
+ if (!body) return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : "";
1545
+ }
1546
+ if (body && FORCE_BODY) _forceRemove(body.firstChild);
1547
+ const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
1548
+ while (currentNode = nodeIterator.nextNode()) {
1549
+ _sanitizeElements(currentNode);
1550
+ _sanitizeAttributes(currentNode);
1551
+ if (currentNode.content instanceof DocumentFragment) _sanitizeShadowDOM(currentNode.content);
1552
+ }
1553
+ if (IN_PLACE) return dirty;
1554
+ if (RETURN_DOM) {
1555
+ if (RETURN_DOM_FRAGMENT) {
1556
+ returnNode = createDocumentFragment.call(body.ownerDocument);
1557
+ while (body.firstChild) returnNode.appendChild(body.firstChild);
1558
+ } else returnNode = body;
1559
+ if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) returnNode = importNode.call(originalDocument, returnNode, true);
1560
+ return returnNode;
1561
+ }
1562
+ let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
1563
+ if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) serializedHTML = "<!DOCTYPE " + body.ownerDocument.doctype.name + ">\n" + serializedHTML;
1564
+ if (SAFE_FOR_TEMPLATES) arrayForEach([
1565
+ MUSTACHE_EXPR,
1566
+ ERB_EXPR,
1567
+ TMPLIT_EXPR
1568
+ ], (expr) => {
1569
+ serializedHTML = stringReplace(serializedHTML, expr, " ");
1570
+ });
1571
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
1572
+ };
1573
+ DOMPurify.setConfig = function() {
1574
+ _parseConfig(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {});
1575
+ SET_CONFIG = true;
1576
+ };
1577
+ DOMPurify.clearConfig = function() {
1578
+ CONFIG = null;
1579
+ SET_CONFIG = false;
1580
+ };
1581
+ DOMPurify.isValidAttribute = function(tag, attr, value) {
1582
+ if (!CONFIG) _parseConfig({});
1583
+ return _isValidAttribute(transformCaseFunc(tag), transformCaseFunc(attr), value);
1584
+ };
1585
+ DOMPurify.addHook = function(entryPoint, hookFunction) {
1586
+ if (typeof hookFunction !== "function") return;
1587
+ arrayPush(hooks[entryPoint], hookFunction);
1588
+ };
1589
+ DOMPurify.removeHook = function(entryPoint, hookFunction) {
1590
+ if (hookFunction !== void 0) {
1591
+ const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
1592
+ return index === -1 ? void 0 : arraySplice(hooks[entryPoint], index, 1)[0];
1593
+ }
1594
+ return arrayPop(hooks[entryPoint]);
1595
+ };
1596
+ DOMPurify.removeHooks = function(entryPoint) {
1597
+ hooks[entryPoint] = [];
1598
+ };
1599
+ DOMPurify.removeAllHooks = function() {
1600
+ hooks = _createHooksMap();
1601
+ };
1602
+ return DOMPurify;
1603
+ }
1604
+ var purify$1 = createDOMPurify();
1605
+ //#endregion
1606
+ //#region src/client/webcomponents/utils/iconify.ts
1607
+ const getIconifySvgMap = /* @__PURE__ */ new Map();
1608
+ const purify = purify$1();
1609
+ async function getIconifySvg(collection, icon) {
1610
+ const id = `${collection}:${icon}`;
1611
+ if (getIconifySvgMap.has(id)) return getIconifySvgMap.get(id);
1612
+ const promise = _get().then((svg) => {
1613
+ getIconifySvgMap.set(id, svg);
1614
+ return svg;
1615
+ });
1616
+ getIconifySvgMap.set(id, promise);
1617
+ return promise;
1618
+ async function _get() {
1619
+ const url = `https://api.iconify.design/${collection}/${icon}.svg?color=currentColor&width=100%`;
1620
+ const svg = await fetch(url).then((res) => res.text());
1621
+ return purify.sanitize(svg);
1622
+ }
1623
+ }
1624
+ //#endregion
1625
+ export { getIconifySvg as t };