import{x as S,_ as K,ae as z,ag as J,s as W,q as U,K as Z,J as w,N as X,D as ee,v as te,b as ne,V as ae,r as M,e as h,f as u,g as N,t as y,O as C,P as O,h as c,n as $,F as L,i as T,j as I,ac as re,ah as V,M as j,l as oe,E as se,w as ie,ai as le,a as ce,c as p,k as ue}from"./index.243aaeea.js";import{c as b,r as k,m as P,e as de,u as me}from"./index.esm.2bb3a7a3.js";import"./Main.bbf5bf30.js";import{_ as fe}from"./Main.50f21f28.js";import{_ as pe}from"./Main.76663f1a.js";var B={},D={},E={},he=S&&S.__awaiter||function(e,r,n,o){function i(t){return t instanceof n?t:new n(function(d){d(t)})}return new(n||(n=Promise))(function(t,d){function m(a){try{s(o.next(a))}catch(A){d(A)}}function g(a){try{s(o.throw(a))}catch(A){d(A)}}function s(a){a.done?t(a.value):i(a.value).then(m,g)}s((o=o.apply(e,r||[])).next())})},ye=S&&S.__generator||function(e,r){var n={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,d;return d={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function m(s){return function(a){return g([s,a])}}function g(s){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,i&&(t=s[0]&2?i.return:s[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,s[1])).done)return t;switch(i=0,t&&(s=[s[0]&2,t.value]),s[0]){case 0:case 1:t=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(t=n.trys,!(t=t.length>0&&t[t.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!t||s[1]>t[0]&&s[1]{d.value=await B.load(r),t.recaptchaToken=await d.value.execute(le)},g={firstname:{required:b.withMessage(w.global.t("REQUIRED_VALIDATION"),k),minLength:b.withMessage(w.global.t("MIN_LENGTH_VALIDATION",{min:2}),P(2))},lastname:{required:b.withMessage(w.global.t("REQUIRED_VALIDATION"),k),minLength:b.withMessage(w.global.t("MIN_LENGTH_VALIDATION",{min:2}),P(2))},email:{required:b.withMessage(w.global.t("REQUIRED_VALIDATION"),k),email:b.withMessage(w.global.t("EMAIL_VALIDATION"),de)},password:{required:b.withMessage(w.global.t("REQUIRED_VALIDATION"),k),minLength:b.withMessage(w.global.t("MIN_LENGTH_VALIDATION",{min:8}),P(8))},country:{required:b.withMessage(w.global.t("REQUIRED_VALIDATION"),k)},accountType:{required:b.withMessage(w.global.t("ACCOUNT_TYPE_REQUIRED"),k)}},s=()=>{setTimeout(()=>document.location.reload(),5e3)},a=me(g,X(t)),A=async()=>{const _=ce();if(a.value.$touch(),t.recaptchaToken===""&&s(),!a.value.$invalid){let f={firstname:t.firstname,lastname:t.lastname,email:t.email,password:t.password,account_type:t.accountType,country:t.country};i.value=!0,await _.register(f),i.value=!1}},R=()=>ue.push({path:"/login"}),q=()=>{document.querySelector("input[name='password']").type="text"},H=()=>{document.querySelector("input[name='password']").type="password"};return ee(()=>{te("body").removeClass("main").removeClass("error-page").addClass("login")}),ne(async()=>{await n.getAll(),await m(),console.log("recaptcha token: "+t.recaptchaToken),d.value.showBadge()}),ae(async()=>{d.value.hideBadge()}),(_,f)=>{const Q=M("EyeIcon"),Y=M("LoadingIcon"),F=M("i18n-t");return p(),h("div",null,[u("div",ve,[u("div",we,[N(fe),u("div",be,[u("div",Ie,[u("div",xe,[u("h2",Ae,y(_.$t("SIGN_UP")),1),N(pe)]),u("div",Ce,y(_.$t("SING_IN_MOTIVATION_MOBILE")),1),u("div",Le,[C(u("input",{type:"text","onUpdate:modelValue":f[0]||(f[0]=l=>c(a).firstname.$model=l),class:$(["intro-x login__input form-control py-3 px-4 block",{"border-danger":c(a).firstname.$error}]),placeholder:_.$t("FIRSTNAME")},null,10,Te),[[O,c(a).firstname.$model,void 0,{trim:!0}]]),c(a).firstname.$error?(p(!0),h(L,{key:0},T(c(a).firstname.$errors,(l,v)=>(p(),h("div",{key:v,class:"text-danger mt-2"},y(l.$message),1))),128)):I("",!0),C(u("input",{type:"text","onUpdate:modelValue":f[1]||(f[1]=l=>c(a).lastname.$model=l),class:$(["intro-x login__input form-control py-3 px-4 block mt-4",{"border-danger":c(a).lastname.$error}]),placeholder:_.$t("LASTNAME")},null,10,ke),[[O,c(a).lastname.$model,void 0,{trim:!0}]]),c(a).lastname.$error?(p(!0),h(L,{key:1},T(c(a).lastname.$errors,(l,v)=>(p(),h("div",{key:v,class:"text-danger mt-2"},y(l.$message),1))),128)):I("",!0),C(u("input",{type:"text","onUpdate:modelValue":f[2]||(f[2]=l=>c(a).email.$model=l),class:$(["intro-x login__input form-control py-3 px-4 block mt-4",{"border-danger":c(a).email.$error}]),placeholder:_.$t("EMAIL")},null,10,De),[[O,c(a).email.$model,void 0,{trim:!0}]]),c(a).email.$error?(p(!0),h(L,{key:2},T(c(a).email.$errors,(l,v)=>(p(),h("div",{key:v,class:"text-danger mt-2"},y(l.$message),1))),128)):I("",!0),u("div",$e,[C(u("input",{type:"password","onUpdate:modelValue":f[3]||(f[3]=l=>c(a).password.$model=l),class:$(["login__input form-control py-3 px-4 block mt-4",{"border-danger":c(a).password.$error}]),placeholder:_.$t("PASSWORD"),name:"password"},null,10,Ee),[[O,c(a).password.$model,void 0,{trim:!0}]]),N(Q,{class:"block mx-auto absolute top-1/2 transform -translate-y-1/2 right-3 text-slate-400 cursor-pointer",onMousedown:q,onMouseup:H})]),c(a).password.$error?(p(!0),h(L,{key:3},T(c(a).password.$errors,(l,v)=>(p(),h("div",{key:v,class:"text-danger mt-2"},y(l.$message),1))),128)):I("",!0),C(u("select",{class:$(["form-select py-3 px-4 block mt-4 sm:mr-2",{"border-danger":c(a).country.$error}]),"aria-label":"Default select example","onUpdate:modelValue":f[4]||(f[4]=l=>c(a).country.$model=l),name:"country"},[u("option",Ne,y(_.$t("SELECT_COUNTRY")),1),c(o).length?(p(!0),h(L,{key:0},T(c(o),l=>(p(),h("option",{key:l.id,value:l.id},y(l.name),9,Oe))),128)):I("",!0)],2),[[re,c(a).country.$model]]),c(a).country.$error?(p(!0),h(L,{key:4},T(c(a).country.$errors,(l,v)=>(p(),h("div",{key:v,class:"text-danger mt-2"},y(l.$message),1))),128)):I("",!0),u("div",Se,[u("label",null,y(_.$t("ACCOUNT_TYPE")),1),u("div",Re,[u("div",Me,[C(u("input",{id:"radio-switch-4",class:"form-check-input",type:"radio","onUpdate:modelValue":f[5]||(f[5]=l=>t.accountType=l),name:"accountType",value:"business"},null,512),[[V,t.accountType]]),u("label",Pe,y(_.$t("ACCOUNT_TYPE_BUSINESS")),1)]),u("div",Ue,[C(u("input",{id:"radio-switch-6",class:"form-check-input",type:"radio","onUpdate:modelValue":f[6]||(f[6]=l=>t.accountType=l),name:"accountType",value:"company"},null,512),[[V,t.accountType]]),u("label",Ve,y(_.$t("ACCOUNT_TYPE_COMPANY")),1)])])]),c(a).accountType.$error?(p(!0),h(L,{key:5},T(c(a).accountType.$errors,(l,v)=>(p(),h("div",{key:v,class:"text-danger mt-2"},y(l.$message),1))),128)):I("",!0)]),u("div",je,[u("button",{class:"btn btn-primary py-3 px-4 xl:mr-3 align-top w-full custom-btns",onClick:j(A,["prevent"]),disabled:i.value},[oe(y(_.$t("SIGN_UP"))+" ",1),i.value?(p(),se(Y,{key:0,icon:"oval",color:"white",class:"w-4 h-4 ml-2"})):I("",!0)],8,Be)]),u("div",Ge,[N(F,{keypath:"ALREADY_HAS_ACCOUNT",for:"SIGN_IN",class:"w-full text-center",tag:"p"},{default:ie(()=>[u("a",{onClick:j(R,["prevent"]),href:"#",class:"font-bold underline"},y(_.$t("SIGN_IN")),9,qe)]),_:1})])])])])])])}}};var Je=K(He,[["__scopeId","data-v-c8e96066"]]);export{Je as default};