').addClass('form-item form-type-select');$formTypeSelect.append($select.addClass(selectClasses));$formTypeSelect.append($('
').attr('type','submit').attr('name','op').attr('value','Go').addClass('form-submit'));$jumpmenu.append($formTypeSelect);$(this).replaceWith($jumpmenu);});$('form.jumpmenu',context).each(function(){var $select=$(this).find('select.jumpmenu-select');$select.val('_none');var submitCallback=function(){var url=$(this).find('option:selected').val();if(url!='_none'){if($select.hasClass('jumpmenu-no-tabs'))window.location=url;else window.open(url,'newTab');return false;}};if($select.hasClass('jumpmenu-hide-button')){$(this).find('.form-submit').hide();$select.change(submitCallback);}else $(this).submit(submitCallback);});}};})(jQuery,Drupal,once);;
(function($,window){"use strict";Drupal.behaviors.usdojSeaerch={attach:function(context){let affiliate;let component=document.querySelector('#affiliate');if(component){let affiliate=component.getAttribute('value');}var moduleConfig=drupalSettings.usasearch;window.usasearch_config={siteHandle:affiliate};var script=document.createElement("script");script.type="text/javascript";script.src="//search.justice.gov/javascripts/remote.loader.js";if(once('search-script','body',context).length)$('body').append(script);}};})(jQuery,window,once);;
;(function(factory){'use strict';if(typeof define==='function'&&define.amd)define(['jquery'],factory);else{if(jQuery&&!jQuery.fn.hoverIntent)factory(jQuery);}})(function($){'use strict';var _cfg={interval:100,sensitivity:6,timeout:0};var INSTANCE_COUNT=0;var cX,cY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,$el,s,cfg){if(Math.sqrt((s.pX-cX)*(s.pX-cX)+(s.pY-cY)*(s.pY-cY))
'],191:['/','?'],192:['`','~'],219:['[','{'],220:['\\','|'],221:[']','}'],222:["'",'"'],224:'Meta',225:'AltGraph',246:'Attn',247:'CrSel',248:'ExSel',249:'EraseEof',250:'Play',251:'ZoomOut'}};var i;for(i=1;i<25;i++)keyboardeventKeyPolyfill.keys[111+i]='F'+i;var letter='';for(i=65;i<91;i++){letter=String.fromCharCode(i);keyboardeventKeyPolyfill.keys[i]=[letter.toLowerCase(),letter.toUpperCase()];}function polyfill(){if(!('KeyboardEvent' in window)||'key' in KeyboardEvent.prototype)return false;var proto={get:function(x){var key=keyboardeventKeyPolyfill.keys[this.which||this.keyCode];if(Array.isArray(key))key=key[+this.shiftKey];return key;}};Object.defineProperty(KeyboardEvent.prototype,'key',proto);return proto;}if(typeof define==='function'&&define.amd)define('keyboardevent-key-polyfill',keyboardeventKeyPolyfill);else if(typeof exports!=='undefined'&&typeof module!=='undefined')module.exports=keyboardeventKeyPolyfill;else{if(window)window.keyboardeventKeyPolyfill=keyboardeventKeyPolyfill;}})();},{}],3:[function(require,module,exports){'use strict';var getOwnPropertySymbols=Object.getOwnPropertySymbols;var hasOwnProperty=Object.prototype.hasOwnProperty;var propIsEnumerable=Object.prototype.propertyIsEnumerable;function toObject(val){if(val===null||val===undefined)throw new TypeError('Object.assign cannot be called with null or undefined');return Object(val);}function shouldUseNative(){try{if(!Object.assign)return false;var test1=new String('abc');test1[5]='de';if(Object.getOwnPropertyNames(test1)[0]==='5')return false;var test2={};for(var i=0;i<10;i++)test2['_'+String.fromCharCode(i)]=i;var order2=Object.getOwnPropertyNames(test2).map(function(n){return test2[n];});if(order2.join('')!=='0123456789')return false;var test3={};'abcdefghijklmnopqrst'.split('').forEach(function(letter){test3[letter]=letter;});if(Object.keys(Object.assign({},test3)).join('')!=='abcdefghijklmnopqrst')return false;return true;}catch(err){return false;}}module.exports=shouldUseNative()?Object.assign:function(target,source){var from;var to=toObject(target);var symbols;for(var s=1;s-1)return type.split(SPACE).map(function(_type){return assign({type:_type},listener);});else{listener.type=type;return [listener];}};var popKey=function(obj,key){var value=obj[key];delete obj[key];return value;};module.exports=function behavior(events,props){const listeners=Object.keys(events).reduce(function(memo,type){var listeners=getListeners(type,events[type]);return memo.concat(listeners);},[]);return assign({add:function addBehavior(element){listeners.forEach(function(listener){element.addEventListener(listener.type,listener.delegate,listener.options);});},remove:function removeBehavior(element){listeners.forEach(function(listener){element.removeEventListener(listener.type,listener.delegate,listener.options);});}},props);};},{"../delegate":6,"../delegateAll":7,"object-assign":3}],5:[function(require,module,exports){"use strict";module.exports=function compose(functions){return function(e){return functions.some(function(fn){return fn.call(this,e)===false;},this);};};},{}],6:[function(require,module,exports){"use strict";require('element-closest');module.exports=function delegate(selector,fn){return function delegation(event){var target=event.target.closest(selector);if(target)return fn.call(target,event);};};},{"element-closest":1}],7:[function(require,module,exports){"use strict";const delegate=require('../delegate');const compose=require('../compose');const SPLAT='*';module.exports=function delegateAll(selectors){const keys=Object.keys(selectors);if(keys.length===1&&keys[0]===SPLAT)return selectors[SPLAT];const delegates=keys.reduce(function(memo,selector){memo.push(delegate(selector,selectors[selector]));return memo;},[]);return compose(delegates);};},{"../compose":5,"../delegate":6}],8:[function(require,module,exports){"use strict";module.exports=function ignore(element,fn){return function ignorance(e){if(element!==e.target&&!element.contains(e.target))return fn.call(this,e);};};},{}],9:[function(require,module,exports){"use strict";module.exports={behavior:require('./behavior'),delegate:require('./delegate'),delegateAll:require('./delegateAll'),ignore:require('./ignore'),keymap:require('./keymap')};},{"./behavior":4,"./delegate":6,"./delegateAll":7,"./ignore":8,"./keymap":10}],10:[function(require,module,exports){"use strict";require('keyboardevent-key-polyfill');const MODIFIERS={'Alt':'altKey','Control':'ctrlKey','Ctrl':'ctrlKey','Shift':'shiftKey'};const MODIFIER_SEPARATOR='+';const getEventKey=function(event,hasModifiers){var key=event.key;if(hasModifiers)for(var modifier in MODIFIERS)if(event[MODIFIERS[modifier]]===true)key=[modifier,key].join(MODIFIER_SEPARATOR);return key;};module.exports=function keymap(keys){const hasModifiers=Object.keys(keys).some(function(key){return key.indexOf(MODIFIER_SEPARATOR)>-1;});return function(event){var key=getEventKey(event,hasModifiers);return [key,key.toLowerCase()].reduce(function(result,_key){if(_key in keys)result=keys[key].call(this,event);return result;},undefined);};};module.exports.MODIFIERS=MODIFIERS;},{"keyboardevent-key-polyfill":2}],11:[function(require,module,exports){"use strict";module.exports=function once(listener,options){var wrapped=function wrappedOnce(e){e.currentTarget.removeEventListener(e.type,wrapped,options);return listener.call(this,e);};return wrapped;};},{}],12:[function(require,module,exports){"use strict";const behavior=require("../../uswds-core/src/js/utils/behavior");const toggleFormInput=require("../../uswds-core/src/js/utils/toggle-form-input");const {CLICK}=require("../../uswds-core/src/js/events");const {prefix:PREFIX}=require("../../uswds-core/src/js/config");const LINK=`.${PREFIX}-show-password`;function toggle(event){event.preventDefault();toggleFormInput(this);}module.exports=behavior({[CLICK]:{[LINK]:toggle}});},{"../../uswds-core/src/js/config":34,"../../uswds-core/src/js/events":35,"../../uswds-core/src/js/utils/behavior":39,"../../uswds-core/src/js/utils/toggle-form-input":49}],13:[function(require,module,exports){"use strict";const select=require("../../uswds-core/src/js/utils/select");const behavior=require("../../uswds-core/src/js/utils/behavior");const toggle=require("../../uswds-core/src/js/utils/toggle");const isElementInViewport=require("../../uswds-core/src/js/utils/is-in-viewport");const {CLICK}=require("../../uswds-core/src/js/events");const {prefix:PREFIX}=require("../../uswds-core/src/js/config");const ACCORDION=`.${PREFIX}-accordion, .${PREFIX}-accordion--bordered`;const BANNER_BUTTON=`.${PREFIX}-banner__button`;const BUTTON=`.${PREFIX}-accordion__button[aria-controls]:not(${BANNER_BUTTON})`;const EXPANDED="aria-expanded";const MULTISELECTABLE="data-allow-multiple";const getAccordionButtons=(accordion)=>{const buttons=select(BUTTON,accordion);return buttons.filter((button)=>button.closest(ACCORDION)===accordion);};const toggleButton=(button,expanded)=>{const accordion=button.closest(ACCORDION);let safeExpanded=expanded;if(!accordion)throw new Error(`${BUTTON} is missing outer ${ACCORDION}`);safeExpanded=toggle(button,expanded);const multiselectable=accordion.hasAttribute(MULTISELECTABLE);if(safeExpanded&&!multiselectable)getAccordionButtons(accordion).forEach((other)=>{if(other!==button)toggle(other,false);});};const showButton=(button)=>toggleButton(button,true);const hideButton=(button)=>toggleButton(button,false);const accordion=behavior({[CLICK]:{[BUTTON](){toggleButton(this);if(this.getAttribute(EXPANDED)==="true")if(!isElementInViewport(this))this.scrollIntoView();}}},{init(root){select(BUTTON,root).forEach((button)=>{const expanded=button.getAttribute(EXPANDED)==="true";toggleButton(button,expanded);});},ACCORDION,BUTTON,show:showButton,hide:hideButton,toggle:toggleButton,getButtons:getAccordionButtons});module.exports=accordion;},{"../../uswds-core/src/js/config":34,"../../uswds-core/src/js/events":35,"../../uswds-core/src/js/utils/behavior":39,"../../uswds-core/src/js/utils/is-in-viewport":42,"../../uswds-core/src/js/utils/select":47,"../../uswds-core/src/js/utils/toggle":50}],14:[function(require,module,exports){"use strict";const behavior=require("../../uswds-core/src/js/utils/behavior");const select=require("../../uswds-core/src/js/utils/select");const {CLICK}=require("../../uswds-core/src/js/events");const {prefix:PREFIX}=require("../../uswds-core/src/js/config");const toggle=require("../../uswds-core/src/js/utils/toggle");const HEADER=`.${PREFIX}-banner__header`;const EXPANDED_CLASS=`${PREFIX}-banner__header--expanded`;const BANNER_BUTTON=`${HEADER} [aria-controls]`;const toggleBanner=function toggleEl(event){event.preventDefault();const trigger=event.target.closest(BANNER_BUTTON);toggle(trigger);this.closest(HEADER).classList.toggle(EXPANDED_CLASS);};module.exports=behavior({[CLICK]:{[BANNER_BUTTON]:toggleBanner}},{init(root){select(BANNER_BUTTON,root).forEach((button)=>{const expanded=button.getAttribute(EXPANDED_CLASS)==="true";toggle(button,expanded);});}});},{"../../uswds-core/src/js/config":34,"../../uswds-core/src/js/events":35,"../../uswds-core/src/js/utils/behavior":39,"../../uswds-core/src/js/utils/select":47,"../../uswds-core/src/js/utils/toggle":50}],15:[function(require,module,exports){"use strict";const keymap=require("receptor/keymap");const behavior=require("../../uswds-core/src/js/utils/behavior");const ANCHOR_BUTTON=`a[class*="usa-button"]`;const toggleButton=(event)=>{event.preventDefault();event.target.click();};const anchorButton=behavior({keydown:{[ANCHOR_BUTTON]:keymap({" ":toggleButton})}});module.exports=anchorButton;},{"../../uswds-core/src/js/utils/behavior":39,"receptor/keymap":10}],16:[function(require,module,exports){"use strict";const select=require("../../uswds-core/src/js/utils/select");const behavior=require("../../uswds-core/src/js/utils/behavior");const debounce=require("../../uswds-core/src/js/utils/debounce");const {prefix:PREFIX}=require("../../uswds-core/src/js/config");const CHARACTER_COUNT_CLASS=`${PREFIX}-character-count`;const CHARACTER_COUNT=`.${CHARACTER_COUNT_CLASS}`;const FORM_GROUP_CLASS=`${PREFIX}-form-group`;const FORM_GROUP_ERROR_CLASS=`${FORM_GROUP_CLASS}--error`;const FORM_GROUP=`.${FORM_GROUP_CLASS}`;const LABEL_CLASS=`${PREFIX}-label`;const LABEL_ERROR_CLASS=`${LABEL_CLASS}--error`;const INPUT=`.${PREFIX}-character-count__field`;const INPUT_ERROR_CLASS=`${PREFIX}-input--error`;const MESSAGE=`.${PREFIX}-character-count__message`;const VALIDATION_MESSAGE="The content is too long.";const MESSAGE_INVALID_CLASS=`${PREFIX}-character-count__status--invalid`;const STATUS_MESSAGE_CLASS=`${CHARACTER_COUNT_CLASS}__status`;const STATUS_MESSAGE_SR_ONLY_CLASS=`${CHARACTER_COUNT_CLASS}__sr-status`;const STATUS_MESSAGE=`.${STATUS_MESSAGE_CLASS}`;const STATUS_MESSAGE_SR_ONLY=`.${STATUS_MESSAGE_SR_ONLY_CLASS}`;const DEFAULT_STATUS_LABEL=`characters allowed`;const getCharacterCountElements=(inputEl)=>{const characterCountEl=inputEl.closest(CHARACTER_COUNT);if(!characterCountEl)throw new Error(`${INPUT} is missing outer ${CHARACTER_COUNT}`);const formGroupEl=characterCountEl.querySelector(FORM_GROUP);const inputID=inputEl.getAttribute("id");const labelEl=document.querySelector(`label[for=${inputID}]`);const messageEl=characterCountEl.querySelector(MESSAGE);if(!messageEl)throw new Error(`${CHARACTER_COUNT} is missing inner ${MESSAGE}`);return {characterCountEl,formGroupEl,inputID,labelEl,messageEl};};const setDataLength=(inputEl)=>{const {characterCountEl}=getCharacterCountElements(inputEl);const maxlength=inputEl.getAttribute("maxlength");if(!maxlength)return;inputEl.removeAttribute("maxlength");characterCountEl.setAttribute("data-maxlength",maxlength);};const createStatusMessages=(characterCountEl)=>{const statusMessage=document.createElement("div");const srStatusMessage=document.createElement("div");const maxLength=characterCountEl.dataset.maxlength;const defaultMessage=`${maxLength} ${DEFAULT_STATUS_LABEL}`;statusMessage.classList.add(`${STATUS_MESSAGE_CLASS}`,"usa-hint");srStatusMessage.classList.add(`${STATUS_MESSAGE_SR_ONLY_CLASS}`,"usa-sr-only");statusMessage.setAttribute("aria-hidden",true);srStatusMessage.setAttribute("aria-live","polite");statusMessage.textContent=defaultMessage;srStatusMessage.textContent=defaultMessage;characterCountEl.append(statusMessage,srStatusMessage);};const getCountMessage=(currentLength,maxLength)=>{let newMessage="";if(currentLength===0)newMessage=`${maxLength} ${DEFAULT_STATUS_LABEL}`;else{const difference=Math.abs(maxLength-currentLength);const characters=`character${difference===1?"":"s"}`;const guidance=currentLength>maxLength?"over limit":"left";newMessage=`${difference} ${characters} ${guidance}`;}return newMessage;};const srUpdateStatus=debounce((msgEl,statusMessage)=>{const srStatusMessage=msgEl;srStatusMessage.textContent=statusMessage;},1000);const updateCountMessage=(inputEl)=>{const {characterCountEl,labelEl,formGroupEl}=getCharacterCountElements(inputEl);const currentLength=inputEl.value.length;const maxLength=parseInt(characterCountEl.getAttribute("data-maxlength"),10);const statusMessage=characterCountEl.querySelector(STATUS_MESSAGE);const srStatusMessage=characterCountEl.querySelector(STATUS_MESSAGE_SR_ONLY);const currentStatusMessage=getCountMessage(currentLength,maxLength);if(!maxLength)return;const isOverLimit=currentLength&¤tLength>maxLength;statusMessage.textContent=currentStatusMessage;srUpdateStatus(srStatusMessage,currentStatusMessage);if(isOverLimit&&!inputEl.validationMessage)inputEl.setCustomValidity(VALIDATION_MESSAGE);if(!isOverLimit&&inputEl.validationMessage===VALIDATION_MESSAGE)inputEl.setCustomValidity("");if(formGroupEl)formGroupEl.classList.toggle(FORM_GROUP_ERROR_CLASS,isOverLimit);if(labelEl)labelEl.classList.toggle(LABEL_ERROR_CLASS,isOverLimit);inputEl.classList.toggle(INPUT_ERROR_CLASS,isOverLimit);statusMessage.classList.toggle(MESSAGE_INVALID_CLASS,isOverLimit);};const enhanceCharacterCount=(inputEl)=>{const {characterCountEl,messageEl}=getCharacterCountElements(inputEl);messageEl.classList.add("usa-sr-only");messageEl.removeAttribute("aria-live");setDataLength(inputEl);createStatusMessages(characterCountEl);};const characterCount=behavior({input:{[INPUT](){updateCountMessage(this);}}},{init(root){select(INPUT,root).forEach((input)=>enhanceCharacterCount(input));},FORM_GROUP_ERROR_CLASS,LABEL_ERROR_CLASS,INPUT_ERROR_CLASS,MESSAGE_INVALID_CLASS,VALIDATION_MESSAGE,STATUS_MESSAGE_CLASS,STATUS_MESSAGE_SR_ONLY_CLASS,DEFAULT_STATUS_LABEL,createStatusMessages,getCountMessage,updateCountMessage});module.exports=characterCount;},{"../../uswds-core/src/js/config":34,"../../uswds-core/src/js/utils/behavior":39,"../../uswds-core/src/js/utils/debounce":40,"../../uswds-core/src/js/utils/select":47}],17:[function(require,module,exports){"use strict";const keymap=require("receptor/keymap");const selectOrMatches=require("../../uswds-core/src/js/utils/select-or-matches");const behavior=require("../../uswds-core/src/js/utils/behavior");const Sanitizer=require("../../uswds-core/src/js/utils/sanitizer");const {prefix:PREFIX}=require("../../uswds-core/src/js/config");const {CLICK}=require("../../uswds-core/src/js/events");const COMBO_BOX_CLASS=`${PREFIX}-combo-box`;const COMBO_BOX_PRISTINE_CLASS=`${COMBO_BOX_CLASS}--pristine`;const SELECT_CLASS=`${COMBO_BOX_CLASS}__select`;const INPUT_CLASS=`${COMBO_BOX_CLASS}__input`;const CLEAR_INPUT_BUTTON_CLASS=`${COMBO_BOX_CLASS}__clear-input`;const CLEAR_INPUT_BUTTON_WRAPPER_CLASS=`${CLEAR_INPUT_BUTTON_CLASS}__wrapper`;const INPUT_BUTTON_SEPARATOR_CLASS=`${COMBO_BOX_CLASS}__input-button-separator`;const TOGGLE_LIST_BUTTON_CLASS=`${COMBO_BOX_CLASS}__toggle-list`;const TOGGLE_LIST_BUTTON_WRAPPER_CLASS=`${TOGGLE_LIST_BUTTON_CLASS}__wrapper`;const LIST_CLASS=`${COMBO_BOX_CLASS}__list`;const LIST_OPTION_CLASS=`${COMBO_BOX_CLASS}__list-option`;const LIST_OPTION_FOCUSED_CLASS=`${LIST_OPTION_CLASS}--focused`;const LIST_OPTION_SELECTED_CLASS=`${LIST_OPTION_CLASS}--selected`;const STATUS_CLASS=`${COMBO_BOX_CLASS}__status`;const COMBO_BOX=`.${COMBO_BOX_CLASS}`;const SELECT=`.${SELECT_CLASS}`;const INPUT=`.${INPUT_CLASS}`;const CLEAR_INPUT_BUTTON=`.${CLEAR_INPUT_BUTTON_CLASS}`;const TOGGLE_LIST_BUTTON=`.${TOGGLE_LIST_BUTTON_CLASS}`;const LIST=`.${LIST_CLASS}`;const LIST_OPTION=`.${LIST_OPTION_CLASS}`;const LIST_OPTION_FOCUSED=`.${LIST_OPTION_FOCUSED_CLASS}`;const LIST_OPTION_SELECTED=`.${LIST_OPTION_SELECTED_CLASS}`;const STATUS=`.${STATUS_CLASS}`;const DEFAULT_FILTER=".*{{query}}.*";const noop=()=>{};const changeElementValue=(el,value="")=>{const elementToChange=el;elementToChange.value=value;const event=new CustomEvent("change",{bubbles:true,cancelable:true,detail:{value}});elementToChange.dispatchEvent(event);};const getComboBoxContext=(el)=>{const comboBoxEl=el.closest(COMBO_BOX);if(!comboBoxEl)throw new Error(`Element is missing outer ${COMBO_BOX}`);const selectEl=comboBoxEl.querySelector(SELECT);const inputEl=comboBoxEl.querySelector(INPUT);const listEl=comboBoxEl.querySelector(LIST);const statusEl=comboBoxEl.querySelector(STATUS);const focusedOptionEl=comboBoxEl.querySelector(LIST_OPTION_FOCUSED);const selectedOptionEl=comboBoxEl.querySelector(LIST_OPTION_SELECTED);const toggleListBtnEl=comboBoxEl.querySelector(TOGGLE_LIST_BUTTON);const clearInputBtnEl=comboBoxEl.querySelector(CLEAR_INPUT_BUTTON);const isPristine=comboBoxEl.classList.contains(COMBO_BOX_PRISTINE_CLASS);const disableFiltering=comboBoxEl.dataset.disableFiltering==="true";return {comboBoxEl,selectEl,inputEl,listEl,statusEl,focusedOptionEl,selectedOptionEl,toggleListBtnEl,clearInputBtnEl,isPristine,disableFiltering};};const disable=(el)=>{const {inputEl,toggleListBtnEl,clearInputBtnEl}=getComboBoxContext(el);clearInputBtnEl.hidden=true;clearInputBtnEl.disabled=true;toggleListBtnEl.disabled=true;inputEl.disabled=true;};const ariaDisable=(el)=>{const {inputEl,toggleListBtnEl,clearInputBtnEl}=getComboBoxContext(el);clearInputBtnEl.hidden=true;clearInputBtnEl.setAttribute("aria-disabled",true);toggleListBtnEl.setAttribute("aria-disabled",true);inputEl.setAttribute("aria-disabled",true);};const enable=(el)=>{const {inputEl,toggleListBtnEl,clearInputBtnEl}=getComboBoxContext(el);clearInputBtnEl.hidden=false;clearInputBtnEl.disabled=false;toggleListBtnEl.disabled=false;inputEl.disabled=false;};const enhanceComboBox=(_comboBoxEl)=>{const comboBoxEl=_comboBoxEl.closest(COMBO_BOX);if(comboBoxEl.dataset.enhanced)return;const selectEl=comboBoxEl.querySelector("select");if(!selectEl)throw new Error(`${COMBO_BOX} is missing inner select`);const selectId=selectEl.id;const selectLabel=document.querySelector(`label[for="${selectId}"]`);const listId=`${selectId}--list`;const listIdLabel=`${selectId}-label`;const additionalAttributes=[];const {defaultValue}=comboBoxEl.dataset;const {placeholder}=comboBoxEl.dataset;let selectedOption;if(placeholder)additionalAttributes.push({placeholder});if(defaultValue){for(let i=0,len=selectEl.options.length;i{if(selectEl.hasAttribute(name)){const value=selectEl.getAttribute(name);additionalAttributes.push({[name]:value});selectEl.removeAttribute(name);}});const input=document.createElement("input");input.setAttribute("id",selectId);input.setAttribute("aria-owns",listId);input.setAttribute("aria-controls",listId);input.setAttribute("aria-autocomplete","list");input.setAttribute("aria-expanded","false");input.setAttribute("autocapitalize","off");input.setAttribute("autocomplete","off");input.setAttribute("class",INPUT_CLASS);input.setAttribute("type","text");input.setAttribute("role","combobox");additionalAttributes.forEach((attr)=>Object.keys(attr).forEach((key)=>{const value=Sanitizer.escapeHTML`${attr[key]}`;input.setAttribute(key,value);}));comboBoxEl.insertAdjacentElement("beforeend",input);comboBoxEl.insertAdjacentHTML("beforeend",Sanitizer.escapeHTML`
`);if(selectedOption){const {inputEl}=getComboBoxContext(comboBoxEl);changeElementValue(selectEl,selectedOption.value);changeElementValue(inputEl,selectedOption.text);comboBoxEl.classList.add(COMBO_BOX_PRISTINE_CLASS);}if(selectEl.disabled){disable(comboBoxEl);selectEl.disabled=false;}if(selectEl.hasAttribute("aria-disabled")){ariaDisable(comboBoxEl);selectEl.removeAttribute("aria-disabled");}comboBoxEl.dataset.enhanced="true";};const highlightOption=(el,nextEl,{skipFocus,preventScroll}={})=>{const {inputEl,listEl,focusedOptionEl}=getComboBoxContext(el);if(focusedOptionEl){focusedOptionEl.classList.remove(LIST_OPTION_FOCUSED_CLASS);focusedOptionEl.setAttribute("tabIndex","-1");}if(nextEl){inputEl.setAttribute("aria-activedescendant",nextEl.id);nextEl.setAttribute("tabIndex","0");nextEl.classList.add(LIST_OPTION_FOCUSED_CLASS);if(!preventScroll){const optionBottom=nextEl.offsetTop+nextEl.offsetHeight;const currentBottom=listEl.scrollTop+listEl.offsetHeight;if(optionBottom>currentBottom)listEl.scrollTop=optionBottom-listEl.offsetHeight;if(nextEl.offsetTop{const escapeRegExp=(text)=>text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");let find=filter.replace(/{{(.*?)}}/g,(m,$1)=>{const key=$1.trim();const queryFilter=extras[key];if(key!=="query"&&queryFilter){const matcher=new RegExp(queryFilter,"i");const matches=query.match(matcher);if(matches)return escapeRegExp(matches[1]);return "";}return escapeRegExp(query);});find=`^(?:${find})$`;return new RegExp(find,"i");};const displayList=(el)=>{const {comboBoxEl,selectEl,inputEl,listEl,statusEl,isPristine,disableFiltering}=getComboBoxContext(el);let selectedItemId;let firstFoundId;const listOptionBaseId=`${listEl.id}--option-`;const inputValue=(inputEl.value||"").toLowerCase();const filter=comboBoxEl.dataset.filter||DEFAULT_FILTER;const regex=generateDynamicRegExp(filter,inputValue,comboBoxEl.dataset);let options=[];const optionsStartsWith=[];const optionsContains=[];const optionList=[...selectEl.options];const buildOptionsArray=(option)=>{if(disableFiltering||isPristine){options.push(option);return;}const matchStartsWith=option.text.toLowerCase().startsWith(inputValue);if(matchStartsWith)optionsStartsWith.push(option);else optionsContains.push(option);options=[...optionsStartsWith,...optionsContains];};const optionMatchesQuery=(option)=>regex.test(option.text);const arrayNeedsUpdate=(option)=>option.value&&(disableFiltering||isPristine||!inputValue||optionMatchesQuery(option));const isFirstMatch=(option)=>disableFiltering&&!firstFoundId&&optionMatchesQuery(option);const isCurrentSelection=(option)=>selectEl.value&&option.value===selectEl.value;optionList.forEach((option)=>{if(arrayNeedsUpdate(option)){buildOptionsArray(option);const optionId=`${listOptionBaseId}${options.indexOf(option)}`;if(isFirstMatch(option))firstFoundId=optionId;if(isCurrentSelection(option))selectedItemId=optionId;}});const numOptions=options.length;const optionHtml=options.map((option,index)=>{const optionId=`${listOptionBaseId}${index}`;const classes=[LIST_OPTION_CLASS];let tabindex="-1";let ariaSelected="false";if(optionId===selectedItemId){classes.push(LIST_OPTION_SELECTED_CLASS,LIST_OPTION_FOCUSED_CLASS);tabindex="0";ariaSelected="true";}if(!selectedItemId&&index===0){classes.push(LIST_OPTION_FOCUSED_CLASS);tabindex="0";}const li=document.createElement("li");li.setAttribute("aria-setsize",options.length);li.setAttribute("aria-posinset",index+1);li.setAttribute("aria-selected",ariaSelected);li.setAttribute("id",optionId);li.setAttribute("class",classes.join(" "));li.setAttribute("tabindex",tabindex);li.setAttribute("role","option");li.setAttribute("data-value",option.value);li.textContent=option.text;return li;});const noResults=document.createElement("li");noResults.setAttribute("class",`${LIST_OPTION_CLASS}--no-results`);noResults.textContent="No results found";listEl.hidden=false;if(numOptions){listEl.innerHTML="";optionHtml.forEach((item)=>listEl.insertAdjacentElement("beforeend",item));}else{listEl.innerHTML="";listEl.insertAdjacentElement("beforeend",noResults);}inputEl.setAttribute("aria-expanded","true");statusEl.textContent=numOptions?`${numOptions} result${numOptions>1?"s":""} available.`:"No results.";let itemToFocus;if(isPristine&&selectedItemId)itemToFocus=listEl.querySelector(`#${selectedItemId}`);else{if(disableFiltering&&firstFoundId)itemToFocus=listEl.querySelector(`#${firstFoundId}`);}if(itemToFocus)highlightOption(listEl,itemToFocus,{skipFocus:true});};const hideList=(el)=>{const {inputEl,listEl,statusEl,focusedOptionEl}=getComboBoxContext(el);statusEl.innerHTML="";inputEl.setAttribute("aria-expanded","false");inputEl.setAttribute("aria-activedescendant","");if(focusedOptionEl)focusedOptionEl.classList.remove(LIST_OPTION_FOCUSED_CLASS);listEl.scrollTop=0;listEl.hidden=true;};const selectItem=(listOptionEl)=>{const {comboBoxEl,selectEl,inputEl}=getComboBoxContext(listOptionEl);changeElementValue(selectEl,listOptionEl.dataset.value);changeElementValue(inputEl,listOptionEl.textContent);comboBoxEl.classList.add(COMBO_BOX_PRISTINE_CLASS);hideList(comboBoxEl);inputEl.focus();};const clearInput=(clearButtonEl)=>{const {comboBoxEl,listEl,selectEl,inputEl}=getComboBoxContext(clearButtonEl);const listShown=!listEl.hidden;if(selectEl.value)changeElementValue(selectEl);if(inputEl.value)changeElementValue(inputEl);comboBoxEl.classList.remove(COMBO_BOX_PRISTINE_CLASS);if(listShown)displayList(comboBoxEl);inputEl.focus();};const resetSelection=(el)=>{const {comboBoxEl,selectEl,inputEl}=getComboBoxContext(el);const selectValue=selectEl.value;const inputValue=(inputEl.value||"").toLowerCase();if(selectValue){for(let i=0,len=selectEl.options.length;i{const {comboBoxEl,selectEl,inputEl,statusEl}=getComboBoxContext(el);statusEl.textContent="";const inputValue=(inputEl.value||"").toLowerCase();if(inputValue){for(let i=0,len=selectEl.options.length;i{const {comboBoxEl,inputEl}=getComboBoxContext(event.target);hideList(comboBoxEl);resetSelection(comboBoxEl);inputEl.focus();};const handleDownFromInput=(event)=>{const {comboBoxEl,listEl}=getComboBoxContext(event.target);if(listEl.hidden)displayList(comboBoxEl);const nextOptionEl=listEl.querySelector(LIST_OPTION_FOCUSED)||listEl.querySelector(LIST_OPTION);if(nextOptionEl)highlightOption(comboBoxEl,nextOptionEl);event.preventDefault();};const handleEnterFromInput=(event)=>{const {comboBoxEl,listEl}=getComboBoxContext(event.target);const listShown=!listEl.hidden;completeSelection(comboBoxEl);if(listShown)hideList(comboBoxEl);event.preventDefault();};const handleDownFromListOption=(event)=>{const focusedOptionEl=event.target;const nextOptionEl=focusedOptionEl.nextSibling;if(nextOptionEl)highlightOption(focusedOptionEl,nextOptionEl);event.preventDefault();};const handleSpaceFromListOption=(event)=>{selectItem(event.target);event.preventDefault();};const handleEnterFromListOption=(event)=>{selectItem(event.target);event.preventDefault();};const handleUpFromListOption=(event)=>{const {comboBoxEl,listEl,focusedOptionEl}=getComboBoxContext(event.target);const nextOptionEl=focusedOptionEl&&focusedOptionEl.previousSibling;const listShown=!listEl.hidden;highlightOption(comboBoxEl,nextOptionEl);if(listShown)event.preventDefault();if(!nextOptionEl)hideList(comboBoxEl);};const handleMouseover=(listOptionEl)=>{const isCurrentlyFocused=listOptionEl.classList.contains(LIST_OPTION_FOCUSED_CLASS);if(isCurrentlyFocused)return;highlightOption(listOptionEl,listOptionEl,{preventScroll:true});};const toggleList=(el)=>{const {comboBoxEl,listEl,inputEl}=getComboBoxContext(el);if(listEl.hidden)displayList(comboBoxEl);else hideList(comboBoxEl);inputEl.focus();};const handleClickFromInput=(el)=>{const {comboBoxEl,listEl}=getComboBoxContext(el);if(listEl.hidden)displayList(comboBoxEl);};const comboBox=behavior({[CLICK]:{[INPUT](){if(this.disabled)return;handleClickFromInput(this);},[TOGGLE_LIST_BUTTON](){if(this.disabled)return;toggleList(this);},[LIST_OPTION](){if(this.disabled)return;selectItem(this);},[CLEAR_INPUT_BUTTON](){if(this.disabled)return;clearInput(this);}},focusout:{[COMBO_BOX](event){if(!this.contains(event.relatedTarget)){resetSelection(this);hideList(this);}}},keydown:{[COMBO_BOX]:keymap({Escape:handleEscape}),[INPUT]:keymap({Enter:handleEnterFromInput,ArrowDown:handleDownFromInput,Down:handleDownFromInput}),[LIST_OPTION]:keymap({ArrowUp:handleUpFromListOption,Up:handleUpFromListOption,ArrowDown:handleDownFromListOption,Down:handleDownFromListOption,Enter:handleEnterFromListOption," ":handleSpaceFromListOption,"Shift+Tab":noop})},input:{[INPUT](){const comboBoxEl=this.closest(COMBO_BOX);comboBoxEl.classList.remove(COMBO_BOX_PRISTINE_CLASS);displayList(this);}},mouseover:{[LIST_OPTION](){handleMouseover(this);}}},{init(root){selectOrMatches(COMBO_BOX,root).forEach((comboBoxEl)=>{enhanceComboBox(comboBoxEl);});},getComboBoxContext,enhanceComboBox,generateDynamicRegExp,disable,enable,displayList,hideList,COMBO_BOX_CLASS});module.exports=comboBox;},{"../../uswds-core/src/js/config":34,"../../uswds-core/src/js/events":35,"../../uswds-core/src/js/utils/behavior":39,"../../uswds-core/src/js/utils/sanitizer":44,"../../uswds-core/src/js/utils/select-or-matches":46,"receptor/keymap":10}],18:[function(require,module,exports){"use strict";const keymap=require("receptor/keymap");const behavior=require("../../uswds-core/src/js/utils/behavior");const select=require("../../uswds-core/src/js/utils/select");const selectOrMatches=require("../../uswds-core/src/js/utils/select-or-matches");const {prefix:PREFIX}=require("../../uswds-core/src/js/config");const {CLICK}=require("../../uswds-core/src/js/events");const activeElement=require("../../uswds-core/src/js/utils/active-element");const isIosDevice=require("../../uswds-core/src/js/utils/is-ios-device");const Sanitizer=require("../../uswds-core/src/js/utils/sanitizer");const DATE_PICKER_CLASS=`${PREFIX}-date-picker`;const DATE_PICKER_WRAPPER_CLASS=`${DATE_PICKER_CLASS}__wrapper`;const DATE_PICKER_INITIALIZED_CLASS=`${DATE_PICKER_CLASS}--initialized`;const DATE_PICKER_ACTIVE_CLASS=`${DATE_PICKER_CLASS}--active`;const DATE_PICKER_INTERNAL_INPUT_CLASS=`${DATE_PICKER_CLASS}__internal-input`;const DATE_PICKER_EXTERNAL_INPUT_CLASS=`${DATE_PICKER_CLASS}__external-input`;const DATE_PICKER_BUTTON_CLASS=`${DATE_PICKER_CLASS}__button`;const DATE_PICKER_CALENDAR_CLASS=`${DATE_PICKER_CLASS}__calendar`;const DATE_PICKER_STATUS_CLASS=`${DATE_PICKER_CLASS}__status`;const CALENDAR_DATE_CLASS=`${DATE_PICKER_CALENDAR_CLASS}__date`;const CALENDAR_DATE_FOCUSED_CLASS=`${CALENDAR_DATE_CLASS}--focused`;const CALENDAR_DATE_SELECTED_CLASS=`${CALENDAR_DATE_CLASS}--selected`;const CALENDAR_DATE_PREVIOUS_MONTH_CLASS=`${CALENDAR_DATE_CLASS}--previous-month`;const CALENDAR_DATE_CURRENT_MONTH_CLASS=`${CALENDAR_DATE_CLASS}--current-month`;const CALENDAR_DATE_NEXT_MONTH_CLASS=`${CALENDAR_DATE_CLASS}--next-month`;const CALENDAR_DATE_RANGE_DATE_CLASS=`${CALENDAR_DATE_CLASS}--range-date`;const CALENDAR_DATE_TODAY_CLASS=`${CALENDAR_DATE_CLASS}--today`;const CALENDAR_DATE_RANGE_DATE_START_CLASS=`${CALENDAR_DATE_CLASS}--range-date-start`;const CALENDAR_DATE_RANGE_DATE_END_CLASS=`${CALENDAR_DATE_CLASS}--range-date-end`;const CALENDAR_DATE_WITHIN_RANGE_CLASS=`${CALENDAR_DATE_CLASS}--within-range`;const CALENDAR_PREVIOUS_YEAR_CLASS=`${DATE_PICKER_CALENDAR_CLASS}__previous-year`;const CALENDAR_PREVIOUS_MONTH_CLASS=`${DATE_PICKER_CALENDAR_CLASS}__previous-month`;const CALENDAR_NEXT_YEAR_CLASS=`${DATE_PICKER_CALENDAR_CLASS}__next-year`;const CALENDAR_NEXT_MONTH_CLASS=`${DATE_PICKER_CALENDAR_CLASS}__next-month`;const CALENDAR_MONTH_SELECTION_CLASS=`${DATE_PICKER_CALENDAR_CLASS}__month-selection`;const CALENDAR_YEAR_SELECTION_CLASS=`${DATE_PICKER_CALENDAR_CLASS}__year-selection`;const CALENDAR_MONTH_CLASS=`${DATE_PICKER_CALENDAR_CLASS}__month`;const CALENDAR_MONTH_FOCUSED_CLASS=`${CALENDAR_MONTH_CLASS}--focused`;const CALENDAR_MONTH_SELECTED_CLASS=`${CALENDAR_MONTH_CLASS}--selected`;const CALENDAR_YEAR_CLASS=`${DATE_PICKER_CALENDAR_CLASS}__year`;const CALENDAR_YEAR_FOCUSED_CLASS=`${CALENDAR_YEAR_CLASS}--focused`;const CALENDAR_YEAR_SELECTED_CLASS=`${CALENDAR_YEAR_CLASS}--selected`;const CALENDAR_PREVIOUS_YEAR_CHUNK_CLASS=`${DATE_PICKER_CALENDAR_CLASS}__previous-year-chunk`;const CALENDAR_NEXT_YEAR_CHUNK_CLASS=`${DATE_PICKER_CALENDAR_CLASS}__next-year-chunk`;const CALENDAR_DATE_PICKER_CLASS=`${DATE_PICKER_CALENDAR_CLASS}__date-picker`;const CALENDAR_MONTH_PICKER_CLASS=`${DATE_PICKER_CALENDAR_CLASS}__month-picker`;const CALENDAR_YEAR_PICKER_CLASS=`${DATE_PICKER_CALENDAR_CLASS}__year-picker`;const CALENDAR_TABLE_CLASS=`${DATE_PICKER_CALENDAR_CLASS}__table`;const CALENDAR_ROW_CLASS=`${DATE_PICKER_CALENDAR_CLASS}__row`;const CALENDAR_CELL_CLASS=`${DATE_PICKER_CALENDAR_CLASS}__cell`;const CALENDAR_CELL_CENTER_ITEMS_CLASS=`${CALENDAR_CELL_CLASS}--center-items`;const CALENDAR_MONTH_LABEL_CLASS=`${DATE_PICKER_CALENDAR_CLASS}__month-label`;const CALENDAR_DAY_OF_WEEK_CLASS=`${DATE_PICKER_CALENDAR_CLASS}__day-of-week`;const DATE_PICKER=`.${DATE_PICKER_CLASS}`;const DATE_PICKER_BUTTON=`.${DATE_PICKER_BUTTON_CLASS}`;const DATE_PICKER_INTERNAL_INPUT=`.${DATE_PICKER_INTERNAL_INPUT_CLASS}`;const DATE_PICKER_EXTERNAL_INPUT=`.${DATE_PICKER_EXTERNAL_INPUT_CLASS}`;const DATE_PICKER_CALENDAR=`.${DATE_PICKER_CALENDAR_CLASS}`;const DATE_PICKER_STATUS=`.${DATE_PICKER_STATUS_CLASS}`;const CALENDAR_DATE=`.${CALENDAR_DATE_CLASS}`;const CALENDAR_DATE_FOCUSED=`.${CALENDAR_DATE_FOCUSED_CLASS}`;const CALENDAR_DATE_CURRENT_MONTH=`.${CALENDAR_DATE_CURRENT_MONTH_CLASS}`;const CALENDAR_PREVIOUS_YEAR=`.${CALENDAR_PREVIOUS_YEAR_CLASS}`;const CALENDAR_PREVIOUS_MONTH=`.${CALENDAR_PREVIOUS_MONTH_CLASS}`;const CALENDAR_NEXT_YEAR=`.${CALENDAR_NEXT_YEAR_CLASS}`;const CALENDAR_NEXT_MONTH=`.${CALENDAR_NEXT_MONTH_CLASS}`;const CALENDAR_YEAR_SELECTION=`.${CALENDAR_YEAR_SELECTION_CLASS}`;const CALENDAR_MONTH_SELECTION=`.${CALENDAR_MONTH_SELECTION_CLASS}`;const CALENDAR_MONTH=`.${CALENDAR_MONTH_CLASS}`;const CALENDAR_YEAR=`.${CALENDAR_YEAR_CLASS}`;const CALENDAR_PREVIOUS_YEAR_CHUNK=`.${CALENDAR_PREVIOUS_YEAR_CHUNK_CLASS}`;const CALENDAR_NEXT_YEAR_CHUNK=`.${CALENDAR_NEXT_YEAR_CHUNK_CLASS}`;const CALENDAR_DATE_PICKER=`.${CALENDAR_DATE_PICKER_CLASS}`;const CALENDAR_MONTH_PICKER=`.${CALENDAR_MONTH_PICKER_CLASS}`;const CALENDAR_YEAR_PICKER=`.${CALENDAR_YEAR_PICKER_CLASS}`;const CALENDAR_MONTH_FOCUSED=`.${CALENDAR_MONTH_FOCUSED_CLASS}`;const CALENDAR_YEAR_FOCUSED=`.${CALENDAR_YEAR_FOCUSED_CLASS}`;const VALIDATION_MESSAGE="Please enter a valid date";const MONTH_DATE_SEED=Array.from({length:12}).map((_,i)=>new Date(0,i));const DAY_OF_WEEK_DATE_SEED=Array.from({length:7}).map((_,i)=>new Date(0,0,i));const CALENDAR_LABELS_BY_LANG=new Map();const ENTER_KEYCODE=13;const YEAR_CHUNK=12;const DEFAULT_MIN_DATE="0000-01-01";const DEFAULT_EXTERNAL_DATE_FORMAT="MM/DD/YYYY";const INTERNAL_DATE_FORMAT="YYYY-MM-DD";const NOT_DISABLED_SELECTOR=":not([disabled])";const processFocusableSelectors=(...selectors)=>selectors.map((query)=>query+NOT_DISABLED_SELECTOR).join(", ");const DATE_PICKER_FOCUSABLE=processFocusableSelectors(CALENDAR_PREVIOUS_YEAR,CALENDAR_PREVIOUS_MONTH,CALENDAR_YEAR_SELECTION,CALENDAR_MONTH_SELECTION,CALENDAR_NEXT_YEAR,CALENDAR_NEXT_MONTH,CALENDAR_DATE_FOCUSED);const MONTH_PICKER_FOCUSABLE=processFocusableSelectors(CALENDAR_MONTH_FOCUSED);const YEAR_PICKER_FOCUSABLE=processFocusableSelectors(CALENDAR_PREVIOUS_YEAR_CHUNK,CALENDAR_NEXT_YEAR_CHUNK,CALENDAR_YEAR_FOCUSED);const keepDateWithinMonth=(dateToCheck,month)=>{if(month!==dateToCheck.getMonth())dateToCheck.setDate(0);return dateToCheck;};const setDate=(year,month,date)=>{const newDate=new Date(0);newDate.setFullYear(year,month,date);return newDate;};const today=()=>{const newDate=new Date();const day=newDate.getDate();const month=newDate.getMonth();const year=newDate.getFullYear();return setDate(year,month,day);};const startOfMonth=(date)=>{const newDate=new Date(0);newDate.setFullYear(date.getFullYear(),date.getMonth(),1);return newDate;};const lastDayOfMonth=(date)=>{const newDate=new Date(0);newDate.setFullYear(date.getFullYear(),date.getMonth()+1,0);return newDate;};const addDays=(_date,numDays)=>{const newDate=new Date(_date.getTime());newDate.setDate(newDate.getDate()+numDays);return newDate;};const subDays=(_date,numDays)=>addDays(_date,-numDays);const addWeeks=(_date,numWeeks)=>addDays(_date,numWeeks*7);const subWeeks=(_date,numWeeks)=>addWeeks(_date,-numWeeks);const startOfWeek=(_date)=>{const dayOfWeek=_date.getDay();return subDays(_date,dayOfWeek);};const endOfWeek=(_date)=>{const dayOfWeek=_date.getDay();return addDays(_date,6-dayOfWeek);};const addMonths=(_date,numMonths)=>{const newDate=new Date(_date.getTime());const dateMonth=(newDate.getMonth()+12+numMonths)%12;newDate.setMonth(newDate.getMonth()+numMonths);keepDateWithinMonth(newDate,dateMonth);return newDate;};const subMonths=(_date,numMonths)=>addMonths(_date,-numMonths);const addYears=(_date,numYears)=>addMonths(_date,numYears*12);const subYears=(_date,numYears)=>addYears(_date,-numYears);const setMonth=(_date,month)=>{const newDate=new Date(_date.getTime());newDate.setMonth(month);keepDateWithinMonth(newDate,month);return newDate;};const setYear=(_date,year)=>{const newDate=new Date(_date.getTime());const month=newDate.getMonth();newDate.setFullYear(year);keepDateWithinMonth(newDate,month);return newDate;};const min=(dateA,dateB)=>{let newDate=dateA;if(dateB{let newDate=dateA;if(dateB>dateA)newDate=dateB;return new Date(newDate.getTime());};const isSameYear=(dateA,dateB)=>dateA&&dateB&&dateA.getFullYear()===dateB.getFullYear();const isSameMonth=(dateA,dateB)=>isSameYear(dateA,dateB)&&dateA.getMonth()===dateB.getMonth();const isSameDay=(dateA,dateB)=>isSameMonth(dateA,dateB)&&dateA.getDate()===dateB.getDate();const keepDateBetweenMinAndMax=(date,minDate,maxDate)=>{let newDate=date;if(datemaxDate)newDate=maxDate;}return new Date(newDate.getTime());};const isDateWithinMinAndMax=(date,minDate,maxDate)=>date>=minDate&&(!maxDate||date<=maxDate);const isDatesMonthOutsideMinOrMax=(date,minDate,maxDate)=>lastDayOfMonth(date)maxDate;const isDatesYearOutsideMinOrMax=(date,minDate,maxDate)=>lastDayOfMonth(setMonth(date,11))maxDate;const setRangeDates=(date,rangeDate)=>{const rangeConclusionDate=date;const rangeStartDate=rangeDate&&min(rangeConclusionDate,rangeDate);const rangeEndDate=rangeDate&&max(rangeConclusionDate,rangeDate);const withinRangeStartDate=rangeDate&&addDays(rangeStartDate,1);const withinRangeEndDate=rangeDate&&subDays(rangeEndDate,1);return {rangeStartDate,rangeEndDate,withinRangeStartDate,withinRangeEndDate};};const parseDateString=(dateString,dateFormat=INTERNAL_DATE_FORMAT,adjustDate=false)=>{let date;let month;let day;let year;let parsed;if(dateString){let monthStr;let dayStr;let yearStr;if(dateFormat===DEFAULT_EXTERNAL_DATE_FORMAT)[monthStr,dayStr,yearStr]=dateString.split("/");else [yearStr,monthStr,dayStr]=dateString.split("-");if(yearStr){parsed=parseInt(yearStr,10);if(!Number.isNaN(parsed)){year=parsed;if(adjustDate){year=Math.max(0,year);if(yearStr.length<3){const currentYear=today().getFullYear();const currentYearStub=currentYear-currentYear%10**yearStr.length;year=currentYearStub+parsed;}}}}if(monthStr){parsed=parseInt(monthStr,10);if(!Number.isNaN(parsed)){month=parsed;if(adjustDate){month=Math.max(1,month);month=Math.min(12,month);}}}if(month&&dayStr&&year!=null){parsed=parseInt(dayStr,10);if(!Number.isNaN(parsed)){day=parsed;if(adjustDate){const lastDayOfTheMonth=setDate(year,month,0).getDate();day=Math.max(1,day);day=Math.min(lastDayOfTheMonth,day);}}}if(month&&day&&year!=null)date=setDate(year,month-1,day);}return date;};const formatDate=(date,dateFormat=INTERNAL_DATE_FORMAT)=>{const padZeros=(value,length)=>`0000${value}`.slice(-length);const month=date.getMonth()+1;const day=date.getDate();const year=date.getFullYear();if(dateFormat===DEFAULT_EXTERNAL_DATE_FORMAT)return [padZeros(month,2),padZeros(day,2),padZeros(year,4)].join("/");return [padZeros(year,4),padZeros(month,2),padZeros(day,2)].join("-");};const listToGridHtml=(htmlArray,rowSize)=>{const grid=[];let row=[];let i=0;while(i{tr.insertAdjacentElement("beforeend",element);});grid.push(tr);}return grid;};const createTableBody=(grid)=>{const tableBody=document.createElement("tbody");grid.forEach((element)=>{tableBody.insertAdjacentElement("beforeend",element);});return tableBody;};const changeElementValue=(el,value="")=>{const elementToChange=el;elementToChange.value=value;const event=new CustomEvent("change",{bubbles:true,cancelable:true,detail:{value}});elementToChange.dispatchEvent(event);};const getDatePickerContext=(el)=>{const datePickerEl=el.closest(DATE_PICKER);if(!datePickerEl)throw new Error(`Element is missing outer ${DATE_PICKER}`);const internalInputEl=datePickerEl.querySelector(DATE_PICKER_INTERNAL_INPUT);const externalInputEl=datePickerEl.querySelector(DATE_PICKER_EXTERNAL_INPUT);const calendarEl=datePickerEl.querySelector(DATE_PICKER_CALENDAR);const toggleBtnEl=datePickerEl.querySelector(DATE_PICKER_BUTTON);const statusEl=datePickerEl.querySelector(DATE_PICKER_STATUS);const firstYearChunkEl=datePickerEl.querySelector(CALENDAR_YEAR);const inputDate=parseDateString(externalInputEl.value,DEFAULT_EXTERNAL_DATE_FORMAT,true);const selectedDate=parseDateString(internalInputEl.value);const calendarDate=parseDateString(calendarEl.dataset.value);const minDate=parseDateString(datePickerEl.dataset.minDate);const maxDate=parseDateString(datePickerEl.dataset.maxDate);const rangeDate=parseDateString(datePickerEl.dataset.rangeDate);const defaultDate=parseDateString(datePickerEl.dataset.defaultDate);if(minDate&&maxDate&&minDate>maxDate)throw new Error("Minimum date cannot be after maximum date");const lang=document.documentElement.lang||"en";if(!CALENDAR_LABELS_BY_LANG.has(lang))CALENDAR_LABELS_BY_LANG.set(lang,{monthLabels:MONTH_DATE_SEED.map((date)=>date.toLocaleString(lang,{month:"long"})),dayOfWeeklabels:DAY_OF_WEEK_DATE_SEED.map((date)=>date.toLocaleString(lang,{weekday:"long"})),dayOfWeeksAbv:DAY_OF_WEEK_DATE_SEED.map((date)=>date.toLocaleString(lang,{weekday:"narrow"}))});const {monthLabels,dayOfWeeklabels,dayOfWeeksAbv}=CALENDAR_LABELS_BY_LANG.get(lang);return {calendarDate,minDate,toggleBtnEl,selectedDate,maxDate,firstYearChunkEl,datePickerEl,inputDate,internalInputEl,externalInputEl,calendarEl,rangeDate,defaultDate,statusEl,monthLabels,dayOfWeeklabels,dayOfWeeksAbv};};const disable=(el)=>{const {externalInputEl,toggleBtnEl}=getDatePickerContext(el);toggleBtnEl.disabled=true;externalInputEl.disabled=true;};const ariaDisable=(el)=>{const {externalInputEl,toggleBtnEl}=getDatePickerContext(el);toggleBtnEl.setAttribute("aria-disabled",true);externalInputEl.setAttribute("aria-disabled",true);externalInputEl.setAttribute("readonly","");};const enable=(el)=>{const {externalInputEl,toggleBtnEl}=getDatePickerContext(el);toggleBtnEl.disabled=false;toggleBtnEl.removeAttribute("aria-disabled");externalInputEl.disabled=false;externalInputEl.removeAttribute("aria-disabled");externalInputEl.removeAttribute("readonly");};const isDateInputInvalid=(el)=>{const {externalInputEl,minDate,maxDate}=getDatePickerContext(el);const dateString=externalInputEl.value;let isInvalid=false;if(dateString){isInvalid=true;const dateStringParts=dateString.split("/");const [month,day,year]=dateStringParts.map((str)=>{let value;const parsed=parseInt(str,10);if(!Number.isNaN(parsed))value=parsed;return value;});if(month&&day&&year!=null){const checkDate=setDate(year,month-1,day);if(checkDate.getMonth()===month-1&&checkDate.getDate()===day&&checkDate.getFullYear()===year&&dateStringParts[2].length===4&&isDateWithinMinAndMax(checkDate,minDate,maxDate))isInvalid=false;}}return isInvalid;};const validateDateInput=(el)=>{const {externalInputEl}=getDatePickerContext(el);const isInvalid=isDateInputInvalid(externalInputEl);if(isInvalid&&!externalInputEl.validationMessage)externalInputEl.setCustomValidity(VALIDATION_MESSAGE);if(!isInvalid&&externalInputEl.validationMessage===VALIDATION_MESSAGE)externalInputEl.setCustomValidity("");};const reconcileInputValues=(el)=>{const {internalInputEl,inputDate}=getDatePickerContext(el);let newValue="";if(inputDate&&!isDateInputInvalid(el))newValue=formatDate(inputDate);if(internalInputEl.value!==newValue)changeElementValue(internalInputEl,newValue);};const setCalendarValue=(el,dateString)=>{const parsedDate=parseDateString(dateString);if(parsedDate){const formattedDate=formatDate(parsedDate,DEFAULT_EXTERNAL_DATE_FORMAT);const {datePickerEl,internalInputEl,externalInputEl}=getDatePickerContext(el);changeElementValue(internalInputEl,dateString);changeElementValue(externalInputEl,formattedDate);validateDateInput(datePickerEl);}};const enhanceDatePicker=(el)=>{const datePickerEl=el.closest(DATE_PICKER);const {defaultValue}=datePickerEl.dataset;const internalInputEl=datePickerEl.querySelector(`input`);if(!internalInputEl)throw new Error(`${DATE_PICKER} is missing inner input`);if(internalInputEl.value)internalInputEl.value="";const minDate=parseDateString(datePickerEl.dataset.minDate||internalInputEl.getAttribute("min"));datePickerEl.dataset.minDate=minDate?formatDate(minDate):DEFAULT_MIN_DATE;const maxDate=parseDateString(datePickerEl.dataset.maxDate||internalInputEl.getAttribute("max"));if(maxDate)datePickerEl.dataset.maxDate=formatDate(maxDate);const calendarWrapper=document.createElement("div");calendarWrapper.classList.add(DATE_PICKER_WRAPPER_CLASS);const externalInputEl=internalInputEl.cloneNode();externalInputEl.classList.add(DATE_PICKER_EXTERNAL_INPUT_CLASS);externalInputEl.type="text";calendarWrapper.appendChild(externalInputEl);calendarWrapper.insertAdjacentHTML("beforeend",Sanitizer.escapeHTML`
`);internalInputEl.setAttribute("aria-hidden","true");internalInputEl.setAttribute("tabindex","-1");internalInputEl.style.display="none";internalInputEl.classList.add(DATE_PICKER_INTERNAL_INPUT_CLASS);internalInputEl.removeAttribute("id");internalInputEl.removeAttribute("name");internalInputEl.required=false;datePickerEl.appendChild(calendarWrapper);datePickerEl.classList.add(DATE_PICKER_INITIALIZED_CLASS);if(defaultValue)setCalendarValue(datePickerEl,defaultValue);if(internalInputEl.disabled){disable(datePickerEl);internalInputEl.disabled=false;}if(internalInputEl.hasAttribute("aria-disabled")){ariaDisable(datePickerEl);internalInputEl.removeAttribute("aria-disabled");}};const renderCalendar=(el,_dateToDisplay)=>{const {datePickerEl,calendarEl,statusEl,selectedDate,maxDate,minDate,rangeDate,monthLabels,dayOfWeeklabels,dayOfWeeksAbv}=getDatePickerContext(el);const todaysDate=today();let dateToDisplay=_dateToDisplay||todaysDate;const calendarWasHidden=calendarEl.hidden;const focusedDate=addDays(dateToDisplay,0);const focusedMonth=dateToDisplay.getMonth();const focusedYear=dateToDisplay.getFullYear();const prevMonth=subMonths(dateToDisplay,1);const nextMonth=addMonths(dateToDisplay,1);const currentFormattedDate=formatDate(dateToDisplay);const firstOfMonth=startOfMonth(dateToDisplay);const prevButtonsDisabled=isSameMonth(dateToDisplay,minDate);const nextButtonsDisabled=isSameMonth(dateToDisplay,maxDate);const {rangeStartDate,rangeEndDate,withinRangeStartDate,withinRangeEndDate}=setRangeDates(selectedDate||dateToDisplay,rangeDate);const monthLabel=monthLabels[focusedMonth];const generateDateHtml=(dateToRender)=>{const classes=[CALENDAR_DATE_CLASS];const day=dateToRender.getDate();const month=dateToRender.getMonth();const year=dateToRender.getFullYear();const dayOfWeek=dateToRender.getDay();const formattedDate=formatDate(dateToRender);let tabindex="-1";const isDisabled=!isDateWithinMinAndMax(dateToRender,minDate,maxDate);const isSelected=isSameDay(dateToRender,selectedDate);if(isSameMonth(dateToRender,prevMonth))classes.push(CALENDAR_DATE_PREVIOUS_MONTH_CLASS);if(isSameMonth(dateToRender,focusedDate))classes.push(CALENDAR_DATE_CURRENT_MONTH_CLASS);if(isSameMonth(dateToRender,nextMonth))classes.push(CALENDAR_DATE_NEXT_MONTH_CLASS);if(isSelected)classes.push(CALENDAR_DATE_SELECTED_CLASS);if(isSameDay(dateToRender,todaysDate))classes.push(CALENDAR_DATE_TODAY_CLASS);if(rangeDate){if(isSameDay(dateToRender,rangeDate))classes.push(CALENDAR_DATE_RANGE_DATE_CLASS);if(isSameDay(dateToRender,rangeStartDate))classes.push(CALENDAR_DATE_RANGE_DATE_START_CLASS);if(isSameDay(dateToRender,rangeEndDate))classes.push(CALENDAR_DATE_RANGE_DATE_END_CLASS);if(isDateWithinMinAndMax(dateToRender,withinRangeStartDate,withinRangeEndDate))classes.push(CALENDAR_DATE_WITHIN_RANGE_CLASS);}if(isSameDay(dateToRender,focusedDate)){tabindex="0";classes.push(CALENDAR_DATE_FOCUSED_CLASS);}const monthStr=monthLabels[month];const dayStr=dayOfWeeklabels[dayOfWeek];const btn=document.createElement("button");btn.setAttribute("type","button");btn.setAttribute("tabindex",tabindex);btn.setAttribute("class",classes.join(" "));btn.setAttribute("data-day",day);btn.setAttribute("data-month",month+1);btn.setAttribute("data-year",year);btn.setAttribute("data-value",formattedDate);btn.setAttribute("aria-label",Sanitizer.escapeHTML`${day} ${monthStr} ${year} ${dayStr}`);btn.setAttribute("aria-selected",isSelected?"true":"false");if(isDisabled===true)btn.disabled=true;btn.textContent=day;return btn;};dateToDisplay=startOfWeek(firstOfMonth);const days=[];while(days.length<28||dateToDisplay.getMonth()===focusedMonth||days.length%7!==0){days.push(generateDateHtml(dateToDisplay));dateToDisplay=addDays(dateToDisplay,1);}const datesGrid=listToGridHtml(days,7);const newCalendar=calendarEl.cloneNode();newCalendar.dataset.value=currentFormattedDate;newCalendar.style.top=`${datePickerEl.offsetHeight}px`;newCalendar.hidden=false;newCalendar.innerHTML=Sanitizer.escapeHTML`
`;const table=document.createElement("table");table.setAttribute("class",CALENDAR_TABLE_CLASS);const tableHead=document.createElement("thead");table.insertAdjacentElement("beforeend",tableHead);const tableHeadRow=document.createElement("tr");tableHead.insertAdjacentElement("beforeend",tableHeadRow);dayOfWeeklabels.forEach((dayOfWeek,i)=>{const th=document.createElement("th");th.setAttribute("class",CALENDAR_DAY_OF_WEEK_CLASS);th.setAttribute("scope","col");th.setAttribute("aria-label",dayOfWeek);th.textContent=dayOfWeeksAbv[i];tableHeadRow.insertAdjacentElement("beforeend",th);});const tableBody=createTableBody(datesGrid);table.insertAdjacentElement("beforeend",tableBody);const datePickerCalendarContainer=newCalendar.querySelector(CALENDAR_DATE_PICKER);datePickerCalendarContainer.insertAdjacentElement("beforeend",table);calendarEl.parentNode.replaceChild(newCalendar,calendarEl);datePickerEl.classList.add(DATE_PICKER_ACTIVE_CLASS);const statuses=[];if(isSameDay(selectedDate,focusedDate))statuses.push("Selected date");if(calendarWasHidden){statuses.push("You can navigate by day using left and right arrows","Weeks by using up and down arrows","Months by using page up and page down keys","Years by using shift plus page up and shift plus page down","Home and end keys navigate to the beginning and end of a week");statusEl.textContent="";}else statuses.push(`${monthLabel} ${focusedYear}`);statusEl.textContent=statuses.join(". ");return newCalendar;};const displayPreviousYear=(_buttonEl)=>{if(_buttonEl.disabled)return;const {calendarEl,calendarDate,minDate,maxDate}=getDatePickerContext(_buttonEl);let date=subYears(calendarDate,1);date=keepDateBetweenMinAndMax(date,minDate,maxDate);const newCalendar=renderCalendar(calendarEl,date);let nextToFocus=newCalendar.querySelector(CALENDAR_PREVIOUS_YEAR);if(nextToFocus.disabled)nextToFocus=newCalendar.querySelector(CALENDAR_DATE_PICKER);nextToFocus.focus();};const displayPreviousMonth=(_buttonEl)=>{if(_buttonEl.disabled)return;const {calendarEl,calendarDate,minDate,maxDate}=getDatePickerContext(_buttonEl);let date=subMonths(calendarDate,1);date=keepDateBetweenMinAndMax(date,minDate,maxDate);const newCalendar=renderCalendar(calendarEl,date);let nextToFocus=newCalendar.querySelector(CALENDAR_PREVIOUS_MONTH);if(nextToFocus.disabled)nextToFocus=newCalendar.querySelector(CALENDAR_DATE_PICKER);nextToFocus.focus();};const displayNextMonth=(_buttonEl)=>{if(_buttonEl.disabled)return;const {calendarEl,calendarDate,minDate,maxDate}=getDatePickerContext(_buttonEl);let date=addMonths(calendarDate,1);date=keepDateBetweenMinAndMax(date,minDate,maxDate);const newCalendar=renderCalendar(calendarEl,date);let nextToFocus=newCalendar.querySelector(CALENDAR_NEXT_MONTH);if(nextToFocus.disabled)nextToFocus=newCalendar.querySelector(CALENDAR_DATE_PICKER);nextToFocus.focus();};const displayNextYear=(_buttonEl)=>{if(_buttonEl.disabled)return;const {calendarEl,calendarDate,minDate,maxDate}=getDatePickerContext(_buttonEl);let date=addYears(calendarDate,1);date=keepDateBetweenMinAndMax(date,minDate,maxDate);const newCalendar=renderCalendar(calendarEl,date);let nextToFocus=newCalendar.querySelector(CALENDAR_NEXT_YEAR);if(nextToFocus.disabled)nextToFocus=newCalendar.querySelector(CALENDAR_DATE_PICKER);nextToFocus.focus();};const hideCalendar=(el)=>{const {datePickerEl,calendarEl,statusEl}=getDatePickerContext(el);datePickerEl.classList.remove(DATE_PICKER_ACTIVE_CLASS);calendarEl.hidden=true;statusEl.textContent="";};const selectDate=(calendarDateEl)=>{if(calendarDateEl.disabled)return;const {datePickerEl,externalInputEl}=getDatePickerContext(calendarDateEl);setCalendarValue(calendarDateEl,calendarDateEl.dataset.value);hideCalendar(datePickerEl);externalInputEl.focus();};const toggleCalendar=(el)=>{if(el.disabled||el.hasAttribute("aria-disabled"))return;const {calendarEl,inputDate,minDate,maxDate,defaultDate}=getDatePickerContext(el);if(calendarEl.hidden){const dateToDisplay=keepDateBetweenMinAndMax(inputDate||defaultDate||today(),minDate,maxDate);const newCalendar=renderCalendar(calendarEl,dateToDisplay);newCalendar.querySelector(CALENDAR_DATE_FOCUSED).focus();}else hideCalendar(el);};const updateCalendarIfVisible=(el)=>{const {calendarEl,inputDate,minDate,maxDate}=getDatePickerContext(el);const calendarShown=!calendarEl.hidden;if(calendarShown&&inputDate){const dateToDisplay=keepDateBetweenMinAndMax(inputDate,minDate,maxDate);renderCalendar(calendarEl,dateToDisplay);}};const displayMonthSelection=(el,monthToDisplay)=>{const {calendarEl,statusEl,calendarDate,minDate,maxDate,monthLabels}=getDatePickerContext(el);const selectedMonth=calendarDate.getMonth();const focusedMonth=monthToDisplay==null?selectedMonth:monthToDisplay;const months=monthLabels.map((month,index)=>{const monthToCheck=setMonth(calendarDate,index);const isDisabled=isDatesMonthOutsideMinOrMax(monthToCheck,minDate,maxDate);let tabindex="-1";const classes=[CALENDAR_MONTH_CLASS];const isSelected=index===selectedMonth;if(index===focusedMonth){tabindex="0";classes.push(CALENDAR_MONTH_FOCUSED_CLASS);}if(isSelected)classes.push(CALENDAR_MONTH_SELECTED_CLASS);const btn=document.createElement("button");btn.setAttribute("type","button");btn.setAttribute("tabindex",tabindex);btn.setAttribute("class",classes.join(" "));btn.setAttribute("data-value",index);btn.setAttribute("data-label",month);btn.setAttribute("aria-selected",isSelected?"true":"false");if(isDisabled===true)btn.disabled=true;btn.textContent=month;return btn;});const monthsHtml=document.createElement("div");monthsHtml.setAttribute("tabindex","-1");monthsHtml.setAttribute("class",CALENDAR_MONTH_PICKER_CLASS);const table=document.createElement("table");table.setAttribute("class",CALENDAR_TABLE_CLASS);table.setAttribute("role","presentation");const monthsGrid=listToGridHtml(months,3);const tableBody=createTableBody(monthsGrid);table.insertAdjacentElement("beforeend",tableBody);monthsHtml.insertAdjacentElement("beforeend",table);const newCalendar=calendarEl.cloneNode();newCalendar.insertAdjacentElement("beforeend",monthsHtml);calendarEl.parentNode.replaceChild(newCalendar,calendarEl);statusEl.textContent="Select a month.";return newCalendar;};const selectMonth=(monthEl)=>{if(monthEl.disabled)return;const {calendarEl,calendarDate,minDate,maxDate}=getDatePickerContext(monthEl);const selectedMonth=parseInt(monthEl.dataset.value,10);let date=setMonth(calendarDate,selectedMonth);date=keepDateBetweenMinAndMax(date,minDate,maxDate);const newCalendar=renderCalendar(calendarEl,date);newCalendar.querySelector(CALENDAR_DATE_FOCUSED).focus();};const displayYearSelection=(el,yearToDisplay)=>{const {calendarEl,statusEl,calendarDate,minDate,maxDate}=getDatePickerContext(el);const selectedYear=calendarDate.getFullYear();const focusedYear=yearToDisplay==null?selectedYear:yearToDisplay;let yearToChunk=focusedYear;yearToChunk-=yearToChunk%YEAR_CHUNK;yearToChunk=Math.max(0,yearToChunk);const prevYearChunkDisabled=isDatesYearOutsideMinOrMax(setYear(calendarDate,yearToChunk-1),minDate,maxDate);const nextYearChunkDisabled=isDatesYearOutsideMinOrMax(setYear(calendarDate,yearToChunk+YEAR_CHUNK),minDate,maxDate);const years=[];let yearIndex=yearToChunk;while(years.length{if(el.disabled)return;const {calendarEl,calendarDate,minDate,maxDate}=getDatePickerContext(el);const yearEl=calendarEl.querySelector(CALENDAR_YEAR_FOCUSED);const selectedYear=parseInt(yearEl.textContent,10);let adjustedYear=selectedYear-YEAR_CHUNK;adjustedYear=Math.max(0,adjustedYear);const date=setYear(calendarDate,adjustedYear);const cappedDate=keepDateBetweenMinAndMax(date,minDate,maxDate);const newCalendar=displayYearSelection(calendarEl,cappedDate.getFullYear());let nextToFocus=newCalendar.querySelector(CALENDAR_PREVIOUS_YEAR_CHUNK);if(nextToFocus.disabled)nextToFocus=newCalendar.querySelector(CALENDAR_YEAR_PICKER);nextToFocus.focus();};const displayNextYearChunk=(el)=>{if(el.disabled)return;const {calendarEl,calendarDate,minDate,maxDate}=getDatePickerContext(el);const yearEl=calendarEl.querySelector(CALENDAR_YEAR_FOCUSED);const selectedYear=parseInt(yearEl.textContent,10);let adjustedYear=selectedYear+YEAR_CHUNK;adjustedYear=Math.max(0,adjustedYear);const date=setYear(calendarDate,adjustedYear);const cappedDate=keepDateBetweenMinAndMax(date,minDate,maxDate);const newCalendar=displayYearSelection(calendarEl,cappedDate.getFullYear());let nextToFocus=newCalendar.querySelector(CALENDAR_NEXT_YEAR_CHUNK);if(nextToFocus.disabled)nextToFocus=newCalendar.querySelector(CALENDAR_YEAR_PICKER);nextToFocus.focus();};const selectYear=(yearEl)=>{if(yearEl.disabled)return;const {calendarEl,calendarDate,minDate,maxDate}=getDatePickerContext(yearEl);const selectedYear=parseInt(yearEl.innerHTML,10);let date=setYear(calendarDate,selectedYear);date=keepDateBetweenMinAndMax(date,minDate,maxDate);const newCalendar=renderCalendar(calendarEl,date);newCalendar.querySelector(CALENDAR_DATE_FOCUSED).focus();};const handleEscapeFromCalendar=(event)=>{const {datePickerEl,externalInputEl}=getDatePickerContext(event.target);hideCalendar(datePickerEl);externalInputEl.focus();event.preventDefault();};const adjustCalendar=(adjustDateFn)=>(event)=>{const {calendarEl,calendarDate,minDate,maxDate}=getDatePickerContext(event.target);const date=adjustDateFn(calendarDate);const cappedDate=keepDateBetweenMinAndMax(date,minDate,maxDate);if(!isSameDay(calendarDate,cappedDate)){const newCalendar=renderCalendar(calendarEl,cappedDate);newCalendar.querySelector(CALENDAR_DATE_FOCUSED).focus();}event.preventDefault();};const handleUpFromDate=adjustCalendar((date)=>subWeeks(date,1));const handleDownFromDate=adjustCalendar((date)=>addWeeks(date,1));const handleLeftFromDate=adjustCalendar((date)=>subDays(date,1));const handleRightFromDate=adjustCalendar((date)=>addDays(date,1));const handleHomeFromDate=adjustCalendar((date)=>startOfWeek(date));const handleEndFromDate=adjustCalendar((date)=>endOfWeek(date));const handlePageDownFromDate=adjustCalendar((date)=>addMonths(date,1));const handlePageUpFromDate=adjustCalendar((date)=>subMonths(date,1));const handleShiftPageDownFromDate=adjustCalendar((date)=>addYears(date,1));const handleShiftPageUpFromDate=adjustCalendar((date)=>subYears(date,1));const handleMouseoverFromDate=(dateEl)=>{if(dateEl.disabled)return;const hoverDate=parseDateString(dateEl.dataset.value);const {calendarEl,selectedDate,rangeDate}=getDatePickerContext(dateEl);if(selectedDate)return;const {withinRangeStartDate,withinRangeEndDate}=setRangeDates(hoverDate,rangeDate);const dateButtons=calendarEl.querySelectorAll(`.${CALENDAR_DATE_CURRENT_MONTH_CLASS}`);dateButtons.forEach((button)=>{const buttonDate=parseDateString(button.dataset.value);if(isDateWithinMinAndMax(buttonDate,withinRangeStartDate,withinRangeEndDate))button.classList.add(CALENDAR_DATE_WITHIN_RANGE_CLASS);else button.classList.remove(CALENDAR_DATE_WITHIN_RANGE_CLASS);});};const adjustMonthSelectionScreen=(adjustMonthFn)=>(event)=>{const monthEl=event.target;const selectedMonth=parseInt(monthEl.dataset.value,10);const {calendarEl,calendarDate,minDate,maxDate}=getDatePickerContext(monthEl);const currentDate=setMonth(calendarDate,selectedMonth);let adjustedMonth=adjustMonthFn(selectedMonth);adjustedMonth=Math.max(0,Math.min(11,adjustedMonth));const date=setMonth(calendarDate,adjustedMonth);const cappedDate=keepDateBetweenMinAndMax(date,minDate,maxDate);if(!isSameMonth(currentDate,cappedDate)){const newCalendar=displayMonthSelection(calendarEl,cappedDate.getMonth());newCalendar.querySelector(CALENDAR_MONTH_FOCUSED).focus();}event.preventDefault();};const handleUpFromMonth=adjustMonthSelectionScreen((month)=>month-3);const handleDownFromMonth=adjustMonthSelectionScreen((month)=>month+3);const handleLeftFromMonth=adjustMonthSelectionScreen((month)=>month-1);const handleRightFromMonth=adjustMonthSelectionScreen((month)=>month+1);const handleHomeFromMonth=adjustMonthSelectionScreen((month)=>month-month%3);const handleEndFromMonth=adjustMonthSelectionScreen((month)=>month+2-month%3);const handlePageDownFromMonth=adjustMonthSelectionScreen(()=>11);const handlePageUpFromMonth=adjustMonthSelectionScreen(()=>0);const adjustYearSelectionScreen=(adjustYearFn)=>(event)=>{const yearEl=event.target;const selectedYear=parseInt(yearEl.dataset.value,10);const {calendarEl,calendarDate,minDate,maxDate}=getDatePickerContext(yearEl);const currentDate=setYear(calendarDate,selectedYear);let adjustedYear=adjustYearFn(selectedYear);adjustedYear=Math.max(0,adjustedYear);const date=setYear(calendarDate,adjustedYear);const cappedDate=keepDateBetweenMinAndMax(date,minDate,maxDate);if(!isSameYear(currentDate,cappedDate)){const newCalendar=displayYearSelection(calendarEl,cappedDate.getFullYear());newCalendar.querySelector(CALENDAR_YEAR_FOCUSED).focus();}event.preventDefault();};const handleUpFromYear=adjustYearSelectionScreen((year)=>year-3);const handleDownFromYear=adjustYearSelectionScreen((year)=>year+3);const handleLeftFromYear=adjustYearSelectionScreen((year)=>year-1);const handleRightFromYear=adjustYearSelectionScreen((year)=>year+1);const handleHomeFromYear=adjustYearSelectionScreen((year)=>year-year%3);const handleEndFromYear=adjustYearSelectionScreen((year)=>year+2-year%3);const handlePageUpFromYear=adjustYearSelectionScreen((year)=>year-YEAR_CHUNK);const handlePageDownFromYear=adjustYearSelectionScreen((year)=>year+YEAR_CHUNK);const tabHandler=(focusable)=>{const getFocusableContext=(el)=>{const {calendarEl}=getDatePickerContext(el);const focusableElements=select(focusable,calendarEl);const firstTabIndex=0;const lastTabIndex=focusableElements.length-1;const firstTabStop=focusableElements[firstTabIndex];const lastTabStop=focusableElements[lastTabIndex];const focusIndex=focusableElements.indexOf(activeElement());const isLastTab=focusIndex===lastTabIndex;const isFirstTab=focusIndex===firstTabIndex;const isNotFound=focusIndex===-1;return {focusableElements,isNotFound,firstTabStop,isFirstTab,lastTabStop,isLastTab};};return {tabAhead(event){const {firstTabStop,isLastTab,isNotFound}=getFocusableContext(event.target);if(isLastTab||isNotFound){event.preventDefault();firstTabStop.focus();}},tabBack(event){const {lastTabStop,isFirstTab,isNotFound}=getFocusableContext(event.target);if(isFirstTab||isNotFound){event.preventDefault();lastTabStop.focus();}}};};const datePickerTabEventHandler=tabHandler(DATE_PICKER_FOCUSABLE);const monthPickerTabEventHandler=tabHandler(MONTH_PICKER_FOCUSABLE);const yearPickerTabEventHandler=tabHandler(YEAR_PICKER_FOCUSABLE);const datePickerEvents={[CLICK]:{[DATE_PICKER_BUTTON](){toggleCalendar(this);},[CALENDAR_DATE](){selectDate(this);},[CALENDAR_MONTH](){selectMonth(this);},[CALENDAR_YEAR](){selectYear(this);},[CALENDAR_PREVIOUS_MONTH](){displayPreviousMonth(this);},[CALENDAR_NEXT_MONTH](){displayNextMonth(this);},[CALENDAR_PREVIOUS_YEAR](){displayPreviousYear(this);},[CALENDAR_NEXT_YEAR](){displayNextYear(this);},[CALENDAR_PREVIOUS_YEAR_CHUNK](){displayPreviousYearChunk(this);},[CALENDAR_NEXT_YEAR_CHUNK](){displayNextYearChunk(this);},[CALENDAR_MONTH_SELECTION](){const newCalendar=displayMonthSelection(this);newCalendar.querySelector(CALENDAR_MONTH_FOCUSED).focus();},[CALENDAR_YEAR_SELECTION](){const newCalendar=displayYearSelection(this);newCalendar.querySelector(CALENDAR_YEAR_FOCUSED).focus();}},keyup:{[DATE_PICKER_CALENDAR](event){const keydown=this.dataset.keydownKeyCode;if(`${event.keyCode}`!==keydown)event.preventDefault();}},keydown:{[DATE_PICKER_EXTERNAL_INPUT](event){if(event.keyCode===ENTER_KEYCODE)validateDateInput(this);},[CALENDAR_DATE]:keymap({Up:handleUpFromDate,ArrowUp:handleUpFromDate,Down:handleDownFromDate,ArrowDown:handleDownFromDate,Left:handleLeftFromDate,ArrowLeft:handleLeftFromDate,Right:handleRightFromDate,ArrowRight:handleRightFromDate,Home:handleHomeFromDate,End:handleEndFromDate,PageDown:handlePageDownFromDate,PageUp:handlePageUpFromDate,"Shift+PageDown":handleShiftPageDownFromDate,"Shift+PageUp":handleShiftPageUpFromDate,Tab:datePickerTabEventHandler.tabAhead}),[CALENDAR_DATE_PICKER]:keymap({Tab:datePickerTabEventHandler.tabAhead,"Shift+Tab":datePickerTabEventHandler.tabBack}),[CALENDAR_MONTH]:keymap({Up:handleUpFromMonth,ArrowUp:handleUpFromMonth,Down:handleDownFromMonth,ArrowDown:handleDownFromMonth,Left:handleLeftFromMonth,ArrowLeft:handleLeftFromMonth,Right:handleRightFromMonth,ArrowRight:handleRightFromMonth,Home:handleHomeFromMonth,End:handleEndFromMonth,PageDown:handlePageDownFromMonth,PageUp:handlePageUpFromMonth}),[CALENDAR_MONTH_PICKER]:keymap({Tab:monthPickerTabEventHandler.tabAhead,"Shift+Tab":monthPickerTabEventHandler.tabBack}),[CALENDAR_YEAR]:keymap({Up:handleUpFromYear,ArrowUp:handleUpFromYear,Down:handleDownFromYear,ArrowDown:handleDownFromYear,Left:handleLeftFromYear,ArrowLeft:handleLeftFromYear,Right:handleRightFromYear,ArrowRight:handleRightFromYear,Home:handleHomeFromYear,End:handleEndFromYear,PageDown:handlePageDownFromYear,PageUp:handlePageUpFromYear}),[CALENDAR_YEAR_PICKER]:keymap({Tab:yearPickerTabEventHandler.tabAhead,"Shift+Tab":yearPickerTabEventHandler.tabBack}),[DATE_PICKER_CALENDAR](event){this.dataset.keydownKeyCode=event.keyCode;},[DATE_PICKER](event){const keyMap=keymap({Escape:handleEscapeFromCalendar});keyMap(event);}},focusout:{[DATE_PICKER_EXTERNAL_INPUT](){validateDateInput(this);},[DATE_PICKER](event){if(!this.contains(event.relatedTarget))hideCalendar(this);}},input:{[DATE_PICKER_EXTERNAL_INPUT](){reconcileInputValues(this);updateCalendarIfVisible(this);}}};if(!isIosDevice())datePickerEvents.mouseover={[CALENDAR_DATE_CURRENT_MONTH](){handleMouseoverFromDate(this);}};const datePicker=behavior(datePickerEvents,{init(root){selectOrMatches(DATE_PICKER,root).forEach((datePickerEl)=>{enhanceDatePicker(datePickerEl);});},getDatePickerContext,disable,ariaDisable,enable,isDateInputInvalid,setCalendarValue,validateDateInput,renderCalendar,updateCalendarIfVisible});module.exports=datePicker;},{"../../uswds-core/src/js/config":34,"../../uswds-core/src/js/events":35,"../../uswds-core/src/js/utils/active-element":38,"../../uswds-core/src/js/utils/behavior":39,"../../uswds-core/src/js/utils/is-ios-device":43,"../../uswds-core/src/js/utils/sanitizer":44,"../../uswds-core/src/js/utils/select":47,"../../uswds-core/src/js/utils/select-or-matches":46,"receptor/keymap":10}],19:[function(require,module,exports){"use strict";const behavior=require("../../uswds-core/src/js/utils/behavior");const select=require("../../uswds-core/src/js/utils/select");const selectOrMatches=require("../../uswds-core/src/js/utils/select-or-matches");const {prefix:PREFIX}=require("../../uswds-core/src/js/config");const {getDatePickerContext,isDateInputInvalid,updateCalendarIfVisible}=require("../../usa-date-picker/src/index");const DATE_PICKER_CLASS=`${PREFIX}-date-picker`;const DATE_RANGE_PICKER_CLASS=`${PREFIX}-date-range-picker`;const DATE_RANGE_PICKER_RANGE_START_CLASS=`${DATE_RANGE_PICKER_CLASS}__range-start`;const DATE_RANGE_PICKER_RANGE_END_CLASS=`${DATE_RANGE_PICKER_CLASS}__range-end`;const DATE_PICKER=`.${DATE_PICKER_CLASS}`;const DATE_RANGE_PICKER=`.${DATE_RANGE_PICKER_CLASS}`;const DATE_RANGE_PICKER_RANGE_START=`.${DATE_RANGE_PICKER_RANGE_START_CLASS}`;const DATE_RANGE_PICKER_RANGE_END=`.${DATE_RANGE_PICKER_RANGE_END_CLASS}`;const DEFAULT_MIN_DATE="0000-01-01";const getDateRangePickerContext=(el)=>{const dateRangePickerEl=el.closest(DATE_RANGE_PICKER);if(!dateRangePickerEl)throw new Error(`Element is missing outer ${DATE_RANGE_PICKER}`);const rangeStartEl=dateRangePickerEl.querySelector(DATE_RANGE_PICKER_RANGE_START);const rangeEndEl=dateRangePickerEl.querySelector(DATE_RANGE_PICKER_RANGE_END);return {dateRangePickerEl,rangeStartEl,rangeEndEl};};const handleRangeStartUpdate=(el)=>{const {dateRangePickerEl,rangeStartEl,rangeEndEl}=getDateRangePickerContext(el);const {internalInputEl}=getDatePickerContext(rangeStartEl);const updatedDate=internalInputEl.value;if(updatedDate&&!isDateInputInvalid(internalInputEl)){rangeEndEl.dataset.minDate=updatedDate;rangeEndEl.dataset.rangeDate=updatedDate;rangeEndEl.dataset.defaultDate=updatedDate;}else{rangeEndEl.dataset.minDate=dateRangePickerEl.dataset.minDate||"";rangeEndEl.dataset.rangeDate="";rangeEndEl.dataset.defaultDate="";}updateCalendarIfVisible(rangeEndEl);};const handleRangeEndUpdate=(el)=>{const {dateRangePickerEl,rangeStartEl,rangeEndEl}=getDateRangePickerContext(el);const {internalInputEl}=getDatePickerContext(rangeEndEl);const updatedDate=internalInputEl.value;if(updatedDate&&!isDateInputInvalid(internalInputEl)){rangeStartEl.dataset.maxDate=updatedDate;rangeStartEl.dataset.rangeDate=updatedDate;rangeStartEl.dataset.defaultDate=updatedDate;}else{rangeStartEl.dataset.maxDate=dateRangePickerEl.dataset.maxDate||"";rangeStartEl.dataset.rangeDate="";rangeStartEl.dataset.defaultDate="";}updateCalendarIfVisible(rangeStartEl);};const enhanceDateRangePicker=(el)=>{const dateRangePickerEl=el.closest(DATE_RANGE_PICKER);const [rangeStart,rangeEnd]=select(DATE_PICKER,dateRangePickerEl);if(!rangeStart)throw new Error(`${DATE_RANGE_PICKER} is missing inner two '${DATE_PICKER}' elements`);if(!rangeEnd)throw new Error(`${DATE_RANGE_PICKER} is missing second '${DATE_PICKER}' element`);rangeStart.classList.add(DATE_RANGE_PICKER_RANGE_START_CLASS);rangeEnd.classList.add(DATE_RANGE_PICKER_RANGE_END_CLASS);if(!dateRangePickerEl.dataset.minDate)dateRangePickerEl.dataset.minDate=DEFAULT_MIN_DATE;const {minDate}=dateRangePickerEl.dataset;rangeStart.dataset.minDate=minDate;rangeEnd.dataset.minDate=minDate;const {maxDate}=dateRangePickerEl.dataset;if(maxDate){rangeStart.dataset.maxDate=maxDate;rangeEnd.dataset.maxDate=maxDate;}handleRangeStartUpdate(dateRangePickerEl);handleRangeEndUpdate(dateRangePickerEl);};const dateRangePicker=behavior({"input change":{[DATE_RANGE_PICKER_RANGE_START](){handleRangeStartUpdate(this);},[DATE_RANGE_PICKER_RANGE_END](){handleRangeEndUpdate(this);}}},{init(root){selectOrMatches(DATE_RANGE_PICKER,root).forEach((dateRangePickerEl)=>{enhanceDateRangePicker(dateRangePickerEl);});}});module.exports=dateRangePicker;},{"../../usa-date-picker/src/index":18,"../../uswds-core/src/js/config":34,"../../uswds-core/src/js/utils/behavior":39,"../../uswds-core/src/js/utils/select":47,"../../uswds-core/src/js/utils/select-or-matches":46}],20:[function(require,module,exports){"use strict";const selectOrMatches=require("../../uswds-core/src/js/utils/select-or-matches");const behavior=require("../../uswds-core/src/js/utils/behavior");const Sanitizer=require("../../uswds-core/src/js/utils/sanitizer");const {prefix:PREFIX}=require("../../uswds-core/src/js/config");const DROPZONE_CLASS=`${PREFIX}-file-input`;const DROPZONE=`.${DROPZONE_CLASS}`;const INPUT_CLASS=`${PREFIX}-file-input__input`;const TARGET_CLASS=`${PREFIX}-file-input__target`;const INPUT=`.${INPUT_CLASS}`;const BOX_CLASS=`${PREFIX}-file-input__box`;const INSTRUCTIONS_CLASS=`${PREFIX}-file-input__instructions`;const PREVIEW_CLASS=`${PREFIX}-file-input__preview`;const PREVIEW_HEADING_CLASS=`${PREFIX}-file-input__preview-heading`;const DISABLED_CLASS=`${PREFIX}-file-input--disabled`;const CHOOSE_CLASS=`${PREFIX}-file-input__choose`;const ACCEPTED_FILE_MESSAGE_CLASS=`${PREFIX}-file-input__accepted-files-message`;const DRAG_TEXT_CLASS=`${PREFIX}-file-input__drag-text`;const DRAG_CLASS=`${PREFIX}-file-input--drag`;const LOADING_CLASS="is-loading";const INVALID_FILE_CLASS="has-invalid-file";const GENERIC_PREVIEW_CLASS_NAME=`${PREFIX}-file-input__preview-image`;const GENERIC_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--generic`;const PDF_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--pdf`;const WORD_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--word`;const VIDEO_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--video`;const EXCEL_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--excel`;const SR_ONLY_CLASS=`${PREFIX}-sr-only`;const SPACER_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";const DEFAULT_ERROR_LABEL_TEXT="Error: This is not a valid file type.";let TYPE_IS_VALID=Boolean(true);let DEFAULT_ARIA_LABEL_TEXT="";let DEFAULT_FILE_STATUS_TEXT="";const getFileInputContext=(el)=>{const dropZoneEl=el.closest(DROPZONE);if(!dropZoneEl)throw new Error(`Element is missing outer ${DROPZONE}`);const inputEl=dropZoneEl.querySelector(INPUT);return {dropZoneEl,inputEl};};const disable=(el)=>{const {dropZoneEl,inputEl}=getFileInputContext(el);inputEl.disabled=true;dropZoneEl.classList.add(DISABLED_CLASS);};const ariaDisable=(el)=>{const {dropZoneEl}=getFileInputContext(el);dropZoneEl.classList.add(DISABLED_CLASS);};const enable=(el)=>{const {dropZoneEl,inputEl}=getFileInputContext(el);inputEl.disabled=false;dropZoneEl.classList.remove(DISABLED_CLASS);dropZoneEl.removeAttribute("aria-disabled");};const replaceName=(s)=>{const c=s.charCodeAt(0);if(c===32)return "-";if(c>=65&&c<=90)return `img_${s.toLowerCase()}`;return `__${("000",c.toString(16)).slice(-4)}`;};const makeSafeForID=(name)=>name.replace(/[^a-z0-9]/g,replaceName);const createUniqueID=(name)=>`${name}-${Math.floor(Date.now().toString()/1000)}`;const getItemsLabel=(fileInputEl)=>{const acceptsMultiple=fileInputEl.hasAttribute("multiple");const itemsLabel=acceptsMultiple?"files":"file";return itemsLabel;};const createTargetArea=(fileInputEl)=>{const fileInputParent=document.createElement("div");const dropTarget=document.createElement("div");const box=document.createElement("div");fileInputEl.classList.remove(DROPZONE_CLASS);fileInputEl.classList.add(INPUT_CLASS);fileInputParent.classList.add(DROPZONE_CLASS);box.classList.add(BOX_CLASS);dropTarget.classList.add(TARGET_CLASS);dropTarget.prepend(box);fileInputEl.parentNode.insertBefore(dropTarget,fileInputEl);fileInputEl.parentNode.insertBefore(fileInputParent,dropTarget);dropTarget.appendChild(fileInputEl);fileInputParent.appendChild(dropTarget);return dropTarget;};const createVisibleInstructions=(fileInputEl)=>{const fileInputParent=fileInputEl.closest(DROPZONE);const itemsLabel=getItemsLabel(fileInputEl);const instructions=document.createElement("div");const dragText=`Drag ${itemsLabel} here or`;const chooseText="choose from folder";DEFAULT_ARIA_LABEL_TEXT=`${dragText} ${chooseText}`;instructions.classList.add(INSTRUCTIONS_CLASS);instructions.setAttribute("aria-hidden","true");fileInputEl.setAttribute("aria-label",DEFAULT_ARIA_LABEL_TEXT);instructions.innerHTML=Sanitizer.escapeHTML`${dragText} ${chooseText}`;fileInputEl.parentNode.insertBefore(instructions,fileInputEl);if(/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))fileInputParent.querySelector(`.${DRAG_TEXT_CLASS}`).outerHTML="";return instructions;};const createSROnlyStatus=(fileInputEl)=>{const statusEl=document.createElement("div");const itemsLabel=getItemsLabel(fileInputEl);const fileInputParent=fileInputEl.closest(DROPZONE);const fileInputTarget=fileInputEl.closest(`.${TARGET_CLASS}`);DEFAULT_FILE_STATUS_TEXT=`No ${itemsLabel} selected.`;statusEl.classList.add(SR_ONLY_CLASS);statusEl.setAttribute("aria-live","polite");statusEl.textContent=DEFAULT_FILE_STATUS_TEXT;fileInputParent.insertBefore(statusEl,fileInputTarget);};const enhanceFileInput=(fileInputEl)=>{const isInputDisabled=fileInputEl.hasAttribute("aria-disabled")||fileInputEl.hasAttribute("disabled");const dropTarget=createTargetArea(fileInputEl);const instructions=createVisibleInstructions(fileInputEl);const {dropZoneEl}=getFileInputContext(fileInputEl);if(isInputDisabled)dropZoneEl.classList.add(DISABLED_CLASS);else createSROnlyStatus(fileInputEl);return {instructions,dropTarget};};const removeOldPreviews=(dropTarget,instructions)=>{const filePreviews=dropTarget.querySelectorAll(`.${PREVIEW_CLASS}`);const currentPreviewHeading=dropTarget.querySelector(`.${PREVIEW_HEADING_CLASS}`);const currentErrorMessage=dropTarget.querySelector(`.${ACCEPTED_FILE_MESSAGE_CLASS}`);const removeImages=(node)=>{node.parentNode.removeChild(node);};if(currentPreviewHeading)currentPreviewHeading.outerHTML="";if(currentErrorMessage){currentErrorMessage.outerHTML="";dropTarget.classList.remove(INVALID_FILE_CLASS);}if(filePreviews!==null){if(instructions)instructions.removeAttribute("hidden");Array.prototype.forEach.call(filePreviews,removeImages);}};const updateStatusMessage=(statusElement,fileNames,fileStore)=>{const statusEl=statusElement;let statusMessage=DEFAULT_FILE_STATUS_TEXT;if(fileNames.length===1)statusMessage=`You have selected the file: ${fileStore}`;else{if(fileNames.length>1)statusMessage=`You have selected ${fileNames.length} files: ${fileStore.join(", ")}`;}setTimeout(()=>{statusEl.textContent=statusMessage;},1000);};const addPreviewHeading=(fileInputEl,fileNames)=>{const filePreviewsHeading=document.createElement("div");const dropTarget=fileInputEl.closest(`.${TARGET_CLASS}`);const instructions=dropTarget.querySelector(`.${INSTRUCTIONS_CLASS}`);let changeItemText="Change file";let previewHeadingText="";if(fileNames.length===1)previewHeadingText=Sanitizer.escapeHTML`Selected file ${changeItemText}`;else{if(fileNames.length>1){changeItemText="Change files";previewHeadingText=Sanitizer.escapeHTML`${fileNames.length} files selected ${changeItemText}`;}}instructions.setAttribute("hidden","true");filePreviewsHeading.classList.add(PREVIEW_HEADING_CLASS);filePreviewsHeading.innerHTML=previewHeadingText;dropTarget.insertBefore(filePreviewsHeading,instructions);fileInputEl.setAttribute("aria-label",changeItemText);};const setPreviewFallback=(previewImage,fallbackClass)=>{previewImage.addEventListener("error",()=>{const localPreviewImage=previewImage;localPreviewImage.src=SPACER_GIF;localPreviewImage.classList.add(fallbackClass);},{once:true});};const handleChange=(e,fileInputEl,instructions,dropTarget)=>{const fileNames=e.target.files;const inputParent=dropTarget.closest(`.${DROPZONE_CLASS}`);const statusElement=inputParent.querySelector(`.${SR_ONLY_CLASS}`);const fileStore=[];removeOldPreviews(dropTarget,instructions);for(let i=0;i
${fileName}
`);};reader.onloadend=function createFilePreview(){const previewImage=document.getElementById(imageId);const fileExtension=fileName.split(".").pop();if(fileExtension==="pdf")setPreviewFallback(previewImage,PDF_PREVIEW_CLASS);else if(fileExtension==="doc"||fileExtension==="docx"||fileExtension==="pages")setPreviewFallback(previewImage,WORD_PREVIEW_CLASS);else if(fileExtension==="xls"||fileExtension==="xlsx"||fileExtension==="numbers")setPreviewFallback(previewImage,EXCEL_PREVIEW_CLASS);else if(fileExtension==="mov"||fileExtension==="mp4")setPreviewFallback(previewImage,VIDEO_PREVIEW_CLASS);else setPreviewFallback(previewImage,GENERIC_PREVIEW_CLASS);previewImage.classList.remove(LOADING_CLASS);previewImage.src=reader.result;};if(fileNames[i])reader.readAsDataURL(fileNames[i]);}if(fileNames.length===0)fileInputEl.setAttribute("aria-label",DEFAULT_ARIA_LABEL_TEXT);else addPreviewHeading(fileInputEl,fileNames);updateStatusMessage(statusElement,fileNames,fileStore);};const preventInvalidFiles=(e,fileInputEl,instructions,dropTarget)=>{const acceptedFilesAttr=fileInputEl.getAttribute("accept");dropTarget.classList.remove(INVALID_FILE_CLASS);const isIncluded=(file,value)=>{let returnValue=false;const pos=file.indexOf(value);if(pos>=0)returnValue=true;return returnValue;};if(acceptedFilesAttr){const acceptedFiles=acceptedFilesAttr.split(",");const errorMessage=document.createElement("div");const userErrorText=fileInputEl.dataset.errormessage;const errorMessageText=userErrorText||DEFAULT_ERROR_LABEL_TEXT;errorMessage.setAttribute("aria-hidden",true);let allFilesAllowed=true;const scannedFiles=e.target.files||e.dataTransfer.files;for(let i=0;i
0||isIncluded(file.type,fileType.replace(/\*/g,""));if(allFilesAllowed){TYPE_IS_VALID=true;break;}}}else break;}if(!allFilesAllowed){removeOldPreviews(dropTarget,instructions);fileInputEl.value="";errorMessage.textContent=errorMessageText;dropTarget.insertBefore(errorMessage,fileInputEl);const ariaLabelText=`${errorMessageText} ${DEFAULT_ARIA_LABEL_TEXT}`;fileInputEl.setAttribute("aria-label",ariaLabelText);errorMessage.classList.add(ACCEPTED_FILE_MESSAGE_CLASS);dropTarget.classList.add(INVALID_FILE_CLASS);TYPE_IS_VALID=false;e.preventDefault();e.stopPropagation();}}};const handleUpload=(event,fileInputEl,instructions,dropTarget)=>{preventInvalidFiles(event,fileInputEl,instructions,dropTarget);if(TYPE_IS_VALID===true)handleChange(event,fileInputEl,instructions,dropTarget);};const fileInput=behavior({},{init(root){selectOrMatches(DROPZONE,root).forEach((fileInputEl)=>{const {instructions,dropTarget}=enhanceFileInput(fileInputEl);dropTarget.addEventListener("dragover",function handleDragOver(){this.classList.add(DRAG_CLASS);},false);dropTarget.addEventListener("dragleave",function handleDragLeave(){this.classList.remove(DRAG_CLASS);},false);dropTarget.addEventListener("drop",function handleDrop(){this.classList.remove(DRAG_CLASS);},false);fileInputEl.addEventListener("change",(e)=>handleUpload(e,fileInputEl,instructions,dropTarget),false);});},teardown(root){selectOrMatches(INPUT,root).forEach((fileInputEl)=>{const fileInputTopElement=fileInputEl.parentElement.parentElement;fileInputTopElement.parentElement.replaceChild(fileInputEl,fileInputTopElement);fileInputEl.className=DROPZONE_CLASS;});},getFileInputContext,disable,ariaDisable,enable});module.exports=fileInput;},{"../../uswds-core/src/js/config":34,"../../uswds-core/src/js/utils/behavior":39,"../../uswds-core/src/js/utils/sanitizer":44,"../../uswds-core/src/js/utils/select-or-matches":46}],21:[function(require,module,exports){"use strict";const behavior=require("../../uswds-core/src/js/utils/behavior");const {CLICK}=require("../../uswds-core/src/js/events");const {prefix:PREFIX}=require("../../uswds-core/src/js/config");const SCOPE=`.${PREFIX}-footer--big`;const NAV=`${SCOPE} nav`;const BUTTON=`${NAV} .${PREFIX}-footer__primary-link`;const HIDE_MAX_WIDTH=480;function showPanel(){if(window.innerWidth{button.setAttribute("aria-expanded",false);});this.setAttribute("aria-expanded",!isOpen);}}function toggleHtmlTag(isMobile){const bigFooter=document.querySelector(SCOPE);if(!bigFooter)return;const primaryLinks=bigFooter.querySelectorAll(BUTTON);primaryLinks.forEach((currentElement)=>{const currentElementClasses=currentElement.getAttribute("class");const preservedHtmlTag=currentElement.getAttribute("data-tag")||currentElement.tagName;const newElementType=isMobile?"button":preservedHtmlTag;const newElement=document.createElement(newElementType);newElement.setAttribute("class",currentElementClasses);newElement.classList.toggle(`${PREFIX}-footer__primary-link--button`,isMobile);newElement.textContent=currentElement.textContent;if(isMobile){newElement.setAttribute("data-tag",currentElement.tagName);const menuId=`${PREFIX}-footer-menu-list-${Math.floor(Math.random()*100000)}`;newElement.setAttribute("aria-controls",menuId);newElement.setAttribute("aria-expanded","false");currentElement.nextElementSibling.setAttribute("id",menuId);newElement.setAttribute("type","button");}currentElement.after(newElement);currentElement.remove();});}const resize=(event)=>{toggleHtmlTag(event.matches);};module.exports=behavior({[CLICK]:{[BUTTON]:showPanel}},{HIDE_MAX_WIDTH,init(){toggleHtmlTag(window.innerWidthdocument.body.classList.contains(ACTIVE_CLASS);const isSafari=navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome");const SCROLLBAR_WIDTH=ScrollBarWidth();const INITIAL_PADDING=window.getComputedStyle(document.body).getPropertyValue("padding-right");const TEMPORARY_PADDING=`${parseInt(INITIAL_PADDING.replace(/px/,""),10)+parseInt(SCROLLBAR_WIDTH.replace(/px/,""),10)}px`;const hideNonNavItems=()=>{const headerParent=document.querySelector(`${HEADER}`).parentNode;nonNavElements=document.querySelectorAll(NON_NAV_ELEMENTS);nonNavElements.forEach((nonNavElement)=>{if(nonNavElement!==headerParent){nonNavElement.setAttribute("aria-hidden",true);nonNavElement.setAttribute(NON_NAV_HIDDEN_ATTRIBUTE,"");}});};const showNonNavItems=()=>{nonNavElements=document.querySelectorAll(NON_NAV_HIDDEN);if(!nonNavElements)return;nonNavElements.forEach((nonNavElement)=>{nonNavElement.removeAttribute("aria-hidden");nonNavElement.removeAttribute(NON_NAV_HIDDEN_ATTRIBUTE);});};const toggleNonNavItems=(active)=>{if(active)hideNonNavItems();else showNonNavItems();};const addSafariClass=()=>{if(isSafari)document.body.classList.add("is-safari");};const setSafariScrollPosition=(body)=>{const currentScrollPosition=`-${window.scrollY}px`;if(isSafari)body.style.setProperty("--scrolltop",currentScrollPosition);};const toggleNav=(active)=>{const {body}=document;const safeActive=typeof active==="boolean"?active:!isActive();setSafariScrollPosition(body);body.classList.toggle(ACTIVE_CLASS,safeActive);select(TOGGLES).forEach((el)=>el.classList.toggle(VISIBLE_CLASS,safeActive));navigation.focusTrap.update(safeActive);const closeButton=body.querySelector(CLOSE_BUTTON);const menuButton=document.querySelector(OPENERS);body.style.paddingRight=body.style.paddingRight===TEMPORARY_PADDING?INITIAL_PADDING:TEMPORARY_PADDING;toggleNonNavItems(safeActive);if(safeActive&&closeButton)closeButton.focus();else{if(!safeActive&&menuButton&&getComputedStyle(menuButton).display!=="none")menuButton.focus();}return safeActive;};const resize=()=>{const closer=document.body.querySelector(CLOSE_BUTTON);if(isActive()&&closer&&closer.getBoundingClientRect().width===0)navigation.toggleNav.call(closer,false);};const onMenuClose=()=>navigation.toggleNav.call(navigation,false);const hideActiveNavDropdown=()=>{if(!navActive)return;toggle(navActive,false);navActive=null;};const focusNavButton=(event)=>{const parentNavItem=event.target.closest(NAV_PRIMARY_ITEM);if(!event.target.matches(NAV_CONTROL)){const navControl=parentNavItem.querySelector(NAV_CONTROL);if(navControl)navControl.focus();}};const handleEscape=(event)=>{hideActiveNavDropdown();focusNavButton(event);};navigation=behavior({[CLICK]:{[NAV_CONTROL](){if(navActive!==this)hideActiveNavDropdown();if(!navActive){navActive=this;toggle(navActive,true);}return false;},[BODY]:hideActiveNavDropdown,[OPENERS]:toggleNav,[CLOSERS]:toggleNav,[NAV_LINKS](){const acc=this.closest(accordion.ACCORDION);if(acc)accordion.getButtons(acc).forEach((btn)=>accordion.hide(btn));if(isActive())navigation.toggleNav.call(navigation,false);}},keydown:{[NAV_PRIMARY]:keymap({Escape:handleEscape})},focusout:{[NAV_PRIMARY](event){const nav=event.target.closest(NAV_PRIMARY);if(!nav.contains(event.relatedTarget))hideActiveNavDropdown();}}},{init(root){const trapContainer=root.matches(NAV)?root:root.querySelector(NAV);if(trapContainer)navigation.focusTrap=FocusTrap(trapContainer,{Escape:onMenuClose});addSafariClass();resize();window.addEventListener("resize",resize,false);},teardown(){window.removeEventListener("resize",resize,false);navActive=false;},focusTrap:null,toggleNav});module.exports=navigation;},{"../../usa-accordion/src/index":13,"../../uswds-core/src/js/config":34,"../../uswds-core/src/js/events":35,"../../uswds-core/src/js/utils/behavior":39,"../../uswds-core/src/js/utils/focus-trap":41,"../../uswds-core/src/js/utils/scrollbar-width":45,"../../uswds-core/src/js/utils/select":47,"../../uswds-core/src/js/utils/toggle":50,"receptor/keymap":10}],23:[function(require,module,exports){"use strict";const once=require("receptor/once");const keymap=require("receptor/keymap");const selectOrMatches=require("../../uswds-core/src/js/utils/select-or-matches");const behavior=require("../../uswds-core/src/js/utils/behavior");const {prefix:PREFIX}=require("../../uswds-core/src/js/config");const {CLICK}=require("../../uswds-core/src/js/events");const Sanitizer=require("../../uswds-core/src/js/utils/sanitizer");const CURRENT_CLASS=`${PREFIX}-current`;const IN_PAGE_NAV_HEADINGS="h2 h3";const IN_PAGE_NAV_VALID_HEADINGS=["h1","h2","h3","h4","h5","h6"];const IN_PAGE_NAV_TITLE_TEXT="On this page";const IN_PAGE_NAV_TITLE_HEADING_LEVEL="h4";const IN_PAGE_NAV_SCROLL_OFFSET=0;const IN_PAGE_NAV_ROOT_MARGIN="0px 0px 0px 0px";const IN_PAGE_NAV_THRESHOLD="1";const IN_PAGE_NAV_MINIMUM_HEADING_COUNT=2;const IN_PAGE_NAV_CLASS=`${PREFIX}-in-page-nav`;const IN_PAGE_NAV_ANCHOR_CLASS=`${PREFIX}-anchor`;const IN_PAGE_NAV_NAV_CLASS=`${IN_PAGE_NAV_CLASS}__nav`;const IN_PAGE_NAV_LIST_CLASS=`${IN_PAGE_NAV_CLASS}__list`;const IN_PAGE_NAV_ITEM_CLASS=`${IN_PAGE_NAV_CLASS}__item`;const IN_PAGE_NAV_PRIMARY_ITEM_CLASS=`${IN_PAGE_NAV_ITEM_CLASS}--primary`;const IN_PAGE_NAV_LINK_CLASS=`${IN_PAGE_NAV_CLASS}__link`;const IN_PAGE_NAV_TITLE_CLASS=`${IN_PAGE_NAV_CLASS}__heading`;const MAIN_ELEMENT="main";const setActive=(el)=>{const allLinks=document.querySelectorAll(`.${IN_PAGE_NAV_LINK_CLASS}`);el.map((i)=>{if(i.isIntersecting===true&&i.intersectionRatio>=1){allLinks.forEach((link)=>link.classList.remove(CURRENT_CLASS));document.querySelector(`a[href="#${i.target.id}"]`).classList.add(CURRENT_CLASS);return true;}return false;});};const createSectionHeadingsArray=(selectedContentRegion,selectedHeadingTypes)=>{const selectedHeadingTypesArray=selectedHeadingTypes.indexOf(" ")?selectedHeadingTypes.split(" "):selectedHeadingTypes;const contentRegion=document.querySelector(selectedContentRegion);selectedHeadingTypesArray.forEach((headingType)=>{if(!IN_PAGE_NAV_VALID_HEADINGS.includes(headingType))throw new Error(`In-page navigation: data-heading-elements attribute defined with an invalid heading type: "${headingType}".
Define the attribute with one or more of the following: "${IN_PAGE_NAV_VALID_HEADINGS}".
Do not use commas or other punctuation in the attribute definition.`);});const sectionHeadingsArray=Array.from(contentRegion.querySelectorAll(selectedHeadingTypesArray));return sectionHeadingsArray;};const getVisibleSectionHeadings=(selectedContentRegion,selectedHeadingTypes)=>{const sectionHeadings=createSectionHeadingsArray(selectedContentRegion,selectedHeadingTypes);const visibleSectionHeadings=sectionHeadings.filter((heading)=>{const headingStyle=window.getComputedStyle(heading);const visibleHeading=headingStyle.getPropertyValue("display")!=="none"&&headingStyle.getPropertyValue("visibility")!=="hidden";return visibleHeading;});return visibleSectionHeadings;};const getTopLevelHeading=(sectionHeadings)=>{const topHeading=sectionHeadings[0].tagName.toLowerCase();return topHeading;};const getSectionAnchors=()=>{const sectionAnchors=document.querySelectorAll(`.${IN_PAGE_NAV_ANCHOR_CLASS}`);return sectionAnchors;};const getHeadingId=(heading)=>{const baseId=heading.textContent.toLowerCase().replace(/[^a-z\d]/g,"-").replace(/-{2,}/g,"-").replace(/^-|-$/g,"");let id;let suffix=0;do{id=baseId;suffix+=1;if(suffix>1)id+=`-${suffix}`;}while(document.getElementById(id));return id;};const getSectionId=(value)=>{let id;if(value&&value.nodeType===1)id=value.getAttribute("href").replace("#","");else id=value.target.hash.replace("#","");return id;};const getTotalElementOffset=(el)=>{const calculateOffset=(currentEl)=>{if(!currentEl.offsetParent)return currentEl.offsetTop;return currentEl.offsetTop+calculateOffset(currentEl.offsetParent);};return calculateOffset(el);};const handleScrollToSection=(el)=>{const inPageNavEl=document.querySelector(`.${IN_PAGE_NAV_CLASS}`);const inPageNavScrollOffset=inPageNavEl.dataset.scrollOffset||IN_PAGE_NAV_SCROLL_OFFSET;const offsetTop=getTotalElementOffset(el);window.scroll({behavior:"smooth",top:offsetTop-inPageNavScrollOffset});if(window.location.hash.slice(1)!==el.id)window.history.pushState(null,"",`#${el.id}`);};const scrollToCurrentSection=()=>{const hashFragment=window.location.hash.slice(1);if(hashFragment){const anchorTag=document.getElementById(hashFragment);if(anchorTag)handleScrollToSection(anchorTag);}};const shouldRenderInPageNav=(sectionHeadings,minimumHeadingCount,acceptedHeadingLevels)=>{const validHeadings=sectionHeadings.filter((heading)=>acceptedHeadingLevels.includes(heading.tagName.toLowerCase()));return validHeadings.length>=minimumHeadingCount;};const createInPageNav=(inPageNavEl)=>{const inPageNavTitleText=Sanitizer.escapeHTML`${inPageNavEl.dataset.titleText||IN_PAGE_NAV_TITLE_TEXT}`;const inPageNavTitleHeadingLevel=Sanitizer.escapeHTML`${inPageNavEl.dataset.titleHeadingLevel||IN_PAGE_NAV_TITLE_HEADING_LEVEL}`;const inPageNavRootMargin=Sanitizer.escapeHTML`${inPageNavEl.dataset.rootMargin||IN_PAGE_NAV_ROOT_MARGIN}`;const inPageNavThreshold=Sanitizer.escapeHTML`${inPageNavEl.dataset.threshold||IN_PAGE_NAV_THRESHOLD}`;const inPageNavContentSelector=Sanitizer.escapeHTML`${inPageNavEl.dataset.mainContentSelector||MAIN_ELEMENT}`;const inPageNavHeadingSelector=Sanitizer.escapeHTML`${inPageNavEl.dataset.headingElements||IN_PAGE_NAV_HEADINGS}`;const inPageNavMinimumHeadingCount=Sanitizer.escapeHTML`${inPageNavEl.dataset.minimumHeadingCount||IN_PAGE_NAV_MINIMUM_HEADING_COUNT}`;const acceptedHeadingLevels=inPageNavHeadingSelector.split(" ").map((h)=>h.toLowerCase());const sectionHeadings=getVisibleSectionHeadings(inPageNavContentSelector,inPageNavHeadingSelector);if(!shouldRenderInPageNav(sectionHeadings,inPageNavMinimumHeadingCount,acceptedHeadingLevels))return;const options={root:null,rootMargin:inPageNavRootMargin,threshold:[inPageNavThreshold]};const inPageNav=document.createElement("nav");inPageNav.setAttribute("aria-label",inPageNavTitleText);inPageNav.classList.add(IN_PAGE_NAV_NAV_CLASS);const inPageNavTitle=document.createElement(inPageNavTitleHeadingLevel);inPageNavTitle.classList.add(IN_PAGE_NAV_TITLE_CLASS);inPageNavTitle.setAttribute("tabindex","0");inPageNavTitle.textContent=inPageNavTitleText;inPageNav.appendChild(inPageNavTitle);const inPageNavList=document.createElement("ul");inPageNavList.classList.add(IN_PAGE_NAV_LIST_CLASS);inPageNav.appendChild(inPageNavList);sectionHeadings.forEach((el)=>{const listItem=document.createElement("li");const navLinks=document.createElement("a");const anchorTag=document.createElement("a");const textContentOfLink=el.textContent;const tag=el.tagName.toLowerCase();const topHeadingLevel=getTopLevelHeading(sectionHeadings);const headingId=getHeadingId(el);listItem.classList.add(IN_PAGE_NAV_ITEM_CLASS);if(tag===topHeadingLevel)listItem.classList.add(IN_PAGE_NAV_PRIMARY_ITEM_CLASS);navLinks.setAttribute("href",`#${headingId}`);navLinks.setAttribute("class",IN_PAGE_NAV_LINK_CLASS);navLinks.textContent=textContentOfLink;anchorTag.setAttribute("id",headingId);anchorTag.setAttribute("class",IN_PAGE_NAV_ANCHOR_CLASS);el.insertAdjacentElement("afterbegin",anchorTag);inPageNavList.appendChild(listItem);listItem.appendChild(navLinks);});inPageNavEl.appendChild(inPageNav);const anchorTags=getSectionAnchors();const observeSections=new window.IntersectionObserver(setActive,options);anchorTags.forEach((tag)=>{observeSections.observe(tag);});};const handleClickFromLink=(el)=>{const elementToScrollTo=document.getElementById(el.hash.slice(1));handleScrollToSection(elementToScrollTo);};const handleEnterFromLink=(event)=>{const id=getSectionId(event);const targetAnchor=document.getElementById(id);const target=targetAnchor.parentElement;if(target){target.setAttribute("tabindex",0);target.focus();target.addEventListener("blur",once(()=>{target.setAttribute("tabindex",-1);}));}else{}handleScrollToSection(targetAnchor);};const inPageNavigation=behavior({[CLICK]:{[`.${IN_PAGE_NAV_LINK_CLASS}`](event){event.preventDefault();if(this.disabled)return;handleClickFromLink(this);}},keydown:{[`.${IN_PAGE_NAV_LINK_CLASS}`]:keymap({Enter:handleEnterFromLink})}},{init(root){selectOrMatches(`.${IN_PAGE_NAV_CLASS}`,root).forEach((inPageNavEl)=>{createInPageNav(inPageNavEl);scrollToCurrentSection();});}});module.exports=inPageNavigation;},{"../../uswds-core/src/js/config":34,"../../uswds-core/src/js/events":35,"../../uswds-core/src/js/utils/behavior":39,"../../uswds-core/src/js/utils/sanitizer":44,"../../uswds-core/src/js/utils/select-or-matches":46,"receptor/keymap":10,"receptor/once":11}],24:[function(require,module,exports){"use strict";const selectOrMatches=require("../../uswds-core/src/js/utils/select-or-matches");const behavior=require("../../uswds-core/src/js/utils/behavior");const {prefix:PREFIX}=require("../../uswds-core/src/js/config");const MASKED_CLASS=`${PREFIX}-masked`;const MASKED=`.${MASKED_CLASS}`;const MASK=`${PREFIX}-input-mask`;const MASK_CONTENT=`${MASK}--content`;const PLACEHOLDER="placeholder";const maskedNumber="_#dDmMyY9";const maskedLetter="A";const createMaskedInputShell=(input)=>{const placeholder=input.getAttribute(`${PLACEHOLDER}`);if(placeholder){input.setAttribute("maxlength",placeholder.length);input.setAttribute("data-placeholder",placeholder);input.removeAttribute(`${PLACEHOLDER}`);}else return;const shell=document.createElement("span");shell.classList.add(MASK);shell.setAttribute("data-mask",placeholder);const content=document.createElement("span");content.classList.add(MASK_CONTENT);content.setAttribute("aria-hidden","true");content.id=`${input.id}Mask`;content.textContent=placeholder;shell.appendChild(content);input.parentNode.insertBefore(shell,input);shell.appendChild(input);};const setValueOfMask=(el)=>{const {value}=el;const placeholderVal=`${el.dataset.placeholder.substr(value.length)}`;const theIEl=document.createElement("i");theIEl.textContent=value;return [theIEl,placeholderVal];};const strippedValue=(isCharsetPresent,value)=>isCharsetPresent?value.replace(/\W/g,""):value.replace(/\D/g,"");const isInteger=(value)=>!Number.isNaN(parseInt(value,10));const isLetter=(value)=>value?value.match(/[A-Z]/i):false;const handleCurrentValue=(el)=>{const isCharsetPresent=el.dataset.charset;const placeholder=isCharsetPresent||el.dataset.placeholder;const {value}=el;const len=placeholder.length;let newValue="";let i;let charIndex;const strippedVal=strippedValue(isCharsetPresent,value);for(i=0,charIndex=0;i=0;const matchesLetter=maskedLetter.indexOf(placeholder[i])>=0;if(matchesNumber&&isInt||isCharsetPresent&&matchesLetter&&isLet){newValue+=strippedVal[charIndex];charIndex+=1;}else if(!isCharsetPresent&&!isInt&&matchesNumber||isCharsetPresent&&(matchesLetter&&!isLet||matchesNumber&&!isInt))return newValue;else newValue+=placeholder[i];if(strippedVal[charIndex]===undefined)break;}return newValue;};const handleValueChange=(el)=>{const inputEl=el;const id=inputEl.getAttribute("id");inputEl.value=handleCurrentValue(inputEl);const maskVal=setValueOfMask(el);const maskEl=document.getElementById(`${id}Mask`);maskEl.textContent="";maskEl.replaceChildren(maskVal[0],maskVal[1]);};const inputMaskEvents={keyup:{[MASKED](){handleValueChange(this);}}};const inputMask=behavior(inputMaskEvents,{init(root){selectOrMatches(MASKED,root).forEach((maskedInput)=>{createMaskedInputShell(maskedInput);});}});module.exports=inputMask;},{"../../uswds-core/src/js/config":34,"../../uswds-core/src/js/utils/behavior":39,"../../uswds-core/src/js/utils/select-or-matches":46}],25:[function(require,module,exports){"use strict";const keymap=require("receptor/keymap");const behavior=require("../../uswds-core/src/js/utils/behavior");const toggle=require("../../uswds-core/src/js/utils/toggle");const FocusTrap=require("../../uswds-core/src/js/utils/focus-trap");const accordion=require("../../usa-accordion/src/index");const {CLICK}=require("../../uswds-core/src/js/events");const {prefix:PREFIX}=require("../../uswds-core/src/js/config");const BODY="body";const LANGUAGE=`.${PREFIX}-language`;const LANGUAGE_SUB=`.${PREFIX}-language__submenu`;const LANGUAGE_PRIMARY=`.${PREFIX}-language__primary`;const LANGUAGE_PRIMARY_ITEM=`.${PREFIX}-language__primary-item`;const LANGUAGE_CONTROL=`button.${PREFIX}-language__link`;const LANGUAGE_LINKS=`${LANGUAGE} a`;let languageSelector;let languageActive;const onLanguageClose=()=>languageSelector.toggleLanguage.call(languageSelector,false);const hideActiveLanguageDropdown=()=>{if(!languageActive)return;toggle(languageActive,false);languageActive=null;};const focusLanguageButton=(event)=>{const parentLanguageItem=event.target.closest(LANGUAGE_PRIMARY_ITEM);if(!event.target.matches(LANGUAGE_CONTROL))parentLanguageItem.querySelector(LANGUAGE_CONTROL).focus();};const handleEscape=(event)=>{hideActiveLanguageDropdown();focusLanguageButton(event);};languageSelector=behavior({[CLICK]:{[LANGUAGE_CONTROL](){if(languageActive!==this)hideActiveLanguageDropdown();if(languageActive===this){hideActiveLanguageDropdown();return false;}if(!languageActive){languageActive=this;toggle(languageActive,true);}return false;},[BODY]:hideActiveLanguageDropdown,[LANGUAGE_LINKS](){const acc=this.closest(accordion.ACCORDION);if(acc)accordion.getButtons(acc).forEach((btn)=>accordion.hide(btn));}},keydown:{[LANGUAGE_PRIMARY]:keymap({Escape:handleEscape})},focusout:{[LANGUAGE_PRIMARY](event){const language=event.target.closest(LANGUAGE_PRIMARY);if(!language.contains(event.relatedTarget))hideActiveLanguageDropdown();}}},{init(root){const trapContainer=root.matches(LANGUAGE_SUB)?root:root.querySelector(LANGUAGE_SUB);if(trapContainer)languageSelector.focusTrap=FocusTrap(trapContainer,{Escape:onLanguageClose});},teardown(){languageActive=false;},focusTrap:null});module.exports=languageSelector;},{"../../usa-accordion/src/index":13,"../../uswds-core/src/js/config":34,"../../uswds-core/src/js/events":35,"../../uswds-core/src/js/utils/behavior":39,"../../uswds-core/src/js/utils/focus-trap":41,"../../uswds-core/src/js/utils/toggle":50,"receptor/keymap":10}],26:[function(require,module,exports){"use strict";const selectOrMatches=require("../../uswds-core/src/js/utils/select-or-matches");const FocusTrap=require("../../uswds-core/src/js/utils/focus-trap");const ScrollBarWidth=require("../../uswds-core/src/js/utils/scrollbar-width");const behavior=require("../../uswds-core/src/js/utils/behavior");const {prefix:PREFIX}=require("../../uswds-core/src/js/config");const MODAL_CLASSNAME=`${PREFIX}-modal`;const OVERLAY_CLASSNAME=`${MODAL_CLASSNAME}-overlay`;const WRAPPER_CLASSNAME=`${MODAL_CLASSNAME}-wrapper`;const OPENER_ATTRIBUTE="data-open-modal";const CLOSER_ATTRIBUTE="data-close-modal";const FORCE_ACTION_ATTRIBUTE="data-force-action";const NON_MODAL_HIDDEN_ATTRIBUTE=`data-modal-hidden`;const MODAL=`.${MODAL_CLASSNAME}`;const INITIAL_FOCUS=`.${WRAPPER_CLASSNAME} *[data-focus]`;const CLOSE_BUTTON=`${WRAPPER_CLASSNAME} *[${CLOSER_ATTRIBUTE}]`;const OPENERS=`*[${OPENER_ATTRIBUTE}][aria-controls]`;const CLOSERS=`${CLOSE_BUTTON}, .${OVERLAY_CLASSNAME}:not([${FORCE_ACTION_ATTRIBUTE}])`;const NON_MODALS=`body > *:not(.${WRAPPER_CLASSNAME}):not([aria-hidden])`;const NON_MODALS_HIDDEN=`[${NON_MODAL_HIDDEN_ATTRIBUTE}]`;const ACTIVE_CLASS="usa-js-modal--active";const PREVENT_CLICK_CLASS="usa-js-no-click";const VISIBLE_CLASS="is-visible";const HIDDEN_CLASS="is-hidden";let modal;let INITIAL_BODY_PADDING;let TEMPORARY_BODY_PADDING;const isActive=()=>document.body.classList.contains(ACTIVE_CLASS);const SCROLLBAR_WIDTH=ScrollBarWidth();const onMenuClose=()=>{modal.toggleModal.call(modal,false);};const setTemporaryBodyPadding=()=>{INITIAL_BODY_PADDING=window.getComputedStyle(document.body).getPropertyValue("padding-right");TEMPORARY_BODY_PADDING=`${parseInt(INITIAL_BODY_PADDING.replace(/px/,""),10)+parseInt(SCROLLBAR_WIDTH.replace(/px/,""),10)}px`;};function toggleModal(event){let originalOpener;let clickedElement=event.target;const {body}=document;const safeActive=!isActive();const modalId=clickedElement?clickedElement.getAttribute("aria-controls"):document.querySelector(`.${WRAPPER_CLASSNAME}.${VISIBLE_CLASS}`);const targetModal=safeActive?document.getElementById(modalId):document.querySelector(`.${WRAPPER_CLASSNAME}.${VISIBLE_CLASS}`);if(!targetModal)return false;const openFocusEl=targetModal.querySelector(INITIAL_FOCUS)?targetModal.querySelector(INITIAL_FOCUS):targetModal.querySelector(`.${MODAL_CLASSNAME}`);const returnFocus=document.getElementById(targetModal.getAttribute("data-opener"));const menuButton=body.querySelector(OPENERS);const forceUserAction=targetModal.getAttribute(FORCE_ACTION_ATTRIBUTE);if(event.type==="keydown"&&targetModal!==null)clickedElement=targetModal.querySelector(CLOSE_BUTTON);if(clickedElement){if(clickedElement.hasAttribute(OPENER_ATTRIBUTE)){if(this.getAttribute("id")===null){originalOpener=`modal-${Math.floor(Math.random()*900000)+100000}`;this.setAttribute("id",originalOpener);}else originalOpener=this.getAttribute("id");targetModal.setAttribute("data-opener",originalOpener);}if(clickedElement.closest(`.${MODAL_CLASSNAME}`))if(clickedElement.hasAttribute(CLOSER_ATTRIBUTE)||clickedElement.closest(`[${CLOSER_ATTRIBUTE}]`)){}else return false;}body.classList.toggle(ACTIVE_CLASS,safeActive);targetModal.classList.toggle(VISIBLE_CLASS,safeActive);targetModal.classList.toggle(HIDDEN_CLASS,!safeActive);if(forceUserAction)body.classList.toggle(PREVENT_CLICK_CLASS,safeActive);if(body.style.paddingRight===TEMPORARY_BODY_PADDING)body.style.removeProperty("padding-right");else body.style.paddingRight=TEMPORARY_BODY_PADDING;if(safeActive&&openFocusEl){if(forceUserAction)modal.focusTrap=FocusTrap(targetModal);else modal.focusTrap=FocusTrap(targetModal,{Escape:onMenuClose});modal.focusTrap.update(safeActive);openFocusEl.focus();document.querySelectorAll(NON_MODALS).forEach((nonModal)=>{nonModal.setAttribute("aria-hidden","true");nonModal.setAttribute(NON_MODAL_HIDDEN_ATTRIBUTE,"");});}else{if(!safeActive&&menuButton&&returnFocus){document.querySelectorAll(NON_MODALS_HIDDEN).forEach((nonModal)=>{nonModal.removeAttribute("aria-hidden");nonModal.removeAttribute(NON_MODAL_HIDDEN_ATTRIBUTE);});returnFocus.focus();modal.focusTrap.update(safeActive);}}return safeActive;}const createPlaceHolder=(baseComponent)=>{const modalID=baseComponent.getAttribute("id");const originalLocationPlaceHolder=document.createElement("div");const modalAttributes=Array.from(baseComponent.attributes);setTemporaryBodyPadding();originalLocationPlaceHolder.setAttribute(`data-placeholder-for`,modalID);originalLocationPlaceHolder.style.display="none";originalLocationPlaceHolder.setAttribute("aria-hidden","true");modalAttributes.forEach((attribute)=>{originalLocationPlaceHolder.setAttribute(`data-original-${attribute.name}`,attribute.value);});return originalLocationPlaceHolder;};const setModalAttributes=(baseComponent,modalContentWrapper)=>{const modalID=baseComponent.getAttribute("id");const ariaLabelledBy=baseComponent.getAttribute("aria-labelledby");const ariaDescribedBy=baseComponent.getAttribute("aria-describedby");const forceUserAction=baseComponent.hasAttribute(FORCE_ACTION_ATTRIBUTE);if(!ariaLabelledBy)throw new Error(`${modalID} is missing aria-labelledby attribute`);if(!ariaDescribedBy)throw new Error(`${modalID} is missing aria-desribedby attribute`);modalContentWrapper.setAttribute("role","dialog");modalContentWrapper.setAttribute("id",modalID);modalContentWrapper.setAttribute("aria-labelledby",ariaLabelledBy);modalContentWrapper.setAttribute("aria-describedby",ariaDescribedBy);if(forceUserAction)modalContentWrapper.setAttribute(FORCE_ACTION_ATTRIBUTE,forceUserAction);const modalClosers=modalContentWrapper.querySelectorAll(CLOSERS);modalClosers.forEach((el)=>{el.setAttribute("aria-controls",modalID);});baseComponent.removeAttribute("id");baseComponent.removeAttribute("aria-labelledby");baseComponent.removeAttribute("aria-describedby");baseComponent.setAttribute("tabindex","-1");return modalContentWrapper;};const rebuildModal=(baseComponent)=>{const modalContent=baseComponent;const modalContentWrapper=document.createElement("div");const overlayDiv=document.createElement("div");modalContentWrapper.classList.add(HIDDEN_CLASS,WRAPPER_CLASSNAME);overlayDiv.classList.add(OVERLAY_CLASSNAME);modalContentWrapper.append(overlayDiv);overlayDiv.append(modalContent);setModalAttributes(modalContent,modalContentWrapper);return modalContentWrapper;};const setUpModal=(baseComponent)=>{const modalID=baseComponent.getAttribute("id");if(!modalID)throw new Error(`Modal markup is missing ID`);const originalLocationPlaceHolder=createPlaceHolder(baseComponent);baseComponent.after(originalLocationPlaceHolder);const modalComponent=rebuildModal(baseComponent);document.body.appendChild(modalComponent);};const cleanUpModal=(baseComponent)=>{const modalContent=baseComponent;const modalContentWrapper=modalContent.parentElement.parentElement;const modalID=modalContentWrapper.getAttribute("id");if(!modalID)return;const originalLocationPlaceHolder=document.querySelector(`[data-placeholder-for="${modalID}"]`);if(originalLocationPlaceHolder){const modalAttributes=Array.from(originalLocationPlaceHolder.attributes);modalAttributes.forEach((attribute)=>{if(attribute.name.startsWith("data-original-"))modalContent.setAttribute(attribute.name.substr(14),attribute.value);});originalLocationPlaceHolder.after(modalContent);originalLocationPlaceHolder.parentElement.removeChild(originalLocationPlaceHolder);}modalContentWrapper.parentElement.removeChild(modalContentWrapper);};modal=behavior({},{init(root){selectOrMatches(MODAL,root).forEach((modalWindow)=>{const modalId=modalWindow.id;setUpModal(modalWindow);selectOrMatches(`[aria-controls="${modalId}"]`,document).forEach((modalTrigger)=>{if(modalTrigger.nodeName==="A"){modalTrigger.setAttribute("role","button");modalTrigger.addEventListener("click",(e)=>e.preventDefault());}modalTrigger.addEventListener("click",toggleModal);});});},teardown(root){selectOrMatches(MODAL,root).forEach((modalWindow)=>{const modalId=modalWindow.id;cleanUpModal(modalWindow);selectOrMatches(`[aria-controls="${modalId}"]`,document).forEach((modalTrigger)=>modalTrigger.removeEventListener("click",toggleModal));});},focusTrap:null,toggleModal});module.exports=modal;},{"../../uswds-core/src/js/config":34,"../../uswds-core/src/js/utils/behavior":39,"../../uswds-core/src/js/utils/focus-trap":41,"../../uswds-core/src/js/utils/scrollbar-width":45,"../../uswds-core/src/js/utils/select-or-matches":46}],27:[function(require,module,exports){"use strict";const selectOrMatches=require("../../uswds-core/src/js/utils/select-or-matches");const behavior=require("../../uswds-core/src/js/utils/behavior");const {prefix:PREFIX}=require("../../uswds-core/src/js/config");const RANGE_CLASSNAME=`${PREFIX}-range`;const RANGE=`.${RANGE_CLASSNAME}`;const RANGE_WRAPPER_CLASS=`${RANGE}__wrapper`;const VALUE_WRAPPER_CLASS=`${RANGE}__value`;const RANGE_WRAPPER=`${RANGE_CLASSNAME}__wrapper`;const VALUE_WRAPPER=`${RANGE_CLASSNAME}__value`;const createEnhancedRangeSlider=(el)=>{const rangeSliderEl=el;const rangeSliderVal=document.createElement("span");rangeSliderVal.setAttribute("aria-hidden","true");rangeSliderVal.className=VALUE_WRAPPER;rangeSliderVal.textContent=rangeSliderEl.value;const rangeWrapper=document.createElement("div");rangeWrapper.className=RANGE_WRAPPER;rangeSliderEl.parentNode.insertBefore(rangeWrapper,rangeSliderEl);rangeWrapper.appendChild(rangeSliderEl);rangeWrapper.appendChild(rangeSliderVal);};const updateCallout=(targetRange)=>{const rangeSlider=targetRange;const defaultPrep="of";const optionalPrep=rangeSlider.dataset.textPreposition;const prep=optionalPrep||defaultPrep;const unit=rangeSlider.dataset.textUnit;const val=rangeSlider.value;const max=rangeSlider.getAttribute("max")||100;let callout;if(unit)callout=`${val} ${unit} ${prep} ${max}`;else callout=`${val} ${prep} ${max}`;rangeSlider.setAttribute("aria-valuetext",callout);};const updateVisualCallout=(el)=>{const rangeSliderEl=el;const parentDiv=rangeSliderEl.closest(RANGE_WRAPPER_CLASS);const rangeSliderVal=parentDiv.querySelector(VALUE_WRAPPER_CLASS);rangeSliderVal.textContent=rangeSliderEl.value;};const rangeEvents={change:{[RANGE](){updateCallout(this);updateVisualCallout(this);}}};const range=behavior(rangeEvents,{init(root){selectOrMatches(RANGE,root).forEach((rangeSlider)=>{createEnhancedRangeSlider(rangeSlider);updateCallout(rangeSlider);});},updateCallout,updateVisualCallout});module.exports=range;},{"../../uswds-core/src/js/config":34,"../../uswds-core/src/js/utils/behavior":39,"../../uswds-core/src/js/utils/select-or-matches":46}],28:[function(require,module,exports){"use strict";const ignore=require("receptor/ignore");const behavior=require("../../uswds-core/src/js/utils/behavior");const select=require("../../uswds-core/src/js/utils/select");const {CLICK}=require("../../uswds-core/src/js/events");const BUTTON=".js-search-button";const FORM=".js-search-form";const INPUT="[type=search]";const CONTEXT="header";let lastButton;const getForm=(button)=>{const context=button.closest(CONTEXT);return context?context.querySelector(FORM):document.querySelector(FORM);};const toggleSearch=(button,active)=>{const form=getForm(button);if(!form)throw new Error(`No ${FORM} found for search toggle in ${CONTEXT}!`);button.hidden=active;form.hidden=!active;if(!active)return;const input=form.querySelector(INPUT);if(input)input.focus();const listener=ignore(form,()=>{if(lastButton)hideSearch.call(lastButton);document.body.removeEventListener(CLICK,listener);});setTimeout(()=>{document.body.addEventListener(CLICK,listener);},0);};function showSearch(){toggleSearch(this,true);lastButton=this;}function hideSearch(){toggleSearch(this,false);lastButton=undefined;}const search=behavior({[CLICK]:{[BUTTON]:showSearch}},{init(target){select(BUTTON,target).forEach((button)=>{toggleSearch(button,false);});},teardown(){lastButton=undefined;}});module.exports=search;},{"../../uswds-core/src/js/events":35,"../../uswds-core/src/js/utils/behavior":39,"../../uswds-core/src/js/utils/select":47,"receptor/ignore":8}],29:[function(require,module,exports){"use strict";const once=require("receptor/once");const behavior=require("../../uswds-core/src/js/utils/behavior");const {CLICK}=require("../../uswds-core/src/js/events");const {prefix:PREFIX}=require("../../uswds-core/src/js/config");const LINK=`.${PREFIX}-skipnav[href^="#"], .${PREFIX}-footer__return-to-top [href^="#"]`;const MAINCONTENT="main-content";function setTabindex(){const id=encodeURI(this.getAttribute("href"));const target=document.getElementById(id==="#"?MAINCONTENT:id.slice(1));if(target){target.style.outline="0";target.setAttribute("tabindex",0);target.focus();target.addEventListener("blur",once(()=>{target.setAttribute("tabindex",-1);}));}else{}}module.exports=behavior({[CLICK]:{[LINK]:setTabindex}});},{"../../uswds-core/src/js/config":34,"../../uswds-core/src/js/events":35,"../../uswds-core/src/js/utils/behavior":39,"receptor/once":11}],30:[function(require,module,exports){"use strict";const select=require("../../uswds-core/src/js/utils/select");const behavior=require("../../uswds-core/src/js/utils/behavior");const {CLICK}=require("../../uswds-core/src/js/events");const {prefix:PREFIX}=require("../../uswds-core/src/js/config");const Sanitizer=require("../../uswds-core/src/js/utils/sanitizer");const TABLE=`.${PREFIX}-table`;const SORTED="aria-sort";const ASCENDING="ascending";const DESCENDING="descending";const SORT_OVERRIDE="data-sort-value";const SORT_BUTTON_CLASS=`${PREFIX}-table__header__button`;const SORT_BUTTON=`.${SORT_BUTTON_CLASS}`;const SORTABLE_HEADER=`th[data-sortable]`;const ANNOUNCEMENT_REGION=`.${PREFIX}-table__announcement-region[aria-live="polite"]`;const getCellValue=(tr,index)=>tr.children[index].getAttribute(SORT_OVERRIDE)||tr.children[index].innerText||tr.children[index].textContent;const compareFunction=(index,isAscending)=>(thisRow,nextRow)=>{const value1=getCellValue(isAscending?thisRow:nextRow,index);const value2=getCellValue(isAscending?nextRow:thisRow,index);if(value1&&value2&&!Number.isNaN(Number(value1))&&!Number.isNaN(Number(value2)))return value1-value2;return value1.toString().localeCompare(value2,navigator.language,{numeric:true,ignorePunctuation:true});};const getColumnHeaders=(table)=>{const headers=select(SORTABLE_HEADER,table);return headers.filter((header)=>header.closest(TABLE)===table);};const updateSortLabel=(header)=>{const headerName=header.innerText;const sortedAscending=header.getAttribute(SORTED)===ASCENDING;const isSorted=header.getAttribute(SORTED)===ASCENDING||header.getAttribute(SORTED)===DESCENDING||false;const headerLabel=`${headerName}, sortable column, currently ${isSorted?`${sortedAscending?`sorted ${ASCENDING}`:`sorted ${DESCENDING}`}`:"unsorted"}`;const headerButtonLabel=`Click to sort by ${headerName} in ${sortedAscending?DESCENDING:ASCENDING} order.`;header.setAttribute("aria-label",headerLabel);header.querySelector(SORT_BUTTON).setAttribute("title",headerButtonLabel);};const unsetSort=(header)=>{header.removeAttribute(SORTED);updateSortLabel(header);};const sortRows=(header,isAscending)=>{header.setAttribute(SORTED,isAscending===true?DESCENDING:ASCENDING);updateSortLabel(header);const tbody=header.closest(TABLE).querySelector("tbody");const allRows=[].slice.call(tbody.querySelectorAll("tr"));const allHeaders=[].slice.call(header.parentNode.children);const thisHeaderIndex=allHeaders.indexOf(header);allRows.sort(compareFunction(thisHeaderIndex,!isAscending)).forEach((tr)=>{[].slice.call(tr.children).forEach((td)=>td.removeAttribute("data-sort-active"));tr.children[thisHeaderIndex].setAttribute("data-sort-active",true);tbody.appendChild(tr);});return true;};const updateLiveRegion=(table,sortedHeader)=>{const caption=table.querySelector("caption").innerText;const sortedAscending=sortedHeader.getAttribute(SORTED)===ASCENDING;const headerLabel=sortedHeader.innerText;const liveRegion=table.nextElementSibling;if(liveRegion&&liveRegion.matches(ANNOUNCEMENT_REGION)){const sortAnnouncement=`The table named "${caption}" is now sorted by ${headerLabel} in ${sortedAscending?ASCENDING:DESCENDING} order.`;liveRegion.innerText=sortAnnouncement;}else throw new Error(`Table containing a sortable column header is not followed by an aria-live region.`);};const toggleSort=(header,isAscending)=>{const table=header.closest(TABLE);let safeAscending=isAscending;if(typeof safeAscending!=="boolean")safeAscending=header.getAttribute(SORTED)===ASCENDING;if(!table)throw new Error(`${SORTABLE_HEADER} is missing outer ${TABLE}`);safeAscending=sortRows(header,isAscending);if(safeAscending){getColumnHeaders(table).forEach((otherHeader)=>{if(otherHeader!==header)unsetSort(otherHeader);});updateLiveRegion(table,header);}};const createHeaderButton=(header)=>{const buttonEl=document.createElement("button");buttonEl.setAttribute("tabindex","0");buttonEl.classList.add(SORT_BUTTON_CLASS);buttonEl.innerHTML=Sanitizer.escapeHTML`
`;header.appendChild(buttonEl);updateSortLabel(header);};const table=behavior({[CLICK]:{[SORT_BUTTON](event){event.preventDefault();toggleSort(event.target.closest(SORTABLE_HEADER),event.target.closest(SORTABLE_HEADER).getAttribute(SORTED)===ASCENDING);}}},{init(root){const sortableHeaders=select(SORTABLE_HEADER,root);sortableHeaders.forEach((header)=>createHeaderButton(header));const firstSorted=sortableHeaders.filter((header)=>header.getAttribute(SORTED)===ASCENDING||header.getAttribute(SORTED)===DESCENDING)[0];if(typeof firstSorted==="undefined")return;const sortDir=firstSorted.getAttribute(SORTED);if(sortDir===ASCENDING)toggleSort(firstSorted,true);else{if(sortDir===DESCENDING)toggleSort(firstSorted,false);}},TABLE,SORTABLE_HEADER,SORT_BUTTON});module.exports=table;},{"../../uswds-core/src/js/config":34,"../../uswds-core/src/js/events":35,"../../uswds-core/src/js/utils/behavior":39,"../../uswds-core/src/js/utils/sanitizer":44,"../../uswds-core/src/js/utils/select":47}],31:[function(require,module,exports){"use strict";const behavior=require("../../uswds-core/src/js/utils/behavior");const selectOrMatches=require("../../uswds-core/src/js/utils/select-or-matches");const {prefix:PREFIX}=require("../../uswds-core/src/js/config");const {COMBO_BOX_CLASS,enhanceComboBox}=require("../../usa-combo-box/src/index");const TIME_PICKER_CLASS=`${PREFIX}-time-picker`;const TIME_PICKER=`.${TIME_PICKER_CLASS}`;const MAX_TIME=60*24-1;const MIN_TIME=0;const DEFAULT_STEP=30;const MIN_STEP=1;const FILTER_DATASET={filter:"0?{{ hourQueryFilter }}:{{minuteQueryFilter}}.*{{ apQueryFilter }}m?",apQueryFilter:"([ap])",hourQueryFilter:"([1-9][0-2]?)",minuteQueryFilter:"[\\d]+:([0-9]{0,2})"};const parseTimeString=(timeStr)=>{let minutes;if(timeStr){const [hours,mins]=timeStr.split(":").map((str)=>{let value;const parsed=parseInt(str,10);if(!Number.isNaN(parsed))value=parsed;return value;});if(hours!=null&&mins!=null)minutes=hours*60+mins;}return minutes;};const transformTimePicker=(el)=>{const timePickerEl=el.closest(TIME_PICKER);const initialInputEl=timePickerEl.querySelector(`input`);if(!initialInputEl)throw new Error(`${TIME_PICKER} is missing inner input`);const selectEl=document.createElement("select");["id","name","required","aria-label","aria-labelledby","disabled","aria-disabled"].forEach((name)=>{if(initialInputEl.hasAttribute(name)){const value=initialInputEl.getAttribute(name);selectEl.setAttribute(name,value);initialInputEl.removeAttribute(name);}});const padZeros=(value,length)=>`0000${value}`.slice(-length);const getTimeContext=(minutes)=>{const minute=minutes%60;const hour24=Math.floor(minutes/60);const hour12=hour24%12||12;const ampm=hour24<12?"am":"pm";return {minute,hour24,hour12,ampm};};const minTime=Math.max(MIN_TIME,parseTimeString(timePickerEl.dataset.minTime)||MIN_TIME);const maxTime=Math.min(MAX_TIME,parseTimeString(timePickerEl.dataset.maxTime)||MAX_TIME);const step=Math.floor(Math.max(MIN_STEP,timePickerEl.dataset.step||DEFAULT_STEP));let defaultValue;for(let time=minTime;time<=maxTime;time+=step){const {minute,hour24,hour12,ampm}=getTimeContext(time);const option=document.createElement("option");option.value=`${padZeros(hour24,2)}:${padZeros(minute,2)}`;option.text=`${hour12}:${padZeros(minute,2)}${ampm}`;if(option.text===initialInputEl.value)defaultValue=option.value;selectEl.appendChild(option);}timePickerEl.classList.add(COMBO_BOX_CLASS);Object.keys(FILTER_DATASET).forEach((key)=>{timePickerEl.dataset[key]=FILTER_DATASET[key];});timePickerEl.dataset.disableFiltering="true";timePickerEl.dataset.defaultValue=defaultValue;timePickerEl.appendChild(selectEl);initialInputEl.remove();};const timePicker=behavior({},{init(root){selectOrMatches(TIME_PICKER,root).forEach((timePickerEl)=>{transformTimePicker(timePickerEl);enhanceComboBox(timePickerEl);});},FILTER_DATASET});module.exports=timePicker;},{"../../usa-combo-box/src/index":17,"../../uswds-core/src/js/config":34,"../../uswds-core/src/js/utils/behavior":39,"../../uswds-core/src/js/utils/select-or-matches":46}],32:[function(require,module,exports){"use strict";const keymap=require("receptor/keymap");const selectOrMatches=require("../../uswds-core/src/js/utils/select-or-matches");const behavior=require("../../uswds-core/src/js/utils/behavior");const {prefix:PREFIX}=require("../../uswds-core/src/js/config");const isElementInViewport=require("../../uswds-core/src/js/utils/is-in-viewport");const BODY="body";const TOOLTIP=`.${PREFIX}-tooltip`;const TOOLTIP_TRIGGER=`.${PREFIX}-tooltip__trigger`;const TOOLTIP_TRIGGER_CLASS=`${PREFIX}-tooltip__trigger`;const TOOLTIP_CLASS=`${PREFIX}-tooltip`;const TOOLTIP_BODY_CLASS=`${PREFIX}-tooltip__body`;const SET_CLASS="is-set";const VISIBLE_CLASS="is-visible";const TRIANGLE_SIZE=5;const ADJUST_WIDTH_CLASS=`${PREFIX}-tooltip__body--wrap`;const getTooltipElements=(trigger)=>{const wrapper=trigger.parentNode;const body=wrapper.querySelector(`.${TOOLTIP_BODY_CLASS}`);return {trigger,wrapper,body};};const showToolTip=(tooltipBody,tooltipTrigger,position)=>{tooltipBody.setAttribute("aria-hidden","false");tooltipBody.classList.add(SET_CLASS);const setPositionClass=(setPos)=>{tooltipBody.classList.remove(`${TOOLTIP_BODY_CLASS}--top`);tooltipBody.classList.remove(`${TOOLTIP_BODY_CLASS}--bottom`);tooltipBody.classList.remove(`${TOOLTIP_BODY_CLASS}--right`);tooltipBody.classList.remove(`${TOOLTIP_BODY_CLASS}--left`);tooltipBody.classList.add(`${TOOLTIP_BODY_CLASS}--${setPos}`);};const resetPositionStyles=(e)=>{e.style.top=null;e.style.bottom=null;e.style.right=null;e.style.left=null;e.style.margin=null;};const offsetMargin=(target,propertyValue)=>parseInt(window.getComputedStyle(target).getPropertyValue(propertyValue),10);const calculateMarginOffset=(marginPosition,tooltipBodyOffset,trigger)=>{const offset=offsetMargin(trigger,`margin-${marginPosition}`)>0?tooltipBodyOffset-offsetMargin(trigger,`margin-${marginPosition}`):tooltipBodyOffset;return offset;};const positionTop=(e)=>{resetPositionStyles(e);const topMargin=calculateMarginOffset("top",e.offsetHeight,tooltipTrigger);const leftMargin=calculateMarginOffset("left",e.offsetWidth,tooltipTrigger);setPositionClass("top");e.style.left=`50%`;e.style.top=`-${TRIANGLE_SIZE}px`;e.style.margin=`-${topMargin}px 0 0 -${leftMargin/2}px`;};const positionBottom=(e)=>{resetPositionStyles(e);const leftMargin=calculateMarginOffset("left",e.offsetWidth,tooltipTrigger);setPositionClass("bottom");e.style.left=`50%`;e.style.margin=`${TRIANGLE_SIZE}px 0 0 -${leftMargin/2}px`;};const positionRight=(e)=>{resetPositionStyles(e);const topMargin=calculateMarginOffset("top",e.offsetHeight,tooltipTrigger);setPositionClass("right");e.style.top=`50%`;e.style.left=`${tooltipTrigger.offsetLeft+tooltipTrigger.offsetWidth+TRIANGLE_SIZE}px`;e.style.margin=`-${topMargin/2}px 0 0 0`;};const positionLeft=(e)=>{resetPositionStyles(e);const topMargin=calculateMarginOffset("top",e.offsetHeight,tooltipTrigger);const leftMargin=calculateMarginOffset("left",tooltipTrigger.offsetLeft>e.offsetWidth?tooltipTrigger.offsetLeft-e.offsetWidth:e.offsetWidth,tooltipTrigger);setPositionClass("left");e.style.top=`50%`;e.style.left=`-${TRIANGLE_SIZE}px`;e.style.margin=`-${topMargin/2}px 0 0 ${tooltipTrigger.offsetLeft>e.offsetWidth?leftMargin:-leftMargin}px`;};const maxAttempts=2;function findBestPosition(element,attempt=1){const positions=[positionTop,positionBottom,positionRight,positionLeft];let hasVisiblePosition=false;function tryPositions(i){if(i{tooltipBody.classList.add(VISIBLE_CLASS);},20);};const hideToolTip=(tooltipBody)=>{tooltipBody.classList.remove(VISIBLE_CLASS);tooltipBody.classList.remove(SET_CLASS);tooltipBody.classList.remove(ADJUST_WIDTH_CLASS);tooltipBody.setAttribute("aria-hidden","true");};const setUpAttributes=(tooltipTrigger)=>{const tooltipID=`tooltip-${Math.floor(Math.random()*900000)+100000}`;const tooltipContent=tooltipTrigger.getAttribute("title");const wrapper=document.createElement("span");const tooltipBody=document.createElement("span");const additionalClasses=tooltipTrigger.getAttribute("data-classes");let position=tooltipTrigger.getAttribute("data-position");if(!position){position="top";tooltipTrigger.setAttribute("data-position",position);}tooltipTrigger.setAttribute("aria-describedby",tooltipID);tooltipTrigger.setAttribute("tabindex","0");tooltipTrigger.removeAttribute("title");tooltipTrigger.classList.remove(TOOLTIP_CLASS);tooltipTrigger.classList.add(TOOLTIP_TRIGGER_CLASS);tooltipTrigger.parentNode.insertBefore(wrapper,tooltipTrigger);wrapper.appendChild(tooltipTrigger);wrapper.classList.add(TOOLTIP_CLASS);wrapper.appendChild(tooltipBody);if(additionalClasses){const classesArray=additionalClasses.split(" ");classesArray.forEach((classname)=>wrapper.classList.add(classname));}tooltipBody.classList.add(TOOLTIP_BODY_CLASS);tooltipBody.setAttribute("id",tooltipID);tooltipBody.setAttribute("role","tooltip");tooltipBody.setAttribute("aria-hidden","true");tooltipBody.textContent=tooltipContent;return {tooltipBody,position,tooltipContent,wrapper};};const handleEscape=()=>{const activeTooltips=selectOrMatches(`.${TOOLTIP_BODY_CLASS}.${SET_CLASS}`);if(!activeTooltips)return;activeTooltips.forEach((activeTooltip)=>hideToolTip(activeTooltip));};const tooltip=behavior({"mouseover focusin":{[TOOLTIP](e){const trigger=e.target;if(trigger.hasAttribute("title"))setUpAttributes(trigger);},[TOOLTIP_TRIGGER](e){const {trigger,body}=getTooltipElements(e.target);showToolTip(body,trigger,trigger.dataset.position);}},focusout:{[TOOLTIP_TRIGGER](e){const {body}=getTooltipElements(e.target);hideToolTip(body);}},keydown:{[BODY]:keymap({Escape:handleEscape})}},{init(root){selectOrMatches(TOOLTIP,root).forEach((tooltipTrigger)=>{setUpAttributes(tooltipTrigger);const {body,wrapper}=getTooltipElements(tooltipTrigger);wrapper.addEventListener("mouseleave",()=>hideToolTip(body));});},teardown(root){selectOrMatches(TOOLTIP,root).forEach((tooltipWrapper)=>{tooltipWrapper.removeEventListener("mouseleave",hideToolTip);});},setup:setUpAttributes,getTooltipElements,show:showToolTip,hide:hideToolTip});module.exports=tooltip;},{"../../uswds-core/src/js/config":34,"../../uswds-core/src/js/utils/behavior":39,"../../uswds-core/src/js/utils/is-in-viewport":42,"../../uswds-core/src/js/utils/select-or-matches":46,"receptor/keymap":10}],33:[function(require,module,exports){"use strict";const behavior=require("../../uswds-core/src/js/utils/behavior");const validate=require("../../uswds-core/src/js/utils/validate-input");const {prefix:PREFIX}=require("../../uswds-core/src/js/config");const selectOrMatches=require("../../uswds-core/src/js/utils/select-or-matches");const VALIDATE_INPUT="input[data-validation-element],textarea[data-validation-element]";const CHECKLIST_ITEM=`.${PREFIX}-checklist__item`;const handleChange=(el)=>validate(el);const createStatusElement=(input)=>{const validationContainer=input.parentNode;const inputID=input.getAttribute("id");const statusSummaryID=`${inputID}-sr-summary`;input.setAttribute("aria-describedby",statusSummaryID);const statusSummaryContainer=document.createElement("span");statusSummaryContainer.setAttribute("data-validation-status","");statusSummaryContainer.classList.add("usa-sr-only");statusSummaryContainer.setAttribute("aria-live","polite");statusSummaryContainer.setAttribute("aria-atomic",true);statusSummaryContainer.setAttribute("id",statusSummaryID);validationContainer.append(statusSummaryContainer);};const createInitialStatus=(input)=>{const validationContainer=input.parentNode;const checklistItems=validationContainer.querySelectorAll(CHECKLIST_ITEM);const validationElement=input.getAttribute("data-validation-element");input.setAttribute("aria-controls",validationElement);checklistItems.forEach((listItem)=>{let currentStatus="status incomplete";if(input.hasAttribute("data-validation-incomplete"))currentStatus=input.getAttribute("data-validation-incomplete");const itemStatus=`${listItem.textContent} ${currentStatus} `;listItem.setAttribute("aria-label",itemStatus);});};const enhanceValidation=(input)=>{createStatusElement(input);createInitialStatus(input);};const validator=behavior({"input change":{[VALIDATE_INPUT](event){handleChange(event.target);}}},{init(root){selectOrMatches(VALIDATE_INPUT,root).forEach((input)=>enhanceValidation(input));}});module.exports=validator;},{"../../uswds-core/src/js/config":34,"../../uswds-core/src/js/utils/behavior":39,"../../uswds-core/src/js/utils/select-or-matches":46,"../../uswds-core/src/js/utils/validate-input":51}],34:[function(require,module,exports){"use strict";module.exports={prefix:"usa"};},{}],35:[function(require,module,exports){"use strict";module.exports={CLICK:"click"};},{}],36:[function(require,module,exports){"use strict";const accordion=require("../../../usa-accordion/src/index");const banner=require("../../../usa-banner/src/index");const button=require("../../../usa-button/src/index");const characterCount=require("../../../usa-character-count/src/index");const comboBox=require("../../../usa-combo-box/src/index");const datePicker=require("../../../usa-date-picker/src/index");const dateRangePicker=require("../../../usa-date-range-picker/src/index");const fileInput=require("../../../usa-file-input/src/index");const footer=require("../../../usa-footer/src/index");const inPageNavigation=require("../../../usa-in-page-navigation/src/index");const inputMask=require("../../../usa-input-mask/src/index");const languageSelector=require("../../../usa-language-selector/src/index");const modal=require("../../../usa-modal/src/index");const navigation=require("../../../usa-header/src/index");const password=require("../../../_usa-password/src/index");const range=require("../../../usa-range/src/index");const search=require("../../../usa-search/src/index");const skipnav=require("../../../usa-skipnav/src/index");const table=require("../../../usa-table/src/index");const timePicker=require("../../../usa-time-picker/src/index");const tooltip=require("../../../usa-tooltip/src/index");const validator=require("../../../usa-validation/src/index");module.exports={accordion,banner,button,characterCount,comboBox,datePicker,dateRangePicker,fileInput,footer,inPageNavigation,inputMask,languageSelector,modal,navigation,password,range,search,skipnav,table,timePicker,tooltip,validator};},{"../../../_usa-password/src/index":12,"../../../usa-accordion/src/index":13,"../../../usa-banner/src/index":14,"../../../usa-button/src/index":15,"../../../usa-character-count/src/index":16,"../../../usa-combo-box/src/index":17,"../../../usa-date-picker/src/index":18,"../../../usa-date-range-picker/src/index":19,"../../../usa-file-input/src/index":20,"../../../usa-footer/src/index":21,"../../../usa-header/src/index":22,"../../../usa-in-page-navigation/src/index":23,"../../../usa-input-mask/src/index":24,"../../../usa-language-selector/src/index":25,"../../../usa-modal/src/index":26,"../../../usa-range/src/index":27,"../../../usa-search/src/index":28,"../../../usa-skipnav/src/index":29,"../../../usa-table/src/index":30,"../../../usa-time-picker/src/index":31,"../../../usa-tooltip/src/index":32,"../../../usa-validation/src/index":33}],37:[function(require,module,exports){"use strict";window.uswdsPresent=true;const uswds=require("./config");const components=require("./index");uswds.components=components;const initComponents=()=>{const target=document.body;Object.keys(components).forEach((key)=>{const behavior=components[key];behavior.on(target);});};if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",initComponents,{once:true});else initComponents();exports.default=uswds;exports.initComponents=initComponents;},{"./config":34,"./index":36}],38:[function(require,module,exports){"use strict";module.exports=(htmlDocument=document)=>htmlDocument.activeElement;},{}],39:[function(require,module,exports){"use strict";const Behavior=require("receptor/behavior");const sequence=(...seq)=>function callHooks(target=document.body){seq.forEach((method)=>{if(typeof this[method]==="function")this[method].call(this,target);});};module.exports=(events,props)=>Behavior(events,{on:sequence("init","add"),off:sequence("teardown","remove"),...props});},{"receptor/behavior":4}],40:[function(require,module,exports){"use strict";module.exports=function debounce(callback,delay=500){let timer=null;return (...args)=>{window.clearTimeout(timer);timer=window.setTimeout(()=>{callback.apply(this,args);},delay);};};},{}],41:[function(require,module,exports){"use strict";const {keymap}=require("receptor");const behavior=require("./behavior");const select=require("./select");const activeElement=require("./active-element");const FOCUSABLE='a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable]';const tabHandler=(context)=>{const focusableElements=select(FOCUSABLE,context);const firstTabStop=focusableElements[0];const lastTabStop=focusableElements[focusableElements.length-1];function tabAhead(event){if(activeElement()===lastTabStop){event.preventDefault();firstTabStop.focus();}}function tabBack(event){if(activeElement()===firstTabStop){event.preventDefault();lastTabStop.focus();}else{if(!focusableElements.includes(activeElement())){event.preventDefault();firstTabStop.focus();}}}return {firstTabStop,lastTabStop,tabAhead,tabBack};};module.exports=(context,additionalKeyBindings={})=>{const tabEventHandler=tabHandler(context);const bindings=additionalKeyBindings;const {Esc,Escape}=bindings;if(Escape&&!Esc)bindings.Esc=Escape;const keyMappings=keymap({Tab:tabEventHandler.tabAhead,"Shift+Tab":tabEventHandler.tabBack,...additionalKeyBindings});const focusTrap=behavior({keydown:keyMappings},{init(){if(tabEventHandler.firstTabStop)tabEventHandler.firstTabStop.focus();},update(isActive){if(isActive)this.on();else this.off();}});return focusTrap;};},{"./active-element":38,"./behavior":39,"./select":47,"receptor":9}],42:[function(require,module,exports){"use strict";function isElementInViewport(el,win=window,docEl=document.documentElement){const rect=el.getBoundingClientRect();return rect.top>=0&&rect.left>=0&&rect.bottom<=(win.innerHeight||docEl.clientHeight)&&rect.right<=(win.innerWidth||docEl.clientWidth);}module.exports=isElementInViewport;},{}],43:[function(require,module,exports){"use strict";function isIosDevice(){return typeof navigator!=="undefined"&&(navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;}module.exports=isIosDevice;},{}],44:[function(require,module,exports){"use strict";!function(factory){module.exports=factory();}(function(){"use strict";var Sanitizer={_entity:/[&<>"'/]/g,_entities:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},getEntity:function(s){return Sanitizer._entities[s];},escapeHTML:function(strings){var result="";for(var i=0;i1?_len-1:0);for(var _key=1;_key<_len;_key++)values[_key-1]=arguments[_key];var escaped=Sanitizer.escapeHTML.apply(Sanitizer,[strings].concat(values));return {__html:escaped,toString:function(){return "[object WrappedHTMLObject]";},info:"This is a wrapped HTML object. See https://developer.mozilla.or"+"g/en-US/Firefox_OS/Security/Security_Automation for more."};},unwrapSafeHTML:function(){var _len=arguments.length;var htmlObjects=new Array(_len);for(var _key=0;_key<_len;_key++)htmlObjects[_key]=arguments[_key];var markupList=htmlObjects.map(function(obj){return obj.__html;});return markupList.join("");}};return Sanitizer;});},{}],45:[function(require,module,exports){"use strict";module.exports=function getScrollbarWidth(){const outer=document.createElement("div");outer.style.visibility="hidden";outer.style.overflow="scroll";outer.style.msOverflowStyle="scrollbar";document.body.appendChild(outer);const inner=document.createElement("div");outer.appendChild(inner);const scrollbarWidth=`${outer.offsetWidth-inner.offsetWidth}px`;outer.parentNode.removeChild(outer);return scrollbarWidth;};},{}],46:[function(require,module,exports){"use strict";const select=require("./select");const isElement=(value)=>value&&typeof value==="object"&&value.nodeType===1;module.exports=(selector,context)=>{const selection=select(selector,context);if(typeof selector!=="string")return selection;if(isElement(context)&&context.matches(selector))selection.push(context);return selection;};},{"./select":47}],47:[function(require,module,exports){"use strict";const isElement=(value)=>value&&typeof value==="object"&&value.nodeType===1;module.exports=(selector,context)=>{if(typeof selector!=="string")return [];if(!context||!isElement(context))context=window.document;const selection=context.querySelectorAll(selector);return Array.prototype.slice.call(selection);};},{}],48:[function(require,module,exports){"use strict";module.exports=(field,mask)=>{field.setAttribute("autocapitalize","off");field.setAttribute("autocorrect","off");field.setAttribute("type",mask?"password":"text");};},{}],49:[function(require,module,exports){"use strict";const toggleFieldMask=require("./toggle-field-mask");const CONTROLS="aria-controls";const PRESSED="aria-pressed";const SHOW_ATTR="data-show-text";const HIDE_ATTR="data-hide-text";const getHideText=(showText)=>showText.replace(/\bShow\b/i,(show)=>`${show[0]==="S"?"H":"h"}ide`);const resolveIdRefs=(id)=>{const ids=id.trim().split(/\s+/);return ids.map((i)=>{const el=document.getElementById(i);if(!el){const err=`no element with id: ${i}`;throw new Error(err);}return el;});};module.exports=(el)=>{const pressed=el.hasAttribute(PRESSED)&&el.getAttribute(PRESSED)!=="true";const fields=resolveIdRefs(el.getAttribute(CONTROLS));fields.forEach((field)=>toggleFieldMask(field,pressed));if(!el.hasAttribute(SHOW_ATTR))el.setAttribute(SHOW_ATTR,el.textContent);const showText=el.getAttribute(SHOW_ATTR);const hideText=el.getAttribute(HIDE_ATTR)||getHideText(showText);el.textContent=pressed?showText:hideText;el.setAttribute(PRESSED,pressed);return pressed;};},{"./toggle-field-mask":48}],50:[function(require,module,exports){"use strict";const EXPANDED="aria-expanded";const CONTROLS="aria-controls";const HIDDEN="hidden";module.exports=(button,expanded)=>{let safeExpanded=expanded;if(typeof safeExpanded!=="boolean")safeExpanded=button.getAttribute(EXPANDED)==="false";button.setAttribute(EXPANDED,safeExpanded);const id=button.getAttribute(CONTROLS);const controls=document.getElementById(id);if(!controls)throw new Error(`No toggle target found with id: "${id}"`);if(safeExpanded)controls.removeAttribute(HIDDEN);else controls.setAttribute(HIDDEN,"");return safeExpanded;};},{}],51:[function(require,module,exports){"use strict";const debounce=require("./debounce");const {prefix:PREFIX}=require("../config");const CHECKED_CLASS=`${PREFIX}-checklist__item--checked`;module.exports=function validate(el){const id=el.dataset.validationElement;const checkList=id.charAt(0)==="#"?document.querySelector(id):document.getElementById(id);if(!checkList)throw new Error(`No validation element found with id: "${id}"`);let statusSummary="";Object.entries(el.dataset).forEach(([key,value])=>{if(key.startsWith("validate")){const validatorName=key.substr("validate".length).toLowerCase();const validatorPattern=new RegExp(value);const validatorSelector=`[data-validator="${validatorName}"]`;const validatorCheckbox=checkList.querySelector(validatorSelector);const validatorParent=el.parentNode;const statusSummaryContainer=validatorParent.querySelector(`[data-validation-status]`);const checked=validatorPattern.test(el.value);validatorCheckbox.classList.toggle(CHECKED_CLASS,checked);if(!validatorCheckbox)throw new Error(`No validator checkbox found for: "${validatorName}"`);const statusComplete=el.dataset.validationComplete||"status complete";const statusIncomplete=el.dataset.validationIncomplete||"status incomplete";let checkboxContent=`${validatorCheckbox.textContent} `;if(validatorCheckbox.classList.contains(CHECKED_CLASS))checkboxContent+=statusComplete;else checkboxContent+=statusIncomplete;validatorCheckbox.setAttribute("aria-label",checkboxContent);statusSummary+=`${checkboxContent}. `;const srUpdateStatus=debounce(()=>{statusSummaryContainer.textContent=statusSummary;},1000);srUpdateStatus();}});};},{"../config":34,"./debounce":40}]},{},[37]);;
(function($){'use strict';Drupal.behaviors.portMenuLinks={attach:function(context,settings){once('portMenuLinks','html',context).forEach(function(element){const primaryMenu=document.querySelector('HEADER .usa-nav');const megaMenuWrappers=primaryMenu.querySelectorAll('.menu_level__1');const portNonImageLinks=()=>{if(!megaMenuWrappers)return;megaMenuWrappers.forEach((megaMenuWrapper)=>{const nonImagedLinksContainer=megaMenuWrapper.querySelector('.non_imaged_links__container');const nonImagedLinks=megaMenuWrapper.querySelectorAll('.no_menu_link_imaged');if(!nonImagedLinks)return;nonImagedLinks.forEach((link)=>{const linkParent=link.closest('.individual_menu_level__1');nonImagedLinksContainer.appendChild(linkParent);});});};portNonImageLinks();});}};Drupal.behaviors.usdojMMSlider={attach:function(context,settings){once('usdojMMSlider','html',context).forEach(function(element){const header=context.querySelector("header.usa-header");const nav=header.querySelector("label.hamburger > .usa-nav");const menuClasses={mainWrapper:"usdojMobileMenuSlider",activeChild:"usdojMobileMenuSlider__activeChild",menuItemOpen:"usdojMobileMenuSlider__open",menuItemHidden:"usdojMobileMenuSlider__hidden",tempHoverRemoval:"temp-hover-removal"};const overlay=context.querySelector(".usdoj_overlay.below-header");const state={menuOpen:false,menuItemExpanded:false};const regionHeader=header.querySelector(".region-header");const menuCheckbox=header.querySelector("#mobile-btn");const desktopBreakpoint=880;const attachedUtilityMenu=nav.querySelector('.mobile-utils');const nestedPrimaryMenu=nav.querySelector('.nested-primary-menu');const attachedElements=[attachedUtilityMenu,nestedPrimaryMenu];let activeMenuItem,activeButton;let menuLvl_0=[];let filteredMenuLvl_0=[];if(!header&&!nav)return;if(window.innerWidth>desktopBreakpoint)header.classList.remove(menuClasses.mainWrapper);const observer=new ResizeObserver((entries)=>{const headerEl=entries[0];const notInDesktop=headerEl.contentRect.width{if(!activeMenuItem)return;nav.classList.remove(menuClasses.activeChild);activeMenuItem.classList.remove(menuClasses.menuItemOpen);filteredMenuLvl_0.forEach((item)=>item.classList.remove(menuClasses.menuItemHidden));attachedElements.forEach((element)=>{if(element)element.classList.remove(menuClasses.menuItemHidden);;});};const stateWatchers=()=>{if(state.menuOpen){clearClasses();if(window.innerWidth{if(slice==="menu")menuCheckbox.checked?state.menuOpen=true:state.menuOpen=false;if(slice==="menuItem")activeButton.getAttribute('aria-expanded')===true?state.menuItemExpanded=true:state.menuItemExpanded=false;};const triggerRemotely=(operation)=>{if(!state.menuOpen)return;const event=new Event('remotelyTriggered');if(operation==='open')menuCheckbox.checked=true;if(operation==='close')menuCheckbox.checked=false;if(operation==='toggle')menuCheckbox.checked=!menuCheckbox.checked;menuCheckbox.dispatchEvent(event);};menuCheckbox.addEventListener('remotelyTriggered',function(){updateState('menu');stateWatchers();});menuCheckbox.addEventListener('change',function(evt){updateState("menu");stateWatchers();});regionHeader.addEventListener('click',function(evt){triggerRemotely("close");});overlay.addEventListener('click',function(evt){triggerRemotely("close");});const toggleAttachments=()=>{if(attachedElements.length===0)return;if(state.menuItemExpanded)attachedElements.forEach((el)=>{if(el)el.classList.add(menuClasses.menuItemHidden);});else attachedElements.forEach((el)=>{if(el)el.classList.remove(menuClasses.menuItemHidden);});};const toggleMenuClasses=()=>{if(!activeButton)return;if(activeButton.getAttribute('aria-expanded')==="true"){nav.classList.remove(menuClasses.activeChild);filteredMenuLvl_0.forEach((item)=>item.classList.remove(menuClasses.menuItemHidden));activeMenuItem.classList.remove(menuClasses.menuItemOpen);state.menuItemExpanded=false;toggleAttachments();}else{nav.classList.add(menuClasses.activeChild);filteredMenuLvl_0.forEach((item)=>item.classList.add(menuClasses.menuItemHidden));activeMenuItem.classList.add(menuClasses.menuItemOpen);state.menuItemExpanded=true;toggleAttachments();}};const activeButtonWatcher=(evt)=>{if(!activeButton)return;activeButton.addEventListener('click',function(){this.classList.add(menuClasses.tempHoverRemoval);this.addEventListener('mouseleave',function(){this.classList.remove(menuClasses.tempHoverRemoval);},{once:true});});activeButton.onblur=()=>{if(evt.target===activeButton)clearClasses();};};const mimicSlide=(evt)=>{activeMenuItem=evt.target.closest('.usa-nav__primary-item');if(!activeMenuItem)return;activeButton=activeMenuItem.querySelector(':scope > .usa-accordion__button');if(!activeButton)return;activeMenuItem.querySelector('.usa-nav__submenu');menuLvl_0=nav.querySelectorAll('.menu_level__0 > .usa-nav__primary-item');filteredMenuLvl_0=[...menuLvl_0].filter((item)=>item!==activeMenuItem);toggleMenuClasses();activeButtonWatcher(evt);};nav.addEventListener('click',function(evt){if(evt.target.closest('.nested-primary-menu'))return;if(!evt.target.closest('.usa-accordion__button'))triggerRemotely("close");else mimicSlide(evt);});});}};Drupal.behaviors.primaryMenuAsAuxiliary={attach:function(context,settings){once('primaryMenuAsAuxiliary','html',context).forEach(function(element){const htmlDoc=context.querySelector("html");const menus=context.querySelectorAll(".usaDoj-menu");const overlay=context.querySelector(".usdoj_overlay");const classes={menuItemExpanded:'menuItem__expanded',menuItemHidden:'menuItem__hidden'};menus.forEach((menu)=>initMenu(menu));function initMenu(activeMenu){let menuLvl_0=[];let filteredMenuLvl_0=[];let activeMenuItem,activeButton;const menuNeedsOverlay=!activeMenu.classList.contains("no-overlay");const attachedUtilityMenu=activeMenu.querySelector(".mobile-utils");let attachedElements=[attachedUtilityMenu];const state={menuBtnExpanded:false,menuItemExpanded:false};const menuBtn=activeMenu.querySelector('.menu-btn');const menuWrapper=activeMenu.querySelector('.menu-wrapper');const closureTriggers=[menuWrapper,overlay];const updateState=(stateSlice)=>{if(stateSlice==="menuBtnExpanded")menuBtn.getAttribute('aria-expanded')==="true"?state.menuBtnExpanded=true:state.menuBtnExpanded=false;if(stateSlice==="menuItemExpanded")activeButton.getAttribute('aria-expanded')==="true"?state.menuBtnExpanded=true:state.menuBtnExpanded=false;stateListeners();};const stateListeners=()=>{if(state.menuBtnExpanded){menuBtn.setAttribute('aria-expanded',"true");toggleMenuEl();toggleOverlay();}else{menuBtn.setAttribute('aria-expanded',"false");toggleMenuEl();toggleOverlay();clearClasses();}if(state.menuItemExpanded)attachedElements.forEach((el)=>el.classList.add(classes.menuItemHidden));else attachedElements.forEach((el)=>el.classList.remove(classes.menuItemHidden));};const toggleMenuEl=()=>{menuWrapper.hidden=!state.menuBtnExpanded;};const toggleOverlay=()=>{if(!menuNeedsOverlay)return;if(state.menuBtnExpanded)overlay.classList.add("show");else overlay.classList.remove("show");};const toggleAttachments=()=>{if(attachedElements.length===0)return;if(state.menuItemExpanded)attachedElements.forEach((el)=>el.classList.add(classes.menuItemHidden));else attachedElements.forEach((el)=>el.classList.remove(classes.menuItemHidden));};const toggleMenuClasses=()=>{if(!activeButton)return;if(activeButton.getAttribute('aria-expanded')==="true"){filteredMenuLvl_0.forEach((item)=>item.classList.remove(classes.menuItemHidden));activeMenuItem.classList.remove(classes.menuItemExpanded);state.menuItemExpanded=false;toggleAttachments();}else{filteredMenuLvl_0.forEach((item)=>item.classList.add(classes.menuItemHidden));activeMenuItem.classList.add(classes.menuItemExpanded);state.menuItemExpanded=true;toggleAttachments();}};const mimicSlide=(evt)=>{activeMenuItem=evt.target.closest('.usa-nav__primary-item');if(!activeMenuItem)return;activeButton=activeMenuItem.querySelector(':scope > .usa-accordion__button');if(!activeButton)return;menuLvl_0=menuWrapper.querySelectorAll('.menu_level__0 > .usa-nav__primary-item');filteredMenuLvl_0=[...menuLvl_0].filter((item)=>item!==activeMenuItem);toggleMenuClasses();};const clearClasses=()=>{if(!activeMenuItem)return;activeMenuItem.classList.remove(classes.menuItemExpanded);filteredMenuLvl_0.forEach((item)=>item.classList.remove(classes.menuItemHidden));};const resetAndClose=(evt)=>{if(evt.target!==evt.currentTarget)return;menuBtn.setAttribute('aria-expanded','false');updateState('menuBtnExpanded');};menuBtn.addEventListener('click',function(){if(this.getAttribute('aria-expanded')==='false'){this.setAttribute('aria-expanded','true');updateState("menuBtnExpanded");attachedElements.forEach((el)=>el.classList.remove(classes.menuItemHidden));}else{this.setAttribute('aria-expanded','false');updateState("menuBtnExpanded");}});activeMenu.addEventListener('click',mimicSlide);closureTriggers.forEach((item)=>item.addEventListener('click',resetAndClose));}});}};Drupal.behaviors.nestedPrimaryMenu={attach:function(context,settings){once('nestedPrimaryMenu','html',context).forEach(function(element){const htmlDoc=context.querySelector("html");const menu=context.querySelector(".nested-primary-menu");const overlay=context.querySelector(".usdoj_overlay");const classes={menuItemExpanded:'menuItem__expanded',menuItemHidden:'menuItem__hidden',tempHoverRemoval:"temp-hover-removal"};if(!menu)return;function initMenu(activeMenu){let menuLvl_0=[];let filteredMenuLvl_0=[];let activeMenuItem,activeButton;const menuNeedsOverlay=!activeMenu.classList.contains("no-overlay");const groupMenu=htmlDoc.querySelector(".usa-nav__inner > .usa-nav__primary");const groupMenuUtility=htmlDoc.querySelector("label.hamburger > nav .usa-nav__inner > .mobile-utils_lvl1");const attachedUtilityMenu=activeMenu.querySelector(".mobile-utils");let attachedElements=[groupMenu,groupMenuUtility,attachedUtilityMenu];const state={menuBtnExpanded:false,menuItemExpanded:false};const menuBtn=activeMenu.querySelector('.menu-btn');const groupMenuBtn=context.getElementById('mobile-btn');const menuWrapper=activeMenu.querySelector('.menu-wrapper');const closureTriggers=[groupMenuBtn,overlay];menuWrapper.addEventListener('click',function(evt){if(activeButton)resetAndClose(evt);if(evt.target===evt.currentTarget)evt.preventDefault();});const updateState=(stateSlice)=>{if(stateSlice==="menuBtnExpanded"){menuBtn.getAttribute('aria-expanded')==="true"?state.menuBtnExpanded=true:state.menuBtnExpanded=false;if(activeButton)activeButton.getAttribute('aria-expanded')==="true"?state.menuItemExpanded=true:state.menuItemExpanded=false;}if(stateSlice==="menuItemExpanded")activeButton.getAttribute('aria-expanded')==="true"?state.menuBtnExpanded=true:state.menuBtnExpanded=false;stateListeners();};const stateListeners=()=>{if(state.menuBtnExpanded){menuBtn.setAttribute('aria-expanded',"true");toggleMenuEl();toggleOverlay();}else{menuBtn.setAttribute('aria-expanded',"false");menuWrapper.setAttribute('data-menu-expanded',"false");toggleMenuEl();toggleOverlay();clearClasses();}if(state.menuItemExpanded)attachedElements.forEach((el)=>{if(el)el.classList.add(classes.menuItemHidden);});else attachedElements.forEach((el)=>{if(el)el.classList.remove(classes.menuItemHidden);});};const toggleMenuEl=()=>{if(state.menuBtnExpanded){menuWrapper.classList.remove('display-none');menuWrapper.setAttribute('data-menu-expanded',"true");}else{menuWrapper.classList.add('display-none');menuWrapper.setAttribute('data-menu-expanded',"false");}};const toggleOverlay=()=>{if(!menuNeedsOverlay)return;if(state.menuBtnExpanded)overlay.classList.add("show");else overlay.classList.remove("show");};const toggleAttachments=()=>{if(attachedElements.length===0)return;if(state.menuItemExpanded)attachedElements.forEach((el)=>{if(el)el.classList.add(classes.menuItemHidden);});else attachedElements.forEach((el)=>{if(el)el.classList.remove(classes.menuItemHidden);});};const toggleMenuClasses=()=>{if(!activeButton)return;if(activeButton.getAttribute('aria-expanded')==="true"){filteredMenuLvl_0.forEach((item)=>item.classList.remove(classes.menuItemHidden));activeMenuItem.classList.remove(classes.menuItemExpanded);state.menuItemExpanded=false;toggleAttachments();}else{filteredMenuLvl_0.forEach((item)=>item.classList.add(classes.menuItemHidden));activeMenuItem.classList.add(classes.menuItemExpanded);state.menuItemExpanded=true;toggleAttachments();}};const activeButtonWatcher=(evt)=>{if(!activeButton)return;activeButton.addEventListener('click',function(){this.classList.add(classes.tempHoverRemoval);this.addEventListener('mouseleave',function(){this.classList.remove(classes.tempHoverRemoval);},{once:true});});activeButton.onblur=(evt)=>{if(evt.target===activeButton)clearClasses();};};const mimicSlide=(evt)=>{activeMenuItem=evt.target.closest('.usa-nav__primary-item');if(!activeMenuItem)return;activeButton=activeMenuItem.querySelector(':scope > .usa-accordion__button');if(!activeButton)return;menuLvl_0=menuWrapper.querySelectorAll('.menu_level__0 > .usa-nav__primary-item');filteredMenuLvl_0=[...menuLvl_0].filter((item)=>item!==activeMenuItem);toggleMenuClasses();activeButtonWatcher();};const clearClasses=()=>{if(activeMenuItem)activeMenuItem.classList.remove(classes.menuItemExpanded);filteredMenuLvl_0.forEach((item)=>{if(item)item.classList.remove(classes.menuItemHidden);});toggleAttachments();};const resetAndClose=(evt)=>{if(evt.target!==evt.currentTarget)return;menuBtn.setAttribute('aria-expanded','false');updateState('menuBtnExpanded');};menuBtn.addEventListener('click',function(){if(this.getAttribute('aria-expanded')==='false'){this.setAttribute('aria-expanded','true');updateState("menuBtnExpanded");attachedElements.forEach((el)=>el.classList.remove(classes.menuItemHidden));}else{this.setAttribute('aria-expanded','false');updateState("menuBtnExpanded");}});activeMenu.addEventListener('click',mimicSlide);closureTriggers.forEach((item)=>item.addEventListener('click',resetAndClose));}initMenu(menu);});}};Drupal.behaviors.usdojDesktopNavOverlay={attach:function(context,settings){once('usdojDesktopNavOverlay','html',context).forEach(function(element){});}};Drupal.behaviors.usdojLeftSidebar={attach:function(context,settings){once('usdojLeftSidebar','html',context).forEach(function(element){const $submenuCurrentItem=$('.usa-nav__sidebar .usa-nav__submenu a.usa-current');const $lvl0LinksWrapper=$('.usa-nav__sidebar .usa-lvl0-links-wrapper, .usa-nav__sidebar .usa-lvl1-links-wrapper, .usa-nav__sidebar .usa-lvl2-links-wrapper');if($lvl0LinksWrapper.children('a.usa-current').length>0)$lvl0LinksWrapper.children('a.usa-current').closest('.usa-lvl0-links-wrapper, .usa-lvl1-links-wrapper, .usa-lvl2-links-wrapper').addClass('is-active');if($submenuCurrentItem.length>0){const $activeMenuItemLlv0=$submenuCurrentItem.closest('.usa-nav__submenu');$activeMenuItemLlv0.removeAttr('hidden');$activeMenuItemLlv0.siblings('.usa-lvl0-links-wrapper, .usa-lvl1-links-wrapper, .usa-lvl2-links-wrapper').children('.usa-nav__link').attr('aria-expanded','true');}$('.usa-nav__sidebar .usa-nav__primary-item .toggle-btn').on('click',function(){$(this).toggleClass('is-closed');$(this).siblings('.usa-nav__link').each(function(){this.setAttribute('aria-expanded',this.getAttribute('aria-expanded')==='true'?'false':'true');});$(this).closest('.usa-lvl0-links-wrapper, .usa-lvl1-links-wrapper, .usa-lvl2-links-wrapper').siblings('.usa-nav__submenu').each(function(){this.toggleAttribute('hidden');});});});}};Drupal.behaviors.injectDOJHomeLink={attach:function(context,settings){once('injectDOJHomeLink','html',context).forEach(function(element){const menu=context.querySelector(".nested-primary-menu-items");if(!menu)return;const homeLinkHTML=`
`;menu.insertAdjacentHTML('afterbegin',homeLinkHTML);});}};Drupal.behaviors.getHeaderHeight={attach:function(context,settings){once('getHeaderHeight','html',context).forEach(function(element){const header=context.querySelector("header.usa-header");if(!header)return;const menu=header.querySelector('.hamburger > nav');const menuBtnCheckbox=context.getElementById('mobile-btn');menuBtnCheckbox.addEventListener('change',function(){if(this.checked){let headerHeight=header.offsetHeight;menu.style.top=`${headerHeight}px`;}});});}};Drupal.behaviors.setActiveParentClass={attach:function(context,settings){once('setActiveParentClass','html',context).forEach(function(){if(window.location.pathname!=='/'){let path=window.location.pathname.split('/');let $submenus=$('.usa-nav__submenu');let pathEnd=path[path.length-1];let $links;$submenus.each(function(){let $menu=$(this);$links=$menu.find('a');$links.each(function(){let href=$(this).attr('href').split('/');if(href[href.length-1]===pathEnd)$menu.siblings('button').addClass('active-child');});});}});}};Drupal.behaviors.groupLeftMenu_on_layoutBuilder_pages={attach:function(context,settings){const path=window.location.pathname;$('.lb-left-nav a').each(function(){if($(this).attr('href')===path)$(this).addClass('usa-current');});}};Drupal.behaviors.newsSideMenu_activeState_monitor={attach:function(context,settings){once('newsSideMenu_activeState_monitor','html',context).forEach(function(element){const newsMenu=context.querySelector(".block-system-menu-blocknews");const body=context.querySelector('body');const nodeContentType=body.getAttribute('data-content-type');if(!newsMenu||nodeContentType===null)return;const newsMenuLinks=newsMenu.querySelectorAll('a');const pathAliases={blog_post:"/news/blogs",image_gallery:"/news/photo-galleries",podcast:"/news/podcasts",press_release:"/news/press-releases",speech:"/news/speeches",youtube_video:"/news/videos"};newsMenuLinks.forEach((link)=>{const linkPath=link.getAttribute('href');const linkPathAlias=pathAliases[nodeContentType];if(linkPath===linkPathAlias)link.classList.add('usa-current');});});}};})(jQuery);;
(function($){'use strict';Drupal.behaviors.portSidebarFirstContent={attach:function(context,settings){once('portSidebarFirstContent','html',context).forEach(function(element){const body=context.body;const sidebarFirst=context.querySelector('.layout-sidebar-first');const sidebarLB_33_67=context.querySelector('.layout--twocol-section--33-67 .layout__region--first');const sidebarLB_25_75=context.querySelector('.layout--twocol-section--25-75 .layout__region--first');const postContent=context.querySelector('.post-content-region');const sidebarMenus=context.querySelectorAll('.wrapper-sidenav');const dojFacetsGroup=context.getElementById('block-dojfacetsgroup');const dojFacetGroupsButton=context.querySelector('#block-dojfacetsgroup .group-wrapper__heading BUTTON');const dojFacetGroupsBody=context.querySelector('#block-dojfacetsgroup .group-wrapper__content');let movableSidebarItems=[];const doNotMove=[...sidebarMenus,dojFacetsGroup];const dojSidebarRegions=[sidebarFirst,sidebarLB_33_67,sidebarLB_25_75];const dataAttrAssignments={sidebarFirst:'sidebar-first',sidebarLB_33_67:'sidebar-lb-33-67',sidebarLB_25_75:'sidebar-lb-25-75'};const classAssignments={belowDesktop:"below-desktop"};const state={isDesktop:false,lastInMobileValue:null,itemsHaveBeenSplit:null};const desktopBreakpoint=880;if(dojSidebarRegions.every((sidebar)=>!sidebar))return;function assignSidebarsIds(){dojSidebarRegions.forEach((activeSidebar)=>{if(!activeSidebar)return;const tempId=Math.floor(Math.random()*1000000);activeSidebar.setAttribute('data-sidebar-swap-id',tempId.toString());});}function defineMovableItems(){dojSidebarRegions.forEach((activeSidebar)=>{if(!activeSidebar)return;const allActiveSidebarItems=activeSidebar.querySelectorAll(':scope > *');const allActiveSidebarItemsArr=Array.from(allActiveSidebarItems);const allActiveSidebarMovableItems=allActiveSidebarItemsArr.filter((el)=>!doNotMove.includes(el));allActiveSidebarMovableItems.forEach((item)=>{const parentSidebar=item.parentElement;item.setAttribute('data-is-movable',"true");if(item.parentElement.classList.contains('layout-sidebar-first')){item.setAttribute('data-sidebar-parent',dataAttrAssignments.sidebarFirst);item.setAttribute('data-sidebar-parent-swap-id',parentSidebar.getAttribute('data-sidebar-swap-id'));}if(item.parentElement.classList.contains('layout__region--first')){item.setAttribute('data-sidebar-parent',dataAttrAssignments.sidebarLB_33_67);item.setAttribute('data-sidebar-parent-swap-id',parentSidebar.getAttribute('data-sidebar-swap-id'));}movableSidebarItems.push(item);});});}assignSidebarsIds();defineMovableItems();function syncFacetGroupAccordion(position){if(!dojFacetsGroup)return;if(!dojFacetsGroup.classList.contains('desktop:accordion-leave-open'))return;if(position==="open"){dojFacetGroupsButton.setAttribute('aria-expanded','true');dojFacetGroupsButton.setAttribute('aria-disabled','true');dojFacetGroupsButton.setAttribute('disabled','true');dojFacetGroupsBody.hidden=false;dojFacetGroupsButton.addEventListener('click',(evt)=>evt.preventDefault());}if(position==="close"){dojFacetGroupsButton.setAttribute('aria-expanded','false');dojFacetGroupsButton.removeAttribute('disabled');dojFacetGroupsButton.removeAttribute('aria-disabled');dojFacetGroupsBody.hidden=true;}}function syncMenuGroupWithWindowSize(sidebarMenuButton,sidebarMenuBody,position){if(!sidebarMenuButton||!sidebarMenuBody)return;if((state.isDesktop&&state.itemsHaveBeenSplit)||position==="open"){sidebarMenuButton.setAttribute('aria-expanded','true');sidebarMenuButton.setAttribute('aria-disabled','true');sidebarMenuButton.setAttribute('disabled','true');sidebarMenuBody.hidden=false;sidebarMenuButton.addEventListener('click',(evt)=>evt.preventDefault());}if((!state.isDesktop&&!state.itemsHaveBeenSplit||position==="close")){sidebarMenuButton.setAttribute('aria-expanded','false');sidebarMenuButton.removeAttribute('disabled');sidebarMenuButton.removeAttribute('aria-disabled');sidebarMenuBody.hidden=true;}}function splitSideBarFirstContent(){if(!state.isDesktop&&!state.itemsHaveBeenSplit){movableSidebarItems.forEach((el)=>{postContent.append(el);});syncFacetGroupAccordion("close");state.itemsHaveBeenSplit=!state.itemsHaveBeenSplit;}}function joinSideBarFirstContent(){if(state.isDesktop&&state.itemsHaveBeenSplit){movableSidebarItems.forEach((el)=>{const parentSidebar=context.querySelector(`[data-sidebar-swap-id="${el.getAttribute("data-sidebar-parent-swap-id")}"]`);parentSidebar.append(el);});state.itemsHaveBeenSplit=!state.itemsHaveBeenSplit;syncFacetGroupAccordion("open");}}if(window.innerWidth>desktopBreakpoint){body.classList.remove(classAssignments.belowDesktop);state.isDesktop=true;dojSidebarRegions.forEach((sidebar)=>{if(sidebar){syncFacetGroupAccordion("open");sidebarMenus.forEach((sidebarMenu)=>{const sidebarMenuButton=sidebarMenu.querySelector('.group-wrapper__heading BUTTON');const sidebarMenuBody=sidebarMenu.querySelector('.group-wrapper__content');syncMenuGroupWithWindowSize(sidebarMenuButton,sidebarMenuBody,"open");});}});}const observer=new ResizeObserver((entries)=>{const bodyEl=entries[0];const inMobile=bodyEl.contentRect.width{if(sidebar)splitSideBarFirstContent();});body.classList.add(classAssignments.belowDesktop);state.isDesktop=false;sidebarMenus.forEach((sidebarMenu)=>{const sidebarMenuButton=sidebarMenu.querySelector('.group-wrapper__heading BUTTON');const sidebarMenuBody=sidebarMenu.querySelector('.group-wrapper__content');syncMenuGroupWithWindowSize(sidebarMenuButton,sidebarMenuBody,"close");});}else{dojSidebarRegions.forEach((sidebar)=>{if(sidebar)joinSideBarFirstContent();});body.classList.remove(classAssignments.belowDesktop);state.isDesktop=true;sidebarMenus.forEach((sidebarMenu)=>{const sidebarMenuButton=sidebarMenu.querySelector('.group-wrapper__heading BUTTON');const sidebarMenuBody=sidebarMenu.querySelector('.group-wrapper__content');syncMenuGroupWithWindowSize(sidebarMenuButton,sidebarMenuBody,"open");});}state.lastInMobileValue=inMobile;});observer.observe(body);});}};})(jQuery);;
(function($){'use strict';function getFileSize(url){let fileSize=new Promise((resolve,reject)=>{var xhr=new XMLHttpRequest();xhr.open('GET',url,true);xhr.onprogress=(event)=>{if(event.lengthComputable)resolve(event.total);else reject(new Error('No content-length available'));xhr.abort();};xhr.send();});return fileSize;}function bytesToSize(bytes){var sizes=['Bytes','KB','MB'];if(bytes===0)return 'n/a';var i=parseInt(Math.floor(Math.log(bytes)/Math.log(1024)));return Math.round(bytes/Math.pow(1024,i),2)+' '+sizes[i];}Drupal.behaviors.dojGetFileSize={attach:function(context,settings){once('dojGetFileSize','html',context).forEach(function(element){const allDownloadableFiles=context.querySelectorAll('.downloadable');if(allDownloadableFiles.length===0)return;allDownloadableFiles.forEach((file)=>{const src=file.querySelector('a').href;const fileSizeField=file.querySelector('.downloadable-file__size');let sizeInBytes;const calcFileSize=async()=>{sizeInBytes=await getFileSize(src);fileSizeField.textContent=bytesToSize(sizeInBytes);};calcFileSize();});});}};})(jQuery);;
!function(a){"use strict";function b(a){return (a||"").toLowerCase();}var c="2.1.6";a.fn.cycle=function(c){var d;return 0!==this.length||a.isReady?this.each(function(){var d,e,f,g,h=a(this),i=a.fn.cycle.log;if(!h.data("cycle.opts")){(h.data("cycle-log")===!1||c&&c.log===!1||e&&e.log===!1)&&(i=a.noop),i("--c2 init--"),d=h.data();for(var j in d)d.hasOwnProperty(j)&&/^cycle[A-Z]+/.test(j)&&(g=d[j],f=j.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,b),i(f+":",g,"("+typeof g+")"),d[f]=g);e=a.extend({},a.fn.cycle.defaults,d,c||{}),e.timeoutId=0,e.paused=e.paused||!1,e.container=h,e._maxZ=e.maxZ,e.API=a.extend({_container:h},a.fn.cycle.API),e.API.log=i,e.API.trigger=function(a,b){return e.container.trigger(a,b),e.API;},h.data("cycle.opts",e),h.data("cycle.API",e.API),e.API.trigger("cycle-bootstrap",[e,e.API]),e.API.addInitialSlides(),e.API.preInitSlideshow(),e.slides.length&&e.API.initSlideshow();}}):(d={s:this.selector,c:this.context},a.fn.cycle.log("requeuing slideshow (dom not ready)"),a(function(){a(d.s,d.c).cycle(c);}),this);},a.fn.cycle.API={opts:function(){return this._container.data("cycle.opts");},addInitialSlides:function(){var b=this.opts(),c=b.slides;b.slideCount=0,b.slides=a(),c=c.jquery?c:b.container.find(c),b.random&&c.sort(function(){return Math.random()-.5;}),b.API.add(c);},preInitSlideshow:function(){var b=this.opts();b.API.trigger("cycle-pre-initialize",[b]);var c=a.fn.cycle.transitions[b.fx];c&&a.isFunction(c.preInit)&&c.preInit(b),b._preInitialized=!0;},postInitSlideshow:function(){var b=this.opts();b.API.trigger("cycle-post-initialize",[b]);var c=a.fn.cycle.transitions[b.fx];c&&a.isFunction(c.postInit)&&c.postInit(b);},initSlideshow:function(){var b,c=this.opts(),d=c.container;c.API.calcFirstSlide(),"static"==c.container.css("position")&&c.container.css("position","relative"),a(c.slides[c.currSlide]).css({opacity:1,display:"block",visibility:"visible"}),c.API.stackSlides(c.slides[c.currSlide],c.slides[c.nextSlide],!c.reverse),c.pauseOnHover&&(c.pauseOnHover!==!0&&(d=a(c.pauseOnHover)),d.hover(function(){c.API.pause(!0);},function(){c.API.resume(!0);})),c.timeout&&(b=c.API.getSlideOpts(c.currSlide),c.API.queueTransition(b,b.timeout+c.delay)),c._initialized=!0,c.API.updateView(!0),c.API.trigger("cycle-initialized",[c]),c.API.postInitSlideshow();},pause:function(b){var c=this.opts(),d=c.API.getSlideOpts(),e=c.hoverPaused||c.paused;b?c.hoverPaused=!0:c.paused=!0,e||(c.container.addClass("cycle-paused"),c.API.trigger("cycle-paused",[c]).log("cycle-paused"),d.timeout&&(clearTimeout(c.timeoutId),c.timeoutId=0,c._remainingTimeout-=a.now()-c._lastQueue,(c._remainingTimeout<0||isNaN(c._remainingTimeout))&&(c._remainingTimeout=void 0)));},resume:function(a){var b=this.opts(),c=!b.hoverPaused&&!b.paused;a?b.hoverPaused=!1:b.paused=!1,c||(b.container.removeClass("cycle-paused"),0===b.slides.filter(":animated").length&&b.API.queueTransition(b.API.getSlideOpts(),b._remainingTimeout),b.API.trigger("cycle-resumed",[b,b._remainingTimeout]).log("cycle-resumed"));},add:function(b,c){var d,e=this.opts(),f=e.slideCount,g=!1;"string"==a.type(b)&&(b=a.trim(b)),a(b).each(function(){var b,d=a(this);c?e.container.prepend(d):e.container.append(d),e.slideCount++,b=e.API.buildSlideOpts(d),e.slides=c?a(d).add(e.slides):e.slides.add(d),e.API.initSlide(b,d,--e._maxZ),d.data("cycle.opts",b),e.API.trigger("cycle-slide-added",[e,b,d]);}),e.API.updateView(!0),g=e._preInitialized&&2>f&&e.slideCount>=1,g&&(e._initialized?e.timeout&&(d=e.slides.length,e.nextSlide=e.reverse?d-1:1,e.timeoutId||e.API.queueTransition(e)):e.API.initSlideshow());},calcFirstSlide:function(){var a,b=this.opts();a=parseInt(b.startingSlide||0,10),(a>=b.slides.length||0>a)&&(a=0),b.currSlide=a,b.reverse?(b.nextSlide=a-1,b.nextSlide<0&&(b.nextSlide=b.slides.length-1)):(b.nextSlide=a+1,b.nextSlide==b.slides.length&&(b.nextSlide=0));},calcNextSlide:function(){var a,b=this.opts();b.reverse?(a=b.nextSlide-1<0,b.nextSlide=a?b.slideCount-1:b.nextSlide-1,b.currSlide=a?0:b.nextSlide+1):(a=b.nextSlide+1==b.slides.length,b.nextSlide=a?0:b.nextSlide+1,b.currSlide=a?b.slides.length-1:b.nextSlide-1);},calcTx:function(b,c){var d,e=b;return e._tempFx?d=a.fn.cycle.transitions[e._tempFx]:c&&e.manualFx&&(d=a.fn.cycle.transitions[e.manualFx]),d||(d=a.fn.cycle.transitions[e.fx]),e._tempFx=null,this.opts()._tempFx=null,d||(d=a.fn.cycle.transitions.fade,e.API.log('Transition "'+e.fx+'" not found. Using fade.')),d;},prepareTx:function(a,b){var c,d,e,f,g,h=this.opts();return h.slideCount<2?void (h.timeoutId=0):(!a||h.busy&&!h.manualTrump||(h.API.stopTransition(),h.busy=!1,clearTimeout(h.timeoutId),h.timeoutId=0),void (h.busy||(0!==h.timeoutId||a)&&(d=h.slides[h.currSlide],e=h.slides[h.nextSlide],f=h.API.getSlideOpts(h.nextSlide),g=h.API.calcTx(f,a),h._tx=g,a&&void 0!==f.manualSpeed&&(f.speed=f.manualSpeed),h.nextSlide!=h.currSlide&&(a||!h.paused&&!h.hoverPaused&&h.timeout)?(h.API.trigger("cycle-before",[f,d,e,b]),g.before&&g.before(f,d,e,b),c=function(){h.busy=!1,h.container.data("cycle.opts")&&(g.after&&g.after(f,d,e,b),h.API.trigger("cycle-after",[f,d,e,b]),h.API.queueTransition(f),h.API.updateView(!0));},h.busy=!0,g.transition?g.transition(f,d,e,b,c):h.API.doTransition(f,d,e,b,c),h.API.calcNextSlide(),h.API.updateView()):h.API.queueTransition(f))));},doTransition:function(b,c,d,e,f){var g=b,h=a(c),i=a(d),j=function(){i.animate(g.animIn||{opacity:1},g.speed,g.easeIn||g.easing,f);};i.css(g.cssBefore||{}),h.animate(g.animOut||{},g.speed,g.easeOut||g.easing,function(){h.css(g.cssAfter||{}),g.sync||j();}),g.sync&&j();},queueTransition:function(b,c){var d=this.opts(),e=void 0!==c?c:b.timeout;return 0===d.nextSlide&&0===--d.loop?(d.API.log("terminating; loop=0"),d.timeout=0,e?setTimeout(function(){d.API.trigger("cycle-finished",[d]);},e):d.API.trigger("cycle-finished",[d]),void (d.nextSlide=d.currSlide)):void 0!==d.continueAuto&&(d.continueAuto===!1||a.isFunction(d.continueAuto)&&d.continueAuto()===!1)?(d.API.log("terminating automatic transitions"),d.timeout=0,void (d.timeoutId&&clearTimeout(d.timeoutId))):void (e&&(d._lastQueue=a.now(),void 0===c&&(d._remainingTimeout=b.timeout),d.paused||d.hoverPaused||(d.timeoutId=setTimeout(function(){d.API.prepareTx(!1,!d.reverse);},e))));},stopTransition:function(){var a=this.opts();a.slides.filter(":animated").length&&(a.slides.stop(!1,!0),a.API.trigger("cycle-transition-stopped",[a])),a._tx&&a._tx.stopTransition&&a._tx.stopTransition(a);},advanceSlide:function(a){var b=this.opts();return clearTimeout(b.timeoutId),b.timeoutId=0,b.nextSlide=b.currSlide+a,b.nextSlide<0?b.nextSlide=b.slides.length-1:b.nextSlide>=b.slides.length&&(b.nextSlide=0),b.API.prepareTx(!0,a>=0),!1;},buildSlideOpts:function(c){var d,e,f=this.opts(),g=c.data()||{};for(var h in g)g.hasOwnProperty(h)&&/^cycle[A-Z]+/.test(h)&&(d=g[h],e=h.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,b),f.API.log("["+(f.slideCount-1)+"]",e+":",d,"("+typeof d+")"),g[e]=d);g=a.extend({},a.fn.cycle.defaults,f,g),g.slideNum=f.slideCount;try{delete g.API,delete g.slideCount,delete g.currSlide,delete g.nextSlide,delete g.slides;}catch(i){}return g;},getSlideOpts:function(b){var c=this.opts();void 0===b&&(b=c.currSlide);var d=c.slides[b],e=a(d).data("cycle.opts");return a.extend({},c,e);},initSlide:function(b,c,d){var e=this.opts();c.css(b.slideCss||{}),d>0&&c.css("zIndex",d),isNaN(b.speed)&&(b.speed=a.fx.speeds[b.speed]||a.fx.speeds._default),b.sync||(b.speed=b.speed/2),c.addClass(e.slideClass);},updateView:function(a,b){var c=this.opts();if(c._initialized){var d=c.API.getSlideOpts(),e=c.slides[c.currSlide];!a&&b!==!0&&(c.API.trigger("cycle-update-view-before",[c,d,e]),c.updateView<0)||(c.slideActiveClass&&c.slides.removeClass(c.slideActiveClass).eq(c.currSlide).addClass(c.slideActiveClass),a&&c.hideNonActive&&c.slides.filter(":not(."+c.slideActiveClass+")").css("visibility","hidden"),0===c.updateView&&setTimeout(function(){c.API.trigger("cycle-update-view",[c,d,e,a]);},d.speed/(c.sync?2:1)),0!==c.updateView&&c.API.trigger("cycle-update-view",[c,d,e,a]),a&&c.API.trigger("cycle-update-view-after",[c,d,e]));}},getComponent:function(b){var c=this.opts(),d=c[b];return "string"==typeof d?/^\s*[\>|\+|~]/.test(d)?c.container.find(d):a(d):d.jquery?d:a(d);},stackSlides:function(b,c,d){var e=this.opts();b||(b=e.slides[e.currSlide],c=e.slides[e.nextSlide],d=!e.reverse),a(b).css("zIndex",e.maxZ);var f,g=e.maxZ-2,h=e.slideCount;if(d){for(f=e.currSlide+1;h>f;f++)a(e.slides[f]).css("zIndex",g--);for(f=0;f=0;f--)a(e.slides[f]).css("zIndex",g--);for(f=h-1;f>e.currSlide;f--)a(e.slides[f]).css("zIndex",g--);}a(c).css("zIndex",e.maxZ-1);},getSlideIndex:function(a){return this.opts().slides.index(a);}},a.fn.cycle.log=function(){window.console&&console.log&&console.log("[cycle2] "+Array.prototype.join.call(arguments," "));},a.fn.cycle.version=function(){return "Cycle2: "+c;},a.fn.cycle.transitions={custom:{},none:{before:function(a,b,c,d){a.API.stackSlides(c,b,d),a.cssBefore={opacity:1,visibility:"visible",display:"block"};}},fade:{before:function(b,c,d,e){var f=b.API.getSlideOpts(b.nextSlide).slideCss||{};b.API.stackSlides(c,d,e),b.cssBefore=a.extend(f,{opacity:0,visibility:"visible",display:"block"}),b.animIn={opacity:1},b.animOut={opacity:0};}},fadeout:{before:function(b,c,d,e){var f=b.API.getSlideOpts(b.nextSlide).slideCss||{};b.API.stackSlides(c,d,e),b.cssBefore=a.extend(f,{opacity:1,visibility:"visible",display:"block"}),b.animOut={opacity:0};}},scrollHorz:{before:function(a,b,c,d){a.API.stackSlides(b,c,d);var e=a.container.css("overflow","hidden").width();a.cssBefore={left:d?e:-e,top:0,opacity:1,visibility:"visible",display:"block"},a.cssAfter={zIndex:a._maxZ-2,left:0},a.animIn={left:0},a.animOut={left:d?-e:e};}}},a.fn.cycle.defaults={allowWrap:!0,autoSelector:".cycle-slideshow[data-cycle-auto-init!=false]",delay:0,easing:null,fx:"fade",hideNonActive:!0,loop:0,manualFx:void 0,manualSpeed:void 0,manualTrump:!0,maxZ:100,pauseOnHover:!1,reverse:!1,slideActiveClass:"cycle-slide-active",slideClass:"cycle-slide",slideCss:{position:"absolute",top:0,left:0},slides:"> img",speed:500,startingSlide:0,sync:!0,timeout:4e3,updateView:0},a(document).ready(function(){a(a.fn.cycle.defaults.autoSelector).cycle();});}(jQuery),function(a){"use strict";function b(b,d){var e,f,g,h=d.autoHeight;if("container"==h)f=a(d.slides[d.currSlide]).outerHeight(),d.container.height(f);else if(d._autoHeightRatio)d.container.height(d.container.width()/d._autoHeightRatio);else{if("calc"===h||"number"==a.type(h)&&h>=0){if(g="calc"===h?c(b,d):h>=d.slides.length?0:h,g==d._sentinelIndex)return;d._sentinelIndex=g,d._sentinel&&d._sentinel.remove(),e=a(d.slides[g].cloneNode(!0)),e.removeAttr("id name rel").find("[id],[name],[rel]").removeAttr("id name rel"),e.css({position:"static",visibility:"hidden",display:"block"}).prependTo(d.container).addClass("cycle-sentinel cycle-slide").removeClass("cycle-slide-active"),e.find("*").css("visibility","hidden"),d._sentinel=e;}}}function c(b,c){var d=0,e=-1;return c.slides.each(function(b){var c=a(this).height();c>e&&(e=c,d=b);}),d;}function d(b,c,d,e){var f=a(e).outerHeight();c.container.animate({height:f},c.autoHeightSpeed,c.autoHeightEasing);}function e(c,f){f._autoHeightOnResize&&(a(window).off("resize orientationchange",f._autoHeightOnResize),f._autoHeightOnResize=null),f.container.off("cycle-slide-added cycle-slide-removed",b),f.container.off("cycle-destroyed",e),f.container.off("cycle-before",d),f._sentinel&&(f._sentinel.remove(),f._sentinel=null);}a.extend(a.fn.cycle.defaults,{autoHeight:0,autoHeightSpeed:250,autoHeightEasing:null}),a(document).on("cycle-initialized",function(c,f){function g(){b(c,f);}var h,i=f.autoHeight,j=a.type(i),k=null;("string"===j||"number"===j)&&(f.container.on("cycle-slide-added cycle-slide-removed",b),f.container.on("cycle-destroyed",e),"container"==i?f.container.on("cycle-before",d):"string"===j&&/\d+\:\d+/.test(i)&&(h=i.match(/(\d+)\:(\d+)/),h=h[1]/h[2],f._autoHeightRatio=h),"number"!==j&&(f._autoHeightOnResize=function(){clearTimeout(k),k=setTimeout(g,50);},a(window).on("resize orientationchange",f._autoHeightOnResize)),setTimeout(g,30));});}(jQuery),function(a){"use strict";a.extend(a.fn.cycle.defaults,{caption:"> .cycle-caption",captionTemplate:"{{slideNum}} / {{slideCount}}",overlay:"> .cycle-overlay",overlayTemplate:"{{title}}
{{desc}}
",captionModule:"caption"}),a(document).on("cycle-update-view",function(b,c,d,e){if("caption"===c.captionModule)a.each(["caption","overlay"],function(){var a=this,b=d[a+"Template"],f=c.API.getComponent(a);f.length&&b?(f.html(c.API.tmpl(b,d,c,e)),f.show()):f.hide();});}),a(document).on("cycle-destroyed",function(b,c){var d;a.each(["caption","overlay"],function(){var a=this,b=c[a+"Template"];c[a]&&b&&(d=c.API.getComponent("caption"),d.empty());});});}(jQuery),function(a){"use strict";var b=a.fn.cycle;a.fn.cycle=function(c){var d,e,f,g=a.makeArray(arguments);return "number"==a.type(c)?this.cycle("goto",c):"string"==a.type(c)?this.each(function(){var h;return d=c,f=a(this).data("cycle.opts"),void 0===f?void b.log('slideshow must be initialized before sending commands; "'+d+'" ignored'):(d="goto"==d?"jump":d,e=f.API[d],a.isFunction(e)?(h=a.makeArray(g),h.shift(),e.apply(f.API,h)):void b.log("unknown command: ",d));}):b.apply(this,arguments);},a.extend(a.fn.cycle,b),a.extend(b.API,{next:function(){var a=this.opts();if(!a.busy||a.manualTrump){var b=a.reverse?-1:1;a.allowWrap===!1&&a.currSlide+b>=a.slideCount||(a.API.advanceSlide(b),a.API.trigger("cycle-next",[a]).log("cycle-next"));}},prev:function(){var a=this.opts();if(!a.busy||a.manualTrump){var b=a.reverse?1:-1;a.allowWrap===!1&&a.currSlide+b<0||(a.API.advanceSlide(b),a.API.trigger("cycle-prev",[a]).log("cycle-prev"));}},destroy:function(){this.stop();var b=this.opts(),c=a.isFunction(a._data)?a._data:a.noop;clearTimeout(b.timeoutId),b.timeoutId=0,b.API.stop(),b.API.trigger("cycle-destroyed",[b]).log("cycle-destroyed"),b.container.removeData(),c(b.container[0],"parsedAttrs",!1),b.retainStylesOnDestroy||(b.container.removeAttr("style"),b.slides.removeAttr("style"),b.slides.removeClass(b.slideActiveClass)),b.slides.each(function(){var d=a(this);d.removeData(),d.removeClass(b.slideClass),c(this,"parsedAttrs",!1);});},jump:function(a,b){var c,d=this.opts();if(!d.busy||d.manualTrump){var e=parseInt(a,10);if(isNaN(e)||0>e||e>=d.slides.length)return void d.API.log("goto: invalid slide index: "+e);if(e==d.currSlide)return void d.API.log("goto: skipping, already on slide",e);d.nextSlide=e,clearTimeout(d.timeoutId),d.timeoutId=0,d.API.log("goto: ",e," (zero-index)"),c=d.currSlide .cycle-pager",pagerActiveClass:"cycle-pager-active",pagerEvent:"click.cycle",pagerEventBubble:void 0,pagerTemplate:"•"}),a(document).on("cycle-bootstrap",function(a,c,d){d.buildPagerLink=b;}),a(document).on("cycle-slide-added",function(a,b,d,e){b.pager&&(b.API.buildPagerLink(b,d,e),b.API.page=c);}),a(document).on("cycle-slide-removed",function(b,c,d){if(c.pager){var e=c.API.getComponent("pager");e.each(function(){var b=a(this);a(b.children()[d]).remove();});}}),a(document).on("cycle-update-view",function(b,c){var d;c.pager&&(d=c.API.getComponent("pager"),d.each(function(){a(this).children().removeClass(c.pagerActiveClass).eq(c.currSlide).addClass(c.pagerActiveClass);}));}),a(document).on("cycle-destroyed",function(a,b){var c=b.API.getComponent("pager");c&&(c.children().off(b.pagerEvent),b.pagerTemplate&&c.empty());});}(jQuery),function(a){"use strict";a.extend(a.fn.cycle.defaults,{next:"> .cycle-next",nextEvent:"click.cycle",disabledClass:"disabled",prev:"> .cycle-prev",prevEvent:"click.cycle",swipe:!1}),a(document).on("cycle-initialized",function(a,b){if(b.API.getComponent("next").on(b.nextEvent,function(a){a.preventDefault(),b.API.next();}),b.API.getComponent("prev").on(b.prevEvent,function(a){a.preventDefault(),b.API.prev();}),b.swipe){var c=b.swipeVert?"swipeUp.cycle":"swipeLeft.cycle swipeleft.cycle",d=b.swipeVert?"swipeDown.cycle":"swipeRight.cycle swiperight.cycle";b.container.on(c,function(){b._tempFx=b.swipeFx,b.API.next();}),b.container.on(d,function(){b._tempFx=b.swipeFx,b.API.prev();});}}),a(document).on("cycle-update-view",function(a,b){if(!b.allowWrap){var c=b.disabledClass,d=b.API.getComponent("next"),e=b.API.getComponent("prev"),f=b._prevBoundry||0,g=void 0!==b._nextBoundry?b._nextBoundry:b.slideCount-1;b.currSlide==g?d.addClass(c).prop("disabled",!0):d.removeClass(c).prop("disabled",!1),b.currSlide===f?e.addClass(c).prop("disabled",!0):e.removeClass(c).prop("disabled",!1);}}),a(document).on("cycle-destroyed",function(a,b){b.API.getComponent("prev").off(b.nextEvent),b.API.getComponent("next").off(b.prevEvent),b.container.off("swipeleft.cycle swiperight.cycle swipeLeft.cycle swipeRight.cycle swipeUp.cycle swipeDown.cycle");});}(jQuery),function(a){"use strict";a.extend(a.fn.cycle.defaults,{progressive:!1}),a(document).on("cycle-pre-initialize",function(b,c){if(c.progressive){var d,e,f=c.API,g=f.next,h=f.prev,i=f.prepareTx,j=a.type(c.progressive);if("array"==j)d=c.progressive;else if(a.isFunction(c.progressive))d=c.progressive(c);else{if("string"==j){if(e=a(c.progressive),d=a.trim(e.html()),!d)return;if(/^(\[)/.test(d))try{d=a.parseJSON(d);}catch(k){return void f.log("error parsing progressive slides",k);}else d=d.split(new RegExp(e.data("cycle-split")||"\n")),d[d.length-1]||d.pop();}}i&&(f.prepareTx=function(a,b){var e,f;return a||0===d.length?void i.apply(c.API,[a,b]):void (b&&c.currSlide==c.slideCount-1?(f=d[0],d=d.slice(1),c.container.one("cycle-slide-added",function(a,b){setTimeout(function(){b.API.advanceSlide(1);},50);}),c.API.add(f)):b||0!==c.currSlide?i.apply(c.API,[a,b]):(e=d.length-1,f=d[e],d=d.slice(0,e),c.container.one("cycle-slide-added",function(a,b){setTimeout(function(){b.currSlide=1,b.API.advanceSlide(-1);},50);}),c.API.add(f,!0)));}),g&&(f.next=function(){var a=this.opts();if(d.length&&a.currSlide==a.slideCount-1){var b=d[0];d=d.slice(1),a.container.one("cycle-slide-added",function(a,b){g.apply(b.API),b.container.removeClass("cycle-loading");}),a.container.addClass("cycle-loading"),a.API.add(b);}else g.apply(a.API);}),h&&(f.prev=function(){var a=this.opts();if(d.length&&0===a.currSlide){var b=d.length-1,c=d[b];d=d.slice(0,b),a.container.one("cycle-slide-added",function(a,b){b.currSlide=1,b.API.advanceSlide(-1),b.container.removeClass("cycle-loading");}),a.container.addClass("cycle-loading"),a.API.add(c,!0);}else h.apply(a.API);});}});}(jQuery),function(a){"use strict";a.extend(a.fn.cycle.defaults,{tmplRegex:"{{((.)?.*?)}}"}),a.extend(a.fn.cycle.API,{tmpl:function(b,c){var d=new RegExp(c.tmplRegex||a.fn.cycle.defaults.tmplRegex,"g"),e=a.makeArray(arguments);return e.shift(),b.replace(d,function(b,c){var d,f,g,h,i=c.split(".");for(d=0;d1)for(h=g,f=0;fthis._visitNode(node));let activeElement=document.activeElement;if(!document.body.contains(startNode)){let node=startNode;let root=undefined;while(node){if(node.nodeType===Node.DOCUMENT_FRAGMENT_NODE){root=(node);break;}node=node.parentNode;}if(root)activeElement=root.activeElement;}if(startNode.contains(activeElement)){activeElement.blur();if(activeElement===document.activeElement)document.body.focus();}}_visitNode(node){if(node.nodeType!==Node.ELEMENT_NODE)return;const element=(node);if(element!==this._rootElement&&element.hasAttribute('inert'))this._adoptInertRoot(element);if(matches.call(element,_focusableElementsString)||element.hasAttribute('tabindex'))this._manageNode(element);}_manageNode(node){const inertNode=this._inertManager.register(node,this);this._managedNodes.add(inertNode);}_unmanageNode(node){const inertNode=this._inertManager.deregister(node,this);if(inertNode)this._managedNodes.delete(inertNode);}_unmanageSubtree(startNode){composedTreeWalk(startNode,(node)=>this._unmanageNode(node));}_adoptInertRoot(node){let inertSubroot=this._inertManager.getInertRoot(node);if(!inertSubroot){this._inertManager.setInert(node,true);inertSubroot=this._inertManager.getInertRoot(node);}inertSubroot.managedNodes.forEach(function(savedInertNode){this._manageNode(savedInertNode.node);},this);}_onMutation(records,self){records.forEach(function(record){const target=(record.target);if(record.type==='childList'){slice.call(record.addedNodes).forEach(function(node){this._makeSubtreeUnfocusable(node);},this);slice.call(record.removedNodes).forEach(function(node){this._unmanageSubtree(node);},this);}else{if(record.type==='attributes')if(record.attributeName==='tabindex')this._manageNode(target);else{if(target!==this._rootElement&&record.attributeName==='inert'&&target.hasAttribute('inert')){this._adoptInertRoot(target);const inertSubroot=this._inertManager.getInertRoot(target);this._managedNodes.forEach(function(managedNode){if(target.contains(managedNode.node))inertSubroot._manageNode(managedNode.node);});}}}},this);}}class InertNode{constructor(node,inertRoot){this._node=node;this._overrodeFocusMethod=false;this._inertRoots=new Set([inertRoot]);this._savedTabIndex=null;this._destroyed=false;this.ensureUntabbable();}destructor(){this._throwIfDestroyed();if(this._node&&this._node.nodeType===Node.ELEMENT_NODE){const element=(this._node);if(this._savedTabIndex!==null)element.setAttribute('tabindex',this._savedTabIndex);else element.removeAttribute('tabindex');if(this._overrodeFocusMethod)delete element.focus;}this._node=(null);this._inertRoots=(null);this._destroyed=true;}get destroyed(){return (this)._destroyed;}_throwIfDestroyed(){if(this.destroyed)throw new Error('Trying to access destroyed InertNode');}get hasSavedTabIndex(){return this._savedTabIndex!==null;}get node(){this._throwIfDestroyed();return this._node;}set savedTabIndex(tabIndex){this._throwIfDestroyed();this._savedTabIndex=tabIndex;}get savedTabIndex(){this._throwIfDestroyed();return this._savedTabIndex;}ensureUntabbable(){if(this.node.nodeType!==Node.ELEMENT_NODE)return;const element=(this.node);if(matches.call(element,_focusableElementsString)){if((element).tabIndex===-1&&this.hasSavedTabIndex)return;if(element.hasAttribute('tabindex'))this._savedTabIndex=(element).tabIndex;element.setAttribute('tabindex','-1');if(element.nodeType===Node.ELEMENT_NODE){element.focus=function(){};this._overrodeFocusMethod=true;}}else{if(element.hasAttribute('tabindex')){this._savedTabIndex=(element).tabIndex;element.removeAttribute('tabindex');}}}addInertRoot(inertRoot){this._throwIfDestroyed();this._inertRoots.add(inertRoot);}removeInertRoot(inertRoot){this._throwIfDestroyed();this._inertRoots.delete(inertRoot);if(this._inertRoots.size===0)this.destructor();}}class InertManager{constructor(document){if(!document)throw new Error('Missing required argument; InertManager needs to wrap a document.');this._document=document;this._managedNodes=new Map();this._inertRoots=new Map();this._observer=new MutationObserver(this._watchForInert.bind(this));addInertStyle(document.head||document.body||document.documentElement);if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',this._onDocumentLoaded.bind(this));else this._onDocumentLoaded();}setInert(root,inert){if(inert){if(this._inertRoots.has(root))return;const inertRoot=new InertRoot(root,this);root.setAttribute('inert','');this._inertRoots.set(root,inertRoot);if(!this._document.body.contains(root)){let parent=root.parentNode;while(parent){if(parent.nodeType===11)addInertStyle(parent);parent=parent.parentNode;}}}else{if(!this._inertRoots.has(root))return;const inertRoot=this._inertRoots.get(root);inertRoot.destructor();this._inertRoots.delete(root);root.removeAttribute('inert');}}getInertRoot(element){return this._inertRoots.get(element);}register(node,inertRoot){let inertNode=this._managedNodes.get(node);if(inertNode!==undefined)inertNode.addInertRoot(inertRoot);else inertNode=new InertNode(node,inertRoot);this._managedNodes.set(node,inertNode);return inertNode;}deregister(node,inertRoot){const inertNode=this._managedNodes.get(node);if(!inertNode)return null;inertNode.removeInertRoot(inertRoot);if(inertNode.destroyed)this._managedNodes.delete(node);return inertNode;}_onDocumentLoaded(){const inertElements=slice.call(this._document.querySelectorAll('[inert]'));inertElements.forEach(function(inertElement){this.setInert(inertElement,true);},this);this._observer.observe(this._document.body||this._document.documentElement,{attributes:true,subtree:true,childList:true});}_watchForInert(records,self){const _this=this;records.forEach(function(record){switch(record.type){case 'childList':slice.call(record.addedNodes).forEach(function(node){if(node.nodeType!==Node.ELEMENT_NODE)return;const inertElements=slice.call(node.querySelectorAll('[inert]'));if(matches.call(node,'[inert]'))inertElements.unshift(node);inertElements.forEach(function(inertElement){this.setInert(inertElement,true);},_this);},_this);break;case 'attributes':{if(record.attributeName!=='inert')return;const target=(record.target);const inert=target.hasAttribute('inert');_this.setInert(target,inert);break;}}},this);}}function composedTreeWalk(node,callback,shadowRootAncestor){if(node.nodeType==Node.ELEMENT_NODE){const element=(node);if(callback)callback(element);const shadowRoot=(element).shadowRoot;if(shadowRoot){composedTreeWalk(shadowRoot,callback,shadowRoot);return;}if(element.localName=='content'){const content=(element);const distributedNodes=content.getDistributedNodes?content.getDistributedNodes():[];for(let i=0;i{const iframeContentWindow=iframeVideo.contentWindow;let nestedOembedIframe=iframeContentWindow.document.querySelector('.oembed-media iframe');if(!nestedOembedIframe)return;onYoutubeIframeAPIReady(nestedOembedIframe);});},(autoPlaySpd/checkYTFrequency));$(document).ready(function(){let totalSlides=context.querySelectorAll('.slick-dots li').length;let stopAfterCycles=2;setTimeout(function(){clearInterval(checkedForLoadedYTVideo);},(totalSlides*autoPlaySpd*stopAfterCycles));});function pauseVideo(){if(iframeVideos.length<1)return;iframeVideos.forEach((iframeVideo)=>{const iframeContentWindow=iframeVideo.contentWindow;let nestedOembedIframe=iframeContentWindow.document.querySelector('.oembed-media iframe');if(!nestedOembedIframe)return;const nestedOembedIframeContentWindow=nestedOembedIframe.contentWindow;nestedOembedIframeContentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}','*');});}var stopObserver=false;setTimeout(function(){stopObserver=true;},120000);const main=document.querySelector("main");let mobileObserver,$firstVideo,$slideHeight,$useImage;var $dots=$('.hero-slideshow-slick .slick-dots');let $arrows=$('.hero-slideshow-slick .slick-arrow');let $firstImage=$('.hero-slideshow-slick .slick-track .hero-image').first();let $imageHeight=$firstImage.height();if($imageHeight)$useImage=true;else{$firstVideo=$('.hero-slideshow-slick .slick-track .field_media_oembed_video iframe').first();$useImage=false;}const observer=new ResizeObserver((entries)=>{if(stopObserver===true)return;let mainEl=entries[0];mobileObserver=mainEl.contentRect.width<880;if(mobileObserver){if($useImage)$slideHeight=$imageHeight;else $slideHeight=$firstVideo.height();$arrows.css("top",$slideHeight-50);$dots.css("top",$slideHeight);}else{$arrows.css("top","50%");$dots.css("top","initial");}});observer.observe(main);}if($(".slides-slideshow")[0])$('.slides-slideshow').slick({infinite:true,dots:true,arrows:false,slidesToShow:3,slidesToScroll:3,responsive:[{breakpoint:880,settings:{slidesToShow:1,slidesToScroll:1}}]});if($(".most-wanted-view")[0]){var $mostWantedSlider=$('.most-wanted-view .item-list');$('ul',$mostWantedSlider).slick({infinite:true,dots:true,arrows:false,slidesToShow:3,slidesToScroll:3,responsive:[{breakpoint:880,settings:{slidesToShow:2,slidesToScroll:2}},{breakpoint:480,settings:{slidesToShow:1,slidesToScroll:1}}]});$mostWantedSlider.each(function(e){const $tablist=$('.slick-dots',this);$(this).remove('.slick-dots');$(this).prepend($tablist);});$mostWantedSlider.on('afterChange',function(slick,currentSlide){const $tablist=$('.slick-dots',this);$tablist.not('.slick-active button').prop('tabindex',-1);});}if($('.paragraph--type--tab .field__items.multiple-cards')[0]){var $cards=$('.paragraph--type--tab .field__items.multiple-cards');$cards.slick({dots:true,infinite:false,prevArrow:false,nextArrow:false,slidesToShow:3,slidesToScroll:3,responsive:[{breakpoint:880,settings:{slidesToShow:1,slidesToScroll:1}}]});$cards.each(function(){if($(this).find('.slick-slide').length>3)$(this).addClass('more-than-three');var $thisSlider=$(this);var $activeCards=$thisSlider.find('.slick-slide.slick-active');var $firstCard=$activeCards.first();var $lastCard=$activeCards.last();$firstCard.css('left','4px');$lastCard.css('right','4px');$thisSlider.on('afterChange',function(slick,currentSlide){setTimeout(function(){$activeCards=$thisSlider.find('.slick-slide.slick-active');$activeCards.first().css('left','4px');$activeCards.last().css('right','4px');$activeCards.prop("tabindex",0);},100);});});}}};Drupal.behaviors.imageGalleryInit={attach:function(context,settings){once('imageGalleryInit','html',context).forEach(function(element){var $gallery=$('.image-gallery-node .slick');var $galleryTitle=$('.image-gallery-node h1').first().html();setTimeout(function(){var $colorbox=$('#colorbox');$colorbox.prepend(""+$galleryTitle+"
");},1000);var totalImages=$gallery.attr('data-slick-count');setTimeout(function(){var $slide=$gallery.find('.slick-current');$slide.append(""+totalImages+"
");},100);});}};Drupal.behaviors.loadMoreItemsInit={attach:function(context,settings){once('loadMoreItems','html',context).forEach(function(element){var $button=$('.layout--onecol .action-center-cta button');var $shownItems=$('.layout--onecol .action-center-items .action-icon-shown');var $itemsWrapper=$('.layout--onecol .action-center-items .action-icons');var $allItems=$('.layout--onecol .action-center-items .action-icons >.field__item');var $hiddenItems=$('.layout--onecol .action-center-items .action-icon-hidden');var $allItemsSecondary=$('.layout--twocol-section .action-center-items .action-icons >.field__item');var $hiddenItemsSeconary=$('.layout--twocol-section .action-center-items .action-icon-hidden');var $shownItemsSecondary=$('.layout--twocol-section .action-center-items .action-icon-shown');var $itemsWrapperSecondary=$('.layout--twocol-section .action-center-items .action-icons');var $buttonSecondary=$('.layout--twocol-section .action-center-cta button');actionItemsPrep($itemsWrapper,$shownItems,$button,$hiddenItems,$allItems,3);actionItemsPrep($itemsWrapperSecondary,$shownItemsSecondary,$buttonSecondary,$hiddenItemsSeconary,$allItemsSecondary,2);function actionItemsPrep($itemsWrapper,$shownItems,$button,$hiddenItems,$allItems,$columns){if($(window).width()>=880){var iconsHeight=$itemsWrapper.height();$itemsWrapper.css({"max-height":iconsHeight});var lastRow=$shownItems.length%$columns;if($columns==3)switch(lastRow){case 0:$shownItems.last().addClass("no-border");$shownItems.eq(-2).addClass("no-border");$shownItems.eq(-3).addClass("no-border");break;case 1:$shownItems.last().addClass("no-border");break;default:$shownItems.last().addClass("no-border");$shownItems.eq(-2).addClass("no-border");}else switch(lastRow){case 1:$shownItems.last().addClass("no-border");break;default:$shownItems.last().addClass("no-border");$shownItems.eq(-2).addClass("no-border");}}$button.click(function(){$hiddenItems.removeClass('action-icon-hidden');$(this).attr("disabled",true);if($(window).width()>=880){$('.action-icons').css({"max-height":3000});$allItems.removeClass("no-border");}});}});}};Drupal.behaviors.moveSitewideAlert={attach:function(context,settings){once('moveSiteWideAlert','html',context).forEach(function(element){var $alert=$('div[data-sitewide-alert]');var $block=$('#block-officialwebsiteblock');if($alert[0])$alert.insertAfter($block);});}};Drupal.behaviors.featuredGroupExpand={attach:function(context,settings){once('featuredGroupExpand','html',context).forEach(function(element){if($(".block-featured_group_content.usa-accordion")[0]){var $allGroups=$('.block-featured_group_content.usa-accordion');var $allHeadings=$allGroups.find(".usa-accordion__button");var $firstGroup=$allGroups.first();var $buttonHTML="";$firstGroup.children('.usa-accordion__item').before($buttonHTML);var $button=$('.featured-group-expand-button');$button.click(function(){if($(this).attr("aria-expanded")==="false"){$button.text("[Collapse All -]");$(this).attr("aria-expanded","true");$allGroups.find(".usa-accordion__content").removeAttr("hidden");$allHeadings.attr("aria-expanded","true");}else{$button.text("[Expand All +]");$(this).attr("aria-expanded","false");$allGroups.find(".usa-accordion__content").attr("hidden","true");$allHeadings.attr("aria-expanded","false");}});}});}};Drupal.behaviors.hideTeaserImage={attach:function(context,settings){if($(".related-content-display")[0]){var $teaserType=$(".related-content-display .views-field-type");$teaserType.each(function(){var $typeText=$.trim($(this).text());if($typeText==='Video')$(this).siblings('.views-field-field-image').addClass('video-image');});};}};Drupal.behaviors.activeBookItem={attach:function(context,settings){once('activeBookItem','html',context).forEach(function(element){if($(".block-book-navigation .book-level2")[0]){var currentUrl=window.location.pathname;var $links=$(".block-book-navigation .book-level2 li a");var $parentPage;$links.each(function(){var $currLink=$(this);if($currLink.attr("href")===currentUrl){$currLink.addClass("active");$parentPage=$currLink.closest("ul").siblings("a").addClass("active");}});}});}};Drupal.behaviors.moveBookAttachments={attach:function(context,settings){once('moveBookAttachments','html',context).forEach(function(element){if($(".book-page .node-attachments")[0]){let $attachments=$(".book-page .node-attachments");let $bookNavBottom=$(".book-page .book-navigation-bottom");$attachments.insertBefore($bookNavBottom);}});}};Drupal.behaviors.copyViewTitle={attach:function(context,settings){once('copyViewTitle','html',context).forEach(function(element){const viewTitleOrig=context.querySelector('.views-title.copy-source');const viewTitleDest=context.querySelector('.views-title.copy-destination');if(!viewTitleOrig)return;viewTitleDest.textContent=viewTitleOrig.textContent;});}};Drupal.behaviors.scrollFadeIn={attach:function(context,settings){once('scrollFadeIn','html',context).forEach(function(element){let $scrollButton=$('.return-to-top');window.onscroll=function(){if(document.documentElement.scrollTop>300)$scrollButton.addClass('fade-in');else $scrollButton.removeClass('fade-in');};});}};Drupal.behaviors.ajaxFormReset={attach:function(context,settings){once('ajaxFormReset','#views-exposed-form-us-trustee-imports-credit-counseling-block, #views-exposed-form-us-trustee-imports-debt-education-block',context).forEach(function(exposedAjaxForm){$('input[data-drupal-selector="edit-reset"]').each(function(e){$(this).on('click',function(event){event.preventDefault();let $form=$(this).closest('form');$form.find('input[type=text], textarea').val('');$form.find('select').val('All').trigger("chosen:updated");$form.find('input[type="submit"]').first().click();});});});}};$('input#edit-start-date, input#edit-end-date').attr('placeholder','mm/dd/yyyy');$('a.keyword-form').click(function(){$('#views-exposed-form-news-page-1').submit();});$('select[name="sort_by"]').change(function(){$('#views-exposed-form-news-page-1').submit();$('#views-exposed-form-news-usdoj-news-list-block').submit();$('#views-exposed-form-court-decision-list-court-decision-lists').submit();$('#views-exposed-form-opinions-opinions-list').submit();$('#views-exposed-form-cases-index-cases-index-list').submit();$('#views-exposed-form-publications-block-1').submit();$('#views-exposed-form-vacancy-announcements-block-1').submit();$('#views-exposed-form-resources-index-resources-index-list').submit();});$('input#expand').click(function(){$('button.usa-accordion__button').attr('aria-expanded','true');$('.usa-accordion__content').removeAttr('hidden');});Drupal.behaviors.setImgWidth={attach:function(context,settings){once('setImgWidth','.field_body figure img, .block-body figure img, .field_body_left figure img, .field_header_body figure img, .field_footer_body figure img',context).forEach(function(element){const width=$(element).attr('width');$(element).closest('figure').css('width',`${width}px`);var $closestFigure=$(element).closest('figure');var $closestFigcaption=$closestFigure.find('figcaption');$closestFigcaption.css('width',`${width}px`);});}};Drupal.behaviors.replaceToolTipText={attach:function(context,settings){once('replaceToolTipText','html',context).forEach(function(element){const removeToolTipText=(header)=>{let text=header.textContent;let indexOfText=text.search(/ is the tooltip text/);if(indexOfText<0)return;let indexRemoval=indexOfText-4;text=text.slice(0,indexRemoval)+text.slice(indexOfText);text=text.replace(/ is the tooltip text/,"");header.textContent=text;};window.addEventListener('DOMContentLoaded',(event)=>{const ckEditorAccordionHeaders=context.querySelectorAll('.ckeditor-accordion-toggler');if(!ckEditorAccordionHeaders)return;ckEditorAccordionHeaders.forEach((header)=>{removeToolTipText(header);});});});}};Drupal.behaviors.viewTableCssRemove={attach:function(context,settings){once('viewTableCssRemove','html',context).forEach(function(element){if(document.getElementsByClassName('usa-table-wrapper')[0])if(!document.getElementsByClassName('usa-table-wrapper')[0].closest('.views-vacancy-page'))document.getElementsByClassName('usa-table-wrapper')[0].closest('.grid-row').classList.remove('grid-row');});}};Drupal.behaviors.youtubeThumbAlt={attach:function(context,settings){once('youtubeThumbAlt','html',context).forEach(function(element){const newsViews=context.querySelectorAll('.related-content-display');if(!newsViews.length)return;newsViews.forEach((view)=>addAltTag(view));function addAltTag(view){const youTubeThumbs=view.querySelectorAll('.video-image IMG');if(!youTubeThumbs.length)return;youTubeThumbs.forEach((thumb)=>{const newsItemWrapper=thumb.closest('.views-col');const newsNodeTitle=newsItemWrapper.querySelector('.views-field-title A');const altText=`Video thumbnail preview, ${newsNodeTitle.textContent}`;if(!thumb.getAttribute('alt')){thumb.setAttribute('alt',altText);thumb.setAttribute('title',altText);}});}});}};Drupal.behaviors.addClassToInlineNewsBlock={attach:function(context,settings){let newsGridBlocks=context.querySelectorAll('.news-block-wrp');let newsListBlocks=context.querySelectorAll('.news-list-block-wrp');const allNewsBlocks=[...newsGridBlocks,...newsListBlocks];if(!allNewsBlocks.length)return;allNewsBlocks.forEach((newsBlock)=>{const parentWrapper=newsBlock.closest('.block-inline-blocknews, .block-inline-blockevents');if(newsBlock.classList.contains('news-block-wrp'))parentWrapper.classList.add('parent-news-block-wrp');if(newsBlock.classList.contains('news-list-block-wrp'))parentWrapper.classList.add('parent-news-list-block-wrp');});}};Drupal.behaviors.highlightSearch={attach:function(context,settings){once('highlightSearch','html',context).forEach(function(element){const keyword_input=document.getElementsByClassName('keyword-search')[0];if(keyword_input){const keywords=document.getElementsByClassName('keyword-search')[0].getElementsByTagName('input')[0].value;const keyword_array=keywords.split(' ');keyword_array.forEach((keyword)=>{if(keyword.length>1){if(document.getElementsByClassName('news-search')[0]){const news_rows=document.getElementsByClassName('news-search')[0].getElementsByClassName('views-row');for(let i=0;i{const reg=new RegExp(keyword,'gi');const title=row.getElementsByClassName(title_element)[0].getElementsByTagName('span')[0].innerHTML;const title_highlighted=title.replace(reg,function(str){return ''+str+'';});row.getElementsByClassName(title_element)[0].getElementsByTagName('span')[0].innerHTML=title_highlighted;if(content_element){const summary=row.getElementsByClassName(content_element)[0].getElementsByTagName('p')[0].innerHTML;const summary_highlighted=summary.replace(reg,function(str){return ''+str+'';});row.getElementsByClassName(content_element)[0].getElementsByTagName('p')[0].innerHTML=summary_highlighted;}};$('.panels .block-tab').click(function(){$(this).parent().siblings('.panel-title').children('button').attr('aria-selected','false');$(this).attr('aria-selected','true');var $id=$(this).attr('id');var $title=$('.panels .block-tab');var $panel=$('.panels .panel-content');$title.attr("tabindex",-1);$(this).attr("tabindex",0);if($title.hasClass('active')){$title.removeClass('active');$panel.removeClass('active');}$panel.attr('hidden',true);$(this).addClass('active');$('#'+$id+'-body').addClass('active').removeAttr('hidden');});Drupal.behaviors.tabArrow={attach:function(context,settings){once('tabArrow','html',context).forEach(function(element){if(document.getElementsByClassName('block-tabbed')[0]||document.getElementsByClassName('block-tabbed_view')[0]){const tabs=document.getElementsByClassName('panel-titles')[0].querySelectorAll('[role="tab"]');const tabList=document.getElementsByClassName('panel-titles');let tabFocus=0;tabs.forEach((tab)=>{tab.addEventListener("click",(e)=>{let current_index=e.target.id.split('').slice(-1)[0];tabFocus=current_index-1;});tab.addEventListener("keydown",(e)=>{if(e.keyCode===13)changeTabs(e);});});tabList[0].addEventListener("keydown",(e)=>{if(e.keyCode===39||e.keyCode===37){tabs[tabFocus].getElementsByClassName('block-tab')[0].setAttribute("dex",-1);if(e.keyCode===39){tabFocus++;if(tabFocus>=tabs.length)tabFocus=0;}else{if(e.keyCode===37){tabFocus--;if(tabFocus<0)tabFocus=tabs.length-1;}}tabs[tabFocus].getElementsByClassName('block-tab')[0].setAttribute("tabindex",0);tabs[tabFocus].getElementsByClassName('block-tab')[0].focus();}});}function changeTabs(e){const target=e.target;const parent=target.parentNode;const grandparent=parent.parentNode;parent.querySelectorAll('[aria-selected="true"]').forEach((t)=>t.setAttribute("aria-selected",false));parent.querySelectorAll('button').forEach((t)=>t.classList.remove('active'));target.getElementsByClassName('block-tab')[0].classList.add('active');target.setAttribute("aria-selected",true);grandparent.querySelectorAll(".panel-bodies>.field__item").forEach((p)=>{p.getElementsByClassName('panel-content')[0].setAttribute("hidden",true);p.getElementsByClassName('panel-content')[0].classList.remove('active');});let target_id=target.getElementsByClassName('block-tab')[0].getAttribute('id');grandparent.querySelectorAll(".panel-bodies>.field__item").forEach((t)=>{if(t.getAttribute('aria-labelledby')==target_id){t.getElementsByClassName('panel-content')[0].classList.add('active');t.getElementsByClassName('panel-content')[0].removeAttribute("hidden");}});}});}};Drupal.behaviors.linkedMenuTitle={attach:function(context,settings){const currentLocation=window.location.pathname;once('linkedMenuTitle','html',context).forEach(function(element){if(document.getElementsByClassName('group-menu-title')[0]||document.getElementsByClassName('linked-menu-title')[0]){const groupMenuTitle=document.getElementsByClassName('group-menu-title')[0];if(groupMenuTitle.getAttribute("href")===currentLocation)groupMenuTitle.removeAttribute("href");const groupMenutitleButton=groupMenuTitle.getElementsByClassName('usa-accordion__button')[0];const menuId=groupMenutitleButton.getAttribute('aria-controls');const menuContent=document.getElementById(menuId);groupMenutitleButton.addEventListener('click',(e)=>{groupMenuTitle.classList.toggle('menu-open');groupMenutitleButton.ariaExpanded=groupMenutitleButton.ariaExpanded!=='true';menuContent.hidden=!menuContent.hidden;e.preventDefault();e.stopPropagation();});}});}};Drupal.behaviors.orgListOrder={attach:function(context,settings){once('orgListOrder','html',context).forEach(function(element){if(document.getElementById('org-list')){const orgChartWrapper=document.getElementById('org-list');const orgChartList=orgChartWrapper.getElementsByClassName('organization-list');const subjectsArray=Array.from(orgChartList);const sorted=subjectsArray.sort(comparator);sorted.forEach((e)=>orgChartWrapper.appendChild(e));function comparator(a,b){if(a.titleb.title)return 1;return 0;}}});}};Drupal.behaviors.listTypeStyle={attach:function(context,settings){once('listTypeStyle','ol',context).forEach(function(element){if($(element).prop('type'))switch($(element).prop('type')){case 'A':$(element).css("list-style-type","upper-alpha");break;case 'a':$(element).css("list-style-type","lower-alpha");break;case 'i':$(element).css("list-style-type","lower-roman");break;case 'I':$(element).css("list-style-type","upper-roman");break;case '1':$(element).css("list-style-type","decimal");break;}});}};Drupal.behaviors.scrollQuickExit={attach:function(context,settings){once('scrollQuickExit','html',context).forEach(function(element){const throttleTimeout=250;let stickyAdded=false;const $quickExitContainer=$('.field_exit_link');const $quickExitButton=$('a',$quickExitContainer);function throttle(callback,limit){var wait=false;var initialRun=false;return function(){if(!wait){if(!initialRun){callback.apply(this,arguments);initialRun=true;}wait=true;setTimeout(function(){if(wait)callback.apply(this,arguments);wait=false;},limit);}};}const updatePosition=throttle(function(){let containerOffset=$quickExitContainer.length?$quickExitContainer.offset().top:0;if($(window).scrollTop()>containerOffset){if(!stickyAdded){$quickExitButton.addClass('sticky');stickyAdded=true;}}else{if(stickyAdded){$quickExitButton.removeClass('sticky');stickyAdded=false;}}},throttleTimeout);updatePosition();$(window).on('scroll',updatePosition);$(window).on('resize',updatePosition);});}};})(jQuery);;
(function($,Drupal){Drupal.behaviors.pauseSlideshowOnPagerClick={attach:function(context,settings){var selector='.views-slideshow-pager-bullets li';var $items=$(selector,context);$items.off('click.pauseSlideshow');$items.on('click.pauseSlideshow',function(){$('#views_slideshow_cycle_teaser_section_news-usdoj_news_hero_block').cycle('pause');});}};})(jQuery,Drupal);;
(function(Drupal){Drupal.behaviors.makeSlideClickable={attach:function(context,settings){var slides=context.querySelectorAll?context.querySelectorAll('.views_slideshow_cycle_slide:not([data-clickable])'):[];slides.forEach(function(slide,idx){slide.setAttribute('data-clickable','true');var titleLink=slide.querySelector('.views-row a');if(!titleLink){console.warn(' ⚠️ No found in .views-row for this slide, skipping',slide);return;}slide.style.cursor='pointer';slide.addEventListener('click',function(e){if(e.target.closest('a,button,input'))return;window.location.href=titleLink.href;});});}};})(Drupal);;
(function(Drupal){Drupal.behaviors.snapPagerUnderImage={attach:function(context,settings){if(typeof window.matchMedia!=='function'||!window.matchMedia('(max-width: 767px)').matches)return;const slideMains=once('snapPager','.views_slideshow_cycle_main',context);slideMains.forEach((slideMain,idx)=>{const parent=slideMain.parentElement;const imgWrap=slideMain.querySelector('.views-field-field-image');const bullets=parent.querySelector('.views-slideshow-pager-bullets');if(!imgWrap||!bullets){console.warn(`[snapPager][#${idx}] missing elements: imgWrap? ${!!imgWrap}, bullets? ${!!bullets}`);return;}if(getComputedStyle(parent).position==='static')parent.style.position='relative';Object.assign(bullets.style,{position:'absolute',left:'0',width:'100%'});const ro=new ResizeObserver((entries)=>{const imgH=imgWrap.getBoundingClientRect().height;bullets.style.top=imgH+'px';});ro.observe(parent);});}};})(Drupal);;