{"version":3,"sources":["Pages/Home/VolunteerApplication.js"],"names":["isUnder18","initEvents","$","on","trim","this","val","removeClass","removeAttr","addClass","attr","click","valid","submit","not","change","specialSkillCategoryId","data","childSpeicalSkillCheckboxes","filter","isSelected","is","prop","parents","find","initValidation","validator","addMethod","value","element","optional","test","v","el","minDate","setHours","Date","elem","param","length","eighteenYears","setFullYear","getFullYear","id","options","extendValidationSettings","errorContainer","errorLabelContainer","errorElement","rules","Address1","City","State","ZipCode","required","zipcodeUS","EducationLevel","IsMobilePhonePrimary","primaryPhone","singlePrimaryPhone","MobilePhone","phoneUS","HomePhone","WorkPhone","LegalFirstName","minlength","maxlength","LegalLastName","HasBackgroundConviction","BackgroundConvictionNotes","DateOfBirth","date","maxDateIfChecked","DriversLicenseExpiration","EmergencyContactName","isEmergencyContactRequired","EmergencyContactRelationship","EmergencyContactPhoneNumber","VolunteerGroups","ReleaseSignature","WaiverParentName","depends","WaiverParentRelationship","WaiverParentEmail","email","remote","url","type","WaiverParentPhone","WaiverParentSignature","trimEqualTo","messages","jQuery","format","extended","CanAttendTraining","HasReadJobDescription","referenceCount","i","workHistoryCount","j","extend","validate","initDocumentUpload","fineUploader","request","endpoint","sizeLimit","validation","allowedExtensions","multiple","autoUpload","template","event","name","fileItemContainer","fileDescription","params","volunteerApplicationId","filename","responseJSON","success","append","FileDescription","ShortFileDescription","remove","UserAccountDocumentId","appendTo"],"mappings":"AAAA,IAAIA,WAAY,EAQhB,SAASC,aACLC,EAAE,qBAAqBC,GAAG,SAAS,WAC3BD,EAAEE,KAAKF,EAAEG,MAAMC,SAAWJ,EAAE,cAAcI,MAC1CJ,EAAE,4BAA4BK,YAAY,YAAYC,WAAW,YAGjEN,EAAE,4BAA4BO,SAAS,YAAYC,KAAK,WAAY,eAI5ER,EAAE,4BAA4BS,OAAM,WAC5BT,EAAE,kBAAkBU,SAAWV,EAAEE,KAAKF,EAAE,qBAAqBI,SAAWJ,EAAE,cAAcI,QACxFJ,EAAE,4BAA4BO,S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ACX7G,GAAG,UAAU,SAAU8G,EAAOtE,EAAIuE,GACjC,IAAIC,EAAoBjH,EAAEG,MAAMmG,aAAa,kBAAmB7D,GAC5DyE,EAAkBlH,EAAEiH,GAAmB3F,KAAK,6BAA6BlB,MAEzE+G,EAAS,CACTC,uBAAwBA,uBACxBF,gBAAiBA,GAGrBlH,EAAEG,MAAMmG,aAAa,YAAaa,EAAQ1E,MAC3CxC,GAAG,UAAU,eACbA,GAAG,YAAY,SAAU8G,EAAOtE,EAAI4E,EAAUC,GACzCA,EAAaC,UACbvH,EAAE,2BAA2BwH,OAAO,gCAAkCH,EAAW,mBAAqBC,EAAaG,gBAAkB,KAAOH,EAAaI,qBAAuB,cAEhL1H,EAAE,sCAAsC2H,SAExC3H,EAAE,WAAWQ,KAAK,CACd6E,KAAM,SACN5C,GAAI,sBACJuE,KAAM,sBACNtF,MAAO4F,EAAaM,wBACrBC,SAAS,sBAIpB7H,EAAE,sBAAsBS,OAAM,WAC1BT,EAAE,mBAAmBsG,aAAa,wBAtb1CtG,GAAE,WACED,aACAwB,iBACA8E","file":"VolunteerApplication.min.js","sourcesContent":["var isUnder18 = true;\n\n$(function () {\n initEvents();\n initValidation();\n initDocumentUpload();\n});\n\nfunction initEvents() {\n $('#ReleaseSignature').on('input', function () {\n if ($.trim($(this).val()) === $('#LegalName').val()) {\n $('#submitApplicationButton').removeClass('disabled').removeAttr('disabled');\n }\n else {\n $('#submitApplicationButton').addClass('disabled').attr('disabled', 'disabled');\n }\n });\n\n $('#submitApplicationButton').click(function () {\n if ($('#volunteerForm').valid() && $.trim($('#ReleaseSignature').val()) === $('#LegalName').val()) {\n $('#submitApplicationButton').addClass('disabled').attr('disabled', 'disabled');\n $('#volunteerForm').submit();\n }\n });\n\n $('input:checkbox.primaryPhone').click(function () {\n $('input:checkbox.primaryPhone').not(this).removeAttr(\"checked\");\n });\n\n $('.specialSkillCategoryCheckbox').change(function () {\n var specialSkillCategoryId = $(this).data('specialSkillCategoryId');\n\n var childSpeicalSkillCheckboxes = $('.specialSkillCheckbox').filter('[data-special-skill-category-id=\"' + specialSkillCategoryId + '\"]');\n\n var isSelected = $(this).is(':checked');\n\n childSpeicalSkillCheckboxes.prop('checked', isSelected);\n\n if (isSelected) {\n $(this).parents('.specialSkillCategoryContainer').find('.specialSkillContainer').removeClass('hidden');\n }\n else {\n $(this).parents('.specialSkillCategoryContainer').find('.specialSkillContainer').addClass('hidden');\n }\n });\n\n $('#Over18Certification').on('click', function () {\n if ($(this).is(':checked')) {\n $('#ParentPanel').addClass('hidden');\n } else {\n $('#ParentPanel').removeClass('hidden');\n }\n });\n}\n\nfunction initValidation() {\n $.validator.addMethod(\"zipcodeUS\", function (value, element) {\n return this.optional(element) || /\\d{5}-\\d{4}$|^\\d{5}$/.test(value);\n });\n\n $.validator.addMethod('minDate', function (v, el, minDate) {\n if (this.optional(el)) {\n return true;\n }\n\n return minDate.setHours(0, 0, 0, 0) <= new Date(v).setHours(0, 0, 0, 0);\n }, 'Date must be in the future.');\n\n $.validator.addMethod(\"primaryPhone\", function (value, elem, param) {\n if ($('input:checkbox.primaryPhone:checked').length > 0) {\n return true;\n } else {\n return false;\n }\n }, \"Primary phone is required.\");\n\n $.validator.addMethod(\"singlePrimaryPhone\", function (value, elem, param) {\n if ($('input:checkbox.primaryPhone:checked').length <= 1) {\n return true;\n } else {\n return false;\n }\n }, \"You may only select 1 primary phone number.\");\n\n var eighteenYears = new Date();\n eighteenYears.setFullYear(eighteenYears.getFullYear() - 18);\n\n $.validator.addMethod('maxDateIfChecked', function (v, el, id) {\n if ($(id).is(':checked')) {\n return eighteenYears >= new Date(v);\n }\n else {\n return true;\n }\n }, 'Parent information must be included if signee birthday indicates they are under 18.');\n\n var options = extendValidationSettings({\n errorContainer: '.errorMessageBox',\n errorLabelContainer: '.errorList',\n errorElement: \"li\",\n rules: {\n Address1: \"required\",\n City: \"required\",\n State: \"required\",\n ZipCode: {\n required: true,\n zipcodeUS: true\n },\n EducationLevel: {\n required: true\n },\n IsMobilePhonePrimary: {\n primaryPhone: true,\n singlePrimaryPhone: true\n },\n MobilePhone: {\n required: \"#IsMobilePhonePrimary:checked\",\n phoneUS: true\n },\n HomePhone: {\n required: \"#IsHomePhonePrimary:checked\",\n phoneUS: true\n },\n WorkPhone: {\n required: \"#IsWorkPhonePrimary:checked\",\n phoneUS: true\n },\n LegalFirstName: {\n required: true,\n minlength: 2,\n maxlength: 50\n },\n LegalLastName: {\n required: true,\n minlength: 2,\n maxlength: 50\n },\n HasBackgroundConviction: \"required\",\n BackgroundConvictionNotes: {\n required: function (element) {\n return $(\"[name='HasBackgroundConviction']:checked\").val() === \"true\";\n }\n },\n DateOfBirth: {\n required: '#DateOfBirth:visible',\n date: true,\n maxDateIfChecked: '#Over18Certification'\n },\n DriversLicenseExpiration: {\n required: function () {\n return $(\"#DriversLicenseNumber\").val().length > 0;\n },\n date: true,\n minDate: new Date()\n },\n EmergencyContactName: {\n required: isEmergencyContactRequired\n },\n EmergencyContactRelationship: {\n required: isEmergencyContactRequired\n },\n EmergencyContactPhoneNumber: {\n required: isEmergencyContactRequired,\n phoneUS: true\n },\n VolunteerGroups: {\n required: 'input[name=\"VolunteerGroups\"]:visible'\n },\n ReleaseSignature: {\n required: 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 Address1: \"Address is required.\",\n City: \"City is required.\",\n State: \"State is required.\",\n ZipCode: {\n required: \"Zip is required.\",\n zipcodeUS: \"Zip is invalid.\"\n },\n EducationLevel: \"Education Attainment is required.\",\n LegalFirstName: {\n required: 'Legal First Name is required.',\n minlength: jQuery.validator.format('Legal First Name must be at least {0} characters.'),\n maxlength: jQuery.validator.format('Legal First Name must be less than {0} characters.')\n },\n LegalLastName: {\n required: 'Legal Last Name is required.',\n minlength: jQuery.validator.format('Legal Last Name must be at least {0} characters.'),\n maxlength: jQuery.validator.format('Legal Last Name must be less than {0} characters.')\n },\n HasBackgroundConviction: \"Background Yes/No is required.\",\n BackgroundConvictionNotes: {\n required: \"Conviction notes are required.\"\n },\n IsMobilePhonePrimary: {\n primaryPhone: 'Primary phone is required.',\n singlePrimaryPhone: 'You may only select 1 primary phone number.'\n },\n MobilePhone: {\n required: \"Primary Phone Number is required.\",\n phoneUS: 'Mobile Phone is invalid.'\n },\n HomePhone: {\n required: \"Primary Phone Number is required.\",\n phoneUS: 'Home Phone is invalid.'\n },\n WorkPhone: {\n required: \"Primary Phone Number is required.\",\n phoneUS: 'Work Phone is invalid.'\n },\n DateOfBirth: {\n required: \"Birthday is required.\",\n date: \"Birthday must be a valid date.\"\n },\n DriversLicenseExpiration: {\n required: 'Drivers License Expiration is required.',\n date: 'Drivers License Expiration must be a valid date.',\n minDate: 'Drivers License Expiration must be in the future.'\n },\n EmergencyContactName: {\n required: 'Emergency Contact Name is required.'\n },\n EmergencyContactRelationship: {\n required: 'Emergency Contact Phone is required.'\n },\n EmergencyContactPhoneNumber: {\n required: 'Emergency Contact Phone is required.',\n phoneUS: 'Emergency Contact Phone is invalid.'\n },\n VolunteerGroups: {\n required: 'You must select at least one from Volunteer Groups To Apply For.'\n },\n ReleaseSignature: {\n required: \"You must type your full legal name to sign the waiver.\"\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 });\n\n var extended = {\n rules: {\n CanAttendTraining: \"required\",\n HasReadJobDescription: \"required\"\n },\n messages: {\n CanAttendTraining: \"You must check: 'I can attend scheduled trainings'.\",\n HasReadJobDescription: \"You must check: 'I've read the position description'.\"\n }\n };\n\n var referenceCount = $('#ReferencesCount').val();\n for (var i = 0; i < referenceCount; i++) {\n extended.rules[\"Reference_\" + i + \"_FirstName\"] = \"required\";\n extended.messages[\"Reference_\" + i + \"_FirstName\"] = \"Reference \" + (i + 1) + \" First Name is required.\";\n\n extended.rules[\"Reference_\" + i + \"_LastName\"] = \"required\";\n extended.messages[\"Reference_\" + i + \"_LastName\"] = \"Reference \" + (i + 1) + \" Last Name is required.\";\n\n extended.rules[\"Reference_\" + i + \"_HomePhone\"] = {\n required: true,\n phoneUS: true\n };\n extended.messages[\"Reference_\" + i + \"_HomePhone\"] = {\n required: \"Reference \" + (i + 1) + \" Home/Primary Phone is required.\",\n phoneUS: \"Reference \" + (i + 1) + \" Home/Primary Phone is invalid.\"\n };\n\n extended.rules[\"Reference_\" + i + \"_CellPhone\"] = {\n phoneUS: true\n };\n extended.messages[\"Reference_\" + i + \"_CellPhone\"] = {\n phoneUS: \"Reference \" + (i + 1) + \" Mobile Phone is invalid.\"\n };\n\n extended.rules[\"Reference_\" + i + \"_WorkPhone\"] = {\n phoneUS: true\n };\n extended.messages[\"Reference_\" + i + \"_WorkPhone\"] = {\n phoneUS: \"Reference \" + (i + 1) + \" Work Phone is invalid.\"\n };\n\n extended.rules[\"Reference_\" + i + \"_Relationship\"] = \"required\";\n extended.messages[\"Reference_\" + i + \"_Relationship\"] = \"Reference \" + (i + 1) + \" Relationship is required.\";\n\n extended.rules[\"Reference_\" + i + \"_EmailAddress\"] = \"email\";\n extended.messages[\"Reference_\" + i + \"_EmailAddress\"] = \"Reference \" + (i + 1) + \" Email must be a valid email address.\";\n }\n\n var workHistoryCount = $('#WorkHistoryCount').val();\n for (var j = 0; j < workHistoryCount; j++) {\n extended.rules[\"WorkHistory_\" + j + \"_FirstName\"] = {\n required: \"#WorkHistory_\" + j + \"_EmployerName:filled\"\n };\n extended.messages[\"WorkHistory_\" + j + \"_FirstName\"] = {\n required: \"Work History \" + (j + 1) + \" First Name is required.\"\n };\n\n extended.rules[\"WorkHistory_\" + j + \"_LastName\"] = {\n required: \"#WorkHistory_\" + j + \"_EmployerName:filled\"\n };\n extended.messages[\"WorkHistory_\" + j + \"_LastName\"] = {\n required: \"Work History \" + (j + 1) + \" Last Name is required.\"\n };\n\n extended.rules[\"WorkHistory_\" + j + \"_WorkPhone\"] = {\n required: \"#WorkHistory_\" + j + \"_EmployerName:filled\",\n phoneUS: true\n };\n extended.messages[\"WorkHistory_\" + j + \"_WorkPhone\"] = {\n required: \"Work History \" + (j + 1) + \" Work/Primary Phone is required.\",\n phoneUS: \"Work History \" + (j + 1) + \" Work/Primary Phone is invalid.\"\n };\n\n extended.rules[\"WorkHistory_\" + j + \"_CellPhone\"] = {\n phoneUS: true\n };\n extended.messages[\"WorkHistory_\" + j + \"_CellPhone\"] = {\n phoneUS: \"Work History \" + (j + 1) + \" Mobile Phone is invalid.\"\n };\n\n extended.rules[\"WorkHistory_\" + j + \"_StartDate\"] = {\n date: true\n };\n extended.messages[\"WorkHistory_\" + j + \"_StartDate\"] = {\n date: \"Work History \" + (j + 1) + \" Start Date must be a valid date.\"\n };\n\n extended.rules[\"WorkHistory_\" + j + \"_EndDate\"] = {\n date: true\n };\n extended.messages[\"WorkHistory_\" + j + \"_EndDate\"] = {\n date: \"Work History \" + (j + 1) + \" End Date must be a valid date.\"\n };\n }\n\n options = $.extend(true, {}, options, extended);\n\n $('#volunteerForm').validate(options);\n}\n\nfunction initDocumentUpload() {\n var documentUploader = $('#documentUpload').fineUploader({\n request: {\n endpoint: '/UserAccountVolunteerApplicationDocumentUpload/',\n sizeLimit: 9437184\n },\n validation: {\n allowedExtensions: ['jpg', 'jpeg', 'gif', 'png', 'bmp', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'pdf'],\n sizeLimit: 29989273\n },\n multiple: true,\n autoUpload: false,\n template: 'documentUploadTemplate'\n }).on('upload', function (event, id, name) {\n var fileItemContainer = $(this).fineUploader('getItemByFileId', id);\n var fileDescription = $(fileItemContainer).find('.qq-edit-file-description').val();\n\n var params = {\n volunteerApplicationId: volunteerApplicationId,\n fileDescription: fileDescription,\n };\n\n $(this).fineUploader('setParams', params, id);\n }).on('submit', function () {\n }).on('complete', function (event, id, filename, responseJSON) {\n if (responseJSON.success) {\n $('#uploadedDocumentsTable').append(\"