1import{u as E,a as L,r as x,i as A,j as t,W as R,A as _}from"./index-CC1u1DhI.js";import{c as $,s as F}from"./otp-YaAdehxP.js";import{L as I}from"./pathfinder-blackwordmark-pScLhTpz.js";function w({index:o,value:g,onChange:n,onKeyDown:f,onPaste:i,inputRef:m,isFirst:p,isLast:d}){return t.jsx("input",{ref:m,type:"text",inputMode:"numeric",maxLength:1,value:g,onChange:u=>n(o,u.target.value),onKeyDown:u=>f(o,u),onPaste:i,className:` 2 bg-white border-[0.5px] border-[rgba(26,0,64,0.2)] h-[40px] w-[40px] 3 flex items-center justify-center text-center 4 text-[14px] font-medium leading-[20px] tracking-[-0.0336px] 5 focus:outline-none focus:border-2 focus:border-[#6918eb] 6 shadow-[0_1px_2px_0_rgba(26,0,64,0.08)] 7 text-[#1a0040] 8 transition-colors 9 ${p?"rounded-l-[12px] pl-1":""} 10 ${d?"rounded-r-[12px] pr-1":""} 11 ${p?"":"ml-[-1px]"} 12 `})}function D(){return t.jsx("div",{className:"h-px bg-[#d9d9d9] w-2.5"})}const O=()=>{const o=E(),{capture:g}=L(),[n,f]=x.useState(Array(10).fill("")),[i,m]=x.useState(!1),[p,d]=x.useState(null),[u,k]=x.useState(!1),a=x.useRef([]);x.useEffect(()=>{A()&&o("/welcome",{replace:!0})},[o]);const b=(e,s)=>{var r,l;if(s.length>1&&(s=s.slice(-1)),s&&!/^\d$/.test(s))return;const c=[...n];c[e]=s,f(c),s&&e<9&&((r=a.current[e+1])==null||r.focus(),(l=a.current[e+1])==null||l.select())},j=(e,s)=>{var c,r;s.key==="Backspace"&&!n[e]&&e>0&&((c=a.current[e-1])==null||c.focus(),(r=a.current[e-1])==null||r.select()),s.key==="Enter"&&n.every(h=>h!=="")&&!i&&(s.preventDefault(),C())},y=e=>{var h,P;e.preventDefault();const c=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,10).split(""),r=[...n];c.forEach((v,S)=>{S<10&&(r[S]=v)}),f(r);const l=r.findIndex(v=>!v);l!==-1?(h=a.current[l])==null||h.focus():(P=a.current[9])==null||P.focus()},C=async()=>{if(N){m(!0),d(null);try{const e=n.join(""),s=await $(e);if(!s.exists||s.onboardingStatus!=="approved"){k(!0);return}if(!await F(e)){d("Unable to send verification code. Please try again.");return}g(_.ONBOARDING_OTP_SENT,{phone_length:e.length}),o(`/login/otp?phoneNumber=${e}`)}catch{d("Unable to verify phone number. Please try again.")}finally{m(!1)}}},N=n.every(e=>e!=="");return t.jsxs("div",{className:"min-h-screen",style:{backgroundColor:"#F5F4F6"},children:[t.jsx("header",{className:"p-8 sticky top-0 z-50",children:t.jsx("img",{src:I,alt:"Pathfinder",className:"h-6"})}),t.jsx("div",{className:"flex items-center justify-center min-h-[calc(100vh-80px)]",children:t.jsx("div",{className:"w-full max-w-md px-6 py-12",children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("h2",{className:"text-[28px] font-medium text-[#1f0151] text-center leading-[32px] tracking-[-0.6px]",children:"Login to view your documentation"}),t.jsx("p",{className:"text-[14px] font-medium text-[#1a0040] opacity-50 text-center leading-[20px] tracking-[-0.0336px]",children:"Enter your phone number below"})]}),t.jsxs("div",{className:"flex flex-col gap-6 items-center",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"bg-[#f5f4f8] border-[0.5px] border-[rgba(26,0,64,0.2)] rounded-[12px] p-2 size-[40px] flex items-center justify-center shrink-0",children:t.jsx("span",{className:"text-[14px] font-medium text-[#1a0040] leading-[20px] tracking-[-0.0336px]",children:"+1"})}),t.jsx(D,{}),t.jsx("div",{className:"flex items-center",children:[0,1,2].map(e=>t.jsx(w,{index:e,value:n[e],onChange:b,onKeyDown:j,onPaste:y,inputRef:s=>{a.current[e]=s},isFirst:e===0,isLast:e===2},e))}),t.jsx(D,{}),t.jsx("div",{className:"flex items-center",children:[3,4,5].map(e=>t.jsx(w,{index:e,value:n[e],onChange:b,onKeyDown:j,onPaste:y,inputRef:s=>{a.current[e]=s},isFirst:e===3,isLast:e===5},e))}),t.jsx(D,{}),t.jsx("div",{className:"flex items-center",children:[6,7,8,9].map(e=>t.jsx(w,{index:e,value:n[e],onChange:b,onKeyDown:j,onPaste:y,inputRef:s=>{a.current[e]=s},isFirst:e===6,isLast:e===9},e))})]}),p&&t.jsx("div",{className:"text-sm text-red-600 text-center max-w-sm",children:p}),t.jsx("button",{type:"button",onClick:C,disabled:!N||i,className:` 13 h-[40px] rounded-[12px] px-4 py-2 14 text-[14px] font-medium text-white text-center leading-[20px] 15 transition-all duration-200 flex items-center justify-center 16 mt-20 17 ${N&&!i?"bg-[#6918eb] hover:bg-[#5612c4] active:bg-[#4a0fa8] cursor-pointer":"bg-[#6918eb] o
17pacity-50 cursor-not-allowed"} 18 `,children:i?"Sending code...":"Get Code"})]})]})})}),u&&t.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/30 p-6",children:t.jsx(R,{onClose:()=>k(!1)})})]})};export{O 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.