altcha 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -8
- package/dist/altcha.d.ts +4 -0
- package/dist/altcha.js +926 -907
- package/dist/altcha.umd.cjs +5 -5
- package/dist_external/altcha.d.ts +4 -0
- package/dist_external/altcha.js +950 -931
- package/dist_external/altcha.umd.cjs +4 -4
- package/package.json +2 -1
package/dist/altcha.umd.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
`,j=typeof self<"u"&&self.Blob&&new Blob([A],{type:"text/javascript;charset=utf-8"});function wt(e){let t;try{if(t=j&&(self.URL||self.webkitURL).createObjectURL(j),!t)throw"";const r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(A),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}const Zn="5";typeof window<"u"&&((dn=window.__svelte??(window.__svelte={})).v??(dn.v=new Set)).add(Zn);const Gn=1,Jn=4,Kn=8,Xn=16,Qn=1,ei=2,Ft="[",or="[!",sr="]",Ve={},Y=Symbol(),ti="http://www.w3.org/1999/xhtml",fr=!1,ae=2,ur=4,pt=8,Mt=16,me=32,Pe=64,yt=128,te=256,bt=512,J=1024,we=2048,Be=4096,qe=8192,Et=16384,ri=32768,Ut=65536,ni=1<<19,cr=1<<20,it=Symbol("$state"),dr=Symbol("legacy props"),ii=Symbol("");var vr=Array.isArray,li=Array.prototype.indexOf,ai=Array.from,xt=Object.keys,$t=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,oi=Object.getOwnPropertyDescriptors,si=Object.prototype,fi=Array.prototype,hr=Object.getPrototypeOf;function gr(e){for(var t=0;t<e.length;t++)e[t]()}const ui=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let lt=[],at=[];function _r(){var e=lt;lt=[],gr(e)}function mr(){var e=at;at=[],gr(e)}function jt(e){lt.length===0&&queueMicrotask(_r),lt.push(e)}function ci(e){at.length===0&&ui(mr),at.push(e)}function wr(){lt.length>0&&_r(),at.length>0&&mr()}function pr(e){return e===this.v}function di(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function yr(e){return!di(e,this.v)}function vi(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function hi(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function gi(e){throw new Error("https://svelte.dev/e/effect_orphan")}function _i(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function mi(){throw new Error("https://svelte.dev/e/hydration_failed")}function wi(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function pi(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function yi(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function bi(){throw new Error("https://svelte.dev/e/state_unsafe_local_read")}function Ei(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}let xi=!1;function ce(e,t){var r={f:0,v:e,reactions:null,equals:pr,rv:0,wv:0};return r}function He(e){return $i(ce(e))}function br(e,t=!1){const r=ce(e);return t||(r.equals=yr),r}function $i(e){return k!==null&&!se&&(k.f&ae)!==0&&(de===null?Ii([e]):de.push(e)),e}function z(e,t){return k!==null&&!se&&Yr()&&(k.f&(ae|Mt))!==0&&(de===null||!de.includes(e))&&Ei(),ki(e,t)}function ki(e,t){return e.equals(t)||(e.v,e.v=t,e.wv=Lr(),Er(e,we),R!==null&&(R.f&J)!==0&&(R.f&(me|Pe))===0&&(be===null?Ti([e]):be.push(e))),t}function Er(e,t){var r=e.reactions;if(r!==null)for(var l=r.length,i=0;i<l;i++){var a=r[i],o=a.f;(o&we)===0&&(ve(a,t),(o&(J|te))!==0&&((o&ae)!==0?Er(a,Be):Nt(a)))}}function ze(e){var t=ae|we,r=k!==null&&(k.f&ae)!==0?k:null;return R===null||r!==null&&(r.f&te)!==0?t|=te:R.f|=cr,{ctx:H,deps:null,effects:null,equals:pr,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:r??R}}function xr(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)Ee(t[r])}}function Ci(e){for(var t=e.parent;t!==null;){if((t.f&ae)===0)return t;t=t.parent}return null}function Ai(e){var t,r=R;Ae(Ci(e));try{xr(e),t=Pr(e)}finally{Ae(r)}return t}function $r(e){var t=Ai(e),r=(Re||(e.f&te)!==0)&&e.deps!==null?Be:J;ve(e,r),e.equals(t)||(e.v=t,e.wv=Lr())}function kt(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let P=!1;function We(e){P=e}let F;function $e(e){if(e===null)throw kt(),Ve;return F=e}function Ye(){return $e(ke(F))}function K(e){if(P){if(ke(F)!==null)throw kt(),Ve;F=e}}function Ri(){for(var e=0,t=F;;){if(t.nodeType===8){var r=t.data;if(r===sr){if(e===0)return t;e-=1}else(r===Ft||r===or)&&(e+=1)}var l=ke(t);t.remove(),t=l}}function oe(e,t=null,r){if(typeof e!="object"||e===null||it in e)return e;const l=hr(e);if(l!==si&&l!==fi)return e;var i=new Map,a=vr(e),o=ce(0);a&&i.set("length",ce(e.length));var f;return new Proxy(e,{defineProperty(s,c,v){(!("value"in v)||v.configurable===!1||v.enumerable===!1||v.writable===!1)&&pi();var h=i.get(c);return h===void 0?(h=ce(v.value),i.set(c,h)):z(h,oe(v.value,f)),!0},deleteProperty(s,c){var v=i.get(c);if(v===void 0)c in s&&i.set(c,ce(Y));else{if(a&&typeof c=="string"){var h=i.get("length"),g=Number(c);Number.isInteger(g)&&g<h.v&&z(h,g)}z(v,Y),kr(o)}return!0},get(s,c,v){var w;if(c===it)return e;var h=i.get(c),g=c in s;if(h===void 0&&(!g||(w=Oe(s,c))!=null&&w.writable)&&(h=ce(oe(g?s[c]:Y,f)),i.set(c,h)),h!==void 0){var m=d(h);return m===Y?void 0:m}return Reflect.get(s,c,v)},getOwnPropertyDescriptor(s,c){var v=Reflect.getOwnPropertyDescriptor(s,c);if(v&&"value"in v){var h=i.get(c);h&&(v.value=d(h))}else if(v===void 0){var g=i.get(c),m=g==null?void 0:g.v;if(g!==void 0&&m!==Y)return{enumerable:!0,configurable:!0,value:m,writable:!0}}return v},has(s,c){var m;if(c===it)return!0;var v=i.get(c),h=v!==void 0&&v.v!==Y||Reflect.has(s,c);if(v!==void 0||R!==null&&(!h||(m=Oe(s,c))!=null&&m.writable)){v===void 0&&(v=ce(h?oe(s[c],f):Y),i.set(c,v));var g=d(v);if(g===Y)return!1}return h},set(s,c,v,h){var U;var g=i.get(c),m=c in s;if(a&&c==="length")for(var w=v;w<g.v;w+=1){var M=i.get(w+"");M!==void 0?z(M,Y):w in s&&(M=ce(Y),i.set(w+"",M))}g===void 0?(!m||(U=Oe(s,c))!=null&&U.writable)&&(g=ce(void 0),z(g,oe(v,f)),i.set(c,g)):(m=g.v!==Y,z(g,oe(v,f)));var L=Reflect.getOwnPropertyDescriptor(s,c);if(L!=null&&L.set&&L.set.call(h,v),!m){if(a&&typeof c=="string"){var ee=i.get("length"),V=Number(c);Number.isInteger(V)&&V>=ee.v&&z(ee,V+1)}kr(o)}return!0},ownKeys(s){d(o);var c=Reflect.ownKeys(s).filter(g=>{var m=i.get(g);return m===void 0||m.v!==Y});for(var[v,h]of i)h.v!==Y&&!(v in s)&&c.push(v);return c},setPrototypeOf(){yi()}})}function kr(e,t=1){z(e,e.v+t)}var Cr,Ar,Rr,Sr;function Vt(){if(Cr===void 0){Cr=window,Ar=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype;Rr=Oe(t,"firstChild").get,Sr=Oe(t,"nextSibling").get,e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0,Text.prototype.__t=void 0}}function Bt(e=""){return document.createTextNode(e)}function pe(e){return Rr.call(e)}function ke(e){return Sr.call(e)}function X(e,t){if(!P)return pe(e);var r=pe(F);return r===null&&(r=F.appendChild(Bt())),$e(r),r}function Ir(e,t){if(!P){var r=pe(e);return r instanceof Comment&&r.data===""?ke(r):r}return F}function ye(e,t=1,r=!1){let l=P?F:e;for(var i;t--;)i=l,l=ke(l);if(!P)return l;var a=l==null?void 0:l.nodeType;if(r&&a!==3){var o=Bt();return l===null?i==null||i.after(o):l.before(o),$e(o),o}return $e(l),l}function Si(e){e.textContent=""}let Ct=!1,At=!1,Rt=null,Fe=!1,qt=!1;function Tr(e){qt=e}let ot=[],oa=[],k=null,se=!1;function Ce(e){k=e}let R=null;function Ae(e){R=e}let de=null;function Ii(e){de=e}let q=null,Q=0,be=null;function Ti(e){be=e}let Nr=1,St=0,Re=!1;function Lr(){return++Nr}function st(e){var h;var t=e.f;if((t&we)!==0)return!0;if((t&Be)!==0){var r=e.deps,l=(t&te)!==0;if(r!==null){var i,a,o=(t&bt)!==0,f=l&&R!==null&&!Re,s=r.length;if(o||f){var c=e,v=c.parent;for(i=0;i<s;i++)a=r[i],(o||!((h=a==null?void 0:a.reactions)!=null&&h.includes(c)))&&(a.reactions??(a.reactions=[])).push(c);o&&(c.f^=bt),f&&v!==null&&(v.f&te)===0&&(c.f^=te)}for(i=0;i<s;i++)if(a=r[i],st(a)&&$r(a),a.wv>e.wv)return!0}(!l||R!==null&&!Re)&&ve(e,J)}return!1}function Ni(e,t){for(var r=t;r!==null;){if((r.f&yt)!==0)try{r.fn(e);return}catch{r.f^=yt}r=r.parent}throw Ct=!1,e}function Li(e){return(e.f&Et)===0&&(e.parent===null||(e.parent.f&yt)===0)}function It(e,t,r,l){if(Ct){if(r===null&&(Ct=!1),Li(t))throw e;return}r!==null&&(Ct=!0);{Ni(e,t);return}}function Dr(e,t,r=!0){var l=e.reactions;if(l!==null)for(var i=0;i<l.length;i++){var a=l[i];(a.f&ae)!==0?Dr(a,t,!1):t===a&&(r?ve(a,we):(a.f&J)!==0&&ve(a,Be),Nt(a))}}function Pr(e){var m;var t=q,r=Q,l=be,i=k,a=Re,o=de,f=H,s=se,c=e.f;q=null,Q=0,be=null,Re=(c&te)!==0&&(se||!Fe||k===null),k=(c&(me|Pe))===0?e:null,de=null,qr(e.ctx),se=!1,St++;try{var v=(0,e.fn)(),h=e.deps;if(q!==null){var g;if(Tt(e,Q),h!==null&&Q>0)for(h.length=Q+q.length,g=0;g<q.length;g++)h[Q+g]=q[g];else e.deps=h=q;if(!Re)for(g=Q;g<h.length;g++)((m=h[g]).reactions??(m.reactions=[])).push(e)}else h!==null&&Q<h.length&&(Tt(e,Q),h.length=Q);if(Yr()&&be!==null&&!se&&h!==null&&(e.f&(ae|Be|we))===0)for(g=0;g<be.length;g++)Dr(be[g],e);return i!==null&&St++,v}finally{q=t,Q=r,be=l,k=i,Re=a,de=o,qr(f),se=s}}function Di(e,t){let r=t.reactions;if(r!==null){var l=li.call(r,e);if(l!==-1){var i=r.length-1;i===0?r=t.reactions=null:(r[l]=r[i],r.pop())}}r===null&&(t.f&ae)!==0&&(q===null||!q.includes(t))&&(ve(t,Be),(t.f&(te|bt))===0&&(t.f^=bt),xr(t),Tt(t,0))}function Tt(e,t){var r=e.deps;if(r!==null)for(var l=t;l<r.length;l++)Di(e,r[l])}function Ht(e){var t=e.f;if((t&Et)===0){ve(e,J);var r=R,l=H,i=Fe;R=e,Fe=!0;try{(t&Mt)!==0?Hi(e):Fr(e),zr(e);var a=Pr(e);e.teardown=typeof a=="function"?a:null,e.wv=Nr;var o=e.deps,f;fr&&xi&&e.f&we}catch(s){It(s,e,r,l||e.ctx)}finally{Fe=i,R=r}}}function Pi(){try{_i()}catch(e){if(Rt!==null)It(e,Rt,null);else throw e}}function Or(){var e=Fe;try{var t=0;for(Fe=!0;ot.length>0;){t++>1e3&&Pi();var r=ot,l=r.length;ot=[];for(var i=0;i<l;i++){var a=zi(r[i]);Oi(a)}}}finally{At=!1,Fe=e,Rt=null}}function Oi(e){var t=e.length;if(t!==0)for(var r=0;r<t;r++){var l=e[r];if((l.f&(Et|qe))===0)try{st(l)&&(Ht(l),l.deps===null&&l.first===null&&l.nodes_start===null&&(l.teardown===null?Mr(l):l.fn=null))}catch(i){It(i,l,null,l.ctx)}}}function Nt(e){At||(At=!0,queueMicrotask(Or));for(var t=Rt=e;t.parent!==null;){t=t.parent;var r=t.f;if((r&(Pe|me))!==0){if((r&J)===0)return;t.f^=J}}ot.push(t)}function zi(e){for(var t=[],r=e;r!==null;){var l=r.f,i=(l&(me|Pe))!==0,a=i&&(l&J)!==0;if(!a&&(l&qe)===0){if((l&ur)!==0)t.push(r);else if(i)r.f^=J;else{var o=k;try{k=r,st(r)&&Ht(r)}catch(c){It(c,r,null,r.ctx)}finally{k=o}}var f=r.first;if(f!==null){r=f;continue}}var s=r.parent;for(r=r.next;r===null&&s!==null;)r=s.next,s=s.parent}return t}function C(e){var t;for(wr();ot.length>0;)At=!0,Or(),wr();return t}async function Fi(){await Promise.resolve(),C()}function d(e){var t=e.f,r=(t&ae)!==0;if(k!==null&&!se){de!==null&&de.includes(e)&&bi();var l=k.deps;e.rv<St&&(e.rv=St,q===null&&l!==null&&l[Q]===e?Q++:q===null?q=[e]:(!Re||!q.includes(e))&&q.push(e))}else if(r&&e.deps===null&&e.effects===null){var i=e,a=i.parent;a!==null&&(a.f&te)===0&&(i.f^=te)}return r&&(i=e,st(i)&&$r(i)),e.v}function Ze(e){var t=se;try{return se=!0,e()}finally{se=t}}const Mi=-7169;function ve(e,t){e.f=e.f&Mi|t}function Ui(e){R===null&&k===null&&gi(),k!==null&&(k.f&te)!==0&&R===null&&hi(),qt&&vi()}function ji(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function Me(e,t,r,l=!0){var i=R,a={ctx:H,deps:null,nodes_start:null,nodes_end:null,f:e|we,first:null,fn:t,last:null,next:null,parent:i,prev:null,teardown:null,transitions:null,wv:0};if(r)try{Ht(a),a.f|=ri}catch(s){throw Ee(a),s}else t!==null&&Nt(a);var o=r&&a.deps===null&&a.first===null&&a.nodes_start===null&&a.teardown===null&&(a.f&(cr|yt))===0;if(!o&&l&&(i!==null&&ji(a,i),k!==null&&(k.f&ae)!==0)){var f=k;(f.effects??(f.effects=[])).push(a)}return a}function Vi(e){const t=Me(pt,null,!1);return ve(t,J),t.teardown=e,t}function Wt(e){Ui();var t=R!==null&&(R.f&me)!==0&&H!==null&&!H.m;if(t){var r=H;(r.e??(r.e=[])).push({fn:e,effect:R,reaction:k})}else{var l=Yt(e);return l}}function Bi(e){const t=Me(Pe,e,!0);return()=>{Ee(t)}}function qi(e){const t=Me(Pe,e,!0);return(r={})=>new Promise(l=>{r.outro?Jt(t,()=>{Ee(t),l(void 0)}):(Ee(t),l(void 0))})}function Yt(e){return Me(ur,e,!1)}function Zt(e){return Me(pt,e,!0)}function Ge(e,t=[],r=ze){const l=t.map(r);return Gt(()=>e(...l.map(d)))}function Gt(e,t=0){return Me(pt|Mt|t,e,!0)}function Lt(e,t=!0){return Me(pt|me,e,!0,t)}function zr(e){var t=e.teardown;if(t!==null){const r=qt,l=k;Tr(!0),Ce(null);try{t.call(null)}finally{Tr(r),Ce(l)}}}function Fr(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){var l=r.next;(r.f&Pe)!==0?r.parent=null:Ee(r,t),r=l}}function Hi(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&me)===0&&Ee(t),t=r}}function Ee(e,t=!0){var r=!1;if((t||(e.f&ni)!==0)&&e.nodes_start!==null){for(var l=e.nodes_start,i=e.nodes_end;l!==null;){var a=l===i?null:ke(l);l.remove(),l=a}r=!0}Fr(e,t&&!r),Tt(e,0),ve(e,Et);var o=e.transitions;if(o!==null)for(const s of o)s.stop();zr(e);var f=e.parent;f!==null&&f.first!==null&&Mr(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function Mr(e){var t=e.parent,r=e.prev,l=e.next;r!==null&&(r.next=l),l!==null&&(l.prev=r),t!==null&&(t.first===e&&(t.first=l),t.last===e&&(t.last=r))}function Jt(e,t){var r=[];Ur(e,r,!0),Wi(r,()=>{Ee(e),t&&t()})}function Wi(e,t){var r=e.length;if(r>0){var l=()=>--r||t();for(var i of e)i.out(l)}else t()}function Ur(e,t,r){if((e.f&qe)===0){if(e.f^=qe,e.transitions!==null)for(const o of e.transitions)(o.is_global||r)&&t.push(o);for(var l=e.first;l!==null;){var i=l.next,a=(l.f&Ut)!==0||(l.f&me)!==0;Ur(l,t,a?r:!1),l=i}}}function jr(e){Vr(e,!0)}function Vr(e,t){if((e.f&qe)!==0){e.f^=qe,(e.f&J)===0&&(e.f^=J),st(e)&&(ve(e,we),Nt(e));for(var r=e.first;r!==null;){var l=r.next,i=(r.f&Ut)!==0||(r.f&me)!==0;Vr(r,i?t:!1),r=l}if(e.transitions!==null)for(const a of e.transitions)(a.is_global||t)&&a.in()}}function Br(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}let H=null;function qr(e){H=e}function Hr(e,t=!1,r){H={p:H,c:null,e:null,m:!1,s:e,x:null,l:null}}function Wr(e){const t=H;if(t!==null){e!==void 0&&(t.x=e);const o=t.e;if(o!==null){var r=R,l=k;t.e=null;try{for(var i=0;i<o.length;i++){var a=o[i];Ae(a.effect),Ce(a.reaction),Yt(a.fn)}}finally{Ae(r),Ce(l)}}H=t.p,t.m=!0}return e||{}}function Yr(){return!0}const Yi=["touchstart","touchmove"];function Zi(e){return Yi.includes(e)}let Zr=!1;function Gr(){Zr||(Zr=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const r of e.target.elements)(t=r.__on_r)==null||t.call(r)})},{capture:!0}))}function Jr(e){var t=k,r=R;Ce(null),Ae(null);try{return e()}finally{Ce(t),Ae(r)}}function Gi(e,t,r,l=r){e.addEventListener(t,()=>Jr(r));const i=e.__on_r;i?e.__on_r=()=>{i(),l(!0)}:e.__on_r=()=>l(!0),Gr()}const Kr=new Set,Kt=new Set;function Ji(e,t,r,l={}){function i(a){if(l.capture||ft.call(t,a),!a.cancelBubble)return Jr(()=>r==null?void 0:r.call(this,a))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?jt(()=>{t.addEventListener(e,i,l)}):t.addEventListener(e,i,l),i}function Ki(e,t,r,l,i){var a={capture:l,passive:i},o=Ji(e,t,r,a);(t===document.body||t===window||t===document)&&Vi(()=>{t.removeEventListener(e,o,a)})}function Xi(e){for(var t=0;t<e.length;t++)Kr.add(e[t]);for(var r of Kt)r(e)}function ft(e){var V;var t=this,r=t.ownerDocument,l=e.type,i=((V=e.composedPath)==null?void 0:V.call(e))||[],a=i[0]||e.target,o=0,f=e.__root;if(f){var s=i.indexOf(f);if(s!==-1&&(t===document||t===window)){e.__root=t;return}var c=i.indexOf(t);if(c===-1)return;s<=c&&(o=s)}if(a=i[o]||e.target,a!==t){$t(e,"currentTarget",{configurable:!0,get(){return a||r}});var v=k,h=R;Ce(null),Ae(null);try{for(var g,m=[];a!==null;){var w=a.assignedSlot||a.parentNode||a.host||null;try{var M=a["__"+l];if(M!=null&&(!a.disabled||e.target===a))if(vr(M)){var[L,...ee]=M;L.apply(a,[e,...ee])}else M.call(a,e)}catch(U){g?m.push(U):g=U}if(e.cancelBubble||w===t||w===null)break;a=w}if(g){for(let U of m)queueMicrotask(()=>{throw U});throw g}}finally{e.__root=t,delete e.currentTarget,Ce(v),Ae(h)}}}function Xt(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function Se(e,t){var r=R;r.nodes_start===null&&(r.nodes_start=e,r.nodes_end=t)}function he(e,t){var r=(t&Qn)!==0,l=(t&ei)!==0,i,a=!e.startsWith("<!>");return()=>{if(P)return Se(F,null),F;i===void 0&&(i=Xt(a?e:"<!>"+e),r||(i=pe(i)));var o=l||Ar?document.importNode(i,!0):i.cloneNode(!0);if(r){var f=pe(o),s=o.lastChild;Se(f,s)}else Se(o,o);return o}}function Qi(e,t,r="svg"){var l=!e.startsWith("<!>"),i=`<${r}>${l?e:"<!>"+e}</${r}>`,a;return()=>{if(P)return Se(F,null),F;if(!a){var o=Xt(i),f=pe(o);a=pe(f)}var s=a.cloneNode(!0);return Se(s,s),s}}function re(e,t){if(P){R.nodes_end=F,Ye();return}e!==null&&e.before(t)}function Xr(e,t){return Qr(e,t)}function el(e,t){Vt(),t.intro=t.intro??!1;const r=t.target,l=P,i=F;try{for(var a=pe(r);a&&(a.nodeType!==8||a.data!==Ft);)a=ke(a);if(!a)throw Ve;We(!0),$e(a),Ye();const o=Qr(e,{...t,anchor:a});if(F===null||F.nodeType!==8||F.data!==sr)throw kt(),Ve;return We(!1),o}catch(o){if(o===Ve)return t.recover===!1&&mi(),Vt(),Si(r),We(!1),Xr(e,t);throw o}finally{We(l),$e(i)}}const Je=new Map;function Qr(e,{target:t,anchor:r,props:l={},events:i,context:a,intro:o=!0}){Vt();var f=new Set,s=h=>{for(var g=0;g<h.length;g++){var m=h[g];if(!f.has(m)){f.add(m);var w=Zi(m);t.addEventListener(m,ft,{passive:w});var M=Je.get(m);M===void 0?(document.addEventListener(m,ft,{passive:w}),Je.set(m,1)):Je.set(m,M+1)}}};s(ai(Kr)),Kt.add(s);var c=void 0,v=qi(()=>{var h=r??t.appendChild(Bt());return Lt(()=>{if(a){Hr({});var g=H;g.c=a}i&&(l.$$events=i),P&&Se(h,null),c=e(h,l)||{},P&&(R.nodes_end=F),a&&Wr()}),()=>{var w;for(var g of f){t.removeEventListener(g,ft);var m=Je.get(g);--m===0?(document.removeEventListener(g,ft),Je.delete(g)):Je.set(g,m)}Kt.delete(s),h!==r&&((w=h.parentNode)==null||w.removeChild(h))}});return Qt.set(c,v),c}let Qt=new WeakMap;function tl(e,t){const r=Qt.get(e);return r?(Qt.delete(e),r(t)):Promise.resolve()}function Ie(e,t,[r,l]=[0,0]){P&&r===0&&Ye();var i=e,a=null,o=null,f=Y,s=r>0?Ut:0,c=!1;const v=(g,m=!0)=>{c=!0,h(m,g)},h=(g,m)=>{if(f===(f=g))return;let w=!1;if(P&&l!==-1){if(r===0){const L=i.data;L===Ft?l=0:L===or?l=1/0:(l=parseInt(L.substring(1)),l!==l&&(l=f?1/0:-1))}const M=l>r;!!f===M&&(i=Ri(),$e(i),We(!1),w=!0,l=-1)}f?(a?jr(a):m&&(a=Lt(()=>m(i))),o&&Jt(o,()=>{o=null})):(o?jr(o):m&&(o=Lt(()=>m(i,[r+1,l]))),a&&Jt(a,()=>{a=null})),w&&We(!0)};Gt(()=>{c=!1,t(v),c||h(null,null)},s),P&&(i=F)}function Ke(e,t,r,l,i){var a=e,o="",f;Gt(()=>{if(o===(o=t()??"")){P&&Ye();return}f!==void 0&&(Ee(f),f=void 0),o!==""&&(f=Lt(()=>{if(P){F.data;for(var s=Ye(),c=s;s!==null&&(s.nodeType!==8||s.data!=="");)c=s,s=ke(s);if(s===null)throw kt(),Ve;Se(F,c),a=$e(s);return}var v=o+"",h=Xt(v);Se(pe(h),h.lastChild),a.before(h)}))})}function rl(e,t,r,l,i){var f;P&&Ye();var a=(f=t.$$slots)==null?void 0:f[r],o=!1;a===!0&&(a=t.children,o=!0),a===void 0||a(e,o?()=>l:l)}function nl(e,t){jt(()=>{var r=e.getRootNode(),l=r.host?r:r.head??r.ownerDocument.head;if(!l.querySelector("#"+t.hash)){const i=document.createElement("style");i.id=t.hash,i.textContent=t.code,l.appendChild(i)}})}const en=[...`
|
|
3
|
-
\r\f \v\uFEFF`];function il(e,t,r){var l=""+e;if(r){for(var i in r)if(r[i])l=l?l+" "+i:i;else if(l.length)for(var a=i.length,o=0;(o=l.indexOf(i,o))>=0;){var f=o+a;(o===0||en.includes(l[o-1]))&&(f===l.length||en.includes(l[f]))?l=(o===0?"":l.substring(0,o))+l.substring(f+1):o=f}}return l===""?null:l}function ll(e,t,r,l,i,a){var o=e.__className;if(P||o!==r){var f=il(r,l,a);(!P||f!==e.getAttribute("class"))&&(f==null?e.removeAttribute("class"):e.className=f),e.__className=r}else if(a&&i!==a)for(var s in a){var c=!!a[s];(i==null||c!==!!i[s])&&e.classList.toggle(s,c)}return a}const al=Symbol("is custom element"),ol=Symbol("is html");function tn(e){if(P){var t=!1,r=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var l=e.value;fe(e,"value",null),e.value=l}if(e.hasAttribute("checked")){var i=e.checked;fe(e,"checked",null),e.checked=i}}};e.__on_r=r,ci(r),Gr()}}function sl(e,t){var r=rn(e);r.value===(r.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function fe(e,t,r,l){var i=rn(e);P&&(i[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||i[t]!==(i[t]=r)&&(t==="loading"&&(e[ii]=r),r==null?e.removeAttribute(t):typeof r!="string"&&fl(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function rn(e){return e.__attributes??(e.__attributes={[al]:e.nodeName.includes("-"),[ol]:e.namespaceURI===ti})}var nn=new Map;function fl(e){var t=nn.get(e.nodeName);if(t)return t;nn.set(e.nodeName,t=[]);for(var r,l=e,i=Element.prototype;i!==l;){r=oi(l);for(var a in r)r[a].set&&t.push(a);l=hr(l)}return t}function ul(e,t,r=t){Gi(e,"change",l=>{var i=l?e.defaultChecked:e.checked;r(i)}),(P&&e.defaultChecked!==e.checked||Ze(t)==null)&&r(e.checked),Zt(()=>{var l=t();e.checked=!!l})}function ln(e,t){return e===t||(e==null?void 0:e[it])===t}function an(e={},t,r,l){return Yt(()=>{var i,a;return Zt(()=>{i=a,a=[],Ze(()=>{e!==r(...a)&&(t(e,...a),i&&ln(r(...i),e)&&t(null,...i))})}),()=>{jt(()=>{a&&ln(r(...a),e)&&t(null,...a)})}}),e}function on(e){H===null&&Br(),Wt(()=>{const t=Ze(e);if(typeof t=="function")return t})}function cl(e){H===null&&Br(),on(()=>()=>Ze(e))}let Dt=!1;function dl(e){var t=Dt;try{return Dt=!1,[e(),Dt]}finally{Dt=t}}function S(e,t,r,l){var Te;var i=(r&Gn)!==0,a=!0,o=(r&Kn)!==0,f=(r&Xn)!==0,s=!1,c;o?[c,s]=dl(()=>e[t]):c=e[t];var v=it in e||dr in e,h=o&&(((Te=Oe(e,t))==null?void 0:Te.set)??(v&&t in e&&(D=>e[t]=D)))||void 0,g=l,m=!0,w=!1,M=()=>(w=!0,m&&(m=!1,f?g=Ze(l):g=l),g);c===void 0&&l!==void 0&&(h&&a&&wi(),c=M(),h&&h(c));var L;if(L=()=>{var D=e[t];return D===void 0?M():(m=!0,w=!1,D)},(r&Jn)===0)return L;if(h){var ee=e.$$legacy;return function(D,ie){return arguments.length>0?((!ie||ee||s)&&h(ie?L():D),D):L()}}var V=!1,U=br(c),ge=ze(()=>{var D=L(),ie=d(U);return V?(V=!1,ie):U.v=D});return i||(ge.equals=yr),function(D,ie){if(arguments.length>0){const B=ie?d(ge):o?oe(D):D;return ge.equals(B)||(V=!0,z(U,B),w&&g!==void 0&&(g=B),Ze(()=>d(ge))),D}return d(ge)}}function vl(e){return new hl(e)}class hl{constructor(t){lr(this,xe);lr(this,ne);var a;var r=new Map,l=(o,f)=>{var s=br(f);return r.set(o,s),s};const i=new Proxy({...t.props||{},$$events:{}},{get(o,f){return d(r.get(f)??l(f,Reflect.get(o,f)))},has(o,f){return f===dr?!0:(d(r.get(f)??l(f,Reflect.get(o,f))),Reflect.has(o,f))},set(o,f,s){return z(r.get(f)??l(f,s),s),Reflect.set(o,f,s)}});ar(this,ne,(t.hydrate?el:Xr)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((a=t==null?void 0:t.props)!=null&&a.$$host)||t.sync===!1)&&C(),ar(this,xe,i.$$events);for(const o of Object.keys(G(this,ne)))o==="$set"||o==="$destroy"||o==="$on"||$t(this,o,{get(){return G(this,ne)[o]},set(f){G(this,ne)[o]=f},enumerable:!0});G(this,ne).$set=o=>{Object.assign(i,o)},G(this,ne).$destroy=()=>{tl(G(this,ne))}}$set(t){G(this,ne).$set(t)}$on(t,r){G(this,xe)[t]=G(this,xe)[t]||[];const l=(...i)=>r.call(this,...i);return G(this,xe)[t].push(l),()=>{G(this,xe)[t]=G(this,xe)[t].filter(i=>i!==l)}}$destroy(){G(this,ne).$destroy()}}xe=new WeakMap,ne=new WeakMap;let sn;typeof HTMLElement=="function"&&(sn=class extends HTMLElement{constructor(t,r,l){super();ue(this,"$$ctor");ue(this,"$$s");ue(this,"$$c");ue(this,"$$cn",!1);ue(this,"$$d",{});ue(this,"$$r",!1);ue(this,"$$p_d",{});ue(this,"$$l",{});ue(this,"$$l_u",new Map);ue(this,"$$me");this.$$ctor=t,this.$$s=r,l&&this.attachShadow({mode:"open"})}addEventListener(t,r,l){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(r),this.$$c){const i=this.$$c.$on(t,r);this.$$l_u.set(r,i)}super.addEventListener(t,r,l)}removeEventListener(t,r,l){if(super.removeEventListener(t,r,l),this.$$c){const i=this.$$l_u.get(r);i&&(i(),this.$$l_u.delete(r))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(i){return a=>{const o=document.createElement("slot");i!=="default"&&(o.name=i),re(a,o)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const r={},l=gl(this);for(const i of this.$$s)i in l&&(i==="default"&&!this.$$d.children?(this.$$d.children=t(i),r.default=!0):r[i]=t(i));for(const i of this.attributes){const a=this.$$g_p(i.name);a in this.$$d||(this.$$d[a]=Pt(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=vl({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:r,$$host:this}}),this.$$me=Bi(()=>{Zt(()=>{var i;this.$$r=!0;for(const a of xt(this.$$c)){if(!((i=this.$$p_d[a])!=null&&i.reflect))continue;this.$$d[a]=this.$$c[a];const o=Pt(a,this.$$d[a],this.$$p_d,"toAttribute");o==null?this.removeAttribute(this.$$p_d[a].attribute||a):this.setAttribute(this.$$p_d[a].attribute||a,o)}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(t,r,l){var i;this.$$r||(t=this.$$g_p(t),this.$$d[t]=Pt(t,l,this.$$p_d,"toProp"),(i=this.$$c)==null||i.$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 xt(this.$$p_d).find(r=>this.$$p_d[r].attribute===t||!this.$$p_d[r].attribute&&r.toLowerCase()===t)||t}});function Pt(e,t,r,l){var a;const i=(a=r[e])==null?void 0:a.type;if(t=i==="Boolean"&&typeof t!="boolean"?t!=null:t,!l||!r[e])return t;if(l==="toAttribute")switch(i){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(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function gl(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function _l(e,t,r,l,i,a){let o=class extends sn{constructor(){super(e,r,i),this.$$p_d=t}static get observedAttributes(){return xt(t).map(f=>(t[f].attribute||f).toLowerCase())}};return xt(t).forEach(f=>{$t(o.prototype,f,{get(){return this.$$c&&f in this.$$c?this.$$c[f]:this.$$d[f]},set(s){var h;s=Pt(f,s,t),this.$$d[f]=s;var c=this.$$c;if(c){var v=(h=Oe(c,f))==null?void 0:h.get;v?c[f]=s:c.$set({[f]:s})}}})}),l.forEach(f=>{$t(o.prototype,f,{get(){var s;return(s=this.$$c)==null?void 0:s[f]}})}),e.element=o,o}const fn=new TextEncoder;function ml(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function wl(e,t="SHA-256",r=1e5){const l=Date.now().toString(16);e||(e=Math.round(Math.random()*r));const i=await un(l,e,t);return{algorithm:t,challenge:i,salt:l,signature:""}}async function un(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 ml(await crypto.subtle.digest(r.toUpperCase(),fn.encode(e+t)))}function pl(e,t,r="SHA-256",l=1e6,i=0){const a=new AbortController,o=Date.now();return{promise:(async()=>{for(let s=i;s<=l;s+=1){if(a.signal.aborted)return null;if(await un(t,s,r)===e)return{number:s,took:Date.now()-o}}return null})(),controller:a}}function yl(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function bl(e){const t=atob(e),r=new Uint8Array(t.length);for(let l=0;l<t.length;l++)r[l]=t.charCodeAt(l);return r}function El(e,t=12){const r=new Uint8Array(t);for(let l=0;l<t;l++)r[l]=e%256,e=Math.floor(e/256);return r}async function xl(e,t="",r=1e6,l=0){const i="AES-GCM",a=new AbortController,o=Date.now(),f=async()=>{for(let v=l;v<=r;v+=1){if(a.signal.aborted||!s||!c)return null;try{const h=await crypto.subtle.decrypt({name:i,iv:El(v)},s,c);if(h)return{clearText:new TextDecoder().decode(h),took:Date.now()-o}}catch{}}return null};let s=null,c=null;try{c=bl(e);const v=await crypto.subtle.digest("SHA-256",fn.encode(t));s=await crypto.subtle.importKey("raw",v,i,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:a}}return{promise:f(),controller:a}}var y=(e=>(e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(y||{}),$l=Qi('<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="svelte-ddsc3z"><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" class="svelte-ddsc3z"></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" class="altcha-spinner svelte-ddsc3z"></path></svg>'),kl=he('<span role="status" aria-live="polite" class="svelte-ddsc3z"><!></span> <input type="hidden" class="svelte-ddsc3z">',1),Cl=he('<span role="status" aria-live="polite" class="svelte-ddsc3z"><!></span>'),Al=he('<label class="svelte-ddsc3z"><!></label>'),Rl=he('<div class="svelte-ddsc3z"><a target="_blank" class="altcha-logo svelte-ddsc3z"><svg width="22" height="22" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" class="svelte-ddsc3z"><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" class="svelte-ddsc3z"></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" class="svelte-ddsc3z"></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" class="svelte-ddsc3z"></path></svg></a></div>'),Sl=he('<div class="svelte-ddsc3z"><!></div>'),Il=he('<div class="svelte-ddsc3z"><!></div>'),Tl=he('<div class="altcha-error svelte-ddsc3z"><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" class="svelte-ddsc3z"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" class="svelte-ddsc3z"></path></svg> <!></div>'),Nl=he('<div class="altcha-footer svelte-ddsc3z"><div class="svelte-ddsc3z"><!></div></div>'),Ll=he('<div class="altcha-anchor-arrow svelte-ddsc3z"></div>'),Dl=he('<!> <div class="altcha svelte-ddsc3z"><div class="altcha-main svelte-ddsc3z"><!> <div><input type="checkbox" class="svelte-ddsc3z"></div> <div class="altcha-label svelte-ddsc3z"><!></div> <!></div> <!> <!> <!></div>',1);const Pl={hash:"svelte-ddsc3z",code:`.altcha.svelte-ddsc3z {background:var(--altcha-color-base, transparent);border:var(--altcha-border-width, 1px) solid var(--altcha-color-border, #a0a0a0);border-radius:var(--altcha-border-radius, 3px);color:var(--altcha-color-text, currentColor);display:flex;flex-direction:column;max-width:var(--altcha-max-width, 260px);position:relative;text-align:left;}.altcha.svelte-ddsc3z:focus-within {border-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating].svelte-ddsc3z {background:var(--altcha-color-base, white);display:none;filter:drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.2));left:-100%;position:fixed;top:-100%;width:var(--altcha-max-width, 260px);z-index:999999;}.altcha[data-floating=top].svelte-ddsc3z .altcha-anchor-arrow:where(.svelte-ddsc3z) {border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto;}.altcha[data-floating=bottom].svelte-ddsc3z:focus-within::after {border-bottom-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating=top].svelte-ddsc3z:focus-within::after {border-top-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating].svelte-ddsc3z:not([data-state=unverified]) {display:block;}.altcha-anchor-arrow.svelte-ddsc3z {border:6px solid transparent;border-bottom-color:var(--altcha-color-border, #a0a0a0);content:"";height:0;left:12px;position:absolute;top:-12px;width:0;}.altcha-main.svelte-ddsc3z {align-items:center;display:flex;gap:0.4rem;padding:0.7rem;}.altcha-label.svelte-ddsc3z {flex-grow:1;}.altcha-label.svelte-ddsc3z label:where(.svelte-ddsc3z) {cursor:pointer;}.altcha-logo.svelte-ddsc3z {color:currentColor;opacity:0.3;}.altcha-logo.svelte-ddsc3z:hover {opacity:1;}.altcha-error.svelte-ddsc3z {color:var(--altcha-color-error-text, #f23939);display:flex;font-size:0.85rem;gap:0.3rem;padding:0 0.7rem 0.7rem;}.altcha-footer.svelte-ddsc3z {align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:0.75rem;opacity:0.4;padding:0.2rem 0.7rem;text-align:right;}.altcha-footer.svelte-ddsc3z:hover {opacity:1;}.altcha-footer.svelte-ddsc3z > :where(.svelte-ddsc3z):first-child {flex-grow:1;}.altcha-footer.svelte-ddsc3z a {color:currentColor;}.altcha-checkbox.svelte-ddsc3z {display:flex;align-items:center;height:24px;width:24px;}.altcha-checkbox.svelte-ddsc3z input:where(.svelte-ddsc3z) {width:18px;height:18px;margin:0;}.altcha-hidden.svelte-ddsc3z {display:none;}.altcha-spinner.svelte-ddsc3z {
|
|
1
|
+
(function(k,A){typeof exports=="object"&&typeof module<"u"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):(k=typeof globalThis<"u"?globalThis:k||self,A(k.altcha={}))})(this,function(k){"use strict";var so=Object.defineProperty;var Gn=k=>{throw TypeError(k)};var fo=(k,A,U)=>A in k?so(k,A,{enumerable:!0,configurable:!0,writable:!0,value:U}):k[A]=U;var ce=(k,A,U)=>fo(k,typeof A!="symbol"?A+"":A,U),Jn=(k,A,U)=>A.has(k)||Gn("Cannot "+U);var K=(k,A,U)=>(Jn(k,A,"read from private field"),U?U.call(k):A.get(k)),ar=(k,A,U)=>A.has(k)?Gn("Cannot add the same private member more than once"):A instanceof WeakSet?A.add(k):A.set(k,U),sr=(k,A,U,bt)=>(Jn(k,A,"write to private field"),bt?bt.call(k,U):A.set(k,U),U);var hn,xe,ie;const A=`(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})})}}})();
|
|
2
|
+
`,U=typeof self<"u"&&self.Blob&&new Blob([A],{type:"text/javascript;charset=utf-8"});function bt(e){let t;try{if(t=U&&(self.URL||self.webkitURL).createObjectURL(U),!t)throw"";const r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(A),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}const Kn="5";typeof window<"u"&&((hn=window.__svelte??(window.__svelte={})).v??(hn.v=new Set)).add(Kn);const Xn=1,Qn=4,ei=8,ti=16,ri=1,ni=2,Mt="[",fr="[!",ur="]",Be={},Y=Symbol(),ii="http://www.w3.org/1999/xhtml",cr=!1,ae=2,dr=4,yt=8,Ut=16,me=32,Pe=64,Et=128,re=256,xt=512,X=1024,pe=2048,qe=4096,He=8192,$t=16384,li=32768,jt=65536,oi=1<<19,vr=1<<20,lt=Symbol("$state"),hr=Symbol("legacy props"),ai=Symbol("");var gr=Array.isArray,si=Array.prototype.indexOf,fi=Array.from,kt=Object.keys,Ct=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,ui=Object.getOwnPropertyDescriptors,ci=Object.prototype,di=Array.prototype,_r=Object.getPrototypeOf;function mr(e){for(var t=0;t<e.length;t++)e[t]()}const vi=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let ot=[],at=[];function pr(){var e=ot;ot=[],mr(e)}function wr(){var e=at;at=[],mr(e)}function Vt(e){ot.length===0&&queueMicrotask(pr),ot.push(e)}function hi(e){at.length===0&&vi(wr),at.push(e)}function br(){ot.length>0&&pr(),at.length>0&&wr()}function yr(e){return e===this.v}function gi(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Er(e){return!gi(e,this.v)}function _i(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function mi(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function pi(e){throw new Error("https://svelte.dev/e/effect_orphan")}function wi(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function bi(){throw new Error("https://svelte.dev/e/hydration_failed")}function yi(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Ei(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function xi(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function $i(){throw new Error("https://svelte.dev/e/state_unsafe_local_read")}function ki(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}let Ci=!1;function de(e,t){var r={f:0,v:e,reactions:null,equals:yr,rv:0,wv:0};return r}function We(e){return Ai(de(e))}function xr(e,t=!1){const r=de(e);return t||(r.equals=Er),r}function Ai(e){return C!==null&&!fe&&(C.f&ae)!==0&&(ve===null?Li([e]):ve.push(e)),e}function O(e,t){return C!==null&&!fe&&Gr()&&(C.f&(ae|Ut))!==0&&(ve===null||!ve.includes(e))&&ki(),Ri(e,t)}function Ri(e,t){return e.equals(t)||(e.v,e.v=t,e.wv=Pr(),$r(e,pe),S!==null&&(S.f&X)!==0&&(S.f&(me|Pe))===0&&(ye===null?Di([e]):ye.push(e))),t}function $r(e,t){var r=e.reactions;if(r!==null)for(var l=r.length,i=0;i<l;i++){var o=r[i],a=o.f;(a&pe)===0&&(he(o,t),(a&(X|re))!==0&&((a&ae)!==0?$r(o,qe):Dt(o)))}}function ze(e){var t=ae|pe,r=C!==null&&(C.f&ae)!==0?C:null;return S===null||r!==null&&(r.f&re)!==0?t|=re:S.f|=vr,{ctx:H,deps:null,effects:null,equals:yr,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:r??S}}function kr(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)Ee(t[r])}}function Ii(e){for(var t=e.parent;t!==null;){if((t.f&ae)===0)return t;t=t.parent}return null}function Si(e){var t,r=S;Re(Ii(e));try{kr(e),t=zr(e)}finally{Re(r)}return t}function Cr(e){var t=Si(e),r=(Ie||(e.f&re)!==0)&&e.deps!==null?qe:X;he(e,r),e.equals(t)||(e.v=t,e.wv=Pr())}function At(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let D=!1;function Ye(e){D=e}let z;function ke(e){if(e===null)throw At(),Be;return z=e}function Ze(){return ke(Ce(z))}function Q(e){if(D){if(Ce(z)!==null)throw At(),Be;z=e}}function Ti(){for(var e=0,t=z;;){if(t.nodeType===8){var r=t.data;if(r===ur){if(e===0)return t;e-=1}else(r===Mt||r===fr)&&(e+=1)}var l=Ce(t);t.remove(),t=l}}function se(e,t=null,r){if(typeof e!="object"||e===null||lt in e)return e;const l=_r(e);if(l!==ci&&l!==di)return e;var i=new Map,o=gr(e),a=de(0);o&&i.set("length",de(e.length));var f;return new Proxy(e,{defineProperty(s,c,v){(!("value"in v)||v.configurable===!1||v.enumerable===!1||v.writable===!1)&&Ei();var h=i.get(c);return h===void 0?(h=de(v.value),i.set(c,h)):O(h,se(v.value,f)),!0},deleteProperty(s,c){var v=i.get(c);if(v===void 0)c in s&&i.set(c,de(Y));else{if(o&&typeof c=="string"){var h=i.get("length"),g=Number(c);Number.isInteger(g)&&g<h.v&&O(h,g)}O(v,Y),Ar(a)}return!0},get(s,c,v){var b;if(c===lt)return e;var h=i.get(c),g=c in s;if(h===void 0&&(!g||(b=Oe(s,c))!=null&&b.writable)&&(h=de(se(g?s[c]:Y,f)),i.set(c,h)),h!==void 0){var m=d(h);return m===Y?void 0:m}return Reflect.get(s,c,v)},getOwnPropertyDescriptor(s,c){var v=Reflect.getOwnPropertyDescriptor(s,c);if(v&&"value"in v){var h=i.get(c);h&&(v.value=d(h))}else if(v===void 0){var g=i.get(c),m=g==null?void 0:g.v;if(g!==void 0&&m!==Y)return{enumerable:!0,configurable:!0,value:m,writable:!0}}return v},has(s,c){var m;if(c===lt)return!0;var v=i.get(c),h=v!==void 0&&v.v!==Y||Reflect.has(s,c);if(v!==void 0||S!==null&&(!h||(m=Oe(s,c))!=null&&m.writable)){v===void 0&&(v=de(h?se(s[c],f):Y),i.set(c,v));var g=d(v);if(g===Y)return!1}return h},set(s,c,v,h){var V;var g=i.get(c),m=c in s;if(o&&c==="length")for(var b=v;b<g.v;b+=1){var L=i.get(b+"");L!==void 0?O(L,Y):b in s&&(L=de(Y),i.set(b+"",L))}g===void 0?(!m||(V=Oe(s,c))!=null&&V.writable)&&(g=de(void 0),O(g,se(v,f)),i.set(c,g)):(m=g.v!==Y,O(g,se(v,f)));var F=Reflect.getOwnPropertyDescriptor(s,c);if(F!=null&&F.set&&F.set.call(h,v),!m){if(o&&typeof c=="string"){var Z=i.get("length"),j=Number(c);Number.isInteger(j)&&j>=Z.v&&O(Z,j+1)}Ar(a)}return!0},ownKeys(s){d(a);var c=Reflect.ownKeys(s).filter(g=>{var m=i.get(g);return m===void 0||m.v!==Y});for(var[v,h]of i)h.v!==Y&&!(v in s)&&c.push(v);return c},setPrototypeOf(){xi()}})}function Ar(e,t=1){O(e,e.v+t)}var Rr,Ir,Sr,Tr;function Bt(){if(Rr===void 0){Rr=window,Ir=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype;Sr=Oe(t,"firstChild").get,Tr=Oe(t,"nextSibling").get,e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0,Text.prototype.__t=void 0}}function qt(e=""){return document.createTextNode(e)}function we(e){return Sr.call(e)}function Ce(e){return Tr.call(e)}function ee(e,t){if(!D)return we(e);var r=we(z);return r===null&&(r=z.appendChild(qt())),ke(r),r}function Nr(e,t){if(!D){var r=we(e);return r instanceof Comment&&r.data===""?Ce(r):r}return z}function be(e,t=1,r=!1){let l=D?z:e;for(var i;t--;)i=l,l=Ce(l);if(!D)return l;var o=l==null?void 0:l.nodeType;if(r&&o!==3){var a=qt();return l===null?i==null||i.after(a):l.before(a),ke(a),a}return ke(l),l}function Ni(e){e.textContent=""}let Rt=!1,It=!1,St=null,Fe=!1,Ht=!1;function Lr(e){Ht=e}let st=[],uo=[],C=null,fe=!1;function Ae(e){C=e}let S=null;function Re(e){S=e}let ve=null;function Li(e){ve=e}let q=null,te=0,ye=null;function Di(e){ye=e}let Dr=1,Tt=0,Ie=!1;function Pr(){return++Dr}function ft(e){var h;var t=e.f;if((t&pe)!==0)return!0;if((t&qe)!==0){var r=e.deps,l=(t&re)!==0;if(r!==null){var i,o,a=(t&xt)!==0,f=l&&S!==null&&!Ie,s=r.length;if(a||f){var c=e,v=c.parent;for(i=0;i<s;i++)o=r[i],(a||!((h=o==null?void 0:o.reactions)!=null&&h.includes(c)))&&(o.reactions??(o.reactions=[])).push(c);a&&(c.f^=xt),f&&v!==null&&(v.f&re)===0&&(c.f^=re)}for(i=0;i<s;i++)if(o=r[i],ft(o)&&Cr(o),o.wv>e.wv)return!0}(!l||S!==null&&!Ie)&&he(e,X)}return!1}function Pi(e,t){for(var r=t;r!==null;){if((r.f&Et)!==0)try{r.fn(e);return}catch{r.f^=Et}r=r.parent}throw Rt=!1,e}function Oi(e){return(e.f&$t)===0&&(e.parent===null||(e.parent.f&Et)===0)}function Nt(e,t,r,l){if(Rt){if(r===null&&(Rt=!1),Oi(t))throw e;return}r!==null&&(Rt=!0);{Pi(e,t);return}}function Or(e,t,r=!0){var l=e.reactions;if(l!==null)for(var i=0;i<l.length;i++){var o=l[i];(o.f&ae)!==0?Or(o,t,!1):t===o&&(r?he(o,pe):(o.f&X)!==0&&he(o,qe),Dt(o))}}function zr(e){var m;var t=q,r=te,l=ye,i=C,o=Ie,a=ve,f=H,s=fe,c=e.f;q=null,te=0,ye=null,Ie=(c&re)!==0&&(fe||!Fe||C===null),C=(c&(me|Pe))===0?e:null,ve=null,Wr(e.ctx),fe=!1,Tt++;try{var v=(0,e.fn)(),h=e.deps;if(q!==null){var g;if(Lt(e,te),h!==null&&te>0)for(h.length=te+q.length,g=0;g<q.length;g++)h[te+g]=q[g];else e.deps=h=q;if(!Ie)for(g=te;g<h.length;g++)((m=h[g]).reactions??(m.reactions=[])).push(e)}else h!==null&&te<h.length&&(Lt(e,te),h.length=te);if(Gr()&&ye!==null&&!fe&&h!==null&&(e.f&(ae|qe|pe))===0)for(g=0;g<ye.length;g++)Or(ye[g],e);return i!==null&&Tt++,v}finally{q=t,te=r,ye=l,C=i,Ie=o,ve=a,Wr(f),fe=s}}function zi(e,t){let r=t.reactions;if(r!==null){var l=si.call(r,e);if(l!==-1){var i=r.length-1;i===0?r=t.reactions=null:(r[l]=r[i],r.pop())}}r===null&&(t.f&ae)!==0&&(q===null||!q.includes(t))&&(he(t,qe),(t.f&(re|xt))===0&&(t.f^=xt),kr(t),Lt(t,0))}function Lt(e,t){var r=e.deps;if(r!==null)for(var l=t;l<r.length;l++)zi(e,r[l])}function Wt(e){var t=e.f;if((t&$t)===0){he(e,X);var r=S,l=H,i=Fe;S=e,Fe=!0;try{(t&Ut)!==0?Zi(e):Ur(e),Mr(e);var o=zr(e);e.teardown=typeof o=="function"?o:null,e.wv=Dr;var a=e.deps,f;cr&&Ci&&e.f&pe}catch(s){Nt(s,e,r,l||e.ctx)}finally{Fe=i,S=r}}}function Fi(){try{wi()}catch(e){if(St!==null)Nt(e,St,null);else throw e}}function Fr(){var e=Fe;try{var t=0;for(Fe=!0;st.length>0;){t++>1e3&&Fi();var r=st,l=r.length;st=[];for(var i=0;i<l;i++){var o=Ui(r[i]);Mi(o)}}}finally{It=!1,Fe=e,St=null}}function Mi(e){var t=e.length;if(t!==0)for(var r=0;r<t;r++){var l=e[r];if((l.f&($t|He))===0)try{ft(l)&&(Wt(l),l.deps===null&&l.first===null&&l.nodes_start===null&&(l.teardown===null?jr(l):l.fn=null))}catch(i){Nt(i,l,null,l.ctx)}}}function Dt(e){It||(It=!0,queueMicrotask(Fr));for(var t=St=e;t.parent!==null;){t=t.parent;var r=t.f;if((r&(Pe|me))!==0){if((r&X)===0)return;t.f^=X}}st.push(t)}function Ui(e){for(var t=[],r=e;r!==null;){var l=r.f,i=(l&(me|Pe))!==0,o=i&&(l&X)!==0;if(!o&&(l&He)===0){if((l&dr)!==0)t.push(r);else if(i)r.f^=X;else{var a=C;try{C=r,ft(r)&&Wt(r)}catch(c){Nt(c,r,null,r.ctx)}finally{C=a}}var f=r.first;if(f!==null){r=f;continue}}var s=r.parent;for(r=r.next;r===null&&s!==null;)r=s.next,s=s.parent}return t}function x(e){var t;for(br();st.length>0;)It=!0,Fr(),br();return t}async function ji(){await Promise.resolve(),x()}function d(e){var t=e.f,r=(t&ae)!==0;if(C!==null&&!fe){ve!==null&&ve.includes(e)&&$i();var l=C.deps;e.rv<Tt&&(e.rv=Tt,q===null&&l!==null&&l[te]===e?te++:q===null?q=[e]:(!Ie||!q.includes(e))&&q.push(e))}else if(r&&e.deps===null&&e.effects===null){var i=e,o=i.parent;o!==null&&(o.f&re)===0&&(i.f^=re)}return r&&(i=e,ft(i)&&Cr(i)),e.v}function Ge(e){var t=fe;try{return fe=!0,e()}finally{fe=t}}const Vi=-7169;function he(e,t){e.f=e.f&Vi|t}function Bi(e){S===null&&C===null&&pi(),C!==null&&(C.f&re)!==0&&S===null&&mi(),Ht&&_i()}function qi(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function Me(e,t,r,l=!0){var i=S,o={ctx:H,deps:null,nodes_start:null,nodes_end:null,f:e|pe,first:null,fn:t,last:null,next:null,parent:i,prev:null,teardown:null,transitions:null,wv:0};if(r)try{Wt(o),o.f|=li}catch(s){throw Ee(o),s}else t!==null&&Dt(o);var a=r&&o.deps===null&&o.first===null&&o.nodes_start===null&&o.teardown===null&&(o.f&(vr|Et))===0;if(!a&&l&&(i!==null&&qi(o,i),C!==null&&(C.f&ae)!==0)){var f=C;(f.effects??(f.effects=[])).push(o)}return o}function Hi(e){const t=Me(yt,null,!1);return he(t,X),t.teardown=e,t}function Yt(e){Bi();var t=S!==null&&(S.f&me)!==0&&H!==null&&!H.m;if(t){var r=H;(r.e??(r.e=[])).push({fn:e,effect:S,reaction:C})}else{var l=Zt(e);return l}}function Wi(e){const t=Me(Pe,e,!0);return()=>{Ee(t)}}function Yi(e){const t=Me(Pe,e,!0);return(r={})=>new Promise(l=>{r.outro?Kt(t,()=>{Ee(t),l(void 0)}):(Ee(t),l(void 0))})}function Zt(e){return Me(dr,e,!1)}function Gt(e){return Me(yt,e,!0)}function Je(e,t=[],r=ze){const l=t.map(r);return Jt(()=>e(...l.map(d)))}function Jt(e,t=0){return Me(yt|Ut|t,e,!0)}function Pt(e,t=!0){return Me(yt|me,e,!0,t)}function Mr(e){var t=e.teardown;if(t!==null){const r=Ht,l=C;Lr(!0),Ae(null);try{t.call(null)}finally{Lr(r),Ae(l)}}}function Ur(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){var l=r.next;(r.f&Pe)!==0?r.parent=null:Ee(r,t),r=l}}function Zi(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&me)===0&&Ee(t),t=r}}function Ee(e,t=!0){var r=!1;if((t||(e.f&oi)!==0)&&e.nodes_start!==null){for(var l=e.nodes_start,i=e.nodes_end;l!==null;){var o=l===i?null:Ce(l);l.remove(),l=o}r=!0}Ur(e,t&&!r),Lt(e,0),he(e,$t);var a=e.transitions;if(a!==null)for(const s of a)s.stop();Mr(e);var f=e.parent;f!==null&&f.first!==null&&jr(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function jr(e){var t=e.parent,r=e.prev,l=e.next;r!==null&&(r.next=l),l!==null&&(l.prev=r),t!==null&&(t.first===e&&(t.first=l),t.last===e&&(t.last=r))}function Kt(e,t){var r=[];Vr(e,r,!0),Gi(r,()=>{Ee(e),t&&t()})}function Gi(e,t){var r=e.length;if(r>0){var l=()=>--r||t();for(var i of e)i.out(l)}else t()}function Vr(e,t,r){if((e.f&He)===0){if(e.f^=He,e.transitions!==null)for(const a of e.transitions)(a.is_global||r)&&t.push(a);for(var l=e.first;l!==null;){var i=l.next,o=(l.f&jt)!==0||(l.f&me)!==0;Vr(l,t,o?r:!1),l=i}}}function Br(e){qr(e,!0)}function qr(e,t){if((e.f&He)!==0){e.f^=He,(e.f&X)===0&&(e.f^=X),ft(e)&&(he(e,pe),Dt(e));for(var r=e.first;r!==null;){var l=r.next,i=(r.f&jt)!==0||(r.f&me)!==0;qr(r,i?t:!1),r=l}if(e.transitions!==null)for(const o of e.transitions)(o.is_global||t)&&o.in()}}function Hr(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}let H=null;function Wr(e){H=e}function Yr(e,t=!1,r){H={p:H,c:null,e:null,m:!1,s:e,x:null,l:null}}function Zr(e){const t=H;if(t!==null){e!==void 0&&(t.x=e);const a=t.e;if(a!==null){var r=S,l=C;t.e=null;try{for(var i=0;i<a.length;i++){var o=a[i];Re(o.effect),Ae(o.reaction),Zt(o.fn)}}finally{Re(r),Ae(l)}}H=t.p,t.m=!0}return e||{}}function Gr(){return!0}const Ji=["touchstart","touchmove"];function Ki(e){return Ji.includes(e)}let Jr=!1;function Kr(){Jr||(Jr=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const r of e.target.elements)(t=r.__on_r)==null||t.call(r)})},{capture:!0}))}function Xr(e){var t=C,r=S;Ae(null),Re(null);try{return e()}finally{Ae(t),Re(r)}}function Xi(e,t,r,l=r){e.addEventListener(t,()=>Xr(r));const i=e.__on_r;i?e.__on_r=()=>{i(),l(!0)}:e.__on_r=()=>l(!0),Kr()}const Qr=new Set,Xt=new Set;function Qi(e,t,r,l={}){function i(o){if(l.capture||ut.call(t,o),!o.cancelBubble)return Xr(()=>r==null?void 0:r.call(this,o))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Vt(()=>{t.addEventListener(e,i,l)}):t.addEventListener(e,i,l),i}function el(e,t,r,l,i){var o={capture:l,passive:i},a=Qi(e,t,r,o);(t===document.body||t===window||t===document)&&Hi(()=>{t.removeEventListener(e,a,o)})}function tl(e){for(var t=0;t<e.length;t++)Qr.add(e[t]);for(var r of Xt)r(e)}function ut(e){var j;var t=this,r=t.ownerDocument,l=e.type,i=((j=e.composedPath)==null?void 0:j.call(e))||[],o=i[0]||e.target,a=0,f=e.__root;if(f){var s=i.indexOf(f);if(s!==-1&&(t===document||t===window)){e.__root=t;return}var c=i.indexOf(t);if(c===-1)return;s<=c&&(a=s)}if(o=i[a]||e.target,o!==t){Ct(e,"currentTarget",{configurable:!0,get(){return o||r}});var v=C,h=S;Ae(null),Re(null);try{for(var g,m=[];o!==null;){var b=o.assignedSlot||o.parentNode||o.host||null;try{var L=o["__"+l];if(L!=null&&(!o.disabled||e.target===o))if(gr(L)){var[F,...Z]=L;F.apply(o,[e,...Z])}else L.call(o,e)}catch(V){g?m.push(V):g=V}if(e.cancelBubble||b===t||b===null)break;o=b}if(g){for(let V of m)queueMicrotask(()=>{throw V});throw g}}finally{e.__root=t,delete e.currentTarget,Ae(v),Re(h)}}}function Qt(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function Se(e,t){var r=S;r.nodes_start===null&&(r.nodes_start=e,r.nodes_end=t)}function ge(e,t){var r=(t&ri)!==0,l=(t&ni)!==0,i,o=!e.startsWith("<!>");return()=>{if(D)return Se(z,null),z;i===void 0&&(i=Qt(o?e:"<!>"+e),r||(i=we(i)));var a=l||Ir?document.importNode(i,!0):i.cloneNode(!0);if(r){var f=we(a),s=a.lastChild;Se(f,s)}else Se(a,a);return a}}function rl(e,t,r="svg"){var l=!e.startsWith("<!>"),i=`<${r}>${l?e:"<!>"+e}</${r}>`,o;return()=>{if(D)return Se(z,null),z;if(!o){var a=Qt(i),f=we(a);o=we(f)}var s=o.cloneNode(!0);return Se(s,s),s}}function ne(e,t){if(D){S.nodes_end=z,Ze();return}e!==null&&e.before(t)}function en(e,t){return tn(e,t)}function nl(e,t){Bt(),t.intro=t.intro??!1;const r=t.target,l=D,i=z;try{for(var o=we(r);o&&(o.nodeType!==8||o.data!==Mt);)o=Ce(o);if(!o)throw Be;Ye(!0),ke(o),Ze();const a=tn(e,{...t,anchor:o});if(z===null||z.nodeType!==8||z.data!==ur)throw At(),Be;return Ye(!1),a}catch(a){if(a===Be)return t.recover===!1&&bi(),Bt(),Ni(r),Ye(!1),en(e,t);throw a}finally{Ye(l),ke(i)}}const Ke=new Map;function tn(e,{target:t,anchor:r,props:l={},events:i,context:o,intro:a=!0}){Bt();var f=new Set,s=h=>{for(var g=0;g<h.length;g++){var m=h[g];if(!f.has(m)){f.add(m);var b=Ki(m);t.addEventListener(m,ut,{passive:b});var L=Ke.get(m);L===void 0?(document.addEventListener(m,ut,{passive:b}),Ke.set(m,1)):Ke.set(m,L+1)}}};s(fi(Qr)),Xt.add(s);var c=void 0,v=Yi(()=>{var h=r??t.appendChild(qt());return Pt(()=>{if(o){Yr({});var g=H;g.c=o}i&&(l.$$events=i),D&&Se(h,null),c=e(h,l)||{},D&&(S.nodes_end=z),o&&Zr()}),()=>{var b;for(var g of f){t.removeEventListener(g,ut);var m=Ke.get(g);--m===0?(document.removeEventListener(g,ut),Ke.delete(g)):Ke.set(g,m)}Xt.delete(s),h!==r&&((b=h.parentNode)==null||b.removeChild(h))}});return er.set(c,v),c}let er=new WeakMap;function il(e,t){const r=er.get(e);return r?(er.delete(e),r(t)):Promise.resolve()}function Te(e,t,[r,l]=[0,0]){D&&r===0&&Ze();var i=e,o=null,a=null,f=Y,s=r>0?jt:0,c=!1;const v=(g,m=!0)=>{c=!0,h(m,g)},h=(g,m)=>{if(f===(f=g))return;let b=!1;if(D&&l!==-1){if(r===0){const F=i.data;F===Mt?l=0:F===fr?l=1/0:(l=parseInt(F.substring(1)),l!==l&&(l=f?1/0:-1))}const L=l>r;!!f===L&&(i=Ti(),ke(i),Ye(!1),b=!0,l=-1)}f?(o?Br(o):m&&(o=Pt(()=>m(i))),a&&Kt(a,()=>{a=null})):(a?Br(a):m&&(a=Pt(()=>m(i,[r+1,l]))),o&&Kt(o,()=>{o=null})),b&&Ye(!0)};Jt(()=>{c=!1,t(v),c||h(null,null)},s),D&&(i=z)}function Xe(e,t,r,l,i){var o=e,a="",f;Jt(()=>{if(a===(a=t()??"")){D&&Ze();return}f!==void 0&&(Ee(f),f=void 0),a!==""&&(f=Pt(()=>{if(D){z.data;for(var s=Ze(),c=s;s!==null&&(s.nodeType!==8||s.data!=="");)c=s,s=Ce(s);if(s===null)throw At(),Be;Se(z,c),o=ke(s);return}var v=a+"",h=Qt(v);Se(we(h),h.lastChild),o.before(h)}))})}function ll(e,t,r,l,i){var f;D&&Ze();var o=(f=t.$$slots)==null?void 0:f[r],a=!1;o===!0&&(o=t.children,a=!0),o===void 0||o(e,a?()=>l:l)}function ol(e,t){Vt(()=>{var r=e.getRootNode(),l=r.host?r:r.head??r.ownerDocument.head;if(!l.querySelector("#"+t.hash)){const i=document.createElement("style");i.id=t.hash,i.textContent=t.code,l.appendChild(i)}})}const rn=[...`
|
|
3
|
+
\r\f \v\uFEFF`];function al(e,t,r){var l=""+e;if(r){for(var i in r)if(r[i])l=l?l+" "+i:i;else if(l.length)for(var o=i.length,a=0;(a=l.indexOf(i,a))>=0;){var f=a+o;(a===0||rn.includes(l[a-1]))&&(f===l.length||rn.includes(l[f]))?l=(a===0?"":l.substring(0,a))+l.substring(f+1):a=f}}return l===""?null:l}function sl(e,t,r,l,i,o){var a=e.__className;if(D||a!==r){var f=al(r,l,o);(!D||f!==e.getAttribute("class"))&&(f==null?e.removeAttribute("class"):e.className=f),e.__className=r}else if(o&&i!==o)for(var s in o){var c=!!o[s];(i==null||c!==!!i[s])&&e.classList.toggle(s,c)}return o}const fl=Symbol("is custom element"),ul=Symbol("is html");function nn(e){if(D){var t=!1,r=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var l=e.value;ue(e,"value",null),e.value=l}if(e.hasAttribute("checked")){var i=e.checked;ue(e,"checked",null),e.checked=i}}};e.__on_r=r,hi(r),Kr()}}function cl(e,t){var r=ln(e);r.value===(r.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function ue(e,t,r,l){var i=ln(e);D&&(i[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||i[t]!==(i[t]=r)&&(t==="loading"&&(e[ai]=r),r==null?e.removeAttribute(t):typeof r!="string"&&dl(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function ln(e){return e.__attributes??(e.__attributes={[fl]:e.nodeName.includes("-"),[ul]:e.namespaceURI===ii})}var on=new Map;function dl(e){var t=on.get(e.nodeName);if(t)return t;on.set(e.nodeName,t=[]);for(var r,l=e,i=Element.prototype;i!==l;){r=ui(l);for(var o in r)r[o].set&&t.push(o);l=_r(l)}return t}function vl(e,t,r=t){Xi(e,"change",l=>{var i=l?e.defaultChecked:e.checked;r(i)}),(D&&e.defaultChecked!==e.checked||Ge(t)==null)&&r(e.checked),Gt(()=>{var l=t();e.checked=!!l})}function an(e,t){return e===t||(e==null?void 0:e[lt])===t}function sn(e={},t,r,l){return Zt(()=>{var i,o;return Gt(()=>{i=o,o=[],Ge(()=>{e!==r(...o)&&(t(e,...o),i&&an(r(...i),e)&&t(null,...i))})}),()=>{Vt(()=>{o&&an(r(...o),e)&&t(null,...o)})}}),e}function fn(e){H===null&&Hr(),Yt(()=>{const t=Ge(e);if(typeof t=="function")return t})}function hl(e){H===null&&Hr(),fn(()=>()=>Ge(e))}let Ot=!1;function gl(e){var t=Ot;try{return Ot=!1,[e(),Ot]}finally{Ot=t}}function R(e,t,r,l){var Ue;var i=(r&Xn)!==0,o=!0,a=(r&ei)!==0,f=(r&ti)!==0,s=!1,c;a?[c,s]=gl(()=>e[t]):c=e[t];var v=lt in e||hr in e,h=a&&(((Ue=Oe(e,t))==null?void 0:Ue.set)??(v&&t in e&&(M=>e[t]=M)))||void 0,g=l,m=!0,b=!1,L=()=>(b=!0,m&&(m=!1,f?g=Ge(l):g=l),g);c===void 0&&l!==void 0&&(h&&o&&yi(),c=L(),h&&h(c));var F;if(F=()=>{var M=e[t];return M===void 0?L():(m=!0,b=!1,M)},(r&Qn)===0)return F;if(h){var Z=e.$$legacy;return function(M,B){return arguments.length>0?((!B||Z||s)&&h(B?F():M),M):F()}}var j=!1,V=xr(c),G=ze(()=>{var M=F(),B=d(V);return j?(j=!1,B):V.v=M});return i||(G.equals=Er),function(M,B){if(arguments.length>0){const $e=B?d(G):a?se(M):M;return G.equals($e)||(j=!0,O(V,$e),b&&g!==void 0&&(g=$e),Ge(()=>d(G))),M}return d(G)}}function _l(e){return new ml(e)}class ml{constructor(t){ar(this,xe);ar(this,ie);var o;var r=new Map,l=(a,f)=>{var s=xr(f);return r.set(a,s),s};const i=new Proxy({...t.props||{},$$events:{}},{get(a,f){return d(r.get(f)??l(f,Reflect.get(a,f)))},has(a,f){return f===hr?!0:(d(r.get(f)??l(f,Reflect.get(a,f))),Reflect.has(a,f))},set(a,f,s){return O(r.get(f)??l(f,s),s),Reflect.set(a,f,s)}});sr(this,ie,(t.hydrate?nl:en)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((o=t==null?void 0:t.props)!=null&&o.$$host)||t.sync===!1)&&x(),sr(this,xe,i.$$events);for(const a of Object.keys(K(this,ie)))a==="$set"||a==="$destroy"||a==="$on"||Ct(this,a,{get(){return K(this,ie)[a]},set(f){K(this,ie)[a]=f},enumerable:!0});K(this,ie).$set=a=>{Object.assign(i,a)},K(this,ie).$destroy=()=>{il(K(this,ie))}}$set(t){K(this,ie).$set(t)}$on(t,r){K(this,xe)[t]=K(this,xe)[t]||[];const l=(...i)=>r.call(this,...i);return K(this,xe)[t].push(l),()=>{K(this,xe)[t]=K(this,xe)[t].filter(i=>i!==l)}}$destroy(){K(this,ie).$destroy()}}xe=new WeakMap,ie=new WeakMap;let un;typeof HTMLElement=="function"&&(un=class extends HTMLElement{constructor(t,r,l){super();ce(this,"$$ctor");ce(this,"$$s");ce(this,"$$c");ce(this,"$$cn",!1);ce(this,"$$d",{});ce(this,"$$r",!1);ce(this,"$$p_d",{});ce(this,"$$l",{});ce(this,"$$l_u",new Map);ce(this,"$$me");this.$$ctor=t,this.$$s=r,l&&this.attachShadow({mode:"open"})}addEventListener(t,r,l){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(r),this.$$c){const i=this.$$c.$on(t,r);this.$$l_u.set(r,i)}super.addEventListener(t,r,l)}removeEventListener(t,r,l){if(super.removeEventListener(t,r,l),this.$$c){const i=this.$$l_u.get(r);i&&(i(),this.$$l_u.delete(r))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(i){return o=>{const a=document.createElement("slot");i!=="default"&&(a.name=i),ne(o,a)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const r={},l=pl(this);for(const i of this.$$s)i in l&&(i==="default"&&!this.$$d.children?(this.$$d.children=t(i),r.default=!0):r[i]=t(i));for(const i of this.attributes){const o=this.$$g_p(i.name);o in this.$$d||(this.$$d[o]=zt(o,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=_l({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:r,$$host:this}}),this.$$me=Wi(()=>{Gt(()=>{var i;this.$$r=!0;for(const o of kt(this.$$c)){if(!((i=this.$$p_d[o])!=null&&i.reflect))continue;this.$$d[o]=this.$$c[o];const a=zt(o,this.$$d[o],this.$$p_d,"toAttribute");a==null?this.removeAttribute(this.$$p_d[o].attribute||o):this.setAttribute(this.$$p_d[o].attribute||o,a)}this.$$r=!1})});for(const i in this.$$l)for(const o of this.$$l[i]){const a=this.$$c.$on(i,o);this.$$l_u.set(o,a)}this.$$l={}}}attributeChangedCallback(t,r,l){var i;this.$$r||(t=this.$$g_p(t),this.$$d[t]=zt(t,l,this.$$p_d,"toProp"),(i=this.$$c)==null||i.$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 kt(this.$$p_d).find(r=>this.$$p_d[r].attribute===t||!this.$$p_d[r].attribute&&r.toLowerCase()===t)||t}});function zt(e,t,r,l){var o;const i=(o=r[e])==null?void 0:o.type;if(t=i==="Boolean"&&typeof t!="boolean"?t!=null:t,!l||!r[e])return t;if(l==="toAttribute")switch(i){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(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function pl(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function wl(e,t,r,l,i,o){let a=class extends un{constructor(){super(e,r,i),this.$$p_d=t}static get observedAttributes(){return kt(t).map(f=>(t[f].attribute||f).toLowerCase())}};return kt(t).forEach(f=>{Ct(a.prototype,f,{get(){return this.$$c&&f in this.$$c?this.$$c[f]:this.$$d[f]},set(s){var h;s=zt(f,s,t),this.$$d[f]=s;var c=this.$$c;if(c){var v=(h=Oe(c,f))==null?void 0:h.get;v?c[f]=s:c.$set({[f]:s})}}})}),l.forEach(f=>{Ct(a.prototype,f,{get(){var s;return(s=this.$$c)==null?void 0:s[f]}})}),e.element=a,a}const cn=new TextEncoder;function bl(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function yl(e,t="SHA-256",r=1e5){const l=Date.now().toString(16);e||(e=Math.round(Math.random()*r));const i=await dn(l,e,t);return{algorithm:t,challenge:i,salt:l,signature:""}}async function dn(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 bl(await crypto.subtle.digest(r.toUpperCase(),cn.encode(e+t)))}function El(e,t,r="SHA-256",l=1e6,i=0){const o=new AbortController,a=Date.now();return{promise:(async()=>{for(let s=i;s<=l;s+=1){if(o.signal.aborted)return null;if(await dn(t,s,r)===e)return{number:s,took:Date.now()-a}}return null})(),controller:o}}function xl(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function $l(e){const t=atob(e),r=new Uint8Array(t.length);for(let l=0;l<t.length;l++)r[l]=t.charCodeAt(l);return r}function kl(e,t=12){const r=new Uint8Array(t);for(let l=0;l<t;l++)r[l]=e%256,e=Math.floor(e/256);return r}async function Cl(e,t="",r=1e6,l=0){const i="AES-GCM",o=new AbortController,a=Date.now(),f=async()=>{for(let v=l;v<=r;v+=1){if(o.signal.aborted||!s||!c)return null;try{const h=await crypto.subtle.decrypt({name:i,iv:kl(v)},s,c);if(h)return{clearText:new TextDecoder().decode(h),took:Date.now()-a}}catch{}}return null};let s=null,c=null;try{c=$l(e);const v=await crypto.subtle.digest("SHA-256",cn.encode(t));s=await crypto.subtle.importKey("raw",v,i,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:o}}return{promise:f(),controller:o}}var w=(e=>(e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(w||{}),Al=rl('<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="svelte-ddsc3z"><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" class="svelte-ddsc3z"></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" class="altcha-spinner svelte-ddsc3z"></path></svg>'),Rl=ge('<span role="status" aria-live="polite" class="svelte-ddsc3z"><!></span> <input type="hidden" class="svelte-ddsc3z">',1),Il=ge('<span role="status" aria-live="polite" class="svelte-ddsc3z"><!></span>'),Sl=ge('<label class="svelte-ddsc3z"><!></label>'),Tl=ge('<div class="svelte-ddsc3z"><a target="_blank" class="altcha-logo svelte-ddsc3z"><svg width="22" height="22" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" class="svelte-ddsc3z"><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" class="svelte-ddsc3z"></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" class="svelte-ddsc3z"></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" class="svelte-ddsc3z"></path></svg></a></div>'),Nl=ge('<div class="svelte-ddsc3z"><!></div>'),Ll=ge('<div class="svelte-ddsc3z"><!></div>'),Dl=ge('<div class="altcha-error svelte-ddsc3z"><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" class="svelte-ddsc3z"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" class="svelte-ddsc3z"></path></svg> <!></div>'),Pl=ge('<div class="altcha-footer svelte-ddsc3z"><div class="svelte-ddsc3z"><!></div></div>'),Ol=ge('<div class="altcha-anchor-arrow svelte-ddsc3z"></div>'),zl=ge('<!> <div class="altcha svelte-ddsc3z"><div class="altcha-main svelte-ddsc3z"><!> <div><input type="checkbox" class="svelte-ddsc3z"></div> <div class="altcha-label svelte-ddsc3z"><!></div> <!></div> <!> <!> <!></div>',1);const Fl={hash:"svelte-ddsc3z",code:`.altcha.svelte-ddsc3z {background:var(--altcha-color-base, transparent);border:var(--altcha-border-width, 1px) solid var(--altcha-color-border, #a0a0a0);border-radius:var(--altcha-border-radius, 3px);color:var(--altcha-color-text, currentColor);display:flex;flex-direction:column;max-width:var(--altcha-max-width, 260px);position:relative;text-align:left;}.altcha.svelte-ddsc3z:focus-within {border-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating].svelte-ddsc3z {background:var(--altcha-color-base, white);display:none;filter:drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.2));left:-100%;position:fixed;top:-100%;width:var(--altcha-max-width, 260px);z-index:999999;}.altcha[data-floating=top].svelte-ddsc3z .altcha-anchor-arrow:where(.svelte-ddsc3z) {border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto;}.altcha[data-floating=bottom].svelte-ddsc3z:focus-within::after {border-bottom-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating=top].svelte-ddsc3z:focus-within::after {border-top-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating].svelte-ddsc3z:not([data-state=unverified]) {display:block;}.altcha-anchor-arrow.svelte-ddsc3z {border:6px solid transparent;border-bottom-color:var(--altcha-color-border, #a0a0a0);content:"";height:0;left:12px;position:absolute;top:-12px;width:0;}.altcha-main.svelte-ddsc3z {align-items:center;display:flex;gap:0.4rem;padding:0.7rem;}.altcha-label.svelte-ddsc3z {flex-grow:1;}.altcha-label.svelte-ddsc3z label:where(.svelte-ddsc3z) {cursor:pointer;}.altcha-logo.svelte-ddsc3z {color:currentColor;opacity:0.3;}.altcha-logo.svelte-ddsc3z:hover {opacity:1;}.altcha-error.svelte-ddsc3z {color:var(--altcha-color-error-text, #f23939);display:flex;font-size:0.85rem;gap:0.3rem;padding:0 0.7rem 0.7rem;}.altcha-footer.svelte-ddsc3z {align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:0.75rem;opacity:0.4;padding:0.2rem 0.7rem;text-align:right;}.altcha-footer.svelte-ddsc3z:hover {opacity:1;}.altcha-footer.svelte-ddsc3z > :where(.svelte-ddsc3z):first-child {flex-grow:1;}.altcha-footer.svelte-ddsc3z a {color:currentColor;}.altcha-checkbox.svelte-ddsc3z {display:flex;align-items:center;height:24px;width:24px;}.altcha-checkbox.svelte-ddsc3z input:where(.svelte-ddsc3z) {width:18px;height:18px;margin:0;}.altcha-hidden.svelte-ddsc3z {display:none;}.altcha-spinner.svelte-ddsc3z {
|
|
4
4
|
animation: svelte-ddsc3z-altcha-spinner 0.75s infinite linear;transform-origin:center;}
|
|
5
5
|
|
|
6
6
|
@keyframes svelte-ddsc3z-altcha-spinner {
|
|
7
7
|
100% {
|
|
8
8
|
transform: rotate(360deg);
|
|
9
9
|
}
|
|
10
|
-
}`};function
|
|
11
|
-
`):x),_},{})}function jl(){const n=ge()!==void 0?ge().split(","):void 0;for(const u of globalThis.altchaPlugins)(!n||n.includes(u.pluginName))&&Le.push(new u({el:d(W),clarify:vt,dispatch:ct,getConfiguration:Ln,getFloatingAnchor:Dn,getState:Pn,log:T,reset:ht,solve:Tn,setState:je,setFloatingAnchor:On,verify:De}))}function T(...n){(f()||n.some(u=>u instanceof Error))&&console[n[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${L()}]`,...n)}function Vl(){[y.UNVERIFIED,y.ERROR,y.EXPIRED].includes(d(I))?D()!==!1&&(b==null?void 0:b.reportValidity())===!1?z(Qe,!1):U()?vt():De():z(Qe,!0)}function bn(n){const u=n.target;v()&&u&&!d(W).contains(u)&&(d(I)===y.VERIFIED||r()==="off"&&d(I)===y.UNVERIFIED)&&(d(W).style.display="none")}function En(){v()&&d(I)!==y.UNVERIFIED&&Ot()}function Bl(n){for(const u of Le)typeof u.onErrorChange=="function"&&u.onErrorChange(d(tt))}function xn(n){d(I)===y.UNVERIFIED&&De()}function $n(n){b&&r()==="onsubmit"?d(I)===y.UNVERIFIED?(n.preventDefault(),n.stopPropagation(),De().then(()=>{b==null||b.requestSubmit()})):d(I)!==y.VERIFIED&&(n.preventDefault(),n.stopPropagation(),d(I)===y.VERIFYING&&Cn()):b&&v()&&r()==="off"&&d(I)===y.UNVERIFIED&&(n.preventDefault(),n.stopPropagation(),d(W).style.display="block",Ot())}function kn(){ht()}function Cn(){d(I)===y.VERIFYING&&d(le).waitAlert&&alert(d(le).waitAlert)}function ql(n){for(const u of Le)typeof u.onStateChange=="function"&&u.onStateChange(d(I));v()&&d(I)!==y.UNVERIFIED&&requestAnimationFrame(()=>{Ot()}),z(Qe,d(I)===y.VERIFIED)}function An(){v()&&Ot()}function Rn(n){return JSON.parse(n)}function Ot(n=20){if(d(W))if(et||(et=(h()?document.querySelector(h()):b==null?void 0:b.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||b),et){const u=parseInt(g(),10)||12,_=et.getBoundingClientRect(),E=d(W).getBoundingClientRect(),N=document.documentElement.clientHeight,x=document.documentElement.clientWidth,p=v()==="auto"?_.bottom+E.height+u+n>N:v()==="top",Z=Math.max(n,Math.min(x-n-E.width,_.left+_.width/2-E.width/2));if(p?d(W).style.top=`${_.top-(E.height+u)}px`:d(W).style.top=`${_.bottom+u}px`,d(W).style.left=`${Z}px`,d(W).setAttribute("data-floating",p?"top":"bottom"),d(dt)){const O=d(dt).getBoundingClientRect();d(dt).style.left=_.left-Z+_.width/2-O.width/2+"px"}}else T("unable to find floating anchor element")}async function Hl(n){if(!Ne())throw new Error("Attribute verifyurl not set.");T("requesting server verification from",Ne());const u={payload:n};if(D()!==!1){const{blockedCountries:N,classifier:x,disableRules:p,email:Z,expectedLanguages:O,expectedCountries:nt,fields:_t,ipAddress:mt,text:ia,timeZone:Hn}=Ml();u.blockedCountries=N,u.classifier=x,u.disableRules=p,u.email=Z===!1?void 0:Fl(Z),u.expectedCountries=nt,u.expectedLanguages=O||(_n?[_n]:void 0),u.fields=_t===!1?void 0:Ul(_t),u.ipAddress=mt===!1?void 0:mt||"auto",u.text=ia,u.timeZone=Hn===!1?void 0:Hn||yl()}const _=await fetch(Ne(),{body:JSON.stringify(u),headers:{"content-type":"application/json"},method:"POST"});if(_.status!==200)throw new Error(`Server responded with ${_.status}.`);const E=await _.json();if(E!=null&&E.payload&&z(Ue,oe(E.payload)),ct("serververification",E),l()&&E.classification==="BAD")throw new Error("SpamFilter returned negative classification.")}function rr(n){T("expire",n),_e&&(clearTimeout(_e),_e=null),n<1?yn():_e=setTimeout(yn,n)}function Sn(n){T("floating",n),v()!==n&&(d(W).style.left="",d(W).style.top=""),v(n===!0||n===""?"auto":n===!1||n==="false"?void 0:v()),v()?(r()||r("onsubmit"),document.addEventListener("scroll",En),document.addEventListener("click",bn),window.addEventListener("resize",An)):r()==="onsubmit"&&r(void 0)}function In(n){if(!n.algorithm)throw new Error("Invalid challenge. Property algorithm is missing.");if(n.signature===void 0)throw new Error("Invalid challenge. Property signature is missing.");if(!vn.includes(n.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${vn.join(", ")}`);if(!n.challenge||n.challenge.length<40)throw new Error("Challenge is too short. Min. 40 chars.");if(!n.salt||n.salt.length<10)throw new Error("Salt is too short. Min. 10 chars.")}async function Tn(n){let u=null;if("Worker"in window){try{u=await Wl(n,n.maxnumber)}catch(_){T(_)}if((u==null?void 0:u.number)!==void 0||"obfuscated"in n)return{data:n,solution:u}}if("obfuscated"in n){const _=await xl(n.obfuscated,n.key,n.maxnumber);return{data:n,solution:await _.promise}}return{data:n,solution:await pl(n.challenge,n.salt,n.algorithm,n.maxnumber||ee()).promise}}async function Wl(n,u=typeof B()=="number"?B():ee(),_=Math.ceil(Xe())){const E=[];_=Math.min(16,Math.max(1,_));for(let p=0;p<_;p++)E.push(altchaCreateWorker(ut()));const N=Math.ceil(u/_),x=await Promise.all(E.map((p,Z)=>{const O=Z*N;return new Promise(nt=>{p.addEventListener("message",_t=>{if(_t.data)for(const mt of E)mt!==p&&mt.postMessage({type:"abort"});nt(_t.data)}),p.postMessage({payload:n,max:O+N,start:O,type:"work"})})}));for(const p of E)p.terminate();return x.find(p=>!!p)||null}async function vt(){if(!U()){je(y.ERROR);return}const n=Le.find(u=>u.constructor.pluginName==="obfuscation");if(!n||!("clarify"in n)){je(y.ERROR),T("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");return}if("clarify"in n&&typeof n.clarify=="function")return n.clarify()}function Nn(n){n.obfuscated!==void 0&&U(n.obfuscated),n.auto!==void 0&&(r(n.auto),r()==="onload"&&(U()?vt():De())),n.blockspam!==void 0&&l(!!n.blockspam),n.customfetch!==void 0&&o(n.customfetch),n.floatinganchor!==void 0&&h(n.floatinganchor),n.delay!==void 0&&s(n.delay),n.floatingoffset!==void 0&&g(n.floatingoffset),n.floating!==void 0&&Sn(n.floating),n.expire!==void 0&&(rr(n.expire),c(n.expire)),n.challenge&&(a(typeof n.challenge=="string"?n.challenge:JSON.stringify(n.challenge)),In(d(tr))),n.challengeurl!==void 0&&i(n.challengeurl),n.debug!==void 0&&f(!!n.debug),n.hidefooter!==void 0&&m(!!n.hidefooter),n.hidelogo!==void 0&&w(!!n.hidelogo),n.maxnumber!==void 0&&ee(+n.maxnumber),n.mockerror!==void 0&&V(!!n.mockerror),n.name!==void 0&&L(n.name),n.refetchonexpire!==void 0&&Te(!!n.refetchonexpire),n.spamfilter!==void 0&&D(typeof n.spamfilter=="object"?n.spamfilter:!!n.spamfilter),n.strings&&ie(typeof n.strings=="string"?n.strings:JSON.stringify(n.strings)),n.test!==void 0&&B(typeof n.test=="number"?n.test:!!n.test),n.verifyurl!==void 0&&Ne(n.verifyurl),n.workers!==void 0&&Xe(+n.workers),n.workerurl!==void 0&&ut(n.workerurl)}function Ln(){return{auto:r(),blockspam:l(),challengeurl:i(),debug:f(),delay:s(),expire:c(),floating:v(),floatinganchor:h(),floatingoffset:g(),hidefooter:m(),hidelogo:w(),name:L(),maxnumber:ee(),mockerror:V(),obfuscated:U(),refetchonexpire:Te(),spamfilter:D(),strings:d(le),test:B(),verifyurl:Ne(),workers:Xe(),workerurl:ut()}}function Dn(){return et}function Yl(n){return Le.find(u=>u.constructor.pluginName===n)}function Pn(){return d(I)}function ht(n=y.UNVERIFIED,u=null){_e&&(clearTimeout(_e),_e=null),z(Qe,!1),z(Ue,null),je(n,u)}function On(n){et=n}function je(n,u=null){z(I,oe(n)),z(tt,oe(u)),ct("statechange",{payload:d(Ue),state:d(I)})}async function De(){return ht(y.VERIFYING),await new Promise(n=>setTimeout(n,s()||0)),zl().then(n=>(In(n),T("challenge",n),Tn(n))).then(({data:n,solution:u})=>{if(T("solution",u),"challenge"in n&&u&&!("clearText"in u))if((u==null?void 0:u.number)!==void 0){if(Ne())return Hl(pn(n,u));z(Ue,oe(pn(n,u))),T("payload",d(Ue))}else throw T("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."),new Error("Unexpected result returned.")}).then(()=>{je(y.VERIFIED),T("verified"),Fi().then(()=>{ct("verified",{payload:d(Ue)})})}).catch(n=>{T(n),je(y.ERROR,n.message)})}var zn=Dl(),Fn=Ir(zn);rl(Fn,t,"default",{});var gt=ye(Fn,2),nr=X(gt),Mn=X(nr);{var Zl=n=>{var u=$l();re(n,u)};Ie(Mn,n=>{d(I)===y.VERIFYING&&n(Zl)})}var zt=ye(Mn,2);let Un;var rt=X(zt);tn(rt),rt.__change=Vl,K(zt);var ir=ye(zt,2),Gl=X(ir);{var Jl=n=>{var u=kl(),_=Ir(u),E=X(_);Ke(E,()=>d(le).verified),K(_);var N=ye(_,2);tn(N),Ge(()=>{fe(N,"name",L()),sl(N,d(Ue))}),re(n,u)},Kl=(n,u)=>{{var _=N=>{var x=Cl(),p=X(x);Ke(p,()=>d(le).verifying),K(x),re(N,x)},E=N=>{var x=Al(),p=X(x);Ke(p,()=>d(le).label),K(x),Ge(()=>fe(x,"for",d(wn))),re(N,x)};Ie(n,N=>{d(I)===y.VERIFYING?N(_):N(E,!1)},u)}};Ie(Gl,n=>{d(I)===y.VERIFIED?n(Jl):n(Kl,!1)})}K(ir);var Xl=ye(ir,2);{var Ql=n=>{var u=Rl(),_=X(u);fe(_,"href",gn),K(u),Ge(()=>fe(_,"aria-label",d(le).ariaLinkLabel)),re(n,u)};Ie(Xl,n=>{(w()!==!0||d(er))&&n(Ql)})}K(nr);var jn=ye(nr,2);{var ea=n=>{var u=Tl(),_=ye(X(u),2);{var E=x=>{var p=Sl(),Z=X(p);Ke(Z,()=>d(le).expired),K(p),Ge(()=>fe(p,"title",d(tt))),re(x,p)},N=x=>{var p=Il(),Z=X(p);Ke(Z,()=>d(le).error),K(p),Ge(()=>fe(p,"title",d(tt))),re(x,p)};Ie(_,x=>{d(I)===y.EXPIRED?x(E):x(N,!1)})}K(u),re(n,u)};Ie(jn,n=>{(d(tt)||d(I)===y.EXPIRED)&&n(ea)})}var Vn=ye(jn,2);{var ta=n=>{var u=Nl(),_=X(u),E=X(_);Ke(E,()=>d(le).footer),K(_),K(u),re(n,u)};Ie(Vn,n=>{d(le).footer&&(m()!==!0||d(er))&&n(ta)})}var ra=ye(Vn,2);{var na=n=>{var u=Ll();an(u,_=>z(dt,_),()=>d(dt)),re(n,u)};Ie(ra,n=>{v()&&n(na)})}return K(gt),an(gt,n=>z(W,n),()=>d(W)),Ge(n=>{fe(gt,"data-state",d(I)),fe(gt,"data-floating",v()),Un=ll(zt,1,"altcha-checkbox svelte-ddsc3z",null,Un,n),fe(rt,"id",d(wn)),rt.required=r()!=="onsubmit"&&(!v()||r()!=="off")},[()=>({"altcha-hidden":d(I)===y.VERIFYING})]),Ki("invalid",rt,Cn),ul(rt,()=>d(Qe),n=>z(Qe,n)),re(e,zn),Wr({clarify:vt,configure:Nn,getConfiguration:Ln,getFloatingAnchor:Dn,getPlugin:Yl,getState:Pn,reset:ht,setFloatingAnchor:On,setState:je,verify:De,get auto(){return r()},set auto(n=void 0){r(n),C()},get blockspam(){return l()},set blockspam(n=void 0){l(n),C()},get challengeurl(){return i()},set challengeurl(n=void 0){i(n),C()},get challengejson(){return a()},set challengejson(n=void 0){a(n),C()},get customfetch(){return o()},set customfetch(n=void 0){o(n),C()},get debug(){return f()},set debug(n=!1){f(n),C()},get delay(){return s()},set delay(n=0){s(n),C()},get expire(){return c()},set expire(n=void 0){c(n),C()},get floating(){return v()},set floating(n=void 0){v(n),C()},get floatinganchor(){return h()},set floatinganchor(n=void 0){h(n),C()},get floatingoffset(){return g()},set floatingoffset(n=void 0){g(n),C()},get hidefooter(){return m()},set hidefooter(n=!1){m(n),C()},get hidelogo(){return w()},set hidelogo(n=!1){w(n),C()},get id(){return M()},set id(n=void 0){M(n),C()},get name(){return L()},set name(n="altcha"){L(n),C()},get maxnumber(){return ee()},set maxnumber(n=1e6){ee(n),C()},get mockerror(){return V()},set mockerror(n=!1){V(n),C()},get obfuscated(){return U()},set obfuscated(n=void 0){U(n),C()},get plugins(){return ge()},set plugins(n=void 0){ge(n),C()},get refetchonexpire(){return Te()},set refetchonexpire(n=!0){Te(n),C()},get spamfilter(){return D()},set spamfilter(n=!1){D(n),C()},get strings(){return ie()},set strings(n=void 0){ie(n),C()},get test(){return B()},set test(n=!1){B(n),C()},get verifyurl(){return Ne()},set verifyurl(n=void 0){Ne(n),C()},get workers(){return Xe()},set workers(n=Math.min(16,navigator.hardwareConcurrency||8)){Xe(n),C()},get workerurl(){return ut()},set workerurl(n=void 0){ut(n),C()}})}Xi(["change"]),customElements.define("altcha-widget",_l(cn,{blockspam:{type:"Boolean"},debug:{type:"Boolean"},delay:{type:"Number"},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:{},customfetch:{},floating:{},floatinganchor:{},id:{},name:{},obfuscated:{},plugins:{},spamfilter:{},strings:{},verifyurl:{},workerurl:{}},["default"],["clarify","configure","getConfiguration","getFloatingAnchor","getPlugin","getState","reset","setFloatingAnchor","setState","verify"],!1)),globalThis.altchaCreateWorker=e=>e?new Worker(new URL(e)):new wt,globalThis.altchaPlugins=globalThis.altchaPlugins||[],$.Altcha=cn,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})});
|
|
10
|
+
}`};function vn(e,t){var Wn,Yn;Yr(t,!0),ol(e,Fl);let r=R(t,"auto",7,void 0),l=R(t,"blockspam",7,void 0),i=R(t,"challengeurl",7,void 0),o=R(t,"challengejson",7,void 0),a=R(t,"customfetch",7,void 0),f=R(t,"debug",7,!1),s=R(t,"delay",7,0),c=R(t,"expire",7,void 0),v=R(t,"floating",7,void 0),h=R(t,"floatinganchor",7,void 0),g=R(t,"floatingoffset",7,void 0),m=R(t,"floatingpersist",7,!1),b=R(t,"hidefooter",7,!1),L=R(t,"hidelogo",7,!1),F=R(t,"id",7,void 0),Z=R(t,"name",7,"altcha"),j=R(t,"maxnumber",7,1e6),V=R(t,"mockerror",7,!1),G=R(t,"obfuscated",7,void 0),Ue=R(t,"plugins",7,void 0),M=R(t,"refetchonexpire",7,!0),B=R(t,"spamfilter",7,!1),$e=R(t,"strings",7,void 0),le=R(t,"test",7,!1),Ne=R(t,"verifyurl",7,void 0),Qe=R(t,"workers",23,()=>Math.min(16,navigator.hardwareConcurrency||8)),ct=R(t,"workerurl",7,void 0);const gn=["SHA-256","SHA-384","SHA-512"],_n="Visit Altcha.org",mn="https://altcha.org/",dt=(n,u)=>{t.$$host.dispatchEvent(new CustomEvent(n,{detail:u}))},pn=(Yn=(Wn=document.documentElement.lang)==null?void 0:Wn.split("-"))==null?void 0:Yn[0],tr=ze(()=>{var n;return i()&&new URL(i(),location.origin).host.endsWith(".altcha.org")&&!!((n=i())!=null&&n.includes("apiKey=ckey_"))}),rr=ze(()=>o()?Sn(o()):void 0),wn=ze(()=>$e()?Sn($e()):{}),oe=ze(()=>{var n;return{ariaLinkLabel:_n,error:"Verification failed. Try again later.",expired:"Verification expired. Try again.",footer:`Protected by <a href="${mn}" target="_blank" aria-label="${((n=d(wn))==null?void 0:n.ariaLinkLabel)||_n}">ALTCHA</a>`,label:"I'm not a robot",verified:"Verified",verifying:"Verifying...",waitAlert:"Verifying... please wait.",...d(wn)}}),bn=ze(()=>F()||`${Z()}_checkbox`);let et=We(!1),I=We(se(w.UNVERIFIED)),W=We(void 0),vt=We(null),tt=null,p=null,rt=We(null),_e=null,Le=[],je=We(null);Yt(()=>{Wl(d(rt))}),Yt(()=>{Yl(d(I))}),hl(()=>{Ml(),p&&(p.removeEventListener("submit",Cn),p.removeEventListener("reset",An),p.removeEventListener("focusin",kn),p=null),_e&&(clearTimeout(_e),_e=null),document.removeEventListener("click",xn),document.removeEventListener("scroll",$n),window.removeEventListener("resize",In)}),fn(()=>{var n;T("mounted","1.4.0"),T("workers",Qe()),ql(),T("plugins",Le.length?Le.map(u=>u.constructor.pluginName).join(", "):"none"),le()&&T("using test mode"),c()&&nr(c()),r()!==void 0&&T("auto",r()),v()!==void 0&&Tn(v()),p=(n=d(W))==null?void 0:n.closest("form"),p&&(p.addEventListener("submit",Cn,{capture:!0}),p.addEventListener("reset",An),(r()==="onfocus"||m()==="focus")&&p.addEventListener("focusin",kn)),r()==="onload"&&(G()?ht():De()),d(tr)&&(b()||L())&&T("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{dt("load")})});function yn(n,u){return btoa(JSON.stringify({algorithm:n.algorithm,challenge:n.challenge,number:u.number,salt:n.salt,signature:n.signature,test:le()?!0:void 0,took:u.took}))}function Ml(){for(const n of Le)n.destroy()}function En(){i()&&M()&&d(I)===w.VERIFIED?De():_t(w.EXPIRED,d(oe).expired)}async function Ul(){var n;if(V())throw T("mocking error"),new Error("Mocked error.");if(d(rr))return T("using provided json data"),d(rr);if(le())return T("generating test challenge",{test:le()}),yl(typeof le()!="boolean"?+le():void 0);{if(!i()&&p){const P=p.getAttribute("action");P!=null&&P.includes("/form/")&&i(P+"/altcha")}if(!i())throw new Error("Attribute challengeurl not set.");T("fetching challenge from",i());let u=null,_=null;if(a())if(T("using customfetch"),typeof a()=="string"){if(u=globalThis[a()]||null,!u)throw new Error(`Custom fetch function not found: ${a()}`)}else u=a();const E={headers:B()!==!1?{"x-altcha-spam-filter":"1"}:{}};if(u){if(_=await u(i(),E),!_||!(_ instanceof Response))throw new Error("Custom fetch function did not return a response.")}else _=await fetch(i(),E);if(_.status!==200)throw new Error(`Server responded with ${_.status}.`);const N=_.headers.get("X-Altcha-Config"),$=await _.json(),y=new URLSearchParams((n=$.salt.split("?"))==null?void 0:n[1]),J=y.get("expires")||y.get("expire");if(J){const P=new Date(+J*1e3),it=isNaN(P.getTime())?0:P.getTime()-Date.now();it>0&&nr(it)}if(N)try{const P=JSON.parse(N);P&&typeof P=="object"&&(P.verifyurl&&(P.verifyurl=new URL(P.verifyurl,new URL(i())).toString()),Dn(P))}catch(P){T("unable to configure from X-Altcha-Config",P)}return $}}function jl(n){var _;const u=p==null?void 0:p.querySelector(typeof n=="string"?`input[name="${n}"]`:'input[type="email"]:not([data-no-spamfilter])');return((_=u==null?void 0:u.value)==null?void 0:_.slice(u.value.indexOf("@")))||void 0}function Vl(){return B()==="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 B()=="object"?B():{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 Bl(n){return[...(p==null?void 0:p.querySelectorAll(n!=null&&n.length?n.map(_=>`input[name="${_}"]`).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'))||[]].reduce((_,E)=>{const N=E.name,$=E.value;return N&&$&&(_[N]=/\n/.test($)?$.replace(new RegExp("(?<!\\r)\\n","g"),`\r
|
|
11
|
+
`):$),_},{})}function ql(){const n=Ue()!==void 0?Ue().split(","):void 0;for(const u of globalThis.altchaPlugins)(!n||n.includes(u.pluginName))&&Le.push(new u({el:d(W),clarify:ht,dispatch:dt,getConfiguration:Pn,getFloatingAnchor:On,getState:zn,log:T,reset:_t,solve:Ln,setState:Ve,setFloatingAnchor:Mn,verify:De}))}function T(...n){(f()||n.some(u=>u instanceof Error))&&console[n[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${Z()}]`,...n)}function Hl(){[w.UNVERIFIED,w.ERROR,w.EXPIRED].includes(d(I))?B()!==!1&&(p==null?void 0:p.reportValidity())===!1?O(et,!1):G()?ht():De():O(et,!0)}function xn(n){const u=n.target;v()&&u&&!d(W).contains(u)&&(d(I)===w.VERIFIED&&m()===!1||d(I)===w.VERIFIED&&m()==="focus"&&!(p!=null&&p.matches(":focus-within"))||r()==="off"&&d(I)===w.UNVERIFIED)&&Fn()}function $n(){v()&&d(I)!==w.UNVERIFIED&>()}function Wl(n){for(const u of Le)typeof u.onErrorChange=="function"&&u.onErrorChange(d(rt))}function kn(n){d(I)===w.UNVERIFIED?De():v()&&m()==="focus"&&d(I)===w.VERIFIED&&ir()}function Cn(n){p&&r()==="onsubmit"?d(I)===w.UNVERIFIED?(n.preventDefault(),n.stopPropagation(),De().then(()=>{p==null||p.requestSubmit()})):d(I)!==w.VERIFIED&&(n.preventDefault(),n.stopPropagation(),d(I)===w.VERIFYING&&Rn()):p&&v()&&r()==="off"&&d(I)===w.UNVERIFIED&&(n.preventDefault(),n.stopPropagation(),ir())}function An(){_t()}function Rn(){d(I)===w.VERIFYING&&d(oe).waitAlert&&alert(d(oe).waitAlert)}function Yl(n){for(const u of Le)typeof u.onStateChange=="function"&&u.onStateChange(d(I));v()&&d(I)!==w.UNVERIFIED&&requestAnimationFrame(()=>{gt()}),O(et,d(I)===w.VERIFIED)}function In(){v()&>()}function Sn(n){return JSON.parse(n)}async function Zl(n){if(!Ne())throw new Error("Attribute verifyurl not set.");T("requesting server verification from",Ne());const u={payload:n};if(B()!==!1){const{blockedCountries:N,classifier:$,disableRules:y,email:J,expectedLanguages:P,expectedCountries:it,fields:pt,ipAddress:wt,text:ao,timeZone:Zn}=Vl();u.blockedCountries=N,u.classifier=$,u.disableRules=y,u.email=J===!1?void 0:jl(J),u.expectedCountries=it,u.expectedLanguages=P||(pn?[pn]:void 0),u.fields=pt===!1?void 0:Bl(pt),u.ipAddress=wt===!1?void 0:wt||"auto",u.text=ao,u.timeZone=Zn===!1?void 0:Zn||xl()}const _=await fetch(Ne(),{body:JSON.stringify(u),headers:{"content-type":"application/json"},method:"POST"});if(_.status!==200)throw new Error(`Server responded with ${_.status}.`);const E=await _.json();if(E!=null&&E.payload&&O(je,se(E.payload)),dt("serververification",E),l()&&E.classification==="BAD")throw new Error("SpamFilter returned negative classification.")}function nr(n){T("expire",n),_e&&(clearTimeout(_e),_e=null),n<1?En():_e=setTimeout(En,n)}function Tn(n){T("floating",n),v()!==n&&(d(W).style.left="",d(W).style.top=""),v(n===!0||n===""?"auto":n===!1||n==="false"?void 0:v()),v()?(r()||r("onsubmit"),document.addEventListener("scroll",$n),document.addEventListener("click",xn),window.addEventListener("resize",In)):r()==="onsubmit"&&r(void 0)}function Nn(n){if(!n.algorithm)throw new Error("Invalid challenge. Property algorithm is missing.");if(n.signature===void 0)throw new Error("Invalid challenge. Property signature is missing.");if(!gn.includes(n.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${gn.join(", ")}`);if(!n.challenge||n.challenge.length<40)throw new Error("Challenge is too short. Min. 40 chars.");if(!n.salt||n.salt.length<10)throw new Error("Salt is too short. Min. 10 chars.")}async function Ln(n){let u=null;if("Worker"in window){try{u=await Gl(n,n.maxNumber||n.maxnumber||j())}catch(_){T(_)}if((u==null?void 0:u.number)!==void 0||"obfuscated"in n)return{data:n,solution:u}}if("obfuscated"in n){const _=await Cl(n.obfuscated,n.key,n.maxNumber||n.maxnumber);return{data:n,solution:await _.promise}}return{data:n,solution:await El(n.challenge,n.salt,n.algorithm,n.maxNumber||n.maxnumber||j()).promise}}async function Gl(n,u=typeof le()=="number"?le():n.maxNumber||n.maxnumber||j(),_=Math.ceil(Qe())){const E=[];_=Math.min(16,u,Math.max(1,_));for(let y=0;y<_;y++)E.push(altchaCreateWorker(ct()));const N=Math.ceil(u/_),$=await Promise.all(E.map((y,J)=>{const P=J*N;return new Promise(it=>{y.addEventListener("message",pt=>{if(pt.data)for(const wt of E)wt!==y&&wt.postMessage({type:"abort"});it(pt.data)}),y.postMessage({payload:n,max:P+N,start:P,type:"work"})})}));for(const y of E)y.terminate();return $.find(y=>!!y)||null}async function ht(){if(!G()){Ve(w.ERROR);return}const n=Le.find(u=>u.constructor.pluginName==="obfuscation");if(!n||!("clarify"in n)){Ve(w.ERROR),T("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");return}if("clarify"in n&&typeof n.clarify=="function")return n.clarify()}function Dn(n){n.obfuscated!==void 0&&G(n.obfuscated),n.auto!==void 0&&(r(n.auto),r()==="onload"&&(G()?ht():De())),n.blockspam!==void 0&&l(!!n.blockspam),n.customfetch!==void 0&&a(n.customfetch),n.floatinganchor!==void 0&&h(n.floatinganchor),n.delay!==void 0&&s(n.delay),n.floatingoffset!==void 0&&g(n.floatingoffset),n.floating!==void 0&&Tn(n.floating),n.expire!==void 0&&(nr(n.expire),c(n.expire)),n.challenge&&(o(typeof n.challenge=="string"?n.challenge:JSON.stringify(n.challenge)),Nn(d(rr))),n.challengeurl!==void 0&&i(n.challengeurl),n.debug!==void 0&&f(!!n.debug),n.hidefooter!==void 0&&b(!!n.hidefooter),n.hidelogo!==void 0&&L(!!n.hidelogo),n.maxnumber!==void 0&&j(+n.maxnumber),n.mockerror!==void 0&&V(!!n.mockerror),n.name!==void 0&&Z(n.name),n.refetchonexpire!==void 0&&M(!!n.refetchonexpire),n.spamfilter!==void 0&&B(typeof n.spamfilter=="object"?n.spamfilter:!!n.spamfilter),n.strings&&$e(typeof n.strings=="string"?n.strings:JSON.stringify(n.strings)),n.test!==void 0&&le(typeof n.test=="number"?n.test:!!n.test),n.verifyurl!==void 0&&Ne(n.verifyurl),n.workers!==void 0&&Qe(+n.workers),n.workerurl!==void 0&&ct(n.workerurl)}function Pn(){return{auto:r(),blockspam:l(),challengeurl:i(),debug:f(),delay:s(),expire:c(),floating:v(),floatinganchor:h(),floatingoffset:g(),hidefooter:b(),hidelogo:L(),name:Z(),maxnumber:j(),mockerror:V(),obfuscated:G(),refetchonexpire:M(),spamfilter:B(),strings:d(oe),test:le(),verifyurl:Ne(),workers:Qe(),workerurl:ct()}}function On(){return tt}function Jl(n){return Le.find(u=>u.constructor.pluginName===n)}function zn(){return d(I)}function Fn(){d(W).style.display="none"}function gt(n=20){if(d(W))if(tt||(tt=(h()?document.querySelector(h()):p==null?void 0:p.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||p),tt){const u=parseInt(g(),10)||12,_=tt.getBoundingClientRect(),E=d(W).getBoundingClientRect(),N=document.documentElement.clientHeight,$=document.documentElement.clientWidth,y=v()==="auto"?_.bottom+E.height+u+n>N:v()==="top",J=Math.max(n,Math.min($-n-E.width,_.left+_.width/2-E.width/2));if(y?d(W).style.top=`${_.top-(E.height+u)}px`:d(W).style.top=`${_.bottom+u}px`,d(W).style.left=`${J}px`,d(W).setAttribute("data-floating",y?"top":"bottom"),d(vt)){const P=d(vt).getBoundingClientRect();d(vt).style.left=_.left-J+_.width/2-P.width/2+"px"}}else T("unable to find floating anchor element")}function _t(n=w.UNVERIFIED,u=null){_e&&(clearTimeout(_e),_e=null),O(et,!1),O(je,null),Ve(n,u)}function Mn(n){tt=n}function Ve(n,u=null){O(I,se(n)),O(rt,se(u)),dt("statechange",{payload:d(je),state:d(I)})}function ir(){d(W).style.display="block",v()&>()}async function De(){return _t(w.VERIFYING),await new Promise(n=>setTimeout(n,s()||0)),Ul().then(n=>(Nn(n),T("challenge",n),Ln(n))).then(({data:n,solution:u})=>{if(T("solution",u),!u||n&&"challenge"in n&&!("clearText"in u))if((u==null?void 0:u.number)!==void 0&&"challenge"in n){if(Ne())return Zl(yn(n,u));O(je,se(yn(n,u))),T("payload",d(je))}else throw T("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."),new Error("Unexpected result returned.")}).then(()=>{Ve(w.VERIFIED),T("verified"),ji().then(()=>{dt("verified",{payload:d(je)})})}).catch(n=>{T(n),Ve(w.ERROR,n.message)})}var Un=zl(),jn=Nr(Un);ll(jn,t,"default",{});var mt=be(jn,2),lr=ee(mt),Vn=ee(lr);{var Kl=n=>{var u=Al();ne(n,u)};Te(Vn,n=>{d(I)===w.VERIFYING&&n(Kl)})}var Ft=be(Vn,2);let Bn;var nt=ee(Ft);nn(nt),nt.__change=Hl,Q(Ft);var or=be(Ft,2),Xl=ee(or);{var Ql=n=>{var u=Rl(),_=Nr(u),E=ee(_);Xe(E,()=>d(oe).verified),Q(_);var N=be(_,2);nn(N),Je(()=>{ue(N,"name",Z()),cl(N,d(je))}),ne(n,u)},eo=(n,u)=>{{var _=N=>{var $=Il(),y=ee($);Xe(y,()=>d(oe).verifying),Q($),ne(N,$)},E=N=>{var $=Sl(),y=ee($);Xe(y,()=>d(oe).label),Q($),Je(()=>ue($,"for",d(bn))),ne(N,$)};Te(n,N=>{d(I)===w.VERIFYING?N(_):N(E,!1)},u)}};Te(Xl,n=>{d(I)===w.VERIFIED?n(Ql):n(eo,!1)})}Q(or);var to=be(or,2);{var ro=n=>{var u=Tl(),_=ee(u);ue(_,"href",mn),Q(u),Je(()=>ue(_,"aria-label",d(oe).ariaLinkLabel)),ne(n,u)};Te(to,n=>{(L()!==!0||d(tr))&&n(ro)})}Q(lr);var qn=be(lr,2);{var no=n=>{var u=Dl(),_=be(ee(u),2);{var E=$=>{var y=Nl(),J=ee(y);Xe(J,()=>d(oe).expired),Q(y),Je(()=>ue(y,"title",d(rt))),ne($,y)},N=$=>{var y=Ll(),J=ee(y);Xe(J,()=>d(oe).error),Q(y),Je(()=>ue(y,"title",d(rt))),ne($,y)};Te(_,$=>{d(I)===w.EXPIRED?$(E):$(N,!1)})}Q(u),ne(n,u)};Te(qn,n=>{(d(rt)||d(I)===w.EXPIRED)&&n(no)})}var Hn=be(qn,2);{var io=n=>{var u=Pl(),_=ee(u),E=ee(_);Xe(E,()=>d(oe).footer),Q(_),Q(u),ne(n,u)};Te(Hn,n=>{d(oe).footer&&(b()!==!0||d(tr))&&n(io)})}var lo=be(Hn,2);{var oo=n=>{var u=Ol();sn(u,_=>O(vt,_),()=>d(vt)),ne(n,u)};Te(lo,n=>{v()&&n(oo)})}return Q(mt),sn(mt,n=>O(W,n),()=>d(W)),Je(n=>{ue(mt,"data-state",d(I)),ue(mt,"data-floating",v()),Bn=sl(Ft,1,"altcha-checkbox svelte-ddsc3z",null,Bn,n),ue(nt,"id",d(bn)),nt.required=r()!=="onsubmit"&&(!v()||r()!=="off")},[()=>({"altcha-hidden":d(I)===w.VERIFYING})]),el("invalid",nt,Rn),vl(nt,()=>d(et),n=>O(et,n)),ne(e,Un),Zr({clarify:ht,configure:Dn,getConfiguration:Pn,getFloatingAnchor:On,getPlugin:Jl,getState:zn,hide:Fn,repositionFloating:gt,reset:_t,setFloatingAnchor:Mn,setState:Ve,show:ir,verify:De,get auto(){return r()},set auto(n=void 0){r(n),x()},get blockspam(){return l()},set blockspam(n=void 0){l(n),x()},get challengeurl(){return i()},set challengeurl(n=void 0){i(n),x()},get challengejson(){return o()},set challengejson(n=void 0){o(n),x()},get customfetch(){return a()},set customfetch(n=void 0){a(n),x()},get debug(){return f()},set debug(n=!1){f(n),x()},get delay(){return s()},set delay(n=0){s(n),x()},get expire(){return c()},set expire(n=void 0){c(n),x()},get floating(){return v()},set floating(n=void 0){v(n),x()},get floatinganchor(){return h()},set floatinganchor(n=void 0){h(n),x()},get floatingoffset(){return g()},set floatingoffset(n=void 0){g(n),x()},get floatingpersist(){return m()},set floatingpersist(n=!1){m(n),x()},get hidefooter(){return b()},set hidefooter(n=!1){b(n),x()},get hidelogo(){return L()},set hidelogo(n=!1){L(n),x()},get id(){return F()},set id(n=void 0){F(n),x()},get name(){return Z()},set name(n="altcha"){Z(n),x()},get maxnumber(){return j()},set maxnumber(n=1e6){j(n),x()},get mockerror(){return V()},set mockerror(n=!1){V(n),x()},get obfuscated(){return G()},set obfuscated(n=void 0){G(n),x()},get plugins(){return Ue()},set plugins(n=void 0){Ue(n),x()},get refetchonexpire(){return M()},set refetchonexpire(n=!0){M(n),x()},get spamfilter(){return B()},set spamfilter(n=!1){B(n),x()},get strings(){return $e()},set strings(n=void 0){$e(n),x()},get test(){return le()},set test(n=!1){le(n),x()},get verifyurl(){return Ne()},set verifyurl(n=void 0){Ne(n),x()},get workers(){return Qe()},set workers(n=Math.min(16,navigator.hardwareConcurrency||8)){Qe(n),x()},get workerurl(){return ct()},set workerurl(n=void 0){ct(n),x()}})}tl(["change"]),customElements.define("altcha-widget",wl(vn,{blockspam:{type:"Boolean"},debug:{type:"Boolean"},delay:{type:"Number"},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:{},customfetch:{},floating:{},floatinganchor:{},floatingpersist:{},id:{},name:{},obfuscated:{},plugins:{},spamfilter:{},strings:{},verifyurl:{},workerurl:{}},["default"],["clarify","configure","getConfiguration","getFloatingAnchor","getPlugin","getState","hide","repositionFloating","reset","setFloatingAnchor","setState","show","verify"],!1)),globalThis.altchaCreateWorker=e=>e?new Worker(new URL(e)):new bt,globalThis.altchaPlugins=globalThis.altchaPlugins||[],k.Altcha=vn,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -31,6 +31,7 @@ declare global {
|
|
|
31
31
|
floating?: 'auto' | 'top' | 'bottom' | 'false' | '' | boolean;
|
|
32
32
|
floatinganchor?: string;
|
|
33
33
|
floatingoffset?: number;
|
|
34
|
+
floatingpersist?: 'focus' | boolean;
|
|
34
35
|
hidefooter?: boolean;
|
|
35
36
|
hidelogo?: boolean;
|
|
36
37
|
id?: string;
|
|
@@ -62,9 +63,12 @@ declare global {
|
|
|
62
63
|
getFloatingAnchor: () => HTMLElement | null;
|
|
63
64
|
getPlugin: <T = unknown>(name: string) => T;
|
|
64
65
|
getState: () => AltchaState;
|
|
66
|
+
hide: () => void;
|
|
67
|
+
repositionFloating: (viewportOffset: numer = 20) => void;
|
|
65
68
|
reset: (newState: AltchaState = 'unverified', err: string | null = null) => void;
|
|
66
69
|
setFloatingAnchor: (el: HTMLElement) => void;
|
|
67
70
|
setState: (newState: AltchaState, err: string | null = null) => void;
|
|
71
|
+
show: () => void;
|
|
68
72
|
verify: () => Promise<void>;
|
|
69
73
|
}
|
|
70
74
|
|