altcha 2.2.2 → 2.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,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)),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&gt)===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&gt)!==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&gt)===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="&times;",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"&&lt(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()&&lt()!==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"})});
1
+ (function(ut,He){typeof exports=="object"&&typeof module<"u"?He(exports):typeof define=="function"&&define.amd?define(["exports"],He):(ut=typeof globalThis<"u"?globalThis:ut||self,He(ut.altcha={}))})(this,function(ut){"use strict";var He=typeof document<"u"?document.currentScript:null;const Bi="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(Bi);const Hi=1,Yi=4,Gi=8,Zi=16,Wi=1,Ji=2,En="[",zn="[!",Qn="]",ft={},ie=Symbol(),Ki="http://www.w3.org/1999/xhtml",er=!1;function tr(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}var nr=Array.isArray,Xi=Array.prototype.indexOf,zi=Array.from,Gt=Object.keys,It=Object.defineProperty,Ye=Object.getOwnPropertyDescriptor,Qi=Object.getOwnPropertyDescriptors,el=Object.prototype,tl=Array.prototype,rr=Object.getPrototypeOf,ir=Object.isExtensible;const ct=()=>{};function lr(e){for(var t=0;t<e.length;t++)e[t]()}function nl(e,t,n=!1){return e===void 0?n?t():t:e}const ge=2,or=4,Zt=8,Cn=16,ke=32,Ge=64,Wt=128,se=256,Jt=512,le=1024,ye=2048,Ze=4096,dt=8192,Kt=16384,rl=32768,An=65536,il=1<<19,ar=1<<20,In=1<<21,xt=Symbol("$state"),sr=Symbol("legacy props"),ll=Symbol("");function ol(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function al(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function sl(e){throw new Error("https://svelte.dev/e/effect_orphan")}function ul(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function fl(){throw new Error("https://svelte.dev/e/hydration_failed")}function cl(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function dl(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function vl(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function hl(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Xt(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let L=!1;function vt(e){L=e}let P;function De(e){if(e===null)throw Xt(),ft;return P=e}function ht(){return De(Pe(P))}function G(e){if(L){if(Pe(P)!==null)throw Xt(),ft;P=e}}function gl(){for(var e=0,t=P;;){if(t.nodeType===8){var n=t.data;if(n===Qn){if(e===0)return t;e-=1}else(n===En||n===zn)&&(e+=1)}var i=Pe(t);t.remove(),t=i}}let _l=!1;function Le(e){if(typeof e!="object"||e===null||xt in e)return e;const t=rr(e);if(t!==el&&t!==tl)return e;var n=new Map,i=nr(e),a=T(0),o=k,s=f=>{var c=k;Ce(o);var d=f();return Ce(c),d};return i&&n.set("length",T(e.length)),new Proxy(e,{defineProperty(f,c,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&dl();var m=n.get(c);return m===void 0?(m=s(()=>T(d.value)),n.set(c,m)):b(m,s(()=>Le(d.value))),!0},deleteProperty(f,c){var d=n.get(c);if(d===void 0)c in f&&(n.set(c,s(()=>T(ie))),xn(a));else{if(i&&typeof c=="string"){var m=n.get("length"),h=Number(c);Number.isInteger(h)&&h<m.v&&b(m,h)}b(d,ie),xn(a)}return!0},get(f,c,d){if(c===xt)return e;var m=n.get(c),h=c in f;if(m===void 0&&(!h||Ye(f,c)?.writable)&&(m=s(()=>T(Le(h?f[c]:ie))),n.set(c,m)),m!==void 0){var p=l(m);return p===ie?void 0:p}return Reflect.get(f,c,d)},getOwnPropertyDescriptor(f,c){var d=Reflect.getOwnPropertyDescriptor(f,c);if(d&&"value"in d){var m=n.get(c);m&&(d.value=l(m))}else if(d===void 0){var h=n.get(c),p=h?.v;if(h!==void 0&&p!==ie)return{enumerable:!0,configurable:!0,value:p,writable:!0}}return d},has(f,c){if(c===xt)return!0;var d=n.get(c),m=d!==void 0&&d.v!==ie||Reflect.has(f,c);if(d!==void 0||S!==null&&(!m||Ye(f,c)?.writable)){d===void 0&&(d=s(()=>T(m?Le(f[c]):ie)),n.set(c,d));var h=l(d);if(h===ie)return!1}return m},set(f,c,d,m){var h=n.get(c),p=c in f;if(i&&c==="length")for(var w=d;w<h.v;w+=1){var F=n.get(w+"");F!==void 0?b(F,ie):w in f&&(F=s(()=>T(ie)),n.set(w+"",F))}h===void 0?(!p||Ye(f,c)?.writable)&&(h=s(()=>T(void 0)),b(h,s(()=>Le(d))),n.set(c,h)):(p=h.v!==ie,b(h,s(()=>Le(d))));var V=Reflect.getOwnPropertyDescriptor(f,c);if(V?.set&&V.set.call(m,d),!p){if(i&&typeof c=="string"){var U=n.get("length"),R=Number(c);Number.isInteger(R)&&R>=U.v&&b(U,R+1)}xn(a)}return!0},ownKeys(f){l(a);var c=Reflect.ownKeys(f).filter(h=>{var p=n.get(h);return p===void 0||p.v!==ie});for(var[d,m]of n)m.v!==ie&&!(d in f)&&c.push(d);return c},setPrototypeOf(){vl()}})}function xn(e,t=1){b(e,e.v+t)}var ur,fr,cr,dr;function Rn(){if(ur===void 0){ur=window,fr=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;cr=Ye(t,"firstChild").get,dr=Ye(t,"nextSibling").get,ir(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),ir(n)&&(n.__t=void 0)}}function zt(e=""){return document.createTextNode(e)}function de(e){return cr.call(e)}function Pe(e){return dr.call(e)}function Z(e,t){if(!L)return de(e);var n=de(P);return n===null&&(n=P.appendChild(zt())),De(n),n}function Rt(e,t){if(!L){var n=de(e);return n instanceof Comment&&n.data===""?Pe(n):n}return P}function W(e,t=1,n=!1){let i=L?P:e;for(var a;t--;)a=i,i=Pe(i);if(!L)return i;var o=i?.nodeType;if(n&&o!==3){var s=zt();return i===null?a?.after(s):i.before(s),De(s),s}return De(i),i}function ml(e){e.textContent=""}function vr(e){return e===this.v}function hr(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function $n(e){return!hr(e,this.v)}function Qt(e){var t=ge|ye,n=k!==null&&(k.f&ge)!==0?k:null;return S===null||n!==null&&(n.f&se)!==0?t|=se:S.f|=ar,{ctx:te,deps:null,effects:null,equals:vr,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:n??S}}function $t(e){const t=Qt(e);return kr(t),t}function pl(e){const t=Qt(e);return t.equals=$n,t}function gr(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)Oe(t[n])}}function bl(e){for(var t=e.parent;t!==null;){if((t.f&ge)===0)return t;t=t.parent}return null}function _r(e){var t,n=S;Fe(bl(e));try{gr(e),t=Lr(e)}finally{Fe(n)}return t}function mr(e){var t=_r(e),n=(Ve||(e.f&se)!==0)&&e.deps!==null?Ze:le;_e(e,n),e.equals(t)||(e.v=t,e.wv=Tr())}function yl(e){S===null&&k===null&&sl(),k!==null&&(k.f&se)!==0&&S===null&&al(),Tt&&ol()}function wl(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function We(e,t,n,i=!0){var a=S,o={ctx:te,deps:null,nodes_start:null,nodes_end:null,f:e|ye,first:null,fn:t,last:null,next:null,parent:a,prev:null,teardown:null,transitions:null,wv:0};if(n)try{On(o),o.f|=rl}catch(c){throw Oe(o),c}else t!==null&&an(o);var s=n&&o.deps===null&&o.first===null&&o.nodes_start===null&&o.teardown===null&&(o.f&(ar|Wt))===0;if(!s&&i&&(a!==null&&wl(o,a),k!==null&&(k.f&ge)!==0)){var f=k;(f.effects??=[]).push(o)}return o}function kn(e){const t=We(Zt,null,!1);return _e(t,le),t.teardown=e,t}function Sn(e){yl();var t=S!==null&&(S.f&ke)!==0&&te!==null&&!te.m;if(t){var n=te;(n.e??=[]).push({fn:e,effect:S,reaction:k})}else{var i=Tn(e);return i}}function El(e){const t=We(Ge,e,!0);return()=>{Oe(t)}}function Cl(e){const t=We(Ge,e,!0);return(n={})=>new Promise(i=>{n.outro?Ln(t,()=>{Oe(t),i(void 0)}):(Oe(t),i(void 0))})}function Tn(e){return We(or,e,!1)}function Nn(e){return We(Zt,e,!0)}function we(e,t=[],n=Qt){const i=t.map(n);return pr(()=>e(...i.map(l)))}function pr(e,t=0){return We(Zt|Cn|t,e,!0)}function Dn(e,t=!0){return We(Zt|ke,e,!0,t)}function br(e){var t=e.teardown;if(t!==null){const n=Tt,i=k;$r(!0),Ce(null);try{t.call(null)}finally{$r(n),Ce(i)}}}function yr(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){var i=n.next;(n.f&Ge)!==0?n.parent=null:Oe(n,t),n=i}}function Al(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&ke)===0&&Oe(t),t=n}}function Oe(e,t=!0){var n=!1;(t||(e.f&il)!==0)&&e.nodes_start!==null&&(wr(e.nodes_start,e.nodes_end),n=!0),yr(e,t&&!n),on(e,0),_e(e,Kt);var i=e.transitions;if(i!==null)for(const o of i)o.stop();br(e);var a=e.parent;a!==null&&a.first!==null&&Er(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function wr(e,t){for(;e!==null;){var n=e===t?null:Pe(e);e.remove(),e=n}}function Er(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 Ln(e,t){var n=[];Cr(e,n,!0),Il(n,()=>{Oe(e),t&&t()})}function Il(e,t){var n=e.length;if(n>0){var i=()=>--n||t();for(var a of e)a.out(i)}else t()}function Cr(e,t,n){if((e.f&dt)===0){if(e.f^=dt,e.transitions!==null)for(const s of e.transitions)(s.is_global||n)&&t.push(s);for(var i=e.first;i!==null;){var a=i.next,o=(i.f&An)!==0||(i.f&ke)!==0;Cr(i,t,o?n:!1),i=a}}}function Ar(e){Ir(e,!0)}function Ir(e,t){if((e.f&dt)!==0){e.f^=dt,(e.f&le)===0&&(e.f^=le),Dt(e)&&(_e(e,ye),an(e));for(var n=e.first;n!==null;){var i=n.next,a=(n.f&An)!==0||(n.f&ke)!==0;Ir(n,a?t:!1),n=i}if(e.transitions!==null)for(const o of e.transitions)(o.is_global||t)&&o.in()}}const xl=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let kt=[],St=[];function xr(){var e=kt;kt=[],lr(e)}function Rr(){var e=St;St=[],lr(e)}function Pn(e){kt.length===0&&queueMicrotask(xr),kt.push(e)}function Rl(e){St.length===0&&xl(Rr),St.push(e)}function $l(){kt.length>0&&xr(),St.length>0&&Rr()}let en=!1,tn=!1,nn=null,Je=!1,Tt=!1;function $r(e){Tt=e}let Nt=[],Ca=[],k=null,Ee=!1;function Ce(e){k=e}let S=null;function Fe(e){S=e}let Se=null;function kr(e){k!==null&&k.f&In&&(Se===null?Se=[e]:Se.push(e))}let ee=null,ue=0,ve=null;function kl(e){ve=e}let Sr=1,rn=0,Ve=!1;function Tr(){return++Sr}function Dt(e){var t=e.f;if((t&ye)!==0)return!0;if((t&Ze)!==0){var n=e.deps,i=(t&se)!==0;if(n!==null){var a,o,s=(t&Jt)!==0,f=i&&S!==null&&!Ve,c=n.length;if(s||f){var d=e,m=d.parent;for(a=0;a<c;a++)o=n[a],(s||!o?.reactions?.includes(d))&&(o.reactions??=[]).push(d);s&&(d.f^=Jt),f&&m!==null&&(m.f&se)===0&&(d.f^=se)}for(a=0;a<c;a++)if(o=n[a],Dt(o)&&mr(o),o.wv>e.wv)return!0}(!i||S!==null&&!Ve)&&_e(e,le)}return!1}function Sl(e,t){for(var n=t;n!==null;){if((n.f&Wt)!==0)try{n.fn(e);return}catch{n.f^=Wt}n=n.parent}throw en=!1,e}function Nr(e){return(e.f&Kt)===0&&(e.parent===null||(e.parent.f&Wt)===0)}function ln(e,t,n,i){if(en){if(n===null&&(en=!1),Nr(t))throw e;return}if(n!==null&&(en=!0),Sl(e,t),Nr(t))throw e}function Dr(e,t,n=!0){var i=e.reactions;if(i!==null)for(var a=0;a<i.length;a++){var o=i[a];Se?.includes(e)||((o.f&ge)!==0?Dr(o,t,!1):t===o&&(n?_e(o,ye):(o.f&le)!==0&&_e(o,Ze),an(o)))}}function Lr(e){var t=ee,n=ue,i=ve,a=k,o=Ve,s=Se,f=te,c=Ee,d=e.f;ee=null,ue=0,ve=null,Ve=(d&se)!==0&&(Ee||!Je||k===null),k=(d&(ke|Ge))===0?e:null,Se=null,Vr(e.ctx),Ee=!1,rn++,e.f|=In;try{var m=(0,e.fn)(),h=e.deps;if(ee!==null){var p;if(on(e,ue),h!==null&&ue>0)for(h.length=ue+ee.length,p=0;p<ee.length;p++)h[ue+p]=ee[p];else e.deps=h=ee;if(!Ve)for(p=ue;p<h.length;p++)(h[p].reactions??=[]).push(e)}else h!==null&&ue<h.length&&(on(e,ue),h.length=ue);if(qr()&&ve!==null&&!Ee&&h!==null&&(e.f&(ge|Ze|ye))===0)for(p=0;p<ve.length;p++)Dr(ve[p],e);return a!==null&&a!==e&&(rn++,ve!==null&&(i===null?i=ve:i.push(...ve))),m}finally{ee=t,ue=n,ve=i,k=a,Ve=o,Se=s,Vr(f),Ee=c,e.f^=In}}function Tl(e,t){let n=t.reactions;if(n!==null){var i=Xi.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&ge)!==0&&(ee===null||!ee.includes(t))&&(_e(t,Ze),(t.f&(se|Jt))===0&&(t.f^=Jt),gr(t),on(t,0))}function on(e,t){var n=e.deps;if(n!==null)for(var i=t;i<n.length;i++)Tl(e,n[i])}function On(e){var t=e.f;if((t&Kt)===0){_e(e,le);var n=S,i=te,a=Je;S=e,Je=!0;try{(t&Cn)!==0?Al(e):yr(e),br(e);var o=Lr(e);e.teardown=typeof o=="function"?o:null,e.wv=Sr;var s=e.deps,f;er&&_l&&e.f&ye}catch(c){ln(c,e,n,i||e.ctx)}finally{Je=a,S=n}}}function Nl(){try{ul()}catch(e){if(nn!==null)ln(e,nn,null);else throw e}}function Pr(){var e=Je;try{var t=0;for(Je=!0;Nt.length>0;){t++>1e3&&Nl();var n=Nt,i=n.length;Nt=[];for(var a=0;a<i;a++){var o=Ll(n[a]);Dl(o)}Lt.clear()}}finally{tn=!1,Je=e,nn=null}}function Dl(e){var t=e.length;if(t!==0)for(var n=0;n<t;n++){var i=e[n];if((i.f&(Kt|dt))===0)try{Dt(i)&&(On(i),i.deps===null&&i.first===null&&i.nodes_start===null&&(i.teardown===null?Er(i):i.fn=null))}catch(a){ln(a,i,null,i.ctx)}}}function an(e){tn||(tn=!0,queueMicrotask(Pr));for(var t=nn=e;t.parent!==null;){t=t.parent;var n=t.f;if((n&(Ge|ke))!==0){if((n&le)===0)return;t.f^=le}}Nt.push(t)}function Ll(e){for(var t=[],n=e;n!==null;){var i=n.f,a=(i&(ke|Ge))!==0,o=a&&(i&le)!==0;if(!o&&(i&dt)===0){if((i&or)!==0)t.push(n);else if(a)n.f^=le;else try{Dt(n)&&On(n)}catch(c){ln(c,n,null,n.ctx)}var s=n.first;if(s!==null){n=s;continue}}var f=n.parent;for(n=n.next;n===null&&f!==null;)n=f.next,f=f.parent}return t}function E(e){for(var t;;){if($l(),Nt.length===0)return t;tn=!0,Pr()}}async function Fn(){await Promise.resolve(),E()}function l(e){var t=e.f,n=(t&ge)!==0;if(k!==null&&!Ee){if(!Se?.includes(e)){var i=k.deps;e.rv<rn&&(e.rv=rn,ee===null&&i!==null&&i[ue]===e?ue++:ee===null?ee=[e]:(!Ve||!ee.includes(e))&&ee.push(e))}}else if(n&&e.deps===null&&e.effects===null){var a=e,o=a.parent;o!==null&&(o.f&se)===0&&(a.f^=se)}return n&&(a=e,Dt(a)&&mr(a)),Tt&&Lt.has(e)?Lt.get(e):e.v}function Ke(e){var t=Ee;try{return Ee=!0,e()}finally{Ee=t}}const Pl=-7169;function _e(e,t){e.f=e.f&Pl|t}const Lt=new Map;function Or(e,t){var n={f:0,v:e,reactions:null,equals:vr,rv:0,wv:0};return n}function T(e,t){const n=Or(e);return kr(n),n}function Vn(e,t=!1){const n=Or(e);return t||(n.equals=$n),n}function b(e,t,n=!1){k!==null&&!Ee&&qr()&&(k.f&(ge|Cn))!==0&&!Se?.includes(e)&&hl();let i=n?Le(t):t;return Ol(e,i)}function Ol(e,t){if(!e.equals(t)){var n=e.v;Tt?Lt.set(e,t):Lt.set(e,n),e.v=t,(e.f&ge)!==0&&((e.f&ye)!==0&&_r(e),_e(e,(e.f&se)===0?le:Ze)),e.wv=Tr(),Fr(e,ye),S!==null&&(S.f&le)!==0&&(S.f&(ke|Ge))===0&&(ve===null?kl([e]):ve.push(e))}return t}function Fr(e,t){var n=e.reactions;if(n!==null)for(var i=n.length,a=0;a<i;a++){var o=n[a],s=o.f;(s&ye)===0&&(_e(o,t),(s&(le|se))!==0&&((s&ge)!==0?Fr(o,Ze):an(o)))}}let te=null;function Vr(e){te=e}function Mr(e,t=!1,n){var i=te={p:te,c:null,d:!1,e:null,m:!1,s:e,x:null,l:null};kn(()=>{i.d=!0})}function Ur(e){const t=te;if(t!==null){e!==void 0&&(t.x=e);const s=t.e;if(s!==null){var n=S,i=k;t.e=null;try{for(var a=0;a<s.length;a++){var o=s[a];Fe(o.effect),Ce(o.reaction),Tn(o.fn)}}finally{Fe(n),Ce(i)}}te=t.p,t.m=!0}return e||{}}function qr(){return!0}const Fl=["touchstart","touchmove"];function Vl(e){return Fl.includes(e)}function Ml(e,t){if(t){const n=document.body;e.autofocus=!0,Pn(()=>{document.activeElement===n&&e.focus()})}}let jr=!1;function Br(){jr||(jr=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function Hr(e){var t=k,n=S;Ce(null),Fe(null);try{return e()}finally{Ce(t),Fe(n)}}function Ul(e,t,n,i=n){e.addEventListener(t,()=>Hr(n));const a=e.__on_r;a?e.__on_r=()=>{a(),i(!0)}:e.__on_r=()=>i(!0),Br()}const Yr=new Set,Mn=new Set;function ql(e,t,n,i={}){function a(o){if(i.capture||Pt.call(t,o),!o.cancelBubble)return Hr(()=>n?.call(this,o))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Pn(()=>{t.addEventListener(e,a,i)}):t.addEventListener(e,a,i),a}function Me(e,t,n,i,a){var o={capture:i,passive:a},s=ql(e,t,n,o);(t===document.body||t===window||t===document)&&kn(()=>{t.removeEventListener(e,s,o)})}function jl(e){for(var t=0;t<e.length;t++)Yr.add(e[t]);for(var n of Mn)n(e)}function Pt(e){var t=this,n=t.ownerDocument,i=e.type,a=e.composedPath?.()||[],o=a[0]||e.target,s=0,f=e.__root;if(f){var c=a.indexOf(f);if(c!==-1&&(t===document||t===window)){e.__root=t;return}var d=a.indexOf(t);if(d===-1)return;c<=d&&(s=c)}if(o=a[s]||e.target,o!==t){It(e,"currentTarget",{configurable:!0,get(){return o||n}});var m=k,h=S;Ce(null),Fe(null);try{for(var p,w=[];o!==null;){var F=o.assignedSlot||o.parentNode||o.host||null;try{var V=o["__"+i];if(V!=null&&(!o.disabled||e.target===o))if(nr(V)){var[U,...R]=V;U.apply(o,[e,...R])}else V.call(o,e)}catch(ne){p?w.push(ne):p=ne}if(e.cancelBubble||F===t||F===null)break;o=F}if(p){for(let ne of w)queueMicrotask(()=>{throw ne});throw p}}finally{e.__root=t,delete e.currentTarget,Ce(m),Fe(h)}}}function Un(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function Ae(e,t){var n=S;n.nodes_start===null&&(n.nodes_start=e,n.nodes_end=t)}function me(e,t){var n=(t&Wi)!==0,i=(t&Ji)!==0,a,o=!e.startsWith("<!>");return()=>{if(L)return Ae(P,null),P;a===void 0&&(a=Un(o?e:"<!>"+e),n||(a=de(a)));var s=i||fr?document.importNode(a,!0):a.cloneNode(!0);if(n){var f=de(s),c=s.lastChild;Ae(f,c)}else Ae(s,s);return s}}function sn(e,t,n="svg"){var i=!e.startsWith("<!>"),a=`<${n}>${i?e:"<!>"+e}</${n}>`,o;return()=>{if(L)return Ae(P,null),P;if(!o){var s=Un(a),f=de(s);o=de(f)}var c=o.cloneNode(!0);return Ae(c,c),c}}function un(){if(L)return Ae(P,null),P;var e=document.createDocumentFragment(),t=document.createComment(""),n=zt();return e.append(t,n),Ae(t,n),e}function B(e,t){if(L){S.nodes_end=P,ht();return}e!==null&&e.before(t)}function Bl(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=n+"")}function Gr(e,t){return Zr(e,t)}function Hl(e,t){Rn(),t.intro=t.intro??!1;const n=t.target,i=L,a=P;try{for(var o=de(n);o&&(o.nodeType!==8||o.data!==En);)o=Pe(o);if(!o)throw ft;vt(!0),De(o),ht();const s=Zr(e,{...t,anchor:o});if(P===null||P.nodeType!==8||P.data!==Qn)throw Xt(),ft;return vt(!1),s}catch(s){if(s===ft)return t.recover===!1&&fl(),Rn(),ml(n),vt(!1),Gr(e,t);throw s}finally{vt(i),De(a)}}const gt=new Map;function Zr(e,{target:t,anchor:n,props:i={},events:a,context:o,intro:s=!0}){Rn();var f=new Set,c=h=>{for(var p=0;p<h.length;p++){var w=h[p];if(!f.has(w)){f.add(w);var F=Vl(w);t.addEventListener(w,Pt,{passive:F});var V=gt.get(w);V===void 0?(document.addEventListener(w,Pt,{passive:F}),gt.set(w,1)):gt.set(w,V+1)}}};c(zi(Yr)),Mn.add(c);var d=void 0,m=Cl(()=>{var h=n??t.appendChild(zt());return Dn(()=>{if(o){Mr({});var p=te;p.c=o}a&&(i.$$events=a),L&&Ae(h,null),d=e(h,i)||{},L&&(S.nodes_end=P),o&&Ur()}),()=>{for(var p of f){t.removeEventListener(p,Pt);var w=gt.get(p);--w===0?(document.removeEventListener(p,Pt),gt.delete(p)):gt.set(p,w)}Mn.delete(c),h!==n&&h.parentNode?.removeChild(h)}});return qn.set(d,m),d}let qn=new WeakMap;function Yl(e,t){const n=qn.get(e);return n?(qn.delete(e),n(t)):Promise.resolve()}function J(e,t,[n,i]=[0,0]){L&&n===0&&ht();var a=e,o=null,s=null,f=ie,c=n>0?An:0,d=!1;const m=(p,w=!0)=>{d=!0,h(w,p)},h=(p,w)=>{if(f===(f=p))return;let F=!1;if(L&&i!==-1){if(n===0){const U=a.data;U===En?i=0:U===zn?i=1/0:(i=parseInt(U.substring(1)),i!==i&&(i=f?1/0:-1))}const V=i>n;!!f===V&&(a=gl(),De(a),vt(!1),F=!0,i=-1)}f?(o?Ar(o):w&&(o=Dn(()=>w(a))),s&&Ln(s,()=>{s=null})):(s?Ar(s):w&&(s=Dn(()=>w(a,[n+1,i]))),o&&Ln(o,()=>{o=null})),F&&vt(!0)};pr(()=>{d=!1,t(m),d||h(null,null)},c),L&&(a=P)}function Xe(e,t,n=!1,i=!1,a=!1){var o=e,s="";we(()=>{var f=S;if(s===(s=t()??"")){L&&ht();return}if(f.nodes_start!==null&&(wr(f.nodes_start,f.nodes_end),f.nodes_start=f.nodes_end=null),s!==""){if(L){P.data;for(var c=ht(),d=c;c!==null&&(c.nodeType!==8||c.data!=="");)d=c,c=Pe(c);if(c===null)throw Xt(),ft;Ae(P,d),o=De(c);return}var m=s+"";n?m=`<svg>${m}</svg>`:i&&(m=`<math>${m}</math>`);var h=Un(m);if((n||i)&&(h=de(h)),Ae(de(h),h.lastChild),n||i)for(;de(h);)o.before(de(h));else o.before(h)}})}function Gl(e,t,n,i,a){L&&ht();var o=t.$$slots?.[n],s=!1;o===!0&&(o=t.children,s=!0),o===void 0||o(e,s?()=>i:i)}const Wr=[...`
2
+ \r\f \v\uFEFF`];function Zl(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 o=a.length,s=0;(s=i.indexOf(a,s))>=0;){var f=s+o;(s===0||Wr.includes(i[s-1]))&&(f===i.length||Wr.includes(i[f]))?i=(s===0?"":i.substring(0,s))+i.substring(f+1):s=f}}return i===""?null:i}function Wl(e,t,n,i,a,o){var s=e.__className;if(L||s!==n||s===void 0){var f=Zl(n,i,o);(!L||f!==e.getAttribute("class"))&&(f==null?e.removeAttribute("class"):e.className=f),e.__className=n}else if(o&&a!==o)for(var c in o){var d=!!o[c];(a==null||d!==!!a[c])&&e.classList.toggle(c,d)}return o}const Jl=Symbol("is custom element"),Kl=Symbol("is html");function Jr(e){if(L){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var i=e.value;$(e,"value",null),e.value=i}if(e.hasAttribute("checked")){var a=e.checked;$(e,"checked",null),e.checked=a}}};e.__on_r=n,Rl(n),Br()}}function Xl(e,t){var n=Kr(e);n.value===(n.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function $(e,t,n,i){var a=Kr(e);L&&(a[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||a[t]!==(a[t]=n)&&(t==="loading"&&(e[ll]=n),n==null?e.removeAttribute(t):typeof n!="string"&&zl(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Kr(e){return e.__attributes??={[Jl]:e.nodeName.includes("-"),[Kl]:e.namespaceURI===Ki}}var Xr=new Map;function zl(e){var t=Xr.get(e.nodeName);if(t)return t;Xr.set(e.nodeName,t=[]);for(var n,i=e,a=Element.prototype;a!==i;){n=Qi(i);for(var o in n)n[o].set&&t.push(o);i=rr(i)}return t}function Ql(e,t,n=t){Ul(e,"change",i=>{var a=i?e.defaultChecked:e.checked;n(a)}),(L&&e.defaultChecked!==e.checked||Ke(t)==null)&&n(e.checked),Nn(()=>{var i=t();e.checked=!!i})}function zr(e,t){return e===t||e?.[xt]===t}function fn(e={},t,n,i){return Tn(()=>{var a,o;return Nn(()=>{a=o,o=[],Ke(()=>{e!==n(...o)&&(t(e,...o),a&&zr(n(...a),e)&&t(null,...a))})}),()=>{Pn(()=>{o&&zr(n(...o),e)&&t(null,...o)})}}),e}function Qr(e){te===null&&tr(),Sn(()=>{const t=Ke(e);if(typeof t=="function")return t})}function eo(e){te===null&&tr(),Qr(()=>()=>Ke(e))}function ei(e,t,n){if(e==null)return t(void 0),ct;const i=Ke(()=>e.subscribe(t,n));return i.unsubscribe?()=>i.unsubscribe():i}const _t=[];function to(e,t=ct){let n=null;const i=new Set;function a(f){if(hr(e,f)&&(e=f,n)){const c=!_t.length;for(const d of i)d[1](),_t.push(d,e);if(c){for(let d=0;d<_t.length;d+=2)_t[d][0](_t[d+1]);_t.length=0}}}function o(f){a(f(e))}function s(f,c=ct){const d=[f,c];return i.add(d),i.size===1&&(n=t(a,o)||ct),f(e),()=>{i.delete(d),i.size===0&&n&&(n(),n=null)}}return{set:a,update:o,subscribe:s}}function cn(e){let t;return ei(e,n=>t=n)(),t}let dn=!1,jn=Symbol();function no(e,t,n){const i=n[t]??={store:null,source:Vn(void 0),unsubscribe:ct};if(i.store!==e&&!(jn in n))if(i.unsubscribe(),i.store=e??null,e==null)i.source.v=void 0,i.unsubscribe=ct;else{var a=!0;i.unsubscribe=ei(e,o=>{a?i.source.v=o:b(i.source,o)}),a=!1}return e&&jn in n?cn(e):l(i.source)}function ro(){const e={};function t(){kn(()=>{for(var n in e)e[n].unsubscribe();It(e,jn,{enumerable:!1,value:!0})})}return[e,t]}function io(e){var t=dn;try{return dn=!1,[e(),dn]}finally{dn=t}}function ti(e){return e.ctx?.d??!1}function C(e,t,n,i){var a=(n&Hi)!==0,o=!0,s=(n&Gi)!==0,f=(n&Zi)!==0,c=!1,d;s?[d,c]=io(()=>e[t]):d=e[t];var m=xt in e||sr in e,h=s&&(Ye(e,t)?.set??(m&&t in e&&(q=>e[t]=q)))||void 0,p=i,w=!0,F=!1,V=()=>(F=!0,w&&(w=!1,f?p=Ke(i):p=i),p);d===void 0&&i!==void 0&&(h&&o&&cl(),d=V(),h&&h(d));var U;if(U=()=>{var q=e[t];return q===void 0?V():(w=!0,F=!1,q)},(n&Yi)===0)return U;if(h){var R=e.$$legacy;return function(q,fe){return arguments.length>0?((!fe||R||c)&&h(fe?U():q),q):U()}}var ne=!1,Te=Vn(d),Q=Qt(()=>{var q=U(),fe=l(Te);return ne?(ne=!1,fe):Te.v=q});return s&&l(Q),a||(Q.equals=$n),function(q,fe){if(arguments.length>0){const ze=fe?l(Q):s?Le(q):q;if(!Q.equals(ze)){if(ne=!0,b(Te,ze),F&&p!==void 0&&(p=ze),ti(Q))return q;Ke(()=>l(Q))}return q}return ti(Q)?Q.v:l(Q)}}function lo(e){return new oo(e)}class oo{#t;#e;constructor(t){var n=new Map,i=(o,s)=>{var f=Vn(s);return n.set(o,f),f};const a=new Proxy({...t.props||{},$$events:{}},{get(o,s){return l(n.get(s)??i(s,Reflect.get(o,s)))},has(o,s){return s===sr?!0:(l(n.get(s)??i(s,Reflect.get(o,s))),Reflect.has(o,s))},set(o,s,f){return b(n.get(s)??i(s,f),f),Reflect.set(o,s,f)}});this.#e=(t.hydrate?Hl:Gr)(t.component,{target:t.target,anchor:t.anchor,props:a,context:t.context,intro:t.intro??!1,recover:t.recover}),(!t?.props?.$$host||t.sync===!1)&&E(),this.#t=a.$$events;for(const o of Object.keys(this.#e))o==="$set"||o==="$destroy"||o==="$on"||It(this,o,{get(){return this.#e[o]},set(s){this.#e[o]=s},enumerable:!0});this.#e.$set=o=>{Object.assign(a,o)},this.#e.$destroy=()=>{Yl(this.#e)}}$set(t){this.#e.$set(t)}$on(t,n){this.#t[t]=this.#t[t]||[];const i=(...a)=>n.call(this,...a);return this.#t[t].push(i),()=>{this.#t[t]=this.#t[t].filter(a=>a!==i)}}$destroy(){this.#e.$destroy()}}let ni;typeof HTMLElement=="function"&&(ni=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(e,t,n){super(),this.$$ctor=e,this.$$s=t,n&&this.attachShadow({mode:"open"})}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const i=this.$$c.$on(e,t);this.$$l_u.set(t,i)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){const i=this.$$l_u.get(t);i&&(i(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(i){return a=>{const o=document.createElement("slot");i!=="default"&&(o.name=i),B(a,o)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},n=ao(this);for(const i of this.$$s)i in n&&(i==="default"&&!this.$$d.children?(this.$$d.children=e(i),t.default=!0):t[i]=e(i));for(const i of this.attributes){const a=this.$$g_p(i.name);a in this.$$d||(this.$$d[a]=vn(a,i.value,this.$$p_d,"toProp"))}for(const i in this.$$p_d)!(i in this.$$d)&&this[i]!==void 0&&(this.$$d[i]=this[i],delete this[i]);this.$$c=lo({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=El(()=>{Nn(()=>{this.$$r=!0;for(const i of Gt(this.$$c)){if(!this.$$p_d[i]?.reflect)continue;this.$$d[i]=this.$$c[i];const a=vn(i,this.$$d[i],this.$$p_d,"toAttribute");a==null?this.removeAttribute(this.$$p_d[i].attribute||i):this.setAttribute(this.$$p_d[i].attribute||i,a)}this.$$r=!1})});for(const i in this.$$l)for(const a of this.$$l[i]){const o=this.$$c.$on(i,a);this.$$l_u.set(a,o)}this.$$l={}}}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=vn(e,n,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return Gt(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function vn(e,t,n,i){const a=n[e]?.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 ao(e){const t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0}),t}function so(e,t,n,i,a,o){let s=class extends ni{constructor(){super(e,n,a),this.$$p_d=t}static get observedAttributes(){return Gt(t).map(f=>(t[f].attribute||f).toLowerCase())}};return Gt(t).forEach(f=>{It(s.prototype,f,{get(){return this.$$c&&f in this.$$c?this.$$c[f]:this.$$d[f]},set(c){c=vn(f,c,t),this.$$d[f]=c;var d=this.$$c;if(d){var m=Ye(d,f)?.get;m?d[f]=c:d.$set({[f]:c})}}})}),i.forEach(f=>{It(s.prototype,f,{get(){return this.$$c?.[f]}})}),e.element=s,s}const ri=new TextEncoder;function uo(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function fo(e,t="SHA-256",n=1e5){const i=Date.now().toString(16);e||(e=Math.round(Math.random()*n));const a=await ii(i,e,t);return{algorithm:t,challenge:a,salt:i,signature:""}}async function ii(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 uo(await crypto.subtle.digest(n.toUpperCase(),ri.encode(e+t)))}function co(e,t,n="SHA-256",i=1e6,a=0){const o=new AbortController,s=Date.now();return{promise:(async()=>{for(let c=a;c<=i;c+=1){if(o.signal.aborted)return null;if(await ii(t,c,n)===e)return{number:c,took:Date.now()-s}}return null})(),controller:o}}function li(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function vo(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 ho(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 go(e,t="",n=1e6,i=0){const a="AES-GCM",o=new AbortController,s=Date.now(),f=async()=>{for(let m=i;m<=n;m+=1){if(o.signal.aborted||!c||!d)return null;try{const h=await crypto.subtle.decrypt({name:a,iv:ho(m)},c,d);if(h)return{clearText:new TextDecoder().decode(h),took:Date.now()-s}}catch{}}return null};let c=null,d=null;try{d=vo(e);const m=await crypto.subtle.digest("SHA-256",ri.encode(t));c=await crypto.subtle.importKey("raw",m,a,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:o}}return{promise:f(),controller:o}}var y=(e=>(e.CODE="code",e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(y||{}),z=(e=>(e.ERROR="error",e.LOADING="loading",e.PLAYING="playing",e.PAUSED="paused",e.READY="ready",e))(z||{});globalThis.altchaPlugins=globalThis.altchaPlugins||[],globalThis.altchaI18n=globalThis.altchaI18n||{get:e=>cn(globalThis.altchaI18n.store)[e],set:(e,t)=>{Object.assign(cn(globalThis.altchaI18n.store),{[e]:t}),globalThis.altchaI18n.store.set(cn(globalThis.altchaI18n.store))},store:to({})};const _o={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",_o);const Bn=(e,t)=>{let n=pl(()=>nl(t?.(),24));var i=yo();we(()=>{$(i,"width",l(n)),$(i,"height",l(n))}),B(e,i)};function mo(e,t){e.code==="Space"&&(e.preventDefault(),e.stopImmediatePropagation(),t())}function po(e,t){e.preventDefault(),t()}function bo(e,t,n,i,a,o,s,f){[y.UNVERIFIED,y.ERROR,y.EXPIRED,y.CODE].includes(l(t))?n()!==!1&&l(i)?.reportValidity()===!1?b(a,!1):o()?s():f():b(a,!0)}var yo=sn('<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>'),wo=me('<input type="hidden">'),Eo=me('<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>'),Co=sn('<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>'),Ao=sn('<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>'),Io=sn('<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>'),xo=me('<button type="button" class="altcha-code-challenge-audio"><!></button>'),Ro=me("<audio hidden autoplay><source></audio>"),$o=me('<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>'),ko=me("<div><!></div>"),So=me("<div><!></div>"),To=me('<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>'),No=me('<div class="altcha-footer"><div><!></div></div>'),Do=me('<div class="altcha-anchor-arrow"></div>'),Lo=me('<!> <div class="altcha"><div class="altcha-main"><div><!> <input type="checkbox"></div> <label class="altcha-label"><!></label> <!> <!> <!></div> <!> <!> <!></div>',1);function oi(e,t){Mr(t,!0);const[n,i]=ro(),a=()=>no(Oo,"$altchaI18nStore",n);let o=C(t,"auto",7,void 0),s=C(t,"blockspam",7,void 0),f=C(t,"challengeurl",7,void 0),c=C(t,"challengejson",7,void 0),d=C(t,"credentials",7,void 0),m=C(t,"customfetch",7,void 0),h=C(t,"debug",7,!1),p=C(t,"delay",7,0),w=C(t,"disableautofocus",7,!1),F=C(t,"refetchonexpire",7,!0),V=C(t,"disablerefetchonexpire",23,()=>!F()),U=C(t,"expire",7,void 0),R=C(t,"floating",7,void 0),ne=C(t,"floatinganchor",7,void 0),Te=C(t,"floatingoffset",7,void 0),Q=C(t,"floatingpersist",7,!1),q=C(t,"hidefooter",7,!1),fe=C(t,"hidelogo",7,!1),ze=C(t,"id",7,void 0),hn=C(t,"language",7,void 0),Qe=C(t,"name",7,"altcha"),et=C(t,"maxnumber",7,1e6),Ot=C(t,"mockerror",7,!1),Ue=C(t,"obfuscated",7,void 0),pe=C(t,"overlay",7,void 0),Ft=C(t,"overlaycontent",7,void 0),gn=C(t,"plugins",7,void 0),tt=C(t,"sentinel",7,void 0),Ie=C(t,"spamfilter",7,!1),mt=C(t,"strings",7,void 0),he=C(t,"test",7,!1),re=C(t,"verifyurl",7,void 0),pt=C(t,"workers",23,()=>Math.min(16,navigator.hardwareConcurrency||8)),Vt=C(t,"workerurl",7,void 0);const{altchaI18n:Po}=globalThis,Oo=Po.store,ai=["SHA-256","SHA-384","SHA-512"],Fo="https://altcha.org/",qe=(r,u)=>{t.$$host.dispatchEvent(new CustomEvent(r,{detail:u}))},si=document.documentElement.lang?.split("-")?.[0],Hn=$t(()=>f()&&new URL(f(),location.origin).host.endsWith(".altcha.org")&&!!f()?.includes("apiKey=ckey_")),_n=$t(()=>c()?Ei(c()):void 0),Vo=$t(()=>mt()?Ei(mt()):{}),O=$t(()=>({...ci(a()),...l(Vo)})),ui=$t(()=>`${ze()||Qe()}_checkbox_${Math.round(Math.random()*1e8)}`);let nt=T(null),Mt=T(!1),Y=T(null),I=T(Le(y.UNVERIFIED)),M=T(void 0),Ut=T(null),je=T(null),ce=T(null),Yn=T(null),bt=T(null),N=T(null),qt=T(null),rt=T(null),xe=null,K=T(null),it=T(!1),Be=[],Gn=T(!1),Re=T(null);Sn(()=>{Xo(l(rt))}),Sn(()=>{zo(l(I))}),eo(()=>{Mo(),b(qt,null),l(N)&&(l(N).removeEventListener("submit",mi),l(N).removeEventListener("reset",pi),l(N).removeEventListener("focusin",_i),b(N,null)),xe&&(clearTimeout(xe),xe=null),document.removeEventListener("click",hi),document.removeEventListener("scroll",gi),window.removeEventListener("resize",wi)}),Qr(()=>{x("mounted","2.2.4"),x("workers",pt()),Bo(),x("plugins",Be.length?Be.map(r=>r.constructor.pluginName).join(", "):"none"),he()&&x("using test mode"),U()&&Wn(U()),o()!==void 0&&x("auto",o()),R()!==void 0&&xi(R()),b(N,l(M)?.closest("form"),!0),l(N)&&(l(N).addEventListener("submit",mi,{capture:!0}),l(N).addEventListener("reset",pi),(o()==="onfocus"||Q()==="focus")&&l(N).addEventListener("focusin",_i)),pe()&&Ri(!0),o()==="onload"&&(Ue()?jt():Ne()),l(Hn)&&(q()||fe())&&x("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{qe("load")})});function mn(r,u){return btoa(JSON.stringify({algorithm:r.algorithm,challenge:r.challenge,number:u.number,salt:r.salt,signature:r.signature,test:he()?!0:void 0,took:u.took}))}function Mo(){for(const r of Be)r.destroy()}function fi(){f()&&!V()&&l(I)===y.VERIFIED?Ne():lt(y.EXPIRED,l(O).expired)}async function Uo(){if(Ot())throw x("mocking error"),new Error("Mocked error.");if(l(_n))return x("using provided json data"),Ci(l(_n).salt),l(_n);if(he())return x("generating test challenge",{test:he()}),fo(typeof he()!="boolean"?+he():void 0);{if(!f()&&l(N)){const g=l(N).getAttribute("action");g?.includes("/form/")&&f(g+"/altcha")}if(!f())throw new Error("Attribute challengeurl not set.");x("fetching challenge from",f());const r={credentials:typeof d()=="boolean"?"include":d(),headers:Ie()!==!1?{"x-altcha-spam-filter":"1"}:{}},u=await Zn()(f(),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 v=u.headers.get("X-Altcha-Config"),_=await u.json();if(Ci(_.salt),v)try{const g=JSON.parse(v);g&&typeof g=="object"&&(g.verifyurl&&!g.verifyurl.startsWith("fn:")&&(g.verifyurl=vi(g.verifyurl)),Si(g))}catch(g){x("unable to configure from X-Altcha-Config",g)}return _}}function qo(r){const u=l(N)?.querySelector(typeof r=="string"?`input[name="${r}"]`:'input[type="email"]:not([data-no-spamfilter])');return u?.value?.slice(u.value.indexOf("@"))||void 0}function Zn(){let r=fetch;if(m())if(x("using customfetch"),typeof m()=="string"){if(r=globalThis[m()]||null,!r)throw new Error(`Custom fetch function not found: ${m()}`)}else r=m();return r}function ci(r,u=[hn()||"",document.documentElement.lang||"",...navigator.languages]){const v=Object.keys(r).map(g=>g.toLowerCase()),_=u.reduce((g,A)=>(A=A.toLowerCase(),g||(r[A]?A:null)||v.find(D=>A.split("-")[0]===D.split("-")[0])||null),null);return r[_||"en"]}function jo(){return Ie()==="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 Ie()=="object"?Ie():{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 di(r){return[...l(N)?.querySelectorAll(r?.length?r.map(v=>`input[name="${v}"]`).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])')||[]].reduce((v,_)=>{const g=_.name,A=_.value;return g&&A&&(v[g]=/\n/.test(A)?A.replace(new RegExp("(?<!\\r)\\n","g"),`\r
3
+ `):A),v},{})}function vi(r,u){const v=new URL(f()||location.origin),_=new URL(r,v);if(_.search||(_.search=v.search),u)for(const g in u)u[g]!==void 0&&u[g]!==null&&_.searchParams.set(g,u[g]);return _.toString()}function Bo(){const r=gn()!==void 0?gn().split(","):void 0;for(const u of globalThis.altchaPlugins)(!r||r.includes(u.pluginName))&&Be.push(new u({el:l(M),clarify:jt,dispatch:qe,getConfiguration:Ti,getFloatingAnchor:Ni,getState:Di,log:x,reset:lt,solve:ki,setState:$e,setFloatingAnchor:Li,verify:Ne}))}function x(...r){(h()||r.some(u=>u instanceof Error))&&console[r[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${Qe()}]`,...r)}function Ho(){b(K,z.PAUSED,!0)}function Yo(r){b(K,z.ERROR,!0)}function Go(){b(K,z.READY,!0)}function Zo(){b(K,z.LOADING,!0)}function Wo(){b(K,z.PLAYING,!0)}function Jo(){b(K,z.PAUSED,!0)}function Ko(r){if(r.preventDefault(),r.stopPropagation(),l(Y)){const u=new FormData(r.target),v=String(u.get("code"));if(re()?.startsWith("fn:")){const _=re().replace(/^fn:/,"");if(x(`calling ${_} function instead of verifyurl`),!(_ in globalThis))throw new Error(`Global function "${_}" is undefined.`);return globalThis[_]({challenge:l(Y).challenge,code:v,solution:l(Y).solution})}b(it,!0),Ai(mn(l(Y).challenge,l(Y).solution),v).then(({reason:_,verified:g})=>{g?(b(Y,null),$e(y.VERIFIED),x("verified"),Fn().then(()=>{l(Yn)?.focus(),qe("verified",{payload:l(Re)}),o()==="onsubmit"?Ii(l(qt)):pe()&&Bt()})):(lt(),b(rt,_||"Verification failed",!0))}).catch(_=>{b(Y,null),$e(y.ERROR,_),x("sentinel verification failed:",_)}).finally(()=>{b(it,!1)})}}function hi(r){const u=r.target;R()&&u&&!l(M).contains(u)&&(l(I)===y.VERIFIED&&Q()===!1||l(I)===y.VERIFIED&&Q()==="focus"&&!l(N)?.matches(":focus-within")||o()==="off"&&l(I)===y.UNVERIFIED)&&Bt()}function gi(){R()&&l(I)!==y.UNVERIFIED&&Ht()}function Xo(r){for(const u of Be)typeof u.onErrorChange=="function"&&u.onErrorChange(l(rt))}function _i(r){l(I)===y.UNVERIFIED?Ne():R()&&Q()==="focus"&&l(I)===y.VERIFIED&&pn()}function mi(r){r.target?.hasAttribute("data-code-challenge-form")||(b(qt,r.submitter,!0),l(N)&&o()==="onsubmit"?(l(qt)?.blur(),l(I)===y.UNVERIFIED?(r.preventDefault(),r.stopPropagation(),Ne().then(()=>{Ii(l(qt))})):l(I)!==y.VERIFIED&&(r.preventDefault(),r.stopPropagation(),l(I)===y.VERIFYING&&bi())):l(N)&&R()&&o()==="off"&&l(I)===y.UNVERIFIED&&(r.preventDefault(),r.stopPropagation(),pn()))}function pi(){lt()}function bi(){l(I)===y.VERIFYING&&l(O).waitAlert&&alert(l(O).waitAlert)}function yi(){l(je)?l(je).paused?(l(je).currentTime=0,l(je).play()):l(je).pause():(b(Gn,!0),requestAnimationFrame(()=>{l(je)?.play()}))}function zo(r){for(const u of Be)typeof u.onStateChange=="function"&&u.onStateChange(l(I));R()&&l(I)!==y.UNVERIFIED&&requestAnimationFrame(()=>{Ht()}),b(Mt,l(I)===y.VERIFIED),pe()&&l(ce)&&(l(I)!==y.UNVERIFIED?pn():Bt())}function wi(){R()&&Ht()}function Ei(r){return JSON.parse(r)}function Ci(r){const u=new URLSearchParams(r.split("?")?.[1]),v=u.get("expires")||u.get("expire");if(v){const _=new Date(+v*1e3),g=isNaN(_.getTime())?0:_.getTime()-Date.now();g>0&&Wn(g)}else xe&&(clearTimeout(xe),xe=null)}async function Qo(r){if(!re())throw new Error("Attribute verifyurl not set.");x("requesting server verification from",re());const u={payload:r};if(Ie()!==!1){const{blockedCountries:g,classifier:A,disableRules:D,email:H,expectedLanguages:j,expectedCountries:oe,fields:ae,ipAddress:at,text:wt,timeZone:st}=jo();u.blockedCountries=g,u.classifier=A,u.disableRules=D,u.email=H===!1?void 0:qo(H),u.expectedCountries=oe,u.expectedLanguages=j||(si?[si]:void 0),u.fields=ae===!1?void 0:di(ae),u.ipAddress=at===!1?void 0:at||"auto",u.text=wt,u.timeZone=st===!1?void 0:st||li()}const v=await Zn()(re(),{body:JSON.stringify(u),headers:{"content-type":"application/json"},method:"POST"});if(!v||!(v instanceof Response))throw new Error("Custom fetch function did not return a response.");if(v.status!==200)throw new Error(`Server responded with ${v.status}.`);const _=await v.json();if(_?.payload&&b(Re,_.payload,!0),qe("serververification",_),s()&&_.classification==="BAD")throw new Error("SpamFilter returned negative classification.")}async function Ai(r,u){if(!re())throw new Error("Attribute verifyurl not set.");x("requesting sentinel verification from",re());const v={code:u,payload:r};tt()&&(v.fields=tt().fields?di():void 0,v.timeZone=tt().timeZone?li():void 0);const _=await Zn()(re(),{body:JSON.stringify(v),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 g=await _.json();return g?.payload&&b(Re,g.payload,!0),qe("sentinelverification",g),g}function Ii(r){l(N)&&"requestSubmit"in l(N)?l(N).requestSubmit(r):l(N)?.reportValidity()&&(r?r.click():l(N).submit())}function Wn(r){x("expire",r),xe&&(clearTimeout(xe),xe=null),r<1?fi():xe=setTimeout(fi,r)}function xi(r){x("floating",r),R()!==r&&(l(M).style.left="",l(M).style.top=""),R(r===!0||r===""?"auto":r===!1||r==="false"?void 0:R()),R()?(o()||o("onsubmit"),document.addEventListener("scroll",gi),document.addEventListener("click",hi),window.addEventListener("resize",wi)):o()==="onsubmit"&&o(void 0)}function Ri(r){if(x("overlay",r),pe(r),r){if(o()||o("onsubmit"),l(ce)&&l(M).parentElement&&l(ce).replaceWith(l(M).parentElement),l(M)?.parentElement?.parentElement){b(ce,document.createElement("div"),!0),l(M).parentElement.parentElement.appendChild(l(ce));const u=document.createElement("div"),v=document.createElement("button");v.type="button",v.innerHTML="&times;",v.addEventListener("click",_=>{_.preventDefault(),lt()}),l(ce).classList.add("altcha-overlay-backdrop"),v.classList.add("altcha-overlay-close-button"),u.classList.add("altcha-overlay"),l(ce).append(u),u.append(v),Ft()&&u.append(...document.querySelectorAll(Ft())),u.append(l(M).parentElement)}}else l(ce)&&l(M).parentElement&&(l(ce).replaceWith(l(M).parentElement),l(M).style.display="block")}function $i(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(!ai.includes(r.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${ai.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 ki(r){let u=null,v=null;if("Worker"in window){try{u=ea(r,r.maxNumber||r.maxnumber||et()),b(nt,u.controller,!0),v=await u.promise}catch(_){x(_)}finally{b(nt,null)}if(v===null||v?.number!==void 0||"obfuscated"in r)return{data:r,solution:v}}if("obfuscated"in r){const _=await go(r.obfuscated,r.key,r.maxNumber||r.maxnumber);return{data:r,solution:await _.promise}}u=co(r.challenge,r.salt,r.algorithm,r.maxNumber||r.maxnumber||et()),b(nt,u.controller,!0);try{v=await u.promise}catch(_){x(_)}finally{b(nt,null)}return{data:r,solution:v}}function ea(r,u=typeof he()=="number"?he():r.maxNumber||r.maxnumber||et(),v=Math.ceil(pt())){const _=new AbortController,g=[];v=Math.min(16,u,Math.max(1,v));for(let H=0;H<v;H++)g.push(altchaCreateWorker(Vt()));const A=Math.ceil(u/v);return{promise:(async()=>{const H=await Promise.all(g.map((j,oe)=>{const ae=oe*A;return _.signal.addEventListener("abort",()=>{j.postMessage({type:"abort"})}),new Promise(at=>{j.addEventListener("message",wt=>{if(wt.data)for(const st of g)st!==j&&st.postMessage({type:"abort"});at(wt.data)}),j.postMessage({payload:r,max:ae+A,start:ae,type:"work"})})}));for(const j of g)j.terminate();return H.find(j=>!!j)||null})(),controller:_}}async function jt(){if(!Ue()){$e(y.ERROR);return}const r=Be.find(u=>u.constructor.pluginName==="obfuscation");if(!r||!("clarify"in r)){$e(y.ERROR),x("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");return}if("clarify"in r&&typeof r.clarify=="function")return r.clarify()}function Si(r){r.obfuscated!==void 0&&Ue(r.obfuscated),r.auto!==void 0&&(o(r.auto),o()==="onload"&&(Ue()?jt():Ne())),r.blockspam!==void 0&&s(!!r.blockspam),r.customfetch!==void 0&&m(r.customfetch),r.floatinganchor!==void 0&&ne(r.floatinganchor),r.delay!==void 0&&p(r.delay),r.floatingoffset!==void 0&&Te(r.floatingoffset),r.floating!==void 0&&xi(r.floating),r.expire!==void 0&&(Wn(r.expire),U(r.expire)),r.challenge&&(c(typeof r.challenge=="string"?r.challenge:JSON.stringify(r.challenge)),$i(l(_n))),r.challengeurl!==void 0&&f(r.challengeurl),r.debug!==void 0&&h(!!r.debug),r.hidefooter!==void 0&&q(!!r.hidefooter),r.hidelogo!==void 0&&fe(!!r.hidelogo),r.language!==void 0&&mt(ci(a(),[r.language])),r.maxnumber!==void 0&&et(+r.maxnumber),r.mockerror!==void 0&&Ot(!!r.mockerror),r.name!==void 0&&Qe(r.name),r.overlaycontent!==void 0&&Ft(r.overlaycontent),r.overlay!==void 0&&Ri(r.overlay),r.refetchonexpire!==void 0&&V(!r.refetchonexpire),r.disablerefetchonexpire!==void 0&&V(!r.disablerefetchonexpire),r.sentinel!==void 0&&typeof r.sentinel=="object"&&tt(r.sentinel),r.spamfilter!==void 0&&Ie(typeof r.spamfilter=="object"?r.spamfilter:!!r.spamfilter),r.strings&&mt(typeof r.strings=="string"?r.strings:JSON.stringify(r.strings)),r.test!==void 0&&he(typeof r.test=="number"?r.test:!!r.test),r.verifyurl!==void 0&&re(r.verifyurl),r.workers!==void 0&&pt(+r.workers),r.workerurl!==void 0&&Vt(r.workerurl)}function Ti(){return{auto:o(),blockspam:s(),challengeurl:f(),debug:h(),delay:p(),disableautofocus:w(),disablerefetchonexpire:V(),expire:U(),floating:R(),floatinganchor:ne(),floatingoffset:Te(),hidefooter:q(),hidelogo:fe(),name:Qe(),maxnumber:et(),mockerror:Ot(),obfuscated:Ue(),overlay:pe(),refetchonexpire:!V(),spamfilter:Ie(),strings:l(O),test:he(),verifyurl:re(),workers:pt(),workerurl:Vt()}}function Ni(){return l(bt)}function ta(r){return Be.find(u=>u.constructor.pluginName===r)}function Di(){return l(I)}function Bt(){l(M).style.display="none",pe()&&l(ce)&&(l(ce).style.display="none")}function Ht(r=20){if(l(M))if(l(bt)||b(bt,(ne()?document.querySelector(ne()):l(N)?.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||l(N),!0),l(bt)){const u=parseInt(Te(),10)||12,v=l(bt).getBoundingClientRect(),_=l(M).getBoundingClientRect(),g=document.documentElement.clientHeight,A=document.documentElement.clientWidth,D=R()==="auto"?v.bottom+_.height+u+r>g:R()==="top",H=Math.max(r,Math.min(A-r-_.width,v.left+v.width/2-_.width/2));if(D?l(M).style.top=`${v.top-(_.height+u)}px`:l(M).style.top=`${v.bottom+u}px`,l(M).style.left=`${H}px`,l(M).setAttribute("data-floating",D?"top":"bottom"),l(Ut)){const j=l(Ut).getBoundingClientRect();l(Ut).style.left=v.left-H+v.width/2-j.width/2+"px"}}else x("unable to find floating anchor element")}function lt(r=y.UNVERIFIED,u=null){l(nt)&&(l(nt).abort(),b(nt,null)),b(Mt,!1),b(Re,null),b(Y,null),b(Gn,!1),b(K,null),$e(r,u)}function Li(r){b(bt,r,!0)}function $e(r,u=null){b(I,r,!0),b(rt,u,!0),qe("statechange",{payload:l(Re),state:l(I)})}function pn(){l(M).style.display="block",R()&&Ht(),pe()&&l(ce)&&(l(ce).style.display="flex")}async function Ne(){return lt(y.VERIFYING),await new Promise(r=>setTimeout(r,p()||0)),Uo().then(r=>($i(r),x("challenge",r),ki(r))).then(({data:r,solution:u})=>{if(x("solution",u),!u||r&&"challenge"in r&&!("clearText"in u)){if(u?.number!==void 0&&"challenge"in r)if(re()&&"codeChallenge"in r)["INPUT","BUTTON","SELECT","TEXTAREA"].includes(document.activeElement?.tagName||"")&&w()===!1&&document.activeElement.blur(),b(Y,{challenge:r,solution:u},!0);else{if(re()&&tt()!==void 0)return Ai(mn(r,u));if(re())return Qo(mn(r,u));b(Re,mn(r,u),!0),x("payload",l(Re))}else if(l(I)!==y.EXPIRED)throw x("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."),new Error("Unexpected result returned.")}}).then(()=>{l(Y)?($e(y.CODE),Fn().then(()=>{qe("code",{codeChallenge:l(Y)})})):l(Re)&&($e(y.VERIFIED),x("verified"),Fn().then(()=>{qe("verified",{payload:l(Re)}),pe()&&Bt()}))}).catch(r=>{x(r),$e(y.ERROR,r.message)})}var Pi=Lo(),Oi=Rt(Pi);Gl(Oi,t,"default",{});var yt=W(Oi,2),Jn=Z(yt),bn=Z(Jn);let Fi;var Vi=Z(bn);{var na=r=>{Bn(r)};J(Vi,r=>{l(I)===y.VERIFYING&&r(na)})}var ot=W(Vi,2);Jr(ot),ot.__change=[bo,I,Ie,N,Mt,Ue,jt,Ne],fn(ot,r=>b(Yn,r),()=>l(Yn)),G(bn);var yn=W(bn,2),ra=Z(yn);{var ia=r=>{var u=un(),v=Rt(u);Xe(v,()=>l(O).verified),B(r,u)},la=(r,u)=>{{var v=g=>{var A=un(),D=Rt(A);Xe(D,()=>l(O).verifying),B(g,A)},_=(g,A)=>{{var D=j=>{var oe=un(),ae=Rt(oe);Xe(ae,()=>l(O).verificationRequired),B(j,oe)},H=j=>{var oe=un(),ae=Rt(oe);Xe(ae,()=>l(O).label),B(j,oe)};J(g,j=>{l(I)===y.CODE?j(D):j(H,!1)},A)}};J(r,g=>{l(I)===y.VERIFYING?g(v):g(_,!1)},u)}};J(ra,r=>{l(I)===y.VERIFIED?r(ia):r(la,!1)})}G(yn);var Mi=W(yn,2);{var oa=r=>{var u=wo();Jr(u),we(()=>{$(u,"name",Qe()),Xl(u,l(Re))}),B(r,u)};J(Mi,r=>{l(I)===y.VERIFIED&&r(oa)})}var Ui=W(Mi,2);{var aa=r=>{var u=Eo(),v=Z(u);$(v,"href",Fo),G(u),we(()=>$(v,"aria-label",l(O).ariaLinkLabel)),B(r,u)};J(Ui,r=>{(fe()!==!0||l(Hn))&&r(aa)})}var sa=W(Ui,2);{var ua=r=>{var u=$o(),v=W(Z(u),2),_=Z(v),g=W(_,2);Ml(g,!w()),g.__keydown=[mo,yi];var A=W(g,2),D=Z(A),H=Z(D);{var j=be=>{var X=xo();X.__click=yi;var wn=Z(X);{var Yt=Et=>{Bn(Et,()=>20)},ma=(Et,pa)=>{{var ba=Ct=>{var Kn=Co();B(Ct,Kn)},ya=(Ct,Kn)=>{{var wa=At=>{var Xn=Ao();B(At,Xn)},Ea=At=>{var Xn=Io();B(At,Xn)};J(Ct,At=>{l(K)===z.PLAYING?At(wa):At(Ea,!1)},Kn)}};J(Et,Ct=>{l(K)===z.ERROR?Ct(ba):Ct(ya,!1)},pa)}};J(wn,Et=>{l(K)===z.LOADING?Et(Yt):Et(ma,!1)})}G(X),we(()=>{$(X,"title",l(O).getAudioChallenge),X.disabled=l(K)===z.LOADING||l(K)===z.ERROR||l(it),$(X,"aria-label",l(K)===z.LOADING?l(O).loading:l(O).getAudioChallenge)}),B(be,X)};J(H,be=>{l(Y).challenge.codeChallenge.audio&&be(j)})}var oe=W(H,2);oe.__click=[po,Ne],G(D);var ae=W(D,2),at=Z(ae);{var wt=be=>{Bn(be,()=>16)};J(at,be=>{l(it)&&be(wt)})}var st=W(at);G(ae),G(A);var ga=W(A,2);{var _a=be=>{var X=Ro(),wn=Z(X);G(X),fn(X,Yt=>b(je,Yt),()=>l(je)),we(Yt=>$(wn,"src",Yt),[()=>vi(l(Y).challenge.codeChallenge.audio,{language:hn()})]),Me("loadstart",X,Zo),Me("canplay",X,Go),Me("pause",X,Jo),Me("playing",X,Wo),Me("ended",X,Ho),Me("error",wn,Yo),B(be,X)};J(ga,be=>{l(Y).challenge.codeChallenge.audio&&l(Gn)&&be(_a)})}G(v),G(u),we(()=>{$(u,"aria-label",l(O).verificationRequired),$(_,"src",l(Y).challenge.codeChallenge.image),$(g,"minlength",l(Y).challenge.codeChallenge.length||1),$(g,"maxlength",l(Y).challenge.codeChallenge.length),$(g,"placeholder",l(O).enterCode),$(g,"aria-label",l(K)===z.LOADING?l(O).loading:l(K)===z.PLAYING?"":l(O).enterCodeAria),$(g,"aria-live",l(K)?"assertive":"polite"),$(g,"aria-busy",l(K)===z.LOADING),g.disabled=l(it),$(oe,"aria-label",l(O).reload),$(oe,"title",l(O).reload),oe.disabled=l(it),ae.disabled=l(it),$(ae,"aria-label",l(O).verify),Bl(st,` ${l(O).verify??""}`)}),Me("submit",v,Ko,!0),B(r,u)};J(sa,r=>{l(Y)?.challenge.codeChallenge&&r(ua)})}G(Jn);var qi=W(Jn,2);{var fa=r=>{var u=To(),v=W(Z(u),2);{var _=A=>{var D=ko(),H=Z(D);Xe(H,()=>l(O).expired),G(D),we(()=>$(D,"title",l(rt))),B(A,D)},g=A=>{var D=So(),H=Z(D);Xe(H,()=>l(O).error),G(D),we(()=>$(D,"title",l(rt))),B(A,D)};J(v,A=>{l(I)===y.EXPIRED?A(_):A(g,!1)})}G(u),B(r,u)};J(qi,r=>{(l(rt)||l(I)===y.EXPIRED)&&r(fa)})}var ji=W(qi,2);{var ca=r=>{var u=No(),v=Z(u),_=Z(v);Xe(_,()=>l(O).footer),G(v),G(u),B(r,u)};J(ji,r=>{l(O).footer&&(q()!==!0||l(Hn))&&r(ca)})}var da=W(ji,2);{var va=r=>{var u=Do();fn(u,v=>b(Ut,v),()=>l(Ut)),B(r,u)};J(da,r=>{R()&&r(va)})}G(yt),fn(yt,r=>b(M,r),()=>l(M)),we(r=>{$(yt,"data-state",l(I)),$(yt,"data-floating",R()),$(yt,"data-overlay",pe()),Fi=Wl(bn,1,"altcha-checkbox",null,Fi,r),$(ot,"id",l(ui)),ot.required=o()!=="onsubmit"&&(!R()||o()!=="off"),$(yn,"for",l(ui))},[()=>({"altcha-checkbox-verifying":l(I)===y.VERIFYING})]),Me("invalid",ot,bi),Ql(ot,()=>l(Mt),r=>b(Mt,r)),B(e,Pi);var ha=Ur({clarify:jt,configure:Si,getConfiguration:Ti,getFloatingAnchor:Ni,getPlugin:ta,getState:Di,hide:Bt,repositionFloating:Ht,reset:lt,setFloatingAnchor:Li,setState:$e,show:pn,verify:Ne,get auto(){return o()},set auto(r=void 0){o(r),E()},get blockspam(){return s()},set blockspam(r=void 0){s(r),E()},get challengeurl(){return f()},set challengeurl(r=void 0){f(r),E()},get challengejson(){return c()},set challengejson(r=void 0){c(r),E()},get credentials(){return d()},set credentials(r=void 0){d(r),E()},get customfetch(){return m()},set customfetch(r=void 0){m(r),E()},get debug(){return h()},set debug(r=!1){h(r),E()},get delay(){return p()},set delay(r=0){p(r),E()},get disableautofocus(){return w()},set disableautofocus(r=!1){w(r),E()},get refetchonexpire(){return F()},set refetchonexpire(r=!0){F(r),E()},get disablerefetchonexpire(){return V()},set disablerefetchonexpire(r=!F){V(r),E()},get expire(){return U()},set expire(r=void 0){U(r),E()},get floating(){return R()},set floating(r=void 0){R(r),E()},get floatinganchor(){return ne()},set floatinganchor(r=void 0){ne(r),E()},get floatingoffset(){return Te()},set floatingoffset(r=void 0){Te(r),E()},get floatingpersist(){return Q()},set floatingpersist(r=!1){Q(r),E()},get hidefooter(){return q()},set hidefooter(r=!1){q(r),E()},get hidelogo(){return fe()},set hidelogo(r=!1){fe(r),E()},get id(){return ze()},set id(r=void 0){ze(r),E()},get language(){return hn()},set language(r=void 0){hn(r),E()},get name(){return Qe()},set name(r="altcha"){Qe(r),E()},get maxnumber(){return et()},set maxnumber(r=1e6){et(r),E()},get mockerror(){return Ot()},set mockerror(r=!1){Ot(r),E()},get obfuscated(){return Ue()},set obfuscated(r=void 0){Ue(r),E()},get overlay(){return pe()},set overlay(r=void 0){pe(r),E()},get overlaycontent(){return Ft()},set overlaycontent(r=void 0){Ft(r),E()},get plugins(){return gn()},set plugins(r=void 0){gn(r),E()},get sentinel(){return tt()},set sentinel(r=void 0){tt(r),E()},get spamfilter(){return Ie()},set spamfilter(r=!1){Ie(r),E()},get strings(){return mt()},set strings(r=void 0){mt(r),E()},get test(){return he()},set test(r=!1){he(r),E()},get verifyurl(){return re()},set verifyurl(r=void 0){re(r),E()},get workers(){return pt()},set workers(r=Math.min(16,navigator.hardwareConcurrency||8)){pt(r),E()},get workerurl(){return Vt()},set workerurl(r=void 0){Vt(r),E()}});return i(),ha}jl(["change","keydown","click"]),customElements.define("altcha-widget",so(oi,{blockspam:{type:"Boolean"},debug:{type:"Boolean"},delay:{type:"Number"},disableautofocus:{type:"Boolean"},disablerefetchonexpire:{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:He&&He.tagName.toUpperCase()==="SCRIPT"&&He.src||new URL("altcha.umd.cjs",document.baseURI).href)),ut.Altcha=oi,Object.defineProperty(ut,Symbol.toStringTag,{value:"Module"})});
@@ -1 +1 @@
1
- (function(){"use strict";const d=new TextEncoder;function p(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function b(e,t,r){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 p(await crypto.subtle.digest(r.toUpperCase(),d.encode(e+t)))}function w(e,t,r="SHA-256",n=1e6,s=0){const o=new AbortController,a=Date.now();return{promise:(async()=>{for(let c=s;c<=n;c+=1){if(o.signal.aborted)return null;if(await b(t,c,r)===e)return{number:c,took:Date.now()-a}}return null})(),controller:o}}function h(e){const t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function g(e,t=12){const r=new Uint8Array(t);for(let n=0;n<t;n++)r[n]=e%256,e=Math.floor(e/256);return r}async function m(e,t="",r=1e6,n=0){const s="AES-GCM",o=new AbortController,a=Date.now(),l=async()=>{for(let u=n;u<=r;u+=1){if(o.signal.aborted||!c||!y)return null;try{const f=await crypto.subtle.decrypt({name:s,iv:g(u)},c,y);if(f)return{clearText:new TextDecoder().decode(f),took:Date.now()-a}}catch{}}return null};let c=null,y=null;try{y=h(e);const u=await crypto.subtle.digest("SHA-256",d.encode(t));c=await crypto.subtle.importKey("raw",u,s,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:o}}return{promise:l(),controller:o}}let i;onmessage=async e=>{const{type:t,payload:r,start:n,max:s}=e.data;let o=null;if(t==="abort")i==null||i.abort(),i=void 0;else if(t==="work"){if("obfuscated"in r){const{key:a,obfuscated:l}=r||{};o=await m(l,a,s,n)}else{const{algorithm:a,challenge:l,salt:c}=r||{};o=w(l,c,a,s,n)}i=o.controller,o.promise.then(a=>{self.postMessage(a&&{...a,worker:!0})})}}})();
1
+ (function(){"use strict";const d=new TextEncoder;function p(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function b(e,t,r){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 p(await crypto.subtle.digest(r.toUpperCase(),d.encode(e+t)))}function w(e,t,r="SHA-256",n=1e6,l=0){const o=new AbortController,a=Date.now();return{promise:(async()=>{for(let c=l;c<=n;c+=1){if(o.signal.aborted)return null;if(await b(t,c,r)===e)return{number:c,took:Date.now()-a}}return null})(),controller:o}}function h(e){const t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function g(e,t=12){const r=new Uint8Array(t);for(let n=0;n<t;n++)r[n]=e%256,e=Math.floor(e/256);return r}async function m(e,t="",r=1e6,n=0){const l="AES-GCM",o=new AbortController,a=Date.now(),s=async()=>{for(let i=n;i<=r;i+=1){if(o.signal.aborted||!c||!u)return null;try{const f=await crypto.subtle.decrypt({name:l,iv:g(i)},c,u);if(f)return{clearText:new TextDecoder().decode(f),took:Date.now()-a}}catch{}}return null};let c=null,u=null;try{u=h(e);const i=await crypto.subtle.digest("SHA-256",d.encode(t));c=await crypto.subtle.importKey("raw",i,l,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:o}}return{promise:s(),controller:o}}let y;onmessage=async e=>{const{type:t,payload:r,start:n,max:l}=e.data;let o=null;if(t==="abort")y?.abort(),y=void 0;else if(t==="work"){if("obfuscated"in r){const{key:a,obfuscated:s}=r||{};o=await m(s,a,l,n)}else{const{algorithm:a,challenge:s,salt:c}=r||{};o=w(s,c,a,l,n)}y=o.controller,o.promise.then(a=>{self.postMessage(a&&{...a,worker:!0})})}}})();
@@ -1,18 +1,11 @@
1
- var y = Object.defineProperty;
2
- var p = (s) => {
3
- throw TypeError(s);
4
- };
5
- var C = (s, t, e) => t in s ? y(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
6
- var l = (s, t, e) => C(s, typeof t != "symbol" ? t + "" : t, e), F = (s, t, e) => t.has(s) || p("Cannot " + e);
7
- var i = (s, t, e) => (F(s, t, "read from private field"), e ? e.call(s) : t.get(s)), r = (s, t, e) => t.has(s) ? p("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), T = (s, t, e, n) => (F(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), E = (s, t, e) => (F(s, t, "access private method"), e);
8
1
  new TextEncoder();
9
- function L() {
2
+ function r() {
10
3
  try {
11
4
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
12
5
  } catch {
13
6
  }
14
7
  }
15
- class v {
8
+ class n {
16
9
  /**
17
10
  * Constructs a new instance of the Plugin.
18
11
  *
@@ -21,6 +14,10 @@ class v {
21
14
  constructor(t) {
22
15
  this.context = t;
23
16
  }
17
+ /**
18
+ * A distinct name of the plugin. Every plugin must have it's own name.
19
+ */
20
+ static pluginName;
24
21
  /**
25
22
  * Registers a plugin class in the global `altchaPlugins` array.
26
23
  * Ensures the plugin is added only once.
@@ -53,64 +50,54 @@ class v {
53
50
  onStateChange(t) {
54
51
  }
55
52
  }
56
- /**
57
- * A distinct name of the plugin. Every plugin must have it's own name.
58
- */
59
- l(v, "pluginName");
60
- var o, a, m, f, w;
61
- class A extends v {
53
+ class a extends n {
54
+ static pluginName = "analytics";
55
+ // HTML form element associated with the plugin
56
+ #t;
57
+ // Session instance for tracking analytics data
58
+ #e;
59
+ // Bound method for form submission handling
60
+ #i = this.#s.bind(this);
62
61
  /**
63
62
  * Creates an instance of PluginAnalytics.
64
63
  *
65
64
  * @param {PluginContext} context - The context object containing plugin configurations.
66
65
  */
67
- constructor(e) {
68
- super(e);
69
- r(this, f);
70
- // HTML form element associated with the plugin
71
- r(this, o);
72
- // Session instance for tracking analytics data
73
- r(this, a);
74
- // Bound method for form submission handling
75
- r(this, m, E(this, f, w).bind(this));
76
- if (T(this, o, this.context.el.closest("form")), i(this, o)) {
77
- let n = i(this, o).getAttribute("data-beacon-url");
78
- const h = i(this, o).getAttribute("action");
79
- !n && h && (n = h + "/beacon"), i(this, o).addEventListener("submit", i(this, m)), T(this, a, new N(i(this, o), n));
66
+ constructor(t) {
67
+ if (super(t), this.#t = this.context.el.closest("form"), this.#t) {
68
+ let e = this.#t.getAttribute("data-beacon-url");
69
+ const i = this.#t.getAttribute("action");
70
+ !e && i && (e = i + "/beacon"), this.#t.addEventListener("submit", this.#i), this.#e = new h(this.#t, e);
80
71
  }
81
72
  }
82
73
  /**
83
74
  * Destroys the plugin instance, removing event listeners and cleaning up the session.
84
75
  */
85
76
  destroy() {
86
- var e, n;
87
- (e = i(this, o)) == null || e.removeEventListener("submit", i(this, m)), (n = i(this, a)) == null || n.destroy();
77
+ this.#t?.removeEventListener("submit", this.#i), this.#e?.destroy();
88
78
  }
89
79
  /**
90
80
  * Tracks errors by forwarding them to the session instance.
91
81
  *
92
82
  * @param {string | null} err - The error message, or `null` if no error exists.
93
83
  */
94
- onErrorChange(e) {
95
- var n;
96
- (n = i(this, a)) == null || n.trackError(e);
84
+ onErrorChange(t) {
85
+ this.#e?.trackError(t);
86
+ }
87
+ /**
88
+ * Handles form submission events, appending session data to the form if applicable.
89
+ */
90
+ #s() {
91
+ if (this.#e && !this.#e.submitTime) {
92
+ this.#e.end();
93
+ const t = this.#e.dataAsBase64();
94
+ this.context.dispatch("session", t);
95
+ const e = document.createElement("input");
96
+ e.type = "hidden", e.name = "__session", e.value = t, this.#t?.appendChild(e);
97
+ }
97
98
  }
98
99
  }
99
- o = new WeakMap(), a = new WeakMap(), m = new WeakMap(), f = new WeakSet(), /**
100
- * Handles form submission events, appending session data to the form if applicable.
101
- */
102
- w = function() {
103
- var e;
104
- if (i(this, a) && !i(this, a).submitTime) {
105
- i(this, a).end();
106
- const n = i(this, a).dataAsBase64();
107
- this.context.dispatch("session", n);
108
- const h = document.createElement("input");
109
- h.type = "hidden", h.name = "__session", h.value = n, (e = i(this, o)) == null || e.appendChild(h);
110
- }
111
- }, l(A, "pluginName", "analytics");
112
- var c, u, d, g, b;
113
- class N {
100
+ class h {
114
101
  /**
115
102
  * Creates a new Session instance.
116
103
  *
@@ -118,43 +105,43 @@ class N {
118
105
  * @param {string | null} [beaconUrl=null] - The URL to send analytics data to.
119
106
  */
120
107
  constructor(t, e = null) {
121
- // Error message associated with the session
122
- l(this, "error", null);
123
- // Timestamp when the form was loaded
124
- l(this, "loadTime", Date.now());
125
- // Timestamp when the form was submitted
126
- l(this, "submitTime", null);
127
- // Timestamp when the user started interacting with the form
128
- l(this, "startTime", null);
129
- // Minimum time in milliseconds required to consider the form "viewed"
130
- l(this, "viewTimeThresholdMs", 1500);
131
- // Tracks the number of changes made to each form field
132
- r(this, c, {});
133
- // Name of the last input field focused by the user
134
- r(this, u, null);
135
- // Bound method for handling form change events
136
- r(this, d, this.onFormChange.bind(this));
137
- // Bound method for handling form focus events
138
- r(this, g, this.onFormFocus.bind(this));
139
- // Bound method for handling the unload event
140
- r(this, b, this.onUnload.bind(this));
141
- this.elForm = t, this.beaconUrl = e, window.addEventListener("unload", i(this, b)), this.elForm.addEventListener("change", i(this, d)), this.elForm.addEventListener("focusin", i(this, g));
108
+ this.elForm = t, this.beaconUrl = e, window.addEventListener("unload", this.#n), this.elForm.addEventListener("change", this.#i), this.elForm.addEventListener("focusin", this.#s);
142
109
  }
110
+ // Error message associated with the session
111
+ error = null;
112
+ // Timestamp when the form was loaded
113
+ loadTime = Date.now();
114
+ // Timestamp when the form was submitted
115
+ submitTime = null;
116
+ // Timestamp when the user started interacting with the form
117
+ startTime = null;
118
+ // Minimum time in milliseconds required to consider the form "viewed"
119
+ viewTimeThresholdMs = 1500;
120
+ // Tracks the number of changes made to each form field
121
+ #t = {};
122
+ // Name of the last input field focused by the user
123
+ #e = null;
124
+ // Bound method for handling form change events
125
+ #i = this.onFormChange.bind(this);
126
+ // Bound method for handling form focus events
127
+ #s = this.onFormFocus.bind(this);
128
+ // Bound method for handling the unload event
129
+ #n = this.onUnload.bind(this);
143
130
  /**
144
131
  * Collects and returns analytics data about the form interaction.
145
132
  *
146
133
  * @returns {Record<string, unknown>} - An object containing analytics data.
147
134
  */
148
135
  data() {
149
- const t = Object.entries(i(this, c));
136
+ const t = Object.entries(this.#t);
150
137
  return {
151
- correction: t.length && t.filter(([e, n]) => n > 1).length / t.length || 0,
152
- dropoff: !this.submitTime && !this.error && i(this, u) ? i(this, u) : null,
138
+ correction: t.length && t.filter(([e, i]) => i > 1).length / t.length || 0,
139
+ dropoff: !this.submitTime && !this.error && this.#e ? this.#e : null,
153
140
  error: this.error,
154
141
  mobile: this.isMobile(),
155
142
  start: this.startTime,
156
143
  submit: this.submitTime,
157
- tz: L()
144
+ tz: r()
158
145
  };
159
146
  }
160
147
  /**
@@ -174,7 +161,7 @@ class N {
174
161
  * Destroys the session, removing event listeners.
175
162
  */
176
163
  destroy() {
177
- window.removeEventListener("unload", i(this, b)), this.elForm.removeEventListener("change", i(this, d)), this.elForm.removeEventListener("focusin", i(this, g));
164
+ window.removeEventListener("unload", this.#n), this.elForm.removeEventListener("change", this.#i), this.elForm.removeEventListener("focusin", this.#s);
178
165
  }
179
166
  /**
180
167
  * Marks the session as ended by recording the submission time.
@@ -190,8 +177,8 @@ class N {
190
177
  * @returns {string} - The field name, truncated to `maxLength` if necessary.
191
178
  */
192
179
  getFieldName(t, e = 40) {
193
- const n = t.getAttribute("data-group-label"), h = t.getAttribute("name") || t.getAttribute("aria-label");
194
- return ((n ? n + ": " : "") + h).slice(0, e);
180
+ const i = t.getAttribute("data-group-label"), o = t.getAttribute("name") || t.getAttribute("aria-label");
181
+ return ((i ? i + ": " : "") + o).slice(0, e);
195
182
  }
196
183
  /**
197
184
  * Determines if the current device is a mobile device.
@@ -237,8 +224,8 @@ class N {
237
224
  onFormFocus(t) {
238
225
  const e = t.target;
239
226
  if (this.startTime || this.start(), e && this.isInput(e)) {
240
- const n = this.getFieldName(e);
241
- n && T(this, u, n);
227
+ const i = this.getFieldName(e);
228
+ i && (this.#e = i);
242
229
  }
243
230
  }
244
231
  /**
@@ -280,11 +267,10 @@ class N {
280
267
  * @param {string} name - The name of the form field.
281
268
  */
282
269
  trackFieldChange(t) {
283
- i(this, c)[t] = (i(this, c)[t] || 0) + 1;
270
+ this.#t[t] = (this.#t[t] || 0) + 1;
284
271
  }
285
272
  }
286
- c = new WeakMap(), u = new WeakMap(), d = new WeakMap(), g = new WeakMap(), b = new WeakMap();
287
- v.register(A);
273
+ n.register(a);
288
274
  export {
289
- A as PluginAnalytics
275
+ a as PluginAnalytics
290
276
  };
@@ -1 +1 @@
1
- (function(e,i){typeof exports=="object"&&typeof module<"u"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(e=typeof globalThis<"u"?globalThis:e||self,i(e["[name]"]={}))})(this,function(e){"use strict";var N=Object.defineProperty;var A=e=>{throw TypeError(e)};var S=(e,i,o)=>i in e?N(e,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[i]=o;var c=(e,i,o)=>S(e,typeof i!="symbol"?i+"":i,o),y=(e,i,o)=>i.has(e)||A("Cannot "+o);var s=(e,i,o)=>(y(e,i,"read from private field"),o?o.call(e):i.get(e)),l=(e,i,o)=>i.has(e)?A("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,o),v=(e,i,o,d)=>(y(e,i,"write to private field"),d?d.call(e,o):i.set(e,o),o),w=(e,i,o)=>(y(e,i,"access private method"),o);var a,h,b,F,C,m,g,f,T,p;new TextEncoder;function i(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}class o{constructor(t){this.context=t}static register(t){typeof globalThis.altchaPlugins!="object"&&(globalThis.altchaPlugins=[]),globalThis.altchaPlugins.includes(t)||globalThis.altchaPlugins.push(t)}destroy(){}onErrorChange(t){}onStateChange(t){}}c(o,"pluginName");class d extends o{constructor(n){super(n);l(this,F);l(this,a);l(this,h);l(this,b,w(this,F,C).bind(this));if(v(this,a,this.context.el.closest("form")),s(this,a)){let r=s(this,a).getAttribute("data-beacon-url");const u=s(this,a).getAttribute("action");!r&&u&&(r=u+"/beacon"),s(this,a).addEventListener("submit",s(this,b)),v(this,h,new L(s(this,a),r))}}destroy(){var n,r;(n=s(this,a))==null||n.removeEventListener("submit",s(this,b)),(r=s(this,h))==null||r.destroy()}onErrorChange(n){var r;(r=s(this,h))==null||r.trackError(n)}}a=new WeakMap,h=new WeakMap,b=new WeakMap,F=new WeakSet,C=function(){var n;if(s(this,h)&&!s(this,h).submitTime){s(this,h).end();const r=s(this,h).dataAsBase64();this.context.dispatch("session",r);const u=document.createElement("input");u.type="hidden",u.name="__session",u.value=r,(n=s(this,a))==null||n.appendChild(u)}},c(d,"pluginName","analytics");class L{constructor(t,n=null){c(this,"error",null);c(this,"loadTime",Date.now());c(this,"submitTime",null);c(this,"startTime",null);c(this,"viewTimeThresholdMs",1500);l(this,m,{});l(this,g,null);l(this,f,this.onFormChange.bind(this));l(this,T,this.onFormFocus.bind(this));l(this,p,this.onUnload.bind(this));this.elForm=t,this.beaconUrl=n,window.addEventListener("unload",s(this,p)),this.elForm.addEventListener("change",s(this,f)),this.elForm.addEventListener("focusin",s(this,T))}data(){const t=Object.entries(s(this,m));return{correction:t.length&&t.filter(([n,r])=>r>1).length/t.length||0,dropoff:!this.submitTime&&!this.error&&s(this,g)?s(this,g):null,error:this.error,mobile:this.isMobile(),start:this.startTime,submit:this.submitTime,tz:i()}}dataAsBase64(){try{return btoa(JSON.stringify(this.data()))}catch(t){console.error("failed to encode ALTCHA session data to base64",t)}return""}destroy(){window.removeEventListener("unload",s(this,p)),this.elForm.removeEventListener("change",s(this,f)),this.elForm.removeEventListener("focusin",s(this,T))}end(){this.submitTime||(this.submitTime=Date.now())}getFieldName(t,n=40){const r=t.getAttribute("data-group-label"),u=t.getAttribute("name")||t.getAttribute("aria-label");return((r?r+": ":"")+u).slice(0,n)}isMobile(){const t="userAgentData"in navigator&&navigator.userAgentData?navigator.userAgentData:{};return"mobile"in t?t.mobile===!0:/Mobi/i.test(window.navigator.userAgent)}isInput(t){return["INPUT","SELECT","TEXTAREA"].includes(t.tagName)}onFormFieldChange(t){const n=this.getFieldName(t);n&&this.trackFieldChange(n)}onFormChange(t){const n=t.target;n&&this.isInput(n)&&this.onFormFieldChange(n)}onFormFocus(t){const n=t.target;if(this.startTime||this.start(),n&&this.isInput(n)){const r=this.getFieldName(n);r&&v(this,g,r)}}onUnload(){this.loadTime<=Date.now()-this.viewTimeThresholdMs&&!this.submitTime&&this.sendBeacon()}async sendBeacon(){if(this.beaconUrl&&"sendBeacon"in navigator)try{navigator.sendBeacon(new URL(this.beaconUrl,location.origin),JSON.stringify(this.data()))}catch{}}start(){this.startTime=Date.now()}trackError(t){this.error=t===null?null:String(t)}trackFieldChange(t){s(this,m)[t]=(s(this,m)[t]||0)+1}}m=new WeakMap,g=new WeakMap,f=new WeakMap,T=new WeakMap,p=new WeakMap,o.register(d),e.PluginAnalytics=d,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
1
+ (function(s,n){typeof exports=="object"&&typeof module<"u"?n(exports):typeof define=="function"&&define.amd?define(["exports"],n):(s=typeof globalThis<"u"?globalThis:s||self,n(s["[name]"]={}))})(this,function(s){"use strict";new TextEncoder;function n(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}class o{constructor(t){this.context=t}static pluginName;static register(t){typeof globalThis.altchaPlugins!="object"&&(globalThis.altchaPlugins=[]),globalThis.altchaPlugins.includes(t)||globalThis.altchaPlugins.push(t)}destroy(){}onErrorChange(t){}onStateChange(t){}}class r extends o{static pluginName="analytics";#t;#e;#i=this.#s.bind(this);constructor(t){if(super(t),this.#t=this.context.el.closest("form"),this.#t){let e=this.#t.getAttribute("data-beacon-url");const i=this.#t.getAttribute("action");!e&&i&&(e=i+"/beacon"),this.#t.addEventListener("submit",this.#i),this.#e=new h(this.#t,e)}}destroy(){this.#t?.removeEventListener("submit",this.#i),this.#e?.destroy()}onErrorChange(t){this.#e?.trackError(t)}#s(){if(this.#e&&!this.#e.submitTime){this.#e.end();const t=this.#e.dataAsBase64();this.context.dispatch("session",t);const e=document.createElement("input");e.type="hidden",e.name="__session",e.value=t,this.#t?.appendChild(e)}}}class h{constructor(t,e=null){this.elForm=t,this.beaconUrl=e,window.addEventListener("unload",this.#n),this.elForm.addEventListener("change",this.#i),this.elForm.addEventListener("focusin",this.#s)}error=null;loadTime=Date.now();submitTime=null;startTime=null;viewTimeThresholdMs=1500;#t={};#e=null;#i=this.onFormChange.bind(this);#s=this.onFormFocus.bind(this);#n=this.onUnload.bind(this);data(){const t=Object.entries(this.#t);return{correction:t.length&&t.filter(([e,i])=>i>1).length/t.length||0,dropoff:!this.submitTime&&!this.error&&this.#e?this.#e:null,error:this.error,mobile:this.isMobile(),start:this.startTime,submit:this.submitTime,tz:n()}}dataAsBase64(){try{return btoa(JSON.stringify(this.data()))}catch(t){console.error("failed to encode ALTCHA session data to base64",t)}return""}destroy(){window.removeEventListener("unload",this.#n),this.elForm.removeEventListener("change",this.#i),this.elForm.removeEventListener("focusin",this.#s)}end(){this.submitTime||(this.submitTime=Date.now())}getFieldName(t,e=40){const i=t.getAttribute("data-group-label"),l=t.getAttribute("name")||t.getAttribute("aria-label");return((i?i+": ":"")+l).slice(0,e)}isMobile(){const t="userAgentData"in navigator&&navigator.userAgentData?navigator.userAgentData:{};return"mobile"in t?t.mobile===!0:/Mobi/i.test(window.navigator.userAgent)}isInput(t){return["INPUT","SELECT","TEXTAREA"].includes(t.tagName)}onFormFieldChange(t){const e=this.getFieldName(t);e&&this.trackFieldChange(e)}onFormChange(t){const e=t.target;e&&this.isInput(e)&&this.onFormFieldChange(e)}onFormFocus(t){const e=t.target;if(this.startTime||this.start(),e&&this.isInput(e)){const i=this.getFieldName(e);i&&(this.#e=i)}}onUnload(){this.loadTime<=Date.now()-this.viewTimeThresholdMs&&!this.submitTime&&this.sendBeacon()}async sendBeacon(){if(this.beaconUrl&&"sendBeacon"in navigator)try{navigator.sendBeacon(new URL(this.beaconUrl,location.origin),JSON.stringify(this.data()))}catch{}}start(){this.startTime=Date.now()}trackError(t){this.error=t===null?null:String(t)}trackFieldChange(t){this.#t[t]=(this.#t[t]||0)+1}}o.register(r),s.PluginAnalytics=r,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});