1import{_ as L,e as C,u as z,m as b,a as V,k,n as m,o as a,c as l,s,q as n,w,A as x,x as h,C as g,B as E,f as I}from"./app4991810000.js";import{a as d}from"./js.cookie3664510000.js";import{L as D}from"./login3664510000.js";import{u as q}from"./upgradeServerPlan3664510000.js";import{u as P}from"./fingerprint3664510000.js";const O={name:"login",mixins:[D],components:{GuestLayout:C(()=>I(()=>import("./Guest3664510000.js"),["Guest3664510000.js","app4991810000.js","app7208310000.css"]))},data(){return{processing:!1,defaultPlan:"Standard",showPassword:!1,user:{email:"",password:"",affiliate_code:"",referral_code:"",invitation_token:""}}},computed:{authStore(){return z()},...b(V,["enabled_providers"]),...b(q,["plan","cycle"]),...b(P,["visitorId"])},async mounted(){if(this.setSaToltReferral(),this.authStore.setOrganizations([]),!this.hosted){const e={starter:"newbie",professional:"pro"},t=["newbie","business"],o=["monthly","yearly"];let c=(this.$route.query.plan||"").toLowerCase(),r=(this.$route.query.cycle||"").toLowerCase();c=e[c]||c;const u=t.includes(c)?c:"",p=o.includes(r)?r:"",y=_=>_.charAt(0).toUpperCase()+_.slice(1);u&&p?this.setUpgradePlanInfo(y(u),y(p)):this.setUpgradePlanInfo(null,null),this.$route.query.status&&this.$route.query.status=="activated"&&d.set("standard_plan_status","activated",{expires:7})}this.$route.query.invitation_token&&(this.user.invitation_token=this.$route.query.invitation_token),this.$route.query.affiliate_code&&this.$route.query.key?this.checkAffiliateCode():d.get("affiliate_code")?this.user.affiliate_code=d.get("affiliate_code"):this.$route.query.r?this.checkReferralCode():d.get("referral_code")?this.user.referral_code=d.get("referral_code"):(this.user.referral_code="",this.user.affiliate_code="")},methods:{...k(q,["setUpgradePlanInfo"]),...k(P,["setVisitorId"]),isEnabledProvider(e){var t,o;return(o=(t=this.enabled_providers)==null?void 0:t.social)==null?void 0:o.includes(e)},async checkAffiliateCode(){await this.$axios.get("/affiliate-code/verify",{params:{affiliate_code:this.$route.query.affiliate_code,key:this.$route.query.key||""}}).then(({data:e})=>{d.set("affiliate_code",this.$route.query.affiliate_code,{expires:21}),this.user.affiliate_code=this.$route.query.affiliate_code,window.location.href=e.redirect_url}).catch(()=>{})},async checkReferralCode(){let e=this;this.$axios.get("/referral-code/verify",{params:{referral_code:this.$route.query.r}}).then(()=>{this.$route.query.affiliate_code||(e.user.referral_code=e.$route.query.r,d.set("referral_code",e.$route.query.r,{expires:7}),window.location.href=this.siteSettings.main_url)}).catch(()=>{})},async attemptLogin(){this.processing=!0,this.hideError(),await this.$axios.post("/login",this.user).then(({data:e})=>{this.$route.query&&this.$route.query.name=="supportLogin"?(this.authStore.setAccessToken(e.access_token,e.expires_in),this.$router.push(this.$route.query.to)):(this.authStore.setUser(e.user),e.user.two_fa_enable?this.$router.push("/two-factor-authentication"):(this.authStore.setAccessToken(e.access_token,e.expires_in),e.user.is_onboarding?(e.organizations.length&&(this.authStore.setOrganizations(e.organizations),this.authStore.setCurrentOrganization(e.organizations[0],!1)),e.user.hasOrganizationExist?e.user.hasNewSubscriptionPlanExist?this.login(e):e.user.hasRegisterLifetimeDeal?this.$router.push({name:"lifetimePlanSelection"}):this.$router.push({name:"recurringPlanSelection"}):this.createOrganization()):e.organizations==null||!e.organizations.length?this.createOrganization():this.login(e)))}).catch(({response:e})=>{if(e!==void 0){const{status:t,data:o}=e;t===422?this.displayError(o):this.$toast.error(o.message)}}).finally(()=>{this.processing=!1})},async createOrganization(){await this.$axios.post("/organizations",{name:"Personal"}).then(({data:e})=>{this.authStore.setOrganizations(e.data.organizations),this.authStore.setCurrentOrganization(e.data.organizations[0],!1),this.authStore.user.hasRegisterLifetimeDeal?this.$router.push({name:"lifetimePlanSelection"}):this.$router.push({name:"recurringPlanSelection"})}).catch(({response:e})=>
1{if(e!==void 0){const{data:t}=e;this.$toast.error(t.message)}}).finally(()=>{this.processing=!1})},async socialLogin(e){var t;try{const o=await this.$fpjs.getVisitorData({extendedResult:!0});this.setVisitorId(o.visitorId)}catch{this.setVisitorId("")}this.$axios.post(`/users/${e}/url`,{defaultPlan:this.defaultPlan,referral_code:this.user.referral_code,affiliate_code:this.user.affiliate_code,invitation_token:this.user.invitation_token,support_login:!!(this.$route.query&&this.$route.query.name=="supportLogin"),tolt_referral:(t=window.tolt_referral)!=null?t:null,visitorId:this.visitorId}).then(({data:o})=>{window.location.href=o.redirect_url}).catch(({response:{data:o}})=>{this.$toast.error(o.message)})}}},A={class:"min-h-screen h-full bg-gradient-to-t from-[#EBF3FF] to-white"},B={class:"flex flex-col justify-center items-center py-14 min-h-screen h-full sm:px-0 px-5"},F={class:"mb-8"},R={key:0,src:"/logo/SaLogoDark.png",width:"180",class:"",alt:"ServerAvatar Logo"},U=["src","alt"],j={class:"mx-auto w-full max-w-md lg:w-[26rem] bg-white border border-gray-100 rounded-xl shadow-sm p-6"},G={key:0,class:"text-red-500 error_message",id:"email_message",role:"alert"},N={class:"mt-4"},T={class:"relative"},M={key:0,class:"text-red-500 error_message",id:"password_message",role:"alert"},H={class:"text-right mt-2"},W={key:0,class:"fa-solid fa-circle-notch fa-spin mr-1 self-center inline-flex"},Y={key:0,class:"relative flex py-2 items-center mt-2.5"},J={class:"text-sm font-medium text-gray-700 text-center tracking-wide mt-3 flex flex-wrap items-center justify-center gap-2"};function K(e,t,o,c,r,u){const p=m("Field"),y=m("ErrorMessage"),_=m("PasswordVisibility"),v=m("router-link"),S=m("Button"),$=m("Form");return a(),l("div",A,[s("div",B,[s("div",F,[!e.hosted||e.hosted&&!e.logo?(a(),l("img",R)):(a(),l("img",{key:1,src:e.logo,width:"180",alt:e.title||"Logo"},null,8,U))]),s("div",j,[t[13]||(t[13]=s("h1",{class:"text-2xl mb-1.5"},"Login",-1)),t[14]||(t[14]=s("p",{class:"text-gray-500 mb-5"},"Hi, Welcome back \u{1F44B}",-1)),n($,{action:"javascript:void(0)",onSubmit:u.attemptLogin,ref:"loginForm",onInvalidSubmit:e.onInvalidSubmit},{default:w(({errors:i})=>[s("div",null,[t[5]||(t[5]=s("label",{for:"email",class:"block mb-2 text-tiny font-semibold tracking-wide text-gray-900 after:content-['*'] after:ml-0.5 after:text-red-500"},"Email",-1)),n(p,{rules:"required|email",validateOnBlur:!0,type:"email",name:"email",modelValue:r.user.email,"onUpdate:modelValue":t[0]||(t[0]=f=>r.user.email=f),id:"email","aria-describedby":"email_message","aria-required":"true",class:x([{"border-red-500 focus:border-red-500":!!(i!=null&&i.email),"border-slate-300 focus:border-sa-500":!(i!=null&&i.email)},"border email text-gray-900 text-sm rounded-lg focus:ring-0 block w-full p-2"]),placeholder:"Enter Email"},null,8,["modelValue","class"]),n(y,{class:"text-red-500 vee-error",as:"small",name:"email"}),!i||!i.email?(a(),l("small",G)):h("",!0)]),s("div",N,[t[6]||(t[6]=s("label",{for:"password",class:"block mb-2 text-tiny font-semibold tracking-wide text-gray-900 after:content-['*'] after:ml-0.5 after:text-red-500"},"Password",-1)),s("div",T,[n(p,{rules:"required|string|min:8|max:64",validateOnBlur:!0,type:r.showPassword?"text":"password",name:"password",modelValue:r.user.password,"onUpdate:modelValue":t[1]||(t[1]=f=>r.user.password=f),id:"password",placeholder:"********","aria-describedby":"password_message","aria-required":"true",class:x([{"border-red-500 focus:border-red-500":!!(i!=null&&i.password),"border-slate-300 focus:border-sa-500":!(i!=null&&i.password)},"border text-gray-900 text-sm rounded-lg focus:ring-0 block w-full p-2"])},null,8,["type","modelValue","class"]),n(_,{showPassword:r.showPassword,onToggle:t[2]||(t[2]=f=>r.showPassword=!r.showPassword)},null,8,["showPassword"])]),n(y,{class:"text-red-500 vee-error",as:"small",name:"password"}),!i||!i.password?(a(),l("small",M)):h("",!0)]),s("div",H,[n(v,{to:{name:"forgotPassword"},class:"ml-auto text-sm font-medium text-sa-500 hover:underline"},{default:w(()=>[...t[7]||(t[7]=[g(" Forgot Password?",-1)])]),_:1})]),n(S,{type:"submit",class:"w-full mt-4",disabled:r.processing},{default:w(()=>[r.processing?(a(),l("i",W)):h("",!0),g(" "+E(r.processing?"Please wait":"Login"),1)]),_:1},8,["disabled"]),e.enabled_providers&&e.enabled_providers.social.length?(a(),l("div",Y,[...t[8]||(t[8]=[s("div",{class:"flex-grow border-t border-[#D1D5DB]"},null,-1),s("span",{class:"flex-shrink mx-4 text-[#6B7280] text-sm"},"Or Login With",-1),s("div",{class:"flex-grow border-t border-[#D1D5DB]"},null,-1)])])):h("",!0),s("div",{class:x(["sm:grid place-content-center gap-5 mt-2.5",e.enabled_providers&&e.enabled_providers.social.length>
11?"sm:grid-cols-2":""])},[u.isEnabledProvider("google")?(a(),l("button",{key:0,type:"button",onClick:t[3]||(t[3]=f=>u.socialLogin("google")),class:"bg-gray-100 rounded-md w-full py-2.5 px-6 flex justify-center items-center gap-x-1","aria-label":"Login with Google"},[...t[9]||(t[9]=[s("img",{src:"/svg/google.svg",class:"mr-1",alt:"Google logo"},null,-1),g(" Google ",-1)])])):h("",!0),u.isEnabledProvider("github")?(a(),l("button",{key:1,type:"button",onClick:t[4]||(t[4]=f=>u.socialLogin("github")),class:"bg-gray-100 rounded-md w-full py-1.5 px-6 flex justify-center items-center gap-x-1 mt-3 sm:mt-0","aria-label":"Login with GitHub"},[...t[10]||(t[10]=[s("i",{class:"lab la-github text-3xl"},null,-1),g("Github ",-1)])])):h("",!0)],2),s("div",J,[t[12]||(t[12]=g(" Not Register Yet? ",-1)),n(v,{to:{name:"register",...this.$route.query.name?{query:{to:this.$route.query.to,name:this.$route.query.name}}:{}},class:"text-sa-500 flex items-center"},{default:w(()=>[...t[11]||(t[11]=[g(" Create an account ",-1),s("span",{class:"material-symbols-outlined -rotate-45 text-xl"}," arrow_forward ",-1)])]),_:1},8,["to"])])]),_:1},8,["onSubmit","onInvalidSubmit"])])])])}const se=L(O,[["render",K],["__scopeId","data-v-0438510e"]]);export{se 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.