altcha 1.0.6 → 1.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/dist/altcha.js +309 -306
- package/dist/altcha.umd.cjs +2 -2
- package/dist_external/altcha.js +193 -190
- package/dist_external/altcha.umd.cjs +2 -2
- package/dist_external/worker.js +1 -1
- package/package.json +1 -1
package/dist/altcha.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
const ht = "
|
|
5
|
-
function
|
|
1
|
+
var jt = Object.defineProperty;
|
|
2
|
+
var Pt = (n, e, t) => e in n ? jt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var B = (n, e, t) => Pt(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
const ht = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IGQ9bmV3IFRleHRFbmNvZGVyO2Z1bmN0aW9uIHAoZSl7cmV0dXJuWy4uLm5ldyBVaW50OEFycmF5KGUpXS5tYXAodD0+dC50b1N0cmluZygxNikucGFkU3RhcnQoMiwiMCIpKS5qb2luKCIiKX1hc3luYyBmdW5jdGlvbiBiKGUsdCxyKXtpZih0eXBlb2YgY3J5cHRvPiJ1Inx8ISgic3VidGxlImluIGNyeXB0byl8fCEoImRpZ2VzdCJpbiBjcnlwdG8uc3VidGxlKSl0aHJvdyBuZXcgRXJyb3IoIldlYiBDcnlwdG8gaXMgbm90IGF2YWlsYWJsZS4gU2VjdXJlIGNvbnRleHQgaXMgcmVxdWlyZWQgKGh0dHBzOi8vZGV2ZWxvcGVyLm1vemlsbGEub3JnL2VuLVVTL2RvY3MvV2ViL1NlY3VyaXR5L1NlY3VyZV9Db250ZXh0cykuIik7cmV0dXJuIHAoYXdhaXQgY3J5cHRvLnN1YnRsZS5kaWdlc3Qoci50b1VwcGVyQ2FzZSgpLGQuZW5jb2RlKGUrdCkpKX1mdW5jdGlvbiB3KGUsdCxyPSJTSEEtMjU2IixuPTFlNixzPTApe2NvbnN0IG89bmV3IEFib3J0Q29udHJvbGxlcixhPURhdGUubm93KCk7cmV0dXJue3Byb21pc2U6KGFzeW5jKCk9Pntmb3IobGV0IGM9cztjPD1uO2MrPTEpe2lmKG8uc2lnbmFsLmFib3J0ZWQpcmV0dXJuIG51bGw7aWYoYXdhaXQgYih0LGMscik9PT1lKXJldHVybntudW1iZXI6Yyx0b29rOkRhdGUubm93KCktYX19cmV0dXJuIG51bGx9KSgpLGNvbnRyb2xsZXI6b319ZnVuY3Rpb24gaChlKXtjb25zdCB0PWF0b2IoZSkscj1uZXcgVWludDhBcnJheSh0Lmxlbmd0aCk7Zm9yKGxldCBuPTA7bjx0Lmxlbmd0aDtuKyspcltuXT10LmNoYXJDb2RlQXQobik7cmV0dXJuIHJ9ZnVuY3Rpb24gZyhlLHQ9MTIpe2NvbnN0IHI9bmV3IFVpbnQ4QXJyYXkodCk7Zm9yKGxldCBuPTA7bjx0O24rKylyW25dPWUlMjU2LGU9TWF0aC5mbG9vcihlLzI1Nik7cmV0dXJuIHJ9YXN5bmMgZnVuY3Rpb24gbShlLHQ9IiIscj0xZTYsbj0wKXtjb25zdCBzPSJBRVMtR0NNIixvPW5ldyBBYm9ydENvbnRyb2xsZXIsYT1EYXRlLm5vdygpLGw9YXN5bmMoKT0+e2ZvcihsZXQgdT1uO3U8PXI7dSs9MSl7aWYoby5zaWduYWwuYWJvcnRlZHx8IWN8fCF5KXJldHVybiBudWxsO3RyeXtjb25zdCBmPWF3YWl0IGNyeXB0by5zdWJ0bGUuZGVjcnlwdCh7bmFtZTpzLGl2OmcodSl9LGMseSk7aWYoZilyZXR1cm57Y2xlYXJUZXh0Om5ldyBUZXh0RGVjb2RlcigpLmRlY29kZShmKSx0b29rOkRhdGUubm93KCktYX19Y2F0Y2h7fX1yZXR1cm4gbnVsbH07bGV0IGM9bnVsbCx5PW51bGw7dHJ5e3k9aChlKTtjb25zdCB1PWF3YWl0IGNyeXB0by5zdWJ0bGUuZGlnZXN0KCJTSEEtMjU2IixkLmVuY29kZSh0KSk7Yz1hd2FpdCBjcnlwdG8uc3VidGxlLmltcG9ydEtleSgicmF3Iix1LHMsITEsWyJkZWNyeXB0Il0pfWNhdGNoe3JldHVybntwcm9taXNlOlByb21pc2UucmVqZWN0KCksY29udHJvbGxlcjpvfX1yZXR1cm57cHJvbWlzZTpsKCksY29udHJvbGxlcjpvfX1sZXQgaTtvbm1lc3NhZ2U9YXN5bmMgZT0+e2NvbnN0e3R5cGU6dCxwYXlsb2FkOnIsc3RhcnQ6bixtYXg6c309ZS5kYXRhO2xldCBvPW51bGw7aWYodD09PSJhYm9ydCIpaT09bnVsbHx8aS5hYm9ydCgpLGk9dm9pZCAwO2Vsc2UgaWYodD09PSJ3b3JrIil7aWYoIm9iZnVzY2F0ZWQiaW4gcil7Y29uc3R7a2V5OmEsb2JmdXNjYXRlZDpsfT1yfHx7fTtvPWF3YWl0IG0obCxhLHMsbil9ZWxzZXtjb25zdHthbGdvcml0aG06YSxjaGFsbGVuZ2U6bCxzYWx0OmN9PXJ8fHt9O289dyhsLGMsYSxzLG4pfWk9by5jb250cm9sbGVyLG8ucHJvbWlzZS50aGVuKGE9PntzZWxmLnBvc3RNZXNzYWdlKGEmJnsuLi5hLHdvcmtlcjohMH0pfSl9fX0pKCk7Cg==", Ft = (n) => Uint8Array.from(atob(n), (e) => e.charCodeAt(0)), nt = typeof self < "u" && self.Blob && new Blob([Ft(ht)], { type: "text/javascript;charset=utf-8" });
|
|
5
|
+
function Mt(n) {
|
|
6
6
|
let e;
|
|
7
7
|
try {
|
|
8
8
|
if (e = nt && (self.URL || self.webkitURL).createObjectURL(nt), !e) throw "";
|
|
@@ -23,9 +23,9 @@ function Pt(n) {
|
|
|
23
23
|
e && (self.URL || self.webkitURL).revokeObjectURL(e);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function Ce() {
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function Ut(n, e) {
|
|
29
29
|
for (const t in e) n[t] = e[t];
|
|
30
30
|
return (
|
|
31
31
|
/** @type {T & S} */
|
|
@@ -44,22 +44,22 @@ function we(n) {
|
|
|
44
44
|
function mt(n) {
|
|
45
45
|
return typeof n == "function";
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function Ht(n, e) {
|
|
48
48
|
return n != n ? e == e : n !== e || n && typeof n == "object" || typeof n == "function";
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function Bt(n) {
|
|
51
51
|
return Object.keys(n).length === 0;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function Dt(n, e, t, i) {
|
|
54
54
|
if (n) {
|
|
55
55
|
const o = bt(n, e, t, i);
|
|
56
56
|
return n[0](o);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
function bt(n, e, t, i) {
|
|
60
|
-
return n[1] && i ?
|
|
60
|
+
return n[1] && i ? Ut(t.ctx.slice(), n[1](i(e))) : t.ctx;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function Jt(n, e, t, i) {
|
|
63
63
|
if (n[2] && i) {
|
|
64
64
|
const o = n[2](i(t));
|
|
65
65
|
if (e.dirty === void 0)
|
|
@@ -80,7 +80,7 @@ function Ot(n, e, t, i, o, l) {
|
|
|
80
80
|
n.p(s, o);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function Kt(n) {
|
|
84
84
|
if (n.ctx.length > 32) {
|
|
85
85
|
const e = [], t = n.ctx.length / 32;
|
|
86
86
|
for (let i = 0; i < t; i++)
|
|
@@ -95,7 +95,7 @@ function L(n, e) {
|
|
|
95
95
|
function $t(n, e, t) {
|
|
96
96
|
const i = Qt(n);
|
|
97
97
|
if (!i.getElementById(e)) {
|
|
98
|
-
const o =
|
|
98
|
+
const o = A("style");
|
|
99
99
|
o.id = e, o.textContent = t, qt(i, o);
|
|
100
100
|
}
|
|
101
101
|
}
|
|
@@ -115,13 +115,13 @@ function qt(n, e) {
|
|
|
115
115
|
e
|
|
116
116
|
), e.sheet;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function T(n, e, t) {
|
|
119
119
|
n.insertBefore(e, t || null);
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function W(n) {
|
|
122
122
|
n.parentNode && n.parentNode.removeChild(n);
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function A(n) {
|
|
125
125
|
return document.createElement(n);
|
|
126
126
|
}
|
|
127
127
|
function Q(n) {
|
|
@@ -161,18 +161,18 @@ let pe;
|
|
|
161
161
|
function ve(n) {
|
|
162
162
|
pe = n;
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function Ge() {
|
|
165
165
|
if (!pe) throw new Error("Function called outside component initialization");
|
|
166
166
|
return pe;
|
|
167
167
|
}
|
|
168
168
|
function on(n) {
|
|
169
|
-
|
|
169
|
+
Ge().$$.on_mount.push(n);
|
|
170
170
|
}
|
|
171
171
|
function ln(n) {
|
|
172
|
-
|
|
172
|
+
Ge().$$.on_destroy.push(n);
|
|
173
173
|
}
|
|
174
174
|
function sn() {
|
|
175
|
-
const n =
|
|
175
|
+
const n = Ge();
|
|
176
176
|
return (e, t, { cancelable: i = !1 } = {}) => {
|
|
177
177
|
const o = n.$$.callbacks[e];
|
|
178
178
|
if (o) {
|
|
@@ -189,12 +189,12 @@ function sn() {
|
|
|
189
189
|
return !0;
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
|
-
const ae = [],
|
|
192
|
+
const ae = [], Ie = [];
|
|
193
193
|
let fe = [];
|
|
194
194
|
const ot = [], yt = /* @__PURE__ */ Promise.resolve();
|
|
195
|
-
let
|
|
195
|
+
let Ve = !1;
|
|
196
196
|
function vt() {
|
|
197
|
-
|
|
197
|
+
Ve || (Ve = !0, yt.then(w));
|
|
198
198
|
}
|
|
199
199
|
function cn() {
|
|
200
200
|
return vt(), yt;
|
|
@@ -202,7 +202,7 @@ function cn() {
|
|
|
202
202
|
function Se(n) {
|
|
203
203
|
fe.push(n);
|
|
204
204
|
}
|
|
205
|
-
const
|
|
205
|
+
const ze = /* @__PURE__ */ new Set();
|
|
206
206
|
let ce = 0;
|
|
207
207
|
function w() {
|
|
208
208
|
if (ce !== 0)
|
|
@@ -217,16 +217,16 @@ function w() {
|
|
|
217
217
|
} catch (e) {
|
|
218
218
|
throw ae.length = 0, ce = 0, e;
|
|
219
219
|
}
|
|
220
|
-
for (ve(null), ae.length = 0, ce = 0;
|
|
220
|
+
for (ve(null), ae.length = 0, ce = 0; Ie.length; ) Ie.pop()();
|
|
221
221
|
for (let e = 0; e < fe.length; e += 1) {
|
|
222
222
|
const t = fe[e];
|
|
223
|
-
|
|
223
|
+
ze.has(t) || (ze.add(t), t());
|
|
224
224
|
}
|
|
225
225
|
fe.length = 0;
|
|
226
226
|
} while (ae.length);
|
|
227
227
|
for (; ot.length; )
|
|
228
228
|
ot.pop()();
|
|
229
|
-
|
|
229
|
+
Ve = !1, ze.clear(), ve(n);
|
|
230
230
|
}
|
|
231
231
|
function an(n) {
|
|
232
232
|
if (n.fragment !== null) {
|
|
@@ -274,7 +274,7 @@ function bn(n, e, t, i, o, l, s = null, d = [-1]) {
|
|
|
274
274
|
ctx: [],
|
|
275
275
|
// state
|
|
276
276
|
props: l,
|
|
277
|
-
update:
|
|
277
|
+
update: Ce,
|
|
278
278
|
not_equal: o,
|
|
279
279
|
bound: rt(),
|
|
280
280
|
// lifecycle
|
|
@@ -291,14 +291,14 @@ function bn(n, e, t, i, o, l, s = null, d = [-1]) {
|
|
|
291
291
|
root: e.target || h.$$.root
|
|
292
292
|
};
|
|
293
293
|
s && s(f.root);
|
|
294
|
-
let
|
|
295
|
-
if (f.ctx = t ? t(n, e.props || {}, (
|
|
296
|
-
const
|
|
297
|
-
return f.ctx && o(f.ctx[
|
|
298
|
-
}) : [], f.update(),
|
|
294
|
+
let I = !1;
|
|
295
|
+
if (f.ctx = t ? t(n, e.props || {}, (v, P, ...F) => {
|
|
296
|
+
const M = F.length ? F[0] : P;
|
|
297
|
+
return f.ctx && o(f.ctx[v], f.ctx[v] = M) && (!f.skip_bound && f.bound[v] && f.bound[v](M), I && mn(n, v)), P;
|
|
298
|
+
}) : [], f.update(), I = !0, we(f.before_update), f.fragment = i ? i(f.ctx) : !1, e.target) {
|
|
299
299
|
if (e.hydrate) {
|
|
300
|
-
const
|
|
301
|
-
f.fragment && f.fragment.l(
|
|
300
|
+
const v = tn(e.target);
|
|
301
|
+
f.fragment && f.fragment.l(v), v.forEach(W);
|
|
302
302
|
} else
|
|
303
303
|
f.fragment && f.fragment.c();
|
|
304
304
|
e.intro && pt(n.$$.fragment), hn(n, e.target, e.anchor), w();
|
|
@@ -310,23 +310,23 @@ typeof HTMLElement == "function" && (wt = class extends HTMLElement {
|
|
|
310
310
|
constructor(e, t, i) {
|
|
311
311
|
super();
|
|
312
312
|
/** The Svelte component constructor */
|
|
313
|
-
|
|
313
|
+
B(this, "$$ctor");
|
|
314
314
|
/** Slots */
|
|
315
|
-
|
|
315
|
+
B(this, "$$s");
|
|
316
316
|
/** The Svelte component instance */
|
|
317
|
-
|
|
317
|
+
B(this, "$$c");
|
|
318
318
|
/** Whether or not the custom element is connected */
|
|
319
|
-
|
|
319
|
+
B(this, "$$cn", !1);
|
|
320
320
|
/** Component props data */
|
|
321
|
-
|
|
321
|
+
B(this, "$$d", {});
|
|
322
322
|
/** `true` if currently in the process of reflecting component props back to attributes */
|
|
323
|
-
|
|
323
|
+
B(this, "$$r", !1);
|
|
324
324
|
/** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */
|
|
325
|
-
|
|
325
|
+
B(this, "$$p_d", {});
|
|
326
326
|
/** @type {Record<string, Function[]>} Event listeners */
|
|
327
|
-
|
|
327
|
+
B(this, "$$l", {});
|
|
328
328
|
/** @type {Map<Function, Function>} Event listener unsubscribe functions */
|
|
329
|
-
|
|
329
|
+
B(this, "$$l_u", /* @__PURE__ */ new Map());
|
|
330
330
|
this.$$ctor = e, this.$$s = t, i && this.attachShadow({ mode: "open" });
|
|
331
331
|
}
|
|
332
332
|
addEventListener(e, t, i) {
|
|
@@ -353,17 +353,17 @@ typeof HTMLElement == "function" && (wt = class extends HTMLElement {
|
|
|
353
353
|
let s;
|
|
354
354
|
return {
|
|
355
355
|
c: function() {
|
|
356
|
-
s =
|
|
356
|
+
s = A("slot"), l !== "default" && a(s, "name", l);
|
|
357
357
|
},
|
|
358
358
|
/**
|
|
359
359
|
* @param {HTMLElement} target
|
|
360
360
|
* @param {HTMLElement} [anchor]
|
|
361
361
|
*/
|
|
362
|
-
m: function(f,
|
|
363
|
-
|
|
362
|
+
m: function(f, I) {
|
|
363
|
+
T(f, s, I);
|
|
364
364
|
},
|
|
365
365
|
d: function(f) {
|
|
366
|
-
f &&
|
|
366
|
+
f && W(s);
|
|
367
367
|
}
|
|
368
368
|
};
|
|
369
369
|
};
|
|
@@ -499,7 +499,7 @@ class vn {
|
|
|
499
499
|
*
|
|
500
500
|
* @type {any}
|
|
501
501
|
*/
|
|
502
|
-
|
|
502
|
+
B(this, "$$");
|
|
503
503
|
/**
|
|
504
504
|
* ### PRIVATE API
|
|
505
505
|
*
|
|
@@ -507,11 +507,11 @@ class vn {
|
|
|
507
507
|
*
|
|
508
508
|
* @type {any}
|
|
509
509
|
*/
|
|
510
|
-
|
|
510
|
+
B(this, "$$set");
|
|
511
511
|
}
|
|
512
512
|
/** @returns {void} */
|
|
513
513
|
$destroy() {
|
|
514
|
-
gn(this, 1), this.$destroy =
|
|
514
|
+
gn(this, 1), this.$destroy = Ce;
|
|
515
515
|
}
|
|
516
516
|
/**
|
|
517
517
|
* @template {Extract<keyof Events, string>} K
|
|
@@ -521,7 +521,7 @@ class vn {
|
|
|
521
521
|
*/
|
|
522
522
|
$on(e, t) {
|
|
523
523
|
if (!mt(t))
|
|
524
|
-
return
|
|
524
|
+
return Ce;
|
|
525
525
|
const i = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
|
|
526
526
|
return i.push(t), () => {
|
|
527
527
|
const o = i.indexOf(t);
|
|
@@ -533,7 +533,7 @@ class vn {
|
|
|
533
533
|
* @returns {void}
|
|
534
534
|
*/
|
|
535
535
|
$set(e) {
|
|
536
|
-
this.$$set && !
|
|
536
|
+
this.$$set && !Bt(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
539
|
const pn = "4";
|
|
@@ -554,6 +554,8 @@ async function _n(n, e = "SHA-256", t = 1e5) {
|
|
|
554
554
|
};
|
|
555
555
|
}
|
|
556
556
|
async function kt(n, e, t) {
|
|
557
|
+
if (typeof crypto > "u" || !("subtle" in crypto) || !("digest" in crypto.subtle))
|
|
558
|
+
throw new Error("Web Crypto is not available. Secure context is required (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).");
|
|
557
559
|
return wn(
|
|
558
560
|
await crypto.subtle.digest(
|
|
559
561
|
t.toUpperCase(),
|
|
@@ -591,29 +593,29 @@ function En(n) {
|
|
|
591
593
|
t[i] = e.charCodeAt(i);
|
|
592
594
|
return t;
|
|
593
595
|
}
|
|
594
|
-
function
|
|
596
|
+
function Cn(n, e = 12) {
|
|
595
597
|
const t = new Uint8Array(e);
|
|
596
598
|
for (let i = 0; i < e; i++)
|
|
597
599
|
t[i] = n % 256, n = Math.floor(n / 256);
|
|
598
600
|
return t;
|
|
599
601
|
}
|
|
600
|
-
async function
|
|
602
|
+
async function In(n, e = "", t = 1e6, i = 0) {
|
|
601
603
|
const o = "AES-GCM", l = new AbortController(), s = Date.now(), d = async () => {
|
|
602
|
-
for (let
|
|
604
|
+
for (let I = i; I <= t; I += 1) {
|
|
603
605
|
if (l.signal.aborted || !h || !f)
|
|
604
606
|
return null;
|
|
605
607
|
try {
|
|
606
|
-
const
|
|
608
|
+
const v = await crypto.subtle.decrypt(
|
|
607
609
|
{
|
|
608
610
|
name: o,
|
|
609
|
-
iv:
|
|
611
|
+
iv: Cn(I)
|
|
610
612
|
},
|
|
611
613
|
h,
|
|
612
614
|
f
|
|
613
615
|
);
|
|
614
|
-
if (
|
|
616
|
+
if (v)
|
|
615
617
|
return {
|
|
616
|
-
clearText: new TextDecoder().decode(
|
|
618
|
+
clearText: new TextDecoder().decode(v),
|
|
617
619
|
took: Date.now() - s
|
|
618
620
|
};
|
|
619
621
|
} catch {
|
|
@@ -624,13 +626,13 @@ async function Cn(n, e = "", t = 1e6, i = 0) {
|
|
|
624
626
|
let h = null, f = null;
|
|
625
627
|
try {
|
|
626
628
|
f = En(n);
|
|
627
|
-
const
|
|
629
|
+
const I = await crypto.subtle.digest(
|
|
628
630
|
"SHA-256",
|
|
629
631
|
_t.encode(e)
|
|
630
632
|
);
|
|
631
633
|
h = await crypto.subtle.importKey(
|
|
632
634
|
"raw",
|
|
633
|
-
|
|
635
|
+
I,
|
|
634
636
|
o,
|
|
635
637
|
!1,
|
|
636
638
|
["decrypt"]
|
|
@@ -647,7 +649,7 @@ async function Cn(n, e = "", t = 1e6, i = 0) {
|
|
|
647
649
|
};
|
|
648
650
|
}
|
|
649
651
|
var m = /* @__PURE__ */ ((n) => (n.ERROR = "error", n.VERIFIED = "verified", n.VERIFYING = "verifying", n.UNVERIFIED = "unverified", n.EXPIRED = "expired", n))(m || {});
|
|
650
|
-
function
|
|
652
|
+
function Rn(n) {
|
|
651
653
|
$t(n, "svelte-ddsc3z", '.altcha.svelte-ddsc3z.svelte-ddsc3z{background:var(--altcha-color-base, transparent);border:var(--altcha-border-width, 1px) solid var(--altcha-color-border, #a0a0a0);border-radius:var(--altcha-border-radius, 3px);color:var(--altcha-color-text, currentColor);display:flex;flex-direction:column;max-width:var(--altcha-max-width, 260px);position:relative;text-align:left}.altcha.svelte-ddsc3z.svelte-ddsc3z:focus-within{border-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating].svelte-ddsc3z.svelte-ddsc3z{background:var(--altcha-color-base, white);display:none;filter:drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.2));left:-100%;position:fixed;top:-100%;width:var(--altcha-max-width, 260px);z-index:999999}.altcha[data-floating=top].svelte-ddsc3z .altcha-anchor-arrow.svelte-ddsc3z{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto}.altcha[data-floating=bottom].svelte-ddsc3z.svelte-ddsc3z:focus-within::after{border-bottom-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating=top].svelte-ddsc3z.svelte-ddsc3z:focus-within::after{border-top-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating].svelte-ddsc3z.svelte-ddsc3z:not([data-state=unverified]){display:block}.altcha-anchor-arrow.svelte-ddsc3z.svelte-ddsc3z{border:6px solid transparent;border-bottom-color:var(--altcha-color-border, #a0a0a0);content:"";height:0;left:12px;position:absolute;top:-12px;width:0}.altcha-main.svelte-ddsc3z.svelte-ddsc3z{align-items:center;display:flex;gap:0.4rem;padding:0.7rem}.altcha-label.svelte-ddsc3z.svelte-ddsc3z{flex-grow:1}.altcha-label.svelte-ddsc3z label.svelte-ddsc3z{cursor:pointer}.altcha-logo.svelte-ddsc3z.svelte-ddsc3z{color:currentColor;opacity:0.3}.altcha-logo.svelte-ddsc3z.svelte-ddsc3z:hover{opacity:1}.altcha-error.svelte-ddsc3z.svelte-ddsc3z{color:var(--altcha-color-error-text, #f23939);display:flex;font-size:0.85rem;gap:0.3rem;padding:0 0.7rem 0.7rem}.altcha-footer.svelte-ddsc3z.svelte-ddsc3z{align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:0.75rem;opacity:0.4;padding:0.2rem 0.7rem;text-align:right}.altcha-footer.svelte-ddsc3z.svelte-ddsc3z:hover{opacity:1}.altcha-footer.svelte-ddsc3z>.svelte-ddsc3z:first-child{flex-grow:1}.altcha-footer.svelte-ddsc3z a{color:currentColor}.altcha-checkbox.svelte-ddsc3z.svelte-ddsc3z{display:flex;align-items:center;height:24px;width:24px}.altcha-checkbox.svelte-ddsc3z input.svelte-ddsc3z{width:18px;height:18px;margin:0}.altcha-hidden.svelte-ddsc3z.svelte-ddsc3z{display:none}.altcha-spinner.svelte-ddsc3z.svelte-ddsc3z{animation:svelte-ddsc3z-altcha-spinner 0.75s infinite linear;transform-origin:center}@keyframes svelte-ddsc3z-altcha-spinner{100%{transform:rotate(360deg)}}');
|
|
652
654
|
}
|
|
653
655
|
function lt(n) {
|
|
@@ -657,10 +659,10 @@ function lt(n) {
|
|
|
657
659
|
e = Q("svg"), t = Q("path"), i = Q("path"), a(t, "d", "M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"), a(t, "fill", "currentColor"), a(t, "opacity", ".25"), a(i, "d", "M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z"), a(i, "fill", "currentColor"), a(i, "class", "altcha-spinner svelte-ddsc3z"), a(e, "width", "24"), a(e, "height", "24"), a(e, "viewBox", "0 0 24 24"), a(e, "xmlns", "http://www.w3.org/2000/svg");
|
|
658
660
|
},
|
|
659
661
|
m(o, l) {
|
|
660
|
-
|
|
662
|
+
T(o, e, l), L(e, t), L(e, i);
|
|
661
663
|
},
|
|
662
664
|
d(o) {
|
|
663
|
-
o &&
|
|
665
|
+
o && W(e);
|
|
664
666
|
}
|
|
665
667
|
};
|
|
666
668
|
}
|
|
@@ -671,11 +673,11 @@ function Ln(n) {
|
|
|
671
673
|
), i;
|
|
672
674
|
return {
|
|
673
675
|
c() {
|
|
674
|
-
e =
|
|
676
|
+
e = A("label"), a(e, "for", i = /*name*/
|
|
675
677
|
n[4] + "_checkbox"), a(e, "class", "svelte-ddsc3z");
|
|
676
678
|
},
|
|
677
679
|
m(o, l) {
|
|
678
|
-
|
|
680
|
+
T(o, e, l), e.innerHTML = t;
|
|
679
681
|
},
|
|
680
682
|
p(o, l) {
|
|
681
683
|
l[0] & /*_strings*/
|
|
@@ -685,21 +687,21 @@ function Ln(n) {
|
|
|
685
687
|
o[4] + "_checkbox") && a(e, "for", i);
|
|
686
688
|
},
|
|
687
689
|
d(o) {
|
|
688
|
-
o &&
|
|
690
|
+
o && W(e);
|
|
689
691
|
}
|
|
690
692
|
};
|
|
691
693
|
}
|
|
692
|
-
function
|
|
694
|
+
function zn(n) {
|
|
693
695
|
let e, t = (
|
|
694
696
|
/*_strings*/
|
|
695
697
|
n[11].verifying + ""
|
|
696
698
|
);
|
|
697
699
|
return {
|
|
698
700
|
c() {
|
|
699
|
-
e =
|
|
701
|
+
e = A("span");
|
|
700
702
|
},
|
|
701
703
|
m(i, o) {
|
|
702
|
-
|
|
704
|
+
T(i, e, o), e.innerHTML = t;
|
|
703
705
|
},
|
|
704
706
|
p(i, o) {
|
|
705
707
|
o[0] & /*_strings*/
|
|
@@ -707,18 +709,18 @@ function Nn(n) {
|
|
|
707
709
|
i[11].verifying + "") && (e.innerHTML = t);
|
|
708
710
|
},
|
|
709
711
|
d(i) {
|
|
710
|
-
i &&
|
|
712
|
+
i && W(e);
|
|
711
713
|
}
|
|
712
714
|
};
|
|
713
715
|
}
|
|
714
|
-
function
|
|
716
|
+
function Vn(n) {
|
|
715
717
|
let e, t = (
|
|
716
718
|
/*_strings*/
|
|
717
719
|
n[11].verified + ""
|
|
718
720
|
), i, o;
|
|
719
721
|
return {
|
|
720
722
|
c() {
|
|
721
|
-
e =
|
|
723
|
+
e = A("span"), i = $(), o = A("input"), a(o, "type", "hidden"), a(
|
|
722
724
|
o,
|
|
723
725
|
"name",
|
|
724
726
|
/*name*/
|
|
@@ -727,7 +729,7 @@ function zn(n) {
|
|
|
727
729
|
n[6];
|
|
728
730
|
},
|
|
729
731
|
m(l, s) {
|
|
730
|
-
|
|
732
|
+
T(l, e, s), e.innerHTML = t, T(l, i, s), T(l, o, s);
|
|
731
733
|
},
|
|
732
734
|
p(l, s) {
|
|
733
735
|
s[0] & /*_strings*/
|
|
@@ -743,7 +745,7 @@ function zn(n) {
|
|
|
743
745
|
l[6]);
|
|
744
746
|
},
|
|
745
747
|
d(l) {
|
|
746
|
-
l && (
|
|
748
|
+
l && (W(e), W(i), W(o));
|
|
747
749
|
}
|
|
748
750
|
};
|
|
749
751
|
}
|
|
@@ -751,11 +753,11 @@ function st(n) {
|
|
|
751
753
|
let e, t, i, o, l, s, d;
|
|
752
754
|
return {
|
|
753
755
|
c() {
|
|
754
|
-
e =
|
|
756
|
+
e = A("div"), t = A("a"), i = Q("svg"), o = Q("path"), l = Q("path"), s = Q("path"), a(o, "d", "M2.33955 16.4279C5.88954 20.6586 12.1971 21.2105 16.4279 17.6604C18.4699 15.947 19.6548 13.5911 19.9352 11.1365L17.9886 10.4279C17.8738 12.5624 16.909 14.6459 15.1423 16.1284C11.7577 18.9684 6.71167 18.5269 3.87164 15.1423C1.03163 11.7577 1.4731 6.71166 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577C16.9767 5.86872 17.5322 7.02798 17.804 8.2324L19.9522 9.01429C19.7622 7.07737 19.0059 5.17558 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956C-0.658625 5.88958 -1.21046 12.1971 2.33955 16.4279Z"), a(o, "fill", "currentColor"), a(l, "d", "M3.57212 2.33956C1.65755 3.94607 0.496389 6.11731 0.12782 8.40523L2.04639 9.13961C2.26047 7.15832 3.21057 5.25375 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577L13.8302 6.78606L19.9633 9.13364C19.7929 7.15555 19.0335 5.20847 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956Z"), a(l, "fill", "currentColor"), a(s, "d", "M7 10H5C5 12.7614 7.23858 15 10 15C12.7614 15 15 12.7614 15 10H13C13 11.6569 11.6569 13 10 13C8.3431 13 7 11.6569 7 10Z"), a(s, "fill", "currentColor"), a(i, "width", "22"), a(i, "height", "22"), a(i, "viewBox", "0 0 20 20"), a(i, "fill", "none"), a(i, "xmlns", "http://www.w3.org/2000/svg"), a(t, "href", xt), a(t, "target", "_blank"), a(t, "class", "altcha-logo svelte-ddsc3z"), a(t, "aria-label", d = /*_strings*/
|
|
755
757
|
n[11].ariaLinkLabel);
|
|
756
758
|
},
|
|
757
759
|
m(h, f) {
|
|
758
|
-
|
|
760
|
+
T(h, e, f), L(e, t), L(t, i), L(i, o), L(i, l), L(i, s);
|
|
759
761
|
},
|
|
760
762
|
p(h, f) {
|
|
761
763
|
f[0] & /*_strings*/
|
|
@@ -763,7 +765,7 @@ function st(n) {
|
|
|
763
765
|
h[11].ariaLinkLabel) && a(t, "aria-label", d);
|
|
764
766
|
},
|
|
765
767
|
d(h) {
|
|
766
|
-
h &&
|
|
768
|
+
h && W(e);
|
|
767
769
|
}
|
|
768
770
|
};
|
|
769
771
|
}
|
|
@@ -772,22 +774,22 @@ function ct(n) {
|
|
|
772
774
|
function l(h, f) {
|
|
773
775
|
return (
|
|
774
776
|
/*state*/
|
|
775
|
-
h[7] === m.EXPIRED ?
|
|
777
|
+
h[7] === m.EXPIRED ? Gn : Sn
|
|
776
778
|
);
|
|
777
779
|
}
|
|
778
780
|
let s = l(n), d = s(n);
|
|
779
781
|
return {
|
|
780
782
|
c() {
|
|
781
|
-
e =
|
|
783
|
+
e = A("div"), t = Q("svg"), i = Q("path"), o = $(), d.c(), a(i, "stroke-linecap", "round"), a(i, "stroke-linejoin", "round"), a(i, "d", "M6 18L18 6M6 6l12 12"), a(t, "width", "14"), a(t, "height", "14"), a(t, "xmlns", "http://www.w3.org/2000/svg"), a(t, "fill", "none"), a(t, "viewBox", "0 0 24 24"), a(t, "stroke-width", "1.5"), a(t, "stroke", "currentColor"), a(e, "class", "altcha-error svelte-ddsc3z");
|
|
782
784
|
},
|
|
783
785
|
m(h, f) {
|
|
784
|
-
|
|
786
|
+
T(h, e, f), L(e, t), L(t, i), L(e, o), d.m(e, null);
|
|
785
787
|
},
|
|
786
788
|
p(h, f) {
|
|
787
789
|
s === (s = l(h)) && d ? d.p(h, f) : (d.d(1), d = s(h), d && (d.c(), d.m(e, null)));
|
|
788
790
|
},
|
|
789
791
|
d(h) {
|
|
790
|
-
h &&
|
|
792
|
+
h && W(e), d.d();
|
|
791
793
|
}
|
|
792
794
|
};
|
|
793
795
|
}
|
|
@@ -798,7 +800,7 @@ function Sn(n) {
|
|
|
798
800
|
);
|
|
799
801
|
return {
|
|
800
802
|
c() {
|
|
801
|
-
e =
|
|
803
|
+
e = A("div"), a(
|
|
802
804
|
e,
|
|
803
805
|
"title",
|
|
804
806
|
/*error*/
|
|
@@ -806,7 +808,7 @@ function Sn(n) {
|
|
|
806
808
|
);
|
|
807
809
|
},
|
|
808
810
|
m(i, o) {
|
|
809
|
-
|
|
811
|
+
T(i, e, o), e.innerHTML = t;
|
|
810
812
|
},
|
|
811
813
|
p(i, o) {
|
|
812
814
|
o[0] & /*_strings*/
|
|
@@ -820,18 +822,18 @@ function Sn(n) {
|
|
|
820
822
|
);
|
|
821
823
|
},
|
|
822
824
|
d(i) {
|
|
823
|
-
i &&
|
|
825
|
+
i && W(e);
|
|
824
826
|
}
|
|
825
827
|
};
|
|
826
828
|
}
|
|
827
|
-
function
|
|
829
|
+
function Gn(n) {
|
|
828
830
|
let e, t = (
|
|
829
831
|
/*_strings*/
|
|
830
832
|
n[11].expired + ""
|
|
831
833
|
);
|
|
832
834
|
return {
|
|
833
835
|
c() {
|
|
834
|
-
e =
|
|
836
|
+
e = A("div"), a(
|
|
835
837
|
e,
|
|
836
838
|
"title",
|
|
837
839
|
/*error*/
|
|
@@ -839,7 +841,7 @@ function An(n) {
|
|
|
839
841
|
);
|
|
840
842
|
},
|
|
841
843
|
m(i, o) {
|
|
842
|
-
|
|
844
|
+
T(i, e, o), e.innerHTML = t;
|
|
843
845
|
},
|
|
844
846
|
p(i, o) {
|
|
845
847
|
o[0] & /*_strings*/
|
|
@@ -853,7 +855,7 @@ function An(n) {
|
|
|
853
855
|
);
|
|
854
856
|
},
|
|
855
857
|
d(i) {
|
|
856
|
-
i &&
|
|
858
|
+
i && W(e);
|
|
857
859
|
}
|
|
858
860
|
};
|
|
859
861
|
}
|
|
@@ -864,10 +866,10 @@ function at(n) {
|
|
|
864
866
|
);
|
|
865
867
|
return {
|
|
866
868
|
c() {
|
|
867
|
-
e =
|
|
869
|
+
e = A("div"), t = A("div"), a(t, "class", "svelte-ddsc3z"), a(e, "class", "altcha-footer svelte-ddsc3z");
|
|
868
870
|
},
|
|
869
871
|
m(o, l) {
|
|
870
|
-
|
|
872
|
+
T(o, e, l), L(e, t), t.innerHTML = i;
|
|
871
873
|
},
|
|
872
874
|
p(o, l) {
|
|
873
875
|
l[0] & /*_strings*/
|
|
@@ -875,7 +877,7 @@ function at(n) {
|
|
|
875
877
|
o[11].footer + "") && (t.innerHTML = i);
|
|
876
878
|
},
|
|
877
879
|
d(o) {
|
|
878
|
-
o &&
|
|
880
|
+
o && W(e);
|
|
879
881
|
}
|
|
880
882
|
};
|
|
881
883
|
}
|
|
@@ -883,51 +885,51 @@ function ft(n) {
|
|
|
883
885
|
let e;
|
|
884
886
|
return {
|
|
885
887
|
c() {
|
|
886
|
-
e =
|
|
888
|
+
e = A("div"), a(e, "class", "altcha-anchor-arrow svelte-ddsc3z");
|
|
887
889
|
},
|
|
888
890
|
m(t, i) {
|
|
889
|
-
|
|
891
|
+
T(t, e, i), n[48](e);
|
|
890
892
|
},
|
|
891
|
-
p:
|
|
893
|
+
p: Ce,
|
|
892
894
|
d(t) {
|
|
893
|
-
t &&
|
|
895
|
+
t && W(e), n[48](null);
|
|
894
896
|
}
|
|
895
897
|
};
|
|
896
898
|
}
|
|
897
|
-
function
|
|
898
|
-
let e, t, i, o, l, s, d, h, f,
|
|
899
|
-
const
|
|
899
|
+
function Nn(n) {
|
|
900
|
+
let e, t, i, o, l, s, d, h, f, I, v, P, F, M, S, z, O;
|
|
901
|
+
const K = (
|
|
900
902
|
/*#slots*/
|
|
901
903
|
n[46].default
|
|
902
|
-
),
|
|
903
|
-
|
|
904
|
+
), Z = Dt(
|
|
905
|
+
K,
|
|
904
906
|
n,
|
|
905
907
|
/*$$scope*/
|
|
906
908
|
n[45],
|
|
907
909
|
null
|
|
908
910
|
);
|
|
909
|
-
let
|
|
911
|
+
let G = (
|
|
910
912
|
/*state*/
|
|
911
913
|
n[7] === m.VERIFYING && lt()
|
|
912
914
|
);
|
|
913
|
-
function q(u,
|
|
915
|
+
function q(u, b) {
|
|
914
916
|
return (
|
|
915
917
|
/*state*/
|
|
916
|
-
u[7] === m.VERIFIED ?
|
|
918
|
+
u[7] === m.VERIFIED ? Vn : (
|
|
917
919
|
/*state*/
|
|
918
|
-
u[7] === m.VERIFYING ?
|
|
920
|
+
u[7] === m.VERIFYING ? zn : Ln
|
|
919
921
|
)
|
|
920
922
|
);
|
|
921
923
|
}
|
|
922
|
-
let
|
|
924
|
+
let D = q(n), Y = D(n), x = (
|
|
923
925
|
/*hidelogo*/
|
|
924
926
|
(n[3] !== !0 || /*isFreeSaaS*/
|
|
925
927
|
n[12]) && st(n)
|
|
926
|
-
),
|
|
928
|
+
), N = (
|
|
927
929
|
/*error*/
|
|
928
930
|
(n[5] || /*state*/
|
|
929
931
|
n[7] === m.EXPIRED) && ct(n)
|
|
930
|
-
),
|
|
932
|
+
), V = (
|
|
931
933
|
/*_strings*/
|
|
932
934
|
n[11].footer && /*hidefooter*/
|
|
933
935
|
(n[2] !== !0 || /*isFreeSaaS*/
|
|
@@ -938,7 +940,7 @@ function Tn(n) {
|
|
|
938
940
|
);
|
|
939
941
|
return {
|
|
940
942
|
c() {
|
|
941
|
-
|
|
943
|
+
Z && Z.c(), e = $(), t = A("div"), i = A("div"), G && G.c(), o = $(), l = A("div"), s = A("input"), f = $(), I = A("div"), Y.c(), v = $(), x && x.c(), P = $(), N && N.c(), F = $(), V && V.c(), M = $(), _ && _.c(), a(s, "type", "checkbox"), a(s, "id", d = /*name*/
|
|
942
944
|
n[4] + "_checkbox"), s.required = h = /*auto*/
|
|
943
945
|
n[0] !== "onsubmit" && (!/*floating*/
|
|
944
946
|
n[1] || /*auto*/
|
|
@@ -947,7 +949,7 @@ function Tn(n) {
|
|
|
947
949
|
"altcha-hidden",
|
|
948
950
|
/*state*/
|
|
949
951
|
n[7] === m.VERIFYING
|
|
950
|
-
), a(
|
|
952
|
+
), a(I, "class", "altcha-label svelte-ddsc3z"), a(i, "class", "altcha-main svelte-ddsc3z"), a(t, "class", "altcha svelte-ddsc3z"), a(
|
|
951
953
|
t,
|
|
952
954
|
"data-state",
|
|
953
955
|
/*state*/
|
|
@@ -959,9 +961,9 @@ function Tn(n) {
|
|
|
959
961
|
n[1]
|
|
960
962
|
);
|
|
961
963
|
},
|
|
962
|
-
m(u,
|
|
963
|
-
|
|
964
|
-
n[8], L(i, f), L(i,
|
|
964
|
+
m(u, b) {
|
|
965
|
+
Z && Z.m(u, b), T(u, e, b), T(u, t, b), L(t, i), G && G.m(i, null), L(i, o), L(i, l), L(l, s), s.checked = /*checked*/
|
|
966
|
+
n[8], L(i, f), L(i, I), Y.m(I, null), L(i, v), x && x.m(i, null), L(t, P), N && N.m(t, null), L(t, F), V && V.m(t, null), L(t, M), _ && _.m(t, null), n[49](t), S = !0, z || (O = [
|
|
965
967
|
Le(
|
|
966
968
|
s,
|
|
967
969
|
"change",
|
|
@@ -980,57 +982,57 @@ function Tn(n) {
|
|
|
980
982
|
/*onInvalid*/
|
|
981
983
|
n[14]
|
|
982
984
|
)
|
|
983
|
-
],
|
|
985
|
+
], z = !0);
|
|
984
986
|
},
|
|
985
|
-
p(u,
|
|
986
|
-
|
|
987
|
+
p(u, b) {
|
|
988
|
+
Z && Z.p && (!S || b[1] & /*$$scope*/
|
|
987
989
|
16384) && Ot(
|
|
988
|
-
|
|
989
|
-
|
|
990
|
+
Z,
|
|
991
|
+
K,
|
|
990
992
|
u,
|
|
991
993
|
/*$$scope*/
|
|
992
994
|
u[45],
|
|
993
|
-
S ?
|
|
994
|
-
|
|
995
|
+
S ? Jt(
|
|
996
|
+
K,
|
|
995
997
|
/*$$scope*/
|
|
996
998
|
u[45],
|
|
997
|
-
|
|
999
|
+
b,
|
|
998
1000
|
null
|
|
999
|
-
) :
|
|
1001
|
+
) : Kt(
|
|
1000
1002
|
/*$$scope*/
|
|
1001
1003
|
u[45]
|
|
1002
1004
|
),
|
|
1003
1005
|
null
|
|
1004
1006
|
), /*state*/
|
|
1005
|
-
u[7] === m.VERIFYING ?
|
|
1007
|
+
u[7] === m.VERIFYING ? G || (G = lt(), G.c(), G.m(i, o)) : G && (G.d(1), G = null), (!S || b[0] & /*name*/
|
|
1006
1008
|
16 && d !== (d = /*name*/
|
|
1007
|
-
u[4] + "_checkbox")) && a(s, "id", d), (!S ||
|
|
1009
|
+
u[4] + "_checkbox")) && a(s, "id", d), (!S || b[0] & /*auto, floating*/
|
|
1008
1010
|
3 && h !== (h = /*auto*/
|
|
1009
1011
|
u[0] !== "onsubmit" && (!/*floating*/
|
|
1010
1012
|
u[1] || /*auto*/
|
|
1011
|
-
u[0] !== "off"))) && (s.required = h),
|
|
1013
|
+
u[0] !== "off"))) && (s.required = h), b[0] & /*checked*/
|
|
1012
1014
|
256 && (s.checked = /*checked*/
|
|
1013
|
-
u[8]), (!S ||
|
|
1015
|
+
u[8]), (!S || b[0] & /*state*/
|
|
1014
1016
|
128) && it(
|
|
1015
1017
|
l,
|
|
1016
1018
|
"altcha-hidden",
|
|
1017
1019
|
/*state*/
|
|
1018
1020
|
u[7] === m.VERIFYING
|
|
1019
|
-
),
|
|
1021
|
+
), D === (D = q(u)) && Y ? Y.p(u, b) : (Y.d(1), Y = D(u), Y && (Y.c(), Y.m(I, null))), /*hidelogo*/
|
|
1020
1022
|
u[3] !== !0 || /*isFreeSaaS*/
|
|
1021
|
-
u[12] ? x ? x.p(u,
|
|
1023
|
+
u[12] ? x ? x.p(u, b) : (x = st(u), x.c(), x.m(i, null)) : x && (x.d(1), x = null), /*error*/
|
|
1022
1024
|
u[5] || /*state*/
|
|
1023
|
-
u[7] === m.EXPIRED ?
|
|
1025
|
+
u[7] === m.EXPIRED ? N ? N.p(u, b) : (N = ct(u), N.c(), N.m(t, F)) : N && (N.d(1), N = null), /*_strings*/
|
|
1024
1026
|
u[11].footer && /*hidefooter*/
|
|
1025
1027
|
(u[2] !== !0 || /*isFreeSaaS*/
|
|
1026
|
-
u[12]) ?
|
|
1027
|
-
u[1] ? _ ? _.p(u,
|
|
1028
|
+
u[12]) ? V ? V.p(u, b) : (V = at(u), V.c(), V.m(t, M)) : V && (V.d(1), V = null), /*floating*/
|
|
1029
|
+
u[1] ? _ ? _.p(u, b) : (_ = ft(u), _.c(), _.m(t, null)) : _ && (_.d(1), _ = null), (!S || b[0] & /*state*/
|
|
1028
1030
|
128) && a(
|
|
1029
1031
|
t,
|
|
1030
1032
|
"data-state",
|
|
1031
1033
|
/*state*/
|
|
1032
1034
|
u[7]
|
|
1033
|
-
), (!S ||
|
|
1035
|
+
), (!S || b[0] & /*floating*/
|
|
1034
1036
|
2) && a(
|
|
1035
1037
|
t,
|
|
1036
1038
|
"data-floating",
|
|
@@ -1039,13 +1041,13 @@ function Tn(n) {
|
|
|
1039
1041
|
);
|
|
1040
1042
|
},
|
|
1041
1043
|
i(u) {
|
|
1042
|
-
S || (pt(
|
|
1044
|
+
S || (pt(Z, u), S = !0);
|
|
1043
1045
|
},
|
|
1044
1046
|
o(u) {
|
|
1045
|
-
dn(
|
|
1047
|
+
dn(Z, u), S = !1;
|
|
1046
1048
|
},
|
|
1047
1049
|
d(u) {
|
|
1048
|
-
u && (
|
|
1050
|
+
u && (W(e), W(t)), Z && Z.d(u), G && G.d(), Y.d(), x && x.d(), N && N.d(), V && V.d(), _ && _.d(), n[49](null), z = !1, we(O);
|
|
1049
1051
|
}
|
|
1050
1052
|
};
|
|
1051
1053
|
}
|
|
@@ -1053,26 +1055,26 @@ const ut = "Visit Altcha.org", xt = "https://altcha.org/";
|
|
|
1053
1055
|
function dt(n) {
|
|
1054
1056
|
return JSON.parse(n);
|
|
1055
1057
|
}
|
|
1056
|
-
function
|
|
1058
|
+
function An(n, e, t) {
|
|
1057
1059
|
var qe, et;
|
|
1058
|
-
let i, o, l, s, { $$slots: d = {}, $$scope: h } = e, { auto: f = void 0 } = e, { blockspam:
|
|
1059
|
-
const de = sn(),
|
|
1060
|
-
let re = !1, E, ie = null, se = null,
|
|
1060
|
+
let i, o, l, s, { $$slots: d = {}, $$scope: h } = e, { auto: f = void 0 } = e, { blockspam: I = void 0 } = e, { challengeurl: v = void 0 } = e, { challengejson: P = void 0 } = e, { debug: F = !1 } = e, { delay: M = 0 } = e, { expire: S = void 0 } = e, { floating: z = void 0 } = e, { floatinganchor: O = void 0 } = e, { floatingoffset: K = void 0 } = e, { hidefooter: Z = !1 } = e, { hidelogo: G = !1 } = e, { name: q = "altcha" } = e, { maxnumber: D = 1e6 } = e, { mockerror: Y = !1 } = e, { obfuscated: x = void 0 } = e, { plugins: N = void 0 } = e, { refetchonexpire: V = !0 } = e, { spamfilter: _ = !1 } = e, { strings: u = void 0 } = e, { test: b = !1 } = e, { verifyurl: ee = void 0 } = e, { workers: le = Math.min(16, navigator.hardwareConcurrency || 8) } = e, { workerurl: ue = void 0 } = e;
|
|
1061
|
+
const de = sn(), Ne = ["SHA-256", "SHA-384", "SHA-512"], Ae = (et = (qe = document.documentElement.lang) == null ? void 0 : qe.split("-")) == null ? void 0 : et[0];
|
|
1062
|
+
let re = !1, E, ie = null, se = null, y = null, he = null, J = null, oe = null, te = [], C = m.UNVERIFIED;
|
|
1061
1063
|
ln(() => {
|
|
1062
|
-
Et(),
|
|
1064
|
+
Et(), y && (y.removeEventListener("submit", je), y.removeEventListener("reset", Pe), y.removeEventListener("focusin", Te), y = null), J && (clearTimeout(J), J = null), document.removeEventListener("click", Ye), document.removeEventListener("scroll", We), window.removeEventListener("resize", Me);
|
|
1063
1065
|
}), on(() => {
|
|
1064
|
-
k("mounted", "1.0.
|
|
1066
|
+
k("mounted", "1.0.7"), k("workers", le), zt(), k("plugins", te.length ? te.map((r) => r.constructor.pluginName).join(", ") : "none"), b && k("using test mode"), S && ke(S), f !== void 0 && k("auto", f), z !== void 0 && Ue(z), y = E.closest("form"), y && (y.addEventListener("submit", je, { capture: !0 }), y.addEventListener("reset", Pe), f === "onfocus" && y.addEventListener("focusin", Te)), f === "onload" && (x ? ge() : ne()), i && (Z || G) && k("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."), requestAnimationFrame(() => {
|
|
1065
1067
|
de("load");
|
|
1066
1068
|
});
|
|
1067
1069
|
});
|
|
1068
|
-
function
|
|
1070
|
+
function Xe(r, c) {
|
|
1069
1071
|
return btoa(JSON.stringify({
|
|
1070
1072
|
algorithm: r.algorithm,
|
|
1071
1073
|
challenge: r.challenge,
|
|
1072
1074
|
number: c.number,
|
|
1073
1075
|
salt: r.salt,
|
|
1074
1076
|
signature: r.signature,
|
|
1075
|
-
test:
|
|
1077
|
+
test: b ? !0 : void 0,
|
|
1076
1078
|
took: c.took
|
|
1077
1079
|
}));
|
|
1078
1080
|
}
|
|
@@ -1080,58 +1082,58 @@ function Zn(n, e, t) {
|
|
|
1080
1082
|
for (const r of te)
|
|
1081
1083
|
r.destroy();
|
|
1082
1084
|
}
|
|
1083
|
-
function
|
|
1084
|
-
|
|
1085
|
+
function Ze() {
|
|
1086
|
+
v && V && C === m.VERIFIED ? ne() : me(m.EXPIRED, s.expired);
|
|
1085
1087
|
}
|
|
1086
|
-
async function
|
|
1088
|
+
async function Ct() {
|
|
1087
1089
|
var r;
|
|
1088
|
-
if (
|
|
1090
|
+
if (Y)
|
|
1089
1091
|
throw k("mocking error"), new Error("Mocked error.");
|
|
1090
1092
|
if (o)
|
|
1091
1093
|
return k("using provided json data"), o;
|
|
1092
|
-
if (
|
|
1093
|
-
return k("generating test challenge", { test:
|
|
1094
|
+
if (b)
|
|
1095
|
+
return k("generating test challenge", { test: b }), _n(typeof b != "boolean" ? +b : void 0);
|
|
1094
1096
|
{
|
|
1095
|
-
if (!
|
|
1096
|
-
const p =
|
|
1097
|
-
p != null && p.includes("/form/") && t(15,
|
|
1097
|
+
if (!v && y) {
|
|
1098
|
+
const p = y.getAttribute("action");
|
|
1099
|
+
p != null && p.includes("/form/") && t(15, v = p + "/altcha");
|
|
1098
1100
|
}
|
|
1099
|
-
if (!
|
|
1101
|
+
if (!v)
|
|
1100
1102
|
throw new Error("Attribute challengeurl not set.");
|
|
1101
|
-
k("fetching challenge from",
|
|
1102
|
-
const c = await fetch(
|
|
1103
|
+
k("fetching challenge from", v);
|
|
1104
|
+
const c = await fetch(v, {
|
|
1103
1105
|
headers: _ ? { "x-altcha-spam-filter": "1" } : {}
|
|
1104
1106
|
});
|
|
1105
1107
|
if (c.status !== 200)
|
|
1106
1108
|
throw new Error(`Server responded with ${c.status}.`);
|
|
1107
|
-
const g = c.headers.get("Expires"),
|
|
1108
|
-
if (
|
|
1109
|
-
const p = new Date(+
|
|
1110
|
-
|
|
1109
|
+
const g = c.headers.get("Expires"), R = c.headers.get("X-Altcha-Config"), U = await c.json(), j = new URLSearchParams((r = U.salt.split("?")) == null ? void 0 : r[1]), X = j.get("expires") || j.get("expire");
|
|
1110
|
+
if (X) {
|
|
1111
|
+
const p = new Date(+X * 1e3), H = isNaN(p.getTime()) ? 0 : p.getTime() - Date.now();
|
|
1112
|
+
H > 0 && ke(H);
|
|
1111
1113
|
}
|
|
1112
|
-
if (
|
|
1114
|
+
if (R)
|
|
1113
1115
|
try {
|
|
1114
|
-
const p = JSON.parse(
|
|
1115
|
-
p && typeof p == "object" && (p.verifyurl && (p.verifyurl = new URL(p.verifyurl, new URL(
|
|
1116
|
+
const p = JSON.parse(R);
|
|
1117
|
+
p && typeof p == "object" && (p.verifyurl && (p.verifyurl = new URL(p.verifyurl, new URL(v)).toString()), De(p));
|
|
1116
1118
|
} catch (p) {
|
|
1117
1119
|
k("unable to configure from X-Altcha-Config", p);
|
|
1118
1120
|
}
|
|
1119
1121
|
if (!S && (g != null && g.length)) {
|
|
1120
1122
|
const p = Date.parse(g);
|
|
1121
1123
|
if (p) {
|
|
1122
|
-
const
|
|
1123
|
-
|
|
1124
|
+
const H = p - Date.now();
|
|
1125
|
+
H > 0 && ke(H);
|
|
1124
1126
|
}
|
|
1125
1127
|
}
|
|
1126
|
-
return
|
|
1128
|
+
return U;
|
|
1127
1129
|
}
|
|
1128
1130
|
}
|
|
1129
|
-
function
|
|
1131
|
+
function It(r) {
|
|
1130
1132
|
var g;
|
|
1131
|
-
const c =
|
|
1133
|
+
const c = y == null ? void 0 : y.querySelector(typeof r == "string" ? `input[name="${r}"]` : 'input[type="email"]:not([data-no-spamfilter])');
|
|
1132
1134
|
return ((g = c == null ? void 0 : c.value) == null ? void 0 : g.slice(c.value.indexOf("@"))) || void 0;
|
|
1133
1135
|
}
|
|
1134
|
-
function
|
|
1136
|
+
function Rt() {
|
|
1135
1137
|
return _ === "ipAddress" ? {
|
|
1136
1138
|
blockedCountries: void 0,
|
|
1137
1139
|
classifier: void 0,
|
|
@@ -1158,94 +1160,94 @@ function Zn(n, e, t) {
|
|
|
1158
1160
|
}
|
|
1159
1161
|
function Lt(r) {
|
|
1160
1162
|
return [
|
|
1161
|
-
...(
|
|
1163
|
+
...(y == null ? void 0 : y.querySelectorAll(r != null && r.length ? r.map((g) => `input[name="${g}"]`).join(", ") : 'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])')) || []
|
|
1162
1164
|
].reduce(
|
|
1163
|
-
(g,
|
|
1164
|
-
const
|
|
1165
|
-
return
|
|
1166
|
-
`) :
|
|
1165
|
+
(g, R) => {
|
|
1166
|
+
const U = R.name, j = R.value;
|
|
1167
|
+
return U && j && (g[U] = /\n/.test(j) ? j.replace(new RegExp("(?<!\\r)\\n", "g"), `\r
|
|
1168
|
+
`) : j), g;
|
|
1167
1169
|
},
|
|
1168
1170
|
{}
|
|
1169
1171
|
);
|
|
1170
1172
|
}
|
|
1171
|
-
function
|
|
1172
|
-
const r =
|
|
1173
|
+
function zt() {
|
|
1174
|
+
const r = N !== void 0 ? N.split(",") : void 0;
|
|
1173
1175
|
for (const c of globalThis.altchaPlugins)
|
|
1174
1176
|
(!r || r.includes(c.pluginName)) && te.push(new c({
|
|
1175
1177
|
el: E,
|
|
1176
1178
|
clarify: ge,
|
|
1177
1179
|
dispatch: de,
|
|
1178
|
-
getConfiguration:
|
|
1180
|
+
getConfiguration: Je,
|
|
1179
1181
|
getFloatingAnchor: Oe,
|
|
1180
|
-
getState:
|
|
1182
|
+
getState: Ke,
|
|
1181
1183
|
log: k,
|
|
1182
1184
|
reset: me,
|
|
1183
|
-
solve:
|
|
1185
|
+
solve: Be,
|
|
1184
1186
|
setState: Qe,
|
|
1185
1187
|
setFloatingAnchor: $e,
|
|
1186
1188
|
verify: ne
|
|
1187
1189
|
}));
|
|
1188
1190
|
}
|
|
1189
1191
|
function k(...r) {
|
|
1190
|
-
(
|
|
1192
|
+
(F || r.some((c) => c instanceof Error)) && console[r[0] instanceof Error ? "error" : "log"]("ALTCHA", `[name=${q}]`, ...r);
|
|
1191
1193
|
}
|
|
1192
|
-
function
|
|
1193
|
-
[m.UNVERIFIED, m.ERROR, m.EXPIRED].includes(
|
|
1194
|
+
function Vt() {
|
|
1195
|
+
[m.UNVERIFIED, m.ERROR, m.EXPIRED].includes(C) ? _ && (y == null ? void 0 : y.reportValidity()) === !1 ? t(8, re = !1) : x ? ge() : ne() : t(8, re = !0);
|
|
1194
1196
|
}
|
|
1195
|
-
function
|
|
1197
|
+
function Ye(r) {
|
|
1196
1198
|
const c = r.target;
|
|
1197
|
-
|
|
1199
|
+
z && c && !E.contains(c) && (C === m.VERIFIED || f === "off" && C === m.UNVERIFIED) && t(9, E.style.display = "none", E);
|
|
1198
1200
|
}
|
|
1199
|
-
function
|
|
1200
|
-
|
|
1201
|
+
function We() {
|
|
1202
|
+
z && C !== m.UNVERIFIED && _e();
|
|
1201
1203
|
}
|
|
1202
1204
|
function St(r) {
|
|
1203
1205
|
for (const c of te)
|
|
1204
1206
|
typeof c.onErrorChange == "function" && c.onErrorChange(he);
|
|
1205
1207
|
}
|
|
1206
|
-
function
|
|
1207
|
-
|
|
1208
|
+
function Te(r) {
|
|
1209
|
+
C === m.UNVERIFIED && ne();
|
|
1208
1210
|
}
|
|
1209
|
-
function
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
})) :
|
|
1211
|
+
function je(r) {
|
|
1212
|
+
y && f === "onsubmit" ? C === m.UNVERIFIED ? (r.preventDefault(), r.stopPropagation(), ne().then(() => {
|
|
1213
|
+
y == null || y.requestSubmit();
|
|
1214
|
+
})) : C !== m.VERIFIED && (r.preventDefault(), r.stopPropagation(), C === m.VERIFYING && Fe()) : y && z && f === "off" && C === m.UNVERIFIED && (r.preventDefault(), r.stopPropagation(), t(9, E.style.display = "block", E), _e());
|
|
1213
1215
|
}
|
|
1214
|
-
function
|
|
1216
|
+
function Pe() {
|
|
1215
1217
|
me();
|
|
1216
1218
|
}
|
|
1217
|
-
function
|
|
1218
|
-
|
|
1219
|
+
function Fe() {
|
|
1220
|
+
C === m.VERIFYING && s.waitAlert && alert(s.waitAlert);
|
|
1219
1221
|
}
|
|
1220
|
-
function
|
|
1222
|
+
function Gt(r) {
|
|
1221
1223
|
for (const c of te)
|
|
1222
|
-
typeof c.onStateChange == "function" && c.onStateChange(
|
|
1223
|
-
|
|
1224
|
+
typeof c.onStateChange == "function" && c.onStateChange(C);
|
|
1225
|
+
z && C !== m.UNVERIFIED && requestAnimationFrame(() => {
|
|
1224
1226
|
_e();
|
|
1225
|
-
}), t(8, re =
|
|
1227
|
+
}), t(8, re = C === m.VERIFIED);
|
|
1226
1228
|
}
|
|
1227
|
-
function
|
|
1228
|
-
|
|
1229
|
+
function Me() {
|
|
1230
|
+
z && _e();
|
|
1229
1231
|
}
|
|
1230
1232
|
function _e(r = 20) {
|
|
1231
1233
|
if (E)
|
|
1232
|
-
if (se || (se = (O ? document.querySelector(O) :
|
|
1233
|
-
const c = parseInt(
|
|
1234
|
-
if (
|
|
1235
|
-
const
|
|
1236
|
-
t(10, ie.style.left = g.left - p + g.width / 2 -
|
|
1234
|
+
if (se || (se = (O ? document.querySelector(O) : y == null ? void 0 : y.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])')) || y), se) {
|
|
1235
|
+
const c = parseInt(K, 10) || 12, g = se.getBoundingClientRect(), R = E.getBoundingClientRect(), U = document.documentElement.clientHeight, j = document.documentElement.clientWidth, X = z === "auto" ? g.bottom + R.height + c + r > U : z === "top", p = Math.max(r, Math.min(j - r - R.width, g.left + g.width / 2 - R.width / 2));
|
|
1236
|
+
if (X ? t(9, E.style.top = `${g.top - (R.height + c)}px`, E) : t(9, E.style.top = `${g.bottom + c}px`, E), t(9, E.style.left = `${p}px`, E), E.setAttribute("data-floating", X ? "top" : "bottom"), ie) {
|
|
1237
|
+
const H = ie.getBoundingClientRect();
|
|
1238
|
+
t(10, ie.style.left = g.left - p + g.width / 2 - H.width / 2 + "px", ie);
|
|
1237
1239
|
}
|
|
1238
1240
|
} else
|
|
1239
1241
|
k("unable to find floating anchor element");
|
|
1240
1242
|
}
|
|
1241
|
-
async function
|
|
1243
|
+
async function Nt(r) {
|
|
1242
1244
|
if (!ee)
|
|
1243
1245
|
throw new Error("Attribute verifyurl not set.");
|
|
1244
1246
|
k("requesting server verification from", ee);
|
|
1245
1247
|
const c = { payload: r };
|
|
1246
1248
|
if (_) {
|
|
1247
|
-
const { blockedCountries:
|
|
1248
|
-
c.blockedCountries =
|
|
1249
|
+
const { blockedCountries: U, classifier: j, disableRules: X, email: p, expectedLanguages: H, expectedCountries: Re, fields: be, ipAddress: ye, text: Tt, timeZone: tt } = Rt();
|
|
1250
|
+
c.blockedCountries = U, c.classifier = j, c.disableRules = X, c.email = p === !1 ? void 0 : It(p), c.expectedCountries = Re, c.expectedLanguages = H || (Ae ? [Ae] : void 0), c.fields = be === !1 ? void 0 : Lt(be), c.ipAddress = ye === !1 ? void 0 : ye || "auto", c.text = Tt, c.timeZone = tt === !1 ? void 0 : tt || xn();
|
|
1249
1251
|
}
|
|
1250
1252
|
const g = await fetch(ee, {
|
|
1251
1253
|
body: JSON.stringify(c),
|
|
@@ -1254,33 +1256,33 @@ function Zn(n, e, t) {
|
|
|
1254
1256
|
});
|
|
1255
1257
|
if (g.status !== 200)
|
|
1256
1258
|
throw new Error(`Server responded with ${g.status}.`);
|
|
1257
|
-
const
|
|
1258
|
-
if (
|
|
1259
|
+
const R = await g.json();
|
|
1260
|
+
if (R != null && R.payload && t(6, oe = R.payload), de("serververification", R), I && R.classification === "BAD")
|
|
1259
1261
|
throw new Error("SpamFilter returned negative classification.");
|
|
1260
1262
|
}
|
|
1261
1263
|
function ke(r) {
|
|
1262
|
-
k("expire", r),
|
|
1263
|
-
}
|
|
1264
|
-
function We(r) {
|
|
1265
|
-
k("floating", r), N !== r && (t(9, E.style.left = "", E), t(9, E.style.top = "", E)), t(1, N = r === !0 || r === "" ? "auto" : r === !1 || r === "false" ? void 0 : N), N ? (f || t(0, f = "onsubmit"), document.addEventListener("scroll", Ye), document.addEventListener("click", He), window.addEventListener("resize", Pe)) : f === "onsubmit" && t(0, f = void 0);
|
|
1264
|
+
k("expire", r), J && (clearTimeout(J), J = null), r < 1 ? Ze() : J = setTimeout(Ze, r);
|
|
1266
1265
|
}
|
|
1267
1266
|
function Ue(r) {
|
|
1267
|
+
k("floating", r), z !== r && (t(9, E.style.left = "", E), t(9, E.style.top = "", E)), t(1, z = r === !0 || r === "" ? "auto" : r === !1 || r === "false" ? void 0 : z), z ? (f || t(0, f = "onsubmit"), document.addEventListener("scroll", We), document.addEventListener("click", Ye), window.addEventListener("resize", Me)) : f === "onsubmit" && t(0, f = void 0);
|
|
1268
|
+
}
|
|
1269
|
+
function He(r) {
|
|
1268
1270
|
if (!r.algorithm)
|
|
1269
1271
|
throw new Error("Invalid challenge. Property algorithm is missing.");
|
|
1270
1272
|
if (r.signature === void 0)
|
|
1271
1273
|
throw new Error("Invalid challenge. Property signature is missing.");
|
|
1272
|
-
if (!
|
|
1273
|
-
throw new Error(`Unknown algorithm value. Allowed values: ${
|
|
1274
|
+
if (!Ne.includes(r.algorithm.toUpperCase()))
|
|
1275
|
+
throw new Error(`Unknown algorithm value. Allowed values: ${Ne.join(", ")}`);
|
|
1274
1276
|
if (!r.challenge || r.challenge.length < 40)
|
|
1275
1277
|
throw new Error("Challenge is too short. Min. 40 chars.");
|
|
1276
1278
|
if (!r.salt || r.salt.length < 10)
|
|
1277
1279
|
throw new Error("Salt is too short. Min. 10 chars.");
|
|
1278
1280
|
}
|
|
1279
|
-
async function
|
|
1281
|
+
async function Be(r) {
|
|
1280
1282
|
let c = null;
|
|
1281
1283
|
if ("Worker" in window) {
|
|
1282
1284
|
try {
|
|
1283
|
-
c = await
|
|
1285
|
+
c = await At(r, r.maxnumber);
|
|
1284
1286
|
} catch (g) {
|
|
1285
1287
|
k(g);
|
|
1286
1288
|
}
|
|
@@ -1288,76 +1290,76 @@ function Zn(n, e, t) {
|
|
|
1288
1290
|
return { data: r, solution: c };
|
|
1289
1291
|
}
|
|
1290
1292
|
if ("obfuscated" in r) {
|
|
1291
|
-
const g = await
|
|
1293
|
+
const g = await In(r.obfuscated, r.key, r.maxnumber);
|
|
1292
1294
|
return { data: r, solution: await g.promise };
|
|
1293
1295
|
}
|
|
1294
1296
|
return {
|
|
1295
1297
|
data: r,
|
|
1296
|
-
solution: await kn(r.challenge, r.salt, r.algorithm, r.maxnumber ||
|
|
1298
|
+
solution: await kn(r.challenge, r.salt, r.algorithm, r.maxnumber || D).promise
|
|
1297
1299
|
};
|
|
1298
1300
|
}
|
|
1299
|
-
async function
|
|
1300
|
-
const
|
|
1301
|
+
async function At(r, c = typeof b == "number" ? b : D, g = Math.ceil(le)) {
|
|
1302
|
+
const R = [];
|
|
1301
1303
|
g = Math.min(16, Math.max(1, g));
|
|
1302
|
-
for (let
|
|
1303
|
-
|
|
1304
|
-
const
|
|
1305
|
-
const
|
|
1306
|
-
return new Promise((
|
|
1307
|
-
|
|
1304
|
+
for (let X = 0; X < g; X++)
|
|
1305
|
+
R.push(altchaCreateWorker(ue));
|
|
1306
|
+
const U = Math.ceil(c / g), j = await Promise.all(R.map((X, p) => {
|
|
1307
|
+
const H = p * U;
|
|
1308
|
+
return new Promise((Re) => {
|
|
1309
|
+
X.addEventListener("message", (be) => {
|
|
1308
1310
|
if (be.data)
|
|
1309
|
-
for (const ye of
|
|
1310
|
-
ye !==
|
|
1311
|
-
|
|
1312
|
-
}),
|
|
1311
|
+
for (const ye of R)
|
|
1312
|
+
ye !== X && ye.postMessage({ type: "abort" });
|
|
1313
|
+
Re(be.data);
|
|
1314
|
+
}), X.postMessage({
|
|
1313
1315
|
payload: r,
|
|
1314
|
-
max:
|
|
1315
|
-
start:
|
|
1316
|
+
max: H + U,
|
|
1317
|
+
start: H,
|
|
1316
1318
|
type: "work"
|
|
1317
1319
|
});
|
|
1318
1320
|
});
|
|
1319
1321
|
}));
|
|
1320
|
-
for (const
|
|
1321
|
-
|
|
1322
|
-
return
|
|
1322
|
+
for (const X of R)
|
|
1323
|
+
X.terminate();
|
|
1324
|
+
return j.find((X) => !!X) || null;
|
|
1323
1325
|
}
|
|
1324
1326
|
async function ge() {
|
|
1325
1327
|
if (!x) {
|
|
1326
|
-
t(7,
|
|
1328
|
+
t(7, C = m.ERROR);
|
|
1327
1329
|
return;
|
|
1328
1330
|
}
|
|
1329
1331
|
const r = te.find((c) => c.constructor.pluginName === "obfuscation");
|
|
1330
1332
|
if (!r || !("clarify" in r)) {
|
|
1331
|
-
t(7,
|
|
1333
|
+
t(7, C = m.ERROR), k("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");
|
|
1332
1334
|
return;
|
|
1333
1335
|
}
|
|
1334
1336
|
if ("clarify" in r && typeof r.clarify == "function")
|
|
1335
1337
|
return r.clarify();
|
|
1336
1338
|
}
|
|
1337
|
-
function
|
|
1338
|
-
r.obfuscated !== void 0 && t(24, x = r.obfuscated), r.auto !== void 0 && (t(0, f = r.auto), f === "onload" && (x ? ge() : ne())), r.blockspam !== void 0 && t(16,
|
|
1339
|
+
function De(r) {
|
|
1340
|
+
r.obfuscated !== void 0 && t(24, x = r.obfuscated), r.auto !== void 0 && (t(0, f = r.auto), f === "onload" && (x ? ge() : ne())), r.blockspam !== void 0 && t(16, I = !!r.blockspam), r.floatinganchor !== void 0 && t(20, O = r.floatinganchor), r.delay !== void 0 && t(18, M = r.delay), r.floatingoffset !== void 0 && t(21, K = r.floatingoffset), r.floating !== void 0 && Ue(r.floating), r.expire !== void 0 && (ke(r.expire), t(19, S = r.expire)), r.challenge && (He(r.challenge), o = r.challenge), r.challengeurl !== void 0 && t(15, v = r.challengeurl), r.debug !== void 0 && t(17, F = !!r.debug), r.hidefooter !== void 0 && t(2, Z = !!r.hidefooter), r.hidelogo !== void 0 && t(3, G = !!r.hidelogo), r.maxnumber !== void 0 && t(22, D = +r.maxnumber), r.mockerror !== void 0 && t(23, Y = !!r.mockerror), r.name !== void 0 && t(4, q = r.name), r.refetchonexpire !== void 0 && t(25, V = !!r.refetchonexpire), r.spamfilter !== void 0 && t(26, _ = typeof r.spamfilter == "object" ? r.spamfilter : !!r.spamfilter), r.strings && t(44, l = r.strings), r.test !== void 0 && t(27, b = typeof r.test == "number" ? r.test : !!r.test), r.verifyurl !== void 0 && t(28, ee = r.verifyurl), r.workers !== void 0 && t(29, le = +r.workers), r.workerurl !== void 0 && t(30, ue = r.workerurl);
|
|
1339
1341
|
}
|
|
1340
|
-
function
|
|
1342
|
+
function Je() {
|
|
1341
1343
|
return {
|
|
1342
1344
|
auto: f,
|
|
1343
|
-
blockspam:
|
|
1344
|
-
challengeurl:
|
|
1345
|
-
debug:
|
|
1346
|
-
delay:
|
|
1345
|
+
blockspam: I,
|
|
1346
|
+
challengeurl: v,
|
|
1347
|
+
debug: F,
|
|
1348
|
+
delay: M,
|
|
1347
1349
|
expire: S,
|
|
1348
|
-
floating:
|
|
1350
|
+
floating: z,
|
|
1349
1351
|
floatinganchor: O,
|
|
1350
|
-
floatingoffset:
|
|
1351
|
-
hidefooter:
|
|
1352
|
-
hidelogo:
|
|
1352
|
+
floatingoffset: K,
|
|
1353
|
+
hidefooter: Z,
|
|
1354
|
+
hidelogo: G,
|
|
1353
1355
|
name: q,
|
|
1354
|
-
maxnumber:
|
|
1355
|
-
mockerror:
|
|
1356
|
+
maxnumber: D,
|
|
1357
|
+
mockerror: Y,
|
|
1356
1358
|
obfuscated: x,
|
|
1357
|
-
refetchonexpire:
|
|
1359
|
+
refetchonexpire: V,
|
|
1358
1360
|
spamfilter: _,
|
|
1359
1361
|
strings: s,
|
|
1360
|
-
test:
|
|
1362
|
+
test: b,
|
|
1361
1363
|
verifyurl: ee,
|
|
1362
1364
|
workers: le,
|
|
1363
1365
|
workerurl: ue
|
|
@@ -1366,57 +1368,58 @@ function Zn(n, e, t) {
|
|
|
1366
1368
|
function Oe() {
|
|
1367
1369
|
return se;
|
|
1368
1370
|
}
|
|
1369
|
-
function
|
|
1371
|
+
function Xt(r) {
|
|
1370
1372
|
return te.find((c) => c.constructor.pluginName === r);
|
|
1371
1373
|
}
|
|
1372
|
-
function
|
|
1373
|
-
return
|
|
1374
|
+
function Ke() {
|
|
1375
|
+
return C;
|
|
1374
1376
|
}
|
|
1375
1377
|
function me(r = m.UNVERIFIED, c = null) {
|
|
1376
|
-
|
|
1378
|
+
J && (clearTimeout(J), J = null), t(8, re = !1), t(5, he = c), t(6, oe = null), t(7, C = r);
|
|
1377
1379
|
}
|
|
1378
1380
|
function $e(r) {
|
|
1379
1381
|
se = r;
|
|
1380
1382
|
}
|
|
1381
1383
|
function Qe(r, c = null) {
|
|
1382
|
-
t(7,
|
|
1384
|
+
t(7, C = r), t(5, he = c);
|
|
1383
1385
|
}
|
|
1384
1386
|
async function ne() {
|
|
1385
|
-
return me(m.VERIFYING), await new Promise((r) => setTimeout(r,
|
|
1387
|
+
return me(m.VERIFYING), await new Promise((r) => setTimeout(r, M || 0)), Ct().then((r) => (He(r), k("challenge", r), Be(r))).then(({ data: r, solution: c }) => {
|
|
1386
1388
|
if (k("solution", c), "challenge" in r && c && !("clearText" in c))
|
|
1387
1389
|
if ((c == null ? void 0 : c.number) !== void 0) {
|
|
1388
1390
|
if (ee)
|
|
1389
|
-
return
|
|
1390
|
-
t(6, oe =
|
|
1391
|
+
return Nt(Xe(r, c));
|
|
1392
|
+
t(6, oe = Xe(r, c)), k("payload", oe);
|
|
1391
1393
|
} else
|
|
1392
1394
|
throw k("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."), new Error("Unexpected result returned.");
|
|
1393
1395
|
}).then(() => {
|
|
1394
|
-
t(7,
|
|
1396
|
+
t(7, C = m.VERIFIED), k("verified"), cn().then(() => {
|
|
1395
1397
|
de("verified", { payload: oe });
|
|
1396
1398
|
});
|
|
1397
1399
|
}).catch((r) => {
|
|
1398
|
-
k(r), t(7,
|
|
1400
|
+
k(r), t(7, C = m.ERROR), t(5, he = r.message);
|
|
1399
1401
|
});
|
|
1400
1402
|
}
|
|
1401
|
-
function
|
|
1403
|
+
function Zt() {
|
|
1402
1404
|
re = this.checked, t(8, re);
|
|
1403
1405
|
}
|
|
1404
|
-
function
|
|
1405
|
-
|
|
1406
|
+
function Yt(r) {
|
|
1407
|
+
Ie[r ? "unshift" : "push"](() => {
|
|
1406
1408
|
ie = r, t(10, ie);
|
|
1407
1409
|
});
|
|
1408
1410
|
}
|
|
1409
|
-
function
|
|
1410
|
-
|
|
1411
|
+
function Wt(r) {
|
|
1412
|
+
Ie[r ? "unshift" : "push"](() => {
|
|
1411
1413
|
E = r, t(9, E);
|
|
1412
1414
|
});
|
|
1413
1415
|
}
|
|
1414
1416
|
return n.$$set = (r) => {
|
|
1415
|
-
"auto" in r && t(0, f = r.auto), "blockspam" in r && t(16,
|
|
1417
|
+
"auto" in r && t(0, f = r.auto), "blockspam" in r && t(16, I = r.blockspam), "challengeurl" in r && t(15, v = r.challengeurl), "challengejson" in r && t(31, P = r.challengejson), "debug" in r && t(17, F = r.debug), "delay" in r && t(18, M = r.delay), "expire" in r && t(19, S = r.expire), "floating" in r && t(1, z = r.floating), "floatinganchor" in r && t(20, O = r.floatinganchor), "floatingoffset" in r && t(21, K = r.floatingoffset), "hidefooter" in r && t(2, Z = r.hidefooter), "hidelogo" in r && t(3, G = r.hidelogo), "name" in r && t(4, q = r.name), "maxnumber" in r && t(22, D = r.maxnumber), "mockerror" in r && t(23, Y = r.mockerror), "obfuscated" in r && t(24, x = r.obfuscated), "plugins" in r && t(32, N = r.plugins), "refetchonexpire" in r && t(25, V = r.refetchonexpire), "spamfilter" in r && t(26, _ = r.spamfilter), "strings" in r && t(33, u = r.strings), "test" in r && t(27, b = r.test), "verifyurl" in r && t(28, ee = r.verifyurl), "workers" in r && t(29, le = r.workers), "workerurl" in r && t(30, ue = r.workerurl), "$$scope" in r && t(45, h = r.$$scope);
|
|
1416
1418
|
}, n.$$.update = () => {
|
|
1417
1419
|
n.$$.dirty[0] & /*challengeurl*/
|
|
1418
|
-
32768
|
|
1419
|
-
1 && (
|
|
1420
|
+
32768 | n.$$.dirty[1] & /*challengejson*/
|
|
1421
|
+
1 && t(12, i = P && new URL(P, location.origin).host.endsWith(".altcha.org") && !!(v != null && v.includes("apiKey=ckey_"))), n.$$.dirty[1] & /*challengejson*/
|
|
1422
|
+
1 && (o = P ? dt(P) : void 0), n.$$.dirty[1] & /*strings*/
|
|
1420
1423
|
4 && t(44, l = u ? dt(u) : {}), n.$$.dirty[1] & /*parsedStrings*/
|
|
1421
1424
|
8192 && t(11, s = {
|
|
1422
1425
|
ariaLinkLabel: ut,
|
|
@@ -1429,50 +1432,50 @@ function Zn(n, e, t) {
|
|
|
1429
1432
|
waitAlert: "Verifying... please wait.",
|
|
1430
1433
|
...l
|
|
1431
1434
|
}), n.$$.dirty[0] & /*payload, state*/
|
|
1432
|
-
192 && de("statechange", { payload: oe, state:
|
|
1435
|
+
192 && de("statechange", { payload: oe, state: C }), n.$$.dirty[0] & /*error*/
|
|
1433
1436
|
32 && St(), n.$$.dirty[0] & /*state*/
|
|
1434
|
-
128 &&
|
|
1437
|
+
128 && Gt();
|
|
1435
1438
|
}, [
|
|
1436
1439
|
f,
|
|
1437
|
-
|
|
1440
|
+
z,
|
|
1441
|
+
Z,
|
|
1438
1442
|
G,
|
|
1439
|
-
A,
|
|
1440
1443
|
q,
|
|
1441
1444
|
he,
|
|
1442
1445
|
oe,
|
|
1443
|
-
|
|
1446
|
+
C,
|
|
1444
1447
|
re,
|
|
1445
1448
|
E,
|
|
1446
1449
|
ie,
|
|
1447
1450
|
s,
|
|
1448
1451
|
i,
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1452
|
+
Vt,
|
|
1453
|
+
Fe,
|
|
1454
|
+
v,
|
|
1455
|
+
I,
|
|
1456
|
+
F,
|
|
1457
|
+
M,
|
|
1455
1458
|
S,
|
|
1456
1459
|
O,
|
|
1457
|
-
J,
|
|
1458
1460
|
K,
|
|
1459
|
-
|
|
1461
|
+
D,
|
|
1462
|
+
Y,
|
|
1460
1463
|
x,
|
|
1461
|
-
|
|
1464
|
+
V,
|
|
1462
1465
|
_,
|
|
1463
|
-
|
|
1466
|
+
b,
|
|
1464
1467
|
ee,
|
|
1465
1468
|
le,
|
|
1466
1469
|
ue,
|
|
1467
|
-
|
|
1468
|
-
|
|
1470
|
+
P,
|
|
1471
|
+
N,
|
|
1469
1472
|
u,
|
|
1470
1473
|
ge,
|
|
1471
|
-
|
|
1472
|
-
Be,
|
|
1473
|
-
Oe,
|
|
1474
|
-
Vt,
|
|
1474
|
+
De,
|
|
1475
1475
|
Je,
|
|
1476
|
+
Oe,
|
|
1477
|
+
Xt,
|
|
1478
|
+
Ke,
|
|
1476
1479
|
me,
|
|
1477
1480
|
$e,
|
|
1478
1481
|
Qe,
|
|
@@ -1480,19 +1483,19 @@ function Zn(n, e, t) {
|
|
|
1480
1483
|
l,
|
|
1481
1484
|
h,
|
|
1482
1485
|
d,
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
+
Zt,
|
|
1487
|
+
Yt,
|
|
1488
|
+
Wt
|
|
1486
1489
|
];
|
|
1487
1490
|
}
|
|
1488
|
-
class
|
|
1491
|
+
class Xn extends vn {
|
|
1489
1492
|
constructor(e) {
|
|
1490
1493
|
super(), bn(
|
|
1491
1494
|
this,
|
|
1492
1495
|
e,
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
+
An,
|
|
1497
|
+
Nn,
|
|
1498
|
+
Ht,
|
|
1496
1499
|
{
|
|
1497
1500
|
auto: 0,
|
|
1498
1501
|
blockspam: 16,
|
|
@@ -1529,7 +1532,7 @@ class Vn extends vn {
|
|
|
1529
1532
|
setState: 42,
|
|
1530
1533
|
verify: 43
|
|
1531
1534
|
},
|
|
1532
|
-
|
|
1535
|
+
Rn,
|
|
1533
1536
|
[-1, -1, -1]
|
|
1534
1537
|
);
|
|
1535
1538
|
}
|
|
@@ -1709,7 +1712,7 @@ class Vn extends vn {
|
|
|
1709
1712
|
}
|
|
1710
1713
|
}
|
|
1711
1714
|
customElements.define("altcha-widget", yn(
|
|
1712
|
-
|
|
1715
|
+
Xn,
|
|
1713
1716
|
{ auto: {}, blockspam: {}, challengeurl: {}, challengejson: {}, debug: { type: "Boolean" }, delay: {}, expire: {}, floating: {}, floatinganchor: {}, floatingoffset: {}, hidefooter: { type: "Boolean" }, hidelogo: { type: "Boolean" }, name: {}, maxnumber: {}, mockerror: { type: "Boolean" }, obfuscated: {}, plugins: {}, refetchonexpire: { type: "Boolean" }, spamfilter: { type: "Boolean" }, strings: {}, test: { type: "Boolean" }, verifyurl: {}, workers: {}, workerurl: {} },
|
|
1714
1717
|
["default"],
|
|
1715
1718
|
[
|
|
@@ -1726,8 +1729,8 @@ customElements.define("altcha-widget", yn(
|
|
|
1726
1729
|
],
|
|
1727
1730
|
!1
|
|
1728
1731
|
));
|
|
1729
|
-
globalThis.altchaCreateWorker = (n) => n ? new Worker(new URL(n)) : new
|
|
1732
|
+
globalThis.altchaCreateWorker = (n) => n ? new Worker(new URL(n)) : new Mt();
|
|
1730
1733
|
globalThis.altchaPlugins = globalThis.altchaPlugins || [];
|
|
1731
1734
|
export {
|
|
1732
|
-
|
|
1735
|
+
Xn as Altcha
|
|
1733
1736
|
};
|