{"version":3,"file":"js/chunks/modules.js","sources":["webpack:///./org_colony/cartridge/js/modules.js"],"sourcesContent":["const dialog = require('./dialog');\nconst minicart = require('./minicart');\nconst searchsuggest = require('./searchsuggest');\nconst util = require('./util');\nconst ajax = require('./ajax');\n\n/**\n * @function\n * @desc Initializes the textarea character limit functionality\n */\nfunction initCharacterLimit() {\n    const controlKeys = ['8', '9', '13', '46', '45', '36', '35', '38', '37', '40', '39'];\n\n    $('body').on('keydown', 'textarea[data-character-limit], input[data-character-limit]', (e) => {\n        const text = $.trim($(e.currentTarget).val());\n        const charsLimit = $(e.currentTarget).data('character-limit');\n        const charsUsed = text.length;\n\n        if ((charsUsed >= charsLimit) && (controlKeys.indexOf(e.which.toString()) < 0)) {\n            e.preventDefault();\n        }\n    }).on('change keyup mouseup', 'textarea[data-character-limit], input[data-character-limit]', (e) => {\n        const text = $(e.currentTarget).val();\n        const charsLimit = $(e.currentTarget).data('character-limit');\n        const charsUsed = text.length;\n\n        let charsRemain = charsLimit - charsUsed;\n\n        if (charsRemain < 0) {\n            $(e.currentTarget).val(text.slice(0, charsRemain));\n            charsRemain = 0;\n        }\n        $(e.currentTarget).parent().find('.char-count .char-remain-count').html(charsRemain);\n    });\n\n    // load js specific styles\n    util.limitCharacters();\n}\n\n/**\n * @function\n * @desc Initializes the search suggestion functionality in the header\n */\nfunction initSearchSuggestions() {\n    /**\n     * initialize search suggestions, pending the value of the site preference(enhancedSearchSuggestions)\n     * this will either init the legacy(false) or the beta versions(true) of the the search suggest feature.\n     * */\n    const $searchContainer = $('.top-banner .header-search');\n    searchsuggest.init($searchContainer, Resources.SIMPLE_SEARCH);\n}\n\n/**\n * @function\n * @desc Initializes the secondary navigation functionality\n */\nfunction initSecondaryNavigation() {\n    // add show/hide navigation elements\n    $('.secondary-navigation .toggle').click((e) => {\n        $(e.currentTarget).toggleClass('expanded').next('ul').toggle();\n    });\n}\n\n/**\n * @function\n * @desc Initializes the generic toggle functionality\n */\nfunction initToggle() {\n    // add generic toggle functionality\n    $('.toggle').next('.toggle-content').hide();\n\n    $('.toggle').on('click', (e) => {\n        if (!$(e.currentTarget).parents('.disable-toggle').length) {\n            $(e.currentTarget).toggleClass('expanded').next('.toggle-content').toggle();\n        }\n    });\n}\n\n/**\n * @function\n * @desc Initializes the generic check box functionality\n */\nfunction initCheckBoxes() {\n    // ensure checkbox values reflect checked state\n    $('body').on('click', '.checkbox label', (e) => {\n        util.setCheckboxValues($(e.currentTarget));\n    });\n}\n\n/**\n * @function\n * @desc Initializes the email signup functionality\n */\nfunction initEmailSignup() {\n    // subscribe email box\n    const $subscribeEmail = $('.subscribe-email');\n\n    if ($subscribeEmail.length > 0) {\n        $subscribeEmail.focus((e) => {\n            const val = $(e.currentTarget).val();\n            if (val.length > 0 && val !== Resources.SUBSCRIBE_EMAIL_DEFAULT) {\n                return; // do not animate when contains non-default value\n            }\n\n            $(e.currentTarget).animate({color: '#999999'}, 500, 'linear', function animateCallback() {\n                $(this).val('').css('color', '#333333');\n            });\n        }).blur((e) => {\n            const val = $.trim($(e.currentTarget).val());\n            if (val.length > 0) {\n                return; // do not animate when contains value\n            }\n            $(e.currentTarget).val(Resources.SUBSCRIBE_EMAIL_DEFAULT).css('color', '#999999').animate({color: '#333333'}, 500, 'linear');\n        });\n    }\n}\n\n/**\n * @function loadCustomContentFiles\n * @desc handles custom content CSS and JS\n * @returns\n */\nfunction loadCustomContentFiles() {\n    if ($('.content-asset').length) {\n        util.clearDynamicCss();\n        util.clearDynamicJs();\n\n        $('.content-asset').each((index, element) => {\n            if ($(element).data('csspath')) {\n                util.loadedCssFiles.push(util.loadCssFile($(element).data('csspath')));\n            }\n            if ($(element).data('jspath')) {\n                util.loadedJsFiles.push(util.loadJsFile($(element).data('jspath')));\n            }\n        });\n    }\n}\n\n/**\n * @function\n * @desc Initializes the general Open Modal functionality\n */\nfunction initOpenModal() {\n    $('body').on('click', '.openModal, .privacy-policy, .openIframe', (e) => {\n        e.preventDefault();\n        /// Checking for the page/asset link\n        /// If it is not on the clicked item, check for a parent\n        let iFrame = false;\n        let width;\n        let $cParent;\n        let href;\n        if ($(e.target).attr('href')) {\n            href = $(e.target).attr('href');\n            $cParent = $(e.target);\n        } else {\n            $cParent = $(e.target);\n            while (href === 'undefined' || !href) {\n                $cParent = $cParent.parent();\n                href = $cParent.attr('href');\n            }\n        }\n        iFrame = $('.openIframe').length > 0 ? 'true' : 'false';\n\n        if (iFrame === 'true') {\n            width = (navigator.userAgent.includes('Android') || navigator.userAgent.includes('iPhone')) ? '316' : '975';\n        } else {\n            width = $cParent.data('dlg-width') ? $cParent.data('dlg-width') : '800';\n        }\n        dialog.open({\n            url: href,\n            doClose: $('.pt_product-search-result').length === 0,\n            options: {\n                width,\n                title: $cParent.data('dlg-title') ? $cParent.data('dlg-title') : $(e.currentTarget).attr('title'),\n                dialogClass: $cParent.data('dlg-class'),\n                open() {\n                    // Check if a vertical scroll has been set and\n                    // Fix the dialog scroll from starting at 1/2 way down\n                    if ($('#dialog-container').css('overflow-y') === 'scroll' || $('#dialog-container').css('overflow-y') === 'auto') {\n                        $('#dialog-container').scrollTop(0);\n                    }\n                    // load custom asset content\n                    loadCustomContentFiles();\n                },\n            },\n        });\n    });\n}\n\nfunction initSocialDialog() {\n    $('body').on('click', '.share-dialog', (e) => {\n        e.preventDefault();\n        const content = $(e.currentTarget).attr('href');\n\n        dialog.open({\n            html: content,\n            options: {\n                title: $(e.currentTarget).data('title'),\n            },\n        });\n    });\n}\n\n/**\n * @function\n * @desc Initializes the mini cart functionality\n */\nfunction initMiniCart() {\n    // Minicart focus\n    minicart.setFocus();\n}\n\n/**\n * @function\n * @desc Initializes the misc. header functionality\n */\nfunction initHeader() {\n    $(document).on('click', () => {\n        $('html, #wrapper').removeClass('menu-active');\n    });\n\n    // main menu toggle\n    $('.menu-toggle').on('click', (e) => {\n        e.stopPropagation();\n        $('html, #wrapper').toggleClass('menu-active');\n    });\n\n    $('.account-menu-toggle.registered').on('click', (e) => {\n        e.stopPropagation();\n        e.preventDefault();\n        $('html, #wrapper').toggleClass('menu-active');\n        $('.mobile-account-navigation a.registered').click();\n    });\n\n    $('#navigation').on('click', (e) => {\n        const mobileMenuViewport = util.getViewports('mobile-menu') - 1;\n        const mobileMenuMediaQuery = matchMedia(`(max-width: ${mobileMenuViewport}px)`);\n\n        if (mobileMenuMediaQuery.matches) {\n            e.stopPropagation();\n        }\n    });\n}\n\n/**\n * @function\n * @desc Initializes the misc. footer functionality\n */\nfunction initFooter() {\n    const emailSignupForm = $('#email-alert-signup');\n    const emailInput = $('#email-alert-address');\n\n    emailInput.on('focus', () => {\n        emailSignupForm.next('.email-signup-msg').remove();\n    });\n\n    // Handles the submission of the email sign up in the footer\n    emailSignupForm.submit((e) => {\n        e.preventDefault();\n        if (!emailSignupForm.valid()) {\n            return false;\n        }\n        ajax.getJson({\n            url: Urls.emailSignUpFooter,\n            data: {\n                email: emailInput.val(),\n            },\n            callback(data) {\n                let msg; let\n                    msgClass;\n                if (data && data.success) {\n                    emailInput.trigger('blur').val('');\n                    msg = Resources.EMAIL_SIGNUP_SUCCESS;\n                    msgClass = 'email-signup-msg';\n                } else {\n                    msg = Resources.EMAIL_SIGNUP_ERROR;\n                    msgClass = 'email-signup-msg error';\n                }\n                // append/show result messaging\n                let msgContainer = $('.email-signup-msg');\n                if (msgContainer.length > 0) {\n                    msgContainer.prop('class', '').addClass(msgClass).html(msg);\n                } else {\n                    msgContainer = $('<span/>').addClass(msgClass).html(msg);\n                    emailSignupForm.after(msgContainer);\n                }\n            },\n        });\n        return true;\n    });\n}\n\nfunction initNavPosition(target) {\n    const desktopQuery = util.mediaBreakpointUp('mobile-menu');\n\n    // restrict mouse events to desktop; affects iOS navigation\n    if (desktopQuery) {\n        if (!$(target).children('.level-2').isOnScreen(1, 0.5)) {\n            $(target).children('.level-2').addClass('edge');\n        }\n    }\n}\n\n/**\n * @function\n * @desc Initializes the navigation functionality\n */\nfunction initNavigation() {\n    /**\n     * @listener\n     * @description Listens for the click event on the menu links to toggle the different levels on mobile\n     */\n    $('.menu-category a').on('click', (e) => {\n        const mobileMenuViewport = util.getViewports('mobile-menu') - 1;\n        const mobileMenuMediaQuery = matchMedia(`(max-width: ${mobileMenuViewport}px)`);\n        let level;\n        let nextLevel;\n        let prevLevel;\n\n        // Only trigger the menus if we are in the mobile menu viewport\n        if (mobileMenuMediaQuery.matches) {\n            // Trigger the sub menu if the chosen link has a sub menu\n            if ($(e.currentTarget).hasClass('has-sub-menu')) {\n                e.preventDefault();\n                level = $(e.currentTarget).attr('data-level');\n                nextLevel = Number(level) + 1;\n\n                $('.menu-category a, .custom-navigation-item a, .sub-nav-content-asset, .mobile-menu-level-label').removeClass('show-menu-item');\n\n                $(e.currentTarget).next().find(`[data-level=\"${nextLevel}\"]`).addClass('show-menu-item');\n                $(e.currentTarget).next().find('.sub-nav-content-asset').addClass('show-menu-item');\n\n                // customer service menu is only visible in level-1\n                $('.mobile-menu-utility-user').hide();\n                $('.level-1 > li:last-child > a::after').show();\n\n                // scroll to top\n                window.scrollTo(0, 0);\n\n            // Open the previous menu if the back link is clicked\n            } else if ($(e.currentTarget).hasClass('back-link')) {\n                e.preventDefault();\n                level = $(e.currentTarget).attr('data-level');\n                prevLevel = Number(level) - 1;\n\n                $('.menu-category a, .custom-navigation-item a, .sub-nav-content-asset, .mobile-menu-level-label').removeClass('show-menu-item');\n\n                if (prevLevel > 1) {\n                    $(e.currentTarget).parents(`[data-container-level=\"${prevLevel}\"]`).find(`[data-level=\"${prevLevel}\"]`).addClass('show-menu-item');\n                } else {\n                    $(`[data-container-level=\"${prevLevel}\"]`).find(`[data-level=\"${prevLevel}\"]`).addClass('show-menu-item');\n                    $('#navigation > .mobile-menu-level-label').addClass('show-menu-item');\n                }\n\n                if (prevLevel === 1) {\n                    $('.mobile-menu-utility-user').show();\n                    $('.level-1 > li:last-child > a::after').hide();\n                }\n            }\n        }\n    });\n\n    // Mobile Account Menu for Registered Credit holders\n    $('.mobile-account-navigation a.registered, .mobile-account-menu .back').on('click', (e) => {\n        const mobileMenuViewport = util.getViewports('mobile-menu') - 1;\n        const mobileMenuMediaQuery = matchMedia(`(max-width: ${mobileMenuViewport}px)`);\n\n        // Only trigger the menus if we are in the mobile menu viewport\n        if (mobileMenuMediaQuery.matches) {\n            // Trigger the sub menu\n            e.preventDefault();\n            $('.mobile-account-navigation a').removeClass('show-menu-item');\n\n            // hide category navigation\n            $('.mobile-cap + .mobile-menu-level-label').removeClass('show-menu-item');\n            $('.menu-category').hide();\n            // hide customer service links\n            $('.mobile-menu-utility-user').hide();\n\n            // show account menu\n            $('.mobile-account-menu.level-2').show();\n\n            // Open the previous menu if the back link is clicked\n            if ($(e.currentTarget).hasClass('back')) {\n                e.preventDefault();\n\n                // put back category navigation\n                $('.mobile-cap + .mobile-menu-level-label').addClass('show-menu-item');\n                $('.menu-category').show();\n                // show other customer service links\n                $('.mobile-menu-utility-user').show();\n\n                // hide account menu\n                $('.mobile-account-menu.level-2').hide();\n            }\n\n            // scroll to top\n            window.scrollTo(0, 0);\n        }\n    });\n\n    $('.account-nav-desktop-bottom .account-nav-toggle').on('click', (e) => {\n        e.stopPropagation();\n        $('.account-menu-toggle').click();\n    });\n\n    const navTimeout = window.SitePreferences.NAV_TIMEOUT;\n    const navInterval = window.SitePreferences.NAV_INTERVAL;\n\n    function navHover() {\n        $(this).addClass('navActive');\n        initNavPosition(this);\n    }\n\n    function navLeave() {\n        $(this).removeClass('navActive');\n    }\n\n    $('#navigation').hoverIntent({\n        over: navHover,\n        out: navLeave,\n        timeout: navTimeout,\n        interval: navInterval,\n        selector: '.level-1 li',\n    });\n\n    $('.menu-utility-user').hoverIntent({\n        over: navHover,\n        out: navLeave,\n        timeout: navTimeout,\n        interval: navInterval,\n        selector: 'li',\n    });\n\n    util.smartResize(() => {\n        $('.level-2').removeClass('edge');\n    });\n}\n\n/**\n * @function\n * @desc Initializes the quantity module events and DOM changes\n */\nfunction initQuantity() {\n    /**\n     * @listener\n     * @desc Listens for the click and keyup events on the quantity decrease button\n     */\n    $('body').on('click keyup', '.quantity-decrease', (e) => {\n        if (e.type === 'click' || (e.type === 'keyup' && e.which === 13)) {\n            const $this = $(e.currentTarget);\n            const qtyInput = $this.parents('.quantity-module').find('input');\n            const qtyInputValue = Number(qtyInput.val());\n\n            if ((qtyInputValue > 1)\n                || ($this.parents('.product-set-list').length && qtyInputValue >= 0)\n                || ($this.parents('.pnc').length && qtyInputValue > 0)) {\n                qtyInput.val(qtyInputValue - 1);\n                qtyInput.trigger('change');\n            }\n        }\n    });\n\n    /**\n     * @listener\n     * @desc Listens for the click and keyup events on the quantity increase button\n     */\n    $('body').on('click keyup', '.quantity-increase', (e) => {\n        if (e.type === 'click' || (e.type === 'keyup' && e.which === 13)) {\n            const qtyInput = $(e.currentTarget).parents('.quantity-module').find('input');\n            const qtyInputValue = Number(qtyInput.val());\n            const maxQtyValue = Number(qtyInput.attr('max'));\n            const pnc = $('.pnc');\n\n            // Do nothing if the quantity input is in the disabled state\n            if (qtyInput.hasClass('disabled')) {\n                e.preventDefault();\n                return;\n            }\n\n            // Only increase the value if the current value is less than the max value\n            if (qtyInputValue < maxQtyValue) {\n                qtyInput.val(qtyInputValue + 1);\n                qtyInput.trigger('change');\n            } else if (pnc.length > 0 && qtyInput.hasClass('pnc-qty')) {\n                const selectedQty = parseInt($('.pnc-remain-count').text(), 10);\n                const totalQty = parseInt($('.pnc ').data('packcount'), 10);\n                // Show errors when Pick 'n Choose max quantity limit reached\n                if (selectedQty === totalQty) {\n                    const url = util.appendParamsToUrl(Urls.pageShow, {cid: 'picknchoose-max-error', format: 'ajax'});\n                    if (window.pageContext.ns === 'product') {\n                        dialog.create({\n                            target: $('#PickNChooseDialog'),\n                            options: {\n                                width: '700',\n                            },\n                        });\n                        dialog.open({\n                            url,\n                            options: {\n                                title: Resources.PRODUCT_ALERT,\n                                buttons: [{\n                                    text: Resources.OK,\n                                    class: 'button primary',\n                                    click() {\n                                        $(this).dialog('close');\n                                    },\n                                }],\n                            },\n                        });\n                    } else if (pnc.find('.pnc-error').length === 0) {\n                        $('<div class=\"pnc-error\"/>').appendTo(pnc).load(url);\n                    }\n                }\n            }\n\n            if (qtyInputValue === maxQtyValue) {\n                $('.max-qty-msg').remove();\n                $(e.currentTarget).parents('.item-quantity').children('.item-quantity-details')\n                    .children('.product-availability-list')\n                    .append(`<span class=\"max-qty-msg not-available\">${Resources.CART_QUANTITY_RESTRICTION_MSG}</span>`);\n            }\n        }\n    });\n\n    /**\n     * @listener\n     * @desc Listens for the blur event on the quantity field\n     */\n    $('body').on('change', '.quantity-module input', (e) => {\n        const qtyValue = Number($(e.currentTarget).val());\n        const maxQtyValue = Number($(e.currentTarget).attr('max'));\n\n        if (qtyValue < 0 || qtyValue === '') {\n            if ($(e.currentTarget).parents('.product-set-list, .pnc').length) {\n                $(e.currentTarget).val(0);\n            } else {\n                $(e.currentTarget).val(1);\n            }\n        } else if (qtyValue > maxQtyValue) {\n            $(e.currentTarget).val(maxQtyValue);\n        }\n    });\n}\n\n/**\n * @function\n * @desc Initializes the sticky header functionality\n * @returns\n */\nfunction initStickyHeader() {\n    // Setup the sticky header functionality\n    const $window = $(window);\n    let lastWindowWidth = window.innerWidth;\n    const scrollTriggerDesktop = 19;\n    const scrollTriggerMobile = 19;\n    const toggleStickyHeader = (e) => {\n        const windowWidth = window.innerWidth;\n\n        // Only true if the event came from a trigger call, if the event is of type\n        // scroll, or only the width changed when the resize event occurs\n        if (e.isTrigger === 3 || e.type === 'scroll' || lastWindowWidth !== windowWidth) {\n            const scrollTop = $window.scrollTop();\n            const desktopQuery = util.mediaBreakpointUp('md');\n            let scrollTrigger;\n\n            if (desktopQuery) {\n                scrollTrigger = scrollTriggerDesktop;\n            } else {\n                scrollTrigger = scrollTriggerMobile;\n            }\n\n            if (scrollTop > scrollTrigger && !$('html').hasClass('sticky')) {\n                $('html').addClass('sticky');\n            } else if (scrollTop <= scrollTrigger) {\n                $('html').removeClass('sticky');\n            }\n\n            lastWindowWidth = windowWidth;\n        }\n    };\n\n    /**\n     * @listener\n     * @description Listens for the scroll and resize events on the window to toggle the sticky header when appropriate\n     */\n    $window.on('scroll.sticky resize.sticky', toggleStickyHeader).trigger('resize.sticky');\n}\n\n/**\n * @function\n * @desc Initializes the smooth scrolling to anchor\n */\nfunction initScrollToAnchor() {\n    $('#wrapper').on('click', 'a[href^=\"#\"]', (e) => {\n        const target = $(e.currentTarget).attr('href');\n        if ($(target).length > 0) {\n            $('html, body').animate({scrollTop: $(target).offset().top}, 400);\n            return false;\n        }\n        return true;\n    });\n}\n\n/**\n * @function\n * @desc Initializes the Back to top link\n * @returns\n */\nfunction initBackToTop() {\n    if ($('.back-to-top').length) {\n        util.backToTop();\n\n        $(window).scroll(() => {\n            util.backToTop();\n        });\n\n        $('body').on('click', '.back-to-top', (e) => {\n            e.preventDefault();\n            $('html,body').animate({\n                scrollTop: 0,\n            }, 700);\n        });\n    }\n}\n\n$.fn.isOnScreen = function isOnScreen(x, y) {\n    const xAxis = (x == null || typeof x === 'undefined') ? 1 : x;\n    const yAxis = (y == null || typeof y === 'undefined') ? 1 : y;\n\n    const win = $(window);\n\n    const viewport = {\n        top: win.scrollTop(),\n        left: win.scrollLeft(),\n    };\n    viewport.right = viewport.left + win.width();\n    viewport.bottom = viewport.top + win.height();\n\n    const height = this.outerHeight();\n    const width = this.outerWidth();\n\n    if (!width || !height) {\n        return false;\n    }\n\n    const bounds = this.offset();\n    bounds.right = bounds.left + width;\n    bounds.bottom = bounds.top + height;\n\n    const visible = (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom));\n\n    if (!visible) {\n        return false;\n    }\n\n    const deltas = {\n        top: Math.min(1, (bounds.bottom - viewport.top) / height),\n        bottom: Math.min(1, (viewport.bottom - bounds.top) / height),\n        left: Math.min(1, (bounds.right - viewport.left) / width),\n        right: Math.min(1, (viewport.right - bounds.left) / width),\n    };\n\n    return (deltas.left * deltas.right) >= xAxis && (deltas.top * deltas.bottom) >= yAxis;\n};\n\nfunction initHorizontalCarousel() {\n    $('.horizontal-carousel .tiles-container').not('slick-initialized').each((index, element) => {\n        const target = element;\n        target.id = `slider${index}`;\n        $(target).slick({\n            dots: true,\n            arrows: false,\n            infinite: false,\n            slidesToShow: 4,\n            slidesToScroll: 1,\n            speed: SitePreferences.SLIDE_SHOW_SPEED,\n            responsive: [{\n                breakpoint: 1024,\n                settings: {\n                    slidesToShow: 4,\n                    slidesToScroll: 1,\n                    infinite: true,\n                    dots: true,\n                },\n            },\n            {\n                breakpoint: 768,\n                settings: {\n                    slidesToShow: 2,\n                    slidesToScroll: 1,\n                },\n            },\n            {\n                breakpoint: 480,\n                settings: {\n                    slidesToShow: 1,\n                    slidesToScroll: 1,\n                },\n            },\n            ],\n        });\n    });\n    $('.horizontal-carousel-with-arrows .tiles-container').not('slick-initialized').each((index, element) => {\n        const target = element;\n        target.id = `slider${index}`;\n        $(target).slick({\n            dots: true,\n            arrows: true,\n            infinite: true,\n            slidesToShow: 4,\n            slidesToScroll: 1,\n            speed: SitePreferences.SLIDE_SHOW_SPEED,\n            responsive: [{\n                breakpoint: 1024,\n                settings: {\n                    slidesToShow: 3,\n                    slidesToScroll: 1,\n                    infinite: true,\n                    dots: true,\n                },\n            },\n            {\n                breakpoint: 768,\n                settings: {\n                    slidesToShow: 2,\n                    slidesToScroll: 1,\n                },\n            },\n            {\n                breakpoint: 480,\n                settings: {\n                    slidesToShow: 1,\n                    slidesToScroll: 1,\n                },\n            },\n            ],\n        });\n    });\n}\n\nfunction universalDrawers() {\n    if ($('.select-payment-methods .universal-drawer').length > 1) {\n        $('body').on('click', '.universal-drawer .drawer-handle', (e) => {\n            e.preventDefault();\n            const $drawer = $(e.currentTarget).parent();\n            if ($drawer.hasClass('radio-treatment')) {\n                if (!$drawer.hasClass('active')) {\n                    $drawer.addClass('active');\n                    $drawer.siblings().removeClass('active');\n                }\n            } else {\n                $drawer.toggleClass('active');\n            }\n            $drawer.trigger('drawerClick');\n        });\n    } else {\n        $('body').on('click', '.universal-drawer .drawer-handle', (e) => {\n            e.preventDefault();\n            const $drawer = $(e.currentTarget).parent();\n            $drawer.toggleClass('active');\n        });\n    }\n\n    $('body').on('click', '.universal-drawer .drawer-handle a', (e) => {\n        e.preventDefault();\n    });\n\n    $('body').on('keydown', '.universal-drawer .drawer-handle', (e) => {\n        if (e.which === 13) {\n            e.preventDefault();\n            $(e.currentTarget).trigger('click');\n        }\n    });\n}\n\nfunction stickItem() {\n    const vpQuery = util.getViewports('md');\n    $('body .sticky').pin({\n        maxWidth: vpQuery,\n        activeClass: 'pinned',\n        padding: {\n            top: 20,\n        },\n    });\n}\n\n/**\n * @function initTooltipClick\n * @desc stop the clicking of tooltip links\n * @returns\n */\nfunction initTooltipClick() {\n    // We don't want to allow using the a link for all tooltips\n    // except the ones that have an open-modal link\n    $('body').on('click', 'a.tooltip', (e) => {\n        if (!$(e.currentTarget).hasClass('open-modal')) {\n            e.preventDefault();\n        }\n    });\n}\n\n/**\n * @function ssnAutoTab\n * @desc tab to next ssn field automatically\n * @returns\n */\nfunction ssnAutoTab() {\n    $('input[name*=\"_ssn\"]').keydown((e) => {\n        const keys = [8, 9, 19, 20, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46, 48, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 144, 145];\n        const charLimit = $(e.currentTarget).attr('maxlength');\n        const $id = $(e.currentTarget).attr('id');\n\n        if (e.which === 8 && e.currentTarget.value.length === 0) {\n            if ($id.match(/_ssn_groupNumber/g)) {\n                $('input[id*=\"_ssn_areaNumber\"]').focus();\n            }\n            if ($id.match(/_ssn_serialNumber/g)) {\n                $('input[id*=\"_ssn_groupNumber\"]').focus();\n            }\n        } else if ($.inArray(e.which, keys) >= 0) {\n            return true;\n        } else if (e.currentTarget.value.length >= charLimit) {\n            $(e.currentTarget).next('input[name*=\"_ssn\"]').focus();\n            if ($id.match(/_ssn_areaNumber/g)) {\n                $('input[id*=\"_ssn_groupNumber\"]').focus();\n            }\n            if ($id.match(/_ssn_groupNumber/g)) {\n                $('input[id*=\"_ssn_serialNumber\"]').focus();\n            }\n            return false;\n        } else if (e.shiftKey || e.which <= 47 || e.which >= 58) {\n            return false;\n        }\n        return true;\n    }).keyup((e) => {\n        const charLimit = $(e.currentTarget).attr('maxlength');\n        if (e.currentTarget.value.length === charLimit) {\n            const $id = $(e.currentTarget).attr('id');\n            if ($id.match(/_ssn_areaNumber/g)) {\n                $('input[id*=\"_ssn_groupNumber\"]').focus();\n            }\n            if ($id.match(/_ssn_groupNumber/g)) {\n                $('input[id*=\"_ssn_serialNumber\"]').focus();\n            }\n            return false;\n        }\n        return true;\n    });\n}\n\nmodule.exports = {\n    init() {\n        if (window.SitePreferences.ENABLE_STICKY_HEADER) {\n            initStickyHeader();\n        }\n        initCharacterLimit();\n        initSearchSuggestions();\n        initSecondaryNavigation();\n        initToggle();\n        initCheckBoxes();\n        initEmailSignup();\n        initOpenModal();\n        initMiniCart();\n        initHeader();\n        initFooter();\n        initNavigation();\n        initQuantity();\n        initBackToTop();\n        initHorizontalCarousel();\n        initScrollToAnchor();\n        universalDrawers();\n        stickItem();\n        initSocialDialog();\n        loadCustomContentFiles();\n        initTooltipClick();\n        ssnAutoTab();\n    },\n};\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;A","sourceRoot":""}