1import{a as Y,b as K,_ as X}from"./BBoeHvzI.js";import{o as g,c as $,j as t,Y as ue,a6 as w,h as S,R as F,b_ as pe,d as ee,ai as te,aC as se,aW as _e,aG as ae,aI as L,an as r,bk as oe,w as h,b as e,b6 as O,ao as I,ae as re,k as j,ap as fe,v as W,bl as ne,bm as D,i as le,H as ge,bq as G,bo as ie,aQ as he,D as ve,bL as M,bE as we,bj as be,n as H,b$ as ye,J as xe}from"./C2i3VHsF.js";import{G as ke}from"./C_yucFP9.js";import{_ as Ve}from"./DPWhgc38.js";import{_ as Ce,a as Ee,b as ze}from"./DFex2tGZ.js";import{h as $e,b as N}from"./BjLbCOBv.js";import{A as de}from"./5s7Q2CuA.js";import{_ as Ie}from"./CirVFW0B.js";import{E as J,a as Q}from"./BSUZZN6q.js";import"./BXfSPKp2.js";import"./BPNtONYh.js";import"./D-SEtxCV.js";import"./BR6p1_aO.js";import"./-xVt6KJz.js";import"./C-c20LQf.js";import"./DO-Sup8Z.js";import"./zF-A6mWY.js";import"./edOYkSCx.js";import"./C4C9r0Uu.js";import"./DRC1a8Qd.js";import"./hFH4saDR.js";import"./BqPJAXt_.js";import"./CsIgT5Ik.js";import"./BM6jv5XJ.js";const Se={xmlns:"http://www.w3.org/2000/svg",fill:"none",class:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",viewBox:"0 0 24 24"};function Ae(V,E){return g(),$("svg",Se,[...E[0]||(E[0]=[t("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4",class:"opacity-25"},null,-1),t("path",{fill:"currentColor",d:"M4 12a8 8 0 0 1 8-8V0C5.373 0 0 5.373 0 12zm2 5.291A7.96 7.96 0 0 1 4 12H0c0 3.042 1.135 5.824 3 7.938z",class:"opacity-75"},null,-1)])])}const Pe={render:Ae};function ce(V,E,o,P){console.warn("Warning: `useZodForm` is deprecated. Please use `useZform` instead.");const c=Object.assign({},{mode:"lazy",dirty:!1},P),A=ue(w(E)),v=S(c.dirty);let i=null;const C=S([]),b=S(null),k=()=>{b.value=null},d=()=>{i===null&&(i=F([()=>w(o),()=>w(A)],async()=>{await U()},{deep:!0}))},U=l=>(T(),C.value=w(V).errors,[]),T=async()=>{k();const l=await w(A).safeParseAsync(w(o));return v.value=l.success,l.success||(b.value=pe.groupBy(l.error.issues,"path"),d()),b},Z=l=>{const u=document.getElementById(l.errors[0].id);u==null||u.focus(),u==null||u.scrollIntoView({behavior:"smooth",block:"center"})},R=l=>{if(w(V)&&w(V).errors.length>0){const u=w(V).errors.find(p=>p.path===l);if(u)return u.message}},B=async l=>{A.value=w(l);const u=w(V).errors,p=await T();if(u.length>0&&p.value){const m=Object.entries(p.value).map(([s,a])=>({path:s.replaceAll(",","."),message:Object.values(a)[0].message})),z=u.map(s=>m.find(({path:a})=>a===s.path)).filter(s=>s!==null);w(V).setErrors(z)}};return c.mode==="eager"&&d(),{validate:U,reValidate:B,errors:C,isValid:v,clearErrors:k,getError:R,onError:Z}}const Ue={class:"transition-all animate-fade-in overflow-hidden"},Te={class:"mt-5"},Ze={class:"space-y-4"},Re={class:"relative"},me=ee({__name:"index",setup(V){const E=te(),{t:o,locale:P}=se(),{toast:c}=ie(),A=_e(),v=S(!1),i=S({dial_code:"+62",country_name:"Indonesia",country_id:"ID"}),C=p=>{const m=p.target;m.value=m.value.replace(/[^0-9]/g,"")},b=W(()=>ne({username:D({message:o("register.form.username.schema.required")}).min(1,{message:o("register.form.username.schema.required")}).min(4,{message:o("register.form.username.schema.min_length")}).regex(/^[a-zA-Z0-9-_]+$/,{message:o("register.form.username.schema.cannot_special")}),hp:D().min(1,{message:o("register.form.phone.schema.required")}).min(8,{message:o("register.form.phone.schema.not_valid")}),refId:D().optional().refine(p=>!p||p.length>=4,{message:o("register.form.ref_id.schema.min_length")}).refine(p=>!p||/^[a-zA-Z0-9-_]+$/.test(p),{message:o("register.form.ref_id.schema.cannot_special")})})),k=S(),d=le({username:void 0,hp:void 0,refId:void 0}),{isValid:U,validate:T,reValidate:Z,onError:R}=ce(k,b,d,{mode:"lazy"});async function B(p){var y,x;const{username:m,hp:z,refId:s}=p.data;v.value=!0;const a={username:m,phoneNumber:i.value.dial_code+z,refId:s,country:{dial_code:i.value.dial_code,country_id:i.value.country_id,country_name:i.value.country_name}};try{const f=await E._preRegister(a),n=await $e(m,"indodax");f.success||f.code<400?(ge({key:"afterRegis",value:"1"}),G("web_signup_submit",{"ma_signup_submit-country":i.value.country_name,"ma_signup_submit-additionalpage-username":n,"ma_signup_submit-additionalpage-referral":s,is_institution:!1}),A.push("/register-confirm")):(v.value=!1,G("web_signup_submit-fail",{"ma_signup_submit-country":i.value.country_name,"ma_signup_submit-additionalpage-username":n,"ma_signup_submit-additionalpage-referral":s,is_institution:!1,reason:(y=f==null?void 0:f.data)==null?void 0:y.error_type}),(x=f.data)==null||x.error_type.forEach(_=>{var q;_.type==="general_err_otp"&&c({description:_.message,variant:"destructive",duration:2e3}),_.type==="session_timeout"?c({description:_.message,variant:"destructive",duration:2e3}):(q=k.value)==null||q.setErrors([{path:_.type,message:_.message}],_.type)}))}catch{}}const l=()=>{E.registration_flow.step_on_additonal_data=1},u=F(P,()=>{Z(b)});return ae(()=>{u()}),(p,m)=>{const z=Ve,s=Ee,a=Ce,y=X,x=K,f=Y,n=ze;return g(),$(L,null,[r(oe),t("div",Ue,[r(a,{class:"relative"},{default:h(()=>[r(z,{class:"absolute left-4 top-5 bg-transparent transition-all hover:bg-transparent hover:-translate-x-1",onClick:l},{default:h(()=>[r(e(de))]),_:1}),r(s,{class:"text-2xl pl-10"},{default:h(()=>[O(I(e(o)("register.additional_data.title")),1)]),_:1})]),_:1}),r(n,null,{default:h(()=>[t("div",null,[t("span",null,I(e(o)("register.additional_data.desc")),1
1)]),t("div",Te,[r(f,{ref_key:"formRef",ref:k,class:"space-y-8",state:e(d),schema:e(b),validate:e(T),onError:e(R),onSubmit:B},{default:h(()=>[t("div",Ze,[r(x,{label:e(o)("register.form.username.label",{type:"register"}),name:"username",size:"xs","eager-validation":""},{default:h(()=>[r(y,{modelValue:e(d).username,"onUpdate:modelValue":m[0]||(m[0]=_=>e(d).username=_),size:"md",placeholder:e(o)("register.form.username.placeholder"),"data-test":"input-username-social",autocomplete:"off"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),r(x,{label:e(o)("register.form.phone.label"),name:"hp",size:"xs","eager-validation":""},{default:h(()=>[t("div",Re,[r(y,{modelValue:e(d).hp,"onUpdate:modelValue":m[2]||(m[2]=_=>e(d).hp=_),placeholder:e(o)("register.form.phone.placeholder"),"data-test":"input-phone-social",size:"md",autocomplete:"off",style:{paddingLeft:"100px"},ui:{icon:{leading:{pointer:"pointer-events-auto"}}},onInput:C},{leading:h(()=>[r(Ie,{modelValue:e(i),"onUpdate:modelValue":m[1]||(m[1]=_=>re(i)?i.value=_:null),"data-test":"btn-country-code-social"},null,8,["modelValue"])]),_:1},8,["modelValue","placeholder"])])]),_:1},8,["label"]),r(x,{label:"Referral ID (Opsional)",name:"refId",size:"xs","eager-validation":""},{default:h(()=>[r(y,{modelValue:e(d).refId,"onUpdate:modelValue":m[3]||(m[3]=_=>e(d).refId=_),size:"md","data-test":"input-ref-id-social",placeholder:e(o)("register.form.ref_id.placeholder"),autocomplete:"off"},null,8,["modelValue","placeholder"])]),_:1})]),t("div",null,[r(z,{class:"flex items-center gap-2 mt-5 w-full bg-colors-idx-500 hover:bg-colors-idx-600 text-white disabled:bg-colors-cadet-blue-500",type:"submit",disabled:!e(U)||e(v),"data-test":"btn-submit-social"},{default:h(()=>[e(v)?(g(),j(e(Pe),{key:0})):fe("",!0),O(" "+I(e(o)("register.btn.create_account")),1)]),_:1},8,["disabled"])])]),_:1},8,["state","schema","validate","onError"])])]),_:1})])],64)}}});typeof N=="function"&&N(me);const Be=Object.assign(he(me,[["__scopeId","data-v-ce9af137"]]),{__name:"RegisterSocialAditionalComponent"}),je={class:"relative flex items-start pt-14 justify-center w-full bg-[#E7E8EC] h-screen min-h-[600px]"},De={key:0,class:"p-4 relative bg-white dark:text-gray-800 w-full max-w-md mx-auto overflow-hidden rounded-lg"},Fe={class:"p-1 transition-all animate-fade-in overflow-hidden space-y-5"},Ne={class:"flex items-center gap-x-2"},Le={class:"inline-flex"},Oe={class:"text-2xl font-semibold"},We={class:"flex gap-x-2 items-start justify-start bg-colors-neutral-500 rounded-md p-5"},qe={class:"text-sm leading-4 break-all"},Ge={class:"font-semibold text-[#232832]"},Me={class:"space-y-4"},He={class:"text-sm text-[#232832]"},Je={class:"space-y-6"},Qe={class:"space-y-3"},Ye={class:"relative"},Ke={class:"p-2 absolute inset-y-0 right-0 left-auto inline-flex items-center"},Xe={class:"grid grid-cols-2 gap-2"},et={class:"text-xs"},tt={class:"relative"},st={class:"p-2 absolute inset-y-0 right-0 left-auto inline-flex items-center"},at={key:1,class:"bg-white w-[470px] overflow-hidden rounded-lg"},ot=ee({__name:"[id]",setup(V){const{isClient:E}=ve(),o=te(),{toast:P}=ie(),{t:c,locale:A}=se(),v=M("passwordShow",()=>!1),i=S({geetest_challenge:"",geetest_seccode:"",geetest_validate:""}),C=M("confirmPasswordShow",()=>!1),b=W(()=>ne({password:D().min(8).refine(s=>/[A-Z]/.test(s),{message:"Password must contain at least one uppercase letter"}).refine(s=>/[a-z]/.test(s),{message:"Password must contain at least one lowercase letter"}).refine(s=>/[0-9!@#$%^&*(),.?":{}|<>]/.test(s),{message:"Password must contain at least one special character"}),confirmPassword:D({message:""}).min(1,{message:""})}).superRefine((s,a)=>{s.confirmPassword!==s.password&&a.addIssue({code:ye.custom,path:["confirmPassword"],message:c("register.form.confirm_password.schema.not_match")})})),k=S(),d=le({password:void 0,confirmPassword:void 0}),{isValid:U,validate:T,reValidate:Z,onError:R}=ce(k,b,d,{mode:"lazy"});async function B(s){var f;const{password:a,confirmPassword:y}=s.data,x={password:a,password_confirm:y,ip_address:"192.168.1.1",social_auth_token:o.token.temporaryToken,geetest_challenge:(f=i==null?void 0:i.value)==null?void 0:f.geetest_challenge,geetest_seccode:i.value.geetest_seccode,geetest_validate:i.value.geetest_validate};try{const n=await o._createFromSocial(x);n.error?P({title:"Uh oh! Something went wrong.",description:"There was a problem with your request.",variant:"destructive"}):n!=null&&n.success&&(o.registration_flow.step_on_additonal_data=2)}catch{P({title:"Uh oh! Something went wrong.",description:"There was a problem with your request.",variant:"destructive",duration:3e3})}}const l=W(()=>[{text:c("register.form.password.criteria.min_length"),met:!1},{text:c("register.form.password.criteria.upper_case"),met:!1},{text:c("register.form.password.criteria.lower_case"),met:!1},{text:c("register.form.password.criteria.special_char"),met:!1}]),u=()=>{const s=d.password||"";l.value[0].met=s.length>=8,l.value[1].met=/[A-Z]/.test(s),l.value[2].met=/[a-z]/.test(s),l.value[3].met=/[
10-9!@#$%^&*(),.?":{}|<>]/.test(s)},p=()=>{o._resetRegisterState(),o._setToken("socialAuthToken",""),o._setToken("refreshToken",""),xe("/register",{replace:!0})},m=F([()=>o.registration_flow.step_on_additonal_data,A],([s,a])=>{s===1&&u(),a&&(Z(b),u())}),z=F(()=>d.password,s=>{l.value[0].met=s.length>=8,l.value[1].met=/[A-Z]/.test(s),l.value[2].met=/[a-z]/.test(s),l.value[3].met=/[0-9!@#$%^&*(),.?":{}|<>]/.test(s)});return ae(()=>{m(),z()}),(s,a)=>{const y=X,x=K,f=Y;return g(),$(L,null,[r(oe),t("div",null,[t("div",je,[e(o).registration_flow.step_on_additonal_data===1?(g(),$("div",De,[t("div",Fe,[t("div",Ne,[t("div",Le,[t("button",{class:"bg-transparent transition-all hover:bg-transparent hover:-translate-x-1",onClick:p},[r(e(de))])]),t("div",null,[t("h1",Oe,I(e(c)("register.save_password.title")),1)])]),t("div",null,[t("div",We,[a[7]||(a[7]=we('<div class="relative"><span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-sky-400 opacity-20"></span><svg width="20" height="20" viewBox="0 1 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path opacity=".4" d="M10 18.335a8.333 8.333 0 1 0 0-16.667 8.333 8.333 0 0 0 0 16.667Z" fill="#169DD0"></path><path d="M10 8.751a.63.63 0 0 1 .625.625v4.167a.63.63 0 0 1-.625.625.63.63 0 0 1-.625-.625V9.376A.63.63 0 0 1 10 8.751ZM10.766 7.19c-.042.1-.1.192-.175.276a.962.962 0 0 1-.275.175.833.833 0 0 1-.633 0 .962.962 0 0 1-.275-.175.962.962 0 0 1-.175-.275.83.83 0 0 1-.067-.317.83.83 0 0 1 .067-.317.86.86 0 0 1 .175-.275.962.962 0 0 1 .275-.175.83.83 0 0 1 .316-.066.83.83 0 0 1 .317.066c.1.042.192.1.275.175a.86.86 0 0 1 .175.275c.042.1.067.209.067.317a.829.829 0 0 1-.067.317Z" fill="#169DD0"></path></svg></div>',1)),t("div",null,[t("p",qe,[O(I(e(c)("register.save_password.register_with_google"))+": ",1),a[6]||(a[6]=t("br",null,null,-1)),t("span",Ge,I(e(o).registration_flow.payload_form.email),1)])])])]),t("div",Me,[t("div",null,[t("p",He,I(e(c)("register.save_password.desc")),1)]),t("div",Je,[r(f,{ref_key:"formRef",ref:k,class:"space-y-4",state:e(d),schema:e(b),validate:e(T),onError:e(R),onSubmit:B},{default:h(()=>[t("div",Qe,[r(x,{label:e(c)("register.form.password.label"),name:"password",size:"xs",error:!1,"eager-validation":"",ui:{label:{base:"dark:text-gray-700"}}},{default:h(()=>[t("div",Ye,[r(y,{modelValue:e(d).password,"onUpdate:modelValue":a[0]||(a[0]=n=>e(d).password=n),placeholder:e(c)("register.form.password.placeholder"),"data-test":"input-password-social",type:e(v)?"text":"password",size:"md",autocomplete:"off",ui:{color:{white:{outline:"dark:bg-white dark:ring-gray-300"}}}},null,8,["modelValue","placeholder","type"]),t("span",Ke,[t("button",{tabindex:"-1",type:"button","data-test":"btn-show-password-social",class:"bg-transparent outline-none hover:bg-transparent",onClick:a[1]||(a[1]=n=>v.value=!e(v))},[e(v)?(g(),j(e(J),{key:0})):(g(),j(e(Q),{key:1}))])])])]),_:1},8,["label"]),t("div",null,[t("div",Xe,[(g(!0),$(L,null,be(e(l),(n,_)=>(g(),$("div",{key:_,class:H([n.met?"text-colors-idx-500":"text-slate-400","flex gap-1 items-center"])},[(g(),$("svg",{class:H(n.met?"fill-idx-500 animate-pop-in transition-all":"fill-slate-400"),width:"18",height:"19",xmlns:"http://www.w3.org/2000/svg"},[...a[8]||(a[8]=[t("rect",{y:".5",width:"18",height:"18",rx:"9"},null,-1),t("path",{d:"M6.484 8.72a1.1 1.1 0 1 0-1.555 1.555l2.2 2.2a1.1 1.1 0 0 0 1.554 0l4.398-4.399a1.1 1.1 0 1 0-1.554-1.555l-3.621 3.62-1.422-1.42Z",fill:"#fff"},null,-1)])],2)),t("span",et,I(n.text),1)],2))),128))])])]),t("div",null,[r(x,{label:e(c)("register.form.confirm_password.label"),name:"confirmPassword",size:"xs","eager-validation":"",ui:{label:{base:"dark:text-gray-700"}}},{default:h(()=>[t("div",tt,[r(y,{modelValue:e(d).confirmPassword,"onUpdate:modelValue":a[2]||(a[2]=n=>e(d).confirmPassword=n),"data-test":"input-confirm-password-social",placeholder:e(c)("register.form.confirm_password.placeholder"),type:e(C)?"text":"password",size:"md",autocomplete:"off",ui:{color:{white:{outline:"dark:bg-white dark:ring-gray-300"}}}},null,8,["modelValue","placeholder","type"]),t("span",st,[t("button",{tabindex:"-1",type:"button","data-test":"btn-show-password-social",class:"bg-transparent outline-none hover:bg-transparent",onClick:a[3]||(a[3]=n=>C.value=!e(C))},[e(C)?(g(),j(e(J),{key:0})):(g(),j(e(Q),{key:1}))])])])]),_:1},8,["label"])])]),_:1},8,["state","schema","validate","onError"]),t("div",null,[r(ke,{modelValue:e(i),"onUpdate:modelValue":[a[4]||(a[4]=n=>
1re(i)?i.value=n:null),a[5]||(a[5]=n=>e(k).submit())],label:e(c)("register.btn.save_password"),"data-test":"btn-submit-password-social",class:"*:text-sm",disabled:!e(U)},null,8,["modelValue","label","disabled"])])])])])])):(g(),$("div",at,[r(Be)]))])])],64)}}});typeof N=="function"&&N(ot);export{ot 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.