1import{u as x,i as h,r as d,j as e,p as f}from"./index-c-vW2Iaa.js";import{s as b}from"./useActiveDossier-BrsWY3wA.js";import"./clientUi-D8h0ubSJ.js";const y=()=>{const{t:s}=x(),[o]=h(),[a,i]=d.useState(null);return d.useEffect(()=>{const c=o.get("token");if(!c){i(s("client:autoLogin.errorInvalidLink"));return}(async()=>{try{const n=await f.customerAutoLogin(c),t=n.customer;localStorage.setItem("customer_token",n.accessToken),localStorage.setItem("customer_data",JSON.stringify(t));const u={id:t.id,email:t.email,name:`${t.firstName||""} ${t.lastName||""}`.trim(),role:"client",phone:t.phone};localStorage.setItem("go2025_user",JSON.stringify(u)),localStorage.setItem("go2025_token",n.accessToken);const r=Number(o.get("booking")),l=Number.isFinite(r)&&r>0;b(l?r:null);const m=o.get("next")||"",g=/^\/client\/[a-z0-9\-/]*(\?[a-z0-9\-_=&%.]*)?$/i.test(m)?m:null;window.location.href=g||(l?"/client/dashboard":"/client/dossiers")}catch(n){i(n.message||s("client:autoLogin.errorInvalidOrExpired"))}})()},[o,s]),a?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50",children:e.jsxs("div",{className:"bg-white p-8 rounded-xl shadow-lg text-center max-w-md",children:[e.jsx("p",{className:"text-red-600 font-semibold mb-4",children:a}),e.jsx("a",{href:"/client/login",className:"text-blue-600 hover:underline font-medium",children:s("client:autoLogin.loginManually")})]})}):e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50",children:e.jsxs("div",{className:"bg-white p-8 rounded-xl shadow-lg text-center",children:[e.jsx("div",{className:"animate-spin w-8 h-8 border-4 border-blue-600 border-t-transparent rounded-full mx-auto mb-4"}),e.jsx("p",{className:"text-gray-600 font-medium",children:s("client:autoLogin.connecting")})]})})};export{y 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.