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