altcha 0.6.7 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -12
- package/dist/altcha.d.ts +2 -0
- package/dist/altcha.js +851 -687
- package/dist/altcha.umd.cjs +2 -2
- package/dist_external/altcha.d.ts +2 -0
- package/dist_external/altcha.js +829 -665
- package/dist_external/altcha.umd.cjs +2 -2
- package/package.json +1 -1
package/dist_external/altcha.js
CHANGED
|
@@ -1,63 +1,70 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
var Pt = Object.defineProperty;
|
|
2
|
+
var it = (n) => {
|
|
3
|
+
throw TypeError(n);
|
|
4
|
+
};
|
|
5
|
+
var Ut = (n, e, t) => e in n ? Pt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
6
|
+
var S = (n, e, t) => Ut(n, typeof e != "symbol" ? e + "" : e, t), rt = (n, e, t) => e.has(n) || it("Cannot " + t);
|
|
7
|
+
var U = (n, e, t) => (rt(n, e, "read from private field"), t ? t.call(n) : e.get(n)), re = (n, e, t) => e.has(n) ? it("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), ot = (n, e, t, r) => (rt(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t);
|
|
8
|
+
function ce() {
|
|
5
9
|
}
|
|
6
|
-
function
|
|
10
|
+
function wt(n) {
|
|
7
11
|
return n();
|
|
8
12
|
}
|
|
9
|
-
function
|
|
13
|
+
function st() {
|
|
10
14
|
return /* @__PURE__ */ Object.create(null);
|
|
11
15
|
}
|
|
12
|
-
function
|
|
13
|
-
n.forEach(
|
|
16
|
+
function ve(n) {
|
|
17
|
+
n.forEach(wt);
|
|
14
18
|
}
|
|
15
|
-
function
|
|
19
|
+
function _t(n) {
|
|
16
20
|
return typeof n == "function";
|
|
17
21
|
}
|
|
18
|
-
function
|
|
22
|
+
function Ot(n, e) {
|
|
19
23
|
return n != n ? e == e : n !== e || n && typeof n == "object" || typeof n == "function";
|
|
20
24
|
}
|
|
21
|
-
function
|
|
25
|
+
function Ht(n) {
|
|
22
26
|
return Object.keys(n).length === 0;
|
|
23
27
|
}
|
|
24
28
|
function p(n, e) {
|
|
25
29
|
n.appendChild(e);
|
|
26
30
|
}
|
|
27
|
-
function
|
|
31
|
+
function M(n, e, t) {
|
|
28
32
|
n.insertBefore(e, t || null);
|
|
29
33
|
}
|
|
30
34
|
function D(n) {
|
|
31
35
|
n.parentNode && n.parentNode.removeChild(n);
|
|
32
36
|
}
|
|
33
|
-
function
|
|
37
|
+
function F(n) {
|
|
34
38
|
return document.createElement(n);
|
|
35
39
|
}
|
|
36
|
-
function
|
|
40
|
+
function z(n) {
|
|
37
41
|
return document.createElementNS("http://www.w3.org/2000/svg", n);
|
|
38
42
|
}
|
|
39
|
-
function
|
|
43
|
+
function yt(n) {
|
|
40
44
|
return document.createTextNode(n);
|
|
41
45
|
}
|
|
42
|
-
function
|
|
43
|
-
return
|
|
46
|
+
function W() {
|
|
47
|
+
return yt(" ");
|
|
48
|
+
}
|
|
49
|
+
function $t() {
|
|
50
|
+
return yt("");
|
|
44
51
|
}
|
|
45
|
-
function
|
|
46
|
-
return n.addEventListener(e, t,
|
|
52
|
+
function Me(n, e, t, r) {
|
|
53
|
+
return n.addEventListener(e, t, r), () => n.removeEventListener(e, t, r);
|
|
47
54
|
}
|
|
48
|
-
function
|
|
55
|
+
function a(n, e, t) {
|
|
49
56
|
t == null ? n.removeAttribute(e) : n.getAttribute(e) !== t && n.setAttribute(e, t);
|
|
50
57
|
}
|
|
51
|
-
function
|
|
58
|
+
function qt(n) {
|
|
52
59
|
return Array.from(n.childNodes);
|
|
53
60
|
}
|
|
54
|
-
function
|
|
61
|
+
function lt(n, e, t) {
|
|
55
62
|
n.classList.toggle(e, !!t);
|
|
56
63
|
}
|
|
57
|
-
function
|
|
58
|
-
return new CustomEvent(n, { detail: e, bubbles: t, cancelable:
|
|
64
|
+
function Zt(n, e, { bubbles: t = !1, cancelable: r = !1 } = {}) {
|
|
65
|
+
return new CustomEvent(n, { detail: e, bubbles: t, cancelable: r });
|
|
59
66
|
}
|
|
60
|
-
function
|
|
67
|
+
function Yt(n) {
|
|
61
68
|
const e = {};
|
|
62
69
|
return n.childNodes.forEach(
|
|
63
70
|
/** @param {Element} node */
|
|
@@ -66,215 +73,215 @@ function Lt(n) {
|
|
|
66
73
|
}
|
|
67
74
|
), e;
|
|
68
75
|
}
|
|
69
|
-
let
|
|
70
|
-
function
|
|
71
|
-
|
|
76
|
+
let me;
|
|
77
|
+
function ge(n) {
|
|
78
|
+
me = n;
|
|
72
79
|
}
|
|
73
|
-
function
|
|
74
|
-
if (!
|
|
75
|
-
return
|
|
80
|
+
function Be() {
|
|
81
|
+
if (!me) throw new Error("Function called outside component initialization");
|
|
82
|
+
return me;
|
|
76
83
|
}
|
|
77
|
-
function
|
|
78
|
-
|
|
84
|
+
function Gt(n) {
|
|
85
|
+
Be().$$.on_mount.push(n);
|
|
79
86
|
}
|
|
80
|
-
function
|
|
81
|
-
|
|
87
|
+
function Jt(n) {
|
|
88
|
+
Be().$$.on_destroy.push(n);
|
|
82
89
|
}
|
|
83
|
-
function
|
|
84
|
-
const n =
|
|
85
|
-
return (e, t, { cancelable:
|
|
90
|
+
function Xt() {
|
|
91
|
+
const n = Be();
|
|
92
|
+
return (e, t, { cancelable: r = !1 } = {}) => {
|
|
86
93
|
const o = n.$$.callbacks[e];
|
|
87
94
|
if (o) {
|
|
88
|
-
const
|
|
95
|
+
const s = Zt(
|
|
89
96
|
/** @type {string} */
|
|
90
97
|
e,
|
|
91
98
|
t,
|
|
92
|
-
{ cancelable:
|
|
99
|
+
{ cancelable: r }
|
|
93
100
|
);
|
|
94
|
-
return o.slice().forEach((
|
|
95
|
-
|
|
96
|
-
}), !
|
|
101
|
+
return o.slice().forEach((u) => {
|
|
102
|
+
u.call(n, s);
|
|
103
|
+
}), !s.defaultPrevented;
|
|
97
104
|
}
|
|
98
105
|
return !0;
|
|
99
106
|
};
|
|
100
107
|
}
|
|
101
|
-
const
|
|
102
|
-
let
|
|
103
|
-
const
|
|
104
|
-
let
|
|
105
|
-
function
|
|
106
|
-
|
|
108
|
+
const se = [], Fe = [];
|
|
109
|
+
let le = [];
|
|
110
|
+
const at = [], vt = /* @__PURE__ */ Promise.resolve();
|
|
111
|
+
let je = !1;
|
|
112
|
+
function Et() {
|
|
113
|
+
je || (je = !0, vt.then(v));
|
|
107
114
|
}
|
|
108
|
-
function
|
|
109
|
-
return
|
|
115
|
+
function Wt() {
|
|
116
|
+
return Et(), vt;
|
|
110
117
|
}
|
|
111
|
-
function
|
|
112
|
-
|
|
118
|
+
function Ve(n) {
|
|
119
|
+
le.push(n);
|
|
113
120
|
}
|
|
114
|
-
const
|
|
115
|
-
let
|
|
116
|
-
function
|
|
117
|
-
if (
|
|
121
|
+
const Ne = /* @__PURE__ */ new Set();
|
|
122
|
+
let oe = 0;
|
|
123
|
+
function v() {
|
|
124
|
+
if (oe !== 0)
|
|
118
125
|
return;
|
|
119
|
-
const n =
|
|
126
|
+
const n = me;
|
|
120
127
|
do {
|
|
121
128
|
try {
|
|
122
|
-
for (;
|
|
123
|
-
const e =
|
|
124
|
-
|
|
129
|
+
for (; oe < se.length; ) {
|
|
130
|
+
const e = se[oe];
|
|
131
|
+
oe++, ge(e), zt(e.$$);
|
|
125
132
|
}
|
|
126
133
|
} catch (e) {
|
|
127
|
-
throw
|
|
134
|
+
throw se.length = 0, oe = 0, e;
|
|
128
135
|
}
|
|
129
|
-
for (
|
|
130
|
-
for (let e = 0; e <
|
|
131
|
-
const t =
|
|
132
|
-
|
|
136
|
+
for (ge(null), se.length = 0, oe = 0; Fe.length; ) Fe.pop()();
|
|
137
|
+
for (let e = 0; e < le.length; e += 1) {
|
|
138
|
+
const t = le[e];
|
|
139
|
+
Ne.has(t) || (Ne.add(t), t());
|
|
133
140
|
}
|
|
134
|
-
|
|
135
|
-
} while (
|
|
136
|
-
for (;
|
|
137
|
-
|
|
138
|
-
|
|
141
|
+
le.length = 0;
|
|
142
|
+
} while (se.length);
|
|
143
|
+
for (; at.length; )
|
|
144
|
+
at.pop()();
|
|
145
|
+
je = !1, Ne.clear(), ge(n);
|
|
139
146
|
}
|
|
140
|
-
function
|
|
147
|
+
function zt(n) {
|
|
141
148
|
if (n.fragment !== null) {
|
|
142
|
-
n.update(),
|
|
149
|
+
n.update(), ve(n.before_update);
|
|
143
150
|
const e = n.dirty;
|
|
144
|
-
n.dirty = [-1], n.fragment && n.fragment.p(n.ctx, e), n.after_update.forEach(
|
|
151
|
+
n.dirty = [-1], n.fragment && n.fragment.p(n.ctx, e), n.after_update.forEach(Ve);
|
|
145
152
|
}
|
|
146
153
|
}
|
|
147
|
-
function
|
|
154
|
+
function Kt(n) {
|
|
148
155
|
const e = [], t = [];
|
|
149
|
-
|
|
156
|
+
le.forEach((r) => n.indexOf(r) === -1 ? e.push(r) : t.push(r)), t.forEach((r) => r()), le = e;
|
|
150
157
|
}
|
|
151
|
-
const
|
|
152
|
-
function
|
|
153
|
-
n && n.i && (
|
|
158
|
+
const Qt = /* @__PURE__ */ new Set();
|
|
159
|
+
function en(n, e) {
|
|
160
|
+
n && n.i && (Qt.delete(n), n.i(e));
|
|
154
161
|
}
|
|
155
|
-
function
|
|
156
|
-
const { fragment:
|
|
157
|
-
|
|
158
|
-
const
|
|
159
|
-
n.$$.on_destroy ? n.$$.on_destroy.push(...
|
|
160
|
-
}), o.forEach(
|
|
162
|
+
function tn(n, e, t) {
|
|
163
|
+
const { fragment: r, after_update: o } = n.$$;
|
|
164
|
+
r && r.m(e, t), Ve(() => {
|
|
165
|
+
const s = n.$$.on_mount.map(wt).filter(_t);
|
|
166
|
+
n.$$.on_destroy ? n.$$.on_destroy.push(...s) : ve(s), n.$$.on_mount = [];
|
|
167
|
+
}), o.forEach(Ve);
|
|
161
168
|
}
|
|
162
|
-
function
|
|
169
|
+
function nn(n, e) {
|
|
163
170
|
const t = n.$$;
|
|
164
|
-
t.fragment !== null && (
|
|
171
|
+
t.fragment !== null && (Kt(t.after_update), ve(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
|
|
165
172
|
}
|
|
166
|
-
function
|
|
167
|
-
n.$$.dirty[0] === -1 && (
|
|
173
|
+
function rn(n, e) {
|
|
174
|
+
n.$$.dirty[0] === -1 && (se.push(n), Et(), n.$$.dirty.fill(0)), n.$$.dirty[e / 31 | 0] |= 1 << e % 31;
|
|
168
175
|
}
|
|
169
|
-
function
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
const
|
|
176
|
+
function on(n, e, t, r, o, s, u = null, f = [-1]) {
|
|
177
|
+
const l = me;
|
|
178
|
+
ge(n);
|
|
179
|
+
const c = n.$$ = {
|
|
173
180
|
fragment: null,
|
|
174
181
|
ctx: [],
|
|
175
182
|
// state
|
|
176
|
-
props:
|
|
177
|
-
update:
|
|
183
|
+
props: s,
|
|
184
|
+
update: ce,
|
|
178
185
|
not_equal: o,
|
|
179
|
-
bound:
|
|
186
|
+
bound: st(),
|
|
180
187
|
// lifecycle
|
|
181
188
|
on_mount: [],
|
|
182
189
|
on_destroy: [],
|
|
183
190
|
on_disconnect: [],
|
|
184
191
|
before_update: [],
|
|
185
192
|
after_update: [],
|
|
186
|
-
context: new Map(e.context || (
|
|
193
|
+
context: new Map(e.context || (l ? l.$$.context : [])),
|
|
187
194
|
// everything else
|
|
188
|
-
callbacks:
|
|
189
|
-
dirty:
|
|
195
|
+
callbacks: st(),
|
|
196
|
+
dirty: f,
|
|
190
197
|
skip_bound: !1,
|
|
191
|
-
root: e.target ||
|
|
198
|
+
root: e.target || l.$$.root
|
|
192
199
|
};
|
|
193
|
-
|
|
194
|
-
let
|
|
195
|
-
if (
|
|
196
|
-
const
|
|
197
|
-
return
|
|
198
|
-
}) : [],
|
|
200
|
+
u && u(c.root);
|
|
201
|
+
let O = !1;
|
|
202
|
+
if (c.ctx = t ? t(n, e.props || {}, (m, H, ...$) => {
|
|
203
|
+
const q = $.length ? $[0] : H;
|
|
204
|
+
return c.ctx && o(c.ctx[m], c.ctx[m] = q) && (!c.skip_bound && c.bound[m] && c.bound[m](q), O && rn(n, m)), H;
|
|
205
|
+
}) : [], c.update(), O = !0, ve(c.before_update), c.fragment = r ? r(c.ctx) : !1, e.target) {
|
|
199
206
|
if (e.hydrate) {
|
|
200
|
-
const
|
|
201
|
-
|
|
207
|
+
const m = qt(e.target);
|
|
208
|
+
c.fragment && c.fragment.l(m), m.forEach(D);
|
|
202
209
|
} else
|
|
203
|
-
|
|
204
|
-
e.intro &&
|
|
210
|
+
c.fragment && c.fragment.c();
|
|
211
|
+
e.intro && en(n.$$.fragment), tn(n, e.target, e.anchor), v();
|
|
205
212
|
}
|
|
206
|
-
|
|
213
|
+
ge(l);
|
|
207
214
|
}
|
|
208
|
-
let
|
|
209
|
-
typeof HTMLElement == "function" && (
|
|
210
|
-
constructor(e, t,
|
|
215
|
+
let kt;
|
|
216
|
+
typeof HTMLElement == "function" && (kt = class extends HTMLElement {
|
|
217
|
+
constructor(e, t, r) {
|
|
211
218
|
super();
|
|
212
219
|
/** The Svelte component constructor */
|
|
213
|
-
|
|
220
|
+
S(this, "$$ctor");
|
|
214
221
|
/** Slots */
|
|
215
|
-
|
|
222
|
+
S(this, "$$s");
|
|
216
223
|
/** The Svelte component instance */
|
|
217
|
-
|
|
224
|
+
S(this, "$$c");
|
|
218
225
|
/** Whether or not the custom element is connected */
|
|
219
|
-
|
|
226
|
+
S(this, "$$cn", !1);
|
|
220
227
|
/** Component props data */
|
|
221
|
-
|
|
228
|
+
S(this, "$$d", {});
|
|
222
229
|
/** `true` if currently in the process of reflecting component props back to attributes */
|
|
223
|
-
|
|
230
|
+
S(this, "$$r", !1);
|
|
224
231
|
/** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */
|
|
225
|
-
|
|
232
|
+
S(this, "$$p_d", {});
|
|
226
233
|
/** @type {Record<string, Function[]>} Event listeners */
|
|
227
|
-
|
|
234
|
+
S(this, "$$l", {});
|
|
228
235
|
/** @type {Map<Function, Function>} Event listener unsubscribe functions */
|
|
229
|
-
|
|
230
|
-
this.$$ctor = e, this.$$s = t,
|
|
236
|
+
S(this, "$$l_u", /* @__PURE__ */ new Map());
|
|
237
|
+
this.$$ctor = e, this.$$s = t, r && this.attachShadow({ mode: "open" });
|
|
231
238
|
}
|
|
232
|
-
addEventListener(e, t,
|
|
239
|
+
addEventListener(e, t, r) {
|
|
233
240
|
if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(t), this.$$c) {
|
|
234
241
|
const o = this.$$c.$on(e, t);
|
|
235
242
|
this.$$l_u.set(t, o);
|
|
236
243
|
}
|
|
237
|
-
super.addEventListener(e, t,
|
|
244
|
+
super.addEventListener(e, t, r);
|
|
238
245
|
}
|
|
239
|
-
removeEventListener(e, t,
|
|
240
|
-
if (super.removeEventListener(e, t,
|
|
246
|
+
removeEventListener(e, t, r) {
|
|
247
|
+
if (super.removeEventListener(e, t, r), this.$$c) {
|
|
241
248
|
const o = this.$$l_u.get(t);
|
|
242
249
|
o && (o(), this.$$l_u.delete(t));
|
|
243
250
|
}
|
|
244
251
|
}
|
|
245
252
|
async connectedCallback() {
|
|
246
253
|
if (this.$$cn = !0, !this.$$c) {
|
|
247
|
-
let e = function(
|
|
254
|
+
let e = function(s) {
|
|
248
255
|
return () => {
|
|
249
|
-
let
|
|
256
|
+
let u;
|
|
250
257
|
return {
|
|
251
258
|
c: function() {
|
|
252
|
-
|
|
259
|
+
u = F("slot"), s !== "default" && a(u, "name", s);
|
|
253
260
|
},
|
|
254
261
|
/**
|
|
255
262
|
* @param {HTMLElement} target
|
|
256
263
|
* @param {HTMLElement} [anchor]
|
|
257
264
|
*/
|
|
258
|
-
m: function(
|
|
259
|
-
|
|
265
|
+
m: function(c, O) {
|
|
266
|
+
M(c, u, O);
|
|
260
267
|
},
|
|
261
|
-
d: function(
|
|
262
|
-
|
|
268
|
+
d: function(c) {
|
|
269
|
+
c && D(u);
|
|
263
270
|
}
|
|
264
271
|
};
|
|
265
272
|
};
|
|
266
273
|
};
|
|
267
274
|
if (await Promise.resolve(), !this.$$cn || this.$$c)
|
|
268
275
|
return;
|
|
269
|
-
const t = {},
|
|
270
|
-
for (const
|
|
271
|
-
|
|
272
|
-
for (const
|
|
273
|
-
const
|
|
274
|
-
|
|
276
|
+
const t = {}, r = Yt(this);
|
|
277
|
+
for (const s of this.$$s)
|
|
278
|
+
s in r && (t[s] = [e(s)]);
|
|
279
|
+
for (const s of this.attributes) {
|
|
280
|
+
const u = this.$$g_p(s.name);
|
|
281
|
+
u in this.$$d || (this.$$d[u] = Te(u, s.value, this.$$p_d, "toProp"));
|
|
275
282
|
}
|
|
276
|
-
for (const
|
|
277
|
-
!(
|
|
283
|
+
for (const s in this.$$p_d)
|
|
284
|
+
!(s in this.$$d) && this[s] !== void 0 && (this.$$d[s] = this[s], delete this[s]);
|
|
278
285
|
this.$$c = new this.$$ctor({
|
|
279
286
|
target: this.shadowRoot || this,
|
|
280
287
|
props: {
|
|
@@ -287,32 +294,32 @@ typeof HTMLElement == "function" && (it = class extends HTMLElement {
|
|
|
287
294
|
});
|
|
288
295
|
const o = () => {
|
|
289
296
|
this.$$r = !0;
|
|
290
|
-
for (const
|
|
291
|
-
if (this.$$d[
|
|
292
|
-
const
|
|
293
|
-
|
|
294
|
-
this.$$d[
|
|
297
|
+
for (const s in this.$$p_d)
|
|
298
|
+
if (this.$$d[s] = this.$$c.$$.ctx[this.$$c.$$.props[s]], this.$$p_d[s].reflect) {
|
|
299
|
+
const u = Te(
|
|
300
|
+
s,
|
|
301
|
+
this.$$d[s],
|
|
295
302
|
this.$$p_d,
|
|
296
303
|
"toAttribute"
|
|
297
304
|
);
|
|
298
|
-
|
|
305
|
+
u == null ? this.removeAttribute(this.$$p_d[s].attribute || s) : this.setAttribute(this.$$p_d[s].attribute || s, u);
|
|
299
306
|
}
|
|
300
307
|
this.$$r = !1;
|
|
301
308
|
};
|
|
302
309
|
this.$$c.$$.after_update.push(o), o();
|
|
303
|
-
for (const
|
|
304
|
-
for (const
|
|
305
|
-
const
|
|
306
|
-
this.$$l_u.set(
|
|
310
|
+
for (const s in this.$$l)
|
|
311
|
+
for (const u of this.$$l[s]) {
|
|
312
|
+
const f = this.$$c.$on(s, u);
|
|
313
|
+
this.$$l_u.set(u, f);
|
|
307
314
|
}
|
|
308
315
|
this.$$l = {};
|
|
309
316
|
}
|
|
310
317
|
}
|
|
311
318
|
// We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte
|
|
312
319
|
// and setting attributes through setAttribute etc, this is helpful
|
|
313
|
-
attributeChangedCallback(e, t,
|
|
320
|
+
attributeChangedCallback(e, t, r) {
|
|
314
321
|
var o;
|
|
315
|
-
this.$$r || (e = this.$$g_p(e), this.$$d[e] =
|
|
322
|
+
this.$$r || (e = this.$$g_p(e), this.$$d[e] = Te(e, r, this.$$p_d, "toProp"), (o = this.$$c) == null || o.$set({ [e]: this.$$d[e] }));
|
|
316
323
|
}
|
|
317
324
|
disconnectedCallback() {
|
|
318
325
|
this.$$cn = !1, Promise.resolve().then(() => {
|
|
@@ -325,12 +332,12 @@ typeof HTMLElement == "function" && (it = class extends HTMLElement {
|
|
|
325
332
|
) || e;
|
|
326
333
|
}
|
|
327
334
|
});
|
|
328
|
-
function
|
|
329
|
-
var
|
|
330
|
-
const o = (
|
|
331
|
-
if (e = o === "Boolean" && typeof e != "boolean" ? e != null : e, !
|
|
335
|
+
function Te(n, e, t, r) {
|
|
336
|
+
var s;
|
|
337
|
+
const o = (s = t[n]) == null ? void 0 : s.type;
|
|
338
|
+
if (e = o === "Boolean" && typeof e != "boolean" ? e != null : e, !r || !t[n])
|
|
332
339
|
return e;
|
|
333
|
-
if (
|
|
340
|
+
if (r === "toAttribute")
|
|
334
341
|
switch (o) {
|
|
335
342
|
case "Object":
|
|
336
343
|
case "Array":
|
|
@@ -355,38 +362,38 @@ function _e(n, e, t, i) {
|
|
|
355
362
|
return e;
|
|
356
363
|
}
|
|
357
364
|
}
|
|
358
|
-
function
|
|
359
|
-
let
|
|
365
|
+
function sn(n, e, t, r, o, s) {
|
|
366
|
+
let u = class extends kt {
|
|
360
367
|
constructor() {
|
|
361
368
|
super(n, t, o), this.$$p_d = e;
|
|
362
369
|
}
|
|
363
370
|
static get observedAttributes() {
|
|
364
371
|
return Object.keys(e).map(
|
|
365
|
-
(
|
|
372
|
+
(f) => (e[f].attribute || f).toLowerCase()
|
|
366
373
|
);
|
|
367
374
|
}
|
|
368
375
|
};
|
|
369
|
-
return Object.keys(e).forEach((
|
|
370
|
-
Object.defineProperty(
|
|
376
|
+
return Object.keys(e).forEach((f) => {
|
|
377
|
+
Object.defineProperty(u.prototype, f, {
|
|
371
378
|
get() {
|
|
372
|
-
return this.$$c &&
|
|
379
|
+
return this.$$c && f in this.$$c ? this.$$c[f] : this.$$d[f];
|
|
373
380
|
},
|
|
374
|
-
set(
|
|
375
|
-
var
|
|
376
|
-
|
|
381
|
+
set(l) {
|
|
382
|
+
var c;
|
|
383
|
+
l = Te(f, l, e), this.$$d[f] = l, (c = this.$$c) == null || c.$set({ [f]: l });
|
|
377
384
|
}
|
|
378
385
|
});
|
|
379
|
-
}),
|
|
380
|
-
Object.defineProperty(
|
|
386
|
+
}), r.forEach((f) => {
|
|
387
|
+
Object.defineProperty(u.prototype, f, {
|
|
381
388
|
get() {
|
|
382
|
-
var
|
|
383
|
-
return (
|
|
389
|
+
var l;
|
|
390
|
+
return (l = this.$$c) == null ? void 0 : l[f];
|
|
384
391
|
}
|
|
385
392
|
});
|
|
386
393
|
}), n.element = /** @type {any} */
|
|
387
|
-
|
|
394
|
+
u, u;
|
|
388
395
|
}
|
|
389
|
-
class
|
|
396
|
+
class ln {
|
|
390
397
|
constructor() {
|
|
391
398
|
/**
|
|
392
399
|
* ### PRIVATE API
|
|
@@ -395,7 +402,7 @@ class Ht {
|
|
|
395
402
|
*
|
|
396
403
|
* @type {any}
|
|
397
404
|
*/
|
|
398
|
-
|
|
405
|
+
S(this, "$$");
|
|
399
406
|
/**
|
|
400
407
|
* ### PRIVATE API
|
|
401
408
|
*
|
|
@@ -403,11 +410,11 @@ class Ht {
|
|
|
403
410
|
*
|
|
404
411
|
* @type {any}
|
|
405
412
|
*/
|
|
406
|
-
|
|
413
|
+
S(this, "$$set");
|
|
407
414
|
}
|
|
408
415
|
/** @returns {void} */
|
|
409
416
|
$destroy() {
|
|
410
|
-
|
|
417
|
+
nn(this, 1), this.$destroy = ce;
|
|
411
418
|
}
|
|
412
419
|
/**
|
|
413
420
|
* @template {Extract<keyof Events, string>} K
|
|
@@ -416,12 +423,12 @@ class Ht {
|
|
|
416
423
|
* @returns {() => void}
|
|
417
424
|
*/
|
|
418
425
|
$on(e, t) {
|
|
419
|
-
if (!
|
|
420
|
-
return
|
|
421
|
-
const
|
|
422
|
-
return
|
|
423
|
-
const o =
|
|
424
|
-
o !== -1 &&
|
|
426
|
+
if (!_t(t))
|
|
427
|
+
return ce;
|
|
428
|
+
const r = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
|
|
429
|
+
return r.push(t), () => {
|
|
430
|
+
const o = r.indexOf(t);
|
|
431
|
+
o !== -1 && r.splice(o, 1);
|
|
425
432
|
};
|
|
426
433
|
}
|
|
427
434
|
/**
|
|
@@ -429,627 +436,765 @@ class Ht {
|
|
|
429
436
|
* @returns {void}
|
|
430
437
|
*/
|
|
431
438
|
$set(e) {
|
|
432
|
-
this.$$set && !
|
|
439
|
+
this.$$set && !Ht(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
|
|
433
440
|
}
|
|
434
441
|
}
|
|
435
|
-
const
|
|
436
|
-
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(
|
|
437
|
-
const
|
|
438
|
-
function
|
|
442
|
+
const an = "4";
|
|
443
|
+
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(an);
|
|
444
|
+
const fn = new TextEncoder();
|
|
445
|
+
function cn(n) {
|
|
439
446
|
return [...new Uint8Array(n)].map((e) => e.toString(16).padStart(2, "0")).join("");
|
|
440
447
|
}
|
|
441
|
-
async function
|
|
442
|
-
const
|
|
448
|
+
async function un(n, e = "SHA-256", t = 1e5) {
|
|
449
|
+
const r = Date.now().toString(16);
|
|
443
450
|
n || (n = Math.round(Math.random() * t));
|
|
444
|
-
const o = await
|
|
451
|
+
const o = await pt(r, n, e);
|
|
445
452
|
return {
|
|
446
453
|
algorithm: e,
|
|
447
454
|
challenge: o,
|
|
448
|
-
salt:
|
|
455
|
+
salt: r,
|
|
449
456
|
signature: ""
|
|
450
457
|
};
|
|
451
458
|
}
|
|
452
|
-
async function
|
|
453
|
-
return
|
|
459
|
+
async function pt(n, e, t) {
|
|
460
|
+
return cn(
|
|
454
461
|
await crypto.subtle.digest(
|
|
455
462
|
t.toUpperCase(),
|
|
456
|
-
|
|
463
|
+
fn.encode(n + e)
|
|
457
464
|
)
|
|
458
465
|
);
|
|
459
466
|
}
|
|
460
|
-
function
|
|
461
|
-
const
|
|
467
|
+
function hn(n, e, t = "SHA-256", r = 1e6, o = 0) {
|
|
468
|
+
const s = new AbortController(), u = Date.now();
|
|
462
469
|
return {
|
|
463
470
|
promise: (async () => {
|
|
464
|
-
for (let
|
|
465
|
-
if (
|
|
471
|
+
for (let l = o; l <= r; l += 1) {
|
|
472
|
+
if (s.signal.aborted)
|
|
466
473
|
return null;
|
|
467
|
-
if (await
|
|
474
|
+
if (await pt(e, l, t) === n)
|
|
468
475
|
return {
|
|
469
|
-
number:
|
|
470
|
-
took: Date.now() -
|
|
476
|
+
number: l,
|
|
477
|
+
took: Date.now() - u
|
|
471
478
|
};
|
|
472
479
|
}
|
|
473
480
|
return null;
|
|
474
481
|
})(),
|
|
475
|
-
controller:
|
|
482
|
+
controller: s
|
|
476
483
|
};
|
|
477
484
|
}
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
485
|
+
function Ct() {
|
|
486
|
+
try {
|
|
487
|
+
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
488
|
+
} catch {
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
var ae, fe, be, we, _e, ye;
|
|
492
|
+
class dn {
|
|
493
|
+
constructor(e) {
|
|
494
|
+
S(this, "beaconUrl", null);
|
|
495
|
+
S(this, "error", null);
|
|
496
|
+
S(this, "loadTime", Date.now());
|
|
497
|
+
S(this, "submitTime", null);
|
|
498
|
+
S(this, "startTime", null);
|
|
499
|
+
S(this, "viewTimeThresholdMs", 1500);
|
|
500
|
+
re(this, ae, {});
|
|
501
|
+
re(this, fe, null);
|
|
502
|
+
re(this, be, this.onFormChange.bind(this));
|
|
503
|
+
re(this, we, this.onFormFocus.bind(this));
|
|
504
|
+
re(this, _e, this.onFormSubmit.bind(this));
|
|
505
|
+
re(this, ye, this.onUnload.bind(this));
|
|
506
|
+
this.elForm = e, window.addEventListener("unload", U(this, ye)), this.elForm.addEventListener("change", U(this, be)), this.elForm.addEventListener("focusin", U(this, we)), this.elForm.addEventListener("submit", U(this, _e));
|
|
507
|
+
}
|
|
508
|
+
data() {
|
|
509
|
+
const e = Object.entries(U(this, ae));
|
|
510
|
+
return {
|
|
511
|
+
correction: e.length && e.filter(([t, r]) => r > 1).length / e.length || 0,
|
|
512
|
+
dropoff: !this.submitTime && !this.error && U(this, fe) ? U(this, fe) : null,
|
|
513
|
+
error: this.error,
|
|
514
|
+
mobile: this.isMobile(),
|
|
515
|
+
start: this.startTime,
|
|
516
|
+
submit: this.submitTime,
|
|
517
|
+
tz: Ct()
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
dataAsBase64() {
|
|
521
|
+
try {
|
|
522
|
+
return btoa(
|
|
523
|
+
JSON.stringify(this.data())
|
|
524
|
+
);
|
|
525
|
+
} catch (e) {
|
|
526
|
+
console.error("failed to encode ALTCHA session data to base64", e);
|
|
527
|
+
}
|
|
528
|
+
return "";
|
|
529
|
+
}
|
|
530
|
+
destroy() {
|
|
531
|
+
window.removeEventListener("unload", U(this, ye)), this.elForm.removeEventListener("change", U(this, be)), this.elForm.removeEventListener("focusin", U(this, we)), this.elForm.removeEventListener("submit", U(this, _e));
|
|
532
|
+
}
|
|
533
|
+
end() {
|
|
534
|
+
this.submitTime || (this.submitTime = Date.now());
|
|
535
|
+
}
|
|
536
|
+
getFieldName(e, t = 40) {
|
|
537
|
+
const r = e.getAttribute("data-group-label"), o = e.getAttribute("name") || e.getAttribute("aria-label");
|
|
538
|
+
return ((r ? r + ": " : "") + o).slice(0, t);
|
|
539
|
+
}
|
|
540
|
+
isMobile() {
|
|
541
|
+
const e = "userAgentData" in navigator && navigator.userAgentData ? navigator.userAgentData : {};
|
|
542
|
+
return "mobile" in e ? e.mobile === !0 : /Mobi/i.test(window.navigator.userAgent);
|
|
543
|
+
}
|
|
544
|
+
isInput(e) {
|
|
545
|
+
return ["INPUT", "SELECT", "TEXTAREA"].includes(e.tagName);
|
|
546
|
+
}
|
|
547
|
+
onFormFieldChange(e) {
|
|
548
|
+
const t = this.getFieldName(e);
|
|
549
|
+
t && this.trackFieldChange(t);
|
|
550
|
+
}
|
|
551
|
+
onFormChange(e) {
|
|
552
|
+
const t = e.target;
|
|
553
|
+
t && this.isInput(t) && this.onFormFieldChange(t);
|
|
554
|
+
}
|
|
555
|
+
onFormFocus(e) {
|
|
556
|
+
const t = e.target;
|
|
557
|
+
if (this.startTime || this.start(), t && this.isInput(t)) {
|
|
558
|
+
const r = this.getFieldName(t);
|
|
559
|
+
r && ot(this, fe, r);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
onFormSubmit() {
|
|
563
|
+
this.end();
|
|
564
|
+
}
|
|
565
|
+
onUnload() {
|
|
566
|
+
this.loadTime <= Date.now() - this.viewTimeThresholdMs && !this.submitTime && this.sendBeacon();
|
|
567
|
+
}
|
|
568
|
+
async sendBeacon() {
|
|
569
|
+
if (this.beaconUrl && "sendBeacon" in navigator)
|
|
570
|
+
try {
|
|
571
|
+
navigator.sendBeacon(
|
|
572
|
+
new URL(this.beaconUrl, location.origin),
|
|
573
|
+
JSON.stringify(this.data())
|
|
574
|
+
);
|
|
575
|
+
} catch {
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
start() {
|
|
579
|
+
this.startTime = Date.now();
|
|
580
|
+
}
|
|
581
|
+
trackError(e) {
|
|
582
|
+
this.error = e === null ? null : String(e);
|
|
583
|
+
}
|
|
584
|
+
trackFieldChange(e) {
|
|
585
|
+
U(this, ae)[e] = (U(this, ae)[e] || 0) + 1;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
ae = new WeakMap(), fe = new WeakMap(), be = new WeakMap(), we = new WeakMap(), _e = new WeakMap(), ye = new WeakMap();
|
|
589
|
+
var _ = /* @__PURE__ */ ((n) => (n.ERROR = "error", n.VERIFIED = "verified", n.VERIFYING = "verifying", n.UNVERIFIED = "unverified", n.EXPIRED = "expired", n))(_ || {});
|
|
590
|
+
function ft(n) {
|
|
591
|
+
let e, t, r;
|
|
481
592
|
return {
|
|
482
593
|
c() {
|
|
483
|
-
e =
|
|
594
|
+
e = z("svg"), t = z("path"), r = z("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(r, "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(r, "fill", "currentColor"), a(r, "class", "altcha-spinner"), a(e, "width", "24"), a(e, "height", "24"), a(e, "viewBox", "0 0 24 24"), a(e, "xmlns", "http://www.w3.org/2000/svg");
|
|
484
595
|
},
|
|
485
|
-
m(o,
|
|
486
|
-
|
|
596
|
+
m(o, s) {
|
|
597
|
+
M(o, e, s), p(e, t), p(e, r);
|
|
487
598
|
},
|
|
488
599
|
d(o) {
|
|
489
600
|
o && D(e);
|
|
490
601
|
}
|
|
491
602
|
};
|
|
492
603
|
}
|
|
493
|
-
function
|
|
604
|
+
function gn(n) {
|
|
494
605
|
let e, t = (
|
|
495
606
|
/*_strings*/
|
|
496
|
-
n[
|
|
497
|
-
),
|
|
607
|
+
n[13].label + ""
|
|
608
|
+
), r;
|
|
498
609
|
return {
|
|
499
610
|
c() {
|
|
500
|
-
e =
|
|
611
|
+
e = F("label"), a(e, "for", r = /*name*/
|
|
501
612
|
n[4] + "_checkbox");
|
|
502
613
|
},
|
|
503
|
-
m(o,
|
|
504
|
-
|
|
614
|
+
m(o, s) {
|
|
615
|
+
M(o, e, s), e.innerHTML = t;
|
|
505
616
|
},
|
|
506
|
-
p(o,
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
o[
|
|
510
|
-
16 &&
|
|
511
|
-
o[4] + "_checkbox") &&
|
|
617
|
+
p(o, s) {
|
|
618
|
+
s[0] & /*_strings*/
|
|
619
|
+
8192 && t !== (t = /*_strings*/
|
|
620
|
+
o[13].label + "") && (e.innerHTML = t), s[0] & /*name*/
|
|
621
|
+
16 && r !== (r = /*name*/
|
|
622
|
+
o[4] + "_checkbox") && a(e, "for", r);
|
|
512
623
|
},
|
|
513
624
|
d(o) {
|
|
514
625
|
o && D(e);
|
|
515
626
|
}
|
|
516
627
|
};
|
|
517
628
|
}
|
|
518
|
-
function
|
|
629
|
+
function mn(n) {
|
|
519
630
|
let e, t = (
|
|
520
631
|
/*_strings*/
|
|
521
|
-
n[
|
|
632
|
+
n[13].verifying + ""
|
|
522
633
|
);
|
|
523
634
|
return {
|
|
524
635
|
c() {
|
|
525
|
-
e =
|
|
636
|
+
e = F("span");
|
|
526
637
|
},
|
|
527
|
-
m(
|
|
528
|
-
|
|
638
|
+
m(r, o) {
|
|
639
|
+
M(r, e, o), e.innerHTML = t;
|
|
529
640
|
},
|
|
530
|
-
p(
|
|
641
|
+
p(r, o) {
|
|
531
642
|
o[0] & /*_strings*/
|
|
532
|
-
|
|
533
|
-
|
|
643
|
+
8192 && t !== (t = /*_strings*/
|
|
644
|
+
r[13].verifying + "") && (e.innerHTML = t);
|
|
534
645
|
},
|
|
535
|
-
d(
|
|
536
|
-
|
|
646
|
+
d(r) {
|
|
647
|
+
r && D(e);
|
|
537
648
|
}
|
|
538
649
|
};
|
|
539
650
|
}
|
|
540
|
-
function
|
|
651
|
+
function bn(n) {
|
|
541
652
|
let e, t = (
|
|
542
653
|
/*_strings*/
|
|
543
|
-
n[
|
|
544
|
-
),
|
|
654
|
+
n[13].verified + ""
|
|
655
|
+
), r, o, s, u, f = (
|
|
656
|
+
/*session*/
|
|
657
|
+
n[11] && ct(n)
|
|
658
|
+
);
|
|
545
659
|
return {
|
|
546
660
|
c() {
|
|
547
|
-
e =
|
|
661
|
+
e = F("span"), r = W(), o = F("input"), s = W(), f && f.c(), u = $t(), a(o, "type", "hidden"), a(
|
|
548
662
|
o,
|
|
549
663
|
"name",
|
|
550
664
|
/*name*/
|
|
551
665
|
n[4]
|
|
552
666
|
), o.value = /*payload*/
|
|
553
|
-
n[
|
|
667
|
+
n[6];
|
|
554
668
|
},
|
|
555
|
-
m(l,
|
|
556
|
-
|
|
669
|
+
m(l, c) {
|
|
670
|
+
M(l, e, c), e.innerHTML = t, M(l, r, c), M(l, o, c), M(l, s, c), f && f.m(l, c), M(l, u, c);
|
|
557
671
|
},
|
|
558
|
-
p(l,
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
l[
|
|
562
|
-
16 &&
|
|
672
|
+
p(l, c) {
|
|
673
|
+
c[0] & /*_strings*/
|
|
674
|
+
8192 && t !== (t = /*_strings*/
|
|
675
|
+
l[13].verified + "") && (e.innerHTML = t), c[0] & /*name*/
|
|
676
|
+
16 && a(
|
|
563
677
|
o,
|
|
564
678
|
"name",
|
|
565
679
|
/*name*/
|
|
566
680
|
l[4]
|
|
567
|
-
),
|
|
568
|
-
|
|
569
|
-
l[
|
|
681
|
+
), c[0] & /*payload*/
|
|
682
|
+
64 && (o.value = /*payload*/
|
|
683
|
+
l[6]), /*session*/
|
|
684
|
+
l[11] ? f ? f.p(l, c) : (f = ct(l), f.c(), f.m(u.parentNode, u)) : f && (f.d(1), f = null);
|
|
570
685
|
},
|
|
571
686
|
d(l) {
|
|
572
|
-
l && (D(e), D(
|
|
687
|
+
l && (D(e), D(r), D(o), D(s), D(u)), f && f.d(l);
|
|
573
688
|
}
|
|
574
689
|
};
|
|
575
690
|
}
|
|
576
|
-
function
|
|
577
|
-
let e
|
|
691
|
+
function ct(n) {
|
|
692
|
+
let e;
|
|
578
693
|
return {
|
|
579
694
|
c() {
|
|
580
|
-
e =
|
|
581
|
-
n[
|
|
695
|
+
e = F("input"), a(e, "type", "hidden"), a(e, "name", "__session"), e.value = /*sessionPayload*/
|
|
696
|
+
n[12];
|
|
582
697
|
},
|
|
583
|
-
m(
|
|
584
|
-
|
|
698
|
+
m(t, r) {
|
|
699
|
+
M(t, e, r);
|
|
585
700
|
},
|
|
586
|
-
p(
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
701
|
+
p(t, r) {
|
|
702
|
+
r[0] & /*sessionPayload*/
|
|
703
|
+
4096 && (e.value = /*sessionPayload*/
|
|
704
|
+
t[12]);
|
|
590
705
|
},
|
|
591
|
-
d(
|
|
592
|
-
|
|
706
|
+
d(t) {
|
|
707
|
+
t && D(e);
|
|
593
708
|
}
|
|
594
709
|
};
|
|
595
710
|
}
|
|
596
|
-
function
|
|
597
|
-
let e, t,
|
|
598
|
-
|
|
711
|
+
function ut(n) {
|
|
712
|
+
let e, t, r, o, s, u, f;
|
|
713
|
+
return {
|
|
714
|
+
c() {
|
|
715
|
+
e = F("div"), t = F("a"), r = z("svg"), o = z("path"), s = z("path"), u = z("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(s, "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(s, "fill", "currentColor"), a(u, "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(u, "fill", "currentColor"), a(r, "width", "22"), a(r, "height", "22"), a(r, "viewBox", "0 0 20 20"), a(r, "fill", "none"), a(r, "xmlns", "http://www.w3.org/2000/svg"), a(t, "href", At), a(t, "target", "_blank"), a(t, "class", "altcha-logo"), a(t, "aria-label", f = /*_strings*/
|
|
716
|
+
n[13].ariaLinkLabel);
|
|
717
|
+
},
|
|
718
|
+
m(l, c) {
|
|
719
|
+
M(l, e, c), p(e, t), p(t, r), p(r, o), p(r, s), p(r, u);
|
|
720
|
+
},
|
|
721
|
+
p(l, c) {
|
|
722
|
+
c[0] & /*_strings*/
|
|
723
|
+
8192 && f !== (f = /*_strings*/
|
|
724
|
+
l[13].ariaLinkLabel) && a(t, "aria-label", f);
|
|
725
|
+
},
|
|
726
|
+
d(l) {
|
|
727
|
+
l && D(e);
|
|
728
|
+
}
|
|
729
|
+
};
|
|
730
|
+
}
|
|
731
|
+
function ht(n) {
|
|
732
|
+
let e, t, r, o;
|
|
733
|
+
function s(l, c) {
|
|
599
734
|
return (
|
|
600
735
|
/*state*/
|
|
601
|
-
|
|
736
|
+
l[7] === _.EXPIRED ? _n : wn
|
|
602
737
|
);
|
|
603
738
|
}
|
|
604
|
-
let
|
|
739
|
+
let u = s(n), f = u(n);
|
|
605
740
|
return {
|
|
606
741
|
c() {
|
|
607
|
-
e =
|
|
742
|
+
e = F("div"), t = z("svg"), r = z("path"), o = W(), f.c(), a(r, "stroke-linecap", "round"), a(r, "stroke-linejoin", "round"), a(r, "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");
|
|
608
743
|
},
|
|
609
|
-
m(
|
|
610
|
-
|
|
744
|
+
m(l, c) {
|
|
745
|
+
M(l, e, c), p(e, t), p(t, r), p(e, o), f.m(e, null);
|
|
611
746
|
},
|
|
612
|
-
p(
|
|
613
|
-
|
|
747
|
+
p(l, c) {
|
|
748
|
+
u === (u = s(l)) && f ? f.p(l, c) : (f.d(1), f = u(l), f && (f.c(), f.m(e, null)));
|
|
614
749
|
},
|
|
615
|
-
d(
|
|
616
|
-
|
|
750
|
+
d(l) {
|
|
751
|
+
l && D(e), f.d();
|
|
617
752
|
}
|
|
618
753
|
};
|
|
619
754
|
}
|
|
620
|
-
function
|
|
755
|
+
function wn(n) {
|
|
621
756
|
let e, t = (
|
|
622
757
|
/*_strings*/
|
|
623
|
-
n[
|
|
758
|
+
n[13].error + ""
|
|
624
759
|
);
|
|
625
760
|
return {
|
|
626
761
|
c() {
|
|
627
|
-
e =
|
|
762
|
+
e = F("div"), a(
|
|
628
763
|
e,
|
|
629
764
|
"title",
|
|
630
765
|
/*error*/
|
|
631
|
-
n[
|
|
766
|
+
n[5]
|
|
632
767
|
);
|
|
633
768
|
},
|
|
634
|
-
m(
|
|
635
|
-
|
|
769
|
+
m(r, o) {
|
|
770
|
+
M(r, e, o), e.innerHTML = t;
|
|
636
771
|
},
|
|
637
|
-
p(
|
|
772
|
+
p(r, o) {
|
|
638
773
|
o[0] & /*_strings*/
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
774
|
+
8192 && t !== (t = /*_strings*/
|
|
775
|
+
r[13].error + "") && (e.innerHTML = t), o[0] & /*error*/
|
|
776
|
+
32 && a(
|
|
642
777
|
e,
|
|
643
778
|
"title",
|
|
644
779
|
/*error*/
|
|
645
|
-
|
|
780
|
+
r[5]
|
|
646
781
|
);
|
|
647
782
|
},
|
|
648
|
-
d(
|
|
649
|
-
|
|
783
|
+
d(r) {
|
|
784
|
+
r && D(e);
|
|
650
785
|
}
|
|
651
786
|
};
|
|
652
787
|
}
|
|
653
|
-
function
|
|
788
|
+
function _n(n) {
|
|
654
789
|
let e, t = (
|
|
655
790
|
/*_strings*/
|
|
656
|
-
n[
|
|
791
|
+
n[13].expired + ""
|
|
657
792
|
);
|
|
658
793
|
return {
|
|
659
794
|
c() {
|
|
660
|
-
e =
|
|
795
|
+
e = F("div"), a(
|
|
661
796
|
e,
|
|
662
797
|
"title",
|
|
663
798
|
/*error*/
|
|
664
|
-
n[
|
|
799
|
+
n[5]
|
|
665
800
|
);
|
|
666
801
|
},
|
|
667
|
-
m(
|
|
668
|
-
|
|
802
|
+
m(r, o) {
|
|
803
|
+
M(r, e, o), e.innerHTML = t;
|
|
669
804
|
},
|
|
670
|
-
p(
|
|
805
|
+
p(r, o) {
|
|
671
806
|
o[0] & /*_strings*/
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
807
|
+
8192 && t !== (t = /*_strings*/
|
|
808
|
+
r[13].expired + "") && (e.innerHTML = t), o[0] & /*error*/
|
|
809
|
+
32 && a(
|
|
675
810
|
e,
|
|
676
811
|
"title",
|
|
677
812
|
/*error*/
|
|
678
|
-
|
|
813
|
+
r[5]
|
|
679
814
|
);
|
|
680
815
|
},
|
|
681
|
-
d(
|
|
682
|
-
|
|
816
|
+
d(r) {
|
|
817
|
+
r && D(e);
|
|
683
818
|
}
|
|
684
819
|
};
|
|
685
820
|
}
|
|
686
|
-
function
|
|
687
|
-
let e, t,
|
|
821
|
+
function dt(n) {
|
|
822
|
+
let e, t, r = (
|
|
688
823
|
/*_strings*/
|
|
689
|
-
n[
|
|
824
|
+
n[13].footer + ""
|
|
690
825
|
);
|
|
691
826
|
return {
|
|
692
827
|
c() {
|
|
693
|
-
e =
|
|
828
|
+
e = F("div"), t = F("div"), a(e, "class", "altcha-footer");
|
|
694
829
|
},
|
|
695
|
-
m(o,
|
|
696
|
-
|
|
830
|
+
m(o, s) {
|
|
831
|
+
M(o, e, s), p(e, t), t.innerHTML = r;
|
|
697
832
|
},
|
|
698
|
-
p(o,
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
o[
|
|
833
|
+
p(o, s) {
|
|
834
|
+
s[0] & /*_strings*/
|
|
835
|
+
8192 && r !== (r = /*_strings*/
|
|
836
|
+
o[13].footer + "") && (t.innerHTML = r);
|
|
702
837
|
},
|
|
703
838
|
d(o) {
|
|
704
839
|
o && D(e);
|
|
705
840
|
}
|
|
706
841
|
};
|
|
707
842
|
}
|
|
708
|
-
function
|
|
843
|
+
function gt(n) {
|
|
709
844
|
let e;
|
|
710
845
|
return {
|
|
711
846
|
c() {
|
|
712
|
-
e =
|
|
847
|
+
e = F("div"), a(e, "class", "altcha-anchor-arrow");
|
|
713
848
|
},
|
|
714
|
-
m(t,
|
|
715
|
-
|
|
849
|
+
m(t, r) {
|
|
850
|
+
M(t, e, r), n[41](e);
|
|
716
851
|
},
|
|
717
|
-
p:
|
|
852
|
+
p: ce,
|
|
718
853
|
d(t) {
|
|
719
|
-
t && D(e), n[
|
|
854
|
+
t && D(e), n[41](null);
|
|
720
855
|
}
|
|
721
856
|
};
|
|
722
857
|
}
|
|
723
|
-
function
|
|
724
|
-
let e, t,
|
|
858
|
+
function yn(n) {
|
|
859
|
+
let e, t, r, o, s, u, f, l, c, O, m, H, $, q, J, b = (
|
|
725
860
|
/*state*/
|
|
726
|
-
n[
|
|
861
|
+
n[7] === _.VERIFYING && ft()
|
|
727
862
|
);
|
|
728
|
-
function
|
|
863
|
+
function K(d, E) {
|
|
729
864
|
return (
|
|
730
865
|
/*state*/
|
|
731
|
-
d[
|
|
866
|
+
d[7] === _.VERIFIED ? bn : (
|
|
732
867
|
/*state*/
|
|
733
|
-
d[
|
|
868
|
+
d[7] === _.VERIFYING ? mn : gn
|
|
734
869
|
)
|
|
735
870
|
);
|
|
736
871
|
}
|
|
737
|
-
let
|
|
872
|
+
let X = K(n), j = X(n), I = (
|
|
738
873
|
/*hidelogo*/
|
|
739
874
|
(n[3] !== !0 || /*isFreeSaaS*/
|
|
740
|
-
n[
|
|
741
|
-
),
|
|
875
|
+
n[14]) && ut(n)
|
|
876
|
+
), R = (
|
|
742
877
|
/*error*/
|
|
743
|
-
(n[
|
|
744
|
-
n[
|
|
745
|
-
),
|
|
878
|
+
(n[5] || /*state*/
|
|
879
|
+
n[7] === _.EXPIRED) && ht(n)
|
|
880
|
+
), C = (
|
|
746
881
|
/*_strings*/
|
|
747
|
-
n[
|
|
882
|
+
n[13].footer && /*hidefooter*/
|
|
748
883
|
(n[2] !== !0 || /*isFreeSaaS*/
|
|
749
|
-
n[
|
|
750
|
-
),
|
|
884
|
+
n[14]) && dt(n)
|
|
885
|
+
), x = (
|
|
751
886
|
/*floating*/
|
|
752
|
-
n[1] &&
|
|
887
|
+
n[1] && gt(n)
|
|
753
888
|
);
|
|
754
889
|
return {
|
|
755
890
|
c() {
|
|
756
|
-
e =
|
|
757
|
-
n[4] + "_checkbox"),
|
|
758
|
-
n[0] !== "onsubmit",
|
|
891
|
+
e = F("div"), t = F("div"), b && b.c(), r = W(), o = F("div"), s = F("input"), l = W(), c = F("div"), j.c(), O = W(), I && I.c(), m = W(), R && R.c(), H = W(), C && C.c(), $ = W(), x && x.c(), a(s, "type", "checkbox"), a(s, "id", u = /*name*/
|
|
892
|
+
n[4] + "_checkbox"), s.required = f = /*auto*/
|
|
893
|
+
n[0] !== "onsubmit", a(o, "class", "altcha-checkbox"), lt(
|
|
759
894
|
o,
|
|
760
895
|
"altcha-hidden",
|
|
761
896
|
/*state*/
|
|
762
|
-
n[
|
|
763
|
-
),
|
|
897
|
+
n[7] === _.VERIFYING
|
|
898
|
+
), a(c, "class", "altcha-label"), a(t, "class", "altcha-main"), a(e, "class", "altcha"), a(
|
|
764
899
|
e,
|
|
765
900
|
"data-state",
|
|
766
901
|
/*state*/
|
|
767
|
-
n[
|
|
768
|
-
),
|
|
902
|
+
n[7]
|
|
903
|
+
), a(
|
|
769
904
|
e,
|
|
770
905
|
"data-floating",
|
|
771
906
|
/*floating*/
|
|
772
907
|
n[1]
|
|
773
908
|
);
|
|
774
909
|
},
|
|
775
|
-
m(d,
|
|
776
|
-
|
|
777
|
-
n[
|
|
778
|
-
|
|
779
|
-
|
|
910
|
+
m(d, E) {
|
|
911
|
+
M(d, e, E), p(e, t), b && b.m(t, null), p(t, r), p(t, o), p(o, s), s.checked = /*checked*/
|
|
912
|
+
n[8], p(t, l), p(t, c), j.m(c, null), p(t, O), I && I.m(t, null), p(e, m), R && R.m(e, null), p(e, H), C && C.m(e, null), p(e, $), x && x.m(e, null), n[42](e), q || (J = [
|
|
913
|
+
Me(
|
|
914
|
+
s,
|
|
780
915
|
"change",
|
|
781
916
|
/*input_change_handler*/
|
|
782
|
-
n[
|
|
917
|
+
n[40]
|
|
783
918
|
),
|
|
784
|
-
|
|
785
|
-
|
|
919
|
+
Me(
|
|
920
|
+
s,
|
|
786
921
|
"change",
|
|
787
922
|
/*onCheckedChange*/
|
|
788
|
-
n[
|
|
923
|
+
n[15]
|
|
789
924
|
),
|
|
790
|
-
|
|
791
|
-
|
|
925
|
+
Me(
|
|
926
|
+
s,
|
|
792
927
|
"invalid",
|
|
793
928
|
/*onInvalid*/
|
|
794
|
-
n[
|
|
929
|
+
n[16]
|
|
795
930
|
)
|
|
796
|
-
],
|
|
931
|
+
], q = !0);
|
|
797
932
|
},
|
|
798
|
-
p(d,
|
|
933
|
+
p(d, E) {
|
|
799
934
|
/*state*/
|
|
800
|
-
d[
|
|
801
|
-
16 &&
|
|
802
|
-
d[4] + "_checkbox") && s
|
|
803
|
-
1 &&
|
|
804
|
-
d[0] !== "onsubmit") && (
|
|
805
|
-
|
|
806
|
-
d[
|
|
807
|
-
|
|
935
|
+
d[7] === _.VERIFYING ? b || (b = ft(), b.c(), b.m(t, r)) : b && (b.d(1), b = null), E[0] & /*name*/
|
|
936
|
+
16 && u !== (u = /*name*/
|
|
937
|
+
d[4] + "_checkbox") && a(s, "id", u), E[0] & /*auto*/
|
|
938
|
+
1 && f !== (f = /*auto*/
|
|
939
|
+
d[0] !== "onsubmit") && (s.required = f), E[0] & /*checked*/
|
|
940
|
+
256 && (s.checked = /*checked*/
|
|
941
|
+
d[8]), E[0] & /*state*/
|
|
942
|
+
128 && lt(
|
|
808
943
|
o,
|
|
809
944
|
"altcha-hidden",
|
|
810
945
|
/*state*/
|
|
811
|
-
d[
|
|
812
|
-
),
|
|
946
|
+
d[7] === _.VERIFYING
|
|
947
|
+
), X === (X = K(d)) && j ? j.p(d, E) : (j.d(1), j = X(d), j && (j.c(), j.m(c, null))), /*hidelogo*/
|
|
813
948
|
d[3] !== !0 || /*isFreeSaaS*/
|
|
814
|
-
d[
|
|
815
|
-
d[
|
|
816
|
-
d[
|
|
817
|
-
d[
|
|
949
|
+
d[14] ? I ? I.p(d, E) : (I = ut(d), I.c(), I.m(t, null)) : I && (I.d(1), I = null), /*error*/
|
|
950
|
+
d[5] || /*state*/
|
|
951
|
+
d[7] === _.EXPIRED ? R ? R.p(d, E) : (R = ht(d), R.c(), R.m(e, H)) : R && (R.d(1), R = null), /*_strings*/
|
|
952
|
+
d[13].footer && /*hidefooter*/
|
|
818
953
|
(d[2] !== !0 || /*isFreeSaaS*/
|
|
819
|
-
d[
|
|
820
|
-
d[1] ?
|
|
821
|
-
|
|
954
|
+
d[14]) ? C ? C.p(d, E) : (C = dt(d), C.c(), C.m(e, $)) : C && (C.d(1), C = null), /*floating*/
|
|
955
|
+
d[1] ? x ? x.p(d, E) : (x = gt(d), x.c(), x.m(e, null)) : x && (x.d(1), x = null), E[0] & /*state*/
|
|
956
|
+
128 && a(
|
|
822
957
|
e,
|
|
823
958
|
"data-state",
|
|
824
959
|
/*state*/
|
|
825
|
-
d[
|
|
826
|
-
),
|
|
827
|
-
2 &&
|
|
960
|
+
d[7]
|
|
961
|
+
), E[0] & /*floating*/
|
|
962
|
+
2 && a(
|
|
828
963
|
e,
|
|
829
964
|
"data-floating",
|
|
830
965
|
/*floating*/
|
|
831
966
|
d[1]
|
|
832
967
|
);
|
|
833
968
|
},
|
|
834
|
-
i:
|
|
835
|
-
o:
|
|
969
|
+
i: ce,
|
|
970
|
+
o: ce,
|
|
836
971
|
d(d) {
|
|
837
|
-
d && D(e),
|
|
972
|
+
d && D(e), b && b.d(), j.d(), I && I.d(), R && R.d(), C && C.d(), x && x.d(), n[42](null), q = !1, ve(J);
|
|
838
973
|
}
|
|
839
974
|
};
|
|
840
975
|
}
|
|
841
|
-
const
|
|
842
|
-
function
|
|
976
|
+
const mt = "Visit Altcha.org", At = "https://altcha.org/";
|
|
977
|
+
function bt(n) {
|
|
843
978
|
return JSON.parse(n);
|
|
844
979
|
}
|
|
845
|
-
function
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
const ye = Rt(), Ae = ["SHA-256", "SHA-384", "SHA-512"], Re = (Ue = (Be = document.documentElement.lang) == null ? void 0 : Be.split("-")) == null ? void 0 : Ue[0];
|
|
855
|
-
let W = !1, C, K = null, he = null, m = null, ve = null, Q = null, j = b.UNVERIFIED, U = null;
|
|
856
|
-
At(() => {
|
|
857
|
-
m && (m.removeEventListener("submit", Me), m.removeEventListener("reset", Se), m.removeEventListener("focusin", $e), m = null), U && (clearTimeout(U), U = null), document.removeEventListener("click", je), document.removeEventListener("scroll", Ve), window.removeEventListener("resize", Pe);
|
|
858
|
-
}), It(() => {
|
|
859
|
-
E("mounted", "0.6.7"), E("workers", oe), _ && E("using test mode"), P && de(P), c !== void 0 && E("auto", c), k !== void 0 && He(k), m = C.closest("form"), m && (m.addEventListener("submit", Me, { capture: !0 }), m.addEventListener("reset", Se), c === "onfocus" && m.addEventListener("focusin", $e)), c === "onload" && ee(), i && (J || Z) && E("Attributes hidefooter and hidelogo ignored because usage with free API Keys require attribution.");
|
|
980
|
+
function vn(n, e, t) {
|
|
981
|
+
var tt, nt;
|
|
982
|
+
let r, o, s, u, { analytics: f = !1 } = e, { auto: l = void 0 } = e, { beaconurl: c = void 0 } = e, { blockspam: O = void 0 } = e, { challengeurl: m = void 0 } = e, { challengejson: H = void 0 } = e, { debug: $ = !1 } = e, { delay: q = 0 } = e, { expire: J = void 0 } = e, { floating: b = void 0 } = e, { floatinganchor: K = void 0 } = e, { floatingoffset: X = void 0 } = e, { hidefooter: j = !1 } = e, { hidelogo: I = !1 } = e, { name: R = "altcha" } = e, { maxnumber: C = 1e6 } = e, { mockerror: x = !1 } = e, { refetchonexpire: d = !0 } = e, { spamfilter: E = !1 } = e, { strings: Ee = void 0 } = e, { test: Z = !1 } = e, { verifyurl: ee = void 0 } = e, { workers: ue = Math.min(16, navigator.hardwareConcurrency || 8) } = e, { workerurl: ke = void 0 } = e;
|
|
983
|
+
const Re = Xt(), Pe = ["SHA-256", "SHA-384", "SHA-512"], Ue = (nt = (tt = document.documentElement.lang) == null ? void 0 : tt.split("-")) == null ? void 0 : nt[0];
|
|
984
|
+
let Q = !1, A, te = null, pe = null, g = null, Ce = null, Y = null, ne = null, V = null, Oe = null, B = _.UNVERIFIED;
|
|
985
|
+
Jt(() => {
|
|
986
|
+
g && (g.removeEventListener("submit", $e), g.removeEventListener("reset", qe), g.removeEventListener("focusin", He), g = null), V && V.destroy(), Y && (clearTimeout(Y), Y = null), document.removeEventListener("click", Xe), document.removeEventListener("scroll", We), window.removeEventListener("resize", Ke);
|
|
987
|
+
}), Gt(() => {
|
|
988
|
+
k("mounted", "0.7.0"), k("workers", ue), Z && k("using test mode"), J && Ae(J), l !== void 0 && k("auto", l), b !== void 0 && Qe(b), g = A.closest("form"), g && (g.addEventListener("submit", $e, { capture: !0 }), g.addEventListener("reset", qe), l === "onfocus" && g.addEventListener("focusin", He)), f && Ge(), l === "onload" && ie(), r && (j || I) && k("Attributes hidefooter and hidelogo ignored because usage with free API Keys require attribution.");
|
|
860
989
|
});
|
|
861
|
-
function
|
|
862
|
-
(
|
|
990
|
+
function k(...i) {
|
|
991
|
+
($ || i.some((h) => h instanceof Error)) && console[i[0] instanceof Error ? "error" : "log"]("ALTCHA", ...i);
|
|
863
992
|
}
|
|
864
|
-
function
|
|
865
|
-
|
|
993
|
+
function He(i) {
|
|
994
|
+
B === _.UNVERIFIED && ie();
|
|
866
995
|
}
|
|
867
|
-
function
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
})) :
|
|
996
|
+
function $e(i) {
|
|
997
|
+
g && V && B === _.VERIFIED && (V.end(), t(12, Oe = V.dataAsBase64())), g && l === "onsubmit" && (B === _.UNVERIFIED ? (i.preventDefault(), i.stopPropagation(), ie().then(() => {
|
|
998
|
+
g == null || g.requestSubmit();
|
|
999
|
+
})) : B !== _.VERIFIED && (i.preventDefault(), i.stopPropagation(), B === _.VERIFYING && ze()));
|
|
871
1000
|
}
|
|
872
|
-
function
|
|
873
|
-
|
|
1001
|
+
function qe() {
|
|
1002
|
+
Le();
|
|
874
1003
|
}
|
|
875
|
-
function
|
|
1004
|
+
function Ze(i, h) {
|
|
876
1005
|
return btoa(JSON.stringify({
|
|
877
|
-
algorithm:
|
|
878
|
-
challenge:
|
|
879
|
-
number:
|
|
880
|
-
salt:
|
|
881
|
-
signature:
|
|
882
|
-
test:
|
|
883
|
-
took:
|
|
1006
|
+
algorithm: i.algorithm,
|
|
1007
|
+
challenge: i.challenge,
|
|
1008
|
+
number: h.number,
|
|
1009
|
+
salt: i.salt,
|
|
1010
|
+
signature: i.signature,
|
|
1011
|
+
test: Z ? !0 : void 0,
|
|
1012
|
+
took: h.took
|
|
884
1013
|
}));
|
|
885
1014
|
}
|
|
886
|
-
function
|
|
887
|
-
if (!
|
|
1015
|
+
function Ye(i) {
|
|
1016
|
+
if (!i.algorithm)
|
|
888
1017
|
throw new Error("Invalid challenge. Property algorithm is missing.");
|
|
889
|
-
if (
|
|
1018
|
+
if (i.signature === void 0)
|
|
890
1019
|
throw new Error("Invalid challenge. Property signature is missing.");
|
|
891
|
-
if (!
|
|
892
|
-
throw new Error(`Unknown algorithm value. Allowed values: ${
|
|
893
|
-
if (!
|
|
1020
|
+
if (!Pe.includes(i.algorithm.toUpperCase()))
|
|
1021
|
+
throw new Error(`Unknown algorithm value. Allowed values: ${Pe.join(", ")}`);
|
|
1022
|
+
if (!i.challenge || i.challenge.length < 40)
|
|
894
1023
|
throw new Error("Challenge is too short. Min. 40 chars.");
|
|
895
|
-
if (!
|
|
1024
|
+
if (!i.salt || i.salt.length < 10)
|
|
896
1025
|
throw new Error("Salt is too short. Min. 10 chars.");
|
|
897
1026
|
}
|
|
898
|
-
async function
|
|
899
|
-
var
|
|
900
|
-
if (
|
|
901
|
-
throw
|
|
1027
|
+
async function Lt() {
|
|
1028
|
+
var i;
|
|
1029
|
+
if (x)
|
|
1030
|
+
throw k("mocking error"), new Error("Mocked error.");
|
|
902
1031
|
if (o)
|
|
903
|
-
return
|
|
904
|
-
if (
|
|
905
|
-
return
|
|
1032
|
+
return k("using provided json data"), o;
|
|
1033
|
+
if (Z)
|
|
1034
|
+
return k("generating test challenge", { test: Z }), un(typeof Z != "boolean" ? +Z : void 0);
|
|
906
1035
|
{
|
|
907
|
-
if (!
|
|
1036
|
+
if (!m && g) {
|
|
1037
|
+
const y = g.getAttribute("action");
|
|
1038
|
+
y != null && y.includes("/form/") && t(17, m = y + "/altcha");
|
|
1039
|
+
}
|
|
1040
|
+
if (!m)
|
|
908
1041
|
throw new Error("Attribute challengeurl not set.");
|
|
909
|
-
|
|
910
|
-
const
|
|
911
|
-
headers: {
|
|
912
|
-
"x-altcha-spam-filter": w ? "1" : "0"
|
|
913
|
-
}
|
|
1042
|
+
k("fetching challenge from", m);
|
|
1043
|
+
const h = await fetch(m, {
|
|
1044
|
+
headers: E ? { "x-altcha-spam-filter": "1" } : {}
|
|
914
1045
|
});
|
|
915
|
-
if (
|
|
916
|
-
throw new Error(`Server responded with ${
|
|
917
|
-
const
|
|
918
|
-
if (
|
|
919
|
-
const
|
|
920
|
-
L > 0 &&
|
|
1046
|
+
if (h.status !== 200)
|
|
1047
|
+
throw new Error(`Server responded with ${h.status}.`);
|
|
1048
|
+
const w = h.headers.get("Expires"), T = h.headers.get("X-Altcha-Config"), P = await h.json(), N = new URLSearchParams((i = P.salt.split("?")) == null ? void 0 : i[1]), G = N.get("expires") || N.get("expire");
|
|
1049
|
+
if (G) {
|
|
1050
|
+
const y = new Date(+G * 1e3), L = isNaN(y.getTime()) ? 0 : y.getTime() - Date.now();
|
|
1051
|
+
L > 0 && Ae(L);
|
|
921
1052
|
}
|
|
922
|
-
if (
|
|
1053
|
+
if (T)
|
|
923
1054
|
try {
|
|
924
|
-
const
|
|
925
|
-
|
|
926
|
-
} catch (
|
|
927
|
-
|
|
1055
|
+
const y = JSON.parse(T);
|
|
1056
|
+
y && typeof y == "object" && (y.verifyurl && (y.verifyurl = new URL(y.verifyurl, new URL(m)).toString()), et(y));
|
|
1057
|
+
} catch (y) {
|
|
1058
|
+
k("unable to configure from X-Altcha-Config", y);
|
|
928
1059
|
}
|
|
929
|
-
if (!
|
|
930
|
-
const
|
|
931
|
-
if (
|
|
932
|
-
const L =
|
|
933
|
-
L > 0 &&
|
|
1060
|
+
if (!J && (w != null && w.length)) {
|
|
1061
|
+
const y = Date.parse(w);
|
|
1062
|
+
if (y) {
|
|
1063
|
+
const L = y - Date.now();
|
|
1064
|
+
L > 0 && Ae(L);
|
|
934
1065
|
}
|
|
935
1066
|
}
|
|
936
|
-
return
|
|
1067
|
+
return P;
|
|
937
1068
|
}
|
|
938
1069
|
}
|
|
939
|
-
function
|
|
940
|
-
|
|
1070
|
+
function Ge() {
|
|
1071
|
+
if (!V)
|
|
1072
|
+
if (g) {
|
|
1073
|
+
if (k("analytics enabled"), t(11, V = new dn(g)), c === void 0) {
|
|
1074
|
+
const i = g.getAttribute("action");
|
|
1075
|
+
i && t(19, c = i + "/beacon");
|
|
1076
|
+
}
|
|
1077
|
+
t(11, V.beaconUrl = c || null, V);
|
|
1078
|
+
} else
|
|
1079
|
+
k("analytics cannot be enabled - form element not found");
|
|
1080
|
+
}
|
|
1081
|
+
function Je() {
|
|
1082
|
+
m && d && B === _.VERIFIED ? ie() : Le(_.EXPIRED, u.expired);
|
|
941
1083
|
}
|
|
942
|
-
async function
|
|
943
|
-
let
|
|
1084
|
+
async function It(i) {
|
|
1085
|
+
let h = null;
|
|
944
1086
|
if ("Worker" in window) {
|
|
945
1087
|
try {
|
|
946
|
-
|
|
947
|
-
} catch (
|
|
948
|
-
|
|
1088
|
+
h = await xt(i.challenge, i.salt, i.algorithm, i.maxnumber);
|
|
1089
|
+
} catch (w) {
|
|
1090
|
+
k(w);
|
|
949
1091
|
}
|
|
950
|
-
if ((
|
|
951
|
-
return { data:
|
|
1092
|
+
if ((h == null ? void 0 : h.number) !== void 0)
|
|
1093
|
+
return { data: i, solution: h };
|
|
952
1094
|
}
|
|
953
1095
|
return {
|
|
954
|
-
data:
|
|
955
|
-
solution: await
|
|
1096
|
+
data: i,
|
|
1097
|
+
solution: await hn(i.challenge, i.salt, i.algorithm, i.maxnumber || C).promise
|
|
956
1098
|
};
|
|
957
1099
|
}
|
|
958
|
-
async function
|
|
959
|
-
const
|
|
960
|
-
|
|
961
|
-
for (let L = 0; L <
|
|
962
|
-
|
|
963
|
-
const
|
|
964
|
-
const
|
|
965
|
-
return new Promise((
|
|
966
|
-
L.addEventListener("message", (
|
|
967
|
-
if (
|
|
968
|
-
for (const
|
|
969
|
-
|
|
970
|
-
|
|
1100
|
+
async function xt(i, h, w, T = typeof Z == "number" ? Z : C, P = Math.ceil(ue)) {
|
|
1101
|
+
const N = [];
|
|
1102
|
+
P = Math.min(16, Math.max(1, P));
|
|
1103
|
+
for (let L = 0; L < P; L++)
|
|
1104
|
+
N.push(createAltchaWorker(ke));
|
|
1105
|
+
const G = Math.ceil(T / P), y = await Promise.all(N.map((L, De) => {
|
|
1106
|
+
const he = De * G;
|
|
1107
|
+
return new Promise((Ie) => {
|
|
1108
|
+
L.addEventListener("message", (xe) => {
|
|
1109
|
+
if (xe.data)
|
|
1110
|
+
for (const de of N)
|
|
1111
|
+
de !== L && de.postMessage({ type: "abort" });
|
|
1112
|
+
Ie(xe.data);
|
|
971
1113
|
}), L.postMessage({
|
|
972
1114
|
payload: {
|
|
973
|
-
alg:
|
|
974
|
-
challenge:
|
|
975
|
-
max:
|
|
976
|
-
salt:
|
|
977
|
-
start:
|
|
1115
|
+
alg: w,
|
|
1116
|
+
challenge: i,
|
|
1117
|
+
max: he + G,
|
|
1118
|
+
salt: h,
|
|
1119
|
+
start: he
|
|
978
1120
|
},
|
|
979
1121
|
type: "work"
|
|
980
1122
|
});
|
|
981
1123
|
});
|
|
982
1124
|
}));
|
|
983
|
-
for (const L of
|
|
1125
|
+
for (const L of N)
|
|
984
1126
|
L.terminate();
|
|
985
|
-
return
|
|
1127
|
+
return y.find((L) => !!L) || null;
|
|
986
1128
|
}
|
|
987
|
-
function
|
|
988
|
-
[
|
|
1129
|
+
function Tt() {
|
|
1130
|
+
[_.UNVERIFIED, _.ERROR, _.EXPIRED].includes(B) ? E && (g == null ? void 0 : g.reportValidity()) === !1 ? t(8, Q = !1) : ie() : t(8, Q = !0);
|
|
989
1131
|
}
|
|
990
|
-
function
|
|
991
|
-
const
|
|
992
|
-
|
|
1132
|
+
function Xe(i) {
|
|
1133
|
+
const h = i.target;
|
|
1134
|
+
b && h && !A.contains(h) && B === _.VERIFIED && t(9, A.style.display = "none", A);
|
|
993
1135
|
}
|
|
994
|
-
function
|
|
995
|
-
|
|
1136
|
+
function We() {
|
|
1137
|
+
b && Se();
|
|
996
1138
|
}
|
|
997
|
-
function
|
|
998
|
-
|
|
1139
|
+
function ze() {
|
|
1140
|
+
B === _.VERIFYING && u.waitAlert && alert(u.waitAlert);
|
|
999
1141
|
}
|
|
1000
|
-
function
|
|
1001
|
-
|
|
1002
|
-
|
|
1142
|
+
function Ft(i) {
|
|
1143
|
+
V && V.trackError(Ce);
|
|
1144
|
+
}
|
|
1145
|
+
function Rt(i) {
|
|
1146
|
+
b && B !== _.UNVERIFIED && requestAnimationFrame(() => {
|
|
1147
|
+
Se();
|
|
1003
1148
|
});
|
|
1004
1149
|
}
|
|
1005
|
-
function
|
|
1006
|
-
|
|
1150
|
+
function Ke() {
|
|
1151
|
+
b && Se();
|
|
1007
1152
|
}
|
|
1008
|
-
function
|
|
1009
|
-
|
|
1153
|
+
function Ae(i) {
|
|
1154
|
+
k("expire", i), Y && (clearTimeout(Y), Y = null), i < 1 ? Je() : Y = setTimeout(Je, i);
|
|
1010
1155
|
}
|
|
1011
|
-
function
|
|
1012
|
-
|
|
1156
|
+
function Qe(i) {
|
|
1157
|
+
k("floating", i), b !== i && (t(9, A.style.left = "", A), t(9, A.style.top = "", A)), t(1, b = i === !0 || i === "" ? "auto" : i === !1 || i === "false" ? void 0 : b), b ? (l || t(0, l = "onsubmit"), document.addEventListener("scroll", We), document.addEventListener("click", Xe), window.addEventListener("resize", Ke)) : l === "onsubmit" && t(0, l = void 0);
|
|
1013
1158
|
}
|
|
1014
|
-
function
|
|
1015
|
-
var
|
|
1016
|
-
const
|
|
1017
|
-
return ((
|
|
1159
|
+
function St(i) {
|
|
1160
|
+
var w;
|
|
1161
|
+
const h = g == null ? void 0 : g.querySelector(typeof i == "string" ? `input[name="${i}"]` : 'input[type="email"]:not([data-no-spamfilter])');
|
|
1162
|
+
return ((w = h == null ? void 0 : h.value) == null ? void 0 : w.slice(h.value.indexOf("@"))) || void 0;
|
|
1018
1163
|
}
|
|
1019
|
-
function
|
|
1164
|
+
function Dt(i) {
|
|
1020
1165
|
return [
|
|
1021
|
-
...(
|
|
1166
|
+
...(g == null ? void 0 : g.querySelectorAll(i != null && i.length ? i.map((w) => `input[name="${w}"]`).join(", ") : 'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])')) || []
|
|
1022
1167
|
].reduce(
|
|
1023
|
-
(
|
|
1024
|
-
const
|
|
1025
|
-
return
|
|
1026
|
-
`) :
|
|
1168
|
+
(w, T) => {
|
|
1169
|
+
const P = T.name, N = T.value;
|
|
1170
|
+
return P && N && (w[P] = /\n/.test(N) ? N.replace(new RegExp("(?<!\\r)\\n", "g"), `\r
|
|
1171
|
+
`) : N), w;
|
|
1027
1172
|
},
|
|
1028
1173
|
{}
|
|
1029
1174
|
);
|
|
1030
1175
|
}
|
|
1031
|
-
async function
|
|
1032
|
-
if (!
|
|
1176
|
+
async function Mt(i) {
|
|
1177
|
+
if (!ee)
|
|
1033
1178
|
throw new Error("Attribute verifyurl not set.");
|
|
1034
|
-
|
|
1035
|
-
const
|
|
1036
|
-
if (
|
|
1037
|
-
const { blockedCountries:
|
|
1038
|
-
|
|
1179
|
+
k("requesting server verification from", ee);
|
|
1180
|
+
const h = { payload: i };
|
|
1181
|
+
if (E) {
|
|
1182
|
+
const { blockedCountries: P, classifier: N, disableRules: G, email: y, expectedLanguages: L, expectedCountries: De, fields: he, ipAddress: Ie, text: xe, timeZone: de } = Nt();
|
|
1183
|
+
h.blockedCountries = P, h.classifier = N, h.disableRules = G, h.email = y === !1 ? void 0 : St(y), h.expectedCountries = De, h.expectedLanguages = L || (Ue ? [Ue] : void 0), h.fields = he === !1 ? void 0 : Dt(he), h.ipAddress = Ie === !1 ? void 0 : Ie || "auto", h.text = xe, h.timeZone = de === !1 ? void 0 : de || Ct();
|
|
1039
1184
|
}
|
|
1040
|
-
const
|
|
1041
|
-
body: JSON.stringify(
|
|
1185
|
+
const w = await fetch(ee, {
|
|
1186
|
+
body: JSON.stringify(h),
|
|
1042
1187
|
headers: { "content-type": "application/json" },
|
|
1043
1188
|
method: "POST"
|
|
1044
1189
|
});
|
|
1045
|
-
if (
|
|
1046
|
-
throw new Error(`Server responded with ${
|
|
1047
|
-
const
|
|
1048
|
-
if (
|
|
1190
|
+
if (w.status !== 200)
|
|
1191
|
+
throw new Error(`Server responded with ${w.status}.`);
|
|
1192
|
+
const T = await w.json();
|
|
1193
|
+
if (T != null && T.payload && t(6, ne = T.payload), Re("serververification", T), O && T.classification === "BAD")
|
|
1049
1194
|
throw new Error("SpamFilter returned negative classification.");
|
|
1050
1195
|
}
|
|
1051
|
-
function
|
|
1052
|
-
return
|
|
1196
|
+
function Nt() {
|
|
1197
|
+
return E === "ipAddress" ? {
|
|
1053
1198
|
blockedCountries: void 0,
|
|
1054
1199
|
classifier: void 0,
|
|
1055
1200
|
disableRules: void 0,
|
|
@@ -1060,7 +1205,7 @@ function Qt(n, e, t) {
|
|
|
1060
1205
|
ipAddress: void 0,
|
|
1061
1206
|
text: void 0,
|
|
1062
1207
|
timeZone: void 0
|
|
1063
|
-
} : typeof
|
|
1208
|
+
} : typeof E == "object" ? E : {
|
|
1064
1209
|
blockedCountries: void 0,
|
|
1065
1210
|
classifier: void 0,
|
|
1066
1211
|
disableRules: void 0,
|
|
@@ -1073,297 +1218,316 @@ function Qt(n, e, t) {
|
|
|
1073
1218
|
timeZone: void 0
|
|
1074
1219
|
};
|
|
1075
1220
|
}
|
|
1076
|
-
function
|
|
1077
|
-
if (
|
|
1078
|
-
if (
|
|
1079
|
-
const
|
|
1080
|
-
if (
|
|
1081
|
-
const L =
|
|
1082
|
-
t(
|
|
1221
|
+
function Se(i = 20) {
|
|
1222
|
+
if (A)
|
|
1223
|
+
if (pe || (pe = (K ? document.querySelector(K) : g == null ? void 0 : g.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])')) || g), pe) {
|
|
1224
|
+
const h = parseInt(X, 10) || 12, w = pe.getBoundingClientRect(), T = A.getBoundingClientRect(), P = document.documentElement.clientHeight, N = document.documentElement.clientWidth, G = b === "auto" ? w.bottom + T.height + h + i > P : b === "top", y = Math.max(i, Math.min(N - i - T.width, w.left + w.width / 2 - T.width / 2));
|
|
1225
|
+
if (G ? t(9, A.style.top = `${w.top - (T.height + h)}px`, A) : t(9, A.style.top = `${w.bottom + h}px`, A), t(9, A.style.left = `${y}px`, A), A.setAttribute("data-floating", G ? "top" : "bottom"), te) {
|
|
1226
|
+
const L = te.getBoundingClientRect();
|
|
1227
|
+
t(10, te.style.left = w.left - y + w.width / 2 - L.width / 2 + "px", te);
|
|
1083
1228
|
}
|
|
1084
1229
|
} else
|
|
1085
|
-
|
|
1230
|
+
k("unable to find floating anchor element");
|
|
1086
1231
|
}
|
|
1087
|
-
function
|
|
1088
|
-
|
|
1232
|
+
function et(i) {
|
|
1233
|
+
i.analytics && (t(18, f = i.analytics), Ge()), i.auto !== void 0 && (t(0, l = i.auto), l === "onload" && ie()), i.beaconurl && (t(19, c = i.beaconurl), V && t(11, V.beaconUrl = c, V)), i.floatinganchor !== void 0 && t(23, K = i.floatinganchor), i.delay !== void 0 && t(21, q = i.delay), i.floatingoffset !== void 0 && t(24, X = i.floatingoffset), i.floating !== void 0 && Qe(i.floating), i.expire !== void 0 && (Ae(i.expire), t(22, J = i.expire)), i.challenge && (Ye(i.challenge), o = i.challenge), i.challengeurl !== void 0 && t(17, m = i.challengeurl), i.debug !== void 0 && t(20, $ = !!i.debug), i.hidefooter !== void 0 && t(2, j = !!i.hidefooter), i.hidelogo !== void 0 && t(3, I = !!i.hidelogo), i.maxnumber !== void 0 && t(25, C = +i.maxnumber), i.mockerror !== void 0 && t(26, x = !!i.mockerror), i.name !== void 0 && t(4, R = i.name), i.refetchonexpire !== void 0 && t(27, d = !!i.refetchonexpire), i.spamfilter !== void 0 && t(28, E = typeof i.spamfilter == "object" ? i.spamfilter : !!i.spamfilter), i.strings && t(39, s = i.strings), i.test !== void 0 && t(29, Z = typeof i.test == "number" ? i.test : !!i.test), i.verifyurl !== void 0 && t(30, ee = i.verifyurl), i.workers !== void 0 && t(31, ue = +i.workers), i.workerurl !== void 0 && t(32, ke = i.workerurl);
|
|
1089
1234
|
}
|
|
1090
|
-
function
|
|
1091
|
-
|
|
1235
|
+
function Le(i = _.UNVERIFIED, h = null) {
|
|
1236
|
+
Y && (clearTimeout(Y), Y = null), t(8, Q = !1), t(5, Ce = h), t(6, ne = null), t(7, B = i);
|
|
1092
1237
|
}
|
|
1093
|
-
async function
|
|
1094
|
-
return
|
|
1095
|
-
if (
|
|
1096
|
-
if (
|
|
1097
|
-
return
|
|
1098
|
-
t(
|
|
1238
|
+
async function ie() {
|
|
1239
|
+
return Le(_.VERIFYING), await new Promise((i) => setTimeout(i, q || 0)), Lt().then((i) => (Ye(i), k("challenge", i), It(i))).then(({ data: i, solution: h }) => {
|
|
1240
|
+
if (k("solution", h), (h == null ? void 0 : h.number) !== void 0) {
|
|
1241
|
+
if (ee)
|
|
1242
|
+
return Mt(Ze(i, h));
|
|
1243
|
+
t(6, ne = Ze(i, h)), k("payload", ne);
|
|
1099
1244
|
} else
|
|
1100
|
-
throw
|
|
1245
|
+
throw k("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."), new Error("Unexpected result returned.");
|
|
1101
1246
|
}).then(() => {
|
|
1102
|
-
|
|
1103
|
-
t(
|
|
1247
|
+
Wt().then(() => {
|
|
1248
|
+
t(7, B = _.VERIFIED), t(8, Q = !0), k("verified"), Re("verified", { payload: ne });
|
|
1104
1249
|
});
|
|
1105
|
-
}).catch((
|
|
1106
|
-
|
|
1250
|
+
}).catch((i) => {
|
|
1251
|
+
k(i), t(7, B = _.ERROR), t(8, Q = !1), t(5, Ce = i.message);
|
|
1107
1252
|
});
|
|
1108
1253
|
}
|
|
1109
|
-
function
|
|
1110
|
-
|
|
1254
|
+
function jt() {
|
|
1255
|
+
Q = this.checked, t(8, Q);
|
|
1111
1256
|
}
|
|
1112
|
-
function
|
|
1113
|
-
|
|
1114
|
-
|
|
1257
|
+
function Vt(i) {
|
|
1258
|
+
Fe[i ? "unshift" : "push"](() => {
|
|
1259
|
+
te = i, t(10, te);
|
|
1115
1260
|
});
|
|
1116
1261
|
}
|
|
1117
|
-
function
|
|
1118
|
-
|
|
1119
|
-
|
|
1262
|
+
function Bt(i) {
|
|
1263
|
+
Fe[i ? "unshift" : "push"](() => {
|
|
1264
|
+
A = i, t(9, A);
|
|
1120
1265
|
});
|
|
1121
1266
|
}
|
|
1122
|
-
return n.$$set = (
|
|
1123
|
-
"auto" in
|
|
1267
|
+
return n.$$set = (i) => {
|
|
1268
|
+
"analytics" in i && t(18, f = i.analytics), "auto" in i && t(0, l = i.auto), "beaconurl" in i && t(19, c = i.beaconurl), "blockspam" in i && t(33, O = i.blockspam), "challengeurl" in i && t(17, m = i.challengeurl), "challengejson" in i && t(34, H = i.challengejson), "debug" in i && t(20, $ = i.debug), "delay" in i && t(21, q = i.delay), "expire" in i && t(22, J = i.expire), "floating" in i && t(1, b = i.floating), "floatinganchor" in i && t(23, K = i.floatinganchor), "floatingoffset" in i && t(24, X = i.floatingoffset), "hidefooter" in i && t(2, j = i.hidefooter), "hidelogo" in i && t(3, I = i.hidelogo), "name" in i && t(4, R = i.name), "maxnumber" in i && t(25, C = i.maxnumber), "mockerror" in i && t(26, x = i.mockerror), "refetchonexpire" in i && t(27, d = i.refetchonexpire), "spamfilter" in i && t(28, E = i.spamfilter), "strings" in i && t(35, Ee = i.strings), "test" in i && t(29, Z = i.test), "verifyurl" in i && t(30, ee = i.verifyurl), "workers" in i && t(31, ue = i.workers), "workerurl" in i && t(32, ke = i.workerurl);
|
|
1124
1269
|
}, n.$$.update = () => {
|
|
1125
1270
|
n.$$.dirty[0] & /*challengeurl*/
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
ariaLinkLabel:
|
|
1271
|
+
131072 && t(14, r = !!(m != null && m.includes(".altcha.org")) && !!(m != null && m.includes("apiKey=ckey_"))), n.$$.dirty[1] & /*challengejson*/
|
|
1272
|
+
8 && (o = H ? bt(H) : void 0), n.$$.dirty[1] & /*strings*/
|
|
1273
|
+
16 && t(39, s = Ee ? bt(Ee) : {}), n.$$.dirty[1] & /*parsedStrings*/
|
|
1274
|
+
256 && t(13, u = {
|
|
1275
|
+
ariaLinkLabel: mt,
|
|
1131
1276
|
error: "Verification failed. Try again later.",
|
|
1132
1277
|
expired: "Verification expired. Try again.",
|
|
1133
|
-
footer: `Protected by <a href="${
|
|
1278
|
+
footer: `Protected by <a href="${At}" target="_blank" aria-label="${s.ariaLinkLabel || mt}">ALTCHA</a>`,
|
|
1134
1279
|
label: "I'm not a robot",
|
|
1135
1280
|
verified: "Verified",
|
|
1136
1281
|
verifying: "Verifying...",
|
|
1137
1282
|
waitAlert: "Verifying... please wait.",
|
|
1138
|
-
...
|
|
1283
|
+
...s
|
|
1139
1284
|
}), n.$$.dirty[0] & /*payload, state*/
|
|
1140
|
-
|
|
1141
|
-
|
|
1285
|
+
192 && Re("statechange", { payload: ne, state: B }), n.$$.dirty[0] & /*error*/
|
|
1286
|
+
32 && Ft(), n.$$.dirty[0] & /*state*/
|
|
1287
|
+
128 && Rt();
|
|
1142
1288
|
}, [
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
J,
|
|
1146
|
-
Z,
|
|
1147
|
-
N,
|
|
1148
|
-
Q,
|
|
1289
|
+
l,
|
|
1290
|
+
b,
|
|
1149
1291
|
j,
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
f,
|
|
1155
|
-
i,
|
|
1156
|
-
ut,
|
|
1157
|
-
Fe,
|
|
1158
|
-
u,
|
|
1159
|
-
S,
|
|
1292
|
+
I,
|
|
1293
|
+
R,
|
|
1294
|
+
Ce,
|
|
1295
|
+
ne,
|
|
1160
1296
|
B,
|
|
1161
|
-
|
|
1162
|
-
|
|
1297
|
+
Q,
|
|
1298
|
+
A,
|
|
1299
|
+
te,
|
|
1300
|
+
V,
|
|
1301
|
+
Oe,
|
|
1302
|
+
u,
|
|
1303
|
+
r,
|
|
1304
|
+
Tt,
|
|
1305
|
+
ze,
|
|
1306
|
+
m,
|
|
1307
|
+
f,
|
|
1308
|
+
c,
|
|
1163
1309
|
$,
|
|
1310
|
+
q,
|
|
1311
|
+
J,
|
|
1312
|
+
K,
|
|
1313
|
+
X,
|
|
1314
|
+
C,
|
|
1164
1315
|
x,
|
|
1165
|
-
I,
|
|
1166
|
-
A,
|
|
1167
|
-
w,
|
|
1168
|
-
_,
|
|
1169
|
-
z,
|
|
1170
|
-
oe,
|
|
1171
|
-
ae,
|
|
1172
|
-
h,
|
|
1173
|
-
H,
|
|
1174
1316
|
d,
|
|
1175
|
-
|
|
1176
|
-
|
|
1317
|
+
E,
|
|
1318
|
+
Z,
|
|
1177
1319
|
ee,
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1320
|
+
ue,
|
|
1321
|
+
ke,
|
|
1322
|
+
O,
|
|
1323
|
+
H,
|
|
1324
|
+
Ee,
|
|
1325
|
+
et,
|
|
1326
|
+
Le,
|
|
1327
|
+
ie,
|
|
1328
|
+
s,
|
|
1329
|
+
jt,
|
|
1330
|
+
Vt,
|
|
1331
|
+
Bt
|
|
1182
1332
|
];
|
|
1183
1333
|
}
|
|
1184
|
-
class
|
|
1334
|
+
class En extends ln {
|
|
1185
1335
|
constructor(e) {
|
|
1186
|
-
super(),
|
|
1336
|
+
super(), on(
|
|
1187
1337
|
this,
|
|
1188
1338
|
e,
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1339
|
+
vn,
|
|
1340
|
+
yn,
|
|
1341
|
+
Ot,
|
|
1192
1342
|
{
|
|
1343
|
+
analytics: 18,
|
|
1193
1344
|
auto: 0,
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1345
|
+
beaconurl: 19,
|
|
1346
|
+
blockspam: 33,
|
|
1347
|
+
challengeurl: 17,
|
|
1348
|
+
challengejson: 34,
|
|
1349
|
+
debug: 20,
|
|
1350
|
+
delay: 21,
|
|
1351
|
+
expire: 22,
|
|
1200
1352
|
floating: 1,
|
|
1201
|
-
floatinganchor:
|
|
1202
|
-
floatingoffset:
|
|
1353
|
+
floatinganchor: 23,
|
|
1354
|
+
floatingoffset: 24,
|
|
1203
1355
|
hidefooter: 2,
|
|
1204
1356
|
hidelogo: 3,
|
|
1205
1357
|
name: 4,
|
|
1206
|
-
maxnumber:
|
|
1207
|
-
mockerror:
|
|
1208
|
-
refetchonexpire:
|
|
1209
|
-
spamfilter:
|
|
1210
|
-
strings:
|
|
1211
|
-
test:
|
|
1212
|
-
verifyurl:
|
|
1213
|
-
workers:
|
|
1214
|
-
workerurl:
|
|
1215
|
-
configure:
|
|
1216
|
-
reset:
|
|
1217
|
-
verify:
|
|
1358
|
+
maxnumber: 25,
|
|
1359
|
+
mockerror: 26,
|
|
1360
|
+
refetchonexpire: 27,
|
|
1361
|
+
spamfilter: 28,
|
|
1362
|
+
strings: 35,
|
|
1363
|
+
test: 29,
|
|
1364
|
+
verifyurl: 30,
|
|
1365
|
+
workers: 31,
|
|
1366
|
+
workerurl: 32,
|
|
1367
|
+
configure: 36,
|
|
1368
|
+
reset: 37,
|
|
1369
|
+
verify: 38
|
|
1218
1370
|
},
|
|
1219
1371
|
null,
|
|
1220
1372
|
[-1, -1, -1]
|
|
1221
1373
|
);
|
|
1222
1374
|
}
|
|
1375
|
+
get analytics() {
|
|
1376
|
+
return this.$$.ctx[18];
|
|
1377
|
+
}
|
|
1378
|
+
set analytics(e) {
|
|
1379
|
+
this.$$set({ analytics: e }), v();
|
|
1380
|
+
}
|
|
1223
1381
|
get auto() {
|
|
1224
1382
|
return this.$$.ctx[0];
|
|
1225
1383
|
}
|
|
1226
1384
|
set auto(e) {
|
|
1227
|
-
this.$$set({ auto: e }),
|
|
1385
|
+
this.$$set({ auto: e }), v();
|
|
1386
|
+
}
|
|
1387
|
+
get beaconurl() {
|
|
1388
|
+
return this.$$.ctx[19];
|
|
1389
|
+
}
|
|
1390
|
+
set beaconurl(e) {
|
|
1391
|
+
this.$$set({ beaconurl: e }), v();
|
|
1228
1392
|
}
|
|
1229
1393
|
get blockspam() {
|
|
1230
|
-
return this.$$.ctx[
|
|
1394
|
+
return this.$$.ctx[33];
|
|
1231
1395
|
}
|
|
1232
1396
|
set blockspam(e) {
|
|
1233
|
-
this.$$set({ blockspam: e }),
|
|
1397
|
+
this.$$set({ blockspam: e }), v();
|
|
1234
1398
|
}
|
|
1235
1399
|
get challengeurl() {
|
|
1236
|
-
return this.$$.ctx[
|
|
1400
|
+
return this.$$.ctx[17];
|
|
1237
1401
|
}
|
|
1238
1402
|
set challengeurl(e) {
|
|
1239
|
-
this.$$set({ challengeurl: e }),
|
|
1403
|
+
this.$$set({ challengeurl: e }), v();
|
|
1240
1404
|
}
|
|
1241
1405
|
get challengejson() {
|
|
1242
|
-
return this.$$.ctx[
|
|
1406
|
+
return this.$$.ctx[34];
|
|
1243
1407
|
}
|
|
1244
1408
|
set challengejson(e) {
|
|
1245
|
-
this.$$set({ challengejson: e }),
|
|
1409
|
+
this.$$set({ challengejson: e }), v();
|
|
1246
1410
|
}
|
|
1247
1411
|
get debug() {
|
|
1248
|
-
return this.$$.ctx[
|
|
1412
|
+
return this.$$.ctx[20];
|
|
1249
1413
|
}
|
|
1250
1414
|
set debug(e) {
|
|
1251
|
-
this.$$set({ debug: e }),
|
|
1415
|
+
this.$$set({ debug: e }), v();
|
|
1252
1416
|
}
|
|
1253
1417
|
get delay() {
|
|
1254
|
-
return this.$$.ctx[
|
|
1418
|
+
return this.$$.ctx[21];
|
|
1255
1419
|
}
|
|
1256
1420
|
set delay(e) {
|
|
1257
|
-
this.$$set({ delay: e }),
|
|
1421
|
+
this.$$set({ delay: e }), v();
|
|
1258
1422
|
}
|
|
1259
1423
|
get expire() {
|
|
1260
|
-
return this.$$.ctx[
|
|
1424
|
+
return this.$$.ctx[22];
|
|
1261
1425
|
}
|
|
1262
1426
|
set expire(e) {
|
|
1263
|
-
this.$$set({ expire: e }),
|
|
1427
|
+
this.$$set({ expire: e }), v();
|
|
1264
1428
|
}
|
|
1265
1429
|
get floating() {
|
|
1266
1430
|
return this.$$.ctx[1];
|
|
1267
1431
|
}
|
|
1268
1432
|
set floating(e) {
|
|
1269
|
-
this.$$set({ floating: e }),
|
|
1433
|
+
this.$$set({ floating: e }), v();
|
|
1270
1434
|
}
|
|
1271
1435
|
get floatinganchor() {
|
|
1272
|
-
return this.$$.ctx[
|
|
1436
|
+
return this.$$.ctx[23];
|
|
1273
1437
|
}
|
|
1274
1438
|
set floatinganchor(e) {
|
|
1275
|
-
this.$$set({ floatinganchor: e }),
|
|
1439
|
+
this.$$set({ floatinganchor: e }), v();
|
|
1276
1440
|
}
|
|
1277
1441
|
get floatingoffset() {
|
|
1278
|
-
return this.$$.ctx[
|
|
1442
|
+
return this.$$.ctx[24];
|
|
1279
1443
|
}
|
|
1280
1444
|
set floatingoffset(e) {
|
|
1281
|
-
this.$$set({ floatingoffset: e }),
|
|
1445
|
+
this.$$set({ floatingoffset: e }), v();
|
|
1282
1446
|
}
|
|
1283
1447
|
get hidefooter() {
|
|
1284
1448
|
return this.$$.ctx[2];
|
|
1285
1449
|
}
|
|
1286
1450
|
set hidefooter(e) {
|
|
1287
|
-
this.$$set({ hidefooter: e }),
|
|
1451
|
+
this.$$set({ hidefooter: e }), v();
|
|
1288
1452
|
}
|
|
1289
1453
|
get hidelogo() {
|
|
1290
1454
|
return this.$$.ctx[3];
|
|
1291
1455
|
}
|
|
1292
1456
|
set hidelogo(e) {
|
|
1293
|
-
this.$$set({ hidelogo: e }),
|
|
1457
|
+
this.$$set({ hidelogo: e }), v();
|
|
1294
1458
|
}
|
|
1295
1459
|
get name() {
|
|
1296
1460
|
return this.$$.ctx[4];
|
|
1297
1461
|
}
|
|
1298
1462
|
set name(e) {
|
|
1299
|
-
this.$$set({ name: e }),
|
|
1463
|
+
this.$$set({ name: e }), v();
|
|
1300
1464
|
}
|
|
1301
1465
|
get maxnumber() {
|
|
1302
|
-
return this.$$.ctx[
|
|
1466
|
+
return this.$$.ctx[25];
|
|
1303
1467
|
}
|
|
1304
1468
|
set maxnumber(e) {
|
|
1305
|
-
this.$$set({ maxnumber: e }),
|
|
1469
|
+
this.$$set({ maxnumber: e }), v();
|
|
1306
1470
|
}
|
|
1307
1471
|
get mockerror() {
|
|
1308
|
-
return this.$$.ctx[
|
|
1472
|
+
return this.$$.ctx[26];
|
|
1309
1473
|
}
|
|
1310
1474
|
set mockerror(e) {
|
|
1311
|
-
this.$$set({ mockerror: e }),
|
|
1475
|
+
this.$$set({ mockerror: e }), v();
|
|
1312
1476
|
}
|
|
1313
1477
|
get refetchonexpire() {
|
|
1314
|
-
return this.$$.ctx[
|
|
1478
|
+
return this.$$.ctx[27];
|
|
1315
1479
|
}
|
|
1316
1480
|
set refetchonexpire(e) {
|
|
1317
|
-
this.$$set({ refetchonexpire: e }),
|
|
1481
|
+
this.$$set({ refetchonexpire: e }), v();
|
|
1318
1482
|
}
|
|
1319
1483
|
get spamfilter() {
|
|
1320
|
-
return this.$$.ctx[
|
|
1484
|
+
return this.$$.ctx[28];
|
|
1321
1485
|
}
|
|
1322
1486
|
set spamfilter(e) {
|
|
1323
|
-
this.$$set({ spamfilter: e }),
|
|
1487
|
+
this.$$set({ spamfilter: e }), v();
|
|
1324
1488
|
}
|
|
1325
1489
|
get strings() {
|
|
1326
|
-
return this.$$.ctx[
|
|
1490
|
+
return this.$$.ctx[35];
|
|
1327
1491
|
}
|
|
1328
1492
|
set strings(e) {
|
|
1329
|
-
this.$$set({ strings: e }),
|
|
1493
|
+
this.$$set({ strings: e }), v();
|
|
1330
1494
|
}
|
|
1331
1495
|
get test() {
|
|
1332
|
-
return this.$$.ctx[
|
|
1496
|
+
return this.$$.ctx[29];
|
|
1333
1497
|
}
|
|
1334
1498
|
set test(e) {
|
|
1335
|
-
this.$$set({ test: e }),
|
|
1499
|
+
this.$$set({ test: e }), v();
|
|
1336
1500
|
}
|
|
1337
1501
|
get verifyurl() {
|
|
1338
|
-
return this.$$.ctx[
|
|
1502
|
+
return this.$$.ctx[30];
|
|
1339
1503
|
}
|
|
1340
1504
|
set verifyurl(e) {
|
|
1341
|
-
this.$$set({ verifyurl: e }),
|
|
1505
|
+
this.$$set({ verifyurl: e }), v();
|
|
1342
1506
|
}
|
|
1343
1507
|
get workers() {
|
|
1344
|
-
return this.$$.ctx[
|
|
1508
|
+
return this.$$.ctx[31];
|
|
1345
1509
|
}
|
|
1346
1510
|
set workers(e) {
|
|
1347
|
-
this.$$set({ workers: e }),
|
|
1511
|
+
this.$$set({ workers: e }), v();
|
|
1348
1512
|
}
|
|
1349
1513
|
get workerurl() {
|
|
1350
|
-
return this.$$.ctx[
|
|
1514
|
+
return this.$$.ctx[32];
|
|
1351
1515
|
}
|
|
1352
1516
|
set workerurl(e) {
|
|
1353
|
-
this.$$set({ workerurl: e }),
|
|
1517
|
+
this.$$set({ workerurl: e }), v();
|
|
1354
1518
|
}
|
|
1355
1519
|
get configure() {
|
|
1356
|
-
return this.$$.ctx[
|
|
1520
|
+
return this.$$.ctx[36];
|
|
1357
1521
|
}
|
|
1358
1522
|
get reset() {
|
|
1359
|
-
return this.$$.ctx[
|
|
1523
|
+
return this.$$.ctx[37];
|
|
1360
1524
|
}
|
|
1361
1525
|
get verify() {
|
|
1362
|
-
return this.$$.ctx[
|
|
1526
|
+
return this.$$.ctx[38];
|
|
1363
1527
|
}
|
|
1364
1528
|
}
|
|
1365
|
-
customElements.define("altcha-widget",
|
|
1529
|
+
customElements.define("altcha-widget", sn(En, { analytics: { type: "Boolean" }, auto: {}, beaconurl: {}, blockspam: {}, challengeurl: {}, challengejson: {}, debug: { type: "Boolean" }, delay: {}, expire: {}, floating: {}, floatinganchor: {}, floatingoffset: {}, hidefooter: { type: "Boolean" }, hidelogo: { type: "Boolean" }, name: {}, maxnumber: {}, mockerror: { type: "Boolean" }, refetchonexpire: { type: "Boolean" }, spamfilter: { type: "Boolean" }, strings: {}, test: { type: "Boolean" }, verifyurl: {}, workers: {}, workerurl: {} }, [], ["configure", "reset", "verify"], !1));
|
|
1366
1530
|
globalThis.createAltchaWorker = (n) => new Worker(new URL(n || "./worker.js", import.meta.url));
|
|
1367
1531
|
export {
|
|
1368
|
-
|
|
1532
|
+
En as Altcha
|
|
1369
1533
|
};
|