altcha 0.6.6 → 0.6.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.d.ts +53 -24
- package/dist/altcha.js +50 -50
- package/dist/altcha.umd.cjs +2 -2
- package/dist_external/altcha.d.ts +53 -24
- package/dist_external/altcha.js +136 -136
- package/dist_external/altcha.umd.cjs +2 -2
- package/package.json +1 -1
package/dist/altcha.d.ts
CHANGED
|
@@ -3,9 +3,60 @@ export {};
|
|
|
3
3
|
declare module 'altcha';
|
|
4
4
|
|
|
5
5
|
declare global {
|
|
6
|
+
type AltchaState = 'error' | 'expired' | 'verified' | 'verifying' | 'unverified';
|
|
7
|
+
|
|
8
|
+
interface AltchaStateChangeEvent extends CustomEvent<{
|
|
9
|
+
payload?: string;
|
|
10
|
+
state: AltchaState;
|
|
11
|
+
}> {}
|
|
12
|
+
|
|
13
|
+
interface AltchaVerifiedEvent extends CustomEvent<{
|
|
14
|
+
payload: string;
|
|
15
|
+
}> {}
|
|
16
|
+
|
|
17
|
+
interface AltchaServerVerificationEvent extends CustomEvent<Record<string, unknown>> {}
|
|
18
|
+
|
|
19
|
+
interface AltchaWidget {
|
|
20
|
+
auto?: 'onfocus' | 'onload' | 'onsubmit';
|
|
21
|
+
blockspam?: boolean;
|
|
22
|
+
challengeurl?: string;
|
|
23
|
+
challengejson?: string;
|
|
24
|
+
debug?: boolean;
|
|
25
|
+
delay?: number;
|
|
26
|
+
expire?: number;
|
|
27
|
+
floating?: 'auto' | 'top' | 'bottom' | 'false' | '' | boolean;
|
|
28
|
+
floatinganchor?: string;
|
|
29
|
+
floatingoffset?: number;
|
|
30
|
+
hidefooter?: boolean;
|
|
31
|
+
hidelogo?: boolean;
|
|
32
|
+
name?: string;
|
|
33
|
+
maxnumber?: number;
|
|
34
|
+
mockerror?: boolean;
|
|
35
|
+
refetchonexpire?: boolean;
|
|
36
|
+
spamfilter?: boolean | 'ipAddress';
|
|
37
|
+
strings?: string;
|
|
38
|
+
test?: boolean | number;
|
|
39
|
+
verifyurl?: string;
|
|
40
|
+
workers?: number;
|
|
41
|
+
workerurl?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
declare namespace svelteHTML {
|
|
45
|
+
interface IntrinsicElements {
|
|
46
|
+
'altcha-widget': AltchaWidgetSvelte;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface AltchaWidgetSvelte extends AltchaWidget {
|
|
50
|
+
'on:statechange'?: (event: AltchaStateChangeEvent) => void;
|
|
51
|
+
'on:serververification'?: (event: AltchaServerVerificationEvent) => void;
|
|
52
|
+
'on:verified'?: (event: AltchaVerifiedEvent) => void;
|
|
53
|
+
style?: string;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
6
57
|
namespace JSX {
|
|
7
58
|
interface IntrinsicElements {
|
|
8
|
-
'altcha-widget':
|
|
59
|
+
'altcha-widget': AltchaWidgetReact;
|
|
9
60
|
}
|
|
10
61
|
|
|
11
62
|
interface AltchaWidgetCSSProperties extends React.CSSProperties {
|
|
@@ -20,31 +71,9 @@ declare global {
|
|
|
20
71
|
'--altcha-max-width'?: string;
|
|
21
72
|
}
|
|
22
73
|
|
|
23
|
-
interface AltchaWidget extends React.HTMLAttributes<HTMLElement> {
|
|
24
|
-
auto?: 'onfocus' | 'onload' | 'onsubmit';
|
|
25
|
-
blockspam?: boolean;
|
|
26
|
-
challengeurl?: string;
|
|
27
|
-
challengejson?: string;
|
|
28
|
-
debug?: boolean;
|
|
29
|
-
delay?: number;
|
|
30
|
-
expire?: number;
|
|
31
|
-
floating?: 'auto' | 'top' | 'bottom' | 'false' | '' | boolean;
|
|
32
|
-
floatinganchor?: string;
|
|
33
|
-
floatingoffset?: number;
|
|
34
|
-
hidefooter?: boolean;
|
|
35
|
-
hidelogo?: boolean;
|
|
36
|
-
name?: string;
|
|
37
|
-
maxnumber?: number;
|
|
38
|
-
mockerror?: boolean;
|
|
74
|
+
interface AltchaWidgetReact extends AltchaWidget extends React.HTMLAttributes<HTMLElement> {
|
|
39
75
|
ref?: React.RefObject<HTMLElement>;
|
|
40
|
-
refetchonexpire?: boolean;
|
|
41
|
-
spamfilter?: boolean | 'ipAddress';
|
|
42
|
-
strings?: string;
|
|
43
76
|
style?: AltchaWidgetCSSProperties;
|
|
44
|
-
test?: boolean | number;
|
|
45
|
-
verifyurl?: string;
|
|
46
|
-
workers?: number;
|
|
47
|
-
workerurl?: string;
|
|
48
77
|
}
|
|
49
78
|
}
|
|
50
79
|
}
|
package/dist/altcha.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
var _t = Object.defineProperty;
|
|
2
2
|
var kt = (r, e, t) => e in r ? _t(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var U = (r, e, t) => kt(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
const tt = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IGY9bmV3IFRleHRFbmNvZGVyO2Z1bmN0aW9uIGQoZSl7cmV0dXJuWy4uLm5ldyBVaW50OEFycmF5KGUpXS5tYXAodD0+dC50b1N0cmluZygxNikucGFkU3RhcnQoMiwiMCIpKS5qb2luKCIiKX1hc3luYyBmdW5jdGlvbiBwKGUsdCxvKXtyZXR1cm4gZChhd2FpdCBjcnlwdG8uc3VidGxlLmRpZ2VzdChvLnRvVXBwZXJDYXNlKCksZi5lbmNvZGUoZSt0KSkpfWZ1bmN0aW9uIGcoZSx0LG89IlNIQS0yNTYiLGw9MWU2LGM9MCl7Y29uc3QgYT1uZXcgQWJvcnRDb250cm9sbGVyLGk9RGF0ZS5ub3coKTtyZXR1cm57cHJvbWlzZTooYXN5bmMoKT0+e2ZvcihsZXQgbj1jO248PWw7bis9MSl7aWYoYS5zaWduYWwuYWJvcnRlZClyZXR1cm4gbnVsbDtpZihhd2FpdCBwKHQsbixvKT09PWUpcmV0dXJue251bWJlcjpuLHRvb2s6RGF0ZS5ub3coKS1pfX1yZXR1cm4gbnVsbH0pKCksY29udHJvbGxlcjphfX1sZXQgcjtvbm1lc3NhZ2U9YXN5bmMgZT0+e2NvbnN0e3R5cGU6dCxwYXlsb2FkOm99PWUuZGF0YTtpZih0PT09ImFib3J0IilyPT1udWxsfHxyLmFib3J0KCkscj12b2lkIDA7ZWxzZSBpZih0PT09IndvcmsiKXtjb25zdHthbGc6bCxjaGFsbGVuZ2U6YyxtYXg6YSxzYWx0Omksc3RhcnQ6dX09b3x8e30sbj1nKGMsaSxsLGEsdSk7cj1uLmNvbnRyb2xsZXIsbi5wcm9taXNlLnRoZW4ocz0+e3NlbGYucG9zdE1lc3NhZ2UocyYmey4uLnMsd29ya2VyOiEwfSl9KX19fSkoKTsK", xt = (r) => Uint8Array.from(atob(r), (e) => e.charCodeAt(0)), Be = typeof
|
|
4
|
+
const tt = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IGY9bmV3IFRleHRFbmNvZGVyO2Z1bmN0aW9uIGQoZSl7cmV0dXJuWy4uLm5ldyBVaW50OEFycmF5KGUpXS5tYXAodD0+dC50b1N0cmluZygxNikucGFkU3RhcnQoMiwiMCIpKS5qb2luKCIiKX1hc3luYyBmdW5jdGlvbiBwKGUsdCxvKXtyZXR1cm4gZChhd2FpdCBjcnlwdG8uc3VidGxlLmRpZ2VzdChvLnRvVXBwZXJDYXNlKCksZi5lbmNvZGUoZSt0KSkpfWZ1bmN0aW9uIGcoZSx0LG89IlNIQS0yNTYiLGw9MWU2LGM9MCl7Y29uc3QgYT1uZXcgQWJvcnRDb250cm9sbGVyLGk9RGF0ZS5ub3coKTtyZXR1cm57cHJvbWlzZTooYXN5bmMoKT0+e2ZvcihsZXQgbj1jO248PWw7bis9MSl7aWYoYS5zaWduYWwuYWJvcnRlZClyZXR1cm4gbnVsbDtpZihhd2FpdCBwKHQsbixvKT09PWUpcmV0dXJue251bWJlcjpuLHRvb2s6RGF0ZS5ub3coKS1pfX1yZXR1cm4gbnVsbH0pKCksY29udHJvbGxlcjphfX1sZXQgcjtvbm1lc3NhZ2U9YXN5bmMgZT0+e2NvbnN0e3R5cGU6dCxwYXlsb2FkOm99PWUuZGF0YTtpZih0PT09ImFib3J0IilyPT1udWxsfHxyLmFib3J0KCkscj12b2lkIDA7ZWxzZSBpZih0PT09IndvcmsiKXtjb25zdHthbGc6bCxjaGFsbGVuZ2U6YyxtYXg6YSxzYWx0Omksc3RhcnQ6dX09b3x8e30sbj1nKGMsaSxsLGEsdSk7cj1uLmNvbnRyb2xsZXIsbi5wcm9taXNlLnRoZW4ocz0+e3NlbGYucG9zdE1lc3NhZ2UocyYmey4uLnMsd29ya2VyOiEwfSl9KX19fSkoKTsK", xt = (r) => Uint8Array.from(atob(r), (e) => e.charCodeAt(0)), Be = typeof self < "u" && self.Blob && new Blob([xt(tt)], { type: "text/javascript;charset=utf-8" });
|
|
5
5
|
function Et(r) {
|
|
6
6
|
let e;
|
|
7
7
|
try {
|
|
8
|
-
if (e = Be && (
|
|
8
|
+
if (e = Be && (self.URL || self.webkitURL).createObjectURL(Be), !e) throw "";
|
|
9
9
|
const t = new Worker(e, {
|
|
10
10
|
name: r == null ? void 0 : r.name
|
|
11
11
|
});
|
|
12
12
|
return t.addEventListener("error", () => {
|
|
13
|
-
(
|
|
13
|
+
(self.URL || self.webkitURL).revokeObjectURL(e);
|
|
14
14
|
}), t;
|
|
15
15
|
} catch {
|
|
16
16
|
return new Worker(
|
|
@@ -20,7 +20,7 @@ function Et(r) {
|
|
|
20
20
|
}
|
|
21
21
|
);
|
|
22
22
|
} finally {
|
|
23
|
-
e && (
|
|
23
|
+
e && (self.URL || self.webkitURL).revokeObjectURL(e);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
function ie() {
|
|
@@ -69,7 +69,7 @@ function zt(r, e) {
|
|
|
69
69
|
e
|
|
70
70
|
), e.sheet;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function $(r, e, t) {
|
|
73
73
|
r.insertBefore(e, t || null);
|
|
74
74
|
}
|
|
75
75
|
function j(r) {
|
|
@@ -166,7 +166,7 @@ function y() {
|
|
|
166
166
|
try {
|
|
167
167
|
for (; te < re.length; ) {
|
|
168
168
|
const e = re[te];
|
|
169
|
-
te++, ce(e),
|
|
169
|
+
te++, ce(e), $t(e.$$);
|
|
170
170
|
}
|
|
171
171
|
} catch (e) {
|
|
172
172
|
throw re.length = 0, te = 0, e;
|
|
@@ -182,20 +182,20 @@ function y() {
|
|
|
182
182
|
We.pop()();
|
|
183
183
|
Ce = !1, Ee.clear(), ce(r);
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function $t(r) {
|
|
186
186
|
if (r.fragment !== null) {
|
|
187
187
|
r.update(), fe(r.before_update);
|
|
188
188
|
const e = r.dirty;
|
|
189
189
|
r.dirty = [-1], r.fragment && r.fragment.p(r.ctx, e), r.after_update.forEach(Le);
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function Dt(r) {
|
|
193
193
|
const e = [], t = [];
|
|
194
194
|
ne.forEach((i) => r.indexOf(i) === -1 ? e.push(i) : t.push(i)), t.forEach((i) => i()), ne = e;
|
|
195
195
|
}
|
|
196
|
-
const
|
|
196
|
+
const Ft = /* @__PURE__ */ new Set();
|
|
197
197
|
function Ut(r, e) {
|
|
198
|
-
r && r.i && (
|
|
198
|
+
r && r.i && (Ft.delete(r), r.i(e));
|
|
199
199
|
}
|
|
200
200
|
function Gt(r, e, t) {
|
|
201
201
|
const { fragment: i, after_update: o } = r.$$;
|
|
@@ -206,7 +206,7 @@ function Gt(r, e, t) {
|
|
|
206
206
|
}
|
|
207
207
|
function Xt(r, e) {
|
|
208
208
|
const t = r.$$;
|
|
209
|
-
t.fragment !== null && (
|
|
209
|
+
t.fragment !== null && (Dt(t.after_update), fe(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
|
|
210
210
|
}
|
|
211
211
|
function Bt(r, e) {
|
|
212
212
|
r.$$.dirty[0] === -1 && (re.push(r), ot(), r.$$.dirty.fill(0)), r.$$.dirty[e / 31 | 0] |= 1 << e % 31;
|
|
@@ -236,11 +236,11 @@ function Ht(r, e, t, i, o, l, c = null, a = [-1]) {
|
|
|
236
236
|
root: e.target || d.$$.root
|
|
237
237
|
};
|
|
238
238
|
c && c(f.root);
|
|
239
|
-
let
|
|
240
|
-
if (f.ctx = t ? t(r, e.props || {}, (N, G, ...
|
|
241
|
-
const k =
|
|
242
|
-
return f.ctx && o(f.ctx[N], f.ctx[N] = k) && (!f.skip_bound && f.bound[N] && f.bound[N](k),
|
|
243
|
-
}) : [], f.update(),
|
|
239
|
+
let F = !1;
|
|
240
|
+
if (f.ctx = t ? t(r, e.props || {}, (N, G, ...D) => {
|
|
241
|
+
const k = D.length ? D[0] : G;
|
|
242
|
+
return f.ctx && o(f.ctx[N], f.ctx[N] = k) && (!f.skip_bound && f.bound[N] && f.bound[N](k), F && Bt(r, N)), G;
|
|
243
|
+
}) : [], f.update(), F = !0, fe(f.before_update), f.fragment = i ? i(f.ctx) : !1, e.target) {
|
|
244
244
|
if (e.hydrate) {
|
|
245
245
|
const N = St(e.target);
|
|
246
246
|
f.fragment && f.fragment.l(N), N.forEach(j);
|
|
@@ -300,8 +300,8 @@ typeof HTMLElement == "function" && (lt = class extends HTMLElement {
|
|
|
300
300
|
* @param {HTMLElement} target
|
|
301
301
|
* @param {HTMLElement} [anchor]
|
|
302
302
|
*/
|
|
303
|
-
m: function(f,
|
|
304
|
-
|
|
303
|
+
m: function(f, F) {
|
|
304
|
+
$(f, c, F);
|
|
305
305
|
},
|
|
306
306
|
d: function(f) {
|
|
307
307
|
f && j(c);
|
|
@@ -361,7 +361,7 @@ typeof HTMLElement == "function" && (lt = class extends HTMLElement {
|
|
|
361
361
|
}
|
|
362
362
|
disconnectedCallback() {
|
|
363
363
|
this.$$cn = !1, Promise.resolve().then(() => {
|
|
364
|
-
this.$$cn
|
|
364
|
+
!this.$$cn && this.$$c && (this.$$c.$destroy(), this.$$c = void 0);
|
|
365
365
|
});
|
|
366
366
|
}
|
|
367
367
|
$$g_p(e) {
|
|
@@ -428,7 +428,7 @@ function Ot(r, e, t, i, o, l) {
|
|
|
428
428
|
return (d = this.$$c) == null ? void 0 : d[a];
|
|
429
429
|
}
|
|
430
430
|
});
|
|
431
|
-
}),
|
|
431
|
+
}), r.element = /** @type {any} */
|
|
432
432
|
c, c;
|
|
433
433
|
}
|
|
434
434
|
class Wt {
|
|
@@ -531,7 +531,7 @@ function Pe(r) {
|
|
|
531
531
|
e = O("svg"), t = O("path"), i = O("path"), s(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"), s(t, "fill", "currentColor"), s(t, "opacity", ".25"), s(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"), s(i, "fill", "currentColor"), s(i, "class", "altcha-spinner svelte-ddsc3z"), s(e, "width", "24"), s(e, "height", "24"), s(e, "viewBox", "0 0 24 24"), s(e, "xmlns", "http://www.w3.org/2000/svg");
|
|
532
532
|
},
|
|
533
533
|
m(o, l) {
|
|
534
|
-
|
|
534
|
+
$(o, e, l), _(e, t), _(e, i);
|
|
535
535
|
},
|
|
536
536
|
d(o) {
|
|
537
537
|
o && j(e);
|
|
@@ -549,7 +549,7 @@ function er(r) {
|
|
|
549
549
|
r[4] + "_checkbox"), s(e, "class", "svelte-ddsc3z");
|
|
550
550
|
},
|
|
551
551
|
m(o, l) {
|
|
552
|
-
|
|
552
|
+
$(o, e, l), e.innerHTML = t;
|
|
553
553
|
},
|
|
554
554
|
p(o, l) {
|
|
555
555
|
l[0] & /*_strings*/
|
|
@@ -573,7 +573,7 @@ function tr(r) {
|
|
|
573
573
|
e = A("span");
|
|
574
574
|
},
|
|
575
575
|
m(i, o) {
|
|
576
|
-
|
|
576
|
+
$(i, e, o), e.innerHTML = t;
|
|
577
577
|
},
|
|
578
578
|
p(i, o) {
|
|
579
579
|
o[0] & /*_strings*/
|
|
@@ -601,7 +601,7 @@ function rr(r) {
|
|
|
601
601
|
r[5];
|
|
602
602
|
},
|
|
603
603
|
m(l, c) {
|
|
604
|
-
|
|
604
|
+
$(l, e, c), e.innerHTML = t, $(l, i, c), $(l, o, c);
|
|
605
605
|
},
|
|
606
606
|
p(l, c) {
|
|
607
607
|
c[0] & /*_strings*/
|
|
@@ -629,7 +629,7 @@ function Ye(r) {
|
|
|
629
629
|
r[11].ariaLinkLabel);
|
|
630
630
|
},
|
|
631
631
|
m(d, f) {
|
|
632
|
-
|
|
632
|
+
$(d, e, f), _(e, t), _(t, i), _(i, o), _(i, l), _(i, c);
|
|
633
633
|
},
|
|
634
634
|
p(d, f) {
|
|
635
635
|
f[0] & /*_strings*/
|
|
@@ -655,7 +655,7 @@ function Ke(r) {
|
|
|
655
655
|
e = A("div"), t = O("svg"), i = O("path"), o = Y(), a.c(), s(i, "stroke-linecap", "round"), s(i, "stroke-linejoin", "round"), s(i, "d", "M6 18L18 6M6 6l12 12"), s(t, "width", "14"), s(t, "height", "14"), s(t, "xmlns", "http://www.w3.org/2000/svg"), s(t, "fill", "none"), s(t, "viewBox", "0 0 24 24"), s(t, "stroke-width", "1.5"), s(t, "stroke", "currentColor"), s(e, "class", "altcha-error svelte-ddsc3z");
|
|
656
656
|
},
|
|
657
657
|
m(d, f) {
|
|
658
|
-
|
|
658
|
+
$(d, e, f), _(e, t), _(t, i), _(e, o), a.m(e, null);
|
|
659
659
|
},
|
|
660
660
|
p(d, f) {
|
|
661
661
|
c === (c = l(d)) && a ? a.p(d, f) : (a.d(1), a = c(d), a && (a.c(), a.m(e, null)));
|
|
@@ -680,7 +680,7 @@ function nr(r) {
|
|
|
680
680
|
);
|
|
681
681
|
},
|
|
682
682
|
m(i, o) {
|
|
683
|
-
|
|
683
|
+
$(i, e, o), e.innerHTML = t;
|
|
684
684
|
},
|
|
685
685
|
p(i, o) {
|
|
686
686
|
o[0] & /*_strings*/
|
|
@@ -713,7 +713,7 @@ function ir(r) {
|
|
|
713
713
|
);
|
|
714
714
|
},
|
|
715
715
|
m(i, o) {
|
|
716
|
-
|
|
716
|
+
$(i, e, o), e.innerHTML = t;
|
|
717
717
|
},
|
|
718
718
|
p(i, o) {
|
|
719
719
|
o[0] & /*_strings*/
|
|
@@ -741,7 +741,7 @@ function Je(r) {
|
|
|
741
741
|
e = A("div"), t = A("div"), s(t, "class", "svelte-ddsc3z"), s(e, "class", "altcha-footer svelte-ddsc3z");
|
|
742
742
|
},
|
|
743
743
|
m(o, l) {
|
|
744
|
-
|
|
744
|
+
$(o, e, l), _(e, t), t.innerHTML = i;
|
|
745
745
|
},
|
|
746
746
|
p(o, l) {
|
|
747
747
|
l[0] & /*_strings*/
|
|
@@ -760,7 +760,7 @@ function qe(r) {
|
|
|
760
760
|
e = A("div"), s(e, "class", "altcha-anchor-arrow svelte-ddsc3z");
|
|
761
761
|
},
|
|
762
762
|
m(t, i) {
|
|
763
|
-
|
|
763
|
+
$(t, e, i), r[37](e);
|
|
764
764
|
},
|
|
765
765
|
p: ie,
|
|
766
766
|
d(t) {
|
|
@@ -769,7 +769,7 @@ function qe(r) {
|
|
|
769
769
|
};
|
|
770
770
|
}
|
|
771
771
|
function or(r) {
|
|
772
|
-
let e, t, i, o, l, c, a, d, f,
|
|
772
|
+
let e, t, i, o, l, c, a, d, f, F, N, G, D, k, W, S = (
|
|
773
773
|
/*state*/
|
|
774
774
|
r[6] === b.VERIFYING && Pe()
|
|
775
775
|
);
|
|
@@ -801,7 +801,7 @@ function or(r) {
|
|
|
801
801
|
);
|
|
802
802
|
return {
|
|
803
803
|
c() {
|
|
804
|
-
e = A("div"), t = A("div"), S && S.c(), i = Y(), o = A("div"), l = A("input"), d = Y(), f = A("div"), M.c(),
|
|
804
|
+
e = A("div"), t = A("div"), S && S.c(), i = Y(), o = A("div"), l = A("input"), d = Y(), f = A("div"), M.c(), F = Y(), E && E.c(), N = Y(), R && R.c(), G = Y(), I && I.c(), D = Y(), w && w.c(), s(l, "type", "checkbox"), s(l, "id", c = /*name*/
|
|
805
805
|
r[4] + "_checkbox"), l.required = a = /*auto*/
|
|
806
806
|
r[0] !== "onsubmit", s(l, "class", "svelte-ddsc3z"), s(o, "class", "altcha-checkbox svelte-ddsc3z"), Oe(
|
|
807
807
|
o,
|
|
@@ -821,8 +821,8 @@ function or(r) {
|
|
|
821
821
|
);
|
|
822
822
|
},
|
|
823
823
|
m(h, v) {
|
|
824
|
-
|
|
825
|
-
r[7], _(t, d), _(t, f), M.m(f, null), _(t,
|
|
824
|
+
$(h, e, v), _(e, t), S && S.m(t, null), _(t, i), _(t, o), _(o, l), l.checked = /*checked*/
|
|
825
|
+
r[7], _(t, d), _(t, f), M.m(f, null), _(t, F), E && E.m(t, null), _(e, N), R && R.m(e, null), _(e, G), I && I.m(e, null), _(e, D), w && w.m(e, null), r[38](e), k || (W = [
|
|
826
826
|
xe(
|
|
827
827
|
l,
|
|
828
828
|
"change",
|
|
@@ -864,7 +864,7 @@ function or(r) {
|
|
|
864
864
|
h[6] === b.EXPIRED ? R ? R.p(h, v) : (R = Ke(h), R.c(), R.m(e, G)) : R && (R.d(1), R = null), /*_strings*/
|
|
865
865
|
h[11].footer && /*hidefooter*/
|
|
866
866
|
(h[2] !== !0 || /*isFreeSaaS*/
|
|
867
|
-
h[12]) ? I ? I.p(h, v) : (I = Je(h), I.c(), I.m(e,
|
|
867
|
+
h[12]) ? I ? I.p(h, v) : (I = Je(h), I.c(), I.m(e, D)) : I && (I.d(1), I = null), /*floating*/
|
|
868
868
|
h[1] ? w ? w.p(h, v) : (w = qe(h), w.c(), w.m(e, null)) : w && (w.d(1), w = null), v[0] & /*state*/
|
|
869
869
|
64 && s(
|
|
870
870
|
e,
|
|
@@ -898,13 +898,13 @@ function lr() {
|
|
|
898
898
|
}
|
|
899
899
|
function sr(r, e, t) {
|
|
900
900
|
var Ge, Xe;
|
|
901
|
-
let i, o, l, c, { auto: a = void 0 } = e, { blockspam: d = void 0 } = e, { challengeurl: f = void 0 } = e, { challengejson:
|
|
901
|
+
let i, o, l, c, { auto: a = void 0 } = e, { blockspam: d = void 0 } = e, { challengeurl: f = void 0 } = e, { challengejson: F = void 0 } = e, { debug: N = !1 } = e, { delay: G = 0 } = e, { expire: D = void 0 } = e, { floating: k = void 0 } = e, { floatinganchor: W = void 0 } = e, { floatingoffset: S = void 0 } = e, { hidefooter: K = !1 } = e, { hidelogo: H = !1 } = e, { name: M = "altcha" } = e, { maxnumber: E = 1e6 } = e, { mockerror: R = !1 } = e, { refetchonexpire: I = !0 } = e, { spamfilter: w = !1 } = e, { strings: h = void 0 } = e, { test: v = !1 } = e, { verifyurl: J = void 0 } = e, { workers: oe = Math.min(16, navigator.hardwareConcurrency || 8) } = e, { workerurl: ue = void 0 } = e;
|
|
902
902
|
const ye = Tt(), Ie = ["SHA-256", "SHA-384", "SHA-512"], ze = (Xe = (Ge = document.documentElement.lang) == null ? void 0 : Ge.split("-")) == null ? void 0 : Xe[0];
|
|
903
903
|
let P = !1, C, q = null, de = null, m = null, pe = null, Q = null, T = b.UNVERIFIED, X = null;
|
|
904
904
|
Mt(() => {
|
|
905
|
-
m && (m.removeEventListener("submit", Se), m.removeEventListener("reset", Ne), m.removeEventListener("focusin", Ae), m = null), X && (clearTimeout(X), X = null), document.removeEventListener("click", Te), document.removeEventListener("scroll", Ve), window.removeEventListener("resize",
|
|
905
|
+
m && (m.removeEventListener("submit", Se), m.removeEventListener("reset", Ne), m.removeEventListener("focusin", Ae), m = null), X && (clearTimeout(X), X = null), document.removeEventListener("click", Te), document.removeEventListener("scroll", Ve), window.removeEventListener("resize", De);
|
|
906
906
|
}), jt(() => {
|
|
907
|
-
x("mounted", "0.6.
|
|
907
|
+
x("mounted", "0.6.7"), x("workers", oe), v && x("using test mode"), D && he(D), a !== void 0 && x("auto", a), k !== void 0 && Fe(k), m = C.closest("form"), m && (m.addEventListener("submit", Se, { capture: !0 }), m.addEventListener("reset", Ne), a === "onfocus" && m.addEventListener("focusin", Ae)), a === "onload" && ee(), i && (K || H) && x("Attributes hidefooter and hidelogo ignored because usage with free API Keys require attribution.");
|
|
908
908
|
});
|
|
909
909
|
function x(...n) {
|
|
910
910
|
(N || n.some((u) => u instanceof Error)) && console[n[0] instanceof Error ? "error" : "log"]("ALTCHA", ...n);
|
|
@@ -915,7 +915,7 @@ function sr(r, e, t) {
|
|
|
915
915
|
function Se(n) {
|
|
916
916
|
m && a === "onsubmit" && (T === b.UNVERIFIED ? (n.preventDefault(), n.stopPropagation(), ee().then(() => {
|
|
917
917
|
m == null || m.requestSubmit();
|
|
918
|
-
})) : T !== b.VERIFIED && (n.preventDefault(), n.stopPropagation(), T === b.VERIFYING &&
|
|
918
|
+
})) : T !== b.VERIFIED && (n.preventDefault(), n.stopPropagation(), T === b.VERIFYING && $e()));
|
|
919
919
|
}
|
|
920
920
|
function Ne() {
|
|
921
921
|
ge();
|
|
@@ -974,7 +974,7 @@ function sr(r, e, t) {
|
|
|
974
974
|
} catch (p) {
|
|
975
975
|
x("unable to configure from X-Altcha-Config", p);
|
|
976
976
|
}
|
|
977
|
-
if (!
|
|
977
|
+
if (!D && (g != null && g.length)) {
|
|
978
978
|
const p = Date.parse(g);
|
|
979
979
|
if (p) {
|
|
980
980
|
const L = p - Date.now();
|
|
@@ -1042,7 +1042,7 @@ function sr(r, e, t) {
|
|
|
1042
1042
|
function Ve() {
|
|
1043
1043
|
k && _e();
|
|
1044
1044
|
}
|
|
1045
|
-
function
|
|
1045
|
+
function $e() {
|
|
1046
1046
|
T === b.VERIFYING && c.waitAlert && alert(c.waitAlert);
|
|
1047
1047
|
}
|
|
1048
1048
|
function ht(n) {
|
|
@@ -1050,14 +1050,14 @@ function sr(r, e, t) {
|
|
|
1050
1050
|
_e();
|
|
1051
1051
|
});
|
|
1052
1052
|
}
|
|
1053
|
-
function
|
|
1053
|
+
function De() {
|
|
1054
1054
|
k && _e();
|
|
1055
1055
|
}
|
|
1056
1056
|
function he(n) {
|
|
1057
1057
|
x("expire", n), X && (clearTimeout(X), X = null), n < 1 ? Me() : X = setTimeout(Me, n);
|
|
1058
1058
|
}
|
|
1059
|
-
function
|
|
1060
|
-
x("floating", n), k !== n && (t(8, C.style.left = "", C), t(8, C.style.top = "", C)), t(1, k = n === !0 || n === "" ? "auto" : n === !1 || n === "false" ? void 0 : k), k ? (a || t(0, a = "onsubmit"), document.addEventListener("scroll", Ve), document.addEventListener("click", Te), window.addEventListener("resize",
|
|
1059
|
+
function Fe(n) {
|
|
1060
|
+
x("floating", n), k !== n && (t(8, C.style.left = "", C), t(8, C.style.top = "", C)), t(1, k = n === !0 || n === "" ? "auto" : n === !1 || n === "false" ? void 0 : k), k ? (a || t(0, a = "onsubmit"), document.addEventListener("scroll", Ve), document.addEventListener("click", Te), window.addEventListener("resize", De)) : a === "onsubmit" && t(0, a = void 0);
|
|
1061
1061
|
}
|
|
1062
1062
|
function gt(n) {
|
|
1063
1063
|
var g;
|
|
@@ -1133,7 +1133,7 @@ function sr(r, e, t) {
|
|
|
1133
1133
|
x("unable to find floating anchor element");
|
|
1134
1134
|
}
|
|
1135
1135
|
function Ue(n) {
|
|
1136
|
-
n.auto !== void 0 && (t(0, a = n.auto), a === "onload" && ee()), n.floatinganchor !== void 0 && t(19, W = n.floatinganchor), n.delay !== void 0 && t(17, G = n.delay), n.floatingoffset !== void 0 && t(20, S = n.floatingoffset), n.floating !== void 0 &&
|
|
1136
|
+
n.auto !== void 0 && (t(0, a = n.auto), a === "onload" && ee()), n.floatinganchor !== void 0 && t(19, W = n.floatinganchor), n.delay !== void 0 && t(17, G = n.delay), n.floatingoffset !== void 0 && t(20, S = n.floatingoffset), n.floating !== void 0 && Fe(n.floating), n.expire !== void 0 && (he(n.expire), t(18, D = n.expire)), n.challenge && (je(n.challenge), o = n.challenge), n.challengeurl !== void 0 && t(15, f = n.challengeurl), n.debug !== void 0 && t(16, N = !!n.debug), n.hidefooter !== void 0 && t(2, K = !!n.hidefooter), n.hidelogo !== void 0 && t(3, H = !!n.hidelogo), n.maxnumber !== void 0 && t(21, E = +n.maxnumber), n.mockerror !== void 0 && t(22, R = !!n.mockerror), n.name !== void 0 && t(4, M = n.name), n.refetchonexpire !== void 0 && t(23, I = !!n.refetchonexpire), n.spamfilter !== void 0 && t(24, w = typeof n.spamfilter == "object" ? n.spamfilter : !!n.spamfilter), n.strings && t(35, l = n.strings), n.test !== void 0 && t(25, v = typeof n.test == "number" ? n.test : !!n.test), n.verifyurl !== void 0 && t(26, J = n.verifyurl), n.workers !== void 0 && t(27, oe = +n.workers), n.workerurl !== void 0 && t(28, ue = n.workerurl);
|
|
1137
1137
|
}
|
|
1138
1138
|
function ge(n = b.UNVERIFIED, u = null) {
|
|
1139
1139
|
X && (clearTimeout(X), X = null), t(7, P = !1), t(10, pe = u), t(5, Q = null), t(6, T = n);
|
|
@@ -1168,11 +1168,11 @@ function sr(r, e, t) {
|
|
|
1168
1168
|
});
|
|
1169
1169
|
}
|
|
1170
1170
|
return r.$$set = (n) => {
|
|
1171
|
-
"auto" in n && t(0, a = n.auto), "blockspam" in n && t(29, d = n.blockspam), "challengeurl" in n && t(15, f = n.challengeurl), "challengejson" in n && t(30,
|
|
1171
|
+
"auto" in n && t(0, a = n.auto), "blockspam" in n && t(29, d = n.blockspam), "challengeurl" in n && t(15, f = n.challengeurl), "challengejson" in n && t(30, F = n.challengejson), "debug" in n && t(16, N = n.debug), "delay" in n && t(17, G = n.delay), "expire" in n && t(18, D = n.expire), "floating" in n && t(1, k = n.floating), "floatinganchor" in n && t(19, W = n.floatinganchor), "floatingoffset" in n && t(20, S = n.floatingoffset), "hidefooter" in n && t(2, K = n.hidefooter), "hidelogo" in n && t(3, H = n.hidelogo), "name" in n && t(4, M = n.name), "maxnumber" in n && t(21, E = n.maxnumber), "mockerror" in n && t(22, R = n.mockerror), "refetchonexpire" in n && t(23, I = n.refetchonexpire), "spamfilter" in n && t(24, w = n.spamfilter), "strings" in n && t(31, h = n.strings), "test" in n && t(25, v = n.test), "verifyurl" in n && t(26, J = n.verifyurl), "workers" in n && t(27, oe = n.workers), "workerurl" in n && t(28, ue = n.workerurl);
|
|
1172
1172
|
}, r.$$.update = () => {
|
|
1173
1173
|
r.$$.dirty[0] & /*challengeurl*/
|
|
1174
1174
|
32768 && t(12, i = !!(f != null && f.includes(".altcha.org")) && !!(f != null && f.includes("apiKey=ckey_"))), r.$$.dirty[0] & /*challengejson*/
|
|
1175
|
-
1073741824 && (o =
|
|
1175
|
+
1073741824 && (o = F ? et(F) : void 0), r.$$.dirty[1] & /*strings*/
|
|
1176
1176
|
1 && t(35, l = h ? et(h) : {}), r.$$.dirty[1] & /*parsedStrings*/
|
|
1177
1177
|
16 && t(11, c = {
|
|
1178
1178
|
ariaLinkLabel: Qe,
|
|
@@ -1202,11 +1202,11 @@ function sr(r, e, t) {
|
|
|
1202
1202
|
c,
|
|
1203
1203
|
i,
|
|
1204
1204
|
dt,
|
|
1205
|
-
|
|
1205
|
+
$e,
|
|
1206
1206
|
f,
|
|
1207
1207
|
N,
|
|
1208
1208
|
G,
|
|
1209
|
-
|
|
1209
|
+
D,
|
|
1210
1210
|
W,
|
|
1211
1211
|
S,
|
|
1212
1212
|
E,
|
|
@@ -1218,7 +1218,7 @@ function sr(r, e, t) {
|
|
|
1218
1218
|
oe,
|
|
1219
1219
|
ue,
|
|
1220
1220
|
d,
|
|
1221
|
-
|
|
1221
|
+
F,
|
|
1222
1222
|
h,
|
|
1223
1223
|
Ue,
|
|
1224
1224
|
ge,
|