@prosopo/procaptcha-bundle 0.3.1 → 0.3.3
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/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/index.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/index.js +14 -7
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/index.js.map +1 -1
- package/dist/bundle/Captcha-O2tGirAv.js +106 -0
- package/dist/bundle/ProcaptchaWidget-f7S-UgEx.js +891 -0
- package/dist/bundle/{index-DUjgpJkc.js → index-BoRQHVyP.js} +4649 -3729
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/procaptcha.bundle.js +1 -1
- package/dist/bundle/{interface-CyIrD5th.js → utils-CIX8CwBe.js} +5092 -5181
- package/dist/cjs/account/dist/extension/ExtensionWeb3.cjs +28 -0
- package/dist/cjs/account/dist/index.cjs +2 -0
- package/dist/cjs/index.cjs +15 -6
- package/dist/cjs/procaptcha-frictionless/dist/ProcaptchaFrictionless.cjs +27 -0
- package/dist/cjs/procaptcha-frictionless/dist/index.cjs +4 -0
- package/dist/cjs/procaptcha-pow/dist/Services/Manager.cjs +91 -27
- package/dist/cjs/procaptcha-pow/dist/components/Captcha.cjs +22 -67
- package/dist/cjs/procaptcha-pow/dist/components/ProcaptchaPoW.cjs +1 -1
- package/dist/cjs/web-components/dist/CaptchaPlaceholder.cjs +13 -55
- package/dist/cjs/web-components/dist/Checkbox.cjs +21 -11
- package/dist/cjs/web-components/dist/Containers.cjs +42 -0
- package/dist/cjs/web-components/dist/LoadingSpinner.cjs +4 -0
- package/dist/cjs/web-components/dist/Logo.cjs +16 -0
- package/dist/cjs/web-components/dist/LogoWithText.cjs +10 -0
- package/dist/cjs/web-components/dist/LogoWithoutText.cjs +10 -0
- package/dist/cjs/web-components/dist/WidgetConstants.cjs +12 -0
- package/dist/cjs/web-components/dist/index.cjs +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -7
- package/dist/index.js.map +1 -1
- package/package.json +7 -6
- package/stats.html +1 -1
- package/typedoc.config.js +13 -0
- package/vite.cjs.config.ts +13 -0
- package/vite.config.ts +14 -1
- package/dist/bundle/Captcha-wrP5sDne.js +0 -169
- package/dist/bundle/ProcaptchaWidget-CggtG-1W.js +0 -1037
|
@@ -1,1037 +0,0 @@
|
|
|
1
|
-
import { r as h, l as J, d as ee, j as u, a as A, b as m, P as Me, R as ke, c as Le, L as Oe } from "./index-DUjgpJkc.js";
|
|
2
|
-
import { _ as _e, j as qe, k as De, I as Re, R as We, m as Ve, n as je, o as Ze, q as Ue, r as Z, v as Fe, P as E, W as Ce, u as Be, p as Ge, h as ne, s as ve, e as ze, A as xe, K as be, a as Ke, d as $e, l as Qe, b as Ye, S as Xe, x as oe, y as B, z as j, B as Je, w as et, t as le, D as tt, f as nt, E as ot, g as at, C as rt, i as st } from "./interface-CyIrD5th.js";
|
|
3
|
-
function ct() {
|
|
4
|
-
if (console && console.warn) {
|
|
5
|
-
for (var t, e = arguments.length, n = new Array(e), o = 0; o < e; o++)
|
|
6
|
-
n[o] = arguments[o];
|
|
7
|
-
typeof n[0] == "string" && (n[0] = "react-i18next:: ".concat(n[0])), (t = console).warn.apply(t, n);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
var de = {};
|
|
11
|
-
function ae() {
|
|
12
|
-
for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
|
|
13
|
-
e[n] = arguments[n];
|
|
14
|
-
typeof e[0] == "string" && de[e[0]] || (typeof e[0] == "string" && (de[e[0]] = /* @__PURE__ */ new Date()), ct.apply(void 0, e));
|
|
15
|
-
}
|
|
16
|
-
function ue(t, e, n) {
|
|
17
|
-
t.loadNamespaces(e, function() {
|
|
18
|
-
if (t.isInitialized)
|
|
19
|
-
n();
|
|
20
|
-
else {
|
|
21
|
-
var o = function a() {
|
|
22
|
-
setTimeout(function() {
|
|
23
|
-
t.off("initialized", a);
|
|
24
|
-
}, 0), n();
|
|
25
|
-
};
|
|
26
|
-
t.on("initialized", o);
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
function it(t, e) {
|
|
31
|
-
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, o = e.languages[0], a = e.options ? e.options.fallbackLng : !1, r = e.languages[e.languages.length - 1];
|
|
32
|
-
if (o.toLowerCase() === "cimode")
|
|
33
|
-
return !0;
|
|
34
|
-
var s = function(l, p) {
|
|
35
|
-
var w = e.services.backendConnector.state["".concat(l, "|").concat(p)];
|
|
36
|
-
return w === -1 || w === 2;
|
|
37
|
-
};
|
|
38
|
-
return n.bindI18n && n.bindI18n.indexOf("languageChanging") > -1 && e.services.backendConnector.backend && e.isLanguageChangingTo && !s(e.isLanguageChangingTo, t) ? !1 : !!(e.hasResourceBundle(o, t) || !e.services.backendConnector.backend || e.options.resources && !e.options.partialBundledLanguages || s(o, t) && (!a || s(r, t)));
|
|
39
|
-
}
|
|
40
|
-
function lt(t, e) {
|
|
41
|
-
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
42
|
-
if (!e.languages || !e.languages.length)
|
|
43
|
-
return ae("i18n.languages were undefined or empty", e.languages), !0;
|
|
44
|
-
var o = e.options.ignoreJSONStructure !== void 0;
|
|
45
|
-
return o ? e.hasLoadedNamespace(t, {
|
|
46
|
-
precheck: function(r, s) {
|
|
47
|
-
if (n.bindI18n && n.bindI18n.indexOf("languageChanging") > -1 && r.services.backendConnector.backend && r.isLanguageChangingTo && !s(r.isLanguageChangingTo, t))
|
|
48
|
-
return !1;
|
|
49
|
-
}
|
|
50
|
-
}) : it(t, e, n);
|
|
51
|
-
}
|
|
52
|
-
function dt(t, e) {
|
|
53
|
-
var n = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
|
|
54
|
-
if (n != null) {
|
|
55
|
-
var o, a, r, s, i = [], l = !0, p = !1;
|
|
56
|
-
try {
|
|
57
|
-
if (r = (n = n.call(t)).next, e === 0) {
|
|
58
|
-
if (Object(n) !== n)
|
|
59
|
-
return;
|
|
60
|
-
l = !1;
|
|
61
|
-
} else
|
|
62
|
-
for (; !(l = (o = r.call(n)).done) && (i.push(o.value), i.length !== e); l = !0)
|
|
63
|
-
;
|
|
64
|
-
} catch (w) {
|
|
65
|
-
p = !0, a = w;
|
|
66
|
-
} finally {
|
|
67
|
-
try {
|
|
68
|
-
if (!l && n.return != null && (s = n.return(), Object(s) !== s))
|
|
69
|
-
return;
|
|
70
|
-
} finally {
|
|
71
|
-
if (p)
|
|
72
|
-
throw a;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return i;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
function ut(t, e) {
|
|
79
|
-
return _e(t) || dt(t, e) || qe(t, e) || De();
|
|
80
|
-
}
|
|
81
|
-
function pe(t, e) {
|
|
82
|
-
var n = Object.keys(t);
|
|
83
|
-
if (Object.getOwnPropertySymbols) {
|
|
84
|
-
var o = Object.getOwnPropertySymbols(t);
|
|
85
|
-
e && (o = o.filter(function(a) {
|
|
86
|
-
return Object.getOwnPropertyDescriptor(t, a).enumerable;
|
|
87
|
-
})), n.push.apply(n, o);
|
|
88
|
-
}
|
|
89
|
-
return n;
|
|
90
|
-
}
|
|
91
|
-
function te(t) {
|
|
92
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
93
|
-
var n = arguments[e] != null ? arguments[e] : {};
|
|
94
|
-
e % 2 ? pe(Object(n), !0).forEach(function(o) {
|
|
95
|
-
je(t, o, n[o]);
|
|
96
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : pe(Object(n)).forEach(function(o) {
|
|
97
|
-
Object.defineProperty(t, o, Object.getOwnPropertyDescriptor(n, o));
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
return t;
|
|
101
|
-
}
|
|
102
|
-
var pt = function(e, n) {
|
|
103
|
-
var o = h.useRef();
|
|
104
|
-
return h.useEffect(function() {
|
|
105
|
-
o.current = n ? o.current : e;
|
|
106
|
-
}, [e, n]), o.current;
|
|
107
|
-
};
|
|
108
|
-
function ht(t) {
|
|
109
|
-
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = e.i18n, o = h.useContext(Re) || {}, a = o.i18n, r = o.defaultNS, s = n || a || Ze();
|
|
110
|
-
if (s && !s.reportNamespaces && (s.reportNamespaces = new We()), !s) {
|
|
111
|
-
ae("You will need to pass in an i18next instance by using initReactI18next");
|
|
112
|
-
var i = function(b) {
|
|
113
|
-
return Array.isArray(b) ? b[b.length - 1] : b;
|
|
114
|
-
}, l = [i, {}, !1];
|
|
115
|
-
return l.t = i, l.i18n = {}, l.ready = !1, l;
|
|
116
|
-
}
|
|
117
|
-
s.options.react && s.options.react.wait !== void 0 && ae("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
|
118
|
-
var p = te(te(te({}, Ve()), s.options.react), e), w = p.useSuspense, y = p.keyPrefix, f = t || r || s.options && s.options.defaultNS;
|
|
119
|
-
f = typeof f == "string" ? [f] : f || ["translation"], s.reportNamespaces.addUsedNamespaces && s.reportNamespaces.addUsedNamespaces(f);
|
|
120
|
-
var T = (s.isInitialized || s.initializedStoreOnce) && f.every(function(x) {
|
|
121
|
-
return lt(x, s, p);
|
|
122
|
-
});
|
|
123
|
-
function S() {
|
|
124
|
-
return s.getFixedT(null, p.nsMode === "fallback" ? f : f[0], y);
|
|
125
|
-
}
|
|
126
|
-
var U = h.useState(S), k = ut(U, 2), L = k[0], I = k[1], O = f.join(), q = pt(O), N = h.useRef(!0);
|
|
127
|
-
h.useEffect(function() {
|
|
128
|
-
var x = p.bindI18n, b = p.bindI18nStore;
|
|
129
|
-
N.current = !0, !T && !w && ue(s, f, function() {
|
|
130
|
-
N.current && I(S);
|
|
131
|
-
}), T && q && q !== O && N.current && I(S);
|
|
132
|
-
function D() {
|
|
133
|
-
N.current && I(S);
|
|
134
|
-
}
|
|
135
|
-
return x && s && s.on(x, D), b && s && s.store.on(b, D), function() {
|
|
136
|
-
N.current = !1, x && s && x.split(" ").forEach(function(d) {
|
|
137
|
-
return s.off(d, D);
|
|
138
|
-
}), b && s && b.split(" ").forEach(function(d) {
|
|
139
|
-
return s.store.off(d, D);
|
|
140
|
-
});
|
|
141
|
-
};
|
|
142
|
-
}, [s, O]);
|
|
143
|
-
var P = h.useRef(!0);
|
|
144
|
-
h.useEffect(function() {
|
|
145
|
-
N.current && !P.current && I(S), P.current = !1;
|
|
146
|
-
}, [s, y]);
|
|
147
|
-
var v = [L, s, T];
|
|
148
|
-
if (v.t = L, v.i18n = s, v.ready = T, T || !T && !w)
|
|
149
|
-
return v;
|
|
150
|
-
throw new Promise(function(x) {
|
|
151
|
-
ue(s, f, function() {
|
|
152
|
-
x();
|
|
153
|
-
});
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
function ft(t) {
|
|
157
|
-
return ht("translation", { i18n: Ue, ...t });
|
|
158
|
-
}
|
|
159
|
-
const gt = (t) => {
|
|
160
|
-
if (!t.hash)
|
|
161
|
-
throw new Z("CAPTCHA.MISSING_ITEM_HASH", { context: { item: t } });
|
|
162
|
-
return t.hash;
|
|
163
|
-
}, mt = ({ challenge: t, solution: e, onClick: n, themeColor: o }) => {
|
|
164
|
-
const a = t.captcha.items, r = h.useMemo(() => o === "light" ? J : ee, [o]), s = "ontouchstart" in window;
|
|
165
|
-
return u("div", { style: {
|
|
166
|
-
paddingRight: 0.5,
|
|
167
|
-
paddingBottom: 0.5,
|
|
168
|
-
width: "100%",
|
|
169
|
-
height: "100%",
|
|
170
|
-
display: "flex",
|
|
171
|
-
flexDirection: "row",
|
|
172
|
-
flexWrap: "wrap"
|
|
173
|
-
}, children: a.map((i, l) => {
|
|
174
|
-
const p = gt(i);
|
|
175
|
-
return u("div", { style: {
|
|
176
|
-
paddingTop: "4px",
|
|
177
|
-
paddingLeft: "4px",
|
|
178
|
-
flexGrow: 1,
|
|
179
|
-
flexBasis: "33.3333%",
|
|
180
|
-
boxSizing: "border-box"
|
|
181
|
-
}, children: A("div", { style: { cursor: "pointer", height: "100%", width: "100%" }, onClick: s ? void 0 : () => n(p), onTouchStart: s ? () => n(p) : void 0, children: [u("div", { style: { border: 1, borderColor: r.palette.grey[300] }, children: u("img", { style: {
|
|
182
|
-
width: "100%",
|
|
183
|
-
backgroundColor: r.palette.grey[300],
|
|
184
|
-
opacity: e.includes(p) && s ? "50%" : "100%",
|
|
185
|
-
display: "block",
|
|
186
|
-
objectFit: "contain",
|
|
187
|
-
aspectRatio: "1/1",
|
|
188
|
-
height: "auto"
|
|
189
|
-
}, src: i.data, alt: `Captcha image ${l + 1}` }) }), u("div", { style: {
|
|
190
|
-
position: "relative",
|
|
191
|
-
width: "100%",
|
|
192
|
-
height: "100%",
|
|
193
|
-
top: "-100%",
|
|
194
|
-
visibility: e.includes(p) ? "visible" : "hidden",
|
|
195
|
-
transition: "opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
|
|
196
|
-
opacity: 1
|
|
197
|
-
}, children: u("div", { style: {
|
|
198
|
-
position: "absolute",
|
|
199
|
-
top: 0,
|
|
200
|
-
left: 0,
|
|
201
|
-
bottom: 0,
|
|
202
|
-
right: 0,
|
|
203
|
-
height: "100%",
|
|
204
|
-
width: "100%",
|
|
205
|
-
display: "flex",
|
|
206
|
-
alignItems: "center",
|
|
207
|
-
justifyContent: "center",
|
|
208
|
-
backgroundColor: "rgba(0,0,0,0.5)"
|
|
209
|
-
}, children: u("svg", { style: {
|
|
210
|
-
backgroundColor: "transparent",
|
|
211
|
-
display: "block",
|
|
212
|
-
width: "35%",
|
|
213
|
-
height: "35%",
|
|
214
|
-
transition: "fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
|
|
215
|
-
userSelect: "none",
|
|
216
|
-
fill: "currentcolor"
|
|
217
|
-
}, focusable: "false", color: "#fff", "aria-hidden": "true", viewBox: "0 0 24 24", "data-testid": "CheckIcon", children: u("path", { d: "M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" }) }) }) })] }) }, l);
|
|
218
|
-
}) });
|
|
219
|
-
};
|
|
220
|
-
function wt(t = {}) {
|
|
221
|
-
return Object.keys(t).reduce((e, n) => ({ ...e, [`data-${n}`]: t[n] }), {});
|
|
222
|
-
}
|
|
223
|
-
function re({ general: t, dev: e }) {
|
|
224
|
-
return {
|
|
225
|
-
...wt(t)
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
const yt = {
|
|
229
|
-
display: "inline-flex",
|
|
230
|
-
alignItems: "center",
|
|
231
|
-
justifyContent: "center",
|
|
232
|
-
position: "relative",
|
|
233
|
-
boxSizing: "border-box",
|
|
234
|
-
outline: "0px",
|
|
235
|
-
border: "0px",
|
|
236
|
-
margin: "0px",
|
|
237
|
-
cursor: "pointer",
|
|
238
|
-
userSelect: "none",
|
|
239
|
-
verticalAlign: "middle",
|
|
240
|
-
appearance: void 0,
|
|
241
|
-
textDecoration: "none",
|
|
242
|
-
fontWeight: "500",
|
|
243
|
-
fontSize: "0.875rem",
|
|
244
|
-
lineHeight: "1.75",
|
|
245
|
-
letterSpacing: "0.02857em",
|
|
246
|
-
textTransform: "uppercase",
|
|
247
|
-
minWidth: "64px",
|
|
248
|
-
padding: "6px 16px",
|
|
249
|
-
borderRadius: "4px",
|
|
250
|
-
transition: "background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
|
|
251
|
-
color: "rgb(0, 0, 0)",
|
|
252
|
-
backgroundColor: "#ffffff",
|
|
253
|
-
boxShadow: "rgba(0, 0, 0, 0.2) 0px 3px 1px -2px, rgba(0, 0, 0, 0.14) 0px 2px 2px 0px, rgba(0, 0, 0, 0.12) 0px 1px 5px 0px"
|
|
254
|
-
}, Ct = ({ themeColor: t, buttonType: e, text: n, onClick: o }) => {
|
|
255
|
-
const a = h.useMemo(() => t === "light" ? J : ee, [t]), [r, s] = h.useState(!1), i = h.useMemo(() => {
|
|
256
|
-
const l = {
|
|
257
|
-
...yt,
|
|
258
|
-
color: r ? a.palette.primary.contrastText : a.palette.background.contrastText
|
|
259
|
-
};
|
|
260
|
-
return e === "cancel" ? {
|
|
261
|
-
...l,
|
|
262
|
-
backgroundColor: r ? a.palette.grey[600] : "transparent"
|
|
263
|
-
} : {
|
|
264
|
-
...l,
|
|
265
|
-
backgroundColor: r ? a.palette.primary.main : a.palette.background.default
|
|
266
|
-
};
|
|
267
|
-
}, [e, r, a]);
|
|
268
|
-
return u("button", { ...re({ dev: { cy: `button-${e}` } }), onMouseEnter: () => s(!0), onMouseLeave: () => s(!1), style: i, onClick: (l) => {
|
|
269
|
-
l.preventDefault(), o();
|
|
270
|
-
}, children: n });
|
|
271
|
-
}, he = Ct, vt = ({ challenge: t, index: e, solutions: n, onSubmit: o, onCancel: a, onClick: r, onNext: s, themeColor: i }) => {
|
|
272
|
-
const { t: l } = ft(), p = t.captchas ? m(t.captchas, e) : null, w = n ? m(n, e) : [], y = h.useMemo(() => i === "light" ? J : ee, [i]);
|
|
273
|
-
return u(h.Suspense, { fallback: u("div", { children: "Loading..." }), children: u("div", { style: {
|
|
274
|
-
overflowX: "auto",
|
|
275
|
-
overflowY: "auto",
|
|
276
|
-
width: "100%",
|
|
277
|
-
maxWidth: "500px",
|
|
278
|
-
maxHeight: "100%",
|
|
279
|
-
display: "flex",
|
|
280
|
-
flexDirection: "column"
|
|
281
|
-
}, children: A("div", { style: {
|
|
282
|
-
backgroundColor: y.palette.background.default,
|
|
283
|
-
display: "flex",
|
|
284
|
-
flexDirection: "column",
|
|
285
|
-
minWidth: "300px"
|
|
286
|
-
}, children: [A("div", { style: {
|
|
287
|
-
display: "flex",
|
|
288
|
-
alignItems: "center",
|
|
289
|
-
width: "100%",
|
|
290
|
-
backgroundColor: y.palette.primary.main,
|
|
291
|
-
padding: "24px 16px"
|
|
292
|
-
}, children: [A("p", { style: {
|
|
293
|
-
color: "#ffffff",
|
|
294
|
-
fontWeight: 700,
|
|
295
|
-
lineHeight: 1.5
|
|
296
|
-
}, children: [l("WIDGET.SELECT_ALL"), ": "] }), u("p", { style: {
|
|
297
|
-
color: "#ffffff",
|
|
298
|
-
fontWeight: 700,
|
|
299
|
-
textTransform: "capitalize",
|
|
300
|
-
lineHeight: 1.5
|
|
301
|
-
}, children: `${m(t.captchas, e).captcha.target}` })] }), u("div", { ...re({ dev: { cy: "captcha-" + e } }), children: p && u(mt, { challenge: p, solution: w, onClick: r, themeColor: i }) }), u("div", { style: {
|
|
302
|
-
display: "flex",
|
|
303
|
-
alignItems: "center",
|
|
304
|
-
justifyContent: "center",
|
|
305
|
-
width: "100%"
|
|
306
|
-
}, ...re({ dev: { cy: "dots-captcha" } }) }), u("div", { style: {
|
|
307
|
-
padding: "8px 16px",
|
|
308
|
-
display: "flex",
|
|
309
|
-
width: "100%"
|
|
310
|
-
} }), A("div", { style: {
|
|
311
|
-
padding: "0 16px 16px",
|
|
312
|
-
display: "flex",
|
|
313
|
-
alignItems: "center",
|
|
314
|
-
justifyContent: "space-between",
|
|
315
|
-
lineHeight: 1.75
|
|
316
|
-
}, children: [u(he, { themeColor: i, buttonType: "cancel", onClick: a, text: l("WIDGET.CANCEL") }), u(he, { themeColor: i, buttonType: "next", text: e < t.captchas.length - 1 ? l("WIDGET.NEXT") : l("WIDGET.SUBMIT"), onClick: e < t.captchas.length - 1 ? s : o })] })] }) }) });
|
|
317
|
-
}, xt = vt;
|
|
318
|
-
function bt(t) {
|
|
319
|
-
return new Promise((e) => {
|
|
320
|
-
document.readyState === "complete" ? e(t()) : window.addEventListener("load", () => e(t()));
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
|
-
const X = window;
|
|
324
|
-
X.injectedWeb3 = X.injectedWeb3 || {};
|
|
325
|
-
Ae();
|
|
326
|
-
let fe = null;
|
|
327
|
-
function Ae() {
|
|
328
|
-
return Object.values(X.injectedWeb3).filter(({ connect: t, enable: e }) => !!(t || e)).length !== 0;
|
|
329
|
-
}
|
|
330
|
-
function At(t) {
|
|
331
|
-
return Promise.all(Object.entries(X.injectedWeb3).map(([e, { connect: n, enable: o, version: a }]) => Promise.resolve().then(() => n ? n(t) : o ? o(t).then((r) => Fe({ name: e, version: a || "unknown" }, r)) : Promise.reject(new Error("No connect(..) or enable(...) hook found"))).catch(({ message: r }) => {
|
|
332
|
-
console.error(`Error initializing ${e}: ${r}`);
|
|
333
|
-
}))).then((e) => e.filter((n) => !!n));
|
|
334
|
-
}
|
|
335
|
-
function Et(t, e = []) {
|
|
336
|
-
if (!t)
|
|
337
|
-
throw new Error("You must pass a name for your app to the web3Enable function");
|
|
338
|
-
const n = e.length ? Promise.all(e.map((o) => o().catch(() => !1))) : Promise.resolve([!0]);
|
|
339
|
-
return fe = bt(() => n.then(() => At(t).then((o) => o.map((a) => (a.accounts.subscribe || (a.accounts.subscribe = (r) => (a.accounts.get().then(r).catch(console.error), () => {
|
|
340
|
-
})), a))).catch(() => []).then((o) => {
|
|
341
|
-
const a = o.map(({ name: r, version: s }) => `${r}/${s}`);
|
|
342
|
-
return Ae(), console.info(`web3Enable: Enabled ${o.length} extension${o.length !== 1 ? "s" : ""}: ${a.join(", ")}`), o;
|
|
343
|
-
}))), fe;
|
|
344
|
-
}
|
|
345
|
-
class se extends Error {
|
|
346
|
-
constructor(e) {
|
|
347
|
-
super(e || "No account found");
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
class Tt extends Error {
|
|
351
|
-
constructor(e) {
|
|
352
|
-
super(e || "No extensions found");
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
class Ee {
|
|
356
|
-
}
|
|
357
|
-
class It extends Ee {
|
|
358
|
-
async getAccount(e) {
|
|
359
|
-
const { dappName: n, userAccountAddress: o } = e;
|
|
360
|
-
if (!o)
|
|
361
|
-
throw new se("No account address provided");
|
|
362
|
-
const a = await Et(n);
|
|
363
|
-
if (a.length === 0)
|
|
364
|
-
throw new Tt();
|
|
365
|
-
for (const r of a) {
|
|
366
|
-
const i = (await r.accounts.get()).find((l) => l.address === o);
|
|
367
|
-
if (i)
|
|
368
|
-
return { account: i, extension: r };
|
|
369
|
-
}
|
|
370
|
-
throw new se("No account found matching " + o);
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
class Nt extends Ee {
|
|
374
|
-
constructor() {
|
|
375
|
-
super(...arguments), this.getNetwork = (e) => {
|
|
376
|
-
const n = e.networks[e.defaultNetwork];
|
|
377
|
-
if (!n)
|
|
378
|
-
throw new E("DEVELOPER.NETWORK_NOT_FOUND", {
|
|
379
|
-
context: { error: `No network found for environment ${e.defaultEnvironment}` }
|
|
380
|
-
});
|
|
381
|
-
return n;
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
async getAccount(e) {
|
|
385
|
-
const n = this.getNetwork(e), o = new Ce(n.endpoint), a = await this.createAccount(o), r = await this.createExtension(a);
|
|
386
|
-
return {
|
|
387
|
-
account: a,
|
|
388
|
-
extension: r
|
|
389
|
-
};
|
|
390
|
-
}
|
|
391
|
-
async createExtension(e) {
|
|
392
|
-
const n = new Xe(async () => {
|
|
393
|
-
});
|
|
394
|
-
return n.signRaw = async (o) => {
|
|
395
|
-
const a = e.keypair.sign(o.data);
|
|
396
|
-
return {
|
|
397
|
-
id: 1,
|
|
398
|
-
signature: Be(a)
|
|
399
|
-
};
|
|
400
|
-
}, {
|
|
401
|
-
accounts: {
|
|
402
|
-
get: async () => [e],
|
|
403
|
-
subscribe: () => () => {
|
|
404
|
-
}
|
|
405
|
-
},
|
|
406
|
-
name: "procaptcha-web2",
|
|
407
|
-
version: "0.1.11",
|
|
408
|
-
signer: n
|
|
409
|
-
};
|
|
410
|
-
}
|
|
411
|
-
async createAccount(e) {
|
|
412
|
-
const n = {
|
|
413
|
-
area: { width: 300, height: 300 },
|
|
414
|
-
offsetParameter: 2001000001,
|
|
415
|
-
multiplier: 15e3,
|
|
416
|
-
fontSizeFactor: 1.5,
|
|
417
|
-
maxShadowBlur: 50,
|
|
418
|
-
numberOfRounds: 5,
|
|
419
|
-
seed: 42
|
|
420
|
-
}, o = await this.getFingerprint(), a = Ge(n.numberOfRounds, n.seed, n), r = ne([a, o].join(""), 128).slice(2), s = ve(r), i = ze(s), l = await xe.create({ provider: e, initWasm: !1 }), p = "ed25519", y = new be({ type: p, ss58Format: l.registry.chainSS58 }).addFromMnemonic(i), f = y.address.length === 42 ? y.address : Ke($e(y.address), l.registry.chainSS58);
|
|
421
|
-
return {
|
|
422
|
-
address: f,
|
|
423
|
-
type: p,
|
|
424
|
-
name: f,
|
|
425
|
-
keypair: y
|
|
426
|
-
};
|
|
427
|
-
}
|
|
428
|
-
async getFingerprint() {
|
|
429
|
-
const o = await (await Qe()).get(), { screenFrame: a, ...r } = o.components;
|
|
430
|
-
return Ye(r);
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
const Pt = (t) => new Promise((e) => setTimeout(e, t));
|
|
434
|
-
async function Ht(t) {
|
|
435
|
-
try {
|
|
436
|
-
const e = await fetch(t);
|
|
437
|
-
if (!e.ok)
|
|
438
|
-
throw new oe("API.BAD_REQUEST", {
|
|
439
|
-
context: { error: `Network response was not ok, status: ${e.status}`, url: t }
|
|
440
|
-
});
|
|
441
|
-
const n = await e.arrayBuffer();
|
|
442
|
-
return new Uint8Array(n);
|
|
443
|
-
} catch (e) {
|
|
444
|
-
throw new E("DATABASE.IMAGE_GET_FAILED", { context: { error: e } });
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
const St = "NO_SOLUTION";
|
|
448
|
-
function Te(t, e = !1, n = !1, o) {
|
|
449
|
-
try {
|
|
450
|
-
const a = t.items.map((r, s) => {
|
|
451
|
-
if (r.hash)
|
|
452
|
-
return r.hash;
|
|
453
|
-
throw new Z("CAPTCHA.MISSING_ITEM_HASH", {
|
|
454
|
-
context: {
|
|
455
|
-
computeCaptchaHashName: Te.name,
|
|
456
|
-
index: s
|
|
457
|
-
}
|
|
458
|
-
});
|
|
459
|
-
});
|
|
460
|
-
return B([
|
|
461
|
-
t.target,
|
|
462
|
-
...e ? Mt(t.solution) : [],
|
|
463
|
-
n ? t.salt : "",
|
|
464
|
-
o ? a.sort() : a
|
|
465
|
-
]);
|
|
466
|
-
} catch (a) {
|
|
467
|
-
throw new Z("DATASET.HASH_ERROR", { context: { error: a } });
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
function Mt(t) {
|
|
471
|
-
return t !== void 0 ? t.sort() : [St];
|
|
472
|
-
}
|
|
473
|
-
async function kt(t) {
|
|
474
|
-
if (t.type === "text")
|
|
475
|
-
return { ...t, hash: ne(t.data) };
|
|
476
|
-
if (t.type === "image")
|
|
477
|
-
return { ...t, hash: ne(await Ht(t.data)) };
|
|
478
|
-
throw new Z("CAPTCHA.INVALID_ITEM_FORMAT");
|
|
479
|
-
}
|
|
480
|
-
function Lt(t) {
|
|
481
|
-
return B([t.captchaId, t.captchaContentId, [...t.solution].sort(), t.salt]);
|
|
482
|
-
}
|
|
483
|
-
class ge {
|
|
484
|
-
constructor(e) {
|
|
485
|
-
this.hash = e, this.parent = null;
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
class Ot {
|
|
489
|
-
constructor() {
|
|
490
|
-
this.leaves = [], this.layers = [];
|
|
491
|
-
}
|
|
492
|
-
build(e) {
|
|
493
|
-
this.layers.length && (this.layers = []);
|
|
494
|
-
const n = [];
|
|
495
|
-
for (const o of e) {
|
|
496
|
-
const a = new ge(o);
|
|
497
|
-
this.leaves.push(a), n.push(a.hash);
|
|
498
|
-
}
|
|
499
|
-
this.layers.push(n), this.root = this.buildMerkleTree(this.leaves)[0];
|
|
500
|
-
}
|
|
501
|
-
buildMerkleTree(e) {
|
|
502
|
-
const n = e.length;
|
|
503
|
-
if (n === 1)
|
|
504
|
-
return e;
|
|
505
|
-
const o = [];
|
|
506
|
-
let a = 0;
|
|
507
|
-
const r = [];
|
|
508
|
-
for (; a < n; ) {
|
|
509
|
-
const s = e[a];
|
|
510
|
-
if (s === void 0)
|
|
511
|
-
throw new j("DEVELOPER.GENERAL", { context: { error: "leftChild undefined" } });
|
|
512
|
-
const i = a + 1 < n ? m(e, a + 1) : s, l = this.createParent(s, i);
|
|
513
|
-
r.push(l.hash), o.push(l), a += 2;
|
|
514
|
-
}
|
|
515
|
-
return this.layers.push(r), this.buildMerkleTree(o);
|
|
516
|
-
}
|
|
517
|
-
createParent(e, n) {
|
|
518
|
-
const o = new ge(B([e.hash, n.hash]));
|
|
519
|
-
return e.parent = o.hash, n.parent = o.hash, o;
|
|
520
|
-
}
|
|
521
|
-
proof(e) {
|
|
522
|
-
const n = [];
|
|
523
|
-
let o = 0;
|
|
524
|
-
for (; o < this.layers.length - 1; ) {
|
|
525
|
-
const r = this.layers[o];
|
|
526
|
-
if (r === void 0)
|
|
527
|
-
throw new j("DATASET.MERKLE_ERROR", {
|
|
528
|
-
context: { error: "layer undefined", failedFuncName: this.proof.name, layerNum: o }
|
|
529
|
-
});
|
|
530
|
-
const s = r.indexOf(e);
|
|
531
|
-
let i = s % 2 && s > 0 ? s - 1 : s + 1;
|
|
532
|
-
i > r.length - 1 && (i = s);
|
|
533
|
-
const l = [e], p = m(r, i);
|
|
534
|
-
i > s ? l.push(p) : l.unshift(p), n.push([m(l, 0), m(l, 1)]), o += 1, e = B(l);
|
|
535
|
-
}
|
|
536
|
-
const a = m(this.layers, this.layers.length - 1);
|
|
537
|
-
return [...n, [m(a, 0)]];
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
function _t(t, e) {
|
|
541
|
-
try {
|
|
542
|
-
if (m(e, 0).indexOf(t) === -1)
|
|
543
|
-
return !1;
|
|
544
|
-
for (const [n, o] of e.entries()) {
|
|
545
|
-
if (t = B(o), m(e, n + 1).indexOf(t) === -1)
|
|
546
|
-
return !1;
|
|
547
|
-
const a = m(e, e.length - 1);
|
|
548
|
-
if (t === m(a, 0))
|
|
549
|
-
return !0;
|
|
550
|
-
}
|
|
551
|
-
return !1;
|
|
552
|
-
} catch {
|
|
553
|
-
return !1;
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
class qt {
|
|
557
|
-
constructor(e, n, o, a, r, s) {
|
|
558
|
-
this.userAccount = e, this.contract = n, this.provider = o, this.providerApi = a, this.web2 = r, this.dappAccount = s;
|
|
559
|
-
}
|
|
560
|
-
async getCaptchaChallenge() {
|
|
561
|
-
try {
|
|
562
|
-
const e = await this.providerApi.getCaptchaChallenge(this.userAccount, this.provider);
|
|
563
|
-
return this.verifyCaptchaChallengeContent(this.provider, e), e.captchas.forEach((n) => {
|
|
564
|
-
n.captcha.items.forEach((o) => {
|
|
565
|
-
o.data && (o.data = o.data.replace(/^http(s)*:\/\//, "//"));
|
|
566
|
-
});
|
|
567
|
-
}), e;
|
|
568
|
-
} catch (e) {
|
|
569
|
-
throw new E("CAPTCHA.INVALID_CAPTCHA_CHALLENGE", { context: { error: e } });
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
verifyCaptchaChallengeContent(e, n) {
|
|
573
|
-
const o = m(n.captchas, 0), a = o.proof.length;
|
|
574
|
-
e.provider;
|
|
575
|
-
const r = m(o.proof, a - 1);
|
|
576
|
-
if (e.provider.datasetIdContent.toString() !== m(r, 0))
|
|
577
|
-
throw new E("CAPTCHA.INVALID_DATASET_CONTENT_ID");
|
|
578
|
-
for (const s of n.captchas) {
|
|
579
|
-
if (!Dt(s))
|
|
580
|
-
throw new E("CAPTCHA.INVALID_CAPTCHA_CHALLENGE");
|
|
581
|
-
if (!_t(s.captcha.captchaContentId, s.proof))
|
|
582
|
-
throw new E("CAPTCHA.INVALID_CAPTCHA_CHALLENGE");
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
async submitCaptchaSolution(e, n, o, a, r) {
|
|
586
|
-
const s = new Ot(), i = a.map((f) => Lt(f));
|
|
587
|
-
s.build(i);
|
|
588
|
-
const l = s.root.hash, p = void 0;
|
|
589
|
-
let w;
|
|
590
|
-
if (this.web2) {
|
|
591
|
-
if (!e || !e.signRaw)
|
|
592
|
-
throw new E("GENERAL.CANT_FIND_KEYRINGPAIR", {
|
|
593
|
-
context: { error: "Signer is not defined, cannot sign message to prove account ownership" }
|
|
594
|
-
});
|
|
595
|
-
w = (await e.signRaw({
|
|
596
|
-
address: this.userAccount,
|
|
597
|
-
data: Je(n),
|
|
598
|
-
type: "bytes"
|
|
599
|
-
})).signature;
|
|
600
|
-
}
|
|
601
|
-
let y;
|
|
602
|
-
try {
|
|
603
|
-
y = await this.providerApi.submitCaptchaSolution(a, n, this.contract.pair.address, r, w);
|
|
604
|
-
} catch (f) {
|
|
605
|
-
throw new Z("CAPTCHA.INVALID_CAPTCHA_CHALLENGE", { context: { error: f } });
|
|
606
|
-
}
|
|
607
|
-
return [y, l, p];
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
async function Dt(t) {
|
|
611
|
-
const e = t.captcha, n = t.proof;
|
|
612
|
-
if (!(await Promise.all(e.items.map(async (a) => (await kt(a)).hash === a.hash))).every((a) => a === !0))
|
|
613
|
-
return !1;
|
|
614
|
-
const o = Te(e, !1, !1, !1);
|
|
615
|
-
return o !== e.captchaContentId ? !1 : m(n, 0).indexOf(o) !== -1;
|
|
616
|
-
}
|
|
617
|
-
const Rt = qt, Ie = "@prosopo/current_account", Ne = "@prosopo/provider";
|
|
618
|
-
function Wt(t) {
|
|
619
|
-
localStorage.setItem(Ie, t);
|
|
620
|
-
}
|
|
621
|
-
function Vt() {
|
|
622
|
-
return localStorage.getItem(Ie);
|
|
623
|
-
}
|
|
624
|
-
function jt(t) {
|
|
625
|
-
localStorage.setItem(Ne, t);
|
|
626
|
-
}
|
|
627
|
-
function Zt() {
|
|
628
|
-
return localStorage.getItem(Ne);
|
|
629
|
-
}
|
|
630
|
-
const Q = {
|
|
631
|
-
setAccount: Wt,
|
|
632
|
-
getAccount: Vt,
|
|
633
|
-
setProviderUrl: jt,
|
|
634
|
-
getProviderUrl: Zt
|
|
635
|
-
}, Ut = () => ({
|
|
636
|
-
showModal: !1,
|
|
637
|
-
loading: !1,
|
|
638
|
-
index: 0,
|
|
639
|
-
challenge: void 0,
|
|
640
|
-
solutions: void 0,
|
|
641
|
-
isHuman: !1,
|
|
642
|
-
captchaApi: void 0,
|
|
643
|
-
account: void 0
|
|
644
|
-
}), Ft = (t, e) => (o) => {
|
|
645
|
-
Object.assign(t, o), e(o);
|
|
646
|
-
}, me = (t) => {
|
|
647
|
-
const e = t.networks[t.defaultNetwork];
|
|
648
|
-
if (!e)
|
|
649
|
-
throw new E("DEVELOPER.NETWORK_NOT_FOUND", {
|
|
650
|
-
context: { error: `No network found for environment ${t.defaultEnvironment}` }
|
|
651
|
-
});
|
|
652
|
-
return e;
|
|
653
|
-
};
|
|
654
|
-
function Bt(t, e, n, o) {
|
|
655
|
-
const a = (d) => {
|
|
656
|
-
alert(d.message);
|
|
657
|
-
}, r = Object.assign({
|
|
658
|
-
onAccountNotFound: a,
|
|
659
|
-
onError: a,
|
|
660
|
-
onHuman: (d) => {
|
|
661
|
-
i({ sendData: !e.sendData });
|
|
662
|
-
},
|
|
663
|
-
onExtensionNotFound: () => {
|
|
664
|
-
alert("No extension found");
|
|
665
|
-
},
|
|
666
|
-
onFailed: () => {
|
|
667
|
-
alert("Captcha challenge failed. Please try again"), i({ sendData: !e.sendData });
|
|
668
|
-
},
|
|
669
|
-
onExpired: () => {
|
|
670
|
-
alert("Completed challenge has expired, please try again");
|
|
671
|
-
},
|
|
672
|
-
onChallengeExpired: () => {
|
|
673
|
-
alert("Uncompleted challenge has expired, please try again");
|
|
674
|
-
},
|
|
675
|
-
onOpen: () => {
|
|
676
|
-
i({ sendData: !e.sendData });
|
|
677
|
-
},
|
|
678
|
-
onClose: () => {
|
|
679
|
-
}
|
|
680
|
-
}, o), s = (d) => {
|
|
681
|
-
const c = d instanceof Error ? d : new Error(String(d));
|
|
682
|
-
c instanceof se ? r.onAccountNotFound(c.message) : r.onError(c);
|
|
683
|
-
}, i = Ft(e, n), l = () => {
|
|
684
|
-
const d = {
|
|
685
|
-
userAccountAddress: "",
|
|
686
|
-
...t
|
|
687
|
-
};
|
|
688
|
-
return e.account && (d.userAccountAddress = e.account.account.address), Me.parse(d);
|
|
689
|
-
}, p = async (d) => {
|
|
690
|
-
try {
|
|
691
|
-
await d();
|
|
692
|
-
} catch (c) {
|
|
693
|
-
console.error(c), s(c), i({ isHuman: !1, showModal: !1, loading: !1 });
|
|
694
|
-
}
|
|
695
|
-
}, w = async () => {
|
|
696
|
-
r.onOpen(), await p(async () => {
|
|
697
|
-
if (e.loading || e.isHuman)
|
|
698
|
-
return;
|
|
699
|
-
O(), i({ loading: !0 });
|
|
700
|
-
const d = l();
|
|
701
|
-
i({ dappAccount: d.account.address }), await Pt(100);
|
|
702
|
-
const c = await N(), g = await b();
|
|
703
|
-
let C = !1;
|
|
704
|
-
try {
|
|
705
|
-
C = (await g.query.dappOperatorIsHumanUser(c.account.address, d.solutionThreshold)).value.unwrap().unwrap();
|
|
706
|
-
} catch (M) {
|
|
707
|
-
}
|
|
708
|
-
if (C) {
|
|
709
|
-
i({ isHuman: !0, loading: !1 }), r.onHuman({
|
|
710
|
-
user: c.account.address,
|
|
711
|
-
dapp: v()
|
|
712
|
-
}), I();
|
|
713
|
-
return;
|
|
714
|
-
}
|
|
715
|
-
const H = Q.getProviderUrl();
|
|
716
|
-
let R;
|
|
717
|
-
if (H) {
|
|
718
|
-
R = await k(H);
|
|
719
|
-
try {
|
|
720
|
-
const M = await R.verifyDappUser(v(), c.account.address, void 0, t.challengeValidLength);
|
|
721
|
-
if (M.solutionApproved) {
|
|
722
|
-
i({ isHuman: !0, loading: !1 }), r.onHuman({
|
|
723
|
-
providerUrl: H,
|
|
724
|
-
user: c.account.address,
|
|
725
|
-
dapp: v(),
|
|
726
|
-
commitmentId: M.commitmentId
|
|
727
|
-
}), I();
|
|
728
|
-
return;
|
|
729
|
-
}
|
|
730
|
-
} catch {
|
|
731
|
-
console.error("Error contacting provider from storage", H);
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
const G = {
|
|
735
|
-
address: c.account.address,
|
|
736
|
-
data: ve("message"),
|
|
737
|
-
type: "bytes"
|
|
738
|
-
}, z = await c.extension.signer.signRaw(G), _ = await et(g.query.getRandomActiveProvider, g.query)(c.account.address, v()), K = parseInt(_.blockNumber.toString()), W = le(_.provider.url.toString());
|
|
739
|
-
R = await k(W);
|
|
740
|
-
const $ = await U(g, _, R), V = await $.getCaptchaChallenge();
|
|
741
|
-
if (V.captchas.length <= 0)
|
|
742
|
-
throw new oe("DEVELOPER.PROVIDER_NO_CAPTCHA");
|
|
743
|
-
const ie = V.captchas.map((M) => M.captcha.timeLimitMs || 30 * 1e3).reduce((M, Se) => M + Se), He = setTimeout(() => {
|
|
744
|
-
"" + ie, r.onChallengeExpired(), i({ isHuman: !1, showModal: !1, loading: !1 });
|
|
745
|
-
}, ie);
|
|
746
|
-
i({
|
|
747
|
-
index: 0,
|
|
748
|
-
solutions: V.captchas.map(() => []),
|
|
749
|
-
challenge: V,
|
|
750
|
-
showModal: !0,
|
|
751
|
-
timeout: He,
|
|
752
|
-
blockNumber: K
|
|
753
|
-
});
|
|
754
|
-
});
|
|
755
|
-
}, y = async () => {
|
|
756
|
-
await p(async () => {
|
|
757
|
-
if (L(), !e.challenge)
|
|
758
|
-
throw new j("CAPTCHA.NO_CAPTCHA", {
|
|
759
|
-
context: { error: "Cannot submit, no Captcha found in state" }
|
|
760
|
-
});
|
|
761
|
-
i({ showModal: !1 });
|
|
762
|
-
const d = e.challenge, c = tt(), g = e.challenge.captchas.map((W, $) => {
|
|
763
|
-
const V = m(e.solutions, $);
|
|
764
|
-
return {
|
|
765
|
-
captchaId: W.captcha.captchaId,
|
|
766
|
-
captchaContentId: W.captcha.captchaContentId,
|
|
767
|
-
salt: c,
|
|
768
|
-
solution: V
|
|
769
|
-
};
|
|
770
|
-
}), C = P(), H = x(), R = C.extension.signer, G = m(d.captchas, 0);
|
|
771
|
-
if (!G.captcha.datasetId)
|
|
772
|
-
throw new Z("CAPTCHA.INVALID_CAPTCHA_ID", {
|
|
773
|
-
context: { error: "No datasetId set for challenge" }
|
|
774
|
-
});
|
|
775
|
-
const z = q(), _ = await z.submitCaptchaSolution(R, d.requestHash, G.captcha.datasetId, g, c), K = _[0].solutionApproved;
|
|
776
|
-
if (K || r.onFailed(), i({
|
|
777
|
-
submission: _,
|
|
778
|
-
isHuman: K,
|
|
779
|
-
loading: !1
|
|
780
|
-
}), e.isHuman) {
|
|
781
|
-
const W = le(z.provider.provider.url.toString());
|
|
782
|
-
Q.setProviderUrl(W), r.onHuman({
|
|
783
|
-
providerUrl: W,
|
|
784
|
-
user: C.account.address,
|
|
785
|
-
dapp: v(),
|
|
786
|
-
commitmentId: _[1],
|
|
787
|
-
blockNumber: H
|
|
788
|
-
}), I();
|
|
789
|
-
}
|
|
790
|
-
});
|
|
791
|
-
}, f = async () => {
|
|
792
|
-
L(), O(), r.onClose();
|
|
793
|
-
}, T = (d) => {
|
|
794
|
-
if (!e.challenge)
|
|
795
|
-
throw new j("CAPTCHA.NO_CAPTCHA", {
|
|
796
|
-
context: { error: "Cannot select, no Captcha found in state" }
|
|
797
|
-
});
|
|
798
|
-
if (e.index >= e.challenge.captchas.length || e.index < 0)
|
|
799
|
-
throw new j("CAPTCHA.NO_CAPTCHA", {
|
|
800
|
-
context: { error: "Cannot select, index is out of range for this Captcha" }
|
|
801
|
-
});
|
|
802
|
-
const c = e.index, g = e.solutions, C = m(g, c);
|
|
803
|
-
C.includes(d) ? C.splice(C.indexOf(d), 1) : C.push(d), i({ solutions: g });
|
|
804
|
-
}, S = () => {
|
|
805
|
-
if (!e.challenge)
|
|
806
|
-
throw new j("CAPTCHA.NO_CAPTCHA", {
|
|
807
|
-
context: { error: "Cannot select, no Captcha found in state" }
|
|
808
|
-
});
|
|
809
|
-
if (e.index + 1 >= e.challenge.captchas.length)
|
|
810
|
-
throw new j("CAPTCHA.NO_CAPTCHA", {
|
|
811
|
-
context: { error: "Cannot select, index is out of range for this Captcha" }
|
|
812
|
-
});
|
|
813
|
-
i({ index: e.index + 1 });
|
|
814
|
-
}, U = async (d, c, g) => {
|
|
815
|
-
const C = l(), H = new Rt(P().account.address, d, c, g, C.web2, v());
|
|
816
|
-
return i({ captchaApi: H }), q();
|
|
817
|
-
}, k = async (d) => {
|
|
818
|
-
const c = l(), g = me(c);
|
|
819
|
-
if (!c.account.address)
|
|
820
|
-
throw new E("GENERAL.SITE_KEY_MISSING");
|
|
821
|
-
return new nt(g, d, c.account.address);
|
|
822
|
-
}, L = () => {
|
|
823
|
-
window.clearTimeout(e.timeout), i({ timeout: void 0 });
|
|
824
|
-
}, I = () => {
|
|
825
|
-
const d = t.challengeValidLength || 120 * 1e3, c = setTimeout(() => {
|
|
826
|
-
"" + d, i({ isHuman: !1 }), r.onExpired();
|
|
827
|
-
}, d);
|
|
828
|
-
i({ successfullChallengeTimeout: c });
|
|
829
|
-
}, O = () => {
|
|
830
|
-
L(), i(Ut());
|
|
831
|
-
}, q = () => {
|
|
832
|
-
if (!e.captchaApi)
|
|
833
|
-
throw new oe("API.UNKNOWN", { context: { error: "Captcha api not set", state: e } });
|
|
834
|
-
return e.captchaApi;
|
|
835
|
-
}, N = async () => {
|
|
836
|
-
const d = l();
|
|
837
|
-
if (!d.web2 && !d.userAccountAddress)
|
|
838
|
-
throw new E("GENERAL.ACCOUNT_NOT_FOUND", {
|
|
839
|
-
context: { error: "Account address has not been set for web3 mode" }
|
|
840
|
-
});
|
|
841
|
-
const g = await (d.web2 ? new Nt() : new It()).getAccount(d);
|
|
842
|
-
return Q.setAccount(g.account.address), i({ account: g }), P();
|
|
843
|
-
}, P = () => {
|
|
844
|
-
if (!e.account)
|
|
845
|
-
throw new E("GENERAL.ACCOUNT_NOT_FOUND", { context: { error: "Account not loaded" } });
|
|
846
|
-
return e.account;
|
|
847
|
-
}, v = () => {
|
|
848
|
-
if (!e.dappAccount)
|
|
849
|
-
throw new E("GENERAL.SITE_KEY_MISSING");
|
|
850
|
-
return e.dappAccount;
|
|
851
|
-
}, x = () => {
|
|
852
|
-
if (!e.blockNumber)
|
|
853
|
-
throw new ot("CAPTCHA.INVALID_BLOCK_NO", { context: { error: "Block number not found" } });
|
|
854
|
-
return e.blockNumber;
|
|
855
|
-
}, b = async () => {
|
|
856
|
-
const d = l(), c = me(d), g = await xe.create({ provider: new Ce(c.endpoint), initWasm: !1 }), C = "sr25519", H = new be({ type: C, ss58Format: g.registry.chainSS58 });
|
|
857
|
-
return new at(g, JSON.parse(rt), c.contract.address, "prosopo", 0, H.addFromAddress(P().account.address));
|
|
858
|
-
};
|
|
859
|
-
return {
|
|
860
|
-
start: w,
|
|
861
|
-
cancel: f,
|
|
862
|
-
submit: y,
|
|
863
|
-
select: T,
|
|
864
|
-
nextRound: S,
|
|
865
|
-
exportData: async (d) => {
|
|
866
|
-
var C;
|
|
867
|
-
const c = Q.getProviderUrl() || ((C = e.captchaApi) == null ? void 0 : C.provider.provider.url.toString());
|
|
868
|
-
if (!c)
|
|
869
|
-
return;
|
|
870
|
-
await (await k(c)).submitUserEvents(d, P().account.address);
|
|
871
|
-
}
|
|
872
|
-
};
|
|
873
|
-
}
|
|
874
|
-
const Gt = 1e3, ce = (t, e) => {
|
|
875
|
-
e((n) => {
|
|
876
|
-
let o = [...n, t];
|
|
877
|
-
return o.length > Gt && (o = o.slice(1)), o;
|
|
878
|
-
});
|
|
879
|
-
}, zt = (t, e) => {
|
|
880
|
-
const n = {
|
|
881
|
-
x: t.x,
|
|
882
|
-
y: t.y,
|
|
883
|
-
timestamp: t.timeStamp
|
|
884
|
-
};
|
|
885
|
-
ce(n, e);
|
|
886
|
-
}, we = (t, e) => {
|
|
887
|
-
const n = {
|
|
888
|
-
key: t.key,
|
|
889
|
-
timestamp: t.timeStamp,
|
|
890
|
-
isShiftKey: t.shiftKey,
|
|
891
|
-
isCtrlKey: t.ctrlKey
|
|
892
|
-
};
|
|
893
|
-
ce(n, e);
|
|
894
|
-
}, Y = (t, e) => {
|
|
895
|
-
for (let n = 0; n < t.touches.length; n++) {
|
|
896
|
-
const o = t.touches[n];
|
|
897
|
-
o && ce({ x: o.clientX, y: o.clientY, timestamp: t.timeStamp }, e);
|
|
898
|
-
}
|
|
899
|
-
}, Kt = (t, e, n, o) => {
|
|
900
|
-
const a = Pe(o);
|
|
901
|
-
a && (a.addEventListener("mousemove", (r) => zt(r, t)), a.addEventListener("keydown", (r) => we(r, n)), a.addEventListener("keyup", (r) => we(r, n)), a.addEventListener("touchstart", (r) => Y(r, e)), a.addEventListener("touchend", (r) => Y(r, e)), a.addEventListener("touchcancel", (r) => Y(r, e)), a.addEventListener("touchmove", (r) => Y(r, e)));
|
|
902
|
-
}, Pe = (t) => t.tagName === "FORM" ? t : t.parentElement ? Pe(t.parentElement) : null, $t = ({ onProcessData: t, sendData: e }) => {
|
|
903
|
-
const [n, o] = h.useState([]), [a, r] = h.useState([]), [s, i] = h.useState([]), l = h.useRef(null);
|
|
904
|
-
return h.useEffect(() => {
|
|
905
|
-
l && l.current && Kt(o, r, i, l.current);
|
|
906
|
-
}, []), h.useEffect(() => {
|
|
907
|
-
t({
|
|
908
|
-
mouseEvents: n,
|
|
909
|
-
touchEvents: a,
|
|
910
|
-
keyboardEvents: s
|
|
911
|
-
});
|
|
912
|
-
}, [e]), u("div", { ref: l });
|
|
913
|
-
}, Qt = $t, Yt = ke.memo((t, e) => {
|
|
914
|
-
const { show: n, children: o } = t, r = {
|
|
915
|
-
position: "fixed",
|
|
916
|
-
zIndex: 2147483646,
|
|
917
|
-
inset: 0,
|
|
918
|
-
display: n ? "block" : "none"
|
|
919
|
-
}, s = {
|
|
920
|
-
position: "fixed",
|
|
921
|
-
display: "flex",
|
|
922
|
-
alignItems: "center",
|
|
923
|
-
justifyContent: "center",
|
|
924
|
-
right: 0,
|
|
925
|
-
bottom: 0,
|
|
926
|
-
top: 0,
|
|
927
|
-
left: 0,
|
|
928
|
-
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
929
|
-
zIndex: -1
|
|
930
|
-
}, i = {
|
|
931
|
-
position: "absolute",
|
|
932
|
-
top: "50%",
|
|
933
|
-
left: "50%",
|
|
934
|
-
transform: "translate(-50%, -50%)",
|
|
935
|
-
width: "400px",
|
|
936
|
-
backgroundColor: "rgb(255, 255, 255)",
|
|
937
|
-
border: "none",
|
|
938
|
-
boxShadow: "rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px,"
|
|
939
|
-
};
|
|
940
|
-
return A("div", { className: "modalOuter", style: r, children: [u("div", { className: "modalBackground", style: s }), u("div", { className: "modalInner", style: i, children: o })] });
|
|
941
|
-
}), Xt = Yt, ye = Le`
|
|
942
|
-
align-items: center;
|
|
943
|
-
justify-content: flex-end;
|
|
944
|
-
display: flex;
|
|
945
|
-
padding: 8px;
|
|
946
|
-
|
|
947
|
-
@media (max-width: 245px) {
|
|
948
|
-
&:nth-of-type(1),
|
|
949
|
-
&:nth-of-type(2) {
|
|
950
|
-
display: none;
|
|
951
|
-
} /* Both logos hidden */
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
@media (min-width: 245px) and (max-width: 400px) {
|
|
955
|
-
&:nth-of-type(1) {
|
|
956
|
-
display: flex;
|
|
957
|
-
} /* logoWithText */
|
|
958
|
-
&:nth-of-type(2) {
|
|
959
|
-
display: none;
|
|
960
|
-
} /* logoWithoutText */
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
@media (min-width: 401px) {
|
|
964
|
-
&:nth-of-type(1) {
|
|
965
|
-
display: none;
|
|
966
|
-
} /* logoWithText */
|
|
967
|
-
&:nth-of-type(2) {
|
|
968
|
-
display: flex;
|
|
969
|
-
} /* logoWithoutText */
|
|
970
|
-
}
|
|
971
|
-
`, F = (t) => {
|
|
972
|
-
const e = h.useRef(t), n = (a) => {
|
|
973
|
-
e.current = a;
|
|
974
|
-
};
|
|
975
|
-
return [e.current, n];
|
|
976
|
-
}, Jt = () => {
|
|
977
|
-
const [t, e] = h.useState(!1), [n, o] = h.useState(0), [a, r] = h.useState([]), [s, i] = F(void 0), [l, p] = h.useState(!1), [w, y] = h.useState(void 0), [f, T] = h.useState(!1), [S, U] = h.useState(void 0), [k, L] = h.useState(void 0), [I, O] = F(void 0), [q, N] = F(void 0), [P, v] = F(void 0), [x, b] = F(void 0), [D, d] = h.useState(!1);
|
|
978
|
-
return [
|
|
979
|
-
{
|
|
980
|
-
isHuman: t,
|
|
981
|
-
index: n,
|
|
982
|
-
solutions: a,
|
|
983
|
-
captchaApi: s,
|
|
984
|
-
showModal: l,
|
|
985
|
-
challenge: w,
|
|
986
|
-
loading: f,
|
|
987
|
-
account: S,
|
|
988
|
-
dappAccount: k,
|
|
989
|
-
submission: I,
|
|
990
|
-
timeout: q,
|
|
991
|
-
blockNumber: P,
|
|
992
|
-
successfullChallengeTimeout: x,
|
|
993
|
-
sendData: D
|
|
994
|
-
},
|
|
995
|
-
(c) => {
|
|
996
|
-
c.account !== void 0 && U(c.account), c.isHuman !== void 0 && e(c.isHuman), c.index !== void 0 && o(c.index), c.solutions !== void 0 && r(c.solutions.slice()), c.captchaApi !== void 0 && i(c.captchaApi), c.showModal !== void 0 && p(c.showModal), c.challenge !== void 0 && y(c.challenge), c.loading !== void 0 && T(c.loading), c.showModal !== void 0 && p(c.showModal), c.dappAccount !== void 0 && L(c.dappAccount), c.submission !== void 0 && O(c.submission), c.timeout !== void 0 && N(c.timeout), c.successfullChallengeTimeout !== void 0 && b(c.timeout), c.blockNumber !== void 0 && v(c.blockNumber), c.sendData !== void 0 && d(c.sendData);
|
|
997
|
-
}
|
|
998
|
-
];
|
|
999
|
-
}, sn = (t) => {
|
|
1000
|
-
t.config;
|
|
1001
|
-
const e = t.config, n = t.callbacks || {}, [o, a] = Jt(), r = Bt(e, o, a, n), s = { maxWidth: "400px", minWidth: "200px", margin: "8px" }, i = t.config.theme === "light" ? "light" : "dark", l = h.useMemo(() => t.config.theme === "light" ? J : ee, [t.config.theme]);
|
|
1002
|
-
return o.showModal, A("div", { children: [A("div", { style: { maxWidth: "100%", maxHeight: "100%", overflowX: "auto" }, children: [u(Xt, { show: o.showModal, children: o.challenge ? u(xt, { challenge: o.challenge, index: o.index, solutions: o.solutions, onSubmit: r.submit, onCancel: r.cancel, onClick: r.select, onNext: r.nextRound, themeColor: e.theme ?? "light" }) : u("div", { children: "No challenge set." }) }), A("div", { style: s, "data-cy": "button-human", children: [" ", A("div", { style: {
|
|
1003
|
-
padding: "8px",
|
|
1004
|
-
border: "1px solid",
|
|
1005
|
-
backgroundColor: l.palette.background.default,
|
|
1006
|
-
borderColor: l.palette.grey[300],
|
|
1007
|
-
borderRadius: "8px",
|
|
1008
|
-
display: "flex",
|
|
1009
|
-
justifyContent: "space-between",
|
|
1010
|
-
alignItems: "center",
|
|
1011
|
-
flexWrap: "wrap"
|
|
1012
|
-
}, children: [u("div", { style: { display: "flex", flexDirection: "column" }, children: A("div", { style: {
|
|
1013
|
-
display: "flex",
|
|
1014
|
-
justifyContent: "flex-start",
|
|
1015
|
-
alignItems: "center",
|
|
1016
|
-
flexWrap: "wrap"
|
|
1017
|
-
}, children: [A("div", { style: {
|
|
1018
|
-
height: "50px",
|
|
1019
|
-
width: "50px",
|
|
1020
|
-
display: "flex",
|
|
1021
|
-
alignItems: "center",
|
|
1022
|
-
justifyContent: "center",
|
|
1023
|
-
flexDirection: "column",
|
|
1024
|
-
verticalAlign: "middle"
|
|
1025
|
-
}, children: [u("div", { style: {
|
|
1026
|
-
display: o.loading ? "none" : "flex"
|
|
1027
|
-
}, children: u(st, { themeColor: i, onChange: r.start, checked: o.isHuman }) }), u("div", { style: {
|
|
1028
|
-
display: o.loading ? "flex" : "none"
|
|
1029
|
-
}, children: u("div", { style: { flex: 1 }, children: u(Oe, { themeColor: i }) }) })] }), u("div", { style: { padding: 1 }, children: u("span", { style: { color: l.palette.background.contrastText, paddingLeft: "4px" }, children: "I am a human" }) })] }) }), u("div", { children: u("a", { href: "https://www.prosopo.io/#features?ref=accounts.prosopo.io&utm_campaign=widget&utm_medium=checkbox", target: "_blank", "aria-label": "Visit prosopo.io to learn more about the service and its accessibility options.", children: u("div", { children: A("div", { children: [u("div", { css: ye, dangerouslySetInnerHTML: {
|
|
1030
|
-
__html: t.config.theme === "light" ? on : nn
|
|
1031
|
-
} }), u("div", { css: ye, dangerouslySetInnerHTML: {
|
|
1032
|
-
__html: t.config.theme === "light" ? en : tn
|
|
1033
|
-
} })] }) }) }) })] })] })] }), e.devOnlyWatchEvents && u(Qt, { onProcessData: r.exportData, sendData: o.showModal })] });
|
|
1034
|
-
}, en = '<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2062.63 468.67" height="35px" width="140px"><defs><style>.cls-1{fill:#1d1d1b;}</style></defs><title>Prosopo Logo Black</title><path class="cls-1" d="M335.55,1825.19A147.75,147.75,0,0,1,483.3,1972.94h50.5c0-109.49-88.76-198.25-198.25-198.25v50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M269.36,1891.39A147.74,147.74,0,0,1,417.1,2039.13h50.5c0-109.49-88.75-198.24-198.24-198.24v50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M414,2157.17a147.75,147.75,0,0,1-147.74-147.74h-50.5c0,109.49,88.75,198.24,198.24,198.24v-50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M480.17,2091a147.74,147.74,0,0,1-147.74-147.75H281.92c0,109.49,88.76,198.25,198.25,198.25V2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M862.8,2017.5q-27.39,22.86-78.25,22.86h-65v112.19H654.82v-312h134q46.32,0,73.86,24.13t27.55,74.72Q890.2,1994.64,862.8,2017.5ZM813,1905.1q-12.37-10.36-34.7-10.38H719.59v91.87h58.75q22.32,0,34.7-11.22t12.39-35.56Q825.43,1915.48,813,1905.1Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1045.69,1916.42c.78.08,2.51.19,5.19.32v61.81c-3.81-.42-7.2-.71-10.16-.85s-5.36-.21-7.2-.21q-36.4,0-48.89,23.71-7,13.33-7,41.06v110.29H916.89V1921.82h57.58V1962q14-23.07,24.34-31.54,16.94-14.18,44-14.18C1044,1916.32,1044.92,1916.35,1045.69,1916.42Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1265.64,2124.32q-29.21,36.06-88.69,36.06t-88.69-36.06Q1059,2088.26,1059,2037.5q0-49.9,29.22-86.5t88.69-36.59q59.47,0,88.69,36.59t29.21,86.5Q1294.85,2088.26,1265.64,2124.32ZM1217.38,2091q14.17-18.81,14.18-53.48t-14.18-53.37q-14.19-18.7-40.64-18.71T1136,1984.13q-14.29,18.72-14.29,53.37T1136,2091q14.28,18.81,40.75,18.81T1217.38,2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1371.81,2078.88q1.92,16.1,8.29,22.87,11.28,12.06,41.7,12.06,17.85,0,28.39-5.29t10.53-15.88a17.12,17.12,0,0,0-8.48-15.45q-8.49-5.28-63.12-18.2-39.33-9.73-55.41-24.35-16.08-14.39-16.09-41.49,0-32,25.14-54.93t70.75-23q43.26,0,70.53,17.25t31.29,59.59H1455q-1.27-11.64-6.58-18.42-10-12.27-34-12.28-19.74,0-28.13,6.14t-8.38,14.4c0,6.91,3,11.93,8.92,15q8.89,4.89,63,16.73,36,8.46,54.05,25.61,17.77,17.35,17.78,43.39,0,34.3-25.56,56t-79,21.7q-54.51,0-80.49-23t-26-58.53Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1745.54,2124.32q-29.22,36.06-88.7,36.06t-88.69-36.06q-29.2-36.06-29.21-86.82,0-49.9,29.21-86.5t88.69-36.59q59.49,0,88.7,36.59t29.21,86.5Q1774.75,2088.26,1745.54,2124.32ZM1697.27,2091q14.19-18.81,14.19-53.48t-14.19-53.37q-14.18-18.7-40.64-18.71t-40.75,18.71q-14.28,18.72-14.28,53.37t14.28,53.48q14.3,18.81,40.75,18.81T1697.27,2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1992.75,1946.59q28.24,29.84,28.23,87.63,0,61-27.58,92.93t-71.06,32q-27.69,0-46-13.76-10-7.62-19.6-22.23v120.24H1797V1921.82h57.79v34.08q9.79-15,20.88-23.71,20.23-15.43,48.15-15.45Q1964.53,1916.74,1992.75,1946.59Zm-46.3,43.39q-12.3-20.52-39.88-20.53-33.15,0-45.54,31.11-6.43,16.51-6.42,41.92,0,40.21,21.58,56.51,12.82,9.53,30.37,9.53,25.45,0,38.83-19.48t13.36-51.86Q1958.75,2010.51,1946.45,1990Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M2249.14,2124.32q-29.2,36.06-88.69,36.06t-88.69-36.06q-29.22-36.06-29.21-86.82,0-49.9,29.21-86.5t88.69-36.59q59.49,0,88.69,36.59t29.22,86.5Q2278.36,2088.26,2249.14,2124.32ZM2200.88,2091q14.19-18.81,14.18-53.48t-14.18-53.37q-14.18-18.7-40.64-18.71t-40.75,18.71q-14.28,18.72-14.29,53.37t14.29,53.48q14.3,18.81,40.75,18.81T2200.88,2091Z" transform="translate(-215.73 -1774.69)"/></svg>', tn = '<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2062.63 468.67" height="35px" width="140px"><defs><style>.cls-1{fill:#fff;}</style></defs><title>Prosopo Logo Black</title><path class="cls-1" d="M335.55,1825.19A147.75,147.75,0,0,1,483.3,1972.94h50.5c0-109.49-88.76-198.25-198.25-198.25v50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M269.36,1891.39A147.74,147.74,0,0,1,417.1,2039.13h50.5c0-109.49-88.75-198.24-198.24-198.24v50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M414,2157.17a147.75,147.75,0,0,1-147.74-147.74h-50.5c0,109.49,88.75,198.24,198.24,198.24v-50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M480.17,2091a147.74,147.74,0,0,1-147.74-147.75H281.92c0,109.49,88.76,198.25,198.25,198.25V2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M862.8,2017.5q-27.39,22.86-78.25,22.86h-65v112.19H654.82v-312h134q46.32,0,73.86,24.13t27.55,74.72Q890.2,1994.64,862.8,2017.5ZM813,1905.1q-12.37-10.36-34.7-10.38H719.59v91.87h58.75q22.32,0,34.7-11.22t12.39-35.56Q825.43,1915.48,813,1905.1Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1045.69,1916.42c.78.08,2.51.19,5.19.32v61.81c-3.81-.42-7.2-.71-10.16-.85s-5.36-.21-7.2-.21q-36.4,0-48.89,23.71-7,13.33-7,41.06v110.29H916.89V1921.82h57.58V1962q14-23.07,24.34-31.54,16.94-14.18,44-14.18C1044,1916.32,1044.92,1916.35,1045.69,1916.42Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1265.64,2124.32q-29.21,36.06-88.69,36.06t-88.69-36.06Q1059,2088.26,1059,2037.5q0-49.9,29.22-86.5t88.69-36.59q59.47,0,88.69,36.59t29.21,86.5Q1294.85,2088.26,1265.64,2124.32ZM1217.38,2091q14.17-18.81,14.18-53.48t-14.18-53.37q-14.19-18.7-40.64-18.71T1136,1984.13q-14.29,18.72-14.29,53.37T1136,2091q14.28,18.81,40.75,18.81T1217.38,2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1371.81,2078.88q1.92,16.1,8.29,22.87,11.28,12.06,41.7,12.06,17.85,0,28.39-5.29t10.53-15.88a17.12,17.12,0,0,0-8.48-15.45q-8.49-5.28-63.12-18.2-39.33-9.73-55.41-24.35-16.08-14.39-16.09-41.49,0-32,25.14-54.93t70.75-23q43.26,0,70.53,17.25t31.29,59.59H1455q-1.27-11.64-6.58-18.42-10-12.27-34-12.28-19.74,0-28.13,6.14t-8.38,14.4c0,6.91,3,11.93,8.92,15q8.89,4.89,63,16.73,36,8.46,54.05,25.61,17.77,17.35,17.78,43.39,0,34.3-25.56,56t-79,21.7q-54.51,0-80.49-23t-26-58.53Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1745.54,2124.32q-29.22,36.06-88.7,36.06t-88.69-36.06q-29.2-36.06-29.21-86.82,0-49.9,29.21-86.5t88.69-36.59q59.49,0,88.7,36.59t29.21,86.5Q1774.75,2088.26,1745.54,2124.32ZM1697.27,2091q14.19-18.81,14.19-53.48t-14.19-53.37q-14.18-18.7-40.64-18.71t-40.75,18.71q-14.28,18.72-14.28,53.37t14.28,53.48q14.3,18.81,40.75,18.81T1697.27,2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1992.75,1946.59q28.24,29.84,28.23,87.63,0,61-27.58,92.93t-71.06,32q-27.69,0-46-13.76-10-7.62-19.6-22.23v120.24H1797V1921.82h57.79v34.08q9.79-15,20.88-23.71,20.23-15.43,48.15-15.45Q1964.53,1916.74,1992.75,1946.59Zm-46.3,43.39q-12.3-20.52-39.88-20.53-33.15,0-45.54,31.11-6.43,16.51-6.42,41.92,0,40.21,21.58,56.51,12.82,9.53,30.37,9.53,25.45,0,38.83-19.48t13.36-51.86Q1958.75,2010.51,1946.45,1990Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M2249.14,2124.32q-29.2,36.06-88.69,36.06t-88.69-36.06q-29.22-36.06-29.21-86.82,0-49.9,29.21-86.5t88.69-36.59q59.49,0,88.69,36.59t29.22,86.5Q2278.36,2088.26,2249.14,2124.32ZM2200.88,2091q14.19-18.81,14.18-53.48t-14.18-53.37q-14.18-18.7-40.64-18.71t-40.75,18.71q-14.28,18.72-14.29,53.37t14.29,53.48q14.3,18.81,40.75,18.81T2200.88,2091Z" transform="translate(-215.73 -1774.69)"/></svg>', nn = '<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 260 348" height="35px"><path id="Vector" d="M95.7053 40.2707C127.005 40.2707 157.022 52.6841 179.154 74.78C201.286 96.8759 213.719 126.844 213.719 158.093H254.056C254.056 70.7808 183.16 -4.57764e-05 95.7053 -4.57764e-05V40.2707Z" fill="#fff"/><path id="Vector_2" d="M42.8365 93.0614C58.3333 93.0614 73.6784 96.1087 87.9955 102.029C102.313 107.95 115.322 116.628 126.279 127.568C137.237 138.508 145.93 151.496 151.86 165.79C157.79 180.084 160.843 195.404 160.843 210.875H201.179C201.179 123.564 130.291 52.7906 42.8365 52.7906V93.0614Z" fill="#fff"/><path id="Vector_3" d="M158.367 305.005C127.07 305.003 97.056 292.59 74.926 270.496C52.796 248.402 40.3626 218.437 40.3604 187.191H0.0239563C0.0239563 274.503 70.9123 345.276 158.367 345.276V305.005Z" fill="#fff"/><path id="Vector_4" d="M211.219 252.239C195.722 252.239 180.376 249.191 166.059 243.27C151.741 237.349 138.732 228.67 127.774 217.729C116.816 206.788 108.123 193.799 102.194 179.505C96.2637 165.21 93.2121 149.889 93.2132 134.417H52.8687C52.8687 221.729 123.765 292.509 211.219 292.509V252.239Z" fill="#fff"/></g><defs><clipPath id="clip0_1_2"><rect width="254" height="345" fill="white"/></clipPath></defs></svg>', on = '<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 260 348" height="35px"><path id="Vector" d="M95.7053 40.2707C127.005 40.2707 157.022 52.6841 179.154 74.78C201.286 96.8759 213.719 126.844 213.719 158.093H254.056C254.056 70.7808 183.16 -4.57764e-05 95.7053 -4.57764e-05V40.2707Z" fill="#000000"/><path id="Vector_2" d="M42.8365 93.0614C58.3333 93.0614 73.6784 96.1087 87.9955 102.029C102.313 107.95 115.322 116.628 126.279 127.568C137.237 138.508 145.93 151.496 151.86 165.79C157.79 180.084 160.843 195.404 160.843 210.875H201.179C201.179 123.564 130.291 52.7906 42.8365 52.7906V93.0614Z" fill="#000000"/><path id="Vector_3" d="M158.367 305.005C127.07 305.003 97.056 292.59 74.926 270.496C52.796 248.402 40.3626 218.437 40.3604 187.191H0.0239563C0.0239563 274.503 70.9123 345.276 158.367 345.276V305.005Z" fill="#000000"/><path id="Vector_4" d="M211.219 252.239C195.722 252.239 180.376 249.191 166.059 243.27C151.741 237.349 138.732 228.67 127.774 217.729C116.816 206.788 108.123 193.799 102.194 179.505C96.2637 165.21 93.2121 149.889 93.2132 134.417H52.8687C52.8687 221.729 123.765 292.509 211.219 292.509V252.239Z" fill="#000000"/></g><defs><clipPath id="clip0_1_2"><rect width="254" height="345" fill="white"/></clipPath></defs></svg>';
|
|
1035
|
-
export {
|
|
1036
|
-
sn as default
|
|
1037
|
-
};
|