PageSourceSearch

https://www.mobilelegends.com/assets/index-faaeadac.js

js mobilelegends.com collected 2026-10-01 10:21:10 UTC 7,884 bytes, 1 lines download raw bytes

1import{q as t,Q as ae,t as E,an as ie,ap as le,j as N,m as de,U as ue,c as he,u as G,aq as I,B as pe,d as R,A as fe,r as U,S as me,ao as Ce}from"./index-06f6d0af.js";import{r as m}from"./react-f4fa6042.js";import{H as ge,i as k}from"./vendor-2e8812bb.js";import{u as xe}from"./useCaptcha-73247b40.js";import{H as ve,u as je}from"./utils-790bf987.js";const Ee=e=>{const{data:c,checked:s,onChange:l}=e,{prefixCls:n}=E("pre-register-agreement"),r=()=>{l(!s)},o=s?"checkbox active":"checkbox";return t.jsxs("div",{className:n,children:[t.jsx("div",{className:"".concat(n,"-checkbox"),onClick:r,children:t.jsx("span",{className:o})}),t.jsx("div",{dangerouslySetInnerHTML:{__html:ae(c.agreement)}})]})},Pe=e=>{const{content:c,disabled:s,onClick:l}=e,{prefixCls:n}=E("pre-register-button"),r=f=>{s||l(f)},o=s?n:"".concat(n," active");return t.jsx("div",{className:o,onClick:r,children:c})},W=["010"],J=["852","853","886"],Ne="abda10a725984a7995468e1b74fb6673",ke={ios:"IOS",android:"Android",email:"Email",phone:"Phone Number",placeholdEmail:"Please enter your email address",errorEmail:"Please enter a valid email address",errorPhoneCode:"Please enter the phone code",placeholdPhone:"Please enter your phone number",placeholdPhoneCode:"Code",placeholdVc:"Please enter the verification code",sendSms:"Send the SMS verification code",agreement:"协议内容",noAgreement:"Please and accept Privacy Policy",preRegister:"Pre-register"},Q=e=>/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(e),X=(e,c)=>c==="kr"?"82":e,Z=(e,c)=>c==="kr"?"10".concat(e):e,be=e=>{const{lang:c,phoneCode:s,phone:l,...n}=e,[r,o]=m.useState(),[f]=ge({targetDate:r,onEnd:()=>{i.refresh()}}),C=k(()=>{o(Date.now()+120*1e3)}),v=k(async(b,P)=>{try{const h=X(s,c),S=Z(l,c);await ie({...n,pc:h,pn:S,module:"mobile",validate:P},{isTransformResponse:!0,ignoreCancelToken:!0}),C()}catch(h){b.refresh()}}),i=xe({captchaId:Ne,onVerify:v,lang:c});return{runCode:C,captcha:i,countdown:f,sendCaptchaSms:v}};var u=(e=>(e.EMAIL="email",e.PHONE="phone",e))(u||{}),_=(e=>(e.IOS="IOS",e.Android="Android",e))(_||{});const Se=e=>{const{content:c,countdown:s,send:l}=e,{prefixCls:n}=E("pre-register-capthca");return t.jsx("div",{className:n,onClick:l,children:s?"".concat(Math.round(s/1e3),"s"):c})},$=e=>{const{prefix:c="input",placeholder:s,maxLength:l,value:n,onChange:r,after:o,before:f}=e,{prefixCls:C}=E("pre-register-".concat(c)),v=i=>{r(i.target.value)};return t.jsxs("div",{className:C,children:[o,t.jsx("input",{type:"text",value:n,maxLength:l,placeholder:s,onChange:v}),f]})},Oe=e=>{const{code:c,codes:s,changeCode:l}=e,{prefixCls:n}=E("pre-register-phone-code"),r=m.useRef(null),[o,f]=m.useState(!1),C=o?"phone-code-box open":"phone-code-box",v=i=>{f(!o),l(i)};return le(()=>{f(!1)},r,"click"),t.jsxs("div",{className:n,ref:r,children:[t.jsx("div",{className:"code",onClick:()=>f(!o),children:c}),t.jsx("div",{className:C,children:s.map(i=>t.jsx("div",{className:c===i?"phone-code-box-item active":"phone-code-box-item",onClick:()=>v(i),children:i},i))})]})},ye=e=>{const{code:c,placeholder:s,changeCode:l}=e,{prefixCls:n}=E("pre-register-phone-code-input"),r=o=>{const f=o.target.value;l(f)};return t.jsx("div",{className:n,children:t.jsx("input",{type:"text",maxLength:5,onChange:r,value:c,placeholder:s})})},Le=e=>{const{isLogin:c,form:s,codes:l,scene:n,content:r,change:o,appId:f,lang:C}=e,{prefixCls:v}=E("pre-register-content"),{captcha:i,countdown:b}=be({phoneCode:s.code,phone:s.value,lang:C,appId:f}),P=k(g=>{o("code",g.trim())}),h=k(g=>{o("phoneCode",g.replace(/[^0-9]/g,""))}),S=k(g=>{o("value",n===u.PHONE?g.replace(/[^0-9]/g,""):g.trim())}),K=k(g=>{o("captcha",g.replace(/[^0-9]/g,""))}),w=k(async()=>{if(b===0){if(!s.value){N.error(r.placeholdPhone);return}i.verify()}});return t.jsx("div",{className:v,children:c?t.jsxs(m.Fragment,{children:[t.jsx($,{placeholder:r.placeholdPhone,prefix:"input-phone",maxLength:14,value:s.value,onChange:S,after:t.jsx(Oe,{code:s.code,codes:l,changeCode:P})}),t.jsx($,{placeholder:r.placeholdVc,value:s.captcha,maxLength:5,onChange:K,prefix:"input-captcha",before:t.jsx(Se,{content:r.sendSms,countdown:b,send:w}
1)})]}):t.jsx($,{placeholder:n===u.EMAIL?r.placeholdEmail:r.placeholdPhone,maxLength:n===u.PHONE?14:void 0,prefix:n===u.PHONE?"input-phone-code":void 0,value:s.value,onChange:S,after:n===u.PHONE&&t.jsx(ye,{code:s.phoneCode,placeholder:r.placeholdPhoneCode,changeCode:h})})})},Me=e=>{const{content:c,device:s,setDevice:l}=e,{prefixCls:n}=E("pre-register-platform"),r=Object.values(_);return t.jsx("div",{className:n,children:r.map(o=>t.jsx("div",{className:"".concat(n,"-item ").concat(s===o&&"active"),onClick:()=>l(o),children:c[o.toLowerCase()]||o},o))})},Ie=e=>{const{content:c,scene:s,scenes:l=Object.values(u),changeScene:n}=e,{prefixCls:r}=E("pre-register-scene");return t.jsx("div",{className:r,children:l.map(o=>t.jsx("div",{className:o===s?"".concat(r,"-item active"):"".concat(r,"-item"),onClick:()=>n(o),children:c[o]||o},o))})},we="COMMON_PRE_REGISTER",D=de({prefixKey:void 0}),Ae=Object.values(u),Y=e=>"",_e=e=>{const{id:c,context:s,data:l,params:n}=e,r=n==null?void 0:n.skin,o=n==null?void 0:n.projectId,f=n==null?void 0:n.actions,C="".concat(we,"_").concat(o),v=ue(c,s),i=m.useMemo(()=>{var a;return ve({...ke},(a=l==null?void 0:l.data)!=null?a:{})},[l==null?void 0:l.data]),{prefixCls:b}=E("pre-register"),P=he(),h=G(({app:a})=>a.lang),S=G(({user:a})=>a.user),w=h.toLocaleUpperCase()==="KR"?W:J,g=m.useRef(!1),O=m.useRef(D.get(C)),[j,T]=m.useState(u.EMAIL),[F,ee]=m.useState(_.IOS),[M,ne]=m.useState(!1),[d,y]=m.useState({code:w[0],phoneCode:Y(),captcha:"",value:""}),V=I((a,p)=>{y(x=>({...x,[a]:p}))}),oe=I(a=>{T(a),V("value","")}),L=!!(h&&["kr","zh_TW"].includes(h)),te=m.useMemo(()=>h==="jp"?[u.EMAIL]:h==="th"?[u.PHONE]:Ae,[h]),se=m.useMemo(()=>!!(!d.value||!M||!L&&(j===u.EMAIL&&!Q(d.value)||j===u.PHONE&&!d.phoneCode)||L&&!d.captcha),[M,d.captcha,d.phoneCode,d.value,L,j]),q=(a,p)=>{f&&Ce({unique:v,actions:f,params:{...p,deviceType:F,domEvt:a}})},re=I(async a=>{if(g.current)return;if(L){if(!d.value){N.error(i.placeholdPhone);return}if(!d.captcha){N.error(i.placeholdVc);return}if(!M){N.error(i.noAgreement);return}try{g.current=!0;const x=X(d.code,h),A=Z(d.value,h),B=await pe({module:"mobile",type:o,pc:x,pn:A,code:d.captcha},{isTransformResponse:!0,ignoreCancelToken:!0});O.current={jwt:B.jwt,lang:h},D.set(C,O.current),P(R({token:B.jwt,ready:!0})),q(a,{phoneCode:x,phone:A})}catch(x){}g.current=!1;return}if(!d.value){N.error(j===u.EMAIL?i.placeholdEmail:i.placeholdPhone);return}if(j===u.EMAIL&&!Q(d.value)){N.error(i.errorEmail);return}if(j===u.PHONE&&!d.phoneCode){N.error(i.errorPhoneCode);return}if(!M){N.error(i.noAgreement);return}const p=j===u.EMAIL?{email:d.value}:{phone:d.value,phoneCode:d.phoneCode};q(a,{...p,registerType:j})}),H=I(()=>{P(R({token:void 0})),D.remove(C),O.current=void 0});fe(()=>{const a=O.current;a&&a.jwt?P(R({token:a.jwt,ready:!0})):P(R({ready:!0})),U("goLogout",H),U("clearToken",H)});const z=I(a=>{const p={code:"",phoneCode:"",captcha:"",value:""};p.phoneCode=Y();const x=O.current;if(x&&x.lang!==a&&(H(),O.current=void 0),a==="zh_TW"){p.code=J[0],y(p);return}if(a==="kr"){p.code=W[0],y(p);return}if(a==="jp"){T(u.EMAIL),y(p);return}if(a==="th"){T(u.PHONE),y(p);return}(d.code||p.phoneCode)&&y(p)});m.useEffect(()=>{z(h)},[z,h]);const ce=m.useMemo(()=>r?Object.entries(r).reduce((a,[p,x])=>{const A="--pre-register-".concat(je(p));return a[A]=x.startsWith("https://")?"url(".concat(x,")"):x,a},{}):{},[r]);return S?null:t.jsx(me,{materialProps:e,children:t.jsxs("div",{className:b,style:ce,children:[!L&&t.jsx(Ie,{content:i,scene:j,scenes:te,changeScene:oe}),t.jsx(Me,{content:i,device:F,setDevice:ee}),t.jsx(Le,{form:d,appId:o,codes:w,isLogin:L,scene:j,change:V,content:i,lang:h}),t.jsx(Ee,{data:i,checked:M,onChange:ne}),t.jsx(Pe,{content:i.preRegister,disabled:se,onClick:re})]})})};export{_e 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.