1import{_ as V}from"./DYnFMSJU.js";import{_ as A}from"./ClYZ6P-a.js";import{u as D}from"./CHoPnCOC.js";import{u as $}from"./DXdIIuFi.js";import{d as k,a0 as N,a1 as x,v as R,B as W,r as _,E as O,a2 as z,a3 as B,U as I,Q as K,R as q,a4 as E,h as b,o as c,a as i,n as h,a5 as L,w as l,i as s,b as y,t as v,K as M,_ as S,l as T,a6 as Q,a7 as Y,C as F,c as G}from"./D3IHV_n4.js";import{i as C}from"./BMvL94yK.js";import{_ as H}from"./CyIlwzAR.js";import{S as P}from"./B1bNe6zu.js";import{_ as j}from"./DjwXiEdQ.js";import{_ as J}from"./DTlhFZgk.js";import{u as X}from"./D99y6PdP.js";import"./B-YFCHXN.js";import"./CfK59ch4.js";import"./COOyLv9j.js";try{let n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new n.Error().stack;o&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[o]="01b7bb06-9242-4bd6-81f5-4f8bfcf7b66a",n._sentryDebugIdIdentifier="sentry-dbid-01b7bb06-9242-4bd6-81f5-4f8bfcf7b66a")}catch{}const Z=k({__name:"sign-in-action-handler",props:{continueUrl:{}},setup(n){const o=n,t=X({experience:N.Standalone}),f=x(),d=R(),p=$(),r=W(()=>t.state.fetching||t.state.success),m=_(),g=_(),u=_(),w=async()=>{var a;const e=((a=m.value)==null?void 0:a.trim())??"";u.value=!!e&&C(e),g.value=u.value?e:void 0,g.value?await t.signInWithEmailLink(e,{continueUrl:o.continueUrl}):e&&f.upsert({id:"email-format",line1:d.t("web.error"),line2:d.t("web.field.emailInvalid"),severity:"error"})};return O(()=>t.state.error,(e,a)=>{e&&!a&&z(t.state.error,B.AUTH_NEW_USER_REGISTRATION_CLOSED)&&I(p({name:"sign-in",query:{[K.KmcRegistrationClosed]:1}}))}),q(()=>{var a;const e=(a=window.localStorage.getItem(E.SignInWithEmail))==null?void 0:a.trim();typeof e=="string"&&C(e)&&(m.value=e,I(w())),window.localStorage.removeItem(E.SignInWithEmail)}),(e,a)=>(c(),b(T,null,[i(j,null,L({title:l(()=>[y(v(e.$t("web.welcomeToNiuhi")),1)]),_:2},[s(t).state.error?{name:"supporting",fn:l(()=>[i(J,{"auth-store":s(t)},null,8,["auth-store"])]),key:"0"}:s(t).state.fetching?{name:"supporting",fn:l(()=>[i(P,{size:"lg",class:"m-auto"})]),key:"1"}:{name:"supporting",fn:l(()=>[y(v(e.$t("web.enterYourEmailToCompleteSignIn")),1)]),key:"2"}]),1024),s(t).state.fetching?h("",!0):(c(),b("form",{key:0,class:"flex flex-col gap-(--n-page-grid-inner-gap)",onSubmit:M(w,["prevent"])},[i(H,{id:"emailInput",modelValue:m.value,"onUpdate:modelValue":a[0]||(a[0]=U=>
1m.value=U),invalid:u.value===!1,placeholder:e.$t("web.enterYourEmail"),disabled:r.value,size:"lg",type:"email"},null,8,["modelValue","invalid","placeholder","disabled"]),i(S,{loading:r.value,title:e.$t("web.signInWithEmail"),size:"md",type:"submit",variant:"filled"},null,8,["loading","title"]),s(t).state.error?(c(),b(T,{key:0},[i(Q,{tight:""},{default:l(()=>[y(v(e.$t("web.dividerOr")),1)]),_:1}),i(S,{title:e.$t("web.pleaseTryAgain"),to:{name:"sign-in"},size:"md",variant:"tonal"},null,8,["title"])],64)):h("",!0)],32))],64))}}),pe=k({__name:"index",async setup(n){let o,t;const f=Y(),d=D(),p=$();let r=0;return f.query.mode==="signIn"&&(r=1),r===0&&([o,t]=F(()=>p({name:"home"},{replace:!0})),await o,t()),(m,g)=>{const u=V;return s(r)===1?(c(),G(u,{key:0},{default:l(()=>[i(Z,{"continue-url":s(d)},null,8,["continue-url"]),i(A,{severity:"error"})]),_:1})):h("",!0)}}});export{pe as default};
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.