@pie-element/venn-classification 0.1.2 → 0.1.3-next.20261007021359
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/author/index.js +3003 -343
- package/dist/author/index.js.map +1 -1
- package/dist/browser/VennClassification-CabX77pV.js +5298 -0
- package/dist/browser/VennClassification-CabX77pV.js.map +1 -0
- package/dist/browser/author/index.js +503 -503
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/delivery/index.js +1 -1
- package/dist/browser/editor-runtime/VennClassification-CabX77pV.js +5298 -0
- package/dist/browser/editor-runtime/VennClassification-CabX77pV.js.map +1 -0
- package/dist/browser/editor-runtime/author/index.js +515 -515
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/delivery/index.js +1 -1
- package/dist/browser/editor-runtime/{mathjax-D2JHb_R_-CnSar24F.js → mathjax-BKrHE4xs-DKFuLcoG.js} +3901 -3864
- package/dist/browser/editor-runtime/mathjax-BKrHE4xs-DKFuLcoG.js.map +1 -0
- package/dist/browser/{mathjax-D2JHb_R_-CnSar24F.js → mathjax-BKrHE4xs-DKFuLcoG.js} +3901 -3864
- package/dist/browser/mathjax-BKrHE4xs-DKFuLcoG.js.map +1 -0
- package/dist/delivery/index.js +2945 -285
- package/dist/delivery/index.js.map +1 -1
- package/dist/index.iife.js +23 -21
- package/package.json +4 -3
- package/dist/browser/VennClassification-DklXKmLP.js +0 -4241
- package/dist/browser/VennClassification-DklXKmLP.js.map +0 -1
- package/dist/browser/editor-runtime/VennClassification-DklXKmLP.js +0 -4241
- package/dist/browser/editor-runtime/VennClassification-DklXKmLP.js.map +0 -1
- package/dist/browser/editor-runtime/mathjax-D2JHb_R_-CnSar24F.js.map +0 -1
- package/dist/browser/mathjax-D2JHb_R_-CnSar24F.js.map +0 -1
package/dist/author/index.js
CHANGED
|
@@ -4500,7 +4500,7 @@ function link(state, prev, next) {
|
|
|
4500
4500
|
* @param {boolean} [skip_warning]
|
|
4501
4501
|
* @returns {void}
|
|
4502
4502
|
*/
|
|
4503
|
-
function html(node, get_value, is_controlled = false, svg = false, mathml = false, skip_warning = false) {
|
|
4503
|
+
function html$2(node, get_value, is_controlled = false, svg = false, mathml = false, skip_warning = false) {
|
|
4504
4504
|
var anchor = node;
|
|
4505
4505
|
/** @type {string | TrustedHTML} */
|
|
4506
4506
|
var value = "";
|
|
@@ -5599,38 +5599,38 @@ function d$1(e, t, n) {
|
|
|
5599
5599
|
[r]: s
|
|
5600
5600
|
};
|
|
5601
5601
|
}
|
|
5602
|
-
var f$
|
|
5603
|
-
var p$
|
|
5604
|
-
var m$
|
|
5605
|
-
var h$
|
|
5606
|
-
var g$
|
|
5607
|
-
var _$
|
|
5602
|
+
var f$2 = /* @__PURE__ */ from_html("<label class=\"pie-settings-toggle svelte-1ang3sw\"><span> </span> <input type=\"checkbox\" role=\"switch\" class=\"svelte-1ang3sw\"/></label>");
|
|
5603
|
+
var p$2 = /* @__PURE__ */ from_html("<label class=\"pie-settings-choice-row svelte-1ang3sw\"><input type=\"radio\" class=\"svelte-1ang3sw\"/> <span> </span></label>");
|
|
5604
|
+
var m$2 = /* @__PURE__ */ from_html("<fieldset class=\"pie-settings-choice svelte-1ang3sw\"><legend class=\"svelte-1ang3sw\"> </legend> <!></fieldset>");
|
|
5605
|
+
var h$3 = /* @__PURE__ */ from_html("<fieldset class=\"pie-settings-group svelte-1ang3sw\"><legend class=\"pie-settings-group-name svelte-1ang3sw\"> </legend> <!></fieldset>");
|
|
5606
|
+
var g$2 = /* @__PURE__ */ from_html("<div class=\"pie-settings-panel svelte-1ang3sw\"></div>");
|
|
5607
|
+
var _$2 = {
|
|
5608
5608
|
hash: "svelte-1ang3sw",
|
|
5609
5609
|
code: ".pie-settings-panel.svelte-1ang3sw {display:flex;flex-direction:column;gap:16px;padding:16px;border:1px solid var(--pie-border-light, #ccc);border-radius:4px;color:var(--pie-text, #212121);}fieldset.svelte-1ang3sw {margin:0;padding:0;border:0;min-width:0;}.pie-settings-group.svelte-1ang3sw {display:flex;flex-direction:column;gap:8px;}.pie-settings-group-name.svelte-1ang3sw {margin-bottom:8px;font-weight:600;}.pie-settings-toggle.svelte-1ang3sw {display:flex;align-items:center;justify-content:space-between;gap:12px;}.pie-settings-choice.svelte-1ang3sw legend:where(.svelte-1ang3sw) {margin-bottom:4px;}.pie-settings-choice-row.svelte-1ang3sw {display:flex;align-items:center;gap:8px;}input.svelte-1ang3sw {accent-color:var(--pie-primary, #3f51b5);}input.svelte-1ang3sw:focus-visible {outline:2px solid var(--pie-focus-outline, #1a73e8);outline-offset:2px;}"
|
|
5610
5610
|
};
|
|
5611
|
-
function v$
|
|
5612
|
-
push(n, !0), append_styles$1(t, _$
|
|
5611
|
+
function v$2(t, n) {
|
|
5612
|
+
push(n, !0), append_styles$1(t, _$2);
|
|
5613
5613
|
let r = prop(n, "configuration", 19, () => ({})), i = Math.random().toString(36).slice(2, 10), a = /* @__PURE__ */ user_derived(() => Object.entries(n.groups).map(([e, t]) => [e, Object.entries(t).filter((e) => !!e[1])]).filter(([, e]) => e.length > 0)), o = (e, t) => u$1(t.isConfigProperty ? r() : n.model, e);
|
|
5614
5614
|
function s(e, t, i) {
|
|
5615
5615
|
t.isConfigProperty ? n.onChangeConfiguration?.(d$1(r(), e, i), e) : n.onChangeModel(d$1(n.model, e, i), e);
|
|
5616
5616
|
}
|
|
5617
|
-
var c = g$
|
|
5617
|
+
var c = g$2();
|
|
5618
5618
|
each(c, 21, () => get$1(a), ([e, t]) => e, (t, n) => {
|
|
5619
5619
|
var r = /* @__PURE__ */ user_derived(() => to_array(get$1(n), 2));
|
|
5620
5620
|
let a = () => get$1(r)[0], c = () => get$1(r)[1];
|
|
5621
|
-
var l = h$
|
|
5621
|
+
var l = h$3(), u = child(l), d = only_child(u, !0);
|
|
5622
5622
|
each(sibling(u, 2), 17, c, ([e, t]) => e, (t, n) => {
|
|
5623
5623
|
var r = /* @__PURE__ */ user_derived(() => to_array(get$1(n), 2));
|
|
5624
5624
|
let a = () => get$1(r)[0], c = () => get$1(r)[1];
|
|
5625
5625
|
var l = comment(), u = first_child(l), d = (t) => {
|
|
5626
|
-
var n = f$
|
|
5626
|
+
var n = f$2(), r = child(n), i = only_child(r, !0), l = sibling(r, 2);
|
|
5627
5627
|
remove_input_defaults(l), reset$1(n), template_effect((t) => {
|
|
5628
5628
|
set_text(i, c().label), set_checked(l, t), l.disabled = c().disabled;
|
|
5629
5629
|
}, [() => !!o(a(), c())]), delegated("change", l, (e) => s(a(), c(), e.currentTarget.checked)), append(t, n);
|
|
5630
5630
|
}, h = (t) => {
|
|
5631
|
-
var n = m$
|
|
5631
|
+
var n = m$2(), r = child(n), l = only_child(r, !0);
|
|
5632
5632
|
each(sibling(r, 2), 17, () => c().choices, (e) => e.value, (t, n) => {
|
|
5633
|
-
var r = p$
|
|
5633
|
+
var r = p$2(), l = child(r);
|
|
5634
5634
|
remove_input_defaults(l);
|
|
5635
5635
|
var d = only_child(sibling(l, 2), !0);
|
|
5636
5636
|
reset$1(r), template_effect((t) => {
|
|
@@ -5645,8 +5645,8 @@ function v$1(t, n) {
|
|
|
5645
5645
|
}), reset$1(c), append(t, c), pop();
|
|
5646
5646
|
}
|
|
5647
5647
|
delegate(["change"]);
|
|
5648
|
-
var y$
|
|
5649
|
-
var b$
|
|
5648
|
+
var y$2 = i$2;
|
|
5649
|
+
var b$2 = v$2;
|
|
5650
5650
|
//#endregion
|
|
5651
5651
|
//#region ../../lib-svelte/editable-html-tiptap-svelte/dist/index2.js
|
|
5652
5652
|
/**
|
|
@@ -14249,7 +14249,7 @@ function moveSelectionBlock(state, dir) {
|
|
|
14249
14249
|
let $start = !$side.parent.inlineContent ? $side : $side.depth ? state.doc.resolve(dir > 0 ? $side.after() : $side.before()) : null;
|
|
14250
14250
|
return $start && Selection$1.findFrom($start, dir);
|
|
14251
14251
|
}
|
|
14252
|
-
function apply(view, sel) {
|
|
14252
|
+
function apply$1(view, sel) {
|
|
14253
14253
|
view.dispatch(view.state.tr.setSelection(sel).scrollIntoView());
|
|
14254
14254
|
return true;
|
|
14255
14255
|
}
|
|
@@ -14260,24 +14260,24 @@ function selectHorizontally(view, dir, mods) {
|
|
|
14260
14260
|
let { $head } = sel, node = $head.textOffset ? null : dir < 0 ? $head.nodeBefore : $head.nodeAfter;
|
|
14261
14261
|
if (!node || node.isText || !node.isLeaf) return false;
|
|
14262
14262
|
let $newHead = view.state.doc.resolve($head.pos + node.nodeSize * (dir < 0 ? -1 : 1));
|
|
14263
|
-
return apply(view, new TextSelection(sel.$anchor, $newHead));
|
|
14263
|
+
return apply$1(view, new TextSelection(sel.$anchor, $newHead));
|
|
14264
14264
|
} else if (!sel.empty) return false;
|
|
14265
14265
|
else if (view.endOfTextblock(dir > 0 ? "forward" : "backward")) {
|
|
14266
14266
|
let next = moveSelectionBlock(view.state, dir);
|
|
14267
|
-
if (next && next instanceof NodeSelection) return apply(view, next);
|
|
14267
|
+
if (next && next instanceof NodeSelection) return apply$1(view, next);
|
|
14268
14268
|
return false;
|
|
14269
14269
|
} else if (!(mac$2 && mods.indexOf("m") > -1)) {
|
|
14270
14270
|
let $head = sel.$head, node = $head.textOffset ? null : dir < 0 ? $head.nodeBefore : $head.nodeAfter, desc;
|
|
14271
14271
|
if (!node || node.isText) return false;
|
|
14272
14272
|
let nodePos = dir < 0 ? $head.pos - node.nodeSize : $head.pos;
|
|
14273
14273
|
if (!(node.isAtom || (desc = view.docView.descAt(nodePos)) && !desc.contentDOM)) return false;
|
|
14274
|
-
if (NodeSelection.isSelectable(node)) return apply(view, new NodeSelection(dir < 0 ? view.state.doc.resolve($head.pos - node.nodeSize) : $head));
|
|
14275
|
-
else return apply(view, new TextSelection(view.state.doc.resolve(dir < 0 ? nodePos : nodePos + node.nodeSize)));
|
|
14274
|
+
if (NodeSelection.isSelectable(node)) return apply$1(view, new NodeSelection(dir < 0 ? view.state.doc.resolve($head.pos - node.nodeSize) : $head));
|
|
14275
|
+
else return apply$1(view, new TextSelection(view.state.doc.resolve(dir < 0 ? nodePos : nodePos + node.nodeSize)));
|
|
14276
14276
|
}
|
|
14277
|
-
} else if (sel instanceof NodeSelection && sel.node.isInline) return apply(view, new TextSelection(dir > 0 ? sel.$to : sel.$from));
|
|
14277
|
+
} else if (sel instanceof NodeSelection && sel.node.isInline) return apply$1(view, new TextSelection(dir > 0 ? sel.$to : sel.$from));
|
|
14278
14278
|
else {
|
|
14279
14279
|
let next = moveSelectionBlock(view.state, dir);
|
|
14280
|
-
if (next) return apply(view, next);
|
|
14280
|
+
if (next) return apply$1(view, next);
|
|
14281
14281
|
return false;
|
|
14282
14282
|
}
|
|
14283
14283
|
}
|
|
@@ -14437,12 +14437,12 @@ function selectVertically(view, dir, mods) {
|
|
|
14437
14437
|
let { $from, $to } = sel;
|
|
14438
14438
|
if (!$from.parent.inlineContent || view.endOfTextblock(dir < 0 ? "up" : "down")) {
|
|
14439
14439
|
let next = moveSelectionBlock(view.state, dir);
|
|
14440
|
-
if (next && next instanceof NodeSelection) return apply(view, next);
|
|
14440
|
+
if (next && next instanceof NodeSelection) return apply$1(view, next);
|
|
14441
14441
|
}
|
|
14442
14442
|
if (!$from.parent.inlineContent) {
|
|
14443
14443
|
let side = dir < 0 ? $from : $to;
|
|
14444
14444
|
let beyond = sel instanceof AllSelection ? Selection$1.near(side, dir) : Selection$1.findFrom(side, dir);
|
|
14445
|
-
return beyond ? apply(view, beyond) : false;
|
|
14445
|
+
return beyond ? apply$1(view, beyond) : false;
|
|
14446
14446
|
}
|
|
14447
14447
|
return false;
|
|
14448
14448
|
}
|
|
@@ -26769,7 +26769,7 @@ function render(tag, attributes) {
|
|
|
26769
26769
|
]);
|
|
26770
26770
|
return createJSXElement([tag, rest]);
|
|
26771
26771
|
}
|
|
26772
|
-
var h$
|
|
26772
|
+
var h$2 = (tag, attributes) => render(tag, attributes);
|
|
26773
26773
|
//#endregion
|
|
26774
26774
|
//#region ../../../node_modules/.bun/@tiptap+extension-blockquote@3.31.4+e39601fe346c19ab/node_modules/@tiptap/extension-blockquote/dist/index.js
|
|
26775
26775
|
/**
|
|
@@ -26834,9 +26834,9 @@ var Blockquote = Node$1.create({
|
|
|
26834
26834
|
return [{ tag: "blockquote" }];
|
|
26835
26835
|
},
|
|
26836
26836
|
renderHTML({ HTMLAttributes }) {
|
|
26837
|
-
return /* @__PURE__ */ h$
|
|
26837
|
+
return /* @__PURE__ */ h$2("blockquote", {
|
|
26838
26838
|
...mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
|
|
26839
|
-
children: /* @__PURE__ */ h$
|
|
26839
|
+
children: /* @__PURE__ */ h$2("slot", {})
|
|
26840
26840
|
});
|
|
26841
26841
|
},
|
|
26842
26842
|
parseMarkdown: (token, helpers) => {
|
|
@@ -26930,9 +26930,9 @@ var Bold = Mark.create({
|
|
|
26930
26930
|
];
|
|
26931
26931
|
},
|
|
26932
26932
|
renderHTML({ HTMLAttributes }) {
|
|
26933
|
-
return /* @__PURE__ */ h$
|
|
26933
|
+
return /* @__PURE__ */ h$2("strong", {
|
|
26934
26934
|
...mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
|
|
26935
|
-
children: /* @__PURE__ */ h$
|
|
26935
|
+
children: /* @__PURE__ */ h$2("slot", {})
|
|
26936
26936
|
});
|
|
26937
26937
|
},
|
|
26938
26938
|
markdownTokenName: "strong",
|
|
@@ -33137,7 +33137,7 @@ function EditableHtml$1($$anchor, $$props) {
|
|
|
33137
33137
|
var node_1 = child(div_6);
|
|
33138
33138
|
var consequent = ($$anchor) => {
|
|
33139
33139
|
var button = root$6();
|
|
33140
|
-
html(button, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M10 10.02h5V21h-5zM17 21h3c1.1 0 2-.9 2-2v-9h-5v11zm3-18H5c-1.1 0-2 .9-2 2v3h19V5c0-1.1-.9-2-2-2zM3 19c0 1.1.9 2 2 2h3V10.02H3V19z\"/></svg>", true);
|
|
33140
|
+
html$2(button, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M10 10.02h5V21h-5zM17 21h3c1.1 0 2-.9 2-2v-9h-5v11zm3-18H5c-1.1 0-2 .9-2 2v3h19V5c0-1.1-.9-2-2-2zM3 19c0 1.1.9 2 2 2h3V10.02H3V19z\"/></svg>", true);
|
|
33141
33141
|
reset$1(button);
|
|
33142
33142
|
template_effect(() => button.disabled = !get$1(editorState).canTable);
|
|
33143
33143
|
delegated("click", button, insertTable);
|
|
@@ -33151,27 +33151,27 @@ function EditableHtml$1($$anchor, $$props) {
|
|
|
33151
33151
|
var fragment = root_1$4();
|
|
33152
33152
|
var button_1 = first_child(fragment);
|
|
33153
33153
|
let classes_2;
|
|
33154
|
-
html(button_1, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M22,10A2,2 0 0,1 20,12H4A2,2 0 0,1 2,10V3H4V5H8V3H10V5H14V3H16V5H20V3H22V10M4,10H8V7H4V10M10,10H14V7H10V10M20,10V7H16V10H20M11,14H13V17H16V19H13V22H11V19H8V17H11V14Z\"/></svg>", true);
|
|
33154
|
+
html$2(button_1, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M22,10A2,2 0 0,1 20,12H4A2,2 0 0,1 2,10V3H4V5H8V3H10V5H14V3H16V5H20V3H22V10M4,10H8V7H4V10M10,10H14V7H10V10M20,10V7H16V10H20M11,14H13V17H16V19H13V22H11V19H8V17H11V14Z\"/></svg>", true);
|
|
33155
33155
|
reset$1(button_1);
|
|
33156
33156
|
var button_2 = sibling(button_1, 2);
|
|
33157
33157
|
let classes_3;
|
|
33158
|
-
html(button_2, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M9.41,13L12,15.59L14.59,13L16,14.41L13.41,17L16,19.59L14.59,21L12,18.41L9.41,21L8,19.59L10.59,17L8,14.41L9.41,13M22,9A2,2 0 0,1 20,11H4A2,2 0 0,1 2,9V6A2,2 0 0,1 4,4H20A2,2 0 0,1 22,6V9M4,9H8V6H4V9M10,9H14V6H10V9M16,9H20V6H16V9Z\"/></svg>", true);
|
|
33158
|
+
html$2(button_2, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M9.41,13L12,15.59L14.59,13L16,14.41L13.41,17L16,19.59L14.59,21L12,18.41L9.41,21L8,19.59L10.59,17L8,14.41L9.41,13M22,9A2,2 0 0,1 20,11H4A2,2 0 0,1 2,9V6A2,2 0 0,1 4,4H20A2,2 0 0,1 22,6V9M4,9H8V6H4V9M10,9H14V6H10V9M16,9H20V6H16V9Z\"/></svg>", true);
|
|
33159
33159
|
reset$1(button_2);
|
|
33160
33160
|
var button_3 = sibling(button_2, 2);
|
|
33161
33161
|
let classes_4;
|
|
33162
|
-
html(button_3, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M11,2A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H2V2H11M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M15,11H18V8H20V11H23V13H20V16H18V13H15V11Z\"/></svg>", true);
|
|
33162
|
+
html$2(button_3, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M11,2A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H2V2H11M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M15,11H18V8H20V11H23V13H20V16H18V13H15V11Z\"/></svg>", true);
|
|
33163
33163
|
reset$1(button_3);
|
|
33164
33164
|
var button_4 = sibling(button_3, 2);
|
|
33165
33165
|
let classes_5;
|
|
33166
|
-
html(button_4, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M4,2H11A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H4A2,2 0 0,1 2,20V4A2,2 0 0,1 4,2M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M17.59,12L15,9.41L16.41,8L19,10.59L21.59,8L23,9.41L20.41,12L23,14.59L21.59,16L19,13.41L16.41,16L15,14.59L17.59,12Z\"/></svg>", true);
|
|
33166
|
+
html$2(button_4, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M4,2H11A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H4A2,2 0 0,1 2,20V4A2,2 0 0,1 4,2M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M17.59,12L15,9.41L16.41,8L19,10.59L21.59,8L23,9.41L20.41,12L23,14.59L21.59,16L19,13.41L16.41,16L15,14.59L17.59,12Z\"/></svg>", true);
|
|
33167
33167
|
reset$1(button_4);
|
|
33168
33168
|
var button_5 = sibling(button_4, 2);
|
|
33169
33169
|
let classes_6;
|
|
33170
|
-
html(button_5, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M15.46,15.88L16.88,14.46L19,16.59L21.12,14.46L22.54,15.88L20.41,18L22.54,20.12L21.12,21.54L19,19.41L16.88,21.54L15.46,20.12L17.59,18L15.46,15.88M4,3H18A2,2 0 0,1 20,5V12.08C18.45,11.82 16.92,12.18 15.68,13H12V17H13.08C12.97,17.68 12.97,18.35 13.08,19H4A2,2 0 0,1 2,17V5A2,2 0 0,1 4,3M4,7V11H10V7H4M12,7V11H18V7H12M4,13V17H10V13H4Z\"/></svg>", true);
|
|
33170
|
+
html$2(button_5, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M15.46,15.88L16.88,14.46L19,16.59L21.12,14.46L22.54,15.88L20.41,18L22.54,20.12L21.12,21.54L19,19.41L16.88,21.54L15.46,20.12L17.59,18L15.46,15.88M4,3H18A2,2 0 0,1 20,5V12.08C18.45,11.82 16.92,12.18 15.68,13H12V17H13.08C12.97,17.68 12.97,18.35 13.08,19H4A2,2 0 0,1 2,17V5A2,2 0 0,1 4,3M4,7V11H10V7H4M12,7V11H18V7H12M4,13V17H10V13H4Z\"/></svg>", true);
|
|
33171
33171
|
reset$1(button_5);
|
|
33172
33172
|
var button_6 = sibling(button_5, 2);
|
|
33173
33173
|
let classes_7;
|
|
33174
|
-
html(button_6, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M3 3v18h18V3H3zm8 16H5v-6h6v6zm0-8H5V5h6v6zm8 8h-6v-6h6v6zm0-8h-6V5h6v6z\"/></svg>", true);
|
|
33174
|
+
html$2(button_6, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M3 3v18h18V3H3zm8 16H5v-6h6v6zm0-8H5V5h6v6zm8 8h-6v-6h6v6zm0-8h-6V5h6v6z\"/></svg>", true);
|
|
33175
33175
|
reset$1(button_6);
|
|
33176
33176
|
template_effect(() => {
|
|
33177
33177
|
classes_2 = set_class(button_1, 1, "pie-toolbar-btn", null, classes_2, { active: get$1(editorState).isTable });
|
|
@@ -33203,55 +33203,55 @@ function EditableHtml$1($$anchor, $$props) {
|
|
|
33203
33203
|
var fragment_1 = root_3$3();
|
|
33204
33204
|
var button_7 = first_child(fragment_1);
|
|
33205
33205
|
let classes_8;
|
|
33206
|
-
html(button_7, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z\"/></svg>", true);
|
|
33206
|
+
html$2(button_7, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z\"/></svg>", true);
|
|
33207
33207
|
reset$1(button_7);
|
|
33208
33208
|
var button_8 = sibling(button_7, 2);
|
|
33209
33209
|
let classes_9;
|
|
33210
|
-
html(button_8, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z\"/></svg>", true);
|
|
33210
|
+
html$2(button_8, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z\"/></svg>", true);
|
|
33211
33211
|
reset$1(button_8);
|
|
33212
33212
|
var button_9 = sibling(button_8, 2);
|
|
33213
33213
|
let classes_10;
|
|
33214
|
-
html(button_9, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z\"/></svg>", true);
|
|
33214
|
+
html$2(button_9, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z\"/></svg>", true);
|
|
33215
33215
|
reset$1(button_9);
|
|
33216
33216
|
var button_10 = sibling(button_9, 2);
|
|
33217
33217
|
let classes_11;
|
|
33218
|
-
html(button_10, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z\"/></svg>", true);
|
|
33218
|
+
html$2(button_10, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z\"/></svg>", true);
|
|
33219
33219
|
reset$1(button_10);
|
|
33220
33220
|
var button_11 = sibling(button_10, 2);
|
|
33221
33221
|
let classes_12;
|
|
33222
|
-
html(button_11, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z\"/></svg>", true);
|
|
33222
|
+
html$2(button_11, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z\"/></svg>", true);
|
|
33223
33223
|
reset$1(button_11);
|
|
33224
33224
|
var button_12 = sibling(button_11, 2);
|
|
33225
33225
|
let classes_13;
|
|
33226
|
-
html(button_12, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M22,18h-2v1h3v1h-4v-2c0-0.55,0.45-1,1-1h2v-1h-3v-1h3c0.55,0,1,0.45,1,1v1C23,17.55,22.55,18,22,18z M5.88,18h2.66 l3.4-5.42h0.12l3.4,5.42h2.66l-4.65-7.27L17.81,4h-2.68l-3.07,4.99h-0.12L8.85,4H6.19l4.32,6.73L5.88,18z\"/></svg>", true);
|
|
33226
|
+
html$2(button_12, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M22,18h-2v1h3v1h-4v-2c0-0.55,0.45-1,1-1h2v-1h-3v-1h3c0.55,0,1,0.45,1,1v1C23,17.55,22.55,18,22,18z M5.88,18h2.66 l3.4-5.42h0.12l3.4,5.42h2.66l-4.65-7.27L17.81,4h-2.68l-3.07,4.99h-0.12L8.85,4H6.19l4.32,6.73L5.88,18z\"/></svg>", true);
|
|
33227
33227
|
reset$1(button_12);
|
|
33228
33228
|
var button_13 = sibling(button_12, 2);
|
|
33229
33229
|
let classes_14;
|
|
33230
|
-
html(button_13, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M22,7h-2v1h3v1h-4V7c0-0.55,0.45-1,1-1h2V5h-3V4h3c0.55,0,1,0.45,1,1v1C23,6.55,22.55,7,22,7z M5.88,20h2.66l3.4-5.42h0.12 l3.4,5.42h2.66l-4.65-7.27L17.81,6h-2.68l-3.07,4.99h-0.12L8.85,6H6.19l4.32,6.73L5.88,20z\"/></svg>", true);
|
|
33230
|
+
html$2(button_13, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M22,7h-2v1h3v1h-4V7c0-0.55,0.45-1,1-1h2V5h-3V4h3c0.55,0,1,0.45,1,1v1C23,6.55,22.55,7,22,7z M5.88,20h2.66l3.4-5.42h0.12 l3.4,5.42h2.66l-4.65-7.27L17.81,6h-2.68l-3.07,4.99h-0.12L8.85,6H6.19l4.32,6.73L5.88,20z\"/></svg>", true);
|
|
33231
33231
|
reset$1(button_13);
|
|
33232
33232
|
var button_14 = sibling(button_13, 2);
|
|
33233
33233
|
let classes_15;
|
|
33234
|
-
html(button_14, () => "<svg width=\"20\" height=\"18\" viewBox=\"0 0 30 28\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M27 4V24H29C29.5 24 30 24.5 30 25V27C30 27.5625 29.5 28 29 28H19C18.4375 28 18 27.5625 18 27V25C18 24.5 18.4375 24 19 24H21V16H9V24H11C11.5 24 12 24.5 12 25V27C12 27.5625 11.5 28 11 28H1C0.4375 28 0 27.5625 0 27V25C0 24.5 0.4375 24 1 24H3V4H1C0.4375 4 0 3.5625 0 3V1C0 0.5 0.4375 0 1 0H11C11.5 0 12 0.5 12 1V3C12 3.5625 11.5 4 11 4H9V12H21V4H19C18.4375 4 18 3.5625 18 3V1C18 0.5 18.4375 0 19 0H29C29.5 0 30 0.5 30 1V3C30 3.5625 29.5 4 29 4H27Z\"/></svg>", true);
|
|
33234
|
+
html$2(button_14, () => "<svg width=\"20\" height=\"18\" viewBox=\"0 0 30 28\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M27 4V24H29C29.5 24 30 24.5 30 25V27C30 27.5625 29.5 28 29 28H19C18.4375 28 18 27.5625 18 27V25C18 24.5 18.4375 24 19 24H21V16H9V24H11C11.5 24 12 24.5 12 25V27C12 27.5625 11.5 28 11 28H1C0.4375 28 0 27.5625 0 27V25C0 24.5 0.4375 24 1 24H3V4H1C0.4375 4 0 3.5625 0 3V1C0 0.5 0.4375 0 1 0H11C11.5 0 12 0.5 12 1V3C12 3.5625 11.5 4 11 4H9V12H21V4H19C18.4375 4 18 3.5625 18 3V1C18 0.5 18.4375 0 19 0H29C29.5 0 30 0.5 30 1V3C30 3.5625 29.5 4 29 4H27Z\"/></svg>", true);
|
|
33235
33235
|
reset$1(button_14);
|
|
33236
33236
|
var button_15 = sibling(button_14, 2);
|
|
33237
|
-
html(button_15, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z\"/></svg>", true);
|
|
33237
|
+
html$2(button_15, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z\"/></svg>", true);
|
|
33238
33238
|
reset$1(button_15);
|
|
33239
33239
|
var div_7 = sibling(button_15, 2);
|
|
33240
33240
|
var button_16 = child(div_7);
|
|
33241
33241
|
var node_4 = child(button_16);
|
|
33242
33242
|
var consequent_2 = ($$anchor) => {
|
|
33243
33243
|
var fragment_2 = comment();
|
|
33244
|
-
html(first_child(fragment_2), () => "<svg width=\"20\" height=\"20\" viewBox=\"0 0 66 66\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M65.625 4.75C65.625 7.38672 63.4277 9.4375 60.9375 9.4375H28.125C25.4883 9.4375 23.4375 7.38672 23.4375 4.75C23.4375 2.25977 25.4883 0.0625 28.125 0.0625H60.9375C63.4277 0.0625 65.625 2.25977 65.625 4.75ZM65.625 42.25C65.625 44.8867 63.4277 46.9375 60.9375 46.9375H28.125C25.4883 46.9375 23.4375 44.8867 23.4375 42.25C23.4375 39.7598 25.4883 37.5625 28.125 37.5625H60.9375C63.4277 37.5625 65.625 39.7598 65.625 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z\"/></svg>");
|
|
33244
|
+
html$2(first_child(fragment_2), () => "<svg width=\"20\" height=\"20\" viewBox=\"0 0 66 66\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M65.625 4.75C65.625 7.38672 63.4277 9.4375 60.9375 9.4375H28.125C25.4883 9.4375 23.4375 7.38672 23.4375 4.75C23.4375 2.25977 25.4883 0.0625 28.125 0.0625H60.9375C63.4277 0.0625 65.625 2.25977 65.625 4.75ZM65.625 42.25C65.625 44.8867 63.4277 46.9375 60.9375 46.9375H28.125C25.4883 46.9375 23.4375 44.8867 23.4375 42.25C23.4375 39.7598 25.4883 37.5625 28.125 37.5625H60.9375C63.4277 37.5625 65.625 39.7598 65.625 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z\"/></svg>");
|
|
33245
33245
|
append($$anchor, fragment_2);
|
|
33246
33246
|
};
|
|
33247
33247
|
var consequent_3 = ($$anchor) => {
|
|
33248
33248
|
var fragment_3 = comment();
|
|
33249
|
-
html(first_child(fragment_3), () => "<svg width=\"20\" height=\"20\" viewBox=\"0 0 66 66\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M51.5625 4.75C51.5625 7.38672 49.3652 9.4375 46.875 9.4375H18.75C16.1133 9.4375 14.0625 7.38672 14.0625 4.75C14.0625 2.25977 16.1133 0.0625 18.75 0.0625H46.875C49.3652 0.0625 51.5625 2.25977 51.5625 4.75ZM65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5ZM0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61ZM51.5625 42.25C51.5625 44.8867 49.3652 46.9375 46.875 46.9375H18.75C16.1133 46.9375 14.0625 44.8867 14.0625 42.25C14.0625 39.7598 16.1133 37.5625 18.75 37.5625H46.875C49.3652 37.5625 51.5625 39.7598 51.5625 42.25Z\"/></svg>");
|
|
33249
|
+
html$2(first_child(fragment_3), () => "<svg width=\"20\" height=\"20\" viewBox=\"0 0 66 66\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M51.5625 4.75C51.5625 7.38672 49.3652 9.4375 46.875 9.4375H18.75C16.1133 9.4375 14.0625 7.38672 14.0625 4.75C14.0625 2.25977 16.1133 0.0625 18.75 0.0625H46.875C49.3652 0.0625 51.5625 2.25977 51.5625 4.75ZM65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5ZM0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61ZM51.5625 42.25C51.5625 44.8867 49.3652 46.9375 46.875 46.9375H18.75C16.1133 46.9375 14.0625 44.8867 14.0625 42.25C14.0625 39.7598 16.1133 37.5625 18.75 37.5625H46.875C49.3652 37.5625 51.5625 39.7598 51.5625 42.25Z\"/></svg>");
|
|
33250
33250
|
append($$anchor, fragment_3);
|
|
33251
33251
|
};
|
|
33252
33252
|
var alternate = ($$anchor) => {
|
|
33253
33253
|
var fragment_4 = comment();
|
|
33254
|
-
html(first_child(fragment_4), () => "<svg width=\"20\" height=\"20\" viewBox=\"0 0 66 66\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M42.1875 4.75C42.1875 7.38672 39.9902 9.4375 37.5 9.4375H4.6875C2.05078 9.4375 0 7.38672 0 4.75C0 2.25977 2.05078 0.0625 4.6875 0.0625H37.5C39.9902 0.0625 42.1875 2.25977 42.1875 4.75ZM42.1875 42.25C42.1875 44.8867 39.9902 46.9375 37.5 46.9375H4.6875C2.05078 46.9375 0 44.8867 0 42.25C0 39.7598 2.05078 37.5625 4.6875 37.5625H37.5C39.9902 37.5625 42.1875 39.7598 42.1875 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z\"/></svg>");
|
|
33254
|
+
html$2(first_child(fragment_4), () => "<svg width=\"20\" height=\"20\" viewBox=\"0 0 66 66\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M42.1875 4.75C42.1875 7.38672 39.9902 9.4375 37.5 9.4375H4.6875C2.05078 9.4375 0 7.38672 0 4.75C0 2.25977 2.05078 0.0625 4.6875 0.0625H37.5C39.9902 0.0625 42.1875 2.25977 42.1875 4.75ZM42.1875 42.25C42.1875 44.8867 39.9902 46.9375 37.5 46.9375H4.6875C2.05078 46.9375 0 44.8867 0 42.25C0 39.7598 2.05078 37.5625 4.6875 37.5625H37.5C39.9902 37.5625 42.1875 39.7598 42.1875 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z\"/></svg>");
|
|
33255
33255
|
append($$anchor, fragment_4);
|
|
33256
33256
|
};
|
|
33257
33257
|
if_block(node_4, ($$render) => {
|
|
@@ -33265,13 +33265,13 @@ function EditableHtml$1($$anchor, $$props) {
|
|
|
33265
33265
|
var consequent_4 = ($$anchor) => {
|
|
33266
33266
|
var div_8 = root_2$3();
|
|
33267
33267
|
var button_17 = child(div_8);
|
|
33268
|
-
html(button_17, () => "<svg width=\"20\" height=\"20\" viewBox=\"0 0 66 66\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M42.1875 4.75C42.1875 7.38672 39.9902 9.4375 37.5 9.4375H4.6875C2.05078 9.4375 0 7.38672 0 4.75C0 2.25977 2.05078 0.0625 4.6875 0.0625H37.5C39.9902 0.0625 42.1875 2.25977 42.1875 4.75ZM42.1875 42.25C42.1875 44.8867 39.9902 46.9375 37.5 46.9375H4.6875C2.05078 46.9375 0 44.8867 0 42.25C0 39.7598 2.05078 37.5625 4.6875 37.5625H37.5C39.9902 37.5625 42.1875 39.7598 42.1875 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z\"/></svg>", true);
|
|
33268
|
+
html$2(button_17, () => "<svg width=\"20\" height=\"20\" viewBox=\"0 0 66 66\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M42.1875 4.75C42.1875 7.38672 39.9902 9.4375 37.5 9.4375H4.6875C2.05078 9.4375 0 7.38672 0 4.75C0 2.25977 2.05078 0.0625 4.6875 0.0625H37.5C39.9902 0.0625 42.1875 2.25977 42.1875 4.75ZM42.1875 42.25C42.1875 44.8867 39.9902 46.9375 37.5 46.9375H4.6875C2.05078 46.9375 0 44.8867 0 42.25C0 39.7598 2.05078 37.5625 4.6875 37.5625H37.5C39.9902 37.5625 42.1875 39.7598 42.1875 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z\"/></svg>", true);
|
|
33269
33269
|
reset$1(button_17);
|
|
33270
33270
|
var button_18 = sibling(button_17, 2);
|
|
33271
|
-
html(button_18, () => "<svg width=\"20\" height=\"20\" viewBox=\"0 0 66 66\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M51.5625 4.75C51.5625 7.38672 49.3652 9.4375 46.875 9.4375H18.75C16.1133 9.4375 14.0625 7.38672 14.0625 4.75C14.0625 2.25977 16.1133 0.0625 18.75 0.0625H46.875C49.3652 0.0625 51.5625 2.25977 51.5625 4.75ZM65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5ZM0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61ZM51.5625 42.25C51.5625 44.8867 49.3652 46.9375 46.875 46.9375H18.75C16.1133 46.9375 14.0625 44.8867 14.0625 42.25C14.0625 39.7598 16.1133 37.5625 18.75 37.5625H46.875C49.3652 37.5625 51.5625 39.7598 51.5625 42.25Z\"/></svg>", true);
|
|
33271
|
+
html$2(button_18, () => "<svg width=\"20\" height=\"20\" viewBox=\"0 0 66 66\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M51.5625 4.75C51.5625 7.38672 49.3652 9.4375 46.875 9.4375H18.75C16.1133 9.4375 14.0625 7.38672 14.0625 4.75C14.0625 2.25977 16.1133 0.0625 18.75 0.0625H46.875C49.3652 0.0625 51.5625 2.25977 51.5625 4.75ZM65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5ZM0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61ZM51.5625 42.25C51.5625 44.8867 49.3652 46.9375 46.875 46.9375H18.75C16.1133 46.9375 14.0625 44.8867 14.0625 42.25C14.0625 39.7598 16.1133 37.5625 18.75 37.5625H46.875C49.3652 37.5625 51.5625 39.7598 51.5625 42.25Z\"/></svg>", true);
|
|
33272
33272
|
reset$1(button_18);
|
|
33273
33273
|
var button_19 = sibling(button_18, 2);
|
|
33274
|
-
html(button_19, () => "<svg width=\"20\" height=\"20\" viewBox=\"0 0 66 66\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M65.625 4.75C65.625 7.38672 63.4277 9.4375 60.9375 9.4375H28.125C25.4883 9.4375 23.4375 7.38672 23.4375 4.75C23.4375 2.25977 25.4883 0.0625 28.125 0.0625H60.9375C63.4277 0.0625 65.625 2.25977 65.625 4.75ZM65.625 42.25C65.625 44.8867 63.4277 46.9375 60.9375 46.9375H28.125C25.4883 46.9375 23.4375 44.8867 23.4375 42.25C23.4375 39.7598 25.4883 37.5625 28.125 37.5625H60.9375C63.4277 37.5625 65.625 39.7598 65.625 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z\"/></svg>", true);
|
|
33274
|
+
html$2(button_19, () => "<svg width=\"20\" height=\"20\" viewBox=\"0 0 66 66\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M65.625 4.75C65.625 7.38672 63.4277 9.4375 60.9375 9.4375H28.125C25.4883 9.4375 23.4375 7.38672 23.4375 4.75C23.4375 2.25977 25.4883 0.0625 28.125 0.0625H60.9375C63.4277 0.0625 65.625 2.25977 65.625 4.75ZM65.625 42.25C65.625 44.8867 63.4277 46.9375 60.9375 46.9375H28.125C25.4883 46.9375 23.4375 44.8867 23.4375 42.25C23.4375 39.7598 25.4883 37.5625 28.125 37.5625H60.9375C63.4277 37.5625 65.625 39.7598 65.625 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z\"/></svg>", true);
|
|
33275
33275
|
reset$1(button_19);
|
|
33276
33276
|
reset$1(div_8);
|
|
33277
33277
|
delegated("click", button_17, () => setTextAlign("left"));
|
|
@@ -33285,17 +33285,17 @@ function EditableHtml$1($$anchor, $$props) {
|
|
|
33285
33285
|
reset$1(div_7);
|
|
33286
33286
|
var button_20 = sibling(div_7, 2);
|
|
33287
33287
|
let classes_16;
|
|
33288
|
-
html(button_20, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5zm0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5zM7 19h14v-2H7v2zm0-6h14v-2H7v2zm0-8v2h14V5H7z\"/></svg>", true);
|
|
33288
|
+
html$2(button_20, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5zm0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5zM7 19h14v-2H7v2zm0-6h14v-2H7v2zm0-8v2h14V5H7z\"/></svg>", true);
|
|
33289
33289
|
reset$1(button_20);
|
|
33290
33290
|
var button_21 = sibling(button_20, 2);
|
|
33291
33291
|
let classes_17;
|
|
33292
|
-
html(button_21, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z\"/></svg>", true);
|
|
33292
|
+
html$2(button_21, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z\"/></svg>", true);
|
|
33293
33293
|
reset$1(button_21);
|
|
33294
33294
|
var button_22 = sibling(button_21, 2);
|
|
33295
|
-
html(button_22, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z\"/></svg>", true);
|
|
33295
|
+
html$2(button_22, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z\"/></svg>", true);
|
|
33296
33296
|
reset$1(button_22);
|
|
33297
33297
|
var button_23 = sibling(button_22, 2);
|
|
33298
|
-
html(button_23, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z\"/></svg>", true);
|
|
33298
|
+
html$2(button_23, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z\"/></svg>", true);
|
|
33299
33299
|
reset$1(button_23);
|
|
33300
33300
|
template_effect(() => {
|
|
33301
33301
|
classes_8 = set_class(button_7, 1, "pie-toolbar-btn", null, classes_8, { active: get$1(editorState).isBold });
|
|
@@ -33336,7 +33336,7 @@ function EditableHtml$1($$anchor, $$props) {
|
|
|
33336
33336
|
});
|
|
33337
33337
|
reset$1(div_6);
|
|
33338
33338
|
var button_24 = sibling(div_6, 2);
|
|
33339
|
-
html(button_24, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\"/></svg>", true);
|
|
33339
|
+
html$2(button_24, () => "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" fill=\"currentColor\"><path d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\"/></svg>", true);
|
|
33340
33340
|
reset$1(button_24);
|
|
33341
33341
|
reset$1(div_5);
|
|
33342
33342
|
reset$1(div_4);
|
|
@@ -36173,121 +36173,2754 @@ create_custom_element(RegionPicker, {
|
|
|
36173
36173
|
onchange: {}
|
|
36174
36174
|
}, [], [], { mode: "open" });
|
|
36175
36175
|
//#endregion
|
|
36176
|
+
//#region ../../../node_modules/.bun/dompurify@3.4.16/node_modules/dompurify/dist/purify.es.mjs
|
|
36177
|
+
/*! @license DOMPurify 3.4.16 | (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.16/LICENSE */
|
|
36178
|
+
function _OverloadYield(e, d) {
|
|
36179
|
+
this.v = e, this.k = d;
|
|
36180
|
+
}
|
|
36181
|
+
function _arrayLikeToArray(r, a) {
|
|
36182
|
+
(null == a || a > r.length) && (a = r.length);
|
|
36183
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
36184
|
+
return n;
|
|
36185
|
+
}
|
|
36186
|
+
function _arrayWithHoles(r) {
|
|
36187
|
+
if (Array.isArray(r)) return r;
|
|
36188
|
+
}
|
|
36189
|
+
function _iterableToArrayLimit(r, l) {
|
|
36190
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
36191
|
+
if (null != t) {
|
|
36192
|
+
var e, n, i, u, a = [], f = !0, o = !1;
|
|
36193
|
+
try {
|
|
36194
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
36195
|
+
if (Object(t) !== t) return;
|
|
36196
|
+
f = !1;
|
|
36197
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
36198
|
+
} catch (r) {
|
|
36199
|
+
o = !0, n = r;
|
|
36200
|
+
} finally {
|
|
36201
|
+
try {
|
|
36202
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
36203
|
+
} finally {
|
|
36204
|
+
if (o) throw n;
|
|
36205
|
+
}
|
|
36206
|
+
}
|
|
36207
|
+
return a;
|
|
36208
|
+
}
|
|
36209
|
+
}
|
|
36210
|
+
function _nonIterableRest() {
|
|
36211
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
36212
|
+
}
|
|
36213
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
36214
|
+
function _slicedToArray(r, e) {
|
|
36215
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
36216
|
+
}
|
|
36217
|
+
function _unsupportedIterableToArray(r, a) {
|
|
36218
|
+
if (r) {
|
|
36219
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
36220
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
36221
|
+
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;
|
|
36222
|
+
}
|
|
36223
|
+
}
|
|
36224
|
+
function AsyncGenerator(e) {
|
|
36225
|
+
var t, n;
|
|
36226
|
+
function resume(t, n) {
|
|
36227
|
+
try {
|
|
36228
|
+
var r = e[t](n), o = r.value, u = o instanceof _OverloadYield;
|
|
36229
|
+
Promise.resolve(u ? o.v : o).then(function(n) {
|
|
36230
|
+
if (u) {
|
|
36231
|
+
var i = "return" === t && o.k ? t : "next";
|
|
36232
|
+
if (!o.k || n.done) return resume(i, n);
|
|
36233
|
+
n = e[i](n).value;
|
|
36234
|
+
}
|
|
36235
|
+
settle(!!r.done, n);
|
|
36236
|
+
}, function(e) {
|
|
36237
|
+
resume("throw", e);
|
|
36238
|
+
});
|
|
36239
|
+
} catch (e) {
|
|
36240
|
+
settle(2, e);
|
|
36241
|
+
}
|
|
36242
|
+
}
|
|
36243
|
+
function settle(e, r) {
|
|
36244
|
+
2 === e ? t.reject(r) : t.resolve({
|
|
36245
|
+
value: r,
|
|
36246
|
+
done: e
|
|
36247
|
+
}), (t = t.next) ? resume(t.key, t.arg) : n = null;
|
|
36248
|
+
}
|
|
36249
|
+
this._invoke = function(e, r) {
|
|
36250
|
+
return new Promise(function(o, u) {
|
|
36251
|
+
var i = {
|
|
36252
|
+
key: e,
|
|
36253
|
+
arg: r,
|
|
36254
|
+
resolve: o,
|
|
36255
|
+
reject: u,
|
|
36256
|
+
next: null
|
|
36257
|
+
};
|
|
36258
|
+
n ? n = n.next = i : (t = n = i, resume(e, r));
|
|
36259
|
+
});
|
|
36260
|
+
}, "function" != typeof e.return && (this.return = void 0);
|
|
36261
|
+
}
|
|
36262
|
+
AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function() {
|
|
36263
|
+
return this;
|
|
36264
|
+
}, AsyncGenerator.prototype.next = function(e) {
|
|
36265
|
+
return this._invoke("next", e);
|
|
36266
|
+
}, AsyncGenerator.prototype.throw = function(e) {
|
|
36267
|
+
return this._invoke("throw", e);
|
|
36268
|
+
}, AsyncGenerator.prototype.return = function(e) {
|
|
36269
|
+
return this._invoke("return", e);
|
|
36270
|
+
};
|
|
36271
|
+
var entries = Object.entries;
|
|
36272
|
+
var setPrototypeOf = Object.setPrototypeOf;
|
|
36273
|
+
var isFrozen = Object.isFrozen;
|
|
36274
|
+
var getPrototypeOf = Object.getPrototypeOf;
|
|
36275
|
+
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
36276
|
+
var freeze = Object.freeze;
|
|
36277
|
+
var seal = Object.seal;
|
|
36278
|
+
var create = Object.create;
|
|
36279
|
+
var _ref = typeof Reflect !== "undefined" && Reflect;
|
|
36280
|
+
var apply = _ref.apply;
|
|
36281
|
+
var construct = _ref.construct;
|
|
36282
|
+
if (!freeze) freeze = function freeze(x) {
|
|
36283
|
+
return x;
|
|
36284
|
+
};
|
|
36285
|
+
if (!seal) seal = function seal(x) {
|
|
36286
|
+
return x;
|
|
36287
|
+
};
|
|
36288
|
+
if (!apply) apply = function apply(func, thisArg) {
|
|
36289
|
+
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];
|
|
36290
|
+
return func.apply(thisArg, args);
|
|
36291
|
+
};
|
|
36292
|
+
if (!construct) construct = function construct(Func) {
|
|
36293
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2];
|
|
36294
|
+
return new Func(...args);
|
|
36295
|
+
};
|
|
36296
|
+
var arrayForEach = unapply(Array.prototype.forEach);
|
|
36297
|
+
Array.prototype.indexOf;
|
|
36298
|
+
var arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
|
|
36299
|
+
var arrayPop = unapply(Array.prototype.pop);
|
|
36300
|
+
var arrayPush = unapply(Array.prototype.push);
|
|
36301
|
+
Array.prototype.slice;
|
|
36302
|
+
var arraySplice = unapply(Array.prototype.splice);
|
|
36303
|
+
var arrayIsArray = Array.isArray;
|
|
36304
|
+
var stringToLowerCase = unapply(String.prototype.toLowerCase);
|
|
36305
|
+
var stringToString = unapply(String.prototype.toString);
|
|
36306
|
+
var stringMatch = unapply(String.prototype.match);
|
|
36307
|
+
var stringReplace = unapply(String.prototype.replace);
|
|
36308
|
+
var stringIndexOf = unapply(String.prototype.indexOf);
|
|
36309
|
+
var stringTrim = unapply(String.prototype.trim);
|
|
36310
|
+
var numberToString = unapply(Number.prototype.toString);
|
|
36311
|
+
var booleanToString = unapply(Boolean.prototype.toString);
|
|
36312
|
+
var bigintToString = typeof BigInt === "undefined" ? null : unapply(BigInt.prototype.toString);
|
|
36313
|
+
var symbolToString = typeof Symbol === "undefined" ? null : unapply(Symbol.prototype.toString);
|
|
36314
|
+
var objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
|
|
36315
|
+
var objectToString = unapply(Object.prototype.toString);
|
|
36316
|
+
var regExpTest = unapply(RegExp.prototype.test);
|
|
36317
|
+
var typeErrorCreate = unconstruct(TypeError);
|
|
36318
|
+
/**
|
|
36319
|
+
* Creates a new function that calls the given function with a specified thisArg and arguments.
|
|
36320
|
+
*
|
|
36321
|
+
* @param func - The function to be wrapped and called.
|
|
36322
|
+
* @returns A new function that calls the given function with a specified thisArg and arguments.
|
|
36323
|
+
*/
|
|
36324
|
+
function unapply(func) {
|
|
36325
|
+
return function(thisArg) {
|
|
36326
|
+
if (thisArg instanceof RegExp) thisArg.lastIndex = 0;
|
|
36327
|
+
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) args[_key3 - 1] = arguments[_key3];
|
|
36328
|
+
return apply(func, thisArg, args);
|
|
36329
|
+
};
|
|
36330
|
+
}
|
|
36331
|
+
/**
|
|
36332
|
+
* Creates a new function that constructs an instance of the given constructor function with the provided arguments.
|
|
36333
|
+
*
|
|
36334
|
+
* @param func - The constructor function to be wrapped and called.
|
|
36335
|
+
* @returns A new function that constructs an instance of the given constructor function with the provided arguments.
|
|
36336
|
+
*/
|
|
36337
|
+
function unconstruct(Func) {
|
|
36338
|
+
return function() {
|
|
36339
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) args[_key4] = arguments[_key4];
|
|
36340
|
+
return construct(Func, args);
|
|
36341
|
+
};
|
|
36342
|
+
}
|
|
36343
|
+
/**
|
|
36344
|
+
* Add properties to a lookup table
|
|
36345
|
+
*
|
|
36346
|
+
* @param set - The set to which elements will be added.
|
|
36347
|
+
* @param array - The array containing elements to be added to the set.
|
|
36348
|
+
* @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
|
|
36349
|
+
* @returns The modified set with added elements.
|
|
36350
|
+
*/
|
|
36351
|
+
function addToSet(set, array) {
|
|
36352
|
+
let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;
|
|
36353
|
+
if (setPrototypeOf) setPrototypeOf(set, null);
|
|
36354
|
+
if (!arrayIsArray(array)) return set;
|
|
36355
|
+
let l = array.length;
|
|
36356
|
+
while (l--) {
|
|
36357
|
+
let element = array[l];
|
|
36358
|
+
if (typeof element === "string") {
|
|
36359
|
+
const lcElement = transformCaseFunc(element);
|
|
36360
|
+
if (lcElement !== element) {
|
|
36361
|
+
if (!isFrozen(array)) array[l] = lcElement;
|
|
36362
|
+
element = lcElement;
|
|
36363
|
+
}
|
|
36364
|
+
}
|
|
36365
|
+
set[element] = true;
|
|
36366
|
+
}
|
|
36367
|
+
return set;
|
|
36368
|
+
}
|
|
36369
|
+
/**
|
|
36370
|
+
* Clean up an array to harden against CSPP
|
|
36371
|
+
*
|
|
36372
|
+
* @param array - The array to be cleaned.
|
|
36373
|
+
* @returns The cleaned version of the array
|
|
36374
|
+
*/
|
|
36375
|
+
function cleanArray(array) {
|
|
36376
|
+
for (let index = 0; index < array.length; index++) if (!objectHasOwnProperty(array, index)) array[index] = null;
|
|
36377
|
+
return array;
|
|
36378
|
+
}
|
|
36379
|
+
/**
|
|
36380
|
+
* Shallow clone an object
|
|
36381
|
+
*
|
|
36382
|
+
* @param object - The object to be cloned.
|
|
36383
|
+
* @returns A new object that copies the original.
|
|
36384
|
+
*/
|
|
36385
|
+
function clone(object) {
|
|
36386
|
+
const newObject = create(null);
|
|
36387
|
+
for (const _ref2 of entries(object)) {
|
|
36388
|
+
var _ref3 = _slicedToArray(_ref2, 2);
|
|
36389
|
+
const property = _ref3[0];
|
|
36390
|
+
const value = _ref3[1];
|
|
36391
|
+
if (objectHasOwnProperty(object, property)) if (arrayIsArray(value)) newObject[property] = cleanArray(value);
|
|
36392
|
+
else if (value && typeof value === "object" && value.constructor === Object) newObject[property] = clone(value);
|
|
36393
|
+
else newObject[property] = value;
|
|
36394
|
+
}
|
|
36395
|
+
return newObject;
|
|
36396
|
+
}
|
|
36397
|
+
/**
|
|
36398
|
+
* Convert non-node values into strings without depending on direct property access.
|
|
36399
|
+
*
|
|
36400
|
+
* @param value - The value to stringify.
|
|
36401
|
+
* @returns A string representation of the provided value.
|
|
36402
|
+
*/
|
|
36403
|
+
function stringifyValue(value) {
|
|
36404
|
+
switch (typeof value) {
|
|
36405
|
+
case "string": return value;
|
|
36406
|
+
case "number": return numberToString(value);
|
|
36407
|
+
case "boolean": return booleanToString(value);
|
|
36408
|
+
case "bigint": return bigintToString ? bigintToString(value) : "0";
|
|
36409
|
+
case "symbol": return symbolToString ? symbolToString(value) : "Symbol()";
|
|
36410
|
+
case "undefined": return objectToString(value);
|
|
36411
|
+
case "function":
|
|
36412
|
+
case "object": {
|
|
36413
|
+
if (value === null) return objectToString(value);
|
|
36414
|
+
const valueAsRecord = value;
|
|
36415
|
+
const valueToString = lookupGetter(valueAsRecord, "toString");
|
|
36416
|
+
if (typeof valueToString === "function") {
|
|
36417
|
+
const stringified = valueToString(valueAsRecord);
|
|
36418
|
+
return typeof stringified === "string" ? stringified : objectToString(stringified);
|
|
36419
|
+
}
|
|
36420
|
+
return objectToString(value);
|
|
36421
|
+
}
|
|
36422
|
+
default: return objectToString(value);
|
|
36423
|
+
}
|
|
36424
|
+
}
|
|
36425
|
+
/**
|
|
36426
|
+
* This method automatically checks if the prop is function or getter and behaves accordingly.
|
|
36427
|
+
*
|
|
36428
|
+
* @param object - The object to look up the getter function in its prototype chain.
|
|
36429
|
+
* @param prop - The property name for which to find the getter function.
|
|
36430
|
+
* @returns The getter function found in the prototype chain or a fallback function.
|
|
36431
|
+
*/
|
|
36432
|
+
function lookupGetter(object, prop) {
|
|
36433
|
+
while (object !== null) {
|
|
36434
|
+
const desc = getOwnPropertyDescriptor(object, prop);
|
|
36435
|
+
if (desc) {
|
|
36436
|
+
if (desc.get) return unapply(desc.get);
|
|
36437
|
+
if (typeof desc.value === "function") return unapply(desc.value);
|
|
36438
|
+
}
|
|
36439
|
+
object = getPrototypeOf(object);
|
|
36440
|
+
}
|
|
36441
|
+
function fallbackValue() {
|
|
36442
|
+
return null;
|
|
36443
|
+
}
|
|
36444
|
+
return fallbackValue;
|
|
36445
|
+
}
|
|
36446
|
+
function isRegex(value) {
|
|
36447
|
+
try {
|
|
36448
|
+
regExpTest(value, "");
|
|
36449
|
+
return true;
|
|
36450
|
+
} catch (_unused) {
|
|
36451
|
+
return false;
|
|
36452
|
+
}
|
|
36453
|
+
}
|
|
36454
|
+
var html$1 = freeze([
|
|
36455
|
+
"a",
|
|
36456
|
+
"abbr",
|
|
36457
|
+
"acronym",
|
|
36458
|
+
"address",
|
|
36459
|
+
"area",
|
|
36460
|
+
"article",
|
|
36461
|
+
"aside",
|
|
36462
|
+
"audio",
|
|
36463
|
+
"b",
|
|
36464
|
+
"bdi",
|
|
36465
|
+
"bdo",
|
|
36466
|
+
"big",
|
|
36467
|
+
"blink",
|
|
36468
|
+
"blockquote",
|
|
36469
|
+
"body",
|
|
36470
|
+
"br",
|
|
36471
|
+
"button",
|
|
36472
|
+
"canvas",
|
|
36473
|
+
"caption",
|
|
36474
|
+
"center",
|
|
36475
|
+
"cite",
|
|
36476
|
+
"code",
|
|
36477
|
+
"col",
|
|
36478
|
+
"colgroup",
|
|
36479
|
+
"content",
|
|
36480
|
+
"data",
|
|
36481
|
+
"datalist",
|
|
36482
|
+
"dd",
|
|
36483
|
+
"decorator",
|
|
36484
|
+
"del",
|
|
36485
|
+
"details",
|
|
36486
|
+
"dfn",
|
|
36487
|
+
"dialog",
|
|
36488
|
+
"dir",
|
|
36489
|
+
"div",
|
|
36490
|
+
"dl",
|
|
36491
|
+
"dt",
|
|
36492
|
+
"element",
|
|
36493
|
+
"em",
|
|
36494
|
+
"fieldset",
|
|
36495
|
+
"figcaption",
|
|
36496
|
+
"figure",
|
|
36497
|
+
"font",
|
|
36498
|
+
"footer",
|
|
36499
|
+
"form",
|
|
36500
|
+
"h1",
|
|
36501
|
+
"h2",
|
|
36502
|
+
"h3",
|
|
36503
|
+
"h4",
|
|
36504
|
+
"h5",
|
|
36505
|
+
"h6",
|
|
36506
|
+
"head",
|
|
36507
|
+
"header",
|
|
36508
|
+
"hgroup",
|
|
36509
|
+
"hr",
|
|
36510
|
+
"html",
|
|
36511
|
+
"i",
|
|
36512
|
+
"img",
|
|
36513
|
+
"input",
|
|
36514
|
+
"ins",
|
|
36515
|
+
"kbd",
|
|
36516
|
+
"label",
|
|
36517
|
+
"legend",
|
|
36518
|
+
"li",
|
|
36519
|
+
"main",
|
|
36520
|
+
"map",
|
|
36521
|
+
"mark",
|
|
36522
|
+
"marquee",
|
|
36523
|
+
"menu",
|
|
36524
|
+
"menuitem",
|
|
36525
|
+
"meter",
|
|
36526
|
+
"nav",
|
|
36527
|
+
"nobr",
|
|
36528
|
+
"ol",
|
|
36529
|
+
"optgroup",
|
|
36530
|
+
"option",
|
|
36531
|
+
"output",
|
|
36532
|
+
"p",
|
|
36533
|
+
"picture",
|
|
36534
|
+
"pre",
|
|
36535
|
+
"progress",
|
|
36536
|
+
"q",
|
|
36537
|
+
"rp",
|
|
36538
|
+
"rt",
|
|
36539
|
+
"ruby",
|
|
36540
|
+
"s",
|
|
36541
|
+
"samp",
|
|
36542
|
+
"search",
|
|
36543
|
+
"section",
|
|
36544
|
+
"select",
|
|
36545
|
+
"shadow",
|
|
36546
|
+
"slot",
|
|
36547
|
+
"small",
|
|
36548
|
+
"source",
|
|
36549
|
+
"spacer",
|
|
36550
|
+
"span",
|
|
36551
|
+
"strike",
|
|
36552
|
+
"strong",
|
|
36553
|
+
"style",
|
|
36554
|
+
"sub",
|
|
36555
|
+
"summary",
|
|
36556
|
+
"sup",
|
|
36557
|
+
"table",
|
|
36558
|
+
"tbody",
|
|
36559
|
+
"td",
|
|
36560
|
+
"template",
|
|
36561
|
+
"textarea",
|
|
36562
|
+
"tfoot",
|
|
36563
|
+
"th",
|
|
36564
|
+
"thead",
|
|
36565
|
+
"time",
|
|
36566
|
+
"tr",
|
|
36567
|
+
"track",
|
|
36568
|
+
"tt",
|
|
36569
|
+
"u",
|
|
36570
|
+
"ul",
|
|
36571
|
+
"var",
|
|
36572
|
+
"video",
|
|
36573
|
+
"wbr"
|
|
36574
|
+
]);
|
|
36575
|
+
var svg$1 = freeze([
|
|
36576
|
+
"svg",
|
|
36577
|
+
"a",
|
|
36578
|
+
"altglyph",
|
|
36579
|
+
"altglyphdef",
|
|
36580
|
+
"altglyphitem",
|
|
36581
|
+
"animatecolor",
|
|
36582
|
+
"animatemotion",
|
|
36583
|
+
"animatetransform",
|
|
36584
|
+
"circle",
|
|
36585
|
+
"clippath",
|
|
36586
|
+
"defs",
|
|
36587
|
+
"desc",
|
|
36588
|
+
"ellipse",
|
|
36589
|
+
"enterkeyhint",
|
|
36590
|
+
"exportparts",
|
|
36591
|
+
"filter",
|
|
36592
|
+
"font",
|
|
36593
|
+
"g",
|
|
36594
|
+
"glyph",
|
|
36595
|
+
"glyphref",
|
|
36596
|
+
"hkern",
|
|
36597
|
+
"image",
|
|
36598
|
+
"inputmode",
|
|
36599
|
+
"line",
|
|
36600
|
+
"lineargradient",
|
|
36601
|
+
"marker",
|
|
36602
|
+
"mask",
|
|
36603
|
+
"metadata",
|
|
36604
|
+
"mpath",
|
|
36605
|
+
"part",
|
|
36606
|
+
"path",
|
|
36607
|
+
"pattern",
|
|
36608
|
+
"polygon",
|
|
36609
|
+
"polyline",
|
|
36610
|
+
"radialgradient",
|
|
36611
|
+
"rect",
|
|
36612
|
+
"stop",
|
|
36613
|
+
"style",
|
|
36614
|
+
"switch",
|
|
36615
|
+
"symbol",
|
|
36616
|
+
"text",
|
|
36617
|
+
"textpath",
|
|
36618
|
+
"title",
|
|
36619
|
+
"tref",
|
|
36620
|
+
"tspan",
|
|
36621
|
+
"view",
|
|
36622
|
+
"vkern"
|
|
36623
|
+
]);
|
|
36624
|
+
var svgFilters = freeze([
|
|
36625
|
+
"feBlend",
|
|
36626
|
+
"feColorMatrix",
|
|
36627
|
+
"feComponentTransfer",
|
|
36628
|
+
"feComposite",
|
|
36629
|
+
"feConvolveMatrix",
|
|
36630
|
+
"feDiffuseLighting",
|
|
36631
|
+
"feDisplacementMap",
|
|
36632
|
+
"feDistantLight",
|
|
36633
|
+
"feDropShadow",
|
|
36634
|
+
"feFlood",
|
|
36635
|
+
"feFuncA",
|
|
36636
|
+
"feFuncB",
|
|
36637
|
+
"feFuncG",
|
|
36638
|
+
"feFuncR",
|
|
36639
|
+
"feGaussianBlur",
|
|
36640
|
+
"feImage",
|
|
36641
|
+
"feMerge",
|
|
36642
|
+
"feMergeNode",
|
|
36643
|
+
"feMorphology",
|
|
36644
|
+
"feOffset",
|
|
36645
|
+
"fePointLight",
|
|
36646
|
+
"feSpecularLighting",
|
|
36647
|
+
"feSpotLight",
|
|
36648
|
+
"feTile",
|
|
36649
|
+
"feTurbulence"
|
|
36650
|
+
]);
|
|
36651
|
+
var svgDisallowed = freeze([
|
|
36652
|
+
"animate",
|
|
36653
|
+
"color-profile",
|
|
36654
|
+
"cursor",
|
|
36655
|
+
"discard",
|
|
36656
|
+
"font-face",
|
|
36657
|
+
"font-face-format",
|
|
36658
|
+
"font-face-name",
|
|
36659
|
+
"font-face-src",
|
|
36660
|
+
"font-face-uri",
|
|
36661
|
+
"foreignobject",
|
|
36662
|
+
"hatch",
|
|
36663
|
+
"hatchpath",
|
|
36664
|
+
"mesh",
|
|
36665
|
+
"meshgradient",
|
|
36666
|
+
"meshpatch",
|
|
36667
|
+
"meshrow",
|
|
36668
|
+
"missing-glyph",
|
|
36669
|
+
"script",
|
|
36670
|
+
"set",
|
|
36671
|
+
"solidcolor",
|
|
36672
|
+
"unknown",
|
|
36673
|
+
"use"
|
|
36674
|
+
]);
|
|
36675
|
+
var mathMl$1 = freeze([
|
|
36676
|
+
"math",
|
|
36677
|
+
"menclose",
|
|
36678
|
+
"merror",
|
|
36679
|
+
"mfenced",
|
|
36680
|
+
"mfrac",
|
|
36681
|
+
"mglyph",
|
|
36682
|
+
"mi",
|
|
36683
|
+
"mlabeledtr",
|
|
36684
|
+
"mmultiscripts",
|
|
36685
|
+
"mn",
|
|
36686
|
+
"mo",
|
|
36687
|
+
"mover",
|
|
36688
|
+
"mpadded",
|
|
36689
|
+
"mphantom",
|
|
36690
|
+
"mroot",
|
|
36691
|
+
"mrow",
|
|
36692
|
+
"ms",
|
|
36693
|
+
"mspace",
|
|
36694
|
+
"msqrt",
|
|
36695
|
+
"mstyle",
|
|
36696
|
+
"msub",
|
|
36697
|
+
"msup",
|
|
36698
|
+
"msubsup",
|
|
36699
|
+
"mtable",
|
|
36700
|
+
"mtd",
|
|
36701
|
+
"mtext",
|
|
36702
|
+
"mtr",
|
|
36703
|
+
"munder",
|
|
36704
|
+
"munderover",
|
|
36705
|
+
"mprescripts"
|
|
36706
|
+
]);
|
|
36707
|
+
var mathMlDisallowed = freeze([
|
|
36708
|
+
"maction",
|
|
36709
|
+
"maligngroup",
|
|
36710
|
+
"malignmark",
|
|
36711
|
+
"mlongdiv",
|
|
36712
|
+
"mscarries",
|
|
36713
|
+
"mscarry",
|
|
36714
|
+
"msgroup",
|
|
36715
|
+
"mstack",
|
|
36716
|
+
"msline",
|
|
36717
|
+
"msrow",
|
|
36718
|
+
"semantics",
|
|
36719
|
+
"annotation",
|
|
36720
|
+
"annotation-xml",
|
|
36721
|
+
"mprescripts",
|
|
36722
|
+
"none"
|
|
36723
|
+
]);
|
|
36724
|
+
var text = freeze(["#text"]);
|
|
36725
|
+
var html = freeze([
|
|
36726
|
+
"accept",
|
|
36727
|
+
"action",
|
|
36728
|
+
"align",
|
|
36729
|
+
"alt",
|
|
36730
|
+
"autocapitalize",
|
|
36731
|
+
"autocomplete",
|
|
36732
|
+
"autopictureinpicture",
|
|
36733
|
+
"autoplay",
|
|
36734
|
+
"background",
|
|
36735
|
+
"bgcolor",
|
|
36736
|
+
"border",
|
|
36737
|
+
"capture",
|
|
36738
|
+
"cellpadding",
|
|
36739
|
+
"cellspacing",
|
|
36740
|
+
"checked",
|
|
36741
|
+
"cite",
|
|
36742
|
+
"class",
|
|
36743
|
+
"clear",
|
|
36744
|
+
"color",
|
|
36745
|
+
"cols",
|
|
36746
|
+
"colspan",
|
|
36747
|
+
"command",
|
|
36748
|
+
"commandfor",
|
|
36749
|
+
"controls",
|
|
36750
|
+
"controlslist",
|
|
36751
|
+
"coords",
|
|
36752
|
+
"crossorigin",
|
|
36753
|
+
"datetime",
|
|
36754
|
+
"decoding",
|
|
36755
|
+
"default",
|
|
36756
|
+
"dir",
|
|
36757
|
+
"disabled",
|
|
36758
|
+
"disablepictureinpicture",
|
|
36759
|
+
"disableremoteplayback",
|
|
36760
|
+
"download",
|
|
36761
|
+
"draggable",
|
|
36762
|
+
"enctype",
|
|
36763
|
+
"enterkeyhint",
|
|
36764
|
+
"exportparts",
|
|
36765
|
+
"face",
|
|
36766
|
+
"for",
|
|
36767
|
+
"headers",
|
|
36768
|
+
"height",
|
|
36769
|
+
"hidden",
|
|
36770
|
+
"high",
|
|
36771
|
+
"href",
|
|
36772
|
+
"hreflang",
|
|
36773
|
+
"id",
|
|
36774
|
+
"inert",
|
|
36775
|
+
"inputmode",
|
|
36776
|
+
"integrity",
|
|
36777
|
+
"ismap",
|
|
36778
|
+
"kind",
|
|
36779
|
+
"label",
|
|
36780
|
+
"lang",
|
|
36781
|
+
"list",
|
|
36782
|
+
"loading",
|
|
36783
|
+
"loop",
|
|
36784
|
+
"low",
|
|
36785
|
+
"max",
|
|
36786
|
+
"maxlength",
|
|
36787
|
+
"media",
|
|
36788
|
+
"method",
|
|
36789
|
+
"min",
|
|
36790
|
+
"minlength",
|
|
36791
|
+
"multiple",
|
|
36792
|
+
"muted",
|
|
36793
|
+
"name",
|
|
36794
|
+
"nonce",
|
|
36795
|
+
"noshade",
|
|
36796
|
+
"novalidate",
|
|
36797
|
+
"nowrap",
|
|
36798
|
+
"open",
|
|
36799
|
+
"optimum",
|
|
36800
|
+
"part",
|
|
36801
|
+
"pattern",
|
|
36802
|
+
"placeholder",
|
|
36803
|
+
"playsinline",
|
|
36804
|
+
"popover",
|
|
36805
|
+
"popovertarget",
|
|
36806
|
+
"popovertargetaction",
|
|
36807
|
+
"poster",
|
|
36808
|
+
"preload",
|
|
36809
|
+
"pubdate",
|
|
36810
|
+
"radiogroup",
|
|
36811
|
+
"readonly",
|
|
36812
|
+
"rel",
|
|
36813
|
+
"required",
|
|
36814
|
+
"rev",
|
|
36815
|
+
"reversed",
|
|
36816
|
+
"role",
|
|
36817
|
+
"rows",
|
|
36818
|
+
"rowspan",
|
|
36819
|
+
"spellcheck",
|
|
36820
|
+
"scope",
|
|
36821
|
+
"selected",
|
|
36822
|
+
"shape",
|
|
36823
|
+
"size",
|
|
36824
|
+
"sizes",
|
|
36825
|
+
"slot",
|
|
36826
|
+
"span",
|
|
36827
|
+
"srclang",
|
|
36828
|
+
"start",
|
|
36829
|
+
"src",
|
|
36830
|
+
"srcset",
|
|
36831
|
+
"step",
|
|
36832
|
+
"style",
|
|
36833
|
+
"summary",
|
|
36834
|
+
"tabindex",
|
|
36835
|
+
"title",
|
|
36836
|
+
"translate",
|
|
36837
|
+
"type",
|
|
36838
|
+
"usemap",
|
|
36839
|
+
"valign",
|
|
36840
|
+
"value",
|
|
36841
|
+
"width",
|
|
36842
|
+
"wrap",
|
|
36843
|
+
"xmlns"
|
|
36844
|
+
]);
|
|
36845
|
+
var svg = freeze([
|
|
36846
|
+
"accent-height",
|
|
36847
|
+
"accumulate",
|
|
36848
|
+
"additive",
|
|
36849
|
+
"alignment-baseline",
|
|
36850
|
+
"amplitude",
|
|
36851
|
+
"ascent",
|
|
36852
|
+
"attributename",
|
|
36853
|
+
"attributetype",
|
|
36854
|
+
"azimuth",
|
|
36855
|
+
"basefrequency",
|
|
36856
|
+
"baseline-shift",
|
|
36857
|
+
"begin",
|
|
36858
|
+
"bias",
|
|
36859
|
+
"by",
|
|
36860
|
+
"class",
|
|
36861
|
+
"clip",
|
|
36862
|
+
"clippathunits",
|
|
36863
|
+
"clip-path",
|
|
36864
|
+
"clip-rule",
|
|
36865
|
+
"color",
|
|
36866
|
+
"color-interpolation",
|
|
36867
|
+
"color-interpolation-filters",
|
|
36868
|
+
"color-profile",
|
|
36869
|
+
"color-rendering",
|
|
36870
|
+
"cx",
|
|
36871
|
+
"cy",
|
|
36872
|
+
"d",
|
|
36873
|
+
"dx",
|
|
36874
|
+
"dy",
|
|
36875
|
+
"diffuseconstant",
|
|
36876
|
+
"direction",
|
|
36877
|
+
"display",
|
|
36878
|
+
"divisor",
|
|
36879
|
+
"dominant-baseline",
|
|
36880
|
+
"dur",
|
|
36881
|
+
"edgemode",
|
|
36882
|
+
"elevation",
|
|
36883
|
+
"end",
|
|
36884
|
+
"exponent",
|
|
36885
|
+
"fill",
|
|
36886
|
+
"fill-opacity",
|
|
36887
|
+
"fill-rule",
|
|
36888
|
+
"filter",
|
|
36889
|
+
"filterunits",
|
|
36890
|
+
"flood-color",
|
|
36891
|
+
"flood-opacity",
|
|
36892
|
+
"font-family",
|
|
36893
|
+
"font-size",
|
|
36894
|
+
"font-size-adjust",
|
|
36895
|
+
"font-stretch",
|
|
36896
|
+
"font-style",
|
|
36897
|
+
"font-variant",
|
|
36898
|
+
"font-weight",
|
|
36899
|
+
"fx",
|
|
36900
|
+
"fy",
|
|
36901
|
+
"g1",
|
|
36902
|
+
"g2",
|
|
36903
|
+
"glyph-name",
|
|
36904
|
+
"glyphref",
|
|
36905
|
+
"gradientunits",
|
|
36906
|
+
"gradienttransform",
|
|
36907
|
+
"height",
|
|
36908
|
+
"href",
|
|
36909
|
+
"id",
|
|
36910
|
+
"image-rendering",
|
|
36911
|
+
"in",
|
|
36912
|
+
"in2",
|
|
36913
|
+
"intercept",
|
|
36914
|
+
"k",
|
|
36915
|
+
"k1",
|
|
36916
|
+
"k2",
|
|
36917
|
+
"k3",
|
|
36918
|
+
"k4",
|
|
36919
|
+
"kerning",
|
|
36920
|
+
"keypoints",
|
|
36921
|
+
"keysplines",
|
|
36922
|
+
"keytimes",
|
|
36923
|
+
"lang",
|
|
36924
|
+
"lengthadjust",
|
|
36925
|
+
"letter-spacing",
|
|
36926
|
+
"kernelmatrix",
|
|
36927
|
+
"kernelunitlength",
|
|
36928
|
+
"lighting-color",
|
|
36929
|
+
"local",
|
|
36930
|
+
"marker-end",
|
|
36931
|
+
"marker-mid",
|
|
36932
|
+
"marker-start",
|
|
36933
|
+
"markerheight",
|
|
36934
|
+
"markerunits",
|
|
36935
|
+
"markerwidth",
|
|
36936
|
+
"maskcontentunits",
|
|
36937
|
+
"maskunits",
|
|
36938
|
+
"max",
|
|
36939
|
+
"mask",
|
|
36940
|
+
"mask-type",
|
|
36941
|
+
"media",
|
|
36942
|
+
"method",
|
|
36943
|
+
"mode",
|
|
36944
|
+
"min",
|
|
36945
|
+
"name",
|
|
36946
|
+
"numoctaves",
|
|
36947
|
+
"offset",
|
|
36948
|
+
"operator",
|
|
36949
|
+
"opacity",
|
|
36950
|
+
"order",
|
|
36951
|
+
"orient",
|
|
36952
|
+
"orientation",
|
|
36953
|
+
"origin",
|
|
36954
|
+
"overflow",
|
|
36955
|
+
"paint-order",
|
|
36956
|
+
"path",
|
|
36957
|
+
"pathlength",
|
|
36958
|
+
"patterncontentunits",
|
|
36959
|
+
"patterntransform",
|
|
36960
|
+
"patternunits",
|
|
36961
|
+
"pointer-events",
|
|
36962
|
+
"points",
|
|
36963
|
+
"preservealpha",
|
|
36964
|
+
"preserveaspectratio",
|
|
36965
|
+
"primitiveunits",
|
|
36966
|
+
"r",
|
|
36967
|
+
"rx",
|
|
36968
|
+
"ry",
|
|
36969
|
+
"radius",
|
|
36970
|
+
"refx",
|
|
36971
|
+
"refy",
|
|
36972
|
+
"repeatcount",
|
|
36973
|
+
"repeatdur",
|
|
36974
|
+
"restart",
|
|
36975
|
+
"result",
|
|
36976
|
+
"rotate",
|
|
36977
|
+
"scale",
|
|
36978
|
+
"seed",
|
|
36979
|
+
"shape-rendering",
|
|
36980
|
+
"slope",
|
|
36981
|
+
"specularconstant",
|
|
36982
|
+
"specularexponent",
|
|
36983
|
+
"spreadmethod",
|
|
36984
|
+
"startoffset",
|
|
36985
|
+
"stddeviation",
|
|
36986
|
+
"stitchtiles",
|
|
36987
|
+
"stop-color",
|
|
36988
|
+
"stop-opacity",
|
|
36989
|
+
"stroke-dasharray",
|
|
36990
|
+
"stroke-dashoffset",
|
|
36991
|
+
"stroke-linecap",
|
|
36992
|
+
"stroke-linejoin",
|
|
36993
|
+
"stroke-miterlimit",
|
|
36994
|
+
"stroke-opacity",
|
|
36995
|
+
"stroke",
|
|
36996
|
+
"stroke-width",
|
|
36997
|
+
"style",
|
|
36998
|
+
"surfacescale",
|
|
36999
|
+
"systemlanguage",
|
|
37000
|
+
"tabindex",
|
|
37001
|
+
"tablevalues",
|
|
37002
|
+
"targetx",
|
|
37003
|
+
"targety",
|
|
37004
|
+
"transform",
|
|
37005
|
+
"transform-origin",
|
|
37006
|
+
"text-anchor",
|
|
37007
|
+
"text-decoration",
|
|
37008
|
+
"text-orientation",
|
|
37009
|
+
"text-rendering",
|
|
37010
|
+
"textlength",
|
|
37011
|
+
"type",
|
|
37012
|
+
"u1",
|
|
37013
|
+
"u2",
|
|
37014
|
+
"unicode",
|
|
37015
|
+
"values",
|
|
37016
|
+
"vector-effect",
|
|
37017
|
+
"viewbox",
|
|
37018
|
+
"visibility",
|
|
37019
|
+
"version",
|
|
37020
|
+
"vert-adv-y",
|
|
37021
|
+
"vert-origin-x",
|
|
37022
|
+
"vert-origin-y",
|
|
37023
|
+
"width",
|
|
37024
|
+
"word-spacing",
|
|
37025
|
+
"wrap",
|
|
37026
|
+
"writing-mode",
|
|
37027
|
+
"xchannelselector",
|
|
37028
|
+
"ychannelselector",
|
|
37029
|
+
"x",
|
|
37030
|
+
"x1",
|
|
37031
|
+
"x2",
|
|
37032
|
+
"xmlns",
|
|
37033
|
+
"y",
|
|
37034
|
+
"y1",
|
|
37035
|
+
"y2",
|
|
37036
|
+
"z",
|
|
37037
|
+
"zoomandpan"
|
|
37038
|
+
]);
|
|
37039
|
+
var mathMl = freeze([
|
|
37040
|
+
"accent",
|
|
37041
|
+
"accentunder",
|
|
37042
|
+
"align",
|
|
37043
|
+
"bevelled",
|
|
37044
|
+
"close",
|
|
37045
|
+
"columnalign",
|
|
37046
|
+
"columnlines",
|
|
37047
|
+
"columnspacing",
|
|
37048
|
+
"columnspan",
|
|
37049
|
+
"denomalign",
|
|
37050
|
+
"depth",
|
|
37051
|
+
"dir",
|
|
37052
|
+
"display",
|
|
37053
|
+
"displaystyle",
|
|
37054
|
+
"encoding",
|
|
37055
|
+
"fence",
|
|
37056
|
+
"frame",
|
|
37057
|
+
"height",
|
|
37058
|
+
"href",
|
|
37059
|
+
"id",
|
|
37060
|
+
"largeop",
|
|
37061
|
+
"length",
|
|
37062
|
+
"linethickness",
|
|
37063
|
+
"lquote",
|
|
37064
|
+
"lspace",
|
|
37065
|
+
"mathbackground",
|
|
37066
|
+
"mathcolor",
|
|
37067
|
+
"mathsize",
|
|
37068
|
+
"mathvariant",
|
|
37069
|
+
"maxsize",
|
|
37070
|
+
"minsize",
|
|
37071
|
+
"movablelimits",
|
|
37072
|
+
"notation",
|
|
37073
|
+
"numalign",
|
|
37074
|
+
"open",
|
|
37075
|
+
"rowalign",
|
|
37076
|
+
"rowlines",
|
|
37077
|
+
"rowspacing",
|
|
37078
|
+
"rowspan",
|
|
37079
|
+
"rspace",
|
|
37080
|
+
"rquote",
|
|
37081
|
+
"scriptlevel",
|
|
37082
|
+
"scriptminsize",
|
|
37083
|
+
"scriptsizemultiplier",
|
|
37084
|
+
"selection",
|
|
37085
|
+
"separator",
|
|
37086
|
+
"separators",
|
|
37087
|
+
"stretchy",
|
|
37088
|
+
"subscriptshift",
|
|
37089
|
+
"supscriptshift",
|
|
37090
|
+
"symmetric",
|
|
37091
|
+
"voffset",
|
|
37092
|
+
"width",
|
|
37093
|
+
"xmlns"
|
|
37094
|
+
]);
|
|
37095
|
+
var xml = freeze([
|
|
37096
|
+
"xlink:href",
|
|
37097
|
+
"xml:id",
|
|
37098
|
+
"xlink:title",
|
|
37099
|
+
"xml:space",
|
|
37100
|
+
"xmlns:xlink"
|
|
37101
|
+
]);
|
|
37102
|
+
var MUSTACHE_EXPR = seal(/{{[\w\W]*|^[\w\W]*}}/g);
|
|
37103
|
+
var ERB_EXPR = seal(/<%[\w\W]*|^[\w\W]*%>/g);
|
|
37104
|
+
var TMPLIT_EXPR = seal(/\${[\w\W]*/g);
|
|
37105
|
+
var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/);
|
|
37106
|
+
var ARIA_ATTR = seal(/^aria-[\-\w]+$/);
|
|
37107
|
+
var IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i);
|
|
37108
|
+
var IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
|
|
37109
|
+
var ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g);
|
|
37110
|
+
var DOCTYPE_NAME = seal(/^html$/i);
|
|
37111
|
+
var CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
37112
|
+
var ELEMENT_MARKUP_PROBE = seal(/<[/\w!]/g);
|
|
37113
|
+
var COMMENT_MARKUP_PROBE = seal(/<[/\w]/g);
|
|
37114
|
+
var FALLBACK_TAG_CLOSE = seal(/<\/no(script|embed|frames)/i);
|
|
37115
|
+
var SELF_CLOSING_TAG = seal(/\/>/i);
|
|
37116
|
+
var NODE_TYPE = {
|
|
37117
|
+
element: 1,
|
|
37118
|
+
attribute: 2,
|
|
37119
|
+
text: 3,
|
|
37120
|
+
cdataSection: 4,
|
|
37121
|
+
entityReference: 5,
|
|
37122
|
+
entityNode: 6,
|
|
37123
|
+
processingInstruction: 7,
|
|
37124
|
+
comment: 8,
|
|
37125
|
+
document: 9,
|
|
37126
|
+
documentType: 10,
|
|
37127
|
+
documentFragment: 11,
|
|
37128
|
+
notation: 12
|
|
37129
|
+
};
|
|
37130
|
+
var LITERAL_TEXT_ELEMENT_NAMES = [
|
|
37131
|
+
"style",
|
|
37132
|
+
"script",
|
|
37133
|
+
"xmp",
|
|
37134
|
+
"iframe",
|
|
37135
|
+
"noembed",
|
|
37136
|
+
"noframes",
|
|
37137
|
+
"plaintext",
|
|
37138
|
+
"noscript"
|
|
37139
|
+
];
|
|
37140
|
+
var LITERAL_TEXT_ELEMENTS = freeze(addToSet({}, LITERAL_TEXT_ELEMENT_NAMES));
|
|
37141
|
+
var LITERAL_TEXT_CLOSE = function() {
|
|
37142
|
+
const map = {};
|
|
37143
|
+
arrayForEach(LITERAL_TEXT_ELEMENT_NAMES, (name) => {
|
|
37144
|
+
map[name] = seal(new RegExp("</" + name + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
37145
|
+
});
|
|
37146
|
+
return freeze(map);
|
|
37147
|
+
}();
|
|
37148
|
+
var getGlobal = function getGlobal() {
|
|
37149
|
+
return typeof window === "undefined" ? null : window;
|
|
37150
|
+
};
|
|
37151
|
+
/**
|
|
37152
|
+
* Creates a no-op policy for internal use only.
|
|
37153
|
+
* Don't export this function outside this module!
|
|
37154
|
+
* @param trustedTypes The policy factory.
|
|
37155
|
+
* @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
|
|
37156
|
+
* @return The policy created (or null, if Trusted Types
|
|
37157
|
+
* are not supported or creating the policy failed).
|
|
37158
|
+
*/
|
|
37159
|
+
var _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
|
|
37160
|
+
if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") return null;
|
|
37161
|
+
let suffix = null;
|
|
37162
|
+
const ATTR_NAME = "data-tt-policy-suffix";
|
|
37163
|
+
if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) suffix = purifyHostElement.getAttribute(ATTR_NAME);
|
|
37164
|
+
const policyName = "dompurify" + (suffix ? "#" + suffix : "");
|
|
37165
|
+
try {
|
|
37166
|
+
return trustedTypes.createPolicy(policyName, {
|
|
37167
|
+
createHTML(html) {
|
|
37168
|
+
return html;
|
|
37169
|
+
},
|
|
37170
|
+
createScriptURL(scriptUrl) {
|
|
37171
|
+
return scriptUrl;
|
|
37172
|
+
}
|
|
37173
|
+
});
|
|
37174
|
+
} catch (_) {
|
|
37175
|
+
console.warn("TrustedTypes policy " + policyName + " could not be created.");
|
|
37176
|
+
return null;
|
|
37177
|
+
}
|
|
37178
|
+
};
|
|
37179
|
+
var _createHooksMap = function _createHooksMap() {
|
|
37180
|
+
return {
|
|
37181
|
+
afterSanitizeAttributes: [],
|
|
37182
|
+
afterSanitizeElements: [],
|
|
37183
|
+
afterSanitizeShadowDOM: [],
|
|
37184
|
+
beforeSanitizeAttributes: [],
|
|
37185
|
+
beforeSanitizeElements: [],
|
|
37186
|
+
beforeSanitizeShadowDOM: [],
|
|
37187
|
+
uponSanitizeAttribute: [],
|
|
37188
|
+
uponSanitizeElement: [],
|
|
37189
|
+
uponSanitizeShadowNode: []
|
|
37190
|
+
};
|
|
37191
|
+
};
|
|
37192
|
+
/**
|
|
37193
|
+
* Resolve a set-valued configuration option: a fresh set built from
|
|
37194
|
+
* cfg[key] when it is an own array property (seeded with a clone of
|
|
37195
|
+
* options.base when given, case-normalized via options.transform),
|
|
37196
|
+
* the fallback set otherwise.
|
|
37197
|
+
*
|
|
37198
|
+
* @param cfg the cloned, prototype-free configuration object
|
|
37199
|
+
* @param key the configuration property to read
|
|
37200
|
+
* @param fallback the set to use when the option is absent or not an array
|
|
37201
|
+
* @param options transform and optional base set to merge into
|
|
37202
|
+
* @returns the resolved set
|
|
37203
|
+
*/
|
|
37204
|
+
var _resolveSetOption = function _resolveSetOption(cfg, key, fallback, options) {
|
|
37205
|
+
return objectHasOwnProperty(cfg, key) && arrayIsArray(cfg[key]) ? addToSet(options.base ? clone(options.base) : {}, cfg[key], options.transform) : fallback;
|
|
37206
|
+
};
|
|
37207
|
+
/**
|
|
37208
|
+
* Resolve an object-valued configuration option: a prototype-free clone
|
|
37209
|
+
* of cfg[key] when it is an own, truthy object property, else a fresh
|
|
37210
|
+
* fallback built by makeFallback (fresh on every parse, so a previous
|
|
37211
|
+
* parse can never leak state into the next one).
|
|
37212
|
+
*
|
|
37213
|
+
* @param cfg the cloned, prototype-free configuration object
|
|
37214
|
+
* @param key the configuration property to read
|
|
37215
|
+
* @param makeFallback builds the fallback value when the option is absent
|
|
37216
|
+
* @returns the resolved object
|
|
37217
|
+
*/
|
|
37218
|
+
var _resolveObjectOption = function _resolveObjectOption(cfg, key, makeFallback) {
|
|
37219
|
+
const value = objectHasOwnProperty(cfg, key) ? cfg[key] : void 0;
|
|
37220
|
+
return value && typeof value === "object" ? clone(value) : makeFallback();
|
|
37221
|
+
};
|
|
37222
|
+
function createDOMPurify() {
|
|
37223
|
+
let window = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
|
|
37224
|
+
const DOMPurify = (root) => createDOMPurify(root);
|
|
37225
|
+
DOMPurify.version = "3.4.16";
|
|
37226
|
+
DOMPurify.removed = [];
|
|
37227
|
+
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
|
|
37228
|
+
DOMPurify.isSupported = false;
|
|
37229
|
+
return DOMPurify;
|
|
37230
|
+
}
|
|
37231
|
+
let document = window.document;
|
|
37232
|
+
const originalDocument = document;
|
|
37233
|
+
const currentScript = originalDocument.currentScript;
|
|
37234
|
+
window.DocumentFragment;
|
|
37235
|
+
const HTMLTemplateElement = window.HTMLTemplateElement, Node = window.Node, Element = window.Element, NodeFilter = window.NodeFilter;
|
|
37236
|
+
window.NamedNodeMap === void 0 && (window.NamedNodeMap || window.MozNamedAttrMap);
|
|
37237
|
+
window.HTMLFormElement;
|
|
37238
|
+
const DOMParser = window.DOMParser, trustedTypes = window.trustedTypes;
|
|
37239
|
+
const ElementPrototype = Element.prototype;
|
|
37240
|
+
const cloneNode = lookupGetter(ElementPrototype, "cloneNode");
|
|
37241
|
+
const remove = lookupGetter(ElementPrototype, "remove");
|
|
37242
|
+
const removeAttributeNode = lookupGetter(ElementPrototype, "removeAttributeNode");
|
|
37243
|
+
const getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
|
|
37244
|
+
const getChildNodes = lookupGetter(ElementPrototype, "childNodes");
|
|
37245
|
+
const getParentNode = lookupGetter(ElementPrototype, "parentNode");
|
|
37246
|
+
const getShadowRoot = lookupGetter(ElementPrototype, "shadowRoot");
|
|
37247
|
+
const getAttributes = lookupGetter(ElementPrototype, "attributes");
|
|
37248
|
+
const getNodeType = Node && Node.prototype ? lookupGetter(Node.prototype, "nodeType") : null;
|
|
37249
|
+
const getNodeName = Node && Node.prototype ? lookupGetter(Node.prototype, "nodeName") : null;
|
|
37250
|
+
const getOwnerDocument = Node && Node.prototype ? lookupGetter(Node.prototype, "ownerDocument") : null;
|
|
37251
|
+
const _readNodeType = function _readNodeType(node) {
|
|
37252
|
+
return getNodeType ? getNodeType(node) : node.nodeType;
|
|
37253
|
+
};
|
|
37254
|
+
const _readNodeName = function _readNodeName(node) {
|
|
37255
|
+
return getNodeName ? getNodeName(node) : node.nodeName;
|
|
37256
|
+
};
|
|
37257
|
+
if (typeof HTMLTemplateElement === "function") {
|
|
37258
|
+
const template = document.createElement("template");
|
|
37259
|
+
if (template.content && template.content.ownerDocument) document = template.content.ownerDocument;
|
|
37260
|
+
}
|
|
37261
|
+
let trustedTypesPolicy;
|
|
37262
|
+
let emptyHTML = "";
|
|
37263
|
+
let defaultTrustedTypesPolicy;
|
|
37264
|
+
let defaultTrustedTypesPolicyResolved = false;
|
|
37265
|
+
let IN_TRUSTED_TYPES_POLICY = 0;
|
|
37266
|
+
const _assertNotInTrustedTypesPolicy = function _assertNotInTrustedTypesPolicy() {
|
|
37267
|
+
if (IN_TRUSTED_TYPES_POLICY > 0) 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.");
|
|
37268
|
+
};
|
|
37269
|
+
const _createTrustedHTML = function _createTrustedHTML(html) {
|
|
37270
|
+
_assertNotInTrustedTypesPolicy();
|
|
37271
|
+
IN_TRUSTED_TYPES_POLICY++;
|
|
37272
|
+
try {
|
|
37273
|
+
return trustedTypesPolicy.createHTML(html);
|
|
37274
|
+
} finally {
|
|
37275
|
+
IN_TRUSTED_TYPES_POLICY--;
|
|
37276
|
+
}
|
|
37277
|
+
};
|
|
37278
|
+
const _createTrustedScriptURL = function _createTrustedScriptURL(scriptUrl) {
|
|
37279
|
+
_assertNotInTrustedTypesPolicy();
|
|
37280
|
+
IN_TRUSTED_TYPES_POLICY++;
|
|
37281
|
+
try {
|
|
37282
|
+
return trustedTypesPolicy.createScriptURL(scriptUrl);
|
|
37283
|
+
} finally {
|
|
37284
|
+
IN_TRUSTED_TYPES_POLICY--;
|
|
37285
|
+
}
|
|
37286
|
+
};
|
|
37287
|
+
const _getDefaultTrustedTypesPolicy = function _getDefaultTrustedTypesPolicy() {
|
|
37288
|
+
if (!defaultTrustedTypesPolicyResolved) {
|
|
37289
|
+
defaultTrustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
|
|
37290
|
+
defaultTrustedTypesPolicyResolved = true;
|
|
37291
|
+
}
|
|
37292
|
+
return defaultTrustedTypesPolicy;
|
|
37293
|
+
};
|
|
37294
|
+
const _document = document, implementation = _document.implementation, createNodeIterator = _document.createNodeIterator, createDocumentFragment = _document.createDocumentFragment, getElementsByTagName = _document.getElementsByTagName;
|
|
37295
|
+
const importNode = originalDocument.importNode;
|
|
37296
|
+
let hooks = _createHooksMap();
|
|
37297
|
+
/**
|
|
37298
|
+
* Expose whether this browser supports running the full DOMPurify.
|
|
37299
|
+
*/
|
|
37300
|
+
DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && implementation.createHTMLDocument !== void 0;
|
|
37301
|
+
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;
|
|
37302
|
+
let IS_ALLOWED_URI$1 = IS_ALLOWED_URI;
|
|
37303
|
+
/**
|
|
37304
|
+
* We consider the elements and attributes below to be safe. Ideally
|
|
37305
|
+
* don't add any new ones but feel free to remove unwanted ones.
|
|
37306
|
+
*/
|
|
37307
|
+
let ALLOWED_TAGS = null;
|
|
37308
|
+
const DEFAULT_ALLOWED_TAGS = addToSet({}, [
|
|
37309
|
+
...html$1,
|
|
37310
|
+
...svg$1,
|
|
37311
|
+
...svgFilters,
|
|
37312
|
+
...mathMl$1,
|
|
37313
|
+
...text
|
|
37314
|
+
]);
|
|
37315
|
+
let ALLOWED_ATTR = null;
|
|
37316
|
+
const DEFAULT_ALLOWED_ATTR = addToSet({}, [
|
|
37317
|
+
...html,
|
|
37318
|
+
...svg,
|
|
37319
|
+
...mathMl,
|
|
37320
|
+
...xml
|
|
37321
|
+
]);
|
|
37322
|
+
let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
|
|
37323
|
+
tagNameCheck: {
|
|
37324
|
+
writable: true,
|
|
37325
|
+
configurable: false,
|
|
37326
|
+
enumerable: true,
|
|
37327
|
+
value: null
|
|
37328
|
+
},
|
|
37329
|
+
attributeNameCheck: {
|
|
37330
|
+
writable: true,
|
|
37331
|
+
configurable: false,
|
|
37332
|
+
enumerable: true,
|
|
37333
|
+
value: null
|
|
37334
|
+
},
|
|
37335
|
+
allowCustomizedBuiltInElements: {
|
|
37336
|
+
writable: true,
|
|
37337
|
+
configurable: false,
|
|
37338
|
+
enumerable: true,
|
|
37339
|
+
value: false
|
|
37340
|
+
}
|
|
37341
|
+
}));
|
|
37342
|
+
let FORBID_TAGS = null;
|
|
37343
|
+
let FORBID_ATTR = null;
|
|
37344
|
+
const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {
|
|
37345
|
+
tagCheck: {
|
|
37346
|
+
writable: true,
|
|
37347
|
+
configurable: false,
|
|
37348
|
+
enumerable: true,
|
|
37349
|
+
value: null
|
|
37350
|
+
},
|
|
37351
|
+
attributeCheck: {
|
|
37352
|
+
writable: true,
|
|
37353
|
+
configurable: false,
|
|
37354
|
+
enumerable: true,
|
|
37355
|
+
value: null
|
|
37356
|
+
}
|
|
37357
|
+
}));
|
|
37358
|
+
let ALLOW_ARIA_ATTR = true;
|
|
37359
|
+
let ALLOW_DATA_ATTR = true;
|
|
37360
|
+
let ALLOW_UNKNOWN_PROTOCOLS = false;
|
|
37361
|
+
let ALLOW_SELF_CLOSE_IN_ATTR = true;
|
|
37362
|
+
let SAFE_FOR_TEMPLATES = false;
|
|
37363
|
+
let SAFE_FOR_XML = true;
|
|
37364
|
+
let WHOLE_DOCUMENT = false;
|
|
37365
|
+
let SET_CONFIG = false;
|
|
37366
|
+
let SET_CONFIG_ALLOWED_TAGS = null;
|
|
37367
|
+
let SET_CONFIG_ALLOWED_ATTR = null;
|
|
37368
|
+
let FORCE_BODY = false;
|
|
37369
|
+
let RETURN_DOM = false;
|
|
37370
|
+
let RETURN_DOM_FRAGMENT = false;
|
|
37371
|
+
let RETURN_TRUSTED_TYPE = false;
|
|
37372
|
+
let SANITIZE_DOM = true;
|
|
37373
|
+
let SANITIZE_NAMED_PROPS = false;
|
|
37374
|
+
const SANITIZE_NAMED_PROPS_PREFIX = "user-content-";
|
|
37375
|
+
let KEEP_CONTENT = true;
|
|
37376
|
+
let IN_PLACE = false;
|
|
37377
|
+
let USE_PROFILES = {};
|
|
37378
|
+
let FORBID_CONTENTS = null;
|
|
37379
|
+
const DEFAULT_FORBID_CONTENTS = addToSet({}, [
|
|
37380
|
+
"annotation-xml",
|
|
37381
|
+
"audio",
|
|
37382
|
+
"colgroup",
|
|
37383
|
+
"desc",
|
|
37384
|
+
"foreignobject",
|
|
37385
|
+
"head",
|
|
37386
|
+
"iframe",
|
|
37387
|
+
"math",
|
|
37388
|
+
"mi",
|
|
37389
|
+
"mn",
|
|
37390
|
+
"mo",
|
|
37391
|
+
"ms",
|
|
37392
|
+
"mtext",
|
|
37393
|
+
"noembed",
|
|
37394
|
+
"noframes",
|
|
37395
|
+
"noscript",
|
|
37396
|
+
"plaintext",
|
|
37397
|
+
"script",
|
|
37398
|
+
"selectedcontent",
|
|
37399
|
+
"style",
|
|
37400
|
+
"svg",
|
|
37401
|
+
"template",
|
|
37402
|
+
"thead",
|
|
37403
|
+
"title",
|
|
37404
|
+
"video",
|
|
37405
|
+
"xmp"
|
|
37406
|
+
]);
|
|
37407
|
+
let DATA_URI_TAGS = null;
|
|
37408
|
+
const DEFAULT_DATA_URI_TAGS = addToSet({}, [
|
|
37409
|
+
"audio",
|
|
37410
|
+
"video",
|
|
37411
|
+
"img",
|
|
37412
|
+
"source",
|
|
37413
|
+
"image",
|
|
37414
|
+
"track"
|
|
37415
|
+
]);
|
|
37416
|
+
let URI_SAFE_ATTRIBUTES = null;
|
|
37417
|
+
const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [
|
|
37418
|
+
"alt",
|
|
37419
|
+
"class",
|
|
37420
|
+
"for",
|
|
37421
|
+
"id",
|
|
37422
|
+
"label",
|
|
37423
|
+
"name",
|
|
37424
|
+
"pattern",
|
|
37425
|
+
"placeholder",
|
|
37426
|
+
"role",
|
|
37427
|
+
"summary",
|
|
37428
|
+
"title",
|
|
37429
|
+
"value",
|
|
37430
|
+
"style",
|
|
37431
|
+
"xmlns"
|
|
37432
|
+
]);
|
|
37433
|
+
const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
|
|
37434
|
+
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
|
37435
|
+
const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
|
|
37436
|
+
let NAMESPACE = HTML_NAMESPACE;
|
|
37437
|
+
let IS_EMPTY_INPUT = false;
|
|
37438
|
+
let ALLOWED_NAMESPACES = null;
|
|
37439
|
+
const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [
|
|
37440
|
+
MATHML_NAMESPACE,
|
|
37441
|
+
SVG_NAMESPACE,
|
|
37442
|
+
HTML_NAMESPACE
|
|
37443
|
+
], stringToString);
|
|
37444
|
+
const DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze([
|
|
37445
|
+
"mi",
|
|
37446
|
+
"mo",
|
|
37447
|
+
"mn",
|
|
37448
|
+
"ms",
|
|
37449
|
+
"mtext"
|
|
37450
|
+
]);
|
|
37451
|
+
let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);
|
|
37452
|
+
const DEFAULT_HTML_INTEGRATION_POINTS = freeze(["annotation-xml"]);
|
|
37453
|
+
let HTML_INTEGRATION_POINTS = addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS);
|
|
37454
|
+
const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [
|
|
37455
|
+
"title",
|
|
37456
|
+
"style",
|
|
37457
|
+
"font",
|
|
37458
|
+
"a",
|
|
37459
|
+
"script"
|
|
37460
|
+
]);
|
|
37461
|
+
let PARSER_MEDIA_TYPE = null;
|
|
37462
|
+
const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
|
|
37463
|
+
const DEFAULT_PARSER_MEDIA_TYPE = "text/html";
|
|
37464
|
+
let transformCaseFunc = null;
|
|
37465
|
+
let CONFIG = null;
|
|
37466
|
+
const formElement = document.createElement("form");
|
|
37467
|
+
const isRegexOrFunction = function isRegexOrFunction(testValue) {
|
|
37468
|
+
return testValue instanceof RegExp || testValue instanceof Function;
|
|
37469
|
+
};
|
|
37470
|
+
/**
|
|
37471
|
+
* _parseConfig
|
|
37472
|
+
*
|
|
37473
|
+
* @param cfg optional config literal
|
|
37474
|
+
*/
|
|
37475
|
+
const _parseConfig = function _parseConfig() {
|
|
37476
|
+
let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
37477
|
+
if (CONFIG && CONFIG === cfg) return;
|
|
37478
|
+
if (!cfg || typeof cfg !== "object") cfg = {};
|
|
37479
|
+
cfg = clone(cfg);
|
|
37480
|
+
PARSER_MEDIA_TYPE = SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
|
|
37481
|
+
transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase;
|
|
37482
|
+
ALLOWED_TAGS = _resolveSetOption(cfg, "ALLOWED_TAGS", DEFAULT_ALLOWED_TAGS, { transform: transformCaseFunc });
|
|
37483
|
+
ALLOWED_ATTR = _resolveSetOption(cfg, "ALLOWED_ATTR", DEFAULT_ALLOWED_ATTR, { transform: transformCaseFunc });
|
|
37484
|
+
ALLOWED_NAMESPACES = _resolveSetOption(cfg, "ALLOWED_NAMESPACES", DEFAULT_ALLOWED_NAMESPACES, { transform: stringToString });
|
|
37485
|
+
URI_SAFE_ATTRIBUTES = _resolveSetOption(cfg, "ADD_URI_SAFE_ATTR", DEFAULT_URI_SAFE_ATTRIBUTES, {
|
|
37486
|
+
transform: transformCaseFunc,
|
|
37487
|
+
base: DEFAULT_URI_SAFE_ATTRIBUTES
|
|
37488
|
+
});
|
|
37489
|
+
DATA_URI_TAGS = _resolveSetOption(cfg, "ADD_DATA_URI_TAGS", DEFAULT_DATA_URI_TAGS, {
|
|
37490
|
+
transform: transformCaseFunc,
|
|
37491
|
+
base: DEFAULT_DATA_URI_TAGS
|
|
37492
|
+
});
|
|
37493
|
+
FORBID_CONTENTS = _resolveSetOption(cfg, "FORBID_CONTENTS", DEFAULT_FORBID_CONTENTS, { transform: transformCaseFunc });
|
|
37494
|
+
FORBID_TAGS = _resolveSetOption(cfg, "FORBID_TAGS", clone({}), { transform: transformCaseFunc });
|
|
37495
|
+
FORBID_ATTR = _resolveSetOption(cfg, "FORBID_ATTR", clone({}), { transform: transformCaseFunc });
|
|
37496
|
+
USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === "object" ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;
|
|
37497
|
+
ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
|
|
37498
|
+
ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
|
|
37499
|
+
ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
|
|
37500
|
+
ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;
|
|
37501
|
+
SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
|
|
37502
|
+
SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false;
|
|
37503
|
+
WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
|
|
37504
|
+
RETURN_DOM = cfg.RETURN_DOM || false;
|
|
37505
|
+
RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
|
|
37506
|
+
RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;
|
|
37507
|
+
FORCE_BODY = cfg.FORCE_BODY || false;
|
|
37508
|
+
SANITIZE_DOM = cfg.SANITIZE_DOM !== false;
|
|
37509
|
+
SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;
|
|
37510
|
+
KEEP_CONTENT = cfg.KEEP_CONTENT !== false;
|
|
37511
|
+
IN_PLACE = cfg.IN_PLACE || false;
|
|
37512
|
+
IS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI;
|
|
37513
|
+
NAMESPACE = typeof cfg.NAMESPACE === "string" ? cfg.NAMESPACE : HTML_NAMESPACE;
|
|
37514
|
+
MATHML_TEXT_INTEGRATION_POINTS = _resolveObjectOption(cfg, "MATHML_TEXT_INTEGRATION_POINTS", () => addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS));
|
|
37515
|
+
HTML_INTEGRATION_POINTS = _resolveObjectOption(cfg, "HTML_INTEGRATION_POINTS", () => addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS));
|
|
37516
|
+
const customElementHandling = _resolveObjectOption(cfg, "CUSTOM_ELEMENT_HANDLING", () => create(null));
|
|
37517
|
+
CUSTOM_ELEMENT_HANDLING = create(null);
|
|
37518
|
+
if (objectHasOwnProperty(customElementHandling, "tagNameCheck") && isRegexOrFunction(customElementHandling.tagNameCheck)) CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck;
|
|
37519
|
+
if (objectHasOwnProperty(customElementHandling, "attributeNameCheck") && isRegexOrFunction(customElementHandling.attributeNameCheck)) CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck;
|
|
37520
|
+
if (objectHasOwnProperty(customElementHandling, "allowCustomizedBuiltInElements") && typeof customElementHandling.allowCustomizedBuiltInElements === "boolean") CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements;
|
|
37521
|
+
seal(CUSTOM_ELEMENT_HANDLING);
|
|
37522
|
+
if (SAFE_FOR_TEMPLATES) ALLOW_DATA_ATTR = false;
|
|
37523
|
+
if (RETURN_DOM_FRAGMENT) RETURN_DOM = true;
|
|
37524
|
+
if (USE_PROFILES) {
|
|
37525
|
+
ALLOWED_TAGS = addToSet({}, text);
|
|
37526
|
+
ALLOWED_ATTR = create(null);
|
|
37527
|
+
if (USE_PROFILES.html === true) {
|
|
37528
|
+
addToSet(ALLOWED_TAGS, html$1);
|
|
37529
|
+
addToSet(ALLOWED_ATTR, html);
|
|
37530
|
+
}
|
|
37531
|
+
if (USE_PROFILES.svg === true) {
|
|
37532
|
+
addToSet(ALLOWED_TAGS, svg$1);
|
|
37533
|
+
addToSet(ALLOWED_ATTR, svg);
|
|
37534
|
+
addToSet(ALLOWED_ATTR, xml);
|
|
37535
|
+
}
|
|
37536
|
+
if (USE_PROFILES.svgFilters === true) {
|
|
37537
|
+
addToSet(ALLOWED_TAGS, svgFilters);
|
|
37538
|
+
addToSet(ALLOWED_ATTR, svg);
|
|
37539
|
+
addToSet(ALLOWED_ATTR, xml);
|
|
37540
|
+
}
|
|
37541
|
+
if (USE_PROFILES.mathMl === true) {
|
|
37542
|
+
addToSet(ALLOWED_TAGS, mathMl$1);
|
|
37543
|
+
addToSet(ALLOWED_ATTR, mathMl);
|
|
37544
|
+
addToSet(ALLOWED_ATTR, xml);
|
|
37545
|
+
}
|
|
37546
|
+
}
|
|
37547
|
+
EXTRA_ELEMENT_HANDLING.tagCheck = null;
|
|
37548
|
+
EXTRA_ELEMENT_HANDLING.attributeCheck = null;
|
|
37549
|
+
if (objectHasOwnProperty(cfg, "ADD_TAGS")) {
|
|
37550
|
+
if (typeof cfg.ADD_TAGS === "function") EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
|
|
37551
|
+
else if (arrayIsArray(cfg.ADD_TAGS)) {
|
|
37552
|
+
if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) ALLOWED_TAGS = clone(ALLOWED_TAGS);
|
|
37553
|
+
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
|
|
37554
|
+
}
|
|
37555
|
+
}
|
|
37556
|
+
if (objectHasOwnProperty(cfg, "ADD_ATTR")) {
|
|
37557
|
+
if (typeof cfg.ADD_ATTR === "function") EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
|
|
37558
|
+
else if (arrayIsArray(cfg.ADD_ATTR)) {
|
|
37559
|
+
if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
|
37560
|
+
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
|
|
37561
|
+
}
|
|
37562
|
+
}
|
|
37563
|
+
if (objectHasOwnProperty(cfg, "ADD_FORBID_CONTENTS") && arrayIsArray(cfg.ADD_FORBID_CONTENTS)) {
|
|
37564
|
+
if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) FORBID_CONTENTS = clone(FORBID_CONTENTS);
|
|
37565
|
+
addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);
|
|
37566
|
+
}
|
|
37567
|
+
if (KEEP_CONTENT) ALLOWED_TAGS["#text"] = true;
|
|
37568
|
+
if (WHOLE_DOCUMENT) addToSet(ALLOWED_TAGS, [
|
|
37569
|
+
"html",
|
|
37570
|
+
"head",
|
|
37571
|
+
"body"
|
|
37572
|
+
]);
|
|
37573
|
+
if (ALLOWED_TAGS.table) {
|
|
37574
|
+
addToSet(ALLOWED_TAGS, ["tbody"]);
|
|
37575
|
+
delete FORBID_TAGS.tbody;
|
|
37576
|
+
}
|
|
37577
|
+
if (cfg.TRUSTED_TYPES_POLICY) {
|
|
37578
|
+
if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
37579
|
+
if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
37580
|
+
const previousTrustedTypesPolicy = trustedTypesPolicy;
|
|
37581
|
+
trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
|
|
37582
|
+
try {
|
|
37583
|
+
emptyHTML = _createTrustedHTML("");
|
|
37584
|
+
} catch (error) {
|
|
37585
|
+
trustedTypesPolicy = previousTrustedTypesPolicy;
|
|
37586
|
+
throw error;
|
|
37587
|
+
}
|
|
37588
|
+
} else if (cfg.TRUSTED_TYPES_POLICY === null) {
|
|
37589
|
+
trustedTypesPolicy = void 0;
|
|
37590
|
+
emptyHTML = "";
|
|
37591
|
+
} else {
|
|
37592
|
+
if (trustedTypesPolicy === void 0) trustedTypesPolicy = _getDefaultTrustedTypesPolicy();
|
|
37593
|
+
if (trustedTypesPolicy && typeof emptyHTML === "string") emptyHTML = _createTrustedHTML("");
|
|
37594
|
+
}
|
|
37595
|
+
if (freeze) freeze(cfg);
|
|
37596
|
+
CONFIG = cfg;
|
|
37597
|
+
};
|
|
37598
|
+
const ALL_SVG_TAGS = addToSet({}, [
|
|
37599
|
+
...svg$1,
|
|
37600
|
+
...svgFilters,
|
|
37601
|
+
...svgDisallowed
|
|
37602
|
+
]);
|
|
37603
|
+
const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
|
|
37604
|
+
/**
|
|
37605
|
+
* Namespace rules for an element in the SVG namespace.
|
|
37606
|
+
*
|
|
37607
|
+
* @param tagName the element's lowercase tag name
|
|
37608
|
+
* @param parent the (possibly simulated) parent node
|
|
37609
|
+
* @param parentTagName the parent's lowercase tag name
|
|
37610
|
+
* @returns true if a spec-compliant parser could produce this element
|
|
37611
|
+
*/
|
|
37612
|
+
const _checkSvgNamespace = function _checkSvgNamespace(tagName, parent, parentTagName) {
|
|
37613
|
+
if (parent.namespaceURI === HTML_NAMESPACE) return tagName === "svg";
|
|
37614
|
+
if (parent.namespaceURI === MATHML_NAMESPACE) return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
|
37615
|
+
return Boolean(ALL_SVG_TAGS[tagName]);
|
|
37616
|
+
};
|
|
37617
|
+
/**
|
|
37618
|
+
* Namespace rules for an element in the MathML namespace.
|
|
37619
|
+
*
|
|
37620
|
+
* @param tagName the element's lowercase tag name
|
|
37621
|
+
* @param parent the (possibly simulated) parent node
|
|
37622
|
+
* @param parentTagName the parent's lowercase tag name
|
|
37623
|
+
* @returns true if a spec-compliant parser could produce this element
|
|
37624
|
+
*/
|
|
37625
|
+
const _checkMathMlNamespace = function _checkMathMlNamespace(tagName, parent, parentTagName) {
|
|
37626
|
+
if (parent.namespaceURI === HTML_NAMESPACE) return tagName === "math";
|
|
37627
|
+
if (parent.namespaceURI === SVG_NAMESPACE) return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName];
|
|
37628
|
+
return Boolean(ALL_MATHML_TAGS[tagName]);
|
|
37629
|
+
};
|
|
37630
|
+
/**
|
|
37631
|
+
* Namespace rules for an element in the HTML namespace.
|
|
37632
|
+
*
|
|
37633
|
+
* @param tagName the element's lowercase tag name
|
|
37634
|
+
* @param parent the (possibly simulated) parent node
|
|
37635
|
+
* @param parentTagName the parent's lowercase tag name
|
|
37636
|
+
* @returns true if a spec-compliant parser could produce this element
|
|
37637
|
+
*/
|
|
37638
|
+
const _checkHtmlNamespace = function _checkHtmlNamespace(tagName, parent, parentTagName) {
|
|
37639
|
+
if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) return false;
|
|
37640
|
+
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) return false;
|
|
37641
|
+
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
|
|
37642
|
+
};
|
|
37643
|
+
/**
|
|
37644
|
+
* @param element a DOM element whose namespace is being checked
|
|
37645
|
+
* @returns Return false if the element has a
|
|
37646
|
+
* namespace that a spec-compliant parser would never
|
|
37647
|
+
* return. Return true otherwise.
|
|
37648
|
+
*/
|
|
37649
|
+
const _checkValidNamespace = function _checkValidNamespace(element) {
|
|
37650
|
+
let parent = getParentNode(element);
|
|
37651
|
+
if (!parent || !parent.tagName) parent = {
|
|
37652
|
+
namespaceURI: NAMESPACE,
|
|
37653
|
+
tagName: "template"
|
|
37654
|
+
};
|
|
37655
|
+
const tagName = stringToLowerCase(element.tagName);
|
|
37656
|
+
const parentTagName = stringToLowerCase(parent.tagName);
|
|
37657
|
+
if (!ALLOWED_NAMESPACES[element.namespaceURI]) return false;
|
|
37658
|
+
if (element.namespaceURI === SVG_NAMESPACE) return _checkSvgNamespace(tagName, parent, parentTagName);
|
|
37659
|
+
if (element.namespaceURI === MATHML_NAMESPACE) return _checkMathMlNamespace(tagName, parent, parentTagName);
|
|
37660
|
+
if (element.namespaceURI === HTML_NAMESPACE) return _checkHtmlNamespace(tagName, parent, parentTagName);
|
|
37661
|
+
if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element.namespaceURI]) return true;
|
|
37662
|
+
return false;
|
|
37663
|
+
};
|
|
37664
|
+
/**
|
|
37665
|
+
* _forceRemove
|
|
37666
|
+
*
|
|
37667
|
+
* @param node a DOM node
|
|
37668
|
+
*/
|
|
37669
|
+
const _forceRemove = function _forceRemove(node) {
|
|
37670
|
+
arrayPush(DOMPurify.removed, { element: node });
|
|
37671
|
+
try {
|
|
37672
|
+
getParentNode(node).removeChild(node);
|
|
37673
|
+
} catch (_) {
|
|
37674
|
+
remove(node);
|
|
37675
|
+
if (!getParentNode(node)) throw typeErrorCreate("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
37676
|
+
}
|
|
37677
|
+
};
|
|
37678
|
+
/**
|
|
37679
|
+
* _stripAttributeNode
|
|
37680
|
+
*
|
|
37681
|
+
* Remove a single Attr node case/namespace-exactly on an attribute-teardown
|
|
37682
|
+
* path. Name-based removeAttribute() ASCII-lowercases its lookup key for an
|
|
37683
|
+
* HTML element in an HTML document and so silently misses a case-preserved
|
|
37684
|
+
* handler (e.g. `ONERROR` off an XML/XHTML import) - the same defect
|
|
37685
|
+
* _removeAttribute() was fixed for, which a name-based call would reintroduce
|
|
37686
|
+
* on these IN_PLACE teardown paths. Unlike _removeAttribute this does not
|
|
37687
|
+
* record into DOMPurify.removed: the neutralize passes intentionally do not
|
|
37688
|
+
* book-keep. A clobbered/detached node falls back to best-effort name-based
|
|
37689
|
+
* removal.
|
|
37690
|
+
*
|
|
37691
|
+
* @param element the element to strip the attribute from
|
|
37692
|
+
* @param attribute the Attr node to remove
|
|
37693
|
+
* @param name the attribute's name, for the fallback path
|
|
37694
|
+
*/
|
|
37695
|
+
const _stripAttributeNode = function _stripAttributeNode(element, attribute, name) {
|
|
37696
|
+
try {
|
|
37697
|
+
removeAttributeNode(element, attribute);
|
|
37698
|
+
} catch (_) {
|
|
37699
|
+
try {
|
|
37700
|
+
element.removeAttribute(name);
|
|
37701
|
+
} catch (_) {}
|
|
37702
|
+
}
|
|
37703
|
+
};
|
|
37704
|
+
/**
|
|
37705
|
+
* _neutralizeRoot
|
|
37706
|
+
*
|
|
37707
|
+
* Fail-closed teardown of an in-place root after the sanitize walk aborts
|
|
37708
|
+
* (campaign-3 F2). An internal throw mid-walk — e.g. a page-registered
|
|
37709
|
+
* custom element's reaction detaches a node so `_forceRemove`'s deliberate
|
|
37710
|
+
* parentless guard throws, or any other re-entrant engine mutation — would
|
|
37711
|
+
* otherwise leave the caller's *live* tree half-sanitized, with everything
|
|
37712
|
+
* after the abort point still carrying its handlers. There is no safe way
|
|
37713
|
+
* to resume the walk (the tree mutated under us), so we strip the root bare:
|
|
37714
|
+
* remove every child and every attribute, then let the caller's catch see
|
|
37715
|
+
* the original error. Clobber-safe (cached `remove`/`childNodes`/`attributes`
|
|
37716
|
+
* getters; the root was already clobber-pre-flighted at the IN_PLACE entry).
|
|
37717
|
+
*
|
|
37718
|
+
* @param root the in-place root to empty
|
|
37719
|
+
*/
|
|
37720
|
+
const _neutralizeRoot = function _neutralizeRoot(root) {
|
|
37721
|
+
_neutralizeSubtree(root);
|
|
37722
|
+
const childNodes = getChildNodes(root);
|
|
37723
|
+
if (childNodes) {
|
|
37724
|
+
const snapshot = [];
|
|
37725
|
+
arrayForEach(childNodes, (child) => {
|
|
37726
|
+
arrayPush(snapshot, child);
|
|
37727
|
+
});
|
|
37728
|
+
arrayForEach(snapshot, (child) => {
|
|
37729
|
+
try {
|
|
37730
|
+
remove(child);
|
|
37731
|
+
} catch (_) {}
|
|
37732
|
+
});
|
|
37733
|
+
}
|
|
37734
|
+
const attributes = getAttributes(root);
|
|
37735
|
+
if (attributes) for (let i = attributes.length - 1; i >= 0; --i) {
|
|
37736
|
+
const attribute = attributes[i];
|
|
37737
|
+
const name = attribute && attribute.name;
|
|
37738
|
+
if (typeof name === "string") _stripAttributeNode(root, attribute, name);
|
|
37739
|
+
}
|
|
37740
|
+
};
|
|
37741
|
+
/**
|
|
37742
|
+
* _removeAttribute
|
|
37743
|
+
*
|
|
37744
|
+
* Name-based getAttributeNode()/removeAttribute() ASCII-lowercase their
|
|
37745
|
+
* lookup key for HTML elements in an HTML document, so they silently miss an
|
|
37746
|
+
* attribute whose stored qualified name still contains uppercase ASCII
|
|
37747
|
+
* letters. That happens when the node came from a case-preserving source
|
|
37748
|
+
* (an XML/XHTML document imported via importNode(), or createAttributeNS()),
|
|
37749
|
+
* where e.g. `ONERROR` survives the walk: the policy check lowercases to
|
|
37750
|
+
* `onerror` and rejects it, but `removeAttribute('ONERROR')` looks up
|
|
37751
|
+
* `onerror` and finds nothing. Remove the exact Attr node instead, which is
|
|
37752
|
+
* case- and namespace-exact, and fall back to name-based removal only when
|
|
37753
|
+
* the caller could not supply the node.
|
|
37754
|
+
*
|
|
37755
|
+
* @param name an Attribute name
|
|
37756
|
+
* @param element a DOM node
|
|
37757
|
+
* @param attr the exact Attr node to remove, when the caller has it
|
|
37758
|
+
*/
|
|
37759
|
+
const _removeAttribute = function _removeAttribute(name, element, attr) {
|
|
37760
|
+
if (!attr) try {
|
|
37761
|
+
attr = element.getAttributeNode(name);
|
|
37762
|
+
} catch (_) {
|
|
37763
|
+
attr = null;
|
|
37764
|
+
}
|
|
37765
|
+
arrayPush(DOMPurify.removed, {
|
|
37766
|
+
attribute: attr || null,
|
|
37767
|
+
from: element
|
|
37768
|
+
});
|
|
37769
|
+
try {
|
|
37770
|
+
if (attr) removeAttributeNode(element, attr);
|
|
37771
|
+
else element.removeAttribute(name);
|
|
37772
|
+
} catch (_) {
|
|
37773
|
+
try {
|
|
37774
|
+
element.removeAttribute(name);
|
|
37775
|
+
} catch (_) {}
|
|
37776
|
+
}
|
|
37777
|
+
if (name === "is") if (RETURN_DOM || RETURN_DOM_FRAGMENT) try {
|
|
37778
|
+
_forceRemove(element);
|
|
37779
|
+
} catch (_) {}
|
|
37780
|
+
else try {
|
|
37781
|
+
element.setAttribute(name, "");
|
|
37782
|
+
} catch (_) {}
|
|
37783
|
+
};
|
|
37784
|
+
/**
|
|
37785
|
+
* _stripDisallowedAttributes
|
|
37786
|
+
*
|
|
37787
|
+
* Removes every attribute the active configuration does not allow from a
|
|
37788
|
+
* single element, using the same allowlist as the main attribute pass (so
|
|
37789
|
+
* `on*` handlers go, but no `/^on/` blocklist is introduced). Used only to
|
|
37790
|
+
* neutralise nodes that are being discarded from an in-place tree.
|
|
37791
|
+
*
|
|
37792
|
+
* @param element the element to strip
|
|
37793
|
+
*/
|
|
37794
|
+
const _stripDisallowedAttributes = function _stripDisallowedAttributes(element) {
|
|
37795
|
+
const attributes = getAttributes(element);
|
|
37796
|
+
if (!attributes) return;
|
|
37797
|
+
for (let i = attributes.length - 1; i >= 0; --i) {
|
|
37798
|
+
const attribute = attributes[i];
|
|
37799
|
+
const name = attribute && attribute.name;
|
|
37800
|
+
if (typeof name !== "string" || ALLOWED_ATTR[transformCaseFunc(name)]) continue;
|
|
37801
|
+
_stripAttributeNode(element, attribute, name);
|
|
37802
|
+
}
|
|
37803
|
+
};
|
|
37804
|
+
/**
|
|
37805
|
+
* _neutralizeSubtree
|
|
37806
|
+
*
|
|
37807
|
+
* Completes the audit-5 F1 fix across every removal path. The KEEP_CONTENT
|
|
37808
|
+
* move-hoist neutralises only disallowed-tag removals; clobber, mXSS-canary,
|
|
37809
|
+
* namespace, comment, processing-instruction and KEEP_CONTENT:false removals
|
|
37810
|
+
* all drop their subtree wholesale via `_forceRemove`. On the IN_PLACE path
|
|
37811
|
+
* those dropped nodes are detached from the caller's LIVE tree but a
|
|
37812
|
+
* handler-bearing original among them (an `<img onerror>`/`<video>` that was
|
|
37813
|
+
* loading) keeps its queued resource event, which fires in page scope after
|
|
37814
|
+
* sanitize returns. This walks a removed subtree and strips every attribute
|
|
37815
|
+
* the active configuration does not allow — so `on*` handlers are cancelled
|
|
37816
|
+
* through the SAME allowlist that governs kept nodes, not a separate `/^on/`
|
|
37817
|
+
* blocklist. Run synchronously before sanitize returns, i.e. before any
|
|
37818
|
+
* queued event can fire. Hook-free by design: these nodes leave the output,
|
|
37819
|
+
* so firing attribute hooks for them would be surprising. Clobber-safe reads;
|
|
37820
|
+
* a doomed clobbered node may shadow `removeAttribute` (its own attributes are
|
|
37821
|
+
* irrelevant — it is discarded — while its non-clobbered descendants, e.g.
|
|
37822
|
+
* the `<img>`, are reached and scrubbed).
|
|
37823
|
+
*
|
|
37824
|
+
* @param root the root of a removed subtree to neutralise
|
|
37825
|
+
*/
|
|
37826
|
+
const _neutralizeSubtree = function _neutralizeSubtree(root) {
|
|
37827
|
+
const stack = [root];
|
|
37828
|
+
while (stack.length > 0) {
|
|
37829
|
+
const node = stack.pop();
|
|
37830
|
+
if (_readNodeType(node) === NODE_TYPE.element) _stripDisallowedAttributes(node);
|
|
37831
|
+
const childNodes = getChildNodes(node);
|
|
37832
|
+
if (childNodes) for (let i = childNodes.length - 1; i >= 0; --i) stack.push(childNodes[i]);
|
|
37833
|
+
}
|
|
37834
|
+
};
|
|
37835
|
+
/**
|
|
37836
|
+
* _neutralizePatchLinkage
|
|
37837
|
+
*
|
|
37838
|
+
* IN_PLACE entry pre-pass (declarative-partial-updates / streaming
|
|
37839
|
+
* hardening, https://github.com/WICG/declarative-partial-updates).
|
|
37840
|
+
*
|
|
37841
|
+
* The main walk strips patch linkage (`for`/`patchsrc`) and removes range
|
|
37842
|
+
* markers (PIs / markup comments) node-by-node, in document order, AS it
|
|
37843
|
+
* reaches each node. On a live in-place root that leaves a window: from the
|
|
37844
|
+
* moment the root is connected until the walk arrives at a given node, that
|
|
37845
|
+
* node's linkage is live. A patch applied on connection/stream can fire as
|
|
37846
|
+
* a microtask during the walk and inject or teleport an unsanitized DOM
|
|
37847
|
+
* range into a region the iterator has already passed and will not revisit,
|
|
37848
|
+
* so the post-return "tree is sanitized" contract is violated. Sweep the
|
|
37849
|
+
* whole tree once up front and sever every linkage before the walk begins,
|
|
37850
|
+
* closing that window.
|
|
37851
|
+
*
|
|
37852
|
+
* This CANNOT undo a patch that already fired before sanitize ran — that is
|
|
37853
|
+
* the irreducible "do not IN_PLACE a live-connected attacker tree" caveat —
|
|
37854
|
+
* but it closes everything from sanitize-start onward. Gated on SAFE_FOR_XML
|
|
37855
|
+
* to group with the rest of the declarative-partial-updates handling and
|
|
37856
|
+
* stay overridable, consistent with the codebase.
|
|
37857
|
+
*
|
|
37858
|
+
* Clobber-safe traversal (cached childNodes getter); per-node try/catch so a
|
|
37859
|
+
* clobbered root cannot defeat the sweep of its non-clobbered descendants.
|
|
37860
|
+
*
|
|
37861
|
+
* NOTE (pending real-Chrome confirmation, see test/declarative-patch-probe
|
|
37862
|
+
* .html Q1): this mirrors the existing policy of keeping `for` on
|
|
37863
|
+
* <label>/<output>. If the shipping feature can drive a patch through a
|
|
37864
|
+
* surviving `for`-on-label/output + `id` pair, this pre-pass and the
|
|
37865
|
+
* attribute check at _isBasicCustomElement's caller must additionally drop
|
|
37866
|
+
* that pair on the IN_PLACE path. Left as-is until the taxonomy is verified.
|
|
37867
|
+
*
|
|
37868
|
+
* @param root the in-place root to sweep
|
|
37869
|
+
*/
|
|
37870
|
+
/**
|
|
37871
|
+
* Central policy for declarative-partial-updates patch-linkage attributes,
|
|
37872
|
+
* shared by the _neutralizePatchLinkage pre-pass and _isValidAttribute so
|
|
37873
|
+
* the two sites cannot drift: `patchsrc` always links, `for` links
|
|
37874
|
+
* everywhere except on <label>/<output>, and the whole policy is gated on
|
|
37875
|
+
* SAFE_FOR_XML (see the rationale block in _isValidAttribute).
|
|
37876
|
+
*
|
|
37877
|
+
* @param lcName the transformCaseFunc'd attribute name
|
|
37878
|
+
* @param lcTag the transformCaseFunc'd tag name of the carrying element
|
|
37879
|
+
* @return true if the attribute is patch linkage and must be dropped
|
|
37880
|
+
*/
|
|
37881
|
+
const _isPatchLinkageAttribute = function _isPatchLinkageAttribute(lcName, lcTag) {
|
|
37882
|
+
if (!SAFE_FOR_XML) return false;
|
|
37883
|
+
if (lcName === "patchsrc") return true;
|
|
37884
|
+
return lcName === "for" && lcTag !== "label" && lcTag !== "output";
|
|
37885
|
+
};
|
|
37886
|
+
const _neutralizePatchLinkage = function _neutralizePatchLinkage(root) {
|
|
37887
|
+
if (!SAFE_FOR_XML) return;
|
|
37888
|
+
const stack = [root];
|
|
37889
|
+
while (stack.length > 0) {
|
|
37890
|
+
const node = stack.pop();
|
|
37891
|
+
const nodeType = _readNodeType(node);
|
|
37892
|
+
if (nodeType === NODE_TYPE.processingInstruction || nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, node.data)) {
|
|
37893
|
+
try {
|
|
37894
|
+
remove(node);
|
|
37895
|
+
} catch (_) {}
|
|
37896
|
+
continue;
|
|
37897
|
+
}
|
|
37898
|
+
if (nodeType === NODE_TYPE.element) {
|
|
37899
|
+
const element = node;
|
|
37900
|
+
const lcTag = transformCaseFunc(_readNodeName(node));
|
|
37901
|
+
try {
|
|
37902
|
+
if (element.hasAttribute && element.hasAttribute("patchsrc")) element.removeAttribute("patchsrc");
|
|
37903
|
+
if (element.hasAttribute && element.hasAttribute("for") && _isPatchLinkageAttribute("for", lcTag)) element.removeAttribute("for");
|
|
37904
|
+
} catch (_) {}
|
|
37905
|
+
}
|
|
37906
|
+
const childNodes = getChildNodes(node);
|
|
37907
|
+
if (childNodes) for (let i = childNodes.length - 1; i >= 0; --i) stack.push(childNodes[i]);
|
|
37908
|
+
}
|
|
37909
|
+
};
|
|
37910
|
+
/**
|
|
37911
|
+
* _initDocument
|
|
37912
|
+
*
|
|
37913
|
+
* @param dirty - a string of dirty markup
|
|
37914
|
+
* @return a DOM, filled with the dirty markup
|
|
37915
|
+
*/
|
|
37916
|
+
const _initDocument = function _initDocument(dirty) {
|
|
37917
|
+
let doc = null;
|
|
37918
|
+
let leadingWhitespace = null;
|
|
37919
|
+
if (FORCE_BODY) dirty = "<remove></remove>" + dirty;
|
|
37920
|
+
else {
|
|
37921
|
+
const matches = stringMatch(dirty, /^[\r\n\t ]+/);
|
|
37922
|
+
leadingWhitespace = matches && matches[0];
|
|
37923
|
+
}
|
|
37924
|
+
if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) dirty = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + dirty + "</body></html>";
|
|
37925
|
+
const dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty;
|
|
37926
|
+
if (NAMESPACE === HTML_NAMESPACE) try {
|
|
37927
|
+
doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
|
|
37928
|
+
} catch (_) {}
|
|
37929
|
+
if (!doc || !doc.documentElement) {
|
|
37930
|
+
doc = implementation.createDocument(NAMESPACE, "template", null);
|
|
37931
|
+
try {
|
|
37932
|
+
doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
|
|
37933
|
+
} catch (_) {}
|
|
37934
|
+
}
|
|
37935
|
+
const body = doc.body || doc.documentElement;
|
|
37936
|
+
if (dirty && leadingWhitespace) body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
|
|
37937
|
+
if (NAMESPACE === HTML_NAMESPACE) return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0];
|
|
37938
|
+
return WHOLE_DOCUMENT ? doc.documentElement : body;
|
|
37939
|
+
};
|
|
37940
|
+
/**
|
|
37941
|
+
* Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
|
|
37942
|
+
*
|
|
37943
|
+
* @param root The root element or node to start traversing on.
|
|
37944
|
+
* @return The created NodeIterator
|
|
37945
|
+
*/
|
|
37946
|
+
const _createNodeIterator = function _createNodeIterator(root) {
|
|
37947
|
+
const doc = getOwnerDocument ? getOwnerDocument(root) : root.ownerDocument;
|
|
37948
|
+
return createNodeIterator.call(doc || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
|
|
37949
|
+
};
|
|
37950
|
+
/**
|
|
37951
|
+
* Replace template expression syntax (mustache, ERB, template
|
|
37952
|
+
* literal) with a space; shared by all SAFE_FOR_TEMPLATES scrub
|
|
37953
|
+
* sites. Order matters: mustache, then ERB, then template literal.
|
|
37954
|
+
*
|
|
37955
|
+
* @param value the string to scrub
|
|
37956
|
+
* @returns the scrubbed string
|
|
37957
|
+
*/
|
|
37958
|
+
const _stripTemplateExpressions = function _stripTemplateExpressions(value) {
|
|
37959
|
+
value = stringReplace(value, MUSTACHE_EXPR$1, " ");
|
|
37960
|
+
value = stringReplace(value, ERB_EXPR$1, " ");
|
|
37961
|
+
value = stringReplace(value, TMPLIT_EXPR$1, " ");
|
|
37962
|
+
return value;
|
|
37963
|
+
};
|
|
37964
|
+
/**
|
|
37965
|
+
* Strip template-engine expressions ({{...}}, ${...}, <%...%>) from the
|
|
37966
|
+
* character data of an element subtree. Used as the final safety net for
|
|
37967
|
+
* SAFE_FOR_TEMPLATES on every DOM-returning code path so that expressions
|
|
37968
|
+
* which only form after text-node normalization (e.g. fragments split across
|
|
37969
|
+
* stripped elements) cannot survive into a template-evaluating framework.
|
|
37970
|
+
*
|
|
37971
|
+
* Walks text/comment/CDATA/processing-instruction nodes and mutates `.data`
|
|
37972
|
+
* in place rather than round-tripping through innerHTML. This preserves
|
|
37973
|
+
* descendant node references (important for IN_PLACE callers), avoids a
|
|
37974
|
+
* serialize/reparse cycle, and reads literal character data — which means
|
|
37975
|
+
* `<%...%>` in text content matches the ERB regex against its real bytes
|
|
37976
|
+
* instead of the HTML-entity-escaped form innerHTML would produce.
|
|
37977
|
+
*
|
|
37978
|
+
* Attribute values are not visited here; SAFE_FOR_TEMPLATES handling for
|
|
37979
|
+
* attributes is performed during the per-node `_sanitizeAttributes` pass.
|
|
37980
|
+
*
|
|
37981
|
+
* @param node The root element whose character data should be scrubbed.
|
|
37982
|
+
*/
|
|
37983
|
+
const _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node) {
|
|
37984
|
+
var _node$querySelectorAl;
|
|
37985
|
+
node.normalize();
|
|
37986
|
+
const doc = getOwnerDocument ? getOwnerDocument(node) : node.ownerDocument;
|
|
37987
|
+
const walker = createNodeIterator.call(doc || node, node, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);
|
|
37988
|
+
let currentNode = walker.nextNode();
|
|
37989
|
+
while (currentNode) {
|
|
37990
|
+
currentNode.data = _stripTemplateExpressions(currentNode.data);
|
|
37991
|
+
currentNode = walker.nextNode();
|
|
37992
|
+
}
|
|
37993
|
+
const templates = (_node$querySelectorAl = node.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node, "template");
|
|
37994
|
+
if (templates) arrayForEach(templates, (tmpl) => {
|
|
37995
|
+
if (_isDocumentFragment(tmpl.content)) _scrubTemplateExpressions2(tmpl.content);
|
|
37996
|
+
});
|
|
37997
|
+
};
|
|
37998
|
+
/**
|
|
37999
|
+
* _isClobbered
|
|
38000
|
+
*
|
|
38001
|
+
* Detect DOM-clobbering on HTMLFormElement nodes. Form is the only HTML
|
|
38002
|
+
* interface with [LegacyOverrideBuiltIns]; a descendant element with a
|
|
38003
|
+
* `name` attribute matching a prototype property shadows that property
|
|
38004
|
+
* on direct reads. We use this check at the IN_PLACE entry-point and
|
|
38005
|
+
* during attribute sanitization to refuse clobbered forms.
|
|
38006
|
+
*
|
|
38007
|
+
* @param element element to check for clobbering attacks
|
|
38008
|
+
* @return true if clobbered, false if safe
|
|
38009
|
+
*/
|
|
38010
|
+
const _isClobbered = function _isClobbered(element) {
|
|
38011
|
+
const realTagName = getNodeName ? getNodeName(element) : null;
|
|
38012
|
+
if (typeof realTagName !== "string") return false;
|
|
38013
|
+
if (transformCaseFunc(realTagName) !== "form") return false;
|
|
38014
|
+
return typeof element.nodeName !== "string" || typeof element.textContent !== "string" || typeof element.removeChild !== "function" || element.attributes !== getAttributes(element) || typeof element.removeAttribute !== "function" || typeof element.removeAttributeNode !== "function" || typeof element.getAttributeNode !== "function" || typeof element.setAttribute !== "function" || typeof element.namespaceURI !== "string" || typeof element.insertBefore !== "function" || typeof element.hasChildNodes !== "function" || element.nodeType !== getNodeType(element) || element.childNodes !== getChildNodes(element);
|
|
38015
|
+
};
|
|
38016
|
+
/**
|
|
38017
|
+
* Checks whether the given value is a DocumentFragment from any realm.
|
|
38018
|
+
*
|
|
38019
|
+
* The realm-independent replacement reads `nodeType` through the cached
|
|
38020
|
+
* Node.prototype getter and compares to the DOCUMENT_FRAGMENT_NODE
|
|
38021
|
+
* constant (11). nodeType is a numeric value resolved from the node's
|
|
38022
|
+
* internal slot, identical across realms for the same kind of node.
|
|
38023
|
+
*
|
|
38024
|
+
* @param value object to check
|
|
38025
|
+
* @return true if value is a DocumentFragment-shaped node from any realm
|
|
38026
|
+
*/
|
|
38027
|
+
const _isDocumentFragment = function _isDocumentFragment(value) {
|
|
38028
|
+
if (!getNodeType || typeof value !== "object" || value === null) return false;
|
|
38029
|
+
try {
|
|
38030
|
+
return getNodeType(value) === NODE_TYPE.documentFragment;
|
|
38031
|
+
} catch (_) {
|
|
38032
|
+
return false;
|
|
38033
|
+
}
|
|
38034
|
+
};
|
|
38035
|
+
/**
|
|
38036
|
+
* Checks whether the given object is a DOM node, including nodes that
|
|
38037
|
+
* originate from a different window/realm (e.g. an iframe's
|
|
38038
|
+
* contentDocument). The previous `value instanceof Node` check was
|
|
38039
|
+
* realm-bound: nodes from a different window failed it, causing
|
|
38040
|
+
* sanitize() to silently stringify them and reset IN_PLACE to false,
|
|
38041
|
+
* returning the original node unsanitized. See GHSA-4w3q-35jp-p934.
|
|
38042
|
+
*
|
|
38043
|
+
* @param value object to check whether it's a DOM node
|
|
38044
|
+
* @return true if value is a DOM node from any realm
|
|
38045
|
+
*/
|
|
38046
|
+
const _isNode = function _isNode(value) {
|
|
38047
|
+
if (!getNodeType || typeof value !== "object" || value === null) return false;
|
|
38048
|
+
try {
|
|
38049
|
+
return typeof getNodeType(value) === "number";
|
|
38050
|
+
} catch (_) {
|
|
38051
|
+
return false;
|
|
38052
|
+
}
|
|
38053
|
+
};
|
|
38054
|
+
function _executeHooks(hooks, currentNode, data) {
|
|
38055
|
+
if (hooks.length === 0) return;
|
|
38056
|
+
arrayForEach(hooks, (hook) => {
|
|
38057
|
+
hook.call(DOMPurify, currentNode, data, CONFIG);
|
|
38058
|
+
});
|
|
38059
|
+
}
|
|
38060
|
+
/**
|
|
38061
|
+
* Structural-threat checks that condemn a node regardless of the
|
|
38062
|
+
* allowlists: mXSS via namespace confusion, risky CSS construction,
|
|
38063
|
+
* processing instructions, markup-bearing comments. Pure predicate;
|
|
38064
|
+
* the caller removes. Check order is load-bearing.
|
|
38065
|
+
*
|
|
38066
|
+
* @param currentNode the node to inspect
|
|
38067
|
+
* @param tagName the node's transformCaseFunc'd tag name
|
|
38068
|
+
* @return true if the node must be removed
|
|
38069
|
+
*/
|
|
38070
|
+
const _isUnsafeNode = function _isUnsafeNode(currentNode, tagName) {
|
|
38071
|
+
if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) return true;
|
|
38072
|
+
if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && LITERAL_TEXT_ELEMENTS[tagName] && (_isNode(currentNode.firstElementChild) || typeof currentNode.textContent === "string" && regExpTest(LITERAL_TEXT_CLOSE[tagName], currentNode.textContent))) return true;
|
|
38073
|
+
if (currentNode.nodeType === NODE_TYPE.processingInstruction) return true;
|
|
38074
|
+
if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) return true;
|
|
38075
|
+
return false;
|
|
38076
|
+
};
|
|
38077
|
+
/**
|
|
38078
|
+
* Evaluate a CUSTOM_ELEMENT_HANDLING check (a RegExp or a predicate
|
|
38079
|
+
* function, per the validation in _parseConfig) against a name.
|
|
38080
|
+
* Additional arguments are forwarded to predicate functions - the
|
|
38081
|
+
* attributeNameCheck predicate receives the tag name as its second
|
|
38082
|
+
* argument. A null/absent check never matches.
|
|
38083
|
+
*
|
|
38084
|
+
* @param check the configured tagNameCheck / attributeNameCheck value
|
|
38085
|
+
* @param name the name to test
|
|
38086
|
+
* @param args extra arguments forwarded to a predicate function
|
|
38087
|
+
* @return true if the check matches the name
|
|
38088
|
+
*/
|
|
38089
|
+
const _matchesNameCheck = function _matchesNameCheck(check, name) {
|
|
38090
|
+
if (check instanceof RegExp) return regExpTest(check, name);
|
|
38091
|
+
if (check instanceof Function) {
|
|
38092
|
+
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];
|
|
38093
|
+
return Boolean(check(name, ...args));
|
|
38094
|
+
}
|
|
38095
|
+
return false;
|
|
38096
|
+
};
|
|
38097
|
+
/**
|
|
38098
|
+
* Handle a node whose tag is forbidden or not allowlisted: keep
|
|
38099
|
+
* allowed custom elements (false return exits _sanitizeElements
|
|
38100
|
+
* early - the namespace and fallback-tag removal checks are
|
|
38101
|
+
* intentionally skipped for kept custom elements), else hoist
|
|
38102
|
+
* content per KEEP_CONTENT and remove.
|
|
38103
|
+
*
|
|
38104
|
+
* A kept custom element is the ONLY case in which this function
|
|
38105
|
+
* returns false, so the caller uses that return value to run the
|
|
38106
|
+
* afterSanitizeElements hook on the kept element and keep the
|
|
38107
|
+
* element-hook lifecycle consistent with normal allowlisted
|
|
38108
|
+
* elements (GHSA-c2j3-45gr-mqc4).
|
|
38109
|
+
*
|
|
38110
|
+
* @param currentNode the disallowed node
|
|
38111
|
+
* @param tagName the node's transformCaseFunc'd tag name
|
|
38112
|
+
* @return true if the node was removed, false if kept
|
|
38113
|
+
*/
|
|
38114
|
+
const _sanitizeDisallowedNode = function _sanitizeDisallowedNode(currentNode, tagName, root) {
|
|
38115
|
+
if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) return false;
|
|
38116
|
+
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
|
38117
|
+
const parentNode = getParentNode(currentNode);
|
|
38118
|
+
const childNodes = getChildNodes(currentNode);
|
|
38119
|
+
if (childNodes && parentNode) {
|
|
38120
|
+
const childCount = childNodes.length;
|
|
38121
|
+
for (let i = childCount - 1; i >= 0; --i) {
|
|
38122
|
+
const hoisted = currentNode === root ? cloneNode(childNodes[i], true) : childNodes[i];
|
|
38123
|
+
parentNode.insertBefore(hoisted, getNextSibling(currentNode));
|
|
38124
|
+
}
|
|
38125
|
+
}
|
|
38126
|
+
}
|
|
38127
|
+
_forceRemove(currentNode);
|
|
38128
|
+
return true;
|
|
38129
|
+
};
|
|
38130
|
+
/**
|
|
38131
|
+
* Fork a hook-mutable allowlist off its shared binding the first time a
|
|
38132
|
+
* (possibly lazily-installed) uponSanitize* hook is about to see it, so the
|
|
38133
|
+
* hook cannot widen the per-instance default or the setConfig binding by
|
|
38134
|
+
* reference and leak past the call. Returns the set unchanged once it is
|
|
38135
|
+
* already call-local, so repeated calls across elements are idempotent.
|
|
38136
|
+
*
|
|
38137
|
+
* @param hookList the uponSanitize* hook array for this event
|
|
38138
|
+
* @param set the current ALLOWED_TAGS / ALLOWED_ATTR binding
|
|
38139
|
+
* @param defaultSet the per-instance DEFAULT_ALLOWED_* constant
|
|
38140
|
+
* @param setConfigSet the captured setConfig() binding, or null
|
|
38141
|
+
* @return a call-local clone if a hook is present and set is still shared,
|
|
38142
|
+
* else set unchanged
|
|
38143
|
+
*/
|
|
38144
|
+
const _forkSharedAllowlist = function _forkSharedAllowlist(hookList, set, defaultSet, setConfigSet) {
|
|
38145
|
+
if (hookList.length === 0) return set;
|
|
38146
|
+
return set === defaultSet || set === setConfigSet ? clone(set) : set;
|
|
38147
|
+
};
|
|
38148
|
+
/**
|
|
38149
|
+
* Shared guard for a node that a hook has detached from the walk tree,
|
|
38150
|
+
* used after each element-hook site in _sanitizeElements. Detaching is a
|
|
38151
|
+
* long-standing user pattern (issue #469; draw.io-style foreignObject
|
|
38152
|
+
* filtering). Per the cached, unclobberable parentNode getter the node is
|
|
38153
|
+
* genuinely out of the tree, so it can reach neither the serialized
|
|
38154
|
+
* output nor an IN_PLACE live tree; treat it as removed and stop
|
|
38155
|
+
* processing it. Without this guard, the unsafe-node / namespace checks
|
|
38156
|
+
* would call _forceRemove on a parentless node and hit the REPORT-3
|
|
38157
|
+
* fail-closed throw — which exists for nodes DOMPurify wants gone but
|
|
38158
|
+
* *cannot* detach (clobbered / parentless roots), the opposite of a node
|
|
38159
|
+
* that is already safely gone. The walk root is exempt: a detached
|
|
38160
|
+
* IN_PLACE root is legitimate input and must still be fully sanitized,
|
|
38161
|
+
* and a kill-decision on it must keep hitting the REPORT-3 throw.
|
|
38162
|
+
*
|
|
38163
|
+
* Nodes detached by hooks stay the hook's responsibility for placement:
|
|
38164
|
+
* they are not recorded in DOMPurify.removed, so the post-walk IN_PLACE
|
|
38165
|
+
* pass (which iterates DOMPurify.removed) does not reach them. But a
|
|
38166
|
+
* hook-detached subtree can still hold a queued resource-event handler -
|
|
38167
|
+
* e.g. an <img onload> that began loading when the caller built the live
|
|
38168
|
+
* tree - which fires in page scope after sanitize returns even though the
|
|
38169
|
+
* handler never reached the returned tree. That is the audit-5 F1 hazard,
|
|
38170
|
+
* and the documented node.remove() hook pattern walks straight into it.
|
|
38171
|
+
* So on the IN_PLACE path we neutralize the detached subtree inline,
|
|
38172
|
+
* stripping its non-allow-listed attributes before returning, exactly as
|
|
38173
|
+
* the post-walk pass does for _forceRemove'd subtrees.
|
|
38174
|
+
*
|
|
38175
|
+
* @param currentNode the node a hook may have detached
|
|
38176
|
+
* @param root the current walk root
|
|
38177
|
+
* @return true if the node is detached and now handled, false otherwise
|
|
38178
|
+
*/
|
|
38179
|
+
const _handleHookDetachedNode = function _handleHookDetachedNode(currentNode, root) {
|
|
38180
|
+
if (currentNode === root || getParentNode(currentNode) !== null) return false;
|
|
38181
|
+
if (IN_PLACE) _neutralizeSubtree(currentNode);
|
|
38182
|
+
return true;
|
|
38183
|
+
};
|
|
38184
|
+
/**
|
|
38185
|
+
* _sanitizeElements
|
|
38186
|
+
*
|
|
38187
|
+
* @protect nodeName
|
|
38188
|
+
* @protect textContent
|
|
38189
|
+
* @protect removeChild
|
|
38190
|
+
* @param currentNode to check for permission to exist
|
|
38191
|
+
* @return true if node was killed, false if left alive
|
|
38192
|
+
*/
|
|
38193
|
+
const _sanitizeElements = function _sanitizeElements(currentNode, root) {
|
|
38194
|
+
_executeHooks(hooks.beforeSanitizeElements, currentNode, null);
|
|
38195
|
+
if (_handleHookDetachedNode(currentNode, root)) return true;
|
|
38196
|
+
if (_isClobbered(currentNode)) {
|
|
38197
|
+
_forceRemove(currentNode);
|
|
38198
|
+
return true;
|
|
38199
|
+
}
|
|
38200
|
+
const tagName = transformCaseFunc(_readNodeName(currentNode));
|
|
38201
|
+
ALLOWED_TAGS = _forkSharedAllowlist(hooks.uponSanitizeElement, ALLOWED_TAGS, DEFAULT_ALLOWED_TAGS, SET_CONFIG_ALLOWED_TAGS);
|
|
38202
|
+
_executeHooks(hooks.uponSanitizeElement, currentNode, {
|
|
38203
|
+
tagName,
|
|
38204
|
+
allowedTags: ALLOWED_TAGS
|
|
38205
|
+
});
|
|
38206
|
+
if (_handleHookDetachedNode(currentNode, root)) return true;
|
|
38207
|
+
if (_isUnsafeNode(currentNode, tagName)) {
|
|
38208
|
+
_forceRemove(currentNode);
|
|
38209
|
+
return true;
|
|
38210
|
+
}
|
|
38211
|
+
if (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {
|
|
38212
|
+
const removed = _sanitizeDisallowedNode(currentNode, tagName, root);
|
|
38213
|
+
if (removed === false) {
|
|
38214
|
+
_executeHooks(hooks.afterSanitizeElements, currentNode, null);
|
|
38215
|
+
if (_handleHookDetachedNode(currentNode, root)) return true;
|
|
38216
|
+
}
|
|
38217
|
+
return removed;
|
|
38218
|
+
}
|
|
38219
|
+
if (_readNodeType(currentNode) === NODE_TYPE.element && !_checkValidNamespace(currentNode)) {
|
|
38220
|
+
_forceRemove(currentNode);
|
|
38221
|
+
return true;
|
|
38222
|
+
}
|
|
38223
|
+
if ((tagName === "noscript" || tagName === "noembed" || tagName === "noframes") && regExpTest(FALLBACK_TAG_CLOSE, currentNode.innerHTML)) {
|
|
38224
|
+
_forceRemove(currentNode);
|
|
38225
|
+
return true;
|
|
38226
|
+
}
|
|
38227
|
+
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
|
|
38228
|
+
const content = _stripTemplateExpressions(currentNode.textContent);
|
|
38229
|
+
if (currentNode.textContent !== content) {
|
|
38230
|
+
arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });
|
|
38231
|
+
currentNode.textContent = content;
|
|
38232
|
+
}
|
|
38233
|
+
}
|
|
38234
|
+
_executeHooks(hooks.afterSanitizeElements, currentNode, null);
|
|
38235
|
+
return _handleHookDetachedNode(currentNode, root);
|
|
38236
|
+
};
|
|
38237
|
+
/**
|
|
38238
|
+
* _isValidAttribute
|
|
38239
|
+
*
|
|
38240
|
+
* @param lcTag Lowercase tag name of containing element.
|
|
38241
|
+
* @param lcName Lowercase attribute name.
|
|
38242
|
+
* @param value Attribute value.
|
|
38243
|
+
* @return Returns true if `value` is valid, otherwise false.
|
|
38244
|
+
*/
|
|
38245
|
+
const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
|
|
38246
|
+
if (FORBID_ATTR[lcName]) return false;
|
|
38247
|
+
if (_isPatchLinkageAttribute(lcName, lcTag)) return false;
|
|
38248
|
+
if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value in document || value in formElement)) return false;
|
|
38249
|
+
const nameIsPermitted = ALLOWED_ATTR[lcName] || EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag);
|
|
38250
|
+
if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) return true;
|
|
38251
|
+
if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) return true;
|
|
38252
|
+
if (!nameIsPermitted) return _isBasicCustomElement(lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName, lcTag) || lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value);
|
|
38253
|
+
if (URI_SAFE_ATTRIBUTES[lcName]) return true;
|
|
38254
|
+
if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, ""))) return true;
|
|
38255
|
+
if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value, "data:") === 0 && DATA_URI_TAGS[lcTag]) return true;
|
|
38256
|
+
if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value, ATTR_WHITESPACE$1, ""))) return true;
|
|
38257
|
+
return !value;
|
|
38258
|
+
};
|
|
38259
|
+
const RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, [
|
|
38260
|
+
"annotation-xml",
|
|
38261
|
+
"color-profile",
|
|
38262
|
+
"font-face",
|
|
38263
|
+
"font-face-format",
|
|
38264
|
+
"font-face-name",
|
|
38265
|
+
"font-face-src",
|
|
38266
|
+
"font-face-uri",
|
|
38267
|
+
"missing-glyph"
|
|
38268
|
+
]);
|
|
38269
|
+
/**
|
|
38270
|
+
* _isBasicCustomElement
|
|
38271
|
+
* checks if at least one dash is included in tagName, and it's not the first char
|
|
38272
|
+
* for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
|
|
38273
|
+
*
|
|
38274
|
+
* @param tagName name of the tag of the node to sanitize
|
|
38275
|
+
* @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
|
|
38276
|
+
*/
|
|
38277
|
+
const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
|
|
38278
|
+
return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName);
|
|
38279
|
+
};
|
|
38280
|
+
/**
|
|
38281
|
+
* Wrap an attribute value in the matching Trusted Types object when
|
|
38282
|
+
* the active policy requires it. Namespaced attributes pass through
|
|
38283
|
+
* unchanged (no TT support yet, see
|
|
38284
|
+
* https://bugs.chromium.org/p/chromium/issues/detail?id=1305293).
|
|
38285
|
+
*
|
|
38286
|
+
* @param lcTag lowercase tag name of the containing element
|
|
38287
|
+
* @param lcName lowercase attribute name
|
|
38288
|
+
* @param namespaceURI the attribute's namespace, if any
|
|
38289
|
+
* @param value the attribute value to wrap
|
|
38290
|
+
* @return the value, wrapped when Trusted Types demand it
|
|
38291
|
+
*/
|
|
38292
|
+
const _applyTrustedTypesToAttribute = function _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value) {
|
|
38293
|
+
if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function" && !namespaceURI) switch (trustedTypes.getAttributeType(lcTag, lcName)) {
|
|
38294
|
+
case "TrustedHTML": return _createTrustedHTML(value);
|
|
38295
|
+
case "TrustedScriptURL": return _createTrustedScriptURL(value);
|
|
38296
|
+
}
|
|
38297
|
+
return value;
|
|
38298
|
+
};
|
|
38299
|
+
/**
|
|
38300
|
+
* Write a modified attribute value back onto the element. On
|
|
38301
|
+
* success, re-probe for clobbering introduced by the new value and
|
|
38302
|
+
* remove the element when found; otherwise, when this writeback is the
|
|
38303
|
+
* recreate half of the SANITIZE_NAMED_PROPS remove-and-recreate, pop the
|
|
38304
|
+
* removal entry that path recorded so it does not show as removed. On
|
|
38305
|
+
* failure, remove the attribute instead.
|
|
38306
|
+
*
|
|
38307
|
+
* Returns true only on a clean write (the value was set and the new value
|
|
38308
|
+
* introduced no clobbering). The caller uses that, together with its own
|
|
38309
|
+
* knowledge of whether this attribute pushed a DOMPurify.removed record, to
|
|
38310
|
+
* decide whether to pop that record. The pop must happen ONLY for the
|
|
38311
|
+
* named-prop remove-and-recreate; popping on any other value change (trim,
|
|
38312
|
+
* template scrubbing, Trusted Types) would consume an unrelated _forceRemove
|
|
38313
|
+
* subtree-cleanup record and let that detached subtree keep a live event
|
|
38314
|
+
* handler through the IN_PLACE neutralization pass (SO-001).
|
|
38315
|
+
*
|
|
38316
|
+
* @param currentNode the element carrying the attribute
|
|
38317
|
+
* @param name the attribute name as present on the element
|
|
38318
|
+
* @param namespaceURI the attribute's namespace, if any
|
|
38319
|
+
* @param value the new attribute value
|
|
38320
|
+
* @return true if the value was written without introducing clobbering
|
|
38321
|
+
*/
|
|
38322
|
+
const _setAttributeValue = function _setAttributeValue(currentNode, name, namespaceURI, value) {
|
|
38323
|
+
try {
|
|
38324
|
+
if (namespaceURI) currentNode.setAttributeNS(namespaceURI, name, value);
|
|
38325
|
+
else currentNode.setAttribute(name, value);
|
|
38326
|
+
if (_isClobbered(currentNode)) {
|
|
38327
|
+
_forceRemove(currentNode);
|
|
38328
|
+
return false;
|
|
38329
|
+
}
|
|
38330
|
+
return true;
|
|
38331
|
+
} catch (_) {
|
|
38332
|
+
_removeAttribute(name, currentNode);
|
|
38333
|
+
return false;
|
|
38334
|
+
}
|
|
38335
|
+
};
|
|
38336
|
+
/**
|
|
38337
|
+
* _sanitizeAttributes
|
|
38338
|
+
*
|
|
38339
|
+
* @protect attributes
|
|
38340
|
+
* @protect nodeName
|
|
38341
|
+
* @protect removeAttribute
|
|
38342
|
+
* @protect setAttribute
|
|
38343
|
+
*
|
|
38344
|
+
* @param currentNode to sanitize
|
|
38345
|
+
* @param root the current walk root
|
|
38346
|
+
*/
|
|
38347
|
+
const _sanitizeAttributes = function _sanitizeAttributes(currentNode, root) {
|
|
38348
|
+
_executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
|
|
38349
|
+
if (_handleHookDetachedNode(currentNode, root)) return;
|
|
38350
|
+
const attributes = currentNode.attributes;
|
|
38351
|
+
if (!attributes || _isClobbered(currentNode)) return;
|
|
38352
|
+
ALLOWED_ATTR = _forkSharedAllowlist(hooks.uponSanitizeAttribute, ALLOWED_ATTR, DEFAULT_ALLOWED_ATTR, SET_CONFIG_ALLOWED_ATTR);
|
|
38353
|
+
const hookEvent = {
|
|
38354
|
+
attrName: "",
|
|
38355
|
+
attrValue: "",
|
|
38356
|
+
keepAttr: true,
|
|
38357
|
+
allowedAttributes: ALLOWED_ATTR,
|
|
38358
|
+
forceKeepAttr: void 0
|
|
38359
|
+
};
|
|
38360
|
+
let l = attributes.length;
|
|
38361
|
+
const lcTag = transformCaseFunc(currentNode.nodeName);
|
|
38362
|
+
while (l--) {
|
|
38363
|
+
const attr = attributes[l];
|
|
38364
|
+
const name = attr.name, namespaceURI = attr.namespaceURI, attrValue = attr.value;
|
|
38365
|
+
const lcName = transformCaseFunc(name);
|
|
38366
|
+
const initValue = attrValue;
|
|
38367
|
+
let value = name === "value" ? initValue : stringTrim(initValue);
|
|
38368
|
+
let recreatedNamedProp = false;
|
|
38369
|
+
hookEvent.attrName = lcName;
|
|
38370
|
+
hookEvent.attrValue = value;
|
|
38371
|
+
hookEvent.keepAttr = true;
|
|
38372
|
+
hookEvent.forceKeepAttr = void 0;
|
|
38373
|
+
_executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
|
|
38374
|
+
value = hookEvent.attrValue;
|
|
38375
|
+
if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name") && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) {
|
|
38376
|
+
_removeAttribute(name, currentNode, attr);
|
|
38377
|
+
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
|
38378
|
+
recreatedNamedProp = true;
|
|
38379
|
+
}
|
|
38380
|
+
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) {
|
|
38381
|
+
_removeAttribute(name, currentNode, attr);
|
|
38382
|
+
continue;
|
|
38383
|
+
}
|
|
38384
|
+
if (lcName === "attributename" && stringMatch(value, "href")) {
|
|
38385
|
+
_removeAttribute(name, currentNode, attr);
|
|
38386
|
+
continue;
|
|
38387
|
+
}
|
|
38388
|
+
if (hookEvent.forceKeepAttr) continue;
|
|
38389
|
+
if (!hookEvent.keepAttr) {
|
|
38390
|
+
_removeAttribute(name, currentNode, attr);
|
|
38391
|
+
continue;
|
|
38392
|
+
}
|
|
38393
|
+
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value)) {
|
|
38394
|
+
_removeAttribute(name, currentNode, attr);
|
|
38395
|
+
continue;
|
|
38396
|
+
}
|
|
38397
|
+
if (SAFE_FOR_TEMPLATES) value = _stripTemplateExpressions(value);
|
|
38398
|
+
if (!_isValidAttribute(lcTag, lcName, value)) {
|
|
38399
|
+
_removeAttribute(name, currentNode, attr);
|
|
38400
|
+
continue;
|
|
38401
|
+
}
|
|
38402
|
+
value = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);
|
|
38403
|
+
if (value !== initValue) {
|
|
38404
|
+
if (_setAttributeValue(currentNode, name, namespaceURI, value) && recreatedNamedProp) arrayPop(DOMPurify.removed);
|
|
38405
|
+
}
|
|
38406
|
+
}
|
|
38407
|
+
_executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
|
|
38408
|
+
_handleHookDetachedNode(currentNode, root);
|
|
38409
|
+
};
|
|
38410
|
+
/**
|
|
38411
|
+
* _sanitizeShadowDOM
|
|
38412
|
+
*
|
|
38413
|
+
* @param fragment to iterate over recursively
|
|
38414
|
+
*/
|
|
38415
|
+
const _sanitizeShadowDOM2 = function _sanitizeShadowDOM(fragment) {
|
|
38416
|
+
let shadowNode = null;
|
|
38417
|
+
const shadowIterator = _createNodeIterator(fragment);
|
|
38418
|
+
_executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
|
|
38419
|
+
while (shadowNode = shadowIterator.nextNode()) {
|
|
38420
|
+
_executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
|
|
38421
|
+
_sanitizeElements(shadowNode, fragment);
|
|
38422
|
+
_sanitizeAttributes(shadowNode, fragment);
|
|
38423
|
+
if (_isDocumentFragment(shadowNode.content)) _sanitizeShadowDOM2(shadowNode.content);
|
|
38424
|
+
if (_readNodeType(shadowNode) === NODE_TYPE.element) {
|
|
38425
|
+
const innerSr = getShadowRoot(shadowNode);
|
|
38426
|
+
if (_isDocumentFragment(innerSr)) {
|
|
38427
|
+
_sanitizeAttachedShadowRoots(innerSr);
|
|
38428
|
+
_sanitizeShadowDOM2(innerSr);
|
|
38429
|
+
}
|
|
38430
|
+
}
|
|
38431
|
+
}
|
|
38432
|
+
_executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
|
|
38433
|
+
};
|
|
38434
|
+
/**
|
|
38435
|
+
* _sanitizeAttachedShadowRoots
|
|
38436
|
+
*
|
|
38437
|
+
* Walks `root` and feeds every attached shadow root we encounter into
|
|
38438
|
+
* the existing _sanitizeShadowDOM pipeline. The default node iterator
|
|
38439
|
+
* does not descend into shadow trees, so nodes inside an attached
|
|
38440
|
+
* shadow root would otherwise be skipped entirely.
|
|
38441
|
+
*
|
|
38442
|
+
* Two real input paths put attached shadow roots in front of us:
|
|
38443
|
+
* 1. IN_PLACE on a DOM node that already has shadow roots attached.
|
|
38444
|
+
* 2. DOM-node input where importNode(dirty, true) deep-clones the
|
|
38445
|
+
* shadow root because it was created with `clonable: true`.
|
|
38446
|
+
*
|
|
38447
|
+
* This pass runs once, up front, so the main iteration loop (and the
|
|
38448
|
+
* existing _sanitizeShadowDOM template-content recursion) stay
|
|
38449
|
+
* untouched — string-input paths are not affected.
|
|
38450
|
+
*
|
|
38451
|
+
* @param root the subtree root to walk for attached shadow roots
|
|
38452
|
+
*/
|
|
38453
|
+
const _sanitizeAttachedShadowRoots = function _sanitizeAttachedShadowRoots(root) {
|
|
38454
|
+
const stack = [{
|
|
38455
|
+
node: root,
|
|
38456
|
+
shadow: null
|
|
38457
|
+
}];
|
|
38458
|
+
while (stack.length > 0) {
|
|
38459
|
+
const item = stack.pop();
|
|
38460
|
+
if (item.shadow) {
|
|
38461
|
+
_sanitizeShadowDOM2(item.shadow);
|
|
38462
|
+
continue;
|
|
38463
|
+
}
|
|
38464
|
+
const node = item.node;
|
|
38465
|
+
const isElement = _readNodeType(node) === NODE_TYPE.element;
|
|
38466
|
+
const childNodes = getChildNodes(node);
|
|
38467
|
+
if (childNodes) for (let i = childNodes.length - 1; i >= 0; --i) stack.push({
|
|
38468
|
+
node: childNodes[i],
|
|
38469
|
+
shadow: null
|
|
38470
|
+
});
|
|
38471
|
+
if (isElement) {
|
|
38472
|
+
const rootName = getNodeName ? getNodeName(node) : null;
|
|
38473
|
+
if (typeof rootName === "string" && transformCaseFunc(rootName) === "template") {
|
|
38474
|
+
const content = node.content;
|
|
38475
|
+
if (_isDocumentFragment(content)) stack.push({
|
|
38476
|
+
node: content,
|
|
38477
|
+
shadow: null
|
|
38478
|
+
});
|
|
38479
|
+
}
|
|
38480
|
+
}
|
|
38481
|
+
if (isElement) {
|
|
38482
|
+
const sr = getShadowRoot(node);
|
|
38483
|
+
if (_isDocumentFragment(sr)) stack.push({
|
|
38484
|
+
node: null,
|
|
38485
|
+
shadow: sr
|
|
38486
|
+
}, {
|
|
38487
|
+
node: sr,
|
|
38488
|
+
shadow: null
|
|
38489
|
+
});
|
|
38490
|
+
}
|
|
38491
|
+
}
|
|
38492
|
+
};
|
|
38493
|
+
DOMPurify.sanitize = function(dirty) {
|
|
38494
|
+
let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
38495
|
+
let body = null;
|
|
38496
|
+
let importedNode = null;
|
|
38497
|
+
let currentNode = null;
|
|
38498
|
+
let returnNode = null;
|
|
38499
|
+
IS_EMPTY_INPUT = !dirty;
|
|
38500
|
+
if (IS_EMPTY_INPUT) dirty = "<!-->";
|
|
38501
|
+
if (typeof dirty !== "string" && !_isNode(dirty)) {
|
|
38502
|
+
dirty = stringifyValue(dirty);
|
|
38503
|
+
if (typeof dirty !== "string") throw typeErrorCreate("dirty is not a string, aborting");
|
|
38504
|
+
}
|
|
38505
|
+
if (!DOMPurify.isSupported) return dirty;
|
|
38506
|
+
if (SET_CONFIG) {
|
|
38507
|
+
ALLOWED_TAGS = SET_CONFIG_ALLOWED_TAGS;
|
|
38508
|
+
ALLOWED_ATTR = SET_CONFIG_ALLOWED_ATTR;
|
|
38509
|
+
} else _parseConfig(cfg);
|
|
38510
|
+
if (hooks.uponSanitizeElement.length > 0 || hooks.uponSanitizeAttribute.length > 0) ALLOWED_TAGS = clone(ALLOWED_TAGS);
|
|
38511
|
+
if (hooks.uponSanitizeAttribute.length > 0) ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
|
38512
|
+
DOMPurify.removed = [];
|
|
38513
|
+
const inPlace = IN_PLACE && typeof dirty !== "string" && _isNode(dirty);
|
|
38514
|
+
if (inPlace) {
|
|
38515
|
+
_neutralizePatchLinkage(dirty);
|
|
38516
|
+
const nn = _readNodeName(dirty);
|
|
38517
|
+
if (typeof nn === "string") {
|
|
38518
|
+
const tagName = transformCaseFunc(nn);
|
|
38519
|
+
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
38520
|
+
_neutralizeRoot(dirty);
|
|
38521
|
+
throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
|
|
38522
|
+
}
|
|
38523
|
+
}
|
|
38524
|
+
if (_isClobbered(dirty)) {
|
|
38525
|
+
_neutralizeRoot(dirty);
|
|
38526
|
+
throw typeErrorCreate("root node is clobbered and cannot be sanitized in-place");
|
|
38527
|
+
}
|
|
38528
|
+
try {
|
|
38529
|
+
_sanitizeAttachedShadowRoots(dirty);
|
|
38530
|
+
} catch (error) {
|
|
38531
|
+
_neutralizeRoot(dirty);
|
|
38532
|
+
throw error;
|
|
38533
|
+
}
|
|
38534
|
+
} else if (_isNode(dirty)) {
|
|
38535
|
+
body = _initDocument("<!---->");
|
|
38536
|
+
importedNode = body.ownerDocument.importNode(dirty, true);
|
|
38537
|
+
if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") body = importedNode;
|
|
38538
|
+
else if (importedNode.nodeName === "HTML") body = importedNode;
|
|
38539
|
+
else body.appendChild(importedNode);
|
|
38540
|
+
_sanitizeAttachedShadowRoots(body);
|
|
38541
|
+
} else {
|
|
38542
|
+
if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && dirty.indexOf("<") === -1) return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty;
|
|
38543
|
+
body = _initDocument(dirty);
|
|
38544
|
+
if (!body) return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : "";
|
|
38545
|
+
}
|
|
38546
|
+
if (body && FORCE_BODY) _forceRemove(body.firstChild);
|
|
38547
|
+
const walkRoot = inPlace ? dirty : body;
|
|
38548
|
+
try {
|
|
38549
|
+
const nodeIterator = _createNodeIterator(walkRoot);
|
|
38550
|
+
while (currentNode = nodeIterator.nextNode()) {
|
|
38551
|
+
_sanitizeElements(currentNode, walkRoot);
|
|
38552
|
+
_sanitizeAttributes(currentNode, walkRoot);
|
|
38553
|
+
if (_isDocumentFragment(currentNode.content)) _sanitizeShadowDOM2(currentNode.content);
|
|
38554
|
+
}
|
|
38555
|
+
} catch (error) {
|
|
38556
|
+
if (inPlace) {
|
|
38557
|
+
_neutralizeRoot(dirty);
|
|
38558
|
+
arrayForEach(DOMPurify.removed, (entry) => {
|
|
38559
|
+
if (entry.element) _neutralizeSubtree(entry.element);
|
|
38560
|
+
});
|
|
38561
|
+
}
|
|
38562
|
+
throw error;
|
|
38563
|
+
}
|
|
38564
|
+
if (inPlace) {
|
|
38565
|
+
let rootWasRemoved = false;
|
|
38566
|
+
arrayForEach(DOMPurify.removed, (entry) => {
|
|
38567
|
+
if (entry.element) {
|
|
38568
|
+
if (entry.element === dirty) rootWasRemoved = true;
|
|
38569
|
+
_neutralizeSubtree(entry.element);
|
|
38570
|
+
}
|
|
38571
|
+
});
|
|
38572
|
+
if (rootWasRemoved) throw typeErrorCreate("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
38573
|
+
if (SAFE_FOR_TEMPLATES) _scrubTemplateExpressions2(dirty);
|
|
38574
|
+
return dirty;
|
|
38575
|
+
}
|
|
38576
|
+
if (RETURN_DOM) {
|
|
38577
|
+
if (SAFE_FOR_TEMPLATES) _scrubTemplateExpressions2(body);
|
|
38578
|
+
if (RETURN_DOM_FRAGMENT) {
|
|
38579
|
+
returnNode = createDocumentFragment.call(body.ownerDocument);
|
|
38580
|
+
while (body.firstChild) returnNode.appendChild(body.firstChild);
|
|
38581
|
+
} else returnNode = body;
|
|
38582
|
+
if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) returnNode = importNode.call(originalDocument, returnNode, true);
|
|
38583
|
+
return returnNode;
|
|
38584
|
+
}
|
|
38585
|
+
let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
|
|
38586
|
+
if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) serializedHTML = "<!DOCTYPE " + body.ownerDocument.doctype.name + ">\n" + serializedHTML;
|
|
38587
|
+
if (SAFE_FOR_TEMPLATES) serializedHTML = _stripTemplateExpressions(serializedHTML);
|
|
38588
|
+
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(serializedHTML) : serializedHTML;
|
|
38589
|
+
};
|
|
38590
|
+
DOMPurify.setConfig = function() {
|
|
38591
|
+
let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
38592
|
+
_parseConfig(cfg);
|
|
38593
|
+
SET_CONFIG = true;
|
|
38594
|
+
SET_CONFIG_ALLOWED_TAGS = ALLOWED_TAGS;
|
|
38595
|
+
SET_CONFIG_ALLOWED_ATTR = ALLOWED_ATTR;
|
|
38596
|
+
};
|
|
38597
|
+
DOMPurify.clearConfig = function() {
|
|
38598
|
+
CONFIG = null;
|
|
38599
|
+
SET_CONFIG = false;
|
|
38600
|
+
SET_CONFIG_ALLOWED_TAGS = null;
|
|
38601
|
+
SET_CONFIG_ALLOWED_ATTR = null;
|
|
38602
|
+
trustedTypesPolicy = defaultTrustedTypesPolicy;
|
|
38603
|
+
emptyHTML = "";
|
|
38604
|
+
};
|
|
38605
|
+
DOMPurify.isValidAttribute = function(tag, attr, value) {
|
|
38606
|
+
if (!CONFIG) _parseConfig({});
|
|
38607
|
+
const lcTag = transformCaseFunc(tag);
|
|
38608
|
+
const lcName = transformCaseFunc(attr);
|
|
38609
|
+
return _isValidAttribute(lcTag, lcName, value);
|
|
38610
|
+
};
|
|
38611
|
+
DOMPurify.addHook = function(entryPoint, hookFunction) {
|
|
38612
|
+
if (typeof hookFunction !== "function") return;
|
|
38613
|
+
if (!objectHasOwnProperty(hooks, entryPoint)) return;
|
|
38614
|
+
arrayPush(hooks[entryPoint], hookFunction);
|
|
38615
|
+
};
|
|
38616
|
+
DOMPurify.removeHook = function(entryPoint, hookFunction) {
|
|
38617
|
+
if (!objectHasOwnProperty(hooks, entryPoint)) return;
|
|
38618
|
+
if (hookFunction !== void 0) {
|
|
38619
|
+
const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
|
|
38620
|
+
return index === -1 ? void 0 : arraySplice(hooks[entryPoint], index, 1)[0];
|
|
38621
|
+
}
|
|
38622
|
+
return arrayPop(hooks[entryPoint]);
|
|
38623
|
+
};
|
|
38624
|
+
DOMPurify.removeHooks = function(entryPoint) {
|
|
38625
|
+
if (!objectHasOwnProperty(hooks, entryPoint)) return;
|
|
38626
|
+
hooks[entryPoint] = [];
|
|
38627
|
+
};
|
|
38628
|
+
DOMPurify.removeAllHooks = function() {
|
|
38629
|
+
hooks = _createHooksMap();
|
|
38630
|
+
};
|
|
38631
|
+
return DOMPurify;
|
|
38632
|
+
}
|
|
38633
|
+
var purify_default = createDOMPurify();
|
|
38634
|
+
//#endregion
|
|
38635
|
+
//#region ../../shared/utils/dist/index.js
|
|
38636
|
+
var f$1 = [
|
|
38637
|
+
"script",
|
|
38638
|
+
"embed",
|
|
38639
|
+
"base",
|
|
38640
|
+
"form",
|
|
38641
|
+
"meta",
|
|
38642
|
+
"link",
|
|
38643
|
+
"style",
|
|
38644
|
+
"foreignobject"
|
|
38645
|
+
];
|
|
38646
|
+
var p$1 = [
|
|
38647
|
+
"onerror",
|
|
38648
|
+
"onload",
|
|
38649
|
+
"onclick",
|
|
38650
|
+
"onmouseover",
|
|
38651
|
+
"onmouseout",
|
|
38652
|
+
"onmouseenter",
|
|
38653
|
+
"onmouseleave",
|
|
38654
|
+
"onfocus",
|
|
38655
|
+
"onblur",
|
|
38656
|
+
"onkeydown",
|
|
38657
|
+
"onkeyup",
|
|
38658
|
+
"onkeypress",
|
|
38659
|
+
"onsubmit",
|
|
38660
|
+
"onchange",
|
|
38661
|
+
"onbeforeunload",
|
|
38662
|
+
"formaction",
|
|
38663
|
+
"xlink:href"
|
|
38664
|
+
];
|
|
38665
|
+
var m$1 = /* @__PURE__ */ new Set([
|
|
38666
|
+
"iframe",
|
|
38667
|
+
"object",
|
|
38668
|
+
"semantics",
|
|
38669
|
+
"annotation",
|
|
38670
|
+
"none"
|
|
38671
|
+
]);
|
|
38672
|
+
var h$1 = /^[a-z_][\w.-]*:[a-z][\w.-]*$/;
|
|
38673
|
+
var g$1 = {
|
|
38674
|
+
ADD_TAGS: (e) => m$1.has(e) || h$1.test(e),
|
|
38675
|
+
ADD_ATTR: [
|
|
38676
|
+
"alignment",
|
|
38677
|
+
"target",
|
|
38678
|
+
"allow",
|
|
38679
|
+
"allowfullscreen",
|
|
38680
|
+
"frameborder",
|
|
38681
|
+
"scrolling",
|
|
38682
|
+
"data"
|
|
38683
|
+
],
|
|
38684
|
+
FORBID_TAGS: f$1,
|
|
38685
|
+
FORBID_ATTR: p$1,
|
|
38686
|
+
ALLOW_UNKNOWN_PROTOCOLS: !1,
|
|
38687
|
+
RETURN_TRUSTED_TYPE: !1
|
|
38688
|
+
};
|
|
38689
|
+
var _$1 = 1e6;
|
|
38690
|
+
var v$1 = /* @__PURE__ */ new Map();
|
|
38691
|
+
var y$1 = 0;
|
|
38692
|
+
function b$1(t) {
|
|
38693
|
+
if (t == null || t === "" || !purify_default.isSupported) return "";
|
|
38694
|
+
let n = typeof t == "string" ? t : String(t), r = v$1.get(n);
|
|
38695
|
+
if (r !== void 0) return r;
|
|
38696
|
+
let i = String(purify_default.sanitize(n, g$1)), a = n.length + i.length;
|
|
38697
|
+
if (a > _$1) return i;
|
|
38698
|
+
for (let [e, t] of v$1) {
|
|
38699
|
+
if (y$1 + a <= _$1) break;
|
|
38700
|
+
v$1.delete(e), y$1 -= e.length + t.length;
|
|
38701
|
+
}
|
|
38702
|
+
return v$1.set(n, i), y$1 += a, i;
|
|
38703
|
+
}
|
|
38704
|
+
//#endregion
|
|
36176
38705
|
//#region ../../shared/math-rendering-mathjax/dist/index.js
|
|
36177
|
-
var e = "
|
|
36178
|
-
var t = "pie-
|
|
36179
|
-
var n =
|
|
36180
|
-
|
|
38706
|
+
var e = "4.1.3";
|
|
38707
|
+
var t = "https://github.com/pie-framework/pie-elements-ng/blob/develop/docs/MATH-RENDERING.md#assets";
|
|
38708
|
+
var n = "@pie-lib/math-rendering@2";
|
|
38709
|
+
var r = ["nemeth", "euro"];
|
|
38710
|
+
var i = `mathjax@${e}/sre`;
|
|
38711
|
+
var a = /^[^@]+@[^@]+$/;
|
|
38712
|
+
function o(e) {
|
|
38713
|
+
if (!e) return;
|
|
38714
|
+
let t;
|
|
38715
|
+
try {
|
|
38716
|
+
t = new URL(e);
|
|
38717
|
+
} catch {
|
|
38718
|
+
return;
|
|
38719
|
+
}
|
|
38720
|
+
if (t.origin === "null") return;
|
|
38721
|
+
let n = t.pathname.split("/");
|
|
38722
|
+
for (let e = n.length - 1; e > 0; e--) {
|
|
38723
|
+
let r = n[e];
|
|
38724
|
+
if (r === "node_modules") return;
|
|
38725
|
+
if (!a.test(r)) continue;
|
|
38726
|
+
let i = n[e - 1]?.startsWith("@") ? e - 1 : e;
|
|
38727
|
+
return t.origin + n.slice(0, i).join("/");
|
|
38728
|
+
}
|
|
38729
|
+
}
|
|
38730
|
+
function s() {
|
|
38731
|
+
let e = globalThis[n]?.opts;
|
|
38732
|
+
return e && typeof e == "object" ? e : {};
|
|
38733
|
+
}
|
|
38734
|
+
function c(e) {
|
|
38735
|
+
if (typeof e != "string" || !e) return;
|
|
38736
|
+
let t = typeof document > "u" ? void 0 : document.baseURI;
|
|
38737
|
+
try {
|
|
38738
|
+
return new URL(e, t).href.replace(/\/+$/, "");
|
|
38739
|
+
} catch {
|
|
38740
|
+
return;
|
|
38741
|
+
}
|
|
38742
|
+
}
|
|
38743
|
+
function l(e) {
|
|
38744
|
+
if (!e || typeof e != "object") return;
|
|
38745
|
+
let t = /* @__PURE__ */ new Map();
|
|
38746
|
+
for (let [n, r] of Object.entries(e)) {
|
|
38747
|
+
let e = c(r);
|
|
38748
|
+
e && t.set(n, e);
|
|
38749
|
+
}
|
|
38750
|
+
return t.size ? t : void 0;
|
|
38751
|
+
}
|
|
38752
|
+
function u(e) {
|
|
38753
|
+
if (Array.isArray(e)) return new Map(e.filter((e) => typeof e == "string").map((e) => [e, void 0]));
|
|
38754
|
+
if (e && typeof e == "object") return new Map(Object.entries(e).map(([e, t]) => [e, typeof t == "string" ? t : void 0]));
|
|
38755
|
+
}
|
|
38756
|
+
function d(e, t) {
|
|
38757
|
+
let n = s(), r = c(e.assetRoot ?? n.assetRoot) ?? o(t);
|
|
38758
|
+
return {
|
|
38759
|
+
root: r,
|
|
38760
|
+
speechPath: c(e.speechPath ?? n.speechPath) ?? (r ? `${r}/${i}` : void 0),
|
|
38761
|
+
speechLocales: u(e.speechLocales ?? n.speechLocales),
|
|
38762
|
+
urls: l(e.assetUrls ?? n.assetUrls)
|
|
38763
|
+
};
|
|
38764
|
+
}
|
|
38765
|
+
function f(e, t) {
|
|
38766
|
+
if (!(!e || !t)) {
|
|
38767
|
+
for (let n of [...e.keys()]) !t.has(n) && !r.includes(n) && e.delete(n);
|
|
38768
|
+
for (let [n, r] of t) (r || !e.has(n)) && e.set(n, r ?? n);
|
|
38769
|
+
}
|
|
38770
|
+
}
|
|
38771
|
+
function p(e) {
|
|
38772
|
+
if (!(!e || e.has("en"))) return [...e.keys()].find((e) => !r.includes(e));
|
|
38773
|
+
}
|
|
38774
|
+
var h = {
|
|
38775
|
+
untypeset: "no MathJax loads, so math stays untypeset",
|
|
38776
|
+
"no-web-fonts": "math renders without web fonts",
|
|
38777
|
+
"no-web-fonts-or-speech": "math renders without web fonts and speech"
|
|
38778
|
+
};
|
|
38779
|
+
var g = Symbol.for("@pie-element/shared-math-rendering-mathjax/no-assets");
|
|
38780
|
+
function _(e) {
|
|
38781
|
+
let r = globalThis;
|
|
38782
|
+
r[g] ?? (r[g] = []);
|
|
38783
|
+
let i = r[g];
|
|
38784
|
+
if (i.includes(e)) return;
|
|
38785
|
+
i.push(e);
|
|
38786
|
+
let a = `[math-rendering] No asset root for MathJax: ${h[e]}. Set window['${n}'].opts.assetRoot to an npm root. See ${t}`;
|
|
38787
|
+
e === "untypeset" ? console.error(a) : console.warn(a), !(typeof window > "u") && window.dispatchEvent(new CustomEvent("pie-mathjax-no-asset-root", { detail: {
|
|
38788
|
+
effect: e,
|
|
38789
|
+
message: a,
|
|
38790
|
+
docsUrl: t
|
|
38791
|
+
} }));
|
|
38792
|
+
}
|
|
38793
|
+
var v = "https://github.com/pie-framework/pie-players/blob/develop/docs/item-player/loading-strategies.md#one-mathjax-version-per-page";
|
|
38794
|
+
var y = "pie-mathjax-version-conflict";
|
|
38795
|
+
var b = Symbol.for("@pie-element/shared-math-rendering-mathjax/unsupported-page");
|
|
38796
|
+
function x(e, t) {
|
|
36181
38797
|
if (typeof window > "u") return;
|
|
36182
|
-
let
|
|
36183
|
-
|
|
38798
|
+
let n = globalThis;
|
|
38799
|
+
n[b] ?? (n[b] = {
|
|
36184
38800
|
logged: !1,
|
|
36185
38801
|
conditions: []
|
|
36186
38802
|
});
|
|
36187
|
-
let
|
|
36188
|
-
if (
|
|
36189
|
-
|
|
36190
|
-
let
|
|
36191
|
-
|
|
36192
|
-
condition:
|
|
36193
|
-
message:
|
|
36194
|
-
docsUrl:
|
|
38803
|
+
let r = n[b];
|
|
38804
|
+
if (r.conditions.includes(e)) return;
|
|
38805
|
+
r.conditions.push(e);
|
|
38806
|
+
let i = `[math-rendering] Unsupported page (${e}): ${t}. PIE supports one MathJax major version per page; with MathJax 3 and 4 on one page, math rendering is best effort and may break. See ${v}`;
|
|
38807
|
+
r.logged || (r.logged = !0, console.error(i)), window.dispatchEvent(new CustomEvent(y, { detail: {
|
|
38808
|
+
condition: e,
|
|
38809
|
+
message: i,
|
|
38810
|
+
docsUrl: v
|
|
36195
38811
|
} }));
|
|
36196
38812
|
}
|
|
36197
|
-
function
|
|
38813
|
+
function ee() {
|
|
36198
38814
|
let e = window.MathJax?.version;
|
|
36199
38815
|
return typeof e == "string" && e.startsWith("3.") ? e : void 0;
|
|
36200
38816
|
}
|
|
36201
|
-
function
|
|
38817
|
+
function S() {
|
|
36202
38818
|
return window.MathJax;
|
|
36203
38819
|
}
|
|
36204
|
-
function
|
|
36205
|
-
|
|
36206
|
-
|
|
36207
|
-
|
|
36208
|
-
|
|
38820
|
+
function te(t, { root: n, speechPath: r }) {
|
|
38821
|
+
n && (t.loader = {
|
|
38822
|
+
...t.loader,
|
|
38823
|
+
paths: {
|
|
38824
|
+
fonts: `${n}/@mathjax`,
|
|
38825
|
+
"mathjax-newcm": `${n}/@mathjax/mathjax-newcm-font@${e}`,
|
|
38826
|
+
"mathjax-mhchem-extension": `${n}/@mathjax/mathjax-mhchem-font-extension@${e}`
|
|
38827
|
+
}
|
|
38828
|
+
}), r && (t.options = {
|
|
38829
|
+
...t.options,
|
|
38830
|
+
worker: {
|
|
38831
|
+
path: r,
|
|
38832
|
+
maps: `${r}/mathmaps`
|
|
38833
|
+
}
|
|
36209
38834
|
});
|
|
36210
38835
|
}
|
|
36211
|
-
|
|
36212
|
-
|
|
36213
|
-
|
|
36214
|
-
|
|
36215
|
-
|
|
36216
|
-
|
|
36217
|
-
|
|
36218
|
-
|
|
38836
|
+
function ne(e, t) {
|
|
38837
|
+
let n = t.srcUrl || (t.root ? `${t.root}/mathjax@4.1.3/tex-mml-chtml.js` : void 0);
|
|
38838
|
+
return n ? (te(e, t), new Promise((t, r) => {
|
|
38839
|
+
window.MathJax = e;
|
|
38840
|
+
let i = document.createElement("script");
|
|
38841
|
+
i.src = n, i.async = !0, i.onload = () => t(!0), i.onerror = () => r(/* @__PURE__ */ Error("Failed to load MathJax")), document.head.appendChild(i);
|
|
38842
|
+
})) : (_("untypeset"), Promise.resolve(!1));
|
|
38843
|
+
}
|
|
38844
|
+
var re = globalThis;
|
|
38845
|
+
var C = "PIE-MJX-CHTML-styles";
|
|
38846
|
+
var ie = ["MJX-CHTML-styles", "MJX-SVG-styles"];
|
|
38847
|
+
var ae = ee;
|
|
38848
|
+
var w = "http://www.w3.org/1998/Math/MathML";
|
|
38849
|
+
var oe = /^([a-z_][\w.-]*):math$/;
|
|
38850
|
+
var se = /^[a-z][a-z0-9-]*$/;
|
|
38851
|
+
function ce(e) {
|
|
36219
38852
|
for (let t of e.querySelectorAll("*")) {
|
|
36220
|
-
let n =
|
|
36221
|
-
!n || !e.contains(t) || t.closest("mjx-container") || t.replaceWith(
|
|
38853
|
+
let n = oe.exec(t.tagName.toLowerCase())?.[1];
|
|
38854
|
+
!n || !e.contains(t) || t.closest("mjx-container") || t.replaceWith(T(t, `${n}:`));
|
|
36222
38855
|
}
|
|
36223
38856
|
}
|
|
36224
|
-
function
|
|
38857
|
+
function T(e, t) {
|
|
36225
38858
|
let n = e.tagName.toLowerCase().slice(t.length);
|
|
36226
|
-
if (!
|
|
36227
|
-
let r = e.ownerDocument.createElementNS(
|
|
38859
|
+
if (!se.test(n)) return e;
|
|
38860
|
+
let r = e.ownerDocument.createElementNS(w, n);
|
|
36228
38861
|
for (let t of e.attributes) r.setAttribute(t.name, t.value);
|
|
36229
38862
|
for (let n of [...e.childNodes]) {
|
|
36230
38863
|
let e = n instanceof Element && n.tagName.toLowerCase().startsWith(t);
|
|
36231
|
-
r.appendChild(e ?
|
|
38864
|
+
r.appendChild(e ? T(n, t) : n);
|
|
36232
38865
|
}
|
|
36233
38866
|
return r;
|
|
36234
38867
|
}
|
|
36235
|
-
var
|
|
38868
|
+
var le = /* @__PURE__ */ new Set([
|
|
36236
38869
|
"updiagonalstrike",
|
|
36237
38870
|
"downdiagonalstrike",
|
|
36238
38871
|
"verticalstrike",
|
|
36239
38872
|
"horizontalstrike"
|
|
36240
38873
|
]);
|
|
36241
|
-
var
|
|
38874
|
+
var ue = {
|
|
36242
38875
|
thin: "0.035em",
|
|
36243
38876
|
medium: "0.07em",
|
|
36244
38877
|
thick: "0.14em"
|
|
36245
38878
|
};
|
|
36246
|
-
var
|
|
38879
|
+
var de = {
|
|
36247
38880
|
tight: "0em",
|
|
36248
38881
|
medium: "0.1em",
|
|
36249
38882
|
loose: "0.2em"
|
|
36250
38883
|
};
|
|
36251
|
-
var
|
|
36252
|
-
var
|
|
36253
|
-
var
|
|
36254
|
-
var
|
|
38884
|
+
var fe = /^(\d+(\.\d*)?|\.\d+)(em|ex|px|pt|pc|in|cm|mm)$/;
|
|
38885
|
+
var pe = /^(#[0-9a-f]{3,8}|[a-z]+)$/i;
|
|
38886
|
+
var me = /^(\d+(\.\d*)?|\.\d+)$/;
|
|
38887
|
+
var he = /* @__PURE__ */ new Set([
|
|
36255
38888
|
"mn",
|
|
36256
38889
|
"mo",
|
|
36257
38890
|
"mi",
|
|
36258
38891
|
"mtext"
|
|
36259
38892
|
]);
|
|
36260
|
-
var
|
|
38893
|
+
var ge = /* @__PURE__ */ new Set([
|
|
36261
38894
|
"stackalign",
|
|
36262
38895
|
"charalign",
|
|
36263
38896
|
"charspacing",
|
|
36264
38897
|
"longdivstyle"
|
|
36265
38898
|
]);
|
|
36266
|
-
function
|
|
36267
|
-
let i = e.createElementNS(
|
|
38899
|
+
function E(e, t, n = [], r = {}) {
|
|
38900
|
+
let i = e.createElementNS(w, t);
|
|
36268
38901
|
for (let [e, t] of Object.entries(r)) i.setAttribute(e, t);
|
|
36269
38902
|
for (let e of n) e && i.appendChild(e);
|
|
36270
38903
|
return i;
|
|
36271
38904
|
}
|
|
36272
|
-
function
|
|
36273
|
-
let n =
|
|
38905
|
+
function D(e, t) {
|
|
38906
|
+
let n = E(e.document, "mo");
|
|
36274
38907
|
return n.textContent = t, n;
|
|
36275
38908
|
}
|
|
36276
|
-
function
|
|
36277
|
-
let t =
|
|
36278
|
-
return t.textContent = "0",
|
|
38909
|
+
function O(e) {
|
|
38910
|
+
let t = E(e.document, "mn");
|
|
38911
|
+
return t.textContent = "0", E(e.document, "mphantom", [t]);
|
|
36279
38912
|
}
|
|
36280
|
-
function
|
|
38913
|
+
function k(e, t) {
|
|
36281
38914
|
return e.getAttribute(t)?.trim().toLowerCase() || void 0;
|
|
36282
38915
|
}
|
|
36283
|
-
function
|
|
38916
|
+
function A(e, t) {
|
|
36284
38917
|
let n = Number.parseInt(e.getAttribute(t) ?? "", 10);
|
|
36285
38918
|
return Number.isFinite(n) ? n : 0;
|
|
36286
38919
|
}
|
|
36287
|
-
function
|
|
38920
|
+
function j(e) {
|
|
36288
38921
|
return e.localName === "none" || e.localName === "mrow" && e.children.length === 0 && !e.textContent?.trim();
|
|
36289
38922
|
}
|
|
36290
|
-
function
|
|
38923
|
+
function M(e, t, n = e) {
|
|
36291
38924
|
switch (t) {
|
|
36292
38925
|
case "left": return 0;
|
|
36293
38926
|
case "center": return Math.floor(e / 2);
|
|
@@ -36295,14 +38928,14 @@ function E(e, t, n = e) {
|
|
|
36295
38928
|
default: return n;
|
|
36296
38929
|
}
|
|
36297
38930
|
}
|
|
36298
|
-
function
|
|
38931
|
+
function N(e, t, n) {
|
|
36299
38932
|
let r = [], i, a, o = (e, t) => {
|
|
36300
38933
|
let s = (e) => t.reduceRight((e, t) => {
|
|
36301
38934
|
let n = t.cloneNode(!1);
|
|
36302
38935
|
return n.appendChild(e), n;
|
|
36303
38936
|
}, e);
|
|
36304
38937
|
if (e.localName === "mstyle") for (let n of [...e.children]) o(n, [...t, e]);
|
|
36305
|
-
else if (
|
|
38938
|
+
else if (j(e)) r.push(null);
|
|
36306
38939
|
else if (e.localName === "mn" && e.children.length === 0) {
|
|
36307
38940
|
let t = [...(e.textContent ?? "").trim()];
|
|
36308
38941
|
for (let a of t) {
|
|
@@ -36311,28 +38944,28 @@ function D(e, t, n) {
|
|
|
36311
38944
|
t.textContent = a, r.push(s(t));
|
|
36312
38945
|
}
|
|
36313
38946
|
t.length && (a ?? (a = r.length));
|
|
36314
|
-
} else
|
|
38947
|
+
} else he.has(e.localName) && e.textContent?.trim() === n.decimalPoint && (i ?? (i = r.length)), r.push(s(e));
|
|
36315
38948
|
};
|
|
36316
38949
|
for (let t of e) o(t, []);
|
|
36317
38950
|
return {
|
|
36318
38951
|
kind: "digits",
|
|
36319
38952
|
cells: r,
|
|
36320
|
-
anchor:
|
|
38953
|
+
anchor: M(r.length, n.stackAlign, i ?? a),
|
|
36321
38954
|
position: t
|
|
36322
38955
|
};
|
|
36323
38956
|
}
|
|
36324
|
-
function
|
|
36325
|
-
return (e ?? "").toLowerCase().split(/\s+/).filter((e) =>
|
|
38957
|
+
function _e(e) {
|
|
38958
|
+
return (e ?? "").toLowerCase().split(/\s+/).filter((e) => le.has(e));
|
|
36326
38959
|
}
|
|
36327
|
-
function
|
|
36328
|
-
let n = [...e.children].filter((e) => !
|
|
36329
|
-
return n.length <= 1 ? n[0] ?? null :
|
|
38960
|
+
function ve(e, t) {
|
|
38961
|
+
let n = [...e.children].filter((e) => !j(e));
|
|
38962
|
+
return n.length <= 1 ? n[0] ?? null : E(t.document, "mrow", n);
|
|
36330
38963
|
}
|
|
36331
|
-
function
|
|
36332
|
-
let r =
|
|
36333
|
-
content:
|
|
36334
|
-
location:
|
|
36335
|
-
crossout: e.hasAttribute("crossout") ?
|
|
38964
|
+
function ye(e, t, n) {
|
|
38965
|
+
let r = k(e, "location") ?? "n", i = _e(e.getAttribute("crossout")), a = [...e.children].map((e) => j(e) ? null : e.localName === "mscarry" ? {
|
|
38966
|
+
content: ve(e, n),
|
|
38967
|
+
location: k(e, "location") ?? r,
|
|
38968
|
+
crossout: e.hasAttribute("crossout") ? _e(e.getAttribute("crossout")) : i
|
|
36336
38969
|
} : {
|
|
36337
38970
|
content: e,
|
|
36338
38971
|
location: r,
|
|
@@ -36341,60 +38974,60 @@ function ae(e, t, n) {
|
|
|
36341
38974
|
return {
|
|
36342
38975
|
kind: "carries",
|
|
36343
38976
|
carries: a,
|
|
36344
|
-
anchor:
|
|
38977
|
+
anchor: M(a.length, n.stackAlign),
|
|
36345
38978
|
position: t,
|
|
36346
|
-
scale:
|
|
38979
|
+
scale: me.test(o) ? o : "0.6"
|
|
36347
38980
|
};
|
|
36348
38981
|
}
|
|
36349
|
-
function
|
|
36350
|
-
let t =
|
|
36351
|
-
return `${n} solid ${
|
|
38982
|
+
function be(e) {
|
|
38983
|
+
let t = k(e, "mslinethickness") ?? "medium", n = ue[t] ?? (fe.test(t) ? t : "0.07em"), r = e.getAttribute("mathcolor")?.trim() ?? "";
|
|
38984
|
+
return `${n} solid ${pe.test(r) ? r : "currentColor"}`;
|
|
36352
38985
|
}
|
|
36353
|
-
function
|
|
36354
|
-
let r = Math.max(0,
|
|
38986
|
+
function xe(e, t, n) {
|
|
38987
|
+
let r = Math.max(0, A(e, "length"));
|
|
36355
38988
|
return {
|
|
36356
38989
|
kind: "line",
|
|
36357
38990
|
length: r,
|
|
36358
|
-
anchor:
|
|
38991
|
+
anchor: M(r, n.stackAlign),
|
|
36359
38992
|
position: t,
|
|
36360
|
-
border:
|
|
38993
|
+
border: be(e)
|
|
36361
38994
|
};
|
|
36362
38995
|
}
|
|
36363
|
-
function
|
|
38996
|
+
function P(e, t, n, r, i) {
|
|
36364
38997
|
e.forEach((e, a) => {
|
|
36365
|
-
let o = t + a * n +
|
|
38998
|
+
let o = t + a * n + A(e, "position");
|
|
36366
38999
|
switch (e.localName) {
|
|
36367
39000
|
case "msgroup":
|
|
36368
|
-
|
|
39001
|
+
P([...e.children], o, A(e, "shift"), r, i);
|
|
36369
39002
|
break;
|
|
36370
39003
|
case "msline":
|
|
36371
|
-
i.push(
|
|
39004
|
+
i.push(xe(e, o, r));
|
|
36372
39005
|
break;
|
|
36373
39006
|
case "mscarries":
|
|
36374
|
-
i.push(
|
|
39007
|
+
i.push(ye(e, o, r));
|
|
36375
39008
|
break;
|
|
36376
39009
|
case "msrow":
|
|
36377
39010
|
case "mrow":
|
|
36378
|
-
i.push(
|
|
39011
|
+
i.push(N([...e.children], o, r));
|
|
36379
39012
|
break;
|
|
36380
|
-
default: i.push(
|
|
39013
|
+
default: i.push(N([e], o, r));
|
|
36381
39014
|
}
|
|
36382
39015
|
});
|
|
36383
39016
|
}
|
|
36384
|
-
function
|
|
39017
|
+
function F(e) {
|
|
36385
39018
|
return -e.anchor - e.position;
|
|
36386
39019
|
}
|
|
36387
|
-
function
|
|
39020
|
+
function I(e) {
|
|
36388
39021
|
return e.kind === "digits" ? e.cells.length : e.kind === "carries" ? e.carries.length : e.length;
|
|
36389
39022
|
}
|
|
36390
|
-
function
|
|
36391
|
-
return
|
|
39023
|
+
function L(e) {
|
|
39024
|
+
return F(e) + I(e) - 1;
|
|
36392
39025
|
}
|
|
36393
|
-
function
|
|
36394
|
-
let i = (e) =>
|
|
39026
|
+
function Se(e, t, n, r) {
|
|
39027
|
+
let i = (e) => E(r.document, "mpadded", [t], {
|
|
36395
39028
|
width: "0",
|
|
36396
39029
|
...e ? { lspace: e } : {}
|
|
36397
|
-
}), a = (e, t) =>
|
|
39030
|
+
}), a = (e, t) => E(r.document, e, t);
|
|
36398
39031
|
switch (n) {
|
|
36399
39032
|
case "s": return a("munder", [e, i("-0.5width")]);
|
|
36400
39033
|
case "ne": return a("msup", [e, i()]);
|
|
@@ -36416,49 +39049,49 @@ function ce(e, t, n, r) {
|
|
|
36416
39049
|
default: return a("mover", [e, i("-0.5width")]);
|
|
36417
39050
|
}
|
|
36418
39051
|
}
|
|
36419
|
-
function
|
|
36420
|
-
let r =
|
|
39052
|
+
function Ce(e, t, n) {
|
|
39053
|
+
let r = E(n.document, "menclose", [e], {
|
|
36421
39054
|
notation: t.join(" "),
|
|
36422
39055
|
"data-padding": "0.1em",
|
|
36423
39056
|
"data-thickness": "0.067em"
|
|
36424
39057
|
}), i = t.some((e) => e.endsWith("diagonalstrike")) ? .167 : t.includes("horizontalstrike") ? .1 : 0;
|
|
36425
|
-
return i ?
|
|
39058
|
+
return i ? E(n.document, "mpadded", [r], {
|
|
36426
39059
|
lspace: `-${i}em`,
|
|
36427
39060
|
width: `-${2 * i}em`
|
|
36428
39061
|
}) : r;
|
|
36429
39062
|
}
|
|
36430
|
-
function
|
|
36431
|
-
let a = e && t.crossout.length ?
|
|
39063
|
+
function we(e, t, n, r, i) {
|
|
39064
|
+
let a = e && t.crossout.length ? Ce(e, t.crossout, i) : e;
|
|
36432
39065
|
if (!t.content) return a;
|
|
36433
|
-
let o =
|
|
36434
|
-
return
|
|
39066
|
+
let o = E(i.document, "mstyle", [t.content], { scriptsizemultiplier: r });
|
|
39067
|
+
return Se(a ?? O(i), o, n, i);
|
|
36435
39068
|
}
|
|
36436
|
-
function
|
|
36437
|
-
return e.carries[t -
|
|
39069
|
+
function R(e, t) {
|
|
39070
|
+
return e.carries[t - F(e)] ?? null;
|
|
36438
39071
|
}
|
|
36439
|
-
function
|
|
39072
|
+
function Te(e, t, n, r) {
|
|
36440
39073
|
let i = e.content;
|
|
36441
39074
|
n.forEach((e, a) => {
|
|
36442
|
-
let o = n.length - 1 - a, s = n[o], c =
|
|
39075
|
+
let o = n.length - 1 - a, s = n[o], c = R(s, t), l = n.slice(0, o).some((e) => R(e, t));
|
|
36443
39076
|
if (!c && !l) return;
|
|
36444
39077
|
let u = c ?? {
|
|
36445
|
-
content:
|
|
39078
|
+
content: O(r),
|
|
36446
39079
|
location: "n",
|
|
36447
39080
|
crossout: []
|
|
36448
39081
|
}, d = a === 0 ? u.location : "n";
|
|
36449
|
-
i =
|
|
39082
|
+
i = we(i, u, d, s.scale, r);
|
|
36450
39083
|
}), e.content = i;
|
|
36451
39084
|
}
|
|
36452
|
-
function
|
|
36453
|
-
let n = e.filter((e) =>
|
|
39085
|
+
function z(e, t) {
|
|
39086
|
+
let n = e.filter((e) => I(e) > 0), r = Math.min(0, ...n.map(F)), i = Math.max(r, ...n.map(L)) - r + 1, a = -r, o = [], s = /* @__PURE__ */ new Map(), c = () => Array.from({ length: i }, () => ({
|
|
36454
39087
|
content: null,
|
|
36455
39088
|
borders: {}
|
|
36456
|
-
})), l = (e) => e.length === 0 ? Array.from({ length: i }, (e, t) => t) : Array.from({ length: e.length }, (t, n) => a +
|
|
39089
|
+
})), l = (e) => e.length === 0 ? Array.from({ length: i }, (e, t) => t) : Array.from({ length: e.length }, (t, n) => a + F(e) + n), u = [], d = [], f = (e) => {
|
|
36457
39090
|
let n = c();
|
|
36458
39091
|
e.cells.forEach((t, r) => {
|
|
36459
|
-
n[a +
|
|
39092
|
+
n[a + F(e) + r].content = t;
|
|
36460
39093
|
}), u.length && n.forEach((e, n) => {
|
|
36461
|
-
|
|
39094
|
+
Te(e, n - a, u, t);
|
|
36462
39095
|
});
|
|
36463
39096
|
for (let e of d) for (let t of l(e)) n[t].borders.top = e.border;
|
|
36464
39097
|
u = [], d = [], s.set(e, o.length), o.push(n);
|
|
@@ -36478,44 +39111,44 @@ function P(e, t) {
|
|
|
36478
39111
|
origin: a
|
|
36479
39112
|
};
|
|
36480
39113
|
}
|
|
36481
|
-
function
|
|
36482
|
-
let r =
|
|
39114
|
+
function B(e, { rows: t }, n) {
|
|
39115
|
+
let r = E(n.document, "mtable", t.map((e) => E(n.document, "mtr", e.map((e) => {
|
|
36483
39116
|
let t = Object.entries(e.borders).map(([e, t]) => `border-${e}:${t}`).join(";");
|
|
36484
|
-
return
|
|
39117
|
+
return E(n.document, "mtd", [e.content], {
|
|
36485
39118
|
...t ? { style: t } : {},
|
|
36486
39119
|
...e.align ? { columnalign: e.align } : {}
|
|
36487
39120
|
});
|
|
36488
39121
|
}))));
|
|
36489
|
-
for (let { name: t, value: n } of [...e.attributes])
|
|
36490
|
-
let i =
|
|
36491
|
-
return r.setAttribute("columnspacing",
|
|
39122
|
+
for (let { name: t, value: n } of [...e.attributes]) ge.has(t) || r.setAttribute(t, n);
|
|
39123
|
+
let i = k(e, "charspacing") ?? "medium", a = k(e, "charalign");
|
|
39124
|
+
return r.setAttribute("columnspacing", de[i] ?? (fe.test(i) ? i : de.medium)), r.setAttribute("columnalign", a === "left" || a === "center" ? a : "right"), r.setAttribute("rowspacing", "0"), r.setAttribute("align", e.getAttribute("align") ?? "baseline"), r;
|
|
36492
39125
|
}
|
|
36493
|
-
function
|
|
39126
|
+
function V(e) {
|
|
36494
39127
|
return {
|
|
36495
39128
|
document: e.ownerDocument,
|
|
36496
|
-
stackAlign:
|
|
39129
|
+
stackAlign: k(e, "stackalign") ?? "decimalpoint",
|
|
36497
39130
|
decimalPoint: e.closest("[decimalpoint]")?.getAttribute("decimalpoint")?.trim().charAt(0) || "."
|
|
36498
39131
|
};
|
|
36499
39132
|
}
|
|
36500
|
-
function
|
|
36501
|
-
let t =
|
|
36502
|
-
return
|
|
39133
|
+
function Ee(e) {
|
|
39134
|
+
let t = V(e), n = [];
|
|
39135
|
+
return P([...e.children], 0, 0, t, n), B(e, z(n, t), t);
|
|
36503
39136
|
}
|
|
36504
|
-
function
|
|
39137
|
+
function H(e, t, n, r, i, a) {
|
|
36505
39138
|
for (let o = n; o <= r; o++) e[t][o].borders[i] = a;
|
|
36506
39139
|
}
|
|
36507
|
-
function
|
|
36508
|
-
let n =
|
|
36509
|
-
return n.setAttribute("minsize", "1.2em"), [
|
|
39140
|
+
function De(e, t) {
|
|
39141
|
+
let n = D(t, ")");
|
|
39142
|
+
return n.setAttribute("minsize", "1.2em"), [E(t.document, "mrow", [e, E(t.document, "mspace", [], { width: "0.2em" })]), E(t.document, "mpadded", [n], {
|
|
36510
39143
|
voffset: "0.1em",
|
|
36511
39144
|
lspace: "-0.15em",
|
|
36512
39145
|
depth: "-0.2em",
|
|
36513
39146
|
height: "-0.2em"
|
|
36514
39147
|
})];
|
|
36515
39148
|
}
|
|
36516
|
-
function
|
|
36517
|
-
let t =
|
|
36518
|
-
|
|
39149
|
+
function Oe(e) {
|
|
39150
|
+
let t = V(e), [n, r, ...i] = [...e.children], a = n && !j(n) ? n : null, o = r && !j(r) ? r : null, s = k(e, "longdivstyle") ?? "lefttop", c = be(e), l = [];
|
|
39151
|
+
P(i, 0, 0, t, l);
|
|
36519
39152
|
let u = l.find((e) => e.kind === "digits");
|
|
36520
39153
|
u || (u = {
|
|
36521
39154
|
kind: "digits",
|
|
@@ -36527,51 +39160,51 @@ function me(e) {
|
|
|
36527
39160
|
u.cells.unshift(...e), u.anchor += e.length;
|
|
36528
39161
|
}, p = (...e) => {
|
|
36529
39162
|
let n = e.flatMap((e) => e ? e.localName === "mrow" ? [...e.children] : [e] : []);
|
|
36530
|
-
u.cells.push(...
|
|
39163
|
+
u.cells.push(...N(n, 0, t).cells);
|
|
36531
39164
|
};
|
|
36532
39165
|
switch (s) {
|
|
36533
39166
|
case "left/\\right":
|
|
36534
|
-
f(a,
|
|
39167
|
+
f(a, D(t, "/")), p(D(t, "\\"), o);
|
|
36535
39168
|
break;
|
|
36536
39169
|
case "left)(right":
|
|
36537
|
-
f(a,
|
|
39170
|
+
f(a, D(t, ")")), p(D(t, "("), o);
|
|
36538
39171
|
break;
|
|
36539
39172
|
case ":right=right":
|
|
36540
|
-
p(
|
|
39173
|
+
p(D(t, ":"), a, D(t, "="), o);
|
|
36541
39174
|
break;
|
|
36542
39175
|
case "righttop":
|
|
36543
39176
|
case "stackedleftlinetop":
|
|
36544
39177
|
case "lefttop":
|
|
36545
|
-
o &&
|
|
39178
|
+
o && P([o], 0, 0, t, d), l.splice(l.indexOf(u), 0, ...d), s === "righttop" ? p(a) : s === "stackedleftlinetop" ? f(a) : f(...De(a, t));
|
|
36546
39179
|
break;
|
|
36547
39180
|
}
|
|
36548
|
-
let m =
|
|
39181
|
+
let m = z(l, t), h = m.rows, g = m.rowOf.get(u) ?? 0, _ = (e) => m.origin + F(u) + e, v = Math.max(_(u.cells.length - 1), ...d.map((e) => m.origin + L(e)));
|
|
36549
39182
|
switch (s) {
|
|
36550
39183
|
case "left/\\right":
|
|
36551
39184
|
case "left)(right":
|
|
36552
39185
|
case ":right=right": break;
|
|
36553
39186
|
case "righttop": {
|
|
36554
39187
|
let e = h[g][_(u.cells.length - 1)];
|
|
36555
|
-
e.borders.left = c, e.borders.bottom = c,
|
|
39188
|
+
e.borders.left = c, e.borders.bottom = c, H(h, g, _(0), _(u.cells.length - 1), "top", c);
|
|
36556
39189
|
break;
|
|
36557
39190
|
}
|
|
36558
39191
|
case "stackedleftlinetop": {
|
|
36559
39192
|
let e = h[g][_(0)];
|
|
36560
|
-
e.borders.right = c, e.borders.bottom = c,
|
|
39193
|
+
e.borders.right = c, e.borders.bottom = c, H(h, g, _(1), v, "top", c);
|
|
36561
39194
|
break;
|
|
36562
39195
|
}
|
|
36563
39196
|
case "stackedrightright":
|
|
36564
39197
|
case "mediumstackedrightright":
|
|
36565
39198
|
case "shortstackedrightright":
|
|
36566
39199
|
case "stackedleftleft":
|
|
36567
|
-
|
|
39200
|
+
ke(h, g, s, a, o, c, t);
|
|
36568
39201
|
break;
|
|
36569
|
-
default:
|
|
39202
|
+
default: H(h, g, _(1), v, "top", c);
|
|
36570
39203
|
}
|
|
36571
|
-
return
|
|
39204
|
+
return B(e, m, t);
|
|
36572
39205
|
}
|
|
36573
|
-
function
|
|
36574
|
-
let s = n === "stackedleftleft", c = s ? "right" : "left", l = (e) => e &&
|
|
39206
|
+
function ke(e, t, n, r, i, a, o) {
|
|
39207
|
+
let s = n === "stackedleftleft", c = s ? "right" : "left", l = (e) => e && E(o.document, "mpadded", [e], {
|
|
36575
39208
|
lspace: "0.2em",
|
|
36576
39209
|
width: "+0.4em"
|
|
36577
39210
|
});
|
|
@@ -36590,134 +39223,153 @@ function he(e, t, n, r, i, a, o) {
|
|
|
36590
39223
|
}) : o === t + 1 ? (u.content = l(i), n !== "shortstackedrightright" && (u.borders[c] = a)) : o > t + 1 && (n === "stackedrightright" || s) && (u.borders[c] = a), s ? e.unshift(u) : e.push(u);
|
|
36591
39224
|
});
|
|
36592
39225
|
}
|
|
36593
|
-
function
|
|
36594
|
-
for (let t of [...e.querySelectorAll("mstack, mlongdiv")]) !t.closest("math") || t.closest("mjx-container") || t.replaceWith(t.localName === "mstack" ?
|
|
39226
|
+
function Ae(e) {
|
|
39227
|
+
for (let t of [...e.querySelectorAll("mstack, mlongdiv")]) !t.closest("math") || t.closest("mjx-container") || t.replaceWith(t.localName === "mstack" ? Ee(t) : Oe(t));
|
|
36595
39228
|
}
|
|
36596
|
-
var
|
|
36597
|
-
var
|
|
36598
|
-
var
|
|
36599
|
-
var
|
|
36600
|
-
var
|
|
36601
|
-
var
|
|
36602
|
-
var
|
|
39229
|
+
var je = "PIE-MJX-explorer-styles";
|
|
39230
|
+
var U = "var(--pie-text, black)";
|
|
39231
|
+
var Me = "var(--pie-background, #ffffff)";
|
|
39232
|
+
var Ne = "var(--pie-border-dark, #66686A)";
|
|
39233
|
+
var W = "var(--pie-focus-outline, var(--pie-button-focus-outline, var(--pie-focus-checked-border, #1565C0)))";
|
|
39234
|
+
var G = `color-mix(in srgb, ${W} 15%, transparent)`;
|
|
39235
|
+
var Pe = `
|
|
36603
39236
|
:root mjx-container [data-sre-highlight-1]:not([data-mjx-collapsed], rect) {
|
|
36604
|
-
color: ${
|
|
36605
|
-
fill: ${
|
|
39237
|
+
color: ${U} !important;
|
|
39238
|
+
fill: ${U} !important;
|
|
36606
39239
|
}
|
|
36607
39240
|
:root mjx-container:not([data-mjx-clone-container]) [data-sre-highlight-1]:not([data-sre-enclosed], rect) {
|
|
36608
|
-
background-color: ${
|
|
39241
|
+
background-color: ${G} !important;
|
|
36609
39242
|
}
|
|
36610
39243
|
:root mjx-container rect[data-sre-highlight-1]:not([data-sre-enclosed]) {
|
|
36611
|
-
fill: ${
|
|
39244
|
+
fill: ${G} !important;
|
|
36612
39245
|
}
|
|
36613
39246
|
:root mjx-container .mjx-selected {
|
|
36614
|
-
outline: 2px solid ${
|
|
39247
|
+
outline: 2px solid ${W} !important;
|
|
36615
39248
|
}
|
|
36616
39249
|
:root mjx-container [data-sre-highlight-2] {
|
|
36617
|
-
color: ${
|
|
39250
|
+
color: ${U} !important;
|
|
36618
39251
|
background-color: transparent !important;
|
|
36619
|
-
fill: ${
|
|
36620
|
-
outline: 2px dashed ${
|
|
39252
|
+
fill: ${U} !important;
|
|
39253
|
+
outline: 2px dashed ${W} !important;
|
|
36621
39254
|
}
|
|
36622
39255
|
:root mjx-container rect[data-sre-highlight-2] {
|
|
36623
39256
|
fill: transparent !important;
|
|
36624
|
-
stroke: ${
|
|
39257
|
+
stroke: ${W} !important;
|
|
36625
39258
|
stroke-width: 2px !important;
|
|
36626
39259
|
vector-effect: non-scaling-stroke;
|
|
36627
39260
|
}
|
|
36628
39261
|
:root .MJX_LiveRegion, :root .MJX_HoverRegion, :root .MJX_ToolTip {
|
|
36629
|
-
color: ${
|
|
36630
|
-
background-color: ${
|
|
36631
|
-
border-color: ${
|
|
39262
|
+
color: ${U} !important;
|
|
39263
|
+
background-color: ${Me} !important;
|
|
39264
|
+
border-color: ${Ne} !important;
|
|
36632
39265
|
}
|
|
36633
39266
|
:root .MJX_LiveRegion > div, :root .MJX_HoverRegion > div {
|
|
36634
|
-
color: ${
|
|
36635
|
-
background-color: ${
|
|
39267
|
+
color: ${U} !important;
|
|
39268
|
+
background-color: ${G} !important;
|
|
36636
39269
|
}
|
|
36637
39270
|
`;
|
|
36638
|
-
function
|
|
39271
|
+
function Fe(e = document) {
|
|
36639
39272
|
if (e.getElementById("PIE-MJX-explorer-styles")) return;
|
|
36640
39273
|
let t = e.createElement("style");
|
|
36641
|
-
t.id =
|
|
39274
|
+
t.id = je, t.textContent = Pe, e.head.appendChild(t);
|
|
39275
|
+
}
|
|
39276
|
+
var K = Symbol.for("@pie-element/shared-math-rendering-mathjax/speech-worker-failed");
|
|
39277
|
+
function Ie() {
|
|
39278
|
+
let e = globalThis;
|
|
39279
|
+
e[K] || (e[K] = !0, console.warn(`[math-rendering] MathJax's speech worker did not start, so speech, braille and the explorer are off. A content security policy must allow blob: workers, and scripts and fetches from the asset root. See ${t}`));
|
|
36642
39280
|
}
|
|
36643
|
-
|
|
36644
|
-
|
|
39281
|
+
function Le(e) {
|
|
39282
|
+
let t = e.webworker;
|
|
39283
|
+
if (!t || t.ready) return;
|
|
39284
|
+
e.options ?? (e.options = {});
|
|
39285
|
+
let n = e.options;
|
|
39286
|
+
n.enableSpeech = !1, n.enableBraille = !1, n.speechError = () => {}, t.Post = () => Promise.reject(/* @__PURE__ */ Error("The speech worker did not start")), t.Terminate(), Ie();
|
|
39287
|
+
}
|
|
39288
|
+
function Re(e) {
|
|
39289
|
+
let t = e?.adaptor, n = t?.createWorker;
|
|
39290
|
+
!e || !t || !n || (t.createWorker = async (r, i) => {
|
|
39291
|
+
let a = await n.call(t, r, i);
|
|
39292
|
+
return a.addEventListener("error", () => Le(e), { once: !0 }), a;
|
|
39293
|
+
});
|
|
39294
|
+
}
|
|
39295
|
+
`${i}`;
|
|
39296
|
+
var ze = {
|
|
36645
39297
|
parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
|
|
36646
39298
|
overarc: "\\overparen",
|
|
36647
39299
|
napprox: "\\not\\approx",
|
|
36648
39300
|
longdiv: "\\enclose{longdiv}",
|
|
36649
39301
|
abs: ["\\left|#1\\right|", 1]
|
|
36650
39302
|
};
|
|
36651
|
-
var
|
|
36652
|
-
var
|
|
36653
|
-
var
|
|
36654
|
-
var
|
|
36655
|
-
var
|
|
39303
|
+
var Be = "[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)";
|
|
39304
|
+
var Ve = /\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/;
|
|
39305
|
+
var He = /\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/;
|
|
39306
|
+
var Ue = /\\embed\{newLine\}\[\]/g;
|
|
39307
|
+
var We = [
|
|
36656
39308
|
["$$", "$$"],
|
|
36657
39309
|
["$", "$"],
|
|
36658
39310
|
["\\[", "\\]"],
|
|
36659
39311
|
["\\(", "\\)"]
|
|
36660
39312
|
];
|
|
36661
|
-
var
|
|
36662
|
-
var
|
|
36663
|
-
var
|
|
36664
|
-
var
|
|
36665
|
-
var
|
|
39313
|
+
var q = Symbol.for("@pie-element/shared-math-rendering-mathjax/loading");
|
|
39314
|
+
var Ge = "MJX-CHTML-styles";
|
|
39315
|
+
var Ke = "PIE-MJX-SVG-styles";
|
|
39316
|
+
var J = "PIE-MathJax-Menu-Settings";
|
|
39317
|
+
var qe = { "mjx-container[overflow=\"linebreak\"][display]": {
|
|
36666
39318
|
overflow: "auto clip",
|
|
36667
39319
|
"min-width": "initial !important"
|
|
36668
39320
|
} };
|
|
36669
|
-
var
|
|
36670
|
-
var
|
|
36671
|
-
function
|
|
39321
|
+
var Je = 200;
|
|
39322
|
+
var Ye = 201;
|
|
39323
|
+
function Y(e) {
|
|
36672
39324
|
let t = [...e.matches("mjx-container") ? [e] : [], ...e.querySelectorAll("mjx-container")];
|
|
36673
39325
|
for (let e of t) for (let t of [e, ...e.querySelectorAll("[data-latex],[data-latex-item]")]) t.removeAttribute("data-latex"), t.removeAttribute("data-latex-item");
|
|
36674
39326
|
}
|
|
36675
|
-
function
|
|
36676
|
-
for (let [t, n] of
|
|
39327
|
+
function X(e) {
|
|
39328
|
+
for (let [t, n] of We) if (e.startsWith(t) && e.endsWith(n)) return e.substring(t.length, e.length - n.length);
|
|
36677
39329
|
return e;
|
|
36678
39330
|
}
|
|
36679
|
-
function
|
|
36680
|
-
return
|
|
39331
|
+
function Xe(e) {
|
|
39332
|
+
return X(e.includes("\\displaystyle") ? e.replace("\\displaystyle", "").trim() : e);
|
|
36681
39333
|
}
|
|
36682
|
-
var
|
|
36683
|
-
var
|
|
36684
|
-
function
|
|
36685
|
-
let n = e.closest(`.${
|
|
36686
|
-
return n !== null && t.contains(n) && !n.classList.contains(
|
|
39334
|
+
var Ze = "mathjax_ignore";
|
|
39335
|
+
var Qe = "mathjax_process";
|
|
39336
|
+
function $e(e, t) {
|
|
39337
|
+
let n = e.closest(`.${Ze}, .${Qe}`);
|
|
39338
|
+
return n !== null && t.contains(n) && !n.classList.contains(Qe);
|
|
36687
39339
|
}
|
|
36688
|
-
function
|
|
39340
|
+
function et(e) {
|
|
36689
39341
|
for (let t of e.querySelectorAll("[data-latex]")) {
|
|
36690
|
-
if (t.dataset.mathHandled || t.closest("mjx-container") ||
|
|
39342
|
+
if (t.dataset.mathHandled || t.closest("mjx-container") || $e(t, e)) continue;
|
|
36691
39343
|
let n = t.textContent;
|
|
36692
|
-
n && (t.textContent = `\\(${
|
|
39344
|
+
n && (t.textContent = `\\(${Xe(n)}\\)`.replace(Ue, "\\newline "), t.dataset.mathHandled = "true");
|
|
36693
39345
|
}
|
|
36694
39346
|
}
|
|
36695
|
-
function
|
|
39347
|
+
function tt(e) {
|
|
36696
39348
|
for (let t of e.querySelectorAll("math")) t.closest("mjx-container") || t.setAttribute("displaystyle", "true");
|
|
36697
39349
|
}
|
|
36698
|
-
function
|
|
39350
|
+
function nt(e, t) {
|
|
36699
39351
|
for (let t of e.querySelectorAll("math")) if (!t.closest("mjx-assistive-mml")) return !0;
|
|
36700
|
-
return (t ?
|
|
39352
|
+
return (t ? He : Ve).test(e.textContent ?? "");
|
|
36701
39353
|
}
|
|
36702
|
-
function
|
|
39354
|
+
function rt(e) {
|
|
36703
39355
|
return new Promise((t, n) => {
|
|
36704
|
-
let { useSingleDollar: r = !1, accessibility: i = !0, loadFonts:
|
|
39356
|
+
let { useSingleDollar: r = !1, accessibility: i = !0, loadFonts: a = !0, srcUrl: o } = e, s = d(e, import.meta.url), c = {
|
|
36705
39357
|
loader: {
|
|
36706
39358
|
load: i ? ["a11y/assistive-mml"] : [],
|
|
36707
39359
|
failed: (e) => n(e),
|
|
36708
39360
|
"output/svg": { ready: (e) => {
|
|
36709
|
-
let t =
|
|
36710
|
-
return
|
|
39361
|
+
let t = S();
|
|
39362
|
+
return it(t) && at(t), e;
|
|
36711
39363
|
} }
|
|
36712
39364
|
},
|
|
36713
39365
|
startup: {
|
|
36714
39366
|
typeset: !1,
|
|
36715
39367
|
ready: () => {
|
|
36716
|
-
let e =
|
|
36717
|
-
i && (
|
|
39368
|
+
let e = S(), r = e?.startup, i = it(e);
|
|
39369
|
+
i && (at(e), ot(e, s.speechLocales), f(e?._?.a11y?.sre_ts?.locales, s.speechLocales)), r?.defaultReady?.(), i && (st(r?.document), r?.document?.addStyles?.(qe), Re(r?.document)), Promise.resolve(r?.promise).then(() => t(), n);
|
|
36718
39370
|
}
|
|
36719
39371
|
},
|
|
36720
|
-
tex: { macros: { ...
|
|
39372
|
+
tex: { macros: { ...ze } },
|
|
36721
39373
|
output: { displayOverflow: "linebreak" },
|
|
36722
39374
|
options: {
|
|
36723
39375
|
enableMenu: i,
|
|
@@ -36729,165 +39381,173 @@ function Be(e) {
|
|
|
36729
39381
|
a11y: { inTabOrder: !1 }
|
|
36730
39382
|
}
|
|
36731
39383
|
};
|
|
36732
|
-
r &&
|
|
39384
|
+
r && c.tex && (console.warn(Be), c.tex.inlineMath = [["$", "$"], ["\\(", "\\)"]], c.tex.processEscapes = !0), a || (c.chtml = { fontURL: "" });
|
|
39385
|
+
let l = p(s.speechLocales);
|
|
39386
|
+
l && c.options && (c.options.sre = { locale: l }), ne(c, {
|
|
39387
|
+
...s,
|
|
39388
|
+
srcUrl: o
|
|
39389
|
+
}).then((e) => {
|
|
39390
|
+
e || t();
|
|
39391
|
+
}, n);
|
|
36733
39392
|
});
|
|
36734
39393
|
}
|
|
36735
|
-
function
|
|
39394
|
+
function it(e) {
|
|
36736
39395
|
return !!e?.version?.startsWith("4.");
|
|
36737
39396
|
}
|
|
36738
|
-
function
|
|
39397
|
+
function at(e) {
|
|
36739
39398
|
let t = e?._?.output, n = t?.chtml_ts?.CHTML;
|
|
36740
|
-
n && (n.STYLESHEETID =
|
|
39399
|
+
n && (n.STYLESHEETID = C);
|
|
36741
39400
|
let r = t?.svg_ts?.SVG;
|
|
36742
|
-
r && (r.STYLESHEETID =
|
|
39401
|
+
r && (r.STYLESHEETID = Ke);
|
|
36743
39402
|
}
|
|
36744
|
-
function
|
|
36745
|
-
let
|
|
36746
|
-
if (
|
|
36747
|
-
|
|
39403
|
+
function ot(e, t) {
|
|
39404
|
+
let n = e?._?.ui?.menu?.Menu?.Menu;
|
|
39405
|
+
if (n) {
|
|
39406
|
+
n.MENU_STORAGE = J;
|
|
36748
39407
|
try {
|
|
36749
|
-
let e = localStorage.getItem(
|
|
39408
|
+
let e = localStorage.getItem(J);
|
|
36750
39409
|
if (!e) return;
|
|
36751
|
-
let { assistiveMml:
|
|
36752
|
-
if (
|
|
36753
|
-
Object.keys(
|
|
39410
|
+
let { assistiveMml: n, locale: r, ...i } = JSON.parse(e), a = r === void 0 || !t || t.has(r);
|
|
39411
|
+
if (n === void 0 && a) return;
|
|
39412
|
+
a && r !== void 0 && (i.locale = r), Object.keys(i).length ? localStorage.setItem(J, JSON.stringify(i)) : localStorage.removeItem(J);
|
|
36754
39413
|
} catch {}
|
|
36755
39414
|
}
|
|
36756
39415
|
}
|
|
36757
|
-
function
|
|
39416
|
+
function st(e) {
|
|
36758
39417
|
if (!e) return;
|
|
36759
39418
|
let t = /* @__PURE__ */ new WeakSet(), n = (e) => {
|
|
36760
39419
|
let n = e.typesetRoot;
|
|
36761
|
-
!n || t.has(n) || (
|
|
39420
|
+
!n || t.has(n) || (Y(n), t.add(n));
|
|
36762
39421
|
};
|
|
36763
|
-
e.addRenderAction?.("pie-strip-latex",
|
|
39422
|
+
e.addRenderAction?.("pie-strip-latex", Ye, (e) => {
|
|
36764
39423
|
for (let t of e.math ?? []) n(t);
|
|
36765
39424
|
return !1;
|
|
36766
39425
|
}, (e) => {
|
|
36767
39426
|
let t = e.typesetRoot;
|
|
36768
|
-
return t &&
|
|
39427
|
+
return t && Y(t), !1;
|
|
36769
39428
|
});
|
|
36770
39429
|
let r = e.outputJax?.chtmlStyles;
|
|
36771
|
-
r?.id ===
|
|
39430
|
+
r?.id === Ge && (r.id = C), ut();
|
|
36772
39431
|
}
|
|
36773
|
-
function
|
|
36774
|
-
return e instanceof HTMLStyleElement &&
|
|
39432
|
+
function ct(e) {
|
|
39433
|
+
return e instanceof HTMLStyleElement && ie.includes(e.id);
|
|
36775
39434
|
}
|
|
36776
|
-
function
|
|
36777
|
-
|
|
39435
|
+
function lt(e) {
|
|
39436
|
+
x("foreign-output-stylesheet", `another MathJax added <style id="${e.id}"> to <head>`);
|
|
36778
39437
|
}
|
|
36779
|
-
function
|
|
36780
|
-
let e = document.head, t = [...e.children].find(
|
|
39438
|
+
function ut() {
|
|
39439
|
+
let e = document.head, t = [...e.children].find(ct);
|
|
36781
39440
|
if (t) {
|
|
36782
|
-
|
|
39441
|
+
lt(t);
|
|
36783
39442
|
return;
|
|
36784
39443
|
}
|
|
36785
39444
|
let n = new MutationObserver((e) => {
|
|
36786
39445
|
for (let t of e) {
|
|
36787
|
-
let e = [...t.addedNodes].find(
|
|
39446
|
+
let e = [...t.addedNodes].find(ct);
|
|
36788
39447
|
if (e) {
|
|
36789
|
-
|
|
39448
|
+
lt(e), n.disconnect();
|
|
36790
39449
|
return;
|
|
36791
39450
|
}
|
|
36792
39451
|
}
|
|
36793
39452
|
});
|
|
36794
39453
|
n.observe(e, { childList: !0 });
|
|
36795
39454
|
}
|
|
36796
|
-
function
|
|
39455
|
+
function dt(e) {
|
|
36797
39456
|
let t = e?.math;
|
|
36798
39457
|
if (!t?.remove) return;
|
|
36799
|
-
let n = [...t].filter((e) => (e.state?.() ?? 0) >=
|
|
39458
|
+
let n = [...t].filter((e) => (e.state?.() ?? 0) >= Je && e.typesetRoot?.isConnected === !1);
|
|
36800
39459
|
if (n.length !== 0) {
|
|
36801
39460
|
for (let e of [...n].reverse()) e.clear?.();
|
|
36802
39461
|
t.remove(...n);
|
|
36803
39462
|
}
|
|
36804
39463
|
}
|
|
36805
|
-
function
|
|
39464
|
+
function ft(e) {
|
|
36806
39465
|
return new Promise((t, n) => {
|
|
36807
39466
|
let r = e.startup ?? {};
|
|
36808
39467
|
e.startup = r;
|
|
36809
39468
|
let i = r.ready;
|
|
36810
39469
|
r.ready = () => {
|
|
36811
|
-
let e =
|
|
39470
|
+
let e = S()?.startup;
|
|
36812
39471
|
i ? i.call(r) : e?.defaultReady?.(), Promise.resolve(e?.promise).then(() => t(), n);
|
|
36813
39472
|
};
|
|
36814
39473
|
});
|
|
36815
39474
|
}
|
|
36816
|
-
function
|
|
36817
|
-
let t =
|
|
36818
|
-
return t ? t.version ? t.startup?.promise ? Promise.resolve(t.startup.promise).then(() => void 0) : Promise.resolve() :
|
|
39475
|
+
function pt(e) {
|
|
39476
|
+
let t = S();
|
|
39477
|
+
return t ? t.version ? t.startup?.promise ? Promise.resolve(t.startup.promise).then(() => void 0) : Promise.resolve() : ft(t) : rt(e);
|
|
36819
39478
|
}
|
|
36820
|
-
function
|
|
36821
|
-
return
|
|
36822
|
-
|
|
39479
|
+
function mt(e) {
|
|
39480
|
+
return pt(e).then(() => {
|
|
39481
|
+
let e = S();
|
|
39482
|
+
e && typeof e.typesetPromise != "function" && console.warn("[mathjax-renderer] MathJax on this page has no typesetPromise; math stays untypeset.");
|
|
36823
39483
|
});
|
|
36824
39484
|
}
|
|
36825
|
-
function
|
|
36826
|
-
let t =
|
|
36827
|
-
return n || (n =
|
|
39485
|
+
function ht(e) {
|
|
39486
|
+
let t = re, n = t[q];
|
|
39487
|
+
return n || (n = mt(e), t[q] = n), n;
|
|
36828
39488
|
}
|
|
36829
|
-
function
|
|
39489
|
+
function gt(e = {}) {
|
|
36830
39490
|
let t = e.useSingleDollar ?? !1;
|
|
36831
39491
|
return async (n) => {
|
|
36832
39492
|
if (typeof window > "u") return;
|
|
36833
|
-
let
|
|
36834
|
-
|
|
36835
|
-
let
|
|
36836
|
-
if (!
|
|
36837
|
-
|
|
39493
|
+
let r = ae();
|
|
39494
|
+
r && x("mathjax-3-global", `window.MathJax is MathJax ${r}`), et(n), ce(n), tt(n), Ae(n);
|
|
39495
|
+
let i = ht(e);
|
|
39496
|
+
if (!nt(n, t)) {
|
|
39497
|
+
i.catch(() => {});
|
|
36838
39498
|
return;
|
|
36839
39499
|
}
|
|
36840
|
-
await
|
|
36841
|
-
let
|
|
36842
|
-
if (await
|
|
36843
|
-
|
|
39500
|
+
await i;
|
|
39501
|
+
let a = S();
|
|
39502
|
+
if (await a?.startup?.promise, typeof a?.typesetPromise == "function") {
|
|
39503
|
+
Fe(), dt(a.startup?.document);
|
|
36844
39504
|
try {
|
|
36845
|
-
await
|
|
39505
|
+
await a.typesetPromise([n]);
|
|
36846
39506
|
} catch (e) {
|
|
36847
|
-
throw
|
|
39507
|
+
throw a.typesetClear?.([n]), e;
|
|
36848
39508
|
}
|
|
36849
|
-
|
|
39509
|
+
Y(n);
|
|
36850
39510
|
}
|
|
36851
39511
|
};
|
|
36852
39512
|
}
|
|
36853
|
-
var
|
|
36854
|
-
var
|
|
36855
|
-
var
|
|
36856
|
-
var
|
|
36857
|
-
var
|
|
36858
|
-
var
|
|
36859
|
-
function
|
|
36860
|
-
return !!window[
|
|
39513
|
+
var vt = "@pie-lib/math-rendering";
|
|
39514
|
+
var yt = "@pie-lib/math-rendering@2";
|
|
39515
|
+
var bt = "pie-print";
|
|
39516
|
+
var xt = 50;
|
|
39517
|
+
var St = 1e4;
|
|
39518
|
+
var Ct = null;
|
|
39519
|
+
function wt() {
|
|
39520
|
+
return !!window[yt]?.opts?.useSingleDollar;
|
|
36861
39521
|
}
|
|
36862
|
-
function
|
|
36863
|
-
return
|
|
39522
|
+
function Tt() {
|
|
39523
|
+
return Ct || (Ct = gt({ useSingleDollar: wt() })), Ct;
|
|
36864
39524
|
}
|
|
36865
|
-
function
|
|
39525
|
+
function Z() {
|
|
36866
39526
|
if (typeof window > "u") return null;
|
|
36867
|
-
let e = window[
|
|
39527
|
+
let e = window[vt];
|
|
36868
39528
|
return typeof e?.renderMath == "function" && e.renderMath !== $ ? e : null;
|
|
36869
39529
|
}
|
|
36870
|
-
function
|
|
39530
|
+
function Et(e) {
|
|
36871
39531
|
let t = e;
|
|
36872
39532
|
for (; t;) {
|
|
36873
|
-
if (t instanceof Element && t.localName ===
|
|
39533
|
+
if (t instanceof Element && t.localName === bt) return t;
|
|
36874
39534
|
t = t instanceof ShadowRoot ? t.host : t.parentNode;
|
|
36875
39535
|
}
|
|
36876
39536
|
return null;
|
|
36877
39537
|
}
|
|
36878
|
-
function
|
|
39538
|
+
function Q() {
|
|
36879
39539
|
let e = window.renderMath;
|
|
36880
39540
|
return typeof e == "function" ? e : null;
|
|
36881
39541
|
}
|
|
36882
|
-
async function
|
|
36883
|
-
let t =
|
|
39542
|
+
async function Dt(e) {
|
|
39543
|
+
let t = Et(e);
|
|
36884
39544
|
if (!t) return null;
|
|
36885
|
-
let n =
|
|
39545
|
+
let n = Q();
|
|
36886
39546
|
if (n || t.mathRenderingModuleUrlImported !== !0) return n;
|
|
36887
|
-
let r = Date.now() +
|
|
39547
|
+
let r = Date.now() + St;
|
|
36888
39548
|
for (; Date.now() < r;) {
|
|
36889
|
-
await new Promise((e) => setTimeout(e,
|
|
36890
|
-
let e =
|
|
39549
|
+
await new Promise((e) => setTimeout(e, xt));
|
|
39550
|
+
let e = Q();
|
|
36891
39551
|
if (e) return e;
|
|
36892
39552
|
}
|
|
36893
39553
|
return null;
|
|
@@ -36896,8 +39556,8 @@ var $ = async (e) => {
|
|
|
36896
39556
|
if (typeof window > "u") return;
|
|
36897
39557
|
let t = typeof e == "string", n;
|
|
36898
39558
|
t ? (n = document.createElement("div"), n.innerHTML = e) : n = e || document.body;
|
|
36899
|
-
let r =
|
|
36900
|
-
return r ? await r.renderMath?.(n) : i && i !== $ ? await i(n) : await
|
|
39559
|
+
let r = Z(), i = r || t ? null : await Dt(n);
|
|
39560
|
+
return r ? await r.renderMath?.(n) : i && i !== $ ? await i(n) : await Tt()(n), t ? n.innerHTML : void 0;
|
|
36901
39561
|
};
|
|
36902
39562
|
//#endregion
|
|
36903
39563
|
//#region src/delivery/tile-accessible-name.ts
|
|
@@ -37101,7 +39761,7 @@ function Tile($$anchor, $$props) {
|
|
|
37101
39761
|
var consequent_1 = ($$anchor) => {
|
|
37102
39762
|
var span_1 = root_1$2();
|
|
37103
39763
|
let classes_2;
|
|
37104
|
-
html(span_1, label, true);
|
|
39764
|
+
html$2(span_1, () => b$1(label()), true);
|
|
37105
39765
|
reset$1(span_1);
|
|
37106
39766
|
template_effect(() => classes_2 = set_class(span_1, 1, "tile-label svelte-1hgaksk", null, classes_2, { "tile-label-below": get$1(hasImage) }));
|
|
37107
39767
|
append($$anchor, span_1);
|
|
@@ -37290,15 +39950,15 @@ var $$css$2 = {
|
|
|
37290
39950
|
function TeacherInstructions($$anchor, $$props) {
|
|
37291
39951
|
push($$props, true);
|
|
37292
39952
|
append_styles$1($$anchor, $$css$2);
|
|
37293
|
-
let html
|
|
39953
|
+
let html = prop($$props, "html", 7), language = prop($$props, "language", 7);
|
|
37294
39954
|
let expanded = /* @__PURE__ */ state(false);
|
|
37295
39955
|
const panelId = `venn-teacher-instructions-${Math.random().toString(36).slice(2, 10)}`;
|
|
37296
39956
|
var $$exports = {
|
|
37297
39957
|
get html() {
|
|
37298
|
-
return html
|
|
39958
|
+
return html();
|
|
37299
39959
|
},
|
|
37300
39960
|
set html($$value) {
|
|
37301
|
-
html
|
|
39961
|
+
html($$value);
|
|
37302
39962
|
flushSync();
|
|
37303
39963
|
},
|
|
37304
39964
|
get language() {
|
|
@@ -37313,7 +39973,7 @@ function TeacherInstructions($$anchor, $$props) {
|
|
|
37313
39973
|
var button = child(div);
|
|
37314
39974
|
var text = only_child(button, true);
|
|
37315
39975
|
var div_1 = sibling(button, 2);
|
|
37316
|
-
html(div_1,
|
|
39976
|
+
html$2(div_1, () => b$1(html()), true);
|
|
37317
39977
|
reset$1(div_1);
|
|
37318
39978
|
reset$1(div);
|
|
37319
39979
|
template_effect(($0) => {
|
|
@@ -38257,7 +40917,7 @@ function VennClassification($$anchor, $$props) {
|
|
|
38257
40917
|
var node_1 = sibling(node, 2);
|
|
38258
40918
|
var consequent_1 = ($$anchor) => {
|
|
38259
40919
|
var div_1 = root$1();
|
|
38260
|
-
html(div_1, () => get$1(prompt), true);
|
|
40920
|
+
html$2(div_1, () => b$1(get$1(prompt)), true);
|
|
38261
40921
|
reset$1(div_1);
|
|
38262
40922
|
append($$anchor, div_1);
|
|
38263
40923
|
};
|
|
@@ -38918,7 +41578,7 @@ function Author($$anchor, $$props) {
|
|
|
38918
41578
|
scoringPolicy: get$1(config).scoringPolicy?.settings && l$1(get$1(config).scoringPolicy.label, SCORING_POLICY_CHOICES)
|
|
38919
41579
|
}
|
|
38920
41580
|
}));
|
|
38921
|
-
b$
|
|
41581
|
+
b$2($$anchor, {
|
|
38922
41582
|
get model() {
|
|
38923
41583
|
return get$1(m);
|
|
38924
41584
|
},
|
|
@@ -38933,7 +41593,7 @@ function Author($$anchor, $$props) {
|
|
|
38933
41593
|
}
|
|
38934
41594
|
};
|
|
38935
41595
|
let $0 = /* @__PURE__ */ user_derived(() => get$1(config).settingsPanelDisabled === true || !s$1(get$1(config)));
|
|
38936
|
-
y$
|
|
41596
|
+
y$2(node, {
|
|
38937
41597
|
get hideSettings() {
|
|
38938
41598
|
return get$1($0);
|
|
38939
41599
|
},
|