1import{b as e,q as a,h as l,o,e as t,f as s,a5 as n,a6 as d,u,t as i,i as r,j as c,n as m,a9 as _,aa as p,a7 as h,k as v,l as g,H as b,_ as k,B as y}from"./vendor-vue-57442272.js";import{u as w}from"./contactAuth-0a5e9b60.js";import{S as C}from"./usePhoneAuth-f023185d.js";import"./vendor-c10055d4.js";import"./vendor-analytics-a42a5756.js";import"./index-e9d222cb.js";import"./vendor-utils-f97cbb7e.js";import"./vendor-ui-ec96081f.js";const f={class:"modal-auth"},V={class:"modal-auth__content"},j={class:"modal-auth__step"},S={class:"g-row g-row_between"},x={class:"g-col"},I={class:"modal-auth__title"},E={class:"g-col"},P={class:"modal-auth__lead"},q={key:0,class:"modal-auth__method-row"},A={class:"modal-auth__radio"},R=["checked"],T={class:"modal-auth__radio"},L=["checked"],O={key:3,class:"modal-auth__error"},U={class:"modal-auth__actions modal-auth__actions--sm"},$=["disabled"],B={class:"modal-auth__step"},D={class:"g-row g-row_between"},M={class:"g-col"},H={class:"modal-auth__code-sent"},K={class:"modal-auth__code-sent-phone"},N={class:"modal-auth__otp"},W={class:"modal-auth__resend"},Y={key:0,class:"modal-auth__resend-timer"},z={key:0,class:"modal-auth__error"},F={class:"modal-auth__actions modal-auth__actions--lg"},G=["disabled"],J=e({__name:"ModalAuth",props:{header:{},lead:{},source:{default:"registration_popup"},crew:{default:null},method:{default:"phone"}},emits:["close","phone","code","auth"],setup(e,{emit:J}){var Q,X;const Z=b(()=>k(()=>import("./SvgIcon-7f9a1214.js"),["assets/SvgIcon-7f9a1214.js","assets/index-e9d222cb.js","assets/vendor-vue-57442272.js","assets/vendor-c10055d4.js","assets/vendor-5aae4848.css","assets/vendor-analytics-a42a5756.js","assets/vendor-vue-1b04fb36.css","assets/vendor-utils-f97cbb7e.js","assets/vendor-ui-ec96081f.js","assets/vendor-ui-ea45ab02.css","assets/index-6596abb1.css"])),ee=b(()=>k(()=>import("./index-92ed2eb9.js"),["assets/index-92ed2eb9.js","assets/component.scss_vue_type_style_index_1_src_true_lang-95fcc7c2.js","assets/vendor-vue-57442272.js","assets/vendor-c10055d4.js","assets/vendor-5aae4848.css","assets/vendor-analytics-a42a5756.js","assets/vendor-vue-1b04fb36.css","assets/click-outside-c025595a.js","assets/index-e9d222cb.js","assets/vendor-utils-f97cbb7e.js","assets/vendor-ui-ec96081f.js","assets/vendor-ui-ea45ab02.css","assets/index-6596abb1.css","assets/component-12724ae1.css"])),ae=e,le=J,oe=null==(Q=a())?void 0:Q.appContext.config.globalProperties,{method:te,setMethod:se,active:ne,phone:de,email:ue}=w({source:ae.source,crew:()=>ae.crew,method:(null==(X=ae.crew)?void 0:X.slug)?"phone":ae.method}),{trackView:ie}=de,re=y(()=>{var e;return!!(null==(e=ae.crew)?void 0:e.slug)}),ce=y({get:()=>ne.value.code.value,set:e=>{ne.value.code.value=e}}),me=async()=>{ne.value.isContactValid.value&&!ne.value.isRequestSending.value&&await ne.value.sendCode()&&le("phone")},_e=async()=>{await ne.value.verifyCode()&&(le("code"),le("auth"))};return l(()=>{var e;null==(e=null==oe?void 0:oe.$gtm)||e.trackEvent({event:"pop_up_event",event_variant:"pop_up_shown",pop_up_variant:"1"}),ie()}),(a,l)=>(o(),t("div",f,[s("div",V,[n(s("div",j,[s("div",S,[s("div",x,[s("h2",I,i(e.header),1)]),s("div",E,[s("div",{class:"button button_icon24 button_circle bg-grey-100 text-grey-500",onClick:l[0]||(l[0]=e=>a.$emit("close"))},[r(u(Z),{"icon-name":"close","class-name":"svg-icon_20"})])])]),s("p",P,i(e.lead),1),re.value?c("",!0):(o(),t("div",q,[s("label",A,[s("input",{checked:"phone"===u(te),type:"radio",value:"phone",class:"modal-auth__radio-input",onChange:l[1]||(l[1]=e=>u(se)("phone"))},null,40,R),l[9]||(l[9]=s("span",{class:"modal-auth__radio-mark"},null,-1)),l[10]||(l[10]=s("span",{class:"modal-auth__radio-label"},"Phone",-1))]),s("label",T,[s("input",{checked:"email"===u(te),type:"radio",value:"email",class:"modal-auth__radio-input",onChange:l[2]||(l[2]=e=>u(se)("email"))},null,40,L),l[11]||(l[11]=s("span",{class:"modal-auth__radio-mark"},null,-1)),l[12]||(l[12]=s("span",{class:"modal-auth__radio-label"},"Email",-1))])])),"email"===u(te)?(o(),t("div",{key:1,class:m(["modal-auth__email-input",{invalid:u(ue).error.value}])},[n(s("input",{"onUpdate:modelValue":l[3]||(l[3]=e=>u(ue).user.email=e),type:"email",class:"input",placeholder:"[email protected]",autocomplete:"email",inputmode:"email",onKeyup:_(me,["enter"])},null,544),[[p,u(ue).user.email]])],2)):(o(),t("div",{key:2,class:m(["modal-auth__phone-input",{invalid:!1===u(de).user.phone.isValid||u(de).error.value}])},[r(u(ee),h(u(de).vueTelInfo.value,{modelValue:u(de).user.phone.formatted,"onUpdate:modelValue":l[4]||(l[4]=e=>u(de).user.phone.formatted=e),onInput:u(de).onPhoneInput}),null,16,["modelValue","onInput"])],2)),u(ne).error.value?(o(),t("p",O,i("email"===u(te)?"Couldn't send the code to this address. Check it and try again.":"Something went wrong. Try again later."),1)):c("",!0),l[13]||(l[13]=s("p",{class:"modal-auth__agreement"},[v(" By clicking the button you agree to the "),s("a",{class:"modal-auth__agreement-link link link_underline-hover",target:"_blank",href:"https://searadar.com/legal-notice"},"offer agreement")],-1)),s("div",U,[s("button",{disabled:u(ne).isRequestSending.value||!u(ne).isContactValid.value,class:"button button_primary button_medium button_full",onClick:me}," Send the code ",8,$)])],512),[[d,!u(ne).isCodeStep.value]]),n(s("div",B,[s("div",D,[l[14]||(l[14]=s("div",{class:"g-col"},[s("h2",{class:"modal-auth__title"}," Enter the code you received ")],-1)),s("div",M,[s("div",{class:"button button_icon24 button_circle bg-grey-100 text-grey-500",onClick:l[5]||(l[5]=e=>a.$emit("close"))},[r(u(Z),{"icon-name":"close","class-name":"svg-icon_20"})])])]),s("p",H,[l[15]||(l[15]=s("span",{class:"modal-auth__code-sent-muted"},"We've sent a code to ",-1)),s("span",K,i(u(ne).contactLabel.value),1),s("a",{class:"modal-auth__code-sent-change link link_underline-hover",href:"#",onClick:l[6]||(l[6]=g((...e)=>u(ne).reset&&u(ne).reset(...e),["prevent"]))},"Change")]),s("div",N,[r(C,{modelValue:ce.value,"onUpdate:modelValue":l[7]||
1(l[7]=e=>ce.value=e),"num-inputs":5,"with-web-otp":"","input-props":{placeholder:"0",required:!0,inputmode:"numeric"},"input-classes":{error:u(ne).error.value},onOnComplete:_e},null,8,["modelValue","input-classes"])]),s("div",W,[u(ne).resendIn.value>0&&!u(ne).error.value?(o(),t("span",Y,"Send code again in "+i(u(ne).resendLabel.value),1)):(o(),t("a",{key:1,class:"modal-auth__resend-link link link_underline-hover",href:"#",onClick:l[8]||(l[8]=g((...e)=>u(ne).resendCode&&u(ne).resendCode(...e),["prevent"]))},"Send code again"))]),u(ne).error.value?(o(),t("p",z," You entered the wrong code. Try again. ")):c("",!0),s("div",F,[s("button",{disabled:u(ne).isRequestSending.value||!ce.value.length,class:"button button_primary button_medium button_full",onClick:_e}," Next ",8,G)])],512),[[d,u(ne).isCodeStep.value]])])]))}});export{J 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.