@nsshunt/stsuxvue 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/stsuxvue.mjs CHANGED
@@ -8212,7 +8212,7 @@ var Filter = /* @__PURE__ */ function() {
8212
8212
  }();
8213
8213
  var ansi_to_html = Filter;
8214
8214
  const Convert = /* @__PURE__ */ getDefaultExportFromCjs(ansi_to_html);
8215
- /*! @license DOMPurify 3.1.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.2/LICENSE */
8215
+ /*! @license DOMPurify 3.1.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.5/LICENSE */
8216
8216
  const {
8217
8217
  entries,
8218
8218
  setPrototypeOf,
@@ -8348,7 +8348,7 @@ const svgDisallowed = freeze(["animate", "color-profile", "cursor", "discard", "
8348
8348
  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"]);
8349
8349
  const mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]);
8350
8350
  const text = freeze(["#text"]);
8351
- const html = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "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", "pattern", "placeholder", "playsinline", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]);
8351
+ const html = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "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", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]);
8352
8352
  const svg = freeze(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "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", "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", "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", "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", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]);
8353
8353
  const mathMl = freeze(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]);
8354
8354
  const xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]);
@@ -8381,6 +8381,23 @@ var EXPRESSIONS = /* @__PURE__ */ Object.freeze({
8381
8381
  DOCTYPE_NAME,
8382
8382
  CUSTOM_ELEMENT
8383
8383
  });
8384
+ const NODE_TYPE = {
8385
+ element: 1,
8386
+ attribute: 2,
8387
+ text: 3,
8388
+ cdataSection: 4,
8389
+ entityReference: 5,
8390
+ // Deprecated
8391
+ entityNode: 6,
8392
+ // Deprecated
8393
+ progressingInstruction: 7,
8394
+ comment: 8,
8395
+ document: 9,
8396
+ documentType: 10,
8397
+ documentFragment: 11,
8398
+ notation: 12
8399
+ // Deprecated
8400
+ };
8384
8401
  const getGlobal = function getGlobal2() {
8385
8402
  return typeof window === "undefined" ? null : window;
8386
8403
  };
@@ -8411,9 +8428,9 @@ const _createTrustedTypesPolicy = function _createTrustedTypesPolicy2(trustedTyp
8411
8428
  function createDOMPurify() {
8412
8429
  let window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
8413
8430
  const DOMPurify = (root) => createDOMPurify(root);
8414
- DOMPurify.version = "3.1.2";
8431
+ DOMPurify.version = "3.1.5";
8415
8432
  DOMPurify.removed = [];
8416
- if (!window2 || !window2.document || window2.document.nodeType !== 9) {
8433
+ if (!window2 || !window2.document || window2.document.nodeType !== NODE_TYPE.document) {
8417
8434
  DOMPurify.isSupported = false;
8418
8435
  return DOMPurify;
8419
8436
  }
@@ -8532,7 +8549,6 @@ function createDOMPurify() {
8532
8549
  const DEFAULT_PARSER_MEDIA_TYPE = "text/html";
8533
8550
  let transformCaseFunc = null;
8534
8551
  let CONFIG = null;
8535
- const MAX_NESTING_DEPTH = 255;
8536
8552
  const formElement = document2.createElement("form");
8537
8553
  const isRegexOrFunction = function isRegexOrFunction2(testValue) {
8538
8554
  return testValue instanceof RegExp || testValue instanceof Function;
@@ -8813,9 +8829,7 @@ function createDOMPurify() {
8813
8829
  );
8814
8830
  };
8815
8831
  const _isClobbered = function _isClobbered2(elm) {
8816
- return elm instanceof HTMLFormElement && // eslint-disable-next-line unicorn/no-typeof-undefined
8817
- (typeof elm.__depth !== "undefined" && typeof elm.__depth !== "number" || // eslint-disable-next-line unicorn/no-typeof-undefined
8818
- typeof elm.__removalCount !== "undefined" && typeof elm.__removalCount !== "number" || typeof elm.nodeName !== "string" || typeof elm.textContent !== "string" || typeof elm.removeChild !== "function" || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== "function" || typeof elm.setAttribute !== "function" || typeof elm.namespaceURI !== "string" || typeof elm.insertBefore !== "function" || typeof elm.hasChildNodes !== "function");
8832
+ return elm instanceof HTMLFormElement && (typeof elm.nodeName !== "string" || typeof elm.textContent !== "string" || typeof elm.removeChild !== "function" || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== "function" || typeof elm.setAttribute !== "function" || typeof elm.namespaceURI !== "string" || typeof elm.insertBefore !== "function" || typeof elm.hasChildNodes !== "function");
8819
8833
  };
8820
8834
  const _isNode = function _isNode2(object) {
8821
8835
  return typeof Node === "function" && object instanceof Node;
@@ -8844,11 +8858,11 @@ function createDOMPurify() {
8844
8858
  _forceRemove(currentNode);
8845
8859
  return true;
8846
8860
  }
8847
- if (currentNode.nodeType === 7) {
8861
+ if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
8848
8862
  _forceRemove(currentNode);
8849
8863
  return true;
8850
8864
  }
8851
- if (SAFE_FOR_XML && currentNode.nodeType === 8 && regExpTest(/<[/\w]/g, currentNode.data)) {
8865
+ if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
8852
8866
  _forceRemove(currentNode);
8853
8867
  return true;
8854
8868
  }
@@ -8884,7 +8898,7 @@ function createDOMPurify() {
8884
8898
  _forceRemove(currentNode);
8885
8899
  return true;
8886
8900
  }
8887
- if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {
8901
+ if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
8888
8902
  content = currentNode.textContent;
8889
8903
  arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => {
8890
8904
  content = stringReplace(content, expr, " ");
@@ -8978,6 +8992,10 @@ function createDOMPurify() {
8978
8992
  _removeAttribute(name, currentNode);
8979
8993
  continue;
8980
8994
  }
8995
+ if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
8996
+ _removeAttribute(name, currentNode);
8997
+ continue;
8998
+ }
8981
8999
  if (SAFE_FOR_TEMPLATES) {
8982
9000
  arrayForEach([MUSTACHE_EXPR2, ERB_EXPR2, TMPLIT_EXPR2], (expr) => {
8983
9001
  value = stringReplace(value, expr, " ");
@@ -9013,7 +9031,11 @@ function createDOMPurify() {
9013
9031
  } else {
9014
9032
  currentNode.setAttribute(name, value);
9015
9033
  }
9016
- arrayPop(DOMPurify.removed);
9034
+ if (_isClobbered(currentNode)) {
9035
+ _forceRemove(currentNode);
9036
+ } else {
9037
+ arrayPop(DOMPurify.removed);
9038
+ }
9017
9039
  } catch (_) {
9018
9040
  }
9019
9041
  }
@@ -9028,19 +9050,7 @@ function createDOMPurify() {
9028
9050
  if (_sanitizeElements(shadowNode)) {
9029
9051
  continue;
9030
9052
  }
9031
- const parentNode = getParentNode(shadowNode);
9032
- if (shadowNode.nodeType === 1) {
9033
- if (parentNode && parentNode.__depth) {
9034
- shadowNode.__depth = (shadowNode.__removalCount || 0) + parentNode.__depth + 1;
9035
- } else {
9036
- shadowNode.__depth = 1;
9037
- }
9038
- }
9039
- if (shadowNode.__depth >= MAX_NESTING_DEPTH) {
9040
- _forceRemove(shadowNode);
9041
- }
9042
9053
  if (shadowNode.content instanceof DocumentFragment) {
9043
- shadowNode.content.__depth = shadowNode.__depth;
9044
9054
  _sanitizeShadowDOM2(shadowNode.content);
9045
9055
  }
9046
9056
  _sanitizeAttributes(shadowNode);
@@ -9087,7 +9097,7 @@ function createDOMPurify() {
9087
9097
  } else if (dirty instanceof Node) {
9088
9098
  body = _initDocument("<!---->");
9089
9099
  importedNode = body.ownerDocument.importNode(dirty, true);
9090
- if (importedNode.nodeType === 1 && importedNode.nodeName === "BODY") {
9100
+ if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") {
9091
9101
  body = importedNode;
9092
9102
  } else if (importedNode.nodeName === "HTML") {
9093
9103
  body = importedNode;
@@ -9112,19 +9122,7 @@ function createDOMPurify() {
9112
9122
  if (_sanitizeElements(currentNode)) {
9113
9123
  continue;
9114
9124
  }
9115
- const parentNode = getParentNode(currentNode);
9116
- if (currentNode.nodeType === 1) {
9117
- if (parentNode && parentNode.__depth) {
9118
- currentNode.__depth = (currentNode.__removalCount || 0) + parentNode.__depth + 1;
9119
- } else {
9120
- currentNode.__depth = 1;
9121
- }
9122
- }
9123
- if (currentNode.__depth >= MAX_NESTING_DEPTH) {
9124
- _forceRemove(currentNode);
9125
- }
9126
9125
  if (currentNode.content instanceof DocumentFragment) {
9127
- currentNode.content.__depth = currentNode.__depth;
9128
9126
  _sanitizeShadowDOM(currentNode.content);
9129
9127
  }
9130
9128
  _sanitizeAttributes(currentNode);