{"version":3,"sources":["Pages/Home/Signup.js"],"names":["initEvents","$","change","this","checked","removeClass","prop","addClass","on","is","val","show","hide","initValidation","validator","addMethod","value","element","params","response","grecaptcha","getResponse","length","digits","replace","split","validate","rules","FirstName","required","minlength","maxlength","LastName","Email","email","remote","url","type","PrimaryPhone","phoneUS","notFakePhone","PrimaryPhoneType","mobileTypeRequiredIfOptIn","Password","passwordMeetsRequirements","ConfirmPassword","equalTo","AgreeToTerms","reCaptcha","WaiverSignature","waiverSignatureMatch","WaiverParentName","depends","WaiverParentRelationship","WaiverParentEmail","WaiverParentPhone","WaiverParentSignature","trimEqualTo","messages","errorContainer","errorLabelContainer","errorElement","onkeyup"],"mappings":"AASA,SAASA,aACPC,EAAE,iBAAiBC,QAAO,WACpBC,KAAKC,SACPH,EAAE,qBAAqBI,YAAY,YACnCJ,EAAE,qBAAqBK,KAAK,YAAY,KAGxCL,EAAE,qBAAqBM,SAAS,YAChCN,EAAE,qBAAqBK,KAAK,YAAY,OAI5CL,EAAE,wBAAwBO,GAAG,UAAU,WACjCP,EAAEE,MAAMM,GAAG,YACbR,EAAE,gBAAgBM,SAAS,UAE3BN,EAAE,gBAAgBI,YAAY,aAIlCJ,EAAE,qBAAqBO,GAAG,UAAU,WACZ,WAAlBP,EAAEE,MAAMO,MACVT,EAAE,WAAWU,OAGbV,EAAE,WAAWW,UAKnB,SAASC,iBACPZ,EAAEa,UAAUC,UAAU,aACpB,SAAUC,EAAOC,EAASC,GACxB,IAAIC,EAAWC,WAAWC,cAC1B,OAAOF,GAAYA,EAASG,OAAS,IACpC,yCAGLrB,EAAEa,UAAUC,UAAU,gBACpB,SAAUC,EAAOC,EAASC,GACxB,GAAIF,EAAO,CACT,IAAIO,EAASP,EAAMQ,QAAQ,OAAQ,IAAIC,MAAM,IAC7C,GAAsB,KAAlBF,EAAOD,OAST,OAAO,EARP,GAAiB,KAAbC,EAAO,IAA0B,KAAbA,EAAO,IAA0B,KAAbA,EAAO,GACjD,OAAO,EAEJ,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,CACNC,IAAK,6BACLC,KAAM,SAGVkB,kBAAmB,CACjB1B,SAAU,CACRuB,QAAS,WACP,OAAoD,GAA5CnD,EAAE,wBAAwBQ,GAAG,cAGzC8B,SAAS,GAEXiB,sBAAuB,CACrB3B,SAAU,CACRuB,QAAS,WACP,OAAoD,GAA5CnD,EAAE,wBAAwBQ,GAAG,cAGzCgD,YAAa,sBAGjBC,SAAU,CACR9B,UAAW,CACTC,SAAU,0BACVC,UAAW,8CACXC,UAAW,gDAEbC,SAAU,CACRH,SAAU,yBACVC,UAAW,6CACXC,UAAW,+CAEbE,MAAO,CACLJ,SAAU,qBACVK,MAAO,mBACPH,UAAW,2CAEbO,aAAc,CACZT,SAAU,qBACVU,QAAS,oBACTC,aAAc,qBAEhBG,SAAU,CACRd,SAAU,yBAEZgB,gBAAiB,CACfhB,SAAU,gCACViB,QAAS,yBAEXC,aAAc,CACZlB,SAAU,sCACVmB,UAAW,yCAEbC,gBAAiB,CACfpB,SAAU,2DAEZsB,iBAAkB,CAChBtB,SAAU,gDAEZwB,yBAA0B,CACxBxB,SAAU,6CAEZyB,kBAAmB,CACjBzB,SAAU,qCACVK,MAAO,wDAETqB,kBAAmB,CACjB1B,SAAU,qCACVU,QAAS,uDAEXiB,sBAAuB,CACrB3B,SAAU,2EACV4B,YAAa,yEAGjBE,eAAgB,yBAChBC,oBAAqB,mBACrBC,aAAc,KACdC,SAAS,IAxOb7D,GAAE,WACAY,iBACAb,aAGAC,EAAE,qBAAqBM,SAAS,YAChCN,EAAE,qBAAqBK,KAAK,YAAY","file":"Signup.min.js","sourcesContent":["$(function () {\n initValidation();\n initEvents();\n\n //Set the inital state of the create account button\n $(\"#createAccountBtn\").addClass('disabled');\n $(\"#createAccountBtn\").prop('disabled', true);\n});\n\nfunction initEvents() {\n $(\"#AgreeToTerms\").change(function () {\n if (this.checked) {\n $(\"#createAccountBtn\").removeClass('disabled');\n $(\"#createAccountBtn\").prop('disabled', false);\n }\n else {\n $(\"#createAccountBtn\").addClass('disabled');\n $(\"#createAccountBtn\").prop('disabled', true);\n }\n });\n\n $('#Over18Certification').on('change', function () {\n if ($(this).is(':checked')) {\n $('#ParentPanel').addClass('hidden');\n } else {\n $('#ParentPanel').removeClass('hidden');\n }\n });\n\n $('#PrimaryPhoneType').on('change', function () {\n if ($(this).val() !== 'Mobile') {\n $('#otpDiv').show();\n }\n else {\n $('#otpDiv').hide();\n }\n });\n}\n\nfunction initValidation() {\n $.validator.addMethod(\"reCaptcha\",\n function (value, element, params) {\n var response = grecaptcha.getResponse();\n return response && response.length > 0;\n }, 'You must confirm you are not a robot.');\n\n //Match BaseController.IsValidPhoneNumberWithFormatting\n $.validator.addMethod(\"notFakePhone\",\n function (value, element, params) {\n if (value) {\n var digits = value.replace(/\\D+/g, '').split('');\n if (digits.length === 10) {\n if (digits[3] == '5' && digits[4] == '5' && digits[5] == '5') { //(XXX) 555-XXXX\n return false;\n }\n else if (digits[3] == digits[4] && digits[4] == digits[5] && digits[5] == digits[6] && digits[6] == digits[7] && digits[7] == digits[8] && digits[8] == digits[9]) { //(XXX) 111-1111\n return false;\n }\n }\n else {\n return false;\n }\n }\n\n return true;\n }, 'Phone is invalid.');\n\n $.validator.addMethod(\"mobileTypeRequiredIfOptIn\",\n function (value, element) {\n if ($('#OptInToTextMessages').length > 0 && $('#OptInToTextMessages').is(':checked')) {\n if (value === 'Mobile') {\n return true;\n }\n else {\n return false;\n }\n }\n\n return true;\n }, 'You must enter a mobile number to opt in to text messages');\n\n $.validator.addMethod(\"waiverSignatureMatch\",\n function (value, element) {\n return ($('#WaiverSignature').val() == ($('#FirstName').val() + ' ' + $('#LastName').val()));\n }, 'Your signature must match what you entered for your First and Last name.'\n );\n\n $(\"#CreateAccountForm\").validate({\n rules: {\n FirstName: {\n required: true,\n minlength: 2,\n maxlength: 50\n },\n LastName: {\n required: true,\n minlength: 2,\n maxlength: 50\n },\n Email: {\n required: true,\n email: true,\n remote: {\n url: \"/api/UserAccountValidEmail\",\n type: \"post\"\n },\n maxlength: 100\n },\n PrimaryPhone: {\n required: true,\n phoneUS: true,\n notFakePhone: true\n },\n PrimaryPhoneType: {\n mobileTypeRequiredIfOptIn: true\n },\n Password: {\n required: true,\n passwordMeetsRequirements: true\n },\n ConfirmPassword: {\n required: true,\n equalTo: \"#Password\"\n },\n AgreeToTerms: {\n required: true,\n reCaptcha: true\n },\n WaiverSignature: {\n required: true,\n waiverSignatureMatch: true,\n },\n WaiverParentName: {\n required: {\n depends: function () {\n return ($('#Over18Certification').is(':checked') == false);\n }\n }\n },\n WaiverParentRelationship: {\n required: {\n depends: function () {\n return ($('#Over18Certification').is(':checked') == false);\n }\n }\n },\n WaiverParentEmail: {\n required: {\n depends: function () {\n return ($('#Over18Certification').is(':checked') == false);\n }\n },\n email: true,\n remote: {\n url: \"/api/UserAccountValidEmail\",\n type: \"post\"\n }\n },\n WaiverParentPhone: {\n required: {\n depends: function () {\n return ($('#Over18Certification').is(':checked') == false);\n }\n },\n phoneUS: true\n },\n WaiverParentSignature: {\n required: {\n depends: function () {\n return ($('#Over18Certification').is(':checked') == false);\n }\n },\n trimEqualTo: '#WaiverParentName'\n }\n },\n messages: {\n FirstName: {\n required: \"First Name is required.\",\n minlength: \"First Name must be at least {0} characters.\",\n maxlength: \"First Name must be less than {0} characters.\"\n },\n LastName: {\n required: \"Last Name is required.\",\n minlength: \"Last Name must be at least {0} characters.\",\n maxlength: \"Last Name must be less than {0} characters.\"\n },\n Email: {\n required: \"Email is required.\",\n email: \"Email is invalid\",\n maxlength: \"Email must be less than {0} characters.\"\n },\n PrimaryPhone: {\n required: \"Phone is required.\",\n phoneUS: 'Phone is invalid.',\n notFakePhone: 'Phone is invalid.'\n },\n Password: {\n required: \"Password is required.\"\n },\n ConfirmPassword: {\n required: \"Confirm Password is required.\",\n equalTo: \"Passwords must match.\"\n },\n AgreeToTerms: {\n required: 'You must agree to the Terms of Use.',\n reCaptcha: 'You must confirm you are not a robot.'\n },\n WaiverSignature: {\n required: \"You must type your full legal name to sign the waivers.\",\n },\n WaiverParentName: {\n required: \"Parent/Guardian Full Legal Name is required.\",\n },\n WaiverParentRelationship: {\n required: \"Parent/Guardian Relationship is required.\",\n },\n WaiverParentEmail: {\n required: \"Parent/Guardian Email is required.\",\n email: \"Parent/Guardian Email must be a valid email address.\"\n },\n WaiverParentPhone: {\n required: \"Parent/Guardian Phone is required.\",\n phoneUS: \"Parent/Guardian Phone must be a valid phone number.\"\n },\n WaiverParentSignature: {\n required: \"Your Parent/Guardian must type their full legal name to sign the waiver.\",\n trimEqualTo: \"Parent/Guardian signature must match Parent/Guardian Full Legal Name\"\n }\n },\n errorContainer: '#errorMessageBoxCreate',\n errorLabelContainer: '#errorListCreate',\n errorElement: \"li\",\n onkeyup: false\n });\n}\n"]}