1import{_ as le}from"./CSw-Dy_N.js";import{F as ie}from"./CxyXLGpx.js";import{_ as re}from"./BUqjjcoA.js";import{_ as de}from"./BYsZ59Yp.js";import{u as ce,e as ue,b as me,g as pe,h as i,n as M}from"./CEh69y81.js";import{d as c,r as he,m as _e,z as fe,B as R,_ as y,$ as S,X as o,u as a,O as T,W as l,V as N,a4 as $,a1 as B,N as ve,S as h,a0 as ge,c as be,ac as E}from"./BUqHG5hE.js";import{_ as we}from"./B7LOhBP1.js";import{_ as ye}from"./CnXcPoBr.js";import{_ as Te}from"./Cyh61iZv.js";import{c as xe,a as D}from"./DJ5fyKCC.js";import{e as ke}from"./DgUuf3Wr.js";import{g as F}from"./Du5gIO94.js";import{u as Ce}from"./CIdsc4Db.js";import"./Wk8s_Eei.js";import"./CeHePDgN.js";import"./B3xisxPa.js";import"./BwxGC_Zs.js";import"./BsUptczt.js";import"./W_DEN-vZ.js";const Se=globalThis.setInterval,$e={class:"container min-h-[100vh] xl:p-20 pt-20"},Oe={class:"flex flex-wrap items-center pb-20 justify-between"},Ve=["href","title","aria-label"],Fe={class:"flex flex-col space-y-5 mb-10"},Pe={class:"font-bold text-2xl"},Ie={class:"text-secondary-gray"},Le={class:"font-semibold text-black"},Me={class:"text-secondary-gray"},Re={class:"profileForm text-black space-y-3"},Ne={class:"flex flex-col space-y-5"},Be={key:0,class:"text-sm text-red-500 mt-2 mb-0"},Ee={class:"flex flex-wrap justify-between"},De={class:"text-center text-black"},ze=["disabled"],qe={class:"text-center text-primary-text"},Ae=["disabled"],Ue={class:"font-bold text-center mb-5"},je={class:"profileForm text-black space-y-3"},We={class:"grid grid-cols-1 gap-5"},Xe=["disabled"],Ge={class:"text-2xl font-bold text-center mb-3"},He={class:"text-xl text-primary-text text-center"},fo={__name:"index",setup(Je){const O=ce(),z=ue(),v=Ce();let d=c("");const{t:p,locale:x}=me(),g=c(!1),k=c(!1),C=c(!1),_=c(30),P=c(0),b=c(""),m=he({valid:!1,touched:!1}),q=xe({old_phone:D().required(p("FORMS.Validation.phone")),new_phone:D().required(p("FORMS.Validation.phone"))}),I=c(null);function A(e,t){I.value=e}const L=c(null);function U(e,t){L.value=e}const w=c(!1);function j(){w.value=!0}const W=pe(),X=_e(()=>W.path==="/auth/verification-code"),G={ar:{title:"Ø§ÙØªØÙÙ Ù
Ù ÙÙØ¯",description:"Ø§ÙØªØÙÙ Ù
Ù ÙÙØ¯ Ù
ÙÙØ¹ اÙÙ
عتÙ
ر",canonical:"https://umrah.almoatamer.com/auth/verification-code",keywords:"Ø§ÙØªØÙÙ Ù
Ù ÙÙØ¯",type:""},en:{title:"Verification Code",description:"Verification Code to Almoatamer Website",canonical:"https://umrah.almoatamer.com/en/auth/verification-code",keywords:"verification code",type:""}};function H(){return z.go(-1)}function V(){_.value=30;let e=Se(()=>{_.value<=0&&(clearTimeout(e),P.value==0)||_.value--},1e3)}fe(()=>{V()});async function J(){const e=new FormData,t=i("user_email");e.append("email",t.value),await F("resend-code","POST",e,x.value).then(s=>{setTimeout(()=>v.success({message:s.message}),300),V()}).catch(s=>{g.value=!1,v.error({message:s.response._data.message})})}const K=e=>{console.log("OTP completed: ",e),m.touched=!1,m.valid=!1,d.value=e},Q=e=>{console.log("OTP changed: ",e),m.touched=!0,m.valid=!1,e.length==4?b.value="":b.value=p("FORMS.Validation.otpRequired")};async function Y(e,t){k.value=!0;const s=new FormData;s.append("old_phone",e.old_phone),s.append("old_phone_code",I.value.code||e.old_code.value.code),s.append("new_phone",e.new_phone),s.append("new_phone_code",L.value.code||e.new_code.value.code),await F("modify-phone-number","POST",s,x.value).then(u=>{k.value=!1,v.success({message:u.message}),t.resetForm(),w.value=!1;const f=i("user_registered_phone");f.value=e.new_phone;const n=i("user_registered_phone_code");n.value=e.new_code.code}).catch(u=>{k.value=!1,v.error({message:u.response._data.message})})}async function Z(e,t){if(!d.value||d.value.length!=4){b.value=p("FORMS.Validation.otpRequired");return}g.value=!0;const s=new FormData,u=i("type"),f=i("user_email");s.append("email",f.value),s.append("otp",d.value),await F("verify","POST",s,x.value).then(n=>{if(g.value=!1,u.value==="resetPassword")M(O("/auth/change-password"));else{C.value=!0;const r=i("umrah_token");r.value=n.data.token;const ee=i("user_email");ee.value=n.data.email;const oe=i("user_name");oe.value=n.data.name;const te=i("user_image");te.value=n.data.image?n.data.image:"";const ae=i("i18n_redirected");ae.value=n.data.locale;const se=i("user_registered_phone");se.value=n.data.phone;const ne=i("user_registered_phone_code");ne.value=n.data.phone_code,setTimeout(()=>{M(O("/"))},2e3)}u.value=null,m.touched=!1,m.valid=!1,d.value="",V()}).catch(n=>{g.value=!1,v.error({message:n.response._data.message})})}return(e,t)=>{const s=le,u=ie,f=re,n=de;return h(),R(ve,null,[a(X)?(h(),y(s,{key:0,metas:G[a(x)]},null,8,["metas"])):S("",!0),o("div",$e,[o("div",Oe,[o("div",null,[o("a",{href:a(O)("/"),title:e.$t("NAV.home"),"aria-label":e.$t("NAV.home")},[...t[9]||(t[9]=[o("img",{width:"55",height:"55",src:we,alt:"logo",format:"webp",loading:"lazy"},null,-1)])],8,Ve)]),o("div",null,[o("img",{onClick:t[0]||(t[0]=r=>H()),class:"me-auto cursor-pointer",src:ye,width:"25",height:"25",alt:"back icon",format:"webp",loading:"lazy"})])]),o("div",Fe,[o("h2",Pe,l(e.$t("TITLES.check_code")),1),o("p",Ie,[N(l(e.$t("TITLES.co
1de_sent"))+" ",1),o("span",Le,l(("useCookie"in e?e.useCookie:a(i))("user_email")),1)]),o("p",Me,l(e.$t("TITLES.enter_code")),1),o("p",{onClick:t[1]||(t[1]=r=>j()),class:"text-primary text-start font-medium cursor-pointer"},l(e.$t("TITLES.edit_phone")),1)]),T(u,{as:"div",onSubmit:Z},{default:$(()=>[o("form",Re,[o("div",Ne,[o("div",{class:ge(["w-full",!a(m).valid&&a(m).touched?"error":""])},[T(a(ke),{ref:"otpInput",name:"otp",modelValue:a(d),"onUpdate:modelValue":t[2]||(t[2]=r=>be(d)?d.value=r:d=r),value:a(d),"input-classes":"otp-input",separator:" ","num-inputs":4,"should-auto-focus":!0,"input-type":"number",conditionalClass:["one","two","three","four"],placeholder:["*","*","*","*"],onOnChange:Q,onOnComplete:K},null,8,["modelValue","value"]),a(b)?(h(),R("p",Be,l(a(b)),1)):S("",!0)],2),o("div",Ee,[o("p",De,[N(l(e.$t("TITLES.not_receive_code"))+" ",1),o("button",{disabled:a(_)!=0||a(P)!=0,type:"button",onClick:J,class:"base-text"},l(e.$t("BUTTONS.resend")),9,ze)]),o("p",qe," 00:"+l(a(_)<10?"0":"")+l(a(_)),1)]),o("button",{disabled:a(g),type:"submit",class:"base-btn flex-grow"},l(e.$t("BUTTONS.next")),9,Ae)])])]),_:1}),(h(),y(B,{to:"body"},[a(w)?(h(),y(n,{key:0,onClose:t[6]||(t[6]=r=>w.value=!a(w))},{default:$(()=>[o("div",{class:"container",onClick:t[5]||(t[5]=E(()=>{},["stop"]))},[o("h2",Ue,l(a(p)("TITLES.change_phone")),1),T(u,{as:"div",onSubmit:Y,"validation-schema":a(q)},{default:$(()=>[o("form",je,[o("div",We,[T(f,{onCode_change:t[3]||(t[3]=r=>A(r)),placeholder:e.$t("FORMS.Placeholders.enter_old_phone"),name:"old_phone",id:"old_phone"},null,8,["placeholder"]),T(f,{onCode_change:t[4]||(t[4]=r=>U(r)),placeholder:e.$t("FORMS.Placeholders.enter_new_phone"),name:"new_phone",id:"new_phone"},null,8,["placeholder"]),o("button",{disabled:a(k),type:"submit",class:"base-btn flex-grow"},l(e.$t("BUTTONS.save")),9,Xe)])])]),_:1},8,["validation-schema"])])]),_:1})):S("",!0)])),(h(),y(B,{to:"body"},[a(C)?(h(),y(n,{key:0,closeBtn:!1,onClose:t[8]||(t[8]=r=>C.value=!a(C))},{default:$(()=>[o("div",{class:"container",onClick:t[7]||(t[7]=E(()=>{},["stop"]))},[o("h2",Ge,l(a(p)("TITLES.thank_you")),1),o("div",He,l(a(p)("TITLES.account_successfully_created")),1),t[10]||(t[10]=o("img",{class:"m-auto my-5",src:Te,alt:"message icon",width:"250",height:"250",format:"webp",loading:"lazy"},null,-1))])]),_:1})):S("",!0)]))])],64)}}};export{fo 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.