import{K as x,m as p,j as e,L as u}from"./app-BMysVXg2.js";import{S as h,h as b}from"./index-BBHaahpi.js";import{G as g}from"./iconBase-BRa7Gs07.js";import{a as j}from"./index-CV25JUjE.js";/* empty css            */function f(a){return g({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 16c-2.137 0-4.146-0.832-5.657-2.343s-2.343-3.52-2.343-5.657c0-1.513 0.425-2.986 1.228-4.261 0.781-1.239 1.885-2.24 3.193-2.895l0.672 1.341c-1.063 0.533-1.961 1.347-2.596 2.354-0.652 1.034-0.997 2.231-0.997 3.461 0 3.584 2.916 6.5 6.5 6.5s6.5-2.916 6.5-6.5c0-1.23-0.345-2.426-0.997-3.461-0.635-1.008-1.533-1.822-2.596-2.354l0.672-1.341c1.308 0.655 2.412 1.656 3.193 2.895 0.803 1.274 1.228 2.748 1.228 4.261 0 2.137-0.832 4.146-2.343 5.657s-3.52 2.343-5.657 2.343z"},child:[]}]})(a)}function A({nouid:a}){const{errors:n,flash:l,remainingAttempts:s,availableAt:m}=x().props,{data:i,setData:o,post:c,processing:t}=p({phone:""}),d=r=>{r.preventDefault(),c(`/${a}/forgot-pin`)};return e.jsxs("div",{className:"flex min-h-screen items-center justify-center bg-gray-50 px-4 py-12 sm:px-6 lg:px-8",children:[e.jsx(u,{title:"Lupa PIN"}),e.jsxs("div",{className:"w-full max-w-md space-y-8 rounded-lg bg-white p-8 shadow-md",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(h,{className:"mx-auto h-12 w-12 text-blue-500"}),e.jsx("h2",{className:"mt-6 text-2xl font-bold text-gray-900",children:"Lupa PIN?"}),e.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Masukkan nomor WhatsApp terdaftar untuk mendapatkan link reset"})]}),s!==null&&s<3&&e.jsx("div",{className:"rounded-md bg-yellow-50 p-4",children:e.jsx("p",{className:"text-sm text-yellow-700",children:s>0?`Anda memiliki ${s} percobaan tersisa.`:`Terlalu banyak percobaan. Silakan coba lagi dalam ${m} menit.`})}),n.phone&&e.jsx("div",{className:"rounded-md bg-red-50 p-4",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(j,{className:"h-5 w-5 text-red-400"}),e.jsx("p",{className:"ml-3 text-sm text-red-700",children:n.phone})]})}),l.status&&e.jsx("div",{className:"rounded-md bg-green-50 p-4",children:e.jsx("p",{className:"text-sm text-green-700",children:l.status})}),e.jsxs("form",{onSubmit:d,className:"mt-8 space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"phone",className:"block text-sm font-medium text-gray-700",children:"Nomor WhatsApp"}),e.jsx("input",{id:"phone",name:"phone",type:"tel",required:!0,autoFocus:!0,value:i.phone,onChange:r=>o("phone",r.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",disabled:t||s===0})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("button",{type:"button",onClick:()=>window.history.back(),className:"flex items-center text-sm font-medium text-gray-600 hover:text-gray-800",children:[e.jsx(b,{className:"mr-1.5"}),"Kembali"]}),e.jsx("button",{type:"submit",disabled:t||s===0,className:`flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium text-white shadow-sm ${t||s===0?"cursor-not-allowed bg-blue-400":"bg-blue-600 hover:bg-blue-700"}`,children:t?e.jsxs(e.Fragment,{children:[e.jsx(f,{className:"mr-2 animate-spin"}),"Mengirim..."]}):"Kirim Link Reset"})]})]})]})]})}export{A as default};
