{"id":459,"date":"2025-09-26T14:21:23","date_gmt":"2025-09-26T14:21:23","guid":{"rendered":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/?page_id=459"},"modified":"2025-09-26T14:21:23","modified_gmt":"2025-09-26T14:21:23","slug":"register","status":"publish","type":"page","link":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/register\/","title":{"rendered":"Register"},"content":{"rendered":"<div class=\"buddyUpPjaxContainer\" data-buddyup-pjax-container=\"1\"><style>#accountEditPagesWrapper {\n    position: relative;\n    max-width: 600px;\n    margin: 0 auto;\n}\n\n#buddyUpEditProfileForm {\n    padding: 10px;\n}\n\n#buddyUpEditProfileForm .buddyUpPage {\n    min-height: 365px;\n}\n\nh2 {\n    font-weight: bold;\n}\n\n.buddyUp form,\n.buddyUp form input[type=\"submit\"] {\n    margin-bottom: 0;\n}\n\n.backButton {\n    border: none !important;\n    margin: 0;\n    transform: translateX(-10px);\n}\n\n\/* Page steps *\/\n#pageSteps {\n    --steps-width: 500px;\n    --steps-count: 3;\n    display: flex;\n    justify-content: space-between;\n    width: var(--steps-width);\n    margin: 0 auto 4rem;\n    user-select: none;\n    font-size: .95rem;\n}\n\n#pageSteps > div {\n    position: relative;\n}\n\n#pageSteps > div > span.stepNumber {\n    display: inline-block;\n    margin-left: -1px;\n    \n    line-height: 0;\n    height: 27px;\n    width: 27px;\n    border-radius: 500px;\n    background: #f1f1f1;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    position: relative;\n    z-index: 3;\n}\n\n#pageSteps .stepName {\n    position: absolute;\n    top: calc(100% + 5px);\n    text-wrap: nowrap;\n    left: 50%;\n    transform: translateX(-50%);\n    opacity: .5;\n}\n\n#pageSteps > div.activePageStep .stepName {\n    opacity: 1;\n    transition: opacity .1s .45s;\n}\n\n#pageSteps > div:not(:first-of-type):before,\n#pageSteps > div:not(:first-of-type):after {\n    content: '';\n    width: calc(var(--steps-width) \/ var(--steps-count));\n    height: 5px;\n    position: absolute;\n    top: 50%;\n    transform: translateY(-50%);\n}\n\n#pageSteps > div:not(:first-of-type):after {\n    right: 95%;\n    width: calc(var(--steps-width) \/ var(--steps-count));\n    background: #f1f1f1;\n}\n\n#pageSteps > div:not(:first-of-type):before {\n    --offset: calc(var(--steps-width) \/ var(--steps-count));\n    left: calc(var(--offset) * -1);\n    background: var(--primary-color);\n    width: 0;\n    z-index: 1;\n    transition: width .4s;\n}\n\n#pageSteps > .activePageStep > span.stepNumber {\n    background: var(--primary-color);\n    color: white;\n    font-weight: bold;\n    transition: background .01s .45s, color .01s .45s, font-weight .01s .45s;\n}\n\n#pageSteps > div.activePageStep:before {\n    width: calc(var(--steps-width) \/ var(--steps-count));\n    transition: width .5s;\n}\n\n@media (max-width: 600px){\n    #pageSteps {\n        --steps-width: 400px;\n    }\n}\n\n@media (max-width: 500px){\n    #pageSteps {\n        --steps-width: 300px;\n    }\n\n    #pageSteps .stepName {\n        display: none;\n    }\n}\n\n@media (max-width: 330px){\n    #pageSteps {\n        --steps-width: 250px;\n    }\n}\n\n\/* Page 1 - Welcome *\/\n.buddyUpRegisterStartingMessageHeading {\n    font-size: 4rem;\n    line-height: 4.2rem;\n    font-weight: bold;\n    margin-bottom: .8rem;\n}\n\n.buddyUpRegisterStartingMessage {\n    font-size: 1.3rem;\n}\n\n.loginLink {\n    font-weight: bold;\n    color: var(--primary-color);\n}\n\n#registerAgeYears {\n    background: #f6f7f9;\n    color: #596273;\n}\n\n.buddyUpAgeFallbackHint {\n    margin: .45rem 0 0;\n    font-size: .82rem;\n    line-height: 1.35;\n    color: #596273;\n}\n\n\n\/* Page 3 - Profile Setup *\/\n.buddyUpProfileInputWrapper {\n    margin-bottom: 1.5rem;\n}\n\n.buddyUp .buddyUpProfileInputWrapper #label-profileImage {\n    height: 250px;\n    width: 264px;\n}\n\n.buddyUpStockProfileGallery {\n    display: grid;\n    grid-template-columns: repeat(4, minmax(0, 1fr));\n    gap: .55rem;\n    margin-top: .8rem;\n}\n\n.buddyUpStockProfileHeader {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: .8rem;\n    margin-top: .65rem;\n}\n\n.buddyUpStockProfileTitle {\n    font-weight: 700;\n    font-size: .92rem;\n}\n\n.buddyUpStockProfileStatus {\n    margin-top: .5rem;\n    font-size: .86rem;\n    color: #3d3d3d;\n}\n\n.buddyUpStockProfileStatus.isError {\n    color: #8b2b2b;\n}\n\n.buddyUpStockProfileInlinePicker {\n    margin-top: .7rem;\n    display: grid;\n    gap: .45rem;\n    justify-items: start;\n}\n\n.buddyUpStockProfileGallery[data-empty=\"1\"] {\n    min-height: 85px;\n}\n\n.buddyUpStockProfileChoice {\n    appearance: none;\n    border: 2px solid rgba(0, 0, 0, .08);\n    background: #fff;\n    border-radius: 10px;\n    padding: .2rem;\n    margin: 0;\n    cursor: pointer;\n    transition: border-color .12s ease, transform .12s ease;\n}\n\n.buddyUpStockProfileChoice:hover {\n    border-color: var(--primary-color);\n    transform: translateY(-1px);\n}\n\n.buddyUpStockProfileChoice.isSelected {\n    border-color: var(--primary-color);\n    box-shadow: 0 0 0 2px rgba(66, 185, 131, .2);\n}\n\n.buddyUpStockProfileChoice img {\n    display: block;\n    width: 100%;\n    aspect-ratio: 1 \/ 1;\n    object-fit: cover;\n    border-radius: 8px;\n}\n\n.buddyUpStockProfileChoice span {\n    display: block;\n    font-size: .7rem;\n    font-weight: 600;\n    line-height: 1.2;\n    padding: .25rem .1rem .15rem;\n}\n\n.buddyUp .buddyUpProfileInputWrapper #label-profileImage.buddyUpBackgroundUploaded {\n    align-items: end;\n}\n\n#label-profileImage.buddyUpUploadLocked {\n    opacity: .7;\n}\n\n#label-profileImage.buddyUpUploadLocked .buddyUpFileUploadButton,\n#label-profileImage.buddyUpUploadLocked .buddyUpFileUploadCropButton {\n    opacity: .5;\n    pointer-events: none;\n}\n\n#label-profileImage.buddyUpUploadLocked .buddyUpFileUploadButtonsWrapper,\n#label-profileImage.buddyUpUploadLocked .buddyUpFileUploadText {\n    display: none;\n}\n\n.buddyUp label#label-profileImage.buddyUpFileUpload.buddyUpBackgroundUploaded::after {\n    display: none;\n}\n\n.privacyInputWrapper {\n    background: var(--buddyup-background);\n    padding: .8rem 1rem;\n    border-radius: var(--border-radius);\n    padding: 15px 20px;\n}\n\n.buddyUp textarea {\n    margin-bottom: 1rem;\n}\n\n.requiredMessage {\n    font-weight: normal;\n    color: red;\n    font-size: .9rem;\n}\n\n@media (max-width: 500px) {\n    .flexCollapseXS {\n        gap: 0;\n    }\n\n    .buddyUpStockProfileGallery {\n        grid-template-columns: repeat(3, minmax(0, 1fr));\n    }\n}\n\n\/* Email Verify Message - Post Register *\/\n#buddyUpVerifyEmailWrapper {\n    background: var(--buddyup-background);\n    text-align: center;\n    padding: 2rem;\n}\n\n#buddyUpVerifyEmailWrapper i.fa-envelope-open-text {\n    font-size: 4rem;\n    color: var(--primary-color);\n    margin: .5rem 0 .2rem;\n}\n\n#buddyUpVerifyEmailWrapper h1 {\n    font-weight: bold;\n    font-size: 2rem;\n    margin-bottom:1rem;\n}\n\n#buddyUpVerifyEmailWrapper button {\n    margin: .5rem 0;\n}\n\n#buddyUpVerifyEmailWrapper button[disabled=\"disabled\"] {\n    border: 2px solid #c4c4c4 !important;\n    background: #c4c4c4 !important;\n    color: #2E2E2E !important;\n}\n\n#buddyUpVerifyEmailWrapper #buddyUpEmailResendCountdown {\n    font-size: .9rem;\n    font-style: italic;\n}<\/style><section id=\"accountEditPagesWrapper\" class=\"buddyUp hidden\">\n    <div id=\"pageSteps\">\n        <div data-step-page=\"1\" class=\"activePageStep\"><span class=\"stepNumber\">1<\/span><span class=\"stepName\">Welcome<\/span><\/div><div data-step-page=\"2\" ><span class=\"stepNumber\">2<\/span><span class=\"stepName\">Account<\/span><\/div><div data-step-page=\"3\" ><span class=\"stepNumber\">3<\/span><span class=\"stepName\">Profile<\/span><\/div>    <\/div>\n    \n    <form id=\"buddyUpEditProfileForm\" disabled=\"disabled\" class=\"buddyUpPagesWrapper\">\n                <div id=\"buddyUpRegisterPage1\" class=\"buddyUpPage\" data-page=\"1\">\n            <p class=\"buddyUpRegisterStartingMessageHeading\">Welcome to BuddyUpGo<\/p>\n            <p class=\"buddyUpRegisterStartingMessage\">Create your free account in a minute.<\/p>\n             \n            <div class=\"buddyUpInputWrapper buddyUpAgeCheckWrapper\">\n                <label for=\"registerDob\">Must be 18 and over to register.<br\/><span style=\"font-weight: normal;\">Enter your date of birth to continue.<\/span><\/label>\n                <input type=\"date\" id=\"registerDob\" name=\"registerDob\" min=\"1916-04-19\" max=\"2008-04-19\" style=\"margin-bottom: 0;\" required \/>\n            <\/div>\n\n            <div class=\"buddyUpInputWrapper\">\n                <label for=\"registerAgeYears\">Age (auto-calculated)<\/label>\n                <input type=\"number\" id=\"registerAgeYears\" name=\"registerAgeYears\" inputmode=\"numeric\" min=\"18\" max=\"110\" step=\"1\" placeholder=\"If the birthdate picker does not work, enter your age\" \/>\n                <p class=\"buddyUpAgeFallbackHint\">If your device does not update the field above after choosing a birthdate, type your age manually to continue.<\/p>\n                <div class=\"buddyUpCheckboxWrapper\" style=\"margin-top: 1.2rem;\">\n                    <input tabindex=\"0\" type=\"checkbox\" id=\"agreementCheck\" required \/>\n                    <label id=\"label-agreementCheck\" for=\"agreementCheck\">I agree to the <a href=\"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/mobile-application-and-website-end-user-license-agreement\/\" target=\"_blank\" style=\"text-decoration: underline;\">User Agreement<\/a><\/label>\n                <\/div>\n            <\/div>\n\n            <input type=\"button\" value=\"Let's Start!\" role=\"button\" aria-label=\"Let's Start\" tabindex=\"0\" data-next-page=\"buddyUpRegisterPage2\" disabled=\"disabled\" class=\"buddyUpButton1 buddyUpGoToNextPage\">\n            <br\/>\n            <p>Already have an account? <a aria-label=\"Create an account\" tabindex=\"0\" href=\"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/login\/\" class=\"loginLink\">Go to login<\/a><\/p>\n        <\/div>\n\n                <div id=\"buddyUpRegisterPage2\" class=\"buddyUpPage hidden\" data-page=\"2\">\n            <button type=\"button\" aria-label=\"Back\" tabindex=\"0\" data-next-page=\"buddyUpRegisterPage1\" class=\"buddyUpButton3 backButton buddyUpGoToNextPage buddyUpGoBack\"><i class=\"fa fa-solid fa-arrow-left\"><\/i>  Back<\/button>\n\n            <h2>Set up your free account<\/h2>\n\n            <div class=\"buddyUpInputWrapper\">\n                <label id=\"label-username\" for=\"username\">Username <span class=\"requiredMessage\">*<\/span><\/label>\n                <input tabindex=\"0\" type=\"text\" id=\"username\" placeholder=\"Choose a username\" required \/>\n            <\/div>\n\n            <div class=\"buddyUpInputWrapper\">\n                <label id=\"label-emailAddress\" for=\"emailAddress\">Email <span class=\"requiredMessage\">*<\/span><\/label>\n                <input tabindex=\"0\" type=\"email\" id=\"emailAddress\" placeholder=\"Enter your email address\" required \/>\n            <\/div>\n\n            <div class=\"buddyUpInputWrapper\">\n                <label id=\"label-locationZip\" for=\"locationZip\">Zip Code <span class=\"requiredMessage\">*<\/span><\/label>\n                <input tabindex=\"0\" type=\"text\" id=\"locationZip\" placeholder=\"Enter your zip code\" required \/>\n            <\/div>\n\n            <div class=\"flexWrapper flexCollapseXS\">\n                <div class=\"buddyUpInputWrapper\">\n                    <label id=\"label-password\" for=\"password\">Create a password <span class=\"requiredMessage\">*<\/span><\/label>\n                    <input tabindex=\"0\" type=\"password\" id=\"password\" placeholder=\"Create a password\" autocomplete=\"new-password\" required \/>\n                <\/div>\n                <div class=\"buddyUpInputWrapper\">\n                    <label id=\"label-passwordConfirm\" for=\"passwordConfirm\" >Confirm password <span class=\"requiredMessage\">*<\/span><\/label>\n                    <input tabindex=\"0\" type=\"password\" id=\"passwordConfirm\" placeholder=\"Confirm your password\" autocomplete=\"new-password\" required \/>\n                <\/div>\n            <\/div>\n            \n            <input type=\"button\" value=\"Continue\" role=\"button\" aria-label=\"Continue\" tabindex=\"0\" data-next-page=\"buddyUpRegisterPage3\" class=\"buddyUpButton1 buddyUpGoToNextPage\">\n        <\/div>\n        \n\n                <div id=\"buddyUpRegisterPage3\" class=\"buddyUpPage hidden\" data-page=\"3\">\n            <button type=\"button\" aria-label=\"Back\" tabindex=\"0\" data-next-page=\"buddyUpRegisterPage2\" class=\"buddyUpButton3 backButton buddyUpGoToNextPage buddyUpGoBack\"><i class=\"fa fa-solid fa-arrow-left\"><\/i>  Back<\/button>\n            \n            <h2>Set up your profile<\/h2>\n\n            <div class=\"buddyUpInputWrapper buddyUpProfileInputWrapper\">\n                <div class=\"inputLabel\">Profile Image <span class=\"requiredMessage\">*<\/span><\/div>\n                <p><i>Free accounts choose from BuddyUp stock profile photos. Custom uploads unlock on paid tiers.<\/i><\/p>\n                <div id=\"buddyUpRegisterProfileUploadLockedMessage\" class=\"buddyUpStockProfileStatus\">Custom profile upload is locked on free registration.<\/div>\n                <div id=\"buddyUpProfileUploadInputWrapper\"><\/div>\n\n                <div class=\"buddyUpStockProfileInlinePicker\">\n                    <button type=\"button\" class=\"buddyUpButton3\" id=\"buddyUpRegisterStockProfileOpenModal\">Browse Outdoor Stock Library<\/button>\n                    <div id=\"buddyUpRegisterStockProfileStatus\" class=\"buddyUpStockProfileStatus\" aria-live=\"polite\">Choose from curated outdoor profile photos.<\/div>\n                <\/div>\n            <\/div>\n\n            <div class=\"buddyUpInputWrapper\">\n                <label id=\"label-aboutMe\" for=\"aboutMe\">About Me <span class=\"requiredMessage\">*<\/span><\/label>\n                <textarea id=\"aboutMe\" placeholder=\"What are you looking to do on BuddyUpGo?\" required><\/textarea>\n            <\/div>\n\n            <div class=\"buddyUpInputWrapper buddyInterestsInputWrapper\">\n                <label id=\"label-buddyInterests\" for=\"buddyInterests\">Interests <span class=\"requiredMessage\">*<\/span><\/label>\n                <div id=\"buddyUpInterestInputWrapper\"><\/div>\n            <\/div>\n            \n            <div id=\"formIncorrectInfo\" class=\"buddyUpErrorMessage hidden\">There was an error registering your account. Please try again.<\/div>\n\n            <div class=\"submitButtonWrapper\">\n                <input type=\"submit\" disabled=\"disabled\" value=\"Create free account\" role=\"button\" id=\"createBuddyUpAccount\" aria-label=\"Create free account\" tabindex=\"0\" class=\"buddyUpButton1\">\n            <\/div>\n        <\/div>\n    <\/form>\n<\/section><script>\/***\n * Redirect if already logged in\n *\/\nfunction buddyUpRegisterRedirectTarget() {\n    if (buddyUpVariables && buddyUpVariables.for_me_link) return buddyUpVariables.for_me_link;\n    if (buddyUpVariables && buddyUpVariables.home_link) return buddyUpVariables.home_link;\n    if (buddyUpVariables && buddyUpVariables.account_link) return buddyUpVariables.account_link;\n    return '\/';\n}\n\nif (BUDDYUP.isLoggedIn()) {\n    BUDDYUP.pjaxNavigate(buddyUpRegisterRedirectTarget());\n} else {\n    document.getElementById('accountEditPagesWrapper').classList.remove('hidden');\n}\n\n\n\/***\n * Remove the Sign Up button in the nav\n *\/\ndocument.querySelectorAll('.register-account-nav, .login-account-nav').forEach(el => {\n    el.parentNode.removeChild(el);\n});\n\n\n\/***\n * Interest Input Functionality\n *\/\nconst buddyInterestsInputWrapper = document.getElementById('buddyUpInterestInputWrapper');\nBUDDYUP.interestsInputSetup(buddyInterestsInputWrapper);\n\n\n\/***\n * Setup File Input + Stock Profile Picker\n *\/\nconst imageInputWrapper = document.getElementById('buddyUpProfileUploadInputWrapper');\nif (imageInputWrapper){\n    BUDDYUP.fileInputSetup('buddyUpProfileUploadInputWrapper', 'profileImage', { label: 'Update profile image' });\n}\n\nconst registerProfileImageLabel = document.getElementById('label-profileImage');\nif (registerProfileImageLabel) {\n    registerProfileImageLabel.classList.add('buddyUpUploadLocked');\n\n    const lockedInput = registerProfileImageLabel.querySelector('.buddyUpFileUploadInput');\n    const lockedFileButton = registerProfileImageLabel.querySelector('.buddyUpFileUploadButton');\n    const lockedCropButton = registerProfileImageLabel.querySelector('.buddyUpFileUploadCropButton');\n\n    if (lockedInput) lockedInput.setAttribute('disabled', 'disabled');\n    if (lockedFileButton) lockedFileButton.setAttribute('disabled', 'disabled');\n    if (lockedCropButton) lockedCropButton.setAttribute('disabled', 'disabled');\n}\n\nconst registerStockOpenButton = document.getElementById('buddyUpRegisterStockProfileOpenModal');\nconst registerStockStatusEl = document.getElementById('buddyUpRegisterStockProfileStatus');\n\nfunction buddyUpSetStockStatus(message, isError) {\n    if (!registerStockStatusEl) return;\n    registerStockStatusEl.textContent = message;\n    registerStockStatusEl.classList.toggle('isError', !!isError);\n}\n\nfunction buddyUpApplyStockSelection(imageUrl, imageLabel) {\n    const profileImageLabel = document.getElementById('label-profileImage');\n    if (!imageUrl || !profileImageLabel) return;\n\n    profileImageLabel.classList.add('buddyUpBackgroundUploaded');\n    profileImageLabel.style.backgroundImage = `url('${imageUrl}')`;\n    profileImageLabel.buddyup_image_data = imageUrl;\n\n    const fileButton = profileImageLabel.querySelector('.buddyUpFileUploadButton');\n    if (fileButton){\n        fileButton.innerHTML = 'Stock photo selected';\n    }\n\n    const chosenLabel = String(imageLabel || '').trim();\n    BUDDYUP.updateFileUploadPreviewAccessibility(\n        profileImageLabel,\n        chosenLabel !== ''\n            ? `Profile image selected: ${chosenLabel}`\n            : 'Profile image selected from stock library'\n    );\n    buddyUpSetStockStatus(chosenLabel !== ''\n        ? `Selected: ${chosenLabel}`\n        : 'Stock profile photo selected.', false);\n\n    checkPageValidation('buddyUpRegisterPage3');\n    validateAllPages();\n}\n\nif (registerStockOpenButton) {\n    registerStockOpenButton.addEventListener('click', async (e) => {\n        e.preventDefault();\n\n        const currentImage = registerProfileImageLabel\n            ? String(registerProfileImageLabel.buddyup_image_data || '')\n            : '';\n\n        const selected = await BUDDYUP.openStockProfileModal({\n            heading: 'Choose Your Profile Photo',\n            currentImage: currentImage,\n            initialQuery: 'outdoor landscape fishing gear',\n        });\n\n        if (selected && selected.url) {\n            buddyUpApplyStockSelection(selected.url, selected.label || 'Outdoor profile photo');\n        }\n    });\n}\n\nbuddyUpSetStockStatus('No custom upload on free signup. Open the stock library to choose your profile photo.', false);\n\n\n\/***\n * Page Validation\n *\/\nfunction buddyUpGetAgeFromDate(dateValue) {\n    if (!(dateValue instanceof Date) || isNaN(dateValue.getTime())) {\n        return NaN;\n    }\n\n    const today = new Date();\n    var age = today.getFullYear() - dateValue.getFullYear();\n    var m = today.getMonth() - dateValue.getMonth();\n    if (m < 0 || (m === 0 && today.getDate() < dateValue.getDate())) {\n        age--;\n    }\n    return age;\n}\n\nfunction shouldDebugRegisterStepOne() {\n    try {\n        if (window.BUDDYUP && BUDDYUP.debug) return true;\n    } catch (e) {}\n    try {\n        if (window.location.search.includes('bu_debug=1')) return true;\n    } catch (e) {}\n    try {\n        return localStorage.getItem('bu_debug') === '1';\n    } catch (e) {\n        return false;\n    }\n}\n\nfunction debugRegisterStepOne(payload) {\n    if (!shouldDebugRegisterStepOne()) return;\n    try {\n        console.log('[BuddyUp Register Step 1]', payload);\n    } catch (e) {}\n}\n\nfunction getRegisterDobDateValue() {\n    const dobInput = document.getElementById('registerDob');\n    if (!dobInput) return null;\n\n    if (dobInput.valueAsDate instanceof Date && !isNaN(dobInput.valueAsDate.getTime())) {\n        return dobInput.valueAsDate;\n    }\n\n    const rawValue = String(dobInput.value || '').trim();\n    if (rawValue === '') return null;\n\n    const normalizedMatch = rawValue.match(\/^(\\d{4})-(\\d{2})-(\\d{2})$\/);\n    if (normalizedMatch) {\n        const year = Number(normalizedMatch[1]);\n        const month = Number(normalizedMatch[2]);\n        const day = Number(normalizedMatch[3]);\n        const parsed = new Date(year, month - 1, day);\n        if (\n            !isNaN(parsed.getTime()) &&\n            parsed.getFullYear() === year &&\n            parsed.getMonth() === month - 1 &&\n            parsed.getDate() === day\n        ) {\n            return parsed;\n        }\n    }\n\n    const fallback = new Date(rawValue);\n    if (!isNaN(fallback.getTime())) {\n        return fallback;\n    }\n\n    return null;\n}\n\nfunction buddyUpGetAge(dateString) {\n    if (!dateString || typeof dateString !== 'string') {\n        return NaN;\n    }\n\n    const normalized = dateString.trim();\n    const normalizedMatch = normalized.match(\/^(\\d{4})-(\\d{2})-(\\d{2})$\/);\n    if (normalizedMatch) {\n        const year = Number(normalizedMatch[1]);\n        const month = Number(normalizedMatch[2]);\n        const day = Number(normalizedMatch[3]);\n        const parsed = new Date(year, month - 1, day);\n        return buddyUpGetAgeFromDate(parsed);\n    }\n\n    return buddyUpGetAgeFromDate(new Date(normalized));\n}\n\nfunction getManualRegisterAge() {\n    const ageInput = document.getElementById('registerAgeYears');\n    if (!ageInput) return NaN;\n\n    const raw = String(ageInput.value || '').trim();\n    if (raw === '') return NaN;\n\n    const parsed = Number(raw);\n    if (!Number.isFinite(parsed)) return NaN;\n    return Math.floor(parsed);\n}\n\nfunction syncRegisterAgeFromDob() {\n    const ageInput = document.getElementById('registerAgeYears');\n    if (!ageInput) return NaN;\n\n    const dobDate = getRegisterDobDateValue();\n    const ageYears = buddyUpGetAgeFromDate(dobDate);\n    if (Number.isFinite(ageYears) && ageYears > 0) {\n        ageInput.value = String(ageYears);\n        ageInput.setAttribute('data-age-source', 'dob');\n    } else if (ageInput.getAttribute('data-age-source') === 'dob') {\n        ageInput.value = '';\n        ageInput.removeAttribute('data-age-source');\n    }\n    return ageYears;\n}\n\nfunction syncRegisterPageOneState() {\n    const derivedAge = syncRegisterAgeFromDob();\n    const manualAge = getManualRegisterAge();\n    const dobInput = document.getElementById('registerDob');\n    const agreementInput = document.getElementById('agreementCheck');\n    const agreementChecked = !!agreementInput && agreementInput.checked;\n    const page = document.querySelector('#buddyUpRegisterPage1');\n    const nextButton = page ? page.querySelector('.buddyUpGoToNextPage:not(.backButton)') : null;\n    const ageIsValid =\n        (Number.isFinite(derivedAge) && derivedAge >= 18) ||\n        (Number.isFinite(manualAge) && manualAge >= 18);\n    const pageIsValid = ageIsValid && agreementChecked;\n\n    if (nextButton) {\n        if (pageIsValid) nextButton.removeAttribute('disabled');\n        else nextButton.setAttribute('disabled', 'disabled');\n    }\n\n    debugRegisterStepOne({\n        dob_value: dobInput ? String(dobInput.value || '') : '',\n        dob_value_as_date: dobInput && dobInput.valueAsDate instanceof Date && !isNaN(dobInput.valueAsDate.getTime())\n            ? dobInput.valueAsDate.toISOString()\n            : null,\n        derived_age: Number.isFinite(derivedAge) ? derivedAge : null,\n        manual_age: Number.isFinite(manualAge) ? manualAge : null,\n        agreement_checked: agreementChecked,\n        page_is_valid: pageIsValid,\n        next_button_disabled: nextButton ? nextButton.hasAttribute('disabled') : null,\n    });\n\n    return pageIsValid;\n}\n\nfunction checkPageValidation(pageID){\n    const page = document.querySelector(`#${pageID}`);\n    if (page){\n        if (pageID === 'buddyUpRegisterPage1') {\n            return syncRegisterPageOneState();\n        }\n\n        let pageIsValid = true;\n        const pageInputs = page.querySelectorAll('input, textarea, select');\n        pageInputs.forEach(input => {\n            if (input.getAttribute('id') === 'registerDob'){ \/\/ Check for user age using DoB\n                const ageYears = syncRegisterAgeFromDob();\n                pageIsValid = Number.isFinite(ageYears) && ageYears >= 18 ? true : false;\n            } else if (input.getAttribute('id') === 'buddyInterests'){\n                pageIsValid = !document.querySelector('.buddyInterestsList .singlePill') ? false : pageIsValid;\n            } else if (input.getAttribute('required') !== null){\n                if (input.getAttribute('type') === 'checkbox'){\n                    pageIsValid = input.checked === false ? false : pageIsValid;\n                } else {\n                    pageIsValid = input.value === '' ? false : pageIsValid;\n                }\n            }\n        });\n\n        if (pageID === 'buddyUpRegisterPage3') {\n            const profileImageLabel = document.getElementById('label-profileImage');\n            const hasProfileImage = !!(profileImageLabel && profileImageLabel.buddyup_image_data);\n            if (!hasProfileImage) pageIsValid = false;\n        }\n        \n        const nextButton = page.querySelector('.buddyUpGoToNextPage:not(.backButton)');\n        if (nextButton){\n            if (pageIsValid === false){\n                nextButton.setAttribute('disabled', 'disabled');\n            } else {\n                nextButton.removeAttribute('disabled');\n            }\n        }\n\n        return pageIsValid;\n    }\n}\n\nBUDDYUP.setGlobalHandler('register.keydown', document, 'keydown', e => {\n    const interestWrapper = e.target.closest('.buddyInterestsInputWrapper'); \/\/ Don't prevent default for interests input. It has its own event listeners\n    if (!interestWrapper && e.key === 'Enter'){\n        e.preventDefault();\n        if (document.querySelector('.buddyUpPage:not(.hidden) .buddyUpGoToNextPage:not(.backButton)').length > 0){\n            document.querySelector('.buddyUpPage:not(.hidden) .buddyUpGoToNextPage:not(.backButton)').click();\n        } else if (document.querySelector('.buddyUpPage:not(.hidden) #createBuddyUpAccount').length > 0){\n            document.querySelector('.buddyUpPage:not(.hidden) #createBuddyUpAccount').click();\n        }\n    }\n});\n\nfunction validateAllPages(){\n    const allPages = document.querySelectorAll('.buddyUpPage');\n    let allPagesValid = true;\n\n    allPages.forEach(page => {\n        const isValid = checkPageValidation(page.getAttribute('id'));\n        if (isValid === false){\n            allPagesValid = false;\n        }\n    });\n    \n    if (allPagesValid === true){\n        document.getElementById('createBuddyUpAccount').removeAttribute('disabled');\n    } else {\n        document.getElementById('createBuddyUpAccount').setAttribute('disabled', 'disabled');\n    }\n}\n\nconst nextPageButtons = document.querySelectorAll('.buddyUpGoToNextPage');\nnextPageButtons.forEach(el => {\n    el.addEventListener('click', e => {\n        validateAllPages();\n    });\n});\n\nconst allPages = document.querySelectorAll('.buddyUpPage');\nallPages.forEach(page => {\n    const pageInputs = page.querySelectorAll('input, textarea');\n    \n    pageInputs.forEach(input => {\n        const syncPageValidation = () => {\n            checkPageValidation(page.getAttribute('id'));\n\n            if (page.getAttribute('id') === 'buddyUpRegisterPage3'){\n                validateAllPages();\n            }\n        };\n\n        if (input.type === 'date') {\n            ['input', 'change', 'blur'].forEach((eventName) => {\n                input.addEventListener(eventName, syncPageValidation);\n            });\n        } else {\n            const eventType = input.type === 'checkbox' ? 'change' : 'keyup';\n            input.addEventListener(eventType, syncPageValidation);\n        }\n    });\n    \n});\n\nconst registerDobInput = document.getElementById('registerDob');\nif (registerDobInput) {\n    ['input', 'change', 'blur'].forEach((eventName) => {\n        registerDobInput.addEventListener(eventName, () => {\n            syncRegisterPageOneState();\n        });\n    });\n}\n\nconst registerAgeInput = document.getElementById('registerAgeYears');\nif (registerAgeInput) {\n    ['input', 'change', 'keyup', 'blur'].forEach((eventName) => {\n        registerAgeInput.addEventListener(eventName, () => {\n            if (String(registerAgeInput.value || '').trim() !== '') {\n                registerAgeInput.setAttribute('data-age-source', 'manual');\n            } else if (registerAgeInput.getAttribute('data-age-source') === 'manual') {\n                registerAgeInput.removeAttribute('data-age-source');\n            }\n            syncRegisterPageOneState();\n        });\n    });\n}\n\nconst registerAgreementInput = document.getElementById('agreementCheck');\nif (registerAgreementInput) {\n    ['input', 'change', 'click'].forEach((eventName) => {\n        registerAgreementInput.addEventListener(eventName, () => {\n            syncRegisterPageOneState();\n        });\n    });\n}\n\nsyncRegisterAgeFromDob();\nsyncRegisterPageOneState();\n\n\/\/ Observer to check if interests exist to active Continue button\nconst interestChecker = document.querySelector('.buddyInterestsList');\nif (interestChecker){\n    const config = { childList: true, subtree: true };\n    const callback = (mutationList, observer) => {\n        mutationList.map(mutation => {\n            if (mutation.type === 'childList'){ checkPageValidation(interestChecker.closest('.buddyUpPage').getAttribute('id')); }\n        });\n    }\n    const observer = new MutationObserver(callback);\n    observer.observe(interestChecker, config);\n};\n\n\n\/***\n * Register Form Submit\n *\/\nvar registerForm = document.getElementById('buddyUpEditProfileForm');\nregisterForm.addEventListener('submit', e => {\n    e.preventDefault();\n    \n    if (document.getElementById('password').value === document.getElementById('passwordConfirm').value){\n        document.getElementById('formIncorrectInfo').classList.add('hidden');\n\n        let errMessage = 'There was an error registering your account. Please try again.';\n        document.getElementById('formIncorrectInfo').innerHTML = errMessage;\n\n        document.getElementById('createBuddyUpAccount').setAttribute('disabled', 'disabled');\n        buddyUpRegisterUser();\n    } else {\n        let errMessage = 'Make sure the passwords aboves match.';\n        document.getElementById('formIncorrectInfo').innerHTML = errMessage;\n        document.getElementById('formIncorrectInfo').classList.remove('hidden');\n    }\n});\n\nasync function buddyUpRegisterUser(){\n    var userRegisterData = {};\n    userRegisterData.username = document.getElementById('username').value;\n    userRegisterData.email_address = document.getElementById('emailAddress').value;\n    userRegisterData.password = document.getElementById('password').value;\n    userRegisterData.profile_image = document.querySelector('#label-profileImage').buddyup_image_data;\n    userRegisterData.first_name = document.getElementById('username').value;\n    userRegisterData.last_name = '';\n    userRegisterData.about_me = document.getElementById('aboutMe').value;\n    userRegisterData.city = '';\n    userRegisterData.state = '';\n    userRegisterData.postal_code = document.getElementById('locationZip').value;\n    userRegisterData.mobile_phone = '';\n    userRegisterData.privacy = 0;\n\n    const dob = String(document.getElementById('registerDob').value || '').trim();\n    const derivedAge = syncRegisterAgeFromDob();\n    const manualAge = getManualRegisterAge();\n    if (dob !== '' && Number.isFinite(derivedAge)) {\n        userRegisterData.date_of_birth = dob;\n        userRegisterData.dob = dob;\n        userRegisterData.age = derivedAge;\n    } else {\n        userRegisterData.date_of_birth = '';\n        userRegisterData.dob = '';\n        userRegisterData.age = Number.isFinite(manualAge) ? manualAge : '';\n    }\n\n    userRegisterData.interests = [];\n    document.querySelectorAll('.buddyInterestsList .singlePill').forEach((el) => {\n        userRegisterData.interests.push(el.textContent.trim(' '));\n    });\n\n    userRegisterData.interests = userRegisterData.interests.toString();\n    const receivedUserData = await BUDDYUP.apiRequest('register', userRegisterData);\n    if (receivedUserData.status === 'success'){\n        const registerPage = document.getElementById('accountEditPagesWrapper');\n        registerPage.classList.add('buddyUpFadeIn'); \/\/ Fade register page out (fade in needed before fade out)\n        registerPage.classList.add('buddyUpFadeOut');\n        setTimeout(() => {\n            registerPage.innerHTML = ''; \/\/ Clear page\n            \n            const successMessage = `<div id=\"buddyUpVerifyEmailWrapper\">\n                <div><i class=\"fas fa-envelope-open-text\"><\/i><\/div>\n                <h1>Verify your email address<\/h1>\n                <p>We have sent a verification link to your email.<br\/>Click on the link to complete the verification process.<\/p>\n                <p>If you do not see the email, <strong>please check the spam folder.<\/strong><\/p>\n                <button id=\"buddyUpResendEmail\" class=\"buddyUpButton1\" disabled=\"disabled\">Resend Email<\/button>\n                <div id=\"buddyUpEmailResendError\" class=\"buddyUpErrorMessage hidden\">An error occurred. Please try again.<\/div>\n                <div id=\"buddyUpEmailResendCountdown\"><\/div>\n            <\/div>`;\n    \n            registerPage.insertAdjacentHTML('beforeEnd', successMessage); \/\/ Add success message\n            registerPage.classList.remove('buddyUpFadeOut'); \/\/ Fade success message in\n\n            buddyUpResendEmailTimer(); \/\/ Start timer before allowing resend email submit\n\n            \/\/ Resend Email Submit\n            document.getElementById('buddyUpResendEmail').addEventListener('click', () => { \n                buddyUpResendEmailVerify(userRegisterData.email_address);\n            });\n        }, 500);\n    } else {\n        let errMessage = 'There was an error registering your account. Please try again.';\n        if (receivedUserData.message && receivedUserData.message !== ''){\n            errMessage = receivedUserData.message;\n        }\n        document.getElementById('formIncorrectInfo').innerHTML = errMessage;\n        document.getElementById('formIncorrectInfo').classList.remove('hidden');\n        document.getElementById('createBuddyUpAccount').removeAttribute('disabled');\n    }\n    \n    return;\n}\n\n\nfunction buddyUpResendEmailTimer(){\n    document.getElementById('buddyUpResendEmail').setAttribute('disabled', 'disabled'); \/\/ Disabled the resend email button\n    document.getElementById('buddyUpEmailResendCountdown').innerHTML = `(Please wait 30 seconds to resend the email)`; \/\/ Show starting 30 second message\n    \n    let counter = 29; \/\/ Update the message for 29 more seconds\n    let resendEmailTimer = setInterval(() => { \/\/ Set interval will trigger every 1 second\n        if (counter === 0){ \/\/ If the countdown is done, enable the button and remove the please wait button\n            clearInterval(resendEmailTimer);\n            document.getElementById('buddyUpResendEmail').removeAttribute('disabled');\n            document.getElementById('buddyUpEmailResendCountdown').innerHTML = ``;\n        } else {\n            document.getElementById('buddyUpEmailResendCountdown').innerHTML = `(Please wait ${counter} second${counter > 1 ? 's' : ''} to resend the email)`;\n        }\n        counter -= 1;\n    }, 1000);\n}\n\n\nasync function buddyUpResendEmailVerify(email){\n    document.getElementById('buddyUpResendEmail').setAttribute('disabled', 'disabled');\n    document.getElementById('buddyUpEmailResendError').classList.remove('add');\n    \n    const emailResendResponse = await BUDDYUP.apiRequest('resend-verification-email', {email: email});\n\n    if (emailResendResponse.status === 'success'){\n        BUDDYUP.openModal('<p style=\"max-width: 400px; margin: 0 auto;\">Please check your email including the <strong>spam folder<\/strong> for the verification email.<\/p><button id=\"buddyUpCloseModal\" class=\"buddyUpButton1\" style=\"margin: 0;\">Okay<\/button>', 'A new email has been sent!', 'resendSuccessModal');\n        document.getElementById('buddyUpCloseModal').addEventListener('click', () => { BUDDYUP.closeModal(); });\n        buddyUpResendEmailTimer();\n    } else {\n        document.getElementById('buddyUpEmailResendError').classList.remove('hidden');\n        document.getElementById('buddyUpResendEmail').removeAttribute('disabled');\n    }\n}\n\n\nBUDDYUP.setGlobalHandler('register.pageChange', document, 'buddyUpPageChange', () => {\n    const currentPage = document.querySelector('.buddyUpPage:not(.hidden)').getAttribute('data-page');\n    const allPageSteps = document.querySelectorAll('#pageSteps > div');\n    allPageSteps.forEach(el => {\n        const stepNum = el.getAttribute('data-step-page');\n        if (parseInt(stepNum) <= parseInt(currentPage)){\n            el.classList.add('activePageStep');\n        } else {\n            el.classList.remove('activePageStep');\n        }\n    });\n});<\/script><\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"templates\/full-width-no-header.php","meta":{"footnotes":""},"class_list":["post-459","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/api\/wp\/v2\/pages\/459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/api\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/api\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/api\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/api\/wp\/v2\/comments?post=459"}],"version-history":[{"count":1,"href":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/api\/wp\/v2\/pages\/459\/revisions"}],"predecessor-version":[{"id":460,"href":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/api\/wp\/v2\/pages\/459\/revisions\/460"}],"wp:attachment":[{"href":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/api\/wp\/v2\/media?parent=459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}