altcha 3.0.5 → 3.0.6

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.
@@ -6066,7 +6066,7 @@ function Widget($$anchor, $$props) {
6066
6066
  }
6067
6067
  });
6068
6068
  onMount(() => {
6069
- log("mounted", "3.0.5");
6069
+ log("mounted", "3.0.6");
6070
6070
  if (instance) {
6071
6071
  globalThis.$altcha.instances.add(instance);
6072
6072
  }
@@ -6317,9 +6317,6 @@ function Widget($$anchor, $$props) {
6317
6317
  }
6318
6318
  }
6319
6319
  function onCloseClick() {
6320
- if (get(currentController)) {
6321
- get(currentController).abort();
6322
- }
6323
6320
  setDisplay(get(config).display);
6324
6321
  reset$1();
6325
6322
  }
@@ -6338,9 +6335,6 @@ function Widget($$anchor, $$props) {
6338
6335
  }
6339
6336
  }
6340
6337
  function onFormReset() {
6341
- if (get(currentController)) {
6342
- get(currentController).abort();
6343
- }
6344
6338
  setDisplay(get(config).display);
6345
6339
  reset$1();
6346
6340
  }
@@ -6359,9 +6353,11 @@ function Widget($$anchor, $$props) {
6359
6353
  });
6360
6354
  }
6361
6355
  }
6362
- function onWindowPageshow() {
6363
- setDisplay(get(config).display);
6364
- reset$1();
6356
+ function onWindowPageshow(ev) {
6357
+ if (ev.persisted) {
6358
+ setDisplay(get(config).display);
6359
+ reset$1();
6360
+ }
6365
6361
  }
6366
6362
  function onWindowResize() {
6367
6363
  updateUI();
@@ -6582,6 +6578,9 @@ function Widget($$anchor, $$props) {
6582
6578
  set(checked, false);
6583
6579
  set(error, err, true);
6584
6580
  set(payload, null);
6581
+ if (get(currentController)) {
6582
+ get(currentController).abort();
6583
+ }
6585
6584
  if (get(expirationTimeout)) {
6586
6585
  clearTimeout(get(expirationTimeout));
6587
6586
  set(expirationTimeout, null);
@@ -6620,8 +6619,8 @@ function Widget($$anchor, $$props) {
6620
6619
  if (hook !== void 0) {
6621
6620
  return hook;
6622
6621
  }
6623
- set(currentController, controller, true);
6624
6622
  reset$1(State.VERIFYING);
6623
+ set(currentController, controller, true);
6625
6624
  try {
6626
6625
  if (!isSecureContext) {
6627
6626
  throw new Error("Secure context (HTTPS) required.");
@@ -6632,6 +6631,10 @@ function Widget($$anchor, $$props) {
6632
6631
  if (get(config).test) {
6633
6632
  log("running test mode with null challenge");
6634
6633
  await delay(Math.max(0, minDuration - (performance.now() - start)));
6634
+ if (get(currentController)?.signal.aborted) {
6635
+ reset$1();
6636
+ return null;
6637
+ }
6635
6638
  set(payload, btoa(JSON.stringify({ challenge: null, solution: null, test: true })), true);
6636
6639
  log("verified");
6637
6640
  setState(State.VERIFIED);
@@ -1 +1 @@
1
- var e=Array.isArray,t=Array.prototype.indexOf,n=Array.prototype.includes,r=Array.from,i=Object.keys,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyDescriptors,l=Object.prototype,c=Array.prototype,u=Object.getPrototypeOf,f=Object.isExtensible;const d=()=>{};function h(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}const v=1<<24,p=16,g=32,m=64,y=512,b=1024,w=2048,_=4096,$=8192,E=16384,C=32768,S=1<<25,k=65536,x=1<<17,I=1<<19,O=65536,T=1<<21,A=1<<23,R=Symbol("$state"),P=Symbol("legacy props"),L=Symbol(""),M=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},N=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");function D(e){return e===this.v}function V(e,t){return e!=e?t==t:e!==t||null!==e&&"object"==typeof e||"function"==typeof e}function j(e){return!V(e,this.v)}const U={},F=Symbol(),q="http://www.w3.org/1999/xhtml";let H=null;function G(e){H=e}function Y(e,t=!1,n){H={p:H,i:!1,c:null,e:null,s:e,x:null,r:Qn,l:null}}function B(e){var t=H,n=t.e;if(null!==n)for(var r of(t.e=null,n))xr(r);return void 0!==e&&(t.x=e),t.i=!0,H=t.p,e??{}}let J=[];function Z(){var e=J;J=[],function(e){for(var t=0;t<e.length;t++)e[t]()}(e)}function W(e){if(0===J.length&&!En){var t=J;queueMicrotask(()=>{t===J&&Z()})}J.push(e)}function z(){for(;J.length>0;)Z()}function X(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let K,Q=!1;function ee(e){Q=e}function te(e){if(null===e)throw X(),U;return K=e}function ne(){return te(ye(K))}function re(e){if(Q){if(null!==ye(K))throw X(),U;K=e}}function ie(e=1){if(Q){for(var t=e,n=K;t--;)n=ye(n);K=n}}function oe(e=!0){for(var t=0,n=K;;){if(8===n.nodeType){var r=n.data;if("]"===r){if(0===t)return n;t-=1}else("["===r||"[!"===r||"["===r[0]&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=ye(n);e&&n.remove(),n=i}}function ae(e){if(!e||8!==e.nodeType)throw X(),U;return e.data}function se(t){if("object"!=typeof t||null===t||R in t)return t;const n=u(t);if(n!==l&&n!==c)return t;var r=new Map,i=e(t),o=Fn(0),s=lr,f=e=>{if(lr===s)return e();var t=zn,n=lr;Kn(null),cr(s);var r=e();return Kn(t),cr(n),r};return i&&r.set("length",Fn(t.length)),new Proxy(t,{defineProperty(e,t,n){"value"in n&&!1!==n.configurable&&!1!==n.enumerable&&!1!==n.writable||function(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}();var i=r.get(t);return void 0===i?f(()=>{var e=Fn(n.value);return r.set(t,e),e}):Hn(i,n.value,!0),!0},deleteProperty(e,t){var n=r.get(t);if(void 0===n){if(t in e){const e=f(()=>Fn(F));r.set(t,e),Yn(o)}}else Hn(n,F),Yn(o);return!0},get(e,n,i){if(n===R)return t;var o=r.get(n),s=n in e;if(void 0!==o||s&&!a(e,n)?.writable||(o=f(()=>Fn(se(s?e[n]:F))),r.set(n,o)),void 0!==o){var l=yr(o);return l===F?void 0:l}return Reflect.get(e,n,i)},getOwnPropertyDescriptor(e,t){var n=Reflect.getOwnPropertyDescriptor(e,t);if(n&&"value"in n){var i=r.get(t);i&&(n.value=yr(i))}else if(void 0===n){var o=r.get(t),a=o?.v;if(void 0!==o&&a!==F)return{enumerable:!0,configurable:!0,value:a,writable:!0}}return n},has(e,t){if(t===R)return!0;var n=r.get(t),i=void 0!==n&&n.v!==F||Reflect.has(e,t);if((void 0!==n||null!==Qn&&(!i||a(e,t)?.writable))&&(void 0===n&&(n=f(()=>Fn(i?se(e[t]):F)),r.set(t,n)),yr(n)===F))return!1;return i},set(e,t,n,s){var l=r.get(t),c=t in e;if(i&&"length"===t)for(var u=n;u<l.v;u+=1){var d=r.get(u+"");void 0!==d?Hn(d,F):u in e&&(d=f(()=>Fn(F)),r.set(u+"",d))}void 0===l?c&&!a(e,t)?.writable||(Hn(l=f(()=>Fn(void 0)),se(n)),r.set(t,l)):(c=l.v!==F,Hn(l,f(()=>se(n))));var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(s,n),!c){if(i&&"string"==typeof t){var v=r.get("length"),p=Number(t);Number.isInteger(p)&&p>=v.v&&Hn(v,p+1)}Yn(o)}return!0},ownKeys(e){yr(o);var t=Reflect.ownKeys(e).filter(e=>{var t=r.get(e);return void 0===t||t.v!==F});for(var[n,i]of r)i.v===F||n in e||t.push(n);return t},setPrototypeOf(){!function(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}()}})}function le(e){try{if(null!==e&&"object"==typeof e&&R in e)return e[R]}catch{}return e}function ce(e,t){return Object.is(le(e),le(t))}var ue,fe,de,he,ve;function pe(){if(void 0===ue){ue=window,fe=document,de=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;he=a(t,"firstChild").get,ve=a(t,"nextSibling").get,f(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),f(n)&&(n.__t=void 0)}}function ge(e=""){return document.createTextNode(e)}function me(e){return he.call(e)}function ye(e){return ve.call(e)}function be(e,t){if(!Q)return me(e);var n=me(K);if(null===n)n=K.appendChild(ge());else if(t&&3!==n.nodeType){var r=ge();return n?.before(r),te(r),r}return t&&Ee(n),te(n),n}function we(e,t=!1){if(!Q){var n=me(e);return n instanceof Comment&&""===n.data?ye(n):n}if(t){if(3!==K?.nodeType){var r=ge();return K?.before(r),te(r),r}Ee(K)}return K}function _e(e,t=1,n=!1){let r=Q?K:e;for(var i;t--;)i=r,r=ye(r);if(!Q)return r;if(n){if(3!==r?.nodeType){var o=ge();return null===r?i?.after(o):r.before(o),te(o),o}Ee(r)}return te(r),r}function $e(e,t,n){let r;return document.createElementNS(t??q,e,r)}function Ee(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;null!==t&&3===t.nodeType;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Ce(e){var t=Qn;if(null===t)return zn.f|=A,e;if(0===(t.f&C)&&!(4&t.f))throw e;Se(e,t)}function Se(e,t){for(;null!==t;){if(128&t.f){if(0===(t.f&C))throw e;try{return void t.b.error(e)}catch(t){e=t}}t=t.parent}throw e}const ke=-7169;function xe(e,t){e.f=e.f&ke|t}function Ie(e){0!==(e.f&y)||null===e.deps?xe(e,b):xe(e,_)}function Oe(e){if(null!==e)for(const t of e)2&t.f&&0!==(t.f&O)&&(t.f^=O,Oe(t.deps))}function Te(e,t,n){0!==(e.f&w)?t.add(e):0!==(e.f&_)&&n.add(e),Oe(e.deps),xe(e,b)}function Ae(e){return e.endsWith("capture")&&"gotpointercapture"!==e&&"lostpointercapture"!==e}const Re=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Pe(e){return Re.includes(e)}const Le={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Me(e){return e=e.toLowerCase(),Le[e]??e}const Ne=["touchstart","touchmove"];function De(e){return Ne.includes(e)}function Ve(e,t){if(t){const t=document.body;e.autofocus=!0,W(()=>{document.activeElement===t&&e.focus()})}}let je=!1;function Ue(){je||(je=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function Fe(e){var t=zn,n=Qn;Kn(null),er(null);try{return e()}finally{Kn(t),er(n)}}const qe=Symbol("events"),He=new Set,Ge=new Set;function Ye(e,t,n,r={}){function i(e){if(r.capture||ze.call(t,e),!e.cancelBubble)return Fe(()=>n?.call(this,e))}return e.startsWith("pointer")||e.startsWith("touch")||"wheel"===e?W(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function Be(e,t,n,r,i){var o={capture:r,passive:i},a=Ye(e,t,n,o);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Sr(()=>{t.removeEventListener(e,a,o)})}function Je(e,t,n){(t[qe]??={})[e]=n}function Ze(e){for(var t=0;t<e.length;t++)He.add(e[t]);for(var n of Ge)n(e)}let We=null;function ze(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;We=e;var s=0,l=We===e&&e[qe];if(l){var c=i.indexOf(l);if(-1!==c&&(t===document||t===window))return void(e[qe]=t);var u=i.indexOf(t);if(-1===u)return;c<=u&&(s=c)}if((a=i[s]||e.target)!==t){o(e,"currentTarget",{configurable:!0,get:()=>a||n});var f=zn,d=Qn;Kn(null),er(null);try{for(var h,v=[];null!==a;){var p=a.assignedSlot||a.parentNode||a.host||null;try{var g=a[qe]?.[r];null==g||a.disabled&&e.target!==a||g.call(a,e)}catch(e){h?v.push(e):h=e}if(e.cancelBubble||p===t||null===p)break;a=p}if(h){for(let e of v)queueMicrotask(()=>{throw e});throw h}}finally{e[qe]=t,delete e.currentTarget,Kn(f),er(d)}}}const Xe=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function Ke(e){var t=$e("template");return t.innerHTML=function(e){return Xe?.createHTML(e)??e}(e.replaceAll("<!>","\x3c!----\x3e")),t.content}function Qe(e,t){var n=Qn;null===n.nodes&&(n.nodes={start:e,end:t,a:null,t:null})}function et(e,t){var n,r=!!(1&t),i=!!(2&t),o=!e.startsWith("<!>");return()=>{if(Q)return Qe(K,null),K;void 0===n&&(n=Ke(o?e:"<!>"+e),r||(n=me(n)));var t=i||de?document.importNode(n,!0):n.cloneNode(!0);r?Qe(me(t),t.lastChild):Qe(t,t);return t}}function tt(e,t,n="svg"){var r,i=`<${n}>${!e.startsWith("<!>")?e:"<!>"+e}</${n}>`;return()=>{if(Q)return Qe(K,null),K;if(!r){var e=Ke(i);r=me(me(e))}var t=r.cloneNode(!0);return Qe(t,t),t}}function nt(e,t){return tt(e,0,"svg")}function rt(e=""){if(!Q){var t=ge(e+"");return Qe(t,t),t}var n=K;return 3!==n.nodeType?(n.before(n=ge()),te(n)):Ee(n),Qe(n,n),n}function it(){if(Q)return Qe(K,null),K;var e=document.createDocumentFragment(),t=document.createComment(""),n=ge();return e.append(t,n),Qe(t,n),e}function ot(e,t){if(Q){var n=Qn;return 0!==(n.f&C)&&null!==n.nodes.end||(n.nodes.end=K),void ne()}null!==e&&e.before(t)}class at{parent;is_pending=!1;transform_error;#e;#t=Q?K:null;#n;#r;#i;#o=null;#a=null;#s=null;#l=null;#c=0;#u=0;#f=!1;#d=new Set;#h=new Set;#v=null;#p=function(e){let t,n=0,r=Un(0);return()=>{Cr()&&(yr(r),Or(()=>(0===n&&(t=_r(()=>e(()=>Yn(r)))),n+=1,()=>{W(()=>{n-=1,0===n&&(t?.(),t=void 0,Yn(r))})})))}}(()=>(this.#v=Un(this.#c),()=>{this.#v=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=Qn;t.b=this,t.f|=128,n(e)},this.parent=Qn.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=Ar(()=>{if(Q){const e=this.#t;ne();const t="[!"===e.data;if(e.data.startsWith("[?")){const t=JSON.parse(e.data.slice(2));this.#g(t)}else t?this.#m():this.#y()}else this.#b()},589824),Q&&(this.#e=K)}#y(){try{this.#o=Pr(()=>this.#r(this.#e))}catch(e){this.error(e)}}#g(e){const t=this.#n.failed;t&&(this.#s=Pr(()=>{t(this.#e,()=>e,()=>()=>{})}))}#m(){const e=this.#n.pending;if(e){this.is_pending=!0,this.#a=Pr(()=>e(this.#e));var t=wn;W(()=>{var e=this.#l=document.createDocumentFragment(),n=ge();e.append(n),this.#o=this.#w(()=>Pr(()=>this.#r(n))),0===this.#u&&(this.#e.before(e),this.#l=null,jr(this.#a,()=>{this.#a=null}),this.#_(t))})}}#b(){var e=wn;try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#c=0,this.#o=Pr(()=>{this.#r(this.#e)}),this.#u>0){var t=this.#l=document.createDocumentFragment();qr(this.#o,t);const e=this.#n.pending;this.#a=Pr(()=>e(this.#e))}else this.#_(e)}catch(e){this.error(e)}}#_(e){this.is_pending=!1;for(const t of this.#d)xe(t,w),e.schedule(t);for(const t of this.#h)xe(t,_),e.schedule(t);this.#d.clear(),this.#h.clear()}defer_effect(e){Te(e,this.#d,this.#h)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#w(e){var t=Qn,n=zn,r=H;er(this.#i),Kn(this.#i),G(this.#i.ctx);try{return On.ensure(),e()}catch(e){return Ce(e),null}finally{er(t),Kn(n),G(r)}}#$(e,t){this.has_pending_snippet()?(this.#u+=e,0===this.#u&&(this.#_(t),this.#a&&jr(this.#a,()=>{this.#a=null}),this.#l&&(this.#e.before(this.#l),this.#l=null))):this.parent&&this.parent.#$(e,t)}update_pending_count(e,t){this.#$(e,t),this.#c+=e,this.#v&&!this.#f&&(this.#f=!0,W(()=>{this.#f=!1,this.#v&&Gn(this.#v,this.#c)}))}get_effect_pending(){return this.#p(),yr(this.#v)}error(e){var t=this.#n.onerror;let n=this.#n.failed;if(!t&&!n)throw e;this.#o&&(Nr(this.#o),this.#o=null),this.#a&&(Nr(this.#a),this.#a=null),this.#s&&(Nr(this.#s),this.#s=null),Q&&(te(this.#t),ie(),te(oe()));var r=!1,i=!1;const o=()=>{r?console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"):(r=!0,i&&function(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}(),null!==this.#s&&jr(this.#s,()=>{this.#s=null}),this.#w(()=>{this.#b()}))},a=e=>{try{i=!0,t?.(e,o),i=!1}catch(e){Se(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#w(()=>{try{return Pr(()=>{var t=Qn;t.b=this,t.f|=128,n(this.#e,()=>e,()=>o)})}catch(e){return Se(e,this.#i.parent),null}}))};W(()=>{var t;try{t=this.transform_error(e)}catch(e){return void Se(e,this.#i&&this.#i.parent)}null!==t&&"object"==typeof t&&"function"==typeof t.then?t.then(a,e=>Se(e,this.#i&&this.#i.parent)):a(t)})}}function st(e,t){var n=null==t?"":"object"==typeof t?`${t}`:t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=`${n}`)}function lt(e,t){return ft(e,t)}function ct(e,t){pe(),t.intro=t.intro??!1;const n=t.target,r=Q,i=K;try{for(var o=me(n);o&&(8!==o.nodeType||"["!==o.data);)o=ye(o);if(!o)throw U;ee(!0),te(o);const r=ft(e,{...t,anchor:o});return ee(!1),r}catch(r){if(r instanceof Error&&r.message.split("\n").some(e=>e.startsWith("https://svelte.dev/e/")))throw r;return r!==U&&console.warn("Failed to hydrate: ",r),!1===t.recover&&function(){throw new Error("https://svelte.dev/e/hydration_failed")}(),pe(),n.textContent="",ee(!1),lt(e,t)}finally{ee(r),te(i)}}const ut=new Map;function ft(e,{target:t,anchor:n,props:i={},events:o,context:a,intro:s=!0,transformError:l}){pe();var c=void 0,u=function(e){On.ensure();const t=Er(524352,e);return(e={})=>new Promise(n=>{e.outro?jr(t,()=>{Nr(t),n(void 0)}):(Nr(t),n(void 0))})}(()=>{var s=n??t.appendChild(ge());!function(e,t,n,r){new at(e,t,n,r)}(s,{pending:()=>{}},t=>{if(Y({}),a&&(H.c=a),o&&(i.$$events=o),Q&&Qe(t,null),c=e(t,i)||{},Q&&(Qn.nodes.end=K,null===K||8!==K.nodeType||"]"!==K.data))throw X(),U;B()},l);var u=new Set,f=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!u.has(r)){u.add(r);var i=De(r);for(const e of[t,document]){var o=ut.get(e);void 0===o&&(o=new Map,ut.set(e,o));var a=o.get(r);void 0===a?(e.addEventListener(r,ze,{passive:i}),o.set(r,1)):o.set(r,a+1)}}}};return f(r(He)),Ge.add(f),()=>{for(var e of u)for(const n of[t,document]){var r=ut.get(n),i=r.get(e);0==--i?(n.removeEventListener(e,ze),r.delete(e),0===r.size&&ut.delete(n)):r.set(e,i)}Ge.delete(f),s!==n&&s.parentNode?.removeChild(s)}});return dt.set(c,u),c}let dt=new WeakMap;function ht(e){var t=null!==zn&&2&zn.f?zn:null;null!==Qn&&(Qn.f|=I);return{ctx:H,deps:null,effects:null,equals:D,f:2050,fn:e,reactions:null,rv:0,v:F,wv:0,parent:t??Qn,ac:null}}function vt(e,t,n){let r=Qn;null===r&&function(){throw new Error("https://svelte.dev/e/async_derived_orphan")}();var i=void 0,o=Un(F),a=!zn,s=new Map;return function(e){Er(4718592,e)}(()=>{var t=Qn,n=h();i=n.promise;try{Promise.resolve(e()).then(n.resolve,n.reject).finally(wt)}catch(e){n.reject(e),wt()}var l=wn;if(a){if(0!==(t.f&C))var c=_t();if(r.b.is_rendered())s.get(l)?.reject(M),s.delete(l);else{for(const e of s.values())e.reject(M);s.clear()}s.set(l,n)}const u=(e,n=void 0)=>{c&&c(n===M);if(n!==M&&0===(t.f&E)){if(l.activate(),n)o.f|=A,Gn(o,n);else{0!==(o.f&A)&&(o.f^=A),Gn(o,e);for(const[e,t]of s){if(s.delete(e),e===l)break;t.reject(M)}}l.deactivate()}};n.promise.then(u,e=>u(null,e||"unknown"))}),Sr(()=>{for(const e of s.values())e.reject(M)}),new Promise(e=>{!function t(n){function r(){n===i?e(o):t(i)}n.then(r,r)}(i)})}function pt(e){const t=ht(e);return nr(t),t}function gt(e){var t,n=Qn;er(function(e){for(var t=e.parent;null!==t;){if(!(2&t.f))return 0===(t.f&E)?t:null;t=t.parent}return null}(e));try{e.f&=-65537,function(e){var t=e.effects;if(null!==t){e.effects=null;for(var n=0;n<t.length;n+=1)Nr(t[n])}}(e),t=hr(e)}finally{er(n)}return t}function mt(e){var t=gt(e);e.equals(t)||(e.wv=ur(),wn?.is_fork&&null!==e.deps||(e.v=t,null!==e.deps))?Zn||(null!==_n?(Cr()||wn?.is_fork)&&_n.set(e,t):Ie(e)):xe(e,b)}function yt(e){if(null!==e.effects)for(const t of e.effects)t.teardown&&gr(t)}function bt(e,t,n,r){const i=ht;var o=e.filter(e=>!e.settled);if(0!==n.length||0!==o.length){var a,s,l,c,u=Qn,f=(a=Qn,s=zn,l=H,c=wn,function(e=!0){er(a),Kn(s),G(l),e&&0===(a.f&E)&&(c?.activate(),c?.apply())}),d=1===o.length?o[0].promise:o.length>1?Promise.all(o.map(e=>e.promise)):null;if(0!==n.length){var h=_t();d?d.then(()=>{f(),p(),wt()}):p()}else d.then(()=>v(t.map(i)))}else r(t.map(i));function v(e){f();try{r(e)}catch(e){0===(u.f&E)&&Se(e,u)}wt()}function p(){Promise.all(n.map(e=>vt(e))).then(e=>v([...t.map(i),...e])).catch(e=>Se(e,u)).finally(()=>h())}}function wt(e=!0){er(null),Kn(null),G(null),e&&wn?.deactivate()}function _t(){var e=Qn.b,t=wn,n=e.is_rendered();return e.update_pending_count(1,t),t.increment(n),(r=!1)=>{e.update_pending_count(-1,t),t.decrement(n,r)}}class $t{anchor;#E=new Map;#C=new Map;#S=new Map;#k=new Set;#x=!0;constructor(e,t=!0){this.anchor=e,this.#x=t}#I=e=>{if(this.#E.has(e)){var t=this.#E.get(e),n=this.#C.get(t);if(n)Fr(n,!0),this.#k.delete(t);else{var r=this.#S.get(t);r&&(this.#C.set(t,r.effect),this.#S.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(const[t,n]of this.#E){if(this.#E.delete(t),t===e)break;const r=this.#S.get(n);r&&(Nr(r.effect),this.#S.delete(n))}for(const[e,r]of this.#C){if(e===t||this.#k.has(e))continue;const i=()=>{if(Array.from(this.#E.values()).includes(e)){var t=document.createDocumentFragment();qr(r,t),t.append(ge()),this.#S.set(e,{effect:r,fragment:t})}else Nr(r);this.#k.delete(e),this.#C.delete(e)};this.#x||!n?(this.#k.add(e),jr(r,i,!1)):i()}}};#O=e=>{this.#E.delete(e);const t=Array.from(this.#E.values());for(const[e,n]of this.#S)t.includes(e)||(Nr(n.effect),this.#S.delete(e))};ensure(e,t){var n=wn;!t||this.#C.has(e)||this.#S.has(e)||this.#C.set(e,Pr(()=>t(this.anchor)));this.#E.set(n,e),Q&&(this.anchor=K),this.#I(n)}}function Et(e,t,n=!1){var r;Q&&(r=K,ne());var i=new $t(e);function o(e,t){if(Q){var n=ae(r);if(e!==parseInt(n.substring(1))){var o=oe();return te(o),i.anchor=o,ee(!1),i.ensure(e,t),void ee(!0)}}i.ensure(e,t)}Ar(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},n?k:0)}const Ct=Symbol("NaN");function St(e,t,n=!1,r=!1,i=!1,o=!1){var a=e,s="";if(n){var l=e;Q&&(a=te(me(l)))}Tr(()=>{var e=Qn;if(s!==(s=t()??"")){if(n&&!Q)return e.nodes=null,l.innerHTML=s,void(""!==s&&Qe(me(l),l.lastChild));if(null!==e.nodes&&(Dr(e.nodes.start,e.nodes.end),e.nodes=null),""!==s){if(Q){K.data;for(var o=ne(),c=o;null!==o&&(8!==o.nodeType||""!==o.data);)c=o,o=ye(o);if(null===o)throw X(),U;return Qe(K,c),void(a=te(o))}var u=$e(r?"svg":i?"math":"template",r?"http://www.w3.org/2000/svg":i?"http://www.w3.org/1998/Math/MathML":void 0);u.innerHTML=s;var f=r||i?u:u.content;if(Qe(me(f),f.lastChild),r||i)for(;me(f);)a.before(me(f));else a.before(f)}}else Q&&ne()})}function kt(e,t){var n,r=void 0;Rr(()=>{r!==(r=t())&&(n&&(Nr(n),n=null),r&&(n=Pr(()=>{Ir(()=>r(e))})))})}function xt(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=xt(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function It(e){return"object"==typeof e?function(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=xt(e))&&(r&&(r+=" "),r+=t);return r}(e):e??""}const Ot=[..." \t\n\r\f \v\ufeff"];function Tt(e,t=!1){var n=t?" !important;":";",r="";for(var i of Object.keys(e)){var o=e[i];null!=o&&""!==o&&(r+=" "+i+": "+o+n)}return r}function At(e){return"-"!==e[0]||"-"!==e[1]?e.toLowerCase():e}function Rt(e,t,n,r,i,o){var a=e.__className;if(Q||a!==n||void 0===a){var s=function(e,t,n){var r=null==e?"":""+e;if(n)for(var i of Object.keys(n))if(n[i])r=r?r+" "+i:i;else if(r.length)for(var o=i.length,a=0;(a=r.indexOf(i,a))>=0;){var s=a+o;0!==a&&!Ot.includes(r[a-1])||s!==r.length&&!Ot.includes(r[s])?a=s:r=(0===a?"":r.substring(0,a))+r.substring(s+1)}return""===r?null:r}(n,0,o);Q&&s===e.getAttribute("class")||(null==s?e.removeAttribute("class"):t?e.className=s:e.setAttribute("class",s)),e.__className=n}else if(o&&i!==o)for(var l in o){var c=!!o[l];null!=i&&c===!!i[l]||e.classList.toggle(l,c)}return o}function Pt(e,t={},n,r){for(var i in n){var o=n[i];t[i]!==o&&(null==n[i]?e.style.removeProperty(i):e.style.setProperty(i,o,r))}}function Lt(e,t,n,r){var i=e.__style;if(Q||i!==t){var o=function(e,t){if(t){var n,r,i="";if(Array.isArray(t)?(n=t[0],r=t[1]):n=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var o=!1,a=0,s=!1,l=[];n&&l.push(...Object.keys(n).map(At)),r&&l.push(...Object.keys(r).map(At));var c=0,u=-1;const t=e.length;for(var f=0;f<t;f++){var d=e[f];if(s?"/"===d&&"*"===e[f-1]&&(s=!1):o?o===d&&(o=!1):"/"===d&&"*"===e[f+1]?s=!0:'"'===d||"'"===d?o=d:"("===d?a++:")"===d&&a--,!s&&!1===o&&0===a)if(":"===d&&-1===u)u=f;else if(";"===d||f===t-1){if(-1!==u){var h=At(e.substring(c,u).trim());l.includes(h)||(";"!==d&&f++,i+=" "+e.substring(c,f).trim()+";")}c=f+1,u=-1}}}return n&&(i+=Tt(n)),r&&(i+=Tt(r,!0)),""===(i=i.trim())?null:i}return null==e?null:String(e)}(t,r);Q&&o===e.getAttribute("style")||(null==o?e.removeAttribute("style"):e.style.cssText=o),e.__style=t}else r&&(Array.isArray(r)?(Pt(e,n?.[0],r[0]),Pt(e,n?.[1],r[1],"important")):Pt(e,n,r));return r}function Mt(t,n,r=!1){if(t.multiple){if(null==n)return;if(!e(n))return void console.warn("https://svelte.dev/e/select_multiple_invalid_value");for(var i of t.options)i.selected=n.includes(Nt(i))}else{for(i of t.options){if(ce(Nt(i),n))return void(i.selected=!0)}r&&void 0===n||(t.selectedIndex=-1)}}function Nt(e){return"__value"in e?e.__value:e.value}const Dt=Symbol("class"),Vt=Symbol("style"),jt=Symbol("is custom element"),Ut=Symbol("is html"),Ft=N?"link":"LINK",qt=N?"input":"INPUT",Ht=N?"option":"OPTION",Gt=N?"select":"SELECT",Yt=N?"progress":"PROGRESS";function Bt(e){if(Q){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var n=e.value;Zt(e,"value",null),e.value=n}if(e.hasAttribute("checked")){var r=e.checked;Zt(e,"checked",null),e.checked=r}}};e.__on_r=n,W(n),Ue()}}function Jt(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function Zt(e,t,n,r){var i=zt(e);Q&&(i[t]=e.getAttribute(t),"src"===t||"srcset"===t||"href"===t&&e.nodeName===Ft)||i[t]!==(i[t]=n)&&("loading"===t&&(e[L]=n),null==n?e.removeAttribute(t):"string"!=typeof n&&Kt(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Wt(e,t,n=[],r=[],i=[],o,a=!1,s=!1){bt(i,n,r,n=>{var r=void 0,i={},o=e.nodeName===Gt,l=!1;if(Rr(()=>{var c=t(...n.map(yr)),u=function(e,t,n,r,i=!1){if(Q&&i&&e.nodeName===qt){var o=e;("checkbox"===o.type?"defaultChecked":"defaultValue")in n||Bt(o)}var a=zt(e),s=a[jt],l=!a[Ut];let c=Q&&s;c&&ee(!1);var u=t||{},f=e.nodeName===Ht;for(var d in t)d in n||(n[d]=null);n.class?n.class=It(n.class):n[Dt]&&(n.class=null),n[Vt]&&(n.style??=null);var h=Kt(e);for(const r in n){let i=n[r];if(f&&"value"===r&&null==i)e.value=e.__value="",u[r]=i;else if("class"!==r)if("style"!==r){var v=u[r];if(i!==v||void 0===i&&e.hasAttribute(r)){u[r]=i;var p=r[0]+r[1];if("$$"!==p)if("on"===p){const t={},n="$$"+r;let o=r.slice(2);var g=Pe(o);if(Ae(o)&&(o=o.slice(0,-7),t.capture=!0),!g&&v){if(null!=i)continue;e.removeEventListener(o,u[n],t),u[n]=null}if(g)Je(o,e,i),Ze([o]);else if(null!=i){let i=function(e){u[r].call(this,e)};u[n]=Ye(o,e,i,t)}}else if("style"===r)Zt(e,r,i);else if("autofocus"===r)Ve(e,Boolean(i));else if(s||"__value"!==r&&("value"!==r||null==i))if("selected"===r&&f)Jt(e,i);else{var m=r;l||(m=Me(m));var y="defaultValue"===m||"defaultChecked"===m;if(null!=i||s||y)y||h.includes(m)&&(s||"string"!=typeof i)?(e[m]=i,m in a&&(a[m]=F)):"function"!=typeof i&&Zt(e,m,i);else if(a[r]=null,"value"===m||"checked"===m){let n=e;const r=void 0===t;if("value"===m){let e=n.defaultValue;n.removeAttribute(m),n.defaultValue=e,n.value=n.__value=r?e:null}else{let e=n.defaultChecked;n.removeAttribute(m),n.defaultChecked=e,n.checked=!!r&&e}}else e.removeAttribute(r)}else e.value=e.__value=i}}else Lt(e,i,t?.[Vt],n[Vt]),u[r]=i,u[Vt]=n[Vt];else Rt(e,"http://www.w3.org/1999/xhtml"===e.namespaceURI,i,0,t?.[Dt],n[Dt]),u[r]=i,u[Dt]=n[Dt]}return c&&ee(!0),u}(e,r,c,0,a,s);l&&o&&"value"in c&&Mt(e,c.value);for(let e of Object.getOwnPropertySymbols(i))c[e]||Nr(i[e]);for(let t of Object.getOwnPropertySymbols(c)){var f=c[t];"@attach"!==t.description||r&&f===r[t]||(i[t]&&Nr(i[t]),i[t]=Pr(()=>kt(e,()=>f))),u[t]=f}r=u}),o){var c=e;Ir(()=>{Mt(c,r.value,!0),function(e){var t=new MutationObserver(()=>{Mt(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Sr(()=>{t.disconnect()})}(c)})}l=!0})}function zt(e){return e.__attributes??={[jt]:e.nodeName.includes("-"),[Ut]:e.namespaceURI===q}}var Xt=new Map;function Kt(e){var t,n=e.getAttribute("is")||e.nodeName,r=Xt.get(n);if(r)return r;Xt.set(n,r=[]);for(var i=e,o=Element.prototype;o!==i;){for(var a in t=s(i))t[a].set&&r.push(a);i=u(i)}return r}function Qt(e,t,n=t){var r=new WeakSet;!function(e,t,n,r=n){e.addEventListener(t,()=>Fe(n));const i=e.__on_r;e.__on_r=i?()=>{i(),r(!0)}:()=>r(!0),Ue()}(e,"input",async i=>{var o=i?e.defaultValue:e.value;if(o=en(e)?tn(o):o,n(o),null!==wn&&r.add(wn),await mr(),o!==(o=t())){var a=e.selectionStart,s=e.selectionEnd,l=e.value.length;if(e.value=o??"",null!==s){var c=e.value.length;a===s&&s===l&&c>l?(e.selectionStart=c,e.selectionEnd=c):(e.selectionStart=a,e.selectionEnd=Math.min(s,c))}}}),(Q&&e.defaultValue!==e.value||null==_r(t)&&e.value)&&(n(en(e)?tn(e.value):e.value),null!==wn&&r.add(wn)),Or(()=>{var n=t();if(e===document.activeElement){var i=wn;if(r.has(i))return}en(e)&&n===tn(e.value)||("date"!==e.type||n||e.value)&&n!==e.value&&(e.value=n??"")})}function en(e){var t=e.type;return"number"===t||"range"===t}function tn(e){return""===e?null:+e}function nn(e,t){return e===t||e?.[R]===t}function rn(e={},t,n,r){var i=H.r,o=Qn;return Ir(()=>{var r,a;return Or(()=>{r=a,a=[],_r(()=>{e!==n(...a)&&(t(e,...a),r&&nn(n(...r),e)&&t(null,...r))})}),()=>{let r=o;for(;r!==i&&null!==r.parent&&r.parent.f&S;)r=r.parent;const s=r.teardown;r.teardown=()=>{a&&nn(n(...a),e)&&t(null,...a),s?.()}}}),e}const on={get(e,t){if(!e.exclude.includes(t))return e.props[t]},set:(e,t)=>!1,getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t))return t in e.props?{enumerable:!0,configurable:!0,value:e.props[t]}:void 0},has:(e,t)=>!e.exclude.includes(t)&&t in e.props,ownKeys:e=>Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))};function an(e,t,n){return new Proxy({props:e,exclude:t},on)}function sn(e,t,n,r){var i,o=r,a=!0,s=()=>(a&&(a=!1,o=r),o);void 0===e[t]&&void 0!==r&&s(),i=()=>{var n=e[t];return void 0===n?s():(a=!0,n)};var l=!1,c=ht(()=>(l=!1,i())),u=Qn;return function(e,t){if(arguments.length>0){const n=t?yr(c):e;return Hn(c,n),l=!0,void 0!==o&&(o=n),e}return Zn&&l||0!==(u.f&E)?c.v:yr(c)}}class ln{#T;#A;constructor(e){var t=new Map,n=(e,n)=>{var r=qn(n,!1,!1);return t.set(e,r),r};const r=new Proxy({...e.props||{},$$events:{}},{get:(e,r)=>yr(t.get(r)??n(r,Reflect.get(e,r))),has:(e,r)=>r===P||(yr(t.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r)),set:(e,r,i)=>(Hn(t.get(r)??n(r,i),i),Reflect.set(e,r,i))});this.#A=(e.hydrate?ct:lt)(e.component,{target:e.target,anchor:e.anchor,props:r,context:e.context,intro:e.intro??!1,recover:e.recover,transformError:e.transformError}),e?.props?.$$host&&!1!==e.sync||Tn(),this.#T=r.$$events;for(const e of Object.keys(this.#A))"$set"!==e&&"$destroy"!==e&&"$on"!==e&&o(this,e,{get(){return this.#A[e]},set(t){this.#A[e]=t},enumerable:!0});this.#A.$set=e=>{Object.assign(r,e)},this.#A.$destroy=()=>{!function(e,t){const n=dt.get(e);n?(dt.delete(e),n(t)):Promise.resolve()}(this.#A)}}$set(e){this.#A.$set(e)}$on(e,t){this.#T[e]=this.#T[e]||[];const n=(...e)=>t.call(this,...e);return this.#T[e].push(n),()=>{this.#T[e]=this.#T[e].filter(e=>e!==n)}}$destroy(){this.#A.$destroy()}}let cn=class{};function un(e,t,n,r){const i=n[e]?.type;if(t="Boolean"===i&&"boolean"!=typeof t?null!=t:t,!r||!n[e])return t;if("toAttribute"===r)switch(i){case"Object":case"Array":return null==t?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return null==t?null:t;default:return t}else switch(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":default:return t;case"Number":return null!=t?+t:t}}function fn(e,t,n,r,s,l){let c=class extends cn{constructor(){super(e,n,s),this.$$p_d=t}static get observedAttributes(){return i(t).map(e=>(t[e].attribute||e).toLowerCase())}};return i(t).forEach(e=>{o(c.prototype,e,{get(){return this.$$c&&e in this.$$c?this.$$c[e]:this.$$d[e]},set(n){n=un(e,n,t),this.$$d[e]=n;var r=this.$$c;if(r){var i=a(r,e)?.get;i?r[e]=n:r.$set({[e]:n})}}})}),r.forEach(e=>{o(c.prototype,e,{get(){return this.$$c?.[e]}})}),e.element=c,c}function dn(e){null===H&&function(){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}(),kr(()=>{const t=_r(e);if("function"==typeof t)return t})}function hn(e,t,n){if(null==e)return t(void 0),d;const r=_r(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}"function"==typeof HTMLElement&&(cn=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,n){super(),this.$$ctor=e,this.$$s=t,n&&(this.$$shadowRoot=this.attachShadow(n))}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){const e=this.$$l_u.get(t);e&&(e(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(e){return t=>{const n=$e("slot");"default"!==e&&(n.name=e),ot(t,n)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},r=function(e){const t={};return e.childNodes.forEach(e=>{t[e.slot||"default"]=!0}),t}(this);for(const e of this.$$s)e in r&&("default"!==e||this.$$d.children?n[e]=t(e):(this.$$d.children=t(e),n.default=!0));for(const e of this.attributes){const t=this.$$g_p(e.name);t in this.$$d||(this.$$d[t]=un(t,e.value,this.$$p_d,"toProp"))}for(const e in this.$$p_d)e in this.$$d||void 0===this[e]||(this.$$d[e]=this[e],delete this[e]);this.$$c=(e={component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:n,$$host:this}},new ln(e)),this.$$me=function(e){On.ensure();const t=Er(524352,e);return()=>{Nr(t)}}(()=>{Or(()=>{this.$$r=!0;for(const e of i(this.$$c)){if(!this.$$p_d[e]?.reflect)continue;this.$$d[e]=this.$$c[e];const t=un(e,this.$$d[e],this.$$p_d,"toAttribute");null==t?this.removeAttribute(this.$$p_d[e].attribute||e):this.setAttribute(this.$$p_d[e].attribute||e,t)}this.$$r=!1})});for(const e in this.$$l)for(const t of this.$$l[e]){const n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}this.$$l={}}var e}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=un(e,n,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return i(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});const vn=[];function pn(e,t=d){let n=null;const r=new Set;function i(t){if(V(e,t)&&(e=t,n)){const t=!vn.length;for(const t of r)t[1](),vn.push(t,e);if(t){for(let e=0;e<vn.length;e+=2)vn[e][0](vn[e+1]);vn.length=0}}}function o(t){i(t(e))}return{set:i,update:o,subscribe:function(a,s=d){const l=[a,s];return r.add(l),1===r.size&&(n=t(i,o)||d),a(e),()=>{r.delete(l),0===r.size&&n&&(n(),n=null)}}}}function gn(e){let t;return hn(e,e=>t=e)(),t}let mn=Symbol();function yn(e,t,n){const r=n[t]??={store:null,source:qn(void 0),unsubscribe:d};if(r.store!==e&&!(mn in n))if(r.unsubscribe(),r.store=e??null,null==e)r.source.v=void 0,r.unsubscribe=d;else{var i=!0;r.unsubscribe=hn(e,e=>{i?r.source.v=e:Hn(r.source,e)}),i=!1}return e&&mn in n?gn(e):yr(r.source)}const bn=new Set;let wn=null,_n=null,$n=null,En=!1,Cn=!1,Sn=null,kn=null;var xn=0;let In=1;class On{id=In++;current=new Map;previous=new Map;#R=new Set;#P=new Set;#L=0;#M=0;#N=null;#D=[];#d=new Set;#h=new Set;#V=new Map;is_fork=!1;#j=!1;#U(){return this.is_fork||this.#M>0}skip_effect(e){this.#V.has(e)||this.#V.set(e,{d:[],m:[]})}unskip_effect(e){var t=this.#V.get(e);if(t){for(var n of(this.#V.delete(e),t.d))xe(n,w),this.schedule(n);for(n of t.m)xe(n,_),this.schedule(n)}}#F(){xn++>1e3&&function(){try{!function(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}()}catch(e){Se(e,$n)}}();const e=this.#D;this.#D=[],this.apply();var t=Sn=[],n=[],r=kn=[];for(const r of e)this.#q(r,t,n);if(wn=null,r.length>0){var i=On.ensure();for(const e of r)i.schedule(e)}if(Sn=null,kn=null,this.#U()){this.#H(n),this.#H(t);for(const[e,t]of this.#V)Nn(e,t)}else{this.#d.clear(),this.#h.clear();for(const e of this.#R)e(this);this.#R.clear(),Rn(n),Rn(t),0===this.#L&&this.#I(),this.#N?.resolve()}var o=wn;if(this.#D.length>0){const e=o??=this;e.#D.push(...this.#D.filter(t=>!e.#D.includes(t)))}null!==o&&(bn.add(o),o.#F())}#q(e,t,n){e.f^=b;for(var r=e.first;null!==r;){var i=r.f,o=!!(96&i);if(!(o&&0!==(i&b)||0!==(i&$)||this.#V.has(r))&&null!==r.fn){o?r.f^=b:4&i?t.push(r):fr(r)&&(0!==(i&p)&&this.#h.add(r),gr(r));var a=r.first;if(null!==a){r=a;continue}}for(;null!==r;){var s=r.next;if(null!==s){r=s;break}r=r.parent}}}#H(e){for(var t=0;t<e.length;t+=1)Te(e[t],this.#d,this.#h)}capture(e,t){t===F||this.previous.has(e)||this.previous.set(e,t),0===(e.f&A)&&(this.current.set(e,e.v),_n?.set(e,e.v))}activate(){wn=this}deactivate(){wn=null,_n=null}flush(){try{if(Cn=!0,wn=this,!this.#U()){for(const e of this.#d)this.#h.delete(e),xe(e,w),this.schedule(e);for(const e of this.#h)xe(e,_),this.schedule(e)}this.#F()}finally{xn=0,$n=null,Sn=null,kn=null,Cn=!1,wn=null,_n=null,Vn.clear()}}discard(){for(const e of this.#P)e(this);this.#P.clear()}#I(){if(bn.size>1){this.previous.clear();var e=wn,t=_n,n=!0;for(const e of bn){if(e===this){n=!1;continue}const t=[];for(const[r,i]of this.current){if(e.current.has(r)){if(!n||i===e.current.get(r))continue;e.current.set(r,i)}t.push(r)}if(0===t.length)continue;const r=[...e.current.keys()].filter(e=>!this.current.has(e));if(r.length>0){e.activate();const n=new Set,i=new Map;for(const e of t)Pn(e,r,n,i);if(e.#D.length>0){e.apply();for(const t of e.#D)e.#q(t,[],[])}e.deactivate()}}wn=e,_n=t}this.#V.clear(),bn.delete(this)}increment(e){this.#L+=1,e&&(this.#M+=1)}decrement(e,t){this.#L-=1,e&&(this.#M-=1),this.#j||t||(this.#j=!0,W(()=>{this.#j=!1,this.flush()}))}oncommit(e){this.#R.add(e)}ondiscard(e){this.#P.add(e)}settled(){return(this.#N??=h()).promise}static ensure(){if(null===wn){const e=wn=new On;Cn||(bn.add(wn),En||W(()=>{wn===e&&e.flush()}))}return wn}apply(){}schedule(e){if($n=e,e.b?.is_pending&&16777228&e.f&&0===(e.f&C))e.b.defer_effect(e);else{for(var t=e;null!==t.parent;){var n=(t=t.parent).f;if(!(null===Sn||t!==Qn||null!==zn&&2&zn.f))return;if(96&n){if(0===(n&b))return;t.f^=b}}this.#D.push(t)}}}function Tn(e){var t=En;En=!0;try{for(;;){if(z(),null===wn)return;wn.flush()}}finally{En=t}}let An=null;function Rn(e){var t=e.length;if(0!==t){for(var n=0;n<t;){var r=e[n++];if(!(24576&r.f)&&fr(r)&&(An=new Set,gr(r),null===r.deps&&null===r.first&&null===r.nodes&&null===r.teardown&&null===r.ac&&Vr(r),An?.size>0)){Vn.clear();for(const e of An){if(24576&e.f)continue;const t=[e];let n=e.parent;for(;null!==n;)An.has(n)&&(An.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){const n=t[e];24576&n.f||gr(n)}}An.clear()}}An=null}}function Pn(e,t,n,r){if(!n.has(e)&&(n.add(e),null!==e.reactions))for(const i of e.reactions){const e=i.f;2&e?Pn(i,t,n,r):4194320&e&&0===(e&w)&&Ln(i,t,r)&&(xe(i,w),Mn(i))}}function Ln(e,t,r){const i=r.get(e);if(void 0!==i)return i;if(null!==e.deps)for(const i of e.deps){if(n.call(t,i))return!0;if(2&i.f&&Ln(i,t,r))return r.set(i,!0),!0}return r.set(e,!1),!1}function Mn(e){wn.schedule(e)}function Nn(e,t){if(0===(e.f&g)||0===(e.f&b)){0!==(e.f&w)?t.d.push(e):0!==(e.f&_)&&t.m.push(e),xe(e,b);for(var n=e.first;null!==n;)Nn(n,t),n=n.next}}let Dn=new Set;const Vn=new Map;let jn=!1;function Un(e,t){return{f:0,v:e,reactions:null,equals:D,rv:0,wv:0}}function Fn(e,t){const n=Un(e);return nr(n),n}function qn(e,t=!1,n=!0){const r=Un(e);return t||(r.equals=j),r}function Hn(e,t,r=!1){return null===zn||Xn&&0===(zn.f&x)||!(4325394&zn.f)||null!==tr&&n.call(tr,e)||function(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}(),Gn(e,r?se(t):t,kn)}function Gn(e,t,n=null){if(!e.equals(t)){var r=e.v;Zn?Vn.set(e,t):Vn.set(e,r),e.v=t;var i=On.ensure();if(i.capture(e,r),2&e.f){const t=e;0!==(e.f&w)&&gt(t),Ie(t)}e.wv=ur(),Bn(e,w,n),null===Qn||0===(Qn.f&b)||96&Qn.f||(null===or?function(e){or=e}([e]):or.push(e)),!i.is_fork&&Dn.size>0&&!jn&&function(){jn=!1;for(const e of Dn)0!==(e.f&b)&&xe(e,_),fr(e)&&gr(e);Dn.clear()}()}return t}function Yn(e){Hn(e,e.v+1)}function Bn(e,t,n){var r=e.reactions;if(null!==r)for(var i=r.length,o=0;o<i;o++){var a=r[o],s=a.f,l=0===(s&w);if(l&&xe(a,t),2&s){var c=a;_n?.delete(c),0===(s&O)&&(s&y&&(a.f|=O),Bn(c,_,n))}else if(l){var u=a;0!==(s&p)&&null!==An&&An.add(u),null!==n?n.push(u):Mn(u)}}}let Jn=!1,Zn=!1;function Wn(e){Zn=e}let zn=null,Xn=!1;function Kn(e){zn=e}let Qn=null;function er(e){Qn=e}let tr=null;function nr(e){null!==zn&&(null===tr?tr=[e]:tr.push(e))}let rr=null,ir=0,or=null;let ar=1,sr=0,lr=sr;function cr(e){lr=e}function ur(){return++ar}function fr(e){var t=e.f;if(0!==(t&w))return!0;if(2&t&&(e.f&=-65537),0!==(t&_)){for(var n=e.deps,r=n.length,i=0;i<r;i++){var o=n[i];if(fr(o)&&mt(o),o.wv>e.wv)return!0}0!==(t&y)&&null===_n&&xe(e,b)}return!1}function dr(e,t,r=!0){var i=e.reactions;if(null!==i&&(null===tr||!n.call(tr,e)))for(var o=0;o<i.length;o++){var a=i[o];2&a.f?dr(a,t,!1):t===a&&(r?xe(a,w):0!==(a.f&b)&&xe(a,_),Mn(a))}}function hr(e){var t=rr,n=ir,r=or,i=zn,o=tr,a=H,s=Xn,l=lr,c=e.f;rr=null,ir=0,or=null,zn=96&c?null:e,tr=null,G(e.ctx),Xn=!1,lr=++sr,null!==e.ac&&(Fe(()=>{e.ac.abort(M)}),e.ac=null);try{e.f|=T;var u=(0,e.fn)();e.f|=C;var f=e.deps,d=wn?.is_fork;if(null!==rr){var h;if(d||pr(e,ir),null!==f&&ir>0)for(f.length=ir+rr.length,h=0;h<rr.length;h++)f[ir+h]=rr[h];else e.deps=f=rr;if(Cr()&&0!==(e.f&y))for(h=ir;h<f.length;h++)(f[h].reactions??=[]).push(e)}else!d&&null!==f&&ir<f.length&&(pr(e,ir),f.length=ir);if(!(null===or||Xn||null===f||6146&e.f))for(h=0;h<or.length;h++)dr(or[h],e);if(null!==i&&i!==e){if(sr++,null!==i.deps)for(let e=0;e<n;e+=1)i.deps[e].rv=sr;if(null!==t)for(const e of t)e.rv=sr;null!==or&&(null===r?r=or:r.push(...or))}return 0!==(e.f&A)&&(e.f^=A),u}catch(e){return Ce(e)}finally{e.f^=T,rr=t,ir=n,or=r,zn=i,tr=o,G(a),Xn=s,lr=l}}function vr(e,r){let i=r.reactions;if(null!==i){var o=t.call(i,e);if(-1!==o){var a=i.length-1;0===a?i=r.reactions=null:(i[o]=i[a],i.pop())}}if(null===i&&2&r.f&&(null===rr||!n.call(rr,r))){var s=r;0!==(s.f&y)&&(s.f^=y,s.f&=-65537),Ie(s),function(e){if(null!==e.effects)for(const t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(M),t.teardown=d,t.ac=null,pr(t,0),Mr(t))}(s),pr(s,0)}}function pr(e,t){var n=e.deps;if(null!==n)for(var r=t;r<n.length;r++)vr(e,n[r])}function gr(e){var t=e.f;if(0===(t&E)){xe(e,b);var n=Qn,r=Jn;Qn=e,Jn=!0;try{16777232&t?function(e){var t=e.first;for(;null!==t;){var n=t.next;0===(t.f&g)&&Nr(t),t=n}}(e):Mr(e),Lr(e);var i=hr(e);e.teardown="function"==typeof i?i:null,e.wv=ar}finally{Jn=r,Qn=n}}}async function mr(){await Promise.resolve(),Tn()}function yr(e){var t=!!(2&e.f);if(null!==zn&&!Xn&&!(null!==Qn&&0!==(Qn.f&E)||null!==tr&&n.call(tr,e))){var r=zn.deps;if(0!==(zn.f&T))e.rv<sr&&(e.rv=sr,null===rr&&null!==r&&r[ir]===e?ir++:null===rr?rr=[e]:rr.push(e));else{(zn.deps??=[]).push(e);var i=e.reactions;null===i?e.reactions=[zn]:n.call(i,zn)||i.push(zn)}}if(Zn&&Vn.has(e))return Vn.get(e);if(t){var o=e;if(Zn){var a=o.v;return(0===(o.f&b)&&null!==o.reactions||wr(o))&&(a=gt(o)),Vn.set(o,a),a}var s=0===(o.f&y)&&!Xn&&null!==zn&&(Jn||0!==(zn.f&y)),l=0===(o.f&C);fr(o)&&(s&&(o.f|=y),mt(o)),s&&!l&&(yt(o),br(o))}if(_n?.has(e))return _n.get(e);if(0!==(e.f&A))throw e.v;return e.v}function br(e){if(e.f|=y,null!==e.deps)for(const t of e.deps)(t.reactions??=[]).push(e),2&t.f&&0===(t.f&y)&&(yt(t),br(t))}function wr(e){if(e.v===F)return!0;if(null===e.deps)return!1;for(const t of e.deps){if(Vn.has(t))return!0;if(2&t.f&&wr(t))return!0}return!1}function _r(e){var t=Xn;try{return Xn=!0,e()}finally{Xn=t}}function $r(e){null===Qn&&(null===zn&&function(){throw new Error("https://svelte.dev/e/effect_orphan")}(),function(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}()),Zn&&function(){throw new Error("https://svelte.dev/e/effect_in_teardown")}()}function Er(e,t){var n=Qn;null!==n&&0!==(n.f&$)&&(e|=$);var r={ctx:H,deps:null,nodes:null,f:e|w|y,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null},i=r;if(4&e)null!==Sn?Sn.push(r):On.ensure().schedule(r);else if(null!==t){try{gr(r)}catch(e){throw Nr(r),e}null===i.deps&&null===i.teardown&&null===i.nodes&&i.first===i.last&&0===(i.f&I)&&(i=i.first,0!==(e&p)&&0!==(e&k)&&null!==i&&(i.f|=k))}if(null!==i&&(i.parent=n,null!==n&&function(e,t){var n=t.last;null===n?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}(i,n),null!==zn&&2&zn.f&&0===(e&m))){var o=zn;(o.effects??=[]).push(i)}return r}function Cr(){return null!==zn&&!Xn}function Sr(e){const t=Er(8,null);return xe(t,b),t.teardown=e,t}function kr(e){$r();var t=Qn.f;if(!(!zn&&0!==(t&g)&&0===(t&C)))return xr(e);var n=H;(n.e??=[]).push(e)}function xr(e){return Er(1048580,e)}function Ir(e){return Er(4,e)}function Or(e,t=0){return Er(8|t,e)}function Tr(e,t=[],n=[],r=[]){bt(r,t,n,t=>{Er(8,()=>e(...t.map(yr)))})}function Ar(e,t=0){return Er(p|t,e)}function Rr(e,t=0){return Er(v|t,e)}function Pr(e){return Er(524320,e)}function Lr(e){var t=e.teardown;if(null!==t){const e=Zn,n=zn;Wn(!0),Kn(null);try{t.call(null)}finally{Wn(e),Kn(n)}}}function Mr(e,t=!1){var n=e.first;for(e.first=e.last=null;null!==n;){const e=n.ac;null!==e&&Fe(()=>{e.abort(M)});var r=n.next;0!==(n.f&m)?n.parent=null:Nr(n,t),n=r}}function Nr(e,t=!0){var n=!1;(t||262144&e.f)&&null!==e.nodes&&null!==e.nodes.end&&(Dr(e.nodes.start,e.nodes.end),n=!0),xe(e,S),Mr(e,t&&!n),pr(e,0);var r=e.nodes&&e.nodes.t;if(null!==r)for(const e of r)e.stop();Lr(e),e.f^=S,e.f|=E;var i=e.parent;null!==i&&null!==i.first&&Vr(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function Dr(e,t){for(;null!==e;){var n=e===t?null:ye(e);e.remove(),e=n}}function Vr(e){var t=e.parent,n=e.prev,r=e.next;null!==n&&(n.next=r),null!==r&&(r.prev=n),null!==t&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function jr(e,t,n=!0){var r=[];Ur(e,r,!0);var i=()=>{n&&Nr(e),t&&t()},o=r.length;if(o>0){var a=()=>--o||i();for(var s of r)s.out(a)}else i()}function Ur(e,t,n){if(0===(e.f&$)){e.f^=$;var r=e.nodes&&e.nodes.t;if(null!==r)for(const e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;null!==i;){var o=i.next;Ur(i,t,!!(0!==(i.f&k)||0!==(i.f&g)&&0!==(e.f&p))&&n),i=o}}}function Fr(e,t){if(0!==(e.f&$)){e.f^=$,0===(e.f&b)&&(xe(e,w),On.ensure().schedule(e));for(var n=e.first;null!==n;){var r=n.next;Fr(n,!!(0!==(n.f&k)||0!==(n.f&g))&&t),n=r}var i=e.nodes&&e.nodes.t;if(null!==i)for(const e of i)(e.is_global||t)&&e.in()}}function qr(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;null!==n;){var i=n===r?null:ye(n);t.append(n),n=i}}function Hr(e){const t={get:e=>gn(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(gn(t.store),{[e]:n}):Object.assign(gn(t.store),e),t.store.set(gn(t.store))},store:pn(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:Hr({}),i18n:Hr({}),instances:new Set,plugins:new Set};const Gr={ariaLinkLabel:"Altcha (official website)",cancel:"Cancel",enterCode:"Enter code",enterCodeAria:"Enter code you hear. Press Space to play audio.",enterCodeFromImage:"To proceed, please enter the code from the image below.",error:"Verification failed. Try again later.",expired:"Verification expired. Try again.",footer:'Protected by <a href="https://altcha.org/" tabindex="-1" target="_blank" aria-label="Altcha (official website)">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."};"$altcha"in globalThis&&globalThis.$altcha.i18n.set("en",Gr);"undefined"!=typeof window&&((window.__svelte??={}).v??=new Set).add("5");var Yr=et('<div class="altcha-checkbox"><input/> <svg aria-hidden="true" width="12" height="9" viewBox="0 0 12 9"><polyline points="1 5 4 8 11 1"></polyline></svg> <div class="altcha-spinner altcha-checkbox-spinner" aria-hidden="true"></div></div>');function Br(e,t){Y(t,!0);let n,r=sn(t,"loading"),i=an(t,["$$slots","$$events","$$legacy","$$host","loading"]);var o={get loading(){return r()},set loading(e){r(e),Tn()}},a=Yr(),s=be(a);Wt(s,()=>({type:"checkbox",...i}),void 0,void 0,void 0,0,!0),rn(s,e=>n=e,()=>n);var l=_e(s,2);return ie(2),re(a),Tr(()=>Zt(a,"data-loading",r())),Je("click",l,function(){n?.click()}),ot(e,a),B(o)}Ze(["click"]),fn(Br,{loading:{}},[],[],{mode:"open"});var Jr=et('<div class="altcha-checkbox-native"><input/> <div class="altcha-spinner altcha-checkbox-native-spinner"></div></div>');function Zr(e,t){Y(t,!0);let n=sn(t,"loading"),r=an(t,["$$slots","$$events","$$legacy","$$host","loading"]);var i={get loading(){return n()},set loading(e){n(e),Tn()}},o=Jr();return Wt(be(o),()=>({type:"checkbox",...r}),void 0,void 0,void 0,0,!0),ie(2),re(o),Tr(()=>Zt(o,"data-loading",n())),ot(e,o),B(i)}fn(Zr,{loading:{}},[],[],{mode:"open"});var Wr=et('<div><a target="_blank" class="altcha-logo" aria-hidden="true" tabindex="-1"><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>');function zr(e,t){Y(t,!0);let n=sn(t,"strings");var r={get strings(){return n()},set strings(e){n(e),Tn()}},i=Wr(),o=be(i);return Zt(o,"href","https://altcha.org"),re(i),Tr(()=>Zt(o,"aria-label",n().ariaLinkLabel)),ot(e,i),B(r)}fn(zr,{strings:{}},[],[],{mode:"open"});var Xr=et('<div class="altcha-footer"><p></p> <!></div>');function Kr(e,t){Y(t,!0);let n=sn(t,"logo"),r=sn(t,"strings");var i={get logo(){return n()},set logo(e){n(e),Tn()},get strings(){return r()},set strings(e){r(e),Tn()}},o=Xr(),a=be(o);St(a,()=>r().footer,!0),re(a);var s=_e(a,2),l=e=>{zr(e,{get strings(){return r()}})};return Et(s,e=>{n()&&e(l)}),re(o),ot(e,o),B(i)}fn(Kr,{logo:{},strings:{}},[],[],{mode:"open"});var Qr=et('<div class="altcha-switch"><input/> <div class="altcha-switch-toggle"><div class="altcha-spinner altcha-switch-spinner"></div></div></div>');function ei(e,t){Y(t,!0);let n,r=sn(t,"loading"),i=an(t,["$$slots","$$events","$$legacy","$$host","loading"]);var o={get loading(){return r()},set loading(e){r(e),Tn()}},a=Qr(),s=be(a);Wt(s,()=>({type:"checkbox",...i}),void 0,void 0,void 0,0,!0),rn(s,e=>n=e,()=>n);var l=_e(s,2);return re(a),Tr(()=>Zt(a,"data-loading",r())),Je("click",l,function(){n?.click()}),ot(e,a),B(o)}Ze(["click"]),fn(ei,{loading:{}},[],[],{mode:"open"});var ti=(e=>(e.ERROR="error",e.LOADING="loading",e.PLAYING="playing",e.PAUSED="paused",e.READY="ready",e))(ti||{}),ni=(e=>(e.CODE="code",e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(ni||{}),ri=et('<div class="altcha-code-challenge-title"> </div>'),ii=et('<div class="altcha-spinner"></div>'),oi=nt('<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>'),ai=nt('<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>'),si=nt('<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>'),li=et('<button type="button" class="altcha-button altcha-button-secondary"><!></button>'),ci=et('<audio hidden="" autoplay=""></audio>'),ui=et('<div class="altcha-code-challenge"><form data-code-challenge="true"><!> <div class="altcha-code-challenge-text"> </div> <img class="altcha-code-challenge-image" alt=""/> <div class="altcha-code-challenge-row"><input type="text" class="altcha-input" autocomplete="off" name="" required=""/> <!> <button type="button" class="altcha-button altcha-button-secondary"><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> <div class="altcha-code-challenge-buttons"><button type="submit" class="altcha-button"> </button> <button type="button" class="altcha-button altcha-button-secondary"> </button></div></form> <!></div>');function fi(e,t){Y(t,!0);let n=sn(t,"audioUrl"),r=sn(t,"codeChallenge"),i=sn(t,"config"),o=sn(t,"imageUrl"),a=sn(t,"onCancel"),s=sn(t,"onReload"),l=sn(t,"onSubmit"),c=sn(t,"strings"),u=Fn(void 0),f=Fn(void 0),d=Fn(void 0),h=Fn(!1),v=Fn(""),p=Fn(!1);function g(){Hn(u,ti.PAUSED,!0)}function m(e){Hn(u,ti.ERROR,!0)}function y(){Hn(u,ti.READY,!0)}function b(){Hn(u,ti.LOADING,!0)}function w(){Hn(u,ti.PLAYING,!0)}function _(){Hn(u,ti.PAUSED,!0)}function $(){yr(f)?yr(u)===ti.LOADING||(yr(f).paused?(n()&&yr(f).src!==n()&&(yr(f).src=n()),yr(f).currentTime=0,yr(f).play()):yr(f).pause()):(Hn(p,!0),requestAnimationFrame(()=>{yr(f)&&n()&&(yr(f).src=n(),yr(f).play())}))}dn(()=>(i().disableAutoFocus||mr().then(()=>{yr(d)?.focus()}),()=>{yr(f)&&(yr(f).pause(),Hn(f,void 0))}));var E={get audioUrl(){return n()},set audioUrl(e){n(e),Tn()},get codeChallenge(){return r()},set codeChallenge(e){r(e),Tn()},get config(){return i()},set config(e){i(e),Tn()},get imageUrl(){return o()},set imageUrl(e){o(e),Tn()},get onCancel(){return a()},set onCancel(e){a(e),Tn()},get onReload(){return s()},set onReload(e){s(e),Tn()},get onSubmit(){return l()},set onSubmit(e){l(e),Tn()},get strings(){return c()},set strings(e){c(e),Tn()}},C=ui(),S=be(C),k=be(S),x=e=>{var t=ri(),n=be(t,!0);re(t),Tr(()=>st(n,c().verificationRequired)),ot(e,t)};Et(k,e=>{"standard"!==i().codeChallengeDisplay&&e(x)});var I=_e(k,2),O=be(I,!0);re(I);var T=_e(I,2),A=_e(T,2),R=be(A);Bt(R),R.disabled=yr(h),rn(R,e=>Hn(d,e),()=>yr(d));var P=_e(R,2),L=e=>{var t=li(),n=be(t),r=e=>{ot(e,ii())},i=e=>{ot(e,oi())},o=e=>{ot(e,ai())},a=e=>{ot(e,si())};Et(n,e=>{yr(u)===ti.LOADING?e(r):yr(u)===ti.ERROR?e(i,1):yr(u)===ti.PLAYING?e(o,2):e(a,-1)}),re(t),Tr(()=>{Zt(t,"title",c().getAudioChallenge),t.disabled=yr(u)===ti.LOADING||yr(u)===ti.ERROR,Zt(t,"aria-label",yr(u)===ti.LOADING?c().loading:c().getAudioChallenge)}),Be("click",t,()=>$(),!0),ot(e,t)};Et(P,e=>{r().audio&&e(L)});var M=_e(P,2);re(A);var N=_e(A,2),D=be(N),V=be(D,!0);re(D);var j=_e(D,2),U=be(j,!0);re(j),re(N),re(S);var F=_e(S,2),q=e=>{var t=ci();rn(t,e=>Hn(f,e),()=>yr(f)),Be("error",t,m),Be("loadstart",t,b),Be("canplay",t,y),Be("pause",t,_),Be("playing",t,w),Be("ended",t,g),ot(e,t)};return Et(F,e=>{yr(p)&&e(q)}),re(C),Tr(()=>{st(O,c().enterCodeFromImage),Zt(T,"src",o()),Zt(R,"minlength",r().length||1),Zt(R,"maxlength",r().length),Zt(R,"placeholder",c().enterCode),Zt(R,"aria-label",yr(u)===ti.LOADING?c().loading:yr(u)===ti.PLAYING?"":c().enterCodeAria),Zt(R,"aria-live",yr(u)?"assertive":"polite"),Zt(R,"aria-busy",yr(u)===ti.LOADING),Zt(M,"title",c().reload),Zt(M,"aria-label",c().reload),Zt(D,"aria-label",c().verify),st(V,c().verify),Zt(j,"aria-label",c().cancel),st(U,c().cancel)}),Be("submit",S,function(e){e.preventDefault(),e.stopPropagation(),l()?.(yr(v))},!0),Je("keydown",R,function(e){"Space"===e.code?(e.preventDefault(),e.stopPropagation(),$()):"Escape"===e.code&&(e.preventDefault(),e.stopPropagation(),a()?.())}),Qt(R,()=>yr(v),e=>Hn(v,e)),Be("click",M,()=>s()?.(),!0),Be("click",j,()=>a()?.(),!0),ot(e,C),B(E)}Ze(["keydown"]),fn(fi,{audioUrl:{},codeChallenge:{},config:{},imageUrl:{},onCancel:{},onReload:{},onSubmit:{},strings:{}},[],[],{mode:"open"});var di=et('<div class="altcha-popover-backdrop" data-backdrop=""></div>'),hi=et('<div class="altcha-popover-arrow"></div>'),vi=et('<div role="button" class="altcha-popover-close">&times;</div>'),pi=et('<!> <div><!> <!> <div class="altcha-popover-content"><!></div></div>',1);function gi(e,t){Y(t,!0);let n=sn(t,"anchor"),r=sn(t,"children"),i=sn(t,"display",0,"standard"),o=sn(t,"backdrop",0,!1),a=sn(t,"onClickOutside"),s=sn(t,"onClickOutsideDelay",0,600),l=sn(t,"onClose"),c=sn(t,"placement",0,"auto"),u=sn(t,"updateUISignal"),f=sn(t,"variant",0,"neutral"),h=an(t,["$$slots","$$events","$$legacy","$$host","anchor","children","display","backdrop","onClickOutside","onClickOutsideDelay","onClose","placement","updateUISignal","variant"]),v=Fn(void 0),p=Fn(void 0),g=Fn(!1),m=Fn(0);function y(){l()?.()}function b(){if(n()&&"auto"===c()&&yr(v)){const e=n().getBoundingClientRect(),t=document.documentElement.clientHeight-(e.top+e.height)<yr(v).clientHeight;yr(g)!==t&&Hn(g,t)}}kr(()=>{"auto"!==c()&&Hn(g,"top"===c())}),kr(()=>{u()&&b()}),dn(()=>{const e="bottomsheet"===i()||"overlay"===i();return e&&(yr(p)&&document.body.append(yr(p)),yr(v)&&document.body.append(yr(v))),b(),mr().then(()=>{Hn(m,Date.now(),!0)}),()=>{e&&(yr(p)&&document.body.removeChild(yr(p)),yr(v)&&document.body.removeChild(yr(v)))}});var w={get anchor(){return n()},set anchor(e){n(e),Tn()},get children(){return r()},set children(e){r(e),Tn()},get display(){return i()},set display(e="standard"){i(e),Tn()},get backdrop(){return o()},set backdrop(e=!1){o(e),Tn()},get onClickOutside(){return a()},set onClickOutside(e){a(e),Tn()},get onClickOutsideDelay(){return s()},set onClickOutsideDelay(e=600){s(e),Tn()},get onClose(){return l()},set onClose(e){l(e),Tn()},get placement(){return c()},set placement(e="auto"){c(e),Tn()},get updateUISignal(){return u()},set updateUISignal(e){u(e),Tn()},get variant(){return f()},set variant(e="neutral"){f(e),Tn()}},_=pi();Be("click",ue,function(e){const t=e.target;yr(v)?.contains(t)||s()&&!(yr(m)+s()<Date.now())||a()?.()},!0),Be("resize",ue,function(){b()}),Be("scroll",ue,function(){b()});var $=we(_),E=e=>{var t=di();rn(t,e=>Hn(p,e),()=>yr(p)),ot(e,t)};Et($,e=>{o()&&e(E)});var C=_e($,2);Wt(C,()=>({...h,class:`altcha-popover ${(t.class||"")??""}`,"data-popover":!0,"data-variant":f(),"data-top":yr(g),"data-display":i()}));var S=be(C),x=e=>{ot(e,hi())};Et(S,e=>{"standard"===i()&&e(x)});var I=_e(S,2),O=e=>{var t=vi();Be("click",t,y,!0),ot(e,t)};Et(I,e=>{"standard"!==i()&&e(O)});var T=_e(I,2);return function(e,t,...n){var r=new $t(e);Ar(()=>{const e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},k)}(be(T),()=>r()??d),re(T),re(C),rn(C,e=>Hn(v,e),()=>yr(v)),ot(e,_),B(w)}async function mi(e){const{challenge:t,concurrency:n=navigator.hardwareConcurrency,controller:r=new AbortController,createWorker:i,onOutOfMemory:o=e=>e>1?Math.floor(e/2):0,counterMode:a,timeout:s=9e4}=e,l=Math.min(16,Math.max(1,n)),c=[],u=()=>{for(const e of c)e.terminate()};for(let e=0;e<l;e++)c.push(await i(t.parameters.algorithm));let f=null;try{f=await Promise.race(c.map((e,n)=>(r.signal.addEventListener("abort",()=>{e.postMessage({type:"abort"})}),new Promise((r,i)=>{e.addEventListener("error",e=>{i(e)}),e.addEventListener("message",t=>{if(t.data){for(const t of c)t!==e&&t.postMessage({type:"abort"});if(t.data.error)return i(new Error(t.data.error))}r(t.data)}),e.postMessage({challenge:t,counterMode:a,counterStart:n,counterStep:l,timeout:s,type:"work"})}))))}catch(n){if(n instanceof Error&&!!n?.message?.includes("Out of memory")&&o){u();const n=o(l);if(n)return mi({...e,challenge:t,controller:r,concurrency:n,createWorker:i})}throw n}finally{u()}return r.signal.aborted?null:f||null}fn(gi,{anchor:{},children:{},display:{},backdrop:{},onClickOutside:{},onClickOutsideDelay:{},onClose:{},placement:{},updateUISignal:{},variant:{}},[],[],{mode:"open"});class yi{TAG_CODES={INPUT:1,TEXTAREA:2,SELECT:3,BUTTON:4,A:5,DETAILS:6,SUMMARY:7,IFRAME:8,VIDEO:9,AUDIO:10};maxSamples;sampleInterval;target;focusStartTime=0;focusInteraction=0;focusInteractionTimer=null;lastPointerSample=0;lastTouchSample=0;lastScrollSample=0;pendingPointer=null;pendingTouch=null;focus=[];pointer=[];scroll=[];touch=[];constructor(e={}){const{maxSamples:t=60,sampleInterval:n=50,target:r=window}=e;this.maxSamples=t,this.sampleInterval=n,this.target=r,this.attach()}destroy(){const e={capture:!0};this.target.removeEventListener("focusin",this.onFocus,e),this.target.removeEventListener("keydown",this.onInteraction,e),this.target.removeEventListener("pointerdown",this.onInteraction,e),this.target.removeEventListener("pointermove",this.onPointer,e),this.target.removeEventListener("scroll",this.onScroll,e),this.target.removeEventListener("touchmove",this.onTouchMove,e)}export(){return{focus:this.focus,maxTouchPoints:navigator.maxTouchPoints||0,pointer:this.pointer,scroll:this.scroll,time:Date.now(),touch:this.touch}}attach(){const e={passive:!0,capture:!0};this.target.addEventListener("focusin",this.onFocus,e),this.target.addEventListener("keydown",this.onInteraction,e),this.target.addEventListener("pointerdown",this.onInteraction,e),this.target.addEventListener("pointermove",this.onPointer,e),this.target.addEventListener("scroll",this.onScroll,e),this.target.addEventListener("touchmove",this.onTouchMove,e)}evict(e){e.length>this.maxSamples&&e.splice(0,e.length-this.maxSamples)}onFocus=e=>{if(2===this.focusInteraction)return;const t=e.target;if(!(t instanceof Element))return;const n=performance.now();0===this.focusStartTime&&(this.focusStartTime=n),this.focus.push([Math.round(n-this.focusStartTime),t.tabIndex,this.TAG_CODES[t.tagName]??0,this.focusInteraction?1:0]),this.evict(this.focus)};onInteraction=e=>{this.focusInteraction="keyCode"in e?1:2,this.focusInteractionTimer&&clearTimeout(this.focusInteractionTimer),this.focusInteractionTimer=setTimeout(()=>{this.focusInteraction=0},100)};onPointer=e=>{if("touch"===e.pointerType)return;const t=e.timeStamp||performance.now();this.pendingPointer=[Math.round(e.clientX),Math.round(e.clientY),Math.round(t)],t-this.lastPointerSample>=this.sampleInterval&&(this.pointer.push(this.pendingPointer),this.lastPointerSample=t,this.pendingPointer=null,this.evict(this.pointer))};onScroll=()=>{const e=performance.now();e-this.lastScrollSample<this.sampleInterval||(this.scroll.push([Math.round(window.scrollY),Math.round(e)]),this.lastScrollSample=e,this.evict(this.scroll))};onTouchMove=e=>{const t=e.timeStamp||performance.now(),n=e.touches[0];n&&(this.pendingTouch=[Math.round(n.clientX),Math.round(n.clientY),Math.round(t),Math.round(1e3*n.force)/1e3,Math.round(n.radiusX||0),Math.round(n.radiusY||0)],t-this.lastTouchSample>=this.sampleInterval&&(this.touch.push(this.pendingTouch),this.lastTouchSample=t,this.pendingTouch=null,this.evict(this.touch)))}}var bi=et('<div class="altcha-overlay-backdrop" data-backdrop=""></div>'),wi=et('<div class="altcha-overlay-content"></div>'),_i=et('<div role="button" class="altcha-overlay-close">&times;</div> <!>',1),$i=et('<div class="altcha-floating-arrow"></div>'),Ei=et('<input type="hidden"/>'),Ci=et('<div class="altcha-error">Secure context (HTTPS) required.</div>'),Si=et('<div class="altcha-error"> </div>'),ki=et('<div class="altcha-error"> </div>'),xi=et("<!> <!>",1),Ii=et('<!> <div class="altcha"><!> <div class="altcha-main"><div><div class="altcha-checkbox-wrap"><!> <label><!></label></div> <!></div> <!> <!> <!></div> <!></div>',1);"undefined"!=typeof window&&window.customElements&&customElements.define("altcha-widget",fn(function(e,t){Y(t,!0);const[n,r]=function(){const e={};return[e,function(){Sr(()=>{for(var t in e)e[t].unsubscribe();o(e,mn,{enumerable:!1,value:!0})})}]}(),i=["ar","fa","he","ur"],{isSecureContext:a}=globalThis,{store:s}=globalThis.$altcha.defaults,l=navigator.hardwareConcurrency||2,c=navigator.deviceMemory||0,u=c&&c<=4?Math.min(4,l):l,f=globalThis.$altcha.i18n.store,d=t.$$host,h=(e,t)=>{mr().then(()=>{d?.dispatchEvent(new CustomEvent(e,{detail:t}))})};let v=null,p=Fn(se(new URL(location.origin))),g=Fn(!1),m=Fn(null),y=Fn(null),b=Fn(null),w=Fn(se(ni.UNVERIFIED)),_=Fn(void 0),$=Fn(void 0),E=Fn(null),C=Fn(void 0),S=Fn(null),x=Fn(null),I=Fn(null),O=Fn(null),T=Fn(se([])),A=Fn(0),R=Fn(se({})),P=Fn(!0);const L=pt(()=>({fetch:(e,t)=>fetch(e,t),audioChallengeLanguage:"",auto:"off",barPlacement:"bottom",challenge:"",codeChallenge:null,codeChallengeDisplay:"standard",credentials:null,debug:!1,disableAutoFocus:!1,display:"standard",floatingAnchor:"",floatingOffset:8,floatingPersist:!1,floatingPlacement:"auto",hideFooter:!1,hideLogo:!1,humanInteractionSignature:!0,language:"",mockError:!1,minDuration:500,overlayContent:"",name:"altcha",popoverPlacement:"auto",retryOnOutOfMemoryError:!0,setCookie:null,serverVerificationFields:!1,serverVerificationTimeZone:!1,test:!1,timeout:9e4,type:"checkbox",validationMessage:"",verifyFunction:null,verifyUrl:"",workers:u,...yn(s,"$altchaDefaults",n),...yr(R)})),M=pt(()=>`altcha-checkbox-${t.id||Math.floor(1e12*Math.random()).toString(16)}`),N=pt(()=>function(e){switch(e){case"checkbox":return Br;case"switch":return ei;default:return Zr}}(yr(L).type)),D=pt(()=>yr(L).auto),V=pt(()=>yr(w)===ni.VERIFYING),j=pt(()=>!yr(L).hideFooter),U=pt(()=>!yr(L).hideLogo&&"bar"!==yr(L).display),F=pt(()=>function(e,t){const n=Object.keys(e).map(e=>e.toLowerCase());let r=t.reduce((t,r)=>(r=r.toLowerCase(),t||(e[r]?r:null)||n.find(e=>r.split("-")[0]===e.split("-")[0])||null),null);e[r||""]||(r="en");return{language:r,strings:e[r]}}(yn(f,"$altchaI18nStore",n),[yr(L).language,document.documentElement.lang,...navigator.languages])),q=pt(()=>i.includes(yr(F).language)?"rtl":void 0),H=pt(()=>({...yr(F).strings})),G=pt(()=>yr(m)?.audio?.match(/^(https?:)?\//)?le(yr(m).audio,yr(p),{language:yr(L).audioChallengeLanguage||yr(F).language}).toString():yr(m)?.audio),J=pt(()=>yr(m)?.image?.match(/^(https?:)?\//)?le(yr(m).image,yr(p)):yr(m)?.image);async function Z(e,...t){let n;for(const r of yr(T))n=await r[e].call(r,...t);return n}async function W(e){await new Promise(t=>setTimeout(t,e))}async function z(e=yr(L).challenge,t){const n=await Z("onFetchChallenge",e);let r=null;if(void 0!==n)return n;if("string"==typeof e)if(e.match(/^(https?:)?\//)){ke("fetching challenge from",t?.method||"GET",e),Hn(p,new URL(e,location.origin),!0);const n=await yr(L).fetch(e,{credentials:yr(L).credentials||void 0,...t});await $e(n);const i=n.headers.get("x-altcha-config");i&&function(e){try{const t=JSON.parse(e);t&&"object"==typeof t&&Ce({serverVerificationFields:t?.sentinel?.fields,serverVerificationTimeZone:t?.sentinel?.timeZone,verifyUrl:t.verifyurl,...t})}catch(e){ke("unable to configure from x-altcha-config header",e)}}(i);const o=await n.json();if(o&&"his"in o&&o.his){if(ke("requested HIS"),!v)throw new Error("Server requested HIS data but collector is disabled.");return z(le(o.his.url,yr(p)),{body:JSON.stringify({his:v.export()}),headers:{"content-type":"application/json"},method:"POST"})}o&&"hisResult"in o&&o.hisResult&&ke("HIS result",o.hisResult),r=o}else{ke("parsing JSON challenge");try{r=JSON.parse(e)}catch{throw new Error("Unable to parse JSON challenge.")}}else if(e&&"object"==typeof e)try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("Unable to parse JSON challenge.")}if(function(e){return"object"==typeof e&&"challenge"in e}(r)&&(r=function(e){const[t,n]=e.salt.split("?"),r={};if(n)try{Object.assign(r,Object.fromEntries(new URLSearchParams(n).entries()))}catch{}const i={codeChallenge:e.codeChallenge,parameters:{algorithm:e.algorithm,cost:1,data:r,expiresAt:r?.expires?parseInt(r.expires,10):void 0,keyLength:"SHA-512"===e.algorithm?64:"SHA-384"===e.algorithm?48:32,nonce:(o=(new TextEncoder).encode(e.salt),Array.from(new Uint8Array(o)).map(e=>e.toString(16).padStart(2,"0")).join("")),keyPrefix:e.challenge,salt:""},signature:e.signature};var o;return Object.defineProperties(i,{_originalSalt:{enumerable:!1,value:e.salt,writable:!1},_version:{enumerable:!1,value:1,writable:!1}}),i}(r)),!function(e){return!!e&&"object"==typeof e&&"parameters"in e&&!!e.parameters&&"object"==typeof e.parameters&&"algorithm"in e.parameters&&"nonce"in e.parameters&&"salt"in e.parameters&&"keyPrefix"in e.parameters}(r))throw new Error("Challenge validation failed.");return r}function X(){return document.getElementById(yr(M))}function ie(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function le(e,t,n){const r=new URL(e,t);if(r.search||(r.search=t.search),n)for(const e in n)void 0!==n[e]&&null!==n[e]&&r.searchParams.set(e,n[e]);return r.toString()}function ce(e){!yr(g)&&e.currentTarget.checked?(e.preventDefault(),e.currentTarget.checked=!1,yr(w)!==ni.VERIFYING&&Ae()):e.currentTarget.checked||(e.preventDefault(),xe())}function de(e){yr(w)===ni.VERIFYING?e.currentTarget.setCustomValidity(yr(H).waitAlert):yr(L).validationMessage&&e.currentTarget.setCustomValidity(yr(L).validationMessage)}function he(){yr(y)&&yr(y).abort(),ye(yr(L).display),xe()}function ve(e){"onfocus"===yr(D)&&yr(w)===ni.UNVERIFIED&&Ae()}function pe(){yr(y)&&yr(y).abort(),ye(yr(L).display),xe()}function ge(e){Hn(S,e.submitter,!0),"onsubmit"===yr(D)&&yr(w)===ni.UNVERIFIED&&(e.preventDefault(),e.stopPropagation(),Oe(),Ae().then(e=>{e&&!yr(m)&&mr().then(()=>{me(yr(S))})}))}function me(e){yr(E)&&"requestSubmit"in yr(E)?yr(E).requestSubmit(e):yr(E)?.reportValidity()&&(e?e.click():yr(E).submit())}function ye(e){switch(e){case"bar":case"floating":case"overlay":Se(),yr(D)&&"off"!==yr(D)||(yr(R).auto="onsubmit");break;case"standard":Oe()}yr(b)!==e&&Hn(b,e,!0)}async function $e(e){if(e.status>=400){if(e.headers.get("content-type")?.includes("/json")){let t;try{t=await e.json()}catch{}if(t&&"error"in t)throw new Error(`Server responded with ${e.status} - ${t.error}`)}throw new Error(`Server responded with ${e.status}.`)}const t=e.headers.get("content-type");if(!t||!t.includes("/json"))throw new Error(`Server responded with invalid content-type. Expected application/json, received ${t}.`)}async function Ee(e){if(!yr(O))return void Ie(ni.ERROR,"Cannot verify code challenge without PoW payload.");Ie(ni.VERIFYING);let t=null;if(yr(L).verifyUrl)t=await async function(e,t){const n=await Z("onRequestServerVerification",e,t);if(void 0!==n)return n;if(ke("requesting server verification from",yr(L).verifyUrl),!yr(L).verifyUrl)throw new Error("Parameter verifyUrl must be set for server verification.");const r=await yr(L).fetch(le(yr(L).verifyUrl,yr(p)),{body:JSON.stringify({code:t,fields:yr(L).serverVerificationFields?[...yr(E)?.querySelectorAll('input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])')||[]].reduce((e,t)=>{const n=t.name,r=t.value;return n&&r&&(e[n]=/\n/.test(r)?r.replace(new RegExp("(?<!\\r)\\n","g"),"\r\n"):r),e},{}):void 0,payload:e,timeZone:yr(L).serverVerificationTimeZone?ie():void 0}),credentials:yr(L).credentials||void 0,headers:{"Content-Type":"application/json"},method:"POST"});await $e(r);const i=await r.json();return i&&"object"==typeof i&&"payload"in i&&i.payload&&h("serververification",i),i}(yr(O),e);else{if(!yr(L).verifyFunction)return void Ie(ni.ERROR,"Parameter verifyUrl is required for code challenge verification.");t=await yr(L).verifyFunction(yr(O),e)}t?.payload&&(Hn(O,t.payload,!0),ke("server payload",yr(O))),!0===t?.verified?(ke("verified"),Ie(ni.VERIFIED),h("verified",{payload:yr(O)}),"onsubmit"===yr(D)&&mr().then(()=>{me(yr(S))})):Ie(ni.ERROR,t?.reason||"Verification failed."),yr(L).disableAutoFocus||X()?.focus()}function Ce(e){Object.assign(yr(R),{...Object.fromEntries(Object.entries(e).filter(([e,t])=>void 0!==t))})}function Se(){Hn(P,!1)}function ke(...e){(yr(L).debug||e.some(e=>e instanceof Error))&&console[e[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${yr(L).name}]`,...e)}function xe(e=ni.UNVERIFIED,t=null){Hn(g,!1),Hn(x,t,!0),Hn(O,null),yr(I)&&(clearTimeout(yr(I)),Hn(I,null)),Ie(e)}function Ie(e,t=null){Hn(w,e,!0),Hn(x,t,!0),h("statechange",{payload:yr(O),state:yr(w)})}function Oe(){Hn(P,!0),mr().then(()=>{Te()})}function Te(){if("floating"===yr(L).display)return function(e=20){if(!yr(C))return;const t=yr(L).floatingPlacement;if(!yr($)&&(Hn($,(yr(L).floatingAnchor instanceof HTMLElement?yr(L).floatingAnchor:yr(L).floatingAnchor?document.querySelector(yr(L).floatingAnchor):yr(E)?.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||yr(E),!0),!yr($)))return void ke("unable to find floating anchor element");const n=parseInt(yr(L).floatingOffset,10)||12,r=yr($).getBoundingClientRect(),i=yr(C).getBoundingClientRect(),o=document.documentElement.clientHeight,a=document.documentElement.clientWidth,s=t&&"auto"!==t?"top"===t:r.bottom+i.height+n+e>o,l=Math.max(e,Math.min(a-e-i.width,r.left+r.width/2-i.width/2));if(yr(C).style.setProperty("--altcha-floating-left",`${l}px`),yr(C).style.setProperty("--altcha-floating-top",s?r.top-(i.height+n)+"px":`${r.bottom+n}px`),yr(C).setAttribute("data-floating-position",s?"top":"bottom"),yr(_)){const e=yr(_).getBoundingClientRect();yr(_).style.left=r.left-l+r.width/2-e.width/2+"px"}}();Hn(A,yr(A)+1)}async function Ae(e={}){const{concurrency:t=Math.max(1,yr(L).workers),controller:n=new AbortController,minDuration:r=yr(L).minDuration}=e,i=performance.now();let o=null,s=null,l=!1;const c=await Z("onVerify",e);if(void 0!==c)return c;Hn(y,n,!0),xe(ni.VERIFYING);try{if(!a)throw new Error("Secure context (HTTPS) required.");if(yr(L).mockError)throw new Error("Mock error.");if(yr(L).test)return ke("running test mode with null challenge"),await W(Math.max(0,r-(performance.now()-i))),Hn(O,btoa(JSON.stringify({challenge:null,solution:null,test:!0})),!0),ke("verified"),Ie(ni.VERIFIED),h("verified",{payload:yr(O)}),{payload:yr(O)};if(o=await z(),!o)throw new Error("Failed to fetch challenge.");ke("challenge",o),"configuration"in o&&(ke("re-configuring from challenge",o.configuration),Ce(o.configuration)),o.parameters.expiresAt&&function(e){yr(I)&&clearTimeout(yr(I));const t=()=>{yr(w)!==ni.UNVERIFIED?(Hn(g,!1),Ie(ni.EXPIRED)):xe(),h("expired")},n=1e3*e-Date.now();n>=1?Hn(I,setTimeout(t,n),!0):t()}(o.parameters.expiresAt),l="_version"in o&&1===o._version;const e=globalThis.$altcha.algorithms.get(o.parameters.algorithm);if(!e)throw new Error(`Unsupported algorithm ${o.parameters.algorithm}.`);if(s=await mi({challenge:o,concurrency:t,controller:n,createWorker:e,counterMode:l?"string":"uint32",onOutOfMemory:e=>{if(ke("out of memory error received"),h("outofmemory"),yr(L).retryOnOutOfMemoryError&&e>1){const t=Math.floor(e/2);return ke(`retrying with ${t} workers...`),t}},timeout:yr(L).timeout}),yr(y)?.signal.aborted)return xe(),null;if(!s)throw new Error("Failed to find solution.");ke("solution",s),await W(Math.max(0,r-(performance.now()-i))),Hn(m,o.codeChallenge||yr(L).codeChallenge||null,!0),Hn(O,l?btoa(JSON.stringify(function(e,t){return{algorithm:e.parameters.algorithm,challenge:e.parameters.keyPrefix,number:t.counter,salt:"_originalSalt"in e?e._originalSalt:e.parameters.nonce,signature:e.signature,took:t.time||0}}(o,s))):btoa(JSON.stringify({challenge:{parameters:o.parameters,signature:o.signature},solution:s})),!0),yr(m)?(ke("requesting code verification"),Ie(ni.CODE),h("codechallenge",{codeChallenge:yr(m)})):yr(L).verifyUrl?await Ee():(ke("verified"),Ie(ni.VERIFIED),h("verified",{payload:yr(O)}))}catch(e){return ke("verification failed",e),Ie(ni.ERROR,String(e)),null}finally{Hn(y,null)}return{challenge:o,payload:yr(O),solution:s}}kr(()=>{Ce({auto:t.auto,challenge:t.challenge,display:t.display,language:t.language,name:t.name,type:t.type,workers:t.workers})}),kr(()=>{if(t.configuration)try{Ce(JSON.parse(t.configuration))}catch{ke("unable to parse the `configuration` attribute (JSON expected)")}}),kr(()=>{yr(b)!==yr(L).display&&ye(yr(L).display)}),kr(()=>{yr(g)&&yr(w)===ni.VERIFYING&&Hn(g,!1)}),kr(()=>{yr(g)||yr(w)!==ni.VERIFIED||Hn(g,!0)}),kr(()=>{if(!yr(g)){const e=X();e&&e.checked&&(e.checked=!1)}}),kr(()=>{yr(w)===ni.VERIFIED&&X()?.setCustomValidity("")}),kr(()=>{if("onload"===yr(D)){const e=setTimeout(()=>{Ae()},1);return()=>{e&&clearTimeout(e)}}}),kr(()=>{yr(x)&&ke("error:",yr(x))}),kr(()=>{yr(O)&&yr(L).setCookie&&function(e,t={}){const{domain:n,name:r=yr(L).name,maxAge:i,path:o,sameSite:a,secure:s}=t;let l=`${encodeURIComponent(r)}=${encodeURIComponent(e)}`;n&&(l+=`; Domain=${n}`);null!=i&&(l+=`; Max-Age=${i}`);o&&(l+=`; Path=${o}`);a&&(l+=`; SameSite=${a}`);s&&(l+="; Secure");document.cookie=l}(yr(O),yr(L).setCookie)}),dn(()=>(ke("mounted","3.0.5"),d&&globalThis.$altcha.instances.add(d),Hn(E,yr(C)?.closest("form"),!0),yr(E)?.addEventListener("reset",pe),yr(E)?.addEventListener("submit",ge,{capture:!0}),yr(E)?.addEventListener("focusin",ve),function(){Hn(T,[...globalThis.$altcha.plugins].map(e=>new e(d)),!0),ke("activating plugins",yr(T).map(e=>e.constructor.name));for(const e of yr(T))e.activate()}(),yr(L).humanInteractionSignature&&(ke("human interaction signature enabled"),v=new yi),h("load"),a||ke("secure context (HTTPS) required"),()=>{!function(){for(const e of yr(T))e.destroy()}(),d&&globalThis.$altcha.instances.delete(d),yr(I)&&clearTimeout(yr(I)),yr(E)?.removeEventListener("reset",pe),yr(E)?.removeEventListener("submit",ge,{capture:!0}),yr(E)?.removeEventListener("focusin",ve),v?.destroy()}));var Re={configure:Ce,getConfiguration:function(){return{...yr(L)}},getState:function(){return yr(w)},hide:Se,log:ke,reset:xe,setState:Ie,show:Oe,updateUI:Te,verify:Ae},Pe=Ii();Be("scroll",fe,function(){Te()}),Be("click",fe,function(e){const t=e.target;"floating"!==yr(L).display||!t||d?.contains(t)||t.hasAttribute("data-backdrop")||t.closest("[data-popover]")||yr(w)===ni.VERIFIED||yr(L).floatingPersist||Se()}),Be("pageshow",ue,function(){ye(yr(L).display),xe()}),Be("resize",ue,function(){Te()});var Le=we(Pe),Me=e=>{ot(e,bi())};Et(Le,e=>{"overlay"===yr(L).display&&yr(P)&&e(Me)});var Ne=_e(Le,2),De=be(Ne),Ve=e=>{var t=_i(),n=we(t),r=_e(n,2),i=e=>{var t=wi();St(t,()=>document.querySelector(yr(L).overlayContent)?.innerHTML,!0),re(t),ot(e,t)};Et(r,e=>{yr(L).overlayContent&&e(i)}),Be("click",n,he,!0),ot(e,t)};Et(De,e=>{"overlay"===yr(L).display&&yr(P)&&e(Ve)});var je=_e(De,2),Ue=be(je),Fe=be(Ue),qe=be(Fe);{let e=pt(()=>"standard"===yr(L).display&&"onsubmit"!==yr(D)||yr(w)===ni.VERIFYING);!function(e,t,n){var r;Q&&(r=K,ne());var i=new $t(e);Ar(()=>{var e=t()??null;if(Q&&"["===ae(r)!=(null!==e)){var o=oe();return te(o),i.anchor=o,ee(!1),i.ensure(e,e&&(t=>n(t,e))),void ee(!0)}i.ensure(e,e&&(t=>n(t,e)))},k)}(qe,()=>yr(N),(t,n)=>{n(t,{get id(){return yr(M)},name:"",get required(){return yr(e)},get loading(){return yr(V)},get checked(){return yr(g)},onchange:ce,oninvalid:de})})}var He=_e(qe,2),Ge=be(He),Ye=e=>{var t=rt();Tr(()=>st(t,yr(H).verificationRequired)),ot(e,t)},Je=e=>{var t=rt();Tr(()=>st(t,yr(H).verifying)),ot(e,t)},Ze=e=>{var t=rt();Tr(()=>st(t,yr(H).verified)),ot(e,t)},We=e=>{var t=rt();Tr(()=>st(t,yr(H).label)),ot(e,t)};Et(Ge,e=>{yr(w)===ni.CODE&&yr(m)?e(Ye):yr(w)===ni.VERIFYING?e(Je,1):yr(w)===ni.VERIFIED?e(Ze,2):e(We,-1)}),re(He),re(Fe);var ze=_e(Fe,2),Xe=e=>{zr(e,{get strings(){return yr(H)}})};Et(ze,e=>{yr(U)&&e(Xe)}),re(Ue);var Ke=_e(Ue,2),Qe=e=>{{let t=pt(()=>"bar"===yr(L).display&&yr(U));Kr(e,{get logo(){return yr(t)},get strings(){return yr(H)}})}};Et(Ke,e=>{yr(j)&&e(Qe)});var et=_e(Ke,2),tt=e=>{var t=$i();rn(t,e=>Hn(_,e),()=>yr(_)),ot(e,t)};Et(et,e=>{"floating"===yr(L).display&&e(tt)});var nt=_e(et,2),at=e=>{var t=Ei();Bt(t),Tr(()=>{var e,n,r;Zt(t,"name",yr(L).name),e=t,n=yr(O),(r=zt(e)).value!==(r.value=n??void 0)&&(e.value!==n||0===n&&e.nodeName===Yt)&&(e.value=n??"")}),ot(e,t)};Et(nt,e=>{yr(L).setCookie||e(at)}),re(je);var lt=_e(je,2),ct=e=>{gi(e,{get anchor(){return yr(C)},onClickOutside:()=>{a&&xe()},get placement(){return yr(L).popoverPlacement},role:"alert",variant:"error",get dir(){return yr(q)},get updateUISignal(){return yr(A)},children:(e,t)=>{var n=it(),r=we(n),i=e=>{ot(e,Ci())},o=e=>{var t=Si(),n=be(t,!0);re(t),Tr(()=>st(n,yr(H).expired)),ot(e,t)},s=e=>{var t=ki(),n=be(t,!0);re(t),Tr(()=>{Zt(t,"title",yr(x)),st(n,yr(H).error)}),ot(e,t)};Et(r,e=>{yr(x)||a?yr(x)||yr(w)!==ni.EXPIRED?e(s,-1):e(o,1):e(i)}),ot(e,n)},$$slots:{default:!0}})},ut=e=>{var t=it();!function(e,t,n){Q&&ne();var r=new $t(e);Ar(()=>{var e=t();e!=e&&(e=Ct),r.ensure(e,n)})}(we(t),()=>yr(m),e=>{{let t=pt(()=>"standard"!==yr(L).codeChallengeDisplay);gi(e,{get anchor(){return yr(C)},get backdrop(){return yr(t)},get display(){return yr(L).codeChallengeDisplay},onClose:()=>{xe()},get placement(){return yr(L).popoverPlacement},role:"dialog",get"aria-label"(){return yr(H).verificationRequired},get dir(){return yr(q)},get updateUISignal(){return yr(A)},children:(e,t)=>{var n=xi(),r=we(n);fi(r,{get audioUrl(){return yr(G)},get imageUrl(){return yr(J)},onCancel:()=>xe(),onReload:()=>Ae(),onSubmit:e=>Ee(e),get codeChallenge(){return yr(m)},get config(){return yr(L)},get strings(){return yr(H)}});var i=_e(r,2),o=e=>{Kr(e,{get logo(){return yr(U)},get strings(){return yr(H)}})};Et(i,e=>{yr(j)&&"standard"!==yr(L).codeChallengeDisplay&&e(o)}),ot(e,n)},$$slots:{default:!0}})}}),ot(e,t)};Et(lt,e=>{yr(x)||yr(w)===ni.EXPIRED||!a?e(ct):yr(m)&&yr(w)===ni.CODE&&e(ut,1)}),re(Ne),rn(Ne,e=>Hn(C,e),()=>yr(C)),Tr(e=>{Zt(Ne,"data-state",yr(w)),Zt(Ne,"data-display",yr(L).display||void 0),Zt(Ne,"data-placement",e),Zt(Ne,"data-visible",yr(P)||void 0),Zt(Ne,"dir",yr(q)),Zt(He,"for",yr(M)),Ne.dir=Ne.dir},[()=>function(e){switch(e){case"bar":return yr(L).barPlacement||"bottom";case"floating":return yr(L).floatingPlacement||"auto";default:return}}(yr(L).display)]),ot(e,Pe);var ft=B(Re);return r(),ft},{auto:{type:"String"},challenge:{type:"String"},configuration:{type:"String"},display:{type:"String"},language:{type:"String"},name:{type:"String"},theme:{type:"String"},type:{type:"String"},workers:{type:"Number"}},[],["configure","getConfiguration","getState","hide","log","reset","setState","show","updateUI","verify"]));
1
+ var e=Array.isArray,t=Array.prototype.indexOf,n=Array.prototype.includes,r=Array.from,i=Object.keys,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyDescriptors,l=Object.prototype,c=Array.prototype,u=Object.getPrototypeOf,f=Object.isExtensible;const d=()=>{};function h(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}const v=1<<24,p=16,g=32,m=64,y=512,b=1024,w=2048,_=4096,$=8192,E=16384,C=32768,S=1<<25,k=65536,x=1<<17,I=1<<19,O=65536,T=1<<21,A=1<<23,R=Symbol("$state"),P=Symbol("legacy props"),L=Symbol(""),M=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},N=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");function D(e){return e===this.v}function V(e,t){return e!=e?t==t:e!==t||null!==e&&"object"==typeof e||"function"==typeof e}function j(e){return!V(e,this.v)}const U={},F=Symbol(),q="http://www.w3.org/1999/xhtml";let H=null;function G(e){H=e}function Y(e,t=!1,n){H={p:H,i:!1,c:null,e:null,s:e,x:null,r:Qn,l:null}}function B(e){var t=H,n=t.e;if(null!==n)for(var r of(t.e=null,n))xr(r);return void 0!==e&&(t.x=e),t.i=!0,H=t.p,e??{}}let J=[];function Z(){var e=J;J=[],function(e){for(var t=0;t<e.length;t++)e[t]()}(e)}function W(e){if(0===J.length&&!En){var t=J;queueMicrotask(()=>{t===J&&Z()})}J.push(e)}function z(){for(;J.length>0;)Z()}function X(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let K,Q=!1;function ee(e){Q=e}function te(e){if(null===e)throw X(),U;return K=e}function ne(){return te(ye(K))}function re(e){if(Q){if(null!==ye(K))throw X(),U;K=e}}function ie(e=1){if(Q){for(var t=e,n=K;t--;)n=ye(n);K=n}}function oe(e=!0){for(var t=0,n=K;;){if(8===n.nodeType){var r=n.data;if("]"===r){if(0===t)return n;t-=1}else("["===r||"[!"===r||"["===r[0]&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=ye(n);e&&n.remove(),n=i}}function ae(e){if(!e||8!==e.nodeType)throw X(),U;return e.data}function se(t){if("object"!=typeof t||null===t||R in t)return t;const n=u(t);if(n!==l&&n!==c)return t;var r=new Map,i=e(t),o=Fn(0),s=lr,f=e=>{if(lr===s)return e();var t=zn,n=lr;Kn(null),cr(s);var r=e();return Kn(t),cr(n),r};return i&&r.set("length",Fn(t.length)),new Proxy(t,{defineProperty(e,t,n){"value"in n&&!1!==n.configurable&&!1!==n.enumerable&&!1!==n.writable||function(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}();var i=r.get(t);return void 0===i?f(()=>{var e=Fn(n.value);return r.set(t,e),e}):Hn(i,n.value,!0),!0},deleteProperty(e,t){var n=r.get(t);if(void 0===n){if(t in e){const e=f(()=>Fn(F));r.set(t,e),Yn(o)}}else Hn(n,F),Yn(o);return!0},get(e,n,i){if(n===R)return t;var o=r.get(n),s=n in e;if(void 0!==o||s&&!a(e,n)?.writable||(o=f(()=>Fn(se(s?e[n]:F))),r.set(n,o)),void 0!==o){var l=yr(o);return l===F?void 0:l}return Reflect.get(e,n,i)},getOwnPropertyDescriptor(e,t){var n=Reflect.getOwnPropertyDescriptor(e,t);if(n&&"value"in n){var i=r.get(t);i&&(n.value=yr(i))}else if(void 0===n){var o=r.get(t),a=o?.v;if(void 0!==o&&a!==F)return{enumerable:!0,configurable:!0,value:a,writable:!0}}return n},has(e,t){if(t===R)return!0;var n=r.get(t),i=void 0!==n&&n.v!==F||Reflect.has(e,t);if((void 0!==n||null!==Qn&&(!i||a(e,t)?.writable))&&(void 0===n&&(n=f(()=>Fn(i?se(e[t]):F)),r.set(t,n)),yr(n)===F))return!1;return i},set(e,t,n,s){var l=r.get(t),c=t in e;if(i&&"length"===t)for(var u=n;u<l.v;u+=1){var d=r.get(u+"");void 0!==d?Hn(d,F):u in e&&(d=f(()=>Fn(F)),r.set(u+"",d))}void 0===l?c&&!a(e,t)?.writable||(Hn(l=f(()=>Fn(void 0)),se(n)),r.set(t,l)):(c=l.v!==F,Hn(l,f(()=>se(n))));var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(s,n),!c){if(i&&"string"==typeof t){var v=r.get("length"),p=Number(t);Number.isInteger(p)&&p>=v.v&&Hn(v,p+1)}Yn(o)}return!0},ownKeys(e){yr(o);var t=Reflect.ownKeys(e).filter(e=>{var t=r.get(e);return void 0===t||t.v!==F});for(var[n,i]of r)i.v===F||n in e||t.push(n);return t},setPrototypeOf(){!function(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}()}})}function le(e){try{if(null!==e&&"object"==typeof e&&R in e)return e[R]}catch{}return e}function ce(e,t){return Object.is(le(e),le(t))}var ue,fe,de,he,ve;function pe(){if(void 0===ue){ue=window,fe=document,de=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;he=a(t,"firstChild").get,ve=a(t,"nextSibling").get,f(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),f(n)&&(n.__t=void 0)}}function ge(e=""){return document.createTextNode(e)}function me(e){return he.call(e)}function ye(e){return ve.call(e)}function be(e,t){if(!Q)return me(e);var n=me(K);if(null===n)n=K.appendChild(ge());else if(t&&3!==n.nodeType){var r=ge();return n?.before(r),te(r),r}return t&&Ee(n),te(n),n}function we(e,t=!1){if(!Q){var n=me(e);return n instanceof Comment&&""===n.data?ye(n):n}if(t){if(3!==K?.nodeType){var r=ge();return K?.before(r),te(r),r}Ee(K)}return K}function _e(e,t=1,n=!1){let r=Q?K:e;for(var i;t--;)i=r,r=ye(r);if(!Q)return r;if(n){if(3!==r?.nodeType){var o=ge();return null===r?i?.after(o):r.before(o),te(o),o}Ee(r)}return te(r),r}function $e(e,t,n){let r;return document.createElementNS(t??q,e,r)}function Ee(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;null!==t&&3===t.nodeType;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Ce(e){var t=Qn;if(null===t)return zn.f|=A,e;if(0===(t.f&C)&&!(4&t.f))throw e;Se(e,t)}function Se(e,t){for(;null!==t;){if(128&t.f){if(0===(t.f&C))throw e;try{return void t.b.error(e)}catch(t){e=t}}t=t.parent}throw e}const ke=-7169;function xe(e,t){e.f=e.f&ke|t}function Ie(e){0!==(e.f&y)||null===e.deps?xe(e,b):xe(e,_)}function Oe(e){if(null!==e)for(const t of e)2&t.f&&0!==(t.f&O)&&(t.f^=O,Oe(t.deps))}function Te(e,t,n){0!==(e.f&w)?t.add(e):0!==(e.f&_)&&n.add(e),Oe(e.deps),xe(e,b)}function Ae(e){return e.endsWith("capture")&&"gotpointercapture"!==e&&"lostpointercapture"!==e}const Re=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Pe(e){return Re.includes(e)}const Le={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Me(e){return e=e.toLowerCase(),Le[e]??e}const Ne=["touchstart","touchmove"];function De(e){return Ne.includes(e)}function Ve(e,t){if(t){const t=document.body;e.autofocus=!0,W(()=>{document.activeElement===t&&e.focus()})}}let je=!1;function Ue(){je||(je=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function Fe(e){var t=zn,n=Qn;Kn(null),er(null);try{return e()}finally{Kn(t),er(n)}}const qe=Symbol("events"),He=new Set,Ge=new Set;function Ye(e,t,n,r={}){function i(e){if(r.capture||ze.call(t,e),!e.cancelBubble)return Fe(()=>n?.call(this,e))}return e.startsWith("pointer")||e.startsWith("touch")||"wheel"===e?W(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function Be(e,t,n,r,i){var o={capture:r,passive:i},a=Ye(e,t,n,o);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Sr(()=>{t.removeEventListener(e,a,o)})}function Je(e,t,n){(t[qe]??={})[e]=n}function Ze(e){for(var t=0;t<e.length;t++)He.add(e[t]);for(var n of Ge)n(e)}let We=null;function ze(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;We=e;var s=0,l=We===e&&e[qe];if(l){var c=i.indexOf(l);if(-1!==c&&(t===document||t===window))return void(e[qe]=t);var u=i.indexOf(t);if(-1===u)return;c<=u&&(s=c)}if((a=i[s]||e.target)!==t){o(e,"currentTarget",{configurable:!0,get:()=>a||n});var f=zn,d=Qn;Kn(null),er(null);try{for(var h,v=[];null!==a;){var p=a.assignedSlot||a.parentNode||a.host||null;try{var g=a[qe]?.[r];null==g||a.disabled&&e.target!==a||g.call(a,e)}catch(e){h?v.push(e):h=e}if(e.cancelBubble||p===t||null===p)break;a=p}if(h){for(let e of v)queueMicrotask(()=>{throw e});throw h}}finally{e[qe]=t,delete e.currentTarget,Kn(f),er(d)}}}const Xe=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function Ke(e){var t=$e("template");return t.innerHTML=function(e){return Xe?.createHTML(e)??e}(e.replaceAll("<!>","\x3c!----\x3e")),t.content}function Qe(e,t){var n=Qn;null===n.nodes&&(n.nodes={start:e,end:t,a:null,t:null})}function et(e,t){var n,r=!!(1&t),i=!!(2&t),o=!e.startsWith("<!>");return()=>{if(Q)return Qe(K,null),K;void 0===n&&(n=Ke(o?e:"<!>"+e),r||(n=me(n)));var t=i||de?document.importNode(n,!0):n.cloneNode(!0);r?Qe(me(t),t.lastChild):Qe(t,t);return t}}function tt(e,t,n="svg"){var r,i=`<${n}>${!e.startsWith("<!>")?e:"<!>"+e}</${n}>`;return()=>{if(Q)return Qe(K,null),K;if(!r){var e=Ke(i);r=me(me(e))}var t=r.cloneNode(!0);return Qe(t,t),t}}function nt(e,t){return tt(e,0,"svg")}function rt(e=""){if(!Q){var t=ge(e+"");return Qe(t,t),t}var n=K;return 3!==n.nodeType?(n.before(n=ge()),te(n)):Ee(n),Qe(n,n),n}function it(){if(Q)return Qe(K,null),K;var e=document.createDocumentFragment(),t=document.createComment(""),n=ge();return e.append(t,n),Qe(t,n),e}function ot(e,t){if(Q){var n=Qn;return 0!==(n.f&C)&&null!==n.nodes.end||(n.nodes.end=K),void ne()}null!==e&&e.before(t)}class at{parent;is_pending=!1;transform_error;#e;#t=Q?K:null;#n;#r;#i;#o=null;#a=null;#s=null;#l=null;#c=0;#u=0;#f=!1;#d=new Set;#h=new Set;#v=null;#p=function(e){let t,n=0,r=Un(0);return()=>{Cr()&&(yr(r),Or(()=>(0===n&&(t=_r(()=>e(()=>Yn(r)))),n+=1,()=>{W(()=>{n-=1,0===n&&(t?.(),t=void 0,Yn(r))})})))}}(()=>(this.#v=Un(this.#c),()=>{this.#v=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=Qn;t.b=this,t.f|=128,n(e)},this.parent=Qn.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=Ar(()=>{if(Q){const e=this.#t;ne();const t="[!"===e.data;if(e.data.startsWith("[?")){const t=JSON.parse(e.data.slice(2));this.#g(t)}else t?this.#m():this.#y()}else this.#b()},589824),Q&&(this.#e=K)}#y(){try{this.#o=Pr(()=>this.#r(this.#e))}catch(e){this.error(e)}}#g(e){const t=this.#n.failed;t&&(this.#s=Pr(()=>{t(this.#e,()=>e,()=>()=>{})}))}#m(){const e=this.#n.pending;if(e){this.is_pending=!0,this.#a=Pr(()=>e(this.#e));var t=wn;W(()=>{var e=this.#l=document.createDocumentFragment(),n=ge();e.append(n),this.#o=this.#w(()=>Pr(()=>this.#r(n))),0===this.#u&&(this.#e.before(e),this.#l=null,jr(this.#a,()=>{this.#a=null}),this.#_(t))})}}#b(){var e=wn;try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#c=0,this.#o=Pr(()=>{this.#r(this.#e)}),this.#u>0){var t=this.#l=document.createDocumentFragment();qr(this.#o,t);const e=this.#n.pending;this.#a=Pr(()=>e(this.#e))}else this.#_(e)}catch(e){this.error(e)}}#_(e){this.is_pending=!1;for(const t of this.#d)xe(t,w),e.schedule(t);for(const t of this.#h)xe(t,_),e.schedule(t);this.#d.clear(),this.#h.clear()}defer_effect(e){Te(e,this.#d,this.#h)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#w(e){var t=Qn,n=zn,r=H;er(this.#i),Kn(this.#i),G(this.#i.ctx);try{return On.ensure(),e()}catch(e){return Ce(e),null}finally{er(t),Kn(n),G(r)}}#$(e,t){this.has_pending_snippet()?(this.#u+=e,0===this.#u&&(this.#_(t),this.#a&&jr(this.#a,()=>{this.#a=null}),this.#l&&(this.#e.before(this.#l),this.#l=null))):this.parent&&this.parent.#$(e,t)}update_pending_count(e,t){this.#$(e,t),this.#c+=e,this.#v&&!this.#f&&(this.#f=!0,W(()=>{this.#f=!1,this.#v&&Gn(this.#v,this.#c)}))}get_effect_pending(){return this.#p(),yr(this.#v)}error(e){var t=this.#n.onerror;let n=this.#n.failed;if(!t&&!n)throw e;this.#o&&(Nr(this.#o),this.#o=null),this.#a&&(Nr(this.#a),this.#a=null),this.#s&&(Nr(this.#s),this.#s=null),Q&&(te(this.#t),ie(),te(oe()));var r=!1,i=!1;const o=()=>{r?console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"):(r=!0,i&&function(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}(),null!==this.#s&&jr(this.#s,()=>{this.#s=null}),this.#w(()=>{this.#b()}))},a=e=>{try{i=!0,t?.(e,o),i=!1}catch(e){Se(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#w(()=>{try{return Pr(()=>{var t=Qn;t.b=this,t.f|=128,n(this.#e,()=>e,()=>o)})}catch(e){return Se(e,this.#i.parent),null}}))};W(()=>{var t;try{t=this.transform_error(e)}catch(e){return void Se(e,this.#i&&this.#i.parent)}null!==t&&"object"==typeof t&&"function"==typeof t.then?t.then(a,e=>Se(e,this.#i&&this.#i.parent)):a(t)})}}function st(e,t){var n=null==t?"":"object"==typeof t?`${t}`:t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=`${n}`)}function lt(e,t){return ft(e,t)}function ct(e,t){pe(),t.intro=t.intro??!1;const n=t.target,r=Q,i=K;try{for(var o=me(n);o&&(8!==o.nodeType||"["!==o.data);)o=ye(o);if(!o)throw U;ee(!0),te(o);const r=ft(e,{...t,anchor:o});return ee(!1),r}catch(r){if(r instanceof Error&&r.message.split("\n").some(e=>e.startsWith("https://svelte.dev/e/")))throw r;return r!==U&&console.warn("Failed to hydrate: ",r),!1===t.recover&&function(){throw new Error("https://svelte.dev/e/hydration_failed")}(),pe(),n.textContent="",ee(!1),lt(e,t)}finally{ee(r),te(i)}}const ut=new Map;function ft(e,{target:t,anchor:n,props:i={},events:o,context:a,intro:s=!0,transformError:l}){pe();var c=void 0,u=function(e){On.ensure();const t=Er(524352,e);return(e={})=>new Promise(n=>{e.outro?jr(t,()=>{Nr(t),n(void 0)}):(Nr(t),n(void 0))})}(()=>{var s=n??t.appendChild(ge());!function(e,t,n,r){new at(e,t,n,r)}(s,{pending:()=>{}},t=>{if(Y({}),a&&(H.c=a),o&&(i.$$events=o),Q&&Qe(t,null),c=e(t,i)||{},Q&&(Qn.nodes.end=K,null===K||8!==K.nodeType||"]"!==K.data))throw X(),U;B()},l);var u=new Set,f=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!u.has(r)){u.add(r);var i=De(r);for(const e of[t,document]){var o=ut.get(e);void 0===o&&(o=new Map,ut.set(e,o));var a=o.get(r);void 0===a?(e.addEventListener(r,ze,{passive:i}),o.set(r,1)):o.set(r,a+1)}}}};return f(r(He)),Ge.add(f),()=>{for(var e of u)for(const n of[t,document]){var r=ut.get(n),i=r.get(e);0==--i?(n.removeEventListener(e,ze),r.delete(e),0===r.size&&ut.delete(n)):r.set(e,i)}Ge.delete(f),s!==n&&s.parentNode?.removeChild(s)}});return dt.set(c,u),c}let dt=new WeakMap;function ht(e){var t=null!==zn&&2&zn.f?zn:null;null!==Qn&&(Qn.f|=I);return{ctx:H,deps:null,effects:null,equals:D,f:2050,fn:e,reactions:null,rv:0,v:F,wv:0,parent:t??Qn,ac:null}}function vt(e,t,n){let r=Qn;null===r&&function(){throw new Error("https://svelte.dev/e/async_derived_orphan")}();var i=void 0,o=Un(F),a=!zn,s=new Map;return function(e){Er(4718592,e)}(()=>{var t=Qn,n=h();i=n.promise;try{Promise.resolve(e()).then(n.resolve,n.reject).finally(wt)}catch(e){n.reject(e),wt()}var l=wn;if(a){if(0!==(t.f&C))var c=_t();if(r.b.is_rendered())s.get(l)?.reject(M),s.delete(l);else{for(const e of s.values())e.reject(M);s.clear()}s.set(l,n)}const u=(e,n=void 0)=>{c&&c(n===M);if(n!==M&&0===(t.f&E)){if(l.activate(),n)o.f|=A,Gn(o,n);else{0!==(o.f&A)&&(o.f^=A),Gn(o,e);for(const[e,t]of s){if(s.delete(e),e===l)break;t.reject(M)}}l.deactivate()}};n.promise.then(u,e=>u(null,e||"unknown"))}),Sr(()=>{for(const e of s.values())e.reject(M)}),new Promise(e=>{!function t(n){function r(){n===i?e(o):t(i)}n.then(r,r)}(i)})}function pt(e){const t=ht(e);return nr(t),t}function gt(e){var t,n=Qn;er(function(e){for(var t=e.parent;null!==t;){if(!(2&t.f))return 0===(t.f&E)?t:null;t=t.parent}return null}(e));try{e.f&=-65537,function(e){var t=e.effects;if(null!==t){e.effects=null;for(var n=0;n<t.length;n+=1)Nr(t[n])}}(e),t=hr(e)}finally{er(n)}return t}function mt(e){var t=gt(e);e.equals(t)||(e.wv=ur(),wn?.is_fork&&null!==e.deps||(e.v=t,null!==e.deps))?Zn||(null!==_n?(Cr()||wn?.is_fork)&&_n.set(e,t):Ie(e)):xe(e,b)}function yt(e){if(null!==e.effects)for(const t of e.effects)t.teardown&&gr(t)}function bt(e,t,n,r){const i=ht;var o=e.filter(e=>!e.settled);if(0!==n.length||0!==o.length){var a,s,l,c,u=Qn,f=(a=Qn,s=zn,l=H,c=wn,function(e=!0){er(a),Kn(s),G(l),e&&0===(a.f&E)&&(c?.activate(),c?.apply())}),d=1===o.length?o[0].promise:o.length>1?Promise.all(o.map(e=>e.promise)):null;if(0!==n.length){var h=_t();d?d.then(()=>{f(),p(),wt()}):p()}else d.then(()=>v(t.map(i)))}else r(t.map(i));function v(e){f();try{r(e)}catch(e){0===(u.f&E)&&Se(e,u)}wt()}function p(){Promise.all(n.map(e=>vt(e))).then(e=>v([...t.map(i),...e])).catch(e=>Se(e,u)).finally(()=>h())}}function wt(e=!0){er(null),Kn(null),G(null),e&&wn?.deactivate()}function _t(){var e=Qn.b,t=wn,n=e.is_rendered();return e.update_pending_count(1,t),t.increment(n),(r=!1)=>{e.update_pending_count(-1,t),t.decrement(n,r)}}class $t{anchor;#E=new Map;#C=new Map;#S=new Map;#k=new Set;#x=!0;constructor(e,t=!0){this.anchor=e,this.#x=t}#I=e=>{if(this.#E.has(e)){var t=this.#E.get(e),n=this.#C.get(t);if(n)Fr(n,!0),this.#k.delete(t);else{var r=this.#S.get(t);r&&(this.#C.set(t,r.effect),this.#S.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(const[t,n]of this.#E){if(this.#E.delete(t),t===e)break;const r=this.#S.get(n);r&&(Nr(r.effect),this.#S.delete(n))}for(const[e,r]of this.#C){if(e===t||this.#k.has(e))continue;const i=()=>{if(Array.from(this.#E.values()).includes(e)){var t=document.createDocumentFragment();qr(r,t),t.append(ge()),this.#S.set(e,{effect:r,fragment:t})}else Nr(r);this.#k.delete(e),this.#C.delete(e)};this.#x||!n?(this.#k.add(e),jr(r,i,!1)):i()}}};#O=e=>{this.#E.delete(e);const t=Array.from(this.#E.values());for(const[e,n]of this.#S)t.includes(e)||(Nr(n.effect),this.#S.delete(e))};ensure(e,t){var n=wn;!t||this.#C.has(e)||this.#S.has(e)||this.#C.set(e,Pr(()=>t(this.anchor)));this.#E.set(n,e),Q&&(this.anchor=K),this.#I(n)}}function Et(e,t,n=!1){var r;Q&&(r=K,ne());var i=new $t(e);function o(e,t){if(Q){var n=ae(r);if(e!==parseInt(n.substring(1))){var o=oe();return te(o),i.anchor=o,ee(!1),i.ensure(e,t),void ee(!0)}}i.ensure(e,t)}Ar(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},n?k:0)}const Ct=Symbol("NaN");function St(e,t,n=!1,r=!1,i=!1,o=!1){var a=e,s="";if(n){var l=e;Q&&(a=te(me(l)))}Tr(()=>{var e=Qn;if(s!==(s=t()??"")){if(n&&!Q)return e.nodes=null,l.innerHTML=s,void(""!==s&&Qe(me(l),l.lastChild));if(null!==e.nodes&&(Dr(e.nodes.start,e.nodes.end),e.nodes=null),""!==s){if(Q){K.data;for(var o=ne(),c=o;null!==o&&(8!==o.nodeType||""!==o.data);)c=o,o=ye(o);if(null===o)throw X(),U;return Qe(K,c),void(a=te(o))}var u=$e(r?"svg":i?"math":"template",r?"http://www.w3.org/2000/svg":i?"http://www.w3.org/1998/Math/MathML":void 0);u.innerHTML=s;var f=r||i?u:u.content;if(Qe(me(f),f.lastChild),r||i)for(;me(f);)a.before(me(f));else a.before(f)}}else Q&&ne()})}function kt(e,t){var n,r=void 0;Rr(()=>{r!==(r=t())&&(n&&(Nr(n),n=null),r&&(n=Pr(()=>{Ir(()=>r(e))})))})}function xt(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=xt(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function It(e){return"object"==typeof e?function(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=xt(e))&&(r&&(r+=" "),r+=t);return r}(e):e??""}const Ot=[..." \t\n\r\f \v\ufeff"];function Tt(e,t=!1){var n=t?" !important;":";",r="";for(var i of Object.keys(e)){var o=e[i];null!=o&&""!==o&&(r+=" "+i+": "+o+n)}return r}function At(e){return"-"!==e[0]||"-"!==e[1]?e.toLowerCase():e}function Rt(e,t,n,r,i,o){var a=e.__className;if(Q||a!==n||void 0===a){var s=function(e,t,n){var r=null==e?"":""+e;if(n)for(var i of Object.keys(n))if(n[i])r=r?r+" "+i:i;else if(r.length)for(var o=i.length,a=0;(a=r.indexOf(i,a))>=0;){var s=a+o;0!==a&&!Ot.includes(r[a-1])||s!==r.length&&!Ot.includes(r[s])?a=s:r=(0===a?"":r.substring(0,a))+r.substring(s+1)}return""===r?null:r}(n,0,o);Q&&s===e.getAttribute("class")||(null==s?e.removeAttribute("class"):t?e.className=s:e.setAttribute("class",s)),e.__className=n}else if(o&&i!==o)for(var l in o){var c=!!o[l];null!=i&&c===!!i[l]||e.classList.toggle(l,c)}return o}function Pt(e,t={},n,r){for(var i in n){var o=n[i];t[i]!==o&&(null==n[i]?e.style.removeProperty(i):e.style.setProperty(i,o,r))}}function Lt(e,t,n,r){var i=e.__style;if(Q||i!==t){var o=function(e,t){if(t){var n,r,i="";if(Array.isArray(t)?(n=t[0],r=t[1]):n=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var o=!1,a=0,s=!1,l=[];n&&l.push(...Object.keys(n).map(At)),r&&l.push(...Object.keys(r).map(At));var c=0,u=-1;const t=e.length;for(var f=0;f<t;f++){var d=e[f];if(s?"/"===d&&"*"===e[f-1]&&(s=!1):o?o===d&&(o=!1):"/"===d&&"*"===e[f+1]?s=!0:'"'===d||"'"===d?o=d:"("===d?a++:")"===d&&a--,!s&&!1===o&&0===a)if(":"===d&&-1===u)u=f;else if(";"===d||f===t-1){if(-1!==u){var h=At(e.substring(c,u).trim());l.includes(h)||(";"!==d&&f++,i+=" "+e.substring(c,f).trim()+";")}c=f+1,u=-1}}}return n&&(i+=Tt(n)),r&&(i+=Tt(r,!0)),""===(i=i.trim())?null:i}return null==e?null:String(e)}(t,r);Q&&o===e.getAttribute("style")||(null==o?e.removeAttribute("style"):e.style.cssText=o),e.__style=t}else r&&(Array.isArray(r)?(Pt(e,n?.[0],r[0]),Pt(e,n?.[1],r[1],"important")):Pt(e,n,r));return r}function Mt(t,n,r=!1){if(t.multiple){if(null==n)return;if(!e(n))return void console.warn("https://svelte.dev/e/select_multiple_invalid_value");for(var i of t.options)i.selected=n.includes(Nt(i))}else{for(i of t.options){if(ce(Nt(i),n))return void(i.selected=!0)}r&&void 0===n||(t.selectedIndex=-1)}}function Nt(e){return"__value"in e?e.__value:e.value}const Dt=Symbol("class"),Vt=Symbol("style"),jt=Symbol("is custom element"),Ut=Symbol("is html"),Ft=N?"link":"LINK",qt=N?"input":"INPUT",Ht=N?"option":"OPTION",Gt=N?"select":"SELECT",Yt=N?"progress":"PROGRESS";function Bt(e){if(Q){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var n=e.value;Zt(e,"value",null),e.value=n}if(e.hasAttribute("checked")){var r=e.checked;Zt(e,"checked",null),e.checked=r}}};e.__on_r=n,W(n),Ue()}}function Jt(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function Zt(e,t,n,r){var i=zt(e);Q&&(i[t]=e.getAttribute(t),"src"===t||"srcset"===t||"href"===t&&e.nodeName===Ft)||i[t]!==(i[t]=n)&&("loading"===t&&(e[L]=n),null==n?e.removeAttribute(t):"string"!=typeof n&&Kt(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Wt(e,t,n=[],r=[],i=[],o,a=!1,s=!1){bt(i,n,r,n=>{var r=void 0,i={},o=e.nodeName===Gt,l=!1;if(Rr(()=>{var c=t(...n.map(yr)),u=function(e,t,n,r,i=!1){if(Q&&i&&e.nodeName===qt){var o=e;("checkbox"===o.type?"defaultChecked":"defaultValue")in n||Bt(o)}var a=zt(e),s=a[jt],l=!a[Ut];let c=Q&&s;c&&ee(!1);var u=t||{},f=e.nodeName===Ht;for(var d in t)d in n||(n[d]=null);n.class?n.class=It(n.class):n[Dt]&&(n.class=null),n[Vt]&&(n.style??=null);var h=Kt(e);for(const r in n){let i=n[r];if(f&&"value"===r&&null==i)e.value=e.__value="",u[r]=i;else if("class"!==r)if("style"!==r){var v=u[r];if(i!==v||void 0===i&&e.hasAttribute(r)){u[r]=i;var p=r[0]+r[1];if("$$"!==p)if("on"===p){const t={},n="$$"+r;let o=r.slice(2);var g=Pe(o);if(Ae(o)&&(o=o.slice(0,-7),t.capture=!0),!g&&v){if(null!=i)continue;e.removeEventListener(o,u[n],t),u[n]=null}if(g)Je(o,e,i),Ze([o]);else if(null!=i){let i=function(e){u[r].call(this,e)};u[n]=Ye(o,e,i,t)}}else if("style"===r)Zt(e,r,i);else if("autofocus"===r)Ve(e,Boolean(i));else if(s||"__value"!==r&&("value"!==r||null==i))if("selected"===r&&f)Jt(e,i);else{var m=r;l||(m=Me(m));var y="defaultValue"===m||"defaultChecked"===m;if(null!=i||s||y)y||h.includes(m)&&(s||"string"!=typeof i)?(e[m]=i,m in a&&(a[m]=F)):"function"!=typeof i&&Zt(e,m,i);else if(a[r]=null,"value"===m||"checked"===m){let n=e;const r=void 0===t;if("value"===m){let e=n.defaultValue;n.removeAttribute(m),n.defaultValue=e,n.value=n.__value=r?e:null}else{let e=n.defaultChecked;n.removeAttribute(m),n.defaultChecked=e,n.checked=!!r&&e}}else e.removeAttribute(r)}else e.value=e.__value=i}}else Lt(e,i,t?.[Vt],n[Vt]),u[r]=i,u[Vt]=n[Vt];else Rt(e,"http://www.w3.org/1999/xhtml"===e.namespaceURI,i,0,t?.[Dt],n[Dt]),u[r]=i,u[Dt]=n[Dt]}return c&&ee(!0),u}(e,r,c,0,a,s);l&&o&&"value"in c&&Mt(e,c.value);for(let e of Object.getOwnPropertySymbols(i))c[e]||Nr(i[e]);for(let t of Object.getOwnPropertySymbols(c)){var f=c[t];"@attach"!==t.description||r&&f===r[t]||(i[t]&&Nr(i[t]),i[t]=Pr(()=>kt(e,()=>f))),u[t]=f}r=u}),o){var c=e;Ir(()=>{Mt(c,r.value,!0),function(e){var t=new MutationObserver(()=>{Mt(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Sr(()=>{t.disconnect()})}(c)})}l=!0})}function zt(e){return e.__attributes??={[jt]:e.nodeName.includes("-"),[Ut]:e.namespaceURI===q}}var Xt=new Map;function Kt(e){var t,n=e.getAttribute("is")||e.nodeName,r=Xt.get(n);if(r)return r;Xt.set(n,r=[]);for(var i=e,o=Element.prototype;o!==i;){for(var a in t=s(i))t[a].set&&r.push(a);i=u(i)}return r}function Qt(e,t,n=t){var r=new WeakSet;!function(e,t,n,r=n){e.addEventListener(t,()=>Fe(n));const i=e.__on_r;e.__on_r=i?()=>{i(),r(!0)}:()=>r(!0),Ue()}(e,"input",async i=>{var o=i?e.defaultValue:e.value;if(o=en(e)?tn(o):o,n(o),null!==wn&&r.add(wn),await mr(),o!==(o=t())){var a=e.selectionStart,s=e.selectionEnd,l=e.value.length;if(e.value=o??"",null!==s){var c=e.value.length;a===s&&s===l&&c>l?(e.selectionStart=c,e.selectionEnd=c):(e.selectionStart=a,e.selectionEnd=Math.min(s,c))}}}),(Q&&e.defaultValue!==e.value||null==_r(t)&&e.value)&&(n(en(e)?tn(e.value):e.value),null!==wn&&r.add(wn)),Or(()=>{var n=t();if(e===document.activeElement){var i=wn;if(r.has(i))return}en(e)&&n===tn(e.value)||("date"!==e.type||n||e.value)&&n!==e.value&&(e.value=n??"")})}function en(e){var t=e.type;return"number"===t||"range"===t}function tn(e){return""===e?null:+e}function nn(e,t){return e===t||e?.[R]===t}function rn(e={},t,n,r){var i=H.r,o=Qn;return Ir(()=>{var r,a;return Or(()=>{r=a,a=[],_r(()=>{e!==n(...a)&&(t(e,...a),r&&nn(n(...r),e)&&t(null,...r))})}),()=>{let r=o;for(;r!==i&&null!==r.parent&&r.parent.f&S;)r=r.parent;const s=r.teardown;r.teardown=()=>{a&&nn(n(...a),e)&&t(null,...a),s?.()}}}),e}const on={get(e,t){if(!e.exclude.includes(t))return e.props[t]},set:(e,t)=>!1,getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t))return t in e.props?{enumerable:!0,configurable:!0,value:e.props[t]}:void 0},has:(e,t)=>!e.exclude.includes(t)&&t in e.props,ownKeys:e=>Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))};function an(e,t,n){return new Proxy({props:e,exclude:t},on)}function sn(e,t,n,r){var i,o=r,a=!0,s=()=>(a&&(a=!1,o=r),o);void 0===e[t]&&void 0!==r&&s(),i=()=>{var n=e[t];return void 0===n?s():(a=!0,n)};var l=!1,c=ht(()=>(l=!1,i())),u=Qn;return function(e,t){if(arguments.length>0){const n=t?yr(c):e;return Hn(c,n),l=!0,void 0!==o&&(o=n),e}return Zn&&l||0!==(u.f&E)?c.v:yr(c)}}class ln{#T;#A;constructor(e){var t=new Map,n=(e,n)=>{var r=qn(n,!1,!1);return t.set(e,r),r};const r=new Proxy({...e.props||{},$$events:{}},{get:(e,r)=>yr(t.get(r)??n(r,Reflect.get(e,r))),has:(e,r)=>r===P||(yr(t.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r)),set:(e,r,i)=>(Hn(t.get(r)??n(r,i),i),Reflect.set(e,r,i))});this.#A=(e.hydrate?ct:lt)(e.component,{target:e.target,anchor:e.anchor,props:r,context:e.context,intro:e.intro??!1,recover:e.recover,transformError:e.transformError}),e?.props?.$$host&&!1!==e.sync||Tn(),this.#T=r.$$events;for(const e of Object.keys(this.#A))"$set"!==e&&"$destroy"!==e&&"$on"!==e&&o(this,e,{get(){return this.#A[e]},set(t){this.#A[e]=t},enumerable:!0});this.#A.$set=e=>{Object.assign(r,e)},this.#A.$destroy=()=>{!function(e,t){const n=dt.get(e);n?(dt.delete(e),n(t)):Promise.resolve()}(this.#A)}}$set(e){this.#A.$set(e)}$on(e,t){this.#T[e]=this.#T[e]||[];const n=(...e)=>t.call(this,...e);return this.#T[e].push(n),()=>{this.#T[e]=this.#T[e].filter(e=>e!==n)}}$destroy(){this.#A.$destroy()}}let cn=class{};function un(e,t,n,r){const i=n[e]?.type;if(t="Boolean"===i&&"boolean"!=typeof t?null!=t:t,!r||!n[e])return t;if("toAttribute"===r)switch(i){case"Object":case"Array":return null==t?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return null==t?null:t;default:return t}else switch(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":default:return t;case"Number":return null!=t?+t:t}}function fn(e,t,n,r,s,l){let c=class extends cn{constructor(){super(e,n,s),this.$$p_d=t}static get observedAttributes(){return i(t).map(e=>(t[e].attribute||e).toLowerCase())}};return i(t).forEach(e=>{o(c.prototype,e,{get(){return this.$$c&&e in this.$$c?this.$$c[e]:this.$$d[e]},set(n){n=un(e,n,t),this.$$d[e]=n;var r=this.$$c;if(r){var i=a(r,e)?.get;i?r[e]=n:r.$set({[e]:n})}}})}),r.forEach(e=>{o(c.prototype,e,{get(){return this.$$c?.[e]}})}),e.element=c,c}function dn(e){null===H&&function(){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}(),kr(()=>{const t=_r(e);if("function"==typeof t)return t})}function hn(e,t,n){if(null==e)return t(void 0),d;const r=_r(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}"function"==typeof HTMLElement&&(cn=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,n){super(),this.$$ctor=e,this.$$s=t,n&&(this.$$shadowRoot=this.attachShadow(n))}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){const e=this.$$l_u.get(t);e&&(e(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(e){return t=>{const n=$e("slot");"default"!==e&&(n.name=e),ot(t,n)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},r=function(e){const t={};return e.childNodes.forEach(e=>{t[e.slot||"default"]=!0}),t}(this);for(const e of this.$$s)e in r&&("default"!==e||this.$$d.children?n[e]=t(e):(this.$$d.children=t(e),n.default=!0));for(const e of this.attributes){const t=this.$$g_p(e.name);t in this.$$d||(this.$$d[t]=un(t,e.value,this.$$p_d,"toProp"))}for(const e in this.$$p_d)e in this.$$d||void 0===this[e]||(this.$$d[e]=this[e],delete this[e]);this.$$c=(e={component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:n,$$host:this}},new ln(e)),this.$$me=function(e){On.ensure();const t=Er(524352,e);return()=>{Nr(t)}}(()=>{Or(()=>{this.$$r=!0;for(const e of i(this.$$c)){if(!this.$$p_d[e]?.reflect)continue;this.$$d[e]=this.$$c[e];const t=un(e,this.$$d[e],this.$$p_d,"toAttribute");null==t?this.removeAttribute(this.$$p_d[e].attribute||e):this.setAttribute(this.$$p_d[e].attribute||e,t)}this.$$r=!1})});for(const e in this.$$l)for(const t of this.$$l[e]){const n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}this.$$l={}}var e}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=un(e,n,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return i(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});const vn=[];function pn(e,t=d){let n=null;const r=new Set;function i(t){if(V(e,t)&&(e=t,n)){const t=!vn.length;for(const t of r)t[1](),vn.push(t,e);if(t){for(let e=0;e<vn.length;e+=2)vn[e][0](vn[e+1]);vn.length=0}}}function o(t){i(t(e))}return{set:i,update:o,subscribe:function(a,s=d){const l=[a,s];return r.add(l),1===r.size&&(n=t(i,o)||d),a(e),()=>{r.delete(l),0===r.size&&n&&(n(),n=null)}}}}function gn(e){let t;return hn(e,e=>t=e)(),t}let mn=Symbol();function yn(e,t,n){const r=n[t]??={store:null,source:qn(void 0),unsubscribe:d};if(r.store!==e&&!(mn in n))if(r.unsubscribe(),r.store=e??null,null==e)r.source.v=void 0,r.unsubscribe=d;else{var i=!0;r.unsubscribe=hn(e,e=>{i?r.source.v=e:Hn(r.source,e)}),i=!1}return e&&mn in n?gn(e):yr(r.source)}const bn=new Set;let wn=null,_n=null,$n=null,En=!1,Cn=!1,Sn=null,kn=null;var xn=0;let In=1;class On{id=In++;current=new Map;previous=new Map;#R=new Set;#P=new Set;#L=0;#M=0;#N=null;#D=[];#d=new Set;#h=new Set;#V=new Map;is_fork=!1;#j=!1;#U(){return this.is_fork||this.#M>0}skip_effect(e){this.#V.has(e)||this.#V.set(e,{d:[],m:[]})}unskip_effect(e){var t=this.#V.get(e);if(t){for(var n of(this.#V.delete(e),t.d))xe(n,w),this.schedule(n);for(n of t.m)xe(n,_),this.schedule(n)}}#F(){xn++>1e3&&function(){try{!function(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}()}catch(e){Se(e,$n)}}();const e=this.#D;this.#D=[],this.apply();var t=Sn=[],n=[],r=kn=[];for(const r of e)this.#q(r,t,n);if(wn=null,r.length>0){var i=On.ensure();for(const e of r)i.schedule(e)}if(Sn=null,kn=null,this.#U()){this.#H(n),this.#H(t);for(const[e,t]of this.#V)Nn(e,t)}else{this.#d.clear(),this.#h.clear();for(const e of this.#R)e(this);this.#R.clear(),Rn(n),Rn(t),0===this.#L&&this.#I(),this.#N?.resolve()}var o=wn;if(this.#D.length>0){const e=o??=this;e.#D.push(...this.#D.filter(t=>!e.#D.includes(t)))}null!==o&&(bn.add(o),o.#F())}#q(e,t,n){e.f^=b;for(var r=e.first;null!==r;){var i=r.f,o=!!(96&i);if(!(o&&0!==(i&b)||0!==(i&$)||this.#V.has(r))&&null!==r.fn){o?r.f^=b:4&i?t.push(r):fr(r)&&(0!==(i&p)&&this.#h.add(r),gr(r));var a=r.first;if(null!==a){r=a;continue}}for(;null!==r;){var s=r.next;if(null!==s){r=s;break}r=r.parent}}}#H(e){for(var t=0;t<e.length;t+=1)Te(e[t],this.#d,this.#h)}capture(e,t){t===F||this.previous.has(e)||this.previous.set(e,t),0===(e.f&A)&&(this.current.set(e,e.v),_n?.set(e,e.v))}activate(){wn=this}deactivate(){wn=null,_n=null}flush(){try{if(Cn=!0,wn=this,!this.#U()){for(const e of this.#d)this.#h.delete(e),xe(e,w),this.schedule(e);for(const e of this.#h)xe(e,_),this.schedule(e)}this.#F()}finally{xn=0,$n=null,Sn=null,kn=null,Cn=!1,wn=null,_n=null,Vn.clear()}}discard(){for(const e of this.#P)e(this);this.#P.clear()}#I(){if(bn.size>1){this.previous.clear();var e=wn,t=_n,n=!0;for(const e of bn){if(e===this){n=!1;continue}const t=[];for(const[r,i]of this.current){if(e.current.has(r)){if(!n||i===e.current.get(r))continue;e.current.set(r,i)}t.push(r)}if(0===t.length)continue;const r=[...e.current.keys()].filter(e=>!this.current.has(e));if(r.length>0){e.activate();const n=new Set,i=new Map;for(const e of t)Pn(e,r,n,i);if(e.#D.length>0){e.apply();for(const t of e.#D)e.#q(t,[],[])}e.deactivate()}}wn=e,_n=t}this.#V.clear(),bn.delete(this)}increment(e){this.#L+=1,e&&(this.#M+=1)}decrement(e,t){this.#L-=1,e&&(this.#M-=1),this.#j||t||(this.#j=!0,W(()=>{this.#j=!1,this.flush()}))}oncommit(e){this.#R.add(e)}ondiscard(e){this.#P.add(e)}settled(){return(this.#N??=h()).promise}static ensure(){if(null===wn){const e=wn=new On;Cn||(bn.add(wn),En||W(()=>{wn===e&&e.flush()}))}return wn}apply(){}schedule(e){if($n=e,e.b?.is_pending&&16777228&e.f&&0===(e.f&C))e.b.defer_effect(e);else{for(var t=e;null!==t.parent;){var n=(t=t.parent).f;if(!(null===Sn||t!==Qn||null!==zn&&2&zn.f))return;if(96&n){if(0===(n&b))return;t.f^=b}}this.#D.push(t)}}}function Tn(e){var t=En;En=!0;try{for(;;){if(z(),null===wn)return;wn.flush()}}finally{En=t}}let An=null;function Rn(e){var t=e.length;if(0!==t){for(var n=0;n<t;){var r=e[n++];if(!(24576&r.f)&&fr(r)&&(An=new Set,gr(r),null===r.deps&&null===r.first&&null===r.nodes&&null===r.teardown&&null===r.ac&&Vr(r),An?.size>0)){Vn.clear();for(const e of An){if(24576&e.f)continue;const t=[e];let n=e.parent;for(;null!==n;)An.has(n)&&(An.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){const n=t[e];24576&n.f||gr(n)}}An.clear()}}An=null}}function Pn(e,t,n,r){if(!n.has(e)&&(n.add(e),null!==e.reactions))for(const i of e.reactions){const e=i.f;2&e?Pn(i,t,n,r):4194320&e&&0===(e&w)&&Ln(i,t,r)&&(xe(i,w),Mn(i))}}function Ln(e,t,r){const i=r.get(e);if(void 0!==i)return i;if(null!==e.deps)for(const i of e.deps){if(n.call(t,i))return!0;if(2&i.f&&Ln(i,t,r))return r.set(i,!0),!0}return r.set(e,!1),!1}function Mn(e){wn.schedule(e)}function Nn(e,t){if(0===(e.f&g)||0===(e.f&b)){0!==(e.f&w)?t.d.push(e):0!==(e.f&_)&&t.m.push(e),xe(e,b);for(var n=e.first;null!==n;)Nn(n,t),n=n.next}}let Dn=new Set;const Vn=new Map;let jn=!1;function Un(e,t){return{f:0,v:e,reactions:null,equals:D,rv:0,wv:0}}function Fn(e,t){const n=Un(e);return nr(n),n}function qn(e,t=!1,n=!0){const r=Un(e);return t||(r.equals=j),r}function Hn(e,t,r=!1){return null===zn||Xn&&0===(zn.f&x)||!(4325394&zn.f)||null!==tr&&n.call(tr,e)||function(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}(),Gn(e,r?se(t):t,kn)}function Gn(e,t,n=null){if(!e.equals(t)){var r=e.v;Zn?Vn.set(e,t):Vn.set(e,r),e.v=t;var i=On.ensure();if(i.capture(e,r),2&e.f){const t=e;0!==(e.f&w)&&gt(t),Ie(t)}e.wv=ur(),Bn(e,w,n),null===Qn||0===(Qn.f&b)||96&Qn.f||(null===or?function(e){or=e}([e]):or.push(e)),!i.is_fork&&Dn.size>0&&!jn&&function(){jn=!1;for(const e of Dn)0!==(e.f&b)&&xe(e,_),fr(e)&&gr(e);Dn.clear()}()}return t}function Yn(e){Hn(e,e.v+1)}function Bn(e,t,n){var r=e.reactions;if(null!==r)for(var i=r.length,o=0;o<i;o++){var a=r[o],s=a.f,l=0===(s&w);if(l&&xe(a,t),2&s){var c=a;_n?.delete(c),0===(s&O)&&(s&y&&(a.f|=O),Bn(c,_,n))}else if(l){var u=a;0!==(s&p)&&null!==An&&An.add(u),null!==n?n.push(u):Mn(u)}}}let Jn=!1,Zn=!1;function Wn(e){Zn=e}let zn=null,Xn=!1;function Kn(e){zn=e}let Qn=null;function er(e){Qn=e}let tr=null;function nr(e){null!==zn&&(null===tr?tr=[e]:tr.push(e))}let rr=null,ir=0,or=null;let ar=1,sr=0,lr=sr;function cr(e){lr=e}function ur(){return++ar}function fr(e){var t=e.f;if(0!==(t&w))return!0;if(2&t&&(e.f&=-65537),0!==(t&_)){for(var n=e.deps,r=n.length,i=0;i<r;i++){var o=n[i];if(fr(o)&&mt(o),o.wv>e.wv)return!0}0!==(t&y)&&null===_n&&xe(e,b)}return!1}function dr(e,t,r=!0){var i=e.reactions;if(null!==i&&(null===tr||!n.call(tr,e)))for(var o=0;o<i.length;o++){var a=i[o];2&a.f?dr(a,t,!1):t===a&&(r?xe(a,w):0!==(a.f&b)&&xe(a,_),Mn(a))}}function hr(e){var t=rr,n=ir,r=or,i=zn,o=tr,a=H,s=Xn,l=lr,c=e.f;rr=null,ir=0,or=null,zn=96&c?null:e,tr=null,G(e.ctx),Xn=!1,lr=++sr,null!==e.ac&&(Fe(()=>{e.ac.abort(M)}),e.ac=null);try{e.f|=T;var u=(0,e.fn)();e.f|=C;var f=e.deps,d=wn?.is_fork;if(null!==rr){var h;if(d||pr(e,ir),null!==f&&ir>0)for(f.length=ir+rr.length,h=0;h<rr.length;h++)f[ir+h]=rr[h];else e.deps=f=rr;if(Cr()&&0!==(e.f&y))for(h=ir;h<f.length;h++)(f[h].reactions??=[]).push(e)}else!d&&null!==f&&ir<f.length&&(pr(e,ir),f.length=ir);if(!(null===or||Xn||null===f||6146&e.f))for(h=0;h<or.length;h++)dr(or[h],e);if(null!==i&&i!==e){if(sr++,null!==i.deps)for(let e=0;e<n;e+=1)i.deps[e].rv=sr;if(null!==t)for(const e of t)e.rv=sr;null!==or&&(null===r?r=or:r.push(...or))}return 0!==(e.f&A)&&(e.f^=A),u}catch(e){return Ce(e)}finally{e.f^=T,rr=t,ir=n,or=r,zn=i,tr=o,G(a),Xn=s,lr=l}}function vr(e,r){let i=r.reactions;if(null!==i){var o=t.call(i,e);if(-1!==o){var a=i.length-1;0===a?i=r.reactions=null:(i[o]=i[a],i.pop())}}if(null===i&&2&r.f&&(null===rr||!n.call(rr,r))){var s=r;0!==(s.f&y)&&(s.f^=y,s.f&=-65537),Ie(s),function(e){if(null!==e.effects)for(const t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(M),t.teardown=d,t.ac=null,pr(t,0),Mr(t))}(s),pr(s,0)}}function pr(e,t){var n=e.deps;if(null!==n)for(var r=t;r<n.length;r++)vr(e,n[r])}function gr(e){var t=e.f;if(0===(t&E)){xe(e,b);var n=Qn,r=Jn;Qn=e,Jn=!0;try{16777232&t?function(e){var t=e.first;for(;null!==t;){var n=t.next;0===(t.f&g)&&Nr(t),t=n}}(e):Mr(e),Lr(e);var i=hr(e);e.teardown="function"==typeof i?i:null,e.wv=ar}finally{Jn=r,Qn=n}}}async function mr(){await Promise.resolve(),Tn()}function yr(e){var t=!!(2&e.f);if(null!==zn&&!Xn&&!(null!==Qn&&0!==(Qn.f&E)||null!==tr&&n.call(tr,e))){var r=zn.deps;if(0!==(zn.f&T))e.rv<sr&&(e.rv=sr,null===rr&&null!==r&&r[ir]===e?ir++:null===rr?rr=[e]:rr.push(e));else{(zn.deps??=[]).push(e);var i=e.reactions;null===i?e.reactions=[zn]:n.call(i,zn)||i.push(zn)}}if(Zn&&Vn.has(e))return Vn.get(e);if(t){var o=e;if(Zn){var a=o.v;return(0===(o.f&b)&&null!==o.reactions||wr(o))&&(a=gt(o)),Vn.set(o,a),a}var s=0===(o.f&y)&&!Xn&&null!==zn&&(Jn||0!==(zn.f&y)),l=0===(o.f&C);fr(o)&&(s&&(o.f|=y),mt(o)),s&&!l&&(yt(o),br(o))}if(_n?.has(e))return _n.get(e);if(0!==(e.f&A))throw e.v;return e.v}function br(e){if(e.f|=y,null!==e.deps)for(const t of e.deps)(t.reactions??=[]).push(e),2&t.f&&0===(t.f&y)&&(yt(t),br(t))}function wr(e){if(e.v===F)return!0;if(null===e.deps)return!1;for(const t of e.deps){if(Vn.has(t))return!0;if(2&t.f&&wr(t))return!0}return!1}function _r(e){var t=Xn;try{return Xn=!0,e()}finally{Xn=t}}function $r(e){null===Qn&&(null===zn&&function(){throw new Error("https://svelte.dev/e/effect_orphan")}(),function(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}()),Zn&&function(){throw new Error("https://svelte.dev/e/effect_in_teardown")}()}function Er(e,t){var n=Qn;null!==n&&0!==(n.f&$)&&(e|=$);var r={ctx:H,deps:null,nodes:null,f:e|w|y,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null},i=r;if(4&e)null!==Sn?Sn.push(r):On.ensure().schedule(r);else if(null!==t){try{gr(r)}catch(e){throw Nr(r),e}null===i.deps&&null===i.teardown&&null===i.nodes&&i.first===i.last&&0===(i.f&I)&&(i=i.first,0!==(e&p)&&0!==(e&k)&&null!==i&&(i.f|=k))}if(null!==i&&(i.parent=n,null!==n&&function(e,t){var n=t.last;null===n?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}(i,n),null!==zn&&2&zn.f&&0===(e&m))){var o=zn;(o.effects??=[]).push(i)}return r}function Cr(){return null!==zn&&!Xn}function Sr(e){const t=Er(8,null);return xe(t,b),t.teardown=e,t}function kr(e){$r();var t=Qn.f;if(!(!zn&&0!==(t&g)&&0===(t&C)))return xr(e);var n=H;(n.e??=[]).push(e)}function xr(e){return Er(1048580,e)}function Ir(e){return Er(4,e)}function Or(e,t=0){return Er(8|t,e)}function Tr(e,t=[],n=[],r=[]){bt(r,t,n,t=>{Er(8,()=>e(...t.map(yr)))})}function Ar(e,t=0){return Er(p|t,e)}function Rr(e,t=0){return Er(v|t,e)}function Pr(e){return Er(524320,e)}function Lr(e){var t=e.teardown;if(null!==t){const e=Zn,n=zn;Wn(!0),Kn(null);try{t.call(null)}finally{Wn(e),Kn(n)}}}function Mr(e,t=!1){var n=e.first;for(e.first=e.last=null;null!==n;){const e=n.ac;null!==e&&Fe(()=>{e.abort(M)});var r=n.next;0!==(n.f&m)?n.parent=null:Nr(n,t),n=r}}function Nr(e,t=!0){var n=!1;(t||262144&e.f)&&null!==e.nodes&&null!==e.nodes.end&&(Dr(e.nodes.start,e.nodes.end),n=!0),xe(e,S),Mr(e,t&&!n),pr(e,0);var r=e.nodes&&e.nodes.t;if(null!==r)for(const e of r)e.stop();Lr(e),e.f^=S,e.f|=E;var i=e.parent;null!==i&&null!==i.first&&Vr(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function Dr(e,t){for(;null!==e;){var n=e===t?null:ye(e);e.remove(),e=n}}function Vr(e){var t=e.parent,n=e.prev,r=e.next;null!==n&&(n.next=r),null!==r&&(r.prev=n),null!==t&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function jr(e,t,n=!0){var r=[];Ur(e,r,!0);var i=()=>{n&&Nr(e),t&&t()},o=r.length;if(o>0){var a=()=>--o||i();for(var s of r)s.out(a)}else i()}function Ur(e,t,n){if(0===(e.f&$)){e.f^=$;var r=e.nodes&&e.nodes.t;if(null!==r)for(const e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;null!==i;){var o=i.next;Ur(i,t,!!(0!==(i.f&k)||0!==(i.f&g)&&0!==(e.f&p))&&n),i=o}}}function Fr(e,t){if(0!==(e.f&$)){e.f^=$,0===(e.f&b)&&(xe(e,w),On.ensure().schedule(e));for(var n=e.first;null!==n;){var r=n.next;Fr(n,!!(0!==(n.f&k)||0!==(n.f&g))&&t),n=r}var i=e.nodes&&e.nodes.t;if(null!==i)for(const e of i)(e.is_global||t)&&e.in()}}function qr(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;null!==n;){var i=n===r?null:ye(n);t.append(n),n=i}}function Hr(e){const t={get:e=>gn(t.store)[e],set:(e,n)=>{"string"==typeof e?Object.assign(gn(t.store),{[e]:n}):Object.assign(gn(t.store),e),t.store.set(gn(t.store))},store:pn(e)};return t}globalThis.$altcha=globalThis.$altcha||{algorithms:new Map,defaults:Hr({}),i18n:Hr({}),instances:new Set,plugins:new Set};const Gr={ariaLinkLabel:"Altcha (official website)",cancel:"Cancel",enterCode:"Enter code",enterCodeAria:"Enter code you hear. Press Space to play audio.",enterCodeFromImage:"To proceed, please enter the code from the image below.",error:"Verification failed. Try again later.",expired:"Verification expired. Try again.",footer:'Protected by <a href="https://altcha.org/" tabindex="-1" target="_blank" aria-label="Altcha (official website)">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."};"$altcha"in globalThis&&globalThis.$altcha.i18n.set("en",Gr);"undefined"!=typeof window&&((window.__svelte??={}).v??=new Set).add("5");var Yr=et('<div class="altcha-checkbox"><input/> <svg aria-hidden="true" width="12" height="9" viewBox="0 0 12 9"><polyline points="1 5 4 8 11 1"></polyline></svg> <div class="altcha-spinner altcha-checkbox-spinner" aria-hidden="true"></div></div>');function Br(e,t){Y(t,!0);let n,r=sn(t,"loading"),i=an(t,["$$slots","$$events","$$legacy","$$host","loading"]);var o={get loading(){return r()},set loading(e){r(e),Tn()}},a=Yr(),s=be(a);Wt(s,()=>({type:"checkbox",...i}),void 0,void 0,void 0,0,!0),rn(s,e=>n=e,()=>n);var l=_e(s,2);return ie(2),re(a),Tr(()=>Zt(a,"data-loading",r())),Je("click",l,function(){n?.click()}),ot(e,a),B(o)}Ze(["click"]),fn(Br,{loading:{}},[],[],{mode:"open"});var Jr=et('<div class="altcha-checkbox-native"><input/> <div class="altcha-spinner altcha-checkbox-native-spinner"></div></div>');function Zr(e,t){Y(t,!0);let n=sn(t,"loading"),r=an(t,["$$slots","$$events","$$legacy","$$host","loading"]);var i={get loading(){return n()},set loading(e){n(e),Tn()}},o=Jr();return Wt(be(o),()=>({type:"checkbox",...r}),void 0,void 0,void 0,0,!0),ie(2),re(o),Tr(()=>Zt(o,"data-loading",n())),ot(e,o),B(i)}fn(Zr,{loading:{}},[],[],{mode:"open"});var Wr=et('<div><a target="_blank" class="altcha-logo" aria-hidden="true" tabindex="-1"><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>');function zr(e,t){Y(t,!0);let n=sn(t,"strings");var r={get strings(){return n()},set strings(e){n(e),Tn()}},i=Wr(),o=be(i);return Zt(o,"href","https://altcha.org"),re(i),Tr(()=>Zt(o,"aria-label",n().ariaLinkLabel)),ot(e,i),B(r)}fn(zr,{strings:{}},[],[],{mode:"open"});var Xr=et('<div class="altcha-footer"><p></p> <!></div>');function Kr(e,t){Y(t,!0);let n=sn(t,"logo"),r=sn(t,"strings");var i={get logo(){return n()},set logo(e){n(e),Tn()},get strings(){return r()},set strings(e){r(e),Tn()}},o=Xr(),a=be(o);St(a,()=>r().footer,!0),re(a);var s=_e(a,2),l=e=>{zr(e,{get strings(){return r()}})};return Et(s,e=>{n()&&e(l)}),re(o),ot(e,o),B(i)}fn(Kr,{logo:{},strings:{}},[],[],{mode:"open"});var Qr=et('<div class="altcha-switch"><input/> <div class="altcha-switch-toggle"><div class="altcha-spinner altcha-switch-spinner"></div></div></div>');function ei(e,t){Y(t,!0);let n,r=sn(t,"loading"),i=an(t,["$$slots","$$events","$$legacy","$$host","loading"]);var o={get loading(){return r()},set loading(e){r(e),Tn()}},a=Qr(),s=be(a);Wt(s,()=>({type:"checkbox",...i}),void 0,void 0,void 0,0,!0),rn(s,e=>n=e,()=>n);var l=_e(s,2);return re(a),Tr(()=>Zt(a,"data-loading",r())),Je("click",l,function(){n?.click()}),ot(e,a),B(o)}Ze(["click"]),fn(ei,{loading:{}},[],[],{mode:"open"});var ti=(e=>(e.ERROR="error",e.LOADING="loading",e.PLAYING="playing",e.PAUSED="paused",e.READY="ready",e))(ti||{}),ni=(e=>(e.CODE="code",e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(ni||{}),ri=et('<div class="altcha-code-challenge-title"> </div>'),ii=et('<div class="altcha-spinner"></div>'),oi=nt('<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>'),ai=nt('<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>'),si=nt('<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>'),li=et('<button type="button" class="altcha-button altcha-button-secondary"><!></button>'),ci=et('<audio hidden="" autoplay=""></audio>'),ui=et('<div class="altcha-code-challenge"><form data-code-challenge="true"><!> <div class="altcha-code-challenge-text"> </div> <img class="altcha-code-challenge-image" alt=""/> <div class="altcha-code-challenge-row"><input type="text" class="altcha-input" autocomplete="off" name="" required=""/> <!> <button type="button" class="altcha-button altcha-button-secondary"><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> <div class="altcha-code-challenge-buttons"><button type="submit" class="altcha-button"> </button> <button type="button" class="altcha-button altcha-button-secondary"> </button></div></form> <!></div>');function fi(e,t){Y(t,!0);let n=sn(t,"audioUrl"),r=sn(t,"codeChallenge"),i=sn(t,"config"),o=sn(t,"imageUrl"),a=sn(t,"onCancel"),s=sn(t,"onReload"),l=sn(t,"onSubmit"),c=sn(t,"strings"),u=Fn(void 0),f=Fn(void 0),d=Fn(void 0),h=Fn(!1),v=Fn(""),p=Fn(!1);function g(){Hn(u,ti.PAUSED,!0)}function m(e){Hn(u,ti.ERROR,!0)}function y(){Hn(u,ti.READY,!0)}function b(){Hn(u,ti.LOADING,!0)}function w(){Hn(u,ti.PLAYING,!0)}function _(){Hn(u,ti.PAUSED,!0)}function $(){yr(f)?yr(u)===ti.LOADING||(yr(f).paused?(n()&&yr(f).src!==n()&&(yr(f).src=n()),yr(f).currentTime=0,yr(f).play()):yr(f).pause()):(Hn(p,!0),requestAnimationFrame(()=>{yr(f)&&n()&&(yr(f).src=n(),yr(f).play())}))}dn(()=>(i().disableAutoFocus||mr().then(()=>{yr(d)?.focus()}),()=>{yr(f)&&(yr(f).pause(),Hn(f,void 0))}));var E={get audioUrl(){return n()},set audioUrl(e){n(e),Tn()},get codeChallenge(){return r()},set codeChallenge(e){r(e),Tn()},get config(){return i()},set config(e){i(e),Tn()},get imageUrl(){return o()},set imageUrl(e){o(e),Tn()},get onCancel(){return a()},set onCancel(e){a(e),Tn()},get onReload(){return s()},set onReload(e){s(e),Tn()},get onSubmit(){return l()},set onSubmit(e){l(e),Tn()},get strings(){return c()},set strings(e){c(e),Tn()}},C=ui(),S=be(C),k=be(S),x=e=>{var t=ri(),n=be(t,!0);re(t),Tr(()=>st(n,c().verificationRequired)),ot(e,t)};Et(k,e=>{"standard"!==i().codeChallengeDisplay&&e(x)});var I=_e(k,2),O=be(I,!0);re(I);var T=_e(I,2),A=_e(T,2),R=be(A);Bt(R),R.disabled=yr(h),rn(R,e=>Hn(d,e),()=>yr(d));var P=_e(R,2),L=e=>{var t=li(),n=be(t),r=e=>{ot(e,ii())},i=e=>{ot(e,oi())},o=e=>{ot(e,ai())},a=e=>{ot(e,si())};Et(n,e=>{yr(u)===ti.LOADING?e(r):yr(u)===ti.ERROR?e(i,1):yr(u)===ti.PLAYING?e(o,2):e(a,-1)}),re(t),Tr(()=>{Zt(t,"title",c().getAudioChallenge),t.disabled=yr(u)===ti.LOADING||yr(u)===ti.ERROR,Zt(t,"aria-label",yr(u)===ti.LOADING?c().loading:c().getAudioChallenge)}),Be("click",t,()=>$(),!0),ot(e,t)};Et(P,e=>{r().audio&&e(L)});var M=_e(P,2);re(A);var N=_e(A,2),D=be(N),V=be(D,!0);re(D);var j=_e(D,2),U=be(j,!0);re(j),re(N),re(S);var F=_e(S,2),q=e=>{var t=ci();rn(t,e=>Hn(f,e),()=>yr(f)),Be("error",t,m),Be("loadstart",t,b),Be("canplay",t,y),Be("pause",t,_),Be("playing",t,w),Be("ended",t,g),ot(e,t)};return Et(F,e=>{yr(p)&&e(q)}),re(C),Tr(()=>{st(O,c().enterCodeFromImage),Zt(T,"src",o()),Zt(R,"minlength",r().length||1),Zt(R,"maxlength",r().length),Zt(R,"placeholder",c().enterCode),Zt(R,"aria-label",yr(u)===ti.LOADING?c().loading:yr(u)===ti.PLAYING?"":c().enterCodeAria),Zt(R,"aria-live",yr(u)?"assertive":"polite"),Zt(R,"aria-busy",yr(u)===ti.LOADING),Zt(M,"title",c().reload),Zt(M,"aria-label",c().reload),Zt(D,"aria-label",c().verify),st(V,c().verify),Zt(j,"aria-label",c().cancel),st(U,c().cancel)}),Be("submit",S,function(e){e.preventDefault(),e.stopPropagation(),l()?.(yr(v))},!0),Je("keydown",R,function(e){"Space"===e.code?(e.preventDefault(),e.stopPropagation(),$()):"Escape"===e.code&&(e.preventDefault(),e.stopPropagation(),a()?.())}),Qt(R,()=>yr(v),e=>Hn(v,e)),Be("click",M,()=>s()?.(),!0),Be("click",j,()=>a()?.(),!0),ot(e,C),B(E)}Ze(["keydown"]),fn(fi,{audioUrl:{},codeChallenge:{},config:{},imageUrl:{},onCancel:{},onReload:{},onSubmit:{},strings:{}},[],[],{mode:"open"});var di=et('<div class="altcha-popover-backdrop" data-backdrop=""></div>'),hi=et('<div class="altcha-popover-arrow"></div>'),vi=et('<div role="button" class="altcha-popover-close">&times;</div>'),pi=et('<!> <div><!> <!> <div class="altcha-popover-content"><!></div></div>',1);function gi(e,t){Y(t,!0);let n=sn(t,"anchor"),r=sn(t,"children"),i=sn(t,"display",0,"standard"),o=sn(t,"backdrop",0,!1),a=sn(t,"onClickOutside"),s=sn(t,"onClickOutsideDelay",0,600),l=sn(t,"onClose"),c=sn(t,"placement",0,"auto"),u=sn(t,"updateUISignal"),f=sn(t,"variant",0,"neutral"),h=an(t,["$$slots","$$events","$$legacy","$$host","anchor","children","display","backdrop","onClickOutside","onClickOutsideDelay","onClose","placement","updateUISignal","variant"]),v=Fn(void 0),p=Fn(void 0),g=Fn(!1),m=Fn(0);function y(){l()?.()}function b(){if(n()&&"auto"===c()&&yr(v)){const e=n().getBoundingClientRect(),t=document.documentElement.clientHeight-(e.top+e.height)<yr(v).clientHeight;yr(g)!==t&&Hn(g,t)}}kr(()=>{"auto"!==c()&&Hn(g,"top"===c())}),kr(()=>{u()&&b()}),dn(()=>{const e="bottomsheet"===i()||"overlay"===i();return e&&(yr(p)&&document.body.append(yr(p)),yr(v)&&document.body.append(yr(v))),b(),mr().then(()=>{Hn(m,Date.now(),!0)}),()=>{e&&(yr(p)&&document.body.removeChild(yr(p)),yr(v)&&document.body.removeChild(yr(v)))}});var w={get anchor(){return n()},set anchor(e){n(e),Tn()},get children(){return r()},set children(e){r(e),Tn()},get display(){return i()},set display(e="standard"){i(e),Tn()},get backdrop(){return o()},set backdrop(e=!1){o(e),Tn()},get onClickOutside(){return a()},set onClickOutside(e){a(e),Tn()},get onClickOutsideDelay(){return s()},set onClickOutsideDelay(e=600){s(e),Tn()},get onClose(){return l()},set onClose(e){l(e),Tn()},get placement(){return c()},set placement(e="auto"){c(e),Tn()},get updateUISignal(){return u()},set updateUISignal(e){u(e),Tn()},get variant(){return f()},set variant(e="neutral"){f(e),Tn()}},_=pi();Be("click",ue,function(e){const t=e.target;yr(v)?.contains(t)||s()&&!(yr(m)+s()<Date.now())||a()?.()},!0),Be("resize",ue,function(){b()}),Be("scroll",ue,function(){b()});var $=we(_),E=e=>{var t=di();rn(t,e=>Hn(p,e),()=>yr(p)),ot(e,t)};Et($,e=>{o()&&e(E)});var C=_e($,2);Wt(C,()=>({...h,class:`altcha-popover ${(t.class||"")??""}`,"data-popover":!0,"data-variant":f(),"data-top":yr(g),"data-display":i()}));var S=be(C),x=e=>{ot(e,hi())};Et(S,e=>{"standard"===i()&&e(x)});var I=_e(S,2),O=e=>{var t=vi();Be("click",t,y,!0),ot(e,t)};Et(I,e=>{"standard"!==i()&&e(O)});var T=_e(I,2);return function(e,t,...n){var r=new $t(e);Ar(()=>{const e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},k)}(be(T),()=>r()??d),re(T),re(C),rn(C,e=>Hn(v,e),()=>yr(v)),ot(e,_),B(w)}async function mi(e){const{challenge:t,concurrency:n=navigator.hardwareConcurrency,controller:r=new AbortController,createWorker:i,onOutOfMemory:o=e=>e>1?Math.floor(e/2):0,counterMode:a,timeout:s=9e4}=e,l=Math.min(16,Math.max(1,n)),c=[],u=()=>{for(const e of c)e.terminate()};for(let e=0;e<l;e++)c.push(await i(t.parameters.algorithm));let f=null;try{f=await Promise.race(c.map((e,n)=>(r.signal.addEventListener("abort",()=>{e.postMessage({type:"abort"})}),new Promise((r,i)=>{e.addEventListener("error",e=>{i(e)}),e.addEventListener("message",t=>{if(t.data){for(const t of c)t!==e&&t.postMessage({type:"abort"});if(t.data.error)return i(new Error(t.data.error))}r(t.data)}),e.postMessage({challenge:t,counterMode:a,counterStart:n,counterStep:l,timeout:s,type:"work"})}))))}catch(n){if(n instanceof Error&&!!n?.message?.includes("Out of memory")&&o){u();const n=o(l);if(n)return mi({...e,challenge:t,controller:r,concurrency:n,createWorker:i})}throw n}finally{u()}return r.signal.aborted?null:f||null}fn(gi,{anchor:{},children:{},display:{},backdrop:{},onClickOutside:{},onClickOutsideDelay:{},onClose:{},placement:{},updateUISignal:{},variant:{}},[],[],{mode:"open"});class yi{TAG_CODES={INPUT:1,TEXTAREA:2,SELECT:3,BUTTON:4,A:5,DETAILS:6,SUMMARY:7,IFRAME:8,VIDEO:9,AUDIO:10};maxSamples;sampleInterval;target;focusStartTime=0;focusInteraction=0;focusInteractionTimer=null;lastPointerSample=0;lastTouchSample=0;lastScrollSample=0;pendingPointer=null;pendingTouch=null;focus=[];pointer=[];scroll=[];touch=[];constructor(e={}){const{maxSamples:t=60,sampleInterval:n=50,target:r=window}=e;this.maxSamples=t,this.sampleInterval=n,this.target=r,this.attach()}destroy(){const e={capture:!0};this.target.removeEventListener("focusin",this.onFocus,e),this.target.removeEventListener("keydown",this.onInteraction,e),this.target.removeEventListener("pointerdown",this.onInteraction,e),this.target.removeEventListener("pointermove",this.onPointer,e),this.target.removeEventListener("scroll",this.onScroll,e),this.target.removeEventListener("touchmove",this.onTouchMove,e)}export(){return{focus:this.focus,maxTouchPoints:navigator.maxTouchPoints||0,pointer:this.pointer,scroll:this.scroll,time:Date.now(),touch:this.touch}}attach(){const e={passive:!0,capture:!0};this.target.addEventListener("focusin",this.onFocus,e),this.target.addEventListener("keydown",this.onInteraction,e),this.target.addEventListener("pointerdown",this.onInteraction,e),this.target.addEventListener("pointermove",this.onPointer,e),this.target.addEventListener("scroll",this.onScroll,e),this.target.addEventListener("touchmove",this.onTouchMove,e)}evict(e){e.length>this.maxSamples&&e.splice(0,e.length-this.maxSamples)}onFocus=e=>{if(2===this.focusInteraction)return;const t=e.target;if(!(t instanceof Element))return;const n=performance.now();0===this.focusStartTime&&(this.focusStartTime=n),this.focus.push([Math.round(n-this.focusStartTime),t.tabIndex,this.TAG_CODES[t.tagName]??0,this.focusInteraction?1:0]),this.evict(this.focus)};onInteraction=e=>{this.focusInteraction="keyCode"in e?1:2,this.focusInteractionTimer&&clearTimeout(this.focusInteractionTimer),this.focusInteractionTimer=setTimeout(()=>{this.focusInteraction=0},100)};onPointer=e=>{if("touch"===e.pointerType)return;const t=e.timeStamp||performance.now();this.pendingPointer=[Math.round(e.clientX),Math.round(e.clientY),Math.round(t)],t-this.lastPointerSample>=this.sampleInterval&&(this.pointer.push(this.pendingPointer),this.lastPointerSample=t,this.pendingPointer=null,this.evict(this.pointer))};onScroll=()=>{const e=performance.now();e-this.lastScrollSample<this.sampleInterval||(this.scroll.push([Math.round(window.scrollY),Math.round(e)]),this.lastScrollSample=e,this.evict(this.scroll))};onTouchMove=e=>{const t=e.timeStamp||performance.now(),n=e.touches[0];n&&(this.pendingTouch=[Math.round(n.clientX),Math.round(n.clientY),Math.round(t),Math.round(1e3*n.force)/1e3,Math.round(n.radiusX||0),Math.round(n.radiusY||0)],t-this.lastTouchSample>=this.sampleInterval&&(this.touch.push(this.pendingTouch),this.lastTouchSample=t,this.pendingTouch=null,this.evict(this.touch)))}}var bi=et('<div class="altcha-overlay-backdrop" data-backdrop=""></div>'),wi=et('<div class="altcha-overlay-content"></div>'),_i=et('<div role="button" class="altcha-overlay-close">&times;</div> <!>',1),$i=et('<div class="altcha-floating-arrow"></div>'),Ei=et('<input type="hidden"/>'),Ci=et('<div class="altcha-error">Secure context (HTTPS) required.</div>'),Si=et('<div class="altcha-error"> </div>'),ki=et('<div class="altcha-error"> </div>'),xi=et("<!> <!>",1),Ii=et('<!> <div class="altcha"><!> <div class="altcha-main"><div><div class="altcha-checkbox-wrap"><!> <label><!></label></div> <!></div> <!> <!> <!></div> <!></div>',1);"undefined"!=typeof window&&window.customElements&&customElements.define("altcha-widget",fn(function(e,t){Y(t,!0);const[n,r]=function(){const e={};return[e,function(){Sr(()=>{for(var t in e)e[t].unsubscribe();o(e,mn,{enumerable:!1,value:!0})})}]}(),i=["ar","fa","he","ur"],{isSecureContext:a}=globalThis,{store:s}=globalThis.$altcha.defaults,l=navigator.hardwareConcurrency||2,c=navigator.deviceMemory||0,u=c&&c<=4?Math.min(4,l):l,f=globalThis.$altcha.i18n.store,d=t.$$host,h=(e,t)=>{mr().then(()=>{d?.dispatchEvent(new CustomEvent(e,{detail:t}))})};let v=null,p=Fn(se(new URL(location.origin))),g=Fn(!1),m=Fn(null),y=Fn(null),b=Fn(null),w=Fn(se(ni.UNVERIFIED)),_=Fn(void 0),$=Fn(void 0),E=Fn(null),C=Fn(void 0),S=Fn(null),x=Fn(null),I=Fn(null),O=Fn(null),T=Fn(se([])),A=Fn(0),R=Fn(se({})),P=Fn(!0);const L=pt(()=>({fetch:(e,t)=>fetch(e,t),audioChallengeLanguage:"",auto:"off",barPlacement:"bottom",challenge:"",codeChallenge:null,codeChallengeDisplay:"standard",credentials:null,debug:!1,disableAutoFocus:!1,display:"standard",floatingAnchor:"",floatingOffset:8,floatingPersist:!1,floatingPlacement:"auto",hideFooter:!1,hideLogo:!1,humanInteractionSignature:!0,language:"",mockError:!1,minDuration:500,overlayContent:"",name:"altcha",popoverPlacement:"auto",retryOnOutOfMemoryError:!0,setCookie:null,serverVerificationFields:!1,serverVerificationTimeZone:!1,test:!1,timeout:9e4,type:"checkbox",validationMessage:"",verifyFunction:null,verifyUrl:"",workers:u,...yn(s,"$altchaDefaults",n),...yr(R)})),M=pt(()=>`altcha-checkbox-${t.id||Math.floor(1e12*Math.random()).toString(16)}`),N=pt(()=>function(e){switch(e){case"checkbox":return Br;case"switch":return ei;default:return Zr}}(yr(L).type)),D=pt(()=>yr(L).auto),V=pt(()=>yr(w)===ni.VERIFYING),j=pt(()=>!yr(L).hideFooter),U=pt(()=>!yr(L).hideLogo&&"bar"!==yr(L).display),F=pt(()=>function(e,t){const n=Object.keys(e).map(e=>e.toLowerCase());let r=t.reduce((t,r)=>(r=r.toLowerCase(),t||(e[r]?r:null)||n.find(e=>r.split("-")[0]===e.split("-")[0])||null),null);e[r||""]||(r="en");return{language:r,strings:e[r]}}(yn(f,"$altchaI18nStore",n),[yr(L).language,document.documentElement.lang,...navigator.languages])),q=pt(()=>i.includes(yr(F).language)?"rtl":void 0),H=pt(()=>({...yr(F).strings})),G=pt(()=>yr(m)?.audio?.match(/^(https?:)?\//)?le(yr(m).audio,yr(p),{language:yr(L).audioChallengeLanguage||yr(F).language}).toString():yr(m)?.audio),J=pt(()=>yr(m)?.image?.match(/^(https?:)?\//)?le(yr(m).image,yr(p)):yr(m)?.image);async function Z(e,...t){let n;for(const r of yr(T))n=await r[e].call(r,...t);return n}async function W(e){await new Promise(t=>setTimeout(t,e))}async function z(e=yr(L).challenge,t){const n=await Z("onFetchChallenge",e);let r=null;if(void 0!==n)return n;if("string"==typeof e)if(e.match(/^(https?:)?\//)){ke("fetching challenge from",t?.method||"GET",e),Hn(p,new URL(e,location.origin),!0);const n=await yr(L).fetch(e,{credentials:yr(L).credentials||void 0,...t});await $e(n);const i=n.headers.get("x-altcha-config");i&&function(e){try{const t=JSON.parse(e);t&&"object"==typeof t&&Ce({serverVerificationFields:t?.sentinel?.fields,serverVerificationTimeZone:t?.sentinel?.timeZone,verifyUrl:t.verifyurl,...t})}catch(e){ke("unable to configure from x-altcha-config header",e)}}(i);const o=await n.json();if(o&&"his"in o&&o.his){if(ke("requested HIS"),!v)throw new Error("Server requested HIS data but collector is disabled.");return z(le(o.his.url,yr(p)),{body:JSON.stringify({his:v.export()}),headers:{"content-type":"application/json"},method:"POST"})}o&&"hisResult"in o&&o.hisResult&&ke("HIS result",o.hisResult),r=o}else{ke("parsing JSON challenge");try{r=JSON.parse(e)}catch{throw new Error("Unable to parse JSON challenge.")}}else if(e&&"object"==typeof e)try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("Unable to parse JSON challenge.")}if(function(e){return"object"==typeof e&&"challenge"in e}(r)&&(r=function(e){const[t,n]=e.salt.split("?"),r={};if(n)try{Object.assign(r,Object.fromEntries(new URLSearchParams(n).entries()))}catch{}const i={codeChallenge:e.codeChallenge,parameters:{algorithm:e.algorithm,cost:1,data:r,expiresAt:r?.expires?parseInt(r.expires,10):void 0,keyLength:"SHA-512"===e.algorithm?64:"SHA-384"===e.algorithm?48:32,nonce:(o=(new TextEncoder).encode(e.salt),Array.from(new Uint8Array(o)).map(e=>e.toString(16).padStart(2,"0")).join("")),keyPrefix:e.challenge,salt:""},signature:e.signature};var o;return Object.defineProperties(i,{_originalSalt:{enumerable:!1,value:e.salt,writable:!1},_version:{enumerable:!1,value:1,writable:!1}}),i}(r)),!function(e){return!!e&&"object"==typeof e&&"parameters"in e&&!!e.parameters&&"object"==typeof e.parameters&&"algorithm"in e.parameters&&"nonce"in e.parameters&&"salt"in e.parameters&&"keyPrefix"in e.parameters}(r))throw new Error("Challenge validation failed.");return r}function X(){return document.getElementById(yr(M))}function ie(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function le(e,t,n){const r=new URL(e,t);if(r.search||(r.search=t.search),n)for(const e in n)void 0!==n[e]&&null!==n[e]&&r.searchParams.set(e,n[e]);return r.toString()}function ce(e){!yr(g)&&e.currentTarget.checked?(e.preventDefault(),e.currentTarget.checked=!1,yr(w)!==ni.VERIFYING&&Ae()):e.currentTarget.checked||(e.preventDefault(),xe())}function de(e){yr(w)===ni.VERIFYING?e.currentTarget.setCustomValidity(yr(H).waitAlert):yr(L).validationMessage&&e.currentTarget.setCustomValidity(yr(L).validationMessage)}function he(){ye(yr(L).display),xe()}function ve(e){"onfocus"===yr(D)&&yr(w)===ni.UNVERIFIED&&Ae()}function pe(){ye(yr(L).display),xe()}function ge(e){Hn(S,e.submitter,!0),"onsubmit"===yr(D)&&yr(w)===ni.UNVERIFIED&&(e.preventDefault(),e.stopPropagation(),Oe(),Ae().then(e=>{e&&!yr(m)&&mr().then(()=>{me(yr(S))})}))}function me(e){yr(E)&&"requestSubmit"in yr(E)?yr(E).requestSubmit(e):yr(E)?.reportValidity()&&(e?e.click():yr(E).submit())}function ye(e){switch(e){case"bar":case"floating":case"overlay":Se(),yr(D)&&"off"!==yr(D)||(yr(R).auto="onsubmit");break;case"standard":Oe()}yr(b)!==e&&Hn(b,e,!0)}async function $e(e){if(e.status>=400){if(e.headers.get("content-type")?.includes("/json")){let t;try{t=await e.json()}catch{}if(t&&"error"in t)throw new Error(`Server responded with ${e.status} - ${t.error}`)}throw new Error(`Server responded with ${e.status}.`)}const t=e.headers.get("content-type");if(!t||!t.includes("/json"))throw new Error(`Server responded with invalid content-type. Expected application/json, received ${t}.`)}async function Ee(e){if(!yr(O))return void Ie(ni.ERROR,"Cannot verify code challenge without PoW payload.");Ie(ni.VERIFYING);let t=null;if(yr(L).verifyUrl)t=await async function(e,t){const n=await Z("onRequestServerVerification",e,t);if(void 0!==n)return n;if(ke("requesting server verification from",yr(L).verifyUrl),!yr(L).verifyUrl)throw new Error("Parameter verifyUrl must be set for server verification.");const r=await yr(L).fetch(le(yr(L).verifyUrl,yr(p)),{body:JSON.stringify({code:t,fields:yr(L).serverVerificationFields?[...yr(E)?.querySelectorAll('input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])')||[]].reduce((e,t)=>{const n=t.name,r=t.value;return n&&r&&(e[n]=/\n/.test(r)?r.replace(new RegExp("(?<!\\r)\\n","g"),"\r\n"):r),e},{}):void 0,payload:e,timeZone:yr(L).serverVerificationTimeZone?ie():void 0}),credentials:yr(L).credentials||void 0,headers:{"Content-Type":"application/json"},method:"POST"});await $e(r);const i=await r.json();return i&&"object"==typeof i&&"payload"in i&&i.payload&&h("serververification",i),i}(yr(O),e);else{if(!yr(L).verifyFunction)return void Ie(ni.ERROR,"Parameter verifyUrl is required for code challenge verification.");t=await yr(L).verifyFunction(yr(O),e)}t?.payload&&(Hn(O,t.payload,!0),ke("server payload",yr(O))),!0===t?.verified?(ke("verified"),Ie(ni.VERIFIED),h("verified",{payload:yr(O)}),"onsubmit"===yr(D)&&mr().then(()=>{me(yr(S))})):Ie(ni.ERROR,t?.reason||"Verification failed."),yr(L).disableAutoFocus||X()?.focus()}function Ce(e){Object.assign(yr(R),{...Object.fromEntries(Object.entries(e).filter(([e,t])=>void 0!==t))})}function Se(){Hn(P,!1)}function ke(...e){(yr(L).debug||e.some(e=>e instanceof Error))&&console[e[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${yr(L).name}]`,...e)}function xe(e=ni.UNVERIFIED,t=null){Hn(g,!1),Hn(x,t,!0),Hn(O,null),yr(y)&&yr(y).abort(),yr(I)&&(clearTimeout(yr(I)),Hn(I,null)),Ie(e)}function Ie(e,t=null){Hn(w,e,!0),Hn(x,t,!0),h("statechange",{payload:yr(O),state:yr(w)})}function Oe(){Hn(P,!0),mr().then(()=>{Te()})}function Te(){if("floating"===yr(L).display)return function(e=20){if(!yr(C))return;const t=yr(L).floatingPlacement;if(!yr($)&&(Hn($,(yr(L).floatingAnchor instanceof HTMLElement?yr(L).floatingAnchor:yr(L).floatingAnchor?document.querySelector(yr(L).floatingAnchor):yr(E)?.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||yr(E),!0),!yr($)))return void ke("unable to find floating anchor element");const n=parseInt(yr(L).floatingOffset,10)||12,r=yr($).getBoundingClientRect(),i=yr(C).getBoundingClientRect(),o=document.documentElement.clientHeight,a=document.documentElement.clientWidth,s=t&&"auto"!==t?"top"===t:r.bottom+i.height+n+e>o,l=Math.max(e,Math.min(a-e-i.width,r.left+r.width/2-i.width/2));if(yr(C).style.setProperty("--altcha-floating-left",`${l}px`),yr(C).style.setProperty("--altcha-floating-top",s?r.top-(i.height+n)+"px":`${r.bottom+n}px`),yr(C).setAttribute("data-floating-position",s?"top":"bottom"),yr(_)){const e=yr(_).getBoundingClientRect();yr(_).style.left=r.left-l+r.width/2-e.width/2+"px"}}();Hn(A,yr(A)+1)}async function Ae(e={}){const{concurrency:t=Math.max(1,yr(L).workers),controller:n=new AbortController,minDuration:r=yr(L).minDuration}=e,i=performance.now();let o=null,s=null,l=!1;const c=await Z("onVerify",e);if(void 0!==c)return c;xe(ni.VERIFYING),Hn(y,n,!0);try{if(!a)throw new Error("Secure context (HTTPS) required.");if(yr(L).mockError)throw new Error("Mock error.");if(yr(L).test)return ke("running test mode with null challenge"),await W(Math.max(0,r-(performance.now()-i))),yr(y)?.signal.aborted?(xe(),null):(Hn(O,btoa(JSON.stringify({challenge:null,solution:null,test:!0})),!0),ke("verified"),Ie(ni.VERIFIED),h("verified",{payload:yr(O)}),{payload:yr(O)});if(o=await z(),!o)throw new Error("Failed to fetch challenge.");ke("challenge",o),"configuration"in o&&(ke("re-configuring from challenge",o.configuration),Ce(o.configuration)),o.parameters.expiresAt&&function(e){yr(I)&&clearTimeout(yr(I));const t=()=>{yr(w)!==ni.UNVERIFIED?(Hn(g,!1),Ie(ni.EXPIRED)):xe(),h("expired")},n=1e3*e-Date.now();n>=1?Hn(I,setTimeout(t,n),!0):t()}(o.parameters.expiresAt),l="_version"in o&&1===o._version;const e=globalThis.$altcha.algorithms.get(o.parameters.algorithm);if(!e)throw new Error(`Unsupported algorithm ${o.parameters.algorithm}.`);if(s=await mi({challenge:o,concurrency:t,controller:n,createWorker:e,counterMode:l?"string":"uint32",onOutOfMemory:e=>{if(ke("out of memory error received"),h("outofmemory"),yr(L).retryOnOutOfMemoryError&&e>1){const t=Math.floor(e/2);return ke(`retrying with ${t} workers...`),t}},timeout:yr(L).timeout}),yr(y)?.signal.aborted)return xe(),null;if(!s)throw new Error("Failed to find solution.");ke("solution",s),await W(Math.max(0,r-(performance.now()-i))),Hn(m,o.codeChallenge||yr(L).codeChallenge||null,!0),Hn(O,l?btoa(JSON.stringify(function(e,t){return{algorithm:e.parameters.algorithm,challenge:e.parameters.keyPrefix,number:t.counter,salt:"_originalSalt"in e?e._originalSalt:e.parameters.nonce,signature:e.signature,took:t.time||0}}(o,s))):btoa(JSON.stringify({challenge:{parameters:o.parameters,signature:o.signature},solution:s})),!0),yr(m)?(ke("requesting code verification"),Ie(ni.CODE),h("codechallenge",{codeChallenge:yr(m)})):yr(L).verifyUrl?await Ee():(ke("verified"),Ie(ni.VERIFIED),h("verified",{payload:yr(O)}))}catch(e){return ke("verification failed",e),Ie(ni.ERROR,String(e)),null}finally{Hn(y,null)}return{challenge:o,payload:yr(O),solution:s}}kr(()=>{Ce({auto:t.auto,challenge:t.challenge,display:t.display,language:t.language,name:t.name,type:t.type,workers:t.workers})}),kr(()=>{if(t.configuration)try{Ce(JSON.parse(t.configuration))}catch{ke("unable to parse the `configuration` attribute (JSON expected)")}}),kr(()=>{yr(b)!==yr(L).display&&ye(yr(L).display)}),kr(()=>{yr(g)&&yr(w)===ni.VERIFYING&&Hn(g,!1)}),kr(()=>{yr(g)||yr(w)!==ni.VERIFIED||Hn(g,!0)}),kr(()=>{if(!yr(g)){const e=X();e&&e.checked&&(e.checked=!1)}}),kr(()=>{yr(w)===ni.VERIFIED&&X()?.setCustomValidity("")}),kr(()=>{if("onload"===yr(D)){const e=setTimeout(()=>{Ae()},1);return()=>{e&&clearTimeout(e)}}}),kr(()=>{yr(x)&&ke("error:",yr(x))}),kr(()=>{yr(O)&&yr(L).setCookie&&function(e,t={}){const{domain:n,name:r=yr(L).name,maxAge:i,path:o,sameSite:a,secure:s}=t;let l=`${encodeURIComponent(r)}=${encodeURIComponent(e)}`;n&&(l+=`; Domain=${n}`);null!=i&&(l+=`; Max-Age=${i}`);o&&(l+=`; Path=${o}`);a&&(l+=`; SameSite=${a}`);s&&(l+="; Secure");document.cookie=l}(yr(O),yr(L).setCookie)}),dn(()=>(ke("mounted","3.0.6"),d&&globalThis.$altcha.instances.add(d),Hn(E,yr(C)?.closest("form"),!0),yr(E)?.addEventListener("reset",pe),yr(E)?.addEventListener("submit",ge,{capture:!0}),yr(E)?.addEventListener("focusin",ve),function(){Hn(T,[...globalThis.$altcha.plugins].map(e=>new e(d)),!0),ke("activating plugins",yr(T).map(e=>e.constructor.name));for(const e of yr(T))e.activate()}(),yr(L).humanInteractionSignature&&(ke("human interaction signature enabled"),v=new yi),h("load"),a||ke("secure context (HTTPS) required"),()=>{!function(){for(const e of yr(T))e.destroy()}(),d&&globalThis.$altcha.instances.delete(d),yr(I)&&clearTimeout(yr(I)),yr(E)?.removeEventListener("reset",pe),yr(E)?.removeEventListener("submit",ge,{capture:!0}),yr(E)?.removeEventListener("focusin",ve),v?.destroy()}));var Re={configure:Ce,getConfiguration:function(){return{...yr(L)}},getState:function(){return yr(w)},hide:Se,log:ke,reset:xe,setState:Ie,show:Oe,updateUI:Te,verify:Ae},Pe=Ii();Be("scroll",fe,function(){Te()}),Be("click",fe,function(e){const t=e.target;"floating"!==yr(L).display||!t||d?.contains(t)||t.hasAttribute("data-backdrop")||t.closest("[data-popover]")||yr(w)===ni.VERIFIED||yr(L).floatingPersist||Se()}),Be("pageshow",ue,function(e){e.persisted&&(ye(yr(L).display),xe())}),Be("resize",ue,function(){Te()});var Le=we(Pe),Me=e=>{ot(e,bi())};Et(Le,e=>{"overlay"===yr(L).display&&yr(P)&&e(Me)});var Ne=_e(Le,2),De=be(Ne),Ve=e=>{var t=_i(),n=we(t),r=_e(n,2),i=e=>{var t=wi();St(t,()=>document.querySelector(yr(L).overlayContent)?.innerHTML,!0),re(t),ot(e,t)};Et(r,e=>{yr(L).overlayContent&&e(i)}),Be("click",n,he,!0),ot(e,t)};Et(De,e=>{"overlay"===yr(L).display&&yr(P)&&e(Ve)});var je=_e(De,2),Ue=be(je),Fe=be(Ue),qe=be(Fe);{let e=pt(()=>"standard"===yr(L).display&&"onsubmit"!==yr(D)||yr(w)===ni.VERIFYING);!function(e,t,n){var r;Q&&(r=K,ne());var i=new $t(e);Ar(()=>{var e=t()??null;if(Q&&"["===ae(r)!=(null!==e)){var o=oe();return te(o),i.anchor=o,ee(!1),i.ensure(e,e&&(t=>n(t,e))),void ee(!0)}i.ensure(e,e&&(t=>n(t,e)))},k)}(qe,()=>yr(N),(t,n)=>{n(t,{get id(){return yr(M)},name:"",get required(){return yr(e)},get loading(){return yr(V)},get checked(){return yr(g)},onchange:ce,oninvalid:de})})}var He=_e(qe,2),Ge=be(He),Ye=e=>{var t=rt();Tr(()=>st(t,yr(H).verificationRequired)),ot(e,t)},Je=e=>{var t=rt();Tr(()=>st(t,yr(H).verifying)),ot(e,t)},Ze=e=>{var t=rt();Tr(()=>st(t,yr(H).verified)),ot(e,t)},We=e=>{var t=rt();Tr(()=>st(t,yr(H).label)),ot(e,t)};Et(Ge,e=>{yr(w)===ni.CODE&&yr(m)?e(Ye):yr(w)===ni.VERIFYING?e(Je,1):yr(w)===ni.VERIFIED?e(Ze,2):e(We,-1)}),re(He),re(Fe);var ze=_e(Fe,2),Xe=e=>{zr(e,{get strings(){return yr(H)}})};Et(ze,e=>{yr(U)&&e(Xe)}),re(Ue);var Ke=_e(Ue,2),Qe=e=>{{let t=pt(()=>"bar"===yr(L).display&&yr(U));Kr(e,{get logo(){return yr(t)},get strings(){return yr(H)}})}};Et(Ke,e=>{yr(j)&&e(Qe)});var et=_e(Ke,2),tt=e=>{var t=$i();rn(t,e=>Hn(_,e),()=>yr(_)),ot(e,t)};Et(et,e=>{"floating"===yr(L).display&&e(tt)});var nt=_e(et,2),at=e=>{var t=Ei();Bt(t),Tr(()=>{var e,n,r;Zt(t,"name",yr(L).name),e=t,n=yr(O),(r=zt(e)).value!==(r.value=n??void 0)&&(e.value!==n||0===n&&e.nodeName===Yt)&&(e.value=n??"")}),ot(e,t)};Et(nt,e=>{yr(L).setCookie||e(at)}),re(je);var lt=_e(je,2),ct=e=>{gi(e,{get anchor(){return yr(C)},onClickOutside:()=>{a&&xe()},get placement(){return yr(L).popoverPlacement},role:"alert",variant:"error",get dir(){return yr(q)},get updateUISignal(){return yr(A)},children:(e,t)=>{var n=it(),r=we(n),i=e=>{ot(e,Ci())},o=e=>{var t=Si(),n=be(t,!0);re(t),Tr(()=>st(n,yr(H).expired)),ot(e,t)},s=e=>{var t=ki(),n=be(t,!0);re(t),Tr(()=>{Zt(t,"title",yr(x)),st(n,yr(H).error)}),ot(e,t)};Et(r,e=>{yr(x)||a?yr(x)||yr(w)!==ni.EXPIRED?e(s,-1):e(o,1):e(i)}),ot(e,n)},$$slots:{default:!0}})},ut=e=>{var t=it();!function(e,t,n){Q&&ne();var r=new $t(e);Ar(()=>{var e=t();e!=e&&(e=Ct),r.ensure(e,n)})}(we(t),()=>yr(m),e=>{{let t=pt(()=>"standard"!==yr(L).codeChallengeDisplay);gi(e,{get anchor(){return yr(C)},get backdrop(){return yr(t)},get display(){return yr(L).codeChallengeDisplay},onClose:()=>{xe()},get placement(){return yr(L).popoverPlacement},role:"dialog",get"aria-label"(){return yr(H).verificationRequired},get dir(){return yr(q)},get updateUISignal(){return yr(A)},children:(e,t)=>{var n=xi(),r=we(n);fi(r,{get audioUrl(){return yr(G)},get imageUrl(){return yr(J)},onCancel:()=>xe(),onReload:()=>Ae(),onSubmit:e=>Ee(e),get codeChallenge(){return yr(m)},get config(){return yr(L)},get strings(){return yr(H)}});var i=_e(r,2),o=e=>{Kr(e,{get logo(){return yr(U)},get strings(){return yr(H)}})};Et(i,e=>{yr(j)&&"standard"!==yr(L).codeChallengeDisplay&&e(o)}),ot(e,n)},$$slots:{default:!0}})}}),ot(e,t)};Et(lt,e=>{yr(x)||yr(w)===ni.EXPIRED||!a?e(ct):yr(m)&&yr(w)===ni.CODE&&e(ut,1)}),re(Ne),rn(Ne,e=>Hn(C,e),()=>yr(C)),Tr(e=>{Zt(Ne,"data-state",yr(w)),Zt(Ne,"data-display",yr(L).display||void 0),Zt(Ne,"data-placement",e),Zt(Ne,"data-visible",yr(P)||void 0),Zt(Ne,"dir",yr(q)),Zt(He,"for",yr(M)),Ne.dir=Ne.dir},[()=>function(e){switch(e){case"bar":return yr(L).barPlacement||"bottom";case"floating":return yr(L).floatingPlacement||"auto";default:return}}(yr(L).display)]),ot(e,Pe);var ft=B(Re);return r(),ft},{auto:{type:"String"},challenge:{type:"String"},configuration:{type:"String"},display:{type:"String"},language:{type:"String"},name:{type:"String"},theme:{type:"String"},type:{type:"String"},workers:{type:"Number"}},[],["configure","getConfiguration","getState","hide","log","reset","setState","show","updateUI","verify"]));
@@ -6071,7 +6071,7 @@
6071
6071
  }
6072
6072
  });
6073
6073
  onMount(() => {
6074
- log("mounted", "3.0.5");
6074
+ log("mounted", "3.0.6");
6075
6075
  if (instance) {
6076
6076
  globalThis.$altcha.instances.add(instance);
6077
6077
  }
@@ -6322,9 +6322,6 @@
6322
6322
  }
6323
6323
  }
6324
6324
  function onCloseClick() {
6325
- if (get(currentController)) {
6326
- get(currentController).abort();
6327
- }
6328
6325
  setDisplay(get(config).display);
6329
6326
  reset$1();
6330
6327
  }
@@ -6343,9 +6340,6 @@
6343
6340
  }
6344
6341
  }
6345
6342
  function onFormReset() {
6346
- if (get(currentController)) {
6347
- get(currentController).abort();
6348
- }
6349
6343
  setDisplay(get(config).display);
6350
6344
  reset$1();
6351
6345
  }
@@ -6364,9 +6358,11 @@
6364
6358
  });
6365
6359
  }
6366
6360
  }
6367
- function onWindowPageshow() {
6368
- setDisplay(get(config).display);
6369
- reset$1();
6361
+ function onWindowPageshow(ev) {
6362
+ if (ev.persisted) {
6363
+ setDisplay(get(config).display);
6364
+ reset$1();
6365
+ }
6370
6366
  }
6371
6367
  function onWindowResize() {
6372
6368
  updateUI();
@@ -6587,6 +6583,9 @@
6587
6583
  set(checked, false);
6588
6584
  set(error, err, true);
6589
6585
  set(payload, null);
6586
+ if (get(currentController)) {
6587
+ get(currentController).abort();
6588
+ }
6590
6589
  if (get(expirationTimeout)) {
6591
6590
  clearTimeout(get(expirationTimeout));
6592
6591
  set(expirationTimeout, null);
@@ -6625,8 +6624,8 @@
6625
6624
  if (hook !== void 0) {
6626
6625
  return hook;
6627
6626
  }
6628
- set(currentController, controller, true);
6629
6627
  reset$1(State.VERIFYING);
6628
+ set(currentController, controller, true);
6630
6629
  try {
6631
6630
  if (!isSecureContext) {
6632
6631
  throw new Error("Secure context (HTTPS) required.");
@@ -6637,6 +6636,10 @@
6637
6636
  if (get(config).test) {
6638
6637
  log("running test mode with null challenge");
6639
6638
  await delay(Math.max(0, minDuration - (performance.now() - start)));
6639
+ if (get(currentController)?.signal.aborted) {
6640
+ reset$1();
6641
+ return null;
6642
+ }
6640
6643
  set(payload, btoa(JSON.stringify({ challenge: null, solution: null, test: true })), true);
6641
6644
  log("verified");
6642
6645
  setState(State.VERIFIED);