vult-security-kyc 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,87 +1,91 @@
|
|
|
1
1
|
var Rn = Object.defineProperty;
|
|
2
|
-
var Dn = (s,
|
|
3
|
-
var
|
|
4
|
-
function
|
|
2
|
+
var Dn = (s, i, u) => i in s ? Rn(s, i, { enumerable: !0, configurable: !0, writable: !0, value: u }) : s[i] = u;
|
|
3
|
+
var g = (s, i, u) => Dn(s, typeof i != "symbol" ? i + "" : i, u);
|
|
4
|
+
function Ln(s) {
|
|
5
5
|
return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
|
|
6
6
|
}
|
|
7
|
-
/*! @license DOMPurify 3.
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
if (
|
|
11
|
-
|
|
7
|
+
/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */
|
|
8
|
+
var Ve, vt;
|
|
9
|
+
function Ct() {
|
|
10
|
+
if (vt) return Ve;
|
|
11
|
+
vt = 1;
|
|
12
12
|
const {
|
|
13
13
|
entries: s,
|
|
14
|
-
setPrototypeOf:
|
|
15
|
-
isFrozen:
|
|
14
|
+
setPrototypeOf: i,
|
|
15
|
+
isFrozen: u,
|
|
16
16
|
getPrototypeOf: d,
|
|
17
|
-
getOwnPropertyDescriptor:
|
|
17
|
+
getOwnPropertyDescriptor: A
|
|
18
18
|
} = Object;
|
|
19
19
|
let {
|
|
20
|
-
freeze:
|
|
21
|
-
seal:
|
|
22
|
-
create:
|
|
20
|
+
freeze: E,
|
|
21
|
+
seal: m,
|
|
22
|
+
create: M
|
|
23
23
|
} = Object, {
|
|
24
|
-
apply:
|
|
25
|
-
construct:
|
|
24
|
+
apply: J,
|
|
25
|
+
construct: F
|
|
26
26
|
} = typeof Reflect < "u" && Reflect;
|
|
27
|
-
|
|
27
|
+
E || (E = function(o) {
|
|
28
28
|
return o;
|
|
29
|
-
}),
|
|
29
|
+
}), m || (m = function(o) {
|
|
30
30
|
return o;
|
|
31
|
-
}),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return
|
|
31
|
+
}), J || (J = function(o, f) {
|
|
32
|
+
for (var a = arguments.length, p = new Array(a > 2 ? a - 2 : 0), v = 2; v < a; v++)
|
|
33
|
+
p[v - 2] = arguments[v];
|
|
34
|
+
return o.apply(f, p);
|
|
35
|
+
}), F || (F = function(o) {
|
|
36
|
+
for (var f = arguments.length, a = new Array(f > 1 ? f - 1 : 0), p = 1; p < f; p++)
|
|
37
|
+
a[p - 1] = arguments[p];
|
|
38
|
+
return new o(...a);
|
|
35
39
|
});
|
|
36
|
-
const
|
|
40
|
+
const me = L(Array.prototype.forEach), kt = L(Array.prototype.lastIndexOf), Xe = L(Array.prototype.pop), ee = L(Array.prototype.push), Ht = L(Array.prototype.splice), de = L(String.prototype.toLowerCase), Ie = L(String.prototype.toString), Re = L(String.prototype.match), te = L(String.prototype.replace), Wt = L(String.prototype.indexOf), Ut = L(String.prototype.trim), N = L(Object.prototype.hasOwnProperty), D = L(RegExp.prototype.test), ne = zt(TypeError);
|
|
37
41
|
function L(c) {
|
|
38
42
|
return function(o) {
|
|
39
43
|
o instanceof RegExp && (o.lastIndex = 0);
|
|
40
|
-
for (var f = arguments.length,
|
|
41
|
-
|
|
42
|
-
return
|
|
44
|
+
for (var f = arguments.length, a = new Array(f > 1 ? f - 1 : 0), p = 1; p < f; p++)
|
|
45
|
+
a[p - 1] = arguments[p];
|
|
46
|
+
return J(c, o, a);
|
|
43
47
|
};
|
|
44
48
|
}
|
|
45
|
-
function
|
|
49
|
+
function zt(c) {
|
|
46
50
|
return function() {
|
|
47
|
-
for (var o = arguments.length, f = new Array(o),
|
|
48
|
-
f[
|
|
49
|
-
return
|
|
51
|
+
for (var o = arguments.length, f = new Array(o), a = 0; a < o; a++)
|
|
52
|
+
f[a] = arguments[a];
|
|
53
|
+
return F(c, f);
|
|
50
54
|
};
|
|
51
55
|
}
|
|
52
|
-
function
|
|
53
|
-
let f = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
54
|
-
|
|
55
|
-
let
|
|
56
|
-
for (;
|
|
57
|
-
let
|
|
58
|
-
if (typeof
|
|
59
|
-
const
|
|
60
|
-
|
|
56
|
+
function l(c, o) {
|
|
57
|
+
let f = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : de;
|
|
58
|
+
i && i(c, null);
|
|
59
|
+
let a = o.length;
|
|
60
|
+
for (; a--; ) {
|
|
61
|
+
let p = o[a];
|
|
62
|
+
if (typeof p == "string") {
|
|
63
|
+
const v = f(p);
|
|
64
|
+
v !== p && (u(o) || (o[a] = v), p = v);
|
|
61
65
|
}
|
|
62
|
-
c[
|
|
66
|
+
c[p] = !0;
|
|
63
67
|
}
|
|
64
68
|
return c;
|
|
65
69
|
}
|
|
66
|
-
function
|
|
70
|
+
function Ft(c) {
|
|
67
71
|
for (let o = 0; o < c.length; o++)
|
|
68
|
-
|
|
72
|
+
N(c, o) || (c[o] = null);
|
|
69
73
|
return c;
|
|
70
74
|
}
|
|
71
|
-
function
|
|
72
|
-
const o =
|
|
73
|
-
for (const [f,
|
|
74
|
-
|
|
75
|
+
function P(c) {
|
|
76
|
+
const o = M(null);
|
|
77
|
+
for (const [f, a] of s(c))
|
|
78
|
+
N(c, f) && (Array.isArray(a) ? o[f] = Ft(a) : a && typeof a == "object" && a.constructor === Object ? o[f] = P(a) : o[f] = a);
|
|
75
79
|
return o;
|
|
76
80
|
}
|
|
77
|
-
function
|
|
81
|
+
function ie(c, o) {
|
|
78
82
|
for (; c !== null; ) {
|
|
79
|
-
const
|
|
80
|
-
if (
|
|
81
|
-
if (
|
|
82
|
-
return L(
|
|
83
|
-
if (typeof
|
|
84
|
-
return L(
|
|
83
|
+
const a = A(c, o);
|
|
84
|
+
if (a) {
|
|
85
|
+
if (a.get)
|
|
86
|
+
return L(a.get);
|
|
87
|
+
if (typeof a.value == "function")
|
|
88
|
+
return L(a.value);
|
|
85
89
|
}
|
|
86
90
|
c = d(c);
|
|
87
91
|
}
|
|
@@ -90,55 +94,55 @@ function vt() {
|
|
|
90
94
|
}
|
|
91
95
|
return f;
|
|
92
96
|
}
|
|
93
|
-
const Ke =
|
|
97
|
+
const Ke = E(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), De = E(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Le = E(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Gt = E(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), be = E(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), Bt = E(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), qe = E(["#text"]), Ze = E(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), Oe = E(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), Qe = E(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), pe = E(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Yt = m(/\{\{[\w\W]*|[\w\W]*\}\}/gm), $t = m(/<%[\w\W]*|[\w\W]*%>/gm), Vt = m(/\$\{[\w\W]*/gm), jt = m(/^data-[\-\w.\u00B7-\uFFFF]+$/), Xt = m(/^aria-[\-\w]+$/), Je = m(
|
|
94
98
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
95
99
|
// eslint-disable-line no-useless-escape
|
|
96
|
-
), Kt =
|
|
100
|
+
), Kt = m(/^(?:\w+script|data):/i), qt = m(
|
|
97
101
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
98
102
|
// eslint-disable-line no-control-regex
|
|
99
|
-
),
|
|
100
|
-
var
|
|
103
|
+
), et = m(/^html$/i), Zt = m(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
104
|
+
var tt = /* @__PURE__ */ Object.freeze({
|
|
101
105
|
__proto__: null,
|
|
102
|
-
ARIA_ATTR:
|
|
103
|
-
ATTR_WHITESPACE:
|
|
104
|
-
CUSTOM_ELEMENT:
|
|
105
|
-
DATA_ATTR:
|
|
106
|
-
DOCTYPE_NAME:
|
|
107
|
-
ERB_EXPR:
|
|
108
|
-
IS_ALLOWED_URI:
|
|
106
|
+
ARIA_ATTR: Xt,
|
|
107
|
+
ATTR_WHITESPACE: qt,
|
|
108
|
+
CUSTOM_ELEMENT: Zt,
|
|
109
|
+
DATA_ATTR: jt,
|
|
110
|
+
DOCTYPE_NAME: et,
|
|
111
|
+
ERB_EXPR: $t,
|
|
112
|
+
IS_ALLOWED_URI: Je,
|
|
109
113
|
IS_SCRIPT_OR_DATA: Kt,
|
|
110
|
-
MUSTACHE_EXPR:
|
|
114
|
+
MUSTACHE_EXPR: Yt,
|
|
111
115
|
TMPLIT_EXPR: Vt
|
|
112
116
|
});
|
|
113
|
-
const
|
|
117
|
+
const oe = {
|
|
114
118
|
element: 1,
|
|
115
119
|
text: 3,
|
|
116
120
|
// Deprecated
|
|
117
121
|
progressingInstruction: 7,
|
|
118
122
|
comment: 8,
|
|
119
123
|
document: 9
|
|
120
|
-
},
|
|
124
|
+
}, Qt = function() {
|
|
121
125
|
return typeof window > "u" ? null : window;
|
|
122
|
-
},
|
|
126
|
+
}, Jt = function(o, f) {
|
|
123
127
|
if (typeof o != "object" || typeof o.createPolicy != "function")
|
|
124
128
|
return null;
|
|
125
|
-
let
|
|
126
|
-
const
|
|
127
|
-
f && f.hasAttribute(
|
|
128
|
-
const
|
|
129
|
+
let a = null;
|
|
130
|
+
const p = "data-tt-policy-suffix";
|
|
131
|
+
f && f.hasAttribute(p) && (a = f.getAttribute(p));
|
|
132
|
+
const v = "dompurify" + (a ? "#" + a : "");
|
|
129
133
|
try {
|
|
130
|
-
return o.createPolicy(
|
|
131
|
-
createHTML(
|
|
132
|
-
return
|
|
134
|
+
return o.createPolicy(v, {
|
|
135
|
+
createHTML(G) {
|
|
136
|
+
return G;
|
|
133
137
|
},
|
|
134
|
-
createScriptURL(
|
|
135
|
-
return
|
|
138
|
+
createScriptURL(G) {
|
|
139
|
+
return G;
|
|
136
140
|
}
|
|
137
141
|
});
|
|
138
142
|
} catch {
|
|
139
|
-
return console.warn("TrustedTypes policy " +
|
|
143
|
+
return console.warn("TrustedTypes policy " + v + " could not be created."), null;
|
|
140
144
|
}
|
|
141
|
-
},
|
|
145
|
+
}, nt = function() {
|
|
142
146
|
return {
|
|
143
147
|
afterSanitizeAttributes: [],
|
|
144
148
|
afterSanitizeElements: [],
|
|
@@ -151,57 +155,57 @@ function vt() {
|
|
|
151
155
|
uponSanitizeShadowNode: []
|
|
152
156
|
};
|
|
153
157
|
};
|
|
154
|
-
function
|
|
155
|
-
let c = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
156
|
-
const o = (r) =>
|
|
157
|
-
if (o.version = "3.
|
|
158
|
+
function it() {
|
|
159
|
+
let c = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Qt();
|
|
160
|
+
const o = (r) => it(r);
|
|
161
|
+
if (o.version = "3.3.0", o.removed = [], !c || !c.document || c.document.nodeType !== oe.document || !c.Element)
|
|
158
162
|
return o.isSupported = !1, o;
|
|
159
163
|
let {
|
|
160
164
|
document: f
|
|
161
165
|
} = c;
|
|
162
|
-
const
|
|
163
|
-
DocumentFragment:
|
|
164
|
-
HTMLTemplateElement:
|
|
165
|
-
Node:
|
|
166
|
-
Element:
|
|
167
|
-
NodeFilter:
|
|
168
|
-
NamedNodeMap:
|
|
169
|
-
HTMLFormElement:
|
|
170
|
-
DOMParser:
|
|
171
|
-
trustedTypes:
|
|
172
|
-
} = c,
|
|
173
|
-
if (typeof
|
|
166
|
+
const a = f, p = a.currentScript, {
|
|
167
|
+
DocumentFragment: v,
|
|
168
|
+
HTMLTemplateElement: G,
|
|
169
|
+
Node: ve,
|
|
170
|
+
Element: ot,
|
|
171
|
+
NodeFilter: re,
|
|
172
|
+
NamedNodeMap: tn = c.NamedNodeMap || c.MozNamedAttrMap,
|
|
173
|
+
HTMLFormElement: nn,
|
|
174
|
+
DOMParser: on,
|
|
175
|
+
trustedTypes: he
|
|
176
|
+
} = c, se = ot.prototype, rn = ie(se, "cloneNode"), sn = ie(se, "remove"), an = ie(se, "nextSibling"), ln = ie(se, "childNodes"), ge = ie(se, "parentNode");
|
|
177
|
+
if (typeof G == "function") {
|
|
174
178
|
const r = f.createElement("template");
|
|
175
179
|
r.content && r.content.ownerDocument && (f = r.content.ownerDocument);
|
|
176
180
|
}
|
|
177
|
-
let
|
|
181
|
+
let b, ae = "";
|
|
178
182
|
const {
|
|
179
|
-
implementation:
|
|
180
|
-
createNodeIterator:
|
|
181
|
-
createDocumentFragment:
|
|
182
|
-
getElementsByTagName:
|
|
183
|
+
implementation: Ce,
|
|
184
|
+
createNodeIterator: cn,
|
|
185
|
+
createDocumentFragment: un,
|
|
186
|
+
getElementsByTagName: fn
|
|
183
187
|
} = f, {
|
|
184
|
-
importNode:
|
|
185
|
-
} =
|
|
186
|
-
let
|
|
187
|
-
o.isSupported = typeof s == "function" && typeof
|
|
188
|
+
importNode: mn
|
|
189
|
+
} = a;
|
|
190
|
+
let O = nt();
|
|
191
|
+
o.isSupported = typeof s == "function" && typeof ge == "function" && Ce && Ce.createHTMLDocument !== void 0;
|
|
188
192
|
const {
|
|
189
|
-
MUSTACHE_EXPR:
|
|
190
|
-
ERB_EXPR:
|
|
191
|
-
TMPLIT_EXPR:
|
|
192
|
-
DATA_ATTR:
|
|
193
|
-
ARIA_ATTR:
|
|
194
|
-
IS_SCRIPT_OR_DATA:
|
|
195
|
-
ATTR_WHITESPACE:
|
|
196
|
-
CUSTOM_ELEMENT:
|
|
197
|
-
} =
|
|
193
|
+
MUSTACHE_EXPR: Me,
|
|
194
|
+
ERB_EXPR: Ne,
|
|
195
|
+
TMPLIT_EXPR: xe,
|
|
196
|
+
DATA_ATTR: dn,
|
|
197
|
+
ARIA_ATTR: pn,
|
|
198
|
+
IS_SCRIPT_OR_DATA: hn,
|
|
199
|
+
ATTR_WHITESPACE: rt,
|
|
200
|
+
CUSTOM_ELEMENT: gn
|
|
201
|
+
} = tt;
|
|
198
202
|
let {
|
|
199
|
-
IS_ALLOWED_URI:
|
|
200
|
-
} =
|
|
201
|
-
const
|
|
202
|
-
let
|
|
203
|
-
const
|
|
204
|
-
let
|
|
203
|
+
IS_ALLOWED_URI: st
|
|
204
|
+
} = tt, w = null;
|
|
205
|
+
const at = l({}, [...Ke, ...De, ...Le, ...be, ...qe]);
|
|
206
|
+
let y = null;
|
|
207
|
+
const lt = l({}, [...Ze, ...Oe, ...Qe, ...pe]);
|
|
208
|
+
let T = Object.seal(M(null, {
|
|
205
209
|
tagNameCheck: {
|
|
206
210
|
writable: !0,
|
|
207
211
|
configurable: !1,
|
|
@@ -220,70 +224,85 @@ function vt() {
|
|
|
220
224
|
enumerable: !0,
|
|
221
225
|
value: !1
|
|
222
226
|
}
|
|
223
|
-
})),
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
227
|
+
})), le = null, Pe = null;
|
|
228
|
+
const B = Object.seal(M(null, {
|
|
229
|
+
tagCheck: {
|
|
230
|
+
writable: !0,
|
|
231
|
+
configurable: !1,
|
|
232
|
+
enumerable: !0,
|
|
233
|
+
value: null
|
|
234
|
+
},
|
|
235
|
+
attributeCheck: {
|
|
236
|
+
writable: !0,
|
|
237
|
+
configurable: !1,
|
|
238
|
+
enumerable: !0,
|
|
239
|
+
value: null
|
|
240
|
+
}
|
|
241
|
+
}));
|
|
242
|
+
let ct = !0, ke = !0, ut = !1, ft = !0, Y = !1, Ee = !0, U = !1, He = !1, We = !1, $ = !1, Te = !1, _e = !1, mt = !0, dt = !1;
|
|
243
|
+
const En = "user-content-";
|
|
244
|
+
let Ue = !0, ce = !1, V = {}, j = null;
|
|
245
|
+
const pt = l({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
246
|
+
let ht = null;
|
|
247
|
+
const gt = l({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
248
|
+
let ze = null;
|
|
249
|
+
const Et = l({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Ae = "http://www.w3.org/1998/Math/MathML", we = "http://www.w3.org/2000/svg", k = "http://www.w3.org/1999/xhtml";
|
|
250
|
+
let X = k, Fe = !1, Ge = null;
|
|
251
|
+
const Tn = l({}, [Ae, we, k], Ie);
|
|
252
|
+
let Se = l({}, ["mi", "mo", "mn", "ms", "mtext"]), ye = l({}, ["annotation-xml"]);
|
|
253
|
+
const _n = l({}, ["title", "style", "font", "a", "script"]);
|
|
254
|
+
let ue = null;
|
|
255
|
+
const An = ["application/xhtml+xml", "text/html"], wn = "text/html";
|
|
256
|
+
let S = null, K = null;
|
|
257
|
+
const Sn = f.createElement("form"), Tt = function(e) {
|
|
239
258
|
return e instanceof RegExp || e instanceof Function;
|
|
240
|
-
},
|
|
259
|
+
}, Be = function() {
|
|
241
260
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
242
|
-
if (!(
|
|
243
|
-
if ((!e || typeof e != "object") && (e = {}), e =
|
|
244
|
-
|
|
261
|
+
if (!(K && K === e)) {
|
|
262
|
+
if ((!e || typeof e != "object") && (e = {}), e = P(e), ue = // eslint-disable-next-line unicorn/prefer-includes
|
|
263
|
+
An.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? wn : e.PARSER_MEDIA_TYPE, S = ue === "application/xhtml+xml" ? Ie : de, w = N(e, "ALLOWED_TAGS") ? l({}, e.ALLOWED_TAGS, S) : at, y = N(e, "ALLOWED_ATTR") ? l({}, e.ALLOWED_ATTR, S) : lt, Ge = N(e, "ALLOWED_NAMESPACES") ? l({}, e.ALLOWED_NAMESPACES, Ie) : Tn, ze = N(e, "ADD_URI_SAFE_ATTR") ? l(P(Et), e.ADD_URI_SAFE_ATTR, S) : Et, ht = N(e, "ADD_DATA_URI_TAGS") ? l(P(gt), e.ADD_DATA_URI_TAGS, S) : gt, j = N(e, "FORBID_CONTENTS") ? l({}, e.FORBID_CONTENTS, S) : pt, le = N(e, "FORBID_TAGS") ? l({}, e.FORBID_TAGS, S) : P({}), Pe = N(e, "FORBID_ATTR") ? l({}, e.FORBID_ATTR, S) : P({}), V = N(e, "USE_PROFILES") ? e.USE_PROFILES : !1, ct = e.ALLOW_ARIA_ATTR !== !1, ke = e.ALLOW_DATA_ATTR !== !1, ut = e.ALLOW_UNKNOWN_PROTOCOLS || !1, ft = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Y = e.SAFE_FOR_TEMPLATES || !1, Ee = e.SAFE_FOR_XML !== !1, U = e.WHOLE_DOCUMENT || !1, $ = e.RETURN_DOM || !1, Te = e.RETURN_DOM_FRAGMENT || !1, _e = e.RETURN_TRUSTED_TYPE || !1, We = e.FORCE_BODY || !1, mt = e.SANITIZE_DOM !== !1, dt = e.SANITIZE_NAMED_PROPS || !1, Ue = e.KEEP_CONTENT !== !1, ce = e.IN_PLACE || !1, st = e.ALLOWED_URI_REGEXP || Je, X = e.NAMESPACE || k, Se = e.MATHML_TEXT_INTEGRATION_POINTS || Se, ye = e.HTML_INTEGRATION_POINTS || ye, T = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && Tt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (T.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && Tt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (T.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (T.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Y && (ke = !1), Te && ($ = !0), V && (w = l({}, qe), y = [], V.html === !0 && (l(w, Ke), l(y, Ze)), V.svg === !0 && (l(w, De), l(y, Oe), l(y, pe)), V.svgFilters === !0 && (l(w, Le), l(y, Oe), l(y, pe)), V.mathMl === !0 && (l(w, be), l(y, Qe), l(y, pe))), e.ADD_TAGS && (typeof e.ADD_TAGS == "function" ? B.tagCheck = e.ADD_TAGS : (w === at && (w = P(w)), l(w, e.ADD_TAGS, S))), e.ADD_ATTR && (typeof e.ADD_ATTR == "function" ? B.attributeCheck = e.ADD_ATTR : (y === lt && (y = P(y)), l(y, e.ADD_ATTR, S))), e.ADD_URI_SAFE_ATTR && l(ze, e.ADD_URI_SAFE_ATTR, S), e.FORBID_CONTENTS && (j === pt && (j = P(j)), l(j, e.FORBID_CONTENTS, S)), Ue && (w["#text"] = !0), U && l(w, ["html", "head", "body"]), w.table && (l(w, ["tbody"]), delete le.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
245
264
|
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
246
|
-
throw
|
|
265
|
+
throw ne('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
247
266
|
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
248
|
-
throw
|
|
249
|
-
|
|
267
|
+
throw ne('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
268
|
+
b = e.TRUSTED_TYPES_POLICY, ae = b.createHTML("");
|
|
250
269
|
} else
|
|
251
|
-
|
|
252
|
-
|
|
270
|
+
b === void 0 && (b = Jt(he, p)), b !== null && typeof ae == "string" && (ae = b.createHTML(""));
|
|
271
|
+
E && E(e), K = e;
|
|
253
272
|
}
|
|
254
|
-
},
|
|
255
|
-
let t =
|
|
273
|
+
}, _t = l({}, [...De, ...Le, ...Gt]), At = l({}, [...be, ...Bt]), yn = function(e) {
|
|
274
|
+
let t = ge(e);
|
|
256
275
|
(!t || !t.tagName) && (t = {
|
|
257
|
-
namespaceURI:
|
|
276
|
+
namespaceURI: X,
|
|
258
277
|
tagName: "template"
|
|
259
278
|
});
|
|
260
|
-
const
|
|
261
|
-
return
|
|
262
|
-
},
|
|
263
|
-
|
|
279
|
+
const n = de(e.tagName), h = de(t.tagName);
|
|
280
|
+
return Ge[e.namespaceURI] ? e.namespaceURI === we ? t.namespaceURI === k ? n === "svg" : t.namespaceURI === Ae ? n === "svg" && (h === "annotation-xml" || Se[h]) : !!_t[n] : e.namespaceURI === Ae ? t.namespaceURI === k ? n === "math" : t.namespaceURI === we ? n === "math" && ye[h] : !!At[n] : e.namespaceURI === k ? t.namespaceURI === we && !ye[h] || t.namespaceURI === Ae && !Se[h] ? !1 : !At[n] && (_n[n] || !_t[n]) : !!(ue === "application/xhtml+xml" && Ge[e.namespaceURI]) : !1;
|
|
281
|
+
}, x = function(e) {
|
|
282
|
+
ee(o.removed, {
|
|
264
283
|
element: e
|
|
265
284
|
});
|
|
266
285
|
try {
|
|
267
|
-
|
|
286
|
+
ge(e).removeChild(e);
|
|
268
287
|
} catch {
|
|
269
|
-
|
|
288
|
+
sn(e);
|
|
270
289
|
}
|
|
271
|
-
},
|
|
290
|
+
}, z = function(e, t) {
|
|
272
291
|
try {
|
|
273
|
-
|
|
292
|
+
ee(o.removed, {
|
|
274
293
|
attribute: t.getAttributeNode(e),
|
|
275
294
|
from: t
|
|
276
295
|
});
|
|
277
296
|
} catch {
|
|
278
|
-
|
|
297
|
+
ee(o.removed, {
|
|
279
298
|
attribute: null,
|
|
280
299
|
from: t
|
|
281
300
|
});
|
|
282
301
|
}
|
|
283
302
|
if (t.removeAttribute(e), e === "is")
|
|
284
|
-
if (
|
|
303
|
+
if ($ || Te)
|
|
285
304
|
try {
|
|
286
|
-
|
|
305
|
+
x(t);
|
|
287
306
|
} catch {
|
|
288
307
|
}
|
|
289
308
|
else
|
|
@@ -291,98 +310,100 @@ function vt() {
|
|
|
291
310
|
t.setAttribute(e, "");
|
|
292
311
|
} catch {
|
|
293
312
|
}
|
|
294
|
-
},
|
|
295
|
-
let t = null,
|
|
296
|
-
if (
|
|
313
|
+
}, wt = function(e) {
|
|
314
|
+
let t = null, n = null;
|
|
315
|
+
if (We)
|
|
297
316
|
e = "<remove></remove>" + e;
|
|
298
317
|
else {
|
|
299
|
-
const
|
|
300
|
-
|
|
318
|
+
const _ = Re(e, /^[\r\n\t ]+/);
|
|
319
|
+
n = _ && _[0];
|
|
301
320
|
}
|
|
302
|
-
|
|
303
|
-
const
|
|
304
|
-
if (
|
|
321
|
+
ue === "application/xhtml+xml" && X === k && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
|
|
322
|
+
const h = b ? b.createHTML(e) : e;
|
|
323
|
+
if (X === k)
|
|
305
324
|
try {
|
|
306
|
-
t = new
|
|
325
|
+
t = new on().parseFromString(h, ue);
|
|
307
326
|
} catch {
|
|
308
327
|
}
|
|
309
328
|
if (!t || !t.documentElement) {
|
|
310
|
-
t =
|
|
329
|
+
t = Ce.createDocument(X, "template", null);
|
|
311
330
|
try {
|
|
312
|
-
t.documentElement.innerHTML =
|
|
331
|
+
t.documentElement.innerHTML = Fe ? ae : h;
|
|
313
332
|
} catch {
|
|
314
333
|
}
|
|
315
334
|
}
|
|
316
|
-
const
|
|
317
|
-
return e &&
|
|
335
|
+
const R = t.body || t.documentElement;
|
|
336
|
+
return e && n && R.insertBefore(f.createTextNode(n), R.childNodes[0] || null), X === k ? fn.call(t, U ? "html" : "body")[0] : U ? t.documentElement : R;
|
|
318
337
|
}, St = function(e) {
|
|
319
|
-
return
|
|
338
|
+
return cn.call(
|
|
320
339
|
e.ownerDocument || e,
|
|
321
340
|
e,
|
|
322
341
|
// eslint-disable-next-line no-bitwise
|
|
323
|
-
|
|
342
|
+
re.SHOW_ELEMENT | re.SHOW_COMMENT | re.SHOW_TEXT | re.SHOW_PROCESSING_INSTRUCTION | re.SHOW_CDATA_SECTION,
|
|
324
343
|
null
|
|
325
344
|
);
|
|
326
|
-
},
|
|
327
|
-
return e instanceof
|
|
328
|
-
},
|
|
329
|
-
return typeof
|
|
345
|
+
}, Ye = function(e) {
|
|
346
|
+
return e instanceof nn && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof tn) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
|
|
347
|
+
}, yt = function(e) {
|
|
348
|
+
return typeof ve == "function" && e instanceof ve;
|
|
330
349
|
};
|
|
331
|
-
function
|
|
332
|
-
|
|
333
|
-
|
|
350
|
+
function H(r, e, t) {
|
|
351
|
+
me(r, (n) => {
|
|
352
|
+
n.call(o, e, t, K);
|
|
334
353
|
});
|
|
335
354
|
}
|
|
336
|
-
const
|
|
355
|
+
const It = function(e) {
|
|
337
356
|
let t = null;
|
|
338
|
-
if (
|
|
339
|
-
return
|
|
340
|
-
const
|
|
341
|
-
if (
|
|
342
|
-
tagName:
|
|
343
|
-
allowedTags:
|
|
344
|
-
}),
|
|
345
|
-
return
|
|
346
|
-
if (!
|
|
347
|
-
if (!
|
|
357
|
+
if (H(O.beforeSanitizeElements, e, null), Ye(e))
|
|
358
|
+
return x(e), !0;
|
|
359
|
+
const n = S(e.nodeName);
|
|
360
|
+
if (H(O.uponSanitizeElement, e, {
|
|
361
|
+
tagName: n,
|
|
362
|
+
allowedTags: w
|
|
363
|
+
}), Ee && e.hasChildNodes() && !yt(e.firstElementChild) && D(/<[/\w!]/g, e.innerHTML) && D(/<[/\w!]/g, e.textContent) || e.nodeType === oe.progressingInstruction || Ee && e.nodeType === oe.comment && D(/<[/\w]/g, e.data))
|
|
364
|
+
return x(e), !0;
|
|
365
|
+
if (!(B.tagCheck instanceof Function && B.tagCheck(n)) && (!w[n] || le[n])) {
|
|
366
|
+
if (!le[n] && Dt(n) && (T.tagNameCheck instanceof RegExp && D(T.tagNameCheck, n) || T.tagNameCheck instanceof Function && T.tagNameCheck(n)))
|
|
348
367
|
return !1;
|
|
349
|
-
if (
|
|
350
|
-
const
|
|
351
|
-
if (
|
|
352
|
-
const
|
|
353
|
-
for (let
|
|
354
|
-
const
|
|
355
|
-
|
|
368
|
+
if (Ue && !j[n]) {
|
|
369
|
+
const h = ge(e) || e.parentNode, R = ln(e) || e.childNodes;
|
|
370
|
+
if (R && h) {
|
|
371
|
+
const _ = R.length;
|
|
372
|
+
for (let C = _ - 1; C >= 0; --C) {
|
|
373
|
+
const W = rn(R[C], !0);
|
|
374
|
+
W.__removalCount = (e.__removalCount || 0) + 1, h.insertBefore(W, an(e));
|
|
356
375
|
}
|
|
357
376
|
}
|
|
358
377
|
}
|
|
359
|
-
return
|
|
378
|
+
return x(e), !0;
|
|
360
379
|
}
|
|
361
|
-
return e instanceof
|
|
362
|
-
t =
|
|
363
|
-
}), e.textContent !== t && (
|
|
380
|
+
return e instanceof ot && !yn(e) || (n === "noscript" || n === "noembed" || n === "noframes") && D(/<\/no(script|embed|frames)/i, e.innerHTML) ? (x(e), !0) : (Y && e.nodeType === oe.text && (t = e.textContent, me([Me, Ne, xe], (h) => {
|
|
381
|
+
t = te(t, h, " ");
|
|
382
|
+
}), e.textContent !== t && (ee(o.removed, {
|
|
364
383
|
element: e.cloneNode()
|
|
365
|
-
}), e.textContent = t)),
|
|
366
|
-
}, Rt = function(e, t,
|
|
367
|
-
if (
|
|
384
|
+
}), e.textContent = t)), H(O.afterSanitizeElements, e, null), !1);
|
|
385
|
+
}, Rt = function(e, t, n) {
|
|
386
|
+
if (mt && (t === "id" || t === "name") && (n in f || n in Sn))
|
|
368
387
|
return !1;
|
|
369
|
-
if (!(
|
|
370
|
-
if (!(
|
|
371
|
-
if (!
|
|
372
|
-
if (
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
if (!
|
|
382
|
-
if (!(
|
|
383
|
-
if (!(
|
|
384
|
-
if (
|
|
385
|
-
|
|
388
|
+
if (!(ke && !Pe[t] && D(dn, t))) {
|
|
389
|
+
if (!(ct && D(pn, t))) {
|
|
390
|
+
if (!(B.attributeCheck instanceof Function && B.attributeCheck(t, e))) {
|
|
391
|
+
if (!y[t] || Pe[t]) {
|
|
392
|
+
if (
|
|
393
|
+
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
394
|
+
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
395
|
+
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
396
|
+
!(Dt(e) && (T.tagNameCheck instanceof RegExp && D(T.tagNameCheck, e) || T.tagNameCheck instanceof Function && T.tagNameCheck(e)) && (T.attributeNameCheck instanceof RegExp && D(T.attributeNameCheck, t) || T.attributeNameCheck instanceof Function && T.attributeNameCheck(t, e)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
397
|
+
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
398
|
+
t === "is" && T.allowCustomizedBuiltInElements && (T.tagNameCheck instanceof RegExp && D(T.tagNameCheck, n) || T.tagNameCheck instanceof Function && T.tagNameCheck(n)))
|
|
399
|
+
) return !1;
|
|
400
|
+
} else if (!ze[t]) {
|
|
401
|
+
if (!D(st, te(n, rt, ""))) {
|
|
402
|
+
if (!((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Wt(n, "data:") === 0 && ht[e])) {
|
|
403
|
+
if (!(ut && !D(hn, te(n, rt, "")))) {
|
|
404
|
+
if (n)
|
|
405
|
+
return !1;
|
|
406
|
+
}
|
|
386
407
|
}
|
|
387
408
|
}
|
|
388
409
|
}
|
|
@@ -391,154 +412,158 @@ function vt() {
|
|
|
391
412
|
}
|
|
392
413
|
return !0;
|
|
393
414
|
}, Dt = function(e) {
|
|
394
|
-
return e !== "annotation-xml" &&
|
|
395
|
-
},
|
|
396
|
-
|
|
415
|
+
return e !== "annotation-xml" && Re(e, gn);
|
|
416
|
+
}, Lt = function(e) {
|
|
417
|
+
H(O.beforeSanitizeAttributes, e, null);
|
|
397
418
|
const {
|
|
398
419
|
attributes: t
|
|
399
420
|
} = e;
|
|
400
|
-
if (!t ||
|
|
421
|
+
if (!t || Ye(e))
|
|
401
422
|
return;
|
|
402
|
-
const
|
|
423
|
+
const n = {
|
|
403
424
|
attrName: "",
|
|
404
425
|
attrValue: "",
|
|
405
426
|
keepAttr: !0,
|
|
406
|
-
allowedAttributes:
|
|
427
|
+
allowedAttributes: y,
|
|
407
428
|
forceKeepAttr: void 0
|
|
408
429
|
};
|
|
409
|
-
let
|
|
410
|
-
for (;
|
|
411
|
-
const
|
|
412
|
-
name:
|
|
413
|
-
namespaceURI:
|
|
414
|
-
value:
|
|
415
|
-
} =
|
|
416
|
-
let
|
|
417
|
-
if (
|
|
418
|
-
|
|
430
|
+
let h = t.length;
|
|
431
|
+
for (; h--; ) {
|
|
432
|
+
const R = t[h], {
|
|
433
|
+
name: _,
|
|
434
|
+
namespaceURI: C,
|
|
435
|
+
value: W
|
|
436
|
+
} = R, q = S(_), $e = W;
|
|
437
|
+
let I = _ === "value" ? $e : Ut($e);
|
|
438
|
+
if (n.attrName = q, n.attrValue = I, n.keepAttr = !0, n.forceKeepAttr = void 0, H(O.uponSanitizeAttribute, e, n), I = n.attrValue, dt && (q === "id" || q === "name") && (z(_, e), I = En + I), Ee && D(/((--!?|])>)|<\/(style|title|textarea)/i, I)) {
|
|
439
|
+
z(_, e);
|
|
440
|
+
continue;
|
|
441
|
+
}
|
|
442
|
+
if (q === "attributename" && Re(I, "href")) {
|
|
443
|
+
z(_, e);
|
|
419
444
|
continue;
|
|
420
445
|
}
|
|
421
|
-
if (
|
|
446
|
+
if (n.forceKeepAttr)
|
|
422
447
|
continue;
|
|
423
|
-
if (!
|
|
424
|
-
|
|
448
|
+
if (!n.keepAttr) {
|
|
449
|
+
z(_, e);
|
|
425
450
|
continue;
|
|
426
451
|
}
|
|
427
|
-
if (!
|
|
428
|
-
|
|
452
|
+
if (!ft && D(/\/>/i, I)) {
|
|
453
|
+
z(_, e);
|
|
429
454
|
continue;
|
|
430
455
|
}
|
|
431
|
-
|
|
432
|
-
|
|
456
|
+
Y && me([Me, Ne, xe], (Ot) => {
|
|
457
|
+
I = te(I, Ot, " ");
|
|
433
458
|
});
|
|
434
|
-
const
|
|
435
|
-
if (!Rt(
|
|
436
|
-
|
|
459
|
+
const bt = S(e.nodeName);
|
|
460
|
+
if (!Rt(bt, q, I)) {
|
|
461
|
+
z(_, e);
|
|
437
462
|
continue;
|
|
438
463
|
}
|
|
439
|
-
if (
|
|
440
|
-
switch (
|
|
464
|
+
if (b && typeof he == "object" && typeof he.getAttributeType == "function" && !C)
|
|
465
|
+
switch (he.getAttributeType(bt, q)) {
|
|
441
466
|
case "TrustedHTML": {
|
|
442
|
-
|
|
467
|
+
I = b.createHTML(I);
|
|
443
468
|
break;
|
|
444
469
|
}
|
|
445
470
|
case "TrustedScriptURL": {
|
|
446
|
-
|
|
471
|
+
I = b.createScriptURL(I);
|
|
447
472
|
break;
|
|
448
473
|
}
|
|
449
474
|
}
|
|
450
|
-
if (
|
|
475
|
+
if (I !== $e)
|
|
451
476
|
try {
|
|
452
|
-
|
|
477
|
+
C ? e.setAttributeNS(C, _, I) : e.setAttribute(_, I), Ye(e) ? x(e) : Xe(o.removed);
|
|
453
478
|
} catch {
|
|
454
|
-
|
|
479
|
+
z(_, e);
|
|
455
480
|
}
|
|
456
481
|
}
|
|
457
|
-
|
|
458
|
-
},
|
|
482
|
+
H(O.afterSanitizeAttributes, e, null);
|
|
483
|
+
}, In = function r(e) {
|
|
459
484
|
let t = null;
|
|
460
|
-
const
|
|
461
|
-
for (
|
|
462
|
-
|
|
463
|
-
|
|
485
|
+
const n = St(e);
|
|
486
|
+
for (H(O.beforeSanitizeShadowDOM, e, null); t = n.nextNode(); )
|
|
487
|
+
H(O.uponSanitizeShadowNode, t, null), It(t), Lt(t), t.content instanceof v && r(t.content);
|
|
488
|
+
H(O.afterSanitizeShadowDOM, e, null);
|
|
464
489
|
};
|
|
465
490
|
return o.sanitize = function(r) {
|
|
466
|
-
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = null,
|
|
467
|
-
if (
|
|
491
|
+
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = null, n = null, h = null, R = null;
|
|
492
|
+
if (Fe = !r, Fe && (r = "<!-->"), typeof r != "string" && !yt(r))
|
|
468
493
|
if (typeof r.toString == "function") {
|
|
469
494
|
if (r = r.toString(), typeof r != "string")
|
|
470
|
-
throw
|
|
495
|
+
throw ne("dirty is not a string, aborting");
|
|
471
496
|
} else
|
|
472
|
-
throw
|
|
497
|
+
throw ne("toString is not a function");
|
|
473
498
|
if (!o.isSupported)
|
|
474
499
|
return r;
|
|
475
|
-
if (
|
|
500
|
+
if (He || Be(e), o.removed = [], typeof r == "string" && (ce = !1), ce) {
|
|
476
501
|
if (r.nodeName) {
|
|
477
|
-
const
|
|
478
|
-
if (!
|
|
479
|
-
throw
|
|
502
|
+
const W = S(r.nodeName);
|
|
503
|
+
if (!w[W] || le[W])
|
|
504
|
+
throw ne("root node is forbidden and cannot be sanitized in-place");
|
|
480
505
|
}
|
|
481
|
-
} else if (r instanceof
|
|
482
|
-
t =
|
|
506
|
+
} else if (r instanceof ve)
|
|
507
|
+
t = wt("<!---->"), n = t.ownerDocument.importNode(r, !0), n.nodeType === oe.element && n.nodeName === "BODY" || n.nodeName === "HTML" ? t = n : t.appendChild(n);
|
|
483
508
|
else {
|
|
484
|
-
if (
|
|
509
|
+
if (!$ && !Y && !U && // eslint-disable-next-line unicorn/prefer-includes
|
|
485
510
|
r.indexOf("<") === -1)
|
|
486
|
-
return
|
|
487
|
-
if (t =
|
|
488
|
-
return
|
|
511
|
+
return b && _e ? b.createHTML(r) : r;
|
|
512
|
+
if (t = wt(r), !t)
|
|
513
|
+
return $ ? null : _e ? ae : "";
|
|
489
514
|
}
|
|
490
|
-
t &&
|
|
491
|
-
const
|
|
492
|
-
for (;
|
|
493
|
-
|
|
494
|
-
if (
|
|
515
|
+
t && We && x(t.firstChild);
|
|
516
|
+
const _ = St(ce ? r : t);
|
|
517
|
+
for (; h = _.nextNode(); )
|
|
518
|
+
It(h), Lt(h), h.content instanceof v && In(h.content);
|
|
519
|
+
if (ce)
|
|
495
520
|
return r;
|
|
496
|
-
if (
|
|
497
|
-
if (
|
|
498
|
-
for (
|
|
499
|
-
|
|
521
|
+
if ($) {
|
|
522
|
+
if (Te)
|
|
523
|
+
for (R = un.call(t.ownerDocument); t.firstChild; )
|
|
524
|
+
R.appendChild(t.firstChild);
|
|
500
525
|
else
|
|
501
|
-
|
|
502
|
-
return (
|
|
526
|
+
R = t;
|
|
527
|
+
return (y.shadowroot || y.shadowrootmode) && (R = mn.call(a, R, !0)), R;
|
|
503
528
|
}
|
|
504
|
-
let
|
|
505
|
-
return U &&
|
|
506
|
-
` +
|
|
507
|
-
|
|
508
|
-
}),
|
|
529
|
+
let C = U ? t.outerHTML : t.innerHTML;
|
|
530
|
+
return U && w["!doctype"] && t.ownerDocument && t.ownerDocument.doctype && t.ownerDocument.doctype.name && D(et, t.ownerDocument.doctype.name) && (C = "<!DOCTYPE " + t.ownerDocument.doctype.name + `>
|
|
531
|
+
` + C), Y && me([Me, Ne, xe], (W) => {
|
|
532
|
+
C = te(C, W, " ");
|
|
533
|
+
}), b && _e ? b.createHTML(C) : C;
|
|
509
534
|
}, o.setConfig = function() {
|
|
510
535
|
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
511
|
-
|
|
536
|
+
Be(r), He = !0;
|
|
512
537
|
}, o.clearConfig = function() {
|
|
513
|
-
|
|
538
|
+
K = null, He = !1;
|
|
514
539
|
}, o.isValidAttribute = function(r, e, t) {
|
|
515
|
-
|
|
516
|
-
const
|
|
517
|
-
return Rt(
|
|
540
|
+
K || Be({});
|
|
541
|
+
const n = S(r), h = S(e);
|
|
542
|
+
return Rt(n, h, t);
|
|
518
543
|
}, o.addHook = function(r, e) {
|
|
519
|
-
typeof e == "function" &&
|
|
544
|
+
typeof e == "function" && ee(O[r], e);
|
|
520
545
|
}, o.removeHook = function(r, e) {
|
|
521
546
|
if (e !== void 0) {
|
|
522
|
-
const t =
|
|
523
|
-
return t === -1 ? void 0 :
|
|
547
|
+
const t = kt(O[r], e);
|
|
548
|
+
return t === -1 ? void 0 : Ht(O[r], t, 1)[0];
|
|
524
549
|
}
|
|
525
|
-
return
|
|
550
|
+
return Xe(O[r]);
|
|
526
551
|
}, o.removeHooks = function(r) {
|
|
527
|
-
|
|
552
|
+
O[r] = [];
|
|
528
553
|
}, o.removeAllHooks = function() {
|
|
529
|
-
|
|
554
|
+
O = nt();
|
|
530
555
|
}, o;
|
|
531
556
|
}
|
|
532
|
-
var
|
|
533
|
-
return
|
|
557
|
+
var en = it();
|
|
558
|
+
return Ve = en, Ve;
|
|
534
559
|
}
|
|
535
|
-
var
|
|
536
|
-
function
|
|
537
|
-
return Mt || (Mt = 1,
|
|
560
|
+
var je, Mt;
|
|
561
|
+
function bn() {
|
|
562
|
+
return Mt || (Mt = 1, je = window.DOMPurify || (window.DOMPurify = Ct().default || Ct())), je;
|
|
538
563
|
}
|
|
539
|
-
var On =
|
|
540
|
-
const
|
|
541
|
-
const
|
|
564
|
+
var On = bn();
|
|
565
|
+
const vn = /* @__PURE__ */ Ln(On), Cn = ({ color: s }) => {
|
|
566
|
+
const i = `
|
|
542
567
|
<svg
|
|
543
568
|
width="48"
|
|
544
569
|
height="48"
|
|
@@ -580,29 +605,30 @@ const bn = /* @__PURE__ */ In(On), vn = ({ color: s }) => {
|
|
|
580
605
|
/>
|
|
581
606
|
</svg>
|
|
582
607
|
`;
|
|
583
|
-
return
|
|
608
|
+
return vn.sanitize(i, {
|
|
584
609
|
ALLOWED_TAGS: ["style", "def"],
|
|
585
610
|
ALLOWED_ATTR: ["class"],
|
|
586
611
|
USE_PROFILES: { svg: !0 }
|
|
587
612
|
});
|
|
588
|
-
},
|
|
589
|
-
Object.entries(
|
|
590
|
-
d !== void 0 && (s.style[
|
|
613
|
+
}, Q = (s, i) => {
|
|
614
|
+
Object.entries(i).forEach(([u, d]) => {
|
|
615
|
+
d !== void 0 && (s.style[u] = d);
|
|
591
616
|
});
|
|
592
|
-
},
|
|
593
|
-
function
|
|
594
|
-
s.addEventListener(
|
|
617
|
+
}, Z = /* @__PURE__ */ new Map();
|
|
618
|
+
function fe({ element: s, event: i, handler: u }) {
|
|
619
|
+
s.addEventListener(i, u), Z.has(s) || Z.set(s, []), Z.get(s).push({ event: i, handler: u });
|
|
595
620
|
}
|
|
596
|
-
function
|
|
597
|
-
|
|
598
|
-
s.removeEventListener(
|
|
599
|
-
}),
|
|
621
|
+
function Nt(s) {
|
|
622
|
+
Z.has(s) && (Z.get(s).forEach(({ event: u, handler: d }) => {
|
|
623
|
+
s.removeEventListener(u, d);
|
|
624
|
+
}), Z.delete(s));
|
|
600
625
|
}
|
|
601
626
|
const Mn = ({
|
|
602
627
|
removeElementFromDOM: s,
|
|
603
|
-
onDismiss:
|
|
628
|
+
onDismiss: i,
|
|
629
|
+
mainWindowId: u
|
|
604
630
|
}) => {
|
|
605
|
-
const
|
|
631
|
+
const d = {
|
|
606
632
|
width: "100%",
|
|
607
633
|
height: window.innerHeight + "px",
|
|
608
634
|
position: "fixed",
|
|
@@ -613,14 +639,14 @@ const Mn = ({
|
|
|
613
639
|
justifyContent: "center",
|
|
614
640
|
alignItems: "center",
|
|
615
641
|
zIndex: "1400"
|
|
616
|
-
},
|
|
617
|
-
s(),
|
|
642
|
+
}, A = document.createElement("div"), E = () => {
|
|
643
|
+
s(), i && i();
|
|
618
644
|
}, m = document.createElement("div");
|
|
619
|
-
return m.innerHTML =
|
|
620
|
-
element:
|
|
645
|
+
return m.innerHTML = Cn({ color: "#d9d9d9" }), fe({
|
|
646
|
+
element: A,
|
|
621
647
|
event: "click",
|
|
622
|
-
handler:
|
|
623
|
-
}),
|
|
648
|
+
handler: E
|
|
649
|
+
}), A.setAttribute("id", u), Q(m, {
|
|
624
650
|
position: "fixed",
|
|
625
651
|
display: "flex",
|
|
626
652
|
justifyContent: "center",
|
|
@@ -630,51 +656,53 @@ const Mn = ({
|
|
|
630
656
|
height: "100%",
|
|
631
657
|
backgroundColor: "rgba(0,0,0,.55)",
|
|
632
658
|
zIndex: "-1"
|
|
633
|
-
}),
|
|
634
|
-
},
|
|
659
|
+
}), Q(A, d), A.append(m), A;
|
|
660
|
+
}, xt = () => innerWidth > 1080 && innerWidth > innerHeight ? {
|
|
635
661
|
width: `${innerHeight * 0.7 * (9 / 16)}px`,
|
|
636
662
|
height: `${innerHeight * 0.7}px`
|
|
637
663
|
} : {
|
|
638
664
|
width: "95%",
|
|
639
665
|
height: "95%"
|
|
640
666
|
};
|
|
641
|
-
function
|
|
642
|
-
const
|
|
667
|
+
function Pt(s) {
|
|
668
|
+
const i = s.toLowerCase().trim(), d = {
|
|
643
669
|
development: "dev",
|
|
644
670
|
production: "prod"
|
|
645
|
-
}[
|
|
671
|
+
}[i] || i, A = {
|
|
646
672
|
dev: "https://face-dev.vultpayments.dev",
|
|
647
673
|
stage: "https://face-stage.vultpayments.dev",
|
|
648
674
|
demo: "https://face-demo.vultsecurity.com",
|
|
649
675
|
prod: "https://face.vultsecurity.com"
|
|
650
676
|
};
|
|
651
|
-
return
|
|
677
|
+
return A[d] ? A[d] : (console.warn(`Unknown environment: ${s}. Using dev domain as default.`), A.dev);
|
|
652
678
|
}
|
|
653
|
-
const
|
|
654
|
-
KYC_VARS: s
|
|
679
|
+
const Nn = async ({
|
|
680
|
+
KYC_VARS: s,
|
|
681
|
+
iframeId: i,
|
|
682
|
+
iframeContainerId: u
|
|
655
683
|
}) => {
|
|
656
|
-
const
|
|
657
|
-
|
|
658
|
-
const
|
|
659
|
-
|
|
660
|
-
width:
|
|
661
|
-
height:
|
|
684
|
+
const d = Pt(s.env), A = document.createElement("div");
|
|
685
|
+
A.setAttribute("id", u);
|
|
686
|
+
const E = xt();
|
|
687
|
+
Q(A, {
|
|
688
|
+
width: E.width,
|
|
689
|
+
height: E.height,
|
|
662
690
|
overflow: "hidden",
|
|
663
691
|
borderRadius: "20px"
|
|
664
692
|
});
|
|
665
|
-
const
|
|
666
|
-
return
|
|
667
|
-
element:
|
|
693
|
+
const m = document.createElement("iframe");
|
|
694
|
+
return fe({
|
|
695
|
+
element: m,
|
|
668
696
|
event: "load",
|
|
669
697
|
handler: () => {
|
|
670
|
-
const
|
|
671
|
-
|
|
698
|
+
const M = document.getElementById(
|
|
699
|
+
i
|
|
672
700
|
);
|
|
673
|
-
|
|
674
|
-
|
|
701
|
+
M && setTimeout(() => {
|
|
702
|
+
M.contentWindow && (M.contentWindow.postMessage(
|
|
675
703
|
"Incoming from kyc",
|
|
676
|
-
|
|
677
|
-
),
|
|
704
|
+
d
|
|
705
|
+
), M.contentWindow.postMessage(
|
|
678
706
|
{
|
|
679
707
|
type: "RESPONSE_WINDOW_SIZE",
|
|
680
708
|
data: {
|
|
@@ -683,21 +711,21 @@ const Cn = async ({
|
|
|
683
711
|
success: !0
|
|
684
712
|
}
|
|
685
713
|
},
|
|
686
|
-
|
|
714
|
+
d
|
|
687
715
|
));
|
|
688
716
|
}, 1e3);
|
|
689
717
|
}
|
|
690
|
-
}),
|
|
718
|
+
}), m.id = i, m.allow = "camera", m.height = `${window.innerHeight}px`, window.innerWidth >= 768 ? m.src = `${d}/show-qr${s.sessionURL}/${s.session_id}` : m.src = `${d}${s.sessionURL}/${s.session_id}`, Q(m, {
|
|
691
719
|
border: "0px",
|
|
692
720
|
width: "100%",
|
|
693
721
|
height: "100%",
|
|
694
722
|
overflow: "hidden",
|
|
695
723
|
borderRadius: "20px"
|
|
696
|
-
}),
|
|
724
|
+
}), A.append(m), A;
|
|
697
725
|
};
|
|
698
|
-
class
|
|
699
|
-
constructor(
|
|
700
|
-
|
|
726
|
+
class Pn {
|
|
727
|
+
constructor(i) {
|
|
728
|
+
g(this, "KYC_VARS", {
|
|
701
729
|
session_id: "",
|
|
702
730
|
onComplete: function() {
|
|
703
731
|
},
|
|
@@ -707,19 +735,25 @@ class xn {
|
|
|
707
735
|
sessionURL: "",
|
|
708
736
|
env: "dev"
|
|
709
737
|
});
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
738
|
+
g(this, "locationData", null);
|
|
739
|
+
g(this, "isResizing", !1);
|
|
740
|
+
g(this, "resizeTimerID", null);
|
|
741
|
+
g(this, "domain", "");
|
|
742
|
+
g(this, "previousWidth", 0);
|
|
743
|
+
g(this, "previousHeight", 0);
|
|
716
744
|
// Threshold for considering a resize significant (address bars typically change height by ~50-100px)
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
745
|
+
g(this, "RESIZE_THRESHOLD_HEIGHT", 100);
|
|
746
|
+
g(this, "RESIZE_THRESHOLD_WIDTH", 50);
|
|
747
|
+
// Unique instance IDs to prevent conflicts with multiple instances
|
|
748
|
+
g(this, "instanceId", "");
|
|
749
|
+
g(this, "mainWindowId", "");
|
|
750
|
+
g(this, "iframeId", "");
|
|
751
|
+
g(this, "iframeContainerId", "");
|
|
752
|
+
g(this, "isClosing", !1);
|
|
753
|
+
g(this, "windowEventListener", (i) => {
|
|
754
|
+
const u = i;
|
|
755
|
+
if (u.data.type === "REQUEST_WINDOW_SIZE") {
|
|
756
|
+
const d = document.getElementById(this.iframeId);
|
|
723
757
|
d && d.contentWindow && d.contentWindow.postMessage(
|
|
724
758
|
{
|
|
725
759
|
type: "RESPONSE_WINDOW_SIZE",
|
|
@@ -732,12 +766,12 @@ class xn {
|
|
|
732
766
|
this.domain
|
|
733
767
|
);
|
|
734
768
|
}
|
|
735
|
-
if (
|
|
736
|
-
switch (
|
|
769
|
+
if (u.data.type === "APP_STATUS")
|
|
770
|
+
switch (u.data.data.status) {
|
|
737
771
|
case "complete": {
|
|
738
772
|
if (this.KYC_VARS.onComplete) {
|
|
739
|
-
if (
|
|
740
|
-
this.KYC_VARS.onComplete(
|
|
773
|
+
if (u.data.data.response) {
|
|
774
|
+
this.KYC_VARS.onComplete(u.data.data.response);
|
|
741
775
|
return;
|
|
742
776
|
}
|
|
743
777
|
this.KYC_VARS.onComplete();
|
|
@@ -745,37 +779,37 @@ class xn {
|
|
|
745
779
|
break;
|
|
746
780
|
}
|
|
747
781
|
case "testing": {
|
|
748
|
-
console.log(
|
|
782
|
+
console.log(u.data.data.status);
|
|
749
783
|
break;
|
|
750
784
|
}
|
|
751
785
|
}
|
|
752
786
|
});
|
|
753
|
-
|
|
754
|
-
this.locationData =
|
|
787
|
+
g(this, "setLocationData", (i) => {
|
|
788
|
+
this.locationData = i;
|
|
755
789
|
});
|
|
756
|
-
|
|
790
|
+
g(this, "resizeHandler", () => {
|
|
757
791
|
console.log("resize");
|
|
758
|
-
const
|
|
759
|
-
if (!(this.previousWidth === 0 && this.previousHeight === 0 || d >= this.RESIZE_THRESHOLD_WIDTH ||
|
|
792
|
+
const i = window.innerWidth, u = window.innerHeight, d = Math.abs(i - this.previousWidth), A = Math.abs(u - this.previousHeight);
|
|
793
|
+
if (!(this.previousWidth === 0 && this.previousHeight === 0 || d >= this.RESIZE_THRESHOLD_WIDTH || A >= this.RESIZE_THRESHOLD_HEIGHT)) {
|
|
760
794
|
console.log("resize ignored (likely address bar hide/show on mobile)");
|
|
761
795
|
return;
|
|
762
796
|
}
|
|
763
797
|
this.isResizing = !0, this.resizeTimerID && clearTimeout(this.resizeTimerID), this.resizeTimerID = setTimeout(() => {
|
|
764
798
|
console.log("triggered state change");
|
|
765
|
-
const
|
|
766
|
-
|
|
767
|
-
),
|
|
768
|
-
|
|
769
|
-
),
|
|
770
|
-
|
|
771
|
-
),
|
|
772
|
-
|
|
773
|
-
width:
|
|
774
|
-
height:
|
|
775
|
-
}),
|
|
799
|
+
const m = document.getElementById(
|
|
800
|
+
this.iframeId
|
|
801
|
+
), M = document.getElementById(
|
|
802
|
+
this.mainWindowId
|
|
803
|
+
), J = document.getElementById(
|
|
804
|
+
this.iframeContainerId
|
|
805
|
+
), F = xt();
|
|
806
|
+
Q(J, {
|
|
807
|
+
width: F.width,
|
|
808
|
+
height: F.height
|
|
809
|
+
}), Q(M, {
|
|
776
810
|
width: `${window.innerWidth}px`,
|
|
777
811
|
height: `${window.innerHeight}px`
|
|
778
|
-
}),
|
|
812
|
+
}), m.contentWindow && (m.contentWindow.postMessage(
|
|
779
813
|
{
|
|
780
814
|
type: "RESPONSE_PARENT_RESIZED",
|
|
781
815
|
data: {
|
|
@@ -785,62 +819,76 @@ class xn {
|
|
|
785
819
|
}
|
|
786
820
|
},
|
|
787
821
|
this.domain
|
|
788
|
-
), console.log(
|
|
822
|
+
), console.log(M), console.log("triggered state change")), this.previousWidth = window.innerWidth, this.previousHeight = window.innerHeight;
|
|
789
823
|
}, 1e3);
|
|
790
824
|
});
|
|
791
|
-
|
|
792
|
-
this.previousWidth = window.innerWidth, this.previousHeight = window.innerHeight,
|
|
825
|
+
g(this, "setupResizingServices", () => {
|
|
826
|
+
this.previousWidth = window.innerWidth, this.previousHeight = window.innerHeight, fe({
|
|
793
827
|
element: window,
|
|
794
828
|
event: "resize",
|
|
795
829
|
handler: this.resizeHandler
|
|
796
830
|
});
|
|
797
831
|
});
|
|
798
|
-
|
|
832
|
+
g(this, "setUpHtml", async () => {
|
|
799
833
|
try {
|
|
800
|
-
|
|
834
|
+
await this.close();
|
|
835
|
+
const i = document.getElementById(this.mainWindowId);
|
|
836
|
+
i && i.remove();
|
|
837
|
+
const u = Mn({
|
|
801
838
|
removeElementFromDOM: this.close,
|
|
802
|
-
onDismiss: this.KYC_VARS.onDismiss
|
|
839
|
+
onDismiss: this.KYC_VARS.onDismiss,
|
|
840
|
+
mainWindowId: this.mainWindowId
|
|
803
841
|
});
|
|
804
|
-
window.document.body.append(
|
|
805
|
-
const
|
|
842
|
+
window.document.body.append(u);
|
|
843
|
+
const d = await Nn({
|
|
806
844
|
KYC_VARS: this.KYC_VARS,
|
|
807
|
-
setLocationData: this.setLocationData
|
|
845
|
+
setLocationData: this.setLocationData,
|
|
846
|
+
iframeId: this.iframeId,
|
|
847
|
+
iframeContainerId: this.iframeContainerId
|
|
808
848
|
});
|
|
809
|
-
|
|
849
|
+
u.append(d);
|
|
810
850
|
} catch {
|
|
811
851
|
console.error("Error setting up HTML");
|
|
812
852
|
}
|
|
813
853
|
});
|
|
814
|
-
|
|
854
|
+
g(this, "setSessionType", (i) => i.Session_Type === "IDAuthentication" ? "/authenticate" : i.Session_Type === "IDVerification" ? "/verify" : "");
|
|
815
855
|
// start - creates HTML div elements and appends to DOM body element.
|
|
816
|
-
|
|
856
|
+
g(this, "startIDVerify", async (i) => {
|
|
817
857
|
try {
|
|
818
|
-
if (
|
|
858
|
+
if (this.isClosing) {
|
|
859
|
+
console.warn("Widget is currently closing, please wait before starting a new session");
|
|
860
|
+
return;
|
|
861
|
+
}
|
|
862
|
+
if (!i || i === "") {
|
|
819
863
|
console.error("You need a session ID to continue");
|
|
820
864
|
return;
|
|
821
865
|
}
|
|
822
866
|
this.KYC_VARS = {
|
|
823
867
|
...this.KYC_VARS,
|
|
824
|
-
session_id:
|
|
825
|
-
}, await this.setUpHtml(), this.setupResizingServices(),
|
|
868
|
+
session_id: i
|
|
869
|
+
}, await this.setUpHtml(), this.setupResizingServices(), fe({
|
|
826
870
|
element: window,
|
|
827
871
|
event: "message",
|
|
828
872
|
handler: this.windowEventListener
|
|
829
873
|
});
|
|
830
874
|
} catch {
|
|
831
|
-
console.error("There was an error starting ID
|
|
875
|
+
console.error("There was an error starting ID Verification.");
|
|
832
876
|
}
|
|
833
877
|
});
|
|
834
|
-
|
|
878
|
+
g(this, "startIDAuthenticate", async (i) => {
|
|
835
879
|
try {
|
|
836
|
-
if (
|
|
880
|
+
if (this.isClosing) {
|
|
881
|
+
console.warn("Widget is currently closing, please wait before starting a new session");
|
|
882
|
+
return;
|
|
883
|
+
}
|
|
884
|
+
if (!i || i === "") {
|
|
837
885
|
console.error("You need a session ID to continue");
|
|
838
886
|
return;
|
|
839
887
|
}
|
|
840
888
|
this.KYC_VARS = {
|
|
841
889
|
...this.KYC_VARS,
|
|
842
|
-
session_id:
|
|
843
|
-
}, this.setUpHtml(), this.setupResizingServices(),
|
|
890
|
+
session_id: i
|
|
891
|
+
}, await this.setUpHtml(), this.setupResizingServices(), fe({
|
|
844
892
|
element: window,
|
|
845
893
|
event: "message",
|
|
846
894
|
handler: this.windowEventListener
|
|
@@ -849,35 +897,41 @@ class xn {
|
|
|
849
897
|
console.error("There was an error starting ID Authentication.");
|
|
850
898
|
}
|
|
851
899
|
});
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
900
|
+
g(this, "close", async () => {
|
|
901
|
+
if (!this.isClosing) {
|
|
902
|
+
this.isClosing = !0;
|
|
903
|
+
try {
|
|
904
|
+
this.resizeTimerID && (clearTimeout(this.resizeTimerID), this.resizeTimerID = null), window.removeEventListener("resize", this.resizeHandler), window.removeEventListener("message", this.windowEventListener);
|
|
905
|
+
const i = document.getElementById(this.mainWindowId), u = document.getElementById(this.iframeId);
|
|
906
|
+
i && (Nt(i), i.remove()), u && Nt(u), await new Promise((d) => setTimeout(d, 0));
|
|
907
|
+
} finally {
|
|
908
|
+
this.isClosing = !1;
|
|
909
|
+
}
|
|
910
|
+
}
|
|
857
911
|
});
|
|
858
|
-
if (!
|
|
912
|
+
if (!i) {
|
|
859
913
|
console.error("Cannot initiate without initial configuration.");
|
|
860
914
|
return;
|
|
861
915
|
}
|
|
862
|
-
if (!
|
|
916
|
+
if (!i.Session_Type) {
|
|
863
917
|
console.error("Cannot initiate without a Session_Type.");
|
|
864
918
|
return;
|
|
865
919
|
}
|
|
866
|
-
if (!
|
|
920
|
+
if (!i.env) {
|
|
867
921
|
console.error("Environment is required. Please provide a valid environment.");
|
|
868
922
|
return;
|
|
869
923
|
}
|
|
870
|
-
this.domain =
|
|
871
|
-
...
|
|
872
|
-
sessionURL: this.setSessionType(
|
|
924
|
+
this.instanceId = `kyc-widget-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, this.mainWindowId = `${this.instanceId}-main-window`, this.iframeId = `${this.instanceId}-iframe`, this.iframeContainerId = `${this.instanceId}-iframe-container`, this.domain = Pt(i.env), this.KYC_VARS = {
|
|
925
|
+
...i,
|
|
926
|
+
sessionURL: this.setSessionType(i),
|
|
873
927
|
session_id: ""
|
|
874
928
|
// Will be set when starting verification/authentication
|
|
875
929
|
};
|
|
876
930
|
}
|
|
877
931
|
}
|
|
878
|
-
const
|
|
932
|
+
const kn = "IDAuthentication", Hn = "IDVerification";
|
|
879
933
|
export {
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
934
|
+
kn as IDA,
|
|
935
|
+
Hn as IDV,
|
|
936
|
+
Pn as KYCWidget
|
|
883
937
|
};
|