123 |
- var Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){class i extends n.Platform.Core.BaseComponent{jsFiles(){return["tenants/themes/compact/index.anonymous.js","platform/membership/managers/accountmanager.js","libs/passwordrequirement/passwordrequirement.js"]}cssFiles(){return["libs/passwordrequirement/passwordrequirement.css"]}html(){if(jQuery("#external-form").length===0){var n=new t.Index_Anonymous;n.init(null)}return`<div><form id="frm_Signup" default="" data-validate="parsley" data-isdynamic="false"><h1 class="display-4 mb-10 ml-10 mr-10">Sign up for free</h1><p class="mb-30 ml-10 mr-10">Create your account and start your free trial today</p><div><div id="div_ValidationSummary" class="clear ml-20 mr-20"></div><div class="form-row"><div class="col-md-6 form-group"><input class="form-control required" id="txt_FirstName" placeholder="First name" value="" type="text" required></div><div class="col-md-6 form-group"><input class="form-control required" id="txt_LastName" placeholder="Last name" value="" type="text" required></div></div><div class="form-group"><input class="form-control required" maxlength="10" id="txt_PhoneNum" placeholder="Mobile" type="tel" required></div><div class="form-group"><input class="form-control required" id="txt_Email" placeholder="Email" type="text" required></div><div class="form-group"><input class="form-control required pr-password " id="txt_Password" placeholder="Password" type="password" autocomplete="new-password" required><span toggle="#txt_Password" id="passwordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"/></span><div class="showpwsdreq"></div></div><div class="form-group"><input class="form-control required" id="txt_ConfirmPassword" placeholder="Confirm Password" type="password" autocomplete="new-password" required><span toggle="#txtConfirmPassword" id="confirmPasswordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"/></div><div class="form-row"><div class="col-md-6 form-group"><input class="form-control required" id="txt_TenantName" placeholder="Tenant Name" type="text" required></div>
- <div class=" col-md-6 form-group " id="div_Industry"><select id="ddl_Industry" class="form-control value-control" data-isdynamic="false"></select><input class="form-control" id="txt_IndustryName" placeholder="Industry Name" type="text" class="hidden"></div>
- </div></div><div class="custom-control custom-checkbox mb-25 ml-10 mr-10"><input class="custom-control-input" id="chk_ReadTerms" type="checkbox"><label class="custom-control-label font-14" for="chk_ReadTerms">I have read and agree to the <a href=""><u>term and conditions</u></a></label></div><div class="ml-10 mr-10 mb-25 text-center"><a class="btn btn-primary btn-block text-white disabled" id="btn_Register">Register</a><div class="option-sep">or</div><p class="text-center">Already have an account?<a href="index.html#/login">Sign In</a></p></div></form><div id="modal_Otp" class="modal fade hide"><div class="modal-dialog"><div class="modal-content"><div class="modal-header mt-2 mb-2"><h5 class="modal-title pull-left">Mobile or Email Verification</h5><button type="button" class="close pull-right" data-dismiss="modal" aria-hidden="true" >×</button></div><div class="modal-body" id="div_modalbody"><div class="mb-10"><p class="lbl_Otp">We have sent OTP on your Mobile Number and Email!</p></div><div class="floating-label-form-group mb-2"><input class="form-control" id ="txt_Otp" placeholder="Enter Mobile OTP/Email OTP" type="text"></div></div><div class="modal-footer mb-2" style="display:block"><button type = "button" class="btn btn-primary pull-left" id="btn_ResendOtp">Resend</button><button type = "button" class="btn btn-primary pull-right" id="btn_VerifyOtp">Verify</button></div></div></div></div></div>`}load(){$(".pr-password").click(function(){var n=$(".pr-password");n.passwordRequirements({numCharacters:8,useLowercase:!0,useUppercase:!0,useNumbers:!0,useSpecial:!0})});this._accountManager=n.Platform.Membership.Managers.AccountManager.Instance();var t=this;t.loadIndustries();jQuery(".preloader-it").delay(500).fadeOut("slow");jQuery("#external-container").delay(500).fadeIn("slow");jQuery("#bizgaze_body").css("background-color","#f4f6f7");$("#div_modalbody").removeAttr("style");$("#chk_ReadTerms").change(function(){$(this).prop("checked")?$("#btn_Register").removeClass("disabled"):$("#btn_Register").addClass("disabled")});$("#passwordHide").click(function(){var n=$("#txt_Password");n.attr("type")=="password"?n.attr("type","text"):n.attr("type","password");$("#passwordHide").toggleClass("fa-eye-slash fa-eye")});$("#confirmPasswordHide").click(function(){var n=$("#txt_ConfirmPassword");n.attr("type")=="password"?n.attr("type","text"):n.attr("type","password");$("#confirmPasswordHide").toggleClass("fa-eye-slash fa-eye")});$("#txt_Otp").keypress(function(n){n.which==13&&document.getElementById("btn_VerifyOtp").click()});$("#txt_PhoneNum").keypress(function(n){if(n.which!=8&&n.which!=0&&(n.which<48||n.which>57))return MessageHelper.Instance().showError("Numbers only allowed","div_ValidationSummary"),!1});$("#btn_Register").click(function(){t.validate()});$("#btn_VerifyOtp").click(function(){t.verifyOtp()});$("#btn_ResendOtp").click(function(){t.sendOtp(t.OtpId)})}loadIndustries(){var n=this;this._accountManager.getIndustries().then(function(t){var i;if(t.result.length>0){$("#ddl_Industry").removeClass("hidden");$("#txt_IndustryName").addClass("hidden");let o=document.getElementById("ddl_Industry");for($("#ddl_Industry").empty(),$("#ddl_Industry").append("<option value=0>Select Industry<\/option>"),n.IndustryLength=t.result.length,i=0;i<t.result.length;i++){var r=t.result[i],u=document.createElement("option"),f=r.industryName,e=r.industryId+"|"+r.industryTenantId+"|"+r.isDefaultData;u.text=f;u.value=e;o.append(u)}}else $("#ddl_Industry").addClass("hidden"),$("#txt_IndustryName").removeClass("hidden")})}validate(){var t=this,u=$("#txt_ConfirmPassword").val(),i=$("#txt_Password").val(),r=$("#txt_PhoneNum").val(),n=$("#txt_Email").val(),f=document.getElementById("frm_Signup"),e=f.checkValidity();if(!e)return MessageHelper.Instance().showError("Mandatory fields are missing!","div_ValidationSummary"),!1;if(i.length<8||u.length<8)return MessageHelper.Instance().showError("Password must be atleast 8 characters!","div_ValidationSummary"),!1;var i=$("#txt_Password").val(),o=i.match(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,15}$/)?!0:!1;if(o==!1)return $(".pr-password").focus(),MessageHelper.Instance().showError("Please Match the Password in requested Format","div_ValidationSummary"),!1;if(i!=u)return MessageHelper.Instance().showError("New and Confirm Passwords doesn't match!","div_ValidationSummary"),!1;if(/^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+((com|COM|in|IN))+$/.test(n)==!1)return MessageHelper.Instance().showError("Email is not provided in correct format","div_ValidationSummary"),!1;if(t.IndustryLength!=0){if($("#ddl_Industry option:selected").val()==0)return MessageHelper.Instance().showError("Select an Industry!","div_ValidationSummary"),!1}else if($("#txt_IndustryName").val()=="")return MessageHelper.Instance().showError("Industry Name cannot be empty!","div_ValidationSummary"),!1;t._accountManager.getUser(r,n).then(function(i){if(i.result!=null){if(i.result.contactNumber==r&&i.result.email==n)return MessageHelper.Instance().showError("Phone Number & Email already exists!","div_ValidationSummary"),!1;if(i.result.contactNumber==r)return MessageHelper.Instance().showError("Phone Number already exists!","div_ValidationSummary"),!1;if(i.result.email==n)return MessageHelper.Instance().showError("Email already exists!","div_ValidationSummary"),!1}else $(".lbl_Otp").removeClass("text-danger text-success").text("We have sent OTP on your Mobile Number and Email !"),$("#txt_Otp").val(""),$("#div_ValidationSummary").empty(),t.sendOtp(0)},function(){MessageHelper.Instance().showError("Some Error has occurred!","div_ValidationSummary")})}sendOtp(n){var t=this,i;$(".preloader-it").fadeIn();i={FirstName:$("#txt_FirstName").val(),LastName:$("#txt_LastName").val(),ContactNumber:$("#txt_PhoneNum").val(),Email:$("#txt_Email").val(),TenantName:$("#txt_TenantName").val(),ContactOrEmail:"",IsForgotPswd:!1,IsRegisterUser:!1,IsSignup:!0,UnibaseId:"",OtpId:n,UserOtp:""};t._accountManager.sendOtp(i).then(function(i){n!=0&&$(".lbl_Otp").text("OTP has been Resent!").removeClass("text-danger","").addClass("text-success","");i==0?($(".preloader-it").delay(200).fadeOut("slow"),MessageHelper.Instance().showError("Some Error has occurred!","div_ValidationSummary")):(t.OtpId=i,$(".preloader-it").delay(200).fadeOut("slow"),$("#modal_Otp").modal("show"))},function(){$(".preloader-it").delay(200).fadeOut("slow");$("#signup-container").show();MessageHelper.Instance().showError("Some Error has occurred!","div_ValidationSummary")})}verifyOtp(){var n=this,t;$("#txt_Otp").val()==""?$(".lbl_Otp").text("Please Enter OTP!").addClass("text-danger",""):(t={FirstName:"",LastName:"",ContactNumber:"",Email:"",TenantName:"",ContactOrEmail:"",IsForgotPswd:!1,IsRegisterUser:!1,IsSignup:!0,UnibaseId:"",OtpId:n.OtpId,UserOtp:$("#txt_Otp").val()},n._accountManager.verifyOtp(t).then(function(t){t.result!=null?t.result.contactConfirmed==!1&&t.result.emailConfirmed==!1?($("#modal_Otp").modal("show"),$(".lbl_Otp").text("Invalid OTP!").addClass("text-danger",""),$("#txt_Otp").val("")):($("#modal_Otp").modal("hide"),n.saveSignUp(t.result.contactConfirmed,t.result.emailConfirmed)):t.code.toString()=="2"&&($("#modal_Otp").modal("show"),$(".lbl_Otp").text(t.errors.toString()).addClass("text-danger",""),$("#txt_Otp").val(""))}))}saveSignUp(t,i){var f=this,r,h;$(".preloader-it").fadeIn();var e=0,o=0,s=!1,u="";$("#txt_IndustryName").val()==""&&$("#ddl_Industry option:selected").val()!="0"?(r=$("#ddl_Industry option:selected").val().toString().split("|"),e=parseInt(r[0]),o=parseInt(r[1]),s=JSON.parse(r[2]),u=$("#ddl_Industry option:selected").text()):u=$("#txt_IndustryName").val();h={FirstName:$("#txt_FirstName").val(),LastName:$("#txt_LastName").val(),ContactNumber:$("#txt_PhoneNum").val(),Email:$("#txt_Email").val(),Password:$("#txt_Password").val(),TenantName:$("#txt_TenantName").val(),TenantId:0,ContactNumberConfirmed:t,EmailConfirmed:i,IndustryId:e,IndustryTenantId:o,IndustryName:u,IsDefaultData:s};f._accountManager.signUp(h).then(function(t){if($("#frm_Signup").find("input,textarea").val(""),$("#frm_Signup").find("input").prop("checked",!1),$(".preloader-it").delay(200).fadeOut("slow"),t.errors==null)MessageHelper.Instance().showSuccess("Tenant Created Successfully","div_ValidationSummary"),f.fileCacheHelper.loadJsFileAsync("tenants/themes/compact/components/signup/signupsuccesspage.js",function(){n.Themes.Compact.Components.SignupSuccessPage.Instance().init("#bizgaze_body")});else return MessageHelper.Instance().showError(t.message,"div_ValidationSummary"),$(".preloader-it").delay(200).fadeOut("slow"),!1},function(){$(".preloader-it").delay(200).fadeOut("slow");$("#signup-container").show();MessageHelper.Instance().showError("Some Error has occurred!","div_ValidationSummary")})}static Instance(){return new i}}t.Signup=i})(i=t.Components||(t.Components={}))})(i=t.Compact||(t.Compact={}))})(t=n.Themes||(n.Themes={}))})(Unibase||(Unibase={}));
|