PageSourceSearch

https://ufabet.mobile/react/assets/ForgotOtpModal.qvMy9C8i.js

js ufabet.mobile collected 2026-10-04 20:35:11 UTC 2,425 bytes, 1 lines download raw bytes

1import{r as n,j as m}from"./vendor-react.ELhBuE2q.js";import{S as g}from"./TextBox.D9WGVcEh.js";import{S as N}from"./SmartInput.DfKyFp4R.js";import{d3 as O,W as j}from"./app-shared.CdUkAbk4.js";import{f as T}from"./resetCountdown.BW7Zr9i7.js";import{u as _}from"./vendor-i18n.DvM0XvO9.js";import{a as w}from"./useThemedStyleName.CKcOhope.js";import"./vendor-router.aN8wpDPU.js";import"./vendor-ui.BSTRh9Ug.js";import"./vendor-moment.BLMuvzoS.js";import"./vendor-axios.NIGUFBhG.js";const d=6,k=300,v=s=>String(s??"").replace(/\D/g,"").slice(0,d);function L({mobile:s,onClose:l}){const{t:o}=_(),[t,p]=n.useState(""),[e,a]=n.useState(""),[c,x]=n.useState(!1),[u,b]=n.useState(k);n.useEffect(()=>{if(u<=0)return;const i=setInterval(()=>b(r=>Math.max(0,r-1)),1e3);return()=>clearInterval(i)},[u]);const S=n.useCallback(i=>{p(v(i)),a("")},[]),f=u<=0,y=t.length===d&&!f&&!c,h=n.useCallback(async()=>{if(!(t.length!==d||f||c)){x(!0),a("");try{const i=await O({mobile:s,otp:t}),r=(i==null?void 0:i.data)||{};if(r.success&&r.link){l==null||l({verified:!0}),location.replace(r.link);return}a(!r.success&&typeof r.message=="string"&&r.message?r.message:o("an_error_occurred"))}catch{a(o("an_error_occurred"))}finally{x(!1)}}},[t,f,c,s,l,o]);
1return{otp:t,setOtp:S,error:e,submitting:c,canSubmit:y,expired:f,secondsLeft:u,formattedTime:T(u),submit:h}}function V({dataEvent:s,onClose:l}){var a;const o=w(),{t}=_(),p=((a=s==null?void 0:s.data)==null?void 0:a.mobile)||"",e=L({mobile:p,onClose:l});return m.jsxs("div",{className:"flex flex-col items-center w-[320px] max-w-full gap-3 base-modal-content",children:[m.jsx(g,{styleName:o("text","text_title_register_modal"),label:t("forgot_otp_title")}),m.jsx(g,{styleName:o("text","text_title_register_preview"),className:"text-center",label:t("forgot_otp_detail",{mobile:p})}),m.jsx(N,{styleName:"register_nebula",type:"text",inputMode:"numeric",name:"otp",maxLength:d,value:e.otp,onChange:c=>e.setOtp(c.target.value),placeholder:t("forgot_otp_placeholder"),className:"w-full",error:e.error||"",handleEnter:e.submit}),m.jsx("div",{className:"text-[12px] opacity-70",children:e.expired?t("forgot_otp_expired"):`${t("forgot_otp_time_left")} ${e.formattedTime}`}),m.jsx(j,{styleName:o("button","btn_register_modal"),className:"w-full !justify-center text-center disabled:opacity-40 disabled:cursor-not-allowed",label:t("confirm"),disabled:!e.canSubmit,onClick:e.submit})]})}export{V 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.