import{r as t,X as k,G as _,a as I,b as e,S as F}from"./app-DTeOhhdM.js";import{I as C}from"./InputError-BmXs89lz.js";import{c as f}from"./createLucideIcon-0QtVMxKe.js";/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const L=[["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"}]],A=f("eye-off",L);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const D=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],P=f("eye",D);function G({status:z,canResetPassword:M,appEnv:g}){const[x,b]=t.useState("Demo Shop"),[r,l]=t.useState(null),[w,o]=t.useState(!1),[j,n]=t.useState(!1),[i,y]=t.useState(!1),{flash:a}=k().props,{data:m,setData:u,post:v,processing:c,errors:p,reset:N}=_({email:"",password:"",remember:!1});t.useEffect(()=>{I.get(route("shop.name")).then(s=>{var d;return((d=s.data)==null?void 0:d.shop_name)&&b(s.data.shop_name)}).catch(()=>{})},[]),t.useEffect(()=>()=>N("password"),[]),t.useEffect(()=>{const s=h=>{h.preventDefault(),l(h),o(!0)};return window.addEventListener("beforeinstallprompt",s),(window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone===!0||document.referrer.includes("android-app://"))&&n(!0),window.addEventListener("appinstalled",()=>{n(!0),o(!1),l(null)}),()=>window.removeEventListener("beforeinstallprompt",s)},[]);const S=()=>{r&&(r.prompt(),r.userChoice.then(({outcome:s})=>{s==="accepted"&&n(!0),l(null),o(!1)}))},E=s=>{s.preventDefault(),v(route("login"),{onSuccess:()=>window.location.assign("/")})};return e.jsxs("main",{className:"min-h-screen w-full bg-[#f8fafc] flex items-center justify-center p-6 relative overflow-hidden",children:[e.jsx(F,{title:"Login"}),e.jsx("div",{className:"absolute top-[-10%] left-[-10%] w-[40%] h-[40%] bg-[#549F46]/10 rounded-full blur-[120px]"}),e.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[40%] h-[40%] bg-blue-100 rounded-full blur-[120px]"}),e.jsxs("section",{className:"relative w-full max-w-[1000px] flex flex-col md:flex-row bg-white/80 backdrop-blur-xl rounded-[32px] shadow-[0_20px_50px_rgba(0,0,0,0.05)] border border-white overflow-hidden",children:[e.jsxs("div",{className:"hidden md:flex md:w-1/2 bg-gradient-to-br from-[#549F46] to-[#22660A] p-12 flex-col justify-between text-white relative",children:[e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"w-12 h-1 bg-white/40 rounded-full mb-6"}),e.jsxs("h2",{className:"text-3xl font-bold leading-tight",children:["Elevate your ",e.jsx("br",{})," Business Experience."]}),e.jsxs("p",{className:"mt-4 text-white/80 font-medium",children:["Everything you need to manage ",x," in one powerful dashboard."]})]}),e.jsxs("div",{className:"relative z-10 flex items-center gap-4 bg-white/10 backdrop-blur-md p-4 rounded-2xl border border-white/10",children:[e.jsx("div",{className:"bg-white p-2 rounded-lg shadow-lg",children:e.jsx("img",{src:"img/logo/logo.jpg",alt:"Logo",className:"w-8 h-8 object-contain"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-bold uppercase tracking-wider opacity-70",children:"Authenticated Portal"}),e.jsx("p",{className:"text-sm font-semibold",children:x})]})]}),e.jsx("div",{className:"absolute top-20 right-[-50px] w-64 h-64 bg-white/10 rounded-full blur-3xl"})]}),e.jsx("div",{className:"flex-1 p-8 md:p-14 lg:p-16",children:e.jsxs("div",{className:"max-w-sm mx-auto",children:[e.jsxs("header",{className:"mb-10",children:[e.jsx("h1",{className:"text-3xl font-black text-gray-900 tracking-tight",children:"Login"}),e.jsx("p",{className:"text-gray-500 mt-2 font-medium",children:"Enter your credentials to access your account."})]}),(a==null?void 0:a.success)&&e.jsx("div",{className:"mb-6 p-4 bg-green-50 border border-green-200 rounded-2xl",children:e.jsx("p",{className:"text-sm font-semibold text-green-800",children:a.success})}),e.jsxs("form",{onSubmit:E,className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2 group",children:[e.jsx("label",{className:"text-[13px] font-bold text-gray-700 ml-1 transition-colors group-focus-within:text-[#549F46]",children:"Email or Name"}),e.jsx("div",{className:"relative",children:e.jsx("input",{type:"text",value:m.email,onChange:s=>u("email",s.target.value),className:"peer w-full bg-gray-100/50 border-2  border-gray-300 rounded-2xl py-4 px-5 text-gray-800 transition-all focus:bg-white focus:border-[#549F46] focus:ring-0 focus:shadow-[0_0_20px_rgba(84,159,70,0.1)] outline-none",placeholder:"Enter your email or name"})})]}),e.jsxs("div",{className:"space-y-2 group",children:[e.jsx("div",{className:"flex justify-between items-center ml-1",children:e.jsx("label",{className:"text-[13px] font-bold text-gray-700 transition-colors group-focus-within:text-[#549F46]",children:"Password"})}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:"login-password",type:i?"text":"password",value:m.password,onChange:s=>u("password",s.target.value),className:"peer w-full bg-gray-100/50 border-2 border-gray-300 rounded-2xl py-4 px-5 pr-14 text-gray-800 transition-all focus:bg-white focus:border-[#549F46] focus:ring-0 focus:shadow-[0_0_20px_rgba(84,159,70,0.1)] outline-none",placeholder:"••••••••"}),e.jsx("button",{type:"button",onClick:()=>y(s=>!s),className:"absolute right-4 top-1/2 -translate-y-1/2 text-gray-500 hover:text-[#549F46] transition-colors","aria-label":i?"Hide password":"Show password",children:i?e.jsx(A,{size:20}):e.jsx(P,{size:20})})]})]}),e.jsx(C,{message:p.email||p.password,className:"text-sm font-semibold"}),e.jsx("button",{disabled:c,className:"group relative w-full bg-[#22660A] text-white font-bold py-4 rounded-2xl transition-all hover:bg-[#2c7e11] active:scale-[0.98] disabled:opacity-70 overflow-hidden shadow-xl shadow-green-900/10",children:e.jsxs("span",{className:"relative z-10 flex items-center justify-center gap-2",children:[c?"Signing in...":"Continue",!c&&e.jsx("i",{className:"bx bx-right-arrow-alt text-xl group-hover:translate-x-1 transition-transform"})]})})]}),e.jsxs("div",{className:"mt-10 flex flex-col items-center gap-6",children:[e.jsx("div",{className:"w-full h-px bg-gray-100"}),e.jsxs("div",{className:"flex flex-col items-center gap-4 w-full",children:[!j&&w&&e.jsxs("button",{type:"button",onClick:S,className:"flex items-center gap-3 text-gray-500 hover:text-[#549F46] transition-colors font-bold text-sm w-full justify-center group",children:[e.jsx("div",{className:"w-10 h-10 flex items-center justify-center bg-gray-100 rounded-xl group-hover:bg-[#549F46]/10",children:e.jsx("i",{className:"bx bx-download text-xl"})}),"Install App"]}),g==="demo"&&e.jsxs("a",{href:route("register"),className:"flex items-center gap-3 text-gray-500 hover:text-[#549F46] transition-colors font-bold text-sm",children:[e.jsx("div",{className:"w-10 h-10 flex items-center justify-center bg-gray-100 rounded-xl group-hover:bg-[#549F46]/10",children:e.jsx("i",{className:"bx bx-user-plus text-xl"})}),"Create Company Account"]})]})]})]})})]}),e.jsx("footer",{className:"absolute bottom-8 text-center",children:e.jsxs("p",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-[0.2em]",children:["System Secured by ",e.jsx("a",{href:"https://www.datadss.com",target:"_blank",className:"text-gray-900",children:"DATA DSS LTD"})]})})]})}export{G as default};
