1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,47737,e=>{"use strict";var t=e.i(330668),r=e.i(848277),n=(0,t.forwardRef)(({as:e="div",...t},n)=>(0,r.jsx)(e,{...t,ref:n}));let o="onloadTurnstileCallback",a={normal:{width:300,height:65},compact:{width:150,height:140},invisible:{width:0,height:0,overflow:"hidden"},flexible:{minWidth:300,width:"100%",height:65}},s="unloaded",l,i=new Promise((e,t)=>{l={resolve:e,reject:t},"ready"===s&&e(void 0)}),d=(e=o)=>("unloaded"===s&&(s="loading",window[e]=()=>{l.resolve(),s="ready",delete window[e]}),i),c=(0,t.forwardRef)((e,l)=>{let{scriptOptions:i,options:c={},siteKey:u,onWidgetLoad:m,onSuccess:g,onExpire:f,onError:x,onBeforeInteractive:p,onAfterInteractive:h,onUnsupported:b,onTimeout:y,onLoadScript:w,id:v,style:j,as:N="div",injectScript:_=!0,rerenderOnCallbackChange:k=!1,...S}=e,C=c.size,E=(0,t.useMemo)(()=>{if(void 0===C)return{};let e=a[C];return"interaction-only"===c.appearance?{...e,height:"auto"}:e},[C,c.appearance]),A="execute"===c.execution?a.invisible:E,[T,R]=(0,t.useState)(A),M=(0,t.useRef)(null),[I,F]=(0,t.useState)(!1),P=(0,t.useRef)(void 0),z=(0,t.useRef)(!1),D=v||"cf-turnstile",$=(0,t.useRef)({onSuccess:g,onError:x,onExpire:f,onBeforeInteractive:p,onAfterInteractive:h,onUnsupported:b,onTimeout:y});(0,t.useEffect)(()=>{k||($.current={onSuccess:g,onError:x,onExpire:f,onBeforeInteractive:p,onAfterInteractive:h,onUnsupported:b,onTimeout:y})});let q=i?.id||"cf-turnstile-script",L=function(e="cf-turnstile-script"){let[r,n]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{let t=()=>{document.getElementById(e)&&n(!0)},r=new MutationObserver(t);return r.observe(document,{childList:!0,subtree:!0}),t(),()=>{r.disconnect()}},[e]),r}(q),B=i?.onLoadCallbackName||"onloadTurnstileCallback",O=(0,t.useMemo)(()=>({sitekey:u,action:c.action,cData:c.cData,theme:c.theme||"auto",language:c.language||"auto",tabindex:c.tabIndex,"response-field":c.responseField,"response-field-name":c.responseFieldName,size:function(e){if("invisible"!==e)return e}(C),retry:c.retry||"auto","retry-interval":c.retryInterval||8e3,"refresh-expired":c.refreshExpired||"auto","refresh-timeout":c.refreshTimeout||"auto",execution:c.execution||"render",appearance:c.appearance||"always","feedback-enabled":c.feedbackEnabled??!0,"offlabel-show-privacy":c.offlabelShowPrivacy??!0,"offlabel-show-help":c.offlabelShowHelp??!0,callback:e=>{z.current=!0,k?g?.(e):$.current.onSuccess?.(e)},"error-callback":k?x:(...e)=>$.current.onError?.(...e),"expired-callback":k?f:(...e)=>$.current.onExpire?.(...e),"before-interactive-callback":k?p:(...e)=>$.current.onBeforeInteractive?.(...e),"after-interactive-callback":k?h:(...e)=>$.current.onAfterInteractive?.(...e),"unsupported-callback":k?b:(...e)=>$.current.onUnsupported?.(...e),"timeout-callback":k?y:(...e)=>$.current.onTimeout?.(...e)}),[c.action,c.appearance,c.cData,c.execution,c.language,c.refreshExpired,c.responseField,c.responseFieldName,c.retry,c.retryInterval,c.tabIndex,c.theme,c.feedbackEnabled,c.offlabelShowPrivacy,c.offlabelShowHelp,c.refreshTimeout,u,C,k,k?g:null,k?x:null,k?f:null,k?p:null,k?h:null,k?b:null,k?y:null]),U=(0,t.useCallback)(()=>"u">typeof window&&!!window.turnstile,[]),G=(0,t.useCallback)((e,t)=>{try{return window.turnstile.render(e,t)}catch(t){let e=k?x:$.current.onError;e?e(t instanceof Error?t.message:String(t)):console.error(t);return}},[k,k?x:null]);return(0,t.useEffect)(function(){_&&!I&&(d(B),(({render:e="explicit",onLoadCallbackName:t=o,scriptOptions:{nonce:r="",defer:n=!0,async:a=!0,id:s="",appendTo:l,onError:i,crossOrigin:d=""}={}})=>{let c=s||"cf-turnstile-script";
1if(document.getElementById(c))return;let u=document.createElement("script");u.id=c,u.src=`https://challenges.cloudflare.com/turnstile/v0/api.js?onload=${t}&render=${e}`,document.querySelector(`script[src="${u.src}"]`)||(u.defer=!!n,u.async=!!a,r&&u.setAttribute("nonce",r),d&&(u.crossOrigin=d),i&&(u.onerror=i,delete window[t]),("body"===l?document.body:document.getElementsByTagName("head")[0]).appendChild(u))})({onLoadCallbackName:B,scriptOptions:{...i,id:q}}))},[_,I,i,q,B]),(0,t.useEffect)(function(){"ready"!==s&&d(B).then(()=>F(!0)).catch(console.error)},[B]),(0,t.useEffect)(function(){if(!M.current||!I)return;let e=!1;return(async()=>{e||!M.current||(P.current=G(M.current,O),R(A),P.current&&m?.(P.current))})(),()=>{e=!0,P.current&&(window.turnstile.remove(P.current),z.current=!1)}},[D,I,O,A,G]),(0,t.useImperativeHandle)(l,()=>{let{turnstile:e}=window;return{getResponse:()=>e?.getResponse&&P.current&&U()?e.getResponse(P.current):void console.warn("Turnstile has not been loaded"),getResponsePromise:async(e=3e4,t=100)=>new Promise((r,n)=>{let o,a=async()=>{if(z.current&&window.turnstile&&P.current)try{let e=window.turnstile.getResponse(P.current);return o&&clearTimeout(o),e?r(e):n(Error("No response received"))}catch(e){return o&&clearTimeout(o),console.warn("Failed to get response",e),n(Error("Failed to get response"))}o||=setTimeout(()=>{o&&clearTimeout(o),n(Error("Timeout"))},e),await new Promise(e=>setTimeout(e,t)),await a()};a()}),reset(){if(!e?.reset||!P.current||!U())return void console.warn("Turnstile has not been loaded");R(A);try{z.current=!1,e.reset(P.current)}catch(e){console.warn(`Failed to reset Turnstile widget ${P.current}`,e)}},remove(){e?.remove&&P.current&&U()?(R(a.invisible),z.current=!1,e.remove(P.current),P.current=null):console.warn("Turnstile has not been loaded")},render(){if(!e?.render||!M.current||!U()||P.current)return void console.warn("Turnstile has not been loaded or container not found");let t=G(M.current,O);return P.current=t,P.current&&m?.(P.current),R(A),t},execute(){"execute"!==c.execution?console.warn('Execution mode is not set to "execute"'):e?.execute&&M.current&&P.current&&U()?(e.execute(M.current),R(E)):console.warn("Turnstile has not been loaded or container not found")},isExpired:()=>e?.isExpired&&P.current&&U()?e.isExpired(P.current):(console.warn("Turnstile has not been loaded"),!1)}},[P,c.execution,O,M,U,G,I,m,A,E]),(0,t.useEffect)(()=>{if(I||!L)return;if(window.turnstile)return void F(!0);let e=setInterval(()=>{window.turnstile&&(F(!0),clearInterval(e))},50);return()=>{clearInterval(e)}},[I,L]),(0,t.useEffect)(()=>{R(A)},[A]),(0,t.useEffect)(()=>{L&&"function"==typeof w&&w()},[L]),(0,r.jsx)(n,{ref:M,as:N,id:D,style:{...T,...j},...S})});c.displayName="Turnstile",e.s(["Turnstile",0,c])},533189,e=>{"use strict";let t=(0,e.i(235884).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],533189)},154906,446374,e=>{"use strict";var t=e.i(235884);let r=(0,t.default)("circle-user",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);e.s(["UserCircle",0,r],154906);let n=(0,t.default)("scan-search",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);e.s(["ScanSearch",0,n],446374)},936656,e=>{"use strict";let t=(0,e.i(235884).default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);e.s(["EyeOff",0,t],936656)},29150,e=>{"use strict";let t=(0,e.i(235884).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["FileText",0,t],29150)},127985,e=>{"use strict";let t=(0,e.i(235884).default)("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);e.s(["KeyRound",0,t],127985)},940380,e=>{"use strict";
1let t=(0,e.i(235884).default)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);e.s(["Lock",0,t],940380)},882087,e=>{"use strict";let t=(0,e.i(235884).default)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);e.s(["Mail",0,t],882087)},796877,e=>{"use strict";var t=e.i(848277),r=e.i(330668),n=e.i(696086),o=e.i(392506),a=e.i(816506),s=e.i(442588),l=e.i(47737),i=e.i(616867),d=e.i(882087),c=e.i(952443),u=e.i(533189),m=e.i(800216),g=e.i(940380),f=e.i(163753),x=e.i(936656),p=e.i(127985),h=e.i(1799),b=e.i(883595),y=e.i(13625),w=e.i(575465),v=e.i(541428);function j({value:e,onChange:n,onComplete:o,length:a=6,disabled:s=!1,autoFocus:l=!0,error:i=!1}){let d=(0,r.useRef)([]);function c(e){e.preventDefault();let t=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,a);if(t.length>0){n(t);let e=Math.min(t.length,a-1);d.current[e]?.focus(),t.length===a&&o?.(t)}}return(0,r.useEffect)(()=>{l&&d.current[0]&&d.current[0].focus()},[l]),(0,t.jsx)("div",{className:"flex items-center justify-center gap-2 sm:gap-3",children:Array.from({length:a}).map((r,l)=>(0,t.jsx)("input",{ref:e=>{d.current[l]=e},type:"text",inputMode:"numeric",autoComplete:"one-time-code",maxLength:1,value:e[l]||"",onChange:t=>(function(t,r){let s=r.replace(/\D/g,"").slice(-1),l=e.split("");for(l[t]=s;l.length<a;)l.push("");let i=l.join("").slice(0,a);n(i),s&&t<a-1&&d.current[t+1]?.focus(),i.length===a&&i.replace(/\D/g,"").length===a&&o?.(i)})(l,t.target.value),onKeyDown:t=>(function(t,r){if("Backspace"===r.key){if(!e[t]&&t>0){r.preventDefault();let o=e.split("");o[t-1]="",n(o.join("")),d.current[t-1]?.focus()}else if(e[t]){r.preventDefault();let o=e.split("");o[t]="",n(o.join(""))}}else"ArrowLeft"===r.key&&t>0?(r.preventDefault(),d.current[t-1]?.focus()):"ArrowRight"===r.key&&t<a-1&&(r.preventDefault(),d.current[t+1]?.focus())})(l,t),onPaste:c,disabled:s,"aria-label":`Digit ${l+1}`,className:(0,v.cn)("h-12 w-10 sm:h-14 sm:w-12 text-center text-xl sm:text-2xl font-semibold tabular-nums","rounded-lg border-2 transition-all outline-none","bg-card text-foreground","border-border","focus:border-brand-orange focus:ring-2 focus:ring-brand-orange/20","disabled:cursor-not-allowed disabled:opacity-50",i&&"border-red-500 focus:border-red-500 focus:ring-red-500/20")},l))})}var N=e.i(154906),_=e.i(446374),k=e.i(942944),S=e.i(29150);let C=[N.UserCircle,_.ScanSearch,k.BarChart3,S.FileText];function E(){let e=(0,w.useDictionary)(),n=(0,r.useRef)(null),o=(0,r.useRef)(null),a=(0,r.useRef)([]),s=(0,r.useRef)(0),l=[{title:e.login.flow_step1,desc:e.login.flow_step1_desc,icon:C[0],active:!0},{title:e.login.flow_step2,desc:e.login.flow_step2_desc,icon:C[1]},{title:e.login.flow_step3,desc:e.login.flow_step3_desc,icon:C[2]},{title:e.login.flow_step4,desc:e.login.flow_step4_desc,icon:C[3]}];return(0,r.useEffect)(()=>{let e=n.current,t=o.current;if(!e||!t)return;let r=e.getContext("2d");if(!r)return;let l=0,i=0;function d(){if(!e||!t||!r)return;let n=t.getBoundingClientRect(),o=window.devicePixelRatio||1;l=n.width,i=n.height,e.width=l*o,e.height=i*o,e.style.width=`${l}px`,e.style.height=`${i}px`,r.setTransform(o,0,0,o,0,0),function(){if(!t)return;let e=t.getBoundingClientRect();a.current=Array.from(t.querySelectorAll("[data-node]")).map(t=>{let r=t.getBoundingClientRect();return{x:r.left-e.left+r.width/2,y:r.top-e.top+r.height/2}})}()}let c=[];for(let e=0;e<3;e++)for(let t=0;t<2;t++)c.push({curveIndex:e,t:Math.random(),speed:.002+.003*Math.random(),size:2+1.5*Math.random(),opacity:.3+.5*Math.random()});function u(e){let t=a.current;if(t.length<4)return null;let r=t[e],n=t[e+1];if(!r||!n)return null;let o=(n.y-r.y)*.4;return{p0:r,p1:n,cp1:{x:r.x+30+10*e,y:r.y+o},cp2:{x:n.x-30-10*e,y:n.y-o}}}let m=0;d(),function e(){if(!r)return;r.clearRect(0,0,l,i);let t=a.current;if(t.length<4){s.current=requestAnimationFrame(e);return}m+=.01;for(let e=0;e<3;e++){let t=u(e);t&&(r.beginPath(),r.moveTo(t.p0.x,t.p0.y),r.bezierCurveTo(t.cp1.x,t.cp1.y,t.cp2.x,t.cp2.y,t.p1.x,t.p1.y),r.strokeStyle="rgba(232, 89, 12, 0.12)",r.lineWidth=1.5,r.stroke())}for(let e of c){let t=u(e.curveIndex);if(!t)continue;e.t+=e.speed,e.t>1&&(e.t=0);let n=function(e,t,r,n,o){let a=1-o;
1return{x:a*a*a*e.x+3*a*a*o*t.x+3*a*o*o*r.x+o*o*o*n.x,y:a*a*a*e.y+3*a*a*o*t.y+3*a*o*o*r.y+o*o*o*n.y}}(t.p0,t.cp1,t.cp2,t.p1,e.t),o=r.createRadialGradient(n.x,n.y,0,n.x,n.y,4*e.size);o.addColorStop(0,"rgba(232, 89, 12, 0.5)"),o.addColorStop(1,"rgba(232, 89, 12, 0)"),r.beginPath(),r.arc(n.x,n.y,4*e.size,0,2*Math.PI),r.fillStyle=o,r.globalAlpha=.4*e.opacity,r.fill(),r.beginPath(),r.arc(n.x,n.y,e.size,0,2*Math.PI),r.fillStyle="#E8590C",r.globalAlpha=e.opacity,r.fill(),r.globalAlpha=1}for(let e=0;e<t.length;e++){let n=t[e],o=.5+.5*Math.sin(2*m+.8*e),a=r.createRadialGradient(n.x,n.y,0,n.x,n.y,25);a.addColorStop(0,`rgba(232, 89, 12, ${.08+.06*o})`),a.addColorStop(1,"rgba(232, 89, 12, 0)"),r.beginPath(),r.arc(n.x,n.y,25,0,2*Math.PI),r.fillStyle=a,r.fill()}s.current=requestAnimationFrame(e)}();let g=new ResizeObserver(()=>d());return g.observe(t),()=>{cancelAnimationFrame(s.current),g.disconnect()}},[]),(0,t.jsxs)("div",{className:"hidden lg:flex lg:w-[30%] flex-col items-center justify-center bg-muted/30 border-l border-border relative overflow-hidden px-6 overflow-y-auto",children:[(0,t.jsx)("div",{className:"absolute top-1/3 left-1/2 -translate-x-1/2 h-[400px] w-[400px] rounded-full bg-brand-orange/3 blur-[100px]"}),(0,t.jsxs)("div",{className:"relative z-10 mb-8 text-center",children:[(0,t.jsx)("p",{className:"mb-2 text-xs font-semibold uppercase tracking-[0.2em] text-brand-orange",children:e.common.process}
1),(0,t.jsx)("h3",{className:"text-xl font-bold text-foreground leading-tight",children:e.home.how_it_works})]}),(0,t.jsxs)("div",{ref:o,className:"relative flex flex-col items-center gap-10 py-8",children:[(0,t.jsx)("canvas",{ref:n,className:"pointer-events-none absolute inset-0"}),l.map((r,n)=>{let o=r.icon;return(0,t.jsxs)("div",{className:"relative z-10 flex flex-col items-center text-center max-w-[200px]",children:[(0,t.jsx)("div",{"data-node":!0,className:`mb-4 flex h-14 w-14 items-center justify-center rounded-2xl border backdrop-blur-sm ${r.active?"border-brand-orange bg-brand-orange/15 ring-4 ring-brand-orange/10":"border-brand-orange/20 bg-brand-orange/5"}`,children:(0,t.jsx)(o,{className:`h-6 w-6 ${r.active?"text-brand-orange":"text-brand-orange/50"}`})}),(0,t.jsxs)("div",{className:`mb-1 text-xs font-semibold uppercase tracking-[0.15em] ${r.active?"text-brand-orange":"text-brand-orange/40"}`,children:[e.common.step," ",n+1]}),(0,t.jsx)("h3",{className:`text-base font-bold ${r.active?"text-foreground":"text-muted-foreground"}`,children:r.title}),r.active&&(0,t.jsxs)("span",{className:"mt-1.5 inline-flex items-center gap-1.5 rounded-full bg-emerald-100 dark:bg-emerald-900/30 px-2.5 py-0.5 text-[11px] font-medium text-emerald-700 dark:text-emerald-400",children:[(0,t.jsx)("span",{className:"h-2 w-2 rounded-full bg-emerald-500 animate-pulse"}),e.login.flow_you_are_here]}),(0,t.jsx)("p",{className:`mt-2 text-xs leading-relaxed ${r.active?"text-muted-foreground":"text-muted-foreground/50"}`,children:r.desc})]},n)})]}),(0,t.jsxs)("div",{className:"relative z-10 mt-8 flex items-center gap-3 text-xs text-muted-foreground",children:[(0,t.jsxs)("div",{className:"flex -space-x-2",children:[(0,t.jsx)("div",{className:"h-6 w-6 rounded-full bg-brand-orange/20 border-2 border-background"}),(0,t.jsx)("div",{className:"h-6 w-6 rounded-full bg-blue-500/20 border-2 border-background"}),(0,t.jsx)("div",{className:"h-6 w-6 rounded-full bg-emerald-500/20 border-2 border-background"})]}),e.login.flow_social_proof]})]})}var A=e.i(339235);let T="0x4AAAAAADLplgAAtGx8H78S";function R({initialMode:e}){let v=(0,n.useSearchParams)(),N=(0,n.useRouter)(),_=(0,n.useParams)(),k=_?.lang==="en"?"en":"sk",S=(0,w.useDictionary)(),{resolvedTheme:C}=(0,A.useTheme)(),M=(0,o.safeNextPath)(v.get("next"),"/dashboard"),I=v.get("error");(0,r.useEffect)(()=>{"/dashboard"!==M&&(0,o.rememberNextAfterLogin)(M)},[M]);let[F,P]=(0,r.useState)("password"),[z,D]=(0,r.useState)("email"),[$,q]=(0,r.useState)(""),[L,B]=(0,r.useState)(""),[O,U]=(0,r.useState)(""),[G,H]=(0,r.useState)(!1),[W,K]=(0,r.useState)(!1),[V,J]=(0,r.useState)(!1),[Z,Q]=(0,r.useState)(!1),[X,Y]=(0,r.useState)(!1),[ee,et]=(0,r.useState)(!1),[er,en]=(0,r.useState)(!1),[eo,ea]=(0,r.useState)("auth_callback_failed"===I?S.errors.auth_callback_failed:""),[es,el]=(0,r.useState)(!1),[ei,ed]=(0,r.useState)(""),ec=(0,r.useRef)(null),eu=!!T;function em(){ed(""),ec.current?.reset()}async function eg(e){if(e.preventDefault(),ea(""),el(!1),$.trim()){if(eu&&!ei)return void ea(S.login.captcha_required);Q(!0);try{await (0,i.sendOtpCode)($.trim(),ei||void 0,S.auth_errors),D("code")}catch(e){ea(e instanceof Error?e.message:String(e)),em()}finally{Q(!1)}}}async function ef(t){let r=t??L;if(6===r.length){ea(""),et(!0);try{await (0,i.verifyOtpCode)($.trim(),r,S.auth_errors),"signup"===e?((0,y.queueAuthEvent)("sign_up","otp"),await (0,b.trackConversionBeforeUnload)("sign_up",{method:"otp"},{email:$.trim(),capiType:"sign_up"})):(0,y.queueAuthEvent)("login","otp"),window.location.href=M}catch(e){ea(e instanceof Error?e.message:S.login.otp_invalid_code),B(""),et(!1)}}}async function ex(){if(ea(""),eu&&!ei)return void ea(S.login.captcha_required);Y(!0),el(!1);try{await (0,i.sendOtpCode)($.trim(),ei||void 0,S.auth_errors),el(!0),em(),setTimeout(()=>el(!1),3e3)}catch(e){ea(e instanceof Error?e.message:String(e)),em()}finally{Y(!1)}}async function ep(){ea(""),en(!0);try{await (0,i.loginWithGoogle)()}catch(e){ea(e instanceof Error?e.message:String(e)),en(!1)}}function eh(t){t!==e&&(ea(""),D("email"),B(""),K(!1),N.push(`/${k}/${t}`))}async function eb(t){if(t.preventDefault(),ea(""),W){if(!$.trim())return;if(eu&&!ei)return void ea(S.login.captcha_required);Q(!0);try{await (0,i.resetPassword)($.trim(),ei||void 0,S.auth_errors),J(!0)}catch(e){ea(e instanceof Error?e.message:String(e)),em()}finally{Q(!1)}return}if($.trim()&&O.trim()){if(eu&&!ei)return void ea(S.login.captcha_required);Q(!0);try{if("signup"===e){let e=O.length<12?S.login.pw_min_length:/[a-z]/.test(O)?/[A-Z]/.test(O)?/[0-9]/.test(O)?/[^a-zA-Z0-9]/.test(O)?null:S.login.pw_special:S.login.pw_digit:S.login.pw_uppercase:S.login.pw_lowercase;if(e){ea(e),Q(!1);return}await (0,i.signUp)($.trim(),O,ei||void 0,S.auth_errors),D("code"),B(""),em()}else await (0,i.loginWithPassword)($.trim(),O,ei||void 0,S.auth_errors),(0,y.queueAuthEvent)("login","password"),window.location.href=M}catch(e){ea(e instanceof Error?e.message:String(e)),em()}finally{Q(!1)}}}let ey="code"===z?S.login.otp_code_sent_title:W?S.login.forgot_title:"signup"===e?S.login.otp_signup_t
1itle:S.login.otp_login_title;return V?(0,t.jsx)("div",{className:"flex min-h-screen items-center justify-center bg-background px-4",children:(0,t.jsx)("div",{className:"w-full max-w-md",children:(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-card p-8 shadow-sm text-center",children:[(0,t.jsx)("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-brand-orange/10",children:(0,t.jsx)(p.KeyRound,{className:"h-6 w-6 text-brand-orange"})}),(0,t.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:S.login.check_email}),(0,t.jsxs)("p",{className:"mt-2 text-sm text-muted-foreground",children:[S.login.reset_sent," ",(0,t.jsx)("span",{className:"font-medium text-foreground",children:$}),"."]}),(0,t.jsx)("button",{onClick:()=>{J(!1),K(!1),ea("")},className:"mt-6 text-sm text-brand-orange hover:underline",children:S.login.back_to_login})]})})}):(0,t.jsxs)("div",{className:"flex min-h-screen",children:[(0,t.jsx)("div",{className:"flex w-full lg:w-[70%] flex-col items-center justify-center bg-background px-6 sm:px-12 py-12",children:(0,t.jsxs)("div",{className:"w-full max-w-[440px]",children:[(0,t.jsxs)("div",{className:"mb-8 text-center",children:[(0,t.jsxs)(a.default,{href:`/${k}`,children:[(0,t.jsx)(s.default,{src:"/be1st-logo.svg",alt:"Be1st.ai",width:150,height:53,className:"mx-auto h-10 w-auto dark:hidden",priority:!0}),(0,t.jsx)(s.default,{src:"/be1st-logo-dark.svg",alt:"Be1st.ai",width:150,height:53,className:"mx-auto hidden h-10 w-auto dark:block",priority:!0})]}),(0,t.jsx)("h1",{className:"mt-6 text-2xl font-bold text-foreground",children:ey}),"email"===z&&!W&&(0,t.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"code"===F?S.login.otp_subtitle:S.login.password_subtitle}),W&&(0,t.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:S.login.forgot_description}),"code"===z&&(0,t.jsxs)("p",{className:"mt-2 text-sm text-muted-foreground",children:[S.login.otp_code_sent_to," ",(0,t.jsx)("span",{className:"font-medium text-foreground",children:$})]})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-card p-6 sm:p-8 shadow-sm",children:[eo&&(0,t.jsx)("div",{className:"mb-4 rounded-lg bg-destructive/10 border border-destructive/20 px-4 py-3 text-sm text-destructive",children:eo}),es&&(0,t.jsx)("div",{className:"mb-4 rounded-lg bg-emerald-50 dark:bg-emerald-950/30 border border-emerald-200 dark:border-emerald-800 px-4 py-3 text-sm text-emerald-700 dark:text-emerald-300",children:S.login.otp_resend_success}),"email"===z&&(0,t.jsxs)(t.Fragment,{children:[!W&&(0,t.jsxs)("div",{className:"mb-5 flex rounded-lg bg-muted p-1",children:[(0,t.jsx)("button",{type:"button",onClick:()=>eh("login"),className:`flex-1 rounded-md py-2 text-sm font-medium transition-colors ${"login"===e?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:S.login.login_tab}),(0,t.jsx)("button",{type:"button",onClick:()=>eh("signup"),className:`flex-1 rounded-md py-2 text-sm font-medium transition-colors ${"signup"===e?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:S.login.signup_tab})]}),!W&&(0,t.jsxs)("div",{className:"mb-5 flex rounded-lg border border-border p-1 text-xs",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{P("password"),ea("")},className:`flex-1 inline-flex items-center justify-center gap-1.5 rounded-md py-1.5 font-medium transition-colors ${"password"===F?"bg-brand-orange/10 text-brand-orange":"text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(g.Lock,{className:"h-3.5 w-3.5"}),S.login.method_password]}),(0,t.jsxs)("button",{type:"button",onClick:()=>{P("code"),ea("")},className:`flex-1 inline-flex items-center justify-center gap-1.5 rounded-md py-1.5 font-medium transition-colors ${"code"===F?"bg-brand-orange/10 text-brand-orange":"text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(h.ShieldCheck,{className:"h-3.5 w-3.5"}),S.login.method_code]})]}),!W&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",onClick:ep,disabled:er||Z,className:"flex w-full items-center justify-center gap-3 rounded-lg border border-input bg-background px-4 py-2.5 text-sm font-medium text-foreground transition-colors hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed",children:[er?(0,t.jsx)("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-foreground border-t-transparent"}):(0,t.jsx)("img",{src:"/Google_logo.svg",alt:"","aria-hidden":"true",className:"h-4 w-4"}),"signup"===e?S.login.google_signup:S.login.google_login]}),(0,t.jsxs)("div",{className:"my-4 flex items-center gap-3",children:[(0,t.jsx)("div",{className:"h-px flex-1 bg-border"}),(0,t.jsx)("span",{className:"text-xs uppercase text-muted-foreground",children:S.login.or_divider}),(0,t.jsx)("div",{className:"h-px flex-1 bg-border"})]})]}),"code"===F&&!W&&(0,t.jsxs)("form",{onSubmit:eg,className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"email",className:"mb-1.5 block text-sm font-medium text-foreground",children:S.login.email_label}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(d.Mail,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)("input",{id:"email",name:"email",type:"email",required:!0,autoFocus:!0,autoComplete:"email",placeholder:S.login.email_placeholder,value:$,onChange:e=>q(e.target.value),className:"w-full rounded-lg border border-input bg-background py-2.5 pl-10 pr-4 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]})]}),(0,t.jsx)("button",{type:"submit",disabled:Z||er||!$.trim(),className:"flex w-full items-center justify-center gap-2 rounded-lg bg-brand-orange px-4 py-3 text-sm font-semibold text-white transition-colors hover:bg-brand-orange-hover disabled:opacity-50 disabled:cursor-not-allowed",children:Z?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"}),S.login.otp_sending]}):(0,t.jsxs)(t.Fragment,{children:[S.login.otp_continue,(0,t.jsx)(c.ArrowRight,{className:"h-4 w-4"})]})})]}),"password"===F&&!W&&(0,t.jsxs)("form",{onSubmit:eb,className:"space-y-4",method:"post",action:"#",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"email-pwd",className:"mb-1.5 block text-sm font-medium text-foreground",children:S.login.email_label}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(d.Mail,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)("input",{id:"email-pwd",name:"email",type:"email",required:!0,autoComplete:"email",placeholder:S.login.email_placeholder,value:$,onChange:e=>q(e.target.value),className:"w-full rounded-lg border border-input bg-background py-2.5 pl-10 pr-4 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"password",className:"mb-1.5 block text-sm font-medium text-foreground",children:S.login.password_label}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(g.Lock,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)("input",{id:"password",name:"password",type:G?"text":"password",required:!0,minLength:"signup"===e?12:1,autoComplete:"signup"===e?"new-password":"current-password",placeholder:"signup"===e?S.login.password_placeholder_signup:S.login.password_placeholder_login,value:O,onChange:e=>U(e.target.value),className:"w-full rounded-lg border border-input bg-background py-2.5 pl-10 pr-10 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"}),(0,t.jsx)("button",{type:"button",onClick:()=>H(!G),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,
1children:G?(0,t.jsx)(x.EyeOff,{className:"h-4 w-4"}):(0,t.jsx)(f.Eye,{className:"h-4 w-4"})})]})]}),"login"===e&&(0,t.jsx)("div",{className:"text-right",children:(0,t.jsx)("button",{type:"button",onClick:()=>{K(!0),ea(""),U("")},className:"text-xs text-muted-foreground hover:text-brand-orange transition-colors",children:S.login.forgot_password})}),(0,t.jsx)("button",{type:"submit",disabled:Z||er||!$.trim()||!O.trim(),className:"flex w-full items-center justify-center gap-2 rounded-lg bg-brand-orange px-4 py-3 text-sm font-semibold text-white transition-colors hover:bg-brand-orange-hover disabled:opacity-50 disabled:cursor-not-allowed",children:Z?(0,t.jsx)("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"}):(0,t.jsxs)(t.Fragment,{children:["login"===e?S.login.submit_login:S.login.submit_signup,(0,t.jsx)(c.ArrowRight,{className:"h-4 w-4"})]})})]}),W&&(0,t.jsxs)("form",{onSubmit:eb,className:"space-y-4",method:"post",action:"#",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"email-forgot",className:"mb-1.5 block text-sm font-medium text-foreground",children:S.login.email_label}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(d.Mail,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)("input",{id:"email-forgot",name:"email",type:"email",required:!0,autoFocus:!0,autoComplete:"email",placeholder:S.login.email_placeholder,value:$,onChange:e=>q(e.target.value),className:"w-full rounded-lg border border-input bg-background py-2.5 pl-10 pr-4 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]})]}),(0,t.jsx)("button",{type:"submit",disabled:Z||!$.trim(),className:"flex w-full items-center justify-center gap-2 rounded-lg bg-brand-orange px-4 py-3 text-sm font-semibold text-white transition-colors hover:bg-brand-orange-hover disabled:opacity-50 disabled:cursor-not-allowed",children:Z?(0,t.jsx)("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"}):(0,t.jsxs)(t.Fragment,{children:[S.login.submit_forgot,(0,t.jsx)(c.ArrowRight,{className:"h-4 w-4"})]})}),(0,t.jsx)("button",{type:"button",onClick:()=>{K(!1),ea("")},className:"w-full text-center text-sm text-muted-foreground hover:text-foreground transition-colors",children:S.login.back_to_login})]})]}),"code"===z&&(0,t.jsxs)("div",{className:"space-y-5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-3 block text-sm font-medium text-foreground text-center",children:S.login.otp_code_label}),(0,t.jsx)(j,{value:L,onChange:B,onComplete:ef,disabled:ee,error:!!eo})]}),(0,t.jsx)("button",{type:"button",onClick:()=>ef(),disabled:ee||6!==L.length,className:"flex w-full items-center justify-center gap-2 rounded-lg bg-brand-orange px-4 py-3 text-sm font-semibold text-white transition-colors hover:bg-brand-orange-hover disabled:opacity-50 disabled:cursor-not-allowed",children:ee?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"}),S.login.otp_verifying]}):(0,t.jsxs)(t.Fragment,{children:[S.login.otp_verify,(0,t.jsx)(c.ArrowRight,{className:"h-4 w-4"})]})}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,t.jsxs)("button",{type:"button",onClick:function(){D("email"),B(""),ea(""),el(!1)},disabled:ee,className:"inline-flex items-center gap-1 text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50",children:[(0,t.jsx)(u.ArrowLeft,{className:"h-3.5 w-3.5"}),S.login.otp_change_email]}),(0,t.jsx)("button",{type:"button",onClick:ex,disabled:X||ee,className:"text-brand-orange hover:underline disabled:opacity-50",children:X?S.login.otp_resending:S.login.otp_resend})]}),(0,t.jsx)("p",{className:"text-center text-xs text-muted-foreground",children:S.login.otp_expires_note})]}),eu&&"email"===z&&(0,t.jsx)("div",{className:"mt-4 flex justify-center",children:(0,t.jsx)(l.Turnstile,{ref:ec,siteKey:T,options:{theme:"dark"===C?"dark":"light",size:"flexible",language:k},onSuccess:e=>{ed(e),ea("")},onError:()=>{ed(""),ea(S.login.captcha_failed)},onExpire:()=>{ed(""),ea(S.login.captcha_expired)}})})]}),(0,t.jsxs)("div",{className:"mt-6 rounded-xl border border-border bg-card p-5",children:[(0,t.jsx)("p",{className:"text-base font-bold text-foreground text-center",children:S.login.flow_ai_teaser}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-1 text-center",children:S.login.flow_ai_teaser_sub}),(0,t.jsx)("div",{className:"mt-4 flex items-center justify-center gap-6",children:[{src:"/Chatgpt_logo.svg",alt:"ChatGPT"},{src:"/Google_Gemini_logo.svg",alt:"Gemini"},{src:"/Perplexity_logo.svg",alt:"Perplexity"}].map(e=>(0,t.jsx)("img",{src:e.src,alt:e.alt,className:"h-8 w-auto hover:scale-110 transition-transform"},e.alt))})]}),(0,t.jsxs)("div",{className:"mt-4 flex items-center justify-center gap-4 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(m.Check,{className:"h-3 w-3 text-emerald-500"}
1)," ",S.login.flow_badge_free]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(m.Check,{className:"h-3 w-3 text-emerald-500"})," ",S.login.flow_badge_no_card]})]}),(0,t.jsxs)("p",{className:"mt-4 text-center text-xs text-muted-foreground",children:[S.login.tos_prefix," ",(0,t.jsx)(a.default,{href:`/${k}/terms`,className:"underline hover:text-foreground",children:S.login.tos_link})," ",S.common.and," ",(0,t.jsx)(a.default,{href:`/${k}/privacy`,className:"underline hover:text-foreground",children:S.login.privacy_link}),"."]})]})}),(0,t.jsx)(E,{})]})}e.s(["default",0,function({initialMode:e}){return(0,t.jsx)(r.Suspense,{fallback:(0,t.jsx)("div",{className:"flex min-h-screen items-center justify-center bg-background",children:(0,t.jsx)("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"})}),children:(0,t.jsx)(R,{initialMode:e})})}],796877)},392506,e=>{"use strict";let t="be1st_next_after_login";function r(e,t){return!e||!e.startsWith("/")||e.startsWith("//")||e.startsWith("/\\")?t:e}e.s(["consumeNextAfterLogin",0,function(){try{let e=localStorage.getItem(t);if(!e)return null;localStorage.removeItem(t);let n=JSON.parse(e);if("string"!=typeof n?.path||"number"!=typeof n?.at||Date.now()-n.at>18e5)return null;return r(n.path,"")||null}catch{return null}},"rememberNextAfterLogin",0,function(e){let n=r(e,"");if(n)try{localStorage.setItem(t,JSON.stringify({path:n,at:Date.now()}))}catch{}},"safeNextPath",0,r])}]);
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.