altcha 0.6.2 → 0.6.4

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