1import{e}from"/assets/application-pevgkcf3.digested.js";import{n}from"/assets/application-ssy074d0.digested.js";import{N}from"/assets/application-k1jka1nw.digested.js";class d extends e{static targets=["error"];static values={passkeyErrors:Object};connect(){this.handleBeforeCache=()=>{if(this.element.open)this.element.close()},document.addEventListener("turbo:before-cache",this.handleBeforeCache),this.checkAutoOpen()}disconnect(){document.removeEventListener("turbo:before-cache",this.handleBeforeCache)}checkAutoOpen(){let r=new URLSearchParams(window.location.search),o=r.get("auth_error"),t=this.passkeyErrorsValue||{};if(o&&Object.hasOwn(t,o)){sessionStorage.removeItem("authBounceGuard"),this.showError(t[o]);let a=new URL(window.location);a.searchParams.delete("auth_error"),a.searchParams.delete("login_required"),window.history.replaceState({},"",a);return}let s=r.get("login_error");if(s==="exchange"||s==="exchange_unknown"){sessionStorage.removeItem("authBounceGuard"),this.showError(t[s]||t.exchange);let a=new URL(window.location);a.searchParams.delete("login_error"),window.history.replaceState({},"",a);return}if(!r.has("login_required")){sessionStorage.removeItem("authBounceGuard");return}let i=N(r.get("return_to"));if(i)localStorage.setItem("authReturnTo",i);let h=new URL(window.location);if(h.searchParams.delete("login_required"),h.searchParams.delete("return_to"),window.history.replaceState({},"",h),i&&n()&&!sessionStorage.getItem("authBounceGuard")){sessionStorage.setItem("authBounceGuard","1"),localStorage.removeItem("authReturnTo"),Turbo.visit(i);return}this.open()}showPasskeyError(r){if(!this.hasErrorTarget)return;let o=r.detail?.code,t=this.passkeyErrorsValue||{},s=Object.hasOwn(t,o)?t[o]:t.unknown;if(!s)return;r.preventDefault(),this.showError(s)}clearError(){if(!this.hasErrorTarget)return;this.errorTarget.textContent="",this.errorTarget.hidden=!0}showError(r){if(!this.hasErrorTarget)return;this.errorTarget.textContent=r,this.errorTarget.hidden=!r,this.open()}open(){if(this.element.open)return;this.element.showModal()}close(){this.clearError(),this.element.close()}backdropClick(r){if(r.target===this.element)this.close()}setReturnUrl(){localStorage.setItem("authReturnTo",window.location.pathname+window.location.search)}}export{d as default}; 2 3//# debugId=5B4B0F4D48CE46B064756E2164756E21
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.