vult-security-kyc 0.0.5 → 0.0.7
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/README.md +25 -0
- package/package.json +6 -3
- package/build/client-apps/IFrame.d.ts +0 -10
- package/build/client-apps/LoadingSpinner.d.ts +0 -3
- package/build/client-apps/MainWindow.d.ts +0 -5
- package/build/client-apps/components.d.ts +0 -3
- package/build/client-apps/components.js +0 -54
- package/build/client-apps/index.d.ts +0 -35
- package/build/client-apps/interfaces/IKYCWidget.d.ts +0 -45
- package/build/client-apps/interfaces/VULTProps.d.ts +0 -7
- package/build/client-apps/utils/applyStyles.d.ts +0 -1
- package/build/client-apps/utils/eventManager.d.ts +0 -6
- package/build/client-apps/utils/getEnvironmentDomain.d.ts +0 -13
- package/build/client-apps/utils/getGeolocation.d.ts +0 -4
- package/build/client-apps/utils/iframeElementParentStyles.d.ts +0 -4
- package/build/components/VULTIda.d.ts +0 -2
- package/build/components/VULTIdv.d.ts +0 -2
- package/build/components.d.ts +0 -2
- package/build/global.d.ts +0 -5
- package/build/index.d.ts +0 -2
- package/build/vite.config.d.ts +0 -2
- package/build/vult-kyc-widget.es.js +0 -937
package/README.md
CHANGED
|
@@ -193,6 +193,31 @@ interface VULTProps {
|
|
|
193
193
|
}
|
|
194
194
|
```
|
|
195
195
|
|
|
196
|
+
### Available Constants
|
|
197
|
+
|
|
198
|
+
The widget exposes the following constants for convenience:
|
|
199
|
+
|
|
200
|
+
- `VultKYC.IDV` - Shorthand for "IDVerification"
|
|
201
|
+
- `VultKYC.IDA` - Shorthand for "IDAuthentication"
|
|
202
|
+
|
|
203
|
+
### Methods
|
|
204
|
+
|
|
205
|
+
#### `startIDVerify(sessionId: string)`
|
|
206
|
+
Starts an ID Verification session. Requires a valid session ID.
|
|
207
|
+
|
|
208
|
+
#### `startIDAuthenticate(sessionId: string)`
|
|
209
|
+
Starts an ID Authentication session. Requires a valid session ID.
|
|
210
|
+
|
|
211
|
+
#### `close()`
|
|
212
|
+
Manually closes the widget and cleans up event listeners. Useful for programmatic dismissal.
|
|
213
|
+
|
|
214
|
+
### Notes
|
|
215
|
+
|
|
216
|
+
- The widget creates a full-screen modal overlay when started
|
|
217
|
+
- Users can dismiss the modal by clicking the backdrop (triggers `onDismiss` callback)
|
|
218
|
+
- The widget automatically handles window resizing and mobile viewport changes
|
|
219
|
+
- Make sure to use valid session IDs obtained from your backend API
|
|
220
|
+
|
|
196
221
|
## Licensing
|
|
197
222
|
|
|
198
223
|
This project includes third-party libraries with their own licenses. Below is a summary of the third-party licenses included in this project:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vult-security-kyc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "typescript widget",
|
|
5
5
|
"author": "Nexrage",
|
|
6
6
|
"license": "ISC",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"start:local": "yarn env:local && vite --host --port 8200",
|
|
32
32
|
"start:frontend": "yarn env:frontend && vite --host --port 8200",
|
|
33
33
|
"env:frontend": "node client-configs/env.js VITE_BUILD=dev VITE_DOMAIN=https://#/",
|
|
34
|
-
"env:dev": "node client-configs/env.js VITE_BUILD=dev VITE_KYC=VULT VITE_DOMAIN=https://face-dev.
|
|
35
|
-
"env:stage": "node client-configs/env.js VITE_BUILD=stage VITE_DOMAIN=https://face-stage.
|
|
34
|
+
"env:dev": "node client-configs/env.js VITE_BUILD=dev VITE_KYC=VULT VITE_DOMAIN=https://face-dev.vultsecurity.com",
|
|
35
|
+
"env:stage": "node client-configs/env.js VITE_BUILD=stage VITE_DOMAIN=https://face-stage.vultsecurity.com",
|
|
36
36
|
"env:demo": "node client-configs/env.js VITE_BUILD=demo VITE_DOMAIN=https://face-demo.vultsecurity.com",
|
|
37
37
|
"env:prod": "node client-configs/env.js VITE_BUILD=prod VITE_DOMAIN=https://face.vultsecurity.com",
|
|
38
38
|
"env:local": "node client-configs/env.js VITE_BUILD=dev VITE_KYC=VULT VITE_DOMAIN=https://localhost:8000",
|
|
@@ -49,6 +49,9 @@
|
|
|
49
49
|
"lint": "eslint \"./client-{apps,configs,schemas}/**/*.{js,jsx,ts,tsx}\"",
|
|
50
50
|
"preview": "vite preview"
|
|
51
51
|
},
|
|
52
|
+
"resolutions": {
|
|
53
|
+
"rollup": "4.22.4"
|
|
54
|
+
},
|
|
52
55
|
"dependencies": {
|
|
53
56
|
"isomorphic-dompurify": "2.26.0"
|
|
54
57
|
},
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { KYC_SETTINGS } from './interfaces/IKYCWidget';
|
|
2
|
-
export declare const IFrame: ({ KYC_VARS, iframeId, iframeContainerId, }: {
|
|
3
|
-
KYC_VARS: KYC_SETTINGS;
|
|
4
|
-
setLocationData: (x: {
|
|
5
|
-
latitude: number;
|
|
6
|
-
longitude: number;
|
|
7
|
-
}) => void;
|
|
8
|
-
iframeId: string;
|
|
9
|
-
iframeContainerId: string;
|
|
10
|
-
}) => Promise<HTMLDivElement>;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/* Vult Kyc Widget: 0.0.5 */
|
|
2
|
-
import { useRef as s, useEffect as f } from "react";
|
|
3
|
-
import { KYCWidget as p, IDV as d, IDA as R } from "../vult-kyc-widget.es.js";
|
|
4
|
-
const D = ({
|
|
5
|
-
environment: l,
|
|
6
|
-
sessionId: c,
|
|
7
|
-
autoClose: n = !0,
|
|
8
|
-
onComplete: u,
|
|
9
|
-
onDismiss: o
|
|
10
|
-
}) => {
|
|
11
|
-
const r = s(null), e = s({ onComplete: u, onDismiss: o, autoClose: n }), t = s(!0);
|
|
12
|
-
return f(() => {
|
|
13
|
-
e.current = { onComplete: u, onDismiss: o, autoClose: n };
|
|
14
|
-
}, [u, o, n]), f(() => (t.current = !0, r.current || (r.current = new p({
|
|
15
|
-
env: l,
|
|
16
|
-
onDismiss: () => {
|
|
17
|
-
t.current && e.current.onDismiss && e.current.onDismiss();
|
|
18
|
-
},
|
|
19
|
-
onComplete: (a) => {
|
|
20
|
-
var i;
|
|
21
|
-
t.current && e.current.onComplete && e.current.onComplete(a), t.current && e.current.autoClose && ((i = r.current) == null || i.close().catch(console.error));
|
|
22
|
-
},
|
|
23
|
-
Session_Type: d
|
|
24
|
-
})), c ? r.current.startIDVerify(c) : console.warn("Awaiting sessionId to be provided"), () => {
|
|
25
|
-
t.current = !1, r.current && (r.current.close().catch(console.error), r.current = null);
|
|
26
|
-
}), [c, l]), null;
|
|
27
|
-
}, h = ({
|
|
28
|
-
environment: l,
|
|
29
|
-
sessionId: c,
|
|
30
|
-
autoClose: n = !0,
|
|
31
|
-
onComplete: u,
|
|
32
|
-
onDismiss: o
|
|
33
|
-
}) => {
|
|
34
|
-
const r = s(null), e = s({ onComplete: u, onDismiss: o, autoClose: n }), t = s(!0);
|
|
35
|
-
return f(() => {
|
|
36
|
-
e.current = { onComplete: u, onDismiss: o, autoClose: n };
|
|
37
|
-
}, [u, o, n]), f(() => (t.current = !0, r.current || (r.current = new p({
|
|
38
|
-
env: l,
|
|
39
|
-
onDismiss: () => {
|
|
40
|
-
t.current && e.current.onDismiss && e.current.onDismiss();
|
|
41
|
-
},
|
|
42
|
-
onComplete: (a) => {
|
|
43
|
-
var i;
|
|
44
|
-
t.current && e.current.onComplete && e.current.onComplete(a), t.current && e.current.autoClose && ((i = r.current) == null || i.close().catch(console.error));
|
|
45
|
-
},
|
|
46
|
-
Session_Type: R
|
|
47
|
-
})), c ? r.current.startIDAuthenticate(c) : console.warn("Awaiting sessionId to be provided"), () => {
|
|
48
|
-
t.current = !1, r.current && (r.current.close().catch(console.error), r.current = null);
|
|
49
|
-
}), [c, l]), null;
|
|
50
|
-
};
|
|
51
|
-
export {
|
|
52
|
-
h as VULTIda,
|
|
53
|
-
D as VULTIdv
|
|
54
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { KYCWidgetConfig, KYC_SETTINGS } from './interfaces/IKYCWidget';
|
|
2
|
-
export declare class KYCWidget {
|
|
3
|
-
KYC_VARS: KYC_SETTINGS;
|
|
4
|
-
locationData: {
|
|
5
|
-
latitude: number;
|
|
6
|
-
longitude: number;
|
|
7
|
-
} | null;
|
|
8
|
-
isResizing: boolean;
|
|
9
|
-
resizeTimerID: null | number;
|
|
10
|
-
domain: string;
|
|
11
|
-
previousWidth: number;
|
|
12
|
-
previousHeight: number;
|
|
13
|
-
RESIZE_THRESHOLD_HEIGHT: number;
|
|
14
|
-
RESIZE_THRESHOLD_WIDTH: number;
|
|
15
|
-
instanceId: string;
|
|
16
|
-
mainWindowId: string;
|
|
17
|
-
iframeId: string;
|
|
18
|
-
iframeContainerId: string;
|
|
19
|
-
isClosing: boolean;
|
|
20
|
-
constructor(initialConfiguration: KYCWidgetConfig);
|
|
21
|
-
windowEventListener: (ev: any) => void;
|
|
22
|
-
setLocationData: (coords: {
|
|
23
|
-
latitude: number;
|
|
24
|
-
longitude: number;
|
|
25
|
-
}) => void;
|
|
26
|
-
resizeHandler: () => void;
|
|
27
|
-
setupResizingServices: () => void;
|
|
28
|
-
setUpHtml: () => Promise<void>;
|
|
29
|
-
setSessionType: (initialConfiguration: KYCWidgetConfig) => "/verify" | "/authenticate" | "";
|
|
30
|
-
startIDVerify: (session_id: string) => Promise<void>;
|
|
31
|
-
startIDAuthenticate: (session_id: string) => Promise<void>;
|
|
32
|
-
close: () => Promise<void>;
|
|
33
|
-
}
|
|
34
|
-
export declare const IDA = "IDAuthentication";
|
|
35
|
-
export declare const IDV = "IDVerification";
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Initial configuration provided by the user when creating a KYCWidget instance.
|
|
3
|
-
* This is what users pass to the constructor.
|
|
4
|
-
*/
|
|
5
|
-
export interface KYCWidgetConfig {
|
|
6
|
-
/**
|
|
7
|
-
* The type of session to run (ID Verification or ID Authentication)
|
|
8
|
-
*/
|
|
9
|
-
Session_Type: "IDVerification" | "IDAuthentication";
|
|
10
|
-
/**
|
|
11
|
-
* Environment for the widget (dev, development, stage, demo, prod, or production)
|
|
12
|
-
*/
|
|
13
|
-
env: "dev" | "development" | "stage" | "demo" | "prod" | "production";
|
|
14
|
-
/**
|
|
15
|
-
* Optional callback fired when verification/authentication is completed
|
|
16
|
-
*/
|
|
17
|
-
onComplete?: (x?: any) => void;
|
|
18
|
-
/**
|
|
19
|
-
* Optional callback fired when the widget is dismissed
|
|
20
|
-
*/
|
|
21
|
-
onDismiss?: (x?: any) => void;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Internal widget settings used throughout the widget lifecycle.
|
|
25
|
-
* This extends the initial configuration with computed and runtime values.
|
|
26
|
-
*/
|
|
27
|
-
export interface KYC_SETTINGS extends KYCWidgetConfig {
|
|
28
|
-
/**
|
|
29
|
-
* Session URL path computed from Session_Type ("/verify" or "/authenticate")
|
|
30
|
-
*/
|
|
31
|
-
sessionURL: "/verify" | "/authenticate" | "";
|
|
32
|
-
/**
|
|
33
|
-
* Session ID - set when starting verification/authentication
|
|
34
|
-
*/
|
|
35
|
-
session_id: string;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* @deprecated Use KYCWidgetConfig instead. This interface is kept for backward compatibility.
|
|
39
|
-
*/
|
|
40
|
-
export interface IKYCWidget {
|
|
41
|
-
session_id: string;
|
|
42
|
-
Session_Type: "IDVerification" | "IDAuthentication";
|
|
43
|
-
onComplete?: (x?: any) => void;
|
|
44
|
-
onDismiss?: (x?: any) => void;
|
|
45
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const applyStyles: (htmlElement: HTMLElement | HTMLIFrameElement, styles: Partial<Record<keyof CSSStyleDeclaration, string>>) => void;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Determines the environment domain URL based on the provided environment string.
|
|
3
|
-
*
|
|
4
|
-
* Maps environment values to their corresponding URLs:
|
|
5
|
-
* - dev, development -> https://face-dev.vultpayments.dev
|
|
6
|
-
* - stage -> https://face-stage.vultpayments.dev
|
|
7
|
-
* - demo -> https://face-demo.vultsecurity.com
|
|
8
|
-
* - prod, production -> https://face.vultsecurity.com
|
|
9
|
-
*
|
|
10
|
-
* @param env - The environment string (dev, development, stage, demo, prod, or production)
|
|
11
|
-
* @returns The domain URL for the specified environment
|
|
12
|
-
*/
|
|
13
|
-
export declare function getEnvironmentDomain(env: 'dev' | 'development' | 'stage' | 'demo' | 'prod' | 'production'): string;
|
package/build/components.d.ts
DELETED
package/build/global.d.ts
DELETED
package/build/index.d.ts
DELETED
package/build/vite.config.d.ts
DELETED
|
@@ -1,937 +0,0 @@
|
|
|
1
|
-
var Rn = Object.defineProperty;
|
|
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
|
-
return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
|
|
6
|
-
}
|
|
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
|
-
const {
|
|
13
|
-
entries: s,
|
|
14
|
-
setPrototypeOf: i,
|
|
15
|
-
isFrozen: u,
|
|
16
|
-
getPrototypeOf: d,
|
|
17
|
-
getOwnPropertyDescriptor: A
|
|
18
|
-
} = Object;
|
|
19
|
-
let {
|
|
20
|
-
freeze: E,
|
|
21
|
-
seal: m,
|
|
22
|
-
create: M
|
|
23
|
-
} = Object, {
|
|
24
|
-
apply: J,
|
|
25
|
-
construct: F
|
|
26
|
-
} = typeof Reflect < "u" && Reflect;
|
|
27
|
-
E || (E = function(o) {
|
|
28
|
-
return o;
|
|
29
|
-
}), m || (m = function(o) {
|
|
30
|
-
return o;
|
|
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);
|
|
39
|
-
});
|
|
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);
|
|
41
|
-
function L(c) {
|
|
42
|
-
return function(o) {
|
|
43
|
-
o instanceof RegExp && (o.lastIndex = 0);
|
|
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);
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
function zt(c) {
|
|
50
|
-
return function() {
|
|
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);
|
|
54
|
-
};
|
|
55
|
-
}
|
|
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);
|
|
65
|
-
}
|
|
66
|
-
c[p] = !0;
|
|
67
|
-
}
|
|
68
|
-
return c;
|
|
69
|
-
}
|
|
70
|
-
function Ft(c) {
|
|
71
|
-
for (let o = 0; o < c.length; o++)
|
|
72
|
-
N(c, o) || (c[o] = null);
|
|
73
|
-
return c;
|
|
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);
|
|
79
|
-
return o;
|
|
80
|
-
}
|
|
81
|
-
function ie(c, o) {
|
|
82
|
-
for (; c !== null; ) {
|
|
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);
|
|
89
|
-
}
|
|
90
|
-
c = d(c);
|
|
91
|
-
}
|
|
92
|
-
function f() {
|
|
93
|
-
return null;
|
|
94
|
-
}
|
|
95
|
-
return f;
|
|
96
|
-
}
|
|
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(
|
|
98
|
-
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
99
|
-
// eslint-disable-line no-useless-escape
|
|
100
|
-
), Kt = m(/^(?:\w+script|data):/i), qt = m(
|
|
101
|
-
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
102
|
-
// eslint-disable-line no-control-regex
|
|
103
|
-
), et = m(/^html$/i), Zt = m(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
104
|
-
var tt = /* @__PURE__ */ Object.freeze({
|
|
105
|
-
__proto__: null,
|
|
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,
|
|
113
|
-
IS_SCRIPT_OR_DATA: Kt,
|
|
114
|
-
MUSTACHE_EXPR: Yt,
|
|
115
|
-
TMPLIT_EXPR: Vt
|
|
116
|
-
});
|
|
117
|
-
const oe = {
|
|
118
|
-
element: 1,
|
|
119
|
-
text: 3,
|
|
120
|
-
// Deprecated
|
|
121
|
-
progressingInstruction: 7,
|
|
122
|
-
comment: 8,
|
|
123
|
-
document: 9
|
|
124
|
-
}, Qt = function() {
|
|
125
|
-
return typeof window > "u" ? null : window;
|
|
126
|
-
}, Jt = function(o, f) {
|
|
127
|
-
if (typeof o != "object" || typeof o.createPolicy != "function")
|
|
128
|
-
return null;
|
|
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 : "");
|
|
133
|
-
try {
|
|
134
|
-
return o.createPolicy(v, {
|
|
135
|
-
createHTML(G) {
|
|
136
|
-
return G;
|
|
137
|
-
},
|
|
138
|
-
createScriptURL(G) {
|
|
139
|
-
return G;
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
} catch {
|
|
143
|
-
return console.warn("TrustedTypes policy " + v + " could not be created."), null;
|
|
144
|
-
}
|
|
145
|
-
}, nt = function() {
|
|
146
|
-
return {
|
|
147
|
-
afterSanitizeAttributes: [],
|
|
148
|
-
afterSanitizeElements: [],
|
|
149
|
-
afterSanitizeShadowDOM: [],
|
|
150
|
-
beforeSanitizeAttributes: [],
|
|
151
|
-
beforeSanitizeElements: [],
|
|
152
|
-
beforeSanitizeShadowDOM: [],
|
|
153
|
-
uponSanitizeAttribute: [],
|
|
154
|
-
uponSanitizeElement: [],
|
|
155
|
-
uponSanitizeShadowNode: []
|
|
156
|
-
};
|
|
157
|
-
};
|
|
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)
|
|
162
|
-
return o.isSupported = !1, o;
|
|
163
|
-
let {
|
|
164
|
-
document: f
|
|
165
|
-
} = c;
|
|
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") {
|
|
178
|
-
const r = f.createElement("template");
|
|
179
|
-
r.content && r.content.ownerDocument && (f = r.content.ownerDocument);
|
|
180
|
-
}
|
|
181
|
-
let b, ae = "";
|
|
182
|
-
const {
|
|
183
|
-
implementation: Ce,
|
|
184
|
-
createNodeIterator: cn,
|
|
185
|
-
createDocumentFragment: un,
|
|
186
|
-
getElementsByTagName: fn
|
|
187
|
-
} = f, {
|
|
188
|
-
importNode: mn
|
|
189
|
-
} = a;
|
|
190
|
-
let O = nt();
|
|
191
|
-
o.isSupported = typeof s == "function" && typeof ge == "function" && Ce && Ce.createHTMLDocument !== void 0;
|
|
192
|
-
const {
|
|
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;
|
|
202
|
-
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, {
|
|
209
|
-
tagNameCheck: {
|
|
210
|
-
writable: !0,
|
|
211
|
-
configurable: !1,
|
|
212
|
-
enumerable: !0,
|
|
213
|
-
value: null
|
|
214
|
-
},
|
|
215
|
-
attributeNameCheck: {
|
|
216
|
-
writable: !0,
|
|
217
|
-
configurable: !1,
|
|
218
|
-
enumerable: !0,
|
|
219
|
-
value: null
|
|
220
|
-
},
|
|
221
|
-
allowCustomizedBuiltInElements: {
|
|
222
|
-
writable: !0,
|
|
223
|
-
configurable: !1,
|
|
224
|
-
enumerable: !0,
|
|
225
|
-
value: !1
|
|
226
|
-
}
|
|
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) {
|
|
258
|
-
return e instanceof RegExp || e instanceof Function;
|
|
259
|
-
}, Be = function() {
|
|
260
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
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) {
|
|
264
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
265
|
-
throw ne('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
266
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
267
|
-
throw ne('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
268
|
-
b = e.TRUSTED_TYPES_POLICY, ae = b.createHTML("");
|
|
269
|
-
} else
|
|
270
|
-
b === void 0 && (b = Jt(he, p)), b !== null && typeof ae == "string" && (ae = b.createHTML(""));
|
|
271
|
-
E && E(e), K = e;
|
|
272
|
-
}
|
|
273
|
-
}, _t = l({}, [...De, ...Le, ...Gt]), At = l({}, [...be, ...Bt]), yn = function(e) {
|
|
274
|
-
let t = ge(e);
|
|
275
|
-
(!t || !t.tagName) && (t = {
|
|
276
|
-
namespaceURI: X,
|
|
277
|
-
tagName: "template"
|
|
278
|
-
});
|
|
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, {
|
|
283
|
-
element: e
|
|
284
|
-
});
|
|
285
|
-
try {
|
|
286
|
-
ge(e).removeChild(e);
|
|
287
|
-
} catch {
|
|
288
|
-
sn(e);
|
|
289
|
-
}
|
|
290
|
-
}, z = function(e, t) {
|
|
291
|
-
try {
|
|
292
|
-
ee(o.removed, {
|
|
293
|
-
attribute: t.getAttributeNode(e),
|
|
294
|
-
from: t
|
|
295
|
-
});
|
|
296
|
-
} catch {
|
|
297
|
-
ee(o.removed, {
|
|
298
|
-
attribute: null,
|
|
299
|
-
from: t
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
if (t.removeAttribute(e), e === "is")
|
|
303
|
-
if ($ || Te)
|
|
304
|
-
try {
|
|
305
|
-
x(t);
|
|
306
|
-
} catch {
|
|
307
|
-
}
|
|
308
|
-
else
|
|
309
|
-
try {
|
|
310
|
-
t.setAttribute(e, "");
|
|
311
|
-
} catch {
|
|
312
|
-
}
|
|
313
|
-
}, wt = function(e) {
|
|
314
|
-
let t = null, n = null;
|
|
315
|
-
if (We)
|
|
316
|
-
e = "<remove></remove>" + e;
|
|
317
|
-
else {
|
|
318
|
-
const _ = Re(e, /^[\r\n\t ]+/);
|
|
319
|
-
n = _ && _[0];
|
|
320
|
-
}
|
|
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)
|
|
324
|
-
try {
|
|
325
|
-
t = new on().parseFromString(h, ue);
|
|
326
|
-
} catch {
|
|
327
|
-
}
|
|
328
|
-
if (!t || !t.documentElement) {
|
|
329
|
-
t = Ce.createDocument(X, "template", null);
|
|
330
|
-
try {
|
|
331
|
-
t.documentElement.innerHTML = Fe ? ae : h;
|
|
332
|
-
} catch {
|
|
333
|
-
}
|
|
334
|
-
}
|
|
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;
|
|
337
|
-
}, St = function(e) {
|
|
338
|
-
return cn.call(
|
|
339
|
-
e.ownerDocument || e,
|
|
340
|
-
e,
|
|
341
|
-
// eslint-disable-next-line no-bitwise
|
|
342
|
-
re.SHOW_ELEMENT | re.SHOW_COMMENT | re.SHOW_TEXT | re.SHOW_PROCESSING_INSTRUCTION | re.SHOW_CDATA_SECTION,
|
|
343
|
-
null
|
|
344
|
-
);
|
|
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;
|
|
349
|
-
};
|
|
350
|
-
function H(r, e, t) {
|
|
351
|
-
me(r, (n) => {
|
|
352
|
-
n.call(o, e, t, K);
|
|
353
|
-
});
|
|
354
|
-
}
|
|
355
|
-
const It = function(e) {
|
|
356
|
-
let t = null;
|
|
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)))
|
|
367
|
-
return !1;
|
|
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));
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
return x(e), !0;
|
|
379
|
-
}
|
|
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, {
|
|
383
|
-
element: e.cloneNode()
|
|
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))
|
|
387
|
-
return !1;
|
|
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
|
-
}
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
return !0;
|
|
414
|
-
}, Dt = function(e) {
|
|
415
|
-
return e !== "annotation-xml" && Re(e, gn);
|
|
416
|
-
}, Lt = function(e) {
|
|
417
|
-
H(O.beforeSanitizeAttributes, e, null);
|
|
418
|
-
const {
|
|
419
|
-
attributes: t
|
|
420
|
-
} = e;
|
|
421
|
-
if (!t || Ye(e))
|
|
422
|
-
return;
|
|
423
|
-
const n = {
|
|
424
|
-
attrName: "",
|
|
425
|
-
attrValue: "",
|
|
426
|
-
keepAttr: !0,
|
|
427
|
-
allowedAttributes: y,
|
|
428
|
-
forceKeepAttr: void 0
|
|
429
|
-
};
|
|
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);
|
|
444
|
-
continue;
|
|
445
|
-
}
|
|
446
|
-
if (n.forceKeepAttr)
|
|
447
|
-
continue;
|
|
448
|
-
if (!n.keepAttr) {
|
|
449
|
-
z(_, e);
|
|
450
|
-
continue;
|
|
451
|
-
}
|
|
452
|
-
if (!ft && D(/\/>/i, I)) {
|
|
453
|
-
z(_, e);
|
|
454
|
-
continue;
|
|
455
|
-
}
|
|
456
|
-
Y && me([Me, Ne, xe], (Ot) => {
|
|
457
|
-
I = te(I, Ot, " ");
|
|
458
|
-
});
|
|
459
|
-
const bt = S(e.nodeName);
|
|
460
|
-
if (!Rt(bt, q, I)) {
|
|
461
|
-
z(_, e);
|
|
462
|
-
continue;
|
|
463
|
-
}
|
|
464
|
-
if (b && typeof he == "object" && typeof he.getAttributeType == "function" && !C)
|
|
465
|
-
switch (he.getAttributeType(bt, q)) {
|
|
466
|
-
case "TrustedHTML": {
|
|
467
|
-
I = b.createHTML(I);
|
|
468
|
-
break;
|
|
469
|
-
}
|
|
470
|
-
case "TrustedScriptURL": {
|
|
471
|
-
I = b.createScriptURL(I);
|
|
472
|
-
break;
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
if (I !== $e)
|
|
476
|
-
try {
|
|
477
|
-
C ? e.setAttributeNS(C, _, I) : e.setAttribute(_, I), Ye(e) ? x(e) : Xe(o.removed);
|
|
478
|
-
} catch {
|
|
479
|
-
z(_, e);
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
H(O.afterSanitizeAttributes, e, null);
|
|
483
|
-
}, In = function r(e) {
|
|
484
|
-
let t = null;
|
|
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);
|
|
489
|
-
};
|
|
490
|
-
return o.sanitize = function(r) {
|
|
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))
|
|
493
|
-
if (typeof r.toString == "function") {
|
|
494
|
-
if (r = r.toString(), typeof r != "string")
|
|
495
|
-
throw ne("dirty is not a string, aborting");
|
|
496
|
-
} else
|
|
497
|
-
throw ne("toString is not a function");
|
|
498
|
-
if (!o.isSupported)
|
|
499
|
-
return r;
|
|
500
|
-
if (He || Be(e), o.removed = [], typeof r == "string" && (ce = !1), ce) {
|
|
501
|
-
if (r.nodeName) {
|
|
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");
|
|
505
|
-
}
|
|
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);
|
|
508
|
-
else {
|
|
509
|
-
if (!$ && !Y && !U && // eslint-disable-next-line unicorn/prefer-includes
|
|
510
|
-
r.indexOf("<") === -1)
|
|
511
|
-
return b && _e ? b.createHTML(r) : r;
|
|
512
|
-
if (t = wt(r), !t)
|
|
513
|
-
return $ ? null : _e ? ae : "";
|
|
514
|
-
}
|
|
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)
|
|
520
|
-
return r;
|
|
521
|
-
if ($) {
|
|
522
|
-
if (Te)
|
|
523
|
-
for (R = un.call(t.ownerDocument); t.firstChild; )
|
|
524
|
-
R.appendChild(t.firstChild);
|
|
525
|
-
else
|
|
526
|
-
R = t;
|
|
527
|
-
return (y.shadowroot || y.shadowrootmode) && (R = mn.call(a, R, !0)), R;
|
|
528
|
-
}
|
|
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;
|
|
534
|
-
}, o.setConfig = function() {
|
|
535
|
-
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
536
|
-
Be(r), He = !0;
|
|
537
|
-
}, o.clearConfig = function() {
|
|
538
|
-
K = null, He = !1;
|
|
539
|
-
}, o.isValidAttribute = function(r, e, t) {
|
|
540
|
-
K || Be({});
|
|
541
|
-
const n = S(r), h = S(e);
|
|
542
|
-
return Rt(n, h, t);
|
|
543
|
-
}, o.addHook = function(r, e) {
|
|
544
|
-
typeof e == "function" && ee(O[r], e);
|
|
545
|
-
}, o.removeHook = function(r, e) {
|
|
546
|
-
if (e !== void 0) {
|
|
547
|
-
const t = kt(O[r], e);
|
|
548
|
-
return t === -1 ? void 0 : Ht(O[r], t, 1)[0];
|
|
549
|
-
}
|
|
550
|
-
return Xe(O[r]);
|
|
551
|
-
}, o.removeHooks = function(r) {
|
|
552
|
-
O[r] = [];
|
|
553
|
-
}, o.removeAllHooks = function() {
|
|
554
|
-
O = nt();
|
|
555
|
-
}, o;
|
|
556
|
-
}
|
|
557
|
-
var en = it();
|
|
558
|
-
return Ve = en, Ve;
|
|
559
|
-
}
|
|
560
|
-
var je, Mt;
|
|
561
|
-
function bn() {
|
|
562
|
-
return Mt || (Mt = 1, je = window.DOMPurify || (window.DOMPurify = Ct().default || Ct())), je;
|
|
563
|
-
}
|
|
564
|
-
var On = bn();
|
|
565
|
-
const vn = /* @__PURE__ */ Ln(On), Cn = ({ color: s }) => {
|
|
566
|
-
const i = `
|
|
567
|
-
<svg
|
|
568
|
-
width="48"
|
|
569
|
-
height="48"
|
|
570
|
-
class="loader"
|
|
571
|
-
id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
|
|
572
|
-
<defs>
|
|
573
|
-
<style>
|
|
574
|
-
.loader {
|
|
575
|
-
width: 48px;
|
|
576
|
-
height: 48px;
|
|
577
|
-
border: 6px solid ${s};
|
|
578
|
-
border-bottom-color: transparent;
|
|
579
|
-
border-radius: 50%;
|
|
580
|
-
display: inline-block;
|
|
581
|
-
box-sizing: border-box;
|
|
582
|
-
animation: rotation 1s linear infinite;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
@keyframes rotation {
|
|
586
|
-
0% {
|
|
587
|
-
transform: rotate(0deg);
|
|
588
|
-
}
|
|
589
|
-
100% {
|
|
590
|
-
transform: rotate(360deg);
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
</style>
|
|
594
|
-
</defs>
|
|
595
|
-
<circle
|
|
596
|
-
|
|
597
|
-
cx="24"
|
|
598
|
-
cy="24"
|
|
599
|
-
r="20"
|
|
600
|
-
fill="none"
|
|
601
|
-
stroke="none"
|
|
602
|
-
strokeWidth="5"
|
|
603
|
-
strokeDasharray="125.6"
|
|
604
|
-
strokeDashoffset="62.8"
|
|
605
|
-
/>
|
|
606
|
-
</svg>
|
|
607
|
-
`;
|
|
608
|
-
return vn.sanitize(i, {
|
|
609
|
-
ALLOWED_TAGS: ["style", "def"],
|
|
610
|
-
ALLOWED_ATTR: ["class"],
|
|
611
|
-
USE_PROFILES: { svg: !0 }
|
|
612
|
-
});
|
|
613
|
-
}, Q = (s, i) => {
|
|
614
|
-
Object.entries(i).forEach(([u, d]) => {
|
|
615
|
-
d !== void 0 && (s.style[u] = d);
|
|
616
|
-
});
|
|
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 });
|
|
620
|
-
}
|
|
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));
|
|
625
|
-
}
|
|
626
|
-
const Mn = ({
|
|
627
|
-
removeElementFromDOM: s,
|
|
628
|
-
onDismiss: i,
|
|
629
|
-
mainWindowId: u
|
|
630
|
-
}) => {
|
|
631
|
-
const d = {
|
|
632
|
-
width: "100%",
|
|
633
|
-
height: window.innerHeight + "px",
|
|
634
|
-
position: "fixed",
|
|
635
|
-
margin: "0px",
|
|
636
|
-
top: "0",
|
|
637
|
-
left: "0",
|
|
638
|
-
display: "flex",
|
|
639
|
-
justifyContent: "center",
|
|
640
|
-
alignItems: "center",
|
|
641
|
-
zIndex: "1400"
|
|
642
|
-
}, A = document.createElement("div"), E = () => {
|
|
643
|
-
s(), i && i();
|
|
644
|
-
}, m = document.createElement("div");
|
|
645
|
-
return m.innerHTML = Cn({ color: "#d9d9d9" }), fe({
|
|
646
|
-
element: A,
|
|
647
|
-
event: "click",
|
|
648
|
-
handler: E
|
|
649
|
-
}), A.setAttribute("id", u), Q(m, {
|
|
650
|
-
position: "fixed",
|
|
651
|
-
display: "flex",
|
|
652
|
-
justifyContent: "center",
|
|
653
|
-
alignItems: "center",
|
|
654
|
-
top: "0px",
|
|
655
|
-
width: "100%",
|
|
656
|
-
height: "100%",
|
|
657
|
-
backgroundColor: "rgba(0,0,0,.55)",
|
|
658
|
-
zIndex: "-1"
|
|
659
|
-
}), Q(A, d), A.append(m), A;
|
|
660
|
-
}, xt = () => innerWidth > 1080 && innerWidth > innerHeight ? {
|
|
661
|
-
width: `${innerHeight * 0.7 * (9 / 16)}px`,
|
|
662
|
-
height: `${innerHeight * 0.7}px`
|
|
663
|
-
} : {
|
|
664
|
-
width: "95%",
|
|
665
|
-
height: "95%"
|
|
666
|
-
};
|
|
667
|
-
function Pt(s) {
|
|
668
|
-
const i = s.toLowerCase().trim(), d = {
|
|
669
|
-
development: "dev",
|
|
670
|
-
production: "prod"
|
|
671
|
-
}[i] || i, A = {
|
|
672
|
-
dev: "https://face-dev.vultpayments.dev",
|
|
673
|
-
stage: "https://face-stage.vultpayments.dev",
|
|
674
|
-
demo: "https://face-demo.vultsecurity.com",
|
|
675
|
-
prod: "https://face.vultsecurity.com"
|
|
676
|
-
};
|
|
677
|
-
return A[d] ? A[d] : (console.warn(`Unknown environment: ${s}. Using dev domain as default.`), A.dev);
|
|
678
|
-
}
|
|
679
|
-
const Nn = async ({
|
|
680
|
-
KYC_VARS: s,
|
|
681
|
-
iframeId: i,
|
|
682
|
-
iframeContainerId: u
|
|
683
|
-
}) => {
|
|
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,
|
|
690
|
-
overflow: "hidden",
|
|
691
|
-
borderRadius: "20px"
|
|
692
|
-
});
|
|
693
|
-
const m = document.createElement("iframe");
|
|
694
|
-
return fe({
|
|
695
|
-
element: m,
|
|
696
|
-
event: "load",
|
|
697
|
-
handler: () => {
|
|
698
|
-
const M = document.getElementById(
|
|
699
|
-
i
|
|
700
|
-
);
|
|
701
|
-
M && setTimeout(() => {
|
|
702
|
-
M.contentWindow && (M.contentWindow.postMessage(
|
|
703
|
-
"Incoming from kyc",
|
|
704
|
-
d
|
|
705
|
-
), M.contentWindow.postMessage(
|
|
706
|
-
{
|
|
707
|
-
type: "RESPONSE_WINDOW_SIZE",
|
|
708
|
-
data: {
|
|
709
|
-
innerWidth: window.innerWidth,
|
|
710
|
-
innerHeight: window.innerHeight,
|
|
711
|
-
success: !0
|
|
712
|
-
}
|
|
713
|
-
},
|
|
714
|
-
d
|
|
715
|
-
));
|
|
716
|
-
}, 1e3);
|
|
717
|
-
}
|
|
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, {
|
|
719
|
-
border: "0px",
|
|
720
|
-
width: "100%",
|
|
721
|
-
height: "100%",
|
|
722
|
-
overflow: "hidden",
|
|
723
|
-
borderRadius: "20px"
|
|
724
|
-
}), A.append(m), A;
|
|
725
|
-
};
|
|
726
|
-
class Pn {
|
|
727
|
-
constructor(i) {
|
|
728
|
-
g(this, "KYC_VARS", {
|
|
729
|
-
session_id: "",
|
|
730
|
-
onComplete: function() {
|
|
731
|
-
},
|
|
732
|
-
onDismiss: function() {
|
|
733
|
-
},
|
|
734
|
-
Session_Type: "IDVerification",
|
|
735
|
-
sessionURL: "",
|
|
736
|
-
env: "dev"
|
|
737
|
-
});
|
|
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);
|
|
744
|
-
// Threshold for considering a resize significant (address bars typically change height by ~50-100px)
|
|
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);
|
|
757
|
-
d && d.contentWindow && d.contentWindow.postMessage(
|
|
758
|
-
{
|
|
759
|
-
type: "RESPONSE_WINDOW_SIZE",
|
|
760
|
-
data: {
|
|
761
|
-
innerWidth: window.innerWidth,
|
|
762
|
-
innerHeight: window.innerHeight,
|
|
763
|
-
success: !0
|
|
764
|
-
}
|
|
765
|
-
},
|
|
766
|
-
this.domain
|
|
767
|
-
);
|
|
768
|
-
}
|
|
769
|
-
if (u.data.type === "APP_STATUS")
|
|
770
|
-
switch (u.data.data.status) {
|
|
771
|
-
case "complete": {
|
|
772
|
-
if (this.KYC_VARS.onComplete) {
|
|
773
|
-
if (u.data.data.response) {
|
|
774
|
-
this.KYC_VARS.onComplete(u.data.data.response);
|
|
775
|
-
return;
|
|
776
|
-
}
|
|
777
|
-
this.KYC_VARS.onComplete();
|
|
778
|
-
}
|
|
779
|
-
break;
|
|
780
|
-
}
|
|
781
|
-
case "testing": {
|
|
782
|
-
console.log(u.data.data.status);
|
|
783
|
-
break;
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
});
|
|
787
|
-
g(this, "setLocationData", (i) => {
|
|
788
|
-
this.locationData = i;
|
|
789
|
-
});
|
|
790
|
-
g(this, "resizeHandler", () => {
|
|
791
|
-
console.log("resize");
|
|
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)) {
|
|
794
|
-
console.log("resize ignored (likely address bar hide/show on mobile)");
|
|
795
|
-
return;
|
|
796
|
-
}
|
|
797
|
-
this.isResizing = !0, this.resizeTimerID && clearTimeout(this.resizeTimerID), this.resizeTimerID = setTimeout(() => {
|
|
798
|
-
console.log("triggered state change");
|
|
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, {
|
|
810
|
-
width: `${window.innerWidth}px`,
|
|
811
|
-
height: `${window.innerHeight}px`
|
|
812
|
-
}), m.contentWindow && (m.contentWindow.postMessage(
|
|
813
|
-
{
|
|
814
|
-
type: "RESPONSE_PARENT_RESIZED",
|
|
815
|
-
data: {
|
|
816
|
-
innerWidth: window.innerWidth,
|
|
817
|
-
innerHeight: window.innerHeight,
|
|
818
|
-
success: !0
|
|
819
|
-
}
|
|
820
|
-
},
|
|
821
|
-
this.domain
|
|
822
|
-
), console.log(M), console.log("triggered state change")), this.previousWidth = window.innerWidth, this.previousHeight = window.innerHeight;
|
|
823
|
-
}, 1e3);
|
|
824
|
-
});
|
|
825
|
-
g(this, "setupResizingServices", () => {
|
|
826
|
-
this.previousWidth = window.innerWidth, this.previousHeight = window.innerHeight, fe({
|
|
827
|
-
element: window,
|
|
828
|
-
event: "resize",
|
|
829
|
-
handler: this.resizeHandler
|
|
830
|
-
});
|
|
831
|
-
});
|
|
832
|
-
g(this, "setUpHtml", async () => {
|
|
833
|
-
try {
|
|
834
|
-
await this.close();
|
|
835
|
-
const i = document.getElementById(this.mainWindowId);
|
|
836
|
-
i && i.remove();
|
|
837
|
-
const u = Mn({
|
|
838
|
-
removeElementFromDOM: this.close,
|
|
839
|
-
onDismiss: this.KYC_VARS.onDismiss,
|
|
840
|
-
mainWindowId: this.mainWindowId
|
|
841
|
-
});
|
|
842
|
-
window.document.body.append(u);
|
|
843
|
-
const d = await Nn({
|
|
844
|
-
KYC_VARS: this.KYC_VARS,
|
|
845
|
-
setLocationData: this.setLocationData,
|
|
846
|
-
iframeId: this.iframeId,
|
|
847
|
-
iframeContainerId: this.iframeContainerId
|
|
848
|
-
});
|
|
849
|
-
u.append(d);
|
|
850
|
-
} catch {
|
|
851
|
-
console.error("Error setting up HTML");
|
|
852
|
-
}
|
|
853
|
-
});
|
|
854
|
-
g(this, "setSessionType", (i) => i.Session_Type === "IDAuthentication" ? "/authenticate" : i.Session_Type === "IDVerification" ? "/verify" : "");
|
|
855
|
-
// start - creates HTML div elements and appends to DOM body element.
|
|
856
|
-
g(this, "startIDVerify", async (i) => {
|
|
857
|
-
try {
|
|
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 === "") {
|
|
863
|
-
console.error("You need a session ID to continue");
|
|
864
|
-
return;
|
|
865
|
-
}
|
|
866
|
-
this.KYC_VARS = {
|
|
867
|
-
...this.KYC_VARS,
|
|
868
|
-
session_id: i
|
|
869
|
-
}, await this.setUpHtml(), this.setupResizingServices(), fe({
|
|
870
|
-
element: window,
|
|
871
|
-
event: "message",
|
|
872
|
-
handler: this.windowEventListener
|
|
873
|
-
});
|
|
874
|
-
} catch {
|
|
875
|
-
console.error("There was an error starting ID Verification.");
|
|
876
|
-
}
|
|
877
|
-
});
|
|
878
|
-
g(this, "startIDAuthenticate", async (i) => {
|
|
879
|
-
try {
|
|
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 === "") {
|
|
885
|
-
console.error("You need a session ID to continue");
|
|
886
|
-
return;
|
|
887
|
-
}
|
|
888
|
-
this.KYC_VARS = {
|
|
889
|
-
...this.KYC_VARS,
|
|
890
|
-
session_id: i
|
|
891
|
-
}, await this.setUpHtml(), this.setupResizingServices(), fe({
|
|
892
|
-
element: window,
|
|
893
|
-
event: "message",
|
|
894
|
-
handler: this.windowEventListener
|
|
895
|
-
});
|
|
896
|
-
} catch {
|
|
897
|
-
console.error("There was an error starting ID Authentication.");
|
|
898
|
-
}
|
|
899
|
-
});
|
|
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
|
-
}
|
|
911
|
-
});
|
|
912
|
-
if (!i) {
|
|
913
|
-
console.error("Cannot initiate without initial configuration.");
|
|
914
|
-
return;
|
|
915
|
-
}
|
|
916
|
-
if (!i.Session_Type) {
|
|
917
|
-
console.error("Cannot initiate without a Session_Type.");
|
|
918
|
-
return;
|
|
919
|
-
}
|
|
920
|
-
if (!i.env) {
|
|
921
|
-
console.error("Environment is required. Please provide a valid environment.");
|
|
922
|
-
return;
|
|
923
|
-
}
|
|
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),
|
|
927
|
-
session_id: ""
|
|
928
|
-
// Will be set when starting verification/authentication
|
|
929
|
-
};
|
|
930
|
-
}
|
|
931
|
-
}
|
|
932
|
-
const kn = "IDAuthentication", Hn = "IDVerification";
|
|
933
|
-
export {
|
|
934
|
-
kn as IDA,
|
|
935
|
-
Hn as IDV,
|
|
936
|
-
Pn as KYCWidget
|
|
937
|
-
};
|