jclib-ui 1.1.0 → 1.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.
@@ -1,4 +1,4 @@
1
- import React, { useEffect, createContext, useContext, useState, useCallback, useRef, useMemo, useLayoutEffect, useImperativeHandle } from "react";
1
+ import React, { useEffect, createContext, useContext, useState, useCallback, useRef, Fragment, useMemo, useLayoutEffect, useImperativeHandle } from "react";
2
2
  import { isMobile, isDarkMode, random, formatData, formatDataHora, formatValor, isDesktop, getDateTimeStr, getHash, validarCNPJ, validarCPF } from "jcinfo-utils";
3
3
  import { useDragControls, motion } from "framer-motion";
4
4
  import styled from "styled-components";
@@ -307,7 +307,7 @@ function requireReactJsxRuntime_development() {
307
307
  var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
308
308
  componentFrameCache = new PossiblyWeakMap();
309
309
  }
310
- function describeNativeComponentFrame(fn, construct) {
310
+ function describeNativeComponentFrame(fn, construct2) {
311
311
  if (!fn || reentry) {
312
312
  return "";
313
313
  }
@@ -328,7 +328,7 @@ function requireReactJsxRuntime_development() {
328
328
  disableLogs();
329
329
  }
330
330
  try {
331
- if (construct) {
331
+ if (construct2) {
332
332
  var Fake = function() {
333
333
  throw Error();
334
334
  };
@@ -1104,7 +1104,7 @@ function JCAlert({
1104
1104
  onConfirm,
1105
1105
  onCancel,
1106
1106
  title,
1107
- text = "",
1107
+ text: text2 = "",
1108
1108
  children,
1109
1109
  defaultBtn = 2
1110
1110
  }) {
@@ -1193,12 +1193,10 @@ function JCAlert({
1193
1193
  ] }),
1194
1194
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "jc-alert-title", children: title })
1195
1195
  ] }),
1196
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "jc-alert-body", children: text && typeof text == "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
1197
- "span",
1198
- {
1199
- dangerouslySetInnerHTML: { __html: text.replaceAll("\n", "<br/>") }
1200
- }
1201
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: text || children }) }),
1196
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "jc-alert-body", children: text2 && typeof text2 == "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: text2.split("\n").map((line, i, arr) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Fragment, { children: [
1197
+ line,
1198
+ i < arr.length - 1 && /* @__PURE__ */ jsxRuntimeExports.jsx("br", {})
1199
+ ] }, i)) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: text2 || children }) }),
1202
1200
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "jc-alert-buttons", children: [
1203
1201
  (type === AlertTypes.Alerta || type === AlertTypes.Aviso) && /* @__PURE__ */ jsxRuntimeExports.jsx(
1204
1202
  "button",
@@ -1245,13 +1243,13 @@ function JCAlert({
1245
1243
  }
1246
1244
  ) });
1247
1245
  }
1248
- function Aviso({ onConfirm, text = "", children }) {
1246
+ function Aviso({ onConfirm, text: text2 = "", children }) {
1249
1247
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
1250
1248
  JCAlert,
1251
1249
  {
1252
1250
  type: AlertTypes.Aviso,
1253
1251
  title: "Aviso!",
1254
- text,
1252
+ text: text2,
1255
1253
  onConfirm,
1256
1254
  children
1257
1255
  }
@@ -1260,7 +1258,7 @@ function Aviso({ onConfirm, text = "", children }) {
1260
1258
  function Confirma({
1261
1259
  onConfirm,
1262
1260
  onCancel,
1263
- text = "",
1261
+ text: text2 = "",
1264
1262
  children,
1265
1263
  defaultBtn = void 0
1266
1264
  }) {
@@ -1269,7 +1267,7 @@ function Confirma({
1269
1267
  {
1270
1268
  type: AlertTypes.Confirmacao,
1271
1269
  title: "Confirmação!",
1272
- text,
1270
+ text: text2,
1273
1271
  onConfirm,
1274
1272
  onCancel,
1275
1273
  defaultBtn,
@@ -1277,13 +1275,13 @@ function Confirma({
1277
1275
  }
1278
1276
  );
1279
1277
  }
1280
- function Alerta({ onConfirm, text = "", children }) {
1278
+ function Alerta({ onConfirm, text: text2 = "", children }) {
1281
1279
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
1282
1280
  JCAlert,
1283
1281
  {
1284
1282
  type: AlertTypes.Alerta,
1285
1283
  title: "Atenção!",
1286
- text,
1284
+ text: text2,
1287
1285
  onConfirm,
1288
1286
  children
1289
1287
  }
@@ -2604,7 +2602,7 @@ function Panel({
2604
2602
  ButtonHelp,
2605
2603
  {
2606
2604
  title: "Ir para ajuda",
2607
- onClick: () => window.open(helpLink, "_blank")
2605
+ onClick: () => window.open(helpLink, "_blank", "noopener,noreferrer")
2608
2606
  }
2609
2607
  ),
2610
2608
  (goBack || goHome || onClose) && /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonClose, { title: "Fechar", onClick: handleClick })
@@ -2657,7 +2655,7 @@ function LinkToFone({
2657
2655
  function LinkToWhatsApp({
2658
2656
  title,
2659
2657
  href,
2660
- text = "",
2658
+ text: text2 = "",
2661
2659
  children,
2662
2660
  ...rest
2663
2661
  }) {
@@ -2670,7 +2668,7 @@ function LinkToWhatsApp({
2670
2668
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
2671
2669
  "a",
2672
2670
  {
2673
- href: `https://wa.me/${celular}?text=${encodeURI(text)}`,
2671
+ href: `https://wa.me/${celular}?text=${encodeURI(text2)}`,
2674
2672
  target: "_blank",
2675
2673
  rel: "noreferrer",
2676
2674
  title: title || "Enviar mensagem para este número usando o WhatsApp",
@@ -3323,7 +3321,7 @@ function ModalHeader({
3323
3321
  ButtonHelp,
3324
3322
  {
3325
3323
  title: "Ir para a ajuda",
3326
- onClick: () => window.open(helpLink, "_blank")
3324
+ onClick: () => window.open(helpLink, "_blank", "noopener,noreferrer")
3327
3325
  }
3328
3326
  ),
3329
3327
  /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonClose, { type: "button", onClick: () => setVisible(false) })
@@ -3817,8 +3815,8 @@ function isObject(obj) {
3817
3815
  }
3818
3816
  function pick(obj, keys) {
3819
3817
  if (Array.isArray(keys)) return pick(obj, (_, k) => keys.includes(k));
3820
- return Object.entries(obj).reduce((acc, _ref) => {
3821
- let [k, v] = _ref;
3818
+ return Object.entries(obj).reduce((acc, _ref2) => {
3819
+ let [k, v] = _ref2;
3822
3820
  if (keys(v, k)) acc[k] = v;
3823
3821
  return acc;
3824
3822
  }, {});
@@ -6855,8 +6853,8 @@ IMask.createPipe = createPipe;
6855
6853
  IMask.pipe = pipe;
6856
6854
  class RepeatBlock extends MaskedPattern {
6857
6855
  get repeatFrom() {
6858
- var _ref;
6859
- return (_ref = Array.isArray(this.repeat) ? this.repeat[0] : this.repeat === Infinity ? 0 : this.repeat) != null ? _ref : 0;
6856
+ var _ref2;
6857
+ return (_ref2 = Array.isArray(this.repeat) ? this.repeat[0] : this.repeat === Infinity ? 0 : this.repeat) != null ? _ref2 : 0;
6860
6858
  }
6861
6859
  get repeatTo() {
6862
6860
  var _ref2;
@@ -7161,7 +7159,7 @@ function requireReactIs_development() {
7161
7159
  var ContextProvider = REACT_PROVIDER_TYPE;
7162
7160
  var Element = REACT_ELEMENT_TYPE;
7163
7161
  var ForwardRef = REACT_FORWARD_REF_TYPE;
7164
- var Fragment = REACT_FRAGMENT_TYPE;
7162
+ var Fragment2 = REACT_FRAGMENT_TYPE;
7165
7163
  var Lazy = REACT_LAZY_TYPE;
7166
7164
  var Memo = REACT_MEMO_TYPE;
7167
7165
  var Portal = REACT_PORTAL_TYPE;
@@ -7220,7 +7218,7 @@ function requireReactIs_development() {
7220
7218
  reactIs_development.ContextProvider = ContextProvider;
7221
7219
  reactIs_development.Element = Element;
7222
7220
  reactIs_development.ForwardRef = ForwardRef;
7223
- reactIs_development.Fragment = Fragment;
7221
+ reactIs_development.Fragment = Fragment2;
7224
7222
  reactIs_development.Lazy = Lazy;
7225
7223
  reactIs_development.Memo = Memo;
7226
7224
  reactIs_development.Portal = Portal;
@@ -7360,8 +7358,8 @@ function requireCheckPropTypes() {
7360
7358
  var ReactPropTypesSecret = requireReactPropTypesSecret();
7361
7359
  var loggedTypeFailures = {};
7362
7360
  var has2 = requireHas();
7363
- printWarning = function(text) {
7364
- var message = "Warning: " + text;
7361
+ printWarning = function(text2) {
7362
+ var message = "Warning: " + text2;
7365
7363
  if (typeof console !== "undefined") {
7366
7364
  console.error(message);
7367
7365
  }
@@ -7425,8 +7423,8 @@ function requireFactoryWithTypeCheckers() {
7425
7423
  var printWarning = function() {
7426
7424
  };
7427
7425
  if (process.env.NODE_ENV !== "production") {
7428
- printWarning = function(text) {
7429
- var message = "Warning: " + text;
7426
+ printWarning = function(text2) {
7427
+ var message = "Warning: " + text2;
7430
7428
  if (typeof console !== "undefined") {
7431
7429
  console.error(message);
7432
7430
  }
@@ -8076,11 +8074,11 @@ function IMaskMixin(ComposedComponent) {
8076
8074
  ref
8077
8075
  }));
8078
8076
  }
8079
- const IMaskInputClass = IMaskMixin((_ref) => {
8077
+ const IMaskInputClass = IMaskMixin((_ref2) => {
8080
8078
  let {
8081
8079
  inputRef,
8082
8080
  ...props
8083
- } = _ref;
8081
+ } = _ref2;
8084
8082
  return React.createElement("input", {
8085
8083
  ...props,
8086
8084
  ref: inputRef
@@ -9114,11 +9112,1529 @@ function RadioGroup({
9114
9112
  }
9115
9113
  );
9116
9114
  }
9115
+ /*! @license DOMPurify 3.4.13 | (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.13/LICENSE */
9116
+ function _arrayLikeToArray(r, a) {
9117
+ (null == a || a > r.length) && (a = r.length);
9118
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
9119
+ return n;
9120
+ }
9121
+ function _arrayWithHoles(r) {
9122
+ if (Array.isArray(r)) return r;
9123
+ }
9124
+ function _iterableToArrayLimit(r, l) {
9125
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
9126
+ if (null != t) {
9127
+ var e, n, i, u, a = [], f = true, o = false;
9128
+ try {
9129
+ if (i = (t = t.call(r)).next, 0 === l) ;
9130
+ else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ;
9131
+ } catch (r2) {
9132
+ o = true, n = r2;
9133
+ } finally {
9134
+ try {
9135
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
9136
+ } finally {
9137
+ if (o) throw n;
9138
+ }
9139
+ }
9140
+ return a;
9141
+ }
9142
+ }
9143
+ function _nonIterableRest() {
9144
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
9145
+ }
9146
+ function _slicedToArray(r, e) {
9147
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
9148
+ }
9149
+ function _unsupportedIterableToArray(r, a) {
9150
+ if (r) {
9151
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
9152
+ var t = {}.toString.call(r).slice(8, -1);
9153
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
9154
+ }
9155
+ }
9156
+ const entries = Object.entries, setPrototypeOf = Object.setPrototypeOf, isFrozen = Object.isFrozen, getPrototypeOf = Object.getPrototypeOf, getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
9157
+ let freeze = Object.freeze, seal = Object.seal, create = Object.create;
9158
+ let _ref = typeof Reflect !== "undefined" && Reflect, apply = _ref.apply, construct = _ref.construct;
9159
+ if (!freeze) {
9160
+ freeze = function freeze2(x) {
9161
+ return x;
9162
+ };
9163
+ }
9164
+ if (!seal) {
9165
+ seal = function seal2(x) {
9166
+ return x;
9167
+ };
9168
+ }
9169
+ if (!apply) {
9170
+ apply = function apply2(func, thisArg) {
9171
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
9172
+ args[_key - 2] = arguments[_key];
9173
+ }
9174
+ return func.apply(thisArg, args);
9175
+ };
9176
+ }
9177
+ if (!construct) {
9178
+ construct = function construct2(Func) {
9179
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
9180
+ args[_key2 - 1] = arguments[_key2];
9181
+ }
9182
+ return new Func(...args);
9183
+ };
9184
+ }
9185
+ const arrayForEach = unapply(Array.prototype.forEach);
9186
+ const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
9187
+ const arrayPop = unapply(Array.prototype.pop);
9188
+ const arrayPush = unapply(Array.prototype.push);
9189
+ const arraySplice = unapply(Array.prototype.splice);
9190
+ const arrayIsArray = Array.isArray;
9191
+ const stringToLowerCase = unapply(String.prototype.toLowerCase);
9192
+ const stringToString = unapply(String.prototype.toString);
9193
+ const stringMatch = unapply(String.prototype.match);
9194
+ const stringReplace = unapply(String.prototype.replace);
9195
+ const stringIndexOf = unapply(String.prototype.indexOf);
9196
+ const stringTrim = unapply(String.prototype.trim);
9197
+ const numberToString = unapply(Number.prototype.toString);
9198
+ const booleanToString = unapply(Boolean.prototype.toString);
9199
+ const bigintToString = typeof BigInt === "undefined" ? null : unapply(BigInt.prototype.toString);
9200
+ const symbolToString = typeof Symbol === "undefined" ? null : unapply(Symbol.prototype.toString);
9201
+ const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
9202
+ const objectToString = unapply(Object.prototype.toString);
9203
+ const regExpTest = unapply(RegExp.prototype.test);
9204
+ const typeErrorCreate = unconstruct(TypeError);
9205
+ function unapply(func) {
9206
+ return function(thisArg) {
9207
+ if (thisArg instanceof RegExp) {
9208
+ thisArg.lastIndex = 0;
9209
+ }
9210
+ for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
9211
+ args[_key3 - 1] = arguments[_key3];
9212
+ }
9213
+ return apply(func, thisArg, args);
9214
+ };
9215
+ }
9216
+ function unconstruct(Func) {
9217
+ return function() {
9218
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
9219
+ args[_key4] = arguments[_key4];
9220
+ }
9221
+ return construct(Func, args);
9222
+ };
9223
+ }
9224
+ function addToSet(set, array) {
9225
+ let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;
9226
+ if (setPrototypeOf) {
9227
+ setPrototypeOf(set, null);
9228
+ }
9229
+ if (!arrayIsArray(array)) {
9230
+ return set;
9231
+ }
9232
+ let l = array.length;
9233
+ while (l--) {
9234
+ let element = array[l];
9235
+ if (typeof element === "string") {
9236
+ const lcElement = transformCaseFunc(element);
9237
+ if (lcElement !== element) {
9238
+ if (!isFrozen(array)) {
9239
+ array[l] = lcElement;
9240
+ }
9241
+ element = lcElement;
9242
+ }
9243
+ }
9244
+ set[element] = true;
9245
+ }
9246
+ return set;
9247
+ }
9248
+ function cleanArray(array) {
9249
+ for (let index = 0; index < array.length; index++) {
9250
+ const isPropertyExist = objectHasOwnProperty(array, index);
9251
+ if (!isPropertyExist) {
9252
+ array[index] = null;
9253
+ }
9254
+ }
9255
+ return array;
9256
+ }
9257
+ function clone(object) {
9258
+ const newObject = create(null);
9259
+ for (const _ref2 of entries(object)) {
9260
+ var _ref3 = _slicedToArray(_ref2, 2);
9261
+ const property = _ref3[0];
9262
+ const value = _ref3[1];
9263
+ const isPropertyExist = objectHasOwnProperty(object, property);
9264
+ if (isPropertyExist) {
9265
+ if (arrayIsArray(value)) {
9266
+ newObject[property] = cleanArray(value);
9267
+ } else if (value && typeof value === "object" && value.constructor === Object) {
9268
+ newObject[property] = clone(value);
9269
+ } else {
9270
+ newObject[property] = value;
9271
+ }
9272
+ }
9273
+ }
9274
+ return newObject;
9275
+ }
9276
+ function stringifyValue(value) {
9277
+ switch (typeof value) {
9278
+ case "string": {
9279
+ return value;
9280
+ }
9281
+ case "number": {
9282
+ return numberToString(value);
9283
+ }
9284
+ case "boolean": {
9285
+ return booleanToString(value);
9286
+ }
9287
+ case "bigint": {
9288
+ return bigintToString ? bigintToString(value) : "0";
9289
+ }
9290
+ case "symbol": {
9291
+ return symbolToString ? symbolToString(value) : "Symbol()";
9292
+ }
9293
+ case "undefined": {
9294
+ return objectToString(value);
9295
+ }
9296
+ case "function":
9297
+ case "object": {
9298
+ if (value === null) {
9299
+ return objectToString(value);
9300
+ }
9301
+ const valueAsRecord = value;
9302
+ const valueToString = lookupGetter(valueAsRecord, "toString");
9303
+ if (typeof valueToString === "function") {
9304
+ const stringified = valueToString(valueAsRecord);
9305
+ return typeof stringified === "string" ? stringified : objectToString(stringified);
9306
+ }
9307
+ return objectToString(value);
9308
+ }
9309
+ default: {
9310
+ return objectToString(value);
9311
+ }
9312
+ }
9313
+ }
9314
+ function lookupGetter(object, prop) {
9315
+ while (object !== null) {
9316
+ const desc = getOwnPropertyDescriptor(object, prop);
9317
+ if (desc) {
9318
+ if (desc.get) {
9319
+ return unapply(desc.get);
9320
+ }
9321
+ if (typeof desc.value === "function") {
9322
+ return unapply(desc.value);
9323
+ }
9324
+ }
9325
+ object = getPrototypeOf(object);
9326
+ }
9327
+ function fallbackValue() {
9328
+ return null;
9329
+ }
9330
+ return fallbackValue;
9331
+ }
9332
+ function isRegex(value) {
9333
+ try {
9334
+ regExpTest(value, "");
9335
+ return true;
9336
+ } catch (_unused) {
9337
+ return false;
9338
+ }
9339
+ }
9340
+ const html$1 = freeze(["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"]);
9341
+ const svg$1 = freeze(["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"]);
9342
+ const svgFilters = freeze(["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"]);
9343
+ const svgDisallowed = freeze(["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"]);
9344
+ const mathMl$1 = freeze(["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"]);
9345
+ const mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]);
9346
+ const text = freeze(["#text"]);
9347
+ const html = freeze(["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"]);
9348
+ const svg = freeze(["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", "dominant-baseline", "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-orientation", "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"]);
9349
+ const mathMl = freeze(["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"]);
9350
+ const xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]);
9351
+ const MUSTACHE_EXPR = seal(/{{[\w\W]*|^[\w\W]*}}/g);
9352
+ const ERB_EXPR = seal(/<%[\w\W]*|^[\w\W]*%>/g);
9353
+ const TMPLIT_EXPR = seal(/\${[\w\W]*/g);
9354
+ const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/);
9355
+ const ARIA_ATTR = seal(/^aria-[\-\w]+$/);
9356
+ const IS_ALLOWED_URI = seal(
9357
+ /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
9358
+ // eslint-disable-line no-useless-escape
9359
+ );
9360
+ const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
9361
+ const ATTR_WHITESPACE = seal(
9362
+ /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
9363
+ // eslint-disable-line no-control-regex
9364
+ );
9365
+ const DOCTYPE_NAME = seal(/^html$/i);
9366
+ const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
9367
+ const ELEMENT_MARKUP_PROBE = seal(/<[/\w!]/g);
9368
+ const COMMENT_MARKUP_PROBE = seal(/<[/\w]/g);
9369
+ const FALLBACK_TAG_CLOSE = seal(/<\/no(script|embed|frames)/i);
9370
+ const SELF_CLOSING_TAG = seal(/\/>/i);
9371
+ const NODE_TYPE = {
9372
+ element: 1,
9373
+ attribute: 2,
9374
+ text: 3,
9375
+ cdataSection: 4,
9376
+ entityReference: 5,
9377
+ // Deprecated
9378
+ entityNode: 6,
9379
+ // Deprecated
9380
+ processingInstruction: 7,
9381
+ comment: 8,
9382
+ document: 9,
9383
+ documentType: 10,
9384
+ documentFragment: 11,
9385
+ notation: 12
9386
+ // Deprecated
9387
+ };
9388
+ const getGlobal = function getGlobal2() {
9389
+ return typeof window === "undefined" ? null : window;
9390
+ };
9391
+ const _createTrustedTypesPolicy = function _createTrustedTypesPolicy2(trustedTypes, purifyHostElement) {
9392
+ if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") {
9393
+ return null;
9394
+ }
9395
+ let suffix = null;
9396
+ const ATTR_NAME = "data-tt-policy-suffix";
9397
+ if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
9398
+ suffix = purifyHostElement.getAttribute(ATTR_NAME);
9399
+ }
9400
+ const policyName = "dompurify" + (suffix ? "#" + suffix : "");
9401
+ try {
9402
+ return trustedTypes.createPolicy(policyName, {
9403
+ createHTML(html2) {
9404
+ return html2;
9405
+ },
9406
+ createScriptURL(scriptUrl) {
9407
+ return scriptUrl;
9408
+ }
9409
+ });
9410
+ } catch (_) {
9411
+ console.warn("TrustedTypes policy " + policyName + " could not be created.");
9412
+ return null;
9413
+ }
9414
+ };
9415
+ const _createHooksMap = function _createHooksMap2() {
9416
+ return {
9417
+ afterSanitizeAttributes: [],
9418
+ afterSanitizeElements: [],
9419
+ afterSanitizeShadowDOM: [],
9420
+ beforeSanitizeAttributes: [],
9421
+ beforeSanitizeElements: [],
9422
+ beforeSanitizeShadowDOM: [],
9423
+ uponSanitizeAttribute: [],
9424
+ uponSanitizeElement: [],
9425
+ uponSanitizeShadowNode: []
9426
+ };
9427
+ };
9428
+ const _resolveSetOption = function _resolveSetOption2(cfg, key, fallback, options) {
9429
+ return objectHasOwnProperty(cfg, key) && arrayIsArray(cfg[key]) ? addToSet(options.base ? clone(options.base) : {}, cfg[key], options.transform) : fallback;
9430
+ };
9431
+ function createDOMPurify() {
9432
+ let window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
9433
+ const DOMPurify = (root) => createDOMPurify(root);
9434
+ DOMPurify.version = "3.4.13";
9435
+ DOMPurify.removed = [];
9436
+ if (!window2 || !window2.document || window2.document.nodeType !== NODE_TYPE.document || !window2.Element) {
9437
+ DOMPurify.isSupported = false;
9438
+ return DOMPurify;
9439
+ }
9440
+ let document2 = window2.document;
9441
+ const originalDocument = document2;
9442
+ const currentScript = originalDocument.currentScript;
9443
+ window2.DocumentFragment;
9444
+ const HTMLTemplateElement = window2.HTMLTemplateElement, Node = window2.Node, Element = window2.Element, NodeFilter = window2.NodeFilter, _window$NamedNodeMap = window2.NamedNodeMap;
9445
+ _window$NamedNodeMap === void 0 ? window2.NamedNodeMap || window2.MozNamedAttrMap : _window$NamedNodeMap;
9446
+ window2.HTMLFormElement;
9447
+ const DOMParser = window2.DOMParser, trustedTypes = window2.trustedTypes;
9448
+ const ElementPrototype = Element.prototype;
9449
+ const cloneNode = lookupGetter(ElementPrototype, "cloneNode");
9450
+ const remove = lookupGetter(ElementPrototype, "remove");
9451
+ const getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
9452
+ const getChildNodes = lookupGetter(ElementPrototype, "childNodes");
9453
+ const getParentNode = lookupGetter(ElementPrototype, "parentNode");
9454
+ const getShadowRoot = lookupGetter(ElementPrototype, "shadowRoot");
9455
+ const getAttributes = lookupGetter(ElementPrototype, "attributes");
9456
+ const getNodeType = Node && Node.prototype ? lookupGetter(Node.prototype, "nodeType") : null;
9457
+ const getNodeName = Node && Node.prototype ? lookupGetter(Node.prototype, "nodeName") : null;
9458
+ const getOwnerDocument = Node && Node.prototype ? lookupGetter(Node.prototype, "ownerDocument") : null;
9459
+ if (typeof HTMLTemplateElement === "function") {
9460
+ const template = document2.createElement("template");
9461
+ if (template.content && template.content.ownerDocument) {
9462
+ document2 = template.content.ownerDocument;
9463
+ }
9464
+ }
9465
+ let trustedTypesPolicy;
9466
+ let emptyHTML = "";
9467
+ let defaultTrustedTypesPolicy;
9468
+ let defaultTrustedTypesPolicyResolved = false;
9469
+ let IN_TRUSTED_TYPES_POLICY = 0;
9470
+ const _assertNotInTrustedTypesPolicy = function _assertNotInTrustedTypesPolicy2() {
9471
+ if (IN_TRUSTED_TYPES_POLICY > 0) {
9472
+ throw typeErrorCreate('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.');
9473
+ }
9474
+ };
9475
+ const _createTrustedHTML = function _createTrustedHTML2(html2) {
9476
+ _assertNotInTrustedTypesPolicy();
9477
+ IN_TRUSTED_TYPES_POLICY++;
9478
+ try {
9479
+ return trustedTypesPolicy.createHTML(html2);
9480
+ } finally {
9481
+ IN_TRUSTED_TYPES_POLICY--;
9482
+ }
9483
+ };
9484
+ const _createTrustedScriptURL = function _createTrustedScriptURL2(scriptUrl) {
9485
+ _assertNotInTrustedTypesPolicy();
9486
+ IN_TRUSTED_TYPES_POLICY++;
9487
+ try {
9488
+ return trustedTypesPolicy.createScriptURL(scriptUrl);
9489
+ } finally {
9490
+ IN_TRUSTED_TYPES_POLICY--;
9491
+ }
9492
+ };
9493
+ const _getDefaultTrustedTypesPolicy = function _getDefaultTrustedTypesPolicy2() {
9494
+ if (!defaultTrustedTypesPolicyResolved) {
9495
+ defaultTrustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
9496
+ defaultTrustedTypesPolicyResolved = true;
9497
+ }
9498
+ return defaultTrustedTypesPolicy;
9499
+ };
9500
+ const _document = document2, implementation = _document.implementation, createNodeIterator = _document.createNodeIterator, createDocumentFragment = _document.createDocumentFragment, getElementsByTagName = _document.getElementsByTagName;
9501
+ const importNode = originalDocument.importNode;
9502
+ let hooks = _createHooksMap();
9503
+ DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && implementation.createHTMLDocument !== void 0;
9504
+ const MUSTACHE_EXPR$1 = MUSTACHE_EXPR, ERB_EXPR$1 = ERB_EXPR, TMPLIT_EXPR$1 = TMPLIT_EXPR, DATA_ATTR$1 = DATA_ATTR, ARIA_ATTR$1 = ARIA_ATTR, IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA, ATTR_WHITESPACE$1 = ATTR_WHITESPACE, CUSTOM_ELEMENT$1 = CUSTOM_ELEMENT;
9505
+ let IS_ALLOWED_URI$1 = IS_ALLOWED_URI;
9506
+ let ALLOWED_TAGS = null;
9507
+ const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
9508
+ let ALLOWED_ATTR = null;
9509
+ const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
9510
+ let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
9511
+ tagNameCheck: {
9512
+ writable: true,
9513
+ configurable: false,
9514
+ enumerable: true,
9515
+ value: null
9516
+ },
9517
+ attributeNameCheck: {
9518
+ writable: true,
9519
+ configurable: false,
9520
+ enumerable: true,
9521
+ value: null
9522
+ },
9523
+ allowCustomizedBuiltInElements: {
9524
+ writable: true,
9525
+ configurable: false,
9526
+ enumerable: true,
9527
+ value: false
9528
+ }
9529
+ }));
9530
+ let FORBID_TAGS = null;
9531
+ let FORBID_ATTR = null;
9532
+ const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {
9533
+ tagCheck: {
9534
+ writable: true,
9535
+ configurable: false,
9536
+ enumerable: true,
9537
+ value: null
9538
+ },
9539
+ attributeCheck: {
9540
+ writable: true,
9541
+ configurable: false,
9542
+ enumerable: true,
9543
+ value: null
9544
+ }
9545
+ }));
9546
+ let ALLOW_ARIA_ATTR = true;
9547
+ let ALLOW_DATA_ATTR = true;
9548
+ let ALLOW_UNKNOWN_PROTOCOLS = false;
9549
+ let ALLOW_SELF_CLOSE_IN_ATTR = true;
9550
+ let SAFE_FOR_TEMPLATES = false;
9551
+ let SAFE_FOR_XML = true;
9552
+ let WHOLE_DOCUMENT = false;
9553
+ let SET_CONFIG = false;
9554
+ let SET_CONFIG_ALLOWED_TAGS = null;
9555
+ let SET_CONFIG_ALLOWED_ATTR = null;
9556
+ let FORCE_BODY = false;
9557
+ let RETURN_DOM = false;
9558
+ let RETURN_DOM_FRAGMENT = false;
9559
+ let RETURN_TRUSTED_TYPE = false;
9560
+ let SANITIZE_DOM = true;
9561
+ let SANITIZE_NAMED_PROPS = false;
9562
+ const SANITIZE_NAMED_PROPS_PREFIX = "user-content-";
9563
+ let KEEP_CONTENT = true;
9564
+ let IN_PLACE = false;
9565
+ let USE_PROFILES = {};
9566
+ let FORBID_CONTENTS = null;
9567
+ const DEFAULT_FORBID_CONTENTS = addToSet({}, [
9568
+ "annotation-xml",
9569
+ "audio",
9570
+ "colgroup",
9571
+ "desc",
9572
+ "foreignobject",
9573
+ "head",
9574
+ "iframe",
9575
+ "math",
9576
+ "mi",
9577
+ "mn",
9578
+ "mo",
9579
+ "ms",
9580
+ "mtext",
9581
+ "noembed",
9582
+ "noframes",
9583
+ "noscript",
9584
+ "plaintext",
9585
+ "script",
9586
+ // <selectedcontent> mirrors the selected <option>'s subtree, cloned by
9587
+ // the UA (customizable <select>) — including any on* handlers — and the
9588
+ // engine re-mirrors synchronously whenever a removal changes which
9589
+ // option/selectedcontent is current, even inside DOMPurify's inert
9590
+ // DOMParser document. Hoisting its children on removal re-inserts a fresh
9591
+ // mirror target ahead of the walk, which the engine refills, looping
9592
+ // forever (DoS) and amplifying output. Dropping its content on removal
9593
+ // (rather than hoisting) breaks that cascade; the content is a duplicate
9594
+ // of the option, which is sanitized on its own. See campaign-3 F1/F6.
9595
+ "selectedcontent",
9596
+ "style",
9597
+ "svg",
9598
+ "template",
9599
+ "thead",
9600
+ "title",
9601
+ "video",
9602
+ "xmp"
9603
+ ]);
9604
+ let DATA_URI_TAGS = null;
9605
+ const DEFAULT_DATA_URI_TAGS = addToSet({}, ["audio", "video", "img", "source", "image", "track"]);
9606
+ let URI_SAFE_ATTRIBUTES = null;
9607
+ const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]);
9608
+ const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
9609
+ const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
9610
+ const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
9611
+ let NAMESPACE = HTML_NAMESPACE;
9612
+ let IS_EMPTY_INPUT = false;
9613
+ let ALLOWED_NAMESPACES = null;
9614
+ const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
9615
+ const DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze(["mi", "mo", "mn", "ms", "mtext"]);
9616
+ let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);
9617
+ const DEFAULT_HTML_INTEGRATION_POINTS = freeze(["annotation-xml"]);
9618
+ let HTML_INTEGRATION_POINTS = addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS);
9619
+ const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]);
9620
+ let PARSER_MEDIA_TYPE = null;
9621
+ const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
9622
+ const DEFAULT_PARSER_MEDIA_TYPE = "text/html";
9623
+ let transformCaseFunc = null;
9624
+ let CONFIG = null;
9625
+ const formElement = document2.createElement("form");
9626
+ const isRegexOrFunction = function isRegexOrFunction2(testValue) {
9627
+ return testValue instanceof RegExp || testValue instanceof Function;
9628
+ };
9629
+ const _parseConfig = function _parseConfig2() {
9630
+ let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
9631
+ if (CONFIG && CONFIG === cfg) {
9632
+ return;
9633
+ }
9634
+ if (!cfg || typeof cfg !== "object") {
9635
+ cfg = {};
9636
+ }
9637
+ cfg = clone(cfg);
9638
+ PARSER_MEDIA_TYPE = // eslint-disable-next-line unicorn/prefer-includes
9639
+ SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
9640
+ transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase;
9641
+ ALLOWED_TAGS = _resolveSetOption(cfg, "ALLOWED_TAGS", DEFAULT_ALLOWED_TAGS, {
9642
+ transform: transformCaseFunc
9643
+ });
9644
+ ALLOWED_ATTR = _resolveSetOption(cfg, "ALLOWED_ATTR", DEFAULT_ALLOWED_ATTR, {
9645
+ transform: transformCaseFunc
9646
+ });
9647
+ ALLOWED_NAMESPACES = _resolveSetOption(cfg, "ALLOWED_NAMESPACES", DEFAULT_ALLOWED_NAMESPACES, {
9648
+ transform: stringToString
9649
+ });
9650
+ URI_SAFE_ATTRIBUTES = _resolveSetOption(cfg, "ADD_URI_SAFE_ATTR", DEFAULT_URI_SAFE_ATTRIBUTES, {
9651
+ transform: transformCaseFunc,
9652
+ base: DEFAULT_URI_SAFE_ATTRIBUTES
9653
+ });
9654
+ DATA_URI_TAGS = _resolveSetOption(cfg, "ADD_DATA_URI_TAGS", DEFAULT_DATA_URI_TAGS, {
9655
+ transform: transformCaseFunc,
9656
+ base: DEFAULT_DATA_URI_TAGS
9657
+ });
9658
+ FORBID_CONTENTS = _resolveSetOption(cfg, "FORBID_CONTENTS", DEFAULT_FORBID_CONTENTS, {
9659
+ transform: transformCaseFunc
9660
+ });
9661
+ FORBID_TAGS = _resolveSetOption(cfg, "FORBID_TAGS", clone({}), {
9662
+ transform: transformCaseFunc
9663
+ });
9664
+ FORBID_ATTR = _resolveSetOption(cfg, "FORBID_ATTR", clone({}), {
9665
+ transform: transformCaseFunc
9666
+ });
9667
+ USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === "object" ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;
9668
+ ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
9669
+ ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
9670
+ ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
9671
+ ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;
9672
+ SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
9673
+ SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false;
9674
+ WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
9675
+ RETURN_DOM = cfg.RETURN_DOM || false;
9676
+ RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
9677
+ RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;
9678
+ FORCE_BODY = cfg.FORCE_BODY || false;
9679
+ SANITIZE_DOM = cfg.SANITIZE_DOM !== false;
9680
+ SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;
9681
+ KEEP_CONTENT = cfg.KEEP_CONTENT !== false;
9682
+ IN_PLACE = cfg.IN_PLACE || false;
9683
+ IS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI;
9684
+ NAMESPACE = typeof cfg.NAMESPACE === "string" ? cfg.NAMESPACE : HTML_NAMESPACE;
9685
+ MATHML_TEXT_INTEGRATION_POINTS = objectHasOwnProperty(cfg, "MATHML_TEXT_INTEGRATION_POINTS") && cfg.MATHML_TEXT_INTEGRATION_POINTS && typeof cfg.MATHML_TEXT_INTEGRATION_POINTS === "object" ? clone(cfg.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);
9686
+ HTML_INTEGRATION_POINTS = objectHasOwnProperty(cfg, "HTML_INTEGRATION_POINTS") && cfg.HTML_INTEGRATION_POINTS && typeof cfg.HTML_INTEGRATION_POINTS === "object" ? clone(cfg.HTML_INTEGRATION_POINTS) : addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS);
9687
+ const customElementHandling = objectHasOwnProperty(cfg, "CUSTOM_ELEMENT_HANDLING") && cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING === "object" ? clone(cfg.CUSTOM_ELEMENT_HANDLING) : create(null);
9688
+ CUSTOM_ELEMENT_HANDLING = create(null);
9689
+ if (objectHasOwnProperty(customElementHandling, "tagNameCheck") && isRegexOrFunction(customElementHandling.tagNameCheck)) {
9690
+ CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck;
9691
+ }
9692
+ if (objectHasOwnProperty(customElementHandling, "attributeNameCheck") && isRegexOrFunction(customElementHandling.attributeNameCheck)) {
9693
+ CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck;
9694
+ }
9695
+ if (objectHasOwnProperty(customElementHandling, "allowCustomizedBuiltInElements") && typeof customElementHandling.allowCustomizedBuiltInElements === "boolean") {
9696
+ CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements;
9697
+ }
9698
+ seal(CUSTOM_ELEMENT_HANDLING);
9699
+ if (SAFE_FOR_TEMPLATES) {
9700
+ ALLOW_DATA_ATTR = false;
9701
+ }
9702
+ if (RETURN_DOM_FRAGMENT) {
9703
+ RETURN_DOM = true;
9704
+ }
9705
+ if (USE_PROFILES) {
9706
+ ALLOWED_TAGS = addToSet({}, text);
9707
+ ALLOWED_ATTR = create(null);
9708
+ if (USE_PROFILES.html === true) {
9709
+ addToSet(ALLOWED_TAGS, html$1);
9710
+ addToSet(ALLOWED_ATTR, html);
9711
+ }
9712
+ if (USE_PROFILES.svg === true) {
9713
+ addToSet(ALLOWED_TAGS, svg$1);
9714
+ addToSet(ALLOWED_ATTR, svg);
9715
+ addToSet(ALLOWED_ATTR, xml);
9716
+ }
9717
+ if (USE_PROFILES.svgFilters === true) {
9718
+ addToSet(ALLOWED_TAGS, svgFilters);
9719
+ addToSet(ALLOWED_ATTR, svg);
9720
+ addToSet(ALLOWED_ATTR, xml);
9721
+ }
9722
+ if (USE_PROFILES.mathMl === true) {
9723
+ addToSet(ALLOWED_TAGS, mathMl$1);
9724
+ addToSet(ALLOWED_ATTR, mathMl);
9725
+ addToSet(ALLOWED_ATTR, xml);
9726
+ }
9727
+ }
9728
+ EXTRA_ELEMENT_HANDLING.tagCheck = null;
9729
+ EXTRA_ELEMENT_HANDLING.attributeCheck = null;
9730
+ if (objectHasOwnProperty(cfg, "ADD_TAGS")) {
9731
+ if (typeof cfg.ADD_TAGS === "function") {
9732
+ EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
9733
+ } else if (arrayIsArray(cfg.ADD_TAGS)) {
9734
+ if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
9735
+ ALLOWED_TAGS = clone(ALLOWED_TAGS);
9736
+ }
9737
+ addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
9738
+ }
9739
+ }
9740
+ if (objectHasOwnProperty(cfg, "ADD_ATTR")) {
9741
+ if (typeof cfg.ADD_ATTR === "function") {
9742
+ EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
9743
+ } else if (arrayIsArray(cfg.ADD_ATTR)) {
9744
+ if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
9745
+ ALLOWED_ATTR = clone(ALLOWED_ATTR);
9746
+ }
9747
+ addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
9748
+ }
9749
+ }
9750
+ if (objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") && arrayIsArray(cfg.ADD_URI_SAFE_ATTR)) {
9751
+ addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
9752
+ }
9753
+ if (objectHasOwnProperty(cfg, "FORBID_CONTENTS") && arrayIsArray(cfg.FORBID_CONTENTS)) {
9754
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
9755
+ FORBID_CONTENTS = clone(FORBID_CONTENTS);
9756
+ }
9757
+ addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
9758
+ }
9759
+ if (objectHasOwnProperty(cfg, "ADD_FORBID_CONTENTS") && arrayIsArray(cfg.ADD_FORBID_CONTENTS)) {
9760
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
9761
+ FORBID_CONTENTS = clone(FORBID_CONTENTS);
9762
+ }
9763
+ addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);
9764
+ }
9765
+ if (KEEP_CONTENT) {
9766
+ ALLOWED_TAGS["#text"] = true;
9767
+ }
9768
+ if (WHOLE_DOCUMENT) {
9769
+ addToSet(ALLOWED_TAGS, ["html", "head", "body"]);
9770
+ }
9771
+ if (ALLOWED_TAGS.table) {
9772
+ addToSet(ALLOWED_TAGS, ["tbody"]);
9773
+ delete FORBID_TAGS.tbody;
9774
+ }
9775
+ if (cfg.TRUSTED_TYPES_POLICY) {
9776
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") {
9777
+ throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
9778
+ }
9779
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") {
9780
+ throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
9781
+ }
9782
+ const previousTrustedTypesPolicy = trustedTypesPolicy;
9783
+ trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
9784
+ try {
9785
+ emptyHTML = _createTrustedHTML("");
9786
+ } catch (error) {
9787
+ trustedTypesPolicy = previousTrustedTypesPolicy;
9788
+ throw error;
9789
+ }
9790
+ } else if (cfg.TRUSTED_TYPES_POLICY === null) {
9791
+ trustedTypesPolicy = void 0;
9792
+ emptyHTML = "";
9793
+ } else {
9794
+ if (trustedTypesPolicy === void 0) {
9795
+ trustedTypesPolicy = _getDefaultTrustedTypesPolicy();
9796
+ }
9797
+ if (trustedTypesPolicy && typeof emptyHTML === "string") {
9798
+ emptyHTML = _createTrustedHTML("");
9799
+ }
9800
+ }
9801
+ if (freeze) {
9802
+ freeze(cfg);
9803
+ }
9804
+ CONFIG = cfg;
9805
+ };
9806
+ const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
9807
+ const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
9808
+ const _checkSvgNamespace = function _checkSvgNamespace2(tagName, parent, parentTagName) {
9809
+ if (parent.namespaceURI === HTML_NAMESPACE) {
9810
+ return tagName === "svg";
9811
+ }
9812
+ if (parent.namespaceURI === MATHML_NAMESPACE) {
9813
+ return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
9814
+ }
9815
+ return Boolean(ALL_SVG_TAGS[tagName]);
9816
+ };
9817
+ const _checkMathMlNamespace = function _checkMathMlNamespace2(tagName, parent, parentTagName) {
9818
+ if (parent.namespaceURI === HTML_NAMESPACE) {
9819
+ return tagName === "math";
9820
+ }
9821
+ if (parent.namespaceURI === SVG_NAMESPACE) {
9822
+ return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName];
9823
+ }
9824
+ return Boolean(ALL_MATHML_TAGS[tagName]);
9825
+ };
9826
+ const _checkHtmlNamespace = function _checkHtmlNamespace2(tagName, parent, parentTagName) {
9827
+ if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
9828
+ return false;
9829
+ }
9830
+ if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
9831
+ return false;
9832
+ }
9833
+ return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
9834
+ };
9835
+ const _checkValidNamespace = function _checkValidNamespace2(element) {
9836
+ let parent = getParentNode(element);
9837
+ if (!parent || !parent.tagName) {
9838
+ parent = {
9839
+ namespaceURI: NAMESPACE,
9840
+ tagName: "template"
9841
+ };
9842
+ }
9843
+ const tagName = stringToLowerCase(element.tagName);
9844
+ const parentTagName = stringToLowerCase(parent.tagName);
9845
+ if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
9846
+ return false;
9847
+ }
9848
+ if (element.namespaceURI === SVG_NAMESPACE) {
9849
+ return _checkSvgNamespace(tagName, parent, parentTagName);
9850
+ }
9851
+ if (element.namespaceURI === MATHML_NAMESPACE) {
9852
+ return _checkMathMlNamespace(tagName, parent, parentTagName);
9853
+ }
9854
+ if (element.namespaceURI === HTML_NAMESPACE) {
9855
+ return _checkHtmlNamespace(tagName, parent, parentTagName);
9856
+ }
9857
+ if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element.namespaceURI]) {
9858
+ return true;
9859
+ }
9860
+ return false;
9861
+ };
9862
+ const _forceRemove = function _forceRemove2(node) {
9863
+ arrayPush(DOMPurify.removed, {
9864
+ element: node
9865
+ });
9866
+ try {
9867
+ getParentNode(node).removeChild(node);
9868
+ } catch (_) {
9869
+ remove(node);
9870
+ if (!getParentNode(node)) {
9871
+ throw typeErrorCreate("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
9872
+ }
9873
+ }
9874
+ };
9875
+ const _neutralizeRoot = function _neutralizeRoot2(root) {
9876
+ _neutralizeSubtree(root);
9877
+ const childNodes = getChildNodes(root);
9878
+ if (childNodes) {
9879
+ const snapshot = [];
9880
+ arrayForEach(childNodes, (child) => {
9881
+ arrayPush(snapshot, child);
9882
+ });
9883
+ arrayForEach(snapshot, (child) => {
9884
+ try {
9885
+ remove(child);
9886
+ } catch (_) {
9887
+ }
9888
+ });
9889
+ }
9890
+ const attributes = getAttributes(root);
9891
+ if (attributes) {
9892
+ for (let i = attributes.length - 1; i >= 0; --i) {
9893
+ const attribute = attributes[i];
9894
+ const name = attribute && attribute.name;
9895
+ if (typeof name === "string") {
9896
+ try {
9897
+ root.removeAttribute(name);
9898
+ } catch (_) {
9899
+ }
9900
+ }
9901
+ }
9902
+ }
9903
+ };
9904
+ const _removeAttribute = function _removeAttribute2(name, element) {
9905
+ try {
9906
+ arrayPush(DOMPurify.removed, {
9907
+ attribute: element.getAttributeNode(name),
9908
+ from: element
9909
+ });
9910
+ } catch (_) {
9911
+ arrayPush(DOMPurify.removed, {
9912
+ attribute: null,
9913
+ from: element
9914
+ });
9915
+ }
9916
+ element.removeAttribute(name);
9917
+ if (name === "is") {
9918
+ if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
9919
+ try {
9920
+ _forceRemove(element);
9921
+ } catch (_) {
9922
+ }
9923
+ } else {
9924
+ try {
9925
+ element.setAttribute(name, "");
9926
+ } catch (_) {
9927
+ }
9928
+ }
9929
+ }
9930
+ };
9931
+ const _stripDisallowedAttributes = function _stripDisallowedAttributes2(element) {
9932
+ const attributes = getAttributes(element);
9933
+ if (!attributes) {
9934
+ return;
9935
+ }
9936
+ for (let i = attributes.length - 1; i >= 0; --i) {
9937
+ const attribute = attributes[i];
9938
+ const name = attribute && attribute.name;
9939
+ if (typeof name !== "string" || ALLOWED_ATTR[transformCaseFunc(name)]) {
9940
+ continue;
9941
+ }
9942
+ try {
9943
+ element.removeAttribute(name);
9944
+ } catch (_) {
9945
+ }
9946
+ }
9947
+ };
9948
+ const _neutralizeSubtree = function _neutralizeSubtree2(root) {
9949
+ const stack = [root];
9950
+ while (stack.length > 0) {
9951
+ const node = stack.pop();
9952
+ const nodeType = getNodeType ? getNodeType(node) : node.nodeType;
9953
+ if (nodeType === NODE_TYPE.element) {
9954
+ _stripDisallowedAttributes(node);
9955
+ }
9956
+ const childNodes = getChildNodes(node);
9957
+ if (childNodes) {
9958
+ for (let i = childNodes.length - 1; i >= 0; --i) {
9959
+ stack.push(childNodes[i]);
9960
+ }
9961
+ }
9962
+ }
9963
+ };
9964
+ const _neutralizePatchLinkage = function _neutralizePatchLinkage2(root) {
9965
+ if (!SAFE_FOR_XML) {
9966
+ return;
9967
+ }
9968
+ const stack = [root];
9969
+ while (stack.length > 0) {
9970
+ const node = stack.pop();
9971
+ const nodeType = getNodeType ? getNodeType(node) : node.nodeType;
9972
+ if (nodeType === NODE_TYPE.processingInstruction || nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, node.data)) {
9973
+ try {
9974
+ remove(node);
9975
+ } catch (_) {
9976
+ }
9977
+ continue;
9978
+ }
9979
+ if (nodeType === NODE_TYPE.element) {
9980
+ const element = node;
9981
+ const lcTag = transformCaseFunc(getNodeName ? getNodeName(node) : node.nodeName);
9982
+ try {
9983
+ if (element.hasAttribute && element.hasAttribute("patchsrc")) {
9984
+ element.removeAttribute("patchsrc");
9985
+ }
9986
+ if (element.hasAttribute && element.hasAttribute("for") && lcTag !== "label" && lcTag !== "output") {
9987
+ element.removeAttribute("for");
9988
+ }
9989
+ } catch (_) {
9990
+ }
9991
+ }
9992
+ const childNodes = getChildNodes(node);
9993
+ if (childNodes) {
9994
+ for (let i = childNodes.length - 1; i >= 0; --i) {
9995
+ stack.push(childNodes[i]);
9996
+ }
9997
+ }
9998
+ }
9999
+ };
10000
+ const _initDocument = function _initDocument2(dirty) {
10001
+ let doc = null;
10002
+ let leadingWhitespace = null;
10003
+ if (FORCE_BODY) {
10004
+ dirty = "<remove></remove>" + dirty;
10005
+ } else {
10006
+ const matches = stringMatch(dirty, /^[\r\n\t ]+/);
10007
+ leadingWhitespace = matches && matches[0];
10008
+ }
10009
+ if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) {
10010
+ dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + "</body></html>";
10011
+ }
10012
+ const dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty;
10013
+ if (NAMESPACE === HTML_NAMESPACE) {
10014
+ try {
10015
+ doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
10016
+ } catch (_) {
10017
+ }
10018
+ }
10019
+ if (!doc || !doc.documentElement) {
10020
+ doc = implementation.createDocument(NAMESPACE, "template", null);
10021
+ try {
10022
+ doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
10023
+ } catch (_) {
10024
+ }
10025
+ }
10026
+ const body = doc.body || doc.documentElement;
10027
+ if (dirty && leadingWhitespace) {
10028
+ body.insertBefore(document2.createTextNode(leadingWhitespace), body.childNodes[0] || null);
10029
+ }
10030
+ if (NAMESPACE === HTML_NAMESPACE) {
10031
+ return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0];
10032
+ }
10033
+ return WHOLE_DOCUMENT ? doc.documentElement : body;
10034
+ };
10035
+ const _createNodeIterator = function _createNodeIterator2(root) {
10036
+ const doc = getOwnerDocument ? getOwnerDocument(root) : root.ownerDocument;
10037
+ return createNodeIterator.call(
10038
+ doc || root,
10039
+ root,
10040
+ // eslint-disable-next-line no-bitwise
10041
+ NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION,
10042
+ null
10043
+ );
10044
+ };
10045
+ const _stripTemplateExpressions = function _stripTemplateExpressions2(value) {
10046
+ value = stringReplace(value, MUSTACHE_EXPR$1, " ");
10047
+ value = stringReplace(value, ERB_EXPR$1, " ");
10048
+ value = stringReplace(value, TMPLIT_EXPR$1, " ");
10049
+ return value;
10050
+ };
10051
+ const _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node) {
10052
+ var _node$querySelectorAl;
10053
+ node.normalize();
10054
+ const doc = getOwnerDocument ? getOwnerDocument(node) : node.ownerDocument;
10055
+ const walker = createNodeIterator.call(
10056
+ doc || node,
10057
+ node,
10058
+ // eslint-disable-next-line no-bitwise
10059
+ NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION,
10060
+ null
10061
+ );
10062
+ let currentNode = walker.nextNode();
10063
+ while (currentNode) {
10064
+ currentNode.data = _stripTemplateExpressions(currentNode.data);
10065
+ currentNode = walker.nextNode();
10066
+ }
10067
+ const templates = (_node$querySelectorAl = node.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node, "template");
10068
+ if (templates) {
10069
+ arrayForEach(templates, (tmpl) => {
10070
+ if (_isDocumentFragment(tmpl.content)) {
10071
+ _scrubTemplateExpressions2(tmpl.content);
10072
+ }
10073
+ });
10074
+ }
10075
+ };
10076
+ const _isClobbered = function _isClobbered2(element) {
10077
+ const realTagName = getNodeName ? getNodeName(element) : null;
10078
+ if (typeof realTagName !== "string") {
10079
+ return false;
10080
+ }
10081
+ if (transformCaseFunc(realTagName) !== "form") {
10082
+ return false;
10083
+ }
10084
+ return typeof element.nodeName !== "string" || typeof element.textContent !== "string" || typeof element.removeChild !== "function" || // Realm-safe NamedNodeMap detection: equality against the cached
10085
+ // prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
10086
+ // makes the direct read diverge from the cached read; a clean form
10087
+ // (same-realm OR foreign-realm) has both reads pointing at the same
10088
+ // canonical NamedNodeMap.
10089
+ element.attributes !== getAttributes(element) || typeof element.removeAttribute !== "function" || typeof element.setAttribute !== "function" || typeof element.namespaceURI !== "string" || typeof element.insertBefore !== "function" || typeof element.hasChildNodes !== "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
10090
+ // returns the integer 1 for any Element regardless of realm; direct
10091
+ // read on a clobbered form (e.g. <input name="nodeType">) returns
10092
+ // the named child element. Cheap addition — nodeType is read from
10093
+ // an internal slot, no serialization cost — and removes a residual
10094
+ // clobbering surface used by several mXSS / PI / comment branches
10095
+ // in _sanitizeElements that compare currentNode.nodeType directly.
10096
+ element.nodeType !== getNodeType(element) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
10097
+ // "childNodes" shadows the prototype getter. Direct reads of
10098
+ // form.childNodes from a clobbered form return the named child
10099
+ // instead of the real NodeList, so any walk that reads it directly
10100
+ // skips the form's real children. Compare the direct read to the
10101
+ // cached Node.prototype getter — when the form's named-property
10102
+ // getter intercepts the read, the two values differ and we flag
10103
+ // the form. This catches every clobbering child type (input,
10104
+ // select, etc.) regardless of whether the named child happens to
10105
+ // carry a numeric .length, which a typeof-based probe would miss
10106
+ // (e.g. HTMLSelectElement.length is a defined unsigned-long).
10107
+ element.childNodes !== getChildNodes(element);
10108
+ };
10109
+ const _isDocumentFragment = function _isDocumentFragment2(value) {
10110
+ if (!getNodeType || typeof value !== "object" || value === null) {
10111
+ return false;
10112
+ }
10113
+ try {
10114
+ return getNodeType(value) === NODE_TYPE.documentFragment;
10115
+ } catch (_) {
10116
+ return false;
10117
+ }
10118
+ };
10119
+ const _isNode = function _isNode2(value) {
10120
+ if (!getNodeType || typeof value !== "object" || value === null) {
10121
+ return false;
10122
+ }
10123
+ try {
10124
+ return typeof getNodeType(value) === "number";
10125
+ } catch (_) {
10126
+ return false;
10127
+ }
10128
+ };
10129
+ function _executeHooks(hooks2, currentNode, data) {
10130
+ if (hooks2.length === 0) {
10131
+ return;
10132
+ }
10133
+ arrayForEach(hooks2, (hook) => {
10134
+ hook.call(DOMPurify, currentNode, data, CONFIG);
10135
+ });
10136
+ }
10137
+ const _isUnsafeNode = function _isUnsafeNode2(currentNode, tagName) {
10138
+ if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) {
10139
+ return true;
10140
+ }
10141
+ if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && tagName === "style" && _isNode(currentNode.firstElementChild)) {
10142
+ return true;
10143
+ }
10144
+ if (currentNode.nodeType === NODE_TYPE.processingInstruction) {
10145
+ return true;
10146
+ }
10147
+ if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) {
10148
+ return true;
10149
+ }
10150
+ return false;
10151
+ };
10152
+ const _sanitizeDisallowedNode = function _sanitizeDisallowedNode2(currentNode, tagName, root) {
10153
+ if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
10154
+ if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
10155
+ return false;
10156
+ }
10157
+ if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
10158
+ return false;
10159
+ }
10160
+ }
10161
+ if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
10162
+ const parentNode = getParentNode(currentNode);
10163
+ const childNodes = getChildNodes(currentNode);
10164
+ if (childNodes && parentNode) {
10165
+ const childCount = childNodes.length;
10166
+ for (let i = childCount - 1; i >= 0; --i) {
10167
+ const hoisted = currentNode === root ? cloneNode(childNodes[i], true) : childNodes[i];
10168
+ parentNode.insertBefore(hoisted, getNextSibling(currentNode));
10169
+ }
10170
+ }
10171
+ }
10172
+ _forceRemove(currentNode);
10173
+ return true;
10174
+ };
10175
+ const _forkSharedAllowlist = function _forkSharedAllowlist2(hookList, set, defaultSet, setConfigSet) {
10176
+ if (hookList.length === 0) {
10177
+ return set;
10178
+ }
10179
+ return set === defaultSet || set === setConfigSet ? clone(set) : set;
10180
+ };
10181
+ const _sanitizeElements = function _sanitizeElements2(currentNode, root) {
10182
+ _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
10183
+ if (currentNode !== root && getParentNode(currentNode) === null) {
10184
+ if (IN_PLACE) {
10185
+ _neutralizeSubtree(currentNode);
10186
+ }
10187
+ return true;
10188
+ }
10189
+ if (_isClobbered(currentNode)) {
10190
+ _forceRemove(currentNode);
10191
+ return true;
10192
+ }
10193
+ const tagName = transformCaseFunc(getNodeName ? getNodeName(currentNode) : currentNode.nodeName);
10194
+ ALLOWED_TAGS = _forkSharedAllowlist(hooks.uponSanitizeElement, ALLOWED_TAGS, DEFAULT_ALLOWED_TAGS, SET_CONFIG_ALLOWED_TAGS);
10195
+ _executeHooks(hooks.uponSanitizeElement, currentNode, {
10196
+ tagName,
10197
+ allowedTags: ALLOWED_TAGS
10198
+ });
10199
+ if (currentNode !== root && getParentNode(currentNode) === null) {
10200
+ if (IN_PLACE) {
10201
+ _neutralizeSubtree(currentNode);
10202
+ }
10203
+ return true;
10204
+ }
10205
+ if (_isUnsafeNode(currentNode, tagName)) {
10206
+ _forceRemove(currentNode);
10207
+ return true;
10208
+ }
10209
+ if (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {
10210
+ const removed = _sanitizeDisallowedNode(currentNode, tagName, root);
10211
+ if (removed === false) {
10212
+ _executeHooks(hooks.afterSanitizeElements, currentNode, null);
10213
+ }
10214
+ return removed;
10215
+ }
10216
+ const nt = getNodeType ? getNodeType(currentNode) : currentNode.nodeType;
10217
+ if (nt === NODE_TYPE.element && !_checkValidNamespace(currentNode)) {
10218
+ _forceRemove(currentNode);
10219
+ return true;
10220
+ }
10221
+ if ((tagName === "noscript" || tagName === "noembed" || tagName === "noframes") && regExpTest(FALLBACK_TAG_CLOSE, currentNode.innerHTML)) {
10222
+ _forceRemove(currentNode);
10223
+ return true;
10224
+ }
10225
+ if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
10226
+ const content = _stripTemplateExpressions(currentNode.textContent);
10227
+ if (currentNode.textContent !== content) {
10228
+ arrayPush(DOMPurify.removed, {
10229
+ element: currentNode.cloneNode()
10230
+ });
10231
+ currentNode.textContent = content;
10232
+ }
10233
+ }
10234
+ _executeHooks(hooks.afterSanitizeElements, currentNode, null);
10235
+ return false;
10236
+ };
10237
+ const _isValidAttribute = function _isValidAttribute2(lcTag, lcName, value) {
10238
+ if (FORBID_ATTR[lcName]) {
10239
+ return false;
10240
+ }
10241
+ if (SAFE_FOR_XML && lcName === "patchsrc") {
10242
+ return false;
10243
+ }
10244
+ if (SAFE_FOR_XML && lcName === "for" && lcTag !== "label" && lcTag !== "output") {
10245
+ return false;
10246
+ }
10247
+ if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value in document2 || value in formElement)) {
10248
+ return false;
10249
+ }
10250
+ const nameIsPermitted = ALLOWED_ATTR[lcName] || EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag);
10251
+ if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) ;
10252
+ else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) ;
10253
+ else if (!nameIsPermitted) {
10254
+ if (
10255
+ // First condition does a very basic check if a) it's basically a valid custom element tagname AND
10256
+ // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
10257
+ // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
10258
+ _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)) || // Alternative, second condition checks if it's an `is`-attribute, AND
10259
+ // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
10260
+ 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))
10261
+ ) ;
10262
+ else {
10263
+ return false;
10264
+ }
10265
+ } else if (URI_SAFE_ATTRIBUTES[lcName]) ;
10266
+ else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, ""))) ;
10267
+ else if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value, "data:") === 0 && DATA_URI_TAGS[lcTag]) ;
10268
+ else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value, ATTR_WHITESPACE$1, ""))) ;
10269
+ else if (value) {
10270
+ return false;
10271
+ } else ;
10272
+ return true;
10273
+ };
10274
+ const RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]);
10275
+ const _isBasicCustomElement = function _isBasicCustomElement2(tagName) {
10276
+ return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName);
10277
+ };
10278
+ const _applyTrustedTypesToAttribute = function _applyTrustedTypesToAttribute2(lcTag, lcName, namespaceURI, value) {
10279
+ if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function" && !namespaceURI) {
10280
+ switch (trustedTypes.getAttributeType(lcTag, lcName)) {
10281
+ case "TrustedHTML": {
10282
+ return _createTrustedHTML(value);
10283
+ }
10284
+ case "TrustedScriptURL": {
10285
+ return _createTrustedScriptURL(value);
10286
+ }
10287
+ }
10288
+ }
10289
+ return value;
10290
+ };
10291
+ const _setAttributeValue = function _setAttributeValue2(currentNode, name, namespaceURI, value) {
10292
+ try {
10293
+ if (namespaceURI) {
10294
+ currentNode.setAttributeNS(namespaceURI, name, value);
10295
+ } else {
10296
+ currentNode.setAttribute(name, value);
10297
+ }
10298
+ if (_isClobbered(currentNode)) {
10299
+ _forceRemove(currentNode);
10300
+ } else {
10301
+ arrayPop(DOMPurify.removed);
10302
+ }
10303
+ } catch (_) {
10304
+ _removeAttribute(name, currentNode);
10305
+ }
10306
+ };
10307
+ const _sanitizeAttributes = function _sanitizeAttributes2(currentNode) {
10308
+ _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
10309
+ const attributes = currentNode.attributes;
10310
+ if (!attributes || _isClobbered(currentNode)) {
10311
+ return;
10312
+ }
10313
+ ALLOWED_ATTR = _forkSharedAllowlist(hooks.uponSanitizeAttribute, ALLOWED_ATTR, DEFAULT_ALLOWED_ATTR, SET_CONFIG_ALLOWED_ATTR);
10314
+ const hookEvent = {
10315
+ attrName: "",
10316
+ attrValue: "",
10317
+ keepAttr: true,
10318
+ allowedAttributes: ALLOWED_ATTR,
10319
+ forceKeepAttr: void 0
10320
+ };
10321
+ let l = attributes.length;
10322
+ const lcTag = transformCaseFunc(currentNode.nodeName);
10323
+ while (l--) {
10324
+ const attr = attributes[l];
10325
+ const name = attr.name, namespaceURI = attr.namespaceURI, attrValue = attr.value;
10326
+ const lcName = transformCaseFunc(name);
10327
+ const initValue = attrValue;
10328
+ let value = name === "value" ? initValue : stringTrim(initValue);
10329
+ hookEvent.attrName = lcName;
10330
+ hookEvent.attrValue = value;
10331
+ hookEvent.keepAttr = true;
10332
+ hookEvent.forceKeepAttr = void 0;
10333
+ _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
10334
+ value = hookEvent.attrValue;
10335
+ if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name") && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) {
10336
+ _removeAttribute(name, currentNode);
10337
+ value = SANITIZE_NAMED_PROPS_PREFIX + value;
10338
+ }
10339
+ if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) {
10340
+ _removeAttribute(name, currentNode);
10341
+ continue;
10342
+ }
10343
+ if (lcName === "attributename" && stringMatch(value, "href")) {
10344
+ _removeAttribute(name, currentNode);
10345
+ continue;
10346
+ }
10347
+ if (hookEvent.forceKeepAttr) {
10348
+ continue;
10349
+ }
10350
+ if (!hookEvent.keepAttr) {
10351
+ _removeAttribute(name, currentNode);
10352
+ continue;
10353
+ }
10354
+ if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value)) {
10355
+ _removeAttribute(name, currentNode);
10356
+ continue;
10357
+ }
10358
+ if (SAFE_FOR_TEMPLATES) {
10359
+ value = _stripTemplateExpressions(value);
10360
+ }
10361
+ if (!_isValidAttribute(lcTag, lcName, value)) {
10362
+ _removeAttribute(name, currentNode);
10363
+ continue;
10364
+ }
10365
+ value = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);
10366
+ if (value !== initValue) {
10367
+ _setAttributeValue(currentNode, name, namespaceURI, value);
10368
+ }
10369
+ }
10370
+ _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
10371
+ };
10372
+ const _sanitizeShadowDOM2 = function _sanitizeShadowDOM(fragment) {
10373
+ let shadowNode = null;
10374
+ const shadowIterator = _createNodeIterator(fragment);
10375
+ _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
10376
+ while (shadowNode = shadowIterator.nextNode()) {
10377
+ _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
10378
+ _sanitizeElements(shadowNode, fragment);
10379
+ _sanitizeAttributes(shadowNode);
10380
+ if (_isDocumentFragment(shadowNode.content)) {
10381
+ _sanitizeShadowDOM2(shadowNode.content);
10382
+ }
10383
+ const shadowNodeType = getNodeType ? getNodeType(shadowNode) : shadowNode.nodeType;
10384
+ if (shadowNodeType === NODE_TYPE.element) {
10385
+ const innerSr = getShadowRoot(shadowNode);
10386
+ if (_isDocumentFragment(innerSr)) {
10387
+ _sanitizeAttachedShadowRoots(innerSr);
10388
+ _sanitizeShadowDOM2(innerSr);
10389
+ }
10390
+ }
10391
+ }
10392
+ _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
10393
+ };
10394
+ const _sanitizeAttachedShadowRoots = function _sanitizeAttachedShadowRoots2(root) {
10395
+ const stack = [{
10396
+ node: root,
10397
+ shadow: null
10398
+ }];
10399
+ while (stack.length > 0) {
10400
+ const item = stack.pop();
10401
+ if (item.shadow) {
10402
+ _sanitizeShadowDOM2(item.shadow);
10403
+ continue;
10404
+ }
10405
+ const node = item.node;
10406
+ const nodeType = getNodeType ? getNodeType(node) : node.nodeType;
10407
+ const isElement = nodeType === NODE_TYPE.element;
10408
+ const childNodes = getChildNodes(node);
10409
+ if (childNodes) {
10410
+ for (let i = childNodes.length - 1; i >= 0; --i) {
10411
+ stack.push({
10412
+ node: childNodes[i],
10413
+ shadow: null
10414
+ });
10415
+ }
10416
+ }
10417
+ if (isElement) {
10418
+ const rootName = getNodeName ? getNodeName(node) : null;
10419
+ if (typeof rootName === "string" && transformCaseFunc(rootName) === "template") {
10420
+ const content = node.content;
10421
+ if (_isDocumentFragment(content)) {
10422
+ stack.push({
10423
+ node: content,
10424
+ shadow: null
10425
+ });
10426
+ }
10427
+ }
10428
+ }
10429
+ if (isElement) {
10430
+ const sr = getShadowRoot(node);
10431
+ if (_isDocumentFragment(sr)) {
10432
+ stack.push({
10433
+ node: null,
10434
+ shadow: sr
10435
+ }, {
10436
+ node: sr,
10437
+ shadow: null
10438
+ });
10439
+ }
10440
+ }
10441
+ }
10442
+ };
10443
+ DOMPurify.sanitize = function(dirty) {
10444
+ let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
10445
+ let body = null;
10446
+ let importedNode = null;
10447
+ let currentNode = null;
10448
+ let returnNode = null;
10449
+ IS_EMPTY_INPUT = !dirty;
10450
+ if (IS_EMPTY_INPUT) {
10451
+ dirty = "<!-->";
10452
+ }
10453
+ if (typeof dirty !== "string" && !_isNode(dirty)) {
10454
+ dirty = stringifyValue(dirty);
10455
+ if (typeof dirty !== "string") {
10456
+ throw typeErrorCreate("dirty is not a string, aborting");
10457
+ }
10458
+ }
10459
+ if (!DOMPurify.isSupported) {
10460
+ return dirty;
10461
+ }
10462
+ if (SET_CONFIG) {
10463
+ ALLOWED_TAGS = SET_CONFIG_ALLOWED_TAGS;
10464
+ ALLOWED_ATTR = SET_CONFIG_ALLOWED_ATTR;
10465
+ } else {
10466
+ _parseConfig(cfg);
10467
+ }
10468
+ if (hooks.uponSanitizeElement.length > 0 || hooks.uponSanitizeAttribute.length > 0) {
10469
+ ALLOWED_TAGS = clone(ALLOWED_TAGS);
10470
+ }
10471
+ if (hooks.uponSanitizeAttribute.length > 0) {
10472
+ ALLOWED_ATTR = clone(ALLOWED_ATTR);
10473
+ }
10474
+ DOMPurify.removed = [];
10475
+ const inPlace = IN_PLACE && typeof dirty !== "string" && _isNode(dirty);
10476
+ if (inPlace) {
10477
+ _neutralizePatchLinkage(dirty);
10478
+ const nn = getNodeName ? getNodeName(dirty) : dirty.nodeName;
10479
+ if (typeof nn === "string") {
10480
+ const tagName = transformCaseFunc(nn);
10481
+ if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
10482
+ _neutralizeRoot(dirty);
10483
+ throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
10484
+ }
10485
+ }
10486
+ if (_isClobbered(dirty)) {
10487
+ _neutralizeRoot(dirty);
10488
+ throw typeErrorCreate("root node is clobbered and cannot be sanitized in-place");
10489
+ }
10490
+ try {
10491
+ _sanitizeAttachedShadowRoots(dirty);
10492
+ } catch (error) {
10493
+ _neutralizeRoot(dirty);
10494
+ throw error;
10495
+ }
10496
+ } else if (_isNode(dirty)) {
10497
+ body = _initDocument("<!---->");
10498
+ importedNode = body.ownerDocument.importNode(dirty, true);
10499
+ if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") {
10500
+ body = importedNode;
10501
+ } else if (importedNode.nodeName === "HTML") {
10502
+ body = importedNode;
10503
+ } else {
10504
+ body.appendChild(importedNode);
10505
+ }
10506
+ _sanitizeAttachedShadowRoots(importedNode);
10507
+ } else {
10508
+ if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && // eslint-disable-next-line unicorn/prefer-includes
10509
+ dirty.indexOf("<") === -1) {
10510
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty;
10511
+ }
10512
+ body = _initDocument(dirty);
10513
+ if (!body) {
10514
+ return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : "";
10515
+ }
10516
+ }
10517
+ if (body && FORCE_BODY) {
10518
+ _forceRemove(body.firstChild);
10519
+ }
10520
+ const walkRoot = inPlace ? dirty : body;
10521
+ try {
10522
+ const nodeIterator = _createNodeIterator(walkRoot);
10523
+ while (currentNode = nodeIterator.nextNode()) {
10524
+ _sanitizeElements(currentNode, walkRoot);
10525
+ _sanitizeAttributes(currentNode);
10526
+ if (_isDocumentFragment(currentNode.content)) {
10527
+ _sanitizeShadowDOM2(currentNode.content);
10528
+ }
10529
+ }
10530
+ } catch (error) {
10531
+ if (inPlace) {
10532
+ _neutralizeRoot(dirty);
10533
+ arrayForEach(DOMPurify.removed, (entry) => {
10534
+ if (entry.element) {
10535
+ _neutralizeSubtree(entry.element);
10536
+ }
10537
+ });
10538
+ }
10539
+ throw error;
10540
+ }
10541
+ if (inPlace) {
10542
+ arrayForEach(DOMPurify.removed, (entry) => {
10543
+ if (entry.element) {
10544
+ _neutralizeSubtree(entry.element);
10545
+ }
10546
+ });
10547
+ if (SAFE_FOR_TEMPLATES) {
10548
+ _scrubTemplateExpressions2(dirty);
10549
+ }
10550
+ return dirty;
10551
+ }
10552
+ if (RETURN_DOM) {
10553
+ if (SAFE_FOR_TEMPLATES) {
10554
+ _scrubTemplateExpressions2(body);
10555
+ }
10556
+ if (RETURN_DOM_FRAGMENT) {
10557
+ returnNode = createDocumentFragment.call(body.ownerDocument);
10558
+ while (body.firstChild) {
10559
+ returnNode.appendChild(body.firstChild);
10560
+ }
10561
+ } else {
10562
+ returnNode = body;
10563
+ }
10564
+ if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
10565
+ returnNode = importNode.call(originalDocument, returnNode, true);
10566
+ }
10567
+ return returnNode;
10568
+ }
10569
+ let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
10570
+ if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
10571
+ serializedHTML = "<!DOCTYPE " + body.ownerDocument.doctype.name + ">\n" + serializedHTML;
10572
+ }
10573
+ if (SAFE_FOR_TEMPLATES) {
10574
+ serializedHTML = _stripTemplateExpressions(serializedHTML);
10575
+ }
10576
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(serializedHTML) : serializedHTML;
10577
+ };
10578
+ DOMPurify.setConfig = function() {
10579
+ let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
10580
+ _parseConfig(cfg);
10581
+ SET_CONFIG = true;
10582
+ SET_CONFIG_ALLOWED_TAGS = ALLOWED_TAGS;
10583
+ SET_CONFIG_ALLOWED_ATTR = ALLOWED_ATTR;
10584
+ };
10585
+ DOMPurify.clearConfig = function() {
10586
+ CONFIG = null;
10587
+ SET_CONFIG = false;
10588
+ SET_CONFIG_ALLOWED_TAGS = null;
10589
+ SET_CONFIG_ALLOWED_ATTR = null;
10590
+ trustedTypesPolicy = defaultTrustedTypesPolicy;
10591
+ emptyHTML = "";
10592
+ };
10593
+ DOMPurify.isValidAttribute = function(tag, attr, value) {
10594
+ if (!CONFIG) {
10595
+ _parseConfig({});
10596
+ }
10597
+ const lcTag = transformCaseFunc(tag);
10598
+ const lcName = transformCaseFunc(attr);
10599
+ return _isValidAttribute(lcTag, lcName, value);
10600
+ };
10601
+ DOMPurify.addHook = function(entryPoint, hookFunction) {
10602
+ if (typeof hookFunction !== "function") {
10603
+ return;
10604
+ }
10605
+ if (!objectHasOwnProperty(hooks, entryPoint)) {
10606
+ return;
10607
+ }
10608
+ arrayPush(hooks[entryPoint], hookFunction);
10609
+ };
10610
+ DOMPurify.removeHook = function(entryPoint, hookFunction) {
10611
+ if (!objectHasOwnProperty(hooks, entryPoint)) {
10612
+ return void 0;
10613
+ }
10614
+ if (hookFunction !== void 0) {
10615
+ const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
10616
+ return index === -1 ? void 0 : arraySplice(hooks[entryPoint], index, 1)[0];
10617
+ }
10618
+ return arrayPop(hooks[entryPoint]);
10619
+ };
10620
+ DOMPurify.removeHooks = function(entryPoint) {
10621
+ if (!objectHasOwnProperty(hooks, entryPoint)) {
10622
+ return;
10623
+ }
10624
+ hooks[entryPoint] = [];
10625
+ };
10626
+ DOMPurify.removeAllHooks = function() {
10627
+ hooks = _createHooksMap();
10628
+ };
10629
+ return DOMPurify;
10630
+ }
10631
+ var purify = createDOMPurify();
9117
10632
  function TextHTML({ value }) {
10633
+ let html2 = value;
9118
10634
  if (value && typeof value == "string") {
9119
- value.replaceAll("\n", "<br/>");
10635
+ html2 = value.replaceAll("\n", "<br/>");
9120
10636
  }
9121
- return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { dangerouslySetInnerHTML: { __html: value } });
10637
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { dangerouslySetInnerHTML: { __html: purify.sanitize(html2) } });
9122
10638
  }
9123
10639
  const Container$2 = styled.div`
9124
10640
  --toggle-color-on: #4169ed;
@@ -12448,6 +13964,7 @@ function Navbar({
12448
13964
  className: "btn nav-button",
12449
13965
  href: helpLink,
12450
13966
  target: "_blank",
13967
+ rel: "noreferrer noopener",
12451
13968
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(IconeHelp, {})
12452
13969
  }
12453
13970
  ),