altcha 2.0.0-beta.9 → 2.0.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/LICENSE.txt +1 -1
- package/README.md +142 -93
- package/dist/altcha.d.ts +5 -2
- package/dist/altcha.i18n.d.ts +158 -0
- package/dist/altcha.i18n.js +4017 -0
- package/dist/altcha.i18n.umd.js +4 -0
- package/dist/altcha.js +1723 -1573
- package/dist/altcha.umd.cjs +4 -4
- package/dist_external/altcha.css +1 -1
- package/dist_external/altcha.d.ts +5 -2
- package/dist_external/altcha.js +1794 -1645
- package/dist_external/altcha.umd.cjs +3 -3
- package/dist_i18n/af.d.ts +1 -0
- package/dist_i18n/af.js +76 -3
- package/dist_i18n/af.umd.cjs +1 -1
- package/dist_i18n/all.d.ts +1 -0
- package/dist_i18n/all.js +178 -105
- package/dist_i18n/all.umd.cjs +1 -1
- package/dist_i18n/americas.d.ts +1 -0
- package/dist_i18n/americas.js +80 -7
- package/dist_i18n/americas.umd.cjs +1 -1
- package/dist_i18n/ar.d.ts +1 -0
- package/dist_i18n/ar.js +76 -3
- package/dist_i18n/ar.umd.cjs +1 -1
- package/dist_i18n/asia.d.ts +1 -0
- package/dist_i18n/asia.js +105 -32
- package/dist_i18n/asia.umd.cjs +1 -1
- package/dist_i18n/bg.d.ts +1 -0
- package/dist_i18n/bg.js +76 -3
- package/dist_i18n/bg.umd.cjs +1 -1
- package/dist_i18n/bn.d.ts +1 -0
- package/dist_i18n/bn.js +76 -3
- package/dist_i18n/bn.umd.cjs +1 -1
- package/dist_i18n/bs.d.ts +1 -0
- package/dist_i18n/bs.js +76 -3
- package/dist_i18n/bs.umd.cjs +1 -1
- package/dist_i18n/ca.d.ts +1 -0
- package/dist_i18n/ca.js +76 -3
- package/dist_i18n/ca.umd.cjs +1 -1
- package/dist_i18n/cs.d.ts +1 -0
- package/dist_i18n/cs.js +76 -3
- package/dist_i18n/cs.umd.cjs +1 -1
- package/dist_i18n/da.d.ts +1 -0
- package/dist_i18n/da.js +76 -3
- package/dist_i18n/da.umd.cjs +1 -1
- package/dist_i18n/de.d.ts +1 -0
- package/dist_i18n/de.js +76 -3
- package/dist_i18n/de.umd.cjs +1 -1
- package/dist_i18n/el.d.ts +1 -0
- package/dist_i18n/el.js +76 -3
- package/dist_i18n/el.umd.cjs +1 -1
- package/dist_i18n/en.d.ts +1 -0
- package/dist_i18n/en.js +76 -3
- package/dist_i18n/en.umd.cjs +1 -1
- package/dist_i18n/es-419.d.ts +1 -0
- package/dist_i18n/es-419.js +76 -3
- package/dist_i18n/es-419.umd.cjs +1 -1
- package/dist_i18n/es-es.d.ts +1 -0
- package/dist_i18n/es-es.js +76 -3
- package/dist_i18n/es-es.umd.cjs +1 -1
- package/dist_i18n/et.d.ts +1 -0
- package/dist_i18n/et.js +76 -3
- package/dist_i18n/et.umd.cjs +1 -1
- package/dist_i18n/eu.d.ts +1 -0
- package/dist_i18n/eu.js +76 -3
- package/dist_i18n/eu.umd.cjs +1 -1
- package/dist_i18n/europe.d.ts +1 -0
- package/dist_i18n/europe.js +139 -66
- package/dist_i18n/europe.umd.cjs +1 -1
- package/dist_i18n/fi.d.ts +1 -0
- package/dist_i18n/fi.js +76 -3
- package/dist_i18n/fi.umd.cjs +1 -1
- package/dist_i18n/fr-ca.d.ts +1 -0
- package/dist_i18n/fr-ca.js +77 -4
- package/dist_i18n/fr-ca.umd.cjs +1 -1
- package/dist_i18n/fr-fr.d.ts +1 -0
- package/dist_i18n/fr-fr.js +77 -4
- package/dist_i18n/fr-fr.umd.cjs +1 -1
- package/dist_i18n/ga.d.ts +1 -0
- package/dist_i18n/ga.js +76 -3
- package/dist_i18n/ga.umd.cjs +1 -1
- package/dist_i18n/he.d.ts +1 -0
- package/dist_i18n/he.js +76 -3
- package/dist_i18n/he.umd.cjs +1 -1
- package/dist_i18n/hi.d.ts +1 -0
- package/dist_i18n/hi.js +76 -3
- package/dist_i18n/hi.umd.cjs +1 -1
- package/dist_i18n/hr.d.ts +1 -0
- package/dist_i18n/hr.js +76 -3
- package/dist_i18n/hr.umd.cjs +1 -1
- package/dist_i18n/hu.d.ts +1 -0
- package/dist_i18n/hu.js +76 -3
- package/dist_i18n/hu.umd.cjs +1 -1
- package/dist_i18n/id.d.ts +1 -0
- package/dist_i18n/id.js +76 -3
- package/dist_i18n/id.umd.cjs +1 -1
- package/dist_i18n/is.d.ts +1 -0
- package/dist_i18n/is.js +76 -3
- package/dist_i18n/is.umd.cjs +1 -1
- package/dist_i18n/it.d.ts +1 -0
- package/dist_i18n/it.js +76 -3
- package/dist_i18n/it.umd.cjs +1 -1
- package/dist_i18n/ja.d.ts +1 -0
- package/dist_i18n/ja.js +76 -3
- package/dist_i18n/ja.umd.cjs +1 -1
- package/dist_i18n/ko.d.ts +1 -0
- package/dist_i18n/ko.js +76 -3
- package/dist_i18n/ko.umd.cjs +1 -1
- package/dist_i18n/lt.d.ts +1 -0
- package/dist_i18n/lt.js +76 -3
- package/dist_i18n/lt.umd.cjs +1 -1
- package/dist_i18n/lv.d.ts +1 -0
- package/dist_i18n/lv.js +76 -3
- package/dist_i18n/lv.umd.cjs +1 -1
- package/dist_i18n/mr.d.ts +1 -0
- package/dist_i18n/mr.js +76 -3
- package/dist_i18n/mr.umd.cjs +1 -1
- package/dist_i18n/mt.d.ts +1 -0
- package/dist_i18n/mt.js +76 -3
- package/dist_i18n/mt.umd.cjs +1 -1
- package/dist_i18n/nb.d.ts +1 -0
- package/dist_i18n/nb.js +77 -4
- package/dist_i18n/nb.umd.cjs +1 -1
- package/dist_i18n/nl.d.ts +1 -0
- package/dist_i18n/nl.js +76 -3
- package/dist_i18n/nl.umd.cjs +1 -1
- package/dist_i18n/pl.d.ts +1 -0
- package/dist_i18n/pl.js +76 -3
- package/dist_i18n/pl.umd.cjs +1 -1
- package/dist_i18n/pt-br.d.ts +1 -0
- package/dist_i18n/pt-br.js +76 -3
- package/dist_i18n/pt-br.umd.cjs +1 -1
- package/dist_i18n/pt-pt.d.ts +1 -0
- package/dist_i18n/pt-pt.js +76 -3
- package/dist_i18n/pt-pt.umd.cjs +1 -1
- package/dist_i18n/ro.d.ts +1 -0
- package/dist_i18n/ro.js +76 -3
- package/dist_i18n/ro.umd.cjs +1 -1
- package/dist_i18n/ru.d.ts +1 -0
- package/dist_i18n/ru.js +76 -3
- package/dist_i18n/ru.umd.cjs +1 -1
- package/dist_i18n/sk.d.ts +1 -0
- package/dist_i18n/sk.js +76 -3
- package/dist_i18n/sk.umd.cjs +1 -1
- package/dist_i18n/sl.d.ts +1 -0
- package/dist_i18n/sl.js +76 -3
- package/dist_i18n/sl.umd.cjs +1 -1
- package/dist_i18n/sr.d.ts +1 -0
- package/dist_i18n/sr.js +76 -3
- package/dist_i18n/sr.umd.cjs +1 -1
- package/dist_i18n/sv.d.ts +1 -0
- package/dist_i18n/sv.js +76 -3
- package/dist_i18n/sv.umd.cjs +1 -1
- package/dist_i18n/ta.d.ts +1 -0
- package/dist_i18n/ta.js +76 -3
- package/dist_i18n/ta.umd.cjs +1 -1
- package/dist_i18n/te.d.ts +1 -0
- package/dist_i18n/te.js +76 -3
- package/dist_i18n/te.umd.cjs +1 -1
- package/dist_i18n/th.d.ts +1 -0
- package/dist_i18n/th.js +76 -3
- package/dist_i18n/th.umd.cjs +1 -1
- package/dist_i18n/tr.d.ts +1 -0
- package/dist_i18n/tr.js +76 -3
- package/dist_i18n/tr.umd.cjs +1 -1
- package/dist_i18n/uk.d.ts +1 -0
- package/dist_i18n/uk.js +76 -3
- package/dist_i18n/uk.umd.cjs +1 -1
- package/dist_i18n/ur.d.ts +1 -0
- package/dist_i18n/ur.js +76 -3
- package/dist_i18n/ur.umd.cjs +1 -1
- package/dist_i18n/vi.d.ts +1 -0
- package/dist_i18n/vi.js +76 -3
- package/dist_i18n/vi.umd.cjs +1 -1
- package/dist_i18n/zh-cn.d.ts +1 -0
- package/dist_i18n/zh-cn.js +76 -3
- package/dist_i18n/zh-cn.umd.cjs +1 -1
- package/dist_i18n/zh-tw.d.ts +1 -0
- package/dist_i18n/zh-tw.js +76 -3
- package/dist_i18n/zh-tw.umd.cjs +1 -1
- package/package.json +11 -6
package/dist/altcha.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(S,
|
|
2
|
-
`,G=typeof self<"u"&&self.Blob&&new Blob([N],{type:"text/javascript;charset=utf-8"});function Ft(e){let t;try{if(t=G&&(self.URL||self.webkitURL).createObjectURL(G),!t)throw"";const r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(N),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}const $i="5";typeof window<"u"&&((Bn=window.__svelte??(window.__svelte={})).v??(Bn.v=new Set)).add($i);const Si=1,Ti=4,Ni=8,Di=16,Li=1,Pi=2,fr="[",Ur="[!",jr="]",st={},le=Symbol(),Oi="http://www.w3.org/1999/xhtml",qr=!1,be=2,Br=4,Mt=8,cr=16,Ne=32,Qe=64,Vt=128,_e=256,Ut=512,de=1024,De=2048,ut=4096,ft=8192,jt=16384,Fi=32768,dr=65536,Mi=1<<19,Hr=1<<20,Et=Symbol("$state"),Gr=Symbol("legacy props"),Vi=Symbol("");var Yr=Array.isArray,Ui=Array.prototype.indexOf,ji=Array.from,qt=Object.keys,Bt=Object.defineProperty,et=Object.getOwnPropertyDescriptor,qi=Object.getOwnPropertyDescriptors,Bi=Object.prototype,Hi=Array.prototype,Wr=Object.getPrototypeOf;function Zr(e){for(var t=0;t<e.length;t++)e[t]()}function Gi(e,t,r=!1){return e===void 0?r?t():t:e}const Yi=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let Ct=[],xt=[];function zr(){var e=Ct;Ct=[],Zr(e)}function Jr(){var e=xt;xt=[],Zr(e)}function hr(e){Ct.length===0&&queueMicrotask(zr),Ct.push(e)}function Wi(e){xt.length===0&&Yi(Jr),xt.push(e)}function Kr(){Ct.length>0&&zr(),xt.length>0&&Jr()}function Xr(e){return e===this.v}function Zi(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function vr(e){return!Zi(e,this.v)}function zi(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Ji(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Ki(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Xi(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Qi(){throw new Error("https://svelte.dev/e/hydration_failed")}function ea(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function ta(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function ra(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function na(){throw new Error("https://svelte.dev/e/state_unsafe_local_read")}function ia(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}let aa=!1;function xe(e,t){var r={f:0,v:e,reactions:null,equals:Xr,rv:0,wv:0};return r}function se(e){return oa(xe(e))}function Qr(e,t=!1){const r=xe(e);return t||(r.equals=vr),r}function oa(e){return T!==null&&!we&&(T.f&be)!==0&&(ke===null?ha([e]):ke.push(e)),e}function w(e,t){return T!==null&&!we&&kn()&&(T.f&(be|cr))!==0&&(ke===null||!ke.includes(e))&&ia(),la(e,t)}function la(e,t){return e.equals(t)||(e.v,e.v=t,e.wv=cn(),en(e,De),L!==null&&(L.f&de)!==0&&(L.f&(Ne|Qe))===0&&(Pe===null?va([e]):Pe.push(e))),t}function en(e,t){var r=e.reactions;if(r!==null)for(var i=r.length,a=0;a<i;a++){var o=r[a],s=o.f;(s&De)===0&&(Ae(o,t),(s&(de|_e))!==0&&((s&be)!==0?en(o,ut):Xt(o)))}}function je(e){var t=be|De,r=T!==null&&(T.f&be)!==0?T:null;return L===null||r!==null&&(r.f&_e)!==0?t|=_e:L.f|=Hr,{ctx:ne,deps:null,effects:null,equals:Xr,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:r??L}}function sa(e){const t=je(e);return t.equals=vr,t}function tn(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)Fe(t[r])}}function ua(e){for(var t=e.parent;t!==null;){if((t.f&be)===0)return t;t=t.parent}return null}function fa(e){var t,r=L;Ge(ua(e));try{tn(e),t=hn(e)}finally{Ge(r)}return t}function rn(e){var t=fa(e),r=(Ye||(e.f&_e)!==0)&&e.deps!==null?ut:de;Ae(e,r),e.equals(t)||(e.v=t,e.wv=cn())}function Ht(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let P=!1;function ct(e){P=e}let O;function qe(e){if(e===null)throw Ht(),st;return O=e}function dt(){return qe(Be(O))}function W(e){if(P){if(Be(O)!==null)throw Ht(),st;O=e}}function ca(){for(var e=0,t=O;;){if(t.nodeType===8){var r=t.data;if(r===jr){if(e===0)return t;e-=1}else(r===fr||r===Ur)&&(e+=1)}var i=Be(t);t.remove(),t=i}}function V(e,t=null,r){if(typeof e!="object"||e===null||Et in e)return e;const i=Wr(e);if(i!==Bi&&i!==Hi)return e;var a=new Map,o=Yr(e),s=xe(0);o&&a.set("length",xe(e.length));var f;return new Proxy(e,{defineProperty(c,d,m){(!("value"in m)||m.configurable===!1||m.enumerable===!1||m.writable===!1)&&ta();var v=a.get(d);return v===void 0?(v=xe(m.value),a.set(d,v)):w(v,V(m.value,f)),!0},deleteProperty(c,d){var m=a.get(d);if(m===void 0)d in c&&a.set(d,xe(le));else{if(o&&typeof d=="string"){var v=a.get("length"),h=Number(d);Number.isInteger(h)&&h<v.v&&w(v,h)}w(m,le),nn(s)}return!0},get(c,d,m){var A;if(d===Et)return e;var v=a.get(d),h=d in c;if(v===void 0&&(!h||(A=et(c,d))!=null&&A.writable)&&(v=xe(V(h?c[d]:le,f)),a.set(d,v)),v!==void 0){var b=l(v);return b===le?void 0:b}return Reflect.get(c,d,m)},getOwnPropertyDescriptor(c,d){var m=Reflect.getOwnPropertyDescriptor(c,d);if(m&&"value"in m){var v=a.get(d);v&&(m.value=l(v))}else if(m===void 0){var h=a.get(d),b=h==null?void 0:h.v;if(h!==void 0&&b!==le)return{enumerable:!0,configurable:!0,value:b,writable:!0}}return m},has(c,d){var b;if(d===Et)return!0;var m=a.get(d),v=m!==void 0&&m.v!==le||Reflect.has(c,d);if(m!==void 0||L!==null&&(!v||(b=et(c,d))!=null&&b.writable)){m===void 0&&(m=xe(v?V(c[d],f):le),a.set(d,m));var h=l(m);if(h===le)return!1}return v},set(c,d,m,v){var ee;var h=a.get(d),b=d in c;if(o&&d==="length")for(var A=m;A<h.v;A+=1){var F=a.get(A+"");F!==void 0?w(F,le):A in c&&(F=xe(le),a.set(A+"",F))}h===void 0?(!b||(ee=et(c,d))!=null&&ee.writable)&&(h=xe(void 0),w(h,V(m,f)),a.set(d,h)):(b=h.v!==le,w(h,V(m,f)));var U=Reflect.getOwnPropertyDescriptor(c,d);if(U!=null&&U.set&&U.set.call(v,m),!b){if(o&&typeof d=="string"){var ve=a.get("length"),ue=Number(d);Number.isInteger(ue)&&ue>=ve.v&&w(ve,ue+1)}nn(s)}return!0},ownKeys(c){l(s);var d=Reflect.ownKeys(c).filter(h=>{var b=a.get(h);return b===void 0||b.v!==le});for(var[m,v]of a)v.v!==le&&!(m in c)&&d.push(m);return d},setPrototypeOf(){ra()}})}function nn(e,t=1){w(e,e.v+t)}var an,on,ln,sn;function gr(){if(an===void 0){an=window,on=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype;ln=et(t,"firstChild").get,sn=et(t,"nextSibling").get,e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0,Text.prototype.__t=void 0}}function Gt(e=""){return document.createTextNode(e)}function Le(e){return ln.call(e)}function Be(e){return sn.call(e)}function Z(e,t){if(!P)return Le(e);var r=Le(O);return r===null&&(r=O.appendChild(Gt())),qe(r),r}function kt(e,t){if(!P){var r=Le(e);return r instanceof Comment&&r.data===""?Be(r):r}return O}function z(e,t=1,r=!1){let i=P?O:e;for(var a;t--;)a=i,i=Be(i);if(!P)return i;var o=i==null?void 0:i.nodeType;if(r&&o!==3){var s=Gt();return i===null?a==null||a.after(s):i.before(s),qe(s),s}return qe(i),i}function da(e){e.textContent=""}let Yt=!1,Wt=!1,Zt=null,tt=!1,_r=!1;function un(e){_r=e}let At=[],hl=[],T=null,we=!1;function He(e){T=e}let L=null;function Ge(e){L=e}let ke=null;function ha(e){ke=e}let re=null,he=0,Pe=null;function va(e){Pe=e}let fn=1,zt=0,Ye=!1;function cn(){return++fn}function Rt(e){var v;var t=e.f;if((t&De)!==0)return!0;if((t&ut)!==0){var r=e.deps,i=(t&_e)!==0;if(r!==null){var a,o,s=(t&Ut)!==0,f=i&&L!==null&&!Ye,c=r.length;if(s||f){var d=e,m=d.parent;for(a=0;a<c;a++)o=r[a],(s||!((v=o==null?void 0:o.reactions)!=null&&v.includes(d)))&&(o.reactions??(o.reactions=[])).push(d);s&&(d.f^=Ut),f&&m!==null&&(m.f&_e)===0&&(d.f^=_e)}for(a=0;a<c;a++)if(o=r[a],Rt(o)&&rn(o),o.wv>e.wv)return!0}(!i||L!==null&&!Ye)&&Ae(e,de)}return!1}function ga(e,t){for(var r=t;r!==null;){if((r.f&Vt)!==0)try{r.fn(e);return}catch{r.f^=Vt}r=r.parent}throw Yt=!1,e}function _a(e){return(e.f&jt)===0&&(e.parent===null||(e.parent.f&Vt)===0)}function Jt(e,t,r,i){if(Yt){if(r===null&&(Yt=!1),_a(t))throw e;return}r!==null&&(Yt=!0);{ga(e,t);return}}function dn(e,t,r=!0){var i=e.reactions;if(i!==null)for(var a=0;a<i.length;a++){var o=i[a];(o.f&be)!==0?dn(o,t,!1):t===o&&(r?Ae(o,De):(o.f&de)!==0&&Ae(o,ut),Xt(o))}}function hn(e){var b;var t=re,r=he,i=Pe,a=T,o=Ye,s=ke,f=ne,c=we,d=e.f;re=null,he=0,Pe=null,Ye=(d&_e)!==0&&(we||!tt||T===null),T=(d&(Ne|Qe))===0?e:null,ke=null,En(e.ctx),we=!1,zt++;try{var m=(0,e.fn)(),v=e.deps;if(re!==null){var h;if(Kt(e,he),v!==null&&he>0)for(v.length=he+re.length,h=0;h<re.length;h++)v[he+h]=re[h];else e.deps=v=re;if(!Ye)for(h=he;h<v.length;h++)((b=v[h]).reactions??(b.reactions=[])).push(e)}else v!==null&&he<v.length&&(Kt(e,he),v.length=he);if(kn()&&Pe!==null&&!we&&v!==null&&(e.f&(be|ut|De))===0)for(h=0;h<Pe.length;h++)dn(Pe[h],e);return a!==null&&zt++,m}finally{re=t,he=r,Pe=i,T=a,Ye=o,ke=s,En(f),we=c}}function ma(e,t){let r=t.reactions;if(r!==null){var i=Ui.call(r,e);if(i!==-1){var a=r.length-1;a===0?r=t.reactions=null:(r[i]=r[a],r.pop())}}r===null&&(t.f&be)!==0&&(re===null||!re.includes(t))&&(Ae(t,ut),(t.f&(_e|Ut))===0&&(t.f^=Ut),tn(t),Kt(t,0))}function Kt(e,t){var r=e.deps;if(r!==null)for(var i=t;i<r.length;i++)ma(e,r[i])}function mr(e){var t=e.f;if((t&jt)===0){Ae(e,de);var r=L,i=ne,a=tt;L=e,tt=!0;try{(t&cr)!==0?Ra(e):_n(e),gn(e);var o=hn(e);e.teardown=typeof o=="function"?o:null,e.wv=fn;var s=e.deps,f;qr&&aa&&e.f&De}catch(c){Jt(c,e,r,i||e.ctx)}finally{tt=a,L=r}}}function pa(){try{Xi()}catch(e){if(Zt!==null)Jt(e,Zt,null);else throw e}}function vn(){var e=tt;try{var t=0;for(tt=!0;At.length>0;){t++>1e3&&pa();var r=At,i=r.length;At=[];for(var a=0;a<i;a++){var o=wa(r[a]);ba(o)}}}finally{Wt=!1,tt=e,Zt=null}}function ba(e){var t=e.length;if(t!==0)for(var r=0;r<t;r++){var i=e[r];if((i.f&(jt|ft))===0)try{Rt(i)&&(mr(i),i.deps===null&&i.first===null&&i.nodes_start===null&&(i.teardown===null?mn(i):i.fn=null))}catch(a){Jt(a,i,null,i.ctx)}}}function Xt(e){Wt||(Wt=!0,queueMicrotask(vn));for(var t=Zt=e;t.parent!==null;){t=t.parent;var r=t.f;if((r&(Qe|Ne))!==0){if((r&de)===0)return;t.f^=de}}At.push(t)}function wa(e){for(var t=[],r=e;r!==null;){var i=r.f,a=(i&(Ne|Qe))!==0,o=a&&(i&de)!==0;if(!o&&(i&ft)===0){if((i&Br)!==0)t.push(r);else if(a)r.f^=de;else{var s=T;try{T=r,Rt(r)&&mr(r)}catch(d){Jt(d,r,null,r.ctx)}finally{T=s}}var f=r.first;if(f!==null){r=f;continue}}var c=r.parent;for(r=r.next;r===null&&c!==null;)r=c.next,c=c.parent}return t}function x(e){var t;for(Kr();At.length>0;)Wt=!0,vn(),Kr();return t}async function pr(){await Promise.resolve(),x()}function l(e){var t=e.f,r=(t&be)!==0;if(T!==null&&!we){ke!==null&&ke.includes(e)&&na();var i=T.deps;e.rv<zt&&(e.rv=zt,re===null&&i!==null&&i[he]===e?he++:re===null?re=[e]:(!Ye||!re.includes(e))&&re.push(e))}else if(r&&e.deps===null&&e.effects===null){var a=e,o=a.parent;o!==null&&(o.f&_e)===0&&(a.f^=_e)}return r&&(a=e,Rt(a)&&rn(a)),e.v}function ht(e){var t=we;try{return we=!0,e()}finally{we=t}}const ya=-7169;function Ae(e,t){e.f=e.f&ya|t}function Ea(e){L===null&&T===null&&Ki(),T!==null&&(T.f&_e)!==0&&L===null&&Ji(),_r&&zi()}function Ca(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function rt(e,t,r,i=!0){var a=L,o={ctx:ne,deps:null,nodes_start:null,nodes_end:null,f:e|De,first:null,fn:t,last:null,next:null,parent:a,prev:null,teardown:null,transitions:null,wv:0};if(r)try{mr(o),o.f|=Fi}catch(c){throw Fe(o),c}else t!==null&&Xt(o);var s=r&&o.deps===null&&o.first===null&&o.nodes_start===null&&o.teardown===null&&(o.f&(Hr|Vt))===0;if(!s&&i&&(a!==null&&Ca(o,a),T!==null&&(T.f&be)!==0)){var f=T;(f.effects??(f.effects=[])).push(o)}return o}function xa(e){const t=rt(Mt,null,!1);return Ae(t,de),t.teardown=e,t}function br(e){Ea();var t=L!==null&&(L.f&Ne)!==0&&ne!==null&&!ne.m;if(t){var r=ne;(r.e??(r.e=[])).push({fn:e,effect:L,reaction:T})}else{var i=wr(e);return i}}function ka(e){const t=rt(Qe,e,!0);return()=>{Fe(t)}}function Aa(e){const t=rt(Qe,e,!0);return(r={})=>new Promise(i=>{r.outro?Cr(t,()=>{Fe(t),i(void 0)}):(Fe(t),i(void 0))})}function wr(e){return rt(Br,e,!1)}function yr(e){return rt(Mt,e,!0)}function Oe(e,t=[],r=je){const i=t.map(r);return Er(()=>e(...i.map(l)))}function Er(e,t=0){return rt(Mt|cr|t,e,!0)}function Qt(e,t=!0){return rt(Mt|Ne,e,!0,t)}function gn(e){var t=e.teardown;if(t!==null){const r=_r,i=T;un(!0),He(null);try{t.call(null)}finally{un(r),He(i)}}}function _n(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){var i=r.next;(r.f&Qe)!==0?r.parent=null:Fe(r,t),r=i}}function Ra(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&Ne)===0&&Fe(t),t=r}}function Fe(e,t=!0){var r=!1;if((t||(e.f&Mi)!==0)&&e.nodes_start!==null){for(var i=e.nodes_start,a=e.nodes_end;i!==null;){var o=i===a?null:Be(i);i.remove(),i=o}r=!0}_n(e,t&&!r),Kt(e,0),Ae(e,jt);var s=e.transitions;if(s!==null)for(const c of s)c.stop();gn(e);var f=e.parent;f!==null&&f.first!==null&&mn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function mn(e){var t=e.parent,r=e.prev,i=e.next;r!==null&&(r.next=i),i!==null&&(i.prev=r),t!==null&&(t.first===e&&(t.first=i),t.last===e&&(t.last=r))}function Cr(e,t){var r=[];pn(e,r,!0),Ia(r,()=>{Fe(e),t&&t()})}function Ia(e,t){var r=e.length;if(r>0){var i=()=>--r||t();for(var a of e)a.out(i)}else t()}function pn(e,t,r){if((e.f&ft)===0){if(e.f^=ft,e.transitions!==null)for(const s of e.transitions)(s.is_global||r)&&t.push(s);for(var i=e.first;i!==null;){var a=i.next,o=(i.f&dr)!==0||(i.f&Ne)!==0;pn(i,t,o?r:!1),i=a}}}function bn(e){wn(e,!0)}function wn(e,t){if((e.f&ft)!==0){e.f^=ft,(e.f&de)===0&&(e.f^=de),Rt(e)&&(Ae(e,De),Xt(e));for(var r=e.first;r!==null;){var i=r.next,a=(r.f&dr)!==0||(r.f&Ne)!==0;wn(r,a?t:!1),r=i}if(e.transitions!==null)for(const o of e.transitions)(o.is_global||t)&&o.in()}}function yn(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}let ne=null;function En(e){ne=e}function Cn(e,t=!1,r){ne={p:ne,c:null,e:null,m:!1,s:e,x:null,l:null}}function xn(e){const t=ne;if(t!==null){e!==void 0&&(t.x=e);const s=t.e;if(s!==null){var r=L,i=T;t.e=null;try{for(var a=0;a<s.length;a++){var o=s[a];Ge(o.effect),He(o.reaction),wr(o.fn)}}finally{Ge(r),He(i)}}ne=t.p,t.m=!0}return e||{}}function kn(){return!0}const $a=["touchstart","touchmove"];function Sa(e){return $a.includes(e)}function Ta(e,t){if(t){const r=document.body;e.autofocus=!0,hr(()=>{document.activeElement===r&&e.focus()})}}let An=!1;function Rn(){An||(An=!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 In(e){var t=T,r=L;He(null),Ge(null);try{return e()}finally{He(t),Ge(r)}}function Na(e,t,r,i=r){e.addEventListener(t,()=>In(r));const a=e.__on_r;a?e.__on_r=()=>{a(),i(!0)}:e.__on_r=()=>i(!0),Rn()}const $n=new Set,xr=new Set;function Da(e,t,r,i={}){function a(o){if(i.capture||It.call(t,o),!o.cancelBubble)return In(()=>r==null?void 0:r.call(this,o))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?hr(()=>{t.addEventListener(e,a,i)}):t.addEventListener(e,a,i),a}function We(e,t,r,i,a){var o={capture:i,passive:a},s=Da(e,t,r,o);(t===document.body||t===window||t===document)&&xa(()=>{t.removeEventListener(e,s,o)})}function La(e){for(var t=0;t<e.length;t++)$n.add(e[t]);for(var r of xr)r(e)}function It(e){var ue;var t=this,r=t.ownerDocument,i=e.type,a=((ue=e.composedPath)==null?void 0:ue.call(e))||[],o=a[0]||e.target,s=0,f=e.__root;if(f){var c=a.indexOf(f);if(c!==-1&&(t===document||t===window)){e.__root=t;return}var d=a.indexOf(t);if(d===-1)return;c<=d&&(s=c)}if(o=a[s]||e.target,o!==t){Bt(e,"currentTarget",{configurable:!0,get(){return o||r}});var m=T,v=L;He(null),Ge(null);try{for(var h,b=[];o!==null;){var A=o.assignedSlot||o.parentNode||o.host||null;try{var F=o["__"+i];if(F!=null&&(!o.disabled||e.target===o))if(Yr(F)){var[U,...ve]=F;U.apply(o,[e,...ve])}else F.call(o,e)}catch(ee){h?b.push(ee):h=ee}if(e.cancelBubble||A===t||A===null)break;o=A}if(h){for(let ee of b)queueMicrotask(()=>{throw ee});throw h}}finally{e.__root=t,delete e.currentTarget,He(m),Ge(v)}}}function kr(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function Re(e,t){var r=L;r.nodes_start===null&&(r.nodes_start=e,r.nodes_end=t)}function ye(e,t){var r=(t&Li)!==0,i=(t&Pi)!==0,a,o=!e.startsWith("<!>");return()=>{if(P)return Re(O,null),O;a===void 0&&(a=kr(o?e:"<!>"+e),r||(a=Le(a)));var s=i||on?document.importNode(a,!0):a.cloneNode(!0);if(r){var f=Le(s),c=s.lastChild;Re(f,c)}else Re(s,s);return s}}function er(e,t,r="svg"){var i=!e.startsWith("<!>"),a=`<${r}>${i?e:"<!>"+e}</${r}>`,o;return()=>{if(P)return Re(O,null),O;if(!o){var s=kr(a),f=Le(s);o=Le(f)}var c=o.cloneNode(!0);return Re(c,c),c}}function tr(){if(P)return Re(O,null),O;var e=document.createDocumentFragment(),t=document.createComment(""),r=Gt();return e.append(t,r),Re(t,r),e}function q(e,t){if(P){L.nodes_end=O,dt();return}e!==null&&e.before(t)}function Pa(e,t){var r=t==null?"":typeof t=="object"?t+"":t;r!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=r,e.nodeValue=r+"")}function Sn(e,t){return Tn(e,t)}function Oa(e,t){gr(),t.intro=t.intro??!1;const r=t.target,i=P,a=O;try{for(var o=Le(r);o&&(o.nodeType!==8||o.data!==fr);)o=Be(o);if(!o)throw st;ct(!0),qe(o),dt();const s=Tn(e,{...t,anchor:o});if(O===null||O.nodeType!==8||O.data!==jr)throw Ht(),st;return ct(!1),s}catch(s){if(s===st)return t.recover===!1&&Qi(),gr(),da(r),ct(!1),Sn(e,t);throw s}finally{ct(i),qe(a)}}const vt=new Map;function Tn(e,{target:t,anchor:r,props:i={},events:a,context:o,intro:s=!0}){gr();var f=new Set,c=v=>{for(var h=0;h<v.length;h++){var b=v[h];if(!f.has(b)){f.add(b);var A=Sa(b);t.addEventListener(b,It,{passive:A});var F=vt.get(b);F===void 0?(document.addEventListener(b,It,{passive:A}),vt.set(b,1)):vt.set(b,F+1)}}};c(ji($n)),xr.add(c);var d=void 0,m=Aa(()=>{var v=r??t.appendChild(Gt());return Qt(()=>{if(o){Cn({});var h=ne;h.c=o}a&&(i.$$events=a),P&&Re(v,null),d=e(v,i)||{},P&&(L.nodes_end=O),o&&xn()}),()=>{var A;for(var h of f){t.removeEventListener(h,It);var b=vt.get(h);--b===0?(document.removeEventListener(h,It),vt.delete(h)):vt.set(h,b)}xr.delete(c),v!==r&&((A=v.parentNode)==null||A.removeChild(v))}});return Ar.set(d,m),d}let Ar=new WeakMap;function Fa(e,t){const r=Ar.get(e);return r?(Ar.delete(e),r(t)):Promise.resolve()}function J(e,t,[r,i]=[0,0]){P&&r===0&&dt();var a=e,o=null,s=null,f=le,c=r>0?dr:0,d=!1;const m=(h,b=!0)=>{d=!0,v(b,h)},v=(h,b)=>{if(f===(f=h))return;let A=!1;if(P&&i!==-1){if(r===0){const U=a.data;U===fr?i=0:U===Ur?i=1/0:(i=parseInt(U.substring(1)),i!==i&&(i=f?1/0:-1))}const F=i>r;!!f===F&&(a=ca(),qe(a),ct(!1),A=!0,i=-1)}f?(o?bn(o):b&&(o=Qt(()=>b(a))),s&&Cr(s,()=>{s=null})):(s?bn(s):b&&(s=Qt(()=>b(a,[r+1,i]))),o&&Cr(o,()=>{o=null})),A&&ct(!0)};Er(()=>{d=!1,t(m),d||v(null,null)},c),P&&(a=O)}function nt(e,t,r,i,a){var o=e,s="",f;Er(()=>{if(s===(s=t()??"")){P&&dt();return}f!==void 0&&(Fe(f),f=void 0),s!==""&&(f=Qt(()=>{if(P){O.data;for(var c=dt(),d=c;c!==null&&(c.nodeType!==8||c.data!=="");)d=c,c=Be(c);if(c===null)throw Ht(),st;Re(O,d),o=qe(c);return}var m=s+"",v=kr(m);Re(Le(v),v.lastChild),o.before(v)}))})}function Ma(e,t,r,i,a){var f;P&&dt();var o=(f=t.$$slots)==null?void 0:f[r],s=!1;o===!0&&(o=t.children,s=!0),o===void 0||o(e,s?()=>i:i)}const Nn=[...`
|
|
3
|
-
\r\f \v\uFEFF`];function Va(e,t,r){var i=""+e;if(r){for(var a in r)if(r[a])i=i?i+" "+a:a;else if(i.length)for(var o=a.length,s=0;(s=i.indexOf(a,s))>=0;){var f=s+o;(s===0||Nn.includes(i[s-1]))&&(f===i.length||Nn.includes(i[f]))?i=(s===0?"":i.substring(0,s))+i.substring(f+1):s=f}}return i===""?null:i}function Ua(e,t,r,i,a,o){var s=e.__className;if(P||s!==r){var f=Va(r,i,o);(!P||f!==e.getAttribute("class"))&&(f==null?e.removeAttribute("class"):e.className=f),e.__className=r}else if(o&&a!==o)for(var c in o){var d=!!o[c];(a==null||d!==!!a[c])&&e.classList.toggle(c,d)}return o}const ja=Symbol("is custom element"),qa=Symbol("is html");function Dn(e){if(P){var t=!1,r=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var i=e.value;D(e,"value",null),e.value=i}if(e.hasAttribute("checked")){var a=e.checked;D(e,"checked",null),e.checked=a}}};e.__on_r=r,Wi(r),Rn()}}function Ba(e,t){var r=Ln(e);r.value===(r.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function D(e,t,r,i){var a=Ln(e);P&&(a[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||a[t]!==(a[t]=r)&&(t==="loading"&&(e[Vi]=r),r==null?e.removeAttribute(t):typeof r!="string"&&Ha(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function Ln(e){return e.__attributes??(e.__attributes={[ja]:e.nodeName.includes("-"),[qa]:e.namespaceURI===Oi})}var Pn=new Map;function Ha(e){var t=Pn.get(e.nodeName);if(t)return t;Pn.set(e.nodeName,t=[]);for(var r,i=e,a=Element.prototype;a!==i;){r=qi(i);for(var o in r)r[o].set&&t.push(o);i=Wr(i)}return t}function Ga(e,t,r=t){Na(e,"change",i=>{var a=i?e.defaultChecked:e.checked;r(a)}),(P&&e.defaultChecked!==e.checked||ht(t)==null)&&r(e.checked),yr(()=>{var i=t();e.checked=!!i})}function On(e,t){return e===t||(e==null?void 0:e[Et])===t}function rr(e={},t,r,i){return wr(()=>{var a,o;return yr(()=>{a=o,o=[],ht(()=>{e!==r(...o)&&(t(e,...o),a&&On(r(...a),e)&&t(null,...a))})}),()=>{hr(()=>{o&&On(r(...o),e)&&t(null,...o)})}}),e}function Fn(e){ne===null&&yn(),br(()=>{const t=ht(e);if(typeof t=="function")return t})}function Ya(e){ne===null&&yn(),Fn(()=>()=>ht(e))}let nr=!1;function Wa(e){var t=nr;try{return nr=!1,[e(),nr]}finally{nr=t}}function k(e,t,r,i){var Ie;var a=(r&Si)!==0,o=!0,s=(r&Ni)!==0,f=(r&Di)!==0,c=!1,d;s?[d,c]=Wa(()=>e[t]):d=e[t];var m=Et in e||Gr in e,v=s&&(((Ie=et(e,t))==null?void 0:Ie.set)??(m&&t in e&&(B=>e[t]=B)))||void 0,h=i,b=!0,A=!1,F=()=>(A=!0,b&&(b=!1,f?h=ht(i):h=i),h);d===void 0&&i!==void 0&&(v&&o&&ea(),d=F(),v&&v(d));var U;if(U=()=>{var B=e[t];return B===void 0?F():(b=!0,A=!1,B)},(r&Ti)===0)return U;if(v){var ve=e.$$legacy;return function(B,ie){return arguments.length>0?((!ie||ve||c)&&v(ie?U():B),B):U()}}var ue=!1,ee=Qr(d),ge=je(()=>{var B=U(),ie=l(ee);return ue?(ue=!1,ie):ee.v=B});return a||(ge.equals=vr),function(B,ie){if(arguments.length>0){const Ze=ie?l(ge):s?V(B):B;return ge.equals(Ze)||(ue=!0,w(ee,Ze),A&&h!==void 0&&(h=Ze),ht(()=>l(ge))),B}return l(ge)}}function Za(e){return new za(e)}class za{constructor(t){Mr(this,Me);Mr(this,me);var o;var r=new Map,i=(s,f)=>{var c=Qr(f);return r.set(s,c),c};const a=new Proxy({...t.props||{},$$events:{}},{get(s,f){return l(r.get(f)??i(f,Reflect.get(s,f)))},has(s,f){return f===Gr?!0:(l(r.get(f)??i(f,Reflect.get(s,f))),Reflect.has(s,f))},set(s,f,c){return w(r.get(f)??i(f,c),c),Reflect.set(s,f,c)}});Vr(this,me,(t.hydrate?Oa:Sn)(t.component,{target:t.target,anchor:t.anchor,props:a,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((o=t==null?void 0:t.props)!=null&&o.$$host)||t.sync===!1)&&x(),Vr(this,Me,a.$$events);for(const s of Object.keys(ce(this,me)))s==="$set"||s==="$destroy"||s==="$on"||Bt(this,s,{get(){return ce(this,me)[s]},set(f){ce(this,me)[s]=f},enumerable:!0});ce(this,me).$set=s=>{Object.assign(a,s)},ce(this,me).$destroy=()=>{Fa(ce(this,me))}}$set(t){ce(this,me).$set(t)}$on(t,r){ce(this,Me)[t]=ce(this,Me)[t]||[];const i=(...a)=>r.call(this,...a);return ce(this,Me)[t].push(i),()=>{ce(this,Me)[t]=ce(this,Me)[t].filter(a=>a!==i)}}$destroy(){ce(this,me).$destroy()}}Me=new WeakMap,me=new WeakMap;let Mn;typeof HTMLElement=="function"&&(Mn=class extends HTMLElement{constructor(t,r,i){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,i&&this.attachShadow({mode:"open"})}addEventListener(t,r,i){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(r),this.$$c){const a=this.$$c.$on(t,r);this.$$l_u.set(r,a)}super.addEventListener(t,r,i)}removeEventListener(t,r,i){if(super.removeEventListener(t,r,i),this.$$c){const a=this.$$l_u.get(r);a&&(a(),this.$$l_u.delete(r))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(a){return o=>{const s=document.createElement("slot");a!=="default"&&(s.name=a),q(o,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const r={},i=Ja(this);for(const a of this.$$s)a in i&&(a==="default"&&!this.$$d.children?(this.$$d.children=t(a),r.default=!0):r[a]=t(a));for(const a of this.attributes){const o=this.$$g_p(a.name);o in this.$$d||(this.$$d[o]=ir(o,a.value,this.$$p_d,"toProp"))}for(const a in this.$$p_d)!(a in this.$$d)&&this[a]!==void 0&&(this.$$d[a]=this[a],delete this[a]);this.$$c=Za({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:r,$$host:this}}),this.$$me=ka(()=>{yr(()=>{var a;this.$$r=!0;for(const o of qt(this.$$c)){if(!((a=this.$$p_d[o])!=null&&a.reflect))continue;this.$$d[o]=this.$$c[o];const s=ir(o,this.$$d[o],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[o].attribute||o):this.setAttribute(this.$$p_d[o].attribute||o,s)}this.$$r=!1})});for(const a in this.$$l)for(const o of this.$$l[a]){const s=this.$$c.$on(a,o);this.$$l_u.set(o,s)}this.$$l={}}}attributeChangedCallback(t,r,i){var a;this.$$r||(t=this.$$g_p(t),this.$$d[t]=ir(t,i,this.$$p_d,"toProp"),(a=this.$$c)==null||a.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return qt(this.$$p_d).find(r=>this.$$p_d[r].attribute===t||!this.$$p_d[r].attribute&&r.toLowerCase()===t)||t}});function ir(e,t,r,i){var o;const a=(o=r[e])==null?void 0:o.type;if(t=a==="Boolean"&&typeof t!="boolean"?t!=null:t,!i||!r[e])return t;if(i==="toAttribute")switch(a){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(a){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function Ja(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function Ka(e,t,r,i,a,o){let s=class extends Mn{constructor(){super(e,r,a),this.$$p_d=t}static get observedAttributes(){return qt(t).map(f=>(t[f].attribute||f).toLowerCase())}};return qt(t).forEach(f=>{Bt(s.prototype,f,{get(){return this.$$c&&f in this.$$c?this.$$c[f]:this.$$d[f]},set(c){var v;c=ir(f,c,t),this.$$d[f]=c;var d=this.$$c;if(d){var m=(v=et(d,f))==null?void 0:v.get;m?d[f]=c:d.$set({[f]:c})}}})}),i.forEach(f=>{Bt(s.prototype,f,{get(){var c;return(c=this.$$c)==null?void 0:c[f]}})}),e.element=s,s}const Vn=new TextEncoder;function Xa(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function Qa(e,t="SHA-256",r=1e5){const i=Date.now().toString(16);e||(e=Math.round(Math.random()*r));const a=await Un(i,e,t);return{algorithm:t,challenge:a,salt:i,signature:""}}async function Un(e,t,r){if(typeof crypto>"u"||!("subtle"in crypto)||!("digest"in crypto.subtle))throw new Error("Web Crypto is not available. Secure context is required (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).");return Xa(await crypto.subtle.digest(r.toUpperCase(),Vn.encode(e+t)))}function eo(e,t,r="SHA-256",i=1e6,a=0){const o=new AbortController,s=Date.now();return{promise:(async()=>{for(let c=a;c<=i;c+=1){if(o.signal.aborted)return null;if(await Un(t,c,r)===e)return{number:c,took:Date.now()-s}}return null})(),controller:o}}function jn(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function to(e){const t=atob(e),r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return r}function ro(e,t=12){const r=new Uint8Array(t);for(let i=0;i<t;i++)r[i]=e%256,e=Math.floor(e/256);return r}async function no(e,t="",r=1e6,i=0){const a="AES-GCM",o=new AbortController,s=Date.now(),f=async()=>{for(let m=i;m<=r;m+=1){if(o.signal.aborted||!c||!d)return null;try{const v=await crypto.subtle.decrypt({name:a,iv:ro(m)},c,d);if(v)return{clearText:new TextDecoder().decode(v),took:Date.now()-s}}catch{}}return null};let c=null,d=null;try{d=to(e);const m=await crypto.subtle.digest("SHA-256",Vn.encode(t));c=await crypto.subtle.importKey("raw",m,a,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:o}}return{promise:f(),controller:o}}var E=(e=>(e.CODE="code",e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(E||{}),Q=(e=>(e.ERROR="error",e.LOADING="loading",e.PLAYING="playing",e.PAUSED="paused",e.READY="ready",e))(Q||{});globalThis.altchaPlugins=globalThis.altchaPlugins||[],globalThis.altchaI18n=globalThis.altchaI18n||{register:(e,t)=>{globalThis.altchaI18n[e]=t}};const io={ariaLinkLabel:"Visit Altcha.org",enterCode:"Enter code",enterCodeAria:"Enter code you hear. Press Space to play audio.",error:"Verification failed. Try again later.",expired:"Verification expired. Try again.",footer:'Protected by <a href="https://altcha.org/" target="_blank" aria-label="Visit Altcha.org">ALTCHA</a>',getAudioChallenge:"Get an audio challenge",label:"I'm not a robot",loading:"Loading...",reload:"Reload",verify:"Verify",verificationRequired:"Verification required!",verified:"Verified",verifying:"Verifying...",waitAlert:"Verifying... please wait."};globalThis.altchaI18n.register("en",io);const Rr=(e,t)=>{let r=sa(()=>Gi(t==null?void 0:t(),24));var i=so();Oe(()=>{D(i,"width",l(r)),D(i,"height",l(r))}),q(e,i)};function ao(e,t){e.code==="Space"&&(e.preventDefault(),e.stopImmediatePropagation(),t())}function oo(e,t){e.preventDefault(),t()}function lo(e,t,r,i,a,o,s,f){var c;[E.UNVERIFIED,E.ERROR,E.EXPIRED,E.CODE].includes(l(t))?r()!==!1&&((c=l(i))==null?void 0:c.reportValidity())===!1?w(a,!1):o()?s():f():w(a,!0)}var so=er('<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" fill="currentColor" opacity=".25"></path><path d="M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z" fill="currentColor" class="altcha-spinner"></path></svg>'),uo=ye('<input type="hidden">'),fo=ye('<div><a target="_blank" class="altcha-logo" aria-hidden="true"><svg width="22" height="22" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.33955 16.4279C5.88954 20.6586 12.1971 21.2105 16.4279 17.6604C18.4699 15.947 19.6548 13.5911 19.9352 11.1365L17.9886 10.4279C17.8738 12.5624 16.909 14.6459 15.1423 16.1284C11.7577 18.9684 6.71167 18.5269 3.87164 15.1423C1.03163 11.7577 1.4731 6.71166 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577C16.9767 5.86872 17.5322 7.02798 17.804 8.2324L19.9522 9.01429C19.7622 7.07737 19.0059 5.17558 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956C-0.658625 5.88958 -1.21046 12.1971 2.33955 16.4279Z" fill="currentColor"></path><path d="M3.57212 2.33956C1.65755 3.94607 0.496389 6.11731 0.12782 8.40523L2.04639 9.13961C2.26047 7.15832 3.21057 5.25375 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577L13.8302 6.78606L19.9633 9.13364C19.7929 7.15555 19.0335 5.20847 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956Z" fill="currentColor"></path><path d="M7 10H5C5 12.7614 7.23858 15 10 15C12.7614 15 15 12.7614 15 10H13C13 11.6569 11.6569 13 10 13C8.3431 13 7 11.6569 7 10Z" fill="currentColor"></path></svg></a></div>'),co=er('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12.8659 3.00017L22.3922 19.5002C22.6684 19.9785 22.5045 20.5901 22.0262 20.8662C21.8742 20.954 21.7017 21.0002 21.5262 21.0002H2.47363C1.92135 21.0002 1.47363 20.5525 1.47363 20.0002C1.47363 19.8246 1.51984 19.6522 1.60761 19.5002L11.1339 3.00017C11.41 2.52187 12.0216 2.358 12.4999 2.63414C12.6519 2.72191 12.7782 2.84815 12.8659 3.00017ZM10.9999 16.0002V18.0002H12.9999V16.0002H10.9999ZM10.9999 9.00017V14.0002H12.9999V9.00017H10.9999Z"></path></svg>'),ho=er('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M15 7C15 6.44772 15.4477 6 16 6C16.5523 6 17 6.44772 17 7V17C17 17.5523 16.5523 18 16 18C15.4477 18 15 17.5523 15 17V7ZM7 7C7 6.44772 7.44772 6 8 6C8.55228 6 9 6.44772 9 7V17C9 17.5523 8.55228 18 8 18C7.44772 18 7 17.5523 7 17V7Z"></path></svg>'),vo=er('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 12H7C8.10457 12 9 12.8954 9 14V19C9 20.1046 8.10457 21 7 21H4C2.89543 21 2 20.1046 2 19V12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12V19C22 20.1046 21.1046 21 20 21H17C15.8954 21 15 20.1046 15 19V14C15 12.8954 15.8954 12 17 12H20C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12Z"></path></svg>'),go=ye('<button type="button" class="altcha-code-challenge-audio"><!></button>'),_o=ye("<audio hidden autoplay><source></audio>"),mo=ye('<div class="altcha-code-challenge" role="dialog"><div class="altcha-code-challenge-arrow"></div> <form data-code-challenge-form="1"><img class="altcha-code-challenge-image" alt=""> <input type="text" autocomplete="off" name="code" class="altcha-code-challenge-input" required> <div class="altcha-code-challenge-buttons"><div class="altcha-code-challenge-buttons-left"><!> <button type="button" class="altcha-code-challenge-reload"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2V4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 9.25022 5.38734 6.82447 7.50024 5.38451L7.5 8H9.5V2L3.5 2V4L5.99918 3.99989C3.57075 5.82434 2 8.72873 2 12Z"></path></svg></button></div> <button type="submit" class="altcha-code-challenge-verify"><!> </button></div> <!></form></div>'),po=ye("<div><!></div>"),bo=ye("<div><!></div>"),wo=ye('<div class="altcha-error"><svg width="14" height="14" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path></svg> <!></div>'),yo=ye('<div class="altcha-footer"><div><!></div></div>'),Eo=ye('<div class="altcha-anchor-arrow"></div>'),Co=ye('<!> <div class="altcha"><div class="altcha-main"><div><!> <input type="checkbox"></div> <label class="altcha-label"><!></label> <!> <!> <!></div> <!> <!> <!></div>',1);function qn(e,t){var ki,Ai;Cn(t,!0);let r=k(t,"auto",7,void 0),i=k(t,"blockspam",7,void 0),a=k(t,"challengeurl",7,void 0),o=k(t,"challengejson",7,void 0),s=k(t,"credentials",7,void 0),f=k(t,"customfetch",7,void 0),c=k(t,"debug",7,!1),d=k(t,"delay",7,0),m=k(t,"disableautofocus",7,!1),v=k(t,"expire",7,void 0),h=k(t,"floating",7,void 0),b=k(t,"floatinganchor",7,void 0),A=k(t,"floatingoffset",7,void 0),F=k(t,"floatingpersist",7,!1),U=k(t,"hidefooter",7,!1),ve=k(t,"hidelogo",7,!1),ue=k(t,"id",7,void 0),ee=k(t,"language",7,void 0),ge=k(t,"name",7,"altcha"),Ie=k(t,"maxnumber",7,1e6),B=k(t,"mockerror",7,!1),ie=k(t,"obfuscated",7,void 0),Ze=k(t,"plugins",7,void 0),$t=k(t,"refetchonexpire",7,!0),it=k(t,"sentinel",7,void 0),$e=k(t,"spamfilter",7,!1),gt=k(t,"strings",7,void 0),pe=k(t,"test",7,!1),ae=k(t,"verifyurl",7,void 0),_t=k(t,"workers",23,()=>Math.min(16,navigator.hardwareConcurrency||8)),St=k(t,"workerurl",7,void 0);const Hn=["SHA-256","SHA-384","SHA-512"],Ao="https://altcha.org/",ze=(n,u)=>{t.$$host.dispatchEvent(new CustomEvent(n,{detail:u}))},Gn=(Ai=(ki=document.documentElement.lang)==null?void 0:ki.split("-"))==null?void 0:Ai[0],Ir=je(()=>{var n;return a()&&new URL(a(),location.origin).host.endsWith(".altcha.org")&&!!((n=a())!=null&&n.includes("apiKey=ckey_"))}),$r=je(()=>o()?oi(o()):void 0),Ro=je(()=>gt()?oi(gt()):{}),M=je(()=>({...zn(),...l(Ro)})),Yn=je(()=>`${ue()||ge()}_checkbox_${Math.round(Math.random()*1e8)}`);let Tt=se(!1),Y=se(null),I=se(V(E.UNVERIFIED)),oe=se(void 0),Nt=se(null),Je=se(null),Sr=se(null),mt=se(null),j=se(null),at=se(null),Se=null,K=se(null),ot=se(!1),Ke=[],Tr=se(!1),Ve=se(null);br(()=>{Uo(l(at))}),br(()=>{jo(l(I))}),Ya(()=>{Io(),l(j)&&(l(j).removeEventListener("submit",ti),l(j).removeEventListener("reset",ri),l(j).removeEventListener("focusin",ei),w(j,null)),Se&&(clearTimeout(Se),Se=null),document.removeEventListener("click",Xn),document.removeEventListener("scroll",Qn),window.removeEventListener("resize",ai)}),Fn(()=>{var n;$("mounted","2.0.0-beta.9"),$("workers",_t()),No(),$("plugins",Ke.length?Ke.map(u=>u.constructor.pluginName).join(", "):"none"),pe()&&$("using test mode"),v()&&Nr(v()),r()!==void 0&&$("auto",r()),h()!==void 0&&si(h()),w(j,V((n=l(oe))==null?void 0:n.closest("form"))),l(j)&&(l(j).addEventListener("submit",ti,{capture:!0}),l(j).addEventListener("reset",ri),(r()==="onfocus"||F()==="focus")&&l(j).addEventListener("focusin",ei)),r()==="onload"&&(ie()?Dt():Ue()),l(Ir)&&(U()||ve())&&$("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{ze("load")})});function ar(n,u){return btoa(JSON.stringify({algorithm:n.algorithm,challenge:n.challenge,number:u.number,salt:n.salt,signature:n.signature,test:pe()?!0:void 0,took:u.took}))}function Io(){for(const n of Ke)n.destroy()}function Wn(){a()&&$t()&&l(I)===E.VERIFIED?Ue():pt(E.EXPIRED,l(M).expired)}async function $o(){var n;if(B())throw $("mocking error"),new Error("Mocked error.");if(l($r))return $("using provided json data"),l($r);if(pe())return $("generating test challenge",{test:pe()}),Qa(typeof pe()!="boolean"?+pe():void 0);{if(!a()&&l(j)){const C=l(j).getAttribute("action");C!=null&&C.includes("/form/")&&a(C+"/altcha")}if(!a())throw new Error("Attribute challengeurl not set.");$("fetching challenge from",a());const u={credentials:typeof s()=="boolean"?"include":s(),headers:$e()!==!1?{"x-altcha-spam-filter":"1"}:{}},g=await Zn()(a(),u);if(!g||!(g instanceof Response))throw new Error("Custom fetch function did not return a response.");if(g.status!==200)throw new Error(`Server responded with ${g.status}.`);const p=g.headers.get("X-Altcha-Config"),_=await g.json(),R=new URLSearchParams((n=_.salt.split("?"))==null?void 0:n[1]),y=R.get("expires")||R.get("expire");if(y){const C=new Date(+y*1e3),H=isNaN(C.getTime())?0:C.getTime()-Date.now();H>0&&Nr(H)}if(p)try{const C=JSON.parse(p);C&&typeof C=="object"&&(C.verifyurl&&!C.verifyurl.startsWith("javascript:")&&(C.verifyurl=Kn(C.verifyurl)),ci(C))}catch(C){$("unable to configure from X-Altcha-Config",C)}return _}}function So(n){var g,p;const u=(g=l(j))==null?void 0:g.querySelector(typeof n=="string"?`input[name="${n}"]`:'input[type="email"]:not([data-no-spamfilter])');return((p=u==null?void 0:u.value)==null?void 0:p.slice(u.value.indexOf("@")))||void 0}function Zn(){let n=fetch;if(f())if($("using customfetch"),typeof f()=="string"){if(n=globalThis[f()]||null,!n)throw new Error(`Custom fetch function not found: ${f()}`)}else n=f();return n}function zn(n=[ee()||"",document.documentElement.lang||"",...navigator.languages]){const u=Object.keys(globalThis.altchaI18n).map(p=>p.toLowerCase()),g=n.reduce((p,_)=>(_=_.toLowerCase(),p||(globalThis.altchaI18n[_]?_:null)||u.find(R=>_.split("-")[0]===R.split("-")[0])||null),null);return globalThis.altchaI18n[g||"en"]}function To(){return $e()==="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 $e()=="object"?$e():{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 Jn(n){var g;return[...((g=l(j))==null?void 0:g.querySelectorAll(n!=null&&n.length?n.map(p=>`input[name="${p}"]`).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'))||[]].reduce((p,_)=>{const R=_.name,y=_.value;return R&&y&&(p[R]=/\n/.test(y)?y.replace(new RegExp("(?<!\\r)\\n","g"),`\r
|
|
4
|
-
`):y),p},{})}function Kn(n,u){const g=new URL(a()||location.origin),p=new URL(n,g);if(p.search||(p.search=g.search),u)for(const _ in u)u[_]!==void 0&&u[_]!==null&&p.searchParams.set(_,u[_]);return p.toString()}function No(){const n=Ze()!==void 0?Ze().split(","):void 0;for(const u of globalThis.altchaPlugins)(!n||n.includes(u.pluginName))&&Ke.push(new u({el:l(oe),clarify:Dt,dispatch:ze,getConfiguration:di,getFloatingAnchor:hi,getState:vi,log:$,reset:pt,solve:fi,setState:Te,setFloatingAnchor:_i,verify:Ue}))}function $(...n){(c()||n.some(u=>u instanceof Error))&&console[n[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${ge()}]`,...n)}function Do(){w(K,V(Q.PAUSED))}function Lo(n){w(K,V(Q.ERROR))}function Po(){w(K,V(Q.READY))}function Oo(){w(K,V(Q.LOADING))}function Fo(){w(K,V(Q.PLAYING))}function Mo(){w(K,V(Q.PAUSED))}function Vo(n){var u;if(n.preventDefault(),n.stopPropagation(),l(Y)){const g=new FormData(n.target),p=String(g.get("code"));if((u=ae())!=null&&u.startsWith("javascript:")){const _=ae().replace(/^javascript:/,"");if($(`calling ${_} function instead of verifyurl`),!(_ in globalThis))throw new Error(`Global function "${_}" is undefined.`);return globalThis[_]({challenge:l(Y).challenge,code:p,solution:l(Y).solution})}w(ot,!0),li(ar(l(Y).challenge,l(Y).solution),p).then(({reason:_,verified:R})=>{R?(w(Y,null),Te(E.VERIFIED),$("verified"),pr().then(()=>{var y;(y=l(Sr))==null||y.focus(),ze("verified",{payload:l(Ve)})})):(pt(),w(at,V(_||"Verification failed")))}).catch(_=>{w(Y,null),Te(E.ERROR,_),$("sentinel verification failed:",_)}).finally(()=>{w(ot,!1)})}}function Xn(n){var g;const u=n.target;h()&&u&&!l(oe).contains(u)&&(l(I)===E.VERIFIED&&F()===!1||l(I)===E.VERIFIED&&F()==="focus"&&!((g=l(j))!=null&&g.matches(":focus-within"))||r()==="off"&&l(I)===E.UNVERIFIED)&&gi()}function Qn(){h()&&l(I)!==E.UNVERIFIED&&Lt()}function Uo(n){for(const u of Ke)typeof u.onErrorChange=="function"&&u.onErrorChange(l(at))}function ei(n){l(I)===E.UNVERIFIED?Ue():h()&&F()==="focus"&&l(I)===E.VERIFIED&&Dr()}function ti(n){const u=n.target,g=n.submitter;u!=null&&u.hasAttribute("data-code-challenge-form")||(l(j)&&r()==="onsubmit"?l(I)===E.UNVERIFIED?(n.preventDefault(),n.stopPropagation(),Ue().then(()=>{var _;g&&["INPUT","BUTTON"].includes(g.tagName)&&g.getAttribute("name")?g.click():(_=l(j))==null||_.requestSubmit()})):l(I)!==E.VERIFIED&&(n.preventDefault(),n.stopPropagation(),l(I)===E.VERIFYING&&ni()):l(j)&&h()&&r()==="off"&&l(I)===E.UNVERIFIED&&(n.preventDefault(),n.stopPropagation(),Dr()))}function ri(){pt()}function ni(){l(I)===E.VERIFYING&&l(M).waitAlert&&alert(l(M).waitAlert)}function ii(){l(Je)?l(Je).paused?(l(Je).currentTime=0,l(Je).play()):l(Je).pause():(w(Tr,!0),requestAnimationFrame(()=>{var n;(n=l(Je))==null||n.play()}))}function jo(n){for(const u of Ke)typeof u.onStateChange=="function"&&u.onStateChange(l(I));h()&&l(I)!==E.UNVERIFIED&&requestAnimationFrame(()=>{Lt()}),w(Tt,l(I)===E.VERIFIED)}function ai(){h()&&Lt()}function oi(n){return JSON.parse(n)}async function qo(n){if(!ae())throw new Error("Attribute verifyurl not set.");$("requesting server verification from",ae());const u={payload:n};if($e()!==!1){const{blockedCountries:_,classifier:R,disableRules:y,email:C,expectedLanguages:H,expectedCountries:te,fields:fe,ipAddress:Xe,text:Pr,timeZone:sr}=To();u.blockedCountries=_,u.classifier=R,u.disableRules=y,u.email=C===!1?void 0:So(C),u.expectedCountries=te,u.expectedLanguages=H||(Gn?[Gn]:void 0),u.fields=fe===!1?void 0:Jn(fe),u.ipAddress=Xe===!1?void 0:Xe||"auto",u.text=Pr,u.timeZone=sr===!1?void 0:sr||jn()}const g=await Zn()(ae(),{body:JSON.stringify(u),headers:{"content-type":"application/json"},method:"POST"});if(!g||!(g instanceof Response))throw new Error("Custom fetch function did not return a response.");if(g.status!==200)throw new Error(`Server responded with ${g.status}.`);const p=await g.json();if(p!=null&&p.payload&&w(Ve,V(p.payload)),ze("serververification",p),i()&&p.classification==="BAD")throw new Error("SpamFilter returned negative classification.")}async function li(n,u){if(!ae())throw new Error("Attribute verifyurl not set.");$("requesting sentinel verification from",ae());const g={code:u,payload:n};it()&&(g.fields=it().fields?Jn():void 0,g.timeZone=it().timeZone?jn():void 0);const p=await fetch(ae(),{body:JSON.stringify(g),headers:{"content-type":"application/json"},method:"POST"});if(p.status!==200)throw new Error(`Server responded with ${p.status}.`);const _=await p.json();return _!=null&&_.payload&&w(Ve,V(_.payload)),ze("sentinelverification",_),_}function Nr(n){$("expire",n),Se&&(clearTimeout(Se),Se=null),n<1?Wn():Se=setTimeout(Wn,n)}function si(n){$("floating",n),h()!==n&&(l(oe).style.left="",l(oe).style.top=""),h(n===!0||n===""?"auto":n===!1||n==="false"?void 0:h()),h()?(r()||r("onsubmit"),document.addEventListener("scroll",Qn),document.addEventListener("click",Xn),window.addEventListener("resize",ai)):r()==="onsubmit"&&r(void 0)}function ui(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(!Hn.includes(n.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${Hn.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 fi(n){let u=null;if("Worker"in window){try{u=await Bo(n,n.maxNumber||n.maxnumber||Ie())}catch(g){$(g)}if((u==null?void 0:u.number)!==void 0||"obfuscated"in n)return{data:n,solution:u}}if("obfuscated"in n){const g=await no(n.obfuscated,n.key,n.maxNumber||n.maxnumber);return{data:n,solution:await g.promise}}return{data:n,solution:await eo(n.challenge,n.salt,n.algorithm,n.maxNumber||n.maxnumber||Ie()).promise}}async function Bo(n,u=typeof pe()=="number"?pe():n.maxNumber||n.maxnumber||Ie(),g=Math.ceil(_t())){const p=[];g=Math.min(16,u,Math.max(1,g));for(let y=0;y<g;y++)p.push(altchaCreateWorker(St()));const _=Math.ceil(u/g),R=await Promise.all(p.map((y,C)=>{const H=C*_;return new Promise(te=>{y.addEventListener("message",fe=>{if(fe.data)for(const Xe of p)Xe!==y&&Xe.postMessage({type:"abort"});te(fe.data)}),y.postMessage({payload:n,max:H+_,start:H,type:"work"})})}));for(const y of p)y.terminate();return R.find(y=>!!y)||null}async function Dt(){if(!ie()){Te(E.ERROR);return}const n=Ke.find(u=>u.constructor.pluginName==="obfuscation");if(!n||!("clarify"in n)){Te(E.ERROR),$("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");return}if("clarify"in n&&typeof n.clarify=="function")return n.clarify()}function ci(n){n.obfuscated!==void 0&&ie(n.obfuscated),n.auto!==void 0&&(r(n.auto),r()==="onload"&&(ie()?Dt():Ue())),n.blockspam!==void 0&&i(!!n.blockspam),n.customfetch!==void 0&&f(n.customfetch),n.floatinganchor!==void 0&&b(n.floatinganchor),n.delay!==void 0&&d(n.delay),n.floatingoffset!==void 0&&A(n.floatingoffset),n.floating!==void 0&&si(n.floating),n.expire!==void 0&&(Nr(n.expire),v(n.expire)),n.challenge&&(o(typeof n.challenge=="string"?n.challenge:JSON.stringify(n.challenge)),ui(l($r))),n.challengeurl!==void 0&&a(n.challengeurl),n.debug!==void 0&&c(!!n.debug),n.hidefooter!==void 0&&U(!!n.hidefooter),n.hidelogo!==void 0&&ve(!!n.hidelogo),n.language!==void 0&>(zn([n.language])),n.maxnumber!==void 0&&Ie(+n.maxnumber),n.mockerror!==void 0&&B(!!n.mockerror),n.name!==void 0&&ge(n.name),n.refetchonexpire!==void 0&&$t(!!n.refetchonexpire),n.sentinel!==void 0&&typeof n.sentinel=="object"&&it(n.sentinel),n.spamfilter!==void 0&&$e(typeof n.spamfilter=="object"?n.spamfilter:!!n.spamfilter),n.strings&>(typeof n.strings=="string"?n.strings:JSON.stringify(n.strings)),n.test!==void 0&&pe(typeof n.test=="number"?n.test:!!n.test),n.verifyurl!==void 0&&ae(n.verifyurl),n.workers!==void 0&&_t(+n.workers),n.workerurl!==void 0&&St(n.workerurl)}function di(){return{auto:r(),blockspam:i(),challengeurl:a(),debug:c(),delay:d(),expire:v(),floating:h(),floatinganchor:b(),floatingoffset:A(),hidefooter:U(),hidelogo:ve(),name:ge(),maxnumber:Ie(),mockerror:B(),obfuscated:ie(),refetchonexpire:$t(),spamfilter:$e(),strings:l(M),test:pe(),verifyurl:ae(),workers:_t(),workerurl:St()}}function hi(){return l(mt)}function Ho(n){return Ke.find(u=>u.constructor.pluginName===n)}function vi(){return l(I)}function gi(){l(oe).style.display="none"}function Lt(n=20){var u;if(l(oe))if(l(mt)||w(mt,V((b()?document.querySelector(b()):(u=l(j))==null?void 0:u.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||l(j))),l(mt)){const g=parseInt(A(),10)||12,p=l(mt).getBoundingClientRect(),_=l(oe).getBoundingClientRect(),R=document.documentElement.clientHeight,y=document.documentElement.clientWidth,C=h()==="auto"?p.bottom+_.height+g+n>R:h()==="top",H=Math.max(n,Math.min(y-n-_.width,p.left+p.width/2-_.width/2));if(C?l(oe).style.top=`${p.top-(_.height+g)}px`:l(oe).style.top=`${p.bottom+g}px`,l(oe).style.left=`${H}px`,l(oe).setAttribute("data-floating",C?"top":"bottom"),l(Nt)){const te=l(Nt).getBoundingClientRect();l(Nt).style.left=p.left-H+p.width/2-te.width/2+"px"}}else $("unable to find floating anchor element")}function pt(n=E.UNVERIFIED,u=null){Se&&(clearTimeout(Se),Se=null),w(Tt,!1),w(Ve,null),w(Y,null),w(Tr,!1),w(K,null),Te(n,u)}function _i(n){w(mt,V(n))}function Te(n,u=null){w(I,V(n)),w(at,V(u)),ze("statechange",{payload:l(Ve),state:l(I)})}function Dr(){l(oe).style.display="block",h()&&Lt()}async function Ue(){return pt(E.VERIFYING),await new Promise(n=>setTimeout(n,d()||0)),$o().then(n=>(ui(n),$("challenge",n),fi(n))).then(({data:n,solution:u})=>{var g;if($("solution",u),!u||n&&"challenge"in n&&!("clearText"in u))if((u==null?void 0:u.number)!==void 0&&"challenge"in n)if(ae()&&"codeChallenge"in n)((g=document.activeElement)==null?void 0:g.tagName)==="INPUT"&&m()===!1&&document.activeElement.blur(),w(Y,V({challenge:n,solution:u}));else{if(ae()&&it()!==void 0)return li(ar(n,u));if(ae())return qo(ar(n,u));w(Ve,V(ar(n,u))),$("payload",l(Ve))}else throw $("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."),new Error("Unexpected result returned.")}).then(()=>{l(Y)?(Te(E.CODE),pr().then(()=>{ze("code",{codeChallenge:l(Y)})})):(Te(E.VERIFIED),$("verified"),pr().then(()=>{ze("verified",{payload:l(Ve)})}))}).catch(n=>{$(n),Te(E.ERROR,n.message)})}var mi=Co(),pi=kt(mi);Ma(pi,t,"default",{});var Pt=z(pi,2),Lr=Z(Pt),or=Z(Lr);let bi;var wi=Z(or);{var Go=n=>{Rr(n)};J(wi,n=>{l(I)===E.VERIFYING&&n(Go)})}var lt=z(wi,2);Dn(lt),lt.__change=[lo,I,$e,j,Tt,ie,Dt,Ue],rr(lt,n=>w(Sr,n),()=>l(Sr)),W(or);var lr=z(or,2),Yo=Z(lr);{var Wo=n=>{var u=tr(),g=kt(u);nt(g,()=>l(M).verified),q(n,u)},Zo=(n,u)=>{{var g=_=>{var R=tr(),y=kt(R);nt(y,()=>l(M).verifying),q(_,R)},p=(_,R)=>{{var y=H=>{var te=tr(),fe=kt(te);nt(fe,()=>l(M).verificationRequired),q(H,te)},C=H=>{var te=tr(),fe=kt(te);nt(fe,()=>l(M).label),q(H,te)};J(_,H=>{l(I)===E.CODE?H(y):H(C,!1)},R)}};J(n,_=>{l(I)===E.VERIFYING?_(g):_(p,!1)},u)}};J(Yo,n=>{l(I)===E.VERIFIED?n(Wo):n(Zo,!1)})}W(lr);var yi=z(lr,2);{var zo=n=>{var u=uo();Dn(u),Oe(()=>{D(u,"name",ge()),Ba(u,l(Ve))}),q(n,u)};J(yi,n=>{l(I)===E.VERIFIED&&n(zo)})}var Ei=z(yi,2);{var Jo=n=>{var u=fo(),g=Z(u);D(g,"href",Ao),W(u),Oe(()=>D(g,"aria-label",l(M).ariaLinkLabel)),q(n,u)};J(Ei,n=>{(ve()!==!0||l(Ir))&&n(Jo)})}var Ko=z(Ei,2);{var Xo=n=>{var u=mo(),g=z(Z(u),2),p=Z(g),_=z(p,2);Ta(_,!m()),_.__keydown=[ao,ii];var R=z(_,2),y=Z(R),C=Z(y);{var H=Ee=>{var X=go();X.__click=ii;var ur=Z(X);{var Ot=bt=>{Rr(bt,()=>20)},al=(bt,ol)=>{{var ll=wt=>{var Or=co();q(wt,Or)},sl=(wt,Or)=>{{var ul=yt=>{var Fr=ho();q(yt,Fr)},fl=yt=>{var Fr=vo();q(yt,Fr)};J(wt,yt=>{l(K)===Q.PLAYING?yt(ul):yt(fl,!1)},Or)}};J(bt,wt=>{l(K)===Q.ERROR?wt(ll):wt(sl,!1)},ol)}};J(ur,bt=>{l(K)===Q.LOADING?bt(Ot):bt(al,!1)})}W(X),Oe(()=>{D(X,"title",l(M).getAudioChallenge),X.disabled=l(K)===Q.LOADING||l(K)===Q.ERROR||l(ot),D(X,"aria-label",l(K)===Q.LOADING?l(M).loading:l(M).getAudioChallenge)}),q(Ee,X)};J(C,Ee=>{l(Y).challenge.codeChallenge.audio&&Ee(H)})}var te=z(C,2);te.__click=[oo,Ue],W(y);var fe=z(y,2),Xe=Z(fe);{var Pr=Ee=>{Rr(Ee,()=>16)};J(Xe,Ee=>{l(ot)&&Ee(Pr)})}var sr=z(Xe);W(fe),W(R);var nl=z(R,2);{var il=Ee=>{var X=_o(),ur=Z(X);W(X),rr(X,Ot=>w(Je,Ot),()=>l(Je)),Oe(Ot=>D(ur,"src",Ot),[()=>Kn(l(Y).challenge.codeChallenge.audio,{language:ee()})]),We("loadstart",X,Oo),We("canplay",X,Po),We("pause",X,Mo),We("playing",X,Fo),We("ended",X,Do),We("error",ur,Lo),q(Ee,X)};J(nl,Ee=>{l(Y).challenge.codeChallenge.audio&&l(Tr)&&Ee(il)})}W(g),W(u),Oe(()=>{D(u,"aria-label",l(M).verificationRequired),D(p,"src",l(Y).challenge.codeChallenge.image),D(_,"minlength",l(Y).challenge.codeChallenge.length||1),D(_,"maxlength",l(Y).challenge.codeChallenge.length),D(_,"placeholder",l(M).enterCode),D(_,"aria-label",l(K)===Q.LOADING?l(M).loading:l(K)===Q.PLAYING?"":l(M).enterCodeAria),D(_,"aria-live",l(K)?"assertive":"polite"),D(_,"aria-busy",l(K)===Q.LOADING),_.disabled=l(ot),D(te,"aria-label",l(M).reload),D(te,"title",l(M).reload),te.disabled=l(ot),fe.disabled=l(ot),D(fe,"aria-label",l(M).verify),Pa(sr,` ${l(M).verify??""}`)}),We("submit",g,Vo,!0),q(n,u)};J(Ko,n=>{var u;(u=l(Y))!=null&&u.challenge.codeChallenge&&n(Xo)})}W(Lr);var Ci=z(Lr,2);{var Qo=n=>{var u=wo(),g=z(Z(u),2);{var p=R=>{var y=po(),C=Z(y);nt(C,()=>l(M).expired),W(y),Oe(()=>D(y,"title",l(at))),q(R,y)},_=R=>{var y=bo(),C=Z(y);nt(C,()=>l(M).error),W(y),Oe(()=>D(y,"title",l(at))),q(R,y)};J(g,R=>{l(I)===E.EXPIRED?R(p):R(_,!1)})}W(u),q(n,u)};J(Ci,n=>{(l(at)||l(I)===E.EXPIRED)&&n(Qo)})}var xi=z(Ci,2);{var el=n=>{var u=yo(),g=Z(u),p=Z(g);nt(p,()=>l(M).footer),W(g),W(u),q(n,u)};J(xi,n=>{l(M).footer&&(U()!==!0||l(Ir))&&n(el)})}var tl=z(xi,2);{var rl=n=>{var u=Eo();rr(u,g=>w(Nt,g),()=>l(Nt)),q(n,u)};J(tl,n=>{h()&&n(rl)})}return W(Pt),rr(Pt,n=>w(oe,n),()=>l(oe)),Oe(n=>{D(Pt,"data-state",l(I)),D(Pt,"data-floating",h()),bi=Ua(or,1,"altcha-checkbox",null,bi,n),D(lt,"id",l(Yn)),lt.required=r()!=="onsubmit"&&(!h()||r()!=="off"),D(lr,"for",l(Yn))},[()=>({"altcha-checkbox-verifying":l(I)===E.VERIFYING})]),We("invalid",lt,ni),Ga(lt,()=>l(Tt),n=>w(Tt,n)),q(e,mi),xn({clarify:Dt,configure:ci,getConfiguration:di,getFloatingAnchor:hi,getPlugin:Ho,getState:vi,hide:gi,repositionFloating:Lt,reset:pt,setFloatingAnchor:_i,setState:Te,show:Dr,verify:Ue,get auto(){return r()},set auto(n=void 0){r(n),x()},get blockspam(){return i()},set blockspam(n=void 0){i(n),x()},get challengeurl(){return a()},set challengeurl(n=void 0){a(n),x()},get challengejson(){return o()},set challengejson(n=void 0){o(n),x()},get credentials(){return s()},set credentials(n=void 0){s(n),x()},get customfetch(){return f()},set customfetch(n=void 0){f(n),x()},get debug(){return c()},set debug(n=!1){c(n),x()},get delay(){return d()},set delay(n=0){d(n),x()},get disableautofocus(){return m()},set disableautofocus(n=!1){m(n),x()},get expire(){return v()},set expire(n=void 0){v(n),x()},get floating(){return h()},set floating(n=void 0){h(n),x()},get floatinganchor(){return b()},set floatinganchor(n=void 0){b(n),x()},get floatingoffset(){return A()},set floatingoffset(n=void 0){A(n),x()},get floatingpersist(){return F()},set floatingpersist(n=!1){F(n),x()},get hidefooter(){return U()},set hidefooter(n=!1){U(n),x()},get hidelogo(){return ve()},set hidelogo(n=!1){ve(n),x()},get id(){return ue()},set id(n=void 0){ue(n),x()},get language(){return ee()},set language(n=void 0){ee(n),x()},get name(){return ge()},set name(n="altcha"){ge(n),x()},get maxnumber(){return Ie()},set maxnumber(n=1e6){Ie(n),x()},get mockerror(){return B()},set mockerror(n=!1){B(n),x()},get obfuscated(){return ie()},set obfuscated(n=void 0){ie(n),x()},get plugins(){return Ze()},set plugins(n=void 0){Ze(n),x()},get refetchonexpire(){return $t()},set refetchonexpire(n=!0){$t(n),x()},get sentinel(){return it()},set sentinel(n=void 0){it(n),x()},get spamfilter(){return $e()},set spamfilter(n=!1){$e(n),x()},get strings(){return gt()},set strings(n=void 0){gt(n),x()},get test(){return pe()},set test(n=!1){pe(n),x()},get verifyurl(){return ae()},set verifyurl(n=void 0){ae(n),x()},get workers(){return _t()},set workers(n=Math.min(16,navigator.hardwareConcurrency||8)){_t(n),x()},get workerurl(){return St()},set workerurl(n=void 0){St(n),x()}})}La(["change","keydown","click"]),customElements.define("altcha-widget",Ka(qn,{blockspam:{type:"Boolean"},debug:{type:"Boolean"},delay:{type:"Number"},disableautofocus:{type:"Boolean"},expire:{type:"Number"},floatingoffset:{type:"Number"},hidefooter:{type:"Boolean"},hidelogo:{type:"Boolean"},maxnumber:{type:"Number"},mockerror:{type:"Boolean"},refetchonexpire:{type:"Boolean"},test:{type:"Boolean"},workers:{type:"Number"},auto:{},challengeurl:{},challengejson:{},credentials:{},customfetch:{},floating:{},floatinganchor:{},floatingpersist:{},id:{},language:{},name:{},obfuscated:{},plugins:{},sentinel:{},spamfilter:{},strings:{},verifyurl:{},workerurl:{}},["default"],["clarify","configure","getConfiguration","getFloatingAnchor","getPlugin","getState","hide","repositionFloating","reset","setFloatingAnchor","setState","show","verify"],!1));const xo='@keyframes altcha-spinner{to{transform:rotate(360deg)}}.altcha{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}.altcha:focus-within{border-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating]{background:var(--altcha-color-base, white);display:none;filter:drop-shadow(3px 3px 6px rgba(0,0,0,.2));left:-100%;position:fixed;top:-100%;width:var(--altcha-max-width, 260px);z-index:999999}.altcha[data-floating=top] .altcha-anchor-arrow{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto}.altcha[data-floating=bottom]:focus-within::after{border-bottom-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating=top]:focus-within::after{border-top-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating]:not([data-state=unverified]){display:block}.altcha-anchor-arrow{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{align-items:center;display:flex;gap:.4rem;padding:.7rem;position:relative}.altcha-code-challenge{background:var(--altcha-color-base, white);border:1px solid var(--altcha-color-border-focus, currentColor);border-radius:var(--altcha-border-radius, 3px);filter:drop-shadow(3px 3px 6px rgba(0,0,0,.2));padding:.5rem;position:absolute;top:2.5rem;z-index:9999999}.altcha-code-challenge>form{display:flex;flex-direction:column;gap:.5rem}.altcha-code-challenge-input{border:1px solid currentColor;border-radius:3px;box-sizing:border-box;outline:0;font-size:16px;padding:.35rem;width:220px}.altcha-code-challenge-input:focus{outline:2px solid color-mix(in srgb,var(--altcha-color-active, #1D1DC9) 20%,transparent)}.altcha-code-challenge-input:disabled{opacity:.7}.altcha-code-challenge-image{background-color:#fff;border:1px solid currentColor;border-radius:3px;box-sizing:border-box;object-fit:contain;height:50px;width:220px}.altcha-code-challenge-audio,.altcha-code-challenge-reload{background:color-mix(in srgb,var(--altcha-color-text, currentColor) 10%,transparent);border:0;border-radius:3px;color:var(--altcha-color-text, currentColor);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:.35rem}.altcha-code-challenge-audio:disabled,.altcha-code-challenge-reload:disabled,.altcha-code-challenge-verify:disabled{opacity:.7;pointer-events:none}.altcha-code-challenge-audio>*,.altcha-code-challenge-reload>*{height:20px;width:20px}.altcha-code-challenge-buttons{display:flex;justify-content:space-between}.altcha-code-challenge-buttons-left{display:flex;gap:.25rem}.altcha-code-challenge-verify{align-items:center;background:var(--altcha-color-active, #1D1DC9);border:0;border-radius:3px;color:#fff;cursor:pointer;display:flex;gap:.5rem;font-size:100%;padding:.35rem 1rem}.altcha-code-challenge-arrow{border:6px solid transparent;border-bottom-color:var(--altcha-color-border, currentColor);content:"";height:0;left:.15rem;position:absolute;top:-12px;width:0}.altcha[data-floating=top] .altcha-code-challenge{top:-150px}.altcha[data-floating=top] .altcha-code-challenge-arrow{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, currentColor);bottom:-12px;top:auto}.altcha-label{cursor:pointer;flex-grow:1}.altcha-logo{color:currentColor;opacity:.7}.altcha-footer:hover,.altcha-logo:hover{opacity:1}.altcha-error{color:var(--altcha-color-error-text, #f23939);display:flex;font-size:.85rem;gap:.3rem;padding:0 .7rem .7rem}.altcha-footer{align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:.75rem;opacity:.7;justify-content:end;padding:.2rem .7rem}.altcha-footer a{color:currentColor}.altcha-checkbox{display:flex;align-items:center;height:24px;width:24px}.altcha-checkbox input{width:18px;height:18px;margin:0}.altcha-checkbox-verifying input{appearance:none;border:0;height:0;padding:0;pointer-events:none;width:0}.altcha-spinner{animation:altcha-spinner .75s infinite linear;transform-origin:center}';function ko(e,t="__altcha-css"){if(!document.getElementById(t)){const r=document.createElement("style");r.id=t,r.textContent=e,document.head.appendChild(r)}}globalThis.altchaCreateWorker=e=>e?new Worker(new URL(e)):new Ft,ko(xo),S.Altcha=qn,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(S,D){typeof exports=="object"&&typeof module<"u"?D(exports):typeof define=="function"&&define.amd?define(["exports"],D):(S=typeof globalThis<"u"?globalThis:S||self,D(S.altcha={}))})(this,function(S){"use strict";var Sl=Object.defineProperty;var Yi=S=>{throw TypeError(S)};var Tl=(S,D,G)=>D in S?Sl(S,D,{enumerable:!0,configurable:!0,writable:!0,value:G}):S[D]=G;var Ae=(S,D,G)=>Tl(S,typeof D!="symbol"?D+"":D,G),Wi=(S,D,G)=>D.has(S)||Yi("Cannot "+G);var he=(S,D,G)=>(Wi(S,D,"read from private field"),G?G.call(S):D.get(S)),zr=(S,D,G)=>D.has(S)?Yi("Cannot add the same private member more than once"):D instanceof WeakSet?D.add(S):D.set(S,G),Jr=(S,D,G,Bt)=>(Wi(S,D,"write to private field"),Bt?Bt.call(S,G):D.set(S,G),G);var ui,Oe,be;const D=`(function(){"use strict";const d=new TextEncoder;function p(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function b(e,t,r){if(typeof crypto>"u"||!("subtle"in crypto)||!("digest"in crypto.subtle))throw new Error("Web Crypto is not available. Secure context is required (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).");return p(await crypto.subtle.digest(r.toUpperCase(),d.encode(e+t)))}function w(e,t,r="SHA-256",n=1e6,s=0){const o=new AbortController,a=Date.now();return{promise:(async()=>{for(let c=s;c<=n;c+=1){if(o.signal.aborted)return null;if(await b(t,c,r)===e)return{number:c,took:Date.now()-a}}return null})(),controller:o}}function h(e){const t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function g(e,t=12){const r=new Uint8Array(t);for(let n=0;n<t;n++)r[n]=e%256,e=Math.floor(e/256);return r}async function m(e,t="",r=1e6,n=0){const s="AES-GCM",o=new AbortController,a=Date.now(),l=async()=>{for(let u=n;u<=r;u+=1){if(o.signal.aborted||!c||!y)return null;try{const f=await crypto.subtle.decrypt({name:s,iv:g(u)},c,y);if(f)return{clearText:new TextDecoder().decode(f),took:Date.now()-a}}catch{}}return null};let c=null,y=null;try{y=h(e);const u=await crypto.subtle.digest("SHA-256",d.encode(t));c=await crypto.subtle.importKey("raw",u,s,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:o}}return{promise:l(),controller:o}}let i;onmessage=async e=>{const{type:t,payload:r,start:n,max:s}=e.data;let o=null;if(t==="abort")i==null||i.abort(),i=void 0;else if(t==="work"){if("obfuscated"in r){const{key:a,obfuscated:l}=r||{};o=await m(l,a,s,n)}else{const{algorithm:a,challenge:l,salt:c}=r||{};o=w(l,c,a,s,n)}i=o.controller,o.promise.then(a=>{self.postMessage(a&&{...a,worker:!0})})}}})();
|
|
2
|
+
`,G=typeof self<"u"&&self.Blob&&new Blob([D],{type:"text/javascript;charset=utf-8"});function Bt(e){let t;try{if(t=G&&(self.URL||self.webkitURL).createObjectURL(G),!t)throw"";const r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(D),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}const Zi="5";typeof window<"u"&&((ui=window.__svelte??(window.__svelte={})).v??(ui.v=new Set)).add(Zi);const zi=1,Ji=4,Ki=8,Xi=16,Qi=1,eo=2,pr="[",Kr="[!",Xr="]",st={},ue=Symbol(),to="http://www.w3.org/1999/xhtml",Qr=!1;function en(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}var tn=Array.isArray,ro=Array.prototype.indexOf,no=Array.from,Ht=Object.keys,Ct=Object.defineProperty,Ke=Object.getOwnPropertyDescriptor,io=Object.getOwnPropertyDescriptors,oo=Object.prototype,ao=Array.prototype,rn=Object.getPrototypeOf,nn=Object.isExtensible;const ut=()=>{};function on(e){for(var t=0;t<e.length;t++)e[t]()}function lo(e,t,r=!1){return e===void 0?r?t():t:e}const ye=2,an=4,Gt=8,mr=16,Pe=32,Xe=64,Yt=128,ve=256,Wt=512,fe=1024,Ie=2048,Qe=4096,ft=8192,Zt=16384,so=32768,br=65536,uo=1<<19,ln=1<<20,wr=1<<21,xt=Symbol("$state"),sn=Symbol("legacy props"),fo=Symbol("");function co(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function ho(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function vo(e){throw new Error("https://svelte.dev/e/effect_orphan")}function go(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function _o(){throw new Error("https://svelte.dev/e/hydration_failed")}function po(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function mo(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function bo(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function wo(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function zt(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let F=!1;function ct(e){F=e}let M;function Ve(e){if(e===null)throw zt(),st;return M=e}function dt(){return Ve(je(M))}function W(e){if(F){if(je(M)!==null)throw zt(),st;M=e}}function yo(){for(var e=0,t=M;;){if(t.nodeType===8){var r=t.data;if(r===Xr){if(e===0)return t;e-=1}else(r===pr||r===Kr)&&(e+=1)}var i=je(t);t.remove(),t=i}}let Eo=!1;function Ue(e){if(typeof e!="object"||e===null||xt in e)return e;const t=rn(e);if(t!==oo&&t!==ao)return e;var r=new Map,i=tn(e),a=U(0),o=N,u=s=>{var c=N;Se(o);var d=s();return Se(c),d};return i&&r.set("length",U(e.length)),new Proxy(e,{defineProperty(s,c,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&mo();var p=r.get(c);return p===void 0?(p=u(()=>U(d.value)),r.set(c,p)):b(p,u(()=>Ue(d.value))),!0},deleteProperty(s,c){var d=r.get(c);if(d===void 0)c in s&&(r.set(c,u(()=>U(ue))),yr(a));else{if(i&&typeof c=="string"){var p=r.get("length"),h=Number(c);Number.isInteger(h)&&h<p.v&&b(p,h)}b(d,ue),yr(a)}return!0},get(s,c,d){var y;if(c===xt)return e;var p=r.get(c),h=c in s;if(p===void 0&&(!h||(y=Ke(s,c))!=null&&y.writable)&&(p=u(()=>U(Ue(h?s[c]:ue))),r.set(c,p)),p!==void 0){var g=l(p);return g===ue?void 0:g}return Reflect.get(s,c,d)},getOwnPropertyDescriptor(s,c){var d=Reflect.getOwnPropertyDescriptor(s,c);if(d&&"value"in d){var p=r.get(c);p&&(d.value=l(p))}else if(d===void 0){var h=r.get(c),g=h==null?void 0:h.v;if(h!==void 0&&g!==ue)return{enumerable:!0,configurable:!0,value:g,writable:!0}}return d},has(s,c){var g;if(c===xt)return!0;var d=r.get(c),p=d!==void 0&&d.v!==ue||Reflect.has(s,c);if(d!==void 0||L!==null&&(!p||(g=Ke(s,c))!=null&&g.writable)){d===void 0&&(d=u(()=>U(p?Ue(s[c]):ue)),r.set(c,d));var h=l(d);if(h===ue)return!1}return p},set(s,c,d,p){var ee;var h=r.get(c),g=c in s;if(i&&c==="length")for(var y=d;y<h.v;y+=1){var T=r.get(y+"");T!==void 0?b(T,ue):y in s&&(T=u(()=>U(ue)),r.set(y+"",T))}h===void 0?(!g||(ee=Ke(s,c))!=null&&ee.writable)&&(h=u(()=>U(void 0)),b(h,u(()=>Ue(d))),r.set(c,h)):(g=h.v!==ue,b(h,u(()=>Ue(d))));var E=Reflect.getOwnPropertyDescriptor(s,c);if(E!=null&&E.set&&E.set.call(p,d),!g){if(i&&typeof c=="string"){var j=r.get("length"),_e=Number(c);Number.isInteger(_e)&&_e>=j.v&&b(j,_e+1)}yr(a)}return!0},ownKeys(s){l(a);var c=Reflect.ownKeys(s).filter(h=>{var g=r.get(h);return g===void 0||g.v!==ue});for(var[d,p]of r)p.v!==ue&&!(d in s)&&c.push(d);return c},setPrototypeOf(){bo()}})}function yr(e,t=1){b(e,e.v+t)}var un,fn,cn,dn;function Er(){if(un===void 0){un=window,fn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;cn=Ke(t,"firstChild").get,dn=Ke(t,"nextSibling").get,nn(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),nn(r)&&(r.__t=void 0)}}function Jt(e=""){return document.createTextNode(e)}function pe(e){return cn.call(e)}function je(e){return dn.call(e)}function Z(e,t){if(!F)return pe(e);var r=pe(M);return r===null&&(r=M.appendChild(Jt())),Ve(r),r}function kt(e,t){if(!F){var r=pe(e);return r instanceof Comment&&r.data===""?je(r):r}return M}function z(e,t=1,r=!1){let i=F?M:e;for(var a;t--;)a=i,i=je(i);if(!F)return i;var o=i==null?void 0:i.nodeType;if(r&&o!==3){var u=Jt();return i===null?a==null||a.after(u):i.before(u),Ve(u),u}return Ve(i),i}function Co(e){e.textContent=""}function hn(e){return e===this.v}function vn(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Cr(e){return!vn(e,this.v)}function Kt(e){var t=ye|Ie,r=N!==null&&(N.f&ye)!==0?N:null;return L===null||r!==null&&(r.f&ve)!==0?t|=ve:L.f|=ln,{ctx:oe,deps:null,effects:null,equals:hn,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:r??L}}function At(e){const t=Kt(e);return $n(t),t}function xo(e){const t=Kt(e);return t.equals=Cr,t}function gn(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)qe(t[r])}}function ko(e){for(var t=e.parent;t!==null;){if((t.f&ye)===0)return t;t=t.parent}return null}function _n(e){var t,r=L;Be(ko(e));try{gn(e),t=Ln(e)}finally{Be(r)}return t}function pn(e){var t=_n(e),r=(He||(e.f&ve)!==0)&&e.deps!==null?Qe:fe;Ee(e,r),e.equals(t)||(e.v=t,e.wv=Tn())}function Ao(e){L===null&&N===null&&vo(),N!==null&&(N.f&ve)!==0&&L===null&&ho(),$t&&co()}function Io(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function et(e,t,r,i=!0){var a=L,o={ctx:oe,deps:null,nodes_start:null,nodes_end:null,f:e|Ie,first:null,fn:t,last:null,next:null,parent:a,prev:null,teardown:null,transitions:null,wv:0};if(r)try{Tr(o),o.f|=so}catch(c){throw qe(o),c}else t!==null&&ir(o);var u=r&&o.deps===null&&o.first===null&&o.nodes_start===null&&o.teardown===null&&(o.f&(ln|Yt))===0;if(!u&&i&&(a!==null&&Io(o,a),N!==null&&(N.f&ye)!==0)){var s=N;(s.effects??(s.effects=[])).push(o)}return o}function xr(e){const t=et(Gt,null,!1);return Ee(t,fe),t.teardown=e,t}function kr(e){Ao();var t=L!==null&&(L.f&Pe)!==0&&oe!==null&&!oe.m;if(t){var r=oe;(r.e??(r.e=[])).push({fn:e,effect:L,reaction:N})}else{var i=Ar(e);return i}}function Ro(e){const t=et(Xe,e,!0);return()=>{qe(t)}}function $o(e){const t=et(Xe,e,!0);return(r={})=>new Promise(i=>{r.outro?$r(t,()=>{qe(t),i(void 0)}):(qe(t),i(void 0))})}function Ar(e){return et(an,e,!1)}function Ir(e){return et(Gt,e,!0)}function Re(e,t=[],r=Kt){const i=t.map(r);return mn(()=>e(...i.map(l)))}function mn(e,t=0){return et(Gt|mr|t,e,!0)}function Rr(e,t=!0){return et(Gt|Pe,e,!0,t)}function bn(e){var t=e.teardown;if(t!==null){const r=$t,i=N;Rn(!0),Se(null);try{t.call(null)}finally{Rn(r),Se(i)}}}function wn(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){var i=r.next;(r.f&Xe)!==0?r.parent=null:qe(r,t),r=i}}function So(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&Pe)===0&&qe(t),t=r}}function qe(e,t=!0){var r=!1;(t||(e.f&uo)!==0)&&e.nodes_start!==null&&(yn(e.nodes_start,e.nodes_end),r=!0),wn(e,t&&!r),nr(e,0),Ee(e,Zt);var i=e.transitions;if(i!==null)for(const o of i)o.stop();bn(e);var a=e.parent;a!==null&&a.first!==null&&En(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function yn(e,t){for(;e!==null;){var r=e===t?null:je(e);e.remove(),e=r}}function En(e){var t=e.parent,r=e.prev,i=e.next;r!==null&&(r.next=i),i!==null&&(i.prev=r),t!==null&&(t.first===e&&(t.first=i),t.last===e&&(t.last=r))}function $r(e,t){var r=[];Cn(e,r,!0),To(r,()=>{qe(e),t&&t()})}function To(e,t){var r=e.length;if(r>0){var i=()=>--r||t();for(var a of e)a.out(i)}else t()}function Cn(e,t,r){if((e.f&ft)===0){if(e.f^=ft,e.transitions!==null)for(const u of e.transitions)(u.is_global||r)&&t.push(u);for(var i=e.first;i!==null;){var a=i.next,o=(i.f&br)!==0||(i.f&Pe)!==0;Cn(i,t,o?r:!1),i=a}}}function xn(e){kn(e,!0)}function kn(e,t){if((e.f&ft)!==0){e.f^=ft,(e.f&fe)===0&&(e.f^=fe),Tt(e)&&(Ee(e,Ie),ir(e));for(var r=e.first;r!==null;){var i=r.next,a=(r.f&br)!==0||(r.f&Pe)!==0;kn(r,a?t:!1),r=i}if(e.transitions!==null)for(const o of e.transitions)(o.is_global||t)&&o.in()}}const Do=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let It=[],Rt=[];function An(){var e=It;It=[],on(e)}function In(){var e=Rt;Rt=[],on(e)}function Sr(e){It.length===0&&queueMicrotask(An),It.push(e)}function No(e){Rt.length===0&&Do(In),Rt.push(e)}function Lo(){It.length>0&&An(),Rt.length>0&&In()}let Xt=!1,Qt=!1,er=null,tt=!1,$t=!1;function Rn(e){$t=e}let St=[],Dl=[],N=null,$e=!1;function Se(e){N=e}let L=null;function Be(e){L=e}let ne=null;function $n(e){N!==null&&N.f&wr&&(ne===null?ne=[e]:ne.push(e))}let ie=null,ge=0,me=null;function Po(e){me=e}let Sn=1,tr=0,He=!1;function Tn(){return++Sn}function Tt(e){var h;var t=e.f;if((t&Ie)!==0)return!0;if((t&Qe)!==0){var r=e.deps,i=(t&ve)!==0;if(r!==null){var a,o,u=(t&Wt)!==0,s=i&&L!==null&&!He,c=r.length;if(u||s){var d=e,p=d.parent;for(a=0;a<c;a++)o=r[a],(u||!((h=o==null?void 0:o.reactions)!=null&&h.includes(d)))&&(o.reactions??(o.reactions=[])).push(d);u&&(d.f^=Wt),s&&p!==null&&(p.f&ve)===0&&(d.f^=ve)}for(a=0;a<c;a++)if(o=r[a],Tt(o)&&pn(o),o.wv>e.wv)return!0}(!i||L!==null&&!He)&&Ee(e,fe)}return!1}function Oo(e,t){for(var r=t;r!==null;){if((r.f&Yt)!==0)try{r.fn(e);return}catch{r.f^=Yt}r=r.parent}throw Xt=!1,e}function Dn(e){return(e.f&Zt)===0&&(e.parent===null||(e.parent.f&Yt)===0)}function rr(e,t,r,i){if(Xt){if(r===null&&(Xt=!1),Dn(t))throw e;return}if(r!==null&&(Xt=!0),Oo(e,t),Dn(t))throw e}function Nn(e,t,r=!0){var i=e.reactions;if(i!==null)for(var a=0;a<i.length;a++){var o=i[a];ne!=null&&ne.includes(e)||((o.f&ye)!==0?Nn(o,t,!1):t===o&&(r?Ee(o,Ie):(o.f&fe)!==0&&Ee(o,Qe),ir(o)))}}function Ln(e){var y;var t=ie,r=ge,i=me,a=N,o=He,u=ne,s=oe,c=$e,d=e.f;ie=null,ge=0,me=null,He=(d&ve)!==0&&($e||!tt||N===null),N=(d&(Pe|Xe))===0?e:null,ne=null,Mn(e.ctx),$e=!1,tr++,e.f|=wr;try{var p=(0,e.fn)(),h=e.deps;if(ie!==null){var g;if(nr(e,ge),h!==null&&ge>0)for(h.length=ge+ie.length,g=0;g<ie.length;g++)h[ge+g]=ie[g];else e.deps=h=ie;if(!He)for(g=ge;g<h.length;g++)((y=h[g]).reactions??(y.reactions=[])).push(e)}else h!==null&&ge<h.length&&(nr(e,ge),h.length=ge);if(jn()&&me!==null&&!$e&&h!==null&&(e.f&(ye|Qe|Ie))===0)for(g=0;g<me.length;g++)Nn(me[g],e);return a!==null&&a!==e&&(tr++,me!==null&&(i===null?i=me:i.push(...me))),p}finally{ie=t,ge=r,me=i,N=a,He=o,ne=u,Mn(s),$e=c,e.f^=wr}}function Fo(e,t){let r=t.reactions;if(r!==null){var i=ro.call(r,e);if(i!==-1){var a=r.length-1;a===0?r=t.reactions=null:(r[i]=r[a],r.pop())}}r===null&&(t.f&ye)!==0&&(ie===null||!ie.includes(t))&&(Ee(t,Qe),(t.f&(ve|Wt))===0&&(t.f^=Wt),gn(t),nr(t,0))}function nr(e,t){var r=e.deps;if(r!==null)for(var i=t;i<r.length;i++)Fo(e,r[i])}function Tr(e){var t=e.f;if((t&Zt)===0){Ee(e,fe);var r=L,i=oe,a=tt;L=e,tt=!0;try{(t&mr)!==0?So(e):wn(e),bn(e);var o=Ln(e);e.teardown=typeof o=="function"?o:null,e.wv=Sn;var u=e.deps,s;Qr&&Eo&&e.f&Ie}catch(c){rr(c,e,r,i||e.ctx)}finally{tt=a,L=r}}}function Mo(){try{go()}catch(e){if(er!==null)rr(e,er,null);else throw e}}function Pn(){var e=tt;try{var t=0;for(tt=!0;St.length>0;){t++>1e3&&Mo();var r=St,i=r.length;St=[];for(var a=0;a<i;a++){var o=Uo(r[a]);Vo(o)}Dt.clear()}}finally{Qt=!1,tt=e,er=null}}function Vo(e){var t=e.length;if(t!==0)for(var r=0;r<t;r++){var i=e[r];if((i.f&(Zt|ft))===0)try{Tt(i)&&(Tr(i),i.deps===null&&i.first===null&&i.nodes_start===null&&(i.teardown===null?En(i):i.fn=null))}catch(a){rr(a,i,null,i.ctx)}}}function ir(e){Qt||(Qt=!0,queueMicrotask(Pn));for(var t=er=e;t.parent!==null;){t=t.parent;var r=t.f;if((r&(Xe|Pe))!==0){if((r&fe)===0)return;t.f^=fe}}St.push(t)}function Uo(e){for(var t=[],r=e;r!==null;){var i=r.f,a=(i&(Pe|Xe))!==0,o=a&&(i&fe)!==0;if(!o&&(i&ft)===0){if((i&an)!==0)t.push(r);else if(a)r.f^=fe;else try{Tt(r)&&Tr(r)}catch(c){rr(c,r,null,r.ctx)}var u=r.first;if(u!==null){r=u;continue}}var s=r.parent;for(r=r.next;r===null&&s!==null;)r=s.next,s=s.parent}return t}function k(e){for(var t;;){if(Lo(),St.length===0)return t;Qt=!0,Pn()}}async function Dr(){await Promise.resolve(),k()}function l(e){var t=e.f,r=(t&ye)!==0;if(N!==null&&!$e){if(!(ne!=null&&ne.includes(e))){var i=N.deps;e.rv<tr&&(e.rv=tr,ie===null&&i!==null&&i[ge]===e?ge++:ie===null?ie=[e]:(!He||!ie.includes(e))&&ie.push(e))}}else if(r&&e.deps===null&&e.effects===null){var a=e,o=a.parent;o!==null&&(o.f&ve)===0&&(a.f^=ve)}return r&&(a=e,Tt(a)&&pn(a)),$t&&Dt.has(e)?Dt.get(e):e.v}function rt(e){var t=$e;try{return $e=!0,e()}finally{$e=t}}const jo=-7169;function Ee(e,t){e.f=e.f&jo|t}const Dt=new Map;function On(e,t){var r={f:0,v:e,reactions:null,equals:hn,rv:0,wv:0};return r}function U(e,t){const r=On(e);return $n(r),r}function Nr(e,t=!1){const r=On(e);return t||(r.equals=Cr),r}function b(e,t,r=!1){N!==null&&!$e&&jn()&&(N.f&(ye|mr))!==0&&!(ne!=null&&ne.includes(e))&&wo();let i=r?Ue(t):t;return qo(e,i)}function qo(e,t){if(!e.equals(t)){var r=e.v;$t?Dt.set(e,t):Dt.set(e,r),e.v=t,(e.f&ye)!==0&&((e.f&Ie)!==0&&_n(e),Ee(e,(e.f&ve)===0?fe:Qe)),e.wv=Tn(),Fn(e,Ie),L!==null&&(L.f&fe)!==0&&(L.f&(Pe|Xe))===0&&(me===null?Po([e]):me.push(e))}return t}function Fn(e,t){var r=e.reactions;if(r!==null)for(var i=r.length,a=0;a<i;a++){var o=r[a],u=o.f;(u&Ie)===0&&(Ee(o,t),(u&(fe|ve))!==0&&((u&ye)!==0?Fn(o,Qe):ir(o)))}}let oe=null;function Mn(e){oe=e}function Vn(e,t=!1,r){var i=oe={p:oe,c:null,d:!1,e:null,m:!1,s:e,x:null,l:null};xr(()=>{i.d=!0})}function Un(e){const t=oe;if(t!==null){e!==void 0&&(t.x=e);const u=t.e;if(u!==null){var r=L,i=N;t.e=null;try{for(var a=0;a<u.length;a++){var o=u[a];Be(o.effect),Se(o.reaction),Ar(o.fn)}}finally{Be(r),Se(i)}}oe=t.p,t.m=!0}return e||{}}function jn(){return!0}const Bo=["touchstart","touchmove"];function Ho(e){return Bo.includes(e)}function Go(e,t){if(t){const r=document.body;e.autofocus=!0,Sr(()=>{document.activeElement===r&&e.focus()})}}let qn=!1;function Bn(){qn||(qn=!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 Hn(e){var t=N,r=L;Se(null),Be(null);try{return e()}finally{Se(t),Be(r)}}function Yo(e,t,r,i=r){e.addEventListener(t,()=>Hn(r));const a=e.__on_r;a?e.__on_r=()=>{a(),i(!0)}:e.__on_r=()=>i(!0),Bn()}const Gn=new Set,Lr=new Set;function Wo(e,t,r,i={}){function a(o){if(i.capture||Nt.call(t,o),!o.cancelBubble)return Hn(()=>r==null?void 0:r.call(this,o))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Sr(()=>{t.addEventListener(e,a,i)}):t.addEventListener(e,a,i),a}function Ge(e,t,r,i,a){var o={capture:i,passive:a},u=Wo(e,t,r,o);(t===document.body||t===window||t===document)&&xr(()=>{t.removeEventListener(e,u,o)})}function Zo(e){for(var t=0;t<e.length;t++)Gn.add(e[t]);for(var r of Lr)r(e)}function Nt(e){var ee;var t=this,r=t.ownerDocument,i=e.type,a=((ee=e.composedPath)==null?void 0:ee.call(e))||[],o=a[0]||e.target,u=0,s=e.__root;if(s){var c=a.indexOf(s);if(c!==-1&&(t===document||t===window)){e.__root=t;return}var d=a.indexOf(t);if(d===-1)return;c<=d&&(u=c)}if(o=a[u]||e.target,o!==t){Ct(e,"currentTarget",{configurable:!0,get(){return o||r}});var p=N,h=L;Se(null),Be(null);try{for(var g,y=[];o!==null;){var T=o.assignedSlot||o.parentNode||o.host||null;try{var E=o["__"+i];if(E!=null&&(!o.disabled||e.target===o))if(tn(E)){var[j,..._e]=E;j.apply(o,[e,..._e])}else E.call(o,e)}catch(ae){g?y.push(ae):g=ae}if(e.cancelBubble||T===t||T===null)break;o=T}if(g){for(let ae of y)queueMicrotask(()=>{throw ae});throw g}}finally{e.__root=t,delete e.currentTarget,Se(p),Be(h)}}}function Pr(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function Te(e,t){var r=L;r.nodes_start===null&&(r.nodes_start=e,r.nodes_end=t)}function Ce(e,t){var r=(t&Qi)!==0,i=(t&eo)!==0,a,o=!e.startsWith("<!>");return()=>{if(F)return Te(M,null),M;a===void 0&&(a=Pr(o?e:"<!>"+e),r||(a=pe(a)));var u=i||fn?document.importNode(a,!0):a.cloneNode(!0);if(r){var s=pe(u),c=u.lastChild;Te(s,c)}else Te(u,u);return u}}function or(e,t,r="svg"){var i=!e.startsWith("<!>"),a=`<${r}>${i?e:"<!>"+e}</${r}>`,o;return()=>{if(F)return Te(M,null),M;if(!o){var u=Pr(a),s=pe(u);o=pe(s)}var c=o.cloneNode(!0);return Te(c,c),c}}function ar(){if(F)return Te(M,null),M;var e=document.createDocumentFragment(),t=document.createComment(""),r=Jt();return e.append(t,r),Te(t,r),e}function q(e,t){if(F){L.nodes_end=M,dt();return}e!==null&&e.before(t)}function zo(e,t){var r=t==null?"":typeof t=="object"?t+"":t;r!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=r,e.nodeValue=r+"")}function Yn(e,t){return Wn(e,t)}function Jo(e,t){Er(),t.intro=t.intro??!1;const r=t.target,i=F,a=M;try{for(var o=pe(r);o&&(o.nodeType!==8||o.data!==pr);)o=je(o);if(!o)throw st;ct(!0),Ve(o),dt();const u=Wn(e,{...t,anchor:o});if(M===null||M.nodeType!==8||M.data!==Xr)throw zt(),st;return ct(!1),u}catch(u){if(u===st)return t.recover===!1&&_o(),Er(),Co(r),ct(!1),Yn(e,t);throw u}finally{ct(i),Ve(a)}}const ht=new Map;function Wn(e,{target:t,anchor:r,props:i={},events:a,context:o,intro:u=!0}){Er();var s=new Set,c=h=>{for(var g=0;g<h.length;g++){var y=h[g];if(!s.has(y)){s.add(y);var T=Ho(y);t.addEventListener(y,Nt,{passive:T});var E=ht.get(y);E===void 0?(document.addEventListener(y,Nt,{passive:T}),ht.set(y,1)):ht.set(y,E+1)}}};c(no(Gn)),Lr.add(c);var d=void 0,p=$o(()=>{var h=r??t.appendChild(Jt());return Rr(()=>{if(o){Vn({});var g=oe;g.c=o}a&&(i.$$events=a),F&&Te(h,null),d=e(h,i)||{},F&&(L.nodes_end=M),o&&Un()}),()=>{var T;for(var g of s){t.removeEventListener(g,Nt);var y=ht.get(g);--y===0?(document.removeEventListener(g,Nt),ht.delete(g)):ht.set(g,y)}Lr.delete(c),h!==r&&((T=h.parentNode)==null||T.removeChild(h))}});return Or.set(d,p),d}let Or=new WeakMap;function Ko(e,t){const r=Or.get(e);return r?(Or.delete(e),r(t)):Promise.resolve()}function J(e,t,[r,i]=[0,0]){F&&r===0&&dt();var a=e,o=null,u=null,s=ue,c=r>0?br:0,d=!1;const p=(g,y=!0)=>{d=!0,h(y,g)},h=(g,y)=>{if(s===(s=g))return;let T=!1;if(F&&i!==-1){if(r===0){const j=a.data;j===pr?i=0:j===Kr?i=1/0:(i=parseInt(j.substring(1)),i!==i&&(i=s?1/0:-1))}const E=i>r;!!s===E&&(a=yo(),Ve(a),ct(!1),T=!0,i=-1)}s?(o?xn(o):y&&(o=Rr(()=>y(a))),u&&$r(u,()=>{u=null})):(u?xn(u):y&&(u=Rr(()=>y(a,[r+1,i]))),o&&$r(o,()=>{o=null})),T&&ct(!0)};mn(()=>{d=!1,t(p),d||h(null,null)},c),F&&(a=M)}function nt(e,t,r=!1,i=!1,a=!1){var o=e,u="";Re(()=>{var s=L;if(u===(u=t()??"")){F&&dt();return}if(s.nodes_start!==null&&(yn(s.nodes_start,s.nodes_end),s.nodes_start=s.nodes_end=null),u!==""){if(F){M.data;for(var c=dt(),d=c;c!==null&&(c.nodeType!==8||c.data!=="");)d=c,c=je(c);if(c===null)throw zt(),st;Te(M,d),o=Ve(c);return}var p=u+"";r?p=`<svg>${p}</svg>`:i&&(p=`<math>${p}</math>`);var h=Pr(p);if((r||i)&&(h=pe(h)),Te(pe(h),h.lastChild),r||i)for(;pe(h);)o.before(pe(h));else o.before(h)}})}function Xo(e,t,r,i,a){var s;F&&dt();var o=(s=t.$$slots)==null?void 0:s[r],u=!1;o===!0&&(o=t.children,u=!0),o===void 0||o(e,u?()=>i:i)}const Zn=[...`
|
|
3
|
+
\r\f \v\uFEFF`];function Qo(e,t,r){var i=""+e;if(r){for(var a in r)if(r[a])i=i?i+" "+a:a;else if(i.length)for(var o=a.length,u=0;(u=i.indexOf(a,u))>=0;){var s=u+o;(u===0||Zn.includes(i[u-1]))&&(s===i.length||Zn.includes(i[s]))?i=(u===0?"":i.substring(0,u))+i.substring(s+1):u=s}}return i===""?null:i}function ea(e,t,r,i,a,o){var u=e.__className;if(F||u!==r||u===void 0){var s=Qo(r,i,o);(!F||s!==e.getAttribute("class"))&&(s==null?e.removeAttribute("class"):e.className=s),e.__className=r}else if(o&&a!==o)for(var c in o){var d=!!o[c];(a==null||d!==!!a[c])&&e.classList.toggle(c,d)}return o}const ta=Symbol("is custom element"),ra=Symbol("is html");function zn(e){if(F){var t=!1,r=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var i=e.value;P(e,"value",null),e.value=i}if(e.hasAttribute("checked")){var a=e.checked;P(e,"checked",null),e.checked=a}}};e.__on_r=r,No(r),Bn()}}function na(e,t){var r=Jn(e);r.value===(r.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function P(e,t,r,i){var a=Jn(e);F&&(a[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||a[t]!==(a[t]=r)&&(t==="loading"&&(e[fo]=r),r==null?e.removeAttribute(t):typeof r!="string"&&ia(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function Jn(e){return e.__attributes??(e.__attributes={[ta]:e.nodeName.includes("-"),[ra]:e.namespaceURI===to})}var Kn=new Map;function ia(e){var t=Kn.get(e.nodeName);if(t)return t;Kn.set(e.nodeName,t=[]);for(var r,i=e,a=Element.prototype;a!==i;){r=io(i);for(var o in r)r[o].set&&t.push(o);i=rn(i)}return t}function oa(e,t,r=t){Yo(e,"change",i=>{var a=i?e.defaultChecked:e.checked;r(a)}),(F&&e.defaultChecked!==e.checked||rt(t)==null)&&r(e.checked),Ir(()=>{var i=t();e.checked=!!i})}function Xn(e,t){return e===t||(e==null?void 0:e[xt])===t}function lr(e={},t,r,i){return Ar(()=>{var a,o;return Ir(()=>{a=o,o=[],rt(()=>{e!==r(...o)&&(t(e,...o),a&&Xn(r(...a),e)&&t(null,...a))})}),()=>{Sr(()=>{o&&Xn(r(...o),e)&&t(null,...o)})}}),e}function Qn(e){oe===null&&en(),kr(()=>{const t=rt(e);if(typeof t=="function")return t})}function aa(e){oe===null&&en(),Qn(()=>()=>rt(e))}function ei(e,t,r){if(e==null)return t(void 0),ut;const i=rt(()=>e.subscribe(t,r));return i.unsubscribe?()=>i.unsubscribe():i}const vt=[];function la(e,t=ut){let r=null;const i=new Set;function a(s){if(vn(e,s)&&(e=s,r)){const c=!vt.length;for(const d of i)d[1](),vt.push(d,e);if(c){for(let d=0;d<vt.length;d+=2)vt[d][0](vt[d+1]);vt.length=0}}}function o(s){a(s(e))}function u(s,c=ut){const d=[s,c];return i.add(d),i.size===1&&(r=t(a,o)||ut),s(e),()=>{i.delete(d),i.size===0&&r&&(r(),r=null)}}return{set:a,update:o,subscribe:u}}function sr(e){let t;return ei(e,r=>t=r)(),t}let ur=!1,Fr=Symbol();function sa(e,t,r){const i=r[t]??(r[t]={store:null,source:Nr(void 0),unsubscribe:ut});if(i.store!==e&&!(Fr in r))if(i.unsubscribe(),i.store=e??null,e==null)i.source.v=void 0,i.unsubscribe=ut;else{var a=!0;i.unsubscribe=ei(e,o=>{a?i.source.v=o:b(i.source,o)}),a=!1}return e&&Fr in r?sr(e):l(i.source)}function ua(){const e={};function t(){xr(()=>{for(var r in e)e[r].unsubscribe();Ct(e,Fr,{enumerable:!1,value:!0})})}return[e,t]}function fa(e){var t=ur;try{return ur=!1,[e(),ur]}finally{ur=t}}function ti(e){var t;return((t=e.ctx)==null?void 0:t.d)??!1}function I(e,t,r,i){var gt;var a=(r&zi)!==0,o=!0,u=(r&Ki)!==0,s=(r&Xi)!==0,c=!1,d;u?[d,c]=fa(()=>e[t]):d=e[t];var p=xt in e||sn in e,h=u&&(((gt=Ke(e,t))==null?void 0:gt.set)??(p&&t in e&&(B=>e[t]=B)))||void 0,g=i,y=!0,T=!1,E=()=>(T=!0,y&&(y=!1,s?g=rt(i):g=i),g);d===void 0&&i!==void 0&&(h&&o&&po(),d=E(),h&&h(d));var j;if(j=()=>{var B=e[t];return B===void 0?E():(y=!0,T=!1,B)},(r&Ji)===0)return j;if(h){var _e=e.$$legacy;return function(B,ce){return arguments.length>0?((!ce||_e||c)&&h(ce?j():B),B):j()}}var ee=!1,ae=Nr(d),te=Kt(()=>{var B=j(),ce=l(ae);return ee?(ee=!1,ce):ae.v=B});return u&&l(te),a||(te.equals=Cr),function(B,ce){if(arguments.length>0){const xe=ce?l(te):u?Ue(B):B;if(!te.equals(xe)){if(ee=!0,b(ae,xe),T&&g!==void 0&&(g=xe),ti(te))return B;rt(()=>l(te))}return B}return ti(te)?te.v:l(te)}}function ca(e){return new da(e)}class da{constructor(t){zr(this,Oe);zr(this,be);var o;var r=new Map,i=(u,s)=>{var c=Nr(s);return r.set(u,c),c};const a=new Proxy({...t.props||{},$$events:{}},{get(u,s){return l(r.get(s)??i(s,Reflect.get(u,s)))},has(u,s){return s===sn?!0:(l(r.get(s)??i(s,Reflect.get(u,s))),Reflect.has(u,s))},set(u,s,c){return b(r.get(s)??i(s,c),c),Reflect.set(u,s,c)}});Jr(this,be,(t.hydrate?Jo:Yn)(t.component,{target:t.target,anchor:t.anchor,props:a,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((o=t==null?void 0:t.props)!=null&&o.$$host)||t.sync===!1)&&k(),Jr(this,Oe,a.$$events);for(const u of Object.keys(he(this,be)))u==="$set"||u==="$destroy"||u==="$on"||Ct(this,u,{get(){return he(this,be)[u]},set(s){he(this,be)[u]=s},enumerable:!0});he(this,be).$set=u=>{Object.assign(a,u)},he(this,be).$destroy=()=>{Ko(he(this,be))}}$set(t){he(this,be).$set(t)}$on(t,r){he(this,Oe)[t]=he(this,Oe)[t]||[];const i=(...a)=>r.call(this,...a);return he(this,Oe)[t].push(i),()=>{he(this,Oe)[t]=he(this,Oe)[t].filter(a=>a!==i)}}$destroy(){he(this,be).$destroy()}}Oe=new WeakMap,be=new WeakMap;let ri;typeof HTMLElement=="function"&&(ri=class extends HTMLElement{constructor(t,r,i){super();Ae(this,"$$ctor");Ae(this,"$$s");Ae(this,"$$c");Ae(this,"$$cn",!1);Ae(this,"$$d",{});Ae(this,"$$r",!1);Ae(this,"$$p_d",{});Ae(this,"$$l",{});Ae(this,"$$l_u",new Map);Ae(this,"$$me");this.$$ctor=t,this.$$s=r,i&&this.attachShadow({mode:"open"})}addEventListener(t,r,i){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(r),this.$$c){const a=this.$$c.$on(t,r);this.$$l_u.set(r,a)}super.addEventListener(t,r,i)}removeEventListener(t,r,i){if(super.removeEventListener(t,r,i),this.$$c){const a=this.$$l_u.get(r);a&&(a(),this.$$l_u.delete(r))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(a){return o=>{const u=document.createElement("slot");a!=="default"&&(u.name=a),q(o,u)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const r={},i=ha(this);for(const a of this.$$s)a in i&&(a==="default"&&!this.$$d.children?(this.$$d.children=t(a),r.default=!0):r[a]=t(a));for(const a of this.attributes){const o=this.$$g_p(a.name);o in this.$$d||(this.$$d[o]=fr(o,a.value,this.$$p_d,"toProp"))}for(const a in this.$$p_d)!(a in this.$$d)&&this[a]!==void 0&&(this.$$d[a]=this[a],delete this[a]);this.$$c=ca({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:r,$$host:this}}),this.$$me=Ro(()=>{Ir(()=>{var a;this.$$r=!0;for(const o of Ht(this.$$c)){if(!((a=this.$$p_d[o])!=null&&a.reflect))continue;this.$$d[o]=this.$$c[o];const u=fr(o,this.$$d[o],this.$$p_d,"toAttribute");u==null?this.removeAttribute(this.$$p_d[o].attribute||o):this.setAttribute(this.$$p_d[o].attribute||o,u)}this.$$r=!1})});for(const a in this.$$l)for(const o of this.$$l[a]){const u=this.$$c.$on(a,o);this.$$l_u.set(o,u)}this.$$l={}}}attributeChangedCallback(t,r,i){var a;this.$$r||(t=this.$$g_p(t),this.$$d[t]=fr(t,i,this.$$p_d,"toProp"),(a=this.$$c)==null||a.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return Ht(this.$$p_d).find(r=>this.$$p_d[r].attribute===t||!this.$$p_d[r].attribute&&r.toLowerCase()===t)||t}});function fr(e,t,r,i){var o;const a=(o=r[e])==null?void 0:o.type;if(t=a==="Boolean"&&typeof t!="boolean"?t!=null:t,!i||!r[e])return t;if(i==="toAttribute")switch(a){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(a){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function ha(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function va(e,t,r,i,a,o){let u=class extends ri{constructor(){super(e,r,a),this.$$p_d=t}static get observedAttributes(){return Ht(t).map(s=>(t[s].attribute||s).toLowerCase())}};return Ht(t).forEach(s=>{Ct(u.prototype,s,{get(){return this.$$c&&s in this.$$c?this.$$c[s]:this.$$d[s]},set(c){var h;c=fr(s,c,t),this.$$d[s]=c;var d=this.$$c;if(d){var p=(h=Ke(d,s))==null?void 0:h.get;p?d[s]=c:d.$set({[s]:c})}}})}),i.forEach(s=>{Ct(u.prototype,s,{get(){var c;return(c=this.$$c)==null?void 0:c[s]}})}),e.element=u,u}const ni=new TextEncoder;function ga(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function _a(e,t="SHA-256",r=1e5){const i=Date.now().toString(16);e||(e=Math.round(Math.random()*r));const a=await ii(i,e,t);return{algorithm:t,challenge:a,salt:i,signature:""}}async function ii(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 ga(await crypto.subtle.digest(r.toUpperCase(),ni.encode(e+t)))}function pa(e,t,r="SHA-256",i=1e6,a=0){const o=new AbortController,u=Date.now();return{promise:(async()=>{for(let c=a;c<=i;c+=1){if(o.signal.aborted)return null;if(await ii(t,c,r)===e)return{number:c,took:Date.now()-u}}return null})(),controller:o}}function oi(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function ma(e){const t=atob(e),r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return r}function ba(e,t=12){const r=new Uint8Array(t);for(let i=0;i<t;i++)r[i]=e%256,e=Math.floor(e/256);return r}async function wa(e,t="",r=1e6,i=0){const a="AES-GCM",o=new AbortController,u=Date.now(),s=async()=>{for(let p=i;p<=r;p+=1){if(o.signal.aborted||!c||!d)return null;try{const h=await crypto.subtle.decrypt({name:a,iv:ba(p)},c,d);if(h)return{clearText:new TextDecoder().decode(h),took:Date.now()-u}}catch{}}return null};let c=null,d=null;try{d=ma(e);const p=await crypto.subtle.digest("SHA-256",ni.encode(t));c=await crypto.subtle.importKey("raw",p,a,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:o}}return{promise:s(),controller:o}}var C=(e=>(e.CODE="code",e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(C||{}),Q=(e=>(e.ERROR="error",e.LOADING="loading",e.PLAYING="playing",e.PAUSED="paused",e.READY="ready",e))(Q||{});globalThis.altchaPlugins=globalThis.altchaPlugins||[],globalThis.altchaI18n=globalThis.altchaI18n||{get:e=>sr(globalThis.altchaI18n.store)[e],set:(e,t)=>{Object.assign(sr(globalThis.altchaI18n.store),{[e]:t}),globalThis.altchaI18n.store.set(sr(globalThis.altchaI18n.store))},store:la({})};const ya={ariaLinkLabel:"Visit Altcha.org",enterCode:"Enter code",enterCodeAria:"Enter code you hear. Press Space to play audio.",error:"Verification failed. Try again later.",expired:"Verification expired. Try again.",footer:'Protected by <a href="https://altcha.org/" target="_blank" aria-label="Visit Altcha.org">ALTCHA</a>',getAudioChallenge:"Get an audio challenge",label:"I'm not a robot",loading:"Loading...",reload:"Reload",verify:"Verify",verificationRequired:"Verification required!",verified:"Verified",verifying:"Verifying...",waitAlert:"Verifying... please wait."};globalThis.altchaI18n.set("en",ya);const Mr=(e,t)=>{let r=xo(()=>lo(t==null?void 0:t(),24));var i=ka();Re(()=>{P(i,"width",l(r)),P(i,"height",l(r))}),q(e,i)};function Ea(e,t){e.code==="Space"&&(e.preventDefault(),e.stopImmediatePropagation(),t())}function Ca(e,t){e.preventDefault(),t()}function xa(e,t,r,i,a,o,u,s){var c;[C.UNVERIFIED,C.ERROR,C.EXPIRED,C.CODE].includes(l(t))?r()!==!1&&((c=l(i))==null?void 0:c.reportValidity())===!1?b(a,!1):o()?u():s():b(a,!0)}var ka=or('<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="altcha-spinner"><path d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" fill="currentColor" opacity=".25"></path><path d="M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z" fill="currentColor"></path></svg>'),Aa=Ce('<input type="hidden">'),Ia=Ce('<div><a target="_blank" class="altcha-logo" aria-hidden="true"><svg width="22" height="22" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.33955 16.4279C5.88954 20.6586 12.1971 21.2105 16.4279 17.6604C18.4699 15.947 19.6548 13.5911 19.9352 11.1365L17.9886 10.4279C17.8738 12.5624 16.909 14.6459 15.1423 16.1284C11.7577 18.9684 6.71167 18.5269 3.87164 15.1423C1.03163 11.7577 1.4731 6.71166 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577C16.9767 5.86872 17.5322 7.02798 17.804 8.2324L19.9522 9.01429C19.7622 7.07737 19.0059 5.17558 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956C-0.658625 5.88958 -1.21046 12.1971 2.33955 16.4279Z" fill="currentColor"></path><path d="M3.57212 2.33956C1.65755 3.94607 0.496389 6.11731 0.12782 8.40523L2.04639 9.13961C2.26047 7.15832 3.21057 5.25375 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577L13.8302 6.78606L19.9633 9.13364C19.7929 7.15555 19.0335 5.20847 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956Z" fill="currentColor"></path><path d="M7 10H5C5 12.7614 7.23858 15 10 15C12.7614 15 15 12.7614 15 10H13C13 11.6569 11.6569 13 10 13C8.3431 13 7 11.6569 7 10Z" fill="currentColor"></path></svg></a></div>'),Ra=or('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12.8659 3.00017L22.3922 19.5002C22.6684 19.9785 22.5045 20.5901 22.0262 20.8662C21.8742 20.954 21.7017 21.0002 21.5262 21.0002H2.47363C1.92135 21.0002 1.47363 20.5525 1.47363 20.0002C1.47363 19.8246 1.51984 19.6522 1.60761 19.5002L11.1339 3.00017C11.41 2.52187 12.0216 2.358 12.4999 2.63414C12.6519 2.72191 12.7782 2.84815 12.8659 3.00017ZM10.9999 16.0002V18.0002H12.9999V16.0002H10.9999ZM10.9999 9.00017V14.0002H12.9999V9.00017H10.9999Z"></path></svg>'),$a=or('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M15 7C15 6.44772 15.4477 6 16 6C16.5523 6 17 6.44772 17 7V17C17 17.5523 16.5523 18 16 18C15.4477 18 15 17.5523 15 17V7ZM7 7C7 6.44772 7.44772 6 8 6C8.55228 6 9 6.44772 9 7V17C9 17.5523 8.55228 18 8 18C7.44772 18 7 17.5523 7 17V7Z"></path></svg>'),Sa=or('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 12H7C8.10457 12 9 12.8954 9 14V19C9 20.1046 8.10457 21 7 21H4C2.89543 21 2 20.1046 2 19V12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12V19C22 20.1046 21.1046 21 20 21H17C15.8954 21 15 20.1046 15 19V14C15 12.8954 15.8954 12 17 12H20C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12Z"></path></svg>'),Ta=Ce('<button type="button" class="altcha-code-challenge-audio"><!></button>'),Da=Ce("<audio hidden autoplay><source></audio>"),Na=Ce('<div class="altcha-code-challenge" role="dialog"><div class="altcha-code-challenge-arrow"></div> <form data-code-challenge-form="1"><img class="altcha-code-challenge-image" alt=""> <input type="text" autocomplete="off" name="code" class="altcha-code-challenge-input" required> <div class="altcha-code-challenge-buttons"><div class="altcha-code-challenge-buttons-left"><!> <button type="button" class="altcha-code-challenge-reload"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2V4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 9.25022 5.38734 6.82447 7.50024 5.38451L7.5 8H9.5V2L3.5 2V4L5.99918 3.99989C3.57075 5.82434 2 8.72873 2 12Z"></path></svg></button></div> <button type="submit" class="altcha-code-challenge-verify"><!> </button></div> <!></form></div>'),La=Ce("<div><!></div>"),Pa=Ce("<div><!></div>"),Oa=Ce('<div class="altcha-error"><svg width="14" height="14" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path></svg> <!></div>'),Fa=Ce('<div class="altcha-footer"><div><!></div></div>'),Ma=Ce('<div class="altcha-anchor-arrow"></div>'),Va=Ce('<!> <div class="altcha"><div class="altcha-main"><div><!> <input type="checkbox"></div> <label class="altcha-label"><!></label> <!> <!> <!></div> <!> <!> <!></div>',1);function ai(e,t){var Hi,Gi;Vn(t,!0);const[r,i]=ua(),a=()=>sa(ja,"$altchaI18nStore",r);let o=I(t,"auto",7,void 0),u=I(t,"blockspam",7,void 0),s=I(t,"challengeurl",7,void 0),c=I(t,"challengejson",7,void 0),d=I(t,"credentials",7,void 0),p=I(t,"customfetch",7,void 0),h=I(t,"debug",7,!1),g=I(t,"delay",7,0),y=I(t,"disableautofocus",7,!1),T=I(t,"expire",7,void 0),E=I(t,"floating",7,void 0),j=I(t,"floatinganchor",7,void 0),_e=I(t,"floatingoffset",7,void 0),ee=I(t,"floatingpersist",7,!1),ae=I(t,"hidefooter",7,!1),te=I(t,"hidelogo",7,!1),gt=I(t,"id",7,void 0),B=I(t,"language",7,void 0),ce=I(t,"name",7,"altcha"),xe=I(t,"maxnumber",7,1e6),Lt=I(t,"mockerror",7,!1),Ye=I(t,"obfuscated",7,void 0),cr=I(t,"plugins",7,void 0),Pt=I(t,"refetchonexpire",7,!0),it=I(t,"sentinel",7,void 0),De=I(t,"spamfilter",7,!1),_t=I(t,"strings",7,void 0),we=I(t,"test",7,!1),le=I(t,"verifyurl",7,void 0),pt=I(t,"workers",23,()=>Math.min(16,navigator.hardwareConcurrency||8)),Ot=I(t,"workerurl",7,void 0);const{altchaI18n:Ua}=globalThis,ja=Ua.store,fi=["SHA-256","SHA-384","SHA-512"],qa="https://altcha.org/",We=(n,f)=>{t.$$host.dispatchEvent(new CustomEvent(n,{detail:f}))},ci=(Gi=(Hi=document.documentElement.lang)==null?void 0:Hi.split("-"))==null?void 0:Gi[0],Vr=At(()=>{var n;return s()&&new URL(s(),location.origin).host.endsWith(".altcha.org")&&!!((n=s())!=null&&n.includes("apiKey=ckey_"))}),Ur=At(()=>c()?Ai(c()):void 0),Ba=At(()=>_t()?Ai(_t()):{}),V=At(()=>({...gi(a()),...l(Ba)})),di=At(()=>`${gt()||ce()}_checkbox_${Math.round(Math.random()*1e8)}`);let Ft=U(!1),Y=U(null),R=U(Ue(C.UNVERIFIED)),se=U(void 0),Mt=U(null),Ze=U(null),jr=U(null),mt=U(null),O=U(null),ot=U(null),Ne=null,K=U(null),at=U(!1),ze=[],qr=U(!1),Fe=U(null);kr(()=>{rl(l(ot))}),kr(()=>{nl(l(R))}),aa(()=>{Ha(),l(O)&&(l(O).removeEventListener("submit",yi),l(O).removeEventListener("reset",Ei),l(O).removeEventListener("focusin",wi),b(O,null)),Ne&&(clearTimeout(Ne),Ne=null),document.removeEventListener("click",mi),document.removeEventListener("scroll",bi),window.removeEventListener("resize",ki)}),Qn(()=>{var n;$("mounted","2.0.0"),$("workers",pt()),Za(),$("plugins",ze.length?ze.map(f=>f.constructor.pluginName).join(", "):"none"),we()&&$("using test mode"),T()&&Br(T()),o()!==void 0&&$("auto",o()),E()!==void 0&&Ri(E()),b(O,(n=l(se))==null?void 0:n.closest("form"),!0),l(O)&&(l(O).addEventListener("submit",yi,{capture:!0}),l(O).addEventListener("reset",Ei),(o()==="onfocus"||ee()==="focus")&&l(O).addEventListener("focusin",wi)),o()==="onload"&&(Ye()?Vt():Me()),l(Vr)&&(ae()||te())&&$("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{We("load")})});function dr(n,f){return btoa(JSON.stringify({algorithm:n.algorithm,challenge:n.challenge,number:f.number,salt:n.salt,signature:n.signature,test:we()?!0:void 0,took:f.took}))}function Ha(){for(const n of ze)n.destroy()}function hi(){s()&&Pt()&&l(R)===C.VERIFIED?Me():bt(C.EXPIRED,l(V).expired)}async function Ga(){var n;if(Lt())throw $("mocking error"),new Error("Mocked error.");if(l(Ur))return $("using provided json data"),l(Ur);if(we())return $("generating test challenge",{test:we()}),_a(typeof we()!="boolean"?+we():void 0);{if(!s()&&l(O)){const A=l(O).getAttribute("action");A!=null&&A.includes("/form/")&&s(A+"/altcha")}if(!s())throw new Error("Attribute challengeurl not set.");$("fetching challenge from",s());const f={credentials:typeof d()=="boolean"?"include":d(),headers:De()!==!1?{"x-altcha-spam-filter":"1"}:{}},v=await vi()(s(),f);if(!v||!(v instanceof Response))throw new Error("Custom fetch function did not return a response.");if(v.status!==200)throw new Error(`Server responded with ${v.status}.`);const m=v.headers.get("X-Altcha-Config"),_=await v.json(),x=new URLSearchParams((n=_.salt.split("?"))==null?void 0:n[1]),w=x.get("expires")||x.get("expire");if(w){const A=new Date(+w*1e3),H=isNaN(A.getTime())?0:A.getTime()-Date.now();H>0&&Br(H)}if(m)try{const A=JSON.parse(m);A&&typeof A=="object"&&A.verifyurl&&!A.verifyurl.startsWith("javascript:")&&(A.verifyurl=pi(A.verifyurl))}catch(A){$("unable to configure from X-Altcha-Config",A)}return _}}function Ya(n){var v,m;const f=(v=l(O))==null?void 0:v.querySelector(typeof n=="string"?`input[name="${n}"]`:'input[type="email"]:not([data-no-spamfilter])');return((m=f==null?void 0:f.value)==null?void 0:m.slice(f.value.indexOf("@")))||void 0}function vi(){let n=fetch;if(p())if($("using customfetch"),typeof p()=="string"){if(n=globalThis[p()]||null,!n)throw new Error(`Custom fetch function not found: ${p()}`)}else n=p();return n}function gi(n,f=[B()||"",document.documentElement.lang||"",...navigator.languages]){const v=Object.keys(n).map(_=>_.toLowerCase()),m=f.reduce((_,x)=>(x=x.toLowerCase(),_||(n[x]?x:null)||v.find(w=>x.split("-")[0]===w.split("-")[0])||null),null);return n[m||"en"]}function Wa(){return De()==="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 De()=="object"?De():{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 _i(n){var v;return[...((v=l(O))==null?void 0:v.querySelectorAll(n!=null&&n.length?n.map(m=>`input[name="${m}"]`).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'))||[]].reduce((m,_)=>{const x=_.name,w=_.value;return x&&w&&(m[x]=/\n/.test(w)?w.replace(new RegExp("(?<!\\r)\\n","g"),`\r
|
|
4
|
+
`):w),m},{})}function pi(n,f){const v=new URL(s()||location.origin),m=new URL(n,v);if(m.search||(m.search=v.search),f)for(const _ in f)f[_]!==void 0&&f[_]!==null&&m.searchParams.set(_,f[_]);return m.toString()}function Za(){const n=cr()!==void 0?cr().split(","):void 0;for(const f of globalThis.altchaPlugins)(!n||n.includes(f.pluginName))&&ze.push(new f({el:l(se),clarify:Vt,dispatch:We,getConfiguration:Ti,getFloatingAnchor:Di,getState:Ni,log:$,reset:bt,solve:Si,setState:Le,setFloatingAnchor:Pi,verify:Me}))}function $(...n){(h()||n.some(f=>f instanceof Error))&&console[n[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${ce()}]`,...n)}function za(){b(K,Q.PAUSED,!0)}function Ja(n){b(K,Q.ERROR,!0)}function Ka(){b(K,Q.READY,!0)}function Xa(){b(K,Q.LOADING,!0)}function Qa(){b(K,Q.PLAYING,!0)}function el(){b(K,Q.PAUSED,!0)}function tl(n){var f;if(n.preventDefault(),n.stopPropagation(),l(Y)){const v=new FormData(n.target),m=String(v.get("code"));if((f=le())!=null&&f.startsWith("javascript:")){const _=le().replace(/^javascript:/,"");if($(`calling ${_} function instead of verifyurl`),!(_ in globalThis))throw new Error(`Global function "${_}" is undefined.`);return globalThis[_]({challenge:l(Y).challenge,code:m,solution:l(Y).solution})}b(at,!0),Ii(dr(l(Y).challenge,l(Y).solution),m).then(({reason:_,verified:x})=>{x?(b(Y,null),Le(C.VERIFIED),$("verified"),Dr().then(()=>{var w;(w=l(jr))==null||w.focus(),We("verified",{payload:l(Fe)})})):(bt(),b(ot,_||"Verification failed",!0))}).catch(_=>{b(Y,null),Le(C.ERROR,_),$("sentinel verification failed:",_)}).finally(()=>{b(at,!1)})}}function mi(n){var v;const f=n.target;E()&&f&&!l(se).contains(f)&&(l(R)===C.VERIFIED&&ee()===!1||l(R)===C.VERIFIED&&ee()==="focus"&&!((v=l(O))!=null&&v.matches(":focus-within"))||o()==="off"&&l(R)===C.UNVERIFIED)&&Li()}function bi(){E()&&l(R)!==C.UNVERIFIED&&Ut()}function rl(n){for(const f of ze)typeof f.onErrorChange=="function"&&f.onErrorChange(l(ot))}function wi(n){l(R)===C.UNVERIFIED?Me():E()&&ee()==="focus"&&l(R)===C.VERIFIED&&Hr()}function yi(n){const f=n.target,v=n.submitter;f!=null&&f.hasAttribute("data-code-challenge-form")||(l(O)&&o()==="onsubmit"?l(R)===C.UNVERIFIED?(n.preventDefault(),n.stopPropagation(),Me().then(()=>{ol(v)})):l(R)!==C.VERIFIED&&(n.preventDefault(),n.stopPropagation(),l(R)===C.VERIFYING&&Ci()):l(O)&&E()&&o()==="off"&&l(R)===C.UNVERIFIED&&(n.preventDefault(),n.stopPropagation(),Hr()))}function Ei(){bt()}function Ci(){l(R)===C.VERIFYING&&l(V).waitAlert&&alert(l(V).waitAlert)}function xi(){l(Ze)?l(Ze).paused?(l(Ze).currentTime=0,l(Ze).play()):l(Ze).pause():(b(qr,!0),requestAnimationFrame(()=>{var n;(n=l(Ze))==null||n.play()}))}function nl(n){for(const f of ze)typeof f.onStateChange=="function"&&f.onStateChange(l(R));E()&&l(R)!==C.UNVERIFIED&&requestAnimationFrame(()=>{Ut()}),b(Ft,l(R)===C.VERIFIED)}function ki(){E()&&Ut()}function Ai(n){return JSON.parse(n)}async function il(n){if(!le())throw new Error("Attribute verifyurl not set.");$("requesting server verification from",le());const f={payload:n};if(De()!==!1){const{blockedCountries:_,classifier:x,disableRules:w,email:A,expectedLanguages:H,expectedCountries:re,fields:de,ipAddress:Je,text:Yr,timeZone:gr}=Wa();f.blockedCountries=_,f.classifier=x,f.disableRules=w,f.email=A===!1?void 0:Ya(A),f.expectedCountries=re,f.expectedLanguages=H||(ci?[ci]:void 0),f.fields=de===!1?void 0:_i(de),f.ipAddress=Je===!1?void 0:Je||"auto",f.text=Yr,f.timeZone=gr===!1?void 0:gr||oi()}const v=await vi()(le(),{body:JSON.stringify(f),headers:{"content-type":"application/json"},method:"POST"});if(!v||!(v instanceof Response))throw new Error("Custom fetch function did not return a response.");if(v.status!==200)throw new Error(`Server responded with ${v.status}.`);const m=await v.json();if(m!=null&&m.payload&&b(Fe,m.payload,!0),We("serververification",m),u()&&m.classification==="BAD")throw new Error("SpamFilter returned negative classification.")}async function Ii(n,f){if(!le())throw new Error("Attribute verifyurl not set.");$("requesting sentinel verification from",le());const v={code:f,payload:n};it()&&(v.fields=it().fields?_i():void 0,v.timeZone=it().timeZone?oi():void 0);const m=await fetch(le(),{body:JSON.stringify(v),headers:{"content-type":"application/json"},method:"POST"});if(!m||!(m instanceof Response))throw new Error("Fetch function did not return a response.");if(m.status!==200)throw new Error(`Server responded with ${m.status}.`);const _=await m.json();return _!=null&&_.payload&&b(Fe,_.payload,!0),We("sentinelverification",_),_}function ol(n){var f;l(O)&&"requestSubmit"in l(O)?l(O).requestSubmit(n):(f=l(O))!=null&&f.reportValidity()&&(n?n.click():l(O).submit())}function Br(n){$("expire",n),Ne&&(clearTimeout(Ne),Ne=null),n<1?hi():Ne=setTimeout(hi,n)}function Ri(n){$("floating",n),E()!==n&&(l(se).style.left="",l(se).style.top=""),E(n===!0||n===""?"auto":n===!1||n==="false"?void 0:E()),E()?(o()||o("onsubmit"),document.addEventListener("scroll",bi),document.addEventListener("click",mi),window.addEventListener("resize",ki)):o()==="onsubmit"&&o(void 0)}function $i(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(!fi.includes(n.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${fi.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 Si(n){let f=null;if("Worker"in window){try{f=await al(n,n.maxNumber||n.maxnumber||xe())}catch(v){$(v)}if((f==null?void 0:f.number)!==void 0||"obfuscated"in n)return{data:n,solution:f}}if("obfuscated"in n){const v=await wa(n.obfuscated,n.key,n.maxNumber||n.maxnumber);return{data:n,solution:await v.promise}}return{data:n,solution:await pa(n.challenge,n.salt,n.algorithm,n.maxNumber||n.maxnumber||xe()).promise}}async function al(n,f=typeof we()=="number"?we():n.maxNumber||n.maxnumber||xe(),v=Math.ceil(pt())){const m=[];v=Math.min(16,f,Math.max(1,v));for(let w=0;w<v;w++)m.push(altchaCreateWorker(Ot()));const _=Math.ceil(f/v),x=await Promise.all(m.map((w,A)=>{const H=A*_;return new Promise(re=>{w.addEventListener("message",de=>{if(de.data)for(const Je of m)Je!==w&&Je.postMessage({type:"abort"});re(de.data)}),w.postMessage({payload:n,max:H+_,start:H,type:"work"})})}));for(const w of m)w.terminate();return x.find(w=>!!w)||null}async function Vt(){if(!Ye()){Le(C.ERROR);return}const n=ze.find(f=>f.constructor.pluginName==="obfuscation");if(!n||!("clarify"in n)){Le(C.ERROR),$("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");return}if("clarify"in n&&typeof n.clarify=="function")return n.clarify()}function ll(n){n.obfuscated!==void 0&&Ye(n.obfuscated),n.auto!==void 0&&(o(n.auto),o()==="onload"&&(Ye()?Vt():Me())),n.blockspam!==void 0&&u(!!n.blockspam),n.customfetch!==void 0&&p(n.customfetch),n.floatinganchor!==void 0&&j(n.floatinganchor),n.delay!==void 0&&g(n.delay),n.floatingoffset!==void 0&&_e(n.floatingoffset),n.floating!==void 0&&Ri(n.floating),n.expire!==void 0&&(Br(n.expire),T(n.expire)),n.challenge&&(c(typeof n.challenge=="string"?n.challenge:JSON.stringify(n.challenge)),$i(l(Ur))),n.challengeurl!==void 0&&s(n.challengeurl),n.debug!==void 0&&h(!!n.debug),n.hidefooter!==void 0&&ae(!!n.hidefooter),n.hidelogo!==void 0&&te(!!n.hidelogo),n.language!==void 0&&_t(gi(a(),[n.language])),n.maxnumber!==void 0&&xe(+n.maxnumber),n.mockerror!==void 0&&Lt(!!n.mockerror),n.name!==void 0&&ce(n.name),n.refetchonexpire!==void 0&&Pt(!!n.refetchonexpire),n.sentinel!==void 0&&typeof n.sentinel=="object"&&it(n.sentinel),n.spamfilter!==void 0&&De(typeof n.spamfilter=="object"?n.spamfilter:!!n.spamfilter),n.strings&&_t(typeof n.strings=="string"?n.strings:JSON.stringify(n.strings)),n.test!==void 0&&we(typeof n.test=="number"?n.test:!!n.test),n.verifyurl!==void 0&&le(n.verifyurl),n.workers!==void 0&&pt(+n.workers),n.workerurl!==void 0&&Ot(n.workerurl)}function Ti(){return{auto:o(),blockspam:u(),challengeurl:s(),debug:h(),delay:g(),expire:T(),floating:E(),floatinganchor:j(),floatingoffset:_e(),hidefooter:ae(),hidelogo:te(),name:ce(),maxnumber:xe(),mockerror:Lt(),obfuscated:Ye(),refetchonexpire:Pt(),spamfilter:De(),strings:l(V),test:we(),verifyurl:le(),workers:pt(),workerurl:Ot()}}function Di(){return l(mt)}function sl(n){return ze.find(f=>f.constructor.pluginName===n)}function Ni(){return l(R)}function Li(){l(se).style.display="none"}function Ut(n=20){var f;if(l(se))if(l(mt)||b(mt,(j()?document.querySelector(j()):(f=l(O))==null?void 0:f.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||l(O),!0),l(mt)){const v=parseInt(_e(),10)||12,m=l(mt).getBoundingClientRect(),_=l(se).getBoundingClientRect(),x=document.documentElement.clientHeight,w=document.documentElement.clientWidth,A=E()==="auto"?m.bottom+_.height+v+n>x:E()==="top",H=Math.max(n,Math.min(w-n-_.width,m.left+m.width/2-_.width/2));if(A?l(se).style.top=`${m.top-(_.height+v)}px`:l(se).style.top=`${m.bottom+v}px`,l(se).style.left=`${H}px`,l(se).setAttribute("data-floating",A?"top":"bottom"),l(Mt)){const re=l(Mt).getBoundingClientRect();l(Mt).style.left=m.left-H+m.width/2-re.width/2+"px"}}else $("unable to find floating anchor element")}function bt(n=C.UNVERIFIED,f=null){Ne&&(clearTimeout(Ne),Ne=null),b(Ft,!1),b(Fe,null),b(Y,null),b(qr,!1),b(K,null),Le(n,f)}function Pi(n){b(mt,n,!0)}function Le(n,f=null){b(R,n,!0),b(ot,f,!0),We("statechange",{payload:l(Fe),state:l(R)})}function Hr(){l(se).style.display="block",E()&&Ut()}async function Me(){return bt(C.VERIFYING),await new Promise(n=>setTimeout(n,g()||0)),Ga().then(n=>($i(n),$("challenge",n),Si(n))).then(({data:n,solution:f})=>{var v;if($("solution",f),!f||n&&"challenge"in n&&!("clearText"in f))if((f==null?void 0:f.number)!==void 0&&"challenge"in n)if(le()&&"codeChallenge"in n)((v=document.activeElement)==null?void 0:v.tagName)==="INPUT"&&y()===!1&&document.activeElement.blur(),b(Y,{challenge:n,solution:f},!0);else{if(le()&&it()!==void 0)return Ii(dr(n,f));if(le())return il(dr(n,f));b(Fe,dr(n,f),!0),$("payload",l(Fe))}else throw $("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."),new Error("Unexpected result returned.")}).then(()=>{l(Y)?(Le(C.CODE),Dr().then(()=>{We("code",{codeChallenge:l(Y)})})):(Le(C.VERIFIED),$("verified"),Dr().then(()=>{We("verified",{payload:l(Fe)})}))}).catch(n=>{$(n),Le(C.ERROR,n.message)})}var Oi=Va(),Fi=kt(Oi);Xo(Fi,t,"default",{});var jt=z(Fi,2),Gr=Z(jt),hr=Z(Gr);let Mi;var Vi=Z(hr);{var ul=n=>{Mr(n)};J(Vi,n=>{l(R)===C.VERIFYING&&n(ul)})}var lt=z(Vi,2);zn(lt),lt.__change=[xa,R,De,O,Ft,Ye,Vt,Me],lr(lt,n=>b(jr,n),()=>l(jr)),W(hr);var vr=z(hr,2),fl=Z(vr);{var cl=n=>{var f=ar(),v=kt(f);nt(v,()=>l(V).verified),q(n,f)},dl=(n,f)=>{{var v=_=>{var x=ar(),w=kt(x);nt(w,()=>l(V).verifying),q(_,x)},m=(_,x)=>{{var w=H=>{var re=ar(),de=kt(re);nt(de,()=>l(V).verificationRequired),q(H,re)},A=H=>{var re=ar(),de=kt(re);nt(de,()=>l(V).label),q(H,re)};J(_,H=>{l(R)===C.CODE?H(w):H(A,!1)},x)}};J(n,_=>{l(R)===C.VERIFYING?_(v):_(m,!1)},f)}};J(fl,n=>{l(R)===C.VERIFIED?n(cl):n(dl,!1)})}W(vr);var Ui=z(vr,2);{var hl=n=>{var f=Aa();zn(f),Re(()=>{P(f,"name",ce()),na(f,l(Fe))}),q(n,f)};J(Ui,n=>{l(R)===C.VERIFIED&&n(hl)})}var ji=z(Ui,2);{var vl=n=>{var f=Ia(),v=Z(f);P(v,"href",qa),W(f),Re(()=>P(v,"aria-label",l(V).ariaLinkLabel)),q(n,f)};J(ji,n=>{(te()!==!0||l(Vr))&&n(vl)})}var gl=z(ji,2);{var _l=n=>{var f=Na(),v=z(Z(f),2),m=Z(v),_=z(m,2);Go(_,!y()),_.__keydown=[Ea,xi];var x=z(_,2),w=Z(x),A=Z(w);{var H=ke=>{var X=Ta();X.__click=xi;var _r=Z(X);{var qt=wt=>{Mr(wt,()=>20)},xl=(wt,kl)=>{{var Al=yt=>{var Wr=Ra();q(yt,Wr)},Il=(yt,Wr)=>{{var Rl=Et=>{var Zr=$a();q(Et,Zr)},$l=Et=>{var Zr=Sa();q(Et,Zr)};J(yt,Et=>{l(K)===Q.PLAYING?Et(Rl):Et($l,!1)},Wr)}};J(wt,yt=>{l(K)===Q.ERROR?yt(Al):yt(Il,!1)},kl)}};J(_r,wt=>{l(K)===Q.LOADING?wt(qt):wt(xl,!1)})}W(X),Re(()=>{P(X,"title",l(V).getAudioChallenge),X.disabled=l(K)===Q.LOADING||l(K)===Q.ERROR||l(at),P(X,"aria-label",l(K)===Q.LOADING?l(V).loading:l(V).getAudioChallenge)}),q(ke,X)};J(A,ke=>{l(Y).challenge.codeChallenge.audio&&ke(H)})}var re=z(A,2);re.__click=[Ca,Me],W(w);var de=z(w,2),Je=Z(de);{var Yr=ke=>{Mr(ke,()=>16)};J(Je,ke=>{l(at)&&ke(Yr)})}var gr=z(Je);W(de),W(x);var El=z(x,2);{var Cl=ke=>{var X=Da(),_r=Z(X);W(X),lr(X,qt=>b(Ze,qt),()=>l(Ze)),Re(qt=>P(_r,"src",qt),[()=>pi(l(Y).challenge.codeChallenge.audio,{language:B()})]),Ge("loadstart",X,Xa),Ge("canplay",X,Ka),Ge("pause",X,el),Ge("playing",X,Qa),Ge("ended",X,za),Ge("error",_r,Ja),q(ke,X)};J(El,ke=>{l(Y).challenge.codeChallenge.audio&&l(qr)&&ke(Cl)})}W(v),W(f),Re(()=>{P(f,"aria-label",l(V).verificationRequired),P(m,"src",l(Y).challenge.codeChallenge.image),P(_,"minlength",l(Y).challenge.codeChallenge.length||1),P(_,"maxlength",l(Y).challenge.codeChallenge.length),P(_,"placeholder",l(V).enterCode),P(_,"aria-label",l(K)===Q.LOADING?l(V).loading:l(K)===Q.PLAYING?"":l(V).enterCodeAria),P(_,"aria-live",l(K)?"assertive":"polite"),P(_,"aria-busy",l(K)===Q.LOADING),_.disabled=l(at),P(re,"aria-label",l(V).reload),P(re,"title",l(V).reload),re.disabled=l(at),de.disabled=l(at),P(de,"aria-label",l(V).verify),zo(gr,` ${l(V).verify??""}`)}),Ge("submit",v,tl,!0),q(n,f)};J(gl,n=>{var f;(f=l(Y))!=null&&f.challenge.codeChallenge&&n(_l)})}W(Gr);var qi=z(Gr,2);{var pl=n=>{var f=Oa(),v=z(Z(f),2);{var m=x=>{var w=La(),A=Z(w);nt(A,()=>l(V).expired),W(w),Re(()=>P(w,"title",l(ot))),q(x,w)},_=x=>{var w=Pa(),A=Z(w);nt(A,()=>l(V).error),W(w),Re(()=>P(w,"title",l(ot))),q(x,w)};J(v,x=>{l(R)===C.EXPIRED?x(m):x(_,!1)})}W(f),q(n,f)};J(qi,n=>{(l(ot)||l(R)===C.EXPIRED)&&n(pl)})}var Bi=z(qi,2);{var ml=n=>{var f=Fa(),v=Z(f),m=Z(v);nt(m,()=>l(V).footer),W(v),W(f),q(n,f)};J(Bi,n=>{l(V).footer&&(ae()!==!0||l(Vr))&&n(ml)})}var bl=z(Bi,2);{var wl=n=>{var f=Ma();lr(f,v=>b(Mt,v),()=>l(Mt)),q(n,f)};J(bl,n=>{E()&&n(wl)})}W(jt),lr(jt,n=>b(se,n),()=>l(se)),Re(n=>{P(jt,"data-state",l(R)),P(jt,"data-floating",E()),Mi=ea(hr,1,"altcha-checkbox",null,Mi,n),P(lt,"id",l(di)),lt.required=o()!=="onsubmit"&&(!E()||o()!=="off"),P(vr,"for",l(di))},[()=>({"altcha-checkbox-verifying":l(R)===C.VERIFYING})]),Ge("invalid",lt,Ci),oa(lt,()=>l(Ft),n=>b(Ft,n)),q(e,Oi);var yl=Un({clarify:Vt,configure:ll,getConfiguration:Ti,getFloatingAnchor:Di,getPlugin:sl,getState:Ni,hide:Li,repositionFloating:Ut,reset:bt,setFloatingAnchor:Pi,setState:Le,show:Hr,verify:Me,get auto(){return o()},set auto(n=void 0){o(n),k()},get blockspam(){return u()},set blockspam(n=void 0){u(n),k()},get challengeurl(){return s()},set challengeurl(n=void 0){s(n),k()},get challengejson(){return c()},set challengejson(n=void 0){c(n),k()},get credentials(){return d()},set credentials(n=void 0){d(n),k()},get customfetch(){return p()},set customfetch(n=void 0){p(n),k()},get debug(){return h()},set debug(n=!1){h(n),k()},get delay(){return g()},set delay(n=0){g(n),k()},get disableautofocus(){return y()},set disableautofocus(n=!1){y(n),k()},get expire(){return T()},set expire(n=void 0){T(n),k()},get floating(){return E()},set floating(n=void 0){E(n),k()},get floatinganchor(){return j()},set floatinganchor(n=void 0){j(n),k()},get floatingoffset(){return _e()},set floatingoffset(n=void 0){_e(n),k()},get floatingpersist(){return ee()},set floatingpersist(n=!1){ee(n),k()},get hidefooter(){return ae()},set hidefooter(n=!1){ae(n),k()},get hidelogo(){return te()},set hidelogo(n=!1){te(n),k()},get id(){return gt()},set id(n=void 0){gt(n),k()},get language(){return B()},set language(n=void 0){B(n),k()},get name(){return ce()},set name(n="altcha"){ce(n),k()},get maxnumber(){return xe()},set maxnumber(n=1e6){xe(n),k()},get mockerror(){return Lt()},set mockerror(n=!1){Lt(n),k()},get obfuscated(){return Ye()},set obfuscated(n=void 0){Ye(n),k()},get plugins(){return cr()},set plugins(n=void 0){cr(n),k()},get refetchonexpire(){return Pt()},set refetchonexpire(n=!0){Pt(n),k()},get sentinel(){return it()},set sentinel(n=void 0){it(n),k()},get spamfilter(){return De()},set spamfilter(n=!1){De(n),k()},get strings(){return _t()},set strings(n=void 0){_t(n),k()},get test(){return we()},set test(n=!1){we(n),k()},get verifyurl(){return le()},set verifyurl(n=void 0){le(n),k()},get workers(){return pt()},set workers(n=Math.min(16,navigator.hardwareConcurrency||8)){pt(n),k()},get workerurl(){return Ot()},set workerurl(n=void 0){Ot(n),k()}});return i(),yl}Zo(["change","keydown","click"]),customElements.define("altcha-widget",va(ai,{blockspam:{type:"Boolean"},debug:{type:"Boolean"},delay:{type:"Number"},disableautofocus:{type:"Boolean"},expire:{type:"Number"},floatingoffset:{type:"Number"},hidefooter:{type:"Boolean"},hidelogo:{type:"Boolean"},maxnumber:{type:"Number"},mockerror:{type:"Boolean"},refetchonexpire:{type:"Boolean"},test:{type:"Boolean"},workers:{type:"Number"},auto:{},challengeurl:{},challengejson:{},credentials:{},customfetch:{},floating:{},floatinganchor:{},floatingpersist:{},id:{},language:{},name:{},obfuscated:{},plugins:{},sentinel:{},spamfilter:{},strings:{},verifyurl:{},workerurl:{}},["default"],["clarify","configure","getConfiguration","getFloatingAnchor","getPlugin","getState","hide","repositionFloating","reset","setFloatingAnchor","setState","show","verify"],!1));const li='@keyframes altcha-spinner{to{transform:rotate(360deg)}}.altcha{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}.altcha:focus-within{border-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating]{background:var(--altcha-color-base, white);display:none;filter:drop-shadow(3px 3px 6px rgba(0,0,0,.2));left:-100%;position:fixed;top:-100%;width:var(--altcha-max-width, 260px);z-index:999999}.altcha[data-floating=top] .altcha-anchor-arrow{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto}.altcha[data-floating=bottom]:focus-within::after{border-bottom-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating=top]:focus-within::after{border-top-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating]:not([data-state=unverified]){display:block}.altcha-anchor-arrow{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{align-items:center;display:flex;gap:.4rem;padding:.7rem;position:relative}.altcha-code-challenge{background:var(--altcha-color-base, white);border:1px solid var(--altcha-color-border-focus, currentColor);border-radius:var(--altcha-border-radius, 3px);filter:drop-shadow(3px 3px 6px rgba(0,0,0,.2));padding:.5rem;position:absolute;top:2.5rem;z-index:9999999}.altcha-code-challenge>form{display:flex;flex-direction:column;gap:.5rem}.altcha-code-challenge-input{border:1px solid currentColor;border-radius:3px;box-sizing:border-box;outline:0;font-size:16px;padding:.35rem;width:220px}.altcha-code-challenge-input:focus{outline:2px solid color-mix(in srgb,var(--altcha-color-active, #1D1DC9) 20%,transparent)}.altcha-code-challenge-input:disabled{opacity:.7}.altcha-code-challenge-image{background-color:#fff;border:1px solid currentColor;border-radius:3px;box-sizing:border-box;object-fit:contain;height:50px;width:220px}.altcha-code-challenge-audio,.altcha-code-challenge-reload{background:color-mix(in srgb,var(--altcha-color-text, currentColor) 10%,transparent);border:0;border-radius:3px;color:var(--altcha-color-text, currentColor);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:.35rem}.altcha-code-challenge-audio:disabled,.altcha-code-challenge-reload:disabled,.altcha-code-challenge-verify:disabled{opacity:.7;pointer-events:none}.altcha-code-challenge-audio>*,.altcha-code-challenge-reload>*{height:20px;width:20px}.altcha-code-challenge-buttons{display:flex;justify-content:space-between}.altcha-code-challenge-buttons-left{display:flex;gap:.25rem}.altcha-code-challenge-verify{align-items:center;background:var(--altcha-color-active, #1D1DC9);border:0;border-radius:3px;color:#fff;cursor:pointer;display:flex;gap:.5rem;font-size:100%;padding:.35rem 1rem}.altcha-code-challenge-arrow{border:6px solid transparent;border-bottom-color:var(--altcha-color-border, currentColor);content:"";height:0;left:.15rem;position:absolute;top:-12px;width:0}.altcha[data-floating=top] .altcha-code-challenge{top:-150px}.altcha[data-floating=top] .altcha-code-challenge-arrow{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, currentColor);bottom:-12px;top:auto}.altcha-label{cursor:pointer;flex-grow:1}.altcha-logo{color:currentColor!important;opacity:.7}.altcha-footer:hover,.altcha-logo:hover{opacity:1}.altcha-error{color:var(--altcha-color-error-text, #f23939);display:flex;font-size:.85rem;gap:.3rem;padding:0 .7rem .7rem}.altcha-footer{align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:.75rem;opacity:.7;justify-content:end;padding:.2rem .7rem}.altcha-footer a{color:currentColor}.altcha-checkbox{display:flex;align-items:center;justify-content:center;height:24px;position:relative;width:24px}.altcha-checkbox .altcha-spinner{bottom:0;left:0;position:absolute;right:0;top:0}.altcha-checkbox input{width:18px;height:18px;margin:0}.altcha-checkbox-verifying input{appearance:none;opacity:0;pointer-events:none}.altcha-spinner{animation:altcha-spinner .75s infinite linear;transform-origin:center}';function si(e,t="__altcha-css"){if(!document.getElementById(t)){const r=document.createElement("style");r.id=t,r.textContent=e,document.head.appendChild(r)}}globalThis.altchaCreateWorker=e=>e?new Worker(new URL(e)):new Bt,si(li),si(li),S.Altcha=ai,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
|
package/dist_external/altcha.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.altcha{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}.altcha:focus-within{border-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating]{background:var(--altcha-color-base, white);display:none;filter:drop-shadow(3px 3px 6px rgba(0,0,0,.2));left:-100%;position:fixed;top:-100%;width:var(--altcha-max-width, 260px);z-index:999999}.altcha[data-floating=top] .altcha-anchor-arrow{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto}.altcha[data-floating=bottom]:focus-within:after{border-bottom-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating=top]:focus-within:after{border-top-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating]:not([data-state=unverified]){display:block}.altcha-anchor-arrow{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{align-items:center;display:flex;gap:.4rem;padding:.7rem;position:relative}.altcha-code-challenge{background:var(--altcha-color-base, white);border:1px solid var(--altcha-color-border-focus, currentColor);border-radius:var(--altcha-border-radius, 3px);filter:drop-shadow(3px 3px 6px rgba(0,0,0,.2));padding:.5rem;position:absolute;top:2.5rem;z-index:9999999}.altcha-code-challenge>form{display:flex;flex-direction:column;gap:.5rem}.altcha-code-challenge-input{border:1px solid currentColor;border-radius:3px;box-sizing:border-box;outline:none;font-size:16px;padding:.35rem;width:220px}.altcha-code-challenge-input:focus{outline:2px solid color-mix(in srgb,var(--altcha-color-active, #1D1DC9) 20%,transparent)}.altcha-code-challenge-input:disabled{opacity:.7}.altcha-code-challenge-image{background-color:#fff;border:1px solid currentColor;border-radius:3px;box-sizing:border-box;object-fit:contain;height:50px;width:220px}.altcha-code-challenge-audio,.altcha-code-challenge-reload{background:color-mix(in srgb,var(--altcha-color-text, currentColor) 10%,transparent);border:0;border-radius:3px;color:var(--altcha-color-text, currentColor);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:.35rem}.altcha-code-challenge-audio:disabled,.altcha-code-challenge-reload:disabled{opacity:.7;pointer-events:none}.altcha-code-challenge-audio>*,.altcha-code-challenge-reload>*{height:20px;width:20px}.altcha-code-challenge-buttons{display:flex;justify-content:space-between}.altcha-code-challenge-buttons-left{display:flex;gap:.25rem}.altcha-code-challenge-verify{align-items:center;background:var(--altcha-color-active, #1D1DC9);border:0;border-radius:3px;color:#fff;cursor:pointer;display:flex;gap:.5rem;font-size:100%;padding:.35rem 1rem}.altcha-code-challenge-verify:disabled{opacity:.7;pointer-events:none}.altcha-code-challenge-arrow{border:6px solid transparent;border-bottom-color:var(--altcha-color-border, currentColor);content:"";height:0;left:.15rem;position:absolute;top:-12px;width:0}.altcha[data-floating=top] .altcha-code-challenge{top:-150px}.altcha[data-floating=top] .altcha-code-challenge-arrow{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, currentColor);bottom:-12px;top:auto}.altcha-label{cursor:pointer;flex-grow:1}.altcha-logo{color:currentColor;opacity:.7}.altcha-logo:hover{opacity:1}.altcha-error{color:var(--altcha-color-error-text, #f23939);display:flex;font-size:.85rem;gap:.3rem;padding:0 .7rem .7rem}.altcha-footer{align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:.75rem;opacity:.7;justify-content:end;padding:.2rem .7rem}.altcha-footer:hover{opacity:1}.altcha-footer a{color:currentColor}.altcha-checkbox{display:flex;align-items:center;height:24px;width:24px}.altcha-checkbox input{width:18px;height:18px;margin:0}.altcha-checkbox-verifying input{-webkit-appearance:none;-moz-appearance:none;appearance:none;
|
|
1
|
+
.altcha{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}.altcha:focus-within{border-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating]{background:var(--altcha-color-base, white);display:none;filter:drop-shadow(3px 3px 6px rgba(0,0,0,.2));left:-100%;position:fixed;top:-100%;width:var(--altcha-max-width, 260px);z-index:999999}.altcha[data-floating=top] .altcha-anchor-arrow{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto}.altcha[data-floating=bottom]:focus-within:after{border-bottom-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating=top]:focus-within:after{border-top-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating]:not([data-state=unverified]){display:block}.altcha-anchor-arrow{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{align-items:center;display:flex;gap:.4rem;padding:.7rem;position:relative}.altcha-code-challenge{background:var(--altcha-color-base, white);border:1px solid var(--altcha-color-border-focus, currentColor);border-radius:var(--altcha-border-radius, 3px);filter:drop-shadow(3px 3px 6px rgba(0,0,0,.2));padding:.5rem;position:absolute;top:2.5rem;z-index:9999999}.altcha-code-challenge>form{display:flex;flex-direction:column;gap:.5rem}.altcha-code-challenge-input{border:1px solid currentColor;border-radius:3px;box-sizing:border-box;outline:none;font-size:16px;padding:.35rem;width:220px}.altcha-code-challenge-input:focus{outline:2px solid color-mix(in srgb,var(--altcha-color-active, #1D1DC9) 20%,transparent)}.altcha-code-challenge-input:disabled{opacity:.7}.altcha-code-challenge-image{background-color:#fff;border:1px solid currentColor;border-radius:3px;box-sizing:border-box;object-fit:contain;height:50px;width:220px}.altcha-code-challenge-audio,.altcha-code-challenge-reload{background:color-mix(in srgb,var(--altcha-color-text, currentColor) 10%,transparent);border:0;border-radius:3px;color:var(--altcha-color-text, currentColor);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:.35rem}.altcha-code-challenge-audio:disabled,.altcha-code-challenge-reload:disabled{opacity:.7;pointer-events:none}.altcha-code-challenge-audio>*,.altcha-code-challenge-reload>*{height:20px;width:20px}.altcha-code-challenge-buttons{display:flex;justify-content:space-between}.altcha-code-challenge-buttons-left{display:flex;gap:.25rem}.altcha-code-challenge-verify{align-items:center;background:var(--altcha-color-active, #1D1DC9);border:0;border-radius:3px;color:#fff;cursor:pointer;display:flex;gap:.5rem;font-size:100%;padding:.35rem 1rem}.altcha-code-challenge-verify:disabled{opacity:.7;pointer-events:none}.altcha-code-challenge-arrow{border:6px solid transparent;border-bottom-color:var(--altcha-color-border, currentColor);content:"";height:0;left:.15rem;position:absolute;top:-12px;width:0}.altcha[data-floating=top] .altcha-code-challenge{top:-150px}.altcha[data-floating=top] .altcha-code-challenge-arrow{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, currentColor);bottom:-12px;top:auto}.altcha-label{cursor:pointer;flex-grow:1}.altcha-logo{color:currentColor!important;opacity:.7}.altcha-logo:hover{opacity:1}.altcha-error{color:var(--altcha-color-error-text, #f23939);display:flex;font-size:.85rem;gap:.3rem;padding:0 .7rem .7rem}.altcha-footer{align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:.75rem;opacity:.7;justify-content:end;padding:.2rem .7rem}.altcha-footer:hover{opacity:1}.altcha-footer a{color:currentColor}.altcha-checkbox{display:flex;align-items:center;justify-content:center;height:24px;position:relative;width:24px}.altcha-checkbox .altcha-spinner{bottom:0;left:0;position:absolute;right:0;top:0}.altcha-checkbox input{width:18px;height:18px;margin:0}.altcha-checkbox-verifying input{-webkit-appearance:none;-moz-appearance:none;appearance:none;opacity:0;pointer-events:none}.altcha-spinner{animation:altcha-spinner .75s infinite linear;transform-origin:center}@keyframes altcha-spinner{to{transform:rotate(360deg)}}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Writable } from 'svelte/store';
|
|
1
2
|
export {};
|
|
2
3
|
|
|
3
4
|
declare module 'altcha';
|
|
@@ -5,8 +6,10 @@ declare module 'altcha';
|
|
|
5
6
|
declare global {
|
|
6
7
|
var altchaCreateWorker: (url?: string) => Worker;
|
|
7
8
|
var altchaPlugins: any[];
|
|
8
|
-
var altchaI18n:
|
|
9
|
-
|
|
9
|
+
var altchaI18n: {
|
|
10
|
+
get: (language: string) => Record<string, string>;
|
|
11
|
+
set: (language: string, translation: Record<string, string>) => void;
|
|
12
|
+
store: Writable<Record<string, Record<string, string>>>;
|
|
10
13
|
};
|
|
11
14
|
|
|
12
15
|
type AltchaState = 'error' | 'expired' | 'verified' | 'verifying' | 'unverified';
|