{"version":3,"file":"bundle.min.js","sources":["../../../node_modules/lozad/dist/lozad.es.js","../../../node_modules/focus-visible/dist/focus-visible.js","../../../src/scripts/utilities/get-first-item.js","../../../src/scripts/utilities/transition-aware-show-hide.js","../../../src/scripts/utilities/toggle-visibility.js","../../../src/scripts/bundle.js","../../../node_modules/js-cookie/dist/js.cookie.mjs","../../../src/scripts/components/dismissable.js","../../../src/scripts/components/collapse.js","../../../node_modules/a11y-dialog/dist/a11y-dialog.esm.js","../../../node_modules/scroll-lock/dist/scroll-lock.js","../../../src/scripts/components/modal.js","../../../node_modules/hideshowpassword/hideShowPassword.js"],"sourcesContent":["/*! lozad.js - v1.16.0 - 2020-09-06\n* https://github.com/ApoorvSaxena/lozad.js\n* Copyright (c) 2020 Apoorv Saxena; Licensed MIT */\n\n\n/**\n * Detect IE browser\n * @const {boolean}\n * @private\n */\nconst isIE = typeof document !== 'undefined' && document.documentMode;\n\nconst defaultConfig = {\n rootMargin: '0px',\n threshold: 0,\n load(element) {\n if (element.nodeName.toLowerCase() === 'picture') {\n let img = element.querySelector('img');\n let append = false;\n\n if (img === null) {\n img = document.createElement('img');\n append = true;\n }\n\n if (isIE && element.getAttribute('data-iesrc')) {\n img.src = element.getAttribute('data-iesrc');\n }\n\n if (element.getAttribute('data-alt')) {\n img.alt = element.getAttribute('data-alt');\n }\n\n if (append) {\n element.append(img);\n }\n }\n\n if (element.nodeName.toLowerCase() === 'video' && !element.getAttribute('data-src')) {\n if (element.children) {\n const childs = element.children;\n let childSrc;\n for (let i = 0; i <= childs.length - 1; i++) {\n childSrc = childs[i].getAttribute('data-src');\n if (childSrc) {\n childs[i].src = childSrc;\n }\n }\n\n element.load();\n }\n }\n\n if (element.getAttribute('data-poster')) {\n element.poster = element.getAttribute('data-poster');\n }\n\n if (element.getAttribute('data-src')) {\n element.src = element.getAttribute('data-src');\n }\n\n if (element.getAttribute('data-srcset')) {\n element.setAttribute('srcset', element.getAttribute('data-srcset'));\n }\n\n let backgroundImageDelimiter = ',';\n if (element.getAttribute('data-background-delimiter')) {\n backgroundImageDelimiter = element.getAttribute('data-background-delimiter');\n }\n\n if (element.getAttribute('data-background-image')) {\n element.style.backgroundImage = `url('${element.getAttribute('data-background-image').split(backgroundImageDelimiter).join('\\'),url(\\'')}')`;\n } else if (element.getAttribute('data-background-image-set')) {\n const imageSetLinks = element.getAttribute('data-background-image-set').split(backgroundImageDelimiter);\n let firstUrlLink = (imageSetLinks[0].substr(0, imageSetLinks[0].indexOf(' ')) || imageSetLinks[0]); // Substring before ... 1x\n firstUrlLink = firstUrlLink.indexOf('url(') === -1 ? `url(${firstUrlLink})` : firstUrlLink;\n if (imageSetLinks.length === 1) {\n element.style.backgroundImage = firstUrlLink;\n } else {\n element.setAttribute('style', (element.getAttribute('style') || '') + `background-image: ${firstUrlLink}; background-image: -webkit-image-set(${imageSetLinks}); background-image: image-set(${imageSetLinks})`);\n }\n }\n\n if (element.getAttribute('data-toggle-class')) {\n element.classList.toggle(element.getAttribute('data-toggle-class'));\n }\n },\n loaded() {}\n};\n\nfunction markAsLoaded(element) {\n element.setAttribute('data-loaded', true);\n}\n\nfunction preLoad(element) {\n if (element.getAttribute('data-placeholder-background')) {\n element.style.background = element.getAttribute('data-placeholder-background');\n }\n}\n\nconst isLoaded = element => element.getAttribute('data-loaded') === 'true';\n\nconst onIntersection = (load, loaded) => (entries, observer) => {\n entries.forEach(entry => {\n if (entry.intersectionRatio > 0 || entry.isIntersecting) {\n observer.unobserve(entry.target);\n\n if (!isLoaded(entry.target)) {\n load(entry.target);\n markAsLoaded(entry.target);\n loaded(entry.target);\n }\n }\n });\n};\n\nconst getElements = (selector, root = document) => {\n if (selector instanceof Element) {\n return [selector]\n }\n\n if (selector instanceof NodeList) {\n return selector\n }\n\n return root.querySelectorAll(selector)\n};\n\nfunction lozad (selector = '.lozad', options = {}) {\n const {root, rootMargin, threshold, load, loaded} = Object.assign({}, defaultConfig, options);\n let observer;\n\n if (typeof window !== 'undefined' && window.IntersectionObserver) {\n observer = new IntersectionObserver(onIntersection(load, loaded), {\n root,\n rootMargin,\n threshold\n });\n }\n\n const elements = getElements(selector, root);\n for (let i = 0; i < elements.length; i++) {\n preLoad(elements[i]);\n }\n\n return {\n observe() {\n const elements = getElements(selector, root);\n\n for (let i = 0; i < elements.length; i++) {\n if (isLoaded(elements[i])) {\n continue\n }\n\n if (observer) {\n observer.observe(elements[i]);\n continue\n }\n\n load(elements[i]);\n markAsLoaded(elements[i]);\n loaded(elements[i]);\n }\n },\n triggerLoad(element) {\n if (isLoaded(element)) {\n return\n }\n\n load(element);\n markAsLoaded(element);\n loaded(element);\n },\n observer\n }\n}\n\nexport default lozad;\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (factory());\n}(this, (function () { 'use strict';\n\n /**\n * Applies the :focus-visible polyfill at the given scope.\n * A scope in this case is either the top-level Document or a Shadow Root.\n *\n * @param {(Document|ShadowRoot)} scope\n * @see https://github.com/WICG/focus-visible\n */\n function applyFocusVisiblePolyfill(scope) {\n var hadKeyboardEvent = true;\n var hadFocusVisibleRecently = false;\n var hadFocusVisibleRecentlyTimeout = null;\n\n var inputTypesAllowlist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true\n };\n\n /**\n * Helper function for legacy browsers and iframes which sometimes focus\n * elements like document, body, and non-interactive SVG.\n * @param {Element} el\n */\n function isValidFocusTarget(el) {\n if (\n el &&\n el !== document &&\n el.nodeName !== 'HTML' &&\n el.nodeName !== 'BODY' &&\n 'classList' in el &&\n 'contains' in el.classList\n ) {\n return true;\n }\n return false;\n }\n\n /**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} el\n * @return {boolean}\n */\n function focusTriggersKeyboardModality(el) {\n var type = el.type;\n var tagName = el.tagName;\n\n if (tagName === 'INPUT' && inputTypesAllowlist[type] && !el.readOnly) {\n return true;\n }\n\n if (tagName === 'TEXTAREA' && !el.readOnly) {\n return true;\n }\n\n if (el.isContentEditable) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Add the `focus-visible` class to the given element if it was not added by\n * the author.\n * @param {Element} el\n */\n function addFocusVisibleClass(el) {\n if (el.classList.contains('focus-visible')) {\n return;\n }\n el.classList.add('focus-visible');\n el.setAttribute('data-focus-visible-added', '');\n }\n\n /**\n * Remove the `focus-visible` class from the given element if it was not\n * originally added by the author.\n * @param {Element} el\n */\n function removeFocusVisibleClass(el) {\n if (!el.hasAttribute('data-focus-visible-added')) {\n return;\n }\n el.classList.remove('focus-visible');\n el.removeAttribute('data-focus-visible-added');\n }\n\n /**\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * Apply `focus-visible` to any current active element and keep track\n * of our keyboard modality state with `hadKeyboardEvent`.\n * @param {KeyboardEvent} e\n */\n function onKeyDown(e) {\n if (e.metaKey || e.altKey || e.ctrlKey) {\n return;\n }\n\n if (isValidFocusTarget(scope.activeElement)) {\n addFocusVisibleClass(scope.activeElement);\n }\n\n hadKeyboardEvent = true;\n }\n\n /**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n * @param {Event} e\n */\n function onPointerDown(e) {\n hadKeyboardEvent = false;\n }\n\n /**\n * On `focus`, add the `focus-visible` class to the target if:\n * - the target received focus as a result of keyboard navigation, or\n * - the event target is an element that will likely require interaction\n * via the keyboard (e.g. a text box)\n * @param {Event} e\n */\n function onFocus(e) {\n // Prevent IE from focusing the document or HTML element.\n if (!isValidFocusTarget(e.target)) {\n return;\n }\n\n if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) {\n addFocusVisibleClass(e.target);\n }\n }\n\n /**\n * On `blur`, remove the `focus-visible` class from the target.\n * @param {Event} e\n */\n function onBlur(e) {\n if (!isValidFocusTarget(e.target)) {\n return;\n }\n\n if (\n e.target.classList.contains('focus-visible') ||\n e.target.hasAttribute('data-focus-visible-added')\n ) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function() {\n hadFocusVisibleRecently = false;\n }, 100);\n removeFocusVisibleClass(e.target);\n }\n }\n\n /**\n * If the user changes tabs, keep track of whether or not the previously\n * focused element had .focus-visible.\n * @param {Event} e\n */\n function onVisibilityChange(e) {\n if (document.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n addInitialPointerMoveListeners();\n }\n }\n\n /**\n * Add a group of listeners to detect usage of any pointing devices.\n * These listeners will be added when the polyfill first loads, and anytime\n * the window is blurred, so that they are active when the window regains\n * focus.\n */\n function addInitialPointerMoveListeners() {\n document.addEventListener('mousemove', onInitialPointerMove);\n document.addEventListener('mousedown', onInitialPointerMove);\n document.addEventListener('mouseup', onInitialPointerMove);\n document.addEventListener('pointermove', onInitialPointerMove);\n document.addEventListener('pointerdown', onInitialPointerMove);\n document.addEventListener('pointerup', onInitialPointerMove);\n document.addEventListener('touchmove', onInitialPointerMove);\n document.addEventListener('touchstart', onInitialPointerMove);\n document.addEventListener('touchend', onInitialPointerMove);\n }\n\n function removeInitialPointerMoveListeners() {\n document.removeEventListener('mousemove', onInitialPointerMove);\n document.removeEventListener('mousedown', onInitialPointerMove);\n document.removeEventListener('mouseup', onInitialPointerMove);\n document.removeEventListener('pointermove', onInitialPointerMove);\n document.removeEventListener('pointerdown', onInitialPointerMove);\n document.removeEventListener('pointerup', onInitialPointerMove);\n document.removeEventListener('touchmove', onInitialPointerMove);\n document.removeEventListener('touchstart', onInitialPointerMove);\n document.removeEventListener('touchend', onInitialPointerMove);\n }\n\n /**\n * When the polfyill first loads, assume the user is in keyboard modality.\n * If any event is received from a pointing device (e.g. mouse, pointer,\n * touch), turn off keyboard modality.\n * This accounts for situations where focus enters the page from the URL bar.\n * @param {Event} e\n */\n function onInitialPointerMove(e) {\n // Work around a Safari quirk that fires a mousemove on whenever the\n // window blurs, even if you're tabbing out of the page. ¯\\_(ツ)_/¯\n if (e.target.nodeName && e.target.nodeName.toLowerCase() === 'html') {\n return;\n }\n\n hadKeyboardEvent = false;\n removeInitialPointerMoveListeners();\n }\n\n // For some kinds of state, we are interested in changes at the global scope\n // only. For example, global pointer input, global key presses and global\n // visibility change should affect the state at every scope:\n document.addEventListener('keydown', onKeyDown, true);\n document.addEventListener('mousedown', onPointerDown, true);\n document.addEventListener('pointerdown', onPointerDown, true);\n document.addEventListener('touchstart', onPointerDown, true);\n document.addEventListener('visibilitychange', onVisibilityChange, true);\n\n addInitialPointerMoveListeners();\n\n // For focus and blur, we specifically care about state changes in the local\n // scope. This is because focus / blur events that originate from within a\n // shadow root are not re-dispatched from the host element if it was already\n // the active element in its own scope:\n scope.addEventListener('focus', onFocus, true);\n scope.addEventListener('blur', onBlur, true);\n\n // We detect that a node is a ShadowRoot by ensuring that it is a\n // DocumentFragment and also has a host property. This check covers native\n // implementation and polyfill implementation transparently. If we only cared\n // about the native implementation, we could just check if the scope was\n // an instance of a ShadowRoot.\n if (scope.nodeType === Node.DOCUMENT_FRAGMENT_NODE && scope.host) {\n // Since a ShadowRoot is a special kind of DocumentFragment, it does not\n // have a root element to add a class to. So, we add this attribute to the\n // host element instead:\n scope.host.setAttribute('data-js-focus-visible', '');\n } else if (scope.nodeType === Node.DOCUMENT_NODE) {\n document.documentElement.classList.add('js-focus-visible');\n document.documentElement.setAttribute('data-js-focus-visible', '');\n }\n }\n\n // It is important to wrap all references to global window and document in\n // these checks to support server-side rendering use cases\n // @see https://github.com/WICG/focus-visible/issues/199\n if (typeof window !== 'undefined' && typeof document !== 'undefined') {\n // Make the polyfill helper globally available. This can be used as a signal\n // to interested libraries that wish to coordinate with the polyfill for e.g.,\n // applying the polyfill to a shadow root:\n window.applyFocusVisiblePolyfill = applyFocusVisiblePolyfill;\n\n // Notify interested libraries of the polyfill's presence, in case the\n // polyfill was loaded lazily:\n var event;\n\n try {\n event = new CustomEvent('focus-visible-polyfill-ready');\n } catch (error) {\n // IE11 does not support using CustomEvent as a constructor directly:\n event = document.createEvent('CustomEvent');\n event.initCustomEvent('focus-visible-polyfill-ready', false, false, {});\n }\n\n window.dispatchEvent(event);\n }\n\n if (typeof document !== 'undefined') {\n // Apply the polyfill to the global document, so that no JavaScript\n // coordination is required to use the polyfill in the top-level document:\n applyFocusVisiblePolyfill(document);\n }\n\n})));\n","/**\n * Get First Item\n *\n * This is a sanity check function for code where you can't be sure whether\n * you'll be passed a single item or a jQuery collection.\n *\n * Accepts either a DOM Element from `document.querySelector`,\n * a collection of DOM Elements from methods like `document.querySelectorAll`,\n * or a jQuery selection object, and returns a single DOM Element.\n *\n * @param {jQuery|NodeList|HTMLCollection|Element} selection - a collection or single element\n * @returns {Element} a DOM element\n */\nexport const getFirstItem = (selection) => {\n // Abort early if we somehow have an empty collection\n if (selection.length === 0) return null;\n\n // If this is a collection, return the first item.\n if (selection.length > 0) return selection[0];\n\n // If this is not a collection, return the original item.\n return selection;\n};\n","import { getFirstItem } from './get-first-item.js';\n\n/**\n * Transition-Aware Show & Hide Element\n *\n * A custom set of functions to handle the fading in and out of elements.\n * This depends on the targeted components having support for the `is-shown`\n * class and the `hidden` attribute. Currently this plugin works with the\n * `Overlay`, `StickyBar`, and `MegaMenu` components. This implementation\n * performs better than jQuery's built in animation methods since it uses CSS\n * transitions instead of manually setting CSS for each keyframe.\n */\n\n/**\n * Transition End Handler\n *\n * Event handler for the `transitionend` event. Sets the `hidden` attribute\n * and removes the event listener now that the animation is complete.\n *\n * @param {Event} event\n */\nconst transitionEndHandler = (event) => {\n // Ensure the event didn't bubble up from a child element\n if (event.target !== event.currentTarget) return;\n\n const element = event.currentTarget;\n\n // Now we know animation has completed, set the `hidden` attribute.\n element.setAttribute('hidden', '');\n\n // Remove our event listener.\n element.removeEventListener('transitionend', transitionEndHandler);\n};\n\n/**\n * Show Element\n *\n * Allows animation by removing the `hidden` attribute, triggering a browser\n * repaint, and then adding the `is-shown` class.\n *\n * @param {jQuery|NodeList|HTMLCollection|Element} selection - a collection or single element\n */\nexport const showElement = (selection) => {\n // If this is a jQuery collection, convert to a single element.\n const element = getFirstItem(selection);\n\n // If there's no element, abort early\n if (!element) return;\n\n // Begin animation.\n // (The specific transition depends on the targeted component's CSS)\n element.removeAttribute('hidden');\n\n // Force a browser re-paint so the browser will realize the element is no\n // longer `hidden` and allow transitions.\n // eslint-disable-next-line no-unused-expressions\n element.offsetWidth;\n\n // Complete animation.\n element.classList.add('is-shown');\n\n // Remove any lingering event listeners.\n element.removeEventListener('transitionend', transitionEndHandler);\n};\n\n/**\n * Hide Element\n *\n * Allows animation by removing the `is-shown` class, setting an event listener\n * for the `transitionend` event, and then adding the `hidden` attribute.\n *\n * @param {jQuery|NodeList|HTMLCollection|Element} selection - a collection or single element\n */\nexport const hideElement = (selection) => {\n // If this is a jQuery collection, convert to a single element.\n const element = getFirstItem(selection);\n\n // If there's no element, abort early\n if (!element) return;\n\n // Begin animation.\n // (The specific transition depends on the targeted component's CSS)\n element.classList.remove('is-shown');\n\n // Complete animation.\n if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {\n // If user prefers reduced motion then we disable the transition in CSS, so\n // `transitionend` will never fire. In that case we add `hidden` immediately.\n element.setAttribute('hidden', '');\n } else {\n // If not, then we set a listener for the `transitionend` event.\n element.addEventListener('transitionend', transitionEndHandler);\n }\n};\n","import $ from 'jquery';\n\nimport { hideElement, showElement } from './transition-aware-show-hide.js';\n\nconst NAME = 'toggleVisibility';\nconst DATA_KEY = `jax.${NAME}`;\n\n/**\n * A custom jQuery wrapper for our transition-aware show & hide element fuctions.\n */\n\nclass ToggleVisibility {\n constructor(element) {\n this._element = $(element);\n }\n\n show() {\n showElement(this._element);\n }\n\n hide() {\n hideElement(this._element);\n }\n\n /**\n * Interface for using this class as a jQuery plugin.\n *\n * @param {string} [method] - Name of a method to call.\n * @returns {jQuery}\n */\n\n static _jQueryInterface(config, ...args) {\n return this.each(function () {\n const $this = $(this);\n let data = $this.data(DATA_KEY);\n\n if (!data) {\n data = new ToggleVisibility(this);\n $this.data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined) {\n throw new Error(`No method named \"${config}\"`);\n }\n\n data[config](...args);\n }\n });\n }\n}\n\n$.fn[NAME] = ToggleVisibility._jQueryInterface;\n$.fn[NAME].Constructor = ToggleVisibility;\n\nexport default ToggleVisibility;\n","import $ from 'jquery';\nimport lozad from 'lozad';\n\nimport 'focus-visible';\nimport './utilities/toggle-visibility.js';\n/* eslint-disable @cloudfour/n/no-missing-import */\nimport breakpointTokens from './compiled/{{ BH_BRAND }}/breakpoints.json';\nimport { components } from './compiled/{{ BH_BRAND }}/components.json';\n/* eslint-enable @cloudfour/n/no-missing-import */\nconst breakpoints = breakpointTokens.size.breakpoint;\n\n$(() => {\n if (components.announcement) {\n import('./components/dismissable.js').then(() => {\n $('.js-Dismissable').dismissable();\n });\n }\n\n if (components.collapse) {\n import('./components/collapse.js').then(() => {\n $('.js-Collapse').collapse();\n });\n }\n\n if (components.modal) {\n import('./components/modal.js').then((modals) => {\n modals.create('.js-Modal');\n });\n }\n\n if (components.input) {\n import('hideshowpassword').then(() => {\n $('.js-PasswordToggle').hidePassword('focus');\n });\n\n /**\n * Auto-select input field contents on focus.\n *\n * This technique is hacky but works in iOS and modern browsers without\n * disabling adjustment of the selection.\n *\n * We use event delegation for this event so that it will work even for\n * elements that are added after page load.\n *\n * @see https://stackoverflow.com/a/22102081/5175805\n * @see https://stackoverflow.com/a/29643207\n */\n $(document).on('focus.jax.selectOnFocus', '.js-SelectOnFocus', (event) => {\n setTimeout(() => event.currentTarget.setSelectionRange(0, 9999), 0);\n });\n }\n\n if (components['input-group']) {\n $('.js-InputGroup').each(function () {\n const group = $(this);\n const inputs = group.find('input[type!=\"submit\"]');\n\n if (inputs.length === 1) {\n inputs\n .on('focus.jax.inputGroup', () => {\n group.addClass('is-focused');\n })\n .on('blur.jax.inputGroup', () => {\n group.removeClass('is-focused');\n });\n }\n });\n }\n\n if (components['input-reveal']) {\n import('./components/input-reveal.js').then(() => {\n $('.js-InputReveal').inputReveal();\n });\n }\n\n if (components.toggle) {\n import('./components/toggle-delegate.js').then(() => {\n $('.js-Toggle-delegate').toggleDelegate();\n });\n }\n\n if (components['toggle-step']) {\n import('./components/toggle-steps.js').then(() => {\n $('.js-ToggleSteps').toggleSteps();\n });\n }\n\n /**\n * Trigger Breakpoint Change Actions\n *\n * This function is called whenever a defined media query matches.\n * Add any actions that should happen on breakpoint changes.\n *\n * @param {MediaQueryList} mq\n */\n const triggerBreakpointChange = (mq) => {\n // This is the only responsive action right now, but more could live here.\n if (components.collapse) {\n $('.js-Collapse').collapse('respond', mq.media, mq.matches);\n }\n };\n\n /**\n * Media Queries\n *\n * Useful for responsive components that react to breakpoint changes.\n *\n * Add a listener to media queries to trigger a function whenever the browser\n * says the media query's `matches` status changes.\n */\n const mqMedium = window.matchMedia(`(min-width: ${breakpoints.md})`);\n mqMedium.addListener(triggerBreakpointChange);\n triggerBreakpointChange(mqMedium);\n\n const mqLarge = window.matchMedia(`(min-width: ${breakpoints.lg})`);\n mqLarge.addListener(triggerBreakpointChange);\n triggerBreakpointChange(mqLarge);\n\n /**\n * Lazy loads elements with default selector of `.lozad`\n */\n const observer = lozad();\n observer.observe();\n});\n","/*! js-cookie v3.0.5 | MIT */\n/* eslint-disable no-var */\nfunction assign (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n target[key] = source[key];\n }\n }\n return target\n}\n/* eslint-enable no-var */\n\n/* eslint-disable no-var */\nvar defaultConverter = {\n read: function (value) {\n if (value[0] === '\"') {\n value = value.slice(1, -1);\n }\n return value.replace(/(%[\\dA-F]{2})+/gi, decodeURIComponent)\n },\n write: function (value) {\n return encodeURIComponent(value).replace(\n /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,\n decodeURIComponent\n )\n }\n};\n/* eslint-enable no-var */\n\n/* eslint-disable no-var */\n\nfunction init (converter, defaultAttributes) {\n function set (name, value, attributes) {\n if (typeof document === 'undefined') {\n return\n }\n\n attributes = assign({}, defaultAttributes, attributes);\n\n if (typeof attributes.expires === 'number') {\n attributes.expires = new Date(Date.now() + attributes.expires * 864e5);\n }\n if (attributes.expires) {\n attributes.expires = attributes.expires.toUTCString();\n }\n\n name = encodeURIComponent(name)\n .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)\n .replace(/[()]/g, escape);\n\n var stringifiedAttributes = '';\n for (var attributeName in attributes) {\n if (!attributes[attributeName]) {\n continue\n }\n\n stringifiedAttributes += '; ' + attributeName;\n\n if (attributes[attributeName] === true) {\n continue\n }\n\n // Considers RFC 6265 section 5.2:\n // ...\n // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n // character:\n // Consume the characters of the unparsed-attributes up to,\n // not including, the first %x3B (\";\") character.\n // ...\n stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n }\n\n return (document.cookie =\n name + '=' + converter.write(value, name) + stringifiedAttributes)\n }\n\n function get (name) {\n if (typeof document === 'undefined' || (arguments.length && !name)) {\n return\n }\n\n // To prevent the for loop in the first place assign an empty array\n // in case there are no cookies at all.\n var cookies = document.cookie ? document.cookie.split('; ') : [];\n var jar = {};\n for (var i = 0; i < cookies.length; i++) {\n var parts = cookies[i].split('=');\n var value = parts.slice(1).join('=');\n\n try {\n var found = decodeURIComponent(parts[0]);\n jar[found] = converter.read(value, found);\n\n if (name === found) {\n break\n }\n } catch (e) {}\n }\n\n return name ? jar[name] : jar\n }\n\n return Object.create(\n {\n set,\n get,\n remove: function (name, attributes) {\n set(\n name,\n '',\n assign({}, attributes, {\n expires: -1\n })\n );\n },\n withAttributes: function (attributes) {\n return init(this.converter, assign({}, this.attributes, attributes))\n },\n withConverter: function (converter) {\n return init(assign({}, this.converter, converter), this.attributes)\n }\n },\n {\n attributes: { value: Object.freeze(defaultAttributes) },\n converter: { value: Object.freeze(converter) }\n }\n )\n}\n\nvar api = init(defaultConverter, { path: '/' });\n/* eslint-enable no-var */\n\nexport { api as default };\n","import $ from 'jquery';\nimport Cookies from 'js-cookie';\n\n/**\n * Supports the Announcement component by adding behavior to the dismiss button\n *\n * This class expects the component to include a `data-dismiss-days=\"#\"` attribute\n * that will determine the expiration of the dismiss cookie. It also expects a\n * `data-dismiss-uid` attribute that .NET will use to link the cookie with the entry\n */\nclass Dismissable {\n /**\n * Instantiate DismissableAnnouncement on an existing element.\n *\n * @param {Element} element\n */\n constructor(element) {\n this.element = element;\n this.uid = this.element.dataset.dismissableUid;\n const dismissDays = this.element.dataset.dismissableDays;\n this.dismissDays = Number.parseInt(dismissDays || 1, 10);\n this.button = this.element.querySelector('.js-Dismissable-button');\n this.button.addEventListener('click', () => this.dismiss());\n }\n\n /**\n * Handler for the dismiss click event.\n */\n dismiss() {\n this.setCookie();\n this.element.setAttribute('hidden', true);\n }\n\n /**\n * Set a cookie to persist the dismissed announcement.\n *\n * This sets a unique cookie for each announcement. We are utilizing the cookie’s expiration\n * to “un-dissmiss” announcements when it expires. If we were to store them all in one cookie We’d\n * first have to read existing cookies, append the new cookie, as well as an expiration timestamp.\n * Then the .NET folks would have to parse this cookie and check all the expiration dates before\n * deciding which announcements to render, etc. With individual cookies, we just drop the cookie\n * (when the announcement gets dismissed) and the only thing .NET needs to care about is whether\n * it finds the expected cookie. If yes, skip that announcement, otherwise show it.\n */\n setCookie() {\n // Can't persist the dismissal without a uid to identify it\n if (!this.uid) {\n return;\n }\n\n Cookies.set(`dismissed-${this.uid}`, '1', { expires: this.dismissDays });\n }\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $this = $(this);\n let data = $this.data('jax.dismissable');\n\n if (!data) {\n data = new Dismissable(this);\n $(this).data('jax.dismissable', data);\n }\n });\n }\n}\n\n$.fn.dismissable = Dismissable._jQueryInterface;\n$.fn.dismissable.Constructor = Dismissable;\n\nexport default Dismissable;\n","import $ from 'jquery';\n\n// eslint-disable-next-line @cloudfour/n/no-missing-import\nimport breakpointTokens from '../compiled/{{ BH_BRAND }}/breakpoints.json';\nimport ToggleVisibility from '../utilities/toggle-visibility.js';\nconst breakpoints = breakpointTokens.size.breakpoint;\n\n/**\n * Supports the Collapse CSS pattern by syncing relevant ARIA attributes to the\n * current element state. Designed to be used as a jQuery plugin.\n *\n * If the component includes a `data-toggle-icon=\"SELECTOR\"` attribute, then\n * this will also toggle the active class for contained elements matching\n * `SELECTOR` on every update.\n */\nclass Collapse {\n /**\n * Instantiate Collapse on an existing element.\n *\n * @param {Element} element\n */\n constructor(element) {\n this.$element = $(element);\n this.$content = this.$element.children('.Collapse-content');\n this.$button = this.$element.find('[aria-expanded]');\n this.$button.on('click.jax.collapse', () => this._toggle());\n this.$buttonIcon = this.$element.find(this.$element.data('toggle-icon'));\n this.$buttonIcon.addClass('Collapse-icon');\n this.$footnote = this.$element.find('.Collapse-footnote');\n\n if (this.$footnote) {\n this.footnoteTransitioner = new ToggleVisibility(this.$footnote);\n }\n }\n\n /**\n * Hide Content\n */\n _hide() {\n this.$element.removeClass('is-open');\n this.$content.attr('hidden', true);\n this.$button.attr('aria-expanded', false);\n this.$buttonIcon.removeClass('is-on');\n\n if (this.$footnote) {\n this.footnoteTransitioner.show();\n }\n }\n\n /**\n * Show Content\n */\n _show() {\n this.$element.addClass('is-open');\n this.$content.attr('hidden', false);\n this.$button.attr('aria-expanded', true);\n this.$buttonIcon.addClass('is-on');\n\n if (this.$footnote) {\n this.footnoteTransitioner.hide();\n }\n }\n\n /**\n * Disable Collapse button\n */\n _disable() {\n this.$element.addClass('is-disabled');\n this.$button.attr('disabled', true);\n this.$buttonIcon.attr('hidden', true);\n }\n\n /**\n * Enable Collapse button\n */\n _enable() {\n this.$element.removeClass('is-disabled');\n this.$button.attr('disabled', false);\n this.$buttonIcon.attr('hidden', false);\n }\n\n /**\n * Toggle the open state\n */\n _toggle() {\n if (this.$button.attr('aria-expanded') === 'true') {\n this._hide();\n } else {\n this._show();\n }\n }\n\n /**\n * Respond to Breakpoint Changes\n *\n * When a media query crosses a breakpoint, if the element has the appropriate\n * responsive modifier class, then show or hide the content. Intended to be\n * called from media query listeners.\n *\n * NOTE: Breakpoints must be a regex becuase IE returns a different version.\n *\n * @param {string} breakpoint\n * @param {boolean} matches\n * @see http://javascriptkit.com/javatutors/matchmediamultiple.shtml\n */\n respond(breakpoint, matches) {\n const mdBreakpointRegEx = new RegExp(\n `\\\\(min-width:\\\\s*${breakpoints.md}\\\\)`,\n );\n const lgBreakpointRegEx = new RegExp(\n `\\\\(min-width:\\\\s*${breakpoints.lg}\\\\)`,\n );\n\n if (\n this.$element.data('disable-md') &&\n mdBreakpointRegEx.test(breakpoint)\n ) {\n if (matches) {\n this._show();\n this._disable();\n } else {\n this._hide();\n this._enable();\n }\n }\n\n if (\n this.$element.data('disable-lg') &&\n lgBreakpointRegEx.test(breakpoint)\n ) {\n if (matches) {\n this._show();\n this._disable();\n } else {\n this._hide();\n this._enable();\n }\n }\n }\n\n /**\n * Interface for using this class as a jQuery plugin.\n *\n * @param {string} config\n * @param {...any} args\n * @returns {jQuery}\n */\n static _jQueryInterface(config, ...args) {\n return this.each(function () {\n const $this = $(this);\n let data = $this.data('jax.collapse');\n\n if (!data) {\n data = new Collapse(this);\n $this.data('jax.collapse', data);\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined) {\n throw new Error(`No method named \"${config}\"`);\n }\n\n data[config](...args);\n }\n });\n }\n}\n\n$.fn.collapse = Collapse._jQueryInterface;\n$.fn.collapse.Constructor = Collapse;\n\nexport default Collapse;\n","const not = {\n inert: ':not([inert]):not([inert] *)',\n negTabIndex: ':not([tabindex^=\"-\"])',\n disabled: ':not(:disabled)',\n};\n\nvar focusableSelectors = [\n `a[href]${not.inert}${not.negTabIndex}`,\n `area[href]${not.inert}${not.negTabIndex}`,\n `input:not([type=\"hidden\"]):not([type=\"radio\"])${not.inert}${not.negTabIndex}${not.disabled}`,\n `input[type=\"radio\"]${not.inert}${not.negTabIndex}${not.disabled}`,\n `select${not.inert}${not.negTabIndex}${not.disabled}`,\n `textarea${not.inert}${not.negTabIndex}${not.disabled}`,\n `button${not.inert}${not.negTabIndex}${not.disabled}`,\n `details${not.inert} > summary:first-of-type${not.negTabIndex}`,\n // Discard until Firefox supports `:has()`\n // See: https://github.com/KittyGiraudel/focusable-selectors/issues/12\n // `details:not(:has(> summary))${not.inert}${not.negTabIndex}`,\n `iframe${not.inert}${not.negTabIndex}`,\n `audio[controls]${not.inert}${not.negTabIndex}`,\n `video[controls]${not.inert}${not.negTabIndex}`,\n `[contenteditable]${not.inert}${not.negTabIndex}`,\n `[tabindex]${not.inert}${not.negTabIndex}`,\n];\n\n/**\n * Set the focus to the first element with `autofocus` with the element or the\n * element itself.\n */\nfunction moveFocusToDialog(el) {\n const focused = (el.querySelector('[autofocus]') || el);\n focused.focus();\n}\n/**\n * Get the first and last focusable elements in a given tree.\n */\nfunction getFocusableEdges(el) {\n // Check for a focusable element within the subtree of `el`.\n const first = findFocusableElement(el, true);\n // Only if we find the first element do we need to look for the last one. If\n // there’s no last element, we set `last` as a reference to `first` so that\n // the returned array is always of length 2.\n const last = first ? findFocusableElement(el, false) || first : null;\n return [first, last];\n}\n/**\n * Find the first focusable element inside the given node if `forward` is truthy\n * or the last focusable element otherwise.\n */\nfunction findFocusableElement(node, forward) {\n // If we’re walking forward, check if this node is focusable, and return it\n // immediately if it is.\n if (forward && isFocusable(node))\n return node;\n // We should only search the subtree of this node if it can have focusable\n // children.\n if (canHaveFocusableChildren(node)) {\n // Start walking the DOM tree, looking for focusable elements.\n // Case 1: If this node has a shadow root, search it recursively.\n if (node.shadowRoot) {\n // Descend into this subtree.\n let next = getNextChildEl(node.shadowRoot, forward);\n // Traverse siblings, searching the subtree of each one\n // for focusable elements.\n while (next) {\n const focusableEl = findFocusableElement(next, forward);\n if (focusableEl)\n return focusableEl;\n next = getNextSiblingEl(next, forward);\n }\n }\n // Case 2: If this node is a slot for a Custom Element, search its assigned\n // nodes recursively.\n else if (node.localName === 'slot') {\n const assignedElements = node.assignedElements({\n flatten: true,\n });\n if (!forward)\n assignedElements.reverse();\n for (const assignedElement of assignedElements) {\n const focusableEl = findFocusableElement(assignedElement, forward);\n if (focusableEl)\n return focusableEl;\n }\n }\n // Case 3: this is a regular Light DOM node. Search its subtree.\n else {\n // Descend into this subtree.\n let next = getNextChildEl(node, forward);\n // Traverse siblings, searching the subtree of each one\n // for focusable elements.\n while (next) {\n const focusableEl = findFocusableElement(next, forward);\n if (focusableEl)\n return focusableEl;\n next = getNextSiblingEl(next, forward);\n }\n }\n }\n // If we’re walking backward, we want to check the node’s entire subtree\n // before checking the node itself. If this node is focusable, return it.\n if (!forward && isFocusable(node))\n return node;\n return null;\n}\nfunction getNextChildEl(node, forward) {\n return forward ? node.firstElementChild : node.lastElementChild;\n}\nfunction getNextSiblingEl(el, forward) {\n return forward ? el.nextElementSibling : el.previousElementSibling;\n}\n/**\n * Determine if an element is hidden from the user.\n */\nconst isHidden = (el) => {\n // Browsers hide all non- descendants of closed
elements\n // from user interaction, but those non- elements may still match our\n // focusable-selectors and may still have dimensions, so we need a special\n // case to ignore them.\n if (el.matches('details:not([open]) *') &&\n !el.matches('details>summary:first-of-type'))\n return true;\n // If this element has no painted dimensions, it's hidden.\n return !(el.offsetWidth || el.offsetHeight || el.getClientRects().length);\n};\n/**\n * Determine if an element is focusable and has user-visible painted dimensions.\n */\nconst isFocusable = (el) => {\n // A shadow host that delegates focus will never directly receive focus,\n // even with `tabindex=0`. Consider our custom element, which\n // delegates focus to its shadow button:\n //\n // \n // #shadow-root\n // \n // \n //\n // The browser acts as as if there is only one focusable element – the shadow\n // button. Our library should behave the same way.\n if (el.shadowRoot?.delegatesFocus)\n return false;\n return el.matches(focusableSelectors.join(',')) && !isHidden(el);\n};\n/**\n * Determine if an element can have focusable children. Useful for bailing out\n * early when walking the DOM tree.\n * @example\n * This div is inert, so none of its children can be focused, even though they\n * meet our criteria for what is focusable. Once we check the div, we can skip\n * the rest of the subtree.\n * ```html\n *
\n * \n * Link\n *
\n * ```\n */\nfunction canHaveFocusableChildren(el) {\n // The browser will never send focus into a Shadow DOM if the host element\n // has a negative tabindex. This applies to both slotted Light DOM Shadow DOM\n // children\n if (el.shadowRoot && el.getAttribute('tabindex') === '-1')\n return false;\n // Elemments matching this selector are either hidden entirely from the user,\n // or are visible but unavailable for interaction. Their descentants can never\n // receive focus.\n return !el.matches(':disabled,[hidden],[inert]');\n}\n/**\n * Get the active element, accounting for Shadow DOM subtrees.\n * @author Cory LaViska\n * @see: https://www.abeautifulsite.net/posts/finding-the-active-element-in-a-shadow-root/\n */\nfunction getActiveElement(root = document) {\n const activeEl = root.activeElement;\n if (!activeEl)\n return null;\n // If there’s a shadow root, recursively find the active element within it.\n // If the recursive call returns null, return the active element\n // of the top-level Document.\n if (activeEl.shadowRoot)\n return getActiveElement(activeEl.shadowRoot) || document.activeElement;\n // If not, we can just return the active element\n return activeEl;\n}\n/**\n * Trap the focus inside the given element\n */\nfunction trapTabKey(el, event) {\n const [firstFocusableChild, lastFocusableChild] = getFocusableEdges(el);\n // If there are no focusable children in the dialog, prevent the user from\n // tabbing out of it\n if (!firstFocusableChild)\n return event.preventDefault();\n const activeElement = getActiveElement();\n // If the SHIFT key is pressed while tabbing (moving backwards) and the\n // currently focused item is the first one, move the focus to the last\n // focusable item from the dialog element\n if (event.shiftKey && activeElement === firstFocusableChild) {\n // @ts-ignore: we know that `lastFocusableChild` is not null here\n lastFocusableChild.focus();\n event.preventDefault();\n }\n // If the SHIFT key is not pressed (moving forwards) and the currently focused\n // item is the last one, move the focus to the first focusable item from the\n // dialog element\n else if (!event.shiftKey && activeElement === lastFocusableChild) {\n firstFocusableChild.focus();\n event.preventDefault();\n }\n}\n\nclass A11yDialog {\n $el;\n id;\n previouslyFocused;\n shown;\n constructor(element) {\n this.$el = element;\n this.id = this.$el.getAttribute('data-a11y-dialog') || this.$el.id;\n this.previouslyFocused = null;\n this.shown = false;\n this.maintainFocus = this.maintainFocus.bind(this);\n this.bindKeypress = this.bindKeypress.bind(this);\n this.handleTriggerClicks = this.handleTriggerClicks.bind(this);\n this.show = this.show.bind(this);\n this.hide = this.hide.bind(this);\n this.$el.setAttribute('aria-hidden', 'true');\n this.$el.setAttribute('aria-modal', 'true');\n this.$el.setAttribute('tabindex', '-1');\n if (!this.$el.hasAttribute('role')) {\n this.$el.setAttribute('role', 'dialog');\n }\n document.addEventListener('click', this.handleTriggerClicks, true);\n }\n /**\n * Destroy the current instance (after making sure the dialog has been hidden)\n * and remove all associated listeners from dialog openers and closers\n */\n destroy() {\n // Hide the dialog to avoid destroying an open instance\n this.hide();\n // Remove the click event delegates for our openers and closers\n document.removeEventListener('click', this.handleTriggerClicks, true);\n // Clone and replace the dialog element to prevent memory leaks caused by\n // event listeners that the author might not have cleaned up.\n this.$el.replaceWith(this.$el.cloneNode(true));\n // Dispatch a `destroy` event\n this.fire('destroy');\n return this;\n }\n /**\n * Show the dialog element, trap the current focus within it, listen for some\n * specific key presses and fire all registered callbacks for `show` event\n */\n show(event) {\n // If the dialog is already open, abort\n if (this.shown)\n return this;\n // Keep a reference to the currently focused element to be able to restore\n // it later\n this.shown = true;\n this.$el.removeAttribute('aria-hidden');\n this.previouslyFocused = getActiveElement();\n // Due to a long lasting bug in Safari, clicking an interactive element\n // (like a