altcha 2.2.0 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/altcha.i18n.js +237 -237
- package/dist/altcha.i18n.umd.js +4 -4
- package/dist/altcha.js +237 -237
- package/dist/altcha.umd.cjs +4 -4
- package/dist_external/altcha.js +237 -237
- package/dist_external/altcha.umd.cjs +3 -3
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(x,S){typeof exports=="object"&&typeof module<"u"?S(exports):typeof define=="function"&&define.amd?define(["exports"],S):(x=typeof globalThis<"u"?globalThis:x||self,S(x.altcha={}))})(this,function(x){"use strict";var Da=Object.defineProperty;var Qi=x=>{throw TypeError(x)};var La=(x,S,Z)=>S in x?Da(x,S,{enumerable:!0,configurable:!0,writable:!0,value:Z}):x[S]=Z;var $e=(x,S,Z)=>La(x,typeof S!="symbol"?S+"":S,Z),el=(x,S,Z)=>S.has(x)||Qi("Cannot "+Z);var ve=(x,S,Z)=>(el(x,S,"read from private field"),Z?Z.call(x):S.get(x)),rr=(x,S,Z)=>S.has(x)?Qi("Cannot add the same private member more than once"):S instanceof WeakSet?S.add(x):S.set(x,Z),ir=(x,S,Z,Xt)=>(el(x,S,"write to private field"),Xt?Xt.call(x,Z):S.set(x,Z),Z);var hi,Me,ye;var S=typeof document<"u"?document.currentScript:null;const Z="5";typeof window<"u"&&((hi=window.__svelte??(window.__svelte={})).v??(hi.v=new Set)).add(Z);const Xt=1,tl=4,nl=8,rl=16,il=1,ll=2,kn="[",lr="[!",or="]",vt={},ue=Symbol(),ol="http://www.w3.org/1999/xhtml",ar=!1;function sr(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}var ur=Array.isArray,al=Array.prototype.indexOf,sl=Array.from,zt=Object.keys,St=Object.defineProperty,ze=Object.getOwnPropertyDescriptor,ul=Object.getOwnPropertyDescriptors,fl=Object.prototype,cl=Array.prototype,fr=Object.getPrototypeOf,cr=Object.isExtensible;const ht=()=>{};function dr(e){for(var t=0;t<e.length;t++)e[t]()}function dl(e,t,n=!1){return e===void 0?n?t():t:e}const Ee=2,vr=4,Qt=8,$n=16,Ve=32,Qe=64,en=128,he=256,tn=512,fe=1024,xe=2048,et=4096,gt=8192,nn=16384,vl=32768,xn=65536,hl=1<<19,hr=1<<20,Sn=1<<21,Tt=Symbol("$state"),gr=Symbol("legacy props"),gl=Symbol("");function _l(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function ml(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function bl(e){throw new Error("https://svelte.dev/e/effect_orphan")}function pl(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function yl(){throw new Error("https://svelte.dev/e/hydration_failed")}function wl(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function El(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Cl(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Al(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function rn(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let F=!1;function _t(e){F=e}let V;function qe(e){if(e===null)throw rn(),vt;return V=e}function mt(){return qe(Be(V))}function W(e){if(F){if(Be(V)!==null)throw rn(),vt;V=e}}function Il(){for(var e=0,t=V;;){if(t.nodeType===8){var n=t.data;if(n===or){if(e===0)return t;e-=1}else(n===kn||n===lr)&&(e+=1)}var i=Be(t);t.remove(),t=i}}let Rl=!1;function je(e){if(typeof e!="object"||e===null||Tt in e)return e;const t=fr(e);if(t!==fl&&t!==cl)return e;var n=new Map,i=ur(e),a=P(0),l=D,f=s=>{var c=D;Ne(l);var d=s();return Ne(c),d};return i&&n.set("length",P(e.length)),new Proxy(e,{defineProperty(s,c,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&El();var b=n.get(c);return b===void 0?(b=f(()=>P(d.value)),n.set(c,b)):p(b,f(()=>je(d.value))),!0},deleteProperty(s,c){var d=n.get(c);if(d===void 0)c in s&&(n.set(c,f(()=>P(ue))),Tn(a));else{if(i&&typeof c=="string"){var b=n.get("length"),h=Number(c);Number.isInteger(h)&&h<b.v&&p(b,h)}p(d,ue),Tn(a)}return!0},get(s,c,d){var y;if(c===Tt)return e;var b=n.get(c),h=c in s;if(b===void 0&&(!h||(y=ze(s,c))!=null&&y.writable)&&(b=f(()=>P(je(h?s[c]:ue))),n.set(c,b)),b!==void 0){var m=o(b);return m===ue?void 0:m}return Reflect.get(s,c,d)},getOwnPropertyDescriptor(s,c){var d=Reflect.getOwnPropertyDescriptor(s,c);if(d&&"value"in d){var b=n.get(c);b&&(d.value=o(b))}else if(d===void 0){var h=n.get(c),m=h==null?void 0:h.v;if(h!==void 0&&m!==ue)return{enumerable:!0,configurable:!0,value:m,writable:!0}}return d},has(s,c){var m;if(c===Tt)return!0;var d=n.get(c),b=d!==void 0&&d.v!==ue||Reflect.has(s,c);if(d!==void 0||L!==null&&(!b||(m=ze(s,c))!=null&&m.writable)){d===void 0&&(d=f(()=>P(b?je(s[c]):ue)),n.set(c,d));var h=o(d);if(h===ue)return!1}return b},set(s,c,d,b){var te;var h=n.get(c),m=c in s;if(i&&c==="length")for(var y=d;y<h.v;y+=1){var N=n.get(y+"");N!==void 0?p(N,ue):y in s&&(N=f(()=>P(ue)),n.set(y+"",N))}h===void 0?(!m||(te=ze(s,c))!=null&&te.writable)&&(h=f(()=>P(void 0)),p(h,f(()=>je(d))),n.set(c,h)):(m=h.v!==ue,p(h,f(()=>je(d))));var E=Reflect.getOwnPropertyDescriptor(s,c);if(E!=null&&E.set&&E.set.call(b,d),!m){if(i&&typeof c=="string"){var j=n.get("length"),_e=Number(c);Number.isInteger(_e)&&_e>=j.v&&p(j,_e+1)}Tn(a)}return!0},ownKeys(s){o(a);var c=Reflect.ownKeys(s).filter(h=>{var m=n.get(h);return m===void 0||m.v!==ue});for(var[d,b]of n)b.v!==ue&&!(d in s)&&c.push(d);return c},setPrototypeOf(){Cl()}})}function Tn(e,t=1){p(e,e.v+t)}var _r,mr,br,pr;function Nn(){if(_r===void 0){_r=window,mr=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;br=ze(t,"firstChild").get,pr=ze(t,"nextSibling").get,cr(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),cr(n)&&(n.__t=void 0)}}function ln(e=""){return document.createTextNode(e)}function be(e){return br.call(e)}function Be(e){return pr.call(e)}function J(e,t){if(!F)return be(e);var n=be(V);return n===null&&(n=V.appendChild(ln())),qe(n),n}function Nt(e,t){if(!F){var n=be(e);return n instanceof Comment&&n.data===""?Be(n):n}return V}function K(e,t=1,n=!1){let i=F?V:e;for(var a;t--;)a=i,i=Be(i);if(!F)return i;var l=i==null?void 0:i.nodeType;if(n&&l!==3){var f=ln();return i===null?a==null||a.after(f):i.before(f),qe(f),f}return qe(i),i}function kl(e){e.textContent=""}function yr(e){return e===this.v}function wr(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Dn(e){return!wr(e,this.v)}function on(e){var t=Ee|xe,n=D!==null&&(D.f&Ee)!==0?D:null;return L===null||n!==null&&(n.f&he)!==0?t|=he:L.f|=hr,{ctx:oe,deps:null,effects:null,equals:yr,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:n??L}}function Dt(e){const t=on(e);return Or(t),t}function $l(e){const t=on(e);return t.equals=Dn,t}function Er(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)He(t[n])}}function xl(e){for(var t=e.parent;t!==null;){if((t.f&Ee)===0)return t;t=t.parent}return null}function Cr(e){var t,n=L;Ye(xl(e));try{Er(e),t=qr(e)}finally{Ye(n)}return t}function Ar(e){var t=Cr(e),n=(Ge||(e.f&he)!==0)&&e.deps!==null?et:fe;Ce(e,n),e.equals(t)||(e.v=t,e.wv=Vr())}function Sl(e){L===null&&D===null&&bl(),D!==null&&(D.f&he)!==0&&L===null&&ml(),Ot&&_l()}function Tl(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function tt(e,t,n,i=!0){var a=L,l={ctx:oe,deps:null,nodes_start:null,nodes_end:null,f:e|xe,first:null,fn:t,last:null,next:null,parent:a,prev:null,teardown:null,transitions:null,wv:0};if(n)try{qn(l),l.f|=vl}catch(c){throw He(l),c}else t!==null&&vn(l);var f=n&&l.deps===null&&l.first===null&&l.nodes_start===null&&l.teardown===null&&(l.f&(hr|en))===0;if(!f&&i&&(a!==null&&Tl(l,a),D!==null&&(D.f&Ee)!==0)){var s=D;(s.effects??(s.effects=[])).push(l)}return l}function Ln(e){const t=tt(Qt,null,!1);return Ce(t,fe),t.teardown=e,t}function Pn(e){Sl();var t=L!==null&&(L.f&Ve)!==0&&oe!==null&&!oe.m;if(t){var n=oe;(n.e??(n.e=[])).push({fn:e,effect:L,reaction:D})}else{var i=On(e);return i}}function Nl(e){const t=tt(Qe,e,!0);return()=>{He(t)}}function Dl(e){const t=tt(Qe,e,!0);return(n={})=>new Promise(i=>{n.outro?Mn(t,()=>{He(t),i(void 0)}):(He(t),i(void 0))})}function On(e){return tt(vr,e,!1)}function Fn(e){return tt(Qt,e,!0)}function Se(e,t=[],n=on){const i=t.map(n);return Ir(()=>e(...i.map(o)))}function Ir(e,t=0){return tt(Qt|$n|t,e,!0)}function Vn(e,t=!0){return tt(Qt|Ve,e,!0,t)}function Rr(e){var t=e.teardown;if(t!==null){const n=Ot,i=D;Pr(!0),Ne(null);try{t.call(null)}finally{Pr(n),Ne(i)}}}function kr(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){var i=n.next;(n.f&Qe)!==0?n.parent=null:He(n,t),n=i}}function Ll(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&Ve)===0&&He(t),t=n}}function He(e,t=!0){var n=!1;(t||(e.f&hl)!==0)&&e.nodes_start!==null&&($r(e.nodes_start,e.nodes_end),n=!0),kr(e,t&&!n),dn(e,0),Ce(e,nn);var i=e.transitions;if(i!==null)for(const l of i)l.stop();Rr(e);var a=e.parent;a!==null&&a.first!==null&&xr(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function $r(e,t){for(;e!==null;){var n=e===t?null:Be(e);e.remove(),e=n}}function xr(e){var t=e.parent,n=e.prev,i=e.next;n!==null&&(n.next=i),i!==null&&(i.prev=n),t!==null&&(t.first===e&&(t.first=i),t.last===e&&(t.last=n))}function Mn(e,t){var n=[];Sr(e,n,!0),Pl(n,()=>{He(e),t&&t()})}function Pl(e,t){var n=e.length;if(n>0){var i=()=>--n||t();for(var a of e)a.out(i)}else t()}function Sr(e,t,n){if((e.f>)===0){if(e.f^=gt,e.transitions!==null)for(const f of e.transitions)(f.is_global||n)&&t.push(f);for(var i=e.first;i!==null;){var a=i.next,l=(i.f&xn)!==0||(i.f&Ve)!==0;Sr(i,t,l?n:!1),i=a}}}function Tr(e){Nr(e,!0)}function Nr(e,t){if((e.f>)!==0){e.f^=gt,(e.f&fe)===0&&(e.f^=fe),Vt(e)&&(Ce(e,xe),vn(e));for(var n=e.first;n!==null;){var i=n.next,a=(n.f&xn)!==0||(n.f&Ve)!==0;Nr(n,a?t:!1),n=i}if(e.transitions!==null)for(const l of e.transitions)(l.is_global||t)&&l.in()}}const Ol=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let Lt=[],Pt=[];function Dr(){var e=Lt;Lt=[],dr(e)}function Lr(){var e=Pt;Pt=[],dr(e)}function Un(e){Lt.length===0&&queueMicrotask(Dr),Lt.push(e)}function Fl(e){Pt.length===0&&Ol(Lr),Pt.push(e)}function Vl(){Lt.length>0&&Dr(),Pt.length>0&&Lr()}let an=!1,sn=!1,un=null,nt=!1,Ot=!1;function Pr(e){Ot=e}let Ft=[],Pa=[],D=null,Te=!1;function Ne(e){D=e}let L=null;function Ye(e){L=e}let ie=null;function Or(e){D!==null&&D.f&Sn&&(ie===null?ie=[e]:ie.push(e))}let le=null,ge=0,pe=null;function Ml(e){pe=e}let Fr=1,fn=0,Ge=!1;function Vr(){return++Fr}function Vt(e){var h;var t=e.f;if((t&xe)!==0)return!0;if((t&et)!==0){var n=e.deps,i=(t&he)!==0;if(n!==null){var a,l,f=(t&tn)!==0,s=i&&L!==null&&!Ge,c=n.length;if(f||s){var d=e,b=d.parent;for(a=0;a<c;a++)l=n[a],(f||!((h=l==null?void 0:l.reactions)!=null&&h.includes(d)))&&(l.reactions??(l.reactions=[])).push(d);f&&(d.f^=tn),s&&b!==null&&(b.f&he)===0&&(d.f^=he)}for(a=0;a<c;a++)if(l=n[a],Vt(l)&&Ar(l),l.wv>e.wv)return!0}(!i||L!==null&&!Ge)&&Ce(e,fe)}return!1}function Ul(e,t){for(var n=t;n!==null;){if((n.f&en)!==0)try{n.fn(e);return}catch{n.f^=en}n=n.parent}throw an=!1,e}function Mr(e){return(e.f&nn)===0&&(e.parent===null||(e.parent.f&en)===0)}function cn(e,t,n,i){if(an){if(n===null&&(an=!1),Mr(t))throw e;return}if(n!==null&&(an=!0),Ul(e,t),Mr(t))throw e}function Ur(e,t,n=!0){var i=e.reactions;if(i!==null)for(var a=0;a<i.length;a++){var l=i[a];ie!=null&&ie.includes(e)||((l.f&Ee)!==0?Ur(l,t,!1):t===l&&(n?Ce(l,xe):(l.f&fe)!==0&&Ce(l,et),vn(l)))}}function qr(e){var y;var t=le,n=ge,i=pe,a=D,l=Ge,f=ie,s=oe,c=Te,d=e.f;le=null,ge=0,pe=null,Ge=(d&he)!==0&&(Te||!nt||D===null),D=(d&(Ve|Qe))===0?e:null,ie=null,Yr(e.ctx),Te=!1,fn++,e.f|=Sn;try{var b=(0,e.fn)(),h=e.deps;if(le!==null){var m;if(dn(e,ge),h!==null&&ge>0)for(h.length=ge+le.length,m=0;m<le.length;m++)h[ge+m]=le[m];else e.deps=h=le;if(!Ge)for(m=ge;m<h.length;m++)((y=h[m]).reactions??(y.reactions=[])).push(e)}else h!==null&&ge<h.length&&(dn(e,ge),h.length=ge);if(Wr()&&pe!==null&&!Te&&h!==null&&(e.f&(Ee|et|xe))===0)for(m=0;m<pe.length;m++)Ur(pe[m],e);return a!==null&&a!==e&&(fn++,pe!==null&&(i===null?i=pe:i.push(...pe))),b}finally{le=t,ge=n,pe=i,D=a,Ge=l,ie=f,Yr(s),Te=c,e.f^=Sn}}function ql(e,t){let n=t.reactions;if(n!==null){var i=al.call(n,e);if(i!==-1){var a=n.length-1;a===0?n=t.reactions=null:(n[i]=n[a],n.pop())}}n===null&&(t.f&Ee)!==0&&(le===null||!le.includes(t))&&(Ce(t,et),(t.f&(he|tn))===0&&(t.f^=tn),Er(t),dn(t,0))}function dn(e,t){var n=e.deps;if(n!==null)for(var i=t;i<n.length;i++)ql(e,n[i])}function qn(e){var t=e.f;if((t&nn)===0){Ce(e,fe);var n=L,i=oe,a=nt;L=e,nt=!0;try{(t&$n)!==0?Ll(e):kr(e),Rr(e);var l=qr(e);e.teardown=typeof l=="function"?l:null,e.wv=Fr;var f=e.deps,s;ar&&Rl&&e.f&xe}catch(c){cn(c,e,n,i||e.ctx)}finally{nt=a,L=n}}}function jl(){try{pl()}catch(e){if(un!==null)cn(e,un,null);else throw e}}function jr(){var e=nt;try{var t=0;for(nt=!0;Ft.length>0;){t++>1e3&&jl();var n=Ft,i=n.length;Ft=[];for(var a=0;a<i;a++){var l=Hl(n[a]);Bl(l)}Mt.clear()}}finally{sn=!1,nt=e,un=null}}function Bl(e){var t=e.length;if(t!==0)for(var n=0;n<t;n++){var i=e[n];if((i.f&(nn|gt))===0)try{Vt(i)&&(qn(i),i.deps===null&&i.first===null&&i.nodes_start===null&&(i.teardown===null?xr(i):i.fn=null))}catch(a){cn(a,i,null,i.ctx)}}}function vn(e){sn||(sn=!0,queueMicrotask(jr));for(var t=un=e;t.parent!==null;){t=t.parent;var n=t.f;if((n&(Qe|Ve))!==0){if((n&fe)===0)return;t.f^=fe}}Ft.push(t)}function Hl(e){for(var t=[],n=e;n!==null;){var i=n.f,a=(i&(Ve|Qe))!==0,l=a&&(i&fe)!==0;if(!l&&(i>)===0){if((i&vr)!==0)t.push(n);else if(a)n.f^=fe;else try{Vt(n)&&qn(n)}catch(c){cn(c,n,null,n.ctx)}var f=n.first;if(f!==null){n=f;continue}}var s=n.parent;for(n=n.next;n===null&&s!==null;)n=s.next,s=s.parent}return t}function A(e){for(var t;;){if(Vl(),Ft.length===0)return t;sn=!0,jr()}}async function jn(){await Promise.resolve(),A()}function o(e){var t=e.f,n=(t&Ee)!==0;if(D!==null&&!Te){if(!(ie!=null&&ie.includes(e))){var i=D.deps;e.rv<fn&&(e.rv=fn,le===null&&i!==null&&i[ge]===e?ge++:le===null?le=[e]:(!Ge||!le.includes(e))&&le.push(e))}}else if(n&&e.deps===null&&e.effects===null){var a=e,l=a.parent;l!==null&&(l.f&he)===0&&(a.f^=he)}return n&&(a=e,Vt(a)&&Ar(a)),Ot&&Mt.has(e)?Mt.get(e):e.v}function rt(e){var t=Te;try{return Te=!0,e()}finally{Te=t}}const Yl=-7169;function Ce(e,t){e.f=e.f&Yl|t}const Mt=new Map;function Br(e,t){var n={f:0,v:e,reactions:null,equals:yr,rv:0,wv:0};return n}function P(e,t){const n=Br(e);return Or(n),n}function Bn(e,t=!1){const n=Br(e);return t||(n.equals=Dn),n}function p(e,t,n=!1){D!==null&&!Te&&Wr()&&(D.f&(Ee|$n))!==0&&!(ie!=null&&ie.includes(e))&&Al();let i=n?je(t):t;return Gl(e,i)}function Gl(e,t){if(!e.equals(t)){var n=e.v;Ot?Mt.set(e,t):Mt.set(e,n),e.v=t,(e.f&Ee)!==0&&((e.f&xe)!==0&&Cr(e),Ce(e,(e.f&he)===0?fe:et)),e.wv=Vr(),Hr(e,xe),L!==null&&(L.f&fe)!==0&&(L.f&(Ve|Qe))===0&&(pe===null?Ml([e]):pe.push(e))}return t}function Hr(e,t){var n=e.reactions;if(n!==null)for(var i=n.length,a=0;a<i;a++){var l=n[a],f=l.f;(f&xe)===0&&(Ce(l,t),(f&(fe|he))!==0&&((f&Ee)!==0?Hr(l,et):vn(l)))}}let oe=null;function Yr(e){oe=e}function Gr(e,t=!1,n){var i=oe={p:oe,c:null,d:!1,e:null,m:!1,s:e,x:null,l:null};Ln(()=>{i.d=!0})}function Zr(e){const t=oe;if(t!==null){e!==void 0&&(t.x=e);const f=t.e;if(f!==null){var n=L,i=D;t.e=null;try{for(var a=0;a<f.length;a++){var l=f[a];Ye(l.effect),Ne(l.reaction),On(l.fn)}}finally{Ye(n),Ne(i)}}oe=t.p,t.m=!0}return e||{}}function Wr(){return!0}const Zl=["touchstart","touchmove"];function Wl(e){return Zl.includes(e)}function Jl(e,t){if(t){const n=document.body;e.autofocus=!0,Un(()=>{document.activeElement===n&&e.focus()})}}let Jr=!1;function Kr(){Jr||(Jr=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const n of e.target.elements)(t=n.__on_r)==null||t.call(n)})},{capture:!0}))}function Xr(e){var t=D,n=L;Ne(null),Ye(null);try{return e()}finally{Ne(t),Ye(n)}}function Kl(e,t,n,i=n){e.addEventListener(t,()=>Xr(n));const a=e.__on_r;a?e.__on_r=()=>{a(),i(!0)}:e.__on_r=()=>i(!0),Kr()}const zr=new Set,Hn=new Set;function Xl(e,t,n,i={}){function a(l){if(i.capture||Ut.call(t,l),!l.cancelBubble)return Xr(()=>n==null?void 0:n.call(this,l))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Un(()=>{t.addEventListener(e,a,i)}):t.addEventListener(e,a,i),a}function Ze(e,t,n,i,a){var l={capture:i,passive:a},f=Xl(e,t,n,l);(t===document.body||t===window||t===document)&&Ln(()=>{t.removeEventListener(e,f,l)})}function zl(e){for(var t=0;t<e.length;t++)zr.add(e[t]);for(var n of Hn)n(e)}function Ut(e){var te;var t=this,n=t.ownerDocument,i=e.type,a=((te=e.composedPath)==null?void 0:te.call(e))||[],l=a[0]||e.target,f=0,s=e.__root;if(s){var c=a.indexOf(s);if(c!==-1&&(t===document||t===window)){e.__root=t;return}var d=a.indexOf(t);if(d===-1)return;c<=d&&(f=c)}if(l=a[f]||e.target,l!==t){St(e,"currentTarget",{configurable:!0,get(){return l||n}});var b=D,h=L;Ne(null),Ye(null);try{for(var m,y=[];l!==null;){var N=l.assignedSlot||l.parentNode||l.host||null;try{var E=l["__"+i];if(E!=null&&(!l.disabled||e.target===l))if(ur(E)){var[j,..._e]=E;j.apply(l,[e,..._e])}else E.call(l,e)}catch(ae){m?y.push(ae):m=ae}if(e.cancelBubble||N===t||N===null)break;l=N}if(m){for(let ae of y)queueMicrotask(()=>{throw ae});throw m}}finally{e.__root=t,delete e.currentTarget,Ne(b),Ye(h)}}}function Yn(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function De(e,t){var n=L;n.nodes_start===null&&(n.nodes_start=e,n.nodes_end=t)}function Ae(e,t){var n=(t&il)!==0,i=(t&ll)!==0,a,l=!e.startsWith("<!>");return()=>{if(F)return De(V,null),V;a===void 0&&(a=Yn(l?e:"<!>"+e),n||(a=be(a)));var f=i||mr?document.importNode(a,!0):a.cloneNode(!0);if(n){var s=be(f),c=f.lastChild;De(s,c)}else De(f,f);return f}}function hn(e,t,n="svg"){var i=!e.startsWith("<!>"),a=`<${n}>${i?e:"<!>"+e}</${n}>`,l;return()=>{if(F)return De(V,null),V;if(!l){var f=Yn(a),s=be(f);l=be(s)}var c=l.cloneNode(!0);return De(c,c),c}}function gn(){if(F)return De(V,null),V;var e=document.createDocumentFragment(),t=document.createComment(""),n=ln();return e.append(t,n),De(t,n),e}function B(e,t){if(F){L.nodes_end=V,mt();return}e!==null&&e.before(t)}function Ql(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=n,e.nodeValue=n+"")}function Qr(e,t){return ei(e,t)}function eo(e,t){Nn(),t.intro=t.intro??!1;const n=t.target,i=F,a=V;try{for(var l=be(n);l&&(l.nodeType!==8||l.data!==kn);)l=Be(l);if(!l)throw vt;_t(!0),qe(l),mt();const f=ei(e,{...t,anchor:l});if(V===null||V.nodeType!==8||V.data!==or)throw rn(),vt;return _t(!1),f}catch(f){if(f===vt)return t.recover===!1&&yl(),Nn(),kl(n),_t(!1),Qr(e,t);throw f}finally{_t(i),qe(a)}}const bt=new Map;function ei(e,{target:t,anchor:n,props:i={},events:a,context:l,intro:f=!0}){Nn();var s=new Set,c=h=>{for(var m=0;m<h.length;m++){var y=h[m];if(!s.has(y)){s.add(y);var N=Wl(y);t.addEventListener(y,Ut,{passive:N});var E=bt.get(y);E===void 0?(document.addEventListener(y,Ut,{passive:N}),bt.set(y,1)):bt.set(y,E+1)}}};c(sl(zr)),Hn.add(c);var d=void 0,b=Dl(()=>{var h=n??t.appendChild(ln());return Vn(()=>{if(l){Gr({});var m=oe;m.c=l}a&&(i.$$events=a),F&&De(h,null),d=e(h,i)||{},F&&(L.nodes_end=V),l&&Zr()}),()=>{var N;for(var m of s){t.removeEventListener(m,Ut);var y=bt.get(m);--y===0?(document.removeEventListener(m,Ut),bt.delete(m)):bt.set(m,y)}Hn.delete(c),h!==n&&((N=h.parentNode)==null||N.removeChild(h))}});return Gn.set(d,b),d}let Gn=new WeakMap;function to(e,t){const n=Gn.get(e);return n?(Gn.delete(e),n(t)):Promise.resolve()}function X(e,t,[n,i]=[0,0]){F&&n===0&&mt();var a=e,l=null,f=null,s=ue,c=n>0?xn:0,d=!1;const b=(m,y=!0)=>{d=!0,h(y,m)},h=(m,y)=>{if(s===(s=m))return;let N=!1;if(F&&i!==-1){if(n===0){const j=a.data;j===kn?i=0:j===lr?i=1/0:(i=parseInt(j.substring(1)),i!==i&&(i=s?1/0:-1))}const E=i>n;!!s===E&&(a=Il(),qe(a),_t(!1),N=!0,i=-1)}s?(l?Tr(l):y&&(l=Vn(()=>y(a))),f&&Mn(f,()=>{f=null})):(f?Tr(f):y&&(f=Vn(()=>y(a,[n+1,i]))),l&&Mn(l,()=>{l=null})),N&&_t(!0)};Ir(()=>{d=!1,t(b),d||h(null,null)},c),F&&(a=V)}function it(e,t,n=!1,i=!1,a=!1){var l=e,f="";Se(()=>{var s=L;if(f===(f=t()??"")){F&&mt();return}if(s.nodes_start!==null&&($r(s.nodes_start,s.nodes_end),s.nodes_start=s.nodes_end=null),f!==""){if(F){V.data;for(var c=mt(),d=c;c!==null&&(c.nodeType!==8||c.data!=="");)d=c,c=Be(c);if(c===null)throw rn(),vt;De(V,d),l=qe(c);return}var b=f+"";n?b=`<svg>${b}</svg>`:i&&(b=`<math>${b}</math>`);var h=Yn(b);if((n||i)&&(h=be(h)),De(be(h),h.lastChild),n||i)for(;be(h);)l.before(be(h));else l.before(h)}})}function no(e,t,n,i,a){var s;F&&mt();var l=(s=t.$$slots)==null?void 0:s[n],f=!1;l===!0&&(l=t.children,f=!0),l===void 0||l(e,f?()=>i:i)}const ti=[...`
|
|
2
|
-
\r\f \v\uFEFF`];function ro(e,t,n){var i=""+e;if(n){for(var a in n)if(n[a])i=i?i+" "+a:a;else if(i.length)for(var l=a.length,f=0;(f=i.indexOf(a,f))>=0;){var s=f+l;(f===0||ti.includes(i[f-1]))&&(s===i.length||ti.includes(i[s]))?i=(f===0?"":i.substring(0,f))+i.substring(s+1):f=s}}return i===""?null:i}function io(e,t,n,i,a,l){var f=e.__className;if(F||f!==n||f===void 0){var s=ro(n,i,l);(!F||s!==e.getAttribute("class"))&&(s==null?e.removeAttribute("class"):e.className=s),e.__className=n}else if(l&&a!==l)for(var c in l){var d=!!l[c];(a==null||d!==!!a[c])&&e.classList.toggle(c,d)}return l}const lo=Symbol("is custom element"),oo=Symbol("is html");function ni(e){if(F){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var i=e.value;T(e,"value",null),e.value=i}if(e.hasAttribute("checked")){var a=e.checked;T(e,"checked",null),e.checked=a}}};e.__on_r=n,Fl(n),Kr()}}function ao(e,t){var n=ri(e);n.value===(n.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function T(e,t,n,i){var a=ri(e);F&&(a[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||a[t]!==(a[t]=n)&&(t==="loading"&&(e[gl]=n),n==null?e.removeAttribute(t):typeof n!="string"&&so(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function ri(e){return e.__attributes??(e.__attributes={[lo]:e.nodeName.includes("-"),[oo]:e.namespaceURI===ol})}var ii=new Map;function so(e){var t=ii.get(e.nodeName);if(t)return t;ii.set(e.nodeName,t=[]);for(var n,i=e,a=Element.prototype;a!==i;){n=ul(i);for(var l in n)n[l].set&&t.push(l);i=fr(i)}return t}function uo(e,t,n=t){Kl(e,"change",i=>{var a=i?e.defaultChecked:e.checked;n(a)}),(F&&e.defaultChecked!==e.checked||rt(t)==null)&&n(e.checked),Fn(()=>{var i=t();e.checked=!!i})}function li(e,t){return e===t||(e==null?void 0:e[Tt])===t}function _n(e={},t,n,i){return On(()=>{var a,l;return Fn(()=>{a=l,l=[],rt(()=>{e!==n(...l)&&(t(e,...l),a&&li(n(...a),e)&&t(null,...a))})}),()=>{Un(()=>{l&&li(n(...l),e)&&t(null,...l)})}}),e}function oi(e){oe===null&&sr(),Pn(()=>{const t=rt(e);if(typeof t=="function")return t})}function fo(e){oe===null&&sr(),oi(()=>()=>rt(e))}function ai(e,t,n){if(e==null)return t(void 0),ht;const i=rt(()=>e.subscribe(t,n));return i.unsubscribe?()=>i.unsubscribe():i}const pt=[];function co(e,t=ht){let n=null;const i=new Set;function a(s){if(wr(e,s)&&(e=s,n)){const c=!pt.length;for(const d of i)d[1](),pt.push(d,e);if(c){for(let d=0;d<pt.length;d+=2)pt[d][0](pt[d+1]);pt.length=0}}}function l(s){a(s(e))}function f(s,c=ht){const d=[s,c];return i.add(d),i.size===1&&(n=t(a,l)||ht),s(e),()=>{i.delete(d),i.size===0&&n&&(n(),n=null)}}return{set:a,update:l,subscribe:f}}function mn(e){let t;return ai(e,n=>t=n)(),t}let bn=!1,Zn=Symbol();function vo(e,t,n){const i=n[t]??(n[t]={store:null,source:Bn(void 0),unsubscribe:ht});if(i.store!==e&&!(Zn in n))if(i.unsubscribe(),i.store=e??null,e==null)i.source.v=void 0,i.unsubscribe=ht;else{var a=!0;i.unsubscribe=ai(e,l=>{a?i.source.v=l:p(i.source,l)}),a=!1}return e&&Zn in n?mn(e):o(i.source)}function ho(){const e={};function t(){Ln(()=>{for(var n in e)e[n].unsubscribe();St(e,Zn,{enumerable:!1,value:!0})})}return[e,t]}function go(e){var t=bn;try{return bn=!1,[e(),bn]}finally{bn=t}}function si(e){var t;return((t=e.ctx)==null?void 0:t.d)??!1}function I(e,t,n,i){var yt;var a=(n&Xt)!==0,l=!0,f=(n&nl)!==0,s=(n&rl)!==0,c=!1,d;f?[d,c]=go(()=>e[t]):d=e[t];var b=Tt in e||gr in e,h=f&&(((yt=ze(e,t))==null?void 0:yt.set)??(b&&t in e&&(H=>e[t]=H)))||void 0,m=i,y=!0,N=!1,E=()=>(N=!0,y&&(y=!1,s?m=rt(i):m=i),m);d===void 0&&i!==void 0&&(h&&l&&wl(),d=E(),h&&h(d));var j;if(j=()=>{var H=e[t];return H===void 0?E():(y=!0,N=!1,H)},(n&tl)===0)return j;if(h){var _e=e.$$legacy;return function(H,ce){return arguments.length>0?((!ce||_e||c)&&h(ce?j():H),H):j()}}var te=!1,ae=Bn(d),ne=on(()=>{var H=j(),ce=o(ae);return te?(te=!1,ce):ae.v=H});return f&&o(ne),a||(ne.equals=Dn),function(H,ce){if(arguments.length>0){const Ie=ce?o(ne):f?je(H):H;if(!ne.equals(Ie)){if(te=!0,p(ae,Ie),N&&m!==void 0&&(m=Ie),si(ne))return H;rt(()=>o(ne))}return H}return si(ne)?ne.v:o(ne)}}function _o(e){return new mo(e)}class mo{constructor(t){rr(this,Me);rr(this,ye);var l;var n=new Map,i=(f,s)=>{var c=Bn(s);return n.set(f,c),c};const a=new Proxy({...t.props||{},$$events:{}},{get(f,s){return o(n.get(s)??i(s,Reflect.get(f,s)))},has(f,s){return s===gr?!0:(o(n.get(s)??i(s,Reflect.get(f,s))),Reflect.has(f,s))},set(f,s,c){return p(n.get(s)??i(s,c),c),Reflect.set(f,s,c)}});ir(this,ye,(t.hydrate?eo:Qr)(t.component,{target:t.target,anchor:t.anchor,props:a,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((l=t==null?void 0:t.props)!=null&&l.$$host)||t.sync===!1)&&A(),ir(this,Me,a.$$events);for(const f of Object.keys(ve(this,ye)))f==="$set"||f==="$destroy"||f==="$on"||St(this,f,{get(){return ve(this,ye)[f]},set(s){ve(this,ye)[f]=s},enumerable:!0});ve(this,ye).$set=f=>{Object.assign(a,f)},ve(this,ye).$destroy=()=>{to(ve(this,ye))}}$set(t){ve(this,ye).$set(t)}$on(t,n){ve(this,Me)[t]=ve(this,Me)[t]||[];const i=(...a)=>n.call(this,...a);return ve(this,Me)[t].push(i),()=>{ve(this,Me)[t]=ve(this,Me)[t].filter(a=>a!==i)}}$destroy(){ve(this,ye).$destroy()}}Me=new WeakMap,ye=new WeakMap;let ui;typeof HTMLElement=="function"&&(ui=class extends HTMLElement{constructor(t,n,i){super();$e(this,"$$ctor");$e(this,"$$s");$e(this,"$$c");$e(this,"$$cn",!1);$e(this,"$$d",{});$e(this,"$$r",!1);$e(this,"$$p_d",{});$e(this,"$$l",{});$e(this,"$$l_u",new Map);$e(this,"$$me");this.$$ctor=t,this.$$s=n,i&&this.attachShadow({mode:"open"})}addEventListener(t,n,i){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(n),this.$$c){const a=this.$$c.$on(t,n);this.$$l_u.set(n,a)}super.addEventListener(t,n,i)}removeEventListener(t,n,i){if(super.removeEventListener(t,n,i),this.$$c){const a=this.$$l_u.get(n);a&&(a(),this.$$l_u.delete(n))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(a){return l=>{const f=document.createElement("slot");a!=="default"&&(f.name=a),B(l,f)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},i=bo(this);for(const a of this.$$s)a in i&&(a==="default"&&!this.$$d.children?(this.$$d.children=t(a),n.default=!0):n[a]=t(a));for(const a of this.attributes){const l=this.$$g_p(a.name);l in this.$$d||(this.$$d[l]=pn(l,a.value,this.$$p_d,"toProp"))}for(const a in this.$$p_d)!(a in this.$$d)&&this[a]!==void 0&&(this.$$d[a]=this[a],delete this[a]);this.$$c=_o({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$host:this}}),this.$$me=Nl(()=>{Fn(()=>{var a;this.$$r=!0;for(const l of zt(this.$$c)){if(!((a=this.$$p_d[l])!=null&&a.reflect))continue;this.$$d[l]=this.$$c[l];const f=pn(l,this.$$d[l],this.$$p_d,"toAttribute");f==null?this.removeAttribute(this.$$p_d[l].attribute||l):this.setAttribute(this.$$p_d[l].attribute||l,f)}this.$$r=!1})});for(const a in this.$$l)for(const l of this.$$l[a]){const f=this.$$c.$on(a,l);this.$$l_u.set(l,f)}this.$$l={}}}attributeChangedCallback(t,n,i){var a;this.$$r||(t=this.$$g_p(t),this.$$d[t]=pn(t,i,this.$$p_d,"toProp"),(a=this.$$c)==null||a.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return zt(this.$$p_d).find(n=>this.$$p_d[n].attribute===t||!this.$$p_d[n].attribute&&n.toLowerCase()===t)||t}});function pn(e,t,n,i){var l;const a=(l=n[e])==null?void 0:l.type;if(t=a==="Boolean"&&typeof t!="boolean"?t!=null:t,!i||!n[e])return t;if(i==="toAttribute")switch(a){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(a){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function bo(e){const t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0}),t}function po(e,t,n,i,a,l){let f=class extends ui{constructor(){super(e,n,a),this.$$p_d=t}static get observedAttributes(){return zt(t).map(s=>(t[s].attribute||s).toLowerCase())}};return zt(t).forEach(s=>{St(f.prototype,s,{get(){return this.$$c&&s in this.$$c?this.$$c[s]:this.$$d[s]},set(c){var h;c=pn(s,c,t),this.$$d[s]=c;var d=this.$$c;if(d){var b=(h=ze(d,s))==null?void 0:h.get;b?d[s]=c:d.$set({[s]:c})}}})}),i.forEach(s=>{St(f.prototype,s,{get(){var c;return(c=this.$$c)==null?void 0:c[s]}})}),e.element=f,f}const fi=new TextEncoder;function yo(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function wo(e,t="SHA-256",n=1e5){const i=Date.now().toString(16);e||(e=Math.round(Math.random()*n));const a=await ci(i,e,t);return{algorithm:t,challenge:a,salt:i,signature:""}}async function ci(e,t,n){if(typeof crypto>"u"||!("subtle"in crypto)||!("digest"in crypto.subtle))throw new Error("Web Crypto is not available. Secure context is required (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).");return yo(await crypto.subtle.digest(n.toUpperCase(),fi.encode(e+t)))}function Eo(e,t,n="SHA-256",i=1e6,a=0){const l=new AbortController,f=Date.now();return{promise:(async()=>{for(let c=a;c<=i;c+=1){if(l.signal.aborted)return null;if(await ci(t,c,n)===e)return{number:c,took:Date.now()-f}}return null})(),controller:l}}function di(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function Co(e){const t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}function Ao(e,t=12){const n=new Uint8Array(t);for(let i=0;i<t;i++)n[i]=e%256,e=Math.floor(e/256);return n}async function Io(e,t="",n=1e6,i=0){const a="AES-GCM",l=new AbortController,f=Date.now(),s=async()=>{for(let b=i;b<=n;b+=1){if(l.signal.aborted||!c||!d)return null;try{const h=await crypto.subtle.decrypt({name:a,iv:Ao(b)},c,d);if(h)return{clearText:new TextDecoder().decode(h),took:Date.now()-f}}catch{}}return null};let c=null,d=null;try{d=Co(e);const b=await crypto.subtle.digest("SHA-256",fi.encode(t));c=await crypto.subtle.importKey("raw",b,a,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:l}}return{promise:s(),controller:l}}var w=(e=>(e.CODE="code",e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(w||{}),ee=(e=>(e.ERROR="error",e.LOADING="loading",e.PLAYING="playing",e.PAUSED="paused",e.READY="ready",e))(ee||{});globalThis.altchaPlugins=globalThis.altchaPlugins||[],globalThis.altchaI18n=globalThis.altchaI18n||{get:e=>mn(globalThis.altchaI18n.store)[e],set:(e,t)=>{Object.assign(mn(globalThis.altchaI18n.store),{[e]:t}),globalThis.altchaI18n.store.set(mn(globalThis.altchaI18n.store))},store:co({})};const Ro={ariaLinkLabel:"Visit Altcha.org",enterCode:"Enter code",enterCodeAria:"Enter code you hear. Press Space to play audio.",error:"Verification failed. Try again later.",expired:"Verification expired. Try again.",footer:'Protected by <a href="https://altcha.org/" target="_blank" aria-label="Visit Altcha.org">ALTCHA</a>',getAudioChallenge:"Get an audio challenge",label:"I'm not a robot",loading:"Loading...",reload:"Reload",verify:"Verify",verificationRequired:"Verification required!",verified:"Verified",verifying:"Verifying...",waitAlert:"Verifying... please wait."};globalThis.altchaI18n.set("en",Ro);const Wn=(e,t)=>{let n=$l(()=>dl(t==null?void 0:t(),24));var i=So();Se(()=>{T(i,"width",o(n)),T(i,"height",o(n))}),B(e,i)};function ko(e,t){e.code==="Space"&&(e.preventDefault(),e.stopImmediatePropagation(),t())}function $o(e,t){e.preventDefault(),t()}function xo(e,t,n,i,a,l,f,s){var c;[w.UNVERIFIED,w.ERROR,w.EXPIRED,w.CODE].includes(o(t))?n()!==!1&&((c=o(i))==null?void 0:c.reportValidity())===!1?p(a,!1):l()?f():s():p(a,!0)}var So=hn('<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="altcha-spinner"><path 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" fill="currentColor" opacity=".25"></path><path 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" fill="currentColor"></path></svg>'),To=Ae('<input type="hidden">'),No=Ae('<div><a target="_blank" class="altcha-logo" aria-hidden="true"><svg width="22" height="22" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path 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" fill="currentColor"></path><path 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" fill="currentColor"></path><path 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" fill="currentColor"></path></svg></a></div>'),Do=hn('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12.8659 3.00017L22.3922 19.5002C22.6684 19.9785 22.5045 20.5901 22.0262 20.8662C21.8742 20.954 21.7017 21.0002 21.5262 21.0002H2.47363C1.92135 21.0002 1.47363 20.5525 1.47363 20.0002C1.47363 19.8246 1.51984 19.6522 1.60761 19.5002L11.1339 3.00017C11.41 2.52187 12.0216 2.358 12.4999 2.63414C12.6519 2.72191 12.7782 2.84815 12.8659 3.00017ZM10.9999 16.0002V18.0002H12.9999V16.0002H10.9999ZM10.9999 9.00017V14.0002H12.9999V9.00017H10.9999Z"></path></svg>'),Lo=hn('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M15 7C15 6.44772 15.4477 6 16 6C16.5523 6 17 6.44772 17 7V17C17 17.5523 16.5523 18 16 18C15.4477 18 15 17.5523 15 17V7ZM7 7C7 6.44772 7.44772 6 8 6C8.55228 6 9 6.44772 9 7V17C9 17.5523 8.55228 18 8 18C7.44772 18 7 17.5523 7 17V7Z"></path></svg>'),Po=hn('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 12H7C8.10457 12 9 12.8954 9 14V19C9 20.1046 8.10457 21 7 21H4C2.89543 21 2 20.1046 2 19V12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12V19C22 20.1046 21.1046 21 20 21H17C15.8954 21 15 20.1046 15 19V14C15 12.8954 15.8954 12 17 12H20C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12Z"></path></svg>'),Oo=Ae('<button type="button" class="altcha-code-challenge-audio"><!></button>'),Fo=Ae("<audio hidden autoplay><source></audio>"),Vo=Ae('<div class="altcha-code-challenge" role="dialog"><div class="altcha-code-challenge-arrow"></div> <form data-code-challenge-form="1"><img class="altcha-code-challenge-image" alt=""> <input type="text" autocomplete="off" name="code" class="altcha-code-challenge-input" required> <div class="altcha-code-challenge-buttons"><div class="altcha-code-challenge-buttons-left"><!> <button type="button" class="altcha-code-challenge-reload"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2V4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 9.25022 5.38734 6.82447 7.50024 5.38451L7.5 8H9.5V2L3.5 2V4L5.99918 3.99989C3.57075 5.82434 2 8.72873 2 12Z"></path></svg></button></div> <button type="submit" class="altcha-code-challenge-verify"><!> </button></div> <!></form></div>'),Mo=Ae("<div><!></div>"),Uo=Ae("<div><!></div>"),qo=Ae('<div class="altcha-error"><svg width="14" height="14" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path></svg> <!></div>'),jo=Ae('<div class="altcha-footer"><div><!></div></div>'),Bo=Ae('<div class="altcha-anchor-arrow"></div>'),Ho=Ae('<!> <div class="altcha"><div class="altcha-main"><div><!> <input type="checkbox"></div> <label class="altcha-label"><!></label> <!> <!> <!></div> <!> <!> <!></div>',1);function vi(e,t){var Xi,zi;Gr(t,!0);const[n,i]=ho(),a=()=>vo(Go,"$altchaI18nStore",n);let l=I(t,"auto",7,void 0),f=I(t,"blockspam",7,void 0),s=I(t,"challengeurl",7,void 0),c=I(t,"challengejson",7,void 0),d=I(t,"credentials",7,void 0),b=I(t,"customfetch",7,void 0),h=I(t,"debug",7,!1),m=I(t,"delay",7,0),y=I(t,"disableautofocus",7,!1),N=I(t,"expire",7,void 0),E=I(t,"floating",7,void 0),j=I(t,"floatinganchor",7,void 0),_e=I(t,"floatingoffset",7,void 0),te=I(t,"floatingpersist",7,!1),ae=I(t,"hidefooter",7,!1),ne=I(t,"hidelogo",7,!1),yt=I(t,"id",7,void 0),H=I(t,"language",7,void 0),ce=I(t,"name",7,"altcha"),Ie=I(t,"maxnumber",7,1e6),qt=I(t,"mockerror",7,!1),We=I(t,"obfuscated",7,void 0),Re=I(t,"overlay",7,void 0),jt=I(t,"overlaycontent",7,void 0),yn=I(t,"plugins",7,void 0),Bt=I(t,"refetchonexpire",7,!0),lt=I(t,"sentinel",7,void 0),Le=I(t,"spamfilter",7,!1),wt=I(t,"strings",7,void 0),we=I(t,"test",7,!1),se=I(t,"verifyurl",7,void 0),Et=I(t,"workers",23,()=>Math.min(16,navigator.hardwareConcurrency||8)),Ht=I(t,"workerurl",7,void 0);const{altchaI18n:Yo}=globalThis,Go=Yo.store,gi=["SHA-256","SHA-384","SHA-512"],Zo="https://altcha.org/",Je=(r,u)=>{t.$$host.dispatchEvent(new CustomEvent(r,{detail:u}))},_i=(zi=(Xi=document.documentElement.lang)==null?void 0:Xi.split("-"))==null?void 0:zi[0],Jn=Dt(()=>{var r;return s()&&new URL(s(),location.origin).host.endsWith(".altcha.org")&&!!((r=s())!=null&&r.includes("apiKey=ckey_"))}),wn=Dt(()=>c()?Ti(c()):void 0),Wo=Dt(()=>wt()?Ti(wt()):{}),M=Dt(()=>({...yi(a()),...o(Wo)})),mi=Dt(()=>`${yt()||ce()}_checkbox_${Math.round(Math.random()*1e8)}`);let ot=P(null),Yt=P(!1),G=P(null),k=P(je(w.UNVERIFIED)),U=P(void 0),Gt=P(null),Ke=P(null),me=P(null),Kn=P(null),Ct=P(null),O=P(null),At=P(null),at=P(null),Pe=null,z=P(null),st=P(!1),Xe=[],Xn=P(!1),Oe=P(null);Pn(()=>{aa(o(at))}),Pn(()=>{sa(o(k))}),fo(()=>{Jo(),p(At,null),o(O)&&(o(O).removeEventListener("submit",Ri),o(O).removeEventListener("reset",ki),o(O).removeEventListener("focusin",Ii),p(O,null)),Pe&&(clearTimeout(Pe),Pe=null),document.removeEventListener("click",Ci),document.removeEventListener("scroll",Ai),window.removeEventListener("resize",Si)}),oi(()=>{var r;$("mounted","2.2.0-beta.2"),$("workers",Et()),Qo(),$("plugins",Xe.length?Xe.map(u=>u.constructor.pluginName).join(", "):"none"),we()&&$("using test mode"),N()&&Qn(N()),l()!==void 0&&$("auto",l()),E()!==void 0&&Li(E()),p(O,(r=o(U))==null?void 0:r.closest("form"),!0),o(O)&&(o(O).addEventListener("submit",Ri,{capture:!0}),o(O).addEventListener("reset",ki),(l()==="onfocus"||te()==="focus")&&o(O).addEventListener("focusin",Ii)),Re()&&Pi(!0),l()==="onload"&&(We()?Zt():Ue()),o(Jn)&&(ae()||ne())&&$("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{Je("load")})});function En(r,u){return btoa(JSON.stringify({algorithm:r.algorithm,challenge:r.challenge,number:u.number,salt:r.salt,signature:r.signature,test:we()?!0:void 0,took:u.took}))}function Jo(){for(const r of Xe)r.destroy()}function bi(){s()&&Bt()&&o(k)===w.VERIFIED?Ue():ut(w.EXPIRED,o(M).expired)}async function Ko(){if(qt())throw $("mocking error"),new Error("Mocked error.");if(o(wn))return $("using provided json data"),Ni(o(wn).salt),o(wn);if(we())return $("generating test challenge",{test:we()}),wo(typeof we()!="boolean"?+we():void 0);{if(!s()&&o(O)){const v=o(O).getAttribute("action");v!=null&&v.includes("/form/")&&s(v+"/altcha")}if(!s())throw new Error("Attribute challengeurl not set.");$("fetching challenge from",s());const r={credentials:typeof d()=="boolean"?"include":d(),headers:Le()!==!1?{"x-altcha-spam-filter":"1"}:{}},u=await pi()(s(),r);if(!u||!(u instanceof Response))throw new Error("Custom fetch function did not return a response.");if(u.status!==200)throw new Error(`Server responded with ${u.status}.`);const g=u.headers.get("X-Altcha-Config"),_=await u.json();if(Ni(_.salt),g)try{const v=JSON.parse(g);v&&typeof v=="object"&&(v.verifyurl&&!v.verifyurl.startsWith("fn:")&&(v.verifyurl=Ei(v.verifyurl)),Vi(v))}catch(v){$("unable to configure from X-Altcha-Config",v)}return _}}function Xo(r){var g,_;const u=(g=o(O))==null?void 0:g.querySelector(typeof r=="string"?`input[name="${r}"]`:'input[type="email"]:not([data-no-spamfilter])');return((_=u==null?void 0:u.value)==null?void 0:_.slice(u.value.indexOf("@")))||void 0}function pi(){let r=fetch;if(b())if($("using customfetch"),typeof b()=="string"){if(r=globalThis[b()]||null,!r)throw new Error(`Custom fetch function not found: ${b()}`)}else r=b();return r}function yi(r,u=[H()||"",document.documentElement.lang||"",...navigator.languages]){const g=Object.keys(r).map(v=>v.toLowerCase()),_=u.reduce((v,C)=>(C=C.toLowerCase(),v||(r[C]?C:null)||g.find(R=>C.split("-")[0]===R.split("-")[0])||null),null);return r[_||"en"]}function zo(){return Le()==="ipAddress"?{blockedCountries:void 0,classifier:void 0,disableRules:void 0,email:!1,expectedCountries:void 0,expectedLanguages:void 0,fields:!1,ipAddress:void 0,text:void 0,timeZone:void 0}:typeof Le()=="object"?Le():{blockedCountries:void 0,classifier:void 0,disableRules:void 0,email:void 0,expectedCountries:void 0,expectedLanguages:void 0,fields:void 0,ipAddress:void 0,text:void 0,timeZone:void 0}}function wi(r){var g;return[...((g=o(O))==null?void 0:g.querySelectorAll(r!=null&&r.length?r.map(_=>`input[name="${_}"]`).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'))||[]].reduce((_,v)=>{const C=v.name,R=v.value;return C&&R&&(_[C]=/\n/.test(R)?R.replace(new RegExp("(?<!\\r)\\n","g"),`\r
|
|
3
|
-
`):R),_},{})}function Ei(r,u){const g=new URL(s()||location.origin),_=new URL(r,g);if(_.search||(_.search=g.search),u)for(const v in u)u[v]!==void 0&&u[v]!==null&&_.searchParams.set(v,u[v]);return _.toString()}function Qo(){const r=yn()!==void 0?yn().split(","):void 0;for(const u of globalThis.altchaPlugins)(!r||r.includes(u.pluginName))&&Xe.push(new u({el:o(U),clarify:Zt,dispatch:Je,getConfiguration:Mi,getFloatingAnchor:Ui,getState:qi,log:$,reset:ut,solve:Fi,setState:Fe,setFloatingAnchor:ji,verify:Ue}))}function $(...r){(h()||r.some(u=>u instanceof Error))&&console[r[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${ce()}]`,...r)}function ea(){p(z,ee.PAUSED,!0)}function ta(r){p(z,ee.ERROR,!0)}function na(){p(z,ee.READY,!0)}function ra(){p(z,ee.LOADING,!0)}function ia(){p(z,ee.PLAYING,!0)}function la(){p(z,ee.PAUSED,!0)}function oa(r){var u;if(r.preventDefault(),r.stopPropagation(),o(G)){const g=new FormData(r.target),_=String(g.get("code"));if((u=se())!=null&&u.startsWith("fn:")){const v=se().replace(/^fn:/,"");if($(`calling ${v} function instead of verifyurl`),!(v in globalThis))throw new Error(`Global function "${v}" is undefined.`);return globalThis[v]({challenge:o(G).challenge,code:_,solution:o(G).solution})}p(st,!0),Di(En(o(G).challenge,o(G).solution),_).then(({reason:v,verified:C})=>{C?(p(G,null),Fe(w.VERIFIED),$("verified"),jn().then(()=>{var R;(R=o(Kn))==null||R.focus(),Je("verified",{payload:o(Oe)}),l()==="onsubmit"?zn(o(At)):Re()&&Wt()})):(ut(),p(at,v||"Verification failed",!0))}).catch(v=>{p(G,null),Fe(w.ERROR,v),$("sentinel verification failed:",v)}).finally(()=>{p(st,!1)})}}function Ci(r){var g;const u=r.target;E()&&u&&!o(U).contains(u)&&(o(k)===w.VERIFIED&&te()===!1||o(k)===w.VERIFIED&&te()==="focus"&&!((g=o(O))!=null&&g.matches(":focus-within"))||l()==="off"&&o(k)===w.UNVERIFIED)&&Wt()}function Ai(){E()&&o(k)!==w.UNVERIFIED&&Jt()}function aa(r){for(const u of Xe)typeof u.onErrorChange=="function"&&u.onErrorChange(o(at))}function Ii(r){o(k)===w.UNVERIFIED?Ue():E()&&te()==="focus"&&o(k)===w.VERIFIED&&Cn()}function Ri(r){var _;const u=r.target;u!=null&&u.hasAttribute("data-code-challenge-form")||(p(At,r.submitter,!0),o(O)&&l()==="onsubmit"?((_=o(At))==null||_.blur(),o(k)===w.UNVERIFIED?(r.preventDefault(),r.stopPropagation(),Ue().then(()=>{zn(o(At))})):o(k)!==w.VERIFIED&&(r.preventDefault(),r.stopPropagation(),o(k)===w.VERIFYING&&$i())):o(O)&&E()&&l()==="off"&&o(k)===w.UNVERIFIED&&(r.preventDefault(),r.stopPropagation(),Cn()))}function ki(){ut()}function $i(){o(k)===w.VERIFYING&&o(M).waitAlert&&alert(o(M).waitAlert)}function xi(){o(Ke)?o(Ke).paused?(o(Ke).currentTime=0,o(Ke).play()):o(Ke).pause():(p(Xn,!0),requestAnimationFrame(()=>{var r;(r=o(Ke))==null||r.play()}))}function sa(r){for(const u of Xe)typeof u.onStateChange=="function"&&u.onStateChange(o(k));E()&&o(k)!==w.UNVERIFIED&&requestAnimationFrame(()=>{Jt()}),p(Yt,o(k)===w.VERIFIED),Re()&&o(me)&&(o(k)!==w.UNVERIFIED?Cn():Wt())}function Si(){E()&&Jt()}function Ti(r){return JSON.parse(r)}function Ni(r){var _;const u=new URLSearchParams((_=r.split("?"))==null?void 0:_[1]),g=u.get("expires")||u.get("expire");if(g){const v=new Date(+g*1e3),C=isNaN(v.getTime())?0:v.getTime()-Date.now();C>0&&Qn(C)}else Pe&&(clearTimeout(Pe),Pe=null)}async function ua(r){if(!se())throw new Error("Attribute verifyurl not set.");$("requesting server verification from",se());const u={payload:r};if(Le()!==!1){const{blockedCountries:v,classifier:C,disableRules:R,email:Y,expectedLanguages:q,expectedCountries:re,fields:de,ipAddress:ct,text:Rt,timeZone:dt}=zo();u.blockedCountries=v,u.classifier=C,u.disableRules=R,u.email=Y===!1?void 0:Xo(Y),u.expectedCountries=re,u.expectedLanguages=q||(_i?[_i]:void 0),u.fields=de===!1?void 0:wi(de),u.ipAddress=ct===!1?void 0:ct||"auto",u.text=Rt,u.timeZone=dt===!1?void 0:dt||di()}const g=await pi()(se(),{body:JSON.stringify(u),headers:{"content-type":"application/json"},method:"POST"});if(!g||!(g instanceof Response))throw new Error("Custom fetch function did not return a response.");if(g.status!==200)throw new Error(`Server responded with ${g.status}.`);const _=await g.json();if(_!=null&&_.payload&&p(Oe,_.payload,!0),Je("serververification",_),f()&&_.classification==="BAD")throw new Error("SpamFilter returned negative classification.")}async function Di(r,u){if(!se())throw new Error("Attribute verifyurl not set.");$("requesting sentinel verification from",se());const g={code:u,payload:r};lt()&&(g.fields=lt().fields?wi():void 0,g.timeZone=lt().timeZone?di():void 0);const _=await fetch(se(),{body:JSON.stringify(g),headers:{"content-type":"application/json"},method:"POST"});if(!_||!(_ instanceof Response))throw new Error("Fetch function did not return a response.");if(_.status!==200)throw new Error(`Server responded with ${_.status}.`);const v=await _.json();return v!=null&&v.payload&&p(Oe,v.payload,!0),Je("sentinelverification",v),v}function zn(r){var u;o(O)&&"requestSubmit"in o(O)?o(O).requestSubmit(r):(u=o(O))!=null&&u.reportValidity()&&(r?r.click():o(O).submit())}function Qn(r){$("expire",r),Pe&&(clearTimeout(Pe),Pe=null),r<1?bi():Pe=setTimeout(bi,r)}function Li(r){$("floating",r),E()!==r&&(o(U).style.left="",o(U).style.top=""),E(r===!0||r===""?"auto":r===!1||r==="false"?void 0:E()),E()?(l()||l("onsubmit"),document.addEventListener("scroll",Ai),document.addEventListener("click",Ci),window.addEventListener("resize",Si)):l()==="onsubmit"&&l(void 0)}function Pi(r){var u,g;if($("overlay",r),Re(r),r){if(l()||l("onsubmit"),o(me)&&o(U).parentElement&&o(me).replaceWith(o(U).parentElement),(g=(u=o(U))==null?void 0:u.parentElement)!=null&&g.parentElement){p(me,document.createElement("div"),!0),o(U).parentElement.parentElement.appendChild(o(me));const _=document.createElement("div"),v=document.createElement("button");v.type="button",v.innerHTML="×",v.addEventListener("click",C=>{C.preventDefault(),ut()}),o(me).classList.add("altcha-overlay-backdrop"),v.classList.add("altcha-overlay-close-button"),_.classList.add("altcha-overlay"),o(me).append(_),_.append(v),jt()&&_.append(...document.querySelectorAll(jt())),_.append(o(U).parentElement)}}else o(me)&&o(U).parentElement&&(o(me).replaceWith(o(U).parentElement),o(U).style.display="block")}function Oi(r){if(!r.algorithm)throw new Error("Invalid challenge. Property algorithm is missing.");if(r.signature===void 0)throw new Error("Invalid challenge. Property signature is missing.");if(!gi.includes(r.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${gi.join(", ")}`);if(!r.challenge||r.challenge.length<40)throw new Error("Challenge is too short. Min. 40 chars.");if(!r.salt||r.salt.length<10)throw new Error("Salt is too short. Min. 10 chars.")}async function Fi(r){let u=null,g=null;if("Worker"in window){try{u=fa(r,r.maxNumber||r.maxnumber||Ie()),p(ot,u.controller,!0),g=await u.promise}catch(_){$(_)}finally{p(ot,null)}if(g===null||(g==null?void 0:g.number)!==void 0||"obfuscated"in r)return{data:r,solution:g}}if("obfuscated"in r){const _=await Io(r.obfuscated,r.key,r.maxNumber||r.maxnumber);return{data:r,solution:await _.promise}}u=Eo(r.challenge,r.salt,r.algorithm,r.maxNumber||r.maxnumber||Ie()),p(ot,u.controller,!0);try{g=await u.promise}catch(_){$(_)}finally{p(ot,null)}return{data:r,solution:g}}function fa(r,u=typeof we()=="number"?we():r.maxNumber||r.maxnumber||Ie(),g=Math.ceil(Et())){const _=new AbortController,v=[];g=Math.min(16,u,Math.max(1,g));for(let Y=0;Y<g;Y++)v.push(altchaCreateWorker(Ht()));const C=Math.ceil(u/g);return{promise:(async()=>{const Y=await Promise.all(v.map((q,re)=>{const de=re*C;return _.signal.addEventListener("abort",()=>{q.postMessage({type:"abort"})}),new Promise(ct=>{q.addEventListener("message",Rt=>{if(Rt.data)for(const dt of v)dt!==q&&dt.postMessage({type:"abort"});ct(Rt.data)}),q.postMessage({payload:r,max:de+C,start:de,type:"work"})})}));for(const q of v)q.terminate();return Y.find(q=>!!q)||null})(),controller:_}}async function Zt(){if(!We()){Fe(w.ERROR);return}const r=Xe.find(u=>u.constructor.pluginName==="obfuscation");if(!r||!("clarify"in r)){Fe(w.ERROR),$("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");return}if("clarify"in r&&typeof r.clarify=="function")return r.clarify()}function Vi(r){r.obfuscated!==void 0&&We(r.obfuscated),r.auto!==void 0&&(l(r.auto),l()==="onload"&&(We()?Zt():Ue())),r.blockspam!==void 0&&f(!!r.blockspam),r.customfetch!==void 0&&b(r.customfetch),r.floatinganchor!==void 0&&j(r.floatinganchor),r.delay!==void 0&&m(r.delay),r.floatingoffset!==void 0&&_e(r.floatingoffset),r.floating!==void 0&&Li(r.floating),r.expire!==void 0&&(Qn(r.expire),N(r.expire)),r.challenge&&(c(typeof r.challenge=="string"?r.challenge:JSON.stringify(r.challenge)),Oi(o(wn))),r.challengeurl!==void 0&&s(r.challengeurl),r.debug!==void 0&&h(!!r.debug),r.hidefooter!==void 0&&ae(!!r.hidefooter),r.hidelogo!==void 0&&ne(!!r.hidelogo),r.language!==void 0&&wt(yi(a(),[r.language])),r.maxnumber!==void 0&&Ie(+r.maxnumber),r.mockerror!==void 0&&qt(!!r.mockerror),r.name!==void 0&&ce(r.name),r.overlaycontent!==void 0&&jt(r.overlaycontent),r.overlay!==void 0&&Pi(r.overlay),r.refetchonexpire!==void 0&&Bt(!!r.refetchonexpire),r.sentinel!==void 0&&typeof r.sentinel=="object"&<(r.sentinel),r.spamfilter!==void 0&&Le(typeof r.spamfilter=="object"?r.spamfilter:!!r.spamfilter),r.strings&&wt(typeof r.strings=="string"?r.strings:JSON.stringify(r.strings)),r.test!==void 0&&we(typeof r.test=="number"?r.test:!!r.test),r.verifyurl!==void 0&&se(r.verifyurl),r.workers!==void 0&&Et(+r.workers),r.workerurl!==void 0&&Ht(r.workerurl)}function Mi(){return{auto:l(),blockspam:f(),challengeurl:s(),debug:h(),delay:m(),expire:N(),floating:E(),floatinganchor:j(),floatingoffset:_e(),hidefooter:ae(),hidelogo:ne(),name:ce(),maxnumber:Ie(),mockerror:qt(),obfuscated:We(),overlay:Re(),refetchonexpire:Bt(),spamfilter:Le(),strings:o(M),test:we(),verifyurl:se(),workers:Et(),workerurl:Ht()}}function Ui(){return o(Ct)}function ca(r){return Xe.find(u=>u.constructor.pluginName===r)}function qi(){return o(k)}function Wt(){o(U).style.display="none",Re()&&o(me)&&(o(me).style.display="none")}function Jt(r=20){var u;if(o(U))if(o(Ct)||p(Ct,(j()?document.querySelector(j()):(u=o(O))==null?void 0:u.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||o(O),!0),o(Ct)){const g=parseInt(_e(),10)||12,_=o(Ct).getBoundingClientRect(),v=o(U).getBoundingClientRect(),C=document.documentElement.clientHeight,R=document.documentElement.clientWidth,Y=E()==="auto"?_.bottom+v.height+g+r>C:E()==="top",q=Math.max(r,Math.min(R-r-v.width,_.left+_.width/2-v.width/2));if(Y?o(U).style.top=`${_.top-(v.height+g)}px`:o(U).style.top=`${_.bottom+g}px`,o(U).style.left=`${q}px`,o(U).setAttribute("data-floating",Y?"top":"bottom"),o(Gt)){const re=o(Gt).getBoundingClientRect();o(Gt).style.left=_.left-q+_.width/2-re.width/2+"px"}}else $("unable to find floating anchor element")}function ut(r=w.UNVERIFIED,u=null){o(ot)&&(o(ot).abort(),p(ot,null)),p(Yt,!1),p(Oe,null),p(G,null),p(Xn,!1),p(z,null),Fe(r,u)}function ji(r){p(Ct,r,!0)}function Fe(r,u=null){p(k,r,!0),p(at,u,!0),Je("statechange",{payload:o(Oe),state:o(k)})}function Cn(){o(U).style.display="block",E()&&Jt(),Re()&&o(me)&&(o(me).style.display="flex")}async function Ue(){return ut(w.VERIFYING),await new Promise(r=>setTimeout(r,m()||0)),Ko().then(r=>(Oi(r),$("challenge",r),Fi(r))).then(({data:r,solution:u})=>{var g;if($("solution",u),!u||r&&"challenge"in r&&!("clearText"in u)){if((u==null?void 0:u.number)!==void 0&&"challenge"in r)if(se()&&"codeChallenge"in r)["INPUT","BUTTON","SELECT","TEXTAREA"].includes(((g=document.activeElement)==null?void 0:g.tagName)||"")&&y()===!1&&document.activeElement.blur(),p(G,{challenge:r,solution:u},!0);else{if(se()&<()!==void 0)return Di(En(r,u));if(se())return ua(En(r,u));p(Oe,En(r,u),!0),$("payload",o(Oe))}else if(o(k)!==w.EXPIRED)throw $("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."),new Error("Unexpected result returned.")}}).then(()=>{o(G)?(Fe(w.CODE),jn().then(()=>{Je("code",{codeChallenge:o(G)})})):o(Oe)&&(Fe(w.VERIFIED),$("verified"),jn().then(()=>{Je("verified",{payload:o(Oe)}),l()==="onsubmit"?zn(o(At)):Re()&&Wt()}))}).catch(r=>{$(r),Fe(w.ERROR,r.message)})}var Bi=Ho(),Hi=Nt(Bi);no(Hi,t,"default",{});var It=K(Hi,2),er=J(It),An=J(er);let Yi;var Gi=J(An);{var da=r=>{Wn(r)};X(Gi,r=>{o(k)===w.VERIFYING&&r(da)})}var ft=K(Gi,2);ni(ft),ft.__change=[xo,k,Le,O,Yt,We,Zt,Ue],_n(ft,r=>p(Kn,r),()=>o(Kn)),W(An);var In=K(An,2),va=J(In);{var ha=r=>{var u=gn(),g=Nt(u);it(g,()=>o(M).verified),B(r,u)},ga=(r,u)=>{{var g=v=>{var C=gn(),R=Nt(C);it(R,()=>o(M).verifying),B(v,C)},_=(v,C)=>{{var R=q=>{var re=gn(),de=Nt(re);it(de,()=>o(M).verificationRequired),B(q,re)},Y=q=>{var re=gn(),de=Nt(re);it(de,()=>o(M).label),B(q,re)};X(v,q=>{o(k)===w.CODE?q(R):q(Y,!1)},C)}};X(r,v=>{o(k)===w.VERIFYING?v(g):v(_,!1)},u)}};X(va,r=>{o(k)===w.VERIFIED?r(ha):r(ga,!1)})}W(In);var Zi=K(In,2);{var _a=r=>{var u=To();ni(u),Se(()=>{T(u,"name",ce()),ao(u,o(Oe))}),B(r,u)};X(Zi,r=>{o(k)===w.VERIFIED&&r(_a)})}var Wi=K(Zi,2);{var ma=r=>{var u=No(),g=J(u);T(g,"href",Zo),W(u),Se(()=>T(g,"aria-label",o(M).ariaLinkLabel)),B(r,u)};X(Wi,r=>{(ne()!==!0||o(Jn))&&r(ma)})}var ba=K(Wi,2);{var pa=r=>{var u=Vo(),g=K(J(u),2),_=J(g),v=K(_,2);Jl(v,!y()),v.__keydown=[ko,xi];var C=K(v,2),R=J(C),Y=J(R);{var q=ke=>{var Q=Oo();Q.__click=xi;var Rn=J(Q);{var Kt=kt=>{Wn(kt,()=>20)},ka=(kt,$a)=>{{var xa=$t=>{var tr=Do();B($t,tr)},Sa=($t,tr)=>{{var Ta=xt=>{var nr=Lo();B(xt,nr)},Na=xt=>{var nr=Po();B(xt,nr)};X($t,xt=>{o(z)===ee.PLAYING?xt(Ta):xt(Na,!1)},tr)}};X(kt,$t=>{o(z)===ee.ERROR?$t(xa):$t(Sa,!1)},$a)}};X(Rn,kt=>{o(z)===ee.LOADING?kt(Kt):kt(ka,!1)})}W(Q),Se(()=>{T(Q,"title",o(M).getAudioChallenge),Q.disabled=o(z)===ee.LOADING||o(z)===ee.ERROR||o(st),T(Q,"aria-label",o(z)===ee.LOADING?o(M).loading:o(M).getAudioChallenge)}),B(ke,Q)};X(Y,ke=>{o(G).challenge.codeChallenge.audio&&ke(q)})}var re=K(Y,2);re.__click=[$o,Ue],W(R);var de=K(R,2),ct=J(de);{var Rt=ke=>{Wn(ke,()=>16)};X(ct,ke=>{o(st)&&ke(Rt)})}var dt=K(ct);W(de),W(C);var Ia=K(C,2);{var Ra=ke=>{var Q=Fo(),Rn=J(Q);W(Q),_n(Q,Kt=>p(Ke,Kt),()=>o(Ke)),Se(Kt=>T(Rn,"src",Kt),[()=>Ei(o(G).challenge.codeChallenge.audio,{language:H()})]),Ze("loadstart",Q,ra),Ze("canplay",Q,na),Ze("pause",Q,la),Ze("playing",Q,ia),Ze("ended",Q,ea),Ze("error",Rn,ta),B(ke,Q)};X(Ia,ke=>{o(G).challenge.codeChallenge.audio&&o(Xn)&&ke(Ra)})}W(g),W(u),Se(()=>{T(u,"aria-label",o(M).verificationRequired),T(_,"src",o(G).challenge.codeChallenge.image),T(v,"minlength",o(G).challenge.codeChallenge.length||1),T(v,"maxlength",o(G).challenge.codeChallenge.length),T(v,"placeholder",o(M).enterCode),T(v,"aria-label",o(z)===ee.LOADING?o(M).loading:o(z)===ee.PLAYING?"":o(M).enterCodeAria),T(v,"aria-live",o(z)?"assertive":"polite"),T(v,"aria-busy",o(z)===ee.LOADING),v.disabled=o(st),T(re,"aria-label",o(M).reload),T(re,"title",o(M).reload),re.disabled=o(st),de.disabled=o(st),T(de,"aria-label",o(M).verify),Ql(dt,` ${o(M).verify??""}`)}),Ze("submit",g,oa,!0),B(r,u)};X(ba,r=>{var u;(u=o(G))!=null&&u.challenge.codeChallenge&&r(pa)})}W(er);var Ji=K(er,2);{var ya=r=>{var u=qo(),g=K(J(u),2);{var _=C=>{var R=Mo(),Y=J(R);it(Y,()=>o(M).expired),W(R),Se(()=>T(R,"title",o(at))),B(C,R)},v=C=>{var R=Uo(),Y=J(R);it(Y,()=>o(M).error),W(R),Se(()=>T(R,"title",o(at))),B(C,R)};X(g,C=>{o(k)===w.EXPIRED?C(_):C(v,!1)})}W(u),B(r,u)};X(Ji,r=>{(o(at)||o(k)===w.EXPIRED)&&r(ya)})}var Ki=K(Ji,2);{var wa=r=>{var u=jo(),g=J(u),_=J(g);it(_,()=>o(M).footer),W(g),W(u),B(r,u)};X(Ki,r=>{o(M).footer&&(ae()!==!0||o(Jn))&&r(wa)})}var Ea=K(Ki,2);{var Ca=r=>{var u=Bo();_n(u,g=>p(Gt,g),()=>o(Gt)),B(r,u)};X(Ea,r=>{E()&&r(Ca)})}W(It),_n(It,r=>p(U,r),()=>o(U)),Se(r=>{T(It,"data-state",o(k)),T(It,"data-floating",E()),T(It,"data-overlay",Re()),Yi=io(An,1,"altcha-checkbox",null,Yi,r),T(ft,"id",o(mi)),ft.required=l()!=="onsubmit"&&(!E()||l()!=="off"),T(In,"for",o(mi))},[()=>({"altcha-checkbox-verifying":o(k)===w.VERIFYING})]),Ze("invalid",ft,$i),uo(ft,()=>o(Yt),r=>p(Yt,r)),B(e,Bi);var Aa=Zr({clarify:Zt,configure:Vi,getConfiguration:Mi,getFloatingAnchor:Ui,getPlugin:ca,getState:qi,hide:Wt,repositionFloating:Jt,reset:ut,setFloatingAnchor:ji,setState:Fe,show:Cn,verify:Ue,get auto(){return l()},set auto(r=void 0){l(r),A()},get blockspam(){return f()},set blockspam(r=void 0){f(r),A()},get challengeurl(){return s()},set challengeurl(r=void 0){s(r),A()},get challengejson(){return c()},set challengejson(r=void 0){c(r),A()},get credentials(){return d()},set credentials(r=void 0){d(r),A()},get customfetch(){return b()},set customfetch(r=void 0){b(r),A()},get debug(){return h()},set debug(r=!1){h(r),A()},get delay(){return m()},set delay(r=0){m(r),A()},get disableautofocus(){return y()},set disableautofocus(r=!1){y(r),A()},get expire(){return N()},set expire(r=void 0){N(r),A()},get floating(){return E()},set floating(r=void 0){E(r),A()},get floatinganchor(){return j()},set floatinganchor(r=void 0){j(r),A()},get floatingoffset(){return _e()},set floatingoffset(r=void 0){_e(r),A()},get floatingpersist(){return te()},set floatingpersist(r=!1){te(r),A()},get hidefooter(){return ae()},set hidefooter(r=!1){ae(r),A()},get hidelogo(){return ne()},set hidelogo(r=!1){ne(r),A()},get id(){return yt()},set id(r=void 0){yt(r),A()},get language(){return H()},set language(r=void 0){H(r),A()},get name(){return ce()},set name(r="altcha"){ce(r),A()},get maxnumber(){return Ie()},set maxnumber(r=1e6){Ie(r),A()},get mockerror(){return qt()},set mockerror(r=!1){qt(r),A()},get obfuscated(){return We()},set obfuscated(r=void 0){We(r),A()},get overlay(){return Re()},set overlay(r=void 0){Re(r),A()},get overlaycontent(){return jt()},set overlaycontent(r=void 0){jt(r),A()},get plugins(){return yn()},set plugins(r=void 0){yn(r),A()},get refetchonexpire(){return Bt()},set refetchonexpire(r=!0){Bt(r),A()},get sentinel(){return lt()},set sentinel(r=void 0){lt(r),A()},get spamfilter(){return Le()},set spamfilter(r=!1){Le(r),A()},get strings(){return wt()},set strings(r=void 0){wt(r),A()},get test(){return we()},set test(r=!1){we(r),A()},get verifyurl(){return se()},set verifyurl(r=void 0){se(r),A()},get workers(){return Et()},set workers(r=Math.min(16,navigator.hardwareConcurrency||8)){Et(r),A()},get workerurl(){return Ht()},set workerurl(r=void 0){Ht(r),A()}});return i(),Aa}zl(["change","keydown","click"]),customElements.define("altcha-widget",po(vi,{blockspam:{type:"Boolean"},debug:{type:"Boolean"},delay:{type:"Number"},disableautofocus:{type:"Boolean"},expire:{type:"Number"},floatingoffset:{type:"Number"},hidefooter:{type:"Boolean"},hidelogo:{type:"Boolean"},maxnumber:{type:"Number"},mockerror:{type:"Boolean"},refetchonexpire:{type:"Boolean"},test:{type:"Boolean"},workers:{type:"Number"},auto:{},challengeurl:{},challengejson:{},credentials:{},customfetch:{},floating:{},floatinganchor:{},floatingpersist:{},id:{},language:{},name:{},obfuscated:{},overlay:{},overlaycontent:{},plugins:{},sentinel:{},spamfilter:{},strings:{},verifyurl:{},workerurl:{}},["default"],["clarify","configure","getConfiguration","getFloatingAnchor","getPlugin","getState","hide","repositionFloating","reset","setFloatingAnchor","setState","show","verify"],!1)),globalThis.altchaCreateWorker=e=>new Worker(new URL(e||"./worker.js",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:S&&S.tagName.toUpperCase()==="SCRIPT"&&S.src||new URL("altcha.umd.cjs",document.baseURI).href)),x.Altcha=vi,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(x,S){typeof exports=="object"&&typeof module<"u"?S(exports):typeof define=="function"&&define.amd?define(["exports"],S):(x=typeof globalThis<"u"?globalThis:x||self,S(x.altcha={}))})(this,function(x){"use strict";var Da=Object.defineProperty;var Qi=x=>{throw TypeError(x)};var La=(x,S,Z)=>S in x?Da(x,S,{enumerable:!0,configurable:!0,writable:!0,value:Z}):x[S]=Z;var $e=(x,S,Z)=>La(x,typeof S!="symbol"?S+"":S,Z),el=(x,S,Z)=>S.has(x)||Qi("Cannot "+Z);var ve=(x,S,Z)=>(el(x,S,"read from private field"),Z?Z.call(x):S.get(x)),nr=(x,S,Z)=>S.has(x)?Qi("Cannot add the same private member more than once"):S instanceof WeakSet?S.add(x):S.set(x,Z),rr=(x,S,Z,Xt)=>(el(x,S,"write to private field"),Xt?Xt.call(x,Z):S.set(x,Z),Z);var vi,Me,ye;var S=typeof document<"u"?document.currentScript:null;const Z="5";typeof window<"u"&&((vi=window.__svelte??(window.__svelte={})).v??(vi.v=new Set)).add(Z);const Xt=1,tl=4,nl=8,rl=16,il=1,ll=2,kn="[",ir="[!",lr="]",vt={},ue=Symbol(),ol="http://www.w3.org/1999/xhtml",or=!1;function ar(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}var sr=Array.isArray,al=Array.prototype.indexOf,sl=Array.from,zt=Object.keys,xt=Object.defineProperty,ze=Object.getOwnPropertyDescriptor,ul=Object.getOwnPropertyDescriptors,fl=Object.prototype,cl=Array.prototype,ur=Object.getPrototypeOf,fr=Object.isExtensible;const ht=()=>{};function cr(e){for(var t=0;t<e.length;t++)e[t]()}function dl(e,t,n=!1){return e===void 0?n?t():t:e}const Ee=2,dr=4,Qt=8,$n=16,Ve=32,Qe=64,en=128,he=256,tn=512,fe=1024,xe=2048,et=4096,gt=8192,nn=16384,vl=32768,xn=65536,hl=1<<19,vr=1<<20,Sn=1<<21,St=Symbol("$state"),hr=Symbol("legacy props"),gl=Symbol("");function _l(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function ml(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function pl(e){throw new Error("https://svelte.dev/e/effect_orphan")}function bl(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function yl(){throw new Error("https://svelte.dev/e/hydration_failed")}function wl(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function El(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Cl(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Al(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function rn(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let F=!1;function _t(e){F=e}let V;function qe(e){if(e===null)throw rn(),vt;return V=e}function mt(){return qe(Be(V))}function W(e){if(F){if(Be(V)!==null)throw rn(),vt;V=e}}function Il(){for(var e=0,t=V;;){if(t.nodeType===8){var n=t.data;if(n===lr){if(e===0)return t;e-=1}else(n===kn||n===ir)&&(e+=1)}var i=Be(t);t.remove(),t=i}}let Rl=!1;function je(e){if(typeof e!="object"||e===null||St in e)return e;const t=ur(e);if(t!==fl&&t!==cl)return e;var n=new Map,i=sr(e),a=P(0),l=D,f=s=>{var c=D;Ne(l);var d=s();return Ne(c),d};return i&&n.set("length",P(e.length)),new Proxy(e,{defineProperty(s,c,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&El();var p=n.get(c);return p===void 0?(p=f(()=>P(d.value)),n.set(c,p)):b(p,f(()=>je(d.value))),!0},deleteProperty(s,c){var d=n.get(c);if(d===void 0)c in s&&(n.set(c,f(()=>P(ue))),Tn(a));else{if(i&&typeof c=="string"){var p=n.get("length"),h=Number(c);Number.isInteger(h)&&h<p.v&&b(p,h)}b(d,ue),Tn(a)}return!0},get(s,c,d){var y;if(c===St)return e;var p=n.get(c),h=c in s;if(p===void 0&&(!h||(y=ze(s,c))!=null&&y.writable)&&(p=f(()=>P(je(h?s[c]:ue))),n.set(c,p)),p!==void 0){var m=o(p);return m===ue?void 0:m}return Reflect.get(s,c,d)},getOwnPropertyDescriptor(s,c){var d=Reflect.getOwnPropertyDescriptor(s,c);if(d&&"value"in d){var p=n.get(c);p&&(d.value=o(p))}else if(d===void 0){var h=n.get(c),m=h==null?void 0:h.v;if(h!==void 0&&m!==ue)return{enumerable:!0,configurable:!0,value:m,writable:!0}}return d},has(s,c){var m;if(c===St)return!0;var d=n.get(c),p=d!==void 0&&d.v!==ue||Reflect.has(s,c);if(d!==void 0||L!==null&&(!p||(m=ze(s,c))!=null&&m.writable)){d===void 0&&(d=f(()=>P(p?je(s[c]):ue)),n.set(c,d));var h=o(d);if(h===ue)return!1}return p},set(s,c,d,p){var te;var h=n.get(c),m=c in s;if(i&&c==="length")for(var y=d;y<h.v;y+=1){var N=n.get(y+"");N!==void 0?b(N,ue):y in s&&(N=f(()=>P(ue)),n.set(y+"",N))}h===void 0?(!m||(te=ze(s,c))!=null&&te.writable)&&(h=f(()=>P(void 0)),b(h,f(()=>je(d))),n.set(c,h)):(m=h.v!==ue,b(h,f(()=>je(d))));var E=Reflect.getOwnPropertyDescriptor(s,c);if(E!=null&&E.set&&E.set.call(p,d),!m){if(i&&typeof c=="string"){var j=n.get("length"),_e=Number(c);Number.isInteger(_e)&&_e>=j.v&&b(j,_e+1)}Tn(a)}return!0},ownKeys(s){o(a);var c=Reflect.ownKeys(s).filter(h=>{var m=n.get(h);return m===void 0||m.v!==ue});for(var[d,p]of n)p.v!==ue&&!(d in s)&&c.push(d);return c},setPrototypeOf(){Cl()}})}function Tn(e,t=1){b(e,e.v+t)}var gr,_r,mr,pr;function Nn(){if(gr===void 0){gr=window,_r=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;mr=ze(t,"firstChild").get,pr=ze(t,"nextSibling").get,fr(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),fr(n)&&(n.__t=void 0)}}function ln(e=""){return document.createTextNode(e)}function pe(e){return mr.call(e)}function Be(e){return pr.call(e)}function J(e,t){if(!F)return pe(e);var n=pe(V);return n===null&&(n=V.appendChild(ln())),qe(n),n}function Tt(e,t){if(!F){var n=pe(e);return n instanceof Comment&&n.data===""?Be(n):n}return V}function K(e,t=1,n=!1){let i=F?V:e;for(var a;t--;)a=i,i=Be(i);if(!F)return i;var l=i==null?void 0:i.nodeType;if(n&&l!==3){var f=ln();return i===null?a==null||a.after(f):i.before(f),qe(f),f}return qe(i),i}function kl(e){e.textContent=""}function br(e){return e===this.v}function yr(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Dn(e){return!yr(e,this.v)}function on(e){var t=Ee|xe,n=D!==null&&(D.f&Ee)!==0?D:null;return L===null||n!==null&&(n.f&he)!==0?t|=he:L.f|=vr,{ctx:oe,deps:null,effects:null,equals:br,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:n??L}}function Nt(e){const t=on(e);return Pr(t),t}function $l(e){const t=on(e);return t.equals=Dn,t}function wr(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)He(t[n])}}function xl(e){for(var t=e.parent;t!==null;){if((t.f&Ee)===0)return t;t=t.parent}return null}function Er(e){var t,n=L;Ye(xl(e));try{wr(e),t=Ur(e)}finally{Ye(n)}return t}function Cr(e){var t=Er(e),n=(Ge||(e.f&he)!==0)&&e.deps!==null?et:fe;Ce(e,n),e.equals(t)||(e.v=t,e.wv=Fr())}function Sl(e){L===null&&D===null&&pl(),D!==null&&(D.f&he)!==0&&L===null&&ml(),Pt&&_l()}function Tl(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function tt(e,t,n,i=!0){var a=L,l={ctx:oe,deps:null,nodes_start:null,nodes_end:null,f:e|xe,first:null,fn:t,last:null,next:null,parent:a,prev:null,teardown:null,transitions:null,wv:0};if(n)try{qn(l),l.f|=vl}catch(c){throw He(l),c}else t!==null&&vn(l);var f=n&&l.deps===null&&l.first===null&&l.nodes_start===null&&l.teardown===null&&(l.f&(vr|en))===0;if(!f&&i&&(a!==null&&Tl(l,a),D!==null&&(D.f&Ee)!==0)){var s=D;(s.effects??(s.effects=[])).push(l)}return l}function Ln(e){const t=tt(Qt,null,!1);return Ce(t,fe),t.teardown=e,t}function Pn(e){Sl();var t=L!==null&&(L.f&Ve)!==0&&oe!==null&&!oe.m;if(t){var n=oe;(n.e??(n.e=[])).push({fn:e,effect:L,reaction:D})}else{var i=On(e);return i}}function Nl(e){const t=tt(Qe,e,!0);return()=>{He(t)}}function Dl(e){const t=tt(Qe,e,!0);return(n={})=>new Promise(i=>{n.outro?Mn(t,()=>{He(t),i(void 0)}):(He(t),i(void 0))})}function On(e){return tt(dr,e,!1)}function Fn(e){return tt(Qt,e,!0)}function Se(e,t=[],n=on){const i=t.map(n);return Ar(()=>e(...i.map(o)))}function Ar(e,t=0){return tt(Qt|$n|t,e,!0)}function Vn(e,t=!0){return tt(Qt|Ve,e,!0,t)}function Ir(e){var t=e.teardown;if(t!==null){const n=Pt,i=D;Lr(!0),Ne(null);try{t.call(null)}finally{Lr(n),Ne(i)}}}function Rr(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){var i=n.next;(n.f&Qe)!==0?n.parent=null:He(n,t),n=i}}function Ll(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&Ve)===0&&He(t),t=n}}function He(e,t=!0){var n=!1;(t||(e.f&hl)!==0)&&e.nodes_start!==null&&(kr(e.nodes_start,e.nodes_end),n=!0),Rr(e,t&&!n),dn(e,0),Ce(e,nn);var i=e.transitions;if(i!==null)for(const l of i)l.stop();Ir(e);var a=e.parent;a!==null&&a.first!==null&&$r(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function kr(e,t){for(;e!==null;){var n=e===t?null:Be(e);e.remove(),e=n}}function $r(e){var t=e.parent,n=e.prev,i=e.next;n!==null&&(n.next=i),i!==null&&(i.prev=n),t!==null&&(t.first===e&&(t.first=i),t.last===e&&(t.last=n))}function Mn(e,t){var n=[];xr(e,n,!0),Pl(n,()=>{He(e),t&&t()})}function Pl(e,t){var n=e.length;if(n>0){var i=()=>--n||t();for(var a of e)a.out(i)}else t()}function xr(e,t,n){if((e.f>)===0){if(e.f^=gt,e.transitions!==null)for(const f of e.transitions)(f.is_global||n)&&t.push(f);for(var i=e.first;i!==null;){var a=i.next,l=(i.f&xn)!==0||(i.f&Ve)!==0;xr(i,t,l?n:!1),i=a}}}function Sr(e){Tr(e,!0)}function Tr(e,t){if((e.f>)!==0){e.f^=gt,(e.f&fe)===0&&(e.f^=fe),Ft(e)&&(Ce(e,xe),vn(e));for(var n=e.first;n!==null;){var i=n.next,a=(n.f&xn)!==0||(n.f&Ve)!==0;Tr(n,a?t:!1),n=i}if(e.transitions!==null)for(const l of e.transitions)(l.is_global||t)&&l.in()}}const Ol=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let Dt=[],Lt=[];function Nr(){var e=Dt;Dt=[],cr(e)}function Dr(){var e=Lt;Lt=[],cr(e)}function Un(e){Dt.length===0&&queueMicrotask(Nr),Dt.push(e)}function Fl(e){Lt.length===0&&Ol(Dr),Lt.push(e)}function Vl(){Dt.length>0&&Nr(),Lt.length>0&&Dr()}let an=!1,sn=!1,un=null,nt=!1,Pt=!1;function Lr(e){Pt=e}let Ot=[],Pa=[],D=null,Te=!1;function Ne(e){D=e}let L=null;function Ye(e){L=e}let ie=null;function Pr(e){D!==null&&D.f&Sn&&(ie===null?ie=[e]:ie.push(e))}let le=null,ge=0,be=null;function Ml(e){be=e}let Or=1,fn=0,Ge=!1;function Fr(){return++Or}function Ft(e){var h;var t=e.f;if((t&xe)!==0)return!0;if((t&et)!==0){var n=e.deps,i=(t&he)!==0;if(n!==null){var a,l,f=(t&tn)!==0,s=i&&L!==null&&!Ge,c=n.length;if(f||s){var d=e,p=d.parent;for(a=0;a<c;a++)l=n[a],(f||!((h=l==null?void 0:l.reactions)!=null&&h.includes(d)))&&(l.reactions??(l.reactions=[])).push(d);f&&(d.f^=tn),s&&p!==null&&(p.f&he)===0&&(d.f^=he)}for(a=0;a<c;a++)if(l=n[a],Ft(l)&&Cr(l),l.wv>e.wv)return!0}(!i||L!==null&&!Ge)&&Ce(e,fe)}return!1}function Ul(e,t){for(var n=t;n!==null;){if((n.f&en)!==0)try{n.fn(e);return}catch{n.f^=en}n=n.parent}throw an=!1,e}function Vr(e){return(e.f&nn)===0&&(e.parent===null||(e.parent.f&en)===0)}function cn(e,t,n,i){if(an){if(n===null&&(an=!1),Vr(t))throw e;return}if(n!==null&&(an=!0),Ul(e,t),Vr(t))throw e}function Mr(e,t,n=!0){var i=e.reactions;if(i!==null)for(var a=0;a<i.length;a++){var l=i[a];ie!=null&&ie.includes(e)||((l.f&Ee)!==0?Mr(l,t,!1):t===l&&(n?Ce(l,xe):(l.f&fe)!==0&&Ce(l,et),vn(l)))}}function Ur(e){var y;var t=le,n=ge,i=be,a=D,l=Ge,f=ie,s=oe,c=Te,d=e.f;le=null,ge=0,be=null,Ge=(d&he)!==0&&(Te||!nt||D===null),D=(d&(Ve|Qe))===0?e:null,ie=null,Hr(e.ctx),Te=!1,fn++,e.f|=Sn;try{var p=(0,e.fn)(),h=e.deps;if(le!==null){var m;if(dn(e,ge),h!==null&&ge>0)for(h.length=ge+le.length,m=0;m<le.length;m++)h[ge+m]=le[m];else e.deps=h=le;if(!Ge)for(m=ge;m<h.length;m++)((y=h[m]).reactions??(y.reactions=[])).push(e)}else h!==null&&ge<h.length&&(dn(e,ge),h.length=ge);if(Zr()&&be!==null&&!Te&&h!==null&&(e.f&(Ee|et|xe))===0)for(m=0;m<be.length;m++)Mr(be[m],e);return a!==null&&a!==e&&(fn++,be!==null&&(i===null?i=be:i.push(...be))),p}finally{le=t,ge=n,be=i,D=a,Ge=l,ie=f,Hr(s),Te=c,e.f^=Sn}}function ql(e,t){let n=t.reactions;if(n!==null){var i=al.call(n,e);if(i!==-1){var a=n.length-1;a===0?n=t.reactions=null:(n[i]=n[a],n.pop())}}n===null&&(t.f&Ee)!==0&&(le===null||!le.includes(t))&&(Ce(t,et),(t.f&(he|tn))===0&&(t.f^=tn),wr(t),dn(t,0))}function dn(e,t){var n=e.deps;if(n!==null)for(var i=t;i<n.length;i++)ql(e,n[i])}function qn(e){var t=e.f;if((t&nn)===0){Ce(e,fe);var n=L,i=oe,a=nt;L=e,nt=!0;try{(t&$n)!==0?Ll(e):Rr(e),Ir(e);var l=Ur(e);e.teardown=typeof l=="function"?l:null,e.wv=Or;var f=e.deps,s;or&&Rl&&e.f&xe}catch(c){cn(c,e,n,i||e.ctx)}finally{nt=a,L=n}}}function jl(){try{bl()}catch(e){if(un!==null)cn(e,un,null);else throw e}}function qr(){var e=nt;try{var t=0;for(nt=!0;Ot.length>0;){t++>1e3&&jl();var n=Ot,i=n.length;Ot=[];for(var a=0;a<i;a++){var l=Hl(n[a]);Bl(l)}Vt.clear()}}finally{sn=!1,nt=e,un=null}}function Bl(e){var t=e.length;if(t!==0)for(var n=0;n<t;n++){var i=e[n];if((i.f&(nn|gt))===0)try{Ft(i)&&(qn(i),i.deps===null&&i.first===null&&i.nodes_start===null&&(i.teardown===null?$r(i):i.fn=null))}catch(a){cn(a,i,null,i.ctx)}}}function vn(e){sn||(sn=!0,queueMicrotask(qr));for(var t=un=e;t.parent!==null;){t=t.parent;var n=t.f;if((n&(Qe|Ve))!==0){if((n&fe)===0)return;t.f^=fe}}Ot.push(t)}function Hl(e){for(var t=[],n=e;n!==null;){var i=n.f,a=(i&(Ve|Qe))!==0,l=a&&(i&fe)!==0;if(!l&&(i>)===0){if((i&dr)!==0)t.push(n);else if(a)n.f^=fe;else try{Ft(n)&&qn(n)}catch(c){cn(c,n,null,n.ctx)}var f=n.first;if(f!==null){n=f;continue}}var s=n.parent;for(n=n.next;n===null&&s!==null;)n=s.next,s=s.parent}return t}function A(e){for(var t;;){if(Vl(),Ot.length===0)return t;sn=!0,qr()}}async function jn(){await Promise.resolve(),A()}function o(e){var t=e.f,n=(t&Ee)!==0;if(D!==null&&!Te){if(!(ie!=null&&ie.includes(e))){var i=D.deps;e.rv<fn&&(e.rv=fn,le===null&&i!==null&&i[ge]===e?ge++:le===null?le=[e]:(!Ge||!le.includes(e))&&le.push(e))}}else if(n&&e.deps===null&&e.effects===null){var a=e,l=a.parent;l!==null&&(l.f&he)===0&&(a.f^=he)}return n&&(a=e,Ft(a)&&Cr(a)),Pt&&Vt.has(e)?Vt.get(e):e.v}function rt(e){var t=Te;try{return Te=!0,e()}finally{Te=t}}const Yl=-7169;function Ce(e,t){e.f=e.f&Yl|t}const Vt=new Map;function jr(e,t){var n={f:0,v:e,reactions:null,equals:br,rv:0,wv:0};return n}function P(e,t){const n=jr(e);return Pr(n),n}function Bn(e,t=!1){const n=jr(e);return t||(n.equals=Dn),n}function b(e,t,n=!1){D!==null&&!Te&&Zr()&&(D.f&(Ee|$n))!==0&&!(ie!=null&&ie.includes(e))&&Al();let i=n?je(t):t;return Gl(e,i)}function Gl(e,t){if(!e.equals(t)){var n=e.v;Pt?Vt.set(e,t):Vt.set(e,n),e.v=t,(e.f&Ee)!==0&&((e.f&xe)!==0&&Er(e),Ce(e,(e.f&he)===0?fe:et)),e.wv=Fr(),Br(e,xe),L!==null&&(L.f&fe)!==0&&(L.f&(Ve|Qe))===0&&(be===null?Ml([e]):be.push(e))}return t}function Br(e,t){var n=e.reactions;if(n!==null)for(var i=n.length,a=0;a<i;a++){var l=n[a],f=l.f;(f&xe)===0&&(Ce(l,t),(f&(fe|he))!==0&&((f&Ee)!==0?Br(l,et):vn(l)))}}let oe=null;function Hr(e){oe=e}function Yr(e,t=!1,n){var i=oe={p:oe,c:null,d:!1,e:null,m:!1,s:e,x:null,l:null};Ln(()=>{i.d=!0})}function Gr(e){const t=oe;if(t!==null){e!==void 0&&(t.x=e);const f=t.e;if(f!==null){var n=L,i=D;t.e=null;try{for(var a=0;a<f.length;a++){var l=f[a];Ye(l.effect),Ne(l.reaction),On(l.fn)}}finally{Ye(n),Ne(i)}}oe=t.p,t.m=!0}return e||{}}function Zr(){return!0}const Zl=["touchstart","touchmove"];function Wl(e){return Zl.includes(e)}function Jl(e,t){if(t){const n=document.body;e.autofocus=!0,Un(()=>{document.activeElement===n&&e.focus()})}}let Wr=!1;function Jr(){Wr||(Wr=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const n of e.target.elements)(t=n.__on_r)==null||t.call(n)})},{capture:!0}))}function Kr(e){var t=D,n=L;Ne(null),Ye(null);try{return e()}finally{Ne(t),Ye(n)}}function Kl(e,t,n,i=n){e.addEventListener(t,()=>Kr(n));const a=e.__on_r;a?e.__on_r=()=>{a(),i(!0)}:e.__on_r=()=>i(!0),Jr()}const Xr=new Set,Hn=new Set;function Xl(e,t,n,i={}){function a(l){if(i.capture||Mt.call(t,l),!l.cancelBubble)return Kr(()=>n==null?void 0:n.call(this,l))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Un(()=>{t.addEventListener(e,a,i)}):t.addEventListener(e,a,i),a}function Ze(e,t,n,i,a){var l={capture:i,passive:a},f=Xl(e,t,n,l);(t===document.body||t===window||t===document)&&Ln(()=>{t.removeEventListener(e,f,l)})}function zl(e){for(var t=0;t<e.length;t++)Xr.add(e[t]);for(var n of Hn)n(e)}function Mt(e){var te;var t=this,n=t.ownerDocument,i=e.type,a=((te=e.composedPath)==null?void 0:te.call(e))||[],l=a[0]||e.target,f=0,s=e.__root;if(s){var c=a.indexOf(s);if(c!==-1&&(t===document||t===window)){e.__root=t;return}var d=a.indexOf(t);if(d===-1)return;c<=d&&(f=c)}if(l=a[f]||e.target,l!==t){xt(e,"currentTarget",{configurable:!0,get(){return l||n}});var p=D,h=L;Ne(null),Ye(null);try{for(var m,y=[];l!==null;){var N=l.assignedSlot||l.parentNode||l.host||null;try{var E=l["__"+i];if(E!=null&&(!l.disabled||e.target===l))if(sr(E)){var[j,..._e]=E;j.apply(l,[e,..._e])}else E.call(l,e)}catch(ae){m?y.push(ae):m=ae}if(e.cancelBubble||N===t||N===null)break;l=N}if(m){for(let ae of y)queueMicrotask(()=>{throw ae});throw m}}finally{e.__root=t,delete e.currentTarget,Ne(p),Ye(h)}}}function Yn(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function De(e,t){var n=L;n.nodes_start===null&&(n.nodes_start=e,n.nodes_end=t)}function Ae(e,t){var n=(t&il)!==0,i=(t&ll)!==0,a,l=!e.startsWith("<!>");return()=>{if(F)return De(V,null),V;a===void 0&&(a=Yn(l?e:"<!>"+e),n||(a=pe(a)));var f=i||_r?document.importNode(a,!0):a.cloneNode(!0);if(n){var s=pe(f),c=f.lastChild;De(s,c)}else De(f,f);return f}}function hn(e,t,n="svg"){var i=!e.startsWith("<!>"),a=`<${n}>${i?e:"<!>"+e}</${n}>`,l;return()=>{if(F)return De(V,null),V;if(!l){var f=Yn(a),s=pe(f);l=pe(s)}var c=l.cloneNode(!0);return De(c,c),c}}function gn(){if(F)return De(V,null),V;var e=document.createDocumentFragment(),t=document.createComment(""),n=ln();return e.append(t,n),De(t,n),e}function B(e,t){if(F){L.nodes_end=V,mt();return}e!==null&&e.before(t)}function Ql(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=n,e.nodeValue=n+"")}function zr(e,t){return Qr(e,t)}function eo(e,t){Nn(),t.intro=t.intro??!1;const n=t.target,i=F,a=V;try{for(var l=pe(n);l&&(l.nodeType!==8||l.data!==kn);)l=Be(l);if(!l)throw vt;_t(!0),qe(l),mt();const f=Qr(e,{...t,anchor:l});if(V===null||V.nodeType!==8||V.data!==lr)throw rn(),vt;return _t(!1),f}catch(f){if(f===vt)return t.recover===!1&&yl(),Nn(),kl(n),_t(!1),zr(e,t);throw f}finally{_t(i),qe(a)}}const pt=new Map;function Qr(e,{target:t,anchor:n,props:i={},events:a,context:l,intro:f=!0}){Nn();var s=new Set,c=h=>{for(var m=0;m<h.length;m++){var y=h[m];if(!s.has(y)){s.add(y);var N=Wl(y);t.addEventListener(y,Mt,{passive:N});var E=pt.get(y);E===void 0?(document.addEventListener(y,Mt,{passive:N}),pt.set(y,1)):pt.set(y,E+1)}}};c(sl(Xr)),Hn.add(c);var d=void 0,p=Dl(()=>{var h=n??t.appendChild(ln());return Vn(()=>{if(l){Yr({});var m=oe;m.c=l}a&&(i.$$events=a),F&&De(h,null),d=e(h,i)||{},F&&(L.nodes_end=V),l&&Gr()}),()=>{var N;for(var m of s){t.removeEventListener(m,Mt);var y=pt.get(m);--y===0?(document.removeEventListener(m,Mt),pt.delete(m)):pt.set(m,y)}Hn.delete(c),h!==n&&((N=h.parentNode)==null||N.removeChild(h))}});return Gn.set(d,p),d}let Gn=new WeakMap;function to(e,t){const n=Gn.get(e);return n?(Gn.delete(e),n(t)):Promise.resolve()}function X(e,t,[n,i]=[0,0]){F&&n===0&&mt();var a=e,l=null,f=null,s=ue,c=n>0?xn:0,d=!1;const p=(m,y=!0)=>{d=!0,h(y,m)},h=(m,y)=>{if(s===(s=m))return;let N=!1;if(F&&i!==-1){if(n===0){const j=a.data;j===kn?i=0:j===ir?i=1/0:(i=parseInt(j.substring(1)),i!==i&&(i=s?1/0:-1))}const E=i>n;!!s===E&&(a=Il(),qe(a),_t(!1),N=!0,i=-1)}s?(l?Sr(l):y&&(l=Vn(()=>y(a))),f&&Mn(f,()=>{f=null})):(f?Sr(f):y&&(f=Vn(()=>y(a,[n+1,i]))),l&&Mn(l,()=>{l=null})),N&&_t(!0)};Ar(()=>{d=!1,t(p),d||h(null,null)},c),F&&(a=V)}function it(e,t,n=!1,i=!1,a=!1){var l=e,f="";Se(()=>{var s=L;if(f===(f=t()??"")){F&&mt();return}if(s.nodes_start!==null&&(kr(s.nodes_start,s.nodes_end),s.nodes_start=s.nodes_end=null),f!==""){if(F){V.data;for(var c=mt(),d=c;c!==null&&(c.nodeType!==8||c.data!=="");)d=c,c=Be(c);if(c===null)throw rn(),vt;De(V,d),l=qe(c);return}var p=f+"";n?p=`<svg>${p}</svg>`:i&&(p=`<math>${p}</math>`);var h=Yn(p);if((n||i)&&(h=pe(h)),De(pe(h),h.lastChild),n||i)for(;pe(h);)l.before(pe(h));else l.before(h)}})}function no(e,t,n,i,a){var s;F&&mt();var l=(s=t.$$slots)==null?void 0:s[n],f=!1;l===!0&&(l=t.children,f=!0),l===void 0||l(e,f?()=>i:i)}const ei=[...`
|
|
2
|
+
\r\f \v\uFEFF`];function ro(e,t,n){var i=""+e;if(n){for(var a in n)if(n[a])i=i?i+" "+a:a;else if(i.length)for(var l=a.length,f=0;(f=i.indexOf(a,f))>=0;){var s=f+l;(f===0||ei.includes(i[f-1]))&&(s===i.length||ei.includes(i[s]))?i=(f===0?"":i.substring(0,f))+i.substring(s+1):f=s}}return i===""?null:i}function io(e,t,n,i,a,l){var f=e.__className;if(F||f!==n||f===void 0){var s=ro(n,i,l);(!F||s!==e.getAttribute("class"))&&(s==null?e.removeAttribute("class"):e.className=s),e.__className=n}else if(l&&a!==l)for(var c in l){var d=!!l[c];(a==null||d!==!!a[c])&&e.classList.toggle(c,d)}return l}const lo=Symbol("is custom element"),oo=Symbol("is html");function ti(e){if(F){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var i=e.value;T(e,"value",null),e.value=i}if(e.hasAttribute("checked")){var a=e.checked;T(e,"checked",null),e.checked=a}}};e.__on_r=n,Fl(n),Jr()}}function ao(e,t){var n=ni(e);n.value===(n.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function T(e,t,n,i){var a=ni(e);F&&(a[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||a[t]!==(a[t]=n)&&(t==="loading"&&(e[gl]=n),n==null?e.removeAttribute(t):typeof n!="string"&&so(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function ni(e){return e.__attributes??(e.__attributes={[lo]:e.nodeName.includes("-"),[oo]:e.namespaceURI===ol})}var ri=new Map;function so(e){var t=ri.get(e.nodeName);if(t)return t;ri.set(e.nodeName,t=[]);for(var n,i=e,a=Element.prototype;a!==i;){n=ul(i);for(var l in n)n[l].set&&t.push(l);i=ur(i)}return t}function uo(e,t,n=t){Kl(e,"change",i=>{var a=i?e.defaultChecked:e.checked;n(a)}),(F&&e.defaultChecked!==e.checked||rt(t)==null)&&n(e.checked),Fn(()=>{var i=t();e.checked=!!i})}function ii(e,t){return e===t||(e==null?void 0:e[St])===t}function _n(e={},t,n,i){return On(()=>{var a,l;return Fn(()=>{a=l,l=[],rt(()=>{e!==n(...l)&&(t(e,...l),a&&ii(n(...a),e)&&t(null,...a))})}),()=>{Un(()=>{l&&ii(n(...l),e)&&t(null,...l)})}}),e}function li(e){oe===null&&ar(),Pn(()=>{const t=rt(e);if(typeof t=="function")return t})}function fo(e){oe===null&&ar(),li(()=>()=>rt(e))}function oi(e,t,n){if(e==null)return t(void 0),ht;const i=rt(()=>e.subscribe(t,n));return i.unsubscribe?()=>i.unsubscribe():i}const bt=[];function co(e,t=ht){let n=null;const i=new Set;function a(s){if(yr(e,s)&&(e=s,n)){const c=!bt.length;for(const d of i)d[1](),bt.push(d,e);if(c){for(let d=0;d<bt.length;d+=2)bt[d][0](bt[d+1]);bt.length=0}}}function l(s){a(s(e))}function f(s,c=ht){const d=[s,c];return i.add(d),i.size===1&&(n=t(a,l)||ht),s(e),()=>{i.delete(d),i.size===0&&n&&(n(),n=null)}}return{set:a,update:l,subscribe:f}}function mn(e){let t;return oi(e,n=>t=n)(),t}let pn=!1,Zn=Symbol();function vo(e,t,n){const i=n[t]??(n[t]={store:null,source:Bn(void 0),unsubscribe:ht});if(i.store!==e&&!(Zn in n))if(i.unsubscribe(),i.store=e??null,e==null)i.source.v=void 0,i.unsubscribe=ht;else{var a=!0;i.unsubscribe=oi(e,l=>{a?i.source.v=l:b(i.source,l)}),a=!1}return e&&Zn in n?mn(e):o(i.source)}function ho(){const e={};function t(){Ln(()=>{for(var n in e)e[n].unsubscribe();xt(e,Zn,{enumerable:!1,value:!0})})}return[e,t]}function go(e){var t=pn;try{return pn=!1,[e(),pn]}finally{pn=t}}function ai(e){var t;return((t=e.ctx)==null?void 0:t.d)??!1}function I(e,t,n,i){var yt;var a=(n&Xt)!==0,l=!0,f=(n&nl)!==0,s=(n&rl)!==0,c=!1,d;f?[d,c]=go(()=>e[t]):d=e[t];var p=St in e||hr in e,h=f&&(((yt=ze(e,t))==null?void 0:yt.set)??(p&&t in e&&(H=>e[t]=H)))||void 0,m=i,y=!0,N=!1,E=()=>(N=!0,y&&(y=!1,s?m=rt(i):m=i),m);d===void 0&&i!==void 0&&(h&&l&&wl(),d=E(),h&&h(d));var j;if(j=()=>{var H=e[t];return H===void 0?E():(y=!0,N=!1,H)},(n&tl)===0)return j;if(h){var _e=e.$$legacy;return function(H,ce){return arguments.length>0?((!ce||_e||c)&&h(ce?j():H),H):j()}}var te=!1,ae=Bn(d),ne=on(()=>{var H=j(),ce=o(ae);return te?(te=!1,ce):ae.v=H});return f&&o(ne),a||(ne.equals=Dn),function(H,ce){if(arguments.length>0){const Ie=ce?o(ne):f?je(H):H;if(!ne.equals(Ie)){if(te=!0,b(ae,Ie),N&&m!==void 0&&(m=Ie),ai(ne))return H;rt(()=>o(ne))}return H}return ai(ne)?ne.v:o(ne)}}function _o(e){return new mo(e)}class mo{constructor(t){nr(this,Me);nr(this,ye);var l;var n=new Map,i=(f,s)=>{var c=Bn(s);return n.set(f,c),c};const a=new Proxy({...t.props||{},$$events:{}},{get(f,s){return o(n.get(s)??i(s,Reflect.get(f,s)))},has(f,s){return s===hr?!0:(o(n.get(s)??i(s,Reflect.get(f,s))),Reflect.has(f,s))},set(f,s,c){return b(n.get(s)??i(s,c),c),Reflect.set(f,s,c)}});rr(this,ye,(t.hydrate?eo:zr)(t.component,{target:t.target,anchor:t.anchor,props:a,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((l=t==null?void 0:t.props)!=null&&l.$$host)||t.sync===!1)&&A(),rr(this,Me,a.$$events);for(const f of Object.keys(ve(this,ye)))f==="$set"||f==="$destroy"||f==="$on"||xt(this,f,{get(){return ve(this,ye)[f]},set(s){ve(this,ye)[f]=s},enumerable:!0});ve(this,ye).$set=f=>{Object.assign(a,f)},ve(this,ye).$destroy=()=>{to(ve(this,ye))}}$set(t){ve(this,ye).$set(t)}$on(t,n){ve(this,Me)[t]=ve(this,Me)[t]||[];const i=(...a)=>n.call(this,...a);return ve(this,Me)[t].push(i),()=>{ve(this,Me)[t]=ve(this,Me)[t].filter(a=>a!==i)}}$destroy(){ve(this,ye).$destroy()}}Me=new WeakMap,ye=new WeakMap;let si;typeof HTMLElement=="function"&&(si=class extends HTMLElement{constructor(t,n,i){super();$e(this,"$$ctor");$e(this,"$$s");$e(this,"$$c");$e(this,"$$cn",!1);$e(this,"$$d",{});$e(this,"$$r",!1);$e(this,"$$p_d",{});$e(this,"$$l",{});$e(this,"$$l_u",new Map);$e(this,"$$me");this.$$ctor=t,this.$$s=n,i&&this.attachShadow({mode:"open"})}addEventListener(t,n,i){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(n),this.$$c){const a=this.$$c.$on(t,n);this.$$l_u.set(n,a)}super.addEventListener(t,n,i)}removeEventListener(t,n,i){if(super.removeEventListener(t,n,i),this.$$c){const a=this.$$l_u.get(n);a&&(a(),this.$$l_u.delete(n))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(a){return l=>{const f=document.createElement("slot");a!=="default"&&(f.name=a),B(l,f)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},i=po(this);for(const a of this.$$s)a in i&&(a==="default"&&!this.$$d.children?(this.$$d.children=t(a),n.default=!0):n[a]=t(a));for(const a of this.attributes){const l=this.$$g_p(a.name);l in this.$$d||(this.$$d[l]=bn(l,a.value,this.$$p_d,"toProp"))}for(const a in this.$$p_d)!(a in this.$$d)&&this[a]!==void 0&&(this.$$d[a]=this[a],delete this[a]);this.$$c=_o({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$host:this}}),this.$$me=Nl(()=>{Fn(()=>{var a;this.$$r=!0;for(const l of zt(this.$$c)){if(!((a=this.$$p_d[l])!=null&&a.reflect))continue;this.$$d[l]=this.$$c[l];const f=bn(l,this.$$d[l],this.$$p_d,"toAttribute");f==null?this.removeAttribute(this.$$p_d[l].attribute||l):this.setAttribute(this.$$p_d[l].attribute||l,f)}this.$$r=!1})});for(const a in this.$$l)for(const l of this.$$l[a]){const f=this.$$c.$on(a,l);this.$$l_u.set(l,f)}this.$$l={}}}attributeChangedCallback(t,n,i){var a;this.$$r||(t=this.$$g_p(t),this.$$d[t]=bn(t,i,this.$$p_d,"toProp"),(a=this.$$c)==null||a.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return zt(this.$$p_d).find(n=>this.$$p_d[n].attribute===t||!this.$$p_d[n].attribute&&n.toLowerCase()===t)||t}});function bn(e,t,n,i){var l;const a=(l=n[e])==null?void 0:l.type;if(t=a==="Boolean"&&typeof t!="boolean"?t!=null:t,!i||!n[e])return t;if(i==="toAttribute")switch(a){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(a){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function po(e){const t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0}),t}function bo(e,t,n,i,a,l){let f=class extends si{constructor(){super(e,n,a),this.$$p_d=t}static get observedAttributes(){return zt(t).map(s=>(t[s].attribute||s).toLowerCase())}};return zt(t).forEach(s=>{xt(f.prototype,s,{get(){return this.$$c&&s in this.$$c?this.$$c[s]:this.$$d[s]},set(c){var h;c=bn(s,c,t),this.$$d[s]=c;var d=this.$$c;if(d){var p=(h=ze(d,s))==null?void 0:h.get;p?d[s]=c:d.$set({[s]:c})}}})}),i.forEach(s=>{xt(f.prototype,s,{get(){var c;return(c=this.$$c)==null?void 0:c[s]}})}),e.element=f,f}const ui=new TextEncoder;function yo(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function wo(e,t="SHA-256",n=1e5){const i=Date.now().toString(16);e||(e=Math.round(Math.random()*n));const a=await fi(i,e,t);return{algorithm:t,challenge:a,salt:i,signature:""}}async function fi(e,t,n){if(typeof crypto>"u"||!("subtle"in crypto)||!("digest"in crypto.subtle))throw new Error("Web Crypto is not available. Secure context is required (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).");return yo(await crypto.subtle.digest(n.toUpperCase(),ui.encode(e+t)))}function Eo(e,t,n="SHA-256",i=1e6,a=0){const l=new AbortController,f=Date.now();return{promise:(async()=>{for(let c=a;c<=i;c+=1){if(l.signal.aborted)return null;if(await fi(t,c,n)===e)return{number:c,took:Date.now()-f}}return null})(),controller:l}}function ci(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function Co(e){const t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}function Ao(e,t=12){const n=new Uint8Array(t);for(let i=0;i<t;i++)n[i]=e%256,e=Math.floor(e/256);return n}async function Io(e,t="",n=1e6,i=0){const a="AES-GCM",l=new AbortController,f=Date.now(),s=async()=>{for(let p=i;p<=n;p+=1){if(l.signal.aborted||!c||!d)return null;try{const h=await crypto.subtle.decrypt({name:a,iv:Ao(p)},c,d);if(h)return{clearText:new TextDecoder().decode(h),took:Date.now()-f}}catch{}}return null};let c=null,d=null;try{d=Co(e);const p=await crypto.subtle.digest("SHA-256",ui.encode(t));c=await crypto.subtle.importKey("raw",p,a,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:l}}return{promise:s(),controller:l}}var w=(e=>(e.CODE="code",e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(w||{}),ee=(e=>(e.ERROR="error",e.LOADING="loading",e.PLAYING="playing",e.PAUSED="paused",e.READY="ready",e))(ee||{});globalThis.altchaPlugins=globalThis.altchaPlugins||[],globalThis.altchaI18n=globalThis.altchaI18n||{get:e=>mn(globalThis.altchaI18n.store)[e],set:(e,t)=>{Object.assign(mn(globalThis.altchaI18n.store),{[e]:t}),globalThis.altchaI18n.store.set(mn(globalThis.altchaI18n.store))},store:co({})};const Ro={ariaLinkLabel:"Visit Altcha.org",enterCode:"Enter code",enterCodeAria:"Enter code you hear. Press Space to play audio.",error:"Verification failed. Try again later.",expired:"Verification expired. Try again.",footer:'Protected by <a href="https://altcha.org/" target="_blank" aria-label="Visit Altcha.org">ALTCHA</a>',getAudioChallenge:"Get an audio challenge",label:"I'm not a robot",loading:"Loading...",reload:"Reload",verify:"Verify",verificationRequired:"Verification required!",verified:"Verified",verifying:"Verifying...",waitAlert:"Verifying... please wait."};globalThis.altchaI18n.set("en",Ro);const Wn=(e,t)=>{let n=$l(()=>dl(t==null?void 0:t(),24));var i=So();Se(()=>{T(i,"width",o(n)),T(i,"height",o(n))}),B(e,i)};function ko(e,t){e.code==="Space"&&(e.preventDefault(),e.stopImmediatePropagation(),t())}function $o(e,t){e.preventDefault(),t()}function xo(e,t,n,i,a,l,f,s){var c;[w.UNVERIFIED,w.ERROR,w.EXPIRED,w.CODE].includes(o(t))?n()!==!1&&((c=o(i))==null?void 0:c.reportValidity())===!1?b(a,!1):l()?f():s():b(a,!0)}var So=hn('<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="altcha-spinner"><path 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" fill="currentColor" opacity=".25"></path><path 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" fill="currentColor"></path></svg>'),To=Ae('<input type="hidden">'),No=Ae('<div><a target="_blank" class="altcha-logo" aria-hidden="true"><svg width="22" height="22" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path 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" fill="currentColor"></path><path 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" fill="currentColor"></path><path 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" fill="currentColor"></path></svg></a></div>'),Do=hn('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12.8659 3.00017L22.3922 19.5002C22.6684 19.9785 22.5045 20.5901 22.0262 20.8662C21.8742 20.954 21.7017 21.0002 21.5262 21.0002H2.47363C1.92135 21.0002 1.47363 20.5525 1.47363 20.0002C1.47363 19.8246 1.51984 19.6522 1.60761 19.5002L11.1339 3.00017C11.41 2.52187 12.0216 2.358 12.4999 2.63414C12.6519 2.72191 12.7782 2.84815 12.8659 3.00017ZM10.9999 16.0002V18.0002H12.9999V16.0002H10.9999ZM10.9999 9.00017V14.0002H12.9999V9.00017H10.9999Z"></path></svg>'),Lo=hn('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M15 7C15 6.44772 15.4477 6 16 6C16.5523 6 17 6.44772 17 7V17C17 17.5523 16.5523 18 16 18C15.4477 18 15 17.5523 15 17V7ZM7 7C7 6.44772 7.44772 6 8 6C8.55228 6 9 6.44772 9 7V17C9 17.5523 8.55228 18 8 18C7.44772 18 7 17.5523 7 17V7Z"></path></svg>'),Po=hn('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 12H7C8.10457 12 9 12.8954 9 14V19C9 20.1046 8.10457 21 7 21H4C2.89543 21 2 20.1046 2 19V12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12V19C22 20.1046 21.1046 21 20 21H17C15.8954 21 15 20.1046 15 19V14C15 12.8954 15.8954 12 17 12H20C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12Z"></path></svg>'),Oo=Ae('<button type="button" class="altcha-code-challenge-audio"><!></button>'),Fo=Ae("<audio hidden autoplay><source></audio>"),Vo=Ae('<div class="altcha-code-challenge" role="dialog"><div class="altcha-code-challenge-arrow"></div> <form data-code-challenge-form="1"><img class="altcha-code-challenge-image" alt=""> <input type="text" autocomplete="off" name="code" class="altcha-code-challenge-input" required> <div class="altcha-code-challenge-buttons"><div class="altcha-code-challenge-buttons-left"><!> <button type="button" class="altcha-code-challenge-reload"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2V4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 9.25022 5.38734 6.82447 7.50024 5.38451L7.5 8H9.5V2L3.5 2V4L5.99918 3.99989C3.57075 5.82434 2 8.72873 2 12Z"></path></svg></button></div> <button type="submit" class="altcha-code-challenge-verify"><!> </button></div> <!></form></div>'),Mo=Ae("<div><!></div>"),Uo=Ae("<div><!></div>"),qo=Ae('<div class="altcha-error"><svg width="14" height="14" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path></svg> <!></div>'),jo=Ae('<div class="altcha-footer"><div><!></div></div>'),Bo=Ae('<div class="altcha-anchor-arrow"></div>'),Ho=Ae('<!> <div class="altcha"><div class="altcha-main"><div><!> <input type="checkbox"></div> <label class="altcha-label"><!></label> <!> <!> <!></div> <!> <!> <!></div>',1);function di(e,t){var Xi,zi;Yr(t,!0);const[n,i]=ho(),a=()=>vo(Go,"$altchaI18nStore",n);let l=I(t,"auto",7,void 0),f=I(t,"blockspam",7,void 0),s=I(t,"challengeurl",7,void 0),c=I(t,"challengejson",7,void 0),d=I(t,"credentials",7,void 0),p=I(t,"customfetch",7,void 0),h=I(t,"debug",7,!1),m=I(t,"delay",7,0),y=I(t,"disableautofocus",7,!1),N=I(t,"expire",7,void 0),E=I(t,"floating",7,void 0),j=I(t,"floatinganchor",7,void 0),_e=I(t,"floatingoffset",7,void 0),te=I(t,"floatingpersist",7,!1),ae=I(t,"hidefooter",7,!1),ne=I(t,"hidelogo",7,!1),yt=I(t,"id",7,void 0),H=I(t,"language",7,void 0),ce=I(t,"name",7,"altcha"),Ie=I(t,"maxnumber",7,1e6),Ut=I(t,"mockerror",7,!1),We=I(t,"obfuscated",7,void 0),Re=I(t,"overlay",7,void 0),qt=I(t,"overlaycontent",7,void 0),yn=I(t,"plugins",7,void 0),jt=I(t,"refetchonexpire",7,!0),lt=I(t,"sentinel",7,void 0),Le=I(t,"spamfilter",7,!1),wt=I(t,"strings",7,void 0),we=I(t,"test",7,!1),se=I(t,"verifyurl",7,void 0),Et=I(t,"workers",23,()=>Math.min(16,navigator.hardwareConcurrency||8)),Bt=I(t,"workerurl",7,void 0);const{altchaI18n:Yo}=globalThis,Go=Yo.store,hi=["SHA-256","SHA-384","SHA-512"],Zo="https://altcha.org/",Je=(r,u)=>{t.$$host.dispatchEvent(new CustomEvent(r,{detail:u}))},gi=(zi=(Xi=document.documentElement.lang)==null?void 0:Xi.split("-"))==null?void 0:zi[0],Jn=Nt(()=>{var r;return s()&&new URL(s(),location.origin).host.endsWith(".altcha.org")&&!!((r=s())!=null&&r.includes("apiKey=ckey_"))}),wn=Nt(()=>c()?Si(c()):void 0),Wo=Nt(()=>wt()?Si(wt()):{}),M=Nt(()=>({...bi(a()),...o(Wo)})),_i=Nt(()=>`${yt()||ce()}_checkbox_${Math.round(Math.random()*1e8)}`);let ot=P(null),Ht=P(!1),G=P(null),k=P(je(w.UNVERIFIED)),U=P(void 0),Yt=P(null),Ke=P(null),me=P(null),Kn=P(null),Ct=P(null),O=P(null),Gt=P(null),at=P(null),Pe=null,z=P(null),st=P(!1),Xe=[],Xn=P(!1),Oe=P(null);Pn(()=>{aa(o(at))}),Pn(()=>{sa(o(k))}),fo(()=>{Jo(),b(Gt,null),o(O)&&(o(O).removeEventListener("submit",Ii),o(O).removeEventListener("reset",Ri),o(O).removeEventListener("focusin",Ai),b(O,null)),Pe&&(clearTimeout(Pe),Pe=null),document.removeEventListener("click",Ei),document.removeEventListener("scroll",Ci),window.removeEventListener("resize",xi)}),li(()=>{var r;$("mounted","2.2.2"),$("workers",Et()),Qo(),$("plugins",Xe.length?Xe.map(u=>u.constructor.pluginName).join(", "):"none"),we()&&$("using test mode"),N()&&zn(N()),l()!==void 0&&$("auto",l()),E()!==void 0&&Li(E()),b(O,(r=o(U))==null?void 0:r.closest("form"),!0),o(O)&&(o(O).addEventListener("submit",Ii,{capture:!0}),o(O).addEventListener("reset",Ri),(l()==="onfocus"||te()==="focus")&&o(O).addEventListener("focusin",Ai)),Re()&&Pi(!0),l()==="onload"&&(We()?Zt():Ue()),o(Jn)&&(ae()||ne())&&$("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{Je("load")})});function En(r,u){return btoa(JSON.stringify({algorithm:r.algorithm,challenge:r.challenge,number:u.number,salt:r.salt,signature:r.signature,test:we()?!0:void 0,took:u.took}))}function Jo(){for(const r of Xe)r.destroy()}function mi(){s()&&jt()&&o(k)===w.VERIFIED?Ue():ut(w.EXPIRED,o(M).expired)}async function Ko(){if(Ut())throw $("mocking error"),new Error("Mocked error.");if(o(wn))return $("using provided json data"),Ti(o(wn).salt),o(wn);if(we())return $("generating test challenge",{test:we()}),wo(typeof we()!="boolean"?+we():void 0);{if(!s()&&o(O)){const v=o(O).getAttribute("action");v!=null&&v.includes("/form/")&&s(v+"/altcha")}if(!s())throw new Error("Attribute challengeurl not set.");$("fetching challenge from",s());const r={credentials:typeof d()=="boolean"?"include":d(),headers:Le()!==!1?{"x-altcha-spam-filter":"1"}:{}},u=await pi()(s(),r);if(!u||!(u instanceof Response))throw new Error("Custom fetch function did not return a response.");if(u.status!==200)throw new Error(`Server responded with ${u.status}.`);const g=u.headers.get("X-Altcha-Config"),_=await u.json();if(Ti(_.salt),g)try{const v=JSON.parse(g);v&&typeof v=="object"&&(v.verifyurl&&!v.verifyurl.startsWith("fn:")&&(v.verifyurl=wi(v.verifyurl)),Vi(v))}catch(v){$("unable to configure from X-Altcha-Config",v)}return _}}function Xo(r){var g,_;const u=(g=o(O))==null?void 0:g.querySelector(typeof r=="string"?`input[name="${r}"]`:'input[type="email"]:not([data-no-spamfilter])');return((_=u==null?void 0:u.value)==null?void 0:_.slice(u.value.indexOf("@")))||void 0}function pi(){let r=fetch;if(p())if($("using customfetch"),typeof p()=="string"){if(r=globalThis[p()]||null,!r)throw new Error(`Custom fetch function not found: ${p()}`)}else r=p();return r}function bi(r,u=[H()||"",document.documentElement.lang||"",...navigator.languages]){const g=Object.keys(r).map(v=>v.toLowerCase()),_=u.reduce((v,C)=>(C=C.toLowerCase(),v||(r[C]?C:null)||g.find(R=>C.split("-")[0]===R.split("-")[0])||null),null);return r[_||"en"]}function zo(){return Le()==="ipAddress"?{blockedCountries:void 0,classifier:void 0,disableRules:void 0,email:!1,expectedCountries:void 0,expectedLanguages:void 0,fields:!1,ipAddress:void 0,text:void 0,timeZone:void 0}:typeof Le()=="object"?Le():{blockedCountries:void 0,classifier:void 0,disableRules:void 0,email:void 0,expectedCountries:void 0,expectedLanguages:void 0,fields:void 0,ipAddress:void 0,text:void 0,timeZone:void 0}}function yi(r){var g;return[...((g=o(O))==null?void 0:g.querySelectorAll(r!=null&&r.length?r.map(_=>`input[name="${_}"]`).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'))||[]].reduce((_,v)=>{const C=v.name,R=v.value;return C&&R&&(_[C]=/\n/.test(R)?R.replace(new RegExp("(?<!\\r)\\n","g"),`\r
|
|
3
|
+
`):R),_},{})}function wi(r,u){const g=new URL(s()||location.origin),_=new URL(r,g);if(_.search||(_.search=g.search),u)for(const v in u)u[v]!==void 0&&u[v]!==null&&_.searchParams.set(v,u[v]);return _.toString()}function Qo(){const r=yn()!==void 0?yn().split(","):void 0;for(const u of globalThis.altchaPlugins)(!r||r.includes(u.pluginName))&&Xe.push(new u({el:o(U),clarify:Zt,dispatch:Je,getConfiguration:Mi,getFloatingAnchor:Ui,getState:qi,log:$,reset:ut,solve:Fi,setState:Fe,setFloatingAnchor:ji,verify:Ue}))}function $(...r){(h()||r.some(u=>u instanceof Error))&&console[r[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${ce()}]`,...r)}function ea(){b(z,ee.PAUSED,!0)}function ta(r){b(z,ee.ERROR,!0)}function na(){b(z,ee.READY,!0)}function ra(){b(z,ee.LOADING,!0)}function ia(){b(z,ee.PLAYING,!0)}function la(){b(z,ee.PAUSED,!0)}function oa(r){var u;if(r.preventDefault(),r.stopPropagation(),o(G)){const g=new FormData(r.target),_=String(g.get("code"));if((u=se())!=null&&u.startsWith("fn:")){const v=se().replace(/^fn:/,"");if($(`calling ${v} function instead of verifyurl`),!(v in globalThis))throw new Error(`Global function "${v}" is undefined.`);return globalThis[v]({challenge:o(G).challenge,code:_,solution:o(G).solution})}b(st,!0),Ni(En(o(G).challenge,o(G).solution),_).then(({reason:v,verified:C})=>{C?(b(G,null),Fe(w.VERIFIED),$("verified"),jn().then(()=>{var R;(R=o(Kn))==null||R.focus(),Je("verified",{payload:o(Oe)}),l()==="onsubmit"?Di(o(Gt)):Re()&&Wt()})):(ut(),b(at,v||"Verification failed",!0))}).catch(v=>{b(G,null),Fe(w.ERROR,v),$("sentinel verification failed:",v)}).finally(()=>{b(st,!1)})}}function Ei(r){var g;const u=r.target;E()&&u&&!o(U).contains(u)&&(o(k)===w.VERIFIED&&te()===!1||o(k)===w.VERIFIED&&te()==="focus"&&!((g=o(O))!=null&&g.matches(":focus-within"))||l()==="off"&&o(k)===w.UNVERIFIED)&&Wt()}function Ci(){E()&&o(k)!==w.UNVERIFIED&&Jt()}function aa(r){for(const u of Xe)typeof u.onErrorChange=="function"&&u.onErrorChange(o(at))}function Ai(r){o(k)===w.UNVERIFIED?Ue():E()&&te()==="focus"&&o(k)===w.VERIFIED&&Cn()}function Ii(r){var _;const u=r.target;u!=null&&u.hasAttribute("data-code-challenge-form")||(b(Gt,r.submitter,!0),o(O)&&l()==="onsubmit"?((_=o(Gt))==null||_.blur(),o(k)===w.UNVERIFIED?(r.preventDefault(),r.stopPropagation(),Ue().then(()=>{Di(o(Gt))})):o(k)!==w.VERIFIED&&(r.preventDefault(),r.stopPropagation(),o(k)===w.VERIFYING&&ki())):o(O)&&E()&&l()==="off"&&o(k)===w.UNVERIFIED&&(r.preventDefault(),r.stopPropagation(),Cn()))}function Ri(){ut()}function ki(){o(k)===w.VERIFYING&&o(M).waitAlert&&alert(o(M).waitAlert)}function $i(){o(Ke)?o(Ke).paused?(o(Ke).currentTime=0,o(Ke).play()):o(Ke).pause():(b(Xn,!0),requestAnimationFrame(()=>{var r;(r=o(Ke))==null||r.play()}))}function sa(r){for(const u of Xe)typeof u.onStateChange=="function"&&u.onStateChange(o(k));E()&&o(k)!==w.UNVERIFIED&&requestAnimationFrame(()=>{Jt()}),b(Ht,o(k)===w.VERIFIED),Re()&&o(me)&&(o(k)!==w.UNVERIFIED?Cn():Wt())}function xi(){E()&&Jt()}function Si(r){return JSON.parse(r)}function Ti(r){var _;const u=new URLSearchParams((_=r.split("?"))==null?void 0:_[1]),g=u.get("expires")||u.get("expire");if(g){const v=new Date(+g*1e3),C=isNaN(v.getTime())?0:v.getTime()-Date.now();C>0&&zn(C)}else Pe&&(clearTimeout(Pe),Pe=null)}async function ua(r){if(!se())throw new Error("Attribute verifyurl not set.");$("requesting server verification from",se());const u={payload:r};if(Le()!==!1){const{blockedCountries:v,classifier:C,disableRules:R,email:Y,expectedLanguages:q,expectedCountries:re,fields:de,ipAddress:ct,text:It,timeZone:dt}=zo();u.blockedCountries=v,u.classifier=C,u.disableRules=R,u.email=Y===!1?void 0:Xo(Y),u.expectedCountries=re,u.expectedLanguages=q||(gi?[gi]:void 0),u.fields=de===!1?void 0:yi(de),u.ipAddress=ct===!1?void 0:ct||"auto",u.text=It,u.timeZone=dt===!1?void 0:dt||ci()}const g=await pi()(se(),{body:JSON.stringify(u),headers:{"content-type":"application/json"},method:"POST"});if(!g||!(g instanceof Response))throw new Error("Custom fetch function did not return a response.");if(g.status!==200)throw new Error(`Server responded with ${g.status}.`);const _=await g.json();if(_!=null&&_.payload&&b(Oe,_.payload,!0),Je("serververification",_),f()&&_.classification==="BAD")throw new Error("SpamFilter returned negative classification.")}async function Ni(r,u){if(!se())throw new Error("Attribute verifyurl not set.");$("requesting sentinel verification from",se());const g={code:u,payload:r};lt()&&(g.fields=lt().fields?yi():void 0,g.timeZone=lt().timeZone?ci():void 0);const _=await fetch(se(),{body:JSON.stringify(g),headers:{"content-type":"application/json"},method:"POST"});if(!_||!(_ instanceof Response))throw new Error("Fetch function did not return a response.");if(_.status!==200)throw new Error(`Server responded with ${_.status}.`);const v=await _.json();return v!=null&&v.payload&&b(Oe,v.payload,!0),Je("sentinelverification",v),v}function Di(r){var u;o(O)&&"requestSubmit"in o(O)?o(O).requestSubmit(r):(u=o(O))!=null&&u.reportValidity()&&(r?r.click():o(O).submit())}function zn(r){$("expire",r),Pe&&(clearTimeout(Pe),Pe=null),r<1?mi():Pe=setTimeout(mi,r)}function Li(r){$("floating",r),E()!==r&&(o(U).style.left="",o(U).style.top=""),E(r===!0||r===""?"auto":r===!1||r==="false"?void 0:E()),E()?(l()||l("onsubmit"),document.addEventListener("scroll",Ci),document.addEventListener("click",Ei),window.addEventListener("resize",xi)):l()==="onsubmit"&&l(void 0)}function Pi(r){var u,g;if($("overlay",r),Re(r),r){if(l()||l("onsubmit"),o(me)&&o(U).parentElement&&o(me).replaceWith(o(U).parentElement),(g=(u=o(U))==null?void 0:u.parentElement)!=null&&g.parentElement){b(me,document.createElement("div"),!0),o(U).parentElement.parentElement.appendChild(o(me));const _=document.createElement("div"),v=document.createElement("button");v.type="button",v.innerHTML="×",v.addEventListener("click",C=>{C.preventDefault(),ut()}),o(me).classList.add("altcha-overlay-backdrop"),v.classList.add("altcha-overlay-close-button"),_.classList.add("altcha-overlay"),o(me).append(_),_.append(v),qt()&&_.append(...document.querySelectorAll(qt())),_.append(o(U).parentElement)}}else o(me)&&o(U).parentElement&&(o(me).replaceWith(o(U).parentElement),o(U).style.display="block")}function Oi(r){if(!r.algorithm)throw new Error("Invalid challenge. Property algorithm is missing.");if(r.signature===void 0)throw new Error("Invalid challenge. Property signature is missing.");if(!hi.includes(r.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${hi.join(", ")}`);if(!r.challenge||r.challenge.length<40)throw new Error("Challenge is too short. Min. 40 chars.");if(!r.salt||r.salt.length<10)throw new Error("Salt is too short. Min. 10 chars.")}async function Fi(r){let u=null,g=null;if("Worker"in window){try{u=fa(r,r.maxNumber||r.maxnumber||Ie()),b(ot,u.controller,!0),g=await u.promise}catch(_){$(_)}finally{b(ot,null)}if(g===null||(g==null?void 0:g.number)!==void 0||"obfuscated"in r)return{data:r,solution:g}}if("obfuscated"in r){const _=await Io(r.obfuscated,r.key,r.maxNumber||r.maxnumber);return{data:r,solution:await _.promise}}u=Eo(r.challenge,r.salt,r.algorithm,r.maxNumber||r.maxnumber||Ie()),b(ot,u.controller,!0);try{g=await u.promise}catch(_){$(_)}finally{b(ot,null)}return{data:r,solution:g}}function fa(r,u=typeof we()=="number"?we():r.maxNumber||r.maxnumber||Ie(),g=Math.ceil(Et())){const _=new AbortController,v=[];g=Math.min(16,u,Math.max(1,g));for(let Y=0;Y<g;Y++)v.push(altchaCreateWorker(Bt()));const C=Math.ceil(u/g);return{promise:(async()=>{const Y=await Promise.all(v.map((q,re)=>{const de=re*C;return _.signal.addEventListener("abort",()=>{q.postMessage({type:"abort"})}),new Promise(ct=>{q.addEventListener("message",It=>{if(It.data)for(const dt of v)dt!==q&&dt.postMessage({type:"abort"});ct(It.data)}),q.postMessage({payload:r,max:de+C,start:de,type:"work"})})}));for(const q of v)q.terminate();return Y.find(q=>!!q)||null})(),controller:_}}async function Zt(){if(!We()){Fe(w.ERROR);return}const r=Xe.find(u=>u.constructor.pluginName==="obfuscation");if(!r||!("clarify"in r)){Fe(w.ERROR),$("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");return}if("clarify"in r&&typeof r.clarify=="function")return r.clarify()}function Vi(r){r.obfuscated!==void 0&&We(r.obfuscated),r.auto!==void 0&&(l(r.auto),l()==="onload"&&(We()?Zt():Ue())),r.blockspam!==void 0&&f(!!r.blockspam),r.customfetch!==void 0&&p(r.customfetch),r.floatinganchor!==void 0&&j(r.floatinganchor),r.delay!==void 0&&m(r.delay),r.floatingoffset!==void 0&&_e(r.floatingoffset),r.floating!==void 0&&Li(r.floating),r.expire!==void 0&&(zn(r.expire),N(r.expire)),r.challenge&&(c(typeof r.challenge=="string"?r.challenge:JSON.stringify(r.challenge)),Oi(o(wn))),r.challengeurl!==void 0&&s(r.challengeurl),r.debug!==void 0&&h(!!r.debug),r.hidefooter!==void 0&&ae(!!r.hidefooter),r.hidelogo!==void 0&&ne(!!r.hidelogo),r.language!==void 0&&wt(bi(a(),[r.language])),r.maxnumber!==void 0&&Ie(+r.maxnumber),r.mockerror!==void 0&&Ut(!!r.mockerror),r.name!==void 0&&ce(r.name),r.overlaycontent!==void 0&&qt(r.overlaycontent),r.overlay!==void 0&&Pi(r.overlay),r.refetchonexpire!==void 0&&jt(!!r.refetchonexpire),r.sentinel!==void 0&&typeof r.sentinel=="object"&<(r.sentinel),r.spamfilter!==void 0&&Le(typeof r.spamfilter=="object"?r.spamfilter:!!r.spamfilter),r.strings&&wt(typeof r.strings=="string"?r.strings:JSON.stringify(r.strings)),r.test!==void 0&&we(typeof r.test=="number"?r.test:!!r.test),r.verifyurl!==void 0&&se(r.verifyurl),r.workers!==void 0&&Et(+r.workers),r.workerurl!==void 0&&Bt(r.workerurl)}function Mi(){return{auto:l(),blockspam:f(),challengeurl:s(),debug:h(),delay:m(),expire:N(),floating:E(),floatinganchor:j(),floatingoffset:_e(),hidefooter:ae(),hidelogo:ne(),name:ce(),maxnumber:Ie(),mockerror:Ut(),obfuscated:We(),overlay:Re(),refetchonexpire:jt(),spamfilter:Le(),strings:o(M),test:we(),verifyurl:se(),workers:Et(),workerurl:Bt()}}function Ui(){return o(Ct)}function ca(r){return Xe.find(u=>u.constructor.pluginName===r)}function qi(){return o(k)}function Wt(){o(U).style.display="none",Re()&&o(me)&&(o(me).style.display="none")}function Jt(r=20){var u;if(o(U))if(o(Ct)||b(Ct,(j()?document.querySelector(j()):(u=o(O))==null?void 0:u.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||o(O),!0),o(Ct)){const g=parseInt(_e(),10)||12,_=o(Ct).getBoundingClientRect(),v=o(U).getBoundingClientRect(),C=document.documentElement.clientHeight,R=document.documentElement.clientWidth,Y=E()==="auto"?_.bottom+v.height+g+r>C:E()==="top",q=Math.max(r,Math.min(R-r-v.width,_.left+_.width/2-v.width/2));if(Y?o(U).style.top=`${_.top-(v.height+g)}px`:o(U).style.top=`${_.bottom+g}px`,o(U).style.left=`${q}px`,o(U).setAttribute("data-floating",Y?"top":"bottom"),o(Yt)){const re=o(Yt).getBoundingClientRect();o(Yt).style.left=_.left-q+_.width/2-re.width/2+"px"}}else $("unable to find floating anchor element")}function ut(r=w.UNVERIFIED,u=null){o(ot)&&(o(ot).abort(),b(ot,null)),b(Ht,!1),b(Oe,null),b(G,null),b(Xn,!1),b(z,null),Fe(r,u)}function ji(r){b(Ct,r,!0)}function Fe(r,u=null){b(k,r,!0),b(at,u,!0),Je("statechange",{payload:o(Oe),state:o(k)})}function Cn(){o(U).style.display="block",E()&&Jt(),Re()&&o(me)&&(o(me).style.display="flex")}async function Ue(){return ut(w.VERIFYING),await new Promise(r=>setTimeout(r,m()||0)),Ko().then(r=>(Oi(r),$("challenge",r),Fi(r))).then(({data:r,solution:u})=>{var g;if($("solution",u),!u||r&&"challenge"in r&&!("clearText"in u)){if((u==null?void 0:u.number)!==void 0&&"challenge"in r)if(se()&&"codeChallenge"in r)["INPUT","BUTTON","SELECT","TEXTAREA"].includes(((g=document.activeElement)==null?void 0:g.tagName)||"")&&y()===!1&&document.activeElement.blur(),b(G,{challenge:r,solution:u},!0);else{if(se()&<()!==void 0)return Ni(En(r,u));if(se())return ua(En(r,u));b(Oe,En(r,u),!0),$("payload",o(Oe))}else if(o(k)!==w.EXPIRED)throw $("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."),new Error("Unexpected result returned.")}}).then(()=>{o(G)?(Fe(w.CODE),jn().then(()=>{Je("code",{codeChallenge:o(G)})})):o(Oe)&&(Fe(w.VERIFIED),$("verified"),jn().then(()=>{Je("verified",{payload:o(Oe)}),Re()&&Wt()}))}).catch(r=>{$(r),Fe(w.ERROR,r.message)})}var Bi=Ho(),Hi=Tt(Bi);no(Hi,t,"default",{});var At=K(Hi,2),Qn=J(At),An=J(Qn);let Yi;var Gi=J(An);{var da=r=>{Wn(r)};X(Gi,r=>{o(k)===w.VERIFYING&&r(da)})}var ft=K(Gi,2);ti(ft),ft.__change=[xo,k,Le,O,Ht,We,Zt,Ue],_n(ft,r=>b(Kn,r),()=>o(Kn)),W(An);var In=K(An,2),va=J(In);{var ha=r=>{var u=gn(),g=Tt(u);it(g,()=>o(M).verified),B(r,u)},ga=(r,u)=>{{var g=v=>{var C=gn(),R=Tt(C);it(R,()=>o(M).verifying),B(v,C)},_=(v,C)=>{{var R=q=>{var re=gn(),de=Tt(re);it(de,()=>o(M).verificationRequired),B(q,re)},Y=q=>{var re=gn(),de=Tt(re);it(de,()=>o(M).label),B(q,re)};X(v,q=>{o(k)===w.CODE?q(R):q(Y,!1)},C)}};X(r,v=>{o(k)===w.VERIFYING?v(g):v(_,!1)},u)}};X(va,r=>{o(k)===w.VERIFIED?r(ha):r(ga,!1)})}W(In);var Zi=K(In,2);{var _a=r=>{var u=To();ti(u),Se(()=>{T(u,"name",ce()),ao(u,o(Oe))}),B(r,u)};X(Zi,r=>{o(k)===w.VERIFIED&&r(_a)})}var Wi=K(Zi,2);{var ma=r=>{var u=No(),g=J(u);T(g,"href",Zo),W(u),Se(()=>T(g,"aria-label",o(M).ariaLinkLabel)),B(r,u)};X(Wi,r=>{(ne()!==!0||o(Jn))&&r(ma)})}var pa=K(Wi,2);{var ba=r=>{var u=Vo(),g=K(J(u),2),_=J(g),v=K(_,2);Jl(v,!y()),v.__keydown=[ko,$i];var C=K(v,2),R=J(C),Y=J(R);{var q=ke=>{var Q=Oo();Q.__click=$i;var Rn=J(Q);{var Kt=Rt=>{Wn(Rt,()=>20)},ka=(Rt,$a)=>{{var xa=kt=>{var er=Do();B(kt,er)},Sa=(kt,er)=>{{var Ta=$t=>{var tr=Lo();B($t,tr)},Na=$t=>{var tr=Po();B($t,tr)};X(kt,$t=>{o(z)===ee.PLAYING?$t(Ta):$t(Na,!1)},er)}};X(Rt,kt=>{o(z)===ee.ERROR?kt(xa):kt(Sa,!1)},$a)}};X(Rn,Rt=>{o(z)===ee.LOADING?Rt(Kt):Rt(ka,!1)})}W(Q),Se(()=>{T(Q,"title",o(M).getAudioChallenge),Q.disabled=o(z)===ee.LOADING||o(z)===ee.ERROR||o(st),T(Q,"aria-label",o(z)===ee.LOADING?o(M).loading:o(M).getAudioChallenge)}),B(ke,Q)};X(Y,ke=>{o(G).challenge.codeChallenge.audio&&ke(q)})}var re=K(Y,2);re.__click=[$o,Ue],W(R);var de=K(R,2),ct=J(de);{var It=ke=>{Wn(ke,()=>16)};X(ct,ke=>{o(st)&&ke(It)})}var dt=K(ct);W(de),W(C);var Ia=K(C,2);{var Ra=ke=>{var Q=Fo(),Rn=J(Q);W(Q),_n(Q,Kt=>b(Ke,Kt),()=>o(Ke)),Se(Kt=>T(Rn,"src",Kt),[()=>wi(o(G).challenge.codeChallenge.audio,{language:H()})]),Ze("loadstart",Q,ra),Ze("canplay",Q,na),Ze("pause",Q,la),Ze("playing",Q,ia),Ze("ended",Q,ea),Ze("error",Rn,ta),B(ke,Q)};X(Ia,ke=>{o(G).challenge.codeChallenge.audio&&o(Xn)&&ke(Ra)})}W(g),W(u),Se(()=>{T(u,"aria-label",o(M).verificationRequired),T(_,"src",o(G).challenge.codeChallenge.image),T(v,"minlength",o(G).challenge.codeChallenge.length||1),T(v,"maxlength",o(G).challenge.codeChallenge.length),T(v,"placeholder",o(M).enterCode),T(v,"aria-label",o(z)===ee.LOADING?o(M).loading:o(z)===ee.PLAYING?"":o(M).enterCodeAria),T(v,"aria-live",o(z)?"assertive":"polite"),T(v,"aria-busy",o(z)===ee.LOADING),v.disabled=o(st),T(re,"aria-label",o(M).reload),T(re,"title",o(M).reload),re.disabled=o(st),de.disabled=o(st),T(de,"aria-label",o(M).verify),Ql(dt,` ${o(M).verify??""}`)}),Ze("submit",g,oa,!0),B(r,u)};X(pa,r=>{var u;(u=o(G))!=null&&u.challenge.codeChallenge&&r(ba)})}W(Qn);var Ji=K(Qn,2);{var ya=r=>{var u=qo(),g=K(J(u),2);{var _=C=>{var R=Mo(),Y=J(R);it(Y,()=>o(M).expired),W(R),Se(()=>T(R,"title",o(at))),B(C,R)},v=C=>{var R=Uo(),Y=J(R);it(Y,()=>o(M).error),W(R),Se(()=>T(R,"title",o(at))),B(C,R)};X(g,C=>{o(k)===w.EXPIRED?C(_):C(v,!1)})}W(u),B(r,u)};X(Ji,r=>{(o(at)||o(k)===w.EXPIRED)&&r(ya)})}var Ki=K(Ji,2);{var wa=r=>{var u=jo(),g=J(u),_=J(g);it(_,()=>o(M).footer),W(g),W(u),B(r,u)};X(Ki,r=>{o(M).footer&&(ae()!==!0||o(Jn))&&r(wa)})}var Ea=K(Ki,2);{var Ca=r=>{var u=Bo();_n(u,g=>b(Yt,g),()=>o(Yt)),B(r,u)};X(Ea,r=>{E()&&r(Ca)})}W(At),_n(At,r=>b(U,r),()=>o(U)),Se(r=>{T(At,"data-state",o(k)),T(At,"data-floating",E()),T(At,"data-overlay",Re()),Yi=io(An,1,"altcha-checkbox",null,Yi,r),T(ft,"id",o(_i)),ft.required=l()!=="onsubmit"&&(!E()||l()!=="off"),T(In,"for",o(_i))},[()=>({"altcha-checkbox-verifying":o(k)===w.VERIFYING})]),Ze("invalid",ft,ki),uo(ft,()=>o(Ht),r=>b(Ht,r)),B(e,Bi);var Aa=Gr({clarify:Zt,configure:Vi,getConfiguration:Mi,getFloatingAnchor:Ui,getPlugin:ca,getState:qi,hide:Wt,repositionFloating:Jt,reset:ut,setFloatingAnchor:ji,setState:Fe,show:Cn,verify:Ue,get auto(){return l()},set auto(r=void 0){l(r),A()},get blockspam(){return f()},set blockspam(r=void 0){f(r),A()},get challengeurl(){return s()},set challengeurl(r=void 0){s(r),A()},get challengejson(){return c()},set challengejson(r=void 0){c(r),A()},get credentials(){return d()},set credentials(r=void 0){d(r),A()},get customfetch(){return p()},set customfetch(r=void 0){p(r),A()},get debug(){return h()},set debug(r=!1){h(r),A()},get delay(){return m()},set delay(r=0){m(r),A()},get disableautofocus(){return y()},set disableautofocus(r=!1){y(r),A()},get expire(){return N()},set expire(r=void 0){N(r),A()},get floating(){return E()},set floating(r=void 0){E(r),A()},get floatinganchor(){return j()},set floatinganchor(r=void 0){j(r),A()},get floatingoffset(){return _e()},set floatingoffset(r=void 0){_e(r),A()},get floatingpersist(){return te()},set floatingpersist(r=!1){te(r),A()},get hidefooter(){return ae()},set hidefooter(r=!1){ae(r),A()},get hidelogo(){return ne()},set hidelogo(r=!1){ne(r),A()},get id(){return yt()},set id(r=void 0){yt(r),A()},get language(){return H()},set language(r=void 0){H(r),A()},get name(){return ce()},set name(r="altcha"){ce(r),A()},get maxnumber(){return Ie()},set maxnumber(r=1e6){Ie(r),A()},get mockerror(){return Ut()},set mockerror(r=!1){Ut(r),A()},get obfuscated(){return We()},set obfuscated(r=void 0){We(r),A()},get overlay(){return Re()},set overlay(r=void 0){Re(r),A()},get overlaycontent(){return qt()},set overlaycontent(r=void 0){qt(r),A()},get plugins(){return yn()},set plugins(r=void 0){yn(r),A()},get refetchonexpire(){return jt()},set refetchonexpire(r=!0){jt(r),A()},get sentinel(){return lt()},set sentinel(r=void 0){lt(r),A()},get spamfilter(){return Le()},set spamfilter(r=!1){Le(r),A()},get strings(){return wt()},set strings(r=void 0){wt(r),A()},get test(){return we()},set test(r=!1){we(r),A()},get verifyurl(){return se()},set verifyurl(r=void 0){se(r),A()},get workers(){return Et()},set workers(r=Math.min(16,navigator.hardwareConcurrency||8)){Et(r),A()},get workerurl(){return Bt()},set workerurl(r=void 0){Bt(r),A()}});return i(),Aa}zl(["change","keydown","click"]),customElements.define("altcha-widget",bo(di,{blockspam:{type:"Boolean"},debug:{type:"Boolean"},delay:{type:"Number"},disableautofocus:{type:"Boolean"},expire:{type:"Number"},floatingoffset:{type:"Number"},hidefooter:{type:"Boolean"},hidelogo:{type:"Boolean"},maxnumber:{type:"Number"},mockerror:{type:"Boolean"},refetchonexpire:{type:"Boolean"},test:{type:"Boolean"},workers:{type:"Number"},auto:{},challengeurl:{},challengejson:{},credentials:{},customfetch:{},floating:{},floatinganchor:{},floatingpersist:{},id:{},language:{},name:{},obfuscated:{},overlay:{},overlaycontent:{},plugins:{},sentinel:{},spamfilter:{},strings:{},verifyurl:{},workerurl:{}},["default"],["clarify","configure","getConfiguration","getFloatingAnchor","getPlugin","getState","hide","repositionFloating","reset","setFloatingAnchor","setState","show","verify"],!1)),globalThis.altchaCreateWorker=e=>new Worker(new URL(e||"./worker.js",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:S&&S.tagName.toUpperCase()==="SCRIPT"&&S.src||new URL("altcha.umd.cjs",document.baseURI).href)),x.Altcha=di,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "altcha",
|
|
3
3
|
"description": "Privacy-first CAPTCHA widget, compliant with global regulations (GDPR/HIPAA/CCPA/LGDP/DPDPA/PIPL) and WCAG accessible. No tracking, self-verifying.",
|
|
4
|
-
"version": "2.2.
|
|
4
|
+
"version": "2.2.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Daniel Regeci",
|